kanna-code 0.19.0 → 0.21.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/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/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/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-B-8fHyaU.css +32 -0
- package/dist/client/assets/index-DrUC3AGz.js +2502 -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/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/pierre-dark-DF2SEV7i.js +1 -0
- package/dist/client/assets/pierre-light-DOlZxES8.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/index.html +2 -2
- package/package.json +2 -1
- package/src/server/agent.test.ts +589 -1
- package/src/server/agent.ts +459 -22
- package/src/server/codex-app-server-protocol.ts +28 -0
- package/src/server/codex-app-server.test.ts +88 -0
- package/src/server/codex-app-server.ts +71 -1
- package/src/server/diff-store.test.ts +126 -0
- package/src/server/diff-store.ts +365 -0
- package/src/server/generate-commit-message.test.ts +59 -0
- package/src/server/generate-commit-message.ts +121 -0
- package/src/server/read-models.test.ts +1 -1
- package/src/server/read-models.ts +6 -1
- package/src/server/server.ts +60 -1
- package/src/server/terminal-manager.test.ts +37 -4
- package/src/server/uploads.ts +4 -0
- package/src/server/ws-router.test.ts +5 -5
- package/src/server/ws-router.ts +125 -7
- package/src/shared/protocol.ts +4 -0
- package/src/shared/types.ts +51 -0
- package/dist/client/assets/index-C952_xJD.css +0 -32
- package/dist/client/assets/index-lgfU0zw2.js +0 -606
|
@@ -1,606 +0,0 @@
|
|
|
1
|
-
var NO=Object.defineProperty;var QS=e=>{throw TypeError(e)};var AO=(e,t,n)=>t in e?NO(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var fn=(e,t,n)=>AO(e,typeof t!="symbol"?t+"":t,n),JS=(e,t,n)=>t.has(e)||QS("Cannot "+n);var Fc=(e,t,n)=>(JS(e,t,"read from private field"),n?n.call(e):t.get(e)),eC=(e,t,n)=>t.has(e)?QS("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),tC=(e,t,n,r)=>(JS(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);function DO(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in e)){const a=Object.getOwnPropertyDescriptor(r,s);a&&Object.defineProperty(e,s,a.get?a:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const a of s)if(a.type==="childList")for(const l of a.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(s){const a={};return s.integrity&&(a.integrity=s.integrity),s.referrerPolicy&&(a.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?a.credentials="include":s.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(s){if(s.ep)return;s.ep=!0;const a=n(s);fetch(s.href,a)}})();function dp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var av={exports:{}},Uc={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react-jsx-runtime.production.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var nC;function OO(){if(nC)return Uc;nC=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,s,a){var l=null;if(a!==void 0&&(l=""+a),s.key!==void 0&&(l=""+s.key),"key"in s){a={};for(var u in s)u!=="key"&&(a[u]=s[u])}else a=s;return s=a.ref,{$$typeof:e,type:r,key:l,ref:s!==void 0?s:null,props:a}}return Uc.Fragment=t,Uc.jsx=n,Uc.jsxs=n,Uc}var rC;function jO(){return rC||(rC=1,av.exports=OO()),av.exports}var p=jO(),lv={exports:{}},qe={};/**
|
|
10
|
-
* @license React
|
|
11
|
-
* react.production.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var iC;function LO(){if(iC)return qe;iC=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),_=Symbol.iterator;function b(I){return I===null||typeof I!="object"?null:(I=_&&I[_]||I["@@iterator"],typeof I=="function"?I:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,C={};function k(I,Z,j){this.props=I,this.context=Z,this.refs=C,this.updater=j||w}k.prototype.isReactComponent={},k.prototype.setState=function(I,Z){if(typeof I!="object"&&typeof I!="function"&&I!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,I,Z,"setState")},k.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function R(){}R.prototype=k.prototype;function T(I,Z,j){this.props=I,this.context=Z,this.refs=C,this.updater=j||w}var N=T.prototype=new R;N.constructor=T,S(N,k.prototype),N.isPureReactComponent=!0;var L=Array.isArray;function A(){}var O={H:null,A:null,T:null,S:null},F=Object.prototype.hasOwnProperty;function G(I,Z,j){var ce=j.ref;return{$$typeof:e,type:I,key:Z,ref:ce!==void 0?ce:null,props:j}}function B(I,Z){return G(I.type,Z,I.props)}function H(I){return typeof I=="object"&&I!==null&&I.$$typeof===e}function P(I){var Z={"=":"=0",":":"=2"};return"$"+I.replace(/[=:]/g,function(j){return Z[j]})}var U=/\/+/g;function V(I,Z){return typeof I=="object"&&I!==null&&I.key!=null?P(""+I.key):Z.toString(36)}function W(I){switch(I.status){case"fulfilled":return I.value;case"rejected":throw I.reason;default:switch(typeof I.status=="string"?I.then(A,A):(I.status="pending",I.then(function(Z){I.status==="pending"&&(I.status="fulfilled",I.value=Z)},function(Z){I.status==="pending"&&(I.status="rejected",I.reason=Z)})),I.status){case"fulfilled":return I.value;case"rejected":throw I.reason}}throw I}function z(I,Z,j,ce,fe){var ue=typeof I;(ue==="undefined"||ue==="boolean")&&(I=null);var de=!1;if(I===null)de=!0;else switch(ue){case"bigint":case"string":case"number":de=!0;break;case"object":switch(I.$$typeof){case e:case t:de=!0;break;case m:return de=I._init,z(de(I._payload),Z,j,ce,fe)}}if(de)return fe=fe(I),de=ce===""?"."+V(I,0):ce,L(fe)?(j="",de!=null&&(j=de.replace(U,"$&/")+"/"),z(fe,Z,j,"",function(be){return be})):fe!=null&&(H(fe)&&(fe=B(fe,j+(fe.key==null||I&&I.key===fe.key?"":(""+fe.key).replace(U,"$&/")+"/")+de)),Z.push(fe)),1;de=0;var we=ce===""?".":ce+":";if(L(I))for(var oe=0;oe<I.length;oe++)ce=I[oe],ue=we+V(ce,oe),de+=z(ce,Z,j,ue,fe);else if(oe=b(I),typeof oe=="function")for(I=oe.call(I),oe=0;!(ce=I.next()).done;)ce=ce.value,ue=we+V(ce,oe++),de+=z(ce,Z,j,ue,fe);else if(ue==="object"){if(typeof I.then=="function")return z(W(I),Z,j,ce,fe);throw Z=String(I),Error("Objects are not valid as a React child (found: "+(Z==="[object Object]"?"object with keys {"+Object.keys(I).join(", ")+"}":Z)+"). If you meant to render a collection of children, use an array instead.")}return de}function $(I,Z,j){if(I==null)return I;var ce=[],fe=0;return z(I,ce,"","",function(ue){return Z.call(j,ue,fe++)}),ce}function q(I){if(I._status===-1){var Z=I._result;Z=Z(),Z.then(function(j){(I._status===0||I._status===-1)&&(I._status=1,I._result=j)},function(j){(I._status===0||I._status===-1)&&(I._status=2,I._result=j)}),I._status===-1&&(I._status=0,I._result=Z)}if(I._status===1)return I._result.default;throw I._result}var Q=typeof reportError=="function"?reportError:function(I){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Z=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(Z))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",I);return}console.error(I)},M={map:$,forEach:function(I,Z,j){$(I,function(){Z.apply(this,arguments)},j)},count:function(I){var Z=0;return $(I,function(){Z++}),Z},toArray:function(I){return $(I,function(Z){return Z})||[]},only:function(I){if(!H(I))throw Error("React.Children.only expected to receive a single React element child.");return I}};return qe.Activity=g,qe.Children=M,qe.Component=k,qe.Fragment=n,qe.Profiler=s,qe.PureComponent=T,qe.StrictMode=r,qe.Suspense=h,qe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=O,qe.__COMPILER_RUNTIME={__proto__:null,c:function(I){return O.H.useMemoCache(I)}},qe.cache=function(I){return function(){return I.apply(null,arguments)}},qe.cacheSignal=function(){return null},qe.cloneElement=function(I,Z,j){if(I==null)throw Error("The argument must be a React element, but you passed "+I+".");var ce=S({},I.props),fe=I.key;if(Z!=null)for(ue in Z.key!==void 0&&(fe=""+Z.key),Z)!F.call(Z,ue)||ue==="key"||ue==="__self"||ue==="__source"||ue==="ref"&&Z.ref===void 0||(ce[ue]=Z[ue]);var ue=arguments.length-2;if(ue===1)ce.children=j;else if(1<ue){for(var de=Array(ue),we=0;we<ue;we++)de[we]=arguments[we+2];ce.children=de}return G(I.type,fe,ce)},qe.createContext=function(I){return I={$$typeof:l,_currentValue:I,_currentValue2:I,_threadCount:0,Provider:null,Consumer:null},I.Provider=I,I.Consumer={$$typeof:a,_context:I},I},qe.createElement=function(I,Z,j){var ce,fe={},ue=null;if(Z!=null)for(ce in Z.key!==void 0&&(ue=""+Z.key),Z)F.call(Z,ce)&&ce!=="key"&&ce!=="__self"&&ce!=="__source"&&(fe[ce]=Z[ce]);var de=arguments.length-2;if(de===1)fe.children=j;else if(1<de){for(var we=Array(de),oe=0;oe<de;oe++)we[oe]=arguments[oe+2];fe.children=we}if(I&&I.defaultProps)for(ce in de=I.defaultProps,de)fe[ce]===void 0&&(fe[ce]=de[ce]);return G(I,ue,fe)},qe.createRef=function(){return{current:null}},qe.forwardRef=function(I){return{$$typeof:u,render:I}},qe.isValidElement=H,qe.lazy=function(I){return{$$typeof:m,_payload:{_status:-1,_result:I},_init:q}},qe.memo=function(I,Z){return{$$typeof:d,type:I,compare:Z===void 0?null:Z}},qe.startTransition=function(I){var Z=O.T,j={};O.T=j;try{var ce=I(),fe=O.S;fe!==null&&fe(j,ce),typeof ce=="object"&&ce!==null&&typeof ce.then=="function"&&ce.then(A,Q)}catch(ue){Q(ue)}finally{Z!==null&&j.types!==null&&(Z.types=j.types),O.T=Z}},qe.unstable_useCacheRefresh=function(){return O.H.useCacheRefresh()},qe.use=function(I){return O.H.use(I)},qe.useActionState=function(I,Z,j){return O.H.useActionState(I,Z,j)},qe.useCallback=function(I,Z){return O.H.useCallback(I,Z)},qe.useContext=function(I){return O.H.useContext(I)},qe.useDebugValue=function(){},qe.useDeferredValue=function(I,Z){return O.H.useDeferredValue(I,Z)},qe.useEffect=function(I,Z){return O.H.useEffect(I,Z)},qe.useEffectEvent=function(I){return O.H.useEffectEvent(I)},qe.useId=function(){return O.H.useId()},qe.useImperativeHandle=function(I,Z,j){return O.H.useImperativeHandle(I,Z,j)},qe.useInsertionEffect=function(I,Z){return O.H.useInsertionEffect(I,Z)},qe.useLayoutEffect=function(I,Z){return O.H.useLayoutEffect(I,Z)},qe.useMemo=function(I,Z){return O.H.useMemo(I,Z)},qe.useOptimistic=function(I,Z){return O.H.useOptimistic(I,Z)},qe.useReducer=function(I,Z,j){return O.H.useReducer(I,Z,j)},qe.useRef=function(I){return O.H.useRef(I)},qe.useState=function(I){return O.H.useState(I)},qe.useSyncExternalStore=function(I,Z,j){return O.H.useSyncExternalStore(I,Z,j)},qe.useTransition=function(){return O.H.useTransition()},qe.version="19.2.1",qe}var sC;function ab(){return sC||(sC=1,lv.exports=LO()),lv.exports}var y=ab();const Pt=dp(y),dR=DO({__proto__:null,default:Pt},[y]);var cv={exports:{}},$c={},uv={exports:{}},dv={};/**
|
|
18
|
-
* @license React
|
|
19
|
-
* scheduler.production.js
|
|
20
|
-
*
|
|
21
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
22
|
-
*
|
|
23
|
-
* This source code is licensed under the MIT license found in the
|
|
24
|
-
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/var oC;function zO(){return oC||(oC=1,(function(e){function t(z,$){var q=z.length;z.push($);e:for(;0<q;){var Q=q-1>>>1,M=z[Q];if(0<s(M,$))z[Q]=$,z[q]=M,q=Q;else break e}}function n(z){return z.length===0?null:z[0]}function r(z){if(z.length===0)return null;var $=z[0],q=z.pop();if(q!==$){z[0]=q;e:for(var Q=0,M=z.length,I=M>>>1;Q<I;){var Z=2*(Q+1)-1,j=z[Z],ce=Z+1,fe=z[ce];if(0>s(j,q))ce<M&&0>s(fe,j)?(z[Q]=fe,z[ce]=q,Q=ce):(z[Q]=j,z[Z]=q,Q=Z);else if(ce<M&&0>s(fe,q))z[Q]=fe,z[ce]=q,Q=ce;else break e}}return $}function s(z,$){var q=z.sortIndex-$.sortIndex;return q!==0?q:z.id-$.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var l=Date,u=l.now();e.unstable_now=function(){return l.now()-u}}var h=[],d=[],m=1,g=null,_=3,b=!1,w=!1,S=!1,C=!1,k=typeof setTimeout=="function"?setTimeout:null,R=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;function N(z){for(var $=n(d);$!==null;){if($.callback===null)r(d);else if($.startTime<=z)r(d),$.sortIndex=$.expirationTime,t(h,$);else break;$=n(d)}}function L(z){if(S=!1,N(z),!w)if(n(h)!==null)w=!0,A||(A=!0,P());else{var $=n(d);$!==null&&W(L,$.startTime-z)}}var A=!1,O=-1,F=5,G=-1;function B(){return C?!0:!(e.unstable_now()-G<F)}function H(){if(C=!1,A){var z=e.unstable_now();G=z;var $=!0;try{e:{w=!1,S&&(S=!1,R(O),O=-1),b=!0;var q=_;try{t:{for(N(z),g=n(h);g!==null&&!(g.expirationTime>z&&B());){var Q=g.callback;if(typeof Q=="function"){g.callback=null,_=g.priorityLevel;var M=Q(g.expirationTime<=z);if(z=e.unstable_now(),typeof M=="function"){g.callback=M,N(z),$=!0;break t}g===n(h)&&r(h),N(z)}else r(h);g=n(h)}if(g!==null)$=!0;else{var I=n(d);I!==null&&W(L,I.startTime-z),$=!1}}break e}finally{g=null,_=q,b=!1}$=void 0}}finally{$?P():A=!1}}}var P;if(typeof T=="function")P=function(){T(H)};else if(typeof MessageChannel<"u"){var U=new MessageChannel,V=U.port2;U.port1.onmessage=H,P=function(){V.postMessage(null)}}else P=function(){k(H,0)};function W(z,$){O=k(function(){z(e.unstable_now())},$)}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(z){z.callback=null},e.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):F=0<z?Math.floor(1e3/z):5},e.unstable_getCurrentPriorityLevel=function(){return _},e.unstable_next=function(z){switch(_){case 1:case 2:case 3:var $=3;break;default:$=_}var q=_;_=$;try{return z()}finally{_=q}},e.unstable_requestPaint=function(){C=!0},e.unstable_runWithPriority=function(z,$){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var q=_;_=z;try{return $()}finally{_=q}},e.unstable_scheduleCallback=function(z,$,q){var Q=e.unstable_now();switch(typeof q=="object"&&q!==null?(q=q.delay,q=typeof q=="number"&&0<q?Q+q:Q):q=Q,z){case 1:var M=-1;break;case 2:M=250;break;case 5:M=1073741823;break;case 4:M=1e4;break;default:M=5e3}return M=q+M,z={id:m++,callback:$,priorityLevel:z,startTime:q,expirationTime:M,sortIndex:-1},q>Q?(z.sortIndex=q,t(d,z),n(h)===null&&z===n(d)&&(S?(R(O),O=-1):S=!0,W(L,q-Q))):(z.sortIndex=M,t(h,z),w||b||(w=!0,A||(A=!0,P()))),z},e.unstable_shouldYield=B,e.unstable_wrapCallback=function(z){var $=_;return function(){var q=_;_=$;try{return z.apply(this,arguments)}finally{_=q}}}})(dv)),dv}var aC;function PO(){return aC||(aC=1,uv.exports=zO()),uv.exports}var hv={exports:{}},$n={};/**
|
|
26
|
-
* @license React
|
|
27
|
-
* react-dom.production.js
|
|
28
|
-
*
|
|
29
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
30
|
-
*
|
|
31
|
-
* This source code is licensed under the MIT license found in the
|
|
32
|
-
* LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/var lC;function BO(){if(lC)return $n;lC=1;var e=ab();function t(h){var d="https://react.dev/errors/"+h;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)d+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+h+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},s=Symbol.for("react.portal");function a(h,d,m){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:g==null?null:""+g,children:h,containerInfo:d,implementation:m}}var l=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(h,d){if(h==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return $n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,$n.createPortal=function(h,d){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(t(299));return a(h,d,null,m)},$n.flushSync=function(h){var d=l.T,m=r.p;try{if(l.T=null,r.p=2,h)return h()}finally{l.T=d,r.p=m,r.d.f()}},$n.preconnect=function(h,d){typeof h=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,r.d.C(h,d))},$n.prefetchDNS=function(h){typeof h=="string"&&r.d.D(h)},$n.preinit=function(h,d){if(typeof h=="string"&&d&&typeof d.as=="string"){var m=d.as,g=u(m,d.crossOrigin),_=typeof d.integrity=="string"?d.integrity:void 0,b=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;m==="style"?r.d.S(h,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:g,integrity:_,fetchPriority:b}):m==="script"&&r.d.X(h,{crossOrigin:g,integrity:_,fetchPriority:b,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},$n.preinitModule=function(h,d){if(typeof h=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var m=u(d.as,d.crossOrigin);r.d.M(h,{crossOrigin:m,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&r.d.M(h)},$n.preload=function(h,d){if(typeof h=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var m=d.as,g=u(m,d.crossOrigin);r.d.L(h,m,{crossOrigin:g,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0,type:typeof d.type=="string"?d.type:void 0,fetchPriority:typeof d.fetchPriority=="string"?d.fetchPriority:void 0,referrerPolicy:typeof d.referrerPolicy=="string"?d.referrerPolicy:void 0,imageSrcSet:typeof d.imageSrcSet=="string"?d.imageSrcSet:void 0,imageSizes:typeof d.imageSizes=="string"?d.imageSizes:void 0,media:typeof d.media=="string"?d.media:void 0})}},$n.preloadModule=function(h,d){if(typeof h=="string")if(d){var m=u(d.as,d.crossOrigin);r.d.m(h,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:m,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else r.d.m(h)},$n.requestFormReset=function(h){r.d.r(h)},$n.unstable_batchedUpdates=function(h,d){return h(d)},$n.useFormState=function(h,d,m){return l.H.useFormState(h,d,m)},$n.useFormStatus=function(){return l.H.useHostTransitionStatus()},$n.version="19.2.1",$n}var cC;function hR(){if(cC)return hv.exports;cC=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(),hv.exports=BO(),hv.exports}/**
|
|
34
|
-
* @license React
|
|
35
|
-
* react-dom-client.production.js
|
|
36
|
-
*
|
|
37
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
38
|
-
*
|
|
39
|
-
* This source code is licensed under the MIT license found in the
|
|
40
|
-
* LICENSE file in the root directory of this source tree.
|
|
41
|
-
*/var uC;function IO(){if(uC)return $c;uC=1;var e=PO(),t=ab(),n=hR();function r(i){var o="https://react.dev/errors/"+i;if(1<arguments.length){o+="?args[]="+encodeURIComponent(arguments[1]);for(var c=2;c<arguments.length;c++)o+="&args[]="+encodeURIComponent(arguments[c])}return"Minified React error #"+i+"; visit "+o+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function a(i){var o=i,c=i;if(i.alternate)for(;o.return;)o=o.return;else{i=o;do o=i,(o.flags&4098)!==0&&(c=o.return),i=o.return;while(i)}return o.tag===3?c:null}function l(i){if(i.tag===13){var o=i.memoizedState;if(o===null&&(i=i.alternate,i!==null&&(o=i.memoizedState)),o!==null)return o.dehydrated}return null}function u(i){if(i.tag===31){var o=i.memoizedState;if(o===null&&(i=i.alternate,i!==null&&(o=i.memoizedState)),o!==null)return o.dehydrated}return null}function h(i){if(a(i)!==i)throw Error(r(188))}function d(i){var o=i.alternate;if(!o){if(o=a(i),o===null)throw Error(r(188));return o!==i?null:i}for(var c=i,f=o;;){var v=c.return;if(v===null)break;var x=v.alternate;if(x===null){if(f=v.return,f!==null){c=f;continue}break}if(v.child===x.child){for(x=v.child;x;){if(x===c)return h(v),i;if(x===f)return h(v),o;x=x.sibling}throw Error(r(188))}if(c.return!==f.return)c=v,f=x;else{for(var E=!1,D=v.child;D;){if(D===c){E=!0,c=v,f=x;break}if(D===f){E=!0,f=v,c=x;break}D=D.sibling}if(!E){for(D=x.child;D;){if(D===c){E=!0,c=x,f=v;break}if(D===f){E=!0,f=x,c=v;break}D=D.sibling}if(!E)throw Error(r(189))}}if(c.alternate!==f)throw Error(r(190))}if(c.tag!==3)throw Error(r(188));return c.stateNode.current===c?i:o}function m(i){var o=i.tag;if(o===5||o===26||o===27||o===6)return i;for(i=i.child;i!==null;){if(o=m(i),o!==null)return o;i=i.sibling}return null}var g=Object.assign,_=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),R=Symbol.for("react.consumer"),T=Symbol.for("react.context"),N=Symbol.for("react.forward_ref"),L=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),F=Symbol.for("react.lazy"),G=Symbol.for("react.activity"),B=Symbol.for("react.memo_cache_sentinel"),H=Symbol.iterator;function P(i){return i===null||typeof i!="object"?null:(i=H&&i[H]||i["@@iterator"],typeof i=="function"?i:null)}var U=Symbol.for("react.client.reference");function V(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===U?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case S:return"Fragment";case k:return"Profiler";case C:return"StrictMode";case L:return"Suspense";case A:return"SuspenseList";case G: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 o=i.render;return i=i.displayName,i||(i=o.displayName||o.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case O:return o=i.displayName||null,o!==null?o:V(i.type)||"Memo";case F:o=i._payload,i=i._init;try{return V(i(o))}catch{}}return null}var W=Array.isArray,z=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q={pending:!1,data:null,method:null,action:null},Q=[],M=-1;function I(i){return{current:i}}function Z(i){0>M||(i.current=Q[M],Q[M]=null,M--)}function j(i,o){M++,Q[M]=i.current,i.current=o}var ce=I(null),fe=I(null),ue=I(null),de=I(null);function we(i,o){switch(j(ue,o),j(fe,i),j(ce,null),o.nodeType){case 9:case 11:i=(i=o.documentElement)&&(i=i.namespaceURI)?xS(i):0;break;default:if(i=o.tagName,o=o.namespaceURI)o=xS(o),i=wS(o,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}Z(ce),j(ce,i)}function oe(){Z(ce),Z(fe),Z(ue)}function be(i){i.memoizedState!==null&&j(de,i);var o=ce.current,c=wS(o,i.type);o!==c&&(j(fe,i),j(ce,c))}function Ne(i){fe.current===i&&(Z(ce),Z(fe)),de.current===i&&(Z(de),Pc._currentValue=q)}var Se,_e;function xe(i){if(Se===void 0)try{throw Error()}catch(c){var o=c.stack.trim().match(/\n( *(at )?)/);Se=o&&o[1]||"",_e=-1<c.stack.indexOf(`
|
|
42
|
-
at`)?" (<anonymous>)":-1<c.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
-
`+Se+i+_e}var He=!1;function Fe(i,o){if(!i||He)return"";He=!0;var c=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var f={DetermineComponentFrameRoot:function(){try{if(o){var me=function(){throw Error()};if(Object.defineProperty(me.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(me,[])}catch(ae){var se=ae}Reflect.construct(i,[],me)}else{try{me.call()}catch(ae){se=ae}i.call(me.prototype)}}else{try{throw Error()}catch(ae){se=ae}(me=i())&&typeof me.catch=="function"&&me.catch(function(){})}}catch(ae){if(ae&&se&&typeof ae.stack=="string")return[ae.stack,se.stack]}return[null,null]}};f.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var v=Object.getOwnPropertyDescriptor(f.DetermineComponentFrameRoot,"name");v&&v.configurable&&Object.defineProperty(f.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var x=f.DetermineComponentFrameRoot(),E=x[0],D=x[1];if(E&&D){var K=E.split(`
|
|
44
|
-
`),ne=D.split(`
|
|
45
|
-
`);for(v=f=0;f<K.length&&!K[f].includes("DetermineComponentFrameRoot");)f++;for(;v<ne.length&&!ne[v].includes("DetermineComponentFrameRoot");)v++;if(f===K.length||v===ne.length)for(f=K.length-1,v=ne.length-1;1<=f&&0<=v&&K[f]!==ne[v];)v--;for(;1<=f&&0<=v;f--,v--)if(K[f]!==ne[v]){if(f!==1||v!==1)do if(f--,v--,0>v||K[f]!==ne[v]){var he=`
|
|
46
|
-
`+K[f].replace(" at new "," at ");return i.displayName&&he.includes("<anonymous>")&&(he=he.replace("<anonymous>",i.displayName)),he}while(1<=f&&0<=v);break}}}finally{He=!1,Error.prepareStackTrace=c}return(c=i?i.displayName||i.name:"")?xe(c):""}function et(i,o){switch(i.tag){case 26:case 27:case 5:return xe(i.type);case 16:return xe("Lazy");case 13:return i.child!==o&&o!==null?xe("Suspense Fallback"):xe("Suspense");case 19:return xe("SuspenseList");case 0:case 15:return Fe(i.type,!1);case 11:return Fe(i.type.render,!1);case 1:return Fe(i.type,!0);case 31:return xe("Activity");default:return""}}function dt(i){try{var o="",c=null;do o+=et(i,c),c=i,i=i.return;while(i);return o}catch(f){return`
|
|
47
|
-
Error generating stack: `+f.message+`
|
|
48
|
-
`+f.stack}}var mt=Object.prototype.hasOwnProperty,bt=e.unstable_scheduleCallback,un=e.unstable_cancelCallback,Zt=e.unstable_shouldYield,Nn=e.unstable_requestPaint,Dt=e.unstable_now,Yn=e.unstable_getCurrentPriorityLevel,Y=e.unstable_ImmediatePriority,le=e.unstable_UserBlockingPriority,Re=e.unstable_NormalPriority,ze=e.unstable_LowPriority,$e=e.unstable_IdlePriority,ht=e.log,ee=e.unstable_setDisableYieldValue,Xe=null,gt=null;function ie(i){if(typeof ht=="function"&&ee(i),gt&&typeof gt.setStrictMode=="function")try{gt.setStrictMode(Xe,i)}catch{}}var Te=Math.clz32?Math.clz32:dn,ct=Math.log,xt=Math.LN2;function dn(i){return i>>>=0,i===0?32:31-(ct(i)/xt|0)|0}var An=256,Xn=262144,kt=4194304;function Et(i){var o=i&42;if(o!==0)return o;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 Lt(i,o,c){var f=i.pendingLanes;if(f===0)return 0;var v=0,x=i.suspendedLanes,E=i.pingedLanes;i=i.warmLanes;var D=f&134217727;return D!==0?(f=D&~x,f!==0?v=Et(f):(E&=D,E!==0?v=Et(E):c||(c=D&~i,c!==0&&(v=Et(c))))):(D=f&~x,D!==0?v=Et(D):E!==0?v=Et(E):c||(c=f&~i,c!==0&&(v=Et(c)))),v===0?0:o!==0&&o!==v&&(o&x)===0&&(x=v&-v,c=o&-o,x>=c||x===32&&(c&4194048)!==0)?o:v}function Dn(i,o){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&o)===0}function On(i,o){switch(i){case 1:case 2:case 4:case 8:case 64:return o+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 o+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 re(){var i=kt;return kt<<=1,(kt&62914560)===0&&(kt=4194304),i}function ve(i){for(var o=[],c=0;31>c;c++)o.push(i);return o}function We(i,o){i.pendingLanes|=o,o!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function Ve(i,o,c,f,v,x){var E=i.pendingLanes;i.pendingLanes=c,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=c,i.entangledLanes&=c,i.errorRecoveryDisabledLanes&=c,i.shellSuspendCounter=0;var D=i.entanglements,K=i.expirationTimes,ne=i.hiddenUpdates;for(c=E&~c;0<c;){var he=31-Te(c),me=1<<he;D[he]=0,K[he]=-1;var se=ne[he];if(se!==null)for(ne[he]=null,he=0;he<se.length;he++){var ae=se[he];ae!==null&&(ae.lane&=-536870913)}c&=~me}f!==0&&wt(i,f,0),x!==0&&v===0&&i.tag!==0&&(i.suspendedLanes|=x&~(E&~o))}function wt(i,o,c){i.pendingLanes|=o,i.suspendedLanes&=~o;var f=31-Te(o);i.entangledLanes|=o,i.entanglements[f]=i.entanglements[f]|1073741824|c&261930}function jn(i,o){var c=i.entangledLanes|=o;for(i=i.entanglements;c;){var f=31-Te(c),v=1<<f;v&o|i[f]&o&&(i[f]|=o),c&=~v}}function Dr(i,o){var c=o&-o;return c=(c&42)!==0?1:Ii(c),(c&(i.suspendedLanes|o))!==0?0:c}function Ii(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 Hi(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function ti(){var i=$.p;return i!==0?i:(i=window.event,i===void 0?32:VS(i.type))}function ws(i,o){var c=$.p;try{return $.p=i,o()}finally{$.p=c}}var Or=Math.random().toString(36).slice(2),Ln="__reactFiber$"+Or,or="__reactProps$"+Or,_a="__reactContainer$"+Or,Qp="__reactEvents$"+Or,y3="__reactListeners$"+Or,b3="__reactHandles$"+Or,lx="__reactResources$"+Or,Ql="__reactMarker$"+Or;function Jp(i){delete i[Ln],delete i[or],delete i[Qp],delete i[y3],delete i[b3]}function ya(i){var o=i[Ln];if(o)return o;for(var c=i.parentNode;c;){if(o=c[_a]||c[Ln]){if(c=o.alternate,o.child!==null||c!==null&&c.child!==null)for(i=MS(i);i!==null;){if(c=i[Ln])return c;i=MS(i)}return o}i=c,c=i.parentNode}return null}function ba(i){if(i=i[Ln]||i[_a]){var o=i.tag;if(o===5||o===6||o===13||o===31||o===26||o===27||o===3)return i}return null}function Jl(i){var o=i.tag;if(o===5||o===26||o===27||o===6)return i.stateNode;throw Error(r(33))}function xa(i){var o=i[lx];return o||(o=i[lx]={hoistableStyles:new Map,hoistableScripts:new Map}),o}function yn(i){i[Ql]=!0}var cx=new Set,ux={};function bo(i,o){wa(i,o),wa(i+"Capture",o)}function wa(i,o){for(ux[i]=o,i=0;i<o.length;i++)cx.add(o[i])}var x3=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]*$"),dx={},hx={};function w3(i){return mt.call(hx,i)?!0:mt.call(dx,i)?!1:x3.test(i)?hx[i]=!0:(dx[i]=!0,!1)}function gd(i,o,c){if(w3(o))if(c===null)i.removeAttribute(o);else{switch(typeof c){case"undefined":case"function":case"symbol":i.removeAttribute(o);return;case"boolean":var f=o.toLowerCase().slice(0,5);if(f!=="data-"&&f!=="aria-"){i.removeAttribute(o);return}}i.setAttribute(o,""+c)}}function vd(i,o,c){if(c===null)i.removeAttribute(o);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(o);return}i.setAttribute(o,""+c)}}function Fi(i,o,c,f){if(f===null)i.removeAttribute(c);else{switch(typeof f){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(c);return}i.setAttributeNS(o,c,""+f)}}function jr(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function fx(i){var o=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function S3(i,o,c){var f=Object.getOwnPropertyDescriptor(i.constructor.prototype,o);if(!i.hasOwnProperty(o)&&typeof f<"u"&&typeof f.get=="function"&&typeof f.set=="function"){var v=f.get,x=f.set;return Object.defineProperty(i,o,{configurable:!0,get:function(){return v.call(this)},set:function(E){c=""+E,x.call(this,E)}}),Object.defineProperty(i,o,{enumerable:f.enumerable}),{getValue:function(){return c},setValue:function(E){c=""+E},stopTracking:function(){i._valueTracker=null,delete i[o]}}}}function em(i){if(!i._valueTracker){var o=fx(i)?"checked":"value";i._valueTracker=S3(i,o,""+i[o])}}function px(i){if(!i)return!1;var o=i._valueTracker;if(!o)return!0;var c=o.getValue(),f="";return i&&(f=fx(i)?i.checked?"true":"false":i.value),i=f,i!==c?(o.setValue(i),!0):!1}function _d(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 C3=/[\n"\\]/g;function Lr(i){return i.replace(C3,function(o){return"\\"+o.charCodeAt(0).toString(16)+" "})}function tm(i,o,c,f,v,x,E,D){i.name="",E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"?i.type=E:i.removeAttribute("type"),o!=null?E==="number"?(o===0&&i.value===""||i.value!=o)&&(i.value=""+jr(o)):i.value!==""+jr(o)&&(i.value=""+jr(o)):E!=="submit"&&E!=="reset"||i.removeAttribute("value"),o!=null?nm(i,E,jr(o)):c!=null?nm(i,E,jr(c)):f!=null&&i.removeAttribute("value"),v==null&&x!=null&&(i.defaultChecked=!!x),v!=null&&(i.checked=v&&typeof v!="function"&&typeof v!="symbol"),D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"?i.name=""+jr(D):i.removeAttribute("name")}function mx(i,o,c,f,v,x,E,D){if(x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(i.type=x),o!=null||c!=null){if(!(x!=="submit"&&x!=="reset"||o!=null)){em(i);return}c=c!=null?""+jr(c):"",o=o!=null?""+jr(o):c,D||o===i.value||(i.value=o),i.defaultValue=o}f=f??v,f=typeof f!="function"&&typeof f!="symbol"&&!!f,i.checked=D?i.checked:!!f,i.defaultChecked=!!f,E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"&&(i.name=E),em(i)}function nm(i,o,c){o==="number"&&_d(i.ownerDocument)===i||i.defaultValue===""+c||(i.defaultValue=""+c)}function Sa(i,o,c,f){if(i=i.options,o){o={};for(var v=0;v<c.length;v++)o["$"+c[v]]=!0;for(c=0;c<i.length;c++)v=o.hasOwnProperty("$"+i[c].value),i[c].selected!==v&&(i[c].selected=v),v&&f&&(i[c].defaultSelected=!0)}else{for(c=""+jr(c),o=null,v=0;v<i.length;v++){if(i[v].value===c){i[v].selected=!0,f&&(i[v].defaultSelected=!0);return}o!==null||i[v].disabled||(o=i[v])}o!==null&&(o.selected=!0)}}function gx(i,o,c){if(o!=null&&(o=""+jr(o),o!==i.value&&(i.value=o),c==null)){i.defaultValue!==o&&(i.defaultValue=o);return}i.defaultValue=c!=null?""+jr(c):""}function vx(i,o,c,f){if(o==null){if(f!=null){if(c!=null)throw Error(r(92));if(W(f)){if(1<f.length)throw Error(r(93));f=f[0]}c=f}c==null&&(c=""),o=c}c=jr(o),i.defaultValue=c,f=i.textContent,f===c&&f!==""&&f!==null&&(i.value=f),em(i)}function Ca(i,o){if(o){var c=i.firstChild;if(c&&c===i.lastChild&&c.nodeType===3){c.nodeValue=o;return}}i.textContent=o}var k3=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 _x(i,o,c){var f=o.indexOf("--")===0;c==null||typeof c=="boolean"||c===""?f?i.setProperty(o,""):o==="float"?i.cssFloat="":i[o]="":f?i.setProperty(o,c):typeof c!="number"||c===0||k3.has(o)?o==="float"?i.cssFloat=c:i[o]=(""+c).trim():i[o]=c+"px"}function yx(i,o,c){if(o!=null&&typeof o!="object")throw Error(r(62));if(i=i.style,c!=null){for(var f in c)!c.hasOwnProperty(f)||o!=null&&o.hasOwnProperty(f)||(f.indexOf("--")===0?i.setProperty(f,""):f==="float"?i.cssFloat="":i[f]="");for(var v in o)f=o[v],o.hasOwnProperty(v)&&c[v]!==f&&_x(i,v,f)}else for(var x in o)o.hasOwnProperty(x)&&_x(i,x,o[x])}function rm(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 E3=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"]]),R3=/^[\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 yd(i){return R3.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}function Ui(){}var im=null;function sm(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var ka=null,Ea=null;function bx(i){var o=ba(i);if(o&&(i=o.stateNode)){var c=i[or]||null;e:switch(i=o.stateNode,o.type){case"input":if(tm(i,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name),o=c.name,c.type==="radio"&&o!=null){for(c=i;c.parentNode;)c=c.parentNode;for(c=c.querySelectorAll('input[name="'+Lr(""+o)+'"][type="radio"]'),o=0;o<c.length;o++){var f=c[o];if(f!==i&&f.form===i.form){var v=f[or]||null;if(!v)throw Error(r(90));tm(f,v.value,v.defaultValue,v.defaultValue,v.checked,v.defaultChecked,v.type,v.name)}}for(o=0;o<c.length;o++)f=c[o],f.form===i.form&&px(f)}break e;case"textarea":gx(i,c.value,c.defaultValue);break e;case"select":o=c.value,o!=null&&Sa(i,!!c.multiple,o,!1)}}}var om=!1;function xx(i,o,c){if(om)return i(o,c);om=!0;try{var f=i(o);return f}finally{if(om=!1,(ka!==null||Ea!==null)&&(oh(),ka&&(o=ka,i=Ea,Ea=ka=null,bx(o),i)))for(o=0;o<i.length;o++)bx(i[o])}}function ec(i,o){var c=i.stateNode;if(c===null)return null;var f=c[or]||null;if(f===null)return null;c=f[o];e:switch(o){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(f=!f.disabled)||(i=i.type,f=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!f;break e;default:i=!1}if(i)return null;if(c&&typeof c!="function")throw Error(r(231,o,typeof c));return c}var $i=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),am=!1;if($i)try{var tc={};Object.defineProperty(tc,"passive",{get:function(){am=!0}}),window.addEventListener("test",tc,tc),window.removeEventListener("test",tc,tc)}catch{am=!1}var Ss=null,lm=null,bd=null;function wx(){if(bd)return bd;var i,o=lm,c=o.length,f,v="value"in Ss?Ss.value:Ss.textContent,x=v.length;for(i=0;i<c&&o[i]===v[i];i++);var E=c-i;for(f=1;f<=E&&o[c-f]===v[x-f];f++);return bd=v.slice(i,1<f?1-f:void 0)}function xd(i){var o=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&o===13&&(i=13)):i=o,i===10&&(i=13),32<=i||i===13?i:0}function wd(){return!0}function Sx(){return!1}function ar(i){function o(c,f,v,x,E){this._reactName=c,this._targetInst=v,this.type=f,this.nativeEvent=x,this.target=E,this.currentTarget=null;for(var D in i)i.hasOwnProperty(D)&&(c=i[D],this[D]=c?c(x):x[D]);return this.isDefaultPrevented=(x.defaultPrevented!=null?x.defaultPrevented:x.returnValue===!1)?wd:Sx,this.isPropagationStopped=Sx,this}return g(o.prototype,{preventDefault:function(){this.defaultPrevented=!0;var c=this.nativeEvent;c&&(c.preventDefault?c.preventDefault():typeof c.returnValue!="unknown"&&(c.returnValue=!1),this.isDefaultPrevented=wd)},stopPropagation:function(){var c=this.nativeEvent;c&&(c.stopPropagation?c.stopPropagation():typeof c.cancelBubble!="unknown"&&(c.cancelBubble=!0),this.isPropagationStopped=wd)},persist:function(){},isPersistent:wd}),o}var xo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Sd=ar(xo),nc=g({},xo,{view:0,detail:0}),T3=ar(nc),cm,um,rc,Cd=g({},nc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:hm,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!==rc&&(rc&&i.type==="mousemove"?(cm=i.screenX-rc.screenX,um=i.screenY-rc.screenY):um=cm=0,rc=i),cm)},movementY:function(i){return"movementY"in i?i.movementY:um}}),Cx=ar(Cd),M3=g({},Cd,{dataTransfer:0}),N3=ar(M3),A3=g({},nc,{relatedTarget:0}),dm=ar(A3),D3=g({},xo,{animationName:0,elapsedTime:0,pseudoElement:0}),O3=ar(D3),j3=g({},xo,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),L3=ar(j3),z3=g({},xo,{data:0}),kx=ar(z3),P3={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},B3={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"},I3={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function H3(i){var o=this.nativeEvent;return o.getModifierState?o.getModifierState(i):(i=I3[i])?!!o[i]:!1}function hm(){return H3}var F3=g({},nc,{key:function(i){if(i.key){var o=P3[i.key]||i.key;if(o!=="Unidentified")return o}return i.type==="keypress"?(i=xd(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?B3[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:hm,charCode:function(i){return i.type==="keypress"?xd(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?xd(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),U3=ar(F3),$3=g({},Cd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ex=ar($3),W3=g({},nc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:hm}),V3=ar(W3),q3=g({},xo,{propertyName:0,elapsedTime:0,pseudoElement:0}),K3=ar(q3),G3=g({},Cd,{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}),Y3=ar(G3),X3=g({},xo,{newState:0,oldState:0}),Z3=ar(X3),Q3=[9,13,27,32],fm=$i&&"CompositionEvent"in window,ic=null;$i&&"documentMode"in document&&(ic=document.documentMode);var J3=$i&&"TextEvent"in window&&!ic,Rx=$i&&(!fm||ic&&8<ic&&11>=ic),Tx=" ",Mx=!1;function Nx(i,o){switch(i){case"keyup":return Q3.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ax(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var Ra=!1;function e4(i,o){switch(i){case"compositionend":return Ax(o);case"keypress":return o.which!==32?null:(Mx=!0,Tx);case"textInput":return i=o.data,i===Tx&&Mx?null:i;default:return null}}function t4(i,o){if(Ra)return i==="compositionend"||!fm&&Nx(i,o)?(i=wx(),bd=lm=Ss=null,Ra=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(o.ctrlKey||o.altKey||o.metaKey)||o.ctrlKey&&o.altKey){if(o.char&&1<o.char.length)return o.char;if(o.which)return String.fromCharCode(o.which)}return null;case"compositionend":return Rx&&o.locale!=="ko"?null:o.data;default:return null}}var n4={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 Dx(i){var o=i&&i.nodeName&&i.nodeName.toLowerCase();return o==="input"?!!n4[i.type]:o==="textarea"}function Ox(i,o,c,f){ka?Ea?Ea.push(f):Ea=[f]:ka=f,o=fh(o,"onChange"),0<o.length&&(c=new Sd("onChange","change",null,c,f),i.push({event:c,listeners:o}))}var sc=null,oc=null;function r4(i){mS(i,0)}function kd(i){var o=Jl(i);if(px(o))return i}function jx(i,o){if(i==="change")return o}var Lx=!1;if($i){var pm;if($i){var mm="oninput"in document;if(!mm){var zx=document.createElement("div");zx.setAttribute("oninput","return;"),mm=typeof zx.oninput=="function"}pm=mm}else pm=!1;Lx=pm&&(!document.documentMode||9<document.documentMode)}function Px(){sc&&(sc.detachEvent("onpropertychange",Bx),oc=sc=null)}function Bx(i){if(i.propertyName==="value"&&kd(oc)){var o=[];Ox(o,oc,i,sm(i)),xx(r4,o)}}function i4(i,o,c){i==="focusin"?(Px(),sc=o,oc=c,sc.attachEvent("onpropertychange",Bx)):i==="focusout"&&Px()}function s4(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return kd(oc)}function o4(i,o){if(i==="click")return kd(o)}function a4(i,o){if(i==="input"||i==="change")return kd(o)}function l4(i,o){return i===o&&(i!==0||1/i===1/o)||i!==i&&o!==o}var _r=typeof Object.is=="function"?Object.is:l4;function ac(i,o){if(_r(i,o))return!0;if(typeof i!="object"||i===null||typeof o!="object"||o===null)return!1;var c=Object.keys(i),f=Object.keys(o);if(c.length!==f.length)return!1;for(f=0;f<c.length;f++){var v=c[f];if(!mt.call(o,v)||!_r(i[v],o[v]))return!1}return!0}function Ix(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function Hx(i,o){var c=Ix(i);i=0;for(var f;c;){if(c.nodeType===3){if(f=i+c.textContent.length,i<=o&&f>=o)return{node:c,offset:o-i};i=f}e:{for(;c;){if(c.nextSibling){c=c.nextSibling;break e}c=c.parentNode}c=void 0}c=Ix(c)}}function Fx(i,o){return i&&o?i===o?!0:i&&i.nodeType===3?!1:o&&o.nodeType===3?Fx(i,o.parentNode):"contains"in i?i.contains(o):i.compareDocumentPosition?!!(i.compareDocumentPosition(o)&16):!1:!1}function Ux(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var o=_d(i.document);o instanceof i.HTMLIFrameElement;){try{var c=typeof o.contentWindow.location.href=="string"}catch{c=!1}if(c)i=o.contentWindow;else break;o=_d(i.document)}return o}function gm(i){var o=i&&i.nodeName&&i.nodeName.toLowerCase();return o&&(o==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||o==="textarea"||i.contentEditable==="true")}var c4=$i&&"documentMode"in document&&11>=document.documentMode,Ta=null,vm=null,lc=null,_m=!1;function $x(i,o,c){var f=c.window===c?c.document:c.nodeType===9?c:c.ownerDocument;_m||Ta==null||Ta!==_d(f)||(f=Ta,"selectionStart"in f&&gm(f)?f={start:f.selectionStart,end:f.selectionEnd}:(f=(f.ownerDocument&&f.ownerDocument.defaultView||window).getSelection(),f={anchorNode:f.anchorNode,anchorOffset:f.anchorOffset,focusNode:f.focusNode,focusOffset:f.focusOffset}),lc&&ac(lc,f)||(lc=f,f=fh(vm,"onSelect"),0<f.length&&(o=new Sd("onSelect","select",null,o,c),i.push({event:o,listeners:f}),o.target=Ta)))}function wo(i,o){var c={};return c[i.toLowerCase()]=o.toLowerCase(),c["Webkit"+i]="webkit"+o,c["Moz"+i]="moz"+o,c}var Ma={animationend:wo("Animation","AnimationEnd"),animationiteration:wo("Animation","AnimationIteration"),animationstart:wo("Animation","AnimationStart"),transitionrun:wo("Transition","TransitionRun"),transitionstart:wo("Transition","TransitionStart"),transitioncancel:wo("Transition","TransitionCancel"),transitionend:wo("Transition","TransitionEnd")},ym={},Wx={};$i&&(Wx=document.createElement("div").style,"AnimationEvent"in window||(delete Ma.animationend.animation,delete Ma.animationiteration.animation,delete Ma.animationstart.animation),"TransitionEvent"in window||delete Ma.transitionend.transition);function So(i){if(ym[i])return ym[i];if(!Ma[i])return i;var o=Ma[i],c;for(c in o)if(o.hasOwnProperty(c)&&c in Wx)return ym[i]=o[c];return i}var Vx=So("animationend"),qx=So("animationiteration"),Kx=So("animationstart"),u4=So("transitionrun"),d4=So("transitionstart"),h4=So("transitioncancel"),Gx=So("transitionend"),Yx=new Map,bm="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(" ");bm.push("scrollEnd");function ni(i,o){Yx.set(i,o),bo(o,[i])}var Ed=typeof reportError=="function"?reportError:function(i){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var o=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(o))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",i);return}console.error(i)},zr=[],Na=0,xm=0;function Rd(){for(var i=Na,o=xm=Na=0;o<i;){var c=zr[o];zr[o++]=null;var f=zr[o];zr[o++]=null;var v=zr[o];zr[o++]=null;var x=zr[o];if(zr[o++]=null,f!==null&&v!==null){var E=f.pending;E===null?v.next=v:(v.next=E.next,E.next=v),f.pending=v}x!==0&&Xx(c,v,x)}}function Td(i,o,c,f){zr[Na++]=i,zr[Na++]=o,zr[Na++]=c,zr[Na++]=f,xm|=f,i.lanes|=f,i=i.alternate,i!==null&&(i.lanes|=f)}function wm(i,o,c,f){return Td(i,o,c,f),Md(i)}function Co(i,o){return Td(i,null,null,o),Md(i)}function Xx(i,o,c){i.lanes|=c;var f=i.alternate;f!==null&&(f.lanes|=c);for(var v=!1,x=i.return;x!==null;)x.childLanes|=c,f=x.alternate,f!==null&&(f.childLanes|=c),x.tag===22&&(i=x.stateNode,i===null||i._visibility&1||(v=!0)),i=x,x=x.return;return i.tag===3?(x=i.stateNode,v&&o!==null&&(v=31-Te(c),i=x.hiddenUpdates,f=i[v],f===null?i[v]=[o]:f.push(o),o.lane=c|536870912),x):null}function Md(i){if(50<Nc)throw Nc=0,Ag=null,Error(r(185));for(var o=i.return;o!==null;)i=o,o=i.return;return i.tag===3?i.stateNode:null}var Aa={};function f4(i,o,c,f){this.tag=i,this.key=c,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=o,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=f,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function yr(i,o,c,f){return new f4(i,o,c,f)}function Sm(i){return i=i.prototype,!(!i||!i.isReactComponent)}function Wi(i,o){var c=i.alternate;return c===null?(c=yr(i.tag,o,i.key,i.mode),c.elementType=i.elementType,c.type=i.type,c.stateNode=i.stateNode,c.alternate=i,i.alternate=c):(c.pendingProps=o,c.type=i.type,c.flags=0,c.subtreeFlags=0,c.deletions=null),c.flags=i.flags&65011712,c.childLanes=i.childLanes,c.lanes=i.lanes,c.child=i.child,c.memoizedProps=i.memoizedProps,c.memoizedState=i.memoizedState,c.updateQueue=i.updateQueue,o=i.dependencies,c.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext},c.sibling=i.sibling,c.index=i.index,c.ref=i.ref,c.refCleanup=i.refCleanup,c}function Zx(i,o){i.flags&=65011714;var c=i.alternate;return c===null?(i.childLanes=0,i.lanes=o,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=c.childLanes,i.lanes=c.lanes,i.child=c.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=c.memoizedProps,i.memoizedState=c.memoizedState,i.updateQueue=c.updateQueue,i.type=c.type,o=c.dependencies,i.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext}),i}function Nd(i,o,c,f,v,x){var E=0;if(f=i,typeof i=="function")Sm(i)&&(E=1);else if(typeof i=="string")E=_O(i,c,ce.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case G:return i=yr(31,c,o,v),i.elementType=G,i.lanes=x,i;case S:return ko(c.children,v,x,o);case C:E=8,v|=24;break;case k:return i=yr(12,c,o,v|2),i.elementType=k,i.lanes=x,i;case L:return i=yr(13,c,o,v),i.elementType=L,i.lanes=x,i;case A:return i=yr(19,c,o,v),i.elementType=A,i.lanes=x,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case T:E=10;break e;case R:E=9;break e;case N:E=11;break e;case O:E=14;break e;case F:E=16,f=null;break e}E=29,c=Error(r(130,i===null?"null":typeof i,"")),f=null}return o=yr(E,c,o,v),o.elementType=i,o.type=f,o.lanes=x,o}function ko(i,o,c,f){return i=yr(7,i,f,o),i.lanes=c,i}function Cm(i,o,c){return i=yr(6,i,null,o),i.lanes=c,i}function Qx(i){var o=yr(18,null,null,0);return o.stateNode=i,o}function km(i,o,c){return o=yr(4,i.children!==null?i.children:[],i.key,o),o.lanes=c,o.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},o}var Jx=new WeakMap;function Pr(i,o){if(typeof i=="object"&&i!==null){var c=Jx.get(i);return c!==void 0?c:(o={value:i,source:o,stack:dt(o)},Jx.set(i,o),o)}return{value:i,source:o,stack:dt(o)}}var Da=[],Oa=0,Ad=null,cc=0,Br=[],Ir=0,Cs=null,vi=1,_i="";function Vi(i,o){Da[Oa++]=cc,Da[Oa++]=Ad,Ad=i,cc=o}function e1(i,o,c){Br[Ir++]=vi,Br[Ir++]=_i,Br[Ir++]=Cs,Cs=i;var f=vi;i=_i;var v=32-Te(f)-1;f&=~(1<<v),c+=1;var x=32-Te(o)+v;if(30<x){var E=v-v%5;x=(f&(1<<E)-1).toString(32),f>>=E,v-=E,vi=1<<32-Te(o)+v|c<<v|f,_i=x+i}else vi=1<<x|c<<v|f,_i=i}function Em(i){i.return!==null&&(Vi(i,1),e1(i,1,0))}function Rm(i){for(;i===Ad;)Ad=Da[--Oa],Da[Oa]=null,cc=Da[--Oa],Da[Oa]=null;for(;i===Cs;)Cs=Br[--Ir],Br[Ir]=null,_i=Br[--Ir],Br[Ir]=null,vi=Br[--Ir],Br[Ir]=null}function t1(i,o){Br[Ir++]=vi,Br[Ir++]=_i,Br[Ir++]=Cs,vi=o.id,_i=o.overflow,Cs=i}var zn=null,Bt=null,lt=!1,ks=null,Hr=!1,Tm=Error(r(519));function Es(i){var o=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw uc(Pr(o,i)),Tm}function n1(i){var o=i.stateNode,c=i.type,f=i.memoizedProps;switch(o[Ln]=i,o[or]=f,c){case"dialog":rt("cancel",o),rt("close",o);break;case"iframe":case"object":case"embed":rt("load",o);break;case"video":case"audio":for(c=0;c<Dc.length;c++)rt(Dc[c],o);break;case"source":rt("error",o);break;case"img":case"image":case"link":rt("error",o),rt("load",o);break;case"details":rt("toggle",o);break;case"input":rt("invalid",o),mx(o,f.value,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name,!0);break;case"select":rt("invalid",o);break;case"textarea":rt("invalid",o),vx(o,f.value,f.defaultValue,f.children)}c=f.children,typeof c!="string"&&typeof c!="number"&&typeof c!="bigint"||o.textContent===""+c||f.suppressHydrationWarning===!0||yS(o.textContent,c)?(f.popover!=null&&(rt("beforetoggle",o),rt("toggle",o)),f.onScroll!=null&&rt("scroll",o),f.onScrollEnd!=null&&rt("scrollend",o),f.onClick!=null&&(o.onclick=Ui),o=!0):o=!1,o||Es(i,!0)}function r1(i){for(zn=i.return;zn;)switch(zn.tag){case 5:case 31:case 13:Hr=!1;return;case 27:case 3:Hr=!0;return;default:zn=zn.return}}function ja(i){if(i!==zn)return!1;if(!lt)return r1(i),lt=!0,!1;var o=i.tag,c;if((c=o!==3&&o!==27)&&((c=o===5)&&(c=i.type,c=!(c!=="form"&&c!=="button")||qg(i.type,i.memoizedProps)),c=!c),c&&Bt&&Es(i),r1(i),o===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));Bt=TS(i)}else if(o===31){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));Bt=TS(i)}else o===27?(o=Bt,Hs(i.type)?(i=Zg,Zg=null,Bt=i):Bt=o):Bt=zn?Ur(i.stateNode.nextSibling):null;return!0}function Eo(){Bt=zn=null,lt=!1}function Mm(){var i=ks;return i!==null&&(dr===null?dr=i:dr.push.apply(dr,i),ks=null),i}function uc(i){ks===null?ks=[i]:ks.push(i)}var Nm=I(null),Ro=null,qi=null;function Rs(i,o,c){j(Nm,o._currentValue),o._currentValue=c}function Ki(i){i._currentValue=Nm.current,Z(Nm)}function Am(i,o,c){for(;i!==null;){var f=i.alternate;if((i.childLanes&o)!==o?(i.childLanes|=o,f!==null&&(f.childLanes|=o)):f!==null&&(f.childLanes&o)!==o&&(f.childLanes|=o),i===c)break;i=i.return}}function Dm(i,o,c,f){var v=i.child;for(v!==null&&(v.return=i);v!==null;){var x=v.dependencies;if(x!==null){var E=v.child;x=x.firstContext;e:for(;x!==null;){var D=x;x=v;for(var K=0;K<o.length;K++)if(D.context===o[K]){x.lanes|=c,D=x.alternate,D!==null&&(D.lanes|=c),Am(x.return,c,i),f||(E=null);break e}x=D.next}}else if(v.tag===18){if(E=v.return,E===null)throw Error(r(341));E.lanes|=c,x=E.alternate,x!==null&&(x.lanes|=c),Am(E,c,i),E=null}else E=v.child;if(E!==null)E.return=v;else for(E=v;E!==null;){if(E===i){E=null;break}if(v=E.sibling,v!==null){v.return=E.return,E=v;break}E=E.return}v=E}}function La(i,o,c,f){i=null;for(var v=o,x=!1;v!==null;){if(!x){if((v.flags&524288)!==0)x=!0;else if((v.flags&262144)!==0)break}if(v.tag===10){var E=v.alternate;if(E===null)throw Error(r(387));if(E=E.memoizedProps,E!==null){var D=v.type;_r(v.pendingProps.value,E.value)||(i!==null?i.push(D):i=[D])}}else if(v===de.current){if(E=v.alternate,E===null)throw Error(r(387));E.memoizedState.memoizedState!==v.memoizedState.memoizedState&&(i!==null?i.push(Pc):i=[Pc])}v=v.return}i!==null&&Dm(o,i,c,f),o.flags|=262144}function Dd(i){for(i=i.firstContext;i!==null;){if(!_r(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function To(i){Ro=i,qi=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function Pn(i){return i1(Ro,i)}function Od(i,o){return Ro===null&&To(i),i1(i,o)}function i1(i,o){var c=o._currentValue;if(o={context:o,memoizedValue:c,next:null},qi===null){if(i===null)throw Error(r(308));qi=o,i.dependencies={lanes:0,firstContext:o},i.flags|=524288}else qi=qi.next=o;return c}var p4=typeof AbortController<"u"?AbortController:function(){var i=[],o=this.signal={aborted:!1,addEventListener:function(c,f){i.push(f)}};this.abort=function(){o.aborted=!0,i.forEach(function(c){return c()})}},m4=e.unstable_scheduleCallback,g4=e.unstable_NormalPriority,tn={$$typeof:T,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Om(){return{controller:new p4,data:new Map,refCount:0}}function dc(i){i.refCount--,i.refCount===0&&m4(g4,function(){i.controller.abort()})}var hc=null,jm=0,za=0,Pa=null;function v4(i,o){if(hc===null){var c=hc=[];jm=0,za=Pg(),Pa={status:"pending",value:void 0,then:function(f){c.push(f)}}}return jm++,o.then(s1,s1),o}function s1(){if(--jm===0&&hc!==null){Pa!==null&&(Pa.status="fulfilled");var i=hc;hc=null,za=0,Pa=null;for(var o=0;o<i.length;o++)(0,i[o])()}}function _4(i,o){var c=[],f={status:"pending",value:null,reason:null,then:function(v){c.push(v)}};return i.then(function(){f.status="fulfilled",f.value=o;for(var v=0;v<c.length;v++)(0,c[v])(o)},function(v){for(f.status="rejected",f.reason=v,v=0;v<c.length;v++)(0,c[v])(void 0)}),f}var o1=z.S;z.S=function(i,o){$w=Dt(),typeof o=="object"&&o!==null&&typeof o.then=="function"&&v4(i,o),o1!==null&&o1(i,o)};var Mo=I(null);function Lm(){var i=Mo.current;return i!==null?i:Ot.pooledCache}function jd(i,o){o===null?j(Mo,Mo.current):j(Mo,o.pool)}function a1(){var i=Lm();return i===null?null:{parent:tn._currentValue,pool:i}}var Ba=Error(r(460)),zm=Error(r(474)),Ld=Error(r(542)),zd={then:function(){}};function l1(i){return i=i.status,i==="fulfilled"||i==="rejected"}function c1(i,o,c){switch(c=i[c],c===void 0?i.push(o):c!==o&&(o.then(Ui,Ui),o=c),o.status){case"fulfilled":return o.value;case"rejected":throw i=o.reason,d1(i),i;default:if(typeof o.status=="string")o.then(Ui,Ui);else{if(i=Ot,i!==null&&100<i.shellSuspendCounter)throw Error(r(482));i=o,i.status="pending",i.then(function(f){if(o.status==="pending"){var v=o;v.status="fulfilled",v.value=f}},function(f){if(o.status==="pending"){var v=o;v.status="rejected",v.reason=f}})}switch(o.status){case"fulfilled":return o.value;case"rejected":throw i=o.reason,d1(i),i}throw Ao=o,Ba}}function No(i){try{var o=i._init;return o(i._payload)}catch(c){throw c!==null&&typeof c=="object"&&typeof c.then=="function"?(Ao=c,Ba):c}}var Ao=null;function u1(){if(Ao===null)throw Error(r(459));var i=Ao;return Ao=null,i}function d1(i){if(i===Ba||i===Ld)throw Error(r(483))}var Ia=null,fc=0;function Pd(i){var o=fc;return fc+=1,Ia===null&&(Ia=[]),c1(Ia,i,o)}function pc(i,o){o=o.props.ref,i.ref=o!==void 0?o:null}function Bd(i,o){throw o.$$typeof===_?Error(r(525)):(i=Object.prototype.toString.call(o),Error(r(31,i==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":i)))}function h1(i){function o(J,X){if(i){var te=J.deletions;te===null?(J.deletions=[X],J.flags|=16):te.push(X)}}function c(J,X){if(!i)return null;for(;X!==null;)o(J,X),X=X.sibling;return null}function f(J){for(var X=new Map;J!==null;)J.key!==null?X.set(J.key,J):X.set(J.index,J),J=J.sibling;return X}function v(J,X){return J=Wi(J,X),J.index=0,J.sibling=null,J}function x(J,X,te){return J.index=te,i?(te=J.alternate,te!==null?(te=te.index,te<X?(J.flags|=67108866,X):te):(J.flags|=67108866,X)):(J.flags|=1048576,X)}function E(J){return i&&J.alternate===null&&(J.flags|=67108866),J}function D(J,X,te,pe){return X===null||X.tag!==6?(X=Cm(te,J.mode,pe),X.return=J,X):(X=v(X,te),X.return=J,X)}function K(J,X,te,pe){var Pe=te.type;return Pe===S?he(J,X,te.props.children,pe,te.key):X!==null&&(X.elementType===Pe||typeof Pe=="object"&&Pe!==null&&Pe.$$typeof===F&&No(Pe)===X.type)?(X=v(X,te.props),pc(X,te),X.return=J,X):(X=Nd(te.type,te.key,te.props,null,J.mode,pe),pc(X,te),X.return=J,X)}function ne(J,X,te,pe){return X===null||X.tag!==4||X.stateNode.containerInfo!==te.containerInfo||X.stateNode.implementation!==te.implementation?(X=km(te,J.mode,pe),X.return=J,X):(X=v(X,te.children||[]),X.return=J,X)}function he(J,X,te,pe,Pe){return X===null||X.tag!==7?(X=ko(te,J.mode,pe,Pe),X.return=J,X):(X=v(X,te),X.return=J,X)}function me(J,X,te){if(typeof X=="string"&&X!==""||typeof X=="number"||typeof X=="bigint")return X=Cm(""+X,J.mode,te),X.return=J,X;if(typeof X=="object"&&X!==null){switch(X.$$typeof){case b:return te=Nd(X.type,X.key,X.props,null,J.mode,te),pc(te,X),te.return=J,te;case w:return X=km(X,J.mode,te),X.return=J,X;case F:return X=No(X),me(J,X,te)}if(W(X)||P(X))return X=ko(X,J.mode,te,null),X.return=J,X;if(typeof X.then=="function")return me(J,Pd(X),te);if(X.$$typeof===T)return me(J,Od(J,X),te);Bd(J,X)}return null}function se(J,X,te,pe){var Pe=X!==null?X.key:null;if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return Pe!==null?null:D(J,X,""+te,pe);if(typeof te=="object"&&te!==null){switch(te.$$typeof){case b:return te.key===Pe?K(J,X,te,pe):null;case w:return te.key===Pe?ne(J,X,te,pe):null;case F:return te=No(te),se(J,X,te,pe)}if(W(te)||P(te))return Pe!==null?null:he(J,X,te,pe,null);if(typeof te.then=="function")return se(J,X,Pd(te),pe);if(te.$$typeof===T)return se(J,X,Od(J,te),pe);Bd(J,te)}return null}function ae(J,X,te,pe,Pe){if(typeof pe=="string"&&pe!==""||typeof pe=="number"||typeof pe=="bigint")return J=J.get(te)||null,D(X,J,""+pe,Pe);if(typeof pe=="object"&&pe!==null){switch(pe.$$typeof){case b:return J=J.get(pe.key===null?te:pe.key)||null,K(X,J,pe,Pe);case w:return J=J.get(pe.key===null?te:pe.key)||null,ne(X,J,pe,Pe);case F:return pe=No(pe),ae(J,X,te,pe,Pe)}if(W(pe)||P(pe))return J=J.get(te)||null,he(X,J,pe,Pe,null);if(typeof pe.then=="function")return ae(J,X,te,Pd(pe),Pe);if(pe.$$typeof===T)return ae(J,X,te,Od(X,pe),Pe);Bd(X,pe)}return null}function De(J,X,te,pe){for(var Pe=null,ft=null,Le=X,Ge=X=0,at=null;Le!==null&&Ge<te.length;Ge++){Le.index>Ge?(at=Le,Le=null):at=Le.sibling;var pt=se(J,Le,te[Ge],pe);if(pt===null){Le===null&&(Le=at);break}i&&Le&&pt.alternate===null&&o(J,Le),X=x(pt,X,Ge),ft===null?Pe=pt:ft.sibling=pt,ft=pt,Le=at}if(Ge===te.length)return c(J,Le),lt&&Vi(J,Ge),Pe;if(Le===null){for(;Ge<te.length;Ge++)Le=me(J,te[Ge],pe),Le!==null&&(X=x(Le,X,Ge),ft===null?Pe=Le:ft.sibling=Le,ft=Le);return lt&&Vi(J,Ge),Pe}for(Le=f(Le);Ge<te.length;Ge++)at=ae(Le,J,Ge,te[Ge],pe),at!==null&&(i&&at.alternate!==null&&Le.delete(at.key===null?Ge:at.key),X=x(at,X,Ge),ft===null?Pe=at:ft.sibling=at,ft=at);return i&&Le.forEach(function(Vs){return o(J,Vs)}),lt&&Vi(J,Ge),Pe}function Ie(J,X,te,pe){if(te==null)throw Error(r(151));for(var Pe=null,ft=null,Le=X,Ge=X=0,at=null,pt=te.next();Le!==null&&!pt.done;Ge++,pt=te.next()){Le.index>Ge?(at=Le,Le=null):at=Le.sibling;var Vs=se(J,Le,pt.value,pe);if(Vs===null){Le===null&&(Le=at);break}i&&Le&&Vs.alternate===null&&o(J,Le),X=x(Vs,X,Ge),ft===null?Pe=Vs:ft.sibling=Vs,ft=Vs,Le=at}if(pt.done)return c(J,Le),lt&&Vi(J,Ge),Pe;if(Le===null){for(;!pt.done;Ge++,pt=te.next())pt=me(J,pt.value,pe),pt!==null&&(X=x(pt,X,Ge),ft===null?Pe=pt:ft.sibling=pt,ft=pt);return lt&&Vi(J,Ge),Pe}for(Le=f(Le);!pt.done;Ge++,pt=te.next())pt=ae(Le,J,Ge,pt.value,pe),pt!==null&&(i&&pt.alternate!==null&&Le.delete(pt.key===null?Ge:pt.key),X=x(pt,X,Ge),ft===null?Pe=pt:ft.sibling=pt,ft=pt);return i&&Le.forEach(function(MO){return o(J,MO)}),lt&&Vi(J,Ge),Pe}function Mt(J,X,te,pe){if(typeof te=="object"&&te!==null&&te.type===S&&te.key===null&&(te=te.props.children),typeof te=="object"&&te!==null){switch(te.$$typeof){case b:e:{for(var Pe=te.key;X!==null;){if(X.key===Pe){if(Pe=te.type,Pe===S){if(X.tag===7){c(J,X.sibling),pe=v(X,te.props.children),pe.return=J,J=pe;break e}}else if(X.elementType===Pe||typeof Pe=="object"&&Pe!==null&&Pe.$$typeof===F&&No(Pe)===X.type){c(J,X.sibling),pe=v(X,te.props),pc(pe,te),pe.return=J,J=pe;break e}c(J,X);break}else o(J,X);X=X.sibling}te.type===S?(pe=ko(te.props.children,J.mode,pe,te.key),pe.return=J,J=pe):(pe=Nd(te.type,te.key,te.props,null,J.mode,pe),pc(pe,te),pe.return=J,J=pe)}return E(J);case w:e:{for(Pe=te.key;X!==null;){if(X.key===Pe)if(X.tag===4&&X.stateNode.containerInfo===te.containerInfo&&X.stateNode.implementation===te.implementation){c(J,X.sibling),pe=v(X,te.children||[]),pe.return=J,J=pe;break e}else{c(J,X);break}else o(J,X);X=X.sibling}pe=km(te,J.mode,pe),pe.return=J,J=pe}return E(J);case F:return te=No(te),Mt(J,X,te,pe)}if(W(te))return De(J,X,te,pe);if(P(te)){if(Pe=P(te),typeof Pe!="function")throw Error(r(150));return te=Pe.call(te),Ie(J,X,te,pe)}if(typeof te.then=="function")return Mt(J,X,Pd(te),pe);if(te.$$typeof===T)return Mt(J,X,Od(J,te),pe);Bd(J,te)}return typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint"?(te=""+te,X!==null&&X.tag===6?(c(J,X.sibling),pe=v(X,te),pe.return=J,J=pe):(c(J,X),pe=Cm(te,J.mode,pe),pe.return=J,J=pe),E(J)):c(J,X)}return function(J,X,te,pe){try{fc=0;var Pe=Mt(J,X,te,pe);return Ia=null,Pe}catch(Le){if(Le===Ba||Le===Ld)throw Le;var ft=yr(29,Le,null,J.mode);return ft.lanes=pe,ft.return=J,ft}finally{}}}var Do=h1(!0),f1=h1(!1),Ts=!1;function Pm(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Bm(i,o){i=i.updateQueue,o.updateQueue===i&&(o.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,callbacks:null})}function Ms(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function Ns(i,o,c){var f=i.updateQueue;if(f===null)return null;if(f=f.shared,(vt&2)!==0){var v=f.pending;return v===null?o.next=o:(o.next=v.next,v.next=o),f.pending=o,o=Md(i),Xx(i,null,c),o}return Td(i,f,o,c),Md(i)}function mc(i,o,c){if(o=o.updateQueue,o!==null&&(o=o.shared,(c&4194048)!==0)){var f=o.lanes;f&=i.pendingLanes,c|=f,o.lanes=c,jn(i,c)}}function Im(i,o){var c=i.updateQueue,f=i.alternate;if(f!==null&&(f=f.updateQueue,c===f)){var v=null,x=null;if(c=c.firstBaseUpdate,c!==null){do{var E={lane:c.lane,tag:c.tag,payload:c.payload,callback:null,next:null};x===null?v=x=E:x=x.next=E,c=c.next}while(c!==null);x===null?v=x=o:x=x.next=o}else v=x=o;c={baseState:f.baseState,firstBaseUpdate:v,lastBaseUpdate:x,shared:f.shared,callbacks:f.callbacks},i.updateQueue=c;return}i=c.lastBaseUpdate,i===null?c.firstBaseUpdate=o:i.next=o,c.lastBaseUpdate=o}var Hm=!1;function gc(){if(Hm){var i=Pa;if(i!==null)throw i}}function vc(i,o,c,f){Hm=!1;var v=i.updateQueue;Ts=!1;var x=v.firstBaseUpdate,E=v.lastBaseUpdate,D=v.shared.pending;if(D!==null){v.shared.pending=null;var K=D,ne=K.next;K.next=null,E===null?x=ne:E.next=ne,E=K;var he=i.alternate;he!==null&&(he=he.updateQueue,D=he.lastBaseUpdate,D!==E&&(D===null?he.firstBaseUpdate=ne:D.next=ne,he.lastBaseUpdate=K))}if(x!==null){var me=v.baseState;E=0,he=ne=K=null,D=x;do{var se=D.lane&-536870913,ae=se!==D.lane;if(ae?(ot&se)===se:(f&se)===se){se!==0&&se===za&&(Hm=!0),he!==null&&(he=he.next={lane:0,tag:D.tag,payload:D.payload,callback:null,next:null});e:{var De=i,Ie=D;se=o;var Mt=c;switch(Ie.tag){case 1:if(De=Ie.payload,typeof De=="function"){me=De.call(Mt,me,se);break e}me=De;break e;case 3:De.flags=De.flags&-65537|128;case 0:if(De=Ie.payload,se=typeof De=="function"?De.call(Mt,me,se):De,se==null)break e;me=g({},me,se);break e;case 2:Ts=!0}}se=D.callback,se!==null&&(i.flags|=64,ae&&(i.flags|=8192),ae=v.callbacks,ae===null?v.callbacks=[se]:ae.push(se))}else ae={lane:se,tag:D.tag,payload:D.payload,callback:D.callback,next:null},he===null?(ne=he=ae,K=me):he=he.next=ae,E|=se;if(D=D.next,D===null){if(D=v.shared.pending,D===null)break;ae=D,D=ae.next,ae.next=null,v.lastBaseUpdate=ae,v.shared.pending=null}}while(!0);he===null&&(K=me),v.baseState=K,v.firstBaseUpdate=ne,v.lastBaseUpdate=he,x===null&&(v.shared.lanes=0),Ls|=E,i.lanes=E,i.memoizedState=me}}function p1(i,o){if(typeof i!="function")throw Error(r(191,i));i.call(o)}function m1(i,o){var c=i.callbacks;if(c!==null)for(i.callbacks=null,i=0;i<c.length;i++)p1(c[i],o)}var Ha=I(null),Id=I(0);function g1(i,o){i=ns,j(Id,i),j(Ha,o),ns=i|o.baseLanes}function Fm(){j(Id,ns),j(Ha,Ha.current)}function Um(){ns=Id.current,Z(Ha),Z(Id)}var br=I(null),Fr=null;function As(i){var o=i.alternate;j(Qt,Qt.current&1),j(br,i),Fr===null&&(o===null||Ha.current!==null||o.memoizedState!==null)&&(Fr=i)}function $m(i){j(Qt,Qt.current),j(br,i),Fr===null&&(Fr=i)}function v1(i){i.tag===22?(j(Qt,Qt.current),j(br,i),Fr===null&&(Fr=i)):Ds()}function Ds(){j(Qt,Qt.current),j(br,br.current)}function xr(i){Z(br),Fr===i&&(Fr=null),Z(Qt)}var Qt=I(0);function Hd(i){for(var o=i;o!==null;){if(o.tag===13){var c=o.memoizedState;if(c!==null&&(c=c.dehydrated,c===null||Yg(c)||Xg(c)))return o}else if(o.tag===19&&(o.memoizedProps.revealOrder==="forwards"||o.memoizedProps.revealOrder==="backwards"||o.memoizedProps.revealOrder==="unstable_legacy-backwards"||o.memoizedProps.revealOrder==="together")){if((o.flags&128)!==0)return o}else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===i)break;for(;o.sibling===null;){if(o.return===null||o.return===i)return null;o=o.return}o.sibling.return=o.return,o=o.sibling}return null}var Gi=0,Ke=null,Rt=null,nn=null,Fd=!1,Fa=!1,Oo=!1,Ud=0,_c=0,Ua=null,y4=0;function qt(){throw Error(r(321))}function Wm(i,o){if(o===null)return!1;for(var c=0;c<o.length&&c<i.length;c++)if(!_r(i[c],o[c]))return!1;return!0}function Vm(i,o,c,f,v,x){return Gi=x,Ke=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,z.H=i===null||i.memoizedState===null?ew:og,Oo=!1,x=c(f,v),Oo=!1,Fa&&(x=y1(o,c,f,v)),_1(i),x}function _1(i){z.H=xc;var o=Rt!==null&&Rt.next!==null;if(Gi=0,nn=Rt=Ke=null,Fd=!1,_c=0,Ua=null,o)throw Error(r(300));i===null||rn||(i=i.dependencies,i!==null&&Dd(i)&&(rn=!0))}function y1(i,o,c,f){Ke=i;var v=0;do{if(Fa&&(Ua=null),_c=0,Fa=!1,25<=v)throw Error(r(301));if(v+=1,nn=Rt=null,i.updateQueue!=null){var x=i.updateQueue;x.lastEffect=null,x.events=null,x.stores=null,x.memoCache!=null&&(x.memoCache.index=0)}z.H=tw,x=o(c,f)}while(Fa);return x}function b4(){var i=z.H,o=i.useState()[0];return o=typeof o.then=="function"?yc(o):o,i=i.useState()[0],(Rt!==null?Rt.memoizedState:null)!==i&&(Ke.flags|=1024),o}function qm(){var i=Ud!==0;return Ud=0,i}function Km(i,o,c){o.updateQueue=i.updateQueue,o.flags&=-2053,i.lanes&=~c}function Gm(i){if(Fd){for(i=i.memoizedState;i!==null;){var o=i.queue;o!==null&&(o.pending=null),i=i.next}Fd=!1}Gi=0,nn=Rt=Ke=null,Fa=!1,_c=Ud=0,Ua=null}function Zn(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return nn===null?Ke.memoizedState=nn=i:nn=nn.next=i,nn}function Jt(){if(Rt===null){var i=Ke.alternate;i=i!==null?i.memoizedState:null}else i=Rt.next;var o=nn===null?Ke.memoizedState:nn.next;if(o!==null)nn=o,Rt=i;else{if(i===null)throw Ke.alternate===null?Error(r(467)):Error(r(310));Rt=i,i={memoizedState:Rt.memoizedState,baseState:Rt.baseState,baseQueue:Rt.baseQueue,queue:Rt.queue,next:null},nn===null?Ke.memoizedState=nn=i:nn=nn.next=i}return nn}function $d(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function yc(i){var o=_c;return _c+=1,Ua===null&&(Ua=[]),i=c1(Ua,i,o),o=Ke,(nn===null?o.memoizedState:nn.next)===null&&(o=o.alternate,z.H=o===null||o.memoizedState===null?ew:og),i}function Wd(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return yc(i);if(i.$$typeof===T)return Pn(i)}throw Error(r(438,String(i)))}function Ym(i){var o=null,c=Ke.updateQueue;if(c!==null&&(o=c.memoCache),o==null){var f=Ke.alternate;f!==null&&(f=f.updateQueue,f!==null&&(f=f.memoCache,f!=null&&(o={data:f.data.map(function(v){return v.slice()}),index:0})))}if(o==null&&(o={data:[],index:0}),c===null&&(c=$d(),Ke.updateQueue=c),c.memoCache=o,c=o.data[o.index],c===void 0)for(c=o.data[o.index]=Array(i),f=0;f<i;f++)c[f]=B;return o.index++,c}function Yi(i,o){return typeof o=="function"?o(i):o}function Vd(i){var o=Jt();return Xm(o,Rt,i)}function Xm(i,o,c){var f=i.queue;if(f===null)throw Error(r(311));f.lastRenderedReducer=c;var v=i.baseQueue,x=f.pending;if(x!==null){if(v!==null){var E=v.next;v.next=x.next,x.next=E}o.baseQueue=v=x,f.pending=null}if(x=i.baseState,v===null)i.memoizedState=x;else{o=v.next;var D=E=null,K=null,ne=o,he=!1;do{var me=ne.lane&-536870913;if(me!==ne.lane?(ot&me)===me:(Gi&me)===me){var se=ne.revertLane;if(se===0)K!==null&&(K=K.next={lane:0,revertLane:0,gesture:null,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null}),me===za&&(he=!0);else if((Gi&se)===se){ne=ne.next,se===za&&(he=!0);continue}else me={lane:0,revertLane:ne.revertLane,gesture:null,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null},K===null?(D=K=me,E=x):K=K.next=me,Ke.lanes|=se,Ls|=se;me=ne.action,Oo&&c(x,me),x=ne.hasEagerState?ne.eagerState:c(x,me)}else se={lane:me,revertLane:ne.revertLane,gesture:ne.gesture,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null},K===null?(D=K=se,E=x):K=K.next=se,Ke.lanes|=me,Ls|=me;ne=ne.next}while(ne!==null&&ne!==o);if(K===null?E=x:K.next=D,!_r(x,i.memoizedState)&&(rn=!0,he&&(c=Pa,c!==null)))throw c;i.memoizedState=x,i.baseState=E,i.baseQueue=K,f.lastRenderedState=x}return v===null&&(f.lanes=0),[i.memoizedState,f.dispatch]}function Zm(i){var o=Jt(),c=o.queue;if(c===null)throw Error(r(311));c.lastRenderedReducer=i;var f=c.dispatch,v=c.pending,x=o.memoizedState;if(v!==null){c.pending=null;var E=v=v.next;do x=i(x,E.action),E=E.next;while(E!==v);_r(x,o.memoizedState)||(rn=!0),o.memoizedState=x,o.baseQueue===null&&(o.baseState=x),c.lastRenderedState=x}return[x,f]}function b1(i,o,c){var f=Ke,v=Jt(),x=lt;if(x){if(c===void 0)throw Error(r(407));c=c()}else c=o();var E=!_r((Rt||v).memoizedState,c);if(E&&(v.memoizedState=c,rn=!0),v=v.queue,eg(S1.bind(null,f,v,i),[i]),v.getSnapshot!==o||E||nn!==null&&nn.memoizedState.tag&1){if(f.flags|=2048,$a(9,{destroy:void 0},w1.bind(null,f,v,c,o),null),Ot===null)throw Error(r(349));x||(Gi&127)!==0||x1(f,o,c)}return c}function x1(i,o,c){i.flags|=16384,i={getSnapshot:o,value:c},o=Ke.updateQueue,o===null?(o=$d(),Ke.updateQueue=o,o.stores=[i]):(c=o.stores,c===null?o.stores=[i]:c.push(i))}function w1(i,o,c,f){o.value=c,o.getSnapshot=f,C1(o)&&k1(i)}function S1(i,o,c){return c(function(){C1(o)&&k1(i)})}function C1(i){var o=i.getSnapshot;i=i.value;try{var c=o();return!_r(i,c)}catch{return!0}}function k1(i){var o=Co(i,2);o!==null&&hr(o,i,2)}function Qm(i){var o=Zn();if(typeof i=="function"){var c=i;if(i=c(),Oo){ie(!0);try{c()}finally{ie(!1)}}}return o.memoizedState=o.baseState=i,o.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Yi,lastRenderedState:i},o}function E1(i,o,c,f){return i.baseState=c,Xm(i,Rt,typeof f=="function"?f:Yi)}function x4(i,o,c,f,v){if(Gd(i))throw Error(r(485));if(i=o.action,i!==null){var x={payload:v,action:i,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(E){x.listeners.push(E)}};z.T!==null?c(!0):x.isTransition=!1,f(x),c=o.pending,c===null?(x.next=o.pending=x,R1(o,x)):(x.next=c.next,o.pending=c.next=x)}}function R1(i,o){var c=o.action,f=o.payload,v=i.state;if(o.isTransition){var x=z.T,E={};z.T=E;try{var D=c(v,f),K=z.S;K!==null&&K(E,D),T1(i,o,D)}catch(ne){Jm(i,o,ne)}finally{x!==null&&E.types!==null&&(x.types=E.types),z.T=x}}else try{x=c(v,f),T1(i,o,x)}catch(ne){Jm(i,o,ne)}}function T1(i,o,c){c!==null&&typeof c=="object"&&typeof c.then=="function"?c.then(function(f){M1(i,o,f)},function(f){return Jm(i,o,f)}):M1(i,o,c)}function M1(i,o,c){o.status="fulfilled",o.value=c,N1(o),i.state=c,o=i.pending,o!==null&&(c=o.next,c===o?i.pending=null:(c=c.next,o.next=c,R1(i,c)))}function Jm(i,o,c){var f=i.pending;if(i.pending=null,f!==null){f=f.next;do o.status="rejected",o.reason=c,N1(o),o=o.next;while(o!==f)}i.action=null}function N1(i){i=i.listeners;for(var o=0;o<i.length;o++)(0,i[o])()}function A1(i,o){return o}function D1(i,o){if(lt){var c=Ot.formState;if(c!==null){e:{var f=Ke;if(lt){if(Bt){t:{for(var v=Bt,x=Hr;v.nodeType!==8;){if(!x){v=null;break t}if(v=Ur(v.nextSibling),v===null){v=null;break t}}x=v.data,v=x==="F!"||x==="F"?v:null}if(v){Bt=Ur(v.nextSibling),f=v.data==="F!";break e}}Es(f)}f=!1}f&&(o=c[0])}}return c=Zn(),c.memoizedState=c.baseState=o,f={pending:null,lanes:0,dispatch:null,lastRenderedReducer:A1,lastRenderedState:o},c.queue=f,c=Z1.bind(null,Ke,f),f.dispatch=c,f=Qm(!1),x=sg.bind(null,Ke,!1,f.queue),f=Zn(),v={state:o,dispatch:null,action:i,pending:null},f.queue=v,c=x4.bind(null,Ke,v,x,c),v.dispatch=c,f.memoizedState=i,[o,c,!1]}function O1(i){var o=Jt();return j1(o,Rt,i)}function j1(i,o,c){if(o=Xm(i,o,A1)[0],i=Vd(Yi)[0],typeof o=="object"&&o!==null&&typeof o.then=="function")try{var f=yc(o)}catch(E){throw E===Ba?Ld:E}else f=o;o=Jt();var v=o.queue,x=v.dispatch;return c!==o.memoizedState&&(Ke.flags|=2048,$a(9,{destroy:void 0},w4.bind(null,v,c),null)),[f,x,i]}function w4(i,o){i.action=o}function L1(i){var o=Jt(),c=Rt;if(c!==null)return j1(o,c,i);Jt(),o=o.memoizedState,c=Jt();var f=c.queue.dispatch;return c.memoizedState=i,[o,f,!1]}function $a(i,o,c,f){return i={tag:i,create:c,deps:f,inst:o,next:null},o=Ke.updateQueue,o===null&&(o=$d(),Ke.updateQueue=o),c=o.lastEffect,c===null?o.lastEffect=i.next=i:(f=c.next,c.next=i,i.next=f,o.lastEffect=i),i}function z1(){return Jt().memoizedState}function qd(i,o,c,f){var v=Zn();Ke.flags|=i,v.memoizedState=$a(1|o,{destroy:void 0},c,f===void 0?null:f)}function Kd(i,o,c,f){var v=Jt();f=f===void 0?null:f;var x=v.memoizedState.inst;Rt!==null&&f!==null&&Wm(f,Rt.memoizedState.deps)?v.memoizedState=$a(o,x,c,f):(Ke.flags|=i,v.memoizedState=$a(1|o,x,c,f))}function P1(i,o){qd(8390656,8,i,o)}function eg(i,o){Kd(2048,8,i,o)}function S4(i){Ke.flags|=4;var o=Ke.updateQueue;if(o===null)o=$d(),Ke.updateQueue=o,o.events=[i];else{var c=o.events;c===null?o.events=[i]:c.push(i)}}function B1(i){var o=Jt().memoizedState;return S4({ref:o,nextImpl:i}),function(){if((vt&2)!==0)throw Error(r(440));return o.impl.apply(void 0,arguments)}}function I1(i,o){return Kd(4,2,i,o)}function H1(i,o){return Kd(4,4,i,o)}function F1(i,o){if(typeof o=="function"){i=i();var c=o(i);return function(){typeof c=="function"?c():o(null)}}if(o!=null)return i=i(),o.current=i,function(){o.current=null}}function U1(i,o,c){c=c!=null?c.concat([i]):null,Kd(4,4,F1.bind(null,o,i),c)}function tg(){}function $1(i,o){var c=Jt();o=o===void 0?null:o;var f=c.memoizedState;return o!==null&&Wm(o,f[1])?f[0]:(c.memoizedState=[i,o],i)}function W1(i,o){var c=Jt();o=o===void 0?null:o;var f=c.memoizedState;if(o!==null&&Wm(o,f[1]))return f[0];if(f=i(),Oo){ie(!0);try{i()}finally{ie(!1)}}return c.memoizedState=[f,o],f}function ng(i,o,c){return c===void 0||(Gi&1073741824)!==0&&(ot&261930)===0?i.memoizedState=o:(i.memoizedState=c,i=Vw(),Ke.lanes|=i,Ls|=i,c)}function V1(i,o,c,f){return _r(c,o)?c:Ha.current!==null?(i=ng(i,c,f),_r(i,o)||(rn=!0),i):(Gi&42)===0||(Gi&1073741824)!==0&&(ot&261930)===0?(rn=!0,i.memoizedState=c):(i=Vw(),Ke.lanes|=i,Ls|=i,o)}function q1(i,o,c,f,v){var x=$.p;$.p=x!==0&&8>x?x:8;var E=z.T,D={};z.T=D,sg(i,!1,o,c);try{var K=v(),ne=z.S;if(ne!==null&&ne(D,K),K!==null&&typeof K=="object"&&typeof K.then=="function"){var he=_4(K,f);bc(i,o,he,Cr(i))}else bc(i,o,f,Cr(i))}catch(me){bc(i,o,{then:function(){},status:"rejected",reason:me},Cr())}finally{$.p=x,E!==null&&D.types!==null&&(E.types=D.types),z.T=E}}function C4(){}function rg(i,o,c,f){if(i.tag!==5)throw Error(r(476));var v=K1(i).queue;q1(i,v,o,q,c===null?C4:function(){return G1(i),c(f)})}function K1(i){var o=i.memoizedState;if(o!==null)return o;o={memoizedState:q,baseState:q,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Yi,lastRenderedState:q},next:null};var c={};return o.next={memoizedState:c,baseState:c,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Yi,lastRenderedState:c},next:null},i.memoizedState=o,i=i.alternate,i!==null&&(i.memoizedState=o),o}function G1(i){var o=K1(i);o.next===null&&(o=i.alternate.memoizedState),bc(i,o.next.queue,{},Cr())}function ig(){return Pn(Pc)}function Y1(){return Jt().memoizedState}function X1(){return Jt().memoizedState}function k4(i){for(var o=i.return;o!==null;){switch(o.tag){case 24:case 3:var c=Cr();i=Ms(c);var f=Ns(o,i,c);f!==null&&(hr(f,o,c),mc(f,o,c)),o={cache:Om()},i.payload=o;return}o=o.return}}function E4(i,o,c){var f=Cr();c={lane:f,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},Gd(i)?Q1(o,c):(c=wm(i,o,c,f),c!==null&&(hr(c,i,f),J1(c,o,f)))}function Z1(i,o,c){var f=Cr();bc(i,o,c,f)}function bc(i,o,c,f){var v={lane:f,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null};if(Gd(i))Q1(o,v);else{var x=i.alternate;if(i.lanes===0&&(x===null||x.lanes===0)&&(x=o.lastRenderedReducer,x!==null))try{var E=o.lastRenderedState,D=x(E,c);if(v.hasEagerState=!0,v.eagerState=D,_r(D,E))return Td(i,o,v,0),Ot===null&&Rd(),!1}catch{}finally{}if(c=wm(i,o,v,f),c!==null)return hr(c,i,f),J1(c,o,f),!0}return!1}function sg(i,o,c,f){if(f={lane:2,revertLane:Pg(),gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null},Gd(i)){if(o)throw Error(r(479))}else o=wm(i,c,f,2),o!==null&&hr(o,i,2)}function Gd(i){var o=i.alternate;return i===Ke||o!==null&&o===Ke}function Q1(i,o){Fa=Fd=!0;var c=i.pending;c===null?o.next=o:(o.next=c.next,c.next=o),i.pending=o}function J1(i,o,c){if((c&4194048)!==0){var f=o.lanes;f&=i.pendingLanes,c|=f,o.lanes=c,jn(i,c)}}var xc={readContext:Pn,use:Wd,useCallback:qt,useContext:qt,useEffect:qt,useImperativeHandle:qt,useLayoutEffect:qt,useInsertionEffect:qt,useMemo:qt,useReducer:qt,useRef:qt,useState:qt,useDebugValue:qt,useDeferredValue:qt,useTransition:qt,useSyncExternalStore:qt,useId:qt,useHostTransitionStatus:qt,useFormState:qt,useActionState:qt,useOptimistic:qt,useMemoCache:qt,useCacheRefresh:qt};xc.useEffectEvent=qt;var ew={readContext:Pn,use:Wd,useCallback:function(i,o){return Zn().memoizedState=[i,o===void 0?null:o],i},useContext:Pn,useEffect:P1,useImperativeHandle:function(i,o,c){c=c!=null?c.concat([i]):null,qd(4194308,4,F1.bind(null,o,i),c)},useLayoutEffect:function(i,o){return qd(4194308,4,i,o)},useInsertionEffect:function(i,o){qd(4,2,i,o)},useMemo:function(i,o){var c=Zn();o=o===void 0?null:o;var f=i();if(Oo){ie(!0);try{i()}finally{ie(!1)}}return c.memoizedState=[f,o],f},useReducer:function(i,o,c){var f=Zn();if(c!==void 0){var v=c(o);if(Oo){ie(!0);try{c(o)}finally{ie(!1)}}}else v=o;return f.memoizedState=f.baseState=v,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:v},f.queue=i,i=i.dispatch=E4.bind(null,Ke,i),[f.memoizedState,i]},useRef:function(i){var o=Zn();return i={current:i},o.memoizedState=i},useState:function(i){i=Qm(i);var o=i.queue,c=Z1.bind(null,Ke,o);return o.dispatch=c,[i.memoizedState,c]},useDebugValue:tg,useDeferredValue:function(i,o){var c=Zn();return ng(c,i,o)},useTransition:function(){var i=Qm(!1);return i=q1.bind(null,Ke,i.queue,!0,!1),Zn().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,o,c){var f=Ke,v=Zn();if(lt){if(c===void 0)throw Error(r(407));c=c()}else{if(c=o(),Ot===null)throw Error(r(349));(ot&127)!==0||x1(f,o,c)}v.memoizedState=c;var x={value:c,getSnapshot:o};return v.queue=x,P1(S1.bind(null,f,x,i),[i]),f.flags|=2048,$a(9,{destroy:void 0},w1.bind(null,f,x,c,o),null),c},useId:function(){var i=Zn(),o=Ot.identifierPrefix;if(lt){var c=_i,f=vi;c=(f&~(1<<32-Te(f)-1)).toString(32)+c,o="_"+o+"R_"+c,c=Ud++,0<c&&(o+="H"+c.toString(32)),o+="_"}else c=y4++,o="_"+o+"r_"+c.toString(32)+"_";return i.memoizedState=o},useHostTransitionStatus:ig,useFormState:D1,useActionState:D1,useOptimistic:function(i){var o=Zn();o.memoizedState=o.baseState=i;var c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return o.queue=c,o=sg.bind(null,Ke,!0,c),c.dispatch=o,[i,o]},useMemoCache:Ym,useCacheRefresh:function(){return Zn().memoizedState=k4.bind(null,Ke)},useEffectEvent:function(i){var o=Zn(),c={impl:i};return o.memoizedState=c,function(){if((vt&2)!==0)throw Error(r(440));return c.impl.apply(void 0,arguments)}}},og={readContext:Pn,use:Wd,useCallback:$1,useContext:Pn,useEffect:eg,useImperativeHandle:U1,useInsertionEffect:I1,useLayoutEffect:H1,useMemo:W1,useReducer:Vd,useRef:z1,useState:function(){return Vd(Yi)},useDebugValue:tg,useDeferredValue:function(i,o){var c=Jt();return V1(c,Rt.memoizedState,i,o)},useTransition:function(){var i=Vd(Yi)[0],o=Jt().memoizedState;return[typeof i=="boolean"?i:yc(i),o]},useSyncExternalStore:b1,useId:Y1,useHostTransitionStatus:ig,useFormState:O1,useActionState:O1,useOptimistic:function(i,o){var c=Jt();return E1(c,Rt,i,o)},useMemoCache:Ym,useCacheRefresh:X1};og.useEffectEvent=B1;var tw={readContext:Pn,use:Wd,useCallback:$1,useContext:Pn,useEffect:eg,useImperativeHandle:U1,useInsertionEffect:I1,useLayoutEffect:H1,useMemo:W1,useReducer:Zm,useRef:z1,useState:function(){return Zm(Yi)},useDebugValue:tg,useDeferredValue:function(i,o){var c=Jt();return Rt===null?ng(c,i,o):V1(c,Rt.memoizedState,i,o)},useTransition:function(){var i=Zm(Yi)[0],o=Jt().memoizedState;return[typeof i=="boolean"?i:yc(i),o]},useSyncExternalStore:b1,useId:Y1,useHostTransitionStatus:ig,useFormState:L1,useActionState:L1,useOptimistic:function(i,o){var c=Jt();return Rt!==null?E1(c,Rt,i,o):(c.baseState=i,[i,c.queue.dispatch])},useMemoCache:Ym,useCacheRefresh:X1};tw.useEffectEvent=B1;function ag(i,o,c,f){o=i.memoizedState,c=c(f,o),c=c==null?o:g({},o,c),i.memoizedState=c,i.lanes===0&&(i.updateQueue.baseState=c)}var lg={enqueueSetState:function(i,o,c){i=i._reactInternals;var f=Cr(),v=Ms(f);v.payload=o,c!=null&&(v.callback=c),o=Ns(i,v,f),o!==null&&(hr(o,i,f),mc(o,i,f))},enqueueReplaceState:function(i,o,c){i=i._reactInternals;var f=Cr(),v=Ms(f);v.tag=1,v.payload=o,c!=null&&(v.callback=c),o=Ns(i,v,f),o!==null&&(hr(o,i,f),mc(o,i,f))},enqueueForceUpdate:function(i,o){i=i._reactInternals;var c=Cr(),f=Ms(c);f.tag=2,o!=null&&(f.callback=o),o=Ns(i,f,c),o!==null&&(hr(o,i,c),mc(o,i,c))}};function nw(i,o,c,f,v,x,E){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(f,x,E):o.prototype&&o.prototype.isPureReactComponent?!ac(c,f)||!ac(v,x):!0}function rw(i,o,c,f){i=o.state,typeof o.componentWillReceiveProps=="function"&&o.componentWillReceiveProps(c,f),typeof o.UNSAFE_componentWillReceiveProps=="function"&&o.UNSAFE_componentWillReceiveProps(c,f),o.state!==i&&lg.enqueueReplaceState(o,o.state,null)}function jo(i,o){var c=o;if("ref"in o){c={};for(var f in o)f!=="ref"&&(c[f]=o[f])}if(i=i.defaultProps){c===o&&(c=g({},c));for(var v in i)c[v]===void 0&&(c[v]=i[v])}return c}function iw(i){Ed(i)}function sw(i){console.error(i)}function ow(i){Ed(i)}function Yd(i,o){try{var c=i.onUncaughtError;c(o.value,{componentStack:o.stack})}catch(f){setTimeout(function(){throw f})}}function aw(i,o,c){try{var f=i.onCaughtError;f(c.value,{componentStack:c.stack,errorBoundary:o.tag===1?o.stateNode:null})}catch(v){setTimeout(function(){throw v})}}function cg(i,o,c){return c=Ms(c),c.tag=3,c.payload={element:null},c.callback=function(){Yd(i,o)},c}function lw(i){return i=Ms(i),i.tag=3,i}function cw(i,o,c,f){var v=c.type.getDerivedStateFromError;if(typeof v=="function"){var x=f.value;i.payload=function(){return v(x)},i.callback=function(){aw(o,c,f)}}var E=c.stateNode;E!==null&&typeof E.componentDidCatch=="function"&&(i.callback=function(){aw(o,c,f),typeof v!="function"&&(zs===null?zs=new Set([this]):zs.add(this));var D=f.stack;this.componentDidCatch(f.value,{componentStack:D!==null?D:""})})}function R4(i,o,c,f,v){if(c.flags|=32768,f!==null&&typeof f=="object"&&typeof f.then=="function"){if(o=c.alternate,o!==null&&La(o,c,v,!0),c=br.current,c!==null){switch(c.tag){case 31:case 13:return Fr===null?ah():c.alternate===null&&Kt===0&&(Kt=3),c.flags&=-257,c.flags|=65536,c.lanes=v,f===zd?c.flags|=16384:(o=c.updateQueue,o===null?c.updateQueue=new Set([f]):o.add(f),jg(i,f,v)),!1;case 22:return c.flags|=65536,f===zd?c.flags|=16384:(o=c.updateQueue,o===null?(o={transitions:null,markerInstances:null,retryQueue:new Set([f])},c.updateQueue=o):(c=o.retryQueue,c===null?o.retryQueue=new Set([f]):c.add(f)),jg(i,f,v)),!1}throw Error(r(435,c.tag))}return jg(i,f,v),ah(),!1}if(lt)return o=br.current,o!==null?((o.flags&65536)===0&&(o.flags|=256),o.flags|=65536,o.lanes=v,f!==Tm&&(i=Error(r(422),{cause:f}),uc(Pr(i,c)))):(f!==Tm&&(o=Error(r(423),{cause:f}),uc(Pr(o,c))),i=i.current.alternate,i.flags|=65536,v&=-v,i.lanes|=v,f=Pr(f,c),v=cg(i.stateNode,f,v),Im(i,v),Kt!==4&&(Kt=2)),!1;var x=Error(r(520),{cause:f});if(x=Pr(x,c),Mc===null?Mc=[x]:Mc.push(x),Kt!==4&&(Kt=2),o===null)return!0;f=Pr(f,c),c=o;do{switch(c.tag){case 3:return c.flags|=65536,i=v&-v,c.lanes|=i,i=cg(c.stateNode,f,i),Im(c,i),!1;case 1:if(o=c.type,x=c.stateNode,(c.flags&128)===0&&(typeof o.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(zs===null||!zs.has(x))))return c.flags|=65536,v&=-v,c.lanes|=v,v=lw(v),cw(v,i,c,f),Im(c,v),!1}c=c.return}while(c!==null);return!1}var ug=Error(r(461)),rn=!1;function Bn(i,o,c,f){o.child=i===null?f1(o,null,c,f):Do(o,i.child,c,f)}function uw(i,o,c,f,v){c=c.render;var x=o.ref;if("ref"in f){var E={};for(var D in f)D!=="ref"&&(E[D]=f[D])}else E=f;return To(o),f=Vm(i,o,c,E,x,v),D=qm(),i!==null&&!rn?(Km(i,o,v),Xi(i,o,v)):(lt&&D&&Em(o),o.flags|=1,Bn(i,o,f,v),o.child)}function dw(i,o,c,f,v){if(i===null){var x=c.type;return typeof x=="function"&&!Sm(x)&&x.defaultProps===void 0&&c.compare===null?(o.tag=15,o.type=x,hw(i,o,x,f,v)):(i=Nd(c.type,null,f,o,o.mode,v),i.ref=o.ref,i.return=o,o.child=i)}if(x=i.child,!_g(i,v)){var E=x.memoizedProps;if(c=c.compare,c=c!==null?c:ac,c(E,f)&&i.ref===o.ref)return Xi(i,o,v)}return o.flags|=1,i=Wi(x,f),i.ref=o.ref,i.return=o,o.child=i}function hw(i,o,c,f,v){if(i!==null){var x=i.memoizedProps;if(ac(x,f)&&i.ref===o.ref)if(rn=!1,o.pendingProps=f=x,_g(i,v))(i.flags&131072)!==0&&(rn=!0);else return o.lanes=i.lanes,Xi(i,o,v)}return dg(i,o,c,f,v)}function fw(i,o,c,f){var v=f.children,x=i!==null?i.memoizedState:null;if(i===null&&o.stateNode===null&&(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),f.mode==="hidden"){if((o.flags&128)!==0){if(x=x!==null?x.baseLanes|c:c,i!==null){for(f=o.child=i.child,v=0;f!==null;)v=v|f.lanes|f.childLanes,f=f.sibling;f=v&~x}else f=0,o.child=null;return pw(i,o,x,c,f)}if((c&536870912)!==0)o.memoizedState={baseLanes:0,cachePool:null},i!==null&&jd(o,x!==null?x.cachePool:null),x!==null?g1(o,x):Fm(),v1(o);else return f=o.lanes=536870912,pw(i,o,x!==null?x.baseLanes|c:c,c,f)}else x!==null?(jd(o,x.cachePool),g1(o,x),Ds(),o.memoizedState=null):(i!==null&&jd(o,null),Fm(),Ds());return Bn(i,o,v,c),o.child}function wc(i,o){return i!==null&&i.tag===22||o.stateNode!==null||(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.sibling}function pw(i,o,c,f,v){var x=Lm();return x=x===null?null:{parent:tn._currentValue,pool:x},o.memoizedState={baseLanes:c,cachePool:x},i!==null&&jd(o,null),Fm(),v1(o),i!==null&&La(i,o,f,!0),o.childLanes=v,null}function Xd(i,o){return o=Qd({mode:o.mode,children:o.children},i.mode),o.ref=i.ref,i.child=o,o.return=i,o}function mw(i,o,c){return Do(o,i.child,null,c),i=Xd(o,o.pendingProps),i.flags|=2,xr(o),o.memoizedState=null,i}function T4(i,o,c){var f=o.pendingProps,v=(o.flags&128)!==0;if(o.flags&=-129,i===null){if(lt){if(f.mode==="hidden")return i=Xd(o,f),o.lanes=536870912,wc(null,i);if($m(o),(i=Bt)?(i=RS(i,Hr),i=i!==null&&i.data==="&"?i:null,i!==null&&(o.memoizedState={dehydrated:i,treeContext:Cs!==null?{id:vi,overflow:_i}:null,retryLane:536870912,hydrationErrors:null},c=Qx(i),c.return=o,o.child=c,zn=o,Bt=null)):i=null,i===null)throw Es(o);return o.lanes=536870912,null}return Xd(o,f)}var x=i.memoizedState;if(x!==null){var E=x.dehydrated;if($m(o),v)if(o.flags&256)o.flags&=-257,o=mw(i,o,c);else if(o.memoizedState!==null)o.child=i.child,o.flags|=128,o=null;else throw Error(r(558));else if(rn||La(i,o,c,!1),v=(c&i.childLanes)!==0,rn||v){if(f=Ot,f!==null&&(E=Dr(f,c),E!==0&&E!==x.retryLane))throw x.retryLane=E,Co(i,E),hr(f,i,E),ug;ah(),o=mw(i,o,c)}else i=x.treeContext,Bt=Ur(E.nextSibling),zn=o,lt=!0,ks=null,Hr=!1,i!==null&&t1(o,i),o=Xd(o,f),o.flags|=4096;return o}return i=Wi(i.child,{mode:f.mode,children:f.children}),i.ref=o.ref,o.child=i,i.return=o,i}function Zd(i,o){var c=o.ref;if(c===null)i!==null&&i.ref!==null&&(o.flags|=4194816);else{if(typeof c!="function"&&typeof c!="object")throw Error(r(284));(i===null||i.ref!==c)&&(o.flags|=4194816)}}function dg(i,o,c,f,v){return To(o),c=Vm(i,o,c,f,void 0,v),f=qm(),i!==null&&!rn?(Km(i,o,v),Xi(i,o,v)):(lt&&f&&Em(o),o.flags|=1,Bn(i,o,c,v),o.child)}function gw(i,o,c,f,v,x){return To(o),o.updateQueue=null,c=y1(o,f,c,v),_1(i),f=qm(),i!==null&&!rn?(Km(i,o,x),Xi(i,o,x)):(lt&&f&&Em(o),o.flags|=1,Bn(i,o,c,x),o.child)}function vw(i,o,c,f,v){if(To(o),o.stateNode===null){var x=Aa,E=c.contextType;typeof E=="object"&&E!==null&&(x=Pn(E)),x=new c(f,x),o.memoizedState=x.state!==null&&x.state!==void 0?x.state:null,x.updater=lg,o.stateNode=x,x._reactInternals=o,x=o.stateNode,x.props=f,x.state=o.memoizedState,x.refs={},Pm(o),E=c.contextType,x.context=typeof E=="object"&&E!==null?Pn(E):Aa,x.state=o.memoizedState,E=c.getDerivedStateFromProps,typeof E=="function"&&(ag(o,c,E,f),x.state=o.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof x.getSnapshotBeforeUpdate=="function"||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(E=x.state,typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount(),E!==x.state&&lg.enqueueReplaceState(x,x.state,null),vc(o,f,x,v),gc(),x.state=o.memoizedState),typeof x.componentDidMount=="function"&&(o.flags|=4194308),f=!0}else if(i===null){x=o.stateNode;var D=o.memoizedProps,K=jo(c,D);x.props=K;var ne=x.context,he=c.contextType;E=Aa,typeof he=="object"&&he!==null&&(E=Pn(he));var me=c.getDerivedStateFromProps;he=typeof me=="function"||typeof x.getSnapshotBeforeUpdate=="function",D=o.pendingProps!==D,he||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(D||ne!==E)&&rw(o,x,f,E),Ts=!1;var se=o.memoizedState;x.state=se,vc(o,f,x,v),gc(),ne=o.memoizedState,D||se!==ne||Ts?(typeof me=="function"&&(ag(o,c,me,f),ne=o.memoizedState),(K=Ts||nw(o,c,K,f,se,ne,E))?(he||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount()),typeof x.componentDidMount=="function"&&(o.flags|=4194308)):(typeof x.componentDidMount=="function"&&(o.flags|=4194308),o.memoizedProps=f,o.memoizedState=ne),x.props=f,x.state=ne,x.context=E,f=K):(typeof x.componentDidMount=="function"&&(o.flags|=4194308),f=!1)}else{x=o.stateNode,Bm(i,o),E=o.memoizedProps,he=jo(c,E),x.props=he,me=o.pendingProps,se=x.context,ne=c.contextType,K=Aa,typeof ne=="object"&&ne!==null&&(K=Pn(ne)),D=c.getDerivedStateFromProps,(ne=typeof D=="function"||typeof x.getSnapshotBeforeUpdate=="function")||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(E!==me||se!==K)&&rw(o,x,f,K),Ts=!1,se=o.memoizedState,x.state=se,vc(o,f,x,v),gc();var ae=o.memoizedState;E!==me||se!==ae||Ts||i!==null&&i.dependencies!==null&&Dd(i.dependencies)?(typeof D=="function"&&(ag(o,c,D,f),ae=o.memoizedState),(he=Ts||nw(o,c,he,f,se,ae,K)||i!==null&&i.dependencies!==null&&Dd(i.dependencies))?(ne||typeof x.UNSAFE_componentWillUpdate!="function"&&typeof x.componentWillUpdate!="function"||(typeof x.componentWillUpdate=="function"&&x.componentWillUpdate(f,ae,K),typeof x.UNSAFE_componentWillUpdate=="function"&&x.UNSAFE_componentWillUpdate(f,ae,K)),typeof x.componentDidUpdate=="function"&&(o.flags|=4),typeof x.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof x.componentDidUpdate!="function"||E===i.memoizedProps&&se===i.memoizedState||(o.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||E===i.memoizedProps&&se===i.memoizedState||(o.flags|=1024),o.memoizedProps=f,o.memoizedState=ae),x.props=f,x.state=ae,x.context=K,f=he):(typeof x.componentDidUpdate!="function"||E===i.memoizedProps&&se===i.memoizedState||(o.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||E===i.memoizedProps&&se===i.memoizedState||(o.flags|=1024),f=!1)}return x=f,Zd(i,o),f=(o.flags&128)!==0,x||f?(x=o.stateNode,c=f&&typeof c.getDerivedStateFromError!="function"?null:x.render(),o.flags|=1,i!==null&&f?(o.child=Do(o,i.child,null,v),o.child=Do(o,null,c,v)):Bn(i,o,c,v),o.memoizedState=x.state,i=o.child):i=Xi(i,o,v),i}function _w(i,o,c,f){return Eo(),o.flags|=256,Bn(i,o,c,f),o.child}var hg={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function fg(i){return{baseLanes:i,cachePool:a1()}}function pg(i,o,c){return i=i!==null?i.childLanes&~c:0,o&&(i|=Sr),i}function yw(i,o,c){var f=o.pendingProps,v=!1,x=(o.flags&128)!==0,E;if((E=x)||(E=i!==null&&i.memoizedState===null?!1:(Qt.current&2)!==0),E&&(v=!0,o.flags&=-129),E=(o.flags&32)!==0,o.flags&=-33,i===null){if(lt){if(v?As(o):Ds(),(i=Bt)?(i=RS(i,Hr),i=i!==null&&i.data!=="&"?i:null,i!==null&&(o.memoizedState={dehydrated:i,treeContext:Cs!==null?{id:vi,overflow:_i}:null,retryLane:536870912,hydrationErrors:null},c=Qx(i),c.return=o,o.child=c,zn=o,Bt=null)):i=null,i===null)throw Es(o);return Xg(i)?o.lanes=32:o.lanes=536870912,null}var D=f.children;return f=f.fallback,v?(Ds(),v=o.mode,D=Qd({mode:"hidden",children:D},v),f=ko(f,v,c,null),D.return=o,f.return=o,D.sibling=f,o.child=D,f=o.child,f.memoizedState=fg(c),f.childLanes=pg(i,E,c),o.memoizedState=hg,wc(null,f)):(As(o),mg(o,D))}var K=i.memoizedState;if(K!==null&&(D=K.dehydrated,D!==null)){if(x)o.flags&256?(As(o),o.flags&=-257,o=gg(i,o,c)):o.memoizedState!==null?(Ds(),o.child=i.child,o.flags|=128,o=null):(Ds(),D=f.fallback,v=o.mode,f=Qd({mode:"visible",children:f.children},v),D=ko(D,v,c,null),D.flags|=2,f.return=o,D.return=o,f.sibling=D,o.child=f,Do(o,i.child,null,c),f=o.child,f.memoizedState=fg(c),f.childLanes=pg(i,E,c),o.memoizedState=hg,o=wc(null,f));else if(As(o),Xg(D)){if(E=D.nextSibling&&D.nextSibling.dataset,E)var ne=E.dgst;E=ne,f=Error(r(419)),f.stack="",f.digest=E,uc({value:f,source:null,stack:null}),o=gg(i,o,c)}else if(rn||La(i,o,c,!1),E=(c&i.childLanes)!==0,rn||E){if(E=Ot,E!==null&&(f=Dr(E,c),f!==0&&f!==K.retryLane))throw K.retryLane=f,Co(i,f),hr(E,i,f),ug;Yg(D)||ah(),o=gg(i,o,c)}else Yg(D)?(o.flags|=192,o.child=i.child,o=null):(i=K.treeContext,Bt=Ur(D.nextSibling),zn=o,lt=!0,ks=null,Hr=!1,i!==null&&t1(o,i),o=mg(o,f.children),o.flags|=4096);return o}return v?(Ds(),D=f.fallback,v=o.mode,K=i.child,ne=K.sibling,f=Wi(K,{mode:"hidden",children:f.children}),f.subtreeFlags=K.subtreeFlags&65011712,ne!==null?D=Wi(ne,D):(D=ko(D,v,c,null),D.flags|=2),D.return=o,f.return=o,f.sibling=D,o.child=f,wc(null,f),f=o.child,D=i.child.memoizedState,D===null?D=fg(c):(v=D.cachePool,v!==null?(K=tn._currentValue,v=v.parent!==K?{parent:K,pool:K}:v):v=a1(),D={baseLanes:D.baseLanes|c,cachePool:v}),f.memoizedState=D,f.childLanes=pg(i,E,c),o.memoizedState=hg,wc(i.child,f)):(As(o),c=i.child,i=c.sibling,c=Wi(c,{mode:"visible",children:f.children}),c.return=o,c.sibling=null,i!==null&&(E=o.deletions,E===null?(o.deletions=[i],o.flags|=16):E.push(i)),o.child=c,o.memoizedState=null,c)}function mg(i,o){return o=Qd({mode:"visible",children:o},i.mode),o.return=i,i.child=o}function Qd(i,o){return i=yr(22,i,null,o),i.lanes=0,i}function gg(i,o,c){return Do(o,i.child,null,c),i=mg(o,o.pendingProps.children),i.flags|=2,o.memoizedState=null,i}function bw(i,o,c){i.lanes|=o;var f=i.alternate;f!==null&&(f.lanes|=o),Am(i.return,o,c)}function vg(i,o,c,f,v,x){var E=i.memoizedState;E===null?i.memoizedState={isBackwards:o,rendering:null,renderingStartTime:0,last:f,tail:c,tailMode:v,treeForkCount:x}:(E.isBackwards=o,E.rendering=null,E.renderingStartTime=0,E.last=f,E.tail=c,E.tailMode=v,E.treeForkCount=x)}function xw(i,o,c){var f=o.pendingProps,v=f.revealOrder,x=f.tail;f=f.children;var E=Qt.current,D=(E&2)!==0;if(D?(E=E&1|2,o.flags|=128):E&=1,j(Qt,E),Bn(i,o,f,c),f=lt?cc:0,!D&&i!==null&&(i.flags&128)!==0)e:for(i=o.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&bw(i,c,o);else if(i.tag===19)bw(i,c,o);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===o)break e;for(;i.sibling===null;){if(i.return===null||i.return===o)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}switch(v){case"forwards":for(c=o.child,v=null;c!==null;)i=c.alternate,i!==null&&Hd(i)===null&&(v=c),c=c.sibling;c=v,c===null?(v=o.child,o.child=null):(v=c.sibling,c.sibling=null),vg(o,!1,v,c,x,f);break;case"backwards":case"unstable_legacy-backwards":for(c=null,v=o.child,o.child=null;v!==null;){if(i=v.alternate,i!==null&&Hd(i)===null){o.child=v;break}i=v.sibling,v.sibling=c,c=v,v=i}vg(o,!0,c,null,x,f);break;case"together":vg(o,!1,null,null,void 0,f);break;default:o.memoizedState=null}return o.child}function Xi(i,o,c){if(i!==null&&(o.dependencies=i.dependencies),Ls|=o.lanes,(c&o.childLanes)===0)if(i!==null){if(La(i,o,c,!1),(c&o.childLanes)===0)return null}else return null;if(i!==null&&o.child!==i.child)throw Error(r(153));if(o.child!==null){for(i=o.child,c=Wi(i,i.pendingProps),o.child=c,c.return=o;i.sibling!==null;)i=i.sibling,c=c.sibling=Wi(i,i.pendingProps),c.return=o;c.sibling=null}return o.child}function _g(i,o){return(i.lanes&o)!==0?!0:(i=i.dependencies,!!(i!==null&&Dd(i)))}function M4(i,o,c){switch(o.tag){case 3:we(o,o.stateNode.containerInfo),Rs(o,tn,i.memoizedState.cache),Eo();break;case 27:case 5:be(o);break;case 4:we(o,o.stateNode.containerInfo);break;case 10:Rs(o,o.type,o.memoizedProps.value);break;case 31:if(o.memoizedState!==null)return o.flags|=128,$m(o),null;break;case 13:var f=o.memoizedState;if(f!==null)return f.dehydrated!==null?(As(o),o.flags|=128,null):(c&o.child.childLanes)!==0?yw(i,o,c):(As(o),i=Xi(i,o,c),i!==null?i.sibling:null);As(o);break;case 19:var v=(i.flags&128)!==0;if(f=(c&o.childLanes)!==0,f||(La(i,o,c,!1),f=(c&o.childLanes)!==0),v){if(f)return xw(i,o,c);o.flags|=128}if(v=o.memoizedState,v!==null&&(v.rendering=null,v.tail=null,v.lastEffect=null),j(Qt,Qt.current),f)break;return null;case 22:return o.lanes=0,fw(i,o,c,o.pendingProps);case 24:Rs(o,tn,i.memoizedState.cache)}return Xi(i,o,c)}function ww(i,o,c){if(i!==null)if(i.memoizedProps!==o.pendingProps)rn=!0;else{if(!_g(i,c)&&(o.flags&128)===0)return rn=!1,M4(i,o,c);rn=(i.flags&131072)!==0}else rn=!1,lt&&(o.flags&1048576)!==0&&e1(o,cc,o.index);switch(o.lanes=0,o.tag){case 16:e:{var f=o.pendingProps;if(i=No(o.elementType),o.type=i,typeof i=="function")Sm(i)?(f=jo(i,f),o.tag=1,o=vw(null,o,i,f,c)):(o.tag=0,o=dg(null,o,i,f,c));else{if(i!=null){var v=i.$$typeof;if(v===N){o.tag=11,o=uw(null,o,i,f,c);break e}else if(v===O){o.tag=14,o=dw(null,o,i,f,c);break e}}throw o=V(i)||i,Error(r(306,o,""))}}return o;case 0:return dg(i,o,o.type,o.pendingProps,c);case 1:return f=o.type,v=jo(f,o.pendingProps),vw(i,o,f,v,c);case 3:e:{if(we(o,o.stateNode.containerInfo),i===null)throw Error(r(387));f=o.pendingProps;var x=o.memoizedState;v=x.element,Bm(i,o),vc(o,f,null,c);var E=o.memoizedState;if(f=E.cache,Rs(o,tn,f),f!==x.cache&&Dm(o,[tn],c,!0),gc(),f=E.element,x.isDehydrated)if(x={element:f,isDehydrated:!1,cache:E.cache},o.updateQueue.baseState=x,o.memoizedState=x,o.flags&256){o=_w(i,o,f,c);break e}else if(f!==v){v=Pr(Error(r(424)),o),uc(v),o=_w(i,o,f,c);break e}else{switch(i=o.stateNode.containerInfo,i.nodeType){case 9:i=i.body;break;default:i=i.nodeName==="HTML"?i.ownerDocument.body:i}for(Bt=Ur(i.firstChild),zn=o,lt=!0,ks=null,Hr=!0,c=f1(o,null,f,c),o.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling}else{if(Eo(),f===v){o=Xi(i,o,c);break e}Bn(i,o,f,c)}o=o.child}return o;case 26:return Zd(i,o),i===null?(c=OS(o.type,null,o.pendingProps,null))?o.memoizedState=c:lt||(c=o.type,i=o.pendingProps,f=ph(ue.current).createElement(c),f[Ln]=o,f[or]=i,In(f,c,i),yn(f),o.stateNode=f):o.memoizedState=OS(o.type,i.memoizedProps,o.pendingProps,i.memoizedState),null;case 27:return be(o),i===null&<&&(f=o.stateNode=NS(o.type,o.pendingProps,ue.current),zn=o,Hr=!0,v=Bt,Hs(o.type)?(Zg=v,Bt=Ur(f.firstChild)):Bt=v),Bn(i,o,o.pendingProps.children,c),Zd(i,o),i===null&&(o.flags|=4194304),o.child;case 5:return i===null&<&&((v=f=Bt)&&(f=sO(f,o.type,o.pendingProps,Hr),f!==null?(o.stateNode=f,zn=o,Bt=Ur(f.firstChild),Hr=!1,v=!0):v=!1),v||Es(o)),be(o),v=o.type,x=o.pendingProps,E=i!==null?i.memoizedProps:null,f=x.children,qg(v,x)?f=null:E!==null&&qg(v,E)&&(o.flags|=32),o.memoizedState!==null&&(v=Vm(i,o,b4,null,null,c),Pc._currentValue=v),Zd(i,o),Bn(i,o,f,c),o.child;case 6:return i===null&<&&((i=c=Bt)&&(c=oO(c,o.pendingProps,Hr),c!==null?(o.stateNode=c,zn=o,Bt=null,i=!0):i=!1),i||Es(o)),null;case 13:return yw(i,o,c);case 4:return we(o,o.stateNode.containerInfo),f=o.pendingProps,i===null?o.child=Do(o,null,f,c):Bn(i,o,f,c),o.child;case 11:return uw(i,o,o.type,o.pendingProps,c);case 7:return Bn(i,o,o.pendingProps,c),o.child;case 8:return Bn(i,o,o.pendingProps.children,c),o.child;case 12:return Bn(i,o,o.pendingProps.children,c),o.child;case 10:return f=o.pendingProps,Rs(o,o.type,f.value),Bn(i,o,f.children,c),o.child;case 9:return v=o.type._context,f=o.pendingProps.children,To(o),v=Pn(v),f=f(v),o.flags|=1,Bn(i,o,f,c),o.child;case 14:return dw(i,o,o.type,o.pendingProps,c);case 15:return hw(i,o,o.type,o.pendingProps,c);case 19:return xw(i,o,c);case 31:return T4(i,o,c);case 22:return fw(i,o,c,o.pendingProps);case 24:return To(o),f=Pn(tn),i===null?(v=Lm(),v===null&&(v=Ot,x=Om(),v.pooledCache=x,x.refCount++,x!==null&&(v.pooledCacheLanes|=c),v=x),o.memoizedState={parent:f,cache:v},Pm(o),Rs(o,tn,v)):((i.lanes&c)!==0&&(Bm(i,o),vc(o,null,null,c),gc()),v=i.memoizedState,x=o.memoizedState,v.parent!==f?(v={parent:f,cache:f},o.memoizedState=v,o.lanes===0&&(o.memoizedState=o.updateQueue.baseState=v),Rs(o,tn,f)):(f=x.cache,Rs(o,tn,f),f!==v.cache&&Dm(o,[tn],c,!0))),Bn(i,o,o.pendingProps.children,c),o.child;case 29:throw o.pendingProps}throw Error(r(156,o.tag))}function Zi(i){i.flags|=4}function yg(i,o,c,f,v){if((o=(i.mode&32)!==0)&&(o=!1),o){if(i.flags|=16777216,(v&335544128)===v)if(i.stateNode.complete)i.flags|=8192;else if(Yw())i.flags|=8192;else throw Ao=zd,zm}else i.flags&=-16777217}function Sw(i,o){if(o.type!=="stylesheet"||(o.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!BS(o))if(Yw())i.flags|=8192;else throw Ao=zd,zm}function Jd(i,o){o!==null&&(i.flags|=4),i.flags&16384&&(o=i.tag!==22?re():536870912,i.lanes|=o,Ka|=o)}function Sc(i,o){if(!lt)switch(i.tailMode){case"hidden":o=i.tail;for(var c=null;o!==null;)o.alternate!==null&&(c=o),o=o.sibling;c===null?i.tail=null:c.sibling=null;break;case"collapsed":c=i.tail;for(var f=null;c!==null;)c.alternate!==null&&(f=c),c=c.sibling;f===null?o||i.tail===null?i.tail=null:i.tail.sibling=null:f.sibling=null}}function It(i){var o=i.alternate!==null&&i.alternate.child===i.child,c=0,f=0;if(o)for(var v=i.child;v!==null;)c|=v.lanes|v.childLanes,f|=v.subtreeFlags&65011712,f|=v.flags&65011712,v.return=i,v=v.sibling;else for(v=i.child;v!==null;)c|=v.lanes|v.childLanes,f|=v.subtreeFlags,f|=v.flags,v.return=i,v=v.sibling;return i.subtreeFlags|=f,i.childLanes=c,o}function N4(i,o,c){var f=o.pendingProps;switch(Rm(o),o.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return It(o),null;case 1:return It(o),null;case 3:return c=o.stateNode,f=null,i!==null&&(f=i.memoizedState.cache),o.memoizedState.cache!==f&&(o.flags|=2048),Ki(tn),oe(),c.pendingContext&&(c.context=c.pendingContext,c.pendingContext=null),(i===null||i.child===null)&&(ja(o)?Zi(o):i===null||i.memoizedState.isDehydrated&&(o.flags&256)===0||(o.flags|=1024,Mm())),It(o),null;case 26:var v=o.type,x=o.memoizedState;return i===null?(Zi(o),x!==null?(It(o),Sw(o,x)):(It(o),yg(o,v,null,f,c))):x?x!==i.memoizedState?(Zi(o),It(o),Sw(o,x)):(It(o),o.flags&=-16777217):(i=i.memoizedProps,i!==f&&Zi(o),It(o),yg(o,v,i,f,c)),null;case 27:if(Ne(o),c=ue.current,v=o.type,i!==null&&o.stateNode!=null)i.memoizedProps!==f&&Zi(o);else{if(!f){if(o.stateNode===null)throw Error(r(166));return It(o),null}i=ce.current,ja(o)?n1(o):(i=NS(v,f,c),o.stateNode=i,Zi(o))}return It(o),null;case 5:if(Ne(o),v=o.type,i!==null&&o.stateNode!=null)i.memoizedProps!==f&&Zi(o);else{if(!f){if(o.stateNode===null)throw Error(r(166));return It(o),null}if(x=ce.current,ja(o))n1(o);else{var E=ph(ue.current);switch(x){case 1:x=E.createElementNS("http://www.w3.org/2000/svg",v);break;case 2:x=E.createElementNS("http://www.w3.org/1998/Math/MathML",v);break;default:switch(v){case"svg":x=E.createElementNS("http://www.w3.org/2000/svg",v);break;case"math":x=E.createElementNS("http://www.w3.org/1998/Math/MathML",v);break;case"script":x=E.createElement("div"),x.innerHTML="<script><\/script>",x=x.removeChild(x.firstChild);break;case"select":x=typeof f.is=="string"?E.createElement("select",{is:f.is}):E.createElement("select"),f.multiple?x.multiple=!0:f.size&&(x.size=f.size);break;default:x=typeof f.is=="string"?E.createElement(v,{is:f.is}):E.createElement(v)}}x[Ln]=o,x[or]=f;e:for(E=o.child;E!==null;){if(E.tag===5||E.tag===6)x.appendChild(E.stateNode);else if(E.tag!==4&&E.tag!==27&&E.child!==null){E.child.return=E,E=E.child;continue}if(E===o)break e;for(;E.sibling===null;){if(E.return===null||E.return===o)break e;E=E.return}E.sibling.return=E.return,E=E.sibling}o.stateNode=x;e:switch(In(x,v,f),v){case"button":case"input":case"select":case"textarea":f=!!f.autoFocus;break e;case"img":f=!0;break e;default:f=!1}f&&Zi(o)}}return It(o),yg(o,o.type,i===null?null:i.memoizedProps,o.pendingProps,c),null;case 6:if(i&&o.stateNode!=null)i.memoizedProps!==f&&Zi(o);else{if(typeof f!="string"&&o.stateNode===null)throw Error(r(166));if(i=ue.current,ja(o)){if(i=o.stateNode,c=o.memoizedProps,f=null,v=zn,v!==null)switch(v.tag){case 27:case 5:f=v.memoizedProps}i[Ln]=o,i=!!(i.nodeValue===c||f!==null&&f.suppressHydrationWarning===!0||yS(i.nodeValue,c)),i||Es(o,!0)}else i=ph(i).createTextNode(f),i[Ln]=o,o.stateNode=i}return It(o),null;case 31:if(c=o.memoizedState,i===null||i.memoizedState!==null){if(f=ja(o),c!==null){if(i===null){if(!f)throw Error(r(318));if(i=o.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(557));i[Ln]=o}else Eo(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;It(o),i=!1}else c=Mm(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=c),i=!0;if(!i)return o.flags&256?(xr(o),o):(xr(o),null);if((o.flags&128)!==0)throw Error(r(558))}return It(o),null;case 13:if(f=o.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(v=ja(o),f!==null&&f.dehydrated!==null){if(i===null){if(!v)throw Error(r(318));if(v=o.memoizedState,v=v!==null?v.dehydrated:null,!v)throw Error(r(317));v[Ln]=o}else Eo(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;It(o),v=!1}else v=Mm(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=v),v=!0;if(!v)return o.flags&256?(xr(o),o):(xr(o),null)}return xr(o),(o.flags&128)!==0?(o.lanes=c,o):(c=f!==null,i=i!==null&&i.memoizedState!==null,c&&(f=o.child,v=null,f.alternate!==null&&f.alternate.memoizedState!==null&&f.alternate.memoizedState.cachePool!==null&&(v=f.alternate.memoizedState.cachePool.pool),x=null,f.memoizedState!==null&&f.memoizedState.cachePool!==null&&(x=f.memoizedState.cachePool.pool),x!==v&&(f.flags|=2048)),c!==i&&c&&(o.child.flags|=8192),Jd(o,o.updateQueue),It(o),null);case 4:return oe(),i===null&&Fg(o.stateNode.containerInfo),It(o),null;case 10:return Ki(o.type),It(o),null;case 19:if(Z(Qt),f=o.memoizedState,f===null)return It(o),null;if(v=(o.flags&128)!==0,x=f.rendering,x===null)if(v)Sc(f,!1);else{if(Kt!==0||i!==null&&(i.flags&128)!==0)for(i=o.child;i!==null;){if(x=Hd(i),x!==null){for(o.flags|=128,Sc(f,!1),i=x.updateQueue,o.updateQueue=i,Jd(o,i),o.subtreeFlags=0,i=c,c=o.child;c!==null;)Zx(c,i),c=c.sibling;return j(Qt,Qt.current&1|2),lt&&Vi(o,f.treeForkCount),o.child}i=i.sibling}f.tail!==null&&Dt()>ih&&(o.flags|=128,v=!0,Sc(f,!1),o.lanes=4194304)}else{if(!v)if(i=Hd(x),i!==null){if(o.flags|=128,v=!0,i=i.updateQueue,o.updateQueue=i,Jd(o,i),Sc(f,!0),f.tail===null&&f.tailMode==="hidden"&&!x.alternate&&!lt)return It(o),null}else 2*Dt()-f.renderingStartTime>ih&&c!==536870912&&(o.flags|=128,v=!0,Sc(f,!1),o.lanes=4194304);f.isBackwards?(x.sibling=o.child,o.child=x):(i=f.last,i!==null?i.sibling=x:o.child=x,f.last=x)}return f.tail!==null?(i=f.tail,f.rendering=i,f.tail=i.sibling,f.renderingStartTime=Dt(),i.sibling=null,c=Qt.current,j(Qt,v?c&1|2:c&1),lt&&Vi(o,f.treeForkCount),i):(It(o),null);case 22:case 23:return xr(o),Um(),f=o.memoizedState!==null,i!==null?i.memoizedState!==null!==f&&(o.flags|=8192):f&&(o.flags|=8192),f?(c&536870912)!==0&&(o.flags&128)===0&&(It(o),o.subtreeFlags&6&&(o.flags|=8192)):It(o),c=o.updateQueue,c!==null&&Jd(o,c.retryQueue),c=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(c=i.memoizedState.cachePool.pool),f=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(f=o.memoizedState.cachePool.pool),f!==c&&(o.flags|=2048),i!==null&&Z(Mo),null;case 24:return c=null,i!==null&&(c=i.memoizedState.cache),o.memoizedState.cache!==c&&(o.flags|=2048),Ki(tn),It(o),null;case 25:return null;case 30:return null}throw Error(r(156,o.tag))}function A4(i,o){switch(Rm(o),o.tag){case 1:return i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 3:return Ki(tn),oe(),i=o.flags,(i&65536)!==0&&(i&128)===0?(o.flags=i&-65537|128,o):null;case 26:case 27:case 5:return Ne(o),null;case 31:if(o.memoizedState!==null){if(xr(o),o.alternate===null)throw Error(r(340));Eo()}return i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 13:if(xr(o),i=o.memoizedState,i!==null&&i.dehydrated!==null){if(o.alternate===null)throw Error(r(340));Eo()}return i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 19:return Z(Qt),null;case 4:return oe(),null;case 10:return Ki(o.type),null;case 22:case 23:return xr(o),Um(),i!==null&&Z(Mo),i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 24:return Ki(tn),null;case 25:return null;default:return null}}function Cw(i,o){switch(Rm(o),o.tag){case 3:Ki(tn),oe();break;case 26:case 27:case 5:Ne(o);break;case 4:oe();break;case 31:o.memoizedState!==null&&xr(o);break;case 13:xr(o);break;case 19:Z(Qt);break;case 10:Ki(o.type);break;case 22:case 23:xr(o),Um(),i!==null&&Z(Mo);break;case 24:Ki(tn)}}function Cc(i,o){try{var c=o.updateQueue,f=c!==null?c.lastEffect:null;if(f!==null){var v=f.next;c=v;do{if((c.tag&i)===i){f=void 0;var x=c.create,E=c.inst;f=x(),E.destroy=f}c=c.next}while(c!==v)}}catch(D){Ct(o,o.return,D)}}function Os(i,o,c){try{var f=o.updateQueue,v=f!==null?f.lastEffect:null;if(v!==null){var x=v.next;f=x;do{if((f.tag&i)===i){var E=f.inst,D=E.destroy;if(D!==void 0){E.destroy=void 0,v=o;var K=c,ne=D;try{ne()}catch(he){Ct(v,K,he)}}}f=f.next}while(f!==x)}}catch(he){Ct(o,o.return,he)}}function kw(i){var o=i.updateQueue;if(o!==null){var c=i.stateNode;try{m1(o,c)}catch(f){Ct(i,i.return,f)}}}function Ew(i,o,c){c.props=jo(i.type,i.memoizedProps),c.state=i.memoizedState;try{c.componentWillUnmount()}catch(f){Ct(i,o,f)}}function kc(i,o){try{var c=i.ref;if(c!==null){switch(i.tag){case 26:case 27:case 5:var f=i.stateNode;break;case 30:f=i.stateNode;break;default:f=i.stateNode}typeof c=="function"?i.refCleanup=c(f):c.current=f}}catch(v){Ct(i,o,v)}}function yi(i,o){var c=i.ref,f=i.refCleanup;if(c!==null)if(typeof f=="function")try{f()}catch(v){Ct(i,o,v)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof c=="function")try{c(null)}catch(v){Ct(i,o,v)}else c.current=null}function Rw(i){var o=i.type,c=i.memoizedProps,f=i.stateNode;try{e:switch(o){case"button":case"input":case"select":case"textarea":c.autoFocus&&f.focus();break e;case"img":c.src?f.src=c.src:c.srcSet&&(f.srcset=c.srcSet)}}catch(v){Ct(i,i.return,v)}}function bg(i,o,c){try{var f=i.stateNode;J4(f,i.type,c,o),f[or]=o}catch(v){Ct(i,i.return,v)}}function Tw(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&Hs(i.type)||i.tag===4}function xg(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||Tw(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&&Hs(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 wg(i,o,c){var f=i.tag;if(f===5||f===6)i=i.stateNode,o?(c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c).insertBefore(i,o):(o=c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c,o.appendChild(i),c=c._reactRootContainer,c!=null||o.onclick!==null||(o.onclick=Ui));else if(f!==4&&(f===27&&Hs(i.type)&&(c=i.stateNode,o=null),i=i.child,i!==null))for(wg(i,o,c),i=i.sibling;i!==null;)wg(i,o,c),i=i.sibling}function eh(i,o,c){var f=i.tag;if(f===5||f===6)i=i.stateNode,o?c.insertBefore(i,o):c.appendChild(i);else if(f!==4&&(f===27&&Hs(i.type)&&(c=i.stateNode),i=i.child,i!==null))for(eh(i,o,c),i=i.sibling;i!==null;)eh(i,o,c),i=i.sibling}function Mw(i){var o=i.stateNode,c=i.memoizedProps;try{for(var f=i.type,v=o.attributes;v.length;)o.removeAttributeNode(v[0]);In(o,f,c),o[Ln]=i,o[or]=c}catch(x){Ct(i,i.return,x)}}var Qi=!1,sn=!1,Sg=!1,Nw=typeof WeakSet=="function"?WeakSet:Set,bn=null;function D4(i,o){if(i=i.containerInfo,Wg=xh,i=Ux(i),gm(i)){if("selectionStart"in i)var c={start:i.selectionStart,end:i.selectionEnd};else e:{c=(c=i.ownerDocument)&&c.defaultView||window;var f=c.getSelection&&c.getSelection();if(f&&f.rangeCount!==0){c=f.anchorNode;var v=f.anchorOffset,x=f.focusNode;f=f.focusOffset;try{c.nodeType,x.nodeType}catch{c=null;break e}var E=0,D=-1,K=-1,ne=0,he=0,me=i,se=null;t:for(;;){for(var ae;me!==c||v!==0&&me.nodeType!==3||(D=E+v),me!==x||f!==0&&me.nodeType!==3||(K=E+f),me.nodeType===3&&(E+=me.nodeValue.length),(ae=me.firstChild)!==null;)se=me,me=ae;for(;;){if(me===i)break t;if(se===c&&++ne===v&&(D=E),se===x&&++he===f&&(K=E),(ae=me.nextSibling)!==null)break;me=se,se=me.parentNode}me=ae}c=D===-1||K===-1?null:{start:D,end:K}}else c=null}c=c||{start:0,end:0}}else c=null;for(Vg={focusedElem:i,selectionRange:c},xh=!1,bn=o;bn!==null;)if(o=bn,i=o.child,(o.subtreeFlags&1028)!==0&&i!==null)i.return=o,bn=i;else for(;bn!==null;){switch(o=bn,x=o.alternate,i=o.flags,o.tag){case 0:if((i&4)!==0&&(i=o.updateQueue,i=i!==null?i.events:null,i!==null))for(c=0;c<i.length;c++)v=i[c],v.ref.impl=v.nextImpl;break;case 11:case 15:break;case 1:if((i&1024)!==0&&x!==null){i=void 0,c=o,v=x.memoizedProps,x=x.memoizedState,f=c.stateNode;try{var De=jo(c.type,v);i=f.getSnapshotBeforeUpdate(De,x),f.__reactInternalSnapshotBeforeUpdate=i}catch(Ie){Ct(c,c.return,Ie)}}break;case 3:if((i&1024)!==0){if(i=o.stateNode.containerInfo,c=i.nodeType,c===9)Gg(i);else if(c===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":Gg(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(r(163))}if(i=o.sibling,i!==null){i.return=o.return,bn=i;break}bn=o.return}}function Aw(i,o,c){var f=c.flags;switch(c.tag){case 0:case 11:case 15:es(i,c),f&4&&Cc(5,c);break;case 1:if(es(i,c),f&4)if(i=c.stateNode,o===null)try{i.componentDidMount()}catch(E){Ct(c,c.return,E)}else{var v=jo(c.type,o.memoizedProps);o=o.memoizedState;try{i.componentDidUpdate(v,o,i.__reactInternalSnapshotBeforeUpdate)}catch(E){Ct(c,c.return,E)}}f&64&&kw(c),f&512&&kc(c,c.return);break;case 3:if(es(i,c),f&64&&(i=c.updateQueue,i!==null)){if(o=null,c.child!==null)switch(c.child.tag){case 27:case 5:o=c.child.stateNode;break;case 1:o=c.child.stateNode}try{m1(i,o)}catch(E){Ct(c,c.return,E)}}break;case 27:o===null&&f&4&&Mw(c);case 26:case 5:es(i,c),o===null&&f&4&&Rw(c),f&512&&kc(c,c.return);break;case 12:es(i,c);break;case 31:es(i,c),f&4&&jw(i,c);break;case 13:es(i,c),f&4&&Lw(i,c),f&64&&(i=c.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(c=F4.bind(null,c),aO(i,c))));break;case 22:if(f=c.memoizedState!==null||Qi,!f){o=o!==null&&o.memoizedState!==null||sn,v=Qi;var x=sn;Qi=f,(sn=o)&&!x?ts(i,c,(c.subtreeFlags&8772)!==0):es(i,c),Qi=v,sn=x}break;case 30:break;default:es(i,c)}}function Dw(i){var o=i.alternate;o!==null&&(i.alternate=null,Dw(o)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(o=i.stateNode,o!==null&&Jp(o)),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 Ft=null,lr=!1;function Ji(i,o,c){for(c=c.child;c!==null;)Ow(i,o,c),c=c.sibling}function Ow(i,o,c){if(gt&&typeof gt.onCommitFiberUnmount=="function")try{gt.onCommitFiberUnmount(Xe,c)}catch{}switch(c.tag){case 26:sn||yi(c,o),Ji(i,o,c),c.memoizedState?c.memoizedState.count--:c.stateNode&&(c=c.stateNode,c.parentNode.removeChild(c));break;case 27:sn||yi(c,o);var f=Ft,v=lr;Hs(c.type)&&(Ft=c.stateNode,lr=!1),Ji(i,o,c),jc(c.stateNode),Ft=f,lr=v;break;case 5:sn||yi(c,o);case 6:if(f=Ft,v=lr,Ft=null,Ji(i,o,c),Ft=f,lr=v,Ft!==null)if(lr)try{(Ft.nodeType===9?Ft.body:Ft.nodeName==="HTML"?Ft.ownerDocument.body:Ft).removeChild(c.stateNode)}catch(x){Ct(c,o,x)}else try{Ft.removeChild(c.stateNode)}catch(x){Ct(c,o,x)}break;case 18:Ft!==null&&(lr?(i=Ft,kS(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,c.stateNode),tl(i)):kS(Ft,c.stateNode));break;case 4:f=Ft,v=lr,Ft=c.stateNode.containerInfo,lr=!0,Ji(i,o,c),Ft=f,lr=v;break;case 0:case 11:case 14:case 15:Os(2,c,o),sn||Os(4,c,o),Ji(i,o,c);break;case 1:sn||(yi(c,o),f=c.stateNode,typeof f.componentWillUnmount=="function"&&Ew(c,o,f)),Ji(i,o,c);break;case 21:Ji(i,o,c);break;case 22:sn=(f=sn)||c.memoizedState!==null,Ji(i,o,c),sn=f;break;default:Ji(i,o,c)}}function jw(i,o){if(o.memoizedState===null&&(i=o.alternate,i!==null&&(i=i.memoizedState,i!==null))){i=i.dehydrated;try{tl(i)}catch(c){Ct(o,o.return,c)}}}function Lw(i,o){if(o.memoizedState===null&&(i=o.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{tl(i)}catch(c){Ct(o,o.return,c)}}function O4(i){switch(i.tag){case 31:case 13:case 19:var o=i.stateNode;return o===null&&(o=i.stateNode=new Nw),o;case 22:return i=i.stateNode,o=i._retryCache,o===null&&(o=i._retryCache=new Nw),o;default:throw Error(r(435,i.tag))}}function th(i,o){var c=O4(i);o.forEach(function(f){if(!c.has(f)){c.add(f);var v=U4.bind(null,i,f);f.then(v,v)}})}function cr(i,o){var c=o.deletions;if(c!==null)for(var f=0;f<c.length;f++){var v=c[f],x=i,E=o,D=E;e:for(;D!==null;){switch(D.tag){case 27:if(Hs(D.type)){Ft=D.stateNode,lr=!1;break e}break;case 5:Ft=D.stateNode,lr=!1;break e;case 3:case 4:Ft=D.stateNode.containerInfo,lr=!0;break e}D=D.return}if(Ft===null)throw Error(r(160));Ow(x,E,v),Ft=null,lr=!1,x=v.alternate,x!==null&&(x.return=null),v.return=null}if(o.subtreeFlags&13886)for(o=o.child;o!==null;)zw(o,i),o=o.sibling}var ri=null;function zw(i,o){var c=i.alternate,f=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:cr(o,i),ur(i),f&4&&(Os(3,i,i.return),Cc(3,i),Os(5,i,i.return));break;case 1:cr(o,i),ur(i),f&512&&(sn||c===null||yi(c,c.return)),f&64&&Qi&&(i=i.updateQueue,i!==null&&(f=i.callbacks,f!==null&&(c=i.shared.hiddenCallbacks,i.shared.hiddenCallbacks=c===null?f:c.concat(f))));break;case 26:var v=ri;if(cr(o,i),ur(i),f&512&&(sn||c===null||yi(c,c.return)),f&4){var x=c!==null?c.memoizedState:null;if(f=i.memoizedState,c===null)if(f===null)if(i.stateNode===null){e:{f=i.type,c=i.memoizedProps,v=v.ownerDocument||v;t:switch(f){case"title":x=v.getElementsByTagName("title")[0],(!x||x[Ql]||x[Ln]||x.namespaceURI==="http://www.w3.org/2000/svg"||x.hasAttribute("itemprop"))&&(x=v.createElement(f),v.head.insertBefore(x,v.querySelector("head > title"))),In(x,f,c),x[Ln]=i,yn(x),f=x;break e;case"link":var E=zS("link","href",v).get(f+(c.href||""));if(E){for(var D=0;D<E.length;D++)if(x=E[D],x.getAttribute("href")===(c.href==null||c.href===""?null:c.href)&&x.getAttribute("rel")===(c.rel==null?null:c.rel)&&x.getAttribute("title")===(c.title==null?null:c.title)&&x.getAttribute("crossorigin")===(c.crossOrigin==null?null:c.crossOrigin)){E.splice(D,1);break t}}x=v.createElement(f),In(x,f,c),v.head.appendChild(x);break;case"meta":if(E=zS("meta","content",v).get(f+(c.content||""))){for(D=0;D<E.length;D++)if(x=E[D],x.getAttribute("content")===(c.content==null?null:""+c.content)&&x.getAttribute("name")===(c.name==null?null:c.name)&&x.getAttribute("property")===(c.property==null?null:c.property)&&x.getAttribute("http-equiv")===(c.httpEquiv==null?null:c.httpEquiv)&&x.getAttribute("charset")===(c.charSet==null?null:c.charSet)){E.splice(D,1);break t}}x=v.createElement(f),In(x,f,c),v.head.appendChild(x);break;default:throw Error(r(468,f))}x[Ln]=i,yn(x),f=x}i.stateNode=f}else PS(v,i.type,i.stateNode);else i.stateNode=LS(v,f,i.memoizedProps);else x!==f?(x===null?c.stateNode!==null&&(c=c.stateNode,c.parentNode.removeChild(c)):x.count--,f===null?PS(v,i.type,i.stateNode):LS(v,f,i.memoizedProps)):f===null&&i.stateNode!==null&&bg(i,i.memoizedProps,c.memoizedProps)}break;case 27:cr(o,i),ur(i),f&512&&(sn||c===null||yi(c,c.return)),c!==null&&f&4&&bg(i,i.memoizedProps,c.memoizedProps);break;case 5:if(cr(o,i),ur(i),f&512&&(sn||c===null||yi(c,c.return)),i.flags&32){v=i.stateNode;try{Ca(v,"")}catch(De){Ct(i,i.return,De)}}f&4&&i.stateNode!=null&&(v=i.memoizedProps,bg(i,v,c!==null?c.memoizedProps:v)),f&1024&&(Sg=!0);break;case 6:if(cr(o,i),ur(i),f&4){if(i.stateNode===null)throw Error(r(162));f=i.memoizedProps,c=i.stateNode;try{c.nodeValue=f}catch(De){Ct(i,i.return,De)}}break;case 3:if(vh=null,v=ri,ri=mh(o.containerInfo),cr(o,i),ri=v,ur(i),f&4&&c!==null&&c.memoizedState.isDehydrated)try{tl(o.containerInfo)}catch(De){Ct(i,i.return,De)}Sg&&(Sg=!1,Pw(i));break;case 4:f=ri,ri=mh(i.stateNode.containerInfo),cr(o,i),ur(i),ri=f;break;case 12:cr(o,i),ur(i);break;case 31:cr(o,i),ur(i),f&4&&(f=i.updateQueue,f!==null&&(i.updateQueue=null,th(i,f)));break;case 13:cr(o,i),ur(i),i.child.flags&8192&&i.memoizedState!==null!=(c!==null&&c.memoizedState!==null)&&(rh=Dt()),f&4&&(f=i.updateQueue,f!==null&&(i.updateQueue=null,th(i,f)));break;case 22:v=i.memoizedState!==null;var K=c!==null&&c.memoizedState!==null,ne=Qi,he=sn;if(Qi=ne||v,sn=he||K,cr(o,i),sn=he,Qi=ne,ur(i),f&8192)e:for(o=i.stateNode,o._visibility=v?o._visibility&-2:o._visibility|1,v&&(c===null||K||Qi||sn||Lo(i)),c=null,o=i;;){if(o.tag===5||o.tag===26){if(c===null){K=c=o;try{if(x=K.stateNode,v)E=x.style,typeof E.setProperty=="function"?E.setProperty("display","none","important"):E.display="none";else{D=K.stateNode;var me=K.memoizedProps.style,se=me!=null&&me.hasOwnProperty("display")?me.display:null;D.style.display=se==null||typeof se=="boolean"?"":(""+se).trim()}}catch(De){Ct(K,K.return,De)}}}else if(o.tag===6){if(c===null){K=o;try{K.stateNode.nodeValue=v?"":K.memoizedProps}catch(De){Ct(K,K.return,De)}}}else if(o.tag===18){if(c===null){K=o;try{var ae=K.stateNode;v?ES(ae,!0):ES(K.stateNode,!1)}catch(De){Ct(K,K.return,De)}}}else if((o.tag!==22&&o.tag!==23||o.memoizedState===null||o===i)&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===i)break e;for(;o.sibling===null;){if(o.return===null||o.return===i)break e;c===o&&(c=null),o=o.return}c===o&&(c=null),o.sibling.return=o.return,o=o.sibling}f&4&&(f=i.updateQueue,f!==null&&(c=f.retryQueue,c!==null&&(f.retryQueue=null,th(i,c))));break;case 19:cr(o,i),ur(i),f&4&&(f=i.updateQueue,f!==null&&(i.updateQueue=null,th(i,f)));break;case 30:break;case 21:break;default:cr(o,i),ur(i)}}function ur(i){var o=i.flags;if(o&2){try{for(var c,f=i.return;f!==null;){if(Tw(f)){c=f;break}f=f.return}if(c==null)throw Error(r(160));switch(c.tag){case 27:var v=c.stateNode,x=xg(i);eh(i,x,v);break;case 5:var E=c.stateNode;c.flags&32&&(Ca(E,""),c.flags&=-33);var D=xg(i);eh(i,D,E);break;case 3:case 4:var K=c.stateNode.containerInfo,ne=xg(i);wg(i,ne,K);break;default:throw Error(r(161))}}catch(he){Ct(i,i.return,he)}i.flags&=-3}o&4096&&(i.flags&=-4097)}function Pw(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var o=i;Pw(o),o.tag===5&&o.flags&1024&&o.stateNode.reset(),i=i.sibling}}function es(i,o){if(o.subtreeFlags&8772)for(o=o.child;o!==null;)Aw(i,o.alternate,o),o=o.sibling}function Lo(i){for(i=i.child;i!==null;){var o=i;switch(o.tag){case 0:case 11:case 14:case 15:Os(4,o,o.return),Lo(o);break;case 1:yi(o,o.return);var c=o.stateNode;typeof c.componentWillUnmount=="function"&&Ew(o,o.return,c),Lo(o);break;case 27:jc(o.stateNode);case 26:case 5:yi(o,o.return),Lo(o);break;case 22:o.memoizedState===null&&Lo(o);break;case 30:Lo(o);break;default:Lo(o)}i=i.sibling}}function ts(i,o,c){for(c=c&&(o.subtreeFlags&8772)!==0,o=o.child;o!==null;){var f=o.alternate,v=i,x=o,E=x.flags;switch(x.tag){case 0:case 11:case 15:ts(v,x,c),Cc(4,x);break;case 1:if(ts(v,x,c),f=x,v=f.stateNode,typeof v.componentDidMount=="function")try{v.componentDidMount()}catch(ne){Ct(f,f.return,ne)}if(f=x,v=f.updateQueue,v!==null){var D=f.stateNode;try{var K=v.shared.hiddenCallbacks;if(K!==null)for(v.shared.hiddenCallbacks=null,v=0;v<K.length;v++)p1(K[v],D)}catch(ne){Ct(f,f.return,ne)}}c&&E&64&&kw(x),kc(x,x.return);break;case 27:Mw(x);case 26:case 5:ts(v,x,c),c&&f===null&&E&4&&Rw(x),kc(x,x.return);break;case 12:ts(v,x,c);break;case 31:ts(v,x,c),c&&E&4&&jw(v,x);break;case 13:ts(v,x,c),c&&E&4&&Lw(v,x);break;case 22:x.memoizedState===null&&ts(v,x,c),kc(x,x.return);break;case 30:break;default:ts(v,x,c)}o=o.sibling}}function Cg(i,o){var c=null;i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(c=i.memoizedState.cachePool.pool),i=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(i=o.memoizedState.cachePool.pool),i!==c&&(i!=null&&i.refCount++,c!=null&&dc(c))}function kg(i,o){i=null,o.alternate!==null&&(i=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==i&&(o.refCount++,i!=null&&dc(i))}function ii(i,o,c,f){if(o.subtreeFlags&10256)for(o=o.child;o!==null;)Bw(i,o,c,f),o=o.sibling}function Bw(i,o,c,f){var v=o.flags;switch(o.tag){case 0:case 11:case 15:ii(i,o,c,f),v&2048&&Cc(9,o);break;case 1:ii(i,o,c,f);break;case 3:ii(i,o,c,f),v&2048&&(i=null,o.alternate!==null&&(i=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==i&&(o.refCount++,i!=null&&dc(i)));break;case 12:if(v&2048){ii(i,o,c,f),i=o.stateNode;try{var x=o.memoizedProps,E=x.id,D=x.onPostCommit;typeof D=="function"&&D(E,o.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch(K){Ct(o,o.return,K)}}else ii(i,o,c,f);break;case 31:ii(i,o,c,f);break;case 13:ii(i,o,c,f);break;case 23:break;case 22:x=o.stateNode,E=o.alternate,o.memoizedState!==null?x._visibility&2?ii(i,o,c,f):Ec(i,o):x._visibility&2?ii(i,o,c,f):(x._visibility|=2,Wa(i,o,c,f,(o.subtreeFlags&10256)!==0||!1)),v&2048&&Cg(E,o);break;case 24:ii(i,o,c,f),v&2048&&kg(o.alternate,o);break;default:ii(i,o,c,f)}}function Wa(i,o,c,f,v){for(v=v&&((o.subtreeFlags&10256)!==0||!1),o=o.child;o!==null;){var x=i,E=o,D=c,K=f,ne=E.flags;switch(E.tag){case 0:case 11:case 15:Wa(x,E,D,K,v),Cc(8,E);break;case 23:break;case 22:var he=E.stateNode;E.memoizedState!==null?he._visibility&2?Wa(x,E,D,K,v):Ec(x,E):(he._visibility|=2,Wa(x,E,D,K,v)),v&&ne&2048&&Cg(E.alternate,E);break;case 24:Wa(x,E,D,K,v),v&&ne&2048&&kg(E.alternate,E);break;default:Wa(x,E,D,K,v)}o=o.sibling}}function Ec(i,o){if(o.subtreeFlags&10256)for(o=o.child;o!==null;){var c=i,f=o,v=f.flags;switch(f.tag){case 22:Ec(c,f),v&2048&&Cg(f.alternate,f);break;case 24:Ec(c,f),v&2048&&kg(f.alternate,f);break;default:Ec(c,f)}o=o.sibling}}var Rc=8192;function Va(i,o,c){if(i.subtreeFlags&Rc)for(i=i.child;i!==null;)Iw(i,o,c),i=i.sibling}function Iw(i,o,c){switch(i.tag){case 26:Va(i,o,c),i.flags&Rc&&i.memoizedState!==null&&yO(c,ri,i.memoizedState,i.memoizedProps);break;case 5:Va(i,o,c);break;case 3:case 4:var f=ri;ri=mh(i.stateNode.containerInfo),Va(i,o,c),ri=f;break;case 22:i.memoizedState===null&&(f=i.alternate,f!==null&&f.memoizedState!==null?(f=Rc,Rc=16777216,Va(i,o,c),Rc=f):Va(i,o,c));break;default:Va(i,o,c)}}function Hw(i){var o=i.alternate;if(o!==null&&(i=o.child,i!==null)){o.child=null;do o=i.sibling,i.sibling=null,i=o;while(i!==null)}}function Tc(i){var o=i.deletions;if((i.flags&16)!==0){if(o!==null)for(var c=0;c<o.length;c++){var f=o[c];bn=f,Uw(f,i)}Hw(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)Fw(i),i=i.sibling}function Fw(i){switch(i.tag){case 0:case 11:case 15:Tc(i),i.flags&2048&&Os(9,i,i.return);break;case 3:Tc(i);break;case 12:Tc(i);break;case 22:var o=i.stateNode;i.memoizedState!==null&&o._visibility&2&&(i.return===null||i.return.tag!==13)?(o._visibility&=-3,nh(i)):Tc(i);break;default:Tc(i)}}function nh(i){var o=i.deletions;if((i.flags&16)!==0){if(o!==null)for(var c=0;c<o.length;c++){var f=o[c];bn=f,Uw(f,i)}Hw(i)}for(i=i.child;i!==null;){switch(o=i,o.tag){case 0:case 11:case 15:Os(8,o,o.return),nh(o);break;case 22:c=o.stateNode,c._visibility&2&&(c._visibility&=-3,nh(o));break;default:nh(o)}i=i.sibling}}function Uw(i,o){for(;bn!==null;){var c=bn;switch(c.tag){case 0:case 11:case 15:Os(8,c,o);break;case 23:case 22:if(c.memoizedState!==null&&c.memoizedState.cachePool!==null){var f=c.memoizedState.cachePool.pool;f!=null&&f.refCount++}break;case 24:dc(c.memoizedState.cache)}if(f=c.child,f!==null)f.return=c,bn=f;else e:for(c=i;bn!==null;){f=bn;var v=f.sibling,x=f.return;if(Dw(f),f===c){bn=null;break e}if(v!==null){v.return=x,bn=v;break e}bn=x}}}var j4={getCacheForType:function(i){var o=Pn(tn),c=o.data.get(i);return c===void 0&&(c=i(),o.data.set(i,c)),c},cacheSignal:function(){return Pn(tn).controller.signal}},L4=typeof WeakMap=="function"?WeakMap:Map,vt=0,Ot=null,nt=null,ot=0,St=0,wr=null,js=!1,qa=!1,Eg=!1,ns=0,Kt=0,Ls=0,zo=0,Rg=0,Sr=0,Ka=0,Mc=null,dr=null,Tg=!1,rh=0,$w=0,ih=1/0,sh=null,zs=null,hn=0,Ps=null,Ga=null,rs=0,Mg=0,Ng=null,Ww=null,Nc=0,Ag=null;function Cr(){return(vt&2)!==0&&ot!==0?ot&-ot:z.T!==null?Pg():ti()}function Vw(){if(Sr===0)if((ot&536870912)===0||lt){var i=Xn;Xn<<=1,(Xn&3932160)===0&&(Xn=262144),Sr=i}else Sr=536870912;return i=br.current,i!==null&&(i.flags|=32),Sr}function hr(i,o,c){(i===Ot&&(St===2||St===9)||i.cancelPendingCommit!==null)&&(Ya(i,0),Bs(i,ot,Sr,!1)),We(i,c),((vt&2)===0||i!==Ot)&&(i===Ot&&((vt&2)===0&&(zo|=c),Kt===4&&Bs(i,ot,Sr,!1)),bi(i))}function qw(i,o,c){if((vt&6)!==0)throw Error(r(327));var f=!c&&(o&127)===0&&(o&i.expiredLanes)===0||Dn(i,o),v=f?B4(i,o):Og(i,o,!0),x=f;do{if(v===0){qa&&!f&&Bs(i,o,0,!1);break}else{if(c=i.current.alternate,x&&!z4(c)){v=Og(i,o,!1),x=!1;continue}if(v===2){if(x=o,i.errorRecoveryDisabledLanes&x)var E=0;else E=i.pendingLanes&-536870913,E=E!==0?E:E&536870912?536870912:0;if(E!==0){o=E;e:{var D=i;v=Mc;var K=D.current.memoizedState.isDehydrated;if(K&&(Ya(D,E).flags|=256),E=Og(D,E,!1),E!==2){if(Eg&&!K){D.errorRecoveryDisabledLanes|=x,zo|=x,v=4;break e}x=dr,dr=v,x!==null&&(dr===null?dr=x:dr.push.apply(dr,x))}v=E}if(x=!1,v!==2)continue}}if(v===1){Ya(i,0),Bs(i,o,0,!0);break}e:{switch(f=i,x=v,x){case 0:case 1:throw Error(r(345));case 4:if((o&4194048)!==o)break;case 6:Bs(f,o,Sr,!js);break e;case 2:dr=null;break;case 3:case 5:break;default:throw Error(r(329))}if((o&62914560)===o&&(v=rh+300-Dt(),10<v)){if(Bs(f,o,Sr,!js),Lt(f,0,!0)!==0)break e;rs=o,f.timeoutHandle=SS(Kw.bind(null,f,c,dr,sh,Tg,o,Sr,zo,Ka,js,x,"Throttled",-0,0),v);break e}Kw(f,c,dr,sh,Tg,o,Sr,zo,Ka,js,x,null,-0,0)}}break}while(!0);bi(i)}function Kw(i,o,c,f,v,x,E,D,K,ne,he,me,se,ae){if(i.timeoutHandle=-1,me=o.subtreeFlags,me&8192||(me&16785408)===16785408){me={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ui},Iw(o,x,me);var De=(x&62914560)===x?rh-Dt():(x&4194048)===x?$w-Dt():0;if(De=bO(me,De),De!==null){rs=x,i.cancelPendingCommit=De(tS.bind(null,i,o,x,c,f,v,E,D,K,he,me,null,se,ae)),Bs(i,x,E,!ne);return}}tS(i,o,x,c,f,v,E,D,K)}function z4(i){for(var o=i;;){var c=o.tag;if((c===0||c===11||c===15)&&o.flags&16384&&(c=o.updateQueue,c!==null&&(c=c.stores,c!==null)))for(var f=0;f<c.length;f++){var v=c[f],x=v.getSnapshot;v=v.value;try{if(!_r(x(),v))return!1}catch{return!1}}if(c=o.child,o.subtreeFlags&16384&&c!==null)c.return=o,o=c;else{if(o===i)break;for(;o.sibling===null;){if(o.return===null||o.return===i)return!0;o=o.return}o.sibling.return=o.return,o=o.sibling}}return!0}function Bs(i,o,c,f){o&=~Rg,o&=~zo,i.suspendedLanes|=o,i.pingedLanes&=~o,f&&(i.warmLanes|=o),f=i.expirationTimes;for(var v=o;0<v;){var x=31-Te(v),E=1<<x;f[x]=-1,v&=~E}c!==0&&wt(i,c,o)}function oh(){return(vt&6)===0?(Ac(0),!1):!0}function Dg(){if(nt!==null){if(St===0)var i=nt.return;else i=nt,qi=Ro=null,Gm(i),Ia=null,fc=0,i=nt;for(;i!==null;)Cw(i.alternate,i),i=i.return;nt=null}}function Ya(i,o){var c=i.timeoutHandle;c!==-1&&(i.timeoutHandle=-1,nO(c)),c=i.cancelPendingCommit,c!==null&&(i.cancelPendingCommit=null,c()),rs=0,Dg(),Ot=i,nt=c=Wi(i.current,null),ot=o,St=0,wr=null,js=!1,qa=Dn(i,o),Eg=!1,Ka=Sr=Rg=zo=Ls=Kt=0,dr=Mc=null,Tg=!1,(o&8)!==0&&(o|=o&32);var f=i.entangledLanes;if(f!==0)for(i=i.entanglements,f&=o;0<f;){var v=31-Te(f),x=1<<v;o|=i[v],f&=~x}return ns=o,Rd(),c}function Gw(i,o){Ke=null,z.H=xc,o===Ba||o===Ld?(o=u1(),St=3):o===zm?(o=u1(),St=4):St=o===ug?8:o!==null&&typeof o=="object"&&typeof o.then=="function"?6:1,wr=o,nt===null&&(Kt=1,Yd(i,Pr(o,i.current)))}function Yw(){var i=br.current;return i===null?!0:(ot&4194048)===ot?Fr===null:(ot&62914560)===ot||(ot&536870912)!==0?i===Fr:!1}function Xw(){var i=z.H;return z.H=xc,i===null?xc:i}function Zw(){var i=z.A;return z.A=j4,i}function ah(){Kt=4,js||(ot&4194048)!==ot&&br.current!==null||(qa=!0),(Ls&134217727)===0&&(zo&134217727)===0||Ot===null||Bs(Ot,ot,Sr,!1)}function Og(i,o,c){var f=vt;vt|=2;var v=Xw(),x=Zw();(Ot!==i||ot!==o)&&(sh=null,Ya(i,o)),o=!1;var E=Kt;e:do try{if(St!==0&&nt!==null){var D=nt,K=wr;switch(St){case 8:Dg(),E=6;break e;case 3:case 2:case 9:case 6:br.current===null&&(o=!0);var ne=St;if(St=0,wr=null,Xa(i,D,K,ne),c&&qa){E=0;break e}break;default:ne=St,St=0,wr=null,Xa(i,D,K,ne)}}P4(),E=Kt;break}catch(he){Gw(i,he)}while(!0);return o&&i.shellSuspendCounter++,qi=Ro=null,vt=f,z.H=v,z.A=x,nt===null&&(Ot=null,ot=0,Rd()),E}function P4(){for(;nt!==null;)Qw(nt)}function B4(i,o){var c=vt;vt|=2;var f=Xw(),v=Zw();Ot!==i||ot!==o?(sh=null,ih=Dt()+500,Ya(i,o)):qa=Dn(i,o);e:do try{if(St!==0&&nt!==null){o=nt;var x=wr;t:switch(St){case 1:St=0,wr=null,Xa(i,o,x,1);break;case 2:case 9:if(l1(x)){St=0,wr=null,Jw(o);break}o=function(){St!==2&&St!==9||Ot!==i||(St=7),bi(i)},x.then(o,o);break e;case 3:St=7;break e;case 4:St=5;break e;case 7:l1(x)?(St=0,wr=null,Jw(o)):(St=0,wr=null,Xa(i,o,x,7));break;case 5:var E=null;switch(nt.tag){case 26:E=nt.memoizedState;case 5:case 27:var D=nt;if(E?BS(E):D.stateNode.complete){St=0,wr=null;var K=D.sibling;if(K!==null)nt=K;else{var ne=D.return;ne!==null?(nt=ne,lh(ne)):nt=null}break t}}St=0,wr=null,Xa(i,o,x,5);break;case 6:St=0,wr=null,Xa(i,o,x,6);break;case 8:Dg(),Kt=6;break e;default:throw Error(r(462))}}I4();break}catch(he){Gw(i,he)}while(!0);return qi=Ro=null,z.H=f,z.A=v,vt=c,nt!==null?0:(Ot=null,ot=0,Rd(),Kt)}function I4(){for(;nt!==null&&!Zt();)Qw(nt)}function Qw(i){var o=ww(i.alternate,i,ns);i.memoizedProps=i.pendingProps,o===null?lh(i):nt=o}function Jw(i){var o=i,c=o.alternate;switch(o.tag){case 15:case 0:o=gw(c,o,o.pendingProps,o.type,void 0,ot);break;case 11:o=gw(c,o,o.pendingProps,o.type.render,o.ref,ot);break;case 5:Gm(o);default:Cw(c,o),o=nt=Zx(o,ns),o=ww(c,o,ns)}i.memoizedProps=i.pendingProps,o===null?lh(i):nt=o}function Xa(i,o,c,f){qi=Ro=null,Gm(o),Ia=null,fc=0;var v=o.return;try{if(R4(i,v,o,c,ot)){Kt=1,Yd(i,Pr(c,i.current)),nt=null;return}}catch(x){if(v!==null)throw nt=v,x;Kt=1,Yd(i,Pr(c,i.current)),nt=null;return}o.flags&32768?(lt||f===1?i=!0:qa||(ot&536870912)!==0?i=!1:(js=i=!0,(f===2||f===9||f===3||f===6)&&(f=br.current,f!==null&&f.tag===13&&(f.flags|=16384))),eS(o,i)):lh(o)}function lh(i){var o=i;do{if((o.flags&32768)!==0){eS(o,js);return}i=o.return;var c=N4(o.alternate,o,ns);if(c!==null){nt=c;return}if(o=o.sibling,o!==null){nt=o;return}nt=o=i}while(o!==null);Kt===0&&(Kt=5)}function eS(i,o){do{var c=A4(i.alternate,i);if(c!==null){c.flags&=32767,nt=c;return}if(c=i.return,c!==null&&(c.flags|=32768,c.subtreeFlags=0,c.deletions=null),!o&&(i=i.sibling,i!==null)){nt=i;return}nt=i=c}while(i!==null);Kt=6,nt=null}function tS(i,o,c,f,v,x,E,D,K){i.cancelPendingCommit=null;do ch();while(hn!==0);if((vt&6)!==0)throw Error(r(327));if(o!==null){if(o===i.current)throw Error(r(177));if(x=o.lanes|o.childLanes,x|=xm,Ve(i,c,x,E,D,K),i===Ot&&(nt=Ot=null,ot=0),Ga=o,Ps=i,rs=c,Mg=x,Ng=v,Ww=f,(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,$4(Re,function(){return oS(),null})):(i.callbackNode=null,i.callbackPriority=0),f=(o.flags&13878)!==0,(o.subtreeFlags&13878)!==0||f){f=z.T,z.T=null,v=$.p,$.p=2,E=vt,vt|=4;try{D4(i,o,c)}finally{vt=E,$.p=v,z.T=f}}hn=1,nS(),rS(),iS()}}function nS(){if(hn===1){hn=0;var i=Ps,o=Ga,c=(o.flags&13878)!==0;if((o.subtreeFlags&13878)!==0||c){c=z.T,z.T=null;var f=$.p;$.p=2;var v=vt;vt|=4;try{zw(o,i);var x=Vg,E=Ux(i.containerInfo),D=x.focusedElem,K=x.selectionRange;if(E!==D&&D&&D.ownerDocument&&Fx(D.ownerDocument.documentElement,D)){if(K!==null&&gm(D)){var ne=K.start,he=K.end;if(he===void 0&&(he=ne),"selectionStart"in D)D.selectionStart=ne,D.selectionEnd=Math.min(he,D.value.length);else{var me=D.ownerDocument||document,se=me&&me.defaultView||window;if(se.getSelection){var ae=se.getSelection(),De=D.textContent.length,Ie=Math.min(K.start,De),Mt=K.end===void 0?Ie:Math.min(K.end,De);!ae.extend&&Ie>Mt&&(E=Mt,Mt=Ie,Ie=E);var J=Hx(D,Ie),X=Hx(D,Mt);if(J&&X&&(ae.rangeCount!==1||ae.anchorNode!==J.node||ae.anchorOffset!==J.offset||ae.focusNode!==X.node||ae.focusOffset!==X.offset)){var te=me.createRange();te.setStart(J.node,J.offset),ae.removeAllRanges(),Ie>Mt?(ae.addRange(te),ae.extend(X.node,X.offset)):(te.setEnd(X.node,X.offset),ae.addRange(te))}}}}for(me=[],ae=D;ae=ae.parentNode;)ae.nodeType===1&&me.push({element:ae,left:ae.scrollLeft,top:ae.scrollTop});for(typeof D.focus=="function"&&D.focus(),D=0;D<me.length;D++){var pe=me[D];pe.element.scrollLeft=pe.left,pe.element.scrollTop=pe.top}}xh=!!Wg,Vg=Wg=null}finally{vt=v,$.p=f,z.T=c}}i.current=o,hn=2}}function rS(){if(hn===2){hn=0;var i=Ps,o=Ga,c=(o.flags&8772)!==0;if((o.subtreeFlags&8772)!==0||c){c=z.T,z.T=null;var f=$.p;$.p=2;var v=vt;vt|=4;try{Aw(i,o.alternate,o)}finally{vt=v,$.p=f,z.T=c}}hn=3}}function iS(){if(hn===4||hn===3){hn=0,Nn();var i=Ps,o=Ga,c=rs,f=Ww;(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?hn=5:(hn=0,Ga=Ps=null,sS(i,i.pendingLanes));var v=i.pendingLanes;if(v===0&&(zs=null),Hi(c),o=o.stateNode,gt&&typeof gt.onCommitFiberRoot=="function")try{gt.onCommitFiberRoot(Xe,o,void 0,(o.current.flags&128)===128)}catch{}if(f!==null){o=z.T,v=$.p,$.p=2,z.T=null;try{for(var x=i.onRecoverableError,E=0;E<f.length;E++){var D=f[E];x(D.value,{componentStack:D.stack})}}finally{z.T=o,$.p=v}}(rs&3)!==0&&ch(),bi(i),v=i.pendingLanes,(c&261930)!==0&&(v&42)!==0?i===Ag?Nc++:(Nc=0,Ag=i):Nc=0,Ac(0)}}function sS(i,o){(i.pooledCacheLanes&=o)===0&&(o=i.pooledCache,o!=null&&(i.pooledCache=null,dc(o)))}function ch(){return nS(),rS(),iS(),oS()}function oS(){if(hn!==5)return!1;var i=Ps,o=Mg;Mg=0;var c=Hi(rs),f=z.T,v=$.p;try{$.p=32>c?32:c,z.T=null,c=Ng,Ng=null;var x=Ps,E=rs;if(hn=0,Ga=Ps=null,rs=0,(vt&6)!==0)throw Error(r(331));var D=vt;if(vt|=4,Fw(x.current),Bw(x,x.current,E,c),vt=D,Ac(0,!1),gt&&typeof gt.onPostCommitFiberRoot=="function")try{gt.onPostCommitFiberRoot(Xe,x)}catch{}return!0}finally{$.p=v,z.T=f,sS(i,o)}}function aS(i,o,c){o=Pr(c,o),o=cg(i.stateNode,o,2),i=Ns(i,o,2),i!==null&&(We(i,2),bi(i))}function Ct(i,o,c){if(i.tag===3)aS(i,i,c);else for(;o!==null;){if(o.tag===3){aS(o,i,c);break}else if(o.tag===1){var f=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof f.componentDidCatch=="function"&&(zs===null||!zs.has(f))){i=Pr(c,i),c=lw(2),f=Ns(o,c,2),f!==null&&(cw(c,f,o,i),We(f,2),bi(f));break}}o=o.return}}function jg(i,o,c){var f=i.pingCache;if(f===null){f=i.pingCache=new L4;var v=new Set;f.set(o,v)}else v=f.get(o),v===void 0&&(v=new Set,f.set(o,v));v.has(c)||(Eg=!0,v.add(c),i=H4.bind(null,i,o,c),o.then(i,i))}function H4(i,o,c){var f=i.pingCache;f!==null&&f.delete(o),i.pingedLanes|=i.suspendedLanes&c,i.warmLanes&=~c,Ot===i&&(ot&c)===c&&(Kt===4||Kt===3&&(ot&62914560)===ot&&300>Dt()-rh?(vt&2)===0&&Ya(i,0):Rg|=c,Ka===ot&&(Ka=0)),bi(i)}function lS(i,o){o===0&&(o=re()),i=Co(i,o),i!==null&&(We(i,o),bi(i))}function F4(i){var o=i.memoizedState,c=0;o!==null&&(c=o.retryLane),lS(i,c)}function U4(i,o){var c=0;switch(i.tag){case 31:case 13:var f=i.stateNode,v=i.memoizedState;v!==null&&(c=v.retryLane);break;case 19:f=i.stateNode;break;case 22:f=i.stateNode._retryCache;break;default:throw Error(r(314))}f!==null&&f.delete(o),lS(i,c)}function $4(i,o){return bt(i,o)}var uh=null,Za=null,Lg=!1,dh=!1,zg=!1,Is=0;function bi(i){i!==Za&&i.next===null&&(Za===null?uh=Za=i:Za=Za.next=i),dh=!0,Lg||(Lg=!0,V4())}function Ac(i,o){if(!zg&&dh){zg=!0;do for(var c=!1,f=uh;f!==null;){if(i!==0){var v=f.pendingLanes;if(v===0)var x=0;else{var E=f.suspendedLanes,D=f.pingedLanes;x=(1<<31-Te(42|i)+1)-1,x&=v&~(E&~D),x=x&201326741?x&201326741|1:x?x|2:0}x!==0&&(c=!0,hS(f,x))}else x=ot,x=Lt(f,f===Ot?x:0,f.cancelPendingCommit!==null||f.timeoutHandle!==-1),(x&3)===0||Dn(f,x)||(c=!0,hS(f,x));f=f.next}while(c);zg=!1}}function W4(){cS()}function cS(){dh=Lg=!1;var i=0;Is!==0&&tO()&&(i=Is);for(var o=Dt(),c=null,f=uh;f!==null;){var v=f.next,x=uS(f,o);x===0?(f.next=null,c===null?uh=v:c.next=v,v===null&&(Za=c)):(c=f,(i!==0||(x&3)!==0)&&(dh=!0)),f=v}hn!==0&&hn!==5||Ac(i),Is!==0&&(Is=0)}function uS(i,o){for(var c=i.suspendedLanes,f=i.pingedLanes,v=i.expirationTimes,x=i.pendingLanes&-62914561;0<x;){var E=31-Te(x),D=1<<E,K=v[E];K===-1?((D&c)===0||(D&f)!==0)&&(v[E]=On(D,o)):K<=o&&(i.expiredLanes|=D),x&=~D}if(o=Ot,c=ot,c=Lt(i,i===o?c:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),f=i.callbackNode,c===0||i===o&&(St===2||St===9)||i.cancelPendingCommit!==null)return f!==null&&f!==null&&un(f),i.callbackNode=null,i.callbackPriority=0;if((c&3)===0||Dn(i,c)){if(o=c&-c,o===i.callbackPriority)return o;switch(f!==null&&un(f),Hi(c)){case 2:case 8:c=le;break;case 32:c=Re;break;case 268435456:c=$e;break;default:c=Re}return f=dS.bind(null,i),c=bt(c,f),i.callbackPriority=o,i.callbackNode=c,o}return f!==null&&f!==null&&un(f),i.callbackPriority=2,i.callbackNode=null,2}function dS(i,o){if(hn!==0&&hn!==5)return i.callbackNode=null,i.callbackPriority=0,null;var c=i.callbackNode;if(ch()&&i.callbackNode!==c)return null;var f=ot;return f=Lt(i,i===Ot?f:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),f===0?null:(qw(i,f,o),uS(i,Dt()),i.callbackNode!=null&&i.callbackNode===c?dS.bind(null,i):null)}function hS(i,o){if(ch())return null;qw(i,o,!0)}function V4(){rO(function(){(vt&6)!==0?bt(Y,W4):cS()})}function Pg(){if(Is===0){var i=za;i===0&&(i=An,An<<=1,(An&261888)===0&&(An=256)),Is=i}return Is}function fS(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:yd(""+i)}function pS(i,o){var c=o.ownerDocument.createElement("input");return c.name=o.name,c.value=o.value,i.id&&c.setAttribute("form",i.id),o.parentNode.insertBefore(c,o),i=new FormData(i),c.parentNode.removeChild(c),i}function q4(i,o,c,f,v){if(o==="submit"&&c&&c.stateNode===v){var x=fS((v[or]||null).action),E=f.submitter;E&&(o=(o=E[or]||null)?fS(o.formAction):E.getAttribute("formAction"),o!==null&&(x=o,E=null));var D=new Sd("action","action",null,f,v);i.push({event:D,listeners:[{instance:null,listener:function(){if(f.defaultPrevented){if(Is!==0){var K=E?pS(v,E):new FormData(v);rg(c,{pending:!0,data:K,method:v.method,action:x},null,K)}}else typeof x=="function"&&(D.preventDefault(),K=E?pS(v,E):new FormData(v),rg(c,{pending:!0,data:K,method:v.method,action:x},x,K))},currentTarget:v}]})}}for(var Bg=0;Bg<bm.length;Bg++){var Ig=bm[Bg],K4=Ig.toLowerCase(),G4=Ig[0].toUpperCase()+Ig.slice(1);ni(K4,"on"+G4)}ni(Vx,"onAnimationEnd"),ni(qx,"onAnimationIteration"),ni(Kx,"onAnimationStart"),ni("dblclick","onDoubleClick"),ni("focusin","onFocus"),ni("focusout","onBlur"),ni(u4,"onTransitionRun"),ni(d4,"onTransitionStart"),ni(h4,"onTransitionCancel"),ni(Gx,"onTransitionEnd"),wa("onMouseEnter",["mouseout","mouseover"]),wa("onMouseLeave",["mouseout","mouseover"]),wa("onPointerEnter",["pointerout","pointerover"]),wa("onPointerLeave",["pointerout","pointerover"]),bo("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),bo("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),bo("onBeforeInput",["compositionend","keypress","textInput","paste"]),bo("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),bo("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),bo("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Dc="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(" "),Y4=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Dc));function mS(i,o){o=(o&4)!==0;for(var c=0;c<i.length;c++){var f=i[c],v=f.event;f=f.listeners;e:{var x=void 0;if(o)for(var E=f.length-1;0<=E;E--){var D=f[E],K=D.instance,ne=D.currentTarget;if(D=D.listener,K!==x&&v.isPropagationStopped())break e;x=D,v.currentTarget=ne;try{x(v)}catch(he){Ed(he)}v.currentTarget=null,x=K}else for(E=0;E<f.length;E++){if(D=f[E],K=D.instance,ne=D.currentTarget,D=D.listener,K!==x&&v.isPropagationStopped())break e;x=D,v.currentTarget=ne;try{x(v)}catch(he){Ed(he)}v.currentTarget=null,x=K}}}}function rt(i,o){var c=o[Qp];c===void 0&&(c=o[Qp]=new Set);var f=i+"__bubble";c.has(f)||(gS(o,i,2,!1),c.add(f))}function Hg(i,o,c){var f=0;o&&(f|=4),gS(c,i,f,o)}var hh="_reactListening"+Math.random().toString(36).slice(2);function Fg(i){if(!i[hh]){i[hh]=!0,cx.forEach(function(c){c!=="selectionchange"&&(Y4.has(c)||Hg(c,!1,i),Hg(c,!0,i))});var o=i.nodeType===9?i:i.ownerDocument;o===null||o[hh]||(o[hh]=!0,Hg("selectionchange",!1,o))}}function gS(i,o,c,f){switch(VS(o)){case 2:var v=SO;break;case 8:v=CO;break;default:v=nv}c=v.bind(null,o,c,i),v=void 0,!am||o!=="touchstart"&&o!=="touchmove"&&o!=="wheel"||(v=!0),f?v!==void 0?i.addEventListener(o,c,{capture:!0,passive:v}):i.addEventListener(o,c,!0):v!==void 0?i.addEventListener(o,c,{passive:v}):i.addEventListener(o,c,!1)}function Ug(i,o,c,f,v){var x=f;if((o&1)===0&&(o&2)===0&&f!==null)e:for(;;){if(f===null)return;var E=f.tag;if(E===3||E===4){var D=f.stateNode.containerInfo;if(D===v)break;if(E===4)for(E=f.return;E!==null;){var K=E.tag;if((K===3||K===4)&&E.stateNode.containerInfo===v)return;E=E.return}for(;D!==null;){if(E=ya(D),E===null)return;if(K=E.tag,K===5||K===6||K===26||K===27){f=x=E;continue e}D=D.parentNode}}f=f.return}xx(function(){var ne=x,he=sm(c),me=[];e:{var se=Yx.get(i);if(se!==void 0){var ae=Sd,De=i;switch(i){case"keypress":if(xd(c)===0)break e;case"keydown":case"keyup":ae=U3;break;case"focusin":De="focus",ae=dm;break;case"focusout":De="blur",ae=dm;break;case"beforeblur":case"afterblur":ae=dm;break;case"click":if(c.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ae=Cx;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ae=N3;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ae=V3;break;case Vx:case qx:case Kx:ae=O3;break;case Gx:ae=K3;break;case"scroll":case"scrollend":ae=T3;break;case"wheel":ae=Y3;break;case"copy":case"cut":case"paste":ae=L3;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ae=Ex;break;case"toggle":case"beforetoggle":ae=Z3}var Ie=(o&4)!==0,Mt=!Ie&&(i==="scroll"||i==="scrollend"),J=Ie?se!==null?se+"Capture":null:se;Ie=[];for(var X=ne,te;X!==null;){var pe=X;if(te=pe.stateNode,pe=pe.tag,pe!==5&&pe!==26&&pe!==27||te===null||J===null||(pe=ec(X,J),pe!=null&&Ie.push(Oc(X,pe,te))),Mt)break;X=X.return}0<Ie.length&&(se=new ae(se,De,null,c,he),me.push({event:se,listeners:Ie}))}}if((o&7)===0){e:{if(se=i==="mouseover"||i==="pointerover",ae=i==="mouseout"||i==="pointerout",se&&c!==im&&(De=c.relatedTarget||c.fromElement)&&(ya(De)||De[_a]))break e;if((ae||se)&&(se=he.window===he?he:(se=he.ownerDocument)?se.defaultView||se.parentWindow:window,ae?(De=c.relatedTarget||c.toElement,ae=ne,De=De?ya(De):null,De!==null&&(Mt=a(De),Ie=De.tag,De!==Mt||Ie!==5&&Ie!==27&&Ie!==6)&&(De=null)):(ae=null,De=ne),ae!==De)){if(Ie=Cx,pe="onMouseLeave",J="onMouseEnter",X="mouse",(i==="pointerout"||i==="pointerover")&&(Ie=Ex,pe="onPointerLeave",J="onPointerEnter",X="pointer"),Mt=ae==null?se:Jl(ae),te=De==null?se:Jl(De),se=new Ie(pe,X+"leave",ae,c,he),se.target=Mt,se.relatedTarget=te,pe=null,ya(he)===ne&&(Ie=new Ie(J,X+"enter",De,c,he),Ie.target=te,Ie.relatedTarget=Mt,pe=Ie),Mt=pe,ae&&De)t:{for(Ie=X4,J=ae,X=De,te=0,pe=J;pe;pe=Ie(pe))te++;pe=0;for(var Pe=X;Pe;Pe=Ie(Pe))pe++;for(;0<te-pe;)J=Ie(J),te--;for(;0<pe-te;)X=Ie(X),pe--;for(;te--;){if(J===X||X!==null&&J===X.alternate){Ie=J;break t}J=Ie(J),X=Ie(X)}Ie=null}else Ie=null;ae!==null&&vS(me,se,ae,Ie,!1),De!==null&&Mt!==null&&vS(me,Mt,De,Ie,!0)}}e:{if(se=ne?Jl(ne):window,ae=se.nodeName&&se.nodeName.toLowerCase(),ae==="select"||ae==="input"&&se.type==="file")var ft=jx;else if(Dx(se))if(Lx)ft=a4;else{ft=s4;var Le=i4}else ae=se.nodeName,!ae||ae.toLowerCase()!=="input"||se.type!=="checkbox"&&se.type!=="radio"?ne&&rm(ne.elementType)&&(ft=jx):ft=o4;if(ft&&(ft=ft(i,ne))){Ox(me,ft,c,he);break e}Le&&Le(i,se,ne),i==="focusout"&&ne&&se.type==="number"&&ne.memoizedProps.value!=null&&nm(se,"number",se.value)}switch(Le=ne?Jl(ne):window,i){case"focusin":(Dx(Le)||Le.contentEditable==="true")&&(Ta=Le,vm=ne,lc=null);break;case"focusout":lc=vm=Ta=null;break;case"mousedown":_m=!0;break;case"contextmenu":case"mouseup":case"dragend":_m=!1,$x(me,c,he);break;case"selectionchange":if(c4)break;case"keydown":case"keyup":$x(me,c,he)}var Ge;if(fm)e:{switch(i){case"compositionstart":var at="onCompositionStart";break e;case"compositionend":at="onCompositionEnd";break e;case"compositionupdate":at="onCompositionUpdate";break e}at=void 0}else Ra?Nx(i,c)&&(at="onCompositionEnd"):i==="keydown"&&c.keyCode===229&&(at="onCompositionStart");at&&(Rx&&c.locale!=="ko"&&(Ra||at!=="onCompositionStart"?at==="onCompositionEnd"&&Ra&&(Ge=wx()):(Ss=he,lm="value"in Ss?Ss.value:Ss.textContent,Ra=!0)),Le=fh(ne,at),0<Le.length&&(at=new kx(at,i,null,c,he),me.push({event:at,listeners:Le}),Ge?at.data=Ge:(Ge=Ax(c),Ge!==null&&(at.data=Ge)))),(Ge=J3?e4(i,c):t4(i,c))&&(at=fh(ne,"onBeforeInput"),0<at.length&&(Le=new kx("onBeforeInput","beforeinput",null,c,he),me.push({event:Le,listeners:at}),Le.data=Ge)),q4(me,i,ne,c,he)}mS(me,o)})}function Oc(i,o,c){return{instance:i,listener:o,currentTarget:c}}function fh(i,o){for(var c=o+"Capture",f=[];i!==null;){var v=i,x=v.stateNode;if(v=v.tag,v!==5&&v!==26&&v!==27||x===null||(v=ec(i,c),v!=null&&f.unshift(Oc(i,v,x)),v=ec(i,o),v!=null&&f.push(Oc(i,v,x))),i.tag===3)return f;i=i.return}return[]}function X4(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function vS(i,o,c,f,v){for(var x=o._reactName,E=[];c!==null&&c!==f;){var D=c,K=D.alternate,ne=D.stateNode;if(D=D.tag,K!==null&&K===f)break;D!==5&&D!==26&&D!==27||ne===null||(K=ne,v?(ne=ec(c,x),ne!=null&&E.unshift(Oc(c,ne,K))):v||(ne=ec(c,x),ne!=null&&E.push(Oc(c,ne,K)))),c=c.return}E.length!==0&&i.push({event:o,listeners:E})}var Z4=/\r\n?/g,Q4=/\u0000|\uFFFD/g;function _S(i){return(typeof i=="string"?i:""+i).replace(Z4,`
|
|
49
|
-
`).replace(Q4,"")}function yS(i,o){return o=_S(o),_S(i)===o}function Tt(i,o,c,f,v,x){switch(c){case"children":typeof f=="string"?o==="body"||o==="textarea"&&f===""||Ca(i,f):(typeof f=="number"||typeof f=="bigint")&&o!=="body"&&Ca(i,""+f);break;case"className":vd(i,"class",f);break;case"tabIndex":vd(i,"tabindex",f);break;case"dir":case"role":case"viewBox":case"width":case"height":vd(i,c,f);break;case"style":yx(i,f,x);break;case"data":if(o!=="object"){vd(i,"data",f);break}case"src":case"href":if(f===""&&(o!=="a"||c!=="href")){i.removeAttribute(c);break}if(f==null||typeof f=="function"||typeof f=="symbol"||typeof f=="boolean"){i.removeAttribute(c);break}f=yd(""+f),i.setAttribute(c,f);break;case"action":case"formAction":if(typeof f=="function"){i.setAttribute(c,"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 x=="function"&&(c==="formAction"?(o!=="input"&&Tt(i,o,"name",v.name,v,null),Tt(i,o,"formEncType",v.formEncType,v,null),Tt(i,o,"formMethod",v.formMethod,v,null),Tt(i,o,"formTarget",v.formTarget,v,null)):(Tt(i,o,"encType",v.encType,v,null),Tt(i,o,"method",v.method,v,null),Tt(i,o,"target",v.target,v,null)));if(f==null||typeof f=="symbol"||typeof f=="boolean"){i.removeAttribute(c);break}f=yd(""+f),i.setAttribute(c,f);break;case"onClick":f!=null&&(i.onclick=Ui);break;case"onScroll":f!=null&&rt("scroll",i);break;case"onScrollEnd":f!=null&&rt("scrollend",i);break;case"dangerouslySetInnerHTML":if(f!=null){if(typeof f!="object"||!("__html"in f))throw Error(r(61));if(c=f.__html,c!=null){if(v.children!=null)throw Error(r(60));i.innerHTML=c}}break;case"multiple":i.multiple=f&&typeof f!="function"&&typeof f!="symbol";break;case"muted":i.muted=f&&typeof f!="function"&&typeof f!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(f==null||typeof f=="function"||typeof f=="boolean"||typeof f=="symbol"){i.removeAttribute("xlink:href");break}c=yd(""+f),i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",c);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":f!=null&&typeof f!="function"&&typeof f!="symbol"?i.setAttribute(c,""+f):i.removeAttribute(c);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":f&&typeof f!="function"&&typeof f!="symbol"?i.setAttribute(c,""):i.removeAttribute(c);break;case"capture":case"download":f===!0?i.setAttribute(c,""):f!==!1&&f!=null&&typeof f!="function"&&typeof f!="symbol"?i.setAttribute(c,f):i.removeAttribute(c);break;case"cols":case"rows":case"size":case"span":f!=null&&typeof f!="function"&&typeof f!="symbol"&&!isNaN(f)&&1<=f?i.setAttribute(c,f):i.removeAttribute(c);break;case"rowSpan":case"start":f==null||typeof f=="function"||typeof f=="symbol"||isNaN(f)?i.removeAttribute(c):i.setAttribute(c,f);break;case"popover":rt("beforetoggle",i),rt("toggle",i),gd(i,"popover",f);break;case"xlinkActuate":Fi(i,"http://www.w3.org/1999/xlink","xlink:actuate",f);break;case"xlinkArcrole":Fi(i,"http://www.w3.org/1999/xlink","xlink:arcrole",f);break;case"xlinkRole":Fi(i,"http://www.w3.org/1999/xlink","xlink:role",f);break;case"xlinkShow":Fi(i,"http://www.w3.org/1999/xlink","xlink:show",f);break;case"xlinkTitle":Fi(i,"http://www.w3.org/1999/xlink","xlink:title",f);break;case"xlinkType":Fi(i,"http://www.w3.org/1999/xlink","xlink:type",f);break;case"xmlBase":Fi(i,"http://www.w3.org/XML/1998/namespace","xml:base",f);break;case"xmlLang":Fi(i,"http://www.w3.org/XML/1998/namespace","xml:lang",f);break;case"xmlSpace":Fi(i,"http://www.w3.org/XML/1998/namespace","xml:space",f);break;case"is":gd(i,"is",f);break;case"innerText":case"textContent":break;default:(!(2<c.length)||c[0]!=="o"&&c[0]!=="O"||c[1]!=="n"&&c[1]!=="N")&&(c=E3.get(c)||c,gd(i,c,f))}}function $g(i,o,c,f,v,x){switch(c){case"style":yx(i,f,x);break;case"dangerouslySetInnerHTML":if(f!=null){if(typeof f!="object"||!("__html"in f))throw Error(r(61));if(c=f.__html,c!=null){if(v.children!=null)throw Error(r(60));i.innerHTML=c}}break;case"children":typeof f=="string"?Ca(i,f):(typeof f=="number"||typeof f=="bigint")&&Ca(i,""+f);break;case"onScroll":f!=null&&rt("scroll",i);break;case"onScrollEnd":f!=null&&rt("scrollend",i);break;case"onClick":f!=null&&(i.onclick=Ui);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ux.hasOwnProperty(c))e:{if(c[0]==="o"&&c[1]==="n"&&(v=c.endsWith("Capture"),o=c.slice(2,v?c.length-7:void 0),x=i[or]||null,x=x!=null?x[c]:null,typeof x=="function"&&i.removeEventListener(o,x,v),typeof f=="function")){typeof x!="function"&&x!==null&&(c in i?i[c]=null:i.hasAttribute(c)&&i.removeAttribute(c)),i.addEventListener(o,f,v);break e}c in i?i[c]=f:f===!0?i.setAttribute(c,""):gd(i,c,f)}}}function In(i,o,c){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":rt("error",i),rt("load",i);var f=!1,v=!1,x;for(x in c)if(c.hasOwnProperty(x)){var E=c[x];if(E!=null)switch(x){case"src":f=!0;break;case"srcSet":v=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,o));default:Tt(i,o,x,E,c,null)}}v&&Tt(i,o,"srcSet",c.srcSet,c,null),f&&Tt(i,o,"src",c.src,c,null);return;case"input":rt("invalid",i);var D=x=E=v=null,K=null,ne=null;for(f in c)if(c.hasOwnProperty(f)){var he=c[f];if(he!=null)switch(f){case"name":v=he;break;case"type":E=he;break;case"checked":K=he;break;case"defaultChecked":ne=he;break;case"value":x=he;break;case"defaultValue":D=he;break;case"children":case"dangerouslySetInnerHTML":if(he!=null)throw Error(r(137,o));break;default:Tt(i,o,f,he,c,null)}}mx(i,x,D,K,ne,E,v,!1);return;case"select":rt("invalid",i),f=E=x=null;for(v in c)if(c.hasOwnProperty(v)&&(D=c[v],D!=null))switch(v){case"value":x=D;break;case"defaultValue":E=D;break;case"multiple":f=D;default:Tt(i,o,v,D,c,null)}o=x,c=E,i.multiple=!!f,o!=null?Sa(i,!!f,o,!1):c!=null&&Sa(i,!!f,c,!0);return;case"textarea":rt("invalid",i),x=v=f=null;for(E in c)if(c.hasOwnProperty(E)&&(D=c[E],D!=null))switch(E){case"value":f=D;break;case"defaultValue":v=D;break;case"children":x=D;break;case"dangerouslySetInnerHTML":if(D!=null)throw Error(r(91));break;default:Tt(i,o,E,D,c,null)}vx(i,f,v,x);return;case"option":for(K in c)if(c.hasOwnProperty(K)&&(f=c[K],f!=null))switch(K){case"selected":i.selected=f&&typeof f!="function"&&typeof f!="symbol";break;default:Tt(i,o,K,f,c,null)}return;case"dialog":rt("beforetoggle",i),rt("toggle",i),rt("cancel",i),rt("close",i);break;case"iframe":case"object":rt("load",i);break;case"video":case"audio":for(f=0;f<Dc.length;f++)rt(Dc[f],i);break;case"image":rt("error",i),rt("load",i);break;case"details":rt("toggle",i);break;case"embed":case"source":case"link":rt("error",i),rt("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(ne in c)if(c.hasOwnProperty(ne)&&(f=c[ne],f!=null))switch(ne){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,o));default:Tt(i,o,ne,f,c,null)}return;default:if(rm(o)){for(he in c)c.hasOwnProperty(he)&&(f=c[he],f!==void 0&&$g(i,o,he,f,c,void 0));return}}for(D in c)c.hasOwnProperty(D)&&(f=c[D],f!=null&&Tt(i,o,D,f,c,null))}function J4(i,o,c,f){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var v=null,x=null,E=null,D=null,K=null,ne=null,he=null;for(ae in c){var me=c[ae];if(c.hasOwnProperty(ae)&&me!=null)switch(ae){case"checked":break;case"value":break;case"defaultValue":K=me;default:f.hasOwnProperty(ae)||Tt(i,o,ae,null,f,me)}}for(var se in f){var ae=f[se];if(me=c[se],f.hasOwnProperty(se)&&(ae!=null||me!=null))switch(se){case"type":x=ae;break;case"name":v=ae;break;case"checked":ne=ae;break;case"defaultChecked":he=ae;break;case"value":E=ae;break;case"defaultValue":D=ae;break;case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(r(137,o));break;default:ae!==me&&Tt(i,o,se,ae,f,me)}}tm(i,E,D,K,ne,he,x,v);return;case"select":ae=E=D=se=null;for(x in c)if(K=c[x],c.hasOwnProperty(x)&&K!=null)switch(x){case"value":break;case"multiple":ae=K;default:f.hasOwnProperty(x)||Tt(i,o,x,null,f,K)}for(v in f)if(x=f[v],K=c[v],f.hasOwnProperty(v)&&(x!=null||K!=null))switch(v){case"value":se=x;break;case"defaultValue":D=x;break;case"multiple":E=x;default:x!==K&&Tt(i,o,v,x,f,K)}o=D,c=E,f=ae,se!=null?Sa(i,!!c,se,!1):!!f!=!!c&&(o!=null?Sa(i,!!c,o,!0):Sa(i,!!c,c?[]:"",!1));return;case"textarea":ae=se=null;for(D in c)if(v=c[D],c.hasOwnProperty(D)&&v!=null&&!f.hasOwnProperty(D))switch(D){case"value":break;case"children":break;default:Tt(i,o,D,null,f,v)}for(E in f)if(v=f[E],x=c[E],f.hasOwnProperty(E)&&(v!=null||x!=null))switch(E){case"value":se=v;break;case"defaultValue":ae=v;break;case"children":break;case"dangerouslySetInnerHTML":if(v!=null)throw Error(r(91));break;default:v!==x&&Tt(i,o,E,v,f,x)}gx(i,se,ae);return;case"option":for(var De in c)if(se=c[De],c.hasOwnProperty(De)&&se!=null&&!f.hasOwnProperty(De))switch(De){case"selected":i.selected=!1;break;default:Tt(i,o,De,null,f,se)}for(K in f)if(se=f[K],ae=c[K],f.hasOwnProperty(K)&&se!==ae&&(se!=null||ae!=null))switch(K){case"selected":i.selected=se&&typeof se!="function"&&typeof se!="symbol";break;default:Tt(i,o,K,se,f,ae)}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 Ie in c)se=c[Ie],c.hasOwnProperty(Ie)&&se!=null&&!f.hasOwnProperty(Ie)&&Tt(i,o,Ie,null,f,se);for(ne in f)if(se=f[ne],ae=c[ne],f.hasOwnProperty(ne)&&se!==ae&&(se!=null||ae!=null))switch(ne){case"children":case"dangerouslySetInnerHTML":if(se!=null)throw Error(r(137,o));break;default:Tt(i,o,ne,se,f,ae)}return;default:if(rm(o)){for(var Mt in c)se=c[Mt],c.hasOwnProperty(Mt)&&se!==void 0&&!f.hasOwnProperty(Mt)&&$g(i,o,Mt,void 0,f,se);for(he in f)se=f[he],ae=c[he],!f.hasOwnProperty(he)||se===ae||se===void 0&&ae===void 0||$g(i,o,he,se,f,ae);return}}for(var J in c)se=c[J],c.hasOwnProperty(J)&&se!=null&&!f.hasOwnProperty(J)&&Tt(i,o,J,null,f,se);for(me in f)se=f[me],ae=c[me],!f.hasOwnProperty(me)||se===ae||se==null&&ae==null||Tt(i,o,me,se,f,ae)}function bS(i){switch(i){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function eO(){if(typeof performance.getEntriesByType=="function"){for(var i=0,o=0,c=performance.getEntriesByType("resource"),f=0;f<c.length;f++){var v=c[f],x=v.transferSize,E=v.initiatorType,D=v.duration;if(x&&D&&bS(E)){for(E=0,D=v.responseEnd,f+=1;f<c.length;f++){var K=c[f],ne=K.startTime;if(ne>D)break;var he=K.transferSize,me=K.initiatorType;he&&bS(me)&&(K=K.responseEnd,E+=he*(K<D?1:(D-ne)/(K-ne)))}if(--f,o+=8*(x+E)/(v.duration/1e3),i++,10<i)break}}if(0<i)return o/i/1e6}return navigator.connection&&(i=navigator.connection.downlink,typeof i=="number")?i:5}var Wg=null,Vg=null;function ph(i){return i.nodeType===9?i:i.ownerDocument}function xS(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 wS(i,o){if(i===0)switch(o){case"svg":return 1;case"math":return 2;default:return 0}return i===1&&o==="foreignObject"?0:i}function qg(i,o){return i==="textarea"||i==="noscript"||typeof o.children=="string"||typeof o.children=="number"||typeof o.children=="bigint"||typeof o.dangerouslySetInnerHTML=="object"&&o.dangerouslySetInnerHTML!==null&&o.dangerouslySetInnerHTML.__html!=null}var Kg=null;function tO(){var i=window.event;return i&&i.type==="popstate"?i===Kg?!1:(Kg=i,!0):(Kg=null,!1)}var SS=typeof setTimeout=="function"?setTimeout:void 0,nO=typeof clearTimeout=="function"?clearTimeout:void 0,CS=typeof Promise=="function"?Promise:void 0,rO=typeof queueMicrotask=="function"?queueMicrotask:typeof CS<"u"?function(i){return CS.resolve(null).then(i).catch(iO)}:SS;function iO(i){setTimeout(function(){throw i})}function Hs(i){return i==="head"}function kS(i,o){var c=o,f=0;do{var v=c.nextSibling;if(i.removeChild(c),v&&v.nodeType===8)if(c=v.data,c==="/$"||c==="/&"){if(f===0){i.removeChild(v),tl(o);return}f--}else if(c==="$"||c==="$?"||c==="$~"||c==="$!"||c==="&")f++;else if(c==="html")jc(i.ownerDocument.documentElement);else if(c==="head"){c=i.ownerDocument.head,jc(c);for(var x=c.firstChild;x;){var E=x.nextSibling,D=x.nodeName;x[Ql]||D==="SCRIPT"||D==="STYLE"||D==="LINK"&&x.rel.toLowerCase()==="stylesheet"||c.removeChild(x),x=E}}else c==="body"&&jc(i.ownerDocument.body);c=v}while(c);tl(o)}function ES(i,o){var c=i;i=0;do{var f=c.nextSibling;if(c.nodeType===1?o?(c._stashedDisplay=c.style.display,c.style.display="none"):(c.style.display=c._stashedDisplay||"",c.getAttribute("style")===""&&c.removeAttribute("style")):c.nodeType===3&&(o?(c._stashedText=c.nodeValue,c.nodeValue=""):c.nodeValue=c._stashedText||""),f&&f.nodeType===8)if(c=f.data,c==="/$"){if(i===0)break;i--}else c!=="$"&&c!=="$?"&&c!=="$~"&&c!=="$!"||i++;c=f}while(c)}function Gg(i){var o=i.firstChild;for(o&&o.nodeType===10&&(o=o.nextSibling);o;){var c=o;switch(o=o.nextSibling,c.nodeName){case"HTML":case"HEAD":case"BODY":Gg(c),Jp(c);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(c.rel.toLowerCase()==="stylesheet")continue}i.removeChild(c)}}function sO(i,o,c,f){for(;i.nodeType===1;){var v=c;if(i.nodeName.toLowerCase()!==o.toLowerCase()){if(!f&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(f){if(!i[Ql])switch(o){case"meta":if(!i.hasAttribute("itemprop"))break;return i;case"link":if(x=i.getAttribute("rel"),x==="stylesheet"&&i.hasAttribute("data-precedence"))break;if(x!==v.rel||i.getAttribute("href")!==(v.href==null||v.href===""?null:v.href)||i.getAttribute("crossorigin")!==(v.crossOrigin==null?null:v.crossOrigin)||i.getAttribute("title")!==(v.title==null?null:v.title))break;return i;case"style":if(i.hasAttribute("data-precedence"))break;return i;case"script":if(x=i.getAttribute("src"),(x!==(v.src==null?null:v.src)||i.getAttribute("type")!==(v.type==null?null:v.type)||i.getAttribute("crossorigin")!==(v.crossOrigin==null?null:v.crossOrigin))&&x&&i.hasAttribute("async")&&!i.hasAttribute("itemprop"))break;return i;default:return i}}else if(o==="input"&&i.type==="hidden"){var x=v.name==null?null:""+v.name;if(v.type==="hidden"&&i.getAttribute("name")===x)return i}else return i;if(i=Ur(i.nextSibling),i===null)break}return null}function oO(i,o,c){if(o==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!c||(i=Ur(i.nextSibling),i===null))return null;return i}function RS(i,o){for(;i.nodeType!==8;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!o||(i=Ur(i.nextSibling),i===null))return null;return i}function Yg(i){return i.data==="$?"||i.data==="$~"}function Xg(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState!=="loading"}function aO(i,o){var c=i.ownerDocument;if(i.data==="$~")i._reactRetry=o;else if(i.data!=="$?"||c.readyState!=="loading")o();else{var f=function(){o(),c.removeEventListener("DOMContentLoaded",f)};c.addEventListener("DOMContentLoaded",f),i._reactRetry=f}}function Ur(i){for(;i!=null;i=i.nextSibling){var o=i.nodeType;if(o===1||o===3)break;if(o===8){if(o=i.data,o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"||o==="F!"||o==="F")break;if(o==="/$"||o==="/&")return null}}return i}var Zg=null;function TS(i){i=i.nextSibling;for(var o=0;i;){if(i.nodeType===8){var c=i.data;if(c==="/$"||c==="/&"){if(o===0)return Ur(i.nextSibling);o--}else c!=="$"&&c!=="$!"&&c!=="$?"&&c!=="$~"&&c!=="&"||o++}i=i.nextSibling}return null}function MS(i){i=i.previousSibling;for(var o=0;i;){if(i.nodeType===8){var c=i.data;if(c==="$"||c==="$!"||c==="$?"||c==="$~"||c==="&"){if(o===0)return i;o--}else c!=="/$"&&c!=="/&"||o++}i=i.previousSibling}return null}function NS(i,o,c){switch(o=ph(c),i){case"html":if(i=o.documentElement,!i)throw Error(r(452));return i;case"head":if(i=o.head,!i)throw Error(r(453));return i;case"body":if(i=o.body,!i)throw Error(r(454));return i;default:throw Error(r(451))}}function jc(i){for(var o=i.attributes;o.length;)i.removeAttributeNode(o[0]);Jp(i)}var $r=new Map,AS=new Set;function mh(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var is=$.d;$.d={f:lO,r:cO,D:uO,C:dO,L:hO,m:fO,X:mO,S:pO,M:gO};function lO(){var i=is.f(),o=oh();return i||o}function cO(i){var o=ba(i);o!==null&&o.tag===5&&o.type==="form"?G1(o):is.r(i)}var Qa=typeof document>"u"?null:document;function DS(i,o,c){var f=Qa;if(f&&typeof o=="string"&&o){var v=Lr(o);v='link[rel="'+i+'"][href="'+v+'"]',typeof c=="string"&&(v+='[crossorigin="'+c+'"]'),AS.has(v)||(AS.add(v),i={rel:i,crossOrigin:c,href:o},f.querySelector(v)===null&&(o=f.createElement("link"),In(o,"link",i),yn(o),f.head.appendChild(o)))}}function uO(i){is.D(i),DS("dns-prefetch",i,null)}function dO(i,o){is.C(i,o),DS("preconnect",i,o)}function hO(i,o,c){is.L(i,o,c);var f=Qa;if(f&&i&&o){var v='link[rel="preload"][as="'+Lr(o)+'"]';o==="image"&&c&&c.imageSrcSet?(v+='[imagesrcset="'+Lr(c.imageSrcSet)+'"]',typeof c.imageSizes=="string"&&(v+='[imagesizes="'+Lr(c.imageSizes)+'"]')):v+='[href="'+Lr(i)+'"]';var x=v;switch(o){case"style":x=Ja(i);break;case"script":x=el(i)}$r.has(x)||(i=g({rel:"preload",href:o==="image"&&c&&c.imageSrcSet?void 0:i,as:o},c),$r.set(x,i),f.querySelector(v)!==null||o==="style"&&f.querySelector(Lc(x))||o==="script"&&f.querySelector(zc(x))||(o=f.createElement("link"),In(o,"link",i),yn(o),f.head.appendChild(o)))}}function fO(i,o){is.m(i,o);var c=Qa;if(c&&i){var f=o&&typeof o.as=="string"?o.as:"script",v='link[rel="modulepreload"][as="'+Lr(f)+'"][href="'+Lr(i)+'"]',x=v;switch(f){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":x=el(i)}if(!$r.has(x)&&(i=g({rel:"modulepreload",href:i},o),$r.set(x,i),c.querySelector(v)===null)){switch(f){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(c.querySelector(zc(x)))return}f=c.createElement("link"),In(f,"link",i),yn(f),c.head.appendChild(f)}}}function pO(i,o,c){is.S(i,o,c);var f=Qa;if(f&&i){var v=xa(f).hoistableStyles,x=Ja(i);o=o||"default";var E=v.get(x);if(!E){var D={loading:0,preload:null};if(E=f.querySelector(Lc(x)))D.loading=5;else{i=g({rel:"stylesheet",href:i,"data-precedence":o},c),(c=$r.get(x))&&Qg(i,c);var K=E=f.createElement("link");yn(K),In(K,"link",i),K._p=new Promise(function(ne,he){K.onload=ne,K.onerror=he}),K.addEventListener("load",function(){D.loading|=1}),K.addEventListener("error",function(){D.loading|=2}),D.loading|=4,gh(E,o,f)}E={type:"stylesheet",instance:E,count:1,state:D},v.set(x,E)}}}function mO(i,o){is.X(i,o);var c=Qa;if(c&&i){var f=xa(c).hoistableScripts,v=el(i),x=f.get(v);x||(x=c.querySelector(zc(v)),x||(i=g({src:i,async:!0},o),(o=$r.get(v))&&Jg(i,o),x=c.createElement("script"),yn(x),In(x,"link",i),c.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},f.set(v,x))}}function gO(i,o){is.M(i,o);var c=Qa;if(c&&i){var f=xa(c).hoistableScripts,v=el(i),x=f.get(v);x||(x=c.querySelector(zc(v)),x||(i=g({src:i,async:!0,type:"module"},o),(o=$r.get(v))&&Jg(i,o),x=c.createElement("script"),yn(x),In(x,"link",i),c.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},f.set(v,x))}}function OS(i,o,c,f){var v=(v=ue.current)?mh(v):null;if(!v)throw Error(r(446));switch(i){case"meta":case"title":return null;case"style":return typeof c.precedence=="string"&&typeof c.href=="string"?(o=Ja(c.href),c=xa(v).hoistableStyles,f=c.get(o),f||(f={type:"style",instance:null,count:0,state:null},c.set(o,f)),f):{type:"void",instance:null,count:0,state:null};case"link":if(c.rel==="stylesheet"&&typeof c.href=="string"&&typeof c.precedence=="string"){i=Ja(c.href);var x=xa(v).hoistableStyles,E=x.get(i);if(E||(v=v.ownerDocument||v,E={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},x.set(i,E),(x=v.querySelector(Lc(i)))&&!x._p&&(E.instance=x,E.state.loading=5),$r.has(i)||(c={rel:"preload",as:"style",href:c.href,crossOrigin:c.crossOrigin,integrity:c.integrity,media:c.media,hrefLang:c.hrefLang,referrerPolicy:c.referrerPolicy},$r.set(i,c),x||vO(v,i,c,E.state))),o&&f===null)throw Error(r(528,""));return E}if(o&&f!==null)throw Error(r(529,""));return null;case"script":return o=c.async,c=c.src,typeof c=="string"&&o&&typeof o!="function"&&typeof o!="symbol"?(o=el(c),c=xa(v).hoistableScripts,f=c.get(o),f||(f={type:"script",instance:null,count:0,state:null},c.set(o,f)),f):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,i))}}function Ja(i){return'href="'+Lr(i)+'"'}function Lc(i){return'link[rel="stylesheet"]['+i+"]"}function jS(i){return g({},i,{"data-precedence":i.precedence,precedence:null})}function vO(i,o,c,f){i.querySelector('link[rel="preload"][as="style"]['+o+"]")?f.loading=1:(o=i.createElement("link"),f.preload=o,o.addEventListener("load",function(){return f.loading|=1}),o.addEventListener("error",function(){return f.loading|=2}),In(o,"link",c),yn(o),i.head.appendChild(o))}function el(i){return'[src="'+Lr(i)+'"]'}function zc(i){return"script[async]"+i}function LS(i,o,c){if(o.count++,o.instance===null)switch(o.type){case"style":var f=i.querySelector('style[data-href~="'+Lr(c.href)+'"]');if(f)return o.instance=f,yn(f),f;var v=g({},c,{"data-href":c.href,"data-precedence":c.precedence,href:null,precedence:null});return f=(i.ownerDocument||i).createElement("style"),yn(f),In(f,"style",v),gh(f,c.precedence,i),o.instance=f;case"stylesheet":v=Ja(c.href);var x=i.querySelector(Lc(v));if(x)return o.state.loading|=4,o.instance=x,yn(x),x;f=jS(c),(v=$r.get(v))&&Qg(f,v),x=(i.ownerDocument||i).createElement("link"),yn(x);var E=x;return E._p=new Promise(function(D,K){E.onload=D,E.onerror=K}),In(x,"link",f),o.state.loading|=4,gh(x,c.precedence,i),o.instance=x;case"script":return x=el(c.src),(v=i.querySelector(zc(x)))?(o.instance=v,yn(v),v):(f=c,(v=$r.get(x))&&(f=g({},c),Jg(f,v)),i=i.ownerDocument||i,v=i.createElement("script"),yn(v),In(v,"link",f),i.head.appendChild(v),o.instance=v);case"void":return null;default:throw Error(r(443,o.type))}else o.type==="stylesheet"&&(o.state.loading&4)===0&&(f=o.instance,o.state.loading|=4,gh(f,c.precedence,i));return o.instance}function gh(i,o,c){for(var f=c.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),v=f.length?f[f.length-1]:null,x=v,E=0;E<f.length;E++){var D=f[E];if(D.dataset.precedence===o)x=D;else if(x!==v)break}x?x.parentNode.insertBefore(i,x.nextSibling):(o=c.nodeType===9?c.head:c,o.insertBefore(i,o.firstChild))}function Qg(i,o){i.crossOrigin==null&&(i.crossOrigin=o.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=o.referrerPolicy),i.title==null&&(i.title=o.title)}function Jg(i,o){i.crossOrigin==null&&(i.crossOrigin=o.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=o.referrerPolicy),i.integrity==null&&(i.integrity=o.integrity)}var vh=null;function zS(i,o,c){if(vh===null){var f=new Map,v=vh=new Map;v.set(c,f)}else v=vh,f=v.get(c),f||(f=new Map,v.set(c,f));if(f.has(i))return f;for(f.set(i,null),c=c.getElementsByTagName(i),v=0;v<c.length;v++){var x=c[v];if(!(x[Ql]||x[Ln]||i==="link"&&x.getAttribute("rel")==="stylesheet")&&x.namespaceURI!=="http://www.w3.org/2000/svg"){var E=x.getAttribute(o)||"";E=i+E;var D=f.get(E);D?D.push(x):f.set(E,[x])}}return f}function PS(i,o,c){i=i.ownerDocument||i,i.head.insertBefore(c,o==="title"?i.querySelector("head > title"):null)}function _O(i,o,c){if(c===1||o.itemProp!=null)return!1;switch(i){case"meta":case"title":return!0;case"style":if(typeof o.precedence!="string"||typeof o.href!="string"||o.href==="")break;return!0;case"link":if(typeof o.rel!="string"||typeof o.href!="string"||o.href===""||o.onLoad||o.onError)break;switch(o.rel){case"stylesheet":return i=o.disabled,typeof o.precedence=="string"&&i==null;default:return!0}case"script":if(o.async&&typeof o.async!="function"&&typeof o.async!="symbol"&&!o.onLoad&&!o.onError&&o.src&&typeof o.src=="string")return!0}return!1}function BS(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function yO(i,o,c,f){if(c.type==="stylesheet"&&(typeof f.media!="string"||matchMedia(f.media).matches!==!1)&&(c.state.loading&4)===0){if(c.instance===null){var v=Ja(f.href),x=o.querySelector(Lc(v));if(x){o=x._p,o!==null&&typeof o=="object"&&typeof o.then=="function"&&(i.count++,i=_h.bind(i),o.then(i,i)),c.state.loading|=4,c.instance=x,yn(x);return}x=o.ownerDocument||o,f=jS(f),(v=$r.get(v))&&Qg(f,v),x=x.createElement("link"),yn(x);var E=x;E._p=new Promise(function(D,K){E.onload=D,E.onerror=K}),In(x,"link",f),c.instance=x}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(c,o),(o=c.state.preload)&&(c.state.loading&3)===0&&(i.count++,c=_h.bind(i),o.addEventListener("load",c),o.addEventListener("error",c))}}var ev=0;function bO(i,o){return i.stylesheets&&i.count===0&&bh(i,i.stylesheets),0<i.count||0<i.imgCount?function(c){var f=setTimeout(function(){if(i.stylesheets&&bh(i,i.stylesheets),i.unsuspend){var x=i.unsuspend;i.unsuspend=null,x()}},6e4+o);0<i.imgBytes&&ev===0&&(ev=62500*eO());var v=setTimeout(function(){if(i.waitingForImages=!1,i.count===0&&(i.stylesheets&&bh(i,i.stylesheets),i.unsuspend)){var x=i.unsuspend;i.unsuspend=null,x()}},(i.imgBytes>ev?50:800)+o);return i.unsuspend=c,function(){i.unsuspend=null,clearTimeout(f),clearTimeout(v)}}:null}function _h(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)bh(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var yh=null;function bh(i,o){i.stylesheets=null,i.unsuspend!==null&&(i.count++,yh=new Map,o.forEach(xO,i),yh=null,_h.call(i))}function xO(i,o){if(!(o.state.loading&4)){var c=yh.get(i);if(c)var f=c.get(null);else{c=new Map,yh.set(i,c);for(var v=i.querySelectorAll("link[data-precedence],style[data-precedence]"),x=0;x<v.length;x++){var E=v[x];(E.nodeName==="LINK"||E.getAttribute("media")!=="not all")&&(c.set(E.dataset.precedence,E),f=E)}f&&c.set(null,f)}v=o.instance,E=v.getAttribute("data-precedence"),x=c.get(E)||f,x===f&&c.set(null,v),c.set(E,v),this.count++,f=_h.bind(this),v.addEventListener("load",f),v.addEventListener("error",f),x?x.parentNode.insertBefore(v,x.nextSibling):(i=i.nodeType===9?i.head:i,i.insertBefore(v,i.firstChild)),o.state.loading|=4}}var Pc={$$typeof:T,Provider:null,Consumer:null,_currentValue:q,_currentValue2:q,_threadCount:0};function wO(i,o,c,f,v,x,E,D,K){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=ve(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ve(0),this.hiddenUpdates=ve(null),this.identifierPrefix=f,this.onUncaughtError=v,this.onCaughtError=x,this.onRecoverableError=E,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=K,this.incompleteTransitions=new Map}function IS(i,o,c,f,v,x,E,D,K,ne,he,me){return i=new wO(i,o,c,E,K,ne,he,me,D),o=1,x===!0&&(o|=24),x=yr(3,null,null,o),i.current=x,x.stateNode=i,o=Om(),o.refCount++,i.pooledCache=o,o.refCount++,x.memoizedState={element:f,isDehydrated:c,cache:o},Pm(x),i}function HS(i){return i?(i=Aa,i):Aa}function FS(i,o,c,f,v,x){v=HS(v),f.context===null?f.context=v:f.pendingContext=v,f=Ms(o),f.payload={element:c},x=x===void 0?null:x,x!==null&&(f.callback=x),c=Ns(i,f,o),c!==null&&(hr(c,i,o),mc(c,i,o))}function US(i,o){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var c=i.retryLane;i.retryLane=c!==0&&c<o?c:o}}function tv(i,o){US(i,o),(i=i.alternate)&&US(i,o)}function $S(i){if(i.tag===13||i.tag===31){var o=Co(i,67108864);o!==null&&hr(o,i,67108864),tv(i,67108864)}}function WS(i){if(i.tag===13||i.tag===31){var o=Cr();o=Ii(o);var c=Co(i,o);c!==null&&hr(c,i,o),tv(i,o)}}var xh=!0;function SO(i,o,c,f){var v=z.T;z.T=null;var x=$.p;try{$.p=2,nv(i,o,c,f)}finally{$.p=x,z.T=v}}function CO(i,o,c,f){var v=z.T;z.T=null;var x=$.p;try{$.p=8,nv(i,o,c,f)}finally{$.p=x,z.T=v}}function nv(i,o,c,f){if(xh){var v=rv(f);if(v===null)Ug(i,o,f,wh,c),qS(i,f);else if(EO(v,i,o,c,f))f.stopPropagation();else if(qS(i,f),o&4&&-1<kO.indexOf(i)){for(;v!==null;){var x=ba(v);if(x!==null)switch(x.tag){case 3:if(x=x.stateNode,x.current.memoizedState.isDehydrated){var E=Et(x.pendingLanes);if(E!==0){var D=x;for(D.pendingLanes|=2,D.entangledLanes|=2;E;){var K=1<<31-Te(E);D.entanglements[1]|=K,E&=~K}bi(x),(vt&6)===0&&(ih=Dt()+500,Ac(0))}}break;case 31:case 13:D=Co(x,2),D!==null&&hr(D,x,2),oh(),tv(x,2)}if(x=rv(f),x===null&&Ug(i,o,f,wh,c),x===v)break;v=x}v!==null&&f.stopPropagation()}else Ug(i,o,f,null,c)}}function rv(i){return i=sm(i),iv(i)}var wh=null;function iv(i){if(wh=null,i=ya(i),i!==null){var o=a(i);if(o===null)i=null;else{var c=o.tag;if(c===13){if(i=l(o),i!==null)return i;i=null}else if(c===31){if(i=u(o),i!==null)return i;i=null}else if(c===3){if(o.stateNode.current.memoizedState.isDehydrated)return o.tag===3?o.stateNode.containerInfo:null;i=null}else o!==i&&(i=null)}}return wh=i,null}function VS(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(Yn()){case Y:return 2;case le:return 8;case Re:case ze:return 32;case $e:return 268435456;default:return 32}default:return 32}}var sv=!1,Fs=null,Us=null,$s=null,Bc=new Map,Ic=new Map,Ws=[],kO="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 qS(i,o){switch(i){case"focusin":case"focusout":Fs=null;break;case"dragenter":case"dragleave":Us=null;break;case"mouseover":case"mouseout":$s=null;break;case"pointerover":case"pointerout":Bc.delete(o.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ic.delete(o.pointerId)}}function Hc(i,o,c,f,v,x){return i===null||i.nativeEvent!==x?(i={blockedOn:o,domEventName:c,eventSystemFlags:f,nativeEvent:x,targetContainers:[v]},o!==null&&(o=ba(o),o!==null&&$S(o)),i):(i.eventSystemFlags|=f,o=i.targetContainers,v!==null&&o.indexOf(v)===-1&&o.push(v),i)}function EO(i,o,c,f,v){switch(o){case"focusin":return Fs=Hc(Fs,i,o,c,f,v),!0;case"dragenter":return Us=Hc(Us,i,o,c,f,v),!0;case"mouseover":return $s=Hc($s,i,o,c,f,v),!0;case"pointerover":var x=v.pointerId;return Bc.set(x,Hc(Bc.get(x)||null,i,o,c,f,v)),!0;case"gotpointercapture":return x=v.pointerId,Ic.set(x,Hc(Ic.get(x)||null,i,o,c,f,v)),!0}return!1}function KS(i){var o=ya(i.target);if(o!==null){var c=a(o);if(c!==null){if(o=c.tag,o===13){if(o=l(c),o!==null){i.blockedOn=o,ws(i.priority,function(){WS(c)});return}}else if(o===31){if(o=u(c),o!==null){i.blockedOn=o,ws(i.priority,function(){WS(c)});return}}else if(o===3&&c.stateNode.current.memoizedState.isDehydrated){i.blockedOn=c.tag===3?c.stateNode.containerInfo:null;return}}}i.blockedOn=null}function Sh(i){if(i.blockedOn!==null)return!1;for(var o=i.targetContainers;0<o.length;){var c=rv(i.nativeEvent);if(c===null){c=i.nativeEvent;var f=new c.constructor(c.type,c);im=f,c.target.dispatchEvent(f),im=null}else return o=ba(c),o!==null&&$S(o),i.blockedOn=c,!1;o.shift()}return!0}function GS(i,o,c){Sh(i)&&c.delete(o)}function RO(){sv=!1,Fs!==null&&Sh(Fs)&&(Fs=null),Us!==null&&Sh(Us)&&(Us=null),$s!==null&&Sh($s)&&($s=null),Bc.forEach(GS),Ic.forEach(GS)}function Ch(i,o){i.blockedOn===o&&(i.blockedOn=null,sv||(sv=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,RO)))}var kh=null;function YS(i){kh!==i&&(kh=i,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){kh===i&&(kh=null);for(var o=0;o<i.length;o+=3){var c=i[o],f=i[o+1],v=i[o+2];if(typeof f!="function"){if(iv(f||c)===null)continue;break}var x=ba(c);x!==null&&(i.splice(o,3),o-=3,rg(x,{pending:!0,data:v,method:c.method,action:f},f,v))}}))}function tl(i){function o(K){return Ch(K,i)}Fs!==null&&Ch(Fs,i),Us!==null&&Ch(Us,i),$s!==null&&Ch($s,i),Bc.forEach(o),Ic.forEach(o);for(var c=0;c<Ws.length;c++){var f=Ws[c];f.blockedOn===i&&(f.blockedOn=null)}for(;0<Ws.length&&(c=Ws[0],c.blockedOn===null);)KS(c),c.blockedOn===null&&Ws.shift();if(c=(i.ownerDocument||i).$$reactFormReplay,c!=null)for(f=0;f<c.length;f+=3){var v=c[f],x=c[f+1],E=v[or]||null;if(typeof x=="function")E||YS(c);else if(E){var D=null;if(x&&x.hasAttribute("formAction")){if(v=x,E=x[or]||null)D=E.formAction;else if(iv(v)!==null)continue}else D=E.action;typeof D=="function"?c[f+1]=D:(c.splice(f,3),f-=3),YS(c)}}}function XS(){function i(x){x.canIntercept&&x.info==="react-transition"&&x.intercept({handler:function(){return new Promise(function(E){return v=E})},focusReset:"manual",scroll:"manual"})}function o(){v!==null&&(v(),v=null),f||setTimeout(c,20)}function c(){if(!f&&!navigation.transition){var x=navigation.currentEntry;x&&x.url!=null&&navigation.navigate(x.url,{state:x.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var f=!1,v=null;return navigation.addEventListener("navigate",i),navigation.addEventListener("navigatesuccess",o),navigation.addEventListener("navigateerror",o),setTimeout(c,100),function(){f=!0,navigation.removeEventListener("navigate",i),navigation.removeEventListener("navigatesuccess",o),navigation.removeEventListener("navigateerror",o),v!==null&&(v(),v=null)}}}function ov(i){this._internalRoot=i}Eh.prototype.render=ov.prototype.render=function(i){var o=this._internalRoot;if(o===null)throw Error(r(409));var c=o.current,f=Cr();FS(c,f,i,o,null,null)},Eh.prototype.unmount=ov.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var o=i.containerInfo;FS(i.current,2,null,i,null,null),oh(),o[_a]=null}};function Eh(i){this._internalRoot=i}Eh.prototype.unstable_scheduleHydration=function(i){if(i){var o=ti();i={blockedOn:null,target:i,priority:o};for(var c=0;c<Ws.length&&o!==0&&o<Ws[c].priority;c++);Ws.splice(c,0,i),c===0&&KS(i)}};var ZS=t.version;if(ZS!=="19.2.1")throw Error(r(527,ZS,"19.2.1"));$.findDOMNode=function(i){var o=i._reactInternals;if(o===void 0)throw typeof i.render=="function"?Error(r(188)):(i=Object.keys(i).join(","),Error(r(268,i)));return i=d(o),i=i!==null?m(i):null,i=i===null?null:i.stateNode,i};var TO={bundleType:0,version:"19.2.1",rendererPackageName:"react-dom",currentDispatcherRef:z,reconcilerVersion:"19.2.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Rh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Rh.isDisabled&&Rh.supportsFiber)try{Xe=Rh.inject(TO),gt=Rh}catch{}}return $c.createRoot=function(i,o){if(!s(i))throw Error(r(299));var c=!1,f="",v=iw,x=sw,E=ow;return o!=null&&(o.unstable_strictMode===!0&&(c=!0),o.identifierPrefix!==void 0&&(f=o.identifierPrefix),o.onUncaughtError!==void 0&&(v=o.onUncaughtError),o.onCaughtError!==void 0&&(x=o.onCaughtError),o.onRecoverableError!==void 0&&(E=o.onRecoverableError)),o=IS(i,1,!1,null,null,c,f,null,v,x,E,XS),i[_a]=o.current,Fg(i),new ov(o)},$c.hydrateRoot=function(i,o,c){if(!s(i))throw Error(r(299));var f=!1,v="",x=iw,E=sw,D=ow,K=null;return c!=null&&(c.unstable_strictMode===!0&&(f=!0),c.identifierPrefix!==void 0&&(v=c.identifierPrefix),c.onUncaughtError!==void 0&&(x=c.onUncaughtError),c.onCaughtError!==void 0&&(E=c.onCaughtError),c.onRecoverableError!==void 0&&(D=c.onRecoverableError),c.formState!==void 0&&(K=c.formState)),o=IS(i,1,!0,o,c??null,f,v,K,x,E,D,XS),o.context=HS(null),c=o.current,f=Cr(),f=Ii(f),v=Ms(f),v.callback=null,Ns(c,v,f),c=f,o.current.lanes=c,We(o,c),bi(o),i[_a]=o.current,Fg(i),new Eh(o)},$c.version="19.2.1",$c}var dC;function HO(){if(dC)return cv.exports;dC=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(),cv.exports=IO(),cv.exports}var FO=HO();/**
|
|
50
|
-
* react-router v7.13.1
|
|
51
|
-
*
|
|
52
|
-
* Copyright (c) Remix Software Inc.
|
|
53
|
-
*
|
|
54
|
-
* This source code is licensed under the MIT license found in the
|
|
55
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
56
|
-
*
|
|
57
|
-
* @license MIT
|
|
58
|
-
*/var hC="popstate";function fC(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function UO(e={}){function t(r,s){var d;let a=(d=s.state)==null?void 0:d.masked,{pathname:l,search:u,hash:h}=a||r.location;return S_("",{pathname:l,search:u,hash:h},s.state&&s.state.usr||null,s.state&&s.state.key||"default",a?{pathname:r.location.pathname,search:r.location.search,hash:r.location.hash}:void 0)}function n(r,s){return typeof s=="string"?s:Mu(s)}return WO(t,n,null,e)}function Ut(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function ui(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function $O(){return Math.random().toString(36).substring(2,10)}function pC(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.unstable_mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function S_(e,t,n=null,r,s){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?jl(t):t,state:n,key:t&&t.key||r||$O(),unstable_mask:s}}function Mu({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function jl(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function WO(e,t,n,r={}){let{window:s=document.defaultView,v5Compat:a=!1}=r,l=s.history,u="POP",h=null,d=m();d==null&&(d=0,l.replaceState({...l.state,idx:d},""));function m(){return(l.state||{idx:null}).idx}function g(){u="POP";let C=m(),k=C==null?null:C-d;d=C,h&&h({action:u,location:S.location,delta:k})}function _(C,k){u="PUSH";let R=fC(C)?C:S_(S.location,C,k);d=m()+1;let T=pC(R,d),N=S.createHref(R.unstable_mask||R);try{l.pushState(T,"",N)}catch(L){if(L instanceof DOMException&&L.name==="DataCloneError")throw L;s.location.assign(N)}a&&h&&h({action:u,location:S.location,delta:1})}function b(C,k){u="REPLACE";let R=fC(C)?C:S_(S.location,C,k);d=m();let T=pC(R,d),N=S.createHref(R.unstable_mask||R);l.replaceState(T,"",N),a&&h&&h({action:u,location:S.location,delta:0})}function w(C){return VO(C)}let S={get action(){return u},get location(){return e(s,l)},listen(C){if(h)throw new Error("A history only accepts one active listener");return s.addEventListener(hC,g),h=C,()=>{s.removeEventListener(hC,g),h=null}},createHref(C){return t(s,C)},createURL:w,encodeLocation(C){let k=w(C);return{pathname:k.pathname,search:k.search,hash:k.hash}},push:_,replace:b,go(C){return l.go(C)}};return S}function VO(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Ut(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:Mu(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function fR(e,t,n="/"){return qO(e,t,n,!1)}function qO(e,t,n,r){let s=typeof t=="string"?jl(t):t,a=hs(s.pathname||"/",n);if(a==null)return null;let l=pR(e);KO(l);let u=null;for(let h=0;u==null&&h<l.length;++h){let d=ij(a);u=nj(l[h],d,r)}return u}function pR(e,t=[],n=[],r="",s=!1){let a=(l,u,h=s,d)=>{let m={relativePath:d===void 0?l.path||"":d,caseSensitive:l.caseSensitive===!0,childrenIndex:u,route:l};if(m.relativePath.startsWith("/")){if(!m.relativePath.startsWith(r)&&h)return;Ut(m.relativePath.startsWith(r),`Absolute route path "${m.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),m.relativePath=m.relativePath.slice(r.length)}let g=Ai([r,m.relativePath]),_=n.concat(m);l.children&&l.children.length>0&&(Ut(l.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${g}".`),pR(l.children,t,_,g,h)),!(l.path==null&&!l.index)&&t.push({path:g,score:ej(g,l.index),routesMeta:_})};return e.forEach((l,u)=>{var h;if(l.path===""||!((h=l.path)!=null&&h.includes("?")))a(l,u);else for(let d of mR(l.path))a(l,u,!0,d)}),t}function mR(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,s=n.endsWith("?"),a=n.replace(/\?$/,"");if(r.length===0)return s?[a,""]:[a];let l=mR(r.join("/")),u=[];return u.push(...l.map(h=>h===""?a:[a,h].join("/"))),s&&u.push(...l),u.map(h=>e.startsWith("/")&&h===""?"/":h)}function KO(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:tj(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var GO=/^:[\w-]+$/,YO=3,XO=2,ZO=1,QO=10,JO=-2,mC=e=>e==="*";function ej(e,t){let n=e.split("/"),r=n.length;return n.some(mC)&&(r+=JO),t&&(r+=XO),n.filter(s=>!mC(s)).reduce((s,a)=>s+(GO.test(a)?YO:a===""?ZO:QO),r)}function tj(e,t){return e.length===t.length&&e.slice(0,-1).every((r,s)=>r===t[s])?e[e.length-1]-t[t.length-1]:0}function nj(e,t,n=!1){let{routesMeta:r}=e,s={},a="/",l=[];for(let u=0;u<r.length;++u){let h=r[u],d=u===r.length-1,m=a==="/"?t:t.slice(a.length)||"/",g=Nf({path:h.relativePath,caseSensitive:h.caseSensitive,end:d},m),_=h.route;if(!g&&d&&n&&!r[r.length-1].route.index&&(g=Nf({path:h.relativePath,caseSensitive:h.caseSensitive,end:!1},m)),!g)return null;Object.assign(s,g.params),l.push({params:s,pathname:Ai([a,g.pathname]),pathnameBase:lj(Ai([a,g.pathnameBase])),route:_}),g.pathnameBase!=="/"&&(a=Ai([a,g.pathnameBase]))}return l}function Nf(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=rj(e.path,e.caseSensitive,e.end),s=t.match(n);if(!s)return null;let a=s[0],l=a.replace(/(.)\/+$/,"$1"),u=s.slice(1);return{params:r.reduce((d,{paramName:m,isOptional:g},_)=>{if(m==="*"){let w=u[_]||"";l=a.slice(0,a.length-w.length).replace(/(.)\/+$/,"$1")}const b=u[_];return g&&!b?d[m]=void 0:d[m]=(b||"").replace(/%2F/g,"/"),d},{}),pathname:a,pathnameBase:l,pattern:e}}function rj(e,t=!1,n=!0){ui(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,u,h,d,m)=>{if(r.push({paramName:u,isOptional:h!=null}),h){let g=m.charAt(d+l.length);return g&&g!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),r]}function ij(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return ui(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function hs(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}var sj=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function oj(e,t="/"){let{pathname:n,search:r="",hash:s=""}=typeof e=="string"?jl(e):e,a;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?a=gC(n.substring(1),"/"):a=gC(n,t)):a=t,{pathname:a,search:cj(r),hash:uj(s)}}function gC(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function fv(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function aj(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function lb(e){let t=aj(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function hp(e,t,n,r=!1){let s;typeof e=="string"?s=jl(e):(s={...e},Ut(!s.pathname||!s.pathname.includes("?"),fv("?","pathname","search",s)),Ut(!s.pathname||!s.pathname.includes("#"),fv("#","pathname","hash",s)),Ut(!s.search||!s.search.includes("#"),fv("#","search","hash",s)));let a=e===""||s.pathname==="",l=a?"/":s.pathname,u;if(l==null)u=n;else{let g=t.length-1;if(!r&&l.startsWith("..")){let _=l.split("/");for(;_[0]==="..";)_.shift(),g-=1;s.pathname=_.join("/")}u=g>=0?t[g]:"/"}let h=oj(s,u),d=l&&l!=="/"&&l.endsWith("/"),m=(a||l===".")&&n.endsWith("/");return!h.pathname.endsWith("/")&&(d||m)&&(h.pathname+="/"),h}var Ai=e=>e.join("/").replace(/\/\/+/g,"/"),lj=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),cj=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,uj=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,dj=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function hj(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function fj(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var gR=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function vR(e,t){let n=e;if(typeof n!="string"||!sj.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,s=!1;if(gR)try{let a=new URL(window.location.href),l=n.startsWith("//")?new URL(a.protocol+n):new URL(n),u=hs(l.pathname,t);l.origin===a.origin&&u!=null?n=u+l.search+l.hash:s=!0}catch{ui(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:s,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var _R=["POST","PUT","PATCH","DELETE"];new Set(_R);var pj=["GET",..._R];new Set(pj);var Ll=y.createContext(null);Ll.displayName="DataRouter";var fp=y.createContext(null);fp.displayName="DataRouterState";var mj=y.createContext(!1),yR=y.createContext({isTransitioning:!1});yR.displayName="ViewTransition";var gj=y.createContext(new Map);gj.displayName="Fetchers";var vj=y.createContext(null);vj.displayName="Await";var Ar=y.createContext(null);Ar.displayName="Navigation";var Ku=y.createContext(null);Ku.displayName="Location";var Jr=y.createContext({outlet:null,matches:[],isDataRoute:!1});Jr.displayName="Route";var cb=y.createContext(null);cb.displayName="RouteError";var bR="REACT_ROUTER_ERROR",_j="REDIRECT",yj="ROUTE_ERROR_RESPONSE";function bj(e){if(e.startsWith(`${bR}:${_j}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function xj(e){if(e.startsWith(`${bR}:${yj}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new dj(t.status,t.statusText,t.data)}catch{}}function wj(e,{relative:t}={}){Ut(zl(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=y.useContext(Ar),{hash:s,pathname:a,search:l}=Gu(e,{relative:t}),u=a;return n!=="/"&&(u=a==="/"?n:Ai([n,a])),r.createHref({pathname:u,search:l,hash:s})}function zl(){return y.useContext(Ku)!=null}function mi(){return Ut(zl(),"useLocation() may be used only in the context of a <Router> component."),y.useContext(Ku).location}var xR="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function wR(e){y.useContext(Ar).static||y.useLayoutEffect(e)}function Pl(){let{isDataRoute:e}=y.useContext(Jr);return e?zj():Sj()}function Sj(){Ut(zl(),"useNavigate() may be used only in the context of a <Router> component.");let e=y.useContext(Ll),{basename:t,navigator:n}=y.useContext(Ar),{matches:r}=y.useContext(Jr),{pathname:s}=mi(),a=JSON.stringify(lb(r)),l=y.useRef(!1);return wR(()=>{l.current=!0}),y.useCallback((h,d={})=>{if(ui(l.current,xR),!l.current)return;if(typeof h=="number"){n.go(h);return}let m=hp(h,JSON.parse(a),s,d.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:Ai([t,m.pathname])),(d.replace?n.replace:n.push)(m,d.state,d)},[t,n,a,s,e])}var SR=y.createContext(null);function ub(){return y.useContext(SR)}function Cj(e){let t=y.useContext(Jr).outlet;return y.useMemo(()=>t&&y.createElement(SR.Provider,{value:e},t),[t,e])}function CR(){let{matches:e}=y.useContext(Jr),t=e[e.length-1];return t?t.params:{}}function Gu(e,{relative:t}={}){let{matches:n}=y.useContext(Jr),{pathname:r}=mi(),s=JSON.stringify(lb(n));return y.useMemo(()=>hp(e,JSON.parse(s),r,t==="path"),[e,s,r,t])}function kj(e,t){return kR(e,t)}function kR(e,t,n){var C;Ut(zl(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:r}=y.useContext(Ar),{matches:s}=y.useContext(Jr),a=s[s.length-1],l=a?a.params:{},u=a?a.pathname:"/",h=a?a.pathnameBase:"/",d=a&&a.route;{let k=d&&d.path||"";RR(u,!d||k.endsWith("*")||k.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${u}" (under <Route path="${k}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
59
|
-
|
|
60
|
-
Please change the parent <Route path="${k}"> to <Route path="${k==="/"?"*":`${k}/*`}">.`)}let m=mi(),g;if(t){let k=typeof t=="string"?jl(t):t;Ut(h==="/"||((C=k.pathname)==null?void 0:C.startsWith(h)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${h}" but pathname "${k.pathname}" was given in the \`location\` prop.`),g=k}else g=m;let _=g.pathname||"/",b=_;if(h!=="/"){let k=h.replace(/^\//,"").split("/");b="/"+_.replace(/^\//,"").split("/").slice(k.length).join("/")}let w=fR(e,{pathname:b});ui(d||w!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),ui(w==null||w[w.length-1].route.element!==void 0||w[w.length-1].route.Component!==void 0||w[w.length-1].route.lazy!==void 0,`Matched leaf route at location "${g.pathname}${g.search}${g.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let S=Nj(w&&w.map(k=>Object.assign({},k,{params:Object.assign({},l,k.params),pathname:Ai([h,r.encodeLocation?r.encodeLocation(k.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathname]),pathnameBase:k.pathnameBase==="/"?h:Ai([h,r.encodeLocation?r.encodeLocation(k.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathnameBase])})),s,n);return t&&S?y.createElement(Ku.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...g},navigationType:"POP"}},S):S}function Ej(){let e=Lj(),t=hj(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",s={padding:"0.5rem",backgroundColor:r},a={padding:"2px 4px",backgroundColor:r},l=null;return console.error("Error handled by React Router default ErrorBoundary:",e),l=y.createElement(y.Fragment,null,y.createElement("p",null,"💿 Hey developer 👋"),y.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",y.createElement("code",{style:a},"ErrorBoundary")," or"," ",y.createElement("code",{style:a},"errorElement")," prop on your route.")),y.createElement(y.Fragment,null,y.createElement("h2",null,"Unexpected Application Error!"),y.createElement("h3",{style:{fontStyle:"italic"}},t),n?y.createElement("pre",{style:s},n):null,l)}var Rj=y.createElement(Ej,null),ER=class extends y.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=xj(e.digest);n&&(e=n)}let t=e!==void 0?y.createElement(Jr.Provider,{value:this.props.routeContext},y.createElement(cb.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?y.createElement(Tj,{error:e},t):t}};ER.contextType=mj;var pv=new WeakMap;function Tj({children:e,error:t}){let{basename:n}=y.useContext(Ar);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=bj(t.digest);if(r){let s=pv.get(t);if(s)throw s;let a=vR(r.location,n);if(gR&&!pv.get(t))if(a.isExternal||r.reloadDocument)window.location.href=a.absoluteURL||a.to;else{const l=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:r.replace}));throw pv.set(t,l),l}return y.createElement("meta",{httpEquiv:"refresh",content:`0;url=${a.absoluteURL||a.to}`})}}return e}function Mj({routeContext:e,match:t,children:n}){let r=y.useContext(Ll);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),y.createElement(Jr.Provider,{value:e},n)}function Nj(e,t=[],n){let r=n==null?void 0:n.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let s=e,a=r==null?void 0:r.errors;if(a!=null){let m=s.findIndex(g=>g.route.id&&(a==null?void 0:a[g.route.id])!==void 0);Ut(m>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(",")}`),s=s.slice(0,Math.min(s.length,m+1))}let l=!1,u=-1;if(n&&r){l=r.renderFallback;for(let m=0;m<s.length;m++){let g=s[m];if((g.route.HydrateFallback||g.route.hydrateFallbackElement)&&(u=m),g.route.id){let{loaderData:_,errors:b}=r,w=g.route.loader&&!_.hasOwnProperty(g.route.id)&&(!b||b[g.route.id]===void 0);if(g.route.lazy||w){n.isStatic&&(l=!0),u>=0?s=s.slice(0,u+1):s=[s[0]];break}}}}let h=n==null?void 0:n.onError,d=r&&h?(m,g)=>{var _,b;h(m,{location:r.location,params:((b=(_=r.matches)==null?void 0:_[0])==null?void 0:b.params)??{},unstable_pattern:fj(r.matches),errorInfo:g})}:void 0;return s.reduceRight((m,g,_)=>{let b,w=!1,S=null,C=null;r&&(b=a&&g.route.id?a[g.route.id]:void 0,S=g.route.errorElement||Rj,l&&(u<0&&_===0?(RR("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),w=!0,C=null):u===_&&(w=!0,C=g.route.hydrateFallbackElement||null)));let k=t.concat(s.slice(0,_+1)),R=()=>{let T;return b?T=S:w?T=C:g.route.Component?T=y.createElement(g.route.Component,null):g.route.element?T=g.route.element:T=m,y.createElement(Mj,{match:g,routeContext:{outlet:m,matches:k,isDataRoute:r!=null},children:T})};return r&&(g.route.ErrorBoundary||g.route.errorElement||_===0)?y.createElement(ER,{location:r.location,revalidation:r.revalidation,component:S,error:b,children:R(),routeContext:{outlet:null,matches:k,isDataRoute:!0},onError:d}):R()},null)}function db(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Aj(e){let t=y.useContext(Ll);return Ut(t,db(e)),t}function Dj(e){let t=y.useContext(fp);return Ut(t,db(e)),t}function Oj(e){let t=y.useContext(Jr);return Ut(t,db(e)),t}function hb(e){let t=Oj(e),n=t.matches[t.matches.length-1];return Ut(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function jj(){return hb("useRouteId")}function Lj(){var r;let e=y.useContext(cb),t=Dj("useRouteError"),n=hb("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function zj(){let{router:e}=Aj("useNavigate"),t=hb("useNavigate"),n=y.useRef(!1);return wR(()=>{n.current=!0}),y.useCallback(async(s,a={})=>{ui(n.current,xR),n.current&&(typeof s=="number"?await e.navigate(s):await e.navigate(s,{fromRouteId:t,...a}))},[e,t])}var vC={};function RR(e,t,n){!t&&!vC[e]&&(vC[e]=!0,ui(!1,n))}y.memo(Pj);function Pj({routes:e,future:t,state:n,isStatic:r,onError:s}){return kR(e,void 0,{state:n,isStatic:r,onError:s})}function Bj({to:e,replace:t,state:n,relative:r}){Ut(zl(),"<Navigate> may be used only in the context of a <Router> component.");let{static:s}=y.useContext(Ar);ui(!s,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:a}=y.useContext(Jr),{pathname:l}=mi(),u=Pl(),h=hp(e,lb(a),l,r==="path"),d=JSON.stringify(h);return y.useEffect(()=>{u(JSON.parse(d),{replace:t,state:n,relative:r})},[u,d,r,t,n]),null}function Ij(e){return Cj(e.context)}function hl(e){Ut(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function Hj({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:s,static:a=!1,unstable_useTransitions:l}){Ut(!zl(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let u=e.replace(/^\/*/,"/"),h=y.useMemo(()=>({basename:u,navigator:s,static:a,unstable_useTransitions:l,future:{}}),[u,s,a,l]);typeof n=="string"&&(n=jl(n));let{pathname:d="/",search:m="",hash:g="",state:_=null,key:b="default",unstable_mask:w}=n,S=y.useMemo(()=>{let C=hs(d,u);return C==null?null:{location:{pathname:C,search:m,hash:g,state:_,key:b,unstable_mask:w},navigationType:r}},[u,d,m,g,_,b,r,w]);return ui(S!=null,`<Router basename="${u}"> is not able to match the URL "${d}${m}${g}" because it does not start with the basename, so the <Router> won't render anything.`),S==null?null:y.createElement(Ar.Provider,{value:h},y.createElement(Ku.Provider,{children:t,value:S}))}function Fj({children:e,location:t}){return kj(C_(e),t)}function C_(e,t=[]){let n=[];return y.Children.forEach(e,(r,s)=>{if(!y.isValidElement(r))return;let a=[...t,s];if(r.type===y.Fragment){n.push.apply(n,C_(r.props.children,a));return}Ut(r.type===hl,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Ut(!r.props.index||!r.props.children,"An index route cannot have child routes.");let l={id:r.props.id||a.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(l.children=C_(r.props.children,a)),n.push(l)}),n}var uf="get",df="application/x-www-form-urlencoded";function pp(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function Uj(e){return pp(e)&&e.tagName.toLowerCase()==="button"}function $j(e){return pp(e)&&e.tagName.toLowerCase()==="form"}function Wj(e){return pp(e)&&e.tagName.toLowerCase()==="input"}function Vj(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function qj(e,t){return e.button===0&&(!t||t==="_self")&&!Vj(e)}var Th=null;function Kj(){if(Th===null)try{new FormData(document.createElement("form"),0),Th=!1}catch{Th=!0}return Th}var Gj=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function mv(e){return e!=null&&!Gj.has(e)?(ui(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${df}"`),null):e}function Yj(e,t){let n,r,s,a,l;if($j(e)){let u=e.getAttribute("action");r=u?hs(u,t):null,n=e.getAttribute("method")||uf,s=mv(e.getAttribute("enctype"))||df,a=new FormData(e)}else if(Uj(e)||Wj(e)&&(e.type==="submit"||e.type==="image")){let u=e.form;if(u==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let h=e.getAttribute("formaction")||u.getAttribute("action");if(r=h?hs(h,t):null,n=e.getAttribute("formmethod")||u.getAttribute("method")||uf,s=mv(e.getAttribute("formenctype"))||mv(u.getAttribute("enctype"))||df,a=new FormData(u,e),!Kj()){let{name:d,type:m,value:g}=e;if(m==="image"){let _=d?`${d}.`:"";a.append(`${_}x`,"0"),a.append(`${_}y`,"0")}else d&&a.append(d,g)}}else{if(pp(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=uf,r=null,s=df,l=e}return a&&s==="text/plain"&&(l=a,a=void 0),{action:r,method:n.toLowerCase(),encType:s,formData:a,body:l}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function fb(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Xj(e,t,n,r){let s=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?s.pathname.endsWith("/")?s.pathname=`${s.pathname}_.${r}`:s.pathname=`${s.pathname}.${r}`:s.pathname==="/"?s.pathname=`_root.${r}`:t&&hs(s.pathname,t)==="/"?s.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:s.pathname=`${s.pathname.replace(/\/$/,"")}.${r}`,s}async function Zj(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Qj(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function Jj(e,t,n){let r=await Promise.all(e.map(async s=>{let a=t.routes[s.route.id];if(a){let l=await Zj(a,n);return l.links?l.links():[]}return[]}));return rL(r.flat(1).filter(Qj).filter(s=>s.rel==="stylesheet"||s.rel==="preload").map(s=>s.rel==="stylesheet"?{...s,rel:"prefetch",as:"style"}:{...s,rel:"prefetch"}))}function _C(e,t,n,r,s,a){let l=(h,d)=>n[d]?h.route.id!==n[d].route.id:!0,u=(h,d)=>{var m;return n[d].pathname!==h.pathname||((m=n[d].route.path)==null?void 0:m.endsWith("*"))&&n[d].params["*"]!==h.params["*"]};return a==="assets"?t.filter((h,d)=>l(h,d)||u(h,d)):a==="data"?t.filter((h,d)=>{var g;let m=r.routes[h.route.id];if(!m||!m.hasLoader)return!1;if(l(h,d)||u(h,d))return!0;if(h.route.shouldRevalidate){let _=h.route.shouldRevalidate({currentUrl:new URL(s.pathname+s.search+s.hash,window.origin),currentParams:((g=n[0])==null?void 0:g.params)||{},nextUrl:new URL(e,window.origin),nextParams:h.params,defaultShouldRevalidate:!0});if(typeof _=="boolean")return _}return!0}):[]}function eL(e,t,{includeHydrateFallback:n}={}){return tL(e.map(r=>{let s=t.routes[r.route.id];if(!s)return[];let a=[s.module];return s.clientActionModule&&(a=a.concat(s.clientActionModule)),s.clientLoaderModule&&(a=a.concat(s.clientLoaderModule)),n&&s.hydrateFallbackModule&&(a=a.concat(s.hydrateFallbackModule)),s.imports&&(a=a.concat(s.imports)),a}).flat(1))}function tL(e){return[...new Set(e)]}function nL(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function rL(e,t){let n=new Set;return new Set(t),e.reduce((r,s)=>{let a=JSON.stringify(nL(s));return n.has(a)||(n.add(a),r.push({key:a,link:s})),r},[])}function TR(){let e=y.useContext(Ll);return fb(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function iL(){let e=y.useContext(fp);return fb(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var pb=y.createContext(void 0);pb.displayName="FrameworkContext";function MR(){let e=y.useContext(pb);return fb(e,"You must render this element inside a <HydratedRouter> element"),e}function sL(e,t){let n=y.useContext(pb),[r,s]=y.useState(!1),[a,l]=y.useState(!1),{onFocus:u,onBlur:h,onMouseEnter:d,onMouseLeave:m,onTouchStart:g}=t,_=y.useRef(null);y.useEffect(()=>{if(e==="render"&&l(!0),e==="viewport"){let S=k=>{k.forEach(R=>{l(R.isIntersecting)})},C=new IntersectionObserver(S,{threshold:.5});return _.current&&C.observe(_.current),()=>{C.disconnect()}}},[e]),y.useEffect(()=>{if(r){let S=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(S)}}},[r]);let b=()=>{s(!0)},w=()=>{s(!1),l(!1)};return n?e!=="intent"?[a,_,{}]:[a,_,{onFocus:Wc(u,b),onBlur:Wc(h,w),onMouseEnter:Wc(d,b),onMouseLeave:Wc(m,w),onTouchStart:Wc(g,b)}]:[!1,_,{}]}function Wc(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function oL({page:e,...t}){let{router:n}=TR(),r=y.useMemo(()=>fR(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?y.createElement(lL,{page:e,matches:r,...t}):null}function aL(e){let{manifest:t,routeModules:n}=MR(),[r,s]=y.useState([]);return y.useEffect(()=>{let a=!1;return Jj(e,t,n).then(l=>{a||s(l)}),()=>{a=!0}},[e,t,n]),r}function lL({page:e,matches:t,...n}){let r=mi(),{future:s,manifest:a,routeModules:l}=MR(),{basename:u}=TR(),{loaderData:h,matches:d}=iL(),m=y.useMemo(()=>_C(e,t,d,a,r,"data"),[e,t,d,a,r]),g=y.useMemo(()=>_C(e,t,d,a,r,"assets"),[e,t,d,a,r]),_=y.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let S=new Set,C=!1;if(t.forEach(R=>{var N;let T=a.routes[R.route.id];!T||!T.hasLoader||(!m.some(L=>L.route.id===R.route.id)&&R.route.id in h&&((N=l[R.route.id])!=null&&N.shouldRevalidate)||T.hasClientLoader?C=!0:S.add(R.route.id))}),S.size===0)return[];let k=Xj(e,u,s.unstable_trailingSlashAwareDataRequests,"data");return C&&S.size>0&&k.searchParams.set("_routes",t.filter(R=>S.has(R.route.id)).map(R=>R.route.id).join(",")),[k.pathname+k.search]},[u,s.unstable_trailingSlashAwareDataRequests,h,r,a,m,t,e,l]),b=y.useMemo(()=>eL(g,a),[g,a]),w=aL(g);return y.createElement(y.Fragment,null,_.map(S=>y.createElement("link",{key:S,rel:"prefetch",as:"fetch",href:S,...n})),b.map(S=>y.createElement("link",{key:S,rel:"modulepreload",href:S,...n})),w.map(({key:S,link:C})=>y.createElement("link",{key:S,nonce:n.nonce,...C,crossOrigin:C.crossOrigin??n.crossOrigin})))}function cL(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var uL=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{uL&&(window.__reactRouterVersion="7.13.1")}catch{}function dL({basename:e,children:t,unstable_useTransitions:n,window:r}){let s=y.useRef();s.current==null&&(s.current=UO({window:r,v5Compat:!0}));let a=s.current,[l,u]=y.useState({action:a.action,location:a.location}),h=y.useCallback(d=>{n===!1?u(d):y.startTransition(()=>u(d))},[n]);return y.useLayoutEffect(()=>a.listen(h),[a,h]),y.createElement(Hj,{basename:e,children:t,location:l.location,navigationType:l.action,navigator:a,unstable_useTransitions:n})}var NR=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,AR=y.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:s,reloadDocument:a,replace:l,unstable_mask:u,state:h,target:d,to:m,preventScrollReset:g,viewTransition:_,unstable_defaultShouldRevalidate:b,...w},S){let{basename:C,navigator:k,unstable_useTransitions:R}=y.useContext(Ar),T=typeof m=="string"&&NR.test(m),N=vR(m,C);m=N.to;let L=wj(m,{relative:s}),A=mi(),O=null;if(u){let W=hp(u,[],A.unstable_mask?A.unstable_mask.pathname:"/",!0);C!=="/"&&(W.pathname=W.pathname==="/"?C:Ai([C,W.pathname])),O=k.createHref(W)}let[F,G,B]=sL(r,w),H=mL(m,{replace:l,unstable_mask:u,state:h,target:d,preventScrollReset:g,relative:s,viewTransition:_,unstable_defaultShouldRevalidate:b,unstable_useTransitions:R});function P(W){t&&t(W),W.defaultPrevented||H(W)}let U=!(N.isExternal||a),V=y.createElement("a",{...w,...B,href:(U?O:void 0)||N.absoluteURL||L,onClick:U?P:t,ref:cL(S,G),target:d,"data-discover":!T&&n==="render"?"true":void 0});return F&&!T?y.createElement(y.Fragment,null,V,y.createElement(oL,{page:L})):V});AR.displayName="Link";var hL=y.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:s=!1,style:a,to:l,viewTransition:u,children:h,...d},m){let g=Gu(l,{relative:d.relative}),_=mi(),b=y.useContext(fp),{navigator:w,basename:S}=y.useContext(Ar),C=b!=null&&bL(g)&&u===!0,k=w.encodeLocation?w.encodeLocation(g).pathname:g.pathname,R=_.pathname,T=b&&b.navigation&&b.navigation.location?b.navigation.location.pathname:null;n||(R=R.toLowerCase(),T=T?T.toLowerCase():null,k=k.toLowerCase()),T&&S&&(T=hs(T,S)||T);const N=k!=="/"&&k.endsWith("/")?k.length-1:k.length;let L=R===k||!s&&R.startsWith(k)&&R.charAt(N)==="/",A=T!=null&&(T===k||!s&&T.startsWith(k)&&T.charAt(k.length)==="/"),O={isActive:L,isPending:A,isTransitioning:C},F=L?t:void 0,G;typeof r=="function"?G=r(O):G=[r,L?"active":null,A?"pending":null,C?"transitioning":null].filter(Boolean).join(" ");let B=typeof a=="function"?a(O):a;return y.createElement(AR,{...d,"aria-current":F,className:G,ref:m,style:B,to:l,viewTransition:u},typeof h=="function"?h(O):h)});hL.displayName="NavLink";var fL=y.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:s,state:a,method:l=uf,action:u,onSubmit:h,relative:d,preventScrollReset:m,viewTransition:g,unstable_defaultShouldRevalidate:_,...b},w)=>{let{unstable_useTransitions:S}=y.useContext(Ar),C=_L(),k=yL(u,{relative:d}),R=l.toLowerCase()==="get"?"get":"post",T=typeof u=="string"&&NR.test(u),N=L=>{if(h&&h(L),L.defaultPrevented)return;L.preventDefault();let A=L.nativeEvent.submitter,O=(A==null?void 0:A.getAttribute("formmethod"))||l,F=()=>C(A||L.currentTarget,{fetcherKey:t,method:O,navigate:n,replace:s,state:a,relative:d,preventScrollReset:m,viewTransition:g,unstable_defaultShouldRevalidate:_});S&&n!==!1?y.startTransition(()=>F()):F()};return y.createElement("form",{ref:w,method:R,action:k,onSubmit:r?h:N,...b,"data-discover":!T&&e==="render"?"true":void 0})});fL.displayName="Form";function pL(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function DR(e){let t=y.useContext(Ll);return Ut(t,pL(e)),t}function mL(e,{target:t,replace:n,unstable_mask:r,state:s,preventScrollReset:a,relative:l,viewTransition:u,unstable_defaultShouldRevalidate:h,unstable_useTransitions:d}={}){let m=Pl(),g=mi(),_=Gu(e,{relative:l});return y.useCallback(b=>{if(qj(b,t)){b.preventDefault();let w=n!==void 0?n:Mu(g)===Mu(_),S=()=>m(e,{replace:w,unstable_mask:r,state:s,preventScrollReset:a,relative:l,viewTransition:u,unstable_defaultShouldRevalidate:h});d?y.startTransition(()=>S()):S()}},[g,m,_,n,r,s,t,e,a,l,u,h,d])}var gL=0,vL=()=>`__${String(++gL)}__`;function _L(){let{router:e}=DR("useSubmit"),{basename:t}=y.useContext(Ar),n=jj(),r=e.fetch,s=e.navigate;return y.useCallback(async(a,l={})=>{let{action:u,method:h,encType:d,formData:m,body:g}=Yj(a,t);if(l.navigate===!1){let _=l.fetcherKey||vL();await r(_,n,l.action||u,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:m,body:g,formMethod:l.method||h,formEncType:l.encType||d,flushSync:l.flushSync})}else await s(l.action||u,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:m,body:g,formMethod:l.method||h,formEncType:l.encType||d,replace:l.replace,state:l.state,fromRouteId:n,flushSync:l.flushSync,viewTransition:l.viewTransition})},[r,s,t,n])}function yL(e,{relative:t}={}){let{basename:n}=y.useContext(Ar),r=y.useContext(Jr);Ut(r,"useFormAction must be used inside a RouteContext");let[s]=r.matches.slice(-1),a={...Gu(e||".",{relative:t})},l=mi();if(e==null){a.search=l.search;let u=new URLSearchParams(a.search),h=u.getAll("index");if(h.some(m=>m==="")){u.delete("index"),h.filter(g=>g).forEach(g=>u.append("index",g));let m=u.toString();a.search=m?`?${m}`:""}}return(!e||e===".")&&s.route.index&&(a.search=a.search?a.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(a.pathname=a.pathname==="/"?n:Ai([n,a.pathname])),Mu(a)}function bL(e,{relative:t}={}){let n=y.useContext(yR);Ut(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=DR("useViewTransitionState"),s=Gu(e,{relative:t});if(!n.isTransitioning)return!1;let a=hs(n.currentLocation.pathname,r)||n.currentLocation.pathname,l=hs(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Nf(s.pathname,l)!=null||Nf(s.pathname,a)!=null}var Ri=hR();const xL=dp(Ri);function OR(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=OR(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function jR(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=OR(e))&&(r&&(r+=" "),r+=t);return r}const yC=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,bC=jR,wL=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return bC(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:a}=t,l=Object.keys(s).map(d=>{const m=n==null?void 0:n[d],g=a==null?void 0:a[d];if(m===null)return null;const _=yC(m)||yC(g);return s[d][_]}),u=n&&Object.entries(n).reduce((d,m)=>{let[g,_]=m;return _===void 0||(d[g]=_),d},{}),h=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((d,m)=>{let{class:g,className:_,...b}=m;return Object.entries(b).every(w=>{let[S,C]=w;return Array.isArray(C)?C.includes({...a,...u}[S]):{...a,...u}[S]===C})?[...d,g,_]:d},[]);return bC(e,l,h,n==null?void 0:n.class,n==null?void 0:n.className)},SL=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},CL=(e,t)=>({classGroupId:e,validator:t}),LR=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Af="-",xC=[],kL="arbitrary..",EL=e=>{const t=TL(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return RL(l);const u=l.split(Af),h=u[0]===""&&u.length>1?1:0;return zR(u,h,t)},getConflictingClassGroupIds:(l,u)=>{if(u){const h=r[l],d=n[l];return h?d?SL(d,h):h:d||xC}return n[l]||xC}}},zR=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const s=e[t],a=n.nextPart.get(s);if(a){const d=zR(e,t+1,a);if(d)return d}const l=n.validators;if(l===null)return;const u=t===0?e.join(Af):e.slice(t).join(Af),h=l.length;for(let d=0;d<h;d++){const m=l[d];if(m.validator(u))return m.classGroupId}},RL=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?kL+r:void 0})(),TL=e=>{const{theme:t,classGroups:n}=e;return ML(n,t)},ML=(e,t)=>{const n=LR();for(const r in e){const s=e[r];mb(s,n,r,t)}return n},mb=(e,t,n,r)=>{const s=e.length;for(let a=0;a<s;a++){const l=e[a];NL(l,t,n,r)}},NL=(e,t,n,r)=>{if(typeof e=="string"){AL(e,t,n);return}if(typeof e=="function"){DL(e,t,n,r);return}OL(e,t,n,r)},AL=(e,t,n)=>{const r=e===""?t:PR(t,e);r.classGroupId=n},DL=(e,t,n,r)=>{if(jL(e)){mb(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(CL(n,e))},OL=(e,t,n,r)=>{const s=Object.entries(e),a=s.length;for(let l=0;l<a;l++){const[u,h]=s[l];mb(h,PR(t,u),n,r)}},PR=(e,t)=>{let n=e;const r=t.split(Af),s=r.length;for(let a=0;a<s;a++){const l=r[a];let u=n.nextPart.get(l);u||(u=LR(),n.nextPart.set(l,u)),n=u}return n},jL=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,LL=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const s=(a,l)=>{n[a]=l,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(a){let l=n[a];if(l!==void 0)return l;if((l=r[a])!==void 0)return s(a,l),l},set(a,l){a in n?n[a]=l:s(a,l)}}},k_="!",wC=":",zL=[],SC=(e,t,n,r,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:s}),PL=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=s=>{const a=[];let l=0,u=0,h=0,d;const m=s.length;for(let S=0;S<m;S++){const C=s[S];if(l===0&&u===0){if(C===wC){a.push(s.slice(h,S)),h=S+1;continue}if(C==="/"){d=S;continue}}C==="["?l++:C==="]"?l--:C==="("?u++:C===")"&&u--}const g=a.length===0?s:s.slice(h);let _=g,b=!1;g.endsWith(k_)?(_=g.slice(0,-1),b=!0):g.startsWith(k_)&&(_=g.slice(1),b=!0);const w=d&&d>h?d-h:void 0;return SC(a,b,_,w)};if(t){const s=t+wC,a=r;r=l=>l.startsWith(s)?a(l.slice(s.length)):SC(zL,!1,l,void 0,!0)}if(n){const s=r;r=a=>n({className:a,parseClassName:s})}return r},BL=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let s=[];for(let a=0;a<n.length;a++){const l=n[a],u=l[0]==="[",h=t.has(l);u||h?(s.length>0&&(s.sort(),r.push(...s),s=[]),r.push(l)):s.push(l)}return s.length>0&&(s.sort(),r.push(...s)),r}},IL=e=>({cache:LL(e.cacheSize),parseClassName:PL(e),sortModifiers:BL(e),...EL(e)}),HL=/\s+/,FL=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:a}=t,l=[],u=e.trim().split(HL);let h="";for(let d=u.length-1;d>=0;d-=1){const m=u[d],{isExternal:g,modifiers:_,hasImportantModifier:b,baseClassName:w,maybePostfixModifierPosition:S}=n(m);if(g){h=m+(h.length>0?" "+h:h);continue}let C=!!S,k=r(C?w.substring(0,S):w);if(!k){if(!C){h=m+(h.length>0?" "+h:h);continue}if(k=r(w),!k){h=m+(h.length>0?" "+h:h);continue}C=!1}const R=_.length===0?"":_.length===1?_[0]:a(_).join(":"),T=b?R+k_:R,N=T+k;if(l.indexOf(N)>-1)continue;l.push(N);const L=s(k,C);for(let A=0;A<L.length;++A){const O=L[A];l.push(T+O)}h=m+(h.length>0?" "+h:h)}return h},UL=(...e)=>{let t=0,n,r,s="";for(;t<e.length;)(n=e[t++])&&(r=BR(n))&&(s&&(s+=" "),s+=r);return s},BR=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=BR(e[r]))&&(n&&(n+=" "),n+=t);return n},$L=(e,...t)=>{let n,r,s,a;const l=h=>{const d=t.reduce((m,g)=>g(m),e());return n=IL(d),r=n.cache.get,s=n.cache.set,a=u,u(h)},u=h=>{const d=r(h);if(d)return d;const m=FL(h,n);return s(h,m),m};return a=l,(...h)=>a(UL(...h))},WL=[],pn=e=>{const t=n=>n[e]||WL;return t.isThemeGetter=!0,t},IR=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,HR=/^\((?:(\w[\w-]*):)?(.+)\)$/i,VL=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,qL=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,KL=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,GL=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,YL=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,XL=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,qs=e=>VL.test(e),Qe=e=>!!e&&!Number.isNaN(Number(e)),Ks=e=>!!e&&Number.isInteger(Number(e)),gv=e=>e.endsWith("%")&&Qe(e.slice(0,-1)),ss=e=>qL.test(e),FR=()=>!0,ZL=e=>KL.test(e)&&!GL.test(e),gb=()=>!1,QL=e=>YL.test(e),JL=e=>XL.test(e),ez=e=>!Oe(e)&&!je(e),tz=e=>fo(e,WR,gb),Oe=e=>IR.test(e),Po=e=>fo(e,VR,ZL),CC=e=>fo(e,cz,Qe),nz=e=>fo(e,KR,FR),rz=e=>fo(e,qR,gb),kC=e=>fo(e,UR,gb),iz=e=>fo(e,$R,JL),Mh=e=>fo(e,GR,QL),je=e=>HR.test(e),Vc=e=>la(e,VR),sz=e=>la(e,qR),EC=e=>la(e,UR),oz=e=>la(e,WR),az=e=>la(e,$R),Nh=e=>la(e,GR,!0),lz=e=>la(e,KR,!0),fo=(e,t,n)=>{const r=IR.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},la=(e,t,n=!1)=>{const r=HR.exec(e);return r?r[1]?t(r[1]):n:!1},UR=e=>e==="position"||e==="percentage",$R=e=>e==="image"||e==="url",WR=e=>e==="length"||e==="size"||e==="bg-size",VR=e=>e==="length",cz=e=>e==="number",qR=e=>e==="family-name",KR=e=>e==="number"||e==="weight",GR=e=>e==="shadow",uz=()=>{const e=pn("color"),t=pn("font"),n=pn("text"),r=pn("font-weight"),s=pn("tracking"),a=pn("leading"),l=pn("breakpoint"),u=pn("container"),h=pn("spacing"),d=pn("radius"),m=pn("shadow"),g=pn("inset-shadow"),_=pn("text-shadow"),b=pn("drop-shadow"),w=pn("blur"),S=pn("perspective"),C=pn("aspect"),k=pn("ease"),R=pn("animate"),T=()=>["auto","avoid","all","avoid-page","page","left","right","column"],N=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],L=()=>[...N(),je,Oe],A=()=>["auto","hidden","clip","visible","scroll"],O=()=>["auto","contain","none"],F=()=>[je,Oe,h],G=()=>[qs,"full","auto",...F()],B=()=>[Ks,"none","subgrid",je,Oe],H=()=>["auto",{span:["full",Ks,je,Oe]},Ks,je,Oe],P=()=>[Ks,"auto",je,Oe],U=()=>["auto","min","max","fr",je,Oe],V=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],W=()=>["start","end","center","stretch","center-safe","end-safe"],z=()=>["auto",...F()],$=()=>[qs,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...F()],q=()=>[qs,"screen","full","dvw","lvw","svw","min","max","fit",...F()],Q=()=>[qs,"screen","full","lh","dvh","lvh","svh","min","max","fit",...F()],M=()=>[e,je,Oe],I=()=>[...N(),EC,kC,{position:[je,Oe]}],Z=()=>["no-repeat",{repeat:["","x","y","space","round"]}],j=()=>["auto","cover","contain",oz,tz,{size:[je,Oe]}],ce=()=>[gv,Vc,Po],fe=()=>["","none","full",d,je,Oe],ue=()=>["",Qe,Vc,Po],de=()=>["solid","dashed","dotted","double"],we=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],oe=()=>[Qe,gv,EC,kC],be=()=>["","none",w,je,Oe],Ne=()=>["none",Qe,je,Oe],Se=()=>["none",Qe,je,Oe],_e=()=>[Qe,je,Oe],xe=()=>[qs,"full",...F()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ss],breakpoint:[ss],color:[FR],container:[ss],"drop-shadow":[ss],ease:["in","out","in-out"],font:[ez],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ss],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ss],shadow:[ss],spacing:["px",Qe],text:[ss],"text-shadow":[ss],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",qs,Oe,je,C]}],container:["container"],columns:[{columns:[Qe,Oe,je,u]}],"break-after":[{"break-after":T()}],"break-before":[{"break-before":T()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:L()}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:O()}],"overscroll-x":[{"overscroll-x":O()}],"overscroll-y":[{"overscroll-y":O()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:G()}],"inset-x":[{"inset-x":G()}],"inset-y":[{"inset-y":G()}],start:[{"inset-s":G(),start:G()}],end:[{"inset-e":G(),end:G()}],"inset-bs":[{"inset-bs":G()}],"inset-be":[{"inset-be":G()}],top:[{top:G()}],right:[{right:G()}],bottom:[{bottom:G()}],left:[{left:G()}],visibility:["visible","invisible","collapse"],z:[{z:[Ks,"auto",je,Oe]}],basis:[{basis:[qs,"full","auto",u,...F()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Qe,qs,"auto","initial","none",Oe]}],grow:[{grow:["",Qe,je,Oe]}],shrink:[{shrink:["",Qe,je,Oe]}],order:[{order:[Ks,"first","last","none",je,Oe]}],"grid-cols":[{"grid-cols":B()}],"col-start-end":[{col:H()}],"col-start":[{"col-start":P()}],"col-end":[{"col-end":P()}],"grid-rows":[{"grid-rows":B()}],"row-start-end":[{row:H()}],"row-start":[{"row-start":P()}],"row-end":[{"row-end":P()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":U()}],"auto-rows":[{"auto-rows":U()}],gap:[{gap:F()}],"gap-x":[{"gap-x":F()}],"gap-y":[{"gap-y":F()}],"justify-content":[{justify:[...V(),"normal"]}],"justify-items":[{"justify-items":[...W(),"normal"]}],"justify-self":[{"justify-self":["auto",...W()]}],"align-content":[{content:["normal",...V()]}],"align-items":[{items:[...W(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...W(),{baseline:["","last"]}]}],"place-content":[{"place-content":V()}],"place-items":[{"place-items":[...W(),"baseline"]}],"place-self":[{"place-self":["auto",...W()]}],p:[{p:F()}],px:[{px:F()}],py:[{py:F()}],ps:[{ps:F()}],pe:[{pe:F()}],pbs:[{pbs:F()}],pbe:[{pbe:F()}],pt:[{pt:F()}],pr:[{pr:F()}],pb:[{pb:F()}],pl:[{pl:F()}],m:[{m:z()}],mx:[{mx:z()}],my:[{my:z()}],ms:[{ms:z()}],me:[{me:z()}],mbs:[{mbs:z()}],mbe:[{mbe:z()}],mt:[{mt:z()}],mr:[{mr:z()}],mb:[{mb:z()}],ml:[{ml:z()}],"space-x":[{"space-x":F()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":F()}],"space-y-reverse":["space-y-reverse"],size:[{size:$()}],"inline-size":[{inline:["auto",...q()]}],"min-inline-size":[{"min-inline":["auto",...q()]}],"max-inline-size":[{"max-inline":["none",...q()]}],"block-size":[{block:["auto",...Q()]}],"min-block-size":[{"min-block":["auto",...Q()]}],"max-block-size":[{"max-block":["none",...Q()]}],w:[{w:[u,"screen",...$()]}],"min-w":[{"min-w":[u,"screen","none",...$()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[l]},...$()]}],h:[{h:["screen","lh",...$()]}],"min-h":[{"min-h":["screen","lh","none",...$()]}],"max-h":[{"max-h":["screen","lh",...$()]}],"font-size":[{text:["base",n,Vc,Po]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,lz,nz]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",gv,Oe]}],"font-family":[{font:[sz,rz,t]}],"font-features":[{"font-features":[Oe]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[s,je,Oe]}],"line-clamp":[{"line-clamp":[Qe,"none",je,CC]}],leading:[{leading:[a,...F()]}],"list-image":[{"list-image":["none",je,Oe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",je,Oe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:M()}],"text-color":[{text:M()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...de(),"wavy"]}],"text-decoration-thickness":[{decoration:[Qe,"from-font","auto",je,Po]}],"text-decoration-color":[{decoration:M()}],"underline-offset":[{"underline-offset":[Qe,"auto",je,Oe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:F()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",je,Oe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",je,Oe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:I()}],"bg-repeat":[{bg:Z()}],"bg-size":[{bg:j()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ks,je,Oe],radial:["",je,Oe],conic:[Ks,je,Oe]},az,iz]}],"bg-color":[{bg:M()}],"gradient-from-pos":[{from:ce()}],"gradient-via-pos":[{via:ce()}],"gradient-to-pos":[{to:ce()}],"gradient-from":[{from:M()}],"gradient-via":[{via:M()}],"gradient-to":[{to:M()}],rounded:[{rounded:fe()}],"rounded-s":[{"rounded-s":fe()}],"rounded-e":[{"rounded-e":fe()}],"rounded-t":[{"rounded-t":fe()}],"rounded-r":[{"rounded-r":fe()}],"rounded-b":[{"rounded-b":fe()}],"rounded-l":[{"rounded-l":fe()}],"rounded-ss":[{"rounded-ss":fe()}],"rounded-se":[{"rounded-se":fe()}],"rounded-ee":[{"rounded-ee":fe()}],"rounded-es":[{"rounded-es":fe()}],"rounded-tl":[{"rounded-tl":fe()}],"rounded-tr":[{"rounded-tr":fe()}],"rounded-br":[{"rounded-br":fe()}],"rounded-bl":[{"rounded-bl":fe()}],"border-w":[{border:ue()}],"border-w-x":[{"border-x":ue()}],"border-w-y":[{"border-y":ue()}],"border-w-s":[{"border-s":ue()}],"border-w-e":[{"border-e":ue()}],"border-w-bs":[{"border-bs":ue()}],"border-w-be":[{"border-be":ue()}],"border-w-t":[{"border-t":ue()}],"border-w-r":[{"border-r":ue()}],"border-w-b":[{"border-b":ue()}],"border-w-l":[{"border-l":ue()}],"divide-x":[{"divide-x":ue()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ue()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...de(),"hidden","none"]}],"divide-style":[{divide:[...de(),"hidden","none"]}],"border-color":[{border:M()}],"border-color-x":[{"border-x":M()}],"border-color-y":[{"border-y":M()}],"border-color-s":[{"border-s":M()}],"border-color-e":[{"border-e":M()}],"border-color-bs":[{"border-bs":M()}],"border-color-be":[{"border-be":M()}],"border-color-t":[{"border-t":M()}],"border-color-r":[{"border-r":M()}],"border-color-b":[{"border-b":M()}],"border-color-l":[{"border-l":M()}],"divide-color":[{divide:M()}],"outline-style":[{outline:[...de(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Qe,je,Oe]}],"outline-w":[{outline:["",Qe,Vc,Po]}],"outline-color":[{outline:M()}],shadow:[{shadow:["","none",m,Nh,Mh]}],"shadow-color":[{shadow:M()}],"inset-shadow":[{"inset-shadow":["none",g,Nh,Mh]}],"inset-shadow-color":[{"inset-shadow":M()}],"ring-w":[{ring:ue()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:M()}],"ring-offset-w":[{"ring-offset":[Qe,Po]}],"ring-offset-color":[{"ring-offset":M()}],"inset-ring-w":[{"inset-ring":ue()}],"inset-ring-color":[{"inset-ring":M()}],"text-shadow":[{"text-shadow":["none",_,Nh,Mh]}],"text-shadow-color":[{"text-shadow":M()}],opacity:[{opacity:[Qe,je,Oe]}],"mix-blend":[{"mix-blend":[...we(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":we()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Qe]}],"mask-image-linear-from-pos":[{"mask-linear-from":oe()}],"mask-image-linear-to-pos":[{"mask-linear-to":oe()}],"mask-image-linear-from-color":[{"mask-linear-from":M()}],"mask-image-linear-to-color":[{"mask-linear-to":M()}],"mask-image-t-from-pos":[{"mask-t-from":oe()}],"mask-image-t-to-pos":[{"mask-t-to":oe()}],"mask-image-t-from-color":[{"mask-t-from":M()}],"mask-image-t-to-color":[{"mask-t-to":M()}],"mask-image-r-from-pos":[{"mask-r-from":oe()}],"mask-image-r-to-pos":[{"mask-r-to":oe()}],"mask-image-r-from-color":[{"mask-r-from":M()}],"mask-image-r-to-color":[{"mask-r-to":M()}],"mask-image-b-from-pos":[{"mask-b-from":oe()}],"mask-image-b-to-pos":[{"mask-b-to":oe()}],"mask-image-b-from-color":[{"mask-b-from":M()}],"mask-image-b-to-color":[{"mask-b-to":M()}],"mask-image-l-from-pos":[{"mask-l-from":oe()}],"mask-image-l-to-pos":[{"mask-l-to":oe()}],"mask-image-l-from-color":[{"mask-l-from":M()}],"mask-image-l-to-color":[{"mask-l-to":M()}],"mask-image-x-from-pos":[{"mask-x-from":oe()}],"mask-image-x-to-pos":[{"mask-x-to":oe()}],"mask-image-x-from-color":[{"mask-x-from":M()}],"mask-image-x-to-color":[{"mask-x-to":M()}],"mask-image-y-from-pos":[{"mask-y-from":oe()}],"mask-image-y-to-pos":[{"mask-y-to":oe()}],"mask-image-y-from-color":[{"mask-y-from":M()}],"mask-image-y-to-color":[{"mask-y-to":M()}],"mask-image-radial":[{"mask-radial":[je,Oe]}],"mask-image-radial-from-pos":[{"mask-radial-from":oe()}],"mask-image-radial-to-pos":[{"mask-radial-to":oe()}],"mask-image-radial-from-color":[{"mask-radial-from":M()}],"mask-image-radial-to-color":[{"mask-radial-to":M()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":N()}],"mask-image-conic-pos":[{"mask-conic":[Qe]}],"mask-image-conic-from-pos":[{"mask-conic-from":oe()}],"mask-image-conic-to-pos":[{"mask-conic-to":oe()}],"mask-image-conic-from-color":[{"mask-conic-from":M()}],"mask-image-conic-to-color":[{"mask-conic-to":M()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:I()}],"mask-repeat":[{mask:Z()}],"mask-size":[{mask:j()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",je,Oe]}],filter:[{filter:["","none",je,Oe]}],blur:[{blur:be()}],brightness:[{brightness:[Qe,je,Oe]}],contrast:[{contrast:[Qe,je,Oe]}],"drop-shadow":[{"drop-shadow":["","none",b,Nh,Mh]}],"drop-shadow-color":[{"drop-shadow":M()}],grayscale:[{grayscale:["",Qe,je,Oe]}],"hue-rotate":[{"hue-rotate":[Qe,je,Oe]}],invert:[{invert:["",Qe,je,Oe]}],saturate:[{saturate:[Qe,je,Oe]}],sepia:[{sepia:["",Qe,je,Oe]}],"backdrop-filter":[{"backdrop-filter":["","none",je,Oe]}],"backdrop-blur":[{"backdrop-blur":be()}],"backdrop-brightness":[{"backdrop-brightness":[Qe,je,Oe]}],"backdrop-contrast":[{"backdrop-contrast":[Qe,je,Oe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Qe,je,Oe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Qe,je,Oe]}],"backdrop-invert":[{"backdrop-invert":["",Qe,je,Oe]}],"backdrop-opacity":[{"backdrop-opacity":[Qe,je,Oe]}],"backdrop-saturate":[{"backdrop-saturate":[Qe,je,Oe]}],"backdrop-sepia":[{"backdrop-sepia":["",Qe,je,Oe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":F()}],"border-spacing-x":[{"border-spacing-x":F()}],"border-spacing-y":[{"border-spacing-y":F()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",je,Oe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Qe,"initial",je,Oe]}],ease:[{ease:["linear","initial",k,je,Oe]}],delay:[{delay:[Qe,je,Oe]}],animate:[{animate:["none",R,je,Oe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,je,Oe]}],"perspective-origin":[{"perspective-origin":L()}],rotate:[{rotate:Ne()}],"rotate-x":[{"rotate-x":Ne()}],"rotate-y":[{"rotate-y":Ne()}],"rotate-z":[{"rotate-z":Ne()}],scale:[{scale:Se()}],"scale-x":[{"scale-x":Se()}],"scale-y":[{"scale-y":Se()}],"scale-z":[{"scale-z":Se()}],"scale-3d":["scale-3d"],skew:[{skew:_e()}],"skew-x":[{"skew-x":_e()}],"skew-y":[{"skew-y":_e()}],transform:[{transform:[je,Oe,"","none","gpu","cpu"]}],"transform-origin":[{origin:L()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:xe()}],"translate-x":[{"translate-x":xe()}],"translate-y":[{"translate-y":xe()}],"translate-z":[{"translate-z":xe()}],"translate-none":["translate-none"],accent:[{accent:M()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:M()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",je,Oe]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":F()}],"scroll-mx":[{"scroll-mx":F()}],"scroll-my":[{"scroll-my":F()}],"scroll-ms":[{"scroll-ms":F()}],"scroll-me":[{"scroll-me":F()}],"scroll-mbs":[{"scroll-mbs":F()}],"scroll-mbe":[{"scroll-mbe":F()}],"scroll-mt":[{"scroll-mt":F()}],"scroll-mr":[{"scroll-mr":F()}],"scroll-mb":[{"scroll-mb":F()}],"scroll-ml":[{"scroll-ml":F()}],"scroll-p":[{"scroll-p":F()}],"scroll-px":[{"scroll-px":F()}],"scroll-py":[{"scroll-py":F()}],"scroll-ps":[{"scroll-ps":F()}],"scroll-pe":[{"scroll-pe":F()}],"scroll-pbs":[{"scroll-pbs":F()}],"scroll-pbe":[{"scroll-pbe":F()}],"scroll-pt":[{"scroll-pt":F()}],"scroll-pr":[{"scroll-pr":F()}],"scroll-pb":[{"scroll-pb":F()}],"scroll-pl":[{"scroll-pl":F()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",je,Oe]}],fill:[{fill:["none",...M()]}],"stroke-w":[{stroke:[Qe,Vc,Po,CC]}],stroke:[{stroke:["none",...M()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},dz=$L(uz);function ye(...e){return dz(jR(e))}function vv(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}function RC(e){return e.startsWith("chatId:")?e.slice(7):e}const vb=wL("touch-manipulation inline-flex items-center justify-center whitespace-nowrap cursor-pointer rounded-md text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none",{variants:{variant:{default:"bg-primary text-primary-foreground disabled:bg-primary/50 disabled:text-primary-foreground/90 hover:bg-primary/90",juicy:"bg-logo text-primary-foreground disabled:text-primary-foreground/50 hover:bg-logo/90",destructive:"bg-destructive/80 dark:text-white",outline:"border disabled:bg-transparent disabled:text-foreground/50 border-inpu disabled:border-input/90 bg-card hover:bg-muted hover:text-accent-foreground",secondary:"bg-transparent border border-border text-secondary-foreground hover:text-secondary-foreground/60 disabled:text-secondary-foreground/50",ghost:"hover:bg-accent dark:hover:bg-card hover:text-accent-foreground text-muted-foreground disabled:text-muted-foreground/50 border border-border/0 hover:border-border",link:"text-primary disabled:text-primary/50 underline-offset-4 hover:underline",none:""},size:{default:"h-10 px-4 rounded-full py-2",sm:"h-9 rounded-full px-3",lg:"h-11 rounded-full px-8",icon:"h-9 w-9 rounded-full","icon-sm":"h-5.5 w-5.5 rounded-md"}},defaultVariants:{variant:"default",size:"default"}}),tt=y.forwardRef(({className:e,variant:t,size:n,...r},s)=>p.jsx("button",{className:ye(vb({variant:t,size:n,className:e})),ref:s,...r}));tt.displayName="Button";function Ae(e,t,{checkForDefaultPrevented:n=!0}={}){return function(s){if(e==null||e(s),n===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}function TC(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function _b(...e){return t=>{let n=!1;const r=e.map(s=>{const a=TC(s,t);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let s=0;s<r.length;s++){const a=r[s];typeof a=="function"?a():TC(e[s],null)}}}}function yt(...e){return y.useCallback(_b(...e),e)}function hz(e,t){const n=y.createContext(t),r=a=>{const{children:l,...u}=a,h=y.useMemo(()=>u,Object.values(u));return p.jsx(n.Provider,{value:h,children:l})};r.displayName=e+"Provider";function s(a){const l=y.useContext(n);if(l)return l;if(t!==void 0)return t;throw new Error(`\`${a}\` must be used within \`${e}\``)}return[r,s]}function vs(e,t=[]){let n=[];function r(a,l){const u=y.createContext(l),h=n.length;n=[...n,l];const d=g=>{var k;const{scope:_,children:b,...w}=g,S=((k=_==null?void 0:_[e])==null?void 0:k[h])||u,C=y.useMemo(()=>w,Object.values(w));return p.jsx(S.Provider,{value:C,children:b})};d.displayName=a+"Provider";function m(g,_){var S;const b=((S=_==null?void 0:_[e])==null?void 0:S[h])||u,w=y.useContext(b);if(w)return w;if(l!==void 0)return l;throw new Error(`\`${g}\` must be used within \`${a}\``)}return[d,m]}const s=()=>{const a=n.map(l=>y.createContext(l));return function(u){const h=(u==null?void 0:u[e])||a;return y.useMemo(()=>({[`__scope${e}`]:{...u,[e]:h}}),[u,h])}};return s.scopeName=e,[r,fz(s,...t)]}function fz(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(a){const l=r.reduce((u,{useScope:h,scopeName:d})=>{const g=h(a)[`__scope${d}`];return{...u,...g}},{});return y.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}var Kn=globalThis!=null&&globalThis.document?y.useLayoutEffect:()=>{},pz=dR[" useId ".trim().toString()]||(()=>{}),mz=0;function ds(e){const[t,n]=y.useState(pz());return Kn(()=>{n(r=>r??String(mz++))},[e]),t?`radix-${t}`:""}var gz=dR[" useInsertionEffect ".trim().toString()]||Kn;function Rl({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[s,a,l]=vz({defaultProp:t,onChange:n}),u=e!==void 0,h=u?e:s;{const m=y.useRef(e!==void 0);y.useEffect(()=>{const g=m.current;g!==u&&console.warn(`${r} is changing from ${g?"controlled":"uncontrolled"} to ${u?"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.`),m.current=u},[u,r])}const d=y.useCallback(m=>{var g;if(u){const _=_z(m)?m(e):m;_!==e&&((g=l.current)==null||g.call(l,_))}else a(m)},[u,e,a,l]);return[h,d]}function vz({defaultProp:e,onChange:t}){const[n,r]=y.useState(e),s=y.useRef(n),a=y.useRef(t);return gz(()=>{a.current=t},[t]),y.useEffect(()=>{var l;s.current!==n&&((l=a.current)==null||l.call(a,n),s.current=n)},[n,s]),[n,r,a]}function _z(e){return typeof e=="function"}function Zo(e){const t=yz(e),n=y.forwardRef((r,s)=>{const{children:a,...l}=r,u=y.Children.toArray(a),h=u.find(xz);if(h){const d=h.props.children,m=u.map(g=>g===h?y.Children.count(d)>1?y.Children.only(null):y.isValidElement(d)?d.props.children:null:g);return p.jsx(t,{...l,ref:s,children:y.isValidElement(d)?y.cloneElement(d,void 0,m):null})}return p.jsx(t,{...l,ref:s,children:a})});return n.displayName=`${e}.Slot`,n}function yz(e){const t=y.forwardRef((n,r)=>{const{children:s,...a}=n;if(y.isValidElement(s)){const l=Sz(s),u=wz(a,s.props);return s.type!==y.Fragment&&(u.ref=r?_b(r,l):l),y.cloneElement(s,u)}return y.Children.count(s)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var YR=Symbol("radix.slottable");function bz(e){const t=({children:n})=>p.jsx(p.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=YR,t}function xz(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===YR}function wz(e,t){const n={...t};for(const r in t){const s=e[r],a=t[r];/^on[A-Z]/.test(r)?s&&a?n[r]=(...u)=>{const h=a(...u);return s(...u),h}:s&&(n[r]=s):r==="style"?n[r]={...s,...a}:r==="className"&&(n[r]=[s,a].filter(Boolean).join(" "))}return{...e,...n}}function Sz(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Cz=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],st=Cz.reduce((e,t)=>{const n=Zo(`Primitive.${t}`),r=y.forwardRef((s,a)=>{const{asChild:l,...u}=s,h=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),p.jsx(h,{...u,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function XR(e,t){e&&Ri.flushSync(()=>e.dispatchEvent(t))}function di(e){const t=y.useRef(e);return y.useEffect(()=>{t.current=e}),y.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function kz(e,t=globalThis==null?void 0:globalThis.document){const n=di(e);y.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Ez="DismissableLayer",E_="dismissableLayer.update",Rz="dismissableLayer.pointerDownOutside",Tz="dismissableLayer.focusOutside",MC,ZR=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Bl=y.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:a,onInteractOutside:l,onDismiss:u,...h}=e,d=y.useContext(ZR),[m,g]=y.useState(null),_=(m==null?void 0:m.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,b]=y.useState({}),w=yt(t,O=>g(O)),S=Array.from(d.layers),[C]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),k=S.indexOf(C),R=m?S.indexOf(m):-1,T=d.layersWithOutsidePointerEventsDisabled.size>0,N=R>=k,L=Az(O=>{const F=O.target,G=[...d.branches].some(B=>B.contains(F));!N||G||(s==null||s(O),l==null||l(O),O.defaultPrevented||u==null||u())},_),A=Dz(O=>{const F=O.target;[...d.branches].some(B=>B.contains(F))||(a==null||a(O),l==null||l(O),O.defaultPrevented||u==null||u())},_);return kz(O=>{R===d.layers.size-1&&(r==null||r(O),!O.defaultPrevented&&u&&(O.preventDefault(),u()))},_),y.useEffect(()=>{if(m)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(MC=_.body.style.pointerEvents,_.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(m)),d.layers.add(m),NC(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(_.body.style.pointerEvents=MC)}},[m,_,n,d]),y.useEffect(()=>()=>{m&&(d.layers.delete(m),d.layersWithOutsidePointerEventsDisabled.delete(m),NC())},[m,d]),y.useEffect(()=>{const O=()=>b({});return document.addEventListener(E_,O),()=>document.removeEventListener(E_,O)},[]),p.jsx(st.div,{...h,ref:w,style:{pointerEvents:T?N?"auto":"none":void 0,...e.style},onFocusCapture:Ae(e.onFocusCapture,A.onFocusCapture),onBlurCapture:Ae(e.onBlurCapture,A.onBlurCapture),onPointerDownCapture:Ae(e.onPointerDownCapture,L.onPointerDownCapture)})});Bl.displayName=Ez;var Mz="DismissableLayerBranch",Nz=y.forwardRef((e,t)=>{const n=y.useContext(ZR),r=y.useRef(null),s=yt(t,r);return y.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),p.jsx(st.div,{...e,ref:s})});Nz.displayName=Mz;function Az(e,t=globalThis==null?void 0:globalThis.document){const n=di(e),r=y.useRef(!1),s=y.useRef(()=>{});return y.useEffect(()=>{const a=u=>{if(u.target&&!r.current){let h=function(){QR(Rz,n,d,{discrete:!0})};const d={originalEvent:u};u.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=h,t.addEventListener("click",s.current,{once:!0})):h()}else t.removeEventListener("click",s.current);r.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",a),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Dz(e,t=globalThis==null?void 0:globalThis.document){const n=di(e),r=y.useRef(!1);return y.useEffect(()=>{const s=a=>{a.target&&!r.current&&QR(Tz,n,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function NC(){const e=new CustomEvent(E_);document.dispatchEvent(e)}function QR(e,t,n,{discrete:r}){const s=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?XR(s,a):s.dispatchEvent(a)}var _v="focusScope.autoFocusOnMount",yv="focusScope.autoFocusOnUnmount",AC={bubbles:!1,cancelable:!0},Oz="FocusScope",Yu=y.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:a,...l}=e,[u,h]=y.useState(null),d=di(s),m=di(a),g=y.useRef(null),_=yt(t,S=>h(S)),b=y.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;y.useEffect(()=>{if(r){let S=function(T){if(b.paused||!u)return;const N=T.target;u.contains(N)?g.current=N:Qs(g.current,{select:!0})},C=function(T){if(b.paused||!u)return;const N=T.relatedTarget;N!==null&&(u.contains(N)||Qs(g.current,{select:!0}))},k=function(T){if(document.activeElement===document.body)for(const L of T)L.removedNodes.length>0&&Qs(u)};document.addEventListener("focusin",S),document.addEventListener("focusout",C);const R=new MutationObserver(k);return u&&R.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",S),document.removeEventListener("focusout",C),R.disconnect()}}},[r,u,b.paused]),y.useEffect(()=>{if(u){OC.add(b);const S=document.activeElement;if(!u.contains(S)){const k=new CustomEvent(_v,AC);u.addEventListener(_v,d),u.dispatchEvent(k),k.defaultPrevented||(jz(Iz(JR(u)),{select:!0}),document.activeElement===S&&Qs(u))}return()=>{u.removeEventListener(_v,d),setTimeout(()=>{const k=new CustomEvent(yv,AC);u.addEventListener(yv,m),u.dispatchEvent(k),k.defaultPrevented||Qs(S??document.body,{select:!0}),u.removeEventListener(yv,m),OC.remove(b)},0)}}},[u,d,m,b]);const w=y.useCallback(S=>{if(!n&&!r||b.paused)return;const C=S.key==="Tab"&&!S.altKey&&!S.ctrlKey&&!S.metaKey,k=document.activeElement;if(C&&k){const R=S.currentTarget,[T,N]=Lz(R);T&&N?!S.shiftKey&&k===N?(S.preventDefault(),n&&Qs(T,{select:!0})):S.shiftKey&&k===T&&(S.preventDefault(),n&&Qs(N,{select:!0})):k===R&&S.preventDefault()}},[n,r,b.paused]);return p.jsx(st.div,{tabIndex:-1,...l,ref:_,onKeyDown:w})});Yu.displayName=Oz;function jz(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Qs(r,{select:t}),document.activeElement!==n)return}function Lz(e){const t=JR(e),n=DC(t,e),r=DC(t.reverse(),e);return[n,r]}function JR(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function DC(e,t){for(const n of e)if(!zz(n,{upTo:t}))return n}function zz(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 Pz(e){return e instanceof HTMLInputElement&&"select"in e}function Qs(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Pz(e)&&t&&e.select()}}var OC=Bz();function Bz(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=jC(e,t),e.unshift(t)},remove(t){var n;e=jC(e,t),(n=e[0])==null||n.resume()}}}function jC(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Iz(e){return e.filter(t=>t.tagName!=="A")}var Hz="Portal",Il=y.forwardRef((e,t)=>{var u;const{container:n,...r}=e,[s,a]=y.useState(!1);Kn(()=>a(!0),[]);const l=n||s&&((u=globalThis==null?void 0:globalThis.document)==null?void 0:u.body);return l?xL.createPortal(p.jsx(st.div,{...r,ref:t}),l):null});Il.displayName=Hz;function Fz(e,t){return y.useReducer((n,r)=>t[n][r]??n,e)}var ei=e=>{const{present:t,children:n}=e,r=Uz(t),s=typeof n=="function"?n({present:r.isPresent}):y.Children.only(n),a=yt(r.ref,$z(s));return typeof n=="function"||r.isPresent?y.cloneElement(s,{ref:a}):null};ei.displayName="Presence";function Uz(e){const[t,n]=y.useState(),r=y.useRef(null),s=y.useRef(e),a=y.useRef("none"),l=e?"mounted":"unmounted",[u,h]=Fz(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return y.useEffect(()=>{const d=Ah(r.current);a.current=u==="mounted"?d:"none"},[u]),Kn(()=>{const d=r.current,m=s.current;if(m!==e){const _=a.current,b=Ah(d);e?h("MOUNT"):b==="none"||(d==null?void 0:d.display)==="none"?h("UNMOUNT"):h(m&&_!==b?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,h]),Kn(()=>{if(t){let d;const m=t.ownerDocument.defaultView??window,g=b=>{const S=Ah(r.current).includes(CSS.escape(b.animationName));if(b.target===t&&S&&(h("ANIMATION_END"),!s.current)){const C=t.style.animationFillMode;t.style.animationFillMode="forwards",d=m.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=C)})}},_=b=>{b.target===t&&(a.current=Ah(r.current))};return t.addEventListener("animationstart",_),t.addEventListener("animationcancel",g),t.addEventListener("animationend",g),()=>{m.clearTimeout(d),t.removeEventListener("animationstart",_),t.removeEventListener("animationcancel",g),t.removeEventListener("animationend",g)}}else h("ANIMATION_END")},[t,h]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:y.useCallback(d=>{r.current=d?getComputedStyle(d):null,n(d)},[])}}function Ah(e){return(e==null?void 0:e.animationName)||"none"}function $z(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var bv=0;function mp(){y.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??LC()),document.body.insertAdjacentElement("beforeend",e[1]??LC()),bv++,()=>{bv===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),bv--}},[])}function LC(){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 Ei=function(){return Ei=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},Ei.apply(this,arguments)};function eT(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n}function Wz(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,a;r<s;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var hf="right-scroll-bar-position",ff="width-before-scroll-bar",Vz="with-scroll-bars-hidden",qz="--removed-body-scroll-bar-size";function xv(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Kz(e,t){var n=y.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var s=n.value;s!==r&&(n.value=r,n.callback(r,s))}}}})[0];return n.callback=t,n.facade}var Gz=typeof window<"u"?y.useLayoutEffect:y.useEffect,zC=new WeakMap;function Yz(e,t){var n=Kz(null,function(r){return e.forEach(function(s){return xv(s,r)})});return Gz(function(){var r=zC.get(n);if(r){var s=new Set(r),a=new Set(e),l=n.current;s.forEach(function(u){a.has(u)||xv(u,null)}),a.forEach(function(u){s.has(u)||xv(u,l)})}zC.set(n,e)},[e]),n}function Xz(e){return e}function Zz(e,t){t===void 0&&(t=Xz);var n=[],r=!1,s={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(a){var l=t(a,r);return n.push(l),function(){n=n.filter(function(u){return u!==l})}},assignSyncMedium:function(a){for(r=!0;n.length;){var l=n;n=[],l.forEach(a)}n={push:function(u){return a(u)},filter:function(){return n}}},assignMedium:function(a){r=!0;var l=[];if(n.length){var u=n;n=[],u.forEach(a),l=n}var h=function(){var m=l;l=[],m.forEach(a)},d=function(){return Promise.resolve().then(h)};d(),n={push:function(m){l.push(m),d()},filter:function(m){return l=l.filter(m),n}}}};return s}function Qz(e){e===void 0&&(e={});var t=Zz(null);return t.options=Ei({async:!0,ssr:!1},e),t}var tT=function(e){var t=e.sideCar,n=eT(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return y.createElement(r,Ei({},n))};tT.isSideCarExport=!0;function Jz(e,t){return e.useMedium(t),tT}var nT=Qz(),wv=function(){},gp=y.forwardRef(function(e,t){var n=y.useRef(null),r=y.useState({onScrollCapture:wv,onWheelCapture:wv,onTouchMoveCapture:wv}),s=r[0],a=r[1],l=e.forwardProps,u=e.children,h=e.className,d=e.removeScrollBar,m=e.enabled,g=e.shards,_=e.sideCar,b=e.noRelative,w=e.noIsolation,S=e.inert,C=e.allowPinchZoom,k=e.as,R=k===void 0?"div":k,T=e.gapMode,N=eT(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),L=_,A=Yz([n,t]),O=Ei(Ei({},N),s);return y.createElement(y.Fragment,null,m&&y.createElement(L,{sideCar:nT,removeScrollBar:d,shards:g,noRelative:b,noIsolation:w,inert:S,setCallbacks:a,allowPinchZoom:!!C,lockRef:n,gapMode:T}),l?y.cloneElement(y.Children.only(u),Ei(Ei({},O),{ref:A})):y.createElement(R,Ei({},O,{className:h,ref:A}),u))});gp.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};gp.classNames={fullWidth:ff,zeroRight:hf};var e6=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function t6(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=e6();return t&&e.setAttribute("nonce",t),e}function n6(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function r6(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var i6=function(){var e=0,t=null;return{add:function(n){e==0&&(t=t6())&&(n6(t,n),r6(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},s6=function(){var e=i6();return function(t,n){y.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},rT=function(){var e=s6(),t=function(n){var r=n.styles,s=n.dynamic;return e(r,s),null};return t},o6={left:0,top:0,right:0,gap:0},Sv=function(e){return parseInt(e||"",10)||0},a6=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[Sv(n),Sv(r),Sv(s)]},l6=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return o6;var t=a6(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},c6=rT(),xl="data-scroll-locked",u6=function(e,t,n,r){var s=e.left,a=e.top,l=e.right,u=e.gap;return n===void 0&&(n="margin"),`
|
|
61
|
-
.`.concat(Vz,` {
|
|
62
|
-
overflow: hidden `).concat(r,`;
|
|
63
|
-
padding-right: `).concat(u,"px ").concat(r,`;
|
|
64
|
-
}
|
|
65
|
-
body[`).concat(xl,`] {
|
|
66
|
-
overflow: hidden `).concat(r,`;
|
|
67
|
-
overscroll-behavior: contain;
|
|
68
|
-
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
69
|
-
padding-left: `.concat(s,`px;
|
|
70
|
-
padding-top: `).concat(a,`px;
|
|
71
|
-
padding-right: `).concat(l,`px;
|
|
72
|
-
margin-left:0;
|
|
73
|
-
margin-top:0;
|
|
74
|
-
margin-right: `).concat(u,"px ").concat(r,`;
|
|
75
|
-
`),n==="padding"&&"padding-right: ".concat(u,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
.`).concat(hf,` {
|
|
79
|
-
right: `).concat(u,"px ").concat(r,`;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
.`).concat(ff,` {
|
|
83
|
-
margin-right: `).concat(u,"px ").concat(r,`;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
.`).concat(hf," .").concat(hf,` {
|
|
87
|
-
right: 0 `).concat(r,`;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
.`).concat(ff," .").concat(ff,` {
|
|
91
|
-
margin-right: 0 `).concat(r,`;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
body[`).concat(xl,`] {
|
|
95
|
-
`).concat(qz,": ").concat(u,`px;
|
|
96
|
-
}
|
|
97
|
-
`)},PC=function(){var e=parseInt(document.body.getAttribute(xl)||"0",10);return isFinite(e)?e:0},d6=function(){y.useEffect(function(){return document.body.setAttribute(xl,(PC()+1).toString()),function(){var e=PC()-1;e<=0?document.body.removeAttribute(xl):document.body.setAttribute(xl,e.toString())}},[])},h6=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;d6();var a=y.useMemo(function(){return l6(s)},[s]);return y.createElement(c6,{styles:u6(a,!t,s,n?"":"!important")})},R_=!1;if(typeof window<"u")try{var Dh=Object.defineProperty({},"passive",{get:function(){return R_=!0,!0}});window.addEventListener("test",Dh,Dh),window.removeEventListener("test",Dh,Dh)}catch{R_=!1}var nl=R_?{passive:!1}:!1,f6=function(e){return e.tagName==="TEXTAREA"},iT=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!f6(e)&&n[t]==="visible")},p6=function(e){return iT(e,"overflowY")},m6=function(e){return iT(e,"overflowX")},BC=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=sT(e,r);if(s){var a=oT(e,r),l=a[1],u=a[2];if(l>u)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},g6=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},v6=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},sT=function(e,t){return e==="v"?p6(t):m6(t)},oT=function(e,t){return e==="v"?g6(t):v6(t)},_6=function(e,t){return e==="h"&&t==="rtl"?-1:1},y6=function(e,t,n,r,s){var a=_6(e,window.getComputedStyle(t).direction),l=a*r,u=n.target,h=t.contains(u),d=!1,m=l>0,g=0,_=0;do{if(!u)break;var b=oT(e,u),w=b[0],S=b[1],C=b[2],k=S-C-a*w;(w||k)&&sT(e,u)&&(g+=k,_+=w);var R=u.parentNode;u=R&&R.nodeType===Node.DOCUMENT_FRAGMENT_NODE?R.host:R}while(!h&&u!==document.body||h&&(t.contains(u)||t===u));return(m&&Math.abs(g)<1||!m&&Math.abs(_)<1)&&(d=!0),d},Oh=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},IC=function(e){return[e.deltaX,e.deltaY]},HC=function(e){return e&&"current"in e?e.current:e},b6=function(e,t){return e[0]===t[0]&&e[1]===t[1]},x6=function(e){return`
|
|
98
|
-
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
99
|
-
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
100
|
-
`)},w6=0,rl=[];function S6(e){var t=y.useRef([]),n=y.useRef([0,0]),r=y.useRef(),s=y.useState(w6++)[0],a=y.useState(rT)[0],l=y.useRef(e);y.useEffect(function(){l.current=e},[e]),y.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var S=Wz([e.lockRef.current],(e.shards||[]).map(HC),!0).filter(Boolean);return S.forEach(function(C){return C.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),S.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var u=y.useCallback(function(S,C){if("touches"in S&&S.touches.length===2||S.type==="wheel"&&S.ctrlKey)return!l.current.allowPinchZoom;var k=Oh(S),R=n.current,T="deltaX"in S?S.deltaX:R[0]-k[0],N="deltaY"in S?S.deltaY:R[1]-k[1],L,A=S.target,O=Math.abs(T)>Math.abs(N)?"h":"v";if("touches"in S&&O==="h"&&A.type==="range")return!1;var F=window.getSelection(),G=F&&F.anchorNode,B=G?G===A||G.contains(A):!1;if(B)return!1;var H=BC(O,A);if(!H)return!0;if(H?L=O:(L=O==="v"?"h":"v",H=BC(O,A)),!H)return!1;if(!r.current&&"changedTouches"in S&&(T||N)&&(r.current=L),!L)return!0;var P=r.current||L;return y6(P,C,S,P==="h"?T:N)},[]),h=y.useCallback(function(S){var C=S;if(!(!rl.length||rl[rl.length-1]!==a)){var k="deltaY"in C?IC(C):Oh(C),R=t.current.filter(function(L){return L.name===C.type&&(L.target===C.target||C.target===L.shadowParent)&&b6(L.delta,k)})[0];if(R&&R.should){C.cancelable&&C.preventDefault();return}if(!R){var T=(l.current.shards||[]).map(HC).filter(Boolean).filter(function(L){return L.contains(C.target)}),N=T.length>0?u(C,T[0]):!l.current.noIsolation;N&&C.cancelable&&C.preventDefault()}}},[]),d=y.useCallback(function(S,C,k,R){var T={name:S,delta:C,target:k,should:R,shadowParent:C6(k)};t.current.push(T),setTimeout(function(){t.current=t.current.filter(function(N){return N!==T})},1)},[]),m=y.useCallback(function(S){n.current=Oh(S),r.current=void 0},[]),g=y.useCallback(function(S){d(S.type,IC(S),S.target,u(S,e.lockRef.current))},[]),_=y.useCallback(function(S){d(S.type,Oh(S),S.target,u(S,e.lockRef.current))},[]);y.useEffect(function(){return rl.push(a),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:_}),document.addEventListener("wheel",h,nl),document.addEventListener("touchmove",h,nl),document.addEventListener("touchstart",m,nl),function(){rl=rl.filter(function(S){return S!==a}),document.removeEventListener("wheel",h,nl),document.removeEventListener("touchmove",h,nl),document.removeEventListener("touchstart",m,nl)}},[]);var b=e.removeScrollBar,w=e.inert;return y.createElement(y.Fragment,null,w?y.createElement(a,{styles:x6(s)}):null,b?y.createElement(h6,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function C6(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const k6=Jz(nT,S6);var Xu=y.forwardRef(function(e,t){return y.createElement(gp,Ei({},e,{ref:t,sideCar:k6}))});Xu.classNames=gp.classNames;var E6=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},il=new WeakMap,jh=new WeakMap,Lh={},Cv=0,aT=function(e){return e&&(e.host||aT(e.parentNode))},R6=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=aT(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},T6=function(e,t,n,r){var s=R6(t,Array.isArray(e)?e:[e]);Lh[n]||(Lh[n]=new WeakMap);var a=Lh[n],l=[],u=new Set,h=new Set(s),d=function(g){!g||u.has(g)||(u.add(g),d(g.parentNode))};s.forEach(d);var m=function(g){!g||h.has(g)||Array.prototype.forEach.call(g.children,function(_){if(u.has(_))m(_);else try{var b=_.getAttribute(r),w=b!==null&&b!=="false",S=(il.get(_)||0)+1,C=(a.get(_)||0)+1;il.set(_,S),a.set(_,C),l.push(_),S===1&&w&&jh.set(_,!0),C===1&&_.setAttribute(n,"true"),w||_.setAttribute(r,"true")}catch(k){console.error("aria-hidden: cannot operate on ",_,k)}})};return m(t),u.clear(),Cv++,function(){l.forEach(function(g){var _=il.get(g)-1,b=a.get(g)-1;il.set(g,_),a.set(g,b),_||(jh.has(g)||g.removeAttribute(r),jh.delete(g)),b||g.removeAttribute(n)}),Cv--,Cv||(il=new WeakMap,il=new WeakMap,jh=new WeakMap,Lh={})}},vp=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=E6(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),T6(r,s,n,"aria-hidden")):function(){return null}},_p="Dialog",[lT]=vs(_p),[M6,gi]=lT(_p),cT=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:s,onOpenChange:a,modal:l=!0}=e,u=y.useRef(null),h=y.useRef(null),[d,m]=Rl({prop:r,defaultProp:s??!1,onChange:a,caller:_p});return p.jsx(M6,{scope:t,triggerRef:u,contentRef:h,contentId:ds(),titleId:ds(),descriptionId:ds(),open:d,onOpenChange:m,onOpenToggle:y.useCallback(()=>m(g=>!g),[m]),modal:l,children:n})};cT.displayName=_p;var uT="DialogTrigger",N6=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=gi(uT,n),a=yt(t,s.triggerRef);return p.jsx(st.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":xb(s.open),...r,ref:a,onClick:Ae(e.onClick,s.onOpenToggle)})});N6.displayName=uT;var yb="DialogPortal",[A6,dT]=lT(yb,{forceMount:void 0}),hT=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,a=gi(yb,t);return p.jsx(A6,{scope:t,forceMount:n,children:y.Children.map(r,l=>p.jsx(ei,{present:n||a.open,children:p.jsx(Il,{asChild:!0,container:s,children:l})}))})};hT.displayName=yb;var Df="DialogOverlay",fT=y.forwardRef((e,t)=>{const n=dT(Df,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,a=gi(Df,e.__scopeDialog);return a.modal?p.jsx(ei,{present:r||a.open,children:p.jsx(O6,{...s,ref:t})}):null});fT.displayName=Df;var D6=Zo("DialogOverlay.RemoveScroll"),O6=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=gi(Df,n);return p.jsx(Xu,{as:D6,allowPinchZoom:!0,shards:[s.contentRef],children:p.jsx(st.div,{"data-state":xb(s.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Qo="DialogContent",pT=y.forwardRef((e,t)=>{const n=dT(Qo,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,a=gi(Qo,e.__scopeDialog);return p.jsx(ei,{present:r||a.open,children:a.modal?p.jsx(j6,{...s,ref:t}):p.jsx(L6,{...s,ref:t})})});pT.displayName=Qo;var j6=y.forwardRef((e,t)=>{const n=gi(Qo,e.__scopeDialog),r=y.useRef(null),s=yt(t,n.contentRef,r);return y.useEffect(()=>{const a=r.current;if(a)return vp(a)},[]),p.jsx(mT,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ae(e.onCloseAutoFocus,a=>{var l;a.preventDefault(),(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:Ae(e.onPointerDownOutside,a=>{const l=a.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0;(l.button===2||u)&&a.preventDefault()}),onFocusOutside:Ae(e.onFocusOutside,a=>a.preventDefault())})}),L6=y.forwardRef((e,t)=>{const n=gi(Qo,e.__scopeDialog),r=y.useRef(!1),s=y.useRef(!1);return p.jsx(mT,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var l,u;(l=e.onCloseAutoFocus)==null||l.call(e,a),a.defaultPrevented||(r.current||(u=n.triggerRef.current)==null||u.focus(),a.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:a=>{var h,d;(h=e.onInteractOutside)==null||h.call(e,a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const l=a.target;((d=n.triggerRef.current)==null?void 0:d.contains(l))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&s.current&&a.preventDefault()}})}),mT=y.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:a,...l}=e,u=gi(Qo,n),h=y.useRef(null),d=yt(t,h);return mp(),p.jsxs(p.Fragment,{children:[p.jsx(Yu,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:a,children:p.jsx(Bl,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":xb(u.open),...l,ref:d,onDismiss:()=>u.onOpenChange(!1)})}),p.jsxs(p.Fragment,{children:[p.jsx(z6,{titleId:u.titleId}),p.jsx(B6,{contentRef:h,descriptionId:u.descriptionId})]})]})}),bb="DialogTitle",gT=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=gi(bb,n);return p.jsx(st.h2,{id:s.titleId,...r,ref:t})});gT.displayName=bb;var vT="DialogDescription",_T=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=gi(vT,n);return p.jsx(st.p,{id:s.descriptionId,...r,ref:t})});_T.displayName=vT;var yT="DialogClose",bT=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=gi(yT,n);return p.jsx(st.button,{type:"button",...r,ref:t,onClick:Ae(e.onClick,()=>s.onOpenChange(!1))})});bT.displayName=yT;function xb(e){return e?"open":"closed"}var xT="DialogTitleWarning",[Hne,wT]=hz(xT,{contentName:Qo,titleName:bb,docsSlug:"dialog"}),z6=({titleId:e})=>{const t=wT(xT),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
101
|
-
|
|
102
|
-
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
103
|
-
|
|
104
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return y.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},P6="DialogDescriptionWarning",B6=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${wT(P6).contentName}}.`;return y.useEffect(()=>{var a;const s=(a=e.current)==null?void 0:a.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},I6=cT,H6=hT,ST=fT,CT=pT,F6=gT,U6=_T,$6=bT;/**
|
|
105
|
-
* @license lucide-react v0.562.0 - ISC
|
|
106
|
-
*
|
|
107
|
-
* This source code is licensed under the ISC license.
|
|
108
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
109
|
-
*/const W6=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),V6=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),FC=e=>{const t=V6(e);return t.charAt(0).toUpperCase()+t.slice(1)},kT=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),q6=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
|
|
110
|
-
* @license lucide-react v0.562.0 - ISC
|
|
111
|
-
*
|
|
112
|
-
* This source code is licensed under the ISC license.
|
|
113
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
114
|
-
*/var K6={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"};/**
|
|
115
|
-
* @license lucide-react v0.562.0 - ISC
|
|
116
|
-
*
|
|
117
|
-
* This source code is licensed under the ISC license.
|
|
118
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
119
|
-
*/const G6=y.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:a,iconNode:l,...u},h)=>y.createElement("svg",{ref:h,...K6,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:kT("lucide",s),...!a&&!q6(u)&&{"aria-hidden":"true"},...u},[...l.map(([d,m])=>y.createElement(d,m)),...Array.isArray(a)?a:[a]]));/**
|
|
120
|
-
* @license lucide-react v0.562.0 - ISC
|
|
121
|
-
*
|
|
122
|
-
* This source code is licensed under the ISC license.
|
|
123
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
124
|
-
*/const Ee=(e,t)=>{const n=y.forwardRef(({className:r,...s},a)=>y.createElement(G6,{ref:a,iconNode:t,className:kT(`lucide-${W6(FC(e))}`,`lucide-${e}`,r),...s}));return n.displayName=FC(e),n};/**
|
|
125
|
-
* @license lucide-react v0.562.0 - ISC
|
|
126
|
-
*
|
|
127
|
-
* This source code is licensed under the ISC license.
|
|
128
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
129
|
-
*/const Y6=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]],X6=Ee("archive",Y6);/**
|
|
130
|
-
* @license lucide-react v0.562.0 - ISC
|
|
131
|
-
*
|
|
132
|
-
* This source code is licensed under the ISC license.
|
|
133
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
134
|
-
*/const Z6=[["path",{d:"M12 17V3",key:"1cwfxf"}],["path",{d:"m6 11 6 6 6-6",key:"12ii2o"}],["path",{d:"M19 21H5",key:"150jfl"}]],Q6=Ee("arrow-down-to-line",Z6);/**
|
|
135
|
-
* @license lucide-react v0.562.0 - ISC
|
|
136
|
-
*
|
|
137
|
-
* This source code is licensed under the ISC license.
|
|
138
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
139
|
-
*/const J6=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],eP=Ee("arrow-down",J6);/**
|
|
140
|
-
* @license lucide-react v0.562.0 - ISC
|
|
141
|
-
*
|
|
142
|
-
* This source code is licensed under the ISC license.
|
|
143
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
144
|
-
*/const tP=[["path",{d:"M8 3 4 7l4 4",key:"9rb6wj"}],["path",{d:"M4 7h16",key:"6tx8e3"}],["path",{d:"m16 21 4-4-4-4",key:"siv7j2"}],["path",{d:"M20 17H4",key:"h6l3hr"}]],nP=Ee("arrow-left-right",tP);/**
|
|
145
|
-
* @license lucide-react v0.562.0 - ISC
|
|
146
|
-
*
|
|
147
|
-
* This source code is licensed under the ISC license.
|
|
148
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
149
|
-
*/const rP=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],iP=Ee("arrow-up",rP);/**
|
|
150
|
-
* @license lucide-react v0.562.0 - ISC
|
|
151
|
-
*
|
|
152
|
-
* This source code is licensed under the ISC license.
|
|
153
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
154
|
-
*/const sP=[["path",{d:"M12 6v12",key:"1vza4d"}],["path",{d:"M17.196 9 6.804 15",key:"1ah31z"}],["path",{d:"m6.804 9 10.392 6",key:"1b6pxd"}]],oP=Ee("asterisk",sP);/**
|
|
155
|
-
* @license lucide-react v0.562.0 - ISC
|
|
156
|
-
*
|
|
157
|
-
* This source code is licensed under the ISC license.
|
|
158
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
159
|
-
*/const aP=[["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}],["path",{d:"M8 11h8",key:"vwpz6n"}],["path",{d:"M8 7h6",key:"1f0q6e"}]],lP=Ee("book-text",aP);/**
|
|
160
|
-
* @license lucide-react v0.562.0 - ISC
|
|
161
|
-
*
|
|
162
|
-
* This source code is licensed under the ISC license.
|
|
163
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
164
|
-
*/const cP=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]],UC=Ee("box",cP);/**
|
|
165
|
-
* @license lucide-react v0.562.0 - ISC
|
|
166
|
-
*
|
|
167
|
-
* This source code is licensed under the ISC license.
|
|
168
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
169
|
-
*/const uP=[["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"}]],kv=Ee("brain",uP);/**
|
|
170
|
-
* @license lucide-react v0.562.0 - ISC
|
|
171
|
-
*
|
|
172
|
-
* This source code is licensed under the ISC license.
|
|
173
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
174
|
-
*/const dP=[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]],hP=Ee("check-check",dP);/**
|
|
175
|
-
* @license lucide-react v0.562.0 - ISC
|
|
176
|
-
*
|
|
177
|
-
* This source code is licensed under the ISC license.
|
|
178
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
179
|
-
*/const fP=[["path",{d:"M20 4L9 15",key:"1qkx8z"}],["path",{d:"M21 19L3 19",key:"100sma"}],["path",{d:"M9 15L4 10",key:"9zxff7"}]],pP=Ee("check-line",fP);/**
|
|
180
|
-
* @license lucide-react v0.562.0 - ISC
|
|
181
|
-
*
|
|
182
|
-
* This source code is licensed under the ISC license.
|
|
183
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
184
|
-
*/const mP=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],lo=Ee("check",mP);/**
|
|
185
|
-
* @license lucide-react v0.562.0 - ISC
|
|
186
|
-
*
|
|
187
|
-
* This source code is licensed under the ISC license.
|
|
188
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
189
|
-
*/const gP=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],wb=Ee("chevron-down",gP);/**
|
|
190
|
-
* @license lucide-react v0.562.0 - ISC
|
|
191
|
-
*
|
|
192
|
-
* This source code is licensed under the ISC license.
|
|
193
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
194
|
-
*/const vP=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],_P=Ee("chevron-left",vP);/**
|
|
195
|
-
* @license lucide-react v0.562.0 - ISC
|
|
196
|
-
*
|
|
197
|
-
* This source code is licensed under the ISC license.
|
|
198
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
199
|
-
*/const yP=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],fs=Ee("chevron-right",yP);/**
|
|
200
|
-
* @license lucide-react v0.562.0 - ISC
|
|
201
|
-
*
|
|
202
|
-
* This source code is licensed under the ISC license.
|
|
203
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
204
|
-
*/const bP=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],xP=Ee("chevron-up",bP);/**
|
|
205
|
-
* @license lucide-react v0.562.0 - ISC
|
|
206
|
-
*
|
|
207
|
-
* This source code is licensed under the ISC license.
|
|
208
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
209
|
-
*/const wP=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"9",x2:"15",y1:"15",y2:"9",key:"1dfufj"}]],SP=Ee("circle-slash",wP);/**
|
|
210
|
-
* @license lucide-react v0.562.0 - ISC
|
|
211
|
-
*
|
|
212
|
-
* This source code is licensed under the ISC license.
|
|
213
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
214
|
-
*/const CP=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],kP=Ee("circle",CP);/**
|
|
215
|
-
* @license lucide-react v0.562.0 - ISC
|
|
216
|
-
*
|
|
217
|
-
* This source code is licensed under the ISC license.
|
|
218
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
219
|
-
*/const EP=[["path",{d:"M12 13v8l-4-4",key:"1f5nwf"}],["path",{d:"m12 21 4-4",key:"1lfcce"}],["path",{d:"M4.393 15.269A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.436 8.284",key:"ui1hmy"}]],RP=Ee("cloud-download",EP);/**
|
|
220
|
-
* @license lucide-react v0.562.0 - ISC
|
|
221
|
-
*
|
|
222
|
-
* This source code is licensed under the ISC license.
|
|
223
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
224
|
-
*/const TP=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],$C=Ee("code-xml",TP);/**
|
|
225
|
-
* @license lucide-react v0.562.0 - ISC
|
|
226
|
-
*
|
|
227
|
-
* This source code is licensed under the ISC license.
|
|
228
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
229
|
-
*/const MP=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],Sb=Ee("code",MP);/**
|
|
230
|
-
* @license lucide-react v0.562.0 - ISC
|
|
231
|
-
*
|
|
232
|
-
* This source code is licensed under the ISC license.
|
|
233
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
234
|
-
*/const NP=[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]],AP=Ee("command",NP);/**
|
|
235
|
-
* @license lucide-react v0.562.0 - ISC
|
|
236
|
-
*
|
|
237
|
-
* This source code is licensed under the ISC license.
|
|
238
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
239
|
-
*/const DP=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Zu=Ee("copy",DP);/**
|
|
240
|
-
* @license lucide-react v0.562.0 - ISC
|
|
241
|
-
*
|
|
242
|
-
* This source code is licensed under the ISC license.
|
|
243
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
244
|
-
*/const OP=[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]],jP=Ee("corner-down-left",OP);/**
|
|
245
|
-
* @license lucide-react v0.562.0 - ISC
|
|
246
|
-
*
|
|
247
|
-
* This source code is licensed under the ISC license.
|
|
248
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
249
|
-
*/const LP=[["path",{d:"M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21",key:"g5wo59"}],["path",{d:"m5.082 11.09 8.828 8.828",key:"1wx5vj"}]],zP=Ee("eraser",LP);/**
|
|
250
|
-
* @license lucide-react v0.562.0 - ISC
|
|
251
|
-
*
|
|
252
|
-
* This source code is licensed under the ISC license.
|
|
253
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
254
|
-
*/const PP=[["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"}]],BP=Ee("external-link",PP);/**
|
|
255
|
-
* @license lucide-react v0.562.0 - ISC
|
|
256
|
-
*
|
|
257
|
-
* This source code is licensed under the ISC license.
|
|
258
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
259
|
-
*/const IP=[["path",{d:"M13.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v11.5",key:"4pqfef"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M8 12v-1",key:"1ej8lb"}],["path",{d:"M8 18v-2",key:"qcmpov"}],["path",{d:"M8 7V6",key:"1nbb54"}],["circle",{cx:"8",cy:"20",r:"2",key:"ckkr5m"}]],HP=Ee("file-archive",IP);/**
|
|
260
|
-
* @license lucide-react v0.562.0 - ISC
|
|
261
|
-
*
|
|
262
|
-
* This source code is licensed under the ISC license.
|
|
263
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
264
|
-
*/const FP=[["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"}]],UP=Ee("file-braces",FP);/**
|
|
265
|
-
* @license lucide-react v0.562.0 - ISC
|
|
266
|
-
*
|
|
267
|
-
* This source code is licensed under the ISC license.
|
|
268
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
269
|
-
*/const $P=[["path",{d:"M4 12.15V4a2 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 8v12a2 2 0 0 1-2 2h-3.35",key:"1wthlu"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m5 16-3 3 3 3",key:"331omg"}],["path",{d:"m9 22 3-3-3-3",key:"lsp7cz"}]],WP=Ee("file-code-corner",$P);/**
|
|
270
|
-
* @license lucide-react v0.562.0 - ISC
|
|
271
|
-
*
|
|
272
|
-
* This source code is licensed under the ISC license.
|
|
273
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
274
|
-
*/const VP=[["path",{d:"M4 6.835V4a2 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 8v12a2 2 0 0 1-2 2h-.343",key:"1vfytu"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M2 19a2 2 0 0 1 4 0v1a2 2 0 0 1-4 0v-4a6 6 0 0 1 12 0v4a2 2 0 0 1-4 0v-1a2 2 0 0 1 4 0",key:"1etmh7"}]],qP=Ee("file-headphone",VP);/**
|
|
275
|
-
* @license lucide-react v0.562.0 - ISC
|
|
276
|
-
*
|
|
277
|
-
* This source code is licensed under the ISC license.
|
|
278
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
279
|
-
*/const KP=[["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:"10",cy:"12",r:"2",key:"737tya"}],["path",{d:"m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22",key:"wt3hpn"}]],ET=Ee("file-image",KP);/**
|
|
280
|
-
* @license lucide-react v0.562.0 - ISC
|
|
281
|
-
*
|
|
282
|
-
* This source code is licensed under the ISC license.
|
|
283
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
284
|
-
*/const GP=[["path",{d:"M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34",key:"o6klzx"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z",key:"zhnas1"}]],YP=Ee("file-pen",GP);/**
|
|
285
|
-
* @license lucide-react v0.562.0 - ISC
|
|
286
|
-
*
|
|
287
|
-
* This source code is licensed under the ISC license.
|
|
288
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
289
|
-
*/const XP=[["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"}]],ZP=Ee("file-plus-corner",XP);/**
|
|
290
|
-
* @license lucide-react v0.562.0 - ISC
|
|
291
|
-
*
|
|
292
|
-
* This source code is licensed under the ISC license.
|
|
293
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
294
|
-
*/const QP=[["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:"M8 13h2",key:"yr2amv"}],["path",{d:"M14 13h2",key:"un5t4a"}],["path",{d:"M8 17h2",key:"2yhykz"}],["path",{d:"M14 17h2",key:"10kma7"}]],JP=Ee("file-spreadsheet",QP);/**
|
|
295
|
-
* @license lucide-react v0.562.0 - ISC
|
|
296
|
-
*
|
|
297
|
-
* This source code is licensed under the ISC license.
|
|
298
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
299
|
-
*/const eB=[["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"}]],tB=Ee("file-text",eB);/**
|
|
300
|
-
* @license lucide-react v0.562.0 - ISC
|
|
301
|
-
*
|
|
302
|
-
* This source code is licensed under the ISC license.
|
|
303
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
304
|
-
*/const nB=[["path",{d:"M4 12V4a2 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 8v12a2 2 0 0 1-2 2",key:"jrl274"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m10 17.843 3.033-1.755a.64.64 0 0 1 .967.56v4.704a.65.65 0 0 1-.967.56L10 20.157",key:"17aeo9"}],["rect",{width:"7",height:"6",x:"3",y:"16",rx:"1",key:"s27ndx"}]],rB=Ee("file-video-camera",nB);/**
|
|
305
|
-
* @license lucide-react v0.562.0 - ISC
|
|
306
|
-
*
|
|
307
|
-
* This source code is licensed under the ISC license.
|
|
308
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
309
|
-
*/const iB=[["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"}]],RT=Ee("file",iB);/**
|
|
310
|
-
* @license lucide-react v0.562.0 - ISC
|
|
311
|
-
*
|
|
312
|
-
* This source code is licensed under the ISC license.
|
|
313
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
314
|
-
*/const sB=[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["path",{d:"M12 16.5A4.5 4.5 0 1 1 7.5 12 4.5 4.5 0 1 1 12 7.5a4.5 4.5 0 1 1 4.5 4.5 4.5 4.5 0 1 1-4.5 4.5",key:"14wa3c"}],["path",{d:"M12 7.5V9",key:"1oy5b0"}],["path",{d:"M7.5 12H9",key:"eltsq1"}],["path",{d:"M16.5 12H15",key:"vk5kw4"}],["path",{d:"M12 16.5V15",key:"k7eayi"}],["path",{d:"m8 8 1.88 1.88",key:"nxy4qf"}],["path",{d:"M14.12 9.88 16 8",key:"1lst6k"}],["path",{d:"m8 16 1.88-1.88",key:"h2eex1"}],["path",{d:"M14.12 14.12 16 16",key:"uqkrx3"}]],yu=Ee("flower",sB);/**
|
|
315
|
-
* @license lucide-react v0.562.0 - ISC
|
|
316
|
-
*
|
|
317
|
-
* This source code is licensed under the ISC license.
|
|
318
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
319
|
-
*/const oB=[["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"}]],Cb=Ee("folder-open",oB);/**
|
|
320
|
-
* @license lucide-react v0.562.0 - ISC
|
|
321
|
-
*
|
|
322
|
-
* This source code is licensed under the ISC license.
|
|
323
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
324
|
-
*/const aB=[["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=Ee("folder",aB);/**
|
|
325
|
-
* @license lucide-react v0.562.0 - ISC
|
|
326
|
-
*
|
|
327
|
-
* This source code is licensed under the ISC license.
|
|
328
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
329
|
-
*/const cB=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],zh=Ee("gauge",cB);/**
|
|
330
|
-
* @license lucide-react v0.562.0 - ISC
|
|
331
|
-
*
|
|
332
|
-
* This source code is licensed under the ISC license.
|
|
333
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
334
|
-
*/const uB=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],dB=Ee("info",uB);/**
|
|
335
|
-
* @license lucide-react v0.562.0 - ISC
|
|
336
|
-
*
|
|
337
|
-
* This source code is licensed under the ISC license.
|
|
338
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
339
|
-
*/const hB=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],fB=Ee("link-2",hB);/**
|
|
340
|
-
* @license lucide-react v0.562.0 - ISC
|
|
341
|
-
*
|
|
342
|
-
* This source code is licensed under the ISC license.
|
|
343
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
344
|
-
*/const pB=[["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"}]],mB=Ee("list-checks",pB);/**
|
|
345
|
-
* @license lucide-react v0.562.0 - ISC
|
|
346
|
-
*
|
|
347
|
-
* This source code is licensed under the ISC license.
|
|
348
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
349
|
-
*/const gB=[["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"}],["rect",{x:"3",y:"4",width:"6",height:"6",rx:"1",key:"cif1o7"}]],Of=Ee("list-todo",gB);/**
|
|
350
|
-
* @license lucide-react v0.562.0 - ISC
|
|
351
|
-
*
|
|
352
|
-
* This source code is licensed under the ISC license.
|
|
353
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
354
|
-
*/const vB=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],ji=Ee("loader-circle",vB);/**
|
|
355
|
-
* @license lucide-react v0.562.0 - ISC
|
|
356
|
-
*
|
|
357
|
-
* This source code is licensed under the ISC license.
|
|
358
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
359
|
-
*/const _B=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 9.9-1",key:"1mm8w8"}]],WC=Ee("lock-open",_B);/**
|
|
360
|
-
* @license lucide-react v0.562.0 - ISC
|
|
361
|
-
*
|
|
362
|
-
* This source code is licensed under the ISC license.
|
|
363
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
364
|
-
*/const yB=[["path",{d:"M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z",key:"169xi5"}],["path",{d:"M15 5.764v15",key:"1pn4in"}],["path",{d:"M9 3.236v15",key:"1uimfh"}]],VC=Ee("map",yB);/**
|
|
365
|
-
* @license lucide-react v0.562.0 - ISC
|
|
366
|
-
*
|
|
367
|
-
* This source code is licensed under the ISC license.
|
|
368
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
369
|
-
*/const bB=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],kb=Ee("menu",bB);/**
|
|
370
|
-
* @license lucide-react v0.562.0 - ISC
|
|
371
|
-
*
|
|
372
|
-
* This source code is licensed under the ISC license.
|
|
373
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
374
|
-
*/const xB=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],TT=Ee("message-circle-question-mark",xB);/**
|
|
375
|
-
* @license lucide-react v0.562.0 - ISC
|
|
376
|
-
*
|
|
377
|
-
* This source code is licensed under the ISC license.
|
|
378
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
379
|
-
*/const wB=[["path",{d:"M14 14a2 2 0 0 0 2-2V8h-2",key:"1r06pg"}],["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"}],["path",{d:"M8 14a2 2 0 0 0 2-2V8H8",key:"1jzu5j"}]],SB=Ee("message-square-quote",wB);/**
|
|
380
|
-
* @license lucide-react v0.562.0 - ISC
|
|
381
|
-
*
|
|
382
|
-
* This source code is licensed under the ISC license.
|
|
383
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
384
|
-
*/const CB=[["path",{d:"M8 3v3a2 2 0 0 1-2 2H3",key:"hohbtr"}],["path",{d:"M21 8h-3a2 2 0 0 1-2-2V3",key:"5jw1f3"}],["path",{d:"M3 16h3a2 2 0 0 1 2 2v3",key:"198tvr"}],["path",{d:"M16 21v-3a2 2 0 0 1 2-2h3",key:"ph8mxp"}]],MT=Ee("minimize",CB);/**
|
|
385
|
-
* @license lucide-react v0.562.0 - ISC
|
|
386
|
-
*
|
|
387
|
-
* This source code is licensed under the ISC license.
|
|
388
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
389
|
-
*/const kB=[["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"}]],Eb=Ee("monitor",kB);/**
|
|
390
|
-
* @license lucide-react v0.562.0 - ISC
|
|
391
|
-
*
|
|
392
|
-
* This source code is licensed under the ISC license.
|
|
393
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
394
|
-
*/const EB=[["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"}]],RB=Ee("moon",EB);/**
|
|
395
|
-
* @license lucide-react v0.562.0 - ISC
|
|
396
|
-
*
|
|
397
|
-
* This source code is licensed under the ISC license.
|
|
398
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
399
|
-
*/const TB=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],T_=Ee("panel-left",TB);/**
|
|
400
|
-
* @license lucide-react v0.562.0 - ISC
|
|
401
|
-
*
|
|
402
|
-
* This source code is licensed under the ISC license.
|
|
403
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
404
|
-
*/const MB=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]],NB=Ee("panel-right",MB);/**
|
|
405
|
-
* @license lucide-react v0.562.0 - ISC
|
|
406
|
-
*
|
|
407
|
-
* This source code is licensed under the ISC license.
|
|
408
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
409
|
-
*/const AB=[["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"}]],DB=Ee("paperclip",AB);/**
|
|
410
|
-
* @license lucide-react v0.562.0 - ISC
|
|
411
|
-
*
|
|
412
|
-
* This source code is licensed under the ISC license.
|
|
413
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
414
|
-
*/const OB=[["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"}]],NT=Ee("pencil",OB);/**
|
|
415
|
-
* @license lucide-react v0.562.0 - ISC
|
|
416
|
-
*
|
|
417
|
-
* This source code is licensed under the ISC license.
|
|
418
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
419
|
-
*/const jB=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Rb=Ee("plus",jB);/**
|
|
420
|
-
* @license lucide-react v0.562.0 - ISC
|
|
421
|
-
*
|
|
422
|
-
* This source code is licensed under the ISC license.
|
|
423
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
424
|
-
*/const LB=[["path",{d:"M13 16H8",key:"wsln4y"}],["path",{d:"M14 8H8",key:"1l3xfs"}],["path",{d:"M16 12H8",key:"1fr5h0"}],["path",{d:"M4 3a1 1 0 0 1 1-1 1.3 1.3 0 0 1 .7.2l.933.6a1.3 1.3 0 0 0 1.4 0l.934-.6a1.3 1.3 0 0 1 1.4 0l.933.6a1.3 1.3 0 0 0 1.4 0l.933-.6a1.3 1.3 0 0 1 1.4 0l.934.6a1.3 1.3 0 0 0 1.4 0l.933-.6A1.3 1.3 0 0 1 19 2a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1 1.3 1.3 0 0 1-.7-.2l-.933-.6a1.3 1.3 0 0 0-1.4 0l-.934.6a1.3 1.3 0 0 1-1.4 0l-.933-.6a1.3 1.3 0 0 0-1.4 0l-.933.6a1.3 1.3 0 0 1-1.4 0l-.934-.6a1.3 1.3 0 0 0-1.4 0l-.933.6a1.3 1.3 0 0 1-.7.2 1 1 0 0 1-1-1z",key:"ycz6yz"}]],zB=Ee("receipt-text",LB);/**
|
|
425
|
-
* @license lucide-react v0.562.0 - ISC
|
|
426
|
-
*
|
|
427
|
-
* This source code is licensed under the ISC license.
|
|
428
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
429
|
-
*/const PB=[["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"}]],BB=Ee("refresh-cw",PB);/**
|
|
430
|
-
* @license lucide-react v0.562.0 - ISC
|
|
431
|
-
*
|
|
432
|
-
* This source code is licensed under the ISC license.
|
|
433
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
434
|
-
*/const IB=[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]],HB=Ee("scroll-text",IB);/**
|
|
435
|
-
* @license lucide-react v0.562.0 - ISC
|
|
436
|
-
*
|
|
437
|
-
* This source code is licensed under the ISC license.
|
|
438
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
439
|
-
*/const FB=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Ev=Ee("search",FB);/**
|
|
440
|
-
* @license lucide-react v0.562.0 - ISC
|
|
441
|
-
*
|
|
442
|
-
* This source code is licensed under the ISC license.
|
|
443
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
444
|
-
*/const UB=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],$B=Ee("send",UB);/**
|
|
445
|
-
* @license lucide-react v0.562.0 - ISC
|
|
446
|
-
*
|
|
447
|
-
* This source code is licensed under the ISC license.
|
|
448
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
449
|
-
*/const WB=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],VB=Ee("settings",WB);/**
|
|
450
|
-
* @license lucide-react v0.562.0 - ISC
|
|
451
|
-
*
|
|
452
|
-
* This source code is licensed under the ISC license.
|
|
453
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
454
|
-
*/const qB=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],KB=Ee("settings-2",qB);/**
|
|
455
|
-
* @license lucide-react v0.562.0 - ISC
|
|
456
|
-
*
|
|
457
|
-
* This source code is licensed under the ISC license.
|
|
458
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
459
|
-
*/const GB=[["path",{d:"M22 2 2 22",key:"y4kqgn"}]],YB=Ee("slash",GB);/**
|
|
460
|
-
* @license lucide-react v0.562.0 - ISC
|
|
461
|
-
*
|
|
462
|
-
* This source code is licensed under the ISC license.
|
|
463
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
464
|
-
*/const XB=[["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"}]],ZB=Ee("sparkles",XB);/**
|
|
465
|
-
* @license lucide-react v0.562.0 - ISC
|
|
466
|
-
*
|
|
467
|
-
* This source code is licensed under the ISC license.
|
|
468
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
469
|
-
*/const QB=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M7 8h10",key:"1jw688"}],["path",{d:"M7 12h10",key:"b7w52i"}],["path",{d:"M7 16h10",key:"wp8him"}]],qC=Ee("square-menu",QB);/**
|
|
470
|
-
* @license lucide-react v0.562.0 - ISC
|
|
471
|
-
*
|
|
472
|
-
* This source code is licensed under the ISC license.
|
|
473
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
474
|
-
*/const JB=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M8 12h8",key:"1wcyev"}]],KC=Ee("square-minus",JB);/**
|
|
475
|
-
* @license lucide-react v0.562.0 - ISC
|
|
476
|
-
*
|
|
477
|
-
* This source code is licensed under the ISC license.
|
|
478
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
479
|
-
*/const eI=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],Tb=Ee("square-pen",eI);/**
|
|
480
|
-
* @license lucide-react v0.562.0 - ISC
|
|
481
|
-
*
|
|
482
|
-
* This source code is licensed under the ISC license.
|
|
483
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
484
|
-
*/const tI=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],nI=Ee("square-x",tI);/**
|
|
485
|
-
* @license lucide-react v0.562.0 - ISC
|
|
486
|
-
*
|
|
487
|
-
* This source code is licensed under the ISC license.
|
|
488
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
489
|
-
*/const rI=[["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"}]],iI=Ee("sun",rI);/**
|
|
490
|
-
* @license lucide-react v0.562.0 - ISC
|
|
491
|
-
*
|
|
492
|
-
* This source code is licensed under the ISC license.
|
|
493
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
494
|
-
*/const sI=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],Mb=Ee("terminal",sI);/**
|
|
495
|
-
* @license lucide-react v0.562.0 - ISC
|
|
496
|
-
*
|
|
497
|
-
* This source code is licensed under the ISC license.
|
|
498
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
499
|
-
*/const oI=[["rect",{width:"18",height:"12",x:"3",y:"8",rx:"1",key:"158fvp"}],["path",{d:"M10 8V5c0-.6-.4-1-1-1H6a1 1 0 0 0-1 1v3",key:"s0042v"}],["path",{d:"M19 8V5c0-.6-.4-1-1-1h-3a1 1 0 0 0-1 1v3",key:"9wmeh2"}]],aI=Ee("toy-brick",oI);/**
|
|
500
|
-
* @license lucide-react v0.562.0 - ISC
|
|
501
|
-
*
|
|
502
|
-
* This source code is licensed under the ISC license.
|
|
503
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
504
|
-
*/const lI=[["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"}]],cI=Ee("trash-2",lI);/**
|
|
505
|
-
* @license lucide-react v0.562.0 - ISC
|
|
506
|
-
*
|
|
507
|
-
* This source code is licensed under the ISC license.
|
|
508
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
509
|
-
*/const uI=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],dI=Ee("upload",uI);/**
|
|
510
|
-
* @license lucide-react v0.562.0 - ISC
|
|
511
|
-
*
|
|
512
|
-
* This source code is licensed under the ISC license.
|
|
513
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
514
|
-
*/const hI=[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]],Nb=Ee("user-round",hI);/**
|
|
515
|
-
* @license lucide-react v0.562.0 - ISC
|
|
516
|
-
*
|
|
517
|
-
* This source code is licensed under the ISC license.
|
|
518
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
519
|
-
*/const fI=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],ca=Ee("x",fI),Nu="data-focus-fallback-ignore",AT="data-allow-focus-retain",jf="kanna:restore-chat-input-focus",Ab="data-chat-input",Lf="data-chat-selection-zone";function qo(e,t){return!!(e!=null&&e.closest(`[${t}]`))}function DT(e){var n;const t=e;return t!=null&&t.matches?t.matches("input:not([type='checkbox']):not([type='radio']):not([type='button']):not([type='submit']):not([type='reset']), textarea, select")||t.isContentEditable||((n=t.getAttribute)==null?void 0:n.call(t,"role"))==="textbox"?!0:qo(e,AT):!1}function pI(e){const t=e;return t!=null&&t.matches?DT(e)||(t.tabIndex??-1)>=0||t.matches("button, a[href], summary")?!0:qo(e,AT):!1}function GC(e){return!!e.querySelector(`[${Nu}][data-state='open']`)}function mI(e){return e?!e.isCollapsed&&e.toString().trim().length>0:!1}function gI(e,t){if(!e)return!1;const n=Array.from(t.querySelectorAll(`textarea[${Ab}]`)).filter(l=>!l.disabled);if(n.length===0)return!1;const r=n.indexOf(e),s=r>=0?(r+1)%n.length:0,a=n[s];return a?(a.focus({preventScroll:!0}),!0):!1}function YC(e){const{activeElement:t,fallback:n,hasActiveOverlay:r}=e;if(!n||n.disabled||r||t===n)return"none";if(e.trigger==="escape")return e.defaultPrevented||qo(t,Ab)||e.canCancel?"none":"escape-focus";const{pointerStartTarget:s,pointerEndTarget:a,root:l,hasActiveSelection:u}=e,h=a??s;return!l||!h||!l.contains(h)||qo(h,Nu)||qo(t,Nu)||u&&(qo(s,Lf)||qo(h,Lf))||DT(t)?"none":t&&t===h?"restore":pI(t)?"none":"restore"}const Db=I6,vI=H6,OT=y.forwardRef(({className:e,...t},n)=>p.jsx(ST,{ref:n,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}));OT.displayName=ST.displayName;const _I={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg"},yp=y.forwardRef(({className:e,children:t,size:n="md",...r},s)=>p.jsxs(vI,{children:[p.jsx(OT,{}),p.jsxs(CT,{ref:s,[Nu]:"",onCloseAutoFocus:a=>{var l;a.preventDefault(),window.dispatchEvent(new Event(jf)),(l=r.onCloseAutoFocus)==null||l.call(r,a)},className:ye("fixed left-1/2 top-1/2 z-50 w-full -translate-x-1/2 -translate-y-1/2 rounded-xl border border-border bg-background shadow-xl duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]","max-h-[85vh] flex flex-col",_I[n],e),...r,children:[t,p.jsxs($6,{className:"absolute right-4 top-4 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 data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[p.jsx(ca,{className:"h-4 w-4"}),p.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));yp.displayName=CT.displayName;function yI({className:e,...t}){return p.jsx("div",{className:ye("shrink-0 flex flex-col space-y-1.5 p-4 border-b border-border",e),...t})}function Ob({className:e,...t}){return p.jsx(F6,{className:ye("text-lg font-medium leading-none tracking-tight",e),...t})}function jT({className:e,...t}){return p.jsx(U6,{className:ye("text-sm text-muted-foreground",e),...t})}function jb({className:e,...t}){return p.jsx("div",{className:ye("flex-1 min-h-0 overflow-y-auto px-4 pb-4 pt-3.5",e),...t})}function Lb({className:e,...t}){return p.jsx("div",{className:ye("shrink-0 flex justify-end gap-2 border-t border-border bg-background p-2 rounded-b-xl",e),...t})}function bI({className:e,...t}){return p.jsx("button",{className:ye("touch-manipulation inline-flex items-center justify-center whitespace-nowrap cursor-pointer text-sm font-medium transition-colors","rounded-full h-9 px-4","hover:bg-accent dark:hover:bg-card hover:text-accent-foreground text-muted-foreground","disabled:pointer-events-none disabled:text-muted-foreground/50",e),...t})}const io=y.forwardRef(({className:e,type:t,...n},r)=>p.jsx("input",{ref:r,type:t,className:ye("flex w-full rounded-lg border border-border bg-background px-3 py-2 text-sm text-foreground outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...n}));io.displayName="Input";const LT=y.createContext(null);function xI({children:e}){const[t,n]=y.useState(null),[r,s]=y.useState(""),a=y.useRef(null);y.useEffect(()=>{(t==null?void 0:t.kind)==="prompt"&&(s(t.options.initialValue??""),setTimeout(()=>{var b,w;(b=a.current)==null||b.focus(),(w=a.current)==null||w.select()},0))},[t]);const l=y.useCallback(()=>{n(null),s("")},[]),u=y.useCallback(()=>{t&&(t.kind==="confirm"?t.resolve(!1):t.kind==="prompt"?t.resolve(null):t.resolve(),l())},[l,t]),h=y.useCallback(()=>{t&&(t.kind==="confirm"?t.resolve(!0):t.kind==="prompt"?t.resolve(r.trim()||null):t.resolve(),l())},[l,t,r]),d=y.useCallback(b=>new Promise(w=>{n({kind:"confirm",options:b,resolve:w})}),[]),m=y.useCallback(b=>new Promise(w=>{n({kind:"prompt",options:b,resolve:w})}),[]),g=y.useCallback(b=>new Promise(w=>{n({kind:"alert",options:b,resolve:w})}),[]),_=y.useMemo(()=>({confirm:d,prompt:m,alert:g}),[g,d,m]);return p.jsxs(LT.Provider,{value:_,children:[e,p.jsx(Db,{open:t!==null,onOpenChange:b=>{b||!t||u()},children:p.jsx(yp,{size:"sm",onKeyDown:b=>{b.key!=="Enter"||b.shiftKey||!t||t.kind!=="confirm"||(b.preventDefault(),h())},children:t?p.jsxs(p.Fragment,{children:[p.jsxs(jb,{className:"space-y-4",children:[p.jsx(Ob,{children:t.options.title}),t.options.description?p.jsx(jT,{children:t.options.description}):null,t.kind==="prompt"?p.jsx(io,{ref:a,type:"text",value:r,onChange:b=>s(b.target.value),onKeyDown:b=>{b.key==="Enter"&&(b.preventDefault(),h())},placeholder:t.options.placeholder}):null]}),p.jsxs(Lb,{children:[p.jsx(tt,{variant:"ghost",size:"sm",onClick:u,className:t.kind==="alert"?"hidden":void 0,children:"cancelLabel"in t.options?t.options.cancelLabel??"Cancel":"Cancel"}),p.jsx(tt,{variant:t.kind==="confirm"?t.options.confirmVariant??"default":"secondary",size:"sm",onClick:h,disabled:t.kind==="prompt"&&!r.trim(),children:t.kind==="alert"?t.options.closeLabel??"OK":"confirmLabel"in t.options?t.options.confirmLabel??"Confirm":"Confirm"})]})]}):null})})]})}function wI(){const e=y.useContext(LT);if(!e)throw new Error("useAppDialog must be used within AppDialogProvider");return e}const SI=["top","right","bottom","left"],co=Math.min,Tr=Math.max,zf=Math.round,Ph=Math.floor,Di=e=>({x:e,y:e}),CI={left:"right",right:"left",bottom:"top",top:"bottom"};function M_(e,t,n){return Tr(e,co(t,n))}function ps(e,t){return typeof e=="function"?e(t):e}function ms(e){return e.split("-")[0]}function Hl(e){return e.split("-")[1]}function zb(e){return e==="x"?"y":"x"}function Pb(e){return e==="y"?"height":"width"}function Ti(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Bb(e){return zb(Ti(e))}function kI(e,t,n){n===void 0&&(n=!1);const r=Hl(e),s=Bb(e),a=Pb(s);let l=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(l=Pf(l)),[l,Pf(l)]}function EI(e){const t=Pf(e);return[N_(e),t,N_(t)]}function N_(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const XC=["left","right"],ZC=["right","left"],RI=["top","bottom"],TI=["bottom","top"];function MI(e,t,n){switch(e){case"top":case"bottom":return n?t?ZC:XC:t?XC:ZC;case"left":case"right":return t?RI:TI;default:return[]}}function NI(e,t,n,r){const s=Hl(e);let a=MI(ms(e),n==="start",r);return s&&(a=a.map(l=>l+"-"+s),t&&(a=a.concat(a.map(N_)))),a}function Pf(e){const t=ms(e);return CI[t]+e.slice(t.length)}function AI(e){return{top:0,right:0,bottom:0,left:0,...e}}function zT(e){return typeof e!="number"?AI(e):{top:e,right:e,bottom:e,left:e}}function Bf(e){const{x:t,y:n,width:r,height:s}=e;return{width:r,height:s,top:n,left:t,right:t+r,bottom:n+s,x:t,y:n}}function QC(e,t,n){let{reference:r,floating:s}=e;const a=Ti(t),l=Bb(t),u=Pb(l),h=ms(t),d=a==="y",m=r.x+r.width/2-s.width/2,g=r.y+r.height/2-s.height/2,_=r[u]/2-s[u]/2;let b;switch(h){case"top":b={x:m,y:r.y-s.height};break;case"bottom":b={x:m,y:r.y+r.height};break;case"right":b={x:r.x+r.width,y:g};break;case"left":b={x:r.x-s.width,y:g};break;default:b={x:r.x,y:r.y}}switch(Hl(t)){case"start":b[l]-=_*(n&&d?-1:1);break;case"end":b[l]+=_*(n&&d?-1:1);break}return b}async function DI(e,t){var n;t===void 0&&(t={});const{x:r,y:s,platform:a,rects:l,elements:u,strategy:h}=e,{boundary:d="clippingAncestors",rootBoundary:m="viewport",elementContext:g="floating",altBoundary:_=!1,padding:b=0}=ps(t,e),w=zT(b),C=u[_?g==="floating"?"reference":"floating":g],k=Bf(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(C)))==null||n?C:C.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(u.floating)),boundary:d,rootBoundary:m,strategy:h})),R=g==="floating"?{x:r,y:s,width:l.floating.width,height:l.floating.height}:l.reference,T=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u.floating)),N=await(a.isElement==null?void 0:a.isElement(T))?await(a.getScale==null?void 0:a.getScale(T))||{x:1,y:1}:{x:1,y:1},L=Bf(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:R,offsetParent:T,strategy:h}):R);return{top:(k.top-L.top+w.top)/N.y,bottom:(L.bottom-k.bottom+w.bottom)/N.y,left:(k.left-L.left+w.left)/N.x,right:(L.right-k.right+w.right)/N.x}}const OI=50,jI=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:a=[],platform:l}=n,u=l.detectOverflow?l:{...l,detectOverflow:DI},h=await(l.isRTL==null?void 0:l.isRTL(t));let d=await l.getElementRects({reference:e,floating:t,strategy:s}),{x:m,y:g}=QC(d,r,h),_=r,b=0;const w={};for(let S=0;S<a.length;S++){const C=a[S];if(!C)continue;const{name:k,fn:R}=C,{x:T,y:N,data:L,reset:A}=await R({x:m,y:g,initialPlacement:r,placement:_,strategy:s,middlewareData:w,rects:d,platform:u,elements:{reference:e,floating:t}});m=T??m,g=N??g,w[k]={...w[k],...L},A&&b<OI&&(b++,typeof A=="object"&&(A.placement&&(_=A.placement),A.rects&&(d=A.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:s}):A.rects),{x:m,y:g}=QC(d,_,h)),S=-1)}return{x:m,y:g,placement:_,strategy:s,middlewareData:w}},LI=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:s,rects:a,platform:l,elements:u,middlewareData:h}=t,{element:d,padding:m=0}=ps(e,t)||{};if(d==null)return{};const g=zT(m),_={x:n,y:r},b=Bb(s),w=Pb(b),S=await l.getDimensions(d),C=b==="y",k=C?"top":"left",R=C?"bottom":"right",T=C?"clientHeight":"clientWidth",N=a.reference[w]+a.reference[b]-_[b]-a.floating[w],L=_[b]-a.reference[b],A=await(l.getOffsetParent==null?void 0:l.getOffsetParent(d));let O=A?A[T]:0;(!O||!await(l.isElement==null?void 0:l.isElement(A)))&&(O=u.floating[T]||a.floating[w]);const F=N/2-L/2,G=O/2-S[w]/2-1,B=co(g[k],G),H=co(g[R],G),P=B,U=O-S[w]-H,V=O/2-S[w]/2+F,W=M_(P,V,U),z=!h.arrow&&Hl(s)!=null&&V!==W&&a.reference[w]/2-(V<P?B:H)-S[w]/2<0,$=z?V<P?V-P:V-U:0;return{[b]:_[b]+$,data:{[b]:W,centerOffset:V-W-$,...z&&{alignmentOffset:$}},reset:z}}}),zI=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:s,middlewareData:a,rects:l,initialPlacement:u,platform:h,elements:d}=t,{mainAxis:m=!0,crossAxis:g=!0,fallbackPlacements:_,fallbackStrategy:b="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:S=!0,...C}=ps(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const k=ms(s),R=Ti(u),T=ms(u)===u,N=await(h.isRTL==null?void 0:h.isRTL(d.floating)),L=_||(T||!S?[Pf(u)]:EI(u)),A=w!=="none";!_&&A&&L.push(...NI(u,S,w,N));const O=[u,...L],F=await h.detectOverflow(t,C),G=[];let B=((r=a.flip)==null?void 0:r.overflows)||[];if(m&&G.push(F[k]),g){const V=kI(s,l,N);G.push(F[V[0]],F[V[1]])}if(B=[...B,{placement:s,overflows:G}],!G.every(V=>V<=0)){var H,P;const V=(((H=a.flip)==null?void 0:H.index)||0)+1,W=O[V];if(W&&(!(g==="alignment"?R!==Ti(W):!1)||B.every(q=>Ti(q.placement)===R?q.overflows[0]>0:!0)))return{data:{index:V,overflows:B},reset:{placement:W}};let z=(P=B.filter($=>$.overflows[0]<=0).sort(($,q)=>$.overflows[1]-q.overflows[1])[0])==null?void 0:P.placement;if(!z)switch(b){case"bestFit":{var U;const $=(U=B.filter(q=>{if(A){const Q=Ti(q.placement);return Q===R||Q==="y"}return!0}).map(q=>[q.placement,q.overflows.filter(Q=>Q>0).reduce((Q,M)=>Q+M,0)]).sort((q,Q)=>q[1]-Q[1])[0])==null?void 0:U[0];$&&(z=$);break}case"initialPlacement":z=u;break}if(s!==z)return{reset:{placement:z}}}return{}}}};function JC(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function e2(e){return SI.some(t=>e[t]>=0)}const PI=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:s="referenceHidden",...a}=ps(e,t);switch(s){case"referenceHidden":{const l=await r.detectOverflow(t,{...a,elementContext:"reference"}),u=JC(l,n.reference);return{data:{referenceHiddenOffsets:u,referenceHidden:e2(u)}}}case"escaped":{const l=await r.detectOverflow(t,{...a,altBoundary:!0}),u=JC(l,n.floating);return{data:{escapedOffsets:u,escaped:e2(u)}}}default:return{}}}}},PT=new Set(["left","top"]);async function BI(e,t){const{placement:n,platform:r,elements:s}=e,a=await(r.isRTL==null?void 0:r.isRTL(s.floating)),l=ms(n),u=Hl(n),h=Ti(n)==="y",d=PT.has(l)?-1:1,m=a&&h?-1:1,g=ps(t,e);let{mainAxis:_,crossAxis:b,alignmentAxis:w}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return u&&typeof w=="number"&&(b=u==="end"?w*-1:w),h?{x:b*m,y:_*d}:{x:_*d,y:b*m}}const II=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:a,placement:l,middlewareData:u}=t,h=await BI(t,e);return l===((n=u.offset)==null?void 0:n.placement)&&(r=u.arrow)!=null&&r.alignmentOffset?{}:{x:s+h.x,y:a+h.y,data:{...h,placement:l}}}}},HI=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s,platform:a}=t,{mainAxis:l=!0,crossAxis:u=!1,limiter:h={fn:k=>{let{x:R,y:T}=k;return{x:R,y:T}}},...d}=ps(e,t),m={x:n,y:r},g=await a.detectOverflow(t,d),_=Ti(ms(s)),b=zb(_);let w=m[b],S=m[_];if(l){const k=b==="y"?"top":"left",R=b==="y"?"bottom":"right",T=w+g[k],N=w-g[R];w=M_(T,w,N)}if(u){const k=_==="y"?"top":"left",R=_==="y"?"bottom":"right",T=S+g[k],N=S-g[R];S=M_(T,S,N)}const C=h.fn({...t,[b]:w,[_]:S});return{...C,data:{x:C.x-n,y:C.y-r,enabled:{[b]:l,[_]:u}}}}}},FI=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:s,rects:a,middlewareData:l}=t,{offset:u=0,mainAxis:h=!0,crossAxis:d=!0}=ps(e,t),m={x:n,y:r},g=Ti(s),_=zb(g);let b=m[_],w=m[g];const S=ps(u,t),C=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:0,crossAxis:0,...S};if(h){const T=_==="y"?"height":"width",N=a.reference[_]-a.floating[T]+C.mainAxis,L=a.reference[_]+a.reference[T]-C.mainAxis;b<N?b=N:b>L&&(b=L)}if(d){var k,R;const T=_==="y"?"width":"height",N=PT.has(ms(s)),L=a.reference[g]-a.floating[T]+(N&&((k=l.offset)==null?void 0:k[g])||0)+(N?0:C.crossAxis),A=a.reference[g]+a.reference[T]+(N?0:((R=l.offset)==null?void 0:R[g])||0)-(N?C.crossAxis:0);w<L?w=L:w>A&&(w=A)}return{[_]:b,[g]:w}}}},UI=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:s,rects:a,platform:l,elements:u}=t,{apply:h=()=>{},...d}=ps(e,t),m=await l.detectOverflow(t,d),g=ms(s),_=Hl(s),b=Ti(s)==="y",{width:w,height:S}=a.floating;let C,k;g==="top"||g==="bottom"?(C=g,k=_===(await(l.isRTL==null?void 0:l.isRTL(u.floating))?"start":"end")?"left":"right"):(k=g,C=_==="end"?"top":"bottom");const R=S-m.top-m.bottom,T=w-m.left-m.right,N=co(S-m[C],R),L=co(w-m[k],T),A=!t.middlewareData.shift;let O=N,F=L;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(F=T),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(O=R),A&&!_){const B=Tr(m.left,0),H=Tr(m.right,0),P=Tr(m.top,0),U=Tr(m.bottom,0);b?F=w-2*(B!==0||H!==0?B+H:Tr(m.left,m.right)):O=S-2*(P!==0||U!==0?P+U:Tr(m.top,m.bottom))}await h({...t,availableWidth:F,availableHeight:O});const G=await l.getDimensions(u.floating);return w!==G.width||S!==G.height?{reset:{rects:!0}}:{}}}};function bp(){return typeof window<"u"}function Fl(e){return BT(e)?(e.nodeName||"").toLowerCase():"#document"}function Mr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Pi(e){var t;return(t=(BT(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function BT(e){return bp()?e instanceof Node||e instanceof Mr(e).Node:!1}function hi(e){return bp()?e instanceof Element||e instanceof Mr(e).Element:!1}function _s(e){return bp()?e instanceof HTMLElement||e instanceof Mr(e).HTMLElement:!1}function t2(e){return!bp()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Mr(e).ShadowRoot}function Qu(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=fi(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&s!=="inline"&&s!=="contents"}function $I(e){return/^(table|td|th)$/.test(Fl(e))}function xp(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const WI=/transform|translate|scale|rotate|perspective|filter/,VI=/paint|layout|strict|content/,Bo=e=>!!e&&e!=="none";let Rv;function Ib(e){const t=hi(e)?fi(e):e;return Bo(t.transform)||Bo(t.translate)||Bo(t.scale)||Bo(t.rotate)||Bo(t.perspective)||!Hb()&&(Bo(t.backdropFilter)||Bo(t.filter))||WI.test(t.willChange||"")||VI.test(t.contain||"")}function qI(e){let t=uo(e);for(;_s(t)&&!Tl(t);){if(Ib(t))return t;if(xp(t))return null;t=uo(t)}return null}function Hb(){return Rv==null&&(Rv=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Rv}function Tl(e){return/^(html|body|#document)$/.test(Fl(e))}function fi(e){return Mr(e).getComputedStyle(e)}function wp(e){return hi(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function uo(e){if(Fl(e)==="html")return e;const t=e.assignedSlot||e.parentNode||t2(e)&&e.host||Pi(e);return t2(t)?t.host:t}function IT(e){const t=uo(e);return Tl(t)?e.ownerDocument?e.ownerDocument.body:e.body:_s(t)&&Qu(t)?t:IT(t)}function Au(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=IT(e),a=s===((r=e.ownerDocument)==null?void 0:r.body),l=Mr(s);if(a){const u=A_(l);return t.concat(l,l.visualViewport||[],Qu(s)?s:[],u&&n?Au(u):[])}else return t.concat(s,Au(s,[],n))}function A_(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function HT(e){const t=fi(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=_s(e),a=s?e.offsetWidth:n,l=s?e.offsetHeight:r,u=zf(n)!==a||zf(r)!==l;return u&&(n=a,r=l),{width:n,height:r,$:u}}function Fb(e){return hi(e)?e:e.contextElement}function wl(e){const t=Fb(e);if(!_s(t))return Di(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:a}=HT(t);let l=(a?zf(n.width):n.width)/r,u=(a?zf(n.height):n.height)/s;return(!l||!Number.isFinite(l))&&(l=1),(!u||!Number.isFinite(u))&&(u=1),{x:l,y:u}}const KI=Di(0);function FT(e){const t=Mr(e);return!Hb()||!t.visualViewport?KI:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function GI(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Mr(e)?!1:t}function Jo(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),a=Fb(e);let l=Di(1);t&&(r?hi(r)&&(l=wl(r)):l=wl(e));const u=GI(a,n,r)?FT(a):Di(0);let h=(s.left+u.x)/l.x,d=(s.top+u.y)/l.y,m=s.width/l.x,g=s.height/l.y;if(a){const _=Mr(a),b=r&&hi(r)?Mr(r):r;let w=_,S=A_(w);for(;S&&r&&b!==w;){const C=wl(S),k=S.getBoundingClientRect(),R=fi(S),T=k.left+(S.clientLeft+parseFloat(R.paddingLeft))*C.x,N=k.top+(S.clientTop+parseFloat(R.paddingTop))*C.y;h*=C.x,d*=C.y,m*=C.x,g*=C.y,h+=T,d+=N,w=Mr(S),S=A_(w)}}return Bf({width:m,height:g,x:h,y:d})}function Sp(e,t){const n=wp(e).scrollLeft;return t?t.left+n:Jo(Pi(e)).left+n}function UT(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Sp(e,n),s=n.top+t.scrollTop;return{x:r,y:s}}function YI(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const a=s==="fixed",l=Pi(r),u=t?xp(t.floating):!1;if(r===l||u&&a)return n;let h={scrollLeft:0,scrollTop:0},d=Di(1);const m=Di(0),g=_s(r);if((g||!g&&!a)&&((Fl(r)!=="body"||Qu(l))&&(h=wp(r)),g)){const b=Jo(r);d=wl(r),m.x=b.x+r.clientLeft,m.y=b.y+r.clientTop}const _=l&&!g&&!a?UT(l,h):Di(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-h.scrollLeft*d.x+m.x+_.x,y:n.y*d.y-h.scrollTop*d.y+m.y+_.y}}function XI(e){return Array.from(e.getClientRects())}function ZI(e){const t=Pi(e),n=wp(e),r=e.ownerDocument.body,s=Tr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=Tr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+Sp(e);const u=-n.scrollTop;return fi(r).direction==="rtl"&&(l+=Tr(t.clientWidth,r.clientWidth)-s),{width:s,height:a,x:l,y:u}}const n2=25;function QI(e,t){const n=Mr(e),r=Pi(e),s=n.visualViewport;let a=r.clientWidth,l=r.clientHeight,u=0,h=0;if(s){a=s.width,l=s.height;const m=Hb();(!m||m&&t==="fixed")&&(u=s.offsetLeft,h=s.offsetTop)}const d=Sp(r);if(d<=0){const m=r.ownerDocument,g=m.body,_=getComputedStyle(g),b=m.compatMode==="CSS1Compat"&&parseFloat(_.marginLeft)+parseFloat(_.marginRight)||0,w=Math.abs(r.clientWidth-g.clientWidth-b);w<=n2&&(a-=w)}else d<=n2&&(a+=d);return{width:a,height:l,x:u,y:h}}function JI(e,t){const n=Jo(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,a=_s(e)?wl(e):Di(1),l=e.clientWidth*a.x,u=e.clientHeight*a.y,h=s*a.x,d=r*a.y;return{width:l,height:u,x:h,y:d}}function r2(e,t,n){let r;if(t==="viewport")r=QI(e,n);else if(t==="document")r=ZI(Pi(e));else if(hi(t))r=JI(t,n);else{const s=FT(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return Bf(r)}function $T(e,t){const n=uo(e);return n===t||!hi(n)||Tl(n)?!1:fi(n).position==="fixed"||$T(n,t)}function e8(e,t){const n=t.get(e);if(n)return n;let r=Au(e,[],!1).filter(u=>hi(u)&&Fl(u)!=="body"),s=null;const a=fi(e).position==="fixed";let l=a?uo(e):e;for(;hi(l)&&!Tl(l);){const u=fi(l),h=Ib(l);!h&&u.position==="fixed"&&(s=null),(a?!h&&!s:!h&&u.position==="static"&&!!s&&(s.position==="absolute"||s.position==="fixed")||Qu(l)&&!h&&$T(e,l))?r=r.filter(m=>m!==l):s=u,l=uo(l)}return t.set(e,r),r}function t8(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const l=[...n==="clippingAncestors"?xp(t)?[]:e8(t,this._c):[].concat(n),r],u=r2(t,l[0],s);let h=u.top,d=u.right,m=u.bottom,g=u.left;for(let _=1;_<l.length;_++){const b=r2(t,l[_],s);h=Tr(b.top,h),d=co(b.right,d),m=co(b.bottom,m),g=Tr(b.left,g)}return{width:d-g,height:m-h,x:g,y:h}}function n8(e){const{width:t,height:n}=HT(e);return{width:t,height:n}}function r8(e,t,n){const r=_s(t),s=Pi(t),a=n==="fixed",l=Jo(e,!0,a,t);let u={scrollLeft:0,scrollTop:0};const h=Di(0);function d(){h.x=Sp(s)}if(r||!r&&!a)if((Fl(t)!=="body"||Qu(s))&&(u=wp(t)),r){const b=Jo(t,!0,a,t);h.x=b.x+t.clientLeft,h.y=b.y+t.clientTop}else s&&d();a&&!r&&s&&d();const m=s&&!r&&!a?UT(s,u):Di(0),g=l.left+u.scrollLeft-h.x-m.x,_=l.top+u.scrollTop-h.y-m.y;return{x:g,y:_,width:l.width,height:l.height}}function Tv(e){return fi(e).position==="static"}function i2(e,t){if(!_s(e)||fi(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Pi(e)===n&&(n=n.ownerDocument.body),n}function WT(e,t){const n=Mr(e);if(xp(e))return n;if(!_s(e)){let s=uo(e);for(;s&&!Tl(s);){if(hi(s)&&!Tv(s))return s;s=uo(s)}return n}let r=i2(e,t);for(;r&&$I(r)&&Tv(r);)r=i2(r,t);return r&&Tl(r)&&Tv(r)&&!Ib(r)?n:r||qI(e)||n}const i8=async function(e){const t=this.getOffsetParent||WT,n=this.getDimensions,r=await n(e.floating);return{reference:r8(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function s8(e){return fi(e).direction==="rtl"}const o8={convertOffsetParentRelativeRectToViewportRelativeRect:YI,getDocumentElement:Pi,getClippingRect:t8,getOffsetParent:WT,getElementRects:i8,getClientRects:XI,getDimensions:n8,getScale:wl,isElement:hi,isRTL:s8};function VT(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function a8(e,t){let n=null,r;const s=Pi(e);function a(){var u;clearTimeout(r),(u=n)==null||u.disconnect(),n=null}function l(u,h){u===void 0&&(u=!1),h===void 0&&(h=1),a();const d=e.getBoundingClientRect(),{left:m,top:g,width:_,height:b}=d;if(u||t(),!_||!b)return;const w=Ph(g),S=Ph(s.clientWidth-(m+_)),C=Ph(s.clientHeight-(g+b)),k=Ph(m),T={rootMargin:-w+"px "+-S+"px "+-C+"px "+-k+"px",threshold:Tr(0,co(1,h))||1};let N=!0;function L(A){const O=A[0].intersectionRatio;if(O!==h){if(!N)return l();O?l(!1,O):r=setTimeout(()=>{l(!1,1e-7)},1e3)}O===1&&!VT(d,e.getBoundingClientRect())&&l(),N=!1}try{n=new IntersectionObserver(L,{...T,root:s.ownerDocument})}catch{n=new IntersectionObserver(L,T)}n.observe(e)}return l(!0),a}function l8(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:a=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:h=!1}=r,d=Fb(e),m=s||a?[...d?Au(d):[],...t?Au(t):[]]:[];m.forEach(k=>{s&&k.addEventListener("scroll",n,{passive:!0}),a&&k.addEventListener("resize",n)});const g=d&&u?a8(d,n):null;let _=-1,b=null;l&&(b=new ResizeObserver(k=>{let[R]=k;R&&R.target===d&&b&&t&&(b.unobserve(t),cancelAnimationFrame(_),_=requestAnimationFrame(()=>{var T;(T=b)==null||T.observe(t)})),n()}),d&&!h&&b.observe(d),t&&b.observe(t));let w,S=h?Jo(e):null;h&&C();function C(){const k=Jo(e);S&&!VT(S,k)&&n(),S=k,w=requestAnimationFrame(C)}return n(),()=>{var k;m.forEach(R=>{s&&R.removeEventListener("scroll",n),a&&R.removeEventListener("resize",n)}),g==null||g(),(k=b)==null||k.disconnect(),b=null,h&&cancelAnimationFrame(w)}}const c8=II,u8=HI,d8=zI,h8=UI,f8=PI,s2=LI,p8=FI,m8=(e,t,n)=>{const r=new Map,s={platform:o8,...n},a={...s.platform,_c:r};return jI(e,t,{...s,platform:a})};var g8=typeof document<"u",v8=function(){},pf=g8?y.useLayoutEffect:v8;function If(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 n,r,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!If(e[r],t[r]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){const a=s[r];if(!(a==="_owner"&&e.$$typeof)&&!If(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function qT(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function o2(e,t){const n=qT(e);return Math.round(t*n)/n}function Mv(e){const t=y.useRef(e);return pf(()=>{t.current=e}),t}function _8(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:a,floating:l}={},transform:u=!0,whileElementsMounted:h,open:d}=e,[m,g]=y.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[_,b]=y.useState(r);If(_,r)||b(r);const[w,S]=y.useState(null),[C,k]=y.useState(null),R=y.useCallback(q=>{q!==A.current&&(A.current=q,S(q))},[]),T=y.useCallback(q=>{q!==O.current&&(O.current=q,k(q))},[]),N=a||w,L=l||C,A=y.useRef(null),O=y.useRef(null),F=y.useRef(m),G=h!=null,B=Mv(h),H=Mv(s),P=Mv(d),U=y.useCallback(()=>{if(!A.current||!O.current)return;const q={placement:t,strategy:n,middleware:_};H.current&&(q.platform=H.current),m8(A.current,O.current,q).then(Q=>{const M={...Q,isPositioned:P.current!==!1};V.current&&!If(F.current,M)&&(F.current=M,Ri.flushSync(()=>{g(M)}))})},[_,t,n,H,P]);pf(()=>{d===!1&&F.current.isPositioned&&(F.current.isPositioned=!1,g(q=>({...q,isPositioned:!1})))},[d]);const V=y.useRef(!1);pf(()=>(V.current=!0,()=>{V.current=!1}),[]),pf(()=>{if(N&&(A.current=N),L&&(O.current=L),N&&L){if(B.current)return B.current(N,L,U);U()}},[N,L,U,B,G]);const W=y.useMemo(()=>({reference:A,floating:O,setReference:R,setFloating:T}),[R,T]),z=y.useMemo(()=>({reference:N,floating:L}),[N,L]),$=y.useMemo(()=>{const q={position:n,left:0,top:0};if(!z.floating)return q;const Q=o2(z.floating,m.x),M=o2(z.floating,m.y);return u?{...q,transform:"translate("+Q+"px, "+M+"px)",...qT(z.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:Q,top:M}},[n,u,z.floating,m.x,m.y]);return y.useMemo(()=>({...m,update:U,refs:W,elements:z,floatingStyles:$}),[m,U,W,z,$])}const y8=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:s}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?s2({element:r.current,padding:s}).fn(n):{}:r?s2({element:r,padding:s}).fn(n):{}}}},b8=(e,t)=>{const n=c8(e);return{name:n.name,fn:n.fn,options:[e,t]}},x8=(e,t)=>{const n=u8(e);return{name:n.name,fn:n.fn,options:[e,t]}},w8=(e,t)=>({fn:p8(e).fn,options:[e,t]}),S8=(e,t)=>{const n=d8(e);return{name:n.name,fn:n.fn,options:[e,t]}},C8=(e,t)=>{const n=h8(e);return{name:n.name,fn:n.fn,options:[e,t]}},k8=(e,t)=>{const n=f8(e);return{name:n.name,fn:n.fn,options:[e,t]}},E8=(e,t)=>{const n=y8(e);return{name:n.name,fn:n.fn,options:[e,t]}};var R8="Arrow",KT=y.forwardRef((e,t)=>{const{children:n,width:r=10,height:s=5,...a}=e;return p.jsx(st.svg,{...a,ref:t,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:p.jsx("polygon",{points:"0,0 30,0 15,10"})})});KT.displayName=R8;var T8=KT;function M8(e){const[t,n]=y.useState(void 0);return Kn(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const a=s[0];let l,u;if("borderBoxSize"in a){const h=a.borderBoxSize,d=Array.isArray(h)?h[0]:h;l=d.inlineSize,u=d.blockSize}else l=e.offsetWidth,u=e.offsetHeight;n({width:l,height:u})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Ub="Popper",[GT,po]=vs(Ub),[N8,YT]=GT(Ub),XT=e=>{const{__scopePopper:t,children:n}=e,[r,s]=y.useState(null);return p.jsx(N8,{scope:t,anchor:r,onAnchorChange:s,children:n})};XT.displayName=Ub;var ZT="PopperAnchor",QT=y.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...s}=e,a=YT(ZT,n),l=y.useRef(null),u=yt(t,l),h=y.useRef(null);return y.useEffect(()=>{const d=h.current;h.current=(r==null?void 0:r.current)||l.current,d!==h.current&&a.onAnchorChange(h.current)}),r?null:p.jsx(st.div,{...s,ref:u})});QT.displayName=ZT;var $b="PopperContent",[A8,D8]=GT($b),JT=y.forwardRef((e,t)=>{var de,we,oe,be,Ne,Se;const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:a="center",alignOffset:l=0,arrowPadding:u=0,avoidCollisions:h=!0,collisionBoundary:d=[],collisionPadding:m=0,sticky:g="partial",hideWhenDetached:_=!1,updatePositionStrategy:b="optimized",onPlaced:w,...S}=e,C=YT($b,n),[k,R]=y.useState(null),T=yt(t,_e=>R(_e)),[N,L]=y.useState(null),A=M8(N),O=(A==null?void 0:A.width)??0,F=(A==null?void 0:A.height)??0,G=r+(a!=="center"?"-"+a:""),B=typeof m=="number"?m:{top:0,right:0,bottom:0,left:0,...m},H=Array.isArray(d)?d:[d],P=H.length>0,U={padding:B,boundary:H.filter(j8),altBoundary:P},{refs:V,floatingStyles:W,placement:z,isPositioned:$,middlewareData:q}=_8({strategy:"fixed",placement:G,whileElementsMounted:(..._e)=>l8(..._e,{animationFrame:b==="always"}),elements:{reference:C.anchor},middleware:[b8({mainAxis:s+F,alignmentAxis:l}),h&&x8({mainAxis:!0,crossAxis:!1,limiter:g==="partial"?w8():void 0,...U}),h&&S8({...U}),C8({...U,apply:({elements:_e,rects:xe,availableWidth:He,availableHeight:Fe})=>{const{width:et,height:dt}=xe.reference,mt=_e.floating.style;mt.setProperty("--radix-popper-available-width",`${He}px`),mt.setProperty("--radix-popper-available-height",`${Fe}px`),mt.setProperty("--radix-popper-anchor-width",`${et}px`),mt.setProperty("--radix-popper-anchor-height",`${dt}px`)}}),N&&E8({element:N,padding:u}),L8({arrowWidth:O,arrowHeight:F}),_&&k8({strategy:"referenceHidden",...U})]}),[Q,M]=nM(z),I=di(w);Kn(()=>{$&&(I==null||I())},[$,I]);const Z=(de=q.arrow)==null?void 0:de.x,j=(we=q.arrow)==null?void 0:we.y,ce=((oe=q.arrow)==null?void 0:oe.centerOffset)!==0,[fe,ue]=y.useState();return Kn(()=>{k&&ue(window.getComputedStyle(k).zIndex)},[k]),p.jsx("div",{ref:V.setFloating,"data-radix-popper-content-wrapper":"",style:{...W,transform:$?W.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:fe,"--radix-popper-transform-origin":[(be=q.transformOrigin)==null?void 0:be.x,(Ne=q.transformOrigin)==null?void 0:Ne.y].join(" "),...((Se=q.hide)==null?void 0:Se.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:p.jsx(A8,{scope:n,placedSide:Q,onArrowChange:L,arrowX:Z,arrowY:j,shouldHideArrow:ce,children:p.jsx(st.div,{"data-side":Q,"data-align":M,...S,ref:T,style:{...S.style,animation:$?void 0:"none"}})})})});JT.displayName=$b;var eM="PopperArrow",O8={top:"bottom",right:"left",bottom:"top",left:"right"},tM=y.forwardRef(function(t,n){const{__scopePopper:r,...s}=t,a=D8(eM,r),l=O8[a.placedSide];return p.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[l]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:p.jsx(T8,{...s,ref:n,style:{...s.style,display:"block"}})})});tM.displayName=eM;function j8(e){return e!==null}var L8=e=>({name:"transformOrigin",options:e,fn(t){var C,k,R;const{placement:n,rects:r,middlewareData:s}=t,l=((C=s.arrow)==null?void 0:C.centerOffset)!==0,u=l?0:e.arrowWidth,h=l?0:e.arrowHeight,[d,m]=nM(n),g={start:"0%",center:"50%",end:"100%"}[m],_=(((k=s.arrow)==null?void 0:k.x)??0)+u/2,b=(((R=s.arrow)==null?void 0:R.y)??0)+h/2;let w="",S="";return d==="bottom"?(w=l?g:`${_}px`,S=`${-h}px`):d==="top"?(w=l?g:`${_}px`,S=`${r.floating.height+h}px`):d==="right"?(w=`${-h}px`,S=l?g:`${b}px`):d==="left"&&(w=`${r.floating.width+h}px`,S=l?g:`${b}px`),{data:{x:w,y:S}}}});function nM(e){const[t,n="center"]=e.split("-");return[t,n]}var Cp=XT,Ju=QT,kp=JT,Ep=tM,rM=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"}),z8="VisuallyHidden",iM=y.forwardRef((e,t)=>p.jsx(st.span,{...e,ref:t,style:{...rM,...e.style}}));iM.displayName=z8;var P8=iM,[Rp]=vs("Tooltip",[po]),Tp=po(),sM="TooltipProvider",B8=700,D_="tooltip.open",[I8,Wb]=Rp(sM),oM=e=>{const{__scopeTooltip:t,delayDuration:n=B8,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:a}=e,l=y.useRef(!0),u=y.useRef(!1),h=y.useRef(0);return y.useEffect(()=>{const d=h.current;return()=>window.clearTimeout(d)},[]),p.jsx(I8,{scope:t,isOpenDelayedRef:l,delayDuration:n,onOpen:y.useCallback(()=>{window.clearTimeout(h.current),l.current=!1},[]),onClose:y.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>l.current=!0,r)},[r]),isPointerInTransitRef:u,onPointerInTransitChange:y.useCallback(d=>{u.current=d},[]),disableHoverableContent:s,children:a})};oM.displayName=sM;var Du="Tooltip",[H8,ed]=Rp(Du),aM=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:s,onOpenChange:a,disableHoverableContent:l,delayDuration:u}=e,h=Wb(Du,e.__scopeTooltip),d=Tp(t),[m,g]=y.useState(null),_=ds(),b=y.useRef(0),w=l??h.disableHoverableContent,S=u??h.delayDuration,C=y.useRef(!1),[k,R]=Rl({prop:r,defaultProp:s??!1,onChange:O=>{O?(h.onOpen(),document.dispatchEvent(new CustomEvent(D_))):h.onClose(),a==null||a(O)},caller:Du}),T=y.useMemo(()=>k?C.current?"delayed-open":"instant-open":"closed",[k]),N=y.useCallback(()=>{window.clearTimeout(b.current),b.current=0,C.current=!1,R(!0)},[R]),L=y.useCallback(()=>{window.clearTimeout(b.current),b.current=0,R(!1)},[R]),A=y.useCallback(()=>{window.clearTimeout(b.current),b.current=window.setTimeout(()=>{C.current=!0,R(!0),b.current=0},S)},[S,R]);return y.useEffect(()=>()=>{b.current&&(window.clearTimeout(b.current),b.current=0)},[]),p.jsx(Cp,{...d,children:p.jsx(H8,{scope:t,contentId:_,open:k,stateAttribute:T,trigger:m,onTriggerChange:g,onTriggerEnter:y.useCallback(()=>{h.isOpenDelayedRef.current?A():N()},[h.isOpenDelayedRef,A,N]),onTriggerLeave:y.useCallback(()=>{w?L():(window.clearTimeout(b.current),b.current=0)},[L,w]),onOpen:N,onClose:L,disableHoverableContent:w,children:n})})};aM.displayName=Du;var O_="TooltipTrigger",lM=y.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=ed(O_,n),a=Wb(O_,n),l=Tp(n),u=y.useRef(null),h=yt(t,u,s.onTriggerChange),d=y.useRef(!1),m=y.useRef(!1),g=y.useCallback(()=>d.current=!1,[]);return y.useEffect(()=>()=>document.removeEventListener("pointerup",g),[g]),p.jsx(Ju,{asChild:!0,...l,children:p.jsx(st.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:h,onPointerMove:Ae(e.onPointerMove,_=>{_.pointerType!=="touch"&&!m.current&&!a.isPointerInTransitRef.current&&(s.onTriggerEnter(),m.current=!0)}),onPointerLeave:Ae(e.onPointerLeave,()=>{s.onTriggerLeave(),m.current=!1}),onPointerDown:Ae(e.onPointerDown,()=>{s.open&&s.onClose(),d.current=!0,document.addEventListener("pointerup",g,{once:!0})}),onFocus:Ae(e.onFocus,()=>{d.current||s.onOpen()}),onBlur:Ae(e.onBlur,s.onClose),onClick:Ae(e.onClick,s.onClose)})})});lM.displayName=O_;var Vb="TooltipPortal",[F8,U8]=Rp(Vb,{forceMount:void 0}),cM=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:s}=e,a=ed(Vb,t);return p.jsx(F8,{scope:t,forceMount:n,children:p.jsx(ei,{present:n||a.open,children:p.jsx(Il,{asChild:!0,container:s,children:r})})})};cM.displayName=Vb;var Ml="TooltipContent",uM=y.forwardRef((e,t)=>{const n=U8(Ml,e.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...a}=e,l=ed(Ml,e.__scopeTooltip);return p.jsx(ei,{present:r||l.open,children:l.disableHoverableContent?p.jsx(dM,{side:s,...a,ref:t}):p.jsx($8,{side:s,...a,ref:t})})}),$8=y.forwardRef((e,t)=>{const n=ed(Ml,e.__scopeTooltip),r=Wb(Ml,e.__scopeTooltip),s=y.useRef(null),a=yt(t,s),[l,u]=y.useState(null),{trigger:h,onClose:d}=n,m=s.current,{onPointerInTransitChange:g}=r,_=y.useCallback(()=>{u(null),g(!1)},[g]),b=y.useCallback((w,S)=>{const C=w.currentTarget,k={x:w.clientX,y:w.clientY},R=G8(k,C.getBoundingClientRect()),T=Y8(k,R),N=X8(S.getBoundingClientRect()),L=Q8([...T,...N]);u(L),g(!0)},[g]);return y.useEffect(()=>()=>_(),[_]),y.useEffect(()=>{if(h&&m){const w=C=>b(C,m),S=C=>b(C,h);return h.addEventListener("pointerleave",w),m.addEventListener("pointerleave",S),()=>{h.removeEventListener("pointerleave",w),m.removeEventListener("pointerleave",S)}}},[h,m,b,_]),y.useEffect(()=>{if(l){const w=S=>{const C=S.target,k={x:S.clientX,y:S.clientY},R=(h==null?void 0:h.contains(C))||(m==null?void 0:m.contains(C)),T=!Z8(k,l);R?_():T&&(_(),d())};return document.addEventListener("pointermove",w),()=>document.removeEventListener("pointermove",w)}},[h,m,l,d,_]),p.jsx(dM,{...e,ref:a})}),[W8,V8]=Rp(Du,{isInside:!1}),q8=bz("TooltipContent"),dM=y.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:a,onPointerDownOutside:l,...u}=e,h=ed(Ml,n),d=Tp(n),{onClose:m}=h;return y.useEffect(()=>(document.addEventListener(D_,m),()=>document.removeEventListener(D_,m)),[m]),y.useEffect(()=>{if(h.trigger){const g=_=>{const b=_.target;b!=null&&b.contains(h.trigger)&&m()};return window.addEventListener("scroll",g,{capture:!0}),()=>window.removeEventListener("scroll",g,{capture:!0})}},[h.trigger,m]),p.jsx(Bl,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:g=>g.preventDefault(),onDismiss:m,children:p.jsxs(kp,{"data-state":h.stateAttribute,...d,...u,ref:t,style:{...u.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:[p.jsx(q8,{children:r}),p.jsx(W8,{scope:n,isInside:!0,children:p.jsx(P8,{id:h.contentId,role:"tooltip",children:s||r})})]})})});uM.displayName=Ml;var hM="TooltipArrow",K8=y.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=Tp(n);return V8(hM,n).isInside?null:p.jsx(Ep,{...s,...r,ref:t})});K8.displayName=hM;function G8(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,s,a)){case a:return"left";case s:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Y8(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function X8(e){const{top:t,right:n,bottom:r,left:s}=e;return[{x:s,y:t},{x:n,y:t},{x:n,y:r},{x:s,y:r}]}function Z8(e,t){const{x:n,y:r}=e;let s=!1;for(let a=0,l=t.length-1;a<t.length;l=a++){const u=t[a],h=t[l],d=u.x,m=u.y,g=h.x,_=h.y;m>r!=_>r&&n<(g-d)*(r-m)/(_-m)+d&&(s=!s)}return s}function Q8(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),J8(t)}function J8(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const s=e[r];for(;t.length>=2;){const a=t[t.length-1],l=t[t.length-2];if((a.x-l.x)*(s.y-l.y)>=(a.y-l.y)*(s.x-l.x))t.pop();else break}t.push(s)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const s=e[r];for(;n.length>=2;){const a=n[n.length-1],l=n[n.length-2];if((a.x-l.x)*(s.y-l.y)>=(a.y-l.y)*(s.x-l.x))n.pop();else break}n.push(s)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var e7=oM,fM=aM,pM=lM,mM=cM,qb=uM;function gM({className:e,...t}){return p.jsx("kbd",{className:ye("pointer-events-none inline-flex h-5 min-w-5 items-center justify-center rounded border border-border/60 bg-muted/50 px-1.5 font-mono text-[11px] font-medium text-current select-none",e),...t})}function vM({className:e,...t}){return p.jsx("span",{className:ye("inline-flex items-center gap-0.5",e),...t})}const t7="z-50 overflow-hidden rounded-md border border-border backdrop-blur-md p-0.5 text-[11px] font-medium text-card-foreground shadow-sm 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",n7=e7,Hf=fM,Ff=pM,Ou=y.forwardRef(({className:e,sideOffset:t=4,...n},r)=>p.jsx(mM,{children:p.jsx(qb,{ref:r,sideOffset:t,className:ye("z-50 overflow-hidden rounded-md bg-card text-card-foreground border border-border px-3 py-1.5 text-xs 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),...n})}));Ou.displayName=qb.displayName;const iu=fM,su=pM;function Kb(e){return e.toUpperCase()}function r7(e){const t=e.split("+");return p.jsx(vM,{children:t.map((n,r)=>p.jsx(gM,{children:Kb(n)},`${n}-${r}`))})}const ml=y.forwardRef(({className:e,sideOffset:t=4,children:n,shortcut:r,...s},a)=>{const l=r===void 0?null:Array.isArray(r)?r[0]??null:r;return p.jsx(mM,{children:p.jsx(qb,{ref:a,sideOffset:t,className:ye(t7,e),...s,children:l?r7(l):p.jsx("span",{children:typeof n=="string"?Kb(n):n})})})});ml.displayName="HotkeyTooltipContent";const i7="0.19.0",s7={version:i7},ln="Kanna",a2="kanna",o7=".kanna",a7=".kanna-dev",l7="KANNA_RUNTIME_PROFILE",Gb=`kanna/${s7.version}`,c7="[kanna]",u7=`~/${ln}`;function Mp(){var t;return(t=globalThis.process)==null?void 0:t.env}function d7(e=Mp()){var t;return((t=e==null?void 0:e[l7])==null?void 0:t.trim().toLowerCase())==="dev"?"dev":"prod"}function h7(e=Mp()){return d7(e)==="dev"?a7:o7}function f7(e=Mp()){return`~/${h7(e)}`}function p7(e=Mp()){return`${f7(e)}/keybindings.json`}function Bh(e){return e?`${a2} ${e}`:a2}const l2=e=>{let t;const n=new Set,r=(d,m)=>{const g=typeof d=="function"?d(t):d;if(!Object.is(g,t)){const _=t;t=m??(typeof g!="object"||g===null)?g:Object.assign({},t,g),n.forEach(b=>b(t,_))}},s=()=>t,u={setState:r,getState:s,getInitialState:()=>h,subscribe:d=>(n.add(d),()=>n.delete(d))},h=t=e(r,s,u);return u},m7=(e=>e?l2(e):l2),g7=e=>e;function v7(e,t=g7){const n=Pt.useSyncExternalStore(e.subscribe,Pt.useCallback(()=>t(e.getState()),[e,t]),Pt.useCallback(()=>t(e.getInitialState()),[e,t]));return Pt.useDebugValue(n),n}const _7=e=>{const t=m7(e),n=r=>v7(t,r);return Object.assign(n,t),n},ua=(e=>_7);function y7(e,t){let n;try{n=e()}catch{return}return{getItem:s=>{var a;const l=h=>h===null?null:JSON.parse(h,void 0),u=(a=n.getItem(s))!=null?a:null;return u instanceof Promise?u.then(l):l(u)},setItem:(s,a)=>n.setItem(s,JSON.stringify(a,void 0)),removeItem:s=>n.removeItem(s)}}const j_=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return j_(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return j_(r)(n)}}}},b7=(e,t)=>(n,r,s)=>{let a={storage:y7(()=>window.localStorage),partialize:C=>C,version:0,merge:(C,k)=>({...k,...C}),...t},l=!1,u=0;const h=new Set,d=new Set;let m=a.storage;if(!m)return e((...C)=>{console.warn(`[zustand persist middleware] Unable to update item '${a.name}', the given storage is currently unavailable.`),n(...C)},r,s);const g=()=>{const C=a.partialize({...r()});return m.setItem(a.name,{state:C,version:a.version})},_=s.setState;s.setState=(C,k)=>(_(C,k),g());const b=e((...C)=>(n(...C),g()),r,s);s.getInitialState=()=>b;let w;const S=()=>{var C,k;if(!m)return;const R=++u;l=!1,h.forEach(N=>{var L;return N((L=r())!=null?L:b)});const T=((k=a.onRehydrateStorage)==null?void 0:k.call(a,(C=r())!=null?C:b))||void 0;return j_(m.getItem.bind(m))(a.name).then(N=>{if(N)if(typeof N.version=="number"&&N.version!==a.version){if(a.migrate){const L=a.migrate(N.state,N.version);return L instanceof Promise?L.then(A=>[!0,A]):[!0,L]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,N.state];return[!1,void 0]}).then(N=>{var L;if(R!==u)return;const[A,O]=N;if(w=a.merge(O,(L=r())!=null?L:b),n(w,!0),A)return g()}).then(()=>{R===u&&(T==null||T(w,void 0),w=r(),l=!0,d.forEach(N=>N(w)))}).catch(N=>{R===u&&(T==null||T(void 0,N))})};return s.persist={setOptions:C=>{a={...a,...C},C.storage&&(m=C.storage)},clearStorage:()=>{m==null||m.removeItem(a.name)},getOptions:()=>a,rehydrate:()=>S(),hasHydrated:()=>l,onHydrate:C=>(h.add(C),()=>{h.delete(C)}),onFinishHydration:C=>(d.add(C),()=>{d.delete(C)})},a.skipHydration||S(),w||b},da=b7,_M="always",yM="funk",x7=[{value:"blow",label:"Blow"},{value:"bottle",label:"Bottle"},{value:"frog",label:"Frog"},{value:"funk",label:"Funk"},{value:"glass",label:"Glass"},{value:"ping",label:"Ping"},{value:"pop",label:"Pop"},{value:"purr",label:"Purr"},{value:"tink",label:"Tink"}];function c2(e){switch(e){case"never":case"unfocused":case"always":return e;default:return _M}}function u2(e){switch(e){case"blow":case"bottle":case"frog":case"funk":case"glass":case"ping":case"pop":case"purr":case"tink":return e;default:return yM}}const gl=ua()(da(e=>({chatSoundPreference:_M,chatSoundId:yM,setChatSoundPreference:t=>e({chatSoundPreference:c2(t)}),setChatSoundId:t=>e({chatSoundId:u2(t)})}),{name:"chat-sound-preferences",version:2,migrate:e=>{const t=e;return{chatSoundPreference:c2(t==null?void 0:t.chatSoundPreference),chatSoundId:u2(t==null?void 0:t.chatSoundId)}}})),w7={blow:"/chat-sounds/Blow.mp3",bottle:"/chat-sounds/Bottle.mp3",frog:"/chat-sounds/Frog.mp3",funk:"/chat-sounds/Funk.mp3",glass:"/chat-sounds/Glass.mp3",ping:"/chat-sounds/Ping.mp3",pop:"/chat-sounds/Pop.mp3",purr:"/chat-sounds/Purr.mp3",tink:"/chat-sounds/Tink.mp3"};function S7(e=document){return e.visibilityState!=="visible"||!e.hasFocus()}function C7(e){const t=new Audio(w7[e]);return t.preload="auto",t.play()}async function L_(e,t){if(t<=0)return;const n=Array.from({length:t},(r,s)=>new Promise(a=>{window.setTimeout(()=>{C7(e).catch(()=>{}).finally(()=>a())},s*90)}));await Promise.all(n)}function k7(e,t=document){return e==="never"?!1:e==="always"?!0:S7(t)}const Uf=[{id:"low",label:"Low"},{id:"medium",label:"Medium"},{id:"high",label:"High"},{id:"max",label:"Max"}],z_=[{id:"minimal",label:"Minimal"},{id:"low",label:"Low"},{id:"medium",label:"Medium"},{id:"high",label:"High"},{id:"xhigh",label:"XHigh"}],ju={reasoningEffort:"high",contextWindow:"200k"},P_={reasoningEffort:"high",fastMode:!1};function d2(e){return Uf.some(t=>t.id===e)}function h2(e){return z_.some(t=>t.id===e)}const B_=[{id:"200k",label:"200k"},{id:"1m",label:"1M"}],bu=[{id:"claude",label:"Claude",defaultModel:"sonnet",defaultEffort:"high",supportsPlanMode:!0,models:[{id:"opus",label:"Opus",supportsEffort:!0,contextWindowOptions:[...B_]},{id:"sonnet",label:"Sonnet",supportsEffort:!0,contextWindowOptions:[...B_]},{id:"haiku",label:"Haiku",supportsEffort:!0}],efforts:[...Uf]},{id:"codex",label:"Codex",defaultModel:"gpt-5.4",supportsPlanMode:!0,models:[{id:"gpt-5.4",label:"GPT-5.4",supportsEffort:!1},{id:"gpt-5.3-codex",label:"GPT-5.3 Codex",supportsEffort:!1},{id:"gpt-5.3-codex-spark",label:"GPT-5.3 Codex Spark",supportsEffort:!1}],efforts:[]}];function E7(e){const t=bu.find(n=>n.id===e);if(!t)throw new Error(`Unknown provider: ${e}`);return t}function R7(e){return E7("claude").models.find(t=>t.id===e)}function T7(e){var t;return((t=R7(e))==null?void 0:t.contextWindowOptions)??[]}function bM(e,t){const n=T7(e);return n.length===0?ju.contextWindow:n.some(r=>r.id===t)?t:ju.contextWindow}const no={toggleEmbeddedTerminal:["cmd+j","ctrl+`"],toggleRightSidebar:["cmd+b","ctrl+b"],openInFinder:["cmd+alt+f","ctrl+alt+f"],openInEditor:["cmd+shift+o","ctrl+shift+o"],addSplitTerminal:["cmd+/","ctrl+/"]},xM={toggleEmbeddedTerminal:"Toggle Embedded Terminal",toggleRightSidebar:"Toggle Right Sidebar",openInFinder:"Open In Finder",openInEditor:"Open In Editor",addSplitTerminal:"Add Split Terminal"};function Nv(e){return(e??[]).join(", ")}function qc(e){return e.split(",").map(t=>t.trim()).map(t=>t.toLowerCase()).filter(Boolean)}const M7=new Map([["cmd","meta"],["meta","meta"],["ctrl","ctrl"],["control","ctrl"],["alt","alt"],["option","alt"],["shift","shift"]]);function N7(e,t){const n=A7(e);return n?t.key.toLowerCase()===n.key&&t.ctrlKey===n.ctrl&&t.metaKey===n.meta&&t.altKey===n.alt&&t.shiftKey===n.shift:!1}function Kc(e,t,n){return((e==null?void 0:e.bindings[t])??no[t]).some(s=>N7(s,n))}function Yb(e){return{bindings:{toggleEmbeddedTerminal:(e==null?void 0:e.bindings.toggleEmbeddedTerminal)??no.toggleEmbeddedTerminal,toggleRightSidebar:(e==null?void 0:e.bindings.toggleRightSidebar)??no.toggleRightSidebar,openInFinder:(e==null?void 0:e.bindings.openInFinder)??no.openInFinder,openInEditor:(e==null?void 0:e.bindings.openInEditor)??no.openInEditor,addSplitTerminal:(e==null?void 0:e.bindings.addSplitTerminal)??no.addSplitTerminal},warning:(e==null?void 0:e.warning)??null,filePathDisplay:(e==null?void 0:e.filePathDisplay)??""}}function A7(e){const t=e.split("+").map(r=>r.trim()).filter(Boolean);if(t.length===0)return null;const n={key:"",ctrl:!1,meta:!1,alt:!1,shift:!1};for(const r of t){const s=r.toLowerCase(),a=M7.get(s);if(a==="ctrl"){n.ctrl=!0;continue}if(a==="meta"){n.meta=!0;continue}if(a==="alt"){n.alt=!0;continue}if(a==="shift"){n.shift=!0;continue}if(n.key)return null;n.key=s}return n.key?n:null}const Np=({children:e,className:t,shimmerWidth:n=100,animate:r=!0,...s})=>p.jsx("span",{style:{"--shiny-width":`${Math.min(n,100)}px`},className:ye("mx-auto max-w-md text-foreground/50",r?["animate-shiny-text [background-size:var(--shiny-width)_100%] bg-clip-text [background-position:0_0] bg-no-repeat [transition:background-position_1s_cubic-bezier(.6,.6,0,1)_infinite]","bg-gradient-to-r from-transparent via-black/80 via-50% to-transparent dark:via-white/80"]:["text-neutral"],t),...s,children:e});function I_(e){return e.split(/[\s_-]+/).filter(Boolean).map(t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()).join(" ")}const D7=[/^(?:\/usr\/bin\/env\s+)?(?:\/bin\/)?(?:bash|zsh|sh)\s+(?:-[a-zA-Z]*c|-c)\s+(['"])([\s\S]*)\1$/,/^(?:\/usr\/bin\/env\s+)?(?:\/bin\/)?(?:bash|zsh|sh)\s+(?:-[a-zA-Z]*c|-c)\s+(.+)$/,/^(?:\/usr\/bin\/env\s+)?(?:cmd(?:\.exe)?)\s+\/c\s+(['"])([\s\S]*)\1$/i,/^(?:\/usr\/bin\/env\s+)?(?:cmd(?:\.exe)?)\s+\/c\s+(.+)$/i,/^(?:\/usr\/bin\/env\s+)?(?:powershell(?:\.exe)?|pwsh)\s+(?:-NoProfile\s+)?-Command\s+(['"])([\s\S]*)\1$/i,/^(?:\/usr\/bin\/env\s+)?(?:powershell(?:\.exe)?|pwsh)\s+(?:-NoProfile\s+)?-Command\s+(.+)$/i];function O7(e){const t=e.trim();for(const n of D7){const r=t.match(n);if(!r)continue;const s=(r[2]??r[1]??"").trim();if(s)return s}return t}function wM(e){return e.split("/").pop()||e}function j7(e,t){if(e===void 0)return null;const n=Math.max(0,t-e),r=6e4,s=60*r,a=24*s,l=7*a;return n<r?"now":n<s?`${Math.floor(n/r)}m`:n<a?`${Math.floor(n/s)}h`:n<l?`${Math.floor(n/a)}d`:`${Math.floor(n/l)}w`}const L7=new Set(["starting","running"]);function z7({chat:e,activeChatId:t,nowMs:n,onSelectChat:r,onDeleteChat:s}){const a=j7(e.lastMessageAt,n);return p.jsxs("div",{"data-chat-id":RC(e.chatId),className:ye("group flex items-center gap-2 pl-2.5 pr-0.5 py-0.5 rounded-lg cursor-pointer border-border/0 hover:border-border hover:bg-muted/20 active:scale-[0.985] border transition-all",t===RC(e.chatId)?"bg-muted hover:bg-muted border-border":"border-border/0 dark:hover:border-slate-400/10 "),onClick:()=>r(e.chatId),children:[L7.has(e.status)?p.jsx(ji,{className:"size-3.5 flex-shrink-0 animate-spin text-muted-foreground"}):e.status==="waiting_for_user"?p.jsx("div",{className:"relative ",children:p.jsxs("div",{className:" rounded-full z-0 size-3.5 flex items-center justify-center ",children:[p.jsx("div",{className:"absolute rounded-full z-0 size-2.5 bg-blue-400/80 animate-ping"}),p.jsx("div",{className:" rounded-full z-0 size-2.5 bg-blue-400 ring-2 ring-muted/20 dark:ring-muted/50"})]})}):e.unread?p.jsx("div",{className:"relative ",children:p.jsxs("div",{className:" rounded-full z-0 size-3.5 flex items-center justify-center ",children:[p.jsx("div",{className:"absolute rounded-full z-0 size-2.5 bg-emerald-400/80 animate-ping"}),p.jsx("div",{className:" rounded-full z-0 size-2.5 bg-emerald-400 ring-2 ring-muted/20 dark:ring-muted/50"})]})}):null,p.jsx("span",{className:"text-sm truncate flex-1 translate-y-[-0.5px]",children:e.status!=="idle"&&e.status!=="waiting_for_user"?p.jsx(Np,{animate:e.status==="running",shimmerWidth:Math.max(20,e.title.length*3),children:e.title}):e.title}),p.jsxs("div",{className:"relative h-7 w-7 mr-[2px] shrink-0",children:[a?p.jsx("span",{className:"hidden md:flex absolute inset-0 items-center justify-end pr-1 text-[11px] text-muted-foreground opacity-50 transition-opacity group-hover:opacity-0",children:a}):null,p.jsx(tt,{variant:"ghost",size:"icon",className:ye("absolute inset-0 h-7 w-7 opacity-100 cursor-pointer rounded-sm hover:!bg-transparent !border-0",a?"md:opacity-0 md:group-hover:opacity-100":"opacity-100 md:opacity-0 md:group-hover:opacity-100"),onClick:l=>{l.stopPropagation(),s(e.chatId)},title:"Delete chat",children:p.jsx(X6,{className:"size-3.5"})})]})]},e._id)}function P7(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return y.useMemo(()=>r=>{t.forEach(s=>s(r))},t)}const Ap=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ul(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Xb(e){return"nodeType"in e}function gr(e){var t,n;return e?Ul(e)?e:Xb(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function Zb(e){const{Document:t}=gr(e);return e instanceof t}function td(e){return Ul(e)?!1:e instanceof gr(e).HTMLElement}function SM(e){return e instanceof gr(e).SVGElement}function $l(e){return e?Ul(e)?e.document:Xb(e)?Zb(e)?e:td(e)||SM(e)?e.ownerDocument:document:document:document}const Li=Ap?y.useLayoutEffect:y.useEffect;function Qb(e){const t=y.useRef(e);return Li(()=>{t.current=e}),y.useCallback(function(){for(var n=arguments.length,r=new Array(n),s=0;s<n;s++)r[s]=arguments[s];return t.current==null?void 0:t.current(...r)},[])}function B7(){const e=y.useRef(null),t=y.useCallback((r,s)=>{e.current=setInterval(r,s)},[]),n=y.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function Lu(e,t){t===void 0&&(t=[e]);const n=y.useRef(e);return Li(()=>{n.current!==e&&(n.current=e)},t),n}function nd(e,t){const n=y.useRef();return y.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function $f(e){const t=Qb(e),n=y.useRef(null),r=y.useCallback(s=>{s!==n.current&&(t==null||t(s,n.current)),n.current=s},[]);return[n,r]}function H_(e){const t=y.useRef();return y.useEffect(()=>{t.current=e},[e]),t.current}let Av={};function rd(e,t){return y.useMemo(()=>{if(t)return t;const n=Av[e]==null?0:Av[e]+1;return Av[e]=n,e+"-"+n},[e,t])}function CM(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];return r.reduce((a,l)=>{const u=Object.entries(l);for(const[h,d]of u){const m=a[h];m!=null&&(a[h]=m+e*d)}return a},{...t})}}const Sl=CM(1),Wf=CM(-1);function I7(e){return"clientX"in e&&"clientY"in e}function Jb(e){if(!e)return!1;const{KeyboardEvent:t}=gr(e.target);return t&&e instanceof t}function H7(e){if(!e)return!1;const{TouchEvent:t}=gr(e.target);return t&&e instanceof t}function F_(e){if(H7(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return I7(e)?{x:e.clientX,y:e.clientY}:null}const zu=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[zu.Translate.toString(e),zu.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),f2="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function F7(e){return e.matches(f2)?e:e.querySelector(f2)}const U7={display:"none"};function $7(e){let{id:t,value:n}=e;return Pt.createElement("div",{id:t,style:U7},n)}function W7(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const s={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return Pt.createElement("div",{id:t,style:s,role:"status","aria-live":r,"aria-atomic":!0},n)}function V7(){const[e,t]=y.useState("");return{announce:y.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const kM=y.createContext(null);function q7(e){const t=y.useContext(kM);y.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function K7(){const[e]=y.useState(()=>new Set),t=y.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[y.useCallback(r=>{let{type:s,event:a}=r;e.forEach(l=>{var u;return(u=l[s])==null?void 0:u.call(l,a)})},[e]),t]}const G7={draggable:`
|
|
520
|
-
To pick up a draggable item, press the space bar.
|
|
521
|
-
While dragging, use the arrow keys to move the item.
|
|
522
|
-
Press space again to drop the item in its new position, or press escape to cancel.
|
|
523
|
-
`},Y7={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function X7(e){let{announcements:t=Y7,container:n,hiddenTextDescribedById:r,screenReaderInstructions:s=G7}=e;const{announce:a,announcement:l}=V7(),u=rd("DndLiveRegion"),[h,d]=y.useState(!1);if(y.useEffect(()=>{d(!0)},[]),q7(y.useMemo(()=>({onDragStart(g){let{active:_}=g;a(t.onDragStart({active:_}))},onDragMove(g){let{active:_,over:b}=g;t.onDragMove&&a(t.onDragMove({active:_,over:b}))},onDragOver(g){let{active:_,over:b}=g;a(t.onDragOver({active:_,over:b}))},onDragEnd(g){let{active:_,over:b}=g;a(t.onDragEnd({active:_,over:b}))},onDragCancel(g){let{active:_,over:b}=g;a(t.onDragCancel({active:_,over:b}))}}),[a,t])),!h)return null;const m=Pt.createElement(Pt.Fragment,null,Pt.createElement($7,{id:r,value:s.draggable}),Pt.createElement(W7,{id:u,announcement:l}));return n?Ri.createPortal(m,n):m}var vn;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(vn||(vn={}));function Vf(){}function p2(e,t){return y.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function Z7(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return y.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const pi=Object.freeze({x:0,y:0});function Q7(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function J7(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function e9(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function t9(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function m2(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}const n9=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const s=m2(t,t.left,t.top),a=[];for(const l of r){const{id:u}=l,h=n.get(u);if(h){const d=Q7(m2(h),s);a.push({id:u,data:{droppableContainer:l,value:d}})}}return a.sort(J7)};function r9(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),s=Math.min(t.left+t.width,e.left+e.width),a=Math.min(t.top+t.height,e.top+e.height),l=s-r,u=a-n;if(r<s&&n<a){const h=t.width*t.height,d=e.width*e.height,m=l*u,g=m/(h+d-m);return Number(g.toFixed(4))}return 0}const i9=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const s=[];for(const a of r){const{id:l}=a,u=n.get(l);if(u){const h=r9(u,t);h>0&&s.push({id:l,data:{droppableContainer:a,value:h}})}}return s.sort(e9)};function s9(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function EM(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:pi}function o9(e){return function(n){for(var r=arguments.length,s=new Array(r>1?r-1:0),a=1;a<r;a++)s[a-1]=arguments[a];return s.reduce((l,u)=>({...l,top:l.top+e*u.y,bottom:l.bottom+e*u.y,left:l.left+e*u.x,right:l.right+e*u.x}),{...n})}}const a9=o9(1);function l9(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function c9(e,t,n){const r=l9(t);if(!r)return e;const{scaleX:s,scaleY:a,x:l,y:u}=r,h=e.left-l-(1-s)*parseFloat(n),d=e.top-u-(1-a)*parseFloat(n.slice(n.indexOf(" ")+1)),m=s?e.width/s:e.width,g=a?e.height/a:e.height;return{width:m,height:g,top:d,right:h+m,bottom:d+g,left:h}}const u9={ignoreTransform:!1};function Wl(e,t){t===void 0&&(t=u9);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:d,transformOrigin:m}=gr(e).getComputedStyle(e);d&&(n=c9(n,d,m))}const{top:r,left:s,width:a,height:l,bottom:u,right:h}=n;return{top:r,left:s,width:a,height:l,bottom:u,right:h}}function g2(e){return Wl(e,{ignoreTransform:!0})}function d9(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function h9(e,t){return t===void 0&&(t=gr(e).getComputedStyle(e)),t.position==="fixed"}function f9(e,t){t===void 0&&(t=gr(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(s=>{const a=t[s];return typeof a=="string"?n.test(a):!1})}function e0(e,t){const n=[];function r(s){if(t!=null&&n.length>=t||!s)return n;if(Zb(s)&&s.scrollingElement!=null&&!n.includes(s.scrollingElement))return n.push(s.scrollingElement),n;if(!td(s)||SM(s)||n.includes(s))return n;const a=gr(e).getComputedStyle(s);return s!==e&&f9(s,a)&&n.push(s),h9(s,a)?n:r(s.parentNode)}return e?r(e):n}function RM(e){const[t]=e0(e,1);return t??null}function Dv(e){return!Ap||!e?null:Ul(e)?e:Xb(e)?Zb(e)||e===$l(e).scrollingElement?window:td(e)?e:null:null}function TM(e){return Ul(e)?e.scrollX:e.scrollLeft}function MM(e){return Ul(e)?e.scrollY:e.scrollTop}function U_(e){return{x:TM(e),y:MM(e)}}var wn;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(wn||(wn={}));function NM(e){return!Ap||!e?!1:e===document.scrollingElement}function AM(e){const t={x:0,y:0},n=NM(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},s=e.scrollTop<=t.y,a=e.scrollLeft<=t.x,l=e.scrollTop>=r.y,u=e.scrollLeft>=r.x;return{isTop:s,isLeft:a,isBottom:l,isRight:u,maxScroll:r,minScroll:t}}const p9={x:.2,y:.2};function m9(e,t,n,r,s){let{top:a,left:l,right:u,bottom:h}=n;r===void 0&&(r=10),s===void 0&&(s=p9);const{isTop:d,isBottom:m,isLeft:g,isRight:_}=AM(e),b={x:0,y:0},w={x:0,y:0},S={height:t.height*s.y,width:t.width*s.x};return!d&&a<=t.top+S.height?(b.y=wn.Backward,w.y=r*Math.abs((t.top+S.height-a)/S.height)):!m&&h>=t.bottom-S.height&&(b.y=wn.Forward,w.y=r*Math.abs((t.bottom-S.height-h)/S.height)),!_&&u>=t.right-S.width?(b.x=wn.Forward,w.x=r*Math.abs((t.right-S.width-u)/S.width)):!g&&l<=t.left+S.width&&(b.x=wn.Backward,w.x=r*Math.abs((t.left+S.width-l)/S.width)),{direction:b,speed:w}}function g9(e){if(e===document.scrollingElement){const{innerWidth:a,innerHeight:l}=window;return{top:0,left:0,right:a,bottom:l,width:a,height:l}}const{top:t,left:n,right:r,bottom:s}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:s,width:e.clientWidth,height:e.clientHeight}}function DM(e){return e.reduce((t,n)=>Sl(t,U_(n)),pi)}function v9(e){return e.reduce((t,n)=>t+TM(n),0)}function _9(e){return e.reduce((t,n)=>t+MM(n),0)}function y9(e,t){if(t===void 0&&(t=Wl),!e)return;const{top:n,left:r,bottom:s,right:a}=t(e);RM(e)&&(s<=0||a<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const b9=[["x",["left","right"],v9],["y",["top","bottom"],_9]];class t0{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=e0(n),s=DM(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[a,l,u]of b9)for(const h of l)Object.defineProperty(this,h,{get:()=>{const d=u(r),m=s[a]-d;return this.rect[h]+m},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class xu{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var s;(s=this.target)==null||s.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function x9(e){const{EventTarget:t}=gr(e);return e instanceof t?e:$l(e)}function Ov(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var Gr;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Gr||(Gr={}));function v2(e){e.preventDefault()}function w9(e){e.stopPropagation()}var _t;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(_t||(_t={}));const OM={start:[_t.Space,_t.Enter],cancel:[_t.Esc],end:[_t.Space,_t.Enter,_t.Tab]},S9=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case _t.Right:return{...n,x:n.x+25};case _t.Left:return{...n,x:n.x-25};case _t.Down:return{...n,y:n.y+25};case _t.Up:return{...n,y:n.y-25}}};class n0{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new xu($l(n)),this.windowListeners=new xu(gr(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Gr.Resize,this.handleCancel),this.windowListeners.add(Gr.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Gr.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&y9(r),n(pi)}handleKeyDown(t){if(Jb(t)){const{active:n,context:r,options:s}=this.props,{keyboardCodes:a=OM,coordinateGetter:l=S9,scrollBehavior:u="smooth"}=s,{code:h}=t;if(a.end.includes(h)){this.handleEnd(t);return}if(a.cancel.includes(h)){this.handleCancel(t);return}const{collisionRect:d}=r.current,m=d?{x:d.left,y:d.top}:pi;this.referenceCoordinates||(this.referenceCoordinates=m);const g=l(t,{active:n,context:r.current,currentCoordinates:m});if(g){const _=Wf(g,m),b={x:0,y:0},{scrollableAncestors:w}=r.current;for(const S of w){const C=t.code,{isTop:k,isRight:R,isLeft:T,isBottom:N,maxScroll:L,minScroll:A}=AM(S),O=g9(S),F={x:Math.min(C===_t.Right?O.right-O.width/2:O.right,Math.max(C===_t.Right?O.left:O.left+O.width/2,g.x)),y:Math.min(C===_t.Down?O.bottom-O.height/2:O.bottom,Math.max(C===_t.Down?O.top:O.top+O.height/2,g.y))},G=C===_t.Right&&!R||C===_t.Left&&!T,B=C===_t.Down&&!N||C===_t.Up&&!k;if(G&&F.x!==g.x){const H=S.scrollLeft+_.x,P=C===_t.Right&&H<=L.x||C===_t.Left&&H>=A.x;if(P&&!_.y){S.scrollTo({left:H,behavior:u});return}P?b.x=S.scrollLeft-H:b.x=C===_t.Right?S.scrollLeft-L.x:S.scrollLeft-A.x,b.x&&S.scrollBy({left:-b.x,behavior:u});break}else if(B&&F.y!==g.y){const H=S.scrollTop+_.y,P=C===_t.Down&&H<=L.y||C===_t.Up&&H>=A.y;if(P&&!_.x){S.scrollTo({top:H,behavior:u});return}P?b.y=S.scrollTop-H:b.y=C===_t.Down?S.scrollTop-L.y:S.scrollTop-A.y,b.y&&S.scrollBy({top:-b.y,behavior:u});break}}this.handleMove(t,Sl(Wf(g,this.referenceCoordinates),b))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}n0.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=OM,onActivation:s}=t,{active:a}=n;const{code:l}=e.nativeEvent;if(r.start.includes(l)){const u=a.activatorNode.current;return u&&e.target!==u?!1:(e.preventDefault(),s==null||s({event:e.nativeEvent}),!0)}return!1}}];function _2(e){return!!(e&&"distance"in e)}function y2(e){return!!(e&&"delay"in e)}class r0{constructor(t,n,r){var s;r===void 0&&(r=x9(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:a}=t,{target:l}=a;this.props=t,this.events=n,this.document=$l(l),this.documentListeners=new xu(this.document),this.listeners=new xu(r),this.windowListeners=new xu(gr(l)),this.initialCoordinates=(s=F_(a))!=null?s:pi,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(Gr.Resize,this.handleCancel),this.windowListeners.add(Gr.DragStart,v2),this.windowListeners.add(Gr.VisibilityChange,this.handleCancel),this.windowListeners.add(Gr.ContextMenu,v2),this.documentListeners.add(Gr.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(y2(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(_2(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:r,onPending:s}=this.props;s(r,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(Gr.Click,w9,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Gr.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:s,props:a}=this,{onMove:l,options:{activationConstraint:u}}=a;if(!s)return;const h=(n=F_(t))!=null?n:pi,d=Wf(s,h);if(!r&&u){if(_2(u)){if(u.tolerance!=null&&Ov(d,u.tolerance))return this.handleCancel();if(Ov(d,u.distance))return this.handleStart()}if(y2(u)&&Ov(d,u.tolerance))return this.handleCancel();this.handlePending(u,d);return}t.cancelable&&t.preventDefault(),l(h)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===_t.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const C9={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class i0 extends r0{constructor(t){const{event:n}=t,r=$l(n.target);super(t,C9,r)}}i0.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r==null||r({event:n}),!0)}}];const k9={move:{name:"mousemove"},end:{name:"mouseup"}};var $_;(function(e){e[e.RightClick=2]="RightClick"})($_||($_={}));class E9 extends r0{constructor(t){super(t,k9,$l(t.event.target))}}E9.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===$_.RightClick?!1:(r==null||r({event:n}),!0)}}];const jv={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class R9 extends r0{constructor(t){super(t,jv)}static setup(){return window.addEventListener(jv.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(jv.move.name,t)};function t(){}}}R9.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:s}=n;return s.length>1?!1:(r==null||r({event:n}),!0)}}];var wu;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(wu||(wu={}));var qf;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(qf||(qf={}));function T9(e){let{acceleration:t,activator:n=wu.Pointer,canScroll:r,draggingRect:s,enabled:a,interval:l=5,order:u=qf.TreeOrder,pointerCoordinates:h,scrollableAncestors:d,scrollableAncestorRects:m,delta:g,threshold:_}=e;const b=N9({delta:g,disabled:!a}),[w,S]=B7(),C=y.useRef({x:0,y:0}),k=y.useRef({x:0,y:0}),R=y.useMemo(()=>{switch(n){case wu.Pointer:return h?{top:h.y,bottom:h.y,left:h.x,right:h.x}:null;case wu.DraggableRect:return s}},[n,s,h]),T=y.useRef(null),N=y.useCallback(()=>{const A=T.current;if(!A)return;const O=C.current.x*k.current.x,F=C.current.y*k.current.y;A.scrollBy(O,F)},[]),L=y.useMemo(()=>u===qf.TreeOrder?[...d].reverse():d,[u,d]);y.useEffect(()=>{if(!a||!d.length||!R){S();return}for(const A of L){if((r==null?void 0:r(A))===!1)continue;const O=d.indexOf(A),F=m[O];if(!F)continue;const{direction:G,speed:B}=m9(A,F,R,t,_);for(const H of["x","y"])b[H][G[H]]||(B[H]=0,G[H]=0);if(B.x>0||B.y>0){S(),T.current=A,w(N,l),C.current=B,k.current=G;return}}C.current={x:0,y:0},k.current={x:0,y:0},S()},[t,N,r,S,a,l,JSON.stringify(R),JSON.stringify(b),w,d,L,m,JSON.stringify(_)])}const M9={x:{[wn.Backward]:!1,[wn.Forward]:!1},y:{[wn.Backward]:!1,[wn.Forward]:!1}};function N9(e){let{delta:t,disabled:n}=e;const r=H_(t);return nd(s=>{if(n||!r||!s)return M9;const a={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[wn.Backward]:s.x[wn.Backward]||a.x===-1,[wn.Forward]:s.x[wn.Forward]||a.x===1},y:{[wn.Backward]:s.y[wn.Backward]||a.y===-1,[wn.Forward]:s.y[wn.Forward]||a.y===1}}},[n,t,r])}function A9(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return nd(s=>{var a;return t==null?null:(a=r??s)!=null?a:null},[r,t])}function D9(e,t){return y.useMemo(()=>e.reduce((n,r)=>{const{sensor:s}=r,a=s.activators.map(l=>({eventName:l.eventName,handler:t(l.handler,r)}));return[...n,...a]},[]),[e,t])}var Pu;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Pu||(Pu={}));var W_;(function(e){e.Optimized="optimized"})(W_||(W_={}));const b2=new Map;function O9(e,t){let{dragging:n,dependencies:r,config:s}=t;const[a,l]=y.useState(null),{frequency:u,measure:h,strategy:d}=s,m=y.useRef(e),g=C(),_=Lu(g),b=y.useCallback(function(k){k===void 0&&(k=[]),!_.current&&l(R=>R===null?k:R.concat(k.filter(T=>!R.includes(T))))},[_]),w=y.useRef(null),S=nd(k=>{if(g&&!n)return b2;if(!k||k===b2||m.current!==e||a!=null){const R=new Map;for(let T of e){if(!T)continue;if(a&&a.length>0&&!a.includes(T.id)&&T.rect.current){R.set(T.id,T.rect.current);continue}const N=T.node.current,L=N?new t0(h(N),N):null;T.rect.current=L,L&&R.set(T.id,L)}return R}return k},[e,a,n,g,h]);return y.useEffect(()=>{m.current=e},[e]),y.useEffect(()=>{g||b()},[n,g]),y.useEffect(()=>{a&&a.length>0&&l(null)},[JSON.stringify(a)]),y.useEffect(()=>{g||typeof u!="number"||w.current!==null||(w.current=setTimeout(()=>{b(),w.current=null},u))},[u,g,b,...r]),{droppableRects:S,measureDroppableContainers:b,measuringScheduled:a!=null};function C(){switch(d){case Pu.Always:return!1;case Pu.BeforeDragging:return n;default:return!n}}}function jM(e,t){return nd(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function j9(e,t){return jM(e,t)}function L9(e){let{callback:t,disabled:n}=e;const r=Qb(t),s=y.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:a}=window;return new a(r)},[r,n]);return y.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function Dp(e){let{callback:t,disabled:n}=e;const r=Qb(t),s=y.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:a}=window;return new a(r)},[n]);return y.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function z9(e){return new t0(Wl(e),e)}function x2(e,t,n){t===void 0&&(t=z9);const[r,s]=y.useState(null);function a(){s(h=>{if(!e)return null;if(e.isConnected===!1){var d;return(d=h??n)!=null?d:null}const m=t(e);return JSON.stringify(h)===JSON.stringify(m)?h:m})}const l=L9({callback(h){if(e)for(const d of h){const{type:m,target:g}=d;if(m==="childList"&&g instanceof HTMLElement&&g.contains(e)){a();break}}}}),u=Dp({callback:a});return Li(()=>{a(),e?(u==null||u.observe(e),l==null||l.observe(document.body,{childList:!0,subtree:!0})):(u==null||u.disconnect(),l==null||l.disconnect())},[e]),r}function P9(e){const t=jM(e);return EM(e,t)}const w2=[];function B9(e){const t=y.useRef(e),n=nd(r=>e?r&&r!==w2&&e&&t.current&&e.parentNode===t.current.parentNode?r:e0(e):w2,[e]);return y.useEffect(()=>{t.current=e},[e]),n}function I9(e){const[t,n]=y.useState(null),r=y.useRef(e),s=y.useCallback(a=>{const l=Dv(a.target);l&&n(u=>u?(u.set(l,U_(l)),new Map(u)):null)},[]);return y.useEffect(()=>{const a=r.current;if(e!==a){l(a);const u=e.map(h=>{const d=Dv(h);return d?(d.addEventListener("scroll",s,{passive:!0}),[d,U_(d)]):null}).filter(h=>h!=null);n(u.length?new Map(u):null),r.current=e}return()=>{l(e),l(a)};function l(u){u.forEach(h=>{const d=Dv(h);d==null||d.removeEventListener("scroll",s)})}},[s,e]),y.useMemo(()=>e.length?t?Array.from(t.values()).reduce((a,l)=>Sl(a,l),pi):DM(e):pi,[e,t])}function S2(e,t){t===void 0&&(t=[]);const n=y.useRef(null);return y.useEffect(()=>{n.current=null},t),y.useEffect(()=>{const r=e!==pi;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?Wf(e,n.current):pi}function H9(e){y.useEffect(()=>{if(!Ap)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n==null||n()}},e.map(t=>{let{sensor:n}=t;return n}))}function F9(e,t){return y.useMemo(()=>e.reduce((n,r)=>{let{eventName:s,handler:a}=r;return n[s]=l=>{a(l,t)},n},{}),[e,t])}function LM(e){return y.useMemo(()=>e?d9(e):null,[e])}const C2=[];function U9(e,t){t===void 0&&(t=Wl);const[n]=e,r=LM(n?gr(n):null),[s,a]=y.useState(C2);function l(){a(()=>e.length?e.map(h=>NM(h)?r:new t0(t(h),h)):C2)}const u=Dp({callback:l});return Li(()=>{u==null||u.disconnect(),l(),e.forEach(h=>u==null?void 0:u.observe(h))},[e]),s}function $9(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return td(t)?t:e}function W9(e){let{measure:t}=e;const[n,r]=y.useState(null),s=y.useCallback(d=>{for(const{target:m}of d)if(td(m)){r(g=>{const _=t(m);return g?{...g,width:_.width,height:_.height}:_});break}},[t]),a=Dp({callback:s}),l=y.useCallback(d=>{const m=$9(d);a==null||a.disconnect(),m&&(a==null||a.observe(m)),r(m?t(m):null)},[t,a]),[u,h]=$f(l);return y.useMemo(()=>({nodeRef:u,rect:n,setRef:h}),[n,u,h])}const V9=[{sensor:i0,options:{}},{sensor:n0,options:{}}],q9={current:{}},mf={draggable:{measure:g2},droppable:{measure:g2,strategy:Pu.WhileDragging,frequency:W_.Optimized},dragOverlay:{measure:Wl}};class Su extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const K9={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Su,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Vf},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:mf,measureDroppableContainers:Vf,windowRect:null,measuringScheduled:!1},G9={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Vf,draggableNodes:new Map,over:null,measureDroppableContainers:Vf},Op=y.createContext(G9),zM=y.createContext(K9);function Y9(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Su}}}function X9(e,t){switch(t.type){case vn.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case vn.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case vn.DragEnd:case vn.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case vn.RegisterDroppable:{const{element:n}=t,{id:r}=n,s=new Su(e.droppable.containers);return s.set(r,n),{...e,droppable:{...e.droppable,containers:s}}}case vn.SetDroppableDisabled:{const{id:n,key:r,disabled:s}=t,a=e.droppable.containers.get(n);if(!a||r!==a.key)return e;const l=new Su(e.droppable.containers);return l.set(n,{...a,disabled:s}),{...e,droppable:{...e.droppable,containers:l}}}case vn.UnregisterDroppable:{const{id:n,key:r}=t,s=e.droppable.containers.get(n);if(!s||r!==s.key)return e;const a=new Su(e.droppable.containers);return a.delete(n),{...e,droppable:{...e.droppable,containers:a}}}default:return e}}function Z9(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:s}=y.useContext(Op),a=H_(r),l=H_(n==null?void 0:n.id);return y.useEffect(()=>{if(!t&&!r&&a&&l!=null){if(!Jb(a)||document.activeElement===a.target)return;const u=s.get(l);if(!u)return;const{activatorNode:h,node:d}=u;if(!h.current&&!d.current)return;requestAnimationFrame(()=>{for(const m of[h.current,d.current]){if(!m)continue;const g=F7(m);if(g){g.focus();break}}})}},[r,t,s,l,a]),null}function Q9(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((s,a)=>a({transform:s,...r}),n):n}function J9(e){return y.useMemo(()=>({draggable:{...mf.draggable,...e==null?void 0:e.draggable},droppable:{...mf.droppable,...e==null?void 0:e.droppable},dragOverlay:{...mf.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function eH(e){let{activeNode:t,measure:n,initialRect:r,config:s=!0}=e;const a=y.useRef(!1),{x:l,y:u}=typeof s=="boolean"?{x:s,y:s}:s;Li(()=>{if(!l&&!u||!t){a.current=!1;return}if(a.current||!r)return;const d=t==null?void 0:t.node.current;if(!d||d.isConnected===!1)return;const m=n(d),g=EM(m,r);if(l||(g.x=0),u||(g.y=0),a.current=!0,Math.abs(g.x)>0||Math.abs(g.y)>0){const _=RM(d);_&&_.scrollBy({top:g.y,left:g.x})}},[t,l,u,r,n])}const PM=y.createContext({...pi,scaleX:1,scaleY:1});var eo;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(eo||(eo={}));const tH=y.memo(function(t){var n,r,s,a;let{id:l,accessibility:u,autoScroll:h=!0,children:d,sensors:m=V9,collisionDetection:g=i9,measuring:_,modifiers:b,...w}=t;const S=y.useReducer(X9,void 0,Y9),[C,k]=S,[R,T]=K7(),[N,L]=y.useState(eo.Uninitialized),A=N===eo.Initialized,{draggable:{active:O,nodes:F,translate:G},droppable:{containers:B}}=C,H=O!=null?F.get(O):null,P=y.useRef({initial:null,translated:null}),U=y.useMemo(()=>{var kt;return O!=null?{id:O,data:(kt=H==null?void 0:H.data)!=null?kt:q9,rect:P}:null},[O,H]),V=y.useRef(null),[W,z]=y.useState(null),[$,q]=y.useState(null),Q=Lu(w,Object.values(w)),M=rd("DndDescribedBy",l),I=y.useMemo(()=>B.getEnabled(),[B]),Z=J9(_),{droppableRects:j,measureDroppableContainers:ce,measuringScheduled:fe}=O9(I,{dragging:A,dependencies:[G.x,G.y],config:Z.droppable}),ue=A9(F,O),de=y.useMemo(()=>$?F_($):null,[$]),we=Xn(),oe=j9(ue,Z.draggable.measure);eH({activeNode:O!=null?F.get(O):null,config:we.layoutShiftCompensation,initialRect:oe,measure:Z.draggable.measure});const be=x2(ue,Z.draggable.measure,oe),Ne=x2(ue?ue.parentElement:null),Se=y.useRef({activatorEvent:null,active:null,activeNode:ue,collisionRect:null,collisions:null,droppableRects:j,draggableNodes:F,draggingNode:null,draggingNodeRect:null,droppableContainers:B,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),_e=B.getNodeFor((n=Se.current.over)==null?void 0:n.id),xe=W9({measure:Z.dragOverlay.measure}),He=(r=xe.nodeRef.current)!=null?r:ue,Fe=A?(s=xe.rect)!=null?s:be:null,et=!!(xe.nodeRef.current&&xe.rect),dt=P9(et?null:be),mt=LM(He?gr(He):null),bt=B9(A?_e??ue:null),un=U9(bt),Zt=Q9(b,{transform:{x:G.x-dt.x,y:G.y-dt.y,scaleX:1,scaleY:1},activatorEvent:$,active:U,activeNodeRect:be,containerNodeRect:Ne,draggingNodeRect:Fe,over:Se.current.over,overlayNodeRect:xe.rect,scrollableAncestors:bt,scrollableAncestorRects:un,windowRect:mt}),Nn=de?Sl(de,G):null,Dt=I9(bt),Yn=S2(Dt),Y=S2(Dt,[be]),le=Sl(Zt,Yn),Re=Fe?a9(Fe,Zt):null,ze=U&&Re?g({active:U,collisionRect:Re,droppableRects:j,droppableContainers:I,pointerCoordinates:Nn}):null,$e=t9(ze,"id"),[ht,ee]=y.useState(null),Xe=et?Zt:Sl(Zt,Y),gt=s9(Xe,(a=ht==null?void 0:ht.rect)!=null?a:null,be),ie=y.useRef(null),Te=y.useCallback((kt,Et)=>{let{sensor:Lt,options:Dn}=Et;if(V.current==null)return;const On=F.get(V.current);if(!On)return;const re=kt.nativeEvent,ve=new Lt({active:V.current,activeNode:On,event:re,options:Dn,context:Se,onAbort(Ve){if(!F.get(Ve))return;const{onDragAbort:jn}=Q.current,Dr={id:Ve};jn==null||jn(Dr),R({type:"onDragAbort",event:Dr})},onPending(Ve,wt,jn,Dr){if(!F.get(Ve))return;const{onDragPending:Hi}=Q.current,ti={id:Ve,constraint:wt,initialCoordinates:jn,offset:Dr};Hi==null||Hi(ti),R({type:"onDragPending",event:ti})},onStart(Ve){const wt=V.current;if(wt==null)return;const jn=F.get(wt);if(!jn)return;const{onDragStart:Dr}=Q.current,Ii={activatorEvent:re,active:{id:wt,data:jn.data,rect:P}};Ri.unstable_batchedUpdates(()=>{Dr==null||Dr(Ii),L(eo.Initializing),k({type:vn.DragStart,initialCoordinates:Ve,active:wt}),R({type:"onDragStart",event:Ii}),z(ie.current),q(re)})},onMove(Ve){k({type:vn.DragMove,coordinates:Ve})},onEnd:We(vn.DragEnd),onCancel:We(vn.DragCancel)});ie.current=ve;function We(Ve){return async function(){const{active:jn,collisions:Dr,over:Ii,scrollAdjustedTranslate:Hi}=Se.current;let ti=null;if(jn&&Hi){const{cancelDrop:ws}=Q.current;ti={activatorEvent:re,active:jn,collisions:Dr,delta:Hi,over:Ii},Ve===vn.DragEnd&&typeof ws=="function"&&await Promise.resolve(ws(ti))&&(Ve=vn.DragCancel)}V.current=null,Ri.unstable_batchedUpdates(()=>{k({type:Ve}),L(eo.Uninitialized),ee(null),z(null),q(null),ie.current=null;const ws=Ve===vn.DragEnd?"onDragEnd":"onDragCancel";if(ti){const Or=Q.current[ws];Or==null||Or(ti),R({type:ws,event:ti})}})}}},[F]),ct=y.useCallback((kt,Et)=>(Lt,Dn)=>{const On=Lt.nativeEvent,re=F.get(Dn);if(V.current!==null||!re||On.dndKit||On.defaultPrevented)return;const ve={active:re};kt(Lt,Et.options,ve)===!0&&(On.dndKit={capturedBy:Et.sensor},V.current=Dn,Te(Lt,Et))},[F,Te]),xt=D9(m,ct);H9(m),Li(()=>{be&&N===eo.Initializing&&L(eo.Initialized)},[be,N]),y.useEffect(()=>{const{onDragMove:kt}=Q.current,{active:Et,activatorEvent:Lt,collisions:Dn,over:On}=Se.current;if(!Et||!Lt)return;const re={active:Et,activatorEvent:Lt,collisions:Dn,delta:{x:le.x,y:le.y},over:On};Ri.unstable_batchedUpdates(()=>{kt==null||kt(re),R({type:"onDragMove",event:re})})},[le.x,le.y]),y.useEffect(()=>{const{active:kt,activatorEvent:Et,collisions:Lt,droppableContainers:Dn,scrollAdjustedTranslate:On}=Se.current;if(!kt||V.current==null||!Et||!On)return;const{onDragOver:re}=Q.current,ve=Dn.get($e),We=ve&&ve.rect.current?{id:ve.id,rect:ve.rect.current,data:ve.data,disabled:ve.disabled}:null,Ve={active:kt,activatorEvent:Et,collisions:Lt,delta:{x:On.x,y:On.y},over:We};Ri.unstable_batchedUpdates(()=>{ee(We),re==null||re(Ve),R({type:"onDragOver",event:Ve})})},[$e]),Li(()=>{Se.current={activatorEvent:$,active:U,activeNode:ue,collisionRect:Re,collisions:ze,droppableRects:j,draggableNodes:F,draggingNode:He,draggingNodeRect:Fe,droppableContainers:B,over:ht,scrollableAncestors:bt,scrollAdjustedTranslate:le},P.current={initial:Fe,translated:Re}},[U,ue,ze,Re,F,He,Fe,j,B,ht,bt,le]),T9({...we,delta:G,draggingRect:Re,pointerCoordinates:Nn,scrollableAncestors:bt,scrollableAncestorRects:un});const dn=y.useMemo(()=>({active:U,activeNode:ue,activeNodeRect:be,activatorEvent:$,collisions:ze,containerNodeRect:Ne,dragOverlay:xe,draggableNodes:F,droppableContainers:B,droppableRects:j,over:ht,measureDroppableContainers:ce,scrollableAncestors:bt,scrollableAncestorRects:un,measuringConfiguration:Z,measuringScheduled:fe,windowRect:mt}),[U,ue,be,$,ze,Ne,xe,F,B,j,ht,ce,bt,un,Z,fe,mt]),An=y.useMemo(()=>({activatorEvent:$,activators:xt,active:U,activeNodeRect:be,ariaDescribedById:{draggable:M},dispatch:k,draggableNodes:F,over:ht,measureDroppableContainers:ce}),[$,xt,U,be,k,M,F,ht,ce]);return Pt.createElement(kM.Provider,{value:T},Pt.createElement(Op.Provider,{value:An},Pt.createElement(zM.Provider,{value:dn},Pt.createElement(PM.Provider,{value:gt},d)),Pt.createElement(Z9,{disabled:(u==null?void 0:u.restoreFocus)===!1})),Pt.createElement(X7,{...u,hiddenTextDescribedById:M}));function Xn(){const kt=(W==null?void 0:W.autoScrollEnabled)===!1,Et=typeof h=="object"?h.enabled===!1:h===!1,Lt=A&&!kt&&!Et;return typeof h=="object"?{...h,enabled:Lt}:{enabled:Lt}}}),nH=y.createContext(null),k2="button",rH="Draggable";function iH(e){let{id:t,data:n,disabled:r=!1,attributes:s}=e;const a=rd(rH),{activators:l,activatorEvent:u,active:h,activeNodeRect:d,ariaDescribedById:m,draggableNodes:g,over:_}=y.useContext(Op),{role:b=k2,roleDescription:w="draggable",tabIndex:S=0}=s??{},C=(h==null?void 0:h.id)===t,k=y.useContext(C?PM:nH),[R,T]=$f(),[N,L]=$f(),A=F9(l,t),O=Lu(n);Li(()=>(g.set(t,{id:t,key:a,node:R,activatorNode:N,data:O}),()=>{const G=g.get(t);G&&G.key===a&&g.delete(t)}),[g,t]);const F=y.useMemo(()=>({role:b,tabIndex:S,"aria-disabled":r,"aria-pressed":C&&b===k2?!0:void 0,"aria-roledescription":w,"aria-describedby":m.draggable}),[r,b,S,C,w,m.draggable]);return{active:h,activatorEvent:u,activeNodeRect:d,attributes:F,isDragging:C,listeners:r?void 0:A,node:R,over:_,setNodeRef:T,setActivatorNodeRef:L,transform:k}}function sH(){return y.useContext(zM)}const oH="Droppable",aH={timeout:25};function lH(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:s}=e;const a=rd(oH),{active:l,dispatch:u,over:h,measureDroppableContainers:d}=y.useContext(Op),m=y.useRef({disabled:n}),g=y.useRef(!1),_=y.useRef(null),b=y.useRef(null),{disabled:w,updateMeasurementsFor:S,timeout:C}={...aH,...s},k=Lu(S??r),R=y.useCallback(()=>{if(!g.current){g.current=!0;return}b.current!=null&&clearTimeout(b.current),b.current=setTimeout(()=>{d(Array.isArray(k.current)?k.current:[k.current]),b.current=null},C)},[C]),T=Dp({callback:R,disabled:w||!l}),N=y.useCallback((F,G)=>{T&&(G&&(T.unobserve(G),g.current=!1),F&&T.observe(F))},[T]),[L,A]=$f(N),O=Lu(t);return y.useEffect(()=>{!T||!L.current||(T.disconnect(),g.current=!1,T.observe(L.current))},[L,T]),y.useEffect(()=>(u({type:vn.RegisterDroppable,element:{id:r,key:a,disabled:n,node:L,rect:_,data:O}}),()=>u({type:vn.UnregisterDroppable,key:a,id:r})),[r]),y.useEffect(()=>{n!==m.current.disabled&&(u({type:vn.SetDroppableDisabled,id:r,key:a,disabled:n}),m.current.disabled=n)},[r,a,n,u]),{active:l,rect:_,isOver:(h==null?void 0:h.id)===r,node:L,over:h,setNodeRef:A}}function s0(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function cH(e,t){return e.reduce((n,r,s)=>{const a=t.get(r);return a&&(n[s]=a),n},Array(e.length))}function Ih(e){return e!==null&&e>=0}function uH(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function dH(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const BM=e=>{let{rects:t,activeIndex:n,overIndex:r,index:s}=e;const a=s0(t,r,n),l=t[s],u=a[s];return!u||!l?null:{x:u.left-l.left,y:u.top-l.top,scaleX:u.width/l.width,scaleY:u.height/l.height}},Hh={scaleX:1,scaleY:1},hH=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:s,rects:a,overIndex:l}=e;const u=(t=a[n])!=null?t:r;if(!u)return null;if(s===n){const d=a[l];return d?{x:0,y:n<l?d.top+d.height-(u.top+u.height):d.top-u.top,...Hh}:null}const h=fH(a,s,n);return s>n&&s<=l?{x:0,y:-u.height-h,...Hh}:s<n&&s>=l?{x:0,y:u.height+h,...Hh}:{x:0,y:0,...Hh}};function fH(e,t,n){const r=e[t],s=e[t-1],a=e[t+1];return r?n<t?s?r.top-(s.top+s.height):a?a.top-(r.top+r.height):0:a?a.top-(r.top+r.height):s?r.top-(s.top+s.height):0:0}const IM="Sortable",HM=Pt.createContext({activeIndex:-1,containerId:IM,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:BM,disabled:{draggable:!1,droppable:!1}});function pH(e){let{children:t,id:n,items:r,strategy:s=BM,disabled:a=!1}=e;const{active:l,dragOverlay:u,droppableRects:h,over:d,measureDroppableContainers:m}=sH(),g=rd(IM,n),_=u.rect!==null,b=y.useMemo(()=>r.map(A=>typeof A=="object"&&"id"in A?A.id:A),[r]),w=l!=null,S=l?b.indexOf(l.id):-1,C=d?b.indexOf(d.id):-1,k=y.useRef(b),R=!uH(b,k.current),T=C!==-1&&S===-1||R,N=dH(a);Li(()=>{R&&w&&m(b)},[R,b,w,m]),y.useEffect(()=>{k.current=b},[b]);const L=y.useMemo(()=>({activeIndex:S,containerId:g,disabled:N,disableTransforms:T,items:b,overIndex:C,useDragOverlay:_,sortedRects:cH(b,h),strategy:s}),[S,g,N.draggable,N.droppable,T,b,C,h,_,s]);return Pt.createElement(HM.Provider,{value:L},t)}const mH=e=>{let{id:t,items:n,activeIndex:r,overIndex:s}=e;return s0(n,r,s).indexOf(t)},gH=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:s,items:a,newIndex:l,previousItems:u,previousContainerId:h,transition:d}=e;return!d||!r||u!==a&&s===l?!1:n?!0:l!==s&&t===h},vH={duration:200,easing:"ease"},FM="transform",_H=zu.Transition.toString({property:FM,duration:0,easing:"linear"}),yH={roleDescription:"sortable"};function bH(e){let{disabled:t,index:n,node:r,rect:s}=e;const[a,l]=y.useState(null),u=y.useRef(n);return Li(()=>{if(!t&&n!==u.current&&r.current){const h=s.current;if(h){const d=Wl(r.current,{ignoreTransform:!0}),m={x:h.left-d.left,y:h.top-d.top,scaleX:h.width/d.width,scaleY:h.height/d.height};(m.x||m.y)&&l(m)}}n!==u.current&&(u.current=n)},[t,n,r,s]),y.useEffect(()=>{a&&l(null)},[a]),a}function xH(e){let{animateLayoutChanges:t=gH,attributes:n,disabled:r,data:s,getNewIndex:a=mH,id:l,strategy:u,resizeObserverConfig:h,transition:d=vH}=e;const{items:m,containerId:g,activeIndex:_,disabled:b,disableTransforms:w,sortedRects:S,overIndex:C,useDragOverlay:k,strategy:R}=y.useContext(HM),T=wH(r,b),N=m.indexOf(l),L=y.useMemo(()=>({sortable:{containerId:g,index:N,items:m},...s}),[g,s,N,m]),A=y.useMemo(()=>m.slice(m.indexOf(l)),[m,l]),{rect:O,node:F,isOver:G,setNodeRef:B}=lH({id:l,data:L,disabled:T.droppable,resizeObserverConfig:{updateMeasurementsFor:A,...h}}),{active:H,activatorEvent:P,activeNodeRect:U,attributes:V,setNodeRef:W,listeners:z,isDragging:$,over:q,setActivatorNodeRef:Q,transform:M}=iH({id:l,data:L,attributes:{...yH,...n},disabled:T.draggable}),I=P7(B,W),Z=!!H,j=Z&&!w&&Ih(_)&&Ih(C),ce=!k&&$,fe=ce&&j?M:null,de=j?fe??(u??R)({rects:S,activeNodeRect:U,activeIndex:_,overIndex:C,index:N}):null,we=Ih(_)&&Ih(C)?a({id:l,items:m,activeIndex:_,overIndex:C}):N,oe=H==null?void 0:H.id,be=y.useRef({activeId:oe,items:m,newIndex:we,containerId:g}),Ne=m!==be.current.items,Se=t({active:H,containerId:g,isDragging:$,isSorting:Z,id:l,index:N,items:m,newIndex:be.current.newIndex,previousItems:be.current.items,previousContainerId:be.current.containerId,transition:d,wasDragging:be.current.activeId!=null}),_e=bH({disabled:!Se,index:N,node:F,rect:O});return y.useEffect(()=>{Z&&be.current.newIndex!==we&&(be.current.newIndex=we),g!==be.current.containerId&&(be.current.containerId=g),m!==be.current.items&&(be.current.items=m)},[Z,we,g,m]),y.useEffect(()=>{if(oe===be.current.activeId)return;if(oe!=null&&be.current.activeId==null){be.current.activeId=oe;return}const He=setTimeout(()=>{be.current.activeId=oe},50);return()=>clearTimeout(He)},[oe]),{active:H,activeIndex:_,attributes:V,data:L,rect:O,index:N,newIndex:we,items:m,isOver:G,isSorting:Z,isDragging:$,listeners:z,node:F,overIndex:C,over:q,setNodeRef:I,setActivatorNodeRef:Q,setDroppableNodeRef:B,setDraggableNodeRef:W,transform:_e??de,transition:xe()};function xe(){if(_e||Ne&&be.current.newIndex===N)return _H;if(!(ce&&!Jb(P)||!d)&&(Z||Se))return zu.Transition.toString({...d,property:FM})}}function wH(e,t){var n,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e==null?void 0:e.draggable)!=null?n:t.draggable,droppable:(r=e==null?void 0:e.droppable)!=null?r:t.droppable}}_t.Down,_t.Right,_t.Up,_t.Left;function o0(e){const t=e+"CollectionProvider",[n,r]=vs(t),[s,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),l=S=>{const{scope:C,children:k}=S,R=Pt.useRef(null),T=Pt.useRef(new Map).current;return p.jsx(s,{scope:C,itemMap:T,collectionRef:R,children:k})};l.displayName=t;const u=e+"CollectionSlot",h=Zo(u),d=Pt.forwardRef((S,C)=>{const{scope:k,children:R}=S,T=a(u,k),N=yt(C,T.collectionRef);return p.jsx(h,{ref:N,children:R})});d.displayName=u;const m=e+"CollectionItemSlot",g="data-radix-collection-item",_=Zo(m),b=Pt.forwardRef((S,C)=>{const{scope:k,children:R,...T}=S,N=Pt.useRef(null),L=yt(C,N),A=a(m,k);return Pt.useEffect(()=>(A.itemMap.set(N,{ref:N,...T}),()=>void A.itemMap.delete(N))),p.jsx(_,{[g]:"",ref:L,children:R})});b.displayName=m;function w(S){const C=a(e+"CollectionConsumer",S);return Pt.useCallback(()=>{const R=C.collectionRef.current;if(!R)return[];const T=Array.from(R.querySelectorAll(`[${g}]`));return Array.from(C.itemMap.values()).sort((A,O)=>T.indexOf(A.ref.current)-T.indexOf(O.ref.current))},[C.collectionRef,C.itemMap])}return[{Provider:l,Slot:d,ItemSlot:b},w,r]}var SH=y.createContext(void 0);function a0(e){const t=y.useContext(SH);return e||t||"ltr"}var Lv="rovingFocusGroup.onEntryFocus",CH={bubbles:!1,cancelable:!0},id="RovingFocusGroup",[V_,UM,kH]=o0(id),[EH,$M]=vs(id,[kH]),[RH,TH]=EH(id),WM=y.forwardRef((e,t)=>p.jsx(V_.Provider,{scope:e.__scopeRovingFocusGroup,children:p.jsx(V_.Slot,{scope:e.__scopeRovingFocusGroup,children:p.jsx(MH,{...e,ref:t})})}));WM.displayName=id;var MH=y.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:a,currentTabStopId:l,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:h,onEntryFocus:d,preventScrollOnEntryFocus:m=!1,...g}=e,_=y.useRef(null),b=yt(t,_),w=a0(a),[S,C]=Rl({prop:l,defaultProp:u??null,onChange:h,caller:id}),[k,R]=y.useState(!1),T=di(d),N=UM(n),L=y.useRef(!1),[A,O]=y.useState(0);return y.useEffect(()=>{const F=_.current;if(F)return F.addEventListener(Lv,T),()=>F.removeEventListener(Lv,T)},[T]),p.jsx(RH,{scope:n,orientation:r,dir:w,loop:s,currentTabStopId:S,onItemFocus:y.useCallback(F=>C(F),[C]),onItemShiftTab:y.useCallback(()=>R(!0),[]),onFocusableItemAdd:y.useCallback(()=>O(F=>F+1),[]),onFocusableItemRemove:y.useCallback(()=>O(F=>F-1),[]),children:p.jsx(st.div,{tabIndex:k||A===0?-1:0,"data-orientation":r,...g,ref:b,style:{outline:"none",...e.style},onMouseDown:Ae(e.onMouseDown,()=>{L.current=!0}),onFocus:Ae(e.onFocus,F=>{const G=!L.current;if(F.target===F.currentTarget&&G&&!k){const B=new CustomEvent(Lv,CH);if(F.currentTarget.dispatchEvent(B),!B.defaultPrevented){const H=N().filter(z=>z.focusable),P=H.find(z=>z.active),U=H.find(z=>z.id===S),W=[P,U,...H].filter(Boolean).map(z=>z.ref.current);KM(W,m)}}L.current=!1}),onBlur:Ae(e.onBlur,()=>R(!1))})})}),VM="RovingFocusGroupItem",qM=y.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:a,children:l,...u}=e,h=ds(),d=a||h,m=TH(VM,n),g=m.currentTabStopId===d,_=UM(n),{onFocusableItemAdd:b,onFocusableItemRemove:w,currentTabStopId:S}=m;return y.useEffect(()=>{if(r)return b(),()=>w()},[r,b,w]),p.jsx(V_.ItemSlot,{scope:n,id:d,focusable:r,active:s,children:p.jsx(st.span,{tabIndex:g?0:-1,"data-orientation":m.orientation,...u,ref:t,onMouseDown:Ae(e.onMouseDown,C=>{r?m.onItemFocus(d):C.preventDefault()}),onFocus:Ae(e.onFocus,()=>m.onItemFocus(d)),onKeyDown:Ae(e.onKeyDown,C=>{if(C.key==="Tab"&&C.shiftKey){m.onItemShiftTab();return}if(C.target!==C.currentTarget)return;const k=DH(C,m.orientation,m.dir);if(k!==void 0){if(C.metaKey||C.ctrlKey||C.altKey||C.shiftKey)return;C.preventDefault();let T=_().filter(N=>N.focusable).map(N=>N.ref.current);if(k==="last")T.reverse();else if(k==="prev"||k==="next"){k==="prev"&&T.reverse();const N=T.indexOf(C.currentTarget);T=m.loop?OH(T,N+1):T.slice(N+1)}setTimeout(()=>KM(T))}}),children:typeof l=="function"?l({isCurrentTabStop:g,hasTabStop:S!=null}):l})})});qM.displayName=VM;var NH={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function AH(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function DH(e,t,n){const r=AH(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return NH[r]}function KM(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function OH(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var jH=WM,LH=qM,q_=["Enter"," "],zH=["ArrowDown","PageUp","Home"],GM=["ArrowUp","PageDown","End"],PH=[...zH,...GM],BH={ltr:[...q_,"ArrowRight"],rtl:[...q_,"ArrowLeft"]},IH={ltr:["ArrowLeft"],rtl:["ArrowRight"]},sd="Menu",[Bu,HH,FH]=o0(sd),[ha,YM]=vs(sd,[FH,po,$M]),jp=po(),XM=$M(),[UH,fa]=ha(sd),[$H,od]=ha(sd),ZM=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:s,onOpenChange:a,modal:l=!0}=e,u=jp(t),[h,d]=y.useState(null),m=y.useRef(!1),g=di(a),_=a0(s);return y.useEffect(()=>{const b=()=>{m.current=!0,document.addEventListener("pointerdown",w,{capture:!0,once:!0}),document.addEventListener("pointermove",w,{capture:!0,once:!0})},w=()=>m.current=!1;return document.addEventListener("keydown",b,{capture:!0}),()=>{document.removeEventListener("keydown",b,{capture:!0}),document.removeEventListener("pointerdown",w,{capture:!0}),document.removeEventListener("pointermove",w,{capture:!0})}},[]),p.jsx(Cp,{...u,children:p.jsx(UH,{scope:t,open:n,onOpenChange:g,content:h,onContentChange:d,children:p.jsx($H,{scope:t,onClose:y.useCallback(()=>g(!1),[g]),isUsingKeyboardRef:m,dir:_,modal:l,children:r})})})};ZM.displayName=sd;var WH="MenuAnchor",l0=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=jp(n);return p.jsx(Ju,{...s,...r,ref:t})});l0.displayName=WH;var c0="MenuPortal",[VH,QM]=ha(c0,{forceMount:void 0}),JM=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:s}=e,a=fa(c0,t);return p.jsx(VH,{scope:t,forceMount:n,children:p.jsx(ei,{present:n||a.open,children:p.jsx(Il,{asChild:!0,container:s,children:r})})})};JM.displayName=c0;var Zr="MenuContent",[qH,u0]=ha(Zr),eN=y.forwardRef((e,t)=>{const n=QM(Zr,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,a=fa(Zr,e.__scopeMenu),l=od(Zr,e.__scopeMenu);return p.jsx(Bu.Provider,{scope:e.__scopeMenu,children:p.jsx(ei,{present:r||a.open,children:p.jsx(Bu.Slot,{scope:e.__scopeMenu,children:l.modal?p.jsx(KH,{...s,ref:t}):p.jsx(GH,{...s,ref:t})})})})}),KH=y.forwardRef((e,t)=>{const n=fa(Zr,e.__scopeMenu),r=y.useRef(null),s=yt(t,r);return y.useEffect(()=>{const a=r.current;if(a)return vp(a)},[]),p.jsx(d0,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Ae(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),GH=y.forwardRef((e,t)=>{const n=fa(Zr,e.__scopeMenu);return p.jsx(d0,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),YH=Zo("MenuContent.ScrollLock"),d0=y.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:s,onOpenAutoFocus:a,onCloseAutoFocus:l,disableOutsidePointerEvents:u,onEntryFocus:h,onEscapeKeyDown:d,onPointerDownOutside:m,onFocusOutside:g,onInteractOutside:_,onDismiss:b,disableOutsideScroll:w,...S}=e,C=fa(Zr,n),k=od(Zr,n),R=jp(n),T=XM(n),N=HH(n),[L,A]=y.useState(null),O=y.useRef(null),F=yt(t,O,C.onContentChange),G=y.useRef(0),B=y.useRef(""),H=y.useRef(0),P=y.useRef(null),U=y.useRef("right"),V=y.useRef(0),W=w?Xu:y.Fragment,z=w?{as:YH,allowPinchZoom:!0}:void 0,$=Q=>{var de,we;const M=B.current+Q,I=N().filter(oe=>!oe.disabled),Z=document.activeElement,j=(de=I.find(oe=>oe.ref.current===Z))==null?void 0:de.textValue,ce=I.map(oe=>oe.textValue),fe=aF(ce,M,j),ue=(we=I.find(oe=>oe.textValue===fe))==null?void 0:we.ref.current;(function oe(be){B.current=be,window.clearTimeout(G.current),be!==""&&(G.current=window.setTimeout(()=>oe(""),1e3))})(M),ue&&setTimeout(()=>ue.focus())};y.useEffect(()=>()=>window.clearTimeout(G.current),[]),mp();const q=y.useCallback(Q=>{var I,Z;return U.current===((I=P.current)==null?void 0:I.side)&&cF(Q,(Z=P.current)==null?void 0:Z.area)},[]);return p.jsx(qH,{scope:n,searchRef:B,onItemEnter:y.useCallback(Q=>{q(Q)&&Q.preventDefault()},[q]),onItemLeave:y.useCallback(Q=>{var M;q(Q)||((M=O.current)==null||M.focus(),A(null))},[q]),onTriggerLeave:y.useCallback(Q=>{q(Q)&&Q.preventDefault()},[q]),pointerGraceTimerRef:H,onPointerGraceIntentChange:y.useCallback(Q=>{P.current=Q},[]),children:p.jsx(W,{...z,children:p.jsx(Yu,{asChild:!0,trapped:s,onMountAutoFocus:Ae(a,Q=>{var M;Q.preventDefault(),(M=O.current)==null||M.focus({preventScroll:!0})}),onUnmountAutoFocus:l,children:p.jsx(Bl,{asChild:!0,disableOutsidePointerEvents:u,onEscapeKeyDown:d,onPointerDownOutside:m,onFocusOutside:g,onInteractOutside:_,onDismiss:b,children:p.jsx(jH,{asChild:!0,...T,dir:k.dir,orientation:"vertical",loop:r,currentTabStopId:L,onCurrentTabStopIdChange:A,onEntryFocus:Ae(h,Q=>{k.isUsingKeyboardRef.current||Q.preventDefault()}),preventScrollOnEntryFocus:!0,children:p.jsx(kp,{role:"menu","aria-orientation":"vertical","data-state":gN(C.open),"data-radix-menu-content":"",dir:k.dir,...R,...S,ref:F,style:{outline:"none",...S.style},onKeyDown:Ae(S.onKeyDown,Q=>{const I=Q.target.closest("[data-radix-menu-content]")===Q.currentTarget,Z=Q.ctrlKey||Q.altKey||Q.metaKey,j=Q.key.length===1;I&&(Q.key==="Tab"&&Q.preventDefault(),!Z&&j&&$(Q.key));const ce=O.current;if(Q.target!==ce||!PH.includes(Q.key))return;Q.preventDefault();const ue=N().filter(de=>!de.disabled).map(de=>de.ref.current);GM.includes(Q.key)&&ue.reverse(),sF(ue)}),onBlur:Ae(e.onBlur,Q=>{Q.currentTarget.contains(Q.target)||(window.clearTimeout(G.current),B.current="")}),onPointerMove:Ae(e.onPointerMove,Iu(Q=>{const M=Q.target,I=V.current!==Q.clientX;if(Q.currentTarget.contains(M)&&I){const Z=Q.clientX>V.current?"right":"left";U.current=Z,V.current=Q.clientX}}))})})})})})})});eN.displayName=Zr;var XH="MenuGroup",h0=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return p.jsx(st.div,{role:"group",...r,ref:t})});h0.displayName=XH;var ZH="MenuLabel",tN=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return p.jsx(st.div,{...r,ref:t})});tN.displayName=ZH;var Kf="MenuItem",E2="menu.itemSelect",Lp=y.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...s}=e,a=y.useRef(null),l=od(Kf,e.__scopeMenu),u=u0(Kf,e.__scopeMenu),h=yt(t,a),d=y.useRef(!1),m=()=>{const g=a.current;if(!n&&g){const _=new CustomEvent(E2,{bubbles:!0,cancelable:!0});g.addEventListener(E2,b=>r==null?void 0:r(b),{once:!0}),XR(g,_),_.defaultPrevented?d.current=!1:l.onClose()}};return p.jsx(nN,{...s,ref:h,disabled:n,onClick:Ae(e.onClick,m),onPointerDown:g=>{var _;(_=e.onPointerDown)==null||_.call(e,g),d.current=!0},onPointerUp:Ae(e.onPointerUp,g=>{var _;d.current||(_=g.currentTarget)==null||_.click()}),onKeyDown:Ae(e.onKeyDown,g=>{const _=u.searchRef.current!=="";n||_&&g.key===" "||q_.includes(g.key)&&(g.currentTarget.click(),g.preventDefault())})})});Lp.displayName=Kf;var nN=y.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:s,...a}=e,l=u0(Kf,n),u=XM(n),h=y.useRef(null),d=yt(t,h),[m,g]=y.useState(!1),[_,b]=y.useState("");return y.useEffect(()=>{const w=h.current;w&&b((w.textContent??"").trim())},[a.children]),p.jsx(Bu.ItemSlot,{scope:n,disabled:r,textValue:s??_,children:p.jsx(LH,{asChild:!0,...u,focusable:!r,children:p.jsx(st.div,{role:"menuitem","data-highlighted":m?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...a,ref:d,onPointerMove:Ae(e.onPointerMove,Iu(w=>{r?l.onItemLeave(w):(l.onItemEnter(w),w.defaultPrevented||w.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Ae(e.onPointerLeave,Iu(w=>l.onItemLeave(w))),onFocus:Ae(e.onFocus,()=>g(!0)),onBlur:Ae(e.onBlur,()=>g(!1))})})})}),QH="MenuCheckboxItem",rN=y.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...s}=e;return p.jsx(lN,{scope:e.__scopeMenu,checked:n,children:p.jsx(Lp,{role:"menuitemcheckbox","aria-checked":Gf(n)?"mixed":n,...s,ref:t,"data-state":p0(n),onSelect:Ae(s.onSelect,()=>r==null?void 0:r(Gf(n)?!0:!n),{checkForDefaultPrevented:!1})})})});rN.displayName=QH;var iN="MenuRadioGroup",[JH,eF]=ha(iN,{value:void 0,onValueChange:()=>{}}),sN=y.forwardRef((e,t)=>{const{value:n,onValueChange:r,...s}=e,a=di(r);return p.jsx(JH,{scope:e.__scopeMenu,value:n,onValueChange:a,children:p.jsx(h0,{...s,ref:t})})});sN.displayName=iN;var oN="MenuRadioItem",aN=y.forwardRef((e,t)=>{const{value:n,...r}=e,s=eF(oN,e.__scopeMenu),a=n===s.value;return p.jsx(lN,{scope:e.__scopeMenu,checked:a,children:p.jsx(Lp,{role:"menuitemradio","aria-checked":a,...r,ref:t,"data-state":p0(a),onSelect:Ae(r.onSelect,()=>{var l;return(l=s.onValueChange)==null?void 0:l.call(s,n)},{checkForDefaultPrevented:!1})})})});aN.displayName=oN;var f0="MenuItemIndicator",[lN,tF]=ha(f0,{checked:!1}),cN=y.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...s}=e,a=tF(f0,n);return p.jsx(ei,{present:r||Gf(a.checked)||a.checked===!0,children:p.jsx(st.span,{...s,ref:t,"data-state":p0(a.checked)})})});cN.displayName=f0;var nF="MenuSeparator",uN=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return p.jsx(st.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});uN.displayName=nF;var rF="MenuArrow",dN=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=jp(n);return p.jsx(Ep,{...s,...r,ref:t})});dN.displayName=rF;var iF="MenuSub",[Fne,hN]=ha(iF),ou="MenuSubTrigger",fN=y.forwardRef((e,t)=>{const n=fa(ou,e.__scopeMenu),r=od(ou,e.__scopeMenu),s=hN(ou,e.__scopeMenu),a=u0(ou,e.__scopeMenu),l=y.useRef(null),{pointerGraceTimerRef:u,onPointerGraceIntentChange:h}=a,d={__scopeMenu:e.__scopeMenu},m=y.useCallback(()=>{l.current&&window.clearTimeout(l.current),l.current=null},[]);return y.useEffect(()=>m,[m]),y.useEffect(()=>{const g=u.current;return()=>{window.clearTimeout(g),h(null)}},[u,h]),p.jsx(l0,{asChild:!0,...d,children:p.jsx(nN,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":gN(n.open),...e,ref:_b(t,s.onTriggerChange),onClick:g=>{var _;(_=e.onClick)==null||_.call(e,g),!(e.disabled||g.defaultPrevented)&&(g.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Ae(e.onPointerMove,Iu(g=>{a.onItemEnter(g),!g.defaultPrevented&&!e.disabled&&!n.open&&!l.current&&(a.onPointerGraceIntentChange(null),l.current=window.setTimeout(()=>{n.onOpenChange(!0),m()},100))})),onPointerLeave:Ae(e.onPointerLeave,Iu(g=>{var b,w;m();const _=(b=n.content)==null?void 0:b.getBoundingClientRect();if(_){const S=(w=n.content)==null?void 0:w.dataset.side,C=S==="right",k=C?-5:5,R=_[C?"left":"right"],T=_[C?"right":"left"];a.onPointerGraceIntentChange({area:[{x:g.clientX+k,y:g.clientY},{x:R,y:_.top},{x:T,y:_.top},{x:T,y:_.bottom},{x:R,y:_.bottom}],side:S}),window.clearTimeout(u.current),u.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(g),g.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:Ae(e.onKeyDown,g=>{var b;const _=a.searchRef.current!=="";e.disabled||_&&g.key===" "||BH[r.dir].includes(g.key)&&(n.onOpenChange(!0),(b=n.content)==null||b.focus(),g.preventDefault())})})})});fN.displayName=ou;var pN="MenuSubContent",mN=y.forwardRef((e,t)=>{const n=QM(Zr,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,a=fa(Zr,e.__scopeMenu),l=od(Zr,e.__scopeMenu),u=hN(pN,e.__scopeMenu),h=y.useRef(null),d=yt(t,h);return p.jsx(Bu.Provider,{scope:e.__scopeMenu,children:p.jsx(ei,{present:r||a.open,children:p.jsx(Bu.Slot,{scope:e.__scopeMenu,children:p.jsx(d0,{id:u.contentId,"aria-labelledby":u.triggerId,...s,ref:d,align:"start",side:l.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:m=>{var g;l.isUsingKeyboardRef.current&&((g=h.current)==null||g.focus()),m.preventDefault()},onCloseAutoFocus:m=>m.preventDefault(),onFocusOutside:Ae(e.onFocusOutside,m=>{m.target!==u.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:Ae(e.onEscapeKeyDown,m=>{l.onClose(),m.preventDefault()}),onKeyDown:Ae(e.onKeyDown,m=>{var b;const g=m.currentTarget.contains(m.target),_=IH[l.dir].includes(m.key);g&&_&&(a.onOpenChange(!1),(b=u.trigger)==null||b.focus(),m.preventDefault())})})})})})});mN.displayName=pN;function gN(e){return e?"open":"closed"}function Gf(e){return e==="indeterminate"}function p0(e){return Gf(e)?"indeterminate":e?"checked":"unchecked"}function sF(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function oF(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function aF(e,t,n){const s=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,a=n?e.indexOf(n):-1;let l=oF(e,Math.max(a,0));s.length===1&&(l=l.filter(d=>d!==n));const h=l.find(d=>d.toLowerCase().startsWith(s.toLowerCase()));return h!==n?h:void 0}function lF(e,t){const{x:n,y:r}=e;let s=!1;for(let a=0,l=t.length-1;a<t.length;l=a++){const u=t[a],h=t[l],d=u.x,m=u.y,g=h.x,_=h.y;m>r!=_>r&&n<(g-d)*(r-m)/(_-m)+d&&(s=!s)}return s}function cF(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return lF(n,t)}function Iu(e){return t=>t.pointerType==="mouse"?e(t):void 0}var uF=ZM,dF=l0,hF=JM,fF=eN,pF=h0,mF=tN,gF=Lp,vF=rN,_F=sN,yF=aN,bF=cN,xF=uN,wF=dN,SF=fN,CF=mN,m0="ContextMenu",[kF]=vs(m0,[YM]),rr=YM(),[EF,vN]=kF(m0),_N=e=>{const{__scopeContextMenu:t,children:n,onOpenChange:r,dir:s,modal:a=!0}=e,[l,u]=y.useState(!1),h=rr(t),d=di(r),m=y.useCallback(g=>{u(g),d(g)},[d]);return p.jsx(EF,{scope:t,open:l,onOpenChange:m,modal:a,children:p.jsx(uF,{...h,dir:s,open:l,onOpenChange:m,modal:a,children:n})})};_N.displayName=m0;var yN="ContextMenuTrigger",bN=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,disabled:r=!1,...s}=e,a=vN(yN,n),l=rr(n),u=y.useRef({x:0,y:0}),h=y.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...u.current})}),d=y.useRef(0),m=y.useCallback(()=>window.clearTimeout(d.current),[]),g=_=>{u.current={x:_.clientX,y:_.clientY},a.onOpenChange(!0)};return y.useEffect(()=>m,[m]),y.useEffect(()=>void(r&&m()),[r,m]),p.jsxs(p.Fragment,{children:[p.jsx(dF,{...l,virtualRef:h}),p.jsx(st.span,{"data-state":a.open?"open":"closed","data-disabled":r?"":void 0,...s,ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:r?e.onContextMenu:Ae(e.onContextMenu,_=>{m(),g(_),_.preventDefault()}),onPointerDown:r?e.onPointerDown:Ae(e.onPointerDown,Fh(_=>{m(),d.current=window.setTimeout(()=>g(_),700)})),onPointerMove:r?e.onPointerMove:Ae(e.onPointerMove,Fh(m)),onPointerCancel:r?e.onPointerCancel:Ae(e.onPointerCancel,Fh(m)),onPointerUp:r?e.onPointerUp:Ae(e.onPointerUp,Fh(m))})]})});bN.displayName=yN;var RF="ContextMenuPortal",xN=e=>{const{__scopeContextMenu:t,...n}=e,r=rr(t);return p.jsx(hF,{...r,...n})};xN.displayName=RF;var wN="ContextMenuContent",SN=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=vN(wN,n),a=rr(n),l=y.useRef(!1);return p.jsx(fF,{...a,...r,ref:t,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:u=>{var h;(h=e.onCloseAutoFocus)==null||h.call(e,u),!u.defaultPrevented&&l.current&&u.preventDefault(),l.current=!1},onInteractOutside:u=>{var h;(h=e.onInteractOutside)==null||h.call(e,u),!u.defaultPrevented&&!s.modal&&(l.current=!0)},style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});SN.displayName=wN;var TF="ContextMenuGroup",MF=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=rr(n);return p.jsx(pF,{...s,...r,ref:t})});MF.displayName=TF;var NF="ContextMenuLabel",AF=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=rr(n);return p.jsx(mF,{...s,...r,ref:t})});AF.displayName=NF;var DF="ContextMenuItem",CN=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=rr(n);return p.jsx(gF,{...s,...r,ref:t})});CN.displayName=DF;var OF="ContextMenuCheckboxItem",jF=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=rr(n);return p.jsx(vF,{...s,...r,ref:t})});jF.displayName=OF;var LF="ContextMenuRadioGroup",zF=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=rr(n);return p.jsx(_F,{...s,...r,ref:t})});zF.displayName=LF;var PF="ContextMenuRadioItem",BF=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=rr(n);return p.jsx(yF,{...s,...r,ref:t})});BF.displayName=PF;var IF="ContextMenuItemIndicator",HF=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=rr(n);return p.jsx(bF,{...s,...r,ref:t})});HF.displayName=IF;var FF="ContextMenuSeparator",UF=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=rr(n);return p.jsx(xF,{...s,...r,ref:t})});UF.displayName=FF;var $F="ContextMenuArrow",WF=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=rr(n);return p.jsx(wF,{...s,...r,ref:t})});WF.displayName=$F;var VF="ContextMenuSubTrigger",qF=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=rr(n);return p.jsx(SF,{...s,...r,ref:t})});qF.displayName=VF;var KF="ContextMenuSubContent",GF=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=rr(n);return p.jsx(CF,{...s,...r,ref:t,style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});GF.displayName=KF;function Fh(e){return t=>t.pointerType!=="mouse"?e(t):void 0}var YF=_N,XF=bN,ZF=xN,kN=SN,EN=CN;const QF=YF,JF=XF,RN=y.forwardRef(({className:e,...t},n)=>p.jsx(ZF,{children:p.jsx(kN,{ref:n,className:ye("z-50 min-w-[170px] overflow-hidden rounded-xl border border-border bg-background p-1 shadow-lg outline-hidden 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",e),...t})}));RN.displayName=kN.displayName;const au=y.forwardRef(({className:e,...t},n)=>p.jsx(EN,{ref:n,className:ye("relative flex cursor-default select-none items-center gap-2.5 rounded-lg px-3 py-2 text-xs font-medium text-foreground outline-hidden transition-colors hover:bg-muted focus:bg-muted data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...t}));au.displayName=EN.displayName;function R2({shortcut:e}){const t=e==null?void 0:e[0];return t?p.jsx(vM,{className:"ml-auto shrink-0 pl-4 text-muted-foreground",children:t.split("+").map((n,r)=>p.jsx(gM,{className:"h-4 min-w-4 px-1 text-[10px]",children:Kb(n)},`${n}-${r}`))}):null}function eU({editorLabel:e,finderShortcut:t,editorShortcut:n,onCopyPath:r,onOpenInFinder:s,onOpenInEditor:a,onRemove:l,children:u}){return p.jsxs(QF,{children:[p.jsx(JF,{asChild:!0,children:u}),p.jsxs(RN,{children:[p.jsxs(au,{onSelect:h=>{h.stopPropagation(),r()},children:[p.jsx(Zu,{className:"h-3.5 w-3.5"}),p.jsx("span",{className:"text-xs font-medium",children:"Copy Path"})]}),p.jsxs(au,{onSelect:h=>{h.stopPropagation(),s()},children:[p.jsx(Cb,{className:"h-3.5 w-3.5"}),p.jsx("span",{className:"text-xs font-medium",children:"Show in Finder"}),p.jsx(R2,{shortcut:t})]}),p.jsxs(au,{onSelect:h=>{h.stopPropagation(),a()},children:[p.jsx(Sb,{className:"h-3.5 w-3.5"}),p.jsxs("span",{className:"text-xs font-medium",children:["Open in ",e]}),p.jsx(R2,{shortcut:n})]}),p.jsxs(au,{onSelect:h=>{h.stopPropagation(),l()},className:"text-destructive dark:text-red-400 hover:bg-destructive/10 focus:bg-destructive/10 dark:hover:bg-red-500/20 dark:focus:bg-red-500/20",children:[p.jsx(cI,{className:"h-3.5 w-3.5"}),p.jsx("span",{className:"text-xs font-medium",children:"Remove"})]})]})]})}function tU({group:e,editorLabel:t,finderShortcut:n,editorShortcut:r,collapsedSections:s,expandedGroups:a,onToggleSection:l,onToggleExpandedGroup:u,renderChatRow:h,chatsPerProject:d,onNewLocalChat:m,onCopyPath:g,onOpenExternalPath:_,onRemoveProject:b,isConnected:w,startingLocalPath:S}){const{groupKey:C,localPath:k,chats:R}=e,T=a.has(C),N=T?R:R.slice(0,d),L=R.length>d,{attributes:A,listeners:O,setNodeRef:F,setActivatorNodeRef:G,transform:B,transition:H,isDragging:P}=xH({id:C}),U={transform:zu.Translate.toString(B),transition:H},V=p.jsxs("div",{ref:G,className:ye("sticky top-0 bg-background dark:bg-card z-10 relative p-[10px] flex items-center justify-between","cursor-grab active:cursor-grabbing",P&&"cursor-grabbing"),onClick:()=>l(C),...O,children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("span",{className:"relative size-3.5 shrink-0 cursor-pointer",children:s.has(C)?p.jsx(fs,{className:"translate-y-[1px] size-3.5 shrink-0 text-slate-400 transition-all duration-200"}):p.jsxs(p.Fragment,{children:[p.jsx(Cb,{className:"absolute inset-0 translate-y-[1px] size-3.5 shrink-0 text-slate-400 dark:text-slate-500 transition-all duration-200 group-hover/section:opacity-0"}),p.jsx(fs,{className:"absolute inset-0 translate-y-[1px] size-3.5 shrink-0 rotate-90 text-slate-400 opacity-0 transition-all duration-200 group-hover/section:opacity-100"})]})}),p.jsxs(Hf,{children:[p.jsx(Ff,{asChild:!0,children:p.jsx("span",{className:"truncate max-w-[150px] whitespace-nowrap text-sm text-slate-500 dark:text-slate-400",children:wM(k)})}),p.jsx(Ou,{side:"right",sideOffset:4,children:k})]})]}),m&&p.jsxs(Hf,{children:[p.jsx(Ff,{asChild:!0,children:p.jsx(tt,{variant:"ghost",size:"icon",className:ye("h-5.5 w-5.5 absolute right-2 !rounded opacity-100 md:opacity-0 md:group-hover/section:opacity-100",(!w||S===k)&&"opacity-50 cursor-not-allowed"),disabled:!w||S===k,onClick:W=>{W.stopPropagation(),m(k)},children:S===k?p.jsx(ji,{className:"size-4 text-slate-500 dark:text-slate-400 animate-spin"}):p.jsx(Tb,{className:"size-3.5 text-slate-500 dark:text-slate-400"})})}),p.jsx(Ou,{side:"right",sideOffset:4,children:w?"New chat":`Start ${ln} to connect`})]})]});return p.jsxs("div",{ref:F,style:U,className:ye("group/section",P&&"opacity-50 shadow-lg z-50 relative"),...A,children:[b&&g&&_?p.jsx(eU,{editorLabel:t,finderShortcut:n,editorShortcut:r,onCopyPath:()=>g(k),onOpenInFinder:()=>_("open_finder",k),onOpenInEditor:()=>_("open_editor",k),onRemove:()=>b(C),children:V}):V,!s.has(C)&&(N.length>0||L)&&p.jsxs("div",{className:"space-y-[2px] mb-2 ",children:[N.map(h),L&&p.jsx("button",{onClick:()=>u(C),className:"pl-2.5 py-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:T?"Show less":`Show more (${R.length-d})`})]})]})}function nU({projectGroups:e,editorLabel:t,finderShortcut:n,editorShortcut:r,collapsedSections:s,expandedGroups:a,onToggleSection:l,onToggleExpandedGroup:u,renderChatRow:h,chatsPerProject:d,onNewLocalChat:m,onCopyPath:g,onOpenExternalPath:_,onRemoveProject:b,onReorderGroups:w,isConnected:S,startingLocalPath:C}){const k=Z7(p2(i0,{activationConstraint:{distance:8}}),p2(n0)),R=y.useMemo(()=>e.map(A=>A.groupKey),[e]),T=y.useRef(null);function N(A){const O=A.active.id;s.has(O)?T.current=null:(T.current=O,l(O))}function L(A){const{active:O,over:F}=A;if(F&&O.id!==F.id&&w){const G=R.indexOf(O.id),B=R.indexOf(F.id);if(G!==-1&&B!==-1){const H=s0(R,G,B);w(H)}}if(T.current){const G=T.current;T.current=null,requestAnimationFrame(()=>l(G))}}return p.jsx(tH,{sensors:k,collisionDetection:n9,onDragStart:N,onDragEnd:L,children:p.jsx(pH,{items:R,strategy:hH,children:e.map(A=>p.jsx(tU,{group:A,editorLabel:t,finderShortcut:n,editorShortcut:r,collapsedSections:s,expandedGroups:a,onToggleSection:l,onToggleExpandedGroup:u,renderChatRow:h,chatsPerProject:d,onNewLocalChat:m,onCopyPath:g,onOpenExternalPath:_,onRemoveProject:b,isConnected:S,startingLocalPath:C},A.groupKey))})})}const T2=ua()(da(e=>({order:[],setOrder:t=>e({order:t})}),{name:"project-group-order"}));function rU({data:e,activeChatId:t,connectionStatus:n,ready:r,open:s,collapsed:a,showMobileOpenButton:l,onOpen:u,onClose:h,onCollapse:d,onExpand:m,onCreateChat:g,onDeleteChat:_,onCopyPath:b,onOpenExternalPath:w,onRemoveProject:S,editorLabel:C,keybindings:k,updateSnapshot:R,onInstallUpdate:T}){const N=mi(),L=Pl(),A=y.useRef(null),[O,F]=y.useState(new Set),[G,B]=y.useState(new Set),[H,P]=y.useState(()=>Date.now()),U=10,V=T2(xe=>xe.order),W=T2(xe=>xe.setOrder),z=y.useMemo(()=>{if(V.length===0)return e.projectGroups;const xe=new Map(e.projectGroups.map(et=>[et.groupKey,et])),He=V.filter(et=>xe.has(et)).map(et=>xe.get(et)),Fe=new Set(V);for(const et of e.projectGroups)Fe.has(et.groupKey)||He.push(et);return He},[e.projectGroups,V]),$=y.useMemo(()=>Yb(k),[k]),q=y.useCallback(xe=>W(xe),[W]),Q=y.useMemo(()=>new Map(e.projectGroups.map(xe=>[xe.localPath,xe.groupKey])),[e.projectGroups]),M=y.useMemo(()=>e.projectGroups.reduce((xe,He)=>xe+He.chats.length,0),[e.projectGroups]),I=y.useCallback(xe=>{F(He=>{const Fe=new Set(He);return Fe.has(xe)?Fe.delete(xe):Fe.add(xe),Fe})},[]),Z=y.useCallback(xe=>{B(He=>{const Fe=new Set(He);return Fe.has(xe)?Fe.delete(xe):Fe.add(xe),Fe})},[]),j=y.useCallback(xe=>p.jsx(z7,{chat:xe,activeChatId:t,nowMs:H,onSelectChat:He=>{L(`/chat/${He}`),h()},onDeleteChat:()=>_(xe)},xe._id),[t,L,H,h,_]);y.useEffect(()=>{const xe=window.setInterval(()=>{P(Date.now())},3e4);return()=>window.clearInterval(xe)},[]),y.useEffect(()=>{!t||!A.current||requestAnimationFrame(()=>{const xe=A.current,He=xe==null?void 0:xe.querySelector(`[data-chat-id="${t}"]`);if(!He||!xe)return;const Fe=He.getBoundingClientRect(),et=xe.getBoundingClientRect();if(Fe.top<et.top+38){const dt=Fe.top-et.top+xe.scrollTop;xe.scrollTo({top:dt-38,behavior:"smooth"})}else if(Fe.bottom>et.bottom){const dt=Fe.top+Fe.height/2-et.top+xe.scrollTop,mt=xe.clientHeight/2;xe.scrollTo({top:dt-mt,behavior:"smooth"})}})},[t,M]);const ce=M>0,fe=N.pathname==="/",ue=N.pathname.startsWith("/settings"),de=fe||ue,we=n==="connecting"||!r,oe=we?"Connecting":n==="connected"?"Connected":"Disconnected",be=n==="connected"?"bg-emerald-500":"bg-amber-500",Ne=(R==null?void 0:R.updateAvailable)===!0,Se=R?R.latestVersion===`${R.currentVersion}-dev`:!1,_e=(R==null?void 0:R.status)==="updating"||(R==null?void 0:R.status)==="restart_pending";return p.jsxs(p.Fragment,{children:[!s&&l&&p.jsx(tt,{variant:"ghost",size:"icon",className:"fixed top-3 left-3 z-50 md:hidden",onClick:u,children:p.jsx(kb,{className:"h-5 w-5"})}),a&&de&&p.jsx("div",{className:"hidden md:flex fixed left-0 top-0 h-full z-40 items-start pt-4 pl-5 border-l border-border/0",children:p.jsxs("div",{className:"flex items-center gap-1",children:[p.jsx(yu,{className:"size-6 text-logo"}),p.jsx(tt,{variant:"ghost",size:"icon",onClick:m,title:"Expand sidebar",children:p.jsx(T_,{className:"h-5 w-5"})})]})}),p.jsxs("div",{"data-sidebar":"open",className:ye("fixed inset-0 z-50 bg-background dark:bg-card flex flex-col h-[100dvh] select-none","md:relative md:inset-auto md:w-[275px] md:mr-0 md:h-[calc(100dvh-16px)] md:my-2 md:ml-2 md:border md:border-border md:rounded-2xl",s?"flex":"hidden md:flex",a&&"md:hidden"),children:[p.jsxs("div",{className:" pl-3 pr-[7px] h-[64px] max-h-[64px] md:h-[55px] md:max-h-[55px] border-b flex items-center justify-between",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsxs("button",{type:"button",onClick:d,title:"Collapse sidebar",className:"hidden md:flex group/sidebar-collapse relative items-center justify-center h-5 w-5 sm:h-6 sm:w-6",children:[p.jsx(yu,{className:"absolute inset-0.5 h-4 w-4 sm:h-5 sm:w-5 text-logo transition-all duration-200 ease-out opacity-100 scale-100 group-hover/sidebar-collapse:opacity-0 group-hover/sidebar-collapse:scale-0"}),p.jsx(T_,{className:"absolute inset-0 h-4 w-4 sm:h-6 sm:w-6 text-slate-500 dark:text-slate-400 transition-all duration-200 ease-out opacity-0 scale-0 group-hover/sidebar-collapse:opacity-100 group-hover/sidebar-collapse:scale-80 hover:opacity-50"})]}),p.jsx(yu,{className:"h-5 w-5 sm:h-6 sm:w-6 text-logo md:hidden"}),p.jsx("span",{className:"font-logo text-base uppercase sm:text-md text-slate-600 dark:text-slate-100",children:ln})]}),p.jsxs("div",{className:"flex items-center",children:[Se?p.jsx("span",{className:"mr-1 inline-flex items-center rounded-full border border-border bg-muted px-2 py-0.5 text-[11px] font-bold tracking-wider text-muted-foreground",title:"Development build",children:"DEV"}):Ne?p.jsxs(tt,{variant:"outline",size:"sm",className:"rounded-full !h-auto mr-1 py-0.5 px-2 bg-logo/20 hover:bg-logo text-logo border-logo/20 hover:text-foreground hover:border-logo/20 text-[11px] font-bold tracking-wider",onClick:T,disabled:_e,title:R!=null&&R.latestVersion?`Update to ${R.latestVersion}`:"Update Kanna",children:[_e?p.jsx(ji,{className:"mr-1.5 h-3 w-3 animate-spin"}):null,"UPDATE"]}):null,p.jsx(tt,{variant:"ghost",size:"icon",onClick:()=>{L("/"),h()},className:"size-10 rounded-lg",title:"New project",children:p.jsx(Rb,{className:"size-4"})}),p.jsx(tt,{variant:"ghost",size:"icon",className:"md:hidden",onClick:h,children:p.jsx(ca,{className:"h-5 w-5"})})]})]}),p.jsx("div",{ref:A,className:"flex-1 min-h-0 overflow-y-auto scrollbar-hide",style:{WebkitOverflowScrolling:"touch"},children:p.jsxs("div",{className:"p-[7px]",children:[!ce&&we?p.jsx("div",{className:"space-y-5 px-1 pt-3",children:[0,1,2].map(xe=>p.jsxs("div",{className:"space-y-2 animate-pulse",children:[p.jsx("div",{className:"h-4 w-28 rounded bg-muted"}),p.jsx("div",{className:"space-y-1",children:[0,1,2].map(He=>p.jsxs("div",{className:"flex items-center gap-2 rounded-md px-3 py-2",children:[p.jsx("div",{className:"h-3.5 w-3.5 rounded-full bg-muted"}),p.jsx("div",{className:ye("h-3.5 rounded bg-muted",He===0?"w-32":He===1?"w-40":"w-28")})]},He))})]},xe))}):null,!ce&&!we&&e.projectGroups.length===0?p.jsx("p",{className:"text-sm text-slate-400 p-2 mt-6 text-center",children:"No conversations yet"}):null,p.jsx(nU,{projectGroups:z,editorLabel:C,finderShortcut:$.bindings.openInFinder,editorShortcut:$.bindings.openInEditor,onReorderGroups:q,collapsedSections:O,expandedGroups:G,onToggleSection:I,onToggleExpandedGroup:Z,renderChatRow:j,chatsPerProject:U,onNewLocalChat:xe=>{const He=Q.get(xe);He&&g(He)},onCopyPath:b,onOpenExternalPath:w,onRemoveProject:S,isConnected:n==="connected"})]})}),p.jsx("div",{className:"border-t border-border p-2",children:p.jsx("button",{type:"button",onClick:()=>{L("/settings/general"),h()},className:ye("w-full rounded-xl rounded-t-md border px-3 py-2 text-left transition-colors",ue?"bg-muted border-border":"border-border/0 hover:bg-muted hover:border-border active:bg-muted/80"),children:p.jsxs("div",{className:"flex items- justify-between gap-2",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(VB,{className:"h-4 w-4 text-muted-foreground"}),p.jsx("span",{className:"text-sm",children:"Settings"})]}),p.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[p.jsx("span",{children:oe}),we?p.jsx(ji,{className:"h-2 w-2 animate-spin"}):p.jsx("span",{className:ye("h-2 w-2 rounded-full",be)})]})]})})})]}),s?p.jsx("div",{className:"fixed inset-0 bg-black/40 z-40 md:hidden",onClick:h}):null]})}const TN=y.forwardRef(({className:e,...t},n)=>p.jsx("textarea",{"data-gramm":"false","data-gramm_editor":"false","data-enable-grammarly":"false","data-1p-ignore":!0,autoComplete:"off",className:ye("flex w-full rounded-lg border border-border bg-background px-2.5 py-2 text-sm placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...t}));TN.displayName="Textarea";const g0=y.forwardRef(({className:e,children:t,...n},r)=>p.jsx("div",{ref:r,className:ye("relative overflow-y-auto overscroll-contain touch-pan-y scrollbar-hide",e),style:{WebkitOverflowScrolling:"touch"},...n,children:t}));g0.displayName="ScrollArea";function iU(){const[e,t]=y.useState(()=>{if(typeof window>"u")return!1;const n=navigator.standalone===!0,r=window.matchMedia("(display-mode: standalone)").matches;return n||r});return y.useEffect(()=>{const n=window.matchMedia("(display-mode: standalone)"),r=s=>{t(s.matches||navigator.standalone===!0)};return n.addEventListener("change",r),()=>n.removeEventListener("change",r)},[]),e}const sU=ua()(da((e,t)=>({drafts:{},attachmentDrafts:{},setDraft:(n,r)=>e(s=>{if(!r){const{[n]:a,...l}=s.drafts;return{drafts:l}}return{drafts:{...s.drafts,[n]:r}}}),clearDraft:n=>e(r=>{const{[n]:s,...a}=r.drafts;return{drafts:a}}),getDraft:n=>t().drafts[n]??"",setAttachmentDrafts:(n,r)=>e(s=>{if(r.length===0){const{[n]:a,...l}=s.attachmentDrafts;return{attachmentDrafts:l}}return{attachmentDrafts:{...s.attachmentDrafts,[n]:r}}}),clearAttachmentDrafts:n=>e(r=>{const{[n]:s,...a}=r.attachmentDrafts;return{attachmentDrafts:a}}),getAttachmentDrafts:n=>t().attachmentDrafts[n]??[]}),{name:"chat-input-drafts"})),K_="__new__",MN=!0;function oU(e){return e==="gpt-5-codex"?"gpt-5.3-codex":e??"gpt-5.4"}function aU(e){return e==="claude"||e==="codex"?e:"last_used"}function Ko(e){var a,l;const t=(a=e==null?void 0:e.modelOptions)==null?void 0:a.reasoningEffort,n=d2(t)?t:d2(e==null?void 0:e.effort)?e.effort:ju.reasoningEffort,r=(e==null?void 0:e.model)??"opus",s=bM(r,(l=e==null?void 0:e.modelOptions)==null?void 0:l.contextWindow);return{model:r,modelOptions:{reasoningEffort:r!=="opus"&&n==="max"?"high":n,contextWindow:s},planMode:!!(e!=null&&e.planMode)}}function Go(e){var n,r;const t=(n=e==null?void 0:e.modelOptions)==null?void 0:n.reasoningEffort;return{model:oU(e==null?void 0:e.model),modelOptions:{reasoningEffort:h2(t)?t:h2(e==null?void 0:e.effort)?e.effort:P_.reasoningEffort,fastMode:typeof((r=e==null?void 0:e.modelOptions)==null?void 0:r.fastMode)=="boolean"?e.modelOptions.fastMode:P_.fastMode},planMode:!!(e!=null&&e.planMode)}}function lU(){return{claude:{model:"opus",modelOptions:{...ju},planMode:!1},codex:{model:"gpt-5.4",modelOptions:{...P_},planMode:!1}}}function cU(e){return{claude:Ko(e==null?void 0:e.claude),codex:Go(e==null?void 0:e.codex)}}function uU(e,t){if(t===void 0){console.info(`[chat-preferences] ${e}`);return}console.info(`[chat-preferences] ${e}`,t)}function Hu(e,t){if(e==="claude"){const r=t.claude;return{provider:"claude",model:r.model,modelOptions:{...r.modelOptions},planMode:r.planMode}}const n=t.codex;return{provider:"codex",model:n.model,modelOptions:{...n.modelOptions},planMode:n.planMode}}function Yf(e){return e.provider==="claude"?{provider:"claude",model:e.model,modelOptions:{...e.modelOptions},planMode:e.planMode}:{provider:"codex",model:e.model,modelOptions:{...e.modelOptions},planMode:e.planMode}}function v0(e,t,n,r){if((e==null?void 0:e.provider)==="claude"){const s=Ko(e);return{provider:"claude",model:s.model,modelOptions:s.modelOptions,planMode:s.planMode}}if((e==null?void 0:e.provider)==="codex"){const s=Go(e);return{provider:"codex",model:s.model,modelOptions:s.modelOptions,planMode:s.planMode}}if(n==="claude"){const s=Ko(r==null?void 0:r.claude);return{provider:"claude",model:s.model,modelOptions:s.modelOptions,planMode:s.planMode}}if(n==="codex"){const s=Go(r==null?void 0:r.codex);return{provider:"codex",model:s.model,modelOptions:s.modelOptions,planMode:s.planMode}}return Hu("claude",t)}function dU(e,t){return e?v0(e,t):null}function hU(e,t){return e?Object.fromEntries(Object.entries(e).map(([n,r])=>[n,v0(r,t)])):{}}function NN(e){return e.defaultProvider==="last_used"?e.sourceState?Yf(e.sourceState):e.legacyComposerState?Yf(e.legacyComposerState):Hu("claude",e.providerDefaults):Hu(e.defaultProvider,e.providerDefaults)}function AN(e,t){const n=e.chatStates[t];return n||NN({defaultProvider:e.defaultProvider,providerDefaults:e.providerDefaults,legacyComposerState:e.legacyComposerState})}function Uh(e,t,n){const r=AN(e,t);return{chatStates:{...e.chatStates,[t]:n(r)}}}function fU(e){const t=cU(e==null?void 0:e.providerDefaults),n=dU((e==null?void 0:e.legacyComposerState)??(e==null?void 0:e.composerState),t);return{defaultProvider:aU(e==null?void 0:e.defaultProvider),providerDefaults:t,chatStates:hU(e==null?void 0:e.chatStates,t),showTranscriptToc:typeof(e==null?void 0:e.showTranscriptToc)=="boolean"?e.showTranscriptToc:MN,legacyComposerState:n??v0(void 0,t,e==null?void 0:e.liveProvider,e==null?void 0:e.livePreferences)}}const er=ua()(da((e,t)=>({defaultProvider:"last_used",providerDefaults:lU(),chatStates:{},showTranscriptToc:MN,legacyComposerState:{provider:"claude",model:"opus",modelOptions:{...ju},planMode:!1},setDefaultProvider:n=>e({defaultProvider:n}),setShowTranscriptToc:n=>e({showTranscriptToc:n}),setProviderDefaultModel:(n,r)=>e(s=>({providerDefaults:{...s.providerDefaults,[n]:n==="claude"?Ko({...s.providerDefaults.claude,model:r}):Go({...s.providerDefaults.codex,model:r})}})),setProviderDefaultModelOptions:(n,r)=>e(s=>({providerDefaults:{...s.providerDefaults,[n]:n==="claude"?Ko({...s.providerDefaults.claude,modelOptions:{...s.providerDefaults.claude.modelOptions,...r}}):Go({...s.providerDefaults.codex,modelOptions:{...s.providerDefaults.codex.modelOptions,...r}})}})),setProviderDefaultPlanMode:(n,r)=>e(s=>({providerDefaults:{...s.providerDefaults,[n]:{...s.providerDefaults[n],planMode:r}}})),getComposerState:n=>Yf(AN(t(),n)),initializeComposerForChat:(n,r)=>e(s=>{if(s.chatStates[n])return s;const a=NN({defaultProvider:s.defaultProvider,providerDefaults:s.providerDefaults,sourceState:r==null?void 0:r.sourceState,legacyComposerState:s.legacyComposerState});return uU("initializeComposerForChat",{chatId:n,composerState:a}),{chatStates:{...s.chatStates,[n]:a}}}),setComposerState:(n,r)=>e(s=>({chatStates:{...s.chatStates,[n]:Yf(r)}})),setChatComposerProvider:(n,r)=>e(s=>Uh(s,n,()=>Hu(r,s.providerDefaults))),setChatComposerModel:(n,r)=>e(s=>Uh(s,n,a=>a.provider==="claude"?{provider:"claude",model:r,modelOptions:Ko({...a,model:r}).modelOptions,planMode:a.planMode}:{provider:"codex",model:r,modelOptions:Go({...a,model:r}).modelOptions,planMode:a.planMode})),setChatComposerModelOptions:(n,r)=>e(s=>Uh(s,n,a=>a.provider==="claude"?{provider:"claude",model:a.model,modelOptions:Ko({...a,modelOptions:{...a.modelOptions,...r}}).modelOptions,planMode:a.planMode}:{provider:"codex",model:a.model,modelOptions:Go({...a,modelOptions:{...a.modelOptions,...r}}).modelOptions,planMode:a.planMode})),setChatComposerPlanMode:(n,r)=>e(s=>Uh(s,n,a=>({...a,planMode:r}))),resetChatComposerFromProvider:(n,r)=>e(s=>({chatStates:{...s.chatStates,[n]:Hu(r,s.providerDefaults)}}))}),{name:"chat-preferences",version:5,migrate:e=>fU(e)}));var zp="Popover",[DN]=vs(zp,[po]),ad=po(),[pU,mo]=DN(zp),ON=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:s,onOpenChange:a,modal:l=!1}=e,u=ad(t),h=y.useRef(null),[d,m]=y.useState(!1),[g,_]=Rl({prop:r,defaultProp:s??!1,onChange:a,caller:zp});return p.jsx(Cp,{...u,children:p.jsx(pU,{scope:t,contentId:ds(),triggerRef:h,open:g,onOpenChange:_,onOpenToggle:y.useCallback(()=>_(b=>!b),[_]),hasCustomAnchor:d,onCustomAnchorAdd:y.useCallback(()=>m(!0),[]),onCustomAnchorRemove:y.useCallback(()=>m(!1),[]),modal:l,children:n})})};ON.displayName=zp;var jN="PopoverAnchor",mU=y.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=mo(jN,n),a=ad(n),{onCustomAnchorAdd:l,onCustomAnchorRemove:u}=s;return y.useEffect(()=>(l(),()=>u()),[l,u]),p.jsx(Ju,{...a,...r,ref:t})});mU.displayName=jN;var LN="PopoverTrigger",zN=y.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=mo(LN,n),a=ad(n),l=yt(t,s.triggerRef),u=p.jsx(st.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":FN(s.open),...r,ref:l,onClick:Ae(e.onClick,s.onOpenToggle)});return s.hasCustomAnchor?u:p.jsx(Ju,{asChild:!0,...a,children:u})});zN.displayName=LN;var _0="PopoverPortal",[gU,vU]=DN(_0,{forceMount:void 0}),PN=e=>{const{__scopePopover:t,forceMount:n,children:r,container:s}=e,a=mo(_0,t);return p.jsx(gU,{scope:t,forceMount:n,children:p.jsx(ei,{present:n||a.open,children:p.jsx(Il,{asChild:!0,container:s,children:r})})})};PN.displayName=_0;var Nl="PopoverContent",BN=y.forwardRef((e,t)=>{const n=vU(Nl,e.__scopePopover),{forceMount:r=n.forceMount,...s}=e,a=mo(Nl,e.__scopePopover);return p.jsx(ei,{present:r||a.open,children:a.modal?p.jsx(yU,{...s,ref:t}):p.jsx(bU,{...s,ref:t})})});BN.displayName=Nl;var _U=Zo("PopoverContent.RemoveScroll"),yU=y.forwardRef((e,t)=>{const n=mo(Nl,e.__scopePopover),r=y.useRef(null),s=yt(t,r),a=y.useRef(!1);return y.useEffect(()=>{const l=r.current;if(l)return vp(l)},[]),p.jsx(Xu,{as:_U,allowPinchZoom:!0,children:p.jsx(IN,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ae(e.onCloseAutoFocus,l=>{var u;l.preventDefault(),a.current||(u=n.triggerRef.current)==null||u.focus()}),onPointerDownOutside:Ae(e.onPointerDownOutside,l=>{const u=l.detail.originalEvent,h=u.button===0&&u.ctrlKey===!0,d=u.button===2||h;a.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:Ae(e.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1})})})}),bU=y.forwardRef((e,t)=>{const n=mo(Nl,e.__scopePopover),r=y.useRef(!1),s=y.useRef(!1);return p.jsx(IN,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var l,u;(l=e.onCloseAutoFocus)==null||l.call(e,a),a.defaultPrevented||(r.current||(u=n.triggerRef.current)==null||u.focus(),a.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:a=>{var h,d;(h=e.onInteractOutside)==null||h.call(e,a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const l=a.target;((d=n.triggerRef.current)==null?void 0:d.contains(l))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&s.current&&a.preventDefault()}})}),IN=y.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:a,disableOutsidePointerEvents:l,onEscapeKeyDown:u,onPointerDownOutside:h,onFocusOutside:d,onInteractOutside:m,...g}=e,_=mo(Nl,n),b=ad(n);return mp(),p.jsx(Yu,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:a,children:p.jsx(Bl,{asChild:!0,disableOutsidePointerEvents:l,onInteractOutside:m,onEscapeKeyDown:u,onPointerDownOutside:h,onFocusOutside:d,onDismiss:()=>_.onOpenChange(!1),children:p.jsx(kp,{"data-state":FN(_.open),role:"dialog",id:_.contentId,...b,...g,ref:t,style:{...g.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),HN="PopoverClose",xU=y.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=mo(HN,n);return p.jsx(st.button,{type:"button",...r,ref:t,onClick:Ae(e.onClick,()=>s.onOpenChange(!1))})});xU.displayName=HN;var wU="PopoverArrow",SU=y.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=ad(n);return p.jsx(Ep,{...s,...r,ref:t})});SU.displayName=wU;function FN(e){return e?"open":"closed"}var CU=ON,kU=zN,EU=PN,UN=BN;const RU=CU,TU=kU,$N=y.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},s)=>p.jsx(EU,{children:p.jsx(UN,{ref:s,align:t,sideOffset:n,[Nu]:"",onCloseAutoFocus:a=>{var l;a.preventDefault(),window.dispatchEvent(new Event(jf)),(l=r.onCloseAutoFocus)==null||l.call(r,a)},className:ye("z-50 w-72 rounded-xl border border-border bg-background p-4 shadow-lg outline-hidden 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),...r})}));$N.displayName=UN.displayName;function MU({className:e,...t}){return p.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",className:ye("shrink-0",e),...t,children:p.jsx("path",{d:"M17.3041 3.541h-3.6718l6.696 16.918H24Zm-10.6082 0L0 20.459h3.7442l1.3693-3.5527h7.0052l1.3693 3.5528h3.7442L10.5363 3.5409Zm-.3712 10.2232 2.2914-5.9456 2.2914 5.9456Z"})})}function NU({className:e,...t}){return p.jsx("svg",{viewBox:"0 0 158.7128 157.296",fill:"currentColor","aria-hidden":"true",className:ye("shrink-0",e),...t,children:p.jsx("path",{d:"M60.8734 57.2556V42.3124c0-1.2586.4722-2.2029 1.5728-2.8314l30.0443-17.3023c4.0899-2.3593 8.9662-3.4599 13.9988-3.4599 18.8759 0 30.8307 14.6289 30.8307 30.2006 0 1.1007 0 2.3593-.158 3.6178l-31.1446-18.2467c-1.8872-1.1006-3.7754-1.1006-5.6629 0L60.8734 57.2556Zm70.1542 58.2005V79.7487c0-2.2028-.9446-3.7756-2.8318-4.8763l-39.481-22.9651 12.8982-7.3934c1.1007-.6285 2.0453-.6285 3.1458 0l30.0441 17.3024c8.6523 5.0341 14.4708 15.7296 14.4708 26.1107 0 11.9539-7.0769 22.965-18.2461 27.527ZM51.593 83.9964l-12.8982-7.5497c-1.1007-.6285-1.5728-1.5728-1.5728-2.8314V39.0105c0-16.8303 12.8982-29.5722 30.3585-29.5722 6.607 0 12.7403 2.2029 17.9324 6.1349l-30.987 17.9324c-1.8871 1.1007-2.8314 2.6735-2.8314 4.8764v45.6159ZM79.3562 100.0403 60.8733 89.6592V67.6383l18.4829-10.3811 18.4812 10.3811v22.0209l-18.4812 10.3811Zm11.8757 47.8188c-6.607 0-12.7403-2.2031-17.9324-6.1344l30.9866-17.9333c1.8872-1.1005 2.8318-2.6728 2.8318-4.8759v-45.616l13.0564 7.5498c1.1005.6285 1.5723 1.5728 1.5723 2.8314v34.6051c0 16.8297-13.0564 29.5723-30.5147 29.5723ZM53.9522 112.7822 23.9079 95.4798c-8.652-5.0343-14.471-15.7296-14.471-26.1107 0-12.1119 7.2356-22.9652 18.403-27.5272v35.8634c0 2.2028.9443 3.7756 2.8314 4.8763l39.3248 22.8068-12.8982 7.3938c-1.1007.6287-2.045.6287-3.1456 0ZM52.2229 138.5791c-17.7745 0-30.8306-13.3713-30.8306-29.8871 0-1.2585.1578-2.5169.3143-3.7754l30.987 17.9323c1.8871 1.1005 3.7757 1.1005 5.6628 0l39.4811-22.807v14.9435c0 1.2585-.4721 2.2021-1.5728 2.8308l-30.0443 17.3025c-4.0898 2.359-8.9662 3.4605-13.9989 3.4605h.0014ZM91.2319 157.296c19.0327 0 34.9188-13.5272 38.5383-31.4594 17.6164-4.562 28.9425-21.0779 28.9425-37.908 0-11.0112-4.719-21.7066-13.2133-29.4143.7867-3.3035 1.2595-6.607 1.2595-9.909 0-22.4929-18.2471-39.3247-39.3251-39.3247-4.2461 0-8.3363.6285-12.4262 2.045-7.0792-6.9213-16.8318-11.3254-27.5271-11.3254-19.0331 0-34.9191 13.5268-38.5384 31.4591C11.3255 36.0212 0 52.5373 0 69.3675c0 11.0112 4.7184 21.7065 13.2125 29.4142-.7865 3.3035-1.2586 6.6067-1.2586 9.9092 0 22.4923 18.2466 39.3241 39.3248 39.3241 4.2462 0 8.3362-.6277 12.426-2.0441 7.0776 6.921 16.8302 11.3251 27.5271 11.3251Z"})})}const M2={claude:MU,codex:NU};function os({onClick:e,selected:t,icon:n,label:r,description:s,disabled:a}){return p.jsxs("button",{onClick:e,disabled:a,className:ye("w-full flex items-center gap-2 p-2 border border-border/0 rounded-lg text-left transition-opacity",t?"bg-muted border-border":"hover:opacity-60",a&&"opacity-40 cursor-not-allowed"),children:[n,p.jsxs("div",{children:[p.jsx("div",{className:"text-sm font-medium",children:r}),s?p.jsx("div",{className:"text-xs text-muted-foreground",children:s}):null]})]})}function sl({trigger:e,triggerClassName:t,disabled:n=!1,children:r}){const[s,a]=y.useState(!1);return n?p.jsx("button",{disabled:!0,className:ye("flex items-center gap-1.5 px-2 py-1 text-sm rounded-md text-muted-foreground [&>svg]:shrink-0 opacity-70 cursor-default [&>span]:whitespace-nowrap",t),children:e}):p.jsxs(RU,{open:s,onOpenChange:a,children:[p.jsx(TU,{asChild:!0,children:p.jsx("button",{className:ye("flex items-center gap-1.5 px-2 py-1 text-sm rounded-md transition-colors text-muted-foreground [&>svg]:shrink-0 [&>span]:whitespace-nowrap","hover:bg-muted/50",t),children:e})}),p.jsx($N,{align:"center",className:"w-64 p-1",children:p.jsx("div",{className:"space-y-1",children:typeof r=="function"?r(()=>a(!1)):r})})]})}function G_({availableProviders:e,selectedProvider:t,showProviderPicker:n=!0,providerLocked:r=!1,model:s,modelOptions:a,onProviderChange:l,onModelChange:u,onModelOptionChange:h,planMode:d=!1,onPlanModeChange:m,includePlanMode:g=!0,className:_}){var A,O,F,G,B;const b=e.find(H=>H.id===t)??e[0],w=M2[t],S=UC,C=g&&(b==null?void 0:b.supportsPlanMode)&&m,k=t==="claude"?a:null,R=t==="codex"?a:null,T=((A=b.models.find(H=>H.id===s))==null?void 0:A.contextWindowOptions)??[],N=(k==null?void 0:k.contextWindow)??B_[0].id,L=N==="1m"?qC:KC;return p.jsxs("div",{className:ye("flex md:justify-center items-center gap-0.5",_),children:[n?p.jsx(sl,{disabled:r||!l,trigger:p.jsxs(p.Fragment,{children:[p.jsx(w,{className:"h-3.5 w-3.5"}),p.jsx("span",{children:(b==null?void 0:b.label)??t})]}),children:H=>e.map(P=>{const U=M2[P.id];return p.jsx(os,{onClick:()=>{l==null||l(P.id),H()},selected:t===P.id,icon:p.jsx(U,{className:"h-4 w-4 text-muted-foreground"}),label:P.label},P.id)})}):null,p.jsx(sl,{trigger:p.jsxs(p.Fragment,{children:[p.jsx(S,{className:"h-3.5 w-3.5"}),p.jsx("span",{children:((O=b.models.find(H=>H.id===s))==null?void 0:O.label)??s})]}),children:H=>b.models.map(P=>{const U=UC;return p.jsx(os,{onClick:()=>{u(t,P.id),H()},selected:s===P.id,icon:p.jsx(U,{className:"h-4 w-4 text-muted-foreground"}),label:P.label},P.id)})}),p.jsx(sl,{trigger:p.jsxs(p.Fragment,{children:[p.jsx(kv,{className:"h-3.5 w-3.5"}),p.jsx("span",{children:t==="claude"?((F=Uf.find(H=>H.id===a.reasoningEffort))==null?void 0:F.label)??a.reasoningEffort:((G=z_.find(H=>H.id===a.reasoningEffort))==null?void 0:G.label)??a.reasoningEffort})]}),children:H=>t==="claude"?Uf.map(P=>p.jsx(os,{onClick:()=>{h({type:"claudeReasoningEffort",effort:P.id}),H()},selected:a.reasoningEffort===P.id,icon:p.jsx(kv,{className:"h-4 w-4 text-muted-foreground"}),label:P.label,disabled:P.id==="max"&&s!=="opus"},P.id)):z_.map(P=>p.jsx(os,{onClick:()=>{h({type:"codexReasoningEffort",effort:P.id}),H()},selected:a.reasoningEffort===P.id,icon:p.jsx(kv,{className:"h-4 w-4 text-muted-foreground"}),label:P.label},P.id))}),t==="claude"&&T.length>1?p.jsx(sl,{trigger:p.jsxs(p.Fragment,{children:[p.jsx(L,{className:"h-3.5 w-3.5"}),p.jsx("span",{children:((B=T.find(H=>H.id===N))==null?void 0:B.label)??N})]}),children:H=>T.map(P=>p.jsx(os,{onClick:()=>{h({type:"contextWindow",contextWindow:P.id}),H()},selected:N===P.id,icon:P.id==="1m"?p.jsx(qC,{className:"h-4 w-4 text-muted-foreground"}):p.jsx(KC,{className:"h-4 w-4 text-muted-foreground"}),label:P.label,description:P.id==="1m"?"Expanded context window":"Standard context window"},P.id))}):null,t==="codex"?p.jsx(sl,{trigger:p.jsxs(p.Fragment,{children:[R!=null&&R.fastMode?p.jsx(zh,{className:"h-3.5 w-3.5"}):p.jsx(zh,{className:"h-3.5 w-3.5 -scale-x-100"}),p.jsx("span",{children:R!=null&&R.fastMode?"Fast Mode":"Standard"})]}),triggerClassName:R!=null&&R.fastMode?"text-emerald-500 dark:text-emerald-400":void 0,children:H=>p.jsxs(p.Fragment,{children:[p.jsx(os,{onClick:()=>{h({type:"fastMode",fastMode:!1}),H()},selected:!(R!=null&&R.fastMode),icon:p.jsx(zh,{className:"h-4 w-4 text-muted-foreground -scale-x-100"}),label:"Standard"}),p.jsx(os,{onClick:()=>{h({type:"fastMode",fastMode:!0}),H()},selected:!!(R!=null&&R.fastMode),icon:p.jsx(zh,{className:"h-4 w-4 text-muted-foreground"}),label:"Fast Mode"})]})}):null,C?p.jsx(sl,{trigger:p.jsxs(p.Fragment,{children:[d?p.jsx(Of,{className:"h-3.5 w-3.5"}):p.jsx(WC,{className:"h-3.5 w-3.5"}),p.jsx("span",{children:d?"Plan Mode":"Full Access"})]}),triggerClassName:d?"text-blue-400 dark:text-blue-300":void 0,children:H=>p.jsxs(p.Fragment,{children:[p.jsx(os,{onClick:()=>{m(!1),H()},selected:!d,icon:p.jsx(WC,{className:"h-4 w-4 text-muted-foreground"}),label:"Full Access",description:"Execution without approval"}),p.jsx(os,{onClick:()=>{m(!0),H()},selected:d,icon:p.jsx(Of,{className:"h-4 w-4 text-muted-foreground"}),label:"Plan Mode",description:"Review a plan before execution"})]})}):null]})}const AU=1024*1024,DU=256*1024,N2=200,Y_=20,WN=new Set([".c",".cc",".cfg",".conf",".cpp",".cs",".css",".env",".go",".graphql",".h",".hpp",".html",".ini",".java",".js",".jsonc",".jsx",".kt",".lua",".mjs",".php",".pl",".properties",".py",".rb",".rs",".scss",".sh",".sql",".swift",".toml",".ts",".tsx",".txt",".vue",".xml",".yaml",".yml",".zsh"]),OU=new Set([".7z",".bz2",".gz",".rar",".tar",".tgz",".xz",".zip"]),jU=new Set([".aac",".flac",".m4a",".mp3",".ogg",".wav"]),LU=new Set([".avi",".m4v",".mov",".mp4",".mkv",".webm"]);function y0(e){const t=e.mimeType.toLowerCase(),n=VN(e.displayName);return t.startsWith("image/")?{kind:"image",openInNewTab:!1}:t==="application/pdf"?{kind:"pdf",openInNewTab:!1}:t==="application/json"?e.size<=DU?{kind:"json",openInNewTab:!1}:{kind:"external",openInNewTab:!0}:n===".md"?{kind:"markdown",openInNewTab:!1}:t==="text/csv"||t==="text/tab-separated-values"?{kind:"table",openInNewTab:!1}:t.startsWith("text/")?{kind:"text",openInNewTab:!1}:WN.has(n)?{kind:"text",openInNewTab:!1}:{kind:"external",openInNewTab:!0}}function zU(e){const t=e.mimeType.toLowerCase(),n=VN(e.displayName);return t.startsWith("image/")?"image":t==="application/pdf"||n===".pdf"?"pdf":t==="application/json"||n===".json"||n===".jsonc"?"json":n===".md"?"markdown":t==="text/csv"||t==="text/tab-separated-values"||n===".csv"||n===".tsv"?"table":t.startsWith("audio/")||jU.has(n)?"audio":t.startsWith("video/")||LU.has(n)?"video":t.includes("zip")||t.includes("archive")||OU.has(n)?"archive":WN.has(n)?n===".txt"?"text":"code":t.startsWith("text/")?"text":"file"}async function PU(e,t){const n=typeof AbortController<"u"?new AbortController:null,r=typeof window<"u"&&n?window.setTimeout(()=>n.abort("preview-timeout"),15e3):null;try{const s=await fetch(HU(e),{signal:n==null?void 0:n.signal,headers:{Accept:"text/plain, text/markdown, application/json, text/csv, text/tab-separated-values, */*"}});if(!s.ok)throw new Error(`Preview request failed with status ${s.status}`);if(!s.body){const g=await s.text(),_=new TextEncoder().encode(g),b=_.length>t;return{content:b?new TextDecoder().decode(_.slice(0,t)):g,truncated:b}}const a=s.body.getReader(),l=[];let u=0,h=!1;for(;;){const{done:g,value:_}=await a.read();if(g)break;if(!_)continue;const b=t-u;if(b<=0){h=!0,await a.cancel();break}if(_.byteLength>b){l.push(_.slice(0,b)),u+=b,h=!0,await a.cancel();break}l.push(_),u+=_.byteLength}const d=new Uint8Array(u);let m=0;for(const g of l)d.set(g,m),m+=g.byteLength;return{content:new TextDecoder().decode(d),truncated:h}}catch(s){throw FU(s)?new Error("Preview request timed out"):s}finally{r!==null&&window.clearTimeout(r)}}function BU(e){try{return`${JSON.stringify(JSON.parse(e),null,2)}
|
|
524
|
-
`}catch{return e}}function IU(e,t){const n=UU(e,t),r=n.length,s=n.reduce((u,h)=>Math.max(u,h.length),0),a=r>N2,l=s>Y_;return{rows:n.slice(0,N2).map(u=>u.slice(0,Y_)),rowCount:r,columnCount:s,truncatedRows:a,truncatedColumns:l}}function VN(e){const t=e.lastIndexOf(".");return t>=0?e.slice(t).toLowerCase():""}function HU(e){return typeof window>"u"?e:new URL(e,window.location.origin).toString()}function FU(e){return e instanceof DOMException&&e.name==="AbortError"?!0:typeof e=="string"&&e==="preview-timeout"}function UU(e,t){const n=[];let r=[],s="",a=!1;for(let l=0;l<e.length;l+=1){const u=e[l],h=e[l+1];if(u==='"'){a&&h==='"'?(s+='"',l+=1):a=!a;continue}if(!a&&u===t){r.push(s),s="";continue}if(!a&&(u===`
|
|
525
|
-
`||u==="\r")){u==="\r"&&h===`
|
|
526
|
-
`&&(l+=1),r.push(s),n.push(r),r=[],s="";continue}s+=u}return(s.length>0||r.length>0)&&(r.push(s),n.push(r)),n}function qN({attachment:e,previewUrl:t,onClick:n,onRemove:r,className:s,size:a="transcript"}){const l=e.contentUrl||t,u=a==="composer";return p.jsxs("div",{className:ye("group relative flex flex-row items-end",s),children:[p.jsxs("button",{type:"button",onClick:n,className:ye("group/image relative overflow-hidden rounded-xl border border-border/80 bg-background/85 shadow-sm backdrop-blur-md",u?"min-w-[80px]":"min-w-[200px]"),children:[l?p.jsx("img",{src:l,alt:e.displayName,className:ye("rounded-xl object-contain bg-muted",u?"min-h-[50px] min-w-[80px] max-h-[120px] max-w-[200px]":"min-h-[100px] min-w-[200px] max-h-[300px] max-w-[300px]")}):p.jsx("div",{className:ye("flex items-center justify-center rounded-xl bg-muted text-muted-foreground",u?"min-h-[64px] min-w-[80px]":"min-h-[160px] min-w-[200px]"),children:p.jsx(ET,{className:ye(u?"size-6":"size-8")})}),p.jsxs("div",{className:ye("pointer-events-none absolute inset-x-0 bottom-0 bg-gradient-to-t from-black/75 via-black/30 to-transparent text-left opacity-0 transition-opacity duration-200 group-hover/image:opacity-100",u?"px-2.5 pb-2 pt-6":"px-4 pb-3 pt-10"),children:[p.jsx("div",{className:ye("truncate font-medium text-white",u?"text-xs":"text-sm"),children:e.displayName}),p.jsxs("div",{className:"truncate text-xs text-white/80",children:[e.mimeType," · ",b0(e.size)]})]})]}),r?p.jsx(GN,{displayName:e.displayName,onRemove:r}):null]})}function KN({attachment:e,onClick:t,onRemove:n,className:r}){const s=$U(zU(e));return p.jsxs("div",{className:ye("group relative",r),children:[p.jsxs("button",{type:"button",onClick:t,className:"flex w-[200px] items-center gap-2 rounded-xl border border-border bg-background/85 p-1 pr-3 text-left transition-colors hover:bg-accent/50",children:[p.jsx("div",{className:"flex min-h-10 min-w-10 items-center justify-center rounded-lg border border-border bg-muted text-muted-foreground",children:p.jsx(s,{className:"size-5"})}),p.jsxs("div",{className:"min-w-0",children:[p.jsx("div",{className:"max-w-[150px] truncate text-[13px] font-medium text-foreground",children:e.displayName}),p.jsxs("div",{className:"truncate text-[11px] text-muted-foreground",children:[e.mimeType," · ",b0(e.size)]})]})]}),n?p.jsx(GN,{displayName:e.displayName,onRemove:n}):null]})}function GN({displayName:e,onRemove:t}){return p.jsx("button",{type:"button",className:"absolute right-2 top-2 rounded-full bg-background/90 p-1 text-muted-foreground shadow-sm transition hover:bg-muted hover:text-foreground",onClick:n=>{n.preventDefault(),n.stopPropagation(),t()},"aria-label":`Remove ${e}`,children:p.jsx(ca,{className:"h-3.5 w-3.5"})})}function $U(e){switch(e){case"image":return ET;case"pdf":return zB;case"markdown":return HB;case"json":return UP;case"table":return JP;case"code":return WP;case"text":return tB;case"archive":return HP;case"audio":return qP;case"video":return rB;default:return RT}}function b0(e){return e<1024?`${e} B`:e<1024*1024?`${Math.max(1,Math.round(e/1024))} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function WU(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const VU=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,qU=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,KU={};function A2(e,t){return(KU.jsx?qU:VU).test(e)}const GU=/[ \t\n\f\r]/g;function YU(e){return typeof e=="object"?e.type==="text"?D2(e.value):!1:D2(e)}function D2(e){return e.replace(GU,"")===""}class ld{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}ld.prototype.normal={};ld.prototype.property={};ld.prototype.space=void 0;function YN(e,t){const n={},r={};for(const s of e)Object.assign(n,s.property),Object.assign(r,s.normal);return new ld(n,r,t)}function X_(e){return e.toLowerCase()}class vr{constructor(t,n){this.attribute=n,this.property=t}}vr.prototype.attribute="";vr.prototype.booleanish=!1;vr.prototype.boolean=!1;vr.prototype.commaOrSpaceSeparated=!1;vr.prototype.commaSeparated=!1;vr.prototype.defined=!1;vr.prototype.mustUseProperty=!1;vr.prototype.number=!1;vr.prototype.overloadedBoolean=!1;vr.prototype.property="";vr.prototype.spaceSeparated=!1;vr.prototype.space=void 0;let XU=0;const Ye=pa(),on=pa(),Z_=pa(),Ce=pa(),zt=pa(),Cl=pa(),Rr=pa();function pa(){return 2**++XU}const Q_=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ye,booleanish:on,commaOrSpaceSeparated:Rr,commaSeparated:Cl,number:Ce,overloadedBoolean:Z_,spaceSeparated:zt},Symbol.toStringTag,{value:"Module"})),zv=Object.keys(Q_);class x0 extends vr{constructor(t,n,r,s){let a=-1;if(super(t,n),O2(this,"space",s),typeof r=="number")for(;++a<zv.length;){const l=zv[a];O2(this,zv[a],(r&Q_[l])===Q_[l])}}}x0.prototype.defined=!0;function O2(e,t,n){n&&(e[t]=n)}function Vl(e){const t={},n={};for(const[r,s]of Object.entries(e.properties)){const a=new x0(r,e.transform(e.attributes||{},r),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[X_(r)]=r,n[X_(a.attribute)]=r}return new ld(t,n,e.space)}const XN=Vl({properties:{ariaActiveDescendant:null,ariaAtomic:on,ariaAutoComplete:null,ariaBusy:on,ariaChecked:on,ariaColCount:Ce,ariaColIndex:Ce,ariaColSpan:Ce,ariaControls:zt,ariaCurrent:null,ariaDescribedBy:zt,ariaDetails:null,ariaDisabled:on,ariaDropEffect:zt,ariaErrorMessage:null,ariaExpanded:on,ariaFlowTo:zt,ariaGrabbed:on,ariaHasPopup:null,ariaHidden:on,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:zt,ariaLevel:Ce,ariaLive:null,ariaModal:on,ariaMultiLine:on,ariaMultiSelectable:on,ariaOrientation:null,ariaOwns:zt,ariaPlaceholder:null,ariaPosInSet:Ce,ariaPressed:on,ariaReadOnly:on,ariaRelevant:null,ariaRequired:on,ariaRoleDescription:zt,ariaRowCount:Ce,ariaRowIndex:Ce,ariaRowSpan:Ce,ariaSelected:on,ariaSetSize:Ce,ariaSort:null,ariaValueMax:Ce,ariaValueMin:Ce,ariaValueNow:Ce,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function ZN(e,t){return t in e?e[t]:t}function QN(e,t){return ZN(e,t.toLowerCase())}const ZU=Vl({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Cl,acceptCharset:zt,accessKey:zt,action:null,allow:null,allowFullScreen:Ye,allowPaymentRequest:Ye,allowUserMedia:Ye,alt:null,as:null,async:Ye,autoCapitalize:null,autoComplete:zt,autoFocus:Ye,autoPlay:Ye,blocking:zt,capture:null,charSet:null,checked:Ye,cite:null,className:zt,cols:Ce,colSpan:null,content:null,contentEditable:on,controls:Ye,controlsList:zt,coords:Ce|Cl,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ye,defer:Ye,dir:null,dirName:null,disabled:Ye,download:Z_,draggable:on,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ye,formTarget:null,headers:zt,height:Ce,hidden:Z_,high:Ce,href:null,hrefLang:null,htmlFor:zt,httpEquiv:zt,id:null,imageSizes:null,imageSrcSet:null,inert:Ye,inputMode:null,integrity:null,is:null,isMap:Ye,itemId:null,itemProp:zt,itemRef:zt,itemScope:Ye,itemType:zt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ye,low:Ce,manifest:null,max:null,maxLength:Ce,media:null,method:null,min:null,minLength:Ce,multiple:Ye,muted:Ye,name:null,nonce:null,noModule:Ye,noValidate:Ye,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Ye,optimum:Ce,pattern:null,ping:zt,placeholder:null,playsInline:Ye,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ye,referrerPolicy:null,rel:zt,required:Ye,reversed:Ye,rows:Ce,rowSpan:Ce,sandbox:zt,scope:null,scoped:Ye,seamless:Ye,selected:Ye,shadowRootClonable:Ye,shadowRootDelegatesFocus:Ye,shadowRootMode:null,shape:null,size:Ce,sizes:null,slot:null,span:Ce,spellCheck:on,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Ce,step:null,style:null,tabIndex:Ce,target:null,title:null,translate:null,type:null,typeMustMatch:Ye,useMap:null,value:on,width:Ce,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:zt,axis:null,background:null,bgColor:null,border:Ce,borderColor:null,bottomMargin:Ce,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ye,declare:Ye,event:null,face:null,frame:null,frameBorder:null,hSpace:Ce,leftMargin:Ce,link:null,longDesc:null,lowSrc:null,marginHeight:Ce,marginWidth:Ce,noResize:Ye,noHref:Ye,noShade:Ye,noWrap:Ye,object:null,profile:null,prompt:null,rev:null,rightMargin:Ce,rules:null,scheme:null,scrolling:on,standby:null,summary:null,text:null,topMargin:Ce,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Ce,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ye,disableRemotePlayback:Ye,prefix:null,property:null,results:Ce,security:null,unselectable:null},space:"html",transform:QN}),QU=Vl({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",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",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",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",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",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",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Rr,accentHeight:Ce,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Ce,amplitude:Ce,arabicForm:null,ascent:Ce,attributeName:null,attributeType:null,azimuth:Ce,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Ce,by:null,calcMode:null,capHeight:Ce,className:zt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Ce,diffuseConstant:Ce,direction:null,display:null,dur:null,divisor:Ce,dominantBaseline:null,download:Ye,dx:null,dy:null,edgeMode:null,editable:null,elevation:Ce,enableBackground:null,end:null,event:null,exponent:Ce,externalResourcesRequired:null,fill:null,fillOpacity:Ce,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Cl,g2:Cl,glyphName:Cl,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Ce,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Ce,horizOriginX:Ce,horizOriginY:Ce,id:null,ideographic:Ce,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Ce,k:Ce,k1:Ce,k2:Ce,k3:Ce,k4:Ce,kernelMatrix:Rr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Ce,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Ce,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Ce,overlineThickness:Ce,paintOrder:null,panose1:null,path:null,pathLength:Ce,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:zt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Ce,pointsAtY:Ce,pointsAtZ:Ce,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Rr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Rr,rev:Rr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Rr,requiredFeatures:Rr,requiredFonts:Rr,requiredFormats:Rr,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Ce,specularExponent:Ce,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Ce,strikethroughThickness:Ce,string:null,stroke:null,strokeDashArray:Rr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Ce,strokeOpacity:Ce,strokeWidth:null,style:null,surfaceScale:Ce,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Rr,tabIndex:Ce,tableValues:null,target:null,targetX:Ce,targetY:Ce,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Rr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Ce,underlineThickness:Ce,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Ce,values:null,vAlphabetic:Ce,vMathematical:Ce,vectorEffect:null,vHanging:Ce,vIdeographic:Ce,version:null,vertAdvY:Ce,vertOriginX:Ce,vertOriginY:Ce,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Ce,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:ZN}),JN=Vl({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),eA=Vl({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:QN}),tA=Vl({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),JU={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},e$=/[A-Z]/g,j2=/-[a-z]/g,t$=/^data[-\w.:]+$/i;function n$(e,t){const n=X_(t);let r=t,s=vr;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&t$.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(j2,i$);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!j2.test(a)){let l=a.replace(e$,r$);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}s=x0}return new s(r,t)}function r$(e){return"-"+e.toLowerCase()}function i$(e){return e.charAt(1).toUpperCase()}const s$=YN([XN,ZU,JN,eA,tA],"html"),w0=YN([XN,QU,JN,eA,tA],"svg");function o$(e){return e.join(" ").trim()}var ol={},Pv,L2;function a$(){if(L2)return Pv;L2=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,u=/^\s+|\s+$/g,h=`
|
|
527
|
-
`,d="/",m="*",g="",_="comment",b="declaration";function w(C,k){if(typeof C!="string")throw new TypeError("First argument must be a string");if(!C)return[];k=k||{};var R=1,T=1;function N(V){var W=V.match(t);W&&(R+=W.length);var z=V.lastIndexOf(h);T=~z?V.length-z:T+V.length}function L(){var V={line:R,column:T};return function(W){return W.position=new A(V),G(),W}}function A(V){this.start=V,this.end={line:R,column:T},this.source=k.source}A.prototype.content=C;function O(V){var W=new Error(k.source+":"+R+":"+T+": "+V);if(W.reason=V,W.filename=k.source,W.line=R,W.column=T,W.source=C,!k.silent)throw W}function F(V){var W=V.exec(C);if(W){var z=W[0];return N(z),C=C.slice(z.length),W}}function G(){F(n)}function B(V){var W;for(V=V||[];W=H();)W!==!1&&V.push(W);return V}function H(){var V=L();if(!(d!=C.charAt(0)||m!=C.charAt(1))){for(var W=2;g!=C.charAt(W)&&(m!=C.charAt(W)||d!=C.charAt(W+1));)++W;if(W+=2,g===C.charAt(W-1))return O("End of comment missing");var z=C.slice(2,W-2);return T+=2,N(z),C=C.slice(W),T+=2,V({type:_,comment:z})}}function P(){var V=L(),W=F(r);if(W){if(H(),!F(s))return O("property missing ':'");var z=F(a),$=V({type:b,property:S(W[0].replace(e,g)),value:z?S(z[0].replace(e,g)):g});return F(l),$}}function U(){var V=[];B(V);for(var W;W=P();)W!==!1&&(V.push(W),B(V));return V}return G(),U()}function S(C){return C?C.replace(u,g):g}return Pv=w,Pv}var z2;function l$(){if(z2)return ol;z2=1;var e=ol&&ol.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ol,"__esModule",{value:!0}),ol.default=n;const t=e(a$());function n(r,s){let a=null;if(!r||typeof r!="string")return a;const l=(0,t.default)(r),u=typeof s=="function";return l.forEach(h=>{if(h.type!=="declaration")return;const{property:d,value:m}=h;u?s(d,m,h):m&&(a=a||{},a[d]=m)}),a}return ol}var Gc={},P2;function c$(){if(P2)return Gc;P2=1,Object.defineProperty(Gc,"__esModule",{value:!0}),Gc.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,a=function(d){return!d||n.test(d)||e.test(d)},l=function(d,m){return m.toUpperCase()},u=function(d,m){return"".concat(m,"-")},h=function(d,m){return m===void 0&&(m={}),a(d)?d:(d=d.toLowerCase(),m.reactCompat?d=d.replace(s,u):d=d.replace(r,u),d.replace(t,l))};return Gc.camelCase=h,Gc}var Yc,B2;function u$(){if(B2)return Yc;B2=1;var e=Yc&&Yc.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},t=e(l$()),n=c$();function r(s,a){var l={};return!s||typeof s!="string"||(0,t.default)(s,function(u,h){u&&h&&(l[(0,n.camelCase)(u,a)]=h)}),l}return r.default=r,Yc=r,Yc}var d$=u$();const h$=dp(d$),nA=rA("end"),S0=rA("start");function rA(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function f$(e){const t=S0(e),n=nA(e);if(t&&n)return{start:t,end:n}}function Cu(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?I2(e.position):"start"in e||"end"in e?I2(e):"line"in e||"column"in e?J_(e):""}function J_(e){return H2(e&&e.line)+":"+H2(e&&e.column)}function I2(e){return J_(e&&e.start)+"-"+J_(e&&e.end)}function H2(e){return e&&typeof e=="number"?e:1}class Gn extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let s="",a={},l=!1;if(n&&("line"in n&&"column"in n?a={place:n}:"start"in n&&"end"in n?a={place:n}:"type"in n?a={ancestors:[n],place:n.position}:a={...n}),typeof t=="string"?s=t:!a.cause&&t&&(l=!0,s=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof r=="string"){const h=r.indexOf(":");h===-1?a.ruleId=r:(a.source=r.slice(0,h),a.ruleId=r.slice(h+1))}if(!a.place&&a.ancestors&&a.ancestors){const h=a.ancestors[a.ancestors.length-1];h&&(a.place=h.position)}const u=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=u?u.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=u?u.line:void 0,this.name=Cu(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=l&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Gn.prototype.file="";Gn.prototype.name="";Gn.prototype.reason="";Gn.prototype.message="";Gn.prototype.stack="";Gn.prototype.column=void 0;Gn.prototype.line=void 0;Gn.prototype.ancestors=void 0;Gn.prototype.cause=void 0;Gn.prototype.fatal=void 0;Gn.prototype.place=void 0;Gn.prototype.ruleId=void 0;Gn.prototype.source=void 0;const C0={}.hasOwnProperty,p$=new Map,m$=/[A-Z]/g,g$=new Set(["table","tbody","thead","tfoot","tr"]),v$=new Set(["td","th"]),iA="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function _$(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=E$(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=k$(n,t.jsx,t.jsxs)}const s={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?w0:s$,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=sA(s,e,void 0);return a&&typeof a!="string"?a:s.create(e,s.Fragment,{children:a||void 0},void 0)}function sA(e,t,n){if(t.type==="element")return y$(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return b$(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return w$(e,t,n);if(t.type==="mdxjsEsm")return x$(e,t);if(t.type==="root")return S$(e,t,n);if(t.type==="text")return C$(e,t)}function y$(e,t,n){const r=e.schema;let s=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=w0,e.schema=s),e.ancestors.push(t);const a=aA(e,t.tagName,!1),l=R$(e,t);let u=E0(e,t);return g$.has(t.tagName)&&(u=u.filter(function(h){return typeof h=="string"?!YU(h):!0})),oA(e,l,a,t),k0(l,u),e.ancestors.pop(),e.schema=r,e.create(t,a,l,n)}function b$(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Fu(e,t.position)}function x$(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Fu(e,t.position)}function w$(e,t,n){const r=e.schema;let s=r;t.name==="svg"&&r.space==="html"&&(s=w0,e.schema=s),e.ancestors.push(t);const a=t.name===null?e.Fragment:aA(e,t.name,!0),l=T$(e,t),u=E0(e,t);return oA(e,l,a,t),k0(l,u),e.ancestors.pop(),e.schema=r,e.create(t,a,l,n)}function S$(e,t,n){const r={};return k0(r,E0(e,t)),e.create(t,e.Fragment,r,n)}function C$(e,t){return t.value}function oA(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function k0(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function k$(e,t,n){return r;function r(s,a,l,u){const d=Array.isArray(l.children)?n:t;return u?d(a,l,u):d(a,l)}}function E$(e,t){return n;function n(r,s,a,l){const u=Array.isArray(a.children),h=S0(r);return t(s,a,l,u,{columnNumber:h?h.column-1:void 0,fileName:e,lineNumber:h?h.line:void 0},void 0)}}function R$(e,t){const n={};let r,s;for(s in t.properties)if(s!=="children"&&C0.call(t.properties,s)){const a=M$(e,s,t.properties[s]);if(a){const[l,u]=a;e.tableCellAlignToStyle&&l==="align"&&typeof u=="string"&&v$.has(t.tagName)?r=u:n[l]=u}}if(r){const a=n.style||(n.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function T$(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const a=r.data.estree.body[0];a.type;const l=a.expression;l.type;const u=l.properties[0];u.type,Object.assign(n,e.evaluater.evaluateExpression(u.argument))}else Fu(e,t.position);else{const s=r.name;let a;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const u=r.value.data.estree.body[0];u.type,a=e.evaluater.evaluateExpression(u.expression)}else Fu(e,t.position);else a=r.value===null?!0:r.value;n[s]=a}return n}function E0(e,t){const n=[];let r=-1;const s=e.passKeys?new Map:p$;for(;++r<t.children.length;){const a=t.children[r];let l;if(e.passKeys){const h=a.type==="element"?a.tagName:a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement"?a.name:void 0;if(h){const d=s.get(h)||0;l=h+"-"+d,s.set(h,d+1)}}const u=sA(e,a,l);u!==void 0&&n.push(u)}return n}function M$(e,t,n){const r=n$(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?WU(n):o$(n)),r.property==="style"){let s=typeof n=="object"?n:N$(e,String(n));return e.stylePropertyNameCase==="css"&&(s=A$(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&r.space?JU[r.property]||r.property:r.attribute,n]}}function N$(e,t){try{return h$(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,s=new Gn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=iA+"#cannot-parse-style-attribute",s}}function aA(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const s=t.split(".");let a=-1,l;for(;++a<s.length;){const u=A2(s[a])?{type:"Identifier",name:s[a]}:{type:"Literal",value:s[a]};l=l?{type:"MemberExpression",object:l,property:u,computed:!!(a&&u.type==="Literal"),optional:!1}:u}r=l}else r=A2(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const s=r.value;return C0.call(e.components,s)?e.components[s]:s}if(e.evaluater)return e.evaluater.evaluateExpression(r);Fu(e)}function Fu(e,t){const n=new Gn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=iA+"#cannot-handle-mdx-estrees-without-createevaluater",n}function A$(e){const t={};let n;for(n in e)C0.call(e,n)&&(t[D$(n)]=e[n]);return t}function D$(e){let t=e.replace(m$,O$);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function O$(e){return"-"+e.toLowerCase()}const Bv={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},j$={};function R0(e,t){const n=j$,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,s=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return lA(e,r,s)}function lA(e,t,n){if(L$(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return F2(e.children,t,n)}return Array.isArray(e)?F2(e,t,n):""}function F2(e,t,n){const r=[];let s=-1;for(;++s<e.length;)r[s]=lA(e[s],t,n);return r.join("")}function L$(e){return!!(e&&typeof e=="object")}const U2=document.createElement("i");function T0(e){const t="&"+e+";";U2.innerHTML=t;const n=U2.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Nr(e,t,n,r){const s=e.length;let a=0,l;if(t<0?t=-t>s?0:s+t:t=t>s?s:t,n=n>0?n:0,r.length<1e4)l=Array.from(r),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);a<r.length;)l=r.slice(a,a+1e4),l.unshift(t,0),e.splice(...l),a+=1e4,t+=1e4}function Xr(e,t){return e.length>0?(Nr(e,e.length,0,t),e):t}const $2={}.hasOwnProperty;function cA(e){const t={};let n=-1;for(;++n<e.length;)z$(t,e[n]);return t}function z$(e,t){let n;for(n in t){const s=($2.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let l;if(a)for(l in a){$2.call(s,l)||(s[l]=[]);const u=a[l];P$(s[l],Array.isArray(u)?u:u?[u]:[])}}}function P$(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Nr(e,0,0,r)}function uA(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function ci(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const nr=go(/[A-Za-z]/),qn=go(/[\dA-Za-z]/),B$=go(/[#-'*+\--9=?A-Z^-~]/);function Xf(e){return e!==null&&(e<32||e===127)}const ey=go(/\d/),I$=go(/[\dA-Fa-f]/),H$=go(/[!-/:-@[-`{-~]/);function Be(e){return e!==null&&e<-2}function jt(e){return e!==null&&(e<0||e===32)}function it(e){return e===-2||e===-1||e===32}const Pp=go(new RegExp("\\p{P}|\\p{S}","u")),ea=go(/\s/);function go(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function ql(e){const t=[];let n=-1,r=0,s=0;for(;++n<e.length;){const a=e.charCodeAt(n);let l="";if(a===37&&qn(e.charCodeAt(n+1))&&qn(e.charCodeAt(n+2)))s=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(l=String.fromCharCode(a));else if(a>55295&&a<57344){const u=e.charCodeAt(n+1);a<56320&&u>56319&&u<57344?(l=String.fromCharCode(a,u),s=1):l="�"}else l=String.fromCharCode(a);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+s+1,l=""),s&&(n+=s,s=0)}return t.join("")+e.slice(r)}function ut(e,t,n,r){const s=r?r-1:Number.POSITIVE_INFINITY;let a=0;return l;function l(h){return it(h)?(e.enter(n),u(h)):t(h)}function u(h){return it(h)&&a++<s?(e.consume(h),u):(e.exit(n),t(h))}}const F$={tokenize:U$};function U$(e){const t=e.attempt(this.parser.constructs.contentInitial,r,s);let n;return t;function r(u){if(u===null){e.consume(u);return}return e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),ut(e,t,"linePrefix")}function s(u){return e.enter("paragraph"),a(u)}function a(u){const h=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=h),n=h,l(u)}function l(u){if(u===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(u);return}return Be(u)?(e.consume(u),e.exit("chunkText"),a):(e.consume(u),l)}}const $$={tokenize:W$},W2={tokenize:V$};function W$(e){const t=this,n=[];let r=0,s,a,l;return u;function u(T){if(r<n.length){const N=n[r];return t.containerState=N[1],e.attempt(N[0].continuation,h,d)(T)}return d(T)}function h(T){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,s&&R();const N=t.events.length;let L=N,A;for(;L--;)if(t.events[L][0]==="exit"&&t.events[L][1].type==="chunkFlow"){A=t.events[L][1].end;break}k(r);let O=N;for(;O<t.events.length;)t.events[O][1].end={...A},O++;return Nr(t.events,L+1,0,t.events.slice(N)),t.events.length=O,d(T)}return u(T)}function d(T){if(r===n.length){if(!s)return _(T);if(s.currentConstruct&&s.currentConstruct.concrete)return w(T);t.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(W2,m,g)(T)}function m(T){return s&&R(),k(r),_(T)}function g(T){return t.parser.lazy[t.now().line]=r!==n.length,l=t.now().offset,w(T)}function _(T){return t.containerState={},e.attempt(W2,b,w)(T)}function b(T){return r++,n.push([t.currentConstruct,t.containerState]),_(T)}function w(T){if(T===null){s&&R(),k(0),e.consume(T);return}return s=s||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:a}),S(T)}function S(T){if(T===null){C(e.exit("chunkFlow"),!0),k(0),e.consume(T);return}return Be(T)?(e.consume(T),C(e.exit("chunkFlow")),r=0,t.interrupt=void 0,u):(e.consume(T),S)}function C(T,N){const L=t.sliceStream(T);if(N&&L.push(null),T.previous=a,a&&(a.next=T),a=T,s.defineSkip(T.start),s.write(L),t.parser.lazy[T.start.line]){let A=s.events.length;for(;A--;)if(s.events[A][1].start.offset<l&&(!s.events[A][1].end||s.events[A][1].end.offset>l))return;const O=t.events.length;let F=O,G,B;for(;F--;)if(t.events[F][0]==="exit"&&t.events[F][1].type==="chunkFlow"){if(G){B=t.events[F][1].end;break}G=!0}for(k(r),A=O;A<t.events.length;)t.events[A][1].end={...B},A++;Nr(t.events,F+1,0,t.events.slice(O)),t.events.length=A}}function k(T){let N=n.length;for(;N-- >T;){const L=n[N];t.containerState=L[1],L[0].exit.call(t,e)}n.length=T}function R(){s.write([null]),a=void 0,s=void 0,t.containerState._closeFlow=void 0}}function V$(e,t,n){return ut(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Al(e){if(e===null||jt(e)||ea(e))return 1;if(Pp(e))return 2}function Bp(e,t,n){const r=[];let s=-1;for(;++s<e.length;){const a=e[s].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}const ty={name:"attention",resolveAll:q$,tokenize:K$};function q$(e,t){let n=-1,r,s,a,l,u,h,d,m;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;h=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const g={...e[r][1].end},_={...e[n][1].start};V2(g,-h),V2(_,h),l={type:h>1?"strongSequence":"emphasisSequence",start:g,end:{...e[r][1].end}},u={type:h>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:_},a={type:h>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},s={type:h>1?"strong":"emphasis",start:{...l.start},end:{...u.end}},e[r][1].end={...l.start},e[n][1].start={...u.end},d=[],e[r][1].end.offset-e[r][1].start.offset&&(d=Xr(d,[["enter",e[r][1],t],["exit",e[r][1],t]])),d=Xr(d,[["enter",s,t],["enter",l,t],["exit",l,t],["enter",a,t]]),d=Xr(d,Bp(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),d=Xr(d,[["exit",a,t],["enter",u,t],["exit",u,t],["exit",s,t]]),e[n][1].end.offset-e[n][1].start.offset?(m=2,d=Xr(d,[["enter",e[n][1],t],["exit",e[n][1],t]])):m=0,Nr(e,r-1,n-r+3,d),n=r+d.length-m-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function K$(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,s=Al(r);let a;return l;function l(h){return a=h,e.enter("attentionSequence"),u(h)}function u(h){if(h===a)return e.consume(h),u;const d=e.exit("attentionSequence"),m=Al(h),g=!m||m===2&&s||n.includes(h),_=!s||s===2&&m||n.includes(r);return d._open=!!(a===42?g:g&&(s||!_)),d._close=!!(a===42?_:_&&(m||!g)),t(h)}}function V2(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const G$={name:"autolink",tokenize:Y$};function Y$(e,t,n){let r=0;return s;function s(b){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),a}function a(b){return nr(b)?(e.consume(b),l):b===64?n(b):d(b)}function l(b){return b===43||b===45||b===46||qn(b)?(r=1,u(b)):d(b)}function u(b){return b===58?(e.consume(b),r=0,h):(b===43||b===45||b===46||qn(b))&&r++<32?(e.consume(b),u):(r=0,d(b))}function h(b){return b===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),t):b===null||b===32||b===60||Xf(b)?n(b):(e.consume(b),h)}function d(b){return b===64?(e.consume(b),m):B$(b)?(e.consume(b),d):n(b)}function m(b){return qn(b)?g(b):n(b)}function g(b){return b===46?(e.consume(b),r=0,m):b===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),t):_(b)}function _(b){if((b===45||qn(b))&&r++<63){const w=b===45?_:g;return e.consume(b),w}return n(b)}}const cd={partial:!0,tokenize:X$};function X$(e,t,n){return r;function r(a){return it(a)?ut(e,s,"linePrefix")(a):s(a)}function s(a){return a===null||Be(a)?t(a):n(a)}}const dA={continuation:{tokenize:Q$},exit:J$,name:"blockQuote",tokenize:Z$};function Z$(e,t,n){const r=this;return s;function s(l){if(l===62){const u=r.containerState;return u.open||(e.enter("blockQuote",{_container:!0}),u.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),a}return n(l)}function a(l){return it(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function Q$(e,t,n){const r=this;return s;function s(l){return it(l)?ut(e,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):a(l)}function a(l){return e.attempt(dA,t,n)(l)}}function J$(e){e.exit("blockQuote")}const hA={name:"characterEscape",tokenize:eW};function eW(e,t,n){return r;function r(a){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(a),e.exit("escapeMarker"),s}function s(a){return H$(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const fA={name:"characterReference",tokenize:tW};function tW(e,t,n){const r=this;let s=0,a,l;return u;function u(g){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),h}function h(g){return g===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(g),e.exit("characterReferenceMarkerNumeric"),d):(e.enter("characterReferenceValue"),a=31,l=qn,m(g))}function d(g){return g===88||g===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(g),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),a=6,l=I$,m):(e.enter("characterReferenceValue"),a=7,l=ey,m(g))}function m(g){if(g===59&&s){const _=e.exit("characterReferenceValue");return l===qn&&!T0(r.sliceSerialize(_))?n(g):(e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return l(g)&&s++<a?(e.consume(g),m):n(g)}}const q2={partial:!0,tokenize:rW},K2={concrete:!0,name:"codeFenced",tokenize:nW};function nW(e,t,n){const r=this,s={partial:!0,tokenize:L};let a=0,l=0,u;return h;function h(A){return d(A)}function d(A){const O=r.events[r.events.length-1];return a=O&&O[1].type==="linePrefix"?O[2].sliceSerialize(O[1],!0).length:0,u=A,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),m(A)}function m(A){return A===u?(l++,e.consume(A),m):l<3?n(A):(e.exit("codeFencedFenceSequence"),it(A)?ut(e,g,"whitespace")(A):g(A))}function g(A){return A===null||Be(A)?(e.exit("codeFencedFence"),r.interrupt?t(A):e.check(q2,S,N)(A)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),_(A))}function _(A){return A===null||Be(A)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),g(A)):it(A)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),ut(e,b,"whitespace")(A)):A===96&&A===u?n(A):(e.consume(A),_)}function b(A){return A===null||Be(A)?g(A):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),w(A))}function w(A){return A===null||Be(A)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),g(A)):A===96&&A===u?n(A):(e.consume(A),w)}function S(A){return e.attempt(s,N,C)(A)}function C(A){return e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),k}function k(A){return a>0&&it(A)?ut(e,R,"linePrefix",a+1)(A):R(A)}function R(A){return A===null||Be(A)?e.check(q2,S,N)(A):(e.enter("codeFlowValue"),T(A))}function T(A){return A===null||Be(A)?(e.exit("codeFlowValue"),R(A)):(e.consume(A),T)}function N(A){return e.exit("codeFenced"),t(A)}function L(A,O,F){let G=0;return B;function B(W){return A.enter("lineEnding"),A.consume(W),A.exit("lineEnding"),H}function H(W){return A.enter("codeFencedFence"),it(W)?ut(A,P,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(W):P(W)}function P(W){return W===u?(A.enter("codeFencedFenceSequence"),U(W)):F(W)}function U(W){return W===u?(G++,A.consume(W),U):G>=l?(A.exit("codeFencedFenceSequence"),it(W)?ut(A,V,"whitespace")(W):V(W)):F(W)}function V(W){return W===null||Be(W)?(A.exit("codeFencedFence"),O(W)):F(W)}}}function rW(e,t,n){const r=this;return s;function s(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),a)}function a(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}const Iv={name:"codeIndented",tokenize:sW},iW={partial:!0,tokenize:oW};function sW(e,t,n){const r=this;return s;function s(d){return e.enter("codeIndented"),ut(e,a,"linePrefix",5)(d)}function a(d){const m=r.events[r.events.length-1];return m&&m[1].type==="linePrefix"&&m[2].sliceSerialize(m[1],!0).length>=4?l(d):n(d)}function l(d){return d===null?h(d):Be(d)?e.attempt(iW,l,h)(d):(e.enter("codeFlowValue"),u(d))}function u(d){return d===null||Be(d)?(e.exit("codeFlowValue"),l(d)):(e.consume(d),u)}function h(d){return e.exit("codeIndented"),t(d)}}function oW(e,t,n){const r=this;return s;function s(l){return r.parser.lazy[r.now().line]?n(l):Be(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),s):ut(e,a,"linePrefix",5)(l)}function a(l){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(l):Be(l)?s(l):n(l)}}const aW={name:"codeText",previous:cW,resolve:lW,tokenize:uW};function lW(e){let t=e.length-4,n=3,r,s;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)s===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(s=r):(r===t||e[r][1].type==="lineEnding")&&(e[s][1].type="codeTextData",r!==s+2&&(e[s][1].end=e[r-1][1].end,e.splice(s+2,r-s-2),t-=r-s-2,r=s+2),s=void 0);return e}function cW(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function uW(e,t,n){let r=0,s,a;return l;function l(g){return e.enter("codeText"),e.enter("codeTextSequence"),u(g)}function u(g){return g===96?(e.consume(g),r++,u):(e.exit("codeTextSequence"),h(g))}function h(g){return g===null?n(g):g===32?(e.enter("space"),e.consume(g),e.exit("space"),h):g===96?(a=e.enter("codeTextSequence"),s=0,m(g)):Be(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),h):(e.enter("codeTextData"),d(g))}function d(g){return g===null||g===32||g===96||Be(g)?(e.exit("codeTextData"),h(g)):(e.consume(g),d)}function m(g){return g===96?(e.consume(g),s++,m):s===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(g)):(a.type="codeTextData",d(g))}}class dW{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const s=n||0;this.setCursor(Math.trunc(t));const a=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return r&&Xc(this.left,r),a.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Xc(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Xc(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Xc(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Xc(this.left,n.reverse())}}}function Xc(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function pA(e){const t={};let n=-1,r,s,a,l,u,h,d;const m=new dW(e);for(;++n<m.length;){for(;n in t;)n=t[n];if(r=m.get(n),n&&r[1].type==="chunkFlow"&&m.get(n-1)[1].type==="listItemPrefix"&&(h=r[1]._tokenizer.events,a=0,a<h.length&&h[a][1].type==="lineEndingBlank"&&(a+=2),a<h.length&&h[a][1].type==="content"))for(;++a<h.length&&h[a][1].type!=="content";)h[a][1].type==="chunkText"&&(h[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,hW(m,n)),n=t[n],d=!0);else if(r[1]._container){for(a=n,s=void 0;a--;)if(l=m.get(a),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(s&&(m.get(s)[1].type="lineEndingBlank"),l[1].type="lineEnding",s=a);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;s&&(r[1].end={...m.get(s)[1].start},u=m.slice(s,n),u.unshift(r),m.splice(s,n-s+1,u))}}return Nr(e,0,Number.POSITIVE_INFINITY,m.slice(0)),!d}function hW(e,t){const n=e.get(t)[1],r=e.get(t)[2];let s=t-1;const a=[];let l=n._tokenizer;l||(l=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const u=l.events,h=[],d={};let m,g,_=-1,b=n,w=0,S=0;const C=[S];for(;b;){for(;e.get(++s)[1]!==b;);a.push(s),b._tokenizer||(m=r.sliceStream(b),b.next||m.push(null),g&&l.defineSkip(b.start),b._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(m),b._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),g=b,b=b.next}for(b=n;++_<u.length;)u[_][0]==="exit"&&u[_-1][0]==="enter"&&u[_][1].type===u[_-1][1].type&&u[_][1].start.line!==u[_][1].end.line&&(S=_+1,C.push(S),b._tokenizer=void 0,b.previous=void 0,b=b.next);for(l.events=[],b?(b._tokenizer=void 0,b.previous=void 0):C.pop(),_=C.length;_--;){const k=u.slice(C[_],C[_+1]),R=a.pop();h.push([R,R+k.length-1]),e.splice(R,2,k)}for(h.reverse(),_=-1;++_<h.length;)d[w+h[_][0]]=w+h[_][1],w+=h[_][1]-h[_][0]-1;return d}const fW={resolve:mW,tokenize:gW},pW={partial:!0,tokenize:vW};function mW(e){return pA(e),e}function gW(e,t){let n;return r;function r(u){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),s(u)}function s(u){return u===null?a(u):Be(u)?e.check(pW,l,a)(u):(e.consume(u),s)}function a(u){return e.exit("chunkContent"),e.exit("content"),t(u)}function l(u){return e.consume(u),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,s}}function vW(e,t,n){const r=this;return s;function s(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),ut(e,a,"linePrefix")}function a(l){if(l===null||Be(l))return n(l);const u=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}function mA(e,t,n,r,s,a,l,u,h){const d=h||Number.POSITIVE_INFINITY;let m=0;return g;function g(k){return k===60?(e.enter(r),e.enter(s),e.enter(a),e.consume(k),e.exit(a),_):k===null||k===32||k===41||Xf(k)?n(k):(e.enter(r),e.enter(l),e.enter(u),e.enter("chunkString",{contentType:"string"}),S(k))}function _(k){return k===62?(e.enter(a),e.consume(k),e.exit(a),e.exit(s),e.exit(r),t):(e.enter(u),e.enter("chunkString",{contentType:"string"}),b(k))}function b(k){return k===62?(e.exit("chunkString"),e.exit(u),_(k)):k===null||k===60||Be(k)?n(k):(e.consume(k),k===92?w:b)}function w(k){return k===60||k===62||k===92?(e.consume(k),b):b(k)}function S(k){return!m&&(k===null||k===41||jt(k))?(e.exit("chunkString"),e.exit(u),e.exit(l),e.exit(r),t(k)):m<d&&k===40?(e.consume(k),m++,S):k===41?(e.consume(k),m--,S):k===null||k===32||k===40||Xf(k)?n(k):(e.consume(k),k===92?C:S)}function C(k){return k===40||k===41||k===92?(e.consume(k),S):S(k)}}function gA(e,t,n,r,s,a){const l=this;let u=0,h;return d;function d(b){return e.enter(r),e.enter(s),e.consume(b),e.exit(s),e.enter(a),m}function m(b){return u>999||b===null||b===91||b===93&&!h||b===94&&!u&&"_hiddenFootnoteSupport"in l.parser.constructs?n(b):b===93?(e.exit(a),e.enter(s),e.consume(b),e.exit(s),e.exit(r),t):Be(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),m):(e.enter("chunkString",{contentType:"string"}),g(b))}function g(b){return b===null||b===91||b===93||Be(b)||u++>999?(e.exit("chunkString"),m(b)):(e.consume(b),h||(h=!it(b)),b===92?_:g)}function _(b){return b===91||b===92||b===93?(e.consume(b),u++,g):g(b)}}function vA(e,t,n,r,s,a){let l;return u;function u(_){return _===34||_===39||_===40?(e.enter(r),e.enter(s),e.consume(_),e.exit(s),l=_===40?41:_,h):n(_)}function h(_){return _===l?(e.enter(s),e.consume(_),e.exit(s),e.exit(r),t):(e.enter(a),d(_))}function d(_){return _===l?(e.exit(a),h(l)):_===null?n(_):Be(_)?(e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),ut(e,d,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),m(_))}function m(_){return _===l||_===null||Be(_)?(e.exit("chunkString"),d(_)):(e.consume(_),_===92?g:m)}function g(_){return _===l||_===92?(e.consume(_),m):m(_)}}function ku(e,t){let n;return r;function r(s){return Be(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,r):it(s)?ut(e,r,n?"linePrefix":"lineSuffix")(s):t(s)}}const _W={name:"definition",tokenize:bW},yW={partial:!0,tokenize:xW};function bW(e,t,n){const r=this;let s;return a;function a(b){return e.enter("definition"),l(b)}function l(b){return gA.call(r,e,u,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(b)}function u(b){return s=ci(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),b===58?(e.enter("definitionMarker"),e.consume(b),e.exit("definitionMarker"),h):n(b)}function h(b){return jt(b)?ku(e,d)(b):d(b)}function d(b){return mA(e,m,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(b)}function m(b){return e.attempt(yW,g,g)(b)}function g(b){return it(b)?ut(e,_,"whitespace")(b):_(b)}function _(b){return b===null||Be(b)?(e.exit("definition"),r.parser.defined.push(s),t(b)):n(b)}}function xW(e,t,n){return r;function r(u){return jt(u)?ku(e,s)(u):n(u)}function s(u){return vA(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(u)}function a(u){return it(u)?ut(e,l,"whitespace")(u):l(u)}function l(u){return u===null||Be(u)?t(u):n(u)}}const wW={name:"hardBreakEscape",tokenize:SW};function SW(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),s}function s(a){return Be(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const CW={name:"headingAtx",resolve:kW,tokenize:EW};function kW(e,t){let n=e.length-2,r=3,s,a;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(s={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},a={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Nr(e,r,n-r+1,[["enter",s,t],["enter",a,t],["exit",a,t],["exit",s,t]])),e}function EW(e,t,n){let r=0;return s;function s(m){return e.enter("atxHeading"),a(m)}function a(m){return e.enter("atxHeadingSequence"),l(m)}function l(m){return m===35&&r++<6?(e.consume(m),l):m===null||jt(m)?(e.exit("atxHeadingSequence"),u(m)):n(m)}function u(m){return m===35?(e.enter("atxHeadingSequence"),h(m)):m===null||Be(m)?(e.exit("atxHeading"),t(m)):it(m)?ut(e,u,"whitespace")(m):(e.enter("atxHeadingText"),d(m))}function h(m){return m===35?(e.consume(m),h):(e.exit("atxHeadingSequence"),u(m))}function d(m){return m===null||m===35||jt(m)?(e.exit("atxHeadingText"),u(m)):(e.consume(m),d)}}const RW=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],G2=["pre","script","style","textarea"],TW={concrete:!0,name:"htmlFlow",resolveTo:AW,tokenize:DW},MW={partial:!0,tokenize:jW},NW={partial:!0,tokenize:OW};function AW(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function DW(e,t,n){const r=this;let s,a,l,u,h;return d;function d(j){return m(j)}function m(j){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(j),g}function g(j){return j===33?(e.consume(j),_):j===47?(e.consume(j),a=!0,S):j===63?(e.consume(j),s=3,r.interrupt?t:M):nr(j)?(e.consume(j),l=String.fromCharCode(j),C):n(j)}function _(j){return j===45?(e.consume(j),s=2,b):j===91?(e.consume(j),s=5,u=0,w):nr(j)?(e.consume(j),s=4,r.interrupt?t:M):n(j)}function b(j){return j===45?(e.consume(j),r.interrupt?t:M):n(j)}function w(j){const ce="CDATA[";return j===ce.charCodeAt(u++)?(e.consume(j),u===ce.length?r.interrupt?t:P:w):n(j)}function S(j){return nr(j)?(e.consume(j),l=String.fromCharCode(j),C):n(j)}function C(j){if(j===null||j===47||j===62||jt(j)){const ce=j===47,fe=l.toLowerCase();return!ce&&!a&&G2.includes(fe)?(s=1,r.interrupt?t(j):P(j)):RW.includes(l.toLowerCase())?(s=6,ce?(e.consume(j),k):r.interrupt?t(j):P(j)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(j):a?R(j):T(j))}return j===45||qn(j)?(e.consume(j),l+=String.fromCharCode(j),C):n(j)}function k(j){return j===62?(e.consume(j),r.interrupt?t:P):n(j)}function R(j){return it(j)?(e.consume(j),R):B(j)}function T(j){return j===47?(e.consume(j),B):j===58||j===95||nr(j)?(e.consume(j),N):it(j)?(e.consume(j),T):B(j)}function N(j){return j===45||j===46||j===58||j===95||qn(j)?(e.consume(j),N):L(j)}function L(j){return j===61?(e.consume(j),A):it(j)?(e.consume(j),L):T(j)}function A(j){return j===null||j===60||j===61||j===62||j===96?n(j):j===34||j===39?(e.consume(j),h=j,O):it(j)?(e.consume(j),A):F(j)}function O(j){return j===h?(e.consume(j),h=null,G):j===null||Be(j)?n(j):(e.consume(j),O)}function F(j){return j===null||j===34||j===39||j===47||j===60||j===61||j===62||j===96||jt(j)?L(j):(e.consume(j),F)}function G(j){return j===47||j===62||it(j)?T(j):n(j)}function B(j){return j===62?(e.consume(j),H):n(j)}function H(j){return j===null||Be(j)?P(j):it(j)?(e.consume(j),H):n(j)}function P(j){return j===45&&s===2?(e.consume(j),z):j===60&&s===1?(e.consume(j),$):j===62&&s===4?(e.consume(j),I):j===63&&s===3?(e.consume(j),M):j===93&&s===5?(e.consume(j),Q):Be(j)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(MW,Z,U)(j)):j===null||Be(j)?(e.exit("htmlFlowData"),U(j)):(e.consume(j),P)}function U(j){return e.check(NW,V,Z)(j)}function V(j){return e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),W}function W(j){return j===null||Be(j)?U(j):(e.enter("htmlFlowData"),P(j))}function z(j){return j===45?(e.consume(j),M):P(j)}function $(j){return j===47?(e.consume(j),l="",q):P(j)}function q(j){if(j===62){const ce=l.toLowerCase();return G2.includes(ce)?(e.consume(j),I):P(j)}return nr(j)&&l.length<8?(e.consume(j),l+=String.fromCharCode(j),q):P(j)}function Q(j){return j===93?(e.consume(j),M):P(j)}function M(j){return j===62?(e.consume(j),I):j===45&&s===2?(e.consume(j),M):P(j)}function I(j){return j===null||Be(j)?(e.exit("htmlFlowData"),Z(j)):(e.consume(j),I)}function Z(j){return e.exit("htmlFlow"),t(j)}}function OW(e,t,n){const r=this;return s;function s(l){return Be(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),a):n(l)}function a(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}function jW(e,t,n){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(cd,t,n)}}const LW={name:"htmlText",tokenize:zW};function zW(e,t,n){const r=this;let s,a,l;return u;function u(M){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(M),h}function h(M){return M===33?(e.consume(M),d):M===47?(e.consume(M),L):M===63?(e.consume(M),T):nr(M)?(e.consume(M),F):n(M)}function d(M){return M===45?(e.consume(M),m):M===91?(e.consume(M),a=0,w):nr(M)?(e.consume(M),R):n(M)}function m(M){return M===45?(e.consume(M),b):n(M)}function g(M){return M===null?n(M):M===45?(e.consume(M),_):Be(M)?(l=g,$(M)):(e.consume(M),g)}function _(M){return M===45?(e.consume(M),b):g(M)}function b(M){return M===62?z(M):M===45?_(M):g(M)}function w(M){const I="CDATA[";return M===I.charCodeAt(a++)?(e.consume(M),a===I.length?S:w):n(M)}function S(M){return M===null?n(M):M===93?(e.consume(M),C):Be(M)?(l=S,$(M)):(e.consume(M),S)}function C(M){return M===93?(e.consume(M),k):S(M)}function k(M){return M===62?z(M):M===93?(e.consume(M),k):S(M)}function R(M){return M===null||M===62?z(M):Be(M)?(l=R,$(M)):(e.consume(M),R)}function T(M){return M===null?n(M):M===63?(e.consume(M),N):Be(M)?(l=T,$(M)):(e.consume(M),T)}function N(M){return M===62?z(M):T(M)}function L(M){return nr(M)?(e.consume(M),A):n(M)}function A(M){return M===45||qn(M)?(e.consume(M),A):O(M)}function O(M){return Be(M)?(l=O,$(M)):it(M)?(e.consume(M),O):z(M)}function F(M){return M===45||qn(M)?(e.consume(M),F):M===47||M===62||jt(M)?G(M):n(M)}function G(M){return M===47?(e.consume(M),z):M===58||M===95||nr(M)?(e.consume(M),B):Be(M)?(l=G,$(M)):it(M)?(e.consume(M),G):z(M)}function B(M){return M===45||M===46||M===58||M===95||qn(M)?(e.consume(M),B):H(M)}function H(M){return M===61?(e.consume(M),P):Be(M)?(l=H,$(M)):it(M)?(e.consume(M),H):G(M)}function P(M){return M===null||M===60||M===61||M===62||M===96?n(M):M===34||M===39?(e.consume(M),s=M,U):Be(M)?(l=P,$(M)):it(M)?(e.consume(M),P):(e.consume(M),V)}function U(M){return M===s?(e.consume(M),s=void 0,W):M===null?n(M):Be(M)?(l=U,$(M)):(e.consume(M),U)}function V(M){return M===null||M===34||M===39||M===60||M===61||M===96?n(M):M===47||M===62||jt(M)?G(M):(e.consume(M),V)}function W(M){return M===47||M===62||jt(M)?G(M):n(M)}function z(M){return M===62?(e.consume(M),e.exit("htmlTextData"),e.exit("htmlText"),t):n(M)}function $(M){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),q}function q(M){return it(M)?ut(e,Q,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):Q(M)}function Q(M){return e.enter("htmlTextData"),l(M)}}const M0={name:"labelEnd",resolveAll:HW,resolveTo:FW,tokenize:UW},PW={tokenize:$W},BW={tokenize:WW},IW={tokenize:VW};function HW(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const s=r.type==="labelImage"?4:2;r.type="data",t+=s}}return e.length!==n.length&&Nr(e,0,e.length,n),e}function FW(e,t){let n=e.length,r=0,s,a,l,u;for(;n--;)if(s=e[n][1],a){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;e[n][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(l){if(e[n][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(a=n,s.type!=="labelLink")){r=2;break}}else s.type==="labelEnd"&&(l=n);const h={type:e[a][1].type==="labelLink"?"link":"image",start:{...e[a][1].start},end:{...e[e.length-1][1].end}},d={type:"label",start:{...e[a][1].start},end:{...e[l][1].end}},m={type:"labelText",start:{...e[a+r+2][1].end},end:{...e[l-2][1].start}};return u=[["enter",h,t],["enter",d,t]],u=Xr(u,e.slice(a+1,a+r+3)),u=Xr(u,[["enter",m,t]]),u=Xr(u,Bp(t.parser.constructs.insideSpan.null,e.slice(a+r+4,l-3),t)),u=Xr(u,[["exit",m,t],e[l-2],e[l-1],["exit",d,t]]),u=Xr(u,e.slice(l+1)),u=Xr(u,[["exit",h,t]]),Nr(e,a,e.length,u),e}function UW(e,t,n){const r=this;let s=r.events.length,a,l;for(;s--;)if((r.events[s][1].type==="labelImage"||r.events[s][1].type==="labelLink")&&!r.events[s][1]._balanced){a=r.events[s][1];break}return u;function u(_){return a?a._inactive?g(_):(l=r.parser.defined.includes(ci(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(_),e.exit("labelMarker"),e.exit("labelEnd"),h):n(_)}function h(_){return _===40?e.attempt(PW,m,l?m:g)(_):_===91?e.attempt(BW,m,l?d:g)(_):l?m(_):g(_)}function d(_){return e.attempt(IW,m,g)(_)}function m(_){return t(_)}function g(_){return a._balanced=!0,n(_)}}function $W(e,t,n){return r;function r(g){return e.enter("resource"),e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),s}function s(g){return jt(g)?ku(e,a)(g):a(g)}function a(g){return g===41?m(g):mA(e,l,u,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(g)}function l(g){return jt(g)?ku(e,h)(g):m(g)}function u(g){return n(g)}function h(g){return g===34||g===39||g===40?vA(e,d,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(g):m(g)}function d(g){return jt(g)?ku(e,m)(g):m(g)}function m(g){return g===41?(e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),e.exit("resource"),t):n(g)}}function WW(e,t,n){const r=this;return s;function s(u){return gA.call(r,e,a,l,"reference","referenceMarker","referenceString")(u)}function a(u){return r.parser.defined.includes(ci(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(u):n(u)}function l(u){return n(u)}}function VW(e,t,n){return r;function r(a){return e.enter("reference"),e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),s}function s(a){return a===93?(e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),e.exit("reference"),t):n(a)}}const qW={name:"labelStartImage",resolveAll:M0.resolveAll,tokenize:KW};function KW(e,t,n){const r=this;return s;function s(u){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(u),e.exit("labelImageMarker"),a}function a(u){return u===91?(e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelImage"),l):n(u)}function l(u){return u===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(u):t(u)}}const GW={name:"labelStartLink",resolveAll:M0.resolveAll,tokenize:YW};function YW(e,t,n){const r=this;return s;function s(l){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelLink"),a}function a(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):t(l)}}const Hv={name:"lineEnding",tokenize:XW};function XW(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),ut(e,t,"linePrefix")}}const gf={name:"thematicBreak",tokenize:ZW};function ZW(e,t,n){let r=0,s;return a;function a(d){return e.enter("thematicBreak"),l(d)}function l(d){return s=d,u(d)}function u(d){return d===s?(e.enter("thematicBreakSequence"),h(d)):r>=3&&(d===null||Be(d))?(e.exit("thematicBreak"),t(d)):n(d)}function h(d){return d===s?(e.consume(d),r++,h):(e.exit("thematicBreakSequence"),it(d)?ut(e,u,"whitespace")(d):u(d))}}const pr={continuation:{tokenize:tV},exit:rV,name:"list",tokenize:eV},QW={partial:!0,tokenize:iV},JW={partial:!0,tokenize:nV};function eV(e,t,n){const r=this,s=r.events[r.events.length-1];let a=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,l=0;return u;function u(b){const w=r.containerState.type||(b===42||b===43||b===45?"listUnordered":"listOrdered");if(w==="listUnordered"?!r.containerState.marker||b===r.containerState.marker:ey(b)){if(r.containerState.type||(r.containerState.type=w,e.enter(w,{_container:!0})),w==="listUnordered")return e.enter("listItemPrefix"),b===42||b===45?e.check(gf,n,d)(b):d(b);if(!r.interrupt||b===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),h(b)}return n(b)}function h(b){return ey(b)&&++l<10?(e.consume(b),h):(!r.interrupt||l<2)&&(r.containerState.marker?b===r.containerState.marker:b===41||b===46)?(e.exit("listItemValue"),d(b)):n(b)}function d(b){return e.enter("listItemMarker"),e.consume(b),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||b,e.check(cd,r.interrupt?n:m,e.attempt(QW,_,g))}function m(b){return r.containerState.initialBlankLine=!0,a++,_(b)}function g(b){return it(b)?(e.enter("listItemPrefixWhitespace"),e.consume(b),e.exit("listItemPrefixWhitespace"),_):n(b)}function _(b){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(b)}}function tV(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(cd,s,a);function s(u){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,ut(e,t,"listItemIndent",r.containerState.size+1)(u)}function a(u){return r.containerState.furtherBlankLines||!it(u)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(u)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(JW,t,l)(u))}function l(u){return r.containerState._closeFlow=!0,r.interrupt=void 0,ut(e,e.attempt(pr,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u)}}function nV(e,t,n){const r=this;return ut(e,s,"listItemIndent",r.containerState.size+1);function s(a){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?t(a):n(a)}}function rV(e){e.exit(this.containerState.type)}function iV(e,t,n){const r=this;return ut(e,s,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(a){const l=r.events[r.events.length-1];return!it(a)&&l&&l[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const Y2={name:"setextUnderline",resolveTo:sV,tokenize:oV};function sV(e,t){let n=e.length,r,s,a;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(s=n)}else e[n][1].type==="content"&&e.splice(n,1),!a&&e[n][1].type==="definition"&&(a=n);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",a?(e.splice(s,0,["enter",l,t]),e.splice(a+1,0,["exit",e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=l,e.push(["exit",l,t]),e}function oV(e,t,n){const r=this;let s;return a;function a(d){let m=r.events.length,g;for(;m--;)if(r.events[m][1].type!=="lineEnding"&&r.events[m][1].type!=="linePrefix"&&r.events[m][1].type!=="content"){g=r.events[m][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||g)?(e.enter("setextHeadingLine"),s=d,l(d)):n(d)}function l(d){return e.enter("setextHeadingLineSequence"),u(d)}function u(d){return d===s?(e.consume(d),u):(e.exit("setextHeadingLineSequence"),it(d)?ut(e,h,"lineSuffix")(d):h(d))}function h(d){return d===null||Be(d)?(e.exit("setextHeadingLine"),t(d)):n(d)}}const aV={tokenize:lV};function lV(e){const t=this,n=e.attempt(cd,r,e.attempt(this.parser.constructs.flowInitial,s,ut(e,e.attempt(this.parser.constructs.flow,s,e.attempt(fW,s)),"linePrefix")));return n;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEndingBlank"),e.consume(a),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function s(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const cV={resolveAll:yA()},uV=_A("string"),dV=_A("text");function _A(e){return{resolveAll:yA(e==="text"?hV:void 0),tokenize:t};function t(n){const r=this,s=this.parser.constructs[e],a=n.attempt(s,l,u);return l;function l(m){return d(m)?a(m):u(m)}function u(m){if(m===null){n.consume(m);return}return n.enter("data"),n.consume(m),h}function h(m){return d(m)?(n.exit("data"),a(m)):(n.consume(m),h)}function d(m){if(m===null)return!0;const g=s[m];let _=-1;if(g)for(;++_<g.length;){const b=g[_];if(!b.previous||b.previous.call(r,r.previous))return!0}return!1}}}function yA(e){return t;function t(n,r){let s=-1,a;for(;++s<=n.length;)a===void 0?n[s]&&n[s][1].type==="data"&&(a=s,s++):(!n[s]||n[s][1].type!=="data")&&(s!==a+2&&(n[a][1].end=n[s-1][1].end,n.splice(a+2,s-a-2),s=a+2),a=void 0);return e?e(n,r):n}}function hV(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],s=t.sliceStream(r);let a=s.length,l=-1,u=0,h;for(;a--;){const d=s[a];if(typeof d=="string"){for(l=d.length;d.charCodeAt(l-1)===32;)u++,l--;if(l)break;l=-1}else if(d===-2)h=!0,u++;else if(d!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(u=0),u){const d={type:n===e.length||h||u<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?l:r.start._bufferIndex+l,_index:r.start._index+a,line:r.end.line,column:r.end.column-u,offset:r.end.offset-u},end:{...r.end}};r.end={...d.start},r.start.offset===r.end.offset?Object.assign(r,d):(e.splice(n,0,["enter",d,t],["exit",d,t]),n+=2)}n++}return e}const fV={42:pr,43:pr,45:pr,48:pr,49:pr,50:pr,51:pr,52:pr,53:pr,54:pr,55:pr,56:pr,57:pr,62:dA},pV={91:_W},mV={[-2]:Iv,[-1]:Iv,32:Iv},gV={35:CW,42:gf,45:[Y2,gf],60:TW,61:Y2,95:gf,96:K2,126:K2},vV={38:fA,92:hA},_V={[-5]:Hv,[-4]:Hv,[-3]:Hv,33:qW,38:fA,42:ty,60:[G$,LW],91:GW,92:[wW,hA],93:M0,95:ty,96:aW},yV={null:[ty,cV]},bV={null:[42,95]},xV={null:[]},wV=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:bV,contentInitial:pV,disable:xV,document:fV,flow:gV,flowInitial:mV,insideSpan:yV,string:vV,text:_V},Symbol.toStringTag,{value:"Module"}));function SV(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const s={},a=[];let l=[],u=[];const h={attempt:O(L),check:O(A),consume:R,enter:T,exit:N,interrupt:O(A,{interrupt:!0})},d={code:null,containerState:{},defineSkip:S,events:[],now:w,parser:e,previous:null,sliceSerialize:_,sliceStream:b,write:g};let m=t.tokenize.call(d,h);return t.resolveAll&&a.push(t),d;function g(H){return l=Xr(l,H),C(),l[l.length-1]!==null?[]:(F(t,0),d.events=Bp(a,d.events,d),d.events)}function _(H,P){return kV(b(H),P)}function b(H){return CV(l,H)}function w(){const{_bufferIndex:H,_index:P,line:U,column:V,offset:W}=r;return{_bufferIndex:H,_index:P,line:U,column:V,offset:W}}function S(H){s[H.line]=H.column,B()}function C(){let H;for(;r._index<l.length;){const P=l[r._index];if(typeof P=="string")for(H=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===H&&r._bufferIndex<P.length;)k(P.charCodeAt(r._bufferIndex));else k(P)}}function k(H){m=m(H)}function R(H){Be(H)?(r.line++,r.column=1,r.offset+=H===-3?2:1,B()):H!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),d.previous=H}function T(H,P){const U=P||{};return U.type=H,U.start=w(),d.events.push(["enter",U,d]),u.push(U),U}function N(H){const P=u.pop();return P.end=w(),d.events.push(["exit",P,d]),P}function L(H,P){F(H,P.from)}function A(H,P){P.restore()}function O(H,P){return U;function U(V,W,z){let $,q,Q,M;return Array.isArray(V)?Z(V):"tokenize"in V?Z([V]):I(V);function I(ue){return de;function de(we){const oe=we!==null&&ue[we],be=we!==null&&ue.null,Ne=[...Array.isArray(oe)?oe:oe?[oe]:[],...Array.isArray(be)?be:be?[be]:[]];return Z(Ne)(we)}}function Z(ue){return $=ue,q=0,ue.length===0?z:j(ue[q])}function j(ue){return de;function de(we){return M=G(),Q=ue,ue.partial||(d.currentConstruct=ue),ue.name&&d.parser.constructs.disable.null.includes(ue.name)?fe():ue.tokenize.call(P?Object.assign(Object.create(d),P):d,h,ce,fe)(we)}}function ce(ue){return H(Q,M),W}function fe(ue){return M.restore(),++q<$.length?j($[q]):z}}}function F(H,P){H.resolveAll&&!a.includes(H)&&a.push(H),H.resolve&&Nr(d.events,P,d.events.length-P,H.resolve(d.events.slice(P),d)),H.resolveTo&&(d.events=H.resolveTo(d.events,d))}function G(){const H=w(),P=d.previous,U=d.currentConstruct,V=d.events.length,W=Array.from(u);return{from:V,restore:z};function z(){r=H,d.previous=P,d.currentConstruct=U,d.events.length=V,u=W,B()}}function B(){r.line in s&&r.column<2&&(r.column=s[r.line],r.offset+=s[r.line]-1)}}function CV(e,t){const n=t.start._index,r=t.start._bufferIndex,s=t.end._index,a=t.end._bufferIndex;let l;if(n===s)l=[e[n].slice(r,a)];else{if(l=e.slice(n,s),r>-1){const u=l[0];typeof u=="string"?l[0]=u.slice(r):l.shift()}a>0&&l.push(e[s].slice(0,a))}return l}function kV(e,t){let n=-1;const r=[];let s;for(;++n<e.length;){const a=e[n];let l;if(typeof a=="string")l=a;else switch(a){case-5:{l="\r";break}case-4:{l=`
|
|
528
|
-
`;break}case-3:{l=`\r
|
|
529
|
-
`;break}case-2:{l=t?" ":" ";break}case-1:{if(!t&&s)continue;l=" ";break}default:l=String.fromCharCode(a)}s=a===-2,r.push(l)}return r.join("")}function EV(e){const r={constructs:cA([wV,...(e||{}).extensions||[]]),content:s(F$),defined:[],document:s($$),flow:s(aV),lazy:{},string:s(uV),text:s(dV)};return r;function s(a){return l;function l(u){return SV(r,a,u)}}}function RV(e){for(;!pA(e););return e}const X2=/[\0\t\n\r]/g;function TV(){let e=1,t="",n=!0,r;return s;function s(a,l,u){const h=[];let d,m,g,_,b;for(a=t+(typeof a=="string"?a.toString():new TextDecoder(l||void 0).decode(a)),g=0,t="",n&&(a.charCodeAt(0)===65279&&g++,n=void 0);g<a.length;){if(X2.lastIndex=g,d=X2.exec(a),_=d&&d.index!==void 0?d.index:a.length,b=a.charCodeAt(_),!d){t=a.slice(g);break}if(b===10&&g===_&&r)h.push(-3),r=void 0;else switch(r&&(h.push(-5),r=void 0),g<_&&(h.push(a.slice(g,_)),e+=_-g),b){case 0:{h.push(65533),e++;break}case 9:{for(m=Math.ceil(e/4)*4,h.push(-2);e++<m;)h.push(-1);break}case 10:{h.push(-4),e=1;break}default:r=!0,e=1}g=_+1}return u&&(r&&h.push(-5),t&&h.push(t),h.push(null)),h}}const MV=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function NV(e){return e.replace(MV,AV)}function AV(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const s=n.charCodeAt(1),a=s===120||s===88;return uA(n.slice(a?2:1),a?16:10)}return T0(n)||e}const bA={}.hasOwnProperty;function DV(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),OV(n)(RV(EV(n).document().write(TV()(e,t,!0))))}function OV(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(mt),autolinkProtocol:G,autolinkEmail:G,atxHeading:a(He),blockQuote:a(be),characterEscape:G,characterReference:G,codeFenced:a(Ne),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:a(Ne,l),codeText:a(Se,l),codeTextData:G,data:G,codeFlowValue:G,definition:a(_e),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:a(xe),hardBreakEscape:a(Fe),hardBreakTrailing:a(Fe),htmlFlow:a(et,l),htmlFlowData:G,htmlText:a(et,l),htmlTextData:G,image:a(dt),label:l,link:a(mt),listItem:a(un),listItemValue:_,listOrdered:a(bt,g),listUnordered:a(bt),paragraph:a(Zt),reference:j,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:a(He),strong:a(Nn),thematicBreak:a(Yn)},exit:{atxHeading:h(),atxHeadingSequence:L,autolink:h(),autolinkEmail:oe,autolinkProtocol:we,blockQuote:h(),characterEscapeValue:B,characterReferenceMarkerHexadecimal:fe,characterReferenceMarkerNumeric:fe,characterReferenceValue:ue,characterReference:de,codeFenced:h(C),codeFencedFence:S,codeFencedFenceInfo:b,codeFencedFenceMeta:w,codeFlowValue:B,codeIndented:h(k),codeText:h(W),codeTextData:B,data:B,definition:h(),definitionDestinationString:N,definitionLabelString:R,definitionTitleString:T,emphasis:h(),hardBreakEscape:h(P),hardBreakTrailing:h(P),htmlFlow:h(U),htmlFlowData:B,htmlText:h(V),htmlTextData:B,image:h($),label:Q,labelText:q,lineEnding:H,link:h(z),listItem:h(),listOrdered:h(),listUnordered:h(),paragraph:h(),referenceString:ce,resourceDestinationString:M,resourceTitleString:I,resource:Z,setextHeading:h(F),setextHeadingLineSequence:O,setextHeadingText:A,strong:h(),thematicBreak:h()}};xA(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(Y){let le={type:"root",children:[]};const Re={stack:[le],tokenStack:[],config:t,enter:u,exit:d,buffer:l,resume:m,data:n},ze=[];let $e=-1;for(;++$e<Y.length;)if(Y[$e][1].type==="listOrdered"||Y[$e][1].type==="listUnordered")if(Y[$e][0]==="enter")ze.push($e);else{const ht=ze.pop();$e=s(Y,ht,$e)}for($e=-1;++$e<Y.length;){const ht=t[Y[$e][0]];bA.call(ht,Y[$e][1].type)&&ht[Y[$e][1].type].call(Object.assign({sliceSerialize:Y[$e][2].sliceSerialize},Re),Y[$e][1])}if(Re.tokenStack.length>0){const ht=Re.tokenStack[Re.tokenStack.length-1];(ht[1]||Z2).call(Re,void 0,ht[0])}for(le.position={start:Gs(Y.length>0?Y[0][1].start:{line:1,column:1,offset:0}),end:Gs(Y.length>0?Y[Y.length-2][1].end:{line:1,column:1,offset:0})},$e=-1;++$e<t.transforms.length;)le=t.transforms[$e](le)||le;return le}function s(Y,le,Re){let ze=le-1,$e=-1,ht=!1,ee,Xe,gt,ie;for(;++ze<=Re;){const Te=Y[ze];switch(Te[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Te[0]==="enter"?$e++:$e--,ie=void 0;break}case"lineEndingBlank":{Te[0]==="enter"&&(ee&&!ie&&!$e&&!gt&&(gt=ze),ie=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:ie=void 0}if(!$e&&Te[0]==="enter"&&Te[1].type==="listItemPrefix"||$e===-1&&Te[0]==="exit"&&(Te[1].type==="listUnordered"||Te[1].type==="listOrdered")){if(ee){let ct=ze;for(Xe=void 0;ct--;){const xt=Y[ct];if(xt[1].type==="lineEnding"||xt[1].type==="lineEndingBlank"){if(xt[0]==="exit")continue;Xe&&(Y[Xe][1].type="lineEndingBlank",ht=!0),xt[1].type="lineEnding",Xe=ct}else if(!(xt[1].type==="linePrefix"||xt[1].type==="blockQuotePrefix"||xt[1].type==="blockQuotePrefixWhitespace"||xt[1].type==="blockQuoteMarker"||xt[1].type==="listItemIndent"))break}gt&&(!Xe||gt<Xe)&&(ee._spread=!0),ee.end=Object.assign({},Xe?Y[Xe][1].start:Te[1].end),Y.splice(Xe||ze,0,["exit",ee,Te[2]]),ze++,Re++}if(Te[1].type==="listItemPrefix"){const ct={type:"listItem",_spread:!1,start:Object.assign({},Te[1].start),end:void 0};ee=ct,Y.splice(ze,0,["enter",ct,Te[2]]),ze++,Re++,gt=void 0,ie=!0}}}return Y[le][1]._spread=ht,Re}function a(Y,le){return Re;function Re(ze){u.call(this,Y(ze),ze),le&&le.call(this,ze)}}function l(){this.stack.push({type:"fragment",children:[]})}function u(Y,le,Re){this.stack[this.stack.length-1].children.push(Y),this.stack.push(Y),this.tokenStack.push([le,Re||void 0]),Y.position={start:Gs(le.start),end:void 0}}function h(Y){return le;function le(Re){Y&&Y.call(this,Re),d.call(this,Re)}}function d(Y,le){const Re=this.stack.pop(),ze=this.tokenStack.pop();if(ze)ze[0].type!==Y.type&&(le?le.call(this,Y,ze[0]):(ze[1]||Z2).call(this,Y,ze[0]));else throw new Error("Cannot close `"+Y.type+"` ("+Cu({start:Y.start,end:Y.end})+"): it’s not open");Re.position.end=Gs(Y.end)}function m(){return R0(this.stack.pop())}function g(){this.data.expectingFirstListItemValue=!0}function _(Y){if(this.data.expectingFirstListItemValue){const le=this.stack[this.stack.length-2];le.start=Number.parseInt(this.sliceSerialize(Y),10),this.data.expectingFirstListItemValue=void 0}}function b(){const Y=this.resume(),le=this.stack[this.stack.length-1];le.lang=Y}function w(){const Y=this.resume(),le=this.stack[this.stack.length-1];le.meta=Y}function S(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function C(){const Y=this.resume(),le=this.stack[this.stack.length-1];le.value=Y.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function k(){const Y=this.resume(),le=this.stack[this.stack.length-1];le.value=Y.replace(/(\r?\n|\r)$/g,"")}function R(Y){const le=this.resume(),Re=this.stack[this.stack.length-1];Re.label=le,Re.identifier=ci(this.sliceSerialize(Y)).toLowerCase()}function T(){const Y=this.resume(),le=this.stack[this.stack.length-1];le.title=Y}function N(){const Y=this.resume(),le=this.stack[this.stack.length-1];le.url=Y}function L(Y){const le=this.stack[this.stack.length-1];if(!le.depth){const Re=this.sliceSerialize(Y).length;le.depth=Re}}function A(){this.data.setextHeadingSlurpLineEnding=!0}function O(Y){const le=this.stack[this.stack.length-1];le.depth=this.sliceSerialize(Y).codePointAt(0)===61?1:2}function F(){this.data.setextHeadingSlurpLineEnding=void 0}function G(Y){const Re=this.stack[this.stack.length-1].children;let ze=Re[Re.length-1];(!ze||ze.type!=="text")&&(ze=Dt(),ze.position={start:Gs(Y.start),end:void 0},Re.push(ze)),this.stack.push(ze)}function B(Y){const le=this.stack.pop();le.value+=this.sliceSerialize(Y),le.position.end=Gs(Y.end)}function H(Y){const le=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Re=le.children[le.children.length-1];Re.position.end=Gs(Y.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(le.type)&&(G.call(this,Y),B.call(this,Y))}function P(){this.data.atHardBreak=!0}function U(){const Y=this.resume(),le=this.stack[this.stack.length-1];le.value=Y}function V(){const Y=this.resume(),le=this.stack[this.stack.length-1];le.value=Y}function W(){const Y=this.resume(),le=this.stack[this.stack.length-1];le.value=Y}function z(){const Y=this.stack[this.stack.length-1];if(this.data.inReference){const le=this.data.referenceType||"shortcut";Y.type+="Reference",Y.referenceType=le,delete Y.url,delete Y.title}else delete Y.identifier,delete Y.label;this.data.referenceType=void 0}function $(){const Y=this.stack[this.stack.length-1];if(this.data.inReference){const le=this.data.referenceType||"shortcut";Y.type+="Reference",Y.referenceType=le,delete Y.url,delete Y.title}else delete Y.identifier,delete Y.label;this.data.referenceType=void 0}function q(Y){const le=this.sliceSerialize(Y),Re=this.stack[this.stack.length-2];Re.label=NV(le),Re.identifier=ci(le).toLowerCase()}function Q(){const Y=this.stack[this.stack.length-1],le=this.resume(),Re=this.stack[this.stack.length-1];if(this.data.inReference=!0,Re.type==="link"){const ze=Y.children;Re.children=ze}else Re.alt=le}function M(){const Y=this.resume(),le=this.stack[this.stack.length-1];le.url=Y}function I(){const Y=this.resume(),le=this.stack[this.stack.length-1];le.title=Y}function Z(){this.data.inReference=void 0}function j(){this.data.referenceType="collapsed"}function ce(Y){const le=this.resume(),Re=this.stack[this.stack.length-1];Re.label=le,Re.identifier=ci(this.sliceSerialize(Y)).toLowerCase(),this.data.referenceType="full"}function fe(Y){this.data.characterReferenceType=Y.type}function ue(Y){const le=this.sliceSerialize(Y),Re=this.data.characterReferenceType;let ze;Re?(ze=uA(le,Re==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):ze=T0(le);const $e=this.stack[this.stack.length-1];$e.value+=ze}function de(Y){const le=this.stack.pop();le.position.end=Gs(Y.end)}function we(Y){B.call(this,Y);const le=this.stack[this.stack.length-1];le.url=this.sliceSerialize(Y)}function oe(Y){B.call(this,Y);const le=this.stack[this.stack.length-1];le.url="mailto:"+this.sliceSerialize(Y)}function be(){return{type:"blockquote",children:[]}}function Ne(){return{type:"code",lang:null,meta:null,value:""}}function Se(){return{type:"inlineCode",value:""}}function _e(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function xe(){return{type:"emphasis",children:[]}}function He(){return{type:"heading",depth:0,children:[]}}function Fe(){return{type:"break"}}function et(){return{type:"html",value:""}}function dt(){return{type:"image",title:null,url:"",alt:null}}function mt(){return{type:"link",title:null,url:"",children:[]}}function bt(Y){return{type:"list",ordered:Y.type==="listOrdered",start:null,spread:Y._spread,children:[]}}function un(Y){return{type:"listItem",spread:Y._spread,checked:null,children:[]}}function Zt(){return{type:"paragraph",children:[]}}function Nn(){return{type:"strong",children:[]}}function Dt(){return{type:"text",value:""}}function Yn(){return{type:"thematicBreak"}}}function Gs(e){return{line:e.line,column:e.column,offset:e.offset}}function xA(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?xA(e,r):jV(e,r)}}function jV(e,t){let n;for(n in t)if(bA.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function Z2(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Cu({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Cu({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Cu({start:t.start,end:t.end})+") is still open")}function LV(e){const t=this;t.parser=n;function n(r){return DV(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function zV(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function PV(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
530
|
-
`}]}function BV(e,t){const n=t.value?t.value+`
|
|
531
|
-
`:"",r={},s=t.lang?t.lang.split(/\s+/):[];s.length>0&&(r.className=["language-"+s[0]]);let a={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:"element",tagName:"pre",properties:{},children:[a]},e.patch(t,a),a}function IV(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function HV(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function FV(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),s=ql(r.toLowerCase()),a=e.footnoteOrder.indexOf(r);let l,u=e.footnoteCounts.get(r);u===void 0?(u=0,e.footnoteOrder.push(r),l=e.footnoteOrder.length):l=a+1,u+=1,e.footnoteCounts.set(r,u);const h={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+s,id:n+"fnref-"+s+(u>1?"-"+u:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,h);const d={type:"element",tagName:"sup",properties:{},children:[h]};return e.patch(t,d),e.applyData(t,d)}function UV(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function $V(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function wA(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const s=e.all(t),a=s[0];a&&a.type==="text"?a.value="["+a.value:s.unshift({type:"text",value:"["});const l=s[s.length-1];return l&&l.type==="text"?l.value+=r:s.push({type:"text",value:r}),s}function WV(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return wA(e,t);const s={src:ql(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(s.title=r.title);const a={type:"element",tagName:"img",properties:s,children:[]};return e.patch(t,a),e.applyData(t,a)}function VV(e,t){const n={src:ql(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function qV(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function KV(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return wA(e,t);const s={href:ql(r.url||"")};r.title!==null&&r.title!==void 0&&(s.title=r.title);const a={type:"element",tagName:"a",properties:s,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function GV(e,t){const n={href:ql(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function YV(e,t,n){const r=e.all(t),s=n?XV(n):SA(t),a={},l=[];if(typeof t.checked=="boolean"){const m=r[0];let g;m&&m.type==="element"&&m.tagName==="p"?g=m:(g={type:"element",tagName:"p",properties:{},children:[]},r.unshift(g)),g.children.length>0&&g.children.unshift({type:"text",value:" "}),g.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let u=-1;for(;++u<r.length;){const m=r[u];(s||u!==0||m.type!=="element"||m.tagName!=="p")&&l.push({type:"text",value:`
|
|
532
|
-
`}),m.type==="element"&&m.tagName==="p"&&!s?l.push(...m.children):l.push(m)}const h=r[r.length-1];h&&(s||h.type!=="element"||h.tagName!=="p")&&l.push({type:"text",value:`
|
|
533
|
-
`});const d={type:"element",tagName:"li",properties:a,children:l};return e.patch(t,d),e.applyData(t,d)}function XV(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=SA(n[r])}return t}function SA(e){const t=e.spread;return t??e.children.length>1}function ZV(e,t){const n={},r=e.all(t);let s=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++s<r.length;){const l=r[s];if(l.type==="element"&&l.tagName==="li"&&l.properties&&Array.isArray(l.properties.className)&&l.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const a={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function QV(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function JV(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function eq(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function tq(e,t){const n=e.all(t),r=n.shift(),s=[];if(r){const l={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],l),s.push(l)}if(n.length>0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},u=S0(t.children[1]),h=nA(t.children[t.children.length-1]);u&&h&&(l.position={start:u,end:h}),s.push(l)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(t,a),e.applyData(t,a)}function nq(e,t,n){const r=n?n.children:void 0,a=(r?r.indexOf(t):1)===0?"th":"td",l=n&&n.type==="table"?n.align:void 0,u=l?l.length:t.children.length;let h=-1;const d=[];for(;++h<u;){const g=t.children[h],_={},b=l?l[h]:void 0;b&&(_.align=b);let w={type:"element",tagName:a,properties:_,children:[]};g&&(w.children=e.all(g),e.patch(g,w),w=e.applyData(g,w)),d.push(w)}const m={type:"element",tagName:"tr",properties:{},children:e.wrap(d,!0)};return e.patch(t,m),e.applyData(t,m)}function rq(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Q2=9,J2=32;function iq(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),s=0;const a=[];for(;r;)a.push(ek(t.slice(s,r.index),s>0,!0),r[0]),s=r.index+r[0].length,r=n.exec(t);return a.push(ek(t.slice(s),s>0,!1)),a.join("")}function ek(e,t,n){let r=0,s=e.length;if(t){let a=e.codePointAt(r);for(;a===Q2||a===J2;)r++,a=e.codePointAt(r)}if(n){let a=e.codePointAt(s-1);for(;a===Q2||a===J2;)s--,a=e.codePointAt(s-1)}return s>r?e.slice(r,s):""}function sq(e,t){const n={type:"text",value:iq(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function oq(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const aq={blockquote:zV,break:PV,code:BV,delete:IV,emphasis:HV,footnoteReference:FV,heading:UV,html:$V,imageReference:WV,image:VV,inlineCode:qV,linkReference:KV,link:GV,listItem:YV,list:ZV,paragraph:QV,root:JV,strong:eq,table:tq,tableCell:rq,tableRow:nq,text:sq,thematicBreak:oq,toml:$h,yaml:$h,definition:$h,footnoteDefinition:$h};function $h(){}const CA=-1,Ip=0,Eu=1,Zf=2,N0=3,A0=4,D0=5,O0=6,kA=7,EA=8,tk=typeof self=="object"?self:globalThis,lq=(e,t)=>{const n=(s,a)=>(e.set(a,s),s),r=s=>{if(e.has(s))return e.get(s);const[a,l]=t[s];switch(a){case Ip:case CA:return n(l,s);case Eu:{const u=n([],s);for(const h of l)u.push(r(h));return u}case Zf:{const u=n({},s);for(const[h,d]of l)u[r(h)]=r(d);return u}case N0:return n(new Date(l),s);case A0:{const{source:u,flags:h}=l;return n(new RegExp(u,h),s)}case D0:{const u=n(new Map,s);for(const[h,d]of l)u.set(r(h),r(d));return u}case O0:{const u=n(new Set,s);for(const h of l)u.add(r(h));return u}case kA:{const{name:u,message:h}=l;return n(new tk[u](h),s)}case EA:return n(BigInt(l),s);case"BigInt":return n(Object(BigInt(l)),s);case"ArrayBuffer":return n(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:u}=new Uint8Array(l);return n(new DataView(u),l)}}return n(new tk[a](l),s)};return r},nk=e=>lq(new Map,e)(0),al="",{toString:cq}={},{keys:uq}=Object,Zc=e=>{const t=typeof e;if(t!=="object"||!e)return[Ip,t];const n=cq.call(e).slice(8,-1);switch(n){case"Array":return[Eu,al];case"Object":return[Zf,al];case"Date":return[N0,al];case"RegExp":return[A0,al];case"Map":return[D0,al];case"Set":return[O0,al];case"DataView":return[Eu,n]}return n.includes("Array")?[Eu,n]:n.includes("Error")?[kA,n]:[Zf,n]},Wh=([e,t])=>e===Ip&&(t==="function"||t==="symbol"),dq=(e,t,n,r)=>{const s=(l,u)=>{const h=r.push(l)-1;return n.set(u,h),h},a=l=>{if(n.has(l))return n.get(l);let[u,h]=Zc(l);switch(u){case Ip:{let m=l;switch(h){case"bigint":u=EA,m=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+h);m=null;break;case"undefined":return s([CA],l)}return s([u,m],l)}case Eu:{if(h){let _=l;return h==="DataView"?_=new Uint8Array(l.buffer):h==="ArrayBuffer"&&(_=new Uint8Array(l)),s([h,[..._]],l)}const m=[],g=s([u,m],l);for(const _ of l)m.push(a(_));return g}case Zf:{if(h)switch(h){case"BigInt":return s([h,l.toString()],l);case"Boolean":case"Number":case"String":return s([h,l.valueOf()],l)}if(t&&"toJSON"in l)return a(l.toJSON());const m=[],g=s([u,m],l);for(const _ of uq(l))(e||!Wh(Zc(l[_])))&&m.push([a(_),a(l[_])]);return g}case N0:return s([u,l.toISOString()],l);case A0:{const{source:m,flags:g}=l;return s([u,{source:m,flags:g}],l)}case D0:{const m=[],g=s([u,m],l);for(const[_,b]of l)(e||!(Wh(Zc(_))||Wh(Zc(b))))&&m.push([a(_),a(b)]);return g}case O0:{const m=[],g=s([u,m],l);for(const _ of l)(e||!Wh(Zc(_)))&&m.push(a(_));return g}}const{message:d}=l;return s([u,{name:h,message:d}],l)};return a},rk=(e,{json:t,lossy:n}={})=>{const r=[];return dq(!(t||n),!!t,new Map,r)(e),r},Qf=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?nk(rk(e,t)):structuredClone(e):(e,t)=>nk(rk(e,t));function hq(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function fq(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function pq(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||hq,r=e.options.footnoteBackLabel||fq,s=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},u=[];let h=-1;for(;++h<e.footnoteOrder.length;){const d=e.footnoteById.get(e.footnoteOrder[h]);if(!d)continue;const m=e.all(d),g=String(d.identifier).toUpperCase(),_=ql(g.toLowerCase());let b=0;const w=[],S=e.footnoteCounts.get(g);for(;S!==void 0&&++b<=S;){w.length>0&&w.push({type:"text",value:" "});let R=typeof n=="string"?n:n(h,b);typeof R=="string"&&(R={type:"text",value:R}),w.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+_+(b>1?"-"+b:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(h,b),className:["data-footnote-backref"]},children:Array.isArray(R)?R:[R]})}const C=m[m.length-1];if(C&&C.type==="element"&&C.tagName==="p"){const R=C.children[C.children.length-1];R&&R.type==="text"?R.value+=" ":C.children.push({type:"text",value:" "}),C.children.push(...w)}else m.push(...w);const k={type:"element",tagName:"li",properties:{id:t+"fn-"+_},children:e.wrap(m,!0)};e.patch(d,k),u.push(k)}if(u.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...Qf(l),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:`
|
|
534
|
-
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(u,!0)},{type:"text",value:`
|
|
535
|
-
`}]}}const Hp=(function(e){if(e==null)return _q;if(typeof e=="function")return Fp(e);if(typeof e=="object")return Array.isArray(e)?mq(e):gq(e);if(typeof e=="string")return vq(e);throw new Error("Expected function, string, or object as test")});function mq(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Hp(e[n]);return Fp(r);function r(...s){let a=-1;for(;++a<t.length;)if(t[a].apply(this,s))return!0;return!1}}function gq(e){const t=e;return Fp(n);function n(r){const s=r;let a;for(a in e)if(s[a]!==t[a])return!1;return!0}}function vq(e){return Fp(t);function t(n){return n&&n.type===e}}function Fp(e){return t;function t(n,r,s){return!!(yq(n)&&e.call(this,n,typeof r=="number"?r:void 0,s||void 0))}}function _q(){return!0}function yq(e){return e!==null&&typeof e=="object"&&"type"in e}const RA=[],bq=!0,ny=!1,xq="skip";function TA(e,t,n,r){let s;typeof t=="function"&&typeof n!="function"?(r=n,n=t):s=t;const a=Hp(s),l=r?-1:1;u(e,void 0,[])();function u(h,d,m){const g=h&&typeof h=="object"?h:{};if(typeof g.type=="string"){const b=typeof g.tagName=="string"?g.tagName:typeof g.name=="string"?g.name:void 0;Object.defineProperty(_,"name",{value:"node ("+(h.type+(b?"<"+b+">":""))+")"})}return _;function _(){let b=RA,w,S,C;if((!t||a(h,d,m[m.length-1]||void 0))&&(b=wq(n(h,m)),b[0]===ny))return b;if("children"in h&&h.children){const k=h;if(k.children&&b[0]!==xq)for(S=(r?k.children.length:-1)+l,C=m.concat(k);S>-1&&S<k.children.length;){const R=k.children[S];if(w=u(R,S,C)(),w[0]===ny)return w;S=typeof w[1]=="number"?w[1]:S+l}}return b}}}function wq(e){return Array.isArray(e)?e:typeof e=="number"?[bq,e]:e==null?RA:[e]}function j0(e,t,n,r){let s,a,l;typeof t=="function"&&typeof n!="function"?(a=void 0,l=t,s=n):(a=t,l=n,s=r),TA(e,a,u,s);function u(h,d){const m=d[d.length-1],g=m?m.children.indexOf(h):void 0;return l(h,g,m)}}const ry={}.hasOwnProperty,Sq={};function Cq(e,t){const n=t||Sq,r=new Map,s=new Map,a=new Map,l={...aq,...n.handlers},u={all:d,applyData:Eq,definitionById:r,footnoteById:s,footnoteCounts:a,footnoteOrder:[],handlers:l,one:h,options:n,patch:kq,wrap:Tq};return j0(e,function(m){if(m.type==="definition"||m.type==="footnoteDefinition"){const g=m.type==="definition"?r:s,_=String(m.identifier).toUpperCase();g.has(_)||g.set(_,m)}}),u;function h(m,g){const _=m.type,b=u.handlers[_];if(ry.call(u.handlers,_)&&b)return b(u,m,g);if(u.options.passThrough&&u.options.passThrough.includes(_)){if("children"in m){const{children:S,...C}=m,k=Qf(C);return k.children=u.all(m),k}return Qf(m)}return(u.options.unknownHandler||Rq)(u,m,g)}function d(m){const g=[];if("children"in m){const _=m.children;let b=-1;for(;++b<_.length;){const w=u.one(_[b],m);if(w){if(b&&_[b-1].type==="break"&&(!Array.isArray(w)&&w.type==="text"&&(w.value=ik(w.value)),!Array.isArray(w)&&w.type==="element")){const S=w.children[0];S&&S.type==="text"&&(S.value=ik(S.value))}Array.isArray(w)?g.push(...w):g.push(w)}}}return g}}function kq(e,t){e.position&&(t.position=f$(e))}function Eq(e,t){let n=t;if(e&&e.data){const r=e.data.hName,s=e.data.hChildren,a=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const l="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:l}}n.type==="element"&&a&&Object.assign(n.properties,Qf(a)),"children"in n&&n.children&&s!==null&&s!==void 0&&(n.children=s)}return n}function Rq(e,t){const n=t.data||{},r="value"in t&&!(ry.call(n,"hProperties")||ry.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Tq(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
536
|
-
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
537
|
-
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
538
|
-
`}),n}function ik(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function sk(e,t){const n=Cq(e,t),r=n.one(e,void 0),s=pq(n),a=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return s&&a.children.push({type:"text",value:`
|
|
539
|
-
`},s),a}function Mq(e,t){return e&&"run"in e?async function(n,r){const s=sk(n,{file:r,...t});await e.run(s,r)}:function(n,r){return sk(n,{file:r,...e||t})}}function ok(e){if(e)throw e}var Fv,ak;function Nq(){if(ak)return Fv;ak=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,s=function(d){return typeof Array.isArray=="function"?Array.isArray(d):t.call(d)==="[object Array]"},a=function(d){if(!d||t.call(d)!=="[object Object]")return!1;var m=e.call(d,"constructor"),g=d.constructor&&d.constructor.prototype&&e.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!m&&!g)return!1;var _;for(_ in d);return typeof _>"u"||e.call(d,_)},l=function(d,m){n&&m.name==="__proto__"?n(d,m.name,{enumerable:!0,configurable:!0,value:m.newValue,writable:!0}):d[m.name]=m.newValue},u=function(d,m){if(m==="__proto__")if(e.call(d,m)){if(r)return r(d,m).value}else return;return d[m]};return Fv=function h(){var d,m,g,_,b,w,S=arguments[0],C=1,k=arguments.length,R=!1;for(typeof S=="boolean"&&(R=S,S=arguments[1]||{},C=2),(S==null||typeof S!="object"&&typeof S!="function")&&(S={});C<k;++C)if(d=arguments[C],d!=null)for(m in d)g=u(S,m),_=u(d,m),S!==_&&(R&&_&&(a(_)||(b=s(_)))?(b?(b=!1,w=g&&s(g)?g:[]):w=g&&a(g)?g:{},l(S,{name:m,newValue:h(R,w,_)})):typeof _<"u"&&l(S,{name:m,newValue:_}));return S},Fv}var Aq=Nq();const Uv=dp(Aq);function iy(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Dq(){const e=[],t={run:n,use:r};return t;function n(...s){let a=-1;const l=s.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);u(null,...s);function u(h,...d){const m=e[++a];let g=-1;if(h){l(h);return}for(;++g<s.length;)(d[g]===null||d[g]===void 0)&&(d[g]=s[g]);s=d,m?Oq(m,u)(...d):l(null,...d)}}function r(s){if(typeof s!="function")throw new TypeError("Expected `middelware` to be a function, not "+s);return e.push(s),t}}function Oq(e,t){let n;return r;function r(...l){const u=e.length>l.length;let h;u&&l.push(s);try{h=e.apply(this,l)}catch(d){const m=d;if(u&&n)throw m;return s(m)}u||(h&&h.then&&typeof h.then=="function"?h.then(a,s):h instanceof Error?s(h):a(h))}function s(l,...u){n||(n=!0,t(l,...u))}function a(l){s(null,l)}}const Ci={basename:jq,dirname:Lq,extname:zq,join:Pq,sep:"/"};function jq(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');ud(e);let n=0,r=-1,s=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(a){n=s+1;break}}else r<0&&(a=!0,r=s+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let l=-1,u=t.length-1;for(;s--;)if(e.codePointAt(s)===47){if(a){n=s+1;break}}else l<0&&(a=!0,l=s+1),u>-1&&(e.codePointAt(s)===t.codePointAt(u--)?u<0&&(r=s):(u=-1,r=l));return n===r?r=l:r<0&&(r=e.length),e.slice(n,r)}function Lq(e){if(ud(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function zq(e){ud(e);let t=e.length,n=-1,r=0,s=-1,a=0,l;for(;t--;){const u=e.codePointAt(t);if(u===47){if(l){r=t+1;break}continue}n<0&&(l=!0,n=t+1),u===46?s<0?s=t:a!==1&&(a=1):s>-1&&(a=-1)}return s<0||n<0||a===0||a===1&&s===n-1&&s===r+1?"":e.slice(s,n)}function Pq(...e){let t=-1,n;for(;++t<e.length;)ud(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":Bq(n)}function Bq(e){ud(e);const t=e.codePointAt(0)===47;let n=Iq(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Iq(e,t){let n="",r=0,s=-1,a=0,l=-1,u,h;for(;++l<=e.length;){if(l<e.length)u=e.codePointAt(l);else{if(u===47)break;u=47}if(u===47){if(!(s===l-1||a===1))if(s!==l-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(h=n.lastIndexOf("/"),h!==n.length-1){h<0?(n="",r=0):(n=n.slice(0,h),r=n.length-1-n.lastIndexOf("/")),s=l,a=0;continue}}else if(n.length>0){n="",r=0,s=l,a=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(s+1,l):n=e.slice(s+1,l),r=l-s-1;s=l,a=0}else u===46&&a>-1?a++:a=-1}return n}function ud(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Hq={cwd:Fq};function Fq(){return"/"}function sy(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Uq(e){if(typeof e=="string")e=new URL(e);else if(!sy(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return $q(e)}function $q(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const s=new TypeError("File URL path must not include encoded / characters");throw s.code="ERR_INVALID_FILE_URL_PATH",s}}return decodeURIComponent(t)}const $v=["history","path","basename","stem","extname","dirname"];class MA{constructor(t){let n;t?sy(t)?n={path:t}:typeof t=="string"||Wq(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":Hq.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<$v.length;){const a=$v[r];a in n&&n[a]!==void 0&&n[a]!==null&&(this[a]=a==="history"?[...n[a]]:n[a])}let s;for(s in n)$v.includes(s)||(this[s]=n[s])}get basename(){return typeof this.path=="string"?Ci.basename(this.path):void 0}set basename(t){Vv(t,"basename"),Wv(t,"basename"),this.path=Ci.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Ci.dirname(this.path):void 0}set dirname(t){lk(this.basename,"dirname"),this.path=Ci.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Ci.extname(this.path):void 0}set extname(t){if(Wv(t,"extname"),lk(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Ci.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){sy(t)&&(t=Uq(t)),Vv(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Ci.basename(this.path,this.extname):void 0}set stem(t){Vv(t,"stem"),Wv(t,"stem"),this.path=Ci.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const s=this.message(t,n,r);throw s.fatal=!0,s}info(t,n,r){const s=this.message(t,n,r);return s.fatal=void 0,s}message(t,n,r){const s=new Gn(t,n,r);return this.path&&(s.name=this.path+":"+s.name,s.file=this.path),s.fatal=!1,this.messages.push(s),s}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Wv(e,t){if(e&&e.includes(Ci.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Ci.sep+"`")}function Vv(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function lk(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function Wq(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Vq=(function(e){const r=this.constructor.prototype,s=r[e],a=function(){return s.apply(a,arguments)};return Object.setPrototypeOf(a,r),a}),qq={}.hasOwnProperty;class L0 extends Vq{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Dq()}copy(){const t=new L0;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Uv(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Gv("data",this.frozen),this.namespace[t]=n,this):qq.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Gv("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const s=n.call(t,...r);typeof s=="function"&&this.transformers.use(s)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Vh(t),r=this.parser||this.Parser;return qv("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),qv("process",this.parser||this.Parser),Kv("process",this.compiler||this.Compiler),n?s(void 0,n):new Promise(s);function s(a,l){const u=Vh(t),h=r.parse(u);r.run(h,u,function(m,g,_){if(m||!g||!_)return d(m);const b=g,w=r.stringify(b,_);Yq(w)?_.value=w:_.result=w,d(m,_)});function d(m,g){m||!g?l(m):a?a(g):n(void 0,g)}}}processSync(t){let n=!1,r;return this.freeze(),qv("processSync",this.parser||this.Parser),Kv("processSync",this.compiler||this.Compiler),this.process(t,s),uk("processSync","process",n),r;function s(a,l){n=!0,ok(a),r=l}}run(t,n,r){ck(t),this.freeze();const s=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?a(void 0,r):new Promise(a);function a(l,u){const h=Vh(n);s.run(t,h,d);function d(m,g,_){const b=g||t;m?u(m):l?l(b):r(void 0,b,_)}}}runSync(t,n){let r=!1,s;return this.run(t,n,a),uk("runSync","run",r),s;function a(l,u){ok(l),s=u,r=!0}}stringify(t,n){this.freeze();const r=Vh(n),s=this.compiler||this.Compiler;return Kv("stringify",s),ck(t),s(t,r)}use(t,...n){const r=this.attachers,s=this.namespace;if(Gv("use",this.frozen),t!=null)if(typeof t=="function")h(t,n);else if(typeof t=="object")Array.isArray(t)?u(t):l(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function a(d){if(typeof d=="function")h(d,[]);else if(typeof d=="object")if(Array.isArray(d)){const[m,...g]=d;h(m,g)}else l(d);else throw new TypeError("Expected usable value, not `"+d+"`")}function l(d){if(!("plugins"in d)&&!("settings"in d))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");u(d.plugins),d.settings&&(s.settings=Uv(!0,s.settings,d.settings))}function u(d){let m=-1;if(d!=null)if(Array.isArray(d))for(;++m<d.length;){const g=d[m];a(g)}else throw new TypeError("Expected a list of plugins, not `"+d+"`")}function h(d,m){let g=-1,_=-1;for(;++g<r.length;)if(r[g][0]===d){_=g;break}if(_===-1)r.push([d,...m]);else if(m.length>0){let[b,...w]=m;const S=r[_][1];iy(S)&&iy(b)&&(b=Uv(!0,S,b)),r[_]=[d,b,...w]}}}}const Kq=new L0().freeze();function qv(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Kv(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Gv(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function ck(e){if(!iy(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function uk(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Vh(e){return Gq(e)?e:new MA(e)}function Gq(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Yq(e){return typeof e=="string"||Xq(e)}function Xq(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Zq="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",dk=[],hk={allowDangerousHtml:!0},Qq=/^(https?|ircs?|mailto|xmpp)$/i,Jq=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function Kl(e){const t=eK(e),n=tK(e);return nK(t.runSync(t.parse(n),n),e)}function eK(e){const t=e.rehypePlugins||dk,n=e.remarkPlugins||dk,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...hk}:hk;return Kq().use(LV).use(n).use(Mq,r).use(t)}function tK(e){const t=e.children||"",n=new MA;return typeof t=="string"&&(n.value=t),n}function nK(e,t){const n=t.allowedElements,r=t.allowElement,s=t.components,a=t.disallowedElements,l=t.skipHtml,u=t.unwrapDisallowed,h=t.urlTransform||rK;for(const m of Jq)Object.hasOwn(t,m.from)&&(""+m.from+(m.to?"use `"+m.to+"` instead":"remove it")+Zq+m.id,void 0);return j0(e,d),_$(e,{Fragment:p.Fragment,components:s,ignoreInvalidStyle:!0,jsx:p.jsx,jsxs:p.jsxs,passKeys:!0,passNode:!0});function d(m,g,_){if(m.type==="raw"&&_&&typeof g=="number")return l?_.children.splice(g,1):_.children[g]={type:"text",value:m.value},g;if(m.type==="element"){let b;for(b in Bv)if(Object.hasOwn(Bv,b)&&Object.hasOwn(m.properties,b)){const w=m.properties[b],S=Bv[b];(S===null||S.includes(m.tagName))&&(m.properties[b]=h(String(w||""),b,m))}}if(m.type==="element"){let b=n?!n.includes(m.tagName):a?a.includes(m.tagName):!1;if(!b&&r&&typeof g=="number"&&(b=!r(m,g,_)),b&&_&&typeof g=="number")return u&&m.children?_.children.splice(g,1,...m.children):_.children.splice(g,1),g}}}function rK(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),s=e.indexOf("/");return t===-1||s!==-1&&t>s||n!==-1&&t>n||r!==-1&&t>r||Qq.test(e.slice(0,t))?e:""}function fk(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,s=n.indexOf(t);for(;s!==-1;)r++,s=n.indexOf(t,s+t.length);return r}function iK(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function sK(e,t,n){const s=Hp((n||{}).ignore||[]),a=oK(t);let l=-1;for(;++l<a.length;)TA(e,"text",u);function u(d,m){let g=-1,_;for(;++g<m.length;){const b=m[g],w=_?_.children:void 0;if(s(b,w?w.indexOf(b):void 0,_))return;_=b}if(_)return h(d,m)}function h(d,m){const g=m[m.length-1],_=a[l][0],b=a[l][1];let w=0;const C=g.children.indexOf(d);let k=!1,R=[];_.lastIndex=0;let T=_.exec(d.value);for(;T;){const N=T.index,L={index:T.index,input:T.input,stack:[...m,d]};let A=b(...T,L);if(typeof A=="string"&&(A=A.length>0?{type:"text",value:A}:void 0),A===!1?_.lastIndex=N+1:(w!==N&&R.push({type:"text",value:d.value.slice(w,N)}),Array.isArray(A)?R.push(...A):A&&R.push(A),w=N+T[0].length,k=!0),!_.global)break;T=_.exec(d.value)}return k?(w<d.value.length&&R.push({type:"text",value:d.value.slice(w)}),g.children.splice(C,1,...R)):R=[d],C+R.length}}function oK(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const s=n[r];t.push([aK(s[0]),lK(s[1])])}return t}function aK(e){return typeof e=="string"?new RegExp(iK(e),"g"):e}function lK(e){return typeof e=="function"?e:function(){return e}}const Yv="phrasing",Xv=["autolink","link","image","label"];function cK(){return{transforms:[gK],enter:{literalAutolink:dK,literalAutolinkEmail:Zv,literalAutolinkHttp:Zv,literalAutolinkWww:Zv},exit:{literalAutolink:mK,literalAutolinkEmail:pK,literalAutolinkHttp:hK,literalAutolinkWww:fK}}}function uK(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Yv,notInConstruct:Xv},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Yv,notInConstruct:Xv},{character:":",before:"[ps]",after:"\\/",inConstruct:Yv,notInConstruct:Xv}]}}function dK(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Zv(e){this.config.enter.autolinkProtocol.call(this,e)}function hK(e){this.config.exit.autolinkProtocol.call(this,e)}function fK(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function pK(e){this.config.exit.autolinkEmail.call(this,e)}function mK(e){this.exit(e)}function gK(e){sK(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,vK],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),_K]],{ignore:["link","linkReference"]})}function vK(e,t,n,r,s){let a="";if(!NA(s)||(/^w/i.test(t)&&(n=t+n,t="",a="http://"),!yK(n)))return!1;const l=bK(n+r);if(!l[0])return!1;const u={type:"link",title:null,url:a+t+l[0],children:[{type:"text",value:t+l[0]}]};return l[1]?[u,{type:"text",value:l[1]}]:u}function _K(e,t,n,r){return!NA(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function yK(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function bK(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const s=fk(e,"(");let a=fk(e,")");for(;r!==-1&&s>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),a++;return[e,n]}function NA(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||ea(n)||Pp(n))&&(!t||n!==47)}AA.peek=MK;function xK(){this.buffer()}function wK(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function SK(){this.buffer()}function CK(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function kK(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ci(this.sliceSerialize(e)).toLowerCase(),n.label=t}function EK(e){this.exit(e)}function RK(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ci(this.sliceSerialize(e)).toLowerCase(),n.label=t}function TK(e){this.exit(e)}function MK(){return"["}function AA(e,t,n,r){const s=n.createTracker(r);let a=s.move("[^");const l=n.enter("footnoteReference"),u=n.enter("reference");return a+=s.move(n.safe(n.associationId(e),{after:"]",before:a})),u(),l(),a+=s.move("]"),a}function NK(){return{enter:{gfmFootnoteCallString:xK,gfmFootnoteCall:wK,gfmFootnoteDefinitionLabelString:SK,gfmFootnoteDefinition:CK},exit:{gfmFootnoteCallString:kK,gfmFootnoteCall:EK,gfmFootnoteDefinitionLabelString:RK,gfmFootnoteDefinition:TK}}}function AK(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:AA},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,s,a,l){const u=a.createTracker(l);let h=u.move("[^");const d=a.enter("footnoteDefinition"),m=a.enter("label");return h+=u.move(a.safe(a.associationId(r),{before:h,after:"]"})),m(),h+=u.move("]:"),r.children&&r.children.length>0&&(u.shift(4),h+=u.move((t?`
|
|
540
|
-
`:" ")+a.indentLines(a.containerFlow(r,u.current()),t?DA:DK))),d(),h}}function DK(e,t,n){return t===0?e:DA(e,t,n)}function DA(e,t,n){return(n?"":" ")+e}const OK=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];OA.peek=BK;function jK(){return{canContainEols:["delete"],enter:{strikethrough:zK},exit:{strikethrough:PK}}}function LK(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:OK}],handlers:{delete:OA}}}function zK(e){this.enter({type:"delete",children:[]},e)}function PK(e){this.exit(e)}function OA(e,t,n,r){const s=n.createTracker(r),a=n.enter("strikethrough");let l=s.move("~~");return l+=n.containerPhrasing(e,{...s.current(),before:l,after:"~"}),l+=s.move("~~"),a(),l}function BK(){return"~"}function IK(e){return e.length}function HK(e,t){const n=t||{},r=(n.align||[]).concat(),s=n.stringLength||IK,a=[],l=[],u=[],h=[];let d=0,m=-1;for(;++m<e.length;){const S=[],C=[];let k=-1;for(e[m].length>d&&(d=e[m].length);++k<e[m].length;){const R=FK(e[m][k]);if(n.alignDelimiters!==!1){const T=s(R);C[k]=T,(h[k]===void 0||T>h[k])&&(h[k]=T)}S.push(R)}l[m]=S,u[m]=C}let g=-1;if(typeof r=="object"&&"length"in r)for(;++g<d;)a[g]=pk(r[g]);else{const S=pk(r);for(;++g<d;)a[g]=S}g=-1;const _=[],b=[];for(;++g<d;){const S=a[g];let C="",k="";S===99?(C=":",k=":"):S===108?C=":":S===114&&(k=":");let R=n.alignDelimiters===!1?1:Math.max(1,h[g]-C.length-k.length);const T=C+"-".repeat(R)+k;n.alignDelimiters!==!1&&(R=C.length+R+k.length,R>h[g]&&(h[g]=R),b[g]=R),_[g]=T}l.splice(1,0,_),u.splice(1,0,b),m=-1;const w=[];for(;++m<l.length;){const S=l[m],C=u[m];g=-1;const k=[];for(;++g<d;){const R=S[g]||"";let T="",N="";if(n.alignDelimiters!==!1){const L=h[g]-(C[g]||0),A=a[g];A===114?T=" ".repeat(L):A===99?L%2?(T=" ".repeat(L/2+.5),N=" ".repeat(L/2-.5)):(T=" ".repeat(L/2),N=T):N=" ".repeat(L)}n.delimiterStart!==!1&&!g&&k.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&R==="")&&(n.delimiterStart!==!1||g)&&k.push(" "),n.alignDelimiters!==!1&&k.push(T),k.push(R),n.alignDelimiters!==!1&&k.push(N),n.padding!==!1&&k.push(" "),(n.delimiterEnd!==!1||g!==d-1)&&k.push("|")}w.push(n.delimiterEnd===!1?k.join("").replace(/ +$/,""):k.join(""))}return w.join(`
|
|
541
|
-
`)}function FK(e){return e==null?"":String(e)}function pk(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function UK(e,t,n,r){const s=n.enter("blockquote"),a=n.createTracker(r);a.move("> "),a.shift(2);const l=n.indentLines(n.containerFlow(e,a.current()),$K);return s(),l}function $K(e,t,n){return">"+(n?"":" ")+e}function WK(e,t){return mk(e,t.inConstruct,!0)&&!mk(e,t.notInConstruct,!1)}function mk(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function gk(e,t,n,r){let s=-1;for(;++s<n.unsafe.length;)if(n.unsafe[s].character===`
|
|
542
|
-
`&&WK(n.stack,n.unsafe[s]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
543
|
-
`}function VK(e,t){const n=String(e);let r=n.indexOf(t),s=r,a=0,l=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===s?++a>l&&(l=a):a=1,s=r+t.length,r=n.indexOf(t,s);return l}function qK(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function KK(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function GK(e,t,n,r){const s=KK(n),a=e.value||"",l=s==="`"?"GraveAccent":"Tilde";if(qK(e,n)){const g=n.enter("codeIndented"),_=n.indentLines(a,YK);return g(),_}const u=n.createTracker(r),h=s.repeat(Math.max(VK(a,s)+1,3)),d=n.enter("codeFenced");let m=u.move(h);if(e.lang){const g=n.enter(`codeFencedLang${l}`);m+=u.move(n.safe(e.lang,{before:m,after:" ",encode:["`"],...u.current()})),g()}if(e.lang&&e.meta){const g=n.enter(`codeFencedMeta${l}`);m+=u.move(" "),m+=u.move(n.safe(e.meta,{before:m,after:`
|
|
544
|
-
`,encode:["`"],...u.current()})),g()}return m+=u.move(`
|
|
545
|
-
`),a&&(m+=u.move(a+`
|
|
546
|
-
`)),m+=u.move(h),d(),m}function YK(e,t,n){return(n?"":" ")+e}function z0(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function XK(e,t,n,r){const s=z0(n),a=s==='"'?"Quote":"Apostrophe",l=n.enter("definition");let u=n.enter("label");const h=n.createTracker(r);let d=h.move("[");return d+=h.move(n.safe(n.associationId(e),{before:d,after:"]",...h.current()})),d+=h.move("]: "),u(),!e.url||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),d+=h.move("<"),d+=h.move(n.safe(e.url,{before:d,after:">",...h.current()})),d+=h.move(">")):(u=n.enter("destinationRaw"),d+=h.move(n.safe(e.url,{before:d,after:e.title?" ":`
|
|
547
|
-
`,...h.current()}))),u(),e.title&&(u=n.enter(`title${a}`),d+=h.move(" "+s),d+=h.move(n.safe(e.title,{before:d,after:s,...h.current()})),d+=h.move(s),u()),l(),d}function ZK(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Uu(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Jf(e,t,n){const r=Al(e),s=Al(t);return r===void 0?s===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}jA.peek=QK;function jA(e,t,n,r){const s=ZK(n),a=n.enter("emphasis"),l=n.createTracker(r),u=l.move(s);let h=l.move(n.containerPhrasing(e,{after:s,before:u,...l.current()}));const d=h.charCodeAt(0),m=Jf(r.before.charCodeAt(r.before.length-1),d,s);m.inside&&(h=Uu(d)+h.slice(1));const g=h.charCodeAt(h.length-1),_=Jf(r.after.charCodeAt(0),g,s);_.inside&&(h=h.slice(0,-1)+Uu(g));const b=l.move(s);return a(),n.attentionEncodeSurroundingInfo={after:_.outside,before:m.outside},u+h+b}function QK(e,t,n){return n.options.emphasis||"*"}function JK(e,t){let n=!1;return j0(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,ny}),!!((!e.depth||e.depth<3)&&R0(e)&&(t.options.setext||n))}function eG(e,t,n,r){const s=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(JK(e,n)){const m=n.enter("headingSetext"),g=n.enter("phrasing"),_=n.containerPhrasing(e,{...a.current(),before:`
|
|
548
|
-
`,after:`
|
|
549
|
-
`});return g(),m(),_+`
|
|
550
|
-
`+(s===1?"=":"-").repeat(_.length-(Math.max(_.lastIndexOf("\r"),_.lastIndexOf(`
|
|
551
|
-
`))+1))}const l="#".repeat(s),u=n.enter("headingAtx"),h=n.enter("phrasing");a.move(l+" ");let d=n.containerPhrasing(e,{before:"# ",after:`
|
|
552
|
-
`,...a.current()});return/^[\t ]/.test(d)&&(d=Uu(d.charCodeAt(0))+d.slice(1)),d=d?l+" "+d:l,n.options.closeAtx&&(d+=" "+l),h(),u(),d}LA.peek=tG;function LA(e){return e.value||""}function tG(){return"<"}zA.peek=nG;function zA(e,t,n,r){const s=z0(n),a=s==='"'?"Quote":"Apostrophe",l=n.enter("image");let u=n.enter("label");const h=n.createTracker(r);let d=h.move("![");return d+=h.move(n.safe(e.alt,{before:d,after:"]",...h.current()})),d+=h.move("]("),u(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),d+=h.move("<"),d+=h.move(n.safe(e.url,{before:d,after:">",...h.current()})),d+=h.move(">")):(u=n.enter("destinationRaw"),d+=h.move(n.safe(e.url,{before:d,after:e.title?" ":")",...h.current()}))),u(),e.title&&(u=n.enter(`title${a}`),d+=h.move(" "+s),d+=h.move(n.safe(e.title,{before:d,after:s,...h.current()})),d+=h.move(s),u()),d+=h.move(")"),l(),d}function nG(){return"!"}PA.peek=rG;function PA(e,t,n,r){const s=e.referenceType,a=n.enter("imageReference");let l=n.enter("label");const u=n.createTracker(r);let h=u.move("![");const d=n.safe(e.alt,{before:h,after:"]",...u.current()});h+=u.move(d+"]["),l();const m=n.stack;n.stack=[],l=n.enter("reference");const g=n.safe(n.associationId(e),{before:h,after:"]",...u.current()});return l(),n.stack=m,a(),s==="full"||!d||d!==g?h+=u.move(g+"]"):s==="shortcut"?h=h.slice(0,-1):h+=u.move("]"),h}function rG(){return"!"}BA.peek=iG;function BA(e,t,n){let r=e.value||"",s="`",a=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(r);)s+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++a<n.unsafe.length;){const l=n.unsafe[a],u=n.compilePattern(l);let h;if(l.atBreak)for(;h=u.exec(r);){let d=h.index;r.charCodeAt(d)===10&&r.charCodeAt(d-1)===13&&d--,r=r.slice(0,d)+" "+r.slice(h.index+1)}}return s+r+s}function iG(){return"`"}function IA(e,t){const n=R0(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}HA.peek=sG;function HA(e,t,n,r){const s=z0(n),a=s==='"'?"Quote":"Apostrophe",l=n.createTracker(r);let u,h;if(IA(e,n)){const m=n.stack;n.stack=[],u=n.enter("autolink");let g=l.move("<");return g+=l.move(n.containerPhrasing(e,{before:g,after:">",...l.current()})),g+=l.move(">"),u(),n.stack=m,g}u=n.enter("link"),h=n.enter("label");let d=l.move("[");return d+=l.move(n.containerPhrasing(e,{before:d,after:"](",...l.current()})),d+=l.move("]("),h(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(h=n.enter("destinationLiteral"),d+=l.move("<"),d+=l.move(n.safe(e.url,{before:d,after:">",...l.current()})),d+=l.move(">")):(h=n.enter("destinationRaw"),d+=l.move(n.safe(e.url,{before:d,after:e.title?" ":")",...l.current()}))),h(),e.title&&(h=n.enter(`title${a}`),d+=l.move(" "+s),d+=l.move(n.safe(e.title,{before:d,after:s,...l.current()})),d+=l.move(s),h()),d+=l.move(")"),u(),d}function sG(e,t,n){return IA(e,n)?"<":"["}FA.peek=oG;function FA(e,t,n,r){const s=e.referenceType,a=n.enter("linkReference");let l=n.enter("label");const u=n.createTracker(r);let h=u.move("[");const d=n.containerPhrasing(e,{before:h,after:"]",...u.current()});h+=u.move(d+"]["),l();const m=n.stack;n.stack=[],l=n.enter("reference");const g=n.safe(n.associationId(e),{before:h,after:"]",...u.current()});return l(),n.stack=m,a(),s==="full"||!d||d!==g?h+=u.move(g+"]"):s==="shortcut"?h=h.slice(0,-1):h+=u.move("]"),h}function oG(){return"["}function P0(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function aG(e){const t=P0(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function lG(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function UA(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function cG(e,t,n,r){const s=n.enter("list"),a=n.bulletCurrent;let l=e.ordered?lG(n):P0(n);const u=e.ordered?l==="."?")":".":aG(n);let h=t&&n.bulletLastUsed?l===n.bulletLastUsed:!1;if(!e.ordered){const m=e.children?e.children[0]:void 0;if((l==="*"||l==="-")&&m&&(!m.children||!m.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(h=!0),UA(n)===l&&m){let g=-1;for(;++g<e.children.length;){const _=e.children[g];if(_&&_.type==="listItem"&&_.children&&_.children[0]&&_.children[0].type==="thematicBreak"){h=!0;break}}}}h&&(l=u),n.bulletCurrent=l;const d=n.containerFlow(e,r);return n.bulletLastUsed=l,n.bulletCurrent=a,s(),d}function uG(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function dG(e,t,n,r){const s=uG(n);let a=n.bulletCurrent||P0(n);t&&t.type==="list"&&t.ordered&&(a=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let l=a.length+1;(s==="tab"||s==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(l=Math.ceil(l/4)*4);const u=n.createTracker(r);u.move(a+" ".repeat(l-a.length)),u.shift(l);const h=n.enter("listItem"),d=n.indentLines(n.containerFlow(e,u.current()),m);return h(),d;function m(g,_,b){return _?(b?"":" ".repeat(l))+g:(b?a:a+" ".repeat(l-a.length))+g}}function hG(e,t,n,r){const s=n.enter("paragraph"),a=n.enter("phrasing"),l=n.containerPhrasing(e,r);return a(),s(),l}const fG=Hp(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function pG(e,t,n,r){return(e.children.some(function(l){return fG(l)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function mG(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}$A.peek=gG;function $A(e,t,n,r){const s=mG(n),a=n.enter("strong"),l=n.createTracker(r),u=l.move(s+s);let h=l.move(n.containerPhrasing(e,{after:s,before:u,...l.current()}));const d=h.charCodeAt(0),m=Jf(r.before.charCodeAt(r.before.length-1),d,s);m.inside&&(h=Uu(d)+h.slice(1));const g=h.charCodeAt(h.length-1),_=Jf(r.after.charCodeAt(0),g,s);_.inside&&(h=h.slice(0,-1)+Uu(g));const b=l.move(s+s);return a(),n.attentionEncodeSurroundingInfo={after:_.outside,before:m.outside},u+h+b}function gG(e,t,n){return n.options.strong||"*"}function vG(e,t,n,r){return n.safe(e.value,r)}function _G(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function yG(e,t,n){const r=(UA(n)+(n.options.ruleSpaces?" ":"")).repeat(_G(n));return n.options.ruleSpaces?r.slice(0,-1):r}const WA={blockquote:UK,break:gk,code:GK,definition:XK,emphasis:jA,hardBreak:gk,heading:eG,html:LA,image:zA,imageReference:PA,inlineCode:BA,link:HA,linkReference:FA,list:cG,listItem:dG,paragraph:hG,root:pG,strong:$A,text:vG,thematicBreak:yG};function bG(){return{enter:{table:xG,tableData:vk,tableHeader:vk,tableRow:SG},exit:{codeText:CG,table:wG,tableData:Qv,tableHeader:Qv,tableRow:Qv}}}function xG(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function wG(e){this.exit(e),this.data.inTable=void 0}function SG(e){this.enter({type:"tableRow",children:[]},e)}function Qv(e){this.exit(e)}function vk(e){this.enter({type:"tableCell",children:[]},e)}function CG(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,kG));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function kG(e,t){return t==="|"?t:e}function EG(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,s=t.stringLength,a=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
553
|
-
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:_,table:l,tableCell:h,tableRow:u}};function l(b,w,S,C){return d(m(b,S,C),b.align)}function u(b,w,S,C){const k=g(b,S,C),R=d([k]);return R.slice(0,R.indexOf(`
|
|
554
|
-
`))}function h(b,w,S,C){const k=S.enter("tableCell"),R=S.enter("phrasing"),T=S.containerPhrasing(b,{...C,before:a,after:a});return R(),k(),T}function d(b,w){return HK(b,{align:w,alignDelimiters:r,padding:n,stringLength:s})}function m(b,w,S){const C=b.children;let k=-1;const R=[],T=w.enter("table");for(;++k<C.length;)R[k]=g(C[k],w,S);return T(),R}function g(b,w,S){const C=b.children;let k=-1;const R=[],T=w.enter("tableRow");for(;++k<C.length;)R[k]=h(C[k],b,w,S);return T(),R}function _(b,w,S){let C=WA.inlineCode(b,w,S);return S.stack.includes("tableCell")&&(C=C.replace(/\|/g,"\\$&")),C}}function RG(){return{exit:{taskListCheckValueChecked:_k,taskListCheckValueUnchecked:_k,paragraph:MG}}}function TG(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:NG}}}function _k(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function MG(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const s=t.children;let a=-1,l;for(;++a<s.length;){const u=s[a];if(u.type==="paragraph"){l=u;break}}l===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function NG(e,t,n,r){const s=e.children[0],a=typeof e.checked=="boolean"&&s&&s.type==="paragraph",l="["+(e.checked?"x":" ")+"] ",u=n.createTracker(r);a&&u.move(l);let h=WA.listItem(e,t,n,{...r,...u.current()});return a&&(h=h.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,d)),h;function d(m){return m+l}}function AG(){return[cK(),NK(),jK(),bG(),RG()]}function DG(e){return{extensions:[uK(),AK(e),LK(),EG(e),TG()]}}const OG={tokenize:IG,partial:!0},VA={tokenize:HG,partial:!0},qA={tokenize:FG,partial:!0},KA={tokenize:UG,partial:!0},jG={tokenize:$G,partial:!0},GA={name:"wwwAutolink",tokenize:PG,previous:XA},YA={name:"protocolAutolink",tokenize:BG,previous:ZA},ys={name:"emailAutolink",tokenize:zG,previous:QA},Bi={};function LG(){return{text:Bi}}let Io=48;for(;Io<123;)Bi[Io]=ys,Io++,Io===58?Io=65:Io===91&&(Io=97);Bi[43]=ys;Bi[45]=ys;Bi[46]=ys;Bi[95]=ys;Bi[72]=[ys,YA];Bi[104]=[ys,YA];Bi[87]=[ys,GA];Bi[119]=[ys,GA];function zG(e,t,n){const r=this;let s,a;return l;function l(g){return!oy(g)||!QA.call(r,r.previous)||B0(r.events)?n(g):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),u(g))}function u(g){return oy(g)?(e.consume(g),u):g===64?(e.consume(g),h):n(g)}function h(g){return g===46?e.check(jG,m,d)(g):g===45||g===95||qn(g)?(a=!0,e.consume(g),h):m(g)}function d(g){return e.consume(g),s=!0,h}function m(g){return a&&s&&nr(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(g)):n(g)}}function PG(e,t,n){const r=this;return s;function s(l){return l!==87&&l!==119||!XA.call(r,r.previous)||B0(r.events)?n(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(OG,e.attempt(VA,e.attempt(qA,a),n),n)(l))}function a(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(l)}}function BG(e,t,n){const r=this;let s="",a=!1;return l;function l(g){return(g===72||g===104)&&ZA.call(r,r.previous)&&!B0(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),s+=String.fromCodePoint(g),e.consume(g),u):n(g)}function u(g){if(nr(g)&&s.length<5)return s+=String.fromCodePoint(g),e.consume(g),u;if(g===58){const _=s.toLowerCase();if(_==="http"||_==="https")return e.consume(g),h}return n(g)}function h(g){return g===47?(e.consume(g),a?d:(a=!0,h)):n(g)}function d(g){return g===null||Xf(g)||jt(g)||ea(g)||Pp(g)?n(g):e.attempt(VA,e.attempt(qA,m),n)(g)}function m(g){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(g)}}function IG(e,t,n){let r=0;return s;function s(l){return(l===87||l===119)&&r<3?(r++,e.consume(l),s):l===46&&r===3?(e.consume(l),a):n(l)}function a(l){return l===null?n(l):t(l)}}function HG(e,t,n){let r,s,a;return l;function l(d){return d===46||d===95?e.check(KA,h,u)(d):d===null||jt(d)||ea(d)||d!==45&&Pp(d)?h(d):(a=!0,e.consume(d),l)}function u(d){return d===95?r=!0:(s=r,r=void 0),e.consume(d),l}function h(d){return s||r||!a?n(d):t(d)}}function FG(e,t){let n=0,r=0;return s;function s(l){return l===40?(n++,e.consume(l),s):l===41&&r<n?a(l):l===33||l===34||l===38||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===60||l===63||l===93||l===95||l===126?e.check(KA,t,a)(l):l===null||jt(l)||ea(l)?t(l):(e.consume(l),s)}function a(l){return l===41&&r++,e.consume(l),s}}function UG(e,t,n){return r;function r(u){return u===33||u===34||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===63||u===95||u===126?(e.consume(u),r):u===38?(e.consume(u),a):u===93?(e.consume(u),s):u===60||u===null||jt(u)||ea(u)?t(u):n(u)}function s(u){return u===null||u===40||u===91||jt(u)||ea(u)?t(u):r(u)}function a(u){return nr(u)?l(u):n(u)}function l(u){return u===59?(e.consume(u),r):nr(u)?(e.consume(u),l):n(u)}}function $G(e,t,n){return r;function r(a){return e.consume(a),s}function s(a){return qn(a)?n(a):t(a)}}function XA(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||jt(e)}function ZA(e){return!nr(e)}function QA(e){return!(e===47||oy(e))}function oy(e){return e===43||e===45||e===46||e===95||qn(e)}function B0(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const WG={tokenize:QG,partial:!0};function VG(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:YG,continuation:{tokenize:XG},exit:ZG}},text:{91:{name:"gfmFootnoteCall",tokenize:GG},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:qG,resolveTo:KG}}}}function qG(e,t,n){const r=this;let s=r.events.length;const a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l;for(;s--;){const h=r.events[s][1];if(h.type==="labelImage"){l=h;break}if(h.type==="gfmFootnoteCall"||h.type==="labelLink"||h.type==="label"||h.type==="image"||h.type==="link")break}return u;function u(h){if(!l||!l._balanced)return n(h);const d=ci(r.sliceSerialize({start:l.end,end:r.now()}));return d.codePointAt(0)!==94||!a.includes(d.slice(1))?n(h):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),t(h))}}function KG(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const a={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},u=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",s,t],["exit",s,t],["enter",a,t],["enter",l,t],["exit",l,t],["exit",a,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...u),e}function GG(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a=0,l;return u;function u(g){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),h}function h(g){return g!==94?n(g):(e.enter("gfmFootnoteCallMarker"),e.consume(g),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",d)}function d(g){if(a>999||g===93&&!l||g===null||g===91||jt(g))return n(g);if(g===93){e.exit("chunkString");const _=e.exit("gfmFootnoteCallString");return s.includes(ci(r.sliceSerialize(_)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(g)}return jt(g)||(l=!0),a++,e.consume(g),g===92?m:d}function m(g){return g===91||g===92||g===93?(e.consume(g),a++,d):d(g)}}function YG(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a,l=0,u;return h;function h(w){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),d}function d(w){return w===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",m):n(w)}function m(w){if(l>999||w===93&&!u||w===null||w===91||jt(w))return n(w);if(w===93){e.exit("chunkString");const S=e.exit("gfmFootnoteDefinitionLabelString");return a=ci(r.sliceSerialize(S)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),_}return jt(w)||(u=!0),l++,e.consume(w),w===92?g:m}function g(w){return w===91||w===92||w===93?(e.consume(w),l++,m):m(w)}function _(w){return w===58?(e.enter("definitionMarker"),e.consume(w),e.exit("definitionMarker"),s.includes(a)||s.push(a),ut(e,b,"gfmFootnoteDefinitionWhitespace")):n(w)}function b(w){return t(w)}}function XG(e,t,n){return e.check(cd,t,e.attempt(WG,t,n))}function ZG(e){e.exit("gfmFootnoteDefinition")}function QG(e,t,n){const r=this;return ut(e,s,"gfmFootnoteDefinitionIndent",5);function s(a){const l=r.events[r.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?t(a):n(a)}}function JG(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:a,resolveAll:s};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function s(l,u){let h=-1;for(;++h<l.length;)if(l[h][0]==="enter"&&l[h][1].type==="strikethroughSequenceTemporary"&&l[h][1]._close){let d=h;for(;d--;)if(l[d][0]==="exit"&&l[d][1].type==="strikethroughSequenceTemporary"&&l[d][1]._open&&l[h][1].end.offset-l[h][1].start.offset===l[d][1].end.offset-l[d][1].start.offset){l[h][1].type="strikethroughSequence",l[d][1].type="strikethroughSequence";const m={type:"strikethrough",start:Object.assign({},l[d][1].start),end:Object.assign({},l[h][1].end)},g={type:"strikethroughText",start:Object.assign({},l[d][1].end),end:Object.assign({},l[h][1].start)},_=[["enter",m,u],["enter",l[d][1],u],["exit",l[d][1],u],["enter",g,u]],b=u.parser.constructs.insideSpan.null;b&&Nr(_,_.length,0,Bp(b,l.slice(d+1,h),u)),Nr(_,_.length,0,[["exit",g,u],["enter",l[h][1],u],["exit",l[h][1],u],["exit",m,u]]),Nr(l,d-1,h-d+3,_),h=d+_.length-2;break}}for(h=-1;++h<l.length;)l[h][1].type==="strikethroughSequenceTemporary"&&(l[h][1].type="data");return l}function a(l,u,h){const d=this.previous,m=this.events;let g=0;return _;function _(w){return d===126&&m[m.length-1][1].type!=="characterEscape"?h(w):(l.enter("strikethroughSequenceTemporary"),b(w))}function b(w){const S=Al(d);if(w===126)return g>1?h(w):(l.consume(w),g++,b);if(g<2&&!n)return h(w);const C=l.exit("strikethroughSequenceTemporary"),k=Al(w);return C._open=!k||k===2&&!!S,C._close=!S||S===2&&!!k,u(w)}}}class eY{constructor(){this.map=[]}add(t,n,r){tY(this,t,n,r)}consume(t){if(this.map.sort(function(a,l){return a[0]-l[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let s=r.pop();for(;s;){for(const a of s)t.push(a);s=r.pop()}this.map.length=0}}function tY(e,t,n,r){let s=0;if(!(n===0&&r.length===0)){for(;s<e.map.length;){if(e.map[s][0]===t){e.map[s][1]+=n,e.map[s][2].push(...r);return}s+=1}e.map.push([t,n,r])}}function nY(e,t){let n=!1;const r=[];for(;t<e.length;){const s=e[t];if(n){if(s[0]==="enter")s[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(s[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const a=r.length-1;r[a]=r[a]==="left"?"center":"right"}}else if(s[1].type==="tableDelimiterRow")break}else s[0]==="enter"&&s[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function rY(){return{flow:{null:{name:"table",tokenize:iY,resolveAll:sY}}}}function iY(e,t,n){const r=this;let s=0,a=0,l;return u;function u(B){let H=r.events.length-1;for(;H>-1;){const V=r.events[H][1].type;if(V==="lineEnding"||V==="linePrefix")H--;else break}const P=H>-1?r.events[H][1].type:null,U=P==="tableHead"||P==="tableRow"?A:h;return U===A&&r.parser.lazy[r.now().line]?n(B):U(B)}function h(B){return e.enter("tableHead"),e.enter("tableRow"),d(B)}function d(B){return B===124||(l=!0,a+=1),m(B)}function m(B){return B===null?n(B):Be(B)?a>1?(a=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(B),e.exit("lineEnding"),b):n(B):it(B)?ut(e,m,"whitespace")(B):(a+=1,l&&(l=!1,s+=1),B===124?(e.enter("tableCellDivider"),e.consume(B),e.exit("tableCellDivider"),l=!0,m):(e.enter("data"),g(B)))}function g(B){return B===null||B===124||jt(B)?(e.exit("data"),m(B)):(e.consume(B),B===92?_:g)}function _(B){return B===92||B===124?(e.consume(B),g):g(B)}function b(B){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(B):(e.enter("tableDelimiterRow"),l=!1,it(B)?ut(e,w,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):w(B))}function w(B){return B===45||B===58?C(B):B===124?(l=!0,e.enter("tableCellDivider"),e.consume(B),e.exit("tableCellDivider"),S):L(B)}function S(B){return it(B)?ut(e,C,"whitespace")(B):C(B)}function C(B){return B===58?(a+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(B),e.exit("tableDelimiterMarker"),k):B===45?(a+=1,k(B)):B===null||Be(B)?N(B):L(B)}function k(B){return B===45?(e.enter("tableDelimiterFiller"),R(B)):L(B)}function R(B){return B===45?(e.consume(B),R):B===58?(l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(B),e.exit("tableDelimiterMarker"),T):(e.exit("tableDelimiterFiller"),T(B))}function T(B){return it(B)?ut(e,N,"whitespace")(B):N(B)}function N(B){return B===124?w(B):B===null||Be(B)?!l||s!==a?L(B):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(B)):L(B)}function L(B){return n(B)}function A(B){return e.enter("tableRow"),O(B)}function O(B){return B===124?(e.enter("tableCellDivider"),e.consume(B),e.exit("tableCellDivider"),O):B===null||Be(B)?(e.exit("tableRow"),t(B)):it(B)?ut(e,O,"whitespace")(B):(e.enter("data"),F(B))}function F(B){return B===null||B===124||jt(B)?(e.exit("data"),O(B)):(e.consume(B),B===92?G:F)}function G(B){return B===92||B===124?(e.consume(B),F):F(B)}}function sY(e,t){let n=-1,r=!0,s=0,a=[0,0,0,0],l=[0,0,0,0],u=!1,h=0,d,m,g;const _=new eY;for(;++n<e.length;){const b=e[n],w=b[1];b[0]==="enter"?w.type==="tableHead"?(u=!1,h!==0&&(yk(_,t,h,d,m),m=void 0,h=0),d={type:"table",start:Object.assign({},w.start),end:Object.assign({},w.end)},_.add(n,0,[["enter",d,t]])):w.type==="tableRow"||w.type==="tableDelimiterRow"?(r=!0,g=void 0,a=[0,0,0,0],l=[0,n+1,0,0],u&&(u=!1,m={type:"tableBody",start:Object.assign({},w.start),end:Object.assign({},w.end)},_.add(n,0,[["enter",m,t]])),s=w.type==="tableDelimiterRow"?2:m?3:1):s&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")?(r=!1,l[2]===0&&(a[1]!==0&&(l[0]=l[1],g=qh(_,t,a,s,void 0,g),a=[0,0,0,0]),l[2]=n)):w.type==="tableCellDivider"&&(r?r=!1:(a[1]!==0&&(l[0]=l[1],g=qh(_,t,a,s,void 0,g)),a=l,l=[a[1],n,0,0])):w.type==="tableHead"?(u=!0,h=n):w.type==="tableRow"||w.type==="tableDelimiterRow"?(h=n,a[1]!==0?(l[0]=l[1],g=qh(_,t,a,s,n,g)):l[1]!==0&&(g=qh(_,t,l,s,n,g)),s=0):s&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")&&(l[3]=n)}for(h!==0&&yk(_,t,h,d,m),_.consume(t.events),n=-1;++n<t.events.length;){const b=t.events[n];b[0]==="enter"&&b[1].type==="table"&&(b[1]._align=nY(t.events,n))}return e}function qh(e,t,n,r,s,a){const l=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",u="tableContent";n[0]!==0&&(a.end=Object.assign({},fl(t.events,n[0])),e.add(n[0],0,[["exit",a,t]]));const h=fl(t.events,n[1]);if(a={type:l,start:Object.assign({},h),end:Object.assign({},h)},e.add(n[1],0,[["enter",a,t]]),n[2]!==0){const d=fl(t.events,n[2]),m=fl(t.events,n[3]),g={type:u,start:Object.assign({},d),end:Object.assign({},m)};if(e.add(n[2],0,[["enter",g,t]]),r!==2){const _=t.events[n[2]],b=t.events[n[3]];if(_[1].end=Object.assign({},b[1].end),_[1].type="chunkText",_[1].contentType="text",n[3]>n[2]+1){const w=n[2]+1,S=n[3]-n[2]-1;e.add(w,S,[])}}e.add(n[3]+1,0,[["exit",g,t]])}return s!==void 0&&(a.end=Object.assign({},fl(t.events,s)),e.add(s,0,[["exit",a,t]]),a=void 0),a}function yk(e,t,n,r,s){const a=[],l=fl(t.events,n);s&&(s.end=Object.assign({},l),a.push(["exit",s,t])),r.end=Object.assign({},l),a.push(["exit",r,t]),e.add(n+1,0,a)}function fl(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const oY={name:"tasklistCheck",tokenize:lY};function aY(){return{text:{91:oY}}}function lY(e,t,n){const r=this;return s;function s(h){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(h):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),a)}function a(h){return jt(h)?(e.enter("taskListCheckValueUnchecked"),e.consume(h),e.exit("taskListCheckValueUnchecked"),l):h===88||h===120?(e.enter("taskListCheckValueChecked"),e.consume(h),e.exit("taskListCheckValueChecked"),l):n(h)}function l(h){return h===93?(e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),u):n(h)}function u(h){return Be(h)?t(h):it(h)?e.check({tokenize:cY},t,n)(h):n(h)}}function cY(e,t,n){return ut(e,r,"whitespace");function r(s){return s===null?n(s):t(s)}}function uY(e){return cA([LG(),VG(),JG(e),rY(),aY()])}const dY={};function Gl(e){const t=this,n=e||dY,r=t.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),a=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),l=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(uY(n)),a.push(AG()),l.push(DG(n))}function bk(e){if(!e)return;const t=Number.parseInt(e,10);return Number.isFinite(t)&&t>0?t:void 0}function hY(e){var r;if(!e)return null;const t=e.trim();if(!t||/^(https?:|mailto:|ftp:|file:)/i.test(t)||!t.startsWith("/"))return null;const n=/^(?<path>\/.+?)#L(?<line>\d+)(?:C(?<column>\d+))?$/.exec(t);return(r=n==null?void 0:n.groups)!=null&&r.path?{path:n.groups.path,line:bk(n.groups.line),column:bk(n.groups.column)}:{path:t}}function Jv(e,t){if(!e)return"";if(t){const n=t.endsWith("/")?t:`${t}/`;if(e.startsWith(n))return e.slice(n.length);if(e===t)return""}return e.replace(/^\/home\/user\/workspace\//,"")}const I0=()=>{},JA=y.createContext(I0);function fY({children:e,onOpenLocalLink:t}){return p.jsx(JA.Provider,{value:t??I0,children:e})}const ay={Task:Of,TaskOutput:Of,Bash:Mb,Glob:Ev,Grep:Ev,ExitPlanMode:VC,Read:RT,Edit:YP,Write:ZP,NotebookEdit:NT,WebFetch:Q6,TodoWrite:pP,WebSearch:Ev,KillShell:nI,AskUserQuestion:TT,Skill:ZB,EnterPlanMode:VC},e5=aI;function t5(e){return ay[e]?ay[e]:e5}function vo({children:e,className:t}){return p.jsx("div",{className:ye("flex gap-3 justify-start items-center",t),children:e})}function pY({children:e,className:t}){return p.jsx("div",{className:ye("flex items-center gap-1.5 text-xs",t),children:e})}function ho({children:e,className:t}){return p.jsx("span",{className:ye("font-medium text-foreground/80",t),children:e})}function mY({children:e}){return p.jsx("span",{className:"text-muted-foreground",children:e})}function Up({children:e,expandedContent:t,defaultExpanded:n=!1}){const[r,s]=y.useState(n);return p.jsxs("div",{className:"flex flex-col w-full",children:[p.jsxs("button",{onClick:()=>s(!r),className:`group/expandable-row cursor-pointer grid grid-cols-[auto_1fr] items-center gap-1 text-sm ${r?"":"hover:opacity-60 transition-opacity"}`,children:[p.jsx("div",{className:"grid grid-cols-[auto_1fr] items-center gap-1.5",children:e}),p.jsx(fs,{className:`h-4.5 w-4.5 text-muted-icon translate-y-[0.5px] transition-all duration-200 opacity-0 group-hover/expandable-row:opacity-100 ${r?"rotate-90 opacity-100":""}`})]}),r&&t]})}function xk({label:e,children:t,copyText:n}){const[r,s]=y.useState(!1),a=n??ep(t),l=y.useCallback(async()=>{await navigator.clipboard.writeText(a),s(!0),setTimeout(()=>s(!1),2e3)},[a]);return p.jsxs("div",{children:[p.jsx("span",{className:"font-medium text-muted-foreground",children:e}),p.jsxs("div",{className:"relative group/codeblock",children:[p.jsx("pre",{className:"my-1 text-xs font-mono whitespace-no-wrap break-all bg-muted border border-border rounded-lg p-2 max-h-64 overflow-auto w-full",children:t}),p.jsx(tt,{variant:"ghost",size:"icon",className:ye("absolute top-[4px] right-[4px] z-10 h-6.5 w-6.5 rounded-sm text-muted-foreground opacity-0 group-hover/codeblock:opacity-100 transition-opacity",!r&&"hover:text-foreground",r&&"hover:!bg-transparent hover:!border-transparent"),onClick:l,children:r?p.jsx(lo,{className:"h-3.5 w-3.5 text-green-400"}):p.jsx(Zu,{className:"h-4 w-4"})})]})]})}function n5({children:e,icon:t,className:n}){return p.jsxs("span",{className:ye("inline-flex items-center gap-1 px-2 py-1 bg-muted border border-border rounded-full",n),children:[t&&p.jsx(t,{className:"h-3 w-3 text-muted-foreground"}),e]})}function $p({children:e,className:t}){return p.jsxs("div",{className:ye("grid grid-cols-[auto_1fr] gap-2 min-w-0",t),children:[p.jsx("div",{className:" min-w-5 flex flex-col relative items-center justify-center",children:p.jsx("div",{className:"min-h-full w-[1px] bg-muted-foreground/20"})}),p.jsx("div",{className:"-ml-[1px] min-w-0 overflow-hidden",children:e})]})}function ep(e){if(typeof e=="string")return e;if(typeof e=="number")return String(e);if(Array.isArray(e))return e.map(ep).join("");if(e&&typeof e=="object"&&"props"in e){const t=e.props;return ep(t.children)}return""}function wk(e,t){return y.isValidElement(e)?y.cloneElement(e,{className:ye(e.props.className,t)}):e}const H0={h1:({children:e})=>p.jsx("h1",{className:"text-[20px] font-normal leading-tight mt-5 mb-3 first:mt-0 last:mb-0",children:e}),h2:({children:e})=>p.jsx("h2",{className:"text-[18px] font-normal leading-tight mt-5 mb-3 first:mt-0 last:mb-0",children:e}),h3:({children:e})=>p.jsx("h3",{className:"text-[16px] font-normal leading-tight mt-5 mb-3 first:mt-0 last:mb-0",children:e}),h4:({children:e})=>p.jsx("h4",{className:"text-[16px] font-normal leading-tight mt-5 mb-3 first:mt-0 last:mb-0",children:e}),h5:({children:e})=>p.jsx("h5",{className:"text-[16px] font-normal leading-tight mt-5 mb-3 first:mt-0 last:mb-0",children:e}),h6:({children:e})=>p.jsx("h6",{className:"text-[16px] font-normal leading-tight mt-5 mb-3 first:mt-0 last:mb-0",children:e}),pre:({children:e,...t})=>{const[n,r]=y.useState(!1),s=ep(e),a=async()=>{await navigator.clipboard.writeText(s),r(!0),setTimeout(()=>r(!1),2e3)};return p.jsxs("div",{className:"relative overflow-x-auto max-w-full min-w-0 no-code-highlight group/pre",children:[p.jsx("pre",{className:"min-w-0 rounded-xl py-2.5 px-3.5 [.no-pre-highlight_&]:bg-background",...t,children:e}),p.jsx(tt,{variant:"ghost",size:"icon",className:ye("absolute top-[35px] -translate-y-[50%] -translate-x-[1px] rounded-md right-1.5 h-8 w-8 text-muted-foreground opacity-0 group-hover/pre:opacity-100 transition-opacity",!n&&"hover:text-foreground",n&&"hover:!bg-transparent hover:!border-transparent"),onClick:a,children:n?p.jsx(lo,{className:"h-4 w-4 text-green-400"}):p.jsx(Zu,{className:"h-4 w-4"})})]})},code:({children:e,className:t,...n})=>t?p.jsx("code",{className:"block text-xs whitespace-pre",...n,children:e}):p.jsx("code",{className:"break-all px-1 bg-border/60 dark:[.no-pre-highlight_&]:bg-background dark:[.text-pretty_&]:bg-neutral [.no-code-highlight_&]:!bg-transparent py-0.5 rounded text-sm whitespace-wrap",...n,children:e}),table:({children:e,...t})=>p.jsx("div",{className:"border border-border rounded-xl overflow-x-auto",children:p.jsx("table",{className:"table-auto min-w-full divide-y divide-border bg-background",...t,children:e})}),tbody:({children:e,...t})=>p.jsx("tbody",{className:"divide-y divide-border",...t,children:e}),th:({children:e,...t})=>p.jsx("th",{className:"text-left text-xs uppercase text-muted-foreground tracking-wider p-2 pl-0 first:pl-3 bg-muted dark:bg-card [&_*]:font-semibold",...t,children:e}),td:({children:e,...t})=>p.jsx("td",{className:"text-left p-2 pl-0 first:pl-3 [&_*]:font-normal ",...t,children:e}),p:({children:e,...t})=>p.jsx("p",{className:"break-words mt-5 mb-3 first:mt-0 last:mb-0",...t,children:e}),blockquote:({children:e,...t})=>(()=>{const n=y.Children.toArray(e),r=n[0];r!==void 0&&(n[0]=wk(r,"mt-0"));const s=n.length-1,a=n[s];return a!==void 0&&(n[s]=wk(a,"mb-0")),p.jsx("blockquote",{className:"my-2 mt-5 mb-3 first:mt-0 last:mb-0 border-l-2 border-border/80 pl-2 text-muted-foreground",...t,children:n})})(),a:({children:e,...t})=>p.jsx("a",{className:"transition-all underline decoration-2 text-logo decoration-logo/50 hover:text-logo/70 dark:text-logo dark:decoration-logo/70 dark:hover:text-logo/60 dark:hover:decoration-logo/40 ",target:"_blank",rel:"noopener noreferrer",...t,children:e})};function dd(e){return{...H0,a:({children:t,href:n,onClick:r,...s})=>{const a=y.useContext(JA),l=hY(n);return p.jsx("a",{className:"transition-all underline decoration-2 text-logo decoration-logo/50 hover:text-logo/70 dark:text-logo dark:decoration-logo/70 dark:hover:text-logo/60 dark:hover:decoration-logo/40 ",href:n,target:l?void 0:"_blank",rel:l?void 0:"noopener noreferrer",onClick:u=>{r==null||r(u),!(u.defaultPrevented||!l||a===I0)&&(u.preventDefault(),a(l))},...s,children:t})}}}({...H0});function gY(e){const t=e.split(`
|
|
555
|
-
`),n=/^\s*(\d+)→(.*)$/;return t.map(r=>{const s=r.match(n);return s?{lineNumber:parseInt(s[1],10),content:s[2]}:{lineNumber:null,content:r}})}function vY(e){return e.replace(/<[^>]+>/g,"")}function _Y(e,t){const n=e.split(`
|
|
556
|
-
`),r=t.split(`
|
|
557
|
-
`),s=yY(n,r),a=bY(n,r,s);return xY(a)}function yY(e,t){const n=e.length,r=t.length,s=Array.from({length:n+1},()=>Array(r+1).fill(0));for(let a=1;a<=n;a++)for(let l=1;l<=r;l++)s[a][l]=e[a-1]===t[l-1]?s[a-1][l-1]+1:Math.max(s[a-1][l],s[a][l-1]);return s}function bY(e,t,n){const r=[];let s=e.length,a=t.length;for(;s>0||a>0;)s>0&&a>0&&e[s-1]===t[a-1]?(r.push({type:"context",text:e[s-1],oldIdx:s,newIdx:a}),s--,a--):a>0&&(s===0||n[s][a-1]>=n[s-1][a])?(r.push({type:"added",text:t[a-1],oldIdx:s,newIdx:a}),a--):(r.push({type:"removed",text:e[s-1],oldIdx:s,newIdx:a}),s--);return r.reverse()}function xY(e){return e.map(t=>{const n=t.type==="removed"?"-":t.type==="added"?"+":" ";return{type:t.type,content:`${n}${t.text}`}})}function vf({content:e,isDiff:t=!1,oldString:n,newString:r}){const s=y.useMemo(()=>t&&n!==void 0&&r!==void 0?_Y(n,r):[],[t,n,r]),a=y.useMemo(()=>t?[]:gY(e),[e,t]),l=y.useMemo(()=>a.some(u=>u.lineNumber!==null),[a]);return t&&s.length>0?p.jsx("div",{className:"my-1 rounded-lg border border-border overflow-hidden",children:p.jsx("div",{className:"overflow-auto max-h-64 md:max-h-[50vh]",children:p.jsx("table",{className:"w-full border-collapse text-xs font-mono",children:p.jsx("tbody",{children:s.map((u,h)=>{const d=u.type==="removed"?"bg-red-500/10 dark:bg-red-500/15":u.type==="added"?"bg-green-500/10 dark:bg-green-500/15":"",m=u.type==="removed"?"text-red-700 dark:text-red-400":u.type==="added"?"text-green-700 dark:text-green-400":"text-foreground";return p.jsxs("tr",{className:d,children:[p.jsx("td",{className:`px-2 py-0 select-none w-0 whitespace-nowrap ${u.type==="removed"?"text-red-500/50":u.type==="added"?"text-green-500/50":"text-muted-foreground/50"}`,children:u.type==="removed"?"-":u.type==="added"?"+":" "}),p.jsx("td",{className:`px-2 py-0 whitespace-pre select-all ${m}`,children:u.content.slice(1)})]},h)})})})})}):p.jsx("div",{className:"my-1 rounded-lg border border-border overflow-hidden",children:p.jsx("div",{className:"overflow-auto max-h-64 md:max-h-[50vh]",children:p.jsx("table",{className:"w-full border-collapse text-xs font-mono",children:p.jsx("tbody",{children:a.map((u,h)=>p.jsxs("tr",{children:[l&&p.jsx("td",{className:"px-2 py-0 select-none w-0 whitespace-nowrap text-muted-foreground/50 text-right",children:u.lineNumber!==null?u.lineNumber:""}),p.jsx("td",{className:"px-2 py-0 whitespace-pre select-all text-foreground",children:vY(u.content)})]},h))})})})})}function r5({attachment:e,onOpenChange:t}){const[n,r]=y.useState({}),s=y.useMemo(()=>e?y0(e):null,[e]),a=e?n[e.id]:void 0,l=e!=null&&e.contentUrl?SY(e.contentUrl):"";y.useEffect(()=>{if(!e||!s||s.openInNewTab||s.kind==="image"||s.kind==="pdf"||s.kind==="external")return;const d=s.kind;if((a==null?void 0:a.status)==="loading"||(a==null?void 0:a.status)==="ready")return;let m=!1;return r(g=>({...g,[e.id]:{status:"loading"}})),PU(e.contentUrl,AU).then(({content:g,truncated:_})=>{if(m)return;if(d==="table"){const w=e.mimeType==="text/tab-separated-values"?" ":",";r(S=>({...S,[e.id]:{status:"ready",kind:"table",truncated:_,table:IU(g,w)}}));return}const b=d==="json"?BU(g):g;r(w=>({...w,[e.id]:{status:"ready",kind:d,content:b,truncated:_}}))}).catch(g=>{if(m)return;const _=g instanceof Error?g.message:"Unable to load preview.";r(b=>({...b,[e.id]:{status:"error",message:_}}))}),()=>{m=!0}},[e==null?void 0:e.id,e==null?void 0:e.contentUrl,e==null?void 0:e.mimeType,s==null?void 0:s.kind,s==null?void 0:s.openInNewTab]);async function u(){var d;!l||typeof navigator>"u"||!((d=navigator.clipboard)!=null&&d.writeText)||await navigator.clipboard.writeText(l)}function h(){!l||typeof window>"u"||window.open(l,"_blank","noopener,noreferrer")}return p.jsx(Db,{open:e!==null&&!(s!=null&&s.openInNewTab),onOpenChange:t,children:p.jsx(yp,{size:"lg",className:"max-w-[min(92vw,960px)] overflow-hidden p-0",children:e&&s&&!s.openInNewTab?p.jsxs(p.Fragment,{children:[p.jsx(yI,{className:"pr-12",children:p.jsx(Ob,{className:"text-md",children:e.displayName})}),p.jsx(jb,{className:"bg-muted/20 p-4",children:wY(e,s.kind,a)}),p.jsxs(Lb,{className:"items-center justify-between gap-3 px-4 py-3",children:[p.jsxs(jT,{className:"truncate",children:[e.mimeType," · ",b0(e.size)]}),p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsxs(bI,{type:"button",onClick:u,children:[p.jsx(fB,{className:"mr-2 h-4 w-4"}),"Copy Link"]}),p.jsxs(tt,{type:"button",variant:"outline",onClick:h,children:[p.jsx(BP,{className:"mr-2 h-4 w-4"}),"Open In New Tab"]})]})]})]}):null})})}function wY(e,t,n){if(t==="image")return p.jsx("div",{className:"flex items-center justify-center",children:p.jsx("img",{src:e.contentUrl,alt:e.displayName,className:"max-h-[70vh] w-auto max-w-full rounded-2xl object-contain"})});if(t==="pdf")return p.jsx("iframe",{src:e.contentUrl,title:e.displayName,className:"h-[70vh] w-full rounded-xl border border-border bg-background"});if(!n||n.status==="loading")return p.jsx("div",{className:"flex h-[50vh] items-center justify-center text-sm text-muted-foreground",children:"Loading preview…"});if(n.status==="error")return p.jsx("div",{className:"flex h-[50vh] items-center justify-center text-sm text-destructive",children:n.message});if(n.kind==="markdown"&&n.content!==void 0)return p.jsxs("div",{className:"space-y-3",children:[n.truncated?p.jsx(e_,{message:"Preview truncated to 1024 KB."}):null,p.jsx("div",{className:"prose prose-sm max-w-none overflow-auto rounded-xl border border-border bg-background p-4 prose-invert",children:p.jsx(Kl,{remarkPlugins:[Gl],components:dd(),children:n.content})})]});if(n.kind==="table"&&n.table){const r=n.table.rows.length>0,[s,...a]=n.table.rows,l=[n.truncated?"Preview truncated to 1024 KB.":null,n.table.truncatedRows?`Showing first ${n.table.rows.length} of ${n.table.rowCount} rows.`:null,n.table.truncatedColumns?`Showing first ${Y_} of ${n.table.columnCount} columns.`:null].filter(Boolean);return p.jsxs("div",{className:"space-y-3",children:[l.length>0?p.jsx(e_,{message:l.join(" ")}):null,p.jsx("div",{className:"max-h-[70vh] overflow-auto rounded-xl border border-border bg-background",children:p.jsxs("table",{className:"min-w-full border-collapse text-xs",children:[r?p.jsx("thead",{className:"sticky top-0 bg-muted",children:p.jsx("tr",{children:s.map((u,h)=>p.jsx("th",{className:"border-b border-border px-3 py-2 text-left font-medium text-foreground",children:u||" "},`${u}-${h}`))})}):null,p.jsx("tbody",{children:(r?a:n.table.rows).map((u,h)=>p.jsx("tr",{className:"odd:bg-background even:bg-muted/20",children:u.map((d,m)=>p.jsx("td",{className:"max-w-[320px] border-b border-border px-3 py-2 align-top text-foreground",children:p.jsx("div",{className:"whitespace-pre-wrap break-words",children:d||" "})},`${h}-${m}`))},h))})]})})]})}return p.jsxs("div",{className:"space-y-3",children:[n.truncated?p.jsx(e_,{message:"Preview truncated to 1024 KB."}):null,p.jsx(vf,{content:n.content??""})]})}function e_({message:e}){return p.jsx("div",{className:"rounded-xl border border-border bg-background px-3 py-2 text-sm text-muted-foreground",children:e})}function SY(e){return typeof window>"u"?e:new URL(e,window.location.origin).toString()}const i5=10,CY=3,kY={"image/gif":"gif","image/jpeg":"jpg","image/png":"png","image/webp":"webp"};function EY(e){const t=e.maxAttachments??i5;return e.currentAttachmentCount+e.queuedAttachmentCount+e.incomingAttachmentCount>t}function RY(e){return e?e.types.includes("text/plain")||e.types.includes("text/html"):!1}function s5(e){return kY[e.type]??"bin"}function TY(e){const t=e.name.trim().toLowerCase();if(!t)return!0;const n=s5(e);return t===`image.${n}`||t==="image.png"}function MY(e,t,n){if(e.name&&!TY(e))return e;const r=s5(e),s=t===0?"":`-${t}`,a=`clipboard-${n}${s}.${r}`;return Object.defineProperty(e,"name",{configurable:!0,value:a}),e}function NY(e,t){const n=[];for(const r of e){if(r.kind!=="file"||!r.type.startsWith("image/"))continue;const s=r.getAsFile();s&&n.push(MY(s,n.length,t))}return n}function Sk(e,t){return e.provider!=="claude"?{...e,model:t}:{...e,model:t,modelOptions:{...e.modelOptions,contextWindow:bM(t,e.modelOptions.contextWindow)}}}function Ck(e,t){if(t===void 0){console.info(`[ChatInput] ${e}`);return}console.info(`[ChatInput] ${e}`,t)}function AY(e,t,n){return!t||e.provider===t?e:t==="claude"?{provider:"claude",model:n.claude.model,modelOptions:{...n.claude.modelOptions},planMode:e.planMode}:{provider:"codex",model:n.codex.model,modelOptions:{...n.codex.modelOptions},planMode:e.planMode}}const DY=y.forwardRef(function({onSubmit:t,onCancel:n,disabled:r,canCancel:s,chatId:a,projectId:l,inputElementRef:u,activeProvider:h,availableProviders:d},m){const{getDraft:g,setDraft:_,clearDraft:b,getAttachmentDrafts:w,setAttachmentDrafts:S,clearAttachmentDrafts:C}=sU(),{providerDefaults:k,getComposerState:R,initializeComposerForChat:T,setChatComposerModel:N,setChatComposerPlanMode:L,resetChatComposerFromProvider:A}=er(),O=a??K_,G=er(ie=>ie.chatStates[O])??R(O),[B,H]=y.useState(()=>a?g(a):""),P=y.useRef(null),U=y.useRef(null),V=iU(),[W,z]=y.useState(()=>kk(a?w(a):[])),[$,q]=y.useState(null),[Q,M]=y.useState(null),I=y.useRef([]),Z=y.useRef(0),j=y.useRef([]),ce=y.useRef(0),fe=y.useRef(new Set),ue=y.useRef(l??null),de=y.useRef(a??null),we=h!==null,oe=AY(G,h,k),be=we?h:G.provider,Ne=d.find(ie=>ie.id===be)??d[0],Se=(Ne==null?void 0:Ne.supportsPlanMode)??!1,_e=W.filter(ie=>ie.status==="uploaded"),xe=W.some(ie=>ie.status==="uploading"),He=B.trim().length>0||_e.length>0,Fe=[...W].sort((ie,Te)=>ie.kind===Te.kind?0:ie.kind==="image"?-1:1),et=W.find(ie=>ie.id===$)??null,dt=y.useCallback(ie=>{ie.previewUrl&&URL.revokeObjectURL(ie.previewUrl)},[]),mt=y.useCallback(()=>{ce.current+=1,fe.current.clear(),z(ie=>(ie.forEach(dt),[])),I.current=[],Z.current=0,M(null)},[dt]),bt=y.useCallback(()=>{const ie=U.current;if(ie){if(ie.value.length===0){ie.style.height="";return}ie.style.height="auto",ie.style.height=`${ie.scrollHeight}px`}},[]),un=y.useCallback(ie=>{U.current=ie,u&&(typeof u=="function"?u(ie):u.current=ie)},[u]);y.useLayoutEffect(()=>{bt()},[B,bt]),y.useEffect(()=>(window.addEventListener("resize",bt),()=>window.removeEventListener("resize",bt)),[bt]),y.useEffect(()=>{var ie;(ie=U.current)==null||ie.focus()},[a]),y.useEffect(()=>{de.current=a??null},[a]),y.useEffect(()=>{T(O)},[O,T]),y.useEffect(()=>{ce.current+=1,I.current=[],Z.current=0,fe.current.clear(),q(null),M(null),z(ie=>(ie.forEach(dt),kk(a?w(a):[])))},[a,dt,w]),y.useEffect(()=>{const ie=ue.current;ue.current=l??null,!(ie===null||l===ie)&&(mt(),a&&C(a))},[l,a,mt,C]),y.useEffect(()=>{Ck("resolved provider state",{chatId:a??null,activeProvider:h,composerProvider:G.provider,composerModel:G.model,effectiveProvider:oe.provider,effectiveModel:oe.model,selectedProvider:be,providerLocked:we})},[h,a,G.model,G.provider,we,oe.model,oe.provider,be]),y.useEffect(()=>{j.current=W},[W]),y.useEffect(()=>{if(!a)return;const ie=W.filter(Te=>Te.status==="uploaded").map(({previewUrl:Te,status:ct,...xt})=>xt);if(ie.length===0){C(a);return}S(a,ie)},[W,a,C,S]),y.useEffect(()=>()=>{j.current.forEach(dt)},[dt]);function Zt(ie){er.getState().setComposerState(O,ie(oe))}function Nn(ie){Zt(Te=>({...Te,modelOptions:{...Te.modelOptions,reasoningEffort:ie}}))}function Dt(ie){Zt(Te=>Te.provider!=="claude"?Te:Sk({...Te,modelOptions:{...Te.modelOptions,contextWindow:ie}},Te.model))}function Yn(ie){L(O,ie)}function Y(){Yn(!oe.planMode)}const le=y.useCallback(()=>{if(l)for(;Z.current<CY&&I.current.length>0;){const ie=I.current.shift();if(!ie)break;Z.current+=1;const Te=crypto.randomUUID(),ct=ie.type.startsWith("image/")?URL.createObjectURL(ie):void 0,xt=ce.current;z(dn=>[...dn,{id:Te,kind:ie.type.startsWith("image/")?"image":"file",displayName:ie.name,absolutePath:"",relativePath:"",contentUrl:"",mimeType:ie.type||"application/octet-stream",size:ie.size,status:"uploading",previewUrl:ct}]),(async()=>{try{const dn=new FormData;dn.append("files",ie);const An=await fetch(`/api/projects/${l}/uploads`,{method:"POST",body:dn});if(!An.ok){const Et=await An.json().catch(()=>({}));throw new Error(typeof Et.error=="string"?Et.error:"Upload failed")}const kt=(await An.json()).attachments[0];if(!kt)throw new Error("Upload failed");if(xt!==ce.current){t_(kt),ct&&URL.revokeObjectURL(ct);return}if(fe.current.has(Te)){fe.current.delete(Te),ct&&URL.revokeObjectURL(ct),t_(kt);return}z(Et=>Et.map(Lt=>Lt.id!==Te?Lt:{...Lt,...kt,previewUrl:Lt.previewUrl,status:"uploaded"})),M(null)}catch(dn){if(xt!==ce.current){ct&&URL.revokeObjectURL(ct);return}z(An=>An.map(Xn=>Xn.id===Te?{...Xn,status:"failed"}:Xn)),M(dn instanceof Error?dn.message:String(dn))}finally{Z.current=Math.max(0,Z.current-1),le()}})()}},[l]),Re=y.useCallback(ie=>{if(!l){M("Open a project before uploading files.");return}if(EY({currentAttachmentCount:j.current.length,queuedAttachmentCount:I.current.length,incomingAttachmentCount:ie.length})){M(`You can upload up to ${i5} files at a time.`);return}I.current.push(...ie),M(null),le()},[le,l]);y.useImperativeHandle(m,()=>({enqueueFiles:Re}),[Re]);async function ze(){if(!He||xe)return;const ie=B,Te=_e.map(({previewUrl:dn,status:An,...Xn})=>Xn);let ct;oe.provider==="claude"?ct={claude:{...oe.modelOptions}}:ct={codex:{...oe.modelOptions}};const xt={provider:be,model:oe.model,modelOptions:ct,planMode:Se?oe.planMode:!1,attachments:Te};Ck("submit settings",{chatId:a??null,activeProvider:h,composerProvider:oe.provider,submitOptions:xt}),H(""),a&&b(a),U.current&&(U.current.style.height="auto");try{await t(ie,xt),mt(),de.current&&C(de.current)}catch(dn){console.error("[ChatInput] Submit failed:",dn),H(ie),a&&_(a,ie)}}function $e(ie){if(ie.key==="Tab"&&!ie.shiftKey){ie.preventDefault(),gI(U.current,document);return}if(ie.key==="Tab"&&ie.shiftKey&&Se){ie.preventDefault(),Y();return}if(ie.key==="Escape"&&s){ie.preventDefault(),n==null||n();return}const Te="ontouchstart"in window||navigator.maxTouchPoints>0;ie.key==="Enter"&&!ie.shiftKey&&!s&&!Te&&(ie.preventDefault(),ze())}function ht(ie){const Te=NY(ie.clipboardData.items,Date.now());Te.length!==0&&(Re(Te),RY(ie.clipboardData)||ie.preventDefault())}function ee(ie){if(y0(ie).openInNewTab){typeof window<"u"&&window.open(new URL(ie.contentUrl,window.location.origin).toString(),"_blank","noopener,noreferrer");return}q(ie.id)}function Xe(ie){fe.current.add(ie.id),z(Te=>{const ct=Te.find(xt=>xt.id===ie.id);return ct&&dt(ct),Te.filter(xt=>xt.id!==ie.id)}),$===ie.id&&q(null),ie.status==="uploaded"&&(fe.current.delete(ie.id),t_(ie))}function gt(){var ie;(ie=P.current)==null||ie.click()}return p.jsxs("div",{children:[p.jsxs("div",{className:ye("px-3 pt-0",V&&"px-5"),children:[p.jsxs("div",{className:"max-w-[840px] mx-auto rounded-[32px]",children:[W.length>0?p.jsx(g0,{className:"overflow-x-auto overflow-y-hidden whitespace-nowrap px-2 pb-2",children:p.jsx("div",{className:"flex items-end gap-2 pt-2",children:Fe.map(ie=>p.jsx("div",{className:ye("flex shrink-0 flex-col justify-end",ie.status==="failed"&&"text-destructive"),children:ie.kind==="image"?p.jsx(qN,{attachment:ie,previewUrl:ie.previewUrl,size:"composer",onClick:ie.status==="uploaded"?()=>ee(ie):void 0,onRemove:()=>Xe(ie)}):p.jsx(KN,{attachment:ie,onClick:ie.status==="uploaded"?()=>ee(ie):void 0,onRemove:()=>Xe(ie)})},ie.id))})}):null,p.jsxs("div",{className:"flex items-end max-w-[840px] mx-auto border dark:bg-card/40 backdrop-blur-lg border-border rounded-[29px] pr-1.5",children:[p.jsx("input",{ref:P,type:"file",multiple:!0,className:"hidden",onChange:ie=>{const Te=[...ie.target.files??[]];Te.length>0&&Re(Te),ie.target.value=""}}),p.jsx(tt,{type:"button",variant:"ghost",size:"icon",onPointerDown:ie=>{ie.preventDefault(),gt()},disabled:r,className:"md:hidden flex-shrink-0 ml-1 mb-1 h-10 w-10 rounded-full text-muted-foreground hover:text-foreground",children:p.jsx(DB,{className:"h-5 w-5"})}),p.jsx(TN,{ref:un,placeholder:"Build something...",value:B,autoFocus:!0,[Ab]:"",rows:1,onChange:ie=>{H(ie.target.value),a&&_(a,ie.target.value),bt()},onPaste:ht,onKeyDown:$e,disabled:r,className:"flex-1 text-base p-3 md:p-4 !pr-2 pl-0 md:pl-6 resize-none max-h-[200px] outline-none bg-transparent border-0 shadow-none"}),p.jsx(tt,{type:"button",onPointerDown:ie=>{ie.preventDefault(),s?n==null||n():!r&&He&&!xe&&ze()},disabled:!s&&(r||!He||xe),size:"icon",className:"flex-shrink-0 bg-slate-600 text-white dark:bg-white dark:text-slate-900 rounded-full cursor-pointer h-10 w-10 md:h-11 md:w-11 mb-1 -mr-0.5 md:mr-0 md:mb-1.5 touch-manipulation disabled:bg-white/60 disabled:text-slate-700",children:s?p.jsx("div",{className:"w-3 h-3 md:w-4 md:h-4 rounded-xs bg-current"}):p.jsx(iP,{className:"h-5 w-5 md:h-6 md:w-6"})})]})]}),Q?p.jsx("div",{className:"max-w-[840px] mx-auto mt-2 px-1 text-sm text-destructive",children:Q}):null]}),p.jsxs("div",{className:ye("overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden py-3 flex flex-row",V&&"p-5 pt-3"),children:[p.jsx("div",{className:"min-w-3"}),p.jsx(G_,{availableProviders:d,selectedProvider:be,providerLocked:we,model:oe.model,modelOptions:oe.modelOptions,onProviderChange:ie=>{we||A(O,ie)},onModelChange:(ie,Te)=>{if(we){Zt(ct=>Sk(ct,Te));return}N(O,Te)},onModelOptionChange:ie=>{switch(ie.type){case"claudeReasoningEffort":Nn(ie.effort);break;case"codexReasoningEffort":Nn(ie.effort);break;case"contextWindow":Dt(ie.contextWindow);break;case"fastMode":Zt(Te=>Te.provider==="claude"?Te:{...Te,modelOptions:{...Te.modelOptions,fastMode:ie.fastMode}});break}},planMode:oe.planMode,onPlanModeChange:Yn,includePlanMode:Se,className:"max-w-[840px] mx-auto"}),p.jsx("div",{className:"min-w-3"})]}),p.jsx(r5,{attachment:et,onOpenChange:ie=>!ie&&q(null)})]})}),OY=y.memo(DY);async function t_(e){if(!e.contentUrl)return;const t=e.contentUrl.replace(/\/content$/,"");await fetch(t,{method:"DELETE"}).catch(()=>{})}function kk(e){return e.map(t=>({...t,status:"uploaded"}))}const o5=y.forwardRef(({className:e,...t},n)=>p.jsx("div",{ref:n,className:ye("bg-card text-card-foreground",e),...t}));o5.displayName="Card";const a5=y.forwardRef(({className:e,...t},n)=>p.jsx("div",{ref:n,className:ye("flex flex-col space-y-1.5 p-2",e),...t}));a5.displayName="CardHeader";const jY=y.forwardRef(({className:e,...t},n)=>p.jsx("h3",{ref:n,className:ye("text-2xl font-semibold leading-none tracking-tight",e),...t}));jY.displayName="CardTitle";const LY=y.forwardRef(({className:e,...t},n)=>p.jsx("p",{ref:n,className:ye("text-sm text-muted-foreground",e),...t}));LY.displayName="CardDescription";const l5=y.forwardRef(({className:e,...t},n)=>p.jsx("div",{ref:n,className:ye("p-6 pt-0",e),...t}));l5.displayName="CardContent";const zY=y.forwardRef(({className:e,...t},n)=>p.jsx("div",{ref:n,className:ye("flex items-center p-6 pt-0",e),...t}));zY.displayName="CardFooter";function PY({sidebarCollapsed:e,onOpenSidebar:t,onExpandSidebar:n,onNewChat:r,localPath:s,embeddedTerminalVisible:a=!1,onToggleEmbeddedTerminal:l,rightSidebarVisible:u=!1,onToggleRightSidebar:h,onOpenExternal:d,editorLabel:m="Editor",finderShortcut:g,editorShortcut:_,terminalShortcut:b,rightSidebarShortcut:w}){return p.jsx(a5,{className:ye("absolute top-0 left-0 right-0 z-10 md:pt-3 px-3 border-border/0 md:pb-0 flex items-center justify-center"," bg-gradient-to-b from-background/70"),children:p.jsxs("div",{className:"relative flex items-center gap-2 w-full",children:[p.jsxs("div",{className:`flex items-center gap-1 flex-shrink-0 border border-border rounded-full ${e?"px-1.5":""} p-1 backdrop-blur-lg`,children:[p.jsx(tt,{variant:"ghost",size:"icon",className:"md:hidden",onClick:t,children:p.jsx(kb,{className:"size-4.5"})}),e&&p.jsxs(p.Fragment,{children:[p.jsx("div",{className:"flex items-center justify-center w-[36px] h-[36px]",children:p.jsx(yu,{className:"h-4 w-4 sm:h-5 sm:w-5 text-logo ml-1 hidden md:block"})}),p.jsx(tt,{variant:"ghost",size:"icon",className:"hidden md:flex",onClick:n,title:"Expand sidebar",children:p.jsx(T_,{className:"size-4.5"})})]}),p.jsx(tt,{variant:"ghost",size:"icon",onClick:r,title:"Compose",children:p.jsx(Tb,{className:"size-4.5"})})]}),p.jsx("div",{className:"flex-1 min-w-0"}),p.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0 border border-border rounded-full px-1.5 py-1 backdrop-blur-lg",children:[s&&(d||l)&&p.jsxs(p.Fragment,{children:[d?p.jsxs(iu,{children:[p.jsx(su,{asChild:!0,children:p.jsx(tt,{variant:"ghost",size:"icon",onClick:()=>d("open_finder"),title:"Open in Finder",className:"border border-border/0",children:p.jsx(Cb,{className:"h-4.5 w-4.5"})})}),p.jsx(ml,{side:"bottom",shortcut:g})]}):null,l?p.jsxs(iu,{children:[p.jsx(su,{asChild:!0,children:p.jsx(tt,{variant:"ghost",size:"icon",onClick:l,className:ye("border border-border/0",a&&"text-white"),children:p.jsx(Mb,{className:"h-4.5 w-4.5"})})}),p.jsx(ml,{side:"bottom",shortcut:b})]}):null,d?p.jsxs(iu,{children:[p.jsx(su,{asChild:!0,children:p.jsx(tt,{variant:"ghost",size:"icon",onClick:()=>d("open_editor"),title:`Open in ${m}`,className:"border border-border/0",children:p.jsx(Sb,{className:"h-4.5 w-4.5"})})}),p.jsx(ml,{side:"bottom",shortcut:_})]}):null]}),h?p.jsxs(iu,{children:[p.jsx(su,{asChild:!0,children:p.jsx(tt,{variant:"ghost",size:"icon",onClick:h,className:ye("border border-border/0",u&&"text-white"),children:p.jsx(NB,{className:"h-4.5 w-4.5"})})}),p.jsx(ml,{side:"bottom",shortcut:w})]}):null]})]})})}function BY({onClose:e}){return p.jsx("div",{className:"h-full min-h-0 border-l border-border bg-background md:min-w-[300px]",children:p.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[p.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b border-border px-3 py-2",children:[p.jsx("div",{className:"min-w-0 flex-1 truncate text-xs text-muted-foreground",children:"Diffs"}),p.jsx("button",{type:"button","aria-label":"Close right sidebar",onClick:e,className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",children:p.jsx(ca,{className:"h-4 w-4"})})]}),p.jsx("div",{className:"flex flex-1 items-center justify-center px-6 text-center",children:p.jsx("p",{className:"text-sm text-muted-foreground",children:"diffs coming soon"})})]})})}function IY(e,t){const n=getComputedStyle(e),r=parseFloat(n.fontSize);return t*r}function HY(e,t){const n=getComputedStyle(e.ownerDocument.body),r=parseFloat(n.fontSize);return t*r}function FY(e){return e/100*window.innerHeight}function UY(e){return e/100*window.innerWidth}function $Y(e){switch(typeof e){case"number":return[e,"px"];case"string":{const t=parseFloat(e);return e.endsWith("%")?[t,"%"]:e.endsWith("px")?[t,"px"]:e.endsWith("rem")?[t,"rem"]:e.endsWith("em")?[t,"em"]:e.endsWith("vh")?[t,"vh"]:e.endsWith("vw")?[t,"vw"]:[t,"%"]}}}function lu({groupSize:e,panelElement:t,styleProp:n}){let r;const[s,a]=$Y(n);switch(a){case"%":{r=s/100*e;break}case"px":{r=s;break}case"rem":{r=HY(t,s);break}case"em":{r=IY(t,s);break}case"vh":{r=FY(s);break}case"vw":{r=UY(s);break}}return r}function mr(e){return parseFloat(e.toFixed(3))}function Dl({group:e}){const{orientation:t,panels:n}=e;return n.reduce((r,s)=>(r+=t==="horizontal"?s.element.offsetWidth:s.element.offsetHeight,r),0)}function ly(e){const{panels:t}=e,n=Dl({group:e});return n===0?t.map(r=>({groupResizeBehavior:r.panelConstraints.groupResizeBehavior,collapsedSize:0,collapsible:r.panelConstraints.collapsible===!0,defaultSize:void 0,disabled:r.panelConstraints.disabled,minSize:0,maxSize:100,panelId:r.id})):t.map(r=>{const{element:s,panelConstraints:a}=r;let l=0;if(a.collapsedSize!==void 0){const m=lu({groupSize:n,panelElement:s,styleProp:a.collapsedSize});l=mr(m/n*100)}let u;if(a.defaultSize!==void 0){const m=lu({groupSize:n,panelElement:s,styleProp:a.defaultSize});u=mr(m/n*100)}let h=0;if(a.minSize!==void 0){const m=lu({groupSize:n,panelElement:s,styleProp:a.minSize});h=mr(m/n*100)}let d=100;if(a.maxSize!==void 0){const m=lu({groupSize:n,panelElement:s,styleProp:a.maxSize});d=mr(m/n*100)}return{groupResizeBehavior:a.groupResizeBehavior,collapsedSize:l,collapsible:a.collapsible===!0,defaultSize:u,disabled:a.disabled,minSize:h,maxSize:d,panelId:r.id}})}function At(e,t="Assertion error"){if(!e)throw Error(t)}function cy(e,t){return Array.from(t).sort(e==="horizontal"?WY:VY)}function WY(e,t){const n=e.element.offsetLeft-t.element.offsetLeft;return n!==0?n:e.element.offsetWidth-t.element.offsetWidth}function VY(e,t){const n=e.element.offsetTop-t.element.offsetTop;return n!==0?n:e.element.offsetHeight-t.element.offsetHeight}function c5(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function u5(e,t){return{x:e.x>=t.left&&e.x<=t.right?0:Math.min(Math.abs(e.x-t.left),Math.abs(e.x-t.right)),y:e.y>=t.top&&e.y<=t.bottom?0:Math.min(Math.abs(e.y-t.top),Math.abs(e.y-t.bottom))}}function qY({orientation:e,rects:t,targetRect:n}){const r={x:n.x+n.width/2,y:n.y+n.height/2};let s,a=Number.MAX_VALUE;for(const l of t){const{x:u,y:h}=u5(r,l),d=e==="horizontal"?u:h;d<a&&(a=d,s=l)}return At(s,"No rect found"),s}let Kh;function KY(){return Kh===void 0&&(typeof matchMedia=="function"?Kh=!!matchMedia("(pointer:coarse)").matches:Kh=!1),Kh}function d5(e){const{element:t,orientation:n,panels:r,separators:s}=e,a=cy(n,Array.from(t.children).filter(c5).map(w=>({element:w}))).map(({element:w})=>w),l=[];let u=!1,h=!1,d=-1,m=-1,g=0,_,b=[];{let w=-1;for(const S of a)S.hasAttribute("data-panel")&&(w++,S.ariaDisabled===null&&(g++,d===-1&&(d=w),m=w))}if(g>1){let w=-1;for(const S of a)if(S.hasAttribute("data-panel")){w++;const C=r.find(k=>k.element===S);if(C){if(_){const k=_.element.getBoundingClientRect(),R=S.getBoundingClientRect();let T;if(h){const N=n==="horizontal"?new DOMRect(k.right,k.top,0,k.height):new DOMRect(k.left,k.bottom,k.width,0),L=n==="horizontal"?new DOMRect(R.left,R.top,0,R.height):new DOMRect(R.left,R.top,R.width,0);switch(b.length){case 0:{T=[N,L];break}case 1:{const A=b[0],O=qY({orientation:n,rects:[k,R],targetRect:A.element.getBoundingClientRect()});T=[A,O===k?L:N];break}default:{T=b;break}}}else b.length?T=b:T=[n==="horizontal"?new DOMRect(k.right,R.top,R.left-k.right,R.height):new DOMRect(R.left,k.bottom,R.width,R.top-k.bottom)];for(const N of T){let L="width"in N?N:N.element.getBoundingClientRect();const A=KY()?e.resizeTargetMinimumSize.coarse:e.resizeTargetMinimumSize.fine;if(L.width<A){const F=A-L.width;L=new DOMRect(L.x-F/2,L.y,L.width+F,L.height)}if(L.height<A){const F=A-L.height;L=new DOMRect(L.x,L.y-F/2,L.width,L.height+F)}const O=w<=d||w>m;!u&&!O&&l.push({group:e,groupSize:Dl({group:e}),panels:[_,C],separator:"width"in N?void 0:N,rect:L}),u=!1}}h=!1,_=C,b=[]}}else if(S.hasAttribute("data-separator")){S.ariaDisabled!==null&&(u=!0);const C=s.find(k=>k.element===S);C?b.push(C):(_=void 0,b=[])}else h=!0}return l}var ro,aR;let h5=(aR=class{constructor(){eC(this,ro,{})}addListener(t,n){const r=Fc(this,ro)[t];return r===void 0?Fc(this,ro)[t]=[n]:r.includes(n)||r.push(n),()=>{this.removeListener(t,n)}}emit(t,n){const r=Fc(this,ro)[t];if(r!==void 0)if(r.length===1)r[0].call(null,n);else{let s=!1,a=null;const l=Array.from(r);for(let u=0;u<l.length;u++){const h=l[u];try{h.call(null,n)}catch(d){a===null&&(s=!0,a=d)}}if(s)throw a}}removeAllListeners(){tC(this,ro,{})}removeListener(t,n){const r=Fc(this,ro)[t];if(r!==void 0){const s=r.indexOf(n);s>=0&&r.splice(s,1)}}},ro=new WeakMap,aR),Mi=new Map;const f5=new h5;function GY(e){Mi=new Map(Mi),Mi.delete(e)}function Ek(e,t){for(const[n]of Mi)if(n.id===e)return n}function oo(e,t){for(const[n,r]of Mi)if(n.id===e)return r;if(t)throw Error(`Could not find data for Group with id ${e}`)}function ma(){return Mi}function F0(e,t){return f5.addListener("groupChange",n=>{n.group.id===e&&t(n)})}function gs(e,t){const n=Mi.get(e);Mi=new Map(Mi),Mi.set(e,t),f5.emit("groupChange",{group:e,prev:n,next:t})}function YY(e,t,n){let r,s={x:1/0,y:1/0};for(const a of t){const l=u5(n,a.rect);switch(e){case"horizontal":{l.x<=s.x&&(r=a,s=l);break}case"vertical":{l.y<=s.y&&(r=a,s=l);break}}}return r?{distance:s,hitRegion:r}:void 0}function XY(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function ZY(e,t){if(e===t)throw new Error("Cannot compare node with itself");const n={a:Mk(e),b:Mk(t)};let r;for(;n.a.at(-1)===n.b.at(-1);)r=n.a.pop(),n.b.pop();At(r,"Stacking order can only be calculated for elements with a common ancestor");const s={a:Tk(Rk(n.a)),b:Tk(Rk(n.b))};if(s.a===s.b){const a=r.childNodes,l={a:n.a.at(-1),b:n.b.at(-1)};let u=a.length;for(;u--;){const h=a[u];if(h===l.a)return 1;if(h===l.b)return-1}}return Math.sign(s.a-s.b)}const QY=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function JY(e){const t=getComputedStyle(p5(e)??e).display;return t==="flex"||t==="inline-flex"}function eX(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||JY(e))||+t.opacity<1||"transform"in t&&t.transform!=="none"||"webkitTransform"in t&&t.webkitTransform!=="none"||"mixBlendMode"in t&&t.mixBlendMode!=="normal"||"filter"in t&&t.filter!=="none"||"webkitFilter"in t&&t.webkitFilter!=="none"||"isolation"in t&&t.isolation==="isolate"||QY.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function Rk(e){let t=e.length;for(;t--;){const n=e[t];if(At(n,"Missing node"),eX(n))return n}return null}function Tk(e){return e&&Number(getComputedStyle(e).zIndex)||0}function Mk(e){const t=[];for(;e;)t.push(e),e=p5(e);return t}function p5(e){const{parentNode:t}=e;return XY(t)?t.host:t}function tX(e,t){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function nX({groupElement:e,hitRegion:t,pointerEventTarget:n}){if(!c5(n)||n.contains(e)||e.contains(n))return!0;if(ZY(n,e)>0){let r=n;for(;r;){if(r.contains(e))return!0;if(tX(r.getBoundingClientRect(),t))return!1;r=r.parentElement}}return!0}function U0(e,t){const n=[];return t.forEach((r,s)=>{if(s.disabled)return;const a=d5(s),l=YY(s.orientation,a,{x:e.clientX,y:e.clientY});l&&l.distance.x<=0&&l.distance.y<=0&&nX({groupElement:s.element,hitRegion:l.hitRegion.rect,pointerEventTarget:e.target})&&n.push(l.hitRegion)}),n}function rX(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function tr(e,t,n=0){return Math.abs(mr(e)-mr(t))<=n}function ki(e,t){return tr(e,t)?0:e>t?1:-1}function vl({overrideDisabledPanels:e,panelConstraints:t,prevSize:n,size:r}){const{collapsedSize:s=0,collapsible:a,disabled:l,maxSize:u=100,minSize:h=0}=t;if(l&&!e)return n;if(ki(r,h)<0)if(a){const d=(s+h)/2;ki(r,d)<0?r=s:r=h}else r=h;return r=Math.min(u,r),r=mr(r),r}function $u({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:s,trigger:a}){if(tr(e,0))return t;const l=a==="imperative-api",u=Object.values(t),h=Object.values(s),d=[...u],[m,g]=r;At(m!=null,"Invalid first pivot index"),At(g!=null,"Invalid second pivot index");let _=0;switch(a){case"keyboard":{{const S=e<0?g:m,C=n[S];At(C,`Panel constraints not found for index ${S}`);const{collapsedSize:k=0,collapsible:R,minSize:T=0}=C;if(R){const N=u[S];if(At(N!=null,`Previous layout not found for panel index ${S}`),tr(N,k)){const L=T-N;ki(L,Math.abs(e))>0&&(e=e<0?0-L:L)}}}{const S=e<0?m:g,C=n[S];At(C,`No panel constraints found for index ${S}`);const{collapsedSize:k=0,collapsible:R,minSize:T=0}=C;if(R){const N=u[S];if(At(N!=null,`Previous layout not found for panel index ${S}`),tr(N,T)){const L=N-k;ki(L,Math.abs(e))>0&&(e=e<0?0-L:L)}}}break}default:{const S=e<0?g:m,C=n[S];At(C,`Panel constraints not found for index ${S}`);const k=u[S],{collapsible:R,collapsedSize:T,minSize:N}=C;if(R&&ki(k,N)<0)if(e>0){const L=N-T,A=L/2,O=k+e;ki(O,N)<0&&(e=ki(e,A)<=0?0:L)}else{const L=N-T,A=100-L/2,O=k-e;ki(O,N)<0&&(e=ki(100+e,A)>0?0:-L)}break}}{const S=e<0?1:-1;let C=e<0?g:m,k=0;for(;;){const T=u[C];At(T!=null,`Previous layout not found for panel index ${C}`);const N=vl({overrideDisabledPanels:l,panelConstraints:n[C],prevSize:T,size:100})-T;if(k+=N,C+=S,C<0||C>=n.length)break}const R=Math.min(Math.abs(e),Math.abs(k));e=e<0?0-R:R}{let S=e<0?m:g;for(;S>=0&&S<n.length;){const C=Math.abs(e)-Math.abs(_),k=u[S];At(k!=null,`Previous layout not found for panel index ${S}`);const R=k-C,T=vl({overrideDisabledPanels:l,panelConstraints:n[S],prevSize:k,size:R});if(!tr(k,T)&&(_+=k-T,d[S]=T,_.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?S--:S++}}if(rX(h,d))return s;{const S=e<0?g:m,C=u[S];At(C!=null,`Previous layout not found for panel index ${S}`);const k=C+_,R=vl({overrideDisabledPanels:l,panelConstraints:n[S],prevSize:C,size:k});if(d[S]=R,!tr(R,k)){let T=k-R,N=e<0?g:m;for(;N>=0&&N<n.length;){const L=d[N];At(L!=null,`Previous layout not found for panel index ${N}`);const A=L+T,O=vl({overrideDisabledPanels:l,panelConstraints:n[N],prevSize:L,size:A});if(tr(L,O)||(T-=O-L,d[N]=O),tr(T,0))break;e>0?N--:N++}}}const b=Object.values(d).reduce((S,C)=>C+S,0);if(!tr(b,100,.1))return s;const w=Object.keys(s);return d.reduce((S,C,k)=>(S[w[k]]=C,S),{})}function ta(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(t[n]===void 0||ki(e[n],t[n])!==0)return!1;return!0}function na({layout:e,panelConstraints:t}){const n=Object.values(e),r=[...n],s=r.reduce((u,h)=>u+h,0);if(r.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${r.map(u=>`${u}%`).join(", ")}`);if(!tr(s,100)&&r.length>0)for(let u=0;u<t.length;u++){const h=r[u];At(h!=null,`No layout data found for index ${u}`);const d=100/s*h;r[u]=d}let a=0;for(let u=0;u<t.length;u++){const h=n[u];At(h!=null,`No layout data found for index ${u}`);const d=r[u];At(d!=null,`No layout data found for index ${u}`);const m=vl({overrideDisabledPanels:!0,panelConstraints:t[u],prevSize:h,size:d});d!=m&&(a+=d-m,r[u]=m)}if(!tr(a,0))for(let u=0;u<t.length;u++){const h=r[u];At(h!=null,`No layout data found for index ${u}`);const d=h+a,m=vl({overrideDisabledPanels:!0,panelConstraints:t[u],prevSize:h,size:d});if(h!==m&&(a-=m-h,r[u]=m,tr(a,0)))break}const l=Object.keys(e);return r.reduce((u,h,d)=>(u[l[d]]=h,u),{})}function m5({groupId:e,panelId:t}){const n=()=>{const u=ma();for(const[h,{defaultLayoutDeferred:d,derivedPanelConstraints:m,layout:g,groupSize:_,separatorToPanels:b}]of u)if(h.id===e)return{defaultLayoutDeferred:d,derivedPanelConstraints:m,group:h,groupSize:_,layout:g,separatorToPanels:b};throw Error(`Group ${e} not found`)},r=()=>{const u=n().derivedPanelConstraints.find(h=>h.panelId===t);if(u!==void 0)return u;throw Error(`Panel constraints not found for Panel ${t}`)},s=()=>{const u=n().group.panels.find(h=>h.id===t);if(u!==void 0)return u;throw Error(`Layout not found for Panel ${t}`)},a=()=>{const u=n().layout[t];if(u!==void 0)return u;throw Error(`Layout not found for Panel ${t}`)},l=u=>{const h=a();if(u===h)return;const{defaultLayoutDeferred:d,derivedPanelConstraints:m,group:g,groupSize:_,layout:b,separatorToPanels:w}=n(),S=g.panels.findIndex(T=>T.id===t),C=S===g.panels.length-1,k=$u({delta:C?h-u:u-h,initialLayout:b,panelConstraints:m,pivotIndices:C?[S-1,S]:[S,S+1],prevLayout:b,trigger:"imperative-api"}),R=na({layout:k,panelConstraints:m});ta(b,R)||gs(g,{defaultLayoutDeferred:d,derivedPanelConstraints:m,groupSize:_,layout:R,separatorToPanels:w})};return{collapse:()=>{const{collapsible:u,collapsedSize:h}=r(),{mutableValues:d}=s(),m=a();u&&m!==h&&(d.expandToSize=m,l(h))},expand:()=>{const{collapsible:u,collapsedSize:h,minSize:d}=r(),{mutableValues:m}=s(),g=a();if(u&&g===h){let _=m.expandToSize??d;_===0&&(_=1),l(_)}},getSize:()=>{const{group:u}=n(),h=a(),{element:d}=s(),m=u.orientation==="horizontal"?d.offsetWidth:d.offsetHeight;return{asPercentage:h,inPixels:m}},isCollapsed:()=>{const{collapsible:u,collapsedSize:h}=r(),d=a();return u&&tr(h,d)},resize:u=>{const{group:h}=n(),{element:d}=s(),m=Dl({group:h}),g=lu({groupSize:m,panelElement:d,styleProp:u}),_=mr(g/m*100);l(_)}}}function Nk(e){if(e.defaultPrevented)return;const t=ma();U0(e,t).forEach(n=>{if(n.separator){const r=n.panels.find(s=>s.panelConstraints.defaultSize!==void 0);if(r){const s=r.panelConstraints.defaultSize,a=m5({groupId:n.group.id,panelId:r.id});a&&s!==void 0&&(a.resize(s),e.preventDefault())}}})}function _f(e){const t=ma();for(const[n]of t)if(n.separators.some(r=>r.element===e))return n;throw Error("Could not find parent Group for separator element")}function g5({groupId:e}){const t=()=>{const n=ma();for(const[r,s]of n)if(r.id===e)return{group:r,...s};throw Error(`Could not find Group with id "${e}"`)};return{getLayout(){const{defaultLayoutDeferred:n,layout:r}=t();return n?{}:r},setLayout(n){const{defaultLayoutDeferred:r,derivedPanelConstraints:s,group:a,groupSize:l,layout:u,separatorToPanels:h}=t(),d=na({layout:n,panelConstraints:s});return r?u:(ta(u,d)||gs(a,{defaultLayoutDeferred:r,derivedPanelConstraints:s,groupSize:l,layout:d,separatorToPanels:h}),d)}}}function Ho(e,t){const n=_f(e),r=oo(n.id,!0),s=n.separators.find(m=>m.element===e);At(s,"Matching separator not found");const a=r.separatorToPanels.get(s);At(a,"Matching panels not found");const l=a.map(m=>n.panels.indexOf(m)),u=g5({groupId:n.id}).getLayout(),h=$u({delta:t,initialLayout:u,panelConstraints:r.derivedPanelConstraints,pivotIndices:l,prevLayout:u,trigger:"keyboard"}),d=na({layout:h,panelConstraints:r.derivedPanelConstraints});ta(u,d)||gs(n,{defaultLayoutDeferred:r.defaultLayoutDeferred,derivedPanelConstraints:r.derivedPanelConstraints,groupSize:r.groupSize,layout:d,separatorToPanels:r.separatorToPanels})}function Ak(e){if(e.defaultPrevented)return;const t=e.currentTarget,n=_f(t);if(!n.disabled)switch(e.key){case"ArrowDown":{e.preventDefault(),n.orientation==="vertical"&&Ho(t,5);break}case"ArrowLeft":{e.preventDefault(),n.orientation==="horizontal"&&Ho(t,-5);break}case"ArrowRight":{e.preventDefault(),n.orientation==="horizontal"&&Ho(t,5);break}case"ArrowUp":{e.preventDefault(),n.orientation==="vertical"&&Ho(t,-5);break}case"End":{e.preventDefault(),Ho(t,100);break}case"Enter":{e.preventDefault();const r=_f(t),s=oo(r.id,!0),{derivedPanelConstraints:a,layout:l,separatorToPanels:u}=s,h=r.separators.find(_=>_.element===t);At(h,"Matching separator not found");const d=u.get(h);At(d,"Matching panels not found");const m=d[0],g=a.find(_=>_.panelId===m.id);if(At(g,"Panel metadata not found"),g.collapsible){const _=l[m.id],b=g.collapsedSize===_?r.mutableState.expandedPanelSizes[m.id]??g.minSize:g.collapsedSize;Ho(t,b-_)}break}case"F6":{e.preventDefault();const r=_f(t).separators.map(l=>l.element),s=Array.from(r).findIndex(l=>l===e.currentTarget);At(s!==null,"Index not found");const a=e.shiftKey?s>0?s-1:r.length-1:s+1<r.length?s+1:0;r[a].focus({preventScroll:!0});break}case"Home":{e.preventDefault(),Ho(t,-100);break}}}let kl={cursorFlags:0,state:"inactive"};const $0=new h5;function ra(){return kl}function iX(e){return $0.addListener("change",e)}function sX(e){const t=kl,n={...kl};n.cursorFlags=e,kl=n,$0.emit("change",{prev:t,next:n})}function El(e){const t=kl;kl=e,$0.emit("change",{prev:t,next:e})}function Dk(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const t=ma(),n=U0(e,t),r=new Map;let s=!1;n.forEach(a=>{a.separator&&(s||(s=!0,a.separator.element.focus({preventScroll:!0})));const l=t.get(a.group);l&&r.set(a.group,l.layout)}),El({cursorFlags:0,hitRegions:n,initialLayoutMap:r,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:"active"}),n.length&&e.preventDefault()}const oX=e=>e,n_=()=>{},v5=1,_5=2,y5=4,b5=8,Ok=3,jk=12;let Gh;function Lk(){return Gh===void 0&&(Gh=!1,typeof window<"u"&&(window.navigator.userAgent.includes("Chrome")||window.navigator.userAgent.includes("Firefox"))&&(Gh=!0)),Gh}function aX({cursorFlags:e,groups:t,state:n}){let r=0,s=0;switch(n){case"active":case"hover":t.forEach(a=>{if(!a.mutableState.disableCursor)switch(a.orientation){case"horizontal":{r++;break}case"vertical":{s++;break}}})}if(!(r===0&&s===0)){switch(n){case"active":{if(e&&Lk()){const a=(e&v5)!==0,l=(e&_5)!==0,u=(e&y5)!==0,h=(e&b5)!==0;if(a)return u?"se-resize":h?"ne-resize":"e-resize";if(l)return u?"sw-resize":h?"nw-resize":"w-resize";if(u)return"s-resize";if(h)return"n-resize"}break}}return Lk()?r>0&&s>0?"move":r>0?"ew-resize":"ns-resize":r>0&&s>0?"grab":r>0?"col-resize":"row-resize"}}const zk=new WeakMap;function W0(e){if(e.defaultView===null||e.defaultView===void 0)return;let{prevStyle:t,styleSheet:n}=zk.get(e)??{};n===void 0&&(n=new e.defaultView.CSSStyleSheet,e.adoptedStyleSheets&&e.adoptedStyleSheets.push(n));const r=ra();switch(r.state){case"active":case"hover":{const s=aX({cursorFlags:r.cursorFlags,groups:r.hitRegions.map(l=>l.group),state:r.state}),a=`*, *:hover {cursor: ${s} !important; }`;if(t===a)return;t=a,s?n.cssRules.length===0?n.insertRule(a):n.replaceSync(a):n.cssRules.length===1&&n.deleteRule(0);break}case"inactive":{t=void 0,n.cssRules.length===1&&n.deleteRule(0);break}}zk.set(e,{prevStyle:t,styleSheet:n})}function x5({document:e,event:t,hitRegions:n,initialLayoutMap:r,mountedGroups:s,pointerDownAtPoint:a,prevCursorFlags:l}){let u=0;n.forEach(d=>{const{group:m,groupSize:g}=d,{orientation:_,panels:b}=m,{disableCursor:w}=m.mutableState;let S=0;a?_==="horizontal"?S=(t.clientX-a.x)/g*100:S=(t.clientY-a.y)/g*100:_==="horizontal"?S=t.clientX<0?-100:100:S=t.clientY<0?-100:100;const C=r.get(m),k=s.get(m);if(!C||!k)return;const{defaultLayoutDeferred:R,derivedPanelConstraints:T,groupSize:N,layout:L,separatorToPanels:A}=k;if(T&&L&&A){const O=$u({delta:S,initialLayout:C,panelConstraints:T,pivotIndices:d.panels.map(F=>b.indexOf(F)),prevLayout:L,trigger:"mouse-or-touch"});if(ta(O,L)){if(S!==0&&!w)switch(_){case"horizontal":{u|=S<0?v5:_5;break}case"vertical":{u|=S<0?y5:b5;break}}}else gs(d.group,{defaultLayoutDeferred:R,derivedPanelConstraints:T,groupSize:N,layout:O,separatorToPanels:A})}});let h=0;t.movementX===0?h|=l&Ok:h|=u&Ok,t.movementY===0?h|=l&jk:h|=u&jk,sX(h),W0(e)}function Pk(e){const t=ma(),n=ra();switch(n.state){case"active":x5({document:e.currentTarget,event:e,hitRegions:n.hitRegions,initialLayoutMap:n.initialLayoutMap,mountedGroups:t,prevCursorFlags:n.cursorFlags})}}function Bk(e){if(e.defaultPrevented)return;const t=ra(),n=ma();switch(t.state){case"active":{if(e.buttons===0){El({cursorFlags:0,state:"inactive"}),t.hitRegions.forEach(r=>{const s=oo(r.group.id,!0);gs(r.group,s)});return}x5({document:e.currentTarget,event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:n,pointerDownAtPoint:t.pointerDownAtPoint,prevCursorFlags:t.cursorFlags});break}default:{const r=U0(e,n);r.length===0?t.state!=="inactive"&&El({cursorFlags:0,state:"inactive"}):El({cursorFlags:0,hitRegions:r,state:"hover"}),W0(e.currentTarget);break}}}function Ik(e){if(e.relatedTarget instanceof HTMLIFrameElement)switch(ra().state){case"hover":El({cursorFlags:0,state:"inactive"})}}function Hk(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const t=ra();switch(t.state){case"active":El({cursorFlags:0,state:"inactive"}),t.hitRegions.length>0&&(W0(e.currentTarget),t.hitRegions.forEach(n=>{const r=oo(n.group.id,!0);gs(n.group,r)}),e.preventDefault())}}function Fk(e){let t=0,n=0;const r={};for(const a of e)if(a.defaultSize!==void 0){t++;const l=mr(a.defaultSize);n+=l,r[a.panelId]=l}else r[a.panelId]=void 0;const s=e.length-t;if(s!==0){const a=mr((100-n)/s);for(const l of e)l.defaultSize===void 0&&(r[l.panelId]=a)}return r}function lX(e,t,n){if(!n[0])return;const r=e.panels.find(h=>h.element===t);if(!r||!r.onResize)return;const s=Dl({group:e}),a=e.orientation==="horizontal"?r.element.offsetWidth:r.element.offsetHeight,l=r.mutableValues.prevSize,u={asPercentage:mr(a/s*100),inPixels:a};r.mutableValues.prevSize=u,r.onResize(u,r.id,l)}function cX(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function uX({group:e,nextGroupSize:t,prevGroupSize:n,prevLayout:r}){if(n<=0||t<=0||n===t)return r;let s=0,a=0,l=!1;const u=new Map,h=[];for(const g of e.panels){const _=r[g.id]??0;switch(g.panelConstraints.groupResizeBehavior){case"preserve-pixel-size":{l=!0;const b=_/100*n,w=mr(b/t*100);u.set(g.id,w),s+=w;break}case"preserve-relative-size":default:{h.push(g.id),a+=_;break}}}if(!l||h.length===0)return r;const d=100-s,m={...r};if(u.forEach((g,_)=>{m[_]=g}),a>0)for(const g of h){const _=r[g]??0;m[g]=mr(_/a*d)}else{const g=mr(d/h.length);for(const _ of h)m[_]=g}return m}function dX(e,t){const n=e.map(s=>s.id),r=Object.keys(t);if(n.length!==r.length)return!1;for(const s of n)if(!r.includes(s))return!1;return!0}const ll=new Map;function hX(e){let t=!0;At(e.element.ownerDocument.defaultView,"Cannot register an unmounted Group");const n=e.element.ownerDocument.defaultView.ResizeObserver,r=new Set,s=new Set,a=new n(w=>{for(const S of w){const{borderBoxSize:C,target:k}=S;if(k===e.element){if(t){const R=Dl({group:e});if(R===0)return;const T=oo(e.id);if(!T)return;const N=ly(e),L=T.defaultLayoutDeferred?Fk(N):T.layout,A=uX({group:e,nextGroupSize:R,prevGroupSize:T.groupSize,prevLayout:L}),O=na({layout:A,panelConstraints:N});if(!T.defaultLayoutDeferred&&ta(T.layout,O)&&cX(T.derivedPanelConstraints,N)&&T.groupSize===R)return;gs(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:N,groupSize:R,layout:O,separatorToPanels:T.separatorToPanels})}}else lX(e,k,C)}});a.observe(e.element),e.panels.forEach(w=>{At(!r.has(w.id),`Panel ids must be unique; id "${w.id}" was used more than once`),r.add(w.id),w.onResize&&a.observe(w.element)});const l=Dl({group:e}),u=ly(e),h=e.panels.map(({id:w})=>w).join(",");let d=e.mutableState.defaultLayout;d&&(dX(e.panels,d)||(d=void 0));const m=e.mutableState.layouts[h]??d??Fk(u),g=na({layout:m,panelConstraints:u}),_=e.element.ownerDocument;ll.set(_,(ll.get(_)??0)+1);const b=new Map;return d5(e).forEach(w=>{w.separator&&b.set(w.separator,w.panels)}),gs(e,{defaultLayoutDeferred:l===0,derivedPanelConstraints:u,groupSize:l,layout:g,separatorToPanels:b}),e.separators.forEach(w=>{At(!s.has(w.id),`Separator ids must be unique; id "${w.id}" was used more than once`),s.add(w.id),w.element.addEventListener("keydown",Ak)}),ll.get(_)===1&&(_.addEventListener("dblclick",Nk,!0),_.addEventListener("pointerdown",Dk,!0),_.addEventListener("pointerleave",Pk),_.addEventListener("pointermove",Bk),_.addEventListener("pointerout",Ik),_.addEventListener("pointerup",Hk,!0)),function(){t=!1,ll.set(_,Math.max(0,(ll.get(_)??0)-1)),GY(e),e.separators.forEach(w=>{w.element.removeEventListener("keydown",Ak)}),ll.get(_)||(_.removeEventListener("dblclick",Nk,!0),_.removeEventListener("pointerdown",Dk,!0),_.removeEventListener("pointerleave",Pk),_.removeEventListener("pointermove",Bk),_.removeEventListener("pointerout",Ik),_.removeEventListener("pointerup",Hk,!0)),a.disconnect()}}function fX(){const[e,t]=y.useState({}),n=y.useCallback(()=>t({}),[]);return[e,n]}function V0(e){const t=y.useId();return`${e??t}`}const ga=typeof window<"u"?y.useLayoutEffect:y.useEffect;function Ru(e){const t=y.useRef(e);return ga(()=>{t.current=e},[e]),y.useCallback((...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[t])}function q0(...e){return Ru(t=>{e.forEach(n=>{if(n)switch(typeof n){case"function":{n(t);break}case"object":{n.current=t;break}}})})}function K0(e){const t=y.useRef({...e});return ga(()=>{for(const n in e)t.current[n]=e[n]},[e]),t.current}const w5=y.createContext(null);function pX(e,t){const n=y.useRef({getLayout:()=>({}),setLayout:oX});y.useImperativeHandle(t,()=>n.current,[]),ga(()=>{Object.assign(n.current,g5({groupId:e}))})}function S5({children:e,className:t,defaultLayout:n,disableCursor:r,disabled:s,elementRef:a,groupRef:l,id:u,onLayoutChange:h,onLayoutChanged:d,orientation:m="horizontal",resizeTargetMinimumSize:g={coarse:20,fine:10},style:_,...b}){const w=y.useRef({onLayoutChange:{},onLayoutChanged:{}}),S=Ru(H=>{ta(w.current.onLayoutChange,H)||(w.current.onLayoutChange=H,h==null||h(H))}),C=Ru(H=>{ta(w.current.onLayoutChanged,H)||(w.current.onLayoutChanged=H,d==null||d(H))}),k=V0(u),R=y.useRef(null),[T,N]=fX(),L=y.useRef({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:g,separators:[]}),A=q0(R,a);pX(k,l);const O=Ru((H,P)=>{const U=ra(),V=Ek(H),W=oo(H);if(W){let z=!1;switch(U.state){case"active":{z=U.hitRegions.some($=>$.group===V);break}}return{flexGrow:W.layout[P]??1,pointerEvents:z?"none":void 0}}return{flexGrow:(n==null?void 0:n[P])??1}}),F=K0({defaultLayout:n,disableCursor:r}),G=y.useMemo(()=>({get disableCursor(){return!!F.disableCursor},getPanelStyles:O,id:k,orientation:m,registerPanel:H=>{const P=L.current;return P.panels=cy(m,[...P.panels,H]),N(),()=>{P.panels=P.panels.filter(U=>U!==H),N()}},registerSeparator:H=>{const P=L.current;return P.separators=cy(m,[...P.separators,H]),N(),()=>{P.separators=P.separators.filter(U=>U!==H),N()}},togglePanelDisabled:(H,P)=>{const U=L.current.panels.find(z=>z.id===H);U&&(U.panelConstraints.disabled=P);const V=Ek(k),W=oo(k);V&&W&&gs(V,{...W,derivedPanelConstraints:ly(V)})},toggleSeparatorDisabled:(H,P)=>{const U=L.current.separators.find(V=>V.id===H);U&&(U.disabled=P)}}),[O,k,N,m,F]),B=y.useRef(null);return ga(()=>{const H=R.current;if(H===null)return;const P=L.current;let U;if(F.defaultLayout!==void 0&&Object.keys(F.defaultLayout).length===P.panels.length){U={};for(const M of P.panels){const I=F.defaultLayout[M.id];I!==void 0&&(U[M.id]=I)}}const V={disabled:!!s,element:H,id:k,mutableState:{defaultLayout:U,disableCursor:!!F.disableCursor,expandedPanelSizes:L.current.lastExpandedPanelSizes,layouts:L.current.layouts},orientation:m,panels:P.panels,resizeTargetMinimumSize:P.resizeTargetMinimumSize,separators:P.separators};B.current=V;const W=hX(V),{defaultLayoutDeferred:z,derivedPanelConstraints:$,layout:q}=oo(V.id,!0);!z&&$.length>0&&(S(q),C(q));const Q=F0(k,M=>{const{defaultLayoutDeferred:I,derivedPanelConstraints:Z,layout:j}=M.next;if(I||Z.length===0)return;const ce=V.panels.map(({id:ue})=>ue).join(",");V.mutableState.layouts[ce]=j,Z.forEach(ue=>{if(ue.collapsible){const{layout:de}=M.prev??{};if(de){const we=tr(ue.collapsedSize,j[ue.panelId]),oe=tr(ue.collapsedSize,de[ue.panelId]);we&&!oe&&(V.mutableState.expandedPanelSizes[ue.panelId]=de[ue.panelId])}}});const fe=ra().state!=="active";S(j),fe&&C(j)});return()=>{B.current=null,W(),Q()}},[s,k,C,S,m,T,F]),y.useEffect(()=>{const H=B.current;H&&(H.mutableState.defaultLayout=n,H.mutableState.disableCursor=!!r)}),p.jsx(w5.Provider,{value:G,children:p.jsx("div",{...b,className:t,"data-group":!0,"data-testid":k,id:k,ref:A,style:{height:"100%",width:"100%",overflow:"hidden",..._,display:"flex",flexDirection:m==="horizontal"?"row":"column",flexWrap:"nowrap",touchAction:m==="horizontal"?"pan-y":"pan-x"},children:e})})}S5.displayName="Group";function G0(){const e=y.useContext(w5);return At(e,"Group Context not found; did you render a Panel or Separator outside of a Group?"),e}function mX(e,t){const{id:n}=G0(),r=y.useRef({collapse:n_,expand:n_,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:n_});y.useImperativeHandle(t,()=>r.current,[]),ga(()=>{Object.assign(r.current,m5({groupId:n,panelId:e}))})}function C5({children:e,className:t,collapsedSize:n="0%",collapsible:r=!1,defaultSize:s,disabled:a,elementRef:l,groupResizeBehavior:u="preserve-relative-size",id:h,maxSize:d="100%",minSize:m="0%",onResize:g,panelRef:_,style:b,...w}){const S=!!h,C=V0(h),k=K0({disabled:a}),R=y.useRef(null),T=q0(R,l),{getPanelStyles:N,id:L,orientation:A,registerPanel:O,togglePanelDisabled:F}=G0(),G=g!==null,B=Ru((P,U,V)=>{g==null||g(P,h,V)});ga(()=>{const P=R.current;if(P!==null){const U={element:P,id:C,idIsStable:S,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:G?B:void 0,panelConstraints:{groupResizeBehavior:u,collapsedSize:n,collapsible:r,defaultSize:s,disabled:k.disabled,maxSize:d,minSize:m}};return O(U)}},[u,n,r,s,G,C,S,d,m,B,O,k]),y.useEffect(()=>{F(C,!!a)},[a,C,F]),mX(C,_);const H=y.useSyncExternalStore(P=>F0(L,P),()=>JSON.stringify(N(L,C)),()=>JSON.stringify(N(L,C)));return p.jsx("div",{...w,"aria-disabled":a||void 0,"data-panel":!0,"data-testid":C,id:C,ref:T,style:{...gX,display:"flex",flexBasis:0,flexShrink:1,overflow:"visible",...JSON.parse(H)},children:p.jsx("div",{className:t,style:{maxHeight:"100%",maxWidth:"100%",flexGrow:1,overflow:"auto",...b,touchAction:A==="horizontal"?"pan-y":"pan-x"},children:e})})}C5.displayName="Panel";const gX={minHeight:0,maxHeight:"100%",height:"auto",minWidth:0,maxWidth:"100%",width:"auto",border:"none",borderWidth:0,padding:0,margin:0};function vX({layout:e,panelConstraints:t,panelId:n,panelIndex:r}){let s,a;const l=e[n],u=t.find(h=>h.panelId===n);if(u){const h=u.maxSize,d=u.collapsible?u.collapsedSize:u.minSize,m=[r,r+1];a=na({layout:$u({delta:d-l,initialLayout:e,panelConstraints:t,pivotIndices:m,prevLayout:e}),panelConstraints:t})[n],s=na({layout:$u({delta:h-l,initialLayout:e,panelConstraints:t,pivotIndices:m,prevLayout:e}),panelConstraints:t})[n]}return{valueControls:n,valueMax:s,valueMin:a,valueNow:l}}function k5({children:e,className:t,disabled:n,elementRef:r,id:s,style:a,...l}){const u=V0(s),h=K0({disabled:n}),[d,m]=y.useState({}),[g,_]=y.useState("inactive"),b=y.useRef(null),w=q0(b,r),{disableCursor:S,id:C,orientation:k,registerSeparator:R,toggleSeparatorDisabled:T}=G0(),N=k==="horizontal"?"vertical":"horizontal";ga(()=>{const A=b.current;if(A!==null){const O={disabled:h.disabled,element:A,id:u},F=R(O),G=iX(H=>{_(H.next.state!=="inactive"&&H.next.hitRegions.some(P=>P.separator===O)?H.next.state:"inactive")}),B=F0(C,H=>{const{derivedPanelConstraints:P,layout:U,separatorToPanels:V}=H.next,W=V.get(O);if(W){const z=W[0],$=W.indexOf(z);m(vX({layout:U,panelConstraints:P,panelId:z.id,panelIndex:$}))}});return()=>{G(),B(),F()}}},[C,u,R,h]),y.useEffect(()=>{T(u,!!n)},[n,u,T]);let L;return n&&!S&&(L="not-allowed"),p.jsx("div",{...l,"aria-controls":d.valueControls,"aria-disabled":n||void 0,"aria-orientation":N,"aria-valuemax":d.valueMax,"aria-valuemin":d.valueMin,"aria-valuenow":d.valueNow,children:e,className:t,"data-separator":n?"disabled":g,"data-testid":u,id:u,ref:w,role:"separator",style:{flexBasis:"auto",cursor:L,...a,flexGrow:0,flexShrink:0,touchAction:"none"},tabIndex:n?void 0:0})}k5.displayName="Separator";const yf=({className:e,...t})=>p.jsx(S5,{className:ye("flex h-full w-full",e),...t}),$o=e=>p.jsx(C5,{...e}),bf=({withHandle:e,orientation:t,disabled:n,className:r,...s})=>p.jsx(k5,{disabled:n,className:ye("relative flex items-center justify-center bg-transparent focus-visible:outline-none",t==="vertical"?"h-2 w-full -my-1 cursor-row-resize before:absolute before:inset-x-0 before:top-1/2 before:h-0.5 before:-translate-y-1/2 before:bg-border":"h-full w-2 -mx-1 cursor-col-resize before:absolute before:inset-y-0 before:left-1/2 before:w-px before:-translate-x-1/2 before:bg-border",r),...s,children:p.jsx("span",{className:"sr-only",children:t==="vertical"?"Resize rows":"Resize columns"})});/**
|
|
558
|
-
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
559
|
-
* @license MIT
|
|
560
|
-
*
|
|
561
|
-
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
562
|
-
* @license MIT
|
|
563
|
-
*
|
|
564
|
-
* Originally forked from (with the author's permission):
|
|
565
|
-
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
566
|
-
* http://bellard.org/jslinux/
|
|
567
|
-
* Copyright (c) 2011 Fabrice Bellard
|
|
568
|
-
*/var Sn=0,Cn=0,kn=0,Gt=0,Vn;(e=>{function t(s,a,l,u){return u!==void 0?`#${Fo(s)}${Fo(a)}${Fo(l)}${Fo(u)}`:`#${Fo(s)}${Fo(a)}${Fo(l)}`}e.toCss=t;function n(s,a,l,u=255){return(s<<24|a<<16|l<<8|u)>>>0}e.toRgba=n;function r(s,a,l,u){return{css:e.toCss(s,a,l,u),rgba:e.toRgba(s,a,l,u)}}e.toColor=r})(Vn||(Vn={}));var _X;(e=>{function t(h,d){if(Gt=(d.rgba&255)/255,Gt===1)return{css:d.css,rgba:d.rgba};let m=d.rgba>>24&255,g=d.rgba>>16&255,_=d.rgba>>8&255,b=h.rgba>>24&255,w=h.rgba>>16&255,S=h.rgba>>8&255;Sn=b+Math.round((m-b)*Gt),Cn=w+Math.round((g-w)*Gt),kn=S+Math.round((_-S)*Gt);let C=Vn.toCss(Sn,Cn,kn),k=Vn.toRgba(Sn,Cn,kn);return{css:C,rgba:k}}e.blend=t;function n(h){return(h.rgba&255)===255}e.isOpaque=n;function r(h,d,m){let g=xf.ensureContrastRatio(h.rgba,d.rgba,m);if(g)return Vn.toColor(g>>24&255,g>>16&255,g>>8&255)}e.ensureContrastRatio=r;function s(h){let d=(h.rgba|255)>>>0;return[Sn,Cn,kn]=xf.toChannels(d),{css:Vn.toCss(Sn,Cn,kn),rgba:d}}e.opaque=s;function a(h,d){return Gt=Math.round(d*255),[Sn,Cn,kn]=xf.toChannels(h.rgba),{css:Vn.toCss(Sn,Cn,kn,Gt),rgba:Vn.toRgba(Sn,Cn,kn,Gt)}}e.opacity=a;function l(h,d){return Gt=h.rgba&255,a(h,Gt*d/255)}e.multiplyOpacity=l;function u(h){return[h.rgba>>24&255,h.rgba>>16&255,h.rgba>>8&255]}e.toColorRGB=u})(_X||(_X={}));var Hn;(e=>{let t,n;try{let s=document.createElement("canvas");s.width=1,s.height=1;let a=s.getContext("2d",{willReadFrequently:!0});a&&(t=a,t.globalCompositeOperation="copy",n=t.createLinearGradient(0,0,1,1))}catch{}function r(s){if(s.match(/#[\da-f]{3,8}/i))switch(s.length){case 4:return Sn=parseInt(s.slice(1,2).repeat(2),16),Cn=parseInt(s.slice(2,3).repeat(2),16),kn=parseInt(s.slice(3,4).repeat(2),16),Vn.toColor(Sn,Cn,kn);case 5:return Sn=parseInt(s.slice(1,2).repeat(2),16),Cn=parseInt(s.slice(2,3).repeat(2),16),kn=parseInt(s.slice(3,4).repeat(2),16),Gt=parseInt(s.slice(4,5).repeat(2),16),Vn.toColor(Sn,Cn,kn,Gt);case 7:return{css:s,rgba:(parseInt(s.slice(1),16)<<8|255)>>>0};case 9:return{css:s,rgba:parseInt(s.slice(1),16)>>>0}}let a=s.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(a)return Sn=parseInt(a[1]),Cn=parseInt(a[2]),kn=parseInt(a[3]),Gt=Math.round((a[5]===void 0?1:parseFloat(a[5]))*255),Vn.toColor(Sn,Cn,kn,Gt);if(!t||!n)throw new Error("css.toColor: Unsupported css format");if(t.fillStyle=n,t.fillStyle=s,typeof t.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(t.fillRect(0,0,1,1),[Sn,Cn,kn,Gt]=t.getImageData(0,0,1,1).data,Gt!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:Vn.toRgba(Sn,Cn,kn,Gt),css:s}}e.toColor=r})(Hn||(Hn={}));var Qn;(e=>{function t(r){return n(r>>16&255,r>>8&255,r&255)}e.relativeLuminance=t;function n(r,s,a){let l=r/255,u=s/255,h=a/255,d=l<=.03928?l/12.92:Math.pow((l+.055)/1.055,2.4),m=u<=.03928?u/12.92:Math.pow((u+.055)/1.055,2.4),g=h<=.03928?h/12.92:Math.pow((h+.055)/1.055,2.4);return d*.2126+m*.7152+g*.0722}e.relativeLuminance2=n})(Qn||(Qn={}));var xf;(e=>{function t(l,u){if(Gt=(u&255)/255,Gt===1)return u;let h=u>>24&255,d=u>>16&255,m=u>>8&255,g=l>>24&255,_=l>>16&255,b=l>>8&255;return Sn=g+Math.round((h-g)*Gt),Cn=_+Math.round((d-_)*Gt),kn=b+Math.round((m-b)*Gt),Vn.toRgba(Sn,Cn,kn)}e.blend=t;function n(l,u,h){let d=Qn.relativeLuminance(l>>8),m=Qn.relativeLuminance(u>>8);if(as(d,m)<h){if(m<d){let b=r(l,u,h),w=as(d,Qn.relativeLuminance(b>>8));if(w<h){let S=s(l,u,h),C=as(d,Qn.relativeLuminance(S>>8));return w>C?b:S}return b}let g=s(l,u,h),_=as(d,Qn.relativeLuminance(g>>8));if(_<h){let b=r(l,u,h),w=as(d,Qn.relativeLuminance(b>>8));return _>w?g:b}return g}}e.ensureContrastRatio=n;function r(l,u,h){let d=l>>24&255,m=l>>16&255,g=l>>8&255,_=u>>24&255,b=u>>16&255,w=u>>8&255,S=as(Qn.relativeLuminance2(_,b,w),Qn.relativeLuminance2(d,m,g));for(;S<h&&(_>0||b>0||w>0);)_-=Math.max(0,Math.ceil(_*.1)),b-=Math.max(0,Math.ceil(b*.1)),w-=Math.max(0,Math.ceil(w*.1)),S=as(Qn.relativeLuminance2(_,b,w),Qn.relativeLuminance2(d,m,g));return(_<<24|b<<16|w<<8|255)>>>0}e.reduceLuminance=r;function s(l,u,h){let d=l>>24&255,m=l>>16&255,g=l>>8&255,_=u>>24&255,b=u>>16&255,w=u>>8&255,S=as(Qn.relativeLuminance2(_,b,w),Qn.relativeLuminance2(d,m,g));for(;S<h&&(_<255||b<255||w<255);)_=Math.min(255,_+Math.ceil((255-_)*.1)),b=Math.min(255,b+Math.ceil((255-b)*.1)),w=Math.min(255,w+Math.ceil((255-w)*.1)),S=as(Qn.relativeLuminance2(_,b,w),Qn.relativeLuminance2(d,m,g));return(_<<24|b<<16|w<<8|255)>>>0}e.increaseLuminance=s;function a(l){return[l>>24&255,l>>16&255,l>>8&255,l&255]}e.toChannels=a})(xf||(xf={}));function Fo(e){let t=e.toString(16);return t.length<2?"0"+t:t}function as(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}var yX=Object.freeze((()=>{let e=[Hn.toColor("#2e3436"),Hn.toColor("#cc0000"),Hn.toColor("#4e9a06"),Hn.toColor("#c4a000"),Hn.toColor("#3465a4"),Hn.toColor("#75507b"),Hn.toColor("#06989a"),Hn.toColor("#d3d7cf"),Hn.toColor("#555753"),Hn.toColor("#ef2929"),Hn.toColor("#8ae234"),Hn.toColor("#fce94f"),Hn.toColor("#729fcf"),Hn.toColor("#ad7fa8"),Hn.toColor("#34e2e2"),Hn.toColor("#eeeeec")],t=[0,95,135,175,215,255];for(let n=0;n<216;n++){let r=t[n/36%6|0],s=t[n/6%6|0],a=t[n%6];e.push({css:Vn.toCss(r,s,a),rgba:Vn.toRgba(r,s,a)})}for(let n=0;n<24;n++){let r=8+n*10;e.push({css:Vn.toCss(r,r,r),rgba:Vn.toRgba(r,r,r)})}return e})());function Uk(e,t,n){return Math.max(t,Math.min(e,n))}function bX(e){switch(e){case"&":return"&";case"<":return"<"}return e}var E5=class{constructor(t){this._buffer=t}serialize(t,n){let r=this._buffer.getNullCell(),s=this._buffer.getNullCell(),a=r,l=t.start.y,u=t.end.y,h=t.start.x,d=t.end.x;this._beforeSerialize(u-l,l,u);for(let m=l;m<=u;m++){let g=this._buffer.getLine(m);if(g){let _=m===t.start.y?h:0,b=m===t.end.y?d:g.length;for(let w=_;w<b;w++){let S=g.getCell(w,a===r?s:r);if(!S){console.warn(`Can't get cell at row=${m}, col=${w}`);continue}this._nextCell(S,a,m,w),a=S}}this._rowEnd(m,m===u)}return this._afterSerialize(),this._serializeString(n)}_nextCell(t,n,r,s){}_rowEnd(t,n){}_beforeSerialize(t,n,r){}_afterSerialize(){}_serializeString(t){return""}};function R5(e,t){return e.getFgColorMode()===t.getFgColorMode()&&e.getFgColor()===t.getFgColor()}function cs(e,t){return e.getBgColorMode()===t.getBgColorMode()&&e.getBgColor()===t.getBgColor()}function T5(e,t){return e.isInverse()===t.isInverse()&&e.isBold()===t.isBold()&&e.isUnderline()===t.isUnderline()&&e.isOverline()===t.isOverline()&&e.isBlink()===t.isBlink()&&e.isInvisible()===t.isInvisible()&&e.isItalic()===t.isItalic()&&e.isDim()===t.isDim()&&e.isStrikethrough()===t.isStrikethrough()}var xX=class extends E5{constructor(t,n){super(t),this._terminal=n,this._rowIndex=0,this._allRows=new Array,this._allRowSeparators=new Array,this._currentRow="",this._nullCellCount=0,this._cursorStyle=this._buffer.getNullCell(),this._cursorStyleRow=0,this._cursorStyleCol=0,this._backgroundCell=this._buffer.getNullCell(),this._firstRow=0,this._lastCursorRow=0,this._lastCursorCol=0,this._lastContentCursorRow=0,this._lastContentCursorCol=0,this._thisRowLastChar=this._buffer.getNullCell(),this._thisRowLastSecondChar=this._buffer.getNullCell(),this._nextRowFirstChar=this._buffer.getNullCell()}_beforeSerialize(t,n,r){this._allRows=new Array(t),this._lastContentCursorRow=n,this._lastCursorRow=n,this._firstRow=n}_rowEnd(t,n){var s;this._nullCellCount>0&&!cs(this._cursorStyle,this._backgroundCell)&&(this._currentRow+=`\x1B[${this._nullCellCount}X`);let r="";if(!n){t-this._firstRow>=this._terminal.rows&&((s=this._buffer.getLine(this._cursorStyleRow))==null||s.getCell(this._cursorStyleCol,this._backgroundCell));let a=this._buffer.getLine(t),l=this._buffer.getLine(t+1);if(!l.isWrapped)r=`\r
|
|
569
|
-
`,this._lastCursorRow=t+1,this._lastCursorCol=0;else{r="";let u=a.getCell(a.length-1,this._thisRowLastChar),h=a.getCell(a.length-2,this._thisRowLastSecondChar),d=l.getCell(0,this._nextRowFirstChar),m=d.getWidth()>1,g=!1;(d.getChars()&&m?this._nullCellCount<=1:this._nullCellCount<=0)&&((u.getChars()||u.getWidth()===0)&&cs(u,d)&&(g=!0),m&&(h.getChars()||h.getWidth()===0)&&cs(u,d)&&cs(h,d)&&(g=!0)),g||(r="-".repeat(this._nullCellCount+1),r+="\x1B[1D\x1B[1X",this._nullCellCount>0&&(r+="\x1B[A",r+=`\x1B[${a.length-this._nullCellCount}C`,r+=`\x1B[${this._nullCellCount}X`,r+=`\x1B[${a.length-this._nullCellCount}D`,r+="\x1B[B"),this._lastContentCursorRow=t+1,this._lastContentCursorCol=0,this._lastCursorRow=t+1,this._lastCursorCol=0)}}this._allRows[this._rowIndex]=this._currentRow,this._allRowSeparators[this._rowIndex++]=r,this._currentRow="",this._nullCellCount=0}_diffStyle(t,n){let r=[],s=!R5(t,n),a=!cs(t,n),l=!T5(t,n);if(s||a||l)if(t.isAttributeDefault())n.isAttributeDefault()||r.push(0);else{if(s){let u=t.getFgColor();t.isFgRGB()?r.push(38,2,u>>>16&255,u>>>8&255,u&255):t.isFgPalette()?u>=16?r.push(38,5,u):r.push(u&8?90+(u&7):30+(u&7)):r.push(39)}if(a){let u=t.getBgColor();t.isBgRGB()?r.push(48,2,u>>>16&255,u>>>8&255,u&255):t.isBgPalette()?u>=16?r.push(48,5,u):r.push(u&8?100+(u&7):40+(u&7)):r.push(49)}l&&(t.isInverse()!==n.isInverse()&&r.push(t.isInverse()?7:27),t.isBold()!==n.isBold()&&r.push(t.isBold()?1:22),t.isUnderline()!==n.isUnderline()&&r.push(t.isUnderline()?4:24),t.isOverline()!==n.isOverline()&&r.push(t.isOverline()?53:55),t.isBlink()!==n.isBlink()&&r.push(t.isBlink()?5:25),t.isInvisible()!==n.isInvisible()&&r.push(t.isInvisible()?8:28),t.isItalic()!==n.isItalic()&&r.push(t.isItalic()?3:23),t.isDim()!==n.isDim()&&r.push(t.isDim()?2:22),t.isStrikethrough()!==n.isStrikethrough()&&r.push(t.isStrikethrough()?9:29))}return r}_nextCell(t,n,r,s){if(t.getWidth()===0)return;let a=t.getChars()==="",l=this._diffStyle(t,this._cursorStyle);if(a?!cs(this._cursorStyle,t):l.length>0){this._nullCellCount>0&&(cs(this._cursorStyle,this._backgroundCell)||(this._currentRow+=`\x1B[${this._nullCellCount}X`),this._currentRow+=`\x1B[${this._nullCellCount}C`,this._nullCellCount=0),this._lastContentCursorRow=this._lastCursorRow=r,this._lastContentCursorCol=this._lastCursorCol=s,this._currentRow+=`\x1B[${l.join(";")}m`;let u=this._buffer.getLine(r);u!==void 0&&(u.getCell(s,this._cursorStyle),this._cursorStyleRow=r,this._cursorStyleCol=s)}a?this._nullCellCount+=t.getWidth():(this._nullCellCount>0&&(cs(this._cursorStyle,this._backgroundCell)?this._currentRow+=`\x1B[${this._nullCellCount}C`:(this._currentRow+=`\x1B[${this._nullCellCount}X`,this._currentRow+=`\x1B[${this._nullCellCount}C`),this._nullCellCount=0),this._currentRow+=t.getChars(),this._lastContentCursorRow=this._lastCursorRow=r,this._lastContentCursorCol=this._lastCursorCol=s+t.getWidth())}_serializeString(t){let n=this._allRows.length;this._buffer.length-this._firstRow<=this._terminal.rows&&(n=this._lastContentCursorRow+1-this._firstRow,this._lastCursorCol=this._lastContentCursorCol,this._lastCursorRow=this._lastContentCursorRow);let r="";for(let l=0;l<n;l++)r+=this._allRows[l],l+1<n&&(r+=this._allRowSeparators[l]);if(!t){let l=this._buffer.baseY+this._buffer.cursorY,u=this._buffer.cursorX,h=l!==this._lastCursorRow||u!==this._lastCursorCol,d=m=>{m>0?r+=`\x1B[${m}C`:m<0&&(r+=`\x1B[${-m}D`)};h&&((m=>{m>0?r+=`\x1B[${m}B`:m<0&&(r+=`\x1B[${-m}A`)})(l-this._lastCursorRow),d(u-this._lastCursorCol))}let s=this._terminal._core._inputHandler._curAttrData,a=this._diffStyle(s,this._cursorStyle);return a.length>0&&(r+=`\x1B[${a.join(";")}m`),r}},wX=class{activate(t){this._terminal=t}_serializeBufferByScrollback(t,n,r){let s=n.length,a=r===void 0?s:Uk(r+t.rows,0,s);return this._serializeBufferByRange(t,n,{start:s-a,end:s-1},!1)}_serializeBufferByRange(t,n,r,s){return new xX(n,t).serialize({start:{x:0,y:typeof r.start=="number"?r.start:r.start.line},end:{x:t.cols,y:typeof r.end=="number"?r.end:r.end.line}},s)}_serializeBufferAsHTML(t,n){var h;let r=t.buffer.active,s=new SX(r,t,n),a=n.onlySelection??!1,l=n.range;if(l)return s.serialize({start:{x:l.startCol,y:(l.startLine,l.startLine)},end:{x:t.cols,y:(l.endLine,l.endLine)}});if(!a){let d=r.length,m=n.scrollback,g=m===void 0?d:Uk(m+t.rows,0,d);return s.serialize({start:{x:0,y:d-g},end:{x:t.cols,y:d-1}})}let u=(h=this._terminal)==null?void 0:h.getSelectionPosition();return u!==void 0?s.serialize({start:{x:u.start.x,y:u.start.y},end:{x:u.end.x,y:u.end.y}}):""}_serializeModes(t){let n="",r=t.modes;if(r.applicationCursorKeysMode&&(n+="\x1B[?1h"),r.applicationKeypadMode&&(n+="\x1B[?66h"),r.bracketedPasteMode&&(n+="\x1B[?2004h"),r.insertMode&&(n+="\x1B[4h"),r.originMode&&(n+="\x1B[?6h"),r.reverseWraparoundMode&&(n+="\x1B[?45h"),r.sendFocusMode&&(n+="\x1B[?1004h"),r.wraparoundMode===!1&&(n+="\x1B[?7l"),r.mouseTrackingMode!=="none")switch(r.mouseTrackingMode){case"x10":n+="\x1B[?9h";break;case"vt200":n+="\x1B[?1000h";break;case"drag":n+="\x1B[?1002h";break;case"any":n+="\x1B[?1003h";break}return n}serialize(t){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");let n=t!=null&&t.range?this._serializeBufferByRange(this._terminal,this._terminal.buffer.normal,t.range,!0):this._serializeBufferByScrollback(this._terminal,this._terminal.buffer.normal,t==null?void 0:t.scrollback);if(!(t!=null&&t.excludeAltBuffer)&&this._terminal.buffer.active.type==="alternate"){let r=this._serializeBufferByScrollback(this._terminal,this._terminal.buffer.alternate,void 0);n+=`\x1B[?1049h\x1B[H${r}`}return t!=null&&t.excludeModes||(n+=this._serializeModes(this._terminal)),n}serializeAsHTML(t){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");return this._serializeBufferAsHTML(this._terminal,t||{})}dispose(){}},SX=class extends E5{constructor(t,n,r){super(t),this._terminal=n,this._options=r,this._currentRow="",this._htmlContent="",n._core._themeService?this._ansiColors=n._core._themeService.colors.ansi:this._ansiColors=yX}_padStart(t,n,r){return n=n>>0,r=r??" ",t.length>n?t:(n-=t.length,n>r.length&&(r+=r.repeat(n/r.length)),r.slice(0,n)+t)}_beforeSerialize(t,n,r){var u,h;this._htmlContent+="<html><body><!--StartFragment--><pre>";let s="#000000",a="#ffffff";(this._options.includeGlobalBackground??!1)&&(s=((u=this._terminal.options.theme)==null?void 0:u.foreground)??"#ffffff",a=((h=this._terminal.options.theme)==null?void 0:h.background)??"#000000");let l=[];l.push("color: "+s+";"),l.push("background-color: "+a+";"),l.push("font-family: "+this._terminal.options.fontFamily+";"),l.push("font-size: "+this._terminal.options.fontSize+"px;"),this._htmlContent+="<div style='"+l.join(" ")+"'>"}_afterSerialize(){this._htmlContent+="</div>",this._htmlContent+="</pre><!--EndFragment--></body></html>"}_rowEnd(t,n){this._htmlContent+="<div><span>"+this._currentRow+"</span></div>",this._currentRow=""}_getHexColor(t,n){let r=n?t.getFgColor():t.getBgColor();if(n?t.isFgRGB():t.isBgRGB())return"#"+[r>>16&255,r>>8&255,r&255].map(s=>this._padStart(s.toString(16),2,"0")).join("");if(n?t.isFgPalette():t.isBgPalette())return this._ansiColors[r].css}_diffStyle(t,n){let r=[],s=!R5(t,n),a=!cs(t,n),l=!T5(t,n);if(s||a||l){let u=this._getHexColor(t,!0);u&&r.push("color: "+u+";");let h=this._getHexColor(t,!1);return h&&r.push("background-color: "+h+";"),t.isInverse()&&r.push("color: #000000; background-color: #BFBFBF;"),t.isBold()&&r.push("font-weight: bold;"),t.isUnderline()&&t.isOverline()?r.push("text-decoration: overline underline;"):t.isUnderline()?r.push("text-decoration: underline;"):t.isOverline()&&r.push("text-decoration: overline;"),t.isBlink()&&r.push("text-decoration: blink;"),t.isInvisible()&&r.push("visibility: hidden;"),t.isItalic()&&r.push("font-style: italic;"),t.isDim()&&r.push("opacity: 0.5;"),t.isStrikethrough()&&r.push("text-decoration: line-through;"),r}}_nextCell(t,n,r,s){if(t.getWidth()===0)return;let a=t.getChars()==="",l=this._diffStyle(t,n);l&&(this._currentRow+=l.length===0?"</span><span>":"</span><span style='"+l.join(" ")+"'>"),a?this._currentRow+=" ":this._currentRow+=bX(t.getChars())}_serializeString(){return this._htmlContent}};/**
|
|
570
|
-
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
571
|
-
* @license MIT
|
|
572
|
-
*
|
|
573
|
-
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
574
|
-
* @license MIT
|
|
575
|
-
*
|
|
576
|
-
* Originally forked from (with the author's permission):
|
|
577
|
-
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
578
|
-
* http://bellard.org/jslinux/
|
|
579
|
-
* Copyright (c) 2011 Fabrice Bellard
|
|
580
|
-
*/var CX=class{constructor(t,n,r,s={}){this._terminal=t,this._regex=n,this._handler=r,this._options=s}provideLinks(t,n){let r=EX.computeLink(t,this._regex,this._terminal,this._handler);n(this._addCallbacks(r))}_addCallbacks(t){return t.map(n=>(n.leave=this._options.leave,n.hover=(r,s)=>{if(this._options.hover){let{range:a}=n;this._options.hover(r,s,a)}},n))}};function kX(e){try{let t=new URL(e),n=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(n.toLocaleLowerCase())}catch{return!1}}var EX=class wf{static computeLink(t,n,r,s){let a=new RegExp(n.source,(n.flags||"")+"g"),[l,u]=wf._getWindowedLineStrings(t-1,r),h=l.join(""),d,m=[];for(;d=a.exec(h);){let g=d[0];if(!kX(g))continue;let[_,b]=wf._mapStrIdx(r,u,0,d.index),[w,S]=wf._mapStrIdx(r,_,b,g.length);if(_===-1||b===-1||w===-1||S===-1)continue;let C={start:{x:b+1,y:_+1},end:{x:S,y:w+1}};m.push({range:C,text:g,activate:s})}return m}static _getWindowedLineStrings(t,n){let r,s=t,a=t,l=0,u="",h=[];if(r=n.buffer.active.getLine(t)){let d=r.translateToString(!0);if(r.isWrapped&&d[0]!==" "){for(l=0;(r=n.buffer.active.getLine(--s))&&l<2048&&(u=r.translateToString(!0),l+=u.length,h.push(u),!(!r.isWrapped||u.indexOf(" ")!==-1)););h.reverse()}for(h.push(d),l=0;(r=n.buffer.active.getLine(++a))&&r.isWrapped&&l<2048&&(u=r.translateToString(!0),l+=u.length,h.push(u),u.indexOf(" ")===-1););}return[h,s]}static _mapStrIdx(t,n,r,s){let a=t.buffer.active,l=a.getNullCell(),u=r;for(;s;){let h=a.getLine(n);if(!h)return[-1,-1];for(let d=u;d<h.length;++d){h.getCell(d,l);let m=l.getChars();if(l.getWidth()&&(s-=m.length||1,d===h.length-1&&m==="")){let g=a.getLine(n+1);g&&g.isWrapped&&(g.getCell(0,l),l.getWidth()===2&&(s+=1))}if(s<0)return[n,d]}n++,u=0}return[n,u]}},RX=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function TX(e,t){let n=window.open();if(n){try{n.opener=null}catch{}n.location.href=t}else console.warn("Opening link blocked as opener could not be cleared")}var MX=class{constructor(t=TX,n={}){this._handler=t,this._options=n}activate(t){this._terminal=t;let n=this._options,r=n.urlRegex||RX;this._linkProvider=this._terminal.registerLinkProvider(new CX(this._terminal,r,this._handler,n))}dispose(){var t;(t=this._linkProvider)==null||t.dispose()}};/**
|
|
581
|
-
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
582
|
-
* @license MIT
|
|
583
|
-
*
|
|
584
|
-
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
585
|
-
* @license MIT
|
|
586
|
-
*
|
|
587
|
-
* Originally forked from (with the author's permission):
|
|
588
|
-
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
589
|
-
* http://bellard.org/jslinux/
|
|
590
|
-
* Copyright (c) 2011 Fabrice Bellard
|
|
591
|
-
*/var M5=Object.defineProperty,NX=Object.getOwnPropertyDescriptor,AX=(e,t)=>{for(var n in t)M5(e,n,{get:t[n],enumerable:!0})},Xt=(e,t,n,r)=>{for(var s=r>1?void 0:r?NX(t,n):t,a=e.length-1,l;a>=0;a--)(l=e[a])&&(s=(r?l(t,n,s):l(s))||s);return r&&s&&M5(t,n,s),s},Me=(e,t)=>(n,r)=>t(n,r,e),$k="Terminal input",uy={get:()=>$k,set:e=>$k=e},Wk="Too much output to announce, navigate to rows manually to read",dy={get:()=>Wk,set:e=>Wk=e};function DX(e){return e.replace(/\r?\n/g,"\r")}function OX(e,t){return t?"\x1B[200~"+e+"\x1B[201~":e}function jX(e,t){e.clipboardData&&e.clipboardData.setData("text/plain",t.selectionText),e.preventDefault()}function LX(e,t,n,r){if(e.stopPropagation(),e.clipboardData){let s=e.clipboardData.getData("text/plain");N5(s,t,n,r)}}function N5(e,t,n,r){e=DX(e),e=OX(e,n.decPrivateModes.bracketedPasteMode&&r.rawOptions.ignoreBracketedPasteMode!==!0),n.triggerDataEvent(e,!0),t.value=""}function A5(e,t,n){let r=n.getBoundingClientRect(),s=e.clientX-r.left-10,a=e.clientY-r.top-10;t.style.width="20px",t.style.height="20px",t.style.left=`${s}px`,t.style.top=`${a}px`,t.style.zIndex="1000",t.focus()}function Vk(e,t,n,r,s){A5(e,t,n),s&&r.rightClickSelect(e),t.value=r.selectionText,t.select()}function to(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function Wp(e,t=0,n=e.length){let r="";for(let s=t;s<n;++s){let a=e[s];a>65535?(a-=65536,r+=String.fromCharCode((a>>10)+55296)+String.fromCharCode(a%1024+56320)):r+=String.fromCharCode(a)}return r}var zX=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let n=e.length;if(!n)return 0;let r=0,s=0;if(this._interim){let a=e.charCodeAt(s++);56320<=a&&a<=57343?t[r++]=(this._interim-55296)*1024+a-56320+65536:(t[r++]=this._interim,t[r++]=a),this._interim=0}for(let a=s;a<n;++a){let l=e.charCodeAt(a);if(55296<=l&&l<=56319){if(++a>=n)return this._interim=l,r;let u=e.charCodeAt(a);56320<=u&&u<=57343?t[r++]=(l-55296)*1024+u-56320+65536:(t[r++]=l,t[r++]=u);continue}l!==65279&&(t[r++]=l)}return r}},PX=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let n=e.length;if(!n)return 0;let r=0,s,a,l,u,h=0,d=0;if(this.interim[0]){let _=!1,b=this.interim[0];b&=(b&224)===192?31:(b&240)===224?15:7;let w=0,S;for(;(S=this.interim[++w]&63)&&w<4;)b<<=6,b|=S;let C=(this.interim[0]&224)===192?2:(this.interim[0]&240)===224?3:4,k=C-w;for(;d<k;){if(d>=n)return 0;if(S=e[d++],(S&192)!==128){d--,_=!0;break}else this.interim[w++]=S,b<<=6,b|=S&63}_||(C===2?b<128?d--:t[r++]=b:C===3?b<2048||b>=55296&&b<=57343||b===65279||(t[r++]=b):b<65536||b>1114111||(t[r++]=b)),this.interim.fill(0)}let m=n-4,g=d;for(;g<n;){for(;g<m&&!((s=e[g])&128)&&!((a=e[g+1])&128)&&!((l=e[g+2])&128)&&!((u=e[g+3])&128);)t[r++]=s,t[r++]=a,t[r++]=l,t[r++]=u,g+=4;if(s=e[g++],s<128)t[r++]=s;else if((s&224)===192){if(g>=n)return this.interim[0]=s,r;if(a=e[g++],(a&192)!==128){g--;continue}if(h=(s&31)<<6|a&63,h<128){g--;continue}t[r++]=h}else if((s&240)===224){if(g>=n)return this.interim[0]=s,r;if(a=e[g++],(a&192)!==128){g--;continue}if(g>=n)return this.interim[0]=s,this.interim[1]=a,r;if(l=e[g++],(l&192)!==128){g--;continue}if(h=(s&15)<<12|(a&63)<<6|l&63,h<2048||h>=55296&&h<=57343||h===65279)continue;t[r++]=h}else if((s&248)===240){if(g>=n)return this.interim[0]=s,r;if(a=e[g++],(a&192)!==128){g--;continue}if(g>=n)return this.interim[0]=s,this.interim[1]=a,r;if(l=e[g++],(l&192)!==128){g--;continue}if(g>=n)return this.interim[0]=s,this.interim[1]=a,this.interim[2]=l,r;if(u=e[g++],(u&192)!==128){g--;continue}if(h=(s&7)<<18|(a&63)<<12|(l&63)<<6|u&63,h<65536||h>1114111)continue;t[r++]=h}}return r}},D5="",so=" ",hd=class O5{constructor(){this.fg=0,this.bg=0,this.extended=new tp}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 O5;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}},tp=class j5{constructor(t=0,n=0){this._ext=0,this._urlId=0,this._ext=t,this._urlId=n}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 j5(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},Qr=class L5 extends hd{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new tp,this.combinedData=""}static fromCharData(t){let n=new L5;return n.setFromCharData(t),n}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?to(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 n=!1;if(t[1].length>2)n=!0;else if(t[1].length===2){let r=t[1].charCodeAt(0);if(55296<=r&&r<=56319){let s=t[1].charCodeAt(1);56320<=s&&s<=57343?this.content=(r-55296)*1024+s-56320+65536|t[2]<<22:n=!0}else n=!0}else this.content=t[1].charCodeAt(0)|t[2]<<22;n&&(this.combinedData=t[1],this.content=2097152|t[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},qk="di$target",hy="di$dependencies",r_=new Map;function BX(e){return e[hy]||[]}function Mn(e){if(r_.has(e))return r_.get(e);let t=function(n,r,s){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");IX(t,n,s)};return t._id=e,r_.set(e,t),t}function IX(e,t,n){t[qk]===t?t[hy].push({id:e,index:n}):(t[hy]=[{id:e,index:n}],t[qk]=t)}var ir=Mn("BufferService"),z5=Mn("CoreMouseService"),va=Mn("CoreService"),HX=Mn("CharsetService"),Y0=Mn("InstantiationService"),P5=Mn("LogService"),sr=Mn("OptionsService"),B5=Mn("OscLinkService"),FX=Mn("UnicodeService"),fd=Mn("DecorationService"),fy=class{constructor(e,t,n){this._bufferService=e,this._optionsService=t,this._oscLinkService=n}provideLinks(e,t){var m;let n=this._bufferService.buffer.lines.get(e-1);if(!n){t(void 0);return}let r=[],s=this._optionsService.rawOptions.linkHandler,a=new Qr,l=n.getTrimmedLength(),u=-1,h=-1,d=!1;for(let g=0;g<l;g++)if(!(h===-1&&!n.hasContent(g))){if(n.loadCell(g,a),a.hasExtendedAttrs()&&a.extended.urlId)if(h===-1){h=g,u=a.extended.urlId;continue}else d=a.extended.urlId!==u;else h!==-1&&(d=!0);if(d||h!==-1&&g===l-1){let _=(m=this._oscLinkService.getLinkData(u))==null?void 0:m.uri;if(_){let b={start:{x:h+1,y:e},end:{x:g+(!d&&g===l-1?1:0),y:e}},w=!1;if(!(s!=null&&s.allowNonHttpProtocols))try{let S=new URL(_);["http:","https:"].includes(S.protocol)||(w=!0)}catch{w=!0}w||r.push({text:_,range:b,activate:(S,C)=>s?s.activate(S,C,b):UX(S,C),hover:(S,C)=>{var k;return(k=s==null?void 0:s.hover)==null?void 0:k.call(s,S,C,b)},leave:(S,C)=>{var k;return(k=s==null?void 0:s.leave)==null?void 0:k.call(s,S,C,b)}})}d=!1,a.hasExtendedAttrs()&&a.extended.urlId?(h=g,u=a.extended.urlId):(h=-1,u=-1)}}t(r)}};fy=Xt([Me(0,ir),Me(1,sr),Me(2,B5)],fy);function UX(e,t){if(confirm(`Do you want to navigate to ${t}?
|
|
592
|
-
|
|
593
|
-
WARNING: This link could potentially be dangerous`)){let n=window.open();if(n){try{n.opener=null}catch{}n.location.href=t}else console.warn("Opening link blocked as opener could not be cleared")}}var Vp=Mn("CharSizeService"),bs=Mn("CoreBrowserService"),X0=Mn("MouseService"),xs=Mn("RenderService"),$X=Mn("SelectionService"),I5=Mn("CharacterJoinerService"),Yl=Mn("ThemeService"),H5=Mn("LinkProviderService"),WX=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?Kk.isErrorNoTelemetry(e)?new Kk(e.message+`
|
|
594
|
-
|
|
595
|
-
`+e.stack):new Error(e.message+`
|
|
596
|
-
|
|
597
|
-
`+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)}},VX=new WX;function Sf(e){qX(e)||VX.onUnexpectedError(e)}var py="Canceled";function qX(e){return e instanceof KX?!0:e instanceof Error&&e.name===py&&e.message===py}var KX=class extends Error{constructor(){super(py),this.name=this.message}};function GX(e){return new Error(`Illegal argument: ${e}`)}var Kk=class my extends Error{constructor(t){super(t),this.name="CodeExpectedError"}static fromError(t){if(t instanceof my)return t;let n=new my;return n.message=t.message,n.stack=t.stack,n}static isErrorNoTelemetry(t){return t.name==="CodeExpectedError"}},gy=class F5 extends Error{constructor(t){super(t||"An unexpected bug occurred."),Object.setPrototypeOf(this,F5.prototype)}};function kr(e,t=0){return e[e.length-(1+t)]}var YX;(e=>{function t(a){return a<0}e.isLessThan=t;function n(a){return a<=0}e.isLessThanOrEqual=n;function r(a){return a>0}e.isGreaterThan=r;function s(a){return a===0}e.isNeitherLessOrGreaterThan=s,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(YX||(YX={}));function XX(e,t){let n=this,r=!1,s;return function(){return r||(r=!0,t||(s=e.apply(n,arguments))),s}}var U5;(e=>{function t(N){return N&&typeof N=="object"&&typeof N[Symbol.iterator]=="function"}e.is=t;let n=Object.freeze([]);function r(){return n}e.empty=r;function*s(N){yield N}e.single=s;function a(N){return t(N)?N:s(N)}e.wrap=a;function l(N){return N||n}e.from=l;function*u(N){for(let L=N.length-1;L>=0;L--)yield N[L]}e.reverse=u;function h(N){return!N||N[Symbol.iterator]().next().done===!0}e.isEmpty=h;function d(N){return N[Symbol.iterator]().next().value}e.first=d;function m(N,L){let A=0;for(let O of N)if(L(O,A++))return!0;return!1}e.some=m;function g(N,L){for(let A of N)if(L(A))return A}e.find=g;function*_(N,L){for(let A of N)L(A)&&(yield A)}e.filter=_;function*b(N,L){let A=0;for(let O of N)yield L(O,A++)}e.map=b;function*w(N,L){let A=0;for(let O of N)yield*L(O,A++)}e.flatMap=w;function*S(...N){for(let L of N)yield*L}e.concat=S;function C(N,L,A){let O=A;for(let F of N)O=L(O,F);return O}e.reduce=C;function*k(N,L,A=N.length){for(L<0&&(L+=N.length),A<0?A+=N.length:A>N.length&&(A=N.length);L<A;L++)yield N[L]}e.slice=k;function R(N,L=Number.POSITIVE_INFINITY){let A=[];if(L===0)return[A,N];let O=N[Symbol.iterator]();for(let F=0;F<L;F++){let G=O.next();if(G.done)return[A,e.empty()];A.push(G.value)}return[A,{[Symbol.iterator](){return O}}]}e.consume=R;async function T(N){let L=[];for await(let A of N)L.push(A);return Promise.resolve(L)}e.asyncToArray=T})(U5||(U5={}));function ia(e){if(U5.is(e)){let t=[];for(let n of e)if(n)try{n.dispose()}catch(r){t.push(r)}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 ZX(...e){return $t(()=>ia(e))}function $t(e){return{dispose:XX(()=>{e()})}}var $5=class W5{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{ia(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?W5.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)}};$5.DISABLE_DISPOSED_WARNING=!1;var ao=$5,Je=class{constructor(){this._store=new ao,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)}};Je.None=Object.freeze({dispose(){}});var Ol=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}},us=typeof window=="object"?window:globalThis,vy=class _y{constructor(t){this.element=t,this.next=_y.Undefined,this.prev=_y.Undefined}};vy.Undefined=new vy(void 0);var Wt=vy,Gk=class{constructor(){this._first=Wt.Undefined,this._last=Wt.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===Wt.Undefined}clear(){let e=this._first;for(;e!==Wt.Undefined;){let t=e.next;e.prev=Wt.Undefined,e.next=Wt.Undefined,e=t}this._first=Wt.Undefined,this._last=Wt.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let n=new Wt(e);if(this._first===Wt.Undefined)this._first=n,this._last=n;else if(t){let s=this._last;this._last=n,n.prev=s,s.next=n}else{let s=this._first;this._first=n,n.next=s,s.prev=n}this._size+=1;let r=!1;return()=>{r||(r=!0,this._remove(n))}}shift(){if(this._first!==Wt.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==Wt.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==Wt.Undefined&&e.next!==Wt.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===Wt.Undefined&&e.next===Wt.Undefined?(this._first=Wt.Undefined,this._last=Wt.Undefined):e.next===Wt.Undefined?(this._last=this._last.prev,this._last.next=Wt.Undefined):e.prev===Wt.Undefined&&(this._first=this._first.next,this._first.prev=Wt.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==Wt.Undefined;)yield e.element,e=e.next}},QX=globalThis.performance&&typeof globalThis.performance.now=="function",JX=class V5{static create(t){return new V5(t)}constructor(t){this._now=QX&&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}},Un;(e=>{e.None=()=>Je.None;function t(P,U){return g(P,()=>{},0,void 0,!0,void 0,U)}e.defer=t;function n(P){return(U,V=null,W)=>{let z=!1,$;return $=P(q=>{if(!z)return $?$.dispose():z=!0,U.call(V,q)},null,W),z&&$.dispose(),$}}e.once=n;function r(P,U,V){return d((W,z=null,$)=>P(q=>W.call(z,U(q)),null,$),V)}e.map=r;function s(P,U,V){return d((W,z=null,$)=>P(q=>{U(q),W.call(z,q)},null,$),V)}e.forEach=s;function a(P,U,V){return d((W,z=null,$)=>P(q=>U(q)&&W.call(z,q),null,$),V)}e.filter=a;function l(P){return P}e.signal=l;function u(...P){return(U,V=null,W)=>{let z=ZX(...P.map($=>$(q=>U.call(V,q))));return m(z,W)}}e.any=u;function h(P,U,V,W){let z=V;return r(P,$=>(z=U(z,$),z),W)}e.reduce=h;function d(P,U){let V,W={onWillAddFirstListener(){V=P(z.fire,z)},onDidRemoveLastListener(){V==null||V.dispose()}},z=new ke(W);return U==null||U.add(z),z.event}function m(P,U){return U instanceof Array?U.push(P):U&&U.add(P),P}function g(P,U,V=100,W=!1,z=!1,$,q){let Q,M,I,Z=0,j,ce={leakWarningThreshold:$,onWillAddFirstListener(){Q=P(ue=>{Z++,M=U(M,ue),W&&!I&&(fe.fire(M),M=void 0),j=()=>{let de=M;M=void 0,I=void 0,(!W||Z>1)&&fe.fire(de),Z=0},typeof V=="number"?(clearTimeout(I),I=setTimeout(j,V)):I===void 0&&(I=0,queueMicrotask(j))})},onWillRemoveListener(){z&&Z>0&&(j==null||j())},onDidRemoveLastListener(){j=void 0,Q.dispose()}},fe=new ke(ce);return q==null||q.add(fe),fe.event}e.debounce=g;function _(P,U=0,V){return e.debounce(P,(W,z)=>W?(W.push(z),W):[z],U,void 0,!0,void 0,V)}e.accumulate=_;function b(P,U=(W,z)=>W===z,V){let W=!0,z;return a(P,$=>{let q=W||!U($,z);return W=!1,z=$,q},V)}e.latch=b;function w(P,U,V){return[e.filter(P,U,V),e.filter(P,W=>!U(W),V)]}e.split=w;function S(P,U=!1,V=[],W){let z=V.slice(),$=P(M=>{z?z.push(M):Q.fire(M)});W&&W.add($);let q=()=>{z==null||z.forEach(M=>Q.fire(M)),z=null},Q=new ke({onWillAddFirstListener(){$||($=P(M=>Q.fire(M)),W&&W.add($))},onDidAddFirstListener(){z&&(U?setTimeout(q):q())},onDidRemoveLastListener(){$&&$.dispose(),$=null}});return W&&W.add(Q),Q.event}e.buffer=S;function C(P,U){return(V,W,z)=>{let $=U(new R);return P(function(q){let Q=$.evaluate(q);Q!==k&&V.call(W,Q)},void 0,z)}}e.chain=C;let k=Symbol("HaltChainable");class R{constructor(){this.steps=[]}map(U){return this.steps.push(U),this}forEach(U){return this.steps.push(V=>(U(V),V)),this}filter(U){return this.steps.push(V=>U(V)?V:k),this}reduce(U,V){let W=V;return this.steps.push(z=>(W=U(W,z),W)),this}latch(U=(V,W)=>V===W){let V=!0,W;return this.steps.push(z=>{let $=V||!U(z,W);return V=!1,W=z,$?z:k}),this}evaluate(U){for(let V of this.steps)if(U=V(U),U===k)break;return U}}function T(P,U,V=W=>W){let W=(...Q)=>q.fire(V(...Q)),z=()=>P.on(U,W),$=()=>P.removeListener(U,W),q=new ke({onWillAddFirstListener:z,onDidRemoveLastListener:$});return q.event}e.fromNodeEventEmitter=T;function N(P,U,V=W=>W){let W=(...Q)=>q.fire(V(...Q)),z=()=>P.addEventListener(U,W),$=()=>P.removeEventListener(U,W),q=new ke({onWillAddFirstListener:z,onDidRemoveLastListener:$});return q.event}e.fromDOMEventEmitter=N;function L(P){return new Promise(U=>n(P)(U))}e.toPromise=L;function A(P){let U=new ke;return P.then(V=>{U.fire(V)},()=>{U.fire(void 0)}).finally(()=>{U.dispose()}),U.event}e.fromPromise=A;function O(P,U){return P(V=>U.fire(V))}e.forward=O;function F(P,U,V){return U(V),P(W=>U(W))}e.runAndSubscribe=F;class G{constructor(U,V){this._observable=U,this._counter=0,this._hasChanged=!1;let W={onWillAddFirstListener:()=>{U.addObserver(this)},onDidRemoveLastListener:()=>{U.removeObserver(this)}};this.emitter=new ke(W),V&&V.add(this.emitter)}beginUpdate(U){this._counter++}handlePossibleChange(U){}handleChange(U,V){this._hasChanged=!0}endUpdate(U){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function B(P,U){return new G(P,U).emitter.event}e.fromObservable=B;function H(P){return(U,V,W)=>{let z=0,$=!1,q={beginUpdate(){z++},endUpdate(){z--,z===0&&(P.reportChanges(),$&&($=!1,U.call(V)))},handlePossibleChange(){},handleChange(){$=!0}};P.addObserver(q),P.reportChanges();let Q={dispose(){P.removeObserver(q)}};return W instanceof ao?W.add(Q):Array.isArray(W)&&W.push(Q),Q}}e.fromObservableLight=H})(Un||(Un={}));var yy=class by{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${by._idPool++}`,by.all.add(this)}start(t){this._stopWatch=new JX,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}}};yy.all=new Set,yy._idPool=0;var eZ=yy,tZ=-1,q5=class K5{constructor(t,n,r=(K5._idPool++).toString(16).padStart(3,"0")){this._errorHandler=t,this.threshold=n,this.name=r,this._warnCountdown=0}dispose(){var t;(t=this._stacks)==null||t.clear()}check(t,n){let r=this.threshold;if(r<=0||n<r)return;this._stacks||(this._stacks=new Map);let s=this._stacks.get(t.value)||0;if(this._stacks.set(t.value,s+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=r*.5;let[a,l]=this.getMostFrequentStack(),u=`[${this.name}] potential listener LEAK detected, having ${n} listeners already. MOST frequent listener (${l}):`;console.warn(u),console.warn(a);let h=new iZ(u,a);this._errorHandler(h)}return()=>{let a=this._stacks.get(t.value)||0;this._stacks.set(t.value,a-1)}}getMostFrequentStack(){if(!this._stacks)return;let t,n=0;for(let[r,s]of this._stacks)(!t||n<s)&&(t=[r,s],n=s);return t}};q5._idPool=1;var nZ=q5,rZ=class G5{constructor(t){this.value=t}static create(){let t=new Error;return new G5(t.stack??"")}print(){console.warn(this.value.split(`
|
|
598
|
-
`).slice(2).join(`
|
|
599
|
-
`))}},iZ=class extends Error{constructor(e,t){super(e),this.name="ListenerLeakError",this.stack=t}},sZ=class extends Error{constructor(e,t){super(e),this.name="ListenerRefusalError",this.stack=t}},oZ=0,i_=class{constructor(e){this.value=e,this.id=oZ++}},aZ=2,lZ,ke=class{constructor(e){var t,n,r,s;this._size=0,this._options=e,this._leakageMon=(t=this._options)!=null&&t.leakWarningThreshold?new nZ((e==null?void 0:e.onListenerError)??Sf,((n=this._options)==null?void 0:n.leakWarningThreshold)??tZ):void 0,this._perfMon=(r=this._options)!=null&&r._profName?new eZ(this._options._profName):void 0,this._deliveryQueue=(s=this._options)==null?void 0:s.deliveryQueue}dispose(){var e,t,n,r;this._disposed||(this._disposed=!0,((e=this._deliveryQueue)==null?void 0:e.current)===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),(n=(t=this._options)==null?void 0:t.onDidRemoveLastListener)==null||n.call(t),(r=this._leakageMon)==null||r.dispose())}get event(){return this._event??(this._event=(e,t,n)=>{var l,u,h,d,m;if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let g=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(g);let _=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],b=new sZ(`${g}. HINT: Stack shows most frequent listener (${_[1]}-times)`,_[0]);return(((l=this._options)==null?void 0:l.onListenerError)||Sf)(b),Je.None}if(this._disposed)return Je.None;t&&(e=e.bind(t));let r=new i_(e),s;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(r.stack=rZ.create(),s=this._leakageMon.check(r.stack,this._size+1)),this._listeners?this._listeners instanceof i_?(this._deliveryQueue??(this._deliveryQueue=new cZ),this._listeners=[this._listeners,r]):this._listeners.push(r):((h=(u=this._options)==null?void 0:u.onWillAddFirstListener)==null||h.call(u,this),this._listeners=r,(m=(d=this._options)==null?void 0:d.onDidAddFirstListener)==null||m.call(d,this)),this._size++;let a=$t(()=>{s==null||s(),this._removeListener(r)});return n instanceof ao?n.add(a):Array.isArray(n)&&n.push(a),a}),this._event}_removeListener(e){var s,a,l,u;if((a=(s=this._options)==null?void 0:s.onWillRemoveListener)==null||a.call(s,this),!this._listeners)return;if(this._size===1){this._listeners=void 0,(u=(l=this._options)==null?void 0:l.onDidRemoveLastListener)==null||u.call(l,this),this._size=0;return}let t=this._listeners,n=t.indexOf(e);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--,t[n]=void 0;let r=this._deliveryQueue.current===this;if(this._size*aZ<=t.length){let h=0;for(let d=0;d<t.length;d++)t[d]?t[h++]=t[d]:r&&(this._deliveryQueue.end--,h<this._deliveryQueue.i&&this._deliveryQueue.i--);t.length=h}}_deliver(e,t){var r;if(!e)return;let n=((r=this._options)==null?void 0:r.onListenerError)||Sf;if(!n){e.value(t);return}try{e.value(t)}catch(s){n(s)}}_deliverQueue(e){let t=e.current._listeners;for(;e.i<e.end;)this._deliver(t[e.i++],e.value);e.reset()}fire(e){var t,n,r,s;if((t=this._deliveryQueue)!=null&&t.current&&(this._deliverQueue(this._deliveryQueue),(n=this._perfMon)==null||n.stop()),(r=this._perfMon)==null||r.start(this._size),this._listeners)if(this._listeners instanceof i_)this._deliver(this._listeners,e);else{let a=this._deliveryQueue;a.enqueue(this,e,this._listeners.length),this._deliverQueue(a)}(s=this._perfMon)==null||s.stop()}hasListeners(){return this._size>0}},cZ=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,n){this.i=0,this.end=n,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},xy=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new ke,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new ke,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(t){return this.mapWindowIdToZoomLevel.get(this.getWindowId(t))??0}setZoomLevel(t,n){if(this.getZoomLevel(n)===t)return;let r=this.getWindowId(n);this.mapWindowIdToZoomLevel.set(r,t),this._onDidChangeZoomLevel.fire(r)}getZoomFactor(t){return this.mapWindowIdToZoomFactor.get(this.getWindowId(t))??1}setZoomFactor(t,n){this.mapWindowIdToZoomFactor.set(this.getWindowId(n),t)}setFullscreen(t,n){if(this.isFullscreen(n)===t)return;let r=this.getWindowId(n);this.mapWindowIdToFullScreen.set(r,t),this._onDidChangeFullscreen.fire(r)}isFullscreen(t){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(t))}getWindowId(t){return t.vscodeWindowId}};xy.INSTANCE=new xy;var Z0=xy;function uZ(e,t,n){typeof t=="string"&&(t=e.matchMedia(t)),t.addEventListener("change",n)}Z0.INSTANCE.onDidChangeZoomLevel;function dZ(e){return Z0.INSTANCE.getZoomFactor(e)}Z0.INSTANCE.onDidChangeFullscreen;var Xl=typeof navigator=="object"?navigator.userAgent:"",wy=Xl.indexOf("Firefox")>=0,hZ=Xl.indexOf("AppleWebKit")>=0,Q0=Xl.indexOf("Chrome")>=0,fZ=!Q0&&Xl.indexOf("Safari")>=0;Xl.indexOf("Electron/")>=0;Xl.indexOf("Android")>=0;var s_=!1;if(typeof us.matchMedia=="function"){let e=us.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),t=us.matchMedia("(display-mode: fullscreen)");s_=e.matches,uZ(us,e,({matches:n})=>{s_&&t.matches||(s_=n)})}var _l="en",Sy=!1,Cy=!1,Cf=!1,Y5=!1,Yh,kf=_l,Yk=_l,pZ,ai,Xo=globalThis,Fn,lR;typeof Xo.vscode<"u"&&typeof Xo.vscode.process<"u"?Fn=Xo.vscode.process:typeof process<"u"&&typeof((lR=process==null?void 0:process.versions)==null?void 0:lR.node)=="string"&&(Fn=process);var cR,mZ=typeof((cR=Fn==null?void 0:Fn.versions)==null?void 0:cR.electron)=="string",gZ=mZ&&(Fn==null?void 0:Fn.type)==="renderer",uR;if(typeof Fn=="object"){Sy=Fn.platform==="win32",Cy=Fn.platform==="darwin",Cf=Fn.platform==="linux",Cf&&Fn.env.SNAP&&Fn.env.SNAP_REVISION,Fn.env.CI||Fn.env.BUILD_ARTIFACTSTAGINGDIRECTORY,Yh=_l,kf=_l;let e=Fn.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);Yh=t.userLocale,Yk=t.osLocale,kf=t.resolvedLanguage||_l,pZ=(uR=t.languagePack)==null?void 0:uR.translationsConfigFile}catch{}Y5=!0}else typeof navigator=="object"&&!gZ?(ai=navigator.userAgent,Sy=ai.indexOf("Windows")>=0,Cy=ai.indexOf("Macintosh")>=0,(ai.indexOf("Macintosh")>=0||ai.indexOf("iPad")>=0||ai.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,Cf=ai.indexOf("Linux")>=0,(ai==null?void 0:ai.indexOf("Mobi"))>=0,kf=globalThis._VSCODE_NLS_LANGUAGE||_l,Yh=navigator.language.toLowerCase(),Yk=Yh):console.error("Unable to resolve platform.");var X5=Sy,Oi=Cy,vZ=Cf,Xk=Y5,zi=ai,Ys=kf,_Z;(e=>{function t(){return Ys}e.value=t;function n(){return Ys.length===2?Ys==="en":Ys.length>=3?Ys[0]==="e"&&Ys[1]==="n"&&Ys[2]==="-":!1}e.isDefaultVariant=n;function r(){return Ys==="en"}e.isDefault=r})(_Z||(_Z={}));var yZ=typeof Xo.postMessage=="function"&&!Xo.importScripts;(()=>{if(yZ){let e=[];Xo.addEventListener("message",n=>{if(n.data&&n.data.vscodeScheduleAsyncWork)for(let r=0,s=e.length;r<s;r++){let a=e[r];if(a.id===n.data.vscodeScheduleAsyncWork){e.splice(r,1),a.callback();return}}});let t=0;return n=>{let r=++t;e.push({id:r,callback:n}),Xo.postMessage({vscodeScheduleAsyncWork:r},"*")}}return e=>setTimeout(e)})();var bZ=!!(zi&&zi.indexOf("Chrome")>=0);zi&&zi.indexOf("Firefox")>=0;!bZ&&zi&&zi.indexOf("Safari")>=0;zi&&zi.indexOf("Edg/")>=0;zi&&zi.indexOf("Android")>=0;var cl=typeof navigator=="object"?navigator:{};Xk||document.queryCommandSupported&&document.queryCommandSupported("copy")||cl&&cl.clipboard&&cl.clipboard.writeText,Xk||cl&&cl.clipboard&&cl.clipboard.readText;var J0=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}},o_=new J0,Zk=new J0,Qk=new J0,xZ=new Array(230),Z5;(e=>{function t(u){return o_.keyCodeToStr(u)}e.toString=t;function n(u){return o_.strToKeyCode(u)}e.fromString=n;function r(u){return Zk.keyCodeToStr(u)}e.toUserSettingsUS=r;function s(u){return Qk.keyCodeToStr(u)}e.toUserSettingsGeneral=s;function a(u){return Zk.strToKeyCode(u)||Qk.strToKeyCode(u)}e.fromUserSettings=a;function l(u){if(u>=98&&u<=113)return null;switch(u){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return o_.keyCodeToStr(u)}e.toElectronAccelerator=l})(Z5||(Z5={}));var wZ=class Q5{constructor(t,n,r,s,a){this.ctrlKey=t,this.shiftKey=n,this.altKey=r,this.metaKey=s,this.keyCode=a}equals(t){return t instanceof Q5&&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",n=this.shiftKey?"1":"0",r=this.altKey?"1":"0",s=this.metaKey?"1":"0";return`K${t}${n}${r}${s}${this.keyCode}`}isModifierKey(){return this.keyCode===0||this.keyCode===5||this.keyCode===57||this.keyCode===6||this.keyCode===4}toKeybinding(){return new SZ([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}},SZ=class{constructor(e){if(e.length===0)throw GX("chords");this.chords=e}getHashCode(){let e="";for(let t=0,n=this.chords.length;t<n;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 CZ(e){if(e.charCode){let n=String.fromCharCode(e.charCode).toUpperCase();return Z5.fromString(n)}let t=e.keyCode;if(t===3)return 7;if(wy)switch(t){case 59:return 85;case 60:if(vZ)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(Oi)return 57;break}else if(hZ&&(Oi&&t===93||!Oi&&t===92))return 57;return xZ[t]||0}var kZ=Oi?256:2048,EZ=512,RZ=1024,TZ=Oi?2048:256,Jk=class{constructor(e){var n;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=(n=t.getModifierState)==null?void 0:n.call(t,"AltGraph"),this.keyCode=CZ(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|=kZ),this.altKey&&(t|=EZ),this.shiftKey&&(t|=RZ),this.metaKey&&(t|=TZ),t|=e,t}_computeKeyCodeChord(){let e=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode),new wZ(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}},eE=new WeakMap;function MZ(e){if(!e.parent||e.parent===e)return null;try{let t=e.location,n=e.parent.location;if(t.origin!=="null"&&n.origin!=="null"&&t.origin!==n.origin)return null}catch{return null}return e.parent}var NZ=class{static getSameOriginWindowChain(e){let t=eE.get(e);if(!t){t=[],eE.set(e,t);let n=e,r;do r=MZ(n),r?t.push({window:new WeakRef(n),iframeElement:n.frameElement||null}):t.push({window:new WeakRef(n),iframeElement:null}),n=r;while(n)}return t.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(e,t){if(!t||e===t)return{top:0,left:0};let n=0,r=0,s=this.getSameOriginWindowChain(e);for(let a of s){let l=a.window.deref();if(n+=(l==null?void 0:l.scrollY)??0,r+=(l==null?void 0:l.scrollX)??0,l===t||!a.iframeElement)break;let u=a.iframeElement.getBoundingClientRect();n+=u.top,r+=u.left}return{top:n,left:r}}},Xh=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 n=NZ.getPositionOfChildWindowRelativeToAncestorWindow(e,t.view);this.posx-=n.left,this.posy-=n.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}},tE=class{constructor(e,t=0,n=0){var s;this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=n,this.deltaX=t;let r=!1;if(Q0){let a=navigator.userAgent.match(/Chrome\/(\d+)/);r=(a?parseInt(a[1]):123)<=122}if(e){let a=e,l=e,u=((s=e.view)==null?void 0:s.devicePixelRatio)||1;if(typeof a.wheelDeltaY<"u")r?this.deltaY=a.wheelDeltaY/(120*u):this.deltaY=a.wheelDeltaY/120;else if(typeof l.VERTICAL_AXIS<"u"&&l.axis===l.VERTICAL_AXIS)this.deltaY=-l.detail/3;else if(e.type==="wheel"){let h=e;h.deltaMode===h.DOM_DELTA_LINE?wy&&!Oi?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof a.wheelDeltaX<"u")fZ&&X5?this.deltaX=-(a.wheelDeltaX/120):r?this.deltaX=a.wheelDeltaX/(120*u):this.deltaX=a.wheelDeltaX/120;else if(typeof l.HORIZONTAL_AXIS<"u"&&l.axis===l.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if(e.type==="wheel"){let h=e;h.deltaMode===h.DOM_DELTA_LINE?wy&&!Oi?this.deltaX=-e.deltaX/3:this.deltaX=-e.deltaX:this.deltaX=-e.deltaX/40}this.deltaY===0&&this.deltaX===0&&e.wheelDelta&&(r?this.deltaY=e.wheelDelta/(120*u):this.deltaY=e.wheelDelta/120)}}preventDefault(){var e;(e=this.browserEvent)==null||e.preventDefault()}stopPropagation(){var e;(e=this.browserEvent)==null||e.stopPropagation()}},J5=Object.freeze(function(e,t){let n=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(n)}}}),AZ;(e=>{function t(n){return n===e.None||n===e.Cancelled||n instanceof DZ?!0:!n||typeof n!="object"?!1:typeof n.isCancellationRequested=="boolean"&&typeof n.onCancellationRequested=="function"}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Un.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:J5})})(AZ||(AZ={}));var DZ=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?J5:(this._emitter||(this._emitter=new ke),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},ex=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 gy("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},t)}setIfNotSet(e,t){if(this._isDisposed)throw new gy("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},t))}},OZ=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,n=globalThis){if(this.isDisposed)throw new gy("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let r=n.setInterval(()=>{e()},t);this.disposable=$t(()=>{n.clearInterval(r),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}},jZ;(e=>{async function t(r){let s,a=await Promise.all(r.map(l=>l.then(u=>u,u=>{s||(s=u)})));if(typeof s<"u")throw s;return a}e.settled=t;function n(r){return new Promise(async(s,a)=>{try{await r(s,a)}catch(l){a(l)}})}e.withAsyncBody=n})(jZ||(jZ={}));var nE=class qr{static fromArray(t){return new qr(n=>{n.emitMany(t)})}static fromPromise(t){return new qr(async n=>{n.emitMany(await t)})}static fromPromises(t){return new qr(async n=>{await Promise.all(t.map(async r=>n.emitOne(await r)))})}static merge(t){return new qr(async n=>{await Promise.all(t.map(async r=>{for await(let s of r)n.emitOne(s)}))})}constructor(t,n){this._state=0,this._results=[],this._error=null,this._onReturn=n,this._onStateChanged=new ke,queueMicrotask(async()=>{let r={emitOne:s=>this.emitOne(s),emitMany:s=>this.emitMany(s),reject:s=>this.reject(s)};try{await Promise.resolve(t(r)),this.resolve()}catch(s){this.reject(s)}finally{r.emitOne=void 0,r.emitMany=void 0,r.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 Un.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>{var n;return(n=this._onReturn)==null||n.call(this),{done:!0,value:void 0}}}}static map(t,n){return new qr(async r=>{for await(let s of t)r.emitOne(n(s))})}map(t){return qr.map(this,t)}static filter(t,n){return new qr(async r=>{for await(let s of t)n(s)&&r.emitOne(s)})}filter(t){return qr.filter(this,t)}static coalesce(t){return qr.filter(t,n=>!!n)}coalesce(){return qr.coalesce(this)}static async toPromise(t){let n=[];for await(let r of t)n.push(r);return n}toPromise(){return qr.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())}};nE.EMPTY=nE.fromArray([]);var{getWindow:Ni,getWindowId:LZ,onDidRegisterWindow:zZ}=(function(){let e=new Map,t={window:us,disposables:new ao};e.set(us.vscodeWindowId,t);let n=new ke,r=new ke,s=new ke;function a(l,u){return(typeof l=="number"?e.get(l):void 0)??(u?t:void 0)}return{onDidRegisterWindow:n.event,onWillUnregisterWindow:s.event,onDidUnregisterWindow:r.event,registerWindow(l){if(e.has(l.vscodeWindowId))return Je.None;let u=new ao,h={window:l,disposables:u.add(new ao)};return e.set(l.vscodeWindowId,h),u.add($t(()=>{e.delete(l.vscodeWindowId),r.fire(l)})),u.add(Ue(l,xn.BEFORE_UNLOAD,()=>{s.fire(l)})),n.fire(h),u},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(l){return l.vscodeWindowId},hasWindow(l){return e.has(l)},getWindowById:a,getWindow(l){var d;let u=l;if((d=u==null?void 0:u.ownerDocument)!=null&&d.defaultView)return u.ownerDocument.defaultView.window;let h=l;return h!=null&&h.view?h.view.window:us},getDocument(l){return Ni(l).document}}})(),PZ=class{constructor(e,t,n,r){this._node=e,this._type=t,this._handler=n,this._options=r||!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 Ue(e,t,n,r){return new PZ(e,t,n,r)}var rE=function(e,t,n,r){return Ue(e,t,n,r)},tx,BZ=class extends OZ{constructor(e){super(),this.defaultTarget=e&&Ni(e)}cancelAndSet(e,t,n){return super.cancelAndSet(e,t,n??this.defaultTarget)}},iE=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){Sf(e)}}static sort(e,t){return t.priority-e.priority}};(function(){let e=new Map,t=new Map,n=new Map,r=new Map,s=a=>{n.set(a,!1);let l=e.get(a)??[];for(t.set(a,l),e.set(a,[]),r.set(a,!0);l.length>0;)l.sort(iE.sort),l.shift().execute();r.set(a,!1)};tx=(a,l,u=0)=>{let h=LZ(a),d=new iE(l,u),m=e.get(h);return m||(m=[],e.set(h,m)),m.push(d),n.get(h)||(n.set(h,!0),a.requestAnimationFrame(()=>s(h))),d}})();function IZ(e){let t=e.getBoundingClientRect(),n=Ni(e);return{left:t.left+n.scrollX,top:t.top+n.scrollY,width:t.width,height:t.height}}var xn={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"},HZ=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=fr(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){let t=fr(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){let t=fr(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){let t=fr(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){let t=fr(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){let t=fr(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){let t=fr(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingTop(e){let t=fr(e);this._paddingTop!==t&&(this._paddingTop=t,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(e){let t=fr(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(e){let t=fr(e);this._paddingBottom!==t&&(this._paddingBottom=t,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(e){let t=fr(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=fr(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=fr(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){let t=fr(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 fr(e){return typeof e=="number"?`${e}px`:e}function Tu(e){return new HZ(e)}var eD=class{constructor(){this._hooks=new ao,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 n=this._onStopCallback;this._onStopCallback=null,e&&n&&n(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,n,r,s){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=r,this._onStopCallback=s;let a=e;try{e.setPointerCapture(t),this._hooks.add($t(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{a=Ni(e)}this._hooks.add(Ue(a,xn.POINTER_MOVE,l=>{if(l.buttons!==n){this.stopMonitoring(!0);return}l.preventDefault(),this._pointerMoveCallback(l)})),this._hooks.add(Ue(a,xn.POINTER_UP,l=>this.stopMonitoring(!0)))}};function FZ(e,t,n){let r=null,s=null;if(typeof n.value=="function"?(r="value",s=n.value,s.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof n.get=="function"&&(r="get",s=n.get),!s)throw new Error("not supported");let a=`$memoize$${t}`;n[r]=function(...l){return this.hasOwnProperty(a)||Object.defineProperty(this,a,{configurable:!1,enumerable:!1,writable:!1,value:s.apply(this,l)}),this[a]}}var Si;(e=>(e.Tap="-xterm-gesturetap",e.Change="-xterm-gesturechange",e.Start="-xterm-gesturestart",e.End="-xterm-gesturesend",e.Contextmenu="-xterm-gesturecontextmenu"))(Si||(Si={}));var cu=class Wn extends Je{constructor(){super(),this.dispatched=!1,this.targets=new Gk,this.ignoreTargets=new Gk,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(Un.runAndSubscribe(zZ,({window:t,disposables:n})=>{n.add(Ue(t.document,"touchstart",r=>this.onTouchStart(r),{passive:!1})),n.add(Ue(t.document,"touchend",r=>this.onTouchEnd(t,r))),n.add(Ue(t.document,"touchmove",r=>this.onTouchMove(r),{passive:!1}))},{window:us,disposables:this._store}))}static addTarget(t){if(!Wn.isTouchDevice())return Je.None;Wn.INSTANCE||(Wn.INSTANCE=new Wn);let n=Wn.INSTANCE.targets.push(t);return $t(n)}static ignoreTarget(t){if(!Wn.isTouchDevice())return Je.None;Wn.INSTANCE||(Wn.INSTANCE=new Wn);let n=Wn.INSTANCE.ignoreTargets.push(t);return $t(n)}static isTouchDevice(){return"ontouchstart"in us||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(t){let n=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let r=0,s=t.targetTouches.length;r<s;r++){let a=t.targetTouches.item(r);this.activeTouches[a.identifier]={id:a.identifier,initialTarget:a.target,initialTimeStamp:n,initialPageX:a.pageX,initialPageY:a.pageY,rollingTimestamps:[n],rollingPageX:[a.pageX],rollingPageY:[a.pageY]};let l=this.newGestureEvent(Si.Start,a.target);l.pageX=a.pageX,l.pageY=a.pageY,this.dispatchEvent(l)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}onTouchEnd(t,n){let r=Date.now(),s=Object.keys(this.activeTouches).length;for(let a=0,l=n.changedTouches.length;a<l;a++){let u=n.changedTouches.item(a);if(!this.activeTouches.hasOwnProperty(String(u.identifier))){console.warn("move of an UNKNOWN touch",u);continue}let h=this.activeTouches[u.identifier],d=Date.now()-h.initialTimeStamp;if(d<Wn.HOLD_DELAY&&Math.abs(h.initialPageX-kr(h.rollingPageX))<30&&Math.abs(h.initialPageY-kr(h.rollingPageY))<30){let m=this.newGestureEvent(Si.Tap,h.initialTarget);m.pageX=kr(h.rollingPageX),m.pageY=kr(h.rollingPageY),this.dispatchEvent(m)}else if(d>=Wn.HOLD_DELAY&&Math.abs(h.initialPageX-kr(h.rollingPageX))<30&&Math.abs(h.initialPageY-kr(h.rollingPageY))<30){let m=this.newGestureEvent(Si.Contextmenu,h.initialTarget);m.pageX=kr(h.rollingPageX),m.pageY=kr(h.rollingPageY),this.dispatchEvent(m)}else if(s===1){let m=kr(h.rollingPageX),g=kr(h.rollingPageY),_=kr(h.rollingTimestamps)-h.rollingTimestamps[0],b=m-h.rollingPageX[0],w=g-h.rollingPageY[0],S=[...this.targets].filter(C=>h.initialTarget instanceof Node&&C.contains(h.initialTarget));this.inertia(t,S,r,Math.abs(b)/_,b>0?1:-1,m,Math.abs(w)/_,w>0?1:-1,g)}this.dispatchEvent(this.newGestureEvent(Si.End,h.initialTarget)),delete this.activeTouches[u.identifier]}this.dispatched&&(n.preventDefault(),n.stopPropagation(),this.dispatched=!1)}newGestureEvent(t,n){let r=document.createEvent("CustomEvent");return r.initEvent(t,!1,!0),r.initialTarget=n,r.tapCount=0,r}dispatchEvent(t){if(t.type===Si.Tap){let n=new Date().getTime(),r=0;n-this._lastSetTapCountTime>Wn.CLEAR_TAP_COUNT_TIME?r=1:r=2,this._lastSetTapCountTime=n,t.tapCount=r}else(t.type===Si.Change||t.type===Si.Contextmenu)&&(this._lastSetTapCountTime=0);if(t.initialTarget instanceof Node){for(let r of this.ignoreTargets)if(r.contains(t.initialTarget))return;let n=[];for(let r of this.targets)if(r.contains(t.initialTarget)){let s=0,a=t.initialTarget;for(;a&&a!==r;)s++,a=a.parentElement;n.push([s,r])}n.sort((r,s)=>r[0]-s[0]);for(let[r,s]of n)s.dispatchEvent(t),this.dispatched=!0}}inertia(t,n,r,s,a,l,u,h,d){this.handle=tx(t,()=>{let m=Date.now(),g=m-r,_=0,b=0,w=!0;s+=Wn.SCROLL_FRICTION*g,u+=Wn.SCROLL_FRICTION*g,s>0&&(w=!1,_=a*s*g),u>0&&(w=!1,b=h*u*g);let S=this.newGestureEvent(Si.Change);S.translationX=_,S.translationY=b,n.forEach(C=>C.dispatchEvent(S)),w||this.inertia(t,n,m,s,a,l+_,u,h,d+b)})}onTouchMove(t){let n=Date.now();for(let r=0,s=t.changedTouches.length;r<s;r++){let a=t.changedTouches.item(r);if(!this.activeTouches.hasOwnProperty(String(a.identifier))){console.warn("end of an UNKNOWN touch",a);continue}let l=this.activeTouches[a.identifier],u=this.newGestureEvent(Si.Change,l.initialTarget);u.translationX=a.pageX-kr(l.rollingPageX),u.translationY=a.pageY-kr(l.rollingPageY),u.pageX=a.pageX,u.pageY=a.pageY,this.dispatchEvent(u),l.rollingPageX.length>3&&(l.rollingPageX.shift(),l.rollingPageY.shift(),l.rollingTimestamps.shift()),l.rollingPageX.push(a.pageX),l.rollingPageY.push(a.pageY),l.rollingTimestamps.push(n)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}};cu.SCROLL_FRICTION=-.005,cu.HOLD_DELAY=700,cu.CLEAR_TAP_COUNT_TIME=400,Xt([FZ],cu,"isTouchDevice",1);var UZ=cu,nx=class extends Je{onclick(e,t){this._register(Ue(e,xn.CLICK,n=>t(new Xh(Ni(e),n))))}onmousedown(e,t){this._register(Ue(e,xn.MOUSE_DOWN,n=>t(new Xh(Ni(e),n))))}onmouseover(e,t){this._register(Ue(e,xn.MOUSE_OVER,n=>t(new Xh(Ni(e),n))))}onmouseleave(e,t){this._register(Ue(e,xn.MOUSE_LEAVE,n=>t(new Xh(Ni(e),n))))}onkeydown(e,t){this._register(Ue(e,xn.KEY_DOWN,n=>t(new Jk(n))))}onkeyup(e,t){this._register(Ue(e,xn.KEY_UP,n=>t(new Jk(n))))}oninput(e,t){this._register(Ue(e,xn.INPUT,t))}onblur(e,t){this._register(Ue(e,xn.BLUR,t))}onfocus(e,t){this._register(Ue(e,xn.FOCUS,t))}onchange(e,t){this._register(Ue(e,xn.CHANGE,t))}ignoreGesture(e){return UZ.ignoreTarget(e)}},sE=11,$Z=class extends nx{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=sE+"px",this.domNode.style.height=sE+"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 eD),this._register(rE(this.bgDomNode,xn.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(rE(this.domNode,xn.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new BZ),this._pointerdownScheduleRepeatTimer=this._register(new ex)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,Ni(e))};this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(t,200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,n=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault()}},WZ=class ky{constructor(t,n,r,s,a,l,u){this._forceIntegerValues=t,this._scrollStateBrand=void 0,this._forceIntegerValues&&(n=n|0,r=r|0,s=s|0,a=a|0,l=l|0,u=u|0),this.rawScrollLeft=s,this.rawScrollTop=u,n<0&&(n=0),s+n>r&&(s=r-n),s<0&&(s=0),a<0&&(a=0),u+a>l&&(u=l-a),u<0&&(u=0),this.width=n,this.scrollWidth=r,this.scrollLeft=s,this.height=a,this.scrollHeight=l,this.scrollTop=u}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,n){return new ky(this._forceIntegerValues,typeof t.width<"u"?t.width:this.width,typeof t.scrollWidth<"u"?t.scrollWidth:this.scrollWidth,n?this.rawScrollLeft:this.scrollLeft,typeof t.height<"u"?t.height:this.height,typeof t.scrollHeight<"u"?t.scrollHeight:this.scrollHeight,n?this.rawScrollTop:this.scrollTop)}withScrollPosition(t){return new ky(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,n){let r=this.width!==t.width,s=this.scrollWidth!==t.scrollWidth,a=this.scrollLeft!==t.scrollLeft,l=this.height!==t.height,u=this.scrollHeight!==t.scrollHeight,h=this.scrollTop!==t.scrollTop;return{inSmoothScrolling:n,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:r,scrollWidthChanged:s,scrollLeftChanged:a,heightChanged:l,scrollHeightChanged:u,scrollTopChanged:h}}},VZ=class extends Je{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new ke),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new WZ(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 r;let n=this._state.withScrollDimensions(e,t);this._setState(n,!!this._smoothScrolling),(r=this._smoothScrolling)==null||r.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 n=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===n.scrollLeft&&this._smoothScrolling.to.scrollTop===n.scrollTop)return;let r;t?r=new aE(this._smoothScrolling.from,n,this._smoothScrolling.startTime,this._smoothScrolling.duration):r=this._smoothScrolling.combine(this._state,n,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=r}else{let n=this._state.withScrollPosition(e);this._smoothScrolling=aE.start(this._state,n,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 n=this._state;n.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(n,t)))}},oE=class{constructor(e,t,n){this.scrollLeft=e,this.scrollTop=t,this.isDone=n}};function a_(e,t){let n=t-e;return function(r){return e+n*GZ(r)}}function qZ(e,t,n){return function(r){return r<n?e(r/n):t((r-n)/(1-n))}}var aE=class Ey{constructor(t,n,r,s){this.from=t,this.to=n,this.duration=s,this.startTime=r,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,n,r){if(Math.abs(t-n)>2.5*r){let s,a;return t<n?(s=t+.75*r,a=n-.75*r):(s=t-.75*r,a=n+.75*r),qZ(a_(t,s),a_(a,n),.33)}return a_(t,n)}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 n=(t-this.startTime)/this.duration;if(n<1){let r=this.scrollLeft(n),s=this.scrollTop(n);return new oE(r,s,!1)}return new oE(this.to.scrollLeft,this.to.scrollTop,!0)}combine(t,n,r){return Ey.start(t,n,r)}static start(t,n,r){r=r+10;let s=Date.now()-10;return new Ey(t,n,s,r)}};function KZ(e){return Math.pow(e,3)}function GZ(e){return 1-KZ(1-e)}var YZ=class extends Je{constructor(e,t,n){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=n,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new ex)}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":"")))}},XZ=140,tD=class extends nx{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 YZ(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new eD),this._shouldRender=!0,this.domNode=Tu(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(Ue(this.domNode.domNode,xn.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){let t=this._register(new $Z(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,n,r){this.slider=Tu(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t),typeof n=="number"&&this.slider.setWidth(n),typeof r=="number"&&this.slider.setHeight(r),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(Ue(this.slider.domNode,xn.POINTER_DOWN,s=>{s.button===0&&(s.preventDefault(),this._sliderPointerDown(s))})),this.onclick(this.slider.domNode,s=>{s.leftButton&&s.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,n=t+this._scrollbarState.getSliderPosition(),r=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),s=this._sliderPointerPosition(e);n<=s&&s<=r?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,n;if(e.target===this.domNode.domNode&&typeof e.offsetX=="number"&&typeof e.offsetY=="number")t=e.offsetX,n=e.offsetY;else{let s=IZ(this.domNode.domNode);t=e.pageX-s.left,n=e.pageY-s.top}let r=this._pointerDownRelativePosition(t,n);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(r):this._scrollbarState.getDesiredScrollPositionFromOffset(r)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=this._sliderPointerPosition(e),n=this._sliderOrthogonalPointerPosition(e),r=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,s=>{let a=this._sliderOrthogonalPointerPosition(s),l=Math.abs(a-n);if(X5&&l>XZ){this._setDesiredScrollPositionNow(r.getScrollPosition());return}let u=this._sliderPointerPosition(s)-t;this._setDesiredScrollPositionNow(r.getDesiredScrollPositionFromDelta(u))},()=>{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()}},nD=class Ry{constructor(t,n,r,s,a,l){this._scrollbarSize=Math.round(n),this._oppositeScrollbarSize=Math.round(r),this._arrowSize=Math.round(t),this._visibleSize=s,this._scrollSize=a,this._scrollPosition=l,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new Ry(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(t){let n=Math.round(t);return this._visibleSize!==n?(this._visibleSize=n,this._refreshComputedValues(),!0):!1}setScrollSize(t){let n=Math.round(t);return this._scrollSize!==n?(this._scrollSize=n,this._refreshComputedValues(),!0):!1}setScrollPosition(t){let n=Math.round(t);return this._scrollPosition!==n?(this._scrollPosition=n,this._refreshComputedValues(),!0):!1}setScrollbarSize(t){this._scrollbarSize=Math.round(t)}setOppositeScrollbarSize(t){this._oppositeScrollbarSize=Math.round(t)}static _computeValues(t,n,r,s,a){let l=Math.max(0,r-t),u=Math.max(0,l-2*n),h=s>0&&s>r;if(!h)return{computedAvailableSize:Math.round(l),computedIsNeeded:h,computedSliderSize:Math.round(u),computedSliderRatio:0,computedSliderPosition:0};let d=Math.round(Math.max(20,Math.floor(r*u/s))),m=(u-d)/(s-r),g=a*m;return{computedAvailableSize:Math.round(l),computedIsNeeded:h,computedSliderSize:Math.round(d),computedSliderRatio:m,computedSliderPosition:Math.round(g)}}_refreshComputedValues(){let t=Ry._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 n=t-this._arrowSize-this._computedSliderSize/2;return Math.round(n/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(t){if(!this._computedIsNeeded)return 0;let n=t-this._arrowSize,r=this._scrollPosition;return n<this._computedSliderPosition?r-=this._visibleSize:r+=this._visibleSize,r}getDesiredScrollPositionFromDelta(t){if(!this._computedIsNeeded)return 0;let n=this._computedSliderPosition+t;return Math.round(n/this._computedSliderRatio)}},ZZ=class extends tD{constructor(e,t,n){let r=e.getScrollDimensions(),s=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:n,scrollbarState:new nD(t.horizontalHasArrows?t.arrowSize:0,t.horizontal===2?0:t.horizontalScrollbarSize,t.vertical===2?0:t.verticalScrollbarSize,r.width,r.scrollWidth,s.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}},QZ=class extends tD{constructor(e,t,n){let r=e.getScrollDimensions(),s=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:n,scrollbarState:new nD(t.verticalHasArrows?t.arrowSize:0,t.vertical===2?0:t.verticalScrollbarSize,0,r.height,r.scrollHeight,s.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}},JZ=500,lE=50,eQ=class{constructor(e,t,n){this.timestamp=e,this.deltaX=t,this.deltaY=n,this.score=0}},Ty=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,n=0,r=1,s=this._rear;do{let a=s===this._front?t:Math.pow(2,-r);if(t-=a,n+=this._memory[s].score*a,s===this._front)break;s=(this._capacity+s-1)%this._capacity,r++}while(!0);return n<=.5}acceptStandardWheelEvent(t){if(Q0){let n=Ni(t.browserEvent),r=dZ(n);this.accept(Date.now(),t.deltaX*r,t.deltaY*r)}else this.accept(Date.now(),t.deltaX,t.deltaY)}accept(t,n,r){let s=null,a=new eQ(t,n,r);this._front===-1&&this._rear===-1?(this._memory[0]=a,this._front=0,this._rear=0):(s=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]=a),a.score=this._computeScore(a,s)}_computeScore(t,n){if(Math.abs(t.deltaX)>0&&Math.abs(t.deltaY)>0)return 1;let r=.5;if((!this._isAlmostInt(t.deltaX)||!this._isAlmostInt(t.deltaY))&&(r+=.25),n){let s=Math.abs(t.deltaX),a=Math.abs(t.deltaY),l=Math.abs(n.deltaX),u=Math.abs(n.deltaY),h=Math.max(Math.min(s,l),1),d=Math.max(Math.min(a,u),1),m=Math.max(s,l),g=Math.max(a,u);m%h===0&&g%d===0&&(r-=.5)}return Math.min(Math.max(r,0),1)}_isAlmostInt(t){return Math.abs(Math.round(t)-t)<.01}};Ty.INSTANCE=new Ty;var tQ=Ty,nQ=class extends nx{constructor(e,t,n){super(),this._onScroll=this._register(new ke),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new ke),this.onWillScroll=this._onWillScroll.event,this._options=iQ(t),this._scrollable=n,this._register(this._scrollable.onScroll(s=>{this._onWillScroll.fire(s),this._onDidScroll(s),this._onScroll.fire(s)}));let r={onMouseWheel:s=>this._onMouseWheel(s),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new QZ(this._scrollable,this._options,r)),this._horizontalScrollbar=this._register(new ZZ(this._scrollable,this._options,r)),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=Tu(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=Tu(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=Tu(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,s=>this._onMouseOver(s)),this.onmouseleave(this._listenOnDomNode,s=>this._onMouseLeave(s)),this._hideTimeout=this._register(new ex),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}get options(){return this._options}dispose(){this._mouseWheelToDispose=ia(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,Oi&&(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 tE(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=ia(this._mouseWheelToDispose),e)){let t=n=>{this._onMouseWheel(new tE(n))};this._mouseWheelToDispose.push(Ue(this._listenOnDomNode,xn.MOUSE_WHEEL,t,{passive:!1}))}}_onMouseWheel(e){var s;if((s=e.browserEvent)!=null&&s.defaultPrevented)return;let t=tQ.INSTANCE;t.acceptStandardWheelEvent(e);let n=!1;if(e.deltaY||e.deltaX){let a=e.deltaY*this._options.mouseWheelScrollSensitivity,l=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&l+a===0?l=a=0:Math.abs(a)>=Math.abs(l)?l=0:a=0),this._options.flipAxes&&([a,l]=[l,a]);let u=!Oi&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||u)&&!l&&(l=a,a=0),e.browserEvent&&e.browserEvent.altKey&&(l=l*this._options.fastScrollSensitivity,a=a*this._options.fastScrollSensitivity);let h=this._scrollable.getFutureScrollPosition(),d={};if(a){let m=lE*a,g=h.scrollTop-(m<0?Math.floor(m):Math.ceil(m));this._verticalScrollbar.writeScrollPosition(d,g)}if(l){let m=lE*l,g=h.scrollLeft-(m<0?Math.floor(m):Math.ceil(m));this._horizontalScrollbar.writeScrollPosition(d,g)}d=this._scrollable.validateScrollPosition(d),(h.scrollLeft!==d.scrollLeft||h.scrollTop!==d.scrollTop)&&(this._options.mouseWheelSmoothScroll&&t.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(d):this._scrollable.setScrollPositionNow(d),n=!0)}let r=n;!r&&this._options.alwaysConsumeMouseWheel&&(r=!0),!r&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(r=!0),r&&(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,n=e.scrollLeft>0,r=n?" left":"",s=t?" top":"",a=n||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${r}`),this._topShadowDomNode.setClassName(`shadow${s}`),this._topLeftShadowDomNode.setClassName(`shadow${a}${s}${r}`)}}_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(),JZ)}},rQ=class extends nQ{constructor(e,t,n){super(e,t,n)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}};function iQ(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,Oi&&(t.className+=" mac"),t}var My=class extends Je{constructor(e,t,n,r,s,a,l,u){super(),this._bufferService=n,this._optionsService=l,this._renderService=u,this._onRequestScrollLines=this._register(new ke),this.onRequestScrollLines=this._onRequestScrollLines.event,this._isSyncing=!1,this._isHandlingScroll=!1,this._suppressOnScrollHandler=!1;let h=this._register(new VZ({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:d=>tx(r.window,d)}));this._register(this._optionsService.onSpecificOptionChange("smoothScrollDuration",()=>{h.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)})),this._scrollableElement=this._register(new rQ(t,{vertical:1,horizontal:2,useShadows:!1,mouseWheelSmoothScroll:!0,...this._getChangeOptions()},h)),this._register(this._optionsService.onMultipleOptionChange(["scrollSensitivity","fastScrollSensitivity","overviewRuler"],()=>this._scrollableElement.updateOptions(this._getChangeOptions()))),this._register(s.onProtocolChange(d=>{this._scrollableElement.updateOptions({handleMouseWheel:!(d&16)})})),this._scrollableElement.setScrollDimensions({height:0,scrollHeight:0}),this._register(Un.runAndSubscribe(a.onChangeColors,()=>{this._scrollableElement.getDomNode().style.backgroundColor=a.colors.background.css})),e.appendChild(this._scrollableElement.getDomNode()),this._register($t(()=>this._scrollableElement.getDomNode().remove())),this._styleElement=r.mainDocument.createElement("style"),t.appendChild(this._styleElement),this._register($t(()=>this._styleElement.remove())),this._register(Un.runAndSubscribe(a.onChangeColors,()=>{this._styleElement.textContent=[".xterm .xterm-scrollable-element > .scrollbar > .slider {",` background: ${a.colors.scrollbarSliderBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider:hover {",` background: ${a.colors.scrollbarSliderHoverBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider.active {",` background: ${a.colors.scrollbarSliderActiveBackground.css};`,"}"].join(`
|
|
600
|
-
`)})),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(d=>this._handleScroll(d)))}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),n=t-this._bufferService.buffer.ydisp;n!==0&&(this._latestYDisp=t,this._onRequestScrollLines.fire(n)),this._isHandlingScroll=!1}};My=Xt([Me(2,ir),Me(3,bs),Me(4,z5),Me(5,Yl),Me(6,sr),Me(7,xs)],My);var Ny=class extends Je{constructor(e,t,n,r,s){super(),this._screenElement=e,this._bufferService=t,this._coreBrowserService=n,this._decorationService=r,this._renderService=s,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(a=>this._removeDecoration(a))),this._register($t(()=>{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 r;let t=this._coreBrowserService.mainDocument.createElement("div");t.classList.add("xterm-decoration"),t.classList.toggle("xterm-decoration-top-layer",((r=e==null?void 0:e.options)==null?void 0:r.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 n=e.options.x??0;return n&&n>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 n=this._decorationElements.get(e);n||(n=this._createElement(e),e.element=n,this._decorationElements.set(e,n),this._container.appendChild(n),e.onDispose(()=>{this._decorationElements.delete(e),n.remove()})),n.style.display=this._altBufferIsActive?"none":"block",this._altBufferIsActive||(n.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,n.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,n.style.top=`${t*this._renderService.dimensions.css.cell.height}px`,n.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`),e.onRenderEmitter.fire(n)}}_refreshXPosition(e,t=e.element){if(!t)return;let n=e.options.x??0;(e.options.anchor||"left")==="right"?t.style.right=n?`${n*this._renderService.dimensions.css.cell.width}px`:"":t.style.left=n?`${n*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()}};Ny=Xt([Me(1,ir),Me(2,bs),Me(3,fd),Me(4,xs)],Ny);var sQ=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,n){return t>=e.startBufferLine-this._linePadding[n||"full"]&&t<=e.endBufferLine+this._linePadding[n||"full"]}_addLineToZone(e,t){e.startBufferLine=Math.min(e.startBufferLine,t),e.endBufferLine=Math.max(e.endBufferLine,t)}},xi={full:0,left:0,center:0,right:0},Xs={full:0,left:0,center:0,right:0},Qc={full:0,left:0,center:0,right:0},np=class extends Je{constructor(e,t,n,r,s,a,l,u){var d;super(),this._viewportElement=e,this._screenElement=t,this._bufferService=n,this._decorationService=r,this._renderService=s,this._optionsService=a,this._themeService=l,this._coreBrowserService=u,this._colorZoneStore=new sQ,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(),(d=this._viewportElement.parentElement)==null||d.insertBefore(this._canvas,this._viewportElement),this._register($t(()=>{var m;return(m=this._canvas)==null?void 0:m.remove()}));let h=this._canvas.getContext("2d");if(h)this._ctx=h;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);Xs.full=this._canvas.width,Xs.left=e,Xs.center=t,Xs.right=e,this._refreshDrawHeightConstants(),Qc.full=1,Qc.left=1,Qc.center=1+Xs.left,Qc.right=1+Xs.left+Xs.center}_refreshDrawHeightConstants(){xi.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);xi.left=t,xi.center=t,xi.right=t}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*xi.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*xi.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*xi.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*xi.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(Qc[e.position||"full"],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-xi[e.position||"full"]/2),Xs[e.position||"full"],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+xi[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}))}};np=Xt([Me(2,ir),Me(3,fd),Me(4,xs),Me(5,sr),Me(6,Yl),Me(7,bs)],np);var ge;(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=`
|
|
601
|
-
`,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=""))(ge||(ge={}));var Ef;(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=""))(Ef||(Ef={}));var rD;(e=>e.ST=`${ge.ESC}\\`)(rD||(rD={}));var Ay=class{constructor(e,t,n,r,s,a){this._textarea=e,this._compositionView=t,this._bufferService=n,this._optionsService=r,this._coreService=s,this._renderService=a,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 n;t.start+=this._dataAlreadySent.length,this._isComposing?n=this._textarea.value.substring(t.start,this._compositionPosition.start):n=this._textarea.value.substring(t.start),n.length>0&&this._coreService.triggerDataEvent(n,!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,n=t.replace(e,"");this._dataAlreadySent=n,t.length>e.length?this._coreService.triggerDataEvent(n,!0):t.length<e.length?this._coreService.triggerDataEvent(`${ge.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),n=this._renderService.dimensions.css.cell.height,r=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,s=t*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=s+"px",this._compositionView.style.top=r+"px",this._compositionView.style.height=n+"px",this._compositionView.style.lineHeight=n+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";let a=this._compositionView.getBoundingClientRect();this._textarea.style.left=s+"px",this._textarea.style.top=r+"px",this._textarea.style.width=Math.max(a.width,1)+"px",this._textarea.style.height=Math.max(a.height,1)+"px",this._textarea.style.lineHeight=a.height+"px"}e||setTimeout(()=>this.updateCompositionElements(!0),0)}}};Ay=Xt([Me(2,ir),Me(3,sr),Me(4,va),Me(5,xs)],Ay);var En=0,Rn=0,Tn=0,Yt=0,cE={css:"#00000000",rgba:0},cn;(e=>{function t(s,a,l,u){return u!==void 0?`#${Uo(s)}${Uo(a)}${Uo(l)}${Uo(u)}`:`#${Uo(s)}${Uo(a)}${Uo(l)}`}e.toCss=t;function n(s,a,l,u=255){return(s<<24|a<<16|l<<8|u)>>>0}e.toRgba=n;function r(s,a,l,u){return{css:e.toCss(s,a,l,u),rgba:e.toRgba(s,a,l,u)}}e.toColor=r})(cn||(cn={}));var Ht;(e=>{function t(h,d){if(Yt=(d.rgba&255)/255,Yt===1)return{css:d.css,rgba:d.rgba};let m=d.rgba>>24&255,g=d.rgba>>16&255,_=d.rgba>>8&255,b=h.rgba>>24&255,w=h.rgba>>16&255,S=h.rgba>>8&255;En=b+Math.round((m-b)*Yt),Rn=w+Math.round((g-w)*Yt),Tn=S+Math.round((_-S)*Yt);let C=cn.toCss(En,Rn,Tn),k=cn.toRgba(En,Rn,Tn);return{css:C,rgba:k}}e.blend=t;function n(h){return(h.rgba&255)===255}e.isOpaque=n;function r(h,d,m){let g=Rf.ensureContrastRatio(h.rgba,d.rgba,m);if(g)return cn.toColor(g>>24&255,g>>16&255,g>>8&255)}e.ensureContrastRatio=r;function s(h){let d=(h.rgba|255)>>>0;return[En,Rn,Tn]=Rf.toChannels(d),{css:cn.toCss(En,Rn,Tn),rgba:d}}e.opaque=s;function a(h,d){return Yt=Math.round(d*255),[En,Rn,Tn]=Rf.toChannels(h.rgba),{css:cn.toCss(En,Rn,Tn,Yt),rgba:cn.toRgba(En,Rn,Tn,Yt)}}e.opacity=a;function l(h,d){return Yt=h.rgba&255,a(h,Yt*d/255)}e.multiplyOpacity=l;function u(h){return[h.rgba>>24&255,h.rgba>>16&255,h.rgba>>8&255]}e.toColorRGB=u})(Ht||(Ht={}));var Vt;(e=>{let t,n;try{let s=document.createElement("canvas");s.width=1,s.height=1;let a=s.getContext("2d",{willReadFrequently:!0});a&&(t=a,t.globalCompositeOperation="copy",n=t.createLinearGradient(0,0,1,1))}catch{}function r(s){if(s.match(/#[\da-f]{3,8}/i))switch(s.length){case 4:return En=parseInt(s.slice(1,2).repeat(2),16),Rn=parseInt(s.slice(2,3).repeat(2),16),Tn=parseInt(s.slice(3,4).repeat(2),16),cn.toColor(En,Rn,Tn);case 5:return En=parseInt(s.slice(1,2).repeat(2),16),Rn=parseInt(s.slice(2,3).repeat(2),16),Tn=parseInt(s.slice(3,4).repeat(2),16),Yt=parseInt(s.slice(4,5).repeat(2),16),cn.toColor(En,Rn,Tn,Yt);case 7:return{css:s,rgba:(parseInt(s.slice(1),16)<<8|255)>>>0};case 9:return{css:s,rgba:parseInt(s.slice(1),16)>>>0}}let a=s.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(a)return En=parseInt(a[1]),Rn=parseInt(a[2]),Tn=parseInt(a[3]),Yt=Math.round((a[5]===void 0?1:parseFloat(a[5]))*255),cn.toColor(En,Rn,Tn,Yt);if(!t||!n)throw new Error("css.toColor: Unsupported css format");if(t.fillStyle=n,t.fillStyle=s,typeof t.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(t.fillRect(0,0,1,1),[En,Rn,Tn,Yt]=t.getImageData(0,0,1,1).data,Yt!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:cn.toRgba(En,Rn,Tn,Yt),css:s}}e.toColor=r})(Vt||(Vt={}));var Jn;(e=>{function t(r){return n(r>>16&255,r>>8&255,r&255)}e.relativeLuminance=t;function n(r,s,a){let l=r/255,u=s/255,h=a/255,d=l<=.03928?l/12.92:Math.pow((l+.055)/1.055,2.4),m=u<=.03928?u/12.92:Math.pow((u+.055)/1.055,2.4),g=h<=.03928?h/12.92:Math.pow((h+.055)/1.055,2.4);return d*.2126+m*.7152+g*.0722}e.relativeLuminance2=n})(Jn||(Jn={}));var Rf;(e=>{function t(l,u){if(Yt=(u&255)/255,Yt===1)return u;let h=u>>24&255,d=u>>16&255,m=u>>8&255,g=l>>24&255,_=l>>16&255,b=l>>8&255;return En=g+Math.round((h-g)*Yt),Rn=_+Math.round((d-_)*Yt),Tn=b+Math.round((m-b)*Yt),cn.toRgba(En,Rn,Tn)}e.blend=t;function n(l,u,h){let d=Jn.relativeLuminance(l>>8),m=Jn.relativeLuminance(u>>8);if(ls(d,m)<h){if(m<d){let b=r(l,u,h),w=ls(d,Jn.relativeLuminance(b>>8));if(w<h){let S=s(l,u,h),C=ls(d,Jn.relativeLuminance(S>>8));return w>C?b:S}return b}let g=s(l,u,h),_=ls(d,Jn.relativeLuminance(g>>8));if(_<h){let b=r(l,u,h),w=ls(d,Jn.relativeLuminance(b>>8));return _>w?g:b}return g}}e.ensureContrastRatio=n;function r(l,u,h){let d=l>>24&255,m=l>>16&255,g=l>>8&255,_=u>>24&255,b=u>>16&255,w=u>>8&255,S=ls(Jn.relativeLuminance2(_,b,w),Jn.relativeLuminance2(d,m,g));for(;S<h&&(_>0||b>0||w>0);)_-=Math.max(0,Math.ceil(_*.1)),b-=Math.max(0,Math.ceil(b*.1)),w-=Math.max(0,Math.ceil(w*.1)),S=ls(Jn.relativeLuminance2(_,b,w),Jn.relativeLuminance2(d,m,g));return(_<<24|b<<16|w<<8|255)>>>0}e.reduceLuminance=r;function s(l,u,h){let d=l>>24&255,m=l>>16&255,g=l>>8&255,_=u>>24&255,b=u>>16&255,w=u>>8&255,S=ls(Jn.relativeLuminance2(_,b,w),Jn.relativeLuminance2(d,m,g));for(;S<h&&(_<255||b<255||w<255);)_=Math.min(255,_+Math.ceil((255-_)*.1)),b=Math.min(255,b+Math.ceil((255-b)*.1)),w=Math.min(255,w+Math.ceil((255-w)*.1)),S=ls(Jn.relativeLuminance2(_,b,w),Jn.relativeLuminance2(d,m,g));return(_<<24|b<<16|w<<8|255)>>>0}e.increaseLuminance=s;function a(l){return[l>>24&255,l>>16&255,l>>8&255,l&255]}e.toChannels=a})(Rf||(Rf={}));function Uo(e){let t=e.toString(16);return t.length<2?"0"+t:t}function ls(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}var oQ=class extends hd{constructor(e,t,n){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=n}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()]}},rp=class{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new Qr}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 n=[],r=t.translateToString(!0),s=0,a=0,l=0,u=t.getFg(0),h=t.getBg(0);for(let d=0;d<t.getTrimmedLength();d++)if(t.loadCell(d,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==u||this._workCell.bg!==h){if(d-s>1){let m=this._getJoinedRanges(r,l,a,t,s);for(let g=0;g<m.length;g++)n.push(m[g])}s=d,l=a,u=this._workCell.fg,h=this._workCell.bg}a+=this._workCell.getChars().length||so.length}if(this._bufferService.cols-s>1){let d=this._getJoinedRanges(r,l,a,t,s);for(let m=0;m<d.length;m++)n.push(d[m])}return n}_getJoinedRanges(e,t,n,r,s){let a=e.substring(t,n),l=[];try{l=this._characterJoiners[0].handler(a)}catch(u){console.error(u)}for(let u=1;u<this._characterJoiners.length;u++)try{let h=this._characterJoiners[u].handler(a);for(let d=0;d<h.length;d++)rp._mergeRanges(l,h[d])}catch(h){console.error(h)}return this._stringRangesToCellRanges(l,r,s),l}_stringRangesToCellRanges(e,t,n){let r=0,s=!1,a=0,l=e[r];if(l){for(let u=n;u<this._bufferService.cols;u++){let h=t.getWidth(u),d=t.getString(u).length||so.length;if(h!==0){if(!s&&l[0]<=a&&(l[0]=u,s=!0),l[1]<=a){if(l[1]=u,l=e[++r],!l)break;l[0]<=a?(l[0]=u,s=!0):s=!1}a+=d}}l&&(l[1]=this._bufferService.cols)}}static _mergeRanges(e,t){let n=!1;for(let r=0;r<e.length;r++){let s=e[r];if(n){if(t[1]<=s[0])return e[r-1][1]=t[1],e;if(t[1]<=s[1])return e[r-1][1]=Math.max(t[1],s[1]),e.splice(r,1),e;e.splice(r,1),r--}else{if(t[1]<=s[0])return e.splice(r,0,t),e;if(t[1]<=s[1])return s[0]=Math.min(t[0],s[0]),e;t[0]<s[1]&&(s[0]=Math.min(t[0],s[0]),n=!0);continue}}return n?e[e.length-1][1]=t[1]:e.push(t),e}};rp=Xt([Me(0,ir)],rp);function aQ(e){return 57508<=e&&e<=57558}function lQ(e){return 9472<=e&&e<=9631}function cQ(e){return aQ(e)||lQ(e)}function uQ(){return{css:{canvas:Zh(),cell:Zh()},device:{canvas:Zh(),cell:Zh(),char:{width:0,height:0,left:0,top:0}}}}function Zh(){return{width:0,height:0}}var Dy=class{constructor(e,t,n,r,s,a,l){this._document=e,this._characterJoinerService=t,this._optionsService=n,this._coreBrowserService=r,this._coreService=s,this._decorationService=a,this._themeService=l,this._workCell=new Qr,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(e,t,n){this._selectionStart=e,this._selectionEnd=t,this._columnSelectMode=n}createRow(e,t,n,r,s,a,l,u,h,d,m){let g=[],_=this._characterJoinerService.getJoinedCharacters(t),b=this._themeService.colors,w=e.getNoBgTrimmedLength();n&&w<a+1&&(w=a+1);let S,C=0,k="",R=0,T=0,N=0,L=0,A=!1,O=0,F=!1,G=0,B=0,H=[],P=d!==-1&&m!==-1;for(let U=0;U<w;U++){e.loadCell(U,this._workCell);let V=this._workCell.getWidth();if(V===0)continue;let W=!1,z=U>=B,$=U,q=this._workCell;if(_.length>0&&U===_[0][0]&&z){let _e=_.shift(),xe=this._isCellInSelection(_e[0],t);for(R=_e[0]+1;R<_e[1];R++)z&&(z=xe===this._isCellInSelection(R,t));z&&(z=!n||a<_e[0]||a>=_e[1]),z?(W=!0,q=new oQ(this._workCell,e.translateToString(!0,_e[0],_e[1]),_e[1]-_e[0]),$=_e[1]-1,V=q.getWidth()):B=_e[1]}let Q=this._isCellInSelection(U,t),M=n&&U===a,I=P&&U>=d&&U<=m,Z=!1;this._decorationService.forEachDecorationAtCell(U,t,void 0,_e=>{Z=!0});let j=q.getChars()||so;if(j===" "&&(q.isUnderline()||q.isOverline())&&(j=" "),G=V*u-h.get(j,q.isBold(),q.isItalic()),!S)S=this._document.createElement("span");else if(C&&(Q&&F||!Q&&!F&&q.bg===T)&&(Q&&F&&b.selectionForeground||q.fg===N)&&q.extended.ext===L&&I===A&&G===O&&!M&&!W&&!Z&&z){q.isInvisible()?k+=so:k+=j,C++;continue}else C&&(S.textContent=k),S=this._document.createElement("span"),C=0,k="";if(T=q.bg,N=q.fg,L=q.extended.ext,A=I,O=G,F=Q,W&&a>=U&&a<=$&&(a=U),!this._coreService.isCursorHidden&&M&&this._coreService.isCursorInitialized){if(H.push("xterm-cursor"),this._coreBrowserService.isFocused)l&&H.push("xterm-cursor-blink"),H.push(r==="bar"?"xterm-cursor-bar":r==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(s)switch(s){case"outline":H.push("xterm-cursor-outline");break;case"block":H.push("xterm-cursor-block");break;case"bar":H.push("xterm-cursor-bar");break;case"underline":H.push("xterm-cursor-underline");break}}if(q.isBold()&&H.push("xterm-bold"),q.isItalic()&&H.push("xterm-italic"),q.isDim()&&H.push("xterm-dim"),q.isInvisible()?k=so:k=q.getChars()||so,q.isUnderline()&&(H.push(`xterm-underline-${q.extended.underlineStyle}`),k===" "&&(k=" "),!q.isUnderlineColorDefault()))if(q.isUnderlineColorRGB())S.style.textDecorationColor=`rgb(${hd.toColorRGB(q.getUnderlineColor()).join(",")})`;else{let _e=q.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&q.isBold()&&_e<8&&(_e+=8),S.style.textDecorationColor=b.ansi[_e].css}q.isOverline()&&(H.push("xterm-overline"),k===" "&&(k=" ")),q.isStrikethrough()&&H.push("xterm-strikethrough"),I&&(S.style.textDecoration="underline");let ce=q.getFgColor(),fe=q.getFgColorMode(),ue=q.getBgColor(),de=q.getBgColorMode(),we=!!q.isInverse();if(we){let _e=ce;ce=ue,ue=_e;let xe=fe;fe=de,de=xe}let oe,be,Ne=!1;this._decorationService.forEachDecorationAtCell(U,t,void 0,_e=>{_e.options.layer!=="top"&&Ne||(_e.backgroundColorRGB&&(de=50331648,ue=_e.backgroundColorRGB.rgba>>8&16777215,oe=_e.backgroundColorRGB),_e.foregroundColorRGB&&(fe=50331648,ce=_e.foregroundColorRGB.rgba>>8&16777215,be=_e.foregroundColorRGB),Ne=_e.options.layer==="top")}),!Ne&&Q&&(oe=this._coreBrowserService.isFocused?b.selectionBackgroundOpaque:b.selectionInactiveBackgroundOpaque,ue=oe.rgba>>8&16777215,de=50331648,Ne=!0,b.selectionForeground&&(fe=50331648,ce=b.selectionForeground.rgba>>8&16777215,be=b.selectionForeground)),Ne&&H.push("xterm-decoration-top");let Se;switch(de){case 16777216:case 33554432:Se=b.ansi[ue],H.push(`xterm-bg-${ue}`);break;case 50331648:Se=cn.toColor(ue>>16,ue>>8&255,ue&255),this._addStyle(S,`background-color:#${uE((ue>>>0).toString(16),"0",6)}`);break;case 0:default:we?(Se=b.foreground,H.push("xterm-bg-257")):Se=b.background}switch(oe||q.isDim()&&(oe=Ht.multiplyOpacity(Se,.5)),fe){case 16777216:case 33554432:q.isBold()&&ce<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(ce+=8),this._applyMinimumContrast(S,Se,b.ansi[ce],q,oe,void 0)||H.push(`xterm-fg-${ce}`);break;case 50331648:let _e=cn.toColor(ce>>16&255,ce>>8&255,ce&255);this._applyMinimumContrast(S,Se,_e,q,oe,be)||this._addStyle(S,`color:#${uE(ce.toString(16),"0",6)}`);break;case 0:default:this._applyMinimumContrast(S,Se,b.foreground,q,oe,be)||we&&H.push("xterm-fg-257")}H.length&&(S.className=H.join(" "),H.length=0),!M&&!W&&!Z&&z?C++:S.textContent=k,G!==this.defaultSpacing&&(S.style.letterSpacing=`${G}px`),g.push(S),U=$}return S&&C&&(S.textContent=k),g}_applyMinimumContrast(e,t,n,r,s,a){if(this._optionsService.rawOptions.minimumContrastRatio===1||cQ(r.getCode()))return!1;let l=this._getContrastCache(r),u;if(!s&&!a&&(u=l.getColor(t.rgba,n.rgba)),u===void 0){let h=this._optionsService.rawOptions.minimumContrastRatio/(r.isDim()?2:1);u=Ht.ensureContrastRatio(s||t,a||n,h),l.setColor((s||t).rgba,(a||n).rgba,u??null)}return u?(this._addStyle(e,`color:${u.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 n=this._selectionStart,r=this._selectionEnd;return!n||!r?!1:this._columnSelectMode?n[0]<=r[0]?e>=n[0]&&t>=n[1]&&e<r[0]&&t<=r[1]:e<n[0]&&t>=n[1]&&e>=r[0]&&t<=r[1]:t>n[1]&&t<r[1]||n[1]===r[1]&&t===n[1]&&e>=n[0]&&e<r[0]||n[1]<r[1]&&t===r[1]&&e<r[0]||n[1]<r[1]&&t===n[1]&&e>=n[0]}};Dy=Xt([Me(1,I5),Me(2,sr),Me(3,bs),Me(4,va),Me(5,fd),Me(6,Yl)],Dy);function uE(e,t,n){for(;e.length<n;)e=t+e;return e}var dQ=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 n=e.createElement("span");n.classList.add("xterm-char-measure-element");let r=e.createElement("span");r.classList.add("xterm-char-measure-element"),r.style.fontWeight="bold";let s=e.createElement("span");s.classList.add("xterm-char-measure-element"),s.style.fontStyle="italic";let a=e.createElement("span");a.classList.add("xterm-char-measure-element"),a.style.fontWeight="bold",a.style.fontStyle="italic",this._measureElements=[n,r,s,a],this._container.appendChild(n),this._container.appendChild(r),this._container.appendChild(s),this._container.appendChild(a),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,n,r){e===this._font&&t===this._fontSize&&n===this._weight&&r===this._weightBold||(this._font=e,this._fontSize=t,this._weight=n,this._weightBold=r,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${n}`,this._measureElements[1].style.fontWeight=`${r}`,this._measureElements[2].style.fontWeight=`${n}`,this._measureElements[3].style.fontWeight=`${r}`,this.clear())}get(e,t,n){let r=0;if(!t&&!n&&e.length===1&&(r=e.charCodeAt(0))<256){if(this._flat[r]!==-9999)return this._flat[r];let l=this._measure(e,0);return l>0&&(this._flat[r]=l),l}let s=e;t&&(s+="B"),n&&(s+="I");let a=this._holey.get(s);if(a===void 0){let l=0;t&&(l|=1),n&&(l|=2),a=this._measure(e,l),a>0&&this._holey.set(s,a)}return a}_measure(e,t){let n=this._measureElements[t];return n.textContent=e.repeat(32),n.offsetWidth/32}},hQ=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,n,r=!1){if(this.selectionStart=t,this.selectionEnd=n,!t||!n||t[0]===n[0]&&t[1]===n[1]){this.clear();return}let s=e.buffers.active.ydisp,a=t[1]-s,l=n[1]-s,u=Math.max(a,0),h=Math.min(l,e.rows-1);if(u>=e.rows||h<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=r,this.viewportStartRow=a,this.viewportEndRow=l,this.viewportCappedStartRow=u,this.viewportCappedEndRow=h,this.startCol=t[0],this.endCol=n[0]}isCellSelected(e,t,n){return this.hasSelection?(n-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?t>=this.startCol&&n>=this.viewportCappedStartRow&&t<this.endCol&&n<=this.viewportCappedEndRow:t<this.startCol&&n>=this.viewportCappedStartRow&&t>=this.endCol&&n<=this.viewportCappedEndRow:n>this.viewportStartRow&&n<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&n===this.viewportStartRow&&t>=this.startCol&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&n===this.viewportEndRow&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&n===this.viewportStartRow&&t>=this.startCol):!1}};function fQ(){return new hQ}var l_="xterm-dom-renderer-owner-",Wr="xterm-rows",Qh="xterm-fg-",dE="xterm-bg-",Jc="xterm-focus",Jh="xterm-selection",pQ=1,Oy=class extends Je{constructor(e,t,n,r,s,a,l,u,h,d,m,g,_,b){super(),this._terminal=e,this._document=t,this._element=n,this._screenElement=r,this._viewportElement=s,this._helperContainer=a,this._linkifier2=l,this._charSizeService=h,this._optionsService=d,this._bufferService=m,this._coreService=g,this._coreBrowserService=_,this._themeService=b,this._terminalClass=pQ++,this._rowElements=[],this._selectionRenderModel=fQ(),this.onRequestRedraw=this._register(new ke).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(Wr),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(Jh),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=uQ(),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=u.createInstance(Dy,document),this._element.classList.add(l_+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($t(()=>{this._element.classList.remove(l_+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new dQ(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 n of this._rowElements)n.style.width=`${this.dimensions.css.canvas.width}px`,n.style.height=`${this.dimensions.css.cell.height}px`,n.style.lineHeight=`${this.dimensions.css.cell.height}px`,n.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));let t=`${this._terminalSelector} .${Wr} 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} .${Wr} { 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} .${Wr} .xterm-dim { color: ${Ht.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 n=`blink_underline_${this._terminalClass}`,r=`blink_bar_${this._terminalClass}`,s=`blink_block_${this._terminalClass}`;t+=`@keyframes ${n} { 50% { border-bottom-style: hidden; }}`,t+=`@keyframes ${r} { 50% { box-shadow: none; }}`,t+=`@keyframes ${s} { 0% { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css}; } 50% { background-color: inherit; color: ${e.cursor.css}; }}`,t+=`${this._terminalSelector} .${Wr}.${Jc} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${n} 1s step-end infinite;}${this._terminalSelector} .${Wr}.${Jc} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${r} 1s step-end infinite;}${this._terminalSelector} .${Wr}.${Jc} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${s} 1s step-end infinite;}${this._terminalSelector} .${Wr} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${Wr} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${Wr} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${Wr} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${Wr} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,t+=`${this._terminalSelector} .${Jh} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${Jh} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${Jh} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[a,l]of e.ansi.entries())t+=`${this._terminalSelector} .${Qh}${a} { color: ${l.css}; }${this._terminalSelector} .${Qh}${a}.xterm-dim { color: ${Ht.multiplyOpacity(l,.5).css}; }${this._terminalSelector} .${dE}${a} { background-color: ${l.css}; }`;t+=`${this._terminalSelector} .${Qh}257 { color: ${Ht.opaque(e.background).css}; }${this._terminalSelector} .${Qh}257.xterm-dim { color: ${Ht.multiplyOpacity(Ht.opaque(e.background),.5).css}; }${this._terminalSelector} .${dE}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 n=this._rowElements.length;n<=t;n++){let r=this._document.createElement("div");this._rowContainer.appendChild(r),this._rowElements.push(r)}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(Jc),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(Jc),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(e,t,n){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(e,t,n),this.renderRows(0,this._bufferService.rows-1),!e||!t||(this._selectionRenderModel.update(this._terminal,e,t,n),!this._selectionRenderModel.hasSelection))return;let r=this._selectionRenderModel.viewportStartRow,s=this._selectionRenderModel.viewportEndRow,a=this._selectionRenderModel.viewportCappedStartRow,l=this._selectionRenderModel.viewportCappedEndRow,u=this._document.createDocumentFragment();if(n){let h=e[0]>t[0];u.appendChild(this._createSelectionElement(a,h?t[0]:e[0],h?e[0]:t[0],l-a+1))}else{let h=r===a?e[0]:0,d=a===s?t[0]:this._bufferService.cols;u.appendChild(this._createSelectionElement(a,h,d));let m=l-a-1;if(u.appendChild(this._createSelectionElement(a+1,0,this._bufferService.cols,m)),a!==l){let g=s===l?t[0]:this._bufferService.cols;u.appendChild(this._createSelectionElement(l,0,g))}}this._selectionContainer.appendChild(u)}_createSelectionElement(e,t,n,r=1){let s=this._document.createElement("div"),a=t*this.dimensions.css.cell.width,l=this.dimensions.css.cell.width*(n-t);return a+l>this.dimensions.css.canvas.width&&(l=this.dimensions.css.canvas.width-a),s.style.height=`${r*this.dimensions.css.cell.height}px`,s.style.top=`${e*this.dimensions.css.cell.height}px`,s.style.left=`${a}px`,s.style.width=`${l}px`,s}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 n=this._bufferService.buffer,r=n.ybase+n.y,s=Math.min(n.x,this._bufferService.cols-1),a=this._coreService.decPrivateModes.cursorBlink??this._optionsService.rawOptions.cursorBlink,l=this._coreService.decPrivateModes.cursorStyle??this._optionsService.rawOptions.cursorStyle,u=this._optionsService.rawOptions.cursorInactiveStyle;for(let h=e;h<=t;h++){let d=h+n.ydisp,m=this._rowElements[h],g=n.lines.get(d);if(!m||!g)break;m.replaceChildren(...this._rowFactory.createRow(g,d,d===r,l,u,s,a,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${l_}${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,n,r,s,a){n<0&&(e=0),r<0&&(t=0);let l=this._bufferService.rows-1;n=Math.max(Math.min(n,l),0),r=Math.max(Math.min(r,l),0),s=Math.min(s,this._bufferService.cols);let u=this._bufferService.buffer,h=u.ybase+u.y,d=Math.min(u.x,s-1),m=this._optionsService.rawOptions.cursorBlink,g=this._optionsService.rawOptions.cursorStyle,_=this._optionsService.rawOptions.cursorInactiveStyle;for(let b=n;b<=r;++b){let w=b+u.ydisp,S=this._rowElements[b],C=u.lines.get(w);if(!S||!C)break;S.replaceChildren(...this._rowFactory.createRow(C,w,w===h,g,_,d,m,this.dimensions.css.cell.width,this._widthCache,a?b===n?e:0:-1,a?(b===r?t:s)-1:-1))}}};Oy=Xt([Me(7,Y0),Me(8,Vp),Me(9,sr),Me(10,ir),Me(11,va),Me(12,bs),Me(13,Yl)],Oy);var jy=class extends Je{constructor(e,t,n){super(),this._optionsService=n,this.width=0,this.height=0,this._onCharSizeChange=this._register(new ke),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new gQ(this._optionsService))}catch{this._measureStrategy=this._register(new mQ(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())}};jy=Xt([Me(2,sr)],jy);var iD=class extends Je{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)}},mQ=class extends iD{constructor(e,t,n){super(),this._document=e,this._parentElement=t,this._optionsService=n,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}},gQ=class extends iD{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}},vQ=class extends Je{constructor(e,t,n){super(),this._textarea=e,this._window=t,this.mainDocument=n,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=this._register(new _Q(this._window)),this._onDprChange=this._register(new ke),this.onDprChange=this._onDprChange.event,this._onWindowChange=this._register(new ke),this.onWindowChange=this._onWindowChange.event,this._register(this.onWindowChange(r=>this._screenDprMonitor.setWindow(r))),this._register(Un.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(Ue(this._textarea,"focus",()=>this._isFocused=!0)),this._register(Ue(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}},_Q=class extends Je{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this._register(new Ol),this._onDprChange=this._register(new ke),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this._register($t(()=>this.clearListener()))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=Ue(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)}},yQ=class extends Je{constructor(){super(),this.linkProviders=[],this._register($t(()=>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 rx(e,t,n){let r=n.getBoundingClientRect(),s=e.getComputedStyle(n),a=parseInt(s.getPropertyValue("padding-left")),l=parseInt(s.getPropertyValue("padding-top"));return[t.clientX-r.left-a,t.clientY-r.top-l]}function bQ(e,t,n,r,s,a,l,u,h){if(!a)return;let d=rx(e,t,n);if(d)return d[0]=Math.ceil((d[0]+(h?l/2:0))/l),d[1]=Math.ceil(d[1]/u),d[0]=Math.min(Math.max(d[0],1),r+(h?1:0)),d[1]=Math.min(Math.max(d[1],1),s),d}var Ly=class{constructor(e,t){this._renderService=e,this._charSizeService=t}getCoords(e,t,n,r,s){return bQ(window,e,t,n,r,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,s)}getMouseReportCoords(e,t){let n=rx(window,e,t);if(this._charSizeService.hasValidSize)return n[0]=Math.min(Math.max(n[0],0),this._renderService.dimensions.css.canvas.width-1),n[1]=Math.min(Math.max(n[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(n[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(n[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(n[0]),y:Math.floor(n[1])}}};Ly=Xt([Me(0,xs),Me(1,Vp)],Ly);var xQ=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,n){this._rowCount=n,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=[]}},sD={};AX(sD,{getSafariVersion:()=>SQ,isChromeOS:()=>cD,isFirefox:()=>oD,isIpad:()=>CQ,isIphone:()=>kQ,isLegacyEdge:()=>wQ,isLinux:()=>ix,isMac:()=>ip,isNode:()=>qp,isSafari:()=>aD,isWindows:()=>lD});var qp=typeof process<"u"&&"title"in process,pd=qp?"node":navigator.userAgent,md=qp?"node":navigator.platform,oD=pd.includes("Firefox"),wQ=pd.includes("Edge"),aD=/^((?!chrome|android).)*safari/i.test(pd);function SQ(){if(!aD)return 0;let e=pd.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}var ip=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(md),CQ=md==="iPad",kQ=md==="iPhone",lD=["Windows","Win16","Win32","WinCE"].includes(md),ix=md.indexOf("Linux")>=0,cD=/\bCrOS\b/.test(pd),uD=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,n=0,r=e.timeRemaining(),s=0;for(;this._i<this._tasks.length;){if(t=performance.now(),this._tasks[this._i]()||this._i++,t=Math.max(1,performance.now()-t),n=Math.max(t,n),s=e.timeRemaining(),n*1.5>s){r-t<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(r-t))}ms`),this._start();return}r=s}this.clear()}},EQ=class extends uD{_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())}}},RQ=class extends uD{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},sp=!qp&&"requestIdleCallback"in window?RQ:EQ,TQ=class{constructor(){this._queue=new sp}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}},zy=class extends Je{constructor(e,t,n,r,s,a,l,u,h){super(),this._rowCount=e,this._optionsService=n,this._charSizeService=r,this._coreService=s,this._coreBrowserService=u,this._renderer=this._register(new Ol),this._pausedResizeTask=new TQ,this._observerDisposable=this._register(new Ol),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 ke),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this._register(new ke),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this._register(new ke),this.onRender=this._onRender.event,this._onRefreshRequest=this._register(new ke),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new xQ((d,m)=>this._renderRows(d,m),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new MQ(this._coreBrowserService,this._coreService,()=>this._fullRefresh()),this._register($t(()=>this._syncOutputHandler.dispose())),this._register(this._coreBrowserService.onDprChange(()=>this.handleDevicePixelRatioChange())),this._register(l.onResize(()=>this._fullRefresh())),this._register(l.buffers.onBufferActivate(()=>{var d;return(d=this._renderer.value)==null?void 0:d.clear()})),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this._register(a.onDecorationRegistered(()=>this._fullRefresh())),this._register(a.onDecorationRemoved(()=>this._fullRefresh())),this._register(this._optionsService.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(l.cols,l.rows),this._fullRefresh()})),this._register(this._optionsService.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(l.buffer.y,l.buffer.y,!0))),this._register(h.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(this._coreBrowserService.window,t),this._register(this._coreBrowserService.onWindowChange(d=>this._registerIntersectionObserver(d,t)))}get dimensions(){return this._renderer.value.dimensions}_registerIntersectionObserver(e,t){if("IntersectionObserver"in e){let n=new e.IntersectionObserver(r=>this._handleIntersectionChange(r[r.length-1]),{threshold:0});n.observe(t),this._observerDisposable.value=$t(()=>n.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,n=!1){if(this._isPaused){this._needsFullRefresh=!0;return}if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}let r=this._syncOutputHandler.flush();r&&(e=Math.min(e,r.start),t=Math.max(t,r.end)),n||(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 n;return(n=this._renderer.value)==null?void 0:n.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,n){var r;this._selectionState.start=e,this._selectionState.end=t,this._selectionState.columnSelectMode=n,(r=this._renderer.value)==null||r.handleSelectionChanged(e,t,n)}handleCursorMove(){var e;(e=this._renderer.value)==null||e.handleCursorMove()}clear(){var e;(e=this._renderer.value)==null||e.clear()}};zy=Xt([Me(2,sr),Me(3,Vp),Me(4,va),Me(5,fd),Me(6,ir),Me(7,bs),Me(8,Yl)],zy);var MQ=class{constructor(e,t,n){this._coreBrowserService=e,this._coreService=t,this._onTimeout=n,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 NQ(e,t,n,r){let s=n.buffer.x,a=n.buffer.y;if(!n.buffer.hasScrollback)return OQ(s,a,e,t,n,r)+Kp(a,t,n,r)+jQ(s,a,e,t,n,r);let l;if(a===t)return l=s>e?"D":"C",Vu(Math.abs(s-e),Wu(l,r));l=a>t?"D":"C";let u=Math.abs(a-t),h=DQ(a>t?e:s,n)+(u-1)*n.cols+1+AQ(a>t?s:e);return Vu(h,Wu(l,r))}function AQ(e,t){return e-1}function DQ(e,t){return t.cols-e}function OQ(e,t,n,r,s,a){return Kp(t,r,s,a).length===0?"":Vu(hD(e,t,e,t-sa(t,s),!1,s).length,Wu("D",a))}function Kp(e,t,n,r){let s=e-sa(e,n),a=t-sa(t,n),l=Math.abs(s-a)-LQ(e,t,n);return Vu(l,Wu(dD(e,t),r))}function jQ(e,t,n,r,s,a){let l;Kp(t,r,s,a).length>0?l=r-sa(r,s):l=t;let u=r,h=zQ(e,t,n,r,s,a);return Vu(hD(e,l,n,u,h==="C",s).length,Wu(h,a))}function LQ(e,t,n){var l;let r=0,s=e-sa(e,n),a=t-sa(t,n);for(let u=0;u<Math.abs(s-a);u++){let h=dD(e,t)==="A"?-1:1;(l=n.buffer.lines.get(s+h*u))!=null&&l.isWrapped&&r++}return r}function sa(e,t){let n=0,r=t.buffer.lines.get(e),s=r==null?void 0:r.isWrapped;for(;s&&e>=0&&e<t.rows;)n++,r=t.buffer.lines.get(--e),s=r==null?void 0:r.isWrapped;return n}function zQ(e,t,n,r,s,a){let l;return Kp(n,r,s,a).length>0?l=r-sa(r,s):l=t,e<n&&l<=r||e>=n&&l<r?"C":"D"}function dD(e,t){return e>t?"A":"B"}function hD(e,t,n,r,s,a){let l=e,u=t,h="";for(;(l!==n||u!==r)&&u>=0&&u<a.buffer.lines.length;)l+=s?1:-1,s&&l>a.cols-1?(h+=a.buffer.translateBufferLineToString(u,!1,e,l),l=0,e=0,u++):!s&&l<0&&(h+=a.buffer.translateBufferLineToString(u,!1,0,e+1),l=a.cols-1,e=l,u--);return h+a.buffer.translateBufferLineToString(u,!1,e,l)}function Wu(e,t){let n=t?"O":"[";return ge.ESC+n+e}function Vu(e,t){e=Math.floor(e);let n="";for(let r=0;r<e;r++)n+=t;return n}var PQ=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 hE(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 c_=50,BQ=15,IQ=50,HQ=500,FQ=" ",UQ=new RegExp(FQ,"g"),Py=class extends Je{constructor(e,t,n,r,s,a,l,u,h){super(),this._element=e,this._screenElement=t,this._linkifier=n,this._bufferService=r,this._coreService=s,this._mouseService=a,this._optionsService=l,this._renderService=u,this._coreBrowserService=h,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new Qr,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this._register(new ke),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this._register(new ke),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this._register(new ke),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this._register(new ke),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=d=>this._handleMouseMove(d),this._mouseUpListener=d=>this._handleMouseUp(d),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(d=>this._handleTrim(d)),this._register(this._bufferService.buffers.onBufferActivate(d=>this._handleBufferActivate(d))),this.enable(),this._model=new PQ(this._bufferService),this._activeSelectionMode=0,this._register($t(()=>{this._removeMouseDownListeners()})),this._register(this._bufferService.onResize(d=>{d.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 n=this._bufferService.buffer,r=[];if(this._activeSelectionMode===3){if(e[0]===t[0])return"";let s=e[0]<t[0]?e[0]:t[0],a=e[0]<t[0]?t[0]:e[0];for(let l=e[1];l<=t[1];l++){let u=n.translateBufferLineToString(l,!0,s,a);r.push(u)}}else{let s=e[1]===t[1]?t[0]:void 0;r.push(n.translateBufferLineToString(e[1],!0,e[0],s));for(let a=e[1]+1;a<=t[1]-1;a++){let l=n.lines.get(a),u=n.translateBufferLineToString(a,!0);l!=null&&l.isWrapped?r[r.length-1]+=u:r.push(u)}if(e[1]!==t[1]){let a=n.lines.get(t[1]),l=n.translateBufferLineToString(t[1],!0,0,t[0]);a&&a.isWrapped?r[r.length-1]+=l:r.push(l)}}return r.map(s=>s.replace(UQ," ")).join(lD?`\r
|
|
602
|
-
`:`
|
|
603
|
-
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),ix&&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),n=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!n||!r||!t?!1:this._areCoordsInSelection(t,n,r)}isCellInSelection(e,t){let n=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!n||!r?!1:this._areCoordsInSelection([e,t],n,r)}_areCoordsInSelection(e,t,n){return e[1]>t[1]&&e[1]<n[1]||t[1]===n[1]&&e[1]===t[1]&&e[0]>=t[0]&&e[0]<n[0]||t[1]<n[1]&&e[1]===n[1]&&e[0]<n[0]||t[1]<n[1]&&e[1]===t[1]&&e[0]>=t[0]}_selectWordAtCursor(e,t){var s,a;let n=(a=(s=this._linkifier.currentLink)==null?void 0:s.link)==null?void 0:a.range;if(n)return this._model.selectionStart=[n.start.x-1,n.start.y-1],this._model.selectionStartLength=hE(n,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let r=this._getMouseBufferCoords(e);return r?(this._selectWordAt(r,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=rx(this._coreBrowserService.window,e,this._screenElement)[1],n=this._renderService.dimensions.css.canvas.height;return t>=0&&t<=n?0:(t>n&&(t-=n),t=Math.min(Math.max(t,-c_),c_),t/=c_,t/Math.abs(t)+Math.round(t*(BQ-1)))}shouldForceSelection(e){return ip?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(),IQ)}_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&&!(ip&&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 n=this._bufferService.buffer;if(this._model.selectionEnd[1]<n.lines.length){let r=n.lines.get(this._model.selectionEnd[1]);r&&r.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<HQ&&e.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){let n=this._mouseService.getCoords(e,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(n&&n[0]!==void 0&&n[1]!==void 0){let r=NQ(n[0]-1,n[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(r,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd,n=!!e&&!!t&&(e[0]!==t[0]||e[1]!==t[1]);if(!n){this._oldHasSelection&&this._fireOnSelectionChange(e,t,n);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,n)}_fireOnSelectionChange(e,t,n){this._oldSelectionStart=e,this._oldSelectionEnd=t,this._oldHasSelection=n,this._onSelectionChange.fire()}_handleBufferActivate(e){this.clearSelection(),this._trimListener.dispose(),this._trimListener=e.activeBuffer.lines.onTrim(t=>this._handleTrim(t))}_convertViewportColToCharacterIndex(e,t){let n=t;for(let r=0;t>=r;r++){let s=e.loadCell(r,this._workCell).getChars().length;this._workCell.getWidth()===0?n--:s>1&&t!==r&&(n+=s-1)}return n}setSelection(e,t,n){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,t],this._model.selectionStartLength=n,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(e){this._isClickInSelection(e)||(this._selectWordAtCursor(e,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(e,t,n=!0,r=!0){if(e[0]>=this._bufferService.cols)return;let s=this._bufferService.buffer,a=s.lines.get(e[1]);if(!a)return;let l=s.translateBufferLineToString(e[1],!1),u=this._convertViewportColToCharacterIndex(a,e[0]),h=u,d=e[0]-u,m=0,g=0,_=0,b=0;if(l.charAt(u)===" "){for(;u>0&&l.charAt(u-1)===" ";)u--;for(;h<l.length&&l.charAt(h+1)===" ";)h++}else{let C=e[0],k=e[0];a.getWidth(C)===0&&(m++,C--),a.getWidth(k)===2&&(g++,k++);let R=a.getString(k).length;for(R>1&&(b+=R-1,h+=R-1);C>0&&u>0&&!this._isCharWordSeparator(a.loadCell(C-1,this._workCell));){a.loadCell(C-1,this._workCell);let T=this._workCell.getChars().length;this._workCell.getWidth()===0?(m++,C--):T>1&&(_+=T-1,u-=T-1),u--,C--}for(;k<a.length&&h+1<l.length&&!this._isCharWordSeparator(a.loadCell(k+1,this._workCell));){a.loadCell(k+1,this._workCell);let T=this._workCell.getChars().length;this._workCell.getWidth()===2?(g++,k++):T>1&&(b+=T-1,h+=T-1),h++,k++}}h++;let w=u+d-m+_,S=Math.min(this._bufferService.cols,h-u+m+g-_-b);if(!(!t&&l.slice(u,h).trim()==="")){if(n&&w===0&&a.getCodePoint(0)!==32){let C=s.lines.get(e[1]-1);if(C&&a.isWrapped&&C.getCodePoint(this._bufferService.cols-1)!==32){let k=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(k){let R=this._bufferService.cols-k.start;w-=R,S+=R}}}if(r&&w+S===this._bufferService.cols&&a.getCodePoint(this._bufferService.cols-1)!==32){let C=s.lines.get(e[1]+1);if(C!=null&&C.isWrapped&&C.getCodePoint(0)!==32){let k=this._getWordAt([0,e[1]+1],!1,!1,!0);k&&(S+=k.length)}}return{start:w,length:S}}}_selectWordAt(e,t){let n=this._getWordAt(e,t);if(n){for(;n.start<0;)n.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[n.start,e[1]],this._model.selectionStartLength=n.length}}_selectToWordAt(e){let t=this._getWordAt(e,!0);if(t){let n=e[1];for(;t.start<0;)t.start+=this._bufferService.cols,n--;if(!this._model.areSelectionValuesReversed())for(;t.start+t.length>this._bufferService.cols;)t.length-=this._bufferService.cols,n++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?t.start:t.start+t.length,n]}}_isCharWordSeparator(e){return e.getWidth()===0?!1:this._optionsService.rawOptions.wordSeparator.indexOf(e.getChars())>=0}_selectLineAt(e){let t=this._bufferService.buffer.getWrappedRangeForLine(e),n={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=hE(n,this._bufferService.cols)}};Py=Xt([Me(3,ir),Me(4,va),Me(5,X0),Me(6,sr),Me(7,xs),Me(8,bs)],Py);var fE=class{constructor(){this._data={}}set(e,t,n){this._data[e]||(this._data[e]={}),this._data[e][t]=n}get(e,t){return this._data[e]?this._data[e][t]:void 0}clear(){this._data={}}},pE=class{constructor(){this._color=new fE,this._css=new fE}setCss(e,t,n){this._css.set(e,t,n)}getCss(e,t){return this._css.get(e,t)}setColor(e,t,n){this._color.set(e,t,n)}getColor(e,t){return this._color.get(e,t)}clear(){this._color.clear(),this._css.clear()}},mn=Object.freeze((()=>{let e=[Vt.toColor("#2e3436"),Vt.toColor("#cc0000"),Vt.toColor("#4e9a06"),Vt.toColor("#c4a000"),Vt.toColor("#3465a4"),Vt.toColor("#75507b"),Vt.toColor("#06989a"),Vt.toColor("#d3d7cf"),Vt.toColor("#555753"),Vt.toColor("#ef2929"),Vt.toColor("#8ae234"),Vt.toColor("#fce94f"),Vt.toColor("#729fcf"),Vt.toColor("#ad7fa8"),Vt.toColor("#34e2e2"),Vt.toColor("#eeeeec")],t=[0,95,135,175,215,255];for(let n=0;n<216;n++){let r=t[n/36%6|0],s=t[n/6%6|0],a=t[n%6];e.push({css:cn.toCss(r,s,a),rgba:cn.toRgba(r,s,a)})}for(let n=0;n<24;n++){let r=8+n*10;e.push({css:cn.toCss(r,r,r),rgba:cn.toRgba(r,r,r)})}return e})()),Wo=Vt.toColor("#ffffff"),uu=Vt.toColor("#000000"),mE=Vt.toColor("#ffffff"),gE=uu,eu={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117},$Q=Wo,By=class extends Je{constructor(e){super(),this._optionsService=e,this._contrastCache=new pE,this._halfContrastCache=new pE,this._onChangeColors=this._register(new ke),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:Wo,background:uu,cursor:mE,cursorAccent:gE,selectionForeground:void 0,selectionBackgroundTransparent:eu,selectionBackgroundOpaque:Ht.blend(uu,eu),selectionInactiveBackgroundTransparent:eu,selectionInactiveBackgroundOpaque:Ht.blend(uu,eu),scrollbarSliderBackground:Ht.opacity(Wo,.2),scrollbarSliderHoverBackground:Ht.opacity(Wo,.4),scrollbarSliderActiveBackground:Ht.opacity(Wo,.5),overviewRulerBorder:Wo,ansi:mn.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=Nt(e.foreground,Wo),t.background=Nt(e.background,uu),t.cursor=Ht.blend(t.background,Nt(e.cursor,mE)),t.cursorAccent=Ht.blend(t.background,Nt(e.cursorAccent,gE)),t.selectionBackgroundTransparent=Nt(e.selectionBackground,eu),t.selectionBackgroundOpaque=Ht.blend(t.background,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundTransparent=Nt(e.selectionInactiveBackground,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundOpaque=Ht.blend(t.background,t.selectionInactiveBackgroundTransparent),t.selectionForeground=e.selectionForeground?Nt(e.selectionForeground,cE):void 0,t.selectionForeground===cE&&(t.selectionForeground=void 0),Ht.isOpaque(t.selectionBackgroundTransparent)&&(t.selectionBackgroundTransparent=Ht.opacity(t.selectionBackgroundTransparent,.3)),Ht.isOpaque(t.selectionInactiveBackgroundTransparent)&&(t.selectionInactiveBackgroundTransparent=Ht.opacity(t.selectionInactiveBackgroundTransparent,.3)),t.scrollbarSliderBackground=Nt(e.scrollbarSliderBackground,Ht.opacity(t.foreground,.2)),t.scrollbarSliderHoverBackground=Nt(e.scrollbarSliderHoverBackground,Ht.opacity(t.foreground,.4)),t.scrollbarSliderActiveBackground=Nt(e.scrollbarSliderActiveBackground,Ht.opacity(t.foreground,.5)),t.overviewRulerBorder=Nt(e.overviewRulerBorder,$Q),t.ansi=mn.slice(),t.ansi[0]=Nt(e.black,mn[0]),t.ansi[1]=Nt(e.red,mn[1]),t.ansi[2]=Nt(e.green,mn[2]),t.ansi[3]=Nt(e.yellow,mn[3]),t.ansi[4]=Nt(e.blue,mn[4]),t.ansi[5]=Nt(e.magenta,mn[5]),t.ansi[6]=Nt(e.cyan,mn[6]),t.ansi[7]=Nt(e.white,mn[7]),t.ansi[8]=Nt(e.brightBlack,mn[8]),t.ansi[9]=Nt(e.brightRed,mn[9]),t.ansi[10]=Nt(e.brightGreen,mn[10]),t.ansi[11]=Nt(e.brightYellow,mn[11]),t.ansi[12]=Nt(e.brightBlue,mn[12]),t.ansi[13]=Nt(e.brightMagenta,mn[13]),t.ansi[14]=Nt(e.brightCyan,mn[14]),t.ansi[15]=Nt(e.brightWhite,mn[15]),e.extendedAnsi){let n=Math.min(t.ansi.length-16,e.extendedAnsi.length);for(let r=0;r<n;r++)t.ansi[r+16]=Nt(e.extendedAnsi[r],mn[r+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()}}};By=Xt([Me(0,sr)],By);function Nt(e,t){if(e!==void 0)try{return Vt.toColor(e)}catch{}return t}var WQ=class{constructor(...e){this._entries=new Map;for(let[t,n]of e)this.set(t,n)}set(e,t){let n=this._entries.get(e);return this._entries.set(e,t),n}forEach(e){for(let[t,n]of this._entries.entries())e(t,n)}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}},VQ=class{constructor(){this._services=new WQ,this._services.set(Y0,this)}setService(e,t){this._services.set(e,t)}getService(e){return this._services.get(e)}createInstance(e,...t){let n=BX(e).sort((a,l)=>a.index-l.index),r=[];for(let a of n){let l=this._services.get(a.id);if(!l)throw new Error(`[createInstance] ${e.name} depends on UNKNOWN service ${a.id._id}.`);r.push(l)}let s=n.length>0?n[0].index:t.length;if(t.length!==s)throw new Error(`[createInstance] First service dependency of ${e.name} at position ${s+1} conflicts with ${t.length} static arguments`);return new e(...t,...r)}},qQ={trace:0,debug:1,info:2,warn:3,error:4,off:5},KQ="xterm.js: ",Iy=class extends Je{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=qQ[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,n){this._evalLazyOptionalParams(n),e.call(console,(this._optionsService.options.logger?"":KQ)+t,...n)}trace(e,...t){var n;this._logLevel<=0&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.trace.bind(this._optionsService.options.logger))??console.log,e,t)}debug(e,...t){var n;this._logLevel<=1&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.debug.bind(this._optionsService.options.logger))??console.log,e,t)}info(e,...t){var n;this._logLevel<=2&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.info.bind(this._optionsService.options.logger))??console.info,e,t)}warn(e,...t){var n;this._logLevel<=3&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.warn.bind(this._optionsService.options.logger))??console.warn,e,t)}error(e,...t){var n;this._logLevel<=4&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.error.bind(this._optionsService.options.logger))??console.error,e,t)}};Iy=Xt([Me(0,sr)],Iy);var vE=class extends Je{constructor(e){super(),this._maxLength=e,this.onDeleteEmitter=this._register(new ke),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this._register(new ke),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this._register(new ke),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 n=0;n<Math.min(e,this.length);n++)t[n]=this._array[this._getCyclicIndex(n)];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,...n){if(t){for(let r=e;r<this._length-t;r++)this._array[this._getCyclicIndex(r)]=this._array[this._getCyclicIndex(r+t)];this._length-=t,this.onDeleteEmitter.fire({index:e,amount:t})}for(let r=this._length-1;r>=e;r--)this._array[this._getCyclicIndex(r+n.length)]=this._array[this._getCyclicIndex(r)];for(let r=0;r<n.length;r++)this._array[this._getCyclicIndex(e+r)]=n[r];if(n.length&&this.onInsertEmitter.fire({index:e,amount:n.length}),this._length+n.length>this._maxLength){let r=this._length+n.length-this._maxLength;this._startIndex+=r,this._length=this._maxLength,this.onTrimEmitter.fire(r)}else this._length+=n.length}trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)}shiftElements(e,t,n){if(!(t<=0)){if(e<0||e>=this._length)throw new Error("start argument out of range");if(e+n<0)throw new Error("Cannot shift elements in list beyond index 0");if(n>0){for(let s=t-1;s>=0;s--)this.set(e+s+n,this.get(e+s));let r=e+t+n-this._length;if(r>0)for(this._length+=r;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let r=0;r<t;r++)this.set(e+r+n,this.get(e+r))}}_getCyclicIndex(e){return(this._startIndex+e)%this._maxLength}},Ze=3,an=Object.freeze(new hd),ef=0,u_=2,du=class fD{constructor(t,n,r=!1){this.isWrapped=r,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(t*Ze);let s=n||Qr.fromCharData([0,D5,1,0]);for(let a=0;a<t;++a)this.setCell(a,s);this.length=t}get(t){let n=this._data[t*Ze+0],r=n&2097151;return[this._data[t*Ze+1],n&2097152?this._combined[t]:r?to(r):"",n>>22,n&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):r]}set(t,n){this._data[t*Ze+1]=n[0],n[1].length>1?(this._combined[t]=n[1],this._data[t*Ze+0]=t|2097152|n[2]<<22):this._data[t*Ze+0]=n[1].charCodeAt(0)|n[2]<<22}getWidth(t){return this._data[t*Ze+0]>>22}hasWidth(t){return this._data[t*Ze+0]&12582912}getFg(t){return this._data[t*Ze+1]}getBg(t){return this._data[t*Ze+2]}hasContent(t){return this._data[t*Ze+0]&4194303}getCodePoint(t){let n=this._data[t*Ze+0];return n&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):n&2097151}isCombined(t){return this._data[t*Ze+0]&2097152}getString(t){let n=this._data[t*Ze+0];return n&2097152?this._combined[t]:n&2097151?to(n&2097151):""}isProtected(t){return this._data[t*Ze+2]&536870912}loadCell(t,n){return ef=t*Ze,n.content=this._data[ef+0],n.fg=this._data[ef+1],n.bg=this._data[ef+2],n.content&2097152&&(n.combinedData=this._combined[t]),n.bg&268435456&&(n.extended=this._extendedAttrs[t]),n}setCell(t,n){n.content&2097152&&(this._combined[t]=n.combinedData),n.bg&268435456&&(this._extendedAttrs[t]=n.extended),this._data[t*Ze+0]=n.content,this._data[t*Ze+1]=n.fg,this._data[t*Ze+2]=n.bg}setCellFromCodepoint(t,n,r,s){s.bg&268435456&&(this._extendedAttrs[t]=s.extended),this._data[t*Ze+0]=n|r<<22,this._data[t*Ze+1]=s.fg,this._data[t*Ze+2]=s.bg}addCodepointToCell(t,n,r){let s=this._data[t*Ze+0];s&2097152?this._combined[t]+=to(n):s&2097151?(this._combined[t]=to(s&2097151)+to(n),s&=-2097152,s|=2097152):s=n|1<<22,r&&(s&=-12582913,s|=r<<22),this._data[t*Ze+0]=s}insertCells(t,n,r){if(t%=this.length,t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,r),n<this.length-t){let s=new Qr;for(let a=this.length-t-n-1;a>=0;--a)this.setCell(t+n+a,this.loadCell(t+a,s));for(let a=0;a<n;++a)this.setCell(t+a,r)}else for(let s=t;s<this.length;++s)this.setCell(s,r);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,r)}deleteCells(t,n,r){if(t%=this.length,n<this.length-t){let s=new Qr;for(let a=0;a<this.length-t-n;++a)this.setCell(t+a,this.loadCell(t+n+a,s));for(let a=this.length-n;a<this.length;++a)this.setCell(a,r)}else for(let s=t;s<this.length;++s)this.setCell(s,r);t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,r),this.getWidth(t)===0&&!this.hasContent(t)&&this.setCellFromCodepoint(t,0,1,r)}replaceCells(t,n,r,s=!1){if(s){for(t&&this.getWidth(t-1)===2&&!this.isProtected(t-1)&&this.setCellFromCodepoint(t-1,0,1,r),n<this.length&&this.getWidth(n-1)===2&&!this.isProtected(n)&&this.setCellFromCodepoint(n,0,1,r);t<n&&t<this.length;)this.isProtected(t)||this.setCell(t,r),t++;return}for(t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,r),n<this.length&&this.getWidth(n-1)===2&&this.setCellFromCodepoint(n,0,1,r);t<n&&t<this.length;)this.setCell(t++,r)}resize(t,n){if(t===this.length)return this._data.length*4*u_<this._data.buffer.byteLength;let r=t*Ze;if(t>this.length){if(this._data.buffer.byteLength>=r*4)this._data=new Uint32Array(this._data.buffer,0,r);else{let s=new Uint32Array(r);s.set(this._data),this._data=s}for(let s=this.length;s<t;++s)this.setCell(s,n)}else{this._data=this._data.subarray(0,r);let s=Object.keys(this._combined);for(let l=0;l<s.length;l++){let u=parseInt(s[l],10);u>=t&&delete this._combined[u]}let a=Object.keys(this._extendedAttrs);for(let l=0;l<a.length;l++){let u=parseInt(a[l],10);u>=t&&delete this._extendedAttrs[u]}}return this.length=t,r*4*u_<this._data.buffer.byteLength}cleanupMemory(){if(this._data.length*4*u_<this._data.buffer.byteLength){let t=new Uint32Array(this._data.length);return t.set(this._data),this._data=t,1}return 0}fill(t,n=!1){if(n){for(let r=0;r<this.length;++r)this.isProtected(r)||this.setCell(r,t);return}this._combined={},this._extendedAttrs={};for(let r=0;r<this.length;++r)this.setCell(r,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 n in t._combined)this._combined[n]=t._combined[n];this._extendedAttrs={};for(let n in t._extendedAttrs)this._extendedAttrs[n]=t._extendedAttrs[n];this.isWrapped=t.isWrapped}clone(){let t=new fD(0);t._data=new Uint32Array(this._data),t.length=this.length;for(let n in this._combined)t._combined[n]=this._combined[n];for(let n in this._extendedAttrs)t._extendedAttrs[n]=this._extendedAttrs[n];return t.isWrapped=this.isWrapped,t}getTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*Ze+0]&4194303)return t+(this._data[t*Ze+0]>>22);return 0}getNoBgTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*Ze+0]&4194303||this._data[t*Ze+2]&50331648)return t+(this._data[t*Ze+0]>>22);return 0}copyCellsFrom(t,n,r,s,a){let l=t._data;if(a)for(let h=s-1;h>=0;h--){for(let d=0;d<Ze;d++)this._data[(r+h)*Ze+d]=l[(n+h)*Ze+d];l[(n+h)*Ze+2]&268435456&&(this._extendedAttrs[r+h]=t._extendedAttrs[n+h])}else for(let h=0;h<s;h++){for(let d=0;d<Ze;d++)this._data[(r+h)*Ze+d]=l[(n+h)*Ze+d];l[(n+h)*Ze+2]&268435456&&(this._extendedAttrs[r+h]=t._extendedAttrs[n+h])}let u=Object.keys(t._combined);for(let h=0;h<u.length;h++){let d=parseInt(u[h],10);d>=n&&(this._combined[d-n+r]=t._combined[d])}}translateToString(t,n,r,s){n=n??0,r=r??this.length,t&&(r=Math.min(r,this.getTrimmedLength())),s&&(s.length=0);let a="";for(;n<r;){let l=this._data[n*Ze+0],u=l&2097151,h=l&2097152?this._combined[n]:u?to(u):so;if(a+=h,s)for(let d=0;d<h.length;++d)s.push(n);n+=l>>22||1}return s&&s.push(n),a}};function GQ(e,t,n,r,s,a){let l=[];for(let u=0;u<e.length-1;u++){let h=u,d=e.get(++h);if(!d.isWrapped)continue;let m=[e.get(u)];for(;h<e.length&&d.isWrapped;)m.push(d),d=e.get(++h);if(!a&&r>=u&&r<h){u+=m.length-1;continue}let g=0,_=qu(m,g,t),b=1,w=0;for(;b<m.length;){let C=qu(m,b,t),k=C-w,R=n-_,T=Math.min(k,R);m[g].copyCellsFrom(m[b],w,_,T,!1),_+=T,_===n&&(g++,_=0),w+=T,w===C&&(b++,w=0),_===0&&g!==0&&m[g-1].getWidth(n-1)===2&&(m[g].copyCellsFrom(m[g-1],n-1,_++,1,!1),m[g-1].setCell(n-1,s))}m[g].replaceCells(_,n,s);let S=0;for(let C=m.length-1;C>0&&(C>g||m[C].getTrimmedLength()===0);C--)S++;S>0&&(l.push(u+m.length-S),l.push(S)),u+=m.length-1}return l}function YQ(e,t){let n=[],r=0,s=t[r],a=0;for(let l=0;l<e.length;l++)if(s===l){let u=t[++r];e.onDeleteEmitter.fire({index:l-a,amount:u}),l+=u-1,a+=u,s=t[++r]}else n.push(l);return{layout:n,countRemoved:a}}function XQ(e,t){let n=[];for(let r=0;r<t.length;r++)n.push(e.get(t[r]));for(let r=0;r<n.length;r++)e.set(r,n[r]);e.length=t.length}function ZQ(e,t,n){let r=[],s=e.map((h,d)=>qu(e,d,t)).reduce((h,d)=>h+d),a=0,l=0,u=0;for(;u<s;){if(s-u<n){r.push(s-u);break}a+=n;let h=qu(e,l,t);a>h&&(a-=h,l++);let d=e[l].getWidth(a-1)===2;d&&a--;let m=d?n-1:n;r.push(m),u+=m}return r}function qu(e,t,n){if(t===e.length-1)return e[t].getTrimmedLength();let r=!e[t].hasContent(n-1)&&e[t].getWidth(n-1)===1,s=e[t+1].getWidth(0)===2;return r&&s?n-1:n}var pD=class mD{constructor(t){this.line=t,this.isDisposed=!1,this._disposables=[],this._id=mD._nextId++,this._onDispose=this.register(new ke),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),ia(this._disposables),this._disposables.length=0)}register(t){return this._disposables.push(t),t}};pD._nextId=1;var QQ=pD,_n={},Vo=_n.B;_n[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:"≥","{":"π","|":"≠","}":"£","~":"·"};_n.A={"#":"£"};_n.B=void 0;_n[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"};_n.C=_n[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};_n.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"};_n.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"};_n.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"};_n.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"};_n.E=_n[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"};_n.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"};_n.H=_n[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};_n["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"};var _E=4294967295,yE=class{constructor(e,t,n){this._hasScrollback=e,this._optionsService=t,this._bufferService=n,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=an.clone(),this.savedCharset=Vo,this.markers=[],this._nullCell=Qr.fromCharData([0,D5,1,0]),this._whitespaceCell=Qr.fromCharData([0,so,1,32]),this._isClearing=!1,this._memoryCleanupQueue=new sp,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new vE(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 tp),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 tp),this._whitespaceCell}getBlankLine(e,t){return new du(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>_E?_E:t}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=an);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 vE(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,t){let n=this.getNullCell(an),r=0,s=this._getCorrectBufferLength(t);if(s>this.lines.maxLength&&(this.lines.maxLength=s),this.lines.length>0){if(this._cols<e)for(let l=0;l<this.lines.length;l++)r+=+this.lines.get(l).resize(e,n);let a=0;if(this._rows<t)for(let l=this._rows;l<t;l++)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 du(e,n)):this.ybase>0&&this.lines.length<=this.ybase+this.y+a+1?(this.ybase--,a++,this.ydisp>0&&this.ydisp--):this.lines.push(new du(e,n)));else for(let l=this._rows;l>t;l--)this.lines.length>t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(s<this.lines.maxLength){let l=this.lines.length-s;l>0&&(this.lines.trimStart(l),this.ybase=Math.max(this.ybase-l,0),this.ydisp=Math.max(this.ydisp-l,0),this.savedY=Math.max(this.savedY-l,0)),this.lines.maxLength=s}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,t-1),a&&(this.y+=a),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 a=0;a<this.lines.length;a++)r+=+this.lines.get(a).resize(e,n);this._cols=e,this._rows=t,this._memoryCleanupQueue.clear(),r>.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 n=this._optionsService.rawOptions.reflowCursorLine,r=GQ(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(an),n);if(r.length>0){let s=YQ(this.lines,r);XQ(this.lines,s.layout),this._reflowLargerAdjustViewport(e,t,s.countRemoved)}}_reflowLargerAdjustViewport(e,t,n){let r=this.getNullCell(an),s=n;for(;s-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<t&&this.lines.push(new du(e,r))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-n,0)}_reflowSmaller(e,t){let n=this._optionsService.rawOptions.reflowCursorLine,r=this.getNullCell(an),s=[],a=0;for(let l=this.lines.length-1;l>=0;l--){let u=this.lines.get(l);if(!u||!u.isWrapped&&u.getTrimmedLength()<=e)continue;let h=[u];for(;u.isWrapped&&l>0;)u=this.lines.get(--l),h.unshift(u);if(!n){let T=this.ybase+this.y;if(T>=l&&T<l+h.length)continue}let d=h[h.length-1].getTrimmedLength(),m=ZQ(h,this._cols,e),g=m.length-h.length,_;this.ybase===0&&this.y!==this.lines.length-1?_=Math.max(0,this.y-this.lines.maxLength+g):_=Math.max(0,this.lines.length-this.lines.maxLength+g);let b=[];for(let T=0;T<g;T++){let N=this.getBlankLine(an,!0);b.push(N)}b.length>0&&(s.push({start:l+h.length+a,newLines:b}),a+=b.length),h.push(...b);let w=m.length-1,S=m[w];S===0&&(w--,S=m[w]);let C=h.length-g-1,k=d;for(;C>=0;){let T=Math.min(k,S);if(h[w]===void 0)break;if(h[w].copyCellsFrom(h[C],k-T,S-T,T,!0),S-=T,S===0&&(w--,S=m[w]),k-=T,k===0){C--;let N=Math.max(C,0);k=qu(h,N,this._cols)}}for(let T=0;T<h.length;T++)m[T]<e&&h[T].setCell(m[T],r);let R=g-_;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+a)-t&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+g,this.ybase+t-1)}if(s.length>0){let l=[],u=[];for(let S=0;S<this.lines.length;S++)u.push(this.lines.get(S));let h=this.lines.length,d=h-1,m=0,g=s[m];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+a);let _=0;for(let S=Math.min(this.lines.maxLength-1,h+a-1);S>=0;S--)if(g&&g.start>d+_){for(let C=g.newLines.length-1;C>=0;C--)this.lines.set(S--,g.newLines[C]);S++,l.push({index:d+1,amount:g.newLines.length}),_+=g.newLines.length,g=s[++m]}else this.lines.set(S,u[d--]);let b=0;for(let S=l.length-1;S>=0;S--)l[S].index+=b,this.lines.onInsertEmitter.fire(l[S]),b+=l[S].amount;let w=Math.max(0,h+a-this.lines.maxLength);w>0&&this.lines.onTrimEmitter.fire(w)}}translateBufferLineToString(e,t,n=0,r){let s=this.lines.get(e);return s?s.translateToString(t,n,r):""}getWrappedRangeForLine(e){let t=e,n=e;for(;t>0&&this.lines.get(t).isWrapped;)t--;for(;n+1<this.lines.length&&this.lines.get(n+1).isWrapped;)n++;return{first:t,last:n}}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 QQ(e);return this.markers.push(t),t.register(this.lines.onTrim(n=>{t.line-=n,t.line<0&&t.dispose()})),t.register(this.lines.onInsert(n=>{t.line>=n.index&&(t.line+=n.amount)})),t.register(this.lines.onDelete(n=>{t.line>=n.index&&t.line<n.index+n.amount&&t.dispose(),t.line>n.index&&(t.line-=n.amount)})),t.register(t.onDispose(()=>this._removeMarker(t))),t}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}},JQ=class extends Je{constructor(e,t){super(),this._optionsService=e,this._bufferService=t,this._onBufferActivate=this._register(new ke),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 yE(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new yE(!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)}},gD=2,vD=1,Hy=class extends Je{constructor(e){super(),this.isUserScrolling=!1,this._onResize=this._register(new ke),this.onResize=this._onResize.event,this._onScroll=this._register(new ke),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,gD),this.rows=Math.max(e.rawOptions.rows||0,vD),this.buffers=this._register(new JQ(e,this)),this._register(this.buffers.onBufferActivate(t=>{this._onScroll.fire(t.activeBuffer.ydisp)}))}get buffer(){return this.buffers.active}resize(e,t){let n=this.cols!==e,r=this.rows!==t;this.cols=e,this.rows=t,this.buffers.resize(e,t),this._onResize.fire({cols:e,rows:t,colsChanged:n,rowsChanged:r})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,t=!1){let n=this.buffer,r;r=this._cachedBlankLine,(!r||r.length!==this.cols||r.getFg(0)!==e.fg||r.getBg(0)!==e.bg)&&(r=n.getBlankLine(e,t),this._cachedBlankLine=r),r.isWrapped=t;let s=n.ybase+n.scrollTop,a=n.ybase+n.scrollBottom;if(n.scrollTop===0){let l=n.lines.isFull;a===n.lines.length-1?l?n.lines.recycle().copyFrom(r):n.lines.push(r.clone()):n.lines.splice(a+1,0,r.clone()),l?this.isUserScrolling&&(n.ydisp=Math.max(n.ydisp-1,0)):(n.ybase++,this.isUserScrolling||n.ydisp++)}else{let l=a-s+1;n.lines.shiftElements(s+1,l-1,-1),n.lines.set(a,r.clone())}this.isUserScrolling||(n.ydisp=n.ybase),this._onScroll.fire(n.ydisp)}scrollLines(e,t){let n=this.buffer;if(e<0){if(n.ydisp===0)return;this.isUserScrolling=!0}else e+n.ydisp>=n.ybase&&(this.isUserScrolling=!1);let r=n.ydisp;n.ydisp=Math.max(Math.min(n.ydisp+e,n.ybase),0),r!==n.ydisp&&(t||this._onScroll.fire(n.ydisp))}};Hy=Xt([Me(0,sr)],Hy);var ul={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:ip,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRuler:{}},eJ=["normal","bold","100","200","300","400","500","600","700","800","900"],tJ=class extends Je{constructor(e){super(),this._onOptionChange=this._register(new ke),this.onOptionChange=this._onOptionChange.event;let t={...ul};for(let n in e)if(n in t)try{let r=e[n];t[n]=this._sanitizeAndValidateOption(n,r)}catch(r){console.error(r)}this.rawOptions=t,this.options={...t},this._setupOptions(),this._register($t(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(e,t){return this.onOptionChange(n=>{n===e&&t(this.rawOptions[e])})}onMultipleOptionChange(e,t){return this.onOptionChange(n=>{e.indexOf(n)!==-1&&t()})}_setupOptions(){let e=n=>{if(!(n in ul))throw new Error(`No option with key "${n}"`);return this.rawOptions[n]},t=(n,r)=>{if(!(n in ul))throw new Error(`No option with key "${n}"`);r=this._sanitizeAndValidateOption(n,r),this.rawOptions[n]!==r&&(this.rawOptions[n]=r,this._onOptionChange.fire(n))};for(let n in this.rawOptions){let r={get:e.bind(this,n),set:t.bind(this,n)};Object.defineProperty(this.options,n,r)}}_sanitizeAndValidateOption(e,t){switch(e){case"cursorStyle":if(t||(t=ul[e]),!nJ(t))throw new Error(`"${t}" is not a valid value for ${e}`);break;case"wordSeparator":t||(t=ul[e]);break;case"fontWeight":case"fontWeightBold":if(typeof t=="number"&&1<=t&&t<=1e3)break;t=eJ.includes(t)?t:ul[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 nJ(e){return e==="block"||e==="underline"||e==="bar"}function hu(e,t=5){if(typeof e!="object")return e;let n=Array.isArray(e)?[]:{};for(let r in e)n[r]=t<=1?e[r]:e[r]&&hu(e[r],t-1);return n}var bE=Object.freeze({insertMode:!1}),xE=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),Fy=class extends Je{constructor(e,t,n){super(),this._bufferService=e,this._logService=t,this._optionsService=n,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this._register(new ke),this.onData=this._onData.event,this._onUserInput=this._register(new ke),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new ke),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new ke),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=hu(bE),this.decPrivateModes=hu(xE)}reset(){this.modes=hu(bE),this.decPrivateModes=hu(xE)}triggerDataEvent(e,t=!1){if(this._optionsService.rawOptions.disableStdin)return;let n=this._bufferService.buffer;t&&this._optionsService.rawOptions.scrollOnUserInput&&n.ybase!==n.ydisp&&this._onRequestScrollToBottom.fire(),t&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`),this._logService.trace("sending data (codes)",()=>e.split("").map(r=>r.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))}};Fy=Xt([Me(0,ir),Me(1,P5),Me(2,sr)],Fy);var wE={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 d_(e,t){let n=(e.ctrl?16:0)|(e.shift?4:0)|(e.alt?8:0);return e.button===4?(n|=64,n|=e.action):(n|=e.button&3,e.button&4&&(n|=64),e.button&8&&(n|=128),e.action===32?n|=32:e.action===0&&!t&&(n|=3)),n}var h_=String.fromCharCode,SE={DEFAULT:e=>{let t=[d_(e,!1)+32,e.col+32,e.row+32];return t[0]>255||t[1]>255||t[2]>255?"":`\x1B[M${h_(t[0])}${h_(t[1])}${h_(t[2])}`},SGR:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${d_(e,!0)};${e.col};${e.row}${t}`},SGR_PIXELS:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${d_(e,!0)};${e.x};${e.y}${t}`}},Uy=class extends Je{constructor(e,t,n){super(),this._bufferService=e,this._coreService=t,this._optionsService=n,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._wheelPartialScroll=0,this._onProtocolChange=this._register(new ke),this.onProtocolChange=this._onProtocolChange.event;for(let r of Object.keys(wE))this.addProtocol(r,wE[r]);for(let r of Object.keys(SE))this.addEncoding(r,SE[r]);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,n){if(e.deltaY===0||e.shiftKey||t===void 0||n===void 0)return 0;let r=t/n,s=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(s/=r+0,Math.abs(e.deltaY)<50&&(s*=.3),this._wheelPartialScroll+=s,s=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(s*=this._bufferService.rows),s}_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,n){if(n){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)}};Uy=Xt([Me(0,ir),Me(1,va),Me(2,sr)],Uy);var f_=[[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]],rJ=[[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]],gn;function iJ(e,t){let n=0,r=t.length-1,s;if(e<t[0][0]||e>t[r][1])return!1;for(;r>=n;)if(s=n+r>>1,e>t[s][1])n=s+1;else if(e<t[s][0])r=s-1;else return!0;return!1}var sJ=class{constructor(){if(this.version="6",!gn){gn=new Uint8Array(65536),gn.fill(1),gn[0]=0,gn.fill(0,1,32),gn.fill(0,127,160),gn.fill(2,4352,4448),gn[9001]=2,gn[9002]=2,gn.fill(2,11904,42192),gn[12351]=1,gn.fill(2,44032,55204),gn.fill(2,63744,64256),gn.fill(2,65040,65050),gn.fill(2,65072,65136),gn.fill(2,65280,65377),gn.fill(2,65504,65511);for(let e=0;e<f_.length;++e)gn.fill(0,f_[e][0],f_[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?gn[e]:iJ(e,rJ)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,t){let n=this.wcwidth(e),r=n===0&&t!==0;if(r){let s=Yo.extractWidth(t);s===0?r=!1:s>n&&(n=s)}return Yo.createPropertyValue(0,n,r)}},Yo=class Tf{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new ke,this.onChange=this._onChange.event;let t=new sJ;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,n,r=!1){return(t&16777215)<<3|(n&3)<<1|(r?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 n=0,r=0,s=t.length;for(let a=0;a<s;++a){let l=t.charCodeAt(a);if(55296<=l&&l<=56319){if(++a>=s)return n+this.wcwidth(l);let d=t.charCodeAt(a);56320<=d&&d<=57343?l=(l-55296)*1024+d-56320+65536:n+=this.wcwidth(d)}let u=this.charProperties(l,r),h=Tf.extractWidth(u);Tf.extractShouldJoin(u)&&(h-=Tf.extractWidth(r)),n+=h,r=u}return n}charProperties(t,n){return this._activeProvider.charProperties(t,n)}},oJ=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 CE(e){var r;let t=(r=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1))==null?void 0:r.get(e.cols-1),n=e.buffer.lines.get(e.buffer.ybase+e.buffer.y);n&&t&&(n.isWrapped=t[3]!==0&&t[3]!==32)}var tu=2147483647,aJ=256,_D=class $y{constructor(t=32,n=32){if(this.maxLength=t,this.maxSubParamsLength=n,n>aJ)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(t),this.length=0,this._subParams=new Int32Array(n),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(t),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(t){let n=new $y;if(!t.length)return n;for(let r=Array.isArray(t[0])?1:0;r<t.length;++r){let s=t[r];if(Array.isArray(s))for(let a=0;a<s.length;++a)n.addSubParam(s[a]);else n.addParam(s)}return n}clone(){let t=new $y(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 n=0;n<this.length;++n){t.push(this.params[n]);let r=this._subParamsIdx[n]>>8,s=this._subParamsIdx[n]&255;s-r>0&&t.push(Array.prototype.slice.call(this._subParams,r,s))}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>tu?tu: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>tu?tu:t,this._subParamsIdx[this.length-1]++}}hasSubParams(t){return(this._subParamsIdx[t]&255)-(this._subParamsIdx[t]>>8)>0}getSubParams(t){let n=this._subParamsIdx[t]>>8,r=this._subParamsIdx[t]&255;return r-n>0?this._subParams.subarray(n,r):null}getSubParamsAll(){let t={};for(let n=0;n<this.length;++n){let r=this._subParamsIdx[n]>>8,s=this._subParamsIdx[n]&255;s-r>0&&(t[n]=this._subParams.slice(r,s))}return t}addDigit(t){let n;if(this._rejectDigits||!(n=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let r=this._digitIsSub?this._subParams:this.params,s=r[n-1];r[n-1]=~s?Math.min(s*10+t,tu):t}},nu=[],lJ=class{constructor(){this._state=0,this._active=nu,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 n=this._handlers[e];return n.push(t),{dispose:()=>{let r=n.indexOf(t);r!==-1&&n.splice(r,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=nu}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=nu,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||nu,!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,n){if(!this._active.length)this._handlerFb(this._id,"PUT",Wp(e,t,n));else for(let r=this._active.length-1;r>=0;r--)this._active[r].put(e,t,n)}start(){this.reset(),this._state=1}put(e,t,n){if(this._state!==3){if(this._state===1)for(;t<n;){let r=e[t++];if(r===59){this._state=2,this._start();break}if(r<48||57<r){this._state=3;return}this._id===-1&&(this._id=0),this._id=this._id*10+r-48}this._state===2&&n-t>0&&this._put(e,t,n)}}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 n=!1,r=this._active.length-1,s=!1;if(this._stack.paused&&(r=this._stack.loopPosition-1,n=t,s=this._stack.fallThrough,this._stack.paused=!1),!s&&n===!1){for(;r>=0&&(n=this._active[r].end(e),n!==!0);r--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!1,n;r--}for(;r>=0;r--)if(n=this._active[r].end(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!0,n}this._active=nu,this._id=-1,this._state=0}}},Er=class{constructor(e){this._handler=e,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(e,t,n){this._hitLimit||(this._data+=Wp(e,t,n),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(n=>(this._data="",this._hitLimit=!1,n));return this._data="",this._hitLimit=!1,t}},ru=[],cJ=class{constructor(){this._handlers=Object.create(null),this._active=ru,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=ru}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let n=this._handlers[e];return n.push(t),{dispose:()=>{let r=n.indexOf(t);r!==-1&&n.splice(r,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=ru,this._ident=0}hook(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||ru,!this._active.length)this._handlerFb(this._ident,"HOOK",t);else for(let n=this._active.length-1;n>=0;n--)this._active[n].hook(t)}put(e,t,n){if(!this._active.length)this._handlerFb(this._ident,"PUT",Wp(e,t,n));else for(let r=this._active.length-1;r>=0;r--)this._active[r].put(e,t,n)}unhook(e,t=!0){if(!this._active.length)this._handlerFb(this._ident,"UNHOOK",e);else{let n=!1,r=this._active.length-1,s=!1;if(this._stack.paused&&(r=this._stack.loopPosition-1,n=t,s=this._stack.fallThrough,this._stack.paused=!1),!s&&n===!1){for(;r>=0&&(n=this._active[r].unhook(e),n!==!0);r--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!1,n;r--}for(;r>=0;r--)if(n=this._active[r].unhook(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!0,n}this._active=ru,this._ident=0}},fu=new _D;fu.addParam(0);var kE=class{constructor(e){this._handler=e,this._data="",this._params=fu,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():fu,this._data="",this._hitLimit=!1}put(e,t,n){this._hitLimit||(this._data+=Wp(e,t,n),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(n=>(this._params=fu,this._data="",this._hitLimit=!1,n));return this._params=fu,this._data="",this._hitLimit=!1,t}},uJ=class{constructor(e){this.table=new Uint8Array(e)}setDefault(e,t){this.table.fill(e<<4|t)}add(e,t,n,r){this.table[t<<8|e]=n<<4|r}addMany(e,t,n,r){for(let s=0;s<e.length;s++)this.table[t<<8|e[s]]=n<<4|r}},Yr=160,dJ=(function(){let e=new uJ(4095),t=Array.apply(null,Array(256)).map((u,h)=>h),n=(u,h)=>t.slice(u,h),r=n(32,127),s=n(0,24);s.push(25),s.push.apply(s,n(28,32));let a=n(0,14),l;e.setDefault(1,0),e.addMany(r,0,2,0);for(l in a)e.addMany([24,26,153,154],l,3,0),e.addMany(n(128,144),l,3,0),e.addMany(n(144,152),l,3,0),e.add(156,l,0,0),e.add(27,l,11,1),e.add(157,l,4,8),e.addMany([152,158,159],l,0,7),e.add(155,l,11,3),e.add(144,l,11,9);return e.addMany(s,0,3,0),e.addMany(s,1,3,1),e.add(127,1,0,1),e.addMany(s,8,0,8),e.addMany(s,3,3,3),e.add(127,3,0,3),e.addMany(s,4,3,4),e.add(127,4,0,4),e.addMany(s,6,3,6),e.addMany(s,5,3,5),e.add(127,5,0,5),e.addMany(s,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(r,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(n(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(r,7,0,7),e.addMany(s,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(n(64,127),3,7,0),e.addMany(n(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(n(48,60),4,8,4),e.addMany(n(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(n(32,64),6,0,6),e.add(127,6,0,6),e.addMany(n(64,127),6,0,0),e.addMany(n(32,48),3,9,5),e.addMany(n(32,48),5,9,5),e.addMany(n(48,64),5,0,6),e.addMany(n(64,127),5,7,0),e.addMany(n(32,48),4,9,5),e.addMany(n(32,48),1,9,2),e.addMany(n(32,48),2,9,2),e.addMany(n(48,127),2,10,0),e.addMany(n(48,80),1,10,0),e.addMany(n(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(n(96,127),1,10,0),e.add(80,1,11,9),e.addMany(s,9,0,9),e.add(127,9,0,9),e.addMany(n(28,32),9,0,9),e.addMany(n(32,48),9,9,12),e.addMany(n(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(s,11,0,11),e.addMany(n(32,128),11,0,11),e.addMany(n(28,32),11,0,11),e.addMany(s,10,0,10),e.add(127,10,0,10),e.addMany(n(28,32),10,0,10),e.addMany(n(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(n(32,48),10,9,12),e.addMany(s,12,0,12),e.add(127,12,0,12),e.addMany(n(28,32),12,0,12),e.addMany(n(32,48),12,9,12),e.addMany(n(48,64),12,0,11),e.addMany(n(64,127),12,12,13),e.addMany(n(64,127),10,12,13),e.addMany(n(64,127),9,12,13),e.addMany(s,13,13,13),e.addMany(r,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(Yr,0,2,0),e.add(Yr,8,5,8),e.add(Yr,6,0,6),e.add(Yr,11,0,11),e.add(Yr,13,13,13),e})(),hJ=class extends Je{constructor(e=dJ){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 _D,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(t,n,r)=>{},this._executeHandlerFb=t=>{},this._csiHandlerFb=(t,n)=>{},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($t(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new lJ),this._dcsParser=this._register(new cJ),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(e,t=[64,126]){let n=0;if(e.prefix){if(e.prefix.length>1)throw new Error("only one byte as prefix supported");if(n=e.prefix.charCodeAt(0),n&&60>n||n>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 s=0;s<e.intermediates.length;++s){let a=e.intermediates.charCodeAt(s);if(32>a||a>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");n<<=8,n|=a}}if(e.final.length!==1)throw new Error("final must be a single byte");let r=e.final.charCodeAt(0);if(t[0]>r||r>t[1])throw new Error(`final must be in range ${t[0]} .. ${t[1]}`);return n<<=8,n|=r,n}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 n=this._identifier(e,[48,126]);this._escHandlers[n]===void 0&&(this._escHandlers[n]=[]);let r=this._escHandlers[n];return r.push(t),{dispose:()=>{let s=r.indexOf(t);s!==-1&&r.splice(s,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 n=this._identifier(e);this._csiHandlers[n]===void 0&&(this._csiHandlers[n]=[]);let r=this._csiHandlers[n];return r.push(t),{dispose:()=>{let s=r.indexOf(t);s!==-1&&r.splice(s,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,n,r,s){this._parseStack.state=e,this._parseStack.handlers=t,this._parseStack.handlerPos=n,this._parseStack.transition=r,this._parseStack.chunkPos=s}parse(e,t,n){let r=0,s=0,a=0,l;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,a=this._parseStack.chunkPos+1;else{if(n===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");let u=this._parseStack.handlers,h=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(n===!1&&h>-1){for(;h>=0&&(l=u[h](this._params),l!==!0);h--)if(l instanceof Promise)return this._parseStack.handlerPos=h,l}this._parseStack.handlers=[];break;case 4:if(n===!1&&h>-1){for(;h>=0&&(l=u[h](),l!==!0);h--)if(l instanceof Promise)return this._parseStack.handlerPos=h,l}this._parseStack.handlers=[];break;case 6:if(r=e[this._parseStack.chunkPos],l=this._dcsParser.unhook(r!==24&&r!==26,n),l)return l;r===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(r=e[this._parseStack.chunkPos],l=this._oscParser.end(r!==24&&r!==26,n),l)return l;r===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break}this._parseStack.state=0,a=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=this._parseStack.transition&15}for(let u=a;u<t;++u){switch(r=e[u],s=this._transitions.table[this.currentState<<8|(r<160?r:Yr)],s>>4){case 2:for(let _=u+1;;++_){if(_>=t||(r=e[_])<32||r>126&&r<Yr){this._printHandler(e,u,_),u=_-1;break}if(++_>=t||(r=e[_])<32||r>126&&r<Yr){this._printHandler(e,u,_),u=_-1;break}if(++_>=t||(r=e[_])<32||r>126&&r<Yr){this._printHandler(e,u,_),u=_-1;break}if(++_>=t||(r=e[_])<32||r>126&&r<Yr){this._printHandler(e,u,_),u=_-1;break}}break;case 3:this._executeHandlers[r]?this._executeHandlers[r]():this._executeHandlerFb(r),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:u,code:r,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:let h=this._csiHandlers[this._collect<<8|r],d=h?h.length-1:-1;for(;d>=0&&(l=h[d](this._params),l!==!0);d--)if(l instanceof Promise)return this._preserveStack(3,h,d,s,u),l;d<0&&this._csiHandlerFb(this._collect<<8|r,this._params),this.precedingJoinState=0;break;case 8:do switch(r){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(r-48)}while(++u<t&&(r=e[u])>47&&r<60);u--;break;case 9:this._collect<<=8,this._collect|=r;break;case 10:let m=this._escHandlers[this._collect<<8|r],g=m?m.length-1:-1;for(;g>=0&&(l=m[g](),l!==!0);g--)if(l instanceof Promise)return this._preserveStack(4,m,g,s,u),l;g<0&&this._escHandlerFb(this._collect<<8|r),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|r,this._params);break;case 13:for(let _=u+1;;++_)if(_>=t||(r=e[_])===24||r===26||r===27||r>127&&r<Yr){this._dcsParser.put(e,u,_),u=_-1;break}break;case 14:if(l=this._dcsParser.unhook(r!==24&&r!==26),l)return this._preserveStack(6,[],0,s,u),l;r===27&&(s|=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 _=u+1;;_++)if(_>=t||(r=e[_])<32||r>127&&r<Yr){this._oscParser.put(e,u,_),u=_-1;break}break;case 6:if(l=this._oscParser.end(r!==24&&r!==26),l)return this._preserveStack(5,[],0,s,u),l;r===27&&(s|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break}this.currentState=s&15}}},fJ=/^([\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})$/,pJ=/^[\da-f]+$/;function EE(e){if(!e)return;let t=e.toLowerCase();if(t.indexOf("rgb:")===0){t=t.slice(4);let n=fJ.exec(t);if(n){let r=n[1]?15:n[4]?255:n[7]?4095:65535;return[Math.round(parseInt(n[1]||n[4]||n[7]||n[10],16)/r*255),Math.round(parseInt(n[2]||n[5]||n[8]||n[11],16)/r*255),Math.round(parseInt(n[3]||n[6]||n[9]||n[12],16)/r*255)]}}else if(t.indexOf("#")===0&&(t=t.slice(1),pJ.exec(t)&&[3,6,9,12].includes(t.length))){let n=t.length/3,r=[0,0,0];for(let s=0;s<3;++s){let a=parseInt(t.slice(n*s,n*s+n),16);r[s]=n===1?a<<4:n===2?a:n===3?a>>4:a>>8}return r}}function p_(e,t){let n=e.toString(16),r=n.length<2?"0"+n:n;switch(t){case 4:return n[0];case 8:return r;case 12:return(r+r).slice(0,3);default:return r+r}}function mJ(e,t=16){let[n,r,s]=e;return`rgb:${p_(n,t)}/${p_(r,t)}/${p_(s,t)}`}var gJ={"(":0,")":1,"*":2,"+":3,"-":1,".":2},Zs=131072,RE=10;function TE(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 ME=5e3,NE=0,vJ=class extends Je{constructor(e,t,n,r,s,a,l,u,h=new hJ){super(),this._bufferService=e,this._charsetService=t,this._coreService=n,this._logService=r,this._optionsService=s,this._oscLinkService=a,this._coreMouseService=l,this._unicodeService=u,this._parser=h,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new zX,this._utf8Decoder=new PX,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=an.clone(),this._eraseAttrDataInternal=an.clone(),this._onRequestBell=this._register(new ke),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new ke),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new ke),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new ke),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new ke),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new ke),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new ke),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new ke),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new ke),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new ke),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new ke),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new ke),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new ke),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 Wy(this._bufferService),this._activeBuffer=this._bufferService.buffer,this._register(this._bufferService.buffers.onBufferActivate(d=>this._activeBuffer=d.activeBuffer)),this._parser.setCsiHandlerFallback((d,m)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(d),params:m.toArray()})}),this._parser.setEscHandlerFallback(d=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(d)})}),this._parser.setExecuteHandlerFallback(d=>{this._logService.debug("Unknown EXECUTE code: ",{code:d})}),this._parser.setOscHandlerFallback((d,m,g)=>{this._logService.debug("Unknown OSC code: ",{identifier:d,action:m,data:g})}),this._parser.setDcsHandlerFallback((d,m,g)=>{m==="HOOK"&&(g=g.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(d),action:m,payload:g})}),this._parser.setPrintHandler((d,m,g)=>this.print(d,m,g)),this._parser.registerCsiHandler({final:"@"},d=>this.insertChars(d)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},d=>this.scrollLeft(d)),this._parser.registerCsiHandler({final:"A"},d=>this.cursorUp(d)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},d=>this.scrollRight(d)),this._parser.registerCsiHandler({final:"B"},d=>this.cursorDown(d)),this._parser.registerCsiHandler({final:"C"},d=>this.cursorForward(d)),this._parser.registerCsiHandler({final:"D"},d=>this.cursorBackward(d)),this._parser.registerCsiHandler({final:"E"},d=>this.cursorNextLine(d)),this._parser.registerCsiHandler({final:"F"},d=>this.cursorPrecedingLine(d)),this._parser.registerCsiHandler({final:"G"},d=>this.cursorCharAbsolute(d)),this._parser.registerCsiHandler({final:"H"},d=>this.cursorPosition(d)),this._parser.registerCsiHandler({final:"I"},d=>this.cursorForwardTab(d)),this._parser.registerCsiHandler({final:"J"},d=>this.eraseInDisplay(d,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},d=>this.eraseInDisplay(d,!0)),this._parser.registerCsiHandler({final:"K"},d=>this.eraseInLine(d,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},d=>this.eraseInLine(d,!0)),this._parser.registerCsiHandler({final:"L"},d=>this.insertLines(d)),this._parser.registerCsiHandler({final:"M"},d=>this.deleteLines(d)),this._parser.registerCsiHandler({final:"P"},d=>this.deleteChars(d)),this._parser.registerCsiHandler({final:"S"},d=>this.scrollUp(d)),this._parser.registerCsiHandler({final:"T"},d=>this.scrollDown(d)),this._parser.registerCsiHandler({final:"X"},d=>this.eraseChars(d)),this._parser.registerCsiHandler({final:"Z"},d=>this.cursorBackwardTab(d)),this._parser.registerCsiHandler({final:"`"},d=>this.charPosAbsolute(d)),this._parser.registerCsiHandler({final:"a"},d=>this.hPositionRelative(d)),this._parser.registerCsiHandler({final:"b"},d=>this.repeatPrecedingCharacter(d)),this._parser.registerCsiHandler({final:"c"},d=>this.sendDeviceAttributesPrimary(d)),this._parser.registerCsiHandler({prefix:">",final:"c"},d=>this.sendDeviceAttributesSecondary(d)),this._parser.registerCsiHandler({final:"d"},d=>this.linePosAbsolute(d)),this._parser.registerCsiHandler({final:"e"},d=>this.vPositionRelative(d)),this._parser.registerCsiHandler({final:"f"},d=>this.hVPosition(d)),this._parser.registerCsiHandler({final:"g"},d=>this.tabClear(d)),this._parser.registerCsiHandler({final:"h"},d=>this.setMode(d)),this._parser.registerCsiHandler({prefix:"?",final:"h"},d=>this.setModePrivate(d)),this._parser.registerCsiHandler({final:"l"},d=>this.resetMode(d)),this._parser.registerCsiHandler({prefix:"?",final:"l"},d=>this.resetModePrivate(d)),this._parser.registerCsiHandler({final:"m"},d=>this.charAttributes(d)),this._parser.registerCsiHandler({final:"n"},d=>this.deviceStatus(d)),this._parser.registerCsiHandler({prefix:"?",final:"n"},d=>this.deviceStatusPrivate(d)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},d=>this.softReset(d)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},d=>this.setCursorStyle(d)),this._parser.registerCsiHandler({final:"r"},d=>this.setScrollRegion(d)),this._parser.registerCsiHandler({final:"s"},d=>this.saveCursor(d)),this._parser.registerCsiHandler({final:"t"},d=>this.windowOptions(d)),this._parser.registerCsiHandler({final:"u"},d=>this.restoreCursor(d)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},d=>this.insertColumns(d)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},d=>this.deleteColumns(d)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},d=>this.selectProtected(d)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},d=>this.requestMode(d,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},d=>this.requestMode(d,!1)),this._parser.setExecuteHandler(ge.BEL,()=>this.bell()),this._parser.setExecuteHandler(ge.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(ge.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(ge.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(ge.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(ge.BS,()=>this.backspace()),this._parser.setExecuteHandler(ge.HT,()=>this.tab()),this._parser.setExecuteHandler(ge.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(ge.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(Ef.IND,()=>this.index()),this._parser.setExecuteHandler(Ef.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(Ef.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new Er(d=>(this.setTitle(d),this.setIconName(d),!0))),this._parser.registerOscHandler(1,new Er(d=>this.setIconName(d))),this._parser.registerOscHandler(2,new Er(d=>this.setTitle(d))),this._parser.registerOscHandler(4,new Er(d=>this.setOrReportIndexedColor(d))),this._parser.registerOscHandler(8,new Er(d=>this.setHyperlink(d))),this._parser.registerOscHandler(10,new Er(d=>this.setOrReportFgColor(d))),this._parser.registerOscHandler(11,new Er(d=>this.setOrReportBgColor(d))),this._parser.registerOscHandler(12,new Er(d=>this.setOrReportCursorColor(d))),this._parser.registerOscHandler(104,new Er(d=>this.restoreIndexedColor(d))),this._parser.registerOscHandler(110,new Er(d=>this.restoreFgColor(d))),this._parser.registerOscHandler(111,new Er(d=>this.restoreBgColor(d))),this._parser.registerOscHandler(112,new Er(d=>this.restoreCursorColor(d))),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 d in _n)this._parser.registerEscHandler({intermediates:"(",final:d},()=>this.selectCharset("("+d)),this._parser.registerEscHandler({intermediates:")",final:d},()=>this.selectCharset(")"+d)),this._parser.registerEscHandler({intermediates:"*",final:d},()=>this.selectCharset("*"+d)),this._parser.registerEscHandler({intermediates:"+",final:d},()=>this.selectCharset("+"+d)),this._parser.registerEscHandler({intermediates:"-",final:d},()=>this.selectCharset("-"+d)),this._parser.registerEscHandler({intermediates:".",final:d},()=>this.selectCharset("."+d)),this._parser.registerEscHandler({intermediates:"/",final:d},()=>this.selectCharset("/"+d));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(d=>(this._logService.error("Parsing error: ",d),d)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new kE((d,m)=>this.requestStatusString(d,m)))}getAttrData(){return this._curAttrData}_preserveStack(e,t,n,r){this._parseStack.paused=!0,this._parseStack.cursorStartX=e,this._parseStack.cursorStartY=t,this._parseStack.decodedLength=n,this._parseStack.position=r}_logSlowResolvingAsync(e){this._logService.logLevel<=3&&Promise.race([e,new Promise((t,n)=>setTimeout(()=>n("#SLOW_TIMEOUT"),ME))]).catch(t=>{if(t!=="#SLOW_TIMEOUT")throw t;console.warn(`async parser handler taking longer than ${ME} ms`)})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(e,t){let n,r=this._activeBuffer.x,s=this._activeBuffer.y,a=0,l=this._parseStack.paused;if(l){if(n=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,t))return this._logSlowResolvingAsync(n),n;r=this._parseStack.cursorStartX,s=this._parseStack.cursorStartY,this._parseStack.paused=!1,e.length>Zs&&(a=this._parseStack.position+Zs)}if(this._logService.logLevel<=1&&this._logService.debug(`parsing data ${typeof e=="string"?` "${e}"`:` "${Array.prototype.map.call(e,d=>String.fromCharCode(d)).join("")}"`}`),this._logService.logLevel===0&&this._logService.trace("parsing data (codes)",typeof e=="string"?e.split("").map(d=>d.charCodeAt(0)):e),this._parseBuffer.length<e.length&&this._parseBuffer.length<Zs&&(this._parseBuffer=new Uint32Array(Math.min(e.length,Zs))),l||this._dirtyRowTracker.clearRange(),e.length>Zs)for(let d=a;d<e.length;d+=Zs){let m=d+Zs<e.length?d+Zs:e.length,g=typeof e=="string"?this._stringDecoder.decode(e.substring(d,m),this._parseBuffer):this._utf8Decoder.decode(e.subarray(d,m),this._parseBuffer);if(n=this._parser.parse(this._parseBuffer,g))return this._preserveStack(r,s,g,d),this._logSlowResolvingAsync(n),n}else if(!l){let d=typeof e=="string"?this._stringDecoder.decode(e,this._parseBuffer):this._utf8Decoder.decode(e,this._parseBuffer);if(n=this._parser.parse(this._parseBuffer,d))return this._preserveStack(r,s,d,0),this._logSlowResolvingAsync(n),n}(this._activeBuffer.x!==r||this._activeBuffer.y!==s)&&this._onCursorMove.fire();let u=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),h=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);h<this._bufferService.rows&&this._onRequestRefreshRows.fire({start:Math.min(h,this._bufferService.rows-1),end:Math.min(u,this._bufferService.rows-1)})}print(e,t,n){let r,s,a=this._charsetService.charset,l=this._optionsService.rawOptions.screenReaderMode,u=this._bufferService.cols,h=this._coreService.decPrivateModes.wraparound,d=this._coreService.modes.insertMode,m=this._curAttrData,g=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&n-t>0&&g.getWidth(this._activeBuffer.x-1)===2&&g.setCellFromCodepoint(this._activeBuffer.x-1,0,1,m);let _=this._parser.precedingJoinState;for(let b=t;b<n;++b){if(r=e[b],r<127&&a){let k=a[String.fromCharCode(r)];k&&(r=k.charCodeAt(0))}let w=this._unicodeService.charProperties(r,_);s=Yo.extractWidth(w);let S=Yo.extractShouldJoin(w),C=S?Yo.extractWidth(_):0;if(_=w,l&&this._onA11yChar.fire(to(r)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+s-C>u){if(h){let k=g,R=this._activeBuffer.x-C;for(this._activeBuffer.x=C,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),g=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),C>0&&g instanceof du&&g.copyCellsFrom(k,R,0,C,!1);R<u;)k.setCellFromCodepoint(R++,0,1,m)}else if(this._activeBuffer.x=u-1,s===2)continue}if(S&&this._activeBuffer.x){let k=g.getWidth(this._activeBuffer.x-1)?1:2;g.addCodepointToCell(this._activeBuffer.x-k,r,s);for(let R=s-C;--R>=0;)g.setCellFromCodepoint(this._activeBuffer.x++,0,0,m);continue}if(d&&(g.insertCells(this._activeBuffer.x,s-C,this._activeBuffer.getNullCell(m)),g.getWidth(u-1)===2&&g.setCellFromCodepoint(u-1,0,1,m)),g.setCellFromCodepoint(this._activeBuffer.x++,r,s,m),s>0)for(;--s;)g.setCellFromCodepoint(this._activeBuffer.x++,0,0,m)}this._parser.precedingJoinState=_,this._activeBuffer.x<u&&n-t>0&&g.getWidth(this._activeBuffer.x)===0&&!g.hasContent(this._activeBuffer.x)&&g.setCellFromCodepoint(this._activeBuffer.x,0,1,m),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(e,t){return e.final==="t"&&!e.prefix&&!e.intermediates?this._parser.registerCsiHandler(e,n=>TE(n.params[0],this._optionsService.rawOptions.windowOptions)?t(n):!0):this._parser.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._parser.registerDcsHandler(e,new kE(t))}registerEscHandler(e,t){return this._parser.registerEscHandler(e,t)}registerOscHandler(e,t){return this._parser.registerOscHandler(e,new Er(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,n,r=!1,s=!1){let a=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);a.replaceCells(t,n,this._activeBuffer.getNullCell(this._eraseAttrData()),s),r&&(a.isWrapped=!1)}_resetBufferLine(e,t=!1){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);n&&(n.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),t),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+e),n.isWrapped=!1)}eraseInDisplay(e,t=!1){var r;this._restrictCursor(this._bufferService.cols);let n;switch(e.params[0]){case 0:for(n=this._activeBuffer.y,this._dirtyRowTracker.markDirty(n),this._eraseInBufferLine(n++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);n<this._bufferService.rows;n++)this._resetBufferLine(n,t);this._dirtyRowTracker.markDirty(n);break;case 1:for(n=this._activeBuffer.y,this._dirtyRowTracker.markDirty(n),this._eraseInBufferLine(n,0,this._activeBuffer.x+1,!0,t),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(n+1).isWrapped=!1);n--;)this._resetBufferLine(n,t);this._dirtyRowTracker.markDirty(0);break;case 2:if(this._optionsService.rawOptions.scrollOnEraseInDisplay){for(n=this._bufferService.rows,this._dirtyRowTracker.markRangeDirty(0,n-1);n--&&!((r=this._activeBuffer.lines.get(this._activeBuffer.ybase+n))!=null&&r.getTrimmedLength()););for(;n>=0;n--)this._bufferService.scroll(this._eraseAttrData())}else{for(n=this._bufferService.rows,this._dirtyRowTracker.markDirty(n-1);n--;)this._resetBufferLine(n,t);this._dirtyRowTracker.markDirty(0)}break;case 3:let s=this._activeBuffer.lines.length-this._bufferService.rows;s>0&&(this._activeBuffer.lines.trimStart(s),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-s,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-s,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 n=this._activeBuffer.ybase+this._activeBuffer.y,r=this._bufferService.rows-1-this._activeBuffer.scrollBottom,s=this._bufferService.rows-1+this._activeBuffer.ybase-r+1;for(;t--;)this._activeBuffer.lines.splice(s-1,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}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 n=this._activeBuffer.ybase+this._activeBuffer.y,r;for(r=this._bufferService.rows-1-this._activeBuffer.scrollBottom,r=this._bufferService.rows-1+this._activeBuffer.ybase-r;t--;)this._activeBuffer.lines.splice(n,1),this._activeBuffer.lines.splice(r,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(an));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 n=this._activeBuffer.scrollTop;n<=this._activeBuffer.scrollBottom;++n){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+n);r.deleteCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),r.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 n=this._activeBuffer.scrollTop;n<=this._activeBuffer.scrollBottom;++n){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+n);r.insertCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),r.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 n=this._activeBuffer.scrollTop;n<=this._activeBuffer.scrollBottom;++n){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+n);r.insertCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),r.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 n=this._activeBuffer.scrollTop;n<=this._activeBuffer.scrollBottom;++n){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+n);r.deleteCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),r.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 n=e.params[0]||1,r=Yo.extractWidth(t),s=this._activeBuffer.x-r,a=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(s),l=new Uint32Array(a.length*n),u=0;for(let d=0;d<a.length;){let m=a.codePointAt(d)||0;l[u++]=m,d+=m>65535?2:1}let h=u;for(let d=1;d<n;++d)l.copyWithin(h,0,u),h+=u;return this.print(l,0,h),!0}sendDeviceAttributesPrimary(e){return e.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(ge.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(ge.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(e){return e.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(ge.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(ge.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(e.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(ge.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,Vo),this._charsetService.setgCharset(1,Vo),this._charsetService.setgCharset(2,Vo),this._charsetService.setgCharset(3,Vo);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){(S=>(S[S.NOT_RECOGNIZED=0]="NOT_RECOGNIZED",S[S.SET=1]="SET",S[S.RESET=2]="RESET",S[S.PERMANENTLY_SET=3]="PERMANENTLY_SET",S[S.PERMANENTLY_RESET=4]="PERMANENTLY_RESET"))(void 0||(n={}));let r=this._coreService.decPrivateModes,{activeProtocol:s,activeEncoding:a}=this._coreMouseService,l=this._coreService,{buffers:u,cols:h}=this._bufferService,{active:d,alt:m}=u,g=this._optionsService.rawOptions,_=(S,C)=>(l.triggerDataEvent(`${ge.ESC}[${t?"":"?"}${S};${C}$y`),!0),b=S=>S?1:2,w=e.params[0];return t?w===2?_(w,4):w===4?_(w,b(l.modes.insertMode)):w===12?_(w,3):w===20?_(w,b(g.convertEol)):_(w,0):w===1?_(w,b(r.applicationCursorKeys)):w===3?_(w,g.windowOptions.setWinLines?h===80?2:h===132?1:0:0):w===6?_(w,b(r.origin)):w===7?_(w,b(r.wraparound)):w===8?_(w,3):w===9?_(w,b(s==="X10")):w===12?_(w,b(g.cursorBlink)):w===25?_(w,b(!l.isCursorHidden)):w===45?_(w,b(r.reverseWraparound)):w===66?_(w,b(r.applicationKeypad)):w===67?_(w,4):w===1e3?_(w,b(s==="VT200")):w===1002?_(w,b(s==="DRAG")):w===1003?_(w,b(s==="ANY")):w===1004?_(w,b(r.sendFocus)):w===1005?_(w,4):w===1006?_(w,b(a==="SGR")):w===1015?_(w,4):w===1016?_(w,b(a==="SGR_PIXELS")):w===1048?_(w,1):w===47||w===1047||w===1049?_(w,b(d===m)):w===2004?_(w,b(r.bracketedPasteMode)):w===2026?_(w,b(r.synchronizedOutput)):_(w,0)}_updateAttrColor(e,t,n,r,s){return t===2?(e|=50331648,e&=-16777216,e|=hd.fromColorRGB([n,r,s])):t===5&&(e&=-50331904,e|=33554432|n&255),e}_extractColor(e,t,n){let r=[0,0,-1,0,0,0],s=0,a=0;do{if(r[a+s]=e.params[t+a],e.hasSubParams(t+a)){let l=e.getSubParams(t+a),u=0;do r[1]===5&&(s=1),r[a+u+1+s]=l[u];while(++u<l.length&&u+a+1+s<r.length);break}if(r[1]===5&&a+s>=2||r[1]===2&&a+s>=5)break;r[1]&&(s=1)}while(++a+t<e.length&&a+s<r.length);for(let l=2;l<r.length;++l)r[l]===-1&&(r[l]=0);switch(r[0]){case 38:n.fg=this._updateAttrColor(n.fg,r[1],r[3],r[4],r[5]);break;case 48:n.bg=this._updateAttrColor(n.bg,r[1],r[3],r[4],r[5]);break;case 58:n.extended=n.extended.clone(),n.extended.underlineColor=this._updateAttrColor(n.extended.underlineColor,r[1],r[3],r[4],r[5])}return a}_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=an.fg,e.bg=an.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,n,r=this._curAttrData;for(let s=0;s<t;s++)n=e.params[s],n>=30&&n<=37?(r.fg&=-50331904,r.fg|=16777216|n-30):n>=40&&n<=47?(r.bg&=-50331904,r.bg|=16777216|n-40):n>=90&&n<=97?(r.fg&=-50331904,r.fg|=16777216|n-90|8):n>=100&&n<=107?(r.bg&=-50331904,r.bg|=16777216|n-100|8):n===0?this._processSGR0(r):n===1?r.fg|=134217728:n===3?r.bg|=67108864:n===4?(r.fg|=268435456,this._processUnderline(e.hasSubParams(s)?e.getSubParams(s)[0]:1,r)):n===5?r.fg|=536870912:n===7?r.fg|=67108864:n===8?r.fg|=1073741824:n===9?r.fg|=2147483648:n===2?r.bg|=134217728:n===21?this._processUnderline(2,r):n===22?(r.fg&=-134217729,r.bg&=-134217729):n===23?r.bg&=-67108865:n===24?(r.fg&=-268435457,this._processUnderline(0,r)):n===25?r.fg&=-536870913:n===27?r.fg&=-67108865:n===28?r.fg&=-1073741825:n===29?r.fg&=2147483647:n===39?(r.fg&=-67108864,r.fg|=an.fg&16777215):n===49?(r.bg&=-67108864,r.bg|=an.bg&16777215):n===38||n===48||n===58?s+=this._extractColor(e,s,r):n===53?r.bg|=1073741824:n===55?r.bg&=-1073741825:n===59?(r.extended=r.extended.clone(),r.extended.underlineColor=-1,r.updateExtended()):n===100?(r.fg&=-67108864,r.fg|=an.fg&16777215,r.bg&=-67108864,r.bg|=an.bg&16777215):this._logService.debug("Unknown SGR attribute: %d.",n);return!0}deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(`${ge.ESC}[0n`);break;case 6:let t=this._activeBuffer.y+1,n=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${ge.ESC}[${t};${n}R`);break}return!0}deviceStatusPrivate(e){switch(e.params[0]){case 6:let t=this._activeBuffer.y+1,n=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${ge.ESC}[?${t};${n}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=an.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 n=t%2===1;this._coreService.decPrivateModes.cursorBlink=n}return!0}setScrollRegion(e){let t=e.params[0]||1,n;return(e.length<2||(n=e.params[1])>this._bufferService.rows||n===0)&&(n=this._bufferService.rows),n>t&&(this._activeBuffer.scrollTop=t-1,this._activeBuffer.scrollBottom=n-1,this._setCursor(0,0)),!0}windowOptions(e){if(!TE(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(`${ge.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:(t===0||t===2)&&(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>RE&&this._windowTitleStack.shift()),(t===0||t===1)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>RE&&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=[],n=e.split(";");for(;n.length>1;){let r=n.shift(),s=n.shift();if(/^\d+$/.exec(r)){let a=parseInt(r);if(AE(a))if(s==="?")t.push({type:0,index:a});else{let l=EE(s);l&&t.push({type:1,index:a,color:l})}}}return t.length&&this._onColor.fire(t),!0}setHyperlink(e){let t=e.indexOf(";");if(t===-1)return!0;let n=e.slice(0,t).trim(),r=e.slice(t+1);return r?this._createHyperlink(n,r):n.trim()?!1:this._finishHyperlink()}_createHyperlink(e,t){this._getCurrentLinkId()&&this._finishHyperlink();let n=e.split(":"),r,s=n.findIndex(a=>a.startsWith("id="));return s!==-1&&(r=n[s].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:r,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 n=e.split(";");for(let r=0;r<n.length&&!(t>=this._specialColors.length);++r,++t)if(n[r]==="?")this._onColor.fire([{type:0,index:this._specialColors[t]}]);else{let s=EE(n[r]);s&&this._onColor.fire([{type:1,index:this._specialColors[t],color:s}])}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=[],n=e.split(";");for(let r=0;r<n.length;++r)if(/^\d+$/.exec(n[r])){let s=parseInt(n[r]);AE(s)&&t.push({type:2,index:s})}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,Vo),!0}selectCharset(e){return e.length!==2?(this.selectDefaultCharset(),!0):(e[0]==="/"||this._charsetService.setgCharset(gJ[e[0]],_n[e[1]]||Vo),!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=an.clone(),this._eraseAttrDataInternal=an.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 Qr;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 n=this._activeBuffer.ybase+this._activeBuffer.y+t,r=this._activeBuffer.lines.get(n);r&&(r.fill(e),r.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(e,t){let n=l=>(this._coreService.triggerDataEvent(`${ge.ESC}${l}${ge.ESC}\\`),!0),r=this._bufferService.buffer,s=this._optionsService.rawOptions;return n(e==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:e==='"p'?'P1$r61;1"p':e==="r"?`P1$r${r.scrollTop+1};${r.scrollBottom+1}r`:e==="m"?"P1$r0m":e===" q"?`P1$r${{block:2,underline:4,bar:6}[s.cursorStyle]-(s.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(e,t){this._dirtyRowTracker.markRangeDirty(e,t)}},Wy=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&&(NE=e,e=t,t=NE),e<this.start&&(this.start=e),t>this.end&&(this.end=t)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};Wy=Xt([Me(0,ir)],Wy);function AE(e){return 0<=e&&e<256}var _J=5e7,DE=12,yJ=50,bJ=class extends Je{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 ke),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 n;for(;n=this._writeBuffer.shift();){this._action(n);let r=this._callbacks.shift();r&&r()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(e,t){if(this._pendingData>_J)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 n=e||performance.now();for(;this._writeBuffer.length>this._bufferOffset;){let r=this._writeBuffer[this._bufferOffset],s=this._action(r,t);if(s){let l=u=>performance.now()-n>=DE?setTimeout(()=>this._innerWrite(0,u)):this._innerWrite(n,u);s.catch(u=>(queueMicrotask(()=>{throw u}),Promise.resolve(!1))).then(l);return}let a=this._callbacks[this._bufferOffset];if(a&&a(),this._bufferOffset++,this._pendingData-=r.length,performance.now()-n>=DE)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>yJ&&(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()}},Vy=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 u=t.addMarker(t.ybase+t.y),h={data:e,id:this._nextId++,lines:[u]};return u.onDispose(()=>this._removeMarkerFromLink(h,u)),this._dataByLinkId.set(h.id,h),h.id}let n=e,r=this._getEntryIdKey(n),s=this._entriesWithId.get(r);if(s)return this.addLineToLink(s.id,t.ybase+t.y),s.id;let a=t.addMarker(t.ybase+t.y),l={id:this._nextId++,key:this._getEntryIdKey(n),data:n,lines:[a]};return a.onDispose(()=>this._removeMarkerFromLink(l,a)),this._entriesWithId.set(l.key,l),this._dataByLinkId.set(l.id,l),l.id}addLineToLink(e,t){let n=this._dataByLinkId.get(e);if(n&&n.lines.every(r=>r.line!==t)){let r=this._bufferService.buffer.addMarker(t);n.lines.push(r),r.onDispose(()=>this._removeMarkerFromLink(n,r))}}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 n=e.lines.indexOf(t);n!==-1&&(e.lines.splice(n,1),e.lines.length===0&&(e.data.id!==void 0&&this._entriesWithId.delete(e.key),this._dataByLinkId.delete(e.id)))}};Vy=Xt([Me(0,ir)],Vy);var OE=!1,xJ=class extends Je{constructor(e){super(),this._windowsWrappingHeuristics=this._register(new Ol),this._onBinary=this._register(new ke),this.onBinary=this._onBinary.event,this._onData=this._register(new ke),this.onData=this._onData.event,this._onLineFeed=this._register(new ke),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new ke),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new ke),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new ke),this._instantiationService=new VQ,this.optionsService=this._register(new tJ(e)),this._instantiationService.setService(sr,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(Hy)),this._instantiationService.setService(ir,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(Iy)),this._instantiationService.setService(P5,this._logService),this.coreService=this._register(this._instantiationService.createInstance(Fy)),this._instantiationService.setService(va,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(Uy)),this._instantiationService.setService(z5,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(Yo)),this._instantiationService.setService(FX,this.unicodeService),this._charsetService=this._instantiationService.createInstance(oJ),this._instantiationService.setService(HX,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(Vy),this._instantiationService.setService(B5,this._oscLinkService),this._inputHandler=this._register(new vJ(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(Un.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(Un.forward(this._bufferService.onResize,this._onResize)),this._register(Un.forward(this.coreService.onData,this._onData)),this._register(Un.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 bJ((t,n)=>this._inputHandler.parse(t,n))),this._register(Un.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new ke),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&&!OE&&(this._logService.warn("writeSync is unreliable and will be removed soon."),OE=!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,gD),t=Math.max(t,vD),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(CE.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:"H"},()=>(CE(this._bufferService),!1))),this._windowsWrappingHeuristics.value=$t(()=>{for(let t of e)t.dispose()})}}},wJ={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 SJ(e,t,n,r){var l;let s={type:0,cancel:!1,key:void 0},a=(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?s.key=ge.ESC+"OA":s.key=ge.ESC+"[A":e.key==="UIKeyInputLeftArrow"?t?s.key=ge.ESC+"OD":s.key=ge.ESC+"[D":e.key==="UIKeyInputRightArrow"?t?s.key=ge.ESC+"OC":s.key=ge.ESC+"[C":e.key==="UIKeyInputDownArrow"&&(t?s.key=ge.ESC+"OB":s.key=ge.ESC+"[B");break;case 8:s.key=e.ctrlKey?"\b":ge.DEL,e.altKey&&(s.key=ge.ESC+s.key);break;case 9:if(e.shiftKey){s.key=ge.ESC+"[Z";break}s.key=ge.HT,s.cancel=!0;break;case 13:s.key=e.altKey?ge.ESC+ge.CR:ge.CR,s.cancel=!0;break;case 27:s.key=ge.ESC,e.altKey&&(s.key=ge.ESC+ge.ESC),s.cancel=!0;break;case 37:if(e.metaKey)break;a?s.key=ge.ESC+"[1;"+(a+1)+"D":t?s.key=ge.ESC+"OD":s.key=ge.ESC+"[D";break;case 39:if(e.metaKey)break;a?s.key=ge.ESC+"[1;"+(a+1)+"C":t?s.key=ge.ESC+"OC":s.key=ge.ESC+"[C";break;case 38:if(e.metaKey)break;a?s.key=ge.ESC+"[1;"+(a+1)+"A":t?s.key=ge.ESC+"OA":s.key=ge.ESC+"[A";break;case 40:if(e.metaKey)break;a?s.key=ge.ESC+"[1;"+(a+1)+"B":t?s.key=ge.ESC+"OB":s.key=ge.ESC+"[B";break;case 45:!e.shiftKey&&!e.ctrlKey&&(s.key=ge.ESC+"[2~");break;case 46:a?s.key=ge.ESC+"[3;"+(a+1)+"~":s.key=ge.ESC+"[3~";break;case 36:a?s.key=ge.ESC+"[1;"+(a+1)+"H":t?s.key=ge.ESC+"OH":s.key=ge.ESC+"[H";break;case 35:a?s.key=ge.ESC+"[1;"+(a+1)+"F":t?s.key=ge.ESC+"OF":s.key=ge.ESC+"[F";break;case 33:e.shiftKey?s.type=2:e.ctrlKey?s.key=ge.ESC+"[5;"+(a+1)+"~":s.key=ge.ESC+"[5~";break;case 34:e.shiftKey?s.type=3:e.ctrlKey?s.key=ge.ESC+"[6;"+(a+1)+"~":s.key=ge.ESC+"[6~";break;case 112:a?s.key=ge.ESC+"[1;"+(a+1)+"P":s.key=ge.ESC+"OP";break;case 113:a?s.key=ge.ESC+"[1;"+(a+1)+"Q":s.key=ge.ESC+"OQ";break;case 114:a?s.key=ge.ESC+"[1;"+(a+1)+"R":s.key=ge.ESC+"OR";break;case 115:a?s.key=ge.ESC+"[1;"+(a+1)+"S":s.key=ge.ESC+"OS";break;case 116:a?s.key=ge.ESC+"[15;"+(a+1)+"~":s.key=ge.ESC+"[15~";break;case 117:a?s.key=ge.ESC+"[17;"+(a+1)+"~":s.key=ge.ESC+"[17~";break;case 118:a?s.key=ge.ESC+"[18;"+(a+1)+"~":s.key=ge.ESC+"[18~";break;case 119:a?s.key=ge.ESC+"[19;"+(a+1)+"~":s.key=ge.ESC+"[19~";break;case 120:a?s.key=ge.ESC+"[20;"+(a+1)+"~":s.key=ge.ESC+"[20~";break;case 121:a?s.key=ge.ESC+"[21;"+(a+1)+"~":s.key=ge.ESC+"[21~";break;case 122:a?s.key=ge.ESC+"[23;"+(a+1)+"~":s.key=ge.ESC+"[23~";break;case 123:a?s.key=ge.ESC+"[24;"+(a+1)+"~":s.key=ge.ESC+"[24~";break;default:if(e.ctrlKey&&!e.shiftKey&&!e.altKey&&!e.metaKey)e.keyCode>=65&&e.keyCode<=90?s.key=String.fromCharCode(e.keyCode-64):e.keyCode===32?s.key=ge.NUL:e.keyCode>=51&&e.keyCode<=55?s.key=String.fromCharCode(e.keyCode-51+27):e.keyCode===56?s.key=ge.DEL:e.keyCode===219?s.key=ge.ESC:e.keyCode===220?s.key=ge.FS:e.keyCode===221&&(s.key=ge.GS);else if((!n||r)&&e.altKey&&!e.metaKey){let u=(l=wJ[e.keyCode])==null?void 0:l[e.shiftKey?1:0];if(u)s.key=ge.ESC+u;else if(e.keyCode>=65&&e.keyCode<=90){let h=e.ctrlKey?e.keyCode-64:e.keyCode+32,d=String.fromCharCode(h);e.shiftKey&&(d=d.toUpperCase()),s.key=ge.ESC+d}else if(e.keyCode===32)s.key=ge.ESC+(e.ctrlKey?ge.NUL:" ");else if(e.key==="Dead"&&e.code.startsWith("Key")){let h=e.code.slice(3,4);e.shiftKey||(h=h.toLowerCase()),s.key=ge.ESC+h,s.cancel=!0}}else n&&!e.altKey&&!e.ctrlKey&&!e.shiftKey&&e.metaKey?e.keyCode===65&&(s.type=1):e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.keyCode>=48&&e.key.length===1?s.key=e.key:e.key&&e.ctrlKey&&(e.key==="_"&&(s.key=ge.US),e.key==="@"&&(s.key=ge.NUL));break}return s}var en=0,CJ=class{constructor(e){this._getKey=e,this._array=[],this._insertedValues=[],this._flushInsertedTask=new sp,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new sp,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((s,a)=>this._getKey(s)-this._getKey(a)),t=0,n=0,r=new Array(this._array.length+this._insertedValues.length);for(let s=0;s<r.length;s++)n>=this._array.length||this._getKey(e[t])<=this._getKey(this._array[n])?(r[s]=e[t],t++):r[s]=this._array[n++];this._array=r,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||(en=this._search(t),en===-1)||this._getKey(this._array[en])!==t)return!1;do if(this._array[en]===e)return this._deletedIndices.length===0&&this._flushDeletedTask.enqueue(()=>this._flushDeleted()),this._deletedIndices.push(en),!0;while(++en<this._array.length&&this._getKey(this._array[en])===t);return!1}_flushDeleted(){this._isFlushingDeleted=!0;let e=this._deletedIndices.sort((s,a)=>s-a),t=0,n=new Array(this._array.length-e.length),r=0;for(let s=0;s<this._array.length;s++)e[t]===s?t++:n[r++]=this._array[s];this._array=n,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&&(en=this._search(e),!(en<0||en>=this._array.length)&&this._getKey(this._array[en])===e))do yield this._array[en];while(++en<this._array.length&&this._getKey(this._array[en])===e)}forEachByKey(e,t){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(en=this._search(e),!(en<0||en>=this._array.length)&&this._getKey(this._array[en])===e))do t(this._array[en]);while(++en<this._array.length&&this._getKey(this._array[en])===e)}values(){return this._flushCleanupInserted(),this._flushCleanupDeleted(),[...this._array].values()}_search(e){let t=0,n=this._array.length-1;for(;n>=t;){let r=t+n>>1,s=this._getKey(this._array[r]);if(s>e)n=r-1;else if(s<e)t=r+1;else{for(;r>0&&this._getKey(this._array[r-1])===e;)r--;return r}}return t}},m_=0,jE=0,kJ=class extends Je{constructor(){super(),this._decorations=new CJ(e=>e==null?void 0:e.marker.line),this._onDecorationRegistered=this._register(new ke),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this._register(new ke),this.onDecorationRemoved=this._onDecorationRemoved.event,this._register($t(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(e){if(e.marker.isDisposed)return;let t=new EJ(e);if(t){let n=t.marker.onDispose(()=>t.dispose()),r=t.onDispose(()=>{r.dispose(),t&&(this._decorations.delete(t)&&this._onDecorationRemoved.fire(t),n.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,n){let r=0,s=0;for(let a of this._decorations.getKeyIterator(t))r=a.options.x??0,s=r+(a.options.width??1),e>=r&&e<s&&(!n||(a.options.layer??"bottom")===n)&&(yield a)}forEachDecorationAtCell(e,t,n,r){this._decorations.forEachByKey(t,s=>{m_=s.options.x??0,jE=m_+(s.options.width??1),e>=m_&&e<jE&&(!n||(s.options.layer??"bottom")===n)&&r(s)})}},EJ=class extends ao{constructor(e){super(),this.options=e,this.onRenderEmitter=this.add(new ke),this.onRender=this.onRenderEmitter.event,this._onDispose=this.add(new ke),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=Vt.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=Vt.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}dispose(){this._onDispose.fire(),super.dispose()}},RJ=1e3,TJ=class{constructor(e,t=RJ){this._renderCallback=e,this._debounceThresholdMS=t,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(e,t,n){this._rowCount=n,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 r=performance.now();if(r-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=r,this._innerRefresh();else if(!this._additionalRefreshRequested){let s=r-this._lastRefreshMs,a=this._debounceThresholdMS-s;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=performance.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},a)}}_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)}},LE=20,op=class extends Je{constructor(e,t,n,r){super(),this._terminal=e,this._coreBrowserService=n,this._renderService=r,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="";let s=this._coreBrowserService.mainDocument;this._accessibilityContainer=s.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=s.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let a=0;a<this._terminal.rows;a++)this._rowElements[a]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[a]);if(this._topBoundaryFocusListener=a=>this._handleBoundaryFocus(a,0),this._bottomBoundaryFocusListener=a=>this._handleBoundaryFocus(a,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=s.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this._register(new TJ(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(a=>this._handleResize(a.rows))),this._register(this._terminal.onRender(a=>this._refreshRows(a.start,a.end))),this._register(this._terminal.onScroll(()=>this._refreshRows())),this._register(this._terminal.onA11yChar(a=>this._handleChar(a))),this._register(this._terminal.onLineFeed(()=>this._handleChar(`
|
|
604
|
-
`))),this._register(this._terminal.onA11yTab(a=>this._handleTab(a))),this._register(this._terminal.onKey(a=>this._handleKey(a.key))),this._register(this._terminal.onBlur(()=>this._clearLiveRegion())),this._register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._register(Ue(s,"selectionchange",()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register($t(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar(" ")}_handleChar(e){this._liveRegionLineCount<LE+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
|
|
605
|
-
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===LE+1&&(this._liveRegion.textContent+=dy.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 n=this._terminal.buffer,r=n.lines.length.toString();for(let s=e;s<=t;s++){let a=n.lines.get(n.ydisp+s),l=[],u=(a==null?void 0:a.translateToString(!0,void 0,void 0,l))||"",h=(n.ydisp+s+1).toString(),d=this._rowElements[s];d&&(u.length===0?(d.textContent=" ",this._rowColumns.set(d,[0,1])):(d.textContent=u,this._rowColumns.set(d,l)),d.setAttribute("aria-posinset",h),d.setAttribute("aria-setsize",r),this._alignRowWidth(d))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(e,t){let n=e.target,r=this._rowElements[t===0?1:this._rowElements.length-2],s=n.getAttribute("aria-posinset"),a=t===0?"1":`${this._terminal.buffer.lines.length}`;if(s===a||e.relatedTarget!==r)return;let l,u;if(t===0?(l=n,u=this._rowElements.pop(),this._rowContainer.removeChild(u)):(l=this._rowElements.shift(),u=n,this._rowContainer.removeChild(l)),l.removeEventListener("focus",this._topBoundaryFocusListener),u.removeEventListener("focus",this._bottomBoundaryFocusListener),t===0){let h=this._createAccessibilityTreeNode();this._rowElements.unshift(h),this._rowContainer.insertAdjacentElement("afterbegin",h)}else{let h=this._createAccessibilityTreeNode();this._rowElements.push(h),this._rowContainer.appendChild(h)}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 u;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},n={node:e.focusNode,offset:e.focusOffset};if((t.node.compareDocumentPosition(n.node)&Node.DOCUMENT_POSITION_PRECEDING||t.node===n.node&&t.offset>n.offset)&&([t,n]=[n,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 r=this._rowElements.slice(-1)[0];if(n.node.compareDocumentPosition(r)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(n={node:r,offset:((u=r.textContent)==null?void 0:u.length)??0}),!this._rowContainer.contains(n.node))return;let s=({node:h,offset:d})=>{let m=h instanceof Text?h.parentNode:h,g=parseInt(m==null?void 0:m.getAttribute("aria-posinset"),10)-1;if(isNaN(g))return console.warn("row is invalid. Race condition?"),null;let _=this._rowColumns.get(m);if(!_)return console.warn("columns is null. Race condition?"),null;let b=d<_.length?_[d]:_.slice(-1)[0]+1;return b>=this._terminal.cols&&(++g,b=0),{row:g,column:b}},a=s(t),l=s(n);if(!(!a||!l)){if(a.row>l.row||a.row===l.row&&a.column>=l.column)throw new Error("invalid range");this._terminal.select(a.column,a.row,(l.row-a.row)*this._terminal.cols-a.column+l.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 s,a;e.style.transform="";let t=e.getBoundingClientRect().width,n=(a=(s=this._rowColumns.get(e))==null?void 0:s.slice(-1))==null?void 0:a[0];if(!n)return;let r=n*this._renderService.dimensions.css.cell.width;e.style.transform=`scaleX(${r/t})`}};op=Xt([Me(1,Y0),Me(2,bs),Me(3,xs)],op);var qy=class extends Je{constructor(e,t,n,r,s){super(),this._element=e,this._mouseService=t,this._renderService=n,this._bufferService=r,this._linkProviderService=s,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this._register(new ke),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this._register(new ke),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this._register($t(()=>{var a;ia(this._linkCacheDisposables),this._linkCacheDisposables.length=0,this._lastMouseEvent=void 0,(a=this._activeProviderReplies)==null||a.clear()})),this._register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this._register(Ue(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(Ue(this._element,"mousemove",this._handleMouseMove.bind(this))),this._register(Ue(this._element,"mousedown",this._handleMouseDown.bind(this))),this._register(Ue(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 n=e.composedPath();for(let r=0;r<n.length;r++){let s=n[r];if(s.classList.contains("xterm"))break;if(s.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 r,s;(!this._activeProviderReplies||!t)&&((r=this._activeProviderReplies)==null||r.forEach(a=>{a==null||a.forEach(l=>{l.link.dispose&&l.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=e.y);let n=!1;for(let[a,l]of this._linkProviderService.linkProviders.entries())t?(s=this._activeProviderReplies)!=null&&s.get(a)&&(n=this._checkLinkProviderResult(a,e,n)):l.provideLinks(e.y,u=>{var d,m;if(this._isMouseOut)return;let h=u==null?void 0:u.map(g=>({link:g}));(d=this._activeProviderReplies)==null||d.set(a,h),n=this._checkLinkProviderResult(a,e,n),((m=this._activeProviderReplies)==null?void 0:m.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)})}_removeIntersectingLinks(e,t){let n=new Set;for(let r=0;r<t.size;r++){let s=t.get(r);if(s)for(let a=0;a<s.length;a++){let l=s[a],u=l.link.range.start.y<e?0:l.link.range.start.x,h=l.link.range.end.y>e?this._bufferService.cols:l.link.range.end.x;for(let d=u;d<=h;d++){if(n.has(d)){s.splice(a--,1);break}n.add(d)}}}}_checkLinkProviderResult(e,t,n){var a;if(!this._activeProviderReplies)return n;let r=this._activeProviderReplies.get(e),s=!1;for(let l=0;l<e;l++)(!this._activeProviderReplies.has(l)||this._activeProviderReplies.get(l))&&(s=!0);if(!s&&r){let l=r.find(u=>this._linkAtPosition(u.link,t));l&&(n=!0,this._handleNewLink(l))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!n)for(let l=0;l<this._activeProviderReplies.size;l++){let u=(a=this._activeProviderReplies.get(l))==null?void 0:a.find(h=>this._linkAtPosition(h.link,t));if(u){n=!0,this._handleNewLink(u);break}}return n}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._currentLink)return;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);t&&this._mouseDownLink&&MJ(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,ia(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 n,r;return(r=(n=this._currentLink)==null?void 0:n.state)==null?void 0:r.decorations.pointerCursor},set:n=>{var r;(r=this._currentLink)!=null&&r.state&&this._currentLink.state.decorations.pointerCursor!==n&&(this._currentLink.state.decorations.pointerCursor=n,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",n))}},underline:{get:()=>{var n,r;return(r=(n=this._currentLink)==null?void 0:n.state)==null?void 0:r.decorations.underline},set:n=>{var r,s,a;(r=this._currentLink)!=null&&r.state&&((a=(s=this._currentLink)==null?void 0:s.state)==null?void 0:a.decorations.underline)!==n&&(this._currentLink.state.decorations.underline=n,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,n))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(n=>{if(!this._currentLink)return;let r=n.start===0?0:n.start+1+this._bufferService.buffer.ydisp,s=this._bufferService.buffer.ydisp+1+n.end;if(this._currentLink.link.range.start.y>=r&&this._currentLink.link.range.end.y<=s&&(this._clearCurrentLink(r,s),this._lastMouseEvent)){let a=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);a&&this._askForLink(a,!1)}})))}_linkHover(e,t,n){var r;(r=this._currentLink)!=null&&r.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(n,t.text)}_fireUnderlineEvent(e,t){let n=e.range,r=this._bufferService.buffer.ydisp,s=this._createLinkUnderlineEvent(n.start.x-1,n.start.y-r-1,n.end.x,n.end.y-r-1,void 0);(t?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(s)}_linkLeave(e,t,n){var r;(r=this._currentLink)!=null&&r.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(n,t.text)}_linkAtPosition(e,t){let n=e.range.start.y*this._bufferService.cols+e.range.start.x,r=e.range.end.y*this._bufferService.cols+e.range.end.x,s=t.y*this._bufferService.cols+t.x;return n<=s&&s<=r}_positionFromMouseEvent(e,t,n){let r=n.getCoords(e,t,this._bufferService.cols,this._bufferService.rows);if(r)return{x:r[0],y:r[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,t,n,r,s){return{x1:e,y1:t,x2:n,y2:r,cols:this._bufferService.cols,fg:s}}};qy=Xt([Me(1,X0),Me(2,xs),Me(3,ir),Me(4,H5)],qy);function MJ(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 NJ=class extends xJ{constructor(e={}){super(e),this._linkifier=this._register(new Ol),this.browser=sD,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new Ol),this._onCursorMove=this._register(new ke),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new ke),this.onKey=this._onKey.event,this._onRender=this._register(new ke),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new ke),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new ke),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new ke),this.onBell=this._onBell.event,this._onFocus=this._register(new ke),this._onBlur=this._register(new ke),this._onA11yCharEmitter=this._register(new ke),this._onA11yTabEmitter=this._register(new ke),this._onWillOpen=this._register(new ke),this._setup(),this._decorationService=this._instantiationService.createInstance(kJ),this._instantiationService.setService(fd,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(yQ),this._instantiationService.setService(H5,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(fy)),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(Un.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(Un.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(Un.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(Un.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(t=>this._afterResize(t.cols,t.rows))),this._register($t(()=>{var t,n;this._customKeyEventHandler=void 0,(n=(t=this.element)==null?void 0:t.parentNode)==null||n.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 n,r="";switch(t.index){case 256:n="foreground",r="10";break;case 257:n="background",r="11";break;case 258:n="cursor",r="12";break;default:n="ansi",r="4;"+t.index}switch(t.type){case 0:let s=Ht.toColorRGB(n==="ansi"?this._themeService.colors.ansi[t.index]:this._themeService.colors[n]);this.coreService.triggerDataEvent(`${ge.ESC}]${r};${mJ(s)}${rD.ST}`);break;case 1:if(n==="ansi")this._themeService.modifyColors(a=>a.ansi[t.index]=cn.toColor(...t.color));else{let a=n;this._themeService.modifyColors(l=>l[a]=cn.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(op,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(ge.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(ge.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 n=Math.min(this.buffer.x,this.cols-1),r=this._renderService.dimensions.css.cell.height,s=t.getWidth(n),a=this._renderService.dimensions.css.cell.width*s,l=this.buffer.y*this._renderService.dimensions.css.cell.height,u=n*this._renderService.dimensions.css.cell.width;this.textarea.style.left=u+"px",this.textarea.style.top=l+"px",this.textarea.style.width=a+"px",this.textarea.style.height=r+"px",this.textarea.style.lineHeight=r+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this._register(Ue(this.element,"copy",t=>{this.hasSelection()&&jX(t,this._selectionService)}));let e=t=>LX(t,this.textarea,this.coreService,this.optionsService);this._register(Ue(this.textarea,"paste",e)),this._register(Ue(this.element,"paste",e)),oD?this._register(Ue(this.element,"mousedown",t=>{t.button===2&&Vk(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(Ue(this.element,"contextmenu",t=>{Vk(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),ix&&this._register(Ue(this.element,"auxclick",t=>{t.button===1&&A5(t,this.textarea,this.screenElement)}))}_bindKeys(){this._register(Ue(this.textarea,"keyup",e=>this._keyUp(e),!0)),this._register(Ue(this.textarea,"keydown",e=>this._keyDown(e),!0)),this._register(Ue(this.textarea,"keypress",e=>this._keyPress(e),!0)),this._register(Ue(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this._register(Ue(this.textarea,"compositionupdate",e=>this._compositionHelper.compositionupdate(e))),this._register(Ue(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this._register(Ue(this.textarea,"input",e=>this._inputEvent(e),!0)),this._register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(e){var s;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"),((s=this.element)==null?void 0:s.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(Ue(this.screenElement,"mousemove",a=>this.updateCursorStyle(a))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),t.appendChild(this.screenElement);let n=this.textarea=this._document.createElement("textarea");this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",uy.get()),cD||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",()=>n.readOnly=this.optionsService.rawOptions.disableStdin)),this.textarea.readOnly=this.optionsService.rawOptions.disableStdin,this._coreBrowserService=this._register(this._instantiationService.createInstance(vQ,this.textarea,e.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(bs,this._coreBrowserService),this._register(Ue(this.textarea,"focus",a=>this._handleTextAreaFocus(a))),this._register(Ue(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(jy,this._document,this._helperContainer),this._instantiationService.setService(Vp,this._charSizeService),this._themeService=this._instantiationService.createInstance(By),this._instantiationService.setService(Yl,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(rp),this._instantiationService.setService(I5,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(zy,this.rows,this.screenElement)),this._instantiationService.setService(xs,this._renderService),this._register(this._renderService.onRenderedViewportChange(a=>this._onRender.fire(a))),this.onResize(a=>this._renderService.resize(a.cols,a.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(Ay,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(Ly),this._instantiationService.setService(X0,this._mouseService);let r=this._linkifier.value=this._register(this._instantiationService.createInstance(qy,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(My,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines(a=>{super.scrollLines(a,!1),this.refresh(0,this.rows-1)})),this._selectionService=this._register(this._instantiationService.createInstance(Py,this.element,this.screenElement,r)),this._instantiationService.setService($X,this._selectionService),this._register(this._selectionService.onRequestScrollLines(a=>this.scrollLines(a.amount,a.suppressScrollEvent))),this._register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this._register(this._selectionService.onRequestRedraw(a=>this._renderService.handleSelectionChanged(a.start,a.end,a.columnSelectMode))),this._register(this._selectionService.onLinuxMouseSelection(a=>{this.textarea.value=a,this.textarea.focus(),this.textarea.select()})),this._register(Un.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{var a;this._selectionService.refresh(),(a=this._viewport)==null||a.queueSync()})),this._register(this._instantiationService.createInstance(Ny,this.screenElement)),this._register(Ue(this.element,"mousedown",a=>this._selectionService.handleMouseDown(a))),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(op,this)),this._register(this.optionsService.onSpecificOptionChange("screenReaderMode",a=>this._handleScreenReaderModeOptionChange(a))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(np,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRuler",a=>{!this._overviewRulerRenderer&&a&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(np,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(Oy,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let e=this,t=this.element;function n(a){var d,m,g,_,b;let l=e._mouseService.getMouseReportCoords(a,e.screenElement);if(!l)return!1;let u,h;switch(a.overrideType||a.type){case"mousemove":h=32,a.buttons===void 0?(u=3,a.button!==void 0&&(u=a.button<3?a.button:3)):u=a.buttons&1?0:a.buttons&4?1:a.buttons&2?2:3;break;case"mouseup":h=0,u=a.button<3?a.button:3;break;case"mousedown":h=1,u=a.button<3?a.button:3;break;case"wheel":if(e._customWheelEventHandler&&e._customWheelEventHandler(a)===!1)return!1;let w=a.deltaY;if(w===0||e.coreMouseService.consumeWheelEvent(a,(_=(g=(m=(d=e._renderService)==null?void 0:d.dimensions)==null?void 0:m.device)==null?void 0:g.cell)==null?void 0:_.height,(b=e._coreBrowserService)==null?void 0:b.dpr)===0)return!1;h=w<0?0:1,u=4;break;default:return!1}return h===void 0||u===void 0||u>4?!1:e.coreMouseService.triggerMouseEvent({col:l.col,row:l.row,x:l.x,y:l.y,button:u,action:h,ctrl:a.ctrlKey,alt:a.altKey,shift:a.shiftKey})}let r={mouseup:null,wheel:null,mousedrag:null,mousemove:null},s={mouseup:a=>(n(a),a.buttons||(this._document.removeEventListener("mouseup",r.mouseup),r.mousedrag&&this._document.removeEventListener("mousemove",r.mousedrag)),this.cancel(a)),wheel:a=>(n(a),this.cancel(a,!0)),mousedrag:a=>{a.buttons&&n(a)},mousemove:a=>{a.buttons||n(a)}};this._register(this.coreMouseService.onProtocolChange(a=>{a?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(a)),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()),a&8?r.mousemove||(t.addEventListener("mousemove",s.mousemove),r.mousemove=s.mousemove):(t.removeEventListener("mousemove",r.mousemove),r.mousemove=null),a&16?r.wheel||(t.addEventListener("wheel",s.wheel,{passive:!1}),r.wheel=s.wheel):(t.removeEventListener("wheel",r.wheel),r.wheel=null),a&2?r.mouseup||(r.mouseup=s.mouseup):(this._document.removeEventListener("mouseup",r.mouseup),r.mouseup=null),a&4?r.mousedrag||(r.mousedrag=s.mousedrag):(this._document.removeEventListener("mousemove",r.mousedrag),r.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register(Ue(t,"mousedown",a=>{if(a.preventDefault(),this.focus(),!(!this.coreMouseService.areMouseEventsActive||this._selectionService.shouldForceSelection(a)))return n(a),r.mouseup&&this._document.addEventListener("mouseup",r.mouseup),r.mousedrag&&this._document.addEventListener("mousemove",r.mousedrag),this.cancel(a)})),this._register(Ue(t,"wheel",a=>{var l,u,h,d,m;if(!r.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(a)===!1)return!1;if(!this.buffer.hasScrollback){if(a.deltaY===0)return!1;if(e.coreMouseService.consumeWheelEvent(a,(d=(h=(u=(l=e._renderService)==null?void 0:l.dimensions)==null?void 0:u.device)==null?void 0:h.cell)==null?void 0:d.height,(m=e._coreBrowserService)==null?void 0:m.dpr)===0)return this.cancel(a,!0);let g=ge.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(a.deltaY<0?"A":"B");return this.coreService.triggerDataEvent(g,!0),this.cancel(a,!0)}}},{passive:!1}))}refresh(e,t){var n;(n=this._renderService)==null||n.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){N5(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,n){this._selectionService.setSelection(e,t,n)}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 n;(n=this._selectionService)==null||n.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 n=SJ(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),n.type===3||n.type===2){let r=this.rows-1;return this.scrollLines(n.type===2?-r:r),this.cancel(e,!0)}if(n.type===1&&this.selectAll(),this._isThirdLevelShift(this.browser,e)||(n.cancel&&this.cancel(e,!0),!n.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((n.key===ge.ETX||n.key===ge.CR)&&(this.textarea.value=""),this._onKey.fire({key:n.key,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(n.key,!0),!this.optionsService.rawOptions.screenReaderMode||e.altKey||e.ctrlKey)return this.cancel(e,!0);this._keyDownHandled=!0}_isThirdLevelShift(e,t){let n=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"?n:n&&(!t.keyCode||t.keyCode>47)}_keyUp(e){this._keyDownSeen=!1,!(this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)&&(AJ(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 n;(n=this._charSizeService)==null||n.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(an));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(ge.ESC+"[I"):this.coreService.triggerDataEvent(ge.ESC+"[O")}_reportWindowsOptions(e){if(this._renderService)switch(e){case 0:let t=this._renderService.dimensions.css.canvas.width.toFixed(0),n=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${ge.ESC}[4;${n};${t}t`);break;case 1:let r=this._renderService.dimensions.css.cell.width.toFixed(0),s=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${ge.ESC}[6;${s};${r}t`);break}}cancel(e,t){if(!(!this.options.cancelEvents&&!t))return e.preventDefault(),e.stopPropagation(),!1}};function AJ(e){return e.keyCode===16||e.keyCode===17||e.keyCode===18}var DJ=class{constructor(){this._addons=[]}dispose(){for(let e=this._addons.length-1;e>=0;e--)this._addons[e].instance.dispose()}loadAddon(e,t){let n={instance:t,dispose:t.dispose,isDisposed:!1};this._addons.push(n),t.dispose=()=>this._wrappedAddonDispose(n),t.activate(e)}_wrappedAddonDispose(e){if(e.isDisposed)return;let t=-1;for(let n=0;n<this._addons.length;n++)if(this._addons[n]===e){t=n;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)}},OJ=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 Qr)}translateToString(e,t,n){return this._line.translateToString(e,t,n)}},zE=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 OJ(t)}getNullCell(){return new Qr}},jJ=class extends Je{constructor(e){super(),this._core=e,this._onBufferChange=this._register(new ke),this.onBufferChange=this._onBufferChange.event,this._normal=new zE(this._core.buffers.normal,"normal"),this._alternate=new zE(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)}},LJ=class{constructor(e){this._core=e}registerCsiHandler(e,t){return this._core.registerCsiHandler(e,n=>t(n.toArray()))}addCsiHandler(e,t){return this.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._core.registerDcsHandler(e,(n,r)=>t(n,r.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)}},zJ=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}},PJ=["cols","rows"],wi=0,BJ=class extends Je{constructor(e){super(),this._core=this._register(new NJ(e)),this._addonManager=this._register(new DJ),this._publicOptions={...this._core.options};let t=r=>this._core.options[r],n=(r,s)=>{this._checkReadonlyOptions(r),this._core.options[r]=s};for(let r in this._core.options){let s={get:t.bind(this,r),set:n.bind(this,r)};Object.defineProperty(this._publicOptions,r,s)}}_checkReadonlyOptions(e){if(PJ.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 LJ(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new zJ(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 jJ(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,n){this._verifyIntegers(e,t,n),this._core.select(e,t,n)}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
|
|
606
|
-
`,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 uy.get()},set promptLabel(e){uy.set(e)},get tooMuchOutput(){return dy.get()},set tooMuchOutput(e){dy.set(e)}}}_verifyIntegers(...e){for(wi of e)if(wi===1/0||isNaN(wi)||wi%1!==0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...e){for(wi of e)if(wi&&(wi===1/0||isNaN(wi)||wi%1!==0||wi<0))throw new Error("This API only accepts positive integers")}};const yD="lever-theme",bD=y.createContext(void 0),IJ=e=>e==="light"||e==="dark"||e==="system",xD=()=>typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",PE=e=>{if(typeof document>"u")return;const t=e==="system"?xD():e;document.documentElement.classList.toggle("dark",t==="dark")},HJ=()=>{if(typeof window>"u")return"system";const e=window.localStorage.getItem(yD);return IJ(e)?e:"system"};function FJ({children:e}){const[t,n]=y.useState(HJ);y.useEffect(()=>{PE(t),typeof window<"u"&&window.localStorage.setItem(yD,t)},[t]),y.useEffect(()=>{if(t!=="system")return;const s=window.matchMedia("(prefers-color-scheme: dark)"),a=()=>PE("system");return s.addEventListener?(s.addEventListener("change",a),()=>s.removeEventListener("change",a)):(s.addListener(a),()=>s.removeListener(a))},[t]);const r=y.useMemo(()=>{const s=t==="system"?xD():t;return{theme:t,resolvedTheme:s,setTheme:n}},[t]);return p.jsx(bD.Provider,{value:r,children:e})}function wD(){const e=y.useContext(bD);if(!e)throw new Error("useTheme must be used within ThemeProvider");return e}const UJ={foreground:"#0f172a",background:"transparent",cursor:"#000000",cursorAccent:"#ffffff",selectionBackground:"rgba(221,228,236,0.55)",selectionInactiveBackground:"rgba(221,228,236,0.38)",black:"#0f172a",red:"#dc2626",green:"#16a34a",yellow:"#ca8a04",blue:"#2563eb",magenta:"#9333ea",cyan:"#0891b2",white:"#94a3b8",brightBlack:"#475569",brightRed:"#ef4444",brightGreen:"#22c55e",brightYellow:"#eab308",brightBlue:"#3b82f6",brightMagenta:"#a855f7",brightCyan:"#06b6d4",brightWhite:"#e2e8f0"},$J={foreground:"#f8fafc",background:"transparent",cursor:"#ffffff",cursorAccent:"#000000",selectionBackground:"rgba(248,250,252,0.28)",selectionInactiveBackground:"rgba(248,250,252,0.18)",black:"#0f172a",red:"#f87171",green:"#4ade80",yellow:"#facc15",blue:"#60a5fa",magenta:"#c084fc",cyan:"#22d3ee",white:"#cbd5e1",brightBlack:"#64748b",brightRed:"#fca5a5",brightGreen:"#86efac",brightYellow:"#fde047",brightBlue:"#93c5fd",brightMagenta:"#d8b4fe",brightCyan:"#67e8f9",brightWhite:"#f8fafc"};function SD(e){return{cols:Math.max(1,e.cols||80),rows:Math.max(1,e.rows||24)}}function CD(e,t){var w,S,C,k,R;const n=e.element,r=(k=(C=(S=(w=e._core)==null?void 0:w._renderService)==null?void 0:S.dimensions)==null?void 0:C.css)==null?void 0:k.cell,s=(r==null?void 0:r.width)??0,a=(r==null?void 0:r.height)??0;if(!n||!Number.isFinite(s)||!Number.isFinite(a)||s<=0||a<=0)return null;const l=t.getBoundingClientRect(),u=window.getComputedStyle(t),h=window.getComputedStyle(n),d=e.options.scrollback===0?0:((R=e.options.overviewRuler)==null?void 0:R.width)??14,m=parseFloat(u.paddingLeft)+parseFloat(u.paddingRight)+parseFloat(h.paddingLeft)+parseFloat(h.paddingRight),g=parseFloat(u.paddingTop)+parseFloat(u.paddingBottom)+parseFloat(h.paddingTop)+parseFloat(h.paddingBottom),_=Math.max(0,l.width-m-d-1),b=Math.max(0,l.height-g);return{cols:Math.max(2,Math.floor(_/s)),rows:Math.max(1,Math.floor(b/a))}}function tf(e){e.refresh(0,Math.max(0,e.rows-1))}function nf(e,t,n,r,s){const a=CD(e,t)??SD(e);return n.current&&n.current.cols===a.cols&&n.current.rows===a.rows||(e.resize(a.cols,a.rows),n.current=a,r&&s(a.cols,a.rows)),a}function WJ({projectId:e,terminalId:t,socket:n,scrollback:r,connectionStatus:s,clearVersion:a=0,focusRequestVersion:l=0,onPathChange:u}){const{resolvedTheme:h}=wD(),d=y.useRef(null),m=y.useRef(null),g=y.useRef(null),_=y.useRef(!1),b=y.useRef(0),w=y.useRef(null),S=y.useRef(null),[C,k]=y.useState(null),[R,T]=y.useState(null),N=h==="dark"?$J:UJ,L=(O,F)=>{n.command({type:"terminal.resize",terminalId:t,cols:O,rows:F}).catch(()=>{})},A=()=>{const O=()=>{const F=m.current,G=d.current;!F||!G||!_.current||nf(F,G,S,!0,L)};requestAnimationFrame(()=>{O(),setTimeout(O,0)})};return y.useEffect(()=>{const O=new BJ({scrollback:r,cursorBlink:!0,cursorStyle:"bar",cursorWidth:1,lineHeight:1.1,convertEol:!1,allowTransparency:!0,fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace",fontSize:13,theme:N}),F=new wX;O.loadAddon(F),O.loadAddon(new MX),m.current=O;const G=d.current;G&&(O.open(G),g.current&&O.write(g.current),nf(O,G,S,!1,()=>{}),tf(O),A());const B=O.onData(U=>{n.command({type:"terminal.input",terminalId:t,data:U}).catch(V=>{T(V instanceof Error?V.message:String(V))})}),H=O.onResize(({cols:U,rows:V})=>{if(!_.current)return;const W={cols:U,rows:V};S.current&&S.current.cols===U&&S.current.rows===V||(S.current=W,L(U,V))}),P=new ResizeObserver(()=>{const U=m.current,V=d.current;!U||!V||nf(U,V,S,_.current,(W,z)=>{n.command({type:"terminal.resize",terminalId:t,cols:W,rows:z}).catch(()=>{})})});return G&&P.observe(G),()=>{P.disconnect(),H.dispose(),B.dispose(),g.current=F.serialize(),O.dispose(),m.current=null}},[r,n,t,N]),y.useEffect(()=>{const O=m.current;O&&(O.options.scrollback=r)},[r]),y.useEffect(()=>{const O=m.current;O&&(O.options.theme=N,tf(O))},[N]),y.useEffect(()=>{if(l===0)return;const O=m.current;O&&requestAnimationFrame(()=>{O.focus()})},[l]),y.useEffect(()=>{if(a===0)return;const O=m.current;O&&(_.current=!1,b.current+=1,w.current=null,g.current=null,k(null),T(null),O.reset(),tf(O),n.command({type:"terminal.close",terminalId:t}).catch(F=>{T(F instanceof Error?F.message:String(F))}))},[a,n,t]),y.useEffect(()=>{u==null||u((C==null?void 0:C.cwd)??null)},[C==null?void 0:C.cwd,u]),y.useEffect(()=>{const O=B=>{const H=m.current;if(!H)return;const P=JSON.stringify({cwd:B.cwd,shell:B.shell,cols:B.cols,rows:B.rows,scrollback:B.scrollback,status:B.status,exitCode:B.exitCode,serializedState:B.serializedState});if(w.current===P){k({cwd:B.cwd,shell:B.shell,status:B.status,exitCode:B.exitCode}),g.current=B.serializedState||null;return}w.current=P,k({cwd:B.cwd,shell:B.shell,status:B.status,exitCode:B.exitCode}),g.current=B.serializedState||null,H.options.scrollback=B.scrollback,H.reset(),B.serializedState&&H.write(B.serializedState),tf(H)},F=()=>{const B=m.current,H=d.current;if(!B||!H)return;const P=CD(B,H)??SD(B);B.resize(P.cols,P.rows),S.current=P,n.command({type:"terminal.create",projectId:e,terminalId:t,cols:P.cols,rows:P.rows,scrollback:r}).then(U=>{_.current=!0,T(null),U&&O(U),A()}).catch(U=>{T(U instanceof Error?U.message:String(U))})},G=()=>{const B=++b.current,H=()=>{if(b.current!==B)return;const P=m.current,U=d.current;if(!P||!U)return;nf(P,U,S,!1,()=>{});const V=U.getBoundingClientRect();if(V.width<=0||V.height<=0){requestAnimationFrame(H);return}F()};requestAnimationFrame(()=>{requestAnimationFrame(H)})};return G(),n.subscribeTerminal(t,{onSnapshot:B=>{if(!B){_.current=!1,w.current=null,s==="connected"&&G();return}_.current=!0,T(null),O(B),A()},onEvent:B=>{const H=m.current;if(H){if(B.type==="terminal.output"){H.write(B.data);return}B.type==="terminal.exit"&&k(P=>({cwd:(P==null?void 0:P.cwd)??"",shell:(P==null?void 0:P.shell)??"",status:"exited",exitCode:B.exitCode}))}}})},[s,e,r,n,t]),p.jsxs("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden pb-4",children:[p.jsx("div",{className:"flex min-h-0 min-w-0 flex-1 overflow-hidden px-3 py-1",children:p.jsx("div",{ref:d,className:"kanna-terminal min-h-0 min-w-0 flex-1 overflow-hidden w-full"})}),R?p.jsxs("div",{className:"px-3 py-1 text-xs text-destructive",children:["Terminal error: ",R]}):null]})}const VJ=24;function kD(e){return e+VJ}function qJ(e,t){return Math.max(1,e)*kD(t)}function BE({projectId:e,layout:t,socket:n,connectionStatus:r,scrollback:s,minColumnWidth:a,focusRequestVersion:l=0,splitTerminalShortcut:u,onAddTerminal:h,onRemoveTerminal:d,onTerminalLayout:m}){const g=y.useRef(null),_=y.useRef({}),b=y.useRef([]),[w,S]=y.useState(0),[C,k]=y.useState({}),[R,T]=y.useState({});y.useLayoutEffect(()=>{const G=g.current;if(!G)return;const B=()=>{S(G.getBoundingClientRect().width)},H=new ResizeObserver(B);return H.observe(G),B(),()=>H.disconnect()},[]);const N=t.terminals.length,L=kD(a),A=qJ(N,a),O=Math.max(w,A),F=y.useMemo(()=>t.terminals.map(G=>G.id).join(":"),[t.terminals]);return y.useLayoutEffect(()=>{const G=b.current,B=t.terminals.map(U=>U.id),H=B.find(U=>!G.includes(U));if(b.current=B,!H||G.length===0)return;const P=_.current[H];P&&P.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})},[t.terminals]),p.jsx("div",{className:"flex h-full min-h-0 flex-col",children:p.jsx("div",{ref:g,className:"min-h-0 flex-1 overflow-x-auto overflow-y-hidden",children:p.jsx("div",{className:"h-full min-h-0",style:{width:O||"100%"},children:p.jsx(yf,{orientation:"horizontal",className:"h-full min-h-0",onLayoutChanged:G=>m(e,t.terminals.map(B=>G[B.id]??B.size)),children:t.terminals.map((G,B)=>p.jsxs(y.Fragment,{children:[p.jsx($o,{id:G.id,defaultSize:`${G.size}%`,minSize:`${L}px`,className:"min-h-0 overflow-hidden",style:{minWidth:L},children:p.jsxs("div",{ref:H=>{_.current[G.id]=H},className:"flex h-full min-h-0 min-w-0 flex-col border-r border-border bg-transparent last:border-r-0",style:{minWidth:L},children:[p.jsxs("div",{className:"flex items-center gap-2 px-3 pr-2 pt-2 pb-1",children:[p.jsx("div",{className:"min-w-0 flex-1 text-left",children:p.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[p.jsx("div",{className:"shrink-0 text-sm font-medium",children:"Terminal"}),p.jsx("div",{className:"min-w-0 truncate text-xs text-muted-foreground",children:C[G.id]??""})]})}),p.jsxs("div",{className:"flex items-center gap-1",children:[p.jsx(tt,{variant:"ghost",size:"icon-sm","aria-label":"Clear terminal",onClick:()=>T(H=>({...H,[G.id]:(H[G.id]??0)+1})),children:p.jsx(zP,{className:"size-3.5"})}),p.jsxs(iu,{children:[p.jsx(su,{asChild:!0,children:p.jsx(tt,{variant:"ghost",size:"icon-sm","aria-label":"Add terminal to the right",onClick:()=>h(e,G.id),children:p.jsx(Rb,{className:"size-3.5"})})}),p.jsx(ml,{side:"bottom",shortcut:u})]}),p.jsx(tt,{variant:"ghost",size:"icon-sm","aria-label":"Archive terminal",onClick:()=>d(e,G.id),children:p.jsx(ca,{className:"size-3.5"})})]})]}),p.jsx(WJ,{projectId:e,terminalId:G.id,socket:n,scrollback:s,connectionStatus:r,clearVersion:R[G.id]??0,focusRequestVersion:B===0?l:0,onPathChange:H=>k(P=>P[G.id]===H?P:{...P,[G.id]:H})})]})}),B<t.terminals.length-1?p.jsx(bf,{withHandle:!0,orientation:"horizontal"}):null]},G.id))},F)})})})}const KJ={connecting:"Connecting...",acquiring_sandbox:"Booting...",initializing:"Initializing...",starting:"Starting...",running:"Running...",waiting_for_user:"Waiting...",failed:"Failed"};function GJ({status:e}){const t=(e?KJ[e]:void 0)||"Processing...",n=e==="failed";return p.jsx(vo,{className:"ml-[1px]",children:p.jsxs(pY,{children:[n?p.jsx(ca,{className:"size-4.5 text-red-500"}):p.jsx(ji,{className:"size-4.5 animate-spin text-muted-icon"}),p.jsx(Np,{className:"ml-[1px] text-sm",shimmerWidth:44,children:t})]})})}const Gp=20,Ky=50,ED=30;function RD(e){return Number.isFinite(e)?Math.min(Ky,Math.max(Gp,e)):ED}function YJ(){return{isVisible:!1,size:Gp}}function g_(e,t){return e[t]??YJ()}function XJ(e){return!e||typeof e!="object"?{projects:{}}:{projects:Object.fromEntries(Object.entries(e.projects??{}).map(([r,s])=>[r,{isVisible:!1,size:RD(s.size??ED)}]))}}const Mf=ua()(da(e=>({projects:{},toggleVisibility:t=>e(n=>({projects:{...n.projects,[t]:{...g_(n.projects,t),isVisible:!g_(n.projects,t).isVisible}}})),setSize:(t,n)=>e(r=>({projects:{...r.projects,[t]:{...g_(r.projects,t),size:RD(n)}}})),clearProject:t=>e(n=>{const{[t]:r,...s}=n.projects;return{projects:s}})}),{name:"right-sidebar-layouts",version:2,migrate:XJ})),ZJ={isVisible:!1,size:Gp},sx=[68,32];function QJ(){return{isVisible:!1,mainSizes:[...sx],terminals:[],nextTerminalIndex:0}}function JJ(e,t){return e[t]??QJ()}function v_(e){if(e.length===0)return[];const t=e.reduce((n,r)=>n+Math.max(r,0),0);return!Number.isFinite(t)||t<=0?Array.from({length:e.length},()=>100/e.length):e.map(n=>Math.max(n,0)/t*100)}function eee(e){let t=e,n="";do n=String.fromCharCode(65+t%26)+n,t=Math.floor(t/26)-1;while(t>=0);return`Terminal ${n}`}function tee(e){if(e.length===0)return e;const t=e.length+1;return e.map(n=>({...n,size:n.size*e.length/t}))}function dl(e,t,n){return{...e,[t]:n(JJ(e,t))}}const Js=ua()(da(e=>({projects:{},addTerminal:(t,n)=>e(r=>({projects:dl(r.projects,t,s=>{var h,d;const a=tee(s.terminals),l={id:((d=(h=globalThis.crypto)==null?void 0:h.randomUUID)==null?void 0:d.call(h))??`terminal-${Date.now()}-${s.nextTerminalIndex}`,title:eee(s.nextTerminalIndex),size:100/(a.length+1)},u=n?Math.max(a.findIndex(m=>m.id===n)+1,0):a.length;return{...s,isVisible:!0,nextTerminalIndex:s.nextTerminalIndex+1,terminals:[...a.slice(0,u),l,...a.slice(u)]}})})),removeTerminal:(t,n)=>e(r=>({projects:dl(r.projects,t,s=>{const a=s.terminals.filter(u=>u.id!==n);if(a.length===0)return{...s,isVisible:!1,terminals:[]};const l=v_(a.map(u=>u.size));return{...s,terminals:a.map((u,h)=>({...u,size:l[h]??100/a.length}))}})})),toggleVisibility:t=>e(n=>({projects:dl(n.projects,t,r=>({...r,isVisible:r.terminals.length>0?!r.isVisible:!1}))})),resetMainSizes:t=>e(n=>({projects:dl(n.projects,t,r=>({...r,mainSizes:[...sx]}))})),setMainSizes:(t,n)=>e(r=>{if(n.length!==2)return r;const s=v_(n);return{projects:dl(r.projects,t,a=>({...a,mainSizes:s}))}}),setTerminalSizes:(t,n)=>e(r=>({projects:dl(r.projects,t,s=>{if(n.length!==s.terminals.length)return s;const a=v_(n);return{...s,terminals:s.terminals.map((l,u)=>({...l,size:a[u]??l.size}))}})})),clearProject:t=>e(n=>{const{[t]:r,...s}=n.projects;return{projects:s}})}),{name:"terminal-layouts",version:1})),nee={isVisible:!1,mainSizes:[...sx],terminals:[],nextTerminalIndex:0},ap=1e3,Gy=500,Yy=5e3,lp=450,Xy=250,Zy=900,Qy="cursor";function Jy(e){switch(e){case"vscode":return"code {path}";case"windsurf":return"windsurf {path}";case"custom":return"cursor {path}";case"cursor":default:return"cursor {path}"}}function ree(e){switch(e){case"vscode":return"VS Code";case"windsurf":return"Windsurf";case"custom":return"Custom";case"cursor":default:return"Cursor"}}function IE(e){return Number.isFinite(e)?Math.min(Yy,Math.max(Gy,Math.round(e))):ap}function HE(e){return Number.isFinite(e)?Math.min(Zy,Math.max(Xy,Math.round(e))):lp}function FE(e){switch(e){case"vscode":case"windsurf":case"custom":case"cursor":return e;default:return Qy}}function __(e,t){const n=e==null?void 0:e.trim();return n&&n.length>0?n:Jy(t)}const Kr=ua()(da(e=>({scrollbackLines:ap,minColumnWidth:lp,editorPreset:Qy,editorCommandTemplate:Jy(Qy),setScrollbackLines:t=>e({scrollbackLines:IE(t)}),setMinColumnWidth:t=>e({minColumnWidth:HE(t)}),setEditorPreset:t=>e(n=>{const r=FE(t);return{editorPreset:r,editorCommandTemplate:r==="custom"?__(n.editorCommandTemplate,r):Jy(r)}}),setEditorCommandTemplate:t=>e(n=>({editorCommandTemplate:__(t,n.editorPreset)}))}),{name:"terminal-preferences",version:3,migrate:e=>{const t=e,n=FE(t==null?void 0:t.editorPreset);return{scrollbackLines:IE((t==null?void 0:t.scrollbackLines)??ap),minColumnWidth:HE((t==null?void 0:t.minColumnWidth)??lp),editorPreset:n,editorCommandTemplate:__(t==null?void 0:t.editorCommandTemplate,n)}}})),iee=35;function see(e,t){return!Number.isFinite(e)||e<=0||!Number.isFinite(t)||t<=0?0:e*(t/100)}function oee(e,t){const n=see(e,t);return n>=0&&n<iee}const yl=350,aee=[.4,0,.2,1],lee=8,UE=1e-6;function cee(e,t,n){const r=1-e;return 3*r*r*e*t+3*r*e*e*n+e*e*e}function uee(e,t,n){const r=1-e;return 3*r*r*e*t+3*r*e*e*n+e*e*e}function dee(e,t,n){const r=1-e;return 3*r*r*t+6*r*e*(n-t)+3*e*e*(1-n)}function hee(e,t,n){let r=e;for(let s=0;s<lee;s+=1){const a=cee(r,t,n)-e;if(Math.abs(a)<UE)return r;const l=dee(r,t,n);if(Math.abs(l)<UE)break;r-=a/l}return r}function fee(e){if(e<=0)return 0;if(e>=1)return 1;const[t,n,r,s]=aee,a=hee(e,t,r);return uee(a,n,s)}function TD(e,t,n){const r=fee(n);return[e[0]+(t[0]-e[0])*r,e[1]+(t[1]-e[1])*r]}function pee({projectId:e,shouldRenderRightSidebarLayout:t,showRightSidebar:n,rightSidebarSize:r}){const s=y.useRef(null),a=y.useRef(null),l=y.useRef(null),u=y.useRef(null),h=y.useRef(null),d=y.useRef(!1),m=y.useRef(null),g=y.useRef(!1),_=y.useRef(!1);return y.useEffect(()=>()=>{u.current!==null&&window.cancelAnimationFrame(u.current),h.current!==null&&window.clearTimeout(h.current)},[]),y.useLayoutEffect(()=>{var O,F,G,B,H,P;if(!t){u.current!==null&&(window.cancelAnimationFrame(u.current),u.current=null),h.current!==null&&(window.clearTimeout(h.current),h.current=null),d.current=!1;return}const b=s.current;if(!b)return;u.current!==null&&(window.cancelAnimationFrame(u.current),u.current=null),h.current!==null&&(window.clearTimeout(h.current),h.current=null);const w=m.current,S=w!==null&&w!==e,C=n&&!_.current,k=!g.current,R=n?[100-r,r]:[100,0],T=S||k&&n,N=C||k?[100,0]:[b.getLayout().workspace??R[0],b.getLayout().rightSidebar??R[1]];if(m.current=e,g.current=t,_.current=n,T||Math.abs(N[0]-R[0])<.1&&Math.abs(N[1]-R[1])<.1){b.setLayout({workspace:R[0],rightSidebar:R[1]}),(O=a.current)==null||O.setAttribute("data-right-sidebar-open",n?"true":"false"),(F=l.current)==null||F.setAttribute("data-right-sidebar-open",n?"true":"false"),(G=l.current)==null||G.setAttribute("data-right-sidebar-animated","false");return}d.current=!0,(B=a.current)==null||B.setAttribute("data-right-sidebar-open",n?"true":"false"),(H=l.current)==null||H.setAttribute("data-right-sidebar-open",n?"true":"false"),(P=l.current)==null||P.setAttribute("data-right-sidebar-animated","true"),b.setLayout({workspace:N[0],rightSidebar:N[1]});const L=performance.now(),A=U=>{const V=Math.min(1,(U-L)/yl),W=TD(N,R,V);if(b.setLayout({workspace:W[0],rightSidebar:W[1]}),V<1){u.current=window.requestAnimationFrame(A);return}b.setLayout({workspace:R[0],rightSidebar:R[1]}),u.current=null,h.current=window.setTimeout(()=>{d.current=!1,h.current=null},0)};u.current=window.requestAnimationFrame(A)},[e,r,t,n]),y.useEffect(()=>{t||(g.current=!1,_.current=!1)},[t]),{isAnimating:d,panelGroupRef:s,sidebarPanelRef:a,sidebarVisualRef:l}}function mee(e){const t=e.previousProjectId!==null&&e.previousProjectId!==e.projectId,n=e.previousProjectId===null&&e.projectId!==null;return!t&&!n&&e.showTerminalPane&&!e.wasTerminalVisible}function gee({previousProjectId:e,projectId:t,previousShouldRenderTerminalLayout:n,previousShowTerminalPane:r,showTerminalPane:s,terminalLayout:a,liveLayout:l}){const u=e!==null&&e!==t,h=s&&!r,d=!n,m=e===null&&t!==null,g=s?a.mainSizes:[100,0];return{currentLayout:h||d?[100,0]:l,shouldSkipAnimation:u||m&&d,targetLayout:g}}function vee({chatInputRef:e,projectId:t,shouldRenderTerminalLayout:n,showTerminalPane:r,terminalLayout:s}){const a=y.useRef(null),l=y.useRef(null),u=y.useRef(null),h=y.useRef(null),d=y.useRef(null),m=y.useRef(!1),g=y.useRef(null),_=y.useRef(!1),b=y.useRef(!1),w=y.useRef(!1),[S,C]=y.useState(0);return y.useEffect(()=>{var T;const k=g.current,R=w.current;mee({previousProjectId:k,projectId:t,showTerminalPane:r,wasTerminalVisible:R})&&C(N=>N+1),k!==null&&k===t&&!r&&R&&((T=e.current)==null||T.focus({preventScroll:!0})),w.current=r,g.current=t},[e,t,r]),y.useEffect(()=>()=>{h.current!==null&&window.cancelAnimationFrame(h.current),d.current!==null&&window.clearTimeout(d.current)},[]),y.useLayoutEffect(()=>{var F,G,B,H,P,U;if(!n){h.current!==null&&(window.cancelAnimationFrame(h.current),h.current=null),d.current!==null&&(window.clearTimeout(d.current),d.current=null),m.current=!1;return}const k=a.current;if(!k)return;h.current!==null&&(window.cancelAnimationFrame(h.current),h.current=null),d.current!==null&&(window.clearTimeout(d.current),d.current=null);const R=g.current,{currentLayout:T,shouldSkipAnimation:N,targetLayout:L}=gee({previousProjectId:R,projectId:t,previousShouldRenderTerminalLayout:_.current,previousShowTerminalPane:b.current,showTerminalPane:r,terminalLayout:s,liveLayout:[k.getLayout().chat??s.mainSizes[0],k.getLayout().terminal??s.mainSizes[1]]});if(_.current=n,b.current=r,N||Math.abs(T[0]-L[0])<.1&&Math.abs(T[1]-L[1])<.1){k.setLayout({chat:L[0],terminal:L[1]}),(F=l.current)==null||F.setAttribute("data-terminal-open",r?"true":"false"),(G=u.current)==null||G.setAttribute("data-terminal-open",r?"true":"false"),(B=u.current)==null||B.setAttribute("data-terminal-animated","false");return}m.current=!0,(H=l.current)==null||H.setAttribute("data-terminal-open",r?"true":"false"),(P=u.current)==null||P.setAttribute("data-terminal-open",r?"true":"false"),(U=u.current)==null||U.setAttribute("data-terminal-animated","true"),k.setLayout({chat:T[0],terminal:T[1]});const A=performance.now(),O=V=>{const W=Math.min(1,(V-A)/yl),z=TD(T,L,W);if(k.setLayout({chat:z[0],terminal:z[1]}),W<1){h.current=window.requestAnimationFrame(O);return}k.setLayout({chat:L[0],terminal:L[1]}),h.current=null,d.current=window.setTimeout(()=>{m.current=!1,d.current=null},0)};h.current=window.requestAnimationFrame(O)},[t,n,r,s.mainSizes]),y.useEffect(()=>{n||(_.current=!1,b.current=!1)},[n]),{isAnimating:m,mainPanelGroupRef:a,terminalFocusRequestVersion:S,terminalPanelRef:l,terminalVisualRef:u}}function _ee({content:e,attachments:t=[]}){const[n,r]=y.useState(null),s=y.useMemo(()=>t.filter(h=>h.kind==="image"&&h.contentUrl),[t]),a=y.useMemo(()=>t.filter(h=>h.kind!=="image"||!h.contentUrl),[t]),l=t.find(h=>h.id===n)??null;function u(h){if(y0(h).openInNewTab){typeof window<"u"&&window.open(new URL(h.contentUrl,window.location.origin).toString(),"_blank","noopener,noreferrer");return}r(h.id)}return p.jsxs(p.Fragment,{children:[p.jsxs("div",{className:"flex flex-col items-end gap-2",children:[s.length>0?p.jsx("div",{className:"flex max-w-[85%] sm:max-w-[80%] flex-wrap justify-end gap-3",children:s.map(h=>p.jsx(qN,{attachment:h,onClick:()=>u(h)},h.id))}):null,a.length>0?p.jsx("div",{className:"flex max-w-[85%] sm:max-w-[80%] flex-wrap justify-end gap-2",children:a.map(h=>p.jsx(KN,{attachment:h,onClick:()=>u(h)},h.id))}):null,e?p.jsx("div",{className:"max-w-[85%] sm:max-w-[80%] rounded-[20px] py-1.5 px-3.5 bg-muted text-primary border border-border prose prose-sm prose-invert [&_p]:whitespace-pre-line",children:p.jsx(Kl,{remarkPlugins:[Gl],components:dd(),children:e})}):null]}),p.jsx(r5,{attachment:l,onOpenChange:h=>!h&&r(null)})]})}function yee({json:e}){return p.jsx("div",{className:"flex gap-3 justify-start",children:p.jsx("div",{className:"flex-1 max-w-[90%]",children:p.jsx("pre",{className:"text-xs font-mono whitespace-pre-wrap break-words bg-muted rounded-lg p-3 overflow-auto max-h-96",children:e})})})}function MD({title:e,count:t,children:n,badge:r}){const[s,a]=y.useState(!1);return t===0?null:p.jsxs("div",{className:"flex flex-col gap-1.5",children:[p.jsxs("button",{onClick:()=>a(!s),className:"flex items-center gap-1 cursor-pointer group/section hover:opacity-60 transition-opacity",children:[p.jsx(fs,{className:ye("h-3.5 w-3.5 text-muted-foreground transition-transform duration-200",s&&"rotate-90")}),p.jsx("span",{className:"text-muted-foreground font-medium",children:e}),p.jsx("span",{className:"text-muted-foreground/60",children:t}),r]}),s&&p.jsx("div",{className:"ml-5",children:n})]})}function y_({title:e,items:t,icon:n,getIcon:r}){return t.length===0?null:p.jsx(MD,{title:e,count:t.length,children:p.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.map(s=>p.jsx(n5,{icon:r?r(s):n,children:s},s))})})}function bee(e){const t=e.match(/^mcp__([^_]+)__(.+)$/);return t?{server:t[1],tool:t[2]}:null}function ND({status:e}){const t=e==="connected"?"bg-emerald-500":e==="pending"?"bg-yellow-500":"bg-red-500";return p.jsx("span",{className:ye("inline-block h-2 w-2 rounded-full shrink-0",t)})}function xee(e){switch(e){case"connected":return"Connected";case"failed":return"Failed";case"needs-auth":return"Needs auth";case"pending":return"Connecting...";case"disabled":return"Disabled";default:return e}}function $E({server:e}){const[t,n]=y.useState(!1),r=e.status==="connected";return p.jsxs("div",{className:"flex flex-col gap-1.5",children:[p.jsxs("button",{onClick:()=>r&&e.tools.length>0&&n(!t),className:ye("flex items-center gap-1.5",r&&e.tools.length>0&&"cursor-pointer hover:opacity-60 transition-opacity"),children:[r&&e.tools.length>0&&p.jsx(fs,{className:ye("h-3 w-3 text-muted-foreground transition-transform duration-200",t&&"rotate-90")}),p.jsx(ND,{status:e.status}),p.jsx("span",{className:"text-muted-foreground font-medium",children:I_(e.name)}),r?p.jsxs("span",{className:"text-muted-foreground/50",children:[e.tools.length," tools"]}):p.jsx("span",{className:"text-muted-foreground/50",children:xee(e.status)})]}),!r&&e.error&&p.jsx("span",{className:"text-destructive ml-5",children:e.error}),t&&e.tools.length>0&&p.jsx("div",{className:"flex flex-wrap gap-1.5 ml-5",children:e.tools.map(s=>p.jsx(n5,{icon:t5(`mcp__${e.name}__${s}`),children:s},s))})]})}function wee({servers:e}){if(e.length===0)return null;const t=e.filter(s=>s.status==="connected"),n=e.filter(s=>s.status!=="connected"),r=n.length>0?p.jsxs("span",{className:"flex items-center gap-1 ml-1",children:[p.jsx(ND,{status:"failed"}),p.jsxs("span",{className:"text-muted-foreground/60",children:[n.length," disconnected"]})]}):null;return p.jsx(MD,{title:"MCP Servers",count:e.length,badge:r,children:p.jsxs("div",{className:"flex flex-col gap-2",children:[t.map(s=>p.jsx($E,{server:s},s.name)),n.map(s=>p.jsx($E,{server:s},s.name))]})})}function See({rawJson:e}){const[t,n]=y.useState(!1);return p.jsxs("div",{className:"flex flex-col gap-1.5",children:[p.jsxs("button",{onClick:()=>n(!t),className:"flex items-center gap-1 cursor-pointer group/section hover:opacity-60 transition-opacity",children:[p.jsx(fs,{className:ye("h-3.5 w-3.5 text-muted-foreground transition-transform duration-200",t&&"rotate-90")}),p.jsx("span",{className:"text-muted-foreground font-medium",children:"Raw Message"})]}),t&&p.jsx("pre",{className:"ml-5 text-xs whitespace-pre-wrap break-all border border-border rounded-md p-3 overflow-x-auto max-h-96 overflow-y-auto",children:e})]})}function Cee({message:e,rawJson:t}){const{coreTools:n,mcpServersWithTools:r}=y.useMemo(()=>{const s=new Map,a=[];for(const u of e.tools){const h=bee(u);if(h){const d=s.get(h.server)||[];d.push(h.tool),s.set(h.server,d)}else a.push(u)}const l=e.mcpServers.map(u=>({name:u.name,status:u.status,error:u.error,tools:s.get(u.name)||[]}));return{coreTools:a,mcpServersWithTools:l}},[e.tools,e.mcpServers]);return p.jsx(vo,{children:p.jsxs(Up,{expandedContent:p.jsx($p,{className:"my-4 text-xs",children:p.jsxs("div",{className:"flex flex-col gap-3",children:[p.jsx(mY,{children:e.model}),p.jsx(y_,{title:"Tools",items:n,getIcon:s=>ay[s]??e5}),p.jsx(y_,{title:"Agents",items:e.agents,icon:Nb}),p.jsx(y_,{title:"Commands",items:e.slashCommands,icon:YB}),p.jsx(wee,{servers:r}),t&&p.jsx(See,{rawJson:t})]})}),children:[p.jsx(oP,{className:"h-5 w-5 text-logo"}),p.jsx(ho,{children:"Session Started"})]})})}function kee({message:e}){return p.jsx(vo,{className:"hidden",children:p.jsxs(Up,{expandedContent:p.jsx($p,{className:"my-4 text-xs",children:p.jsx("pre",{className:"font-mono whitespace-pre-wrap break-all bg-muted border border-border rounded-lg p-2 max-h-64 overflow-auto",children:JSON.stringify(e.accountInfo,null,2)})}),children:[p.jsx("div",{className:"size-5 flex justify-center items-center ",children:p.jsx(Nb,{className:"h-4 w-4 text-muted-foreground"})}),p.jsx(ho,{children:"Account"})]})})}function Eee({message:e}){return p.jsx("div",{className:"text-pretty prose prose-sm dark:prose-invert px-0.5 w-full max-w-full space-y-4",children:p.jsx(Kl,{remarkPlugins:[Gl],components:dd(),children:e.text})})}function Ree({question:e,currentIndex:t,totalQuestions:n,onBack:r,children:s}){const a=r&&t>0;return p.jsxs("div",{className:"rounded-2xl border border-border overflow-hidden",children:[p.jsxs("div",{className:"relative",children:[p.jsxs("h3",{className:"font-medium text-foreground text-sm p-3 px-4 bg-card border-b border-border text-foreground flex flex-row items-center gap-2",children:[a?p.jsx("button",{onClick:r,className:" text-muted-foreground hover:opacity-60 transition-all flex items-center",children:p.jsx(_P,{className:"h-4 w-4 -ml-0.5",strokeWidth:3})}):n>1?p.jsxs("span",{className:"font-bold text-muted-foreground whitespace-nowrap",children:[t+1," of ",n]}):null,e]}),n>1&&p.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-0.5 bg-border",children:p.jsx("div",{className:"h-full bg-muted-foreground/40 transition-all duration-300",style:{width:`${t/n*100}%`}})})]}),s]})}function WE({label:e,description:t}){return p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"text-foreground text-sm",children:e}),t&&p.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:t})]})}function AD({selected:e,multiSelect:t,onClick:n}){return p.jsx("button",{type:"button",onClick:n,className:ye("flex-shrink-0 w-5 h-5 border-1 flex items-center justify-center",t?"rounded":"rounded-full",e?"border-slate-500/0 bg-foreground":"border-muted-foreground/50 bg-background",n&&e&&"cursor-pointer"),children:e&&p.jsx(lo,{strokeWidth:3,className:"translate-y-[0.5px] h-3 w-3 text-white dark:text-background"})})}function Tee({option:e,selected:t,multiSelect:n,onClick:r,isLast:s}){const a="w-full text-left p-3 pt-2.5 pl-4 pr-5 bg-background",l=s?"":"border-b border-border";return r?p.jsx("button",{onClick:r,className:ye(a,l,"transition-all cursor-pointer"),children:p.jsxs("div",{className:"flex items-center justify-between gap-3",children:[p.jsx("div",{className:"flex-1 min-w-0",children:p.jsx(WE,{label:e.label,description:e.description})}),p.jsx(AD,{selected:t,multiSelect:n})]})}):p.jsx("div",{className:ye(a,l),children:p.jsx(WE,{label:e.label,description:e.description})})}function Mee(e){return e==null?void 0:e.answers}function si(e){return e.id||e.question}function Nee({message:e,onSubmit:t,isLatest:n}){var z,$;const r=e.input.questions,s=!!e.result,a=Mee(e.result),l=((z=e.result)==null?void 0:z.discarded)===!0,[u,h]=y.useState(0),[d,m]=y.useState({}),[g,_]=y.useState({}),[b,w]=y.useState(a??null),[S,C]=y.useState(s),k=(q,Q)=>{var ce;const M=(ce=g[q])==null?void 0:ce.trim(),I=d[q]||"",Z=Q||r.find(fe=>si(fe)===q);if(Z!=null&&Z.multiSelect)return[I,M].filter(Boolean).flatMap(fe=>fe.split(", ").filter(Boolean));const j=M||I;return j?[j]:[]},R=q=>{const Q=d[si(q)]||"";return q.multiSelect?Q.split(", ").filter(Boolean):[Q]},T=(q,Q)=>{const M=si(q);if(q.multiSelect){const I=d[M]?d[M].split(", ").filter(Boolean):[],Z=I.includes(Q)?I.filter(j=>j!==Q):[...I,Q];m({...d,[M]:Z.join(", ")})}else m({...d,[M]:Q}),_({...g,[M]:""}),u<r.length-1&&setTimeout(()=>h(u+1),150)},N=(q,Q)=>{const M=si(q);_({...g,[M]:Q}),Q&&!q.multiSelect&&m({...d,[M]:""})},L=q=>{const Q=si(q);q.multiSelect&&g[Q]&&_({...g,[Q]:""})},A=r.every(q=>k(si(q),q).length>0),O=r[u],F=u===r.length-1,G=O&&k(si(O),O).length>0,B=()=>{u<r.length-1&&h(u+1)},H=()=>{u>0&&h(u-1)},P=()=>{if(!A)return;const q={};for(const Q of r){const M=si(Q);q[M]=k(M,Q)}w(q),C(!0),t(e.toolId,r,q)},U=q=>{if(q.key==="Enter"&&!(!O||!G)){if(q.preventDefault(),F){P();return}B()}};if(S||s){const q=a||b||{};return p.jsx("div",{className:"w-full",children:p.jsxs("div",{className:"rounded-2xl border border-border overflow-hidden",children:[p.jsxs("div",{className:"font-medium text-sm p-3 px-4 pr-5 bg-muted border-b border-border flex flex-row items-center justify-between",children:[p.jsxs("p",{children:["Question",r.length!==1?"s":""]}),p.jsx("p",{className:"",children:l?"Discarded":"Answers"})]}),r.map((Q,M)=>{const I=q[si(Q)]||q[Q.question]||[],Z=M===r.length-1;return p.jsxs("div",{className:ye("w-full p-3 pt-2.5 pl-4 pr-5 bg-background flex items-center justify-between gap-3",!Z&&"border-b border-border"),children:[p.jsx("div",{className:"text-sm text-pretty",children:Q.question}),I.length>0&&p.jsx("div",{className:"text-sm font-medium text-right max-w-[50%] text-pretty",children:I.join(", ")}),I.length===0&&p.jsx("div",{className:"text-sm font-medium text-right italic",children:l?"Discarded":"No Response"})]},si(Q))})]})})}if(!n)return p.jsx("div",{className:"w-full py-2",children:p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(TT,{className:"h-4 w-4 text-muted-foreground"}),p.jsx("span",{className:"text-sm text-muted-foreground",children:"Questions pending (newer question active)"})]})});if(!O)return null;const V=R(O),W=g[si(O)]||"";return p.jsxs("div",{className:"w-full space-y-3",children:[p.jsxs(Ree,{question:O.question,currentIndex:u,totalQuestions:r.length,onBack:u>0?H:void 0,children:[($=O.options)==null?void 0:$.map(q=>p.jsx(Tee,{option:q,selected:V.includes(q.label),multiSelect:O.multiSelect,onClick:()=>T(O,q.label)},q.label)),p.jsx("div",{className:"transition-all bg-background",children:p.jsxs("div",{className:"flex pr-5 items-center justify-between gap-3",children:[p.jsx("input",{type:"text",value:W,onChange:q=>N(O,q.target.value),onKeyDown:U,placeholder:"Other...",className:"flex-1 px-3 !py-1 pl-4 min-h-[55px] min-w-0 text-sm bg-transparent outline-none text-foreground placeholder:text-muted-foreground"}),p.jsx(AD,{selected:!!W,multiSelect:O.multiSelect,onClick:O.multiSelect&&W?()=>L(O):void 0})]})})]}),p.jsxs("div",{className:"flex justify-end gap-2 mx-2",children:[!F&&G&&(O.multiSelect||!!W)&&p.jsx(tt,{size:"sm",onClick:B,children:"Next"}),F&&p.jsx(tt,{size:"sm",onClick:P,disabled:!A,className:ye(!A&&"opacity-50 cursor-not-allowed","rounded-full"),children:"Submit"})]})]})}function Aee({message:e,onConfirm:t,isLatest:n}){const r=!!e.result,[s,a]=y.useState(!1),[l,u]=y.useState(!1),[h,d]=y.useState(!1),[m,g]=y.useState(""),_=y.useRef(null),b=e.input;y.useEffect(()=>{h&&_.current&&_.current.focus()},[h]);const w=async()=>{b!=null&&b.plan&&(await navigator.clipboard.writeText(b.plan),u(!0),setTimeout(()=>u(!1),2e3))},S=r?e.result:null,C=(S==null?void 0:S.discarded)===!0;return p.jsxs("div",{className:"flex flex-col gap-3",children:[p.jsxs("div",{className:"relative rounded-2xl border border-border overflow-hidden group/plan",children:[(b==null?void 0:b.plan)&&p.jsx(tt,{variant:"ghost",size:"icon",className:ye("absolute top-2 right-2 z-10 h-8 w-8 rounded-md text-muted-foreground opacity-0 group-hover/plan:opacity-100 transition-opacity",!l&&"hover:text-foreground",l&&"hover:!bg-transparent hover:!border-transparent"),onClick:w,children:l?p.jsx(lo,{className:"h-4 w-4 text-green-400"}):p.jsx(Zu,{className:"h-4 w-4"})}),p.jsxs("div",{className:ye("!pt-5 !pb-0 px-4 md:py-4.5 md:px-5.5 bg-muted dark:bg-card overflow-scroll no-pre-highlight transition-all",r&&!s?"max-h-[min(400px,40vh)] ":"",r?"hover:!pb-[32px]":""),children:[r&&p.jsxs(tt,{variant:"ghost",className:"absolute z-10 bottom-2 pr-2.5 !pl-3.5 h-[34px] inline-flex gap-1 text-sm left-[50%] -translate-x-[50%] text-muted-foreground backdrop-blur-sm hover:text-foreground opacity-0 group-hover/plan:opacity-100 transition-all rounded-full border border-border",onClick:()=>a(!s),children:[s?"Show Less":"Show More",p.jsx(wb,{className:`size-3.5 transition-transform ${s?"rotate-180":""}`})]}),b!=null&&b.plan?p.jsxs("div",{className:"prose prose-sm dark:prose-invert max-w-none",children:[p.jsx(Kl,{remarkPlugins:[Gl],components:dd(),children:b.plan}),p.jsx("div",{className:"mt-5"})]}):p.jsx("p",{className:"text-sm text-muted-foreground",children:"No plan provided"})]})]}),r?p.jsx("div",{className:"flex justify-end mx-2",children:p.jsxs("span",{className:"pl-4 inline text-sm font-medium bg-background text-foreground/60 border border-border py-1.5 px-3 rounded-[20px] leading-relaxed max-w-[85%] sm:max-w-[80%]",children:[p.jsx("em",{children:C?"Discarded":S!=null&&S.clearContext?"Approved & Cleared Context":S!=null&&S.confirmed?"Approved":S!=null&&S.message?`Adjusted: "${S.message}"`:"Adjusted Plan"}),p.jsx(jP,{className:"inline h-4 w-4 ml-1.5 -mt-0.5"})]})}):n?p.jsxs("div",{className:"flex flex-col gap-3",children:[!h&&p.jsxs("div",{className:"flex flex-col md:flex-row items-stretch md:items-center justify-end gap-2 mx-2",children:[p.jsxs(tt,{size:"sm",onClick:()=>t(e.toolId,!0,!0),className:"rounded-full bg-primary text-background pr-4 md:order-last",children:[p.jsx(hP,{className:"h-4 w-4 mr-1.5"}),"Approve & Clear"]}),p.jsxs("div",{className:"flex items-stretch md:items-center gap-2 md:contents",children:[p.jsxs(tt,{size:"sm",variant:"outline",onClick:()=>d(!0),className:"rounded-full border-border flex-1 md:flex-initial md:order-first",children:[p.jsx(NT,{className:"h-4 w-4 mr-1.5"}),"Suggest Edits"]}),p.jsxs(tt,{size:"sm",variant:"outline",onClick:()=>t(e.toolId,!0),className:"rounded-full border-border flex-1 md:flex-initial",children:[p.jsx(lo,{className:"h-4 w-4 mr-1.5"}),"Approve"]})]})]}),h&&p.jsxs("div",{className:"flex flex-col gap-2",children:[p.jsx("textarea",{ref:_,value:m,onChange:k=>g(k.target.value),onKeyDown:k=>{k.key==="Enter"&&!k.shiftKey&&m.trim()&&(k.preventDefault(),t(e.toolId,!1,void 0,m.trim())),k.key==="Escape"&&(d(!1),g(""))},placeholder:"Describe what you'd like to change...",rows:3,className:"w-full rounded-2xl border border-border bg-muted dark:bg-card px-4 py-3 text-sm text-foreground placeholder:text-muted-foreground resize-none outline-none"}),p.jsxs("div",{className:"flex items-center justify-end gap-2 mx-2",children:[p.jsx(tt,{size:"sm",variant:"ghost",onClick:()=>{d(!1),g("")},className:"rounded-full text-muted-foreground",children:"Cancel"}),p.jsxs(tt,{size:"sm",disabled:!m.trim(),onClick:()=>t(e.toolId,!1,void 0,m.trim()),className:"rounded-full bg-primary text-background disabled:opacity-50 disabled:pointer-events-none",children:[p.jsx($B,{className:"h-4 w-4 mr-1.5"}),"Adjust Plan"]})]})]})]}):p.jsx("div",{className:"flex justify-end mx-2",children:p.jsx("span",{className:"inline text-sm text-muted-foreground italic",children:"Plan pending (newer prompt active)"})})]})}const Dee={completed:{Icon:lo,iconClass:"text-emerald-500",textClass:"text-muted-foreground"},in_progress:{Icon:ji,iconClass:"text-foreground animate-spin",textClass:"text-foreground font-medium"},pending:{Icon:kP,iconClass:"text-muted-foreground",textClass:"text-muted-foreground"}};function Oee({message:e}){const t=e.input.todos;return t.length?p.jsx("div",{className:"w-full",children:p.jsxs("div",{className:"rounded-2xl border border-border overflow-hidden",children:[p.jsxs("h3",{className:"font-medium text-foreground text-sm p-3 px-4 bg-card border-b border-border flex items-center gap-2",children:[p.jsx(mB,{className:"h-4 w-4 text-muted-foreground"}),"Progress"]}),p.jsx("div",{children:t.map((n,r)=>{const s=r===t.length-1,{Icon:a,iconClass:l,textClass:u}=Dee[n.status];return p.jsxs("div",{className:ye("flex items-center gap-3 px-4 py-2.5 bg-background",!s&&"border-b border-border"),children:[p.jsx(a,{className:ye("h-4 w-4 flex-shrink-0",l)}),p.jsx("span",{className:ye("text-sm",u),children:n.status==="in_progress"?n.activeForm:n.content})]},r)})})]})}):null}function VE(e){return(e&&typeof e=="object"&&"content"in e&&Array.isArray(e.content)?e.content:Array.isArray(e)?e:[]).flatMap(n=>!n||typeof n!="object"||!("type"in n)||n.type!=="image"?[]:"data"in n&&typeof n.data=="string"?[{type:"image",data:n.data,mimeType:typeof n.mimeType=="string"?n.mimeType:void 0}]:"source"in n&&n.source&&typeof n.source=="object"&&"type"in n.source&&n.source.type==="base64"&&"data"in n.source&&typeof n.source.data=="string"?[{type:"image",data:n.source.data,mimeType:typeof n.source.media_type=="string"?n.source.media_type:void 0}]:[])}function jee({images:e}){return p.jsx("div",{className:"flex flex-col gap-3",children:e.map((t,n)=>{const r=t.mimeType||"image/png";return p.jsx("div",{className:"overflow-hidden rounded-lg border border-border bg-muted/20",children:p.jsx("img",{src:`data:${r};base64,${t.data}`,alt:`Read result ${n+1}`,className:"max-h-[50vh] w-full object-contain bg-background"})},`${r}:${n}`)})})}function DD({message:e,isLoading:t=!1,localPath:n}){var S;const r=e.result!==void 0,s=!r&&t,a=y.useMemo(()=>{if(e.toolKind==="skill")return e.input.skill;if(e.toolKind==="glob")return`Search files ${e.input.pattern==="**/*"?"in all directories":`matching ${e.input.pattern}`}`;if(e.toolKind==="grep"){const C=e.input.pattern,k=e.input.outputMode;return k==="count"?`Count \`${C}\` occurrences`:k==="content"?`Find \`${C}\` in text`:`Find \`${C}\` in files`}return e.toolKind==="bash"?e.input.description||(e.input.command?O7(e.input.command):"Bash"):e.toolKind==="web_search"?e.input.query||"Web Search":e.toolKind==="read_file"?`Read ${Jv(e.input.filePath,n)}`:e.toolKind==="write_file"?`Write ${Jv(e.input.filePath,n)}`:e.toolKind==="edit_file"?`Edit ${Jv(e.input.filePath,n)}`:e.toolKind==="mcp_generic"?`${I_(e.input.tool)} from ${I_(e.input.server)}`:e.toolKind==="subagent_task"&&e.input.subagentType||e.toolName},[e.input,e.toolName,n]),l=y.useMemo(()=>e.toolKind==="subagent_task",[e.toolKind]),u=y.useMemo(()=>{if(e.toolKind==="skill")return e.input.skill},[e.input,e.toolKind]),h=e.toolKind==="bash",d=e.toolKind==="write_file",m=e.toolKind==="edit_file",g=e.toolKind==="read_file",_=y.useMemo(()=>{if(typeof e.result=="string")return e.result;if(!e.result)return"";if(typeof e.result=="object"&&e.result!==null&&"content"in e.result){const C=e.result.content;if(typeof C=="string")return C}return JSON.stringify(e.result,null,2)},[e.result]),b=y.useMemo(()=>{if(!g)return[];if(e.result&&typeof e.result=="object"&&"blocks"in e.result){const C=e.result.blocks;if(Array.isArray(C)){const k=VE(C);if(k.length>0)return k}}return VE(e.rawResult)},[g,e.rawResult,e.result]),w=y.useMemo(()=>{switch(e.toolKind){case"bash":return e.input.command;case"write_file":return e.input.content;default:return JSON.stringify(e.input,null,2)}},[e]);return p.jsx(vo,{className:"w-full",children:p.jsxs(Up,{expandedContent:p.jsx($p,{className:"my-4 text-sm",children:p.jsxs("div",{className:"flex flex-col gap-2",children:[m?p.jsx(vf,{content:"",isDiff:!0,oldString:e.input.oldString,newString:e.input.newString}):!g&&!d&&p.jsx(xk,{label:h?p.jsxs("span",{className:"flex items-center gap-2 w-full",children:[p.jsx("span",{children:"Command"}),!!e.input.timeoutMs&&p.jsxs("span",{className:"text-muted-foreground",children:["timeout: ",String(e.input.timeoutMs),"ms"]}),!!e.input.runInBackground&&p.jsx("span",{className:"text-muted-foreground",children:"background"})]}):d?"Contents":"Input",copyText:w,children:w}),r&&g&&!e.isError&&(b.length>0?p.jsxs("div",{children:[p.jsx("span",{className:"font-medium text-muted-foreground",children:"Image"}),p.jsx("div",{className:"mt-1",children:p.jsx(jee,{images:b})})]}):p.jsx(vf,{content:_})),d&&!e.isError&&p.jsx(vf,{content:e.input.content}),r&&!g&&!(d&&!e.isError)&&!(m&&!e.isError)&&p.jsx(xk,{label:e.isError?"Error":"Result",copyText:_,children:_})]})}),children:[p.jsx("div",{className:"w-5 h-5 relative flex items-center justify-center",children:(()=>{if(e.isError)return p.jsx(ca,{className:"size-4 text-destructive"});if(l)return p.jsx(Nb,{className:"size-4 text-muted-icon"});const C=t5(e.toolName);return p.jsx(C,{className:"size-4 text-muted-icon"})})()}),p.jsx(ho,{className:"text-left transition-opacity duration-200 truncate",children:p.jsx(Np,{animate:s,shimmerWidth:Math.max(20,(((S=u||a)==null?void 0:S.length)??33)*3),children:u||a})})]})})}function Lee({message:e}){const t=n=>{if(n<1e3)return`${n}ms`;const r=Math.floor(n/1e3),s=Math.floor(r/3600),a=Math.floor(r%3600/60),l=r%60;return s>0?`${s}h${a>0?` ${a}m`:""}`:a>0?`${a}m${l>0?` ${l}s`:""}`:`${l}s`};return e.success?p.jsxs(vo,{className:`px-0.5 text-xs tracking-wide ${e.durationMs>6e4?"":"hidden"}`,children:[p.jsx("div",{className:"w-full h-[1px] bg-border"}),p.jsxs(ho,{className:"whitespace-nowrap text-[11px] tracking-widest text-muted-foreground/60 uppercase flex-shrink-0",children:["Worked for ",t(e.durationMs)]}),p.jsx("div",{className:"w-full h-[1px] bg-border"})]}):p.jsx("div",{className:"px-4 py-3 mx-2 my-1 rounded-lg bg-destructive/10 border border-destructive/20 text-destructive text-sm",children:e.result||"An unknown error occurred."})}function zee({message:e}){return p.jsx("div",{className:"flex items-center justify-end gap-2 text-sm text-muted-foreground my-3",children:p.jsxs("div",{className:"inline-flex gap-1.5 items-center justify-center whitespace-nowrap text-sm font-medium bg-background text-foreground/60 border border-border h-9 pl-1 pr-4 rounded-full",children:[p.jsx(SP,{className:"h-4 w-4 ml-1.5"}),p.jsx("em",{children:"Interrupted"})]})})}function cp({size:e=4}){return p.jsxs("svg",{className:"flex-1",viewBox:`0 0 100 ${e}`,preserveAspectRatio:"none",style:{height:`${e}px`},children:[p.jsx("pattern",{id:"zigzag",width:e,height:e,patternUnits:"userSpaceOnUse",children:p.jsx("path",{d:`M0 ${e} L${e/2} 0 L${e} ${e}`,fill:"none",stroke:"currentColor",strokeWidth:"0.5",className:"text-muted-foreground/30",style:{stroke:"currentColor"}})}),p.jsx("rect",{width:"100%",height:e,fill:"url(#zigzag)",className:"text-muted-foreground/30"})]})}function Pee(){return p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsx(cp,{}),p.jsx("span",{className:"text-[11px] tracking-widest text-muted-foreground uppercase flex-shrink-0",children:"Compacted"}),p.jsx(cp,{})]})}function Bee(){return p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsx(cp,{}),p.jsx("span",{className:"text-[11px] tracking-widest text-muted-foreground uppercase flex-shrink-0",children:"Context Cleared"}),p.jsx(cp,{})]})}function Iee({message:e}){return p.jsx(vo,{children:p.jsxs(Up,{expandedContent:p.jsx($p,{className:"my-4 text-xs",children:p.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none",children:p.jsx(Kl,{remarkPlugins:[Gl],components:dd(),children:e.summary})})}),children:[p.jsx("div",{className:"w-5 h-5 relative flex items-center justify-center",children:p.jsx(MT,{className:"h-4.5 w-4.5 text-muted-foreground"})}),p.jsx(ho,{children:"Summarized"})]})})}const Hee={compacting:"Compacting..."};function Fee({message:e}){const t=Hee[e.status]||e.status;return p.jsxs(vo,{className:"grid grid-cols-[auto_1fr] items-center gap-1.5 text-sm animate-pulse",children:[p.jsx("div",{className:"w-5 h-5 relative flex items-center justify-center",children:p.jsx(MT,{className:"h-4.5 w-4.5 text-muted-foreground"})}),p.jsx(ho,{className:"text-left transition-opacity duration-200 truncate",children:t})]})}const Uee={read_file:{key:"read",singular:"read",plural:"reads"},edit_file:{key:"edit",singular:"edit",plural:"edits"},write_file:{key:"write",singular:"write",plural:"writes"},bash:{key:"bash",singular:"command",plural:"commands"},grep:{key:"grep",singular:"search",plural:"searches"},glob:{key:"glob",singular:"glob",plural:"globs"},subagent_task:{key:"task",singular:"agent",plural:"agents"},web_search:{key:"websearch",singular:"web search",plural:"web searches"},skill:{key:"skill",singular:"skill",plural:"skills"},todo_write:{key:"todo",singular:"todo update",plural:"todo updates"}},$ee={key:"other",singular:"tool call",plural:"tool calls"};function Wee(e){return Uee[e]??$ee}function Vee(e){const t=new Map,n=[];for(const r of e){const s=r.toolKind,a=Wee(s),l=t.get(a.key);l?l.count++:(t.set(a.key,{category:a,count:1}),n.push(a.key))}return n.map(r=>{const{category:s,count:a}=t.get(r);return`${a} ${a===1?s.singular:s.plural}`}).join(", ")}function qee({messages:e,isLoading:t,localPath:n}){const[r,s]=y.useState(!1),a=y.useMemo(()=>Vee(e),[e]),u=e.some(h=>h.result===void 0)&&t;return p.jsx(vo,{className:"w-full",children:p.jsxs("div",{className:"flex flex-col w-full",children:[p.jsx("button",{onClick:()=>s(!r),className:`group cursor-pointer grid grid-cols-[auto_1fr] items-center gap-1 text-sm ${!r&&!u?"hover:opacity-60 transition-opacity":""}`,children:p.jsxs("div",{className:"grid grid-cols-[auto_1fr] items-center gap-1.5",children:[p.jsx("div",{className:"w-5 h-5 relative flex items-center justify-center",children:p.jsx(fs,{className:`h-4.5 w-4.5 text-muted-icon transition-all duration-200 ${r?"rotate-90":""}`})}),p.jsx(ho,{className:"text-left",children:p.jsx(Np,{animate:u,children:a})})]})}),r&&p.jsxs("div",{className:"my-4 flex flex-col gap-3",children:[e.map(h=>p.jsx(DD,{message:h,isLoading:t,localPath:n},h.id)),e.length>5&&p.jsx("button",{onClick:()=>s(!1),className:"cursor-pointer grid grid-cols-[auto_1fr] items-center gap-1 text-xs hover:opacity-80 transition-opacity",children:p.jsxs("div",{className:"grid grid-cols-[auto_1fr] items-center gap-1.5",children:[p.jsx("div",{className:"w-5 h-5 relative flex items-center justify-center",children:p.jsx(fs,{className:"h-4.5 w-4.5 text-muted-icon -rotate-90"})}),p.jsx(ho,{className:"text-left",children:"Collapse"})]})})]})]})})}const Kee=new Set(["AskUserQuestion","ExitPlanMode","TodoWrite"]);function qE(e){if(e.kind!=="tool")return!1;const t=e.toolName;return!Kee.has(t)}function Gee(e){const t=[];let n=0;for(;n<e.length;){const r=e[n];if(qE(r)){const s=[r],a=n;for(n+=1;n<e.length&&qE(e[n]);)s.push(e[n]),n+=1;s.length>=2?t.push({type:"tool-group",messages:s,startIndex:a}):t.push({type:"single",message:r,index:a});continue}t.push({type:"single",message:r,index:n}),n+=1}return t}function Yee({messages:e,isLoading:t,localPath:n,latestToolIds:r,onOpenLocalLink:s,onAskUserQuestionSubmit:a,onExitPlanModeConfirm:l}){const u=y.useMemo(()=>Gee(e),[e]);function h(d,m){if(d.kind==="user_prompt")return p.jsx(_ee,{content:d.content,attachments:d.attachments},d.id);switch(d.kind){case"unknown":return p.jsx(yee,{json:d.json},d.id);case"system_init":return e.findIndex(_=>_.kind==="system_init")===m?p.jsx(Cee,{message:d,rawJson:d.debugRaw},d.id):null;case"account_info":return e.findIndex(_=>_.kind==="account_info")===m?p.jsx(kee,{message:d},d.id):null;case"assistant_text":return p.jsx(Eee,{message:d},d.id);case"tool":return d.toolKind==="ask_user_question"?p.jsx(Nee,{message:d,onSubmit:a,isLatest:d.id===r.AskUserQuestion},d.id):d.toolKind==="exit_plan_mode"?p.jsx(Aee,{message:d,onConfirm:l,isLatest:d.id===r.ExitPlanMode},d.id):d.toolKind==="todo_write"?d.id!==r.TodoWrite?null:p.jsx(Oee,{message:d},d.id):p.jsx(DD,{message:d,isLoading:t,localPath:n},d.id);case"result":{const g=e[m+1],_=e[m-1];return(g==null?void 0:g.kind)==="context_cleared"||(_==null?void 0:_.kind)==="context_cleared"?null:p.jsx(Lee,{message:d},d.id)}case"interrupted":return p.jsx(zee,{message:d},d.id);case"compact_boundary":return p.jsx(Pee,{},d.id);case"context_cleared":return p.jsx(Bee,{},d.id);case"compact_summary":return p.jsx(Iee,{message:d},d.id);case"status":return m===e.length-1?p.jsx(Fee,{message:d},d.id):null}}return p.jsx(fY,{onOpenLocalLink:s,children:u.map(d=>{if(d.type==="tool-group")return p.jsx("div",{className:"group relative",[Lf]:"",children:p.jsx(qee,{messages:d.messages,isLoading:t,localPath:n})},`group-${d.startIndex}`);const m=h(d.message,d.index);return m?p.jsx("div",{id:`msg-${d.message.id}`,className:"group relative",[Lf]:"",children:m},d.message.id):null})})}function Xee({rootRef:e,fallbackRef:t,enabled:n,canCancel:r}){y.useEffect(()=>{if(!n)return;let s=0,a=null;const l=g=>{const _=g instanceof Element?g:null,b=e.current,w=t.current;if(YC({trigger:"pointer",activeElement:document.activeElement,pointerStartTarget:a,pointerEndTarget:_,root:b,fallback:w,hasActiveOverlay:GC(document),hasActiveSelection:mI(window.getSelection())})!=="restore"){a=null;return}w==null||w.focus({preventScroll:!0}),a=null},u=g=>{cancelAnimationFrame(s),a=g.target instanceof Element?g.target:null},h=g=>{cancelAnimationFrame(s),s=window.requestAnimationFrame(()=>{l(g.target)})},d=()=>{a=null;const g=t.current;!g||g.disabled||g.focus({preventScroll:!0})},m=g=>{if(g.key!=="Escape")return;const _=t.current;YC({trigger:"escape",activeElement:document.activeElement,fallback:_,hasActiveOverlay:GC(document),canCancel:r,defaultPrevented:g.defaultPrevented})==="escape-focus"&&(g.preventDefault(),_==null||_.focus({preventScroll:!0}))};return window.addEventListener("pointerdown",u,!0),window.addEventListener("pointerup",h,!0),window.addEventListener("keydown",m,!0),window.addEventListener(jf,d),()=>{cancelAnimationFrame(s),window.removeEventListener("pointerdown",u,!0),window.removeEventListener("pointerup",h,!0),window.removeEventListener("keydown",m,!0),window.removeEventListener(jf,d)}},[r,n,t,e])}const rf="What are we building?",Zee=19,eb=72,Qee=120,Jee=1200;function ete(e){return e.split(/\r?\n/u).map(n=>n.trim()).find(n=>n.length>0)??"(attachment only)"}function tte(e){let t=0;return e.flatMap(n=>n.kind!=="user_prompt"||n.hidden?[]:(t+=1,[{id:n.id,label:ete(n.content),order:t}]))}function nte(e){return e.enabled&&e.layoutWidth>Jee&&e.itemCount>0}function rte(e,t){const n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),s=e.scrollTop+r.top-n.top-eb;e.scrollTo({top:Math.max(0,s),behavior:"smooth"})}function ite(e){return Array.from(e).includes("Files")}function ste(){var bt,un,Zt,Nn,Dt,Yn;const e=ub(),t=y.useRef(null),n=y.useRef(null),r=y.useRef(null),s=y.useRef(null),[a,l]=y.useState(""),[u,h]=y.useState(!1),[d,m]=y.useState(0),[g,_]=y.useState(!1),[b,w]=y.useState(0),S=y.useRef(0),C=((bt=e.runtime)==null?void 0:bt.projectId)??null,R=Js(Y=>C?Y.projects[C]:void 0)??nee,N=Mf(Y=>C?Y.projects[C]:void 0)??ZJ,L=Js(Y=>Y.addTerminal),A=Js(Y=>Y.removeTerminal),O=Js(Y=>Y.toggleVisibility),F=Js(Y=>Y.resetMainSizes),G=Js(Y=>Y.setMainSizes),B=Js(Y=>Y.setTerminalSizes),H=Mf(Y=>Y.toggleVisibility),P=Mf(Y=>Y.setSize),U=Kr(Y=>Y.scrollbackLines),V=Kr(Y=>Y.minColumnWidth),W=er(Y=>Y.showTranscriptToc),z=e.keybindings,$=y.useMemo(()=>Yb(z),[z]),q=y.useMemo(()=>tte(e.messages),[e.messages]),Q=nte({enabled:W,layoutWidth:b,itemCount:q.length}),M=R.terminals.length>0,I=!!(C&&R.isVisible&&M),Z=!!(C&&M),j=!!(C&&N.isVisible),ce=!!C,{isAnimating:fe,mainPanelGroupRef:ue,terminalFocusRequestVersion:de,terminalPanelRef:we,terminalVisualRef:oe}=vee({showTerminalPane:I,shouldRenderTerminalLayout:Z,projectId:C,terminalLayout:R,chatInputRef:r}),{isAnimating:be,panelGroupRef:Ne,sidebarPanelRef:Se,sidebarVisualRef:_e}=pee({projectId:C,shouldRenderRightSidebarLayout:ce,showRightSidebar:j,rightSidebarSize:N.size});Xee({rootRef:n,fallbackRef:r,enabled:e.hasSelectedProject&&((un=e.runtime)==null?void 0:un.status)!=="waiting_for_user",canCancel:e.canCancel});function xe(Y){var le;return ite(((le=Y.dataTransfer)==null?void 0:le.types)??[])}function He(Y){var le;!e.hasSelectedProject||Y.length===0||(le=s.current)==null||le.enqueueFiles(Y)}const Fe=()=>{if(C){if(M){O(C);return}L(C)}},et=Y=>{var $e;if(!C||!I||fe.current)return;const le=Y.chat,Re=Y.terminal;if(!Number.isFinite(le)||!Number.isFinite(Re))return;const ze=(($e=t.current)==null?void 0:$e.getBoundingClientRect().height)??0;if(oee(ze,Re)){F(C),O(C);return}G(C,[le,Re])};y.useEffect(()=>{if(e.messages.length!==0)return;l(""),h(!1);let Y=0;const le=window.setInterval(()=>{Y+=1,l(rf.slice(0,Y)),Y>=rf.length&&(window.clearInterval(le),h(!0))},Zee);return()=>window.clearInterval(le)},[e.activeChatId,e.messages.length]),y.useEffect(()=>{function Y(le){if(C){if(Kc($,"toggleEmbeddedTerminal",le)){le.preventDefault(),Fe();return}if(Kc($,"toggleRightSidebar",le)){le.preventDefault(),H(C);return}if(Kc($,"openInFinder",le)){le.preventDefault(),e.handleOpenExternal("open_finder");return}if(Kc($,"openInEditor",le)){le.preventDefault(),e.handleOpenExternal("open_editor");return}Kc($,"addSplitTerminal",le)&&(le.preventDefault(),L(C))}}return window.addEventListener("keydown",Y),()=>window.removeEventListener("keydown",Y)},[L,Fe,C,$,H,O]),y.useEffect(()=>{const Y=window.requestAnimationFrame(()=>{e.updateScrollState()}),le=window.setTimeout(()=>{e.updateScrollState()},yl);return()=>{window.cancelAnimationFrame(Y),window.clearTimeout(le)}},[Z,I,e.updateScrollState]),y.useEffect(()=>{function Y(){e.updateScrollState()}return window.addEventListener("resize",Y),()=>window.removeEventListener("resize",Y)},[e.updateScrollState]),y.useEffect(()=>{const Y=t.current;if(!Y)return;const le=()=>{const ze=Y.getBoundingClientRect().height,$e=Y.getBoundingClientRect().width;if(w(ee=>Math.abs(ee-$e)<1?ee:$e),!Z||ze<=0)return;const ht=ze*(R.mainSizes[1]/100);ht<=0||m(ee=>Math.abs(ee-ht)<1?ee:ht)},Re=new ResizeObserver(le);return Re.observe(Y),le(),()=>Re.disconnect()},[C,Z,R.mainSizes]);const dt=Y=>Number.isFinite(Y)?Math.min(Ky,Math.max(Gp,Y)):N.size,mt=p.jsxs(o5,{ref:n,className:"bg-background h-full flex flex-col overflow-hidden border-0 rounded-none relative",onDragEnter:Y=>{!xe(Y)||!e.hasSelectedProject||(Y.preventDefault(),S.current+=1,_(!0))},onDragOver:Y=>{!xe(Y)||!e.hasSelectedProject||(Y.preventDefault(),Y.dataTransfer.dropEffect="copy",g||_(!0))},onDragLeave:Y=>{!xe(Y)||!e.hasSelectedProject||(Y.preventDefault(),S.current=Math.max(0,S.current-1),S.current===0&&_(!1))},onDrop:Y=>{!xe(Y)||!e.hasSelectedProject||(Y.preventDefault(),S.current=0,_(!1),He([...Y.dataTransfer.files]))},children:[p.jsxs(l5,{className:"flex flex-1 min-h-0 flex-col p-0 overflow-hidden relative",children:[p.jsx(PY,{sidebarCollapsed:e.sidebarCollapsed,onOpenSidebar:e.openSidebar,onExpandSidebar:e.expandSidebar,onNewChat:e.handleCompose,localPath:e.navbarLocalPath,embeddedTerminalVisible:I,onToggleEmbeddedTerminal:C?Fe:void 0,rightSidebarVisible:j,onToggleRightSidebar:C?()=>H(C):void 0,onOpenExternal:Y=>{e.handleOpenExternal(Y)},editorLabel:e.editorLabel,finderShortcut:$.bindings.openInFinder,editorShortcut:$.bindings.openInEditor,terminalShortcut:$.bindings.toggleEmbeddedTerminal,rightSidebarShortcut:$.bindings.toggleRightSidebar}),p.jsxs(g0,{ref:e.scrollRef,onScroll:e.updateScrollState,className:"flex-1 min-h-0 px-4 scroll-pt-[72px]",children:[e.messages.length===0?p.jsx("div",{style:{height:e.transcriptPaddingBottom},"aria-hidden":"true"}):null,e.messages.length>0?p.jsxs(p.Fragment,{children:[p.jsxs("div",{className:"animate-fade-in space-y-5 pt-[72px] max-w-[800px] mx-auto",children:[p.jsx(Yee,{messages:e.messages,isLoading:e.isProcessing,localPath:(Zt=e.runtime)==null?void 0:Zt.localPath,latestToolIds:e.latestToolIds,onOpenLocalLink:e.handleOpenLocalLink,onAskUserQuestionSubmit:e.handleAskUserQuestion,onExitPlanModeConfirm:e.handleExitPlanMode}),e.isProcessing?p.jsx(GJ,{status:(Nn=e.runtime)==null?void 0:Nn.status}):null,e.commandError?p.jsx("div",{className:"text-sm text-destructive border border-destructive/20 bg-destructive/5 rounded-xl px-4 py-3",children:e.commandError}):null]}),p.jsx("div",{style:{height:250},"aria-hidden":"true"})]}):null]}),Q?p.jsx("div",{className:"absolute right-4 z-20",style:{top:eb},children:p.jsx("div",{className:" px-1 backdrop-blur-md","data-testid":"transcript-toc",children:p.jsx("div",{className:"flex flex-col items-end gap-[1px]",children:q.map(Y=>p.jsx("button",{type:"button",className:"flex max-w-[175px] items-center justify-end gap-1 rounded-xl px-2 py-1 text-left text-xs text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",onClick:()=>{const le=e.scrollRef.current,Re=document.getElementById(`msg-${Y.id}`);!le||!Re||rte(le,Re)},title:Y.label,children:p.jsx("span",{className:"min-w-0 truncate",children:Y.label})},Y.id))})})}):null,e.messages.length===0?p.jsx("div",{className:"pointer-events-none absolute inset-x-4 animate-fade-in",style:{top:eb,bottom:e.transcriptPaddingBottom},children:p.jsx("div",{className:"mx-auto flex h-full max-w-[800px] items-center justify-center",children:p.jsxs("div",{className:"flex flex-col items-center justify-center text-muted-foreground gap-4 opacity-70",children:[p.jsx(yu,{strokeWidth:1.5,className:"size-8 text-muted-foreground kanna-empty-state-flower"}),p.jsx("div",{className:"text-base font-normal text-muted-foreground text-center max-w-xs flex items-center kanna-empty-state-text","aria-label":rf,children:p.jsxs("span",{className:"relative inline-grid place-items-start",children:[p.jsxs("span",{className:"invisible col-start-1 row-start-1 whitespace-pre flex items-center",children:[p.jsx("span",{children:rf}),p.jsx("span",{className:"kanna-typewriter-cursor-slot","aria-hidden":"true"})]}),p.jsxs("span",{className:"col-start-1 row-start-1 whitespace-pre flex items-center",children:[p.jsx("span",{children:a}),p.jsx("span",{className:"kanna-typewriter-cursor-slot","aria-hidden":"true",children:p.jsx("span",{className:"kanna-typewriter-cursor","data-typing-complete":u?"true":"false"})})]})]})})]})})},e.activeChatId??"new-chat"):null,g?p.jsxs("div",{className:"absolute inset-0 z-30 pointer-events-none",children:[p.jsx("div",{className:"absolute inset-0 backdrop-blur-sm"}),p.jsx("div",{className:"absolute inset-6 ",children:p.jsx("div",{className:"flex h-full items-center justify-center",children:p.jsxs("div",{className:"text-center flex flex-col items-center justify-center gap-3",children:[p.jsx(dI,{className:"mx-auto size-14 text-foreground",strokeWidth:1.75}),p.jsx("div",{className:"text-xl font-medium text-foreground",children:"Drop up to 10 files"})]})})})]}):null,p.jsx("div",{style:{bottom:Qee},className:ye("absolute left-1/2 -translate-x-1/2 z-10 transition-all",e.showScrollButton?"scale-100 duration-300 ease-[cubic-bezier(0.34,1.56,0.64,1)]":"scale-60 duration-300 ease-out pointer-events-none blur-sm opacity-0"),children:p.jsx("button",{onClick:e.scrollToBottom,className:"flex items-center transition-colors gap-1.5 px-2 bg-white hover:bg-muted border border-border rounded-full aspect-square cursor-pointer text-sm text-primary hover:text-foreground dark:bg-slate-700 dark:hover:bg-slate-600 dark:text-slate-100 dark:border-slate-600",children:p.jsx(eP,{className:"h-5 w-5"})})})]}),p.jsx("div",{className:"absolute bottom-0 left-0 right-0 z-20 pointer-events-none",children:p.jsx("div",{className:"bg-gradient-to-t from-background via-background pointer-events-auto",ref:e.inputRef,children:p.jsx(OY,{ref:s,inputElementRef:r,onSubmit:e.handleSend,onCancel:()=>{e.handleCancel()},disabled:!e.hasSelectedProject||((Dt=e.runtime)==null?void 0:Dt.status)==="waiting_for_user",canCancel:e.canCancel,chatId:e.activeChatId,projectId:C,activeProvider:((Yn=e.runtime)==null?void 0:Yn.provider)??null,availableProviders:e.availableProviders},e.activeChatId??"new-chat")})})]});return p.jsx("div",{ref:t,className:"flex-1 flex flex-col min-w-0 relative",children:ce&&C?p.jsxs(yf,{groupRef:Ne,orientation:"horizontal",className:"flex-1 min-h-0",onLayoutChange:Y=>{var Re;if(!j||be.current)return;const le=dt(Y.rightSidebar);Math.abs(le-Y.rightSidebar)<.1||(Re=Ne.current)==null||Re.setLayout({workspace:100-le,rightSidebar:le})},onLayoutChanged:Y=>{!j||be.current||P(C,dt(Y.rightSidebar))},children:[p.jsx($o,{id:"workspace",defaultSize:`${100-N.size}%`,minSize:"50%",className:"min-h-0 min-w-0",children:Z?p.jsxs(yf,{groupRef:ue,orientation:"vertical",className:"flex-1 min-h-0",onLayoutChanged:et,children:[p.jsx($o,{id:"chat",defaultSize:`${R.mainSizes[0]}%`,minSize:"25%",className:"min-h-0",children:mt}),p.jsx(bf,{withHandle:!0,orientation:"vertical",disabled:!I,className:ye(!I&&"pointer-events-none opacity-0")}),p.jsx($o,{id:"terminal",defaultSize:`${R.mainSizes[1]}%`,minSize:"0%",className:"min-h-0",elementRef:we,children:p.jsx("div",{ref:oe,className:"h-full min-h-0 overflow-hidden relative","data-terminal-open":I?"true":"false","data-terminal-animated":"false","data-terminal-visual":!0,style:{"--terminal-toggle-duration":`${yl}ms`},children:p.jsx("div",{style:d>0?{height:`${d}px`}:void 0,children:p.jsx(BE,{projectId:C,layout:R,onAddTerminal:L,socket:e.socket,connectionStatus:e.connectionStatus,scrollback:U,minColumnWidth:V,splitTerminalShortcut:$.bindings.addSplitTerminal,focusRequestVersion:de,onRemoveTerminal:(Y,le)=>{e.socket.command({type:"terminal.close",terminalId:le}).catch(()=>{}),A(Y,le)},onTerminalLayout:B})})})})]},C):mt}),p.jsx(bf,{withHandle:!0,orientation:"horizontal",disabled:!j,className:ye(!j&&"pointer-events-none opacity-0")}),p.jsx($o,{id:"rightSidebar",defaultSize:`${N.size}%`,maxSize:`${Ky}%`,className:"min-h-0 min-w-0",elementRef:Se,children:p.jsx("div",{ref:_e,className:"h-full min-h-0 overflow-hidden","data-right-sidebar-open":j?"true":"false","data-right-sidebar-animated":"false","data-right-sidebar-visual":!0,style:{"--terminal-toggle-duration":`${yl}ms`},children:p.jsx(BY,{onClose:()=>H(C)})})})]},`${C}-right-sidebar`):Z&&C?p.jsxs(yf,{groupRef:ue,orientation:"vertical",className:"flex-1 min-h-0",onLayoutChanged:et,children:[p.jsx($o,{id:"chat",defaultSize:`${R.mainSizes[0]}%`,minSize:"25%",className:"min-h-0",children:mt}),p.jsx(bf,{withHandle:!0,orientation:"vertical",disabled:!I,className:ye(!I&&"pointer-events-none opacity-0")}),p.jsx($o,{id:"terminal",defaultSize:`${R.mainSizes[1]}%`,minSize:"0%",className:"min-h-0",elementRef:we,children:p.jsx("div",{ref:oe,className:"h-full min-h-0 overflow-hidden relative","data-terminal-open":I?"true":"false","data-terminal-animated":"false","data-terminal-visual":!0,style:{"--terminal-toggle-duration":`${yl}ms`},children:p.jsx("div",{style:d>0?{height:`${d}px`}:void 0,children:p.jsx(BE,{projectId:C,layout:R,onAddTerminal:L,socket:e.socket,connectionStatus:e.connectionStatus,scrollback:U,minColumnWidth:V,splitTerminalShortcut:$.bindings.addSplitTerminal,focusRequestVersion:de,onRemoveTerminal:(Y,le)=>{e.socket.command({type:"terminal.close",terminalId:le}).catch(()=>{}),A(Y,le)},onTerminalLayout:B})})})})]},C):mt})}function KE({narrow:e=!1,title:t,subtitle:n,icon:r=Eb}){return p.jsxs("div",{className:ye("w-full",e?"max-w-2xl px-6 pt-16 mx-auto":"px-6 pt-16 mb-10"),children:[p.jsxs("div",{className:ye("flex items-center gap-1 mb-2",e&&"justify-center"),children:[p.jsx("div",{className:"p-2 pl-0 rounded-lg",children:p.jsx(r,{className:"h-6 w-6 text-muted-foreground"})}),p.jsx("h1",{className:"text-2xl font-semibold text-foreground",children:t})]}),n&&p.jsx("p",{className:ye("text-muted-foreground",e&&"mb-10 text-center"),children:n})]})}const ote={sm:"text-sm px-2.5 py-1",md:"text-sm px-3 py-1.5"};function tb({value:e,onValueChange:t,options:n,size:r="md",className:s,optionClassName:a}){return p.jsx("div",{className:ye("inline-flex items-center rounded-lg border border-border p-[3px] ",s),children:n.map(l=>{const u=l.value===e,h=l.icon,d=h?y.isValidElement(h)?h:(()=>{const g=h;return p.jsx(g,{className:r==="sm"?"h-3.5 w-3.5":"h-4 w-4"})})():null,m=p.jsxs("button",{type:"button",onClick:()=>t(l.value),disabled:l.disabled,"aria-pressed":u,className:ye("rounded-[4px] border transition-colors",h?"grid grid-cols-[auto_auto] items-center gap-2":"inline-flex items-center gap-1.5",ote[r],u?"bg-white dark:bg-muted text-slate-900 dark:text-slate-200 border-slate-300 dark:border-white/10 bg-slate-200 ":"border-transparent text-slate-800 hover:text-slate-900 dark:text-muted-foreground dark:hover:text-foreground",l.disabled&&"opacity-50 pointer-events-none",a),children:[d,p.jsx("span",{children:l.label})]},l.value);return l.tooltip?p.jsxs(Hf,{children:[p.jsx(Ff,{asChild:!0,children:m}),p.jsx(Ou,{children:l.tooltip})]},l.value):m})})}function ate(e){return e.toLowerCase().replace(/[\s_]+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"")}function lte({open:e,onOpenChange:t,onConfirm:n}){const[r,s]=y.useState("new"),[a,l]=y.useState(""),[u,h]=y.useState(""),d=y.useRef(null),m=y.useRef(null);y.useEffect(()=>{e&&(s("new"),l(""),h(""),setTimeout(()=>{var C;return(C=d.current)==null?void 0:C.focus()},0))},[e]),y.useEffect(()=>{e&&setTimeout(()=>{var C,k;r==="new"?(C=d.current)==null||C.focus():(k=m.current)==null||k.focus()},0)},[r,e]);const g=ate(a),_=g?`${u7}/${g}`:"",b=u.trim(),w=r==="new"?!!g:!!b,S=()=>{if(w){if(r==="new")n({mode:"new",localPath:_,title:a.trim()});else{const C=b.split("/").pop()||b;n({mode:"existing",localPath:b,title:C})}t(!1)}};return p.jsx(Db,{open:e,onOpenChange:t,children:p.jsxs(yp,{size:"sm",children:[p.jsxs(jb,{className:"space-y-4",children:[p.jsx(Ob,{children:"Add Project"}),p.jsx(tb,{value:r,onValueChange:s,options:[{value:"new",label:"New Folder"},{value:"existing",label:"Existing Path"}],className:"w-full mb-2",optionClassName:"flex-1 justify-center"}),r==="new"?p.jsxs("div",{className:"space-y-2",children:[p.jsx(io,{ref:d,type:"text",value:a,onChange:C=>l(C.target.value),onKeyDown:C=>{C.key==="Enter"&&S(),C.key==="Escape"&&t(!1)},placeholder:"Project name"}),_&&p.jsx("p",{className:"text-xs text-muted-foreground font-mono",children:_})]}):p.jsxs("div",{className:"space-y-2",children:[p.jsx(io,{ref:m,type:"text",value:u,onChange:C=>h(C.target.value),onKeyDown:C=>{C.key==="Enter"&&S(),C.key==="Escape"&&t(!1)},placeholder:"~/Projects/my-app"}),p.jsx("p",{className:"text-xs text-muted-foreground",children:"The folder will be created if it doesn't exist."})]})]}),p.jsxs(Lb,{children:[p.jsx(tt,{variant:"ghost",size:"sm",onClick:()=>t(!1),children:"Cancel"}),p.jsx(tt,{variant:"secondary",size:"sm",onClick:S,disabled:!w,children:"Create"})]})]})})}function cte({text:e}){const[t,n]=y.useState(!1);async function r(){await navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),2e3)}return p.jsx(tt,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:()=>void r(),children:t?p.jsx(lo,{className:"h-4 w-4 text-green-400"}):p.jsx(Zu,{className:"h-4 w-4"})})}function GE({children:e}){return p.jsxs("div",{className:"grid grid-cols-[1fr_auto] items-center group bg-background border border-border text-foreground rounded-xl p-1.5 pl-3 font-mono text-sm",children:[p.jsxs("pre",{className:"inline-flex items-center gap-2 overflow-x-auto",children:[p.jsx(fs,{className:"inline h-4 w-4 opacity-40"}),p.jsx("code",{children:e})]}),p.jsx(cte,{text:e})]})}function sf({children:e}){return p.jsx("div",{className:"bg-card border border-border rounded-2xl p-4",children:e})}function b_({children:e}){return p.jsx("h2",{className:"text-[13px] font-medium text-muted-foreground uppercase tracking-wider mb-3",children:e})}function x_({icon:e,title:t,subtitle:n,iconClassName:r}){return p.jsxs("div",{className:"flex flex-col items-center gap-0",children:[p.jsx("div",{className:"p-3 mb-2 rounded-xl bg-background border border-border",children:p.jsx(e,{className:r||"h-8 w-8 text-muted-foreground"})}),p.jsx("span",{className:"text-sm font-medium",children:t}),p.jsx("span",{className:"text-xs text-muted-foreground",children:n})]})}function YE(){return p.jsx(nP,{className:"h-4 w-4 text-muted-foreground"})}function XE({number:e,title:t,children:n}){return p.jsx("div",{className:"flex gap-4",children:p.jsxs("div",{className:"flex-1 min-w-0",children:[p.jsxs("div",{className:"grid grid-cols-[auto_1fr] items-baseline gap-3",children:[p.jsxs("div",{className:"flex-shrink-0 flex items-center justify-center font-medium text-logo",children:[e,"."]}),p.jsx("h3",{className:"font-medium text-foreground mb-2",children:t})]}),p.jsx("div",{className:"text-muted-foreground text-sm space-y-3",children:n})]})})}function ute({localPath:e,loading:t,onClick:n}){return p.jsxs(Hf,{children:[p.jsx(Ff,{asChild:!0,children:p.jsxs("button",{className:ye("border border-border hover:border-primary/30 group rounded-lg bg-card px-4 py-3 flex items-center gap-3 w-full text-left hover:bg-muted/50 transition-colors",t&&"opacity-50 cursor-not-allowed"),disabled:t,onClick:n,children:[p.jsx(lB,{className:"h-4 w-4 text-muted-foreground flex-shrink-0"}),p.jsx("span",{className:"font-medium text-foreground truncate flex-1",children:wM(e)}),t?p.jsx(ji,{className:"h-4 w-4 text-muted-foreground group-hover:text-primary animate-spin flex-shrink-0"}):p.jsx(Tb,{className:"h-4 w-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity flex-shrink-0"})]})}),p.jsx(Ou,{children:p.jsx("p",{children:e})})]})}function dte({connectionStatus:e,ready:t,snapshot:n,startingLocalPath:r,commandError:s,onOpenProject:a,onCreateProject:l}){const[u,h]=y.useState(!1),d=y.useMemo(()=>(n==null?void 0:n.projects)??[],[n==null?void 0:n.projects]),m=e==="connecting"||!t,g=e==="connected"&&t;return p.jsxs("div",{className:"flex-1 flex flex-col min-w-0 bg-background overflow-y-auto",children:[g?p.jsxs(p.Fragment,{children:[p.jsx(KE,{title:(n==null?void 0:n.machine.displayName)??"Local Projects",subtitle:`${ln} is connected, choose a project below to get started.`}),p.jsxs("div",{className:"w-full px-6 mb-10",children:[p.jsxs("div",{className:"flex items-baseline justify-between mb-3",children:[p.jsx("h2",{className:"text-[13px] font-medium text-muted-foreground uppercase tracking-wider",children:"Projects"}),p.jsxs(tt,{variant:"default",size:"sm",onClick:()=>h(!0),children:[p.jsx(Rb,{className:"h-4 w-4 mr-1.5"}),"Add Project"]})]}),d.length>0?p.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-4 3xl:grid-cols-5 gap-2",children:d.map(_=>p.jsx(ute,{localPath:_.localPath,loading:r===_.localPath,onClick:()=>{a(_.localPath)}},_.localPath))}):p.jsx(sf,{children:p.jsx("p",{className:"text-sm text-muted-foreground",children:"No local projects discovered yet. Open one with Claude or Codex, or create a new project here."})}),s?p.jsx("div",{className:"text-sm text-destructive border border-destructive/20 bg-destructive/5 rounded-xl px-4 py-3 mt-4",children:s}):null]})]}):p.jsxs(p.Fragment,{children:[p.jsx(KE,{narrow:!0,icon:$C,title:m?`Connecting ${ln}`:`Connect ${ln}`,subtitle:m?`${ln} is starting up and loading your local projects.`:`Run ${ln} directly on your machine with full access to your local files and agent project history.`}),p.jsxs("div",{className:"max-w-2xl w-full mx-auto pb-12 px-6",children:[p.jsx(b_,{children:"Status"}),p.jsx("div",{className:"mb-8",children:p.jsx(sf,{children:p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsx(ji,{className:"h-4 w-4 text-muted-foreground animate-spin"}),p.jsx("span",{className:"text-sm text-muted-foreground",children:m?`Connecting to your local ${ln} server...`:p.jsxs(p.Fragment,{children:["Not connected. Run ",p.jsx("code",{className:"bg-background border border-border rounded-md mx-0.5 p-1 font-mono text-xs text-foreground",children:Bh()})," from any terminal on this machine."]})})]})})}),m?null:p.jsxs("div",{className:"mb-10",children:[p.jsx(b_,{children:"How it works"}),p.jsx(sf,{children:p.jsxs("div",{className:"flex items-center justify-around gap-6 py-4 px-2",children:[p.jsx(x_,{icon:Mb,title:`${ln} CLI`,subtitle:"On Your Machine"}),p.jsx(YE,{}),p.jsx(x_,{icon:Eb,title:`${ln} Server`,subtitle:"Local WebSocket"}),p.jsx(YE,{}),p.jsx(x_,{icon:$C,title:`${ln} UI`,subtitle:"Project Chat"})]})})]}),m?null:p.jsxs("div",{className:"mb-10",children:[p.jsx(b_,{children:"Setup"}),p.jsx(sf,{children:p.jsxs("div",{className:"space-y-4",children:[p.jsxs(XE,{number:1,title:`Start ${ln}`,children:[p.jsx("p",{children:"Run this command in your terminal:"}),p.jsx(GE,{children:Bh()})]}),p.jsxs(XE,{number:2,title:"Open the local UI",children:[p.jsxs("p",{children:[ln," serves the app locally and opens the Local Projects page in an app-style browser window."]}),p.jsx(GE,{children:"http://localhost:3210/local"})]}),p.jsxs("div",{className:"mt-8",children:[p.jsx("h3",{className:"text-sm font-medium text-muted-foreground uppercase tracking-wider mb-4",children:"Notes"}),p.jsxs("div",{className:"space-y-3 text-sm",children:[p.jsxs("div",{className:"flex gap-4",children:[p.jsx("code",{className:"font-mono text-foreground whitespace-nowrap",children:Bh("").trim()}),p.jsx("span",{className:"text-muted-foreground",children:"Start in the current directory"})]}),p.jsxs("div",{className:"flex gap-4",children:[p.jsx("code",{className:"font-mono text-foreground whitespace-nowrap",children:Bh("--no-open")}),p.jsx("span",{className:"text-muted-foreground",children:"Start the server without opening the browser"})]})]})]})]})})]})]})]}),p.jsx(lte,{open:u,onOpenChange:h,onConfirm:_=>{l(_)}}),p.jsx("div",{className:"py-4 text-center",children:p.jsxs("span",{className:"text-xs text-muted-foreground/50",children:["v",Gb.split("/")[1]]})})]})}function hte(){const e=ub();return p.jsx("div",{className:"flex-1 flex flex-col min-w-0 relative",children:p.jsx(dte,{connectionStatus:e.connectionStatus,ready:e.localProjectsReady,snapshot:e.localProjects,startingLocalPath:e.startingLocalPath,commandError:e.commandError,onOpenProject:e.handleOpenLocalProject,onCreateProject:e.handleCreateProject})})}function ZE({children:e,className:t,icon:n,type:r="button",variant:s="outline",...a}){return p.jsxs("button",{type:r,className:ye(vb({variant:s,size:"sm"}),"h-auto gap-1.5 px-3 py-1.5",t),...a,children:[n,p.jsx("span",{children:e})]})}function QE(e,[t,n]){return Math.min(n,Math.max(t,e))}function fte(e){const t=y.useRef({value:e,previous:e});return y.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var pte=[" ","Enter","ArrowUp","ArrowDown"],mte=[" ","Enter"],oa="Select",[Yp,Xp,gte]=o0(oa),[Zl]=vs(oa,[gte,po]),Zp=po(),[vte,_o]=Zl(oa),[_te,yte]=Zl(oa),OD=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:s,onOpenChange:a,value:l,defaultValue:u,onValueChange:h,dir:d,name:m,autoComplete:g,disabled:_,required:b,form:w}=e,S=Zp(t),[C,k]=y.useState(null),[R,T]=y.useState(null),[N,L]=y.useState(!1),A=a0(d),[O,F]=Rl({prop:r,defaultProp:s??!1,onChange:a,caller:oa}),[G,B]=Rl({prop:l,defaultProp:u,onChange:h,caller:oa}),H=y.useRef(null),P=C?w||!!C.closest("form"):!0,[U,V]=y.useState(new Set),W=Array.from(U).map(z=>z.props.value).join(";");return p.jsx(Cp,{...S,children:p.jsxs(vte,{required:b,scope:t,trigger:C,onTriggerChange:k,valueNode:R,onValueNodeChange:T,valueNodeHasChildren:N,onValueNodeHasChildrenChange:L,contentId:ds(),value:G,onValueChange:B,open:O,onOpenChange:F,dir:A,triggerPointerDownPosRef:H,disabled:_,children:[p.jsx(Yp.Provider,{scope:t,children:p.jsx(_te,{scope:e.__scopeSelect,onNativeOptionAdd:y.useCallback(z=>{V($=>new Set($).add(z))},[]),onNativeOptionRemove:y.useCallback(z=>{V($=>{const q=new Set($);return q.delete(z),q})},[]),children:n})}),P?p.jsxs(i3,{"aria-hidden":!0,required:b,tabIndex:-1,name:m,autoComplete:g,value:G,onChange:z=>B(z.target.value),disabled:_,form:w,children:[G===void 0?p.jsx("option",{value:""}):null,Array.from(U)]},W):null]})})};OD.displayName=oa;var jD="SelectTrigger",LD=y.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...s}=e,a=Zp(n),l=_o(jD,n),u=l.disabled||r,h=yt(t,l.onTriggerChange),d=Xp(n),m=y.useRef("touch"),[g,_,b]=o3(S=>{const C=d().filter(T=>!T.disabled),k=C.find(T=>T.value===l.value),R=a3(C,S,k);R!==void 0&&l.onValueChange(R.value)}),w=S=>{u||(l.onOpenChange(!0),b()),S&&(l.triggerPointerDownPosRef.current={x:Math.round(S.pageX),y:Math.round(S.pageY)})};return p.jsx(Ju,{asChild:!0,...a,children:p.jsx(st.button,{type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:u,"data-disabled":u?"":void 0,"data-placeholder":s3(l.value)?"":void 0,...s,ref:h,onClick:Ae(s.onClick,S=>{S.currentTarget.focus(),m.current!=="mouse"&&w(S)}),onPointerDown:Ae(s.onPointerDown,S=>{m.current=S.pointerType;const C=S.target;C.hasPointerCapture(S.pointerId)&&C.releasePointerCapture(S.pointerId),S.button===0&&S.ctrlKey===!1&&S.pointerType==="mouse"&&(w(S),S.preventDefault())}),onKeyDown:Ae(s.onKeyDown,S=>{const C=g.current!=="";!(S.ctrlKey||S.altKey||S.metaKey)&&S.key.length===1&&_(S.key),!(C&&S.key===" ")&&pte.includes(S.key)&&(w(),S.preventDefault())})})})});LD.displayName=jD;var zD="SelectValue",PD=y.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,children:a,placeholder:l="",...u}=e,h=_o(zD,n),{onValueNodeHasChildrenChange:d}=h,m=a!==void 0,g=yt(t,h.onValueNodeChange);return Kn(()=>{d(m)},[d,m]),p.jsx(st.span,{...u,ref:g,style:{pointerEvents:"none"},children:s3(h.value)?p.jsx(p.Fragment,{children:l}):a})});PD.displayName=zD;var bte="SelectIcon",BD=y.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...s}=e;return p.jsx(st.span,{"aria-hidden":!0,...s,ref:t,children:r||"▼"})});BD.displayName=bte;var xte="SelectPortal",ID=e=>p.jsx(Il,{asChild:!0,...e});ID.displayName=xte;var aa="SelectContent",HD=y.forwardRef((e,t)=>{const n=_o(aa,e.__scopeSelect),[r,s]=y.useState();if(Kn(()=>{s(new DocumentFragment)},[]),!n.open){const a=r;return a?Ri.createPortal(p.jsx(FD,{scope:e.__scopeSelect,children:p.jsx(Yp.Slot,{scope:e.__scopeSelect,children:p.jsx("div",{children:e.children})})}),a):null}return p.jsx(UD,{...e,ref:t})});HD.displayName=aa;var li=10,[FD,yo]=Zl(aa),wte="SelectContentImpl",Ste=Zo("SelectContent.RemoveScroll"),UD=y.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:a,onPointerDownOutside:l,side:u,sideOffset:h,align:d,alignOffset:m,arrowPadding:g,collisionBoundary:_,collisionPadding:b,sticky:w,hideWhenDetached:S,avoidCollisions:C,...k}=e,R=_o(aa,n),[T,N]=y.useState(null),[L,A]=y.useState(null),O=yt(t,de=>N(de)),[F,G]=y.useState(null),[B,H]=y.useState(null),P=Xp(n),[U,V]=y.useState(!1),W=y.useRef(!1);y.useEffect(()=>{if(T)return vp(T)},[T]),mp();const z=y.useCallback(de=>{const[we,...oe]=P().map(Se=>Se.ref.current),[be]=oe.slice(-1),Ne=document.activeElement;for(const Se of de)if(Se===Ne||(Se==null||Se.scrollIntoView({block:"nearest"}),Se===we&&L&&(L.scrollTop=0),Se===be&&L&&(L.scrollTop=L.scrollHeight),Se==null||Se.focus(),document.activeElement!==Ne))return},[P,L]),$=y.useCallback(()=>z([F,T]),[z,F,T]);y.useEffect(()=>{U&&$()},[U,$]);const{onOpenChange:q,triggerPointerDownPosRef:Q}=R;y.useEffect(()=>{if(T){let de={x:0,y:0};const we=be=>{var Ne,Se;de={x:Math.abs(Math.round(be.pageX)-(((Ne=Q.current)==null?void 0:Ne.x)??0)),y:Math.abs(Math.round(be.pageY)-(((Se=Q.current)==null?void 0:Se.y)??0))}},oe=be=>{de.x<=10&&de.y<=10?be.preventDefault():T.contains(be.target)||q(!1),document.removeEventListener("pointermove",we),Q.current=null};return Q.current!==null&&(document.addEventListener("pointermove",we),document.addEventListener("pointerup",oe,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",we),document.removeEventListener("pointerup",oe,{capture:!0})}}},[T,q,Q]),y.useEffect(()=>{const de=()=>q(!1);return window.addEventListener("blur",de),window.addEventListener("resize",de),()=>{window.removeEventListener("blur",de),window.removeEventListener("resize",de)}},[q]);const[M,I]=o3(de=>{const we=P().filter(Ne=>!Ne.disabled),oe=we.find(Ne=>Ne.ref.current===document.activeElement),be=a3(we,de,oe);be&&setTimeout(()=>be.ref.current.focus())}),Z=y.useCallback((de,we,oe)=>{const be=!W.current&&!oe;(R.value!==void 0&&R.value===we||be)&&(G(de),be&&(W.current=!0))},[R.value]),j=y.useCallback(()=>T==null?void 0:T.focus(),[T]),ce=y.useCallback((de,we,oe)=>{const be=!W.current&&!oe;(R.value!==void 0&&R.value===we||be)&&H(de)},[R.value]),fe=r==="popper"?nb:$D,ue=fe===nb?{side:u,sideOffset:h,align:d,alignOffset:m,arrowPadding:g,collisionBoundary:_,collisionPadding:b,sticky:w,hideWhenDetached:S,avoidCollisions:C}:{};return p.jsx(FD,{scope:n,content:T,viewport:L,onViewportChange:A,itemRefCallback:Z,selectedItem:F,onItemLeave:j,itemTextRefCallback:ce,focusSelectedItem:$,selectedItemText:B,position:r,isPositioned:U,searchRef:M,children:p.jsx(Xu,{as:Ste,allowPinchZoom:!0,children:p.jsx(Yu,{asChild:!0,trapped:R.open,onMountAutoFocus:de=>{de.preventDefault()},onUnmountAutoFocus:Ae(s,de=>{var we;(we=R.trigger)==null||we.focus({preventScroll:!0}),de.preventDefault()}),children:p.jsx(Bl,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:de=>de.preventDefault(),onDismiss:()=>R.onOpenChange(!1),children:p.jsx(fe,{role:"listbox",id:R.contentId,"data-state":R.open?"open":"closed",dir:R.dir,onContextMenu:de=>de.preventDefault(),...k,...ue,onPlaced:()=>V(!0),ref:O,style:{display:"flex",flexDirection:"column",outline:"none",...k.style},onKeyDown:Ae(k.onKeyDown,de=>{const we=de.ctrlKey||de.altKey||de.metaKey;if(de.key==="Tab"&&de.preventDefault(),!we&&de.key.length===1&&I(de.key),["ArrowUp","ArrowDown","Home","End"].includes(de.key)){let be=P().filter(Ne=>!Ne.disabled).map(Ne=>Ne.ref.current);if(["ArrowUp","End"].includes(de.key)&&(be=be.slice().reverse()),["ArrowUp","ArrowDown"].includes(de.key)){const Ne=de.target,Se=be.indexOf(Ne);be=be.slice(Se+1)}setTimeout(()=>z(be)),de.preventDefault()}})})})})})})});UD.displayName=wte;var Cte="SelectItemAlignedPosition",$D=y.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...s}=e,a=_o(aa,n),l=yo(aa,n),[u,h]=y.useState(null),[d,m]=y.useState(null),g=yt(t,O=>m(O)),_=Xp(n),b=y.useRef(!1),w=y.useRef(!0),{viewport:S,selectedItem:C,selectedItemText:k,focusSelectedItem:R}=l,T=y.useCallback(()=>{if(a.trigger&&a.valueNode&&u&&d&&S&&C&&k){const O=a.trigger.getBoundingClientRect(),F=d.getBoundingClientRect(),G=a.valueNode.getBoundingClientRect(),B=k.getBoundingClientRect();if(a.dir!=="rtl"){const Ne=B.left-F.left,Se=G.left-Ne,_e=O.left-Se,xe=O.width+_e,He=Math.max(xe,F.width),Fe=window.innerWidth-li,et=QE(Se,[li,Math.max(li,Fe-He)]);u.style.minWidth=xe+"px",u.style.left=et+"px"}else{const Ne=F.right-B.right,Se=window.innerWidth-G.right-Ne,_e=window.innerWidth-O.right-Se,xe=O.width+_e,He=Math.max(xe,F.width),Fe=window.innerWidth-li,et=QE(Se,[li,Math.max(li,Fe-He)]);u.style.minWidth=xe+"px",u.style.right=et+"px"}const H=_(),P=window.innerHeight-li*2,U=S.scrollHeight,V=window.getComputedStyle(d),W=parseInt(V.borderTopWidth,10),z=parseInt(V.paddingTop,10),$=parseInt(V.borderBottomWidth,10),q=parseInt(V.paddingBottom,10),Q=W+z+U+q+$,M=Math.min(C.offsetHeight*5,Q),I=window.getComputedStyle(S),Z=parseInt(I.paddingTop,10),j=parseInt(I.paddingBottom,10),ce=O.top+O.height/2-li,fe=P-ce,ue=C.offsetHeight/2,de=C.offsetTop+ue,we=W+z+de,oe=Q-we;if(we<=ce){const Ne=H.length>0&&C===H[H.length-1].ref.current;u.style.bottom="0px";const Se=d.clientHeight-S.offsetTop-S.offsetHeight,_e=Math.max(fe,ue+(Ne?j:0)+Se+$),xe=we+_e;u.style.height=xe+"px"}else{const Ne=H.length>0&&C===H[0].ref.current;u.style.top="0px";const _e=Math.max(ce,W+S.offsetTop+(Ne?Z:0)+ue)+oe;u.style.height=_e+"px",S.scrollTop=we-ce+S.offsetTop}u.style.margin=`${li}px 0`,u.style.minHeight=M+"px",u.style.maxHeight=P+"px",r==null||r(),requestAnimationFrame(()=>b.current=!0)}},[_,a.trigger,a.valueNode,u,d,S,C,k,a.dir,r]);Kn(()=>T(),[T]);const[N,L]=y.useState();Kn(()=>{d&&L(window.getComputedStyle(d).zIndex)},[d]);const A=y.useCallback(O=>{O&&w.current===!0&&(T(),R==null||R(),w.current=!1)},[T,R]);return p.jsx(Ete,{scope:n,contentWrapper:u,shouldExpandOnScrollRef:b,onScrollButtonChange:A,children:p.jsx("div",{ref:h,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:N},children:p.jsx(st.div,{...s,ref:g,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});$D.displayName=Cte;var kte="SelectPopperPosition",nb=y.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:s=li,...a}=e,l=Zp(n);return p.jsx(kp,{...l,...a,ref:t,align:r,collisionPadding:s,style:{boxSizing:"border-box",...a.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});nb.displayName=kte;var[Ete,ox]=Zl(aa,{}),rb="SelectViewport",WD=y.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...s}=e,a=yo(rb,n),l=ox(rb,n),u=yt(t,a.onViewportChange),h=y.useRef(0);return p.jsxs(p.Fragment,{children:[p.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),p.jsx(Yp.Slot,{scope:n,children:p.jsx(st.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:u,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:Ae(s.onScroll,d=>{const m=d.currentTarget,{contentWrapper:g,shouldExpandOnScrollRef:_}=l;if(_!=null&&_.current&&g){const b=Math.abs(h.current-m.scrollTop);if(b>0){const w=window.innerHeight-li*2,S=parseFloat(g.style.minHeight),C=parseFloat(g.style.height),k=Math.max(S,C);if(k<w){const R=k+b,T=Math.min(w,R),N=R-T;g.style.height=T+"px",g.style.bottom==="0px"&&(m.scrollTop=N>0?N:0,g.style.justifyContent="flex-end")}}}h.current=m.scrollTop})})})]})});WD.displayName=rb;var VD="SelectGroup",[Rte,Tte]=Zl(VD),qD=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=ds();return p.jsx(Rte,{scope:n,id:s,children:p.jsx(st.div,{role:"group","aria-labelledby":s,...r,ref:t})})});qD.displayName=VD;var KD="SelectLabel",GD=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=Tte(KD,n);return p.jsx(st.div,{id:s.id,...r,ref:t})});GD.displayName=KD;var up="SelectItem",[Mte,YD]=Zl(up),XD=y.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:s=!1,textValue:a,...l}=e,u=_o(up,n),h=yo(up,n),d=u.value===r,[m,g]=y.useState(a??""),[_,b]=y.useState(!1),w=yt(t,R=>{var T;return(T=h.itemRefCallback)==null?void 0:T.call(h,R,r,s)}),S=ds(),C=y.useRef("touch"),k=()=>{s||(u.onValueChange(r),u.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return p.jsx(Mte,{scope:n,value:r,disabled:s,textId:S,isSelected:d,onItemTextChange:y.useCallback(R=>{g(T=>T||((R==null?void 0:R.textContent)??"").trim())},[]),children:p.jsx(Yp.ItemSlot,{scope:n,value:r,disabled:s,textValue:m,children:p.jsx(st.div,{role:"option","aria-labelledby":S,"data-highlighted":_?"":void 0,"aria-selected":d&&_,"data-state":d?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...l,ref:w,onFocus:Ae(l.onFocus,()=>b(!0)),onBlur:Ae(l.onBlur,()=>b(!1)),onClick:Ae(l.onClick,()=>{C.current!=="mouse"&&k()}),onPointerUp:Ae(l.onPointerUp,()=>{C.current==="mouse"&&k()}),onPointerDown:Ae(l.onPointerDown,R=>{C.current=R.pointerType}),onPointerMove:Ae(l.onPointerMove,R=>{var T;C.current=R.pointerType,s?(T=h.onItemLeave)==null||T.call(h):C.current==="mouse"&&R.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ae(l.onPointerLeave,R=>{var T;R.currentTarget===document.activeElement&&((T=h.onItemLeave)==null||T.call(h))}),onKeyDown:Ae(l.onKeyDown,R=>{var N;((N=h.searchRef)==null?void 0:N.current)!==""&&R.key===" "||(mte.includes(R.key)&&k(),R.key===" "&&R.preventDefault())})})})})});XD.displayName=up;var pu="SelectItemText",ZD=y.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,...a}=e,l=_o(pu,n),u=yo(pu,n),h=YD(pu,n),d=yte(pu,n),[m,g]=y.useState(null),_=yt(t,k=>g(k),h.onItemTextChange,k=>{var R;return(R=u.itemTextRefCallback)==null?void 0:R.call(u,k,h.value,h.disabled)}),b=m==null?void 0:m.textContent,w=y.useMemo(()=>p.jsx("option",{value:h.value,disabled:h.disabled,children:b},h.value),[h.disabled,h.value,b]),{onNativeOptionAdd:S,onNativeOptionRemove:C}=d;return Kn(()=>(S(w),()=>C(w)),[S,C,w]),p.jsxs(p.Fragment,{children:[p.jsx(st.span,{id:h.textId,...a,ref:_}),h.isSelected&&l.valueNode&&!l.valueNodeHasChildren?Ri.createPortal(a.children,l.valueNode):null]})});ZD.displayName=pu;var QD="SelectItemIndicator",JD=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return YD(QD,n).isSelected?p.jsx(st.span,{"aria-hidden":!0,...r,ref:t}):null});JD.displayName=QD;var ib="SelectScrollUpButton",e3=y.forwardRef((e,t)=>{const n=yo(ib,e.__scopeSelect),r=ox(ib,e.__scopeSelect),[s,a]=y.useState(!1),l=yt(t,r.onScrollButtonChange);return Kn(()=>{if(n.viewport&&n.isPositioned){let u=function(){const d=h.scrollTop>0;a(d)};const h=n.viewport;return u(),h.addEventListener("scroll",u),()=>h.removeEventListener("scroll",u)}},[n.viewport,n.isPositioned]),s?p.jsx(n3,{...e,ref:l,onAutoScroll:()=>{const{viewport:u,selectedItem:h}=n;u&&h&&(u.scrollTop=u.scrollTop-h.offsetHeight)}}):null});e3.displayName=ib;var sb="SelectScrollDownButton",t3=y.forwardRef((e,t)=>{const n=yo(sb,e.__scopeSelect),r=ox(sb,e.__scopeSelect),[s,a]=y.useState(!1),l=yt(t,r.onScrollButtonChange);return Kn(()=>{if(n.viewport&&n.isPositioned){let u=function(){const d=h.scrollHeight-h.clientHeight,m=Math.ceil(h.scrollTop)<d;a(m)};const h=n.viewport;return u(),h.addEventListener("scroll",u),()=>h.removeEventListener("scroll",u)}},[n.viewport,n.isPositioned]),s?p.jsx(n3,{...e,ref:l,onAutoScroll:()=>{const{viewport:u,selectedItem:h}=n;u&&h&&(u.scrollTop=u.scrollTop+h.offsetHeight)}}):null});t3.displayName=sb;var n3=y.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...s}=e,a=yo("SelectScrollButton",n),l=y.useRef(null),u=Xp(n),h=y.useCallback(()=>{l.current!==null&&(window.clearInterval(l.current),l.current=null)},[]);return y.useEffect(()=>()=>h(),[h]),Kn(()=>{var m;const d=u().find(g=>g.ref.current===document.activeElement);(m=d==null?void 0:d.ref.current)==null||m.scrollIntoView({block:"nearest"})},[u]),p.jsx(st.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:Ae(s.onPointerDown,()=>{l.current===null&&(l.current=window.setInterval(r,50))}),onPointerMove:Ae(s.onPointerMove,()=>{var d;(d=a.onItemLeave)==null||d.call(a),l.current===null&&(l.current=window.setInterval(r,50))}),onPointerLeave:Ae(s.onPointerLeave,()=>{h()})})}),Nte="SelectSeparator",r3=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return p.jsx(st.div,{"aria-hidden":!0,...r,ref:t})});r3.displayName=Nte;var ob="SelectArrow",Ate=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=Zp(n),a=_o(ob,n),l=yo(ob,n);return a.open&&l.position==="popper"?p.jsx(Ep,{...s,...r,ref:t}):null});Ate.displayName=ob;var Dte="SelectBubbleInput",i3=y.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const s=y.useRef(null),a=yt(r,s),l=fte(t);return y.useEffect(()=>{const u=s.current;if(!u)return;const h=window.HTMLSelectElement.prototype,m=Object.getOwnPropertyDescriptor(h,"value").set;if(l!==t&&m){const g=new Event("change",{bubbles:!0});m.call(u,t),u.dispatchEvent(g)}},[l,t]),p.jsx(st.select,{...n,style:{...rM,...n.style},ref:a,defaultValue:t})});i3.displayName=Dte;function s3(e){return e===""||e===void 0}function o3(e){const t=di(e),n=y.useRef(""),r=y.useRef(0),s=y.useCallback(l=>{const u=n.current+l;t(u),(function h(d){n.current=d,window.clearTimeout(r.current),d!==""&&(r.current=window.setTimeout(()=>h(""),1e3))})(u)},[t]),a=y.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return y.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,s,a]}function a3(e,t,n){const s=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,a=n?e.indexOf(n):-1;let l=Ote(e,Math.max(a,0));s.length===1&&(l=l.filter(d=>d!==n));const h=l.find(d=>d.textValue.toLowerCase().startsWith(s.toLowerCase()));return h!==n?h:void 0}function Ote(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var jte=OD,l3=LD,Lte=PD,zte=BD,Pte=ID,c3=HD,Bte=WD,Ite=qD,u3=GD,d3=XD,Hte=ZD,Fte=JD,h3=e3,f3=t3,p3=r3;const of=jte,af=Ite,lf=Lte,mu=y.forwardRef(({className:e,children:t,...n},r)=>p.jsxs(l3,{ref:r,className:ye("flex h-9 w-full items-center justify-between gap-2 rounded-lg border border-border bg-background px-3 py-2 text-sm text-foreground outline-none transition-colors","placeholder:text-muted-foreground","focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:ring-offset-background","disabled:cursor-not-allowed disabled:opacity-50","[&>span]:line-clamp-1",e),...n,children:[t,p.jsx(zte,{asChild:!0,children:p.jsx(wb,{className:"h-4 w-4 shrink-0 opacity-50"})})]}));mu.displayName=l3.displayName;const m3=y.forwardRef(({className:e,...t},n)=>p.jsx(h3,{ref:n,className:ye("flex cursor-default items-center justify-center py-1",e),...t,children:p.jsx(xP,{className:"h-4 w-4"})}));m3.displayName=h3.displayName;const g3=y.forwardRef(({className:e,...t},n)=>p.jsx(f3,{ref:n,className:ye("flex cursor-default items-center justify-center py-1",e),...t,children:p.jsx(wb,{className:"h-4 w-4"})}));g3.displayName=f3.displayName;const gu=y.forwardRef(({className:e,children:t,position:n="popper",...r},s)=>p.jsx(Pte,{children:p.jsxs(c3,{ref:s,className:ye("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-lg border border-border bg-background text-foreground shadow-md","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",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[p.jsx(m3,{}),p.jsx(Bte,{className:ye("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),p.jsx(g3,{})]})}));gu.displayName=c3.displayName;const Ute=y.forwardRef(({className:e,...t},n)=>p.jsx(u3,{ref:n,className:ye("px-2 py-1.5 text-sm font-semibold",e),...t}));Ute.displayName=u3.displayName;const pl=y.forwardRef(({className:e,children:t,...n},r)=>p.jsxs(d3,{ref:r,className:ye("relative flex w-full cursor-default select-none items-center rounded-md py-1.5 pl-2 pr-8 text-sm outline-none","focus:bg-accent focus:text-accent-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[p.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:p.jsx(Fte,{children:p.jsx(lo,{className:"h-4 w-4"})})}),p.jsx(Hte,{children:t})]}));pl.displayName=d3.displayName;const $te=y.forwardRef(({className:e,...t},n)=>p.jsx(p3,{ref:n,className:ye("-mx-1 my-1 h-px bg-border",e),...t}));$te.displayName=p3.displayName;const vu=[{id:"general",label:"General",icon:KB,subtitle:"Manage appearance, editor behavior, and embedded terminal defaults."},{id:"providers",label:"Providers",icon:SB,subtitle:"Manage the default chat provider and saved model defaults for Claude Code and Codex."},{id:"keybindings",label:"Keybindings",icon:AP,subtitle:"Edit global app shortcuts stored in the active keybindings file."},{id:"changelog",label:"Changelog",icon:lP,subtitle:"Release notes pulled from the public GitHub releases feed."}];function JE(e){return e&&vu.some(t=>t.id===e)?e:null}const Wte=[{value:"light",label:"Light",icon:iI},{value:"dark",label:"Dark",icon:RB},{value:"system",label:"System",icon:Eb}],Vte=[{value:"cursor",label:"Cursor"},{value:"vscode",label:"VS Code"},{value:"windsurf",label:"Windsurf"},{value:"custom",label:"Custom"}],qte=[{value:"never",label:"Never"},{value:"unfocused",label:"When Unfocused"},{value:"always",label:"Always"}],Kte=[{value:"enabled",label:"Enabled"},{value:"disabled",label:"Disabled"}],Gte="https://api.github.com/repos/jakemor/kanna/releases",Yte=300*1e3;let bl=null;const eR=Object.keys(xM);function Xte(e){return`Edit global app shortcuts stored in ${e}.`}function Zte(e){const t=(e==null?void 0:e.status)==="checking",n=(e==null?void 0:e.status)==="updating"||(e==null?void 0:e.status)==="restart_pending";return e!=null&&e.updateAvailable?{disabled:n,kind:"update",label:"Update",variant:"default"}:{disabled:t||n,kind:"check",label:"Check for updates",spinning:t,variant:"outline"}}function tR(e,t){return e!==t}async function Qte(e=fetch){const t=await e(Gte,{headers:{Accept:"application/vnd.github+json"}});if(!t.ok)throw new Error(`GitHub releases request failed with status ${t.status}`);return(await t.json()).filter(r=>!r.draft)}function Jte(){return bl?Date.now()>=bl.expiresAt?(bl=null,null):bl.releases:null}function ene(e){bl={releases:e,expiresAt:Date.now()+Yte}}async function nR(e){const t=e!=null&&e.force?null:Jte();if(t)return t;const n=await Qte(e==null?void 0:e.fetchImpl);return ene(n),n}function tne(e){if(!e)return"Unpublished";const t=new Date(e);return Number.isNaN(t.getTime())?"Unknown date":new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",year:"numeric"}).format(t)}function nne({status:e,releases:t,error:n,onRetry:r}){return p.jsxs("div",{className:"space-y-4",children:[e==="loading"||e==="idle"?p.jsx("div",{className:"flex min-h-[180px] items-center justify-center rounded-2xl border border-border bg-card/40 px-6 py-8 text-sm text-muted-foreground",children:p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsx(ji,{className:"h-4 w-4 animate-spin"}),p.jsx("span",{children:"Loading release notes…"})]})}):null,e==="error"?p.jsx("div",{className:"rounded-2xl border border-destructive/20 bg-destructive/5 px-6 py-5",children:p.jsxs("div",{className:"flex items-start justify-between gap-4",children:[p.jsxs("div",{children:[p.jsx("div",{className:"text-sm font-medium text-foreground",children:"Could not load changelog"}),p.jsx("div",{className:"mt-1 text-sm text-muted-foreground",children:n??"Unable to load changelog."})]}),p.jsx("button",{type:"button",onClick:r,className:"rounded-lg border border-border bg-background px-3 py-2 text-sm text-foreground transition-colors hover:bg-muted",children:"Retry"})]})}):null,e==="success"&&t.length===0?p.jsxs("div",{className:"rounded-2xl border border-border bg-card/30 px-6 py-8",children:[p.jsx("div",{className:"text-sm font-medium text-foreground",children:"No releases yet"}),p.jsx("div",{className:"mt-2 text-sm text-muted-foreground",children:"GitHub did not return any published releases for this repository."})]}):null,e==="success"&&t.length>0?t.map(s=>{var a,l;return p.jsxs("article",{className:"rounded-xl border border-border bg-card/30 pl-6 pr-4 py-4",children:[p.jsxs("div",{className:"flex flex-row items-center min-w-0 flex-1 gap-3 ",children:[p.jsxs("div",{className:"flex flex-row items-center min-w-0 flex-1 gap-3 ",children:[p.jsx("div",{className:"text-lg font-semibold tracking-[-0.2px] text-foreground",children:((a=s.name)==null?void 0:a.trim())||s.tag_name}),p.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2 text-xs text-muted-foreground",children:[p.jsx("span",{children:tne(s.published_at)}),s.prerelease?p.jsx("span",{className:"rounded-full border border-border px-2.5 py-1 uppercase tracking-wide",children:"Prerelease"}):null]})]}),p.jsxs("div",{className:"flex flex-row items-center justify-end min-w-0 flex-1 gap-3 ",children:[p.jsx("div",{className:"flex min-w-0 flex-wrap items-center gap-2 text-xs text-muted-foreground",children:p.jsx("span",{className:"rounded-full bg-muted px-2.5 py-1 font-mono text-foreground/80",children:s.tag_name})}),p.jsx("a",{href:s.html_url,target:"_blank",rel:"noopener noreferrer","aria-label":"View release on GitHub",className:ye(vb({variant:"ghost",size:"icon-sm"}),"h-8 w-8 shrink-0 rounded-md"),children:p.jsx(rne,{className:"h-4 w-4"})})]})]}),(l=s.body)!=null&&l.trim()?p.jsx("div",{className:"prose prose-sm mt-5 max-w-none text-foreground dark:prose-invert",children:p.jsx(Kl,{remarkPlugins:[Gl],components:H0,children:s.body})}):p.jsx("div",{className:"mt-5 text-sm text-muted-foreground",children:"No release notes were provided."})]},s.id)}):null]})}function rne({className:e}){return p.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",className:e,children:p.jsx("path",{d:"M12 .5C5.649.5.5 5.649.5 12A11.5 11.5 0 0 0 8.36 22.04c.575.106.785-.25.785-.556 0-.274-.01-1-.015-1.962-3.181.691-3.853-1.532-3.853-1.532-.52-1.322-1.27-1.674-1.27-1.674-1.038-.71.08-.695.08-.695 1.148.08 1.752 1.178 1.752 1.178 1.02 1.748 2.676 1.243 3.328.95.103-.738.399-1.243.725-1.53-2.54-.289-5.211-1.27-5.211-5.65 0-1.248.446-2.27 1.177-3.07-.118-.288-.51-1.45.112-3.024 0 0 .96-.307 3.145 1.173A10.91 10.91 0 0 1 12 6.03c.973.004 1.954.132 2.87.387 2.182-1.48 3.14-1.173 3.14-1.173.625 1.573.233 2.736.115 3.024.734.8 1.175 1.822 1.175 3.07 0 4.39-2.676 5.358-5.224 5.642.41.353.776 1.05.776 2.117 0 1.528-.014 2.761-.014 3.136 0 .309.207.668.79.555A11.502 11.502 0 0 0 23.5 12C23.5 5.649 18.351.5 12 .5Z"})})}function Vr({title:e,description:t,children:n,bordered:r=!0,alignStart:s=!1}){return p.jsx("div",{className:r?"border-t border-border":void 0,children:p.jsxs("div",{className:ye("flex flex-col gap-4 py-5 md:flex-row md:justify-between md:gap-8",s?"md:items-start":"md:items-center"),children:[p.jsxs("div",{className:"min-w-0 max-w-xl",children:[p.jsx("div",{className:"text-sm font-medium text-foreground",children:e}),p.jsx("div",{className:"mt-1 text-[13px] text-muted-foreground",children:t})]}),p.jsx("div",{className:"flex items-center justify-start md:shrink-0 md:justify-end",children:n})]})})}function ine(){var $e,ht;const e=Pl(),{sectionId:t}=CR(),n=ub(),{theme:r,setTheme:s}=wD(),[a,l]=y.useState("idle"),[u,h]=y.useState([]),[d,m]=y.useState(null),g=JE(t)??"general",_=n.connectionStatus==="connecting"||!n.localProjectsReady,b=(($e=n.localProjects)==null?void 0:$e.machine.displayName)??"Unavailable",w=((ht=n.localProjects)==null?void 0:ht.projects.length)??0,S=Gb.split("/")[1]??"unknown",C=Kr(ee=>ee.scrollbackLines),k=Kr(ee=>ee.minColumnWidth),R=Kr(ee=>ee.editorPreset),T=Kr(ee=>ee.editorCommandTemplate),N=Kr(ee=>ee.setScrollbackLines),L=Kr(ee=>ee.setMinColumnWidth),A=Kr(ee=>ee.setEditorPreset),O=Kr(ee=>ee.setEditorCommandTemplate),F=gl(ee=>ee.chatSoundPreference),G=gl(ee=>ee.chatSoundId),B=gl(ee=>ee.setChatSoundPreference),H=gl(ee=>ee.setChatSoundId),P=n.keybindings,U=er(ee=>ee.defaultProvider),V=er(ee=>ee.providerDefaults),W=er(ee=>ee.showTranscriptToc),z=er(ee=>ee.setDefaultProvider),$=er(ee=>ee.setShowTranscriptToc),q=er(ee=>ee.setProviderDefaultModel),Q=er(ee=>ee.setProviderDefaultModelOptions),M=er(ee=>ee.setProviderDefaultPlanMode),I=y.useMemo(()=>Yb(P),[P]),Z=I.filePathDisplay||p7(),[j,ce]=y.useState(String(C)),[fe,ue]=y.useState(String(k)),[de,we]=y.useState(T),[oe,be]=y.useState({}),[Ne,Se]=y.useState(null),_e=n.updateSnapshot,xe=Zte(_e),He=(_e==null?void 0:_e.status)==="checking"?"Checking for updates…":(_e==null?void 0:_e.status)==="updating"?"Installing update…":(_e==null?void 0:_e.status)==="restart_pending"?"Restarting Kanna…":(_e==null?void 0:_e.status)==="available"?`Update available${_e.latestVersion?`: ${_e.latestVersion}`:""}`:(_e==null?void 0:_e.status)==="up_to_date"?"Up to date":(_e==null?void 0:_e.status)==="error"?"Update check failed":"Not checked yet";y.useEffect(()=>{ce(String(C))},[C]),y.useEffect(()=>{ue(String(k))},[k]),y.useEffect(()=>{we(T)},[T]),y.useEffect(()=>{be(Object.fromEntries(eR.map(ee=>[ee,Nv(I.bindings[ee])])))},[I]),y.useEffect(()=>{t&&(JE(t)||e("/settings/general",{replace:!0}))},[e,t]),y.useEffect(()=>{if(g!=="changelog"||_)return;let ee=!1;return l("loading"),m(null),nR().then(Xe=>{ee||(h(Xe),l("success"))}).catch(Xe=>{ee||(m(Xe instanceof Error?Xe.message:"Unable to load changelog."),l("error"))}),()=>{ee=!0}},[_,g]);function Fe(){const ee=Number(j);if(!Number.isFinite(ee)){ce(String(C));return}N(ee)}function et(){const ee=Number(fe);if(!Number.isFinite(ee)){ue(String(k));return}L(ee)}function dt(ee,Xe){ee.key==="Enter"&&(Xe(),ee.currentTarget.blur())}function mt(ee,Xe){ee.key==="Enter"&&(Xe(),ee.currentTarget.blur())}function bt(){O(de)}function un(ee){tR(F,ee)&&(B(ee),L_(G,1).catch(()=>{}))}function Zt(ee){tR(G,ee)&&(H(ee),L_(ee,1).catch(()=>{}))}async function Nn(){try{Se(null),await n.socket.command({type:"settings.writeKeybindings",bindings:rR(oe)})}catch(ee){Se(ee instanceof Error?ee.message:"Unable to save keybindings.")}}async function Dt(ee){const Xe={...oe,[ee]:Nv(no[ee])};be(Xe);try{Se(null),await n.socket.command({type:"settings.writeKeybindings",bindings:rR(Xe)})}catch(gt){Se(gt instanceof Error?gt.message:"Unable to save keybindings.")}}function Yn(){bl=null,l("loading"),m(null),nR({force:!0}).then(ee=>{h(ee),l("success")}).catch(ee=>{m(ee instanceof Error?ee.message:"Unable to load changelog."),l("error")})}const Y=de.replaceAll("{path}","/Users/jake/Projects/kanna/src/client/app/App.tsx").replaceAll("{line}","12").replaceAll("{column}","1"),le=vu.find(ee=>ee.id===g)??vu[0],Re=g==="keybindings"?Xte(Z):le.subtitle,ze=!_;return p.jsxs("div",{className:"relative flex h-full flex-1 min-w-0 bg-background",children:[p.jsxs("div",{className:"flex min-w-0 flex-1",children:[p.jsx("aside",{className:`hidden w-[200px] shrink-0 md:block ${ze?"pb-[89px]":""}`,children:p.jsxs("div",{className:"flex flex-col gap-1 px-4 py-6",children:[p.jsx("div",{className:"px-3 pb-5 text-[22px] font-extrabold tracking-[-0.5px] text-foreground",children:"Settings"}),vu.map(ee=>p.jsx("button",{type:"button",onClick:()=>e(`/settings/${ee.id}`),className:`cursor-pointer rounded-lg px-3 py-2 text-sm ${ee.id===g?"bg-muted font-medium text-foreground":"text-muted-foreground hover:bg-muted/50 hover:text-foreground"}`,children:p.jsxs("div",{className:"flex items-center gap-2.5",children:[p.jsx(ee.icon,{className:"h-4 w-4 shrink-0"}),p.jsx("span",{children:ee.label})]})},ee.label))]})}),p.jsxs("div",{className:"min-w-0 flex-1 overflow-y-auto",children:[p.jsx("div",{className:"border-b border-border py-2 md:hidden",children:p.jsx("div",{className:"overflow-x-auto pr-4 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:p.jsxs("div",{className:"flex min-w-max items-center gap-2",children:[p.jsx("div",{className:" sticky left-0 bg-gradient-to-r from-background via-background/80 to-transparent px-2 py-1",children:p.jsx("button",{type:"button",onClick:n.openSidebar,className:"flex shrink-0 items-center p-2 text-sm text-muted-foreground transition-colors hover:bg-muted/50 hover:text-foreground","aria-label":"Open sidebar",title:"Open sidebar",children:p.jsx(kb,{className:"h-4 w-4 shrink-0"})})}),vu.map(ee=>p.jsxs("button",{type:"button",onClick:()=>e(`/settings/${ee.id}`),className:ye("flex shrink-0 items-center gap-2 rounded-full border px-3 py-2 text-sm transition-colors",ee.id===g?"border-transparent bg-muted font-medium text-foreground":"border-border bg-background text-muted-foreground hover:bg-muted/50 hover:text-foreground"),children:[p.jsx(ee.icon,{className:"h-4 w-4 shrink-0"}),p.jsx("span",{className:"whitespace-nowrap",children:ee.label})]},ee.label))]})})}),p.jsxs("div",{className:"w-full px-4 pb-32 pt-8 md:px-6 md:pt-16",children:[_?p.jsx("div",{className:"flex min-h-[240px] items-center justify-center rounded-2xl border border-border bg-card/40 px-4 py-6 text-sm text-muted-foreground",children:p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsx(ji,{className:"h-4 w-4 animate-spin"}),p.jsx("span",{children:"Loading machine settings…"})]})}):p.jsxs("div",{className:"mx-auto max-w-4xl",children:[p.jsxs("div",{className:"pb-6",children:[p.jsxs("div",{className:"flex items-center justify-between gap-4 min-h-[34px]",children:[p.jsx("div",{className:"text-lg font-semibold tracking-[-0.2px] text-foreground",children:le.label}),g==="keybindings"?p.jsxs(ZE,{onClick:()=>{n.handleOpenExternalPath("open_editor",Z)},icon:p.jsx(Sb,{className:"h-4 w-4"}),children:["Open in ",n.editorLabel]}):null,g==="general"?p.jsx("div",{className:"flex items-center gap-2",children:p.jsx(ZE,{variant:xe.variant,onClick:()=>{if(xe.kind==="update"){n.handleInstallUpdate();return}n.handleCheckForUpdates({force:!0})},disabled:xe.disabled,icon:xe.kind==="check"?p.jsx(BB,{className:ye("size-3.5",xe.spinning&&"animate-spin")}):xe.kind==="update"?p.jsx(RP,{className:ye("size-3.5")}):void 0,children:xe.label})}):null]}),p.jsx("div",{className:"mt-1 text-sm text-muted-foreground",children:Re})]}),g==="general"?p.jsx(p.Fragment,{children:p.jsxs("div",{className:"border-b border-border",children:[p.jsx(Vr,{title:"Application Update",description:p.jsxs(p.Fragment,{children:[p.jsxs("span",{children:[He,"."]}),_e!=null&&_e.lastCheckedAt?p.jsxs("span",{children:[" Last checked ",new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}).format(_e.lastCheckedAt),"."]}):null,_e!=null&&_e.error?p.jsxs("span",{children:[" ",_e.error]}):null]}),bordered:!1,children:p.jsxs("div",{className:"text-right text-sm text-foreground",children:[p.jsxs("div",{children:["Current: ",(_e==null?void 0:_e.currentVersion)??S]}),p.jsxs("div",{className:"text-xs text-muted-foreground",children:["Latest: ",(_e==null?void 0:_e.latestVersion)??"Unknown"]})]})}),p.jsx(Vr,{title:"Theme",description:"Choose between light, dark, or system appearance",children:p.jsx(tb,{value:r,onValueChange:s,options:Wte,size:"sm"})}),p.jsx(Vr,{title:"Chat Sounds",description:"Play a pop when a chat starts waiting on you or the unread chat count increases",children:p.jsxs(of,{value:F,onValueChange:ee=>un(ee),children:[p.jsx(mu,{className:"min-w-[180px]",children:p.jsx(lf,{})}),p.jsx(gu,{children:p.jsx(af,{children:qte.map(ee=>p.jsx(pl,{value:ee.value,children:ee.label},ee.value))})})]})}),p.jsx(Vr,{title:"Chat Sound",description:"The bundled sound used for chat notification playback and previews",children:p.jsxs(of,{value:G,onValueChange:ee=>Zt(ee),children:[p.jsx(mu,{className:"min-w-[180px]",children:p.jsx(lf,{})}),p.jsx(gu,{children:p.jsx(af,{children:x7.map(ee=>p.jsx(pl,{value:ee.value,children:ee.label},ee.value))})})]})}),p.jsx(Vr,{title:"Transcript Table of Contents",description:"Show a floating list of user messages in chat when the layout is wider than 1200 px",children:p.jsx(tb,{value:W?"enabled":"disabled",onValueChange:ee=>$(ee==="enabled"),options:Kte,size:"sm"})}),p.jsx(Vr,{title:"Default Editor",description:"Used by the navbar code button and local file links in chat",alignStart:!0,children:p.jsxs(of,{value:R,onValueChange:ee=>A(ee),children:[p.jsx(mu,{className:"min-w-[180px]",children:p.jsx(lf,{})}),p.jsx(gu,{children:p.jsx(af,{children:Vte.map(ee=>p.jsx(pl,{value:ee.value,children:ee.label},ee.value))})})]})}),R==="custom"?p.jsx("div",{className:"border-t border-border",children:p.jsxs("div",{className:"flex justify-between gap-8 py-5 pl-6",children:[p.jsxs("div",{className:"min-w-0 max-w-xl",children:[p.jsx("div",{className:"text-sm font-medium text-foreground",children:"Command Template"}),p.jsxs("div",{className:"mt-1 text-[13px] text-muted-foreground",children:["Include ","{path}"," and optionally ","{line}"," and ","{column}"," in your command."]})]}),p.jsxs("div",{className:"flex min-w-0 max-w-[420px] flex-1 flex-col items-stretch gap-2",children:[p.jsx(io,{type:"text",value:de,onChange:ee=>we(ee.target.value),onBlur:bt,onKeyDown:ee=>mt(ee,bt),className:"font-mono"}),p.jsxs("div",{className:"text-xs text-muted-foreground",children:["Preview: ",p.jsx("span",{className:"font-mono",children:Y})]})]})]})}):null,p.jsx(Vr,{title:"Terminal Scrollback",description:"Lines retained for embedded terminal history",children:p.jsxs("div",{className:"flex w-full min-w-0 flex-col items-stretch gap-2 md:w-auto md:items-end",children:[p.jsx(io,{type:"number",min:Gy,max:Yy,step:100,value:j,onChange:ee=>ce(ee.target.value),onBlur:Fe,onKeyDown:ee=>dt(ee,Fe),className:"hide-number-steppers w-full text-left font-mono md:w-28 md:text-right"}),p.jsxs("div",{className:"text-left text-xs text-muted-foreground md:text-right",children:[Gy,"-",Yy," lines",C===ap?" (default)":""]})]})}),p.jsx(Vr,{title:"Terminal Min Column Width",description:"Minimum width for each terminal pane",children:p.jsxs("div",{className:"flex w-full min-w-0 flex-col items-stretch gap-2 md:w-auto md:items-end",children:[p.jsx(io,{type:"number",min:Xy,max:Zy,step:10,value:fe,onChange:ee=>ue(ee.target.value),onBlur:et,onKeyDown:ee=>dt(ee,et),className:"hide-number-steppers w-full text-left font-mono md:w-28 md:text-right"}),p.jsxs("div",{className:"text-left text-xs text-muted-foreground md:text-right",children:[Xy,"-",Zy," px",k===lp?" (default)":""]})]})})]})}):g==="providers"?p.jsxs("div",{className:"border-b border-border",children:[p.jsx(Vr,{title:"Default Provider",description:"The default harness used for new chats before a provider is locked by an existing session.",bordered:!1,children:p.jsxs(of,{value:U,onValueChange:ee=>z(ee),children:[p.jsx(mu,{className:"min-w-[180px]",children:p.jsx(lf,{})}),p.jsx(gu,{children:p.jsxs(af,{children:[p.jsx(pl,{value:"last_used",children:"Last Used"}),bu.map(ee=>p.jsx(pl,{value:ee.id,children:ee.label},ee.id))]})})]})}),p.jsx(Vr,{title:"Claude Code Defaults",description:"Saved defaults when using Claude Code.",alignStart:!0,children:p.jsx("div",{className:"max-w-[420px]",children:p.jsx(G_,{availableProviders:bu,selectedProvider:"claude",showProviderPicker:!1,providerLocked:!0,model:V.claude.model,modelOptions:V.claude.modelOptions,onModelChange:(ee,Xe)=>{q("claude",Xe)},onModelOptionChange:ee=>{ee.type==="claudeReasoningEffort"?Q("claude",{reasoningEffort:ee.effort}):ee.type==="contextWindow"&&Q("claude",{contextWindow:ee.contextWindow})},planMode:V.claude.planMode,onPlanModeChange:ee=>M("claude",ee),includePlanMode:!0,className:"justify-start flex-wrap"})})}),p.jsx(Vr,{title:"Codex Defaults",description:"Saved defaults when using Codex.",alignStart:!0,children:p.jsx("div",{className:"max-w-[420px]",children:p.jsx(G_,{availableProviders:bu,selectedProvider:"codex",showProviderPicker:!1,providerLocked:!0,model:V.codex.model,modelOptions:V.codex.modelOptions,onModelChange:(ee,Xe)=>{q("codex",Xe)},onModelOptionChange:ee=>{ee.type==="codexReasoningEffort"?Q("codex",{reasoningEffort:ee.effort}):ee.type==="fastMode"&&Q("codex",{fastMode:ee.fastMode})},planMode:V.codex.planMode,onPlanModeChange:ee=>M("codex",ee),includePlanMode:!0,className:"justify-start flex-wrap"})})})]}):g==="keybindings"?p.jsxs("div",{className:"border-b border-border",children:[Ne?p.jsx("div",{className:"mb-4 rounded-2xl border border-destructive/20 bg-destructive/5 px-4 py-3 text-sm text-destructive",children:Ne}):null,I.warning?p.jsx("div",{className:"mb-4 rounded-2xl border border-border bg-card/30 px-4 py-3 text-sm text-muted-foreground",children:I.warning}):null,eR.map((ee,Xe)=>{const gt=Nv(no[ee]),ie=oe[ee]??"",Te=ie!==gt;return p.jsx(Vr,{title:xM[ee],description:p.jsxs(p.Fragment,{children:[p.jsx("span",{children:"Comma-separated shortcuts."}),Te?p.jsxs(p.Fragment,{children:[p.jsx("span",{children:" "}),p.jsxs("button",{type:"button",onClick:()=>{Dt(ee)},className:"inline rounded text-foreground hover:text-foreground/80",children:["Restore: ",gt]})]}):null]}),bordered:Xe!==0,children:p.jsx("div",{className:"flex min-w-0 max-w-[420px] flex-1 flex-col items-stretch gap-2",children:p.jsx(io,{type:"text",value:ie,onChange:ct=>{const xt=ct.target.value;be(dn=>({...dn,[ee]:xt}))},onBlur:()=>{Nn()},onKeyDown:ct=>mt(ct,()=>{Nn()}),className:"font-mono"})})},ee)})]}):p.jsx(nne,{status:a,releases:u,error:d,onRetry:Yn})]}),n.commandError?p.jsxs("div",{className:"mx-auto mt-4 flex max-w-4xl items-start gap-3 rounded-2xl border border-destructive/20 bg-destructive/5 px-4 py-3 text-sm text-destructive",children:[p.jsx(dB,{className:"mt-0.5 h-4 w-4 flex-shrink-0"}),p.jsx("span",{children:n.commandError})]}):null]})]})]}),ze?p.jsx("div",{className:"absolute bottom-0 left-0 right-0 border-t border-border bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/80",children:p.jsx("div",{className:"px-6 py-[14.25px]",children:p.jsxs("div",{className:"grid gap-3 text-xs text-muted-foreground grid-cols-2 lg:grid-cols-4",children:[p.jsxs("div",{children:[p.jsx("div",{className:"mb-1 uppercase tracking-wide text-[11px] text-muted-foreground/80",children:"Machine"}),p.jsx("div",{className:"text-foreground/80",children:b})]}),p.jsxs("div",{className:"hidden md:block",children:[p.jsx("div",{className:"mb-1 uppercase tracking-wide text-[11px] text-muted-foreground/80",children:"Connection"}),p.jsx("div",{className:"text-foreground/80",children:n.connectionStatus})]}),p.jsxs("div",{className:"hidden md:block",children:[p.jsx("div",{className:"mb-1 uppercase tracking-wide text-[11px] text-muted-foreground/80",children:"Projects Indexed"}),p.jsx("div",{className:"text-foreground/80",children:w})]}),p.jsxs("div",{children:[p.jsx("div",{className:"mb-1 uppercase tracking-wide text-[11px] text-muted-foreground/80",children:"App Version"}),p.jsx("div",{className:"text-foreground/80",children:S})]})]})})}):null]})}function rR(e){return{toggleEmbeddedTerminal:qc(e.toggleEmbeddedTerminal??""),toggleRightSidebar:qc(e.toggleRightSidebar??""),openInFinder:qc(e.openInFinder??""),openInEditor:qc(e.openInEditor??""),addSplitTerminal:qc(e.addSplitTerminal??"")}}function cf(e){return!e||typeof e!="object"||Array.isArray(e)?null:e}function sne(e){if(typeof e!="string")return e;try{return JSON.parse(e)}catch{return e}}function one(e){const t=e&&typeof e=="object"&&"content"in e&&Array.isArray(e.content)?e.content:Array.isArray(e)?e:[],n=[];for(const r of t)if(!(!r||typeof r!="object"||!("type"in r))){if(r.type==="text"&&typeof r.text=="string"){n.push({type:"text",text:r.text});continue}if(r.type==="image"){if("data"in r&&typeof r.data=="string"){n.push({type:"image",data:r.data,mimeType:typeof r.mimeType=="string"?r.mimeType:void 0});continue}"source"in r&&r.source&&typeof r.source=="object"&&"type"in r.source&&r.source.type==="base64"&&"data"in r.source&&typeof r.source.data=="string"&&n.push({type:"image",data:r.source.data,mimeType:typeof r.source.media_type=="string"?r.source.media_type:void 0})}}return n}function ane(e,t){const n=sne(t);switch(e.toolKind){case"ask_user_question":{const a=cf(n),l=cf(a==null?void 0:a.answers)??(a||{});return{answers:Object.fromEntries(Object.entries(l).map(([u,h])=>Array.isArray(h)?[u,h.map(d=>String(d))]:h&&typeof h=="object"&&Array.isArray(h.answers)?[u,h.answers.map(d=>String(d))]:h==null||h===""?[u,[]]:[u,[String(h)]])),...(a==null?void 0:a.discarded)===!0?{discarded:!0}:{}}}case"exit_plan_mode":{const a=cf(n);return{confirmed:typeof(a==null?void 0:a.confirmed)=="boolean"?a.confirmed:void 0,clearContext:typeof(a==null?void 0:a.clearContext)=="boolean"?a.clearContext:void 0,message:typeof(a==null?void 0:a.message)=="string"?a.message:void 0,...(a==null?void 0:a.discarded)===!0?{discarded:!0}:{}}}case"read_file":if(typeof n=="string")return n;const r=one(n);if(r.length>0)return{content:r.flatMap(a=>a.type==="text"?[a.text]:[]).join(""),blocks:r};const s=cf(n);return{content:typeof(s==null?void 0:s.content)=="string"?s.content:JSON.stringify(n,null,2)};default:return n}}function v3(e){return new Date(e).toISOString()}function oi(e){return{id:e._id,messageId:e.messageId,timestamp:v3(e.createdAt),hidden:e.hidden}}function lne(e){return{id:e._id,messageId:e.messageId,hidden:e.hidden,kind:"tool",toolKind:e.tool.toolKind,toolName:e.tool.toolName,toolId:e.tool.toolId,input:e.tool.input,timestamp:v3(e.createdAt)}}function cne(e){if(e.debugRaw)try{return JSON.parse(e.debugRaw).tool_use_result}catch{return}}function une(e){const t=new Map,n=[];for(const r of e)switch(r.kind){case"user_prompt":n.push({...oi(r),kind:"user_prompt",content:r.content,attachments:r.attachments??[]});break;case"system_init":n.push({...oi(r),kind:"system_init",provider:r.provider,model:r.model,tools:r.tools,agents:r.agents,slashCommands:r.slashCommands,mcpServers:r.mcpServers,debugRaw:r.debugRaw});break;case"account_info":n.push({...oi(r),kind:"account_info",accountInfo:r.accountInfo});break;case"assistant_text":n.push({...oi(r),kind:"assistant_text",text:r.text});break;case"tool_call":{const s=lne(r);t.set(r.tool.toolId,{hydrated:s,normalized:r.tool}),n.push(s);break}case"tool_result":{const s=t.get(r.toolId);if(s){const a=s.normalized.toolKind==="ask_user_question"||s.normalized.toolKind==="exit_plan_mode"?cne(r)??r.content:r.content;s.hydrated.result=ane(s.normalized,a),s.hydrated.rawResult=a,s.hydrated.isError=r.isError}break}case"result":n.push({...oi(r),kind:"result",success:!r.isError,cancelled:r.subtype==="cancelled",result:r.result,durationMs:r.durationMs,costUsd:r.costUsd});break;case"status":n.push({...oi(r),kind:"status",status:r.status});break;case"compact_boundary":n.push({...oi(r),kind:"compact_boundary"});break;case"compact_summary":n.push({...oi(r),kind:"compact_summary",summary:r.summary});break;case"context_cleared":n.push({...oi(r),kind:"context_cleared"});break;case"interrupted":n.push({...oi(r),kind:"interrupted"});break;default:n.push({...oi(r),kind:"unknown",json:JSON.stringify(r,null,2)});break}return n}const dne=["AskUserQuestion","ExitPlanMode","TodoWrite"],hne=new Set(["TodoWrite"]);function fne(e,t){for(let n=e.length-1;n>=0;n-=1){const r=e[n];if(r.kind!=="tool")continue;const s=r;if(s.toolName===t&&!s.result)return s.id}return null}function pne(e,t){for(let n=e.length-1;n>=0;n-=1){const r=e[n];if(r.kind!=="tool")continue;const s=r;if(s.toolName===t)return s.id}return null}function mne(e){const t={};for(const n of dne)t[n]=hne.has(n)?pne(e,n):fne(e,n);return t}function gne(e){return e==="starting"||e==="running"||e==="waiting_for_user"}function vne(e){return e==="starting"||e==="running"||e==="waiting_for_user"}const _ne=25e3,yne=15e3,bne=4e3;class xne{constructor(t){fn(this,"url");fn(this,"ws",null);fn(this,"started",!1);fn(this,"reconnectTimer",null);fn(this,"reconnectDelayMs",750);fn(this,"subscriptions",new Map);fn(this,"pending",new Map);fn(this,"outboundQueue",[]);fn(this,"statusListeners",new Set);fn(this,"heartbeatTimer",null);fn(this,"pingTimeoutTimer",null);fn(this,"pingPromise",null);fn(this,"lastOpenAt",0);fn(this,"lastMessageAt",0);fn(this,"reconnectImmediatelyOnClose",!1);fn(this,"handleWindowFocus",()=>{this.ensureHealthyConnection()});fn(this,"handleVisibilityChange",()=>{if(document.visibilityState==="visible"){this.startHeartbeat(),this.ensureHealthyConnection();return}this.stopHeartbeat()});fn(this,"handleOnline",()=>{this.ensureHealthyConnection()});this.url=t}start(){this.started||(this.started=!0,window.addEventListener("focus",this.handleWindowFocus),window.addEventListener("online",this.handleOnline),document.addEventListener("visibilitychange",this.handleVisibilityChange),this.connect())}dispose(){var t;this.started=!1,this.reconnectTimer&&(window.clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.stopHeartbeat(),this.clearPingState(),window.removeEventListener("focus",this.handleWindowFocus),window.removeEventListener("online",this.handleOnline),document.removeEventListener("visibilitychange",this.handleVisibilityChange),(t=this.ws)==null||t.close(),this.ws=null;for(const n of this.pending.values())n.reject(new Error("Socket disposed"));this.pending.clear()}onStatus(t){return this.statusListeners.add(t),t(this.getStatus()),()=>{this.statusListeners.delete(t)}}subscribe(t,n,r){const s=vv();return this.subscriptions.set(s,{topic:t,listener:n,eventListener:r}),this.enqueue({v:1,type:"subscribe",id:s,topic:t}),()=>{this.subscriptions.delete(s),this.enqueue({v:1,type:"unsubscribe",id:s})}}subscribeTerminal(t,n){const r=vv(),s={type:"terminal",terminalId:t};return this.subscriptions.set(r,{topic:s,listener:n.onSnapshot,eventListener:n.onEvent}),this.enqueue({v:1,type:"subscribe",id:r,topic:s}),()=>{this.subscriptions.delete(r),this.enqueue({v:1,type:"unsubscribe",id:r})}}command(t){const n=vv(),r={v:1,type:"command",id:n,command:t};return new Promise((s,a)=>{this.pending.set(n,{resolve:s,reject:a}),this.enqueue(r)})}ensureHealthyConnection(){return!this.ws||this.ws.readyState===WebSocket.CLOSED||this.ws.readyState===WebSocket.CLOSING?(this.reconnectNow(),Promise.resolve()):this.ws.readyState===WebSocket.CONNECTING||!this.isConnectionStale()?Promise.resolve():this.sendPing()}connect(){this.started&&(this.emitStatus("connecting"),this.ws=new WebSocket(this.url),this.ws.addEventListener("open",()=>{this.reconnectDelayMs=750,this.reconnectImmediatelyOnClose=!1,this.lastOpenAt=Date.now(),this.lastMessageAt=this.lastOpenAt,this.emitStatus("connected"),this.startHeartbeat();for(const[t,n]of this.subscriptions.entries())this.sendNow({v:1,type:"subscribe",id:t,topic:n.topic});for(;this.outboundQueue.length>0;){const t=this.outboundQueue.shift();t&&this.sendNow(t)}}),this.ws.addEventListener("message",t=>{var r;this.lastMessageAt=Date.now();let n;try{n=JSON.parse(String(t.data))}catch{return}if(n.type==="snapshot"){const s=this.subscriptions.get(n.id);s==null||s.listener(n.snapshot.data);return}if(n.type==="event"){const s=this.subscriptions.get(n.id);(r=s==null?void 0:s.eventListener)==null||r.call(s,n.event);return}if(n.type==="ack"){const s=this.pending.get(n.id);if(!s)return;this.pending.delete(n.id),s.resolve(n.result);return}if(n.type==="error"){if(!n.id){console.error(c7,n.message);return}const s=this.pending.get(n.id);if(!s)return;this.pending.delete(n.id),s.reject(new Error(n.message))}}),this.ws.addEventListener("close",()=>{if(!this.started)return;const t=this.reconnectImmediatelyOnClose;this.reconnectImmediatelyOnClose=!1,this.stopHeartbeat(),this.clearPingState(),this.emitStatus("disconnected");for(const n of this.pending.values())n.reject(new Error("Disconnected"));if(this.pending.clear(),t){this.connect();return}this.scheduleReconnect()}))}scheduleReconnect(){this.reconnectTimer===null&&(this.reconnectTimer=window.setTimeout(()=>{this.reconnectTimer=null,this.connect(),this.reconnectDelayMs=Math.min(this.reconnectDelayMs*2,5e3)},this.reconnectDelayMs))}getStatus(){var t,n;return((t=this.ws)==null?void 0:t.readyState)===WebSocket.OPEN?"connected":((n=this.ws)==null?void 0:n.readyState)===WebSocket.CONNECTING?"connecting":"disconnected"}emitStatus(t){for(const n of this.statusListeners)n(t)}isConnectionStale(){const t=Math.max(this.lastMessageAt,this.lastOpenAt);return t>0&&Date.now()-t>=_ne}sendPing(){if(this.pingPromise)return this.pingPromise;const t=this.command({type:"system.ping"}).then(()=>{this.clearPingState()}).catch(n=>{throw this.clearPingState(),this.reconnectNow(),n});return this.pingTimeoutTimer=window.setTimeout(()=>{this.clearPingState(),this.reconnectNow()},bne),this.pingPromise=t,t}reconnectNow(){if(this.reconnectTimer!==null&&(window.clearTimeout(this.reconnectTimer),this.reconnectTimer=null),!this.ws||this.ws.readyState===WebSocket.CLOSED){this.connect();return}this.ws.readyState!==WebSocket.CONNECTING&&(this.reconnectImmediatelyOnClose=!0,this.ws.close())}startHeartbeat(){document.visibilityState==="visible"&&this.heartbeatTimer===null&&(this.heartbeatTimer=window.setInterval(()=>{var t;if(document.visibilityState!=="visible"){this.stopHeartbeat();return}((t=this.ws)==null?void 0:t.readyState)===WebSocket.OPEN&&this.ensureHealthyConnection()},yne))}stopHeartbeat(){this.heartbeatTimer!==null&&(window.clearInterval(this.heartbeatTimer),this.heartbeatTimer=null)}clearPingState(){this.pingTimeoutTimer!==null&&(window.clearTimeout(this.pingTimeoutTimer),this.pingTimeoutTimer=null),this.pingPromise=null}enqueue(t){var n;if(((n=this.ws)==null?void 0:n.readyState)===WebSocket.OPEN){this.sendNow(t);return}this.outboundQueue.push(t)}sendNow(t){var n;(n=this.ws)==null||n.send(JSON.stringify(t))}}function wne(e,t){var r;const n=e.find(s=>s.chats.some(a=>a.chatId===t));return n?((r=n.chats.find(s=>s.chatId!==t))==null?void 0:r.chatId)??null:null}function Sne(e=document){return e.visibilityState==="visible"&&e.hasFocus()}function Cne(){return`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`}function kne(){const e=y.useRef(null);return e.current||(e.current=new xne(Cne())),y.useEffect(()=>{const t=e.current;return t==null||t.start(),()=>{t==null||t.dispose()}},[]),e.current}function _u(e,t){if(t===void 0){console.info(`[useKannaState] ${e}`);return}console.info(`[useKannaState] ${e}`,t)}function Ene(e){var t,n;return(e==null?void 0:e.provider)==="claude"&&e.model&&((t=e.modelOptions)!=null&&t.claude)?{provider:"claude",model:e.model,modelOptions:{reasoningEffort:e.modelOptions.claude.reasoningEffort??"high",contextWindow:e.modelOptions.claude.contextWindow??"200k"},planMode:!!e.planMode}:(e==null?void 0:e.provider)==="codex"&&e.model&&((n=e.modelOptions)!=null&&n.codex)?{provider:"codex",model:e.model,modelOptions:{reasoningEffort:e.modelOptions.codex.reasoningEffort??"high",fastMode:e.modelOptions.codex.fastMode??!1},planMode:!!e.planMode}:null}function Rne(e){return e<24}function Tne(e,t){return e==="awaiting_disconnect"&&t==="disconnected"?"awaiting_reconnect":e==="awaiting_reconnect"&&t==="connected"?"navigate_changelog":"none"}const Mne=320,ax="kanna:ui-update-restart";function Nne(){return window.sessionStorage.getItem(ax)}function iR(e){window.sessionStorage.setItem(ax,e)}function w_(){window.sessionStorage.removeItem(ax)}function Ane(e){const t=e.selectedProjectId??e.sidebarProjectId??null;return t?{kind:"project_id",projectId:t}:e.fallbackLocalProjectPath?{kind:"local_path",localPath:e.fallbackLocalProjectPath}:null}function Dne(e,t){return!e||!t?null:e.runtime.chatId!==t?(_u("stale snapshot masked",{routeChatId:t,snapshotChatId:e.runtime.chatId,snapshotProvider:e.runtime.provider}),null):e}function One(e){var Lt,Dn,On;const t=Pl(),n=kne(),r=wI(),[s,a]=y.useState({projectGroups:[]}),[l,u]=y.useState(null),[h,d]=y.useState(null),[m,g]=y.useState(null),[_,b]=y.useState(null),[w,S]=y.useState("connecting"),[C,k]=y.useState(!1),[R,T]=y.useState(!1),[N,L]=y.useState(!1),[A,O]=y.useState(null),[F,G]=y.useState(!1),[B,H]=y.useState(!1),[P,U]=y.useState(148),[V,W]=y.useState(!0),[z,$]=y.useState(null),[q,Q]=y.useState(null),[M,I]=y.useState(null),[Z,j]=y.useState(0),ce=ree(Kr(re=>re.editorPreset)),fe=y.useRef(null),ue=y.useRef(null),de=y.useRef(!1),we=y.useRef(null);y.useEffect(()=>n.onStatus(S),[n]),y.useEffect(()=>n.subscribe({type:"sidebar"},re=>{a(re),k(!0),$(null)}),[n]),y.useEffect(()=>n.subscribe({type:"local-projects"},re=>{u(re),T(!0),$(null)}),[n]),y.useEffect(()=>n.subscribe({type:"update"},re=>{d(re),$(null)}),[n]),y.useEffect(()=>{w==="connected"&&n.command({type:"update.check",force:!0}).catch(re=>{$(re instanceof Error?re.message:String(re))})},[w,n]),y.useEffect(()=>{const re=Nne(),ve=Tne(re,w);if(ve==="awaiting_reconnect"){iR("awaiting_reconnect");return}ve==="navigate_changelog"&&(w_(),t("/settings/changelog",{replace:!0}))},[w,t]),y.useEffect(()=>{function re(){h!=null&&h.lastCheckedAt&&(Date.now()-h.lastCheckedAt<=3600*1e3||n.command({type:"update.check"}).catch(ve=>{$(ve instanceof Error?ve.message:String(ve))}))}return window.addEventListener("focus",re),()=>{window.removeEventListener("focus",re)}},[n,h==null?void 0:h.lastCheckedAt]),y.useEffect(()=>n.subscribe({type:"keybindings"},re=>{b(re),$(null)}),[n]),y.useEffect(()=>{function re(){j(ve=>ve+1)}return window.addEventListener("focus",re),document.addEventListener("visibilitychange",re),()=>{window.removeEventListener("focus",re),document.removeEventListener("visibilitychange",re)}},[]),y.useEffect(()=>{if(!e){_u("clearing chat snapshot for non-chat route"),g(null),L(!0);return}return _u("subscribing to chat",{activeChatId:e}),g(null),L(!1),n.subscribe({type:"chat",chatId:e},re=>{_u("chat snapshot received",{activeChatId:e,snapshotChatId:(re==null?void 0:re.runtime.chatId)??null,snapshotProvider:(re==null?void 0:re.runtime.provider)??null,snapshotStatus:(re==null?void 0:re.runtime.status)??null}),g(re),L(!0),$(null)})},[e,n]),y.useEffect(()=>{if(A)return;const re=s.projectGroups[0];re&&O(re.groupKey)},[A,s.projectGroups]),y.useEffect(()=>{if(!e||!C||!N)return;if(s.projectGroups.some(ve=>ve.chats.some(We=>We.chatId===e))){M===e&&I(null);return}M!==e&&t("/")},[e,N,t,M,s.projectGroups,C]),y.useEffect(()=>{m&&(O(m.runtime.projectId),M===m.runtime.chatId&&I(null))},[m,M]),y.useEffect(()=>{if(!e||!C||!Sne())return;const re=s.projectGroups.flatMap(ve=>ve.chats).find(ve=>ve.chatId===e);re!=null&&re.unread&&n.command({type:"chat.markRead",chatId:e}).catch(ve=>{$(ve instanceof Error?ve.message:String(ve))})},[e,Z,s.projectGroups,C,n]),y.useEffect(()=>{de.current=!1,we.current!==null&&(window.cancelAnimationFrame(we.current),we.current=null),W(!0)},[e]),y.useEffect(()=>()=>{we.current!==null&&window.cancelAnimationFrame(we.current)},[]),y.useLayoutEffect(()=>{const re=ue.current;if(!re)return;const ve=new ResizeObserver(()=>{U(re.getBoundingClientRect().height)});return ve.observe(re),U(re.getBoundingClientRect().height),()=>ve.disconnect()},[]);const oe=y.useMemo(()=>Dne(m,e),[e,m]);y.useEffect(()=>{_u("active snapshot resolved",{routeChatId:e,rawSnapshotChatId:(m==null?void 0:m.runtime.chatId)??null,rawSnapshotProvider:(m==null?void 0:m.runtime.provider)??null,activeSnapshotChatId:(oe==null?void 0:oe.runtime.chatId)??null,activeSnapshotProvider:(oe==null?void 0:oe.runtime.provider)??null,pendingChatId:M})},[e,oe,m,M]);const be=y.useMemo(()=>une((oe==null?void 0:oe.messages)??[]),[oe==null?void 0:oe.messages]),Ne=y.useMemo(()=>mne(be),[be]),Se=(oe==null?void 0:oe.runtime)??null,_e=(oe==null?void 0:oe.availableProviders)??bu,xe=vne(Se==null?void 0:Se.status),He=gne(Se==null?void 0:Se.status),Fe=Mne,et=!V&&be.length>0,dt=((Lt=l==null?void 0:l.projects[0])==null?void 0:Lt.localPath)??null,mt=(Se==null?void 0:Se.localPath)??dt??((Dn=s.projectGroups[0])==null?void 0:Dn.localPath),bt=!!(A??(Se==null?void 0:Se.projectId)??((On=s.projectGroups[0])==null?void 0:On.groupKey)??dt);y.useLayoutEffect(()=>{if(de.current)return;const re=fe.current;re&&(e&&!Se||(re.scrollTo({top:re.scrollHeight,behavior:"auto"}),we.current!==null&&window.cancelAnimationFrame(we.current),we.current=window.requestAnimationFrame(()=>{const ve=fe.current;ve&&(ve.scrollTo({top:ve.scrollHeight,behavior:"auto"}),we.current=null)}),de.current=!0))},[e,P,be.length,Se]),y.useEffect(()=>{if(!de.current||!V)return;const re=window.requestAnimationFrame(()=>{const ve=fe.current;!ve||!V||ve.scrollTo({top:ve.scrollHeight,behavior:"auto"})});return()=>window.cancelAnimationFrame(re)},[e,P,V,be.length,Se==null?void 0:Se.status]);function un(){const re=fe.current;if(!re)return;const ve=re.scrollHeight-re.scrollTop-re.clientHeight;W(Rne(ve))}function Zt(re){const ve=fe.current;W(!0),ve&&ve.scrollTo({top:ve.scrollHeight,behavior:re})}function Nn(){Zt("smooth")}async function Dt(re){const ve=er.getState(),We=e?ve.getComposerState(e):ve.getComposerState(K_),Ve=await n.command({type:"chat.create",projectId:re});ve.initializeComposerForChat(Ve.chatId,{sourceState:We}),O(re),I(Ve.chatId),t(`/chat/${Ve.chatId}`),G(!1),$(null)}async function Yn(re){return re.kind==="project_id"?{projectId:re.projectId}:re.kind==="local_path"?{projectId:(await n.command({type:"project.open",localPath:re.localPath})).projectId,localPath:re.localPath}:{projectId:(await n.command(re.project.mode==="new"?{type:"project.create",localPath:re.project.localPath,title:re.project.title}:{type:"project.open",localPath:re.project.localPath})).projectId,localPath:re.project.localPath}}async function Y(re){try{const ve=re.kind==="project_id"?null:re.kind==="local_path"?re.localPath:re.project.localPath;ve&&Q(ve);const{projectId:We}=await Yn(re);await Dt(We)}catch(ve){$(ve instanceof Error?ve.message:String(ve))}finally{Q(null)}}async function le(re){await Y({kind:"project_id",projectId:re})}async function Re(re){await Y({kind:"local_path",localPath:re})}async function ze(re){await Y({kind:"project_request",project:re})}async function $e(re){try{await n.command({type:"update.check",force:re==null?void 0:re.force}),$(null)}catch(ve){$(ve instanceof Error?ve.message:String(ve))}}async function ht(){try{const re=await n.command({type:"update.install"});if(!re.ok){w_(),$(null),await r.alert({title:re.userTitle??"Update failed",description:re.userMessage??"Kanna could not install the update. Try again later.",closeLabel:"OK"});return}if(re.ok&&re.action==="reload"){window.location.reload();return}re.ok&&re.action==="restart"&&iR("awaiting_disconnect"),$(null)}catch(re){w_(),$(re instanceof Error?re.message:String(re))}}async function ee(re,ve){var We;try{let Ve=A??((We=s.projectGroups[0])==null?void 0:We.groupKey)??null;if(!e&&!Ve&&dt&&(Ve=(await n.command({type:"project.open",localPath:dt})).projectId,O(Ve)),!e&&!Ve)throw new Error("Open a project first");Zt("auto");const wt=await n.command({type:"chat.send",chatId:e??void 0,projectId:e?void 0:Ve??void 0,provider:ve==null?void 0:ve.provider,content:re,attachments:ve==null?void 0:ve.attachments,model:ve==null?void 0:ve.model,modelOptions:ve==null?void 0:ve.modelOptions,planMode:ve==null?void 0:ve.planMode});if(!e&&wt.chatId){const jn=er.getState();jn.setComposerState(wt.chatId,Ene(ve)??jn.getComposerState(K_)),I(wt.chatId),t(`/chat/${wt.chatId}`)}$(null)}catch(Ve){throw $(Ve instanceof Error?Ve.message:String(Ve)),Ve}}async function Xe(){if(e)try{await n.command({type:"chat.cancel",chatId:e})}catch(re){$(re instanceof Error?re.message:String(re))}}async function gt(re){if(await r.confirm({title:"Delete Chat",description:`Delete "${re.title}"? This cannot be undone.`,confirmLabel:"Delete",confirmVariant:"destructive"}))try{if(await n.command({type:"chat.delete",chatId:re.chatId}),re.chatId===e){const We=wne(s.projectGroups,re.chatId);t(We?`/chat/${We}`:"/")}}catch(We){$(We instanceof Error?We.message:String(We))}}async function ie(re){const ve=s.projectGroups.find(wt=>wt.groupKey===re);if(!ve)return;const We=ve.localPath.split("/").filter(Boolean).pop()??ve.localPath;if(await r.confirm({title:"Remove",description:`Remove "${We}" from the sidebar? Existing chats will be removed from ${ln}.`,confirmLabel:"Remove",confirmVariant:"destructive"}))try{await n.command({type:"project.remove",projectId:re}),Js.getState().clearProject(re),Mf.getState().clearProject(re),(Se==null?void 0:Se.projectId)===re&&t("/"),$(null)}catch(wt){$(wt instanceof Error?wt.message:String(wt))}}async function Te(re){var We,Ve;const ve=(Se==null?void 0:Se.localPath)??((We=l==null?void 0:l.projects[0])==null?void 0:We.localPath)??((Ve=s.projectGroups[0])==null?void 0:Ve.localPath);if(ve)try{await An({action:re,localPath:ve})}catch(wt){$(wt instanceof Error?wt.message:String(wt))}}async function ct(re){var ve;try{if(typeof navigator>"u"||!((ve=navigator.clipboard)!=null&&ve.writeText))throw new Error("Clipboard is not available");await navigator.clipboard.writeText(re),$(null)}catch(We){$(We instanceof Error?We.message:String(We))}}async function xt(re){try{await An({action:"open_editor",localPath:re.path,line:re.line,column:re.column})}catch(ve){$(ve instanceof Error?ve.message:String(ve))}}async function dn(re,ve){try{await An({action:re,localPath:ve})}catch(We){$(We instanceof Error?We.message:String(We))}}async function An(re){const ve=Kr.getState();$(null),await n.command({type:"system.openExternal",...re,editor:re.action==="open_editor"?{preset:ve.editorPreset,commandTemplate:ve.editorCommandTemplate}:void 0})}function Xn(){var ve;const re=Ane({selectedProjectId:A,sidebarProjectId:(ve=s.projectGroups[0])==null?void 0:ve.groupKey,fallbackLocalProjectPath:dt});if(re){Y(re);return}t("/")}async function kt(re,ve,We){if(e)try{await n.command({type:"chat.respondTool",chatId:e,toolUseId:re,result:{questions:ve,answers:We}})}catch(Ve){$(Ve instanceof Error?Ve.message:String(Ve))}}async function Et(re,ve,We,Ve){if(e){ve&&er.getState().setChatComposerPlanMode(e,!1);try{await n.command({type:"chat.respondTool",chatId:e,toolUseId:re,result:{confirmed:ve,...We?{clearContext:!0}:{},...Ve?{message:Ve}:{}}})}catch(wt){$(wt instanceof Error?wt.message:String(wt))}}}return{socket:n,activeChatId:e,sidebarData:s,localProjects:l,updateSnapshot:h,chatSnapshot:m,keybindings:_,connectionStatus:w,sidebarReady:C,localProjectsReady:R,commandError:z,startingLocalPath:q,sidebarOpen:F,sidebarCollapsed:B,scrollRef:fe,inputRef:ue,messages:be,latestToolIds:Ne,runtime:Se,availableProviders:_e,isProcessing:xe,canCancel:He,transcriptPaddingBottom:Fe,showScrollButton:et,navbarLocalPath:mt,editorLabel:ce,hasSelectedProject:bt,openSidebar:()=>G(!0),closeSidebar:()=>G(!1),collapseSidebar:()=>H(!0),expandSidebar:()=>H(!1),updateScrollState:un,scrollToBottom:Nn,handleCreateChat:le,handleOpenLocalProject:Re,handleCreateProject:ze,handleCheckForUpdates:$e,handleInstallUpdate:ht,handleSend:ee,handleCancel:Xe,handleDeleteChat:gt,handleRemoveProject:ie,handleCopyPath:ct,handleOpenExternal:Te,handleOpenExternalPath:dn,handleOpenLocalLink:xt,handleCompose:Xn,handleAskUserQuestion:kt,handleExitPlanMode:Et}}const sR="kanna:last-seen-version";function jne(e,t,n){return e==="/"&&!!t&&n!==t}function Lne(e){return e.projectGroups.reduce((t,n)=>t+n.chats.reduce((r,s)=>r+(s.unread?1:0)+(s.status==="waiting_for_user"?1:0),0),0)}function oR(e){let t=0;const n=new Set;for(const r of e.projectGroups)for(const s of r.chats)s.unread&&(t+=1),s.status==="waiting_for_user"&&n.add(s.chatId);return{unreadCount:t,waitingChatIds:n}}function zne(e,t){if(!e)return 0;const n=oR(e),r=oR(t),s=Math.max(0,r.unreadCount-n.unreadCount);let a=0;for(const l of r.waitingChatIds)n.waitingChatIds.has(l)||(a+=1);return s+a}function Pne(){const e=mi(),t=Pl(),n=CR(),r=One(n.chatId??null),s=gl(d=>d.chatSoundPreference),a=gl(d=>d.chatSoundId),l=e.pathname==="/",u=Gb.split("/")[1]??"unknown",h=y.useRef(null);return y.useEffect(()=>{const d=window.localStorage.getItem(sR),m=jne(e.pathname,u,d);window.localStorage.setItem(sR,u),m&&t("/settings/changelog",{replace:!0})},[u,e.pathname,t]),y.useLayoutEffect(()=>{document.title=ln},[e.key]),y.useEffect(()=>{function d(){document.title=ln}function m(){document.title=ln}return window.addEventListener("pageshow",d),window.addEventListener("pagehide",m),()=>{window.removeEventListener("pageshow",d),window.removeEventListener("pagehide",m)}},[]),y.useEffect(()=>{const d=Lne(r.sidebarData);document.title=d>0?`[${d}] ${ln}`:ln},[r.sidebarData]),y.useEffect(()=>{const d=zne(h.current,r.sidebarData);h.current=r.sidebarData,!(d<=0)&&k7(s)&&L_(a,d).catch(()=>{})},[a,s,r.sidebarData]),p.jsxs("div",{className:"flex h-[100dvh] min-h-[100dvh] overflow-hidden",children:[p.jsx(rU,{data:r.sidebarData,activeChatId:r.activeChatId,connectionStatus:r.connectionStatus,ready:r.sidebarReady,open:r.sidebarOpen,collapsed:r.sidebarCollapsed,showMobileOpenButton:l,onOpen:r.openSidebar,onClose:r.closeSidebar,onCollapse:r.collapseSidebar,onExpand:r.expandSidebar,onCreateChat:d=>{r.handleCreateChat(d)},onDeleteChat:d=>{r.handleDeleteChat(d)},onCopyPath:d=>{r.handleCopyPath(d)},onOpenExternalPath:(d,m)=>{r.handleOpenExternalPath(d,m)},onRemoveProject:d=>{r.handleRemoveProject(d)},editorLabel:r.editorLabel,keybindings:r.keybindings,updateSnapshot:r.updateSnapshot,onInstallUpdate:()=>{r.handleInstallUpdate()}}),p.jsx(Ij,{context:r})]})}function Bne(){return p.jsx(n7,{children:p.jsx(xI,{children:p.jsx(Fj,{children:p.jsxs(hl,{element:p.jsx(Pne,{}),children:[p.jsx(hl,{path:"/",element:p.jsx(hte,{})}),p.jsx(hl,{path:"/settings",element:p.jsx(Bj,{to:"/settings/general",replace:!0})}),p.jsx(hl,{path:"/settings/:sectionId",element:p.jsx(ine,{})}),p.jsx(hl,{path:"/chat/:chatId",element:p.jsx(ste,{})})]})})})})}const _3=document.getElementById("root");if(!_3)throw new Error("Missing #root");FO.createRoot(_3).render(p.jsx(y.StrictMode,{children:p.jsx(dL,{children:p.jsx(FJ,{children:p.jsx(Bne,{})})})}));
|