remote-codex 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +190 -0
- package/apps/supervisor-api/dist/index.d.ts +2 -0
- package/apps/supervisor-api/dist/index.js +14552 -0
- package/apps/supervisor-web/dist/assets/abap-BdImnpbu.js +1 -0
- package/apps/supervisor-web/dist/assets/actionscript-3-CoDkCxhg.js +1 -0
- package/apps/supervisor-web/dist/assets/ada-bCR0ucgS.js +1 -0
- package/apps/supervisor-web/dist/assets/addon-fit-YJmn1quW.js +12 -0
- package/apps/supervisor-web/dist/assets/andromeeda-C4gqWexZ.js +1 -0
- package/apps/supervisor-web/dist/assets/angular-html-CU67Zn6k.js +1 -0
- package/apps/supervisor-web/dist/assets/angular-ts-BwZT4LLn.js +1 -0
- package/apps/supervisor-web/dist/assets/apache-Pmp26Uib.js +1 -0
- package/apps/supervisor-web/dist/assets/apex-D8_7TLub.js +1 -0
- package/apps/supervisor-web/dist/assets/apl-dKokRX4l.js +1 -0
- package/apps/supervisor-web/dist/assets/applescript-Co6uUVPk.js +1 -0
- package/apps/supervisor-web/dist/assets/ara-BRHolxvo.js +1 -0
- package/apps/supervisor-web/dist/assets/asciidoc-Ve4PFQV2.js +1 -0
- package/apps/supervisor-web/dist/assets/asm-D_Q5rh1f.js +1 -0
- package/apps/supervisor-web/dist/assets/astro-CbQHKStN.js +1 -0
- package/apps/supervisor-web/dist/assets/aurora-x-D-2ljcwZ.js +1 -0
- package/apps/supervisor-web/dist/assets/awk-DMzUqQB5.js +1 -0
- package/apps/supervisor-web/dist/assets/ayu-dark-DYE7WIF3.js +1 -0
- package/apps/supervisor-web/dist/assets/ayu-light-BA47KaF1.js +1 -0
- package/apps/supervisor-web/dist/assets/ayu-mirage-32ctXXKs.js +1 -0
- package/apps/supervisor-web/dist/assets/ballerina-BFfxhgS-.js +1 -0
- package/apps/supervisor-web/dist/assets/bat-BkioyH1T.js +1 -0
- package/apps/supervisor-web/dist/assets/beancount-k_qm7-4y.js +1 -0
- package/apps/supervisor-web/dist/assets/berry-uYugtg8r.js +1 -0
- package/apps/supervisor-web/dist/assets/bibtex-CHM0blh-.js +1 -0
- package/apps/supervisor-web/dist/assets/bicep-Bmn6On1c.js +1 -0
- package/apps/supervisor-web/dist/assets/bird2-DPOp833l.js +1 -0
- package/apps/supervisor-web/dist/assets/blade-D4QpJJKB.js +1 -0
- package/apps/supervisor-web/dist/assets/bsl-BO_Y6i37.js +1 -0
- package/apps/supervisor-web/dist/assets/c-BIGW1oBm.js +1 -0
- package/apps/supervisor-web/dist/assets/c3-eo99z4R2.js +1 -0
- package/apps/supervisor-web/dist/assets/cadence-Bv_4Rxtq.js +1 -0
- package/apps/supervisor-web/dist/assets/cairo-KRGpt6FW.js +1 -0
- package/apps/supervisor-web/dist/assets/catppuccin-frappe-DFWUc33u.js +1 -0
- package/apps/supervisor-web/dist/assets/catppuccin-latte-C9dUb6Cb.js +1 -0
- package/apps/supervisor-web/dist/assets/catppuccin-macchiato-DQyhUUbL.js +1 -0
- package/apps/supervisor-web/dist/assets/catppuccin-mocha-D87Tk5Gz.js +1 -0
- package/apps/supervisor-web/dist/assets/clarity-D53aC0YG.js +1 -0
- package/apps/supervisor-web/dist/assets/clojure-P80f7IUj.js +1 -0
- package/apps/supervisor-web/dist/assets/cmake-D1j8_8rp.js +1 -0
- package/apps/supervisor-web/dist/assets/cobol-nwyudZeR.js +1 -0
- package/apps/supervisor-web/dist/assets/codeowners-Bp6g37R7.js +1 -0
- package/apps/supervisor-web/dist/assets/codeql-DsOJ9woJ.js +1 -0
- package/apps/supervisor-web/dist/assets/coffee-Ch7k5sss.js +1 -0
- package/apps/supervisor-web/dist/assets/common-lisp-Cg-RD9OK.js +1 -0
- package/apps/supervisor-web/dist/assets/coq-DkFqJrB1.js +1 -0
- package/apps/supervisor-web/dist/assets/cpp-CofmeUqb.js +1 -0
- package/apps/supervisor-web/dist/assets/crystal-tKQVLTB8.js +1 -0
- package/apps/supervisor-web/dist/assets/csharp-COcwbKMJ.js +1 -0
- package/apps/supervisor-web/dist/assets/css-DPfMkruS.js +1 -0
- package/apps/supervisor-web/dist/assets/csv-fuZLfV_i.js +1 -0
- package/apps/supervisor-web/dist/assets/cue-D82EKSYY.js +1 -0
- package/apps/supervisor-web/dist/assets/cypher-COkxafJQ.js +1 -0
- package/apps/supervisor-web/dist/assets/d-85-TOEBH.js +1 -0
- package/apps/supervisor-web/dist/assets/dark-plus-C3mMm8J8.js +1 -0
- package/apps/supervisor-web/dist/assets/dart-CF10PKvl.js +1 -0
- package/apps/supervisor-web/dist/assets/dax-CEL-wOlO.js +1 -0
- package/apps/supervisor-web/dist/assets/desktop-BmXAJ9_W.js +1 -0
- package/apps/supervisor-web/dist/assets/diff-D97Zzqfu.js +1 -0
- package/apps/supervisor-web/dist/assets/docker-BcOcwvcX.js +1 -0
- package/apps/supervisor-web/dist/assets/dotenv-Da5cRb03.js +1 -0
- package/apps/supervisor-web/dist/assets/dracula-BzJJZx-M.js +1 -0
- package/apps/supervisor-web/dist/assets/dracula-soft-BXkSAIEj.js +1 -0
- package/apps/supervisor-web/dist/assets/dream-maker-BtqSS_iP.js +1 -0
- package/apps/supervisor-web/dist/assets/edge-BkV0erSs.js +1 -0
- package/apps/supervisor-web/dist/assets/elixir-CDX3lj18.js +1 -0
- package/apps/supervisor-web/dist/assets/elm-DbKCFpqz.js +1 -0
- package/apps/supervisor-web/dist/assets/emacs-lisp-C9XAeP06.js +1 -0
- package/apps/supervisor-web/dist/assets/erb-B12qg9BL.js +1 -0
- package/apps/supervisor-web/dist/assets/erlang-DsQrWhSR.js +1 -0
- package/apps/supervisor-web/dist/assets/everforest-dark-BgDCqdQA.js +1 -0
- package/apps/supervisor-web/dist/assets/everforest-light-C8M2exoo.js +1 -0
- package/apps/supervisor-web/dist/assets/fennel-BYunw83y.js +1 -0
- package/apps/supervisor-web/dist/assets/fish-BvzEVeQv.js +1 -0
- package/apps/supervisor-web/dist/assets/fluent-C4IJs8-o.js +1 -0
- package/apps/supervisor-web/dist/assets/fortran-fixed-form-CkoXwp7k.js +1 -0
- package/apps/supervisor-web/dist/assets/fortran-free-form-BxgE0vQu.js +1 -0
- package/apps/supervisor-web/dist/assets/fsharp-CXgrBDvD.js +1 -0
- package/apps/supervisor-web/dist/assets/gdresource-BOOCDP_w.js +1 -0
- package/apps/supervisor-web/dist/assets/gdscript-C5YyOfLZ.js +1 -0
- package/apps/supervisor-web/dist/assets/gdshader-DkwncUOv.js +1 -0
- package/apps/supervisor-web/dist/assets/genie-D0YGMca9.js +1 -0
- package/apps/supervisor-web/dist/assets/gherkin-DyxjwDmM.js +1 -0
- package/apps/supervisor-web/dist/assets/git-commit-F4YmCXRG.js +1 -0
- package/apps/supervisor-web/dist/assets/git-rebase-r7XF79zn.js +1 -0
- package/apps/supervisor-web/dist/assets/github-dark-DHJKELXO.js +1 -0
- package/apps/supervisor-web/dist/assets/github-dark-default-Cuk6v7N8.js +1 -0
- package/apps/supervisor-web/dist/assets/github-dark-dimmed-DH5Ifo-i.js +1 -0
- package/apps/supervisor-web/dist/assets/github-dark-high-contrast-E3gJ1_iC.js +1 -0
- package/apps/supervisor-web/dist/assets/github-light-DAi9KRSo.js +1 -0
- package/apps/supervisor-web/dist/assets/github-light-default-D7oLnXFd.js +1 -0
- package/apps/supervisor-web/dist/assets/github-light-high-contrast-BfjtVDDH.js +1 -0
- package/apps/supervisor-web/dist/assets/gleam-BspZqrRM.js +1 -0
- package/apps/supervisor-web/dist/assets/glimmer-js-Rg0-pVw9.js +1 -0
- package/apps/supervisor-web/dist/assets/glimmer-ts-U6CK756n.js +1 -0
- package/apps/supervisor-web/dist/assets/glsl-DplSGwfg.js +1 -0
- package/apps/supervisor-web/dist/assets/gn-n2N0HUVH.js +1 -0
- package/apps/supervisor-web/dist/assets/gnuplot-DdkO51Og.js +1 -0
- package/apps/supervisor-web/dist/assets/go-CxLEBnE3.js +1 -0
- package/apps/supervisor-web/dist/assets/graphql-ChdNCCLP.js +1 -0
- package/apps/supervisor-web/dist/assets/groovy-gcz8RCvz.js +1 -0
- package/apps/supervisor-web/dist/assets/gruvbox-dark-hard-CFHQjOhq.js +1 -0
- package/apps/supervisor-web/dist/assets/gruvbox-dark-medium-GsRaNv29.js +1 -0
- package/apps/supervisor-web/dist/assets/gruvbox-dark-soft-CVdnzihN.js +1 -0
- package/apps/supervisor-web/dist/assets/gruvbox-light-hard-CH1njM8p.js +1 -0
- package/apps/supervisor-web/dist/assets/gruvbox-light-medium-DRw_LuNl.js +1 -0
- package/apps/supervisor-web/dist/assets/gruvbox-light-soft-hJgmCMqR.js +1 -0
- package/apps/supervisor-web/dist/assets/hack-CaT9iCJl.js +1 -0
- package/apps/supervisor-web/dist/assets/haml-B8DHNrY2.js +1 -0
- package/apps/supervisor-web/dist/assets/handlebars-BL8al0AC.js +1 -0
- package/apps/supervisor-web/dist/assets/haskell-Df6bDoY_.js +1 -0
- package/apps/supervisor-web/dist/assets/haxe-CzTSHFRz.js +1 -0
- package/apps/supervisor-web/dist/assets/hcl-BWvSN4gD.js +1 -0
- package/apps/supervisor-web/dist/assets/highlighted-body-OFNGDK62-D-RjOTTL.js +1 -0
- package/apps/supervisor-web/dist/assets/hjson-D5-asLiD.js +1 -0
- package/apps/supervisor-web/dist/assets/hlsl-D3lLCCz7.js +1 -0
- package/apps/supervisor-web/dist/assets/horizon-BUw7H-hv.js +1 -0
- package/apps/supervisor-web/dist/assets/horizon-bright-Cn-bp-IR.js +1 -0
- package/apps/supervisor-web/dist/assets/houston-DnULxvSX.js +1 -0
- package/apps/supervisor-web/dist/assets/html-GMplVEZG.js +1 -0
- package/apps/supervisor-web/dist/assets/html-derivative-BFtXZ54Q.js +1 -0
- package/apps/supervisor-web/dist/assets/http-jrhK8wxY.js +1 -0
- package/apps/supervisor-web/dist/assets/hurl-irOxFIW8.js +1 -0
- package/apps/supervisor-web/dist/assets/hxml-Bvhsp5Yf.js +1 -0
- package/apps/supervisor-web/dist/assets/hy-DFXneXwc.js +1 -0
- package/apps/supervisor-web/dist/assets/imba-DGztddWO.js +1 -0
- package/apps/supervisor-web/dist/assets/index-CdG3ogmZ.js +376 -0
- package/apps/supervisor-web/dist/assets/index-QM8NQf3e.css +32 -0
- package/apps/supervisor-web/dist/assets/ini-BEwlwnbL.js +1 -0
- package/apps/supervisor-web/dist/assets/java-CylS5w8V.js +1 -0
- package/apps/supervisor-web/dist/assets/javascript-wDzz0qaB.js +1 -0
- package/apps/supervisor-web/dist/assets/jinja-4LBKfQ-Z.js +1 -0
- package/apps/supervisor-web/dist/assets/jison-wvAkD_A8.js +1 -0
- package/apps/supervisor-web/dist/assets/json-Cp-IABpG.js +1 -0
- package/apps/supervisor-web/dist/assets/json5-C9tS-k6U.js +1 -0
- package/apps/supervisor-web/dist/assets/jsonc-Des-eS-w.js +1 -0
- package/apps/supervisor-web/dist/assets/jsonl-DcaNXYhu.js +1 -0
- package/apps/supervisor-web/dist/assets/jsonnet-DFQXde-d.js +1 -0
- package/apps/supervisor-web/dist/assets/jssm-C2t-YnRu.js +1 -0
- package/apps/supervisor-web/dist/assets/jsx-g9-lgVsj.js +1 -0
- package/apps/supervisor-web/dist/assets/julia-CxzCAyBv.js +1 -0
- package/apps/supervisor-web/dist/assets/just-Cw27pwNe.js +1 -0
- package/apps/supervisor-web/dist/assets/kanagawa-dragon-CkXjmgJE.js +1 -0
- package/apps/supervisor-web/dist/assets/kanagawa-lotus-CfQXZHmo.js +1 -0
- package/apps/supervisor-web/dist/assets/kanagawa-wave-DWedfzmr.js +1 -0
- package/apps/supervisor-web/dist/assets/kdl-DV7GczEv.js +1 -0
- package/apps/supervisor-web/dist/assets/kotlin-BdnUsdx6.js +1 -0
- package/apps/supervisor-web/dist/assets/kusto-DZf3V79B.js +1 -0
- package/apps/supervisor-web/dist/assets/laserwave-DUszq2jm.js +1 -0
- package/apps/supervisor-web/dist/assets/latex-CWtU0Tv5.js +1 -0
- package/apps/supervisor-web/dist/assets/lean-BZvkOJ9d.js +1 -0
- package/apps/supervisor-web/dist/assets/less-B1dDrJ26.js +1 -0
- package/apps/supervisor-web/dist/assets/light-plus-B7mTdjB0.js +1 -0
- package/apps/supervisor-web/dist/assets/liquid-DYVedYrR.js +1 -0
- package/apps/supervisor-web/dist/assets/llvm-DjAJT7YJ.js +1 -0
- package/apps/supervisor-web/dist/assets/log-2UxHyX5q.js +1 -0
- package/apps/supervisor-web/dist/assets/logo-BtOb2qkB.js +1 -0
- package/apps/supervisor-web/dist/assets/lua-BaeVxFsk.js +1 -0
- package/apps/supervisor-web/dist/assets/luau-C-HG3fhB.js +1 -0
- package/apps/supervisor-web/dist/assets/make-CHLpvVh8.js +1 -0
- package/apps/supervisor-web/dist/assets/markdown-Cvjx9yec.js +1 -0
- package/apps/supervisor-web/dist/assets/marko-CnJfTvn9.js +1 -0
- package/apps/supervisor-web/dist/assets/material-theme-D5KoaKCx.js +1 -0
- package/apps/supervisor-web/dist/assets/material-theme-darker-BfHTSMKl.js +1 -0
- package/apps/supervisor-web/dist/assets/material-theme-lighter-B0m2ddpp.js +1 -0
- package/apps/supervisor-web/dist/assets/material-theme-ocean-CyktbL80.js +1 -0
- package/apps/supervisor-web/dist/assets/material-theme-palenight-Csfq5Kiy.js +1 -0
- package/apps/supervisor-web/dist/assets/matlab-D7o27uSR.js +1 -0
- package/apps/supervisor-web/dist/assets/mdc-BMNejdWA.js +1 -0
- package/apps/supervisor-web/dist/assets/mdx-Cmh6b_Ma.js +1 -0
- package/apps/supervisor-web/dist/assets/mermaid-mWjccvbQ.js +1 -0
- package/apps/supervisor-web/dist/assets/min-dark-CafNBF8u.js +1 -0
- package/apps/supervisor-web/dist/assets/min-light-CTRr51gU.js +1 -0
- package/apps/supervisor-web/dist/assets/mipsasm-CKIfxQSi.js +1 -0
- package/apps/supervisor-web/dist/assets/mojo-rZm6bMo-.js +1 -0
- package/apps/supervisor-web/dist/assets/monokai-D4h5O-jR.js +1 -0
- package/apps/supervisor-web/dist/assets/moonbit-_H4v1dQx.js +1 -0
- package/apps/supervisor-web/dist/assets/move-IF9eRakj.js +1 -0
- package/apps/supervisor-web/dist/assets/narrat-DRg8JJMk.js +1 -0
- package/apps/supervisor-web/dist/assets/nextflow-Zz6hmt5N.js +1 -0
- package/apps/supervisor-web/dist/assets/nextflow-groovy-BeH2EWoN.js +1 -0
- package/apps/supervisor-web/dist/assets/nginx-BpAMiNFr.js +1 -0
- package/apps/supervisor-web/dist/assets/night-owl-C39BiMTA.js +1 -0
- package/apps/supervisor-web/dist/assets/night-owl-light-CMTm3GFP.js +1 -0
- package/apps/supervisor-web/dist/assets/nim-CVrawwO9.js +1 -0
- package/apps/supervisor-web/dist/assets/nix-CwoSXNpI.js +1 -0
- package/apps/supervisor-web/dist/assets/nord-Ddv68eIx.js +1 -0
- package/apps/supervisor-web/dist/assets/nushell-Cz2AlsmD.js +1 -0
- package/apps/supervisor-web/dist/assets/objective-c-DXmwc3jG.js +1 -0
- package/apps/supervisor-web/dist/assets/objective-cpp-CLxacb5B.js +1 -0
- package/apps/supervisor-web/dist/assets/ocaml-C0hk2d4L.js +1 -0
- package/apps/supervisor-web/dist/assets/odin-BBf5iR-q.js +1 -0
- package/apps/supervisor-web/dist/assets/one-dark-pro-DVMEJ2y_.js +1 -0
- package/apps/supervisor-web/dist/assets/one-light-C3Wv6jpd.js +1 -0
- package/apps/supervisor-web/dist/assets/openscad-C4EeE6gA.js +1 -0
- package/apps/supervisor-web/dist/assets/pascal-D93ZcfNL.js +1 -0
- package/apps/supervisor-web/dist/assets/perl-C0TMdlhV.js +1 -0
- package/apps/supervisor-web/dist/assets/php-Dhbhpdrm.js +1 -0
- package/apps/supervisor-web/dist/assets/pkl-u5AG7uiY.js +1 -0
- package/apps/supervisor-web/dist/assets/plastic-3e1v2bzS.js +1 -0
- package/apps/supervisor-web/dist/assets/plsql-ChMvpjG-.js +1 -0
- package/apps/supervisor-web/dist/assets/po-BTJTHyun.js +1 -0
- package/apps/supervisor-web/dist/assets/poimandres-CS3Unz2-.js +1 -0
- package/apps/supervisor-web/dist/assets/polar-C0HS_06l.js +1 -0
- package/apps/supervisor-web/dist/assets/postcss-CXtECtnM.js +1 -0
- package/apps/supervisor-web/dist/assets/powerquery-CEu0bR-o.js +1 -0
- package/apps/supervisor-web/dist/assets/powershell-Dpen1YoG.js +1 -0
- package/apps/supervisor-web/dist/assets/prisma-Dd19v3D-.js +1 -0
- package/apps/supervisor-web/dist/assets/prolog-CbFg5uaA.js +1 -0
- package/apps/supervisor-web/dist/assets/proto-C7zT0LnQ.js +1 -0
- package/apps/supervisor-web/dist/assets/pug-CGlum2m_.js +1 -0
- package/apps/supervisor-web/dist/assets/puppet-BMWR74SV.js +1 -0
- package/apps/supervisor-web/dist/assets/purescript-CklMAg4u.js +1 -0
- package/apps/supervisor-web/dist/assets/python-B6aJPvgy.js +1 -0
- package/apps/supervisor-web/dist/assets/qml-3beO22l8.js +1 -0
- package/apps/supervisor-web/dist/assets/qmldir-C8lEn-DE.js +1 -0
- package/apps/supervisor-web/dist/assets/qss-IeuSbFQv.js +1 -0
- package/apps/supervisor-web/dist/assets/r-Dspwwk_N.js +1 -0
- package/apps/supervisor-web/dist/assets/racket-BqYA7rlc.js +1 -0
- package/apps/supervisor-web/dist/assets/raku-DXvB9xmW.js +1 -0
- package/apps/supervisor-web/dist/assets/razor-Uh8Bk_45.js +1 -0
- package/apps/supervisor-web/dist/assets/red-bN70gL4F.js +1 -0
- package/apps/supervisor-web/dist/assets/reg-C-SQnVFl.js +1 -0
- package/apps/supervisor-web/dist/assets/regexp-CDVJQ6XC.js +1 -0
- package/apps/supervisor-web/dist/assets/rel-C3B-1QV4.js +1 -0
- package/apps/supervisor-web/dist/assets/riscv-BM1_JUlF.js +1 -0
- package/apps/supervisor-web/dist/assets/ron-D8l8udqQ.js +1 -0
- package/apps/supervisor-web/dist/assets/rose-pine-dawn-DHQR4-dF.js +1 -0
- package/apps/supervisor-web/dist/assets/rose-pine-moon-D4_iv3hh.js +1 -0
- package/apps/supervisor-web/dist/assets/rose-pine-qdsjHGoJ.js +1 -0
- package/apps/supervisor-web/dist/assets/rosmsg-BJDFO7_C.js +1 -0
- package/apps/supervisor-web/dist/assets/rst-BrH8l1NY.js +1 -0
- package/apps/supervisor-web/dist/assets/ruby-Dw2BHqvy.js +1 -0
- package/apps/supervisor-web/dist/assets/rust-B1yitclQ.js +1 -0
- package/apps/supervisor-web/dist/assets/sas-cz2c8ADy.js +1 -0
- package/apps/supervisor-web/dist/assets/sass-Cj5Yp3dK.js +1 -0
- package/apps/supervisor-web/dist/assets/scala-C151Ov-r.js +1 -0
- package/apps/supervisor-web/dist/assets/scheme-C98Dy4si.js +1 -0
- package/apps/supervisor-web/dist/assets/scss-OYdSNvt2.js +1 -0
- package/apps/supervisor-web/dist/assets/sdbl-DVxCFoDh.js +1 -0
- package/apps/supervisor-web/dist/assets/shaderlab-Dg9Lc6iA.js +1 -0
- package/apps/supervisor-web/dist/assets/shellscript-Yzrsuije.js +1 -0
- package/apps/supervisor-web/dist/assets/shellsession-BADoaaVG.js +1 -0
- package/apps/supervisor-web/dist/assets/slack-dark-BthQWCQV.js +1 -0
- package/apps/supervisor-web/dist/assets/slack-ochin-DqwNpetd.js +1 -0
- package/apps/supervisor-web/dist/assets/smalltalk-BERRCDM3.js +1 -0
- package/apps/supervisor-web/dist/assets/snazzy-light-Bw305WKR.js +1 -0
- package/apps/supervisor-web/dist/assets/solarized-dark-DXbdFlpD.js +1 -0
- package/apps/supervisor-web/dist/assets/solarized-light-L9t79GZl.js +1 -0
- package/apps/supervisor-web/dist/assets/solidity-rGO070M0.js +1 -0
- package/apps/supervisor-web/dist/assets/soy-Brmx7dQM.js +1 -0
- package/apps/supervisor-web/dist/assets/sparql-rVzFXLq3.js +1 -0
- package/apps/supervisor-web/dist/assets/splunk-BtCnVYZw.js +1 -0
- package/apps/supervisor-web/dist/assets/sql-BLtJtn59.js +1 -0
- package/apps/supervisor-web/dist/assets/ssh-config-_ykCGR6B.js +1 -0
- package/apps/supervisor-web/dist/assets/stata-BH5u7GGu.js +1 -0
- package/apps/supervisor-web/dist/assets/stylus-BEDo0Tqx.js +1 -0
- package/apps/supervisor-web/dist/assets/surrealql-Bq5Q-fJD.js +1 -0
- package/apps/supervisor-web/dist/assets/svelte-C_ipcX3V.js +1 -0
- package/apps/supervisor-web/dist/assets/swift-D82vCrfD.js +1 -0
- package/apps/supervisor-web/dist/assets/synthwave-84-CbfX1IO0.js +1 -0
- package/apps/supervisor-web/dist/assets/system-verilog-CnnmHF94.js +1 -0
- package/apps/supervisor-web/dist/assets/systemd-4A_iFExJ.js +1 -0
- package/apps/supervisor-web/dist/assets/talonscript-CkByrt1z.js +1 -0
- package/apps/supervisor-web/dist/assets/tasl-QIJgUcNo.js +1 -0
- package/apps/supervisor-web/dist/assets/tcl-dwOrl1Do.js +1 -0
- package/apps/supervisor-web/dist/assets/templ-P3uqSqPl.js +1 -0
- package/apps/supervisor-web/dist/assets/terraform-BETggiCN.js +1 -0
- package/apps/supervisor-web/dist/assets/tex-idrVyKtj.js +1 -0
- package/apps/supervisor-web/dist/assets/tokyo-night-hegEt444.js +1 -0
- package/apps/supervisor-web/dist/assets/toml-vGWfd6FD.js +1 -0
- package/apps/supervisor-web/dist/assets/ts-tags-zn1MmPIZ.js +1 -0
- package/apps/supervisor-web/dist/assets/tsv-B_m7g4N7.js +1 -0
- package/apps/supervisor-web/dist/assets/tsx-COt5Ahok.js +1 -0
- package/apps/supervisor-web/dist/assets/turtle-BsS91CYL.js +1 -0
- package/apps/supervisor-web/dist/assets/twig-DNn4PbVi.js +1 -0
- package/apps/supervisor-web/dist/assets/typescript-BPQ3VLAy.js +1 -0
- package/apps/supervisor-web/dist/assets/typespec-BGHnOYBU.js +1 -0
- package/apps/supervisor-web/dist/assets/typst-DHCkPAjA.js +1 -0
- package/apps/supervisor-web/dist/assets/v-BcVCzyr7.js +1 -0
- package/apps/supervisor-web/dist/assets/vala-CsfeWuGM.js +1 -0
- package/apps/supervisor-web/dist/assets/vb-D17OF-Vu.js +1 -0
- package/apps/supervisor-web/dist/assets/verilog-BQ8w6xss.js +1 -0
- package/apps/supervisor-web/dist/assets/vesper-DU1UobuO.js +1 -0
- package/apps/supervisor-web/dist/assets/vhdl-CeAyd5Ju.js +1 -0
- package/apps/supervisor-web/dist/assets/viml-CJc9bBzg.js +1 -0
- package/apps/supervisor-web/dist/assets/vitesse-black-Bkuqu6BP.js +1 -0
- package/apps/supervisor-web/dist/assets/vitesse-dark-D0r3Knsf.js +1 -0
- package/apps/supervisor-web/dist/assets/vitesse-light-CVO1_9PV.js +1 -0
- package/apps/supervisor-web/dist/assets/vue-DN_0RTcg.js +1 -0
- package/apps/supervisor-web/dist/assets/vue-html-AaS7Mt5G.js +1 -0
- package/apps/supervisor-web/dist/assets/vue-vine-CQOfvN7w.js +1 -0
- package/apps/supervisor-web/dist/assets/vyper-CDx5xZoG.js +1 -0
- package/apps/supervisor-web/dist/assets/wasm-CG6Dc4jp.js +1 -0
- package/apps/supervisor-web/dist/assets/wasm-MzD3tlZU.js +1 -0
- package/apps/supervisor-web/dist/assets/wenyan-BV7otONQ.js +1 -0
- package/apps/supervisor-web/dist/assets/wgsl-Dx-B1_4e.js +1 -0
- package/apps/supervisor-web/dist/assets/wikitext-BhOHFoWU.js +1 -0
- package/apps/supervisor-web/dist/assets/wit-5i3qLPDT.js +1 -0
- package/apps/supervisor-web/dist/assets/wolfram-lXgVvXCa.js +1 -0
- package/apps/supervisor-web/dist/assets/xml-sdJ4AIDG.js +1 -0
- package/apps/supervisor-web/dist/assets/xsl-CtQFsRM5.js +1 -0
- package/apps/supervisor-web/dist/assets/xterm-D8iZbRww.js +9 -0
- package/apps/supervisor-web/dist/assets/yaml-Buea-lGh.js +1 -0
- package/apps/supervisor-web/dist/assets/zenscript-DVFEvuxE.js +1 -0
- package/apps/supervisor-web/dist/assets/zig-VOosw3JB.js +1 -0
- package/apps/supervisor-web/dist/index.html +13 -0
- package/bin/remote-codex.mjs +92 -0
- package/package.json +85 -0
- package/scripts/run-web-service.mjs +257 -0
- package/scripts/service-manager.mjs +341 -0
|
@@ -0,0 +1,376 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/angular-html-CU67Zn6k.js","assets/html-GMplVEZG.js","assets/javascript-wDzz0qaB.js","assets/css-DPfMkruS.js","assets/angular-ts-BwZT4LLn.js","assets/scss-OYdSNvt2.js","assets/apl-dKokRX4l.js","assets/xml-sdJ4AIDG.js","assets/java-CylS5w8V.js","assets/json-Cp-IABpG.js","assets/astro-CbQHKStN.js","assets/typescript-BPQ3VLAy.js","assets/postcss-CXtECtnM.js","assets/tsx-COt5Ahok.js","assets/blade-D4QpJJKB.js","assets/html-derivative-BFtXZ54Q.js","assets/sql-BLtJtn59.js","assets/bsl-BO_Y6i37.js","assets/sdbl-DVxCFoDh.js","assets/cairo-KRGpt6FW.js","assets/python-B6aJPvgy.js","assets/cobol-nwyudZeR.js","assets/coffee-Ch7k5sss.js","assets/cpp-CofmeUqb.js","assets/regexp-CDVJQ6XC.js","assets/glsl-DplSGwfg.js","assets/c-BIGW1oBm.js","assets/crystal-tKQVLTB8.js","assets/shellscript-Yzrsuije.js","assets/edge-BkV0erSs.js","assets/elixir-CDX3lj18.js","assets/elm-DbKCFpqz.js","assets/erb-B12qg9BL.js","assets/ruby-Dw2BHqvy.js","assets/haml-B8DHNrY2.js","assets/graphql-ChdNCCLP.js","assets/jsx-g9-lgVsj.js","assets/lua-BaeVxFsk.js","assets/yaml-Buea-lGh.js","assets/erlang-DsQrWhSR.js","assets/markdown-Cvjx9yec.js","assets/fortran-fixed-form-CkoXwp7k.js","assets/fortran-free-form-BxgE0vQu.js","assets/fsharp-CXgrBDvD.js","assets/gdresource-BOOCDP_w.js","assets/gdshader-DkwncUOv.js","assets/gdscript-C5YyOfLZ.js","assets/git-commit-F4YmCXRG.js","assets/diff-D97Zzqfu.js","assets/git-rebase-r7XF79zn.js","assets/glimmer-js-Rg0-pVw9.js","assets/glimmer-ts-U6CK756n.js","assets/hack-CaT9iCJl.js","assets/handlebars-BL8al0AC.js","assets/http-jrhK8wxY.js","assets/hurl-irOxFIW8.js","assets/csv-fuZLfV_i.js","assets/hxml-Bvhsp5Yf.js","assets/haxe-CzTSHFRz.js","assets/jinja-4LBKfQ-Z.js","assets/jison-wvAkD_A8.js","assets/julia-CxzCAyBv.js","assets/r-Dspwwk_N.js","assets/just-Cw27pwNe.js","assets/perl-C0TMdlhV.js","assets/latex-CWtU0Tv5.js","assets/tex-idrVyKtj.js","assets/liquid-DYVedYrR.js","assets/marko-CnJfTvn9.js","assets/less-B1dDrJ26.js","assets/mdc-BMNejdWA.js","assets/nextflow-Zz6hmt5N.js","assets/nextflow-groovy-BeH2EWoN.js","assets/nginx-BpAMiNFr.js","assets/nim-CVrawwO9.js","assets/php-Dhbhpdrm.js","assets/pug-CGlum2m_.js","assets/qml-3beO22l8.js","assets/razor-Uh8Bk_45.js","assets/csharp-COcwbKMJ.js","assets/rst-BrH8l1NY.js","assets/cmake-D1j8_8rp.js","assets/sas-cz2c8ADy.js","assets/shaderlab-Dg9Lc6iA.js","assets/hlsl-D3lLCCz7.js","assets/shellsession-BADoaaVG.js","assets/soy-Brmx7dQM.js","assets/sparql-rVzFXLq3.js","assets/turtle-BsS91CYL.js","assets/stata-BH5u7GGu.js","assets/surrealql-Bq5Q-fJD.js","assets/svelte-C_ipcX3V.js","assets/templ-P3uqSqPl.js","assets/go-CxLEBnE3.js","assets/ts-tags-zn1MmPIZ.js","assets/twig-DNn4PbVi.js","assets/vue-DN_0RTcg.js","assets/vue-html-AaS7Mt5G.js","assets/vue-vine-CQOfvN7w.js","assets/stylus-BEDo0Tqx.js","assets/xsl-CtQFsRM5.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
var FA=Object.defineProperty;var $A=Object.getPrototypeOf;var VA=Reflect.get;var sE=e=>{throw TypeError(e)};var GA=(e,t,n)=>t in e?FA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var le=(e,t,n)=>GA(e,typeof t!="symbol"?t+"":t,n),op=(e,t,n)=>t.has(e)||sE("Cannot "+n);var cr=(e,t,n)=>(op(e,t,"read from private field"),n?n.call(e):t.get(e)),Ys=(e,t,n)=>t.has(e)?sE("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),xa=(e,t,n,r)=>(op(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),up=(e,t,n)=>(op(e,t,"access private method"),n);var lE=(e,t,n)=>VA($A(e),n,t);(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 l of s)if(l.type==="childList")for(const o of l.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(s){const l={};return s.integrity&&(l.integrity=s.integrity),s.referrerPolicy&&(l.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?l.credentials="include":s.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function r(s){if(s.ep)return;s.ep=!0;const l=n(s);fetch(s.href,l)}})();function Bf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var cp={exports:{}},Tu={};/**
|
|
3
|
+
* @license React
|
|
4
|
+
* react-jsx-runtime.production.js
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
7
|
+
*
|
|
8
|
+
* This source code is licensed under the MIT license found in the
|
|
9
|
+
* LICENSE file in the root directory of this source tree.
|
|
10
|
+
*/var oE;function qA(){if(oE)return Tu;oE=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,s,l){var o=null;if(l!==void 0&&(o=""+l),s.key!==void 0&&(o=""+s.key),"key"in s){l={};for(var c in s)c!=="key"&&(l[c]=s[c])}else l=s;return s=l.ref,{$$typeof:e,type:r,key:o,ref:s!==void 0?s:null,props:l}}return Tu.Fragment=t,Tu.jsx=n,Tu.jsxs=n,Tu}var uE;function YA(){return uE||(uE=1,cp.exports=qA()),cp.exports}var h=YA(),dp={exports:{}},bt={};/**
|
|
11
|
+
* @license React
|
|
12
|
+
* react.production.js
|
|
13
|
+
*
|
|
14
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
15
|
+
*
|
|
16
|
+
* This source code is licensed under the MIT license found in the
|
|
17
|
+
* LICENSE file in the root directory of this source tree.
|
|
18
|
+
*/var cE;function WA(){if(cE)return bt;cE=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"),l=Symbol.for("react.consumer"),o=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),y=Symbol.iterator;function E($){return $===null||typeof $!="object"?null:($=y&&$[y]||$["@@iterator"],typeof $=="function"?$:null)}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},k=Object.assign,C={};function S($,ae,O){this.props=$,this.context=ae,this.refs=C,this.updater=O||v}S.prototype.isReactComponent={},S.prototype.setState=function($,ae){if(typeof $!="object"&&typeof $!="function"&&$!=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,$,ae,"setState")},S.prototype.forceUpdate=function($){this.updater.enqueueForceUpdate(this,$,"forceUpdate")};function A(){}A.prototype=S.prototype;function N($,ae,O){this.props=$,this.context=ae,this.refs=C,this.updater=O||v}var U=N.prototype=new A;U.constructor=N,k(U,S.prototype),U.isPureReactComponent=!0;var G=Array.isArray;function P(){}var H={H:null,A:null,T:null,S:null},Y=Object.prototype.hasOwnProperty;function ue($,ae,O){var _e=O.ref;return{$$typeof:e,type:$,key:ae,ref:_e!==void 0?_e:null,props:O}}function M($,ae){return ue($.type,ae,$.props)}function K($){return typeof $=="object"&&$!==null&&$.$$typeof===e}function F($){var ae={"=":"=0",":":"=2"};return"$"+$.replace(/[=:]/g,function(O){return ae[O]})}var ge=/\/+/g;function ce($,ae){return typeof $=="object"&&$!==null&&$.key!=null?F(""+$.key):ae.toString(36)}function ne($){switch($.status){case"fulfilled":return $.value;case"rejected":throw $.reason;default:switch(typeof $.status=="string"?$.then(P,P):($.status="pending",$.then(function(ae){$.status==="pending"&&($.status="fulfilled",$.value=ae)},function(ae){$.status==="pending"&&($.status="rejected",$.reason=ae)})),$.status){case"fulfilled":return $.value;case"rejected":throw $.reason}}throw $}function z($,ae,O,_e,Re){var we=typeof $;(we==="undefined"||we==="boolean")&&($=null);var et=!1;if($===null)et=!0;else switch(we){case"bigint":case"string":case"number":et=!0;break;case"object":switch($.$$typeof){case e:case t:et=!0;break;case p:return et=$._init,z(et($._payload),ae,O,_e,Re)}}if(et)return Re=Re($),et=_e===""?"."+ce($,0):_e,G(Re)?(O="",et!=null&&(O=et.replace(ge,"$&/")+"/"),z(Re,ae,O,"",function(kt){return kt})):Re!=null&&(K(Re)&&(Re=M(Re,O+(Re.key==null||$&&$.key===Re.key?"":(""+Re.key).replace(ge,"$&/")+"/")+et)),ae.push(Re)),1;et=0;var Fe=_e===""?".":_e+":";if(G($))for(var Ie=0;Ie<$.length;Ie++)_e=$[Ie],we=Fe+ce(_e,Ie),et+=z(_e,ae,O,we,Re);else if(Ie=E($),typeof Ie=="function")for($=Ie.call($),Ie=0;!(_e=$.next()).done;)_e=_e.value,we=Fe+ce(_e,Ie++),et+=z(_e,ae,O,we,Re);else if(we==="object"){if(typeof $.then=="function")return z(ne($),ae,O,_e,Re);throw ae=String($),Error("Objects are not valid as a React child (found: "+(ae==="[object Object]"?"object with keys {"+Object.keys($).join(", ")+"}":ae)+"). If you meant to render a collection of children, use an array instead.")}return et}function ee($,ae,O){if($==null)return $;var _e=[],Re=0;return z($,_e,"","",function(we){return ae.call(O,we,Re++)}),_e}function ke($){if($._status===-1){var ae=$._result;ae=ae(),ae.then(function(O){($._status===0||$._status===-1)&&($._status=1,$._result=O)},function(O){($._status===0||$._status===-1)&&($._status=2,$._result=O)}),$._status===-1&&($._status=0,$._result=ae)}if($._status===1)return $._result.default;throw $._result}var Be=typeof reportError=="function"?reportError:function($){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var ae=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof $=="object"&&$!==null&&typeof $.message=="string"?String($.message):String($),error:$});if(!window.dispatchEvent(ae))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",$);return}console.error($)},L={map:ee,forEach:function($,ae,O){ee($,function(){ae.apply(this,arguments)},O)},count:function($){var ae=0;return ee($,function(){ae++}),ae},toArray:function($){return ee($,function(ae){return ae})||[]},only:function($){if(!K($))throw Error("React.Children.only expected to receive a single React element child.");return $}};return bt.Activity=g,bt.Children=L,bt.Component=S,bt.Fragment=n,bt.Profiler=s,bt.PureComponent=N,bt.StrictMode=r,bt.Suspense=d,bt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=H,bt.__COMPILER_RUNTIME={__proto__:null,c:function($){return H.H.useMemoCache($)}},bt.cache=function($){return function(){return $.apply(null,arguments)}},bt.cacheSignal=function(){return null},bt.cloneElement=function($,ae,O){if($==null)throw Error("The argument must be a React element, but you passed "+$+".");var _e=k({},$.props),Re=$.key;if(ae!=null)for(we in ae.key!==void 0&&(Re=""+ae.key),ae)!Y.call(ae,we)||we==="key"||we==="__self"||we==="__source"||we==="ref"&&ae.ref===void 0||(_e[we]=ae[we]);var we=arguments.length-2;if(we===1)_e.children=O;else if(1<we){for(var et=Array(we),Fe=0;Fe<we;Fe++)et[Fe]=arguments[Fe+2];_e.children=et}return ue($.type,Re,_e)},bt.createContext=function($){return $={$$typeof:o,_currentValue:$,_currentValue2:$,_threadCount:0,Provider:null,Consumer:null},$.Provider=$,$.Consumer={$$typeof:l,_context:$},$},bt.createElement=function($,ae,O){var _e,Re={},we=null;if(ae!=null)for(_e in ae.key!==void 0&&(we=""+ae.key),ae)Y.call(ae,_e)&&_e!=="key"&&_e!=="__self"&&_e!=="__source"&&(Re[_e]=ae[_e]);var et=arguments.length-2;if(et===1)Re.children=O;else if(1<et){for(var Fe=Array(et),Ie=0;Ie<et;Ie++)Fe[Ie]=arguments[Ie+2];Re.children=Fe}if($&&$.defaultProps)for(_e in et=$.defaultProps,et)Re[_e]===void 0&&(Re[_e]=et[_e]);return ue($,we,Re)},bt.createRef=function(){return{current:null}},bt.forwardRef=function($){return{$$typeof:c,render:$}},bt.isValidElement=K,bt.lazy=function($){return{$$typeof:p,_payload:{_status:-1,_result:$},_init:ke}},bt.memo=function($,ae){return{$$typeof:m,type:$,compare:ae===void 0?null:ae}},bt.startTransition=function($){var ae=H.T,O={};H.T=O;try{var _e=$(),Re=H.S;Re!==null&&Re(O,_e),typeof _e=="object"&&_e!==null&&typeof _e.then=="function"&&_e.then(P,Be)}catch(we){Be(we)}finally{ae!==null&&O.types!==null&&(ae.types=O.types),H.T=ae}},bt.unstable_useCacheRefresh=function(){return H.H.useCacheRefresh()},bt.use=function($){return H.H.use($)},bt.useActionState=function($,ae,O){return H.H.useActionState($,ae,O)},bt.useCallback=function($,ae){return H.H.useCallback($,ae)},bt.useContext=function($){return H.H.useContext($)},bt.useDebugValue=function(){},bt.useDeferredValue=function($,ae){return H.H.useDeferredValue($,ae)},bt.useEffect=function($,ae){return H.H.useEffect($,ae)},bt.useEffectEvent=function($){return H.H.useEffectEvent($)},bt.useId=function(){return H.H.useId()},bt.useImperativeHandle=function($,ae,O){return H.H.useImperativeHandle($,ae,O)},bt.useInsertionEffect=function($,ae){return H.H.useInsertionEffect($,ae)},bt.useLayoutEffect=function($,ae){return H.H.useLayoutEffect($,ae)},bt.useMemo=function($,ae){return H.H.useMemo($,ae)},bt.useOptimistic=function($,ae){return H.H.useOptimistic($,ae)},bt.useReducer=function($,ae,O){return H.H.useReducer($,ae,O)},bt.useRef=function($){return H.H.useRef($)},bt.useState=function($){return H.H.useState($)},bt.useSyncExternalStore=function($,ae,O){return H.H.useSyncExternalStore($,ae,O)},bt.useTransition=function(){return H.H.useTransition()},bt.version="19.2.5",bt}var dE;function pg(){return dE||(dE=1,dp.exports=WA()),dp.exports}var T=pg();const QA=Bf(T);var fp={exports:{}},vu={},hp={exports:{}},mp={};/**
|
|
19
|
+
* @license React
|
|
20
|
+
* scheduler.production.js
|
|
21
|
+
*
|
|
22
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
23
|
+
*
|
|
24
|
+
* This source code is licensed under the MIT license found in the
|
|
25
|
+
* LICENSE file in the root directory of this source tree.
|
|
26
|
+
*/var fE;function XA(){return fE||(fE=1,(function(e){function t(z,ee){var ke=z.length;z.push(ee);e:for(;0<ke;){var Be=ke-1>>>1,L=z[Be];if(0<s(L,ee))z[Be]=ee,z[ke]=L,ke=Be;else break e}}function n(z){return z.length===0?null:z[0]}function r(z){if(z.length===0)return null;var ee=z[0],ke=z.pop();if(ke!==ee){z[0]=ke;e:for(var Be=0,L=z.length,$=L>>>1;Be<$;){var ae=2*(Be+1)-1,O=z[ae],_e=ae+1,Re=z[_e];if(0>s(O,ke))_e<L&&0>s(Re,O)?(z[Be]=Re,z[_e]=ke,Be=_e):(z[Be]=O,z[ae]=ke,Be=ae);else if(_e<L&&0>s(Re,ke))z[Be]=Re,z[_e]=ke,Be=_e;else break e}}return ee}function s(z,ee){var ke=z.sortIndex-ee.sortIndex;return ke!==0?ke:z.id-ee.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var o=Date,c=o.now();e.unstable_now=function(){return o.now()-c}}var d=[],m=[],p=1,g=null,y=3,E=!1,v=!1,k=!1,C=!1,S=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;function U(z){for(var ee=n(m);ee!==null;){if(ee.callback===null)r(m);else if(ee.startTime<=z)r(m),ee.sortIndex=ee.expirationTime,t(d,ee);else break;ee=n(m)}}function G(z){if(k=!1,U(z),!v)if(n(d)!==null)v=!0,P||(P=!0,F());else{var ee=n(m);ee!==null&&ne(G,ee.startTime-z)}}var P=!1,H=-1,Y=5,ue=-1;function M(){return C?!0:!(e.unstable_now()-ue<Y)}function K(){if(C=!1,P){var z=e.unstable_now();ue=z;var ee=!0;try{e:{v=!1,k&&(k=!1,A(H),H=-1),E=!0;var ke=y;try{t:{for(U(z),g=n(d);g!==null&&!(g.expirationTime>z&&M());){var Be=g.callback;if(typeof Be=="function"){g.callback=null,y=g.priorityLevel;var L=Be(g.expirationTime<=z);if(z=e.unstable_now(),typeof L=="function"){g.callback=L,U(z),ee=!0;break t}g===n(d)&&r(d),U(z)}else r(d);g=n(d)}if(g!==null)ee=!0;else{var $=n(m);$!==null&&ne(G,$.startTime-z),ee=!1}}break e}finally{g=null,y=ke,E=!1}ee=void 0}}finally{ee?F():P=!1}}}var F;if(typeof N=="function")F=function(){N(K)};else if(typeof MessageChannel<"u"){var ge=new MessageChannel,ce=ge.port2;ge.port1.onmessage=K,F=function(){ce.postMessage(null)}}else F=function(){S(K,0)};function ne(z,ee){H=S(function(){z(e.unstable_now())},ee)}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"):Y=0<z?Math.floor(1e3/z):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_next=function(z){switch(y){case 1:case 2:case 3:var ee=3;break;default:ee=y}var ke=y;y=ee;try{return z()}finally{y=ke}},e.unstable_requestPaint=function(){C=!0},e.unstable_runWithPriority=function(z,ee){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var ke=y;y=z;try{return ee()}finally{y=ke}},e.unstable_scheduleCallback=function(z,ee,ke){var Be=e.unstable_now();switch(typeof ke=="object"&&ke!==null?(ke=ke.delay,ke=typeof ke=="number"&&0<ke?Be+ke:Be):ke=Be,z){case 1:var L=-1;break;case 2:L=250;break;case 5:L=1073741823;break;case 4:L=1e4;break;default:L=5e3}return L=ke+L,z={id:p++,callback:ee,priorityLevel:z,startTime:ke,expirationTime:L,sortIndex:-1},ke>Be?(z.sortIndex=ke,t(m,z),n(d)===null&&z===n(m)&&(k?(A(H),H=-1):k=!0,ne(G,ke-Be))):(z.sortIndex=L,t(d,z),v||E||(v=!0,P||(P=!0,F()))),z},e.unstable_shouldYield=M,e.unstable_wrapCallback=function(z){var ee=y;return function(){var ke=y;y=ee;try{return z.apply(this,arguments)}finally{y=ke}}}})(mp)),mp}var hE;function KA(){return hE||(hE=1,hp.exports=XA()),hp.exports}var pp={exports:{}},nr={};/**
|
|
27
|
+
* @license React
|
|
28
|
+
* react-dom.production.js
|
|
29
|
+
*
|
|
30
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
31
|
+
*
|
|
32
|
+
* This source code is licensed under the MIT license found in the
|
|
33
|
+
* LICENSE file in the root directory of this source tree.
|
|
34
|
+
*/var mE;function ZA(){if(mE)return nr;mE=1;var e=pg();function t(d){var m="https://react.dev/errors/"+d;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)m+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+d+"; visit "+m+" 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 l(d,m,p){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:g==null?null:""+g,children:d,containerInfo:m,implementation:p}}var o=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(d,m){if(d==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return nr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,nr.createPortal=function(d,m){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!m||m.nodeType!==1&&m.nodeType!==9&&m.nodeType!==11)throw Error(t(299));return l(d,m,null,p)},nr.flushSync=function(d){var m=o.T,p=r.p;try{if(o.T=null,r.p=2,d)return d()}finally{o.T=m,r.p=p,r.d.f()}},nr.preconnect=function(d,m){typeof d=="string"&&(m?(m=m.crossOrigin,m=typeof m=="string"?m==="use-credentials"?m:"":void 0):m=null,r.d.C(d,m))},nr.prefetchDNS=function(d){typeof d=="string"&&r.d.D(d)},nr.preinit=function(d,m){if(typeof d=="string"&&m&&typeof m.as=="string"){var p=m.as,g=c(p,m.crossOrigin),y=typeof m.integrity=="string"?m.integrity:void 0,E=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;p==="style"?r.d.S(d,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:g,integrity:y,fetchPriority:E}):p==="script"&&r.d.X(d,{crossOrigin:g,integrity:y,fetchPriority:E,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},nr.preinitModule=function(d,m){if(typeof d=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var p=c(m.as,m.crossOrigin);r.d.M(d,{crossOrigin:p,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0})}}else m==null&&r.d.M(d)},nr.preload=function(d,m){if(typeof d=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var p=m.as,g=c(p,m.crossOrigin);r.d.L(d,p,{crossOrigin:g,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,type:typeof m.type=="string"?m.type:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0,referrerPolicy:typeof m.referrerPolicy=="string"?m.referrerPolicy:void 0,imageSrcSet:typeof m.imageSrcSet=="string"?m.imageSrcSet:void 0,imageSizes:typeof m.imageSizes=="string"?m.imageSizes:void 0,media:typeof m.media=="string"?m.media:void 0})}},nr.preloadModule=function(d,m){if(typeof d=="string")if(m){var p=c(m.as,m.crossOrigin);r.d.m(d,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:p,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else r.d.m(d)},nr.requestFormReset=function(d){r.d.r(d)},nr.unstable_batchedUpdates=function(d,m){return d(m)},nr.useFormState=function(d,m,p){return o.H.useFormState(d,m,p)},nr.useFormStatus=function(){return o.H.useHostTransitionStatus()},nr.version="19.2.5",nr}var pE;function MT(){if(pE)return pp.exports;pE=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(),pp.exports=ZA(),pp.exports}/**
|
|
35
|
+
* @license React
|
|
36
|
+
* react-dom-client.production.js
|
|
37
|
+
*
|
|
38
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
39
|
+
*
|
|
40
|
+
* This source code is licensed under the MIT license found in the
|
|
41
|
+
* LICENSE file in the root directory of this source tree.
|
|
42
|
+
*/var gE;function JA(){if(gE)return vu;gE=1;var e=KA(),t=pg(),n=MT();function r(a){var i="https://react.dev/errors/"+a;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var u=2;u<arguments.length;u++)i+="&args[]="+encodeURIComponent(arguments[u])}return"Minified React error #"+a+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function l(a){var i=a,u=a;if(a.alternate)for(;i.return;)i=i.return;else{a=i;do i=a,(i.flags&4098)!==0&&(u=i.return),a=i.return;while(a)}return i.tag===3?u:null}function o(a){if(a.tag===13){var i=a.memoizedState;if(i===null&&(a=a.alternate,a!==null&&(i=a.memoizedState)),i!==null)return i.dehydrated}return null}function c(a){if(a.tag===31){var i=a.memoizedState;if(i===null&&(a=a.alternate,a!==null&&(i=a.memoizedState)),i!==null)return i.dehydrated}return null}function d(a){if(l(a)!==a)throw Error(r(188))}function m(a){var i=a.alternate;if(!i){if(i=l(a),i===null)throw Error(r(188));return i!==a?null:a}for(var u=a,f=i;;){var b=u.return;if(b===null)break;var x=b.alternate;if(x===null){if(f=b.return,f!==null){u=f;continue}break}if(b.child===x.child){for(x=b.child;x;){if(x===u)return d(b),a;if(x===f)return d(b),i;x=x.sibling}throw Error(r(188))}if(u.return!==f.return)u=b,f=x;else{for(var w=!1,R=b.child;R;){if(R===u){w=!0,u=b,f=x;break}if(R===f){w=!0,f=b,u=x;break}R=R.sibling}if(!w){for(R=x.child;R;){if(R===u){w=!0,u=x,f=b;break}if(R===f){w=!0,f=x,u=b;break}R=R.sibling}if(!w)throw Error(r(189))}}if(u.alternate!==f)throw Error(r(190))}if(u.tag!==3)throw Error(r(188));return u.stateNode.current===u?a:i}function p(a){var i=a.tag;if(i===5||i===26||i===27||i===6)return a;for(a=a.child;a!==null;){if(i=p(a),i!==null)return i;a=a.sibling}return null}var g=Object.assign,y=Symbol.for("react.element"),E=Symbol.for("react.transitional.element"),v=Symbol.for("react.portal"),k=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),A=Symbol.for("react.consumer"),N=Symbol.for("react.context"),U=Symbol.for("react.forward_ref"),G=Symbol.for("react.suspense"),P=Symbol.for("react.suspense_list"),H=Symbol.for("react.memo"),Y=Symbol.for("react.lazy"),ue=Symbol.for("react.activity"),M=Symbol.for("react.memo_cache_sentinel"),K=Symbol.iterator;function F(a){return a===null||typeof a!="object"?null:(a=K&&a[K]||a["@@iterator"],typeof a=="function"?a:null)}var ge=Symbol.for("react.client.reference");function ce(a){if(a==null)return null;if(typeof a=="function")return a.$$typeof===ge?null:a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case k:return"Fragment";case S:return"Profiler";case C:return"StrictMode";case G:return"Suspense";case P:return"SuspenseList";case ue:return"Activity"}if(typeof a=="object")switch(a.$$typeof){case v:return"Portal";case N:return a.displayName||"Context";case A:return(a._context.displayName||"Context")+".Consumer";case U:var i=a.render;return a=a.displayName,a||(a=i.displayName||i.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case H:return i=a.displayName||null,i!==null?i:ce(a.type)||"Memo";case Y:i=a._payload,a=a._init;try{return ce(a(i))}catch{}}return null}var ne=Array.isArray,z=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ee=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ke={pending:!1,data:null,method:null,action:null},Be=[],L=-1;function $(a){return{current:a}}function ae(a){0>L||(a.current=Be[L],Be[L]=null,L--)}function O(a,i){L++,Be[L]=a.current,a.current=i}var _e=$(null),Re=$(null),we=$(null),et=$(null);function Fe(a,i){switch(O(we,i),O(Re,a),O(_e,null),i.nodeType){case 9:case 11:a=(a=i.documentElement)&&(a=a.namespaceURI)?Ny(a):0;break;default:if(a=i.tagName,i=i.namespaceURI)i=Ny(i),a=Ry(i,a);else switch(a){case"svg":a=1;break;case"math":a=2;break;default:a=0}}ae(_e),O(_e,a)}function Ie(){ae(_e),ae(Re),ae(we)}function kt(a){a.memoizedState!==null&&O(et,a);var i=_e.current,u=Ry(i,a.type);i!==u&&(O(Re,a),O(_e,u))}function at(a){Re.current===a&&(ae(_e),ae(Re)),et.current===a&&(ae(et),xu._currentValue=ke)}var Nt,Gt;function Ut(a){if(Nt===void 0)try{throw Error()}catch(u){var i=u.stack.trim().match(/\n( *(at )?)/);Nt=i&&i[1]||"",Gt=-1<u.stack.indexOf(`
|
|
43
|
+
at`)?" (<anonymous>)":-1<u.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
44
|
+
`+Nt+a+Gt}var Tt=!1;function rt(a,i){if(!a||Tt)return"";Tt=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var f={DetermineComponentFrameRoot:function(){try{if(i){var Te=function(){throw Error()};if(Object.defineProperty(Te.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Te,[])}catch(oe){var se=oe}Reflect.construct(a,[],Te)}else{try{Te.call()}catch(oe){se=oe}a.call(Te.prototype)}}else{try{throw Error()}catch(oe){se=oe}(Te=a())&&typeof Te.catch=="function"&&Te.catch(function(){})}}catch(oe){if(oe&&se&&typeof oe.stack=="string")return[oe.stack,se.stack]}return[null,null]}};f.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var b=Object.getOwnPropertyDescriptor(f.DetermineComponentFrameRoot,"name");b&&b.configurable&&Object.defineProperty(f.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var x=f.DetermineComponentFrameRoot(),w=x[0],R=x[1];if(w&&R){var q=w.split(`
|
|
45
|
+
`),ie=R.split(`
|
|
46
|
+
`);for(b=f=0;f<q.length&&!q[f].includes("DetermineComponentFrameRoot");)f++;for(;b<ie.length&&!ie[b].includes("DetermineComponentFrameRoot");)b++;if(f===q.length||b===ie.length)for(f=q.length-1,b=ie.length-1;1<=f&&0<=b&&q[f]!==ie[b];)b--;for(;1<=f&&0<=b;f--,b--)if(q[f]!==ie[b]){if(f!==1||b!==1)do if(f--,b--,0>b||q[f]!==ie[b]){var be=`
|
|
47
|
+
`+q[f].replace(" at new "," at ");return a.displayName&&be.includes("<anonymous>")&&(be=be.replace("<anonymous>",a.displayName)),be}while(1<=f&&0<=b);break}}}finally{Tt=!1,Error.prepareStackTrace=u}return(u=a?a.displayName||a.name:"")?Ut(u):""}function on(a,i){switch(a.tag){case 26:case 27:case 5:return Ut(a.type);case 16:return Ut("Lazy");case 13:return a.child!==i&&i!==null?Ut("Suspense Fallback"):Ut("Suspense");case 19:return Ut("SuspenseList");case 0:case 15:return rt(a.type,!1);case 11:return rt(a.type.render,!1);case 1:return rt(a.type,!0);case 31:return Ut("Activity");default:return""}}function it(a){try{var i="",u=null;do i+=on(a,u),u=a,a=a.return;while(a);return i}catch(f){return`
|
|
48
|
+
Error generating stack: `+f.message+`
|
|
49
|
+
`+f.stack}}var lt=Object.prototype.hasOwnProperty,ht=e.unstable_scheduleCallback,mn=e.unstable_cancelCallback,rn=e.unstable_shouldYield,An=e.unstable_requestPaint,qt=e.unstable_now,Zt=e.unstable_getCurrentPriorityLevel,me=e.unstable_ImmediatePriority,Ce=e.unstable_UserBlockingPriority,Ze=e.unstable_NormalPriority,ot=e.unstable_LowPriority,dt=e.unstable_IdlePriority,Qt=e.log,Ht=e.unstable_setDisableYieldValue,xe=null,Le=null;function Ke(a){if(typeof Qt=="function"&&Ht(a),Le&&typeof Le.setStrictMode=="function")try{Le.setStrictMode(xe,a)}catch{}}var $e=Math.clz32?Math.clz32:ve,nt=Math.log,Q=Math.LN2;function ve(a){return a>>>=0,a===0?32:31-(nt(a)/Q|0)|0}var ut=256,He=262144,We=4194304;function xt(a){var i=a&42;if(i!==0)return i;switch(a&-a){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 a&261888;case 262144:case 524288:case 1048576:case 2097152:return a&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return a&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return a}}function Ct(a,i,u){var f=a.pendingLanes;if(f===0)return 0;var b=0,x=a.suspendedLanes,w=a.pingedLanes;a=a.warmLanes;var R=f&134217727;return R!==0?(f=R&~x,f!==0?b=xt(f):(w&=R,w!==0?b=xt(w):u||(u=R&~a,u!==0&&(b=xt(u))))):(R=f&~x,R!==0?b=xt(R):w!==0?b=xt(w):u||(u=f&~a,u!==0&&(b=xt(u)))),b===0?0:i!==0&&i!==b&&(i&x)===0&&(x=b&-b,u=i&-i,x>=u||x===32&&(u&4194048)!==0)?i:b}function Qe(a,i){return(a.pendingLanes&~(a.suspendedLanes&~a.pingedLanes)&i)===0}function yt(a,i){switch(a){case 1:case 2:case 4:case 8:case 64:return i+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 i+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 Nn(){var a=We;return We<<=1,(We&62914560)===0&&(We=4194304),a}function or(a){for(var i=[],u=0;31>u;u++)i.push(a);return i}function dn(a,i){a.pendingLanes|=i,i!==268435456&&(a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0)}function Yt(a,i,u,f,b,x){var w=a.pendingLanes;a.pendingLanes=u,a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0,a.expiredLanes&=u,a.entangledLanes&=u,a.errorRecoveryDisabledLanes&=u,a.shellSuspendCounter=0;var R=a.entanglements,q=a.expirationTimes,ie=a.hiddenUpdates;for(u=w&~u;0<u;){var be=31-$e(u),Te=1<<be;R[be]=0,q[be]=-1;var se=ie[be];if(se!==null)for(ie[be]=null,be=0;be<se.length;be++){var oe=se[be];oe!==null&&(oe.lane&=-536870913)}u&=~Te}f!==0&&Ss(a,f,0),x!==0&&b===0&&a.tag!==0&&(a.suspendedLanes|=x&~(w&~i))}function Ss(a,i,u){a.pendingLanes|=i,a.suspendedLanes&=~i;var f=31-$e(i);a.entangledLanes|=i,a.entanglements[f]=a.entanglements[f]|1073741824|u&261930}function Li(a,i){var u=a.entangledLanes|=i;for(a=a.entanglements;u;){var f=31-$e(u),b=1<<f;b&i|a[f]&i&&(a[f]|=i),u&=~b}}function Hr(a,i){var u=i&-i;return u=(u&42)!==0?1:Ya(u),(u&(a.suspendedLanes|i))!==0?0:u}function Ya(a){switch(a){case 2:a=1;break;case 8:a=4;break;case 32:a=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:a=128;break;case 268435456:a=134217728;break;default:a=0}return a}function Ii(a){return a&=-a,2<a?8<a?(a&134217727)!==0?32:268435456:8:2}function Sa(){var a=ee.p;return a!==0?a:(a=window.event,a===void 0?32:Jy(a.type))}function oa(a,i){var u=ee.p;try{return ee.p=a,i()}finally{ee.p=u}}var pr=Math.random().toString(36).slice(2),ft="__reactFiber$"+pr,vt="__reactProps$"+pr,Xn="__reactContainer$"+pr,Tn="__reactEvents$"+pr,Mo="__reactListeners$"+pr,Po="__reactHandles$"+pr,Oi="__reactResources$"+pr,ua="__reactMarker$"+pr;function As(a){delete a[ft],delete a[vt],delete a[Tn],delete a[Mo],delete a[Po]}function ca(a){var i=a[ft];if(i)return i;for(var u=a.parentNode;u;){if(i=u[Xn]||u[ft]){if(u=i.alternate,i.child!==null||u!==null&&u.child!==null)for(a=Py(a);a!==null;){if(u=a[ft])return u;a=Py(a)}return i}a=u,u=a.parentNode}return null}function da(a){if(a=a[ft]||a[Xn]){var i=a.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return a}return null}function zr(a){var i=a.tag;if(i===5||i===26||i===27||i===6)return a.stateNode;throw Error(r(33))}function Fr(a){var i=a[Oi];return i||(i=a[Oi]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function pn(a){a[ua]=!0}var Di=new Set,Wa={};function gr(a,i){Cr(a,i),Cr(a+"Capture",i)}function Cr(a,i){for(Wa[a]=i,a=0;a<i.length;a++)Di.add(i[a])}var Aa=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]*$"),vn={},yl={};function Sr(a){return lt.call(yl,a)?!0:lt.call(vn,a)?!1:Aa.test(a)?yl[a]=!0:(vn[a]=!0,!1)}function Qa(a,i,u){if(Sr(i))if(u===null)a.removeAttribute(i);else{switch(typeof u){case"undefined":case"function":case"symbol":a.removeAttribute(i);return;case"boolean":var f=i.toLowerCase().slice(0,5);if(f!=="data-"&&f!=="aria-"){a.removeAttribute(i);return}}a.setAttribute(i,""+u)}}function fa(a,i,u){if(u===null)a.removeAttribute(i);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(i);return}a.setAttribute(i,""+u)}}function tr(a,i,u,f){if(f===null)a.removeAttribute(u);else{switch(typeof f){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(u);return}a.setAttributeNS(i,u,""+f)}}function Vn(a){switch(typeof a){case"bigint":case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function ji(a){var i=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function Ns(a,i,u){var f=Object.getOwnPropertyDescriptor(a.constructor.prototype,i);if(!a.hasOwnProperty(i)&&typeof f<"u"&&typeof f.get=="function"&&typeof f.set=="function"){var b=f.get,x=f.set;return Object.defineProperty(a,i,{configurable:!0,get:function(){return b.call(this)},set:function(w){u=""+w,x.call(this,w)}}),Object.defineProperty(a,i,{enumerable:f.enumerable}),{getValue:function(){return u},setValue:function(w){u=""+w},stopTracking:function(){a._valueTracker=null,delete a[i]}}}}function Mi(a){if(!a._valueTracker){var i=ji(a)?"checked":"value";a._valueTracker=Ns(a,i,""+a[i])}}function Xa(a){if(!a)return!1;var i=a._valueTracker;if(!i)return!0;var u=i.getValue(),f="";return a&&(f=ji(a)?a.checked?"true":"false":a.value),a=f,a!==u?(i.setValue(a),!0):!1}function ha(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}var Pi=/[\n"\\]/g;function Rn(a){return a.replace(Pi,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function Ln(a,i,u,f,b,x,w,R){a.name="",w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?a.type=w:a.removeAttribute("type"),i!=null?w==="number"?(i===0&&a.value===""||a.value!=i)&&(a.value=""+Vn(i)):a.value!==""+Vn(i)&&(a.value=""+Vn(i)):w!=="submit"&&w!=="reset"||a.removeAttribute("value"),i!=null?Bi(a,w,Vn(i)):u!=null?Bi(a,w,Vn(u)):f!=null&&a.removeAttribute("value"),b==null&&x!=null&&(a.defaultChecked=!!x),b!=null&&(a.checked=b&&typeof b!="function"&&typeof b!="symbol"),R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"?a.name=""+Vn(R):a.removeAttribute("name")}function Rs(a,i,u,f,b,x,w,R){if(x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(a.type=x),i!=null||u!=null){if(!(x!=="submit"&&x!=="reset"||i!=null)){Mi(a);return}u=u!=null?""+Vn(u):"",i=i!=null?""+Vn(i):u,R||i===a.value||(a.value=i),a.defaultValue=i}f=f??b,f=typeof f!="function"&&typeof f!="symbol"&&!!f,a.checked=R?a.checked:!!f,a.defaultChecked=!!f,w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(a.name=w),Mi(a)}function Bi(a,i,u){i==="number"&&ha(a.ownerDocument)===a||a.defaultValue===""+u||(a.defaultValue=""+u)}function Na(a,i,u,f){if(a=a.options,i){i={};for(var b=0;b<u.length;b++)i["$"+u[b]]=!0;for(u=0;u<a.length;u++)b=i.hasOwnProperty("$"+a[u].value),a[u].selected!==b&&(a[u].selected=b),b&&f&&(a[u].defaultSelected=!0)}else{for(u=""+Vn(u),i=null,b=0;b<a.length;b++){if(a[b].value===u){a[b].selected=!0,f&&(a[b].defaultSelected=!0);return}i!==null||a[b].disabled||(i=a[b])}i!==null&&(i.selected=!0)}}function El(a,i,u){if(i!=null&&(i=""+Vn(i),i!==a.value&&(a.value=i),u==null)){a.defaultValue!==i&&(a.defaultValue=i);return}a.defaultValue=u!=null?""+Vn(u):""}function _l(a,i,u,f){if(i==null){if(f!=null){if(u!=null)throw Error(r(92));if(ne(f)){if(1<f.length)throw Error(r(93));f=f[0]}u=f}u==null&&(u=""),i=u}u=Vn(i),a.defaultValue=u,f=a.textContent,f===u&&f!==""&&f!==null&&(a.value=f),Mi(a)}function Ra(a,i){if(i){var u=a.firstChild;if(u&&u===a.lastChild&&u.nodeType===3){u.nodeValue=i;return}}a.textContent=i}var Bo=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 La(a,i,u){var f=i.indexOf("--")===0;u==null||typeof u=="boolean"||u===""?f?a.setProperty(i,""):i==="float"?a.cssFloat="":a[i]="":f?a.setProperty(i,u):typeof u!="number"||u===0||Bo.has(i)?i==="float"?a.cssFloat=u:a[i]=(""+u).trim():a[i]=u+"px"}function Ka(a,i,u){if(i!=null&&typeof i!="object")throw Error(r(62));if(a=a.style,u!=null){for(var f in u)!u.hasOwnProperty(f)||i!=null&&i.hasOwnProperty(f)||(f.indexOf("--")===0?a.setProperty(f,""):f==="float"?a.cssFloat="":a[f]="");for(var b in i)f=i[b],i.hasOwnProperty(b)&&u[b]!==f&&La(a,b,f)}else for(var x in i)i.hasOwnProperty(x)&&La(a,x,i[x])}function Za(a){if(a.indexOf("-")===-1)return!1;switch(a){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 ma=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"]]),Tl=/^[\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 Ja(a){return Tl.test(""+a)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":a}function br(){}var Ui=null;function ei(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var Ia=null,$r=null;function Hi(a){var i=da(a);if(i&&(a=i.stateNode)){var u=a[vt]||null;e:switch(a=i.stateNode,i.type){case"input":if(Ln(a,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name),i=u.name,u.type==="radio"&&i!=null){for(u=a;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll('input[name="'+Rn(""+i)+'"][type="radio"]'),i=0;i<u.length;i++){var f=u[i];if(f!==a&&f.form===a.form){var b=f[vt]||null;if(!b)throw Error(r(90));Ln(f,b.value,b.defaultValue,b.defaultValue,b.checked,b.defaultChecked,b.type,b.name)}}for(i=0;i<u.length;i++)f=u[i],f.form===a.form&&Xa(f)}break e;case"textarea":El(a,u.value,u.defaultValue);break e;case"select":i=u.value,i!=null&&Na(a,!!u.multiple,i,!1)}}}var ti=!1;function Ls(a,i,u){if(ti)return a(i,u);ti=!0;try{var f=a(i);return f}finally{if(ti=!1,(Ia!==null||$r!==null)&&(ld(),Ia&&(i=Ia,a=$r,$r=Ia=null,Hi(i),a)))for(i=0;i<a.length;i++)Hi(a[i])}}function W(a,i){var u=a.stateNode;if(u===null)return null;var f=u[vt]||null;if(f===null)return null;u=f[i];e:switch(i){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)||(a=a.type,f=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!f;break e;default:a=!1}if(a)return null;if(u&&typeof u!="function")throw Error(r(231,i,typeof u));return u}var J=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),de=!1;if(J)try{var De={};Object.defineProperty(De,"passive",{get:function(){de=!0}}),window.addEventListener("test",De,De),window.removeEventListener("test",De,De)}catch{de=!1}var Ue=null,pt=null,I=null;function fe(){if(I)return I;var a,i=pt,u=i.length,f,b="value"in Ue?Ue.value:Ue.textContent,x=b.length;for(a=0;a<u&&i[a]===b[a];a++);var w=u-a;for(f=1;f<=w&&i[u-f]===b[x-f];f++);return I=b.slice(a,1<f?1-f:void 0)}function Ee(a){var i=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&i===13&&(a=13)):a=i,a===10&&(a=13),32<=a||a===13?a:0}function Ge(){return!0}function qe(){return!1}function je(a){function i(u,f,b,x,w){this._reactName=u,this._targetInst=b,this.type=f,this.nativeEvent=x,this.target=w,this.currentTarget=null;for(var R in a)a.hasOwnProperty(R)&&(u=a[R],this[R]=u?u(x):x[R]);return this.isDefaultPrevented=(x.defaultPrevented!=null?x.defaultPrevented:x.returnValue===!1)?Ge:qe,this.isPropagationStopped=qe,this}return g(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=Ge)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=Ge)},persist:function(){},isPersistent:Ge}),i}var Me={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},pe=je(Me),Ae=g({},Me,{view:0,detail:0}),Pe=je(Ae),mt,ze,Et,un=g({},Ae,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:hh,button:0,buttons:0,relatedTarget:function(a){return a.relatedTarget===void 0?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){return"movementX"in a?a.movementX:(a!==Et&&(Et&&a.type==="mousemove"?(mt=a.screenX-Et.screenX,ze=a.screenY-Et.screenY):ze=mt=0,Et=a),mt)},movementY:function(a){return"movementY"in a?a.movementY:ze}}),In=je(un),vl=g({},un,{dataTransfer:0}),kc=je(vl),$C=g({},Ae,{relatedTarget:0}),fh=je($C),VC=g({},Me,{animationName:0,elapsedTime:0,pseudoElement:0}),GC=je(VC),qC=g({},Me,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),YC=je(qC),WC=g({},Me,{data:0}),O1=je(WC),QC={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},XC={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"},KC={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ZC(a){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(a):(a=KC[a])?!!i[a]:!1}function hh(){return ZC}var JC=g({},Ae,{key:function(a){if(a.key){var i=QC[a.key]||a.key;if(i!=="Unidentified")return i}return a.type==="keypress"?(a=Ee(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?XC[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:hh,charCode:function(a){return a.type==="keypress"?Ee(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?Ee(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),eS=je(JC),tS=g({},un,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),D1=je(tS),nS=g({},Ae,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:hh}),rS=je(nS),aS=g({},Me,{propertyName:0,elapsedTime:0,pseudoElement:0}),iS=je(aS),sS=g({},un,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),lS=je(sS),oS=g({},Me,{newState:0,oldState:0}),uS=je(oS),cS=[9,13,27,32],mh=J&&"CompositionEvent"in window,Uo=null;J&&"documentMode"in document&&(Uo=document.documentMode);var dS=J&&"TextEvent"in window&&!Uo,j1=J&&(!mh||Uo&&8<Uo&&11>=Uo),M1=" ",P1=!1;function B1(a,i){switch(a){case"keyup":return cS.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function U1(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var wl=!1;function fS(a,i){switch(a){case"compositionend":return U1(i);case"keypress":return i.which!==32?null:(P1=!0,M1);case"textInput":return a=i.data,a===M1&&P1?null:a;default:return null}}function hS(a,i){if(wl)return a==="compositionend"||!mh&&B1(a,i)?(a=fe(),I=pt=Ue=null,wl=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return j1&&i.locale!=="ko"?null:i.data;default:return null}}var mS={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 H1(a){var i=a&&a.nodeName&&a.nodeName.toLowerCase();return i==="input"?!!mS[a.type]:i==="textarea"}function z1(a,i,u,f){Ia?$r?$r.push(f):$r=[f]:Ia=f,i=md(i,"onChange"),0<i.length&&(u=new pe("onChange","change",null,u,f),a.push({event:u,listeners:i}))}var Ho=null,zo=null;function pS(a){vy(a,0)}function Cc(a){var i=zr(a);if(Xa(i))return a}function F1(a,i){if(a==="change")return i}var $1=!1;if(J){var ph;if(J){var gh="oninput"in document;if(!gh){var V1=document.createElement("div");V1.setAttribute("oninput","return;"),gh=typeof V1.oninput=="function"}ph=gh}else ph=!1;$1=ph&&(!document.documentMode||9<document.documentMode)}function G1(){Ho&&(Ho.detachEvent("onpropertychange",q1),zo=Ho=null)}function q1(a){if(a.propertyName==="value"&&Cc(zo)){var i=[];z1(i,zo,a,ei(a)),Ls(pS,i)}}function gS(a,i,u){a==="focusin"?(G1(),Ho=i,zo=u,Ho.attachEvent("onpropertychange",q1)):a==="focusout"&&G1()}function bS(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return Cc(zo)}function xS(a,i){if(a==="click")return Cc(i)}function yS(a,i){if(a==="input"||a==="change")return Cc(i)}function ES(a,i){return a===i&&(a!==0||1/a===1/i)||a!==a&&i!==i}var Ar=typeof Object.is=="function"?Object.is:ES;function Fo(a,i){if(Ar(a,i))return!0;if(typeof a!="object"||a===null||typeof i!="object"||i===null)return!1;var u=Object.keys(a),f=Object.keys(i);if(u.length!==f.length)return!1;for(f=0;f<u.length;f++){var b=u[f];if(!lt.call(i,b)||!Ar(a[b],i[b]))return!1}return!0}function Y1(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function W1(a,i){var u=Y1(a);a=0;for(var f;u;){if(u.nodeType===3){if(f=a+u.textContent.length,a<=i&&f>=i)return{node:u,offset:i-a};a=f}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=Y1(u)}}function Q1(a,i){return a&&i?a===i?!0:a&&a.nodeType===3?!1:i&&i.nodeType===3?Q1(a,i.parentNode):"contains"in a?a.contains(i):a.compareDocumentPosition?!!(a.compareDocumentPosition(i)&16):!1:!1}function X1(a){a=a!=null&&a.ownerDocument!=null&&a.ownerDocument.defaultView!=null?a.ownerDocument.defaultView:window;for(var i=ha(a.document);i instanceof a.HTMLIFrameElement;){try{var u=typeof i.contentWindow.location.href=="string"}catch{u=!1}if(u)a=i.contentWindow;else break;i=ha(a.document)}return i}function bh(a){var i=a&&a.nodeName&&a.nodeName.toLowerCase();return i&&(i==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||i==="textarea"||a.contentEditable==="true")}var _S=J&&"documentMode"in document&&11>=document.documentMode,kl=null,xh=null,$o=null,yh=!1;function K1(a,i,u){var f=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;yh||kl==null||kl!==ha(f)||(f=kl,"selectionStart"in f&&bh(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}),$o&&Fo($o,f)||($o=f,f=md(xh,"onSelect"),0<f.length&&(i=new pe("onSelect","select",null,i,u),a.push({event:i,listeners:f}),i.target=kl)))}function Is(a,i){var u={};return u[a.toLowerCase()]=i.toLowerCase(),u["Webkit"+a]="webkit"+i,u["Moz"+a]="moz"+i,u}var Cl={animationend:Is("Animation","AnimationEnd"),animationiteration:Is("Animation","AnimationIteration"),animationstart:Is("Animation","AnimationStart"),transitionrun:Is("Transition","TransitionRun"),transitionstart:Is("Transition","TransitionStart"),transitioncancel:Is("Transition","TransitionCancel"),transitionend:Is("Transition","TransitionEnd")},Eh={},Z1={};J&&(Z1=document.createElement("div").style,"AnimationEvent"in window||(delete Cl.animationend.animation,delete Cl.animationiteration.animation,delete Cl.animationstart.animation),"TransitionEvent"in window||delete Cl.transitionend.transition);function Os(a){if(Eh[a])return Eh[a];if(!Cl[a])return a;var i=Cl[a],u;for(u in i)if(i.hasOwnProperty(u)&&u in Z1)return Eh[a]=i[u];return a}var J1=Os("animationend"),eb=Os("animationiteration"),tb=Os("animationstart"),TS=Os("transitionrun"),vS=Os("transitionstart"),wS=Os("transitioncancel"),nb=Os("transitionend"),rb=new Map,_h="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(" ");_h.push("scrollEnd");function pa(a,i){rb.set(a,i),gr(i,[a])}var Sc=typeof reportError=="function"?reportError:function(a){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof a=="object"&&a!==null&&typeof a.message=="string"?String(a.message):String(a),error:a});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",a);return}console.error(a)},Vr=[],Sl=0,Th=0;function Ac(){for(var a=Sl,i=Th=Sl=0;i<a;){var u=Vr[i];Vr[i++]=null;var f=Vr[i];Vr[i++]=null;var b=Vr[i];Vr[i++]=null;var x=Vr[i];if(Vr[i++]=null,f!==null&&b!==null){var w=f.pending;w===null?b.next=b:(b.next=w.next,w.next=b),f.pending=b}x!==0&&ab(u,b,x)}}function Nc(a,i,u,f){Vr[Sl++]=a,Vr[Sl++]=i,Vr[Sl++]=u,Vr[Sl++]=f,Th|=f,a.lanes|=f,a=a.alternate,a!==null&&(a.lanes|=f)}function vh(a,i,u,f){return Nc(a,i,u,f),Rc(a)}function Ds(a,i){return Nc(a,null,null,i),Rc(a)}function ab(a,i,u){a.lanes|=u;var f=a.alternate;f!==null&&(f.lanes|=u);for(var b=!1,x=a.return;x!==null;)x.childLanes|=u,f=x.alternate,f!==null&&(f.childLanes|=u),x.tag===22&&(a=x.stateNode,a===null||a._visibility&1||(b=!0)),a=x,x=x.return;return a.tag===3?(x=a.stateNode,b&&i!==null&&(b=31-$e(u),a=x.hiddenUpdates,f=a[b],f===null?a[b]=[i]:f.push(i),i.lane=u|536870912),x):null}function Rc(a){if(50<du)throw du=0,Im=null,Error(r(185));for(var i=a.return;i!==null;)a=i,i=a.return;return a.tag===3?a.stateNode:null}var Al={};function kS(a,i,u,f){this.tag=a,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=i,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 Nr(a,i,u,f){return new kS(a,i,u,f)}function wh(a){return a=a.prototype,!(!a||!a.isReactComponent)}function ni(a,i){var u=a.alternate;return u===null?(u=Nr(a.tag,i,a.key,a.mode),u.elementType=a.elementType,u.type=a.type,u.stateNode=a.stateNode,u.alternate=a,a.alternate=u):(u.pendingProps=i,u.type=a.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=a.flags&65011712,u.childLanes=a.childLanes,u.lanes=a.lanes,u.child=a.child,u.memoizedProps=a.memoizedProps,u.memoizedState=a.memoizedState,u.updateQueue=a.updateQueue,i=a.dependencies,u.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},u.sibling=a.sibling,u.index=a.index,u.ref=a.ref,u.refCleanup=a.refCleanup,u}function ib(a,i){a.flags&=65011714;var u=a.alternate;return u===null?(a.childLanes=0,a.lanes=i,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=u.childLanes,a.lanes=u.lanes,a.child=u.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=u.memoizedProps,a.memoizedState=u.memoizedState,a.updateQueue=u.updateQueue,a.type=u.type,i=u.dependencies,a.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),a}function Lc(a,i,u,f,b,x){var w=0;if(f=a,typeof a=="function")wh(a)&&(w=1);else if(typeof a=="string")w=RA(a,u,_e.current)?26:a==="html"||a==="head"||a==="body"?27:5;else e:switch(a){case ue:return a=Nr(31,u,i,b),a.elementType=ue,a.lanes=x,a;case k:return js(u.children,b,x,i);case C:w=8,b|=24;break;case S:return a=Nr(12,u,i,b|2),a.elementType=S,a.lanes=x,a;case G:return a=Nr(13,u,i,b),a.elementType=G,a.lanes=x,a;case P:return a=Nr(19,u,i,b),a.elementType=P,a.lanes=x,a;default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case N:w=10;break e;case A:w=9;break e;case U:w=11;break e;case H:w=14;break e;case Y:w=16,f=null;break e}w=29,u=Error(r(130,a===null?"null":typeof a,"")),f=null}return i=Nr(w,u,i,b),i.elementType=a,i.type=f,i.lanes=x,i}function js(a,i,u,f){return a=Nr(7,a,f,i),a.lanes=u,a}function kh(a,i,u){return a=Nr(6,a,null,i),a.lanes=u,a}function sb(a){var i=Nr(18,null,null,0);return i.stateNode=a,i}function Ch(a,i,u){return i=Nr(4,a.children!==null?a.children:[],a.key,i),i.lanes=u,i.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},i}var lb=new WeakMap;function Gr(a,i){if(typeof a=="object"&&a!==null){var u=lb.get(a);return u!==void 0?u:(i={value:a,source:i,stack:it(i)},lb.set(a,i),i)}return{value:a,source:i,stack:it(i)}}var Nl=[],Rl=0,Ic=null,Vo=0,qr=[],Yr=0,zi=null,Oa=1,Da="";function ri(a,i){Nl[Rl++]=Vo,Nl[Rl++]=Ic,Ic=a,Vo=i}function ob(a,i,u){qr[Yr++]=Oa,qr[Yr++]=Da,qr[Yr++]=zi,zi=a;var f=Oa;a=Da;var b=32-$e(f)-1;f&=~(1<<b),u+=1;var x=32-$e(i)+b;if(30<x){var w=b-b%5;x=(f&(1<<w)-1).toString(32),f>>=w,b-=w,Oa=1<<32-$e(i)+b|u<<b|f,Da=x+a}else Oa=1<<x|u<<b|f,Da=a}function Sh(a){a.return!==null&&(ri(a,1),ob(a,1,0))}function Ah(a){for(;a===Ic;)Ic=Nl[--Rl],Nl[Rl]=null,Vo=Nl[--Rl],Nl[Rl]=null;for(;a===zi;)zi=qr[--Yr],qr[Yr]=null,Da=qr[--Yr],qr[Yr]=null,Oa=qr[--Yr],qr[Yr]=null}function ub(a,i){qr[Yr++]=Oa,qr[Yr++]=Da,qr[Yr++]=zi,Oa=i.id,Da=i.overflow,zi=a}var Kn=null,fn=null,Bt=!1,Fi=null,Wr=!1,Nh=Error(r(519));function $i(a){var i=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Go(Gr(i,a)),Nh}function cb(a){var i=a.stateNode,u=a.type,f=a.memoizedProps;switch(i[ft]=a,i[vt]=f,u){case"dialog":Dt("cancel",i),Dt("close",i);break;case"iframe":case"object":case"embed":Dt("load",i);break;case"video":case"audio":for(u=0;u<hu.length;u++)Dt(hu[u],i);break;case"source":Dt("error",i);break;case"img":case"image":case"link":Dt("error",i),Dt("load",i);break;case"details":Dt("toggle",i);break;case"input":Dt("invalid",i),Rs(i,f.value,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name,!0);break;case"select":Dt("invalid",i);break;case"textarea":Dt("invalid",i),_l(i,f.value,f.defaultValue,f.children)}u=f.children,typeof u!="string"&&typeof u!="number"&&typeof u!="bigint"||i.textContent===""+u||f.suppressHydrationWarning===!0||Sy(i.textContent,u)?(f.popover!=null&&(Dt("beforetoggle",i),Dt("toggle",i)),f.onScroll!=null&&Dt("scroll",i),f.onScrollEnd!=null&&Dt("scrollend",i),f.onClick!=null&&(i.onclick=br),i=!0):i=!1,i||$i(a,!0)}function db(a){for(Kn=a.return;Kn;)switch(Kn.tag){case 5:case 31:case 13:Wr=!1;return;case 27:case 3:Wr=!0;return;default:Kn=Kn.return}}function Ll(a){if(a!==Kn)return!1;if(!Bt)return db(a),Bt=!0,!1;var i=a.tag,u;if((u=i!==3&&i!==27)&&((u=i===5)&&(u=a.type,u=!(u!=="form"&&u!=="button")||Ym(a.type,a.memoizedProps)),u=!u),u&&fn&&$i(a),db(a),i===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(317));fn=My(a)}else if(i===31){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(317));fn=My(a)}else i===27?(i=fn,rs(a.type)?(a=Zm,Zm=null,fn=a):fn=i):fn=Kn?Xr(a.stateNode.nextSibling):null;return!0}function Ms(){fn=Kn=null,Bt=!1}function Rh(){var a=Fi;return a!==null&&(_r===null?_r=a:_r.push.apply(_r,a),Fi=null),a}function Go(a){Fi===null?Fi=[a]:Fi.push(a)}var Lh=$(null),Ps=null,ai=null;function Vi(a,i,u){O(Lh,i._currentValue),i._currentValue=u}function ii(a){a._currentValue=Lh.current,ae(Lh)}function Ih(a,i,u){for(;a!==null;){var f=a.alternate;if((a.childLanes&i)!==i?(a.childLanes|=i,f!==null&&(f.childLanes|=i)):f!==null&&(f.childLanes&i)!==i&&(f.childLanes|=i),a===u)break;a=a.return}}function Oh(a,i,u,f){var b=a.child;for(b!==null&&(b.return=a);b!==null;){var x=b.dependencies;if(x!==null){var w=b.child;x=x.firstContext;e:for(;x!==null;){var R=x;x=b;for(var q=0;q<i.length;q++)if(R.context===i[q]){x.lanes|=u,R=x.alternate,R!==null&&(R.lanes|=u),Ih(x.return,u,a),f||(w=null);break e}x=R.next}}else if(b.tag===18){if(w=b.return,w===null)throw Error(r(341));w.lanes|=u,x=w.alternate,x!==null&&(x.lanes|=u),Ih(w,u,a),w=null}else w=b.child;if(w!==null)w.return=b;else for(w=b;w!==null;){if(w===a){w=null;break}if(b=w.sibling,b!==null){b.return=w.return,w=b;break}w=w.return}b=w}}function Il(a,i,u,f){a=null;for(var b=i,x=!1;b!==null;){if(!x){if((b.flags&524288)!==0)x=!0;else if((b.flags&262144)!==0)break}if(b.tag===10){var w=b.alternate;if(w===null)throw Error(r(387));if(w=w.memoizedProps,w!==null){var R=b.type;Ar(b.pendingProps.value,w.value)||(a!==null?a.push(R):a=[R])}}else if(b===et.current){if(w=b.alternate,w===null)throw Error(r(387));w.memoizedState.memoizedState!==b.memoizedState.memoizedState&&(a!==null?a.push(xu):a=[xu])}b=b.return}a!==null&&Oh(i,a,u,f),i.flags|=262144}function Oc(a){for(a=a.firstContext;a!==null;){if(!Ar(a.context._currentValue,a.memoizedValue))return!0;a=a.next}return!1}function Bs(a){Ps=a,ai=null,a=a.dependencies,a!==null&&(a.firstContext=null)}function Zn(a){return fb(Ps,a)}function Dc(a,i){return Ps===null&&Bs(a),fb(a,i)}function fb(a,i){var u=i._currentValue;if(i={context:i,memoizedValue:u,next:null},ai===null){if(a===null)throw Error(r(308));ai=i,a.dependencies={lanes:0,firstContext:i},a.flags|=524288}else ai=ai.next=i;return u}var CS=typeof AbortController<"u"?AbortController:function(){var a=[],i=this.signal={aborted:!1,addEventListener:function(u,f){a.push(f)}};this.abort=function(){i.aborted=!0,a.forEach(function(u){return u()})}},SS=e.unstable_scheduleCallback,AS=e.unstable_NormalPriority,On={$$typeof:N,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Dh(){return{controller:new CS,data:new Map,refCount:0}}function qo(a){a.refCount--,a.refCount===0&&SS(AS,function(){a.controller.abort()})}var Yo=null,jh=0,Ol=0,Dl=null;function NS(a,i){if(Yo===null){var u=Yo=[];jh=0,Ol=Bm(),Dl={status:"pending",value:void 0,then:function(f){u.push(f)}}}return jh++,i.then(hb,hb),i}function hb(){if(--jh===0&&Yo!==null){Dl!==null&&(Dl.status="fulfilled");var a=Yo;Yo=null,Ol=0,Dl=null;for(var i=0;i<a.length;i++)(0,a[i])()}}function RS(a,i){var u=[],f={status:"pending",value:null,reason:null,then:function(b){u.push(b)}};return a.then(function(){f.status="fulfilled",f.value=i;for(var b=0;b<u.length;b++)(0,u[b])(i)},function(b){for(f.status="rejected",f.reason=b,b=0;b<u.length;b++)(0,u[b])(void 0)}),f}var mb=z.S;z.S=function(a,i){Kx=qt(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&NS(a,i),mb!==null&&mb(a,i)};var Us=$(null);function Mh(){var a=Us.current;return a!==null?a:an.pooledCache}function jc(a,i){i===null?O(Us,Us.current):O(Us,i.pool)}function pb(){var a=Mh();return a===null?null:{parent:On._currentValue,pool:a}}var jl=Error(r(460)),Ph=Error(r(474)),Mc=Error(r(542)),Pc={then:function(){}};function gb(a){return a=a.status,a==="fulfilled"||a==="rejected"}function bb(a,i,u){switch(u=a[u],u===void 0?a.push(i):u!==i&&(i.then(br,br),i=u),i.status){case"fulfilled":return i.value;case"rejected":throw a=i.reason,yb(a),a;default:if(typeof i.status=="string")i.then(br,br);else{if(a=an,a!==null&&100<a.shellSuspendCounter)throw Error(r(482));a=i,a.status="pending",a.then(function(f){if(i.status==="pending"){var b=i;b.status="fulfilled",b.value=f}},function(f){if(i.status==="pending"){var b=i;b.status="rejected",b.reason=f}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw a=i.reason,yb(a),a}throw zs=i,jl}}function Hs(a){try{var i=a._init;return i(a._payload)}catch(u){throw u!==null&&typeof u=="object"&&typeof u.then=="function"?(zs=u,jl):u}}var zs=null;function xb(){if(zs===null)throw Error(r(459));var a=zs;return zs=null,a}function yb(a){if(a===jl||a===Mc)throw Error(r(483))}var Ml=null,Wo=0;function Bc(a){var i=Wo;return Wo+=1,Ml===null&&(Ml=[]),bb(Ml,a,i)}function Qo(a,i){i=i.props.ref,a.ref=i!==void 0?i:null}function Uc(a,i){throw i.$$typeof===y?Error(r(525)):(a=Object.prototype.toString.call(i),Error(r(31,a==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":a)))}function Eb(a){function i(Z,X){if(a){var re=Z.deletions;re===null?(Z.deletions=[X],Z.flags|=16):re.push(X)}}function u(Z,X){if(!a)return null;for(;X!==null;)i(Z,X),X=X.sibling;return null}function f(Z){for(var X=new Map;Z!==null;)Z.key!==null?X.set(Z.key,Z):X.set(Z.index,Z),Z=Z.sibling;return X}function b(Z,X){return Z=ni(Z,X),Z.index=0,Z.sibling=null,Z}function x(Z,X,re){return Z.index=re,a?(re=Z.alternate,re!==null?(re=re.index,re<X?(Z.flags|=67108866,X):re):(Z.flags|=67108866,X)):(Z.flags|=1048576,X)}function w(Z){return a&&Z.alternate===null&&(Z.flags|=67108866),Z}function R(Z,X,re,ye){return X===null||X.tag!==6?(X=kh(re,Z.mode,ye),X.return=Z,X):(X=b(X,re),X.return=Z,X)}function q(Z,X,re,ye){var tt=re.type;return tt===k?be(Z,X,re.props.children,ye,re.key):X!==null&&(X.elementType===tt||typeof tt=="object"&&tt!==null&&tt.$$typeof===Y&&Hs(tt)===X.type)?(X=b(X,re.props),Qo(X,re),X.return=Z,X):(X=Lc(re.type,re.key,re.props,null,Z.mode,ye),Qo(X,re),X.return=Z,X)}function ie(Z,X,re,ye){return X===null||X.tag!==4||X.stateNode.containerInfo!==re.containerInfo||X.stateNode.implementation!==re.implementation?(X=Ch(re,Z.mode,ye),X.return=Z,X):(X=b(X,re.children||[]),X.return=Z,X)}function be(Z,X,re,ye,tt){return X===null||X.tag!==7?(X=js(re,Z.mode,ye,tt),X.return=Z,X):(X=b(X,re),X.return=Z,X)}function Te(Z,X,re){if(typeof X=="string"&&X!==""||typeof X=="number"||typeof X=="bigint")return X=kh(""+X,Z.mode,re),X.return=Z,X;if(typeof X=="object"&&X!==null){switch(X.$$typeof){case E:return re=Lc(X.type,X.key,X.props,null,Z.mode,re),Qo(re,X),re.return=Z,re;case v:return X=Ch(X,Z.mode,re),X.return=Z,X;case Y:return X=Hs(X),Te(Z,X,re)}if(ne(X)||F(X))return X=js(X,Z.mode,re,null),X.return=Z,X;if(typeof X.then=="function")return Te(Z,Bc(X),re);if(X.$$typeof===N)return Te(Z,Dc(Z,X),re);Uc(Z,X)}return null}function se(Z,X,re,ye){var tt=X!==null?X.key:null;if(typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint")return tt!==null?null:R(Z,X,""+re,ye);if(typeof re=="object"&&re!==null){switch(re.$$typeof){case E:return re.key===tt?q(Z,X,re,ye):null;case v:return re.key===tt?ie(Z,X,re,ye):null;case Y:return re=Hs(re),se(Z,X,re,ye)}if(ne(re)||F(re))return tt!==null?null:be(Z,X,re,ye,null);if(typeof re.then=="function")return se(Z,X,Bc(re),ye);if(re.$$typeof===N)return se(Z,X,Dc(Z,re),ye);Uc(Z,re)}return null}function oe(Z,X,re,ye,tt){if(typeof ye=="string"&&ye!==""||typeof ye=="number"||typeof ye=="bigint")return Z=Z.get(re)||null,R(X,Z,""+ye,tt);if(typeof ye=="object"&&ye!==null){switch(ye.$$typeof){case E:return Z=Z.get(ye.key===null?re:ye.key)||null,q(X,Z,ye,tt);case v:return Z=Z.get(ye.key===null?re:ye.key)||null,ie(X,Z,ye,tt);case Y:return ye=Hs(ye),oe(Z,X,re,ye,tt)}if(ne(ye)||F(ye))return Z=Z.get(re)||null,be(X,Z,ye,tt,null);if(typeof ye.then=="function")return oe(Z,X,re,Bc(ye),tt);if(ye.$$typeof===N)return oe(Z,X,re,Dc(X,ye),tt);Uc(X,ye)}return null}function Ve(Z,X,re,ye){for(var tt=null,$t=null,Je=X,St=X=0,Pt=null;Je!==null&&St<re.length;St++){Je.index>St?(Pt=Je,Je=null):Pt=Je.sibling;var Vt=se(Z,Je,re[St],ye);if(Vt===null){Je===null&&(Je=Pt);break}a&&Je&&Vt.alternate===null&&i(Z,Je),X=x(Vt,X,St),$t===null?tt=Vt:$t.sibling=Vt,$t=Vt,Je=Pt}if(St===re.length)return u(Z,Je),Bt&&ri(Z,St),tt;if(Je===null){for(;St<re.length;St++)Je=Te(Z,re[St],ye),Je!==null&&(X=x(Je,X,St),$t===null?tt=Je:$t.sibling=Je,$t=Je);return Bt&&ri(Z,St),tt}for(Je=f(Je);St<re.length;St++)Pt=oe(Je,Z,St,re[St],ye),Pt!==null&&(a&&Pt.alternate!==null&&Je.delete(Pt.key===null?St:Pt.key),X=x(Pt,X,St),$t===null?tt=Pt:$t.sibling=Pt,$t=Pt);return a&&Je.forEach(function(os){return i(Z,os)}),Bt&&ri(Z,St),tt}function ct(Z,X,re,ye){if(re==null)throw Error(r(151));for(var tt=null,$t=null,Je=X,St=X=0,Pt=null,Vt=re.next();Je!==null&&!Vt.done;St++,Vt=re.next()){Je.index>St?(Pt=Je,Je=null):Pt=Je.sibling;var os=se(Z,Je,Vt.value,ye);if(os===null){Je===null&&(Je=Pt);break}a&&Je&&os.alternate===null&&i(Z,Je),X=x(os,X,St),$t===null?tt=os:$t.sibling=os,$t=os,Je=Pt}if(Vt.done)return u(Z,Je),Bt&&ri(Z,St),tt;if(Je===null){for(;!Vt.done;St++,Vt=re.next())Vt=Te(Z,Vt.value,ye),Vt!==null&&(X=x(Vt,X,St),$t===null?tt=Vt:$t.sibling=Vt,$t=Vt);return Bt&&ri(Z,St),tt}for(Je=f(Je);!Vt.done;St++,Vt=re.next())Vt=oe(Je,Z,St,Vt.value,ye),Vt!==null&&(a&&Vt.alternate!==null&&Je.delete(Vt.key===null?St:Vt.key),X=x(Vt,X,St),$t===null?tt=Vt:$t.sibling=Vt,$t=Vt);return a&&Je.forEach(function(zA){return i(Z,zA)}),Bt&&ri(Z,St),tt}function tn(Z,X,re,ye){if(typeof re=="object"&&re!==null&&re.type===k&&re.key===null&&(re=re.props.children),typeof re=="object"&&re!==null){switch(re.$$typeof){case E:e:{for(var tt=re.key;X!==null;){if(X.key===tt){if(tt=re.type,tt===k){if(X.tag===7){u(Z,X.sibling),ye=b(X,re.props.children),ye.return=Z,Z=ye;break e}}else if(X.elementType===tt||typeof tt=="object"&&tt!==null&&tt.$$typeof===Y&&Hs(tt)===X.type){u(Z,X.sibling),ye=b(X,re.props),Qo(ye,re),ye.return=Z,Z=ye;break e}u(Z,X);break}else i(Z,X);X=X.sibling}re.type===k?(ye=js(re.props.children,Z.mode,ye,re.key),ye.return=Z,Z=ye):(ye=Lc(re.type,re.key,re.props,null,Z.mode,ye),Qo(ye,re),ye.return=Z,Z=ye)}return w(Z);case v:e:{for(tt=re.key;X!==null;){if(X.key===tt)if(X.tag===4&&X.stateNode.containerInfo===re.containerInfo&&X.stateNode.implementation===re.implementation){u(Z,X.sibling),ye=b(X,re.children||[]),ye.return=Z,Z=ye;break e}else{u(Z,X);break}else i(Z,X);X=X.sibling}ye=Ch(re,Z.mode,ye),ye.return=Z,Z=ye}return w(Z);case Y:return re=Hs(re),tn(Z,X,re,ye)}if(ne(re))return Ve(Z,X,re,ye);if(F(re)){if(tt=F(re),typeof tt!="function")throw Error(r(150));return re=tt.call(re),ct(Z,X,re,ye)}if(typeof re.then=="function")return tn(Z,X,Bc(re),ye);if(re.$$typeof===N)return tn(Z,X,Dc(Z,re),ye);Uc(Z,re)}return typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint"?(re=""+re,X!==null&&X.tag===6?(u(Z,X.sibling),ye=b(X,re),ye.return=Z,Z=ye):(u(Z,X),ye=kh(re,Z.mode,ye),ye.return=Z,Z=ye),w(Z)):u(Z,X)}return function(Z,X,re,ye){try{Wo=0;var tt=tn(Z,X,re,ye);return Ml=null,tt}catch(Je){if(Je===jl||Je===Mc)throw Je;var $t=Nr(29,Je,null,Z.mode);return $t.lanes=ye,$t.return=Z,$t}finally{}}}var Fs=Eb(!0),_b=Eb(!1),Gi=!1;function Bh(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Uh(a,i){a=a.updateQueue,i.updateQueue===a&&(i.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,callbacks:null})}function qi(a){return{lane:a,tag:0,payload:null,callback:null,next:null}}function Yi(a,i,u){var f=a.updateQueue;if(f===null)return null;if(f=f.shared,(Wt&2)!==0){var b=f.pending;return b===null?i.next=i:(i.next=b.next,b.next=i),f.pending=i,i=Rc(a),ab(a,null,u),i}return Nc(a,f,i,u),Rc(a)}function Xo(a,i,u){if(i=i.updateQueue,i!==null&&(i=i.shared,(u&4194048)!==0)){var f=i.lanes;f&=a.pendingLanes,u|=f,i.lanes=u,Li(a,u)}}function Hh(a,i){var u=a.updateQueue,f=a.alternate;if(f!==null&&(f=f.updateQueue,u===f)){var b=null,x=null;if(u=u.firstBaseUpdate,u!==null){do{var w={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};x===null?b=x=w:x=x.next=w,u=u.next}while(u!==null);x===null?b=x=i:x=x.next=i}else b=x=i;u={baseState:f.baseState,firstBaseUpdate:b,lastBaseUpdate:x,shared:f.shared,callbacks:f.callbacks},a.updateQueue=u;return}a=u.lastBaseUpdate,a===null?u.firstBaseUpdate=i:a.next=i,u.lastBaseUpdate=i}var zh=!1;function Ko(){if(zh){var a=Dl;if(a!==null)throw a}}function Zo(a,i,u,f){zh=!1;var b=a.updateQueue;Gi=!1;var x=b.firstBaseUpdate,w=b.lastBaseUpdate,R=b.shared.pending;if(R!==null){b.shared.pending=null;var q=R,ie=q.next;q.next=null,w===null?x=ie:w.next=ie,w=q;var be=a.alternate;be!==null&&(be=be.updateQueue,R=be.lastBaseUpdate,R!==w&&(R===null?be.firstBaseUpdate=ie:R.next=ie,be.lastBaseUpdate=q))}if(x!==null){var Te=b.baseState;w=0,be=ie=q=null,R=x;do{var se=R.lane&-536870913,oe=se!==R.lane;if(oe?(Mt&se)===se:(f&se)===se){se!==0&&se===Ol&&(zh=!0),be!==null&&(be=be.next={lane:0,tag:R.tag,payload:R.payload,callback:null,next:null});e:{var Ve=a,ct=R;se=i;var tn=u;switch(ct.tag){case 1:if(Ve=ct.payload,typeof Ve=="function"){Te=Ve.call(tn,Te,se);break e}Te=Ve;break e;case 3:Ve.flags=Ve.flags&-65537|128;case 0:if(Ve=ct.payload,se=typeof Ve=="function"?Ve.call(tn,Te,se):Ve,se==null)break e;Te=g({},Te,se);break e;case 2:Gi=!0}}se=R.callback,se!==null&&(a.flags|=64,oe&&(a.flags|=8192),oe=b.callbacks,oe===null?b.callbacks=[se]:oe.push(se))}else oe={lane:se,tag:R.tag,payload:R.payload,callback:R.callback,next:null},be===null?(ie=be=oe,q=Te):be=be.next=oe,w|=se;if(R=R.next,R===null){if(R=b.shared.pending,R===null)break;oe=R,R=oe.next,oe.next=null,b.lastBaseUpdate=oe,b.shared.pending=null}}while(!0);be===null&&(q=Te),b.baseState=q,b.firstBaseUpdate=ie,b.lastBaseUpdate=be,x===null&&(b.shared.lanes=0),Zi|=w,a.lanes=w,a.memoizedState=Te}}function Tb(a,i){if(typeof a!="function")throw Error(r(191,a));a.call(i)}function vb(a,i){var u=a.callbacks;if(u!==null)for(a.callbacks=null,a=0;a<u.length;a++)Tb(u[a],i)}var Pl=$(null),Hc=$(0);function wb(a,i){a=mi,O(Hc,a),O(Pl,i),mi=a|i.baseLanes}function Fh(){O(Hc,mi),O(Pl,Pl.current)}function $h(){mi=Hc.current,ae(Pl),ae(Hc)}var Rr=$(null),Qr=null;function Wi(a){var i=a.alternate;O(wn,wn.current&1),O(Rr,a),Qr===null&&(i===null||Pl.current!==null||i.memoizedState!==null)&&(Qr=a)}function Vh(a){O(wn,wn.current),O(Rr,a),Qr===null&&(Qr=a)}function kb(a){a.tag===22?(O(wn,wn.current),O(Rr,a),Qr===null&&(Qr=a)):Qi()}function Qi(){O(wn,wn.current),O(Rr,Rr.current)}function Lr(a){ae(Rr),Qr===a&&(Qr=null),ae(wn)}var wn=$(0);function zc(a){for(var i=a;i!==null;){if(i.tag===13){var u=i.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||Xm(u)||Km(u)))return i}else if(i.tag===19&&(i.memoizedProps.revealOrder==="forwards"||i.memoizedProps.revealOrder==="backwards"||i.memoizedProps.revealOrder==="unstable_legacy-backwards"||i.memoizedProps.revealOrder==="together")){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===a)break;for(;i.sibling===null;){if(i.return===null||i.return===a)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var si=0,wt=null,Jt=null,Dn=null,Fc=!1,Bl=!1,$s=!1,$c=0,Jo=0,Ul=null,LS=0;function yn(){throw Error(r(321))}function Gh(a,i){if(i===null)return!1;for(var u=0;u<i.length&&u<a.length;u++)if(!Ar(a[u],i[u]))return!1;return!0}function qh(a,i,u,f,b,x){return si=x,wt=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,z.H=a===null||a.memoizedState===null?ox:lm,$s=!1,x=u(f,b),$s=!1,Bl&&(x=Sb(i,u,f,b)),Cb(a),x}function Cb(a){z.H=nu;var i=Jt!==null&&Jt.next!==null;if(si=0,Dn=Jt=wt=null,Fc=!1,Jo=0,Ul=null,i)throw Error(r(300));a===null||jn||(a=a.dependencies,a!==null&&Oc(a)&&(jn=!0))}function Sb(a,i,u,f){wt=a;var b=0;do{if(Bl&&(Ul=null),Jo=0,Bl=!1,25<=b)throw Error(r(301));if(b+=1,Dn=Jt=null,a.updateQueue!=null){var x=a.updateQueue;x.lastEffect=null,x.events=null,x.stores=null,x.memoCache!=null&&(x.memoCache.index=0)}z.H=ux,x=i(u,f)}while(Bl);return x}function IS(){var a=z.H,i=a.useState()[0];return i=typeof i.then=="function"?eu(i):i,a=a.useState()[0],(Jt!==null?Jt.memoizedState:null)!==a&&(wt.flags|=1024),i}function Yh(){var a=$c!==0;return $c=0,a}function Wh(a,i,u){i.updateQueue=a.updateQueue,i.flags&=-2053,a.lanes&=~u}function Qh(a){if(Fc){for(a=a.memoizedState;a!==null;){var i=a.queue;i!==null&&(i.pending=null),a=a.next}Fc=!1}si=0,Dn=Jt=wt=null,Bl=!1,Jo=$c=0,Ul=null}function ur(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Dn===null?wt.memoizedState=Dn=a:Dn=Dn.next=a,Dn}function kn(){if(Jt===null){var a=wt.alternate;a=a!==null?a.memoizedState:null}else a=Jt.next;var i=Dn===null?wt.memoizedState:Dn.next;if(i!==null)Dn=i,Jt=a;else{if(a===null)throw wt.alternate===null?Error(r(467)):Error(r(310));Jt=a,a={memoizedState:Jt.memoizedState,baseState:Jt.baseState,baseQueue:Jt.baseQueue,queue:Jt.queue,next:null},Dn===null?wt.memoizedState=Dn=a:Dn=Dn.next=a}return Dn}function Vc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function eu(a){var i=Jo;return Jo+=1,Ul===null&&(Ul=[]),a=bb(Ul,a,i),i=wt,(Dn===null?i.memoizedState:Dn.next)===null&&(i=i.alternate,z.H=i===null||i.memoizedState===null?ox:lm),a}function Gc(a){if(a!==null&&typeof a=="object"){if(typeof a.then=="function")return eu(a);if(a.$$typeof===N)return Zn(a)}throw Error(r(438,String(a)))}function Xh(a){var i=null,u=wt.updateQueue;if(u!==null&&(i=u.memoCache),i==null){var f=wt.alternate;f!==null&&(f=f.updateQueue,f!==null&&(f=f.memoCache,f!=null&&(i={data:f.data.map(function(b){return b.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),u===null&&(u=Vc(),wt.updateQueue=u),u.memoCache=i,u=i.data[i.index],u===void 0)for(u=i.data[i.index]=Array(a),f=0;f<a;f++)u[f]=M;return i.index++,u}function li(a,i){return typeof i=="function"?i(a):i}function qc(a){var i=kn();return Kh(i,Jt,a)}function Kh(a,i,u){var f=a.queue;if(f===null)throw Error(r(311));f.lastRenderedReducer=u;var b=a.baseQueue,x=f.pending;if(x!==null){if(b!==null){var w=b.next;b.next=x.next,x.next=w}i.baseQueue=b=x,f.pending=null}if(x=a.baseState,b===null)a.memoizedState=x;else{i=b.next;var R=w=null,q=null,ie=i,be=!1;do{var Te=ie.lane&-536870913;if(Te!==ie.lane?(Mt&Te)===Te:(si&Te)===Te){var se=ie.revertLane;if(se===0)q!==null&&(q=q.next={lane:0,revertLane:0,gesture:null,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null}),Te===Ol&&(be=!0);else if((si&se)===se){ie=ie.next,se===Ol&&(be=!0);continue}else Te={lane:0,revertLane:ie.revertLane,gesture:null,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null},q===null?(R=q=Te,w=x):q=q.next=Te,wt.lanes|=se,Zi|=se;Te=ie.action,$s&&u(x,Te),x=ie.hasEagerState?ie.eagerState:u(x,Te)}else se={lane:Te,revertLane:ie.revertLane,gesture:ie.gesture,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null},q===null?(R=q=se,w=x):q=q.next=se,wt.lanes|=Te,Zi|=Te;ie=ie.next}while(ie!==null&&ie!==i);if(q===null?w=x:q.next=R,!Ar(x,a.memoizedState)&&(jn=!0,be&&(u=Dl,u!==null)))throw u;a.memoizedState=x,a.baseState=w,a.baseQueue=q,f.lastRenderedState=x}return b===null&&(f.lanes=0),[a.memoizedState,f.dispatch]}function Zh(a){var i=kn(),u=i.queue;if(u===null)throw Error(r(311));u.lastRenderedReducer=a;var f=u.dispatch,b=u.pending,x=i.memoizedState;if(b!==null){u.pending=null;var w=b=b.next;do x=a(x,w.action),w=w.next;while(w!==b);Ar(x,i.memoizedState)||(jn=!0),i.memoizedState=x,i.baseQueue===null&&(i.baseState=x),u.lastRenderedState=x}return[x,f]}function Ab(a,i,u){var f=wt,b=kn(),x=Bt;if(x){if(u===void 0)throw Error(r(407));u=u()}else u=i();var w=!Ar((Jt||b).memoizedState,u);if(w&&(b.memoizedState=u,jn=!0),b=b.queue,tm(Lb.bind(null,f,b,a),[a]),b.getSnapshot!==i||w||Dn!==null&&Dn.memoizedState.tag&1){if(f.flags|=2048,Hl(9,{destroy:void 0},Rb.bind(null,f,b,u,i),null),an===null)throw Error(r(349));x||(si&127)!==0||Nb(f,i,u)}return u}function Nb(a,i,u){a.flags|=16384,a={getSnapshot:i,value:u},i=wt.updateQueue,i===null?(i=Vc(),wt.updateQueue=i,i.stores=[a]):(u=i.stores,u===null?i.stores=[a]:u.push(a))}function Rb(a,i,u,f){i.value=u,i.getSnapshot=f,Ib(i)&&Ob(a)}function Lb(a,i,u){return u(function(){Ib(i)&&Ob(a)})}function Ib(a){var i=a.getSnapshot;a=a.value;try{var u=i();return!Ar(a,u)}catch{return!0}}function Ob(a){var i=Ds(a,2);i!==null&&Tr(i,a,2)}function Jh(a){var i=ur();if(typeof a=="function"){var u=a;if(a=u(),$s){Ke(!0);try{u()}finally{Ke(!1)}}}return i.memoizedState=i.baseState=a,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:li,lastRenderedState:a},i}function Db(a,i,u,f){return a.baseState=u,Kh(a,Jt,typeof f=="function"?f:li)}function OS(a,i,u,f,b){if(Qc(a))throw Error(r(485));if(a=i.action,a!==null){var x={payload:b,action:a,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(w){x.listeners.push(w)}};z.T!==null?u(!0):x.isTransition=!1,f(x),u=i.pending,u===null?(x.next=i.pending=x,jb(i,x)):(x.next=u.next,i.pending=u.next=x)}}function jb(a,i){var u=i.action,f=i.payload,b=a.state;if(i.isTransition){var x=z.T,w={};z.T=w;try{var R=u(b,f),q=z.S;q!==null&&q(w,R),Mb(a,i,R)}catch(ie){em(a,i,ie)}finally{x!==null&&w.types!==null&&(x.types=w.types),z.T=x}}else try{x=u(b,f),Mb(a,i,x)}catch(ie){em(a,i,ie)}}function Mb(a,i,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(f){Pb(a,i,f)},function(f){return em(a,i,f)}):Pb(a,i,u)}function Pb(a,i,u){i.status="fulfilled",i.value=u,Bb(i),a.state=u,i=a.pending,i!==null&&(u=i.next,u===i?a.pending=null:(u=u.next,i.next=u,jb(a,u)))}function em(a,i,u){var f=a.pending;if(a.pending=null,f!==null){f=f.next;do i.status="rejected",i.reason=u,Bb(i),i=i.next;while(i!==f)}a.action=null}function Bb(a){a=a.listeners;for(var i=0;i<a.length;i++)(0,a[i])()}function Ub(a,i){return i}function Hb(a,i){if(Bt){var u=an.formState;if(u!==null){e:{var f=wt;if(Bt){if(fn){t:{for(var b=fn,x=Wr;b.nodeType!==8;){if(!x){b=null;break t}if(b=Xr(b.nextSibling),b===null){b=null;break t}}x=b.data,b=x==="F!"||x==="F"?b:null}if(b){fn=Xr(b.nextSibling),f=b.data==="F!";break e}}$i(f)}f=!1}f&&(i=u[0])}}return u=ur(),u.memoizedState=u.baseState=i,f={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ub,lastRenderedState:i},u.queue=f,u=ix.bind(null,wt,f),f.dispatch=u,f=Jh(!1),x=sm.bind(null,wt,!1,f.queue),f=ur(),b={state:i,dispatch:null,action:a,pending:null},f.queue=b,u=OS.bind(null,wt,b,x,u),b.dispatch=u,f.memoizedState=a,[i,u,!1]}function zb(a){var i=kn();return Fb(i,Jt,a)}function Fb(a,i,u){if(i=Kh(a,i,Ub)[0],a=qc(li)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var f=eu(i)}catch(w){throw w===jl?Mc:w}else f=i;i=kn();var b=i.queue,x=b.dispatch;return u!==i.memoizedState&&(wt.flags|=2048,Hl(9,{destroy:void 0},DS.bind(null,b,u),null)),[f,x,a]}function DS(a,i){a.action=i}function $b(a){var i=kn(),u=Jt;if(u!==null)return Fb(i,u,a);kn(),i=i.memoizedState,u=kn();var f=u.queue.dispatch;return u.memoizedState=a,[i,f,!1]}function Hl(a,i,u,f){return a={tag:a,create:u,deps:f,inst:i,next:null},i=wt.updateQueue,i===null&&(i=Vc(),wt.updateQueue=i),u=i.lastEffect,u===null?i.lastEffect=a.next=a:(f=u.next,u.next=a,a.next=f,i.lastEffect=a),a}function Vb(){return kn().memoizedState}function Yc(a,i,u,f){var b=ur();wt.flags|=a,b.memoizedState=Hl(1|i,{destroy:void 0},u,f===void 0?null:f)}function Wc(a,i,u,f){var b=kn();f=f===void 0?null:f;var x=b.memoizedState.inst;Jt!==null&&f!==null&&Gh(f,Jt.memoizedState.deps)?b.memoizedState=Hl(i,x,u,f):(wt.flags|=a,b.memoizedState=Hl(1|i,x,u,f))}function Gb(a,i){Yc(8390656,8,a,i)}function tm(a,i){Wc(2048,8,a,i)}function jS(a){wt.flags|=4;var i=wt.updateQueue;if(i===null)i=Vc(),wt.updateQueue=i,i.events=[a];else{var u=i.events;u===null?i.events=[a]:u.push(a)}}function qb(a){var i=kn().memoizedState;return jS({ref:i,nextImpl:a}),function(){if((Wt&2)!==0)throw Error(r(440));return i.impl.apply(void 0,arguments)}}function Yb(a,i){return Wc(4,2,a,i)}function Wb(a,i){return Wc(4,4,a,i)}function Qb(a,i){if(typeof i=="function"){a=a();var u=i(a);return function(){typeof u=="function"?u():i(null)}}if(i!=null)return a=a(),i.current=a,function(){i.current=null}}function Xb(a,i,u){u=u!=null?u.concat([a]):null,Wc(4,4,Qb.bind(null,i,a),u)}function nm(){}function Kb(a,i){var u=kn();i=i===void 0?null:i;var f=u.memoizedState;return i!==null&&Gh(i,f[1])?f[0]:(u.memoizedState=[a,i],a)}function Zb(a,i){var u=kn();i=i===void 0?null:i;var f=u.memoizedState;if(i!==null&&Gh(i,f[1]))return f[0];if(f=a(),$s){Ke(!0);try{a()}finally{Ke(!1)}}return u.memoizedState=[f,i],f}function rm(a,i,u){return u===void 0||(si&1073741824)!==0&&(Mt&261930)===0?a.memoizedState=i:(a.memoizedState=u,a=Jx(),wt.lanes|=a,Zi|=a,u)}function Jb(a,i,u,f){return Ar(u,i)?u:Pl.current!==null?(a=rm(a,u,f),Ar(a,i)||(jn=!0),a):(si&42)===0||(si&1073741824)!==0&&(Mt&261930)===0?(jn=!0,a.memoizedState=u):(a=Jx(),wt.lanes|=a,Zi|=a,i)}function ex(a,i,u,f,b){var x=ee.p;ee.p=x!==0&&8>x?x:8;var w=z.T,R={};z.T=R,sm(a,!1,i,u);try{var q=b(),ie=z.S;if(ie!==null&&ie(R,q),q!==null&&typeof q=="object"&&typeof q.then=="function"){var be=RS(q,f);tu(a,i,be,Dr(a))}else tu(a,i,f,Dr(a))}catch(Te){tu(a,i,{then:function(){},status:"rejected",reason:Te},Dr())}finally{ee.p=x,w!==null&&R.types!==null&&(w.types=R.types),z.T=w}}function MS(){}function am(a,i,u,f){if(a.tag!==5)throw Error(r(476));var b=tx(a).queue;ex(a,b,i,ke,u===null?MS:function(){return nx(a),u(f)})}function tx(a){var i=a.memoizedState;if(i!==null)return i;i={memoizedState:ke,baseState:ke,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:li,lastRenderedState:ke},next:null};var u={};return i.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:li,lastRenderedState:u},next:null},a.memoizedState=i,a=a.alternate,a!==null&&(a.memoizedState=i),i}function nx(a){var i=tx(a);i.next===null&&(i=a.alternate.memoizedState),tu(a,i.next.queue,{},Dr())}function im(){return Zn(xu)}function rx(){return kn().memoizedState}function ax(){return kn().memoizedState}function PS(a){for(var i=a.return;i!==null;){switch(i.tag){case 24:case 3:var u=Dr();a=qi(u);var f=Yi(i,a,u);f!==null&&(Tr(f,i,u),Xo(f,i,u)),i={cache:Dh()},a.payload=i;return}i=i.return}}function BS(a,i,u){var f=Dr();u={lane:f,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},Qc(a)?sx(i,u):(u=vh(a,i,u,f),u!==null&&(Tr(u,a,f),lx(u,i,f)))}function ix(a,i,u){var f=Dr();tu(a,i,u,f)}function tu(a,i,u,f){var b={lane:f,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if(Qc(a))sx(i,b);else{var x=a.alternate;if(a.lanes===0&&(x===null||x.lanes===0)&&(x=i.lastRenderedReducer,x!==null))try{var w=i.lastRenderedState,R=x(w,u);if(b.hasEagerState=!0,b.eagerState=R,Ar(R,w))return Nc(a,i,b,0),an===null&&Ac(),!1}catch{}finally{}if(u=vh(a,i,b,f),u!==null)return Tr(u,a,f),lx(u,i,f),!0}return!1}function sm(a,i,u,f){if(f={lane:2,revertLane:Bm(),gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null},Qc(a)){if(i)throw Error(r(479))}else i=vh(a,u,f,2),i!==null&&Tr(i,a,2)}function Qc(a){var i=a.alternate;return a===wt||i!==null&&i===wt}function sx(a,i){Bl=Fc=!0;var u=a.pending;u===null?i.next=i:(i.next=u.next,u.next=i),a.pending=i}function lx(a,i,u){if((u&4194048)!==0){var f=i.lanes;f&=a.pendingLanes,u|=f,i.lanes=u,Li(a,u)}}var nu={readContext:Zn,use:Gc,useCallback:yn,useContext:yn,useEffect:yn,useImperativeHandle:yn,useLayoutEffect:yn,useInsertionEffect:yn,useMemo:yn,useReducer:yn,useRef:yn,useState:yn,useDebugValue:yn,useDeferredValue:yn,useTransition:yn,useSyncExternalStore:yn,useId:yn,useHostTransitionStatus:yn,useFormState:yn,useActionState:yn,useOptimistic:yn,useMemoCache:yn,useCacheRefresh:yn};nu.useEffectEvent=yn;var ox={readContext:Zn,use:Gc,useCallback:function(a,i){return ur().memoizedState=[a,i===void 0?null:i],a},useContext:Zn,useEffect:Gb,useImperativeHandle:function(a,i,u){u=u!=null?u.concat([a]):null,Yc(4194308,4,Qb.bind(null,i,a),u)},useLayoutEffect:function(a,i){return Yc(4194308,4,a,i)},useInsertionEffect:function(a,i){Yc(4,2,a,i)},useMemo:function(a,i){var u=ur();i=i===void 0?null:i;var f=a();if($s){Ke(!0);try{a()}finally{Ke(!1)}}return u.memoizedState=[f,i],f},useReducer:function(a,i,u){var f=ur();if(u!==void 0){var b=u(i);if($s){Ke(!0);try{u(i)}finally{Ke(!1)}}}else b=i;return f.memoizedState=f.baseState=b,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:b},f.queue=a,a=a.dispatch=BS.bind(null,wt,a),[f.memoizedState,a]},useRef:function(a){var i=ur();return a={current:a},i.memoizedState=a},useState:function(a){a=Jh(a);var i=a.queue,u=ix.bind(null,wt,i);return i.dispatch=u,[a.memoizedState,u]},useDebugValue:nm,useDeferredValue:function(a,i){var u=ur();return rm(u,a,i)},useTransition:function(){var a=Jh(!1);return a=ex.bind(null,wt,a.queue,!0,!1),ur().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,i,u){var f=wt,b=ur();if(Bt){if(u===void 0)throw Error(r(407));u=u()}else{if(u=i(),an===null)throw Error(r(349));(Mt&127)!==0||Nb(f,i,u)}b.memoizedState=u;var x={value:u,getSnapshot:i};return b.queue=x,Gb(Lb.bind(null,f,x,a),[a]),f.flags|=2048,Hl(9,{destroy:void 0},Rb.bind(null,f,x,u,i),null),u},useId:function(){var a=ur(),i=an.identifierPrefix;if(Bt){var u=Da,f=Oa;u=(f&~(1<<32-$e(f)-1)).toString(32)+u,i="_"+i+"R_"+u,u=$c++,0<u&&(i+="H"+u.toString(32)),i+="_"}else u=LS++,i="_"+i+"r_"+u.toString(32)+"_";return a.memoizedState=i},useHostTransitionStatus:im,useFormState:Hb,useActionState:Hb,useOptimistic:function(a){var i=ur();i.memoizedState=i.baseState=a;var u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=u,i=sm.bind(null,wt,!0,u),u.dispatch=i,[a,i]},useMemoCache:Xh,useCacheRefresh:function(){return ur().memoizedState=PS.bind(null,wt)},useEffectEvent:function(a){var i=ur(),u={impl:a};return i.memoizedState=u,function(){if((Wt&2)!==0)throw Error(r(440));return u.impl.apply(void 0,arguments)}}},lm={readContext:Zn,use:Gc,useCallback:Kb,useContext:Zn,useEffect:tm,useImperativeHandle:Xb,useInsertionEffect:Yb,useLayoutEffect:Wb,useMemo:Zb,useReducer:qc,useRef:Vb,useState:function(){return qc(li)},useDebugValue:nm,useDeferredValue:function(a,i){var u=kn();return Jb(u,Jt.memoizedState,a,i)},useTransition:function(){var a=qc(li)[0],i=kn().memoizedState;return[typeof a=="boolean"?a:eu(a),i]},useSyncExternalStore:Ab,useId:rx,useHostTransitionStatus:im,useFormState:zb,useActionState:zb,useOptimistic:function(a,i){var u=kn();return Db(u,Jt,a,i)},useMemoCache:Xh,useCacheRefresh:ax};lm.useEffectEvent=qb;var ux={readContext:Zn,use:Gc,useCallback:Kb,useContext:Zn,useEffect:tm,useImperativeHandle:Xb,useInsertionEffect:Yb,useLayoutEffect:Wb,useMemo:Zb,useReducer:Zh,useRef:Vb,useState:function(){return Zh(li)},useDebugValue:nm,useDeferredValue:function(a,i){var u=kn();return Jt===null?rm(u,a,i):Jb(u,Jt.memoizedState,a,i)},useTransition:function(){var a=Zh(li)[0],i=kn().memoizedState;return[typeof a=="boolean"?a:eu(a),i]},useSyncExternalStore:Ab,useId:rx,useHostTransitionStatus:im,useFormState:$b,useActionState:$b,useOptimistic:function(a,i){var u=kn();return Jt!==null?Db(u,Jt,a,i):(u.baseState=a,[a,u.queue.dispatch])},useMemoCache:Xh,useCacheRefresh:ax};ux.useEffectEvent=qb;function om(a,i,u,f){i=a.memoizedState,u=u(f,i),u=u==null?i:g({},i,u),a.memoizedState=u,a.lanes===0&&(a.updateQueue.baseState=u)}var um={enqueueSetState:function(a,i,u){a=a._reactInternals;var f=Dr(),b=qi(f);b.payload=i,u!=null&&(b.callback=u),i=Yi(a,b,f),i!==null&&(Tr(i,a,f),Xo(i,a,f))},enqueueReplaceState:function(a,i,u){a=a._reactInternals;var f=Dr(),b=qi(f);b.tag=1,b.payload=i,u!=null&&(b.callback=u),i=Yi(a,b,f),i!==null&&(Tr(i,a,f),Xo(i,a,f))},enqueueForceUpdate:function(a,i){a=a._reactInternals;var u=Dr(),f=qi(u);f.tag=2,i!=null&&(f.callback=i),i=Yi(a,f,u),i!==null&&(Tr(i,a,u),Xo(i,a,u))}};function cx(a,i,u,f,b,x,w){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(f,x,w):i.prototype&&i.prototype.isPureReactComponent?!Fo(u,f)||!Fo(b,x):!0}function dx(a,i,u,f){a=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(u,f),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(u,f),i.state!==a&&um.enqueueReplaceState(i,i.state,null)}function Vs(a,i){var u=i;if("ref"in i){u={};for(var f in i)f!=="ref"&&(u[f]=i[f])}if(a=a.defaultProps){u===i&&(u=g({},u));for(var b in a)u[b]===void 0&&(u[b]=a[b])}return u}function fx(a){Sc(a)}function hx(a){console.error(a)}function mx(a){Sc(a)}function Xc(a,i){try{var u=a.onUncaughtError;u(i.value,{componentStack:i.stack})}catch(f){setTimeout(function(){throw f})}}function px(a,i,u){try{var f=a.onCaughtError;f(u.value,{componentStack:u.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(b){setTimeout(function(){throw b})}}function cm(a,i,u){return u=qi(u),u.tag=3,u.payload={element:null},u.callback=function(){Xc(a,i)},u}function gx(a){return a=qi(a),a.tag=3,a}function bx(a,i,u,f){var b=u.type.getDerivedStateFromError;if(typeof b=="function"){var x=f.value;a.payload=function(){return b(x)},a.callback=function(){px(i,u,f)}}var w=u.stateNode;w!==null&&typeof w.componentDidCatch=="function"&&(a.callback=function(){px(i,u,f),typeof b!="function"&&(Ji===null?Ji=new Set([this]):Ji.add(this));var R=f.stack;this.componentDidCatch(f.value,{componentStack:R!==null?R:""})})}function US(a,i,u,f,b){if(u.flags|=32768,f!==null&&typeof f=="object"&&typeof f.then=="function"){if(i=u.alternate,i!==null&&Il(i,u,b,!0),u=Rr.current,u!==null){switch(u.tag){case 31:case 13:return Qr===null?od():u.alternate===null&&En===0&&(En=3),u.flags&=-257,u.flags|=65536,u.lanes=b,f===Pc?u.flags|=16384:(i=u.updateQueue,i===null?u.updateQueue=new Set([f]):i.add(f),jm(a,f,b)),!1;case 22:return u.flags|=65536,f===Pc?u.flags|=16384:(i=u.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([f])},u.updateQueue=i):(u=i.retryQueue,u===null?i.retryQueue=new Set([f]):u.add(f)),jm(a,f,b)),!1}throw Error(r(435,u.tag))}return jm(a,f,b),od(),!1}if(Bt)return i=Rr.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=b,f!==Nh&&(a=Error(r(422),{cause:f}),Go(Gr(a,u)))):(f!==Nh&&(i=Error(r(423),{cause:f}),Go(Gr(i,u))),a=a.current.alternate,a.flags|=65536,b&=-b,a.lanes|=b,f=Gr(f,u),b=cm(a.stateNode,f,b),Hh(a,b),En!==4&&(En=2)),!1;var x=Error(r(520),{cause:f});if(x=Gr(x,u),cu===null?cu=[x]:cu.push(x),En!==4&&(En=2),i===null)return!0;f=Gr(f,u),u=i;do{switch(u.tag){case 3:return u.flags|=65536,a=b&-b,u.lanes|=a,a=cm(u.stateNode,f,a),Hh(u,a),!1;case 1:if(i=u.type,x=u.stateNode,(u.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(Ji===null||!Ji.has(x))))return u.flags|=65536,b&=-b,u.lanes|=b,b=gx(b),bx(b,a,u,f),Hh(u,b),!1}u=u.return}while(u!==null);return!1}var dm=Error(r(461)),jn=!1;function Jn(a,i,u,f){i.child=a===null?_b(i,null,u,f):Fs(i,a.child,u,f)}function xx(a,i,u,f,b){u=u.render;var x=i.ref;if("ref"in f){var w={};for(var R in f)R!=="ref"&&(w[R]=f[R])}else w=f;return Bs(i),f=qh(a,i,u,w,x,b),R=Yh(),a!==null&&!jn?(Wh(a,i,b),oi(a,i,b)):(Bt&&R&&Sh(i),i.flags|=1,Jn(a,i,f,b),i.child)}function yx(a,i,u,f,b){if(a===null){var x=u.type;return typeof x=="function"&&!wh(x)&&x.defaultProps===void 0&&u.compare===null?(i.tag=15,i.type=x,Ex(a,i,x,f,b)):(a=Lc(u.type,null,f,i,i.mode,b),a.ref=i.ref,a.return=i,i.child=a)}if(x=a.child,!ym(a,b)){var w=x.memoizedProps;if(u=u.compare,u=u!==null?u:Fo,u(w,f)&&a.ref===i.ref)return oi(a,i,b)}return i.flags|=1,a=ni(x,f),a.ref=i.ref,a.return=i,i.child=a}function Ex(a,i,u,f,b){if(a!==null){var x=a.memoizedProps;if(Fo(x,f)&&a.ref===i.ref)if(jn=!1,i.pendingProps=f=x,ym(a,b))(a.flags&131072)!==0&&(jn=!0);else return i.lanes=a.lanes,oi(a,i,b)}return fm(a,i,u,f,b)}function _x(a,i,u,f){var b=f.children,x=a!==null?a.memoizedState:null;if(a===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),f.mode==="hidden"){if((i.flags&128)!==0){if(x=x!==null?x.baseLanes|u:u,a!==null){for(f=i.child=a.child,b=0;f!==null;)b=b|f.lanes|f.childLanes,f=f.sibling;f=b&~x}else f=0,i.child=null;return Tx(a,i,x,u,f)}if((u&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},a!==null&&jc(i,x!==null?x.cachePool:null),x!==null?wb(i,x):Fh(),kb(i);else return f=i.lanes=536870912,Tx(a,i,x!==null?x.baseLanes|u:u,u,f)}else x!==null?(jc(i,x.cachePool),wb(i,x),Qi(),i.memoizedState=null):(a!==null&&jc(i,null),Fh(),Qi());return Jn(a,i,b,u),i.child}function ru(a,i){return a!==null&&a.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function Tx(a,i,u,f,b){var x=Mh();return x=x===null?null:{parent:On._currentValue,pool:x},i.memoizedState={baseLanes:u,cachePool:x},a!==null&&jc(i,null),Fh(),kb(i),a!==null&&Il(a,i,f,!0),i.childLanes=b,null}function Kc(a,i){return i=Jc({mode:i.mode,children:i.children},a.mode),i.ref=a.ref,a.child=i,i.return=a,i}function vx(a,i,u){return Fs(i,a.child,null,u),a=Kc(i,i.pendingProps),a.flags|=2,Lr(i),i.memoizedState=null,a}function HS(a,i,u){var f=i.pendingProps,b=(i.flags&128)!==0;if(i.flags&=-129,a===null){if(Bt){if(f.mode==="hidden")return a=Kc(i,f),i.lanes=536870912,ru(null,a);if(Vh(i),(a=fn)?(a=jy(a,Wr),a=a!==null&&a.data==="&"?a:null,a!==null&&(i.memoizedState={dehydrated:a,treeContext:zi!==null?{id:Oa,overflow:Da}:null,retryLane:536870912,hydrationErrors:null},u=sb(a),u.return=i,i.child=u,Kn=i,fn=null)):a=null,a===null)throw $i(i);return i.lanes=536870912,null}return Kc(i,f)}var x=a.memoizedState;if(x!==null){var w=x.dehydrated;if(Vh(i),b)if(i.flags&256)i.flags&=-257,i=vx(a,i,u);else if(i.memoizedState!==null)i.child=a.child,i.flags|=128,i=null;else throw Error(r(558));else if(jn||Il(a,i,u,!1),b=(u&a.childLanes)!==0,jn||b){if(f=an,f!==null&&(w=Hr(f,u),w!==0&&w!==x.retryLane))throw x.retryLane=w,Ds(a,w),Tr(f,a,w),dm;od(),i=vx(a,i,u)}else a=x.treeContext,fn=Xr(w.nextSibling),Kn=i,Bt=!0,Fi=null,Wr=!1,a!==null&&ub(i,a),i=Kc(i,f),i.flags|=4096;return i}return a=ni(a.child,{mode:f.mode,children:f.children}),a.ref=i.ref,i.child=a,a.return=i,a}function Zc(a,i){var u=i.ref;if(u===null)a!==null&&a.ref!==null&&(i.flags|=4194816);else{if(typeof u!="function"&&typeof u!="object")throw Error(r(284));(a===null||a.ref!==u)&&(i.flags|=4194816)}}function fm(a,i,u,f,b){return Bs(i),u=qh(a,i,u,f,void 0,b),f=Yh(),a!==null&&!jn?(Wh(a,i,b),oi(a,i,b)):(Bt&&f&&Sh(i),i.flags|=1,Jn(a,i,u,b),i.child)}function wx(a,i,u,f,b,x){return Bs(i),i.updateQueue=null,u=Sb(i,f,u,b),Cb(a),f=Yh(),a!==null&&!jn?(Wh(a,i,x),oi(a,i,x)):(Bt&&f&&Sh(i),i.flags|=1,Jn(a,i,u,x),i.child)}function kx(a,i,u,f,b){if(Bs(i),i.stateNode===null){var x=Al,w=u.contextType;typeof w=="object"&&w!==null&&(x=Zn(w)),x=new u(f,x),i.memoizedState=x.state!==null&&x.state!==void 0?x.state:null,x.updater=um,i.stateNode=x,x._reactInternals=i,x=i.stateNode,x.props=f,x.state=i.memoizedState,x.refs={},Bh(i),w=u.contextType,x.context=typeof w=="object"&&w!==null?Zn(w):Al,x.state=i.memoizedState,w=u.getDerivedStateFromProps,typeof w=="function"&&(om(i,u,w,f),x.state=i.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof x.getSnapshotBeforeUpdate=="function"||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(w=x.state,typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount(),w!==x.state&&um.enqueueReplaceState(x,x.state,null),Zo(i,f,x,b),Ko(),x.state=i.memoizedState),typeof x.componentDidMount=="function"&&(i.flags|=4194308),f=!0}else if(a===null){x=i.stateNode;var R=i.memoizedProps,q=Vs(u,R);x.props=q;var ie=x.context,be=u.contextType;w=Al,typeof be=="object"&&be!==null&&(w=Zn(be));var Te=u.getDerivedStateFromProps;be=typeof Te=="function"||typeof x.getSnapshotBeforeUpdate=="function",R=i.pendingProps!==R,be||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(R||ie!==w)&&dx(i,x,f,w),Gi=!1;var se=i.memoizedState;x.state=se,Zo(i,f,x,b),Ko(),ie=i.memoizedState,R||se!==ie||Gi?(typeof Te=="function"&&(om(i,u,Te,f),ie=i.memoizedState),(q=Gi||cx(i,u,q,f,se,ie,w))?(be||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"&&(i.flags|=4194308)):(typeof x.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=f,i.memoizedState=ie),x.props=f,x.state=ie,x.context=w,f=q):(typeof x.componentDidMount=="function"&&(i.flags|=4194308),f=!1)}else{x=i.stateNode,Uh(a,i),w=i.memoizedProps,be=Vs(u,w),x.props=be,Te=i.pendingProps,se=x.context,ie=u.contextType,q=Al,typeof ie=="object"&&ie!==null&&(q=Zn(ie)),R=u.getDerivedStateFromProps,(ie=typeof R=="function"||typeof x.getSnapshotBeforeUpdate=="function")||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(w!==Te||se!==q)&&dx(i,x,f,q),Gi=!1,se=i.memoizedState,x.state=se,Zo(i,f,x,b),Ko();var oe=i.memoizedState;w!==Te||se!==oe||Gi||a!==null&&a.dependencies!==null&&Oc(a.dependencies)?(typeof R=="function"&&(om(i,u,R,f),oe=i.memoizedState),(be=Gi||cx(i,u,be,f,se,oe,q)||a!==null&&a.dependencies!==null&&Oc(a.dependencies))?(ie||typeof x.UNSAFE_componentWillUpdate!="function"&&typeof x.componentWillUpdate!="function"||(typeof x.componentWillUpdate=="function"&&x.componentWillUpdate(f,oe,q),typeof x.UNSAFE_componentWillUpdate=="function"&&x.UNSAFE_componentWillUpdate(f,oe,q)),typeof x.componentDidUpdate=="function"&&(i.flags|=4),typeof x.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof x.componentDidUpdate!="function"||w===a.memoizedProps&&se===a.memoizedState||(i.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||w===a.memoizedProps&&se===a.memoizedState||(i.flags|=1024),i.memoizedProps=f,i.memoizedState=oe),x.props=f,x.state=oe,x.context=q,f=be):(typeof x.componentDidUpdate!="function"||w===a.memoizedProps&&se===a.memoizedState||(i.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||w===a.memoizedProps&&se===a.memoizedState||(i.flags|=1024),f=!1)}return x=f,Zc(a,i),f=(i.flags&128)!==0,x||f?(x=i.stateNode,u=f&&typeof u.getDerivedStateFromError!="function"?null:x.render(),i.flags|=1,a!==null&&f?(i.child=Fs(i,a.child,null,b),i.child=Fs(i,null,u,b)):Jn(a,i,u,b),i.memoizedState=x.state,a=i.child):a=oi(a,i,b),a}function Cx(a,i,u,f){return Ms(),i.flags|=256,Jn(a,i,u,f),i.child}var hm={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function mm(a){return{baseLanes:a,cachePool:pb()}}function pm(a,i,u){return a=a!==null?a.childLanes&~u:0,i&&(a|=Or),a}function Sx(a,i,u){var f=i.pendingProps,b=!1,x=(i.flags&128)!==0,w;if((w=x)||(w=a!==null&&a.memoizedState===null?!1:(wn.current&2)!==0),w&&(b=!0,i.flags&=-129),w=(i.flags&32)!==0,i.flags&=-33,a===null){if(Bt){if(b?Wi(i):Qi(),(a=fn)?(a=jy(a,Wr),a=a!==null&&a.data!=="&"?a:null,a!==null&&(i.memoizedState={dehydrated:a,treeContext:zi!==null?{id:Oa,overflow:Da}:null,retryLane:536870912,hydrationErrors:null},u=sb(a),u.return=i,i.child=u,Kn=i,fn=null)):a=null,a===null)throw $i(i);return Km(a)?i.lanes=32:i.lanes=536870912,null}var R=f.children;return f=f.fallback,b?(Qi(),b=i.mode,R=Jc({mode:"hidden",children:R},b),f=js(f,b,u,null),R.return=i,f.return=i,R.sibling=f,i.child=R,f=i.child,f.memoizedState=mm(u),f.childLanes=pm(a,w,u),i.memoizedState=hm,ru(null,f)):(Wi(i),gm(i,R))}var q=a.memoizedState;if(q!==null&&(R=q.dehydrated,R!==null)){if(x)i.flags&256?(Wi(i),i.flags&=-257,i=bm(a,i,u)):i.memoizedState!==null?(Qi(),i.child=a.child,i.flags|=128,i=null):(Qi(),R=f.fallback,b=i.mode,f=Jc({mode:"visible",children:f.children},b),R=js(R,b,u,null),R.flags|=2,f.return=i,R.return=i,f.sibling=R,i.child=f,Fs(i,a.child,null,u),f=i.child,f.memoizedState=mm(u),f.childLanes=pm(a,w,u),i.memoizedState=hm,i=ru(null,f));else if(Wi(i),Km(R)){if(w=R.nextSibling&&R.nextSibling.dataset,w)var ie=w.dgst;w=ie,f=Error(r(419)),f.stack="",f.digest=w,Go({value:f,source:null,stack:null}),i=bm(a,i,u)}else if(jn||Il(a,i,u,!1),w=(u&a.childLanes)!==0,jn||w){if(w=an,w!==null&&(f=Hr(w,u),f!==0&&f!==q.retryLane))throw q.retryLane=f,Ds(a,f),Tr(w,a,f),dm;Xm(R)||od(),i=bm(a,i,u)}else Xm(R)?(i.flags|=192,i.child=a.child,i=null):(a=q.treeContext,fn=Xr(R.nextSibling),Kn=i,Bt=!0,Fi=null,Wr=!1,a!==null&&ub(i,a),i=gm(i,f.children),i.flags|=4096);return i}return b?(Qi(),R=f.fallback,b=i.mode,q=a.child,ie=q.sibling,f=ni(q,{mode:"hidden",children:f.children}),f.subtreeFlags=q.subtreeFlags&65011712,ie!==null?R=ni(ie,R):(R=js(R,b,u,null),R.flags|=2),R.return=i,f.return=i,f.sibling=R,i.child=f,ru(null,f),f=i.child,R=a.child.memoizedState,R===null?R=mm(u):(b=R.cachePool,b!==null?(q=On._currentValue,b=b.parent!==q?{parent:q,pool:q}:b):b=pb(),R={baseLanes:R.baseLanes|u,cachePool:b}),f.memoizedState=R,f.childLanes=pm(a,w,u),i.memoizedState=hm,ru(a.child,f)):(Wi(i),u=a.child,a=u.sibling,u=ni(u,{mode:"visible",children:f.children}),u.return=i,u.sibling=null,a!==null&&(w=i.deletions,w===null?(i.deletions=[a],i.flags|=16):w.push(a)),i.child=u,i.memoizedState=null,u)}function gm(a,i){return i=Jc({mode:"visible",children:i},a.mode),i.return=a,a.child=i}function Jc(a,i){return a=Nr(22,a,null,i),a.lanes=0,a}function bm(a,i,u){return Fs(i,a.child,null,u),a=gm(i,i.pendingProps.children),a.flags|=2,i.memoizedState=null,a}function Ax(a,i,u){a.lanes|=i;var f=a.alternate;f!==null&&(f.lanes|=i),Ih(a.return,i,u)}function xm(a,i,u,f,b,x){var w=a.memoizedState;w===null?a.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:f,tail:u,tailMode:b,treeForkCount:x}:(w.isBackwards=i,w.rendering=null,w.renderingStartTime=0,w.last=f,w.tail=u,w.tailMode=b,w.treeForkCount=x)}function Nx(a,i,u){var f=i.pendingProps,b=f.revealOrder,x=f.tail;f=f.children;var w=wn.current,R=(w&2)!==0;if(R?(w=w&1|2,i.flags|=128):w&=1,O(wn,w),Jn(a,i,f,u),f=Bt?Vo:0,!R&&a!==null&&(a.flags&128)!==0)e:for(a=i.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&Ax(a,u,i);else if(a.tag===19)Ax(a,u,i);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===i)break e;for(;a.sibling===null;){if(a.return===null||a.return===i)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}switch(b){case"forwards":for(u=i.child,b=null;u!==null;)a=u.alternate,a!==null&&zc(a)===null&&(b=u),u=u.sibling;u=b,u===null?(b=i.child,i.child=null):(b=u.sibling,u.sibling=null),xm(i,!1,b,u,x,f);break;case"backwards":case"unstable_legacy-backwards":for(u=null,b=i.child,i.child=null;b!==null;){if(a=b.alternate,a!==null&&zc(a)===null){i.child=b;break}a=b.sibling,b.sibling=u,u=b,b=a}xm(i,!0,u,null,x,f);break;case"together":xm(i,!1,null,null,void 0,f);break;default:i.memoizedState=null}return i.child}function oi(a,i,u){if(a!==null&&(i.dependencies=a.dependencies),Zi|=i.lanes,(u&i.childLanes)===0)if(a!==null){if(Il(a,i,u,!1),(u&i.childLanes)===0)return null}else return null;if(a!==null&&i.child!==a.child)throw Error(r(153));if(i.child!==null){for(a=i.child,u=ni(a,a.pendingProps),i.child=u,u.return=i;a.sibling!==null;)a=a.sibling,u=u.sibling=ni(a,a.pendingProps),u.return=i;u.sibling=null}return i.child}function ym(a,i){return(a.lanes&i)!==0?!0:(a=a.dependencies,!!(a!==null&&Oc(a)))}function zS(a,i,u){switch(i.tag){case 3:Fe(i,i.stateNode.containerInfo),Vi(i,On,a.memoizedState.cache),Ms();break;case 27:case 5:kt(i);break;case 4:Fe(i,i.stateNode.containerInfo);break;case 10:Vi(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,Vh(i),null;break;case 13:var f=i.memoizedState;if(f!==null)return f.dehydrated!==null?(Wi(i),i.flags|=128,null):(u&i.child.childLanes)!==0?Sx(a,i,u):(Wi(i),a=oi(a,i,u),a!==null?a.sibling:null);Wi(i);break;case 19:var b=(a.flags&128)!==0;if(f=(u&i.childLanes)!==0,f||(Il(a,i,u,!1),f=(u&i.childLanes)!==0),b){if(f)return Nx(a,i,u);i.flags|=128}if(b=i.memoizedState,b!==null&&(b.rendering=null,b.tail=null,b.lastEffect=null),O(wn,wn.current),f)break;return null;case 22:return i.lanes=0,_x(a,i,u,i.pendingProps);case 24:Vi(i,On,a.memoizedState.cache)}return oi(a,i,u)}function Rx(a,i,u){if(a!==null)if(a.memoizedProps!==i.pendingProps)jn=!0;else{if(!ym(a,u)&&(i.flags&128)===0)return jn=!1,zS(a,i,u);jn=(a.flags&131072)!==0}else jn=!1,Bt&&(i.flags&1048576)!==0&&ob(i,Vo,i.index);switch(i.lanes=0,i.tag){case 16:e:{var f=i.pendingProps;if(a=Hs(i.elementType),i.type=a,typeof a=="function")wh(a)?(f=Vs(a,f),i.tag=1,i=kx(null,i,a,f,u)):(i.tag=0,i=fm(null,i,a,f,u));else{if(a!=null){var b=a.$$typeof;if(b===U){i.tag=11,i=xx(null,i,a,f,u);break e}else if(b===H){i.tag=14,i=yx(null,i,a,f,u);break e}}throw i=ce(a)||a,Error(r(306,i,""))}}return i;case 0:return fm(a,i,i.type,i.pendingProps,u);case 1:return f=i.type,b=Vs(f,i.pendingProps),kx(a,i,f,b,u);case 3:e:{if(Fe(i,i.stateNode.containerInfo),a===null)throw Error(r(387));f=i.pendingProps;var x=i.memoizedState;b=x.element,Uh(a,i),Zo(i,f,null,u);var w=i.memoizedState;if(f=w.cache,Vi(i,On,f),f!==x.cache&&Oh(i,[On],u,!0),Ko(),f=w.element,x.isDehydrated)if(x={element:f,isDehydrated:!1,cache:w.cache},i.updateQueue.baseState=x,i.memoizedState=x,i.flags&256){i=Cx(a,i,f,u);break e}else if(f!==b){b=Gr(Error(r(424)),i),Go(b),i=Cx(a,i,f,u);break e}else{switch(a=i.stateNode.containerInfo,a.nodeType){case 9:a=a.body;break;default:a=a.nodeName==="HTML"?a.ownerDocument.body:a}for(fn=Xr(a.firstChild),Kn=i,Bt=!0,Fi=null,Wr=!0,u=_b(i,null,f,u),i.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling}else{if(Ms(),f===b){i=oi(a,i,u);break e}Jn(a,i,f,u)}i=i.child}return i;case 26:return Zc(a,i),a===null?(u=zy(i.type,null,i.pendingProps,null))?i.memoizedState=u:Bt||(u=i.type,a=i.pendingProps,f=pd(we.current).createElement(u),f[ft]=i,f[vt]=a,er(f,u,a),pn(f),i.stateNode=f):i.memoizedState=zy(i.type,a.memoizedProps,i.pendingProps,a.memoizedState),null;case 27:return kt(i),a===null&&Bt&&(f=i.stateNode=By(i.type,i.pendingProps,we.current),Kn=i,Wr=!0,b=fn,rs(i.type)?(Zm=b,fn=Xr(f.firstChild)):fn=b),Jn(a,i,i.pendingProps.children,u),Zc(a,i),a===null&&(i.flags|=4194304),i.child;case 5:return a===null&&Bt&&((b=f=fn)&&(f=bA(f,i.type,i.pendingProps,Wr),f!==null?(i.stateNode=f,Kn=i,fn=Xr(f.firstChild),Wr=!1,b=!0):b=!1),b||$i(i)),kt(i),b=i.type,x=i.pendingProps,w=a!==null?a.memoizedProps:null,f=x.children,Ym(b,x)?f=null:w!==null&&Ym(b,w)&&(i.flags|=32),i.memoizedState!==null&&(b=qh(a,i,IS,null,null,u),xu._currentValue=b),Zc(a,i),Jn(a,i,f,u),i.child;case 6:return a===null&&Bt&&((a=u=fn)&&(u=xA(u,i.pendingProps,Wr),u!==null?(i.stateNode=u,Kn=i,fn=null,a=!0):a=!1),a||$i(i)),null;case 13:return Sx(a,i,u);case 4:return Fe(i,i.stateNode.containerInfo),f=i.pendingProps,a===null?i.child=Fs(i,null,f,u):Jn(a,i,f,u),i.child;case 11:return xx(a,i,i.type,i.pendingProps,u);case 7:return Jn(a,i,i.pendingProps,u),i.child;case 8:return Jn(a,i,i.pendingProps.children,u),i.child;case 12:return Jn(a,i,i.pendingProps.children,u),i.child;case 10:return f=i.pendingProps,Vi(i,i.type,f.value),Jn(a,i,f.children,u),i.child;case 9:return b=i.type._context,f=i.pendingProps.children,Bs(i),b=Zn(b),f=f(b),i.flags|=1,Jn(a,i,f,u),i.child;case 14:return yx(a,i,i.type,i.pendingProps,u);case 15:return Ex(a,i,i.type,i.pendingProps,u);case 19:return Nx(a,i,u);case 31:return HS(a,i,u);case 22:return _x(a,i,u,i.pendingProps);case 24:return Bs(i),f=Zn(On),a===null?(b=Mh(),b===null&&(b=an,x=Dh(),b.pooledCache=x,x.refCount++,x!==null&&(b.pooledCacheLanes|=u),b=x),i.memoizedState={parent:f,cache:b},Bh(i),Vi(i,On,b)):((a.lanes&u)!==0&&(Uh(a,i),Zo(i,null,null,u),Ko()),b=a.memoizedState,x=i.memoizedState,b.parent!==f?(b={parent:f,cache:f},i.memoizedState=b,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=b),Vi(i,On,f)):(f=x.cache,Vi(i,On,f),f!==b.cache&&Oh(i,[On],u,!0))),Jn(a,i,i.pendingProps.children,u),i.child;case 29:throw i.pendingProps}throw Error(r(156,i.tag))}function ui(a){a.flags|=4}function Em(a,i,u,f,b){if((i=(a.mode&32)!==0)&&(i=!1),i){if(a.flags|=16777216,(b&335544128)===b)if(a.stateNode.complete)a.flags|=8192;else if(ry())a.flags|=8192;else throw zs=Pc,Ph}else a.flags&=-16777217}function Lx(a,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)a.flags&=-16777217;else if(a.flags|=16777216,!qy(i))if(ry())a.flags|=8192;else throw zs=Pc,Ph}function ed(a,i){i!==null&&(a.flags|=4),a.flags&16384&&(i=a.tag!==22?Nn():536870912,a.lanes|=i,Vl|=i)}function au(a,i){if(!Bt)switch(a.tailMode){case"hidden":i=a.tail;for(var u=null;i!==null;)i.alternate!==null&&(u=i),i=i.sibling;u===null?a.tail=null:u.sibling=null;break;case"collapsed":u=a.tail;for(var f=null;u!==null;)u.alternate!==null&&(f=u),u=u.sibling;f===null?i||a.tail===null?a.tail=null:a.tail.sibling=null:f.sibling=null}}function hn(a){var i=a.alternate!==null&&a.alternate.child===a.child,u=0,f=0;if(i)for(var b=a.child;b!==null;)u|=b.lanes|b.childLanes,f|=b.subtreeFlags&65011712,f|=b.flags&65011712,b.return=a,b=b.sibling;else for(b=a.child;b!==null;)u|=b.lanes|b.childLanes,f|=b.subtreeFlags,f|=b.flags,b.return=a,b=b.sibling;return a.subtreeFlags|=f,a.childLanes=u,i}function FS(a,i,u){var f=i.pendingProps;switch(Ah(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return hn(i),null;case 1:return hn(i),null;case 3:return u=i.stateNode,f=null,a!==null&&(f=a.memoizedState.cache),i.memoizedState.cache!==f&&(i.flags|=2048),ii(On),Ie(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(a===null||a.child===null)&&(Ll(i)?ui(i):a===null||a.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,Rh())),hn(i),null;case 26:var b=i.type,x=i.memoizedState;return a===null?(ui(i),x!==null?(hn(i),Lx(i,x)):(hn(i),Em(i,b,null,f,u))):x?x!==a.memoizedState?(ui(i),hn(i),Lx(i,x)):(hn(i),i.flags&=-16777217):(a=a.memoizedProps,a!==f&&ui(i),hn(i),Em(i,b,a,f,u)),null;case 27:if(at(i),u=we.current,b=i.type,a!==null&&i.stateNode!=null)a.memoizedProps!==f&&ui(i);else{if(!f){if(i.stateNode===null)throw Error(r(166));return hn(i),null}a=_e.current,Ll(i)?cb(i):(a=By(b,f,u),i.stateNode=a,ui(i))}return hn(i),null;case 5:if(at(i),b=i.type,a!==null&&i.stateNode!=null)a.memoizedProps!==f&&ui(i);else{if(!f){if(i.stateNode===null)throw Error(r(166));return hn(i),null}if(x=_e.current,Ll(i))cb(i);else{var w=pd(we.current);switch(x){case 1:x=w.createElementNS("http://www.w3.org/2000/svg",b);break;case 2:x=w.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;default:switch(b){case"svg":x=w.createElementNS("http://www.w3.org/2000/svg",b);break;case"math":x=w.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;case"script":x=w.createElement("div"),x.innerHTML="<script><\/script>",x=x.removeChild(x.firstChild);break;case"select":x=typeof f.is=="string"?w.createElement("select",{is:f.is}):w.createElement("select"),f.multiple?x.multiple=!0:f.size&&(x.size=f.size);break;default:x=typeof f.is=="string"?w.createElement(b,{is:f.is}):w.createElement(b)}}x[ft]=i,x[vt]=f;e:for(w=i.child;w!==null;){if(w.tag===5||w.tag===6)x.appendChild(w.stateNode);else if(w.tag!==4&&w.tag!==27&&w.child!==null){w.child.return=w,w=w.child;continue}if(w===i)break e;for(;w.sibling===null;){if(w.return===null||w.return===i)break e;w=w.return}w.sibling.return=w.return,w=w.sibling}i.stateNode=x;e:switch(er(x,b,f),b){case"button":case"input":case"select":case"textarea":f=!!f.autoFocus;break e;case"img":f=!0;break e;default:f=!1}f&&ui(i)}}return hn(i),Em(i,i.type,a===null?null:a.memoizedProps,i.pendingProps,u),null;case 6:if(a&&i.stateNode!=null)a.memoizedProps!==f&&ui(i);else{if(typeof f!="string"&&i.stateNode===null)throw Error(r(166));if(a=we.current,Ll(i)){if(a=i.stateNode,u=i.memoizedProps,f=null,b=Kn,b!==null)switch(b.tag){case 27:case 5:f=b.memoizedProps}a[ft]=i,a=!!(a.nodeValue===u||f!==null&&f.suppressHydrationWarning===!0||Sy(a.nodeValue,u)),a||$i(i,!0)}else a=pd(a).createTextNode(f),a[ft]=i,i.stateNode=a}return hn(i),null;case 31:if(u=i.memoizedState,a===null||a.memoizedState!==null){if(f=Ll(i),u!==null){if(a===null){if(!f)throw Error(r(318));if(a=i.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(557));a[ft]=i}else Ms(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;hn(i),a=!1}else u=Rh(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=u),a=!0;if(!a)return i.flags&256?(Lr(i),i):(Lr(i),null);if((i.flags&128)!==0)throw Error(r(558))}return hn(i),null;case 13:if(f=i.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(b=Ll(i),f!==null&&f.dehydrated!==null){if(a===null){if(!b)throw Error(r(318));if(b=i.memoizedState,b=b!==null?b.dehydrated:null,!b)throw Error(r(317));b[ft]=i}else Ms(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;hn(i),b=!1}else b=Rh(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=b),b=!0;if(!b)return i.flags&256?(Lr(i),i):(Lr(i),null)}return Lr(i),(i.flags&128)!==0?(i.lanes=u,i):(u=f!==null,a=a!==null&&a.memoizedState!==null,u&&(f=i.child,b=null,f.alternate!==null&&f.alternate.memoizedState!==null&&f.alternate.memoizedState.cachePool!==null&&(b=f.alternate.memoizedState.cachePool.pool),x=null,f.memoizedState!==null&&f.memoizedState.cachePool!==null&&(x=f.memoizedState.cachePool.pool),x!==b&&(f.flags|=2048)),u!==a&&u&&(i.child.flags|=8192),ed(i,i.updateQueue),hn(i),null);case 4:return Ie(),a===null&&Fm(i.stateNode.containerInfo),hn(i),null;case 10:return ii(i.type),hn(i),null;case 19:if(ae(wn),f=i.memoizedState,f===null)return hn(i),null;if(b=(i.flags&128)!==0,x=f.rendering,x===null)if(b)au(f,!1);else{if(En!==0||a!==null&&(a.flags&128)!==0)for(a=i.child;a!==null;){if(x=zc(a),x!==null){for(i.flags|=128,au(f,!1),a=x.updateQueue,i.updateQueue=a,ed(i,a),i.subtreeFlags=0,a=u,u=i.child;u!==null;)ib(u,a),u=u.sibling;return O(wn,wn.current&1|2),Bt&&ri(i,f.treeForkCount),i.child}a=a.sibling}f.tail!==null&&qt()>id&&(i.flags|=128,b=!0,au(f,!1),i.lanes=4194304)}else{if(!b)if(a=zc(x),a!==null){if(i.flags|=128,b=!0,a=a.updateQueue,i.updateQueue=a,ed(i,a),au(f,!0),f.tail===null&&f.tailMode==="hidden"&&!x.alternate&&!Bt)return hn(i),null}else 2*qt()-f.renderingStartTime>id&&u!==536870912&&(i.flags|=128,b=!0,au(f,!1),i.lanes=4194304);f.isBackwards?(x.sibling=i.child,i.child=x):(a=f.last,a!==null?a.sibling=x:i.child=x,f.last=x)}return f.tail!==null?(a=f.tail,f.rendering=a,f.tail=a.sibling,f.renderingStartTime=qt(),a.sibling=null,u=wn.current,O(wn,b?u&1|2:u&1),Bt&&ri(i,f.treeForkCount),a):(hn(i),null);case 22:case 23:return Lr(i),$h(),f=i.memoizedState!==null,a!==null?a.memoizedState!==null!==f&&(i.flags|=8192):f&&(i.flags|=8192),f?(u&536870912)!==0&&(i.flags&128)===0&&(hn(i),i.subtreeFlags&6&&(i.flags|=8192)):hn(i),u=i.updateQueue,u!==null&&ed(i,u.retryQueue),u=null,a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(u=a.memoizedState.cachePool.pool),f=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(f=i.memoizedState.cachePool.pool),f!==u&&(i.flags|=2048),a!==null&&ae(Us),null;case 24:return u=null,a!==null&&(u=a.memoizedState.cache),i.memoizedState.cache!==u&&(i.flags|=2048),ii(On),hn(i),null;case 25:return null;case 30:return null}throw Error(r(156,i.tag))}function $S(a,i){switch(Ah(i),i.tag){case 1:return a=i.flags,a&65536?(i.flags=a&-65537|128,i):null;case 3:return ii(On),Ie(),a=i.flags,(a&65536)!==0&&(a&128)===0?(i.flags=a&-65537|128,i):null;case 26:case 27:case 5:return at(i),null;case 31:if(i.memoizedState!==null){if(Lr(i),i.alternate===null)throw Error(r(340));Ms()}return a=i.flags,a&65536?(i.flags=a&-65537|128,i):null;case 13:if(Lr(i),a=i.memoizedState,a!==null&&a.dehydrated!==null){if(i.alternate===null)throw Error(r(340));Ms()}return a=i.flags,a&65536?(i.flags=a&-65537|128,i):null;case 19:return ae(wn),null;case 4:return Ie(),null;case 10:return ii(i.type),null;case 22:case 23:return Lr(i),$h(),a!==null&&ae(Us),a=i.flags,a&65536?(i.flags=a&-65537|128,i):null;case 24:return ii(On),null;case 25:return null;default:return null}}function Ix(a,i){switch(Ah(i),i.tag){case 3:ii(On),Ie();break;case 26:case 27:case 5:at(i);break;case 4:Ie();break;case 31:i.memoizedState!==null&&Lr(i);break;case 13:Lr(i);break;case 19:ae(wn);break;case 10:ii(i.type);break;case 22:case 23:Lr(i),$h(),a!==null&&ae(Us);break;case 24:ii(On)}}function iu(a,i){try{var u=i.updateQueue,f=u!==null?u.lastEffect:null;if(f!==null){var b=f.next;u=b;do{if((u.tag&a)===a){f=void 0;var x=u.create,w=u.inst;f=x(),w.destroy=f}u=u.next}while(u!==b)}}catch(R){Kt(i,i.return,R)}}function Xi(a,i,u){try{var f=i.updateQueue,b=f!==null?f.lastEffect:null;if(b!==null){var x=b.next;f=x;do{if((f.tag&a)===a){var w=f.inst,R=w.destroy;if(R!==void 0){w.destroy=void 0,b=i;var q=u,ie=R;try{ie()}catch(be){Kt(b,q,be)}}}f=f.next}while(f!==x)}}catch(be){Kt(i,i.return,be)}}function Ox(a){var i=a.updateQueue;if(i!==null){var u=a.stateNode;try{vb(i,u)}catch(f){Kt(a,a.return,f)}}}function Dx(a,i,u){u.props=Vs(a.type,a.memoizedProps),u.state=a.memoizedState;try{u.componentWillUnmount()}catch(f){Kt(a,i,f)}}function su(a,i){try{var u=a.ref;if(u!==null){switch(a.tag){case 26:case 27:case 5:var f=a.stateNode;break;case 30:f=a.stateNode;break;default:f=a.stateNode}typeof u=="function"?a.refCleanup=u(f):u.current=f}}catch(b){Kt(a,i,b)}}function ja(a,i){var u=a.ref,f=a.refCleanup;if(u!==null)if(typeof f=="function")try{f()}catch(b){Kt(a,i,b)}finally{a.refCleanup=null,a=a.alternate,a!=null&&(a.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(b){Kt(a,i,b)}else u.current=null}function jx(a){var i=a.type,u=a.memoizedProps,f=a.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":u.autoFocus&&f.focus();break e;case"img":u.src?f.src=u.src:u.srcSet&&(f.srcset=u.srcSet)}}catch(b){Kt(a,a.return,b)}}function _m(a,i,u){try{var f=a.stateNode;dA(f,a.type,u,i),f[vt]=i}catch(b){Kt(a,a.return,b)}}function Mx(a){return a.tag===5||a.tag===3||a.tag===26||a.tag===27&&rs(a.type)||a.tag===4}function Tm(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||Mx(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.tag===27&&rs(a.type)||a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function vm(a,i,u){var f=a.tag;if(f===5||f===6)a=a.stateNode,i?(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u).insertBefore(a,i):(i=u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,i.appendChild(a),u=u._reactRootContainer,u!=null||i.onclick!==null||(i.onclick=br));else if(f!==4&&(f===27&&rs(a.type)&&(u=a.stateNode,i=null),a=a.child,a!==null))for(vm(a,i,u),a=a.sibling;a!==null;)vm(a,i,u),a=a.sibling}function td(a,i,u){var f=a.tag;if(f===5||f===6)a=a.stateNode,i?u.insertBefore(a,i):u.appendChild(a);else if(f!==4&&(f===27&&rs(a.type)&&(u=a.stateNode),a=a.child,a!==null))for(td(a,i,u),a=a.sibling;a!==null;)td(a,i,u),a=a.sibling}function Px(a){var i=a.stateNode,u=a.memoizedProps;try{for(var f=a.type,b=i.attributes;b.length;)i.removeAttributeNode(b[0]);er(i,f,u),i[ft]=a,i[vt]=u}catch(x){Kt(a,a.return,x)}}var ci=!1,Mn=!1,wm=!1,Bx=typeof WeakSet=="function"?WeakSet:Set,Gn=null;function VS(a,i){if(a=a.containerInfo,Gm=Td,a=X1(a),bh(a)){if("selectionStart"in a)var u={start:a.selectionStart,end:a.selectionEnd};else e:{u=(u=a.ownerDocument)&&u.defaultView||window;var f=u.getSelection&&u.getSelection();if(f&&f.rangeCount!==0){u=f.anchorNode;var b=f.anchorOffset,x=f.focusNode;f=f.focusOffset;try{u.nodeType,x.nodeType}catch{u=null;break e}var w=0,R=-1,q=-1,ie=0,be=0,Te=a,se=null;t:for(;;){for(var oe;Te!==u||b!==0&&Te.nodeType!==3||(R=w+b),Te!==x||f!==0&&Te.nodeType!==3||(q=w+f),Te.nodeType===3&&(w+=Te.nodeValue.length),(oe=Te.firstChild)!==null;)se=Te,Te=oe;for(;;){if(Te===a)break t;if(se===u&&++ie===b&&(R=w),se===x&&++be===f&&(q=w),(oe=Te.nextSibling)!==null)break;Te=se,se=Te.parentNode}Te=oe}u=R===-1||q===-1?null:{start:R,end:q}}else u=null}u=u||{start:0,end:0}}else u=null;for(qm={focusedElem:a,selectionRange:u},Td=!1,Gn=i;Gn!==null;)if(i=Gn,a=i.child,(i.subtreeFlags&1028)!==0&&a!==null)a.return=i,Gn=a;else for(;Gn!==null;){switch(i=Gn,x=i.alternate,a=i.flags,i.tag){case 0:if((a&4)!==0&&(a=i.updateQueue,a=a!==null?a.events:null,a!==null))for(u=0;u<a.length;u++)b=a[u],b.ref.impl=b.nextImpl;break;case 11:case 15:break;case 1:if((a&1024)!==0&&x!==null){a=void 0,u=i,b=x.memoizedProps,x=x.memoizedState,f=u.stateNode;try{var Ve=Vs(u.type,b);a=f.getSnapshotBeforeUpdate(Ve,x),f.__reactInternalSnapshotBeforeUpdate=a}catch(ct){Kt(u,u.return,ct)}}break;case 3:if((a&1024)!==0){if(a=i.stateNode.containerInfo,u=a.nodeType,u===9)Qm(a);else if(u===1)switch(a.nodeName){case"HEAD":case"HTML":case"BODY":Qm(a);break;default:a.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((a&1024)!==0)throw Error(r(163))}if(a=i.sibling,a!==null){a.return=i.return,Gn=a;break}Gn=i.return}}function Ux(a,i,u){var f=u.flags;switch(u.tag){case 0:case 11:case 15:fi(a,u),f&4&&iu(5,u);break;case 1:if(fi(a,u),f&4)if(a=u.stateNode,i===null)try{a.componentDidMount()}catch(w){Kt(u,u.return,w)}else{var b=Vs(u.type,i.memoizedProps);i=i.memoizedState;try{a.componentDidUpdate(b,i,a.__reactInternalSnapshotBeforeUpdate)}catch(w){Kt(u,u.return,w)}}f&64&&Ox(u),f&512&&su(u,u.return);break;case 3:if(fi(a,u),f&64&&(a=u.updateQueue,a!==null)){if(i=null,u.child!==null)switch(u.child.tag){case 27:case 5:i=u.child.stateNode;break;case 1:i=u.child.stateNode}try{vb(a,i)}catch(w){Kt(u,u.return,w)}}break;case 27:i===null&&f&4&&Px(u);case 26:case 5:fi(a,u),i===null&&f&4&&jx(u),f&512&&su(u,u.return);break;case 12:fi(a,u);break;case 31:fi(a,u),f&4&&Fx(a,u);break;case 13:fi(a,u),f&4&&$x(a,u),f&64&&(a=u.memoizedState,a!==null&&(a=a.dehydrated,a!==null&&(u=JS.bind(null,u),yA(a,u))));break;case 22:if(f=u.memoizedState!==null||ci,!f){i=i!==null&&i.memoizedState!==null||Mn,b=ci;var x=Mn;ci=f,(Mn=i)&&!x?hi(a,u,(u.subtreeFlags&8772)!==0):fi(a,u),ci=b,Mn=x}break;case 30:break;default:fi(a,u)}}function Hx(a){var i=a.alternate;i!==null&&(a.alternate=null,Hx(i)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(i=a.stateNode,i!==null&&As(i)),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}var gn=null,xr=!1;function di(a,i,u){for(u=u.child;u!==null;)zx(a,i,u),u=u.sibling}function zx(a,i,u){if(Le&&typeof Le.onCommitFiberUnmount=="function")try{Le.onCommitFiberUnmount(xe,u)}catch{}switch(u.tag){case 26:Mn||ja(u,i),di(a,i,u),u.memoizedState?u.memoizedState.count--:u.stateNode&&(u=u.stateNode,u.parentNode.removeChild(u));break;case 27:Mn||ja(u,i);var f=gn,b=xr;rs(u.type)&&(gn=u.stateNode,xr=!1),di(a,i,u),pu(u.stateNode),gn=f,xr=b;break;case 5:Mn||ja(u,i);case 6:if(f=gn,b=xr,gn=null,di(a,i,u),gn=f,xr=b,gn!==null)if(xr)try{(gn.nodeType===9?gn.body:gn.nodeName==="HTML"?gn.ownerDocument.body:gn).removeChild(u.stateNode)}catch(x){Kt(u,i,x)}else try{gn.removeChild(u.stateNode)}catch(x){Kt(u,i,x)}break;case 18:gn!==null&&(xr?(a=gn,Oy(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,u.stateNode),Zl(a)):Oy(gn,u.stateNode));break;case 4:f=gn,b=xr,gn=u.stateNode.containerInfo,xr=!0,di(a,i,u),gn=f,xr=b;break;case 0:case 11:case 14:case 15:Xi(2,u,i),Mn||Xi(4,u,i),di(a,i,u);break;case 1:Mn||(ja(u,i),f=u.stateNode,typeof f.componentWillUnmount=="function"&&Dx(u,i,f)),di(a,i,u);break;case 21:di(a,i,u);break;case 22:Mn=(f=Mn)||u.memoizedState!==null,di(a,i,u),Mn=f;break;default:di(a,i,u)}}function Fx(a,i){if(i.memoizedState===null&&(a=i.alternate,a!==null&&(a=a.memoizedState,a!==null))){a=a.dehydrated;try{Zl(a)}catch(u){Kt(i,i.return,u)}}}function $x(a,i){if(i.memoizedState===null&&(a=i.alternate,a!==null&&(a=a.memoizedState,a!==null&&(a=a.dehydrated,a!==null))))try{Zl(a)}catch(u){Kt(i,i.return,u)}}function GS(a){switch(a.tag){case 31:case 13:case 19:var i=a.stateNode;return i===null&&(i=a.stateNode=new Bx),i;case 22:return a=a.stateNode,i=a._retryCache,i===null&&(i=a._retryCache=new Bx),i;default:throw Error(r(435,a.tag))}}function nd(a,i){var u=GS(a);i.forEach(function(f){if(!u.has(f)){u.add(f);var b=eA.bind(null,a,f);f.then(b,b)}})}function yr(a,i){var u=i.deletions;if(u!==null)for(var f=0;f<u.length;f++){var b=u[f],x=a,w=i,R=w;e:for(;R!==null;){switch(R.tag){case 27:if(rs(R.type)){gn=R.stateNode,xr=!1;break e}break;case 5:gn=R.stateNode,xr=!1;break e;case 3:case 4:gn=R.stateNode.containerInfo,xr=!0;break e}R=R.return}if(gn===null)throw Error(r(160));zx(x,w,b),gn=null,xr=!1,x=b.alternate,x!==null&&(x.return=null),b.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)Vx(i,a),i=i.sibling}var ga=null;function Vx(a,i){var u=a.alternate,f=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:yr(i,a),Er(a),f&4&&(Xi(3,a,a.return),iu(3,a),Xi(5,a,a.return));break;case 1:yr(i,a),Er(a),f&512&&(Mn||u===null||ja(u,u.return)),f&64&&ci&&(a=a.updateQueue,a!==null&&(f=a.callbacks,f!==null&&(u=a.shared.hiddenCallbacks,a.shared.hiddenCallbacks=u===null?f:u.concat(f))));break;case 26:var b=ga;if(yr(i,a),Er(a),f&512&&(Mn||u===null||ja(u,u.return)),f&4){var x=u!==null?u.memoizedState:null;if(f=a.memoizedState,u===null)if(f===null)if(a.stateNode===null){e:{f=a.type,u=a.memoizedProps,b=b.ownerDocument||b;t:switch(f){case"title":x=b.getElementsByTagName("title")[0],(!x||x[ua]||x[ft]||x.namespaceURI==="http://www.w3.org/2000/svg"||x.hasAttribute("itemprop"))&&(x=b.createElement(f),b.head.insertBefore(x,b.querySelector("head > title"))),er(x,f,u),x[ft]=a,pn(x),f=x;break e;case"link":var w=Vy("link","href",b).get(f+(u.href||""));if(w){for(var R=0;R<w.length;R++)if(x=w[R],x.getAttribute("href")===(u.href==null||u.href===""?null:u.href)&&x.getAttribute("rel")===(u.rel==null?null:u.rel)&&x.getAttribute("title")===(u.title==null?null:u.title)&&x.getAttribute("crossorigin")===(u.crossOrigin==null?null:u.crossOrigin)){w.splice(R,1);break t}}x=b.createElement(f),er(x,f,u),b.head.appendChild(x);break;case"meta":if(w=Vy("meta","content",b).get(f+(u.content||""))){for(R=0;R<w.length;R++)if(x=w[R],x.getAttribute("content")===(u.content==null?null:""+u.content)&&x.getAttribute("name")===(u.name==null?null:u.name)&&x.getAttribute("property")===(u.property==null?null:u.property)&&x.getAttribute("http-equiv")===(u.httpEquiv==null?null:u.httpEquiv)&&x.getAttribute("charset")===(u.charSet==null?null:u.charSet)){w.splice(R,1);break t}}x=b.createElement(f),er(x,f,u),b.head.appendChild(x);break;default:throw Error(r(468,f))}x[ft]=a,pn(x),f=x}a.stateNode=f}else Gy(b,a.type,a.stateNode);else a.stateNode=$y(b,f,a.memoizedProps);else x!==f?(x===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):x.count--,f===null?Gy(b,a.type,a.stateNode):$y(b,f,a.memoizedProps)):f===null&&a.stateNode!==null&&_m(a,a.memoizedProps,u.memoizedProps)}break;case 27:yr(i,a),Er(a),f&512&&(Mn||u===null||ja(u,u.return)),u!==null&&f&4&&_m(a,a.memoizedProps,u.memoizedProps);break;case 5:if(yr(i,a),Er(a),f&512&&(Mn||u===null||ja(u,u.return)),a.flags&32){b=a.stateNode;try{Ra(b,"")}catch(Ve){Kt(a,a.return,Ve)}}f&4&&a.stateNode!=null&&(b=a.memoizedProps,_m(a,b,u!==null?u.memoizedProps:b)),f&1024&&(wm=!0);break;case 6:if(yr(i,a),Er(a),f&4){if(a.stateNode===null)throw Error(r(162));f=a.memoizedProps,u=a.stateNode;try{u.nodeValue=f}catch(Ve){Kt(a,a.return,Ve)}}break;case 3:if(xd=null,b=ga,ga=gd(i.containerInfo),yr(i,a),ga=b,Er(a),f&4&&u!==null&&u.memoizedState.isDehydrated)try{Zl(i.containerInfo)}catch(Ve){Kt(a,a.return,Ve)}wm&&(wm=!1,Gx(a));break;case 4:f=ga,ga=gd(a.stateNode.containerInfo),yr(i,a),Er(a),ga=f;break;case 12:yr(i,a),Er(a);break;case 31:yr(i,a),Er(a),f&4&&(f=a.updateQueue,f!==null&&(a.updateQueue=null,nd(a,f)));break;case 13:yr(i,a),Er(a),a.child.flags&8192&&a.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(ad=qt()),f&4&&(f=a.updateQueue,f!==null&&(a.updateQueue=null,nd(a,f)));break;case 22:b=a.memoizedState!==null;var q=u!==null&&u.memoizedState!==null,ie=ci,be=Mn;if(ci=ie||b,Mn=be||q,yr(i,a),Mn=be,ci=ie,Er(a),f&8192)e:for(i=a.stateNode,i._visibility=b?i._visibility&-2:i._visibility|1,b&&(u===null||q||ci||Mn||Gs(a)),u=null,i=a;;){if(i.tag===5||i.tag===26){if(u===null){q=u=i;try{if(x=q.stateNode,b)w=x.style,typeof w.setProperty=="function"?w.setProperty("display","none","important"):w.display="none";else{R=q.stateNode;var Te=q.memoizedProps.style,se=Te!=null&&Te.hasOwnProperty("display")?Te.display:null;R.style.display=se==null||typeof se=="boolean"?"":(""+se).trim()}}catch(Ve){Kt(q,q.return,Ve)}}}else if(i.tag===6){if(u===null){q=i;try{q.stateNode.nodeValue=b?"":q.memoizedProps}catch(Ve){Kt(q,q.return,Ve)}}}else if(i.tag===18){if(u===null){q=i;try{var oe=q.stateNode;b?Dy(oe,!0):Dy(q.stateNode,!1)}catch(Ve){Kt(q,q.return,Ve)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===a)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===a)break e;for(;i.sibling===null;){if(i.return===null||i.return===a)break e;u===i&&(u=null),i=i.return}u===i&&(u=null),i.sibling.return=i.return,i=i.sibling}f&4&&(f=a.updateQueue,f!==null&&(u=f.retryQueue,u!==null&&(f.retryQueue=null,nd(a,u))));break;case 19:yr(i,a),Er(a),f&4&&(f=a.updateQueue,f!==null&&(a.updateQueue=null,nd(a,f)));break;case 30:break;case 21:break;default:yr(i,a),Er(a)}}function Er(a){var i=a.flags;if(i&2){try{for(var u,f=a.return;f!==null;){if(Mx(f)){u=f;break}f=f.return}if(u==null)throw Error(r(160));switch(u.tag){case 27:var b=u.stateNode,x=Tm(a);td(a,x,b);break;case 5:var w=u.stateNode;u.flags&32&&(Ra(w,""),u.flags&=-33);var R=Tm(a);td(a,R,w);break;case 3:case 4:var q=u.stateNode.containerInfo,ie=Tm(a);vm(a,ie,q);break;default:throw Error(r(161))}}catch(be){Kt(a,a.return,be)}a.flags&=-3}i&4096&&(a.flags&=-4097)}function Gx(a){if(a.subtreeFlags&1024)for(a=a.child;a!==null;){var i=a;Gx(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),a=a.sibling}}function fi(a,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)Ux(a,i.alternate,i),i=i.sibling}function Gs(a){for(a=a.child;a!==null;){var i=a;switch(i.tag){case 0:case 11:case 14:case 15:Xi(4,i,i.return),Gs(i);break;case 1:ja(i,i.return);var u=i.stateNode;typeof u.componentWillUnmount=="function"&&Dx(i,i.return,u),Gs(i);break;case 27:pu(i.stateNode);case 26:case 5:ja(i,i.return),Gs(i);break;case 22:i.memoizedState===null&&Gs(i);break;case 30:Gs(i);break;default:Gs(i)}a=a.sibling}}function hi(a,i,u){for(u=u&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var f=i.alternate,b=a,x=i,w=x.flags;switch(x.tag){case 0:case 11:case 15:hi(b,x,u),iu(4,x);break;case 1:if(hi(b,x,u),f=x,b=f.stateNode,typeof b.componentDidMount=="function")try{b.componentDidMount()}catch(ie){Kt(f,f.return,ie)}if(f=x,b=f.updateQueue,b!==null){var R=f.stateNode;try{var q=b.shared.hiddenCallbacks;if(q!==null)for(b.shared.hiddenCallbacks=null,b=0;b<q.length;b++)Tb(q[b],R)}catch(ie){Kt(f,f.return,ie)}}u&&w&64&&Ox(x),su(x,x.return);break;case 27:Px(x);case 26:case 5:hi(b,x,u),u&&f===null&&w&4&&jx(x),su(x,x.return);break;case 12:hi(b,x,u);break;case 31:hi(b,x,u),u&&w&4&&Fx(b,x);break;case 13:hi(b,x,u),u&&w&4&&$x(b,x);break;case 22:x.memoizedState===null&&hi(b,x,u),su(x,x.return);break;case 30:break;default:hi(b,x,u)}i=i.sibling}}function km(a,i){var u=null;a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(u=a.memoizedState.cachePool.pool),a=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(a=i.memoizedState.cachePool.pool),a!==u&&(a!=null&&a.refCount++,u!=null&&qo(u))}function Cm(a,i){a=null,i.alternate!==null&&(a=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==a&&(i.refCount++,a!=null&&qo(a))}function ba(a,i,u,f){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)qx(a,i,u,f),i=i.sibling}function qx(a,i,u,f){var b=i.flags;switch(i.tag){case 0:case 11:case 15:ba(a,i,u,f),b&2048&&iu(9,i);break;case 1:ba(a,i,u,f);break;case 3:ba(a,i,u,f),b&2048&&(a=null,i.alternate!==null&&(a=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==a&&(i.refCount++,a!=null&&qo(a)));break;case 12:if(b&2048){ba(a,i,u,f),a=i.stateNode;try{var x=i.memoizedProps,w=x.id,R=x.onPostCommit;typeof R=="function"&&R(w,i.alternate===null?"mount":"update",a.passiveEffectDuration,-0)}catch(q){Kt(i,i.return,q)}}else ba(a,i,u,f);break;case 31:ba(a,i,u,f);break;case 13:ba(a,i,u,f);break;case 23:break;case 22:x=i.stateNode,w=i.alternate,i.memoizedState!==null?x._visibility&2?ba(a,i,u,f):lu(a,i):x._visibility&2?ba(a,i,u,f):(x._visibility|=2,zl(a,i,u,f,(i.subtreeFlags&10256)!==0||!1)),b&2048&&km(w,i);break;case 24:ba(a,i,u,f),b&2048&&Cm(i.alternate,i);break;default:ba(a,i,u,f)}}function zl(a,i,u,f,b){for(b=b&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var x=a,w=i,R=u,q=f,ie=w.flags;switch(w.tag){case 0:case 11:case 15:zl(x,w,R,q,b),iu(8,w);break;case 23:break;case 22:var be=w.stateNode;w.memoizedState!==null?be._visibility&2?zl(x,w,R,q,b):lu(x,w):(be._visibility|=2,zl(x,w,R,q,b)),b&&ie&2048&&km(w.alternate,w);break;case 24:zl(x,w,R,q,b),b&&ie&2048&&Cm(w.alternate,w);break;default:zl(x,w,R,q,b)}i=i.sibling}}function lu(a,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var u=a,f=i,b=f.flags;switch(f.tag){case 22:lu(u,f),b&2048&&km(f.alternate,f);break;case 24:lu(u,f),b&2048&&Cm(f.alternate,f);break;default:lu(u,f)}i=i.sibling}}var ou=8192;function Fl(a,i,u){if(a.subtreeFlags&ou)for(a=a.child;a!==null;)Yx(a,i,u),a=a.sibling}function Yx(a,i,u){switch(a.tag){case 26:Fl(a,i,u),a.flags&ou&&a.memoizedState!==null&&LA(u,ga,a.memoizedState,a.memoizedProps);break;case 5:Fl(a,i,u);break;case 3:case 4:var f=ga;ga=gd(a.stateNode.containerInfo),Fl(a,i,u),ga=f;break;case 22:a.memoizedState===null&&(f=a.alternate,f!==null&&f.memoizedState!==null?(f=ou,ou=16777216,Fl(a,i,u),ou=f):Fl(a,i,u));break;default:Fl(a,i,u)}}function Wx(a){var i=a.alternate;if(i!==null&&(a=i.child,a!==null)){i.child=null;do i=a.sibling,a.sibling=null,a=i;while(a!==null)}}function uu(a){var i=a.deletions;if((a.flags&16)!==0){if(i!==null)for(var u=0;u<i.length;u++){var f=i[u];Gn=f,Xx(f,a)}Wx(a)}if(a.subtreeFlags&10256)for(a=a.child;a!==null;)Qx(a),a=a.sibling}function Qx(a){switch(a.tag){case 0:case 11:case 15:uu(a),a.flags&2048&&Xi(9,a,a.return);break;case 3:uu(a);break;case 12:uu(a);break;case 22:var i=a.stateNode;a.memoizedState!==null&&i._visibility&2&&(a.return===null||a.return.tag!==13)?(i._visibility&=-3,rd(a)):uu(a);break;default:uu(a)}}function rd(a){var i=a.deletions;if((a.flags&16)!==0){if(i!==null)for(var u=0;u<i.length;u++){var f=i[u];Gn=f,Xx(f,a)}Wx(a)}for(a=a.child;a!==null;){switch(i=a,i.tag){case 0:case 11:case 15:Xi(8,i,i.return),rd(i);break;case 22:u=i.stateNode,u._visibility&2&&(u._visibility&=-3,rd(i));break;default:rd(i)}a=a.sibling}}function Xx(a,i){for(;Gn!==null;){var u=Gn;switch(u.tag){case 0:case 11:case 15:Xi(8,u,i);break;case 23:case 22:if(u.memoizedState!==null&&u.memoizedState.cachePool!==null){var f=u.memoizedState.cachePool.pool;f!=null&&f.refCount++}break;case 24:qo(u.memoizedState.cache)}if(f=u.child,f!==null)f.return=u,Gn=f;else e:for(u=a;Gn!==null;){f=Gn;var b=f.sibling,x=f.return;if(Hx(f),f===u){Gn=null;break e}if(b!==null){b.return=x,Gn=b;break e}Gn=x}}}var qS={getCacheForType:function(a){var i=Zn(On),u=i.data.get(a);return u===void 0&&(u=a(),i.data.set(a,u)),u},cacheSignal:function(){return Zn(On).controller.signal}},YS=typeof WeakMap=="function"?WeakMap:Map,Wt=0,an=null,Ot=null,Mt=0,Xt=0,Ir=null,Ki=!1,$l=!1,Sm=!1,mi=0,En=0,Zi=0,qs=0,Am=0,Or=0,Vl=0,cu=null,_r=null,Nm=!1,ad=0,Kx=0,id=1/0,sd=null,Ji=null,Un=0,es=null,Gl=null,pi=0,Rm=0,Lm=null,Zx=null,du=0,Im=null;function Dr(){return(Wt&2)!==0&&Mt!==0?Mt&-Mt:z.T!==null?Bm():Sa()}function Jx(){if(Or===0)if((Mt&536870912)===0||Bt){var a=He;He<<=1,(He&3932160)===0&&(He=262144),Or=a}else Or=536870912;return a=Rr.current,a!==null&&(a.flags|=32),Or}function Tr(a,i,u){(a===an&&(Xt===2||Xt===9)||a.cancelPendingCommit!==null)&&(ql(a,0),ts(a,Mt,Or,!1)),dn(a,u),((Wt&2)===0||a!==an)&&(a===an&&((Wt&2)===0&&(qs|=u),En===4&&ts(a,Mt,Or,!1)),Ma(a))}function ey(a,i,u){if((Wt&6)!==0)throw Error(r(327));var f=!u&&(i&127)===0&&(i&a.expiredLanes)===0||Qe(a,i),b=f?XS(a,i):Dm(a,i,!0),x=f;do{if(b===0){$l&&!f&&ts(a,i,0,!1);break}else{if(u=a.current.alternate,x&&!WS(u)){b=Dm(a,i,!1),x=!1;continue}if(b===2){if(x=i,a.errorRecoveryDisabledLanes&x)var w=0;else w=a.pendingLanes&-536870913,w=w!==0?w:w&536870912?536870912:0;if(w!==0){i=w;e:{var R=a;b=cu;var q=R.current.memoizedState.isDehydrated;if(q&&(ql(R,w).flags|=256),w=Dm(R,w,!1),w!==2){if(Sm&&!q){R.errorRecoveryDisabledLanes|=x,qs|=x,b=4;break e}x=_r,_r=b,x!==null&&(_r===null?_r=x:_r.push.apply(_r,x))}b=w}if(x=!1,b!==2)continue}}if(b===1){ql(a,0),ts(a,i,0,!0);break}e:{switch(f=a,x=b,x){case 0:case 1:throw Error(r(345));case 4:if((i&4194048)!==i)break;case 6:ts(f,i,Or,!Ki);break e;case 2:_r=null;break;case 3:case 5:break;default:throw Error(r(329))}if((i&62914560)===i&&(b=ad+300-qt(),10<b)){if(ts(f,i,Or,!Ki),Ct(f,0,!0)!==0)break e;pi=i,f.timeoutHandle=Ly(ty.bind(null,f,u,_r,sd,Nm,i,Or,qs,Vl,Ki,x,"Throttled",-0,0),b);break e}ty(f,u,_r,sd,Nm,i,Or,qs,Vl,Ki,x,null,-0,0)}}break}while(!0);Ma(a)}function ty(a,i,u,f,b,x,w,R,q,ie,be,Te,se,oe){if(a.timeoutHandle=-1,Te=i.subtreeFlags,Te&8192||(Te&16785408)===16785408){Te={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:br},Yx(i,x,Te);var Ve=(x&62914560)===x?ad-qt():(x&4194048)===x?Kx-qt():0;if(Ve=IA(Te,Ve),Ve!==null){pi=x,a.cancelPendingCommit=Ve(uy.bind(null,a,i,x,u,f,b,w,R,q,be,Te,null,se,oe)),ts(a,x,w,!ie);return}}uy(a,i,x,u,f,b,w,R,q)}function WS(a){for(var i=a;;){var u=i.tag;if((u===0||u===11||u===15)&&i.flags&16384&&(u=i.updateQueue,u!==null&&(u=u.stores,u!==null)))for(var f=0;f<u.length;f++){var b=u[f],x=b.getSnapshot;b=b.value;try{if(!Ar(x(),b))return!1}catch{return!1}}if(u=i.child,i.subtreeFlags&16384&&u!==null)u.return=i,i=u;else{if(i===a)break;for(;i.sibling===null;){if(i.return===null||i.return===a)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function ts(a,i,u,f){i&=~Am,i&=~qs,a.suspendedLanes|=i,a.pingedLanes&=~i,f&&(a.warmLanes|=i),f=a.expirationTimes;for(var b=i;0<b;){var x=31-$e(b),w=1<<x;f[x]=-1,b&=~w}u!==0&&Ss(a,u,i)}function ld(){return(Wt&6)===0?(fu(0),!1):!0}function Om(){if(Ot!==null){if(Xt===0)var a=Ot.return;else a=Ot,ai=Ps=null,Qh(a),Ml=null,Wo=0,a=Ot;for(;a!==null;)Ix(a.alternate,a),a=a.return;Ot=null}}function ql(a,i){var u=a.timeoutHandle;u!==-1&&(a.timeoutHandle=-1,mA(u)),u=a.cancelPendingCommit,u!==null&&(a.cancelPendingCommit=null,u()),pi=0,Om(),an=a,Ot=u=ni(a.current,null),Mt=i,Xt=0,Ir=null,Ki=!1,$l=Qe(a,i),Sm=!1,Vl=Or=Am=qs=Zi=En=0,_r=cu=null,Nm=!1,(i&8)!==0&&(i|=i&32);var f=a.entangledLanes;if(f!==0)for(a=a.entanglements,f&=i;0<f;){var b=31-$e(f),x=1<<b;i|=a[b],f&=~x}return mi=i,Ac(),u}function ny(a,i){wt=null,z.H=nu,i===jl||i===Mc?(i=xb(),Xt=3):i===Ph?(i=xb(),Xt=4):Xt=i===dm?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,Ir=i,Ot===null&&(En=1,Xc(a,Gr(i,a.current)))}function ry(){var a=Rr.current;return a===null?!0:(Mt&4194048)===Mt?Qr===null:(Mt&62914560)===Mt||(Mt&536870912)!==0?a===Qr:!1}function ay(){var a=z.H;return z.H=nu,a===null?nu:a}function iy(){var a=z.A;return z.A=qS,a}function od(){En=4,Ki||(Mt&4194048)!==Mt&&Rr.current!==null||($l=!0),(Zi&134217727)===0&&(qs&134217727)===0||an===null||ts(an,Mt,Or,!1)}function Dm(a,i,u){var f=Wt;Wt|=2;var b=ay(),x=iy();(an!==a||Mt!==i)&&(sd=null,ql(a,i)),i=!1;var w=En;e:do try{if(Xt!==0&&Ot!==null){var R=Ot,q=Ir;switch(Xt){case 8:Om(),w=6;break e;case 3:case 2:case 9:case 6:Rr.current===null&&(i=!0);var ie=Xt;if(Xt=0,Ir=null,Yl(a,R,q,ie),u&&$l){w=0;break e}break;default:ie=Xt,Xt=0,Ir=null,Yl(a,R,q,ie)}}QS(),w=En;break}catch(be){ny(a,be)}while(!0);return i&&a.shellSuspendCounter++,ai=Ps=null,Wt=f,z.H=b,z.A=x,Ot===null&&(an=null,Mt=0,Ac()),w}function QS(){for(;Ot!==null;)sy(Ot)}function XS(a,i){var u=Wt;Wt|=2;var f=ay(),b=iy();an!==a||Mt!==i?(sd=null,id=qt()+500,ql(a,i)):$l=Qe(a,i);e:do try{if(Xt!==0&&Ot!==null){i=Ot;var x=Ir;t:switch(Xt){case 1:Xt=0,Ir=null,Yl(a,i,x,1);break;case 2:case 9:if(gb(x)){Xt=0,Ir=null,ly(i);break}i=function(){Xt!==2&&Xt!==9||an!==a||(Xt=7),Ma(a)},x.then(i,i);break e;case 3:Xt=7;break e;case 4:Xt=5;break e;case 7:gb(x)?(Xt=0,Ir=null,ly(i)):(Xt=0,Ir=null,Yl(a,i,x,7));break;case 5:var w=null;switch(Ot.tag){case 26:w=Ot.memoizedState;case 5:case 27:var R=Ot;if(w?qy(w):R.stateNode.complete){Xt=0,Ir=null;var q=R.sibling;if(q!==null)Ot=q;else{var ie=R.return;ie!==null?(Ot=ie,ud(ie)):Ot=null}break t}}Xt=0,Ir=null,Yl(a,i,x,5);break;case 6:Xt=0,Ir=null,Yl(a,i,x,6);break;case 8:Om(),En=6;break e;default:throw Error(r(462))}}KS();break}catch(be){ny(a,be)}while(!0);return ai=Ps=null,z.H=f,z.A=b,Wt=u,Ot!==null?0:(an=null,Mt=0,Ac(),En)}function KS(){for(;Ot!==null&&!rn();)sy(Ot)}function sy(a){var i=Rx(a.alternate,a,mi);a.memoizedProps=a.pendingProps,i===null?ud(a):Ot=i}function ly(a){var i=a,u=i.alternate;switch(i.tag){case 15:case 0:i=wx(u,i,i.pendingProps,i.type,void 0,Mt);break;case 11:i=wx(u,i,i.pendingProps,i.type.render,i.ref,Mt);break;case 5:Qh(i);default:Ix(u,i),i=Ot=ib(i,mi),i=Rx(u,i,mi)}a.memoizedProps=a.pendingProps,i===null?ud(a):Ot=i}function Yl(a,i,u,f){ai=Ps=null,Qh(i),Ml=null,Wo=0;var b=i.return;try{if(US(a,b,i,u,Mt)){En=1,Xc(a,Gr(u,a.current)),Ot=null;return}}catch(x){if(b!==null)throw Ot=b,x;En=1,Xc(a,Gr(u,a.current)),Ot=null;return}i.flags&32768?(Bt||f===1?a=!0:$l||(Mt&536870912)!==0?a=!1:(Ki=a=!0,(f===2||f===9||f===3||f===6)&&(f=Rr.current,f!==null&&f.tag===13&&(f.flags|=16384))),oy(i,a)):ud(i)}function ud(a){var i=a;do{if((i.flags&32768)!==0){oy(i,Ki);return}a=i.return;var u=FS(i.alternate,i,mi);if(u!==null){Ot=u;return}if(i=i.sibling,i!==null){Ot=i;return}Ot=i=a}while(i!==null);En===0&&(En=5)}function oy(a,i){do{var u=$S(a.alternate,a);if(u!==null){u.flags&=32767,Ot=u;return}if(u=a.return,u!==null&&(u.flags|=32768,u.subtreeFlags=0,u.deletions=null),!i&&(a=a.sibling,a!==null)){Ot=a;return}Ot=a=u}while(a!==null);En=6,Ot=null}function uy(a,i,u,f,b,x,w,R,q){a.cancelPendingCommit=null;do cd();while(Un!==0);if((Wt&6)!==0)throw Error(r(327));if(i!==null){if(i===a.current)throw Error(r(177));if(x=i.lanes|i.childLanes,x|=Th,Yt(a,u,x,w,R,q),a===an&&(Ot=an=null,Mt=0),Gl=i,es=a,pi=u,Rm=x,Lm=b,Zx=f,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(a.callbackNode=null,a.callbackPriority=0,tA(Ze,function(){return my(),null})):(a.callbackNode=null,a.callbackPriority=0),f=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||f){f=z.T,z.T=null,b=ee.p,ee.p=2,w=Wt,Wt|=4;try{VS(a,i,u)}finally{Wt=w,ee.p=b,z.T=f}}Un=1,cy(),dy(),fy()}}function cy(){if(Un===1){Un=0;var a=es,i=Gl,u=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||u){u=z.T,z.T=null;var f=ee.p;ee.p=2;var b=Wt;Wt|=4;try{Vx(i,a);var x=qm,w=X1(a.containerInfo),R=x.focusedElem,q=x.selectionRange;if(w!==R&&R&&R.ownerDocument&&Q1(R.ownerDocument.documentElement,R)){if(q!==null&&bh(R)){var ie=q.start,be=q.end;if(be===void 0&&(be=ie),"selectionStart"in R)R.selectionStart=ie,R.selectionEnd=Math.min(be,R.value.length);else{var Te=R.ownerDocument||document,se=Te&&Te.defaultView||window;if(se.getSelection){var oe=se.getSelection(),Ve=R.textContent.length,ct=Math.min(q.start,Ve),tn=q.end===void 0?ct:Math.min(q.end,Ve);!oe.extend&&ct>tn&&(w=tn,tn=ct,ct=w);var Z=W1(R,ct),X=W1(R,tn);if(Z&&X&&(oe.rangeCount!==1||oe.anchorNode!==Z.node||oe.anchorOffset!==Z.offset||oe.focusNode!==X.node||oe.focusOffset!==X.offset)){var re=Te.createRange();re.setStart(Z.node,Z.offset),oe.removeAllRanges(),ct>tn?(oe.addRange(re),oe.extend(X.node,X.offset)):(re.setEnd(X.node,X.offset),oe.addRange(re))}}}}for(Te=[],oe=R;oe=oe.parentNode;)oe.nodeType===1&&Te.push({element:oe,left:oe.scrollLeft,top:oe.scrollTop});for(typeof R.focus=="function"&&R.focus(),R=0;R<Te.length;R++){var ye=Te[R];ye.element.scrollLeft=ye.left,ye.element.scrollTop=ye.top}}Td=!!Gm,qm=Gm=null}finally{Wt=b,ee.p=f,z.T=u}}a.current=i,Un=2}}function dy(){if(Un===2){Un=0;var a=es,i=Gl,u=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||u){u=z.T,z.T=null;var f=ee.p;ee.p=2;var b=Wt;Wt|=4;try{Ux(a,i.alternate,i)}finally{Wt=b,ee.p=f,z.T=u}}Un=3}}function fy(){if(Un===4||Un===3){Un=0,An();var a=es,i=Gl,u=pi,f=Zx;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?Un=5:(Un=0,Gl=es=null,hy(a,a.pendingLanes));var b=a.pendingLanes;if(b===0&&(Ji=null),Ii(u),i=i.stateNode,Le&&typeof Le.onCommitFiberRoot=="function")try{Le.onCommitFiberRoot(xe,i,void 0,(i.current.flags&128)===128)}catch{}if(f!==null){i=z.T,b=ee.p,ee.p=2,z.T=null;try{for(var x=a.onRecoverableError,w=0;w<f.length;w++){var R=f[w];x(R.value,{componentStack:R.stack})}}finally{z.T=i,ee.p=b}}(pi&3)!==0&&cd(),Ma(a),b=a.pendingLanes,(u&261930)!==0&&(b&42)!==0?a===Im?du++:(du=0,Im=a):du=0,fu(0)}}function hy(a,i){(a.pooledCacheLanes&=i)===0&&(i=a.pooledCache,i!=null&&(a.pooledCache=null,qo(i)))}function cd(){return cy(),dy(),fy(),my()}function my(){if(Un!==5)return!1;var a=es,i=Rm;Rm=0;var u=Ii(pi),f=z.T,b=ee.p;try{ee.p=32>u?32:u,z.T=null,u=Lm,Lm=null;var x=es,w=pi;if(Un=0,Gl=es=null,pi=0,(Wt&6)!==0)throw Error(r(331));var R=Wt;if(Wt|=4,Qx(x.current),qx(x,x.current,w,u),Wt=R,fu(0,!1),Le&&typeof Le.onPostCommitFiberRoot=="function")try{Le.onPostCommitFiberRoot(xe,x)}catch{}return!0}finally{ee.p=b,z.T=f,hy(a,i)}}function py(a,i,u){i=Gr(u,i),i=cm(a.stateNode,i,2),a=Yi(a,i,2),a!==null&&(dn(a,2),Ma(a))}function Kt(a,i,u){if(a.tag===3)py(a,a,u);else for(;i!==null;){if(i.tag===3){py(i,a,u);break}else if(i.tag===1){var f=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof f.componentDidCatch=="function"&&(Ji===null||!Ji.has(f))){a=Gr(u,a),u=gx(2),f=Yi(i,u,2),f!==null&&(bx(u,f,i,a),dn(f,2),Ma(f));break}}i=i.return}}function jm(a,i,u){var f=a.pingCache;if(f===null){f=a.pingCache=new YS;var b=new Set;f.set(i,b)}else b=f.get(i),b===void 0&&(b=new Set,f.set(i,b));b.has(u)||(Sm=!0,b.add(u),a=ZS.bind(null,a,i,u),i.then(a,a))}function ZS(a,i,u){var f=a.pingCache;f!==null&&f.delete(i),a.pingedLanes|=a.suspendedLanes&u,a.warmLanes&=~u,an===a&&(Mt&u)===u&&(En===4||En===3&&(Mt&62914560)===Mt&&300>qt()-ad?(Wt&2)===0&&ql(a,0):Am|=u,Vl===Mt&&(Vl=0)),Ma(a)}function gy(a,i){i===0&&(i=Nn()),a=Ds(a,i),a!==null&&(dn(a,i),Ma(a))}function JS(a){var i=a.memoizedState,u=0;i!==null&&(u=i.retryLane),gy(a,u)}function eA(a,i){var u=0;switch(a.tag){case 31:case 13:var f=a.stateNode,b=a.memoizedState;b!==null&&(u=b.retryLane);break;case 19:f=a.stateNode;break;case 22:f=a.stateNode._retryCache;break;default:throw Error(r(314))}f!==null&&f.delete(i),gy(a,u)}function tA(a,i){return ht(a,i)}var dd=null,Wl=null,Mm=!1,fd=!1,Pm=!1,ns=0;function Ma(a){a!==Wl&&a.next===null&&(Wl===null?dd=Wl=a:Wl=Wl.next=a),fd=!0,Mm||(Mm=!0,rA())}function fu(a,i){if(!Pm&&fd){Pm=!0;do for(var u=!1,f=dd;f!==null;){if(a!==0){var b=f.pendingLanes;if(b===0)var x=0;else{var w=f.suspendedLanes,R=f.pingedLanes;x=(1<<31-$e(42|a)+1)-1,x&=b&~(w&~R),x=x&201326741?x&201326741|1:x?x|2:0}x!==0&&(u=!0,Ey(f,x))}else x=Mt,x=Ct(f,f===an?x:0,f.cancelPendingCommit!==null||f.timeoutHandle!==-1),(x&3)===0||Qe(f,x)||(u=!0,Ey(f,x));f=f.next}while(u);Pm=!1}}function nA(){by()}function by(){fd=Mm=!1;var a=0;ns!==0&&hA()&&(a=ns);for(var i=qt(),u=null,f=dd;f!==null;){var b=f.next,x=xy(f,i);x===0?(f.next=null,u===null?dd=b:u.next=b,b===null&&(Wl=u)):(u=f,(a!==0||(x&3)!==0)&&(fd=!0)),f=b}Un!==0&&Un!==5||fu(a),ns!==0&&(ns=0)}function xy(a,i){for(var u=a.suspendedLanes,f=a.pingedLanes,b=a.expirationTimes,x=a.pendingLanes&-62914561;0<x;){var w=31-$e(x),R=1<<w,q=b[w];q===-1?((R&u)===0||(R&f)!==0)&&(b[w]=yt(R,i)):q<=i&&(a.expiredLanes|=R),x&=~R}if(i=an,u=Mt,u=Ct(a,a===i?u:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),f=a.callbackNode,u===0||a===i&&(Xt===2||Xt===9)||a.cancelPendingCommit!==null)return f!==null&&f!==null&&mn(f),a.callbackNode=null,a.callbackPriority=0;if((u&3)===0||Qe(a,u)){if(i=u&-u,i===a.callbackPriority)return i;switch(f!==null&&mn(f),Ii(u)){case 2:case 8:u=Ce;break;case 32:u=Ze;break;case 268435456:u=dt;break;default:u=Ze}return f=yy.bind(null,a),u=ht(u,f),a.callbackPriority=i,a.callbackNode=u,i}return f!==null&&f!==null&&mn(f),a.callbackPriority=2,a.callbackNode=null,2}function yy(a,i){if(Un!==0&&Un!==5)return a.callbackNode=null,a.callbackPriority=0,null;var u=a.callbackNode;if(cd()&&a.callbackNode!==u)return null;var f=Mt;return f=Ct(a,a===an?f:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),f===0?null:(ey(a,f,i),xy(a,qt()),a.callbackNode!=null&&a.callbackNode===u?yy.bind(null,a):null)}function Ey(a,i){if(cd())return null;ey(a,i,!0)}function rA(){pA(function(){(Wt&6)!==0?ht(me,nA):by()})}function Bm(){if(ns===0){var a=Ol;a===0&&(a=ut,ut<<=1,(ut&261888)===0&&(ut=256)),ns=a}return ns}function _y(a){return a==null||typeof a=="symbol"||typeof a=="boolean"?null:typeof a=="function"?a:Ja(""+a)}function Ty(a,i){var u=i.ownerDocument.createElement("input");return u.name=i.name,u.value=i.value,a.id&&u.setAttribute("form",a.id),i.parentNode.insertBefore(u,i),a=new FormData(a),u.parentNode.removeChild(u),a}function aA(a,i,u,f,b){if(i==="submit"&&u&&u.stateNode===b){var x=_y((b[vt]||null).action),w=f.submitter;w&&(i=(i=w[vt]||null)?_y(i.formAction):w.getAttribute("formAction"),i!==null&&(x=i,w=null));var R=new pe("action","action",null,f,b);a.push({event:R,listeners:[{instance:null,listener:function(){if(f.defaultPrevented){if(ns!==0){var q=w?Ty(b,w):new FormData(b);am(u,{pending:!0,data:q,method:b.method,action:x},null,q)}}else typeof x=="function"&&(R.preventDefault(),q=w?Ty(b,w):new FormData(b),am(u,{pending:!0,data:q,method:b.method,action:x},x,q))},currentTarget:b}]})}}for(var Um=0;Um<_h.length;Um++){var Hm=_h[Um],iA=Hm.toLowerCase(),sA=Hm[0].toUpperCase()+Hm.slice(1);pa(iA,"on"+sA)}pa(J1,"onAnimationEnd"),pa(eb,"onAnimationIteration"),pa(tb,"onAnimationStart"),pa("dblclick","onDoubleClick"),pa("focusin","onFocus"),pa("focusout","onBlur"),pa(TS,"onTransitionRun"),pa(vS,"onTransitionStart"),pa(wS,"onTransitionCancel"),pa(nb,"onTransitionEnd"),Cr("onMouseEnter",["mouseout","mouseover"]),Cr("onMouseLeave",["mouseout","mouseover"]),Cr("onPointerEnter",["pointerout","pointerover"]),Cr("onPointerLeave",["pointerout","pointerover"]),gr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),gr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),gr("onBeforeInput",["compositionend","keypress","textInput","paste"]),gr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),gr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),gr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var hu="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(" "),lA=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(hu));function vy(a,i){i=(i&4)!==0;for(var u=0;u<a.length;u++){var f=a[u],b=f.event;f=f.listeners;e:{var x=void 0;if(i)for(var w=f.length-1;0<=w;w--){var R=f[w],q=R.instance,ie=R.currentTarget;if(R=R.listener,q!==x&&b.isPropagationStopped())break e;x=R,b.currentTarget=ie;try{x(b)}catch(be){Sc(be)}b.currentTarget=null,x=q}else for(w=0;w<f.length;w++){if(R=f[w],q=R.instance,ie=R.currentTarget,R=R.listener,q!==x&&b.isPropagationStopped())break e;x=R,b.currentTarget=ie;try{x(b)}catch(be){Sc(be)}b.currentTarget=null,x=q}}}}function Dt(a,i){var u=i[Tn];u===void 0&&(u=i[Tn]=new Set);var f=a+"__bubble";u.has(f)||(wy(i,a,2,!1),u.add(f))}function zm(a,i,u){var f=0;i&&(f|=4),wy(u,a,f,i)}var hd="_reactListening"+Math.random().toString(36).slice(2);function Fm(a){if(!a[hd]){a[hd]=!0,Di.forEach(function(u){u!=="selectionchange"&&(lA.has(u)||zm(u,!1,a),zm(u,!0,a))});var i=a.nodeType===9?a:a.ownerDocument;i===null||i[hd]||(i[hd]=!0,zm("selectionchange",!1,i))}}function wy(a,i,u,f){switch(Jy(i)){case 2:var b=jA;break;case 8:b=MA;break;default:b=rp}u=b.bind(null,i,u,a),b=void 0,!de||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(b=!0),f?b!==void 0?a.addEventListener(i,u,{capture:!0,passive:b}):a.addEventListener(i,u,!0):b!==void 0?a.addEventListener(i,u,{passive:b}):a.addEventListener(i,u,!1)}function $m(a,i,u,f,b){var x=f;if((i&1)===0&&(i&2)===0&&f!==null)e:for(;;){if(f===null)return;var w=f.tag;if(w===3||w===4){var R=f.stateNode.containerInfo;if(R===b)break;if(w===4)for(w=f.return;w!==null;){var q=w.tag;if((q===3||q===4)&&w.stateNode.containerInfo===b)return;w=w.return}for(;R!==null;){if(w=ca(R),w===null)return;if(q=w.tag,q===5||q===6||q===26||q===27){f=x=w;continue e}R=R.parentNode}}f=f.return}Ls(function(){var ie=x,be=ei(u),Te=[];e:{var se=rb.get(a);if(se!==void 0){var oe=pe,Ve=a;switch(a){case"keypress":if(Ee(u)===0)break e;case"keydown":case"keyup":oe=eS;break;case"focusin":Ve="focus",oe=fh;break;case"focusout":Ve="blur",oe=fh;break;case"beforeblur":case"afterblur":oe=fh;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":oe=In;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":oe=kc;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":oe=rS;break;case J1:case eb:case tb:oe=GC;break;case nb:oe=iS;break;case"scroll":case"scrollend":oe=Pe;break;case"wheel":oe=lS;break;case"copy":case"cut":case"paste":oe=YC;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":oe=D1;break;case"toggle":case"beforetoggle":oe=uS}var ct=(i&4)!==0,tn=!ct&&(a==="scroll"||a==="scrollend"),Z=ct?se!==null?se+"Capture":null:se;ct=[];for(var X=ie,re;X!==null;){var ye=X;if(re=ye.stateNode,ye=ye.tag,ye!==5&&ye!==26&&ye!==27||re===null||Z===null||(ye=W(X,Z),ye!=null&&ct.push(mu(X,ye,re))),tn)break;X=X.return}0<ct.length&&(se=new oe(se,Ve,null,u,be),Te.push({event:se,listeners:ct}))}}if((i&7)===0){e:{if(se=a==="mouseover"||a==="pointerover",oe=a==="mouseout"||a==="pointerout",se&&u!==Ui&&(Ve=u.relatedTarget||u.fromElement)&&(ca(Ve)||Ve[Xn]))break e;if((oe||se)&&(se=be.window===be?be:(se=be.ownerDocument)?se.defaultView||se.parentWindow:window,oe?(Ve=u.relatedTarget||u.toElement,oe=ie,Ve=Ve?ca(Ve):null,Ve!==null&&(tn=l(Ve),ct=Ve.tag,Ve!==tn||ct!==5&&ct!==27&&ct!==6)&&(Ve=null)):(oe=null,Ve=ie),oe!==Ve)){if(ct=In,ye="onMouseLeave",Z="onMouseEnter",X="mouse",(a==="pointerout"||a==="pointerover")&&(ct=D1,ye="onPointerLeave",Z="onPointerEnter",X="pointer"),tn=oe==null?se:zr(oe),re=Ve==null?se:zr(Ve),se=new ct(ye,X+"leave",oe,u,be),se.target=tn,se.relatedTarget=re,ye=null,ca(be)===ie&&(ct=new ct(Z,X+"enter",Ve,u,be),ct.target=re,ct.relatedTarget=tn,ye=ct),tn=ye,oe&&Ve)t:{for(ct=oA,Z=oe,X=Ve,re=0,ye=Z;ye;ye=ct(ye))re++;ye=0;for(var tt=X;tt;tt=ct(tt))ye++;for(;0<re-ye;)Z=ct(Z),re--;for(;0<ye-re;)X=ct(X),ye--;for(;re--;){if(Z===X||X!==null&&Z===X.alternate){ct=Z;break t}Z=ct(Z),X=ct(X)}ct=null}else ct=null;oe!==null&&ky(Te,se,oe,ct,!1),Ve!==null&&tn!==null&&ky(Te,tn,Ve,ct,!0)}}e:{if(se=ie?zr(ie):window,oe=se.nodeName&&se.nodeName.toLowerCase(),oe==="select"||oe==="input"&&se.type==="file")var $t=F1;else if(H1(se))if($1)$t=yS;else{$t=bS;var Je=gS}else oe=se.nodeName,!oe||oe.toLowerCase()!=="input"||se.type!=="checkbox"&&se.type!=="radio"?ie&&Za(ie.elementType)&&($t=F1):$t=xS;if($t&&($t=$t(a,ie))){z1(Te,$t,u,be);break e}Je&&Je(a,se,ie),a==="focusout"&&ie&&se.type==="number"&&ie.memoizedProps.value!=null&&Bi(se,"number",se.value)}switch(Je=ie?zr(ie):window,a){case"focusin":(H1(Je)||Je.contentEditable==="true")&&(kl=Je,xh=ie,$o=null);break;case"focusout":$o=xh=kl=null;break;case"mousedown":yh=!0;break;case"contextmenu":case"mouseup":case"dragend":yh=!1,K1(Te,u,be);break;case"selectionchange":if(_S)break;case"keydown":case"keyup":K1(Te,u,be)}var St;if(mh)e:{switch(a){case"compositionstart":var Pt="onCompositionStart";break e;case"compositionend":Pt="onCompositionEnd";break e;case"compositionupdate":Pt="onCompositionUpdate";break e}Pt=void 0}else wl?B1(a,u)&&(Pt="onCompositionEnd"):a==="keydown"&&u.keyCode===229&&(Pt="onCompositionStart");Pt&&(j1&&u.locale!=="ko"&&(wl||Pt!=="onCompositionStart"?Pt==="onCompositionEnd"&&wl&&(St=fe()):(Ue=be,pt="value"in Ue?Ue.value:Ue.textContent,wl=!0)),Je=md(ie,Pt),0<Je.length&&(Pt=new O1(Pt,a,null,u,be),Te.push({event:Pt,listeners:Je}),St?Pt.data=St:(St=U1(u),St!==null&&(Pt.data=St)))),(St=dS?fS(a,u):hS(a,u))&&(Pt=md(ie,"onBeforeInput"),0<Pt.length&&(Je=new O1("onBeforeInput","beforeinput",null,u,be),Te.push({event:Je,listeners:Pt}),Je.data=St)),aA(Te,a,ie,u,be)}vy(Te,i)})}function mu(a,i,u){return{instance:a,listener:i,currentTarget:u}}function md(a,i){for(var u=i+"Capture",f=[];a!==null;){var b=a,x=b.stateNode;if(b=b.tag,b!==5&&b!==26&&b!==27||x===null||(b=W(a,u),b!=null&&f.unshift(mu(a,b,x)),b=W(a,i),b!=null&&f.push(mu(a,b,x))),a.tag===3)return f;a=a.return}return[]}function oA(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5&&a.tag!==27);return a||null}function ky(a,i,u,f,b){for(var x=i._reactName,w=[];u!==null&&u!==f;){var R=u,q=R.alternate,ie=R.stateNode;if(R=R.tag,q!==null&&q===f)break;R!==5&&R!==26&&R!==27||ie===null||(q=ie,b?(ie=W(u,x),ie!=null&&w.unshift(mu(u,ie,q))):b||(ie=W(u,x),ie!=null&&w.push(mu(u,ie,q)))),u=u.return}w.length!==0&&a.push({event:i,listeners:w})}var uA=/\r\n?/g,cA=/\u0000|\uFFFD/g;function Cy(a){return(typeof a=="string"?a:""+a).replace(uA,`
|
|
50
|
+
`).replace(cA,"")}function Sy(a,i){return i=Cy(i),Cy(a)===i}function en(a,i,u,f,b,x){switch(u){case"children":typeof f=="string"?i==="body"||i==="textarea"&&f===""||Ra(a,f):(typeof f=="number"||typeof f=="bigint")&&i!=="body"&&Ra(a,""+f);break;case"className":fa(a,"class",f);break;case"tabIndex":fa(a,"tabindex",f);break;case"dir":case"role":case"viewBox":case"width":case"height":fa(a,u,f);break;case"style":Ka(a,f,x);break;case"data":if(i!=="object"){fa(a,"data",f);break}case"src":case"href":if(f===""&&(i!=="a"||u!=="href")){a.removeAttribute(u);break}if(f==null||typeof f=="function"||typeof f=="symbol"||typeof f=="boolean"){a.removeAttribute(u);break}f=Ja(""+f),a.setAttribute(u,f);break;case"action":case"formAction":if(typeof f=="function"){a.setAttribute(u,"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"&&(u==="formAction"?(i!=="input"&&en(a,i,"name",b.name,b,null),en(a,i,"formEncType",b.formEncType,b,null),en(a,i,"formMethod",b.formMethod,b,null),en(a,i,"formTarget",b.formTarget,b,null)):(en(a,i,"encType",b.encType,b,null),en(a,i,"method",b.method,b,null),en(a,i,"target",b.target,b,null)));if(f==null||typeof f=="symbol"||typeof f=="boolean"){a.removeAttribute(u);break}f=Ja(""+f),a.setAttribute(u,f);break;case"onClick":f!=null&&(a.onclick=br);break;case"onScroll":f!=null&&Dt("scroll",a);break;case"onScrollEnd":f!=null&&Dt("scrollend",a);break;case"dangerouslySetInnerHTML":if(f!=null){if(typeof f!="object"||!("__html"in f))throw Error(r(61));if(u=f.__html,u!=null){if(b.children!=null)throw Error(r(60));a.innerHTML=u}}break;case"multiple":a.multiple=f&&typeof f!="function"&&typeof f!="symbol";break;case"muted":a.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"){a.removeAttribute("xlink:href");break}u=Ja(""+f),a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",u);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"?a.setAttribute(u,""+f):a.removeAttribute(u);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"?a.setAttribute(u,""):a.removeAttribute(u);break;case"capture":case"download":f===!0?a.setAttribute(u,""):f!==!1&&f!=null&&typeof f!="function"&&typeof f!="symbol"?a.setAttribute(u,f):a.removeAttribute(u);break;case"cols":case"rows":case"size":case"span":f!=null&&typeof f!="function"&&typeof f!="symbol"&&!isNaN(f)&&1<=f?a.setAttribute(u,f):a.removeAttribute(u);break;case"rowSpan":case"start":f==null||typeof f=="function"||typeof f=="symbol"||isNaN(f)?a.removeAttribute(u):a.setAttribute(u,f);break;case"popover":Dt("beforetoggle",a),Dt("toggle",a),Qa(a,"popover",f);break;case"xlinkActuate":tr(a,"http://www.w3.org/1999/xlink","xlink:actuate",f);break;case"xlinkArcrole":tr(a,"http://www.w3.org/1999/xlink","xlink:arcrole",f);break;case"xlinkRole":tr(a,"http://www.w3.org/1999/xlink","xlink:role",f);break;case"xlinkShow":tr(a,"http://www.w3.org/1999/xlink","xlink:show",f);break;case"xlinkTitle":tr(a,"http://www.w3.org/1999/xlink","xlink:title",f);break;case"xlinkType":tr(a,"http://www.w3.org/1999/xlink","xlink:type",f);break;case"xmlBase":tr(a,"http://www.w3.org/XML/1998/namespace","xml:base",f);break;case"xmlLang":tr(a,"http://www.w3.org/XML/1998/namespace","xml:lang",f);break;case"xmlSpace":tr(a,"http://www.w3.org/XML/1998/namespace","xml:space",f);break;case"is":Qa(a,"is",f);break;case"innerText":case"textContent":break;default:(!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(u=ma.get(u)||u,Qa(a,u,f))}}function Vm(a,i,u,f,b,x){switch(u){case"style":Ka(a,f,x);break;case"dangerouslySetInnerHTML":if(f!=null){if(typeof f!="object"||!("__html"in f))throw Error(r(61));if(u=f.__html,u!=null){if(b.children!=null)throw Error(r(60));a.innerHTML=u}}break;case"children":typeof f=="string"?Ra(a,f):(typeof f=="number"||typeof f=="bigint")&&Ra(a,""+f);break;case"onScroll":f!=null&&Dt("scroll",a);break;case"onScrollEnd":f!=null&&Dt("scrollend",a);break;case"onClick":f!=null&&(a.onclick=br);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Wa.hasOwnProperty(u))e:{if(u[0]==="o"&&u[1]==="n"&&(b=u.endsWith("Capture"),i=u.slice(2,b?u.length-7:void 0),x=a[vt]||null,x=x!=null?x[u]:null,typeof x=="function"&&a.removeEventListener(i,x,b),typeof f=="function")){typeof x!="function"&&x!==null&&(u in a?a[u]=null:a.hasAttribute(u)&&a.removeAttribute(u)),a.addEventListener(i,f,b);break e}u in a?a[u]=f:f===!0?a.setAttribute(u,""):Qa(a,u,f)}}}function er(a,i,u){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Dt("error",a),Dt("load",a);var f=!1,b=!1,x;for(x in u)if(u.hasOwnProperty(x)){var w=u[x];if(w!=null)switch(x){case"src":f=!0;break;case"srcSet":b=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,i));default:en(a,i,x,w,u,null)}}b&&en(a,i,"srcSet",u.srcSet,u,null),f&&en(a,i,"src",u.src,u,null);return;case"input":Dt("invalid",a);var R=x=w=b=null,q=null,ie=null;for(f in u)if(u.hasOwnProperty(f)){var be=u[f];if(be!=null)switch(f){case"name":b=be;break;case"type":w=be;break;case"checked":q=be;break;case"defaultChecked":ie=be;break;case"value":x=be;break;case"defaultValue":R=be;break;case"children":case"dangerouslySetInnerHTML":if(be!=null)throw Error(r(137,i));break;default:en(a,i,f,be,u,null)}}Rs(a,x,R,q,ie,w,b,!1);return;case"select":Dt("invalid",a),f=w=x=null;for(b in u)if(u.hasOwnProperty(b)&&(R=u[b],R!=null))switch(b){case"value":x=R;break;case"defaultValue":w=R;break;case"multiple":f=R;default:en(a,i,b,R,u,null)}i=x,u=w,a.multiple=!!f,i!=null?Na(a,!!f,i,!1):u!=null&&Na(a,!!f,u,!0);return;case"textarea":Dt("invalid",a),x=b=f=null;for(w in u)if(u.hasOwnProperty(w)&&(R=u[w],R!=null))switch(w){case"value":f=R;break;case"defaultValue":b=R;break;case"children":x=R;break;case"dangerouslySetInnerHTML":if(R!=null)throw Error(r(91));break;default:en(a,i,w,R,u,null)}_l(a,f,b,x);return;case"option":for(q in u)if(u.hasOwnProperty(q)&&(f=u[q],f!=null))switch(q){case"selected":a.selected=f&&typeof f!="function"&&typeof f!="symbol";break;default:en(a,i,q,f,u,null)}return;case"dialog":Dt("beforetoggle",a),Dt("toggle",a),Dt("cancel",a),Dt("close",a);break;case"iframe":case"object":Dt("load",a);break;case"video":case"audio":for(f=0;f<hu.length;f++)Dt(hu[f],a);break;case"image":Dt("error",a),Dt("load",a);break;case"details":Dt("toggle",a);break;case"embed":case"source":case"link":Dt("error",a),Dt("load",a);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ie in u)if(u.hasOwnProperty(ie)&&(f=u[ie],f!=null))switch(ie){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,i));default:en(a,i,ie,f,u,null)}return;default:if(Za(i)){for(be in u)u.hasOwnProperty(be)&&(f=u[be],f!==void 0&&Vm(a,i,be,f,u,void 0));return}}for(R in u)u.hasOwnProperty(R)&&(f=u[R],f!=null&&en(a,i,R,f,u,null))}function dA(a,i,u,f){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var b=null,x=null,w=null,R=null,q=null,ie=null,be=null;for(oe in u){var Te=u[oe];if(u.hasOwnProperty(oe)&&Te!=null)switch(oe){case"checked":break;case"value":break;case"defaultValue":q=Te;default:f.hasOwnProperty(oe)||en(a,i,oe,null,f,Te)}}for(var se in f){var oe=f[se];if(Te=u[se],f.hasOwnProperty(se)&&(oe!=null||Te!=null))switch(se){case"type":x=oe;break;case"name":b=oe;break;case"checked":ie=oe;break;case"defaultChecked":be=oe;break;case"value":w=oe;break;case"defaultValue":R=oe;break;case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(r(137,i));break;default:oe!==Te&&en(a,i,se,oe,f,Te)}}Ln(a,w,R,q,ie,be,x,b);return;case"select":oe=w=R=se=null;for(x in u)if(q=u[x],u.hasOwnProperty(x)&&q!=null)switch(x){case"value":break;case"multiple":oe=q;default:f.hasOwnProperty(x)||en(a,i,x,null,f,q)}for(b in f)if(x=f[b],q=u[b],f.hasOwnProperty(b)&&(x!=null||q!=null))switch(b){case"value":se=x;break;case"defaultValue":R=x;break;case"multiple":w=x;default:x!==q&&en(a,i,b,x,f,q)}i=R,u=w,f=oe,se!=null?Na(a,!!u,se,!1):!!f!=!!u&&(i!=null?Na(a,!!u,i,!0):Na(a,!!u,u?[]:"",!1));return;case"textarea":oe=se=null;for(R in u)if(b=u[R],u.hasOwnProperty(R)&&b!=null&&!f.hasOwnProperty(R))switch(R){case"value":break;case"children":break;default:en(a,i,R,null,f,b)}for(w in f)if(b=f[w],x=u[w],f.hasOwnProperty(w)&&(b!=null||x!=null))switch(w){case"value":se=b;break;case"defaultValue":oe=b;break;case"children":break;case"dangerouslySetInnerHTML":if(b!=null)throw Error(r(91));break;default:b!==x&&en(a,i,w,b,f,x)}El(a,se,oe);return;case"option":for(var Ve in u)if(se=u[Ve],u.hasOwnProperty(Ve)&&se!=null&&!f.hasOwnProperty(Ve))switch(Ve){case"selected":a.selected=!1;break;default:en(a,i,Ve,null,f,se)}for(q in f)if(se=f[q],oe=u[q],f.hasOwnProperty(q)&&se!==oe&&(se!=null||oe!=null))switch(q){case"selected":a.selected=se&&typeof se!="function"&&typeof se!="symbol";break;default:en(a,i,q,se,f,oe)}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 ct in u)se=u[ct],u.hasOwnProperty(ct)&&se!=null&&!f.hasOwnProperty(ct)&&en(a,i,ct,null,f,se);for(ie in f)if(se=f[ie],oe=u[ie],f.hasOwnProperty(ie)&&se!==oe&&(se!=null||oe!=null))switch(ie){case"children":case"dangerouslySetInnerHTML":if(se!=null)throw Error(r(137,i));break;default:en(a,i,ie,se,f,oe)}return;default:if(Za(i)){for(var tn in u)se=u[tn],u.hasOwnProperty(tn)&&se!==void 0&&!f.hasOwnProperty(tn)&&Vm(a,i,tn,void 0,f,se);for(be in f)se=f[be],oe=u[be],!f.hasOwnProperty(be)||se===oe||se===void 0&&oe===void 0||Vm(a,i,be,se,f,oe);return}}for(var Z in u)se=u[Z],u.hasOwnProperty(Z)&&se!=null&&!f.hasOwnProperty(Z)&&en(a,i,Z,null,f,se);for(Te in f)se=f[Te],oe=u[Te],!f.hasOwnProperty(Te)||se===oe||se==null&&oe==null||en(a,i,Te,se,f,oe)}function Ay(a){switch(a){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function fA(){if(typeof performance.getEntriesByType=="function"){for(var a=0,i=0,u=performance.getEntriesByType("resource"),f=0;f<u.length;f++){var b=u[f],x=b.transferSize,w=b.initiatorType,R=b.duration;if(x&&R&&Ay(w)){for(w=0,R=b.responseEnd,f+=1;f<u.length;f++){var q=u[f],ie=q.startTime;if(ie>R)break;var be=q.transferSize,Te=q.initiatorType;be&&Ay(Te)&&(q=q.responseEnd,w+=be*(q<R?1:(R-ie)/(q-ie)))}if(--f,i+=8*(x+w)/(b.duration/1e3),a++,10<a)break}}if(0<a)return i/a/1e6}return navigator.connection&&(a=navigator.connection.downlink,typeof a=="number")?a:5}var Gm=null,qm=null;function pd(a){return a.nodeType===9?a:a.ownerDocument}function Ny(a){switch(a){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Ry(a,i){if(a===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return a===1&&i==="foreignObject"?0:a}function Ym(a,i){return a==="textarea"||a==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.children=="bigint"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var Wm=null;function hA(){var a=window.event;return a&&a.type==="popstate"?a===Wm?!1:(Wm=a,!0):(Wm=null,!1)}var Ly=typeof setTimeout=="function"?setTimeout:void 0,mA=typeof clearTimeout=="function"?clearTimeout:void 0,Iy=typeof Promise=="function"?Promise:void 0,pA=typeof queueMicrotask=="function"?queueMicrotask:typeof Iy<"u"?function(a){return Iy.resolve(null).then(a).catch(gA)}:Ly;function gA(a){setTimeout(function(){throw a})}function rs(a){return a==="head"}function Oy(a,i){var u=i,f=0;do{var b=u.nextSibling;if(a.removeChild(u),b&&b.nodeType===8)if(u=b.data,u==="/$"||u==="/&"){if(f===0){a.removeChild(b),Zl(i);return}f--}else if(u==="$"||u==="$?"||u==="$~"||u==="$!"||u==="&")f++;else if(u==="html")pu(a.ownerDocument.documentElement);else if(u==="head"){u=a.ownerDocument.head,pu(u);for(var x=u.firstChild;x;){var w=x.nextSibling,R=x.nodeName;x[ua]||R==="SCRIPT"||R==="STYLE"||R==="LINK"&&x.rel.toLowerCase()==="stylesheet"||u.removeChild(x),x=w}}else u==="body"&&pu(a.ownerDocument.body);u=b}while(u);Zl(i)}function Dy(a,i){var u=a;a=0;do{var f=u.nextSibling;if(u.nodeType===1?i?(u._stashedDisplay=u.style.display,u.style.display="none"):(u.style.display=u._stashedDisplay||"",u.getAttribute("style")===""&&u.removeAttribute("style")):u.nodeType===3&&(i?(u._stashedText=u.nodeValue,u.nodeValue=""):u.nodeValue=u._stashedText||""),f&&f.nodeType===8)if(u=f.data,u==="/$"){if(a===0)break;a--}else u!=="$"&&u!=="$?"&&u!=="$~"&&u!=="$!"||a++;u=f}while(u)}function Qm(a){var i=a.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var u=i;switch(i=i.nextSibling,u.nodeName){case"HTML":case"HEAD":case"BODY":Qm(u),As(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}a.removeChild(u)}}function bA(a,i,u,f){for(;a.nodeType===1;){var b=u;if(a.nodeName.toLowerCase()!==i.toLowerCase()){if(!f&&(a.nodeName!=="INPUT"||a.type!=="hidden"))break}else if(f){if(!a[ua])switch(i){case"meta":if(!a.hasAttribute("itemprop"))break;return a;case"link":if(x=a.getAttribute("rel"),x==="stylesheet"&&a.hasAttribute("data-precedence"))break;if(x!==b.rel||a.getAttribute("href")!==(b.href==null||b.href===""?null:b.href)||a.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin)||a.getAttribute("title")!==(b.title==null?null:b.title))break;return a;case"style":if(a.hasAttribute("data-precedence"))break;return a;case"script":if(x=a.getAttribute("src"),(x!==(b.src==null?null:b.src)||a.getAttribute("type")!==(b.type==null?null:b.type)||a.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin))&&x&&a.hasAttribute("async")&&!a.hasAttribute("itemprop"))break;return a;default:return a}}else if(i==="input"&&a.type==="hidden"){var x=b.name==null?null:""+b.name;if(b.type==="hidden"&&a.getAttribute("name")===x)return a}else return a;if(a=Xr(a.nextSibling),a===null)break}return null}function xA(a,i,u){if(i==="")return null;for(;a.nodeType!==3;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!u||(a=Xr(a.nextSibling),a===null))return null;return a}function jy(a,i){for(;a.nodeType!==8;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!i||(a=Xr(a.nextSibling),a===null))return null;return a}function Xm(a){return a.data==="$?"||a.data==="$~"}function Km(a){return a.data==="$!"||a.data==="$?"&&a.ownerDocument.readyState!=="loading"}function yA(a,i){var u=a.ownerDocument;if(a.data==="$~")a._reactRetry=i;else if(a.data!=="$?"||u.readyState!=="loading")i();else{var f=function(){i(),u.removeEventListener("DOMContentLoaded",f)};u.addEventListener("DOMContentLoaded",f),a._reactRetry=f}}function Xr(a){for(;a!=null;a=a.nextSibling){var i=a.nodeType;if(i===1||i===3)break;if(i===8){if(i=a.data,i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"||i==="F!"||i==="F")break;if(i==="/$"||i==="/&")return null}}return a}var Zm=null;function My(a){a=a.nextSibling;for(var i=0;a;){if(a.nodeType===8){var u=a.data;if(u==="/$"||u==="/&"){if(i===0)return Xr(a.nextSibling);i--}else u!=="$"&&u!=="$!"&&u!=="$?"&&u!=="$~"&&u!=="&"||i++}a=a.nextSibling}return null}function Py(a){a=a.previousSibling;for(var i=0;a;){if(a.nodeType===8){var u=a.data;if(u==="$"||u==="$!"||u==="$?"||u==="$~"||u==="&"){if(i===0)return a;i--}else u!=="/$"&&u!=="/&"||i++}a=a.previousSibling}return null}function By(a,i,u){switch(i=pd(u),a){case"html":if(a=i.documentElement,!a)throw Error(r(452));return a;case"head":if(a=i.head,!a)throw Error(r(453));return a;case"body":if(a=i.body,!a)throw Error(r(454));return a;default:throw Error(r(451))}}function pu(a){for(var i=a.attributes;i.length;)a.removeAttributeNode(i[0]);As(a)}var Kr=new Map,Uy=new Set;function gd(a){return typeof a.getRootNode=="function"?a.getRootNode():a.nodeType===9?a:a.ownerDocument}var gi=ee.d;ee.d={f:EA,r:_A,D:TA,C:vA,L:wA,m:kA,X:SA,S:CA,M:AA};function EA(){var a=gi.f(),i=ld();return a||i}function _A(a){var i=da(a);i!==null&&i.tag===5&&i.type==="form"?nx(i):gi.r(a)}var Ql=typeof document>"u"?null:document;function Hy(a,i,u){var f=Ql;if(f&&typeof i=="string"&&i){var b=Rn(i);b='link[rel="'+a+'"][href="'+b+'"]',typeof u=="string"&&(b+='[crossorigin="'+u+'"]'),Uy.has(b)||(Uy.add(b),a={rel:a,crossOrigin:u,href:i},f.querySelector(b)===null&&(i=f.createElement("link"),er(i,"link",a),pn(i),f.head.appendChild(i)))}}function TA(a){gi.D(a),Hy("dns-prefetch",a,null)}function vA(a,i){gi.C(a,i),Hy("preconnect",a,i)}function wA(a,i,u){gi.L(a,i,u);var f=Ql;if(f&&a&&i){var b='link[rel="preload"][as="'+Rn(i)+'"]';i==="image"&&u&&u.imageSrcSet?(b+='[imagesrcset="'+Rn(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(b+='[imagesizes="'+Rn(u.imageSizes)+'"]')):b+='[href="'+Rn(a)+'"]';var x=b;switch(i){case"style":x=Xl(a);break;case"script":x=Kl(a)}Kr.has(x)||(a=g({rel:"preload",href:i==="image"&&u&&u.imageSrcSet?void 0:a,as:i},u),Kr.set(x,a),f.querySelector(b)!==null||i==="style"&&f.querySelector(gu(x))||i==="script"&&f.querySelector(bu(x))||(i=f.createElement("link"),er(i,"link",a),pn(i),f.head.appendChild(i)))}}function kA(a,i){gi.m(a,i);var u=Ql;if(u&&a){var f=i&&typeof i.as=="string"?i.as:"script",b='link[rel="modulepreload"][as="'+Rn(f)+'"][href="'+Rn(a)+'"]',x=b;switch(f){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":x=Kl(a)}if(!Kr.has(x)&&(a=g({rel:"modulepreload",href:a},i),Kr.set(x,a),u.querySelector(b)===null)){switch(f){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(bu(x)))return}f=u.createElement("link"),er(f,"link",a),pn(f),u.head.appendChild(f)}}}function CA(a,i,u){gi.S(a,i,u);var f=Ql;if(f&&a){var b=Fr(f).hoistableStyles,x=Xl(a);i=i||"default";var w=b.get(x);if(!w){var R={loading:0,preload:null};if(w=f.querySelector(gu(x)))R.loading=5;else{a=g({rel:"stylesheet",href:a,"data-precedence":i},u),(u=Kr.get(x))&&Jm(a,u);var q=w=f.createElement("link");pn(q),er(q,"link",a),q._p=new Promise(function(ie,be){q.onload=ie,q.onerror=be}),q.addEventListener("load",function(){R.loading|=1}),q.addEventListener("error",function(){R.loading|=2}),R.loading|=4,bd(w,i,f)}w={type:"stylesheet",instance:w,count:1,state:R},b.set(x,w)}}}function SA(a,i){gi.X(a,i);var u=Ql;if(u&&a){var f=Fr(u).hoistableScripts,b=Kl(a),x=f.get(b);x||(x=u.querySelector(bu(b)),x||(a=g({src:a,async:!0},i),(i=Kr.get(b))&&ep(a,i),x=u.createElement("script"),pn(x),er(x,"link",a),u.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},f.set(b,x))}}function AA(a,i){gi.M(a,i);var u=Ql;if(u&&a){var f=Fr(u).hoistableScripts,b=Kl(a),x=f.get(b);x||(x=u.querySelector(bu(b)),x||(a=g({src:a,async:!0,type:"module"},i),(i=Kr.get(b))&&ep(a,i),x=u.createElement("script"),pn(x),er(x,"link",a),u.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},f.set(b,x))}}function zy(a,i,u,f){var b=(b=we.current)?gd(b):null;if(!b)throw Error(r(446));switch(a){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(i=Xl(u.href),u=Fr(b).hoistableStyles,f=u.get(i),f||(f={type:"style",instance:null,count:0,state:null},u.set(i,f)),f):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){a=Xl(u.href);var x=Fr(b).hoistableStyles,w=x.get(a);if(w||(b=b.ownerDocument||b,w={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},x.set(a,w),(x=b.querySelector(gu(a)))&&!x._p&&(w.instance=x,w.state.loading=5),Kr.has(a)||(u={rel:"preload",as:"style",href:u.href,crossOrigin:u.crossOrigin,integrity:u.integrity,media:u.media,hrefLang:u.hrefLang,referrerPolicy:u.referrerPolicy},Kr.set(a,u),x||NA(b,a,u,w.state))),i&&f===null)throw Error(r(528,""));return w}if(i&&f!==null)throw Error(r(529,""));return null;case"script":return i=u.async,u=u.src,typeof u=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=Kl(u),u=Fr(b).hoistableScripts,f=u.get(i),f||(f={type:"script",instance:null,count:0,state:null},u.set(i,f)),f):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,a))}}function Xl(a){return'href="'+Rn(a)+'"'}function gu(a){return'link[rel="stylesheet"]['+a+"]"}function Fy(a){return g({},a,{"data-precedence":a.precedence,precedence:null})}function NA(a,i,u,f){a.querySelector('link[rel="preload"][as="style"]['+i+"]")?f.loading=1:(i=a.createElement("link"),f.preload=i,i.addEventListener("load",function(){return f.loading|=1}),i.addEventListener("error",function(){return f.loading|=2}),er(i,"link",u),pn(i),a.head.appendChild(i))}function Kl(a){return'[src="'+Rn(a)+'"]'}function bu(a){return"script[async]"+a}function $y(a,i,u){if(i.count++,i.instance===null)switch(i.type){case"style":var f=a.querySelector('style[data-href~="'+Rn(u.href)+'"]');if(f)return i.instance=f,pn(f),f;var b=g({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return f=(a.ownerDocument||a).createElement("style"),pn(f),er(f,"style",b),bd(f,u.precedence,a),i.instance=f;case"stylesheet":b=Xl(u.href);var x=a.querySelector(gu(b));if(x)return i.state.loading|=4,i.instance=x,pn(x),x;f=Fy(u),(b=Kr.get(b))&&Jm(f,b),x=(a.ownerDocument||a).createElement("link"),pn(x);var w=x;return w._p=new Promise(function(R,q){w.onload=R,w.onerror=q}),er(x,"link",f),i.state.loading|=4,bd(x,u.precedence,a),i.instance=x;case"script":return x=Kl(u.src),(b=a.querySelector(bu(x)))?(i.instance=b,pn(b),b):(f=u,(b=Kr.get(x))&&(f=g({},u),ep(f,b)),a=a.ownerDocument||a,b=a.createElement("script"),pn(b),er(b,"link",f),a.head.appendChild(b),i.instance=b);case"void":return null;default:throw Error(r(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(f=i.instance,i.state.loading|=4,bd(f,u.precedence,a));return i.instance}function bd(a,i,u){for(var f=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),b=f.length?f[f.length-1]:null,x=b,w=0;w<f.length;w++){var R=f[w];if(R.dataset.precedence===i)x=R;else if(x!==b)break}x?x.parentNode.insertBefore(a,x.nextSibling):(i=u.nodeType===9?u.head:u,i.insertBefore(a,i.firstChild))}function Jm(a,i){a.crossOrigin==null&&(a.crossOrigin=i.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=i.referrerPolicy),a.title==null&&(a.title=i.title)}function ep(a,i){a.crossOrigin==null&&(a.crossOrigin=i.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=i.referrerPolicy),a.integrity==null&&(a.integrity=i.integrity)}var xd=null;function Vy(a,i,u){if(xd===null){var f=new Map,b=xd=new Map;b.set(u,f)}else b=xd,f=b.get(u),f||(f=new Map,b.set(u,f));if(f.has(a))return f;for(f.set(a,null),u=u.getElementsByTagName(a),b=0;b<u.length;b++){var x=u[b];if(!(x[ua]||x[ft]||a==="link"&&x.getAttribute("rel")==="stylesheet")&&x.namespaceURI!=="http://www.w3.org/2000/svg"){var w=x.getAttribute(i)||"";w=a+w;var R=f.get(w);R?R.push(x):f.set(w,[x])}}return f}function Gy(a,i,u){a=a.ownerDocument||a,a.head.insertBefore(u,i==="title"?a.querySelector("head > title"):null)}function RA(a,i,u){if(u===1||i.itemProp!=null)return!1;switch(a){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;switch(i.rel){case"stylesheet":return a=i.disabled,typeof i.precedence=="string"&&a==null;default:return!0}case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function qy(a){return!(a.type==="stylesheet"&&(a.state.loading&3)===0)}function LA(a,i,u,f){if(u.type==="stylesheet"&&(typeof f.media!="string"||matchMedia(f.media).matches!==!1)&&(u.state.loading&4)===0){if(u.instance===null){var b=Xl(f.href),x=i.querySelector(gu(b));if(x){i=x._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(a.count++,a=yd.bind(a),i.then(a,a)),u.state.loading|=4,u.instance=x,pn(x);return}x=i.ownerDocument||i,f=Fy(f),(b=Kr.get(b))&&Jm(f,b),x=x.createElement("link"),pn(x);var w=x;w._p=new Promise(function(R,q){w.onload=R,w.onerror=q}),er(x,"link",f),u.instance=x}a.stylesheets===null&&(a.stylesheets=new Map),a.stylesheets.set(u,i),(i=u.state.preload)&&(u.state.loading&3)===0&&(a.count++,u=yd.bind(a),i.addEventListener("load",u),i.addEventListener("error",u))}}var tp=0;function IA(a,i){return a.stylesheets&&a.count===0&&_d(a,a.stylesheets),0<a.count||0<a.imgCount?function(u){var f=setTimeout(function(){if(a.stylesheets&&_d(a,a.stylesheets),a.unsuspend){var x=a.unsuspend;a.unsuspend=null,x()}},6e4+i);0<a.imgBytes&&tp===0&&(tp=62500*fA());var b=setTimeout(function(){if(a.waitingForImages=!1,a.count===0&&(a.stylesheets&&_d(a,a.stylesheets),a.unsuspend)){var x=a.unsuspend;a.unsuspend=null,x()}},(a.imgBytes>tp?50:800)+i);return a.unsuspend=u,function(){a.unsuspend=null,clearTimeout(f),clearTimeout(b)}}:null}function yd(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)_d(this,this.stylesheets);else if(this.unsuspend){var a=this.unsuspend;this.unsuspend=null,a()}}}var Ed=null;function _d(a,i){a.stylesheets=null,a.unsuspend!==null&&(a.count++,Ed=new Map,i.forEach(OA,a),Ed=null,yd.call(a))}function OA(a,i){if(!(i.state.loading&4)){var u=Ed.get(a);if(u)var f=u.get(null);else{u=new Map,Ed.set(a,u);for(var b=a.querySelectorAll("link[data-precedence],style[data-precedence]"),x=0;x<b.length;x++){var w=b[x];(w.nodeName==="LINK"||w.getAttribute("media")!=="not all")&&(u.set(w.dataset.precedence,w),f=w)}f&&u.set(null,f)}b=i.instance,w=b.getAttribute("data-precedence"),x=u.get(w)||f,x===f&&u.set(null,b),u.set(w,b),this.count++,f=yd.bind(this),b.addEventListener("load",f),b.addEventListener("error",f),x?x.parentNode.insertBefore(b,x.nextSibling):(a=a.nodeType===9?a.head:a,a.insertBefore(b,a.firstChild)),i.state.loading|=4}}var xu={$$typeof:N,Provider:null,Consumer:null,_currentValue:ke,_currentValue2:ke,_threadCount:0};function DA(a,i,u,f,b,x,w,R,q){this.tag=1,this.containerInfo=a,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=or(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=or(0),this.hiddenUpdates=or(null),this.identifierPrefix=f,this.onUncaughtError=b,this.onCaughtError=x,this.onRecoverableError=w,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=q,this.incompleteTransitions=new Map}function Yy(a,i,u,f,b,x,w,R,q,ie,be,Te){return a=new DA(a,i,u,w,q,ie,be,Te,R),i=1,x===!0&&(i|=24),x=Nr(3,null,null,i),a.current=x,x.stateNode=a,i=Dh(),i.refCount++,a.pooledCache=i,i.refCount++,x.memoizedState={element:f,isDehydrated:u,cache:i},Bh(x),a}function Wy(a){return a?(a=Al,a):Al}function Qy(a,i,u,f,b,x){b=Wy(b),f.context===null?f.context=b:f.pendingContext=b,f=qi(i),f.payload={element:u},x=x===void 0?null:x,x!==null&&(f.callback=x),u=Yi(a,f,i),u!==null&&(Tr(u,a,i),Xo(u,a,i))}function Xy(a,i){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var u=a.retryLane;a.retryLane=u!==0&&u<i?u:i}}function np(a,i){Xy(a,i),(a=a.alternate)&&Xy(a,i)}function Ky(a){if(a.tag===13||a.tag===31){var i=Ds(a,67108864);i!==null&&Tr(i,a,67108864),np(a,67108864)}}function Zy(a){if(a.tag===13||a.tag===31){var i=Dr();i=Ya(i);var u=Ds(a,i);u!==null&&Tr(u,a,i),np(a,i)}}var Td=!0;function jA(a,i,u,f){var b=z.T;z.T=null;var x=ee.p;try{ee.p=2,rp(a,i,u,f)}finally{ee.p=x,z.T=b}}function MA(a,i,u,f){var b=z.T;z.T=null;var x=ee.p;try{ee.p=8,rp(a,i,u,f)}finally{ee.p=x,z.T=b}}function rp(a,i,u,f){if(Td){var b=ap(f);if(b===null)$m(a,i,f,vd,u),eE(a,f);else if(BA(b,a,i,u,f))f.stopPropagation();else if(eE(a,f),i&4&&-1<PA.indexOf(a)){for(;b!==null;){var x=da(b);if(x!==null)switch(x.tag){case 3:if(x=x.stateNode,x.current.memoizedState.isDehydrated){var w=xt(x.pendingLanes);if(w!==0){var R=x;for(R.pendingLanes|=2,R.entangledLanes|=2;w;){var q=1<<31-$e(w);R.entanglements[1]|=q,w&=~q}Ma(x),(Wt&6)===0&&(id=qt()+500,fu(0))}}break;case 31:case 13:R=Ds(x,2),R!==null&&Tr(R,x,2),ld(),np(x,2)}if(x=ap(f),x===null&&$m(a,i,f,vd,u),x===b)break;b=x}b!==null&&f.stopPropagation()}else $m(a,i,f,null,u)}}function ap(a){return a=ei(a),ip(a)}var vd=null;function ip(a){if(vd=null,a=ca(a),a!==null){var i=l(a);if(i===null)a=null;else{var u=i.tag;if(u===13){if(a=o(i),a!==null)return a;a=null}else if(u===31){if(a=c(i),a!==null)return a;a=null}else if(u===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;a=null}else i!==a&&(a=null)}}return vd=a,null}function Jy(a){switch(a){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(Zt()){case me:return 2;case Ce:return 8;case Ze:case ot:return 32;case dt:return 268435456;default:return 32}default:return 32}}var sp=!1,as=null,is=null,ss=null,yu=new Map,Eu=new Map,ls=[],PA="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 eE(a,i){switch(a){case"focusin":case"focusout":as=null;break;case"dragenter":case"dragleave":is=null;break;case"mouseover":case"mouseout":ss=null;break;case"pointerover":case"pointerout":yu.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":Eu.delete(i.pointerId)}}function _u(a,i,u,f,b,x){return a===null||a.nativeEvent!==x?(a={blockedOn:i,domEventName:u,eventSystemFlags:f,nativeEvent:x,targetContainers:[b]},i!==null&&(i=da(i),i!==null&&Ky(i)),a):(a.eventSystemFlags|=f,i=a.targetContainers,b!==null&&i.indexOf(b)===-1&&i.push(b),a)}function BA(a,i,u,f,b){switch(i){case"focusin":return as=_u(as,a,i,u,f,b),!0;case"dragenter":return is=_u(is,a,i,u,f,b),!0;case"mouseover":return ss=_u(ss,a,i,u,f,b),!0;case"pointerover":var x=b.pointerId;return yu.set(x,_u(yu.get(x)||null,a,i,u,f,b)),!0;case"gotpointercapture":return x=b.pointerId,Eu.set(x,_u(Eu.get(x)||null,a,i,u,f,b)),!0}return!1}function tE(a){var i=ca(a.target);if(i!==null){var u=l(i);if(u!==null){if(i=u.tag,i===13){if(i=o(u),i!==null){a.blockedOn=i,oa(a.priority,function(){Zy(u)});return}}else if(i===31){if(i=c(u),i!==null){a.blockedOn=i,oa(a.priority,function(){Zy(u)});return}}else if(i===3&&u.stateNode.current.memoizedState.isDehydrated){a.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}a.blockedOn=null}function wd(a){if(a.blockedOn!==null)return!1;for(var i=a.targetContainers;0<i.length;){var u=ap(a.nativeEvent);if(u===null){u=a.nativeEvent;var f=new u.constructor(u.type,u);Ui=f,u.target.dispatchEvent(f),Ui=null}else return i=da(u),i!==null&&Ky(i),a.blockedOn=u,!1;i.shift()}return!0}function nE(a,i,u){wd(a)&&u.delete(i)}function UA(){sp=!1,as!==null&&wd(as)&&(as=null),is!==null&&wd(is)&&(is=null),ss!==null&&wd(ss)&&(ss=null),yu.forEach(nE),Eu.forEach(nE)}function kd(a,i){a.blockedOn===i&&(a.blockedOn=null,sp||(sp=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,UA)))}var Cd=null;function rE(a){Cd!==a&&(Cd=a,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Cd===a&&(Cd=null);for(var i=0;i<a.length;i+=3){var u=a[i],f=a[i+1],b=a[i+2];if(typeof f!="function"){if(ip(f||u)===null)continue;break}var x=da(u);x!==null&&(a.splice(i,3),i-=3,am(x,{pending:!0,data:b,method:u.method,action:f},f,b))}}))}function Zl(a){function i(q){return kd(q,a)}as!==null&&kd(as,a),is!==null&&kd(is,a),ss!==null&&kd(ss,a),yu.forEach(i),Eu.forEach(i);for(var u=0;u<ls.length;u++){var f=ls[u];f.blockedOn===a&&(f.blockedOn=null)}for(;0<ls.length&&(u=ls[0],u.blockedOn===null);)tE(u),u.blockedOn===null&&ls.shift();if(u=(a.ownerDocument||a).$$reactFormReplay,u!=null)for(f=0;f<u.length;f+=3){var b=u[f],x=u[f+1],w=b[vt]||null;if(typeof x=="function")w||rE(u);else if(w){var R=null;if(x&&x.hasAttribute("formAction")){if(b=x,w=x[vt]||null)R=w.formAction;else if(ip(b)!==null)continue}else R=w.action;typeof R=="function"?u[f+1]=R:(u.splice(f,3),f-=3),rE(u)}}}function aE(){function a(x){x.canIntercept&&x.info==="react-transition"&&x.intercept({handler:function(){return new Promise(function(w){return b=w})},focusReset:"manual",scroll:"manual"})}function i(){b!==null&&(b(),b=null),f||setTimeout(u,20)}function u(){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,b=null;return navigation.addEventListener("navigate",a),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(u,100),function(){f=!0,navigation.removeEventListener("navigate",a),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),b!==null&&(b(),b=null)}}}function lp(a){this._internalRoot=a}Sd.prototype.render=lp.prototype.render=function(a){var i=this._internalRoot;if(i===null)throw Error(r(409));var u=i.current,f=Dr();Qy(u,f,a,i,null,null)},Sd.prototype.unmount=lp.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var i=a.containerInfo;Qy(a.current,2,null,a,null,null),ld(),i[Xn]=null}};function Sd(a){this._internalRoot=a}Sd.prototype.unstable_scheduleHydration=function(a){if(a){var i=Sa();a={blockedOn:null,target:a,priority:i};for(var u=0;u<ls.length&&i!==0&&i<ls[u].priority;u++);ls.splice(u,0,a),u===0&&tE(a)}};var iE=t.version;if(iE!=="19.2.5")throw Error(r(527,iE,"19.2.5"));ee.findDOMNode=function(a){var i=a._reactInternals;if(i===void 0)throw typeof a.render=="function"?Error(r(188)):(a=Object.keys(a).join(","),Error(r(268,a)));return a=m(i),a=a!==null?p(a):null,a=a===null?null:a.stateNode,a};var HA={bundleType:0,version:"19.2.5",rendererPackageName:"react-dom",currentDispatcherRef:z,reconcilerVersion:"19.2.5"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ad=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ad.isDisabled&&Ad.supportsFiber)try{xe=Ad.inject(HA),Le=Ad}catch{}}return vu.createRoot=function(a,i){if(!s(a))throw Error(r(299));var u=!1,f="",b=fx,x=hx,w=mx;return i!=null&&(i.unstable_strictMode===!0&&(u=!0),i.identifierPrefix!==void 0&&(f=i.identifierPrefix),i.onUncaughtError!==void 0&&(b=i.onUncaughtError),i.onCaughtError!==void 0&&(x=i.onCaughtError),i.onRecoverableError!==void 0&&(w=i.onRecoverableError)),i=Yy(a,1,!1,null,null,u,f,null,b,x,w,aE),a[Xn]=i.current,Fm(a),new lp(i)},vu.hydrateRoot=function(a,i,u){if(!s(a))throw Error(r(299));var f=!1,b="",x=fx,w=hx,R=mx,q=null;return u!=null&&(u.unstable_strictMode===!0&&(f=!0),u.identifierPrefix!==void 0&&(b=u.identifierPrefix),u.onUncaughtError!==void 0&&(x=u.onUncaughtError),u.onCaughtError!==void 0&&(w=u.onCaughtError),u.onRecoverableError!==void 0&&(R=u.onRecoverableError),u.formState!==void 0&&(q=u.formState)),i=Yy(a,1,!0,i,u??null,f,b,q,x,w,R,aE),i.context=Wy(null),u=i.current,f=Dr(),f=Ya(f),b=qi(f),b.callback=null,Yi(u,b,f),u=f,i.current.lanes=u,dn(i,u),Ma(i),a[Xn]=i.current,Fm(a),new Sd(i)},vu.version="19.2.5",vu}var bE;function eN(){if(bE)return fp.exports;bE=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(),fp.exports=JA(),fp.exports}var tN=eN();const nN=Bf(tN);/**
|
|
51
|
+
* react-router v7.14.0
|
|
52
|
+
*
|
|
53
|
+
* Copyright (c) Remix Software Inc.
|
|
54
|
+
*
|
|
55
|
+
* This source code is licensed under the MIT license found in the
|
|
56
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
57
|
+
*
|
|
58
|
+
* @license MIT
|
|
59
|
+
*/var xE="popstate";function yE(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function rN(e={}){function t(r,s){var m;let l=(m=s.state)==null?void 0:m.masked,{pathname:o,search:c,hash:d}=l||r.location;return b0("",{pathname:o,search:c,hash:d},s.state&&s.state.usr||null,s.state&&s.state.key||"default",l?{pathname:r.location.pathname,search:r.location.search,hash:r.location.hash}:void 0)}function n(r,s){return typeof s=="string"?s:ec(s)}return iN(t,n,null,e)}function xn(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function ia(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function aN(){return Math.random().toString(36).substring(2,10)}function EE(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 b0(e,t,n=null,r,s){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?To(t):t,state:n,key:t&&t.key||r||aN(),unstable_mask:s}}function ec({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 To(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 iN(e,t,n,r={}){let{window:s=document.defaultView,v5Compat:l=!1}=r,o=s.history,c="POP",d=null,m=p();m==null&&(m=0,o.replaceState({...o.state,idx:m},""));function p(){return(o.state||{idx:null}).idx}function g(){c="POP";let C=p(),S=C==null?null:C-m;m=C,d&&d({action:c,location:k.location,delta:S})}function y(C,S){c="PUSH";let A=yE(C)?C:b0(k.location,C,S);m=p()+1;let N=EE(A,m),U=k.createHref(A.unstable_mask||A);try{o.pushState(N,"",U)}catch(G){if(G instanceof DOMException&&G.name==="DataCloneError")throw G;s.location.assign(U)}l&&d&&d({action:c,location:k.location,delta:1})}function E(C,S){c="REPLACE";let A=yE(C)?C:b0(k.location,C,S);m=p();let N=EE(A,m),U=k.createHref(A.unstable_mask||A);o.replaceState(N,"",U),l&&d&&d({action:c,location:k.location,delta:0})}function v(C){return sN(C)}let k={get action(){return c},get location(){return e(s,o)},listen(C){if(d)throw new Error("A history only accepts one active listener");return s.addEventListener(xE,g),d=C,()=>{s.removeEventListener(xE,g),d=null}},createHref(C){return t(s,C)},createURL:v,encodeLocation(C){let S=v(C);return{pathname:S.pathname,search:S.search,hash:S.hash}},push:y,replace:E,go(C){return o.go(C)}};return k}function sN(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),xn(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:ec(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function PT(e,t,n="/"){return lN(e,t,n,!1)}function lN(e,t,n,r){let s=typeof t=="string"?To(t):t,l=ki(s.pathname||"/",n);if(l==null)return null;let o=BT(e);oN(o);let c=null;for(let d=0;c==null&&d<o.length;++d){let m=yN(l);c=bN(o[d],m,r)}return c}function BT(e,t=[],n=[],r="",s=!1){let l=(o,c,d=s,m)=>{let p={relativePath:m===void 0?o.path||"":m,caseSensitive:o.caseSensitive===!0,childrenIndex:c,route:o};if(p.relativePath.startsWith("/")){if(!p.relativePath.startsWith(r)&&d)return;xn(p.relativePath.startsWith(r),`Absolute route path "${p.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),p.relativePath=p.relativePath.slice(r.length)}let g=Fa([r,p.relativePath]),y=n.concat(p);o.children&&o.children.length>0&&(xn(o.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${g}".`),BT(o.children,t,y,g,d)),!(o.path==null&&!o.index)&&t.push({path:g,score:pN(g,o.index),routesMeta:y})};return e.forEach((o,c)=>{var d;if(o.path===""||!((d=o.path)!=null&&d.includes("?")))l(o,c);else for(let m of UT(o.path))l(o,c,!0,m)}),t}function UT(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,s=n.endsWith("?"),l=n.replace(/\?$/,"");if(r.length===0)return s?[l,""]:[l];let o=UT(r.join("/")),c=[];return c.push(...o.map(d=>d===""?l:[l,d].join("/"))),s&&c.push(...o),c.map(d=>e.startsWith("/")&&d===""?"/":d)}function oN(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:gN(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var uN=/^:[\w-]+$/,cN=3,dN=2,fN=1,hN=10,mN=-2,_E=e=>e==="*";function pN(e,t){let n=e.split("/"),r=n.length;return n.some(_E)&&(r+=mN),t&&(r+=dN),n.filter(s=>!_E(s)).reduce((s,l)=>s+(uN.test(l)?cN:l===""?fN:hN),r)}function gN(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 bN(e,t,n=!1){let{routesMeta:r}=e,s={},l="/",o=[];for(let c=0;c<r.length;++c){let d=r[c],m=c===r.length-1,p=l==="/"?t:t.slice(l.length)||"/",g=ff({path:d.relativePath,caseSensitive:d.caseSensitive,end:m},p),y=d.route;if(!g&&m&&n&&!r[r.length-1].route.index&&(g=ff({path:d.relativePath,caseSensitive:d.caseSensitive,end:!1},p)),!g)return null;Object.assign(s,g.params),o.push({params:s,pathname:Fa([l,g.pathname]),pathnameBase:vN(Fa([l,g.pathnameBase])),route:y}),g.pathnameBase!=="/"&&(l=Fa([l,g.pathnameBase]))}return o}function ff(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=xN(e.path,e.caseSensitive,e.end),s=t.match(n);if(!s)return null;let l=s[0],o=l.replace(/(.)\/+$/,"$1"),c=s.slice(1);return{params:r.reduce((m,{paramName:p,isOptional:g},y)=>{if(p==="*"){let v=c[y]||"";o=l.slice(0,l.length-v.length).replace(/(.)\/+$/,"$1")}const E=c[y];return g&&!E?m[p]=void 0:m[p]=(E||"").replace(/%2F/g,"/"),m},{}),pathname:l,pathnameBase:o,pattern:e}}function xN(e,t=!1,n=!0){ia(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,(o,c,d,m,p)=>{if(r.push({paramName:c,isOptional:d!=null}),d){let g=p.charAt(m+o.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 yN(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return ia(!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 ki(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 EN=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function _N(e,t="/"){let{pathname:n,search:r="",hash:s=""}=typeof e=="string"?To(e):e,l;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?l=TE(n.substring(1),"/"):l=TE(n,t)):l=t,{pathname:l,search:wN(r),hash:kN(s)}}function TE(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 gp(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 TN(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function gg(e){let t=TN(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function Uf(e,t,n,r=!1){let s;typeof e=="string"?s=To(e):(s={...e},xn(!s.pathname||!s.pathname.includes("?"),gp("?","pathname","search",s)),xn(!s.pathname||!s.pathname.includes("#"),gp("#","pathname","hash",s)),xn(!s.search||!s.search.includes("#"),gp("#","search","hash",s)));let l=e===""||s.pathname==="",o=l?"/":s.pathname,c;if(o==null)c=n;else{let g=t.length-1;if(!r&&o.startsWith("..")){let y=o.split("/");for(;y[0]==="..";)y.shift(),g-=1;s.pathname=y.join("/")}c=g>=0?t[g]:"/"}let d=_N(s,c),m=o&&o!=="/"&&o.endsWith("/"),p=(l||o===".")&&n.endsWith("/");return!d.pathname.endsWith("/")&&(m||p)&&(d.pathname+="/"),d}var Fa=e=>e.join("/").replace(/\/\/+/g,"/"),vN=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),wN=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,kN=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,CN=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 SN(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function AN(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var HT=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function zT(e,t){let n=e;if(typeof n!="string"||!EN.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,s=!1;if(HT)try{let l=new URL(window.location.href),o=n.startsWith("//")?new URL(l.protocol+n):new URL(n),c=ki(o.pathname,t);o.origin===l.origin&&c!=null?n=c+o.search+o.hash:s=!0}catch{ia(!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 FT=["POST","PUT","PATCH","DELETE"];new Set(FT);var NN=["GET",...FT];new Set(NN);var vo=T.createContext(null);vo.displayName="DataRouter";var Hf=T.createContext(null);Hf.displayName="DataRouterState";var $T=T.createContext(!1);function RN(){return T.useContext($T)}var VT=T.createContext({isTransitioning:!1});VT.displayName="ViewTransition";var LN=T.createContext(new Map);LN.displayName="Fetchers";var IN=T.createContext(null);IN.displayName="Await";var Br=T.createContext(null);Br.displayName="Navigation";var dc=T.createContext(null);dc.displayName="Location";var la=T.createContext({outlet:null,matches:[],isDataRoute:!1});la.displayName="Route";var bg=T.createContext(null);bg.displayName="RouteError";var GT="REACT_ROUTER_ERROR",ON="REDIRECT",DN="ROUTE_ERROR_RESPONSE";function jN(e){if(e.startsWith(`${GT}:${ON}:{`))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 MN(e){if(e.startsWith(`${GT}:${DN}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new CN(t.status,t.statusText,t.data)}catch{}}function PN(e,{relative:t}={}){xn(wo(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=T.useContext(Br),{hash:s,pathname:l,search:o}=fc(e,{relative:t}),c=l;return n!=="/"&&(c=l==="/"?n:Fa([n,l])),r.createHref({pathname:c,search:o,hash:s})}function wo(){return T.useContext(dc)!=null}function Ur(){return xn(wo(),"useLocation() may be used only in the context of a <Router> component."),T.useContext(dc).location}var qT="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function YT(e){T.useContext(Br).static||T.useLayoutEffect(e)}function wa(){let{isDataRoute:e}=T.useContext(la);return e?JN():BN()}function BN(){xn(wo(),"useNavigate() may be used only in the context of a <Router> component.");let e=T.useContext(vo),{basename:t,navigator:n}=T.useContext(Br),{matches:r}=T.useContext(la),{pathname:s}=Ur(),l=JSON.stringify(gg(r)),o=T.useRef(!1);return YT(()=>{o.current=!0}),T.useCallback((d,m={})=>{if(ia(o.current,qT),!o.current)return;if(typeof d=="number"){n.go(d);return}let p=Uf(d,JSON.parse(l),s,m.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:Fa([t,p.pathname])),(m.replace?n.replace:n.push)(p,m.state,m)},[t,n,l,s,e])}var UN=T.createContext(null);function HN(e){let t=T.useContext(la).outlet;return T.useMemo(()=>t&&T.createElement(UN.Provider,{value:e},t),[t,e])}function zN(){let{matches:e}=T.useContext(la),t=e[e.length-1];return t?t.params:{}}function fc(e,{relative:t}={}){let{matches:n}=T.useContext(la),{pathname:r}=Ur(),s=JSON.stringify(gg(n));return T.useMemo(()=>Uf(e,JSON.parse(s),r,t==="path"),[e,s,r,t])}function FN(e,t){return WT(e,t)}function WT(e,t,n){var C;xn(wo(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:r}=T.useContext(Br),{matches:s}=T.useContext(la),l=s[s.length-1],o=l?l.params:{},c=l?l.pathname:"/",d=l?l.pathnameBase:"/",m=l&&l.route;{let S=m&&m.path||"";XT(c,!m||S.endsWith("*")||S.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (under <Route path="${S}">) 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.
|
|
60
|
+
|
|
61
|
+
Please change the parent <Route path="${S}"> to <Route path="${S==="/"?"*":`${S}/*`}">.`)}let p=Ur(),g;if(t){let S=typeof t=="string"?To(t):t;xn(d==="/"||((C=S.pathname)==null?void 0:C.startsWith(d)),`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 "${d}" but pathname "${S.pathname}" was given in the \`location\` prop.`),g=S}else g=p;let y=g.pathname||"/",E=y;if(d!=="/"){let S=d.replace(/^\//,"").split("/");E="/"+y.replace(/^\//,"").split("/").slice(S.length).join("/")}let v=PT(e,{pathname:E});ia(m||v!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),ia(v==null||v[v.length-1].route.element!==void 0||v[v.length-1].route.Component!==void 0||v[v.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 k=YN(v&&v.map(S=>Object.assign({},S,{params:Object.assign({},o,S.params),pathname:Fa([d,r.encodeLocation?r.encodeLocation(S.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?d:Fa([d,r.encodeLocation?r.encodeLocation(S.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:S.pathnameBase])})),s,n);return t&&k?T.createElement(dc.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...g},navigationType:"POP"}},k):k}function $N(){let e=ZN(),t=SN(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},l={padding:"2px 4px",backgroundColor:r},o=null;return console.error("Error handled by React Router default ErrorBoundary:",e),o=T.createElement(T.Fragment,null,T.createElement("p",null,"💿 Hey developer 👋"),T.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",T.createElement("code",{style:l},"ErrorBoundary")," or"," ",T.createElement("code",{style:l},"errorElement")," prop on your route.")),T.createElement(T.Fragment,null,T.createElement("h2",null,"Unexpected Application Error!"),T.createElement("h3",{style:{fontStyle:"italic"}},t),n?T.createElement("pre",{style:s},n):null,o)}var VN=T.createElement($N,null),QT=class extends T.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=MN(e.digest);n&&(e=n)}let t=e!==void 0?T.createElement(la.Provider,{value:this.props.routeContext},T.createElement(bg.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?T.createElement(GN,{error:e},t):t}};QT.contextType=$T;var bp=new WeakMap;function GN({children:e,error:t}){let{basename:n}=T.useContext(Br);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=jN(t.digest);if(r){let s=bp.get(t);if(s)throw s;let l=zT(r.location,n);if(HT&&!bp.get(t))if(l.isExternal||r.reloadDocument)window.location.href=l.absoluteURL||l.to;else{const o=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(l.to,{replace:r.replace}));throw bp.set(t,o),o}return T.createElement("meta",{httpEquiv:"refresh",content:`0;url=${l.absoluteURL||l.to}`})}}return e}function qN({routeContext:e,match:t,children:n}){let r=T.useContext(vo);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),T.createElement(la.Provider,{value:e},n)}function YN(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,l=r==null?void 0:r.errors;if(l!=null){let p=s.findIndex(g=>g.route.id&&(l==null?void 0:l[g.route.id])!==void 0);xn(p>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(l).join(",")}`),s=s.slice(0,Math.min(s.length,p+1))}let o=!1,c=-1;if(n&&r){o=r.renderFallback;for(let p=0;p<s.length;p++){let g=s[p];if((g.route.HydrateFallback||g.route.hydrateFallbackElement)&&(c=p),g.route.id){let{loaderData:y,errors:E}=r,v=g.route.loader&&!y.hasOwnProperty(g.route.id)&&(!E||E[g.route.id]===void 0);if(g.route.lazy||v){n.isStatic&&(o=!0),c>=0?s=s.slice(0,c+1):s=[s[0]];break}}}}let d=n==null?void 0:n.onError,m=r&&d?(p,g)=>{var y,E;d(p,{location:r.location,params:((E=(y=r.matches)==null?void 0:y[0])==null?void 0:E.params)??{},unstable_pattern:AN(r.matches),errorInfo:g})}:void 0;return s.reduceRight((p,g,y)=>{let E,v=!1,k=null,C=null;r&&(E=l&&g.route.id?l[g.route.id]:void 0,k=g.route.errorElement||VN,o&&(c<0&&y===0?(XT("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),v=!0,C=null):c===y&&(v=!0,C=g.route.hydrateFallbackElement||null)));let S=t.concat(s.slice(0,y+1)),A=()=>{let N;return E?N=k:v?N=C:g.route.Component?N=T.createElement(g.route.Component,null):g.route.element?N=g.route.element:N=p,T.createElement(qN,{match:g,routeContext:{outlet:p,matches:S,isDataRoute:r!=null},children:N})};return r&&(g.route.ErrorBoundary||g.route.errorElement||y===0)?T.createElement(QT,{location:r.location,revalidation:r.revalidation,component:k,error:E,children:A(),routeContext:{outlet:null,matches:S,isDataRoute:!0},onError:m}):A()},null)}function xg(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function WN(e){let t=T.useContext(vo);return xn(t,xg(e)),t}function QN(e){let t=T.useContext(Hf);return xn(t,xg(e)),t}function XN(e){let t=T.useContext(la);return xn(t,xg(e)),t}function yg(e){let t=XN(e),n=t.matches[t.matches.length-1];return xn(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function KN(){return yg("useRouteId")}function ZN(){var r;let e=T.useContext(bg),t=QN("useRouteError"),n=yg("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function JN(){let{router:e}=WN("useNavigate"),t=yg("useNavigate"),n=T.useRef(!1);return YT(()=>{n.current=!0}),T.useCallback(async(s,l={})=>{ia(n.current,qT),n.current&&(typeof s=="number"?await e.navigate(s):await e.navigate(s,{fromRouteId:t,...l}))},[e,t])}var vE={};function XT(e,t,n){!t&&!vE[e]&&(vE[e]=!0,ia(!1,n))}T.memo(e5);function e5({routes:e,future:t,state:n,isStatic:r,onError:s}){return WT(e,void 0,{state:n,isStatic:r,onError:s})}function t5({to:e,replace:t,state:n,relative:r}){xn(wo(),"<Navigate> may be used only in the context of a <Router> component.");let{static:s}=T.useContext(Br);ia(!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:l}=T.useContext(la),{pathname:o}=Ur(),c=wa(),d=Uf(e,gg(l),o,r==="path"),m=JSON.stringify(d);return T.useEffect(()=>{c(JSON.parse(m),{replace:t,state:n,relative:r})},[c,m,r,t,n]),null}function n5(e){return HN(e.context)}function Ei(e){xn(!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 r5({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:s,static:l=!1,unstable_useTransitions:o}){xn(!wo(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let c=e.replace(/^\/*/,"/"),d=T.useMemo(()=>({basename:c,navigator:s,static:l,unstable_useTransitions:o,future:{}}),[c,s,l,o]);typeof n=="string"&&(n=To(n));let{pathname:m="/",search:p="",hash:g="",state:y=null,key:E="default",unstable_mask:v}=n,k=T.useMemo(()=>{let C=ki(m,c);return C==null?null:{location:{pathname:C,search:p,hash:g,state:y,key:E,unstable_mask:v},navigationType:r}},[c,m,p,g,y,E,r,v]);return ia(k!=null,`<Router basename="${c}"> is not able to match the URL "${m}${p}${g}" because it does not start with the basename, so the <Router> won't render anything.`),k==null?null:T.createElement(Br.Provider,{value:d},T.createElement(dc.Provider,{children:t,value:k}))}function a5({children:e,location:t}){return FN(x0(e),t)}function x0(e,t=[]){let n=[];return T.Children.forEach(e,(r,s)=>{if(!T.isValidElement(r))return;let l=[...t,s];if(r.type===T.Fragment){n.push.apply(n,x0(r.props.children,l));return}xn(r.type===Ei,`[${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>`),xn(!r.props.index||!r.props.children,"An index route cannot have child routes.");let o={id:r.props.id||l.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&&(o.children=x0(r.props.children,l)),n.push(o)}),n}var tf="get",nf="application/x-www-form-urlencoded";function zf(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function i5(e){return zf(e)&&e.tagName.toLowerCase()==="button"}function s5(e){return zf(e)&&e.tagName.toLowerCase()==="form"}function l5(e){return zf(e)&&e.tagName.toLowerCase()==="input"}function o5(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function u5(e,t){return e.button===0&&(!t||t==="_self")&&!o5(e)}function y0(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(s=>[n,s]):[[n,r]])},[]))}function c5(e,t){let n=y0(e);return t&&t.forEach((r,s)=>{n.has(s)||t.getAll(s).forEach(l=>{n.append(s,l)})}),n}var Nd=null;function d5(){if(Nd===null)try{new FormData(document.createElement("form"),0),Nd=!1}catch{Nd=!0}return Nd}var f5=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function xp(e){return e!=null&&!f5.has(e)?(ia(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${nf}"`),null):e}function h5(e,t){let n,r,s,l,o;if(s5(e)){let c=e.getAttribute("action");r=c?ki(c,t):null,n=e.getAttribute("method")||tf,s=xp(e.getAttribute("enctype"))||nf,l=new FormData(e)}else if(i5(e)||l5(e)&&(e.type==="submit"||e.type==="image")){let c=e.form;if(c==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let d=e.getAttribute("formaction")||c.getAttribute("action");if(r=d?ki(d,t):null,n=e.getAttribute("formmethod")||c.getAttribute("method")||tf,s=xp(e.getAttribute("formenctype"))||xp(c.getAttribute("enctype"))||nf,l=new FormData(c,e),!d5()){let{name:m,type:p,value:g}=e;if(p==="image"){let y=m?`${m}.`:"";l.append(`${y}x`,"0"),l.append(`${y}y`,"0")}else m&&l.append(m,g)}}else{if(zf(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=tf,r=null,s=nf,o=e}return l&&s==="text/plain"&&(o=l,l=void 0),{action:r,method:n.toLowerCase(),encType:s,formData:l,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Eg(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function KT(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&&ki(s.pathname,t)==="/"?s.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:s.pathname=`${s.pathname.replace(/\/$/,"")}.${r}`,s}async function m5(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 p5(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 g5(e,t,n){let r=await Promise.all(e.map(async s=>{let l=t.routes[s.route.id];if(l){let o=await m5(l,n);return o.links?o.links():[]}return[]}));return E5(r.flat(1).filter(p5).filter(s=>s.rel==="stylesheet"||s.rel==="preload").map(s=>s.rel==="stylesheet"?{...s,rel:"prefetch",as:"style"}:{...s,rel:"prefetch"}))}function wE(e,t,n,r,s,l){let o=(d,m)=>n[m]?d.route.id!==n[m].route.id:!0,c=(d,m)=>{var p;return n[m].pathname!==d.pathname||((p=n[m].route.path)==null?void 0:p.endsWith("*"))&&n[m].params["*"]!==d.params["*"]};return l==="assets"?t.filter((d,m)=>o(d,m)||c(d,m)):l==="data"?t.filter((d,m)=>{var g;let p=r.routes[d.route.id];if(!p||!p.hasLoader)return!1;if(o(d,m)||c(d,m))return!0;if(d.route.shouldRevalidate){let y=d.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:d.params,defaultShouldRevalidate:!0});if(typeof y=="boolean")return y}return!0}):[]}function b5(e,t,{includeHydrateFallback:n}={}){return x5(e.map(r=>{let s=t.routes[r.route.id];if(!s)return[];let l=[s.module];return s.clientActionModule&&(l=l.concat(s.clientActionModule)),s.clientLoaderModule&&(l=l.concat(s.clientLoaderModule)),n&&s.hydrateFallbackModule&&(l=l.concat(s.hydrateFallbackModule)),s.imports&&(l=l.concat(s.imports)),l}).flat(1))}function x5(e){return[...new Set(e)]}function y5(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function E5(e,t){let n=new Set;return new Set(t),e.reduce((r,s)=>{let l=JSON.stringify(y5(s));return n.has(l)||(n.add(l),r.push({key:l,link:s})),r},[])}function _g(){let e=T.useContext(vo);return Eg(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function _5(){let e=T.useContext(Hf);return Eg(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Tg=T.createContext(void 0);Tg.displayName="FrameworkContext";function vg(){let e=T.useContext(Tg);return Eg(e,"You must render this element inside a <HydratedRouter> element"),e}function T5(e,t){let n=T.useContext(Tg),[r,s]=T.useState(!1),[l,o]=T.useState(!1),{onFocus:c,onBlur:d,onMouseEnter:m,onMouseLeave:p,onTouchStart:g}=t,y=T.useRef(null);T.useEffect(()=>{if(e==="render"&&o(!0),e==="viewport"){let k=S=>{S.forEach(A=>{o(A.isIntersecting)})},C=new IntersectionObserver(k,{threshold:.5});return y.current&&C.observe(y.current),()=>{C.disconnect()}}},[e]),T.useEffect(()=>{if(r){let k=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(k)}}},[r]);let E=()=>{s(!0)},v=()=>{s(!1),o(!1)};return n?e!=="intent"?[l,y,{}]:[l,y,{onFocus:wu(c,E),onBlur:wu(d,v),onMouseEnter:wu(m,E),onMouseLeave:wu(p,v),onTouchStart:wu(g,E)}]:[!1,y,{}]}function wu(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function v5({page:e,...t}){let n=RN(),{router:r}=_g(),s=T.useMemo(()=>PT(r.routes,e,r.basename),[r.routes,e,r.basename]);return s?n?T.createElement(k5,{page:e,matches:s,...t}):T.createElement(C5,{page:e,matches:s,...t}):null}function w5(e){let{manifest:t,routeModules:n}=vg(),[r,s]=T.useState([]);return T.useEffect(()=>{let l=!1;return g5(e,t,n).then(o=>{l||s(o)}),()=>{l=!0}},[e,t,n]),r}function k5({page:e,matches:t,...n}){let r=Ur(),{future:s}=vg(),{basename:l}=_g(),o=T.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let c=KT(e,l,s.unstable_trailingSlashAwareDataRequests,"rsc"),d=!1,m=[];for(let p of t)typeof p.route.shouldRevalidate=="function"?d=!0:m.push(p.route.id);return d&&m.length>0&&c.searchParams.set("_routes",m.join(",")),[c.pathname+c.search]},[l,s.unstable_trailingSlashAwareDataRequests,e,r,t]);return T.createElement(T.Fragment,null,o.map(c=>T.createElement("link",{key:c,rel:"prefetch",as:"fetch",href:c,...n})))}function C5({page:e,matches:t,...n}){let r=Ur(),{future:s,manifest:l,routeModules:o}=vg(),{basename:c}=_g(),{loaderData:d,matches:m}=_5(),p=T.useMemo(()=>wE(e,t,m,l,r,"data"),[e,t,m,l,r]),g=T.useMemo(()=>wE(e,t,m,l,r,"assets"),[e,t,m,l,r]),y=T.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let k=new Set,C=!1;if(t.forEach(A=>{var U;let N=l.routes[A.route.id];!N||!N.hasLoader||(!p.some(G=>G.route.id===A.route.id)&&A.route.id in d&&((U=o[A.route.id])!=null&&U.shouldRevalidate)||N.hasClientLoader?C=!0:k.add(A.route.id))}),k.size===0)return[];let S=KT(e,c,s.unstable_trailingSlashAwareDataRequests,"data");return C&&k.size>0&&S.searchParams.set("_routes",t.filter(A=>k.has(A.route.id)).map(A=>A.route.id).join(",")),[S.pathname+S.search]},[c,s.unstable_trailingSlashAwareDataRequests,d,r,l,p,t,e,o]),E=T.useMemo(()=>b5(g,l),[g,l]),v=w5(g);return T.createElement(T.Fragment,null,y.map(k=>T.createElement("link",{key:k,rel:"prefetch",as:"fetch",href:k,...n})),E.map(k=>T.createElement("link",{key:k,rel:"modulepreload",href:k,...n})),v.map(({key:k,link:C})=>T.createElement("link",{key:k,nonce:n.nonce,...C,crossOrigin:C.crossOrigin??n.crossOrigin})))}function S5(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var A5=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{A5&&(window.__reactRouterVersion="7.14.0")}catch{}function N5({basename:e,children:t,unstable_useTransitions:n,window:r}){let s=T.useRef();s.current==null&&(s.current=rN({window:r,v5Compat:!0}));let l=s.current,[o,c]=T.useState({action:l.action,location:l.location}),d=T.useCallback(m=>{n===!1?c(m):T.startTransition(()=>c(m))},[n]);return T.useLayoutEffect(()=>l.listen(d),[l,d]),T.createElement(r5,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:l,unstable_useTransitions:n})}var ZT=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ci=T.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:s,reloadDocument:l,replace:o,unstable_mask:c,state:d,target:m,to:p,preventScrollReset:g,viewTransition:y,unstable_defaultShouldRevalidate:E,...v},k){let{basename:C,navigator:S,unstable_useTransitions:A}=T.useContext(Br),N=typeof p=="string"&&ZT.test(p),U=zT(p,C);p=U.to;let G=PN(p,{relative:s}),P=Ur(),H=null;if(c){let ne=Uf(c,[],P.unstable_mask?P.unstable_mask.pathname:"/",!0);C!=="/"&&(ne.pathname=ne.pathname==="/"?C:Fa([C,ne.pathname])),H=S.createHref(ne)}let[Y,ue,M]=T5(r,v),K=O5(p,{replace:o,unstable_mask:c,state:d,target:m,preventScrollReset:g,relative:s,viewTransition:y,unstable_defaultShouldRevalidate:E,unstable_useTransitions:A});function F(ne){t&&t(ne),ne.defaultPrevented||K(ne)}let ge=!(U.isExternal||l),ce=T.createElement("a",{...v,...M,href:(ge?H:void 0)||U.absoluteURL||G,onClick:ge?F:t,ref:S5(k,ue),target:m,"data-discover":!N&&n==="render"?"true":void 0});return Y&&!N?T.createElement(T.Fragment,null,ce,T.createElement(v5,{page:G})):ce});Ci.displayName="Link";var R5=T.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:s=!1,style:l,to:o,viewTransition:c,children:d,...m},p){let g=fc(o,{relative:m.relative}),y=Ur(),E=T.useContext(Hf),{navigator:v,basename:k}=T.useContext(Br),C=E!=null&&B5(g)&&c===!0,S=v.encodeLocation?v.encodeLocation(g).pathname:g.pathname,A=y.pathname,N=E&&E.navigation&&E.navigation.location?E.navigation.location.pathname:null;n||(A=A.toLowerCase(),N=N?N.toLowerCase():null,S=S.toLowerCase()),N&&k&&(N=ki(N,k)||N);const U=S!=="/"&&S.endsWith("/")?S.length-1:S.length;let G=A===S||!s&&A.startsWith(S)&&A.charAt(U)==="/",P=N!=null&&(N===S||!s&&N.startsWith(S)&&N.charAt(S.length)==="/"),H={isActive:G,isPending:P,isTransitioning:C},Y=G?t:void 0,ue;typeof r=="function"?ue=r(H):ue=[r,G?"active":null,P?"pending":null,C?"transitioning":null].filter(Boolean).join(" ");let M=typeof l=="function"?l(H):l;return T.createElement(Ci,{...m,"aria-current":Y,className:ue,ref:p,style:M,to:o,viewTransition:c},typeof d=="function"?d(H):d)});R5.displayName="NavLink";var L5=T.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:s,state:l,method:o=tf,action:c,onSubmit:d,relative:m,preventScrollReset:p,viewTransition:g,unstable_defaultShouldRevalidate:y,...E},v)=>{let{unstable_useTransitions:k}=T.useContext(Br),C=M5(),S=P5(c,{relative:m}),A=o.toLowerCase()==="get"?"get":"post",N=typeof c=="string"&&ZT.test(c),U=G=>{if(d&&d(G),G.defaultPrevented)return;G.preventDefault();let P=G.nativeEvent.submitter,H=(P==null?void 0:P.getAttribute("formmethod"))||o,Y=()=>C(P||G.currentTarget,{fetcherKey:t,method:H,navigate:n,replace:s,state:l,relative:m,preventScrollReset:p,viewTransition:g,unstable_defaultShouldRevalidate:y});k&&n!==!1?T.startTransition(()=>Y()):Y()};return T.createElement("form",{ref:v,method:A,action:S,onSubmit:r?d:U,...E,"data-discover":!N&&e==="render"?"true":void 0})});L5.displayName="Form";function I5(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function JT(e){let t=T.useContext(vo);return xn(t,I5(e)),t}function O5(e,{target:t,replace:n,unstable_mask:r,state:s,preventScrollReset:l,relative:o,viewTransition:c,unstable_defaultShouldRevalidate:d,unstable_useTransitions:m}={}){let p=wa(),g=Ur(),y=fc(e,{relative:o});return T.useCallback(E=>{if(u5(E,t)){E.preventDefault();let v=n!==void 0?n:ec(g)===ec(y),k=()=>p(e,{replace:v,unstable_mask:r,state:s,preventScrollReset:l,relative:o,viewTransition:c,unstable_defaultShouldRevalidate:d});m?T.startTransition(()=>k()):k()}},[g,p,y,n,r,s,t,e,l,o,c,d,m])}function ev(e){ia(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=T.useRef(y0(e)),n=T.useRef(!1),r=Ur(),s=T.useMemo(()=>c5(r.search,n.current?null:t.current),[r.search]),l=wa(),o=T.useCallback((c,d)=>{const m=y0(typeof c=="function"?c(new URLSearchParams(s)):c);n.current=!0,l("?"+m,d)},[l,s]);return[s,o]}var D5=0,j5=()=>`__${String(++D5)}__`;function M5(){let{router:e}=JT("useSubmit"),{basename:t}=T.useContext(Br),n=KN(),r=e.fetch,s=e.navigate;return T.useCallback(async(l,o={})=>{let{action:c,method:d,encType:m,formData:p,body:g}=h5(l,t);if(o.navigate===!1){let y=o.fetcherKey||j5();await r(y,n,o.action||c,{unstable_defaultShouldRevalidate:o.unstable_defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,formData:p,body:g,formMethod:o.method||d,formEncType:o.encType||m,flushSync:o.flushSync})}else await s(o.action||c,{unstable_defaultShouldRevalidate:o.unstable_defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,formData:p,body:g,formMethod:o.method||d,formEncType:o.encType||m,replace:o.replace,state:o.state,fromRouteId:n,flushSync:o.flushSync,viewTransition:o.viewTransition})},[r,s,t,n])}function P5(e,{relative:t}={}){let{basename:n}=T.useContext(Br),r=T.useContext(la);xn(r,"useFormAction must be used inside a RouteContext");let[s]=r.matches.slice(-1),l={...fc(e||".",{relative:t})},o=Ur();if(e==null){l.search=o.search;let c=new URLSearchParams(l.search),d=c.getAll("index");if(d.some(p=>p==="")){c.delete("index"),d.filter(g=>g).forEach(g=>c.append("index",g));let p=c.toString();l.search=p?`?${p}`:""}}return(!e||e===".")&&s.route.index&&(l.search=l.search?l.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(l.pathname=l.pathname==="/"?n:Fa([n,l.pathname])),ec(l)}function B5(e,{relative:t}={}){let n=T.useContext(VT);xn(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=JT("useViewTransitionState"),s=fc(e,{relative:t});if(!n.isTransitioning)return!1;let l=ki(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=ki(n.nextLocation.pathname,r)||n.nextLocation.pathname;return ff(s.pathname,o)!=null||ff(s.pathname,l)!=null}var ko=MT();const tv=T.createContext(null);function hc(){return T.useContext(tv)}class sn extends Error{constructor(t,n){super(n.message),this.statusCode=t,this.payload=n}}async function gt(e,t){const n=new Headers(t==null?void 0:t.headers);(t==null?void 0:t.body)!==void 0&&!(t.body instanceof FormData)&&!n.has("Content-Type")&&n.set("Content-Type","application/json");const r=await fetch(e,{headers:n,...t});if(!r.ok){const s=await r.json();throw new sn(r.status,s)}return await r.json()}function U5(e){const t=String(e);return t.includes("/exports/pdf")?t.includes("format=html")?"remote-codex-transcript.html":"remote-codex-transcript.pdf":"download"}function H5(e){var s;if(!e)return null;const t=e.match(/filename\*=UTF-8''([^;]+)/i);if(t!=null&&t[1])try{return decodeURIComponent(t[1].trim())}catch{return t[1].trim()}const n=e.match(/filename="([^"]+)"/i);if(n!=null&&n[1])return n[1].trim();const r=e.match(/filename=([^;]+)/i);return((s=r==null?void 0:r[1])==null?void 0:s.trim())??null}async function z5(e,t){const n=await fetch(e,t);if(!n.ok){let s=null;try{s=await n.json()}catch{s=null}throw new sn(n.status,s??{code:"internal_error",message:"Unable to download file."})}const r=H5(n.headers.get("content-disposition"))??U5(e);return{blob:await n.blob(),filename:r}}function kE(e,t){const n=e.originalName.trim();if(n)return n;const r=e.file.name.trim();return r||(e.kind==="photo"?`photo-${t+1}.jpg`:`file-${t+1}`)}function F5(){return gt("/api/config/runtime")}function $5(){return gt("/api/config/workspace-settings",{cache:"no-store"})}function V5(e){return gt("/api/config/workspace-settings",{method:"PATCH",body:JSON.stringify(e)})}function E0(e){return gt(`/api/config/codex-files/${encodeURIComponent(e)}`,{cache:"no-store"})}function _0(e,t){return gt(`/api/config/codex-files/${encodeURIComponent(e)}`,{method:"PATCH",body:JSON.stringify(t)})}function G5(){return gt("/api/config/codex-archives",{cache:"no-store"})}function q5(e={}){return gt("/api/config/codex-archives",{method:"POST",body:JSON.stringify(e)})}function Y5(e,t){return gt(`/api/config/codex-archives/${encodeURIComponent(e)}`,{method:"PATCH",body:JSON.stringify(t)})}function W5(e){return gt(`/api/config/codex-archives/${encodeURIComponent(e)}/apply`,{method:"POST"})}function nv(){return gt("/api/codex/status")}function Q5(){return gt("/api/codex/restart",{method:"POST"})}function X5(){return gt("/api/codex/build-restart",{method:"POST"})}function rv(){return gt("/api/codex/models")}function K5(){return gt("/healthz",{cache:"no-store"})}function wg(){return gt("/api/workspaces")}function av(){return gt("/api/threads")}function CE(e,t={}){const n=new URLSearchParams;return t.limit!==void 0&&n.set("limit",String(t.limit)),t.beforeTurnId&&n.set("beforeTurnId",t.beforeTurnId),gt(`/api/threads/${e}${n.size>0?`?${n.toString()}`:""}`)}function Z5(e,t){return gt(`/api/threads/${e}/items/${encodeURIComponent(t)}/detail`)}function J5(e){return gt(`/api/threads/${e}/export-turns`,{cache:"no-store"})}function e6(e,t){var r,s,l;const n=new URLSearchParams;return t.format!==void 0&&n.set("format",t.format),n.set("mode",t.mode),t.limit!==void 0&&n.set("limit",String(t.limit)),t.turnIds!==void 0&&n.set("turnIds",t.turnIds.join(",")),t.profile!==void 0&&n.set("profile",t.profile),((r=t.options)==null?void 0:r.includeTokenAndPrice)!==void 0&&n.set("includeTokenAndPrice",String(t.options.includeTokenAndPrice)),((s=t.options)==null?void 0:s.includeCommandOutput)!==void 0&&n.set("includeCommandOutput",String(t.options.includeCommandOutput)),((l=t.options)==null?void 0:l.includeAbsolutePaths)!==void 0&&n.set("includeAbsolutePaths",String(t.options.includeAbsolutePaths)),`/api/threads/${encodeURIComponent(e)}/exports/pdf?${n.toString()}`}function t6(e,t){return z5(e6(e,t),{cache:"no-store"})}function n6(e){return gt(`/api/threads/${e}/shell`)}function r6(e){return gt("/api/threads/start",{method:"POST",body:JSON.stringify(e)})}function a6(e){return gt("/api/threads/import",{method:"POST",body:JSON.stringify({sessionId:e})})}function i6(e,t={}){return gt(`/api/threads/${e}/shell`,{method:"POST",...Object.keys(t).length>0?{body:JSON.stringify(t)}:{}})}function s6(e){return gt(`/api/shells/${e}/terminate`,{method:"POST"})}function SE(e,t={}){return gt(`/api/threads/${e}/resume`,{method:"POST",...Object.keys(t).length>0?{body:JSON.stringify(t)}:{}})}function l6(e){return gt(`/api/threads/${e}/disconnect`,{method:"POST"})}function o6(e,t){const n=t.attachments??[];if(n.length===0)return gt(`/api/threads/${e}/prompt`,{method:"POST",body:JSON.stringify(t)});const r=new FormData;r.append("prompt",t.prompt),t.clientRequestId!==void 0&&r.append("clientRequestId",t.clientRequestId),t.model!==void 0&&r.append("model",t.model),t.reasoningEffort!==void 0&&t.reasoningEffort!==null&&r.append("reasoningEffort",t.reasoningEffort),t.collaborationMode!==void 0&&r.append("collaborationMode",t.collaborationMode),t.sandboxMode!==void 0&&t.sandboxMode!==null&&r.append("sandboxMode",t.sandboxMode);const s=n.map((l,o)=>({clientId:l.clientId,kind:l.kind,originalName:kE(l,o),placeholder:l.placeholder}));r.append("attachmentManifest",JSON.stringify(s));for(const[l,o]of n.entries())r.append("attachments",o.file,kE(o,l));return gt(`/api/threads/${e}/prompt`,{method:"POST",body:r})}function AE(e,t={}){return gt(`/api/threads/${e}/interrupt`,{method:"POST",body:JSON.stringify(t)})}function iv(e,t){return gt(`/api/threads/${e}`,{method:"PATCH",body:JSON.stringify(t)})}function u6(e){return gt(`/api/threads/${e}`,{method:"DELETE"})}function c6(e,t){return gt(`/api/threads/${e}/settings`,{method:"PATCH",body:JSON.stringify(t)})}function d6(e){return gt(`/api/threads/${e}/compact`,{method:"POST"})}function f6(e){return gt(`/api/threads/${e}/goal`,{cache:"no-store"})}function h6(e,t){return gt(`/api/threads/${e}/goal`,{method:"PATCH",body:JSON.stringify(t)})}function m6(e){return gt(`/api/threads/${e}/goal`,{method:"DELETE"})}function p6(e){return gt(`/api/threads/${e}/fork-turns`,{cache:"no-store"})}function NE(e,t){return gt(`/api/threads/${e}/fork`,{method:"POST",body:JSON.stringify(t)})}function g6(e){return gt(`/api/threads/${e}/skills`,{cache:"no-store"})}function b6(e){return gt(`/api/threads/${e}/mcp-servers`,{cache:"no-store"})}function x6(e,t,n){return gt(`/api/threads/${e}/requests/${encodeURIComponent(t)}/respond`,{method:"POST",body:JSON.stringify(n)})}function y6(e){return gt("/api/workspaces",{method:"POST",body:JSON.stringify(e)})}function E6(e,t){return gt(`/api/workspaces/${e}`,{method:"PATCH",body:JSON.stringify(t)})}function _6(e){return gt(`/api/workspaces/${e}`,{method:"DELETE"})}function T6(e,t){return gt(`/api/workspaces/${e}/favorite`,{method:"POST",body:JSON.stringify(t)})}function sv(e){const t=window.location.protocol==="https:"?"wss:":"ws:",n=window.location.host,r=new WebSocket(`${t}//${n}/ws`);return r.addEventListener("message",s=>{try{const l=JSON.parse(s.data);"threadId"in l&&l.type.startsWith("thread.")&&e(l)}catch{}}),r}function v6(e={}){const t=window.location.protocol==="https:"?"wss:":"ws:",n=window.location.host,r=new WebSocket(`${t}//${n}/ws`);return r.addEventListener("message",s=>{var l,o;try{const c=JSON.parse(s.data);if(c.type==="supervisor.connected"){(l=e.onConnected)==null||l.call(e,c);return}"shellId"in c&&c.type.startsWith("shell.")&&((o=e.onShellEvent)==null||o.call(e,c))}catch{}}),{socket:r,send(s){r.send(JSON.stringify(s))}}}function w6(){return h.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-4 w-4 fill-current",children:h.jsx("path",{d:"M2 3.25h12v1.5H2Zm0 4h12v1.5H2Zm0 4h12v1.5H2Z"})})}function T0(){return h.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-4 w-4 fill-current",children:h.jsx("path",{d:"M3.22 2.47 8 7.25l4.78-4.78 1.06 1.06L9.06 8.31l4.78 4.78-1.06 1.06L8 9.37l-4.78 4.78-1.06-1.06 4.78-4.78-4.78-4.78 1.06-1.06Z"})})}function RE(e=!1){return`flex w-full items-center rounded-[0.95rem] px-3 py-2 text-left text-sm transition ${e?"cursor-not-allowed bg-[var(--theme-muted)] text-[var(--theme-fg-muted)]":"text-[var(--theme-fg)] hover:bg-[var(--theme-hover)]"}`}const k6=[{value:"light",label:"Light",description:"Always use the bright theme."},{value:"dark",label:"Dark",description:"Always use the dark theme."},{value:"system",label:"System",description:"Follow the operating system appearance."}],C6=["config.toml","auth.json"];function S6(e){const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function kg({className:e=""}){const t=hc();return t?h.jsx("button",{type:"button","aria-label":t.navOpen?"Close Navigation":"Open Navigation","aria-expanded":t.navOpen,"aria-controls":"app-shell-navigation-menu",onClick:t.toggleNav,className:`inline-flex h-10 w-10 shrink-0 items-center justify-center text-[var(--theme-fg)] transition hover:text-[var(--theme-fg-soft)] ${e}`.trim(),children:t.navOpen?h.jsx(T0,{}):h.jsx(w6,{})}):null}function Cg({className:e=""}){const t=hc(),n=Ur(),r=wa(),s=T.useRef(null),l=n.pathname==="/workspaces";return T.useEffect(()=>{if(!(t!=null&&t.navOpen))return;const o=t;function c(d){const m=d.target;if(!m)return;const p=s.current;p!=null&&p.contains(m)||m instanceof Element&&m.closest('[aria-controls="app-shell-navigation-menu"]')||o.closeNav()}return document.addEventListener("pointerdown",c),()=>{document.removeEventListener("pointerdown",c)}},[t]),t!=null&&t.navOpen?h.jsxs("div",{ref:s,id:"app-shell-navigation-menu",onPointerDown:o=>{o.stopPropagation()},onMouseDown:o=>{o.stopPropagation()},onTouchStart:o=>{o.stopPropagation()},className:`rounded-[1.8rem] border border-[var(--theme-border)] bg-[var(--theme-panel)] p-4 shadow-2xl shadow-black/15 backdrop-blur ${e}`.trim(),children:[h.jsxs("div",{children:[h.jsx("p",{className:"text-base font-semibold tracking-wide text-[var(--theme-accent-strong)]",children:"Remote Codex"}),h.jsx("p",{className:"mt-1 text-xs uppercase tracking-[0.24em] text-[var(--theme-fg-muted)]",children:"Navigation"})]}),h.jsxs("nav",{className:"mt-4 flex flex-col gap-1.5 text-sm",children:[h.jsx("button",{type:"button",disabled:l,onClick:()=>{l||(t.closeNav(),r("/workspaces"))},className:RE(l),children:"Workspaces"}),h.jsx("button",{type:"button",onClick:()=>{t.openSettings()},className:RE(),children:"Settings"})]})]}):null}function A6(){const e=hc(),t=T.useMemo(()=>[{name:"config.toml",label:"config.toml",description:"Codex runtime configuration"},{name:"auth.json",label:"auth.json",description:"Codex authentication state"}],[]),[n,r]=T.useState(null),[s,l]=T.useState({"config.toml":{path:"~/.codex/config.toml",exists:!1,originalContent:"",draftContent:"",loading:!1,saving:!1,error:null,saveMessage:null},"auth.json":{path:"~/.codex/auth.json",exists:!1,originalContent:"",draftContent:"",loading:!1,saving:!1,error:null,saveMessage:null}}),o=n?s[n]:null,[c,d]=T.useState({busy:!1,message:null,error:null}),[m,p]=T.useState([]),[g,y]=T.useState(null),[E,v]=T.useState({devHomeDraft:"",loading:!1,saving:!1,message:null,error:null}),[k,C]=T.useState({loading:!1,creating:!1,applyingId:null,renamingId:null,renameDraft:"",message:null,error:null}),S=(e==null?void 0:e.themeMode)??"system",A=(e==null?void 0:e.effectiveTheme)??"dark";T.useEffect(()=>{if(!(e!=null&&e.settingsOpen))return;const M=e;function K(F){F.key==="Escape"&&M.closeSettings()}return window.addEventListener("keydown",K),()=>{window.removeEventListener("keydown",K)}},[e]),T.useEffect(()=>{if(!(e!=null&&e.settingsOpen))return;let M=!1;return v(K=>({...K,loading:!0,message:null,error:null})),$5().then(K=>{M||(y(K),v(F=>({...F,devHomeDraft:K.devHome,loading:!1})))}).catch(K=>{M||v(F=>({...F,loading:!1,error:K instanceof sn?K.message:"Unable to load workspace settings."}))}),()=>{M=!0}},[e==null?void 0:e.settingsOpen]),T.useEffect(()=>{if(!(e!=null&&e.settingsOpen))return;let M=!1;async function K(){l(ge=>({"config.toml":{...ge["config.toml"],loading:!0,error:null,saveMessage:null},"auth.json":{...ge["auth.json"],loading:!0,error:null,saveMessage:null}}));const F=await Promise.allSettled(t.map(async ge=>({name:ge.name,result:await E0(ge.name)})));M||l(ge=>{var ne;const ce={...ge};for(const z of F){if(z.status==="fulfilled"){const{name:Be,result:L}=z.value;ce[Be]={path:L.path,exists:L.exists,originalContent:L.content,draftContent:L.content,loading:!1,saving:!1,error:null,saveMessage:null};continue}const ee=z.reason instanceof sn?z.reason.message:"Unable to load the file.",ke=((ne=t[F.indexOf(z)])==null?void 0:ne.name)??"config.toml";ce[ke]={...ce[ke],loading:!1,saving:!1,error:ee,saveMessage:null}}return ce})}return K(),()=>{M=!0}},[t,e==null?void 0:e.settingsOpen]),T.useEffect(()=>{if(!(e!=null&&e.settingsOpen))return;let M=!1;async function K(){C(F=>({...F,loading:!0,error:null,message:null}));try{const F=await G5();if(M)return;p(F),C(ge=>({...ge,loading:!1}))}catch(F){if(M)return;C(ge=>({...ge,loading:!1,error:F instanceof sn?F.message:"Unable to load config archives."}))}}return K(),()=>{M=!0}},[e==null?void 0:e.settingsOpen]);async function N(){if(!c.busy){d({busy:!0,message:null,error:null});try{const M=await Q5();d({busy:!1,message:M.state==="ready"?"App server restarted.":`App server state: ${M.state}`,error:null})}catch(M){d({busy:!1,message:null,error:M instanceof sn?M.message:"Unable to restart the app server."})}}}async function U(){if(!c.busy){d({busy:!0,message:null,error:null});try{await X5(),d({busy:!1,message:"Build and restart launched. The page may disconnect briefly.",error:null})}catch(M){d({busy:!1,message:null,error:M instanceof sn?M.message:"Unable to launch build and restart."})}}}async function G(){const M=E.devHomeDraft.trim();if(!(!M||E.saving)){v(K=>({...K,saving:!0,message:null,error:null}));try{const K=await V5({devHome:M});y(K),v(F=>({...F,devHomeDraft:K.devHome,saving:!1,message:"Workspace defaults saved."}))}catch(K){v(F=>({...F,saving:!1,error:K instanceof sn?K.message:"Unable to save workspace settings."}))}}}async function P(M){const K=s[M];if(!(!K||K.saving)){l(F=>({...F,[M]:{...F[M],saving:!0,error:null,saveMessage:null}}));try{const F=await _0(M,{content:K.draftContent});l(ge=>({...ge,[M]:{path:F.path,exists:F.exists,originalContent:F.content,draftContent:F.content,loading:!1,saving:!1,error:null,saveMessage:"Saved"}}))}catch(F){l(ge=>({...ge,[M]:{...ge[M],saving:!1,error:F instanceof sn?F.message:"Unable to save the file.",saveMessage:null}}))}}}async function H(){if(!k.creating){C(M=>({...M,creating:!0,message:null,error:null}));try{const M=await q5();p(K=>[M,...K]),C(K=>({...K,creating:!1,message:"Backup created."}))}catch(M){C(K=>({...K,creating:!1,error:M instanceof sn?M.message:"Unable to create a config backup."}))}}}async function Y(M){if(!k.applyingId){C(K=>({...K,applyingId:M.id,message:null,error:null}));try{const K=await W5(M.id);C(F=>({...F,applyingId:null,message:K.status.state==="ready"?`Applied "${K.archive.label}" and restarted app-server.`:`Applied "${K.archive.label}". App-server state: ${K.status.state}.`}))}catch(K){C(F=>({...F,applyingId:null,error:K instanceof sn?K.message:"Unable to apply the config archive."}))}}}async function ue(M){const K=k.renameDraft.trim();if(!(!K||k.renamingId!==M.id)){C(F=>({...F,message:null,error:null}));try{const F=await Y5(M.id,{label:K});p(ge=>ge.map(ce=>ce.id===M.id?F:ce)),C(ge=>({...ge,renamingId:null,renameDraft:"",message:"Backup renamed."}))}catch(F){C(ge=>({...ge,error:F instanceof sn?F.message:"Unable to rename the config backup."}))}}}return e!=null&&e.settingsOpen?h.jsxs("div",{className:"fixed inset-0 z-[70] flex items-start justify-center p-4 pt-[max(env(safe-area-inset-top),1rem)] sm:items-center",children:[h.jsx("button",{type:"button","aria-label":"Close Settings",onClick:e.closeSettings,className:"ui-overlay-scrim absolute inset-0 backdrop-blur-sm"}),h.jsxs("section",{role:"dialog","aria-modal":"true","aria-label":"Settings",className:"relative z-10 flex max-h-[calc(100vh-2rem)] w-full max-w-4xl flex-col overflow-hidden rounded-[1.8rem] border border-[var(--theme-border)] bg-[var(--theme-panel)] shadow-2xl shadow-black/20",children:[h.jsx("div",{className:"shrink-0 p-5 pb-0",children:h.jsxs("div",{className:"flex items-start justify-between gap-3",children:[h.jsxs("div",{children:[h.jsx("p",{className:"text-xs uppercase tracking-[0.24em] text-[var(--theme-fg-muted)]",children:"Settings"}),h.jsx("h2",{className:"mt-2 text-xl font-semibold text-[var(--theme-fg)]",children:"Settings"}),h.jsx("p",{className:"mt-2 text-sm leading-6 text-[var(--theme-fg-soft)]",children:"Edit host-side Codex configuration files through supervisor."})]}),h.jsx("button",{type:"button","aria-label":"Close Settings",onClick:e.closeSettings,className:"inline-flex h-9 w-9 items-center justify-center rounded-full border border-[var(--theme-border-strong)] bg-[var(--theme-surface-strong)] text-[var(--theme-fg)] transition hover:border-[var(--theme-border-contrast)] hover:bg-[var(--theme-hover)]",children:h.jsx(T0,{})})]})}),h.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto p-5 pt-5",children:h.jsxs("div",{className:"space-y-2",children:[h.jsxs("div",{className:"rounded-[1.1rem] border border-[var(--theme-border)] bg-[var(--theme-surface)] px-3 py-3",children:[h.jsx("div",{className:"flex items-start justify-between gap-3",children:h.jsxs("div",{className:"min-w-0",children:[h.jsx("p",{className:"text-sm font-medium text-[var(--theme-fg)]",children:"Appearance"}),h.jsxs("p",{className:"mt-1 text-xs leading-5 text-[var(--theme-fg-muted)]",children:["Choose light, dark, or follow the system setting. Active: ",A,"."]})]})}),h.jsx("div",{className:"mt-3 grid gap-2 sm:grid-cols-3",children:k6.map(M=>{const K=S===M.value;return h.jsxs("button",{type:"button",onClick:()=>e.setThemeMode(M.value),className:`block rounded-[1rem] border px-3 py-2.5 text-left transition ${K?"border-[var(--theme-accent-border)] bg-[var(--theme-accent-soft)]":"border-[var(--theme-border)] bg-[var(--theme-surface-strong)] hover:bg-[var(--theme-hover)]"}`,children:[h.jsxs("div",{className:"flex items-center justify-between gap-3",children:[h.jsx("span",{className:"text-sm font-medium text-[var(--theme-fg)]",children:M.label}),K?h.jsx("span",{className:"rounded-full border border-[var(--theme-accent-border)] bg-[var(--theme-accent-soft)] px-2 py-0.5 text-[10px] uppercase tracking-[0.18em] text-[var(--theme-accent-strong)]",children:"Active"}):null]}),h.jsx("p",{className:"mt-1 text-xs leading-5 text-[var(--theme-fg-muted)]",children:M.description})]},M.value)})})]}),h.jsxs("div",{className:"rounded-[1.1rem] border border-[var(--theme-border)] bg-[var(--theme-surface)] px-3 py-3",children:[h.jsx("div",{className:"flex items-start justify-between gap-3",children:h.jsxs("div",{className:"min-w-0",children:[h.jsx("p",{className:"text-sm font-medium text-[var(--theme-fg)]",children:"Workspace defaults"}),h.jsx("p",{className:"mt-1 text-xs leading-5 text-[var(--theme-fg-muted)]",children:"Git projects clone into dev home. New workspace directories can create one missing child under this path."})]})}),h.jsxs("div",{className:"mt-3 grid gap-3",children:[h.jsxs("div",{children:[h.jsx("p",{className:"text-[11px] uppercase tracking-[0.18em] text-[var(--theme-fg-muted)]",children:"Workspace root"}),h.jsx("p",{title:(g==null?void 0:g.workspaceRoot)??"Loading workspace root",className:"mt-1 truncate rounded-[0.9rem] border border-[var(--theme-border)] bg-[var(--theme-surface-strong)] px-3 py-2 font-mono text-xs text-[var(--theme-fg-soft)]",children:E.loading&&!g?"Loading...":(g==null?void 0:g.workspaceRoot)??"Unavailable"})]}),h.jsxs("div",{children:[h.jsx("label",{htmlFor:"settings-dev-home",className:"text-[11px] uppercase tracking-[0.18em] text-[var(--theme-fg-muted)]",children:"Dev home"}),h.jsxs("div",{className:"mt-1 flex flex-col gap-2 sm:flex-row",children:[h.jsx("input",{id:"settings-dev-home",value:E.devHomeDraft,onChange:M=>v(K=>({...K,devHomeDraft:M.target.value,message:null,error:null})),placeholder:"/Users/name/dev",className:"min-w-0 flex-1 rounded-full border border-[var(--theme-border)] bg-[var(--theme-panel)] px-3 py-2 text-sm text-[var(--theme-fg)] outline-none focus:border-[var(--theme-accent-border)]"}),h.jsx("button",{type:"button","aria-label":"Save workspace defaults",onClick:()=>void G(),disabled:E.loading||E.saving||!E.devHomeDraft.trim(),className:"rounded-full bg-[var(--theme-accent-solid)] px-4 py-2 text-xs font-medium text-[var(--theme-accent-solid-fg)] transition hover:bg-[var(--theme-accent-solid-hover)] disabled:cursor-not-allowed disabled:bg-[var(--theme-muted)] disabled:text-[var(--theme-fg-muted)]",children:E.saving?"Saving...":"Save"})]})]})]}),E.error?h.jsx("p",{className:"mt-2 text-xs text-rose-300",children:E.error}):E.message?h.jsx("p",{className:"mt-2 text-xs text-emerald-300",children:E.message}):null]}),h.jsxs("div",{className:"rounded-[1.1rem] border border-[var(--theme-border)] bg-[var(--theme-surface)] px-3 py-3",children:[h.jsxs("div",{className:"flex items-start justify-between gap-3",children:[h.jsxs("div",{className:"min-w-0",children:[h.jsx("p",{className:"text-sm font-medium text-[var(--theme-fg)]",children:"Codex app-server"}),h.jsx("p",{className:"mt-1 text-xs leading-5 text-[var(--theme-fg-muted)]",children:"Restart after editing host configuration to force a fresh reload."})]}),h.jsxs("div",{className:"flex shrink-0 flex-wrap justify-end gap-2",children:[h.jsx("button",{type:"button",onClick:()=>void N(),disabled:c.busy,className:"rounded-full border border-sky-400/35 bg-sky-400/10 px-3 py-1.5 text-xs font-medium text-sky-500 transition hover:bg-sky-400/16 disabled:cursor-not-allowed disabled:border-[var(--theme-border)] disabled:bg-[var(--theme-muted)] disabled:text-[var(--theme-fg-muted)]",children:c.busy?"Restarting...":"Restart"}),h.jsx("button",{type:"button",onClick:()=>void U(),disabled:c.busy,className:"rounded-full border border-amber-400/35 bg-amber-400/10 px-3 py-1.5 text-xs font-medium text-amber-500 transition hover:bg-amber-400/16 disabled:cursor-not-allowed disabled:border-[var(--theme-border)] disabled:bg-[var(--theme-muted)] disabled:text-[var(--theme-fg-muted)]",children:c.busy?"Working...":"Build and restart"})]})]}),c.error?h.jsx("p",{className:"mt-2 text-xs text-rose-300",children:c.error}):c.message?h.jsx("p",{className:"mt-2 text-xs text-emerald-300",children:c.message}):null]}),h.jsxs("div",{className:"rounded-[1.1rem] border border-[var(--theme-border)] bg-[var(--theme-surface)] px-3 py-3",children:[h.jsx("div",{className:"flex items-start justify-between gap-3",children:h.jsxs("div",{className:"min-w-0",children:[h.jsx("p",{className:"text-sm font-medium text-[var(--theme-fg)]",children:"Host files"}),h.jsx("p",{className:"mt-1 text-xs leading-5 text-[var(--theme-fg-muted)]",children:"Open `config.toml` or `auth.json` in a secondary editor dialog when needed."})]})}),h.jsx("div",{className:"mt-3 grid gap-2 sm:grid-cols-2",children:t.map(M=>{const K=s[M.name],F=K.draftContent!==K.originalContent;return h.jsx("button",{type:"button",onClick:()=>r(M.name),className:"block rounded-[1.1rem] border border-[var(--theme-border)] bg-[var(--theme-surface-strong)] px-3 py-3 text-left transition hover:bg-[var(--theme-hover)]",children:h.jsxs("div",{className:"flex items-start justify-between gap-3",children:[h.jsxs("div",{className:"min-w-0",children:[h.jsx("p",{className:"truncate text-sm font-medium text-[var(--theme-fg)]",children:M.label}),h.jsx("p",{className:"mt-1 text-xs leading-5 text-[var(--theme-fg-muted)]",children:M.description})]}),h.jsx("div",{className:"shrink-0",children:K.loading?h.jsx("span",{className:"text-[11px] uppercase tracking-[0.2em] text-[var(--theme-fg-muted)]",children:"Loading"}):F?h.jsx("span",{className:"rounded-full border border-[var(--theme-accent-border)] bg-[var(--theme-accent-soft)] px-2 py-0.5 text-[10px] uppercase tracking-[0.18em] text-[var(--theme-accent-strong)]",children:"Unsaved"}):K.exists?h.jsx("span",{className:"rounded-full border border-emerald-400/25 bg-emerald-400/10 px-2 py-0.5 text-[10px] uppercase tracking-[0.18em] text-emerald-600 dark:text-emerald-100",children:"Ready"}):h.jsx("span",{className:"rounded-full border border-sky-300/25 bg-sky-300/10 px-2 py-0.5 text-[10px] uppercase tracking-[0.18em] text-sky-600 dark:text-sky-100",children:"New"})})]})},M.name)})})]}),h.jsxs("div",{className:"rounded-[1.1rem] border border-[var(--theme-border)] bg-[var(--theme-surface)] px-3 py-3",children:[h.jsxs("div",{className:"flex items-start justify-between gap-3",children:[h.jsxs("div",{className:"min-w-0",children:[h.jsx("p",{className:"text-sm font-medium text-[var(--theme-fg)]",children:"Config archives"}),h.jsx("p",{className:"mt-1 text-xs leading-5 text-[var(--theme-fg-muted)]",children:"Backup `config.toml` and `auth.json`, then apply a saved archive with an app-server restart so Codex reloads the selected files."})]}),h.jsx("button",{type:"button",onClick:()=>void H(),disabled:k.creating,className:"shrink-0 rounded-full border border-[var(--theme-accent-border)] bg-[var(--theme-accent-soft)] px-3 py-1.5 text-xs font-medium text-[var(--theme-accent-strong)] transition hover:bg-[var(--theme-hover)] disabled:cursor-not-allowed disabled:border-[var(--theme-border)] disabled:bg-[var(--theme-muted)] disabled:text-[var(--theme-fg-muted)]",children:k.creating?"Creating...":"Create backup"})]}),k.error?h.jsx("p",{className:"mt-2 text-xs text-rose-300",children:k.error}):k.message?h.jsx("p",{className:"mt-2 text-xs text-emerald-300",children:k.message}):null,h.jsx("div",{className:"mt-3 space-y-2",children:k.loading?h.jsx("p",{className:"rounded-[1rem] border border-[var(--theme-border)] bg-[var(--theme-surface-strong)] px-3 py-3 text-xs text-[var(--theme-fg-muted)]",children:"Loading backups..."}):m.length===0?h.jsx("p",{className:"rounded-[1rem] border border-[var(--theme-border)] bg-[var(--theme-surface-strong)] px-3 py-3 text-xs text-[var(--theme-fg-muted)]",children:"No config backups yet."}):m.map(M=>{const K=k.renamingId===M.id;return h.jsx("div",{className:"rounded-[1.1rem] border border-[var(--theme-border)] bg-[var(--theme-surface-strong)] px-3 py-3",children:h.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[h.jsxs("div",{className:"min-w-0",children:[K?h.jsxs("div",{className:"flex max-w-xl gap-2",children:[h.jsx("input",{"aria-label":`Rename ${M.label}`,value:k.renameDraft,onChange:F=>C(ge=>({...ge,renameDraft:F.target.value,error:null,message:null})),className:"min-w-0 flex-1 rounded-full border border-[var(--theme-border)] bg-[var(--theme-panel)] px-3 py-1.5 text-sm text-[var(--theme-fg)] outline-none focus:border-[var(--theme-accent-border)]"}),h.jsx("button",{type:"button","aria-label":`Save archive name ${M.label}`,onClick:()=>void ue(M),className:"rounded-full bg-[var(--theme-accent-solid)] px-3 py-1.5 text-xs font-medium text-[var(--theme-accent-solid-fg)] transition hover:bg-[var(--theme-accent-solid-hover)]",children:"Save"}),h.jsx("button",{type:"button",onClick:()=>C(F=>({...F,renamingId:null,renameDraft:""})),className:"rounded-full border border-[var(--theme-border)] bg-[var(--theme-panel)] px-3 py-1.5 text-xs font-medium text-[var(--theme-fg)] transition hover:bg-[var(--theme-hover)]",children:"Cancel"})]}):h.jsx("p",{className:"truncate text-sm font-medium text-[var(--theme-fg)]",children:M.label}),h.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2 text-[11px] text-[var(--theme-fg-muted)]",children:[h.jsxs("span",{children:["Created ",S6(M.createdAt)]}),C6.map(F=>{var ge;return h.jsxs("span",{className:"rounded-full border border-[var(--theme-border)] bg-[var(--theme-panel)] px-2 py-0.5 font-mono",children:[F,": ",(ge=M.files[F])!=null&&ge.exists?"saved":"missing"]},F)})]})]}),h.jsxs("div",{className:"flex shrink-0 flex-wrap gap-2",children:[h.jsx("button",{type:"button",onClick:()=>C(F=>({...F,renamingId:M.id,renameDraft:M.label,message:null,error:null})),disabled:K,className:"rounded-full border border-[var(--theme-border)] bg-[var(--theme-panel)] px-3 py-1.5 text-xs font-medium text-[var(--theme-fg)] transition hover:bg-[var(--theme-hover)] disabled:cursor-not-allowed disabled:text-[var(--theme-fg-muted)]",children:"Rename"}),h.jsx("button",{type:"button",onClick:()=>void Y(M),disabled:k.applyingId!==null,className:"rounded-full border border-emerald-400/35 bg-emerald-400/10 px-3 py-1.5 text-xs font-medium text-emerald-600 transition hover:bg-emerald-400/16 disabled:cursor-not-allowed disabled:border-[var(--theme-border)] disabled:bg-[var(--theme-muted)] disabled:text-[var(--theme-fg-muted)] dark:text-emerald-100",children:k.applyingId===M.id?"Applying...":"Apply"})]})]})},M.id)})})]})]})})]}),n&&o?h.jsx("div",{className:"pointer-events-none fixed inset-0 z-[71] flex items-center justify-center p-4",children:h.jsxs("div",{className:"pointer-events-auto relative z-10 flex max-h-[min(88vh,56rem)] w-full max-w-3xl flex-col overflow-hidden rounded-[1.6rem] border border-[var(--theme-border)] bg-[var(--theme-panel)] shadow-2xl shadow-black/25",children:[h.jsxs("div",{className:"flex items-start justify-between gap-3 border-b border-[var(--theme-border)] px-4 py-3 sm:px-5",children:[h.jsxs("div",{className:"min-w-0",children:[h.jsx("p",{className:"text-sm font-medium text-[var(--theme-fg)]",children:n}),h.jsx("p",{className:"mt-1 break-all font-mono text-xs text-[var(--theme-fg-muted)]",children:o.path})]}),h.jsxs("div",{className:"flex items-center gap-2",children:[o.error?h.jsx("span",{className:"text-xs text-rose-300",children:o.error}):o.saveMessage?h.jsx("span",{className:"text-xs text-emerald-300",children:o.saveMessage}):null,h.jsx("button",{type:"button","aria-label":`Save ${n}`,onClick:()=>void P(n),disabled:o.loading||o.saving||o.draftContent===o.originalContent,className:"rounded-full bg-[var(--theme-accent-solid)] px-4 py-2 text-sm font-medium text-[var(--theme-accent-solid-fg)] transition hover:bg-[var(--theme-accent-solid-hover)] disabled:cursor-not-allowed disabled:bg-[var(--theme-muted)] disabled:text-[var(--theme-fg-muted)]",children:o.saving?"Saving...":"Save"}),h.jsx("button",{type:"button","aria-label":"Close File Editor",onClick:()=>r(null),className:"inline-flex h-9 w-9 items-center justify-center rounded-full border border-[var(--theme-border-strong)] bg-[var(--theme-surface-strong)] text-[var(--theme-fg)] transition hover:border-[var(--theme-border-contrast)] hover:bg-[var(--theme-hover)]",children:h.jsx(T0,{})})]})]}),h.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto p-4 sm:p-5",children:h.jsx("textarea",{"aria-label":`Edit ${n}`,value:o.draftContent,onChange:M=>l(K=>({...K,[n]:{...K[n],draftContent:M.target.value,error:null,saveMessage:null}})),spellCheck:!1,className:"min-h-[28rem] w-full rounded-[1rem] border border-[var(--theme-border)] bg-[var(--theme-surface-strong)] px-3 py-3 font-mono text-[13px] leading-6 text-[var(--theme-fg)] outline-none transition focus:border-[var(--theme-accent-border)]",placeholder:o.loading?"Loading...":`Edit ${n} here`})})]})}):null]}):null}function yp({eyebrow:e,title:t,description:n}){return h.jsxs("div",{className:"rounded-3xl border border-stone-800 bg-stone-900 p-5 shadow-2xl shadow-stone-950/20",children:[h.jsx("p",{className:"text-xs uppercase tracking-[0.3em] text-stone-500",children:e}),h.jsx("h2",{className:"mt-3 text-xl font-semibold text-stone-100",children:t}),h.jsx("p",{className:"mt-2 text-sm leading-6 text-stone-400",children:n})]})}function N6(){const[e,t]=T.useState(null),[n,r]=T.useState(null);return T.useEffect(()=>{F5().then(t).catch(s=>{r(s instanceof Error?s.message:"Unable to load runtime config.")})},[]),h.jsx("div",{className:"min-h-screen bg-stone-950 px-4 py-8 text-stone-100 sm:px-6",children:h.jsx("div",{className:"mx-auto max-w-7xl",children:h.jsxs("div",{className:"grid gap-6 lg:grid-cols-[1.2fr_0.8fr]",children:[h.jsxs("section",{className:"rounded-[2rem] border border-stone-800 bg-stone-900 p-8 shadow-2xl shadow-stone-950/20 sm:p-10",children:[h.jsx("p",{className:"text-xs uppercase tracking-[0.35em] text-amber-300",children:"Local Supervisor"}),h.jsx("h1",{className:"mt-4 max-w-3xl text-4xl font-semibold tracking-tight text-stone-100 sm:text-6xl",children:"Bring your local workspaces into a mobile-ready control surface."}),h.jsx("p",{className:"mt-6 max-w-2xl text-base leading-7 text-stone-400 sm:text-lg",children:"Phase 1 focuses on a stable supervisor shell: runtime config, workspace onboarding, database bootstrap, and a read-only file tree that already respects workspace root boundaries."}),h.jsxs("div",{className:"mt-8 flex flex-wrap gap-4",children:[h.jsx(Ci,{to:"/workspaces",className:"rounded-full bg-amber-300 px-5 py-3 font-medium text-stone-950 transition hover:bg-amber-200",children:"Enter Workspace Console"}),h.jsx(Ci,{to:"/workspaces/new",className:"rounded-full border border-stone-700 px-5 py-3 font-medium text-stone-200 transition hover:border-stone-500 hover:bg-stone-800",children:"Add First Workspace"})]})]}),h.jsxs("section",{className:"grid gap-4",children:[h.jsx(yp,{eyebrow:"Health",title:n?"API unavailable":"Supervisor reachable",description:n??`Connected to ${(e==null?void 0:e.appName)??"Remote Codex Supervisor"} ${(e==null?void 0:e.appVersion)??""}`.trim()}),h.jsx(yp,{eyebrow:"Workspace Root",title:(e==null?void 0:e.workspaceRoot)??"Loading root path",description:"The file tree and workspace creation flow stay inside this boundary in Phase 1."}),h.jsx(yp,{eyebrow:"Environment",title:(e==null?void 0:e.environment)??"Loading environment",description:e?`${e.host}:${e.port}`:"Runtime metadata appears here after bootstrap."})]})]})})})}function R6(e){if(!e)return"No time";const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}function L6(e){switch(e){case"inProgress":return"running";case"completed":return"completed";case"interrupted":return"interrupted";case"failed":return"failed"}}function I6({open:e,busy:t=!1,turnsState:n,onCancel:r,onLoadTurns:s,onExport:l}){var U,G,P;const o=((U=n.data)==null?void 0:U.turns)??[],c=T.useMemo(()=>o.slice(0,10).map(H=>H.turnId),[o]),[d,m]=T.useState("latest"),[p,g]=T.useState(()=>new Set),[y,E]=T.useState(!0),[v,k]=T.useState("pdf");if(T.useEffect(()=>{e&&(m("latest"),k("pdf"),E(!0),s())},[s,e]),T.useEffect(()=>{e&&o.length>0&&g(new Set(c))},[c,e,o.length]),T.useEffect(()=>{if(!e)return;function H(Y){Y.key==="Escape"&&!t&&r()}return window.addEventListener("keydown",H),()=>window.removeEventListener("keydown",H)},[t,r,e]),!e)return null;const C=d==="latest"?Math.min(10,((G=n.data)==null?void 0:G.totalTurnCount)??10):p.size,S=!t&&(d==="latest"||p.size>0);function A(H){g(Y=>{const ue=new Set(Y);return ue.has(H)?ue.delete(H):ue.add(H),ue})}function N(){const H={format:v,mode:d,...d==="latest"?{limit:10}:{turnIds:[...p]},profile:"review",options:{includeTokenAndPrice:y}};l(H)}return ko.createPortal(h.jsxs("div",{className:"fixed inset-0 z-[96] flex items-center justify-center p-3 sm:p-6",children:[h.jsx("button",{type:"button","aria-label":"Close export dialog",onClick:r,disabled:t,className:"absolute inset-0 bg-stone-950/78 backdrop-blur-sm disabled:cursor-not-allowed"}),h.jsxs("div",{role:"dialog","aria-modal":"true","aria-label":"Export transcript",className:"relative z-[1] flex max-h-[min(46rem,calc(100vh-2rem))] w-full max-w-2xl flex-col rounded-[1.6rem] border border-stone-700 bg-stone-900 shadow-2xl shadow-stone-950/40",children:[h.jsxs("div",{className:"flex items-start justify-between gap-3 border-b border-stone-800 px-5 py-4",children:[h.jsxs("div",{className:"min-w-0",children:[h.jsx("p",{className:"text-sm font-semibold text-stone-100",children:"Export transcript"}),h.jsx("p",{className:"mt-1 text-xs text-stone-500",children:"Default review copy summarizes command batches and file changes."})]}),h.jsx("button",{type:"button","aria-label":"Close dialog",onClick:r,disabled:t,className:"inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-full border border-stone-700 text-stone-300 transition hover:bg-stone-800 disabled:cursor-not-allowed disabled:opacity-60",children:h.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-4 w-4 fill-current",children:h.jsx("path",{d:"M3.22 2.47 8 7.25l4.78-4.78 1.06 1.06L9.06 8.31l4.78 4.78-1.06 1.06L8 9.37l-4.78 4.78-1.06-1.06 4.78-4.78-4.78-4.78 1.06-1.06Z"})})})]}),h.jsxs("div",{className:"min-h-0 flex-1 overflow-auto px-5 py-4",children:[h.jsx("div",{className:"inline-flex rounded-full border border-stone-700 bg-stone-950/60 p-1",children:[["latest","Latest 10"],["selected","Custom selection"]].map(([H,Y])=>h.jsx("button",{type:"button",onClick:()=>m(H),className:`rounded-full px-3 py-1.5 text-sm transition ${d===H?"ui-status-warning":"text-stone-400 hover:text-stone-100"}`,children:Y},H))}),h.jsx("div",{className:"mt-4 inline-flex rounded-full border border-stone-700 bg-stone-950/60 p-1",children:[["pdf","PDF"],["html","HTML"]].map(([H,Y])=>h.jsx("button",{type:"button",onClick:()=>k(H),className:`rounded-full px-3 py-1.5 text-sm transition ${v===H?"ui-status-warning":"text-stone-400 hover:text-stone-100"}`,children:Y},H))}),d==="selected"?h.jsxs("div",{className:"mt-4 rounded-2xl border border-stone-800 bg-stone-950/40",children:[h.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 border-b border-stone-800 px-3 py-2.5",children:[h.jsxs("p",{className:"text-xs text-stone-400",children:["Selected ",p.size," of ",((P=n.data)==null?void 0:P.totalTurnCount)??o.length]}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("button",{type:"button",onClick:()=>g(new Set(o.map(H=>H.turnId))),className:"rounded-full border border-stone-700 px-2.5 py-1 text-xs text-stone-300 transition hover:bg-stone-800",children:"Select all"}),h.jsx("button",{type:"button",onClick:()=>g(new Set),className:"rounded-full border border-stone-700 px-2.5 py-1 text-xs text-stone-300 transition hover:bg-stone-800",children:"Clear"})]})]}),n.status==="loading"?h.jsx("p",{className:"px-3 py-6 text-sm text-stone-400",children:"Loading turns..."}):n.status==="failed"?h.jsx("p",{className:"px-3 py-6 text-sm text-rose-100",children:n.error}):h.jsx("div",{className:"max-h-80 overflow-auto p-2",children:o.map(H=>h.jsxs("label",{className:"flex cursor-pointer items-center gap-3 rounded-xl px-2.5 py-2 text-sm transition hover:bg-stone-800/70",children:[h.jsx("input",{type:"checkbox",checked:p.has(H.turnId),onChange:()=>A(H.turnId),className:"h-4 w-4 accent-amber-300"}),h.jsxs("span",{className:"shrink-0 text-xs font-medium text-stone-300",children:["Turn ",H.turnNumber]}),h.jsx("span",{className:"shrink-0 text-xs text-stone-500",children:R6(H.startedAt)}),h.jsx("span",{className:"min-w-0 flex-1 truncate text-left text-stone-200",children:H.userPromptPreview}),h.jsx("span",{className:"hidden shrink-0 rounded-full border border-stone-700 px-2 py-0.5 text-[10px] text-stone-400 sm:inline",children:L6(H.status)})]},H.turnId))})]}):h.jsx("p",{className:"mt-4 rounded-2xl border border-stone-800 bg-stone-950/40 px-3 py-3 text-sm text-stone-300",children:"Exports the latest 10 turns in chronological order."}),h.jsxs("div",{className:"mt-4 grid gap-2 text-sm text-stone-300 sm:grid-cols-2",children:[h.jsxs("label",{className:"flex items-center gap-2 rounded-xl border border-stone-800 bg-stone-950/35 px-3 py-2",children:[h.jsx("input",{type:"checkbox",checked:y,onChange:H=>E(H.target.checked),className:"h-4 w-4 accent-amber-300"}),"Token and price"]}),h.jsx("p",{className:"flex items-center rounded-xl border border-stone-800 bg-stone-950/35 px-3 py-2 text-xs text-stone-500",children:v==="html"?"HTML keeps the chat timeline styling and omits raw command output.":"Review exports keep message text readable and omit tool activity."})]})]}),h.jsxs("div",{className:"flex items-center justify-between gap-3 border-t border-stone-800 px-5 py-4",children:[h.jsxs("p",{className:"min-w-0 text-xs text-stone-500",children:[C," ",C===1?"turn":"turns"," will be exported."]}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("button",{type:"button",onClick:r,disabled:t,className:"rounded-full border border-stone-700 px-4 py-2 text-sm font-medium text-stone-300 transition hover:bg-stone-800 disabled:cursor-not-allowed disabled:opacity-60",children:"Cancel"}),h.jsx("button",{type:"button",onClick:N,disabled:!S,className:"ui-status-warning rounded-full px-4 py-2 text-sm font-medium transition disabled:cursor-not-allowed disabled:opacity-60",children:t?"Exporting...":`Export ${v.toUpperCase()}`})]})]})]})]}),document.body)}function LE(e){return e.replace(/\u00a0/g," ")}function O6(e){if(!e)return"";const t=document.createElement("div");return t.innerHTML=e,t.textContent??""}function D6(e){return!!e.querySelector("[style], font")}function j6(e,t){if(!e)return[];const n=[],r=[...t].sort((o,c)=>c.placeholder.length-o.placeholder.length);let s=0,l=0;for(;s<e.length;){const o=r.find(m=>e.startsWith(m.placeholder,s));if(o){n.push({type:"attachment",key:`${o.clientId}-${s}`,attachment:o}),s+=o.placeholder.length;continue}let c=e.length;for(const m of r){const p=e.indexOf(m.placeholder,s);p!==-1&&p<c&&(c=p)}const d=e.slice(s,c);d&&(n.push({type:"text",key:`text-${l}`,text:d}),l+=1),s=c}return n}function IE(e){if(!e)return"Auto";switch(e){case"xhigh":return"xhigh";default:return e}}function M6(){return h.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:[h.jsx("path",{d:"m4 5 2 2-2 2"}),h.jsx("path",{d:"M7.75 9.5h4.25"})]})}function P6(){return h.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.5",strokeLinecap:"round",children:h.jsx("path",{d:"M8 3.25v9.5M3.25 8h9.5"})})}function B6(){return h.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[h.jsx("path",{d:"M10.75 2.5 5.25 13.5"}),h.jsx("path",{d:"M4.25 5.25h2.25"}),h.jsx("path",{d:"M9.5 10.75h2.25"})]})}function U6(e){switch(e){case"bearerToken":return"Token";case"oAuth":return"OAuth";case"notLoggedIn":return"Login";case"unsupported":return"Public";default:return"Unknown"}}function H6(e){switch(e){case"repo":return"Repo";case"system":return"System";case"admin":return"Admin";case"user":default:return"User"}}function z6(e){switch(e){case"active":return"Active";case"paused":return"Paused";case"budgetLimited":return"Budget";case"complete":return"Complete";default:return e}}function F6(e){const t=e.trim();if(!t)return null;const n=Number(t);return!Number.isFinite(n)||n<=0?Number.NaN:Math.round(n*1e3)}function $6(e){if(!e)return"";const t=e/1e3;return Number.isInteger(t)?String(t):String(Number(t.toFixed(1)))}function v0(e){return e.replace(/\r\n/g,`
|
|
62
|
+
`)}function V6(e){const t=e.trim();return/^[A-Za-z0-9_-]+$/.test(t)?t:null}function G6(e){const n=v0(e).split(`
|
|
63
|
+
`).map(s=>s.trim()).filter(Boolean).find(s=>/^\[mcp_servers\.[^\]]+\]$/.test(s));if(!n)return null;const r=n.match(/^\[mcp_servers\.([A-Za-z0-9_-]+)\]$/);return(r==null?void 0:r[1])??null}function q6(e,t){return`[mcp_servers.${e}]
|
|
64
|
+
url = ${JSON.stringify(t.trim())}
|
|
65
|
+
`}function OE(e,t,n){var g,y;const r=v0(e),s=`${v0(n).trim()}
|
|
66
|
+
`,l=r.split(`
|
|
67
|
+
`),o=`[mcp_servers.${t}]`,c=`[mcp_servers.${t}.`;let d=-1,m=l.length;for(let E=0;E<l.length;E+=1)if((((g=l[E])==null?void 0:g.trim())??"")===o){d=E;break}if(d>=0){for(let k=d+1;k<l.length;k+=1){const C=((y=l[k])==null?void 0:y.trim())??"";if(C.startsWith("[")&&!(C===o||C.startsWith(c))){m=k;break}}const E=l.slice(0,d).join(`
|
|
68
|
+
`).trimEnd(),v=l.slice(m).join(`
|
|
69
|
+
`).trim();return[E,s.trimEnd(),v].filter(Boolean).join(`
|
|
70
|
+
|
|
71
|
+
`).replace(/\n{3,}/g,`
|
|
72
|
+
|
|
73
|
+
`).concat(`
|
|
74
|
+
`)}const p=r.trimEnd();return p?`${p}
|
|
75
|
+
|
|
76
|
+
${s}`:s}function lv(e){return typeof e!="number"||Number.isNaN(e)?0:Math.max(0,Math.min(100,Math.round(e)))}function Ep(e){const t=e/1e3;return Number.isInteger(t)?`${t}k`:`${Number(t.toFixed(1))}k`}function Y6(e,t){if(!e)return"Select model";if((t==null?void 0:t.availability)!=="available"||typeof t.tokensInContextWindow!="number"||typeof t.modelContextWindow!="number")return`${e} · context unavailable`;const n=Math.max(t.tokensInContextWindow,0),r=Math.max(t.modelContextWindow,0),s=Math.max(r-n,0);return[e,`${Ep(n)} used / ${Ep(r)}`,`${Ep(s)} left`,`${lv(t.remainingPercent)}% context left`].join(" · ")}function W6({contextUsage:e}){const t=(e==null?void 0:e.availability)??"unavailable",n=lv(e==null?void 0:e.remainingPercent),r=t==="available"?n:100,s=t!=="available"?"rgba(120,113,108,0.55)":n<=20?"rgba(251,113,133,0.95)":n<=40?"rgba(252,211,77,0.94)":"rgba(125,211,252,0.95)";return h.jsx("span",{"aria-hidden":"true",className:"thread-context-progress-frame pointer-events-none absolute inset-0",style:{"--context-ring-progress":`${r}%`,"--context-ring-color":s}})}function DE(e,t){const n=e.name.trim();if(n)return n;const r=t==="photo"?e.type.includes("png")?".png":e.type.includes("heic")?".heic":e.type.includes("heif")?".heif":e.type.includes("webp")?".webp":".jpg":"";return`${t==="photo"?"photo":"file"}-${Date.now()}${r}`}function jE(e){return e.replace(/[\r\n[\]]+/g," ").replace(/\s+/g," ").trim()||"attachment"}function _p(e){return e.type.startsWith("image/")?"photo":"file"}function w0(e,t){const n=[];if(e)for(const r of Array.from(e)){if(r.kind!=="file")continue;const s=r.getAsFile();s&&n.push(s)}return n.length>0?n:t?Array.from(t):[]}function ME(e,t){return w0(e,t).length>0}function Ws(e){return e instanceof HTMLElement&&e.dataset.segmentType==="attachment"&&e.dataset.placeholder?e.dataset.placeholder:e.textContent??""}function Q6(e){const t=e.replace(/[\\/]+$/,"").trim();return t?t.split(/[\\/]/).filter(Boolean).at(-1)??t:""}function PE(e){const t=e.placeholder.match(/^\[(?:PHOTO|FILE)\s+(.+)\]$/);return t!=null&&t[1]?t[1]:Q6(e.originalName)}function X6(){return h.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:h.jsx("path",{d:"M3 4.5A1.75 1.75 0 0 1 4.75 2.75h6.5A1.75 1.75 0 0 1 13 4.5v4A1.75 1.75 0 0 1 11.25 10.25H8l-2.75 2v-2H4.75A1.75 1.75 0 0 1 3 8.5v-4Z"})})}function K6(){return h.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 20 20",className:"h-3.5 w-3.5 fill-current",children:[h.jsx("path",{fillRule:"evenodd",d:"M14.5 10C16.9853 10 19 7.98528 19 5.5C19 5.01783 18.9242 4.55338 18.7838 4.11791C18.6792 3.79367 18.2734 3.72683 18.0325 3.96772L15.3402 6.66002C15.2098 6.79041 15.0168 6.84163 14.8466 6.77074C14.1172 6.46695 13.5334 5.88351 13.2292 5.15431C13.1582 4.98403 13.2094 4.79088 13.3398 4.66042L16.0327 1.9676C16.2735 1.72672 16.2067 1.32092 15.8825 1.21636C15.4469 1.07588 14.9823 1 14.5 1C12.0147 1 10 3.01472 10 5.5C10 5.59783 10.0031 5.69494 10.0093 5.79122C10.065 6.66418 9.88174 7.59855 9.20974 8.15855L1.98017 14.1832C1.3591 14.7008 1 15.4674 1 16.2759C1 17.7804 2.21962 19 3.7241 19C4.53256 19 5.29925 18.6409 5.81681 18.0198L11.8414 10.7903C12.4014 10.1183 13.3358 9.93497 14.2088 9.99073C14.3051 9.99688 14.4022 10 14.5 10ZM5 16C5 16.5523 4.55228 17 4 17C3.44772 17 3 16.5523 3 16C3 15.4477 3.44772 15 4 15C4.55228 15 5 15.4477 5 16Z",clipRule:"evenodd"}),h.jsx("path",{d:"M14.5 11.5C14.6731 11.5 14.8445 11.4927 15.0138 11.4783L18.7678 15.2323C19.7441 16.2086 19.7441 17.7915 18.7678 18.7678C17.7915 19.7441 16.2086 19.7441 15.2323 18.7678L10.8216 14.3571L12.9938 11.7505C13.0455 11.6885 13.1413 11.6131 13.3357 11.5552C13.5378 11.4951 13.805 11.468 14.1132 11.4877C14.2413 11.4959 14.3702 11.5 14.5 11.5Z"}),h.jsx("path",{d:"M6.00003 4.58582L8.33056 6.91635C8.3027 6.95627 8.27496 6.98497 8.24946 7.00622L6.79994 8.21415L4.58582 6.00003H3.30905C3.11966 6.00003 2.94653 5.89303 2.86184 5.72364L1.1612 2.32237C1.06495 2.12987 1.10268 1.89739 1.25486 1.74521L1.74521 1.25486C1.89739 1.10268 2.12987 1.06495 2.32237 1.1612L5.72364 2.86184C5.89303 2.94653 6.00003 3.11966 6.00003 3.30905V4.58582Z"})]})}function Tp(){return h.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:[h.jsx("path",{d:"M5.5 3.25h5"}),h.jsx("path",{d:"M6.4 2h3.2a.9.9 0 0 1 .9.9v.35h1.3a1.2 1.2 0 0 1 1.2 1.2v7.35a1.2 1.2 0 0 1-1.2 1.2H4.2A1.2 1.2 0 0 1 3 11.8V4.45a1.2 1.2 0 0 1 1.2-1.2h1.3V2.9a.9.9 0 0 1 .9-.9Z"})]})}function Qs({label:e,tone:t="stone"}){const n=t==="rose"?"border-rose-300/35 bg-rose-300/14 text-rose-50":t==="sky"?"border-sky-300/35 bg-sky-300/14 text-sky-50":"border-stone-700/90 bg-stone-900/80 text-stone-100";return h.jsx("span",{className:`inline-flex min-w-[3rem] items-center justify-center rounded-full border px-2 py-1.5 text-[10px] font-medium tracking-[0.12em] ${n}`,children:e})}function vp({activeView:e,edgeToEdgeMobile:t=!1,busy:n=!1,settingsBusy:r=!1,compactBusy:s=!1,error:l,model:o=null,reasoningEffort:c=null,fastMode:d=!1,collaborationMode:m="default",modelOptions:p=[],contextUsage:g=null,followTail:y=!1,threadConnected:E=!0,disabled:v=!1,disabledPlaceholder:k,shellControlState:C=null,draftPrompt:S,draftAttachments:A,skillsState:N={status:"idle",data:null,error:null},mcpState:U={status:"idle",data:null,error:null},goalState:G={status:"idle",data:null,error:null},forkTurnOptionsState:P={status:"idle",data:null,error:null},onDraftChange:H,onSubmit:Y,onInterrupt:ue,onCompact:M,onOpenSkills:K,onOpenMcp:F,onOpenGoal:ge,onUpdateGoal:ce,onOpenForkTurns:ne,onForkLatest:z,onForkTurn:ee,onReadCodexConfig:ke,onWriteCodexConfig:Be,onToggleFollow:L,onUpdateSettings:$,onToggleView:ae,onShellCopy:O,onShellControl:_e,canInterrupt:Re=!1}){var Hi,ti,Ls,W,J,de,De,Ue,pt;const[we,et]=T.useState({prompt:"",attachments:[]}),[Fe,Ie]=T.useState(null),[kt,at]=T.useState("root"),[Nt,Gt]=T.useState("list"),[Ut,Tt]=T.useState(""),[rt,on]=T.useState(""),[it,lt]=T.useState(""),[ht,mn]=T.useState(null),[rn,An]=T.useState(!1),[qt,Zt]=T.useState(null),[me,Ce]=T.useState(null),[Ze,ot]=T.useState(null),[dt,Qt]=T.useState(!1),[Ht,xe]=T.useState(!1),[Le,Ke]=T.useState(""),[$e,nt]=T.useState(!1),[Q,ve]=T.useState(null),ut=T.useRef(null),He=T.useRef(null),We=T.useRef(null),xt=T.useRef(null),Ct=T.useRef(null),Qe=T.useRef([]),yt=T.useRef(null),Nn=T.useRef(new Map),or=T.useRef(""),dn=T.useRef(0),Yt=e==="shell",Ss=!!(Yt&&(C!=null&&C.isMobileShell)),Li=(C==null?void 0:C.promptLabel)??null,[Hr,Ya]=T.useState({}),[Ii,Sa]=T.useState(!1),[oa,pr]=T.useState(0),ft=!Yt&&S!==void 0&&A!==void 0&&typeof H=="function",vt=ft?S:we.prompt,Xn=ft?A:we.attachments;T.useEffect(()=>{Fe!=="slash"&&(at("root"),Gt("list"),Zt(null),Ce(null))},[Fe]),T.useEffect(()=>{kt!=="mcp"&&(Gt("list"),Zt(null),Ce(null))},[kt]),T.useEffect(()=>{kt!=="forkTurns"&&Qt(!1)},[kt]),T.useEffect(()=>{if(!Ze)return;const I=window.setTimeout(()=>{ot(fe=>fe===Ze?null:fe)},1400);return()=>{window.clearTimeout(I)}},[Ze]);function Tn(I){if(ft){H==null||H(fe=>I({prompt:fe.prompt,attachments:fe.attachments}));return}et(fe=>I(fe))}function Mo(I){Tn(fe=>{if(typeof I=="function"){const Ee=I(fe.prompt,fe.attachments);return{prompt:Ee.prompt,attachments:Ee.attachments??fe.attachments}}return{prompt:I,attachments:fe.attachments}})}async function Po(I){try{await navigator.clipboard.writeText(`$${I}`),ot(I)}catch{ot(null)}}async function Oi(){if(z){Qt(!0);try{await z(),Ie(null)}finally{Qt(!1)}}}async function ua(I){if(ee){Qt(!0);try{await ee(I),Ie(null)}finally{Qt(!1)}}}async function As(){const I=vt.trim();if(!I){ve("Goal objective cannot be empty.");return}const fe=Le.trim(),Ee=F6(fe);if(fe.length>0&&(Ee===null||!Number.isInteger(Ee)||Ee<=0)){ve("Token budget must be a positive number in thousands.");return}if(!ce){ve("/goal is unavailable in this view.");return}nt(!0),ve(null);try{await ce({objective:I,status:"active",tokenBudget:Ee}),Ke(""),xe(!1),Tn(()=>({prompt:"",attachments:[]}))}catch(Ge){ve(Ge instanceof Error?Ge.message:"Unable to set goal.")}finally{nt(!1)}}function ca(){var I;Ie(null),at("root"),xe(!0),Ke($6((I=G.data)==null?void 0:I.tokenBudget)),ve(null),ge==null||ge(),requestAnimationFrame(()=>{var fe;(fe=He.current)==null||fe.focus()})}function da(){xe(!1),ve(null)}const zr=T.useMemo(()=>p.find(I=>I.model===o)??null,[o,p]),Fr=Y6(o,g),pn=(zr==null?void 0:zr.supportedReasoningEfforts)??[],Di=T.useMemo(()=>j6(vt,Xn),[Xn,vt]),Wa=T.useMemo(()=>Object.entries(Hr).sort(([I],[fe])=>I.localeCompare(fe)).map(([I,fe])=>`${I}:${fe}`).join("|"),[Hr]);async function gr(){if(!ke)throw new Error("config.toml editing is unavailable in this view.");const I=await ke();return mn(I.path),I}async function Cr(I){if(!Be)throw new Error("config.toml editing is unavailable in this view.");const fe=await Be(I);return mn(fe.path),fe}async function Aa(){const I=V6(Ut),fe=rt.trim();if(!I){Zt("MCP name must use only letters, numbers, underscore, or hyphen.");return}if(!/^https?:\/\//i.test(fe)){Zt("HTTP MCP URL must start with http:// or https://");return}An(!0),Zt(null),Ce(null);try{const Ee=await gr(),Ge=OE(Ee.content,I,q6(I,fe));await Cr(Ge),Ce("MCP entry written to config.toml. Restart Codex service if it does not appear immediately."),Gt("list"),Tt(""),on(""),F==null||F()}catch(Ee){Zt(Ee instanceof Error?Ee.message:"Unable to update config.toml.")}finally{An(!1)}}async function vn(){An(!0),Zt(null),Ce(null);try{await gr(),it.trim()||lt(`[mcp_servers.example_stdio]
|
|
77
|
+
command = "npx"
|
|
78
|
+
args = ["-y", "your-mcp-server"]
|
|
79
|
+
`),Gt("stdio")}catch(I){Zt(I instanceof Error?I.message:"Unable to load config.toml.")}finally{An(!1)}}async function yl(){const I=G6(it);if(!I){Zt("The raw MCP block must start with a header like [mcp_servers.name].");return}An(!0),Zt(null),Ce(null);try{const fe=await gr(),Ee=OE(fe.content,I,it);await Cr(Ee),Ce("MCP entry written to config.toml. Restart Codex service if it does not appear immediately."),Gt("list"),F==null||F()}catch(fe){Zt(fe instanceof Error?fe.message:"Unable to update config.toml.")}finally{An(!1)}}T.useEffect(()=>{if(Yt){Ya({});return}const I={},fe=new Set;for(const Ee of Xn){if(Ee.kind!=="photo")continue;fe.add(Ee.clientId);let Ge=Nn.current.get(Ee.clientId);Ge||(Ge=URL.createObjectURL(Ee.file),Nn.current.set(Ee.clientId,Ge)),I[Ee.clientId]=Ge}for(const[Ee,Ge]of Nn.current.entries())fe.has(Ee)||(URL.revokeObjectURL(Ge),Nn.current.delete(Ee));Ya(I)},[Xn,Yt]),T.useEffect(()=>()=>{for(const I of Nn.current.values())URL.revokeObjectURL(I);Nn.current.clear()},[]);function Sr(){const I=He.current,fe=window.getSelection();if(!I||!fe||fe.rangeCount===0)return null;const Ee=fe.getRangeAt(0);return!I.contains(Ee.startContainer)||!I.contains(Ee.endContainer)?null:{start:Qa(I,Ee.startContainer,Ee.startOffset),end:Qa(I,Ee.endContainer,Ee.endOffset)}}function Qa(I,fe,Ee){var pe;let Ge=null,qe=Ee;if(fe===I){const Ae=Array.from(I.childNodes);let Pe=0;for(let mt=0;mt<Math.min(Ee,Ae.length);mt+=1){const ze=Ae[mt];ze&&(Pe+=Ws(ze).length)}return Pe}if(fe.nodeType===Node.TEXT_NODE)Ge=fe;else{const Ae=Array.from(I.childNodes).find(Pe=>Pe.contains(fe));if(!Ae)return ji().length;if(Ge=Ae,Ae instanceof HTMLElement&&Ae.dataset.segmentType==="attachment"){const Pe=document.createRange();Pe.selectNodeContents(Ae);const mt=Ws(Ae).length;try{Pe.setEnd(fe,Ee);const ze=Pe.toString().length,Et=((pe=Ae.textContent)==null?void 0:pe.length)??0;Et===0?qe=mt:qe=Math.round(Math.min(1,ze/Et)*mt)}catch{qe=mt}}else{const Pe=document.createRange();Pe.selectNodeContents(Ae);try{Pe.setEnd(fe,Ee),qe=Pe.toString().length}catch{qe=Ws(Ae).length}}}const je=Array.from(I.childNodes);let Me=0;for(const Ae of je){if(Ae===Ge)return Ae.nodeType===Node.TEXT_NODE?Me+qe:Me+Math.min(qe,Ws(Ae).length);Me+=Ws(Ae).length}return Me}function fa(I,fe){let Ee=Math.max(0,fe);const Ge=Array.from(I.childNodes);for(const[qe,je]of Ge.entries()){const pe=Ws(je).length;if(je.nodeType===Node.TEXT_NODE){if(Ee<=pe)return{node:je,offset:Ee};Ee-=pe;continue}if(je instanceof HTMLElement&&je.dataset.segmentType==="attachment"){if(Ee===0)return{node:I,offset:qe};if(Ee<=pe){const Ae=Ge[qe+1];return Ee===pe&&(Ae==null?void 0:Ae.nodeType)===Node.TEXT_NODE?{node:Ae,offset:0}:{node:I,offset:qe+1}}Ee-=pe;continue}if(Ee<=pe)return{node:I,offset:qe+1};Ee-=pe}return{node:I,offset:I.childNodes.length}}function tr(I){const fe=He.current;if(!fe||!I)return;const Ee=fa(fe,I.start),Ge=fa(fe,I.end),qe=document.createRange();qe.setStart(Ee.node,Ee.offset),qe.setEnd(Ge.node,Ge.offset);const je=window.getSelection();je==null||je.removeAllRanges(),je==null||je.addRange(qe)}function Vn(I){const fe=Qe.current;if(fe.length===0)return!1;const Ee=fe.at(-1);if(!Ee)return!1;const Ge=Array.from(I.childNodes).find(pe=>pe instanceof HTMLElement&&pe.dataset.segmentType==="attachment"&&pe.dataset.clientId===Ee);if(!(Ge instanceof HTMLElement))return!1;const qe=document.createRange(),je=Ge.nextSibling;(je==null?void 0:je.nodeType)===Node.TEXT_NODE?qe.setStart(je,0):qe.setStartAfter(Ge),qe.collapse(!0);const Me=window.getSelection();return Me==null||Me.removeAllRanges(),Me==null||Me.addRange(qe),!0}function ji(){const I=He.current;if(!I)return vt;let fe="";for(const Ee of Array.from(I.childNodes))fe+=Ws(Ee);return LE(fe)}function Ns(I,fe,Ee){const Ge=I==="photo"?"PHOTO":"FILE";let qe=0;for(;;){const je=qe===0?fe:`${fe} (${qe+1})`,Me=`[${Ge} ${je}]`;if(!Ee.has(Me))return Me;qe+=1}}function Mi(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`attachment-${Date.now()}-${Math.random().toString(36).slice(2,10)}`}function Xa(I,fe,Ee){const Ge=fe.start>0?I[fe.start-1]:"",qe=fe.end<I.length?I[fe.end]:"",je=!!(Ge&&!/\s/.test(Ge)),Me=!qe||!/\s/.test(qe);return`${je?" ":""}${Ee.join(" ")}${Me?" ":""}`}function ha(I,fe){if(!I||I.length===0)return;const Ee=Array.from(I),Ge=new Set(Xn.map(ze=>ze.placeholder)),qe=Ee.map(ze=>{const Et=DE(ze,fe),un=Ns(fe,jE(Et),Ge);return Ge.add(un),{clientId:Mi(),kind:fe,originalName:Et,placeholder:un,file:ze}}),je=Sr()??yt.current,Me=je?{start:je.start,end:je.end}:{start:vt.length,end:vt.length},pe=Xa(vt,Me,qe.map(ze=>ze.placeholder)),Ae=`${vt.slice(0,Me.start)}${pe}${vt.slice(Me.end)}`;Tn(ze=>({prompt:Ae,attachments:[...ze.attachments,...qe]}));const Pe=pe.endsWith(" ")?1:0,mt=Me.start+pe.length-Pe;Ct.current={start:mt,end:mt},yt.current={start:mt,end:mt},Qe.current=qe.map(ze=>ze.clientId),Ie(null)}function Pi(I){if(I.length===0)return;const fe={photo:I.filter(ze=>_p(ze)==="photo"),file:I.filter(ze=>_p(ze)==="file")},Ee=[...fe.photo,...fe.file],Ge=new Set(Xn.map(ze=>ze.placeholder)),qe=Ee.map(ze=>{const Et=_p(ze),un=DE(ze,Et),In=Ns(Et,jE(un),Ge);return Ge.add(In),{clientId:Mi(),kind:Et,originalName:un,placeholder:In,file:ze}}),je=Sr()??yt.current,Me=je?{start:je.start,end:je.end}:{start:vt.length,end:vt.length},pe=Xa(vt,Me,qe.map(ze=>ze.placeholder)),Ae=`${vt.slice(0,Me.start)}${pe}${vt.slice(Me.end)}`;Tn(ze=>({prompt:Ae,attachments:[...ze.attachments,...qe]}));const Pe=pe.endsWith(" ")?1:0,mt=Me.start+pe.length-Pe;Ct.current={start:mt,end:mt},yt.current={start:mt,end:mt},Qe.current=qe.map(ze=>ze.clientId),Ie(null)}function Rn(I){if(!I)return;const fe=Sr()??yt.current,Ee=(fe==null?void 0:fe.start)??vt.length,Ge=(fe==null?void 0:fe.end)??Ee,qe=LE(I),je=`${vt.slice(0,Ee)}${qe}${vt.slice(Ge)}`;Tn(pe=>({prompt:je,attachments:pe.attachments}));const Me=Ee+qe.length;Ct.current={start:Me,end:Me},yt.current={start:Me,end:Me}}T.useEffect(()=>{function I(fe){(typeof fe.composedPath=="function"?fe.composedPath():[]).some(qe=>qe instanceof HTMLElement&&(qe.dataset.composerMenuSurface==="true"||qe.dataset.composerMenuTrigger==="true"))||Fe&&Ie(null)}if(Fe)return window.addEventListener("pointerdown",I),()=>{window.removeEventListener("pointerdown",I)}},[Fe]),T.useLayoutEffect(()=>{const I=He.current;if(!I||Yt)return;const fe=Ct.current,Ee=ji()!==vt||or.current!==Wa||dn.current!==oa;if(Ee){const Ge=document.createDocumentFragment();for(const qe of Di){if(qe.type==="text"){Ge.append(document.createTextNode(qe.text===" "?" ":qe.text));continue}const je=qe.attachment,Me=document.createElement("span");if(Me.dataset.segmentType="attachment",Me.dataset.clientId=je.clientId,Me.dataset.placeholder=je.placeholder,Me.contentEditable="false",Me.className="mx-[0.12rem] inline-flex max-w-full align-baseline",je.kind==="photo"){Me.classList.add("rounded-[0.95rem]","border","border-sky-300/35","bg-sky-300/10","p-1","shadow-sm","shadow-stone-950/20");const pe=Hr[je.clientId];if(pe){const Pe=document.createElement("img");Pe.src=pe,Pe.alt=je.originalName||"Pasted image",Pe.className="h-[4.5rem] w-[6rem] rounded-[0.7rem] bg-stone-950 object-contain",Pe.draggable=!1,Me.append(Pe)}else{const Pe=document.createElement("span");Pe.className="inline-block h-[4.5rem] w-[6rem] rounded-[0.7rem] bg-stone-900/80",Pe.setAttribute("aria-hidden","true"),Me.append(Pe)}const Ae=document.createElement("span");Ae.className="ml-2 inline-flex max-w-[8rem] items-center text-[10px] font-medium tracking-[0.08em] text-sky-50",Ae.textContent=PE(je),Me.append(Ae)}else{Me.classList.add("items-center","gap-2","rounded-[0.95rem]","border","border-emerald-300/35","bg-emerald-300/10","px-2.5","py-2","text-[10px]","font-medium","tracking-[0.08em]","text-emerald-50","shadow-sm","shadow-stone-950/20");const pe=document.createElement("span");pe.className="inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-full border border-emerald-200/25 bg-emerald-300/12 text-[9px]",pe.textContent="FILE";const Ae=document.createElement("span");Ae.className="inline-flex max-w-[10rem] truncate",Ae.textContent=PE(je),Me.append(pe,Ae)}Ge.append(Me)}I.replaceChildren(Ge),or.current=Wa,dn.current=oa}fe!==null?(I.focus(),Vn(I)||tr(fe),yt.current=fe):document.activeElement===I&&Ee&&tr(yt.current),Ct.current=null,Qe.current=[]},[Hr,oa,Yt,Wa,vt,Di]);function Ln(){var I;(I=He.current)==null||I.blur(),document.activeElement instanceof HTMLElement&&document.activeElement!==document.body&&document.activeElement.blur()}async function Rs(){var I;if(Ln(),Ie(null),!!((I=navigator.clipboard)!=null&&I.readText))try{const fe=await navigator.clipboard.readText();Rn(fe)}catch{return}}async function Bi(){if(Ht&&!Yt){await As();return}if(!Yt&&!vt.trim())return;const I=Yt?vt:vt.trim(),fe=Yt?[]:Xn.filter(Ee=>I.includes(Ee.placeholder));await Y(fe.length>0?{prompt:I,attachments:fe}:{prompt:I}),Tn(()=>({prompt:"",attachments:[]}))}async function Na(I){I.preventDefault(),await Bi()}function El(){const I=ji(),fe=Sr();yt.current=fe;const Ee=He.current;(Ee?D6(Ee):!1)&&(Ct.current=fe,pr(qe=>qe+1)),Tn(qe=>({prompt:I,attachments:qe.attachments.filter(je=>I.includes(je.placeholder))}))}function _l(I){var Ee,Ge,qe,je;const fe=w0((Ee=I.clipboardData)==null?void 0:Ee.items,(Ge=I.clipboardData)==null?void 0:Ge.files);if(fe.length===0){const Me=((qe=I.clipboardData)==null?void 0:qe.getData("text/plain"))??"",pe=((je=I.clipboardData)==null?void 0:je.getData("text/html"))??"",Ae=Me||O6(pe);if(!Ae&&!pe)return;I.preventDefault(),Rn(Ae);return}I.preventDefault(),Pi(fe)}function Ra(I){var fe,Ee;ME((fe=I.dataTransfer)==null?void 0:fe.items,(Ee=I.dataTransfer)==null?void 0:Ee.files)&&(I.preventDefault(),Sa(!0))}function Bo(I){var fe,Ee;ME((fe=I.dataTransfer)==null?void 0:fe.items,(Ee=I.dataTransfer)==null?void 0:Ee.files)&&(I.preventDefault(),I.dataTransfer&&(I.dataTransfer.dropEffect="copy"),Sa(!0))}function La(I){I.currentTarget.contains(I.relatedTarget)||Sa(!1)}function Ka(I){var Ee,Ge;const fe=w0((Ee=I.dataTransfer)==null?void 0:Ee.items,(Ge=I.dataTransfer)==null?void 0:Ge.files);fe.length!==0&&(I.preventDefault(),Sa(!1),Pi(fe))}function Za(I){I.key==="Enter"&&(!I.metaKey&&!I.ctrlKey||(I.preventDefault(),!(n||v)&&Bi()))}async function ma(I){await($==null?void 0:$(I)),Ie(null)}const Tl=Ht?"Describe the goal Codex should continue working toward...":k??(Yt?"Send shell input to the attached terminal...":"Ask Codex to inspect, modify, or explain code..."),Ja=Yt?"Send Ctrl-C":"Stop Current Turn",br=Ht?$e?"Setting...":"Set goal":!E&&n?"Connecting...":E&&n&&!Yt?"Sending...":"Send",Ui=E?Ht?"ui-action-info":"ui-action-primary":"ui-action-danger",ei=r,Ia=t||Ss?"relative z-20 shrink-0 bg-transparent px-3 pb-0 pt-3 sm:p-4":"relative z-20 shrink-0 bg-transparent px-3 pb-3 pt-0 sm:px-4 sm:pb-4 sm:pt-0",$r=`thread-composer-input min-h-[7.25rem] w-full rounded-[1.25rem] border px-4 pr-14 pt-2.5 outline-none transition sm:min-h-[6.25rem] ${Ii?"is-drag-target border-sky-300/80 bg-sky-300/[0.08] shadow-[0_0_0_1px_rgba(125,211,252,0.2)]":"border-stone-700 focus-within:border-[var(--theme-accent-border)]"}`;return h.jsxs("div",{className:"relative z-20 shrink-0",children:[h.jsx("input",{ref:We,type:"file",accept:"image/*",multiple:!0,tabIndex:-1,className:"sr-only",onChange:I=>{ha(I.target.files,"photo"),I.target.value=""}}),h.jsx("input",{ref:xt,type:"file",multiple:!0,tabIndex:-1,className:"sr-only",onChange:I=>{ha(I.target.files,"file"),I.target.value=""}}),e==="chat"&&h.jsx("button",{type:"button","aria-label":"Jump to latest",title:y?"Latest turn is in view":"Jump to the latest messages",onClick:()=>L==null?void 0:L(),className:"absolute left-1/2 top-3 z-40 inline-flex h-9 min-w-[5.75rem] -translate-x-1/2 -translate-y-[62%] items-start justify-center bg-transparent pt-1 touch-manipulation sm:top-4",children:h.jsx("span",{className:`thread-jump-latest-badge pointer-events-none inline-flex h-4 min-w-[3.75rem] items-center justify-center rounded-[0.7rem] border shadow-sm transition ${y?"is-active border-sky-300/36 bg-sky-300/[0.03] text-sky-100/86":"border-stone-500/70 bg-stone-950/[0.08] text-stone-200/86"}`,children:h.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:h.jsx("path",{d:"m4 6 4 4 4-4"})})})}),h.jsxs("form",{ref:ut,onSubmit:Na,className:Ia,children:[h.jsxs("div",{className:"thread-composer-toolbar relative z-30 mb-0 flex items-center gap-2 rounded-full border px-2.5 py-1.5 text-xs shadow-lg shadow-stone-950/8",children:[h.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[!Yt&&h.jsxs("div",{className:"relative",children:[h.jsx("button",{type:"button","data-composer-menu-trigger":"true","aria-label":"Open slash toolbox",title:"Open slash toolbox",onClick:()=>Ie(I=>I==="slash"?null:"slash"),className:"thread-composer-icon-button inline-flex h-7 w-7 items-center justify-center rounded-full border border-stone-700 bg-stone-900/92 text-stone-200 transition hover:bg-stone-800",children:h.jsx(B6,{})}),Fe==="slash"&&h.jsx("div",{"data-composer-menu-surface":"true",className:"thread-composer-menu absolute bottom-full left-0 z-40 mb-2 w-72 overflow-hidden rounded-2xl border bg-stone-900/72 shadow-2xl shadow-stone-950/20 backdrop-blur-xl",onClick:I=>{I.stopPropagation()},onMouseDown:I=>{I.stopPropagation()},onPointerDown:I=>{I.stopPropagation()},onTouchStart:I=>{I.stopPropagation()},children:kt==="root"?h.jsxs("div",{className:"p-2",children:[h.jsx("button",{type:"button",disabled:r,onClick:()=>{ma({fastMode:!d})},className:`block w-full rounded-xl px-3 py-2 text-left text-sm transition disabled:cursor-not-allowed disabled:opacity-60 ${d?"ui-status-warning":"thread-composer-menu-item"}`,children:h.jsxs("div",{className:"flex items-center justify-between gap-3",children:[h.jsx("span",{children:"/fast"}),h.jsx("span",{className:"text-[11px] uppercase tracking-[0.16em] text-stone-400",children:d?"On":"Off"})]})}),h.jsx("button",{type:"button",disabled:s||n,onClick:()=>{Ie(null),M==null||M()},className:"thread-composer-menu-item mt-1 block w-full rounded-xl px-3 py-2 text-left text-sm transition disabled:cursor-not-allowed disabled:opacity-60",children:h.jsxs("div",{className:"flex items-center justify-between gap-3",children:[h.jsx("span",{children:"/compact"}),h.jsx("span",{className:"text-[11px] uppercase tracking-[0.16em] text-stone-400",children:s?"Busy":"Run"})]})}),h.jsx("button",{type:"button",onClick:I=>{I.stopPropagation(),Ht?(da(),Ie(null)):ca()},className:`mt-1 block w-full rounded-xl px-3 py-2 text-left text-sm transition ${Ht||((Hi=G.data)==null?void 0:Hi.status)==="active"?"ui-status-warning":"thread-composer-menu-item"}`,children:h.jsxs("div",{className:"flex items-center justify-between gap-3",children:[h.jsx("span",{children:"/goal"}),h.jsx("span",{className:"text-[11px] uppercase tracking-[0.16em] text-stone-400",children:Ht?"Composing":G.data?z6(G.data.status):"Open"})]})}),h.jsx("button",{type:"button",disabled:n||dt,onClick:I=>{I.stopPropagation(),at("fork")},className:"thread-composer-menu-item mt-1 block w-full rounded-xl px-3 py-2 text-left text-sm transition disabled:cursor-not-allowed disabled:opacity-60",children:h.jsxs("div",{className:"flex items-center justify-between gap-3",children:[h.jsx("span",{children:"/fork"}),h.jsx("span",{className:"text-[11px] uppercase tracking-[0.16em] text-stone-400",children:n?"Idle only":"Open"})]})}),h.jsx("button",{type:"button",onClick:I=>{I.stopPropagation(),at("skills"),K==null||K()},className:"thread-composer-menu-item mt-1 block w-full rounded-xl px-3 py-2 text-left text-sm transition",children:h.jsxs("div",{className:"flex items-center justify-between gap-3",children:[h.jsx("span",{children:"/skills"}),h.jsx("span",{className:"text-[11px] uppercase tracking-[0.16em] text-stone-400",children:"View"})]})}),h.jsx("button",{type:"button",onClick:I=>{I.stopPropagation(),at("mcp"),F==null||F()},className:"thread-composer-menu-item mt-1 block w-full rounded-xl px-3 py-2 text-left text-sm transition",children:h.jsxs("div",{className:"flex items-center justify-between gap-3",children:[h.jsx("span",{children:"/mcp"}),h.jsx("span",{className:"text-[11px] uppercase tracking-[0.16em] text-stone-400",children:"View"})]})})]}):h.jsx("div",{className:"max-h-80 overflow-auto",children:kt==="fork"?h.jsxs("div",{className:"p-2",children:[h.jsx("button",{type:"button",disabled:n||dt,onClick:()=>void Oi(),className:"thread-composer-menu-item block w-full rounded-xl px-3 py-2 text-left text-sm transition disabled:cursor-not-allowed disabled:opacity-60",children:h.jsxs("div",{className:"flex items-center justify-between gap-3",children:[h.jsx("span",{children:"Fork from latest"}),h.jsx("span",{className:"text-[11px] uppercase tracking-[0.16em] text-stone-400",children:dt?"Forking":"Run"})]})}),h.jsx("button",{type:"button",disabled:n||dt,onClick:I=>{I.stopPropagation(),at("forkTurns"),ne==null||ne()},className:"thread-composer-menu-item mt-1 block w-full rounded-xl px-3 py-2 text-left text-sm transition disabled:cursor-not-allowed disabled:opacity-60",children:h.jsxs("div",{className:"flex items-center justify-between gap-3",children:[h.jsx("span",{children:"Fork from selected turn"}),h.jsx("span",{className:"text-[11px] uppercase tracking-[0.16em] text-stone-400",children:"Pick"})]})}),n?h.jsx("p",{className:"mt-2 rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3 text-sm text-stone-400",children:"Fork is only available while the thread is idle."}):null]}):kt==="forkTurns"?h.jsxs("div",{className:"p-2",children:[P.status==="loading"&&!P.data?h.jsx("p",{className:"rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3 text-sm text-stone-400",children:"Loading turns…"}):null,P.error?h.jsx("p",{className:"mb-2 rounded-xl border border-rose-500/35 bg-rose-500/10 px-3 py-3 text-sm text-rose-100/90",children:P.error}):null,(ti=P.data)!=null&&ti.length?h.jsx("div",{className:"space-y-2",children:P.data.map(I=>h.jsx("button",{type:"button",disabled:dt,onClick:()=>void ua(I.turnId),className:"thread-composer-panel-button block w-full rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3 text-left transition disabled:cursor-not-allowed disabled:opacity-60",children:h.jsxs("div",{className:"flex items-center justify-between gap-3",children:[h.jsxs("span",{className:"text-sm text-stone-100",children:["Turn ",I.turnIndex]}),h.jsx("span",{className:"text-[11px] uppercase tracking-[0.16em] text-stone-500",children:dt?"Forking":I.status})]})},I.turnId))}):null,P.status!=="loading"&&!P.error&&(((Ls=P.data)==null?void 0:Ls.length)??0)===0?h.jsx("p",{className:"rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3 text-sm text-stone-400",children:"No turns available to fork yet."}):null]}):kt==="skills"?h.jsxs("div",{className:"p-2",children:[N.status==="loading"&&!N.data?h.jsx("p",{className:"rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3 text-sm text-stone-400",children:"Loading skills…"}):null,N.error?h.jsx("p",{className:"mb-2 rounded-xl border border-rose-500/35 bg-rose-500/10 px-3 py-3 text-sm text-rose-100/90",children:N.error}):null,(W=N.data)!=null&&W.skills.length?h.jsx("div",{className:"space-y-2",children:N.data.skills.map(I=>{var fe,Ee;return h.jsx("div",{className:"rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-2.5",children:h.jsxs("div",{className:"space-y-2",children:[h.jsx("p",{className:"truncate text-sm font-medium text-stone-100",children:((fe=I.interface)==null?void 0:fe.displayName)??I.name}),h.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 text-[10px] uppercase tracking-[0.14em]",children:[h.jsx("span",{className:"rounded-full border border-stone-700 px-2 py-1 text-stone-400",children:H6(I.scope)}),h.jsxs("button",{type:"button",className:`inline-flex items-center gap-1 rounded-full border px-2 py-1 normal-case tracking-normal transition ${Ze===I.name?"border-emerald-400/45 bg-emerald-400/12 text-emerald-100":"thread-composer-chip-button border-stone-700 text-stone-300 hover:border-stone-500"}`,onClick:()=>void Po(I.name),title:`Copy $${I.name}`,"aria-label":`Copy $${I.name}`,children:[h.jsx(Tp,{}),"$",I.name]})]}),h.jsx("p",{className:"text-xs leading-5 text-stone-400",children:((Ee=I.interface)==null?void 0:Ee.shortDescription)??I.shortDescription??I.description})]})},I.path)})}):null,(J=N.data)!=null&&J.errors.length?h.jsx("div",{className:"mt-2 space-y-2",children:N.data.errors.map(I=>h.jsxs("div",{className:"rounded-xl border border-amber-500/25 bg-amber-500/10 px-3 py-2 text-xs text-amber-100/85",children:[h.jsx("p",{className:"font-medium",children:I.message}),h.jsx("p",{className:"mt-1 break-all text-amber-100/60",children:I.path})]},`${I.path}:${I.message}`))}):null,N.status!=="loading"&&!N.error&&(((de=N.data)==null?void 0:de.skills.length)??0)===0&&(((De=N.data)==null?void 0:De.errors.length)??0)===0?h.jsx("p",{className:"rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3 text-sm text-stone-400",children:"No skills available right now."}):null]}):h.jsxs("div",{className:"p-2",children:[h.jsxs("div",{className:"mb-2 flex items-center justify-between gap-2",children:[h.jsxs("div",{className:"min-w-0",children:[h.jsx("p",{className:"text-xs text-stone-400",children:"MCP config source"}),h.jsx("p",{className:"truncate text-[11px] text-stone-500",children:ht??"~/.codex/config.toml"})]}),Nt==="list"?h.jsx("button",{type:"button",onClick:I=>{I.stopPropagation(),Gt("add"),Zt(null),Ce(null)},className:"shrink-0 rounded-full border border-sky-300/35 px-3 py-1.5 text-xs text-sky-100 transition hover:bg-sky-300/10",children:"Add MCP"}):null]}),U.status==="loading"&&!U.data?h.jsx("p",{className:"rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3 text-sm text-stone-400",children:"Loading MCP servers…"}):null,U.error?h.jsx("p",{className:"mb-2 rounded-xl border border-rose-500/35 bg-rose-500/10 px-3 py-3 text-sm text-rose-100/90",children:U.error}):null,qt?h.jsx("p",{className:"mb-2 rounded-xl border border-rose-500/35 bg-rose-500/10 px-3 py-3 text-sm text-rose-100/90",children:qt}):null,me?h.jsx("p",{className:"mb-2 rounded-xl border border-emerald-500/35 bg-emerald-500/10 px-3 py-3 text-sm text-emerald-100/90",children:me}):null,Nt==="add"?h.jsxs("div",{className:"space-y-2",children:[h.jsxs("button",{type:"button",onClick:I=>{I.stopPropagation(),Gt("http"),Zt(null),Ce(null)},className:"thread-composer-panel-button block w-full rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3 text-left transition",children:[h.jsxs("div",{className:"flex items-center justify-between gap-3",children:[h.jsx("span",{className:"text-sm text-stone-100",children:"HTTP / Streamable HTTP"}),h.jsx("span",{className:"text-[11px] uppercase tracking-[0.16em] text-stone-500",children:"Form"})]}),h.jsx("p",{className:"mt-1 text-xs text-stone-400",children:"Add an MCP server with a name and URL, then write the matching block into config.toml."})]}),h.jsxs("button",{type:"button",onClick:I=>{I.stopPropagation(),vn()},className:"thread-composer-panel-button block w-full rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3 text-left transition",children:[h.jsxs("div",{className:"flex items-center justify-between gap-3",children:[h.jsx("span",{className:"text-sm text-stone-100",children:"stdio / raw block"}),h.jsx("span",{className:"text-[11px] uppercase tracking-[0.16em] text-stone-500",children:"TOML"})]}),h.jsx("p",{className:"mt-1 text-xs text-stone-400",children:"Write a single `[mcp_servers.name]` block, then save it back into config.toml."})]})]}):null,Nt==="http"?h.jsxs("div",{className:"space-y-2 rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3",children:[h.jsxs("div",{children:[h.jsx("label",{className:"mb-1 block text-xs text-stone-400",children:"MCP name"}),h.jsx("input",{"aria-label":"MCP name",value:Ut,onChange:I=>Tt(I.target.value),placeholder:"openaiDeveloperDocs",className:"w-full rounded-lg border border-stone-700 bg-stone-950 px-3 py-2 text-sm text-stone-100 outline-none placeholder:text-stone-500 focus:border-sky-300/50"})]}),h.jsxs("div",{children:[h.jsx("label",{className:"mb-1 block text-xs text-stone-400",children:"URL"}),h.jsx("input",{"aria-label":"URL",value:rt,onChange:I=>on(I.target.value),placeholder:"https://developers.openai.com/mcp",className:"w-full rounded-lg border border-stone-700 bg-stone-950 px-3 py-2 text-sm text-stone-100 outline-none placeholder:text-stone-500 focus:border-sky-300/50"})]}),h.jsxs("div",{className:"flex items-center justify-between gap-2 pt-1",children:[h.jsx("button",{type:"button",onClick:()=>Gt("add"),className:"thread-composer-chip-button rounded-full border border-stone-700 px-3 py-1.5 text-xs text-stone-300 transition",children:"Back"}),h.jsx("button",{type:"button",onClick:()=>void Aa(),disabled:rn,className:"ui-status-info rounded-full px-3 py-1.5 text-xs transition disabled:cursor-not-allowed disabled:opacity-60",children:rn?"Saving…":"Write HTTP MCP"})]})]}):null,Nt==="stdio"?h.jsxs("div",{className:"space-y-2 rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3",children:[h.jsx("label",{className:"block text-xs text-stone-400",children:"MCP block for config.toml"}),h.jsx("textarea",{"aria-label":"MCP block for config.toml",value:it,onChange:I=>lt(I.target.value),rows:8,className:"w-full rounded-lg border border-stone-700 bg-stone-950 px-3 py-2 text-sm text-stone-100 outline-none placeholder:text-stone-500 focus:border-sky-300/50"}),h.jsxs("div",{className:"flex items-center justify-between gap-2 pt-1",children:[h.jsx("button",{type:"button",onClick:()=>Gt("add"),className:"thread-composer-chip-button rounded-full border border-stone-700 px-3 py-1.5 text-xs text-stone-300 transition",children:"Back"}),h.jsx("button",{type:"button",onClick:()=>void yl(),disabled:rn,className:"ui-status-info rounded-full px-3 py-1.5 text-xs transition disabled:cursor-not-allowed disabled:opacity-60",children:rn?"Saving…":"Write raw block"})]})]}):null,Nt==="list"&&((Ue=U.data)!=null&&Ue.servers.length)?h.jsx("div",{className:"space-y-2",children:U.data.servers.map(I=>h.jsxs("div",{className:"rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-2.5",children:[h.jsxs("div",{className:"flex items-start justify-between gap-3",children:[h.jsxs("div",{className:"min-w-0",children:[h.jsx("p",{className:"truncate text-sm font-medium text-stone-100",children:I.name}),h.jsxs("p",{className:"mt-0.5 text-xs text-stone-400",children:[I.tools.length," tools · ",I.resourceCount," ","resources · ",I.resourceTemplateCount," templates"]})]}),h.jsx("span",{className:"shrink-0 rounded-full border border-stone-700 px-2 py-1 text-[10px] uppercase tracking-[0.14em] text-stone-300",children:U6(I.authStatus)})]}),I.tools.length>0?h.jsx("p",{className:"mt-2 line-clamp-2 text-xs text-stone-500",children:I.tools.slice(0,4).map(fe=>fe.title??fe.name).join(" · ")}):null]},I.name))}):null,Nt==="list"&&U.status!=="loading"&&!U.error&&(((pt=U.data)==null?void 0:pt.servers.length)??0)===0?h.jsx("p",{className:"rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3 text-sm text-stone-400",children:"No MCP servers available right now."}):null]})})})]}),!Yt&&h.jsxs("div",{className:"relative",children:[h.jsx("button",{type:"button","data-composer-menu-trigger":"true","aria-label":"Add attachment",title:"Add attachment",onClick:()=>Ie(I=>I==="attachments"?null:"attachments"),className:"thread-composer-icon-button inline-flex h-7 w-7 items-center justify-center rounded-full border border-stone-700 bg-stone-900/92 text-stone-200 transition hover:bg-stone-800",children:h.jsx(P6,{})}),Fe==="attachments"&&h.jsx("div",{"data-composer-menu-surface":"true",className:"thread-composer-menu absolute left-0 top-full mt-2 w-32 overflow-hidden rounded-2xl border bg-stone-900/72 shadow-2xl shadow-stone-950/20",children:h.jsxs("div",{className:"p-2",children:[h.jsx("button",{type:"button",onClick:()=>{var I;Ln(),(I=We.current)==null||I.click()},className:"thread-composer-menu-item block w-full rounded-xl px-3 py-2 text-left text-sm transition",children:"Photo"}),h.jsx("button",{type:"button",onClick:()=>{var I;Ln(),(I=xt.current)==null||I.click()},className:"thread-composer-menu-item mt-1 block w-full rounded-xl px-3 py-2 text-left text-sm transition",children:"File"})]})})]}),h.jsx("button",{type:"button","aria-label":Yt?"Switch to chat":"Switch to shell",title:Yt?"Switch to chat":"Switch to shell",onClick:()=>ae==null?void 0:ae(),className:"thread-composer-icon-button inline-flex h-7 w-7 items-center justify-center rounded-full border border-stone-700 bg-stone-900/92 text-stone-200 transition hover:bg-stone-800",children:Yt?h.jsx(X6,{}):h.jsx(M6,{})})]}),h.jsxs("div",{className:"flex min-w-0 flex-1 items-center justify-end gap-1.5",children:[Yt&&Li&&h.jsx("span",{className:"min-w-0 max-w-[12rem] truncate rounded-full px-1.5 py-1 text-stone-400",title:Li,children:Li}),Ss&&h.jsxs("div",{className:"relative",children:[h.jsx("button",{type:"button","data-composer-menu-trigger":"true","aria-label":Fe==="shellTools"?"Close shell tools":"Open shell tools","aria-haspopup":"menu","aria-expanded":Fe==="shellTools",title:Fe==="shellTools"?"Close shell tools":"Open shell tools",onClick:()=>{Ln(),Ie(I=>I==="shellTools"?null:"shellTools")},className:"inline-flex h-7 w-7 items-center justify-center rounded-full border border-stone-700 bg-stone-900/92 text-stone-200 transition hover:bg-stone-800",children:h.jsx(K6,{})}),Fe==="shellTools"&&h.jsx("div",{"data-composer-menu-surface":"true",className:"absolute right-0 top-full z-40 mt-2 w-[11.5rem] max-w-[calc(100vw-1.5rem)] rounded-[1rem] border border-stone-700/90 bg-stone-950/96 p-2 shadow-2xl shadow-stone-950/40 sm:w-48",onMouseDown:I=>{I.stopPropagation()},onPointerDown:I=>{I.stopPropagation()},onTouchStart:I=>{I.stopPropagation()},children:h.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[h.jsx("button",{type:"button",onClick:()=>void Rs(),className:"inline-flex items-center justify-center rounded-full border border-sky-300/35 bg-sky-300/12 px-2 py-2 text-sky-50",children:h.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[h.jsx(Tp,{}),h.jsx("span",{className:"text-[10px] font-medium tracking-[0.12em]",children:"Paste"})]})}),h.jsx("button",{type:"button",onClick:()=>{Ln(),Ie(null),O==null||O()},className:"inline-flex items-center justify-center rounded-full border border-stone-700/90 bg-stone-900/80 px-2 py-2 text-stone-100",children:h.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[h.jsx(Tp,{}),h.jsx("span",{className:"text-[10px] font-medium tracking-[0.12em]",children:"Copy"})]})}),h.jsx("button",{type:"button",disabled:n,onClick:()=>{Ln(),Ie(null),Y({prompt:"clear"})},className:"disabled:cursor-not-allowed disabled:opacity-45",children:h.jsx(Qs,{label:"CLEAR",tone:"sky"})}),h.jsx("button",{type:"button",disabled:!(C!=null&&C.shellInputEnabled)||!(C!=null&&C.isCommandRunning),onClick:()=>{Ln(),Ie(null),_e==null||_e("ctrl_c")},className:"disabled:cursor-not-allowed disabled:opacity-45",children:h.jsx(Qs,{label:"CTRL-C",tone:"rose"})}),h.jsx("button",{type:"button",disabled:!(C!=null&&C.shellInputEnabled),onClick:()=>{Ln(),Ie(null),_e==null||_e("ctrl_d")},className:"disabled:cursor-not-allowed disabled:opacity-45",children:h.jsx(Qs,{label:"CTRL-D"})}),h.jsx("button",{type:"button",disabled:!(C!=null&&C.shellInputEnabled),onClick:()=>{Ln(),Ie(null),_e==null||_e("esc")},className:"disabled:cursor-not-allowed disabled:opacity-45",children:h.jsx(Qs,{label:"ESC"})}),h.jsx("button",{type:"button",disabled:!(C!=null&&C.shellInputEnabled),onClick:()=>{Ln(),Ie(null),_e==null||_e("tab")},className:"disabled:cursor-not-allowed disabled:opacity-45",children:h.jsx(Qs,{label:"TAB"})}),h.jsx("button",{type:"button",disabled:!(C!=null&&C.shellInputEnabled),onClick:()=>{Ln(),Ie(null),_e==null||_e("up")},className:"disabled:cursor-not-allowed disabled:opacity-45",children:h.jsx(Qs,{label:"UP"})}),h.jsx("button",{type:"button",disabled:!(C!=null&&C.shellInputEnabled),onClick:()=>{Ln(),Ie(null),_e==null||_e("down")},className:"disabled:cursor-not-allowed disabled:opacity-45",children:h.jsx(Qs,{label:"DOWN"})})]})})]})]})]}),Ht&&!Yt&&h.jsxs("div",{className:"relative z-20 mb-1.5 flex flex-wrap items-center gap-2 rounded-2xl border border-sky-300/25 bg-sky-300/[0.07] px-3 py-2 text-xs text-sky-50 shadow-sm shadow-stone-950/10",children:[h.jsx("span",{className:"font-medium uppercase tracking-[0.16em] text-sky-100/90",children:"Goal"}),h.jsxs("label",{className:"flex items-center gap-2 text-stone-300",children:[h.jsx("span",{children:"Max tokens (k)"}),h.jsx("input",{"aria-label":"Goal token budget",value:Le,onChange:I=>Ke(I.target.value),inputMode:"numeric",placeholder:"Optional",className:"h-7 w-24 rounded-full border border-sky-300/25 bg-stone-950/60 px-3 text-xs text-stone-100 outline-none placeholder:text-stone-500 focus:border-sky-300/70"})]}),Q?h.jsx("span",{className:"min-w-0 flex-1 text-rose-200",children:Q}):null,h.jsx("button",{type:"button",onClick:da,className:"rounded-full border border-stone-700/80 px-2.5 py-1 text-[11px] text-stone-300 transition hover:bg-stone-800",children:"Cancel"})]}),h.jsxs("div",{className:"relative",children:[Yt?h.jsx("textarea",{"aria-label":"Prompt",disabled:!1,value:vt,onChange:I=>Mo(I.target.value),onKeyDown:Za,rows:2,placeholder:Tl,className:`${$r} resize-y pb-10`}):h.jsxs("div",{className:$r,children:[vt.length===0&&h.jsx("span",{className:"pointer-events-none absolute left-4 top-2.5 text-stone-500",children:Tl}),h.jsx("div",{ref:He,role:"textbox","aria-label":"Prompt","aria-multiline":"true",contentEditable:!v,suppressContentEditableWarning:!0,onInput:()=>El(),onPaste:_l,onKeyDown:Za,onKeyUp:()=>{yt.current=Sr()},onMouseUp:()=>{yt.current=Sr()},onBlur:()=>{yt.current=Sr(),Sa(!1)},onDragEnter:Ra,onDragOver:Bo,onDragLeave:La,onDrop:Ka,className:`relative z-[1] min-h-[5.75rem] whitespace-pre-wrap break-words pb-10 outline-none sm:min-h-[4.875rem] ${v?"cursor-not-allowed text-stone-500":""}`})]}),h.jsx("button",{type:"button","aria-label":Ja,title:Ja,onClick:()=>void(ue==null?void 0:ue()),disabled:!Re,className:`absolute right-2.5 top-2.5 inline-flex h-8 w-8 items-center justify-center rounded-full border transition ${Re?"border-rose-300/55 bg-rose-300/[0.14] text-rose-50 shadow-lg shadow-rose-950/20 hover:bg-rose-300/[0.22]":"cursor-not-allowed border-stone-700/30 bg-stone-400/[0.02] text-stone-500/55 opacity-55"}`,children:h.jsx("span",{"aria-hidden":"true",className:"block h-2.5 w-2.5 rounded-[2px] bg-current"})}),h.jsx("button",{type:"submit","aria-label":Ht&&!Yt?"Set goal":Yt?"Send Shell Input":"Send Prompt",onMouseDown:I=>{I.preventDefault()},onPointerDown:I=>{I.preventDefault()},onTouchStart:I=>{I.preventDefault()},disabled:$e||n||(e==="chat"?v:!1),className:`absolute bottom-2.5 right-2.5 rounded-full px-3.5 py-1.5 text-sm font-medium shadow-lg shadow-stone-950/30 transition disabled:cursor-not-allowed disabled:bg-stone-700 disabled:text-stone-300 ${Ui}`,children:br}),!Yt&&h.jsxs("div",{className:"absolute bottom-2.5 left-3 z-30 flex max-w-[calc(100%-7rem)] items-center gap-1.5 text-xs",children:[h.jsxs("div",{className:"relative min-w-0",children:[h.jsxs("button",{type:"button","data-composer-menu-trigger":"true","aria-haspopup":"menu","aria-expanded":Fe==="model","aria-label":o??"Select model",disabled:ei||p.length===0,onClick:()=>Ie(I=>I==="model"?null:"model"),title:d?`Fast mode is on. Turn it off from the slash toolbox to edit model. ${Fr}`:Fr,className:"thread-composer-inline-toggle relative inline-flex min-w-0 max-w-[8.75rem] items-center overflow-hidden rounded-full px-2.5 py-1 text-left text-stone-300 transition disabled:cursor-not-allowed disabled:text-stone-600 sm:max-w-[11rem]",children:[o?h.jsx(W6,{contextUsage:g}):null,h.jsx("span",{className:"relative z-[1] block min-w-0 truncate whitespace-nowrap [direction:rtl]",children:o??"Select model"})]}),Fe==="model"&&h.jsx("div",{"data-composer-menu-surface":"true",className:"absolute bottom-full left-0 mb-2 w-max min-w-[9rem] max-w-[14rem] overflow-hidden rounded-2xl border border-stone-700 bg-stone-900 shadow-2xl shadow-stone-950/40",children:h.jsx("div",{className:"max-h-72 overflow-auto p-2",children:p.map(I=>h.jsx("button",{type:"button",onClick:()=>void ma({model:I.model,reasoningEffort:I.defaultReasoningEffort}),className:`block w-full rounded-xl px-3 py-2 text-left transition ${I.model===o?"ui-status-warning":"thread-composer-menu-item text-stone-300"}`,children:h.jsx("p",{className:"text-sm font-medium",children:I.model})},I.id))})})]}),h.jsxs("div",{className:"relative",children:[h.jsx("button",{type:"button","data-composer-menu-trigger":"true","aria-haspopup":"menu","aria-expanded":Fe==="effort",disabled:ei||pn.length===0,onClick:()=>Ie(I=>I==="effort"?null:"effort"),title:d?"Fast mode is on. Turn it off from the slash toolbox to edit reasoning.":void 0,className:"thread-composer-inline-toggle rounded-full px-2 py-1 text-stone-500 transition disabled:cursor-not-allowed disabled:text-stone-700",children:IE(c)}),Fe==="effort"&&h.jsx("div",{"data-composer-menu-surface":"true",className:"absolute bottom-full left-0 mb-2 w-max min-w-[8rem] max-w-[12rem] overflow-hidden rounded-2xl border border-stone-700 bg-stone-900 shadow-2xl shadow-stone-950/40",children:h.jsx("div",{className:"max-h-72 overflow-auto p-2",children:pn.map(I=>h.jsx("button",{type:"button",onClick:()=>void ma({reasoningEffort:I.reasoningEffort}),className:`block w-full rounded-xl px-3 py-2 text-left transition ${I.reasoningEffort===c?"ui-status-warning":"thread-composer-menu-item text-stone-300"}`,children:h.jsx("p",{className:"text-sm font-medium",children:IE(I.reasoningEffort)})},I.reasoningEffort))})})]}),h.jsx("button",{type:"button","aria-pressed":m==="plan",disabled:r,onClick:()=>void ma({collaborationMode:m==="plan"?"default":"plan"}),className:`thread-composer-inline-toggle rounded-full px-2.5 py-1 transition ${m==="plan"?"bg-sky-300/18 text-sky-100":"text-stone-500"} disabled:cursor-not-allowed disabled:opacity-60`,children:"Plan"})]})]}),l&&h.jsx("div",{className:"mt-2 rounded-2xl border border-rose-500/40 bg-rose-500/10 px-4 py-3 text-sm text-rose-200",children:l})]})]})}const Z6="modulepreload",J6=function(e){return"/"+e},BE={},D=function(t,n,r){let s=Promise.resolve();if(n&&n.length>0){let o=function(m){return Promise.all(m.map(p=>Promise.resolve(p).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),d=(c==null?void 0:c.nonce)||(c==null?void 0:c.getAttribute("nonce"));s=o(n.map(m=>{if(m=J6(m),m in BE)return;BE[m]=!0;const p=m.endsWith(".css"),g=p?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${m}"]${g}`))return;const y=document.createElement("link");if(y.rel=p?"stylesheet":Z6,p||(y.as="script"),y.crossOrigin="",y.href=m,d&&y.setAttribute("nonce",d),document.head.appendChild(y),p)return new Promise((E,v)=>{y.addEventListener("load",E),y.addEventListener("error",()=>v(new Error(`Unable to preload CSS for ${m}`)))})}))}function l(o){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=o,window.dispatchEvent(c),!c.defaultPrevented)throw o}return s.then(o=>{for(const c of o||[])c.status==="rejected"&&l(c.reason);return t().catch(l)})};function UE(e){return{background:e==="light"?"#f2ede5":"#0c1117",foreground:e==="light"?"#3f3a36":"#d6dde6",cursor:e==="light"?"#3f3a36":"#d6dde6",black:e==="light"?"#d8cfc2":"#0f1720",brightBlack:e==="light"?"#8a7f73":"#475569",red:"#f87171",brightRed:"#fb7185",green:e==="light"?"#16a34a":"#86efac",brightGreen:e==="light"?"#22c55e":"#4ade80",yellow:"#fbbf24",brightYellow:"#fcd34d",blue:e==="light"?"#2563eb":"#93c5fd",brightBlue:e==="light"?"#3b82f6":"#60a5fa",magenta:e==="light"?"#7c3aed":"#c4b5fd",brightMagenta:e==="light"?"#8b5cf6":"#a78bfa",cyan:e==="light"?"#0891b2":"#67e8f9",brightCyan:e==="light"?"#06b6d4":"#22d3ee",white:e==="light"?"#5b5148":"#e2e8f0",brightWhite:e==="light"?"#2c2723":"#f8fafc"}}function e4(e){switch(e){case"not_created":return"Not created";case"creating":return"Creating";case"running":return"Running";case"attached":return"Attached";case"detached":return"Detached";case"exited":return"Exited";case"not_found":return"Missing";case"workspace_missing":return"Workspace missing"}}function HE(e,t,n,r,s){const l=t.replace(/\r\n/g,`
|
|
80
|
+
`).replace(/\r/g,`
|
|
81
|
+
`),o=l.split(`
|
|
82
|
+
`);l.endsWith(`
|
|
83
|
+
`)&&o.at(-1)===""&&o.pop();let d=o.join(`\r
|
|
84
|
+
`);if(n!==void 0&&r!==void 0){const p=(s!==void 0?Math.max(0,o.length-s):0)+r,g=Math.max(0,o.length-p-1);g>0&&(d+=`\x1B[${g}A`),d+=`\r\x1B[${n+1}G`}e.reset(),e.write(d,()=>{e.scrollToBottom()})}function t4(e){return/^[a-z]$/i.test(e)?String.fromCharCode(e.toUpperCase().charCodeAt(0)-64):null}function wp(e){return e?Array.from(e.querySelectorAll(".xterm-rows > div")).map(n=>n.textContent??"").filter((n,r,s)=>n.length>0||r<s.length-1).join(`
|
|
85
|
+
`).trimEnd():""}function ov(e){return e.replace(/\r\n/g,`
|
|
86
|
+
`).replace(/\r/g,`
|
|
87
|
+
`)}function zE(e){const t=ov(e),n=t.split(`
|
|
88
|
+
`);return t.endsWith(`
|
|
89
|
+
`)&&n.at(-1)===""&&n.pop(),n}function n4(e){const t=e.trim();return t?/(?:[$%#>])\s*$/.test(t):!1}function r4(e,t){const n=t.trim();if(!n||e.length===0)return e;const[r,...s]=e;if(r===void 0)return e;const l=r.trim();return l===n||l.endsWith(` ${n}`)||l.endsWith(`$ ${n}`)||l.endsWith(`% ${n}`)||l.endsWith(`# ${n}`)||l.endsWith(`> ${n}`)?s:e}function a4(e,t,n){var d,m;const r=zE(e),s=zE(t);let l=0;for(;l<r.length&&l<s.length&&r[l]===s[l];)l+=1;let o=0;for(;o<r.length-l&&o<s.length-l&&r[r.length-1-o]===s[s.length-1-o];)o+=1;let c=s.slice(l,s.length-o);for(c=r4(c,n);c.length>0&&((d=c[0])==null?void 0:d.trim())==="";)c.shift();for(;c.length>0&&(((m=c.at(-1))==null?void 0:m.trim())===""||n4(c.at(-1)??""));)c.pop();return c.join(`
|
|
90
|
+
`).trimEnd()}function kp(e){if(!e)return"";const t=e.replace(/[\\/]+$/,"");return t?t.split(/[\\/]/).filter(Boolean).at(-1)??t:""}function Cp(e,t){const n=[t==null?void 0:t.trim(),e==null?void 0:e.trim()].filter(Boolean);return n.length>0?n.join(" "):null}function i4(){return h.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 20 20",className:"h-4 w-4 fill-current",children:[h.jsx("path",{fillRule:"evenodd",d:"M14.5 10C16.9853 10 19 7.98528 19 5.5C19 5.01783 18.9242 4.55338 18.7838 4.11791C18.6792 3.79367 18.2734 3.72683 18.0325 3.96772L15.3402 6.66002C15.2098 6.79041 15.0168 6.84163 14.8466 6.77074C14.1172 6.46695 13.5334 5.88351 13.2292 5.15431C13.1582 4.98403 13.2094 4.79088 13.3398 4.66042L16.0327 1.9676C16.2735 1.72672 16.2067 1.32092 15.8825 1.21636C15.4469 1.07588 14.9823 1 14.5 1C12.0147 1 10 3.01472 10 5.5C10 5.59783 10.0031 5.69494 10.0093 5.79122C10.065 6.66418 9.88174 7.59855 9.20974 8.15855L1.98017 14.1832C1.3591 14.7008 1 15.4674 1 16.2759C1 17.7804 2.21962 19 3.7241 19C4.53256 19 5.29925 18.6409 5.81681 18.0198L11.8414 10.7903C12.4014 10.1183 13.3358 9.93497 14.2088 9.99073C14.3051 9.99688 14.4022 10 14.5 10ZM5 16C5 16.5523 4.55228 17 4 17C3.44772 17 3 16.5523 3 16C3 15.4477 3.44772 15 4 15C4.55228 15 5 15.4477 5 16Z",clipRule:"evenodd"}),h.jsx("path",{d:"M14.5 11.5C14.6731 11.5 14.8445 11.4927 15.0138 11.4783L18.7678 15.2323C19.7441 16.2086 19.7441 17.7915 18.7678 18.7678C17.7915 19.7441 16.2086 19.7441 15.2323 18.7678L10.8216 14.3571L12.9938 11.7505C13.0455 11.6885 13.1413 11.6131 13.3357 11.5552C13.5378 11.4951 13.805 11.468 14.1132 11.4877C14.2413 11.4959 14.3702 11.5 14.5 11.5Z"}),h.jsx("path",{d:"M6.00003 4.58582L8.33056 6.91635C8.3027 6.95627 8.27496 6.98497 8.24946 7.00622L6.79994 8.21415L4.58582 6.00003H3.30905C3.11966 6.00003 2.94653 5.89303 2.86184 5.72364L1.1612 2.32237C1.06495 2.12987 1.10268 1.89739 1.25486 1.74521L1.74521 1.25486C1.89739 1.10268 2.12987 1.06495 2.32237 1.1612L5.72364 2.86184C5.89303 2.94653 6.00003 3.11966 6.00003 3.30905V4.58582Z"})]})}function s4({connected:e}){return e?h.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"h-4.5 w-4.5 fill-none stroke-current",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:h.jsx("path",{d:"M13.19 8.688a4.5 4.5 0 0 1 1.242 7.244l-4.5 4.5a4.5 4.5 0 0 1-6.364-6.364l1.757-1.757m13.35-.622 1.757-1.757a4.5 4.5 0 0 0-6.364-6.364l-4.5 4.5a4.5 4.5 0 0 0 1.242 7.244"})}):h.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"h-4.5 w-4.5 fill-none stroke-current",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:h.jsx("path",{d:"M13.181 8.68a4.503 4.503 0 0 1 1.903 6.405m-9.768-2.782L3.56 14.06a4.5 4.5 0 0 0 6.364 6.365l3.129-3.129m5.614-5.615 1.757-1.757a4.5 4.5 0 0 0-6.364-6.365l-4.5 4.5c-.258.26-.479.541-.661.84m1.903 6.405a4.495 4.495 0 0 1-1.242-.88 4.483 4.483 0 0 1-1.062-1.683m6.587 2.345 5.907 5.907m-5.907-5.907L8.898 8.898M2.991 2.99 8.898 8.9"})})}function FE(){return h.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:[h.jsx("path",{d:"M5.5 3.25h5"}),h.jsx("path",{d:"M6.4 2h3.2a.9.9 0 0 1 .9.9v.35h1.3a1.2 1.2 0 0 1 1.2 1.2v7.35a1.2 1.2 0 0 1-1.2 1.2H4.2A1.2 1.2 0 0 1 3 11.8V4.45a1.2 1.2 0 0 1 1.2-1.2h1.3V2.9a.9.9 0 0 1 .9-.9Z"})]})}function Xs({label:e,tone:t="stone"}){const n=t==="rose"?"border-rose-300/35 bg-rose-300/14 text-rose-600 dark:text-rose-50":t==="sky"?"border-sky-300/35 bg-sky-300/14 text-sky-600 dark:text-sky-50":"shell-control-chip border";return h.jsx("span",{className:`inline-flex min-w-[3.45rem] items-center justify-center rounded-full border px-2.5 py-1.5 text-[11px] font-medium tracking-[0.12em] ${n}`,children:e})}function l4(e){switch(e){case"ctrl_c":return"";case"ctrl_d":return"";case"esc":return"\x1B";case"tab":return" ";case"up":return"\x1B[A";case"down":return"\x1B[B"}}const o4=T.forwardRef(function({threadId:t,isVisible:n=!0,showHeader:r=!0,showFloatingToolbox:s=!0,onStateChange:l},o){var Qt,Ht;const c=hc(),d=T.useRef(null),m=T.useRef(null),p=T.useRef(null),g=T.useRef(null),y=T.useRef(null),E=T.useRef(null),v=T.useRef(0),k=T.useRef(""),C=T.useRef(null),S=T.useRef(""),A=T.useRef(null),N=T.useRef({cursorX:void 0,cursorY:void 0,paneHeight:void 0}),U=T.useRef(!1),G=T.useRef(null),[P,H]=T.useState(null),[Y,ue]=T.useState(null),[M,K]=T.useState(!0),[F,ge]=T.useState(!1),[ce,ne]=T.useState(null),[z,ee]=T.useState(0),[ke,Be]=T.useState(!1),[L,$]=T.useState(!1),[ae,O]=T.useState(!1),[_e,Re]=T.useState(null),[we,et]=T.useState(!1),[Fe,Ie]=T.useState(null),kt=(c==null?void 0:c.effectiveTheme)??"dark",at=T.useCallback((xe,Le)=>{Ie({tone:xe,text:Le}),G.current!==null&&window.clearTimeout(G.current),G.current=window.setTimeout(()=>{Ie(null),G.current=null},1800)},[]),Nt=T.useCallback(xe=>{var nt;const Le=p.current,Ke=y.current,$e=g.current;return!Le||!Ke||!$e?!1:(Le.send({type:"shell.input",shellId:Ke,viewerId:$e,data:xe}),L||(nt=d.current)==null||nt.focus(),!0)},[L]),Gt=T.useCallback(()=>{var $e;const xe=p.current,Le=y.current,Ke=g.current;return!xe||!Le||!Ke?!1:(xe.send({type:"shell.clear",shellId:Le,viewerId:Ke}),L||($e=d.current)==null||$e.focus(),!0)},[L]),Ut=T.useCallback(xe=>{const Le=d.current,Ke=m.current;!Le||!Ke||(Ke.fit(),k.current&&!wp(P)?HE(Le,k.current,N.current.cursorX,N.current.cursorY,N.current.paneHeight):Le.scrollToBottom(),xe!=null&&xe.focus&&!L&&Le.focus())},[L,P]),Tt=(Y==null?void 0:Y.state)??"not_created",rt=T.useMemo(()=>(Y==null?void 0:Y.shell)??null,[Y==null?void 0:Y.shell]),on=!!(g.current&&rt),it=T.useMemo(()=>Cp(kp(rt==null?void 0:rt.cwd),null),[rt==null?void 0:rt.cwd]),lt=_e??it,ht=F||M||Tt==="creating"||Tt==="workspace_missing",mn=Tt==="attached"?"border-emerald-300/45 bg-emerald-300/18 text-emerald-50 ring-1 ring-emerald-300/20 hover:bg-emerald-300/24":Tt==="exited"||Tt==="not_found"?"border-stone-600 bg-stone-800/90 text-stone-100 hover:border-stone-500 hover:bg-stone-800":Tt==="workspace_missing"?"border-rose-300/35 bg-rose-300/12 text-rose-100":"border-stone-600 bg-stone-800/90 text-stone-100 hover:border-stone-500 hover:bg-stone-800",rn=Tt==="attached"?"Disconnect shell":Tt==="exited"||Tt==="not_found"?"Restart shell":rt?"Connect shell":"Create shell",An=(Fe==null?void 0:Fe.tone)==="done"?"shell-floating-feedback shell-floating-feedback-done":(Fe==null?void 0:Fe.tone)==="failed"?"shell-floating-feedback shell-floating-feedback-failed":"shell-floating-feedback",qt=T.useCallback(async()=>{K(!0);try{const xe=await n6(t);ue(xe),ne(null)}catch(xe){ne(xe instanceof Error?xe.message:"Unable to load shell state.")}finally{K(!1)}},[t]);T.useEffect(()=>{qt()},[qt]),T.useEffect(()=>{var xe;y.current=((xe=Y==null?void 0:Y.shell)==null?void 0:xe.id)??null},[(Qt=Y==null?void 0:Y.shell)==null?void 0:Qt.id]),T.useEffect(()=>{E.current=Y},[Y]),T.useEffect(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;const xe=window.matchMedia("(max-width: 767px), (hover: none) and (pointer: coarse)"),Le=()=>{$(xe.matches),xe.matches||O(!1)};return Le(),xe.addEventListener("change",Le),()=>{xe.removeEventListener("change",Le)}},[]),T.useEffect(()=>()=>{G.current!==null&&window.clearTimeout(G.current)},[]),T.useEffect(()=>{if(!P||d.current)return;let xe=!1,Le=null;return(async()=>{const[{Terminal:Ke},{FitAddon:$e}]=await Promise.all([D(()=>import("./xterm-D8iZbRww.js").then(ve=>ve.x),[]),D(()=>import("./addon-fit-YJmn1quW.js"),[])]);if(xe||!P)return;const nt=new Ke({cursorBlink:!0,disableStdin:L,fontFamily:"IBM Plex Mono, SFMono-Regular, Menlo, monospace",fontSize:13,lineHeight:1.25,scrollback:3e3,theme:UE(kt)}),Q=new $e;nt.loadAddon(Q),nt.open(P),Q.fit(),nt.attachCustomKeyEventHandler(ve=>{if(L||ve.type!=="keydown")return!0;if(ve.ctrlKey&&!ve.altKey&&!ve.metaKey&&!ve.shiftKey){const ut=t4(ve.key);return ut&&Nt(ut)?(ve.preventDefault(),!1):!0}return!0}),d.current=nt,m.current=Q,Be(!0),A.current=new ResizeObserver(()=>{Ut(),p.current&&y.current&&g.current&&p.current.send({type:"shell.resize",shellId:y.current,viewerId:g.current,cols:nt.cols,rows:nt.rows})}),A.current.observe(P),Le=nt.onData(ve=>{L||Nt(ve)})})(),()=>{var Ke,$e;xe=!0,Le==null||Le.dispose(),(Ke=A.current)==null||Ke.disconnect(),A.current=null,Be(!1),($e=d.current)==null||$e.dispose(),d.current=null,m.current=null}},[L,Ut,Nt,P]),T.useEffect(()=>{if(!n||!ke)return;let xe=window.requestAnimationFrame(()=>{Ut({focus:!0})});return()=>{window.cancelAnimationFrame(xe)}},[n,Ut,ke]),T.useEffect(()=>{const xe=d.current;xe&&(xe.options.disableStdin=L)},[L]),T.useEffect(()=>{var Q;const xe=E.current,Le=(Q=xe==null?void 0:xe.shell)==null?void 0:Q.id;if(!Le)return;const Ke=xe==null?void 0:xe.state;if(Ke==="not_created"||Ke==="workspace_missing"||Ke==="creating"||Ke==="not_found"||Ke==="exited")return;const $e=d.current;if(!$e||!ke||z===v.current)return;v.current=z,$e.reset(),ne(null),g.current=null,$e.focus();const nt=v6({onConnected:()=>{nt.send({type:"shell.attach",shellId:Le,cols:$e.cols,rows:$e.rows})},onShellEvent:ve=>{if(ve.shellId!==Le)return;if(ve.type==="shell.connected"){const He=String(ve.payload.viewerId??"");g.current=He||null,ue(We=>We&&{...We,state:"attached",shell:We.shell?{...We.shell,status:"attached",attachedViewerId:He}:We.shell});return}if(ve.type==="shell.output"){const He=typeof ve.payload.data=="string"?ve.payload.data:"",We=ve.payload.replace===!0,xt=typeof ve.payload.cursorX=="number"?ve.payload.cursorX:void 0,Ct=typeof ve.payload.cursorY=="number"?ve.payload.cursorY:void 0,Qe=typeof ve.payload.paneHeight=="number"?ve.payload.paneHeight:void 0,yt=typeof ve.payload.cwdBaseName=="string"?ve.payload.cwdBaseName:null,Nn=typeof ve.payload.envPrefix=="string"?ve.payload.envPrefix:null,or=Cp(yt??kp(rt==null?void 0:rt.cwd),Nn),dn=ve.payload.isCommandRunning===!0;if(N.current={cursorX:xt,cursorY:Ct,paneHeight:Qe},Re(or),et(dn),U.current=dn,He)if(We){const Yt=ov(He);k.current=Yt,HE($e,He,xt,Ct,Qe),!dn&&C.current&&(S.current=a4(C.current.beforeSnapshot,Yt,C.current.command),C.current=null)}else $e.write(He);return}if(ve.type==="shell.error"){ne(String(ve.payload.message??"Shell connection failed.")),ve.payload.code==="viewer_conflict"&&ue(He=>He&&{...He,state:"detached",shell:He.shell?{...He.shell,status:"detached",attachedViewerId:null}:He.shell});return}if(ve.type==="shell.detached"){const He=String(ve.payload.viewerId??""),We=String(ve.payload.reason??"");He&&He===g.current&&(g.current=null,ue(xt=>xt&&{...xt,state:"detached",shell:xt.shell?{...xt.shell,status:"detached",attachedViewerId:null}:xt.shell}),ne(We==="replaced"?"This shell connection was taken over by another device.":null),et(!1),U.current=!1,nt.socket.close());return}if(ve.type==="shell.exited"){g.current=null,et(!1),U.current=!1;const He=ve.payload.state==="exited"?"exited":"not_found";ue(We=>We&&{...We,state:He,shell:We.shell?{...We.shell,status:He,attachedViewerId:null}:We.shell});return}const ut=ve.payload.state;ut&&(ut!=="attached"&&(g.current=null,et(!1),U.current=!1),ue(He=>He&&{...He,state:ut,shell:He.shell?{...He.shell,status:ut==="attached"||ut==="detached"?ut:He.shell.status,attachedViewerId:ut==="attached"?He.shell.attachedViewerId:null}:He.shell}))}});return p.current=nt,nt.socket.addEventListener("close",()=>{var ve;((ve=p.current)==null?void 0:ve.socket)===nt.socket&&(p.current=null)}),()=>{var ut;const ve=g.current;ve&&nt.send({type:"shell.detach",shellId:Le,viewerId:ve}),g.current=null,nt.socket.close(),((ut=p.current)==null?void 0:ut.socket)===nt.socket&&(p.current=null)}},[z,rt==null?void 0:rt.cwd,(Ht=Y==null?void 0:Y.shell)==null?void 0:Ht.id,ke]);const Zt=T.useCallback(async()=>{ge(!0);try{const xe=d.current,Le=await i6(t,{...(xe==null?void 0:xe.cols)!==void 0?{cols:xe.cols}:{},...(xe==null?void 0:xe.rows)!==void 0?{rows:xe.rows}:{}});ue(Le),ee(Ke=>Ke+1),ne(null)}catch(xe){ne(xe instanceof sn?xe.payload.message:"Unable to create shell.")}finally{ge(!1)}},[t]),me=T.useCallback(async()=>{if(Tt==="exited"||Tt==="not_found"){await Zt();return}ne(null),ee(xe=>xe+1)},[Zt,Tt]),Ce=T.useCallback(async()=>{if(Y!=null&&Y.shell){ge(!0);try{await s6(Y.shell.id),await qt(),ne(null)}catch(xe){ne(xe instanceof sn?xe.payload.message:"Unable to terminate shell.")}finally{ge(!1)}}},[qt,Y==null?void 0:Y.shell]),Ze=T.useCallback(()=>{var $e;const xe=p.current,Le=y.current,Ke=g.current;!xe||!Le||(Ke&&xe.send({type:"shell.detach",shellId:Le,viewerId:Ke}),g.current=null,xe.socket.close(),(($e=p.current)==null?void 0:$e.socket)===xe.socket&&(p.current=null),ne(null),ue(nt=>nt&&{...nt,state:"detached",shell:nt.shell?{...nt.shell,status:"detached",attachedViewerId:null}:nt.shell}))},[kt]);T.useEffect(()=>{d.current&&(d.current.options.theme=UE(kt))},[kt]);const ot=T.useCallback(async()=>{if(!(F||M||Tt==="creating"||Tt==="workspace_missing")){if(Tt==="attached"){Ze();return}if(Tt==="exited"||Tt==="not_found"||!rt){await Zt();return}await me()}},[F,Zt,Ze,me,M,rt,Tt]),dt=T.useCallback(async()=>{var xe,Le,Ke,$e;try{const nt=((Le=(xe=d.current)==null?void 0:xe.getSelection())==null?void 0:Le.trim())||(($e=(Ke=window.getSelection)==null?void 0:Ke.call(window))==null?void 0:$e.toString().trim())||wp(P);return nt?(await navigator.clipboard.writeText(nt),at("done","Copied"),!0):(at("failed","Nothing to copy"),!1)}catch{return at("failed","Copy failed"),!1}},[P,at]);return T.useEffect(()=>{if(!(rt!=null&&rt.cwd)){Re(null);return}Re(xe=>xe??Cp(kp(rt.cwd),null))},[rt==null?void 0:rt.cwd]),T.useEffect(()=>{l==null||l({status:Tt,connectionButtonDisabled:ht,connectionButtonLabel:rn,shellInputEnabled:on,isCommandRunning:we,promptLabel:lt,isMobileShell:L,hasShell:!!rt,busy:F,loading:M,error:ce})},[F,ht,rn,ce,L,we,M,l,lt,rt,on,Tt]),T.useImperativeHandle(o,()=>({async toggleConnection(){await ot()},sendInput(xe){return Nt(xe)},sendCommand(xe){const Le={command:xe,beforeSnapshot:k.current};if(C.current=Le,xe.trim()==="clear"){const nt=Gt();return!nt&&C.current===Le&&(C.current=null),nt}const Ke=xe.endsWith(`
|
|
91
|
+
`)?xe:`${xe}
|
|
92
|
+
`,$e=Nt(Ke);return!$e&&C.current===Le&&(C.current=null),$e},sendControl(xe){return xe==="clear"?Gt():Nt(l4(xe))},async copyLastCommandOutput(){const xe=S.current.trim()||wp(P);if(!xe)return at("failed","Nothing to copy"),!1;try{return await navigator.clipboard.writeText(xe),at("done","Copied"),!0}catch{return at("failed","Copy failed"),!1}},async terminate(){await Ce()},focus(){var xe;(xe=d.current)==null||xe.focus()},refreshLayout(xe){Ut(xe)}}),[ot,Ce,Ut,Gt,Nt,at,P]),h.jsxs("div",{className:"shell-panel flex min-h-0 flex-1 flex-col",children:[r&&h.jsxs("div",{className:"shell-header shrink-0 border-b px-3 py-3 sm:px-5",children:[h.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[h.jsxs("div",{className:"min-w-0",children:[h.jsx("p",{className:"text-xs uppercase tracking-[0.24em] text-[var(--theme-fg-muted)]",children:"Shell"}),h.jsx("p",{className:"mt-1 truncate text-sm text-[var(--theme-fg-soft)]",children:lt??(rt==null?void 0:rt.cwd)??"Create a durable shell for this thread."})]}),h.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[h.jsx("button",{type:"button","aria-label":rn,title:`${rn} (${e4(Tt)})`,disabled:ht,onClick:()=>void ot(),className:`inline-flex h-10 w-10 items-center justify-center rounded-full border shadow-lg shadow-stone-950/25 transition disabled:cursor-not-allowed disabled:opacity-60 ${mn}`,children:h.jsx(s4,{connected:Tt==="attached"})}),rt&&h.jsx("button",{type:"button",disabled:F,onClick:()=>void Ce(),className:"rounded-full border border-rose-300/35 bg-rose-300/12 px-3 py-2 text-sm text-rose-600 transition hover:bg-rose-300/18 dark:text-rose-100 disabled:cursor-not-allowed disabled:opacity-60",children:"Terminate"})]})]}),(ce||M||(Y==null?void 0:Y.workspacePathStatus)==="missing")&&h.jsxs("div",{className:"shell-banner mt-3 rounded-2xl border px-3 py-3 text-sm",children:[M&&h.jsx("p",{className:"text-[var(--theme-fg-muted)]",children:"Loading shell state..."}),!M&&(Y==null?void 0:Y.workspacePathStatus)==="missing"&&h.jsx("p",{className:"text-rose-600 dark:text-rose-100",children:"Workspace path is missing on this machine. Restore the path before creating a shell."}),!M&&ce&&h.jsx("p",{className:"text-amber-700 dark:text-amber-100",children:ce})]})]}),h.jsx("div",{className:"min-h-0 flex-1",children:Tt==="not_created"||Tt==="workspace_missing"?h.jsx("div",{className:"flex h-full items-center justify-center px-6 text-center",children:h.jsxs("div",{className:"shell-empty-state max-w-md rounded-[1.6rem] border px-6 py-8",children:[h.jsx("p",{className:"text-base font-medium text-[var(--theme-fg)]",children:"Durable thread shell"}),h.jsx("p",{className:"mt-3 text-sm leading-6 text-[var(--theme-fg-muted)]",children:"The shell runs under supervisor-managed tmux and survives browser disconnects. Create it explicitly when you want to inspect or take over the workspace."})]})}):h.jsx("div",{className:"h-full min-h-0 p-2 sm:p-3",children:h.jsxs("div",{className:"shell-terminal-frame relative h-full rounded-[1.4rem] border shadow-inner",children:[!r&&(ce||M||(Y==null?void 0:Y.workspacePathStatus)==="missing")&&h.jsxs("div",{className:"shell-banner absolute left-2 right-2 top-2 z-10 rounded-2xl border px-3 py-3 text-sm backdrop-blur sm:left-3 sm:right-3 sm:top-3",children:[M&&h.jsx("p",{className:"text-[var(--theme-fg-muted)]",children:"Loading shell state..."}),!M&&(Y==null?void 0:Y.workspacePathStatus)==="missing"&&h.jsx("p",{className:"text-rose-600 dark:text-rose-100",children:"Workspace path is missing on this machine. Restore the path before creating a shell."}),!M&&ce&&h.jsx("p",{className:"text-amber-700 dark:text-amber-100",children:ce})]}),h.jsx("div",{ref:H,className:`h-full w-full px-2 py-2 sm:px-3 sm:py-3 ${L?"mobile-shell-selectable":""}`,onMouseDown:()=>{var xe;(xe=d.current)==null||xe.focus()}}),s&&L&&h.jsxs("div",{className:"pointer-events-none absolute bottom-3 right-3 z-20 flex flex-col items-end gap-2",children:[Fe&&h.jsx("div",{className:`pointer-events-auto rounded-full border px-3 py-1.5 text-[11px] shadow-lg shadow-stone-950/30 backdrop-blur ${An}`,children:Fe.text}),ae&&h.jsx("div",{className:"shell-toolbox pointer-events-auto rounded-[1.2rem] border p-2 shadow-2xl backdrop-blur",children:h.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[h.jsx("button",{type:"button",onClick:()=>{at("idle","Use the prompt box tools to paste")},className:"inline-flex items-center justify-center rounded-full border border-sky-300/35 bg-sky-300/12 px-2.5 py-2 text-sky-600 dark:text-sky-50",children:h.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[h.jsx(FE,{}),h.jsx("span",{className:"text-[11px] font-medium tracking-[0.12em]",children:"Paste"})]})}),h.jsx("button",{type:"button",onClick:()=>void dt(),className:"shell-toolbox-copy inline-flex items-center justify-center rounded-full border px-2.5 py-2",children:h.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[h.jsx(FE,{}),h.jsx("span",{className:"text-[11px] font-medium tracking-[0.12em]",children:"Copy"})]})}),h.jsx("button",{type:"button",disabled:!on,onClick:()=>{Gt()?at("done","Cleared"):at("failed","Connect the shell first")},className:"disabled:opacity-45",children:h.jsx(Xs,{label:"CLEAR",tone:"sky"})}),h.jsx("button",{type:"button",disabled:!on||!we,onClick:()=>{Nt("")?at("done","Sent Ctrl-C"):at("failed","Connect the shell first")},className:"disabled:opacity-45",children:h.jsx(Xs,{label:"CTRL-C",tone:"rose"})}),h.jsx("button",{type:"button",disabled:!on,onClick:()=>{Nt("")?at("done","Sent Ctrl-D"):at("failed","Connect the shell first")},className:"disabled:opacity-45",children:h.jsx(Xs,{label:"CTRL-D",tone:"stone"})}),h.jsx("button",{type:"button",disabled:!on,onClick:()=>{Nt("\x1B")?at("done","Sent Esc"):at("failed","Connect the shell first")},className:"disabled:opacity-45",children:h.jsx(Xs,{label:"ESC",tone:"stone"})}),h.jsx("button",{type:"button",disabled:!on,onClick:()=>{Nt(" ")?at("done","Sent Tab"):at("failed","Connect the shell first")},className:"disabled:opacity-45",children:h.jsx(Xs,{label:"TAB",tone:"stone"})}),h.jsx("button",{type:"button",disabled:!on,onClick:()=>{Nt("\x1B[A")?at("done","Sent Up"):at("failed","Connect the shell first")},className:"disabled:opacity-45",children:h.jsx(Xs,{label:"UP",tone:"stone"})}),h.jsx("button",{type:"button",disabled:!on,onClick:()=>{Nt("\x1B[B")?at("done","Sent Down"):at("failed","Connect the shell first")},className:"disabled:opacity-45",children:h.jsx(Xs,{label:"DOWN",tone:"stone"})})]})}),h.jsx("button",{type:"button","aria-expanded":ae,"aria-label":ae?"Close shell tools":"Open shell tools",onClick:()=>O(xe=>!xe),className:"shell-toolbox-trigger pointer-events-auto inline-flex h-11 w-11 items-center justify-center rounded-full border shadow-2xl backdrop-blur transition",children:h.jsx(i4,{})})]})]})})})]})});let Bn=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function u4(e){return Sg(e)}function Sg(e){return Array.isArray(e)?c4(e):e instanceof RegExp?e:typeof e=="object"?d4(e):e}function c4(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=Sg(e[n]);return t}function d4(e){let t={};for(let n in e)t[n]=Sg(e[n]);return t}function uv(e,...t){return t.forEach(n=>{for(let r in n)e[r]=n[r]}),e}function cv(e){const t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?cv(e.substring(0,e.length-1)):e.substr(~t+1)}var Sp=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Rd=class{static hasCaptures(e){return e===null?!1:(Sp.lastIndex=0,Sp.test(e))}static replaceCaptures(e,t,n){return e.replace(Sp,(r,s,l,o)=>{let c=n[parseInt(s||l,10)];if(c){let d=t.substring(c.start,c.end);for(;d[0]===".";)d=d.substring(1);switch(o){case"downcase":return d.toLowerCase();case"upcase":return d.toUpperCase();default:return d}}else return r})}};function dv(e,t){return e<t?-1:e>t?1:0}function fv(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let s=0;s<n;s++){let l=dv(e[s],t[s]);if(l!==0)return l}return 0}return n-r}function $E(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function hv(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var mv=class{constructor(e){le(this,"cache",new Map);this.fn=e}get(e){if(this.cache.has(e))return this.cache.get(e);const t=this.fn(e);return this.cache.set(e,t),t}},hf=class{constructor(e,t,n){le(this,"_cachedMatchRoot",new mv(e=>this._root.match(e)));this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(m4(e),t)}static createFromParsedTheme(e,t){return g4(e,t)}getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;const t=e.scopeName,r=this._cachedMatchRoot.get(t).find(s=>f4(e.parent,s.parentScopes));return r?new pv(r.fontStyle,r.foreground,r.background):null}},Ap=class rf{constructor(t,n){this.parent=t,this.scopeName=n}static push(t,n){for(const r of n)t=new rf(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new rf(n,t[r]);return n}push(t){return new rf(this,t)}getSegments(){let t=this;const n=[];for(;t;)n.push(t.scopeName),t=t.parent;return n.reverse(),n}toString(){return this.getSegments().join(" ")}extends(t){return this===t?!0:this.parent===null?!1:this.parent.extends(t)}getExtensionIfDefined(t){const n=[];let r=this;for(;r&&r!==t;)n.push(r.scopeName),r=r.parent;return r===t?n.reverse():void 0}};function f4(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let r=t[n],s=!1;if(r===">"){if(n===t.length-1)return!1;r=t[++n],s=!0}for(;e&&!h4(e.scopeName,r);){if(s)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function h4(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var pv=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function m4(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let s=0,l=t.length;s<l;s++){let o=t[s];if(!o.settings)continue;let c;if(typeof o.scope=="string"){let g=o.scope;g=g.replace(/^[,]+/,""),g=g.replace(/[,]+$/,""),c=g.split(",")}else Array.isArray(o.scope)?c=o.scope:c=[""];let d=-1;if(typeof o.settings.fontStyle=="string"){d=0;let g=o.settings.fontStyle.split(" ");for(let y=0,E=g.length;y<E;y++)switch(g[y]){case"italic":d=d|1;break;case"bold":d=d|2;break;case"underline":d=d|4;break;case"strikethrough":d=d|8;break}}let m=null;typeof o.settings.foreground=="string"&&$E(o.settings.foreground)&&(m=o.settings.foreground);let p=null;typeof o.settings.background=="string"&&$E(o.settings.background)&&(p=o.settings.background);for(let g=0,y=c.length;g<y;g++){let v=c[g].trim().split(" "),k=v[v.length-1],C=null;v.length>1&&(C=v.slice(0,v.length-1),C.reverse()),n[r++]=new p4(k,C,s,d,m,p)}}return n}var p4=class{constructor(e,t,n,r,s,l){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=s,this.background=l}},ar=(e=>(e[e.NotSet=-1]="NotSet",e[e.None=0]="None",e[e.Italic=1]="Italic",e[e.Bold=2]="Bold",e[e.Underline=4]="Underline",e[e.Strikethrough=8]="Strikethrough",e))(ar||{});function g4(e,t){e.sort((d,m)=>{let p=dv(d.scope,m.scope);return p!==0||(p=fv(d.parentScopes,m.parentScopes),p!==0)?p:d.index-m.index});let n=0,r="#000000",s="#ffffff";for(;e.length>=1&&e[0].scope==="";){let d=e.shift();d.fontStyle!==-1&&(n=d.fontStyle),d.foreground!==null&&(r=d.foreground),d.background!==null&&(s=d.background)}let l=new b4(t),o=new pv(n,l.getId(r),l.getId(s)),c=new y4(new k0(0,null,-1,0,0),[]);for(let d=0,m=e.length;d<m;d++){let p=e[d];c.insert(0,p.scope,p.parentScopes,p.fontStyle,l.getId(p.foreground),l.getId(p.background))}return new hf(l,o,c)}var b4=class{constructor(e){le(this,"_isFrozen");le(this,"_lastColorId");le(this,"_id2color");le(this,"_color2id");if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw new Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},x4=Object.freeze([]),k0=class gv{constructor(t,n,r,s,l){le(this,"scopeDepth");le(this,"parentScopes");le(this,"fontStyle");le(this,"foreground");le(this,"background");this.scopeDepth=t,this.parentScopes=n||x4,this.fontStyle=r,this.foreground=s,this.background=l}clone(){return new gv(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(t){let n=[];for(let r=0,s=t.length;r<s;r++)n[r]=t[r].clone();return n}acceptOverwrite(t,n,r,s){this.scopeDepth>t?console.log("how did this happen?"):this.scopeDepth=t,n!==-1&&(this.fontStyle=n),r!==0&&(this.foreground=r),s!==0&&(this.background=s)}},y4=class C0{constructor(t,n=[],r={}){le(this,"_rulesWithParentScopes");this._mainRule=t,this._children=r,this._rulesWithParentScopes=n}static _cmpBySpecificity(t,n){if(t.scopeDepth!==n.scopeDepth)return n.scopeDepth-t.scopeDepth;let r=0,s=0;for(;t.parentScopes[r]===">"&&r++,n.parentScopes[s]===">"&&s++,!(r>=t.parentScopes.length||s>=n.parentScopes.length);){const l=n.parentScopes[s].length-t.parentScopes[r].length;if(l!==0)return l;r++,s++}return n.parentScopes.length-t.parentScopes.length}match(t){if(t!==""){let r=t.indexOf("."),s,l;if(r===-1?(s=t,l=""):(s=t.substring(0,r),l=t.substring(r+1)),this._children.hasOwnProperty(s))return this._children[s].match(l)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(C0._cmpBySpecificity),n}insert(t,n,r,s,l,o){if(n===""){this._doInsertHere(t,r,s,l,o);return}let c=n.indexOf("."),d,m;c===-1?(d=n,m=""):(d=n.substring(0,c),m=n.substring(c+1));let p;this._children.hasOwnProperty(d)?p=this._children[d]:(p=new C0(this._mainRule.clone(),k0.cloneArr(this._rulesWithParentScopes)),this._children[d]=p),p.insert(t+1,m,r,s,l,o)}_doInsertHere(t,n,r,s,l){if(n===null){this._mainRule.acceptOverwrite(t,r,s,l);return}for(let o=0,c=this._rulesWithParentScopes.length;o<c;o++){let d=this._rulesWithParentScopes[o];if(fv(d.parentScopes,n)===0){d.acceptOverwrite(t,r,s,l);return}}r===-1&&(r=this._mainRule.fontStyle),s===0&&(s=this._mainRule.foreground),l===0&&(l=this._mainRule.background),this._rulesWithParentScopes.push(new k0(t,n,r,s,l))}},xo=class Zr{static toBinaryStr(t){return t.toString(2).padStart(32,"0")}static print(t){const n=Zr.getLanguageId(t),r=Zr.getTokenType(t),s=Zr.getFontStyle(t),l=Zr.getForeground(t),o=Zr.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:s,foreground:l,background:o})}static getLanguageId(t){return(t&255)>>>0}static getTokenType(t){return(t&768)>>>8}static containsBalancedBrackets(t){return(t&1024)!==0}static getFontStyle(t){return(t&30720)>>>11}static getForeground(t){return(t&16744448)>>>15}static getBackground(t){return(t&4278190080)>>>24}static set(t,n,r,s,l,o,c){let d=Zr.getLanguageId(t),m=Zr.getTokenType(t),p=Zr.containsBalancedBrackets(t)?1:0,g=Zr.getFontStyle(t),y=Zr.getForeground(t),E=Zr.getBackground(t);return n!==0&&(d=n),r!==8&&(m=r),s!==null&&(p=s?1:0),l!==-1&&(g=l),o!==0&&(y=o),c!==0&&(E=c),(d<<0|m<<8|p<<10|g<<11|y<<15|E<<24)>>>0}};function mf(e,t){const n=[],r=E4(e);let s=r.next();for(;s!==null;){let d=0;if(s.length===2&&s.charAt(1)===":"){switch(s.charAt(0)){case"R":d=1;break;case"L":d=-1;break;default:console.log(`Unknown priority ${s} in scope selector`)}s=r.next()}let m=o();if(n.push({matcher:m,priority:d}),s!==",")break;s=r.next()}return n;function l(){if(s==="-"){s=r.next();const d=l();return m=>!!d&&!d(m)}if(s==="("){s=r.next();const d=c();return s===")"&&(s=r.next()),d}if(VE(s)){const d=[];do d.push(s),s=r.next();while(VE(s));return m=>t(d,m)}return null}function o(){const d=[];let m=l();for(;m;)d.push(m),m=l();return p=>d.every(g=>g(p))}function c(){const d=[];let m=o();for(;m&&(d.push(m),s==="|"||s===",");){do s=r.next();while(s==="|"||s===",");m=o()}return p=>d.some(g=>g(p))}}function VE(e){return!!e&&!!e.match(/[\w\.:]+/)}function E4(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;const r=n[0];return n=t.exec(e),r}}}function bv(e){typeof e.dispose=="function"&&e.dispose()}var tc=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},_4=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},T4=class{constructor(){le(this,"_references",[]);le(this,"_seenReferenceKeys",new Set);le(this,"visitedRule",new Set)}get references(){return this._references}add(e){const t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},v4=class{constructor(e,t){le(this,"seenFullScopeRequests",new Set);le(this,"seenPartialScopeRequests",new Set);le(this,"Q");this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new tc(this.initialScopeName)]}processQueue(){const e=this.Q;this.Q=[];const t=new T4;for(const n of e)w4(n,this.initialScopeName,this.repo,t);for(const n of t.references)if(n instanceof tc){if(this.seenFullScopeRequests.has(n.scopeName))continue;this.seenFullScopeRequests.add(n.scopeName),this.Q.push(n)}else{if(this.seenFullScopeRequests.has(n.scopeName)||this.seenPartialScopeRequests.has(n.toKey()))continue;this.seenPartialScopeRequests.add(n.toKey()),this.Q.push(n)}}};function w4(e,t,n,r){const s=n.lookup(e.scopeName);if(!s){if(e.scopeName===t)throw new Error(`No grammar provided for <${t}>`);return}const l=n.lookup(t);e instanceof tc?af({baseGrammar:l,selfGrammar:s},r):S0(e.ruleName,{baseGrammar:l,selfGrammar:s,repository:s.repository},r);const o=n.injections(e.scopeName);if(o)for(const c of o)r.add(new tc(c))}function S0(e,t,n){if(t.repository&&t.repository[e]){const r=t.repository[e];pf([r],t,n)}}function af(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&pf(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&pf(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function pf(e,t,n){for(const r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);const s=r.repository?uv({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&pf(r.patterns,{...t,repository:s},n);const l=r.include;if(!l)continue;const o=xv(l);switch(o.kind){case 0:af({...t,selfGrammar:t.baseGrammar},n);break;case 1:af(t,n);break;case 2:S0(o.ruleName,{...t,repository:s},n);break;case 3:case 4:const c=o.scopeName===t.selfGrammar.scopeName?t.selfGrammar:o.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(c){const d={baseGrammar:t.baseGrammar,selfGrammar:c,repository:s};o.kind===4?S0(o.ruleName,d,n):af(d,n)}else o.kind===4?n.add(new _4(o.scopeName,o.ruleName)):n.add(new tc(o.scopeName));break}}}var k4=class{constructor(){le(this,"kind",0)}},C4=class{constructor(){le(this,"kind",1)}},S4=class{constructor(e){le(this,"kind",2);this.ruleName=e}},A4=class{constructor(e){le(this,"kind",3);this.scopeName=e}},N4=class{constructor(e,t){le(this,"kind",4);this.scopeName=e,this.ruleName=t}};function xv(e){if(e==="$base")return new k4;if(e==="$self")return new C4;const t=e.indexOf("#");if(t===-1)return new A4(e);if(t===0)return new S4(e.substring(1));{const n=e.substring(0,t),r=e.substring(t+1);return new N4(n,r)}}var R4=/\\(\d+)/,GE=/\\(\d+)/g,L4=-1,yv=-2;var mc=class{constructor(e,t,n,r){le(this,"$location");le(this,"id");le(this,"_nameIsCapturing");le(this,"_name");le(this,"_contentNameIsCapturing");le(this,"_contentName");this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=Rd.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=Rd.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${cv(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:Rd.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:Rd.replaceCaptures(this._contentName,e,t)}},I4=class extends mc{constructor(t,n,r,s,l){super(t,n,r,s);le(this,"retokenizeCapturedWithRuleId");this.retokenizeCapturedWithRuleId=l}dispose(){}collectPatterns(t,n){throw new Error("Not supported!")}compile(t,n){throw new Error("Not supported!")}compileAG(t,n,r,s){throw new Error("Not supported!")}},O4=class extends mc{constructor(t,n,r,s,l){super(t,n,r,null);le(this,"_match");le(this,"captures");le(this,"_cachedCompiledPatterns");this._match=new nc(s,this.id),this.captures=l,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(t,n){n.push(this._match)}compile(t,n){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,n,r,s){return this._getCachedCompiledPatterns(t).compileAG(t,r,s)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new rc,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},qE=class extends mc{constructor(t,n,r,s,l){super(t,n,r,s);le(this,"hasMissingPatterns");le(this,"patterns");le(this,"_cachedCompiledPatterns");this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(t,n){for(const r of this.patterns)t.getRule(r).collectPatterns(t,n)}compile(t,n){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,n,r,s){return this._getCachedCompiledPatterns(t).compileAG(t,r,s)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new rc,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},A0=class extends mc{constructor(t,n,r,s,l,o,c,d,m,p){super(t,n,r,s);le(this,"_begin");le(this,"beginCaptures");le(this,"_end");le(this,"endHasBackReferences");le(this,"endCaptures");le(this,"applyEndPatternLast");le(this,"hasMissingPatterns");le(this,"patterns");le(this,"_cachedCompiledPatterns");this._begin=new nc(l,this.id),this.beginCaptures=o,this._end=new nc(c||"",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=d,this.applyEndPatternLast=m||!1,this.patterns=p.patterns,this.hasMissingPatterns=p.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(t,n){return this._end.resolveBackReferences(t,n)}collectPatterns(t,n){n.push(this._begin)}compile(t,n){return this._getCachedCompiledPatterns(t,n).compile(t)}compileAG(t,n,r,s){return this._getCachedCompiledPatterns(t,n).compileAG(t,r,s)}_getCachedCompiledPatterns(t,n){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new rc;for(const r of this.patterns)t.getRule(r).collectPatterns(t,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,n):this._cachedCompiledPatterns.setSource(0,n)),this._cachedCompiledPatterns}},gf=class extends mc{constructor(t,n,r,s,l,o,c,d,m){super(t,n,r,s);le(this,"_begin");le(this,"beginCaptures");le(this,"whileCaptures");le(this,"_while");le(this,"whileHasBackReferences");le(this,"hasMissingPatterns");le(this,"patterns");le(this,"_cachedCompiledPatterns");le(this,"_cachedCompiledWhilePatterns");this._begin=new nc(l,this.id),this.beginCaptures=o,this.whileCaptures=d,this._while=new nc(c,yv),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=m.patterns,this.hasMissingPatterns=m.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(t,n){return this._while.resolveBackReferences(t,n)}collectPatterns(t,n){n.push(this._begin)}compile(t,n){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,n,r,s){return this._getCachedCompiledPatterns(t).compileAG(t,r,s)}_getCachedCompiledPatterns(t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new rc;for(const n of this.patterns)t.getRule(n).collectPatterns(t,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(t,n){return this._getCachedCompiledWhilePatterns(t,n).compile(t)}compileWhileAG(t,n,r,s){return this._getCachedCompiledWhilePatterns(t,n).compileAG(t,r,s)}_getCachedCompiledWhilePatterns(t,n){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new rc,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,n||""),this._cachedCompiledWhilePatterns}},Ev=class rr{static createCaptureRule(t,n,r,s,l){return t.registerRule(o=>new I4(n,o,r,s,l))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(s=>{if(t.id=s,t.match)return new O4(t.$vscodeTextmateLocation,t.id,t.name,t.match,rr._compileCaptures(t.captures,n,r));if(typeof t.begin>"u"){t.repository&&(r=uv({},r,t.repository));let l=t.patterns;return typeof l>"u"&&t.include&&(l=[{include:t.include}]),new qE(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,rr._compilePatterns(l,n,r))}return t.while?new gf(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,rr._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,rr._compileCaptures(t.whileCaptures||t.captures,n,r),rr._compilePatterns(t.patterns,n,r)):new A0(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,rr._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,rr._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,rr._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let s=[];if(t){let l=0;for(const o in t){if(o==="$vscodeTextmateLocation")continue;const c=parseInt(o,10);c>l&&(l=c)}for(let o=0;o<=l;o++)s[o]=null;for(const o in t){if(o==="$vscodeTextmateLocation")continue;const c=parseInt(o,10);let d=0;t[o].patterns&&(d=rr.getCompiledRuleId(t[o],n,r)),s[c]=rr.createCaptureRule(n,t[o].$vscodeTextmateLocation,t[o].name,t[o].contentName,d)}}return s}static _compilePatterns(t,n,r){let s=[];if(t)for(let l=0,o=t.length;l<o;l++){const c=t[l];let d=-1;if(c.include){const m=xv(c.include);switch(m.kind){case 0:case 1:d=rr.getCompiledRuleId(r[c.include],n,r);break;case 2:let p=r[m.ruleName];p&&(d=rr.getCompiledRuleId(p,n,r));break;case 3:case 4:const g=m.scopeName,y=m.kind===4?m.ruleName:null,E=n.getExternalGrammar(g,r);if(E)if(y){let v=E.repository[y];v&&(d=rr.getCompiledRuleId(v,n,E.repository))}else d=rr.getCompiledRuleId(E.repository.$self,n,E.repository);break}}else d=rr.getCompiledRuleId(c,n,r);if(d!==-1){const m=n.getRule(d);let p=!1;if((m instanceof qE||m instanceof A0||m instanceof gf)&&m.hasMissingPatterns&&m.patterns.length===0&&(p=!0),p)continue;s.push(d)}}return{patterns:s,hasMissingPatterns:(t?t.length:0)!==s.length}}},nc=class _v{constructor(t,n){le(this,"source");le(this,"ruleId");le(this,"hasAnchor");le(this,"hasBackReferences");le(this,"_anchorCache");if(t&&typeof t=="string"){const r=t.length;let s=0,l=[],o=!1;for(let c=0;c<r;c++)if(t.charAt(c)==="\\"&&c+1<r){const m=t.charAt(c+1);m==="z"?(l.push(t.substring(s,c)),l.push("$(?!\\n)(?<!\\n)"),s=c+2):(m==="A"||m==="G")&&(o=!0),c++}this.hasAnchor=o,s===0?this.source=t:(l.push(t.substring(s,r)),this.source=l.join(""))}else this.hasAnchor=!1,this.source=t;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=n,typeof this.source=="string"?this.hasBackReferences=R4.test(this.source):this.hasBackReferences=!1}clone(){return new _v(this.source,this.ruleId)}setSource(t){this.source!==t&&(this.source=t,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(t,n){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let r=n.map(s=>t.substring(s.start,s.end));return GE.lastIndex=0,this.source.replace(GE,(s,l)=>hv(r[parseInt(l,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let t=[],n=[],r=[],s=[],l,o,c,d;for(l=0,o=this.source.length;l<o;l++)c=this.source.charAt(l),t[l]=c,n[l]=c,r[l]=c,s[l]=c,c==="\\"&&l+1<o&&(d=this.source.charAt(l+1),d==="A"?(t[l+1]="",n[l+1]="",r[l+1]="A",s[l+1]="A"):d==="G"?(t[l+1]="",n[l+1]="G",r[l+1]="",s[l+1]="G"):(t[l+1]=d,n[l+1]=d,r[l+1]=d,s[l+1]=d),l++);return{A0_G0:t.join(""),A0_G1:n.join(""),A1_G0:r.join(""),A1_G1:s.join("")}}resolveAnchors(t,n){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:t?n?this._anchorCache.A1_G1:this._anchorCache.A1_G0:n?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},rc=class{constructor(){le(this,"_items");le(this,"_hasAnchors");le(this,"_cached");le(this,"_anchorCache");this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached.dispose(),this._cached=null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(n=>n.source);this._cached=new YE(e,t,this._items.map(n=>n.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){let r=this._items.map(s=>s.resolveAnchors(t,n));return new YE(e,r,this._items.map(s=>s.ruleId))}},YE=class{constructor(e,t,n){le(this,"scanner");this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(" - "+this.rules[t]+": "+this.regExps[t]);return e.join(`
|
|
93
|
+
`)}findNextMatchSync(e,t,n){const r=this.scanner.findNextMatchSync(e,t,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},Np=class{constructor(e,t){this.languageId=e,this.tokenType=t}},vi,D4=(vi=class{constructor(t,n){le(this,"_defaultAttributes");le(this,"_embeddedLanguagesMatcher");le(this,"_getBasicScopeAttributes",new mv(t=>{const n=this._scopeToLanguage(t),r=this._toStandardTokenType(t);return new Np(n,r)}));this._defaultAttributes=new Np(t,8),this._embeddedLanguagesMatcher=new j4(Object.entries(n||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?vi._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}_scopeToLanguage(t){return this._embeddedLanguagesMatcher.match(t)||0}_toStandardTokenType(t){const n=t.match(vi.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw new Error("Unexpected match for standard token type!")}},le(vi,"_NULL_SCOPE_METADATA",new Np(0,0)),le(vi,"STANDARD_TOKEN_TYPE_REGEXP",/\b(comment|string|regex|meta\.embedded)\b/),vi),j4=class{constructor(e){le(this,"values");le(this,"scopesRegExp");if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);const t=e.map(([n,r])=>hv(n));t.sort(),t.reverse(),this.scopesRegExp=new RegExp(`^((${t.join(")|(")}))($|\\.)`,"")}}match(e){if(!this.scopesRegExp)return;const t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}},WE=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function Tv(e,t,n,r,s,l,o,c){const d=t.content.length;let m=!1,p=-1;if(o){const E=M4(e,t,n,r,s,l);s=E.stack,r=E.linePos,n=E.isFirstLine,p=E.anchorPosition}const g=Date.now();for(;!m;){if(c!==0&&Date.now()-g>c)return new WE(s,!0);y()}return new WE(s,!1);function y(){const E=P4(e,t,n,r,s,p);if(!E){l.produce(s,d),m=!0;return}const v=E.captureIndices,k=E.matchedRuleId,C=v&&v.length>0?v[0].end>r:!1;if(k===L4){const S=s.getRule(e);l.produce(s,v[0].start),s=s.withContentNameScopesList(s.nameScopesList),Mu(e,t,n,s,l,S.endCaptures,v),l.produce(s,v[0].end);const A=s;if(s=s.parent,p=A.getAnchorPos(),!C&&A.getEnterPos()===r){s=A,l.produce(s,d),m=!0;return}}else{const S=e.getRule(k);l.produce(s,v[0].start);const A=s,N=S.getName(t.content,v),U=s.contentNameScopesList.pushAttributed(N,e);if(s=s.push(k,r,p,v[0].end===d,null,U,U),S instanceof A0){const G=S;Mu(e,t,n,s,l,G.beginCaptures,v),l.produce(s,v[0].end),p=v[0].end;const P=G.getContentName(t.content,v),H=U.pushAttributed(P,e);if(s=s.withContentNameScopesList(H),G.endHasBackReferences&&(s=s.withEndRule(G.getEndWithResolvedBackReferences(t.content,v))),!C&&A.hasSameRuleAs(s)){s=s.pop(),l.produce(s,d),m=!0;return}}else if(S instanceof gf){const G=S;Mu(e,t,n,s,l,G.beginCaptures,v),l.produce(s,v[0].end),p=v[0].end;const P=G.getContentName(t.content,v),H=U.pushAttributed(P,e);if(s=s.withContentNameScopesList(H),G.whileHasBackReferences&&(s=s.withEndRule(G.getWhileWithResolvedBackReferences(t.content,v))),!C&&A.hasSameRuleAs(s)){s=s.pop(),l.produce(s,d),m=!0;return}}else if(Mu(e,t,n,s,l,S.captures,v),l.produce(s,v[0].end),s=s.pop(),!C){s=s.safePop(),l.produce(s,d),m=!0;return}}v[0].end>r&&(r=v[0].end,n=!1)}}function M4(e,t,n,r,s,l){let o=s.beginRuleCapturedEOL?0:-1;const c=[];for(let d=s;d;d=d.pop()){const m=d.getRule(e);m instanceof gf&&c.push({rule:m,stack:d})}for(let d=c.pop();d;d=c.pop()){const{ruleScanner:m,findOptions:p}=H4(d.rule,e,d.stack.endRule,n,r===o),g=m.findNextMatchSync(t,r,p);if(g){if(g.ruleId!==yv){s=d.stack.pop();break}g.captureIndices&&g.captureIndices.length&&(l.produce(d.stack,g.captureIndices[0].start),Mu(e,t,n,d.stack,l,d.rule.whileCaptures,g.captureIndices),l.produce(d.stack,g.captureIndices[0].end),o=g.captureIndices[0].end,g.captureIndices[0].end>r&&(r=g.captureIndices[0].end,n=!1))}else{s=d.stack.pop();break}}return{stack:s,linePos:r,anchorPosition:o,isFirstLine:n}}function P4(e,t,n,r,s,l){const o=B4(e,t,n,r,s,l),c=e.getInjections();if(c.length===0)return o;const d=U4(c,e,t,n,r,s,l);if(!d)return o;if(!o)return d;const m=o.captureIndices[0].start,p=d.captureIndices[0].start;return p<m||d.priorityMatch&&p===m?d:o}function B4(e,t,n,r,s,l){const o=s.getRule(e),{ruleScanner:c,findOptions:d}=vv(o,e,s.endRule,n,r===l),m=c.findNextMatchSync(t,r,d);return m?{captureIndices:m.captureIndices,matchedRuleId:m.ruleId}:null}function U4(e,t,n,r,s,l,o){let c=Number.MAX_VALUE,d=null,m,p=0;const g=l.contentNameScopesList.getScopeNames();for(let y=0,E=e.length;y<E;y++){const v=e[y];if(!v.matcher(g))continue;const k=t.getRule(v.ruleId),{ruleScanner:C,findOptions:S}=vv(k,t,null,r,s===o),A=C.findNextMatchSync(n,s,S);if(!A)continue;const N=A.captureIndices[0].start;if(!(N>=c)&&(c=N,d=A.captureIndices,m=A.ruleId,p=v.priority,c===s))break}return d?{priorityMatch:p===-1,captureIndices:d,matchedRuleId:m}:null}function vv(e,t,n,r,s){return{ruleScanner:e.compileAG(t,n,r,s),findOptions:0}}function H4(e,t,n,r,s){return{ruleScanner:e.compileWhileAG(t,n,r,s),findOptions:0}}function Mu(e,t,n,r,s,l,o){if(l.length===0)return;const c=t.content,d=Math.min(l.length,o.length),m=[],p=o[0].end;for(let g=0;g<d;g++){const y=l[g];if(y===null)continue;const E=o[g];if(E.length===0)continue;if(E.start>p)break;for(;m.length>0&&m[m.length-1].endPos<=E.start;)s.produceFromScopes(m[m.length-1].scopes,m[m.length-1].endPos),m.pop();if(m.length>0?s.produceFromScopes(m[m.length-1].scopes,E.start):s.produce(r,E.start),y.retokenizeCapturedWithRuleId){const k=y.getName(c,o),C=r.contentNameScopesList.pushAttributed(k,e),S=y.getContentName(c,o),A=C.pushAttributed(S,e),N=r.push(y.retokenizeCapturedWithRuleId,E.start,-1,!1,null,C,A),U=e.createOnigString(c.substring(0,E.end));Tv(e,U,n&&E.start===0,E.start,N,s,!1,0),bv(U);continue}const v=y.getName(c,o);if(v!==null){const C=(m.length>0?m[m.length-1].scopes:r.contentNameScopesList).pushAttributed(v,e);m.push(new z4(C,E.end))}}for(;m.length>0;)s.produceFromScopes(m[m.length-1].scopes,m[m.length-1].endPos),m.pop()}var z4=class{constructor(e,t){le(this,"scopes");le(this,"endPos");this.scopes=e,this.endPos=t}};function F4(e,t,n,r,s,l,o,c){return new V4(e,t,n,r,s,l,o,c)}function QE(e,t,n,r,s){const l=mf(t,bf),o=Ev.getCompiledRuleId(n,r,s.repository);for(const c of l)e.push({debugSelector:t,matcher:c.matcher,ruleId:o,grammar:s,priority:c.priority})}function bf(e,t){if(t.length<e.length)return!1;let n=0;return e.every(r=>{for(let s=n;s<t.length;s++)if($4(t[s],r))return n=s+1,!0;return!1})}function $4(e,t){if(!e)return!1;if(e===t)return!0;const n=t.length;return e.length>n&&e.substr(0,n)===t&&e[n]==="."}var V4=class{constructor(e,t,n,r,s,l,o,c){le(this,"_rootId");le(this,"_lastRuleId");le(this,"_ruleId2desc");le(this,"_includedGrammars");le(this,"_grammarRepository");le(this,"_grammar");le(this,"_injections");le(this,"_basicScopeAttributesProvider");le(this,"_tokenTypeMatchers");if(this._rootScopeName=e,this.balancedBracketSelectors=l,this._onigLib=c,this._basicScopeAttributesProvider=new D4(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=XE(t,null),this._injections=null,this._tokenTypeMatchers=[],s)for(const d of Object.keys(s)){const m=mf(d,bf);for(const p of m)this._tokenTypeMatchers.push({matcher:p.matcher,type:s[d]})}}get themeProvider(){return this._grammarRepository}dispose(){for(const e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){const e={lookup:s=>s===this._rootScopeName?this._grammar:this.getExternalGrammar(s),injections:s=>this._grammarRepository.injections(s)},t=[],n=this._rootScopeName,r=e.lookup(n);if(r){const s=r.injections;if(s)for(let o in s)QE(t,o,s[o],this,r);const l=this._grammarRepository.injections(n);l&&l.forEach(o=>{const c=this.getExternalGrammar(o);if(c){const d=c.injectionSelector;d&&QE(t,d,c,this,c)}})}return t.sort((s,l)=>s.priority-l.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){const t=++this._lastRuleId,n=e(t);return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[e]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){const n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=XE(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){const r=this._tokenize(e,t,!1,n);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(e,t,n=0){const r=this._tokenize(e,t,!0,n);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(e,t,n,r){this._rootId===-1&&(this._rootId=Ev.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let s;if(!t||t===N0.NULL){s=!0;const m=this._basicScopeAttributesProvider.getDefaultAttributes(),p=this.themeProvider.getDefaults(),g=xo.set(0,m.languageId,m.tokenType,null,p.fontStyle,p.foregroundId,p.backgroundId),y=this.getRule(this._rootId).getName(null,null);let E;y?E=Fu.createRootAndLookUpScopeName(y,g,this):E=Fu.createRoot("unknown",g),t=new N0(null,this._rootId,-1,-1,!1,null,E,E)}else s=!1,t.reset();e=e+`
|
|
94
|
+
`;const l=this.createOnigString(e),o=l.content.length,c=new q4(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),d=Tv(this,l,s,0,t,c,!0,r);return bv(l),{lineLength:o,lineTokens:c,ruleStack:d.stack,stoppedEarly:d.stoppedEarly}}};function XE(e,t){return e=u4(e),e.repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var Fu=class Pa{constructor(t,n,r){this.parent=t,this.scopePath=n,this.tokenAttributes=r}static fromExtension(t,n){let r=t,s=(t==null?void 0:t.scopePath)??null;for(const l of n)s=Ap.push(s,l.scopeNames),r=new Pa(r,s,l.encodedTokenAttributes);return r}static createRoot(t,n){return new Pa(null,new Ap(null,t),n)}static createRootAndLookUpScopeName(t,n,r){const s=r.getMetadataForScope(t),l=new Ap(null,t),o=r.themeProvider.themeMatch(l),c=Pa.mergeAttributes(n,s,o);return new Pa(null,l,c)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return Pa.equals(this,t)}static equals(t,n){do{if(t===n||!t&&!n)return!0;if(!t||!n||t.scopeName!==n.scopeName||t.tokenAttributes!==n.tokenAttributes)return!1;t=t.parent,n=n.parent}while(!0)}static mergeAttributes(t,n,r){let s=-1,l=0,o=0;return r!==null&&(s=r.fontStyle,l=r.foregroundId,o=r.backgroundId),xo.set(t,n.languageId,n.tokenType,null,s,l,o)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(" ")===-1)return Pa._pushAttributed(this,t,n);const r=t.split(/ /g);let s=this;for(const l of r)s=Pa._pushAttributed(s,l,n);return s}static _pushAttributed(t,n,r){const s=r.getMetadataForScope(n),l=t.scopePath.push(n),o=r.themeProvider.themeMatch(l),c=Pa.mergeAttributes(t.tokenAttributes,s,o);return new Pa(t,l,c)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(t){var s;const n=[];let r=this;for(;r&&r!==t;)n.push({encodedTokenAttributes:r.tokenAttributes,scopeNames:r.scopePath.getExtensionIfDefined(((s=r.parent)==null?void 0:s.scopePath)??null)}),r=r.parent;return r===t?n.reverse():void 0}},na,N0=(na=class{constructor(t,n,r,s,l,o,c,d){le(this,"_stackElementBrand");le(this,"_enterPos");le(this,"_anchorPos");le(this,"depth");this.parent=t,this.ruleId=n,this.beginRuleCapturedEOL=l,this.endRule=o,this.nameScopesList=c,this.contentNameScopesList=d,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=r,this._anchorPos=s}equals(t){return t===null?!1:na._equals(this,t)}static _equals(t,n){return t===n?!0:this._structuralEquals(t,n)?Fu.equals(t.contentNameScopesList,n.contentNameScopesList):!1}static _structuralEquals(t,n){do{if(t===n||!t&&!n)return!0;if(!t||!n||t.depth!==n.depth||t.ruleId!==n.ruleId||t.endRule!==n.endRule)return!1;t=t.parent,n=n.parent}while(!0)}clone(){return this}static _reset(t){for(;t;)t._enterPos=-1,t._anchorPos=-1,t=t.parent}reset(){na._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,r,s,l,o,c){return new na(this,t,n,r,s,l,o,c)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(t){return t.getRule(this.ruleId)}toString(){const t=[];return this._writeString(t,0),"["+t.join(",")+"]"}_writeString(t,n){var r,s;return this.parent&&(n=this.parent._writeString(t,n)),t[n++]=`(${this.ruleId}, ${(r=this.nameScopesList)==null?void 0:r.toString()}, ${(s=this.contentNameScopesList)==null?void 0:s.toString()})`,n}withContentNameScopesList(t){return this.contentNameScopesList===t?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,t)}withEndRule(t){return this.endRule===t?this:new na(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(t){let n=this;for(;n&&n._enterPos===t._enterPos;){if(n.ruleId===t.ruleId)return!0;n=n.parent}return!1}toStateStackFrame(){var t,n,r;return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:((n=this.nameScopesList)==null?void 0:n.getExtensionIfDefined(((t=this.parent)==null?void 0:t.nameScopesList)??null))??[],contentNameScopesList:((r=this.contentNameScopesList)==null?void 0:r.getExtensionIfDefined(this.nameScopesList))??[]}}static pushFrame(t,n){const r=Fu.fromExtension((t==null?void 0:t.nameScopesList)??null,n.nameScopesList);return new na(t,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,Fu.fromExtension(r,n.contentNameScopesList))}},le(na,"NULL",new na(null,0,0,0,!1,null,null,null)),na),G4=class{constructor(e,t){le(this,"balancedBracketScopes");le(this,"unbalancedBracketScopes");le(this,"allowAny",!1);this.balancedBracketScopes=e.flatMap(n=>n==="*"?(this.allowAny=!0,[]):mf(n,bf).map(r=>r.matcher)),this.unbalancedBracketScopes=t.flatMap(n=>mf(n,bf).map(r=>r.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(const t of this.unbalancedBracketScopes)if(t(e))return!1;for(const t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},q4=class{constructor(e,t,n,r){le(this,"_emitBinaryTokens");le(this,"_lineText");le(this,"_tokens");le(this,"_binaryTokens");le(this,"_lastTokenEndIndex");le(this,"_tokenTypeOverrides");this.balancedBracketSelectors=r,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){var r;if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let s=(e==null?void 0:e.tokenAttributes)??0,l=!1;if((r=this.balancedBracketSelectors)!=null&&r.matchesAlways&&(l=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const o=(e==null?void 0:e.getScopeNames())??[];for(const c of this._tokenTypeOverrides)c.matcher(o)&&(s=xo.set(s,0,c.type,null,-1,0,0));this.balancedBracketSelectors&&(l=this.balancedBracketSelectors.match(o))}if(l&&(s=xo.set(s,0,8,l,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===s){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(s),this._lastTokenEndIndex=t;return}const n=(e==null?void 0:e.getScopeNames())??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:n}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);const n=new Uint32Array(this._binaryTokens.length);for(let r=0,s=this._binaryTokens.length;r<s;r++)n[r]=this._binaryTokens[r];return n}},Y4=class{constructor(e,t){le(this,"_grammars",new Map);le(this,"_rawGrammars",new Map);le(this,"_injectionGrammars",new Map);le(this,"_theme");this._onigLib=t,this._theme=e}dispose(){for(const e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}grammarForScopeName(e,t,n,r,s){if(!this._grammars.has(e)){let l=this._rawGrammars.get(e);if(!l)return null;this._grammars.set(e,F4(e,l,t,n,r,s,this,this._onigLib))}return this._grammars.get(e)}},W4=class{constructor(t){le(this,"_options");le(this,"_syncRegistry");le(this,"_ensureGrammarCache");this._options=t,this._syncRegistry=new Y4(hf.createFromRawTheme(t.theme,t.colorMap),t.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(t,n){this._syncRegistry.setTheme(hf.createFromRawTheme(t,n))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(t,n,r){return this.loadGrammarWithConfiguration(t,n,{embeddedLanguages:r})}loadGrammarWithConfiguration(t,n,r){return this._loadGrammar(t,n,r.embeddedLanguages,r.tokenTypes,new G4(r.balancedBracketSelectors||[],r.unbalancedBracketSelectors||[]))}loadGrammar(t){return this._loadGrammar(t,0,null,null,null)}_loadGrammar(t,n,r,s,l){const o=new v4(this._syncRegistry,t);for(;o.Q.length>0;)o.Q.map(c=>this._loadSingleGrammar(c.scopeName)),o.processQueue();return this._grammarForScopeName(t,n,r,s,l)}_loadSingleGrammar(t){this._ensureGrammarCache.has(t)||(this._doLoadSingleGrammar(t),this._ensureGrammarCache.set(t,!0))}_doLoadSingleGrammar(t){const n=this._options.loadGrammar(t);if(n){const r=typeof this._options.getInjections=="function"?this._options.getInjections(t):void 0;this._syncRegistry.addGrammar(n,r)}}addGrammar(t,n=[],r=0,s=null){return this._syncRegistry.addGrammar(t,n),this._grammarForScopeName(t.scopeName,r,s)}_grammarForScopeName(t,n=0,r=null,s=null,l=null){return this._syncRegistry.grammarForScopeName(t,n,r,s,l)}},R0=N0.NULL;const wv=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class pc{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}pc.prototype.normal={};pc.prototype.property={};pc.prototype.space=void 0;function kv(e,t){const n={},r={};for(const s of e)Object.assign(n,s.property),Object.assign(r,s.normal);return new pc(n,r,t)}function ac(e){return e.toLowerCase()}class kr{constructor(t,n){this.attribute=n,this.property=t}}kr.prototype.attribute="";kr.prototype.booleanish=!1;kr.prototype.boolean=!1;kr.prototype.commaOrSpaceSeparated=!1;kr.prototype.commaSeparated=!1;kr.prototype.defined=!1;kr.prototype.mustUseProperty=!1;kr.prototype.number=!1;kr.prototype.overloadedBoolean=!1;kr.prototype.property="";kr.prototype.spaceSeparated=!1;kr.prototype.space=void 0;let Q4=0;const At=ml(),Pn=ml(),L0=ml(),Oe=ml(),cn=ml(),mo=ml(),jr=ml();function ml(){return 2**++Q4}const I0=Object.freeze(Object.defineProperty({__proto__:null,boolean:At,booleanish:Pn,commaOrSpaceSeparated:jr,commaSeparated:mo,number:Oe,overloadedBoolean:L0,spaceSeparated:cn},Symbol.toStringTag,{value:"Module"})),Rp=Object.keys(I0);class Ag extends kr{constructor(t,n,r,s){let l=-1;if(super(t,n),KE(this,"space",s),typeof r=="number")for(;++l<Rp.length;){const o=Rp[l];KE(this,Rp[l],(r&I0[o])===I0[o])}}}Ag.prototype.defined=!0;function KE(e,t,n){n&&(e[t]=n)}function Co(e){const t={},n={};for(const[r,s]of Object.entries(e.properties)){const l=new Ag(r,e.transform(e.attributes||{},r),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(l.mustUseProperty=!0),t[r]=l,n[ac(r)]=r,n[ac(l.attribute)]=r}return new pc(t,n,e.space)}const Cv=Co({properties:{ariaActiveDescendant:null,ariaAtomic:Pn,ariaAutoComplete:null,ariaBusy:Pn,ariaChecked:Pn,ariaColCount:Oe,ariaColIndex:Oe,ariaColSpan:Oe,ariaControls:cn,ariaCurrent:null,ariaDescribedBy:cn,ariaDetails:null,ariaDisabled:Pn,ariaDropEffect:cn,ariaErrorMessage:null,ariaExpanded:Pn,ariaFlowTo:cn,ariaGrabbed:Pn,ariaHasPopup:null,ariaHidden:Pn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:cn,ariaLevel:Oe,ariaLive:null,ariaModal:Pn,ariaMultiLine:Pn,ariaMultiSelectable:Pn,ariaOrientation:null,ariaOwns:cn,ariaPlaceholder:null,ariaPosInSet:Oe,ariaPressed:Pn,ariaReadOnly:Pn,ariaRelevant:null,ariaRequired:Pn,ariaRoleDescription:cn,ariaRowCount:Oe,ariaRowIndex:Oe,ariaRowSpan:Oe,ariaSelected:Pn,ariaSetSize:Oe,ariaSort:null,ariaValueMax:Oe,ariaValueMin:Oe,ariaValueNow:Oe,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Sv(e,t){return t in e?e[t]:t}function Av(e,t){return Sv(e,t.toLowerCase())}const X4=Co({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:mo,acceptCharset:cn,accessKey:cn,action:null,allow:null,allowFullScreen:At,allowPaymentRequest:At,allowUserMedia:At,alt:null,as:null,async:At,autoCapitalize:null,autoComplete:cn,autoFocus:At,autoPlay:At,blocking:cn,capture:null,charSet:null,checked:At,cite:null,className:cn,cols:Oe,colSpan:null,content:null,contentEditable:Pn,controls:At,controlsList:cn,coords:Oe|mo,crossOrigin:null,data:null,dateTime:null,decoding:null,default:At,defer:At,dir:null,dirName:null,disabled:At,download:L0,draggable:Pn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:At,formTarget:null,headers:cn,height:Oe,hidden:L0,high:Oe,href:null,hrefLang:null,htmlFor:cn,httpEquiv:cn,id:null,imageSizes:null,imageSrcSet:null,inert:At,inputMode:null,integrity:null,is:null,isMap:At,itemId:null,itemProp:cn,itemRef:cn,itemScope:At,itemType:cn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:At,low:Oe,manifest:null,max:null,maxLength:Oe,media:null,method:null,min:null,minLength:Oe,multiple:At,muted:At,name:null,nonce:null,noModule:At,noValidate:At,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:At,optimum:Oe,pattern:null,ping:cn,placeholder:null,playsInline:At,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:At,referrerPolicy:null,rel:cn,required:At,reversed:At,rows:Oe,rowSpan:Oe,sandbox:cn,scope:null,scoped:At,seamless:At,selected:At,shadowRootClonable:At,shadowRootDelegatesFocus:At,shadowRootMode:null,shape:null,size:Oe,sizes:null,slot:null,span:Oe,spellCheck:Pn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Oe,step:null,style:null,tabIndex:Oe,target:null,title:null,translate:null,type:null,typeMustMatch:At,useMap:null,value:Pn,width:Oe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:cn,axis:null,background:null,bgColor:null,border:Oe,borderColor:null,bottomMargin:Oe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:At,declare:At,event:null,face:null,frame:null,frameBorder:null,hSpace:Oe,leftMargin:Oe,link:null,longDesc:null,lowSrc:null,marginHeight:Oe,marginWidth:Oe,noResize:At,noHref:At,noShade:At,noWrap:At,object:null,profile:null,prompt:null,rev:null,rightMargin:Oe,rules:null,scheme:null,scrolling:Pn,standby:null,summary:null,text:null,topMargin:Oe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Oe,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:At,disableRemotePlayback:At,prefix:null,property:null,results:Oe,security:null,unselectable:null},space:"html",transform:Av}),K4=Co({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:jr,accentHeight:Oe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Oe,amplitude:Oe,arabicForm:null,ascent:Oe,attributeName:null,attributeType:null,azimuth:Oe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Oe,by:null,calcMode:null,capHeight:Oe,className:cn,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:Oe,diffuseConstant:Oe,direction:null,display:null,dur:null,divisor:Oe,dominantBaseline:null,download:At,dx:null,dy:null,edgeMode:null,editable:null,elevation:Oe,enableBackground:null,end:null,event:null,exponent:Oe,externalResourcesRequired:null,fill:null,fillOpacity:Oe,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:mo,g2:mo,glyphName:mo,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Oe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Oe,horizOriginX:Oe,horizOriginY:Oe,id:null,ideographic:Oe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Oe,k:Oe,k1:Oe,k2:Oe,k3:Oe,k4:Oe,kernelMatrix:jr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Oe,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:Oe,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:Oe,overlineThickness:Oe,paintOrder:null,panose1:null,path:null,pathLength:Oe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:cn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Oe,pointsAtY:Oe,pointsAtZ:Oe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:jr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:jr,rev:jr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:jr,requiredFeatures:jr,requiredFonts:jr,requiredFormats:jr,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:Oe,specularExponent:Oe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Oe,strikethroughThickness:Oe,string:null,stroke:null,strokeDashArray:jr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Oe,strokeOpacity:Oe,strokeWidth:null,style:null,surfaceScale:Oe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:jr,tabIndex:Oe,tableValues:null,target:null,targetX:Oe,targetY:Oe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:jr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Oe,underlineThickness:Oe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Oe,values:null,vAlphabetic:Oe,vMathematical:Oe,vectorEffect:null,vHanging:Oe,vIdeographic:Oe,version:null,vertAdvY:Oe,vertOriginX:Oe,vertOriginY:Oe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Oe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Sv}),Nv=Co({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()}}),Rv=Co({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Av}),Lv=Co({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Z4={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"},J4=/[A-Z]/g,ZE=/-[a-z]/g,eR=/^data[-\w.:]+$/i;function gc(e,t){const n=ac(t);let r=t,s=kr;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&eR.test(t)){if(t.charAt(4)==="-"){const l=t.slice(5).replace(ZE,nR);r="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=t.slice(4);if(!ZE.test(l)){let o=l.replace(J4,tR);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}s=Ag}return new s(r,t)}function tR(e){return"-"+e.toLowerCase()}function nR(e){return e.charAt(1).toUpperCase()}const So=kv([Cv,X4,Nv,Rv,Lv],"html"),Va=kv([Cv,K4,Nv,Rv,Lv],"svg"),JE={}.hasOwnProperty;function Ng(e,t){const n=t||{};function r(s,...l){let o=r.invalid;const c=r.handlers;if(s&&JE.call(s,e)){const d=String(s[e]);o=JE.call(c,d)?c[d]:r.unknown}if(o)return o.call(this,s,...l)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const rR=/["&'<>`]/g,aR=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,iR=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,sR=/[|\\{}()[\]^$+*?.]/g,e2=new WeakMap;function lR(e,t){if(e=e.replace(t.subset?oR(t.subset):rR,r),t.subset||t.escapeOnly)return e;return e.replace(aR,n).replace(iR,r);function n(s,l,o){return t.format((s.charCodeAt(0)-55296)*1024+s.charCodeAt(1)-56320+65536,o.charCodeAt(l+2),t)}function r(s,l,o){return t.format(s.charCodeAt(0),o.charCodeAt(l+1),t)}}function oR(e){let t=e2.get(e);return t||(t=uR(e),e2.set(e,t)),t}function uR(e){const t=[];let n=-1;for(;++n<e.length;)t.push(e[n].replace(sR,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}const cR=/[\dA-Fa-f]/;function dR(e,t,n){const r="&#x"+e.toString(16).toUpperCase();return n&&t&&!cR.test(String.fromCharCode(t))?r:r+";"}const fR=/\d/;function hR(e,t,n){const r="&#"+String(e);return n&&t&&!fR.test(String.fromCharCode(t))?r:r+";"}const mR=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],Lp={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"",zwj:"",lrm:"",rlm:"",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},pR=["cent","copy","divide","gt","lt","not","para","times"],Iv={}.hasOwnProperty,O0={};let Ld;for(Ld in Lp)Iv.call(Lp,Ld)&&(O0[Lp[Ld]]=Ld);const gR=/[^\dA-Za-z]/;function bR(e,t,n,r){const s=String.fromCharCode(e);if(Iv.call(O0,s)){const l=O0[s],o="&"+l;return n&&mR.includes(l)&&!pR.includes(l)&&(!r||t&&t!==61&&gR.test(String.fromCharCode(t)))?o:o+";"}return""}function xR(e,t,n){let r=dR(e,t,n.omitOptionalSemicolons),s;if((n.useNamedReferences||n.useShortestReferences)&&(s=bR(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!s)&&n.useShortestReferences){const l=hR(e,t,n.omitOptionalSemicolons);l.length<r.length&&(r=l)}return s&&(!n.useShortestReferences||s.length<r.length)?s:r}function po(e,t){return lR(e,Object.assign({format:xR},t))}const yR=/^>|^->|<!--|-->|--!>|<!-$/g,ER=[">"],_R=["<",">"];function TR(e,t,n,r){return r.settings.bogusComments?"<?"+po(e.value,Object.assign({},r.settings.characterReferences,{subset:ER}))+">":"<!--"+e.value.replace(yR,s)+"-->";function s(l){return po(l,Object.assign({},r.settings.characterReferences,{subset:_R}))}}function vR(e,t,n,r){return"<!"+(r.settings.upperDoctype?"DOCTYPE":"doctype")+(r.settings.tightDoctype?"":" ")+"html>"}function xf(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 t2(e){const t=[],n=String(e||"");let r=n.indexOf(","),s=0,l=!1;for(;!l;){r===-1&&(r=n.length,l=!0);const o=n.slice(s,r).trim();(o||!l)&&t.push(o),s=r+1,r=n.indexOf(",",s)}return t}function Rg(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function n2(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function Lg(e){return e.join(" ").trim()}const wR=/[ \t\n\f\r]/g;function Ff(e){return typeof e=="object"?e.type==="text"?r2(e.value):!1:r2(e)}function r2(e){return e.replace(wR,"")===""}const $n=Dv(1),Ov=Dv(-1),kR=[];function Dv(e){return t;function t(n,r,s){const l=n?n.children:kR;let o=(r||0)+e,c=l[o];if(!s)for(;c&&Ff(c);)o+=e,c=l[o];return c}}const CR={}.hasOwnProperty;function jv(e){return t;function t(n,r,s){return CR.call(e,n.tagName)&&e[n.tagName](n,r,s)}}const Ig=jv({body:AR,caption:Ip,colgroup:Ip,dd:IR,dt:LR,head:Ip,html:SR,li:RR,optgroup:OR,option:DR,p:NR,rp:a2,rt:a2,tbody:MR,td:i2,tfoot:PR,th:i2,thead:jR,tr:BR});function Ip(e,t,n){const r=$n(n,t,!0);return!r||r.type!=="comment"&&!(r.type==="text"&&Ff(r.value.charAt(0)))}function SR(e,t,n){const r=$n(n,t);return!r||r.type!=="comment"}function AR(e,t,n){const r=$n(n,t);return!r||r.type!=="comment"}function NR(e,t,n){const r=$n(n,t);return r?r.type==="element"&&(r.tagName==="address"||r.tagName==="article"||r.tagName==="aside"||r.tagName==="blockquote"||r.tagName==="details"||r.tagName==="div"||r.tagName==="dl"||r.tagName==="fieldset"||r.tagName==="figcaption"||r.tagName==="figure"||r.tagName==="footer"||r.tagName==="form"||r.tagName==="h1"||r.tagName==="h2"||r.tagName==="h3"||r.tagName==="h4"||r.tagName==="h5"||r.tagName==="h6"||r.tagName==="header"||r.tagName==="hgroup"||r.tagName==="hr"||r.tagName==="main"||r.tagName==="menu"||r.tagName==="nav"||r.tagName==="ol"||r.tagName==="p"||r.tagName==="pre"||r.tagName==="section"||r.tagName==="table"||r.tagName==="ul"):!n||!(n.type==="element"&&(n.tagName==="a"||n.tagName==="audio"||n.tagName==="del"||n.tagName==="ins"||n.tagName==="map"||n.tagName==="noscript"||n.tagName==="video"))}function RR(e,t,n){const r=$n(n,t);return!r||r.type==="element"&&r.tagName==="li"}function LR(e,t,n){const r=$n(n,t);return!!(r&&r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd"))}function IR(e,t,n){const r=$n(n,t);return!r||r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd")}function a2(e,t,n){const r=$n(n,t);return!r||r.type==="element"&&(r.tagName==="rp"||r.tagName==="rt")}function OR(e,t,n){const r=$n(n,t);return!r||r.type==="element"&&r.tagName==="optgroup"}function DR(e,t,n){const r=$n(n,t);return!r||r.type==="element"&&(r.tagName==="option"||r.tagName==="optgroup")}function jR(e,t,n){const r=$n(n,t);return!!(r&&r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot"))}function MR(e,t,n){const r=$n(n,t);return!r||r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot")}function PR(e,t,n){return!$n(n,t)}function BR(e,t,n){const r=$n(n,t);return!r||r.type==="element"&&r.tagName==="tr"}function i2(e,t,n){const r=$n(n,t);return!r||r.type==="element"&&(r.tagName==="td"||r.tagName==="th")}const UR=jv({body:FR,colgroup:$R,head:zR,html:HR,tbody:VR});function HR(e){const t=$n(e,-1);return!t||t.type!=="comment"}function zR(e){const t=new Set;for(const r of e.children)if(r.type==="element"&&(r.tagName==="base"||r.tagName==="title")){if(t.has(r.tagName))return!1;t.add(r.tagName)}const n=e.children[0];return!n||n.type==="element"}function FR(e){const t=$n(e,-1,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&Ff(t.value.charAt(0)))&&!(t.type==="element"&&(t.tagName==="meta"||t.tagName==="link"||t.tagName==="script"||t.tagName==="style"||t.tagName==="template"))}function $R(e,t,n){const r=Ov(n,t),s=$n(e,-1,!0);return n&&r&&r.type==="element"&&r.tagName==="colgroup"&&Ig(r,n.children.indexOf(r),n)?!1:!!(s&&s.type==="element"&&s.tagName==="col")}function VR(e,t,n){const r=Ov(n,t),s=$n(e,-1);return n&&r&&r.type==="element"&&(r.tagName==="thead"||r.tagName==="tbody")&&Ig(r,n.children.indexOf(r),n)?!1:!!(s&&s.type==="element"&&s.tagName==="tr")}const Id={name:[[`
|
|
95
|
+
\f\r &/=>`.split(""),`
|
|
96
|
+
\f\r "&'/=>\``.split("")],[`\0
|
|
97
|
+
\f\r "&'/<=>`.split(""),`\0
|
|
98
|
+
\f\r "&'/<=>\``.split("")]],unquoted:[[`
|
|
99
|
+
\f\r &>`.split(""),`\0
|
|
100
|
+
\f\r "&'<=>\``.split("")],[`\0
|
|
101
|
+
\f\r "&'<=>\``.split(""),`\0
|
|
102
|
+
\f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function GR(e,t,n,r){const s=r.schema,l=s.space==="svg"?!1:r.settings.omitOptionalTags;let o=s.space==="svg"?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase());const c=[];let d;s.space==="html"&&e.tagName==="svg"&&(r.schema=Va);const m=qR(r,e.properties),p=r.all(s.space==="html"&&e.tagName==="template"?e.content:e);return r.schema=s,p&&(o=!1),(m||!l||!UR(e,t,n))&&(c.push("<",e.tagName,m?" "+m:""),o&&(s.space==="svg"||r.settings.closeSelfClosing)&&(d=m.charAt(m.length-1),(!r.settings.tightSelfClosing||d==="/"||d&&d!=='"'&&d!=="'")&&c.push(" "),c.push("/")),c.push(">")),c.push(p),!o&&(!l||!Ig(e,t,n))&&c.push("</"+e.tagName+">"),c.join("")}function qR(e,t){const n=[];let r=-1,s;if(t){for(s in t)if(t[s]!==null&&t[s]!==void 0){const l=YR(e,s,t[s]);l&&n.push(l)}}for(;++r<n.length;){const l=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&l!=='"'&&l!=="'"&&(n[r]+=" ")}return n.join("")}function YR(e,t,n){const r=gc(e.schema,t),s=e.settings.allowParseErrors&&e.schema.space==="html"?0:1,l=e.settings.allowDangerousCharacters?0:1;let o=e.quote,c;if(r.overloadedBoolean&&(n===r.attribute||n==="")?n=!0:(r.boolean||r.overloadedBoolean)&&(typeof n!="string"||n===r.attribute||n==="")&&(n=!!n),n==null||n===!1||typeof n=="number"&&Number.isNaN(n))return"";const d=po(r.attribute,Object.assign({},e.settings.characterReferences,{subset:Id.name[s][l]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?Rg:Lg)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?d:(e.settings.preferUnquoted&&(c=po(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:Id.unquoted[s][l]}))),c!==n&&(e.settings.quoteSmart&&xf(n,o)>xf(n,e.alternative)&&(o=e.alternative),c=o+po(n,Object.assign({},e.settings.characterReferences,{subset:(o==="'"?Id.single:Id.double)[s][l],attribute:!0}))+o),d+(c&&"="+c))}const WR=["<","&"];function Mv(e,t,n,r){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?e.value:po(e.value,Object.assign({},r.settings.characterReferences,{subset:WR}))}function QR(e,t,n,r){return r.settings.allowDangerousHtml?e.value:Mv(e,t,n,r)}function XR(e,t,n,r){return r.all(e)}const KR=Ng("type",{invalid:ZR,unknown:JR,handlers:{comment:TR,doctype:vR,element:GR,raw:QR,root:XR,text:Mv}});function ZR(e){throw new Error("Expected node, not `"+e+"`")}function JR(e){const t=e;throw new Error("Cannot compile unknown node `"+t.type+"`")}const eL={},tL={},nL=[];function rL(e,t){const n=t||eL,r=n.quote||'"',s=r==='"'?"'":'"';if(r!=='"'&&r!=="'")throw new Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:aL,all:iL,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||wv,characterReferences:n.characterReferences||tL,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?Va:So,quote:r,alternative:s}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}function aL(e,t,n){return KR(e,t,n,this)}function iL(e){const t=[],n=e&&e.children||nL;let r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join("")}function yf(e,t){const n=typeof e=="string"?{}:{...e.colorReplacements},r=typeof e=="string"?e:e.name;for(const[s,l]of Object.entries((t==null?void 0:t.colorReplacements)||{}))typeof l=="string"?n[s]=l:s===r&&Object.assign(n,l);return n}function Es(e,t){return e&&((t==null?void 0:t[e==null?void 0:e.toLowerCase()])||e)}function sL(e){return Array.isArray(e)?e:[e]}async function Pv(e){return Promise.resolve(typeof e=="function"?e():e).then(t=>t.default||t)}function Og(e){return!e||["plaintext","txt","text","plain"].includes(e)}function Bv(e){return e==="ansi"||Og(e)}function Dg(e){return e==="none"}function Uv(e){return Dg(e)}function Hv(e,t){var r;if(!t)return e;e.properties||(e.properties={}),(r=e.properties).class||(r.class=[]),typeof e.properties.class=="string"&&(e.properties.class=e.properties.class.split(/\s+/g)),Array.isArray(e.properties.class)||(e.properties.class=[]);const n=Array.isArray(t)?t:t.split(/\s+/g);for(const s of n)s&&!e.properties.class.includes(s)&&e.properties.class.push(s);return e}function $f(e,t=!1){var l;if(e.length===0)return[["",0]];const n=e.split(/(\r?\n)/g);let r=0;const s=[];for(let o=0;o<n.length;o+=2){const c=t?n[o]+(n[o+1]||""):n[o];s.push([c,r]),r+=n[o].length,r+=((l=n[o+1])==null?void 0:l.length)||0}return s}function lL(e){const t=$f(e,!0).map(([s])=>s);function n(s){if(s===e.length)return{line:t.length-1,character:t[t.length-1].length};let l=s,o=0;for(const c of t){if(l<c.length)break;l-=c.length,o++}return{line:o,character:l}}function r(s,l){let o=0;for(let c=0;c<s;c++)o+=t[c].length;return o+=l,o}return{lines:t,indexToPos:n,posToIndex:r}}const jg="light-dark()",oL=["color","background-color"];function uL(e,t){let n=0;const r=[];for(const s of t)s>n&&r.push({...e,content:e.content.slice(n,s),offset:e.offset+n}),n=s;return n<e.content.length&&r.push({...e,content:e.content.slice(n),offset:e.offset+n}),r}function cL(e,t){const n=Array.from(t instanceof Set?t:new Set(t)).sort((r,s)=>r-s);return n.length?e.map(r=>r.flatMap(s=>{const l=n.filter(o=>s.offset<o&&o<s.offset+s.content.length).map(o=>o-s.offset).sort((o,c)=>o-c);return l.length?uL(s,l):s})):e}function dL(e,t,n,r,s="css-vars"){const l={content:e.content,explanation:e.explanation,offset:e.offset},o=t.map(p=>Ef(e.variants[p])),c=new Set(o.flatMap(p=>Object.keys(p))),d={},m=(p,g)=>{const y=g==="color"?"":g==="background-color"?"-bg":`-${g}`;return n+t[p]+(g==="color"?"":y)};return o.forEach((p,g)=>{for(const y of c){const E=p[y]||"inherit";if(g===0&&r&&oL.includes(y))if(r===jg&&o.length>1){const v=t.findIndex(A=>A==="light"),k=t.findIndex(A=>A==="dark");if(v===-1||k===-1)throw new Bn('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const C=o[v][y]||"inherit",S=o[k][y]||"inherit";d[y]=`light-dark(${C}, ${S})`,s==="css-vars"&&(d[m(g,y)]=E)}else d[y]=E;else s==="css-vars"&&(d[m(g,y)]=E)}}),l.htmlStyle=d,l}function Ef(e){const t={};if(e.color&&(t.color=e.color),e.bgColor&&(t["background-color"]=e.bgColor),e.fontStyle){e.fontStyle&ar.Italic&&(t["font-style"]="italic"),e.fontStyle&ar.Bold&&(t["font-weight"]="bold");const n=[];e.fontStyle&ar.Underline&&n.push("underline"),e.fontStyle&ar.Strikethrough&&n.push("line-through"),n.length&&(t["text-decoration"]=n.join(" "))}return t}function D0(e){return typeof e=="string"?e:Object.entries(e).map(([t,n])=>`${t}:${n}`).join(";")}const zv=new WeakMap;function Vf(e,t){zv.set(e,t)}function ic(e){return zv.get(e)}class Ao{constructor(...t){le(this,"_stacks",{});le(this,"lang");if(t.length===2){const[n,r]=t;this.lang=r,this._stacks=n}else{const[n,r,s]=t;this.lang=r,this._stacks={[s]:n}}}get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(t,n){return new Ao(Object.fromEntries(sL(n).map(r=>[r,R0])),t)}getInternalStack(t=this.theme){return this._stacks[t]}getScopes(t=this.theme){return fL(this._stacks[t])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}}function fL(e){const t=[],n=new Set;function r(s){var o;if(n.has(s))return;n.add(s);const l=(o=s==null?void 0:s.nameScopesList)==null?void 0:o.scopeName;l&&t.push(l),s.parent&&r(s.parent)}return r(e),t}function hL(e,t){if(!(e instanceof Ao))throw new Bn("Invalid grammar state");return e.getInternalStack(t)}function mL(){const e=new WeakMap;function t(n){if(!e.has(n.meta)){let r=function(o){if(typeof o=="number"){if(o<0||o>n.source.length)throw new Bn(`Invalid decoration offset: ${o}. Code length: ${n.source.length}`);return{...s.indexToPos(o),offset:o}}else{const c=s.lines[o.line];if(c===void 0)throw new Bn(`Invalid decoration position ${JSON.stringify(o)}. Lines length: ${s.lines.length}`);let d=o.character;if(d<0&&(d=c.length+d),d<0||d>c.length)throw new Bn(`Invalid decoration position ${JSON.stringify(o)}. Line ${o.line} length: ${c.length}`);return{...o,character:d,offset:s.posToIndex(o.line,d)}}};const s=lL(n.source),l=(n.options.decorations||[]).map(o=>({...o,start:r(o.start),end:r(o.end)}));pL(l),e.set(n.meta,{decorations:l,converter:s,source:n.source})}return e.get(n.meta)}return{name:"shiki:decorations",tokens(n){var o;if(!((o=this.options.decorations)!=null&&o.length))return;const s=t(this).decorations.flatMap(c=>[c.start.offset,c.end.offset]);return cL(n,s)},code(n){var p;if(!((p=this.options.decorations)!=null&&p.length))return;const r=t(this),s=Array.from(n.children).filter(g=>g.type==="element"&&g.tagName==="span");if(s.length!==r.converter.lines.length)throw new Bn(`Number of lines in code element (${s.length}) does not match the number of lines in the source (${r.converter.lines.length}). Failed to apply decorations.`);function l(g,y,E,v){const k=s[g];let C="",S=-1,A=-1;if(y===0&&(S=0),E===0&&(A=0),E===Number.POSITIVE_INFINITY&&(A=k.children.length),S===-1||A===-1)for(let U=0;U<k.children.length;U++)C+=Fv(k.children[U]),S===-1&&C.length===y&&(S=U+1),A===-1&&C.length===E&&(A=U+1);if(S===-1)throw new Bn(`Failed to find start index for decoration ${JSON.stringify(v.start)}`);if(A===-1)throw new Bn(`Failed to find end index for decoration ${JSON.stringify(v.end)}`);const N=k.children.slice(S,A);if(!v.alwaysWrap&&N.length===k.children.length)c(k,v,"line");else if(!v.alwaysWrap&&N.length===1&&N[0].type==="element")c(N[0],v,"token");else{const U={type:"element",tagName:"span",properties:{},children:N};c(U,v,"wrapper"),k.children.splice(S,N.length,U)}}function o(g,y){s[g]=c(s[g],y,"line")}function c(g,y,E){var C;const v=y.properties||{},k=y.transform||(S=>S);return g.tagName=y.tagName||"span",g.properties={...g.properties,...v,class:g.properties.class},(C=y.properties)!=null&&C.class&&Hv(g,y.properties.class),g=k(g,E)||g,g}const d=[],m=r.decorations.sort((g,y)=>y.start.offset-g.start.offset||g.end.offset-y.end.offset);for(const g of m){const{start:y,end:E}=g;if(y.line===E.line)l(y.line,y.character,E.character,g);else if(y.line<E.line){l(y.line,y.character,Number.POSITIVE_INFINITY,g);for(let v=y.line+1;v<E.line;v++)d.unshift(()=>o(v,g));l(E.line,0,E.character,g)}}d.forEach(g=>g())}}}function pL(e){for(let t=0;t<e.length;t++){const n=e[t];if(n.start.offset>n.end.offset)throw new Bn(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let r=t+1;r<e.length;r++){const s=e[r],l=n.start.offset<=s.start.offset&&s.start.offset<n.end.offset,o=n.start.offset<s.end.offset&&s.end.offset<=n.end.offset,c=s.start.offset<=n.start.offset&&n.start.offset<s.end.offset,d=s.start.offset<n.end.offset&&n.end.offset<=s.end.offset;if(l||o||c||d){if(l&&o||c&&d||c&&n.start.offset===n.end.offset||o&&s.start.offset===s.end.offset)continue;throw new Bn(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(s.start)} intersect.`)}}}}function Fv(e){return e.type==="text"?e.value:e.type==="element"?e.children.map(Fv).join(""):""}const gL=[mL()];function _f(e){const t=bL(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...gL]}function bL(e){const t=[],n=[],r=[];for(const s of e)switch(s.enforce){case"pre":t.push(s);break;case"post":n.push(s);break;default:r.push(s)}return{pre:t,post:n,normal:r}}var al=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],Op={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function xL(e,t){const n=e.indexOf("\x1B",t);if(n!==-1&&e[n+1]==="["){const r=e.indexOf("m",n);if(r!==-1)return{sequence:e.substring(n+2,r).split(";"),startPosition:n,position:r+1}}return{position:e.length}}function s2(e){const t=e.shift();if(t==="2"){const n=e.splice(0,3).map(r=>Number.parseInt(r));return n.length!==3||n.some(r=>Number.isNaN(r))?void 0:{type:"rgb",rgb:n}}else if(t==="5"){const n=e.shift();if(n)return{type:"table",index:Number(n)}}}function yL(e){const t=[];for(;e.length>0;){const n=e.shift();if(!n)continue;const r=Number.parseInt(n);if(!Number.isNaN(r))if(r===0)t.push({type:"resetAll"});else if(r<=9)Op[r]&&t.push({type:"setDecoration",value:Op[r]});else if(r<=29){const s=Op[r-20];s&&(t.push({type:"resetDecoration",value:s}),s==="dim"&&t.push({type:"resetDecoration",value:"bold"}))}else if(r<=37)t.push({type:"setForegroundColor",value:{type:"named",name:al[r-30]}});else if(r===38){const s=s2(e);s&&t.push({type:"setForegroundColor",value:s})}else if(r===39)t.push({type:"resetForegroundColor"});else if(r<=47)t.push({type:"setBackgroundColor",value:{type:"named",name:al[r-40]}});else if(r===48){const s=s2(e);s&&t.push({type:"setBackgroundColor",value:s})}else r===49?t.push({type:"resetBackgroundColor"}):r===53?t.push({type:"setDecoration",value:"overline"}):r===55?t.push({type:"resetDecoration",value:"overline"}):r>=90&&r<=97?t.push({type:"setForegroundColor",value:{type:"named",name:al[r-90+8]}}):r>=100&&r<=107&&t.push({type:"setBackgroundColor",value:{type:"named",name:al[r-100+8]}})}return t}function EL(){let e=null,t=null,n=new Set;return{parse(r){const s=[];let l=0;do{const o=xL(r,l),c=o.sequence?r.substring(l,o.startPosition):r.substring(l);if(c.length>0&&s.push({value:c,foreground:e,background:t,decorations:new Set(n)}),o.sequence){const d=yL(o.sequence);for(const m of d)m.type==="resetAll"?(e=null,t=null,n.clear()):m.type==="resetForegroundColor"?e=null:m.type==="resetBackgroundColor"?t=null:m.type==="resetDecoration"&&n.delete(m.value);for(const m of d)m.type==="setForegroundColor"?e=m.value:m.type==="setBackgroundColor"?t=m.value:m.type==="setDecoration"&&n.add(m.value)}l=o.position}while(l<r.length);return s}}}var _L={black:"#000000",red:"#bb0000",green:"#00bb00",yellow:"#bbbb00",blue:"#0000bb",magenta:"#ff00ff",cyan:"#00bbbb",white:"#eeeeee",brightBlack:"#555555",brightRed:"#ff5555",brightGreen:"#00ff00",brightYellow:"#ffff55",brightBlue:"#5555ff",brightMagenta:"#ff55ff",brightCyan:"#55ffff",brightWhite:"#ffffff"};function TL(e=_L){function t(c){return e[c]}function n(c){return`#${c.map(d=>Math.max(0,Math.min(d,255)).toString(16).padStart(2,"0")).join("")}`}let r;function s(){if(r)return r;r=[];for(let m=0;m<al.length;m++)r.push(t(al[m]));let c=[0,95,135,175,215,255];for(let m=0;m<6;m++)for(let p=0;p<6;p++)for(let g=0;g<6;g++)r.push(n([c[m],c[p],c[g]]));let d=8;for(let m=0;m<24;m++,d+=10)r.push(n([d,d,d]));return r}function l(c){return s()[c]}function o(c){switch(c.type){case"named":return t(c.name);case"rgb":return n(c.rgb);case"table":return l(c.index)}}return{value:o}}const vL={black:"#000000",red:"#cd3131",green:"#0DBC79",yellow:"#E5E510",blue:"#2472C8",magenta:"#BC3FBC",cyan:"#11A8CD",white:"#E5E5E5",brightBlack:"#666666",brightRed:"#F14C4C",brightGreen:"#23D18B",brightYellow:"#F5F543",brightBlue:"#3B8EEA",brightMagenta:"#D670D6",brightCyan:"#29B8DB",brightWhite:"#FFFFFF"};function wL(e,t,n){const r=yf(e,n),s=$f(t),l=Object.fromEntries(al.map(d=>{var g;const m=`terminal.ansi${d[0].toUpperCase()}${d.substring(1)}`,p=(g=e.colors)==null?void 0:g[m];return[d,p||vL[d]]})),o=TL(l),c=EL();return s.map(d=>c.parse(d[0]).map(m=>{let p,g;m.decorations.has("reverse")?(p=m.background?o.value(m.background):e.bg,g=m.foreground?o.value(m.foreground):e.fg):(p=m.foreground?o.value(m.foreground):e.fg,g=m.background?o.value(m.background):void 0),p=Es(p,r),g=Es(g,r),m.decorations.has("dim")&&(p=kL(p));let y=ar.None;return m.decorations.has("bold")&&(y|=ar.Bold),m.decorations.has("italic")&&(y|=ar.Italic),m.decorations.has("underline")&&(y|=ar.Underline),m.decorations.has("strikethrough")&&(y|=ar.Strikethrough),{content:m.value,offset:d[1],color:p,bgColor:g,fontStyle:y}}))}function kL(e){const t=e.match(/#([0-9a-f]{3,8})/i);if(t){const r=t[1];if(r.length===8){const s=Math.round(Number.parseInt(r.slice(6,8),16)/2).toString(16).padStart(2,"0");return`#${r.slice(0,6)}${s}`}else{if(r.length===6)return`#${r}80`;if(r.length===4){const s=r[0],l=r[1],o=r[2],c=r[3],d=Math.round(Number.parseInt(`${c}${c}`,16)/2).toString(16).padStart(2,"0");return`#${s}${s}${l}${l}${o}${o}${d}`}else if(r.length===3){const s=r[0],l=r[1],o=r[2];return`#${s}${s}${l}${l}${o}${o}80`}}}const n=e.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);return n?`var(${n[1]}-dim)`:e}function Mg(e,t,n={}){const{theme:r=e.getLoadedThemes()[0]}=n,s=e.resolveLangAlias(n.lang||"text");if(Og(s)||Dg(r))return $f(t).map(d=>[{content:d[0],offset:d[1]}]);const{theme:l,colorMap:o}=e.setTheme(r);if(s==="ansi")return wL(l,t,n);const c=e.getLanguage(n.lang||"text");if(n.grammarState){if(n.grammarState.lang!==c.name)throw new Bn(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${c.name}"`);if(!n.grammarState.themes.includes(l.name))throw new Bn(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${l.name}"`)}return SL(t,c,l,o,n)}function CL(...e){if(e.length===2)return ic(e[1]);const[t,n,r={}]=e,{lang:s="text",theme:l=t.getLoadedThemes()[0]}=r;if(Og(s)||Dg(l))throw new Bn("Plain language does not have grammar state");if(s==="ansi")throw new Bn("ANSI language does not have grammar state");const{theme:o,colorMap:c}=t.setTheme(l),d=t.getLanguage(s);return new Ao(Pg(n,d,o,c,r).stateStack,d.name,o.name)}function SL(e,t,n,r,s){const l=Pg(e,t,n,r,s),o=new Ao(l.stateStack,t.name,n.name);return Vf(l.tokens,o),l.tokens}function Pg(e,t,n,r,s){const l=yf(n,s),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:c=500}=s,d=$f(e);let m=s.grammarState?hL(s.grammarState,n.name)??R0:s.grammarContextCode!=null?Pg(s.grammarContextCode,t,n,r,{...s,grammarState:void 0,grammarContextCode:void 0}).stateStack:R0,p=[];const g=[];for(let y=0,E=d.length;y<E;y++){const[v,k]=d[y];if(v===""){p=[],g.push([]);continue}if(o>0&&v.length>=o){p=[],g.push([{content:v,offset:k,color:"",fontStyle:0}]);continue}let C,S,A;s.includeExplanation&&(C=t.tokenizeLine(v,m,c),S=C.tokens,A=0);const N=t.tokenizeLine2(v,m,c),U=N.tokens.length/2;for(let G=0;G<U;G++){const P=N.tokens[2*G],H=G+1<U?N.tokens[2*G+2]:v.length;if(P===H)continue;const Y=N.tokens[2*G+1],ue=Es(r[xo.getForeground(Y)],l),M=xo.getFontStyle(Y),K={content:v.substring(P,H),offset:k+P,color:ue,fontStyle:M};if(s.includeExplanation){const F=[];if(s.includeExplanation!=="scopeName")for(const ce of n.settings){let ne;switch(typeof ce.scope){case"string":ne=ce.scope.split(/,/).map(z=>z.trim());break;case"object":ne=ce.scope;break;default:continue}F.push({settings:ce,selectors:ne.map(z=>z.split(/ /))})}K.explanation=[];let ge=0;for(;P+ge<H;){const ce=S[A],ne=v.substring(ce.startIndex,ce.endIndex);ge+=ne.length,K.explanation.push({content:ne,scopes:s.includeExplanation==="scopeName"?AL(ce.scopes):NL(F,ce.scopes)}),A+=1}}p.push(K)}g.push(p),p=[],m=N.ruleStack}return{tokens:g,stateStack:m}}function AL(e){return e.map(t=>({scopeName:t}))}function NL(e,t){const n=[];for(let r=0,s=t.length;r<s;r++){const l=t[r];n[r]={scopeName:l,themeMatches:LL(e,l,t.slice(0,r))}}return n}function l2(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]==="."}function RL(e,t,n){if(!l2(e[e.length-1],t))return!1;let r=e.length-2,s=n.length-1;for(;r>=0&&s>=0;)l2(e[r],n[s])&&(r-=1),s-=1;return r===-1}function LL(e,t,n){const r=[];for(const{selectors:s,settings:l}of e)for(const o of s)if(RL(o,t,n)){r.push(l);break}return r}function $v(e,t,n){const r=Object.entries(n.themes).filter(d=>d[1]).map(d=>({color:d[0],theme:d[1]})),s=r.map(d=>{const m=Mg(e,t,{...n,theme:d.theme}),p=ic(m),g=typeof d.theme=="string"?d.theme:d.theme.name;return{tokens:m,state:p,theme:g}}),l=IL(...s.map(d=>d.tokens)),o=l[0].map((d,m)=>d.map((p,g)=>{const y={content:p.content,variants:{},offset:p.offset};return"includeExplanation"in n&&n.includeExplanation&&(y.explanation=p.explanation),l.forEach((E,v)=>{const{content:k,explanation:C,offset:S,...A}=E[m][g];y.variants[r[v].color]=A}),y})),c=s[0].state?new Ao(Object.fromEntries(s.map(d=>{var m;return[d.theme,(m=d.state)==null?void 0:m.getInternalStack(d.theme)]})),s[0].state.lang):void 0;return c&&Vf(o,c),o}function IL(...e){const t=e.map(()=>[]),n=e.length;for(let r=0;r<e[0].length;r++){const s=e.map(d=>d[r]),l=t.map(()=>[]);t.forEach((d,m)=>d.push(l[m]));const o=s.map(()=>0),c=s.map(d=>d[0]);for(;c.every(d=>d);){const d=Math.min(...c.map(m=>m.content.length));for(let m=0;m<n;m++){const p=c[m];p.content.length===d?(l[m].push(p),o[m]+=1,c[m]=s[m][o[m]]):(l[m].push({...p,content:p.content.slice(0,d)}),c[m]={...p,content:p.content.slice(d),offset:p.offset+d})}}}return t}function Tf(e,t,n){let r,s,l,o,c,d;if("themes"in n){const{defaultColor:m="light",cssVariablePrefix:p="--shiki-",colorsRendering:g="css-vars"}=n,y=Object.entries(n.themes).filter(S=>S[1]).map(S=>({color:S[0],theme:S[1]})).sort((S,A)=>S.color===m?-1:A.color===m?1:0);if(y.length===0)throw new Bn("`themes` option must not be empty");const E=$v(e,t,n);if(d=ic(E),m&&jg!==m&&!y.find(S=>S.color===m))throw new Bn(`\`themes\` option must contain the defaultColor key \`${m}\``);const v=y.map(S=>e.getTheme(S.theme)),k=y.map(S=>S.color);l=E.map(S=>S.map(A=>dL(A,k,p,m,g))),d&&Vf(l,d);const C=y.map(S=>yf(S.theme,n));s=o2(y,v,C,p,m,"fg",g),r=o2(y,v,C,p,m,"bg",g),o=`shiki-themes ${v.map(S=>S.name).join(" ")}`,c=m?void 0:[s,r].join(";")}else if("theme"in n){const m=yf(n.theme,n);l=Mg(e,t,n);const p=e.getTheme(n.theme);r=Es(p.bg,m),s=Es(p.fg,m),o=p.name,d=ic(l)}else throw new Bn("Invalid options, either `theme` or `themes` must be provided");return{tokens:l,fg:s,bg:r,themeName:o,rootStyle:c,grammarState:d}}function o2(e,t,n,r,s,l,o){return e.map((c,d)=>{const m=Es(t[d][l],n[d])||"inherit",p=`${r+c.color}${l==="bg"?"-bg":""}:${m}`;if(d===0&&s){if(s===jg&&e.length>1){const g=e.findIndex(k=>k.color==="light"),y=e.findIndex(k=>k.color==="dark");if(g===-1||y===-1)throw new Bn('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const E=Es(t[g][l],n[g])||"inherit",v=Es(t[y][l],n[y])||"inherit";return`light-dark(${E}, ${v});${p}`}return m}return o==="css-vars"?p:null}).filter(c=>!!c).join(";")}function vf(e,t,n,r={meta:{},options:n,codeToHast:(s,l)=>vf(e,s,l),codeToTokens:(s,l)=>Tf(e,s,l)}){var v,k;let s=t;for(const C of _f(n))s=((v=C.preprocess)==null?void 0:v.call(r,s,n))||s;let{tokens:l,fg:o,bg:c,themeName:d,rootStyle:m,grammarState:p}=Tf(e,s,n);const{mergeWhitespaces:g=!0,mergeSameStyleTokens:y=!1}=n;g===!0?l=DL(l):g==="never"&&(l=jL(l)),y&&(l=ML(l));const E={...r,get source(){return s}};for(const C of _f(n))l=((k=C.tokens)==null?void 0:k.call(E,l))||l;return OL(l,{...n,fg:o,bg:c,themeName:d,rootStyle:n.rootStyle===!1?!1:n.rootStyle??m},E,p)}function OL(e,t,n,r=ic(e)){var k,C,S,A;const s=_f(t),l=[],o={type:"root",children:[]},{structure:c="classic",tabindex:d="0"}=t,m={class:`shiki ${t.themeName||""}`};t.rootStyle!==!1&&(t.rootStyle!=null?m.style=t.rootStyle:m.style=`background-color:${t.bg};color:${t.fg}`),d!==!1&&d!=null&&(m.tabindex=d.toString());for(const[N,U]of Object.entries(t.meta||{}))N.startsWith("_")||(m[N]=U);let p={type:"element",tagName:"pre",properties:m,children:[],data:t.data},g={type:"element",tagName:"code",properties:{},children:l};const y=[],E={...n,structure:c,addClassToHast:Hv,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return o},get pre(){return p},get code(){return g},get lines(){return y}};if(e.forEach((N,U)=>{var H,Y;U&&(c==="inline"?o.children.push({type:"element",tagName:"br",properties:{},children:[]}):c==="classic"&&l.push({type:"text",value:`
|
|
103
|
+
`}));let G={type:"element",tagName:"span",properties:{class:"line"},children:[]},P=0;for(const ue of N){let M={type:"element",tagName:"span",properties:{...ue.htmlAttrs},children:[{type:"text",value:ue.content}]};const K=D0(ue.htmlStyle||Ef(ue));K&&(M.properties.style=K);for(const F of s)M=((H=F==null?void 0:F.span)==null?void 0:H.call(E,M,U+1,P,G,ue))||M;c==="inline"?o.children.push(M):c==="classic"&&G.children.push(M),P+=ue.content.length}if(c==="classic"){for(const ue of s)G=((Y=ue==null?void 0:ue.line)==null?void 0:Y.call(E,G,U+1))||G;y.push(G),l.push(G)}else c==="inline"&&y.push(G)}),c==="classic"){for(const N of s)g=((k=N==null?void 0:N.code)==null?void 0:k.call(E,g))||g;p.children.push(g);for(const N of s)p=((C=N==null?void 0:N.pre)==null?void 0:C.call(E,p))||p;o.children.push(p)}else if(c==="inline"){const N=[];let U={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(const H of o.children)H.type==="element"&&H.tagName==="br"?(N.push(U),U={type:"element",tagName:"span",properties:{class:"line"},children:[]}):(H.type==="element"||H.type==="text")&&U.children.push(H);N.push(U);let P={type:"element",tagName:"code",properties:{},children:N};for(const H of s)P=((S=H==null?void 0:H.code)==null?void 0:S.call(E,P))||P;o.children=[];for(let H=0;H<P.children.length;H++){H>0&&o.children.push({type:"element",tagName:"br",properties:{},children:[]});const Y=P.children[H];Y.type==="element"&&o.children.push(...Y.children)}}let v=o;for(const N of s)v=((A=N==null?void 0:N.root)==null?void 0:A.call(E,v))||v;return r&&Vf(v,r),v}function DL(e){return e.map(t=>{const n=[];let r="",s;return t.forEach((l,o)=>{const d=!(l.fontStyle&&(l.fontStyle&ar.Underline||l.fontStyle&ar.Strikethrough));d&&l.content.match(/^\s+$/)&&t[o+1]?(s===void 0&&(s=l.offset),r+=l.content):r?(d?n.push({...l,offset:s,content:r+l.content}):n.push({content:r,offset:s},l),s=void 0,r=""):n.push(l)}),n})}function jL(e){return e.map(t=>t.flatMap(n=>{if(n.content.match(/^\s+$/))return n;const r=n.content.match(/^(\s*)(.*?)(\s*)$/);if(!r)return n;const[,s,l,o]=r;if(!s&&!o)return n;const c=[{...n,offset:n.offset+s.length,content:l}];return s&&c.unshift({content:s,offset:n.offset}),o&&c.push({content:o,offset:n.offset+s.length+l.length}),c}))}function ML(e){return e.map(t=>{const n=[];for(const r of t){if(n.length===0){n.push({...r});continue}const s=n[n.length-1],l=D0(s.htmlStyle||Ef(s)),o=D0(r.htmlStyle||Ef(r)),c=s.fontStyle&&(s.fontStyle&ar.Underline||s.fontStyle&ar.Strikethrough),d=r.fontStyle&&(r.fontStyle&ar.Underline||r.fontStyle&ar.Strikethrough);!c&&!d&&l===o?s.content+=r.content:n.push({...r})}return n})}const PL=rL;function BL(e,t,n){var l;const r={meta:{},options:n,codeToHast:(o,c)=>vf(e,o,c),codeToTokens:(o,c)=>Tf(e,o,c)};let s=PL(vf(e,t,n,r));for(const o of _f(n))s=((l=o.postprocess)==null?void 0:l.call(r,s,n))||s;return s}const u2={light:"#333333",dark:"#bbbbbb"},c2={light:"#fffffe",dark:"#1e1e1e"},d2="__shiki_resolved";function Bg(e){var c,d,m,p,g;if(e!=null&&e[d2])return e;const t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||(t.type="dark"),t.colorReplacements={...t.colorReplacements},t.settings||(t.settings=[]);let{bg:n,fg:r}=t;if(!n||!r){const y=t.settings?t.settings.find(E=>!E.name&&!E.scope):void 0;(c=y==null?void 0:y.settings)!=null&&c.foreground&&(r=y.settings.foreground),(d=y==null?void 0:y.settings)!=null&&d.background&&(n=y.settings.background),!r&&((m=t==null?void 0:t.colors)!=null&&m["editor.foreground"])&&(r=t.colors["editor.foreground"]),!n&&((p=t==null?void 0:t.colors)!=null&&p["editor.background"])&&(n=t.colors["editor.background"]),r||(r=t.type==="light"?u2.light:u2.dark),n||(n=t.type==="light"?c2.light:c2.dark),t.fg=r,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let s=0;const l=new Map;function o(y){var v;if(l.has(y))return l.get(y);s+=1;const E=`#${s.toString(16).padStart(8,"0").toLowerCase()}`;return(v=t.colorReplacements)!=null&&v[`#${E}`]?o(y):(l.set(y,E),E)}t.settings=t.settings.map(y=>{var C,S;const E=((C=y.settings)==null?void 0:C.foreground)&&!y.settings.foreground.startsWith("#"),v=((S=y.settings)==null?void 0:S.background)&&!y.settings.background.startsWith("#");if(!E&&!v)return y;const k={...y,settings:{...y.settings}};if(E){const A=o(y.settings.foreground);t.colorReplacements[A]=y.settings.foreground,k.settings.foreground=A}if(v){const A=o(y.settings.background);t.colorReplacements[A]=y.settings.background,k.settings.background=A}return k});for(const y of Object.keys(t.colors||{}))if((y==="editor.foreground"||y==="editor.background"||y.startsWith("terminal.ansi"))&&!((g=t.colors[y])!=null&&g.startsWith("#"))){const E=o(t.colors[y]);t.colorReplacements[E]=t.colors[y],t.colors[y]=E}return Object.defineProperty(t,d2,{enumerable:!1,writable:!1,value:!0}),t}async function Vv(e){return Array.from(new Set((await Promise.all(e.filter(t=>!Bv(t)).map(async t=>await Pv(t).then(n=>Array.isArray(n)?n:[n])))).flat()))}async function Gv(e){return(await Promise.all(e.map(async n=>Uv(n)?null:Bg(await Pv(n))))).filter(n=>!!n)}let UL=3;function HL(e,t=3){t>UL||console.trace(`[SHIKI DEPRECATE]: ${e}`)}let co=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function qv(e,t){if(!t)return e;if(t[e]){const n=new Set([e]);for(;t[e];){if(e=t[e],n.has(e))throw new co(`Circular alias \`${Array.from(n).join(" -> ")} -> ${e}\``);n.add(e)}}return e}class zL extends W4{constructor(n,r,s,l={}){super(n);le(this,"_resolvedThemes",new Map);le(this,"_resolvedGrammars",new Map);le(this,"_langMap",new Map);le(this,"_langGraph",new Map);le(this,"_textmateThemeCache",new WeakMap);le(this,"_loadedThemesCache",null);le(this,"_loadedLanguagesCache",null);this._resolver=n,this._themes=r,this._langs=s,this._alias=l,this._themes.map(o=>this.loadTheme(o)),this.loadLanguages(this._langs)}getTheme(n){return typeof n=="string"?this._resolvedThemes.get(n):this.loadTheme(n)}loadTheme(n){const r=Bg(n);return r.name&&(this._resolvedThemes.set(r.name,r),this._loadedThemesCache=null),r}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(n){let r=this._textmateThemeCache.get(n);r||(r=hf.createFromRawTheme(n),this._textmateThemeCache.set(n,r)),this._syncRegistry.setTheme(r)}getGrammar(n){return n=qv(n,this._alias),this._resolvedGrammars.get(n)}loadLanguage(n){var o,c,d,m;if(this.getGrammar(n.name))return;const r=new Set([...this._langMap.values()].filter(p=>{var g;return(g=p.embeddedLangsLazy)==null?void 0:g.includes(n.name)}));this._resolver.addLanguage(n);const s={balancedBracketSelectors:n.balancedBracketSelectors||["*"],unbalancedBracketSelectors:n.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(n.scopeName,n);const l=this.loadGrammarWithConfiguration(n.scopeName,1,s);if(l.name=n.name,this._resolvedGrammars.set(n.name,l),n.aliases&&n.aliases.forEach(p=>{this._alias[p]=n.name}),this._loadedLanguagesCache=null,r.size)for(const p of r)this._resolvedGrammars.delete(p.name),this._loadedLanguagesCache=null,(c=(o=this._syncRegistry)==null?void 0:o._injectionGrammars)==null||c.delete(p.scopeName),(m=(d=this._syncRegistry)==null?void 0:d._grammars)==null||m.delete(p.scopeName),this.loadLanguage(this._langMap.get(p.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(n){for(const l of n)this.resolveEmbeddedLanguages(l);const r=Array.from(this._langGraph.entries()),s=r.filter(([l,o])=>!o);if(s.length){const l=r.filter(([o,c])=>{if(!c)return!1;const d=c.embeddedLanguages||c.embeddedLangs;return d==null?void 0:d.some(m=>s.map(([p])=>p).includes(m))}).filter(o=>!s.includes(o));throw new co(`Missing languages ${s.map(([o])=>`\`${o}\``).join(", ")}, required by ${l.map(([o])=>`\`${o}\``).join(", ")}`)}for(const[l,o]of r)this._resolver.addLanguage(o);for(const[l,o]of r)this.loadLanguage(o)}getLoadedLanguages(){return this._loadedLanguagesCache||(this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])]),this._loadedLanguagesCache}resolveEmbeddedLanguages(n){this._langMap.set(n.name,n),this._langGraph.set(n.name,n);const r=n.embeddedLanguages??n.embeddedLangs;if(r)for(const s of r)this._langGraph.set(s,this._langMap.get(s))}}class FL{constructor(t,n){le(this,"_langs",new Map);le(this,"_scopeToLang",new Map);le(this,"_injections",new Map);le(this,"_onigLib");this._onigLib={createOnigScanner:r=>t.createScanner(r),createOnigString:r=>t.createString(r)},n.forEach(r=>this.addLanguage(r))}get onigLib(){return this._onigLib}getLangRegistration(t){return this._langs.get(t)}loadGrammar(t){return this._scopeToLang.get(t)}addLanguage(t){this._langs.set(t.name,t),t.aliases&&t.aliases.forEach(n=>{this._langs.set(n,t)}),this._scopeToLang.set(t.scopeName,t),t.injectTo&&t.injectTo.forEach(n=>{this._injections.get(n)||this._injections.set(n,[]),this._injections.get(n).push(t.scopeName)})}getInjections(t){const n=t.split(".");let r=[];for(let s=1;s<=n.length;s++){const l=n.slice(0,s).join(".");r=[...r,...this._injections.get(l)||[]]}return r}}let ku=0;function $L(e){ku+=1,e.warnings!==!1&&ku>=10&&ku%10===0&&console.warn(`[Shiki] ${ku} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let t=!1;if(!e.engine)throw new co("`engine` option is required for synchronous mode");const n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(Bg),s=new FL(e.engine,n),l=new zL(s,r,n,e.langAlias);let o;function c(N){return qv(N,e.langAlias)}function d(N){S();const U=l.getGrammar(typeof N=="string"?N:N.name);if(!U)throw new co(`Language \`${N}\` not found, you may need to load it first`);return U}function m(N){if(N==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};S();const U=l.getTheme(N);if(!U)throw new co(`Theme \`${N}\` not found, you may need to load it first`);return U}function p(N){S();const U=m(N);o!==N&&(l.setTheme(U),o=N);const G=l.getColorMap();return{theme:U,colorMap:G}}function g(){return S(),l.getLoadedThemes()}function y(){return S(),l.getLoadedLanguages()}function E(...N){S(),l.loadLanguages(N.flat(1))}async function v(...N){return E(await Vv(N))}function k(...N){S();for(const U of N.flat(1))l.loadTheme(U)}async function C(...N){return S(),k(await Gv(N))}function S(){if(t)throw new co("Shiki instance has been disposed")}function A(){t||(t=!0,l.dispose(),ku-=1)}return{setTheme:p,getTheme:m,getLanguage:d,getLoadedThemes:g,getLoadedLanguages:y,resolveLangAlias:c,loadLanguage:v,loadLanguageSync:E,loadTheme:C,loadThemeSync:k,dispose:A,[Symbol.dispose]:A}}async function VL(e){e.engine||HL("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[t,n,r]=await Promise.all([Gv(e.themes||[]),Vv(e.langs||[]),e.engine]);return $L({...e,themes:t,langs:n,engine:r})}async function GL(e){const t=await VL(e);return{getLastGrammarState:(...n)=>CL(t,...n),codeToTokensBase:(n,r)=>Mg(t,n,r),codeToTokensWithThemes:(n,r)=>$v(t,n,r),codeToTokens:(n,r)=>Tf(t,n,r),codeToHast:(n,r)=>vf(t,n,r),codeToHtml:(n,r)=>BL(t,n,r),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function qL(e){const t=e.langs,n=e.themes,r=e.engine;async function s(l){function o(g){var y;if(typeof g=="string"){if(g=((y=l.langAlias)==null?void 0:y[g])||g,Bv(g))return[];const E=t[g];if(!E)throw new Bn(`Language \`${g}\` is not included in this bundle. You may want to load it from external source.`);return E}return g}function c(g){if(Uv(g))return"none";if(typeof g=="string"){const y=n[g];if(!y)throw new Bn(`Theme \`${g}\` is not included in this bundle. You may want to load it from external source.`);return y}return g}const d=(l.themes??[]).map(g=>c(g)),m=(l.langs??[]).map(g=>o(g)),p=await GL({engine:l.engine??r(),...l,themes:d,langs:m});return{...p,loadLanguage(...g){return p.loadLanguage(...g.map(o))},loadTheme(...g){return p.loadTheme(...g.map(c))},getBundledLanguages(){return t},getBundledThemes(){return n}}}return s}const Ug=[{id:"abap",name:"ABAP",import:(()=>D(()=>import("./abap-BdImnpbu.js"),[]))},{id:"actionscript-3",name:"ActionScript",import:(()=>D(()=>import("./actionscript-3-CoDkCxhg.js"),[]))},{id:"ada",name:"Ada",import:(()=>D(()=>import("./ada-bCR0ucgS.js"),[]))},{id:"angular-html",name:"Angular HTML",import:(()=>D(()=>import("./angular-html-CU67Zn6k.js").then(e=>e.f),__vite__mapDeps([0,1,2,3])))},{id:"angular-ts",name:"Angular TypeScript",import:(()=>D(()=>import("./angular-ts-BwZT4LLn.js"),__vite__mapDeps([4,0,1,2,3,5])))},{id:"apache",name:"Apache Conf",import:(()=>D(()=>import("./apache-Pmp26Uib.js"),[]))},{id:"apex",name:"Apex",import:(()=>D(()=>import("./apex-D8_7TLub.js"),[]))},{id:"apl",name:"APL",import:(()=>D(()=>import("./apl-dKokRX4l.js"),__vite__mapDeps([6,1,2,3,7,8,9])))},{id:"applescript",name:"AppleScript",import:(()=>D(()=>import("./applescript-Co6uUVPk.js"),[]))},{id:"ara",name:"Ara",import:(()=>D(()=>import("./ara-BRHolxvo.js"),[]))},{id:"asciidoc",name:"AsciiDoc",aliases:["adoc"],import:(()=>D(()=>import("./asciidoc-Ve4PFQV2.js"),[]))},{id:"asm",name:"Assembly",import:(()=>D(()=>import("./asm-D_Q5rh1f.js"),[]))},{id:"astro",name:"Astro",import:(()=>D(()=>import("./astro-CbQHKStN.js"),__vite__mapDeps([10,9,2,11,3,12,13])))},{id:"awk",name:"AWK",import:(()=>D(()=>import("./awk-DMzUqQB5.js"),[]))},{id:"ballerina",name:"Ballerina",import:(()=>D(()=>import("./ballerina-BFfxhgS-.js"),[]))},{id:"bat",name:"Batch File",aliases:["batch"],import:(()=>D(()=>import("./bat-BkioyH1T.js"),[]))},{id:"beancount",name:"Beancount",import:(()=>D(()=>import("./beancount-k_qm7-4y.js"),[]))},{id:"berry",name:"Berry",aliases:["be"],import:(()=>D(()=>import("./berry-uYugtg8r.js"),[]))},{id:"bibtex",name:"BibTeX",import:(()=>D(()=>import("./bibtex-CHM0blh-.js"),[]))},{id:"bicep",name:"Bicep",import:(()=>D(()=>import("./bicep-Bmn6On1c.js"),[]))},{id:"bird2",name:"BIRD2 Configuration",aliases:["bird"],import:(()=>D(()=>import("./bird2-DPOp833l.js"),[]))},{id:"blade",name:"Blade",import:(()=>D(()=>import("./blade-D4QpJJKB.js"),__vite__mapDeps([14,15,1,2,3,7,8,16,9])))},{id:"bsl",name:"1C (Enterprise)",aliases:["1c"],import:(()=>D(()=>import("./bsl-BO_Y6i37.js"),__vite__mapDeps([17,18])))},{id:"c",name:"C",import:(()=>D(()=>import("./c-BIGW1oBm.js"),[]))},{id:"c3",name:"C3",import:(()=>D(()=>import("./c3-eo99z4R2.js"),[]))},{id:"cadence",name:"Cadence",aliases:["cdc"],import:(()=>D(()=>import("./cadence-Bv_4Rxtq.js"),[]))},{id:"cairo",name:"Cairo",import:(()=>D(()=>import("./cairo-KRGpt6FW.js"),__vite__mapDeps([19,20])))},{id:"clarity",name:"Clarity",import:(()=>D(()=>import("./clarity-D53aC0YG.js"),[]))},{id:"clojure",name:"Clojure",aliases:["clj"],import:(()=>D(()=>import("./clojure-P80f7IUj.js"),[]))},{id:"cmake",name:"CMake",import:(()=>D(()=>import("./cmake-D1j8_8rp.js"),[]))},{id:"cobol",name:"COBOL",import:(()=>D(()=>import("./cobol-nwyudZeR.js"),__vite__mapDeps([21,1,2,3,8])))},{id:"codeowners",name:"CODEOWNERS",import:(()=>D(()=>import("./codeowners-Bp6g37R7.js"),[]))},{id:"codeql",name:"CodeQL",aliases:["ql"],import:(()=>D(()=>import("./codeql-DsOJ9woJ.js"),[]))},{id:"coffee",name:"CoffeeScript",aliases:["coffeescript"],import:(()=>D(()=>import("./coffee-Ch7k5sss.js"),__vite__mapDeps([22,2])))},{id:"common-lisp",name:"Common Lisp",aliases:["lisp"],import:(()=>D(()=>import("./common-lisp-Cg-RD9OK.js"),[]))},{id:"coq",name:"Coq",import:(()=>D(()=>import("./coq-DkFqJrB1.js"),[]))},{id:"cpp",name:"C++",aliases:["c++"],import:(()=>D(()=>import("./cpp-CofmeUqb.js"),__vite__mapDeps([23,24,25,26,16])))},{id:"crystal",name:"Crystal",import:(()=>D(()=>import("./crystal-tKQVLTB8.js"),__vite__mapDeps([27,1,2,3,16,26,28])))},{id:"csharp",name:"C#",aliases:["c#","cs"],import:(()=>D(()=>import("./csharp-COcwbKMJ.js"),[]))},{id:"css",name:"CSS",import:(()=>D(()=>import("./css-DPfMkruS.js"),[]))},{id:"csv",name:"CSV",import:(()=>D(()=>import("./csv-fuZLfV_i.js"),[]))},{id:"cue",name:"CUE",import:(()=>D(()=>import("./cue-D82EKSYY.js"),[]))},{id:"cypher",name:"Cypher",aliases:["cql"],import:(()=>D(()=>import("./cypher-COkxafJQ.js"),[]))},{id:"d",name:"D",import:(()=>D(()=>import("./d-85-TOEBH.js"),[]))},{id:"dart",name:"Dart",import:(()=>D(()=>import("./dart-CF10PKvl.js"),[]))},{id:"dax",name:"DAX",import:(()=>D(()=>import("./dax-CEL-wOlO.js"),[]))},{id:"desktop",name:"Desktop",import:(()=>D(()=>import("./desktop-BmXAJ9_W.js"),[]))},{id:"diff",name:"Diff",import:(()=>D(()=>import("./diff-D97Zzqfu.js"),[]))},{id:"docker",name:"Dockerfile",aliases:["dockerfile"],import:(()=>D(()=>import("./docker-BcOcwvcX.js"),[]))},{id:"dotenv",name:"dotEnv",import:(()=>D(()=>import("./dotenv-Da5cRb03.js"),[]))},{id:"dream-maker",name:"Dream Maker",import:(()=>D(()=>import("./dream-maker-BtqSS_iP.js"),[]))},{id:"edge",name:"Edge",import:(()=>D(()=>import("./edge-BkV0erSs.js"),__vite__mapDeps([29,11,1,2,3,15])))},{id:"elixir",name:"Elixir",import:(()=>D(()=>import("./elixir-CDX3lj18.js"),__vite__mapDeps([30,1,2,3])))},{id:"elm",name:"Elm",import:(()=>D(()=>import("./elm-DbKCFpqz.js"),__vite__mapDeps([31,25,26])))},{id:"emacs-lisp",name:"Emacs Lisp",aliases:["elisp"],import:(()=>D(()=>import("./emacs-lisp-C9XAeP06.js"),[]))},{id:"erb",name:"ERB",import:(()=>D(()=>import("./erb-B12qg9BL.js"),__vite__mapDeps([32,1,2,3,33,34,7,8,16,35,11,36,13,23,24,25,26,28,37,38])))},{id:"erlang",name:"Erlang",aliases:["erl"],import:(()=>D(()=>import("./erlang-DsQrWhSR.js"),__vite__mapDeps([39,40])))},{id:"fennel",name:"Fennel",import:(()=>D(()=>import("./fennel-BYunw83y.js"),[]))},{id:"fish",name:"Fish",import:(()=>D(()=>import("./fish-BvzEVeQv.js"),[]))},{id:"fluent",name:"Fluent",aliases:["ftl"],import:(()=>D(()=>import("./fluent-C4IJs8-o.js"),[]))},{id:"fortran-fixed-form",name:"Fortran (Fixed Form)",aliases:["f","for","f77"],import:(()=>D(()=>import("./fortran-fixed-form-CkoXwp7k.js"),__vite__mapDeps([41,42])))},{id:"fortran-free-form",name:"Fortran (Free Form)",aliases:["f90","f95","f03","f08","f18"],import:(()=>D(()=>import("./fortran-free-form-BxgE0vQu.js"),[]))},{id:"fsharp",name:"F#",aliases:["f#","fs"],import:(()=>D(()=>import("./fsharp-CXgrBDvD.js"),__vite__mapDeps([43,40])))},{id:"gdresource",name:"GDResource",aliases:["tscn","tres"],import:(()=>D(()=>import("./gdresource-BOOCDP_w.js"),__vite__mapDeps([44,45,46])))},{id:"gdscript",name:"GDScript",aliases:["gd"],import:(()=>D(()=>import("./gdscript-C5YyOfLZ.js"),[]))},{id:"gdshader",name:"GDShader",import:(()=>D(()=>import("./gdshader-DkwncUOv.js"),[]))},{id:"genie",name:"Genie",import:(()=>D(()=>import("./genie-D0YGMca9.js"),[]))},{id:"gherkin",name:"Gherkin",import:(()=>D(()=>import("./gherkin-DyxjwDmM.js"),[]))},{id:"git-commit",name:"Git Commit Message",import:(()=>D(()=>import("./git-commit-F4YmCXRG.js"),__vite__mapDeps([47,48])))},{id:"git-rebase",name:"Git Rebase Message",import:(()=>D(()=>import("./git-rebase-r7XF79zn.js"),__vite__mapDeps([49,28])))},{id:"gleam",name:"Gleam",import:(()=>D(()=>import("./gleam-BspZqrRM.js"),[]))},{id:"glimmer-js",name:"Glimmer JS",aliases:["gjs"],import:(()=>D(()=>import("./glimmer-js-Rg0-pVw9.js"),__vite__mapDeps([50,2,11,3,1])))},{id:"glimmer-ts",name:"Glimmer TS",aliases:["gts"],import:(()=>D(()=>import("./glimmer-ts-U6CK756n.js"),__vite__mapDeps([51,11,3,2,1])))},{id:"glsl",name:"GLSL",import:(()=>D(()=>import("./glsl-DplSGwfg.js"),__vite__mapDeps([25,26])))},{id:"gn",name:"GN",import:(()=>D(()=>import("./gn-n2N0HUVH.js"),[]))},{id:"gnuplot",name:"Gnuplot",import:(()=>D(()=>import("./gnuplot-DdkO51Og.js"),[]))},{id:"go",name:"Go",import:(()=>D(()=>import("./go-CxLEBnE3.js"),[]))},{id:"graphql",name:"GraphQL",aliases:["gql"],import:(()=>D(()=>import("./graphql-ChdNCCLP.js"),__vite__mapDeps([35,2,11,36,13])))},{id:"groovy",name:"Groovy",import:(()=>D(()=>import("./groovy-gcz8RCvz.js"),[]))},{id:"hack",name:"Hack",import:(()=>D(()=>import("./hack-CaT9iCJl.js"),__vite__mapDeps([52,1,2,3,16])))},{id:"haml",name:"Ruby Haml",import:(()=>D(()=>import("./haml-B8DHNrY2.js"),__vite__mapDeps([34,2,3])))},{id:"handlebars",name:"Handlebars",aliases:["hbs"],import:(()=>D(()=>import("./handlebars-BL8al0AC.js"),__vite__mapDeps([53,1,2,3,38])))},{id:"haskell",name:"Haskell",aliases:["hs"],import:(()=>D(()=>import("./haskell-Df6bDoY_.js"),[]))},{id:"haxe",name:"Haxe",import:(()=>D(()=>import("./haxe-CzTSHFRz.js"),[]))},{id:"hcl",name:"HashiCorp HCL",import:(()=>D(()=>import("./hcl-BWvSN4gD.js"),[]))},{id:"hjson",name:"Hjson",import:(()=>D(()=>import("./hjson-D5-asLiD.js"),[]))},{id:"hlsl",name:"HLSL",import:(()=>D(()=>import("./hlsl-D3lLCCz7.js"),[]))},{id:"html",name:"HTML",import:(()=>D(()=>import("./html-GMplVEZG.js"),__vite__mapDeps([1,2,3])))},{id:"html-derivative",name:"HTML (Derivative)",import:(()=>D(()=>import("./html-derivative-BFtXZ54Q.js"),__vite__mapDeps([15,1,2,3])))},{id:"http",name:"HTTP",import:(()=>D(()=>import("./http-jrhK8wxY.js"),__vite__mapDeps([54,28,9,7,8,35,2,11,36,13])))},{id:"hurl",name:"Hurl",import:(()=>D(()=>import("./hurl-irOxFIW8.js"),__vite__mapDeps([55,35,2,11,36,13,7,8,56])))},{id:"hxml",name:"HXML",import:(()=>D(()=>import("./hxml-Bvhsp5Yf.js"),__vite__mapDeps([57,58])))},{id:"hy",name:"Hy",import:(()=>D(()=>import("./hy-DFXneXwc.js"),[]))},{id:"imba",name:"Imba",import:(()=>D(()=>import("./imba-DGztddWO.js"),[]))},{id:"ini",name:"INI",aliases:["properties"],import:(()=>D(()=>import("./ini-BEwlwnbL.js"),[]))},{id:"java",name:"Java",import:(()=>D(()=>import("./java-CylS5w8V.js"),[]))},{id:"javascript",name:"JavaScript",aliases:["js","cjs","mjs"],import:(()=>D(()=>import("./javascript-wDzz0qaB.js"),[]))},{id:"jinja",name:"Jinja",import:(()=>D(()=>import("./jinja-4LBKfQ-Z.js"),__vite__mapDeps([59,1,2,3])))},{id:"jison",name:"Jison",import:(()=>D(()=>import("./jison-wvAkD_A8.js"),__vite__mapDeps([60,2])))},{id:"json",name:"JSON",import:(()=>D(()=>import("./json-Cp-IABpG.js"),[]))},{id:"json5",name:"JSON5",import:(()=>D(()=>import("./json5-C9tS-k6U.js"),[]))},{id:"jsonc",name:"JSON with Comments",import:(()=>D(()=>import("./jsonc-Des-eS-w.js"),[]))},{id:"jsonl",name:"JSON Lines",import:(()=>D(()=>import("./jsonl-DcaNXYhu.js"),[]))},{id:"jsonnet",name:"Jsonnet",import:(()=>D(()=>import("./jsonnet-DFQXde-d.js"),[]))},{id:"jssm",name:"JSSM",aliases:["fsl"],import:(()=>D(()=>import("./jssm-C2t-YnRu.js"),[]))},{id:"jsx",name:"JSX",import:(()=>D(()=>import("./jsx-g9-lgVsj.js"),[]))},{id:"julia",name:"Julia",aliases:["jl"],import:(()=>D(()=>import("./julia-CxzCAyBv.js"),__vite__mapDeps([61,23,24,25,26,16,20,2,62])))},{id:"just",name:"Just",import:(()=>D(()=>import("./just-Cw27pwNe.js"),__vite__mapDeps([63,28,2,11,64,1,3,7,8,16,20,33,34,35,36,13,23,24,25,26,37,38])))},{id:"kdl",name:"KDL",import:(()=>D(()=>import("./kdl-DV7GczEv.js"),[]))},{id:"kotlin",name:"Kotlin",aliases:["kt","kts"],import:(()=>D(()=>import("./kotlin-BdnUsdx6.js"),[]))},{id:"kusto",name:"Kusto",aliases:["kql"],import:(()=>D(()=>import("./kusto-DZf3V79B.js"),[]))},{id:"latex",name:"LaTeX",import:(()=>D(()=>import("./latex-CWtU0Tv5.js"),__vite__mapDeps([65,66,62])))},{id:"lean",name:"Lean 4",aliases:["lean4"],import:(()=>D(()=>import("./lean-BZvkOJ9d.js"),[]))},{id:"less",name:"Less",import:(()=>D(()=>import("./less-B1dDrJ26.js"),[]))},{id:"liquid",name:"Liquid",import:(()=>D(()=>import("./liquid-DYVedYrR.js"),__vite__mapDeps([67,1,2,3,9])))},{id:"llvm",name:"LLVM IR",import:(()=>D(()=>import("./llvm-DjAJT7YJ.js"),[]))},{id:"log",name:"Log file",import:(()=>D(()=>import("./log-2UxHyX5q.js"),[]))},{id:"logo",name:"Logo",import:(()=>D(()=>import("./logo-BtOb2qkB.js"),[]))},{id:"lua",name:"Lua",import:(()=>D(()=>import("./lua-BaeVxFsk.js"),__vite__mapDeps([37,26])))},{id:"luau",name:"Luau",import:(()=>D(()=>import("./luau-C-HG3fhB.js"),[]))},{id:"make",name:"Makefile",aliases:["makefile"],import:(()=>D(()=>import("./make-CHLpvVh8.js"),[]))},{id:"markdown",name:"Markdown",aliases:["md"],import:(()=>D(()=>import("./markdown-Cvjx9yec.js"),[]))},{id:"marko",name:"Marko",import:(()=>D(()=>import("./marko-CnJfTvn9.js"),__vite__mapDeps([68,3,69,5,11])))},{id:"matlab",name:"MATLAB",import:(()=>D(()=>import("./matlab-D7o27uSR.js"),[]))},{id:"mdc",name:"MDC",import:(()=>D(()=>import("./mdc-BMNejdWA.js"),__vite__mapDeps([70,40,38,15,1,2,3])))},{id:"mdx",name:"MDX",import:(()=>D(()=>import("./mdx-Cmh6b_Ma.js"),[]))},{id:"mermaid",name:"Mermaid",aliases:["mmd"],import:(()=>D(()=>import("./mermaid-mWjccvbQ.js"),[]))},{id:"mipsasm",name:"MIPS Assembly",aliases:["mips"],import:(()=>D(()=>import("./mipsasm-CKIfxQSi.js"),[]))},{id:"mojo",name:"Mojo",import:(()=>D(()=>import("./mojo-rZm6bMo-.js"),[]))},{id:"moonbit",name:"MoonBit",aliases:["mbt","mbti"],import:(()=>D(()=>import("./moonbit-_H4v1dQx.js"),[]))},{id:"move",name:"Move",import:(()=>D(()=>import("./move-IF9eRakj.js"),[]))},{id:"narrat",name:"Narrat Language",aliases:["nar"],import:(()=>D(()=>import("./narrat-DRg8JJMk.js"),[]))},{id:"nextflow",name:"Nextflow",aliases:["nf"],import:(()=>D(()=>import("./nextflow-Zz6hmt5N.js"),__vite__mapDeps([71,72])))},{id:"nextflow-groovy",name:"nextflow-groovy",import:(()=>D(()=>import("./nextflow-groovy-BeH2EWoN.js"),[]))},{id:"nginx",name:"Nginx",import:(()=>D(()=>import("./nginx-BpAMiNFr.js"),__vite__mapDeps([73,37,26])))},{id:"nim",name:"Nim",import:(()=>D(()=>import("./nim-CVrawwO9.js"),__vite__mapDeps([74,26,1,2,3,7,8,25,40])))},{id:"nix",name:"Nix",import:(()=>D(()=>import("./nix-CwoSXNpI.js"),[]))},{id:"nushell",name:"nushell",aliases:["nu"],import:(()=>D(()=>import("./nushell-Cz2AlsmD.js"),[]))},{id:"objective-c",name:"Objective-C",aliases:["objc"],import:(()=>D(()=>import("./objective-c-DXmwc3jG.js"),[]))},{id:"objective-cpp",name:"Objective-C++",import:(()=>D(()=>import("./objective-cpp-CLxacb5B.js"),[]))},{id:"ocaml",name:"OCaml",import:(()=>D(()=>import("./ocaml-C0hk2d4L.js"),[]))},{id:"odin",name:"Odin",import:(()=>D(()=>import("./odin-BBf5iR-q.js"),[]))},{id:"openscad",name:"OpenSCAD",aliases:["scad"],import:(()=>D(()=>import("./openscad-C4EeE6gA.js"),[]))},{id:"pascal",name:"Pascal",import:(()=>D(()=>import("./pascal-D93ZcfNL.js"),[]))},{id:"perl",name:"Perl",import:(()=>D(()=>import("./perl-C0TMdlhV.js"),__vite__mapDeps([64,1,2,3,7,8,16])))},{id:"php",name:"PHP",import:(()=>D(()=>import("./php-Dhbhpdrm.js"),__vite__mapDeps([75,1,2,3,7,8,16,9])))},{id:"pkl",name:"Pkl",import:(()=>D(()=>import("./pkl-u5AG7uiY.js"),[]))},{id:"plsql",name:"PL/SQL",import:(()=>D(()=>import("./plsql-ChMvpjG-.js"),[]))},{id:"po",name:"Gettext PO",aliases:["pot","potx"],import:(()=>D(()=>import("./po-BTJTHyun.js"),[]))},{id:"polar",name:"Polar",import:(()=>D(()=>import("./polar-C0HS_06l.js"),[]))},{id:"postcss",name:"PostCSS",import:(()=>D(()=>import("./postcss-CXtECtnM.js"),[]))},{id:"powerquery",name:"PowerQuery",import:(()=>D(()=>import("./powerquery-CEu0bR-o.js"),[]))},{id:"powershell",name:"PowerShell",aliases:["ps","ps1"],import:(()=>D(()=>import("./powershell-Dpen1YoG.js"),[]))},{id:"prisma",name:"Prisma",import:(()=>D(()=>import("./prisma-Dd19v3D-.js"),[]))},{id:"prolog",name:"Prolog",import:(()=>D(()=>import("./prolog-CbFg5uaA.js"),[]))},{id:"proto",name:"Protocol Buffer 3",aliases:["protobuf"],import:(()=>D(()=>import("./proto-C7zT0LnQ.js"),[]))},{id:"pug",name:"Pug",aliases:["jade"],import:(()=>D(()=>import("./pug-CGlum2m_.js"),__vite__mapDeps([76,2,3,1])))},{id:"puppet",name:"Puppet",import:(()=>D(()=>import("./puppet-BMWR74SV.js"),[]))},{id:"purescript",name:"PureScript",import:(()=>D(()=>import("./purescript-CklMAg4u.js"),[]))},{id:"python",name:"Python",aliases:["py"],import:(()=>D(()=>import("./python-B6aJPvgy.js"),[]))},{id:"qml",name:"QML",import:(()=>D(()=>import("./qml-3beO22l8.js"),__vite__mapDeps([77,2])))},{id:"qmldir",name:"QML Directory",import:(()=>D(()=>import("./qmldir-C8lEn-DE.js"),[]))},{id:"qss",name:"Qt Style Sheets",import:(()=>D(()=>import("./qss-IeuSbFQv.js"),[]))},{id:"r",name:"R",import:(()=>D(()=>import("./r-Dspwwk_N.js"),[]))},{id:"racket",name:"Racket",import:(()=>D(()=>import("./racket-BqYA7rlc.js"),[]))},{id:"raku",name:"Raku",aliases:["perl6"],import:(()=>D(()=>import("./raku-DXvB9xmW.js"),[]))},{id:"razor",name:"ASP.NET Razor",import:(()=>D(()=>import("./razor-Uh8Bk_45.js"),__vite__mapDeps([78,1,2,3,79])))},{id:"reg",name:"Windows Registry Script",import:(()=>D(()=>import("./reg-C-SQnVFl.js"),[]))},{id:"regexp",name:"RegExp",aliases:["regex"],import:(()=>D(()=>import("./regexp-CDVJQ6XC.js"),[]))},{id:"rel",name:"Rel",import:(()=>D(()=>import("./rel-C3B-1QV4.js"),[]))},{id:"riscv",name:"RISC-V",import:(()=>D(()=>import("./riscv-BM1_JUlF.js"),[]))},{id:"ron",name:"RON",import:(()=>D(()=>import("./ron-D8l8udqQ.js"),[]))},{id:"rosmsg",name:"ROS Interface",import:(()=>D(()=>import("./rosmsg-BJDFO7_C.js"),[]))},{id:"rst",name:"reStructuredText",import:(()=>D(()=>import("./rst-BrH8l1NY.js"),__vite__mapDeps([80,15,1,2,3,23,24,25,26,16,20,28,38,81,33,34,7,8,35,11,36,13,37])))},{id:"ruby",name:"Ruby",aliases:["rb"],import:(()=>D(()=>import("./ruby-Dw2BHqvy.js"),__vite__mapDeps([33,1,2,3,34,7,8,16,35,11,36,13,23,24,25,26,28,37,38])))},{id:"rust",name:"Rust",aliases:["rs"],import:(()=>D(()=>import("./rust-B1yitclQ.js"),[]))},{id:"sas",name:"SAS",import:(()=>D(()=>import("./sas-cz2c8ADy.js"),__vite__mapDeps([82,16])))},{id:"sass",name:"Sass",import:(()=>D(()=>import("./sass-Cj5Yp3dK.js"),[]))},{id:"scala",name:"Scala",import:(()=>D(()=>import("./scala-C151Ov-r.js"),[]))},{id:"scheme",name:"Scheme",import:(()=>D(()=>import("./scheme-C98Dy4si.js"),[]))},{id:"scss",name:"SCSS",import:(()=>D(()=>import("./scss-OYdSNvt2.js"),__vite__mapDeps([5,3])))},{id:"sdbl",name:"1C (Query)",aliases:["1c-query"],import:(()=>D(()=>import("./sdbl-DVxCFoDh.js"),[]))},{id:"shaderlab",name:"ShaderLab",aliases:["shader"],import:(()=>D(()=>import("./shaderlab-Dg9Lc6iA.js"),__vite__mapDeps([83,84])))},{id:"shellscript",name:"Shell",aliases:["bash","sh","shell","zsh"],import:(()=>D(()=>import("./shellscript-Yzrsuije.js"),[]))},{id:"shellsession",name:"Shell Session",aliases:["console"],import:(()=>D(()=>import("./shellsession-BADoaaVG.js"),__vite__mapDeps([85,28])))},{id:"smalltalk",name:"Smalltalk",import:(()=>D(()=>import("./smalltalk-BERRCDM3.js"),[]))},{id:"solidity",name:"Solidity",import:(()=>D(()=>import("./solidity-rGO070M0.js"),[]))},{id:"soy",name:"Closure Templates",aliases:["closure-templates"],import:(()=>D(()=>import("./soy-Brmx7dQM.js"),__vite__mapDeps([86,1,2,3])))},{id:"sparql",name:"SPARQL",import:(()=>D(()=>import("./sparql-rVzFXLq3.js"),__vite__mapDeps([87,88])))},{id:"splunk",name:"Splunk Query Language",aliases:["spl"],import:(()=>D(()=>import("./splunk-BtCnVYZw.js"),[]))},{id:"sql",name:"SQL",import:(()=>D(()=>import("./sql-BLtJtn59.js"),[]))},{id:"ssh-config",name:"SSH Config",import:(()=>D(()=>import("./ssh-config-_ykCGR6B.js"),[]))},{id:"stata",name:"Stata",import:(()=>D(()=>import("./stata-BH5u7GGu.js"),__vite__mapDeps([89,16])))},{id:"stylus",name:"Stylus",aliases:["styl"],import:(()=>D(()=>import("./stylus-BEDo0Tqx.js"),[]))},{id:"surrealql",name:"SurrealQL",aliases:["surql"],import:(()=>D(()=>import("./surrealql-Bq5Q-fJD.js"),__vite__mapDeps([90,2])))},{id:"svelte",name:"Svelte",import:(()=>D(()=>import("./svelte-C_ipcX3V.js"),__vite__mapDeps([91,2,11,3,12])))},{id:"swift",name:"Swift",import:(()=>D(()=>import("./swift-D82vCrfD.js"),[]))},{id:"system-verilog",name:"SystemVerilog",import:(()=>D(()=>import("./system-verilog-CnnmHF94.js"),[]))},{id:"systemd",name:"Systemd Units",import:(()=>D(()=>import("./systemd-4A_iFExJ.js"),[]))},{id:"talonscript",name:"TalonScript",aliases:["talon"],import:(()=>D(()=>import("./talonscript-CkByrt1z.js"),[]))},{id:"tasl",name:"Tasl",import:(()=>D(()=>import("./tasl-QIJgUcNo.js"),[]))},{id:"tcl",name:"Tcl",import:(()=>D(()=>import("./tcl-dwOrl1Do.js"),[]))},{id:"templ",name:"Templ",import:(()=>D(()=>import("./templ-P3uqSqPl.js"),__vite__mapDeps([92,93,2,3])))},{id:"terraform",name:"Terraform",aliases:["tf","tfvars"],import:(()=>D(()=>import("./terraform-BETggiCN.js"),[]))},{id:"tex",name:"TeX",import:(()=>D(()=>import("./tex-idrVyKtj.js"),__vite__mapDeps([66,62])))},{id:"toml",name:"TOML",import:(()=>D(()=>import("./toml-vGWfd6FD.js"),[]))},{id:"ts-tags",name:"TypeScript with Tags",aliases:["lit"],import:(()=>D(()=>import("./ts-tags-zn1MmPIZ.js"),__vite__mapDeps([94,11,3,2,25,26,1,16,7,8])))},{id:"tsv",name:"TSV",import:(()=>D(()=>import("./tsv-B_m7g4N7.js"),[]))},{id:"tsx",name:"TSX",import:(()=>D(()=>import("./tsx-COt5Ahok.js"),[]))},{id:"turtle",name:"Turtle",import:(()=>D(()=>import("./turtle-BsS91CYL.js"),[]))},{id:"twig",name:"Twig",import:(()=>D(()=>import("./twig-DNn4PbVi.js"),__vite__mapDeps([95,3,2,5,75,1,7,8,16,9,20,33,34,35,11,36,13,23,24,25,26,28,37,38])))},{id:"typescript",name:"TypeScript",aliases:["ts","cts","mts"],import:(()=>D(()=>import("./typescript-BPQ3VLAy.js"),[]))},{id:"typespec",name:"TypeSpec",aliases:["tsp"],import:(()=>D(()=>import("./typespec-BGHnOYBU.js"),[]))},{id:"typst",name:"Typst",aliases:["typ"],import:(()=>D(()=>import("./typst-DHCkPAjA.js"),[]))},{id:"v",name:"V",import:(()=>D(()=>import("./v-BcVCzyr7.js"),[]))},{id:"vala",name:"Vala",import:(()=>D(()=>import("./vala-CsfeWuGM.js"),[]))},{id:"vb",name:"Visual Basic",aliases:["cmd"],import:(()=>D(()=>import("./vb-D17OF-Vu.js"),[]))},{id:"verilog",name:"Verilog",import:(()=>D(()=>import("./verilog-BQ8w6xss.js"),[]))},{id:"vhdl",name:"VHDL",import:(()=>D(()=>import("./vhdl-CeAyd5Ju.js"),[]))},{id:"viml",name:"Vim Script",aliases:["vim","vimscript"],import:(()=>D(()=>import("./viml-CJc9bBzg.js"),[]))},{id:"vue",name:"Vue",import:(()=>D(()=>import("./vue-DN_0RTcg.js"),__vite__mapDeps([96,3,2,11,9,1,15])))},{id:"vue-html",name:"Vue HTML",import:(()=>D(()=>import("./vue-html-AaS7Mt5G.js"),__vite__mapDeps([97,2])))},{id:"vue-vine",name:"Vue Vine",import:(()=>D(()=>import("./vue-vine-CQOfvN7w.js"),__vite__mapDeps([98,3,5,69,99,12,2])))},{id:"vyper",name:"Vyper",aliases:["vy"],import:(()=>D(()=>import("./vyper-CDx5xZoG.js"),[]))},{id:"wasm",name:"WebAssembly",import:(()=>D(()=>import("./wasm-MzD3tlZU.js"),[]))},{id:"wenyan",name:"Wenyan",aliases:["文言"],import:(()=>D(()=>import("./wenyan-BV7otONQ.js"),[]))},{id:"wgsl",name:"WGSL",import:(()=>D(()=>import("./wgsl-Dx-B1_4e.js"),[]))},{id:"wikitext",name:"Wikitext",aliases:["mediawiki","wiki"],import:(()=>D(()=>import("./wikitext-BhOHFoWU.js"),[]))},{id:"wit",name:"WebAssembly Interface Types",import:(()=>D(()=>import("./wit-5i3qLPDT.js"),[]))},{id:"wolfram",name:"Wolfram",aliases:["wl"],import:(()=>D(()=>import("./wolfram-lXgVvXCa.js"),[]))},{id:"xml",name:"XML",import:(()=>D(()=>import("./xml-sdJ4AIDG.js"),__vite__mapDeps([7,8])))},{id:"xsl",name:"XSL",import:(()=>D(()=>import("./xsl-CtQFsRM5.js"),__vite__mapDeps([100,7,8])))},{id:"yaml",name:"YAML",aliases:["yml"],import:(()=>D(()=>import("./yaml-Buea-lGh.js"),[]))},{id:"zenscript",name:"ZenScript",import:(()=>D(()=>import("./zenscript-DVFEvuxE.js"),[]))},{id:"zig",name:"Zig",import:(()=>D(()=>import("./zig-VOosw3JB.js"),[]))}],YL=Object.fromEntries(Ug.map(e=>[e.id,e.import])),WL=Object.fromEntries(Ug.flatMap(e=>{var t;return((t=e.aliases)==null?void 0:t.map(n=>[n,e.import]))||[]})),Yv={...YL,...WL},QL=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:(()=>D(()=>import("./andromeeda-C4gqWexZ.js"),[]))},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:(()=>D(()=>import("./aurora-x-D-2ljcwZ.js"),[]))},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:(()=>D(()=>import("./ayu-dark-DYE7WIF3.js"),[]))},{id:"ayu-light",displayName:"Ayu Light",type:"light",import:(()=>D(()=>import("./ayu-light-BA47KaF1.js"),[]))},{id:"ayu-mirage",displayName:"Ayu Mirage",type:"dark",import:(()=>D(()=>import("./ayu-mirage-32ctXXKs.js"),[]))},{id:"catppuccin-frappe",displayName:"Catppuccin Frappé",type:"dark",import:(()=>D(()=>import("./catppuccin-frappe-DFWUc33u.js"),[]))},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:(()=>D(()=>import("./catppuccin-latte-C9dUb6Cb.js"),[]))},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:(()=>D(()=>import("./catppuccin-macchiato-DQyhUUbL.js"),[]))},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:(()=>D(()=>import("./catppuccin-mocha-D87Tk5Gz.js"),[]))},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:(()=>D(()=>import("./dark-plus-C3mMm8J8.js"),[]))},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:(()=>D(()=>import("./dracula-BzJJZx-M.js"),[]))},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:(()=>D(()=>import("./dracula-soft-BXkSAIEj.js"),[]))},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:(()=>D(()=>import("./everforest-dark-BgDCqdQA.js"),[]))},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:(()=>D(()=>import("./everforest-light-C8M2exoo.js"),[]))},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:(()=>D(()=>import("./github-dark-DHJKELXO.js"),[]))},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:(()=>D(()=>import("./github-dark-default-Cuk6v7N8.js"),[]))},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:(()=>D(()=>import("./github-dark-dimmed-DH5Ifo-i.js"),[]))},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:(()=>D(()=>import("./github-dark-high-contrast-E3gJ1_iC.js"),[]))},{id:"github-light",displayName:"GitHub Light",type:"light",import:(()=>D(()=>import("./github-light-DAi9KRSo.js"),[]))},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:(()=>D(()=>import("./github-light-default-D7oLnXFd.js"),[]))},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:(()=>D(()=>import("./github-light-high-contrast-BfjtVDDH.js"),[]))},{id:"gruvbox-dark-hard",displayName:"Gruvbox Dark Hard",type:"dark",import:(()=>D(()=>import("./gruvbox-dark-hard-CFHQjOhq.js"),[]))},{id:"gruvbox-dark-medium",displayName:"Gruvbox Dark Medium",type:"dark",import:(()=>D(()=>import("./gruvbox-dark-medium-GsRaNv29.js"),[]))},{id:"gruvbox-dark-soft",displayName:"Gruvbox Dark Soft",type:"dark",import:(()=>D(()=>import("./gruvbox-dark-soft-CVdnzihN.js"),[]))},{id:"gruvbox-light-hard",displayName:"Gruvbox Light Hard",type:"light",import:(()=>D(()=>import("./gruvbox-light-hard-CH1njM8p.js"),[]))},{id:"gruvbox-light-medium",displayName:"Gruvbox Light Medium",type:"light",import:(()=>D(()=>import("./gruvbox-light-medium-DRw_LuNl.js"),[]))},{id:"gruvbox-light-soft",displayName:"Gruvbox Light Soft",type:"light",import:(()=>D(()=>import("./gruvbox-light-soft-hJgmCMqR.js"),[]))},{id:"horizon",displayName:"Horizon",type:"dark",import:(()=>D(()=>import("./horizon-BUw7H-hv.js"),[]))},{id:"horizon-bright",displayName:"Horizon Bright",type:"dark",import:(()=>D(()=>import("./horizon-bright-Cn-bp-IR.js"),[]))},{id:"houston",displayName:"Houston",type:"dark",import:(()=>D(()=>import("./houston-DnULxvSX.js"),[]))},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:(()=>D(()=>import("./kanagawa-dragon-CkXjmgJE.js"),[]))},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:(()=>D(()=>import("./kanagawa-lotus-CfQXZHmo.js"),[]))},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:(()=>D(()=>import("./kanagawa-wave-DWedfzmr.js"),[]))},{id:"laserwave",displayName:"LaserWave",type:"dark",import:(()=>D(()=>import("./laserwave-DUszq2jm.js"),[]))},{id:"light-plus",displayName:"Light Plus",type:"light",import:(()=>D(()=>import("./light-plus-B7mTdjB0.js"),[]))},{id:"material-theme",displayName:"Material Theme",type:"dark",import:(()=>D(()=>import("./material-theme-D5KoaKCx.js"),[]))},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:(()=>D(()=>import("./material-theme-darker-BfHTSMKl.js"),[]))},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:(()=>D(()=>import("./material-theme-lighter-B0m2ddpp.js"),[]))},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:(()=>D(()=>import("./material-theme-ocean-CyktbL80.js"),[]))},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:(()=>D(()=>import("./material-theme-palenight-Csfq5Kiy.js"),[]))},{id:"min-dark",displayName:"Min Dark",type:"dark",import:(()=>D(()=>import("./min-dark-CafNBF8u.js"),[]))},{id:"min-light",displayName:"Min Light",type:"light",import:(()=>D(()=>import("./min-light-CTRr51gU.js"),[]))},{id:"monokai",displayName:"Monokai",type:"dark",import:(()=>D(()=>import("./monokai-D4h5O-jR.js"),[]))},{id:"night-owl",displayName:"Night Owl",type:"dark",import:(()=>D(()=>import("./night-owl-C39BiMTA.js"),[]))},{id:"night-owl-light",displayName:"Night Owl Light",type:"light",import:(()=>D(()=>import("./night-owl-light-CMTm3GFP.js"),[]))},{id:"nord",displayName:"Nord",type:"dark",import:(()=>D(()=>import("./nord-Ddv68eIx.js"),[]))},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:(()=>D(()=>import("./one-dark-pro-DVMEJ2y_.js"),[]))},{id:"one-light",displayName:"One Light",type:"light",import:(()=>D(()=>import("./one-light-C3Wv6jpd.js"),[]))},{id:"plastic",displayName:"Plastic",type:"dark",import:(()=>D(()=>import("./plastic-3e1v2bzS.js"),[]))},{id:"poimandres",displayName:"Poimandres",type:"dark",import:(()=>D(()=>import("./poimandres-CS3Unz2-.js"),[]))},{id:"red",displayName:"Red",type:"dark",import:(()=>D(()=>import("./red-bN70gL4F.js"),[]))},{id:"rose-pine",displayName:"Rosé Pine",type:"dark",import:(()=>D(()=>import("./rose-pine-qdsjHGoJ.js"),[]))},{id:"rose-pine-dawn",displayName:"Rosé Pine Dawn",type:"light",import:(()=>D(()=>import("./rose-pine-dawn-DHQR4-dF.js"),[]))},{id:"rose-pine-moon",displayName:"Rosé Pine Moon",type:"dark",import:(()=>D(()=>import("./rose-pine-moon-D4_iv3hh.js"),[]))},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:(()=>D(()=>import("./slack-dark-BthQWCQV.js"),[]))},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:(()=>D(()=>import("./slack-ochin-DqwNpetd.js"),[]))},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:(()=>D(()=>import("./snazzy-light-Bw305WKR.js"),[]))},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:(()=>D(()=>import("./solarized-dark-DXbdFlpD.js"),[]))},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:(()=>D(()=>import("./solarized-light-L9t79GZl.js"),[]))},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:(()=>D(()=>import("./synthwave-84-CbfX1IO0.js"),[]))},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:(()=>D(()=>import("./tokyo-night-hegEt444.js"),[]))},{id:"vesper",displayName:"Vesper",type:"dark",import:(()=>D(()=>import("./vesper-DU1UobuO.js"),[]))},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:(()=>D(()=>import("./vitesse-black-Bkuqu6BP.js"),[]))},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:(()=>D(()=>import("./vitesse-dark-D0r3Knsf.js"),[]))},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:(()=>D(()=>import("./vitesse-light-CVO1_9PV.js"),[]))}],XL=Object.fromEntries(QL.map(e=>[e.id,e.import]));class Hg extends Error{constructor(t){super(t),this.name="ShikiError"}}function KL(){return 2147483648}function ZL(){return typeof performance<"u"?performance.now():Date.now()}const JL=(e,t)=>e+(t-e%t)%t;async function eI(e){let t,n;const r={};function s(E){n=E,r.HEAPU8=new Uint8Array(E),r.HEAPU32=new Uint32Array(E)}function l(E,v,k){r.HEAPU8.copyWithin(E,v,v+k)}function o(E){try{return t.grow(E-n.byteLength+65535>>>16),s(t.buffer),1}catch{}}function c(E){const v=r.HEAPU8.length;E=E>>>0;const k=KL();if(E>k)return!1;for(let C=1;C<=4;C*=2){let S=v*(1+.2/C);S=Math.min(S,E+100663296);const A=Math.min(k,JL(Math.max(E,S),65536));if(o(A))return!0}return!1}const d=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function m(E,v,k=1024){const C=v+k;let S=v;for(;E[S]&&!(S>=C);)++S;if(S-v>16&&E.buffer&&d)return d.decode(E.subarray(v,S));let A="";for(;v<S;){let N=E[v++];if(!(N&128)){A+=String.fromCharCode(N);continue}const U=E[v++]&63;if((N&224)===192){A+=String.fromCharCode((N&31)<<6|U);continue}const G=E[v++]&63;if((N&240)===224?N=(N&15)<<12|U<<6|G:N=(N&7)<<18|U<<12|G<<6|E[v++]&63,N<65536)A+=String.fromCharCode(N);else{const P=N-65536;A+=String.fromCharCode(55296|P>>10,56320|P&1023)}}return A}function p(E,v){return E?m(r.HEAPU8,E,v):""}const g={emscripten_get_now:ZL,emscripten_memcpy_big:l,emscripten_resize_heap:c,fd_write:()=>0};async function y(){const v=await e({env:g,wasi_snapshot_preview1:g});t=v.memory,s(t.buffer),Object.assign(r,v),r.UTF8ToString=p}return await y(),r}var tI=Object.defineProperty,nI=(e,t,n)=>t in e?tI(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,zn=(e,t,n)=>nI(e,typeof t!="symbol"?t+"":t,n);let Yn=null;function rI(e){throw new Hg(e.UTF8ToString(e.getLastOnigError()))}class Gf{constructor(t){zn(this,"utf16Length"),zn(this,"utf8Length"),zn(this,"utf16Value"),zn(this,"utf8Value"),zn(this,"utf16OffsetToUtf8"),zn(this,"utf8OffsetToUtf16");const n=t.length,r=Gf._utf8ByteLength(t),s=r!==n,l=s?new Uint32Array(n+1):null;s&&(l[n]=r);const o=s?new Uint32Array(r+1):null;s&&(o[r]=n);const c=new Uint8Array(r);let d=0;for(let m=0;m<n;m++){const p=t.charCodeAt(m);let g=p,y=!1;if(p>=55296&&p<=56319&&m+1<n){const E=t.charCodeAt(m+1);E>=56320&&E<=57343&&(g=(p-55296<<10)+65536|E-56320,y=!0)}s&&(l[m]=d,y&&(l[m+1]=d),g<=127?o[d+0]=m:g<=2047?(o[d+0]=m,o[d+1]=m):g<=65535?(o[d+0]=m,o[d+1]=m,o[d+2]=m):(o[d+0]=m,o[d+1]=m,o[d+2]=m,o[d+3]=m)),g<=127?c[d++]=g:g<=2047?(c[d++]=192|(g&1984)>>>6,c[d++]=128|(g&63)>>>0):g<=65535?(c[d++]=224|(g&61440)>>>12,c[d++]=128|(g&4032)>>>6,c[d++]=128|(g&63)>>>0):(c[d++]=240|(g&1835008)>>>18,c[d++]=128|(g&258048)>>>12,c[d++]=128|(g&4032)>>>6,c[d++]=128|(g&63)>>>0),y&&m++}this.utf16Length=n,this.utf8Length=r,this.utf16Value=t,this.utf8Value=c,this.utf16OffsetToUtf8=l,this.utf8OffsetToUtf16=o}static _utf8ByteLength(t){let n=0;for(let r=0,s=t.length;r<s;r++){const l=t.charCodeAt(r);let o=l,c=!1;if(l>=55296&&l<=56319&&r+1<s){const d=t.charCodeAt(r+1);d>=56320&&d<=57343&&(o=(l-55296<<10)+65536|d-56320,c=!0)}o<=127?n+=1:o<=2047?n+=2:o<=65535?n+=3:n+=4,c&&r++}return n}createString(t){const n=t.omalloc(this.utf8Length);return t.HEAPU8.set(this.utf8Value,n),n}}const qf=class Ba{constructor(t){if(zn(this,"id",++Ba.LAST_ID),zn(this,"_onigBinding"),zn(this,"content"),zn(this,"utf16Length"),zn(this,"utf8Length"),zn(this,"utf16OffsetToUtf8"),zn(this,"utf8OffsetToUtf16"),zn(this,"ptr"),!Yn)throw new Hg("Must invoke loadWasm first.");this._onigBinding=Yn,this.content=t;const n=new Gf(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!Ba._sharedPtrInUse?(Ba._sharedPtr||(Ba._sharedPtr=Yn.omalloc(1e4)),Ba._sharedPtrInUse=!0,Yn.HEAPU8.set(n.utf8Value,Ba._sharedPtr),this.ptr=Ba._sharedPtr):this.ptr=n.createString(Yn)}convertUtf8OffsetToUtf16(t){return this.utf8OffsetToUtf16?t<0?0:t>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[t]:t}convertUtf16OffsetToUtf8(t){return this.utf16OffsetToUtf8?t<0?0:t>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[t]:t}dispose(){this.ptr===Ba._sharedPtr?Ba._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};zn(qf,"LAST_ID",0);zn(qf,"_sharedPtr",0);zn(qf,"_sharedPtrInUse",!1);let Wv=qf;class aI{constructor(t){if(zn(this,"_onigBinding"),zn(this,"_ptr"),!Yn)throw new Hg("Must invoke loadWasm first.");const n=[],r=[];for(let c=0,d=t.length;c<d;c++){const m=new Gf(t[c]);n[c]=m.createString(Yn),r[c]=m.utf8Length}const s=Yn.omalloc(4*t.length);Yn.HEAPU32.set(n,s/4);const l=Yn.omalloc(4*t.length);Yn.HEAPU32.set(r,l/4);const o=Yn.createOnigScanner(s,l,t.length);for(let c=0,d=t.length;c<d;c++)Yn.ofree(n[c]);Yn.ofree(l),Yn.ofree(s),o===0&&rI(Yn),this._onigBinding=Yn,this._ptr=o}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(t,n,r){let s=0;if(typeof r=="number"&&(s=r),typeof t=="string"){t=new Wv(t);const l=this._findNextMatchSync(t,n,!1,s);return t.dispose(),l}return this._findNextMatchSync(t,n,!1,s)}_findNextMatchSync(t,n,r,s){const l=this._onigBinding,o=l.findNextOnigScannerMatch(this._ptr,t.id,t.ptr,t.utf8Length,t.convertUtf16OffsetToUtf8(n),s);if(o===0)return null;const c=l.HEAPU32;let d=o/4;const m=c[d++],p=c[d++],g=[];for(let y=0;y<p;y++){const E=t.convertUtf8OffsetToUtf16(c[d++]),v=t.convertUtf8OffsetToUtf16(c[d++]);g[y]={start:E,end:v,length:v-E}}return{index:m,captureIndices:g}}}function iI(e){return typeof e.instantiator=="function"}function sI(e){return typeof e.default=="function"}function lI(e){return typeof e.data<"u"}function oI(e){return typeof Response<"u"&&e instanceof Response}function uI(e){var t;return typeof ArrayBuffer<"u"&&(e instanceof ArrayBuffer||ArrayBuffer.isView(e))||typeof Buffer<"u"&&((t=Buffer.isBuffer)==null?void 0:t.call(Buffer,e))||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer||typeof Uint32Array<"u"&&e instanceof Uint32Array}let Od;function cI(e){if(Od)return Od;async function t(){Yn=await eI(async n=>{let r=e;return r=await r,typeof r=="function"&&(r=await r(n)),typeof r=="function"&&(r=await r(n)),iI(r)?r=await r.instantiator(n):sI(r)?r=await r.default(n):(lI(r)&&(r=r.data),oI(r)?typeof WebAssembly.instantiateStreaming=="function"?r=await dI(r)(n):r=await fI(r)(n):uI(r)?r=await Dp(r)(n):r instanceof WebAssembly.Module?r=await Dp(r)(n):"default"in r&&r.default instanceof WebAssembly.Module&&(r=await Dp(r.default)(n))),"instance"in r&&(r=r.instance),"exports"in r&&(r=r.exports),r})}return Od=t(),Od}function Dp(e){return t=>WebAssembly.instantiate(e,t)}function dI(e){return t=>WebAssembly.instantiateStreaming(e,t)}function fI(e){return async t=>{const n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}async function hI(e){return e&&await cI(e),{createScanner(t){return new aI(t.map(n=>typeof n=="string"?n:n.source))},createString(t){return new Wv(t)}}}const mI=qL({langs:Yv,themes:XL,engine:()=>hI(D(()=>import("./wasm-CG6Dc4jp.js"),[]))});function No(e){if([...e].length!==1)throw new Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function pI(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}const zg=new Set(["alnum","alpha","ascii","blank","cntrl","digit","graph","lower","print","punct","space","upper","word","xdigit"]),Wn=String.raw;function Ro(e,t){if(e==null)throw new Error(t??"Value expected");return e}const Qv=Wn`\[\^?`,Xv=`c.? | C(?:-.?)?|${Wn`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${Wn`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${Wn`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${Wn`o\{[^\}]*\}?`}|${Wn`\d{1,3}`}`,Fg=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,Dd=new RegExp(Wn`
|
|
104
|
+
\\ (?:
|
|
105
|
+
${Xv}
|
|
106
|
+
| [gk]<[^>]*>?
|
|
107
|
+
| [gk]'[^']*'?
|
|
108
|
+
| .
|
|
109
|
+
)
|
|
110
|
+
| \( (?:
|
|
111
|
+
\? (?:
|
|
112
|
+
[:=!>({]
|
|
113
|
+
| <[=!]
|
|
114
|
+
| <[^>]*>
|
|
115
|
+
| '[^']*'
|
|
116
|
+
| ~\|?
|
|
117
|
+
| #(?:[^)\\]|\\.?)*
|
|
118
|
+
| [^:)]*[:)]
|
|
119
|
+
)?
|
|
120
|
+
| \*[^\)]*\)?
|
|
121
|
+
)?
|
|
122
|
+
| (?:${Fg.source})+
|
|
123
|
+
| ${Qv}
|
|
124
|
+
| .
|
|
125
|
+
`.replace(/\s+/g,""),"gsu"),jp=new RegExp(Wn`
|
|
126
|
+
\\ (?:
|
|
127
|
+
${Xv}
|
|
128
|
+
| .
|
|
129
|
+
)
|
|
130
|
+
| \[:(?:\^?\p{Alpha}+|\^):\]
|
|
131
|
+
| ${Qv}
|
|
132
|
+
| &&
|
|
133
|
+
| .
|
|
134
|
+
`.replace(/\s+/g,""),"gsu");function gI(e,t={}){const n={flags:"",...t,rules:{captureGroup:!1,singleline:!1,...t.rules}};if(typeof e!="string")throw new Error("String expected as pattern");const r=jI(n.flags),s=[r.extended],l={captureGroup:n.rules.captureGroup,getCurrentModX(){return s.at(-1)},numOpenGroups:0,popModX(){s.pop()},pushModX(g){s.push(g)},replaceCurrentModX(g){s[s.length-1]=g},singleline:n.rules.singleline};let o=[],c;for(Dd.lastIndex=0;c=Dd.exec(e);){const g=bI(l,e,c[0],Dd.lastIndex);g.tokens?o.push(...g.tokens):g.token&&o.push(g.token),g.lastIndex!==void 0&&(Dd.lastIndex=g.lastIndex)}const d=[];let m=0;o.filter(g=>g.type==="GroupOpen").forEach(g=>{g.kind==="capturing"?g.number=++m:g.raw==="("&&d.push(g)}),m||d.forEach((g,y)=>{g.kind="capturing",g.number=y+1});const p=m||d.length;return{tokens:o.map(g=>g.type==="EscapedNumber"?PI(g,p):g).flat(),flags:r}}function bI(e,t,n,r){const[s,l]=n;if(n==="["||n==="[^"){const o=xI(t,n,r);return{tokens:o.tokens,lastIndex:o.lastIndex}}if(s==="\\"){if("AbBGyYzZ".includes(l))return{token:f2(n,n)};if(/^\\g[<']/.test(n)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:AI(n)}}if(/^\\k[<']/.test(n)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:Zv(n)}}if(l==="K")return{token:Jv("keep",n)};if(l==="N"||l==="R")return{token:il("newline",n,{negate:l==="N"})};if(l==="O")return{token:il("any",n)};if(l==="X")return{token:il("text_segment",n)};const o=Kv(n,{inCharClass:!1});return Array.isArray(o)?{tokens:o}:{token:o}}if(s==="("){if(l==="*")return{token:II(n)};if(n==="(?{")throw new Error(`Unsupported callout "${n}"`);if(n.startsWith("(?#")){if(t[r]!==")")throw new Error('Unclosed comment group "(?#"');return{lastIndex:r+1}}if(/^\(\?[-imx]+[:)]$/.test(n))return{token:LI(n,e)};if(e.pushModX(e.getCurrentModX()),e.numOpenGroups++,n==="("&&!e.captureGroup||n==="(?:")return{token:lo("group",n)};if(n==="(?>")return{token:lo("atomic",n)};if(n==="(?="||n==="(?!"||n==="(?<="||n==="(?<!")return{token:lo(n[2]==="<"?"lookbehind":"lookahead",n,{negate:n.endsWith("!")})};if(n==="("&&e.captureGroup||n.startsWith("(?<")&&n.endsWith(">")||n.startsWith("(?'")&&n.endsWith("'"))return{token:lo("capturing",n,{...n!=="("&&{name:n.slice(3,-1)}})};if(n.startsWith("(?~")){if(n==="(?~|")throw new Error(`Unsupported absence function kind "${n}"`);return{token:lo("absence_repeater",n)}}throw n==="(?("?new Error(`Unsupported conditional "${n}"`):new Error(`Invalid or unsupported group option "${n}"`)}if(n===")"){if(e.popModX(),e.numOpenGroups--,e.numOpenGroups<0)throw new Error('Unmatched ")"');return{token:kI(n)}}if(e.getCurrentModX()){if(n==="#"){const o=t.indexOf(`
|
|
135
|
+
`,r);return{lastIndex:o===-1?t.length:o}}if(/^\s$/.test(n)){const o=/\s+/y;return o.lastIndex=r,{lastIndex:o.exec(t)?o.lastIndex:r}}}if(n===".")return{token:il("dot",n)};if(n==="^"||n==="$"){const o=e.singleline?{"^":Wn`\A`,$:Wn`\Z`}[n]:n;return{token:f2(o,n)}}return n==="|"?{token:EI(n)}:Fg.test(n)?{tokens:BI(n)}:{token:wi(No(n),n)}}function xI(e,t,n){const r=[h2(t[1]==="^",t)];let s=1,l;for(jp.lastIndex=n;l=jp.exec(e);){const o=l[0];if(o[0]==="["&&o[1]!==":")s++,r.push(h2(o[1]==="^",o));else if(o==="]"){if(r.at(-1).type==="CharacterClassOpen")r.push(wi(93,o));else if(s--,r.push(_I(o)),!s)break}else{const c=yI(o);Array.isArray(c)?r.push(...c):r.push(c)}}return{tokens:r,lastIndex:jp.lastIndex||e.length}}function yI(e){if(e[0]==="\\")return Kv(e,{inCharClass:!0});if(e[0]==="["){const t=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(e);if(!t||!zg.has(t.groups.name))throw new Error(`Invalid POSIX class "${e}"`);return il("posix",e,{value:t.groups.name,negate:!!t.groups.negate})}return e==="-"?TI(e):e==="&&"?vI(e):wi(No(e),e)}function Kv(e,{inCharClass:t}){const n=e[1];if(n==="c"||n==="C")return RI(e);if("dDhHsSwW".includes(n))return OI(e);if(e.startsWith(Wn`\o{`))throw new Error(`Incomplete, invalid, or unsupported octal code point "${e}"`);if(/^\\[pP]\{/.test(e)){if(e.length===3)throw new Error(`Incomplete or invalid Unicode property "${e}"`);return DI(e)}if(new RegExp("^\\\\x[89A-Fa-f]\\p{AHex}","u").test(e))try{const r=e.split(/\\x/).slice(1).map(o=>parseInt(o,16)),s=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}).decode(new Uint8Array(r)),l=new TextEncoder;return[...s].map(o=>{const c=[...l.encode(o)].map(d=>`\\x${d.toString(16)}`).join("");return wi(No(o),c)})}catch{throw new Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`)}if(n==="u"||n==="x")return wi(MI(e),e);if(m2.has(n))return wi(m2.get(n),e);if(/\d/.test(n))return wI(t,e);if(e==="\\")throw new Error(Wn`Incomplete escape "\"`);if(n==="M")throw new Error(`Unsupported meta "${e}"`);if([...e].length===2)return wi(e.codePointAt(1),e);throw new Error(`Unexpected escape "${e}"`)}function EI(e){return{type:"Alternator",raw:e}}function f2(e,t){return{type:"Assertion",kind:e,raw:t}}function Zv(e){return{type:"Backreference",raw:e}}function wi(e,t){return{type:"Character",value:e,raw:t}}function _I(e){return{type:"CharacterClassClose",raw:e}}function TI(e){return{type:"CharacterClassHyphen",raw:e}}function vI(e){return{type:"CharacterClassIntersector",raw:e}}function h2(e,t){return{type:"CharacterClassOpen",negate:e,raw:t}}function il(e,t,n={}){return{type:"CharacterSet",kind:e,...n,raw:t}}function Jv(e,t,n={}){return e==="keep"?{type:"Directive",kind:e,raw:t}:{type:"Directive",kind:e,flags:Ro(n.flags),raw:t}}function wI(e,t){return{type:"EscapedNumber",inCharClass:e,raw:t}}function kI(e){return{type:"GroupClose",raw:e}}function lo(e,t,n={}){return{type:"GroupOpen",kind:e,...n,raw:t}}function CI(e,t,n,r){return{type:"NamedCallout",kind:e,tag:t,arguments:n,raw:r}}function SI(e,t,n,r){return{type:"Quantifier",kind:e,min:t,max:n,raw:r}}function AI(e){return{type:"Subroutine",raw:e}}const NI=new Set(["COUNT","CMP","ERROR","FAIL","MAX","MISMATCH","SKIP","TOTAL_COUNT"]),m2=new Map([["a",7],["b",8],["e",27],["f",12],["n",10],["r",13],["t",9],["v",11]]);function RI(e){const t=e[1]==="c"?e[2]:e[3];if(!t||!/[A-Za-z]/.test(t))throw new Error(`Unsupported control character "${e}"`);return wi(No(t.toUpperCase())-64,e)}function LI(e,t){let{on:n,off:r}=/^\(\?(?<on>[imx]*)(?:-(?<off>[-imx]*))?/.exec(e).groups;r??(r="");const s=(t.getCurrentModX()||n.includes("x"))&&!r.includes("x"),l=g2(n),o=g2(r),c={};if(l&&(c.enable=l),o&&(c.disable=o),e.endsWith(")"))return t.replaceCurrentModX(s),Jv("flags",e,{flags:c});if(e.endsWith(":"))return t.pushModX(s),t.numOpenGroups++,lo("group",e,{...(l||o)&&{flags:c}});throw new Error(`Unexpected flag modifier "${e}"`)}function II(e){const t=/\(\*(?<name>[A-Za-z_]\w*)?(?:\[(?<tag>(?:[A-Za-z_]\w*)?)\])?(?:\{(?<args>[^}]*)\})?\)/.exec(e);if(!t)throw new Error(`Incomplete or invalid named callout "${e}"`);const{name:n,tag:r,args:s}=t.groups;if(!n)throw new Error(`Invalid named callout "${e}"`);if(r==="")throw new Error(`Named callout tag with empty value not allowed "${e}"`);const l=s?s.split(",").filter(p=>p!=="").map(p=>/^[+-]?\d+$/.test(p)?+p:p):[],[o,c,d]=l,m=NI.has(n)?n.toLowerCase():"custom";switch(m){case"fail":case"mismatch":case"skip":if(l.length>0)throw new Error(`Named callout arguments not allowed "${l}"`);break;case"error":if(l.length>1)throw new Error(`Named callout allows only one argument "${l}"`);if(typeof o=="string")throw new Error(`Named callout argument must be a number "${o}"`);break;case"max":if(!l.length||l.length>2)throw new Error(`Named callout must have one or two arguments "${l}"`);if(typeof o=="string"&&!/^[A-Za-z_]\w*$/.test(o))throw new Error(`Named callout argument one must be a tag or number "${o}"`);if(l.length===2&&(typeof c=="number"||!/^[<>X]$/.test(c)))throw new Error(`Named callout optional argument two must be '<', '>', or 'X' "${c}"`);break;case"count":case"total_count":if(l.length>1)throw new Error(`Named callout allows only one argument "${l}"`);if(l.length===1&&(typeof o=="number"||!/^[<>X]$/.test(o)))throw new Error(`Named callout optional argument must be '<', '>', or 'X' "${o}"`);break;case"cmp":if(l.length!==3)throw new Error(`Named callout must have three arguments "${l}"`);if(typeof o=="string"&&!/^[A-Za-z_]\w*$/.test(o))throw new Error(`Named callout argument one must be a tag or number "${o}"`);if(typeof c=="number"||!/^(?:[<>!=]=|[<>])$/.test(c))throw new Error(`Named callout argument two must be '==', '!=', '>', '<', '>=', or '<=' "${c}"`);if(typeof d=="string"&&!/^[A-Za-z_]\w*$/.test(d))throw new Error(`Named callout argument three must be a tag or number "${d}"`);break;case"custom":throw new Error(`Undefined callout name "${n}"`);default:throw new Error(`Unexpected named callout kind "${m}"`)}return CI(m,r??null,(s==null?void 0:s.split(","))??null,e)}function p2(e){let t=null,n,r;if(e[0]==="{"){const{minStr:s,maxStr:l}=/^\{(?<minStr>\d*)(?:,(?<maxStr>\d*))?/.exec(e).groups,o=1e5;if(+s>o||l&&+l>o)throw new Error("Quantifier value unsupported in Oniguruma");if(n=+s,r=l===void 0?+s:l===""?1/0:+l,n>r&&(t="possessive",[n,r]=[r,n]),e.endsWith("?")){if(t==="possessive")throw new Error('Unsupported possessive interval quantifier chain with "?"');t="lazy"}else t||(t="greedy")}else n=e[0]==="+"?1:0,r=e[0]==="?"?1:1/0,t=e[1]==="+"?"possessive":e[1]==="?"?"lazy":"greedy";return SI(t,n,r,e)}function OI(e){const t=e[1].toLowerCase();return il({d:"digit",h:"hex",s:"space",w:"word"}[t],e,{negate:e[1]!==t})}function DI(e){const{p:t,neg:n,value:r}=/^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(e).groups;return il("property",e,{value:r,negate:t==="P"&&!n||t==="p"&&!!n})}function g2(e){const t={};return e.includes("i")&&(t.ignoreCase=!0),e.includes("m")&&(t.dotAll=!0),e.includes("x")&&(t.extended=!0),Object.keys(t).length?t:null}function jI(e){const t={ignoreCase:!1,dotAll:!1,extended:!1,digitIsAscii:!1,posixIsAscii:!1,spaceIsAscii:!1,wordIsAscii:!1,textSegmentMode:null};for(let n=0;n<e.length;n++){const r=e[n];if(!"imxDPSWy".includes(r))throw new Error(`Invalid flag "${r}"`);if(r==="y"){if(!/^y{[gw]}/.test(e.slice(n)))throw new Error('Invalid or unspecified flag "y" mode');t.textSegmentMode=e[n+2]==="g"?"grapheme":"word",n+=3;continue}t[{i:"ignoreCase",m:"dotAll",x:"extended",D:"digitIsAscii",P:"posixIsAscii",S:"spaceIsAscii",W:"wordIsAscii"}[r]]=!0}return t}function MI(e){if(new RegExp("^(?:\\\\u(?!\\p{AHex}{4})|\\\\x(?!\\p{AHex}{1,2}|\\{\\p{AHex}{1,8}\\}))","u").test(e))throw new Error(`Incomplete or invalid escape "${e}"`);const t=e[2]==="{"?new RegExp("^\\\\x\\{\\s*(?<hex>\\p{AHex}+)","u").exec(e).groups.hex:e.slice(2);return parseInt(t,16)}function PI(e,t){const{raw:n,inCharClass:r}=e,s=n.slice(1);if(!r&&(s!=="0"&&s.length===1||s[0]!=="0"&&+s<=t))return[Zv(n)];const l=[],o=s.match(/^[0-7]+|\d/g);for(let c=0;c<o.length;c++){const d=o[c];let m;if(c===0&&d!=="8"&&d!=="9"){if(m=parseInt(d,8),m>127)throw new Error(Wn`Octal encoded byte above 177 unsupported "${n}"`)}else m=No(d);l.push(wi(m,(c===0?"\\":"")+d))}return l}function BI(e){const t=[],n=new RegExp(Fg,"gy");let r;for(;r=n.exec(e);){const s=r[0];if(s[0]==="{"){const l=/^\{(?<min>\d+),(?<max>\d+)\}\??$/.exec(s);if(l){const{min:o,max:c}=l.groups;if(+o>+c&&s.endsWith("?")){n.lastIndex--,t.push(p2(s.slice(0,-1)));continue}}}t.push(p2(s))}return t}function e3(e,t){if(!Array.isArray(e.body))throw new Error("Expected node with body array");if(e.body.length!==1)return!1;const n=e.body[0];return!t||Object.keys(t).every(r=>t[r]===n[r])}function UI(e){return HI.has(e.type)}const HI=new Set(["AbsenceFunction","Backreference","CapturingGroup","Character","CharacterClass","CharacterSet","Group","Quantifier","Subroutine"]);function t3(e,t={}){const n={flags:"",normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}},r=gI(e,{flags:n.flags,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline}}),s=(y,E)=>{const v=r.tokens[l.nextIndex];switch(l.parent=y,l.nextIndex++,v.type){case"Alternator":return cl();case"Assertion":return zI(v);case"Backreference":return FI(v,l);case"Character":return Yf(v.value,{useLastValid:!!E.isCheckingRangeEnd});case"CharacterClassHyphen":return $I(v,l,E);case"CharacterClassOpen":return VI(v,l,E);case"CharacterSet":return GI(v,l);case"Directive":return KI(v.kind,{flags:v.flags});case"GroupOpen":return qI(v,l,E);case"NamedCallout":return JI(v.kind,v.tag,v.arguments);case"Quantifier":return YI(v,l);case"Subroutine":return WI(v,l);default:throw new Error(`Unexpected token type "${v.type}"`)}},l={capturingGroups:[],hasNumberedRef:!1,namedGroupsByName:new Map,nextIndex:0,normalizeUnknownPropertyNames:n.normalizeUnknownPropertyNames,parent:null,skipBackrefValidation:n.skipBackrefValidation,skipLookbehindValidation:n.skipLookbehindValidation,skipPropertyNameValidation:n.skipPropertyNameValidation,subroutines:[],tokens:r.tokens,unicodePropertyMap:n.unicodePropertyMap,walk:s},o=tO(ZI(r.flags));let c=o.body[0];for(;l.nextIndex<r.tokens.length;){const y=s(c,{});y.type==="Alternative"?(o.body.push(y),c=y):c.body.push(y)}const{capturingGroups:d,hasNumberedRef:m,namedGroupsByName:p,subroutines:g}=l;if(m&&p.size&&!n.rules.captureGroup)throw new Error("Numbered backref/subroutine not allowed when using named capture");for(const{ref:y}of g)if(typeof y=="number"){if(y>d.length)throw new Error("Subroutine uses a group number that's not defined");y&&(d[y-1].isSubroutined=!0)}else if(p.has(y)){if(p.get(y).length>1)throw new Error(Wn`Subroutine uses a duplicate group name "\g<${y}>"`);p.get(y)[0].isSubroutined=!0}else throw new Error(Wn`Subroutine uses a group name that's not defined "\g<${y}>"`);return o}function zI({kind:e}){return j0(Ro({"^":"line_start",$:"line_end","\\A":"string_start","\\b":"word_boundary","\\B":"word_boundary","\\G":"search_start","\\y":"text_segment_boundary","\\Y":"text_segment_boundary","\\z":"string_end","\\Z":"string_end_newline"}[e],`Unexpected assertion kind "${e}"`),{negate:e===Wn`\B`||e===Wn`\Y`})}function FI({raw:e},t){const n=/^\\k[<']/.test(e),r=n?e.slice(3,-1):e.slice(1),s=(l,o=!1)=>{const c=t.capturingGroups.length;let d=!1;if(l>c)if(t.skipBackrefValidation)d=!0;else throw new Error(`Not enough capturing groups defined to the left "${e}"`);return t.hasNumberedRef=!0,M0(o?c+1-l:l,{orphan:d})};if(n){const l=/^(?<sign>-?)0*(?<num>[1-9]\d*)$/.exec(r);if(l)return s(+l.groups.num,!!l.groups.sign);if(/[-+]/.test(r))throw new Error(`Invalid backref name "${e}"`);if(!t.namedGroupsByName.has(r))throw new Error(`Group name not defined to the left "${e}"`);return M0(r)}return s(+r)}function $I(e,t,n){const{tokens:r,walk:s}=t,l=t.parent,o=l.body.at(-1),c=r[t.nextIndex];if(!n.isCheckingRangeEnd&&o&&o.type!=="CharacterClass"&&o.type!=="CharacterClassRange"&&c&&c.type!=="CharacterClassOpen"&&c.type!=="CharacterClassClose"&&c.type!=="CharacterClassIntersector"){const d=s(l,{...n,isCheckingRangeEnd:!0});if(o.type==="Character"&&d.type==="Character")return l.body.pop(),XI(o,d);throw new Error("Invalid character class range")}return Yf(No("-"))}function VI({negate:e},t,n){const{tokens:r,walk:s}=t,l=r[t.nextIndex],o=[sf()];let c=y2(l);for(;c.type!=="CharacterClassClose";){if(c.type==="CharacterClassIntersector")o.push(sf()),t.nextIndex++;else{const m=o.at(-1);m.body.push(s(m,n))}c=y2(r[t.nextIndex],l)}const d=sf({negate:e});return o.length===1?d.body=o[0].body:(d.kind="intersection",d.body=o.map(m=>m.body.length===1?m.body[0]:m)),t.nextIndex++,d}function GI({kind:e,negate:t,value:n},r){const{normalizeUnknownPropertyNames:s,skipPropertyNameValidation:l,unicodePropertyMap:o}=r;if(e==="property"){const c=Wf(n);if(zg.has(c)&&!(o!=null&&o.has(c)))e="posix",n=c;else return oo(n,{negate:t,normalizeUnknownPropertyNames:s,skipPropertyNameValidation:l,unicodePropertyMap:o})}return e==="posix"?eO(n,{negate:t}):P0(e,{negate:t})}function qI(e,t,n){const{tokens:r,capturingGroups:s,namedGroupsByName:l,skipLookbehindValidation:o,walk:c}=t,d=nO(e),m=d.type==="AbsenceFunction",p=x2(d),g=p&&d.negate;if(d.type==="CapturingGroup"&&(s.push(d),d.name&&pI(l,d.name,[]).push(d)),m&&n.isInAbsenceFunction)throw new Error("Nested absence function not supported by Oniguruma");let y=E2(r[t.nextIndex]);for(;y.type!=="GroupClose";){if(y.type==="Alternator")d.body.push(cl()),t.nextIndex++;else{const E=d.body.at(-1),v=c(E,{...n,isInAbsenceFunction:n.isInAbsenceFunction||m,isInLookbehind:n.isInLookbehind||p,isInNegLookbehind:n.isInNegLookbehind||g});if(E.body.push(v),(p||n.isInLookbehind)&&!o){const k="Lookbehind includes a pattern not allowed by Oniguruma";if(g||n.isInNegLookbehind){if(b2(v)||v.type==="CapturingGroup")throw new Error(k)}else if(b2(v)||x2(v)&&v.negate)throw new Error(k)}}y=E2(r[t.nextIndex])}return t.nextIndex++,d}function YI({kind:e,min:t,max:n},r){const s=r.parent,l=s.body.at(-1);if(!l||!UI(l))throw new Error("Quantifier requires a repeatable token");const o=r3(e,t,n,l);return s.body.pop(),o}function WI({raw:e},t){const{capturingGroups:n,subroutines:r}=t;let s=e.slice(3,-1);const l=/^(?<sign>[-+]?)0*(?<num>[1-9]\d*)$/.exec(s);if(l){const c=+l.groups.num,d=n.length;if(t.hasNumberedRef=!0,s={"":c,"+":d+c,"-":d+1-c}[l.groups.sign],s<1)throw new Error("Invalid subroutine number")}else s==="0"&&(s=0);const o=a3(s);return r.push(o),o}function QI(e,t){return{type:"AbsenceFunction",kind:e,body:bc(t==null?void 0:t.body)}}function cl(e){return{type:"Alternative",body:i3(e==null?void 0:e.body)}}function j0(e,t){const n={type:"Assertion",kind:e};return(e==="word_boundary"||e==="text_segment_boundary")&&(n.negate=!!(t!=null&&t.negate)),n}function M0(e,t){const n=!!(t!=null&&t.orphan);return{type:"Backreference",ref:e,...n&&{orphan:n}}}function n3(e,t){const n={name:void 0,isSubroutined:!1,...t};if(n.name!==void 0&&!rO(n.name))throw new Error(`Group name "${n.name}" invalid in Oniguruma`);return{type:"CapturingGroup",number:e,...n.name&&{name:n.name},...n.isSubroutined&&{isSubroutined:n.isSubroutined},body:bc(t==null?void 0:t.body)}}function Yf(e,t){const n={useLastValid:!1,...t};if(e>1114111){const r=e.toString(16);if(n.useLastValid)e=1114111;else throw e>1310719?new Error(`Invalid code point out of range "\\x{${r}}"`):new Error(`Invalid code point out of range in JS "\\x{${r}}"`)}return{type:"Character",value:e}}function sf(e){const t={kind:"union",negate:!1,...e};return{type:"CharacterClass",kind:t.kind,negate:t.negate,body:i3(e==null?void 0:e.body)}}function XI(e,t){if(t.value<e.value)throw new Error("Character class range out of order");return{type:"CharacterClassRange",min:e,max:t}}function P0(e,t){const n=!!(t!=null&&t.negate),r={type:"CharacterSet",kind:e};return(e==="digit"||e==="hex"||e==="newline"||e==="space"||e==="word")&&(r.negate=n),(e==="text_segment"||e==="newline"&&!n)&&(r.variableLength=!0),r}function KI(e,t={}){if(e==="keep")return{type:"Directive",kind:e};if(e==="flags")return{type:"Directive",kind:e,flags:Ro(t.flags)};throw new Error(`Unexpected directive kind "${e}"`)}function ZI(e){return{type:"Flags",...e}}function Ea(e){const t=e==null?void 0:e.atomic,n=e==null?void 0:e.flags;if(t&&n)throw new Error("Atomic group cannot have flags");return{type:"Group",...t&&{atomic:t},...n&&{flags:n},body:bc(e==null?void 0:e.body)}}function tl(e){const t={behind:!1,negate:!1,...e};return{type:"LookaroundAssertion",kind:t.behind?"lookbehind":"lookahead",negate:t.negate,body:bc(e==null?void 0:e.body)}}function JI(e,t,n){return{type:"NamedCallout",kind:e,tag:t,arguments:n}}function eO(e,t){const n=!!(t!=null&&t.negate);if(!zg.has(e))throw new Error(`Invalid POSIX class "${e}"`);return{type:"CharacterSet",kind:"posix",value:e,negate:n}}function r3(e,t,n,r){if(t>n)throw new Error("Invalid reversed quantifier range");return{type:"Quantifier",kind:e,min:t,max:n,body:r}}function tO(e,t){return{type:"Regex",body:bc(t==null?void 0:t.body),flags:e}}function a3(e){return{type:"Subroutine",ref:e}}function oo(e,t){var s;const n={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t};let r=(s=n.unicodePropertyMap)==null?void 0:s.get(Wf(e));if(!r){if(n.normalizeUnknownPropertyNames)r=aO(e);else if(n.unicodePropertyMap&&!n.skipPropertyNameValidation)throw new Error(Wn`Invalid Unicode property "\p{${e}}"`)}return{type:"CharacterSet",kind:"property",value:r??e,negate:n.negate}}function nO({flags:e,kind:t,name:n,negate:r,number:s}){switch(t){case"absence_repeater":return QI("repeater");case"atomic":return Ea({atomic:!0});case"capturing":return n3(s,{name:n});case"group":return Ea({flags:e});case"lookahead":case"lookbehind":return tl({behind:t==="lookbehind",negate:r});default:throw new Error(`Unexpected group kind "${t}"`)}}function bc(e){if(e===void 0)e=[cl()];else if(!Array.isArray(e)||!e.length||!e.every(t=>t.type==="Alternative"))throw new Error("Invalid body; expected array of one or more Alternative nodes");return e}function i3(e){if(e===void 0)e=[];else if(!Array.isArray(e)||!e.every(t=>!!t.type))throw new Error("Invalid body; expected array of nodes");return e}function b2(e){return e.type==="LookaroundAssertion"&&e.kind==="lookahead"}function x2(e){return e.type==="LookaroundAssertion"&&e.kind==="lookbehind"}function rO(e){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(e)}function aO(e){return e.trim().replace(/[- _]+/g,"_").replace(/[A-Z][a-z]+(?=[A-Z])/g,"$&_").replace(/[A-Za-z]+/g,t=>t[0].toUpperCase()+t.slice(1).toLowerCase())}function Wf(e){return e.replace(/[- _]+/g,"").toLowerCase()}function y2(e,t){return Ro(e,`${(t==null?void 0:t.type)==="Character"&&t.value===93?"Empty":"Unclosed"} character class`)}function E2(e){return Ro(e,"Unclosed group")}function $u(e,t,n=null){function r(l,o){for(let c=0;c<l.length;c++){const d=s(l[c],o,c,l);c=Math.max(-1,c+d)}}function s(l,o=null,c=null,d=null){var S,A;let m=0,p=!1;const g={node:l,parent:o,key:c,container:d,root:e,remove(){jd(d).splice(Math.max(0,Jl(c)+m),1),m--,p=!0},removeAllNextSiblings(){return jd(d).splice(Jl(c)+1)},removeAllPrevSiblings(){const N=Jl(c)+m;return m-=N,jd(d).splice(0,Math.max(0,N))},replaceWith(N,U={}){const G=!!U.traverse;d?d[Math.max(0,Jl(c)+m)]=N:Ro(o,"Can't replace root node")[c]=N,G&&s(N,o,c,d),p=!0},replaceWithMultiple(N,U={}){const G=!!U.traverse;if(jd(d).splice(Math.max(0,Jl(c)+m),1,...N),m+=N.length-1,G){let P=0;for(let H=0;H<N.length;H++)P+=s(N[H],o,Jl(c)+H+P,d)}p=!0},skip(){p=!0}},{type:y}=l,E=t["*"],v=t[y],k=typeof E=="function"?E:E==null?void 0:E.enter,C=typeof v=="function"?v:v==null?void 0:v.enter;if(k==null||k(g,n),C==null||C(g,n),!p)switch(y){case"AbsenceFunction":case"CapturingGroup":case"Group":r(l.body,l);break;case"Alternative":case"CharacterClass":r(l.body,l);break;case"Assertion":case"Backreference":case"Character":case"CharacterSet":case"Directive":case"Flags":case"NamedCallout":case"Subroutine":break;case"CharacterClassRange":s(l.min,l,"min"),s(l.max,l,"max");break;case"LookaroundAssertion":r(l.body,l);break;case"Quantifier":s(l.body,l,"body");break;case"Regex":r(l.body,l),s(l.flags,l,"flags");break;default:throw new Error(`Unexpected node type "${y}"`)}return(S=v==null?void 0:v.exit)==null||S.call(v,g,n),(A=E==null?void 0:E.exit)==null||A.call(E,g,n),m}return s(e),e}function jd(e){if(!Array.isArray(e))throw new Error("Container expected");return e}function Jl(e){if(typeof e!="number")throw new Error("Numeric key expected");return e}const iO=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;function sO(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function lO(e,t,n,r){return e.slice(0,t)+r+e.slice(t+n.length)}const aa=Object.freeze({DEFAULT:"DEFAULT",CHAR_CLASS:"CHAR_CLASS"});function $g(e,t,n,r){const s=new RegExp(String.raw`${t}|(?<$skip>\[\^?|\\?.)`,"gsu"),l=[!1];let o=0,c="";for(const d of e.matchAll(s)){const{0:m,groups:{$skip:p}}=d;if(!p&&(!r||r===aa.DEFAULT==!o)){n instanceof Function?c+=n(d,{context:o?aa.CHAR_CLASS:aa.DEFAULT,negated:l[l.length-1]}):c+=n;continue}m[0]==="["?(o++,l.push(m[1]==="^")):m==="]"&&o&&(o--,l.pop()),c+=m}return c}function s3(e,t,n,r){$g(e,t,n,r)}function oO(e,t,n=0,r){if(!new RegExp(t,"su").test(e))return null;const s=new RegExp(`${t}|(?<$skip>\\\\?.)`,"gsu");s.lastIndex=n;let l=0,o;for(;o=s.exec(e);){const{0:c,groups:{$skip:d}}=o;if(!d&&(!r||r===aa.DEFAULT==!l))return o;c==="["?l++:c==="]"&&l&&l--,s.lastIndex==o.index&&s.lastIndex++}return null}function Md(e,t,n){return!!oO(e,t,0,n)}function uO(e,t){const n=/\\?./gsu;n.lastIndex=t;let r=e.length,s=0,l=1,o;for(;o=n.exec(e);){const[c]=o;if(c==="[")s++;else if(s)c==="]"&&s--;else if(c==="(")l++;else if(c===")"&&(l--,!l)){r=o.index;break}}return e.slice(t,r)}const _2=new RegExp(String.raw`(?<noncapturingStart>${iO})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,"gsu");function cO(e,t){const n=(t==null?void 0:t.hiddenCaptures)??[];let r=(t==null?void 0:t.captureTransfers)??new Map;if(!/\(\?>/.test(e))return{pattern:e,captureTransfers:r,hiddenCaptures:n};const s="(?>",l="(?:(?=(",o=[0],c=[];let d=0,m=0,p=NaN,g;do{g=!1;let y=0,E=0,v=!1,k;for(_2.lastIndex=Number.isNaN(p)?0:p+l.length;k=_2.exec(e);){const{0:C,index:S,groups:{capturingStart:A,noncapturingStart:N}}=k;if(C==="[")y++;else if(y)C==="]"&&y--;else if(C===s&&!v)p=S,v=!0;else if(v&&N)E++;else if(A)v?E++:(d++,o.push(d+m));else if(C===")"&&v){if(!E){m++;const U=d+m;if(e=`${e.slice(0,p)}${l}${e.slice(p+s.length,S)}))<$$${U}>)${e.slice(S+1)}`,g=!0,c.push(U),sO(n,U),r.size){const G=new Map;r.forEach((P,H)=>{G.set(H>=U?H+1:H,P.map(Y=>Y>=U?Y+1:Y))}),r=G}break}E--}}}while(g);return n.push(...c),e=$g(e,String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,({0:y,groups:{backrefNum:E,wrappedBackrefNum:v}})=>{if(E){const k=+E;if(k>o.length-1)throw new Error(`Backref "${y}" greater than number of captures`);return`\\${o[k]}`}return`\\${v}`},aa.DEFAULT),{pattern:e,captureTransfers:r,hiddenCaptures:n}}const l3=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,Mp=new RegExp(String.raw`
|
|
136
|
+
\\(?: \d+
|
|
137
|
+
| c[A-Za-z]
|
|
138
|
+
| [gk]<[^>]+>
|
|
139
|
+
| [pPu]\{[^\}]+\}
|
|
140
|
+
| u[A-Fa-f\d]{4}
|
|
141
|
+
| x[A-Fa-f\d]{2}
|
|
142
|
+
)
|
|
143
|
+
| \((?: \? (?: [:=!>]
|
|
144
|
+
| <(?:[=!]|[^>]+>)
|
|
145
|
+
| [A-Za-z\-]+:
|
|
146
|
+
| \(DEFINE\)
|
|
147
|
+
))?
|
|
148
|
+
| (?<qBase>${l3})(?<qMod>[?+]?)(?<invalidQ>[?*+\{]?)
|
|
149
|
+
| \\?.
|
|
150
|
+
`.replace(/\s+/g,""),"gsu");function dO(e){if(!new RegExp(`${l3}\\+`).test(e))return{pattern:e};const t=[];let n=null,r=null,s="",l=0,o;for(Mp.lastIndex=0;o=Mp.exec(e);){const{0:c,index:d,groups:{qBase:m,qMod:p,invalidQ:g}}=o;if(c==="[")l||(r=d),l++;else if(c==="]")l?l--:r=null;else if(!l)if(p==="+"&&s&&!s.startsWith("(")){if(g)throw new Error(`Invalid quantifier "${c}"`);let y=-1;if(/^\{\d+\}$/.test(m))e=lO(e,d+m.length,p,"");else{if(s===")"||s==="]"){const E=s===")"?n:r;if(E===null)throw new Error(`Invalid unmatched "${s}"`);e=`${e.slice(0,E)}(?>${e.slice(E,d)}${m})${e.slice(d+c.length)}`}else e=`${e.slice(0,d-s.length)}(?>${s}${m})${e.slice(d+c.length)}`;y+=4}Mp.lastIndex+=y}else c[0]==="("?t.push(d):c===")"&&(n=t.length?t.pop():null);s=c}return{pattern:e}}const ra=String.raw,fO=ra`\\g<(?<gRNameOrNum>[^>&]+)&R=(?<gRDepth>[^>]+)>`,B0=ra`\(\?R=(?<rDepth>[^\)]+)\)|${fO}`,Qf=ra`\(\?<(?![=!])(?<captureName>[^>]+)>`,o3=ra`${Qf}|(?<unnamed>\()(?!\?)`,Ks=new RegExp(ra`${Qf}|${B0}|\(\?|\\?.`,"gsu"),Pp="Cannot use multiple overlapping recursions";function hO(e,t){const{hiddenCaptures:n,mode:r}={hiddenCaptures:[],mode:"plugin",...t};let s=(t==null?void 0:t.captureTransfers)??new Map;if(!new RegExp(B0,"su").test(e))return{pattern:e,captureTransfers:s,hiddenCaptures:n};if(r==="plugin"&&Md(e,ra`\(\?\(DEFINE\)`,aa.DEFAULT))throw new Error("DEFINE groups cannot be used with recursion");const l=[],o=Md(e,ra`\\[1-9]`,aa.DEFAULT),c=new Map,d=[];let m=!1,p=0,g=0,y;for(Ks.lastIndex=0;y=Ks.exec(e);){const{0:E,groups:{captureName:v,rDepth:k,gRNameOrNum:C,gRDepth:S}}=y;if(E==="[")p++;else if(p)E==="]"&&p--;else if(k){if(T2(k),m)throw new Error(Pp);if(o)throw new Error(`${r==="external"?"Backrefs":"Numbered backrefs"} cannot be used with global recursion`);const A=e.slice(0,y.index),N=e.slice(Ks.lastIndex);if(Md(N,B0,aa.DEFAULT))throw new Error(Pp);const U=+k-1;e=v2(A,N,U,!1,n,l,g),s=k2(s,A,U,l.length,0,g);break}else if(C){T2(S);let A=!1;for(const F of d)if(F.name===C||F.num===+C){if(A=!0,F.hasRecursedWithin)throw new Error(Pp);break}if(!A)throw new Error(ra`Recursive \g cannot be used outside the referenced group "${r==="external"?C:ra`\g<${C}&R=${S}>`}"`);const N=c.get(C),U=uO(e,N);if(o&&Md(U,ra`${Qf}|\((?!\?)`,aa.DEFAULT))throw new Error(`${r==="external"?"Backrefs":"Numbered backrefs"} cannot be used with recursion of capturing groups`);const G=e.slice(N,y.index),P=U.slice(G.length+E.length),H=l.length,Y=+S-1,ue=v2(G,P,Y,!0,n,l,g);s=k2(s,G,Y,l.length-H,H,g);const M=e.slice(0,N),K=e.slice(N+U.length);e=`${M}${ue}${K}`,Ks.lastIndex+=ue.length-E.length-G.length-P.length,d.forEach(F=>F.hasRecursedWithin=!0),m=!0}else if(v)g++,c.set(String(g),Ks.lastIndex),c.set(v,Ks.lastIndex),d.push({num:g,name:v});else if(E[0]==="("){const A=E==="(";A&&(g++,c.set(String(g),Ks.lastIndex)),d.push(A?{num:g}:{})}else E===")"&&d.pop()}return n.push(...l),{pattern:e,captureTransfers:s,hiddenCaptures:n}}function T2(e){const t=`Max depth must be integer between 2 and 100; used ${e}`;if(!/^[1-9]\d*$/.test(e))throw new Error(t);if(e=+e,e<2||e>100)throw new Error(t)}function v2(e,t,n,r,s,l,o){const c=new Set;r&&s3(e+t,Qf,({groups:{captureName:m}})=>{c.add(m)},aa.DEFAULT);const d=[n,r?c:null,s,l,o];return`${e}${w2(`(?:${e}`,"forward",...d)}(?:)${w2(`${t})`,"backward",...d)}${t}`}function w2(e,t,n,r,s,l,o){const d=p=>t==="forward"?p+2:n-p+2-1;let m="";for(let p=0;p<n;p++){const g=d(p);m+=$g(e,ra`${o3}|\\k<(?<backref>[^>]+)>`,({0:y,groups:{captureName:E,unnamed:v,backref:k}})=>{if(k&&r&&!r.has(k))return y;const C=`_$${g}`;if(v||E){const S=o+l.length+1;return l.push(S),mO(s,S),v?y:`(?<${E}${C}>`}return ra`\k<${k}${C}>`},aa.DEFAULT)}return m}function mO(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function k2(e,t,n,r,s,l){if(e.size&&r){let o=0;s3(t,o3,()=>o++,aa.DEFAULT);const c=l-o+s,d=new Map;return e.forEach((m,p)=>{const g=(r-o*n)/n,y=o*n,E=p>c+o?p+r:p,v=[];for(const k of m)if(k<=c)v.push(k);else if(k>c+o+g)v.push(k+r);else if(k<=c+o)for(let C=0;C<=n;C++)v.push(k+o*C);else for(let C=0;C<=n;C++)v.push(k+y+g*C);d.set(E,v)}),d}return e}var Fn=String.fromCodePoint,_t=String.raw,_a={},Xf=globalThis.RegExp;_a.flagGroups=(()=>{try{new Xf("(?i:)")}catch{return!1}return!0})();_a.unicodeSets=(()=>{try{new Xf("[[]]","v")}catch{return!1}return!0})();_a.bugFlagVLiteralHyphenIsRange=_a.unicodeSets?(()=>{try{new Xf(_t`[\d\-a]`,"v")}catch{return!0}return!1})():!1;_a.bugNestedClassIgnoresNegation=_a.unicodeSets&&new Xf("[[^a]]","v").test("a");function wf(e,{enable:t,disable:n}){return{dotAll:!(n!=null&&n.dotAll)&&!!(t!=null&&t.dotAll||e.dotAll),ignoreCase:!(n!=null&&n.ignoreCase)&&!!(t!=null&&t.ignoreCase||e.ignoreCase)}}function sc(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}function U0(e,t){return C2[e]>=C2[t]}function pO(e,t){if(e==null)throw new Error(t??"Value expected");return e}var C2={ES2025:2025,ES2024:2024,ES2018:2018},gO={auto:"auto",ES2025:"ES2025",ES2024:"ES2024",ES2018:"ES2018"};function u3(e={}){if({}.toString.call(e)!=="[object Object]")throw new Error("Unexpected options");if(e.target!==void 0&&!gO[e.target])throw new Error(`Unexpected target "${e.target}"`);const t={accuracy:"default",avoidSubclass:!1,flags:"",global:!1,hasIndices:!1,lazyCompileLength:1/0,target:"auto",verbose:!1,...e,rules:{allowOrphanBackrefs:!1,asciiWordBoundaries:!1,captureGroup:!1,recursionLimit:20,singleline:!1,...e.rules}};return t.target==="auto"&&(t.target=_a.flagGroups?"ES2025":_a.unicodeSets?"ES2024":"ES2018"),t}var bO="[ -\r ]",xO=new Set([Fn(304),Fn(305)]),bi=_t`[\p{L}\p{M}\p{N}\p{Pc}]`;function c3(e){if(xO.has(e))return[e];const t=new Set,n=e.toLowerCase(),r=n.toUpperCase(),s=_O.get(n),l=yO.get(n),o=EO.get(n);return[...r].length===1&&t.add(r),o&&t.add(o),s&&t.add(s),t.add(n),l&&t.add(l),[...t]}var Vg=new Map(`C Other
|
|
151
|
+
Cc Control cntrl
|
|
152
|
+
Cf Format
|
|
153
|
+
Cn Unassigned
|
|
154
|
+
Co Private_Use
|
|
155
|
+
Cs Surrogate
|
|
156
|
+
L Letter
|
|
157
|
+
LC Cased_Letter
|
|
158
|
+
Ll Lowercase_Letter
|
|
159
|
+
Lm Modifier_Letter
|
|
160
|
+
Lo Other_Letter
|
|
161
|
+
Lt Titlecase_Letter
|
|
162
|
+
Lu Uppercase_Letter
|
|
163
|
+
M Mark Combining_Mark
|
|
164
|
+
Mc Spacing_Mark
|
|
165
|
+
Me Enclosing_Mark
|
|
166
|
+
Mn Nonspacing_Mark
|
|
167
|
+
N Number
|
|
168
|
+
Nd Decimal_Number digit
|
|
169
|
+
Nl Letter_Number
|
|
170
|
+
No Other_Number
|
|
171
|
+
P Punctuation punct
|
|
172
|
+
Pc Connector_Punctuation
|
|
173
|
+
Pd Dash_Punctuation
|
|
174
|
+
Pe Close_Punctuation
|
|
175
|
+
Pf Final_Punctuation
|
|
176
|
+
Pi Initial_Punctuation
|
|
177
|
+
Po Other_Punctuation
|
|
178
|
+
Ps Open_Punctuation
|
|
179
|
+
S Symbol
|
|
180
|
+
Sc Currency_Symbol
|
|
181
|
+
Sk Modifier_Symbol
|
|
182
|
+
Sm Math_Symbol
|
|
183
|
+
So Other_Symbol
|
|
184
|
+
Z Separator
|
|
185
|
+
Zl Line_Separator
|
|
186
|
+
Zp Paragraph_Separator
|
|
187
|
+
Zs Space_Separator
|
|
188
|
+
ASCII
|
|
189
|
+
ASCII_Hex_Digit AHex
|
|
190
|
+
Alphabetic Alpha
|
|
191
|
+
Any
|
|
192
|
+
Assigned
|
|
193
|
+
Bidi_Control Bidi_C
|
|
194
|
+
Bidi_Mirrored Bidi_M
|
|
195
|
+
Case_Ignorable CI
|
|
196
|
+
Cased
|
|
197
|
+
Changes_When_Casefolded CWCF
|
|
198
|
+
Changes_When_Casemapped CWCM
|
|
199
|
+
Changes_When_Lowercased CWL
|
|
200
|
+
Changes_When_NFKC_Casefolded CWKCF
|
|
201
|
+
Changes_When_Titlecased CWT
|
|
202
|
+
Changes_When_Uppercased CWU
|
|
203
|
+
Dash
|
|
204
|
+
Default_Ignorable_Code_Point DI
|
|
205
|
+
Deprecated Dep
|
|
206
|
+
Diacritic Dia
|
|
207
|
+
Emoji
|
|
208
|
+
Emoji_Component EComp
|
|
209
|
+
Emoji_Modifier EMod
|
|
210
|
+
Emoji_Modifier_Base EBase
|
|
211
|
+
Emoji_Presentation EPres
|
|
212
|
+
Extended_Pictographic ExtPict
|
|
213
|
+
Extender Ext
|
|
214
|
+
Grapheme_Base Gr_Base
|
|
215
|
+
Grapheme_Extend Gr_Ext
|
|
216
|
+
Hex_Digit Hex
|
|
217
|
+
IDS_Binary_Operator IDSB
|
|
218
|
+
IDS_Trinary_Operator IDST
|
|
219
|
+
ID_Continue IDC
|
|
220
|
+
ID_Start IDS
|
|
221
|
+
Ideographic Ideo
|
|
222
|
+
Join_Control Join_C
|
|
223
|
+
Logical_Order_Exception LOE
|
|
224
|
+
Lowercase Lower
|
|
225
|
+
Math
|
|
226
|
+
Noncharacter_Code_Point NChar
|
|
227
|
+
Pattern_Syntax Pat_Syn
|
|
228
|
+
Pattern_White_Space Pat_WS
|
|
229
|
+
Quotation_Mark QMark
|
|
230
|
+
Radical
|
|
231
|
+
Regional_Indicator RI
|
|
232
|
+
Sentence_Terminal STerm
|
|
233
|
+
Soft_Dotted SD
|
|
234
|
+
Terminal_Punctuation Term
|
|
235
|
+
Unified_Ideograph UIdeo
|
|
236
|
+
Uppercase Upper
|
|
237
|
+
Variation_Selector VS
|
|
238
|
+
White_Space space
|
|
239
|
+
XID_Continue XIDC
|
|
240
|
+
XID_Start XIDS`.split(/\s/).map(e=>[Wf(e),e])),yO=new Map([["s",Fn(383)],[Fn(383),"s"]]),EO=new Map([[Fn(223),Fn(7838)],[Fn(107),Fn(8490)],[Fn(229),Fn(8491)],[Fn(969),Fn(8486)]]),_O=new Map([fs(453),fs(456),fs(459),fs(498),...Bp(8072,8079),...Bp(8088,8095),...Bp(8104,8111),fs(8124),fs(8140),fs(8188)]),TO=new Map([["alnum",_t`[\p{Alpha}\p{Nd}]`],["alpha",_t`\p{Alpha}`],["ascii",_t`\p{ASCII}`],["blank",_t`[\p{Zs}\t]`],["cntrl",_t`\p{Cc}`],["digit",_t`\p{Nd}`],["graph",_t`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],["lower",_t`\p{Lower}`],["print",_t`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],["punct",_t`[\p{P}\p{S}]`],["space",_t`\p{space}`],["upper",_t`\p{Upper}`],["word",_t`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],["xdigit",_t`\p{AHex}`]]);function vO(e,t){const n=[];for(let r=e;r<=t;r++)n.push(r);return n}function fs(e){const t=Fn(e);return[t.toLowerCase(),t]}function Bp(e,t){return vO(e,t).map(n=>fs(n))}var d3=new Set(["Lower","Lowercase","Upper","Uppercase","Ll","Lowercase_Letter","Lt","Titlecase_Letter","Lu","Uppercase_Letter"]);function wO(e,t){const n={accuracy:"default",asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:"ES2025",...t};f3(e);const r={accuracy:n.accuracy,asciiWordBoundaries:n.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:U0(n.bestEffortTarget,"ES2024"),passedLookbehind:!1,strategy:null,subroutineRefMap:new Map,supportedGNodes:new Set,digitIsAscii:e.flags.digitIsAscii,spaceIsAscii:e.flags.spaceIsAscii,wordIsAscii:e.flags.wordIsAscii};$u(e,kO,r);const s={dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},l={currentFlags:s,prevFlags:null,globalFlags:s,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:r.subroutineRefMap};$u(e,CO,l);const o={groupsByName:l.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:l.reffedNodesByReferencer};return $u(e,SO,o),e._originMap=l.groupOriginByCopy,e._strategy=r.strategy,e}var kO={AbsenceFunction({node:e,parent:t,replaceWith:n}){const{body:r,kind:s}=e;if(s==="repeater"){const l=Ea();l.body[0].body.push(tl({negate:!0,body:r}),oo("Any"));const o=Ea();o.body[0].body.push(r3("greedy",0,1/0,l)),n(Cn(o,t),{traverse:!0})}else throw new Error('Unsupported absence function "(?~|"')},Alternative:{enter({node:e,parent:t,key:n},{flagDirectivesByAlt:r}){const s=e.body.filter(l=>l.kind==="flags");for(let l=n+1;l<t.body.length;l++){const o=t.body[l];sc(r,o,[]).push(...s)}},exit({node:e},{flagDirectivesByAlt:t}){var n;if((n=t.get(e))!=null&&n.length){const r=m3(t.get(e));if(r){const s=Ea({flags:r});s.body[0].body=e.body,e.body=[Cn(s,e)]}}}},Assertion({node:e,parent:t,key:n,container:r,root:s,remove:l,replaceWith:o},c){const{kind:d,negate:m}=e,{asciiWordBoundaries:p,avoidSubclass:g,supportedGNodes:y,wordIsAscii:E}=c;if(d==="text_segment_boundary")throw new Error(`Unsupported text segment boundary "\\${m?"Y":"y"}"`);if(d==="line_end")o(Cn(tl({body:[cl({body:[j0("string_end")]}),cl({body:[Yf(10)]})]}),t));else if(d==="line_start")o(Cn(xi(_t`(?<=\A|\n(?!\z))`,{skipLookbehindValidation:!0}),t));else if(d==="search_start")if(y.has(e))s.flags.sticky=!0,l();else{const v=r[n-1];if(v&&OO(v))o(Cn(tl({negate:!0}),t));else{if(g)throw new Error(_t`Uses "\G" in a way that requires a subclass`);o(hs(j0("string_start"),t)),c.strategy="clip_search"}}else if(!(d==="string_end"||d==="string_start"))if(d==="string_end_newline")o(Cn(xi(_t`(?=\n?\z)`),t));else if(d==="word_boundary"){if(!E&&!p){const v=`(?:(?<=${bi})(?!${bi})|(?<!${bi})(?=${bi}))`,k=`(?:(?<=${bi})(?=${bi})|(?<!${bi})(?!${bi}))`;o(Cn(xi(m?k:v),t))}}else throw new Error(`Unexpected assertion kind "${d}"`)},Backreference({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n=="string"&&!Hp(n)&&(n=Up(n,t),e.ref=n)},CapturingGroup({node:e},{jsGroupNameMap:t,subroutineRefMap:n}){let{name:r}=e;r&&!Hp(r)&&(r=Up(r,t),e.name=r),n.set(e.number,e),r&&n.set(r,e)},CharacterClassRange({node:e,parent:t,replaceWith:n}){if(t.kind==="intersection"){const r=sf({body:[e]});n(Cn(r,t),{traverse:!0})}},CharacterSet({node:e,parent:t,replaceWith:n},{accuracy:r,minTargetEs2024:s,digitIsAscii:l,spaceIsAscii:o,wordIsAscii:c}){const{kind:d,negate:m,value:p}=e;if(l&&(d==="digit"||p==="digit")){n(hs(P0("digit",{negate:m}),t));return}if(o&&(d==="space"||p==="space")){n(Cn(zp(xi(bO),m),t));return}if(c&&(d==="word"||p==="word")){n(hs(P0("word",{negate:m}),t));return}if(d==="any")n(hs(oo("Any"),t));else if(d==="digit")n(hs(oo("Nd",{negate:m}),t));else if(d!=="dot")if(d==="text_segment"){if(r==="strict")throw new Error(_t`Use of "\X" requires non-strict accuracy`);const g="\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?",y=_t`\p{RI}{2}|${g}(?:\u200D${g})*`;n(Cn(xi(_t`(?>\r\n|${s?_t`\p{RGI_Emoji}`:y}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),t))}else if(d==="hex")n(hs(oo("AHex",{negate:m}),t));else if(d==="newline")n(Cn(xi(m?`[^
|
|
241
|
+
]`:`(?>\r
|
|
242
|
+
?|[
|
|
243
|
+
\v\f
\u2028\u2029])`),t));else if(d==="posix")if(!s&&(p==="graph"||p==="print")){if(r==="strict")throw new Error(`POSIX class "${p}" requires min target ES2024 or non-strict accuracy`);let g={graph:"!-~",print:" -~"}[p];m&&(g=`\0-${Fn(g.codePointAt(0)-1)}${Fn(g.codePointAt(2)+1)}-`),n(Cn(xi(`[${g}]`),t))}else n(Cn(zp(xi(TO.get(p)),m),t));else if(d==="property")Vg.has(Wf(p))||(e.key="sc");else if(d==="space")n(hs(oo("space",{negate:m}),t));else if(d==="word")n(Cn(zp(xi(bi),m),t));else throw new Error(`Unexpected character set kind "${d}"`)},Directive({node:e,parent:t,root:n,remove:r,replaceWith:s,removeAllPrevSiblings:l,removeAllNextSiblings:o}){const{kind:c,flags:d}=e;if(c==="flags")if(!d.enable&&!d.disable)r();else{const m=Ea({flags:d});m.body[0].body=o(),s(Cn(m,t),{traverse:!0})}else if(c==="keep"){const m=n.body[0],g=n.body.length===1&&e3(m,{type:"Group"})&&m.body[0].body.length===1?m.body[0]:n;if(t.parent!==g||g.body.length>1)throw new Error(_t`Uses "\K" in a way that's unsupported`);const y=tl({behind:!0});y.body[0].body=l(),s(Cn(y,t))}else throw new Error(`Unexpected directive kind "${c}"`)},Flags({node:e,parent:t}){if(e.posixIsAscii)throw new Error('Unsupported flag "P"');if(e.textSegmentMode==="word")throw new Error('Unsupported flag "y{w}"');["digitIsAscii","extended","posixIsAscii","spaceIsAscii","wordIsAscii","textSegmentMode"].forEach(n=>delete e[n]),Object.assign(e,{global:!1,hasIndices:!1,multiline:!1,sticky:e.sticky??!1}),t.options={disable:{x:!0,n:!0},force:{v:!0}}},Group({node:e}){if(!e.flags)return;const{enable:t,disable:n}=e.flags;t!=null&&t.extended&&delete t.extended,n!=null&&n.extended&&delete n.extended,t!=null&&t.dotAll&&(n!=null&&n.dotAll)&&delete t.dotAll,t!=null&&t.ignoreCase&&(n!=null&&n.ignoreCase)&&delete t.ignoreCase,t&&!Object.keys(t).length&&delete e.flags.enable,n&&!Object.keys(n).length&&delete e.flags.disable,!e.flags.enable&&!e.flags.disable&&delete e.flags},LookaroundAssertion({node:e},t){const{kind:n}=e;n==="lookbehind"&&(t.passedLookbehind=!0)},NamedCallout({node:e,parent:t,replaceWith:n}){const{kind:r}=e;if(r==="fail")n(Cn(tl({negate:!0}),t));else throw new Error(`Unsupported named callout "(*${r.toUpperCase()}"`)},Quantifier({node:e}){if(e.body.type==="Quantifier"){const t=Ea();t.body[0].body.push(e.body),e.body=Cn(t,e)}},Regex:{enter({node:e},{supportedGNodes:t}){const n=[];let r=!1,s=!1;for(const l of e.body)if(l.body.length===1&&l.body[0].kind==="search_start")l.body.pop();else{const o=g3(l.body);o?(r=!0,Array.isArray(o)?n.push(...o):n.push(o)):s=!0}r&&!s&&n.forEach(l=>t.add(l))},exit(e,{accuracy:t,passedLookbehind:n,strategy:r}){if(t==="strict"&&n&&r)throw new Error(_t`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n=="string"&&!Hp(n)&&(n=Up(n,t),e.ref=n)}},CO={Backreference({node:e},{multiplexCapturesToLeftByRef:t,reffedNodesByReferencer:n}){const{orphan:r,ref:s}=e;r||n.set(e,[...t.get(s).map(({node:l})=>l)])},CapturingGroup:{enter({node:e,parent:t,replaceWith:n,skip:r},{groupOriginByCopy:s,groupsByName:l,multiplexCapturesToLeftByRef:o,openRefs:c,reffedNodesByReferencer:d}){const m=s.get(e);if(m&&c.has(e.number)){const g=hs(S2(e.number),t);d.set(g,c.get(e.number)),n(g);return}c.set(e.number,e),o.set(e.number,[]),e.name&&sc(o,e.name,[]);const p=o.get(e.name??e.number);for(let g=0;g<p.length;g++){const y=p[g];if(m===y.node||m&&m===y.origin||e===y.origin){p.splice(g,1);break}}if(o.get(e.number).push({node:e,origin:m}),e.name&&o.get(e.name).push({node:e,origin:m}),e.name){const g=sc(l,e.name,new Map);let y=!1;if(m)y=!0;else for(const E of g.values())if(!E.hasDuplicateNameToRemove){y=!0;break}l.get(e.name).set(e,{node:e,hasDuplicateNameToRemove:y})}},exit({node:e},{openRefs:t}){t.delete(e.number)}},Group:{enter({node:e},t){t.prevFlags=t.currentFlags,e.flags&&(t.currentFlags=wf(t.currentFlags,e.flags))},exit(e,t){t.currentFlags=t.prevFlags}},Subroutine({node:e,parent:t,replaceWith:n},r){const{isRecursive:s,ref:l}=e;if(s){let p=t;for(;(p=p.parent)&&!(p.type==="CapturingGroup"&&(p.name===l||p.number===l)););r.reffedNodesByReferencer.set(e,p);return}const o=r.subroutineRefMap.get(l),c=l===0,d=c?S2(0):h3(o,r.groupOriginByCopy,null);let m=d;if(!c){const p=m3(RO(o,y=>y.type==="Group"&&!!y.flags)),g=p?wf(r.globalFlags,p):r.globalFlags;AO(g,r.currentFlags)||(m=Ea({flags:LO(g)}),m.body[0].body.push(d))}n(Cn(m,t),{traverse:!c})}},SO={Backreference({node:e,parent:t,replaceWith:n},r){if(e.orphan){r.highestOrphanBackref=Math.max(r.highestOrphanBackref,e.ref);return}const l=r.reffedNodesByReferencer.get(e).filter(o=>NO(o,e));if(!l.length)n(Cn(tl({negate:!0}),t));else if(l.length>1){const o=Ea({atomic:!0,body:l.reverse().map(c=>cl({body:[M0(c.number)]}))});n(Cn(o,t))}else e.ref=l[0].number},CapturingGroup({node:e},t){e.number=++t.numCapturesToLeft,e.name&&t.groupsByName.get(e.name).get(e).hasDuplicateNameToRemove&&delete e.name},Regex:{exit({node:e},t){const n=Math.max(t.highestOrphanBackref-t.numCapturesToLeft,0);for(let r=0;r<n;r++){const s=n3();e.body.at(-1).body.push(s)}}},Subroutine({node:e},t){!e.isRecursive||e.ref===0||(e.ref=t.reffedNodesByReferencer.get(e).number)}};function f3(e){$u(e,{"*"({node:t,parent:n}){t.parent=n}})}function AO(e,t){return e.dotAll===t.dotAll&&e.ignoreCase===t.ignoreCase}function NO(e,t){let n=t;do{if(n.type==="Regex")return!1;if(n.type==="Alternative")continue;if(n===e)return!1;const r=p3(n.parent);for(const s of r){if(s===n)break;if(s===e||b3(s,e))return!0}}while(n=n.parent);throw new Error("Unexpected path")}function h3(e,t,n,r){const s=Array.isArray(e)?[]:{};for(const[l,o]of Object.entries(e))l==="parent"?s.parent=Array.isArray(n)?r:n:o&&typeof o=="object"?s[l]=h3(o,t,s,n):(l==="type"&&o==="CapturingGroup"&&t.set(s,t.get(e)??e),s[l]=o);return s}function S2(e){const t=a3(e);return t.isRecursive=!0,t}function RO(e,t){const n=[];for(;e=e.parent;)(!t||t(e))&&n.push(e);return n}function Up(e,t){if(t.has(e))return t.get(e);const n=`$${t.size}_${e.replace(/^[^$_\p{IDS}]|[^$\u200C\u200D\p{IDC}]/ug,"_")}`;return t.set(e,n),n}function m3(e){const t=["dotAll","ignoreCase"],n={enable:{},disable:{}};return e.forEach(({flags:r})=>{t.forEach(s=>{var l,o;(l=r.enable)!=null&&l[s]&&(delete n.disable[s],n.enable[s]=!0),(o=r.disable)!=null&&o[s]&&(n.disable[s]=!0)})}),Object.keys(n.enable).length||delete n.enable,Object.keys(n.disable).length||delete n.disable,n.enable||n.disable?n:null}function LO({dotAll:e,ignoreCase:t}){const n={};return(e||t)&&(n.enable={},e&&(n.enable.dotAll=!0),t&&(n.enable.ignoreCase=!0)),(!e||!t)&&(n.disable={},!e&&(n.disable.dotAll=!0),!t&&(n.disable.ignoreCase=!0)),n}function p3(e){if(!e)throw new Error("Node expected");const{body:t}=e;return Array.isArray(t)?t:t?[t]:null}function g3(e){const t=e.find(n=>n.kind==="search_start"||DO(n,{negate:!1})||!IO(n));if(!t)return null;if(t.kind==="search_start")return t;if(t.type==="LookaroundAssertion")return t.body[0].body[0];if(t.type==="CapturingGroup"||t.type==="Group"){const n=[];for(const r of t.body){const s=g3(r.body);if(!s)return null;Array.isArray(s)?n.push(...s):n.push(s)}return n}return null}function b3(e,t){const n=p3(e)??[];for(const r of n)if(r===t||b3(r,t))return!0;return!1}function IO({type:e}){return e==="Assertion"||e==="Directive"||e==="LookaroundAssertion"}function OO(e){const t=["Character","CharacterClass","CharacterSet"];return t.includes(e.type)||e.type==="Quantifier"&&e.min&&t.includes(e.body.type)}function DO(e,t){const n={negate:null,...t};return e.type==="LookaroundAssertion"&&(n.negate===null||e.negate===n.negate)&&e.body.length===1&&e3(e.body[0],{type:"Assertion",kind:"search_start"})}function Hp(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function xi(e,t){const r=t3(e,{...t,unicodePropertyMap:Vg}).body;return r.length>1||r[0].body.length>1?Ea({body:r}):r[0].body[0]}function zp(e,t){return e.negate=t,e}function hs(e,t){return e.parent=t,e}function Cn(e,t){return f3(e),e.parent=t,e}function jO(e,t){const n=u3(t),r=U0(n.target,"ES2024"),s=U0(n.target,"ES2025"),l=n.rules.recursionLimit;if(!Number.isInteger(l)||l<2||l>20)throw new Error("Invalid recursionLimit; use 2-20");let o=null,c=null;if(!s){const E=[e.flags.ignoreCase];$u(e,MO,{getCurrentModI:()=>E.at(-1),popModI(){E.pop()},pushModI(v){E.push(v)},setHasCasedChar(){E.at(-1)?o=!0:c=!0}})}const d={dotAll:e.flags.dotAll,ignoreCase:!!((e.flags.ignoreCase||o)&&!c)};let m=e;const p={accuracy:n.accuracy,appliedGlobalFlags:d,captureMap:new Map,currentFlags:{dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},inCharClass:!1,lastNode:m,originMap:e._originMap,recursionLimit:l,useAppliedIgnoreCase:!!(!s&&o&&c),useFlagMods:s,useFlagV:r,verbose:n.verbose};function g(E){return p.lastNode=m,m=E,pO(PO[E.type],`Unexpected node type "${E.type}"`)(E,p,g)}const y={pattern:e.body.map(g).join("|"),flags:g(e.flags),options:{...e.options}};return r||(delete y.options.force.v,y.options.disable.v=!0,y.options.unicodeSetsPlugin=null),y._captureTransfers=new Map,y._hiddenCaptures=[],p.captureMap.forEach((E,v)=>{E.hidden&&y._hiddenCaptures.push(v),E.transferTo&&sc(y._captureTransfers,E.transferTo,[]).push(v)}),y}var MO={"*":{enter({node:e},t){if(N2(e)){const n=t.getCurrentModI();t.pushModI(e.flags?wf({ignoreCase:n},e.flags).ignoreCase:n)}},exit({node:e},t){N2(e)&&t.popModI()}},Backreference(e,t){t.setHasCasedChar()},Character({node:e},t){Gg(Fn(e.value))&&t.setHasCasedChar()},CharacterClassRange({node:e,skip:t},n){t(),x3(e,{firstOnly:!0}).length&&n.setHasCasedChar()},CharacterSet({node:e},t){e.kind==="property"&&d3.has(e.value)&&t.setHasCasedChar()}},PO={Alternative({body:e},t,n){return e.map(n).join("")},Assertion({kind:e,negate:t}){if(e==="string_end")return"$";if(e==="string_start")return"^";if(e==="word_boundary")return t?_t`\B`:_t`\b`;throw new Error(`Unexpected assertion kind "${e}"`)},Backreference({ref:e},t){if(typeof e!="number")throw new Error("Unexpected named backref in transformed AST");if(!t.useFlagMods&&t.accuracy==="strict"&&t.currentFlags.ignoreCase&&!t.captureMap.get(e).ignoreCase)throw new Error("Use of case-insensitive backref to case-sensitive group requires target ES2025 or non-strict accuracy");return"\\"+e},CapturingGroup(e,t,n){const{body:r,name:s,number:l}=e,o={ignoreCase:t.currentFlags.ignoreCase},c=t.originMap.get(e);return c&&(o.hidden=!0,l>c.number&&(o.transferTo=c.number)),t.captureMap.set(l,o),`(${s?`?<${s}>`:""}${r.map(n).join("|")})`},Character({value:e},t){const n=Fn(e),r=eo(e,{escDigit:t.lastNode.type==="Backreference",inCharClass:t.inCharClass,useFlagV:t.useFlagV});if(r!==n)return r;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&Gg(n)){const s=c3(n);return t.inCharClass?s.join(""):s.length>1?`[${s.join("")}]`:s[0]}return n},CharacterClass(e,t,n){const{kind:r,negate:s,parent:l}=e;let{body:o}=e;if(r==="intersection"&&!t.useFlagV)throw new Error("Use of character class intersection requires min target ES2024");_a.bugFlagVLiteralHyphenIsRange&&t.useFlagV&&o.some(R2)&&(o=[Yf(45),...o.filter(m=>!R2(m))]);const c=()=>`[${s?"^":""}${o.map(n).join(r==="intersection"?"&&":"")}]`;if(!t.inCharClass){if((!t.useFlagV||_a.bugNestedClassIgnoresNegation)&&!s){const p=o.filter(g=>g.type==="CharacterClass"&&g.kind==="union"&&g.negate);if(p.length){const g=Ea(),y=g.body[0];return g.parent=l,y.parent=g,o=o.filter(E=>!p.includes(E)),e.body=o,o.length?(e.parent=y,y.body.push(e)):g.body.pop(),p.forEach(E=>{const v=cl({body:[E]});E.parent=v,v.parent=g,g.body.push(v)}),n(g)}}t.inCharClass=!0;const m=c();return t.inCharClass=!1,m}const d=o[0];if(r==="union"&&!s&&d&&((!t.useFlagV||!t.verbose)&&l.kind==="union"&&!(_a.bugFlagVLiteralHyphenIsRange&&t.useFlagV)||!t.verbose&&l.kind==="intersection"&&o.length===1&&d.type!=="CharacterClassRange"))return o.map(n).join("");if(!t.useFlagV&&l.type==="CharacterClass")throw new Error("Uses nested character class in a way that requires min target ES2024");return c()},CharacterClassRange(e,t){const n=e.min.value,r=e.max.value,s={escDigit:!1,inCharClass:!0,useFlagV:t.useFlagV},l=eo(n,s),o=eo(r,s),c=new Set;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase){const d=x3(e);FO(d).forEach(p=>{c.add(Array.isArray(p)?`${eo(p[0],s)}-${eo(p[1],s)}`:eo(p,s))})}return`${l}-${o}${[...c].join("")}`},CharacterSet({kind:e,negate:t,value:n,key:r},s){if(e==="dot")return s.currentFlags.dotAll?s.appliedGlobalFlags.dotAll||s.useFlagMods?".":"[^]":_t`[^\n]`;if(e==="digit")return t?_t`\D`:_t`\d`;if(e==="property"){if(s.useAppliedIgnoreCase&&s.currentFlags.ignoreCase&&d3.has(n))throw new Error(`Unicode property "${n}" can't be case-insensitive when other chars have specific case`);return`${t?_t`\P`:_t`\p`}{${r?`${r}=`:""}${n}}`}if(e==="word")return t?_t`\W`:_t`\w`;throw new Error(`Unexpected character set kind "${e}"`)},Flags(e,t){return(t.appliedGlobalFlags.ignoreCase?"i":"")+(e.dotAll?"s":"")+(e.sticky?"y":"")},Group({atomic:e,body:t,flags:n,parent:r},s,l){const o=s.currentFlags;n&&(s.currentFlags=wf(o,n));const c=t.map(l).join("|"),d=!s.verbose&&t.length===1&&r.type!=="Quantifier"&&!e&&(!s.useFlagMods||!n)?c:`(?${$O(e,n,s.useFlagMods)}${c})`;return s.currentFlags=o,d},LookaroundAssertion({body:e,kind:t,negate:n},r,s){return`(?${`${t==="lookahead"?"":"<"}${n?"!":"="}`}${e.map(s).join("|")})`},Quantifier(e,t,n){return n(e.body)+VO(e)},Subroutine({isRecursive:e,ref:t},n){if(!e)throw new Error("Unexpected non-recursive subroutine in transformed AST");const r=n.recursionLimit;return t===0?`(?R=${r})`:_t`\g<${t}&R=${r}>`}},BO=new Set(["$","(",")","*","+",".","?","[","\\","]","^","{","|","}"]),UO=new Set(["-","\\","]","^","["]),HO=new Set(["(",")","-","/","[","\\","]","^","{","|","}","!","#","$","%","&","*","+",",",".",":",";","<","=",">","?","@","`","~"]),A2=new Map([[9,_t`\t`],[10,_t`\n`],[11,_t`\v`],[12,_t`\f`],[13,_t`\r`],[8232,_t`\u2028`],[8233,_t`\u2029`],[65279,_t`\uFEFF`]]),zO=new RegExp("^\\p{Cased}$","u");function Gg(e){return zO.test(e)}function x3(e,t){const n=!!(t!=null&&t.firstOnly),r=e.min.value,s=e.max.value,l=[];if(r<65&&(s===65535||s>=131071)||r===65536&&s>=131071)return l;for(let o=r;o<=s;o++){const c=Fn(o);if(!Gg(c))continue;const d=c3(c).filter(m=>{const p=m.codePointAt(0);return p<r||p>s});if(d.length&&(l.push(...d),n))break}return l}function eo(e,{escDigit:t,inCharClass:n,useFlagV:r}){if(A2.has(e))return A2.get(e);if(e<32||e>126&&e<160||e>262143||t&&GO(e))return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,"0")}`;const s=n?r?HO:UO:BO,l=Fn(e);return(s.has(l)?"\\":"")+l}function FO(e){const t=e.map(s=>s.codePointAt(0)).sort((s,l)=>s-l),n=[];let r=null;for(let s=0;s<t.length;s++)t[s+1]===t[s]+1?r??(r=t[s]):r===null?n.push(t[s]):(n.push([r,t[s]]),r=null);return n}function $O(e,t,n){if(e)return">";let r="";if(t&&n){const{enable:s,disable:l}=t;r=(s!=null&&s.ignoreCase?"i":"")+(s!=null&&s.dotAll?"s":"")+(l?"-":"")+(l!=null&&l.ignoreCase?"i":"")+(l!=null&&l.dotAll?"s":"")}return`${r}:`}function VO({kind:e,max:t,min:n}){let r;return!n&&t===1?r="?":!n&&t===1/0?r="*":n===1&&t===1/0?r="+":n===t?r=`{${n}}`:r=`{${n},${t===1/0?"":t}}`,r+{greedy:"",lazy:"?",possessive:"+"}[e]}function N2({type:e}){return e==="CapturingGroup"||e==="Group"||e==="LookaroundAssertion"}function GO(e){return e>47&&e<58}function R2({type:e,value:t}){return e==="Character"&&t===45}var bs,_i,ll,xs,ol,cc,H0,_s,qO=(_s=class extends RegExp{constructor(n,r,s){var t=(...NY)=>(super(...NY),Ys(this,cc),Ys(this,bs,new Map),Ys(this,_i,null),Ys(this,ll),Ys(this,xs,null),Ys(this,ol,null),le(this,"rawOptions",{}),this);const l=!!(s!=null&&s.lazyCompile);if(n instanceof RegExp){if(s)throw new Error("Cannot provide options when copying a regexp");const o=n;t(o,r),xa(this,ll,o.source),o instanceof _s&&(xa(this,bs,cr(o,bs)),xa(this,xs,cr(o,xs)),xa(this,ol,cr(o,ol)),this.rawOptions=o.rawOptions)}else{const o={hiddenCaptures:[],strategy:null,transfers:[],...s};t(l?"":n,r),xa(this,ll,n),xa(this,bs,WO(o.hiddenCaptures,o.transfers)),xa(this,ol,o.strategy),this.rawOptions=s??{}}l||xa(this,_i,this)}get source(){return cr(this,ll)||"(?:)"}exec(n){if(!cr(this,_i)){const{lazyCompile:l,...o}=this.rawOptions;xa(this,_i,new _s(cr(this,ll),this.flags,o))}const r=this.global||this.sticky,s=this.lastIndex;if(cr(this,ol)==="clip_search"&&r&&s){this.lastIndex=0;const l=up(this,cc,H0).call(this,n.slice(s));return l&&(YO(l,s,n,this.hasIndices),this.lastIndex+=s),l}return up(this,cc,H0).call(this,n)}},bs=new WeakMap,_i=new WeakMap,ll=new WeakMap,xs=new WeakMap,ol=new WeakMap,cc=new WeakSet,H0=function(n){cr(this,_i).lastIndex=this.lastIndex;const r=lE(_s.prototype,this,"exec").call(cr(this,_i),n);if(this.lastIndex=cr(this,_i).lastIndex,!r||!cr(this,bs).size)return r;const s=[...r];r.length=1;let l;this.hasIndices&&(l=[...r.indices],r.indices.length=1);const o=[0];for(let c=1;c<s.length;c++){const{hidden:d,transferTo:m}=cr(this,bs).get(c)??{};if(d?o.push(null):(o.push(r.length),r.push(s[c]),this.hasIndices&&r.indices.push(l[c])),m&&s[c]!==void 0){const p=o[m];if(!p)throw new Error(`Invalid capture transfer to "${p}"`);if(r[p]=s[c],this.hasIndices&&(r.indices[p]=l[c]),r.groups){cr(this,xs)||xa(this,xs,QO(this.source));const g=cr(this,xs).get(m);g&&(r.groups[g]=s[c],this.hasIndices&&(r.indices.groups[g]=l[c]))}}}return r},_s);function YO(e,t,n,r){if(e.index+=t,e.input=n,r){const s=e.indices;for(let o=0;o<s.length;o++){const c=s[o];c&&(s[o]=[c[0]+t,c[1]+t])}const l=s.groups;l&&Object.keys(l).forEach(o=>{const c=l[o];c&&(l[o]=[c[0]+t,c[1]+t])})}}function WO(e,t){const n=new Map;for(const r of e)n.set(r,{hidden:!0});for(const[r,s]of t)for(const l of s)sc(n,l,{}).transferTo=r;return n}function QO(e){const t=/(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu,n=new Map;let r=0,s=0,l;for(;l=t.exec(e);){const{0:o,groups:{capture:c,name:d}}=l;o==="["?r++:r?o==="]"&&r--:c&&(s++,d&&n.set(s,d))}return n}function XO(e,t){const n=KO(e,t);return n.options?new qO(n.pattern,n.flags,n.options):new RegExp(n.pattern,n.flags)}function KO(e,t){const n=u3(t),r=t3(e,{flags:n.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline},skipBackrefValidation:n.rules.allowOrphanBackrefs,unicodePropertyMap:Vg}),s=wO(r,{accuracy:n.accuracy,asciiWordBoundaries:n.rules.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,bestEffortTarget:n.target}),l=jO(s,n),o=hO(l.pattern,{captureTransfers:l._captureTransfers,hiddenCaptures:l._hiddenCaptures,mode:"external"}),c=dO(o.pattern),d=cO(c.pattern,{captureTransfers:o.captureTransfers,hiddenCaptures:o.hiddenCaptures}),m={pattern:d.pattern,flags:`${n.hasIndices?"d":""}${n.global?"g":""}${l.flags}${l.options.disable.v?"u":"v"}`};if(n.avoidSubclass){if(n.lazyCompileLength!==1/0)throw new Error("Lazy compilation requires subclass")}else{const p=d.hiddenCaptures.sort((v,k)=>v-k),g=Array.from(d.captureTransfers),y=s._strategy,E=m.pattern.length>=n.lazyCompileLength;(p.length||g.length||y||E)&&(m.options={...p.length&&{hiddenCaptures:p},...g.length&&{transfers:g},...y&&{strategy:y},...E&&{lazyCompile:E}})}return m}const L2=4294967295;class ZO{constructor(t,n={}){le(this,"regexps");this.patterns=t,this.options=n;const{forgiving:r=!1,cache:s,regexConstructor:l}=n;if(!l)throw new Error("Option `regexConstructor` is not provided");this.regexps=t.map(o=>{if(typeof o!="string")return o;const c=s==null?void 0:s.get(o);if(c){if(c instanceof RegExp)return c;if(r)return null;throw c}try{const d=l(o);return s==null||s.set(o,d),d}catch(d){if(s==null||s.set(o,d),r)return null;throw d}})}findNextMatchSync(t,n,r){const s=typeof t=="string"?t:t.content,l=[];function o(c,d,m=0){return{index:c,captureIndices:d.indices.map(p=>p==null?{start:L2,end:L2,length:0}:{start:p[0]+m,end:p[1]+m,length:p[1]-p[0]})}}for(let c=0;c<this.regexps.length;c++){const d=this.regexps[c];if(d)try{d.lastIndex=n;const m=d.exec(s);if(!m)continue;if(m.index===n)return o(c,m,0);l.push([c,m,0])}catch(m){if(this.options.forgiving)continue;throw m}}if(l.length){const c=Math.min(...l.map(d=>d[1].index));for(const[d,m,p]of l)if(m.index===c)return o(d,m,p)}return null}}function JO(e,t){return XO(e,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...t})}function e8(e={}){const t=Object.assign({target:"auto",cache:new Map},e);return t.regexConstructor||(t.regexConstructor=n=>JO(n,{target:t.target})),{createScanner(n){return new ZO(n,t)},createString(n){return{content:n}}}}var t8=e8({forgiving:!0}),n8=Object.fromEntries(Ug.flatMap(e=>{var t;return((t=e.aliases)!=null?t:[]).map(n=>[n,e.id])})),lf=new Set(Object.keys(Yv)),I2=e=>{let t=e.trim().toLowerCase();return n8[t]||(lf.has(t),t)},Fp=new Map,$p=new Map,to=new Map,kf=e=>{var t;return typeof e=="string"?e:(t=e.name)!=null?t:"custom"},r8=(e,t)=>`${e}-${kf(t[0])}-${kf(t[1])}`,a8=(e,t,n)=>{let r=e.slice(0,100),s=e.length>100?e.slice(-100):"";return`${t}:${n[0]}:${n[1]}:${e.length}:${r}:${s}`},i8=(e,t)=>{let n=r8(e,t);if(Fp.has(n))return Fp.get(n);let r=mI({themes:t,langs:[e],engine:t8});return Fp.set(n,r),r};function s8(e={}){var t;let n=(t=e.themes)!=null?t:["github-light","github-dark"];return{name:"shiki",type:"code-highlighter",supportsLanguage(r){let s=I2(r);return lf.has(s)},getSupportedLanguages(){return Array.from(lf)},getThemes(){return n},highlight({code:r,language:s,themes:l},o){let c=I2(s),d=[kf(l[0]),kf(l[1])],m=a8(r,c,d);if($p.has(m))return $p.get(m);o&&(to.has(m)||to.set(m,new Set),to.get(m).add(o));let p=lf.has(c)?c:"text";return i8(p,l).then(g=>{let y=g.getLoadedLanguages().includes(c)?c:"text",E=g.codeToTokens(r,{lang:y,themes:{light:d[0],dark:d[1]}});$p.set(m,E);let v=to.get(m);if(v){for(let k of v)k(E);to.delete(m)}}).catch(g=>{console.error("[Streamdown Code] Failed to highlight code:",g),to.delete(m)}),null}}}var l8=s8();const Kf=(function(e){if(e==null)return d8;if(typeof e=="function")return Zf(e);if(typeof e=="object")return Array.isArray(e)?o8(e):u8(e);if(typeof e=="string")return c8(e);throw new Error("Expected function, string, or object as test")});function o8(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Kf(e[n]);return Zf(r);function r(...s){let l=-1;for(;++l<t.length;)if(t[l].apply(this,s))return!0;return!1}}function u8(e){const t=e;return Zf(n);function n(r){const s=r;let l;for(l in e)if(s[l]!==t[l])return!1;return!0}}function c8(e){return Zf(t);function t(n){return n&&n.type===e}}function Zf(e){return t;function t(n,r,s){return!!(f8(n)&&e.call(this,n,typeof r=="number"?r:void 0,s||void 0))}}function d8(){return!0}function f8(e){return e!==null&&typeof e=="object"&&"type"in e}const y3=[],Pu=!0,z0=!1,fo="skip";function qg(e,t,n,r){let s;typeof t=="function"&&typeof n!="function"?(r=n,n=t):s=t;const l=Kf(s),o=r?-1:1;c(e,void 0,[])();function c(d,m,p){const g=d&&typeof d=="object"?d:{};if(typeof g.type=="string"){const E=typeof g.tagName=="string"?g.tagName:typeof g.name=="string"?g.name:void 0;Object.defineProperty(y,"name",{value:"node ("+(d.type+(E?"<"+E+">":""))+")"})}return y;function y(){let E=y3,v,k,C;if((!t||l(d,m,p[p.length-1]||void 0))&&(E=h8(n(d,p)),E[0]===z0))return E;if("children"in d&&d.children){const S=d;if(S.children&&E[0]!==fo)for(k=(r?S.children.length:-1)+o,C=p.concat(S);k>-1&&k<S.children.length;){const A=S.children[k];if(v=c(A,k,C)(),v[0]===z0)return v;k=typeof v[1]=="number"?v[1]:k+o}}return E}}}function h8(e){return Array.isArray(e)?e:typeof e=="number"?[Pu,e]:e==null?y3:[e]}function $a(e,t,n,r){let s,l,o;typeof t=="function"&&typeof n!="function"?(l=void 0,o=t,s=n):(l=t,o=n,s=r),qg(e,l,c,s);function c(d,m){const p=m[m.length-1],g=p?p.children.indexOf(d):void 0;return o(d,g,p)}}const yo={indicator:"indicator",textOnly:"text-only",remove:"remove"};function m8({defaultOrigin:e="",allowedLinkPrefixes:t=[],allowedImagePrefixes:n=[],allowDataImages:r=!1,allowedProtocols:s=[],blockedImageClass:l="inline-block bg-gray-200 dark:bg-gray-700 text-gray-600 dark:text-gray-400 px-3 py-1 rounded text-sm",blockedLinkClass:o="text-gray-500",linkBlockPolicy:c=yo.indicator,imageBlockPolicy:d=yo.indicator}){const m=t.length&&!t.every(g=>g==="*"),p=n.length&&!n.every(g=>g==="*");if(!e&&(m||p))throw new Error("defaultOrigin is required when allowedLinkPrefixes or allowedImagePrefixes are provided");return g=>{const y=E8(e,t,n,r,s,l,o,c,d);E3(g),$a(g,y)}}function O2(e,t){if(typeof e!="string")return null;try{return new URL(e)}catch{if(t)try{return new URL(e,t)}catch{return null}if(e.startsWith("/")||e.startsWith("./")||e.startsWith("../"))try{return new URL(e,"http://example.com")}catch{return null}return null}}function p8(e){return typeof e!="string"?!1:e.startsWith("/")||e.startsWith("./")||e.startsWith("../")}const g8=new Set(["https:","http:","irc:","ircs:","mailto:","xmpp:","blob:"]),b8=new Set(["javascript:","data:","file:","vbscript:"]);function D2(e,t,n,r=!1,s=!1,l=[]){if(!e)return null;if(typeof e=="string"&&e.startsWith("#")&&!s)try{if(new URL(e,"http://example.com").hash===e)return e}catch{}if(typeof e=="string"&&e.startsWith("data:"))return s&&r&&e.startsWith("data:image/")?e:null;if(typeof e=="string"&&e.startsWith("blob:")){try{if(new URL(e).protocol==="blob:"&&e.length>5){const p=e.substring(5);if(p&&p.length>0&&p!=="invalid")return e}}catch{return null}return null}const o=O2(e,n);if(!o||b8.has(o.protocol)||!(g8.has(o.protocol)||l.includes(o.protocol)||l.includes("*")))return null;if(o.protocol==="mailto:"||!o.protocol.match(/^https?:$/))return o.href;const d=p8(e);return o&&t.some(m=>{const p=O2(m,n);return!p||p.origin!==o.origin?!1:o.href.startsWith(p.href)})?d?o.pathname+o.search+o.hash:o.href:t.includes("*")?o.protocol!=="https:"&&o.protocol!=="http:"?null:d?o.pathname+o.search+o.hash:o.href:null}function E3(e){if("children"in e&&Array.isArray(e.children)){e.children=e.children.filter(t=>t!=null);for(const t of e.children)E3(t)}}const Vp=Symbol("node-seen");function x8(e,t,n){return t===yo.remove?{type:"remove"}:t===yo.textOnly?{type:"replace",element:{type:"element",tagName:"span",properties:{},children:[...e.children]}}:{type:"replace",element:{type:"element",tagName:"span",properties:{title:"Blocked URL: "+String(e.properties.href),class:n},children:[...e.children,{type:"text",value:" [blocked]"}]}}}function y8(e,t,n){if(t===yo.remove)return{type:"remove"};if(t===yo.textOnly){const r=String(e.properties.alt||"");return r?{type:"replace",element:{type:"element",tagName:"span",properties:{},children:[{type:"text",value:r}]}}:{type:"remove"}}return{type:"replace",element:{type:"element",tagName:"span",properties:{class:n},children:[{type:"text",value:"[Image blocked: "+String(e.properties.alt||"No description")+"]"}]}}}const E8=(e,t,n,r,s,l,o,c,d)=>{const m=(p,g,y)=>{if(p.type!=="element"||p[Vp])return Pu;if(p.tagName==="a"){const E=D2(p.properties.href,t,e,!1,!1,s);if(E===null){if(p[Vp]=!0,$a(p,m),y&&typeof g=="number"){const v=x8(p,c,o);if(v.type==="remove")return y.children.splice(g,1),[fo,g];y.children[g]=v.element}return fo}else return p.properties.href=E,p.properties.target="_blank",p.properties.rel="noopener noreferrer",Pu}if(p.tagName==="img"){const E=D2(p.properties.src,n,e,r,!0,s);if(E===null){if(p[Vp]=!0,$a(p,m),y&&typeof g=="number"){const v=y8(p,d,l);if(v.type==="remove")return y.children.splice(g,1),[fo,g];y.children[g]=v.element}return fo}else return p.properties.src=E,Pu}return Pu};return m},_3=-1,Jf=0,Vu=1,Cf=2,Yg=3,Wg=4,Qg=5,Xg=6,T3=7,v3=8,j2=typeof self=="object"?self:globalThis,_8=(e,t)=>{const n=(s,l)=>(e.set(l,s),s),r=s=>{if(e.has(s))return e.get(s);const[l,o]=t[s];switch(l){case Jf:case _3:return n(o,s);case Vu:{const c=n([],s);for(const d of o)c.push(r(d));return c}case Cf:{const c=n({},s);for(const[d,m]of o)c[r(d)]=r(m);return c}case Yg:return n(new Date(o),s);case Wg:{const{source:c,flags:d}=o;return n(new RegExp(c,d),s)}case Qg:{const c=n(new Map,s);for(const[d,m]of o)c.set(r(d),r(m));return c}case Xg:{const c=n(new Set,s);for(const d of o)c.add(r(d));return c}case T3:{const{name:c,message:d}=o;return n(new j2[c](d),s)}case v3:return n(BigInt(o),s);case"BigInt":return n(Object(BigInt(o)),s);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:c}=new Uint8Array(o);return n(new DataView(c),o)}}return n(new j2[l](o),s)};return r},M2=e=>_8(new Map,e)(0),no="",{toString:T8}={},{keys:v8}=Object,Cu=e=>{const t=typeof e;if(t!=="object"||!e)return[Jf,t];const n=T8.call(e).slice(8,-1);switch(n){case"Array":return[Vu,no];case"Object":return[Cf,no];case"Date":return[Yg,no];case"RegExp":return[Wg,no];case"Map":return[Qg,no];case"Set":return[Xg,no];case"DataView":return[Vu,n]}return n.includes("Array")?[Vu,n]:n.includes("Error")?[T3,n]:[Cf,n]},Pd=([e,t])=>e===Jf&&(t==="function"||t==="symbol"),w8=(e,t,n,r)=>{const s=(o,c)=>{const d=r.push(o)-1;return n.set(c,d),d},l=o=>{if(n.has(o))return n.get(o);let[c,d]=Cu(o);switch(c){case Jf:{let p=o;switch(d){case"bigint":c=v3,p=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+d);p=null;break;case"undefined":return s([_3],o)}return s([c,p],o)}case Vu:{if(d){let y=o;return d==="DataView"?y=new Uint8Array(o.buffer):d==="ArrayBuffer"&&(y=new Uint8Array(o)),s([d,[...y]],o)}const p=[],g=s([c,p],o);for(const y of o)p.push(l(y));return g}case Cf:{if(d)switch(d){case"BigInt":return s([d,o.toString()],o);case"Boolean":case"Number":case"String":return s([d,o.valueOf()],o)}if(t&&"toJSON"in o)return l(o.toJSON());const p=[],g=s([c,p],o);for(const y of v8(o))(e||!Pd(Cu(o[y])))&&p.push([l(y),l(o[y])]);return g}case Yg:return s([c,o.toISOString()],o);case Wg:{const{source:p,flags:g}=o;return s([c,{source:p,flags:g}],o)}case Qg:{const p=[],g=s([c,p],o);for(const[y,E]of o)(e||!(Pd(Cu(y))||Pd(Cu(E))))&&p.push([l(y),l(E)]);return g}case Xg:{const p=[],g=s([c,p],o);for(const y of o)(e||!Pd(Cu(y)))&&p.push(l(y));return g}}const{message:m}=o;return s([c,{name:d,message:m}],o)};return l},P2=(e,{json:t,lossy:n}={})=>{const r=[];return w8(!(t||n),!!t,new Map,r)(e),r},dl=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?M2(P2(e,t)):structuredClone(e):(e,t)=>M2(P2(e,t));const B2=/[#.]/g;function k8(e,t){const n=e||"",r={};let s=0,l,o;for(;s<n.length;){B2.lastIndex=s;const c=B2.exec(n),d=n.slice(s,c?c.index:n.length);d&&(l?l==="#"?r.id=d:Array.isArray(r.className)?r.className.push(d):r.className=[d]:o=d,s+=d.length),c&&(l=c[0],s++)}return{type:"element",tagName:o||t||"div",properties:r,children:[]}}function w3(e,t,n){const r=n?N8(n):void 0;function s(l,o,...c){let d;if(l==null){d={type:"root",children:[]};const m=o;c.unshift(m)}else{d=k8(l,t);const m=d.tagName.toLowerCase(),p=r?r.get(m):void 0;if(d.tagName=p||m,C8(o))c.unshift(o);else for(const[g,y]of Object.entries(o))S8(e,d.properties,g,y)}for(const m of c)F0(d.children,m);return d.type==="element"&&d.tagName==="template"&&(d.content={type:"root",children:d.children},d.children=[]),d}return s}function C8(e){if(e===null||typeof e!="object"||Array.isArray(e))return!0;if(typeof e.type!="string")return!1;const t=e,n=Object.keys(e);for(const r of n){const s=t[r];if(s&&typeof s=="object"){if(!Array.isArray(s))return!0;const l=s;for(const o of l)if(typeof o!="number"&&typeof o!="string")return!0}}return!!("children"in e&&Array.isArray(e.children))}function S8(e,t,n,r){const s=gc(e,n);let l;if(r!=null){if(typeof r=="number"){if(Number.isNaN(r))return;l=r}else typeof r=="boolean"?l=r:typeof r=="string"?s.spaceSeparated?l=n2(r):s.commaSeparated?l=t2(r):s.commaOrSpaceSeparated?l=n2(t2(r).join(" ")):l=U2(s,s.property,r):Array.isArray(r)?l=[...r]:l=s.property==="style"?A8(r):String(r);if(Array.isArray(l)){const o=[];for(const c of l)o.push(U2(s,s.property,c));l=o}s.property==="className"&&Array.isArray(t.className)&&(l=t.className.concat(l)),t[s.property]=l}}function F0(e,t){if(t!=null)if(typeof t=="number"||typeof t=="string")e.push({type:"text",value:String(t)});else if(Array.isArray(t))for(const n of t)F0(e,n);else if(typeof t=="object"&&"type"in t)t.type==="root"?F0(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function U2(e,t,n){if(typeof n=="string"){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===""||ac(n)===ac(t)))return!0}return n}function A8(e){const t=[];for(const[n,r]of Object.entries(e))t.push([n,r].join(": "));return t.join("; ")}function N8(e){const t=new Map;for(const n of e)t.set(n.toLowerCase(),n);return t}const R8=["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"],L8=w3(So,"div"),I8=w3(Va,"g",R8);function O8(e){const t=String(e),n=[];return{toOffset:s,toPoint:r};function r(l){if(typeof l=="number"&&l>-1&&l<=t.length){let o=0;for(;;){let c=n[o];if(c===void 0){const d=H2(t,n[o-1]);c=d===-1?t.length+1:d+1,n[o]=c}if(c>l)return{line:o+1,column:l-(o>0?n[o-1]:0)+1,offset:l};o++}}}function s(l){if(l&&typeof l.line=="number"&&typeof l.column=="number"&&!Number.isNaN(l.line)&&!Number.isNaN(l.column)){for(;n.length<l.line;){const c=n[n.length-1],d=H2(t,c),m=d===-1?t.length+1:d+1;if(c===m)break;n.push(m)}const o=(l.line>1?n[l.line-2]:0)+l.column-1;if(o<n[l.line-1])return o}}}function H2(e,t){const n=e.indexOf("\r",t),r=e.indexOf(`
|
|
244
|
+
`,t);return r===-1?n:n===-1||n+1===r?r:n<r?n:r}const sl={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},k3={}.hasOwnProperty,D8=Object.prototype;function j8(e,t){const n=t||{};return Kg({file:n.file||void 0,location:!1,schema:n.space==="svg"?Va:So,verbose:n.verbose||!1},e)}function Kg(e,t){let n;switch(t.nodeName){case"#comment":{const r=t;return n={type:"comment",value:r.data},of(e,r,n),n}case"#document":case"#document-fragment":{const r=t,s="mode"in r?r.mode==="quirks"||r.mode==="limited-quirks":!1;if(n={type:"root",children:C3(e,t.childNodes),data:{quirksMode:s}},e.file&&e.location){const l=String(e.file),o=O8(l),c=o.toPoint(0),d=o.toPoint(l.length);n.position={start:c,end:d}}return n}case"#documentType":{const r=t;return n={type:"doctype"},of(e,r,n),n}case"#text":{const r=t;return n={type:"text",value:r.value},of(e,r,n),n}default:return n=M8(e,t),n}}function C3(e,t){let n=-1;const r=[];for(;++n<t.length;){const s=Kg(e,t[n]);r.push(s)}return r}function M8(e,t){const n=e.schema;e.schema=t.namespaceURI===sl.svg?Va:So;let r=-1;const s={};for(;++r<t.attrs.length;){const c=t.attrs[r],d=(c.prefix?c.prefix+":":"")+c.name;k3.call(D8,d)||(s[d]=c.value)}const o=(e.schema.space==="svg"?I8:L8)(t.tagName,s,C3(e,t.childNodes));if(of(e,t,o),o.tagName==="template"){const c=t,d=c.sourceCodeLocation,m=d&&d.startTag&&ho(d.startTag),p=d&&d.endTag&&ho(d.endTag),g=Kg(e,c.content);m&&p&&e.file&&(g.position={start:m.end,end:p.start}),o.content=g}return e.schema=n,o}function of(e,t,n){if("sourceCodeLocation"in t&&t.sourceCodeLocation&&e.file){const r=P8(e,n,t.sourceCodeLocation);r&&(e.location=!0,n.position=r)}}function P8(e,t,n){const r=ho(n);if(t.type==="element"){const s=t.children[t.children.length-1];if(r&&!n.endTag&&s&&s.position&&s.position.end&&(r.end=Object.assign({},s.position.end)),e.verbose){const l={};let o;if(n.attrs)for(o in n.attrs)k3.call(n.attrs,o)&&(l[gc(e.schema,o).property]=ho(n.attrs[o]));n.startTag;const c=ho(n.startTag),d=n.endTag?ho(n.endTag):void 0,m={opening:c};d&&(m.closing=d),m.properties=l,t.data={position:m}}}return r}function ho(e){const t=z2({line:e.startLine,column:e.startCol,offset:e.startOffset}),n=z2({line:e.endLine,column:e.endCol,offset:e.endOffset});return t||n?{start:t,end:n}:void 0}function z2(e){return e.line&&e.column?e:void 0}const B8={},U8={}.hasOwnProperty,S3=Ng("type",{handlers:{root:z8,element:q8,text:V8,comment:G8,doctype:$8}});function H8(e,t){const r=(t||B8).space;return S3(e,r==="svg"?Va:So)}function z8(e,t){const n={nodeName:"#document",mode:(e.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return n.childNodes=Zg(e.children,n,t),Lo(e,n),n}function F8(e,t){const n={nodeName:"#document-fragment",childNodes:[]};return n.childNodes=Zg(e.children,n,t),Lo(e,n),n}function $8(e){const t={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return Lo(e,t),t}function V8(e){const t={nodeName:"#text",value:e.value,parentNode:null};return Lo(e,t),t}function G8(e){const t={nodeName:"#comment",data:e.value,parentNode:null};return Lo(e,t),t}function q8(e,t){const n=t;let r=n;e.type==="element"&&e.tagName.toLowerCase()==="svg"&&n.space==="html"&&(r=Va);const s=[];let l;if(e.properties){for(l in e.properties)if(l!=="children"&&U8.call(e.properties,l)){const d=Y8(r,l,e.properties[l]);d&&s.push(d)}}const o=r.space,c={nodeName:e.tagName,tagName:e.tagName,attrs:s,namespaceURI:sl[o],childNodes:[],parentNode:null};return c.childNodes=Zg(e.children,c,r),Lo(e,c),e.tagName==="template"&&e.content&&(c.content=F8(e.content,r)),c}function Y8(e,t,n){const r=gc(e,t);if(n===!1||n===null||n===void 0||typeof n=="number"&&Number.isNaN(n)||!n&&r.boolean)return;Array.isArray(n)&&(n=r.commaSeparated?Rg(n):Lg(n));const s={name:r.attribute,value:n===!0?"":String(n)};if(r.space&&r.space!=="html"&&r.space!=="svg"){const l=s.name.indexOf(":");l<0?s.prefix="":(s.name=s.name.slice(l+1),s.prefix=r.attribute.slice(0,l)),s.namespace=sl[r.space]}return s}function Zg(e,t,n){let r=-1;const s=[];if(e)for(;++r<e.length;){const l=S3(e[r],n);l.parentNode=t,s.push(l)}return s}function Lo(e,t){const n=e.position;n&&n.start&&n.end&&(n.start.offset,n.end.offset,t.sourceCodeLocation={startLine:n.start.line,startCol:n.start.column,startOffset:n.start.offset,endLine:n.end.line,endCol:n.end.column,endOffset:n.end.offset})}const W8=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),bn="�";var j;(function(e){e[e.EOF=-1]="EOF",e[e.NULL=0]="NULL",e[e.TABULATION=9]="TABULATION",e[e.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",e[e.LINE_FEED=10]="LINE_FEED",e[e.FORM_FEED=12]="FORM_FEED",e[e.SPACE=32]="SPACE",e[e.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",e[e.QUOTATION_MARK=34]="QUOTATION_MARK",e[e.AMPERSAND=38]="AMPERSAND",e[e.APOSTROPHE=39]="APOSTROPHE",e[e.HYPHEN_MINUS=45]="HYPHEN_MINUS",e[e.SOLIDUS=47]="SOLIDUS",e[e.DIGIT_0=48]="DIGIT_0",e[e.DIGIT_9=57]="DIGIT_9",e[e.SEMICOLON=59]="SEMICOLON",e[e.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",e[e.EQUALS_SIGN=61]="EQUALS_SIGN",e[e.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",e[e.QUESTION_MARK=63]="QUESTION_MARK",e[e.LATIN_CAPITAL_A=65]="LATIN_CAPITAL_A",e[e.LATIN_CAPITAL_Z=90]="LATIN_CAPITAL_Z",e[e.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",e[e.GRAVE_ACCENT=96]="GRAVE_ACCENT",e[e.LATIN_SMALL_A=97]="LATIN_SMALL_A",e[e.LATIN_SMALL_Z=122]="LATIN_SMALL_Z"})(j||(j={}));const vr={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function A3(e){return e>=55296&&e<=57343}function Q8(e){return e>=56320&&e<=57343}function X8(e,t){return(e-55296)*1024+9216+t}function N3(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function R3(e){return e>=64976&&e<=65007||W8.has(e)}var he;(function(e){e.controlCharacterInInputStream="control-character-in-input-stream",e.noncharacterInInputStream="noncharacter-in-input-stream",e.surrogateInInputStream="surrogate-in-input-stream",e.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",e.endTagWithAttributes="end-tag-with-attributes",e.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",e.unexpectedSolidusInTag="unexpected-solidus-in-tag",e.unexpectedNullCharacter="unexpected-null-character",e.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",e.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",e.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",e.missingEndTagName="missing-end-tag-name",e.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",e.unknownNamedCharacterReference="unknown-named-character-reference",e.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",e.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",e.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",e.eofBeforeTagName="eof-before-tag-name",e.eofInTag="eof-in-tag",e.missingAttributeValue="missing-attribute-value",e.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",e.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",e.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",e.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",e.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",e.missingDoctypePublicIdentifier="missing-doctype-public-identifier",e.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",e.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",e.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",e.cdataInHtmlContent="cdata-in-html-content",e.incorrectlyOpenedComment="incorrectly-opened-comment",e.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",e.eofInDoctype="eof-in-doctype",e.nestedComment="nested-comment",e.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",e.eofInComment="eof-in-comment",e.incorrectlyClosedComment="incorrectly-closed-comment",e.eofInCdata="eof-in-cdata",e.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",e.nullCharacterReference="null-character-reference",e.surrogateCharacterReference="surrogate-character-reference",e.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",e.controlCharacterReference="control-character-reference",e.noncharacterCharacterReference="noncharacter-character-reference",e.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",e.missingDoctypeName="missing-doctype-name",e.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",e.duplicateAttribute="duplicate-attribute",e.nonConformingDoctype="non-conforming-doctype",e.missingDoctype="missing-doctype",e.misplacedDoctype="misplaced-doctype",e.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",e.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",e.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",e.openElementsLeftAfterEof="open-elements-left-after-eof",e.abandonedHeadElementChild="abandoned-head-element-child",e.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",e.nestedNoscriptInHead="nested-noscript-in-head",e.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(he||(he={}));const K8=65536;class Z8{constructor(t){this.handler=t,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=K8,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(t,n){const{line:r,col:s,offset:l}=this,o=s+n,c=l+n;return{code:t,startLine:r,endLine:r,startCol:o,endCol:o,startOffset:c,endOffset:c}}_err(t){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(t,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(t){if(this.pos!==this.html.length-1){const n=this.html.charCodeAt(this.pos+1);if(Q8(n))return this.pos++,this._addGap(),X8(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,j.EOF;return this._err(he.surrogateInInputStream),t}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(t,n){this.html.length>0?this.html+=t:this.html=t,this.endOfChunkHit=!1,this.lastChunkWritten=n}insertHtmlAtCurrentPos(t){this.html=this.html.substring(0,this.pos+1)+t+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(t,n){if(this.pos+t.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(n)return this.html.startsWith(t,this.pos);for(let r=0;r<t.length;r++)if((this.html.charCodeAt(this.pos+r)|32)!==t.charCodeAt(r))return!1;return!0}peek(t){const n=this.pos+t;if(n>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,j.EOF;const r=this.html.charCodeAt(n);return r===j.CARRIAGE_RETURN?j.LINE_FEED:r}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,j.EOF;let t=this.html.charCodeAt(this.pos);return t===j.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,j.LINE_FEED):t===j.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,A3(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===j.LINE_FEED||t===j.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){N3(t)?this._err(he.controlCharacterInInputStream):R3(t)&&this._err(he.noncharacterInInputStream)}retreat(t){for(this.pos-=t;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var Lt;(function(e){e[e.CHARACTER=0]="CHARACTER",e[e.NULL_CHARACTER=1]="NULL_CHARACTER",e[e.WHITESPACE_CHARACTER=2]="WHITESPACE_CHARACTER",e[e.START_TAG=3]="START_TAG",e[e.END_TAG=4]="END_TAG",e[e.COMMENT=5]="COMMENT",e[e.DOCTYPE=6]="DOCTYPE",e[e.EOF=7]="EOF",e[e.HIBERNATION=8]="HIBERNATION"})(Lt||(Lt={}));function L3(e,t){for(let n=e.attrs.length-1;n>=0;n--)if(e.attrs[n].name===t)return e.attrs[n].value;return null}const J8=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏઑඡ༉༦ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲϏϢϸontourIntegraìȹoɴ\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲy;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱còJTabcdfgorstרׯؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ߂ߐĀiyޱrc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣসে্ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४ĀnrࢃgleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpwਖਛgȀLRlr৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼અઋp;椅y;䐜Ādl੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑඞcy;䐊cute;䅃ƀaeyહાron;䅇dil;䅅;䐝ƀgswે૰ativeƀMTV૨ediumSpace;怋hiĀcn૦ëeryThiîtedĀGLଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷreak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪௫ఄ಄ದൡඅ櫬Āoungruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater;EFGLSTஶஷ扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨setĀ;Eೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂෛ෧ขภยา฿ไlig;䅒cute耻Ó䃓Āiyීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲcr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬืde耻Õ䃕es;樷ml耻Ö䃖erĀBP๋Āar๐๓r;怾acĀek๚;揞et;掴arenthesis;揜ҀacfhilorsງຊຏຒດຝະrtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ檻cedesȀ;EST່້扺qual;檯lantEqual;扼ilde;找me;怳Ādpuct;戏ortionĀ;aȥl;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL憒ar;懥eftArrow;懄eiling;按oǵ\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄቕቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHcቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗ĀeiቻDzኀ\0ኇefore;戴a;䎘ĀcnኘkSpace;쀀 Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtèa;䎖r;愨pf;愤cr;쀀𝒵ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒;Eaeiopᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;eᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;eᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰᝃᝈ០៦ᠹᡐᜍ᥈ᥰot;櫭ĀcrᛶkȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;tbrk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯᝳ;䎲;愶een;扬r;쀀𝔟gcostuvwឍឝឳេ៕៛ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀakoᠦᠵĀcn៲ᠣkƀlst֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ;敛;敘;攘;攔;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģbar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;elƀ;bhᥨᥩᥫ䁜;槅sub;柈ŬᥴlĀ;e怢t»pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭒\0᯽\0ᰌƀcprᦲute;䄇̀;abcdsᦿᧀᧄ᧕᧙戩nd;橄rcup;橉Āau᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r;Ecefms᩠ᩢᩫ᪤᪪旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ\0\0aĀ;t䀬;䁀ƀ;fl戁îᅠeĀmxent»eóɍǧ\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯delprvw᭠᭬᭷ᮂᮬᯔarrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;pᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰻᰿ᱝᱩᱵᲞᲬᲷᴍᵻᶑᶫᶻ᷆᷍ròar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂᳖᳜᳠mƀ;oș᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄĀDoḆᴴoôĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»ṺƀaeiἒἚls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧\0耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₥₰₴⃰℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽ƀ;qsؾٌlanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqrⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0proør;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼ròòΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonóquigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roøurĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨íistĀ;sடr;쀀𝔫ȀEest⩦⩹⩼ƀ;qs⩭ƀ;qs⩴lanôií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast⭕⭚⭟lleìl;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖchimpqu⮽⯍⯙⬄⯤⯯Ȁ;cerല⯆ഷ⯉uå;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭ååഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñĀ;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;cⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācrir;榿;쀀𝔬ͯ\0\0\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕⶥⶨrò᪀Āirⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔǒr;榷rp;榹;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ\0\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ脀¶;l䂶leìЃɩ\0\0m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳ᤈ⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t⾴ïrel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⋢⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔ABHabcdefhilmnoprstuxけさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstwガクシスゼゾダッデナp;極Ā;fゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ìâヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘rrowĀ;tㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowóarpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓ròaòՑ;怏oustĀ;a㈞掱che»mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì耻䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;qኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫwar;椪lig耻ß䃟㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rëƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproøim»ኬsðኞĀas㚺㚮ðrn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈadempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xôheadĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roðtré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜtré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),eD=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function tD(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=eD.get(e))!==null&&t!==void 0?t:e}var Qn;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(Qn||(Qn={}));const nD=32;var ys;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(ys||(ys={}));function $0(e){return e>=Qn.ZERO&&e<=Qn.NINE}function rD(e){return e>=Qn.UPPER_A&&e<=Qn.UPPER_F||e>=Qn.LOWER_A&&e<=Qn.LOWER_F}function aD(e){return e>=Qn.UPPER_A&&e<=Qn.UPPER_Z||e>=Qn.LOWER_A&&e<=Qn.LOWER_Z||$0(e)}function iD(e){return e===Qn.EQUALS||aD(e)}var qn;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(qn||(qn={}));var Ti;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(Ti||(Ti={}));class sD{constructor(t,n,r){this.decodeTree=t,this.emitCodePoint=n,this.errors=r,this.state=qn.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Ti.Strict}startEntity(t){this.decodeMode=t,this.state=qn.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case qn.EntityStart:return t.charCodeAt(n)===Qn.NUM?(this.state=qn.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=qn.NamedEntity,this.stateNamedEntity(t,n));case qn.NumericStart:return this.stateNumericStart(t,n);case qn.NumericDecimal:return this.stateNumericDecimal(t,n);case qn.NumericHex:return this.stateNumericHex(t,n);case qn.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|nD)===Qn.LOWER_X?(this.state=qn.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=qn.NumericDecimal,this.stateNumericDecimal(t,n))}addToNumericResult(t,n,r,s){if(n!==r){const l=r-n;this.result=this.result*Math.pow(s,l)+Number.parseInt(t.substr(n,l),s),this.consumed+=l}}stateNumericHex(t,n){const r=n;for(;n<t.length;){const s=t.charCodeAt(n);if($0(s)||rD(s))n+=1;else return this.addToNumericResult(t,r,n,16),this.emitNumericEntity(s,3)}return this.addToNumericResult(t,r,n,16),-1}stateNumericDecimal(t,n){const r=n;for(;n<t.length;){const s=t.charCodeAt(n);if($0(s))n+=1;else return this.addToNumericResult(t,r,n,10),this.emitNumericEntity(s,2)}return this.addToNumericResult(t,r,n,10),-1}emitNumericEntity(t,n){var r;if(this.consumed<=n)return(r=this.errors)===null||r===void 0||r.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(t===Qn.SEMI)this.consumed+=1;else if(this.decodeMode===Ti.Strict)return 0;return this.emitCodePoint(tD(this.result),this.consumed),this.errors&&(t!==Qn.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,n){const{decodeTree:r}=this;let s=r[this.treeIndex],l=(s&ys.VALUE_LENGTH)>>14;for(;n<t.length;n++,this.excess++){const o=t.charCodeAt(n);if(this.treeIndex=lD(r,s,this.treeIndex+Math.max(1,l),o),this.treeIndex<0)return this.result===0||this.decodeMode===Ti.Attribute&&(l===0||iD(o))?0:this.emitNotTerminatedNamedEntity();if(s=r[this.treeIndex],l=(s&ys.VALUE_LENGTH)>>14,l!==0){if(o===Qn.SEMI)return this.emitNamedEntityData(this.treeIndex,l,this.consumed+this.excess);this.decodeMode!==Ti.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:n,decodeTree:r}=this,s=(r[n]&ys.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,s,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,r){const{decodeTree:s}=this;return this.emitCodePoint(n===1?s[t]&~ys.VALUE_LENGTH:s[t+1],r),n===3&&this.emitCodePoint(s[t+2],r),r}end(){var t;switch(this.state){case qn.NamedEntity:return this.result!==0&&(this.decodeMode!==Ti.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case qn.NumericDecimal:return this.emitNumericEntity(0,2);case qn.NumericHex:return this.emitNumericEntity(0,3);case qn.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case qn.EntityStart:return 0}}}function lD(e,t,n,r){const s=(t&ys.BRANCH_LENGTH)>>7,l=t&ys.JUMP_TABLE;if(s===0)return l!==0&&r===l?n:-1;if(l){const d=r-l;return d<0||d>=s?-1:e[n+d]-1}let o=n,c=o+s-1;for(;o<=c;){const d=o+c>>>1,m=e[d];if(m<r)o=d+1;else if(m>r)c=d-1;else return e[d+s]}return-1}var Se;(function(e){e.HTML="http://www.w3.org/1999/xhtml",e.MATHML="http://www.w3.org/1998/Math/MathML",e.SVG="http://www.w3.org/2000/svg",e.XLINK="http://www.w3.org/1999/xlink",e.XML="http://www.w3.org/XML/1998/namespace",e.XMLNS="http://www.w3.org/2000/xmlns/"})(Se||(Se={}));var ul;(function(e){e.TYPE="type",e.ACTION="action",e.ENCODING="encoding",e.PROMPT="prompt",e.NAME="name",e.COLOR="color",e.FACE="face",e.SIZE="size"})(ul||(ul={}));var Jr;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(Jr||(Jr={}));var te;(function(e){e.A="a",e.ADDRESS="address",e.ANNOTATION_XML="annotation-xml",e.APPLET="applet",e.AREA="area",e.ARTICLE="article",e.ASIDE="aside",e.B="b",e.BASE="base",e.BASEFONT="basefont",e.BGSOUND="bgsound",e.BIG="big",e.BLOCKQUOTE="blockquote",e.BODY="body",e.BR="br",e.BUTTON="button",e.CAPTION="caption",e.CENTER="center",e.CODE="code",e.COL="col",e.COLGROUP="colgroup",e.DD="dd",e.DESC="desc",e.DETAILS="details",e.DIALOG="dialog",e.DIR="dir",e.DIV="div",e.DL="dl",e.DT="dt",e.EM="em",e.EMBED="embed",e.FIELDSET="fieldset",e.FIGCAPTION="figcaption",e.FIGURE="figure",e.FONT="font",e.FOOTER="footer",e.FOREIGN_OBJECT="foreignObject",e.FORM="form",e.FRAME="frame",e.FRAMESET="frameset",e.H1="h1",e.H2="h2",e.H3="h3",e.H4="h4",e.H5="h5",e.H6="h6",e.HEAD="head",e.HEADER="header",e.HGROUP="hgroup",e.HR="hr",e.HTML="html",e.I="i",e.IMG="img",e.IMAGE="image",e.INPUT="input",e.IFRAME="iframe",e.KEYGEN="keygen",e.LABEL="label",e.LI="li",e.LINK="link",e.LISTING="listing",e.MAIN="main",e.MALIGNMARK="malignmark",e.MARQUEE="marquee",e.MATH="math",e.MENU="menu",e.META="meta",e.MGLYPH="mglyph",e.MI="mi",e.MO="mo",e.MN="mn",e.MS="ms",e.MTEXT="mtext",e.NAV="nav",e.NOBR="nobr",e.NOFRAMES="noframes",e.NOEMBED="noembed",e.NOSCRIPT="noscript",e.OBJECT="object",e.OL="ol",e.OPTGROUP="optgroup",e.OPTION="option",e.P="p",e.PARAM="param",e.PLAINTEXT="plaintext",e.PRE="pre",e.RB="rb",e.RP="rp",e.RT="rt",e.RTC="rtc",e.RUBY="ruby",e.S="s",e.SCRIPT="script",e.SEARCH="search",e.SECTION="section",e.SELECT="select",e.SOURCE="source",e.SMALL="small",e.SPAN="span",e.STRIKE="strike",e.STRONG="strong",e.STYLE="style",e.SUB="sub",e.SUMMARY="summary",e.SUP="sup",e.TABLE="table",e.TBODY="tbody",e.TEMPLATE="template",e.TEXTAREA="textarea",e.TFOOT="tfoot",e.TD="td",e.TH="th",e.THEAD="thead",e.TITLE="title",e.TR="tr",e.TRACK="track",e.TT="tt",e.U="u",e.UL="ul",e.SVG="svg",e.VAR="var",e.WBR="wbr",e.XMP="xmp"})(te||(te={}));var _;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.A=1]="A",e[e.ADDRESS=2]="ADDRESS",e[e.ANNOTATION_XML=3]="ANNOTATION_XML",e[e.APPLET=4]="APPLET",e[e.AREA=5]="AREA",e[e.ARTICLE=6]="ARTICLE",e[e.ASIDE=7]="ASIDE",e[e.B=8]="B",e[e.BASE=9]="BASE",e[e.BASEFONT=10]="BASEFONT",e[e.BGSOUND=11]="BGSOUND",e[e.BIG=12]="BIG",e[e.BLOCKQUOTE=13]="BLOCKQUOTE",e[e.BODY=14]="BODY",e[e.BR=15]="BR",e[e.BUTTON=16]="BUTTON",e[e.CAPTION=17]="CAPTION",e[e.CENTER=18]="CENTER",e[e.CODE=19]="CODE",e[e.COL=20]="COL",e[e.COLGROUP=21]="COLGROUP",e[e.DD=22]="DD",e[e.DESC=23]="DESC",e[e.DETAILS=24]="DETAILS",e[e.DIALOG=25]="DIALOG",e[e.DIR=26]="DIR",e[e.DIV=27]="DIV",e[e.DL=28]="DL",e[e.DT=29]="DT",e[e.EM=30]="EM",e[e.EMBED=31]="EMBED",e[e.FIELDSET=32]="FIELDSET",e[e.FIGCAPTION=33]="FIGCAPTION",e[e.FIGURE=34]="FIGURE",e[e.FONT=35]="FONT",e[e.FOOTER=36]="FOOTER",e[e.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",e[e.FORM=38]="FORM",e[e.FRAME=39]="FRAME",e[e.FRAMESET=40]="FRAMESET",e[e.H1=41]="H1",e[e.H2=42]="H2",e[e.H3=43]="H3",e[e.H4=44]="H4",e[e.H5=45]="H5",e[e.H6=46]="H6",e[e.HEAD=47]="HEAD",e[e.HEADER=48]="HEADER",e[e.HGROUP=49]="HGROUP",e[e.HR=50]="HR",e[e.HTML=51]="HTML",e[e.I=52]="I",e[e.IMG=53]="IMG",e[e.IMAGE=54]="IMAGE",e[e.INPUT=55]="INPUT",e[e.IFRAME=56]="IFRAME",e[e.KEYGEN=57]="KEYGEN",e[e.LABEL=58]="LABEL",e[e.LI=59]="LI",e[e.LINK=60]="LINK",e[e.LISTING=61]="LISTING",e[e.MAIN=62]="MAIN",e[e.MALIGNMARK=63]="MALIGNMARK",e[e.MARQUEE=64]="MARQUEE",e[e.MATH=65]="MATH",e[e.MENU=66]="MENU",e[e.META=67]="META",e[e.MGLYPH=68]="MGLYPH",e[e.MI=69]="MI",e[e.MO=70]="MO",e[e.MN=71]="MN",e[e.MS=72]="MS",e[e.MTEXT=73]="MTEXT",e[e.NAV=74]="NAV",e[e.NOBR=75]="NOBR",e[e.NOFRAMES=76]="NOFRAMES",e[e.NOEMBED=77]="NOEMBED",e[e.NOSCRIPT=78]="NOSCRIPT",e[e.OBJECT=79]="OBJECT",e[e.OL=80]="OL",e[e.OPTGROUP=81]="OPTGROUP",e[e.OPTION=82]="OPTION",e[e.P=83]="P",e[e.PARAM=84]="PARAM",e[e.PLAINTEXT=85]="PLAINTEXT",e[e.PRE=86]="PRE",e[e.RB=87]="RB",e[e.RP=88]="RP",e[e.RT=89]="RT",e[e.RTC=90]="RTC",e[e.RUBY=91]="RUBY",e[e.S=92]="S",e[e.SCRIPT=93]="SCRIPT",e[e.SEARCH=94]="SEARCH",e[e.SECTION=95]="SECTION",e[e.SELECT=96]="SELECT",e[e.SOURCE=97]="SOURCE",e[e.SMALL=98]="SMALL",e[e.SPAN=99]="SPAN",e[e.STRIKE=100]="STRIKE",e[e.STRONG=101]="STRONG",e[e.STYLE=102]="STYLE",e[e.SUB=103]="SUB",e[e.SUMMARY=104]="SUMMARY",e[e.SUP=105]="SUP",e[e.TABLE=106]="TABLE",e[e.TBODY=107]="TBODY",e[e.TEMPLATE=108]="TEMPLATE",e[e.TEXTAREA=109]="TEXTAREA",e[e.TFOOT=110]="TFOOT",e[e.TD=111]="TD",e[e.TH=112]="TH",e[e.THEAD=113]="THEAD",e[e.TITLE=114]="TITLE",e[e.TR=115]="TR",e[e.TRACK=116]="TRACK",e[e.TT=117]="TT",e[e.U=118]="U",e[e.UL=119]="UL",e[e.SVG=120]="SVG",e[e.VAR=121]="VAR",e[e.WBR=122]="WBR",e[e.XMP=123]="XMP"})(_||(_={}));const oD=new Map([[te.A,_.A],[te.ADDRESS,_.ADDRESS],[te.ANNOTATION_XML,_.ANNOTATION_XML],[te.APPLET,_.APPLET],[te.AREA,_.AREA],[te.ARTICLE,_.ARTICLE],[te.ASIDE,_.ASIDE],[te.B,_.B],[te.BASE,_.BASE],[te.BASEFONT,_.BASEFONT],[te.BGSOUND,_.BGSOUND],[te.BIG,_.BIG],[te.BLOCKQUOTE,_.BLOCKQUOTE],[te.BODY,_.BODY],[te.BR,_.BR],[te.BUTTON,_.BUTTON],[te.CAPTION,_.CAPTION],[te.CENTER,_.CENTER],[te.CODE,_.CODE],[te.COL,_.COL],[te.COLGROUP,_.COLGROUP],[te.DD,_.DD],[te.DESC,_.DESC],[te.DETAILS,_.DETAILS],[te.DIALOG,_.DIALOG],[te.DIR,_.DIR],[te.DIV,_.DIV],[te.DL,_.DL],[te.DT,_.DT],[te.EM,_.EM],[te.EMBED,_.EMBED],[te.FIELDSET,_.FIELDSET],[te.FIGCAPTION,_.FIGCAPTION],[te.FIGURE,_.FIGURE],[te.FONT,_.FONT],[te.FOOTER,_.FOOTER],[te.FOREIGN_OBJECT,_.FOREIGN_OBJECT],[te.FORM,_.FORM],[te.FRAME,_.FRAME],[te.FRAMESET,_.FRAMESET],[te.H1,_.H1],[te.H2,_.H2],[te.H3,_.H3],[te.H4,_.H4],[te.H5,_.H5],[te.H6,_.H6],[te.HEAD,_.HEAD],[te.HEADER,_.HEADER],[te.HGROUP,_.HGROUP],[te.HR,_.HR],[te.HTML,_.HTML],[te.I,_.I],[te.IMG,_.IMG],[te.IMAGE,_.IMAGE],[te.INPUT,_.INPUT],[te.IFRAME,_.IFRAME],[te.KEYGEN,_.KEYGEN],[te.LABEL,_.LABEL],[te.LI,_.LI],[te.LINK,_.LINK],[te.LISTING,_.LISTING],[te.MAIN,_.MAIN],[te.MALIGNMARK,_.MALIGNMARK],[te.MARQUEE,_.MARQUEE],[te.MATH,_.MATH],[te.MENU,_.MENU],[te.META,_.META],[te.MGLYPH,_.MGLYPH],[te.MI,_.MI],[te.MO,_.MO],[te.MN,_.MN],[te.MS,_.MS],[te.MTEXT,_.MTEXT],[te.NAV,_.NAV],[te.NOBR,_.NOBR],[te.NOFRAMES,_.NOFRAMES],[te.NOEMBED,_.NOEMBED],[te.NOSCRIPT,_.NOSCRIPT],[te.OBJECT,_.OBJECT],[te.OL,_.OL],[te.OPTGROUP,_.OPTGROUP],[te.OPTION,_.OPTION],[te.P,_.P],[te.PARAM,_.PARAM],[te.PLAINTEXT,_.PLAINTEXT],[te.PRE,_.PRE],[te.RB,_.RB],[te.RP,_.RP],[te.RT,_.RT],[te.RTC,_.RTC],[te.RUBY,_.RUBY],[te.S,_.S],[te.SCRIPT,_.SCRIPT],[te.SEARCH,_.SEARCH],[te.SECTION,_.SECTION],[te.SELECT,_.SELECT],[te.SOURCE,_.SOURCE],[te.SMALL,_.SMALL],[te.SPAN,_.SPAN],[te.STRIKE,_.STRIKE],[te.STRONG,_.STRONG],[te.STYLE,_.STYLE],[te.SUB,_.SUB],[te.SUMMARY,_.SUMMARY],[te.SUP,_.SUP],[te.TABLE,_.TABLE],[te.TBODY,_.TBODY],[te.TEMPLATE,_.TEMPLATE],[te.TEXTAREA,_.TEXTAREA],[te.TFOOT,_.TFOOT],[te.TD,_.TD],[te.TH,_.TH],[te.THEAD,_.THEAD],[te.TITLE,_.TITLE],[te.TR,_.TR],[te.TRACK,_.TRACK],[te.TT,_.TT],[te.U,_.U],[te.UL,_.UL],[te.SVG,_.SVG],[te.VAR,_.VAR],[te.WBR,_.WBR],[te.XMP,_.XMP]]);function Io(e){var t;return(t=oD.get(e))!==null&&t!==void 0?t:_.UNKNOWN}const Ne=_,uD={[Se.HTML]:new Set([Ne.ADDRESS,Ne.APPLET,Ne.AREA,Ne.ARTICLE,Ne.ASIDE,Ne.BASE,Ne.BASEFONT,Ne.BGSOUND,Ne.BLOCKQUOTE,Ne.BODY,Ne.BR,Ne.BUTTON,Ne.CAPTION,Ne.CENTER,Ne.COL,Ne.COLGROUP,Ne.DD,Ne.DETAILS,Ne.DIR,Ne.DIV,Ne.DL,Ne.DT,Ne.EMBED,Ne.FIELDSET,Ne.FIGCAPTION,Ne.FIGURE,Ne.FOOTER,Ne.FORM,Ne.FRAME,Ne.FRAMESET,Ne.H1,Ne.H2,Ne.H3,Ne.H4,Ne.H5,Ne.H6,Ne.HEAD,Ne.HEADER,Ne.HGROUP,Ne.HR,Ne.HTML,Ne.IFRAME,Ne.IMG,Ne.INPUT,Ne.LI,Ne.LINK,Ne.LISTING,Ne.MAIN,Ne.MARQUEE,Ne.MENU,Ne.META,Ne.NAV,Ne.NOEMBED,Ne.NOFRAMES,Ne.NOSCRIPT,Ne.OBJECT,Ne.OL,Ne.P,Ne.PARAM,Ne.PLAINTEXT,Ne.PRE,Ne.SCRIPT,Ne.SECTION,Ne.SELECT,Ne.SOURCE,Ne.STYLE,Ne.SUMMARY,Ne.TABLE,Ne.TBODY,Ne.TD,Ne.TEMPLATE,Ne.TEXTAREA,Ne.TFOOT,Ne.TH,Ne.THEAD,Ne.TITLE,Ne.TR,Ne.TRACK,Ne.UL,Ne.WBR,Ne.XMP]),[Se.MATHML]:new Set([Ne.MI,Ne.MO,Ne.MN,Ne.MS,Ne.MTEXT,Ne.ANNOTATION_XML]),[Se.SVG]:new Set([Ne.TITLE,Ne.FOREIGN_OBJECT,Ne.DESC]),[Se.XLINK]:new Set,[Se.XML]:new Set,[Se.XMLNS]:new Set},V0=new Set([Ne.H1,Ne.H2,Ne.H3,Ne.H4,Ne.H5,Ne.H6]);te.STYLE,te.SCRIPT,te.XMP,te.IFRAME,te.NOEMBED,te.NOFRAMES,te.PLAINTEXT;var B;(function(e){e[e.DATA=0]="DATA",e[e.RCDATA=1]="RCDATA",e[e.RAWTEXT=2]="RAWTEXT",e[e.SCRIPT_DATA=3]="SCRIPT_DATA",e[e.PLAINTEXT=4]="PLAINTEXT",e[e.TAG_OPEN=5]="TAG_OPEN",e[e.END_TAG_OPEN=6]="END_TAG_OPEN",e[e.TAG_NAME=7]="TAG_NAME",e[e.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",e[e.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",e[e.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",e[e.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",e[e.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",e[e.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",e[e.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",e[e.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",e[e.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",e[e.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",e[e.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",e[e.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",e[e.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",e[e.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",e[e.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",e[e.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",e[e.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",e[e.BOGUS_COMMENT=40]="BOGUS_COMMENT",e[e.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",e[e.COMMENT_START=42]="COMMENT_START",e[e.COMMENT_START_DASH=43]="COMMENT_START_DASH",e[e.COMMENT=44]="COMMENT",e[e.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",e[e.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",e[e.COMMENT_END_DASH=49]="COMMENT_END_DASH",e[e.COMMENT_END=50]="COMMENT_END",e[e.COMMENT_END_BANG=51]="COMMENT_END_BANG",e[e.DOCTYPE=52]="DOCTYPE",e[e.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",e[e.DOCTYPE_NAME=54]="DOCTYPE_NAME",e[e.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",e[e.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",e[e.CDATA_SECTION=68]="CDATA_SECTION",e[e.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",e[e.CDATA_SECTION_END=70]="CDATA_SECTION_END",e[e.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",e[e.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})(B||(B={}));const Sn={DATA:B.DATA,RCDATA:B.RCDATA,RAWTEXT:B.RAWTEXT,SCRIPT_DATA:B.SCRIPT_DATA,PLAINTEXT:B.PLAINTEXT,CDATA_SECTION:B.CDATA_SECTION};function cD(e){return e>=j.DIGIT_0&&e<=j.DIGIT_9}function Bu(e){return e>=j.LATIN_CAPITAL_A&&e<=j.LATIN_CAPITAL_Z}function dD(e){return e>=j.LATIN_SMALL_A&&e<=j.LATIN_SMALL_Z}function ms(e){return dD(e)||Bu(e)}function F2(e){return ms(e)||cD(e)}function Bd(e){return e+32}function I3(e){return e===j.SPACE||e===j.LINE_FEED||e===j.TABULATION||e===j.FORM_FEED}function $2(e){return I3(e)||e===j.SOLIDUS||e===j.GREATER_THAN_SIGN}function fD(e){return e===j.NULL?he.nullCharacterReference:e>1114111?he.characterReferenceOutsideUnicodeRange:A3(e)?he.surrogateCharacterReference:R3(e)?he.noncharacterCharacterReference:N3(e)||e===j.CARRIAGE_RETURN?he.controlCharacterReference:null}class hD{constructor(t,n){this.options=t,this.handler=n,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=B.DATA,this.returnState=B.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new Z8(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new sD(J8,(r,s)=>{this.preprocessor.pos=this.entityStartPos+s-1,this._flushCodePointConsumedAsCharacterReference(r)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(he.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(he.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{const s=fD(r);s&&this._err(s,1)}}:void 0)}_err(t,n=0){var r,s;(s=(r=this.handler).onParseError)===null||s===void 0||s.call(r,this.preprocessor.getError(t,n))}getCurrentLocation(t){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-t,startOffset:this.preprocessor.offset-t,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const t=this._consume();this._ensureHibernation()||this._callState(t)}this.inLoop=!1}}pause(){this.paused=!0}resume(t){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||t==null||t())}write(t,n,r){this.active=!0,this.preprocessor.write(t,n),this._runParsingLoop(),this.paused||r==null||r()}insertHtmlAtCurrentPos(t){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(t),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(t){this.consumedAfterSnapshot+=t;for(let n=0;n<t;n++)this.preprocessor.advance()}_consumeSequenceIfMatch(t,n){return this.preprocessor.startsWith(t,n)?(this._advanceBy(t.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:Lt.START_TAG,tagName:"",tagID:_.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:Lt.END_TAG,tagName:"",tagID:_.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(t){this.currentToken={type:Lt.COMMENT,data:"",location:this.getCurrentLocation(t)}}_createDoctypeToken(t){this.currentToken={type:Lt.DOCTYPE,name:t,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(t,n){this.currentCharacterToken={type:t,chars:n,location:this.currentLocation}}_createAttr(t){this.currentAttr={name:t,value:""},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var t,n;const r=this.currentToken;if(L3(r,this.currentAttr.name)===null){if(r.attrs.push(this.currentAttr),r.location&&this.currentLocation){const s=(t=(n=r.location).attrs)!==null&&t!==void 0?t:n.attrs=Object.create(null);s[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(he.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(t){this._emitCurrentCharacterToken(t.location),this.currentToken=null,t.location&&(t.location.endLine=this.preprocessor.line,t.location.endCol=this.preprocessor.col+1,t.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){const t=this.currentToken;this.prepareToken(t),t.tagID=Io(t.tagName),t.type===Lt.START_TAG?(this.lastStartTagName=t.tagName,this.handler.onStartTag(t)):(t.attrs.length>0&&this._err(he.endTagWithAttributes),t.selfClosing&&this._err(he.endTagWithTrailingSolidus),this.handler.onEndTag(t)),this.preprocessor.dropParsedChunk()}emitCurrentComment(t){this.prepareToken(t),this.handler.onComment(t),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(t){this.prepareToken(t),this.handler.onDoctype(t),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(t){if(this.currentCharacterToken){switch(t&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=t.startLine,this.currentCharacterToken.location.endCol=t.startCol,this.currentCharacterToken.location.endOffset=t.startOffset),this.currentCharacterToken.type){case Lt.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case Lt.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case Lt.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const t=this.getCurrentLocation(0);t&&(t.endLine=t.startLine,t.endCol=t.startCol,t.endOffset=t.startOffset),this._emitCurrentCharacterToken(t),this.handler.onEof({type:Lt.EOF,location:t}),this.active=!1}_appendCharToCurrentCharacterToken(t,n){if(this.currentCharacterToken)if(this.currentCharacterToken.type===t){this.currentCharacterToken.chars+=n;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(t,n)}_emitCodePoint(t){const n=I3(t)?Lt.WHITESPACE_CHARACTER:t===j.NULL?Lt.NULL_CHARACTER:Lt.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(Lt.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=B.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?Ti.Attribute:Ti.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===B.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===B.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===B.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case B.DATA:{this._stateData(t);break}case B.RCDATA:{this._stateRcdata(t);break}case B.RAWTEXT:{this._stateRawtext(t);break}case B.SCRIPT_DATA:{this._stateScriptData(t);break}case B.PLAINTEXT:{this._statePlaintext(t);break}case B.TAG_OPEN:{this._stateTagOpen(t);break}case B.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case B.TAG_NAME:{this._stateTagName(t);break}case B.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case B.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case B.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case B.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case B.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case B.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case B.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case B.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case B.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case B.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case B.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case B.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case B.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case B.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case B.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case B.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case B.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case B.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case B.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case B.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case B.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case B.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case B.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case B.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case B.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case B.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case B.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case B.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case B.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case B.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case B.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case B.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case B.BOGUS_COMMENT:{this._stateBogusComment(t);break}case B.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case B.COMMENT_START:{this._stateCommentStart(t);break}case B.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case B.COMMENT:{this._stateComment(t);break}case B.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case B.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case B.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case B.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case B.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case B.COMMENT_END:{this._stateCommentEnd(t);break}case B.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case B.DOCTYPE:{this._stateDoctype(t);break}case B.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case B.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case B.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case B.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case B.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case B.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case B.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case B.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case B.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case B.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case B.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case B.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case B.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case B.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case B.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case B.CDATA_SECTION:{this._stateCdataSection(t);break}case B.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case B.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case B.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case B.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case j.LESS_THAN_SIGN:{this.state=B.TAG_OPEN;break}case j.AMPERSAND:{this._startCharacterReference();break}case j.NULL:{this._err(he.unexpectedNullCharacter),this._emitCodePoint(t);break}case j.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case j.AMPERSAND:{this._startCharacterReference();break}case j.LESS_THAN_SIGN:{this.state=B.RCDATA_LESS_THAN_SIGN;break}case j.NULL:{this._err(he.unexpectedNullCharacter),this._emitChars(bn);break}case j.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case j.LESS_THAN_SIGN:{this.state=B.RAWTEXT_LESS_THAN_SIGN;break}case j.NULL:{this._err(he.unexpectedNullCharacter),this._emitChars(bn);break}case j.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case j.LESS_THAN_SIGN:{this.state=B.SCRIPT_DATA_LESS_THAN_SIGN;break}case j.NULL:{this._err(he.unexpectedNullCharacter),this._emitChars(bn);break}case j.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case j.NULL:{this._err(he.unexpectedNullCharacter),this._emitChars(bn);break}case j.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(ms(t))this._createStartTagToken(),this.state=B.TAG_NAME,this._stateTagName(t);else switch(t){case j.EXCLAMATION_MARK:{this.state=B.MARKUP_DECLARATION_OPEN;break}case j.SOLIDUS:{this.state=B.END_TAG_OPEN;break}case j.QUESTION_MARK:{this._err(he.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=B.BOGUS_COMMENT,this._stateBogusComment(t);break}case j.EOF:{this._err(he.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(he.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=B.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(ms(t))this._createEndTagToken(),this.state=B.TAG_NAME,this._stateTagName(t);else switch(t){case j.GREATER_THAN_SIGN:{this._err(he.missingEndTagName),this.state=B.DATA;break}case j.EOF:{this._err(he.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(he.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=B.BOGUS_COMMENT,this._stateBogusComment(t)}}_stateTagName(t){const n=this.currentToken;switch(t){case j.SPACE:case j.LINE_FEED:case j.TABULATION:case j.FORM_FEED:{this.state=B.BEFORE_ATTRIBUTE_NAME;break}case j.SOLIDUS:{this.state=B.SELF_CLOSING_START_TAG;break}case j.GREATER_THAN_SIGN:{this.state=B.DATA,this.emitCurrentTagToken();break}case j.NULL:{this._err(he.unexpectedNullCharacter),n.tagName+=bn;break}case j.EOF:{this._err(he.eofInTag),this._emitEOFToken();break}default:n.tagName+=String.fromCodePoint(Bu(t)?Bd(t):t)}}_stateRcdataLessThanSign(t){t===j.SOLIDUS?this.state=B.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=B.RCDATA,this._stateRcdata(t))}_stateRcdataEndTagOpen(t){ms(t)?(this.state=B.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(t)):(this._emitChars("</"),this.state=B.RCDATA,this._stateRcdata(t))}handleSpecialEndTag(t){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();const n=this.currentToken;switch(n.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case j.SPACE:case j.LINE_FEED:case j.TABULATION:case j.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=B.BEFORE_ATTRIBUTE_NAME,!1;case j.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=B.SELF_CLOSING_START_TAG,!1;case j.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=B.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=B.RCDATA,this._stateRcdata(t))}_stateRawtextLessThanSign(t){t===j.SOLIDUS?this.state=B.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=B.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagOpen(t){ms(t)?(this.state=B.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(t)):(this._emitChars("</"),this.state=B.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=B.RAWTEXT,this._stateRawtext(t))}_stateScriptDataLessThanSign(t){switch(t){case j.SOLIDUS:{this.state=B.SCRIPT_DATA_END_TAG_OPEN;break}case j.EXCLAMATION_MARK:{this.state=B.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=B.SCRIPT_DATA,this._stateScriptData(t)}}_stateScriptDataEndTagOpen(t){ms(t)?(this.state=B.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(t)):(this._emitChars("</"),this.state=B.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=B.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStart(t){t===j.HYPHEN_MINUS?(this.state=B.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=B.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStartDash(t){t===j.HYPHEN_MINUS?(this.state=B.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=B.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscaped(t){switch(t){case j.HYPHEN_MINUS:{this.state=B.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case j.LESS_THAN_SIGN:{this.state=B.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case j.NULL:{this._err(he.unexpectedNullCharacter),this._emitChars(bn);break}case j.EOF:{this._err(he.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataEscapedDash(t){switch(t){case j.HYPHEN_MINUS:{this.state=B.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case j.LESS_THAN_SIGN:{this.state=B.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case j.NULL:{this._err(he.unexpectedNullCharacter),this.state=B.SCRIPT_DATA_ESCAPED,this._emitChars(bn);break}case j.EOF:{this._err(he.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=B.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedDashDash(t){switch(t){case j.HYPHEN_MINUS:{this._emitChars("-");break}case j.LESS_THAN_SIGN:{this.state=B.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case j.GREATER_THAN_SIGN:{this.state=B.SCRIPT_DATA,this._emitChars(">");break}case j.NULL:{this._err(he.unexpectedNullCharacter),this.state=B.SCRIPT_DATA_ESCAPED,this._emitChars(bn);break}case j.EOF:{this._err(he.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=B.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===j.SOLIDUS?this.state=B.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:ms(t)?(this._emitChars("<"),this.state=B.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=B.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){ms(t)?(this.state=B.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("</"),this.state=B.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=B.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscapeStart(t){if(this.preprocessor.startsWith(vr.SCRIPT,!1)&&$2(this.preprocessor.peek(vr.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<vr.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=B.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=B.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscaped(t){switch(t){case j.HYPHEN_MINUS:{this.state=B.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case j.LESS_THAN_SIGN:{this.state=B.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case j.NULL:{this._err(he.unexpectedNullCharacter),this._emitChars(bn);break}case j.EOF:{this._err(he.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDash(t){switch(t){case j.HYPHEN_MINUS:{this.state=B.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case j.LESS_THAN_SIGN:{this.state=B.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case j.NULL:{this._err(he.unexpectedNullCharacter),this.state=B.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(bn);break}case j.EOF:{this._err(he.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=B.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDashDash(t){switch(t){case j.HYPHEN_MINUS:{this._emitChars("-");break}case j.LESS_THAN_SIGN:{this.state=B.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case j.GREATER_THAN_SIGN:{this.state=B.SCRIPT_DATA,this._emitChars(">");break}case j.NULL:{this._err(he.unexpectedNullCharacter),this.state=B.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(bn);break}case j.EOF:{this._err(he.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=B.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===j.SOLIDUS?(this.state=B.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=B.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(vr.SCRIPT,!1)&&$2(this.preprocessor.peek(vr.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<vr.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=B.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=B.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateBeforeAttributeName(t){switch(t){case j.SPACE:case j.LINE_FEED:case j.TABULATION:case j.FORM_FEED:break;case j.SOLIDUS:case j.GREATER_THAN_SIGN:case j.EOF:{this.state=B.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case j.EQUALS_SIGN:{this._err(he.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=B.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=B.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateAttributeName(t){switch(t){case j.SPACE:case j.LINE_FEED:case j.TABULATION:case j.FORM_FEED:case j.SOLIDUS:case j.GREATER_THAN_SIGN:case j.EOF:{this._leaveAttrName(),this.state=B.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case j.EQUALS_SIGN:{this._leaveAttrName(),this.state=B.BEFORE_ATTRIBUTE_VALUE;break}case j.QUOTATION_MARK:case j.APOSTROPHE:case j.LESS_THAN_SIGN:{this._err(he.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(t);break}case j.NULL:{this._err(he.unexpectedNullCharacter),this.currentAttr.name+=bn;break}default:this.currentAttr.name+=String.fromCodePoint(Bu(t)?Bd(t):t)}}_stateAfterAttributeName(t){switch(t){case j.SPACE:case j.LINE_FEED:case j.TABULATION:case j.FORM_FEED:break;case j.SOLIDUS:{this.state=B.SELF_CLOSING_START_TAG;break}case j.EQUALS_SIGN:{this.state=B.BEFORE_ATTRIBUTE_VALUE;break}case j.GREATER_THAN_SIGN:{this.state=B.DATA,this.emitCurrentTagToken();break}case j.EOF:{this._err(he.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=B.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateBeforeAttributeValue(t){switch(t){case j.SPACE:case j.LINE_FEED:case j.TABULATION:case j.FORM_FEED:break;case j.QUOTATION_MARK:{this.state=B.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case j.APOSTROPHE:{this.state=B.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case j.GREATER_THAN_SIGN:{this._err(he.missingAttributeValue),this.state=B.DATA,this.emitCurrentTagToken();break}default:this.state=B.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(t)}}_stateAttributeValueDoubleQuoted(t){switch(t){case j.QUOTATION_MARK:{this.state=B.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case j.AMPERSAND:{this._startCharacterReference();break}case j.NULL:{this._err(he.unexpectedNullCharacter),this.currentAttr.value+=bn;break}case j.EOF:{this._err(he.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueSingleQuoted(t){switch(t){case j.APOSTROPHE:{this.state=B.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case j.AMPERSAND:{this._startCharacterReference();break}case j.NULL:{this._err(he.unexpectedNullCharacter),this.currentAttr.value+=bn;break}case j.EOF:{this._err(he.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueUnquoted(t){switch(t){case j.SPACE:case j.LINE_FEED:case j.TABULATION:case j.FORM_FEED:{this._leaveAttrValue(),this.state=B.BEFORE_ATTRIBUTE_NAME;break}case j.AMPERSAND:{this._startCharacterReference();break}case j.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=B.DATA,this.emitCurrentTagToken();break}case j.NULL:{this._err(he.unexpectedNullCharacter),this.currentAttr.value+=bn;break}case j.QUOTATION_MARK:case j.APOSTROPHE:case j.LESS_THAN_SIGN:case j.EQUALS_SIGN:case j.GRAVE_ACCENT:{this._err(he.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(t);break}case j.EOF:{this._err(he.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAfterAttributeValueQuoted(t){switch(t){case j.SPACE:case j.LINE_FEED:case j.TABULATION:case j.FORM_FEED:{this._leaveAttrValue(),this.state=B.BEFORE_ATTRIBUTE_NAME;break}case j.SOLIDUS:{this._leaveAttrValue(),this.state=B.SELF_CLOSING_START_TAG;break}case j.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=B.DATA,this.emitCurrentTagToken();break}case j.EOF:{this._err(he.eofInTag),this._emitEOFToken();break}default:this._err(he.missingWhitespaceBetweenAttributes),this.state=B.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateSelfClosingStartTag(t){switch(t){case j.GREATER_THAN_SIGN:{const n=this.currentToken;n.selfClosing=!0,this.state=B.DATA,this.emitCurrentTagToken();break}case j.EOF:{this._err(he.eofInTag),this._emitEOFToken();break}default:this._err(he.unexpectedSolidusInTag),this.state=B.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateBogusComment(t){const n=this.currentToken;switch(t){case j.GREATER_THAN_SIGN:{this.state=B.DATA,this.emitCurrentComment(n);break}case j.EOF:{this.emitCurrentComment(n),this._emitEOFToken();break}case j.NULL:{this._err(he.unexpectedNullCharacter),n.data+=bn;break}default:n.data+=String.fromCodePoint(t)}}_stateMarkupDeclarationOpen(t){this._consumeSequenceIfMatch(vr.DASH_DASH,!0)?(this._createCommentToken(vr.DASH_DASH.length+1),this.state=B.COMMENT_START):this._consumeSequenceIfMatch(vr.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(vr.DOCTYPE.length+1),this.state=B.DOCTYPE):this._consumeSequenceIfMatch(vr.CDATA_START,!0)?this.inForeignNode?this.state=B.CDATA_SECTION:(this._err(he.cdataInHtmlContent),this._createCommentToken(vr.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=B.BOGUS_COMMENT):this._ensureHibernation()||(this._err(he.incorrectlyOpenedComment),this._createCommentToken(2),this.state=B.BOGUS_COMMENT,this._stateBogusComment(t))}_stateCommentStart(t){switch(t){case j.HYPHEN_MINUS:{this.state=B.COMMENT_START_DASH;break}case j.GREATER_THAN_SIGN:{this._err(he.abruptClosingOfEmptyComment),this.state=B.DATA;const n=this.currentToken;this.emitCurrentComment(n);break}default:this.state=B.COMMENT,this._stateComment(t)}}_stateCommentStartDash(t){const n=this.currentToken;switch(t){case j.HYPHEN_MINUS:{this.state=B.COMMENT_END;break}case j.GREATER_THAN_SIGN:{this._err(he.abruptClosingOfEmptyComment),this.state=B.DATA,this.emitCurrentComment(n);break}case j.EOF:{this._err(he.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=B.COMMENT,this._stateComment(t)}}_stateComment(t){const n=this.currentToken;switch(t){case j.HYPHEN_MINUS:{this.state=B.COMMENT_END_DASH;break}case j.LESS_THAN_SIGN:{n.data+="<",this.state=B.COMMENT_LESS_THAN_SIGN;break}case j.NULL:{this._err(he.unexpectedNullCharacter),n.data+=bn;break}case j.EOF:{this._err(he.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+=String.fromCodePoint(t)}}_stateCommentLessThanSign(t){const n=this.currentToken;switch(t){case j.EXCLAMATION_MARK:{n.data+="!",this.state=B.COMMENT_LESS_THAN_SIGN_BANG;break}case j.LESS_THAN_SIGN:{n.data+="<";break}default:this.state=B.COMMENT,this._stateComment(t)}}_stateCommentLessThanSignBang(t){t===j.HYPHEN_MINUS?this.state=B.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=B.COMMENT,this._stateComment(t))}_stateCommentLessThanSignBangDash(t){t===j.HYPHEN_MINUS?this.state=B.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=B.COMMENT_END_DASH,this._stateCommentEndDash(t))}_stateCommentLessThanSignBangDashDash(t){t!==j.GREATER_THAN_SIGN&&t!==j.EOF&&this._err(he.nestedComment),this.state=B.COMMENT_END,this._stateCommentEnd(t)}_stateCommentEndDash(t){const n=this.currentToken;switch(t){case j.HYPHEN_MINUS:{this.state=B.COMMENT_END;break}case j.EOF:{this._err(he.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=B.COMMENT,this._stateComment(t)}}_stateCommentEnd(t){const n=this.currentToken;switch(t){case j.GREATER_THAN_SIGN:{this.state=B.DATA,this.emitCurrentComment(n);break}case j.EXCLAMATION_MARK:{this.state=B.COMMENT_END_BANG;break}case j.HYPHEN_MINUS:{n.data+="-";break}case j.EOF:{this._err(he.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--",this.state=B.COMMENT,this._stateComment(t)}}_stateCommentEndBang(t){const n=this.currentToken;switch(t){case j.HYPHEN_MINUS:{n.data+="--!",this.state=B.COMMENT_END_DASH;break}case j.GREATER_THAN_SIGN:{this._err(he.incorrectlyClosedComment),this.state=B.DATA,this.emitCurrentComment(n);break}case j.EOF:{this._err(he.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--!",this.state=B.COMMENT,this._stateComment(t)}}_stateDoctype(t){switch(t){case j.SPACE:case j.LINE_FEED:case j.TABULATION:case j.FORM_FEED:{this.state=B.BEFORE_DOCTYPE_NAME;break}case j.GREATER_THAN_SIGN:{this.state=B.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t);break}case j.EOF:{this._err(he.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(he.missingWhitespaceBeforeDoctypeName),this.state=B.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t)}}_stateBeforeDoctypeName(t){if(Bu(t))this._createDoctypeToken(String.fromCharCode(Bd(t))),this.state=B.DOCTYPE_NAME;else switch(t){case j.SPACE:case j.LINE_FEED:case j.TABULATION:case j.FORM_FEED:break;case j.NULL:{this._err(he.unexpectedNullCharacter),this._createDoctypeToken(bn),this.state=B.DOCTYPE_NAME;break}case j.GREATER_THAN_SIGN:{this._err(he.missingDoctypeName),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=B.DATA;break}case j.EOF:{this._err(he.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(t)),this.state=B.DOCTYPE_NAME}}_stateDoctypeName(t){const n=this.currentToken;switch(t){case j.SPACE:case j.LINE_FEED:case j.TABULATION:case j.FORM_FEED:{this.state=B.AFTER_DOCTYPE_NAME;break}case j.GREATER_THAN_SIGN:{this.state=B.DATA,this.emitCurrentDoctype(n);break}case j.NULL:{this._err(he.unexpectedNullCharacter),n.name+=bn;break}case j.EOF:{this._err(he.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.name+=String.fromCodePoint(Bu(t)?Bd(t):t)}}_stateAfterDoctypeName(t){const n=this.currentToken;switch(t){case j.SPACE:case j.LINE_FEED:case j.TABULATION:case j.FORM_FEED:break;case j.GREATER_THAN_SIGN:{this.state=B.DATA,this.emitCurrentDoctype(n);break}case j.EOF:{this._err(he.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(vr.PUBLIC,!1)?this.state=B.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(vr.SYSTEM,!1)?this.state=B.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(he.invalidCharacterSequenceAfterDoctypeName),n.forceQuirks=!0,this.state=B.BOGUS_DOCTYPE,this._stateBogusDoctype(t))}}_stateAfterDoctypePublicKeyword(t){const n=this.currentToken;switch(t){case j.SPACE:case j.LINE_FEED:case j.TABULATION:case j.FORM_FEED:{this.state=B.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case j.QUOTATION_MARK:{this._err(he.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=B.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case j.APOSTROPHE:{this._err(he.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=B.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case j.GREATER_THAN_SIGN:{this._err(he.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=B.DATA,this.emitCurrentDoctype(n);break}case j.EOF:{this._err(he.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(he.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=B.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case j.SPACE:case j.LINE_FEED:case j.TABULATION:case j.FORM_FEED:break;case j.QUOTATION_MARK:{n.publicId="",this.state=B.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case j.APOSTROPHE:{n.publicId="",this.state=B.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case j.GREATER_THAN_SIGN:{this._err(he.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=B.DATA,this.emitCurrentDoctype(n);break}case j.EOF:{this._err(he.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(he.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=B.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypePublicIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case j.QUOTATION_MARK:{this.state=B.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case j.NULL:{this._err(he.unexpectedNullCharacter),n.publicId+=bn;break}case j.GREATER_THAN_SIGN:{this._err(he.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=B.DATA;break}case j.EOF:{this._err(he.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(t)}}_stateDoctypePublicIdentifierSingleQuoted(t){const n=this.currentToken;switch(t){case j.APOSTROPHE:{this.state=B.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case j.NULL:{this._err(he.unexpectedNullCharacter),n.publicId+=bn;break}case j.GREATER_THAN_SIGN:{this._err(he.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=B.DATA;break}case j.EOF:{this._err(he.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(t)}}_stateAfterDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case j.SPACE:case j.LINE_FEED:case j.TABULATION:case j.FORM_FEED:{this.state=B.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case j.GREATER_THAN_SIGN:{this.state=B.DATA,this.emitCurrentDoctype(n);break}case j.QUOTATION_MARK:{this._err(he.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=B.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case j.APOSTROPHE:{this._err(he.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=B.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case j.EOF:{this._err(he.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(he.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=B.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBetweenDoctypePublicAndSystemIdentifiers(t){const n=this.currentToken;switch(t){case j.SPACE:case j.LINE_FEED:case j.TABULATION:case j.FORM_FEED:break;case j.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=B.DATA;break}case j.QUOTATION_MARK:{n.systemId="",this.state=B.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case j.APOSTROPHE:{n.systemId="",this.state=B.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case j.EOF:{this._err(he.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(he.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=B.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateAfterDoctypeSystemKeyword(t){const n=this.currentToken;switch(t){case j.SPACE:case j.LINE_FEED:case j.TABULATION:case j.FORM_FEED:{this.state=B.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case j.QUOTATION_MARK:{this._err(he.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=B.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case j.APOSTROPHE:{this._err(he.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=B.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case j.GREATER_THAN_SIGN:{this._err(he.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=B.DATA,this.emitCurrentDoctype(n);break}case j.EOF:{this._err(he.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(he.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=B.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case j.SPACE:case j.LINE_FEED:case j.TABULATION:case j.FORM_FEED:break;case j.QUOTATION_MARK:{n.systemId="",this.state=B.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case j.APOSTROPHE:{n.systemId="",this.state=B.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case j.GREATER_THAN_SIGN:{this._err(he.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=B.DATA,this.emitCurrentDoctype(n);break}case j.EOF:{this._err(he.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(he.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=B.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypeSystemIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case j.QUOTATION_MARK:{this.state=B.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case j.NULL:{this._err(he.unexpectedNullCharacter),n.systemId+=bn;break}case j.GREATER_THAN_SIGN:{this._err(he.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=B.DATA;break}case j.EOF:{this._err(he.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(t)}}_stateDoctypeSystemIdentifierSingleQuoted(t){const n=this.currentToken;switch(t){case j.APOSTROPHE:{this.state=B.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case j.NULL:{this._err(he.unexpectedNullCharacter),n.systemId+=bn;break}case j.GREATER_THAN_SIGN:{this._err(he.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=B.DATA;break}case j.EOF:{this._err(he.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(t)}}_stateAfterDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case j.SPACE:case j.LINE_FEED:case j.TABULATION:case j.FORM_FEED:break;case j.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=B.DATA;break}case j.EOF:{this._err(he.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(he.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=B.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBogusDoctype(t){const n=this.currentToken;switch(t){case j.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=B.DATA;break}case j.NULL:{this._err(he.unexpectedNullCharacter);break}case j.EOF:{this.emitCurrentDoctype(n),this._emitEOFToken();break}}}_stateCdataSection(t){switch(t){case j.RIGHT_SQUARE_BRACKET:{this.state=B.CDATA_SECTION_BRACKET;break}case j.EOF:{this._err(he.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateCdataSectionBracket(t){t===j.RIGHT_SQUARE_BRACKET?this.state=B.CDATA_SECTION_END:(this._emitChars("]"),this.state=B.CDATA_SECTION,this._stateCdataSection(t))}_stateCdataSectionEnd(t){switch(t){case j.GREATER_THAN_SIGN:{this.state=B.DATA;break}case j.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=B.CDATA_SECTION,this._stateCdataSection(t)}}_stateCharacterReference(){let t=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(t<0)if(this.preprocessor.lastChunkWritten)t=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}t===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(j.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&F2(this.preprocessor.peek(1))?B.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(t){F2(t)?this._flushCodePointConsumedAsCharacterReference(t):(t===j.SEMICOLON&&this._err(he.unknownNamedCharacterReference),this.state=this.returnState,this._callState(t))}}const O3=new Set([_.DD,_.DT,_.LI,_.OPTGROUP,_.OPTION,_.P,_.RB,_.RP,_.RT,_.RTC]),V2=new Set([...O3,_.CAPTION,_.COLGROUP,_.TBODY,_.TD,_.TFOOT,_.TH,_.THEAD,_.TR]),Sf=new Set([_.APPLET,_.CAPTION,_.HTML,_.MARQUEE,_.OBJECT,_.TABLE,_.TD,_.TEMPLATE,_.TH]),mD=new Set([...Sf,_.OL,_.UL]),pD=new Set([...Sf,_.BUTTON]),G2=new Set([_.ANNOTATION_XML,_.MI,_.MN,_.MO,_.MS,_.MTEXT]),q2=new Set([_.DESC,_.FOREIGN_OBJECT,_.TITLE]),gD=new Set([_.TR,_.TEMPLATE,_.HTML]),bD=new Set([_.TBODY,_.TFOOT,_.THEAD,_.TEMPLATE,_.HTML]),xD=new Set([_.TABLE,_.TEMPLATE,_.HTML]),yD=new Set([_.TD,_.TH]);class ED{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(t,n,r){this.treeAdapter=n,this.handler=r,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=_.UNKNOWN,this.current=t}_indexOf(t){return this.items.lastIndexOf(t,this.stackTop)}_isInTemplate(){return this.currentTagId===_.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===Se.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(t,n){this.stackTop++,this.items[this.stackTop]=t,this.current=t,this.tagIDs[this.stackTop]=n,this.currentTagId=n,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(t,n,!0)}pop(){const t=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!0)}replace(t,n){const r=this._indexOf(t);this.items[r]=n,r===this.stackTop&&(this.current=n)}insertAfter(t,n,r){const s=this._indexOf(t)+1;this.items.splice(s,0,n),this.tagIDs.splice(s,0,r),this.stackTop++,s===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,s===this.stackTop)}popUntilTagNamePopped(t){let n=this.stackTop+1;do n=this.tagIDs.lastIndexOf(t,n-1);while(n>0&&this.treeAdapter.getNamespaceURI(this.items[n])!==Se.HTML);this.shortenToLength(Math.max(n,0))}shortenToLength(t){for(;this.stackTop>=t;){const n=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(n,this.stackTop<t)}}popUntilElementPopped(t){const n=this._indexOf(t);this.shortenToLength(Math.max(n,0))}popUntilPopped(t,n){const r=this._indexOfTagNames(t,n);this.shortenToLength(Math.max(r,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(V0,Se.HTML)}popUntilTableCellPopped(){this.popUntilPopped(yD,Se.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(t,n){for(let r=this.stackTop;r>=0;r--)if(t.has(this.tagIDs[r])&&this.treeAdapter.getNamespaceURI(this.items[r])===n)return r;return-1}clearBackTo(t,n){const r=this._indexOfTagNames(t,n);this.shortenToLength(r+1)}clearBackToTableContext(){this.clearBackTo(xD,Se.HTML)}clearBackToTableBodyContext(){this.clearBackTo(bD,Se.HTML)}clearBackToTableRowContext(){this.clearBackTo(gD,Se.HTML)}remove(t){const n=this._indexOf(t);n>=0&&(n===this.stackTop?this.pop():(this.items.splice(n,1),this.tagIDs.splice(n,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===_.BODY?this.items[1]:null}contains(t){return this._indexOf(t)>-1}getCommonAncestor(t){const n=this._indexOf(t)-1;return n>=0?this.items[n]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===_.HTML}hasInDynamicScope(t,n){for(let r=this.stackTop;r>=0;r--){const s=this.tagIDs[r];switch(this.treeAdapter.getNamespaceURI(this.items[r])){case Se.HTML:{if(s===t)return!0;if(n.has(s))return!1;break}case Se.SVG:{if(q2.has(s))return!1;break}case Se.MATHML:{if(G2.has(s))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,Sf)}hasInListItemScope(t){return this.hasInDynamicScope(t,mD)}hasInButtonScope(t){return this.hasInDynamicScope(t,pD)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case Se.HTML:{if(V0.has(n))return!0;if(Sf.has(n))return!1;break}case Se.SVG:{if(q2.has(n))return!1;break}case Se.MATHML:{if(G2.has(n))return!1;break}}}return!0}hasInTableScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===Se.HTML)switch(this.tagIDs[n]){case t:return!0;case _.TABLE:case _.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===Se.HTML)switch(this.tagIDs[t]){case _.TBODY:case _.THEAD:case _.TFOOT:return!0;case _.TABLE:case _.HTML:return!1}return!0}hasInSelectScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===Se.HTML)switch(this.tagIDs[n]){case t:return!0;case _.OPTION:case _.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&O3.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&V2.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&V2.has(this.currentTagId);)this.pop()}}const Gp=3;var za;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(za||(za={}));const Y2={type:za.Marker};class _D{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(t,n){const r=[],s=n.length,l=this.treeAdapter.getTagName(t),o=this.treeAdapter.getNamespaceURI(t);for(let c=0;c<this.entries.length;c++){const d=this.entries[c];if(d.type===za.Marker)break;const{element:m}=d;if(this.treeAdapter.getTagName(m)===l&&this.treeAdapter.getNamespaceURI(m)===o){const p=this.treeAdapter.getAttrList(m);p.length===s&&r.push({idx:c,attrs:p})}}return r}_ensureNoahArkCondition(t){if(this.entries.length<Gp)return;const n=this.treeAdapter.getAttrList(t),r=this._getNoahArkConditionCandidates(t,n);if(r.length<Gp)return;const s=new Map(n.map(o=>[o.name,o.value]));let l=0;for(let o=0;o<r.length;o++){const c=r[o];c.attrs.every(d=>s.get(d.name)===d.value)&&(l+=1,l>=Gp&&this.entries.splice(c.idx,1))}}insertMarker(){this.entries.unshift(Y2)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:za.Element,element:t,token:n})}insertElementAfterBookmark(t,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:za.Element,element:t,token:n})}removeEntry(t){const n=this.entries.indexOf(t);n!==-1&&this.entries.splice(n,1)}clearToLastMarker(){const t=this.entries.indexOf(Y2);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const n=this.entries.find(r=>r.type===za.Marker||this.treeAdapter.getTagName(r.element)===t);return n&&n.type===za.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===za.Element&&n.element===t)}}const ps={createDocument(){return{nodeName:"#document",mode:Jr.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(e,t,n){return{nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}},createCommentNode(e){return{nodeName:"#comment",data:e,parentNode:null}},createTextNode(e){return{nodeName:"#text",value:e,parentNode:null}},appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,n){const r=e.childNodes.indexOf(n);e.childNodes.splice(r,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,n,r){const s=e.childNodes.find(l=>l.nodeName==="#documentType");if(s)s.name=t,s.publicId=n,s.systemId=r;else{const l={nodeName:"#documentType",name:t,publicId:n,systemId:r,parentNode:null};ps.appendChild(e,l)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){const t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){const n=e.childNodes[e.childNodes.length-1];if(ps.isTextNode(n)){n.value+=t;return}}ps.appendChild(e,ps.createTextNode(t))},insertTextBefore(e,t,n){const r=e.childNodes[e.childNodes.indexOf(n)-1];r&&ps.isTextNode(r)?r.value+=t:ps.insertBefore(e,ps.createTextNode(t),n)},adoptAttributes(e,t){const n=new Set(e.attrs.map(r=>r.name));for(let r=0;r<t.length;r++)n.has(t[r].name)||e.attrs.push(t[r])},getFirstChild(e){return e.childNodes[0]},getChildNodes(e){return e.childNodes},getParentNode(e){return e.parentNode},getAttrList(e){return e.attrs},getTagName(e){return e.tagName},getNamespaceURI(e){return e.namespaceURI},getTextNodeContent(e){return e.value},getCommentNodeContent(e){return e.data},getDocumentTypeNodeName(e){return e.name},getDocumentTypeNodePublicId(e){return e.publicId},getDocumentTypeNodeSystemId(e){return e.systemId},isTextNode(e){return e.nodeName==="#text"},isCommentNode(e){return e.nodeName==="#comment"},isDocumentTypeNode(e){return e.nodeName==="#documentType"},isElementNode(e){return Object.prototype.hasOwnProperty.call(e,"tagName")},setNodeSourceCodeLocation(e,t){e.sourceCodeLocation=t},getNodeSourceCodeLocation(e){return e.sourceCodeLocation},updateNodeSourceCodeLocation(e,t){e.sourceCodeLocation={...e.sourceCodeLocation,...t}}},D3="html",TD="about:legacy-compat",vD="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",j3=["+//silmaril//dtd html pro v0r11 19970101//","-//as//dtd html 3.0 aswedit + extensions//","-//advasoft ltd//dtd html 3.0 aswedit + extensions//","-//ietf//dtd html 2.0 level 1//","-//ietf//dtd html 2.0 level 2//","-//ietf//dtd html 2.0 strict level 1//","-//ietf//dtd html 2.0 strict level 2//","-//ietf//dtd html 2.0 strict//","-//ietf//dtd html 2.0//","-//ietf//dtd html 2.1e//","-//ietf//dtd html 3.0//","-//ietf//dtd html 3.2 final//","-//ietf//dtd html 3.2//","-//ietf//dtd html 3//","-//ietf//dtd html level 0//","-//ietf//dtd html level 1//","-//ietf//dtd html level 2//","-//ietf//dtd html level 3//","-//ietf//dtd html strict level 0//","-//ietf//dtd html strict level 1//","-//ietf//dtd html strict level 2//","-//ietf//dtd html strict level 3//","-//ietf//dtd html strict//","-//ietf//dtd html//","-//metrius//dtd metrius presentational//","-//microsoft//dtd internet explorer 2.0 html strict//","-//microsoft//dtd internet explorer 2.0 html//","-//microsoft//dtd internet explorer 2.0 tables//","-//microsoft//dtd internet explorer 3.0 html strict//","-//microsoft//dtd internet explorer 3.0 html//","-//microsoft//dtd internet explorer 3.0 tables//","-//netscape comm. corp.//dtd html//","-//netscape comm. corp.//dtd strict html//","-//o'reilly and associates//dtd html 2.0//","-//o'reilly and associates//dtd html extended 1.0//","-//o'reilly and associates//dtd html extended relaxed 1.0//","-//sq//dtd html 2.0 hotmetal + extensions//","-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//","-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//","-//spyglass//dtd html 2.0 extended//","-//sun microsystems corp.//dtd hotjava html//","-//sun microsystems corp.//dtd hotjava strict html//","-//w3c//dtd html 3 1995-03-24//","-//w3c//dtd html 3.2 draft//","-//w3c//dtd html 3.2 final//","-//w3c//dtd html 3.2//","-//w3c//dtd html 3.2s draft//","-//w3c//dtd html 4.0 frameset//","-//w3c//dtd html 4.0 transitional//","-//w3c//dtd html experimental 19960712//","-//w3c//dtd html experimental 970421//","-//w3c//dtd w3 html//","-//w3o//dtd w3 html 3.0//","-//webtechs//dtd mozilla html 2.0//","-//webtechs//dtd mozilla html//"],wD=[...j3,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],kD=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),M3=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],CD=[...M3,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function W2(e,t){return t.some(n=>e.startsWith(n))}function SD(e){return e.name===D3&&e.publicId===null&&(e.systemId===null||e.systemId===TD)}function AD(e){if(e.name!==D3)return Jr.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===vD)return Jr.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),kD.has(n))return Jr.QUIRKS;let r=t===null?wD:j3;if(W2(n,r))return Jr.QUIRKS;if(r=t===null?M3:CD,W2(n,r))return Jr.LIMITED_QUIRKS}return Jr.NO_QUIRKS}const Q2={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},ND="definitionurl",RD="definitionURL",LD=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(e=>[e.toLowerCase(),e])),ID=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:Se.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:Se.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:Se.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:Se.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:Se.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:Se.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:Se.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:Se.XML}],["xml:space",{prefix:"xml",name:"space",namespace:Se.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:Se.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:Se.XMLNS}]]),OD=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(e=>[e.toLowerCase(),e])),DD=new Set([_.B,_.BIG,_.BLOCKQUOTE,_.BODY,_.BR,_.CENTER,_.CODE,_.DD,_.DIV,_.DL,_.DT,_.EM,_.EMBED,_.H1,_.H2,_.H3,_.H4,_.H5,_.H6,_.HEAD,_.HR,_.I,_.IMG,_.LI,_.LISTING,_.MENU,_.META,_.NOBR,_.OL,_.P,_.PRE,_.RUBY,_.S,_.SMALL,_.SPAN,_.STRONG,_.STRIKE,_.SUB,_.SUP,_.TABLE,_.TT,_.U,_.UL,_.VAR]);function jD(e){const t=e.tagID;return t===_.FONT&&e.attrs.some(({name:r})=>r===ul.COLOR||r===ul.SIZE||r===ul.FACE)||DD.has(t)}function P3(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===ND){e.attrs[t].name=RD;break}}function B3(e){for(let t=0;t<e.attrs.length;t++){const n=LD.get(e.attrs[t].name);n!=null&&(e.attrs[t].name=n)}}function Jg(e){for(let t=0;t<e.attrs.length;t++){const n=ID.get(e.attrs[t].name);n&&(e.attrs[t].prefix=n.prefix,e.attrs[t].name=n.name,e.attrs[t].namespace=n.namespace)}}function MD(e){const t=OD.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=Io(e.tagName))}function PD(e,t){return t===Se.MATHML&&(e===_.MI||e===_.MO||e===_.MN||e===_.MS||e===_.MTEXT)}function BD(e,t,n){if(t===Se.MATHML&&e===_.ANNOTATION_XML){for(let r=0;r<n.length;r++)if(n[r].name===ul.ENCODING){const s=n[r].value.toLowerCase();return s===Q2.TEXT_HTML||s===Q2.APPLICATION_XML}}return t===Se.SVG&&(e===_.FOREIGN_OBJECT||e===_.DESC||e===_.TITLE)}function UD(e,t,n,r){return(!r||r===Se.HTML)&&BD(e,t,n)||(!r||r===Se.MATHML)&&PD(e,t)}const HD="hidden",zD=8,FD=3;var V;(function(e){e[e.INITIAL=0]="INITIAL",e[e.BEFORE_HTML=1]="BEFORE_HTML",e[e.BEFORE_HEAD=2]="BEFORE_HEAD",e[e.IN_HEAD=3]="IN_HEAD",e[e.IN_HEAD_NO_SCRIPT=4]="IN_HEAD_NO_SCRIPT",e[e.AFTER_HEAD=5]="AFTER_HEAD",e[e.IN_BODY=6]="IN_BODY",e[e.TEXT=7]="TEXT",e[e.IN_TABLE=8]="IN_TABLE",e[e.IN_TABLE_TEXT=9]="IN_TABLE_TEXT",e[e.IN_CAPTION=10]="IN_CAPTION",e[e.IN_COLUMN_GROUP=11]="IN_COLUMN_GROUP",e[e.IN_TABLE_BODY=12]="IN_TABLE_BODY",e[e.IN_ROW=13]="IN_ROW",e[e.IN_CELL=14]="IN_CELL",e[e.IN_SELECT=15]="IN_SELECT",e[e.IN_SELECT_IN_TABLE=16]="IN_SELECT_IN_TABLE",e[e.IN_TEMPLATE=17]="IN_TEMPLATE",e[e.AFTER_BODY=18]="AFTER_BODY",e[e.IN_FRAMESET=19]="IN_FRAMESET",e[e.AFTER_FRAMESET=20]="AFTER_FRAMESET",e[e.AFTER_AFTER_BODY=21]="AFTER_AFTER_BODY",e[e.AFTER_AFTER_FRAMESET=22]="AFTER_AFTER_FRAMESET"})(V||(V={}));const $D={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},U3=new Set([_.TABLE,_.TBODY,_.TFOOT,_.THEAD,_.TR]),X2={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:ps,onParseError:null};class K2{constructor(t,n,r=null,s=null){this.fragmentContext=r,this.scriptHandler=s,this.currentToken=null,this.stopped=!1,this.insertionMode=V.INITIAL,this.originalInsertionMode=V.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...X2,...t},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=n??this.treeAdapter.createDocument(),this.tokenizer=new hD(this.options,this),this.activeFormattingElements=new _D(this.treeAdapter),this.fragmentContextID=r?Io(this.treeAdapter.getTagName(r)):_.UNKNOWN,this._setContextModes(r??this.document,this.fragmentContextID),this.openElements=new ED(this.document,this.treeAdapter,this)}static parse(t,n){const r=new this(n);return r.tokenizer.write(t,!0),r.document}static getFragmentParser(t,n){const r={...X2,...n};t??(t=r.treeAdapter.createElement(te.TEMPLATE,Se.HTML,[]));const s=r.treeAdapter.createElement("documentmock",Se.HTML,[]),l=new this(r,s,t);return l.fragmentContextID===_.TEMPLATE&&l.tmplInsertionModeStack.unshift(V.IN_TEMPLATE),l._initTokenizerForFragmentParsing(),l._insertFakeRootElement(),l._resetInsertionMode(),l._findFormInFragmentContext(),l}getFragment(){const t=this.treeAdapter.getFirstChild(this.document),n=this.treeAdapter.createDocumentFragment();return this._adoptNodes(t,n),n}_err(t,n,r){var s;if(!this.onParseError)return;const l=(s=t.location)!==null&&s!==void 0?s:$D,o={code:n,startLine:l.startLine,startCol:l.startCol,startOffset:l.startOffset,endLine:r?l.startLine:l.endLine,endCol:r?l.startCol:l.endCol,endOffset:r?l.startOffset:l.endOffset};this.onParseError(o)}onItemPush(t,n,r){var s,l;(l=(s=this.treeAdapter).onItemPush)===null||l===void 0||l.call(s,t),r&&this.openElements.stackTop>0&&this._setContextModes(t,n)}onItemPop(t,n){var r,s;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(t,this.currentToken),(s=(r=this.treeAdapter).onItemPop)===null||s===void 0||s.call(r,t,this.openElements.current),n){let l,o;this.openElements.stackTop===0&&this.fragmentContext?(l=this.fragmentContext,o=this.fragmentContextID):{current:l,currentTagId:o}=this.openElements,this._setContextModes(l,o)}}_setContextModes(t,n){const r=t===this.document||t&&this.treeAdapter.getNamespaceURI(t)===Se.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&t!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,t)}_switchToTextParsing(t,n){this._insertElement(t,Se.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=V.TEXT}switchToPlaintextParsing(){this.insertionMode=V.TEXT,this.originalInsertionMode=V.IN_BODY,this.tokenizer.state=Sn.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let t=this.fragmentContext;for(;t;){if(this.treeAdapter.getTagName(t)===te.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==Se.HTML))switch(this.fragmentContextID){case _.TITLE:case _.TEXTAREA:{this.tokenizer.state=Sn.RCDATA;break}case _.STYLE:case _.XMP:case _.IFRAME:case _.NOEMBED:case _.NOFRAMES:case _.NOSCRIPT:{this.tokenizer.state=Sn.RAWTEXT;break}case _.SCRIPT:{this.tokenizer.state=Sn.SCRIPT_DATA;break}case _.PLAINTEXT:{this.tokenizer.state=Sn.PLAINTEXT;break}}}_setDocumentType(t){const n=t.name||"",r=t.publicId||"",s=t.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,r,s),t.location){const o=this.treeAdapter.getChildNodes(this.document).find(c=>this.treeAdapter.isDocumentTypeNode(c));o&&this.treeAdapter.setNodeSourceCodeLocation(o,t.location)}}_attachElementToTree(t,n){if(this.options.sourceCodeLocationInfo){const r=n&&{...n,startTag:n};this.treeAdapter.setNodeSourceCodeLocation(t,r)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(t);else{const r=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(r??this.document,t)}}_appendElement(t,n){const r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location)}_insertElement(t,n){const r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location),this.openElements.push(r,t.tagID)}_insertFakeElement(t,n){const r=this.treeAdapter.createElement(t,Se.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(t){const n=this.treeAdapter.createElement(t.tagName,Se.HTML,t.attrs),r=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(n,r),this._attachElementToTree(n,t.location),this.openElements.push(n,t.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,null)}_insertFakeRootElement(){const t=this.treeAdapter.createElement(te.HTML,Se.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,_.HTML)}_appendCommentNode(t,n){const r=this.treeAdapter.createCommentNode(t.data);this.treeAdapter.appendChild(n,r),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,t.location)}_insertCharacters(t){let n,r;if(this._shouldFosterParentOnInsertion()?({parent:n,beforeElement:r}=this._findFosterParentingLocation(),r?this.treeAdapter.insertTextBefore(n,t.chars,r):this.treeAdapter.insertText(n,t.chars)):(n=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(n,t.chars)),!t.location)return;const s=this.treeAdapter.getChildNodes(n),l=r?s.lastIndexOf(r):s.length,o=s[l-1];if(this.treeAdapter.getNodeSourceCodeLocation(o)){const{endLine:d,endCol:m,endOffset:p}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(o,{endLine:d,endCol:m,endOffset:p})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(o,t.location)}_adoptNodes(t,n){for(let r=this.treeAdapter.getFirstChild(t);r;r=this.treeAdapter.getFirstChild(t))this.treeAdapter.detachNode(r),this.treeAdapter.appendChild(n,r)}_setEndLocation(t,n){if(this.treeAdapter.getNodeSourceCodeLocation(t)&&n.location){const r=n.location,s=this.treeAdapter.getTagName(t),l=n.type===Lt.END_TAG&&s===n.tagName?{endTag:{...r},endLine:r.endLine,endCol:r.endCol,endOffset:r.endOffset}:{endLine:r.startLine,endCol:r.startCol,endOffset:r.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(t,l)}}shouldProcessStartTagTokenInForeignContent(t){if(!this.currentNotInHTML)return!1;let n,r;return this.openElements.stackTop===0&&this.fragmentContext?(n=this.fragmentContext,r=this.fragmentContextID):{current:n,currentTagId:r}=this.openElements,t.tagID===_.SVG&&this.treeAdapter.getTagName(n)===te.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===Se.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===_.MGLYPH||t.tagID===_.MALIGNMARK)&&r!==void 0&&!this._isIntegrationPoint(r,n,Se.HTML)}_processToken(t){switch(t.type){case Lt.CHARACTER:{this.onCharacter(t);break}case Lt.NULL_CHARACTER:{this.onNullCharacter(t);break}case Lt.COMMENT:{this.onComment(t);break}case Lt.DOCTYPE:{this.onDoctype(t);break}case Lt.START_TAG:{this._processStartTag(t);break}case Lt.END_TAG:{this.onEndTag(t);break}case Lt.EOF:{this.onEof(t);break}case Lt.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,r){const s=this.treeAdapter.getNamespaceURI(n),l=this.treeAdapter.getAttrList(n);return UD(t,s,l,r)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const n=this.activeFormattingElements.entries.findIndex(s=>s.type===za.Marker||this.openElements.contains(s.element)),r=n===-1?t-1:n-1;for(let s=r;s>=0;s--){const l=this.activeFormattingElements.entries[s];this._insertElement(l.token,this.treeAdapter.getNamespaceURI(l.element)),l.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=V.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(_.P),this.openElements.popUntilTagNamePopped(_.P)}_resetInsertionMode(){for(let t=this.openElements.stackTop;t>=0;t--)switch(t===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case _.TR:{this.insertionMode=V.IN_ROW;return}case _.TBODY:case _.THEAD:case _.TFOOT:{this.insertionMode=V.IN_TABLE_BODY;return}case _.CAPTION:{this.insertionMode=V.IN_CAPTION;return}case _.COLGROUP:{this.insertionMode=V.IN_COLUMN_GROUP;return}case _.TABLE:{this.insertionMode=V.IN_TABLE;return}case _.BODY:{this.insertionMode=V.IN_BODY;return}case _.FRAMESET:{this.insertionMode=V.IN_FRAMESET;return}case _.SELECT:{this._resetInsertionModeForSelect(t);return}case _.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case _.HTML:{this.insertionMode=this.headElement?V.AFTER_HEAD:V.BEFORE_HEAD;return}case _.TD:case _.TH:{if(t>0){this.insertionMode=V.IN_CELL;return}break}case _.HEAD:{if(t>0){this.insertionMode=V.IN_HEAD;return}break}}this.insertionMode=V.IN_BODY}_resetInsertionModeForSelect(t){if(t>0)for(let n=t-1;n>0;n--){const r=this.openElements.tagIDs[n];if(r===_.TEMPLATE)break;if(r===_.TABLE){this.insertionMode=V.IN_SELECT_IN_TABLE;return}}this.insertionMode=V.IN_SELECT}_isElementCausesFosterParenting(t){return U3.has(t)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let t=this.openElements.stackTop;t>=0;t--){const n=this.openElements.items[t];switch(this.openElements.tagIDs[t]){case _.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===Se.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case _.TABLE:{const r=this.treeAdapter.getParentNode(n);return r?{parent:r,beforeElement:n}:{parent:this.openElements.items[t-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(t){const n=this._findFosterParentingLocation();n.beforeElement?this.treeAdapter.insertBefore(n.parent,t,n.beforeElement):this.treeAdapter.appendChild(n.parent,t)}_isSpecialElement(t,n){const r=this.treeAdapter.getNamespaceURI(t);return uD[r].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){yj(this,t);return}switch(this.insertionMode){case V.INITIAL:{Su(this,t);break}case V.BEFORE_HTML:{Gu(this,t);break}case V.BEFORE_HEAD:{qu(this,t);break}case V.IN_HEAD:{Yu(this,t);break}case V.IN_HEAD_NO_SCRIPT:{Wu(this,t);break}case V.AFTER_HEAD:{Qu(this,t);break}case V.IN_BODY:case V.IN_CAPTION:case V.IN_CELL:case V.IN_TEMPLATE:{z3(this,t);break}case V.TEXT:case V.IN_SELECT:case V.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case V.IN_TABLE:case V.IN_TABLE_BODY:case V.IN_ROW:{qp(this,t);break}case V.IN_TABLE_TEXT:{Y3(this,t);break}case V.IN_COLUMN_GROUP:{Af(this,t);break}case V.AFTER_BODY:{Nf(this,t);break}case V.AFTER_AFTER_BODY:{uf(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){xj(this,t);return}switch(this.insertionMode){case V.INITIAL:{Su(this,t);break}case V.BEFORE_HTML:{Gu(this,t);break}case V.BEFORE_HEAD:{qu(this,t);break}case V.IN_HEAD:{Yu(this,t);break}case V.IN_HEAD_NO_SCRIPT:{Wu(this,t);break}case V.AFTER_HEAD:{Qu(this,t);break}case V.TEXT:{this._insertCharacters(t);break}case V.IN_TABLE:case V.IN_TABLE_BODY:case V.IN_ROW:{qp(this,t);break}case V.IN_COLUMN_GROUP:{Af(this,t);break}case V.AFTER_BODY:{Nf(this,t);break}case V.AFTER_AFTER_BODY:{uf(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){G0(this,t);return}switch(this.insertionMode){case V.INITIAL:case V.BEFORE_HTML:case V.BEFORE_HEAD:case V.IN_HEAD:case V.IN_HEAD_NO_SCRIPT:case V.AFTER_HEAD:case V.IN_BODY:case V.IN_TABLE:case V.IN_CAPTION:case V.IN_COLUMN_GROUP:case V.IN_TABLE_BODY:case V.IN_ROW:case V.IN_CELL:case V.IN_SELECT:case V.IN_SELECT_IN_TABLE:case V.IN_TEMPLATE:case V.IN_FRAMESET:case V.AFTER_FRAMESET:{G0(this,t);break}case V.IN_TABLE_TEXT:{Au(this,t);break}case V.AFTER_BODY:{XD(this,t);break}case V.AFTER_AFTER_BODY:case V.AFTER_AFTER_FRAMESET:{KD(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case V.INITIAL:{ZD(this,t);break}case V.BEFORE_HEAD:case V.IN_HEAD:case V.IN_HEAD_NO_SCRIPT:case V.AFTER_HEAD:{this._err(t,he.misplacedDoctype);break}case V.IN_TABLE_TEXT:{Au(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,he.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?Ej(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case V.INITIAL:{Su(this,t);break}case V.BEFORE_HTML:{JD(this,t);break}case V.BEFORE_HEAD:{t9(this,t);break}case V.IN_HEAD:{ka(this,t);break}case V.IN_HEAD_NO_SCRIPT:{a9(this,t);break}case V.AFTER_HEAD:{s9(this,t);break}case V.IN_BODY:{sr(this,t);break}case V.IN_TABLE:{Eo(this,t);break}case V.IN_TABLE_TEXT:{Au(this,t);break}case V.IN_CAPTION:{nj(this,t);break}case V.IN_COLUMN_GROUP:{n1(this,t);break}case V.IN_TABLE_BODY:{nh(this,t);break}case V.IN_ROW:{rh(this,t);break}case V.IN_CELL:{ij(this,t);break}case V.IN_SELECT:{X3(this,t);break}case V.IN_SELECT_IN_TABLE:{lj(this,t);break}case V.IN_TEMPLATE:{uj(this,t);break}case V.AFTER_BODY:{dj(this,t);break}case V.IN_FRAMESET:{fj(this,t);break}case V.AFTER_FRAMESET:{mj(this,t);break}case V.AFTER_AFTER_BODY:{gj(this,t);break}case V.AFTER_AFTER_FRAMESET:{bj(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?_j(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case V.INITIAL:{Su(this,t);break}case V.BEFORE_HTML:{e9(this,t);break}case V.BEFORE_HEAD:{n9(this,t);break}case V.IN_HEAD:{r9(this,t);break}case V.IN_HEAD_NO_SCRIPT:{i9(this,t);break}case V.AFTER_HEAD:{l9(this,t);break}case V.IN_BODY:{th(this,t);break}case V.TEXT:{q9(this,t);break}case V.IN_TABLE:{lc(this,t);break}case V.IN_TABLE_TEXT:{Au(this,t);break}case V.IN_CAPTION:{rj(this,t);break}case V.IN_COLUMN_GROUP:{aj(this,t);break}case V.IN_TABLE_BODY:{q0(this,t);break}case V.IN_ROW:{Q3(this,t);break}case V.IN_CELL:{sj(this,t);break}case V.IN_SELECT:{K3(this,t);break}case V.IN_SELECT_IN_TABLE:{oj(this,t);break}case V.IN_TEMPLATE:{cj(this,t);break}case V.AFTER_BODY:{J3(this,t);break}case V.IN_FRAMESET:{hj(this,t);break}case V.AFTER_FRAMESET:{pj(this,t);break}case V.AFTER_AFTER_BODY:{uf(this,t);break}}}onEof(t){switch(this.insertionMode){case V.INITIAL:{Su(this,t);break}case V.BEFORE_HTML:{Gu(this,t);break}case V.BEFORE_HEAD:{qu(this,t);break}case V.IN_HEAD:{Yu(this,t);break}case V.IN_HEAD_NO_SCRIPT:{Wu(this,t);break}case V.AFTER_HEAD:{Qu(this,t);break}case V.IN_BODY:case V.IN_TABLE:case V.IN_CAPTION:case V.IN_COLUMN_GROUP:case V.IN_TABLE_BODY:case V.IN_ROW:case V.IN_CELL:case V.IN_SELECT:case V.IN_SELECT_IN_TABLE:{G3(this,t);break}case V.TEXT:{Y9(this,t);break}case V.IN_TABLE_TEXT:{Au(this,t);break}case V.IN_TEMPLATE:{Z3(this,t);break}case V.AFTER_BODY:case V.IN_FRAMESET:case V.AFTER_FRAMESET:case V.AFTER_AFTER_BODY:case V.AFTER_AFTER_FRAMESET:{t1(this,t);break}}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===j.LINE_FEED)){if(t.chars.length===1)return;t.chars=t.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(t);return}switch(this.insertionMode){case V.IN_HEAD:case V.IN_HEAD_NO_SCRIPT:case V.AFTER_HEAD:case V.TEXT:case V.IN_COLUMN_GROUP:case V.IN_SELECT:case V.IN_SELECT_IN_TABLE:case V.IN_FRAMESET:case V.AFTER_FRAMESET:{this._insertCharacters(t);break}case V.IN_BODY:case V.IN_CAPTION:case V.IN_CELL:case V.IN_TEMPLATE:case V.AFTER_BODY:case V.AFTER_AFTER_BODY:case V.AFTER_AFTER_FRAMESET:{H3(this,t);break}case V.IN_TABLE:case V.IN_TABLE_BODY:case V.IN_ROW:{qp(this,t);break}case V.IN_TABLE_TEXT:{q3(this,t);break}}}}function VD(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return n?e.openElements.contains(n.element)?e.openElements.hasInScope(t.tagID)||(n=null):(e.activeFormattingElements.removeEntry(n),n=null):V3(e,t),n}function GD(e,t){let n=null,r=e.openElements.stackTop;for(;r>=0;r--){const s=e.openElements.items[r];if(s===t.element)break;e._isSpecialElement(s,e.openElements.tagIDs[r])&&(n=s)}return n||(e.openElements.shortenToLength(Math.max(r,0)),e.activeFormattingElements.removeEntry(t)),n}function qD(e,t,n){let r=t,s=e.openElements.getCommonAncestor(t);for(let l=0,o=s;o!==n;l++,o=s){s=e.openElements.getCommonAncestor(o);const c=e.activeFormattingElements.getElementEntry(o),d=c&&l>=FD;!c||d?(d&&e.activeFormattingElements.removeEntry(c),e.openElements.remove(o)):(o=YD(e,c),r===t&&(e.activeFormattingElements.bookmark=c),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(o,r),r=o)}return r}function YD(e,t){const n=e.treeAdapter.getNamespaceURI(t.element),r=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,r),t.element=r,r}function WD(e,t,n){const r=e.treeAdapter.getTagName(t),s=Io(r);if(e._isElementCausesFosterParenting(s))e._fosterParentElement(n);else{const l=e.treeAdapter.getNamespaceURI(t);s===_.TEMPLATE&&l===Se.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function QD(e,t,n){const r=e.treeAdapter.getNamespaceURI(n.element),{token:s}=n,l=e.treeAdapter.createElement(s.tagName,r,s.attrs);e._adoptNodes(t,l),e.treeAdapter.appendChild(t,l),e.activeFormattingElements.insertElementAfterBookmark(l,s),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,l,s.tagID)}function e1(e,t){for(let n=0;n<zD;n++){const r=VD(e,t);if(!r)break;const s=GD(e,r);if(!s)break;e.activeFormattingElements.bookmark=r;const l=qD(e,s,r.element),o=e.openElements.getCommonAncestor(r.element);e.treeAdapter.detachNode(l),o&&WD(e,o,l),QD(e,s,r)}}function G0(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function XD(e,t){e._appendCommentNode(t,e.openElements.items[0])}function KD(e,t){e._appendCommentNode(t,e.document)}function t1(e,t){if(e.stopped=!0,t.location){const n=e.fragmentContext?0:2;for(let r=e.openElements.stackTop;r>=n;r--)e._setEndLocation(e.openElements.items[r],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){const r=e.openElements.items[0],s=e.treeAdapter.getNodeSourceCodeLocation(r);if(s&&!s.endTag&&(e._setEndLocation(r,t),e.openElements.stackTop>=1)){const l=e.openElements.items[1],o=e.treeAdapter.getNodeSourceCodeLocation(l);o&&!o.endTag&&e._setEndLocation(l,t)}}}}function ZD(e,t){e._setDocumentType(t);const n=t.forceQuirks?Jr.QUIRKS:AD(t);SD(t)||e._err(t,he.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=V.BEFORE_HTML}function Su(e,t){e._err(t,he.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,Jr.QUIRKS),e.insertionMode=V.BEFORE_HTML,e._processToken(t)}function JD(e,t){t.tagID===_.HTML?(e._insertElement(t,Se.HTML),e.insertionMode=V.BEFORE_HEAD):Gu(e,t)}function e9(e,t){const n=t.tagID;(n===_.HTML||n===_.HEAD||n===_.BODY||n===_.BR)&&Gu(e,t)}function Gu(e,t){e._insertFakeRootElement(),e.insertionMode=V.BEFORE_HEAD,e._processToken(t)}function t9(e,t){switch(t.tagID){case _.HTML:{sr(e,t);break}case _.HEAD:{e._insertElement(t,Se.HTML),e.headElement=e.openElements.current,e.insertionMode=V.IN_HEAD;break}default:qu(e,t)}}function n9(e,t){const n=t.tagID;n===_.HEAD||n===_.BODY||n===_.HTML||n===_.BR?qu(e,t):e._err(t,he.endTagWithoutMatchingOpenElement)}function qu(e,t){e._insertFakeElement(te.HEAD,_.HEAD),e.headElement=e.openElements.current,e.insertionMode=V.IN_HEAD,e._processToken(t)}function ka(e,t){switch(t.tagID){case _.HTML:{sr(e,t);break}case _.BASE:case _.BASEFONT:case _.BGSOUND:case _.LINK:case _.META:{e._appendElement(t,Se.HTML),t.ackSelfClosing=!0;break}case _.TITLE:{e._switchToTextParsing(t,Sn.RCDATA);break}case _.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,Sn.RAWTEXT):(e._insertElement(t,Se.HTML),e.insertionMode=V.IN_HEAD_NO_SCRIPT);break}case _.NOFRAMES:case _.STYLE:{e._switchToTextParsing(t,Sn.RAWTEXT);break}case _.SCRIPT:{e._switchToTextParsing(t,Sn.SCRIPT_DATA);break}case _.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=V.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(V.IN_TEMPLATE);break}case _.HEAD:{e._err(t,he.misplacedStartTagForHeadElement);break}default:Yu(e,t)}}function r9(e,t){switch(t.tagID){case _.HEAD:{e.openElements.pop(),e.insertionMode=V.AFTER_HEAD;break}case _.BODY:case _.BR:case _.HTML:{Yu(e,t);break}case _.TEMPLATE:{pl(e,t);break}default:e._err(t,he.endTagWithoutMatchingOpenElement)}}function pl(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==_.TEMPLATE&&e._err(t,he.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(_.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,he.endTagWithoutMatchingOpenElement)}function Yu(e,t){e.openElements.pop(),e.insertionMode=V.AFTER_HEAD,e._processToken(t)}function a9(e,t){switch(t.tagID){case _.HTML:{sr(e,t);break}case _.BASEFONT:case _.BGSOUND:case _.HEAD:case _.LINK:case _.META:case _.NOFRAMES:case _.STYLE:{ka(e,t);break}case _.NOSCRIPT:{e._err(t,he.nestedNoscriptInHead);break}default:Wu(e,t)}}function i9(e,t){switch(t.tagID){case _.NOSCRIPT:{e.openElements.pop(),e.insertionMode=V.IN_HEAD;break}case _.BR:{Wu(e,t);break}default:e._err(t,he.endTagWithoutMatchingOpenElement)}}function Wu(e,t){const n=t.type===Lt.EOF?he.openElementsLeftAfterEof:he.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=V.IN_HEAD,e._processToken(t)}function s9(e,t){switch(t.tagID){case _.HTML:{sr(e,t);break}case _.BODY:{e._insertElement(t,Se.HTML),e.framesetOk=!1,e.insertionMode=V.IN_BODY;break}case _.FRAMESET:{e._insertElement(t,Se.HTML),e.insertionMode=V.IN_FRAMESET;break}case _.BASE:case _.BASEFONT:case _.BGSOUND:case _.LINK:case _.META:case _.NOFRAMES:case _.SCRIPT:case _.STYLE:case _.TEMPLATE:case _.TITLE:{e._err(t,he.abandonedHeadElementChild),e.openElements.push(e.headElement,_.HEAD),ka(e,t),e.openElements.remove(e.headElement);break}case _.HEAD:{e._err(t,he.misplacedStartTagForHeadElement);break}default:Qu(e,t)}}function l9(e,t){switch(t.tagID){case _.BODY:case _.HTML:case _.BR:{Qu(e,t);break}case _.TEMPLATE:{pl(e,t);break}default:e._err(t,he.endTagWithoutMatchingOpenElement)}}function Qu(e,t){e._insertFakeElement(te.BODY,_.BODY),e.insertionMode=V.IN_BODY,eh(e,t)}function eh(e,t){switch(t.type){case Lt.CHARACTER:{z3(e,t);break}case Lt.WHITESPACE_CHARACTER:{H3(e,t);break}case Lt.COMMENT:{G0(e,t);break}case Lt.START_TAG:{sr(e,t);break}case Lt.END_TAG:{th(e,t);break}case Lt.EOF:{G3(e,t);break}}}function H3(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function z3(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function o9(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function u9(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function c9(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,Se.HTML),e.insertionMode=V.IN_FRAMESET)}function d9(e,t){e.openElements.hasInButtonScope(_.P)&&e._closePElement(),e._insertElement(t,Se.HTML)}function f9(e,t){e.openElements.hasInButtonScope(_.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&V0.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,Se.HTML)}function h9(e,t){e.openElements.hasInButtonScope(_.P)&&e._closePElement(),e._insertElement(t,Se.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function m9(e,t){const n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(_.P)&&e._closePElement(),e._insertElement(t,Se.HTML),n||(e.formElement=e.openElements.current))}function p9(e,t){e.framesetOk=!1;const n=t.tagID;for(let r=e.openElements.stackTop;r>=0;r--){const s=e.openElements.tagIDs[r];if(n===_.LI&&s===_.LI||(n===_.DD||n===_.DT)&&(s===_.DD||s===_.DT)){e.openElements.generateImpliedEndTagsWithExclusion(s),e.openElements.popUntilTagNamePopped(s);break}if(s!==_.ADDRESS&&s!==_.DIV&&s!==_.P&&e._isSpecialElement(e.openElements.items[r],s))break}e.openElements.hasInButtonScope(_.P)&&e._closePElement(),e._insertElement(t,Se.HTML)}function g9(e,t){e.openElements.hasInButtonScope(_.P)&&e._closePElement(),e._insertElement(t,Se.HTML),e.tokenizer.state=Sn.PLAINTEXT}function b9(e,t){e.openElements.hasInScope(_.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(_.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,Se.HTML),e.framesetOk=!1}function x9(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(te.A);n&&(e1(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,Se.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function y9(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Se.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function E9(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(_.NOBR)&&(e1(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,Se.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function _9(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Se.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function T9(e,t){e.treeAdapter.getDocumentMode(e.document)!==Jr.QUIRKS&&e.openElements.hasInButtonScope(_.P)&&e._closePElement(),e._insertElement(t,Se.HTML),e.framesetOk=!1,e.insertionMode=V.IN_TABLE}function F3(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,Se.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function $3(e){const t=L3(e,ul.TYPE);return t!=null&&t.toLowerCase()===HD}function v9(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,Se.HTML),$3(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function w9(e,t){e._appendElement(t,Se.HTML),t.ackSelfClosing=!0}function k9(e,t){e.openElements.hasInButtonScope(_.P)&&e._closePElement(),e._appendElement(t,Se.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function C9(e,t){t.tagName=te.IMG,t.tagID=_.IMG,F3(e,t)}function S9(e,t){e._insertElement(t,Se.HTML),e.skipNextNewLine=!0,e.tokenizer.state=Sn.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=V.TEXT}function A9(e,t){e.openElements.hasInButtonScope(_.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,Sn.RAWTEXT)}function N9(e,t){e.framesetOk=!1,e._switchToTextParsing(t,Sn.RAWTEXT)}function Z2(e,t){e._switchToTextParsing(t,Sn.RAWTEXT)}function R9(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Se.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===V.IN_TABLE||e.insertionMode===V.IN_CAPTION||e.insertionMode===V.IN_TABLE_BODY||e.insertionMode===V.IN_ROW||e.insertionMode===V.IN_CELL?V.IN_SELECT_IN_TABLE:V.IN_SELECT}function L9(e,t){e.openElements.currentTagId===_.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,Se.HTML)}function I9(e,t){e.openElements.hasInScope(_.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,Se.HTML)}function O9(e,t){e.openElements.hasInScope(_.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(_.RTC),e._insertElement(t,Se.HTML)}function D9(e,t){e._reconstructActiveFormattingElements(),P3(t),Jg(t),t.selfClosing?e._appendElement(t,Se.MATHML):e._insertElement(t,Se.MATHML),t.ackSelfClosing=!0}function j9(e,t){e._reconstructActiveFormattingElements(),B3(t),Jg(t),t.selfClosing?e._appendElement(t,Se.SVG):e._insertElement(t,Se.SVG),t.ackSelfClosing=!0}function J2(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Se.HTML)}function sr(e,t){switch(t.tagID){case _.I:case _.S:case _.B:case _.U:case _.EM:case _.TT:case _.BIG:case _.CODE:case _.FONT:case _.SMALL:case _.STRIKE:case _.STRONG:{y9(e,t);break}case _.A:{x9(e,t);break}case _.H1:case _.H2:case _.H3:case _.H4:case _.H5:case _.H6:{f9(e,t);break}case _.P:case _.DL:case _.OL:case _.UL:case _.DIV:case _.DIR:case _.NAV:case _.MAIN:case _.MENU:case _.ASIDE:case _.CENTER:case _.FIGURE:case _.FOOTER:case _.HEADER:case _.HGROUP:case _.DIALOG:case _.DETAILS:case _.ADDRESS:case _.ARTICLE:case _.SEARCH:case _.SECTION:case _.SUMMARY:case _.FIELDSET:case _.BLOCKQUOTE:case _.FIGCAPTION:{d9(e,t);break}case _.LI:case _.DD:case _.DT:{p9(e,t);break}case _.BR:case _.IMG:case _.WBR:case _.AREA:case _.EMBED:case _.KEYGEN:{F3(e,t);break}case _.HR:{k9(e,t);break}case _.RB:case _.RTC:{I9(e,t);break}case _.RT:case _.RP:{O9(e,t);break}case _.PRE:case _.LISTING:{h9(e,t);break}case _.XMP:{A9(e,t);break}case _.SVG:{j9(e,t);break}case _.HTML:{o9(e,t);break}case _.BASE:case _.LINK:case _.META:case _.STYLE:case _.TITLE:case _.SCRIPT:case _.BGSOUND:case _.BASEFONT:case _.TEMPLATE:{ka(e,t);break}case _.BODY:{u9(e,t);break}case _.FORM:{m9(e,t);break}case _.NOBR:{E9(e,t);break}case _.MATH:{D9(e,t);break}case _.TABLE:{T9(e,t);break}case _.INPUT:{v9(e,t);break}case _.PARAM:case _.TRACK:case _.SOURCE:{w9(e,t);break}case _.IMAGE:{C9(e,t);break}case _.BUTTON:{b9(e,t);break}case _.APPLET:case _.OBJECT:case _.MARQUEE:{_9(e,t);break}case _.IFRAME:{N9(e,t);break}case _.SELECT:{R9(e,t);break}case _.OPTION:case _.OPTGROUP:{L9(e,t);break}case _.NOEMBED:case _.NOFRAMES:{Z2(e,t);break}case _.FRAMESET:{c9(e,t);break}case _.TEXTAREA:{S9(e,t);break}case _.NOSCRIPT:{e.options.scriptingEnabled?Z2(e,t):J2(e,t);break}case _.PLAINTEXT:{g9(e,t);break}case _.COL:case _.TH:case _.TD:case _.TR:case _.HEAD:case _.FRAME:case _.TBODY:case _.TFOOT:case _.THEAD:case _.CAPTION:case _.COLGROUP:break;default:J2(e,t)}}function M9(e,t){if(e.openElements.hasInScope(_.BODY)&&(e.insertionMode=V.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function P9(e,t){e.openElements.hasInScope(_.BODY)&&(e.insertionMode=V.AFTER_BODY,J3(e,t))}function B9(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function U9(e){const t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(_.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(_.FORM):n&&e.openElements.remove(n))}function H9(e){e.openElements.hasInButtonScope(_.P)||e._insertFakeElement(te.P,_.P),e._closePElement()}function z9(e){e.openElements.hasInListItemScope(_.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(_.LI),e.openElements.popUntilTagNamePopped(_.LI))}function F9(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function $9(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function V9(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function G9(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(te.BR,_.BR),e.openElements.pop(),e.framesetOk=!1}function V3(e,t){const n=t.tagName,r=t.tagID;for(let s=e.openElements.stackTop;s>0;s--){const l=e.openElements.items[s],o=e.openElements.tagIDs[s];if(r===o&&(r!==_.UNKNOWN||e.treeAdapter.getTagName(l)===n)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.stackTop>=s&&e.openElements.shortenToLength(s);break}if(e._isSpecialElement(l,o))break}}function th(e,t){switch(t.tagID){case _.A:case _.B:case _.I:case _.S:case _.U:case _.EM:case _.TT:case _.BIG:case _.CODE:case _.FONT:case _.NOBR:case _.SMALL:case _.STRIKE:case _.STRONG:{e1(e,t);break}case _.P:{H9(e);break}case _.DL:case _.UL:case _.OL:case _.DIR:case _.DIV:case _.NAV:case _.PRE:case _.MAIN:case _.MENU:case _.ASIDE:case _.BUTTON:case _.CENTER:case _.FIGURE:case _.FOOTER:case _.HEADER:case _.HGROUP:case _.DIALOG:case _.ADDRESS:case _.ARTICLE:case _.DETAILS:case _.SEARCH:case _.SECTION:case _.SUMMARY:case _.LISTING:case _.FIELDSET:case _.BLOCKQUOTE:case _.FIGCAPTION:{B9(e,t);break}case _.LI:{z9(e);break}case _.DD:case _.DT:{F9(e,t);break}case _.H1:case _.H2:case _.H3:case _.H4:case _.H5:case _.H6:{$9(e);break}case _.BR:{G9(e);break}case _.BODY:{M9(e,t);break}case _.HTML:{P9(e,t);break}case _.FORM:{U9(e);break}case _.APPLET:case _.OBJECT:case _.MARQUEE:{V9(e,t);break}case _.TEMPLATE:{pl(e,t);break}default:V3(e,t)}}function G3(e,t){e.tmplInsertionModeStack.length>0?Z3(e,t):t1(e,t)}function q9(e,t){var n;t.tagID===_.SCRIPT&&((n=e.scriptHandler)===null||n===void 0||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function Y9(e,t){e._err(t,he.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function qp(e,t){if(e.openElements.currentTagId!==void 0&&U3.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=V.IN_TABLE_TEXT,t.type){case Lt.CHARACTER:{Y3(e,t);break}case Lt.WHITESPACE_CHARACTER:{q3(e,t);break}}else xc(e,t)}function W9(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,Se.HTML),e.insertionMode=V.IN_CAPTION}function Q9(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,Se.HTML),e.insertionMode=V.IN_COLUMN_GROUP}function X9(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(te.COLGROUP,_.COLGROUP),e.insertionMode=V.IN_COLUMN_GROUP,n1(e,t)}function K9(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,Se.HTML),e.insertionMode=V.IN_TABLE_BODY}function Z9(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(te.TBODY,_.TBODY),e.insertionMode=V.IN_TABLE_BODY,nh(e,t)}function J9(e,t){e.openElements.hasInTableScope(_.TABLE)&&(e.openElements.popUntilTagNamePopped(_.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function ej(e,t){$3(t)?e._appendElement(t,Se.HTML):xc(e,t),t.ackSelfClosing=!0}function tj(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,Se.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function Eo(e,t){switch(t.tagID){case _.TD:case _.TH:case _.TR:{Z9(e,t);break}case _.STYLE:case _.SCRIPT:case _.TEMPLATE:{ka(e,t);break}case _.COL:{X9(e,t);break}case _.FORM:{tj(e,t);break}case _.TABLE:{J9(e,t);break}case _.TBODY:case _.TFOOT:case _.THEAD:{K9(e,t);break}case _.INPUT:{ej(e,t);break}case _.CAPTION:{W9(e,t);break}case _.COLGROUP:{Q9(e,t);break}default:xc(e,t)}}function lc(e,t){switch(t.tagID){case _.TABLE:{e.openElements.hasInTableScope(_.TABLE)&&(e.openElements.popUntilTagNamePopped(_.TABLE),e._resetInsertionMode());break}case _.TEMPLATE:{pl(e,t);break}case _.BODY:case _.CAPTION:case _.COL:case _.COLGROUP:case _.HTML:case _.TBODY:case _.TD:case _.TFOOT:case _.TH:case _.THEAD:case _.TR:break;default:xc(e,t)}}function xc(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,eh(e,t),e.fosterParentingEnabled=n}function q3(e,t){e.pendingCharacterTokens.push(t)}function Y3(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function Au(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n<e.pendingCharacterTokens.length;n++)xc(e,e.pendingCharacterTokens[n]);else for(;n<e.pendingCharacterTokens.length;n++)e._insertCharacters(e.pendingCharacterTokens[n]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}const W3=new Set([_.CAPTION,_.COL,_.COLGROUP,_.TBODY,_.TD,_.TFOOT,_.TH,_.THEAD,_.TR]);function nj(e,t){const n=t.tagID;W3.has(n)?e.openElements.hasInTableScope(_.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(_.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=V.IN_TABLE,Eo(e,t)):sr(e,t)}function rj(e,t){const n=t.tagID;switch(n){case _.CAPTION:case _.TABLE:{e.openElements.hasInTableScope(_.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(_.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=V.IN_TABLE,n===_.TABLE&&lc(e,t));break}case _.BODY:case _.COL:case _.COLGROUP:case _.HTML:case _.TBODY:case _.TD:case _.TFOOT:case _.TH:case _.THEAD:case _.TR:break;default:th(e,t)}}function n1(e,t){switch(t.tagID){case _.HTML:{sr(e,t);break}case _.COL:{e._appendElement(t,Se.HTML),t.ackSelfClosing=!0;break}case _.TEMPLATE:{ka(e,t);break}default:Af(e,t)}}function aj(e,t){switch(t.tagID){case _.COLGROUP:{e.openElements.currentTagId===_.COLGROUP&&(e.openElements.pop(),e.insertionMode=V.IN_TABLE);break}case _.TEMPLATE:{pl(e,t);break}case _.COL:break;default:Af(e,t)}}function Af(e,t){e.openElements.currentTagId===_.COLGROUP&&(e.openElements.pop(),e.insertionMode=V.IN_TABLE,e._processToken(t))}function nh(e,t){switch(t.tagID){case _.TR:{e.openElements.clearBackToTableBodyContext(),e._insertElement(t,Se.HTML),e.insertionMode=V.IN_ROW;break}case _.TH:case _.TD:{e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(te.TR,_.TR),e.insertionMode=V.IN_ROW,rh(e,t);break}case _.CAPTION:case _.COL:case _.COLGROUP:case _.TBODY:case _.TFOOT:case _.THEAD:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=V.IN_TABLE,Eo(e,t));break}default:Eo(e,t)}}function q0(e,t){const n=t.tagID;switch(t.tagID){case _.TBODY:case _.TFOOT:case _.THEAD:{e.openElements.hasInTableScope(n)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=V.IN_TABLE);break}case _.TABLE:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=V.IN_TABLE,lc(e,t));break}case _.BODY:case _.CAPTION:case _.COL:case _.COLGROUP:case _.HTML:case _.TD:case _.TH:case _.TR:break;default:lc(e,t)}}function rh(e,t){switch(t.tagID){case _.TH:case _.TD:{e.openElements.clearBackToTableRowContext(),e._insertElement(t,Se.HTML),e.insertionMode=V.IN_CELL,e.activeFormattingElements.insertMarker();break}case _.CAPTION:case _.COL:case _.COLGROUP:case _.TBODY:case _.TFOOT:case _.THEAD:case _.TR:{e.openElements.hasInTableScope(_.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=V.IN_TABLE_BODY,nh(e,t));break}default:Eo(e,t)}}function Q3(e,t){switch(t.tagID){case _.TR:{e.openElements.hasInTableScope(_.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=V.IN_TABLE_BODY);break}case _.TABLE:{e.openElements.hasInTableScope(_.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=V.IN_TABLE_BODY,q0(e,t));break}case _.TBODY:case _.TFOOT:case _.THEAD:{(e.openElements.hasInTableScope(t.tagID)||e.openElements.hasInTableScope(_.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=V.IN_TABLE_BODY,q0(e,t));break}case _.BODY:case _.CAPTION:case _.COL:case _.COLGROUP:case _.HTML:case _.TD:case _.TH:break;default:lc(e,t)}}function ij(e,t){const n=t.tagID;W3.has(n)?(e.openElements.hasInTableScope(_.TD)||e.openElements.hasInTableScope(_.TH))&&(e._closeTableCell(),rh(e,t)):sr(e,t)}function sj(e,t){const n=t.tagID;switch(n){case _.TD:case _.TH:{e.openElements.hasInTableScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=V.IN_ROW);break}case _.TABLE:case _.TBODY:case _.TFOOT:case _.THEAD:case _.TR:{e.openElements.hasInTableScope(n)&&(e._closeTableCell(),Q3(e,t));break}case _.BODY:case _.CAPTION:case _.COL:case _.COLGROUP:case _.HTML:break;default:th(e,t)}}function X3(e,t){switch(t.tagID){case _.HTML:{sr(e,t);break}case _.OPTION:{e.openElements.currentTagId===_.OPTION&&e.openElements.pop(),e._insertElement(t,Se.HTML);break}case _.OPTGROUP:{e.openElements.currentTagId===_.OPTION&&e.openElements.pop(),e.openElements.currentTagId===_.OPTGROUP&&e.openElements.pop(),e._insertElement(t,Se.HTML);break}case _.HR:{e.openElements.currentTagId===_.OPTION&&e.openElements.pop(),e.openElements.currentTagId===_.OPTGROUP&&e.openElements.pop(),e._appendElement(t,Se.HTML),t.ackSelfClosing=!0;break}case _.INPUT:case _.KEYGEN:case _.TEXTAREA:case _.SELECT:{e.openElements.hasInSelectScope(_.SELECT)&&(e.openElements.popUntilTagNamePopped(_.SELECT),e._resetInsertionMode(),t.tagID!==_.SELECT&&e._processStartTag(t));break}case _.SCRIPT:case _.TEMPLATE:{ka(e,t);break}}}function K3(e,t){switch(t.tagID){case _.OPTGROUP:{e.openElements.stackTop>0&&e.openElements.currentTagId===_.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===_.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===_.OPTGROUP&&e.openElements.pop();break}case _.OPTION:{e.openElements.currentTagId===_.OPTION&&e.openElements.pop();break}case _.SELECT:{e.openElements.hasInSelectScope(_.SELECT)&&(e.openElements.popUntilTagNamePopped(_.SELECT),e._resetInsertionMode());break}case _.TEMPLATE:{pl(e,t);break}}}function lj(e,t){const n=t.tagID;n===_.CAPTION||n===_.TABLE||n===_.TBODY||n===_.TFOOT||n===_.THEAD||n===_.TR||n===_.TD||n===_.TH?(e.openElements.popUntilTagNamePopped(_.SELECT),e._resetInsertionMode(),e._processStartTag(t)):X3(e,t)}function oj(e,t){const n=t.tagID;n===_.CAPTION||n===_.TABLE||n===_.TBODY||n===_.TFOOT||n===_.THEAD||n===_.TR||n===_.TD||n===_.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(_.SELECT),e._resetInsertionMode(),e.onEndTag(t)):K3(e,t)}function uj(e,t){switch(t.tagID){case _.BASE:case _.BASEFONT:case _.BGSOUND:case _.LINK:case _.META:case _.NOFRAMES:case _.SCRIPT:case _.STYLE:case _.TEMPLATE:case _.TITLE:{ka(e,t);break}case _.CAPTION:case _.COLGROUP:case _.TBODY:case _.TFOOT:case _.THEAD:{e.tmplInsertionModeStack[0]=V.IN_TABLE,e.insertionMode=V.IN_TABLE,Eo(e,t);break}case _.COL:{e.tmplInsertionModeStack[0]=V.IN_COLUMN_GROUP,e.insertionMode=V.IN_COLUMN_GROUP,n1(e,t);break}case _.TR:{e.tmplInsertionModeStack[0]=V.IN_TABLE_BODY,e.insertionMode=V.IN_TABLE_BODY,nh(e,t);break}case _.TD:case _.TH:{e.tmplInsertionModeStack[0]=V.IN_ROW,e.insertionMode=V.IN_ROW,rh(e,t);break}default:e.tmplInsertionModeStack[0]=V.IN_BODY,e.insertionMode=V.IN_BODY,sr(e,t)}}function cj(e,t){t.tagID===_.TEMPLATE&&pl(e,t)}function Z3(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(_.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):t1(e,t)}function dj(e,t){t.tagID===_.HTML?sr(e,t):Nf(e,t)}function J3(e,t){var n;if(t.tagID===_.HTML){if(e.fragmentContext||(e.insertionMode=V.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===_.HTML){e._setEndLocation(e.openElements.items[0],t);const r=e.openElements.items[1];r&&!(!((n=e.treeAdapter.getNodeSourceCodeLocation(r))===null||n===void 0)&&n.endTag)&&e._setEndLocation(r,t)}}else Nf(e,t)}function Nf(e,t){e.insertionMode=V.IN_BODY,eh(e,t)}function fj(e,t){switch(t.tagID){case _.HTML:{sr(e,t);break}case _.FRAMESET:{e._insertElement(t,Se.HTML);break}case _.FRAME:{e._appendElement(t,Se.HTML),t.ackSelfClosing=!0;break}case _.NOFRAMES:{ka(e,t);break}}}function hj(e,t){t.tagID===_.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==_.FRAMESET&&(e.insertionMode=V.AFTER_FRAMESET))}function mj(e,t){switch(t.tagID){case _.HTML:{sr(e,t);break}case _.NOFRAMES:{ka(e,t);break}}}function pj(e,t){t.tagID===_.HTML&&(e.insertionMode=V.AFTER_AFTER_FRAMESET)}function gj(e,t){t.tagID===_.HTML?sr(e,t):uf(e,t)}function uf(e,t){e.insertionMode=V.IN_BODY,eh(e,t)}function bj(e,t){switch(t.tagID){case _.HTML:{sr(e,t);break}case _.NOFRAMES:{ka(e,t);break}}}function xj(e,t){t.chars=bn,e._insertCharacters(t)}function yj(e,t){e._insertCharacters(t),e.framesetOk=!1}function ew(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==Se.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function Ej(e,t){if(jD(t))ew(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===Se.MATHML?P3(t):r===Se.SVG&&(MD(t),B3(t)),Jg(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function _j(e,t){if(t.tagID===_.P||t.tagID===_.BR){ew(e),e._endTagOutsideForeignContent(t);return}for(let n=e.openElements.stackTop;n>0;n--){const r=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(r)===Se.HTML){e._endTagOutsideForeignContent(t);break}const s=e.treeAdapter.getTagName(r);if(s.toLowerCase()===t.tagName){t.tagName=s,e.openElements.shortenToLength(n);break}}}te.AREA,te.BASE,te.BASEFONT,te.BGSOUND,te.BR,te.COL,te.EMBED,te.FRAME,te.HR,te.IMG,te.INPUT,te.KEYGEN,te.LINK,te.META,te.PARAM,te.SOURCE,te.TRACK,te.WBR;const ah=tw("end"),Ga=tw("start");function tw(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 nw(e){const t=Ga(e),n=ah(e);if(t&&n)return{start:t,end:n}}const Tj=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,vj=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),e_={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function rw(e,t){const n=Oj(e),r=Ng("type",{handlers:{root:wj,element:kj,text:Cj,comment:iw,doctype:Sj,raw:Nj},unknown:Rj}),s={parser:n?new K2(e_):K2.getFragmentParser(void 0,e_),handle(c){r(c,s)},stitches:!1,options:t||{}};r(e,s),Oo(s,Ga());const l=n?s.parser.document:s.parser.getFragment(),o=j8(l,{file:s.options.file});return s.stitches&&$a(o,"comment",function(c,d,m){const p=c;if(p.value.stitch&&m&&d!==void 0){const g=m.children;return g[d]=p.value.stitch,d}}),o.type==="root"&&o.children.length===1&&o.children[0].type===e.type?o.children[0]:o}function aw(e,t){let n=-1;if(e)for(;++n<e.length;)t.handle(e[n])}function wj(e,t){aw(e.children,t)}function kj(e,t){Lj(e,t),aw(e.children,t),Ij(e,t)}function Cj(e,t){t.parser.tokenizer.state>4&&(t.parser.tokenizer.state=0);const n={type:Lt.CHARACTER,chars:e.value,location:yc(e)};Oo(t,Ga(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function Sj(e,t){const n={type:Lt.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:yc(e)};Oo(t,Ga(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function Aj(e,t){t.stitches=!0;const n=Dj(e);if("children"in e&&"children"in n){const r=rw({type:"root",children:e.children},t.options);n.children=r.children}iw({type:"comment",value:{stitch:n}},t)}function iw(e,t){const n=e.value,r={type:Lt.COMMENT,data:n,location:yc(e)};Oo(t,Ga(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function Nj(e,t){if(t.parser.tokenizer.preprocessor.html="",t.parser.tokenizer.preprocessor.pos=-1,t.parser.tokenizer.preprocessor.lastGapPos=-2,t.parser.tokenizer.preprocessor.gapStack=[],t.parser.tokenizer.preprocessor.skipNextNewLine=!1,t.parser.tokenizer.preprocessor.lastChunkWritten=!1,t.parser.tokenizer.preprocessor.endOfChunkHit=!1,t.parser.tokenizer.preprocessor.isEol=!1,sw(t,Ga(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(Tj,"<$1$2"):e.value,!1),t.parser.tokenizer._runParsingLoop(),t.parser.tokenizer.state===72||t.parser.tokenizer.state===78){t.parser.tokenizer.preprocessor.lastChunkWritten=!0;const n=t.parser.tokenizer._consume();t.parser.tokenizer._callState(n)}}function Rj(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))Aj(n,t);else{let r="";throw vj.has(n.type)&&(r=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),new Error("Cannot compile `"+n.type+"` node"+r)}}function Oo(e,t){sw(e,t);const n=e.parser.tokenizer.currentCharacterToken;n&&n.location&&(n.location.endLine=e.parser.tokenizer.preprocessor.line,n.location.endCol=e.parser.tokenizer.preprocessor.col+1,n.location.endOffset=e.parser.tokenizer.preprocessor.offset+1,e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)),e.parser.tokenizer.paused=!1,e.parser.tokenizer.inLoop=!1,e.parser.tokenizer.active=!1,e.parser.tokenizer.returnState=Sn.DATA,e.parser.tokenizer.charRefCode=-1,e.parser.tokenizer.consumedAfterSnapshot=-1,e.parser.tokenizer.currentLocation=null,e.parser.tokenizer.currentCharacterToken=null,e.parser.tokenizer.currentToken=null,e.parser.tokenizer.currentAttr={name:"",value:""}}function sw(e,t){if(t&&t.offset!==void 0){const n={startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:-1,endCol:-1,endOffset:-1};e.parser.tokenizer.preprocessor.lineStartPos=-t.column+1,e.parser.tokenizer.preprocessor.droppedBufferSize=t.offset,e.parser.tokenizer.preprocessor.line=t.line,e.parser.tokenizer.currentLocation=n}}function Lj(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===Sn.PLAINTEXT)return;Oo(t,Ga(e));const r=t.parser.openElements.current;let s="namespaceURI"in r?r.namespaceURI:sl.html;s===sl.html&&n==="svg"&&(s=sl.svg);const l=H8({...e,children:[]},{space:s===sl.svg?"svg":"html"}),o={type:Lt.START_TAG,tagName:n,tagID:Io(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in l?l.attrs:[],location:yc(e)};t.parser.currentToken=o,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function Ij(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&wv.includes(n)||t.parser.tokenizer.state===Sn.PLAINTEXT)return;Oo(t,ah(e));const r={type:Lt.END_TAG,tagName:n,tagID:Io(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:yc(e)};t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===Sn.RCDATA||t.parser.tokenizer.state===Sn.RAWTEXT||t.parser.tokenizer.state===Sn.SCRIPT_DATA)&&(t.parser.tokenizer.state=Sn.DATA)}function Oj(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function yc(e){const t=Ga(e)||{line:void 0,column:void 0,offset:void 0},n=ah(e)||{line:void 0,column:void 0,offset:void 0};return{startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:n.line,endCol:n.column,endOffset:n.offset}}function Dj(e){return"children"in e?dl({...e,children:[]}):dl(e)}function Y0(e){return function(t,n){return rw(t,{...e,file:n})}}const Zs=["ariaDescribedBy","ariaLabel","ariaLabelledBy"],nl={ancestors:{tbody:["table"],td:["table"],th:["table"],thead:["table"],tfoot:["table"],tr:["table"]},attributes:{a:[...Zs,"dataFootnoteBackref","dataFootnoteRef",["className","data-footnote-backref"],"href"],blockquote:["cite"],code:[["className",/^language-./]],del:["cite"],div:["itemScope","itemType"],dl:[...Zs],h2:[["className","sr-only"]],img:[...Zs,"longDesc","src"],input:[["disabled",!0],["type","checkbox"]],ins:["cite"],li:[["className","task-list-item"]],ol:[...Zs,["className","contains-task-list"]],q:["cite"],section:["dataFootnotes",["className","footnotes"]],source:["srcSet"],summary:[...Zs],table:[...Zs],ul:[...Zs,["className","contains-task-list"]],"*":["abbr","accept","acceptCharset","accessKey","action","align","alt","axis","border","cellPadding","cellSpacing","char","charOff","charSet","checked","clear","colSpan","color","cols","compact","coords","dateTime","dir","encType","frame","hSpace","headers","height","hrefLang","htmlFor","id","isMap","itemProp","label","lang","maxLength","media","method","multiple","name","noHref","noShade","noWrap","open","prompt","readOnly","rev","rowSpan","rows","rules","scope","selected","shape","size","span","start","summary","tabIndex","title","useMap","vAlign","value","width"]},clobber:["ariaDescribedBy","ariaLabelledBy","id","name"],clobberPrefix:"user-content-",protocols:{cite:["http","https"],href:["http","https","irc","ircs","mailto","xmpp"],longDesc:["http","https"],src:["http","https"]},required:{input:{disabled:!0,type:"checkbox"}},strip:["script"],tagNames:["a","b","blockquote","br","code","dd","del","details","div","dl","dt","em","h1","h2","h3","h4","h5","h6","hr","i","img","input","ins","kbd","li","ol","p","picture","pre","q","rp","rt","ruby","s","samp","section","source","span","strike","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","tr","tt","ul","var"]},gs={}.hasOwnProperty;function jj(e,t){let n={type:"root",children:[]};const r={schema:t?{...nl,...t}:nl,stack:[]},s=lw(r,e);return s&&(Array.isArray(s)?s.length===1?n=s[0]:n.children=s:n=s),n}function lw(e,t){if(t&&typeof t=="object"){const n=t;switch(typeof n.type=="string"?n.type:""){case"comment":return Mj(e,n);case"doctype":return Pj(e,n);case"element":return Bj(e,n);case"root":return Uj(e,n);case"text":return Hj(e,n)}}}function Mj(e,t){if(e.schema.allowComments){const n=typeof t.value=="string"?t.value:"",r=n.indexOf("-->"),l={type:"comment",value:r<0?n:n.slice(0,r)};return Ec(l,t),l}}function Pj(e,t){if(e.schema.allowDoctypes){const n={type:"doctype"};return Ec(n,t),n}}function Bj(e,t){const n=typeof t.tagName=="string"?t.tagName:"";e.stack.push(n);const r=ow(e,t.children),s=zj(e,t.properties);e.stack.pop();let l=!1;if(n&&n!=="*"&&(!e.schema.tagNames||e.schema.tagNames.includes(n))&&(l=!0,e.schema.ancestors&&gs.call(e.schema.ancestors,n))){const c=e.schema.ancestors[n];let d=-1;for(l=!1;++d<c.length;)e.stack.includes(c[d])&&(l=!0)}if(!l)return e.schema.strip&&!e.schema.strip.includes(n)?r:void 0;const o={type:"element",tagName:n,properties:s,children:r};return Ec(o,t),o}function Uj(e,t){const r={type:"root",children:ow(e,t.children)};return Ec(r,t),r}function Hj(e,t){const r={type:"text",value:typeof t.value=="string"?t.value:""};return Ec(r,t),r}function ow(e,t){const n=[];if(Array.isArray(t)){const r=t;let s=-1;for(;++s<r.length;){const l=lw(e,r[s]);l&&(Array.isArray(l)?n.push(...l):n.push(l))}}return n}function zj(e,t){const n=e.stack[e.stack.length-1],r=e.schema.attributes,s=e.schema.required,l=r&&gs.call(r,n)?r[n]:void 0,o=r&&gs.call(r,"*")?r["*"]:void 0,c=t&&typeof t=="object"?t:{},d={};let m;for(m in c)if(gs.call(c,m)){const p=c[m];let g=t_(e,n_(l,m),m,p);g==null&&(g=t_(e,n_(o,m),m,p)),g!=null&&(d[m]=g)}if(s&&gs.call(s,n)){const p=s[n];for(m in p)gs.call(p,m)&&!gs.call(d,m)&&(d[m]=p[m])}return d}function t_(e,t,n,r){return t?Array.isArray(r)?Fj(e,t,n,r):uw(e,t,n,r):void 0}function Fj(e,t,n,r){let s=-1;const l=[];for(;++s<r.length;){const o=uw(e,t,n,r[s]);(typeof o=="number"||typeof o=="string")&&l.push(o)}return l}function uw(e,t,n,r){if(!(typeof r!="boolean"&&typeof r!="number"&&typeof r!="string")&&$j(e,n,r)){if(typeof t=="object"&&t.length>1){let s=!1,l=0;for(;++l<t.length;){const o=t[l];if(o&&typeof o=="object"&&"flags"in o){if(o.test(String(r))){s=!0;break}}else if(o===r){s=!0;break}}if(!s)return}return e.schema.clobber&&e.schema.clobberPrefix&&e.schema.clobber.includes(n)?e.schema.clobberPrefix+r:r}}function $j(e,t,n){const r=e.schema.protocols&&gs.call(e.schema.protocols,t)?e.schema.protocols[t]:void 0;if(!r||r.length===0)return!0;const s=String(n),l=s.indexOf(":"),o=s.indexOf("?"),c=s.indexOf("#"),d=s.indexOf("/");if(l<0||d>-1&&l>d||o>-1&&l>o||c>-1&&l>c)return!0;let m=-1;for(;++m<r.length;){const p=r[m];if(l===p.length&&s.slice(0,p.length)===p)return!0}return!1}function Ec(e,t){const n=nw(t);t.data&&(e.data=dl(t.data)),n&&(e.position=n)}function n_(e,t){let n,r=-1;if(e)for(;++r<e.length;){const s=e[r],l=typeof s=="string"?s:s[0];if(l===t)return s;l==="data*"&&(n=s)}if(t.length>4&&t.slice(0,4).toLowerCase()==="data")return n}function cw(e){return function(t){return jj(t,e)}}const fr=ks(/[A-Za-z]/),ir=ks(/[\dA-Za-z]/),Vj=ks(/[#-'*+\--9=?A-Z^-~]/);function Rf(e){return e!==null&&(e<32||e===127)}const W0=ks(/\d/),Gj=ks(/[\dA-Fa-f]/),qj=ks(/[!-/:-@[-`{-~]/);function st(e){return e!==null&&e<-2}function ln(e){return e!==null&&(e<0||e===32)}function jt(e){return e===-2||e===-1||e===32}const ih=ks(new RegExp("\\p{P}|\\p{S}","u")),fl=ks(/\s/);function ks(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Yj(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Wj(e,t,n){const s=Kf((n||{}).ignore||[]),l=Qj(t);let o=-1;for(;++o<l.length;)qg(e,"text",c);function c(m,p){let g=-1,y;for(;++g<p.length;){const E=p[g],v=y?y.children:void 0;if(s(E,v?v.indexOf(E):void 0,y))return;y=E}if(y)return d(m,p)}function d(m,p){const g=p[p.length-1],y=l[o][0],E=l[o][1];let v=0;const C=g.children.indexOf(m);let S=!1,A=[];y.lastIndex=0;let N=y.exec(m.value);for(;N;){const U=N.index,G={index:N.index,input:N.input,stack:[...p,m]};let P=E(...N,G);if(typeof P=="string"&&(P=P.length>0?{type:"text",value:P}:void 0),P===!1?y.lastIndex=U+1:(v!==U&&A.push({type:"text",value:m.value.slice(v,U)}),Array.isArray(P)?A.push(...P):P&&A.push(P),v=U+N[0].length,S=!0),!y.global)break;N=y.exec(m.value)}return S?(v<m.value.length&&A.push({type:"text",value:m.value.slice(v)}),g.children.splice(C,1,...A)):A=[m],C+A.length}}function Qj(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([Xj(s[0]),Kj(s[1])])}return t}function Xj(e){return typeof e=="string"?new RegExp(Yj(e),"g"):e}function Kj(e){return typeof e=="function"?e:function(){return e}}const Yp="phrasing",Wp=["autolink","link","image","label"];function Zj(){return{transforms:[iM],enter:{literalAutolink:eM,literalAutolinkEmail:Qp,literalAutolinkHttp:Qp,literalAutolinkWww:Qp},exit:{literalAutolink:aM,literalAutolinkEmail:rM,literalAutolinkHttp:tM,literalAutolinkWww:nM}}}function Jj(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Yp,notInConstruct:Wp},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Yp,notInConstruct:Wp},{character:":",before:"[ps]",after:"\\/",inConstruct:Yp,notInConstruct:Wp}]}}function eM(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Qp(e){this.config.enter.autolinkProtocol.call(this,e)}function tM(e){this.config.exit.autolinkProtocol.call(this,e)}function nM(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 rM(e){this.config.exit.autolinkEmail.call(this,e)}function aM(e){this.exit(e)}function iM(e){Wj(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,sM],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),lM]],{ignore:["link","linkReference"]})}function sM(e,t,n,r,s){let l="";if(!dw(s)||(/^w/i.test(t)&&(n=t+n,t="",l="http://"),!oM(n)))return!1;const o=uM(n+r);if(!o[0])return!1;const c={type:"link",title:null,url:l+t+o[0],children:[{type:"text",value:t+o[0]}]};return o[1]?[c,{type:"text",value:o[1]}]:c}function lM(e,t,n,r){return!dw(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function oM(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 uM(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=xf(e,"(");let l=xf(e,")");for(;r!==-1&&s>l;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),l++;return[e,n]}function dw(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||fl(n)||ih(n))&&(!t||n!==47)}function Ta(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}fw.peek=xM;function cM(){this.buffer()}function dM(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function fM(){this.buffer()}function hM(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function mM(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ta(this.sliceSerialize(e)).toLowerCase(),n.label=t}function pM(e){this.exit(e)}function gM(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ta(this.sliceSerialize(e)).toLowerCase(),n.label=t}function bM(e){this.exit(e)}function xM(){return"["}function fw(e,t,n,r){const s=n.createTracker(r);let l=s.move("[^");const o=n.enter("footnoteReference"),c=n.enter("reference");return l+=s.move(n.safe(n.associationId(e),{after:"]",before:l})),c(),o(),l+=s.move("]"),l}function yM(){return{enter:{gfmFootnoteCallString:cM,gfmFootnoteCall:dM,gfmFootnoteDefinitionLabelString:fM,gfmFootnoteDefinition:hM},exit:{gfmFootnoteCallString:mM,gfmFootnoteCall:pM,gfmFootnoteDefinitionLabelString:gM,gfmFootnoteDefinition:bM}}}function EM(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:fw},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,s,l,o){const c=l.createTracker(o);let d=c.move("[^");const m=l.enter("footnoteDefinition"),p=l.enter("label");return d+=c.move(l.safe(l.associationId(r),{before:d,after:"]"})),p(),d+=c.move("]:"),r.children&&r.children.length>0&&(c.shift(4),d+=c.move((t?`
|
|
245
|
+
`:" ")+l.indentLines(l.containerFlow(r,c.current()),t?hw:_M))),m(),d}}function _M(e,t,n){return t===0?e:hw(e,t,n)}function hw(e,t,n){return(n?"":" ")+e}const TM=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];mw.peek=SM;function vM(){return{canContainEols:["delete"],enter:{strikethrough:kM},exit:{strikethrough:CM}}}function wM(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:TM}],handlers:{delete:mw}}}function kM(e){this.enter({type:"delete",children:[]},e)}function CM(e){this.exit(e)}function mw(e,t,n,r){const s=n.createTracker(r),l=n.enter("strikethrough");let o=s.move("~~");return o+=n.containerPhrasing(e,{...s.current(),before:o,after:"~"}),o+=s.move("~~"),l(),o}function SM(){return"~"}function AM(e){return e.length}function NM(e,t){const n=t||{},r=(n.align||[]).concat(),s=n.stringLength||AM,l=[],o=[],c=[],d=[];let m=0,p=-1;for(;++p<e.length;){const k=[],C=[];let S=-1;for(e[p].length>m&&(m=e[p].length);++S<e[p].length;){const A=RM(e[p][S]);if(n.alignDelimiters!==!1){const N=s(A);C[S]=N,(d[S]===void 0||N>d[S])&&(d[S]=N)}k.push(A)}o[p]=k,c[p]=C}let g=-1;if(typeof r=="object"&&"length"in r)for(;++g<m;)l[g]=r_(r[g]);else{const k=r_(r);for(;++g<m;)l[g]=k}g=-1;const y=[],E=[];for(;++g<m;){const k=l[g];let C="",S="";k===99?(C=":",S=":"):k===108?C=":":k===114&&(S=":");let A=n.alignDelimiters===!1?1:Math.max(1,d[g]-C.length-S.length);const N=C+"-".repeat(A)+S;n.alignDelimiters!==!1&&(A=C.length+A+S.length,A>d[g]&&(d[g]=A),E[g]=A),y[g]=N}o.splice(1,0,y),c.splice(1,0,E),p=-1;const v=[];for(;++p<o.length;){const k=o[p],C=c[p];g=-1;const S=[];for(;++g<m;){const A=k[g]||"";let N="",U="";if(n.alignDelimiters!==!1){const G=d[g]-(C[g]||0),P=l[g];P===114?N=" ".repeat(G):P===99?G%2?(N=" ".repeat(G/2+.5),U=" ".repeat(G/2-.5)):(N=" ".repeat(G/2),U=N):U=" ".repeat(G)}n.delimiterStart!==!1&&!g&&S.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&A==="")&&(n.delimiterStart!==!1||g)&&S.push(" "),n.alignDelimiters!==!1&&S.push(N),S.push(A),n.alignDelimiters!==!1&&S.push(U),n.padding!==!1&&S.push(" "),(n.delimiterEnd!==!1||g!==m-1)&&S.push("|")}v.push(n.delimiterEnd===!1?S.join("").replace(/ +$/,""):S.join(""))}return v.join(`
|
|
246
|
+
`)}function RM(e){return e==null?"":String(e)}function r_(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 LM(e,t,n,r){const s=n.enter("blockquote"),l=n.createTracker(r);l.move("> "),l.shift(2);const o=n.indentLines(n.containerFlow(e,l.current()),IM);return s(),o}function IM(e,t,n){return">"+(n?"":" ")+e}function OM(e,t){return a_(e,t.inConstruct,!0)&&!a_(e,t.notInConstruct,!1)}function a_(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 i_(e,t,n,r){let s=-1;for(;++s<n.unsafe.length;)if(n.unsafe[s].character===`
|
|
247
|
+
`&&OM(n.stack,n.unsafe[s]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
248
|
+
`}function DM(e,t){const n=String(e);let r=n.indexOf(t),s=r,l=0,o=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===s?++l>o&&(o=l):l=1,s=r+t.length,r=n.indexOf(t,s);return o}function jM(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 MM(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 PM(e,t,n,r){const s=MM(n),l=e.value||"",o=s==="`"?"GraveAccent":"Tilde";if(jM(e,n)){const g=n.enter("codeIndented"),y=n.indentLines(l,BM);return g(),y}const c=n.createTracker(r),d=s.repeat(Math.max(DM(l,s)+1,3)),m=n.enter("codeFenced");let p=c.move(d);if(e.lang){const g=n.enter(`codeFencedLang${o}`);p+=c.move(n.safe(e.lang,{before:p,after:" ",encode:["`"],...c.current()})),g()}if(e.lang&&e.meta){const g=n.enter(`codeFencedMeta${o}`);p+=c.move(" "),p+=c.move(n.safe(e.meta,{before:p,after:`
|
|
249
|
+
`,encode:["`"],...c.current()})),g()}return p+=c.move(`
|
|
250
|
+
`),l&&(p+=c.move(l+`
|
|
251
|
+
`)),p+=c.move(d),m(),p}function BM(e,t,n){return(n?"":" ")+e}function r1(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 UM(e,t,n,r){const s=r1(n),l=s==='"'?"Quote":"Apostrophe",o=n.enter("definition");let c=n.enter("label");const d=n.createTracker(r);let m=d.move("[");return m+=d.move(n.safe(n.associationId(e),{before:m,after:"]",...d.current()})),m+=d.move("]: "),c(),!e.url||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),m+=d.move("<"),m+=d.move(n.safe(e.url,{before:m,after:">",...d.current()})),m+=d.move(">")):(c=n.enter("destinationRaw"),m+=d.move(n.safe(e.url,{before:m,after:e.title?" ":`
|
|
252
|
+
`,...d.current()}))),c(),e.title&&(c=n.enter(`title${l}`),m+=d.move(" "+s),m+=d.move(n.safe(e.title,{before:m,after:s,...d.current()})),m+=d.move(s),c()),o(),m}function HM(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 oc(e){return"&#x"+e.toString(16).toUpperCase()+";"}function _o(e){if(e===null||ln(e)||fl(e))return 1;if(ih(e))return 2}function Lf(e,t,n){const r=_o(e),s=_o(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}}pw.peek=zM;function pw(e,t,n,r){const s=HM(n),l=n.enter("emphasis"),o=n.createTracker(r),c=o.move(s);let d=o.move(n.containerPhrasing(e,{after:s,before:c,...o.current()}));const m=d.charCodeAt(0),p=Lf(r.before.charCodeAt(r.before.length-1),m,s);p.inside&&(d=oc(m)+d.slice(1));const g=d.charCodeAt(d.length-1),y=Lf(r.after.charCodeAt(0),g,s);y.inside&&(d=d.slice(0,-1)+oc(g));const E=o.move(s);return l(),n.attentionEncodeSurroundingInfo={after:y.outside,before:p.outside},c+d+E}function zM(e,t,n){return n.options.emphasis||"*"}const FM={};function a1(e,t){const n=FM,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,s=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return gw(e,r,s)}function gw(e,t,n){if($M(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 s_(e.children,t,n)}return Array.isArray(e)?s_(e,t,n):""}function s_(e,t,n){const r=[];let s=-1;for(;++s<e.length;)r[s]=gw(e[s],t,n);return r.join("")}function $M(e){return!!(e&&typeof e=="object")}function VM(e,t){let n=!1;return $a(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,z0}),!!((!e.depth||e.depth<3)&&a1(e)&&(t.options.setext||n))}function GM(e,t,n,r){const s=Math.max(Math.min(6,e.depth||1),1),l=n.createTracker(r);if(VM(e,n)){const p=n.enter("headingSetext"),g=n.enter("phrasing"),y=n.containerPhrasing(e,{...l.current(),before:`
|
|
253
|
+
`,after:`
|
|
254
|
+
`});return g(),p(),y+`
|
|
255
|
+
`+(s===1?"=":"-").repeat(y.length-(Math.max(y.lastIndexOf("\r"),y.lastIndexOf(`
|
|
256
|
+
`))+1))}const o="#".repeat(s),c=n.enter("headingAtx"),d=n.enter("phrasing");l.move(o+" ");let m=n.containerPhrasing(e,{before:"# ",after:`
|
|
257
|
+
`,...l.current()});return/^[\t ]/.test(m)&&(m=oc(m.charCodeAt(0))+m.slice(1)),m=m?o+" "+m:o,n.options.closeAtx&&(m+=" "+o),d(),c(),m}bw.peek=qM;function bw(e){return e.value||""}function qM(){return"<"}xw.peek=YM;function xw(e,t,n,r){const s=r1(n),l=s==='"'?"Quote":"Apostrophe",o=n.enter("image");let c=n.enter("label");const d=n.createTracker(r);let m=d.move("![");return m+=d.move(n.safe(e.alt,{before:m,after:"]",...d.current()})),m+=d.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),m+=d.move("<"),m+=d.move(n.safe(e.url,{before:m,after:">",...d.current()})),m+=d.move(">")):(c=n.enter("destinationRaw"),m+=d.move(n.safe(e.url,{before:m,after:e.title?" ":")",...d.current()}))),c(),e.title&&(c=n.enter(`title${l}`),m+=d.move(" "+s),m+=d.move(n.safe(e.title,{before:m,after:s,...d.current()})),m+=d.move(s),c()),m+=d.move(")"),o(),m}function YM(){return"!"}yw.peek=WM;function yw(e,t,n,r){const s=e.referenceType,l=n.enter("imageReference");let o=n.enter("label");const c=n.createTracker(r);let d=c.move("![");const m=n.safe(e.alt,{before:d,after:"]",...c.current()});d+=c.move(m+"]["),o();const p=n.stack;n.stack=[],o=n.enter("reference");const g=n.safe(n.associationId(e),{before:d,after:"]",...c.current()});return o(),n.stack=p,l(),s==="full"||!m||m!==g?d+=c.move(g+"]"):s==="shortcut"?d=d.slice(0,-1):d+=c.move("]"),d}function WM(){return"!"}Ew.peek=QM;function Ew(e,t,n){let r=e.value||"",s="`",l=-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+" ");++l<n.unsafe.length;){const o=n.unsafe[l],c=n.compilePattern(o);let d;if(o.atBreak)for(;d=c.exec(r);){let m=d.index;r.charCodeAt(m)===10&&r.charCodeAt(m-1)===13&&m--,r=r.slice(0,m)+" "+r.slice(d.index+1)}}return s+r+s}function QM(){return"`"}function _w(e,t){const n=a1(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))}Tw.peek=XM;function Tw(e,t,n,r){const s=r1(n),l=s==='"'?"Quote":"Apostrophe",o=n.createTracker(r);let c,d;if(_w(e,n)){const p=n.stack;n.stack=[],c=n.enter("autolink");let g=o.move("<");return g+=o.move(n.containerPhrasing(e,{before:g,after:">",...o.current()})),g+=o.move(">"),c(),n.stack=p,g}c=n.enter("link"),d=n.enter("label");let m=o.move("[");return m+=o.move(n.containerPhrasing(e,{before:m,after:"](",...o.current()})),m+=o.move("]("),d(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(d=n.enter("destinationLiteral"),m+=o.move("<"),m+=o.move(n.safe(e.url,{before:m,after:">",...o.current()})),m+=o.move(">")):(d=n.enter("destinationRaw"),m+=o.move(n.safe(e.url,{before:m,after:e.title?" ":")",...o.current()}))),d(),e.title&&(d=n.enter(`title${l}`),m+=o.move(" "+s),m+=o.move(n.safe(e.title,{before:m,after:s,...o.current()})),m+=o.move(s),d()),m+=o.move(")"),c(),m}function XM(e,t,n){return _w(e,n)?"<":"["}vw.peek=KM;function vw(e,t,n,r){const s=e.referenceType,l=n.enter("linkReference");let o=n.enter("label");const c=n.createTracker(r);let d=c.move("[");const m=n.containerPhrasing(e,{before:d,after:"]",...c.current()});d+=c.move(m+"]["),o();const p=n.stack;n.stack=[],o=n.enter("reference");const g=n.safe(n.associationId(e),{before:d,after:"]",...c.current()});return o(),n.stack=p,l(),s==="full"||!m||m!==g?d+=c.move(g+"]"):s==="shortcut"?d=d.slice(0,-1):d+=c.move("]"),d}function KM(){return"["}function i1(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 ZM(e){const t=i1(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 JM(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 ww(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 e7(e,t,n,r){const s=n.enter("list"),l=n.bulletCurrent;let o=e.ordered?JM(n):i1(n);const c=e.ordered?o==="."?")":".":ZM(n);let d=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){const p=e.children?e.children[0]:void 0;if((o==="*"||o==="-")&&p&&(!p.children||!p.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&&(d=!0),ww(n)===o&&p){let g=-1;for(;++g<e.children.length;){const y=e.children[g];if(y&&y.type==="listItem"&&y.children&&y.children[0]&&y.children[0].type==="thematicBreak"){d=!0;break}}}}d&&(o=c),n.bulletCurrent=o;const m=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=l,s(),m}function t7(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 n7(e,t,n,r){const s=t7(n);let l=n.bulletCurrent||i1(n);t&&t.type==="list"&&t.ordered&&(l=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+l);let o=l.length+1;(s==="tab"||s==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);const c=n.createTracker(r);c.move(l+" ".repeat(o-l.length)),c.shift(o);const d=n.enter("listItem"),m=n.indentLines(n.containerFlow(e,c.current()),p);return d(),m;function p(g,y,E){return y?(E?"":" ".repeat(o))+g:(E?l:l+" ".repeat(o-l.length))+g}}function r7(e,t,n,r){const s=n.enter("paragraph"),l=n.enter("phrasing"),o=n.containerPhrasing(e,r);return l(),s(),o}const a7=Kf(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function i7(e,t,n,r){return(e.children.some(function(o){return a7(o)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function s7(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}kw.peek=l7;function kw(e,t,n,r){const s=s7(n),l=n.enter("strong"),o=n.createTracker(r),c=o.move(s+s);let d=o.move(n.containerPhrasing(e,{after:s,before:c,...o.current()}));const m=d.charCodeAt(0),p=Lf(r.before.charCodeAt(r.before.length-1),m,s);p.inside&&(d=oc(m)+d.slice(1));const g=d.charCodeAt(d.length-1),y=Lf(r.after.charCodeAt(0),g,s);y.inside&&(d=d.slice(0,-1)+oc(g));const E=o.move(s+s);return l(),n.attentionEncodeSurroundingInfo={after:y.outside,before:p.outside},c+d+E}function l7(e,t,n){return n.options.strong||"*"}function o7(e,t,n,r){return n.safe(e.value,r)}function u7(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 c7(e,t,n){const r=(ww(n)+(n.options.ruleSpaces?" ":"")).repeat(u7(n));return n.options.ruleSpaces?r.slice(0,-1):r}const Cw={blockquote:LM,break:i_,code:PM,definition:UM,emphasis:pw,hardBreak:i_,heading:GM,html:bw,image:xw,imageReference:yw,inlineCode:Ew,link:Tw,linkReference:vw,list:e7,listItem:n7,paragraph:r7,root:i7,strong:kw,text:o7,thematicBreak:c7},l_=document.createElement("i");function s1(e){const t="&"+e+";";l_.innerHTML=t;const n=l_.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Sw(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)}const d7=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function f7(e){return e.replace(d7,h7)}function h7(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const s=n.charCodeAt(1),l=s===120||s===88;return Sw(n.slice(l?2:1),l?16:10)}return s1(n)||e}function m7(){return{enter:{table:p7,tableData:o_,tableHeader:o_,tableRow:b7},exit:{codeText:x7,table:g7,tableData:Xp,tableHeader:Xp,tableRow:Xp}}}function p7(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 g7(e){this.exit(e),this.data.inTable=void 0}function b7(e){this.enter({type:"tableRow",children:[]},e)}function Xp(e){this.exit(e)}function o_(e){this.enter({type:"tableCell",children:[]},e)}function x7(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,y7));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function y7(e,t){return t==="|"?t:e}function E7(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,s=t.stringLength,l=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
258
|
+
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:y,table:o,tableCell:d,tableRow:c}};function o(E,v,k,C){return m(p(E,k,C),E.align)}function c(E,v,k,C){const S=g(E,k,C),A=m([S]);return A.slice(0,A.indexOf(`
|
|
259
|
+
`))}function d(E,v,k,C){const S=k.enter("tableCell"),A=k.enter("phrasing"),N=k.containerPhrasing(E,{...C,before:l,after:l});return A(),S(),N}function m(E,v){return NM(E,{align:v,alignDelimiters:r,padding:n,stringLength:s})}function p(E,v,k){const C=E.children;let S=-1;const A=[],N=v.enter("table");for(;++S<C.length;)A[S]=g(C[S],v,k);return N(),A}function g(E,v,k){const C=E.children;let S=-1;const A=[],N=v.enter("tableRow");for(;++S<C.length;)A[S]=d(C[S],E,v,k);return N(),A}function y(E,v,k){let C=Cw.inlineCode(E,v,k);return k.stack.includes("tableCell")&&(C=C.replace(/\|/g,"\\$&")),C}}function _7(){return{exit:{taskListCheckValueChecked:u_,taskListCheckValueUnchecked:u_,paragraph:v7}}}function T7(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:w7}}}function u_(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function v7(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 l=-1,o;for(;++l<s.length;){const c=s[l];if(c.type==="paragraph"){o=c;break}}o===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 w7(e,t,n,r){const s=e.children[0],l=typeof e.checked=="boolean"&&s&&s.type==="paragraph",o="["+(e.checked?"x":" ")+"] ",c=n.createTracker(r);l&&c.move(o);let d=Cw.listItem(e,t,n,{...r,...c.current()});return l&&(d=d.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,m)),d;function m(p){return p+o}}function k7(){return[Zj(),yM(),vM(),m7(),_7()]}function C7(e){return{extensions:[Jj(),EM(e),wM(),E7(e),T7()]}}function Mr(e,t,n,r){const s=e.length;let l=0,o;if(t<0?t=-t>s?0:s+t:t=t>s?s:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);l<r.length;)o=r.slice(l,l+1e4),o.unshift(t,0),e.splice(...o),l+=1e4,t+=1e4}function ea(e,t){return e.length>0?(Mr(e,e.length,0,t),e):t}const c_={}.hasOwnProperty;function Aw(e){const t={};let n=-1;for(;++n<e.length;)S7(t,e[n]);return t}function S7(e,t){let n;for(n in t){const s=(c_.call(e,n)?e[n]:void 0)||(e[n]={}),l=t[n];let o;if(l)for(o in l){c_.call(s,o)||(s[o]=[]);const c=l[o];A7(s[o],Array.isArray(c)?c:c?[c]:[])}}}function A7(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Mr(e,0,0,r)}const N7={tokenize:j7,partial:!0},Nw={tokenize:M7,partial:!0},Rw={tokenize:P7,partial:!0},Lw={tokenize:B7,partial:!0},R7={tokenize:U7,partial:!0},Iw={name:"wwwAutolink",tokenize:O7,previous:Dw},Ow={name:"protocolAutolink",tokenize:D7,previous:jw},Si={name:"emailAutolink",tokenize:I7,previous:Mw},qa={};function L7(){return{text:qa}}let Js=48;for(;Js<123;)qa[Js]=Si,Js++,Js===58?Js=65:Js===91&&(Js=97);qa[43]=Si;qa[45]=Si;qa[46]=Si;qa[95]=Si;qa[72]=[Si,Ow];qa[104]=[Si,Ow];qa[87]=[Si,Iw];qa[119]=[Si,Iw];function I7(e,t,n){const r=this;let s,l;return o;function o(g){return!Q0(g)||!Mw.call(r,r.previous)||l1(r.events)?n(g):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),c(g))}function c(g){return Q0(g)?(e.consume(g),c):g===64?(e.consume(g),d):n(g)}function d(g){return g===46?e.check(R7,p,m)(g):g===45||g===95||ir(g)?(l=!0,e.consume(g),d):p(g)}function m(g){return e.consume(g),s=!0,d}function p(g){return l&&s&&fr(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(g)):n(g)}}function O7(e,t,n){const r=this;return s;function s(o){return o!==87&&o!==119||!Dw.call(r,r.previous)||l1(r.events)?n(o):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(N7,e.attempt(Nw,e.attempt(Rw,l),n),n)(o))}function l(o){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(o)}}function D7(e,t,n){const r=this;let s="",l=!1;return o;function o(g){return(g===72||g===104)&&jw.call(r,r.previous)&&!l1(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),s+=String.fromCodePoint(g),e.consume(g),c):n(g)}function c(g){if(fr(g)&&s.length<5)return s+=String.fromCodePoint(g),e.consume(g),c;if(g===58){const y=s.toLowerCase();if(y==="http"||y==="https")return e.consume(g),d}return n(g)}function d(g){return g===47?(e.consume(g),l?m:(l=!0,d)):n(g)}function m(g){return g===null||Rf(g)||ln(g)||fl(g)||ih(g)?n(g):e.attempt(Nw,e.attempt(Rw,p),n)(g)}function p(g){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(g)}}function j7(e,t,n){let r=0;return s;function s(o){return(o===87||o===119)&&r<3?(r++,e.consume(o),s):o===46&&r===3?(e.consume(o),l):n(o)}function l(o){return o===null?n(o):t(o)}}function M7(e,t,n){let r,s,l;return o;function o(m){return m===46||m===95?e.check(Lw,d,c)(m):m===null||ln(m)||fl(m)||m!==45&&ih(m)?d(m):(l=!0,e.consume(m),o)}function c(m){return m===95?r=!0:(s=r,r=void 0),e.consume(m),o}function d(m){return s||r||!l?n(m):t(m)}}function P7(e,t){let n=0,r=0;return s;function s(o){return o===40?(n++,e.consume(o),s):o===41&&r<n?l(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(Lw,t,l)(o):o===null||ln(o)||fl(o)?t(o):(e.consume(o),s)}function l(o){return o===41&&r++,e.consume(o),s}}function B7(e,t,n){return r;function r(c){return c===33||c===34||c===39||c===41||c===42||c===44||c===46||c===58||c===59||c===63||c===95||c===126?(e.consume(c),r):c===38?(e.consume(c),l):c===93?(e.consume(c),s):c===60||c===null||ln(c)||fl(c)?t(c):n(c)}function s(c){return c===null||c===40||c===91||ln(c)||fl(c)?t(c):r(c)}function l(c){return fr(c)?o(c):n(c)}function o(c){return c===59?(e.consume(c),r):fr(c)?(e.consume(c),o):n(c)}}function U7(e,t,n){return r;function r(l){return e.consume(l),s}function s(l){return ir(l)?n(l):t(l)}}function Dw(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||ln(e)}function jw(e){return!fr(e)}function Mw(e){return!(e===47||Q0(e))}function Q0(e){return e===43||e===45||e===46||e===95||ir(e)}function l1(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}function Do(e){const t=[];let n=-1,r=0,s=0;for(;++n<e.length;){const l=e.charCodeAt(n);let o="";if(l===37&&ir(e.charCodeAt(n+1))&&ir(e.charCodeAt(n+2)))s=2;else if(l<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(l))||(o=String.fromCharCode(l));else if(l>55295&&l<57344){const c=e.charCodeAt(n+1);l<56320&&c>56319&&c<57344?(o=String.fromCharCode(l,c),s=1):o="�"}else o=String.fromCharCode(l);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+s+1,o=""),s&&(n+=s,s=0)}return t.join("")+e.slice(r)}function sh(e,t,n){const r=[];let s=-1;for(;++s<e.length;){const l=e[s].resolveAll;l&&!r.includes(l)&&(t=l(t,n),r.push(l))}return t}const X0={name:"attention",resolveAll:H7,tokenize:z7};function H7(e,t){let n=-1,r,s,l,o,c,d,m,p;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;d=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},y={...e[n][1].start};d_(g,-d),d_(y,d),o={type:d>1?"strongSequence":"emphasisSequence",start:g,end:{...e[r][1].end}},c={type:d>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:y},l={type:d>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},s={type:d>1?"strong":"emphasis",start:{...o.start},end:{...c.end}},e[r][1].end={...o.start},e[n][1].start={...c.end},m=[],e[r][1].end.offset-e[r][1].start.offset&&(m=ea(m,[["enter",e[r][1],t],["exit",e[r][1],t]])),m=ea(m,[["enter",s,t],["enter",o,t],["exit",o,t],["enter",l,t]]),m=ea(m,sh(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),m=ea(m,[["exit",l,t],["enter",c,t],["exit",c,t],["exit",s,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,m=ea(m,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,Mr(e,r-1,n-r+3,m),n=r+m.length-p-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function z7(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,s=_o(r);let l;return o;function o(d){return l=d,e.enter("attentionSequence"),c(d)}function c(d){if(d===l)return e.consume(d),c;const m=e.exit("attentionSequence"),p=_o(d),g=!p||p===2&&s||n.includes(d),y=!s||s===2&&p||n.includes(r);return m._open=!!(l===42?g:g&&(s||!y)),m._close=!!(l===42?y:y&&(p||!g)),t(d)}}function d_(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const F7={name:"autolink",tokenize:$7};function $7(e,t,n){let r=0;return s;function s(E){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(E),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),l}function l(E){return fr(E)?(e.consume(E),o):E===64?n(E):m(E)}function o(E){return E===43||E===45||E===46||ir(E)?(r=1,c(E)):m(E)}function c(E){return E===58?(e.consume(E),r=0,d):(E===43||E===45||E===46||ir(E))&&r++<32?(e.consume(E),c):(r=0,m(E))}function d(E){return E===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(E),e.exit("autolinkMarker"),e.exit("autolink"),t):E===null||E===32||E===60||Rf(E)?n(E):(e.consume(E),d)}function m(E){return E===64?(e.consume(E),p):Vj(E)?(e.consume(E),m):n(E)}function p(E){return ir(E)?g(E):n(E)}function g(E){return E===46?(e.consume(E),r=0,p):E===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(E),e.exit("autolinkMarker"),e.exit("autolink"),t):y(E)}function y(E){if((E===45||ir(E))&&r++<63){const v=E===45?y:g;return e.consume(E),v}return n(E)}}function zt(e,t,n,r){const s=r?r-1:Number.POSITIVE_INFINITY;let l=0;return o;function o(d){return jt(d)?(e.enter(n),c(d)):t(d)}function c(d){return jt(d)&&l++<s?(e.consume(d),c):(e.exit(n),t(d))}}const _c={partial:!0,tokenize:V7};function V7(e,t,n){return r;function r(l){return jt(l)?zt(e,s,"linePrefix")(l):s(l)}function s(l){return l===null||st(l)?t(l):n(l)}}const Pw={continuation:{tokenize:q7},exit:Y7,name:"blockQuote",tokenize:G7};function G7(e,t,n){const r=this;return s;function s(o){if(o===62){const c=r.containerState;return c.open||(e.enter("blockQuote",{_container:!0}),c.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),l}return n(o)}function l(o){return jt(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function q7(e,t,n){const r=this;return s;function s(o){return jt(o)?zt(e,l,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):l(o)}function l(o){return e.attempt(Pw,t,n)(o)}}function Y7(e){e.exit("blockQuote")}const Bw={name:"characterEscape",tokenize:W7};function W7(e,t,n){return r;function r(l){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(l),e.exit("escapeMarker"),s}function s(l){return qj(l)?(e.enter("characterEscapeValue"),e.consume(l),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(l)}}const Uw={name:"characterReference",tokenize:Q7};function Q7(e,t,n){const r=this;let s=0,l,o;return c;function c(g){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),d}function d(g){return g===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(g),e.exit("characterReferenceMarkerNumeric"),m):(e.enter("characterReferenceValue"),l=31,o=ir,p(g))}function m(g){return g===88||g===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(g),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),l=6,o=Gj,p):(e.enter("characterReferenceValue"),l=7,o=W0,p(g))}function p(g){if(g===59&&s){const y=e.exit("characterReferenceValue");return o===ir&&!s1(r.sliceSerialize(y))?n(g):(e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(g)&&s++<l?(e.consume(g),p):n(g)}}const f_={partial:!0,tokenize:K7},h_={concrete:!0,name:"codeFenced",tokenize:X7};function X7(e,t,n){const r=this,s={partial:!0,tokenize:G};let l=0,o=0,c;return d;function d(P){return m(P)}function m(P){const H=r.events[r.events.length-1];return l=H&&H[1].type==="linePrefix"?H[2].sliceSerialize(H[1],!0).length:0,c=P,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),p(P)}function p(P){return P===c?(o++,e.consume(P),p):o<3?n(P):(e.exit("codeFencedFenceSequence"),jt(P)?zt(e,g,"whitespace")(P):g(P))}function g(P){return P===null||st(P)?(e.exit("codeFencedFence"),r.interrupt?t(P):e.check(f_,k,U)(P)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),y(P))}function y(P){return P===null||st(P)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),g(P)):jt(P)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),zt(e,E,"whitespace")(P)):P===96&&P===c?n(P):(e.consume(P),y)}function E(P){return P===null||st(P)?g(P):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),v(P))}function v(P){return P===null||st(P)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),g(P)):P===96&&P===c?n(P):(e.consume(P),v)}function k(P){return e.attempt(s,U,C)(P)}function C(P){return e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),S}function S(P){return l>0&&jt(P)?zt(e,A,"linePrefix",l+1)(P):A(P)}function A(P){return P===null||st(P)?e.check(f_,k,U)(P):(e.enter("codeFlowValue"),N(P))}function N(P){return P===null||st(P)?(e.exit("codeFlowValue"),A(P)):(e.consume(P),N)}function U(P){return e.exit("codeFenced"),t(P)}function G(P,H,Y){let ue=0;return M;function M(ne){return P.enter("lineEnding"),P.consume(ne),P.exit("lineEnding"),K}function K(ne){return P.enter("codeFencedFence"),jt(ne)?zt(P,F,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(ne):F(ne)}function F(ne){return ne===c?(P.enter("codeFencedFenceSequence"),ge(ne)):Y(ne)}function ge(ne){return ne===c?(ue++,P.consume(ne),ge):ue>=o?(P.exit("codeFencedFenceSequence"),jt(ne)?zt(P,ce,"whitespace")(ne):ce(ne)):Y(ne)}function ce(ne){return ne===null||st(ne)?(P.exit("codeFencedFence"),H(ne)):Y(ne)}}}function K7(e,t,n){const r=this;return s;function s(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),l)}function l(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}const Kp={name:"codeIndented",tokenize:J7},Z7={partial:!0,tokenize:eP};function J7(e,t,n){const r=this;return s;function s(m){return e.enter("codeIndented"),zt(e,l,"linePrefix",5)(m)}function l(m){const p=r.events[r.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?o(m):n(m)}function o(m){return m===null?d(m):st(m)?e.attempt(Z7,o,d)(m):(e.enter("codeFlowValue"),c(m))}function c(m){return m===null||st(m)?(e.exit("codeFlowValue"),o(m)):(e.consume(m),c)}function d(m){return e.exit("codeIndented"),t(m)}}function eP(e,t,n){const r=this;return s;function s(o){return r.parser.lazy[r.now().line]?n(o):st(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s):zt(e,l,"linePrefix",5)(o)}function l(o){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(o):st(o)?s(o):n(o)}}const tP={name:"codeText",previous:rP,resolve:nP,tokenize:aP};function nP(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 rP(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function aP(e,t,n){let r=0,s,l;return o;function o(g){return e.enter("codeText"),e.enter("codeTextSequence"),c(g)}function c(g){return g===96?(e.consume(g),r++,c):(e.exit("codeTextSequence"),d(g))}function d(g){return g===null?n(g):g===32?(e.enter("space"),e.consume(g),e.exit("space"),d):g===96?(l=e.enter("codeTextSequence"),s=0,p(g)):st(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),d):(e.enter("codeTextData"),m(g))}function m(g){return g===null||g===32||g===96||st(g)?(e.exit("codeTextData"),d(g)):(e.consume(g),m)}function p(g){return g===96?(e.consume(g),s++,p):s===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(g)):(l.type="codeTextData",m(g))}}class iP{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 l=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return r&&Nu(this.left,r),l.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),Nu(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Nu(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);Nu(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Nu(this.left,n.reverse())}}}function Nu(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 Hw(e){const t={};let n=-1,r,s,l,o,c,d,m;const p=new iP(e);for(;++n<p.length;){for(;n in t;)n=t[n];if(r=p.get(n),n&&r[1].type==="chunkFlow"&&p.get(n-1)[1].type==="listItemPrefix"&&(d=r[1]._tokenizer.events,l=0,l<d.length&&d[l][1].type==="lineEndingBlank"&&(l+=2),l<d.length&&d[l][1].type==="content"))for(;++l<d.length&&d[l][1].type!=="content";)d[l][1].type==="chunkText"&&(d[l][1]._isInFirstContentOfListItem=!0,l++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,sP(p,n)),n=t[n],m=!0);else if(r[1]._container){for(l=n,s=void 0;l--;)if(o=p.get(l),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(s&&(p.get(s)[1].type="lineEndingBlank"),o[1].type="lineEnding",s=l);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;s&&(r[1].end={...p.get(s)[1].start},c=p.slice(s,n),c.unshift(r),p.splice(s,n-s+1,c))}}return Mr(e,0,Number.POSITIVE_INFINITY,p.slice(0)),!m}function sP(e,t){const n=e.get(t)[1],r=e.get(t)[2];let s=t-1;const l=[];let o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const c=o.events,d=[],m={};let p,g,y=-1,E=n,v=0,k=0;const C=[k];for(;E;){for(;e.get(++s)[1]!==E;);l.push(s),E._tokenizer||(p=r.sliceStream(E),E.next||p.push(null),g&&o.defineSkip(E.start),E._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(p),E._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),g=E,E=E.next}for(E=n;++y<c.length;)c[y][0]==="exit"&&c[y-1][0]==="enter"&&c[y][1].type===c[y-1][1].type&&c[y][1].start.line!==c[y][1].end.line&&(k=y+1,C.push(k),E._tokenizer=void 0,E.previous=void 0,E=E.next);for(o.events=[],E?(E._tokenizer=void 0,E.previous=void 0):C.pop(),y=C.length;y--;){const S=c.slice(C[y],C[y+1]),A=l.pop();d.push([A,A+S.length-1]),e.splice(A,2,S)}for(d.reverse(),y=-1;++y<d.length;)m[v+d[y][0]]=v+d[y][1],v+=d[y][1]-d[y][0]-1;return m}const lP={resolve:uP,tokenize:cP},oP={partial:!0,tokenize:dP};function uP(e){return Hw(e),e}function cP(e,t){let n;return r;function r(c){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),s(c)}function s(c){return c===null?l(c):st(c)?e.check(oP,o,l)(c):(e.consume(c),s)}function l(c){return e.exit("chunkContent"),e.exit("content"),t(c)}function o(c){return e.consume(c),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,s}}function dP(e,t,n){const r=this;return s;function s(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),zt(e,l,"linePrefix")}function l(o){if(o===null||st(o))return n(o);const c=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function zw(e,t,n,r,s,l,o,c,d){const m=d||Number.POSITIVE_INFINITY;let p=0;return g;function g(S){return S===60?(e.enter(r),e.enter(s),e.enter(l),e.consume(S),e.exit(l),y):S===null||S===32||S===41||Rf(S)?n(S):(e.enter(r),e.enter(o),e.enter(c),e.enter("chunkString",{contentType:"string"}),k(S))}function y(S){return S===62?(e.enter(l),e.consume(S),e.exit(l),e.exit(s),e.exit(r),t):(e.enter(c),e.enter("chunkString",{contentType:"string"}),E(S))}function E(S){return S===62?(e.exit("chunkString"),e.exit(c),y(S)):S===null||S===60||st(S)?n(S):(e.consume(S),S===92?v:E)}function v(S){return S===60||S===62||S===92?(e.consume(S),E):E(S)}function k(S){return!p&&(S===null||S===41||ln(S))?(e.exit("chunkString"),e.exit(c),e.exit(o),e.exit(r),t(S)):p<m&&S===40?(e.consume(S),p++,k):S===41?(e.consume(S),p--,k):S===null||S===32||S===40||Rf(S)?n(S):(e.consume(S),S===92?C:k)}function C(S){return S===40||S===41||S===92?(e.consume(S),k):k(S)}}function Fw(e,t,n,r,s,l){const o=this;let c=0,d;return m;function m(E){return e.enter(r),e.enter(s),e.consume(E),e.exit(s),e.enter(l),p}function p(E){return c>999||E===null||E===91||E===93&&!d||E===94&&!c&&"_hiddenFootnoteSupport"in o.parser.constructs?n(E):E===93?(e.exit(l),e.enter(s),e.consume(E),e.exit(s),e.exit(r),t):st(E)?(e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),p):(e.enter("chunkString",{contentType:"string"}),g(E))}function g(E){return E===null||E===91||E===93||st(E)||c++>999?(e.exit("chunkString"),p(E)):(e.consume(E),d||(d=!jt(E)),E===92?y:g)}function y(E){return E===91||E===92||E===93?(e.consume(E),c++,g):g(E)}}function $w(e,t,n,r,s,l){let o;return c;function c(y){return y===34||y===39||y===40?(e.enter(r),e.enter(s),e.consume(y),e.exit(s),o=y===40?41:y,d):n(y)}function d(y){return y===o?(e.enter(s),e.consume(y),e.exit(s),e.exit(r),t):(e.enter(l),m(y))}function m(y){return y===o?(e.exit(l),d(o)):y===null?n(y):st(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),zt(e,m,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(y))}function p(y){return y===o||y===null||st(y)?(e.exit("chunkString"),m(y)):(e.consume(y),y===92?g:p)}function g(y){return y===o||y===92?(e.consume(y),p):p(y)}}function Xu(e,t){let n;return r;function r(s){return st(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,r):jt(s)?zt(e,r,n?"linePrefix":"lineSuffix")(s):t(s)}}const fP={name:"definition",tokenize:mP},hP={partial:!0,tokenize:pP};function mP(e,t,n){const r=this;let s;return l;function l(E){return e.enter("definition"),o(E)}function o(E){return Fw.call(r,e,c,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(E)}function c(E){return s=Ta(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),E===58?(e.enter("definitionMarker"),e.consume(E),e.exit("definitionMarker"),d):n(E)}function d(E){return ln(E)?Xu(e,m)(E):m(E)}function m(E){return zw(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(E)}function p(E){return e.attempt(hP,g,g)(E)}function g(E){return jt(E)?zt(e,y,"whitespace")(E):y(E)}function y(E){return E===null||st(E)?(e.exit("definition"),r.parser.defined.push(s),t(E)):n(E)}}function pP(e,t,n){return r;function r(c){return ln(c)?Xu(e,s)(c):n(c)}function s(c){return $w(e,l,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(c)}function l(c){return jt(c)?zt(e,o,"whitespace")(c):o(c)}function o(c){return c===null||st(c)?t(c):n(c)}}const gP={name:"hardBreakEscape",tokenize:bP};function bP(e,t,n){return r;function r(l){return e.enter("hardBreakEscape"),e.consume(l),s}function s(l){return st(l)?(e.exit("hardBreakEscape"),t(l)):n(l)}}const xP={name:"headingAtx",resolve:yP,tokenize:EP};function yP(e,t){let n=e.length-2,r=3,s,l;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},l={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Mr(e,r,n-r+1,[["enter",s,t],["enter",l,t],["exit",l,t],["exit",s,t]])),e}function EP(e,t,n){let r=0;return s;function s(p){return e.enter("atxHeading"),l(p)}function l(p){return e.enter("atxHeadingSequence"),o(p)}function o(p){return p===35&&r++<6?(e.consume(p),o):p===null||ln(p)?(e.exit("atxHeadingSequence"),c(p)):n(p)}function c(p){return p===35?(e.enter("atxHeadingSequence"),d(p)):p===null||st(p)?(e.exit("atxHeading"),t(p)):jt(p)?zt(e,c,"whitespace")(p):(e.enter("atxHeadingText"),m(p))}function d(p){return p===35?(e.consume(p),d):(e.exit("atxHeadingSequence"),c(p))}function m(p){return p===null||p===35||ln(p)?(e.exit("atxHeadingText"),c(p)):(e.consume(p),m)}}const _P=["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"],m_=["pre","script","style","textarea"],TP={concrete:!0,name:"htmlFlow",resolveTo:kP,tokenize:CP},vP={partial:!0,tokenize:AP},wP={partial:!0,tokenize:SP};function kP(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 CP(e,t,n){const r=this;let s,l,o,c,d;return m;function m(O){return p(O)}function p(O){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(O),g}function g(O){return O===33?(e.consume(O),y):O===47?(e.consume(O),l=!0,k):O===63?(e.consume(O),s=3,r.interrupt?t:L):fr(O)?(e.consume(O),o=String.fromCharCode(O),C):n(O)}function y(O){return O===45?(e.consume(O),s=2,E):O===91?(e.consume(O),s=5,c=0,v):fr(O)?(e.consume(O),s=4,r.interrupt?t:L):n(O)}function E(O){return O===45?(e.consume(O),r.interrupt?t:L):n(O)}function v(O){const _e="CDATA[";return O===_e.charCodeAt(c++)?(e.consume(O),c===_e.length?r.interrupt?t:F:v):n(O)}function k(O){return fr(O)?(e.consume(O),o=String.fromCharCode(O),C):n(O)}function C(O){if(O===null||O===47||O===62||ln(O)){const _e=O===47,Re=o.toLowerCase();return!_e&&!l&&m_.includes(Re)?(s=1,r.interrupt?t(O):F(O)):_P.includes(o.toLowerCase())?(s=6,_e?(e.consume(O),S):r.interrupt?t(O):F(O)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(O):l?A(O):N(O))}return O===45||ir(O)?(e.consume(O),o+=String.fromCharCode(O),C):n(O)}function S(O){return O===62?(e.consume(O),r.interrupt?t:F):n(O)}function A(O){return jt(O)?(e.consume(O),A):M(O)}function N(O){return O===47?(e.consume(O),M):O===58||O===95||fr(O)?(e.consume(O),U):jt(O)?(e.consume(O),N):M(O)}function U(O){return O===45||O===46||O===58||O===95||ir(O)?(e.consume(O),U):G(O)}function G(O){return O===61?(e.consume(O),P):jt(O)?(e.consume(O),G):N(O)}function P(O){return O===null||O===60||O===61||O===62||O===96?n(O):O===34||O===39?(e.consume(O),d=O,H):jt(O)?(e.consume(O),P):Y(O)}function H(O){return O===d?(e.consume(O),d=null,ue):O===null||st(O)?n(O):(e.consume(O),H)}function Y(O){return O===null||O===34||O===39||O===47||O===60||O===61||O===62||O===96||ln(O)?G(O):(e.consume(O),Y)}function ue(O){return O===47||O===62||jt(O)?N(O):n(O)}function M(O){return O===62?(e.consume(O),K):n(O)}function K(O){return O===null||st(O)?F(O):jt(O)?(e.consume(O),K):n(O)}function F(O){return O===45&&s===2?(e.consume(O),z):O===60&&s===1?(e.consume(O),ee):O===62&&s===4?(e.consume(O),$):O===63&&s===3?(e.consume(O),L):O===93&&s===5?(e.consume(O),Be):st(O)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(vP,ae,ge)(O)):O===null||st(O)?(e.exit("htmlFlowData"),ge(O)):(e.consume(O),F)}function ge(O){return e.check(wP,ce,ae)(O)}function ce(O){return e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),ne}function ne(O){return O===null||st(O)?ge(O):(e.enter("htmlFlowData"),F(O))}function z(O){return O===45?(e.consume(O),L):F(O)}function ee(O){return O===47?(e.consume(O),o="",ke):F(O)}function ke(O){if(O===62){const _e=o.toLowerCase();return m_.includes(_e)?(e.consume(O),$):F(O)}return fr(O)&&o.length<8?(e.consume(O),o+=String.fromCharCode(O),ke):F(O)}function Be(O){return O===93?(e.consume(O),L):F(O)}function L(O){return O===62?(e.consume(O),$):O===45&&s===2?(e.consume(O),L):F(O)}function $(O){return O===null||st(O)?(e.exit("htmlFlowData"),ae(O)):(e.consume(O),$)}function ae(O){return e.exit("htmlFlow"),t(O)}}function SP(e,t,n){const r=this;return s;function s(o){return st(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),l):n(o)}function l(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}function AP(e,t,n){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(_c,t,n)}}const NP={name:"htmlText",tokenize:RP};function RP(e,t,n){const r=this;let s,l,o;return c;function c(L){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(L),d}function d(L){return L===33?(e.consume(L),m):L===47?(e.consume(L),G):L===63?(e.consume(L),N):fr(L)?(e.consume(L),Y):n(L)}function m(L){return L===45?(e.consume(L),p):L===91?(e.consume(L),l=0,v):fr(L)?(e.consume(L),A):n(L)}function p(L){return L===45?(e.consume(L),E):n(L)}function g(L){return L===null?n(L):L===45?(e.consume(L),y):st(L)?(o=g,ee(L)):(e.consume(L),g)}function y(L){return L===45?(e.consume(L),E):g(L)}function E(L){return L===62?z(L):L===45?y(L):g(L)}function v(L){const $="CDATA[";return L===$.charCodeAt(l++)?(e.consume(L),l===$.length?k:v):n(L)}function k(L){return L===null?n(L):L===93?(e.consume(L),C):st(L)?(o=k,ee(L)):(e.consume(L),k)}function C(L){return L===93?(e.consume(L),S):k(L)}function S(L){return L===62?z(L):L===93?(e.consume(L),S):k(L)}function A(L){return L===null||L===62?z(L):st(L)?(o=A,ee(L)):(e.consume(L),A)}function N(L){return L===null?n(L):L===63?(e.consume(L),U):st(L)?(o=N,ee(L)):(e.consume(L),N)}function U(L){return L===62?z(L):N(L)}function G(L){return fr(L)?(e.consume(L),P):n(L)}function P(L){return L===45||ir(L)?(e.consume(L),P):H(L)}function H(L){return st(L)?(o=H,ee(L)):jt(L)?(e.consume(L),H):z(L)}function Y(L){return L===45||ir(L)?(e.consume(L),Y):L===47||L===62||ln(L)?ue(L):n(L)}function ue(L){return L===47?(e.consume(L),z):L===58||L===95||fr(L)?(e.consume(L),M):st(L)?(o=ue,ee(L)):jt(L)?(e.consume(L),ue):z(L)}function M(L){return L===45||L===46||L===58||L===95||ir(L)?(e.consume(L),M):K(L)}function K(L){return L===61?(e.consume(L),F):st(L)?(o=K,ee(L)):jt(L)?(e.consume(L),K):ue(L)}function F(L){return L===null||L===60||L===61||L===62||L===96?n(L):L===34||L===39?(e.consume(L),s=L,ge):st(L)?(o=F,ee(L)):jt(L)?(e.consume(L),F):(e.consume(L),ce)}function ge(L){return L===s?(e.consume(L),s=void 0,ne):L===null?n(L):st(L)?(o=ge,ee(L)):(e.consume(L),ge)}function ce(L){return L===null||L===34||L===39||L===60||L===61||L===96?n(L):L===47||L===62||ln(L)?ue(L):(e.consume(L),ce)}function ne(L){return L===47||L===62||ln(L)?ue(L):n(L)}function z(L){return L===62?(e.consume(L),e.exit("htmlTextData"),e.exit("htmlText"),t):n(L)}function ee(L){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),ke}function ke(L){return jt(L)?zt(e,Be,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):Be(L)}function Be(L){return e.enter("htmlTextData"),o(L)}}const o1={name:"labelEnd",resolveAll:DP,resolveTo:jP,tokenize:MP},LP={tokenize:PP},IP={tokenize:BP},OP={tokenize:UP};function DP(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&&Mr(e,0,e.length,n),e}function jP(e,t){let n=e.length,r=0,s,l,o,c;for(;n--;)if(s=e[n][1],l){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;e[n][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(o){if(e[n][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(l=n,s.type!=="labelLink")){r=2;break}}else s.type==="labelEnd"&&(o=n);const d={type:e[l][1].type==="labelLink"?"link":"image",start:{...e[l][1].start},end:{...e[e.length-1][1].end}},m={type:"label",start:{...e[l][1].start},end:{...e[o][1].end}},p={type:"labelText",start:{...e[l+r+2][1].end},end:{...e[o-2][1].start}};return c=[["enter",d,t],["enter",m,t]],c=ea(c,e.slice(l+1,l+r+3)),c=ea(c,[["enter",p,t]]),c=ea(c,sh(t.parser.constructs.insideSpan.null,e.slice(l+r+4,o-3),t)),c=ea(c,[["exit",p,t],e[o-2],e[o-1],["exit",m,t]]),c=ea(c,e.slice(o+1)),c=ea(c,[["exit",d,t]]),Mr(e,l,e.length,c),e}function MP(e,t,n){const r=this;let s=r.events.length,l,o;for(;s--;)if((r.events[s][1].type==="labelImage"||r.events[s][1].type==="labelLink")&&!r.events[s][1]._balanced){l=r.events[s][1];break}return c;function c(y){return l?l._inactive?g(y):(o=r.parser.defined.includes(Ta(r.sliceSerialize({start:l.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(y),e.exit("labelMarker"),e.exit("labelEnd"),d):n(y)}function d(y){return y===40?e.attempt(LP,p,o?p:g)(y):y===91?e.attempt(IP,p,o?m:g)(y):o?p(y):g(y)}function m(y){return e.attempt(OP,p,g)(y)}function p(y){return t(y)}function g(y){return l._balanced=!0,n(y)}}function PP(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 ln(g)?Xu(e,l)(g):l(g)}function l(g){return g===41?p(g):zw(e,o,c,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(g)}function o(g){return ln(g)?Xu(e,d)(g):p(g)}function c(g){return n(g)}function d(g){return g===34||g===39||g===40?$w(e,m,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(g):p(g)}function m(g){return ln(g)?Xu(e,p)(g):p(g)}function p(g){return g===41?(e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),e.exit("resource"),t):n(g)}}function BP(e,t,n){const r=this;return s;function s(c){return Fw.call(r,e,l,o,"reference","referenceMarker","referenceString")(c)}function l(c){return r.parser.defined.includes(Ta(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(c):n(c)}function o(c){return n(c)}}function UP(e,t,n){return r;function r(l){return e.enter("reference"),e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),s}function s(l){return l===93?(e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),e.exit("reference"),t):n(l)}}const HP={name:"labelStartImage",resolveAll:o1.resolveAll,tokenize:zP};function zP(e,t,n){const r=this;return s;function s(c){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(c),e.exit("labelImageMarker"),l}function l(c){return c===91?(e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelImage"),o):n(c)}function o(c){return c===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(c):t(c)}}const FP={name:"labelStartLink",resolveAll:o1.resolveAll,tokenize:$P};function $P(e,t,n){const r=this;return s;function s(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),l}function l(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const Zp={name:"lineEnding",tokenize:VP};function VP(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),zt(e,t,"linePrefix")}}const cf={name:"thematicBreak",tokenize:GP};function GP(e,t,n){let r=0,s;return l;function l(m){return e.enter("thematicBreak"),o(m)}function o(m){return s=m,c(m)}function c(m){return m===s?(e.enter("thematicBreakSequence"),d(m)):r>=3&&(m===null||st(m))?(e.exit("thematicBreak"),t(m)):n(m)}function d(m){return m===s?(e.consume(m),r++,d):(e.exit("thematicBreakSequence"),jt(m)?zt(e,c,"whitespace")(m):c(m))}}const wr={continuation:{tokenize:QP},exit:KP,name:"list",tokenize:WP},qP={partial:!0,tokenize:ZP},YP={partial:!0,tokenize:XP};function WP(e,t,n){const r=this,s=r.events[r.events.length-1];let l=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,o=0;return c;function c(E){const v=r.containerState.type||(E===42||E===43||E===45?"listUnordered":"listOrdered");if(v==="listUnordered"?!r.containerState.marker||E===r.containerState.marker:W0(E)){if(r.containerState.type||(r.containerState.type=v,e.enter(v,{_container:!0})),v==="listUnordered")return e.enter("listItemPrefix"),E===42||E===45?e.check(cf,n,m)(E):m(E);if(!r.interrupt||E===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),d(E)}return n(E)}function d(E){return W0(E)&&++o<10?(e.consume(E),d):(!r.interrupt||o<2)&&(r.containerState.marker?E===r.containerState.marker:E===41||E===46)?(e.exit("listItemValue"),m(E)):n(E)}function m(E){return e.enter("listItemMarker"),e.consume(E),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||E,e.check(_c,r.interrupt?n:p,e.attempt(qP,y,g))}function p(E){return r.containerState.initialBlankLine=!0,l++,y(E)}function g(E){return jt(E)?(e.enter("listItemPrefixWhitespace"),e.consume(E),e.exit("listItemPrefixWhitespace"),y):n(E)}function y(E){return r.containerState.size=l+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(E)}}function QP(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(_c,s,l);function s(c){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,zt(e,t,"listItemIndent",r.containerState.size+1)(c)}function l(c){return r.containerState.furtherBlankLines||!jt(c)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(c)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(YP,t,o)(c))}function o(c){return r.containerState._closeFlow=!0,r.interrupt=void 0,zt(e,e.attempt(wr,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c)}}function XP(e,t,n){const r=this;return zt(e,s,"listItemIndent",r.containerState.size+1);function s(l){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(l):n(l)}}function KP(e){e.exit(this.containerState.type)}function ZP(e,t,n){const r=this;return zt(e,s,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(l){const o=r.events[r.events.length-1];return!jt(l)&&o&&o[1].type==="listItemPrefixWhitespace"?t(l):n(l)}}const p_={name:"setextUnderline",resolveTo:JP,tokenize:eB};function JP(e,t){let n=e.length,r,s,l;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),!l&&e[n][1].type==="definition"&&(l=n);const o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",l?(e.splice(s,0,["enter",o,t]),e.splice(l+1,0,["exit",e[r][1],t]),e[r][1].end={...e[l][1].end}):e[r][1]=o,e.push(["exit",o,t]),e}function eB(e,t,n){const r=this;let s;return l;function l(m){let p=r.events.length,g;for(;p--;)if(r.events[p][1].type!=="lineEnding"&&r.events[p][1].type!=="linePrefix"&&r.events[p][1].type!=="content"){g=r.events[p][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||g)?(e.enter("setextHeadingLine"),s=m,o(m)):n(m)}function o(m){return e.enter("setextHeadingLineSequence"),c(m)}function c(m){return m===s?(e.consume(m),c):(e.exit("setextHeadingLineSequence"),jt(m)?zt(e,d,"lineSuffix")(m):d(m))}function d(m){return m===null||st(m)?(e.exit("setextHeadingLine"),t(m)):n(m)}}const tB={tokenize:uB,partial:!0};function nB(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:sB,continuation:{tokenize:lB},exit:oB}},text:{91:{name:"gfmFootnoteCall",tokenize:iB},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:rB,resolveTo:aB}}}}function rB(e,t,n){const r=this;let s=r.events.length;const l=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o;for(;s--;){const d=r.events[s][1];if(d.type==="labelImage"){o=d;break}if(d.type==="gfmFootnoteCall"||d.type==="labelLink"||d.type==="label"||d.type==="image"||d.type==="link")break}return c;function c(d){if(!o||!o._balanced)return n(d);const m=Ta(r.sliceSerialize({start:o.end,end:r.now()}));return m.codePointAt(0)!==94||!l.includes(m.slice(1))?n(d):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),t(d))}}function aB(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 l={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},l.start),end:Object.assign({},l.end)},c=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",s,t],["exit",s,t],["enter",l,t],["enter",o,t],["exit",o,t],["exit",l,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...c),e}function iB(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l=0,o;return c;function c(g){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),d}function d(g){return g!==94?n(g):(e.enter("gfmFootnoteCallMarker"),e.consume(g),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",m)}function m(g){if(l>999||g===93&&!o||g===null||g===91||ln(g))return n(g);if(g===93){e.exit("chunkString");const y=e.exit("gfmFootnoteCallString");return s.includes(Ta(r.sliceSerialize(y)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(g)}return ln(g)||(o=!0),l++,e.consume(g),g===92?p:m}function p(g){return g===91||g===92||g===93?(e.consume(g),l++,m):m(g)}}function sB(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l,o=0,c;return d;function d(v){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(v),e.exit("gfmFootnoteDefinitionLabelMarker"),m}function m(v){return v===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(v),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",p):n(v)}function p(v){if(o>999||v===93&&!c||v===null||v===91||ln(v))return n(v);if(v===93){e.exit("chunkString");const k=e.exit("gfmFootnoteDefinitionLabelString");return l=Ta(r.sliceSerialize(k)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(v),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),y}return ln(v)||(c=!0),o++,e.consume(v),v===92?g:p}function g(v){return v===91||v===92||v===93?(e.consume(v),o++,p):p(v)}function y(v){return v===58?(e.enter("definitionMarker"),e.consume(v),e.exit("definitionMarker"),s.includes(l)||s.push(l),zt(e,E,"gfmFootnoteDefinitionWhitespace")):n(v)}function E(v){return t(v)}}function lB(e,t,n){return e.check(_c,t,e.attempt(tB,t,n))}function oB(e){e.exit("gfmFootnoteDefinition")}function uB(e,t,n){const r=this;return zt(e,s,"gfmFootnoteDefinitionIndent",5);function s(l){const o=r.events[r.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?t(l):n(l)}}function cB(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:l,resolveAll:s};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function s(o,c){let d=-1;for(;++d<o.length;)if(o[d][0]==="enter"&&o[d][1].type==="strikethroughSequenceTemporary"&&o[d][1]._close){let m=d;for(;m--;)if(o[m][0]==="exit"&&o[m][1].type==="strikethroughSequenceTemporary"&&o[m][1]._open&&o[d][1].end.offset-o[d][1].start.offset===o[m][1].end.offset-o[m][1].start.offset){o[d][1].type="strikethroughSequence",o[m][1].type="strikethroughSequence";const p={type:"strikethrough",start:Object.assign({},o[m][1].start),end:Object.assign({},o[d][1].end)},g={type:"strikethroughText",start:Object.assign({},o[m][1].end),end:Object.assign({},o[d][1].start)},y=[["enter",p,c],["enter",o[m][1],c],["exit",o[m][1],c],["enter",g,c]],E=c.parser.constructs.insideSpan.null;E&&Mr(y,y.length,0,sh(E,o.slice(m+1,d),c)),Mr(y,y.length,0,[["exit",g,c],["enter",o[d][1],c],["exit",o[d][1],c],["exit",p,c]]),Mr(o,m-1,d-m+3,y),d=m+y.length-2;break}}for(d=-1;++d<o.length;)o[d][1].type==="strikethroughSequenceTemporary"&&(o[d][1].type="data");return o}function l(o,c,d){const m=this.previous,p=this.events;let g=0;return y;function y(v){return m===126&&p[p.length-1][1].type!=="characterEscape"?d(v):(o.enter("strikethroughSequenceTemporary"),E(v))}function E(v){const k=_o(m);if(v===126)return g>1?d(v):(o.consume(v),g++,E);if(g<2&&!n)return d(v);const C=o.exit("strikethroughSequenceTemporary"),S=_o(v);return C._open=!S||S===2&&!!k,C._close=!k||k===2&&!!S,c(v)}}}class dB{constructor(){this.map=[]}add(t,n,r){fB(this,t,n,r)}consume(t){if(this.map.sort(function(l,o){return l[0]-o[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 l of s)t.push(l);s=r.pop()}this.map.length=0}}function fB(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 hB(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 l=r.length-1;r[l]=r[l]==="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 mB(){return{flow:{null:{name:"table",tokenize:pB,resolveAll:gB}}}}function pB(e,t,n){const r=this;let s=0,l=0,o;return c;function c(M){let K=r.events.length-1;for(;K>-1;){const ce=r.events[K][1].type;if(ce==="lineEnding"||ce==="linePrefix")K--;else break}const F=K>-1?r.events[K][1].type:null,ge=F==="tableHead"||F==="tableRow"?P:d;return ge===P&&r.parser.lazy[r.now().line]?n(M):ge(M)}function d(M){return e.enter("tableHead"),e.enter("tableRow"),m(M)}function m(M){return M===124||(o=!0,l+=1),p(M)}function p(M){return M===null?n(M):st(M)?l>1?(l=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),E):n(M):jt(M)?zt(e,p,"whitespace")(M):(l+=1,o&&(o=!1,s+=1),M===124?(e.enter("tableCellDivider"),e.consume(M),e.exit("tableCellDivider"),o=!0,p):(e.enter("data"),g(M)))}function g(M){return M===null||M===124||ln(M)?(e.exit("data"),p(M)):(e.consume(M),M===92?y:g)}function y(M){return M===92||M===124?(e.consume(M),g):g(M)}function E(M){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(M):(e.enter("tableDelimiterRow"),o=!1,jt(M)?zt(e,v,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):v(M))}function v(M){return M===45||M===58?C(M):M===124?(o=!0,e.enter("tableCellDivider"),e.consume(M),e.exit("tableCellDivider"),k):G(M)}function k(M){return jt(M)?zt(e,C,"whitespace")(M):C(M)}function C(M){return M===58?(l+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(M),e.exit("tableDelimiterMarker"),S):M===45?(l+=1,S(M)):M===null||st(M)?U(M):G(M)}function S(M){return M===45?(e.enter("tableDelimiterFiller"),A(M)):G(M)}function A(M){return M===45?(e.consume(M),A):M===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(M),e.exit("tableDelimiterMarker"),N):(e.exit("tableDelimiterFiller"),N(M))}function N(M){return jt(M)?zt(e,U,"whitespace")(M):U(M)}function U(M){return M===124?v(M):M===null||st(M)?!o||s!==l?G(M):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(M)):G(M)}function G(M){return n(M)}function P(M){return e.enter("tableRow"),H(M)}function H(M){return M===124?(e.enter("tableCellDivider"),e.consume(M),e.exit("tableCellDivider"),H):M===null||st(M)?(e.exit("tableRow"),t(M)):jt(M)?zt(e,H,"whitespace")(M):(e.enter("data"),Y(M))}function Y(M){return M===null||M===124||ln(M)?(e.exit("data"),H(M)):(e.consume(M),M===92?ue:Y)}function ue(M){return M===92||M===124?(e.consume(M),Y):Y(M)}}function gB(e,t){let n=-1,r=!0,s=0,l=[0,0,0,0],o=[0,0,0,0],c=!1,d=0,m,p,g;const y=new dB;for(;++n<e.length;){const E=e[n],v=E[1];E[0]==="enter"?v.type==="tableHead"?(c=!1,d!==0&&(g_(y,t,d,m,p),p=void 0,d=0),m={type:"table",start:Object.assign({},v.start),end:Object.assign({},v.end)},y.add(n,0,[["enter",m,t]])):v.type==="tableRow"||v.type==="tableDelimiterRow"?(r=!0,g=void 0,l=[0,0,0,0],o=[0,n+1,0,0],c&&(c=!1,p={type:"tableBody",start:Object.assign({},v.start),end:Object.assign({},v.end)},y.add(n,0,[["enter",p,t]])),s=v.type==="tableDelimiterRow"?2:p?3:1):s&&(v.type==="data"||v.type==="tableDelimiterMarker"||v.type==="tableDelimiterFiller")?(r=!1,o[2]===0&&(l[1]!==0&&(o[0]=o[1],g=Ud(y,t,l,s,void 0,g),l=[0,0,0,0]),o[2]=n)):v.type==="tableCellDivider"&&(r?r=!1:(l[1]!==0&&(o[0]=o[1],g=Ud(y,t,l,s,void 0,g)),l=o,o=[l[1],n,0,0])):v.type==="tableHead"?(c=!0,d=n):v.type==="tableRow"||v.type==="tableDelimiterRow"?(d=n,l[1]!==0?(o[0]=o[1],g=Ud(y,t,l,s,n,g)):o[1]!==0&&(g=Ud(y,t,o,s,n,g)),s=0):s&&(v.type==="data"||v.type==="tableDelimiterMarker"||v.type==="tableDelimiterFiller")&&(o[3]=n)}for(d!==0&&g_(y,t,d,m,p),y.consume(t.events),n=-1;++n<t.events.length;){const E=t.events[n];E[0]==="enter"&&E[1].type==="table"&&(E[1]._align=hB(t.events,n))}return e}function Ud(e,t,n,r,s,l){const o=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",c="tableContent";n[0]!==0&&(l.end=Object.assign({},uo(t.events,n[0])),e.add(n[0],0,[["exit",l,t]]));const d=uo(t.events,n[1]);if(l={type:o,start:Object.assign({},d),end:Object.assign({},d)},e.add(n[1],0,[["enter",l,t]]),n[2]!==0){const m=uo(t.events,n[2]),p=uo(t.events,n[3]),g={type:c,start:Object.assign({},m),end:Object.assign({},p)};if(e.add(n[2],0,[["enter",g,t]]),r!==2){const y=t.events[n[2]],E=t.events[n[3]];if(y[1].end=Object.assign({},E[1].end),y[1].type="chunkText",y[1].contentType="text",n[3]>n[2]+1){const v=n[2]+1,k=n[3]-n[2]-1;e.add(v,k,[])}}e.add(n[3]+1,0,[["exit",g,t]])}return s!==void 0&&(l.end=Object.assign({},uo(t.events,s)),e.add(s,0,[["exit",l,t]]),l=void 0),l}function g_(e,t,n,r,s){const l=[],o=uo(t.events,n);s&&(s.end=Object.assign({},o),l.push(["exit",s,t])),r.end=Object.assign({},o),l.push(["exit",r,t]),e.add(n+1,0,l)}function uo(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const bB={name:"tasklistCheck",tokenize:yB};function xB(){return{text:{91:bB}}}function yB(e,t,n){const r=this;return s;function s(d){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(d):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(d),e.exit("taskListCheckMarker"),l)}function l(d){return ln(d)?(e.enter("taskListCheckValueUnchecked"),e.consume(d),e.exit("taskListCheckValueUnchecked"),o):d===88||d===120?(e.enter("taskListCheckValueChecked"),e.consume(d),e.exit("taskListCheckValueChecked"),o):n(d)}function o(d){return d===93?(e.enter("taskListCheckMarker"),e.consume(d),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),c):n(d)}function c(d){return st(d)?t(d):jt(d)?e.check({tokenize:EB},t,n)(d):n(d)}}function EB(e,t,n){return zt(e,r,"whitespace");function r(s){return s===null?n(s):t(s)}}function _B(e){return Aw([L7(),nB(),cB(e),mB(),xB()])}const TB={};function vB(e){const t=this,n=e||TB,r=t.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),l=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),o=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(_B(n)),l.push(k7()),o.push(C7(n))}var wB=Object.defineProperty,kB=Object.defineProperties,CB=Object.getOwnPropertyDescriptors,b_=Object.getOwnPropertySymbols,SB=Object.prototype.hasOwnProperty,AB=Object.prototype.propertyIsEnumerable,x_=(e,t,n)=>t in e?wB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Vw=(e,t)=>{for(var n in t||(t={}))SB.call(t,n)&&x_(e,n,t[n]);if(b_)for(var n of b_(t))AB.call(t,n)&&x_(e,n,t[n]);return e},Gw=(e,t)=>kB(e,CB(t)),mr=(e,t)=>{let n=!1,r=!1;for(let s=0;s<t;s+=1){if(e[s]==="\\"&&s+1<e.length&&e[s+1]==="`"){s+=1;continue}if(e.substring(s,s+3)==="```"){r=!r,s+=2;continue}!r&&e[s]==="`"&&(n=!n)}return n||r},NB=(e,t)=>{let n=e.substring(t,t+3)==="```",r=t>0&&e.substring(t-1,t+2)==="```",s=t>1&&e.substring(t-2,t+1)==="```";return n||r||s},RB=e=>{let t=0;for(let n=0;n<e.length;n+=1){if(e[n]==="\\"&&n+1<e.length&&e[n+1]==="`"){n+=1;continue}e[n]==="`"&&!NB(e,n)&&(t+=1)}return t},Ts=(e,t)=>{let n=!1,r=!1,s=-1;for(let l=0;l<e.length;l+=1){if(e[l]==="\\"&&l+1<e.length&&e[l+1]==="`"){l+=1;continue}if(e.substring(l,l+3)==="```"){r=!r,l+=2;continue}if(!r&&e[l]==="`")if(n){if(s<t&&t<l)return!0;n=!1,s=-1}else n=!0,s=l}return!1},LB=/^(\s*(?:[-*+]|\d+[.)]) +)>(=?\s*[$]?\d)/gm,IB=e=>!e||typeof e!="string"||!e.includes(">")?e:e.replace(LB,(t,n,r,s)=>mr(e,s)?t:`${n}\\>${r}`),OB=/(\*\*)([^*]*\*?)$/,DB=/(__)([^_]*?)$/,jB=/(\*\*\*)([^*]*?)$/,MB=/(\*)([^*]*?)$/,PB=/(_)([^_]*?)$/,BB=/(`)([^`]*?)$/,UB=/(~~)([^~]*?)$/,gl=/^[\s_~*`]*$/,qw=/^[\s]*[-*+][\s]+$/,HB=/[\p{L}\p{N}_]/u,zB=/^```[^`\n]*```?$/,FB=/^\*{4,}$/,$B=/(__)([^_]+)_$/,VB=/(~~)([^~]+)~$/,y_=/~~/g,vs=e=>{if(!e)return!1;let t=e.charCodeAt(0);return t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122||t===95?!0:HB.test(e)},GB=(e,t)=>{let n=1;for(let r=t-1;r>=0;r-=1)if(e[r]==="]")n+=1;else if(e[r]==="["&&(n-=1,n===0))return r;return-1},Yw=(e,t)=>{let n=1;for(let r=t+1;r<e.length;r+=1)if(e[r]==="[")n+=1;else if(e[r]==="]"&&(n-=1,n===0))return r;return-1},lh=(e,t)=>{let n=!1,r=!1;for(let s=0;s<e.length&&s<t;s+=1){if(e[s]==="\\"&&e[s+1]==="$"){s+=1;continue}e[s]==="$"&&(e[s+1]==="$"?(r=!r,s+=1,n=!1):r||(n=!n))}return n||r},qB=(e,t)=>{for(let n=t;n<e.length;n+=1){if(e[n]===")")return!0;if(e[n]===`
|
|
260
|
+
`)return!1}return!1},Ww=(e,t)=>{for(let n=t-1;n>=0;n-=1){if(e[n]===")")return!1;if(e[n]==="(")return n>0&&e[n-1]==="]"?qB(e,t):!1;if(e[n]===`
|
|
261
|
+
`)return!1}return!1},YB=(e,t)=>{for(let n=t-1;n>=0;n-=1){if(e[n]===">")return!1;if(e[n]==="<"){let r=n+1<e.length?e[n+1]:"";return r>="a"&&r<="z"||r>="A"&&r<="Z"||r==="/"}if(e[n]===`
|
|
262
|
+
`)return!1}return!1},u1=(e,t,n)=>{let r=0;for(let d=t-1;d>=0;d-=1)if(e[d]===`
|
|
263
|
+
`){r=d+1;break}let s=e.length;for(let d=t;d<e.length;d+=1)if(e[d]===`
|
|
264
|
+
`){s=d;break}let l=e.substring(r,s),o=0,c=!1;for(let d of l)if(d===n)o+=1;else if(d!==" "&&d!==" "){c=!0;break}return o>=3&&!c},WB=(e,t,n,r)=>n==="\\"||e.includes("$")&&lh(e,t)?!0:n!=="*"&&r==="*"?(t<e.length-2?e[t+2]:"")!=="*":!!(n==="*"||n&&r&&vs(n)&&vs(r)||(!n||n===" "||n===" "||n===`
|
|
265
|
+
`)&&(!r||r===" "||r===" "||r===`
|
|
266
|
+
`)),Qw=e=>{let t=0,n=!1,r=e.length;for(let s=0;s<r;s+=1){if(e[s]==="`"&&s+2<r&&e[s+1]==="`"&&e[s+2]==="`"){n=!n,s+=2;continue}if(n||e[s]!=="*")continue;let l=s>0?e[s-1]:"",o=s<r-1?e[s+1]:"";WB(e,s,l,o)||(t+=1)}return t},QB=(e,t,n,r)=>!!(n==="\\"||e.includes("$")&&lh(e,t)||Ww(e,t)||YB(e,t)||n==="_"||r==="_"||n&&r&&vs(n)&&vs(r)),XB=e=>{let t=0,n=!1,r=e.length;for(let s=0;s<r;s+=1){if(e[s]==="`"&&s+2<r&&e[s+1]==="`"&&e[s+2]==="`"){n=!n,s+=2;continue}if(n||e[s]!=="_")continue;let l=s>0?e[s-1]:"",o=s<r-1?e[s+1]:"";QB(e,s,l,o)||(t+=1)}return t},KB=e=>{let t=0,n=0,r=!1;for(let s=0;s<e.length;s+=1){if(e[s]==="`"&&s+2<e.length&&e[s+1]==="`"&&e[s+2]==="`"){n>=3&&(t+=Math.floor(n/3)),n=0,r=!r,s+=2;continue}r||(e[s]==="*"?n+=1:(n>=3&&(t+=Math.floor(n/3)),n=0))}return n>=3&&(t+=Math.floor(n/3)),t},c1=e=>{let t=0,n=!1;for(let r=0;r<e.length;r+=1){if(e[r]==="`"&&r+2<e.length&&e[r+1]==="`"&&e[r+2]==="`"){n=!n,r+=2;continue}n||e[r]==="*"&&r+1<e.length&&e[r+1]==="*"&&(t+=1,r+=1)}return t},E_=e=>{let t=0,n=!1;for(let r=0;r<e.length;r+=1){if(e[r]==="`"&&r+2<e.length&&e[r+1]==="`"&&e[r+2]==="`"){n=!n,r+=2;continue}n||e[r]==="_"&&r+1<e.length&&e[r+1]==="_"&&(t+=1,r+=1)}return t},ZB=(e,t,n)=>{if(!t||gl.test(t))return!0;let r=e.substring(0,n).lastIndexOf(`
|
|
267
|
+
`),s=r===-1?0:r+1,l=e.substring(s,n);return qw.test(l)&&t.includes(`
|
|
268
|
+
`)?!0:u1(e,n,"*")},JB=e=>{let t=e.match(OB);if(!t)return e;let n=t[2],r=e.lastIndexOf(t[1]);return mr(e,r)||Ts(e,r)||ZB(e,n,r)?e:c1(e)%2===1?n.endsWith("*")?`${e}*`:`${e}**`:e},eU=(e,t,n)=>{if(!t||gl.test(t))return!0;let r=e.substring(0,n).lastIndexOf(`
|
|
269
|
+
`),s=r===-1?0:r+1,l=e.substring(s,n);return qw.test(l)&&t.includes(`
|
|
270
|
+
`)?!0:u1(e,n,"_")},tU=e=>{let t=e.match(DB);if(!t){let s=e.match($B);if(s){let l=e.lastIndexOf(s[1]);if(!(mr(e,l)||Ts(e,l))&&E_(e)%2===1)return`${e}_`}return e}let n=t[2],r=e.lastIndexOf(t[1]);return mr(e,r)||Ts(e,r)||eU(e,n,r)?e:E_(e)%2===1?`${e}__`:e},nU=e=>{let t=!1;for(let n=0;n<e.length;n+=1){if(e[n]==="`"&&n+2<e.length&&e[n+1]==="`"&&e[n+2]==="`"){t=!t,n+=2;continue}if(!t&&e[n]==="*"&&e[n-1]!=="*"&&e[n+1]!=="*"&&e[n-1]!=="\\"&&!lh(e,n)){let r=n>0?e[n-1]:"",s=n<e.length-1?e[n+1]:"";if((!r||r===" "||r===" "||r===`
|
|
271
|
+
`)&&(!s||s===" "||s===" "||s===`
|
|
272
|
+
`)||r&&s&&vs(r)&&vs(s))continue;return n}}return-1},rU=e=>{if(!e.match(MB))return e;let t=nU(e);if(t===-1||mr(e,t)||Ts(e,t))return e;let n=e.substring(t+1);return!n||gl.test(n)?e:Qw(e)%2===1?`${e}*`:e},Xw=e=>{let t=!1;for(let n=0;n<e.length;n+=1){if(e[n]==="`"&&n+2<e.length&&e[n+1]==="`"&&e[n+2]==="`"){t=!t,n+=2;continue}if(!t&&e[n]==="_"&&e[n-1]!=="_"&&e[n+1]!=="_"&&e[n-1]!=="\\"&&!lh(e,n)&&!Ww(e,n)){let r=n>0?e[n-1]:"",s=n<e.length-1?e[n+1]:"";if(r&&s&&vs(r)&&vs(s))continue;return n}}return-1},aU=e=>{let t=e.length;for(;t>0&&e[t-1]===`
|
|
273
|
+
`;)t-=1;if(t<e.length){let n=e.slice(0,t),r=e.slice(t);return`${n}_${r}`}return`${e}_`},iU=e=>{if(!e.endsWith("**"))return null;let t=e.slice(0,-2);if(c1(t)%2!==1)return null;let n=t.indexOf("**"),r=Xw(t);return n!==-1&&r!==-1&&n<r?`${t}_**`:null},sU=e=>{if(!e.match(PB))return e;let t=Xw(e);if(t===-1)return e;let n=e.substring(t+1);if(!n||gl.test(n)||mr(e,t)||Ts(e,t))return e;if(XB(e)%2===1){let r=iU(e);return r!==null?r:aU(e)}return e},lU=e=>{let t=c1(e),n=Qw(e);return t%2===0&&n%2===0},oU=(e,t,n)=>!t||gl.test(t)||mr(e,n)||Ts(e,n)?!0:u1(e,n,"*"),uU=e=>{if(FB.test(e))return e;let t=e.match(jB);if(!t)return e;let n=t[2],r=e.lastIndexOf(t[1]);return oU(e,n,r)?e:KB(e)%2===1?lU(e)?e:`${e}***`:e},cU=/<[a-zA-Z/][^>]*$/,dU=e=>{let t=e.match(cU);return!t||t.index===void 0||mr(e,t.index)?e:e.substring(0,t.index).trimEnd()},fU=e=>!e.match(zB)||e.includes(`
|
|
274
|
+
`)?null:e.endsWith("``")&&!e.endsWith("```")?`${e}\``:e,hU=e=>(e.match(/```/g)||[]).length%2===1,mU=e=>{let t=fU(e);if(t!==null)return t;let n=e.match(BB);if(n&&!hU(e)){let r=n[2];if(!r||gl.test(r))return e;if(RB(e)%2===1)return`${e}\``}return e},Kw=(e,t)=>t>=2&&e.substring(t-2,t+1)==="```"||t>=1&&e.substring(t-1,t+2)==="```"||t<=e.length-3&&e.substring(t,t+3)==="```",pU=e=>{let t=0,n=!1;for(let r=0;r<e.length-1;r+=1)e[r]==="`"&&!Kw(e,r)&&(n=!n),!n&&e[r]==="$"&&e[r+1]==="$"&&(t+=1,r+=1);return t},gU=e=>{let t=0,n=!1;for(let r=0;r<e.length;r+=1){if(e[r]==="\\"){r+=1;continue}if(e[r]==="`"&&!Kw(e,r)){n=!n;continue}!n&&e[r]==="$"&&(r+1<e.length&&e[r+1]==="$"?r+=1:t+=1)}return t},bU=e=>{if(e.endsWith("$")&&!e.endsWith("$$"))return`${e}$`;let t=e.indexOf("$$");return t!==-1&&e.indexOf(`
|
|
275
|
+
`,t)!==-1&&!e.endsWith(`
|
|
276
|
+
`)?`${e}
|
|
277
|
+
$$`:`${e}$$`},xU=e=>pU(e)%2===0?e:bU(e),yU=e=>gU(e)%2===1?`${e}$`:e,EU=(e,t,n)=>{if(e.substring(t+2).includes(")"))return null;let r=GB(e,t);if(r===-1||mr(e,r))return null;let s=r>0&&e[r-1]==="!",l=s?r-1:r,o=e.substring(0,l);if(s)return o;let c=e.substring(r+1,t);return n==="text-only"?`${o}${c}`:`${o}[${c}](streamdown:incomplete-link)`},__=(e,t)=>{for(let n=0;n<t;n++)if(e[n]==="["&&!mr(e,n)){if(n>0&&e[n-1]==="!")continue;let r=Yw(e,n);if(r===-1)return n;if(r+1<e.length&&e[r+1]==="("){let s=e.indexOf(")",r+2);s!==-1&&(n=s)}}return t},_U=(e,t,n)=>{let r=t>0&&e[t-1]==="!",s=r?t-1:t;if(!e.substring(t+1).includes("]")){let l=e.substring(0,s);if(r)return l;if(n==="text-only"){let o=__(e,t);return e.substring(0,o)+e.substring(o+1)}return`${e}](streamdown:incomplete-link)`}if(Yw(e,t)===-1){let l=e.substring(0,s);if(r)return l;if(n==="text-only"){let o=__(e,t);return e.substring(0,o)+e.substring(o+1)}return`${e}](streamdown:incomplete-link)`}return null},Zw=(e,t="protocol")=>{let n=e.lastIndexOf("](");if(n!==-1&&!mr(e,n)){let r=EU(e,n,t);if(r!==null)return r}for(let r=e.length-1;r>=0;r-=1)if(e[r]==="["&&!mr(e,r)){let s=_U(e,r,t);if(s!==null)return s}return e},TU=/^-{1,2}$/,vU=/^[\s]*-{1,2}[\s]+$/,wU=/^={1,2}$/,kU=/^[\s]*={1,2}[\s]+$/,CU=e=>{if(!e||typeof e!="string")return e;let t=e.lastIndexOf(`
|
|
278
|
+
`);if(t===-1)return e;let n=e.substring(t+1),r=e.substring(0,t),s=n.trim();if(TU.test(s)&&!n.match(vU)){let l=r.split(`
|
|
279
|
+
`).at(-1);if(l&&l.trim().length>0)return`${e}`}if(wU.test(s)&&!n.match(kU)){let l=r.split(`
|
|
280
|
+
`).at(-1);if(l&&l.trim().length>0)return`${e}`}return e},SU=new RegExp("(?<=[\\p{L}\\p{N}_])~(?!~)(?=[\\p{L}\\p{N}_])","gu"),AU=e=>!e||typeof e!="string"||!e.includes("~")?e:e.replace(SU,(t,n)=>mr(e,n)?t:"\\~"),NU=e=>{var t,n;let r=e.match(UB);if(r){let s=r[2];if(!s||gl.test(s))return e;let l=e.lastIndexOf(r[1]);if(mr(e,l)||Ts(e,l))return e;if(((t=e.match(y_))==null?void 0:t.length)%2===1)return`${e}~~`}else{let s=e.match(VB);if(s){let l=e.lastIndexOf(s[0].slice(0,2));if(mr(e,l)||Ts(e,l))return e;if(((n=e.match(y_))==null?void 0:n.length)%2===1)return`${e}~`}}return e},Jp=e=>e!==!1,RU=e=>e===!0,dr={SINGLE_TILDE:0,COMPARISON_OPERATORS:5,HTML_TAGS:10,SETEXT_HEADINGS:15,LINKS:20,BOLD_ITALIC:30,BOLD:35,ITALIC_DOUBLE_UNDERSCORE:40,ITALIC_SINGLE_ASTERISK:41,ITALIC_SINGLE_UNDERSCORE:42,INLINE_CODE:50,STRIKETHROUGH:60,KATEX:70,INLINE_KATEX:75,DEFAULT:100},LU=[{handler:{name:"singleTilde",handle:AU,priority:dr.SINGLE_TILDE},optionKey:"singleTilde"},{handler:{name:"comparisonOperators",handle:IB,priority:dr.COMPARISON_OPERATORS},optionKey:"comparisonOperators"},{handler:{name:"htmlTags",handle:dU,priority:dr.HTML_TAGS},optionKey:"htmlTags"},{handler:{name:"setextHeadings",handle:CU,priority:dr.SETEXT_HEADINGS},optionKey:"setextHeadings"},{handler:{name:"links",handle:Zw,priority:dr.LINKS},optionKey:"links",earlyReturn:e=>e.endsWith("](streamdown:incomplete-link)")},{handler:{name:"boldItalic",handle:uU,priority:dr.BOLD_ITALIC},optionKey:"boldItalic"},{handler:{name:"bold",handle:JB,priority:dr.BOLD},optionKey:"bold"},{handler:{name:"italicDoubleUnderscore",handle:tU,priority:dr.ITALIC_DOUBLE_UNDERSCORE},optionKey:"italic"},{handler:{name:"italicSingleAsterisk",handle:rU,priority:dr.ITALIC_SINGLE_ASTERISK},optionKey:"italic"},{handler:{name:"italicSingleUnderscore",handle:sU,priority:dr.ITALIC_SINGLE_UNDERSCORE},optionKey:"italic"},{handler:{name:"inlineCode",handle:mU,priority:dr.INLINE_CODE},optionKey:"inlineCode"},{handler:{name:"strikethrough",handle:NU,priority:dr.STRIKETHROUGH},optionKey:"strikethrough"},{handler:{name:"katex",handle:xU,priority:dr.KATEX},optionKey:"katex"},{handler:{name:"inlineKatex",handle:yU,priority:dr.INLINE_KATEX},optionKey:"inlineKatex"}],IU=e=>{var t;let n=(t=e==null?void 0:e.linkMode)!=null?t:"protocol";return LU.filter(({handler:r,optionKey:s})=>r.name==="links"?Jp(e==null?void 0:e.links)||Jp(e==null?void 0:e.images):r.name==="inlineKatex"?RU(e==null?void 0:e.inlineKatex):Jp(e==null?void 0:e[s])).map(({handler:r,earlyReturn:s})=>r.name==="links"?{handler:Gw(Vw({},r),{handle:l=>Zw(l,n)}),earlyReturn:n==="protocol"?s:void 0}:{handler:r,earlyReturn:s})},OU=(e,t)=>{var n;if(!e||typeof e!="string")return e;let r=e.endsWith(" ")&&!e.endsWith(" ")?e.slice(0,-1):e,s=IU(t),l=((n=t==null?void 0:t.handlers)!=null?n:[]).map(c=>{var d;return{handler:Gw(Vw({},c),{priority:(d=c.priority)!=null?d:dr.DEFAULT}),earlyReturn:void 0}}),o=[...s,...l].sort((c,d)=>{var m,p;return((m=c.handler.priority)!=null?m:0)-((p=d.handler.priority)!=null?p:0)});for(let{handler:c,earlyReturn:d}of o)if(r=c.handle(r),d!=null&&d(r))return r;return r},DU=OU;function Jw(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=Jw(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function ek(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=Jw(e))&&(r&&(r+=" "),r+=t);return r}const jU=(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},MU=(e,t)=>({classGroupId:e,validator:t}),tk=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),If="-",T_=[],PU="arbitrary..",BU=e=>{const t=HU(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return UU(o);const c=o.split(If),d=c[0]===""&&c.length>1?1:0;return nk(c,d,t)},getConflictingClassGroupIds:(o,c)=>{if(c){const d=r[o],m=n[o];return d?m?jU(m,d):d:m||T_}return n[o]||T_}}},nk=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const s=e[t],l=n.nextPart.get(s);if(l){const m=nk(e,t+1,l);if(m)return m}const o=n.validators;if(o===null)return;const c=t===0?e.join(If):e.slice(t).join(If),d=o.length;for(let m=0;m<d;m++){const p=o[m];if(p.validator(c))return p.classGroupId}},UU=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?PU+r:void 0})(),HU=e=>{const{theme:t,classGroups:n}=e;return zU(n,t)},zU=(e,t)=>{const n=tk();for(const r in e){const s=e[r];d1(s,n,r,t)}return n},d1=(e,t,n,r)=>{const s=e.length;for(let l=0;l<s;l++){const o=e[l];FU(o,t,n,r)}},FU=(e,t,n,r)=>{if(typeof e=="string"){$U(e,t,n);return}if(typeof e=="function"){VU(e,t,n,r);return}GU(e,t,n,r)},$U=(e,t,n)=>{const r=e===""?t:rk(t,e);r.classGroupId=n},VU=(e,t,n,r)=>{if(qU(e)){d1(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(MU(n,e))},GU=(e,t,n,r)=>{const s=Object.entries(e),l=s.length;for(let o=0;o<l;o++){const[c,d]=s[o];d1(d,rk(t,c),n,r)}},rk=(e,t)=>{let n=e;const r=t.split(If),s=r.length;for(let l=0;l<s;l++){const o=r[l];let c=n.nextPart.get(o);c||(c=tk(),n.nextPart.set(o,c)),n=c}return n},qU=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,YU=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const s=(l,o)=>{n[l]=o,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(l){let o=n[l];if(o!==void 0)return o;if((o=r[l])!==void 0)return s(l,o),o},set(l,o){l in n?n[l]=o:s(l,o)}}},K0="!",v_=":",WU=[],w_=(e,t,n,r,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:s}),QU=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=s=>{const l=[];let o=0,c=0,d=0,m;const p=s.length;for(let k=0;k<p;k++){const C=s[k];if(o===0&&c===0){if(C===v_){l.push(s.slice(d,k)),d=k+1;continue}if(C==="/"){m=k;continue}}C==="["?o++:C==="]"?o--:C==="("?c++:C===")"&&c--}const g=l.length===0?s:s.slice(d);let y=g,E=!1;g.endsWith(K0)?(y=g.slice(0,-1),E=!0):g.startsWith(K0)&&(y=g.slice(1),E=!0);const v=m&&m>d?m-d:void 0;return w_(l,E,y,v)};if(t){const s=t+v_,l=r;r=o=>o.startsWith(s)?l(o.slice(s.length)):w_(WU,!1,o,void 0,!0)}if(n){const s=r;r=l=>n({className:l,parseClassName:s})}return r},XU=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let s=[];for(let l=0;l<n.length;l++){const o=n[l],c=o[0]==="[",d=t.has(o);c||d?(s.length>0&&(s.sort(),r.push(...s),s=[]),r.push(o)):s.push(o)}return s.length>0&&(s.sort(),r.push(...s)),r}},KU=e=>({cache:YU(e.cacheSize),parseClassName:QU(e),sortModifiers:XU(e),...BU(e)}),ZU=/\s+/,JU=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:l}=t,o=[],c=e.trim().split(ZU);let d="";for(let m=c.length-1;m>=0;m-=1){const p=c[m],{isExternal:g,modifiers:y,hasImportantModifier:E,baseClassName:v,maybePostfixModifierPosition:k}=n(p);if(g){d=p+(d.length>0?" "+d:d);continue}let C=!!k,S=r(C?v.substring(0,k):v);if(!S){if(!C){d=p+(d.length>0?" "+d:d);continue}if(S=r(v),!S){d=p+(d.length>0?" "+d:d);continue}C=!1}const A=y.length===0?"":y.length===1?y[0]:l(y).join(":"),N=E?A+K0:A,U=N+S;if(o.indexOf(U)>-1)continue;o.push(U);const G=s(S,C);for(let P=0;P<G.length;++P){const H=G[P];o.push(N+H)}d=p+(d.length>0?" "+d:d)}return d},eH=(...e)=>{let t=0,n,r,s="";for(;t<e.length;)(n=e[t++])&&(r=ak(n))&&(s&&(s+=" "),s+=r);return s},ak=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=ak(e[r]))&&(n&&(n+=" "),n+=t);return n},tH=(e,...t)=>{let n,r,s,l;const o=d=>{const m=t.reduce((p,g)=>g(p),e());return n=KU(m),r=n.cache.get,s=n.cache.set,l=c,c(d)},c=d=>{const m=r(d);if(m)return m;const p=JU(d,n);return s(d,p),p};return l=o,(...d)=>l(eH(...d))},nH=[],Hn=e=>{const t=n=>n[e]||nH;return t.isThemeGetter=!0,t},ik=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,sk=/^\((?:(\w[\w-]*):)?(.+)\)$/i,rH=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,aH=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,iH=/\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$/,sH=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,lH=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,oH=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,us=e=>rH.test(e),Rt=e=>!!e&&!Number.isNaN(Number(e)),cs=e=>!!e&&Number.isInteger(Number(e)),e0=e=>e.endsWith("%")&&Rt(e.slice(0,-1)),yi=e=>aH.test(e),lk=()=>!0,uH=e=>iH.test(e)&&!sH.test(e),f1=()=>!1,cH=e=>lH.test(e),dH=e=>oH.test(e),fH=e=>!Ye(e)&&!Xe(e),hH=e=>Cs(e,ck,f1),Ye=e=>ik.test(e),el=e=>Cs(e,dk,uH),k_=e=>Cs(e,_H,Rt),mH=e=>Cs(e,hk,lk),pH=e=>Cs(e,fk,f1),C_=e=>Cs(e,ok,f1),gH=e=>Cs(e,uk,dH),Hd=e=>Cs(e,mk,cH),Xe=e=>sk.test(e),Ru=e=>bl(e,dk),bH=e=>bl(e,fk),S_=e=>bl(e,ok),xH=e=>bl(e,ck),yH=e=>bl(e,uk),zd=e=>bl(e,mk,!0),EH=e=>bl(e,hk,!0),Cs=(e,t,n)=>{const r=ik.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},bl=(e,t,n=!1)=>{const r=sk.exec(e);return r?r[1]?t(r[1]):n:!1},ok=e=>e==="position"||e==="percentage",uk=e=>e==="image"||e==="url",ck=e=>e==="length"||e==="size"||e==="bg-size",dk=e=>e==="length",_H=e=>e==="number",fk=e=>e==="family-name",hk=e=>e==="number"||e==="weight",mk=e=>e==="shadow",TH=()=>{const e=Hn("color"),t=Hn("font"),n=Hn("text"),r=Hn("font-weight"),s=Hn("tracking"),l=Hn("leading"),o=Hn("breakpoint"),c=Hn("container"),d=Hn("spacing"),m=Hn("radius"),p=Hn("shadow"),g=Hn("inset-shadow"),y=Hn("text-shadow"),E=Hn("drop-shadow"),v=Hn("blur"),k=Hn("perspective"),C=Hn("aspect"),S=Hn("ease"),A=Hn("animate"),N=()=>["auto","avoid","all","avoid-page","page","left","right","column"],U=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],G=()=>[...U(),Xe,Ye],P=()=>["auto","hidden","clip","visible","scroll"],H=()=>["auto","contain","none"],Y=()=>[Xe,Ye,d],ue=()=>[us,"full","auto",...Y()],M=()=>[cs,"none","subgrid",Xe,Ye],K=()=>["auto",{span:["full",cs,Xe,Ye]},cs,Xe,Ye],F=()=>[cs,"auto",Xe,Ye],ge=()=>["auto","min","max","fr",Xe,Ye],ce=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ne=()=>["start","end","center","stretch","center-safe","end-safe"],z=()=>["auto",...Y()],ee=()=>[us,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...Y()],ke=()=>[us,"screen","full","dvw","lvw","svw","min","max","fit",...Y()],Be=()=>[us,"screen","full","lh","dvh","lvh","svh","min","max","fit",...Y()],L=()=>[e,Xe,Ye],$=()=>[...U(),S_,C_,{position:[Xe,Ye]}],ae=()=>["no-repeat",{repeat:["","x","y","space","round"]}],O=()=>["auto","cover","contain",xH,hH,{size:[Xe,Ye]}],_e=()=>[e0,Ru,el],Re=()=>["","none","full",m,Xe,Ye],we=()=>["",Rt,Ru,el],et=()=>["solid","dashed","dotted","double"],Fe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Ie=()=>[Rt,e0,S_,C_],kt=()=>["","none",v,Xe,Ye],at=()=>["none",Rt,Xe,Ye],Nt=()=>["none",Rt,Xe,Ye],Gt=()=>[Rt,Xe,Ye],Ut=()=>[us,"full",...Y()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[yi],breakpoint:[yi],color:[lk],container:[yi],"drop-shadow":[yi],ease:["in","out","in-out"],font:[fH],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[yi],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[yi],shadow:[yi],spacing:["px",Rt],text:[yi],"text-shadow":[yi],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",us,Ye,Xe,C]}],container:["container"],columns:[{columns:[Rt,Ye,Xe,c]}],"break-after":[{"break-after":N()}],"break-before":[{"break-before":N()}],"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:G()}],overflow:[{overflow:P()}],"overflow-x":[{"overflow-x":P()}],"overflow-y":[{"overflow-y":P()}],overscroll:[{overscroll:H()}],"overscroll-x":[{"overscroll-x":H()}],"overscroll-y":[{"overscroll-y":H()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:ue()}],"inset-x":[{"inset-x":ue()}],"inset-y":[{"inset-y":ue()}],start:[{"inset-s":ue(),start:ue()}],end:[{"inset-e":ue(),end:ue()}],"inset-bs":[{"inset-bs":ue()}],"inset-be":[{"inset-be":ue()}],top:[{top:ue()}],right:[{right:ue()}],bottom:[{bottom:ue()}],left:[{left:ue()}],visibility:["visible","invisible","collapse"],z:[{z:[cs,"auto",Xe,Ye]}],basis:[{basis:[us,"full","auto",c,...Y()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Rt,us,"auto","initial","none",Ye]}],grow:[{grow:["",Rt,Xe,Ye]}],shrink:[{shrink:["",Rt,Xe,Ye]}],order:[{order:[cs,"first","last","none",Xe,Ye]}],"grid-cols":[{"grid-cols":M()}],"col-start-end":[{col:K()}],"col-start":[{"col-start":F()}],"col-end":[{"col-end":F()}],"grid-rows":[{"grid-rows":M()}],"row-start-end":[{row:K()}],"row-start":[{"row-start":F()}],"row-end":[{"row-end":F()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":ge()}],"auto-rows":[{"auto-rows":ge()}],gap:[{gap:Y()}],"gap-x":[{"gap-x":Y()}],"gap-y":[{"gap-y":Y()}],"justify-content":[{justify:[...ce(),"normal"]}],"justify-items":[{"justify-items":[...ne(),"normal"]}],"justify-self":[{"justify-self":["auto",...ne()]}],"align-content":[{content:["normal",...ce()]}],"align-items":[{items:[...ne(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ne(),{baseline:["","last"]}]}],"place-content":[{"place-content":ce()}],"place-items":[{"place-items":[...ne(),"baseline"]}],"place-self":[{"place-self":["auto",...ne()]}],p:[{p:Y()}],px:[{px:Y()}],py:[{py:Y()}],ps:[{ps:Y()}],pe:[{pe:Y()}],pbs:[{pbs:Y()}],pbe:[{pbe:Y()}],pt:[{pt:Y()}],pr:[{pr:Y()}],pb:[{pb:Y()}],pl:[{pl:Y()}],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":Y()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":Y()}],"space-y-reverse":["space-y-reverse"],size:[{size:ee()}],"inline-size":[{inline:["auto",...ke()]}],"min-inline-size":[{"min-inline":["auto",...ke()]}],"max-inline-size":[{"max-inline":["none",...ke()]}],"block-size":[{block:["auto",...Be()]}],"min-block-size":[{"min-block":["auto",...Be()]}],"max-block-size":[{"max-block":["none",...Be()]}],w:[{w:[c,"screen",...ee()]}],"min-w":[{"min-w":[c,"screen","none",...ee()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[o]},...ee()]}],h:[{h:["screen","lh",...ee()]}],"min-h":[{"min-h":["screen","lh","none",...ee()]}],"max-h":[{"max-h":["screen","lh",...ee()]}],"font-size":[{text:["base",n,Ru,el]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,EH,mH]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",e0,Ye]}],"font-family":[{font:[bH,pH,t]}],"font-features":[{"font-features":[Ye]}],"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,Xe,Ye]}],"line-clamp":[{"line-clamp":[Rt,"none",Xe,k_]}],leading:[{leading:[l,...Y()]}],"list-image":[{"list-image":["none",Xe,Ye]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Xe,Ye]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:L()}],"text-color":[{text:L()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...et(),"wavy"]}],"text-decoration-thickness":[{decoration:[Rt,"from-font","auto",Xe,el]}],"text-decoration-color":[{decoration:L()}],"underline-offset":[{"underline-offset":[Rt,"auto",Xe,Ye]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:Y()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Xe,Ye]}],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",Xe,Ye]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:$()}],"bg-repeat":[{bg:ae()}],"bg-size":[{bg:O()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},cs,Xe,Ye],radial:["",Xe,Ye],conic:[cs,Xe,Ye]},yH,gH]}],"bg-color":[{bg:L()}],"gradient-from-pos":[{from:_e()}],"gradient-via-pos":[{via:_e()}],"gradient-to-pos":[{to:_e()}],"gradient-from":[{from:L()}],"gradient-via":[{via:L()}],"gradient-to":[{to:L()}],rounded:[{rounded:Re()}],"rounded-s":[{"rounded-s":Re()}],"rounded-e":[{"rounded-e":Re()}],"rounded-t":[{"rounded-t":Re()}],"rounded-r":[{"rounded-r":Re()}],"rounded-b":[{"rounded-b":Re()}],"rounded-l":[{"rounded-l":Re()}],"rounded-ss":[{"rounded-ss":Re()}],"rounded-se":[{"rounded-se":Re()}],"rounded-ee":[{"rounded-ee":Re()}],"rounded-es":[{"rounded-es":Re()}],"rounded-tl":[{"rounded-tl":Re()}],"rounded-tr":[{"rounded-tr":Re()}],"rounded-br":[{"rounded-br":Re()}],"rounded-bl":[{"rounded-bl":Re()}],"border-w":[{border:we()}],"border-w-x":[{"border-x":we()}],"border-w-y":[{"border-y":we()}],"border-w-s":[{"border-s":we()}],"border-w-e":[{"border-e":we()}],"border-w-bs":[{"border-bs":we()}],"border-w-be":[{"border-be":we()}],"border-w-t":[{"border-t":we()}],"border-w-r":[{"border-r":we()}],"border-w-b":[{"border-b":we()}],"border-w-l":[{"border-l":we()}],"divide-x":[{"divide-x":we()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":we()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...et(),"hidden","none"]}],"divide-style":[{divide:[...et(),"hidden","none"]}],"border-color":[{border:L()}],"border-color-x":[{"border-x":L()}],"border-color-y":[{"border-y":L()}],"border-color-s":[{"border-s":L()}],"border-color-e":[{"border-e":L()}],"border-color-bs":[{"border-bs":L()}],"border-color-be":[{"border-be":L()}],"border-color-t":[{"border-t":L()}],"border-color-r":[{"border-r":L()}],"border-color-b":[{"border-b":L()}],"border-color-l":[{"border-l":L()}],"divide-color":[{divide:L()}],"outline-style":[{outline:[...et(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Rt,Xe,Ye]}],"outline-w":[{outline:["",Rt,Ru,el]}],"outline-color":[{outline:L()}],shadow:[{shadow:["","none",p,zd,Hd]}],"shadow-color":[{shadow:L()}],"inset-shadow":[{"inset-shadow":["none",g,zd,Hd]}],"inset-shadow-color":[{"inset-shadow":L()}],"ring-w":[{ring:we()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:L()}],"ring-offset-w":[{"ring-offset":[Rt,el]}],"ring-offset-color":[{"ring-offset":L()}],"inset-ring-w":[{"inset-ring":we()}],"inset-ring-color":[{"inset-ring":L()}],"text-shadow":[{"text-shadow":["none",y,zd,Hd]}],"text-shadow-color":[{"text-shadow":L()}],opacity:[{opacity:[Rt,Xe,Ye]}],"mix-blend":[{"mix-blend":[...Fe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Fe()}],"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":[Rt]}],"mask-image-linear-from-pos":[{"mask-linear-from":Ie()}],"mask-image-linear-to-pos":[{"mask-linear-to":Ie()}],"mask-image-linear-from-color":[{"mask-linear-from":L()}],"mask-image-linear-to-color":[{"mask-linear-to":L()}],"mask-image-t-from-pos":[{"mask-t-from":Ie()}],"mask-image-t-to-pos":[{"mask-t-to":Ie()}],"mask-image-t-from-color":[{"mask-t-from":L()}],"mask-image-t-to-color":[{"mask-t-to":L()}],"mask-image-r-from-pos":[{"mask-r-from":Ie()}],"mask-image-r-to-pos":[{"mask-r-to":Ie()}],"mask-image-r-from-color":[{"mask-r-from":L()}],"mask-image-r-to-color":[{"mask-r-to":L()}],"mask-image-b-from-pos":[{"mask-b-from":Ie()}],"mask-image-b-to-pos":[{"mask-b-to":Ie()}],"mask-image-b-from-color":[{"mask-b-from":L()}],"mask-image-b-to-color":[{"mask-b-to":L()}],"mask-image-l-from-pos":[{"mask-l-from":Ie()}],"mask-image-l-to-pos":[{"mask-l-to":Ie()}],"mask-image-l-from-color":[{"mask-l-from":L()}],"mask-image-l-to-color":[{"mask-l-to":L()}],"mask-image-x-from-pos":[{"mask-x-from":Ie()}],"mask-image-x-to-pos":[{"mask-x-to":Ie()}],"mask-image-x-from-color":[{"mask-x-from":L()}],"mask-image-x-to-color":[{"mask-x-to":L()}],"mask-image-y-from-pos":[{"mask-y-from":Ie()}],"mask-image-y-to-pos":[{"mask-y-to":Ie()}],"mask-image-y-from-color":[{"mask-y-from":L()}],"mask-image-y-to-color":[{"mask-y-to":L()}],"mask-image-radial":[{"mask-radial":[Xe,Ye]}],"mask-image-radial-from-pos":[{"mask-radial-from":Ie()}],"mask-image-radial-to-pos":[{"mask-radial-to":Ie()}],"mask-image-radial-from-color":[{"mask-radial-from":L()}],"mask-image-radial-to-color":[{"mask-radial-to":L()}],"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":U()}],"mask-image-conic-pos":[{"mask-conic":[Rt]}],"mask-image-conic-from-pos":[{"mask-conic-from":Ie()}],"mask-image-conic-to-pos":[{"mask-conic-to":Ie()}],"mask-image-conic-from-color":[{"mask-conic-from":L()}],"mask-image-conic-to-color":[{"mask-conic-to":L()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:$()}],"mask-repeat":[{mask:ae()}],"mask-size":[{mask:O()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Xe,Ye]}],filter:[{filter:["","none",Xe,Ye]}],blur:[{blur:kt()}],brightness:[{brightness:[Rt,Xe,Ye]}],contrast:[{contrast:[Rt,Xe,Ye]}],"drop-shadow":[{"drop-shadow":["","none",E,zd,Hd]}],"drop-shadow-color":[{"drop-shadow":L()}],grayscale:[{grayscale:["",Rt,Xe,Ye]}],"hue-rotate":[{"hue-rotate":[Rt,Xe,Ye]}],invert:[{invert:["",Rt,Xe,Ye]}],saturate:[{saturate:[Rt,Xe,Ye]}],sepia:[{sepia:["",Rt,Xe,Ye]}],"backdrop-filter":[{"backdrop-filter":["","none",Xe,Ye]}],"backdrop-blur":[{"backdrop-blur":kt()}],"backdrop-brightness":[{"backdrop-brightness":[Rt,Xe,Ye]}],"backdrop-contrast":[{"backdrop-contrast":[Rt,Xe,Ye]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Rt,Xe,Ye]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Rt,Xe,Ye]}],"backdrop-invert":[{"backdrop-invert":["",Rt,Xe,Ye]}],"backdrop-opacity":[{"backdrop-opacity":[Rt,Xe,Ye]}],"backdrop-saturate":[{"backdrop-saturate":[Rt,Xe,Ye]}],"backdrop-sepia":[{"backdrop-sepia":["",Rt,Xe,Ye]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":Y()}],"border-spacing-x":[{"border-spacing-x":Y()}],"border-spacing-y":[{"border-spacing-y":Y()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Xe,Ye]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Rt,"initial",Xe,Ye]}],ease:[{ease:["linear","initial",S,Xe,Ye]}],delay:[{delay:[Rt,Xe,Ye]}],animate:[{animate:["none",A,Xe,Ye]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[k,Xe,Ye]}],"perspective-origin":[{"perspective-origin":G()}],rotate:[{rotate:at()}],"rotate-x":[{"rotate-x":at()}],"rotate-y":[{"rotate-y":at()}],"rotate-z":[{"rotate-z":at()}],scale:[{scale:Nt()}],"scale-x":[{"scale-x":Nt()}],"scale-y":[{"scale-y":Nt()}],"scale-z":[{"scale-z":Nt()}],"scale-3d":["scale-3d"],skew:[{skew:Gt()}],"skew-x":[{"skew-x":Gt()}],"skew-y":[{"skew-y":Gt()}],transform:[{transform:[Xe,Ye,"","none","gpu","cpu"]}],"transform-origin":[{origin:G()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ut()}],"translate-x":[{"translate-x":Ut()}],"translate-y":[{"translate-y":Ut()}],"translate-z":[{"translate-z":Ut()}],"translate-none":["translate-none"],accent:[{accent:L()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:L()}],"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",Xe,Ye]}],"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":Y()}],"scroll-mx":[{"scroll-mx":Y()}],"scroll-my":[{"scroll-my":Y()}],"scroll-ms":[{"scroll-ms":Y()}],"scroll-me":[{"scroll-me":Y()}],"scroll-mbs":[{"scroll-mbs":Y()}],"scroll-mbe":[{"scroll-mbe":Y()}],"scroll-mt":[{"scroll-mt":Y()}],"scroll-mr":[{"scroll-mr":Y()}],"scroll-mb":[{"scroll-mb":Y()}],"scroll-ml":[{"scroll-ml":Y()}],"scroll-p":[{"scroll-p":Y()}],"scroll-px":[{"scroll-px":Y()}],"scroll-py":[{"scroll-py":Y()}],"scroll-ps":[{"scroll-ps":Y()}],"scroll-pe":[{"scroll-pe":Y()}],"scroll-pbs":[{"scroll-pbs":Y()}],"scroll-pbe":[{"scroll-pbe":Y()}],"scroll-pt":[{"scroll-pt":Y()}],"scroll-pr":[{"scroll-pr":Y()}],"scroll-pb":[{"scroll-pb":Y()}],"scroll-pl":[{"scroll-pl":Y()}],"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",Xe,Ye]}],fill:[{fill:["none",...L()]}],"stroke-w":[{stroke:[Rt,Ru,el,k_]}],stroke:[{stroke:["none",...L()]}],"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"]}},pk=tH(TH),vH=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,wH=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,kH={};function A_(e,t){return(kH.jsx?wH:vH).test(e)}var ro={},t0,N_;function CH(){if(N_)return t0;N_=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,l=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,c=/^\s+|\s+$/g,d=`
|
|
281
|
+
`,m="/",p="*",g="",y="comment",E="declaration";function v(C,S){if(typeof C!="string")throw new TypeError("First argument must be a string");if(!C)return[];S=S||{};var A=1,N=1;function U(ce){var ne=ce.match(t);ne&&(A+=ne.length);var z=ce.lastIndexOf(d);N=~z?ce.length-z:N+ce.length}function G(){var ce={line:A,column:N};return function(ne){return ne.position=new P(ce),ue(),ne}}function P(ce){this.start=ce,this.end={line:A,column:N},this.source=S.source}P.prototype.content=C;function H(ce){var ne=new Error(S.source+":"+A+":"+N+": "+ce);if(ne.reason=ce,ne.filename=S.source,ne.line=A,ne.column=N,ne.source=C,!S.silent)throw ne}function Y(ce){var ne=ce.exec(C);if(ne){var z=ne[0];return U(z),C=C.slice(z.length),ne}}function ue(){Y(n)}function M(ce){var ne;for(ce=ce||[];ne=K();)ne!==!1&&ce.push(ne);return ce}function K(){var ce=G();if(!(m!=C.charAt(0)||p!=C.charAt(1))){for(var ne=2;g!=C.charAt(ne)&&(p!=C.charAt(ne)||m!=C.charAt(ne+1));)++ne;if(ne+=2,g===C.charAt(ne-1))return H("End of comment missing");var z=C.slice(2,ne-2);return N+=2,U(z),C=C.slice(ne),N+=2,ce({type:y,comment:z})}}function F(){var ce=G(),ne=Y(r);if(ne){if(K(),!Y(s))return H("property missing ':'");var z=Y(l),ee=ce({type:E,property:k(ne[0].replace(e,g)),value:z?k(z[0].replace(e,g)):g});return Y(o),ee}}function ge(){var ce=[];M(ce);for(var ne;ne=F();)ne!==!1&&(ce.push(ne),M(ce));return ce}return ue(),ge()}function k(C){return C?C.replace(c,g):g}return t0=v,t0}var R_;function SH(){if(R_)return ro;R_=1;var e=ro&&ro.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ro,"__esModule",{value:!0}),ro.default=n;const t=e(CH());function n(r,s){let l=null;if(!r||typeof r!="string")return l;const o=(0,t.default)(r),c=typeof s=="function";return o.forEach(d=>{if(d.type!=="declaration")return;const{property:m,value:p}=d;c?s(m,p,d):p&&(l=l||{},l[m]=p)}),l}return ro}var Lu={},L_;function AH(){if(L_)return Lu;L_=1,Object.defineProperty(Lu,"__esModule",{value:!0}),Lu.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,l=function(m){return!m||n.test(m)||e.test(m)},o=function(m,p){return p.toUpperCase()},c=function(m,p){return"".concat(p,"-")},d=function(m,p){return p===void 0&&(p={}),l(m)?m:(m=m.toLowerCase(),p.reactCompat?m=m.replace(s,c):m=m.replace(r,c),m.replace(t,o))};return Lu.camelCase=d,Lu}var Iu,I_;function NH(){if(I_)return Iu;I_=1;var e=Iu&&Iu.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},t=e(SH()),n=AH();function r(s,l){var o={};return!s||typeof s!="string"||(0,t.default)(s,function(c,d){c&&d&&(o[(0,n.camelCase)(c,l)]=d)}),o}return r.default=r,Iu=r,Iu}var RH=NH();const LH=Bf(RH);function Ku(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?O_(e.position):"start"in e||"end"in e?O_(e):"line"in e||"column"in e?Z0(e):""}function Z0(e){return D_(e&&e.line)+":"+D_(e&&e.column)}function O_(e){return Z0(e&&e.start)+"-"+Z0(e&&e.end)}function D_(e){return e&&typeof e=="number"?e:1}class lr extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let s="",l={},o=!1;if(n&&("line"in n&&"column"in n?l={place:n}:"start"in n&&"end"in n?l={place:n}:"type"in n?l={ancestors:[n],place:n.position}:l={...n}),typeof t=="string"?s=t:!l.cause&&t&&(o=!0,s=t.message,l.cause=t),!l.ruleId&&!l.source&&typeof r=="string"){const d=r.indexOf(":");d===-1?l.ruleId=r:(l.source=r.slice(0,d),l.ruleId=r.slice(d+1))}if(!l.place&&l.ancestors&&l.ancestors){const d=l.ancestors[l.ancestors.length-1];d&&(l.place=d.position)}const c=l.place&&"start"in l.place?l.place.start:l.place;this.ancestors=l.ancestors||void 0,this.cause=l.cause||void 0,this.column=c?c.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=c?c.line:void 0,this.name=Ku(l.place)||"1:1",this.place=l.place||void 0,this.reason=this.message,this.ruleId=l.ruleId||void 0,this.source=l.source||void 0,this.stack=o&&l.cause&&typeof l.cause.stack=="string"?l.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}lr.prototype.file="";lr.prototype.name="";lr.prototype.reason="";lr.prototype.message="";lr.prototype.stack="";lr.prototype.column=void 0;lr.prototype.line=void 0;lr.prototype.ancestors=void 0;lr.prototype.cause=void 0;lr.prototype.fatal=void 0;lr.prototype.place=void 0;lr.prototype.ruleId=void 0;lr.prototype.source=void 0;const h1={}.hasOwnProperty,IH=new Map,OH=/[A-Z]/g,DH=new Set(["table","tbody","thead","tfoot","tr"]),jH=new Set(["td","th"]),gk="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function MH(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=VH(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=$H(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"?Va:So,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},l=bk(s,e,void 0);return l&&typeof l!="string"?l:s.create(e,s.Fragment,{children:l||void 0},void 0)}function bk(e,t,n){if(t.type==="element")return PH(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return BH(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return HH(e,t,n);if(t.type==="mdxjsEsm")return UH(e,t);if(t.type==="root")return zH(e,t,n);if(t.type==="text")return FH(e,t)}function PH(e,t,n){const r=e.schema;let s=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=Va,e.schema=s),e.ancestors.push(t);const l=yk(e,t.tagName,!1),o=GH(e,t);let c=p1(e,t);return DH.has(t.tagName)&&(c=c.filter(function(d){return typeof d=="string"?!Ff(d):!0})),xk(e,o,l,t),m1(o,c),e.ancestors.pop(),e.schema=r,e.create(t,l,o,n)}function BH(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)}uc(e,t.position)}function UH(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);uc(e,t.position)}function HH(e,t,n){const r=e.schema;let s=r;t.name==="svg"&&r.space==="html"&&(s=Va,e.schema=s),e.ancestors.push(t);const l=t.name===null?e.Fragment:yk(e,t.name,!0),o=qH(e,t),c=p1(e,t);return xk(e,o,l,t),m1(o,c),e.ancestors.pop(),e.schema=r,e.create(t,l,o,n)}function zH(e,t,n){const r={};return m1(r,p1(e,t)),e.create(t,e.Fragment,r,n)}function FH(e,t){return t.value}function xk(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function m1(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function $H(e,t,n){return r;function r(s,l,o,c){const m=Array.isArray(o.children)?n:t;return c?m(l,o,c):m(l,o)}}function VH(e,t){return n;function n(r,s,l,o){const c=Array.isArray(l.children),d=Ga(r);return t(s,l,o,c,{columnNumber:d?d.column-1:void 0,fileName:e,lineNumber:d?d.line:void 0},void 0)}}function GH(e,t){const n={};let r,s;for(s in t.properties)if(s!=="children"&&h1.call(t.properties,s)){const l=YH(e,s,t.properties[s]);if(l){const[o,c]=l;e.tableCellAlignToStyle&&o==="align"&&typeof c=="string"&&jH.has(t.tagName)?r=c:n[o]=c}}if(r){const l=n.style||(n.style={});l[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function qH(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const l=r.data.estree.body[0];l.type;const o=l.expression;o.type;const c=o.properties[0];c.type,Object.assign(n,e.evaluater.evaluateExpression(c.argument))}else uc(e,t.position);else{const s=r.name;let l;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const c=r.value.data.estree.body[0];c.type,l=e.evaluater.evaluateExpression(c.expression)}else uc(e,t.position);else l=r.value===null?!0:r.value;n[s]=l}return n}function p1(e,t){const n=[];let r=-1;const s=e.passKeys?new Map:IH;for(;++r<t.children.length;){const l=t.children[r];let o;if(e.passKeys){const d=l.type==="element"?l.tagName:l.type==="mdxJsxFlowElement"||l.type==="mdxJsxTextElement"?l.name:void 0;if(d){const m=s.get(d)||0;o=d+"-"+m,s.set(d,m+1)}}const c=bk(e,l,o);c!==void 0&&n.push(c)}return n}function YH(e,t,n){const r=gc(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Rg(n):Lg(n)),r.property==="style"){let s=typeof n=="object"?n:WH(e,String(n));return e.stylePropertyNameCase==="css"&&(s=QH(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&r.space?Z4[r.property]||r.property:r.attribute,n]}}function WH(e,t){try{return LH(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,s=new lr("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=gk+"#cannot-parse-style-attribute",s}}function yk(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const s=t.split(".");let l=-1,o;for(;++l<s.length;){const c=A_(s[l])?{type:"Identifier",name:s[l]}:{type:"Literal",value:s[l]};o=o?{type:"MemberExpression",object:o,property:c,computed:!!(l&&c.type==="Literal"),optional:!1}:c}r=o}else r=A_(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const s=r.value;return h1.call(e.components,s)?e.components[s]:s}if(e.evaluater)return e.evaluater.evaluateExpression(r);uc(e)}function uc(e,t){const n=new lr("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=gk+"#cannot-handle-mdx-estrees-without-createevaluater",n}function QH(e){const t={};let n;for(n in e)h1.call(e,n)&&(t[XH(n)]=e[n]);return t}function XH(e){let t=e.replace(OH,KH);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function KH(e){return"-"+e.toLowerCase()}const n0={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"]},ZH={tokenize:JH};function JH(e){const t=e.attempt(this.parser.constructs.contentInitial,r,s);let n;return t;function r(c){if(c===null){e.consume(c);return}return e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),zt(e,t,"linePrefix")}function s(c){return e.enter("paragraph"),l(c)}function l(c){const d=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=d),n=d,o(c)}function o(c){if(c===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(c);return}return st(c)?(e.consume(c),e.exit("chunkText"),l):(e.consume(c),o)}}const ez={tokenize:tz},j_={tokenize:nz};function tz(e){const t=this,n=[];let r=0,s,l,o;return c;function c(N){if(r<n.length){const U=n[r];return t.containerState=U[1],e.attempt(U[0].continuation,d,m)(N)}return m(N)}function d(N){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,s&&A();const U=t.events.length;let G=U,P;for(;G--;)if(t.events[G][0]==="exit"&&t.events[G][1].type==="chunkFlow"){P=t.events[G][1].end;break}S(r);let H=U;for(;H<t.events.length;)t.events[H][1].end={...P},H++;return Mr(t.events,G+1,0,t.events.slice(U)),t.events.length=H,m(N)}return c(N)}function m(N){if(r===n.length){if(!s)return y(N);if(s.currentConstruct&&s.currentConstruct.concrete)return v(N);t.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(j_,p,g)(N)}function p(N){return s&&A(),S(r),y(N)}function g(N){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,v(N)}function y(N){return t.containerState={},e.attempt(j_,E,v)(N)}function E(N){return r++,n.push([t.currentConstruct,t.containerState]),y(N)}function v(N){if(N===null){s&&A(),S(0),e.consume(N);return}return s=s||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:l}),k(N)}function k(N){if(N===null){C(e.exit("chunkFlow"),!0),S(0),e.consume(N);return}return st(N)?(e.consume(N),C(e.exit("chunkFlow")),r=0,t.interrupt=void 0,c):(e.consume(N),k)}function C(N,U){const G=t.sliceStream(N);if(U&&G.push(null),N.previous=l,l&&(l.next=N),l=N,s.defineSkip(N.start),s.write(G),t.parser.lazy[N.start.line]){let P=s.events.length;for(;P--;)if(s.events[P][1].start.offset<o&&(!s.events[P][1].end||s.events[P][1].end.offset>o))return;const H=t.events.length;let Y=H,ue,M;for(;Y--;)if(t.events[Y][0]==="exit"&&t.events[Y][1].type==="chunkFlow"){if(ue){M=t.events[Y][1].end;break}ue=!0}for(S(r),P=H;P<t.events.length;)t.events[P][1].end={...M},P++;Mr(t.events,Y+1,0,t.events.slice(H)),t.events.length=P}}function S(N){let U=n.length;for(;U-- >N;){const G=n[U];t.containerState=G[1],G[0].exit.call(t,e)}n.length=N}function A(){s.write([null]),l=void 0,s=void 0,t.containerState._closeFlow=void 0}}function nz(e,t,n){return zt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}const rz={tokenize:az};function az(e){const t=this,n=e.attempt(_c,r,e.attempt(this.parser.constructs.flowInitial,s,zt(e,e.attempt(this.parser.constructs.flow,s,e.attempt(lP,s)),"linePrefix")));return n;function r(l){if(l===null){e.consume(l);return}return e.enter("lineEndingBlank"),e.consume(l),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function s(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const iz={resolveAll:_k()},sz=Ek("string"),lz=Ek("text");function Ek(e){return{resolveAll:_k(e==="text"?oz:void 0),tokenize:t};function t(n){const r=this,s=this.parser.constructs[e],l=n.attempt(s,o,c);return o;function o(p){return m(p)?l(p):c(p)}function c(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),d}function d(p){return m(p)?(n.exit("data"),l(p)):(n.consume(p),d)}function m(p){if(p===null)return!0;const g=s[p];let y=-1;if(g)for(;++y<g.length;){const E=g[y];if(!E.previous||E.previous.call(r,r.previous))return!0}return!1}}}function _k(e){return t;function t(n,r){let s=-1,l;for(;++s<=n.length;)l===void 0?n[s]&&n[s][1].type==="data"&&(l=s,s++):(!n[s]||n[s][1].type!=="data")&&(s!==l+2&&(n[l][1].end=n[s-1][1].end,n.splice(l+2,s-l-2),s=l+2),l=void 0);return e?e(n,r):n}}function oz(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 l=s.length,o=-1,c=0,d;for(;l--;){const m=s[l];if(typeof m=="string"){for(o=m.length;m.charCodeAt(o-1)===32;)c++,o--;if(o)break;o=-1}else if(m===-2)d=!0,c++;else if(m!==-1){l++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(c=0),c){const m={type:n===e.length||d||c<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:l?o:r.start._bufferIndex+o,_index:r.start._index+l,line:r.end.line,column:r.end.column-c,offset:r.end.offset-c},end:{...r.end}};r.end={...m.start},r.start.offset===r.end.offset?Object.assign(r,m):(e.splice(n,0,["enter",m,t],["exit",m,t]),n+=2)}n++}return e}const uz={42:wr,43:wr,45:wr,48:wr,49:wr,50:wr,51:wr,52:wr,53:wr,54:wr,55:wr,56:wr,57:wr,62:Pw},cz={91:fP},dz={[-2]:Kp,[-1]:Kp,32:Kp},fz={35:xP,42:cf,45:[p_,cf],60:TP,61:p_,95:cf,96:h_,126:h_},hz={38:Uw,92:Bw},mz={[-5]:Zp,[-4]:Zp,[-3]:Zp,33:HP,38:Uw,42:X0,60:[F7,NP],91:FP,92:[gP,Bw],93:o1,95:X0,96:tP},pz={null:[X0,iz]},gz={null:[42,95]},bz={null:[]},xz=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:gz,contentInitial:cz,disable:bz,document:uz,flow:fz,flowInitial:dz,insideSpan:pz,string:hz,text:mz},Symbol.toStringTag,{value:"Module"}));function yz(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={},l=[];let o=[],c=[];const d={attempt:H(G),check:H(P),consume:A,enter:N,exit:U,interrupt:H(P,{interrupt:!0})},m={code:null,containerState:{},defineSkip:k,events:[],now:v,parser:e,previous:null,sliceSerialize:y,sliceStream:E,write:g};let p=t.tokenize.call(m,d);return t.resolveAll&&l.push(t),m;function g(K){return o=ea(o,K),C(),o[o.length-1]!==null?[]:(Y(t,0),m.events=sh(l,m.events,m),m.events)}function y(K,F){return _z(E(K),F)}function E(K){return Ez(o,K)}function v(){const{_bufferIndex:K,_index:F,line:ge,column:ce,offset:ne}=r;return{_bufferIndex:K,_index:F,line:ge,column:ce,offset:ne}}function k(K){s[K.line]=K.column,M()}function C(){let K;for(;r._index<o.length;){const F=o[r._index];if(typeof F=="string")for(K=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===K&&r._bufferIndex<F.length;)S(F.charCodeAt(r._bufferIndex));else S(F)}}function S(K){p=p(K)}function A(K){st(K)?(r.line++,r.column=1,r.offset+=K===-3?2:1,M()):K!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),m.previous=K}function N(K,F){const ge=F||{};return ge.type=K,ge.start=v(),m.events.push(["enter",ge,m]),c.push(ge),ge}function U(K){const F=c.pop();return F.end=v(),m.events.push(["exit",F,m]),F}function G(K,F){Y(K,F.from)}function P(K,F){F.restore()}function H(K,F){return ge;function ge(ce,ne,z){let ee,ke,Be,L;return Array.isArray(ce)?ae(ce):"tokenize"in ce?ae([ce]):$(ce);function $(we){return et;function et(Fe){const Ie=Fe!==null&&we[Fe],kt=Fe!==null&&we.null,at=[...Array.isArray(Ie)?Ie:Ie?[Ie]:[],...Array.isArray(kt)?kt:kt?[kt]:[]];return ae(at)(Fe)}}function ae(we){return ee=we,ke=0,we.length===0?z:O(we[ke])}function O(we){return et;function et(Fe){return L=ue(),Be=we,we.partial||(m.currentConstruct=we),we.name&&m.parser.constructs.disable.null.includes(we.name)?Re():we.tokenize.call(F?Object.assign(Object.create(m),F):m,d,_e,Re)(Fe)}}function _e(we){return K(Be,L),ne}function Re(we){return L.restore(),++ke<ee.length?O(ee[ke]):z}}}function Y(K,F){K.resolveAll&&!l.includes(K)&&l.push(K),K.resolve&&Mr(m.events,F,m.events.length-F,K.resolve(m.events.slice(F),m)),K.resolveTo&&(m.events=K.resolveTo(m.events,m))}function ue(){const K=v(),F=m.previous,ge=m.currentConstruct,ce=m.events.length,ne=Array.from(c);return{from:ce,restore:z};function z(){r=K,m.previous=F,m.currentConstruct=ge,m.events.length=ce,c=ne,M()}}function M(){r.line in s&&r.column<2&&(r.column=s[r.line],r.offset+=s[r.line]-1)}}function Ez(e,t){const n=t.start._index,r=t.start._bufferIndex,s=t.end._index,l=t.end._bufferIndex;let o;if(n===s)o=[e[n].slice(r,l)];else{if(o=e.slice(n,s),r>-1){const c=o[0];typeof c=="string"?o[0]=c.slice(r):o.shift()}l>0&&o.push(e[s].slice(0,l))}return o}function _z(e,t){let n=-1;const r=[];let s;for(;++n<e.length;){const l=e[n];let o;if(typeof l=="string")o=l;else switch(l){case-5:{o="\r";break}case-4:{o=`
|
|
282
|
+
`;break}case-3:{o=`\r
|
|
283
|
+
`;break}case-2:{o=t?" ":" ";break}case-1:{if(!t&&s)continue;o=" ";break}default:o=String.fromCharCode(l)}s=l===-2,r.push(o)}return r.join("")}function Tz(e){const r={constructs:Aw([xz,...(e||{}).extensions||[]]),content:s(ZH),defined:[],document:s(ez),flow:s(rz),lazy:{},string:s(sz),text:s(lz)};return r;function s(l){return o;function o(c){return yz(r,l,c)}}}function vz(e){for(;!Hw(e););return e}const M_=/[\0\t\n\r]/g;function wz(){let e=1,t="",n=!0,r;return s;function s(l,o,c){const d=[];let m,p,g,y,E;for(l=t+(typeof l=="string"?l.toString():new TextDecoder(o||void 0).decode(l)),g=0,t="",n&&(l.charCodeAt(0)===65279&&g++,n=void 0);g<l.length;){if(M_.lastIndex=g,m=M_.exec(l),y=m&&m.index!==void 0?m.index:l.length,E=l.charCodeAt(y),!m){t=l.slice(g);break}if(E===10&&g===y&&r)d.push(-3),r=void 0;else switch(r&&(d.push(-5),r=void 0),g<y&&(d.push(l.slice(g,y)),e+=y-g),E){case 0:{d.push(65533),e++;break}case 9:{for(p=Math.ceil(e/4)*4,d.push(-2);e++<p;)d.push(-1);break}case 10:{d.push(-4),e=1;break}default:r=!0,e=1}g=y+1}return c&&(r&&d.push(-5),t&&d.push(t),d.push(null)),d}}const Tk={}.hasOwnProperty;function kz(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),Cz(n)(vz(Tz(n).document().write(wz()(e,t,!0))))}function Cz(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:l(lt),autolinkProtocol:ue,autolinkEmail:ue,atxHeading:l(Tt),blockQuote:l(kt),characterEscape:ue,characterReference:ue,codeFenced:l(at),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:l(at,o),codeText:l(Nt,o),codeTextData:ue,data:ue,codeFlowValue:ue,definition:l(Gt),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:l(Ut),hardBreakEscape:l(rt),hardBreakTrailing:l(rt),htmlFlow:l(on,o),htmlFlowData:ue,htmlText:l(on,o),htmlTextData:ue,image:l(it),label:o,link:l(lt),listItem:l(mn),listItemValue:y,listOrdered:l(ht,g),listUnordered:l(ht),paragraph:l(rn),reference:O,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:l(Tt),strong:l(An),thematicBreak:l(Zt)},exit:{atxHeading:d(),atxHeadingSequence:G,autolink:d(),autolinkEmail:Ie,autolinkProtocol:Fe,blockQuote:d(),characterEscapeValue:M,characterReferenceMarkerHexadecimal:Re,characterReferenceMarkerNumeric:Re,characterReferenceValue:we,characterReference:et,codeFenced:d(C),codeFencedFence:k,codeFencedFenceInfo:E,codeFencedFenceMeta:v,codeFlowValue:M,codeIndented:d(S),codeText:d(ne),codeTextData:M,data:M,definition:d(),definitionDestinationString:U,definitionLabelString:A,definitionTitleString:N,emphasis:d(),hardBreakEscape:d(F),hardBreakTrailing:d(F),htmlFlow:d(ge),htmlFlowData:M,htmlText:d(ce),htmlTextData:M,image:d(ee),label:Be,labelText:ke,lineEnding:K,link:d(z),listItem:d(),listOrdered:d(),listUnordered:d(),paragraph:d(),referenceString:_e,resourceDestinationString:L,resourceTitleString:$,resource:ae,setextHeading:d(Y),setextHeadingLineSequence:H,setextHeadingText:P,strong:d(),thematicBreak:d()}};vk(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(me){let Ce={type:"root",children:[]};const Ze={stack:[Ce],tokenStack:[],config:t,enter:c,exit:m,buffer:o,resume:p,data:n},ot=[];let dt=-1;for(;++dt<me.length;)if(me[dt][1].type==="listOrdered"||me[dt][1].type==="listUnordered")if(me[dt][0]==="enter")ot.push(dt);else{const Qt=ot.pop();dt=s(me,Qt,dt)}for(dt=-1;++dt<me.length;){const Qt=t[me[dt][0]];Tk.call(Qt,me[dt][1].type)&&Qt[me[dt][1].type].call(Object.assign({sliceSerialize:me[dt][2].sliceSerialize},Ze),me[dt][1])}if(Ze.tokenStack.length>0){const Qt=Ze.tokenStack[Ze.tokenStack.length-1];(Qt[1]||P_).call(Ze,void 0,Qt[0])}for(Ce.position={start:ds(me.length>0?me[0][1].start:{line:1,column:1,offset:0}),end:ds(me.length>0?me[me.length-2][1].end:{line:1,column:1,offset:0})},dt=-1;++dt<t.transforms.length;)Ce=t.transforms[dt](Ce)||Ce;return Ce}function s(me,Ce,Ze){let ot=Ce-1,dt=-1,Qt=!1,Ht,xe,Le,Ke;for(;++ot<=Ze;){const $e=me[ot];switch($e[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{$e[0]==="enter"?dt++:dt--,Ke=void 0;break}case"lineEndingBlank":{$e[0]==="enter"&&(Ht&&!Ke&&!dt&&!Le&&(Le=ot),Ke=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Ke=void 0}if(!dt&&$e[0]==="enter"&&$e[1].type==="listItemPrefix"||dt===-1&&$e[0]==="exit"&&($e[1].type==="listUnordered"||$e[1].type==="listOrdered")){if(Ht){let nt=ot;for(xe=void 0;nt--;){const Q=me[nt];if(Q[1].type==="lineEnding"||Q[1].type==="lineEndingBlank"){if(Q[0]==="exit")continue;xe&&(me[xe][1].type="lineEndingBlank",Qt=!0),Q[1].type="lineEnding",xe=nt}else if(!(Q[1].type==="linePrefix"||Q[1].type==="blockQuotePrefix"||Q[1].type==="blockQuotePrefixWhitespace"||Q[1].type==="blockQuoteMarker"||Q[1].type==="listItemIndent"))break}Le&&(!xe||Le<xe)&&(Ht._spread=!0),Ht.end=Object.assign({},xe?me[xe][1].start:$e[1].end),me.splice(xe||ot,0,["exit",Ht,$e[2]]),ot++,Ze++}if($e[1].type==="listItemPrefix"){const nt={type:"listItem",_spread:!1,start:Object.assign({},$e[1].start),end:void 0};Ht=nt,me.splice(ot,0,["enter",nt,$e[2]]),ot++,Ze++,Le=void 0,Ke=!0}}}return me[Ce][1]._spread=Qt,Ze}function l(me,Ce){return Ze;function Ze(ot){c.call(this,me(ot),ot),Ce&&Ce.call(this,ot)}}function o(){this.stack.push({type:"fragment",children:[]})}function c(me,Ce,Ze){this.stack[this.stack.length-1].children.push(me),this.stack.push(me),this.tokenStack.push([Ce,Ze||void 0]),me.position={start:ds(Ce.start),end:void 0}}function d(me){return Ce;function Ce(Ze){me&&me.call(this,Ze),m.call(this,Ze)}}function m(me,Ce){const Ze=this.stack.pop(),ot=this.tokenStack.pop();if(ot)ot[0].type!==me.type&&(Ce?Ce.call(this,me,ot[0]):(ot[1]||P_).call(this,me,ot[0]));else throw new Error("Cannot close `"+me.type+"` ("+Ku({start:me.start,end:me.end})+"): it’s not open");Ze.position.end=ds(me.end)}function p(){return a1(this.stack.pop())}function g(){this.data.expectingFirstListItemValue=!0}function y(me){if(this.data.expectingFirstListItemValue){const Ce=this.stack[this.stack.length-2];Ce.start=Number.parseInt(this.sliceSerialize(me),10),this.data.expectingFirstListItemValue=void 0}}function E(){const me=this.resume(),Ce=this.stack[this.stack.length-1];Ce.lang=me}function v(){const me=this.resume(),Ce=this.stack[this.stack.length-1];Ce.meta=me}function k(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function C(){const me=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=me.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function S(){const me=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=me.replace(/(\r?\n|\r)$/g,"")}function A(me){const Ce=this.resume(),Ze=this.stack[this.stack.length-1];Ze.label=Ce,Ze.identifier=Ta(this.sliceSerialize(me)).toLowerCase()}function N(){const me=this.resume(),Ce=this.stack[this.stack.length-1];Ce.title=me}function U(){const me=this.resume(),Ce=this.stack[this.stack.length-1];Ce.url=me}function G(me){const Ce=this.stack[this.stack.length-1];if(!Ce.depth){const Ze=this.sliceSerialize(me).length;Ce.depth=Ze}}function P(){this.data.setextHeadingSlurpLineEnding=!0}function H(me){const Ce=this.stack[this.stack.length-1];Ce.depth=this.sliceSerialize(me).codePointAt(0)===61?1:2}function Y(){this.data.setextHeadingSlurpLineEnding=void 0}function ue(me){const Ze=this.stack[this.stack.length-1].children;let ot=Ze[Ze.length-1];(!ot||ot.type!=="text")&&(ot=qt(),ot.position={start:ds(me.start),end:void 0},Ze.push(ot)),this.stack.push(ot)}function M(me){const Ce=this.stack.pop();Ce.value+=this.sliceSerialize(me),Ce.position.end=ds(me.end)}function K(me){const Ce=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ze=Ce.children[Ce.children.length-1];Ze.position.end=ds(me.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Ce.type)&&(ue.call(this,me),M.call(this,me))}function F(){this.data.atHardBreak=!0}function ge(){const me=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=me}function ce(){const me=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=me}function ne(){const me=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=me}function z(){const me=this.stack[this.stack.length-1];if(this.data.inReference){const Ce=this.data.referenceType||"shortcut";me.type+="Reference",me.referenceType=Ce,delete me.url,delete me.title}else delete me.identifier,delete me.label;this.data.referenceType=void 0}function ee(){const me=this.stack[this.stack.length-1];if(this.data.inReference){const Ce=this.data.referenceType||"shortcut";me.type+="Reference",me.referenceType=Ce,delete me.url,delete me.title}else delete me.identifier,delete me.label;this.data.referenceType=void 0}function ke(me){const Ce=this.sliceSerialize(me),Ze=this.stack[this.stack.length-2];Ze.label=f7(Ce),Ze.identifier=Ta(Ce).toLowerCase()}function Be(){const me=this.stack[this.stack.length-1],Ce=this.resume(),Ze=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ze.type==="link"){const ot=me.children;Ze.children=ot}else Ze.alt=Ce}function L(){const me=this.resume(),Ce=this.stack[this.stack.length-1];Ce.url=me}function $(){const me=this.resume(),Ce=this.stack[this.stack.length-1];Ce.title=me}function ae(){this.data.inReference=void 0}function O(){this.data.referenceType="collapsed"}function _e(me){const Ce=this.resume(),Ze=this.stack[this.stack.length-1];Ze.label=Ce,Ze.identifier=Ta(this.sliceSerialize(me)).toLowerCase(),this.data.referenceType="full"}function Re(me){this.data.characterReferenceType=me.type}function we(me){const Ce=this.sliceSerialize(me),Ze=this.data.characterReferenceType;let ot;Ze?(ot=Sw(Ce,Ze==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):ot=s1(Ce);const dt=this.stack[this.stack.length-1];dt.value+=ot}function et(me){const Ce=this.stack.pop();Ce.position.end=ds(me.end)}function Fe(me){M.call(this,me);const Ce=this.stack[this.stack.length-1];Ce.url=this.sliceSerialize(me)}function Ie(me){M.call(this,me);const Ce=this.stack[this.stack.length-1];Ce.url="mailto:"+this.sliceSerialize(me)}function kt(){return{type:"blockquote",children:[]}}function at(){return{type:"code",lang:null,meta:null,value:""}}function Nt(){return{type:"inlineCode",value:""}}function Gt(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ut(){return{type:"emphasis",children:[]}}function Tt(){return{type:"heading",depth:0,children:[]}}function rt(){return{type:"break"}}function on(){return{type:"html",value:""}}function it(){return{type:"image",title:null,url:"",alt:null}}function lt(){return{type:"link",title:null,url:"",children:[]}}function ht(me){return{type:"list",ordered:me.type==="listOrdered",start:null,spread:me._spread,children:[]}}function mn(me){return{type:"listItem",spread:me._spread,checked:null,children:[]}}function rn(){return{type:"paragraph",children:[]}}function An(){return{type:"strong",children:[]}}function qt(){return{type:"text",value:""}}function Zt(){return{type:"thematicBreak"}}}function ds(e){return{line:e.line,column:e.column,offset:e.offset}}function vk(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?vk(e,r):Sz(e,r)}}function Sz(e,t){let n;for(n in t)if(Tk.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 P_(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Ku({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Ku({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Ku({start:t.start,end:t.end})+") is still open")}function Az(e){const t=this;t.parser=n;function n(r){return kz(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Nz(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 Rz(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
284
|
+
`}]}function Lz(e,t){const n=t.value?t.value+`
|
|
285
|
+
`:"",r={},s=t.lang?t.lang.split(/\s+/):[];s.length>0&&(r.className=["language-"+s[0]]);let l={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(l.data={meta:t.meta}),e.patch(t,l),l=e.applyData(t,l),l={type:"element",tagName:"pre",properties:{},children:[l]},e.patch(t,l),l}function Iz(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Oz(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Dz(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),s=Do(r.toLowerCase()),l=e.footnoteOrder.indexOf(r);let o,c=e.footnoteCounts.get(r);c===void 0?(c=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=l+1,c+=1,e.footnoteCounts.set(r,c);const d={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+s,id:n+"fnref-"+s+(c>1?"-"+c:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,d);const m={type:"element",tagName:"sup",properties:{},children:[d]};return e.patch(t,m),e.applyData(t,m)}function jz(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 Mz(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function wk(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),l=s[0];l&&l.type==="text"?l.value="["+l.value:s.unshift({type:"text",value:"["});const o=s[s.length-1];return o&&o.type==="text"?o.value+=r:s.push({type:"text",value:r}),s}function Pz(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return wk(e,t);const s={src:Do(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(s.title=r.title);const l={type:"element",tagName:"img",properties:s,children:[]};return e.patch(t,l),e.applyData(t,l)}function Bz(e,t){const n={src:Do(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 Uz(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 Hz(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return wk(e,t);const s={href:Do(r.url||"")};r.title!==null&&r.title!==void 0&&(s.title=r.title);const l={type:"element",tagName:"a",properties:s,children:e.all(t)};return e.patch(t,l),e.applyData(t,l)}function zz(e,t){const n={href:Do(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 Fz(e,t,n){const r=e.all(t),s=n?$z(n):kk(t),l={},o=[];if(typeof t.checked=="boolean"){const p=r[0];let g;p&&p.type==="element"&&p.tagName==="p"?g=p:(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:[]}),l.className=["task-list-item"]}let c=-1;for(;++c<r.length;){const p=r[c];(s||c!==0||p.type!=="element"||p.tagName!=="p")&&o.push({type:"text",value:`
|
|
286
|
+
`}),p.type==="element"&&p.tagName==="p"&&!s?o.push(...p.children):o.push(p)}const d=r[r.length-1];d&&(s||d.type!=="element"||d.tagName!=="p")&&o.push({type:"text",value:`
|
|
287
|
+
`});const m={type:"element",tagName:"li",properties:l,children:o};return e.patch(t,m),e.applyData(t,m)}function $z(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=kk(n[r])}return t}function kk(e){const t=e.spread;return t??e.children.length>1}function Vz(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 o=r[s];if(o.type==="element"&&o.tagName==="li"&&o.properties&&Array.isArray(o.properties.className)&&o.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const l={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,l),e.applyData(t,l)}function Gz(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function qz(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Yz(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Wz(e,t){const n=e.all(t),r=n.shift(),s=[];if(r){const o={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],o),s.push(o)}if(n.length>0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},c=Ga(t.children[1]),d=ah(t.children[t.children.length-1]);c&&d&&(o.position={start:c,end:d}),s.push(o)}const l={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(t,l),e.applyData(t,l)}function Qz(e,t,n){const r=n?n.children:void 0,l=(r?r.indexOf(t):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,c=o?o.length:t.children.length;let d=-1;const m=[];for(;++d<c;){const g=t.children[d],y={},E=o?o[d]:void 0;E&&(y.align=E);let v={type:"element",tagName:l,properties:y,children:[]};g&&(v.children=e.all(g),e.patch(g,v),v=e.applyData(g,v)),m.push(v)}const p={type:"element",tagName:"tr",properties:{},children:e.wrap(m,!0)};return e.patch(t,p),e.applyData(t,p)}function Xz(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const B_=9,U_=32;function Kz(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),s=0;const l=[];for(;r;)l.push(H_(t.slice(s,r.index),s>0,!0),r[0]),s=r.index+r[0].length,r=n.exec(t);return l.push(H_(t.slice(s),s>0,!1)),l.join("")}function H_(e,t,n){let r=0,s=e.length;if(t){let l=e.codePointAt(r);for(;l===B_||l===U_;)r++,l=e.codePointAt(r)}if(n){let l=e.codePointAt(s-1);for(;l===B_||l===U_;)s--,l=e.codePointAt(s-1)}return s>r?e.slice(r,s):""}function Zz(e,t){const n={type:"text",value:Kz(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Jz(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const eF={blockquote:Nz,break:Rz,code:Lz,delete:Iz,emphasis:Oz,footnoteReference:Dz,heading:jz,html:Mz,imageReference:Pz,image:Bz,inlineCode:Uz,linkReference:Hz,link:zz,listItem:Fz,list:Vz,paragraph:Gz,root:qz,strong:Yz,table:Wz,tableCell:Xz,tableRow:Qz,text:Zz,thematicBreak:Jz,toml:Fd,yaml:Fd,definition:Fd,footnoteDefinition:Fd};function Fd(){}function tF(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 nF(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function rF(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||tF,r=e.options.footnoteBackLabel||nF,s=e.options.footnoteLabel||"Footnotes",l=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},c=[];let d=-1;for(;++d<e.footnoteOrder.length;){const m=e.footnoteById.get(e.footnoteOrder[d]);if(!m)continue;const p=e.all(m),g=String(m.identifier).toUpperCase(),y=Do(g.toLowerCase());let E=0;const v=[],k=e.footnoteCounts.get(g);for(;k!==void 0&&++E<=k;){v.length>0&&v.push({type:"text",value:" "});let A=typeof n=="string"?n:n(d,E);typeof A=="string"&&(A={type:"text",value:A}),v.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+y+(E>1?"-"+E:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(d,E),className:["data-footnote-backref"]},children:Array.isArray(A)?A:[A]})}const C=p[p.length-1];if(C&&C.type==="element"&&C.tagName==="p"){const A=C.children[C.children.length-1];A&&A.type==="text"?A.value+=" ":C.children.push({type:"text",value:" "}),C.children.push(...v)}else p.push(...v);const S={type:"element",tagName:"li",properties:{id:t+"fn-"+y},children:e.wrap(p,!0)};e.patch(m,S),c.push(S)}if(c.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:l,properties:{...dl(o),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:`
|
|
288
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(c,!0)},{type:"text",value:`
|
|
289
|
+
`}]}}const J0={}.hasOwnProperty,aF={};function iF(e,t){const n=t||aF,r=new Map,s=new Map,l=new Map,o={...eF,...n.handlers},c={all:m,applyData:lF,definitionById:r,footnoteById:s,footnoteCounts:l,footnoteOrder:[],handlers:o,one:d,options:n,patch:sF,wrap:uF};return $a(e,function(p){if(p.type==="definition"||p.type==="footnoteDefinition"){const g=p.type==="definition"?r:s,y=String(p.identifier).toUpperCase();g.has(y)||g.set(y,p)}}),c;function d(p,g){const y=p.type,E=c.handlers[y];if(J0.call(c.handlers,y)&&E)return E(c,p,g);if(c.options.passThrough&&c.options.passThrough.includes(y)){if("children"in p){const{children:k,...C}=p,S=dl(C);return S.children=c.all(p),S}return dl(p)}return(c.options.unknownHandler||oF)(c,p,g)}function m(p){const g=[];if("children"in p){const y=p.children;let E=-1;for(;++E<y.length;){const v=c.one(y[E],p);if(v){if(E&&y[E-1].type==="break"&&(!Array.isArray(v)&&v.type==="text"&&(v.value=z_(v.value)),!Array.isArray(v)&&v.type==="element")){const k=v.children[0];k&&k.type==="text"&&(k.value=z_(k.value))}Array.isArray(v)?g.push(...v):g.push(v)}}}return g}}function sF(e,t){e.position&&(t.position=nw(e))}function lF(e,t){let n=t;if(e&&e.data){const r=e.data.hName,s=e.data.hChildren,l=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const o="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:o}}n.type==="element"&&l&&Object.assign(n.properties,dl(l)),"children"in n&&n.children&&s!==null&&s!==void 0&&(n.children=s)}return n}function oF(e,t){const n=t.data||{},r="value"in t&&!(J0.call(n,"hProperties")||J0.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 uF(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
290
|
+
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
291
|
+
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
292
|
+
`}),n}function z_(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function F_(e,t){const n=iF(e,t),r=n.one(e,void 0),s=rF(n),l=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return s&&l.children.push({type:"text",value:`
|
|
293
|
+
`},s),l}function cF(e,t){return e&&"run"in e?async function(n,r){const s=F_(n,{file:r,...t});await e.run(s,r)}:function(n,r){return F_(n,{file:r,...e||t})}}function $_(e){if(e)throw e}var r0,V_;function dF(){if(V_)return r0;V_=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,s=function(m){return typeof Array.isArray=="function"?Array.isArray(m):t.call(m)==="[object Array]"},l=function(m){if(!m||t.call(m)!=="[object Object]")return!1;var p=e.call(m,"constructor"),g=m.constructor&&m.constructor.prototype&&e.call(m.constructor.prototype,"isPrototypeOf");if(m.constructor&&!p&&!g)return!1;var y;for(y in m);return typeof y>"u"||e.call(m,y)},o=function(m,p){n&&p.name==="__proto__"?n(m,p.name,{enumerable:!0,configurable:!0,value:p.newValue,writable:!0}):m[p.name]=p.newValue},c=function(m,p){if(p==="__proto__")if(e.call(m,p)){if(r)return r(m,p).value}else return;return m[p]};return r0=function d(){var m,p,g,y,E,v,k=arguments[0],C=1,S=arguments.length,A=!1;for(typeof k=="boolean"&&(A=k,k=arguments[1]||{},C=2),(k==null||typeof k!="object"&&typeof k!="function")&&(k={});C<S;++C)if(m=arguments[C],m!=null)for(p in m)g=c(k,p),y=c(m,p),k!==y&&(A&&y&&(l(y)||(E=s(y)))?(E?(E=!1,v=g&&s(g)?g:[]):v=g&&l(g)?g:{},o(k,{name:p,newValue:d(A,v,y)})):typeof y<"u"&&o(k,{name:p,newValue:y}));return k},r0}var fF=dF();const a0=Bf(fF);function eg(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 hF(){const e=[],t={run:n,use:r};return t;function n(...s){let l=-1;const o=s.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);c(null,...s);function c(d,...m){const p=e[++l];let g=-1;if(d){o(d);return}for(;++g<s.length;)(m[g]===null||m[g]===void 0)&&(m[g]=s[g]);s=m,p?mF(p,c)(...m):o(null,...m)}}function r(s){if(typeof s!="function")throw new TypeError("Expected `middelware` to be a function, not "+s);return e.push(s),t}}function mF(e,t){let n;return r;function r(...o){const c=e.length>o.length;let d;c&&o.push(s);try{d=e.apply(this,o)}catch(m){const p=m;if(c&&n)throw p;return s(p)}c||(d&&d.then&&typeof d.then=="function"?d.then(l,s):d instanceof Error?s(d):l(d))}function s(o,...c){n||(n=!0,t(o,...c))}function l(o){s(null,o)}}const Ha={basename:pF,dirname:gF,extname:bF,join:xF,sep:"/"};function pF(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Tc(e);let n=0,r=-1,s=e.length,l;if(t===void 0||t.length===0||t.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(l){n=s+1;break}}else r<0&&(l=!0,r=s+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let o=-1,c=t.length-1;for(;s--;)if(e.codePointAt(s)===47){if(l){n=s+1;break}}else o<0&&(l=!0,o=s+1),c>-1&&(e.codePointAt(s)===t.codePointAt(c--)?c<0&&(r=s):(c=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function gF(e){if(Tc(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 bF(e){Tc(e);let t=e.length,n=-1,r=0,s=-1,l=0,o;for(;t--;){const c=e.codePointAt(t);if(c===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),c===46?s<0?s=t:l!==1&&(l=1):s>-1&&(l=-1)}return s<0||n<0||l===0||l===1&&s===n-1&&s===r+1?"":e.slice(s,n)}function xF(...e){let t=-1,n;for(;++t<e.length;)Tc(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":yF(n)}function yF(e){Tc(e);const t=e.codePointAt(0)===47;let n=EF(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function EF(e,t){let n="",r=0,s=-1,l=0,o=-1,c,d;for(;++o<=e.length;){if(o<e.length)c=e.codePointAt(o);else{if(c===47)break;c=47}if(c===47){if(!(s===o-1||l===1))if(s!==o-1&&l===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(d=n.lastIndexOf("/"),d!==n.length-1){d<0?(n="",r=0):(n=n.slice(0,d),r=n.length-1-n.lastIndexOf("/")),s=o,l=0;continue}}else if(n.length>0){n="",r=0,s=o,l=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(s+1,o):n=e.slice(s+1,o),r=o-s-1;s=o,l=0}else c===46&&l>-1?l++:l=-1}return n}function Tc(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const _F={cwd:TF};function TF(){return"/"}function tg(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function vF(e){if(typeof e=="string")e=new URL(e);else if(!tg(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 wF(e)}function wF(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 i0=["history","path","basename","stem","extname","dirname"];class kF{constructor(t){let n;t?tg(t)?n={path:t}:typeof t=="string"||CF(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":_F.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<i0.length;){const l=i0[r];l in n&&n[l]!==void 0&&n[l]!==null&&(this[l]=l==="history"?[...n[l]]:n[l])}let s;for(s in n)i0.includes(s)||(this[s]=n[s])}get basename(){return typeof this.path=="string"?Ha.basename(this.path):void 0}set basename(t){l0(t,"basename"),s0(t,"basename"),this.path=Ha.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Ha.dirname(this.path):void 0}set dirname(t){G_(this.basename,"dirname"),this.path=Ha.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Ha.extname(this.path):void 0}set extname(t){if(s0(t,"extname"),G_(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=Ha.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){tg(t)&&(t=vF(t)),l0(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Ha.basename(this.path,this.extname):void 0}set stem(t){l0(t,"stem"),s0(t,"stem"),this.path=Ha.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 lr(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 s0(e,t){if(e&&e.includes(Ha.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Ha.sep+"`")}function l0(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function G_(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function CF(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const SF=(function(e){const r=this.constructor.prototype,s=r[e],l=function(){return s.apply(l,arguments)};return Object.setPrototypeOf(l,r),l}),AF={}.hasOwnProperty;class g1 extends SF{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=hF()}copy(){const t=new g1;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(a0(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(c0("data",this.frozen),this.namespace[t]=n,this):AF.call(this.namespace,t)&&this.namespace[t]||void 0:t?(c0("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=$d(t),r=this.parser||this.Parser;return o0("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),o0("process",this.parser||this.Parser),u0("process",this.compiler||this.Compiler),n?s(void 0,n):new Promise(s);function s(l,o){const c=$d(t),d=r.parse(c);r.run(d,c,function(p,g,y){if(p||!g||!y)return m(p);const E=g,v=r.stringify(E,y);LF(v)?y.value=v:y.result=v,m(p,y)});function m(p,g){p||!g?o(p):l?l(g):n(void 0,g)}}}processSync(t){let n=!1,r;return this.freeze(),o0("processSync",this.parser||this.Parser),u0("processSync",this.compiler||this.Compiler),this.process(t,s),Y_("processSync","process",n),r;function s(l,o){n=!0,$_(l),r=o}}run(t,n,r){q_(t),this.freeze();const s=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?l(void 0,r):new Promise(l);function l(o,c){const d=$d(n);s.run(t,d,m);function m(p,g,y){const E=g||t;p?c(p):o?o(E):r(void 0,E,y)}}}runSync(t,n){let r=!1,s;return this.run(t,n,l),Y_("runSync","run",r),s;function l(o,c){$_(o),s=c,r=!0}}stringify(t,n){this.freeze();const r=$d(n),s=this.compiler||this.Compiler;return u0("stringify",s),q_(t),s(t,r)}use(t,...n){const r=this.attachers,s=this.namespace;if(c0("use",this.frozen),t!=null)if(typeof t=="function")d(t,n);else if(typeof t=="object")Array.isArray(t)?c(t):o(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function l(m){if(typeof m=="function")d(m,[]);else if(typeof m=="object")if(Array.isArray(m)){const[p,...g]=m;d(p,g)}else o(m);else throw new TypeError("Expected usable value, not `"+m+"`")}function o(m){if(!("plugins"in m)&&!("settings"in m))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");c(m.plugins),m.settings&&(s.settings=a0(!0,s.settings,m.settings))}function c(m){let p=-1;if(m!=null)if(Array.isArray(m))for(;++p<m.length;){const g=m[p];l(g)}else throw new TypeError("Expected a list of plugins, not `"+m+"`")}function d(m,p){let g=-1,y=-1;for(;++g<r.length;)if(r[g][0]===m){y=g;break}if(y===-1)r.push([m,...p]);else if(p.length>0){let[E,...v]=p;const k=r[y][1];eg(k)&&eg(E)&&(E=a0(!0,k,E)),r[y]=[m,E,...v]}}}}const NF=new g1().freeze();function o0(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function u0(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function c0(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 q_(e){if(!eg(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Y_(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function $d(e){return RF(e)?e:new kF(e)}function RF(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function LF(e){return typeof e=="string"||IF(e)}function IF(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}function b1(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var xl=b1();function Ck(e){xl=e}var rl={exec:()=>null};function Ft(e,t=""){let n=typeof e=="string"?e:e.source,r={replace:(s,l)=>{let o=typeof l=="string"?l:l.source;return o=o.replace(hr.caret,"$1"),n=n.replace(s,o),r},getRegex:()=>new RegExp(n,t)};return r}var OF=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),hr={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}>`)},DF=/^(?:[ \t]*(?:\n|$))+/,jF=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,MF=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,vc=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,PF=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,x1=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Sk=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Ak=Ft(Sk).replace(/bull/g,x1).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),BF=Ft(Sk).replace(/bull/g,x1).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),y1=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,UF=/^[^\n]+/,E1=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,HF=Ft(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",E1).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),zF=Ft(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,x1).getRegex(),oh="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|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",_1=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,FF=Ft("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",_1).replace("tag",oh).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Nk=Ft(y1).replace("hr",vc).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",oh).getRegex(),$F=Ft(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Nk).getRegex(),T1={blockquote:$F,code:jF,def:HF,fences:MF,heading:PF,hr:vc,html:FF,lheading:Ak,list:zF,newline:DF,paragraph:Nk,table:rl,text:UF},W_=Ft("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",vc).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",oh).getRegex(),VF={...T1,lheading:BF,table:W_,paragraph:Ft(y1).replace("hr",vc).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",W_).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",oh).getRegex()},GF={...T1,html:Ft(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",_1).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:rl,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Ft(y1).replace("hr",vc).replace("heading",` *#{1,6} *[^
|
|
294
|
+
]`).replace("lheading",Ak).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},qF=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,YF=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Rk=/^( {2,}|\\)\n(?!\s*$)/,WF=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,jo=/[\p{P}\p{S}]/u,uh=/[\s\p{P}\p{S}]/u,v1=/[^\s\p{P}\p{S}]/u,QF=Ft(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,uh).getRegex(),Lk=/(?!~)[\p{P}\p{S}]/u,XF=/(?!~)[\s\p{P}\p{S}]/u,KF=/(?:[^\s\p{P}\p{S}]|~)/u,ZF=Ft(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",OF?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Ik=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,JF=Ft(Ik,"u").replace(/punct/g,jo).getRegex(),e$=Ft(Ik,"u").replace(/punct/g,Lk).getRegex(),Ok="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",t$=Ft(Ok,"gu").replace(/notPunctSpace/g,v1).replace(/punctSpace/g,uh).replace(/punct/g,jo).getRegex(),n$=Ft(Ok,"gu").replace(/notPunctSpace/g,KF).replace(/punctSpace/g,XF).replace(/punct/g,Lk).getRegex(),r$=Ft("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,v1).replace(/punctSpace/g,uh).replace(/punct/g,jo).getRegex(),a$=Ft(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,jo).getRegex(),i$="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",s$=Ft(i$,"gu").replace(/notPunctSpace/g,v1).replace(/punctSpace/g,uh).replace(/punct/g,jo).getRegex(),l$=Ft(/\\(punct)/,"gu").replace(/punct/g,jo).getRegex(),o$=Ft(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),u$=Ft(_1).replace("(?:-->|$)","-->").getRegex(),c$=Ft("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",u$).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Of=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,d$=Ft(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Of).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Dk=Ft(/^!?\[(label)\]\[(ref)\]/).replace("label",Of).replace("ref",E1).getRegex(),jk=Ft(/^!?\[(ref)\](?:\[\])?/).replace("ref",E1).getRegex(),f$=Ft("reflink|nolink(?!\\()","g").replace("reflink",Dk).replace("nolink",jk).getRegex(),Q_=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,w1={_backpedal:rl,anyPunctuation:l$,autolink:o$,blockSkip:ZF,br:Rk,code:YF,del:rl,delLDelim:rl,delRDelim:rl,emStrongLDelim:JF,emStrongRDelimAst:t$,emStrongRDelimUnd:r$,escape:qF,link:d$,nolink:jk,punctuation:QF,reflink:Dk,reflinkSearch:f$,tag:c$,text:WF,url:rl},h$={...w1,link:Ft(/^!?\[(label)\]\((.*?)\)/).replace("label",Of).getRegex(),reflink:Ft(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Of).getRegex()},ng={...w1,emStrongRDelimAst:n$,emStrongLDelim:e$,delLDelim:a$,delRDelim:s$,url:Ft(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Q_).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:Ft(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Q_).getRegex()},m$={...ng,br:Ft(Rk).replace("{2,}","*").getRegex(),text:Ft(ng.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Vd={normal:T1,gfm:VF,pedantic:GF},Ou={normal:w1,gfm:ng,breaks:m$,pedantic:h$},p$={"&":"&","<":"<",">":">",'"':""","'":"'"},X_=e=>p$[e];function Ua(e,t){if(t){if(hr.escapeTest.test(e))return e.replace(hr.escapeReplace,X_)}else if(hr.escapeTestNoEncode.test(e))return e.replace(hr.escapeReplaceNoEncode,X_);return e}function K_(e){try{e=encodeURI(e).replace(hr.percentDecode,"%")}catch{return null}return e}function Z_(e,t){var l;let n=e.replace(hr.findPipe,(o,c,d)=>{let m=!1,p=c;for(;--p>=0&&d[p]==="\\";)m=!m;return m?"|":" |"}),r=n.split(hr.splitPipe),s=0;if(r[0].trim()||r.shift(),r.length>0&&!((l=r.at(-1))!=null&&l.trim())&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;s<r.length;s++)r[s]=r[s].trim().replace(hr.slashPipe,"|");return r}function Du(e,t,n){let r=e.length;if(r===0)return"";let s=0;for(;s<r&&e.charAt(r-s-1)===t;)s++;return e.slice(0,r-s)}function g$(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]==="\\")r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function b$(e,t=0){let n=t,r="";for(let s of e)if(s===" "){let l=4-n%4;r+=" ".repeat(l),n+=l}else r+=s,n++;return r}function J_(e,t,n,r,s){let l=t.href,o=t.title||null,c=e[1].replace(s.other.outputLinkReplace,"$1");r.state.inLink=!0;let d={type:e[0].charAt(0)==="!"?"image":"link",raw:n,href:l,title:o,text:c,tokens:r.inlineTokens(c)};return r.state.inLink=!1,d}function x$(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let s=r[1];return t.split(`
|
|
295
|
+
`).map(l=>{let o=l.match(n.other.beginningSpace);if(o===null)return l;let[c]=o;return c.length>=s.length?l.slice(s.length):l}).join(`
|
|
296
|
+
`)}var Df=class{constructor(e){le(this,"options");le(this,"rules");le(this,"lexer");this.options=e||xl}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let n=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:Du(n,`
|
|
297
|
+
`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let n=t[0],r=x$(n,t[3]||"",this.rules);return{type:"code",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:r}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(this.rules.other.endingHash.test(n)){let r=Du(n,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(n=r.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:Du(t[0],`
|
|
298
|
+
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let n=Du(t[0],`
|
|
299
|
+
`).split(`
|
|
300
|
+
`),r="",s="",l=[];for(;n.length>0;){let o=!1,c=[],d;for(d=0;d<n.length;d++)if(this.rules.other.blockquoteStart.test(n[d]))c.push(n[d]),o=!0;else if(!o)c.push(n[d]);else break;n=n.slice(d);let m=c.join(`
|
|
301
|
+
`),p=m.replace(this.rules.other.blockquoteSetextReplace,`
|
|
302
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
|
|
303
|
+
${m}`:m,s=s?`${s}
|
|
304
|
+
${p}`:p;let g=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(p,l,!0),this.lexer.state.top=g,n.length===0)break;let y=l.at(-1);if((y==null?void 0:y.type)==="code")break;if((y==null?void 0:y.type)==="blockquote"){let E=y,v=E.raw+`
|
|
305
|
+
`+n.join(`
|
|
306
|
+
`),k=this.blockquote(v);l[l.length-1]=k,r=r.substring(0,r.length-E.raw.length)+k.raw,s=s.substring(0,s.length-E.text.length)+k.text;break}else if((y==null?void 0:y.type)==="list"){let E=y,v=E.raw+`
|
|
307
|
+
`+n.join(`
|
|
308
|
+
`),k=this.list(v);l[l.length-1]=k,r=r.substring(0,r.length-y.raw.length)+k.raw,s=s.substring(0,s.length-E.raw.length)+k.raw,n=v.substring(l.at(-1).raw.length).split(`
|
|
309
|
+
`);continue}}return{type:"blockquote",raw:r,tokens:l,text:s}}}list(e){var n,r;let t=this.rules.block.list.exec(e);if(t){let s=t[1].trim(),l=s.length>1,o={type:"list",raw:"",ordered:l,start:l?+s.slice(0,-1):"",loose:!1,items:[]};s=l?`\\d{1,9}\\${s.slice(-1)}`:`\\${s}`,this.options.pedantic&&(s=l?s:"[*+-]");let c=this.rules.other.listItemRegex(s),d=!1;for(;e;){let p=!1,g="",y="";if(!(t=c.exec(e))||this.rules.block.hr.test(e))break;g=t[0],e=e.substring(g.length);let E=b$(t[2].split(`
|
|
310
|
+
`,1)[0],t[1].length),v=e.split(`
|
|
311
|
+
`,1)[0],k=!E.trim(),C=0;if(this.options.pedantic?(C=2,y=E.trimStart()):k?C=t[1].length+1:(C=E.search(this.rules.other.nonSpaceChar),C=C>4?1:C,y=E.slice(C),C+=t[1].length),k&&this.rules.other.blankLine.test(v)&&(g+=v+`
|
|
312
|
+
`,e=e.substring(v.length+1),p=!0),!p){let S=this.rules.other.nextBulletRegex(C),A=this.rules.other.hrRegex(C),N=this.rules.other.fencesBeginRegex(C),U=this.rules.other.headingBeginRegex(C),G=this.rules.other.htmlBeginRegex(C),P=this.rules.other.blockquoteBeginRegex(C);for(;e;){let H=e.split(`
|
|
313
|
+
`,1)[0],Y;if(v=H,this.options.pedantic?(v=v.replace(this.rules.other.listReplaceNesting," "),Y=v):Y=v.replace(this.rules.other.tabCharGlobal," "),N.test(v)||U.test(v)||G.test(v)||P.test(v)||S.test(v)||A.test(v))break;if(Y.search(this.rules.other.nonSpaceChar)>=C||!v.trim())y+=`
|
|
314
|
+
`+Y.slice(C);else{if(k||E.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||N.test(E)||U.test(E)||A.test(E))break;y+=`
|
|
315
|
+
`+v}k=!v.trim(),g+=H+`
|
|
316
|
+
`,e=e.substring(H.length+1),E=Y.slice(C)}}o.loose||(d?o.loose=!0:this.rules.other.doubleBlankLine.test(g)&&(d=!0)),o.items.push({type:"list_item",raw:g,task:!!this.options.gfm&&this.rules.other.listIsTask.test(y),loose:!1,text:y,tokens:[]}),o.raw+=g}let m=o.items.at(-1);if(m)m.raw=m.raw.trimEnd(),m.text=m.text.trimEnd();else return;o.raw=o.raw.trimEnd();for(let p of o.items){if(this.lexer.state.top=!1,p.tokens=this.lexer.blockTokens(p.text,[]),p.task){if(p.text=p.text.replace(this.rules.other.listReplaceTask,""),((n=p.tokens[0])==null?void 0:n.type)==="text"||((r=p.tokens[0])==null?void 0:r.type)==="paragraph"){p.tokens[0].raw=p.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),p.tokens[0].text=p.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let y=this.lexer.inlineQueue.length-1;y>=0;y--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[y].src)){this.lexer.inlineQueue[y].src=this.lexer.inlineQueue[y].src.replace(this.rules.other.listReplaceTask,"");break}}let g=this.rules.other.listTaskCheckbox.exec(p.raw);if(g){let y={type:"checkbox",raw:g[0]+" ",checked:g[0]!=="[ ]"};p.checked=y.checked,o.loose?p.tokens[0]&&["paragraph","text"].includes(p.tokens[0].type)&&"tokens"in p.tokens[0]&&p.tokens[0].tokens?(p.tokens[0].raw=y.raw+p.tokens[0].raw,p.tokens[0].text=y.raw+p.tokens[0].text,p.tokens[0].tokens.unshift(y)):p.tokens.unshift({type:"paragraph",raw:y.raw,text:y.raw,tokens:[y]}):p.tokens.unshift(y)}}if(!o.loose){let g=p.tokens.filter(E=>E.type==="space"),y=g.length>0&&g.some(E=>this.rules.other.anyLine.test(E.raw));o.loose=y}}if(o.loose)for(let p of o.items){p.loose=!0;for(let g of p.tokens)g.type==="text"&&(g.type="paragraph")}return o}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let n=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:n,raw:t[0],href:r,title:s}}}table(e){var o;let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=Z_(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=(o=t[3])!=null&&o.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
317
|
+
`):[],l={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let c of r)this.rules.other.tableAlignRight.test(c)?l.align.push("right"):this.rules.other.tableAlignCenter.test(c)?l.align.push("center"):this.rules.other.tableAlignLeft.test(c)?l.align.push("left"):l.align.push(null);for(let c=0;c<n.length;c++)l.header.push({text:n[c],tokens:this.lexer.inline(n[c]),header:!0,align:l.align[c]});for(let c of s)l.rows.push(Z_(c,l.header.length).map((d,m)=>({text:d,tokens:this.lexer.inline(d),header:!1,align:l.align[m]})));return l}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let n=t[1].trim();return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:n,tokens:this.lexer.inline(n)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let n=t[1].charAt(t[1].length-1)===`
|
|
318
|
+
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let n=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let l=Du(n.slice(0,-1),"\\");if((n.length-l.length)%2===0)return}else{let l=g$(t[2],"()");if(l===-2)return;if(l>-1){let o=(t[0].indexOf("!")===0?5:4)+t[1].length+l;t[2]=t[2].substring(0,l),t[0]=t[0].substring(0,o).trim(),t[3]=""}}let r=t[2],s="";if(this.options.pedantic){let l=this.rules.other.pedanticHrefTitle.exec(r);l&&(r=l[1],s=l[3])}else s=t[3]?t[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?r=r.slice(1):r=r.slice(1,-1)),J_(t,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let r=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=t[r.toLowerCase()];if(!s){let l=n[0].charAt(0);return{type:"text",raw:l,text:l}}return J_(n,s,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let s=[...r[0]].length-1,l,o,c=s,d=0,m=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(m.lastIndex=0,t=t.slice(-1*e.length+s);(r=m.exec(t))!==null;){if(l=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!l)continue;if(o=[...l].length,r[3]||r[4]){c+=o;continue}else if((r[5]||r[6])&&s%3&&!((s+o)%3)){d+=o;continue}if(c-=o,c>0)continue;o=Math.min(o,o+c+d);let p=[...r[0]][0].length,g=e.slice(0,s+r.index+p+o);if(Math.min(s,o)%2){let E=g.slice(1,-1);return{type:"em",raw:g,text:E,tokens:this.lexer.inlineTokens(E)}}let y=g.slice(2,-2);return{type:"strong",raw:g,text:y,tokens:this.lexer.inlineTokens(y)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(n),s=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&s&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:t[0],text:n}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e,t,n=""){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let s=[...r[0]].length-1,l,o,c=s,d=this.rules.inline.delRDelim;for(d.lastIndex=0,t=t.slice(-1*e.length+s);(r=d.exec(t))!==null;){if(l=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!l||(o=[...l].length,o!==s))continue;if(r[3]||r[4]){c+=o;continue}if(c-=o,c>0)continue;o=Math.min(o,o+c);let m=[...r[0]][0].length,p=e.slice(0,s+r.index+m+o),g=p.slice(s,-s);return{type:"del",raw:p,text:g,tokens:this.lexer.inlineTokens(g)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let n,r;return t[2]==="@"?(n=t[1],r="mailto:"+n):(n=t[1],r=n),{type:"link",raw:t[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}url(e){var n;let t;if(t=this.rules.inline.url.exec(e)){let r,s;if(t[2]==="@")r=t[0],s="mailto:"+r;else{let l;do l=t[0],t[0]=((n=this.rules.inline._backpedal.exec(t[0]))==null?void 0:n[0])??"";while(l!==t[0]);r=t[0],t[1]==="www."?s="http://"+t[0]:s=t[0]}return{type:"link",raw:t[0],text:r,href:s,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let n=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:n}}}},ta=class rg{constructor(t){le(this,"tokens");le(this,"options");le(this,"state");le(this,"inlineQueue");le(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=t||xl,this.options.tokenizer=this.options.tokenizer||new Df,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let n={other:hr,block:Vd.normal,inline:Ou.normal};this.options.pedantic?(n.block=Vd.pedantic,n.inline=Ou.pedantic):this.options.gfm&&(n.block=Vd.gfm,this.options.breaks?n.inline=Ou.breaks:n.inline=Ou.gfm),this.tokenizer.rules=n}static get rules(){return{block:Vd,inline:Ou}}static lex(t,n){return new rg(n).lex(t)}static lexInline(t,n){return new rg(n).inlineTokens(t)}lex(t){t=t.replace(hr.carriageReturn,`
|
|
319
|
+
`),this.blockTokens(t,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let r=this.inlineQueue[n];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,n=[],r=!1){var s,l,o;for(this.tokenizer.lexer=this,this.options.pedantic&&(t=t.replace(hr.tabCharGlobal," ").replace(hr.spaceLine,""));t;){let c;if((l=(s=this.options.extensions)==null?void 0:s.block)!=null&&l.some(m=>(c=m.call({lexer:this},t,n))?(t=t.substring(c.raw.length),n.push(c),!0):!1))continue;if(c=this.tokenizer.space(t)){t=t.substring(c.raw.length);let m=n.at(-1);c.raw.length===1&&m!==void 0?m.raw+=`
|
|
320
|
+
`:n.push(c);continue}if(c=this.tokenizer.code(t)){t=t.substring(c.raw.length);let m=n.at(-1);(m==null?void 0:m.type)==="paragraph"||(m==null?void 0:m.type)==="text"?(m.raw+=(m.raw.endsWith(`
|
|
321
|
+
`)?"":`
|
|
322
|
+
`)+c.raw,m.text+=`
|
|
323
|
+
`+c.text,this.inlineQueue.at(-1).src=m.text):n.push(c);continue}if(c=this.tokenizer.fences(t)){t=t.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.heading(t)){t=t.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.hr(t)){t=t.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.blockquote(t)){t=t.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.list(t)){t=t.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.html(t)){t=t.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.def(t)){t=t.substring(c.raw.length);let m=n.at(-1);(m==null?void 0:m.type)==="paragraph"||(m==null?void 0:m.type)==="text"?(m.raw+=(m.raw.endsWith(`
|
|
324
|
+
`)?"":`
|
|
325
|
+
`)+c.raw,m.text+=`
|
|
326
|
+
`+c.raw,this.inlineQueue.at(-1).src=m.text):this.tokens.links[c.tag]||(this.tokens.links[c.tag]={href:c.href,title:c.title},n.push(c));continue}if(c=this.tokenizer.table(t)){t=t.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.lheading(t)){t=t.substring(c.raw.length),n.push(c);continue}let d=t;if((o=this.options.extensions)!=null&&o.startBlock){let m=1/0,p=t.slice(1),g;this.options.extensions.startBlock.forEach(y=>{g=y.call({lexer:this},p),typeof g=="number"&&g>=0&&(m=Math.min(m,g))}),m<1/0&&m>=0&&(d=t.substring(0,m+1))}if(this.state.top&&(c=this.tokenizer.paragraph(d))){let m=n.at(-1);r&&(m==null?void 0:m.type)==="paragraph"?(m.raw+=(m.raw.endsWith(`
|
|
327
|
+
`)?"":`
|
|
328
|
+
`)+c.raw,m.text+=`
|
|
329
|
+
`+c.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=m.text):n.push(c),r=d.length!==t.length,t=t.substring(c.raw.length);continue}if(c=this.tokenizer.text(t)){t=t.substring(c.raw.length);let m=n.at(-1);(m==null?void 0:m.type)==="text"?(m.raw+=(m.raw.endsWith(`
|
|
330
|
+
`)?"":`
|
|
331
|
+
`)+c.raw,m.text+=`
|
|
332
|
+
`+c.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=m.text):n.push(c);continue}if(t){let m="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(m);break}else throw new Error(m)}}return this.state.top=!0,n}inline(t,n=[]){return this.inlineQueue.push({src:t,tokens:n}),n}inlineTokens(t,n=[]){var d,m,p,g,y;this.tokenizer.lexer=this;let r=t,s=null;if(this.tokens.links){let E=Object.keys(this.tokens.links);if(E.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(r))!==null;)E.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.anyPunctuation.exec(r))!==null;)r=r.slice(0,s.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let l;for(;(s=this.tokenizer.rules.inline.blockSkip.exec(r))!==null;)l=s[2]?s[2].length:0,r=r.slice(0,s.index+l)+"["+"a".repeat(s[0].length-l-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);r=((m=(d=this.options.hooks)==null?void 0:d.emStrongMask)==null?void 0:m.call({lexer:this},r))??r;let o=!1,c="";for(;t;){o||(c=""),o=!1;let E;if((g=(p=this.options.extensions)==null?void 0:p.inline)!=null&&g.some(k=>(E=k.call({lexer:this},t,n))?(t=t.substring(E.raw.length),n.push(E),!0):!1))continue;if(E=this.tokenizer.escape(t)){t=t.substring(E.raw.length),n.push(E);continue}if(E=this.tokenizer.tag(t)){t=t.substring(E.raw.length),n.push(E);continue}if(E=this.tokenizer.link(t)){t=t.substring(E.raw.length),n.push(E);continue}if(E=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(E.raw.length);let k=n.at(-1);E.type==="text"&&(k==null?void 0:k.type)==="text"?(k.raw+=E.raw,k.text+=E.text):n.push(E);continue}if(E=this.tokenizer.emStrong(t,r,c)){t=t.substring(E.raw.length),n.push(E);continue}if(E=this.tokenizer.codespan(t)){t=t.substring(E.raw.length),n.push(E);continue}if(E=this.tokenizer.br(t)){t=t.substring(E.raw.length),n.push(E);continue}if(E=this.tokenizer.del(t,r,c)){t=t.substring(E.raw.length),n.push(E);continue}if(E=this.tokenizer.autolink(t)){t=t.substring(E.raw.length),n.push(E);continue}if(!this.state.inLink&&(E=this.tokenizer.url(t))){t=t.substring(E.raw.length),n.push(E);continue}let v=t;if((y=this.options.extensions)!=null&&y.startInline){let k=1/0,C=t.slice(1),S;this.options.extensions.startInline.forEach(A=>{S=A.call({lexer:this},C),typeof S=="number"&&S>=0&&(k=Math.min(k,S))}),k<1/0&&k>=0&&(v=t.substring(0,k+1))}if(E=this.tokenizer.inlineText(v)){t=t.substring(E.raw.length),E.raw.slice(-1)!=="_"&&(c=E.raw.slice(-1)),o=!0;let k=n.at(-1);(k==null?void 0:k.type)==="text"?(k.raw+=E.raw,k.text+=E.text):n.push(E);continue}if(t){let k="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(k);break}else throw new Error(k)}}return n}},jf=class{constructor(t){le(this,"options");le(this,"parser");this.options=t||xl}space(t){return""}code({text:t,lang:n,escaped:r}){var o;let s=(o=(n||"").match(hr.notSpaceStart))==null?void 0:o[0],l=t.replace(hr.endingNewline,"")+`
|
|
333
|
+
`;return s?'<pre><code class="language-'+Ua(s)+'">'+(r?l:Ua(l,!0))+`</code></pre>
|
|
334
|
+
`:"<pre><code>"+(r?l:Ua(l,!0))+`</code></pre>
|
|
335
|
+
`}blockquote({tokens:t}){return`<blockquote>
|
|
336
|
+
${this.parser.parse(t)}</blockquote>
|
|
337
|
+
`}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:n}){return`<h${n}>${this.parser.parseInline(t)}</h${n}>
|
|
338
|
+
`}hr(t){return`<hr>
|
|
339
|
+
`}list(t){let n=t.ordered,r=t.start,s="";for(let c=0;c<t.items.length;c++){let d=t.items[c];s+=this.listitem(d)}let l=n?"ol":"ul",o=n&&r!==1?' start="'+r+'"':"";return"<"+l+o+`>
|
|
340
|
+
`+s+"</"+l+`>
|
|
341
|
+
`}listitem(t){return`<li>${this.parser.parse(t.tokens)}</li>
|
|
342
|
+
`}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
|
|
343
|
+
`}table(t){let n="",r="";for(let l=0;l<t.header.length;l++)r+=this.tablecell(t.header[l]);n+=this.tablerow({text:r});let s="";for(let l=0;l<t.rows.length;l++){let o=t.rows[l];r="";for(let c=0;c<o.length;c++)r+=this.tablecell(o[c]);s+=this.tablerow({text:r})}return s&&(s=`<tbody>${s}</tbody>`),`<table>
|
|
344
|
+
<thead>
|
|
345
|
+
`+n+`</thead>
|
|
346
|
+
`+s+`</table>
|
|
347
|
+
`}tablerow({text:t}){return`<tr>
|
|
348
|
+
${t}</tr>
|
|
349
|
+
`}tablecell(t){let n=this.parser.parseInline(t.tokens),r=t.header?"th":"td";return(t.align?`<${r} align="${t.align}">`:`<${r}>`)+n+`</${r}>
|
|
350
|
+
`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${Ua(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:n,tokens:r}){let s=this.parser.parseInline(r),l=K_(t);if(l===null)return s;t=l;let o='<a href="'+t+'"';return n&&(o+=' title="'+Ua(n)+'"'),o+=">"+s+"</a>",o}image({href:t,title:n,text:r,tokens:s}){s&&(r=this.parser.parseInline(s,this.parser.textRenderer));let l=K_(t);if(l===null)return Ua(r);t=l;let o=`<img src="${t}" alt="${Ua(r)}"`;return n&&(o+=` title="${Ua(n)}"`),o+=">",o}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:Ua(t.text)}},k1=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}checkbox({raw:e}){return e}},ya=class ag{constructor(t){le(this,"options");le(this,"renderer");le(this,"textRenderer");this.options=t||xl,this.options.renderer=this.options.renderer||new jf,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new k1}static parse(t,n){return new ag(n).parse(t)}static parseInline(t,n){return new ag(n).parseInline(t)}parse(t){var r,s;this.renderer.parser=this;let n="";for(let l=0;l<t.length;l++){let o=t[l];if((s=(r=this.options.extensions)==null?void 0:r.renderers)!=null&&s[o.type]){let d=o,m=this.options.extensions.renderers[d.type].call({parser:this},d);if(m!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(d.type)){n+=m||"";continue}}let c=o;switch(c.type){case"space":{n+=this.renderer.space(c);break}case"hr":{n+=this.renderer.hr(c);break}case"heading":{n+=this.renderer.heading(c);break}case"code":{n+=this.renderer.code(c);break}case"table":{n+=this.renderer.table(c);break}case"blockquote":{n+=this.renderer.blockquote(c);break}case"list":{n+=this.renderer.list(c);break}case"checkbox":{n+=this.renderer.checkbox(c);break}case"html":{n+=this.renderer.html(c);break}case"def":{n+=this.renderer.def(c);break}case"paragraph":{n+=this.renderer.paragraph(c);break}case"text":{n+=this.renderer.text(c);break}default:{let d='Token with "'+c.type+'" type was not found.';if(this.options.silent)return console.error(d),"";throw new Error(d)}}}return n}parseInline(t,n=this.renderer){var s,l;this.renderer.parser=this;let r="";for(let o=0;o<t.length;o++){let c=t[o];if((l=(s=this.options.extensions)==null?void 0:s.renderers)!=null&&l[c.type]){let m=this.options.extensions.renderers[c.type].call({parser:this},c);if(m!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(c.type)){r+=m||"";continue}}let d=c;switch(d.type){case"escape":{r+=n.text(d);break}case"html":{r+=n.html(d);break}case"link":{r+=n.link(d);break}case"image":{r+=n.image(d);break}case"checkbox":{r+=n.checkbox(d);break}case"strong":{r+=n.strong(d);break}case"em":{r+=n.em(d);break}case"codespan":{r+=n.codespan(d);break}case"br":{r+=n.br(d);break}case"del":{r+=n.del(d);break}case"text":{r+=n.text(d);break}default:{let m='Token with "'+d.type+'" type was not found.';if(this.options.silent)return console.error(m),"";throw new Error(m)}}}return r}},ef,Uu=(ef=class{constructor(e){le(this,"options");le(this,"block");this.options=e||xl}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?ta.lex:ta.lexInline}provideParser(e=this.block){return e?ya.parse:ya.parseInline}},le(ef,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),le(ef,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),ef),y$=class{constructor(...t){le(this,"defaults",b1());le(this,"options",this.setOptions);le(this,"parse",this.parseMarkdown(!0));le(this,"parseInline",this.parseMarkdown(!1));le(this,"Parser",ya);le(this,"Renderer",jf);le(this,"TextRenderer",k1);le(this,"Lexer",ta);le(this,"Tokenizer",Df);le(this,"Hooks",Uu);this.use(...t)}walkTokens(t,n){var s,l;let r=[];for(let o of t)switch(r=r.concat(n.call(this,o)),o.type){case"table":{let c=o;for(let d of c.header)r=r.concat(this.walkTokens(d.tokens,n));for(let d of c.rows)for(let m of d)r=r.concat(this.walkTokens(m.tokens,n));break}case"list":{let c=o;r=r.concat(this.walkTokens(c.items,n));break}default:{let c=o;(l=(s=this.defaults.extensions)==null?void 0:s.childTokens)!=null&&l[c.type]?this.defaults.extensions.childTokens[c.type].forEach(d=>{let m=c[d].flat(1/0);r=r.concat(this.walkTokens(m,n))}):c.tokens&&(r=r.concat(this.walkTokens(c.tokens,n)))}}return r}use(...t){let n=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(r=>{let s={...r};if(s.async=this.defaults.async||s.async||!1,r.extensions&&(r.extensions.forEach(l=>{if(!l.name)throw new Error("extension name required");if("renderer"in l){let o=n.renderers[l.name];o?n.renderers[l.name]=function(...c){let d=l.renderer.apply(this,c);return d===!1&&(d=o.apply(this,c)),d}:n.renderers[l.name]=l.renderer}if("tokenizer"in l){if(!l.level||l.level!=="block"&&l.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let o=n[l.level];o?o.unshift(l.tokenizer):n[l.level]=[l.tokenizer],l.start&&(l.level==="block"?n.startBlock?n.startBlock.push(l.start):n.startBlock=[l.start]:l.level==="inline"&&(n.startInline?n.startInline.push(l.start):n.startInline=[l.start]))}"childTokens"in l&&l.childTokens&&(n.childTokens[l.name]=l.childTokens)}),s.extensions=n),r.renderer){let l=this.defaults.renderer||new jf(this.defaults);for(let o in r.renderer){if(!(o in l))throw new Error(`renderer '${o}' does not exist`);if(["options","parser"].includes(o))continue;let c=o,d=r.renderer[c],m=l[c];l[c]=(...p)=>{let g=d.apply(l,p);return g===!1&&(g=m.apply(l,p)),g||""}}s.renderer=l}if(r.tokenizer){let l=this.defaults.tokenizer||new Df(this.defaults);for(let o in r.tokenizer){if(!(o in l))throw new Error(`tokenizer '${o}' does not exist`);if(["options","rules","lexer"].includes(o))continue;let c=o,d=r.tokenizer[c],m=l[c];l[c]=(...p)=>{let g=d.apply(l,p);return g===!1&&(g=m.apply(l,p)),g}}s.tokenizer=l}if(r.hooks){let l=this.defaults.hooks||new Uu;for(let o in r.hooks){if(!(o in l))throw new Error(`hook '${o}' does not exist`);if(["options","block"].includes(o))continue;let c=o,d=r.hooks[c],m=l[c];Uu.passThroughHooks.has(o)?l[c]=p=>{if(this.defaults.async&&Uu.passThroughHooksRespectAsync.has(o))return(async()=>{let y=await d.call(l,p);return m.call(l,y)})();let g=d.call(l,p);return m.call(l,g)}:l[c]=(...p)=>{if(this.defaults.async)return(async()=>{let y=await d.apply(l,p);return y===!1&&(y=await m.apply(l,p)),y})();let g=d.apply(l,p);return g===!1&&(g=m.apply(l,p)),g}}s.hooks=l}if(r.walkTokens){let l=this.defaults.walkTokens,o=r.walkTokens;s.walkTokens=function(c){let d=[];return d.push(o.call(this,c)),l&&(d=d.concat(l.call(this,c))),d}}this.defaults={...this.defaults,...s}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,n){return ta.lex(t,n??this.defaults)}parser(t,n){return ya.parse(t,n??this.defaults)}parseMarkdown(t){return(n,r)=>{let s={...r},l={...this.defaults,...s},o=this.onError(!!l.silent,!!l.async);if(this.defaults.async===!0&&s.async===!1)return o(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof n>"u"||n===null)return o(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(l.hooks&&(l.hooks.options=l,l.hooks.block=t),l.async)return(async()=>{let c=l.hooks?await l.hooks.preprocess(n):n,d=await(l.hooks?await l.hooks.provideLexer(t):t?ta.lex:ta.lexInline)(c,l),m=l.hooks?await l.hooks.processAllTokens(d):d;l.walkTokens&&await Promise.all(this.walkTokens(m,l.walkTokens));let p=await(l.hooks?await l.hooks.provideParser(t):t?ya.parse:ya.parseInline)(m,l);return l.hooks?await l.hooks.postprocess(p):p})().catch(o);try{l.hooks&&(n=l.hooks.preprocess(n));let c=(l.hooks?l.hooks.provideLexer(t):t?ta.lex:ta.lexInline)(n,l);l.hooks&&(c=l.hooks.processAllTokens(c)),l.walkTokens&&this.walkTokens(c,l.walkTokens);let d=(l.hooks?l.hooks.provideParser(t):t?ya.parse:ya.parseInline)(c,l);return l.hooks&&(d=l.hooks.postprocess(d)),d}catch(c){return o(c)}}}onError(t,n){return r=>{if(r.message+=`
|
|
351
|
+
Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error occurred:</p><pre>"+Ua(r.message+"",!0)+"</pre>";return n?Promise.resolve(s):s}if(n)return Promise.reject(r);throw r}}},hl=new y$;function nn(e,t){return hl.parse(e,t)}nn.options=nn.setOptions=function(e){return hl.setOptions(e),nn.defaults=hl.defaults,Ck(nn.defaults),nn};nn.getDefaults=b1;nn.defaults=xl;nn.use=function(...e){return hl.use(...e),nn.defaults=hl.defaults,Ck(nn.defaults),nn};nn.walkTokens=function(e,t){return hl.walkTokens(e,t)};nn.parseInline=hl.parseInline;nn.Parser=ya;nn.parser=ya.parse;nn.Renderer=jf;nn.TextRenderer=k1;nn.Lexer=ta;nn.lexer=ta.lex;nn.Tokenizer=Df;nn.Hooks=Uu;nn.parse=nn;nn.options;nn.setOptions;nn.use;nn.walkTokens;nn.parseInline;ya.parse;ta.lex;var E$=300,_$="300px",T$=500;function v$(e={}){let{immediate:t=!1,debounceDelay:n=E$,rootMargin:r=_$,idleTimeout:s=T$}=e,[l,o]=T.useState(!1),c=T.useRef(null),d=T.useRef(null),m=T.useRef(null),p=T.useMemo(()=>E=>{let v=Date.now();return window.setTimeout(()=>{E({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-v))})},1)},[]),g=T.useMemo(()=>typeof window<"u"&&window.requestIdleCallback?(E,v)=>window.requestIdleCallback(E,v):p,[p]),y=T.useMemo(()=>typeof window<"u"&&window.cancelIdleCallback?E=>window.cancelIdleCallback(E):E=>{clearTimeout(E)},[]);return T.useEffect(()=>{if(t){o(!0);return}let E=c.current;if(!E)return;d.current&&(clearTimeout(d.current),d.current=null),m.current&&(y(m.current),m.current=null);let v=()=>{d.current&&(clearTimeout(d.current),d.current=null),m.current&&(y(m.current),m.current=null)},k=N=>{m.current=g(U=>{U.timeRemaining()>0||U.didTimeout?(o(!0),N.disconnect()):m.current=g(()=>{o(!0),N.disconnect()},{timeout:s/2})},{timeout:s})},C=N=>{v(),d.current=window.setTimeout(()=>{var U,G;let P=N.takeRecords();(P.length===0||(G=(U=P.at(-1))==null?void 0:U.isIntersecting)!=null&&G)&&k(N)},n)},S=(N,U)=>{N.isIntersecting?C(U):v()},A=new IntersectionObserver(N=>{for(let U of N)S(U,A)},{rootMargin:r,threshold:0});return A.observe(E),()=>{d.current&&clearTimeout(d.current),m.current&&y(m.current),A.disconnect()}},[t,n,r,s,y,g]),{shouldRender:l,containerRef:c}}var Mk=/\s/,w$=/^\s+$/,k$=new Set(["code","pre","svg","math","annotation"]),C$=e=>typeof e=="object"&&e!==null&&"type"in e&&e.type==="element",S$=e=>e.some(t=>C$(t)&&k$.has(t.tagName)),A$=e=>{let t=[],n="",r=!1;for(let s of e){let l=Mk.test(s);l!==r&&n&&(t.push(n),n=""),n+=s,r=l}return n&&t.push(n),t},N$=e=>{let t=[],n="";for(let r of e)Mk.test(r)?n+=r:(n&&(t.push(n),n=""),t.push(r));return n&&t.push(n),t},R$=(e,t,n,r,s,l)=>{let o=`--sd-animation:sd-${t};--sd-duration:${s?0:n}ms;--sd-easing:${r}`;return l&&(o+=`;--sd-delay:${l}ms`),{type:"element",tagName:"span",properties:{"data-sd-animate":!0,style:o},children:[{type:"text",value:e}]}},L$=(e,t,n,r,s)=>{let l=t.at(-1);if(!(l&&"children"in l))return;if(S$(t))return fo;let o=l,c=o.children.indexOf(e);if(c===-1)return;let d=e.value;if(!d.trim()){s.count+=d.length;return}let m=n.sep==="char"?N$(d):A$(d),p=r.prevContentLength,g=m.map(y=>{let E=s.count;if(s.count+=y.length,w$.test(y))return{type:"text",value:y};let v=p>0&&E<p,k=v?0:s.newIndex++*n.stagger;return R$(y,n.animation,n.duration,n.easing,v,k)});return o.children.splice(c,1,...g),c+g.length},I$=0;function ig(e){var t,n,r,s,l;let o={animation:(t=e==null?void 0:e.animation)!=null?t:"fadeIn",duration:(n=e==null?void 0:e.duration)!=null?n:150,easing:(r=e==null?void 0:e.easing)!=null?r:"ease",sep:(s=e==null?void 0:e.sep)!=null?s:"word",stagger:(l=e==null?void 0:e.stagger)!=null?l:40},c={prevContentLength:0,lastRenderCharCount:0},d=I$++,m=()=>p=>{let g={count:0,newIndex:0};qg(p,"text",(y,E)=>L$(y,E,o,c,g)),c.lastRenderCharCount=g.count,c.prevContentLength=0};return Object.defineProperty(m,"name",{value:`rehypeAnimate$${d}`}),{name:"animate",type:"animate",rehypePlugin:m,setPrevContentLength(p){c.prevContentLength=p},getLastRenderCharCount(){let p=c.lastRenderCharCount;return c.lastRenderCharCount=0,p}}}ig();var Pk=T.createContext(!1),O$=()=>T.useContext(Pk),C1=(...e)=>pk(ek(e)),D$=(e,t)=>{if(!e||!t)return t;let n=`${e}:`;return t.split(/\s+/).filter(Boolean).map(r=>r.startsWith(n)?r:`${e}:${r}`).join(" ")},j$=e=>e?(...t)=>D$(e,pk(ek(t))):C1,go=(e,t,n)=>{let r=typeof t=="string"&&n.startsWith("text/csv")?"\uFEFF":"",s=typeof t=="string"?new Blob([r+t],{type:n}):t,l=URL.createObjectURL(s),o=document.createElement("a");o.href=l,o.download=e,document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(l)},sg=T.createContext(C1),It=()=>T.useContext(sg),M$=C1("block","before:content-[counter(line)]","before:inline-block","before:[counter-increment:line]","before:w-6","before:mr-4","before:text-[13px]","before:text-right","before:text-muted-foreground/50","before:font-mono","before:select-none"),P$=e=>{let t={};for(let n of e.split(";")){let r=n.indexOf(":");if(r>0){let s=n.slice(0,r).trim(),l=n.slice(r+1).trim();s&&l&&(t[s]=l)}}return t},B$=T.memo(({children:e,result:t,language:n,className:r,startLine:s,lineNumbers:l=!0,...o})=>{let c=It(),d=T.useMemo(()=>c(M$),[c]),m=T.useMemo(()=>{let p={};return t.bg&&(p["--sdm-bg"]=t.bg),t.fg&&(p["--sdm-fg"]=t.fg),t.rootStyle&&Object.assign(p,P$(t.rootStyle)),p},[t.bg,t.fg,t.rootStyle]);return h.jsx("div",{className:c(r,"overflow-x-auto rounded-md border border-border bg-background p-4 text-sm"),"data-language":n,"data-streamdown":"code-block-body",...o,children:h.jsx("pre",{className:c(r,"bg-[var(--sdm-bg,inherit]","dark:bg-[var(--shiki-dark-bg,var(--sdm-bg,inherit)]"),style:m,children:h.jsx("code",{className:l?c("[counter-increment:line_0] [counter-reset:line]"):void 0,style:l&&s&&s>1?{counterReset:`line ${s-1}`}:void 0,children:t.tokens.map((p,g)=>h.jsx("span",{className:l?d:void 0,children:p.length===0||p.length===1&&p[0].content===""?`
|
|
352
|
+
`:p.map((y,E)=>{let v={},k=!!y.bgColor;if(y.color&&(v["--sdm-c"]=y.color),y.bgColor&&(v["--sdm-tbg"]=y.bgColor),y.htmlStyle)for(let[C,S]of Object.entries(y.htmlStyle))C==="color"?v["--sdm-c"]=S:C==="background-color"?(v["--sdm-tbg"]=S,k=!0):v[C]=S;return h.jsx("span",{className:c("text-[var(--sdm-c,inherit)]","dark:text-[var(--shiki-dark,var(--sdm-c,inherit))]",k&&"bg-[var(--sdm-tbg)]",k&&"dark:bg-[var(--shiki-dark-bg,var(--sdm-tbg))]"),style:v,...y.htmlAttrs,children:y.content},E)})},g))})})})},(e,t)=>e.result===t.result&&e.language===t.language&&e.className===t.className&&e.startLine===t.startLine&&e.lineNumbers===t.lineNumbers),U$=({className:e,language:t,style:n,isIncomplete:r,...s})=>{let l=It();return h.jsx("div",{className:l("my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2",e),"data-incomplete":r||void 0,"data-language":t,"data-streamdown":"code-block",style:{contentVisibility:"auto",containIntrinsicSize:"auto 200px",...n},...s})},Bk=T.createContext({code:""}),Uk=()=>T.useContext(Bk),H$=({language:e})=>{let t=It();return h.jsx("div",{className:t("flex h-8 items-center text-muted-foreground text-xs"),"data-language":e,"data-streamdown":"code-block-header",children:h.jsx("span",{className:t("ml-1 font-mono lowercase"),children:e})})},z$=e=>{let t=e.length;for(;t>0&&e[t-1]===`
|
|
353
|
+
`;)t--;return e.slice(0,t)},F$=T.lazy(()=>D(()=>import("./highlighted-body-OFNGDK62-D-RjOTTL.js"),[]).then(e=>({default:e.HighlightedCodeBlockBody}))),$$=({code:e,language:t,className:n,children:r,isIncomplete:s=!1,startLine:l,lineNumbers:o,...c})=>{let d=It(),m=T.useMemo(()=>z$(e),[e]),p=T.useMemo(()=>({bg:"transparent",fg:"inherit",tokens:m.split(`
|
|
354
|
+
`).map(g=>[{content:g,color:"inherit",bgColor:"transparent",htmlStyle:{},offset:0}])}),[m]);return h.jsx(Bk.Provider,{value:{code:e},children:h.jsxs(U$,{isIncomplete:s,language:t,children:[h.jsx(H$,{language:t}),r?h.jsx("div",{className:d("pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end"),children:h.jsx("div",{className:d("pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur"),"data-streamdown":"code-block-actions",children:r})}):null,h.jsx(T.Suspense,{fallback:h.jsx(B$,{className:n,language:t,lineNumbers:o,result:p,startLine:l,...c}),children:h.jsx(F$,{className:n,code:m,language:t,lineNumbers:o,raw:p,startLine:l,...c})})]})})},V$=e=>h.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:h.jsx("path",{clipRule:"evenodd",d:"M15.5607 3.99999L15.0303 4.53032L6.23744 13.3232C5.55403 14.0066 4.44599 14.0066 3.76257 13.3232L4.2929 12.7929L3.76257 13.3232L0.969676 10.5303L0.439346 9.99999L1.50001 8.93933L2.03034 9.46966L4.82323 12.2626C4.92086 12.3602 5.07915 12.3602 5.17678 12.2626L13.9697 3.46966L14.5 2.93933L15.5607 3.99999Z",fill:"currentColor",fillRule:"evenodd"})}),G$=e=>h.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:h.jsx("path",{clipRule:"evenodd",d:"M2.75 0.5C1.7835 0.5 1 1.2835 1 2.25V9.75C1 10.7165 1.7835 11.5 2.75 11.5H3.75H4.5V10H3.75H2.75C2.61193 10 2.5 9.88807 2.5 9.75V2.25C2.5 2.11193 2.61193 2 2.75 2H8.25C8.38807 2 8.5 2.11193 8.5 2.25V3H10V2.25C10 1.2835 9.2165 0.5 8.25 0.5H2.75ZM7.75 4.5C6.7835 4.5 6 5.2835 6 6.25V13.75C6 14.7165 6.7835 15.5 7.75 15.5H13.25C14.2165 15.5 15 14.7165 15 13.75V6.25C15 5.2835 14.2165 4.5 13.25 4.5H7.75ZM7.5 6.25C7.5 6.11193 7.61193 6 7.75 6H13.25C13.3881 6 13.5 6.11193 13.5 6.25V13.75C13.5 13.8881 13.3881 14 13.25 14H7.75C7.61193 14 7.5 13.8881 7.5 13.75V6.25Z",fill:"currentColor",fillRule:"evenodd"})}),q$=e=>h.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:h.jsx("path",{clipRule:"evenodd",d:"M8.75 1V1.75V8.68934L10.7197 6.71967L11.25 6.18934L12.3107 7.25L11.7803 7.78033L8.70711 10.8536C8.31658 11.2441 7.68342 11.2441 7.29289 10.8536L4.21967 7.78033L3.68934 7.25L4.75 6.18934L5.28033 6.71967L7.25 8.68934V1.75V1H8.75ZM13.5 9.25V13.5H2.5V9.25V8.5H1V9.25V14C1 14.5523 1.44771 15 2 15H14C14.5523 15 15 14.5523 15 14V9.25V8.5H13.5V9.25Z",fill:"currentColor",fillRule:"evenodd"})}),Y$=e=>h.jsxs("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:[h.jsx("path",{d:"M8 0V4",stroke:"currentColor",strokeWidth:"1.5"}),h.jsx("path",{d:"M8 16V12",opacity:"0.5",stroke:"currentColor",strokeWidth:"1.5"}),h.jsx("path",{d:"M3.29773 1.52783L5.64887 4.7639",opacity:"0.9",stroke:"currentColor",strokeWidth:"1.5"}),h.jsx("path",{d:"M12.7023 1.52783L10.3511 4.7639",opacity:"0.1",stroke:"currentColor",strokeWidth:"1.5"}),h.jsx("path",{d:"M12.7023 14.472L10.3511 11.236",opacity:"0.4",stroke:"currentColor",strokeWidth:"1.5"}),h.jsx("path",{d:"M3.29773 14.472L5.64887 11.236",opacity:"0.6",stroke:"currentColor",strokeWidth:"1.5"}),h.jsx("path",{d:"M15.6085 5.52783L11.8043 6.7639",opacity:"0.2",stroke:"currentColor",strokeWidth:"1.5"}),h.jsx("path",{d:"M0.391602 10.472L4.19583 9.23598",opacity:"0.7",stroke:"currentColor",strokeWidth:"1.5"}),h.jsx("path",{d:"M15.6085 10.4722L11.8043 9.2361",opacity:"0.3",stroke:"currentColor",strokeWidth:"1.5"}),h.jsx("path",{d:"M0.391602 5.52783L4.19583 6.7639",opacity:"0.8",stroke:"currentColor",strokeWidth:"1.5"})]}),W$=e=>h.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:h.jsx("path",{clipRule:"evenodd",d:"M1 5.25V6H2.5V5.25V2.5H5.25H6V1H5.25H2C1.44772 1 1 1.44772 1 2V5.25ZM5.25 14.9994H6V13.4994H5.25H2.5V10.7494V9.99939H1V10.7494V13.9994C1 14.5517 1.44772 14.9994 2 14.9994H5.25ZM15 10V10.75V14C15 14.5523 14.5523 15 14 15H10.75H10V13.5H10.75H13.5V10.75V10H15ZM10.75 1H10V2.5H10.75H13.5V5.25V6H15V5.25V2C15 1.44772 14.5523 1 14 1H10.75Z",fill:"currentColor",fillRule:"evenodd"})}),Q$=e=>h.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:h.jsx("path",{clipRule:"evenodd",d:"M13.5 8C13.5 4.96643 11.0257 2.5 7.96452 2.5C5.42843 2.5 3.29365 4.19393 2.63724 6.5H5.25H6V8H5.25H0.75C0.335787 8 0 7.66421 0 7.25V2.75V2H1.5V2.75V5.23347C2.57851 2.74164 5.06835 1 7.96452 1C11.8461 1 15 4.13001 15 8C15 11.87 11.8461 15 7.96452 15C5.62368 15 3.54872 13.8617 2.27046 12.1122L1.828 11.5066L3.03915 10.6217L3.48161 11.2273C4.48831 12.6051 6.12055 13.5 7.96452 13.5C11.0257 13.5 13.5 11.0336 13.5 8Z",fill:"currentColor",fillRule:"evenodd"})}),X$=e=>h.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:h.jsx("path",{clipRule:"evenodd",d:"M12.4697 13.5303L13 14.0607L14.0607 13L13.5303 12.4697L9.06065 7.99999L13.5303 3.53032L14.0607 2.99999L13 1.93933L12.4697 2.46966L7.99999 6.93933L3.53032 2.46966L2.99999 1.93933L1.93933 2.99999L2.46966 3.53032L6.93933 7.99999L2.46966 12.4697L1.93933 13L2.99999 14.0607L3.53032 13.5303L7.99999 9.06065L12.4697 13.5303Z",fill:"currentColor",fillRule:"evenodd"})}),K$=e=>h.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:h.jsx("path",{clipRule:"evenodd",d:"M13.5 10.25V13.25C13.5 13.3881 13.3881 13.5 13.25 13.5H2.75C2.61193 13.5 2.5 13.3881 2.5 13.25L2.5 2.75C2.5 2.61193 2.61193 2.5 2.75 2.5H5.75H6.5V1H5.75H2.75C1.7835 1 1 1.7835 1 2.75V13.25C1 14.2165 1.7835 15 2.75 15H13.25C14.2165 15 15 14.2165 15 13.25V10.25V9.5H13.5V10.25ZM9 1H9.75H14.2495C14.6637 1 14.9995 1.33579 14.9995 1.75V6.25V7H13.4995V6.25V3.56066L8.53033 8.52978L8 9.06011L6.93934 7.99945L7.46967 7.46912L12.4388 2.5H9.75H9V1Z",fill:"currentColor",fillRule:"evenodd"})}),Z$=e=>h.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:h.jsx("path",{clipRule:"evenodd",d:"M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H5.875V4.75V4.125H7.125V4.75V5.875H8.25H8.875V7.125H8.25H7.125V8.25V8.875H5.875V8.25V7.125H4.75H4.125V5.875Z",fill:"currentColor",fillRule:"evenodd"})}),J$=e=>h.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:h.jsx("path",{clipRule:"evenodd",d:"M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H8.25H8.875V7.125H8.25H4.75H4.125V5.875Z",fill:"currentColor",fillRule:"evenodd"})}),Hu={CheckIcon:V$,CopyIcon:G$,DownloadIcon:q$,ExternalLinkIcon:K$,Loader2Icon:Y$,Maximize2Icon:W$,RotateCcwIcon:Q$,XIcon:X$,ZoomInIcon:Z$,ZoomOutIcon:J$},Hk=T.createContext(Hu),eV=(e,t)=>{if(e===t)return!0;if(!(e&&t))return e===t;let n=Object.keys(e),r=Object.keys(t);return n.length!==r.length?!1:n.every(s=>e[s]===t[s])},eT=({icons:e,children:t})=>{let n=T.useRef(e),r=T.useRef(e?{...Hu,...e}:Hu);eV(n.current,e)||(n.current=e,r.current=e?{...Hu,...e}:Hu);let s=r.current;return h.jsx(Hk.Provider,{value:s,children:t})},Ca=()=>T.useContext(Hk),zk={copyCode:"Copy Code",downloadFile:"Download file",downloadDiagram:"Download diagram",downloadDiagramAsSvg:"Download diagram as SVG",downloadDiagramAsPng:"Download diagram as PNG",downloadDiagramAsMmd:"Download diagram as MMD",viewFullscreen:"View fullscreen",exitFullscreen:"Exit fullscreen",mermaidFormatSvg:"SVG",mermaidFormatPng:"PNG",mermaidFormatMmd:"MMD",copyTable:"Copy table",copyTableAsMarkdown:"Copy table as Markdown",copyTableAsCsv:"Copy table as CSV",copyTableAsTsv:"Copy table as TSV",downloadTable:"Download table",downloadTableAsCsv:"Download table as CSV",downloadTableAsMarkdown:"Download table as Markdown",tableFormatMarkdown:"Markdown",tableFormatCsv:"CSV",tableFormatTsv:"TSV",imageNotAvailable:"Image not available",downloadImage:"Download image",openExternalLink:"Open external link?",externalLinkWarning:"You're about to visit an external website.",close:"Close",copyLink:"Copy link",copied:"Copied",openLink:"Open link"},lg=T.createContext(zk),Ai=()=>T.useContext(lg),tT=({onCopy:e,onError:t,timeout:n=2e3,children:r,className:s,code:l,...o})=>{let c=It(),[d,m]=T.useState(!1),p=T.useRef(0),{code:g}=Uk(),{isAnimating:y}=T.useContext(Pr),E=Ai(),v=l??g,k=async()=>{var A;if(typeof window>"u"||!((A=navigator==null?void 0:navigator.clipboard)!=null&&A.writeText)){t==null||t(new Error("Clipboard API not available"));return}try{d||(await navigator.clipboard.writeText(v),m(!0),e==null||e(),p.current=window.setTimeout(()=>m(!1),n))}catch(N){t==null||t(N)}};T.useEffect(()=>()=>{window.clearTimeout(p.current)},[]);let C=Ca(),S=d?C.CheckIcon:C.CopyIcon;return h.jsx("button",{className:c("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",s),"data-streamdown":"code-block-copy-button",disabled:y,onClick:k,title:E.copyCode,type:"button",...o,children:r??h.jsx(S,{size:14})})},nT={"1c":"1c","1c-query":"1cq",abap:"abap","actionscript-3":"as",ada:"ada",adoc:"adoc","angular-html":"html","angular-ts":"ts",apache:"conf",apex:"cls",apl:"apl",applescript:"applescript",ara:"ara",asciidoc:"adoc",asm:"asm",astro:"astro",awk:"awk",ballerina:"bal",bash:"sh",bat:"bat",batch:"bat",be:"be",beancount:"beancount",berry:"berry",bibtex:"bib",bicep:"bicep",blade:"blade.php",bsl:"bsl",c:"c","c#":"cs","c++":"cpp",cadence:"cdc",cairo:"cairo",cdc:"cdc",clarity:"clar",clj:"clj",clojure:"clj","closure-templates":"soy",cmake:"cmake",cmd:"cmd",cobol:"cob",codeowners:"CODEOWNERS",codeql:"ql",coffee:"coffee",coffeescript:"coffee","common-lisp":"lisp",console:"sh",coq:"v",cpp:"cpp",cql:"cql",crystal:"cr",cs:"cs",csharp:"cs",css:"css",csv:"csv",cue:"cue",cypher:"cql",d:"d",dart:"dart",dax:"dax",desktop:"desktop",diff:"diff",docker:"dockerfile",dockerfile:"dockerfile",dotenv:"env","dream-maker":"dm",edge:"edge",elisp:"el",elixir:"ex",elm:"elm","emacs-lisp":"el",erb:"erb",erl:"erl",erlang:"erl",f:"f","f#":"fs",f03:"f03",f08:"f08",f18:"f18",f77:"f77",f90:"f90",f95:"f95",fennel:"fnl",fish:"fish",fluent:"ftl",for:"for","fortran-fixed-form":"f","fortran-free-form":"f90",fs:"fs",fsharp:"fs",fsl:"fsl",ftl:"ftl",gdresource:"tres",gdscript:"gd",gdshader:"gdshader",genie:"gs",gherkin:"feature","git-commit":"gitcommit","git-rebase":"gitrebase",gjs:"js",gleam:"gleam","glimmer-js":"js","glimmer-ts":"ts",glsl:"glsl",gnuplot:"plt",go:"go",gql:"gql",graphql:"graphql",groovy:"groovy",gts:"gts",hack:"hack",haml:"haml",handlebars:"hbs",haskell:"hs",haxe:"hx",hbs:"hbs",hcl:"hcl",hjson:"hjson",hlsl:"hlsl",hs:"hs",html:"html","html-derivative":"html",http:"http",hxml:"hxml",hy:"hy",imba:"imba",ini:"ini",jade:"jade",java:"java",javascript:"js",jinja:"jinja",jison:"jison",jl:"jl",js:"js",json:"json",json5:"json5",jsonc:"jsonc",jsonl:"jsonl",jsonnet:"jsonnet",jssm:"jssm",jsx:"jsx",julia:"jl",kotlin:"kt",kql:"kql",kt:"kt",kts:"kts",kusto:"kql",latex:"tex",lean:"lean",lean4:"lean",less:"less",liquid:"liquid",lisp:"lisp",lit:"lit",llvm:"ll",log:"log",logo:"logo",lua:"lua",luau:"luau",make:"mak",makefile:"mak",markdown:"md",marko:"marko",matlab:"m",md:"md",mdc:"mdc",mdx:"mdx",mediawiki:"wiki",mermaid:"mmd",mips:"s",mipsasm:"s",mmd:"mmd",mojo:"mojo",move:"move",nar:"nar",narrat:"narrat",nextflow:"nf",nf:"nf",nginx:"conf",nim:"nim",nix:"nix",nu:"nu",nushell:"nu",objc:"m","objective-c":"m","objective-cpp":"mm",ocaml:"ml",pascal:"pas",perl:"pl",perl6:"p6",php:"php",plsql:"pls",po:"po",polar:"polar",postcss:"pcss",pot:"pot",potx:"potx",powerquery:"pq",powershell:"ps1",prisma:"prisma",prolog:"pl",properties:"properties",proto:"proto",protobuf:"proto",ps:"ps",ps1:"ps1",pug:"pug",puppet:"pp",purescript:"purs",py:"py",python:"py",ql:"ql",qml:"qml",qmldir:"qmldir",qss:"qss",r:"r",racket:"rkt",raku:"raku",razor:"cshtml",rb:"rb",reg:"reg",regex:"regex",regexp:"regexp",rel:"rel",riscv:"s",rs:"rs",rst:"rst",ruby:"rb",rust:"rs",sas:"sas",sass:"sass",scala:"scala",scheme:"scm",scss:"scss",sdbl:"sdbl",sh:"sh",shader:"shader",shaderlab:"shader",shell:"sh",shellscript:"sh",shellsession:"sh",smalltalk:"st",solidity:"sol",soy:"soy",sparql:"rq",spl:"spl",splunk:"spl",sql:"sql","ssh-config":"config",stata:"do",styl:"styl",stylus:"styl",svelte:"svelte",swift:"swift","system-verilog":"sv",systemd:"service",talon:"talon",talonscript:"talon",tasl:"tasl",tcl:"tcl",templ:"templ",terraform:"tf",tex:"tex",tf:"tf",tfvars:"tfvars",toml:"toml",ts:"ts","ts-tags":"ts",tsp:"tsp",tsv:"tsv",tsx:"tsx",turtle:"ttl",twig:"twig",typ:"typ",typescript:"ts",typespec:"tsp",typst:"typ",v:"v",vala:"vala",vb:"vb",verilog:"v",vhdl:"vhdl",vim:"vim",viml:"vim",vimscript:"vim",vue:"vue","vue-html":"html","vue-vine":"vine",vy:"vy",vyper:"vy",wasm:"wasm",wenyan:"wy",wgsl:"wgsl",wiki:"wiki",wikitext:"wiki",wit:"wit",wl:"wl",wolfram:"wl",xml:"xml",xsl:"xsl",yaml:"yaml",yml:"yml",zenscript:"zs",zig:"zig",zsh:"zsh",文言:"wy"},tV=({onDownload:e,onError:t,language:n,children:r,className:s,code:l,...o})=>{let c=It(),{code:d}=Uk(),{isAnimating:m}=T.useContext(Pr),p=Ai(),g=Ca(),y=l??d,E=`file.${n&&n in nT?nT[n]:"txt"}`,v="text/plain",k=()=>{try{go(E,y,v),e==null||e()}catch(C){t==null||t(C)}};return h.jsx("button",{className:c("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",s),"data-streamdown":"code-block-download-button",disabled:m,onClick:k,title:p.downloadFile,type:"button",...o,children:r??h.jsx(g.DownloadIcon,{size:14})})},rT=()=>{let{Loader2Icon:e}=Ca(),t=It();return h.jsxs("div",{className:t("w-full divide-y divide-border overflow-hidden rounded-xl border border-border"),children:[h.jsx("div",{className:t("h-[46px] w-full bg-muted/80")}),h.jsx("div",{className:t("flex w-full items-center justify-center p-4"),children:h.jsx(e,{className:t("size-4 animate-spin")})})]})},nV=/\.[^/.]+$/,rV=({node:e,className:t,src:n,alt:r,onLoad:s,onError:l,...o})=>{let{DownloadIcon:c}=Ca(),d=It(),m=T.useRef(null),[p,g]=T.useState(!1),[y,E]=T.useState(!1),v=Ai(),k=o.width!=null||o.height!=null,C=(p||k)&&!y,S=y&&!k;T.useEffect(()=>{let G=m.current;if(G!=null&&G.complete){let P=G.naturalWidth>0;g(P),E(!P)}},[]);let A=T.useCallback(G=>{g(!0),E(!1),s==null||s(G)},[s]),N=T.useCallback(G=>{g(!1),E(!0),l==null||l(G)},[l]),U=async()=>{if(n)try{let G=await(await fetch(n)).blob(),P=new URL(n,window.location.origin).pathname.split("/").pop()||"",H=P.split(".").pop(),Y=P.includes(".")&&H!==void 0&&H.length<=4,ue="";if(Y)ue=P;else{let M=G.type,K="png";M.includes("jpeg")||M.includes("jpg")?K="jpg":M.includes("png")?K="png":M.includes("svg")?K="svg":M.includes("gif")?K="gif":M.includes("webp")&&(K="webp"),ue=`${(r||P||"image").replace(nV,"")}.${K}`}go(ue,G,G.type)}catch{window.open(n,"_blank")}};return n?h.jsxs("div",{className:d("group relative my-4 inline-block"),"data-streamdown":"image-wrapper",children:[h.jsx("img",{alt:r,className:d("max-w-full rounded-lg",S&&"hidden",t),"data-streamdown":"image",onError:N,onLoad:A,ref:m,src:n,...o}),S&&h.jsx("span",{className:d("text-muted-foreground text-xs italic"),"data-streamdown":"image-fallback",children:v.imageNotAvailable}),h.jsx("div",{className:d("pointer-events-none absolute inset-0 hidden rounded-lg bg-black/10 group-hover:block")}),C&&h.jsx("button",{className:d("absolute right-2 bottom-2 flex h-8 w-8 cursor-pointer items-center justify-center rounded-md border border-border bg-background/90 shadow-sm backdrop-blur-sm transition-all duration-200 hover:bg-background","opacity-0 group-hover:opacity-100"),onClick:U,title:v.downloadImage,type:"button",children:h.jsx(c,{size:14})})]}):null},Zu=0,S1=()=>{Zu+=1,Zu===1&&(document.body.style.overflow="hidden")},A1=()=>{Zu=Math.max(0,Zu-1),Zu===0&&(document.body.style.overflow="")},aV=({url:e,isOpen:t,onClose:n,onConfirm:r})=>{let{CheckIcon:s,CopyIcon:l,ExternalLinkIcon:o,XIcon:c}=Ca(),d=It(),[m,p]=T.useState(!1),g=Ai(),y=T.useCallback(async()=>{try{await navigator.clipboard.writeText(e),p(!0),setTimeout(()=>p(!1),2e3)}catch{}},[e]),E=T.useCallback(()=>{r(),n()},[r,n]);return T.useEffect(()=>{if(t){S1();let v=k=>{k.key==="Escape"&&n()};return document.addEventListener("keydown",v),()=>{document.removeEventListener("keydown",v),A1()}}},[t,n]),t?h.jsx("div",{className:d("fixed inset-0 z-50 flex items-center justify-center bg-background/50 backdrop-blur-sm"),"data-streamdown":"link-safety-modal",onClick:n,onKeyDown:v=>{v.key==="Escape"&&n()},role:"button",tabIndex:0,children:h.jsxs("div",{className:d("relative mx-4 flex w-full max-w-md flex-col gap-4 rounded-xl border bg-background p-6 shadow-lg"),onClick:v=>v.stopPropagation(),onKeyDown:v=>v.stopPropagation(),role:"presentation",children:[h.jsx("button",{className:d("absolute top-4 right-4 rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground"),onClick:n,title:g.close,type:"button",children:h.jsx(c,{size:16})}),h.jsxs("div",{className:d("flex flex-col gap-2"),children:[h.jsxs("div",{className:d("flex items-center gap-2 font-semibold text-lg"),children:[h.jsx(o,{size:20}),h.jsx("span",{children:g.openExternalLink})]}),h.jsx("p",{className:d("text-muted-foreground text-sm"),children:g.externalLinkWarning})]}),h.jsx("div",{className:d("break-all rounded-md bg-muted p-3 font-mono text-sm",e.length>100&&"max-h-32 overflow-y-auto"),children:e}),h.jsxs("div",{className:d("flex gap-2"),children:[h.jsx("button",{className:d("flex flex-1 items-center justify-center gap-2 rounded-md border bg-background px-4 py-2 font-medium text-sm transition-all hover:bg-muted"),onClick:y,type:"button",children:m?h.jsxs(h.Fragment,{children:[h.jsx(s,{size:14}),h.jsx("span",{children:g.copied})]}):h.jsxs(h.Fragment,{children:[h.jsx(l,{size:14}),h.jsx("span",{children:g.copyLink})]})}),h.jsxs("button",{className:d("flex flex-1 items-center justify-center gap-2 rounded-md bg-primary px-4 py-2 font-medium text-primary-foreground text-sm transition-all hover:bg-primary/90"),onClick:E,type:"button",children:[h.jsx(o,{size:14}),h.jsx("span",{children:g.openLink})]})]})]})}):null},og=T.createContext(null),N1=()=>T.useContext(og),Wq=()=>{var e;let t=N1();return(e=t==null?void 0:t.code)!=null?e:null},R1=()=>{var e;let t=N1();return(e=t==null?void 0:t.mermaid)!=null?e:null},iV=e=>{var t;let n=N1();return n!=null&&n.renderers&&e&&(t=n.renderers.find(r=>Array.isArray(r.language)?r.language.includes(e):r.language===e))!=null?t:null},sV=(e,t)=>{var n;let r=(n=void 0)!=null?n:5;return new Promise((s,l)=>{let o="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(e))),c=new Image;c.crossOrigin="anonymous",c.onload=()=>{let d=document.createElement("canvas"),m=c.width*r,p=c.height*r;d.width=m,d.height=p;let g=d.getContext("2d");if(!g){l(new Error("Failed to create 2D canvas context for PNG export"));return}g.drawImage(c,0,0,m,p),d.toBlob(y=>{if(!y){l(new Error("Failed to create PNG blob"));return}s(y)},"image/png")},c.onerror=()=>l(new Error("Failed to load SVG image")),c.src=o})},lV=({chart:e,children:t,className:n,onDownload:r,config:s,onError:l})=>{let o=It(),[c,d]=T.useState(!1),m=T.useRef(null),{isAnimating:p}=T.useContext(Pr),g=Ca(),y=R1(),E=Ai(),v=async k=>{try{if(k==="mmd"){go("diagram.mmd",e,"text/plain"),d(!1),r==null||r(k);return}if(!y){l==null||l(new Error("Mermaid plugin not available"));return}let C=y.getMermaid(s),S=e.split("").reduce((U,G)=>(U<<5)-U+G.charCodeAt(0)|0,0),A=`mermaid-${Math.abs(S)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:N}=await C.render(A,e);if(!N){l==null||l(new Error("SVG not found. Please wait for the diagram to render."));return}if(k==="svg"){go("diagram.svg",N,"image/svg+xml"),d(!1),r==null||r(k);return}if(k==="png"){let U=await sV(N);go("diagram.png",U,"image/png"),r==null||r(k),d(!1);return}}catch(C){l==null||l(C)}};return T.useEffect(()=>{let k=C=>{let S=C.composedPath();m.current&&!S.includes(m.current)&&d(!1)};return document.addEventListener("mousedown",k),()=>{document.removeEventListener("mousedown",k)}},[]),h.jsxs("div",{className:o("relative"),ref:m,children:[h.jsx("button",{className:o("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",n),disabled:p,onClick:()=>d(!c),title:E.downloadDiagram,type:"button",children:t??h.jsx(g.DownloadIcon,{size:14})}),c?h.jsxs("div",{className:o("absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg"),children:[h.jsx("button",{className:o("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>v("svg"),title:E.downloadDiagramAsSvg,type:"button",children:E.mermaidFormatSvg}),h.jsx("button",{className:o("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>v("png"),title:E.downloadDiagramAsPng,type:"button",children:E.mermaidFormatPng}),h.jsx("button",{className:o("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>v("mmd"),title:E.downloadDiagramAsMmd,type:"button",children:E.mermaidFormatMmd})]}):null]})},oV=({chart:e,config:t,onFullscreen:n,onExit:r,className:s,...l})=>{let{Maximize2Icon:o,XIcon:c}=Ca(),d=It(),[m,p]=T.useState(!1),{isAnimating:g,controls:y}=T.useContext(Pr),E=Ai(),v=(()=>{if(typeof y=="boolean")return y;let C=y.mermaid;return C===!1?!1:C===!0||C===void 0?!0:C.panZoom!==!1})(),k=()=>{p(!m)};return T.useEffect(()=>{if(m){S1();let C=S=>{S.key==="Escape"&&p(!1)};return document.addEventListener("keydown",C),()=>{document.removeEventListener("keydown",C),A1()}}},[m]),T.useEffect(()=>{m?n==null||n():r&&r()},[m,n,r]),h.jsxs(h.Fragment,{children:[h.jsx("button",{className:d("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",s),disabled:g,onClick:k,title:E.viewFullscreen,type:"button",...l,children:h.jsx(o,{size:14})}),m?ko.createPortal(h.jsxs("div",{className:d("fixed inset-0 z-50 flex items-center justify-center bg-background/95 backdrop-blur-sm"),onClick:k,onKeyDown:C=>{C.key==="Escape"&&k()},role:"button",tabIndex:0,children:[h.jsx("button",{className:d("absolute top-4 right-4 z-10 rounded-md p-2 text-muted-foreground transition-all hover:bg-muted hover:text-foreground"),onClick:k,title:E.exitFullscreen,type:"button",children:h.jsx(c,{size:20})}),h.jsx("div",{className:d("flex size-full items-center justify-center p-4"),onClick:C=>C.stopPropagation(),onKeyDown:C=>C.stopPropagation(),role:"presentation",children:h.jsx(vC,{chart:e,className:d("size-full [&_svg]:h-auto [&_svg]:w-auto"),config:t,fullscreen:!0,showControls:v})})]}),document.body):null]})},Fk=e=>{var t,n;let r=[],s=[],l=e.querySelectorAll("thead th");for(let c of l)r.push(((t=c.textContent)==null?void 0:t.trim())||"");let o=e.querySelectorAll("tbody tr");for(let c of o){let d=[],m=c.querySelectorAll("td");for(let p of m)d.push(((n=p.textContent)==null?void 0:n.trim())||"");s.push(d)}return{headers:r,rows:s}},$k=e=>{let{headers:t,rows:n}=e,r=c=>{let d=!1,m=!1;for(let p of c){if(p==='"'){d=!0,m=!0;break}(p===","||p===`
|
|
355
|
+
`)&&(d=!0)}return d?m?`"${c.replace(/"/g,'""')}"`:`"${c}"`:c},s=t.length>0?n.length+1:n.length,l=new Array(s),o=0;t.length>0&&(l[o]=t.map(r).join(","),o+=1);for(let c of n)l[o]=c.map(r).join(","),o+=1;return l.join(`
|
|
356
|
+
`)},uV=e=>{let{headers:t,rows:n}=e,r=c=>{let d=!1;for(let p of c)if(p===" "||p===`
|
|
357
|
+
`||p==="\r"){d=!0;break}if(!d)return c;let m=[];for(let p of c)p===" "?m.push("\\t"):p===`
|
|
358
|
+
`?m.push("\\n"):p==="\r"?m.push("\\r"):m.push(p);return m.join("")},s=t.length>0?n.length+1:n.length,l=new Array(s),o=0;t.length>0&&(l[o]=t.map(r).join(" "),o+=1);for(let c of n)l[o]=c.map(r).join(" "),o+=1;return l.join(`
|
|
359
|
+
`)},d0=e=>{let t=!1;for(let r of e)if(r==="\\"||r==="|"){t=!0;break}if(!t)return e;let n=[];for(let r of e)r==="\\"?n.push("\\\\"):r==="|"?n.push("\\|"):n.push(r);return n.join("")},ug=e=>{let{headers:t,rows:n}=e;if(t.length===0)return"";let r=new Array(n.length+2),s=0,l=t.map(c=>d0(c));r[s]=`| ${l.join(" | ")} |`,s+=1;let o=new Array(t.length);for(let c=0;c<t.length;c+=1)o[c]="---";r[s]=`| ${o.join(" | ")} |`,s+=1;for(let c of n)if(c.length<t.length){let d=new Array(t.length);for(let m=0;m<t.length;m+=1)d[m]=m<c.length?d0(c[m]):"";r[s]=`| ${d.join(" | ")} |`,s+=1}else{let d=c.map(m=>d0(m));r[s]=`| ${d.join(" | ")} |`,s+=1}return r.join(`
|
|
360
|
+
`)},Vk=({children:e,className:t,onCopy:n,onError:r,timeout:s=2e3})=>{let l=It(),[o,c]=T.useState(!1),[d,m]=T.useState(!1),p=T.useRef(null),g=T.useRef(0),{isAnimating:y}=T.useContext(Pr),E=Ai(),v=async S=>{var A,N;if(typeof window>"u"||!((A=navigator==null?void 0:navigator.clipboard)!=null&&A.write)){r==null||r(new Error("Clipboard API not available"));return}try{let U=(N=p.current)==null?void 0:N.closest('[data-streamdown="table-wrapper"]'),G=U==null?void 0:U.querySelector("table");if(!G){r==null||r(new Error("Table not found"));return}let P=Fk(G),H=({csv:$k,tsv:uV,md:ug}[S]||ug)(P),Y=new ClipboardItem({"text/plain":new Blob([H],{type:"text/plain"}),"text/html":new Blob([G.outerHTML],{type:"text/html"})});await navigator.clipboard.write([Y]),m(!0),c(!1),n==null||n(S),g.current=window.setTimeout(()=>m(!1),s)}catch(U){r==null||r(U)}};T.useEffect(()=>{let S=A=>{let N=A.composedPath();p.current&&!N.includes(p.current)&&c(!1)};return document.addEventListener("mousedown",S),()=>{document.removeEventListener("mousedown",S),window.clearTimeout(g.current)}},[]);let k=Ca(),C=d?k.CheckIcon:k.CopyIcon;return h.jsxs("div",{className:l("relative"),ref:p,children:[h.jsx("button",{className:l("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:y,onClick:()=>c(!o),title:E.copyTable,type:"button",children:e??h.jsx(C,{height:14,width:14})}),o?h.jsxs("div",{className:l("absolute top-full right-0 z-20 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg"),children:[h.jsx("button",{className:l("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>v("md"),title:E.copyTableAsMarkdown,type:"button",children:E.tableFormatMarkdown}),h.jsx("button",{className:l("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>v("csv"),title:E.copyTableAsCsv,type:"button",children:E.tableFormatCsv}),h.jsx("button",{className:l("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>v("tsv"),title:E.copyTableAsTsv,type:"button",children:E.tableFormatTsv})]}):null]})},Gk=({children:e,className:t,onDownload:n,onError:r})=>{let s=It(),[l,o]=T.useState(!1),c=T.useRef(null),{isAnimating:d}=T.useContext(Pr),m=Ai(),p=Ca(),g=y=>{var E;try{let v=(E=c.current)==null?void 0:E.closest('[data-streamdown="table-wrapper"]'),k=v==null?void 0:v.querySelector("table");if(!k){r==null||r(new Error("Table not found"));return}let C=Fk(k),S=y==="csv"?$k(C):ug(C);go(`table.${y==="csv"?"csv":"md"}`,S,y==="csv"?"text/csv":"text/markdown"),o(!1),n==null||n(y)}catch(v){r==null||r(v)}};return T.useEffect(()=>{let y=E=>{let v=E.composedPath();c.current&&!v.includes(c.current)&&o(!1)};return document.addEventListener("mousedown",y),()=>{document.removeEventListener("mousedown",y)}},[]),h.jsxs("div",{className:s("relative"),ref:c,children:[h.jsx("button",{className:s("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:d,onClick:()=>o(!l),title:m.downloadTable,type:"button",children:e??h.jsx(p.DownloadIcon,{size:14})}),l?h.jsxs("div",{className:s("absolute top-full right-0 z-20 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg"),children:[h.jsx("button",{className:s("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>g("csv"),title:m.downloadTableAsCsv,type:"button",children:m.tableFormatCsv}),h.jsx("button",{className:s("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>g("markdown"),title:m.downloadTableAsMarkdown,type:"button",children:m.tableFormatMarkdown})]}):null]})},cV=({children:e,className:t,showCopy:n=!0,showDownload:r=!0})=>{let{Maximize2Icon:s,XIcon:l}=Ca(),o=It(),[c,d]=T.useState(!1),{isAnimating:m}=T.useContext(Pr),p=Ai(),g=()=>{d(!0)},y=()=>{d(!1)};return T.useEffect(()=>{if(c){S1();let E=v=>{v.key==="Escape"&&d(!1)};return document.addEventListener("keydown",E),()=>{document.removeEventListener("keydown",E),A1()}}},[c]),h.jsxs(h.Fragment,{children:[h.jsx("button",{className:o("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:m,onClick:g,title:p.viewFullscreen,type:"button",children:h.jsx(s,{size:14})}),c?ko.createPortal(h.jsx("div",{"aria-label":p.viewFullscreen,"aria-modal":"true",className:o("fixed inset-0 z-50 flex flex-col bg-background"),"data-streamdown":"table-fullscreen",onClick:y,onKeyDown:E=>{E.key==="Escape"&&y()},role:"dialog",children:h.jsxs("div",{className:o("flex h-full flex-col"),onClick:E=>E.stopPropagation(),onKeyDown:E=>E.stopPropagation(),role:"presentation",children:[h.jsxs("div",{className:o("flex items-center justify-end gap-1 p-4"),children:[n?h.jsx(Vk,{}):null,r?h.jsx(Gk,{}):null,h.jsx("button",{className:o("rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground"),onClick:y,title:p.exitFullscreen,type:"button",children:h.jsx(l,{size:20})})]}),h.jsx("div",{className:o("flex-1 overflow-auto p-4 pt-0 [&_thead]:sticky [&_thead]:top-0 [&_thead]:z-10"),children:h.jsx("table",{className:o("w-full border-collapse border border-border"),"data-streamdown":"table",children:e})})]})}),document.body):null]})},dV=({children:e,className:t,showControls:n,showCopy:r=!0,showDownload:s=!0,showFullscreen:l=!0,...o})=>{let c=It(),d=n&&r,m=n&&s,p=n&&l,g=d||m||p;return h.jsxs("div",{className:c("my-4 flex flex-col gap-2 rounded-lg border border-border bg-sidebar p-2"),"data-streamdown":"table-wrapper",children:[g?h.jsxs("div",{className:c("flex items-center justify-end gap-1"),children:[d?h.jsx(Vk,{}):null,m?h.jsx(Gk,{}):null,p?h.jsx(cV,{showCopy:d,showDownload:m,children:e}):null]}):null,h.jsx("div",{className:c("border-collapse overflow-x-auto overflow-y-auto rounded-md border border-border bg-background"),children:h.jsx("table",{className:c("w-full divide-y divide-border",t),"data-streamdown":"table",...o,children:e})})]})},fV=/startLine=(\d+)/,hV=/\bnoLineNumbers\b/,mV=T.lazy(()=>D(()=>Promise.resolve().then(()=>zq),void 0).then(e=>({default:e.Mermaid}))),pV=/language-([^\s]+)/;function ch(e,t){if(!(e!=null&&e.position||t!=null&&t.position))return!0;if(!(e!=null&&e.position&&t!=null&&t.position))return!1;let n=e.position.start,r=t.position.start,s=e.position.end,l=t.position.end;return(n==null?void 0:n.line)===(r==null?void 0:r.line)&&(n==null?void 0:n.column)===(r==null?void 0:r.column)&&(s==null?void 0:s.line)===(l==null?void 0:l.line)&&(s==null?void 0:s.column)===(l==null?void 0:l.column)}function _n(e,t){return e.className===t.className&&ch(e.node,t.node)}var cg=(e,t)=>typeof e=="boolean"?e:e[t]!==!1,f0=(e,t)=>{if(typeof e=="boolean")return e;let n=e.table;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},aT=(e,t)=>{if(typeof e=="boolean")return e;let n=e.code;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},Gd=(e,t)=>{if(typeof e=="boolean")return e;let n=e.mermaid;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},L1=T.memo(({children:e,className:t,node:n,...r})=>{let s=It();return h.jsx("ol",{className:s("list-inside list-decimal whitespace-normal [li_&]:pl-6",t),"data-streamdown":"ordered-list",...r,children:e})},(e,t)=>_n(e,t));L1.displayName="MarkdownOl";var qk=T.memo(({children:e,className:t,node:n,...r})=>{let s=It();return h.jsx("li",{className:s("py-1 [&>p]:inline",t),"data-streamdown":"list-item",...r,children:e})},(e,t)=>e.className===t.className&&ch(e.node,t.node));qk.displayName="MarkdownLi";var Yk=T.memo(({children:e,className:t,node:n,...r})=>{let s=It();return h.jsx("ul",{className:s("list-inside list-disc whitespace-normal [li_&]:pl-6",t),"data-streamdown":"unordered-list",...r,children:e})},(e,t)=>_n(e,t));Yk.displayName="MarkdownUl";var Wk=T.memo(({className:e,node:t,...n})=>{let r=It();return h.jsx("hr",{className:r("my-6 border-border",e),"data-streamdown":"horizontal-rule",...n})},(e,t)=>_n(e,t));Wk.displayName="MarkdownHr";var Qk=T.memo(({children:e,className:t,node:n,...r})=>{let s=It();return h.jsx("span",{className:s("font-semibold",t),"data-streamdown":"strong",...r,children:e})},(e,t)=>_n(e,t));Qk.displayName="MarkdownStrong";var gV=({children:e,className:t,href:n,node:r,...s})=>{let l=It(),{linkSafety:o}=T.useContext(Pr),[c,d]=T.useState(!1),m=n==="streamdown:incomplete-link",p=T.useCallback(async v=>{if(!(!(o!=null&&o.enabled&&n)||m)){if(v.preventDefault(),o.onLinkCheck&&await o.onLinkCheck(n)){window.open(n,"_blank","noreferrer");return}d(!0)}},[o,n,m]),g=T.useCallback(()=>{n&&window.open(n,"_blank","noreferrer")},[n]),y=T.useCallback(()=>{d(!1)},[]),E={url:n??"",isOpen:c,onClose:y,onConfirm:g};return o!=null&&o.enabled&&n?h.jsxs(h.Fragment,{children:[h.jsx("button",{className:l("wrap-anywhere appearance-none text-left font-medium text-primary underline",t),"data-incomplete":m,"data-streamdown":"link",onClick:p,type:"button",children:e}),o.renderModal?o.renderModal(E):h.jsx(aV,{...E})]}):h.jsx("a",{className:l("wrap-anywhere font-medium text-primary underline",t),"data-incomplete":m,"data-streamdown":"link",href:n,rel:"noreferrer",target:"_blank",...s,children:e})},Xk=T.memo(gV,(e,t)=>_n(e,t)&&e.href===t.href);Xk.displayName="MarkdownA";var Kk=T.memo(({children:e,className:t,node:n,...r})=>{let s=It();return h.jsx("h1",{className:s("mt-6 mb-2 font-semibold text-3xl",t),"data-streamdown":"heading-1",...r,children:e})},(e,t)=>_n(e,t));Kk.displayName="MarkdownH1";var Zk=T.memo(({children:e,className:t,node:n,...r})=>{let s=It();return h.jsx("h2",{className:s("mt-6 mb-2 font-semibold text-2xl",t),"data-streamdown":"heading-2",...r,children:e})},(e,t)=>_n(e,t));Zk.displayName="MarkdownH2";var Jk=T.memo(({children:e,className:t,node:n,...r})=>{let s=It();return h.jsx("h3",{className:s("mt-6 mb-2 font-semibold text-xl",t),"data-streamdown":"heading-3",...r,children:e})},(e,t)=>_n(e,t));Jk.displayName="MarkdownH3";var eC=T.memo(({children:e,className:t,node:n,...r})=>{let s=It();return h.jsx("h4",{className:s("mt-6 mb-2 font-semibold text-lg",t),"data-streamdown":"heading-4",...r,children:e})},(e,t)=>_n(e,t));eC.displayName="MarkdownH4";var tC=T.memo(({children:e,className:t,node:n,...r})=>{let s=It();return h.jsx("h5",{className:s("mt-6 mb-2 font-semibold text-base",t),"data-streamdown":"heading-5",...r,children:e})},(e,t)=>_n(e,t));tC.displayName="MarkdownH5";var nC=T.memo(({children:e,className:t,node:n,...r})=>{let s=It();return h.jsx("h6",{className:s("mt-6 mb-2 font-semibold text-sm",t),"data-streamdown":"heading-6",...r,children:e})},(e,t)=>_n(e,t));nC.displayName="MarkdownH6";var rC=T.memo(({children:e,className:t,node:n,...r})=>{let{controls:s}=T.useContext(Pr),l=cg(s,"table"),o=f0(s,"copy"),c=f0(s,"download"),d=f0(s,"fullscreen");return h.jsx(dV,{className:t,showControls:l,showCopy:o,showDownload:c,showFullscreen:d,...r,children:e})},(e,t)=>_n(e,t));rC.displayName="MarkdownTable";var aC=T.memo(({children:e,className:t,node:n,...r})=>{let s=It();return h.jsx("thead",{className:s("bg-muted/80",t),"data-streamdown":"table-header",...r,children:e})},(e,t)=>_n(e,t));aC.displayName="MarkdownThead";var iC=T.memo(({children:e,className:t,node:n,...r})=>{let s=It();return h.jsx("tbody",{className:s("divide-y divide-border",t),"data-streamdown":"table-body",...r,children:e})},(e,t)=>_n(e,t));iC.displayName="MarkdownTbody";var sC=T.memo(({children:e,className:t,node:n,...r})=>{let s=It();return h.jsx("tr",{className:s("border-border",t),"data-streamdown":"table-row",...r,children:e})},(e,t)=>_n(e,t));sC.displayName="MarkdownTr";var lC=T.memo(({children:e,className:t,node:n,...r})=>{let s=It();return h.jsx("th",{className:s("whitespace-nowrap px-4 py-2 text-left font-semibold text-sm",t),"data-streamdown":"table-header-cell",...r,children:e})},(e,t)=>_n(e,t));lC.displayName="MarkdownTh";var oC=T.memo(({children:e,className:t,node:n,...r})=>{let s=It();return h.jsx("td",{className:s("px-4 py-2 text-sm",t),"data-streamdown":"table-cell",...r,children:e})},(e,t)=>_n(e,t));oC.displayName="MarkdownTd";var uC=T.memo(({children:e,className:t,node:n,...r})=>{let s=It();return h.jsx("blockquote",{className:s("my-4 border-muted-foreground/30 border-l-4 pl-4 text-muted-foreground italic",t),"data-streamdown":"blockquote",...r,children:e})},(e,t)=>_n(e,t));uC.displayName="MarkdownBlockquote";var cC=T.memo(({children:e,className:t,node:n,...r})=>{let s=It();return h.jsx("sup",{className:s("text-sm",t),"data-streamdown":"superscript",...r,children:e})},(e,t)=>_n(e,t));cC.displayName="MarkdownSup";var dC=T.memo(({children:e,className:t,node:n,...r})=>{let s=It();return h.jsx("sub",{className:s("text-sm",t),"data-streamdown":"subscript",...r,children:e})},(e,t)=>_n(e,t));dC.displayName="MarkdownSub";var fC=T.memo(({children:e,className:t,node:n,...r})=>{if("data-footnotes"in r){let s=o=>{var c,d;if(!T.isValidElement(o))return!1;let m=Array.isArray(o.props.children)?o.props.children:[o.props.children],p=!1,g=!1;for(let y of m)if(y){if(typeof y=="string")y.trim()!==""&&(p=!0);else if(T.isValidElement(y))if(((c=y.props)==null?void 0:c["data-footnote-backref"])!==void 0)g=!0;else{let E=Array.isArray(y.props.children)?y.props.children:[y.props.children];for(let v of E){if(typeof v=="string"&&v.trim()!==""){p=!0;break}if(T.isValidElement(v)&&((d=v.props)==null?void 0:d["data-footnote-backref"])===void 0){p=!0;break}}}}return g&&!p},l=Array.isArray(e)?e.map(o=>{if(!T.isValidElement(o))return o;if(o.type===L1){let c=(Array.isArray(o.props.children)?o.props.children:[o.props.children]).filter(d=>!s(d));return c.length===0?null:{...o,props:{...o.props,children:c}}}return o}):e;return(Array.isArray(l)?l.some(o=>o!==null):l!==null)?h.jsx("section",{className:t,...r,children:l}):null}return h.jsx("section",{className:t,...r,children:e})},(e,t)=>_n(e,t));fC.displayName="MarkdownSection";var bV=({node:e,className:t,children:n,...r})=>{var s,l;let o=It(),c=!("data-block"in r),{mermaid:d,controls:m,lineNumbers:p}=T.useContext(Pr),g=R1(),y=O$(),E=t==null?void 0:t.match(pV),v=(s=E==null?void 0:E.at(1))!=null?s:"",k=iV(v);if(c)return h.jsx("code",{className:o("rounded bg-muted px-1.5 py-0.5 font-mono text-sm",t),"data-streamdown":"inline-code",...r,children:n});let C=(l=e==null?void 0:e.properties)==null?void 0:l.metastring,S=C==null?void 0:C.match(fV),A=S?Number.parseInt(S[1],10):void 0,N=A!==void 0&&A>=1?A:void 0,U=!(C&&hV.test(C))&&p!==!1,G="";if(T.isValidElement(n)&&n.props&&typeof n.props=="object"&&"children"in n.props&&typeof n.props.children=="string"?G=n.props.children:typeof n=="string"&&(G=n),k){let ue=k.component;return h.jsx(T.Suspense,{fallback:h.jsx(rT,{}),children:h.jsx(ue,{code:G,isIncomplete:y,language:v,meta:C})})}if(v==="mermaid"&&g){let ue=cg(m,"mermaid"),M=Gd(m,"download"),K=Gd(m,"copy"),F=Gd(m,"fullscreen"),ge=Gd(m,"panZoom"),ce=ue&&(M||K||F);return h.jsx(T.Suspense,{fallback:h.jsx(rT,{}),children:h.jsxs("div",{className:o("group relative my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2",t),"data-streamdown":"mermaid-block",children:[h.jsx("div",{className:o("flex h-8 items-center text-muted-foreground text-xs"),children:h.jsx("span",{className:o("ml-1 font-mono lowercase"),children:"mermaid"})}),ce?h.jsx("div",{className:o("pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end"),children:h.jsxs("div",{className:o("pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur"),"data-streamdown":"mermaid-block-actions",children:[M?h.jsx(lV,{chart:G,config:d==null?void 0:d.config}):null,K?h.jsx(tT,{code:G}):null,F?h.jsx(oV,{chart:G,config:d==null?void 0:d.config}):null]})}):null,h.jsx("div",{className:o("rounded-md border border-border bg-background"),children:h.jsx(mV,{chart:G,config:d==null?void 0:d.config,showControls:ge})})]})})}let P=cg(m,"code"),H=aT(m,"download"),Y=aT(m,"copy");return h.jsx($$,{className:t,code:G,isIncomplete:y,language:v,lineNumbers:U,startLine:N,children:P?h.jsxs(h.Fragment,{children:[H?h.jsx(tV,{code:G,language:v}):null,Y?h.jsx(tT,{}):null]}):null})},hC=T.memo(bV,(e,t)=>e.className===t.className&&ch(e.node,t.node));hC.displayName="MarkdownCode";var mC=T.memo(rV,(e,t)=>e.className===t.className&&ch(e.node,t.node));mC.displayName="MarkdownImg";var pC=T.memo(({children:e,node:t,...n})=>{let r=(Array.isArray(e)?e:[e]).filter(s=>s!=null&&s!=="");if(r.length===1&&T.isValidElement(r[0])){let s=r[0].props.node,l=s==null?void 0:s.tagName;if(l==="img")return h.jsx(h.Fragment,{children:e});if(l==="code"&&"data-block"in r[0].props)return h.jsx(h.Fragment,{children:e})}return h.jsx("p",{...n,children:e})},(e,t)=>_n(e,t));pC.displayName="MarkdownParagraph";var xV={ol:L1,li:qk,ul:Yk,hr:Wk,strong:Qk,a:Xk,h1:Kk,h2:Zk,h3:Jk,h4:eC,h5:tC,h6:nC,table:rC,thead:aC,tbody:iC,tr:sC,th:lC,td:oC,blockquote:uC,code:hC,img:mC,pre:({children:e})=>T.isValidElement(e)?T.cloneElement(e,{"data-block":"true"}):e,sup:cC,sub:dC,p:pC,section:fC},yV=/[\u0590-\u08FF\uFB1D-\uFDFF\uFE70-\uFEFF]/,EV=new RegExp("\\p{L}","u");function iT(e){let t=e.replace(/^#{1,6}\s+/gm,"").replace(/(\*{1,3}|_{1,3})/g,"").replace(/`[^`]*`/g,"").replace(/\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/^[\s>*\-+\d.]+/gm,"");for(let n of t){if(yV.test(n))return"rtl";if(EV.test(n))return"ltr"}return"ltr"}var _V=/^[ \t]{0,3}(`{3,}|~{3,})/,TV=/^\|?[ \t]*:?-{1,}:?[ \t]*(\|[ \t]*:?-{1,}:?[ \t]*)*\|?$/,sT=e=>{let t=e.split(`
|
|
361
|
+
`),n=null,r=0;for(let s of t){let l=_V.exec(s);if(n===null){if(l){let o=l[1];n=o[0],r=o.length}}else if(l){let o=l[1],c=o[0],d=o.length;c===n&&d>=r&&(n=null,r=0)}}return n!==null},vV=e=>{let t=e.split(`
|
|
362
|
+
`);for(let n of t){let r=n.trim();if(r.length>0&&r.includes("|")&&TV.test(r))return!0}return!1},wV=()=>e=>{$a(e,"html",(t,n,r)=>{!r||typeof n!="number"||(r.children[n]={type:"text",value:t.value})})},lT=[],oT={allowDangerousHtml:!0},qd=new WeakMap,kV=class{constructor(){this.cache=new Map,this.keyCache=new WeakMap,this.maxSize=100}generateCacheKey(e){let t=this.keyCache.get(e);if(t)return t;let n=e.rehypePlugins,r=e.remarkPlugins,s=e.remarkRehypeOptions;if(!(n||r||s)){let p="default";return this.keyCache.set(e,p),p}let l=p=>{if(!p||p.length===0)return"";let g="";for(let y=0;y<p.length;y+=1){let E=p[y];if(y>0&&(g+=","),Array.isArray(E)){let[v,k]=E;if(typeof v=="function"){let C=qd.get(v);C||(C=v.name,qd.set(v,C)),g+=C}else g+=String(v);g+=":",g+=JSON.stringify(k)}else if(typeof E=="function"){let v=qd.get(E);v||(v=E.name,qd.set(E,v)),g+=v}else g+=String(E)}return g},o=l(n),c=l(r),d=s?JSON.stringify(s):"",m=`${c}::${o}::${d}`;return this.keyCache.set(e,m),m}get(e){let t=this.generateCacheKey(e),n=this.cache.get(t);return n&&(this.cache.delete(t),this.cache.set(t,n)),n}set(e,t){let n=this.generateCacheKey(e);if(this.cache.size>=this.maxSize){let r=this.cache.keys().next().value;r&&this.cache.delete(r)}this.cache.set(n,t)}clear(){this.cache.clear()}},uT=new kV,gC=e=>{let t=CV(e),n=e.children||"",r=t.runSync(t.parse(n),n);return OV(r,e)},CV=e=>{let t=uT.get(e);if(t)return t;let n=AV(e);return uT.set(e,n),n},SV=e=>e.some(t=>Array.isArray(t)?t[0]===Y0:t===Y0),AV=e=>{let t=e.rehypePlugins||lT,n=e.remarkPlugins||lT,r=SV(t)?n:[...n,wV],s=e.remarkRehypeOptions?{...oT,...e.remarkRehypeOptions}:oT;return NF().use(Az).use(r).use(cF,s).use(t)},NV=e=>e,RV=(e,t,n,r)=>{n?e.children.splice(t,1):e.children[t]={type:"text",value:r}},LV=(e,t)=>{var n;for(let r in n0)if(Object.hasOwn(n0,r)&&Object.hasOwn(e.properties,r)){let s=e.properties[r],l=n0[r];(l===null||l.includes(e.tagName))&&(e.properties[r]=(n=t(String(s||""),r,e))!=null?n:void 0)}},IV=(e,t,n,r,s,l)=>{let o=!1;return r?o=!r.includes(e.tagName):s&&(o=s.includes(e.tagName)),!o&&l&&typeof t=="number"&&(o=!l(e,t,n)),o},OV=(e,t)=>{let{allowElement:n,allowedElements:r,disallowedElements:s,skipHtml:l,unwrapDisallowed:o,urlTransform:c}=t;if(n||r||s||l||c){let d=c||NV;$a(e,(m,p,g)=>{if(m.type==="raw"&&g&&typeof p=="number")return RV(g,p,l,m.value),p;if(m.type==="element"&&(LV(m,d),IV(m,p,g,r,s,n)&&g&&typeof p=="number"))return o&&m.children?g.children.splice(p,1,...m.children):g.children.splice(p,1),p})}return MH(e,{Fragment:h.Fragment,components:t.components,ignoreInvalidStyle:!0,jsx:h.jsx,jsxs:h.jsxs,passKeys:!0,passNode:!0})},DV=/\[\^[\w-]{1,200}\](?!:)/,jV=/\[\^[\w-]{1,200}\]:/,MV=/<(\w+)[\s>]/,PV=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),cT=new Map,dT=new Map,BV=e=>{let t=e.toLowerCase(),n=cT.get(t);if(n)return n;let r=new RegExp(`<${t}(?=[\\s>/])[^>]*>`,"gi");return cT.set(t,r),r},UV=e=>{let t=e.toLowerCase(),n=dT.get(t);if(n)return n;let r=new RegExp(`</${t}(?=[\\s>])[^>]*>`,"gi");return dT.set(t,r),r},fT=(e,t)=>{if(PV.has(t.toLowerCase()))return 0;let n=e.match(BV(t));if(!n)return 0;let r=0;for(let s of n)s.trimEnd().endsWith("/>")||(r+=1);return r},hT=(e,t)=>{let n=e.match(UV(t));return n?n.length:0},HV=e=>{let t=0;for(let n=0;n<e.length-1;n+=1)e[n]==="$"&&e[n+1]==="$"&&(t+=1,n+=1);return t},zV=e=>{let t=DV.test(e),n=jV.test(e);if(t||n)return[e];let r=ta.lex(e,{gfm:!0}),s=[],l=[],o=!1;for(let c of r){let d=c.raw,m=s.length;if(l.length>0){s[m-1]+=d;let p=l.at(-1),g=fT(d,p),y=hT(d,p);for(let E=0;E<g;E+=1)l.push(p);for(let E=0;E<y;E+=1)l.length>0&&l.at(-1)===p&&l.pop();continue}if(c.type==="html"&&c.block){let p=d.match(MV);if(p){let g=p[1],y=fT(d,g),E=hT(d,g);y>E&&l.push(g)}}if(m>0&&!o){let p=s[m-1];if(HV(p)%2===1){s[m-1]=p+d;continue}}s.push(d),c.type!=="space"&&(o=c.type==="code")}return s},FV=(e,t)=>{if(!t.length)return e;let n=e;for(let r of t){let s=new RegExp(`(<${r}(?=[\\s>/])[^>]*>)([\\s\\S]*?)(</${r}\\s*>)`,"gi");n=n.replace(s,(l,o,c,d)=>{if(!c.includes(`
|
|
363
|
+
|
|
364
|
+
`))return o+c+d;let m=c.replace(/\n\n/g,`
|
|
365
|
+
<!---->
|
|
366
|
+
`),p=(m.startsWith(`
|
|
367
|
+
`)?"":`
|
|
368
|
+
`)+m+(m.endsWith(`
|
|
369
|
+
`)?"":`
|
|
370
|
+
`);return`${o}${p}${d}
|
|
371
|
+
|
|
372
|
+
`})}return n},$V=/([\\`*_~[\]|])/g,VV=e=>e.replace($V,"\\$1"),GV=(e,t)=>{if(!t.length)return e;let n=e;for(let r of t){let s=new RegExp(`(<${r}(?=[\\s>/])[^>]*>)([\\s\\S]*?)(</${r}\\s*>)`,"gi");n=n.replace(s,(l,o,c,d)=>{let m=VV(c).replace(/\n\n/g," ");return o+m+d})}return n},bC=e=>e.type==="text"?e.value:"children"in e&&Array.isArray(e.children)?e.children.map(bC).join(""):"",qV=e=>t=>{if(!e||e.length===0)return;let n=new Set(e.map(r=>r.toLowerCase()));$a(t,"element",r=>{if(n.has(r.tagName.toLowerCase())){let s=bC(r);r.children=s?[{type:"text",value:s}]:[]}})},YV=()=>e=>{$a(e,"code",t=>{var n,r;t.meta&&(t.data=(n=t.data)!=null?n:{},t.data.hProperties={...(r=t.data.hProperties)!=null?r:{},metastring:t.meta})})},WV=/^[ \t]*<[\w!/?-]/,QV=/(^|\n)[ \t]{4,}(?=<[\w!/?-])/g,XV=e=>typeof e!="string"||e.length===0||!WV.test(e)?e:e.replace(QV,"$1"),mT,pT,gT,bT,df={...nl,protocols:{...nl.protocols,href:[...(pT=(mT=nl.protocols)==null?void 0:mT.href)!=null?pT:[],"tel"]},attributes:{...nl.attributes,code:[...(bT=(gT=nl.attributes)==null?void 0:gT.code)!=null?bT:[],"metastring"]}},dg={raw:Y0,sanitize:[cw,df],harden:[m8,{allowedImagePrefixes:["*"],allowedLinkPrefixes:["*"],allowedProtocols:["*"],defaultOrigin:void 0,allowDataImages:!0}]},xC={gfm:[vB,{}],codeMeta:YV},xT=Object.values(dg),KV=Object.values(xC),ZV={block:" ▋",circle:" ●"},yC=["github-light","github-dark"],EC={enabled:!0},JV={shikiTheme:yC,controls:!0,isAnimating:!1,lineNumbers:!0,mode:"streaming",mermaid:void 0,linkSafety:EC},Pr=T.createContext(JV),_C=T.memo(({content:e,shouldParseIncompleteMarkdown:t,shouldNormalizeHtmlIndentation:n,index:r,isIncomplete:s,dir:l,animatePlugin:o,...c})=>{if(o){let p=o.getLastRenderCharCount();o.setPrevContentLength(p)}let d=typeof e=="string"&&n?XV(e):e,m=h.jsx(gC,{...c,children:d});return h.jsx(Pk.Provider,{value:s,children:l?h.jsx("div",{dir:l,style:{display:"contents"},children:m}):m})},(e,t)=>{if(e.content!==t.content||e.shouldNormalizeHtmlIndentation!==t.shouldNormalizeHtmlIndentation||e.index!==t.index||e.isIncomplete!==t.isIncomplete||e.dir!==t.dir)return!1;if(e.components!==t.components){let n=Object.keys(e.components||{}),r=Object.keys(t.components||{});if(n.length!==r.length||n.some(s=>{var l,o;return((l=e.components)==null?void 0:l[s])!==((o=t.components)==null?void 0:o[s])}))return!1}return!(e.rehypePlugins!==t.rehypePlugins||e.remarkPlugins!==t.remarkPlugins)});_C.displayName="Block";var TC=T.memo(({children:e,mode:t="streaming",dir:n,parseIncompleteMarkdown:r=!0,normalizeHtmlIndentation:s=!1,components:l,rehypePlugins:o=xT,remarkPlugins:c=KV,className:d,shikiTheme:m=yC,mermaid:p,controls:g=!0,isAnimating:y=!1,animated:E,BlockComponent:v=_C,parseMarkdownIntoBlocksFn:k=zV,caret:C,plugins:S,remend:A,linkSafety:N=EC,lineNumbers:U=!0,allowedTags:G,literalTagContent:P,translations:H,icons:Y,prefix:ue,onAnimationStart:M,onAnimationEnd:K,...F})=>{let ge=T.useId(),[ce,ne]=T.useTransition(),z=T.useMemo(()=>j$(ue),[ue]),ee=T.useRef(null),ke=T.useRef(M),Be=T.useRef(K);ke.current=M,Be.current=K,T.useEffect(()=>{var it,lt,ht;if(t==="static")return;let mn=ee.current;if(ee.current=y,mn===null){y&&((it=ke.current)==null||it.call(ke));return}y&&!mn?(lt=ke.current)==null||lt.call(ke):!y&&mn&&((ht=Be.current)==null||ht.call(Be))},[y,t]);let L=T.useMemo(()=>G?Object.keys(G):[],[G]),$=T.useMemo(()=>{if(typeof e!="string")return"";let it=t==="streaming"&&r?DU(e,A):e;return P&&P.length>0&&(it=GV(it,P)),L.length>0&&(it=FV(it,L)),it},[e,t,r,A,L,P]),ae=T.useMemo(()=>k($),[$,k]),[O,_e]=T.useState(ae);T.useEffect(()=>{t==="streaming"&&!Ie?ne(()=>{_e(ae)}):_e(ae)},[ae,t]);let Re=t==="streaming"?O:ae,we=T.useMemo(()=>n==="auto"?Re.map(iT):void 0,[Re,n]),et=T.useMemo(()=>Re.map((it,lt)=>`${ge}-${lt}`),[Re.length,ge]),Fe=T.useMemo(()=>E===!0?"true":E?JSON.stringify(E):"",[E]),Ie=T.useMemo(()=>Fe?Fe==="true"?ig():ig(E):null,[Fe]),kt=T.useMemo(()=>{var it,lt;return{shikiTheme:(lt=(it=S==null?void 0:S.code)==null?void 0:it.getThemes())!=null?lt:m,controls:g,isAnimating:y,lineNumbers:U,mode:t,mermaid:p,linkSafety:N}},[m,g,y,U,t,p,N,S==null?void 0:S.code]),at=T.useMemo(()=>H?JSON.stringify(H):"",[H]),Nt=T.useMemo(()=>({...zk,...H}),[at]),Gt=T.useMemo(()=>{let{inlineCode:it,...lt}=l??{},ht={...xV,...lt};if(it){let mn=ht.code;ht.code=rn=>"data-block"in rn?mn?T.createElement(mn,rn):null:T.createElement(it,rn)}return ht},[l]),Ut=T.useMemo(()=>{let it=[];return S!=null&&S.cjk&&(it=[...it,...S.cjk.remarkPluginsBefore]),it=[...it,...c],S!=null&&S.cjk&&(it=[...it,...S.cjk.remarkPluginsAfter]),S!=null&&S.math&&(it=[...it,S.math.remarkPlugin]),it},[c,S==null?void 0:S.math,S==null?void 0:S.cjk]),Tt=T.useMemo(()=>{var it;let lt=o;if(G&&Object.keys(G).length>0&&o===xT){let ht={...df,tagNames:[...(it=df.tagNames)!=null?it:[],...Object.keys(G)],attributes:{...df.attributes,...G}};lt=[dg.raw,[cw,ht],dg.harden]}return P&&P.length>0&&(lt=[...lt,[qV,P]]),S!=null&&S.math&&(lt=[...lt,S.math.rehypePlugin]),Ie&&y&&(lt=[...lt,Ie.rehypePlugin]),lt},[o,S==null?void 0:S.math,Ie,y,G,P]),rt=T.useMemo(()=>{if(!y||Re.length===0)return!1;let it=Re.at(-1);return sT(it)||vV(it)},[y,Re]),on=T.useMemo(()=>C&&y&&!rt?{"--streamdown-caret":`"${ZV[C]}"`}:void 0,[C,y,rt]);return t==="static"?h.jsx(lg.Provider,{value:Nt,children:h.jsx(og.Provider,{value:S??null,children:h.jsx(Pr.Provider,{value:kt,children:h.jsx(eT,{icons:Y,children:h.jsx(sg.Provider,{value:z,children:h.jsx("div",{className:z("space-y-4 whitespace-normal [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",d),dir:n==="auto"?iT($):n,children:h.jsx(gC,{components:Gt,rehypePlugins:Tt,remarkPlugins:Ut,...F,children:$})})})})})})}):h.jsx(lg.Provider,{value:Nt,children:h.jsx(og.Provider,{value:S??null,children:h.jsx(Pr.Provider,{value:kt,children:h.jsx(eT,{icons:Y,children:h.jsx(sg.Provider,{value:z,children:h.jsxs("div",{className:z("space-y-4 whitespace-normal [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",C&&!rt?"[&>*:last-child]:after:inline [&>*:last-child]:after:align-baseline [&>*:last-child]:after:content-[var(--streamdown-caret)]":null,d),style:on,children:[Re.length===0&&C&&y&&h.jsx("span",{}),Re.map((it,lt)=>{var ht;let mn=lt===Re.length-1,rn=y&&mn&&sT(it);return h.jsx(v,{animatePlugin:Ie,components:Gt,content:it,dir:(ht=we==null?void 0:we[lt])!=null?ht:n!=="auto"?n:void 0,index:lt,isIncomplete:rn,rehypePlugins:Tt,remarkPlugins:Ut,shouldNormalizeHtmlIndentation:s,shouldParseIncompleteMarkdown:r,...F},et[lt])})]})})})})})})},(e,t)=>e.children===t.children&&e.shikiTheme===t.shikiTheme&&e.isAnimating===t.isAnimating&&e.animated===t.animated&&e.mode===t.mode&&e.plugins===t.plugins&&e.className===t.className&&e.linkSafety===t.linkSafety&&e.lineNumbers===t.lineNumbers&&e.normalizeHtmlIndentation===t.normalizeHtmlIndentation&&e.literalTagContent===t.literalTagContent&&JSON.stringify(e.translations)===JSON.stringify(t.translations)&&e.prefix===t.prefix&&e.dir===t.dir);TC.displayName="Streamdown";var eG=({children:e,className:t,minZoom:n=.5,maxZoom:r=3,zoomStep:s=.1,showControls:l=!0,initialZoom:o=1,fullscreen:c=!1})=>{let{RotateCcwIcon:d,ZoomInIcon:m,ZoomOutIcon:p}=Ca(),g=It(),y=T.useRef(null),E=T.useRef(null),[v,k]=T.useState(o),[C,S]=T.useState({x:0,y:0}),[A,N]=T.useState(!1),[U,G]=T.useState({x:0,y:0}),[P,H]=T.useState({x:0,y:0}),Y=T.useCallback(z=>{k(ee=>Math.max(n,Math.min(r,ee+z)))},[n,r]),ue=T.useCallback(()=>{Y(s)},[Y,s]),M=T.useCallback(()=>{Y(-s)},[Y,s]),K=T.useCallback(()=>{k(o),S({x:0,y:0})},[o]),F=T.useCallback(z=>{z.preventDefault();let ee=z.deltaY>0?-s:s;Y(ee)},[Y,s]),ge=T.useCallback(z=>{if(z.button!==0||z.isPrimary===!1)return;N(!0),G({x:z.clientX,y:z.clientY}),H(C);let ee=z.currentTarget;ee instanceof HTMLElement&&ee.setPointerCapture(z.pointerId)},[C]),ce=T.useCallback(z=>{if(!A)return;z.preventDefault();let ee=z.clientX-U.x,ke=z.clientY-U.y;S({x:P.x+ee,y:P.y+ke})},[A,U,P]),ne=T.useCallback(z=>{N(!1);let ee=z.currentTarget;ee instanceof HTMLElement&&ee.releasePointerCapture(z.pointerId)},[]);return T.useEffect(()=>{let z=y.current;if(z)return z.addEventListener("wheel",F,{passive:!1}),()=>{z.removeEventListener("wheel",F)}},[F]),T.useEffect(()=>{let z=E.current;if(z&&A)return document.body.style.userSelect="none",z.addEventListener("pointermove",ce,{passive:!1}),z.addEventListener("pointerup",ne),z.addEventListener("pointercancel",ne),()=>{document.body.style.userSelect="",z.removeEventListener("pointermove",ce),z.removeEventListener("pointerup",ne),z.removeEventListener("pointercancel",ne)}},[A,ce,ne]),h.jsxs("div",{className:g("relative flex flex-col",c?"h-full w-full":"min-h-28 w-full",t),ref:y,style:{cursor:A?"grabbing":"grab"},children:[l?h.jsxs("div",{className:g("absolute z-10 flex flex-col gap-1 rounded-md border border-border bg-background/80 p-1 supports-[backdrop-filter]:bg-background/70 supports-[backdrop-filter]:backdrop-blur-sm",c?"bottom-4 left-4":"bottom-2 left-2"),children:[h.jsx("button",{className:g("flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50"),disabled:v>=r,onClick:ue,title:"Zoom in",type:"button",children:h.jsx(m,{size:16})}),h.jsx("button",{className:g("flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50"),disabled:v<=n,onClick:M,title:"Zoom out",type:"button",children:h.jsx(p,{size:16})}),h.jsx("button",{className:g("flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground"),onClick:K,title:"Reset zoom and pan",type:"button",children:h.jsx(d,{size:16})})]}):null,h.jsx("div",{className:g("flex-1 origin-center transition-transform duration-150 ease-out",c?"flex h-full w-full items-center justify-center":"flex w-full items-center justify-center"),onPointerDown:ge,ref:E,role:"application",style:{transform:`translate(${C.x}px, ${C.y}px) scale(${v})`,transformOrigin:"center center",touchAction:"none",willChange:"transform"},children:e})]})},vC=({chart:e,className:t,config:n,fullscreen:r=!1,showControls:s=!0})=>{let l=It(),[o,c]=T.useState(null),[d,m]=T.useState(!1),[p,g]=T.useState(""),[y,E]=T.useState(""),[v,k]=T.useState(0),{mermaid:C}=T.useContext(Pr),S=R1(),A=C==null?void 0:C.errorComponent,{shouldRender:N,containerRef:U}=v$({immediate:r});if(T.useEffect(()=>{if(N){if(!S){c("Mermaid plugin not available. Please add the mermaid plugin to enable diagram rendering.");return}(async()=>{try{c(null),m(!0);let P=S.getMermaid(n),H=e.split("").reduce((M,K)=>(M<<5)-M+K.charCodeAt(0)|0,0),Y=`mermaid-${Math.abs(H)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:ue}=await P.render(Y,e);g(ue),E(ue)}catch(P){if(!(y||p)){let H=P instanceof Error?P.message:"Failed to render Mermaid chart";c(H)}}finally{m(!1)}})()}},[e,n,v,N,S]),!(N||p||y))return h.jsx("div",{className:l("my-4 min-h-[200px]",t),ref:U});if(d&&!p&&!y)return h.jsx("div",{className:l("my-4 flex justify-center p-4",t),ref:U,children:h.jsxs("div",{className:l("flex items-center space-x-2 text-muted-foreground"),children:[h.jsx("div",{className:l("h-4 w-4 animate-spin rounded-full border-current border-b-2")}),h.jsx("span",{className:l("text-sm"),children:"Loading diagram..."})]})});if(o&&!p&&!y){let P=()=>k(H=>H+1);return A?h.jsx("div",{ref:U,children:h.jsx(A,{chart:e,error:o,retry:P})}):h.jsxs("div",{className:l("rounded-md bg-red-50 p-4",t),ref:U,children:[h.jsxs("p",{className:l("font-mono text-red-700 text-sm"),children:["Mermaid Error: ",o]}),h.jsxs("details",{className:l("mt-2"),children:[h.jsx("summary",{className:l("cursor-pointer text-red-600 text-xs"),children:"Show Code"}),h.jsx("pre",{className:l("mt-2 overflow-x-auto rounded bg-red-100 p-2 text-red-800 text-xs"),children:e})]})]})}let G=p||y;return h.jsx("div",{className:l("size-full",t),"data-streamdown":"mermaid",ref:U,children:h.jsx(eG,{className:l(r?"size-full overflow-hidden":"overflow-hidden",t),fullscreen:r,maxZoom:3,minZoom:.5,showControls:s,zoomStep:.1,children:h.jsx("div",{"aria-label":"Mermaid chart",className:l("flex justify-center",r?"size-full items-center":null),dangerouslySetInnerHTML:{__html:G},role:"img"})})})};function wC({open:e,title:t,text:n,onClose:r}){return T.useEffect(()=>{if(!e)return;function s(l){l.key==="Escape"&&r()}return window.addEventListener("keydown",s),()=>{window.removeEventListener("keydown",s)}},[r,e]),e?ko.createPortal(h.jsxs("div",{className:"fixed inset-0 z-[90] flex items-center justify-center p-4 sm:p-6",children:[h.jsx("button",{type:"button","aria-label":"Close full text",onClick:r,className:"absolute inset-0 bg-stone-950/78 backdrop-blur-sm"}),h.jsxs("div",{role:"dialog","aria-modal":"true","aria-label":t,className:"relative z-[1] flex max-h-[min(82vh,52rem)] w-full max-w-4xl flex-col overflow-hidden rounded-[1.8rem] border border-stone-700 bg-stone-900 shadow-2xl shadow-stone-950/40",children:[h.jsxs("div",{className:"flex items-center justify-between gap-3 border-b border-stone-800 px-4 py-3 sm:px-5",children:[h.jsx("p",{className:"truncate text-sm font-medium text-stone-100",children:t}),h.jsx("button",{type:"button","aria-label":"Close dialog",onClick:r,className:"inline-flex h-9 w-9 items-center justify-center rounded-full border border-stone-700 text-stone-300 transition hover:bg-stone-800",children:h.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-4 w-4 fill-current",children:h.jsx("path",{d:"M3.22 2.47 8 7.25l4.78-4.78 1.06 1.06L9.06 8.31l4.78 4.78-1.06 1.06L8 9.37l-4.78 4.78-1.06-1.06 4.78-4.78-4.78-4.78 1.06-1.06Z"})})})]}),h.jsx("div",{className:"min-h-0 flex-1 overflow-auto px-4 py-4 sm:px-5",children:h.jsx("pre",{className:"whitespace-pre-wrap break-words text-sm leading-6 text-stone-200",children:n})})]})]}),document.body):null}const tG=[/^(?: {0,3})#{1,6}\s+\S/m,/^(?: {0,3})>{1,}\s*\S/m,/^(?: {0,3})(?:[-+*]|\d{1,9}[.)])\s+(?:\[[ xX]\]\s+)?\S/m,/^(?: {0,3})(?:```|~~~)/m,/^(?: {0,3})(?:[-*_]\s*){3,}$/m],nG=/^(?:\|?[^|\n]+\|[^|\n]+(?:\|[^|\n]+)*\|?\s*\n\|?\s*:?-{3,}:?\s*(?:\|\s*:?-{3,}:?\s*)+\|?\s*$)/m,rG=/!?\[[^\]\n]+\]\([^)]+\)/,aG=/`[^`\n]+`/,iG=/(?:\*\*[^*\n]+\*\*|__[^_\n]+__)/,sG=/(^|[^\w])(?:\*[^*\n]+\*|_[^_\n]+_)(?=[^\w]|$)/,lG=/~~[^~\n]+~~/;function oG(e){const t=e.trim();return t?tG.some(n=>n.test(t))||nG.test(t)?!0:/[`[\]*_~!]/.test(t)?rG.test(t)||aG.test(t)||iG.test(t)||sG.test(t)||lG.test(t):!1:!1}function dh(e){return e?new Date(e).toLocaleString([],{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}):"Time unavailable"}function bo(e){return e?new Date(e).toLocaleString():"Time unavailable"}function kC(e){switch(e){case"idle":return"Idle";case"running":return"Running";case"interrupted":return"Interrupted";case"failed":return"Failed";case"not_loaded":return"Not Loaded";case"system_error":return"System Error"}}function uG(e){switch(e){case"idle":return"ui-status-neutral";case"running":return"ui-status-info";case"interrupted":return"ui-status-warning";case"failed":case"system_error":return"ui-status-danger";case"not_loaded":return"ui-status-neutral"}}function CC(e){switch(e){case"sending":return"Sending";case"completed":return"Completed";case"interrupted":return"Interrupted";case"failed":return"Failed";case"inProgress":return"Running"}}function Ni(e){switch(e){case"userMessage":return"timeline-kind-user";case"agentMessage":return"timeline-kind-agent";case"image":return"timeline-kind-action";case"contextCompaction":return"timeline-kind-action";case"commandExecution":return"timeline-kind-command";case"webSearch":return"timeline-kind-search";case"reasoning":return"timeline-kind-reasoning";case"toolCall":return"timeline-kind-action";case"plan":return"timeline-kind-plan";case"fileChange":return"timeline-kind-file";case"other":return"ui-status-neutral"}}function SC(e){switch(e){case"userMessage":return"User";case"agentMessage":return"Agent";case"image":return"Image";case"contextCompaction":return"Context";case"commandExecution":return"Command";case"webSearch":return"Web Search";case"reasoning":return"Reasoning";case"toolCall":return"Tool";case"plan":return"Plan";case"fileChange":return"File Change";case"other":return"Other"}}function cG(e){return e==="commandExecution"||e==="reasoning"}const yT=10,dG=10,fg=80;function Ri(e){switch(e){case"userMessage":return"timeline-user";case"agentMessage":return"timeline-agent";case"image":return"timeline-action";case"contextCompaction":return"timeline-action";case"commandExecution":return"timeline-command";case"webSearch":return"timeline-search";case"reasoning":return"timeline-reasoning";case"toolCall":return"timeline-action";case"plan":return"timeline-plan";case"fileChange":return"timeline-file-change";case"other":return"timeline-other"}}function va(e){switch(e){case"user":return"timeline-overlay-badge timeline-overlay-badge-user";case"agent":return"timeline-overlay-badge timeline-overlay-badge-agent";case"command":return"timeline-overlay-badge timeline-overlay-badge-command";case"search":return"timeline-overlay-badge timeline-overlay-badge-search";case"action":return"timeline-overlay-badge timeline-overlay-badge-action"}}function ET(){return h.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:[h.jsx("path",{d:"M3.5 5.25h9"}),h.jsx("path",{d:"M5 8h6"}),h.jsx("path",{d:"M6.5 10.75h3"})]})}function fG(e){var n;const t=e.replace(/\r\n/g,`
|
|
373
|
+
`).split(`
|
|
374
|
+
`);for(;t.length>1&&((n=t.at(-1))==null?void 0:n.trim())==="";)t.pop();return t}function wc(e){const t=fG(e);return t.length===1?{firstLine:t[0]??"",showGap:!1,isTruncated:!1}:{firstLine:t[0]??"",showGap:!0,isTruncated:!0}}function _T(e){const t=e.replace(/[\\/]+$/,"").trim();return t?t.split(/[\\/]/).filter(Boolean).at(-1)??t:""}function hG(e){var l;if(!e)return[];const t=/\[(PHOTO|FILE)\s+([^\]]+)\]/g,n=[];let r=0,s=0;for(const o of e.matchAll(t)){const c=o.index??0;c>r&&(n.push({type:"text",key:`text-${s}`,text:e.slice(r,c)}),s+=1);const d=o[1],m=((l=o[2])==null?void 0:l.trim())??"";d==="PHOTO"&&m?n.push({type:"photo",key:`photo-${s}`,path:m}):d==="FILE"&&m?n.push({type:"file",key:`file-${s}`,path:m}):n.push({type:"text",key:`text-${s}`,text:o[0]}),s+=1,r=c+o[0].length}return r<e.length&&n.push({type:"text",key:`text-${s}`,text:e.slice(r)}),n}function AC(e,t=42){const n=e.trim();if(!n)return"";const r=n.match(/(, \+\d+ more.*)$/),s=(r==null?void 0:r[1])??"",l=s?n.slice(0,-s.length):n;if(l.length<=t)return`${l}${s}`;const c=l.replace(/\\/g,"/").split("/").filter(Boolean);if(c.length>1){const d=[];let m=s.length+4;for(let p=c.length-1;p>=0;p-=1){const g=c[p],y=m+g.length+(d.length>0?1:0);if(d.length>0&&y>t)break;d.unshift(g),m=y}if(d.length>0)return`.../${d.join("/")}${s}`}return`...${l.slice(-(t-s.length-3))}${s}`}function mG(e){var r;const t=[];if(typeof e.changedFiles=="number"&&e.changedFiles>0&&t.push(`${e.changedFiles} ${e.changedFiles===1?"file":"files"}`),typeof e.addedLines=="number"&&e.addedLines>0&&t.push(`+${e.addedLines}`),typeof e.removedLines=="number"&&e.removedLines>0&&t.push(`-${e.removedLines}`),t.length>0)return t;const n=(r=e.previewText)==null?void 0:r.trim();return n?n.replace(/\bfiles changed\b/gi,"files").replace(/\bfile changed\b/gi,"file").split("·").map(s=>s.trim()).filter(Boolean):[]}function pG(e){return e==="userMessage"||e==="agentMessage"}function gG(e){return e==="commandExecution"||e==="webSearch"||e==="fileChange"||e==="image"||e==="contextCompaction"}function bG(e){return e==="agentMessage"||e==="reasoning"||e==="toolCall"||e==="plan"}function xG(e,t){if(!t)return e;const n=[...e],r=n.findIndex(l=>l.kind==="userMessage");if(r<0)return n;for(let l=r+1;l<n.length;l+=1){const o=n[l];if(!o||o.kind!=="userMessage")continue;let c=l+1;for(;c<n.length&&gG(n[c].kind);)c+=1;if(c===l+1)continue;const[d]=n.splice(l,1);n.splice(c-1,0,d),l=c-1}let s=!1;return n.map((l,o)=>l.kind!=="userMessage"?l:s?n.slice(o+1).some(d=>bG(d.kind))?l:{...l,status:"Awaiting response"}:(s=!0,l))}function yG(e,t){if(!t||t.length===0)return e;const n=new Set(e.map(s=>s.id)),r=t.filter(s=>!n.has(s.id));return r.length===0?e:[...e,...r]}function EG(e,t){if(!e)return"";const n=t.filter(d=>d.kind==="agentMessage").map(d=>d.text).filter(d=>d.length>0),r=n.at(-1)??"";if(r){const d=e.lastIndexOf(r);if(d>=0){const m=e.slice(d+r.length);return m.trim()?m:""}}const s=n.join("");if(!s)return e;const l=Math.min(e.length,s.length);let o=0;for(;o<l&&e[o]===s[o];)o+=1;if(o===0)return e;const c=e.slice(o);return c.trim()?c:""}function ws(e){if(!e)return!1;const t=e.toLowerCase();return t.includes("running")||t.includes("inprogress")||t.includes("in_progress")}function Mf(e){return e==="inProgress"||e==="sending"}function h0(e,t=fg){return e.scrollHeight-e.scrollTop-e.clientHeight<=t}function _G(e,t){const n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),s=Math.max(n.top,r.top),l=Math.min(n.bottom,r.bottom);return Math.max(0,l-s)>0}function TG(e){var r;const t=[];let n=0;for(;n<e.length;){const s=e[n];if(!s)break;if(s.kind!=="commandExecution"&&s.kind!=="fileChange"&&s.kind!=="webSearch"){t.push({kind:"item",key:s.id,item:s}),n+=1;continue}const l=[];for(;n<e.length&&((r=e[n])==null?void 0:r.kind)===s.kind;)l.push(e[n]),n+=1;if(l.length===1){t.push({kind:"item",key:l[0].id,item:l[0]});continue}const o=l.map(c=>c.id).join(":");if(s.kind==="commandExecution"){t.push({kind:"commandGroup",key:o,items:l});continue}if(s.kind==="fileChange"){t.push({kind:"fileChangeGroup",key:o,items:l});continue}t.push({kind:"searchGroup",key:o,items:l})}return t}function TT({kind:e}){return e==="userMessage"?h.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:[h.jsx("path",{d:"M8 8a2.75 2.75 0 1 0 0-5.5A2.75 2.75 0 0 0 8 8Z"}),h.jsx("path",{d:"M3.5 13.25a4.5 4.5 0 0 1 9 0"})]}):h.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:[h.jsx("rect",{x:"3.25",y:"3",width:"9.5",height:"7.5",rx:"2"}),h.jsx("path",{d:"M5.5 6.75h.01M10.5 6.75h.01M6.5 12.25h3"}),h.jsx("path",{d:"M6 10.5v1.75M10 10.5v1.75"})]})}function vT(){return h.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:[h.jsx("path",{d:"m4 5 2 2-2 2"}),h.jsx("path",{d:"M7.75 9.5h4.25"})]})}function hg(){return h.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:[h.jsx("path",{d:"M6.25 4.25 3.5 7l2.75 2.75"}),h.jsx("path",{d:"M9.75 4.25 12.5 7 9.75 9.75"}),h.jsx("path",{d:"M8.9 3.5 7.1 10.5"}),h.jsx("path",{d:"M3 12.25h10"})]})}function wT(){return h.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round",children:[h.jsx("rect",{x:"2.75",y:"3",width:"8.5",height:"3",rx:"1.1"}),h.jsx("rect",{x:"4.25",y:"6.5",width:"8.5",height:"3",rx:"1.1"}),h.jsx("rect",{x:"5.75",y:"10",width:"7.5",height:"3",rx:"1.1"}),h.jsx("path",{d:"m6.25 4.5 1 1-1 1"}),h.jsx("path",{d:"M7.9 5.5h1.7"}),h.jsx("path",{d:"m7.75 8 1 1-1 1"}),h.jsx("path",{d:"M9.4 9h1.7"})]})}function kT(){return h.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:[h.jsx("circle",{cx:"7",cy:"7",r:"3.75"}),h.jsx("path",{d:"m10.25 10.25 3 3"})]})}function CT(){return h.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round",children:[h.jsx("circle",{cx:"6",cy:"6",r:"2.3"}),h.jsx("path",{d:"m8 8 1.6 1.6"}),h.jsx("circle",{cx:"9.3",cy:"8.8",r:"2"}),h.jsx("path",{d:"m10.75 10.25 1.65 1.65"}),h.jsx("circle",{cx:"11.2",cy:"4.75",r:"1.8"}),h.jsx("path",{d:"m12.45 6 1.1 1.1"})]})}function ST(){return h.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:[h.jsx("rect",{x:"2.75",y:"3",width:"10.5",height:"9.5",rx:"1.5"}),h.jsx("circle",{cx:"6.1",cy:"6.1",r:"1.1"}),h.jsx("path",{d:"m4.5 10 2.2-2.2 1.9 1.9 1.1-1.1 1.8 1.8"})]})}function Pf(){return h.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round",children:[h.jsx("path",{d:"M5 2.75h4l2 2v6.5a1.5 1.5 0 0 1-1.5 1.5h-4A1.5 1.5 0 0 1 4 11.25v-7A1.5 1.5 0 0 1 5.5 2.75Z"}),h.jsx("path",{d:"M9 2.75v2h2"}),h.jsx("path",{d:"M6.2 8h3.6"}),h.jsx("path",{d:"M6.2 10h1.7"})]})}function vG(){return h.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:[h.jsx("path",{d:"M4.25 4.75h7.5"}),h.jsx("path",{d:"M4.25 8h7.5"}),h.jsx("path",{d:"M4.25 11.25h4.5"}),h.jsx("path",{d:"M2.25 4.75h.01M2.25 8h.01M2.25 11.25h.01"})]})}function wG(){return h.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 20 20",className:"h-3.5 w-3.5 fill-current",children:h.jsx("path",{d:"m13.28 7.78 3.22-3.22v2.69a.75.75 0 0 0 1.5 0v-4.5a.75.75 0 0 0-.75-.75h-4.5a.75.75 0 0 0 0 1.5h2.69l-3.22 3.22a.75.75 0 0 0 1.06 1.06ZM2 17.25v-4.5a.75.75 0 0 1 1.5 0v2.69l3.22-3.22a.75.75 0 0 1 1.06 1.06L4.56 16.5h2.69a.75.75 0 0 1 0 1.5h-4.5a.747.747 0 0 1-.75-.75ZM12.22 13.28l3.22 3.22h-2.69a.75.75 0 0 0 0 1.5h4.5a.747.747 0 0 0 .75-.75v-4.5a.75.75 0 0 0-1.5 0v2.69l-3.22-3.22a.75.75 0 1 0-1.06 1.06ZM3.5 4.56l3.22 3.22a.75.75 0 0 0 1.06-1.06L4.56 3.5h2.69a.75.75 0 0 0 0-1.5h-4.5a.75.75 0 0 0-.75.75v4.5a.75.75 0 0 0 1.5 0V4.56Z"})})}function kG(){return h.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:[h.jsx("rect",{x:"5.25",y:"3.25",width:"7.5",height:"9",rx:"1.5"}),h.jsx("path",{d:"M10.75 12.75H4.5a1.25 1.25 0 0 1-1.25-1.25V4.75A1.25 1.25 0 0 1 4.5 3.5h.75"})]})}function sa({tone:e="amber"}){const t=e==="emerald"?"bg-sky-200/90":e==="sky"?"bg-sky-300/90":"bg-amber-200/90";return h.jsx("span",{className:"ml-1.5 inline-flex items-center gap-1","aria-hidden":"true",children:[0,1,2].map(n=>h.jsx("span",{className:`h-1.5 w-1.5 rounded-full animate-pulse ${t}`,style:{animationDelay:`${n*180}ms`}},n))})}function mg(e){const t=e.trim().toLowerCase();return t==="completed"||t==="done"||t==="complete"?"completed":t==="in_progress"||t==="in progress"||t==="inprogress"||t==="running"||t==="active"?"in_progress":t==="pending"||t==="todo"||t==="not_started"||t==="not started"||t==="queued"?"pending":t==="failed"||t==="error"?"failed":"other"}function CG(e){switch(e.kind){case"fileChange":case"webSearch":case"image":case"contextCompaction":return!0;case"commandExecution":case"toolCall":return!ws(e.status);default:return!1}}function SG(e,t,n){if(!e||!Mf(n))return e;const r=e.plan.findIndex(c=>mg(c.status)==="in_progress");if(r<0)return e;const s=e.plan.findIndex((c,d)=>d>r&&mg(c.status)==="pending");if(s<0||!t.some(c=>CG(c)))return e;const o=e.plan.map((c,d)=>d===r?{...c,status:"completed"}:d===s?{...c,status:"in_progress"}:c);return{...e,plan:o}}function AG(){return h.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:[h.jsx("circle",{cx:"8",cy:"8",r:"4.75"}),h.jsx("path",{d:"M8 5.25v2.9l2.05 1.2"})]})}function NG({status:e}){const t=mg(e),n=t==="completed"?"Plan step status: Completed":t==="in_progress"?"Plan step status: In progress":t==="pending"?"Plan step status: Pending":t==="failed"?"Plan step status: Failed":`Plan step status: ${e}`,r=t==="completed"?"ui-status-success":t==="in_progress"?"ui-status-info":t==="pending"?"border-stone-700/90 bg-stone-900/80 text-stone-300":t==="failed"?"border-rose-300/30 bg-rose-300/10 text-rose-100":"border-stone-700/90 bg-stone-900/80 text-stone-300";return h.jsx("span",{"aria-label":n,title:n.replace("Plan step status: ",""),className:`inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-full border ${r}`,children:t==="completed"?h.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:h.jsx("path",{d:"m3.75 8.25 2.5 2.5 6-6"})}):t==="in_progress"?h.jsx(sa,{tone:"sky"}):t==="pending"?h.jsx(AG,{}):t==="failed"?h.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round",children:h.jsx("path",{d:"m5 5 6 6M11 5l-6 6"})}):h.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-[0.14em]",children:"?"})})}function AT({status:e}){const t=CC(e);return e==="completed"?h.jsx("span",{"aria-label":t,title:t,className:"timeline-status-icon timeline-status-icon-success inline-flex h-4 w-4 items-center justify-center",children:h.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:h.jsx("path",{d:"m3.75 8.25 2.5 2.5 6-6"})})}):e==="failed"?h.jsx("span",{"aria-label":t,title:t,className:"timeline-status-icon timeline-status-icon-failed inline-flex h-4 w-4 items-center justify-center",children:h.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round",children:h.jsx("path",{d:"m5 5 6 6M11 5l-6 6"})})}):e==="interrupted"?h.jsx("span",{"aria-label":t,title:t,className:"timeline-status-icon timeline-status-icon-warning inline-flex h-4 w-4 items-center justify-center",children:h.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round",children:h.jsx("path",{d:"M6 4.5v7M10 4.5v7"})})}):h.jsx("span",{"aria-label":t,title:t,className:"inline-flex min-w-[1.25rem] items-center justify-center text-sky-200",children:h.jsx(sa,{tone:"emerald"})})}function NT({turn:e,variant:t="header"}){const n=CC(e.status),r=PG(e),s=jG(e),l=RC(e),o=Mf(e.status),c=e.status==="failed"?"border-rose-300/20 bg-rose-300/[0.06] text-rose-100":o?"border-sky-300/22 bg-sky-300/[0.08] text-sky-100":"border-stone-700/90 bg-stone-900/70 text-stone-200";if(t==="footer")return h.jsxs("div",{className:`flex w-full flex-col gap-1.5 rounded-[0.95rem] border px-3 py-2 text-xs ${c}`,children:[h.jsxs("div",{className:"flex w-full items-center justify-between gap-3",children:[h.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[h.jsx(AT,{status:e.status}),h.jsx("span",{className:"timeline-soft-text min-w-0 truncate",children:r})]}),e.startedAt&&h.jsx("time",{dateTime:e.startedAt,title:bo(e.startedAt),className:"timeline-meta-text shrink-0 text-[11px]",children:dh(e.startedAt)})]}),(l||s.length>0)&&h.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 pl-6",children:[l?h.jsx("span",{className:`inline-flex items-center rounded-full border px-1.5 py-0.5 text-[10px] font-medium ${l.className}`,title:l.title,children:l.label}):null,s.map(m=>h.jsxs("span",{className:`inline-flex items-center rounded-full border px-1.5 py-0.5 text-[10px] font-medium ${m.className}`,title:m.title,children:[m.icon?h.jsx("span",{className:"mr-1",children:m.icon}):null,m.label]},m.id))]})]});const d=`${n} · ${r}`;return h.jsxs("span",{className:`inline-flex min-w-0 items-center gap-1.5 rounded-full border px-2 py-1 text-[10px] sm:text-[11px] ${c}`,title:d,children:[h.jsx(AT,{status:e.status}),h.jsx("span",{className:"timeline-meta-text min-w-0 truncate",children:r})]})}function RG(){return h.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round",children:[h.jsx("path",{d:"M8 2.75v8"}),h.jsx("path",{d:"m4.75 7.5 3.25 3.25L11.25 7.5"})]})}function LG(){return h.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round",children:[h.jsx("path",{d:"M8 13.25v-8"}),h.jsx("path",{d:"m11.25 8.5-3.25-3.25L4.75 8.5"})]})}function IG(){return h.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.45",strokeLinecap:"round",strokeLinejoin:"round",children:[h.jsx("path",{d:"M3.25 5.25 8 2.75l4.75 2.5L8 7.75l-4.75-2.5Z"}),h.jsx("path",{d:"M3.25 8 8 10.5 12.75 8"}),h.jsx("path",{d:"M3.25 10.75 8 13.25l4.75-2.5"}),h.jsx("path",{d:"M3.25 5.25v5.5"}),h.jsx("path",{d:"M12.75 5.25v5.5"})]})}function OG(){return h.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.45",strokeLinecap:"round",strokeLinejoin:"round",children:[h.jsx("path",{d:"M6.2 3.2a2.3 2.3 0 0 0-2.95 3.5A2.4 2.4 0 0 0 4.5 11h.2c.25 1.1 1.1 1.8 2.3 1.8h1.8c1.2 0 2.05-.7 2.3-1.8h.2A2.4 2.4 0 0 0 12.75 6.7 2.3 2.3 0 0 0 9.8 3.2"}),h.jsx("path",{d:"M6.3 6.15c.45-.42 1.02-.65 1.7-.65s1.25.23 1.7.65"}),h.jsx("path",{d:"M8 5.5v4.75"}),h.jsx("path",{d:"M6.75 9.05 8 10.25l1.25-1.2"})]})}function Yd(e){if(!Number.isFinite(e)||e<=0)return"0";if(e>=1e6){const t=e>=1e7?Math.round(e/1e6):e/1e6;return`${String(t.toFixed(1)).replace(/\.0$/,"")}m`}if(e>=1e3){const t=e>=1e4?Math.round(e/1e3):e/1e3;return`${String(t.toFixed(1)).replace(/\.0$/,"")}k`}return String(Math.round(e))}function DG(e){return!Number.isFinite(e)||e<=0?"$0":e>=100?`$${Math.round(e)}`:e>=10?`$${String(e.toFixed(1)).replace(/\.0$/,"")}`:e>=1?`$${String(e.toFixed(2)).replace(/0$/,"").replace(/\.$/,"")}`:e>=.1?`$${e.toFixed(2)}`:e>=.01?`$${e.toFixed(3)}`:e>=.001?`$${e.toFixed(4)}`:"<$0.001"}function zu(e){return!Number.isFinite(e)||e<=0?"$0.0000":`$${e.toFixed(4)}`}function Wd(e,t,n){const r=e??null;return!Number.isFinite(r??NaN)||r===null||t<=0||n<=0?null:r*n/t}function NC(e){var c,d,m,p,g;const t=(c=e.tokenUsage)==null?void 0:c.total;if(!t)return[];const n=Math.max(t.inputTokens-t.cachedInputTokens,0),r=Math.max(t.cachedInputTokens,0),s=Math.max(t.reasoningOutputTokens,0),l=Math.max(t.outputTokens-s,0);return[n>0?{id:"in",label:"Input",tokenCompactValue:Yd(n),tokenRawValue:n,usdCompactValue:e.priceEstimate?zu(e.priceEstimate.inputUsd):"--",usdRawValue:((d=e.priceEstimate)==null?void 0:d.inputUsd)??null,className:"token-badge-in",icon:h.jsx(RG,{})}:null,r>0?{id:"cache",label:"Cached input",tokenCompactValue:Yd(r),tokenRawValue:r,usdCompactValue:e.priceEstimate?zu(e.priceEstimate.cachedInputUsd):"--",usdRawValue:((m=e.priceEstimate)==null?void 0:m.cachedInputUsd)??null,className:"token-badge-cache",icon:h.jsx(IG,{})}:null,l>0?{id:"out",label:"Output",tokenCompactValue:Yd(l),tokenRawValue:l,usdCompactValue:e.priceEstimate?zu(Wd(e.priceEstimate.outputUsd,Math.max(t.outputTokens,0),l)??0):"--",usdRawValue:Wd((p=e.priceEstimate)==null?void 0:p.outputUsd,Math.max(t.outputTokens,0),l),className:"token-badge-out",icon:h.jsx(LG,{})}:null,s>0?{id:"reason",label:"Reasoning",tokenCompactValue:Yd(s),tokenRawValue:s,usdCompactValue:e.priceEstimate?zu(Wd(e.priceEstimate.outputUsd,Math.max(t.outputTokens,0),s)??0):"--",usdRawValue:Wd((g=e.priceEstimate)==null?void 0:g.outputUsd,Math.max(t.outputTokens,0),s),className:"token-badge-reason",icon:h.jsx(OG,{})}:null].filter(y=>y!==null)}function jG(e){return NC(e).map(t=>({id:t.id,label:t.tokenCompactValue,title:`${t.label}: ${t.tokenRawValue} tokens`,className:t.className,icon:t.icon}))}function RC(e){return{label:e.priceEstimate?DG(e.priceEstimate.totalUsd):"--",title:e.priceEstimate===null||e.priceEstimate===void 0?"Price estimate unavailable for this model.":`Estimated cost: ${zu(e.priceEstimate.totalUsd)}`,className:e.priceEstimate?"token-badge-total":"token-badge-empty"}}const m0="inline-flex shrink-0 items-center gap-1 rounded-full border px-1.5 py-0.5 text-[10px] font-normal leading-none sm:text-[11px]";function MG({turn:e}){const t=NC(e),n=RC(e),[r,s]=T.useState(!1),[l,o]=T.useState(!1),[c,d]=T.useState(0),m=T.useRef(null),p=T.useRef(null),g=T.useRef(null);if(T.useLayoutEffect(()=>{if(!r||t.length===0){d(0);return}const E=()=>{const v=m.current,k=g.current;if(!v||!k)return;const C=v.getBoundingClientRect(),S=k.offsetWidth||k.getBoundingClientRect().width;if(S<=0)return;const A=window.innerWidth||document.documentElement.clientWidth,N=12,U=C.left+C.width/2-S/2,G=N,P=Math.max(G,A-N-S),H=Math.min(Math.max(U,G),P);d(Math.round(H-U))};return E(),window.addEventListener("resize",E),()=>{window.removeEventListener("resize",E)}},[t.length,r]),T.useEffect(()=>{if(!r&&!l)return;const E=v=>{v.target instanceof Node&&(m.current&&!m.current.contains(v.target)&&s(!1),p.current&&!p.current.contains(v.target)&&o(!1))};return document.addEventListener("pointerdown",E),()=>{document.removeEventListener("pointerdown",E)}},[l,r]),!n&&t.length===0)return null;const y=()=>h.jsx("div",{className:"thread-token-popover min-w-[12rem] rounded-2xl border p-2.5 shadow-2xl shadow-black/20 backdrop-blur",children:h.jsx("div",{className:"space-y-1",children:t.map(E=>h.jsxs("div",{className:"thread-token-popover-row flex items-center justify-between gap-3 rounded-xl border px-2.5 py-1.5 text-[11px]",title:`${E.label}: ${E.tokenRawValue} tokens`,children:[h.jsxs("span",{className:"thread-token-popover-text inline-flex min-w-0 items-center gap-2",children:[h.jsx("span",{className:"inline-flex shrink-0",children:E.icon}),h.jsx("span",{className:"thread-token-popover-strong font-medium",children:E.usdCompactValue})]}),h.jsx("span",{className:"thread-token-popover-text shrink-0 font-medium",children:E.tokenCompactValue})]},E.id))})});return h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"hidden shrink-0 items-center gap-1.5 md:inline-flex",children:[n?h.jsxs("div",{ref:p,className:"relative shrink-0",onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),children:[h.jsx("button",{type:"button","aria-label":"Show token and price details","aria-expanded":l,onFocus:()=>o(!0),onBlur:()=>o(!1),className:`${m0} appearance-none whitespace-nowrap bg-transparent !text-[10px] !font-normal !leading-none transition hover:bg-[var(--theme-hover)] sm:!text-[11px] ${n.className}`,title:n.title,children:n.label}),l&&t.length>0?h.jsx("div",{className:"absolute left-1/2 top-full z-30 mt-1.5 -translate-x-1/2",children:y()}):null]}):null,t.map(E=>h.jsxs("span",{className:`${m0} ${E.className}`,title:`${E.label}: ${E.usdCompactValue}, ${E.tokenRawValue} tokens`,children:[E.icon,h.jsx("span",{className:"font-medium text-stone-100",children:E.tokenCompactValue})]},E.id))]}),h.jsxs("div",{ref:m,className:"relative shrink-0 md:hidden",children:[n?h.jsx("button",{type:"button","aria-label":"Show token and price details","aria-expanded":r,onClick:()=>s(E=>!E),className:`${m0} appearance-none whitespace-nowrap bg-transparent !text-[10px] !font-normal !leading-none transition hover:bg-[var(--theme-hover)] sm:!text-[11px] ${n.className}`,title:n.title,children:n.label}):null,r&&t.length>0?h.jsx("div",{ref:g,className:"absolute left-1/2 top-full z-30 mt-1.5",style:{transform:`translateX(${c}px) translateX(-50%)`},children:y()}):null]})]})}function PG(e){var r;const t=(r=e.model)!=null&&r.trim()?e.model.trim():"--";let n="--";return e.reasoningEffortAvailable===null||e.reasoningEffortAvailable===void 0?n="--":e.reasoningEffortAvailable===!1?n="-":n=e.reasoningEffort??"--",[t,n].join(" · ")}function BG({text:e,className:t="agent-markdown"}){return h.jsx(TC,{mode:"static",plugins:{code:l8},controls:!1,lineNumbers:!1,remarkPlugins:HG,className:t,children:e})}function UG(){return e=>{LC(e)}}const HG=[...Object.values(xC),UG];function LC(e){if(!Array.isArray(e.children))return;const t=[];for(const n of e.children){if(n.type==="text"&&typeof n.value=="string"&&n.value.includes(`
|
|
375
|
+
`)){n.value.split(`
|
|
376
|
+
`).forEach((s,l)=>{l>0&&t.push({type:"break"}),s&&t.push({...n,value:s})});continue}LC(n),t.push(n)}e.children=t}const zG=/\b(?:https?:\/\/|www\.)[^\s<>"'`]+/gi,FG=/[),.;:!?]+$/;function $G(e){return e.startsWith("www.")?`https://${e}`:e}function IC({text:e}){var r;const t=[];let n=0;for(const s of e.matchAll(zG)){const l=s[0],o=s.index??0,c=((r=l.match(FG))==null?void 0:r[0])??"",d=c?l.slice(0,-c.length):l;d&&(o>n&&t.push(e.slice(n,o)),t.push(h.jsx("a",{href:$G(d),target:"_blank",rel:"noreferrer",className:"thread-inline-link",children:d},`${o}-${d}`)),c&&t.push(c),n=o+l.length)}return n<e.length&&t.push(e.slice(n)),h.jsx(h.Fragment,{children:t.length>0?t:e})}function OC({text:e,scrollRootRef:t,streaming:n=!1,containerClassName:r="",plainTextClassName:s="whitespace-pre-wrap break-words text-[15px] leading-6 text-stone-100",markdownClassName:l="agent-markdown"}){const o=T.useRef(null),c=oG(e),[d,m]=T.useState(n||typeof IntersectionObserver>"u");return T.useEffect(()=>{if(n||typeof IntersectionObserver>"u"){m(!0);return}if(d||!o.current)return;const p=new IntersectionObserver(g=>{for(const y of g)if(y.isIntersecting){m(!0),p.disconnect();break}},{root:t.current,threshold:0});return p.observe(o.current),()=>{p.disconnect()}},[d,t,n]),h.jsx("div",{ref:o,className:r,children:d&&c?h.jsx(BG,{text:e,className:l}):h.jsx("p",{className:s,children:h.jsx(IC,{text:e})})})}function VG({text:e,scrollRootRef:t,streaming:n=!1}){return h.jsx(OC,{text:e,scrollRootRef:t,streaming:n,containerClassName:"thread-message-prose"})}function GG({threadId:e,text:t}){const n=T.useMemo(()=>hG(t),[t]);return h.jsx("div",{className:"thread-message-prose whitespace-pre-wrap break-words text-[15px] leading-6 text-stone-300",children:n.map(r=>{if(r.type==="text")return h.jsx("span",{children:r.text},r.key);if(r.type==="photo"){const l=e?`/api/threads/${e}/assets/image?path=${encodeURIComponent(r.path)}`:null,o=_T(r.path)||"Attached image";return h.jsx("span",{className:"mx-[0.14rem] inline-flex align-middle",children:h.jsxs("span",{className:"inline-flex max-w-full flex-col rounded-[1rem] border border-sky-300/28 bg-sky-300/[0.08] p-1.5 shadow-sm shadow-stone-950/20",children:[l?h.jsx("img",{src:l,alt:o,className:"h-[4.5rem] w-[6rem] rounded-[0.75rem] bg-stone-950 object-contain",loading:"lazy"}):h.jsx("span",{className:"inline-flex h-[4.5rem] w-[6rem] items-center justify-center rounded-[0.75rem] bg-stone-950 text-[10px] text-sky-100",children:"PHOTO"}),h.jsx("span",{className:"mt-1 max-w-[7rem] truncate text-[10px] font-medium tracking-[0.08em] text-sky-50",title:r.path,children:o})]})},r.key)}const s=_T(r.path)||"Attached file";return h.jsx("span",{className:"mx-[0.14rem] inline-flex align-middle",children:h.jsxs("span",{className:"inline-flex max-w-[12rem] items-center gap-2 rounded-[0.95rem] border border-emerald-300/28 bg-emerald-300/[0.08] px-2.5 py-2 text-[10px] font-medium tracking-[0.08em] text-emerald-50 shadow-sm shadow-stone-950/20",title:r.path,children:[h.jsx("span",{className:"inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-full border border-emerald-200/20 bg-emerald-300/12 text-[9px]",children:"FILE"}),h.jsx("span",{className:"min-w-0 truncate",children:s})]})},r.key)})})}function DC(e){return e==="completed"?"timeline-command-status-complete":"timeline-command-status-pending"}function jC({status:e}){return e==="completed"?h.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:h.jsx("path",{d:"m3.75 8.25 2.5 2.5 6-6"})}):h.jsx(sa,{tone:"emerald"})}const Ju=T.memo(function({threadId:t,item:n,scrollRootRef:r,streaming:s=!1}){const[l,o]=T.useState("idle"),c=T.useRef(null),d=n.kind==="userMessage"?"thread-message-icon thread-message-icon-user":"thread-message-icon thread-message-icon-agent",m=n.kind==="userMessage"&&(n.status==="Steering"||n.status==="Accepted"||n.status==="Awaiting response"),p=n.status==="Steering"?"ui-status-warning":n.status==="Accepted"?"ui-status-success":"ui-status-info";T.useEffect(()=>()=>{c.current!==null&&window.clearTimeout(c.current)},[]);async function g(){try{await navigator.clipboard.writeText(n.text),o("copied"),c.current!==null&&window.clearTimeout(c.current),c.current=window.setTimeout(()=>o("idle"),1200)}catch{o("failed"),c.current!==null&&window.clearTimeout(c.current),c.current=window.setTimeout(()=>o("idle"),1600)}}return h.jsxs("div",{className:`timeline-item-frame ${n.kind==="agentMessage"?"timeline-has-corner-copy":""} relative min-w-0 w-full overflow-hidden rounded-[1rem] border ${Ni(n.kind)} ${Ri(n.kind)} px-2.5 py-2.5 sm:rounded-[1.2rem] sm:px-3`,children:[m&&h.jsxs("span",{className:`absolute right-2.5 top-2.5 z-[1] inline-flex items-center gap-1 rounded-full border px-2 py-1 text-[10px] font-medium tracking-[0.12em] shadow-sm shadow-stone-950/20 ${p}`,children:[h.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.45",strokeLinecap:"round",strokeLinejoin:"round",children:[h.jsx("path",{d:"M3.25 8A4.75 4.75 0 0 1 8 3.25h2.75"}),h.jsx("path",{d:"m9.5 1.75 1.75 1.5-1.75 1.5"}),h.jsx("path",{d:"M12.75 8A4.75 4.75 0 0 1 8 12.75H5.25"}),h.jsx("path",{d:"m6.5 14.25-1.75-1.5 1.75-1.5"})]}),h.jsx("span",{children:n.status})]}),h.jsx("span",{className:`absolute left-0 top-0 z-[1] inline-flex h-5 w-5 items-center justify-center rounded-br-[0.7rem] rounded-tl-[0.95rem] border text-[10px] shadow-sm shadow-stone-950/20 sm:hidden ${d}`,children:h.jsx("span",{className:"scale-[0.78]",children:h.jsx(TT,{kind:n.kind})})}),h.jsxs("div",{className:"timeline-message-content timeline-mobile-bubble-content flex min-w-0 items-start gap-0 pt-2 sm:gap-2.5 sm:pt-0",children:[h.jsxs("div",{className:"hidden",children:[h.jsx("span",{className:`hidden h-6 w-6 items-center justify-center rounded-full border sm:inline-flex ${d}`,children:h.jsx(TT,{kind:n.kind})}),s&&n.kind==="agentMessage"&&h.jsx("span",{className:"hidden sm:inline-flex",children:h.jsx(sa,{tone:"emerald"})})]}),h.jsxs("div",{className:"min-w-0 flex-1",children:[n.kind==="agentMessage"?h.jsx(VG,{text:n.text,scrollRootRef:r,streaming:s}):h.jsx(GG,{threadId:t,text:n.text}),n.status&&!m&&h.jsx("p",{className:"timeline-meta-text mt-1 text-xs",children:n.status})]})]}),s&&n.kind==="agentMessage"&&h.jsx("span",{className:"absolute left-5 top-0 inline-flex sm:hidden",children:h.jsx(sa,{tone:"emerald"})}),n.kind==="agentMessage"&&h.jsx("button",{type:"button","aria-label":"Copy agent reply",title:l==="copied"?"Copied":l==="failed"?"Copy failed":"Copy agent reply",onClick:()=>void g(),className:"timeline-corner-copy absolute bottom-0 right-0 inline-flex h-5 w-5 items-center justify-center transition",children:h.jsx("span",{className:`timeline-corner-copy-visual inline-flex items-center justify-center border shadow-sm shadow-stone-950/25 backdrop-blur transition ${l==="copied"?"ui-status-info":l==="failed"?"ui-status-danger":"border-stone-700/90 bg-stone-900/60 text-stone-300 hover:bg-stone-800/92"}`,children:h.jsx(kG,{})})})]})}),qG=T.memo(function({item:t,onOpen:n}){const r=wc(t.text);return h.jsxs("div",{className:`timeline-item-frame timeline-mobile-dense-event timeline-mobile-dense-command relative min-w-0 w-full overflow-hidden rounded-[1rem] border ${Ni(t.kind)} ${Ri(t.kind)} px-2.5 py-2.5 sm:rounded-[1.2rem] sm:px-3`,children:[h.jsx("span",{className:`absolute left-0 top-0 z-[1] inline-flex h-5 w-5 items-center justify-center rounded-br-[0.7rem] rounded-tl-[0.95rem] border text-[10px] shadow-sm shadow-stone-950/20 sm:hidden ${va("command")}`,children:h.jsx("span",{className:"scale-[0.78]",children:h.jsx(vT,{})})}),ws(t.status)&&h.jsx("span",{className:"absolute left-5 top-0 inline-flex sm:hidden",children:h.jsx(sa,{})}),h.jsxs("div",{className:"flex items-start gap-2.5",children:[h.jsxs("div",{className:"mt-0.5 hidden shrink-0 items-center sm:flex",children:[h.jsx("span",{className:"inline-flex h-6 w-6 items-center justify-center rounded-full border border-amber-300/25 bg-amber-300/10 text-amber-200",children:h.jsx(vT,{})}),ws(t.status)&&h.jsx(sa,{})]}),h.jsxs("div",{className:"timeline-item-inner timeline-mobile-dense-inner timeline-mobile-bubble-content relative min-w-0 w-full flex-1 rounded-[0.9rem] border px-2.5 py-2.5 pt-6 sm:rounded-xl sm:px-3 sm:py-2",children:[h.jsx("button",{type:"button","aria-label":t.status?`Command status: ${t.status}`:"Command status",title:t.status??"Command status",onClick:()=>n(t,"Command Output"),className:`absolute right-0 top-0 inline-flex h-5 w-5 items-center justify-center rounded-bl-[0.7rem] rounded-tr-[0.9rem] border shadow-sm shadow-stone-950/25 transition sm:right-2 sm:top-2 sm:h-7 sm:w-7 sm:rounded-full ${DC(t.status)} hover:brightness-110`,children:h.jsx("span",{className:"scale-[0.72] sm:scale-100",children:h.jsx(jC,{status:t.status})})}),h.jsx("button",{type:"button","aria-label":"Open full command",onClick:()=>n(t,"Command Output"),className:"block w-full text-left",children:h.jsxs("div",{className:"timeline-mobile-dense-line flex min-w-0 items-center gap-2 text-sm leading-6",children:[h.jsx("p",{className:"timeline-primary-text min-w-0 flex-1 overflow-hidden whitespace-nowrap text-clip",children:r.firstLine}),r.showGap?h.jsx("span",{className:"timeline-meta-text shrink-0 text-[11px] font-medium tracking-[0.28em]",children:"..."}):null]})})]})]})]})}),YG=T.memo(function({item:t,onOpen:n}){const r=wc(t.text);return h.jsxs("div",{className:`timeline-item-frame relative min-w-0 w-full overflow-hidden rounded-[1rem] border ${Ni(t.kind)} ${Ri(t.kind)} px-2.5 py-2.5 sm:rounded-[1.2rem] sm:px-3`,children:[h.jsx("span",{className:`absolute left-0 top-0 z-[1] inline-flex h-5 w-5 items-center justify-center rounded-br-[0.7rem] rounded-tl-[0.95rem] border text-[10px] shadow-sm shadow-stone-950/20 sm:hidden ${va("action")}`,children:h.jsx("span",{className:"scale-[0.78]",children:h.jsx(hg,{})})}),ws(t.status)&&h.jsx("span",{className:"absolute left-5 top-0 inline-flex sm:hidden",children:h.jsx(sa,{})}),h.jsxs("div",{className:"flex items-start gap-2.5",children:[h.jsxs("div",{className:"mt-0.5 hidden shrink-0 items-center sm:flex",children:[h.jsx("span",{className:"inline-flex h-6 w-6 items-center justify-center rounded-full border border-fuchsia-300/25 bg-fuchsia-300/10 text-fuchsia-100",children:h.jsx(hg,{})}),ws(t.status)&&h.jsx(sa,{})]}),h.jsxs("div",{className:"timeline-item-inner relative min-w-0 w-full flex-1 rounded-[0.9rem] border px-2.5 py-2.5 pt-6 sm:rounded-xl sm:px-3 sm:py-2",children:[h.jsx("button",{type:"button","aria-label":t.status?`Tool status: ${t.status}`:"Tool status",title:t.status??"Tool status",onClick:()=>n(t,"Tool Call Details"),className:`absolute right-0 top-0 inline-flex h-5 w-5 items-center justify-center rounded-bl-[0.7rem] rounded-tr-[0.9rem] border shadow-sm shadow-stone-950/25 transition sm:right-2 sm:top-2 sm:h-7 sm:w-7 sm:rounded-full ${DC(t.status)} hover:brightness-110`,children:h.jsx("span",{className:"scale-[0.72] sm:scale-100",children:h.jsx(jC,{status:t.status})})}),h.jsx("button",{type:"button","aria-label":"Open full tool call",onClick:()=>n(t,"Tool Call Details"),className:"block w-full text-left",children:h.jsxs("div",{className:"flex min-w-0 items-center gap-2 text-sm leading-6",children:[h.jsx("p",{className:"timeline-primary-text min-w-0 flex-1 overflow-hidden whitespace-nowrap text-clip",children:r.firstLine}),r.showGap?h.jsx("span",{className:"timeline-meta-text shrink-0 text-[11px] font-medium tracking-[0.28em]",children:"..."}):null]})})]})]})]})}),WG=T.memo(function({items:t,expanded:n,onToggleExpanded:r,onOpen:s}){const l=t.filter(c=>ws(c.status)).length,o=t.length===1?"1 command":`${t.length} commands`;return h.jsxs("div",{className:"timeline-mobile-dense-event timeline-mobile-dense-command relative min-w-0 w-full overflow-hidden rounded-[1rem] border timeline-special-warning px-2.5 py-2.5 sm:rounded-[1.2rem] sm:px-3",children:[h.jsx("span",{className:`absolute left-0 top-0 z-[1] inline-flex h-5 w-5 items-center justify-center rounded-br-[0.7rem] rounded-tl-[0.95rem] border text-[10px] shadow-sm shadow-stone-950/20 sm:hidden ${va("command")}`,children:h.jsx("span",{className:"scale-[0.78]",children:h.jsx(wT,{})})}),h.jsxs("div",{className:"flex items-start gap-2.5",children:[h.jsxs("div",{className:"mt-0.5 hidden shrink-0 items-center sm:flex",children:[h.jsxs("span",{className:"relative inline-flex h-8 w-8 items-center justify-center rounded-[0.9rem] border border-amber-300/30 bg-amber-300/[0.14] text-amber-100 shadow-sm shadow-stone-950/20",children:[h.jsx(wT,{}),h.jsx("span",{className:"absolute -right-1 -top-1 inline-flex min-w-[1.1rem] items-center justify-center rounded-full border border-amber-200/35 bg-stone-950/90 px-1 text-[9px] font-semibold leading-4 text-amber-100",children:t.length})]}),l>0&&h.jsx(sa,{})]}),h.jsxs("div",{className:"timeline-batch-inner timeline-mobile-dense-batch timeline-mobile-bubble-content min-w-0 flex-1 rounded-[0.9rem] border px-2 py-1.5 sm:rounded-xl sm:px-3 sm:py-2",children:[h.jsx("button",{type:"button","aria-expanded":n,"aria-label":`${n?"Collapse":"Expand"} ${t.length} command entries`,onClick:r,className:"timeline-mobile-dense-toggle flex w-full min-w-0 items-center justify-between gap-3 text-left",children:h.jsxs("div",{className:"timeline-mobile-dense-summary min-w-0 flex flex-1 flex-wrap items-center gap-2 pr-1",children:[h.jsx("span",{className:"rounded-full border border-amber-300/28 bg-amber-300/12 px-2 py-0.5 text-[10px] font-medium uppercase tracking-[0.24em] text-amber-100",children:"Batch"}),h.jsx("span",{className:"rounded-full border border-stone-700/90 bg-stone-900/80 px-2 py-0.5 text-[10px] font-medium uppercase tracking-[0.16em] text-stone-300",children:o}),l>0&&h.jsx("span",{className:"inline-flex items-center text-xs text-amber-100/90",children:h.jsx(sa,{})})]})}),n&&h.jsx("div",{className:"timeline-mobile-section-list mt-3 space-y-0 border-t border-amber-300/12 pt-3 sm:space-y-2",children:t.map((c,d)=>{const m=wc(c.text);return h.jsxs("button",{type:"button","aria-label":`Open grouped command ${d+1}`,onClick:()=>s(c,`Command Output ${d+1}`),className:"timeline-detail-row block w-full rounded-xl border px-3 py-2 text-left transition",children:[h.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[h.jsxs("span",{className:"rounded-full border border-amber-300/18 bg-amber-300/[0.07] px-2 py-0.5 text-[10px] uppercase tracking-[0.18em] text-amber-100",children:["Step ",d+1]}),c.status&&h.jsx("span",{className:"timeline-meta-text text-xs",children:c.status})]}),h.jsxs("div",{className:"mt-1 flex min-w-0 items-center gap-2 text-sm leading-6",children:[h.jsx("p",{className:"timeline-primary-text min-w-0 flex-1 overflow-hidden whitespace-nowrap text-clip",children:m.firstLine}),m.showGap?h.jsx("span",{className:"timeline-meta-text shrink-0 text-[11px] font-medium tracking-[0.28em]",children:"..."}):null]})]},c.id)})})]})]})]})}),QG=T.memo(function({items:t,expanded:n,onToggleExpanded:r,onOpen:s}){const l=t.length===1?"1 search":`${t.length} searches`;return h.jsxs("div",{className:"timeline-mobile-dense-event timeline-mobile-dense-search relative min-w-0 w-full overflow-hidden rounded-[1rem] border timeline-special-info px-2.5 py-2.5 sm:rounded-[1.2rem] sm:px-3",children:[h.jsx("span",{className:`absolute left-0 top-0 z-[1] inline-flex h-5 w-5 items-center justify-center rounded-br-[0.7rem] rounded-tl-[0.95rem] border text-[10px] shadow-sm shadow-stone-950/20 sm:hidden ${va("search")}`,children:h.jsx("span",{className:"scale-[0.78]",children:h.jsx(CT,{})})}),h.jsxs("div",{className:"flex items-start gap-2.5",children:[h.jsx("div",{className:"mt-0.5 hidden shrink-0 items-center sm:flex",children:h.jsxs("span",{className:"relative inline-flex h-8 w-8 items-center justify-center rounded-[0.9rem] border border-sky-300/30 bg-sky-300/[0.14] text-sky-100 shadow-sm shadow-stone-950/20",children:[h.jsx(CT,{}),h.jsx("span",{className:"absolute -right-1 -top-1 inline-flex min-w-[1.1rem] items-center justify-center rounded-full border border-sky-200/35 bg-stone-950/90 px-1 text-[9px] font-semibold leading-4 text-sky-100",children:t.length})]})}),h.jsxs("div",{className:"timeline-batch-inner timeline-mobile-dense-batch timeline-mobile-bubble-content min-w-0 flex-1 rounded-[0.9rem] border px-2 py-1.5 sm:rounded-xl sm:px-3 sm:py-2",children:[h.jsx("button",{type:"button","aria-expanded":n,"aria-label":`${n?"Collapse":"Expand"} ${t.length} web search entries`,onClick:r,className:"timeline-mobile-dense-toggle flex w-full min-w-0 items-center justify-between gap-3 text-left",children:h.jsxs("div",{className:"timeline-mobile-dense-summary min-w-0 flex flex-1 flex-wrap items-center gap-2 pr-1",children:[h.jsx("span",{className:"rounded-full border border-sky-300/28 bg-sky-300/12 px-2 py-0.5 text-[10px] font-medium uppercase tracking-[0.24em] text-sky-100",children:"Batch"}),h.jsx("span",{className:"rounded-full border border-stone-700/90 bg-stone-900/80 px-2 py-0.5 text-[10px] font-medium uppercase tracking-[0.16em] text-stone-300",children:l})]})}),n&&h.jsx("div",{className:"timeline-mobile-section-list mt-3 space-y-0 border-t border-sky-300/12 pt-3 sm:space-y-2",children:t.map((o,c)=>{var g,y;const d=((g=o.previewText)==null?void 0:g.trim())||o.text||"Web search",m=wc(d),p=((y=o.detailText)==null?void 0:y.trim())||o.text||"Web search";return h.jsxs("button",{type:"button","aria-label":`Open grouped web search ${c+1}`,onClick:()=>s(`Web Search ${c+1}`,p),className:"timeline-detail-row block w-full rounded-xl border px-3 py-2 text-left transition",children:[h.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[h.jsxs("span",{className:"rounded-full border border-sky-300/18 bg-sky-300/[0.07] px-2 py-0.5 text-[10px] uppercase tracking-[0.18em] text-sky-100",children:["Search ",c+1]}),o.status&&h.jsx("span",{className:"timeline-meta-text text-xs",children:o.status})]}),h.jsxs("div",{className:"mt-1 flex min-w-0 items-center gap-2 text-sm leading-6",children:[h.jsx("p",{className:"timeline-primary-text min-w-0 flex-1 overflow-hidden whitespace-nowrap text-clip",children:m.firstLine}),m.showGap?h.jsx("span",{className:"timeline-meta-text shrink-0 text-[11px] font-medium tracking-[0.28em]",children:"..."}):null]})]},o.id)})})]})]})]})}),XG=T.memo(function({item:t,scrollRootRef:n}){return h.jsxs("div",{className:`timeline-item-frame relative min-w-0 w-full overflow-hidden rounded-[1rem] border border-stone-800/80 ${Ni(t.kind)} ${Ri(t.kind)} px-2.5 py-2.5 sm:rounded-[1.2rem] sm:px-3`,children:[h.jsx("span",{className:`absolute left-0 top-0 z-[1] inline-flex h-5 w-5 items-center justify-center rounded-br-[0.7rem] rounded-tl-[0.95rem] border text-[10px] shadow-sm shadow-stone-950/20 sm:hidden ${va("search")}`,children:h.jsx("span",{className:"scale-[0.78]",children:h.jsx(vG,{})})}),h.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[h.jsx("span",{className:"timeline-meta-text text-[11px] uppercase tracking-[0.2em]",children:SC(t.kind)}),t.status&&h.jsx("span",{className:"timeline-meta-text text-xs",children:t.status})]}),h.jsx("div",{className:"mt-1.5",children:h.jsx(OC,{text:t.text,scrollRootRef:n,plainTextClassName:"whitespace-pre-wrap break-words text-sm leading-6 text-stone-300",markdownClassName:"agent-markdown text-sm"})})]})}),KG=T.memo(function({item:t}){const n=ws(t.status)||t.text==="Compacting context",r=n?"Compacting context":"Context compacted",s=t.detailText&&t.detailText!==r?t.detailText:null;return h.jsxs("div",{className:`timeline-item-frame relative min-w-0 w-full overflow-hidden rounded-[1rem] border border-stone-800/80 ${Ni(t.kind)} ${Ri(t.kind)} px-2.5 py-2 sm:rounded-[1.2rem] sm:px-3`,children:[h.jsx("span",{className:"absolute left-0 top-0 z-[1] inline-flex h-5 w-5 items-center justify-center rounded-br-[0.7rem] rounded-tl-[0.95rem] border border-teal-300/30 bg-teal-300/12 text-[10px] text-teal-100 shadow-sm shadow-stone-950/20 sm:hidden",children:h.jsx("span",{className:"scale-[0.78]",children:h.jsx(ET,{})})}),h.jsxs("div",{className:"flex min-w-0 items-center gap-2 pt-2 sm:pt-0",children:[h.jsx("div",{className:"mt-0.5 hidden shrink-0 sm:flex",children:h.jsx("span",{className:"inline-flex h-6 w-6 items-center justify-center rounded-full border border-teal-300/25 bg-teal-300/10 text-teal-100",children:h.jsx(ET,{})})}),h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[h.jsx("p",{className:"timeline-primary-text truncate text-[13px] font-medium sm:text-sm",children:r}),n?h.jsx(sa,{tone:"emerald"}):null]}),s?h.jsx("p",{className:"timeline-meta-text mt-0.5 truncate text-[11px] sm:text-xs",title:s,children:s}):null]})]})]})}),ZG=T.memo(function({item:t,onOpen:n}){var o,c;const r=((o=t.previewText)==null?void 0:o.trim())||t.text||"Web search",s=((c=t.detailText)==null?void 0:c.trim())||t.text||"Web search",l=wc(r);return h.jsxs("div",{className:`timeline-item-frame timeline-mobile-dense-event timeline-mobile-dense-search relative min-w-0 w-full overflow-hidden rounded-[1rem] border ${Ni(t.kind)} ${Ri(t.kind)} px-2.5 py-2.5 sm:rounded-[1.2rem] sm:px-3`,children:[h.jsx("span",{className:`absolute left-0 top-0 z-[1] inline-flex h-5 w-5 items-center justify-center rounded-br-[0.7rem] rounded-tl-[0.95rem] border text-[10px] shadow-sm shadow-stone-950/20 sm:hidden ${va("search")}`,children:h.jsx("span",{className:"scale-[0.78]",children:h.jsx(kT,{})})}),h.jsxs("div",{className:"flex items-start gap-2.5",children:[h.jsx("div",{className:"mt-0.5 hidden shrink-0 items-center sm:flex",children:h.jsx("span",{className:"inline-flex h-6 w-6 items-center justify-center rounded-full border border-sky-300/25 bg-sky-300/10 text-sky-100",children:h.jsx(kT,{})})}),h.jsxs("div",{className:"timeline-item-inner timeline-mobile-dense-inner timeline-mobile-bubble-content relative min-w-0 w-full flex-1 rounded-[0.9rem] border px-2.5 py-2.5 pt-6 sm:rounded-xl sm:px-3 sm:py-2",children:[h.jsx("button",{type:"button","aria-label":"Expand web search",title:"Expand web search",onClick:()=>n("Web Search Details",s),className:`absolute right-0 top-0 inline-flex h-5 w-5 items-center justify-center rounded-bl-[0.7rem] rounded-tr-[0.9rem] border shadow-sm shadow-stone-950/25 transition sm:right-2 sm:top-2 sm:h-7 sm:w-7 sm:rounded-full ${va("action")} hover:bg-stone-800`,children:h.jsx("span",{className:"scale-[0.72] sm:scale-100",children:h.jsx(wG,{})})}),t.status&&h.jsx("p",{className:"timeline-meta-text pr-8 text-xs sm:pr-10",children:t.status}),h.jsx("button",{type:"button","aria-label":"Open full web search",onClick:()=>n("Web Search Details",s),className:"block w-full text-left",children:h.jsxs("div",{className:"timeline-mobile-dense-line flex min-w-0 items-center gap-2 text-sm leading-6",children:[h.jsx("p",{className:"timeline-primary-text min-w-0 flex-1 overflow-hidden whitespace-nowrap text-clip",children:l.firstLine}),l.showGap?h.jsx("span",{className:"timeline-meta-text shrink-0 text-[11px] font-medium tracking-[0.28em]",children:"..."}):null]})})]})]})]})}),JG=T.memo(function({threadId:t,item:n,onOpen:r}){const s=n.assetPath??n.detailText??null,l=t&&s?`/api/threads/${t}/assets/image?path=${encodeURIComponent(s)}`:null;return h.jsxs("div",{className:`timeline-item-frame relative min-w-0 w-full overflow-hidden rounded-[1rem] border ${Ni(n.kind)} ${Ri(n.kind)} px-2.5 py-2.5 sm:rounded-[1.2rem] sm:px-3`,children:[h.jsx("span",{className:`absolute left-0 top-0 z-[1] inline-flex h-5 w-5 items-center justify-center rounded-br-[0.7rem] rounded-tl-[0.95rem] border text-[10px] shadow-sm shadow-stone-950/20 sm:hidden ${va("search")}`,children:h.jsx("span",{className:"scale-[0.78]",children:h.jsx(ST,{})})}),h.jsxs("div",{className:"flex items-start gap-2.5",children:[h.jsx("div",{className:"mt-0.5 hidden shrink-0 items-center sm:flex",children:h.jsx("span",{className:"inline-flex h-6 w-6 items-center justify-center rounded-full border border-indigo-300/25 bg-indigo-300/10 text-indigo-100",children:h.jsx(ST,{})})}),h.jsxs("div",{className:"min-w-0 w-full flex-1",children:[l?h.jsx("button",{type:"button",onClick:()=>r("Image Path",s??n.text),className:"block w-full text-left",children:h.jsx("img",{src:l,alt:n.text||"Image preview",className:"max-h-[24rem] w-full rounded-xl border border-stone-700/80 bg-stone-950 object-contain",loading:"lazy"})}):h.jsx("div",{className:"timeline-item-inner rounded-xl border px-3 py-3 text-sm",children:n.text}),s&&h.jsx("button",{type:"button",onClick:()=>r("Image Path",s),className:"timeline-meta-text mt-2 block max-w-full truncate text-left text-xs hover:text-[var(--theme-fg)]",title:s,children:s}),n.status&&h.jsx("p",{className:"timeline-meta-text mt-1 text-xs",children:n.status})]})]})]})}),eq=T.memo(function({item:t,onOpen:n}){var d,m,p;const r=(d=t.previewText)!=null&&d.trim()&&t.text.trim()!==t.previewText.trim()?t.text.trim():null,s=((m=t.detailText)==null?void 0:m.trim())||null,l=AC(r??((p=t.previewText)==null?void 0:p.trim())??t.text,48),o=mG(t),c=s?"button":"div";return h.jsxs("div",{className:`timeline-item-frame timeline-mobile-dense-event timeline-mobile-dense-file relative min-w-0 w-full overflow-hidden rounded-[1rem] border ${Ni(t.kind)} ${Ri(t.kind)} px-2.5 py-2.5 sm:rounded-[1.2rem] sm:px-3`,children:[h.jsx("span",{className:`absolute left-0 top-0 z-[1] inline-flex h-5 w-5 items-center justify-center rounded-br-[0.7rem] rounded-tl-[0.95rem] border text-[10px] shadow-sm shadow-stone-950/20 sm:hidden ${va("action")}`,children:h.jsx("span",{className:"scale-[0.78]",children:h.jsx(Pf,{})})}),h.jsxs("div",{className:"flex items-start gap-2.5",children:[h.jsx("div",{className:"mt-0.5 hidden shrink-0 items-center sm:flex",children:h.jsx("span",{className:"inline-flex h-6 w-6 items-center justify-center rounded-full border border-lime-300/25 bg-lime-300/10 text-lime-100",children:h.jsx(Pf,{})})}),h.jsx(c,{...s?{type:"button","aria-label":"Open file change details",onClick:()=>n("File Change Details",s)}:{},className:`timeline-item-inner timeline-mobile-dense-inner timeline-mobile-bubble-content min-w-0 flex-1 rounded-[0.9rem] border px-2.5 py-2 text-left sm:rounded-xl sm:px-3 ${s?"transition hover:bg-[var(--theme-hover)] hover:text-[var(--theme-fg)]":""}`,children:h.jsxs("div",{className:"timeline-mobile-file-line flex min-w-0 items-center gap-2",children:[h.jsx("span",{className:"timeline-primary-text min-w-0 flex-1 overflow-hidden whitespace-nowrap text-clip text-sm",title:r??l,children:l}),o.length>0&&h.jsx("div",{className:"inline-flex shrink-0 items-center justify-end gap-1.5 text-xs",children:o.map(g=>h.jsx("span",{className:`timeline-delta-badge border ${g.startsWith("+")?"timeline-delta-badge-add text-emerald-300":g.startsWith("-")?"timeline-delta-badge-remove text-rose-300":"timeline-delta-badge-neutral"}`,children:g},g))})]})})]})]})}),tq=T.memo(function({items:t,expanded:n,onToggleExpanded:r,onOpen:s}){const l=t.reduce((m,p)=>m+(p.changedFiles??0),0),o=t.reduce((m,p)=>m+(p.addedLines??0),0),c=t.reduce((m,p)=>m+(p.removedLines??0),0),d=t.length===1?"1 file change":`${t.length} file changes`;return h.jsxs("div",{className:"timeline-mobile-dense-event timeline-mobile-dense-file relative min-w-0 w-full overflow-hidden rounded-[1rem] border timeline-special-success px-2.5 py-2.5 sm:rounded-[1.2rem] sm:px-3",children:[h.jsx("span",{className:`absolute left-0 top-0 z-[1] inline-flex h-5 w-5 items-center justify-center rounded-br-[0.7rem] rounded-tl-[0.95rem] border text-[10px] shadow-sm shadow-stone-950/20 sm:hidden ${va("action")}`,children:h.jsx("span",{className:"scale-[0.78]",children:h.jsx(Pf,{})})}),h.jsxs("div",{className:"flex items-start gap-2.5",children:[h.jsx("div",{className:"mt-0.5 hidden shrink-0 items-center sm:flex",children:h.jsxs("span",{className:"relative inline-flex h-8 w-8 items-center justify-center rounded-[0.9rem] border border-lime-300/30 bg-lime-300/[0.14] text-lime-100 shadow-sm shadow-stone-950/20",children:[h.jsx(Pf,{}),h.jsx("span",{className:"absolute -right-1 -top-1 inline-flex min-w-[1.1rem] items-center justify-center rounded-full border border-lime-200/35 bg-stone-950/90 px-1 text-[9px] font-semibold leading-4 text-lime-100",children:t.length})]})}),h.jsxs("div",{className:"timeline-batch-inner timeline-mobile-dense-batch timeline-mobile-bubble-content min-w-0 flex-1 rounded-[0.9rem] border px-2 py-1.5 sm:rounded-xl sm:px-3 sm:py-2",children:[h.jsxs("button",{type:"button","aria-expanded":n,"aria-label":`${n?"Collapse":"Expand"} ${t.length} file change entries`,onClick:r,className:"timeline-mobile-dense-toggle flex w-full min-w-0 items-center justify-between gap-3 text-left",children:[h.jsxs("div",{className:"timeline-mobile-dense-summary min-w-0 flex flex-1 flex-wrap items-center gap-2 pr-1",children:[h.jsx("span",{className:"rounded-full border border-lime-300/28 bg-lime-300/12 px-2 py-0.5 text-[10px] font-medium uppercase tracking-[0.24em] text-lime-100",children:"Batch"}),h.jsx("span",{className:"rounded-full border border-stone-700/90 bg-stone-900/80 px-2 py-0.5 text-[10px] font-medium uppercase tracking-[0.16em] text-stone-300",children:d}),l>0&&h.jsxs("span",{className:"timeline-meta-text text-xs",children:[l," files"]})]}),h.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1.5",children:[o>0&&h.jsxs("span",{className:"timeline-delta-badge timeline-delta-badge-add rounded-full border px-1.5 py-0.5 text-[11px] font-medium",children:["+",o]}),c>0&&h.jsxs("span",{className:"timeline-delta-badge timeline-delta-badge-remove rounded-full border px-1.5 py-0.5 text-[11px] font-medium",children:["-",c]})]})]}),n&&h.jsx("div",{className:"timeline-mobile-section-list mt-3 space-y-0 border-t border-lime-300/12 pt-3 sm:space-y-2",children:t.map((m,p)=>{var E,v,k,C;const g=((E=m.detailText)==null?void 0:E.trim())||((v=m.previewText)==null?void 0:v.trim())||m.text,y=(k=m.previewText)!=null&&k.trim()&&m.text.trim()!==m.previewText.trim()?m.text.trim():((C=m.previewText)==null?void 0:C.trim())||m.text;return h.jsx("button",{type:"button","aria-label":`Open grouped file change ${p+1}`,onClick:()=>s(`File Change ${p+1}`,g),className:"timeline-detail-row block w-full rounded-xl border px-3 py-2 text-left transition",children:h.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[h.jsx("span",{className:"timeline-primary-text min-w-0 flex-1 text-sm leading-6",title:y,children:AC(y,34)}),h.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1.5",children:[(m.addedLines??0)>0&&h.jsxs("span",{className:"timeline-delta-badge timeline-delta-badge-add rounded-full border px-1.5 py-0.5 text-[11px] font-medium",children:["+",m.addedLines]}),(m.removedLines??0)>0&&h.jsxs("span",{className:"timeline-delta-badge timeline-delta-badge-remove rounded-full border px-1.5 py-0.5 text-[11px] font-medium",children:["-",m.removedLines]})]})]})},m.id)})})]})]})]})}),nq=T.memo(function({item:t}){return h.jsxs("div",{className:`timeline-item-frame relative min-w-0 w-full overflow-hidden rounded-[1rem] border border-stone-800/80 ${Ni(t.kind)} ${Ri(t.kind)} px-2.5 py-2 sm:rounded-[1.2rem] sm:px-3`,children:[h.jsx("span",{className:`absolute left-0 top-0 z-[1] inline-flex h-5 w-5 items-center justify-center rounded-br-[0.7rem] rounded-tl-[0.95rem] border text-[10px] shadow-sm shadow-stone-950/20 sm:hidden ${va("action")}`,children:h.jsx("span",{className:"scale-[0.78]",children:h.jsx(hg,{})})}),h.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-1.5 leading-none",children:[h.jsx("span",{className:"timeline-meta-text text-[10px] uppercase tracking-[0.16em]",children:SC(t.kind)}),t.status&&h.jsx("span",{className:"timeline-meta-text text-[10px]",children:t.status})]}),h.jsx("pre",{className:`timeline-soft-text mt-1 whitespace-pre-wrap break-words text-[13px] leading-5 ${cG(t.kind)?"max-h-56 overflow-auto":""}`,children:h.jsx(IC,{text:t.text})})]})}),rq=T.memo(function({threadId:t,item:n,scrollRootRef:r,onOpenExpandedText:s,onOpenCommandDetail:l,onOpenToolCallDetail:o}){return pG(n.kind)?h.jsx(Ju,{threadId:t,item:n,scrollRootRef:r}):n.kind==="commandExecution"?h.jsx(qG,{item:n,onOpen:l}):n.kind==="toolCall"?h.jsx(YG,{item:n,onOpen:o}):n.kind==="webSearch"?h.jsx(ZG,{item:n,onOpen:s}):n.kind==="image"?h.jsx(JG,{threadId:t,item:n,onOpen:s}):n.kind==="plan"?h.jsx(XG,{item:n,scrollRootRef:r}):n.kind==="fileChange"?h.jsx(eq,{item:n,onOpen:s}):n.kind==="contextCompaction"?h.jsx(KG,{item:n}):h.jsx(nq,{item:n})});function Qd({request:e,busy:t=!1,onRespond:n}){const[r,s]=T.useState({}),[l,o]=T.useState({}),[c,d]=T.useState(null),m=e.questions[0]??null,p="__other__",g=e.kind==="planDecision"?"Plan":e.kind==="requestUserInput"?"Answer Required":e.title;function y(k){const C=/\s*\(recommended\)\s*$/i.test(k);return{rawLabel:k,displayLabel:k.replace(/\s*\(recommended\)\s*$/i,"").trim(),recommended:C}}function E(k){m&&(d(k),n==null||n(e.id,{answers:{[m.id]:{answers:[k]}}}))}function v(k){const C=r[k.id]??"";return C===p?(l[k.id]??"").trim():C.trim()}return h.jsxs("div",{className:"timeline-pending-card w-full rounded-[1rem] border px-3 py-3 sm:rounded-[1.2rem] sm:px-4",children:[h.jsx("div",{className:"flex items-center justify-between gap-3",children:h.jsxs("div",{children:[h.jsx("p",{className:"timeline-primary-text text-sm font-medium",children:g}),e.kind!=="planDecision"&&e.description&&h.jsx("p",{className:"timeline-soft-text mt-1 text-[13px] leading-5",children:e.description})]})}),h.jsx("div",{className:"mt-3 space-y-3",children:e.questions.map(k=>h.jsxs("div",{className:"timeline-question-section rounded-xl border p-2.5 sm:p-3",children:[h.jsx("p",{className:"timeline-meta-text text-xs uppercase tracking-[0.2em]",children:k.header}),h.jsx("p",{className:"timeline-primary-text mt-1 text-[13px] leading-5 sm:text-sm",children:k.question}),e.kind==="planDecision"&&k.options&&k.options.length>0?h.jsx("div",{className:"mt-3 flex flex-wrap gap-2",children:k.options.map((C,S)=>{const A=y(C.label),N=A.displayLabel.toLowerCase()==="implement";return h.jsxs("button",{type:"button",disabled:t,onClick:()=>E(C.label),className:`relative rounded-2xl border px-2.5 py-1.5 pr-6 text-[12px] leading-4 transition sm:text-[13px] ${S===0?"ui-action-info":"border-stone-700 text-stone-200 hover:bg-stone-800"} disabled:cursor-not-allowed disabled:opacity-60`,title:C.description,children:[A.recommended?h.jsx("span",{"aria-hidden":"true",className:"absolute right-1.5 top-1 inline-flex h-3.5 w-3.5 items-center justify-center rounded-full bg-white/18 text-[10px] leading-none text-current",children:"✦"}):null,t&&c===C.label?N?"Starting...":"Saving...":A.displayLabel]},C.label)})}):k.options&&k.options.length>0?h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[k.options.map(C=>{const S=y(C.label);return h.jsxs("button",{type:"button",disabled:t,onClick:()=>s(A=>({...A,[k.id]:C.label})),className:`relative rounded-2xl border px-3 py-1.5 pr-6 text-[12px] leading-4 transition sm:text-[13px] ${r[k.id]===C.label?"ui-status-warning":"border-stone-700 text-stone-300 hover:bg-stone-800"} disabled:cursor-not-allowed disabled:opacity-60`,title:C.description,children:[S.recommended?h.jsx("span",{"aria-hidden":"true",className:"absolute right-1.5 top-1 inline-flex h-3.5 w-3.5 items-center justify-center rounded-full bg-white/10 text-[10px] leading-none text-amber-100/90",children:"✦"}):null,S.displayLabel]},C.label)}),k.isOther&&h.jsx("button",{type:"button",disabled:t,onClick:()=>s(C=>({...C,[k.id]:p})),className:`rounded-2xl border px-3 py-1.5 text-[12px] leading-4 transition sm:text-[13px] ${r[k.id]===p?"ui-status-info":"border-stone-700 text-stone-300 hover:bg-stone-800"} disabled:cursor-not-allowed disabled:opacity-60`,children:"Not from above"})]}),k.isOther&&r[k.id]===p&&h.jsx("input",{"aria-label":`${k.header} custom answer`,value:l[k.id]??"",onChange:C=>o(S=>({...S,[k.id]:C.target.value})),placeholder:"Enter a custom answer",className:"mt-3 w-full rounded-xl border border-stone-700 bg-stone-900 px-3 py-2 text-sm text-stone-100 outline-none transition focus:border-sky-300"})]}):h.jsx("input",{"aria-label":k.header,value:r[k.id]??"",onChange:C=>s(S=>({...S,[k.id]:C.target.value})),className:"mt-3 w-full rounded-xl border border-stone-700 bg-stone-900 px-3 py-2 text-sm text-stone-100 outline-none transition focus:border-amber-300"})]},k.id))}),e.kind!=="planDecision"&&h.jsx("div",{className:"mt-3 flex justify-end",children:h.jsx("button",{type:"button",disabled:t||e.questions.some(k=>!v(k)),onClick:()=>void(n==null?void 0:n(e.id,{answers:Object.fromEntries(e.questions.map(k=>[k.id,{answers:[v(k)]}]))})),className:"ui-action-info rounded-full px-4 py-2 text-sm font-medium transition disabled:cursor-not-allowed",children:t?"Submitting...":"Submit"})})]})}function Xd({note:e}){return h.jsxs("div",{className:"timeline-note-card w-full rounded-2xl border px-3 py-2.5",children:[h.jsx("p",{className:"timeline-meta-text text-[11px] uppercase tracking-[0.2em]",children:e.title}),h.jsx("div",{className:"mt-1 space-y-1",children:e.summaryLines.map((t,n)=>h.jsxs("p",{className:"timeline-primary-text text-[13px] leading-5",children:["You selected ",t]},`${e.id}-${n}`))})]})}function ao({note:e,onOpenThread:t}){const n=e.kind==="forkCreated"?"Fork":e.kind==="forkSource"?"Fork source":"System",r=e.kind==="forkCreated"?`Thread forked from Turn ${e.turnIndex??"?"}`:e.kind==="forkSource"?`Forked from ${e.linkedThreadTitle??"source thread"} at Turn ${e.turnIndex??"?"}`:e.text??"";return h.jsxs("div",{className:"timeline-activity-card w-full rounded-2xl border px-3 py-2.5",children:[h.jsxs("div",{className:"flex items-center justify-between gap-3",children:[h.jsx("p",{className:"timeline-meta-text text-[11px] uppercase tracking-[0.2em]",children:n}),h.jsx("time",{dateTime:e.createdAt,title:bo(e.createdAt),className:"timeline-meta-text text-[10px]",children:dh(e.createdAt)})]}),h.jsx("p",{className:"timeline-primary-text mt-1 text-[13px] leading-5",children:r}),e.linkedThreadId?h.jsx("button",{type:"button",onClick:()=>{if(t){t(e.linkedThreadId);return}typeof window<"u"&&window.location.assign(`/threads/${e.linkedThreadId}`)},className:"relative z-10 mt-2 inline-flex cursor-pointer rounded-full border border-amber-300/30 px-3 py-1.5 text-xs text-amber-100 transition hover:bg-amber-300/10",children:e.kind==="forkCreated"?"Open fork":"Back to source"}):null]})}const RT=T.memo(function({threadId:t,turn:n,absoluteIndex:r,isCollapsed:s,livePlan:l,liveItems:o,liveOutput:c,onToggleCollapse:d,onOpenExpandedText:m,onOpenCommandDetail:p,onOpenToolCallDetail:g,scrollRootRef:y,articleRef:E}){const v=T.useMemo(()=>yG(n.items,o),[o,n.items]),k=T.useMemo(()=>SG(l,v,n.status),[l,v,n.status]),C=T.useMemo(()=>xG(v,Mf(n.status)),[v,n.status]),S=T.useMemo(()=>TG(C),[C]),A=T.useMemo(()=>EG(c,v),[c,v]),[N,U]=T.useState({}),G=T.useCallback(P=>{U(H=>({...H,[P]:!H[P]}))},[]);return h.jsxs("article",{ref:E,className:"px-2 py-1.5 sm:px-6 sm:py-2",children:[h.jsxs("div",{className:"flex items-start justify-between gap-2",children:[h.jsxs("div",{className:"min-w-0 flex flex-1 items-start gap-1.5",children:[h.jsxs("div",{className:"min-w-0 flex flex-1 items-center gap-1.5 overflow-hidden",children:[h.jsxs("span",{className:"timeline-meta-text rounded-[0.6rem] border border-stone-700 px-1.5 py-0.5 text-[10px] uppercase tracking-[0.16em]",children:["Turn ",r]}),h.jsx("time",{dateTime:n.startedAt??void 0,title:bo(n.startedAt),className:"timeline-meta-text shrink-0 text-[10px] sm:text-[11px]",children:dh(n.startedAt)}),h.jsx(NT,{turn:n}),n.error&&h.jsx("p",{className:"hidden truncate text-[11px] text-rose-200 sm:block",children:n.error})]}),h.jsx(MG,{turn:n})]}),h.jsx("button",{type:"button","aria-label":`${s?"Expand":"Collapse"} turn ${r}`,title:s?"Expand turn":"Collapse turn",onClick:()=>d(n.id),className:"timeline-compact-action timeline-meta-text inline-flex h-5 w-5 shrink-0 items-center justify-center transition hover:text-[var(--theme-fg)]",children:h.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round",children:s?h.jsx("path",{d:"m4.5 10 3.5-3.5L11.5 10"}):h.jsx("path",{d:"m4.5 6 3.5 3.5L11.5 6"})})})]}),n.error&&h.jsx("p",{className:"mt-1 text-[11px] text-rose-200 sm:hidden",children:n.error}),!s&&h.jsxs("div",{className:"mt-1.5 space-y-1.5",children:[S.map(P=>P.kind==="commandGroup"?h.jsx(WG,{items:P.items,expanded:N[P.key]??!1,onToggleExpanded:()=>G(P.key),onOpen:p},P.key):P.kind==="fileChangeGroup"?h.jsx(tq,{items:P.items,expanded:N[P.key]??!1,onToggleExpanded:()=>G(P.key),onOpen:m},P.key):P.kind==="searchGroup"?h.jsx(QG,{items:P.items,expanded:N[P.key]??!1,onToggleExpanded:()=>G(P.key),onOpen:m},P.key):h.jsx(rq,{threadId:t,item:P.item,scrollRootRef:y,onOpenExpandedText:m,onOpenCommandDetail:p,onOpenToolCallDetail:g},P.key)),k&&h.jsxs("div",{className:"timeline-live-plan-card rounded-[1rem] border px-3 py-3 sm:rounded-[1.2rem]",children:[h.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[h.jsx("p",{className:"timeline-primary-text text-sm font-medium",children:"Plan update"}),h.jsx("span",{className:"rounded-full border border-sky-300/40 px-2 py-1 text-[11px] uppercase tracking-[0.2em] text-sky-200",children:"Live"})]}),k.explanation&&h.jsx("p",{className:"timeline-soft-text mt-3 text-sm",children:k.explanation}),h.jsx("div",{className:"mt-3 space-y-2",children:k.plan.map((P,H)=>h.jsxs("div",{className:"timeline-live-plan-step flex items-center justify-between gap-3 rounded-xl border px-3 py-2 text-sm",children:[h.jsx("span",{className:"timeline-primary-text min-w-0 flex-1",children:P.step}),h.jsx(NG,{status:P.status})]},`${k.turnId}-${H}`))})]}),A&&h.jsx(Ju,{item:{id:"live-agent-message",kind:"agentMessage",text:A},scrollRootRef:y,streaming:!0}),Mf(n.status)&&h.jsx(NT,{turn:n,variant:"footer"})]})]})});function aq({threadId:e,turns:t,totalTurnCount:n,pendingRequests:r=[],pendingSteers:s=[],livePlan:l=null,liveItems:o=null,respondingRequestId:c=null,onRespondToRequest:d,liveOutput:m,scrollRequestKey:p=0,bottomSpacer:g=0,className:y="",onTailVisibilityChange:E,loadingEarlier:v=!1,onLoadEarlier:k,ephemeralUserNote:C=null,answeredRequestNotes:S=[],activityNotes:A=[],optimisticSteers:N=[],optimisticTurn:U=null,onLoadHistoryItemDetail:G,onOpenThread:P}){var Ke,$e,nt;const H=T.useRef(null),Y=T.useRef(null),ue=T.useRef(p),M=T.useRef(null),K=T.useRef(g),F=T.useRef(0),ge=T.useRef(null),ce=T.useRef(!0),ne=T.useRef(!0),z=T.useRef(0),ee=T.useRef(new Map),[ke,Be]=T.useState(yT),[L,$]=T.useState(0),[ae,O]=T.useState(null),[_e,Re]=T.useState({}),[we,et]=T.useState(!0),Fe=T.useMemo(()=>JSON.stringify({turns:t.map(Q=>({id:Q.id,status:Q.status,startedAt:Q.startedAt,error:Q.error,items:Q.items.map(ve=>({id:ve.id,kind:ve.kind,status:ve.status,textLength:ve.text.length}))})),pendingRequests:r.map(Q=>({id:Q.id,turnId:Q.turnId,title:Q.title})),pendingSteers:s.map(Q=>({id:Q.id,turnId:Q.turnId,prompt:Q.prompt,clientRequestId:Q.clientRequestId})),optimisticSteers:N.map(Q=>({id:Q.id,turnId:Q.turnId,prompt:Q.prompt,status:Q.status})),liveOutputLength:m.length,livePlan:l===null?null:{turnId:l.turnId,explanation:l.explanation,steps:l.plan.map(Q=>`${Q.status}:${Q.step}`)},liveItems:o===null?null:{turnId:o.turnId,items:o.items.map(Q=>({id:Q.id,kind:Q.kind,status:Q.status,textLength:Q.text.length}))},optimisticTurn:U===null?null:{id:U.id,status:U.status,error:U.error,items:U.items.map(Q=>({id:Q.id,kind:Q.kind,textLength:Q.text.length}))},answeredRequestNotes:S.map(Q=>({id:Q.id,turnId:Q.turnId??null,title:Q.title,createdAt:Q.createdAt??"",summaryLines:Q.summaryLines})),activityNotes:A.map(Q=>({id:Q.id,kind:Q.kind,text:Q.text,createdAt:Q.createdAt})),ephemeralUserNote:C,bottomSpacer:g}),[A,S,g,C,m,o,l,N,U,s,r,t]),Ie=typeof k=="function"||n!==void 0,kt=T.useCallback(Q=>{Re(ve=>({...ve,[Q]:!ve[Q]}))},[]),at=T.useCallback((Q,ve)=>{O({title:Q,text:ve})},[]),Nt=T.useCallback(async(Q,ve)=>{var xt;const ut=((xt=Q.detailText)==null?void 0:xt.trim())||Q.text||"Command output";if(!Q.hasDeferredDetail||!G){O({title:ve,text:ut});return}const He=ee.current.get(Q.id);if(He){O({title:He.title,text:He.text});return}const We=z.current+1;z.current=We,O({title:ve,text:"Loading full command output..."});try{const Ct=await G(Q.id);if(ee.current.set(Q.id,Ct),z.current!==We)return;O({title:Ct.title,text:Ct.text})}catch(Ct){if(z.current!==We)return;O({title:ve,text:Ct instanceof Error?Ct.message:"Unable to load full command output."})}},[G]),Gt=T.useCallback(async(Q,ve)=>{var xt;const ut=((xt=Q.detailText)==null?void 0:xt.trim())||Q.text||"Tool call";if(!Q.hasDeferredDetail||!G){O({title:ve,text:ut});return}const He=ee.current.get(Q.id);if(He){O({title:He.title,text:He.text});return}const We=z.current+1;z.current=We,O({title:ve,text:"Loading full tool call details..."});try{const Ct=await G(Q.id);if(ee.current.set(Q.id,Ct),z.current!==We)return;O({title:Ct.title,text:Ct.text})}catch(Ct){if(z.current!==We)return;O({title:ve,text:Ct instanceof Error?Ct.message:"Unable to load full tool call details."})}},[G]),Ut=T.useCallback(()=>{const Q=H.current,ve=ge.current;if(!Q)return;const ut=ve?_G(Q,ve):h0(Q);ce.current=ut,et(ut)},[]),Tt=T.useCallback(()=>{const Q=H.current;Q&&(ne.current=h0(Q,fg)),Ut()},[Ut]),rt=T.useCallback(()=>{const Q=H.current;Q&&(Q.scrollTop=Q.scrollHeight,F.current=Q.scrollHeight,ce.current=!0,et(!0),ne.current=!0)},[]);T.useEffect(()=>{Be(Q=>Q>=t.length-1?t.length:Math.max(Q,yT))},[t.length]),T.useEffect(()=>{const Q=H.current;Q&&(F.current=Q.scrollHeight,ne.current=h0(Q,fg)),Ut()},[g,S,C,m,o,l,r.length,Ut,t.length,ke]),T.useEffect(()=>{const Q=p!==ue.current,ve=M.current!==Fe;if(M.current=Fe,!(Q||ve&&(we||ne.current)))return;const He=window.requestAnimationFrame(()=>{rt()});return p!==ue.current&&(ue.current=p),()=>{window.cancelAnimationFrame(He)}},[Fe,we,rt,p]),T.useEffect(()=>{const Q=H.current,ve=Y.current;if(!Q||!ve||typeof ResizeObserver>"u")return;F.current=Q.scrollHeight;const ut=new ResizeObserver(()=>{const He=Q.scrollHeight,We=F.current;F.current=He,!(He<=We)&&(ne.current||ce.current)&&window.requestAnimationFrame(()=>{rt()})});return ut.observe(ve),()=>{ut.disconnect()}},[rt]),T.useEffect(()=>{if(!we){K.current=g;return}if(g===K.current)return;K.current=g;const Q=window.requestAnimationFrame(()=>{rt()});return()=>{window.cancelAnimationFrame(Q)}},[g,we,rt]),T.useEffect(()=>{E==null||E(we)},[we,E]);const on=n??t.length,it=Math.max(0,t.length-ke),lt=Ie?t:t.slice(it),ht=Ie?Math.max(0,on-t.length):it,mn=on+1,rn=Ie?Math.max(0,on-t.length):t.length-lt.length,An=!Ie&&rn>0&&L>=2,qt=m&<.length>0?lt.findLastIndex(Q=>ws(Q.status)):-1,Zt=qt<0&&!!m&&!!U&&U.status!=="failed",me=qt>=0||Zt,Ce=new Set(lt.map(Q=>Q.id)),Ze=S.reduce((Q,ve)=>{if(!ve.turnId||!Ce.has(ve.turnId))return Q;const ut=Q.get(ve.turnId)??[];return ut.push(ve),Q.set(ve.turnId,ut),Q},new Map),ot=r.reduce((Q,ve)=>{if(!ve.turnId||!Ce.has(ve.turnId))return Q;const ut=Q.get(ve.turnId)??[];return ut.push(ve),Q.set(ve.turnId,ut),Q},new Map),dt=[...s.map(Q=>({id:Q.id,prompt:Q.prompt,status:"Accepted",createdAt:Q.createdAt})),...N.map(Q=>({id:Q.id,prompt:Q.prompt,status:Q.status==="steering"?"Steering":null,createdAt:Q.createdAt}))].sort((Q,ve)=>Q.createdAt.localeCompare(ve.createdAt)),Qt=S.filter(Q=>!Q.turnId||!Ce.has(Q.turnId)),Ht=r.filter(Q=>!Q.turnId||!Ce.has(Q.turnId)),xe=T.useMemo(()=>{const Q=[...lt.map(We=>({id:We.id,startedAt:We.startedAt??""})),...U?[{id:U.id,startedAt:U.startedAt??""}]:[]],ve=new Map,ut=[],He=[...Qt.map(We=>({kind:"note",id:We.id,createdAt:We.createdAt??"",note:We})),...Ht.map(We=>({kind:"request",id:We.id,createdAt:We.createdAt,request:We}))].sort((We,xt)=>We.createdAt.localeCompare(xt.createdAt));for(const We of He){const xt=Q.find(Qe=>We.createdAt&&Qe.startedAt&&We.createdAt.localeCompare(Qe.startedAt)<=0);if(!xt){ut.push(We);continue}const Ct=ve.get(xt.id)??[];Ct.push(We),ve.set(xt.id,Ct)}return{beforeTurnId:ve,trailing:ut}},[U,r,Qt,Ht,lt]),Le=T.useMemo(()=>{const Q=[...A].sort((yt,Nn)=>yt.createdAt.localeCompare(Nn.createdAt)),ve=[...lt.map(yt=>({id:yt.id,startedAt:yt.startedAt??""})),...U?[{id:U.id,startedAt:U.startedAt??""}]:[]],ut=[],He=new Map,We=new Map,xt=[],Qe=ve.map(yt=>yt.startedAt).filter(yt=>!!yt).sort().at(-1)??null;for(const yt of Q){if(yt.anchorTurnId==="__leading__"){ut.push(yt);continue}if(yt.anchorTurnId){if(ve.some(dn=>dn.id===yt.anchorTurnId)){const dn=We.get(yt.anchorTurnId)??[];dn.push(yt),We.set(yt.anchorTurnId,dn)}else ut.push(yt);continue}const Nn=ve.find(dn=>dn.startedAt&&yt.createdAt.localeCompare(dn.startedAt)<=0);if(!Nn){!Qe||yt.createdAt.localeCompare(Qe)<=0?ut.push(yt):xt.push(yt);continue}const or=He.get(Nn.id)??[];or.push(yt),He.set(Nn.id,or)}return{leading:ut,beforeTurnId:He,afterTurnId:We,trailing:xt}},[A,U,lt]);return h.jsxs(h.Fragment,{children:[h.jsx("section",{className:`flex min-h-0 flex-1 flex-col ${y}`.trim(),children:h.jsx("div",{ref:H,"data-testid":"thread-scroll-container",onScroll:Tt,className:"thread-scroll-container min-h-0 flex-1 overflow-y-auto overscroll-contain",style:g>0?{paddingBottom:g}:void 0,children:h.jsxs("div",{ref:Y,children:[t.length>0&&h.jsx("div",{className:"px-2.5 pb-1 pt-2 sm:px-6 sm:pb-1.5 sm:pt-3",children:h.jsxs("div",{className:"flex flex-wrap items-center gap-2.5 text-xs sm:text-sm",children:[rn>0&&h.jsx("button",{type:"button",onClick:()=>{if(Ie){k==null||k();return}Be(Q=>Math.min(t.length,Q+dG)),$(Q=>Q+1)},disabled:v,className:"rounded-full border border-stone-700 px-2.5 py-1.5 text-stone-300 transition hover:bg-stone-800",children:v?"Loading earlier...":"Load 10 earlier"}),An&&h.jsx("button",{type:"button",onClick:()=>Be(t.length),className:"rounded-full border border-amber-300/40 px-2.5 py-1.5 text-amber-200 transition hover:bg-amber-300/10",children:"Load full history"}),h.jsxs("p",{className:"timeline-meta-text",children:["Showing ",lt.length," of ",on," turns",rn>0?` · ${rn} earlier hidden`:""]})]})}),t.length===0&&!m&&!U&&h.jsx("div",{className:"timeline-meta-text px-2.5 py-8 text-sm sm:px-6",children:"Send the first prompt to start the thread."}),(lt.length>0||U||Le.leading.length>0||Le.trailing.length>0)&&h.jsxs("div",{className:"divide-y divide-stone-800/80",children:[Le.leading.length>0?h.jsx("div",{className:"space-y-3 border-b border-stone-800/80 px-2.5 py-4 sm:px-6",children:Le.leading.map(Q=>h.jsx(ao,{note:Q,onOpenThread:P},Q.id))}):null,lt.map((Q,ve)=>{var ut,He,We,xt,Ct;return h.jsxs("div",{children:[(((ut=Le.beforeTurnId.get(Q.id))==null?void 0:ut.length)??0)>0?h.jsx("div",{className:"space-y-3 border-b border-stone-800/80 px-2.5 py-4 sm:px-6",children:(Le.beforeTurnId.get(Q.id)??[]).map(Qe=>h.jsx(ao,{note:Qe,onOpenThread:P},Qe.id))}):null,(((He=xe.beforeTurnId.get(Q.id))==null?void 0:He.length)??0)>0?h.jsx("div",{className:"space-y-3 border-b border-stone-800/80 px-2.5 py-4 sm:px-6",children:(xe.beforeTurnId.get(Q.id)??[]).map(Qe=>Qe.kind==="note"?h.jsx(Xd,{note:Qe.note},Qe.id):h.jsx(Qd,{request:Qe.request,busy:c===Qe.request.id,onRespond:d??void 0},Qe.id))}):null,h.jsx(RT,{threadId:e,turn:Q,absoluteIndex:ht+ve+1,isCollapsed:_e[Q.id]??!1,livePlan:(l==null?void 0:l.turnId)===Q.id?l:null,liveItems:(o==null?void 0:o.turnId)===Q.id?o.items:null,liveOutput:ve===qt?m:"",onToggleCollapse:kt,onOpenExpandedText:at,onOpenCommandDetail:Nt,onOpenToolCallDetail:Gt,scrollRootRef:H,articleRef:void 0}),(((We=Le.afterTurnId.get(Q.id))==null?void 0:We.length)??0)>0?h.jsx("div",{className:"space-y-3 border-t border-stone-800/80 px-2.5 py-4 sm:px-6",children:(Le.afterTurnId.get(Q.id)??[]).map(Qe=>h.jsx(ao,{note:Qe},Qe.id))}):null,(xt=Ze.get(Q.id))!=null&&xt.length||(Ct=ot.get(Q.id))!=null&&Ct.length?h.jsx("div",{className:"space-y-3 border-t border-stone-800/80 px-2.5 py-4 sm:px-6",children:[...(Ze.get(Q.id)??[]).map(Qe=>({kind:"note",id:Qe.id,createdAt:Qe.createdAt??"",note:Qe})),...(ot.get(Q.id)??[]).map(Qe=>({kind:"request",id:Qe.id,createdAt:Qe.createdAt,request:Qe}))].sort((Qe,yt)=>Qe.createdAt.localeCompare(yt.createdAt)).map(Qe=>Qe.kind==="note"?h.jsx(Xd,{note:Qe.note},Qe.id):h.jsx(Qd,{request:Qe.request,busy:c===Qe.request.id,onRespond:d??void 0},Qe.id))}):null]},Q.id)}),U&&h.jsxs(h.Fragment,{children:[(((Ke=Le.beforeTurnId.get(U.id))==null?void 0:Ke.length)??0)>0?h.jsx("div",{className:"space-y-3 border-b border-stone-800/80 px-2.5 py-4 sm:px-6",children:(Le.beforeTurnId.get(U.id)??[]).map(Q=>h.jsx(ao,{note:Q,onOpenThread:P},Q.id))}):null,((($e=xe.beforeTurnId.get(U.id))==null?void 0:$e.length)??0)>0?h.jsx("div",{className:"space-y-3 border-b border-stone-800/80 px-2.5 py-4 sm:px-6",children:(xe.beforeTurnId.get(U.id)??[]).map(Q=>Q.kind==="note"?h.jsx(Xd,{note:Q.note},Q.id):h.jsx(Qd,{request:Q.request,busy:c===Q.request.id,onRespond:d??void 0},Q.id))}):null,h.jsx(RT,{threadId:e,turn:U,absoluteIndex:mn,isCollapsed:_e[U.id]??!1,livePlan:null,liveItems:null,liveOutput:Zt?m:"",onToggleCollapse:kt,onOpenExpandedText:at,onOpenCommandDetail:Nt,onOpenToolCallDetail:Gt,scrollRootRef:H}),(((nt=Le.afterTurnId.get(U.id))==null?void 0:nt.length)??0)>0?h.jsx("div",{className:"space-y-3 border-t border-stone-800/80 px-2.5 py-4 sm:px-6",children:(Le.afterTurnId.get(U.id)??[]).map(Q=>h.jsx(ao,{note:Q,onOpenThread:P},Q.id))}):null]})]}),dt.length>0&&h.jsx("div",{className:"space-y-3 border-t border-stone-800/80 px-2.5 py-4 sm:px-6",children:dt.map(Q=>h.jsx(Ju,{threadId:e,item:{id:Q.id,kind:"userMessage",text:Q.prompt,status:Q.status},scrollRootRef:H},Q.id))}),(xe.trailing.length>0||Le.trailing.length>0)&&h.jsx("div",{className:"space-y-3 border-t border-stone-800/80 px-2.5 py-4 sm:px-6",children:[...Le.trailing.map(Q=>({kind:"activity",id:Q.id,createdAt:Q.createdAt,note:Q})),...xe.trailing].sort((Q,ve)=>Q.createdAt.localeCompare(ve.createdAt)).map(Q=>Q.kind==="activity"?h.jsx(ao,{note:Q.note,onOpenThread:P},Q.id):Q.kind==="note"?h.jsx(Xd,{note:Q.note},Q.id):h.jsx(Qd,{request:Q.request,busy:c===Q.request.id,onRespond:d??void 0},Q.id))}),C&&h.jsx("div",{className:"border-t border-stone-800/80 px-2.5 py-2.5 sm:px-6",children:h.jsx(Ju,{threadId:e,item:{id:"ephemeral-plan-decision-note",kind:"userMessage",text:C},scrollRootRef:H})}),m&&!me&&h.jsx("div",{className:"border-t border-stone-800/80 px-2.5 py-2.5 sm:px-6",children:h.jsx(Ju,{threadId:e,item:{id:"live-agent-message-fallback",kind:"agentMessage",text:m},scrollRootRef:H,streaming:!0})}),h.jsx("div",{ref:ge,"aria-hidden":"true",className:"h-px w-full"})]})})}),h.jsx(wC,{open:ae!==null,title:(ae==null?void 0:ae.title)??"Full text",text:(ae==null?void 0:ae.text)??"",onClose:()=>{z.current+=1,O(null)}})]})}function I1({open:e,title:t,label:n,value:r,busy:s=!1,onChange:l,onCancel:o,onSubmit:c}){if(T.useEffect(()=>{if(!e)return;function m(p){p.key==="Escape"&&!s&&o()}return window.addEventListener("keydown",m),()=>{window.removeEventListener("keydown",m)}},[s,o,e]),!e)return null;function d(m){m.preventDefault(),c()}return ko.createPortal(h.jsxs("div",{className:"fixed inset-0 z-[95] flex items-center justify-center p-4 sm:p-6",children:[h.jsx("button",{type:"button","aria-label":"Close rename dialog",onClick:o,disabled:s,className:"absolute inset-0 bg-stone-950/78 backdrop-blur-sm disabled:cursor-not-allowed"}),h.jsxs("form",{role:"dialog","aria-modal":"true","aria-label":t,onSubmit:d,className:"relative z-[1] w-full max-w-md rounded-[1.6rem] border border-stone-700 bg-stone-900 p-5 shadow-2xl shadow-stone-950/40 sm:p-6",children:[h.jsxs("div",{className:"flex items-start justify-between gap-3",children:[h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsx("p",{className:"text-sm font-medium text-stone-100",children:t}),h.jsx("p",{className:"mt-1 text-sm text-stone-500",children:"Changes are saved only after confirmation."})]}),h.jsx("button",{type:"button","aria-label":"Close dialog",onClick:o,disabled:s,className:"inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-full border border-stone-700 text-stone-300 transition hover:bg-stone-800 disabled:cursor-not-allowed disabled:opacity-60",children:h.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-4 w-4 fill-current",children:h.jsx("path",{d:"M3.22 2.47 8 7.25l4.78-4.78 1.06 1.06L9.06 8.31l4.78 4.78-1.06 1.06L8 9.37l-4.78 4.78-1.06-1.06 4.78-4.78-4.78-4.78 1.06-1.06Z"})})})]}),h.jsxs("div",{className:"mt-5",children:[h.jsx("label",{htmlFor:"rename-dialog-input",className:"text-sm font-medium text-stone-200",children:n}),h.jsx("input",{id:"rename-dialog-input","aria-label":n,autoFocus:!0,value:r,onChange:m=>l(m.target.value),className:"mt-2 w-full rounded-2xl border border-stone-700 bg-stone-950 px-4 py-3 text-stone-100 outline-none transition focus:border-amber-300"})]}),h.jsxs("div",{className:"mt-5 flex items-center justify-end gap-2",children:[h.jsx("button",{type:"button",onClick:o,disabled:s,className:"rounded-full border border-stone-700 px-4 py-2 text-sm font-medium text-stone-300 transition hover:bg-stone-800 disabled:cursor-not-allowed disabled:opacity-60",children:"Cancel"}),h.jsx("button",{type:"submit",disabled:s||!r.trim(),className:"ui-action-success rounded-full px-4 py-2 text-sm font-medium transition disabled:cursor-not-allowed",children:"Save"})]})]})]}),document.body)}function iq(){return h.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.6",strokeLinecap:"round",children:h.jsx("path",{d:"M8 3.25v9.5M3.25 8h9.5"})})}function sq(){return h.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-current",children:h.jsx("path",{d:"M5.75 1.75c-.97 0-1.75.78-1.75 1.75v.25H3.5c-.97 0-1.75.78-1.75 1.75v6c0 .97.78 1.75 1.75 1.75h4.75c.97 0 1.75-.78 1.75-1.75v-.25h.5c.97 0 1.75-.78 1.75-1.75v-6c0-.97-.78-1.75-1.75-1.75h-4.75Zm-.5 2V3.5c0-.28.22-.5.5-.5h4.75c.28 0 .5.22.5.5v6a.5.5 0 0 1-.5.5H10v-4.5c0-.97-.78-1.75-1.75-1.75h-3Zm-1.75 1.25h4.75c.28 0 .5.22.5.5v6a.5.5 0 0 1-.5.5H3.5a.5.5 0 0 1-.5-.5v-6c0-.28.22-.5.5-.5Z"})})}function lq(){return h.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3 w-3 fill-current",children:h.jsx("path",{d:"M6.1 1.75h3.8c.75 0 1.4.52 1.57 1.25h2.03c.35 0 .63.28.63.63 0 .34-.28.62-.63.62h-.66l-.62 8.03c-.08 1.09-.99 1.97-2.08 1.97H5.86c-1.09 0-2-.88-2.08-1.97l-.62-8.03H2.5a.62.62 0 1 1 0-1.25h2.03c.17-.73.82-1.25 1.57-1.25Zm0 1.25c-.07 0-.14.03-.19.08A.26.26 0 0 0 5.84 3h4.32a.26.26 0 0 0-.07-.17.26.26 0 0 0-.19-.08H6.1Zm-1.07 1.25.61 7.93c.03.44.4.79.84.79h3.04c.44 0 .81-.35.84-.79l.61-7.93H5.03Z"})})}function LT({title:e,defaultOpen:t=!1,children:n}){const[r,s]=T.useState(t);return h.jsxs("section",{className:"border-t border-[var(--theme-border)] pt-4 first:border-t-0 first:pt-0",children:[h.jsxs("button",{type:"button",onClick:()=>s(l=>!l),"aria-expanded":r,className:"flex w-full items-center justify-between gap-3 text-left",children:[h.jsx("span",{className:"text-xs uppercase tracking-[0.28em] text-[var(--theme-fg-muted)]",children:e}),h.jsx("span",{className:"text-xs text-[var(--theme-fg-muted)]",children:r?"Hide":"Show"})]}),r&&h.jsx("div",{className:"mt-3",children:n})]})}function oq({thread:e,currentThreadId:t,currentWorkspaceId:n,workspaceLabels:r={},onOpenThread:s,onBeginRenameThread:l,onDeleteThread:o,showDeleteButton:c=!1,showSessionCopyButton:d=!1}){const[m,p]=T.useState("idle"),g=T.useRef(null),y=r[e.workspaceId],E=t===e.id;T.useEffect(()=>()=>{g.current!==null&&window.clearTimeout(g.current)},[]);async function v(){if(e.codexThreadId)try{await navigator.clipboard.writeText(e.codexThreadId),p("copied"),g.current!==null&&window.clearTimeout(g.current),g.current=window.setTimeout(()=>p("idle"),1200)}catch{p("failed"),g.current!==null&&window.clearTimeout(g.current),g.current=window.setTimeout(()=>p("idle"),1600)}}return h.jsxs("div",{role:"link",tabIndex:0,onClick:()=>s(e.id),onKeyDown:k=>{(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),s(e.id))},className:`thread-sidebar-card relative block rounded-[1.2rem] border px-3 py-2.5 transition ${E?"thread-sidebar-card-active shadow-lg shadow-stone-950/12":""} ${d&&e.codexThreadId?"pb-4":""}`,children:[h.jsxs("div",{className:"flex items-start justify-between gap-3",children:[h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx("p",{className:"min-w-0 w-fit max-w-[calc(100%-2rem)] truncate text-[13px] font-medium leading-5 text-[var(--theme-fg)]",title:e.title,children:e.title}),h.jsx("button",{type:"button",onClick:k=>{k.stopPropagation(),l(e)},"aria-label":`Rename thread ${e.title}`,className:"inline-flex h-4 w-4 shrink-0 items-center justify-center text-[var(--theme-fg-muted)] transition hover:text-[var(--theme-fg)]",children:h.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3 w-3 fill-current",children:h.jsx("path",{d:"m11.9 1.6 2.5 2.5-8.2 8.2-3.3.7.7-3.3 8.3-8.1Zm-7.3 8.7-.3 1.3 1.3-.3 6.9-6.9-1-1-6.9 6.9Zm8.8-7.8-1-1-1 1 1 1 1-1Z"})})}),c&&o&&h.jsx("button",{type:"button",onClick:k=>{k.stopPropagation(),o(e)},"aria-label":`Delete thread ${e.title}`,className:"inline-flex h-4 w-4 shrink-0 items-center justify-center text-rose-300/90 transition hover:text-rose-200",children:h.jsx(lq,{})})]}),y&&!n&&h.jsx("p",{className:"mt-1 truncate text-xs text-[var(--theme-fg-muted)]",children:y})]}),h.jsx("span",{className:`rounded-full border px-2 py-0.5 text-[9px] uppercase tracking-[0.18em] ${uG(e.status)}`,children:kC(e.status)})]}),h.jsxs("div",{className:`mt-2 flex items-center justify-between gap-3 text-[11px] text-[var(--theme-fg-muted)] ${d&&e.codexThreadId?"pr-9":""}`,children:[h.jsx("time",{dateTime:e.lastTurnStartedAt??e.updatedAt,children:dh(e.lastTurnStartedAt??e.updatedAt)}),h.jsx("span",{children:e.model??"No model"})]}),d&&e.codexThreadId&&h.jsx("button",{type:"button","aria-label":"Copy Codex session ID",title:m==="copied"?"Copied":m==="failed"?"Copy failed":"Copy Codex session ID",onClick:k=>{k.stopPropagation(),v()},className:`absolute bottom-2.5 right-2.5 inline-flex h-7 w-7 items-center justify-center rounded-full border shadow-sm shadow-stone-950/25 backdrop-blur transition ${m==="copied"?"border-sky-300/40 bg-sky-300/16 text-sky-100":m==="failed"?"border-rose-300/35 bg-rose-300/12 text-rose-100":"border-[var(--theme-border-strong)] bg-[var(--theme-surface-strong)] text-[var(--theme-fg-soft)] hover:bg-[var(--theme-hover)]"}`,children:h.jsx(sq,{})})]})}function MC({threads:e,currentThreadId:t,currentWorkspaceId:n,workspaceLabels:r={},onOpenThread:s,onBeginRenameThread:l,onDeleteThread:o,scrollable:c=!1,maxHeightClassName:d="max-h-full",showDeleteButton:m=!1,showSessionCopyButton:p=!1}){const g=c?`min-h-0 overflow-y-auto overscroll-contain pr-1 ${d}`:"";return h.jsx("div",{className:g,children:h.jsx("div",{className:"space-y-1.5",children:e.map(y=>h.jsx(oq,{thread:y,currentThreadId:t,currentWorkspaceId:n,workspaceLabels:r,onOpenThread:s,onBeginRenameThread:l,showDeleteButton:m,showSessionCopyButton:p,...o?{onDeleteThread:o}:{}},y.id))})})}function PC({threads:e,status:t,loading:n=!1,error:r,viewportConstrained:s=!1,showMobileAppMenu:l=!0,showMobileThreadNavToggle:o=!0,showMobileNewThreadShortcut:c=!0,mobileHeaderAction:d,currentThreadId:m,currentThreadLabel:p=null,currentWorkspaceId:g=null,currentWorkspaceLabel:y=null,workspaceLabels:E={},metaContent:v,settingsContent:k,onRenameThread:C,children:S}){const[A,N]=T.useState(!1),[U,G]=T.useState(null),[P,H]=T.useState(""),[Y,ue]=T.useState(null),M=wa(),K=hc(),F=T.useMemo(()=>[...g?e.filter(ae=>ae.workspaceId===g):e].sort((ae,O)=>{if(ae.id===m)return-1;if(O.id===m)return 1;const _e=Date.parse(ae.lastTurnStartedAt??ae.updatedAt);return Date.parse(O.lastTurnStartedAt??O.updatedAt)-_e}),[m,g,e]),ge=y??(g?"Current workspace":"All threads"),ce=p&&p.trim()?`${ge} / ${p.trim()}`:ge,ne=g?`/threads/new?workspaceId=${encodeURIComponent(g)}`:"/threads/new";async function z($){if(!C)return;const ae=P.trim();if(ae){ue($);try{await C($,ae),G(null),H("")}finally{ue(null)}}}function ee($){G($.id),H($.title)}function ke(){G(null),H("")}function Be($){M(`/threads/${$}`),N(!1),K==null||K.closeNav()}function L(){return h.jsxs("div",{className:"space-y-4",children:[h.jsxs("section",{children:[h.jsxs("div",{className:"mb-3 flex items-center justify-between gap-3",children:[h.jsx("p",{className:"text-xs uppercase tracking-[0.28em] text-[var(--theme-fg-muted)]",children:"Thread List"}),h.jsxs("div",{className:"flex items-center gap-2",children:[n&&h.jsx("span",{className:"text-xs text-[var(--theme-fg-muted)]",children:"Refreshing..."}),h.jsx(Ci,{to:ne,onClick:()=>{N(!1),K==null||K.closeNav()},className:"inline-flex h-7 items-center rounded-full bg-[var(--theme-accent-solid)] px-2.5 text-[10px] font-medium uppercase tracking-[0.16em] text-[var(--theme-accent-solid-fg)] transition hover:bg-[var(--theme-accent-solid-hover)]",children:"New Thread"})]})]}),r&&h.jsx("div",{className:"rounded-2xl border border-rose-500/30 bg-rose-500/10 px-3 py-3 text-sm text-rose-100",children:r}),!r&&F.length===0&&!n&&h.jsx("div",{className:"rounded-2xl border border-dashed border-[var(--theme-border)] bg-[var(--theme-surface)] px-4 py-6 text-sm text-[var(--theme-fg-muted)]",children:"No threads available in this view."}),F.length>0&&h.jsx(MC,{threads:F,currentThreadId:m,currentWorkspaceId:g,workspaceLabels:E,onOpenThread:Be,onBeginRenameThread:ee})]}),h.jsx(LT,{title:"Thread Meta",defaultOpen:!0,children:v??h.jsx("p",{className:"text-sm text-[var(--theme-fg-muted)]",children:"Select a thread to inspect metadata."})}),h.jsx(LT,{title:"Settings",children:k??h.jsx("p",{className:"text-sm text-[var(--theme-fg-muted)]",children:"No thread settings available."})})]})}return h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:s?"flex h-full max-h-full min-h-0 flex-col gap-2 overflow-hidden overscroll-none sm:gap-4 lg:grid lg:grid-cols-[320px_minmax(0,1fr)] xl:grid-cols-[340px_minmax(0,1fr)]":"flex min-h-[calc(100dvh-2rem)] flex-col gap-4 lg:grid lg:grid-cols-[320px_minmax(0,1fr)] xl:grid-cols-[340px_minmax(0,1fr)]",children:[h.jsx("div",{className:"lg:hidden",children:h.jsxs("div",{className:"relative",children:[h.jsxs("div",{className:`thread-topbar-surface grid h-10 items-center gap-1.5 border-b px-2.5 backdrop-blur ${l&&(c||d)?"grid-cols-[2.5rem_minmax(0,1fr)_auto]":l?"grid-cols-[2.5rem_minmax(0,1fr)]":"grid-cols-[minmax(0,1fr)]"}`,children:[l&&h.jsx(kg,{}),o?h.jsxs("button",{type:"button",onClick:()=>N($=>!$),"aria-expanded":A,"aria-label":A?"Collapse thread navigation":"Expand thread navigation",className:"inline-flex min-w-0 items-center justify-center gap-1 px-1 text-center text-sm font-medium text-[var(--theme-fg)]",title:ce,children:[h.jsx("span",{className:"min-w-0 truncate",children:ce}),h.jsx("span",{"aria-hidden":"true",className:`inline-flex h-4 w-4 shrink-0 items-center justify-center text-[var(--theme-fg-muted)] transition ${A?"rotate-180":""}`,children:h.jsx("svg",{viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:h.jsx("path",{d:"m4.5 6.25 3.5 3.5 3.5-3.5"})})})]}):h.jsx("p",{className:"min-w-0 truncate px-1 text-center text-sm font-medium text-[var(--theme-fg)]",title:ce,children:ce}),l&&(d||(c?h.jsxs(Ci,{to:ne,onClick:()=>{K==null||K.closeNav(),N(!1)},"aria-label":"New Thread",className:"inline-flex h-8 min-w-0 shrink-0 items-center justify-center gap-1 rounded-full bg-[var(--theme-accent-solid)] px-2 text-[10px] font-medium uppercase tracking-[0.16em] text-[var(--theme-accent-solid-fg)] transition hover:bg-[var(--theme-accent-solid-hover)]",children:[h.jsx(iq,{}),h.jsx("span",{className:"hidden sm:inline",children:"New"})]}):null))]}),l&&h.jsx(Cg,{className:"absolute left-2 top-[calc(100%+0.45rem)] z-20 w-[min(18rem,calc(100vw-1rem))]"}),o&&A&&h.jsx("aside",{className:"thread-sidebar-surface absolute inset-x-2 top-[calc(100%+0.35rem)] z-10 max-h-[40dvh] overflow-y-auto rounded-[1.35rem] border p-4 shadow-2xl shadow-stone-950/18 backdrop-blur",children:L()})]})}),h.jsx("aside",{className:"hidden min-h-0 lg:block",children:h.jsx("div",{className:`thread-sidebar-surface sticky top-4 rounded-[2rem] border p-4 shadow-2xl shadow-stone-950/12 backdrop-blur ${s?"h-full max-h-full overflow-y-auto":""}`,children:L()})}),h.jsx("section",{className:s?"flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden":"min-w-0",children:S})]}),h.jsx(I1,{open:U!==null,title:"Rename Thread",label:"Thread Title",value:P,busy:Y!==null,onChange:H,onCancel:ke,onSubmit:()=>U?z(U):void 0})]})}const IT=10,uq=1e3,cq=2e3,p0=5500,dq=3e3,g0=0,io=1,Kd=3,fq=["read-only","workspace-write","danger-full-access"];function hq(e){return e.sandboxMode??(e.approvalMode==="guarded"?"workspace-write":"danger-full-access")}function mq(e,t){const n=new Set(t.map(r=>r.id));return[...t,...e.filter(r=>!n.has(r.id))]}function so(e,t){const n=new Set(t.map(r=>r.id));return[...e.filter(r=>!n.has(r.id)),...t]}function ju(e,t){const n=e.filter(r=>r.id!==t.id);return[t,...n]}function BC(e){return`${e.threadId}:${e.objective}:${e.createdAt}`}function pq(e,t){const n=Date.parse(e.updatedAt)||0,s=(Date.parse(t.updatedAt)||0)>=n?t:e,l=s===t?e:t;return{...s,localGoalId:s.localGoalId??l.localGoalId??null}}function UC(e){const t=new Map;for(const n of e){const r=BC(n),s=t.get(r);t.set(r,s?pq(s,n):n)}return[...t.values()].sort((n,r)=>Date.parse(r.updatedAt)-Date.parse(n.updatedAt))}function Zd(e,t){return UC([t,...e])}function gq(e){const t=new Intl.NumberFormat(void 0,{notation:"compact",maximumFractionDigits:1});return e.tokenBudget===null?`${t.format(e.tokensUsed)} tok`:`${t.format(e.tokensUsed)}/${t.format(e.tokenBudget)} tok`}function bq(e){const t=Math.max(0,Math.floor(e/60)),n=Math.floor(t/60),r=t%60;return n>0?`${n}h ${r}m`:`${t}m`}function OT(e,t){if(!t)return null;const n=e.find(r=>r.model===t);return n?n.supportedReasoningEfforts.length>1:null}function xq(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`client-${Date.now()}-${Math.random().toString(16).slice(2,10)}`}function yq(e,t){return(e==null?void 0:e.items.some(n=>n.kind==="userMessage"&&n.text.trim()===t))??!1}function Eq(e,t,n,r){let s=!1;const l=e.map(o=>o.id!==t?o:(s=!0,{...o,tokenUsage:n,priceEstimate:r}));return s?l:e}function _q(){return h.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-current",children:h.jsx("path",{d:"M5.75 1.75c-.97 0-1.75.78-1.75 1.75v.25H3.5c-.97 0-1.75.78-1.75 1.75v6c0 .97.78 1.75 1.75 1.75h4.75c.97 0 1.75-.78 1.75-1.75v-.25h.5c.97 0 1.75-.78 1.75-1.75v-6c0-.97-.78-1.75-1.75-1.75h-4.75Zm-.5 2V3.5c0-.28.22-.5.5-.5h4.75c.28 0 .5.22.5.5v6a.5.5 0 0 1-.5.5H10v-4.5c0-.97-.78-1.75-1.75-1.75h-3Zm-1.75 1.25h4.75c.28 0 .5.22.5.5v6a.5.5 0 0 1-.5.5H3.5a.5.5 0 0 1-.5-.5v-6c0-.28.22-.5.5-.5Z"})})}function Tq(){return h.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-4 w-4 fill-none stroke-current",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[h.jsx("path",{d:"M4.25 2.25h5.2l2.3 2.3v9.2h-7.5a2 2 0 0 1-2-2v-7.5a2 2 0 0 1 2-2Z"}),h.jsx("path",{d:"M9.25 2.5v2.25h2.25"}),h.jsx("path",{d:"M7 6.75v4"}),h.jsx("path",{d:"m5.45 9.35 1.55 1.55 1.55-1.55"})]})}function Jd({status:e}){return h.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-4.5 w-4.5 fill-none stroke-current",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round",children:[h.jsx("path",{d:"M2.5 6.75A8.22 8.22 0 0 1 8 4.5c2.14 0 4.1.8 5.5 2.25"}),h.jsx("path",{d:"M4.75 9a4.95 4.95 0 0 1 6.5 0"}),h.jsx("path",{d:"M6.9 11.3a1.9 1.9 0 0 1 2.2 0"}),e==="connected"?h.jsx("path",{d:"m6.7 13.2.9.9 1.7-2"}):e==="offline"?h.jsx("path",{d:"M3 3l10 10"}):e==="detached"?null:h.jsxs(h.Fragment,{children:[h.jsx("path",{d:"M11.8 11.1a2.2 2.2 0 0 1-1.8 2.7"}),h.jsx("path",{d:"m10.7 11.35 1.3-.55-.55-1.3"})]})]})}function vq(e,t){if(!e)return"Thread disconnected";switch(t.status){case"connected":return"Realtime updates connected";case"reconnecting":return"Realtime updates reconnecting";case"offline":return"Browser offline";case"checking":return"Checking realtime connection"}}function wq(){const{id:e=""}=zN(),t=wa(),n=T.useRef(""),r=T.useRef(null),s=T.useRef(null),l=T.useRef(null),o=T.useRef(!1),c=T.useRef(null),d=T.useRef(null),m=T.useRef(typeof navigator>"u"?!0:navigator.onLine),p=T.useRef(!1),g=T.useRef(null),y=T.useRef(null),E=T.useRef(0),v=T.useRef(0),k=T.useRef(null),C=T.useRef(null),S=T.useRef(null),[A,N]=T.useState(null),[U,G]=T.useState([]),[P,H]=T.useState([]),[Y,ue]=T.useState(null),[M,K]=T.useState(""),[F,ge]=T.useState(null),[ce,ne]=T.useState(null),[z,ee]=T.useState(!0),[ke,Be]=T.useState(0),[L,$]=T.useState(!0),[ae,O]=T.useState(!1),[_e,Re]=T.useState(!1),[we,et]=T.useState("chat"),[Fe,Ie]=T.useState({prompt:"",attachments:[]}),[kt,at]=T.useState(!1),[Nt,Gt]=T.useState(0),[Ut,Tt]=T.useState(0),[rt,on]=T.useState(0),[it,lt]=T.useState(!1),[ht,mn]=T.useState(null),[rn,An]=T.useState(!1),[qt,Zt]=T.useState(!1),[me,Ce]=T.useState(!1),[Ze,ot]=T.useState(null),[dt,Qt]=T.useState("idle"),[Ht,xe]=T.useState({status:m.current?"checking":"offline",browserOnline:m.current,healthOk:!1,socketOpen:!1,lastHealthyAt:null}),[Le,Ke]=T.useState(null),[$e,nt]=T.useState([]),[Q,ve]=T.useState({status:"idle",data:null,error:null}),[ut,He]=T.useState({status:"idle",data:null,error:null}),[We,xt]=T.useState({status:"idle",data:null,error:null}),[Ct,Qe]=T.useState({status:"idle",data:null,error:null}),[yt,Nn]=T.useState(!1),[or,dn]=T.useState(!1),[Yt,Ss]=T.useState(()=>new Set),[Li,Hr]=T.useState(!1),[Ya,Ii]=T.useState(!1),[Sa,oa]=T.useState({status:"idle",data:null,error:null}),[pr,ft]=T.useState(null),vt=T.useCallback(()=>{const W=n.current;n.current="",r.current=null,W&&K(J=>J+W)},[]),Xn=T.useCallback(W=>{n.current+=W,r.current===null&&(r.current=window.requestAnimationFrame(()=>{vt()}))},[vt]),Tn=T.useCallback(()=>{n.current="",r.current!==null&&(window.cancelAnimationFrame(r.current),r.current=null)},[]);T.useEffect(()=>{ve({status:"idle",data:null,error:null}),He({status:"idle",data:null,error:null}),xt({status:"idle",data:null,error:null}),Qe({status:"idle",data:null,error:null}),Hr(!1),oa({status:"idle",data:null,error:null})},[e]);const Mo=T.useCallback(async()=>{if(e){oa(W=>({status:"loading",data:W.data,error:null}));try{const W=await J5(e);oa({status:"ready",data:W,error:null})}catch(W){const J=W instanceof sn?W.payload.message:"Unable to load export turns.";oa(de=>({status:"failed",data:de.data,error:J}))}}},[e]);async function Po(W){if(e){ft(null),Ii(!0);try{const{blob:J,filename:de}=await t6(e,W),De=URL.createObjectURL(J),Ue=document.createElement("a");Ue.href=De,Ue.download=de,document.body.append(Ue),Ue.click(),Ue.remove(),window.setTimeout(()=>URL.revokeObjectURL(De),3e4),Hr(!1)}catch(J){const de=J instanceof sn?J.payload.message:"Unable to export transcript.";ft(de)}finally{Ii(!1)}}}async function Oi(){if(e){Qe(W=>{var J;return{status:"loading",data:W.data??((J=C.current)==null?void 0:J.goal)??null,error:null}});try{const W=await f6(e);Qe({status:"ready",data:W.goal,error:null}),N(J=>J&&(W.goal?{...J,goal:W.goal,goalHistory:Zd(J.goalHistory??[],W.goal)}:{...J,goal:W.goal}))}catch(W){Qe(J=>({status:"failed",data:J.data,error:W instanceof sn?W.payload.message:"Unable to load goal."}))}}}async function ua(W){if(e){Qe(J=>{var de;return{status:"loading",data:J.data??((de=C.current)==null?void 0:de.goal)??null,error:null}});try{const J=await h6(e,W);Qe({status:"ready",data:J.goal,error:null}),N(de=>de&&(J.goal?{...de,goal:J.goal,goalHistory:Zd(de.goalHistory??[],J.goal)}:{...de,goal:J.goal}))}catch(J){throw Qe(de=>({status:"failed",data:de.data,error:J instanceof sn?J.payload.message:"Unable to update goal."})),J}}}async function As(){if(e){Qe(W=>{var J;return{status:"loading",data:W.data??((J=C.current)==null?void 0:J.goal)??null,error:null}});try{const W=await m6(e);Qe({status:"ready",data:null,error:null}),N(J=>J&&(W.goalHistory?{...J,goal:null,goalHistory:W.goalHistory}:{...J,goal:null}))}catch(W){throw Qe(J=>({status:"failed",data:J.data,error:W instanceof sn?W.payload.message:"Unable to clear goal."})),W}}}async function ca(W){dn(!0);try{await ua({status:W})}finally{dn(!1)}}async function da(){dn(!0);try{await As()}finally{dn(!1)}}async function zr(){if(e){ve(W=>({status:"loading",data:W.data,error:null}));try{const W=await g6(e);ve({status:"ready",data:W,error:null})}catch(W){ve(J=>({status:"failed",data:J.data,error:W instanceof sn?W.payload.message:"Unable to load skills."}))}}}async function Fr(){if(e){He(W=>({status:"loading",data:W.data,error:null}));try{const W=await b6(e);He({status:"ready",data:W,error:null})}catch(W){He(J=>({status:"failed",data:J.data,error:W instanceof sn?W.payload.message:"Unable to load MCP servers."}))}}}async function pn(){if(e){xt(W=>({status:"loading",data:W.data,error:null}));try{const W=await p6(e);xt({status:"ready",data:W,error:null})}catch(W){xt(J=>({status:"failed",data:J.data,error:W instanceof sn?W.payload.message:"Unable to load turns for forking."}))}}}async function Di(){if(!e)return;const W=await NE(e,{mode:"latest"});G(J=>ju(J,W.thread.thread)),t(`/threads/${W.thread.thread.id}`)}async function Wa(W){if(!e)return;const J=await NE(e,{mode:"turn",turnId:W});G(de=>ju(de,J.thread.thread)),t(`/threads/${J.thread.thread.id}`)}const gr=T.useCallback(W=>{const J=S.current,de=J&&Object.keys(J).length>0?{...W,thread:{...W.thread,...J}}:W;C.current=de,ge(de.livePlan??null),ne(de.liveItems??null),Qe(I=>I.status==="idle"?I:{...I,data:de.goal??null});const De=de.thread.activeTurnId===null&&de.thread.status!=="running";N(I=>I&&!de.goalHistory?{...de,turns:so(I.turns,de.turns),...I.goalHistory?{goalHistory:I.goalHistory}:{}}:I?{...de,turns:so(I.turns,de.turns)}:de),G(I=>ju(I,de.thread));const Ue=new Map(de.turns.map(I=>[I.id,I])),pt=new Set((de.pendingSteers??[]).map(I=>I.clientRequestId).filter(I=>!!I));nt(I=>I.filter(fe=>{if(pt.has(fe.clientRequestId))return!1;const Ee=Ue.get(fe.turnId);return!(!Ee||yq(Ee,fe.prompt)||de.thread.activeTurnId!==fe.turnId&&Ee.status!=="inProgress")})),Ke(I=>{if(!I)return I;const fe=I.serverTurnId??I.id;return de.turns.some(Ge=>Ge.id===fe)?null:I}),(De||k.current&&de.turns.some(I=>I.id===k.current))&&(k.current=null,Tn(),K(""),ge(null),ne(null))},[Tn]);T.useEffect(()=>{C.current=A},[A]);const Cr=T.useCallback(async({seedThread:W}={})=>{const J=v.current+1;v.current=J;const[de,De,Ue]=await Promise.allSettled([av(),nv(),rv()]);v.current===J&&(de.status==="fulfilled"?G(W?ju(de.value,W):de.value):W&&G(pt=>ju(pt,W)),De.status==="fulfilled"&&ue(De.value),Ue.status==="fulfilled"&&H(Ue.value))},[]),Aa=T.useCallback(async({showLoading:W=!0,clearError:J=!0,reportError:de=!0}={})=>{const De=E.current+1;E.current=De,W&&$(!0),J&&ft(null);try{const Ue=await CE(e,{limit:IT});if(E.current!==De)return;gr(Ue)}catch(Ue){if(E.current!==De||!de)return;ft(Ue instanceof Error?Ue.message:"Unable to load thread detail.")}finally{E.current===De&&$(!1)}},[gr,e,Cr]),vn=T.useCallback(()=>{var fe;const W=((fe=s.current)==null?void 0:fe.readyState)??Kd,J=W===io,de=m.current,De=Date.now(),Ue=c.current!==null&&De-Date.parse(c.current)<=p0,pt=d.current!==null&&De-d.current<=p0;let I;de?J&&Ue&&pt?I="connected":W===g0||l.current!==null||Ue||pt||o.current?I="reconnecting":I="checking":I="offline",xe(Ee=>Ee.status===I&&Ee.browserOnline===de&&Ee.healthOk===Ue&&Ee.socketOpen===J&&Ee.lastHealthyAt===c.current?Ee:{status:I,browserOnline:de,healthOk:Ue,socketOpen:J,lastHealthyAt:c.current})},[]);T.useEffect(()=>{E.current+=1,v.current+=1,N(null),Ie({prompt:"",attachments:[]}),O(!1),Qt("idle"),Ke(null),nt([]),ne(null),S.current=null,k.current=null,c.current=null,d.current=null,p.current=!1,m.current=typeof navigator>"u"?!0:navigator.onLine,xe({status:m.current?"checking":"offline",browserOnline:m.current,healthOk:!1,socketOpen:!1,lastHealthyAt:null})},[e]),T.useEffect(()=>{if(dt==="idle")return;const W=window.setTimeout(()=>{Qt("idle")},dt==="copied"?1200:1600);return()=>{window.clearTimeout(W)}},[dt]),T.useEffect(()=>{if(typeof document>"u")return;const{documentElement:W,body:J}=document;return W.classList.add("thread-detail-scroll-locked"),J.classList.add("thread-detail-scroll-locked"),()=>{W.classList.remove("thread-detail-scroll-locked"),J.classList.remove("thread-detail-scroll-locked")}},[]),T.useEffect(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;const W=window.matchMedia("(max-width: 639px)"),J=()=>at(W.matches);return J(),W.addEventListener("change",J),()=>{W.removeEventListener("change",J)}},[]),T.useEffect(()=>{var J,de;if(typeof window>"u")return;const W=()=>{const De=window.visualViewport,Ue=De?Math.max(0,Math.round(window.innerHeight-De.height-De.offsetTop)):0;on(Ue),document.documentElement.style.setProperty("--thread-detail-keyboard-inset",`${Ue}px`)};return W(),(J=window.visualViewport)==null||J.addEventListener("resize",W),(de=window.visualViewport)==null||de.addEventListener("scroll",W),window.addEventListener("resize",W),()=>{var De,Ue;(De=window.visualViewport)==null||De.removeEventListener("resize",W),(Ue=window.visualViewport)==null||Ue.removeEventListener("scroll",W),window.removeEventListener("resize",W),document.documentElement.style.removeProperty("--thread-detail-keyboard-inset")}},[]),T.useEffect(()=>{if(typeof document>"u")return;const W=()=>{const J=document.activeElement,de=y.current,De=de==null?void 0:de.querySelector('[aria-label="Prompt"]');lt(!!(J&&De&&(J===De||De.contains(J))))};return W(),document.addEventListener("focusin",W),document.addEventListener("focusout",W),()=>{document.removeEventListener("focusin",W),document.removeEventListener("focusout",W)}},[we,A==null?void 0:A.thread.id,kt]),T.useEffect(()=>{const W=y.current;if(!W||typeof ResizeObserver>"u")return;const J=W.querySelector("form")??W,de=()=>{Gt(Math.max(W.getBoundingClientRect().height,J.getBoundingClientRect().height))};de();const De=new ResizeObserver(()=>{de()});return De.observe(J),()=>{De.disconnect()}},[we,kt]),T.useEffect(()=>{var De,Ue;const W=y.current;if(!W||!kt||we!=="chat"){Tt(0);return}const J=()=>{const pt=W.getBoundingClientRect();Tt(Math.max(0,Math.ceil(window.innerHeight-pt.top)))};J(),window.addEventListener("resize",J),(De=window.visualViewport)==null||De.addEventListener("resize",J),(Ue=window.visualViewport)==null||Ue.addEventListener("scroll",J);let de=null;return typeof ResizeObserver<"u"&&(de=new ResizeObserver(J),de.observe(W)),()=>{var pt,I;window.removeEventListener("resize",J),(pt=window.visualViewport)==null||pt.removeEventListener("resize",J),(I=window.visualViewport)==null||I.removeEventListener("scroll",J),de==null||de.disconnect()}},[we,A==null?void 0:A.thread.id,kt,rt,it]),T.useEffect(()=>{Aa({showLoading:!0}),Cr()},[Cr,Aa]),T.useEffect(()=>{let W=!1,J=null;const de=()=>{Aa({showLoading:!1,clearError:!1,reportError:!1})},De=()=>{l.current!==null&&(window.clearTimeout(l.current),l.current=null)},Ue=()=>{W||!m.current||l.current!==null||(l.current=window.setTimeout(()=>{l.current=null,!W&&Ee()},uq),vn())},pt=()=>{const pe=s.current;if(s.current=null,pe)try{pe.close()}catch{}},I=pe=>{if(pe.threadId===e){if(pe.type==="thread.output.delta"&&typeof pe.payload.delta=="string"){const Ae=typeof pe.payload.turnId=="string"?pe.payload.turnId:null;Xn(pe.payload.delta),Ae&&Ke(Pe=>Pe&&(Pe.serverTurnId===null||Pe.serverTurnId===Ae)?{...Pe,serverTurnId:Ae,id:Ae,status:Pe.status==="failed"?Pe.status:"inProgress",tokenUsage:Pe.tokenUsage}:Pe)}if(pe.type==="thread.context.updated"){const Ae=pe.payload.contextUsage&&typeof pe.payload.contextUsage=="object"?pe.payload.contextUsage:null;if(Ae){const Pe=Ae;N(mt=>mt&&{...mt,thread:{...mt.thread,contextUsage:Pe}}),G(mt=>mt.map(ze=>ze.id===e?{...ze,contextUsage:Pe}:ze))}}if(pe.type==="thread.turn.token.updated"&&typeof pe.payload.turnId=="string"&&pe.payload.tokenUsage&&typeof pe.payload.tokenUsage=="object"){const Ae=pe.payload.turnId,Pe=pe.payload.tokenUsage,mt=pe.payload.priceEstimate&&typeof pe.payload.priceEstimate=="object"?pe.payload.priceEstimate:null;N(ze=>{if(!ze)return ze;const Et=Eq(ze.turns,Ae,Pe,mt);return Et===ze.turns?ze:{...ze,turns:Et}}),Ke(ze=>ze&&(ze.serverTurnId===Ae||ze.id===Ae)?{...ze,tokenUsage:Pe,priceEstimate:mt}:ze)}if(pe.type==="thread.turn.started"||pe.type==="thread.turn.completed"||pe.type==="thread.turn.failed"||pe.type==="thread.updated"||pe.type==="thread.goal.updated"||pe.type==="thread.goal.cleared"||pe.type==="thread.request.created"||pe.type==="thread.request.resolved"){if(pe.type==="thread.goal.updated"){const Ae=pe.payload.goal&&typeof pe.payload.goal=="object"?pe.payload.goal:null,Pe=Array.isArray(pe.payload.goalHistory)?pe.payload.goalHistory:null;Qe({status:"ready",data:Ae,error:null}),N(mt=>mt&&(Pe?{...mt,goal:Ae,goalHistory:Pe}:Ae?{...mt,goal:Ae,goalHistory:Zd(mt.goalHistory??[],Ae)}:{...mt,goal:Ae}))}if(pe.type==="thread.goal.cleared"){const Ae=Array.isArray(pe.payload.goalHistory)?pe.payload.goalHistory:null;Qe({status:"ready",data:null,error:null}),N(Pe=>Pe&&(Ae?{...Pe,goal:null,goalHistory:Ae}:{...Pe,goal:null}))}if(de(),pe.type==="thread.turn.started"){Tn(),K(""),ne(null),k.current=null;const Ae=typeof pe.payload.turnId=="string"?pe.payload.turnId:null;Ae&&Ke(Pe=>Pe&&{...Pe,serverTurnId:Ae,id:Ae,status:Pe.status==="failed"?Pe.status:"inProgress",error:null,tokenUsage:Pe.tokenUsage})}if(pe.type==="thread.turn.completed"||pe.type==="thread.turn.failed"){ne(null);const Ae=typeof pe.payload.turnId=="string"?pe.payload.turnId:null;Ae&&(k.current=Ae,pe.type==="thread.turn.failed"&&Ke(Pe=>Pe&&(Pe.serverTurnId===Ae||Pe.id===Ae)?{...Pe,status:"failed",error:typeof pe.payload.error=="string"?pe.payload.error:"Unable to complete the turn.",tokenUsage:Pe.tokenUsage}:Pe))}}if((pe.type==="thread.item.started"||pe.type==="thread.item.completed")&&pe.payload.item&&typeof pe.payload.item=="object"&&typeof pe.payload.turnId=="string"){const Ae=pe.payload.turnId,Pe=pe.payload.item;typeof Pe.id=="string"&&typeof Pe.text=="string"&&ne(mt=>{const Et=[...((mt==null?void 0:mt.turnId)===Ae?mt.items:[]).filter(un=>un.id!==Pe.id),Pe];return{turnId:Ae,items:Et,updatedAt:new Date().toISOString()}})}pe.type==="thread.plan.updated"&&Array.isArray(pe.payload.plan)&&ge({turnId:String(pe.payload.turnId??""),explanation:typeof pe.payload.explanation=="string"?pe.payload.explanation:null,plan:pe.payload.plan})}},fe=()=>{const pe=s.current;if(!(!pe||pe.readyState!==io))try{pe.send(JSON.stringify({type:"supervisor.ping",timestamp:new Date().toISOString()}))}catch{p.current=!0,pt(),Ue(),vn()}},Ee=()=>{var Pe;if(W||!m.current){vn();return}const pe=((Pe=s.current)==null?void 0:Pe.readyState)??Kd;if(pe===g0||pe===io){vn();return}const Ae=sv(I);s.current=Ae,vn(),Ae.addEventListener("message",mt=>{if(s.current===Ae)try{const ze=JSON.parse(mt.data);(ze.type==="supervisor.connected"||ze.type==="supervisor.pong")&&(d.current=Date.now(),vn())}catch{}}),Ae.addEventListener("open",()=>{s.current===Ae&&(p.current=!0,de(),fe(),vn())}),Ae.addEventListener("close",()=>{s.current===Ae&&(s.current=null),p.current=!0,Ue(),vn()}),Ae.addEventListener("error",()=>{s.current===Ae&&(s.current=null),p.current=!0,Ue(),vn()})},Ge=async()=>{var pe;if(!(W||!m.current||o.current)){o.current=!0,vn();try{await K5();const Ae=p.current;c.current=new Date().toISOString(),Ae&&(p.current=!1,de()),(((pe=s.current)==null?void 0:pe.readyState)??Kd)!==io&&Ee()}catch{c.current=null,p.current=!0,Ue()}finally{o.current=!1,vn()}}},qe=()=>{m.current=!0,p.current=!0,vn(),Ee(),Ge()},je=()=>{m.current=!1,c.current=null,d.current=null,p.current=!0,De(),pt(),vn()},Me=()=>{var Pe;if(W||!m.current){vn();return}const pe=((Pe=s.current)==null?void 0:Pe.readyState)??Kd,Ae=d.current===null?null:Date.now()-d.current;pe===io&&Ae!==null&&Ae>p0?(p.current=!0,pt(),Ue()):pe===io?fe():pe!==g0&&Ee(),Ge(),vn()};return window.addEventListener("online",qe),window.addEventListener("offline",je),Ee(),Ge(),J=window.setInterval(Me,cq),()=>{W=!0,window.removeEventListener("online",qe),window.removeEventListener("offline",je),De(),J!==null&&window.clearInterval(J),Tn(),pt()}},[Tn,e,Aa,Xn,vn]),T.useEffect(()=>{if(!((A==null?void 0:A.thread.activeTurnId)!==null||(A==null?void 0:A.thread.status)==="running"||Le!==null||$e.length>0||M.length>0||F!==null||ce!==null))return;const J=window.setInterval(()=>{Aa({showLoading:!1,clearError:!1,reportError:!1})},dq);return()=>{window.clearInterval(J)}},[A==null?void 0:A.thread.activeTurnId,A==null?void 0:A.thread.status,M.length,ce,F,Aa,$e.length,Le]);async function yl(){var W;if(!(!A||A.turns.length===0||ae)){O(!0),ft(null);try{const J=(W=A.turns[0])==null?void 0:W.id,de=await CE(e,{limit:IT,...J?{beforeTurnId:J}:{}});N(De=>De?{...de,turns:mq(De.turns,de.turns)}:de),G(De=>De.map(Ue=>Ue.id===de.thread.id?de.thread:Ue))}catch(J){ft(J instanceof Error?J.message:"Unable to load earlier turns.")}finally{O(!1)}}}async function Sr(W){var Ge,qe;if(we==="shell"){if((A==null?void 0:A.thread.isLoaded)===!1){await fa({attachShell:!0});return}const je=((Ge=g.current)==null?void 0:Ge.sendCommand(W.prompt))??!1;ft(je?null:"Connect the shell before sending commands.");return}Re(!0),ft(null),Be(je=>je+1);const J=C.current,de=J?{...J.thread,...S.current??{}}:null,De=(de==null?void 0:de.model)??null,Ue=(de==null?void 0:de.reasoningEffort)??null,pt=xq(),I=`optimistic-${Date.now()}`,fe=`optimistic-steer-${pt}`,Ee=new Date().toISOString();try{let je=C.current;if(je&&!je.thread.isLoaded){const Et={...je.thread,...S.current??{}},un=await SE(e,{...je.thread.model?{model:je.thread.model}:{},...je.thread.sandboxMode?{sandboxMode:je.thread.sandboxMode}:{}}),In={...un,thread:{...un.thread,model:Et.model??un.thread.model,reasoningEffort:Et.reasoningEffort??un.thread.reasoningEffort,collaborationMode:Et.collaborationMode??un.thread.collaborationMode,sandboxMode:Et.sandboxMode??un.thread.sandboxMode??null}};je=In,C.current=In,N(vl=>vl?{...In,turns:so(vl.turns,In.turns)}:In),G(vl=>vl.map(kc=>kc.id===In.thread.id?In.thread:kc))}const Me=je?{...je.thread,...S.current??{}}:null,pe=(Me==null?void 0:Me.status)==="running"?Me.activeTurnId:null,Ae=we==="chat"&&!!pe;Ae&&pe?nt(Et=>[...Et,{id:fe,clientRequestId:pt,turnId:pe,prompt:W.prompt,createdAt:Ee,status:"steering"}]):(Tn(),K(""),Ke({id:I,serverTurnId:null,startedAt:Ee,status:"sending",error:null,prompt:W.prompt,model:De,reasoningEffort:Ue,reasoningEffortAvailable:OT(P,De),tokenUsage:null,priceEstimate:null}));const Pe={prompt:W.prompt,clientRequestId:pt,...Me!=null&&Me.model?{model:Me.model}:{},...Me!=null&&Me.reasoningEffort?{reasoningEffort:Me.reasoningEffort}:{},...Me!=null&&Me.collaborationMode?{collaborationMode:Me.collaborationMode}:{},...Me!=null&&Me.sandboxMode?{sandboxMode:Me.sandboxMode}:{},...(qe=W.attachments)!=null&&qe.length?{attachments:W.attachments}:{}},mt=await o6(e,Pe),ze=S.current&&Object.keys(S.current).length>0?{...mt,...S.current}:mt;N(Et=>Et&&{...Et,thread:ze}),G(Et=>Et.map(un=>un.id===ze.id?ze:un)),Ae&&pe?ze.activeTurnId!==null&&ze.activeTurnId!==pe&&ze.lastTurnStartedAt!==(Me==null?void 0:Me.lastTurnStartedAt)?(Tn(),K(""),ge(null),nt(un=>un.filter(In=>In.id!==fe)),Ke({id:I,serverTurnId:ze.activeTurnId,startedAt:ze.lastTurnStartedAt??Ee,status:"inProgress",error:null,prompt:W.prompt,model:De,reasoningEffort:Ue,reasoningEffortAvailable:OT(P,De),tokenUsage:null,priceEstimate:null})):nt(un=>un.map(In=>In.id===fe?{...In,turnId:ze.activeTurnId??In.turnId,status:"accepted"}:In)):(Ke(Et=>Et&&Et.id===I?{...Et,id:ze.activeTurnId??Et.id,serverTurnId:ze.activeTurnId??Et.serverTurnId,status:"inProgress",error:null,tokenUsage:Et.tokenUsage,priceEstimate:Et.priceEstimate}:Et),ge(null)),Ie({prompt:"",attachments:[]})}catch(je){const Me=je instanceof sn?je.payload.message:je instanceof Error?je.message:"Unable to send prompt.";je instanceof sn?ft(je.payload.message):ft(Me),nt(pe=>pe.filter(Ae=>Ae.clientRequestId!==pt)),Ke(pe=>pe&&pe.id===I?{...pe,status:"failed",error:Me}:pe)}finally{Re(!1)}}async function Qa(){const W=A==null?void 0:A.thread.codexThreadId;if(W)try{await navigator.clipboard.writeText(W),Qt("copied")}catch{Qt("failed")}}async function fa(W){if(A){Re(!0),ft(null),Tn(),K("");try{if(A.thread.isLoaded){const de=await l6(e);N(De=>De?{...de,turns:so(De.turns,de.turns)}:de),mn(null),G(De=>De.map(Ue=>Ue.id===de.thread.id?de.thread:Ue)),An(!1);return}const J=await SE(e,{...A.thread.model?{model:A.thread.model}:{},...A.thread.sandboxMode?{sandboxMode:A.thread.sandboxMode}:{}});N(de=>de?{...J,turns:so(de.turns,J.turns)}:J),G(de=>de.map(De=>De.id===J.thread.id?J.thread:De)),W!=null&&W.attachShell&&we==="shell"&&An(!0)}catch(J){ft(J instanceof Error?J.message:"Unable to change connection state.")}finally{Re(!1)}}}async function tr(){var W;if(we==="shell"){const J=((W=g.current)==null?void 0:W.sendControl("ctrl_c"))??!1;ft(J?null:"Connect the shell before sending Ctrl-C.");return}Re(!0),ft(null);try{const J=A!=null&&A.thread.activeTurnId?await AE(e,{turnId:A.thread.activeTurnId}):await AE(e);N(de=>de&&{...de,thread:J}),G(de=>de.map(De=>De.id===J.id?J:De)),Tn(),K("")}catch(J){ft(J instanceof Error?J.message:"Unable to interrupt turn.")}finally{Re(!1)}}async function Vn(W){if(!A)return;const J=A,de={...S.current??{},...W.model!==void 0?{model:W.model}:{},...W.reasoningEffort!==void 0?{reasoningEffort:W.reasoningEffort}:{},...W.fastMode!==void 0?{fastMode:W.fastMode}:{},...W.collaborationMode!==void 0?{collaborationMode:W.collaborationMode}:{},...W.sandboxMode!==void 0?{sandboxMode:W.sandboxMode}:{}},De={...A.thread,...de};Zt(!0),S.current=de,C.current={...A,thread:De},N(Ue=>Ue&&{...Ue,thread:De}),G(Ue=>Ue.map(pt=>pt.id===De.id?{...pt,...De}:pt));try{const Ue=await c6(e,{...W.model!==void 0?{model:W.model}:{},...W.reasoningEffort!==void 0?{reasoningEffort:W.reasoningEffort}:{},...W.fastMode!==void 0?{fastMode:W.fastMode}:{},...W.collaborationMode!==void 0?{collaborationMode:W.collaborationMode}:{},...W.sandboxMode!==void 0?{sandboxMode:W.sandboxMode}:{}});S.current=null,C.current=J?{...J,thread:Ue}:null,N(pt=>pt&&{...pt,thread:Ue}),G(pt=>pt.map(I=>I.id===Ue.id?Ue:I))}catch(Ue){S.current=null,C.current=J,N(J),G(pt=>pt.map(I=>I.id===J.thread.id?J.thread:I)),ft(Ue instanceof Error?Ue.message:"Unable to update thread settings.")}finally{Zt(!1)}}async function ji(W,J){ot(W),ft(null);try{const de=await x6(e,W,J);N(De=>De?{...de,turns:so(De.turns,de.turns)}:de),ge(de.livePlan??null),ne(de.liveItems??null)}catch(de){ft(de instanceof Error?de.message:"Unable to answer this request.")}finally{ot(null)}}async function Ns(){if(A){Ce(!0),ft(null);try{const W=await d6(e);N(J=>J&&{...J,thread:W}),G(J=>J.map(de=>de.id===W.id?W:de))}catch(W){ft(W instanceof Error?W.message:"Unable to compact this thread context.")}finally{Ce(!1)}}}async function Mi(W,J){try{const de=await iv(W,{title:J});G(De=>De.map(Ue=>Ue.id===de.id?{...Ue,title:de.title,updatedAt:de.updatedAt}:Ue)),N(De=>De&&De.thread.id===de.id?{...De,thread:{...De.thread,title:de.title,updatedAt:de.updatedAt}}:De)}catch(de){throw ft(de instanceof Error?de.message:"Unable to rename thread."),de}}function Xa(){et(W=>W==="chat"?(A!=null&&A.thread.isLoaded&&An(!0),"shell"):"chat")}async function ha(){var J;const W=await((J=g.current)==null?void 0:J.copyLastCommandOutput());ft(W?null:"Unable to copy the last shell command output.")}function Pi(W){var de,De;const J=W==="clear"?((de=g.current)==null?void 0:de.sendCommand("clear"))??!1:((De=g.current)==null?void 0:De.sendControl(W))??!1;ft(J?null:"Connect the shell before sending control input.")}T.useEffect(()=>{if(!(!rn||we!=="shell"||!g.current||(A==null?void 0:A.thread.isLoaded)===!1||(ht==null?void 0:ht.loading)!==!1)){if((ht==null?void 0:ht.status)==="attached"){An(!1);return}An(!1),g.current.toggleConnection()}},[we,A==null?void 0:A.thread.isLoaded,rn,ht==null?void 0:ht.loading,ht==null?void 0:ht.status]),T.useEffect(()=>{if(we!=="shell")return;const W=window.requestAnimationFrame(()=>{var J;(J=g.current)==null||J.refreshLayout({focus:!0})});return()=>{window.cancelAnimationFrame(W)}},[we]);const Rn=A&&A.workspacePathStatus==="missing"?"Restore this workspace path on the current machine before continuing.":null,Ln=kt&&we==="chat",Rs=Ln&&it?rt:0,Bi=Math.max(Nt,144),Na=Math.max(Ut,Bi+Rs),El=Ln?Na+12:0,_l=A?h.jsxs("dl",{className:"space-y-4 text-sm",children:[h.jsxs("div",{className:"relative pr-9",children:[h.jsx("dt",{className:"text-stone-500",children:"Session ID"}),h.jsx("dd",{className:"mt-1 break-all text-stone-100",children:A.thread.codexThreadId??"Unavailable"}),A.thread.codexThreadId&&h.jsx("button",{type:"button","aria-label":"Copy Codex session ID",title:dt==="copied"?"Copied":dt==="failed"?"Copy failed":"Copy Codex session ID",onClick:()=>void Qa(),className:`thread-mobile-hit-target absolute bottom-0 right-0 inline-flex h-5 w-5 items-center justify-center rounded-full border shadow-sm shadow-stone-950/25 backdrop-blur transition ${dt==="copied"?"ui-status-info":dt==="failed"?"ui-status-danger":"border-stone-700/90 bg-stone-900/60 text-stone-300 hover:bg-stone-800/92"}`,children:h.jsx("span",{className:"scale-[0.72]",children:h.jsx(_q,{})})})]}),h.jsxs("div",{children:[h.jsx("dt",{className:"text-stone-500",children:"Source"}),h.jsx("dd",{className:"mt-1 text-stone-100",children:A.thread.source==="local_codex_import"?"Imported local Codex session":"Supervisor thread"})]}),h.jsxs("div",{children:[h.jsx("dt",{className:"text-stone-500",children:"Status"}),h.jsx("dd",{className:"mt-1 text-stone-100",children:kC(A.thread.status)})]}),h.jsxs("div",{children:[h.jsx("dt",{className:"text-stone-500",children:"Created"}),h.jsx("dd",{className:"mt-1 text-stone-100",children:bo(A.thread.createdAt)})]}),h.jsxs("div",{children:[h.jsx("dt",{className:"text-stone-500",children:"Workspace"}),h.jsx("dd",{className:"mt-1 break-words text-stone-100",children:A.workspace.absPath})]}),h.jsxs("div",{children:[h.jsx("dt",{className:"text-stone-500",children:"Workspace path"}),h.jsx("dd",{className:"mt-1 text-stone-100",children:A.workspacePathStatus==="present"?"Present":"Missing on this machine"})]}),h.jsxs("div",{children:[h.jsx("dt",{className:"text-stone-500",children:"Active turn"}),h.jsx("dd",{className:"mt-1 text-stone-100",children:A.thread.activeTurnId??"None"})]})]}):null,Ra=A?h.jsx("div",{className:"space-y-3",children:h.jsxs("div",{children:[h.jsx("p",{className:"text-xs uppercase tracking-[0.2em] text-stone-500",children:"Sandbox Mode"}),h.jsx("div",{className:"mt-2 space-y-1.5",children:fq.map(W=>{const J=hq(A.thread)===W;return h.jsx("button",{type:"button",disabled:qt,onClick:()=>void Vn({sandboxMode:W}),className:`block w-full rounded-xl border px-3 py-2 text-left text-sm transition ${J?"ui-status-warning":"border-stone-800 bg-stone-950/40 text-stone-300 hover:bg-stone-800/80"} disabled:cursor-not-allowed disabled:opacity-60`,children:W},W)})})]})}):null,Bo=Le&&!(A!=null&&A.turns.some(W=>W.id===(Le.serverTurnId??Le.id)))?{id:Le.id,startedAt:Le.startedAt,status:Le.status,error:Le.error,model:Le.model,reasoningEffort:Le.reasoningEffort,reasoningEffortAvailable:Le.reasoningEffortAvailable,tokenUsage:Le.tokenUsage,priceEstimate:Le.priceEstimate,items:[{id:`${Le.id}-user-message`,kind:"userMessage",text:Le.prompt}]}:null,La=(A==null?void 0:A.thread.isLoaded)??!1,Ka=La?Ht.status==="connected"?"ui-action-success shadow-lg shadow-stone-950/20":Ht.status==="reconnecting"?"thread-live-connection-reconnecting ui-status-success shadow-lg shadow-stone-950/20":Ht.status==="offline"?"ui-status-danger shadow-lg shadow-stone-950/20":"ui-status-warning shadow-lg shadow-stone-950/20":"border border-stone-700/90 bg-stone-900/85 text-stone-400 shadow-lg shadow-stone-950/20",Za=vq(La,Ht),ma=[Za,La?null:"Tap to connect this thread",Ht.lastHealthyAt?`Last healthy ${bo(Ht.lastHealthyAt)}`:null].filter(Boolean).join(" · "),Tl=La?h.jsx("div",{role:"status","aria-live":"polite","aria-label":Za,title:ma,className:`inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full transition ${Ka}`,children:h.jsx(Jd,{status:Ht.status})}):h.jsx("button",{type:"button",onClick:()=>void fa(),disabled:_e||!A,"aria-label":_e?"Connecting thread":"Connect thread",title:_e?"Connecting thread":ma,className:`inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full transition ${Ka}`,children:h.jsx(Jd,{status:"detached"})}),Ja=La?h.jsx("div",{title:ma,className:`hidden lg:inline-flex h-9 w-9 items-center justify-center rounded-full transition ${Ka}`,children:h.jsx(Jd,{status:Ht.status})}):h.jsx("button",{type:"button",onClick:()=>void fa(),disabled:_e||!A,title:_e?"Connecting thread":ma,className:`hidden lg:inline-flex h-9 w-9 items-center justify-center rounded-full transition ${Ka}`,children:h.jsx(Jd,{status:"detached"})}),br=Ct.data??(A==null?void 0:A.goal)??null,Ui=(A==null?void 0:A.goalHistory)??[],ei=br?Zd(Ui,br):UC(Ui),Ia=h.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-4 w-4 fill-none stroke-current",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[h.jsx("circle",{cx:"8",cy:"8",r:"5.5"}),h.jsx("circle",{cx:"8",cy:"8",r:"2"}),h.jsx("path",{d:"M8 1.7v2M8 12.3v2M1.7 8h2M12.3 8h2"})]}),$r=yt?h.jsxs("div",{className:"w-96 max-w-[calc(100vw-1.5rem)] rounded-3xl border border-stone-700/80 bg-stone-950/92 p-3 text-left text-stone-100 shadow-2xl shadow-stone-950/35 backdrop-blur-xl",children:[h.jsxs("div",{className:"flex items-center justify-between gap-3",children:[h.jsxs("div",{children:[h.jsx("p",{className:"text-sm font-semibold",children:"Goal monitor"}),h.jsx("p",{className:"text-xs text-stone-500",children:"Current thread only"})]}),h.jsx("button",{type:"button",onClick:()=>Nn(!1),className:"rounded-full border border-stone-700 px-2.5 py-1 text-xs text-stone-300 transition hover:bg-stone-800",children:"Close"})]}),Ct.error?h.jsx("p",{className:"mt-3 rounded-2xl border border-rose-400/30 bg-rose-400/10 px-3 py-2 text-xs text-rose-100",children:Ct.error}):null,h.jsx("div",{className:"mt-3 max-h-[28rem] space-y-2 overflow-auto pr-1",children:ei.length===0?h.jsx("p",{className:"rounded-2xl border border-stone-800 bg-stone-900/60 px-3 py-3 text-sm text-stone-400",children:"No goals in this thread yet."}):ei.map(W=>{const J=BC(W),de=Yt.has(J),De=["active","paused","budgetLimited"].includes(W.status);return h.jsxs("div",{className:`rounded-2xl border px-3 py-3 ${De?"ui-status-info":"border-stone-800 bg-stone-900/60"}`,children:[h.jsxs("div",{className:"flex items-start justify-between gap-3",children:[h.jsx("button",{type:"button",onClick:()=>Ss(Ue=>{const pt=new Set(Ue);return pt.has(J)?pt.delete(J):pt.add(J),pt}),className:"min-w-0 flex-1 text-left",children:h.jsx("p",{className:`text-sm font-medium leading-5 ${de?"":"line-clamp-2"}`,children:W.objective})}),h.jsx("span",{className:"shrink-0 rounded-full border border-stone-700 px-2 py-1 text-[10px] uppercase tracking-[0.14em] text-stone-300",children:W.status})]}),h.jsxs("div",{className:"mt-2 flex flex-wrap gap-2 text-[11px] text-stone-400",children:[h.jsx("span",{children:bq(W.timeUsedSeconds)}),h.jsx("span",{children:gq(W)}),h.jsxs("span",{title:bo(W.updatedAt),children:["Updated ",new Date(W.updatedAt).toLocaleTimeString()]})]}),De?h.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[h.jsx("button",{type:"button",disabled:or||W.status==="active",onClick:()=>void ca("active"),className:"ui-status-info rounded-full px-3 py-1.5 text-xs transition disabled:cursor-not-allowed disabled:opacity-50",children:"Continue"}),h.jsx("button",{type:"button",disabled:or||W.status==="paused",onClick:()=>void ca("paused"),className:"rounded-full border border-stone-700 px-3 py-1.5 text-xs text-stone-300 transition hover:bg-stone-800 disabled:cursor-not-allowed disabled:opacity-50",children:"Pause"}),h.jsx("button",{type:"button",disabled:or,onClick:()=>void da(),className:"rounded-full border border-rose-400/35 px-3 py-1.5 text-xs text-rose-100 transition hover:bg-rose-400/10 disabled:cursor-not-allowed disabled:opacity-50",children:"Terminate"})]}):null]},J)})})]}):null,Hi=h.jsx("button",{type:"button","aria-label":"Open goal monitor",title:"Open goal monitor",onClick:()=>{Nn(W=>!W),Oi()},className:"ui-status-info inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full shadow-lg shadow-stone-950/20 transition lg:h-9 lg:w-9",children:Ia}),ti=h.jsx("button",{type:"button","aria-label":"Export transcript",title:"Export transcript",onClick:()=>Hr(!0),disabled:!A,className:"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full border border-stone-700/90 bg-stone-900/85 text-stone-300 shadow-lg shadow-stone-950/20 transition hover:bg-stone-800 disabled:cursor-not-allowed disabled:opacity-50 lg:h-9 lg:w-9",children:h.jsx(Tq,{})}),Ls=h.jsxs("div",{className:"relative flex items-center justify-end gap-1.5",children:[ti,Hi,Tl]});return h.jsx(PC,{threads:U,status:Y,loading:L,error:L?null:pr,viewportConstrained:!0,currentThreadId:A==null?void 0:A.thread.id,currentThreadLabel:A==null?void 0:A.thread.title,currentWorkspaceId:A==null?void 0:A.thread.workspaceId,currentWorkspaceLabel:A==null?void 0:A.workspace.label,metaContent:_l,settingsContent:Ra,showMobileNewThreadShortcut:!1,mobileHeaderAction:Ls,onRenameThread:Mi,children:h.jsxs("div",{className:"thread-detail-surface relative flex h-full min-h-0 flex-1 flex-col overflow-hidden rounded-none border-y shadow-2xl shadow-stone-950/20 sm:flex-none sm:rounded-[2rem] sm:border",children:[h.jsx("div",{className:"pointer-events-none absolute right-4 top-4 z-30 hidden lg:block",children:h.jsx("div",{className:"pointer-events-auto flex flex-col items-end gap-2",children:h.jsxs("div",{className:"flex items-center justify-end gap-2",children:[ti,Hi,Ja]})})}),$r?h.jsx("div",{className:"fixed right-3 top-20 z-50 lg:absolute lg:top-16 lg:right-4",children:$r}):null,pr&&!L&&h.jsx("div",{className:"shrink-0 border-b border-rose-500/20 bg-rose-500/10 px-5 py-4 text-sm text-rose-100 sm:px-6",children:pr}),L?h.jsx("div",{className:"flex flex-1 items-center justify-center px-6 py-12 text-center text-stone-400",children:"Loading thread detail..."}):A?h.jsxs(h.Fragment,{children:[A.workspacePathStatus==="missing"&&h.jsxs("div",{className:"shrink-0 border-b border-rose-500/20 bg-rose-500/10 px-5 py-4 text-sm text-rose-100 sm:px-6",children:[h.jsx("p",{className:"font-medium text-rose-50",children:"Workspace path missing"}),h.jsx("p",{className:"mt-1 break-words text-rose-100/90",children:A.workspace.absPath})]}),h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:we==="chat"?"flex min-h-0 flex-1 flex-col":"hidden",children:[h.jsx(aq,{threadId:A.thread.id,turns:A.turns,totalTurnCount:A.totalTurnCount??A.turns.length,pendingRequests:A.pendingRequests,livePlan:F,liveItems:ce,respondingRequestId:Ze,onRespondToRequest:ji,liveOutput:M,scrollRequestKey:ke,bottomSpacer:El,className:"thread-timeline-surface min-h-0 flex-1",onTailVisibilityChange:ee,loadingEarlier:ae,onLoadEarlier:yl,onLoadHistoryItemDetail:W=>Z5(A.thread.id,W),answeredRequestNotes:A.answeredRequestNotes??[],activityNotes:A.activityNotes??[],pendingSteers:A.pendingSteers??[],optimisticSteers:$e,optimisticTurn:Bo}),Ln?h.jsx("div",{ref:y,className:"fixed inset-x-0 bottom-0 z-30 sm:hidden",style:{bottom:`${Rs}px`,paddingBottom:"env(safe-area-inset-bottom)"},children:h.jsx(vp,{activeView:we,edgeToEdgeMobile:!0,busy:we==="chat"?_e:!1,settingsBusy:qt,error:null,model:A.thread.model,reasoningEffort:A.thread.reasoningEffort,fastMode:A.thread.fastMode??!1,collaborationMode:A.thread.collaborationMode,modelOptions:P,contextUsage:A.thread.contextUsage,followTail:z,threadConnected:A.thread.isLoaded,disabled:!!Rn,disabledPlaceholder:Rn??void 0,shellControlState:ht,draftPrompt:Fe.prompt,draftAttachments:Fe.attachments,onDraftChange:Ie,canInterrupt:!!A.thread.activeTurnId,onSubmit:Sr,onInterrupt:tr,onCompact:Ns,onOpenForkTurns:pn,onForkLatest:Di,onForkTurn:Wa,onOpenSkills:zr,onOpenMcp:Fr,goalState:Ct,onOpenGoal:Oi,onUpdateGoal:ua,onReadCodexConfig:()=>E0("config.toml"),onWriteCodexConfig:W=>_0("config.toml",{content:W}),onToggleFollow:()=>Be(W=>W+1),onUpdateSettings:Vn,onToggleView:Xa,onShellCopy:ha,onShellControl:Pi,compactBusy:me,skillsState:Q,mcpState:ut,forkTurnOptionsState:We})}):h.jsx("div",{ref:y,children:h.jsx(vp,{activeView:we,busy:we==="chat"?_e:!1,settingsBusy:qt,error:null,model:A.thread.model,reasoningEffort:A.thread.reasoningEffort,fastMode:A.thread.fastMode??!1,collaborationMode:A.thread.collaborationMode,modelOptions:P,contextUsage:A.thread.contextUsage,followTail:z,threadConnected:A.thread.isLoaded,disabled:!!Rn,disabledPlaceholder:Rn??void 0,shellControlState:ht,draftPrompt:Fe.prompt,draftAttachments:Fe.attachments,onDraftChange:Ie,canInterrupt:!!A.thread.activeTurnId,onSubmit:Sr,onInterrupt:tr,onCompact:Ns,onOpenForkTurns:pn,onForkLatest:Di,onForkTurn:Wa,onOpenSkills:zr,onOpenMcp:Fr,goalState:Ct,onOpenGoal:Oi,onUpdateGoal:ua,onReadCodexConfig:()=>E0("config.toml"),onWriteCodexConfig:W=>_0("config.toml",{content:W}),onToggleFollow:()=>Be(W=>W+1),onUpdateSettings:Vn,onToggleView:Xa,onShellCopy:ha,onShellControl:Pi,compactBusy:me,skillsState:Q,mcpState:ut,forkTurnOptionsState:We})})]}),h.jsxs("div",{className:we==="shell"?"flex min-h-0 flex-1 flex-col":"hidden",children:[A.thread.isLoaded&&h.jsx(o4,{ref:g,threadId:A.thread.id,isVisible:we==="shell",showHeader:!1,showFloatingToolbox:!1,onStateChange:mn}),we==="shell"&&!A.thread.isLoaded&&h.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center p-4 sm:p-6",children:h.jsxs("div",{className:"thread-empty-surface max-w-md rounded-[1.6rem] border px-6 py-8 text-center",children:[h.jsx("p",{className:"text-base font-medium text-[var(--theme-fg)]",children:"Thread disconnected"}),h.jsx("p",{className:"mt-3 text-sm leading-6 text-[var(--theme-fg-soft)]",children:"Reconnect this thread before creating or attaching a shell."})]})}),we==="shell"&&h.jsx(vp,{activeView:we,busy:_e,settingsBusy:!1,error:A.thread.isLoaded?(ht==null?void 0:ht.error)??null:null,followTail:!1,threadConnected:A.thread.isLoaded,shellControlState:ht,canInterrupt:!!(A.thread.isLoaded&&(ht!=null&&ht.isCommandRunning)),onSubmit:Sr,onInterrupt:tr,onToggleView:Xa,onShellCopy:ha,onShellControl:Pi})]})]})]}):h.jsx("div",{className:"flex flex-1 items-center justify-center px-6 py-12 text-center text-stone-400",children:"Unable to resolve this thread."}),h.jsx(I6,{open:Li,busy:Ya,turnsState:Sa,onCancel:()=>{Ya||Hr(!1)},onLoadTurns:Mo,onExport:Po})]})})}function kq(){const e=wa(),[t,n]=T.useState(""),[r,s]=T.useState(!1),[l,o]=T.useState(null);async function c(d){d.preventDefault();const m=t.trim();if(!m){o("Session ID is required.");return}s(!0),o(null);try{const p=await a6(m);e(`/threads/${p.thread.id}`)}catch(p){p instanceof sn?o(p.payload.message):o(p instanceof Error?p.message:"Unable to import session.")}finally{s(!1)}}return h.jsxs("div",{className:"space-y-6",children:[h.jsxs("div",{children:[h.jsx("p",{className:"text-xs uppercase tracking-[0.3em] text-stone-500",children:"Import Session"}),h.jsx("h2",{className:"mt-2 text-3xl font-semibold text-stone-100",children:"Bring in a local Codex session"}),h.jsx("p",{className:"mt-3 max-w-3xl text-sm leading-6 text-stone-400",children:"Paste a session ID from this machine. Supervisor will recover the workspace path, reuse an existing workspace when possible, or create one with the last folder name as the default label."}),h.jsx("p",{className:"mt-2 max-w-3xl text-sm leading-6 text-stone-500",children:"Imported history appears immediately, but sending a new prompt still requires a manual Resume / Connect."})]}),h.jsxs("form",{onSubmit:c,className:"space-y-5 rounded-3xl border border-stone-800 bg-stone-900 p-6",children:[h.jsxs("div",{children:[h.jsx("label",{htmlFor:"session-id",className:"text-sm font-medium text-stone-200",children:"Local session ID"}),h.jsx("input",{id:"session-id",value:t,onChange:d=>n(d.target.value),placeholder:"019d6fb7-7033-7a30-a2c7-74d0919e87d4",className:"mt-2 w-full rounded-2xl border border-stone-700 bg-stone-950 px-4 py-3 text-stone-100 outline-none transition focus:border-amber-300"})]}),l&&h.jsx("div",{className:"rounded-2xl border border-rose-500/40 bg-rose-500/10 px-4 py-3 text-sm text-rose-200",children:l}),h.jsx("div",{className:"flex flex-wrap items-center gap-3",children:h.jsx("button",{type:"submit",disabled:r,className:"rounded-full bg-amber-300 px-5 py-3 font-medium text-stone-950 transition hover:bg-amber-200 disabled:cursor-not-allowed disabled:bg-stone-700 disabled:text-stone-300",children:r?"Importing...":"Import Session"})})]})]})}function Cq(){const e=wa(),[t]=ev(),[n,r]=T.useState([]),[s,l]=T.useState([]),[o,c]=T.useState(""),[d,m]=T.useState(""),[p,g]=T.useState(""),[y,E]=T.useState("yolo"),[v,k]=T.useState(!0),[C,S]=T.useState(!1),[A,N]=T.useState(null),U=t.get("workspaceId");T.useEffect(()=>{Promise.all([wg(),rv()]).then(([H,Y])=>{var M,K,F;r(H),l(Y);const ue=H.some(ge=>ge.id===U)?U:((M=H[0])==null?void 0:M.id)??"";c(ue),m(((K=Y.find(ge=>ge.isDefault))==null?void 0:K.model)??((F=Y[0])==null?void 0:F.model)??"")}).catch(H=>{N(H instanceof Error?H.message:"Unable to load creation form data.")}).finally(()=>{k(!1)})},[t]);function G(){if(window.history.length>1){e(-1);return}if(U){e(`/threads?workspaceId=${encodeURIComponent(U)}`);return}e("/workspaces")}async function P(H){H.preventDefault(),S(!0),N(null);try{const Y=await r6(p.trim()?{workspaceId:o,model:d,approvalMode:y,title:p.trim()}:{workspaceId:o,model:d,approvalMode:y});e(`/threads/${Y.id}`)}catch(Y){Y instanceof sn?N(Y.payload.message):N(Y instanceof Error?Y.message:"Unable to create thread.")}finally{S(!1)}}return h.jsxs("div",{className:"space-y-6",children:[h.jsxs("div",{children:[h.jsx("p",{className:"text-xs uppercase tracking-[0.3em] text-stone-500",children:"New Thread"}),h.jsx("h2",{className:"mt-2 text-3xl font-semibold text-stone-100",children:"Start a Codex session"}),h.jsx("p",{className:"mt-3 max-w-2xl text-sm leading-6 text-stone-400",children:"Choose the workspace, model, and approval mode that should back the new thread."})]}),v?h.jsx("div",{className:"rounded-3xl border border-stone-800 bg-stone-900 px-6 py-12 text-center text-stone-400",children:"Loading creation form..."}):h.jsxs("form",{onSubmit:P,className:"space-y-5 rounded-3xl border border-stone-800 bg-stone-900 p-6",children:[h.jsxs("div",{children:[h.jsx("label",{className:"text-sm font-medium text-stone-200",htmlFor:"thread-workspace",children:"Workspace"}),h.jsx("select",{id:"thread-workspace",value:o,onChange:H=>c(H.target.value),className:"mt-2 w-full rounded-2xl border border-stone-700 bg-stone-950 px-4 py-3 text-stone-100 outline-none transition focus:border-amber-300",children:n.map(H=>h.jsxs("option",{value:H.id,children:[H.label," · ",H.absPath]},H.id))})]}),h.jsxs("div",{children:[h.jsx("label",{className:"text-sm font-medium text-stone-200",htmlFor:"thread-model",children:"Model"}),h.jsx("select",{id:"thread-model",value:d,onChange:H=>m(H.target.value),className:"mt-2 w-full rounded-2xl border border-stone-700 bg-stone-950 px-4 py-3 text-stone-100 outline-none transition focus:border-amber-300",children:s.map(H=>h.jsxs("option",{value:H.model,children:[H.displayName," · ",H.model]},H.id))})]}),h.jsxs("div",{children:[h.jsx("label",{className:"text-sm font-medium text-stone-200",htmlFor:"thread-title",children:"Title"}),h.jsx("input",{id:"thread-title",value:p,onChange:H=>g(H.target.value),placeholder:"Optional. Falls back to first prompt.",className:"mt-2 w-full rounded-2xl border border-stone-700 bg-stone-950 px-4 py-3 text-stone-100 outline-none transition focus:border-amber-300"})]}),h.jsxs("div",{children:[h.jsx("label",{className:"text-sm font-medium text-stone-200",htmlFor:"thread-approval-mode",children:"Approval mode"}),h.jsxs("select",{id:"thread-approval-mode",value:y,onChange:H=>E(H.target.value),className:"mt-2 w-full rounded-2xl border border-stone-700 bg-stone-950 px-4 py-3 text-stone-100 outline-none transition focus:border-amber-300",children:[h.jsx("option",{value:"yolo",children:"yolo"}),h.jsx("option",{value:"guarded",children:"guarded"})]})]}),A&&h.jsx("div",{className:"rounded-2xl border border-rose-500/40 bg-rose-500/10 px-4 py-3 text-sm text-rose-200",children:A}),h.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[h.jsx("button",{type:"submit",disabled:C||!o||!d,className:"rounded-full bg-amber-300 px-5 py-3 font-medium text-stone-950 transition hover:bg-amber-200 disabled:cursor-not-allowed disabled:bg-stone-700 disabled:text-stone-300",children:C?"Creating...":"Create Thread"}),h.jsx("button",{type:"button",onClick:G,disabled:C,className:"rounded-full border border-stone-700 px-5 py-3 font-medium text-stone-200 transition hover:bg-stone-800 disabled:cursor-not-allowed disabled:border-stone-800 disabled:text-stone-500",children:"Cancel"})]})]})]})}function HC({open:e,title:t,description:n,confirmLabel:r="Delete",busy:s=!1,onCancel:l,onConfirm:o}){return T.useEffect(()=>{if(!e)return;function c(d){d.key==="Escape"&&!s&&l()}return window.addEventListener("keydown",c),()=>{window.removeEventListener("keydown",c)}},[s,l,e]),e?ko.createPortal(h.jsxs("div",{className:"fixed inset-0 z-[95] flex items-center justify-center p-4 sm:p-6",children:[h.jsx("button",{type:"button","aria-label":"Close confirmation dialog",onClick:l,disabled:s,className:"absolute inset-0 bg-stone-950/78 backdrop-blur-sm disabled:cursor-not-allowed"}),h.jsxs("div",{role:"dialog","aria-modal":"true","aria-label":t,className:"relative z-[1] w-full max-w-md rounded-[1.6rem] border border-stone-700 bg-stone-900 p-5 shadow-2xl shadow-stone-950/40 sm:p-6",children:[h.jsxs("div",{className:"flex items-start justify-between gap-3",children:[h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsx("p",{className:"text-sm font-medium text-stone-100",children:t}),h.jsx("p",{className:"mt-2 text-sm leading-6 text-stone-400",children:n})]}),h.jsx("button",{type:"button","aria-label":"Close dialog",onClick:l,disabled:s,className:"inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-full border border-stone-700 text-stone-300 transition hover:bg-stone-800 disabled:cursor-not-allowed disabled:opacity-60",children:h.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-4 w-4 fill-current",children:h.jsx("path",{d:"M3.22 2.47 8 7.25l4.78-4.78 1.06 1.06L9.06 8.31l4.78 4.78-1.06 1.06L8 9.37l-4.78 4.78-1.06-1.06 4.78-4.78-4.78-4.78 1.06-1.06Z"})})})]}),h.jsxs("div",{className:"mt-5 flex items-center justify-end gap-2",children:[h.jsx("button",{type:"button",onClick:l,disabled:s,className:"rounded-full border border-stone-700 px-4 py-2 text-sm font-medium text-stone-300 transition hover:bg-stone-800 disabled:cursor-not-allowed disabled:opacity-60",children:"Cancel"}),h.jsx("button",{type:"button",onClick:()=>void o(),disabled:s,className:"ui-action-danger rounded-full px-4 py-2 text-sm font-medium transition disabled:cursor-not-allowed",children:s?"Deleting...":r})]})]})]}),document.body):null}function Sq(e){const t=e.replace(/\s+/g," ").trim(),n=Array.from(t);return n.length<=15?t:`${n.slice(0,15).join("")}...`}function Aq(){const[e]=ev(),t=wa(),n=e.get("workspaceId"),[r,s]=T.useState([]),[l,o]=T.useState([]),[c,d]=T.useState(null),[m,p]=T.useState(!0),[g,y]=T.useState(null),[E,v]=T.useState(null),[k,C]=T.useState(""),[S,A]=T.useState(null),[N,U]=T.useState(null),[G,P]=T.useState(!1);async function H(){p(!0),y(null);try{const[ee,ke,Be]=await Promise.all([nv(),av(),wg()]);d(ee),s(ke),o(Be)}catch(ee){y(ee instanceof Error?ee.message:"Unable to load threads.")}finally{p(!1)}}T.useEffect(()=>{if(n===null)return;H();const ee=sv(ke=>{s(Be=>Be.map(L=>L.id===ke.threadId?{...L,status:typeof ke.payload.status=="string"?ke.payload.status:L.status,lastError:typeof ke.payload.error=="string"?ke.payload.error:L.lastError,title:typeof ke.payload.title=="string"?ke.payload.title:L.title}:L))});return()=>{ee.close()}},[n]);const Y=Object.fromEntries(l.map(ee=>[ee.id,ee.label])),ue=l.find(ee=>ee.id===n)??null,M=T.useMemo(()=>n?r.filter(ee=>ee.workspaceId===n):[],[n,r]),K=M.filter(ee=>ee.status==="running").length,F=n?`/threads/new?workspaceId=${encodeURIComponent(n)}`:"/threads/new";if(n===null)return h.jsx(t5,{to:"/workspaces",replace:!0});function ge(){switch(c==null?void 0:c.state){case"ready":return"bg-emerald-400 shadow-[0_0_0_3px_rgba(52,211,153,0.14)]";case"starting":return"bg-amber-300 shadow-[0_0_0_3px_rgba(252,211,77,0.12)]";case"degraded":case"failed":return"bg-rose-400 shadow-[0_0_0_3px_rgba(251,113,133,0.14)]";default:return"bg-stone-500 shadow-[0_0_0_3px_rgba(120,113,108,0.14)]"}}async function ce(ee,ke){try{const Be=await iv(ee,{title:ke});s(L=>L.map($=>$.id===Be.id?{...$,title:Be.title,updatedAt:Be.updatedAt}:$))}catch(Be){throw y(Be instanceof Error?Be.message:"Unable to rename thread."),Be}}async function ne(){if(!E)return;const ee=k.trim();if(ee){A(E);try{await ce(E,ee),v(null),C("")}finally{A(null)}}}async function z(){if(N){P(!0);try{await u6(N.id),s(ee=>ee.filter(ke=>ke.id!==N.id)),U(null)}catch(ee){y(ee instanceof Error?ee.message:"Unable to delete thread.")}finally{P(!1)}}}return h.jsx(PC,{threads:r,workspaceLabels:Y,status:c,loading:m,error:g,viewportConstrained:n!==null,showMobileAppMenu:!0,showMobileThreadNavToggle:!1,showMobileNewThreadShortcut:!1,currentWorkspaceId:n,currentWorkspaceLabel:(ue==null?void 0:ue.label)??null,onRenameThread:ce,children:h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden rounded-[2rem] border border-stone-800 bg-stone-900/85 shadow-2xl shadow-stone-950/20",children:[h.jsx("div",{className:"border-b border-stone-800 px-4 py-3 sm:px-6 sm:py-4",children:h.jsxs("div",{className:"flex items-center justify-between gap-3",children:[h.jsx("h2",{className:"min-w-0 truncate text-base font-semibold text-stone-100 sm:text-lg",title:ue?`${ue.label} threads`:"All threads",children:ue?ue.label:"All Threads"}),h.jsx(Ci,{to:F,className:"inline-flex h-9 shrink-0 items-center rounded-full bg-amber-300 px-3.5 text-xs font-medium uppercase tracking-[0.18em] text-stone-950 transition hover:bg-amber-200",children:"New Thread"})]})}),h.jsx("div",{className:"px-4 py-3 sm:px-6 sm:py-4",children:h.jsxs("article",{className:"inline-flex min-w-[12rem] max-w-full items-center gap-3 rounded-[1.25rem] border border-stone-800 bg-stone-950/70 px-3.5 py-2.5",children:[h.jsx("span",{"aria-hidden":"true",className:`h-2.5 w-2.5 shrink-0 rounded-full ${ge()}`}),h.jsxs("div",{className:"min-w-0",children:[h.jsx("p",{className:"truncate text-[11px] uppercase tracking-[0.22em] text-stone-500",children:"Supervisor"}),h.jsx("p",{className:"truncate text-sm text-stone-200",children:(c==null?void 0:c.lastError)??((c==null?void 0:c.state)==="ready"?"Ready":(c==null?void 0:c.state)??"Checking")})]})]})}),!m&&!g&&M.length>0&&h.jsxs("div",{className:"flex min-h-0 flex-1 flex-col border-t border-stone-800 px-4 py-4 sm:px-6 sm:py-5",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("p",{className:"text-xs uppercase tracking-[0.28em] text-stone-500",children:"Recent Threads"}),h.jsxs("span",{className:"rounded-full border border-amber-300/30 bg-amber-300/10 px-2 py-0.5 text-[11px] font-medium uppercase tracking-[0.18em] text-amber-200",children:[M.length," total"]}),K>0&&h.jsxs("span",{className:"text-xs text-stone-500",children:["· ",K," running"]})]}),h.jsx("div",{className:"mt-3 min-h-0 flex-1",children:h.jsx(MC,{threads:M,currentWorkspaceId:n,workspaceLabels:Y,onOpenThread:ee=>t(`/threads/${ee}`),onBeginRenameThread:ee=>{v(ee.id),C(ee.title)},onDeleteThread:ee=>U(ee),scrollable:!0,maxHeightClassName:"max-h-full",showDeleteButton:!0,showSessionCopyButton:!0})})]}),!m&&!g&&M.length===0&&h.jsx("div",{className:"border-t border-stone-800 px-4 py-6 text-sm text-stone-500 sm:px-6",children:"No threads available in this workspace."})]}),h.jsx(I1,{open:E!==null,title:"Rename Thread",label:"Thread Title",value:k,busy:S!==null,onChange:C,onCancel:()=>{v(null),C("")},onSubmit:()=>void ne()}),h.jsx(HC,{open:N!==null,title:"Delete Thread",description:N?`Delete ${Sq(N.title)} from supervisor. The Codex session id will no longer appear in this workspace list.`:"",confirmLabel:"Delete Thread",busy:G,onCancel:()=>{G||U(null)},onConfirm:()=>void z()})]})})}function DT(e){const t=e.trim(),n=t.replace(/[\\/]+$/,"");if(!n)return"";if(zC(t)){const s=(n.split(/[?#]/)[0]??n).split(/[/:]/).filter(Boolean).at(-1)??"";return s.endsWith(".git")?s.slice(0,-4):s}return n.split(/[\\/]/).filter(Boolean).at(-1)??""}function zC(e){const t=e.trim();return/^https?:\/\/.+/i.test(t)||/^ssh:\/\/.+/i.test(t)||/^git@[^:]+:.+/.test(t)}function Nq({initialPath:e="",initialLabel:t="",submitLabel:n="Save Workspace",error:r,busy:s=!1,onSubmit:l}){const o=DT(e),[c,d]=T.useState(e),[m,p]=T.useState(t||o),[g,y]=T.useState(null),E=T.useRef(o);T.useEffect(()=>{const k=DT(c);p(C=>!C.trim()||C===E.current?k:C),E.current=k},[c]);async function v(k){k.preventDefault();const C=c.trim();if(!C){y("Workspace path or Git URL is required.");return}y(null);const S=m.trim(),A=zC(C)?"gitUrl":"absPath";await l(S?{[A]:C,label:S}:{[A]:C})}return h.jsxs("form",{onSubmit:v,className:"space-y-5 rounded-3xl border border-stone-800 bg-stone-900 p-6",children:[h.jsxs("div",{children:[h.jsx("label",{htmlFor:"workspace-path",className:"text-sm font-medium text-stone-200",children:"Path or Git URL"}),h.jsx("input",{id:"workspace-path",name:"absPath",value:c,onChange:k=>d(k.target.value),placeholder:"/Users/name/project or https://github.com/owner/repo.git",className:"mt-2 w-full rounded-2xl border border-stone-700 bg-stone-950 px-4 py-3 text-stone-100 outline-none transition focus:border-amber-300"}),h.jsx("p",{className:"mt-2 text-xs text-stone-500",children:"Absolute paths register local directories. Git URLs clone into the configured dev home."})]}),h.jsxs("div",{children:[h.jsx("label",{htmlFor:"workspace-label",className:"text-sm font-medium text-stone-200",children:"Display label"}),h.jsx("input",{id:"workspace-label",name:"label",value:m,onChange:k=>p(k.target.value),placeholder:"Optional override",className:"mt-2 w-full rounded-2xl border border-stone-700 bg-stone-950 px-4 py-3 text-stone-100 outline-none transition focus:border-amber-300"}),h.jsx("p",{className:"mt-2 text-xs text-stone-500",children:"Defaults to the last folder name. You can override it."})]}),(g||r)&&h.jsx("div",{className:"rounded-2xl border border-rose-500/40 bg-rose-500/10 px-4 py-3 text-sm text-rose-200",children:g??r}),h.jsx("button",{type:"submit",disabled:s,className:"rounded-full bg-amber-300 px-5 py-3 font-medium text-stone-950 transition hover:bg-amber-200 disabled:cursor-not-allowed disabled:bg-stone-700 disabled:text-stone-300",children:s?"Saving...":n})]})}function Rq(){const e=wa(),[t,n]=T.useState(null),[r,s]=T.useState(!1);async function l(o){s(!0),n(null);try{const c=await y6(o);e(`/threads?workspaceId=${encodeURIComponent(c.id)}`)}catch(c){c instanceof sn?n(c.payload.message):n(c instanceof Error?c.message:"Unable to create workspace.")}finally{s(!1)}}return h.jsxs("div",{className:"space-y-6",children:[h.jsxs("div",{children:[h.jsx("p",{className:"text-xs uppercase tracking-[0.3em] text-stone-500",children:"Add Workspace"}),h.jsx("h2",{className:"mt-2 text-3xl font-semibold text-stone-100",children:"Create a workspace"}),h.jsx("p",{className:"mt-3 max-w-2xl text-sm leading-6 text-stone-400",children:"Register an existing local directory, create one missing child directory under dev home, or clone a Git repository into dev home."})]}),h.jsx(Nq,{busy:r,error:t,submitLabel:"Create Workspace",onSubmit:l})]})}function jT(e){return Date.parse(e.lastOpenedAt??e.createdAt)}function Lq(e,t){return e.isFavorite!==t.isFavorite?e.isFavorite?-1:1:jT(t)-jT(e)}function Iq(e){return e?new Date(e).toLocaleString():"Never opened"}function Oq(e,t=28){return e.length<=t?e:`...${e.slice(-(t-3))}`}function Dq({active:e}){return h.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:`h-3.5 w-3.5 fill-current ${e?"rotate-[18deg]":"rotate-[8deg]"}`,children:h.jsx("path",{d:"M10.7 1.75c.34 0 .62.28.62.63v1.24l1.43 1.42c.24.24.24.62 0 .86l-1.1 1.1v2.02c0 .17-.07.33-.19.45l-1.5 1.5v2.28c0 .28-.18.53-.44.6a.62.62 0 0 1-.69-.24L7.2 12.4l-2.83 2.83a.625.625 0 1 1-.88-.88l2.83-2.83-2.2-1.62a.62.62 0 0 1-.24-.69c.08-.26.32-.44.6-.44h2.28l1.5-1.5a.64.64 0 0 1 .45-.18h2.02l1.1-1.11-1.42-1.42H9.07a.63.63 0 0 1-.62-.63c0-.34.28-.62.62-.62h1.63Z"})})}function jq(){return h.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-current",children:h.jsx("path",{d:"M6.1 1.75h3.8c.75 0 1.4.52 1.57 1.25h2.03c.35 0 .63.28.63.63 0 .34-.28.62-.63.62h-.66l-.62 8.03c-.08 1.09-.99 1.97-2.08 1.97H5.86c-1.09 0-2-.88-2.08-1.97l-.62-8.03H2.5a.62.62 0 1 1 0-1.25h2.03c.17-.73.82-1.25 1.57-1.25Zm0 1.25c-.07 0-.14.03-.19.08A.26.26 0 0 0 5.84 3h4.32a.26.26 0 0 0-.07-.17.26.26 0 0 0-.19-.08H6.1Zm-1.07 1.25.61 7.93c.03.44.4.79.84.79h3.04c.44 0 .81-.35.84-.79l.61-7.93H5.03Zm1.53 1.32c.35 0 .62.28.62.62v4.19a.62.62 0 1 1-1.24 0V6.19c0-.34.28-.62.62-.62Zm2.82 0c.34 0 .62.28.62.62v4.19a.62.62 0 1 1-1.24 0V6.19c0-.34.28-.62.62-.62Z"})})}function Mq(){const e=wa(),[t,n]=T.useState([]),[r,s]=T.useState(!0),[l,o]=T.useState(null),[c,d]=T.useState(null),[m,p]=T.useState(""),[g,y]=T.useState(null),[E,v]=T.useState(null),[k,C]=T.useState(null),[S,A]=T.useState(!1);async function N(){s(!0),o(null);try{n(await wg())}catch(F){o(F instanceof Error?F.message:"Unable to load workspaces.")}finally{s(!1)}}T.useEffect(()=>{N()},[]);async function U(F){const ge={...F,isFavorite:!F.isFavorite};n(ce=>ce.map(ne=>ne.id===F.id?ge:ne));try{const ce=await T6(F.id,{isFavorite:!F.isFavorite});n(ne=>ne.map(z=>z.id===ce.id?ce:z))}catch(ce){n(ne=>ne.map(z=>z.id===F.id?F:z)),o(ce instanceof Error?ce.message:"Unable to update workspace.")}}async function G(F){const ge=m.trim();if(ge){y(F);try{const ce=await E6(F,{label:ge});n(ne=>ne.map(z=>z.id===ce.id?ce:z)),d(null),p("")}catch(ce){o(ce instanceof Error?ce.message:"Unable to rename workspace.")}finally{y(null)}}}function P(F){d(F.id),p(F.label)}function H(){d(null),p("")}function Y(F){e(`/threads?workspaceId=${encodeURIComponent(F)}`)}async function ue(){if(k){A(!0);try{await _6(k.id),n(F=>F.filter(ge=>ge.id!==k.id)),C(null)}catch(F){o(F instanceof Error?F.message:"Unable to delete workspace.")}finally{A(!1)}}}function M(F,ge){(F.key==="Enter"||F.key===" ")&&(F.preventDefault(),Y(ge))}const K=T.useMemo(()=>[...t].sort(Lq),[t]);return h.jsxs("div",{className:"space-y-4",children:[h.jsx("div",{className:"sticky top-[env(safe-area-inset-top)] z-20 -mx-4 border-b border-stone-800/90 bg-stone-950/96 px-2.5 py-2 backdrop-blur sm:mx-0 sm:rounded-[1.4rem] sm:border sm:px-4",children:h.jsxs("div",{className:"relative",children:[h.jsxs("div",{className:"flex min-w-0 items-center gap-1.5 sm:gap-2",children:[h.jsx(kg,{}),h.jsx(Ci,{to:"/threads/import",className:"inline-flex h-8 shrink-0 items-center rounded-full border border-sky-400/30 bg-sky-400/10 px-2.5 text-[11px] font-medium uppercase tracking-[0.14em] text-sky-100 transition hover:border-sky-300/45 hover:bg-sky-400/16 sm:px-3 sm:text-xs sm:tracking-[0.18em]",children:"Import"}),h.jsx(Ci,{to:"/workspaces/new",className:"inline-flex h-8 shrink-0 items-center rounded-full bg-amber-300 px-2.5 text-[11px] font-medium uppercase tracking-[0.14em] text-stone-950 transition hover:bg-amber-200 sm:px-3 sm:text-xs sm:tracking-[0.18em]",children:"Create"}),h.jsx("div",{className:"min-w-0 flex-1 text-right",children:h.jsx("p",{className:"truncate text-[11px] uppercase tracking-[0.24em] text-stone-500",children:"Workspaces"})})]}),h.jsx(Cg,{className:"absolute left-0 top-[calc(100%+0.5rem)] z-30 w-[min(22rem,calc(100vw-1rem))]"})]})}),r&&h.jsx("div",{className:"rounded-[1.6rem] border border-stone-800 bg-stone-900/85 px-6 py-12 text-center text-stone-400",children:"Loading workspace registry..."}),l&&h.jsx("div",{className:"rounded-[1.4rem] border border-rose-500/30 bg-rose-500/10 px-4 py-4 text-rose-100",children:l}),!r&&!l&&t.length===0&&h.jsxs("div",{className:"rounded-[1.6rem] border border-dashed border-stone-700 bg-stone-900/80 px-6 py-12 text-center",children:[h.jsx("p",{className:"text-lg font-medium text-stone-100",children:"No workspaces yet"}),h.jsx("p",{className:"mt-2 text-sm text-stone-500",children:"Add a local directory inside the configured workspace root to start building the registry."})]}),!r&&K.length>0&&h.jsx("div",{className:"space-y-2 overflow-x-hidden",children:K.map(F=>h.jsxs("article",{role:"link",tabIndex:0,onClick:()=>Y(F.id),onKeyDown:ge=>M(ge,F.id),className:"relative overflow-hidden rounded-[1.35rem] border border-stone-800 bg-stone-900/88 px-4 py-3 shadow-lg shadow-stone-950/10 transition hover:border-stone-700 hover:bg-stone-900",children:[h.jsxs("div",{className:"absolute right-2.5 top-2.5 flex items-center gap-1.5",children:[h.jsx("button",{type:"button","aria-label":`Delete workspace ${F.label}`,title:"Delete workspace",onClick:ge=>{ge.stopPropagation(),C(F)},className:"inline-flex h-7 w-7 items-center justify-center rounded-full border border-rose-400/20 bg-rose-400/10 text-rose-200 transition hover:bg-rose-400/18",children:h.jsx(jq,{})}),h.jsx("button",{type:"button","aria-label":F.isFavorite?`Unpin workspace ${F.label}`:`Pin workspace ${F.label}`,title:F.isFavorite?"Unpin workspace":"Pin workspace",onClick:ge=>{ge.stopPropagation(),U(F)},className:`inline-flex h-7 w-7 items-center justify-center rounded-full border transition ${F.isFavorite?"border-amber-300/40 bg-amber-300/15 text-amber-200":"border-stone-700 bg-stone-900/72 text-stone-500 hover:text-stone-200"}`,children:h.jsx(Dq,{active:F.isFavorite})})]}),h.jsx("div",{className:"flex min-w-0 items-start gap-3 pr-[4.6rem]",children:h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsxs("div",{className:"flex min-w-0 items-center gap-1",children:[h.jsx("p",{className:"min-w-0 max-w-full truncate text-base font-semibold text-stone-100 sm:text-lg",title:F.label,children:F.label}),h.jsx("button",{type:"button",onClick:ge=>{ge.stopPropagation(),P(F)},"aria-label":`Rename workspace ${F.label}`,className:"inline-flex h-4 w-4 shrink-0 items-center justify-center text-stone-500 transition hover:text-stone-100",children:h.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3 w-3 fill-current",children:h.jsx("path",{d:"m11.9 1.6 2.5 2.5-8.2 8.2-3.3.7.7-3.3 8.3-8.1Zm-7.3 8.7-.3 1.3 1.3-.3 6.9-6.9-1-1-6.9 6.9Zm8.8-7.8-1-1-1 1 1 1 1-1Z"})})})]}),h.jsx("button",{type:"button","aria-label":F.absPath,title:F.absPath,onClick:ge=>{ge.stopPropagation(),v(F.absPath)},className:"mt-1 inline-block max-w-full overflow-hidden whitespace-nowrap text-left text-[9px] leading-4 text-stone-500 transition hover:text-stone-300",children:Oq(F.absPath)}),h.jsx("div",{className:"mt-2 flex flex-wrap items-center gap-2 text-xs text-stone-500",children:h.jsxs("span",{className:"min-w-0 truncate",children:["Last opened: ",Iq(F.lastOpenedAt)]})})]})})]},F.id))}),h.jsx(I1,{open:c!==null,title:"Rename Workspace",label:"Workspace Label",value:m,busy:g!==null,onChange:p,onCancel:H,onSubmit:()=>c?G(c):void 0}),h.jsx(wC,{open:E!==null,title:"Workspace Path",text:E??"",onClose:()=>v(null)}),h.jsx(HC,{open:k!==null,title:"Delete Workspace",description:k?`Delete ${k.label} from supervisor. This also removes its threads and local supervisor metadata.`:"",confirmLabel:"Delete Workspace",busy:S,onCancel:()=>{S||C(null)},onConfirm:()=>void ue()})]})}const FC="remote-codex-theme-mode";function Pq(){if(typeof window>"u")return"system";const e=window.localStorage.getItem(FC);return e==="light"||e==="dark"||e==="system"?e:"system"}function Bq(){return typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function Uq({themeMode:e,setThemeMode:t,effectiveTheme:n}){const[r,s]=T.useState(!1),[l,o]=T.useState(!1),c=Ur(),d=/^\/threads\/[^/]+$/.test(c.pathname),m=c.pathname==="/threads",p=d||m,g=m||d,y=c.pathname==="/workspaces",E=y||m;return T.useEffect(()=>{s(!1)},[c.pathname,c.search]),h.jsxs(tv.Provider,{value:{navOpen:r,openNav:()=>s(!0),toggleNav:()=>s(v=>!v),closeNav:()=>s(!1),settingsOpen:l,openSettings:()=>{s(!1),o(!0)},closeSettings:()=>o(!1),themeMode:e,setThemeMode:t,effectiveTheme:n},children:[h.jsxs("div",{className:`bg-[var(--app-bg)] text-[var(--app-fg)] ${p?"fixed inset-0 overflow-hidden overscroll-none":"min-h-screen"}`,children:[!E&&h.jsxs("div",{className:`fixed left-4 top-4 z-50 ${d?"hidden sm:block":""}`,children:[h.jsx(kg,{}),h.jsx(Cg,{className:"mt-3 w-[min(22rem,calc(100vw-2rem))]"})]}),h.jsx("main",{className:`mx-auto w-full max-w-[1600px] ${p?"absolute inset-0 pb-0 sm:pb-4":"pb-4"} ${g?d||m?"pt-[env(safe-area-inset-top)] sm:pt-4":"pt-[calc(env(safe-area-inset-top)+4rem)] sm:pt-4":y?"pt-[env(safe-area-inset-top)] sm:pt-4":"pt-4"} ${p?"overflow-hidden overscroll-none px-0 sm:px-6":"px-4 sm:px-6"}`,children:h.jsx("section",{className:`min-w-0 ${p?"h-full overflow-hidden overscroll-none":""}`,children:h.jsx(n5,{})})})]}),h.jsx(A6,{})]})}function Hq(){const[e,t]=T.useState(()=>Pq()),[n,r]=T.useState(()=>Bq()),s=e==="system"?n:e;return T.useEffect(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;const l=window.matchMedia("(prefers-color-scheme: dark)"),o=()=>{r(l.matches?"dark":"light")};return o(),typeof l.addEventListener=="function"?l.addEventListener("change",o):l.addListener(o),()=>{typeof l.removeEventListener=="function"?l.removeEventListener("change",o):l.removeListener(o)}},[]),T.useEffect(()=>{typeof window>"u"||window.localStorage.setItem(FC,e)},[e]),T.useEffect(()=>{const l=document.documentElement;l.dataset.themeMode=e,l.dataset.themeEffective=s,l.style.colorScheme=s},[s,e]),h.jsx("div",{className:"theme-shell theme-scrollbar",children:h.jsx(N5,{children:h.jsxs(a5,{children:[h.jsx(Ei,{path:"/",element:h.jsx(N6,{})}),h.jsxs(Ei,{element:h.jsx(Uq,{themeMode:e,setThemeMode:t,effectiveTheme:s}),children:[h.jsx(Ei,{path:"/workspaces",element:h.jsx(Mq,{})}),h.jsx(Ei,{path:"/workspaces/new",element:h.jsx(Rq,{})}),h.jsx(Ei,{path:"/threads",element:h.jsx(Aq,{})}),h.jsx(Ei,{path:"/threads/import",element:h.jsx(kq,{})}),h.jsx(Ei,{path:"/threads/new",element:h.jsx(Cq,{})}),h.jsx(Ei,{path:"/threads/:id",element:h.jsx(wq,{})})]})]})})})}nN.createRoot(document.getElementById("root")).render(h.jsx(QA.StrictMode,{children:h.jsx(Hq,{})}));const zq=Object.freeze(Object.defineProperty({__proto__:null,Mermaid:vC},Symbol.toStringTag,{value:"Module"}));export{B$ as A,Wq as L,Pr as R,Bf as g,h as j,T as r};
|