impactus-swarm 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.
Potentially problematic release.
This version of impactus-swarm might be problematic. Click here for more details.
- package/bin/cli.js +189 -0
- package/package.json +42 -0
- package/server/main.js +568 -0
- package/web/assets/abap-BdImnpbu.js +1 -0
- package/web/assets/actionscript-3-CoDkCxhg.js +1 -0
- package/web/assets/ada-bCR0ucgS.js +1 -0
- package/web/assets/andromeeda-C4gqWexZ.js +1 -0
- package/web/assets/angular-html-CU67Zn6k.js +1 -0
- package/web/assets/angular-ts-BwZT4LLn.js +1 -0
- package/web/assets/apache-Pmp26Uib.js +1 -0
- package/web/assets/apex-D8_7TLub.js +1 -0
- package/web/assets/apl-dKokRX4l.js +1 -0
- package/web/assets/applescript-Co6uUVPk.js +1 -0
- package/web/assets/ara-BRHolxvo.js +1 -0
- package/web/assets/asciidoc-Ve4PFQV2.js +1 -0
- package/web/assets/asm-D_Q5rh1f.js +1 -0
- package/web/assets/astro-CbQHKStN.js +1 -0
- package/web/assets/aurora-x-D-2ljcwZ.js +1 -0
- package/web/assets/awk-DMzUqQB5.js +1 -0
- package/web/assets/ayu-dark-DYE7WIF3.js +1 -0
- package/web/assets/ayu-light-BA47KaF1.js +1 -0
- package/web/assets/ayu-mirage-32ctXXKs.js +1 -0
- package/web/assets/ballerina-BFfxhgS-.js +1 -0
- package/web/assets/bat-BkioyH1T.js +1 -0
- package/web/assets/beancount-k_qm7-4y.js +1 -0
- package/web/assets/berry-uYugtg8r.js +1 -0
- package/web/assets/bibtex-CHM0blh-.js +1 -0
- package/web/assets/bicep-Bmn6On1c.js +1 -0
- package/web/assets/bird2-DPOp833l.js +1 -0
- package/web/assets/blade-D4QpJJKB.js +1 -0
- package/web/assets/bsl-BO_Y6i37.js +1 -0
- package/web/assets/c-BIGW1oBm.js +1 -0
- package/web/assets/c3-eo99z4R2.js +1 -0
- package/web/assets/cadence-Bv_4Rxtq.js +1 -0
- package/web/assets/cairo-KRGpt6FW.js +1 -0
- package/web/assets/catppuccin-frappe-DFWUc33u.js +1 -0
- package/web/assets/catppuccin-latte-C9dUb6Cb.js +1 -0
- package/web/assets/catppuccin-macchiato-DQyhUUbL.js +1 -0
- package/web/assets/catppuccin-mocha-D87Tk5Gz.js +1 -0
- package/web/assets/clarity-D53aC0YG.js +1 -0
- package/web/assets/clojure-P80f7IUj.js +1 -0
- package/web/assets/cmake-D1j8_8rp.js +1 -0
- package/web/assets/cobol-nwyudZeR.js +1 -0
- package/web/assets/codeowners-Bp6g37R7.js +1 -0
- package/web/assets/codeql-DsOJ9woJ.js +1 -0
- package/web/assets/coffee-Ch7k5sss.js +1 -0
- package/web/assets/common-lisp-Cg-RD9OK.js +1 -0
- package/web/assets/coq-DkFqJrB1.js +1 -0
- package/web/assets/cpp-CofmeUqb.js +1 -0
- package/web/assets/crystal-tKQVLTB8.js +1 -0
- package/web/assets/csharp-COcwbKMJ.js +1 -0
- package/web/assets/css-DPfMkruS.js +1 -0
- package/web/assets/csv-fuZLfV_i.js +1 -0
- package/web/assets/cue-D82EKSYY.js +1 -0
- package/web/assets/cypher-COkxafJQ.js +1 -0
- package/web/assets/d-85-TOEBH.js +1 -0
- package/web/assets/dark-plus-C3mMm8J8.js +1 -0
- package/web/assets/dart-CF10PKvl.js +1 -0
- package/web/assets/dax-CEL-wOlO.js +1 -0
- package/web/assets/desktop-BmXAJ9_W.js +1 -0
- package/web/assets/diff-D97Zzqfu.js +1 -0
- package/web/assets/docker-BcOcwvcX.js +1 -0
- package/web/assets/dotenv-Da5cRb03.js +1 -0
- package/web/assets/dracula-BzJJZx-M.js +1 -0
- package/web/assets/dracula-soft-BXkSAIEj.js +1 -0
- package/web/assets/dream-maker-BtqSS_iP.js +1 -0
- package/web/assets/edge-BkV0erSs.js +1 -0
- package/web/assets/elixir-CDX3lj18.js +1 -0
- package/web/assets/elm-DbKCFpqz.js +1 -0
- package/web/assets/emacs-lisp-C9XAeP06.js +1 -0
- package/web/assets/erb-B12qg9BL.js +1 -0
- package/web/assets/erlang-DsQrWhSR.js +1 -0
- package/web/assets/everforest-dark-BgDCqdQA.js +1 -0
- package/web/assets/everforest-light-C8M2exoo.js +1 -0
- package/web/assets/fennel-BYunw83y.js +1 -0
- package/web/assets/fish-BvzEVeQv.js +1 -0
- package/web/assets/fluent-C4IJs8-o.js +1 -0
- package/web/assets/fortran-fixed-form-CkoXwp7k.js +1 -0
- package/web/assets/fortran-free-form-BxgE0vQu.js +1 -0
- package/web/assets/fsharp-CXgrBDvD.js +1 -0
- package/web/assets/gdresource-BOOCDP_w.js +1 -0
- package/web/assets/gdscript-C5YyOfLZ.js +1 -0
- package/web/assets/gdshader-DkwncUOv.js +1 -0
- package/web/assets/genie-D0YGMca9.js +1 -0
- package/web/assets/gherkin-DyxjwDmM.js +1 -0
- package/web/assets/git-commit-F4YmCXRG.js +1 -0
- package/web/assets/git-rebase-r7XF79zn.js +1 -0
- package/web/assets/github-dark-DHJKELXO.js +1 -0
- package/web/assets/github-dark-default-Cuk6v7N8.js +1 -0
- package/web/assets/github-dark-dimmed-DH5Ifo-i.js +1 -0
- package/web/assets/github-dark-high-contrast-E3gJ1_iC.js +1 -0
- package/web/assets/github-light-DAi9KRSo.js +1 -0
- package/web/assets/github-light-default-D7oLnXFd.js +1 -0
- package/web/assets/github-light-high-contrast-BfjtVDDH.js +1 -0
- package/web/assets/gleam-BspZqrRM.js +1 -0
- package/web/assets/glimmer-js-Rg0-pVw9.js +1 -0
- package/web/assets/glimmer-ts-U6CK756n.js +1 -0
- package/web/assets/glsl-DplSGwfg.js +1 -0
- package/web/assets/gn-n2N0HUVH.js +1 -0
- package/web/assets/gnuplot-DdkO51Og.js +1 -0
- package/web/assets/go-CxLEBnE3.js +1 -0
- package/web/assets/graphql-ChdNCCLP.js +1 -0
- package/web/assets/groovy-gcz8RCvz.js +1 -0
- package/web/assets/gruvbox-dark-hard-CFHQjOhq.js +1 -0
- package/web/assets/gruvbox-dark-medium-GsRaNv29.js +1 -0
- package/web/assets/gruvbox-dark-soft-CVdnzihN.js +1 -0
- package/web/assets/gruvbox-light-hard-CH1njM8p.js +1 -0
- package/web/assets/gruvbox-light-medium-DRw_LuNl.js +1 -0
- package/web/assets/gruvbox-light-soft-hJgmCMqR.js +1 -0
- package/web/assets/hack-CaT9iCJl.js +1 -0
- package/web/assets/haml-B8DHNrY2.js +1 -0
- package/web/assets/handlebars-BL8al0AC.js +1 -0
- package/web/assets/haskell-Df6bDoY_.js +1 -0
- package/web/assets/haxe-CzTSHFRz.js +1 -0
- package/web/assets/hcl-BWvSN4gD.js +1 -0
- package/web/assets/hjson-D5-asLiD.js +1 -0
- package/web/assets/hlsl-D3lLCCz7.js +1 -0
- package/web/assets/horizon-BUw7H-hv.js +1 -0
- package/web/assets/horizon-bright-Cn-bp-IR.js +1 -0
- package/web/assets/houston-DnULxvSX.js +1 -0
- package/web/assets/html-GMplVEZG.js +1 -0
- package/web/assets/html-derivative-BFtXZ54Q.js +1 -0
- package/web/assets/http-jrhK8wxY.js +1 -0
- package/web/assets/hurl-irOxFIW8.js +1 -0
- package/web/assets/hxml-Bvhsp5Yf.js +1 -0
- package/web/assets/hy-DFXneXwc.js +1 -0
- package/web/assets/imba-DGztddWO.js +1 -0
- package/web/assets/index-B26PZgLN.css +32 -0
- package/web/assets/index-BPxuvrOD.js +66 -0
- package/web/assets/index-Bf7dLvcq.js +107 -0
- package/web/assets/index-Bt1qnI1D.css +32 -0
- package/web/assets/index-BtXLpAW0.js +107 -0
- package/web/assets/index-C7Xu173F.js +107 -0
- package/web/assets/index-CPRX44rP.js +106 -0
- package/web/assets/index-Cc3rknU0.css +32 -0
- package/web/assets/index-Cqp_OfVm.css +32 -0
- package/web/assets/index-D3wDU_n4.css +32 -0
- package/web/assets/index-DE7DcjO8.js +66 -0
- package/web/assets/index-DN1qYqDR.js +2019 -0
- package/web/assets/index-DV88b3Yn.js +107 -0
- package/web/assets/index-Db1DwSg_.css +32 -0
- package/web/assets/index-Dc20OqL5.js +58 -0
- package/web/assets/index-DePLYgQ1.js +66 -0
- package/web/assets/index-DgCe5Dtw.css +32 -0
- package/web/assets/index-DosPiAmQ.css +32 -0
- package/web/assets/index-DsgyEjGR.js +58 -0
- package/web/assets/index-SKqT9S_7.js +107 -0
- package/web/assets/index-u16BRiHR.css +32 -0
- package/web/assets/ini-BEwlwnbL.js +1 -0
- package/web/assets/java-CylS5w8V.js +1 -0
- package/web/assets/javascript-wDzz0qaB.js +1 -0
- package/web/assets/jinja-4LBKfQ-Z.js +1 -0
- package/web/assets/jison-wvAkD_A8.js +1 -0
- package/web/assets/json-Cp-IABpG.js +1 -0
- package/web/assets/json5-C9tS-k6U.js +1 -0
- package/web/assets/jsonc-Des-eS-w.js +1 -0
- package/web/assets/jsonl-DcaNXYhu.js +1 -0
- package/web/assets/jsonnet-DFQXde-d.js +1 -0
- package/web/assets/jssm-C2t-YnRu.js +1 -0
- package/web/assets/jsx-g9-lgVsj.js +1 -0
- package/web/assets/julia-CxzCAyBv.js +1 -0
- package/web/assets/just-Cw27pwNe.js +1 -0
- package/web/assets/kanagawa-dragon-CkXjmgJE.js +1 -0
- package/web/assets/kanagawa-lotus-CfQXZHmo.js +1 -0
- package/web/assets/kanagawa-wave-DWedfzmr.js +1 -0
- package/web/assets/kdl-DV7GczEv.js +1 -0
- package/web/assets/kotlin-BdnUsdx6.js +1 -0
- package/web/assets/kusto-DZf3V79B.js +1 -0
- package/web/assets/laserwave-DUszq2jm.js +1 -0
- package/web/assets/latex-CWtU0Tv5.js +1 -0
- package/web/assets/lean-BZvkOJ9d.js +1 -0
- package/web/assets/less-B1dDrJ26.js +1 -0
- package/web/assets/light-plus-B7mTdjB0.js +1 -0
- package/web/assets/liquid-DYVedYrR.js +1 -0
- package/web/assets/llvm-DjAJT7YJ.js +1 -0
- package/web/assets/log-2UxHyX5q.js +1 -0
- package/web/assets/logo-BtOb2qkB.js +1 -0
- package/web/assets/lua-BaeVxFsk.js +1 -0
- package/web/assets/luau-C-HG3fhB.js +1 -0
- package/web/assets/make-CHLpvVh8.js +1 -0
- package/web/assets/markdown-Cvjx9yec.js +1 -0
- package/web/assets/marko-CnJfTvn9.js +1 -0
- package/web/assets/material-theme-D5KoaKCx.js +1 -0
- package/web/assets/material-theme-darker-BfHTSMKl.js +1 -0
- package/web/assets/material-theme-lighter-B0m2ddpp.js +1 -0
- package/web/assets/material-theme-ocean-CyktbL80.js +1 -0
- package/web/assets/material-theme-palenight-Csfq5Kiy.js +1 -0
- package/web/assets/matlab-D7o27uSR.js +1 -0
- package/web/assets/mdc-BMNejdWA.js +1 -0
- package/web/assets/mdx-Cmh6b_Ma.js +1 -0
- package/web/assets/mermaid-mWjccvbQ.js +1 -0
- package/web/assets/min-dark-CafNBF8u.js +1 -0
- package/web/assets/min-light-CTRr51gU.js +1 -0
- package/web/assets/mipsasm-CKIfxQSi.js +1 -0
- package/web/assets/mojo-rZm6bMo-.js +1 -0
- package/web/assets/monokai-D4h5O-jR.js +1 -0
- package/web/assets/moonbit-_H4v1dQx.js +1 -0
- package/web/assets/move-IF9eRakj.js +1 -0
- package/web/assets/narrat-DRg8JJMk.js +1 -0
- package/web/assets/nextflow-Zz6hmt5N.js +1 -0
- package/web/assets/nextflow-groovy-BeH2EWoN.js +1 -0
- package/web/assets/nginx-BpAMiNFr.js +1 -0
- package/web/assets/night-owl-C39BiMTA.js +1 -0
- package/web/assets/night-owl-light-CMTm3GFP.js +1 -0
- package/web/assets/nim-CVrawwO9.js +1 -0
- package/web/assets/nix-CwoSXNpI.js +1 -0
- package/web/assets/nord-Ddv68eIx.js +1 -0
- package/web/assets/nushell-Cz2AlsmD.js +1 -0
- package/web/assets/objective-c-DXmwc3jG.js +1 -0
- package/web/assets/objective-cpp-CLxacb5B.js +1 -0
- package/web/assets/ocaml-C0hk2d4L.js +1 -0
- package/web/assets/odin-BBf5iR-q.js +1 -0
- package/web/assets/one-dark-pro-DVMEJ2y_.js +1 -0
- package/web/assets/one-light-C3Wv6jpd.js +1 -0
- package/web/assets/openscad-C4EeE6gA.js +1 -0
- package/web/assets/pascal-D93ZcfNL.js +1 -0
- package/web/assets/perl-C0TMdlhV.js +1 -0
- package/web/assets/php-Dhbhpdrm.js +1 -0
- package/web/assets/pierre-dark-ClCaJvdG.js +1 -0
- package/web/assets/pierre-light-zjGsWSiE.js +1 -0
- package/web/assets/pkl-u5AG7uiY.js +1 -0
- package/web/assets/plastic-3e1v2bzS.js +1 -0
- package/web/assets/plsql-ChMvpjG-.js +1 -0
- package/web/assets/po-BTJTHyun.js +1 -0
- package/web/assets/poimandres-CS3Unz2-.js +1 -0
- package/web/assets/polar-C0HS_06l.js +1 -0
- package/web/assets/postcss-CXtECtnM.js +1 -0
- package/web/assets/powerquery-CEu0bR-o.js +1 -0
- package/web/assets/powershell-Dpen1YoG.js +1 -0
- package/web/assets/prisma-Dd19v3D-.js +1 -0
- package/web/assets/prolog-CbFg5uaA.js +1 -0
- package/web/assets/proto-C7zT0LnQ.js +1 -0
- package/web/assets/pug-CGlum2m_.js +1 -0
- package/web/assets/puppet-BMWR74SV.js +1 -0
- package/web/assets/purescript-CklMAg4u.js +1 -0
- package/web/assets/python-B6aJPvgy.js +1 -0
- package/web/assets/qml-3beO22l8.js +1 -0
- package/web/assets/qmldir-C8lEn-DE.js +1 -0
- package/web/assets/qss-IeuSbFQv.js +1 -0
- package/web/assets/r-Dspwwk_N.js +1 -0
- package/web/assets/racket-BqYA7rlc.js +1 -0
- package/web/assets/raku-DXvB9xmW.js +1 -0
- package/web/assets/razor-Uh8Bk_45.js +1 -0
- package/web/assets/red-bN70gL4F.js +1 -0
- package/web/assets/reg-C-SQnVFl.js +1 -0
- package/web/assets/regexp-CDVJQ6XC.js +1 -0
- package/web/assets/rel-C3B-1QV4.js +1 -0
- package/web/assets/riscv-BM1_JUlF.js +1 -0
- package/web/assets/ron-D8l8udqQ.js +1 -0
- package/web/assets/rose-pine-dawn-DHQR4-dF.js +1 -0
- package/web/assets/rose-pine-moon-D4_iv3hh.js +1 -0
- package/web/assets/rose-pine-qdsjHGoJ.js +1 -0
- package/web/assets/rosmsg-BJDFO7_C.js +1 -0
- package/web/assets/rst-BrH8l1NY.js +1 -0
- package/web/assets/ruby-Dw2BHqvy.js +1 -0
- package/web/assets/rust-B1yitclQ.js +1 -0
- package/web/assets/sas-cz2c8ADy.js +1 -0
- package/web/assets/sass-Cj5Yp3dK.js +1 -0
- package/web/assets/scala-C151Ov-r.js +1 -0
- package/web/assets/scheme-C98Dy4si.js +1 -0
- package/web/assets/scss-OYdSNvt2.js +1 -0
- package/web/assets/sdbl-DVxCFoDh.js +1 -0
- package/web/assets/shaderlab-Dg9Lc6iA.js +1 -0
- package/web/assets/shellscript-Yzrsuije.js +1 -0
- package/web/assets/shellsession-BADoaaVG.js +1 -0
- package/web/assets/slack-dark-BthQWCQV.js +1 -0
- package/web/assets/slack-ochin-DqwNpetd.js +1 -0
- package/web/assets/smalltalk-BERRCDM3.js +1 -0
- package/web/assets/snazzy-light-Bw305WKR.js +1 -0
- package/web/assets/solarized-dark-DXbdFlpD.js +1 -0
- package/web/assets/solarized-light-L9t79GZl.js +1 -0
- package/web/assets/solidity-rGO070M0.js +1 -0
- package/web/assets/soy-Brmx7dQM.js +1 -0
- package/web/assets/sparql-rVzFXLq3.js +1 -0
- package/web/assets/splunk-BtCnVYZw.js +1 -0
- package/web/assets/sql-BLtJtn59.js +1 -0
- package/web/assets/ssh-config-_ykCGR6B.js +1 -0
- package/web/assets/stata-BH5u7GGu.js +1 -0
- package/web/assets/stylus-BEDo0Tqx.js +1 -0
- package/web/assets/surrealql-Bq5Q-fJD.js +1 -0
- package/web/assets/svelte-C_ipcX3V.js +1 -0
- package/web/assets/swift-D82vCrfD.js +1 -0
- package/web/assets/synthwave-84-CbfX1IO0.js +1 -0
- package/web/assets/system-verilog-CnnmHF94.js +1 -0
- package/web/assets/systemd-4A_iFExJ.js +1 -0
- package/web/assets/talonscript-CkByrt1z.js +1 -0
- package/web/assets/tasl-QIJgUcNo.js +1 -0
- package/web/assets/tcl-dwOrl1Do.js +1 -0
- package/web/assets/templ-P3uqSqPl.js +1 -0
- package/web/assets/terraform-BETggiCN.js +1 -0
- package/web/assets/tex-idrVyKtj.js +1 -0
- package/web/assets/tokyo-night-hegEt444.js +1 -0
- package/web/assets/toml-vGWfd6FD.js +1 -0
- package/web/assets/ts-tags-zn1MmPIZ.js +1 -0
- package/web/assets/tsv-B_m7g4N7.js +1 -0
- package/web/assets/tsx-COt5Ahok.js +1 -0
- package/web/assets/turtle-BsS91CYL.js +1 -0
- package/web/assets/twig-DNn4PbVi.js +1 -0
- package/web/assets/typescript-BPQ3VLAy.js +1 -0
- package/web/assets/typespec-BGHnOYBU.js +1 -0
- package/web/assets/typst-DHCkPAjA.js +1 -0
- package/web/assets/v-BcVCzyr7.js +1 -0
- package/web/assets/vala-CsfeWuGM.js +1 -0
- package/web/assets/vb-D17OF-Vu.js +1 -0
- package/web/assets/vendor-DLeMxNCH.js +17 -0
- package/web/assets/vendor-DtzUpehM.js +17 -0
- package/web/assets/verilog-BQ8w6xss.js +1 -0
- package/web/assets/vesper-DU1UobuO.js +1 -0
- package/web/assets/vhdl-CeAyd5Ju.js +1 -0
- package/web/assets/viml-CJc9bBzg.js +1 -0
- package/web/assets/vitesse-black-Bkuqu6BP.js +1 -0
- package/web/assets/vitesse-dark-D0r3Knsf.js +1 -0
- package/web/assets/vitesse-light-CVO1_9PV.js +1 -0
- package/web/assets/vue-DN_0RTcg.js +1 -0
- package/web/assets/vue-html-AaS7Mt5G.js +1 -0
- package/web/assets/vue-vine-CQOfvN7w.js +1 -0
- package/web/assets/vyper-CDx5xZoG.js +1 -0
- package/web/assets/wasm-CG6Dc4jp.js +1 -0
- package/web/assets/wasm-MzD3tlZU.js +1 -0
- package/web/assets/wenyan-BV7otONQ.js +1 -0
- package/web/assets/wgsl-Dx-B1_4e.js +1 -0
- package/web/assets/wikitext-BhOHFoWU.js +1 -0
- package/web/assets/wit-5i3qLPDT.js +1 -0
- package/web/assets/wolfram-lXgVvXCa.js +1 -0
- package/web/assets/worker-CkgkkPqX.js +155 -0
- package/web/assets/xml-sdJ4AIDG.js +1 -0
- package/web/assets/xsl-CtQFsRM5.js +1 -0
- package/web/assets/xterm-C3JRPngT.js +66 -0
- package/web/assets/yaml-Buea-lGh.js +1 -0
- package/web/assets/zenscript-DVFEvuxE.js +1 -0
- package/web/assets/zig-VOosw3JB.js +1 -0
- package/web/index.html +15 -0
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
var Zs=Object.defineProperty;var Qs=Object.getPrototypeOf;var Ys=Reflect.get;var Bn=t=>{throw TypeError(t)};var Js=(t,e,n)=>e in t?Zs(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var m=(t,e,n)=>Js(t,typeof e!="symbol"?e+"":e,n),Ot=(t,e,n)=>e.has(t)||Bn("Cannot "+n);var H=(t,e,n)=>(Ot(t,e,"read from private field"),n?n.call(t):e.get(t)),ye=(t,e,n)=>e.has(t)?Bn("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),te=(t,e,n,r)=>(Ot(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),Dt=(t,e,n)=>(Ot(t,e,"access private method"),n);var Fn=(t,e,n)=>Ys(Qs(t),n,e);let U=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function eo(t){return Sn(t)}function Sn(t){return Array.isArray(t)?to(t):t instanceof RegExp?t:typeof t=="object"?no(t):t}function to(t){let e=[];for(let n=0,r=t.length;n<r;n++)e[n]=Sn(t[n]);return e}function no(t){let e={};for(let n in t)e[n]=Sn(t[n]);return e}function Dr(t,...e){return e.forEach(n=>{for(let r in n)t[r]=n[r]}),t}function Gr(t){const e=~t.lastIndexOf("/")||~t.lastIndexOf("\\");return e===0?t:~e===t.length-1?Gr(t.substring(0,t.length-1)):t.substr(~e+1)}var Gt=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,nt=class{static hasCaptures(t){return t===null?!1:(Gt.lastIndex=0,Gt.test(t))}static replaceCaptures(t,e,n){return t.replace(Gt,(r,s,o,i)=>{let a=n[parseInt(s||o,10)];if(a){let l=e.substring(a.start,a.end);for(;l[0]===".";)l=l.substring(1);switch(i){case"downcase":return l.toLowerCase();case"upcase":return l.toUpperCase();default:return l}}else return r})}};function Br(t,e){return t<e?-1:t>e?1:0}function Fr(t,e){if(t===null&&e===null)return 0;if(!t)return-1;if(!e)return 1;let n=t.length,r=e.length;if(n===r){for(let s=0;s<n;s++){let o=Br(t[s],e[s]);if(o!==0)return o}return 0}return n-r}function Un(t){return!!(/^#[0-9a-f]{6}$/i.test(t)||/^#[0-9a-f]{8}$/i.test(t)||/^#[0-9a-f]{3}$/i.test(t)||/^#[0-9a-f]{4}$/i.test(t))}function Ur(t){return t.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var jr=class{constructor(t){m(this,"cache",new Map);this.fn=t}get(t){if(this.cache.has(t))return this.cache.get(t);const e=this.fn(t);return this.cache.set(t,e),e}},gt=class{constructor(t,e,n){m(this,"_cachedMatchRoot",new jr(t=>this._root.match(t)));this._colorMap=t,this._defaults=e,this._root=n}static createFromRawTheme(t,e){return this.createFromParsedTheme(oo(t),e)}static createFromParsedTheme(t,e){return ao(t,e)}getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(t){if(t===null)return this._defaults;const e=t.scopeName,r=this._cachedMatchRoot.get(e).find(s=>ro(t.parent,s.parentScopes));return r?new Wr(r.fontStyle,r.foreground,r.background):null}},Bt=class ft{constructor(e,n){this.parent=e,this.scopeName=n}static push(e,n){for(const r of n)e=new ft(e,r);return e}static from(...e){let n=null;for(let r=0;r<e.length;r++)n=new ft(n,e[r]);return n}push(e){return new ft(this,e)}getSegments(){let e=this;const n=[];for(;e;)n.push(e.scopeName),e=e.parent;return n.reverse(),n}toString(){return this.getSegments().join(" ")}extends(e){return this===e?!0:this.parent===null?!1:this.parent.extends(e)}getExtensionIfDefined(e){const n=[];let r=this;for(;r&&r!==e;)n.push(r.scopeName),r=r.parent;return r===e?n.reverse():void 0}};function ro(t,e){if(e.length===0)return!0;for(let n=0;n<e.length;n++){let r=e[n],s=!1;if(r===">"){if(n===e.length-1)return!1;r=e[++n],s=!0}for(;t&&!so(t.scopeName,r);){if(s)return!1;t=t.parent}if(!t)return!1;t=t.parent}return!0}function so(t,e){return e===t||t.startsWith(e)&&t[e.length]==="."}var Wr=class{constructor(t,e,n){this.fontStyle=t,this.foregroundId=e,this.backgroundId=n}};function oo(t){if(!t)return[];if(!t.settings||!Array.isArray(t.settings))return[];let e=t.settings,n=[],r=0;for(let s=0,o=e.length;s<o;s++){let i=e[s];if(!i.settings)continue;let a;if(typeof i.scope=="string"){let u=i.scope;u=u.replace(/^[,]+/,""),u=u.replace(/[,]+$/,""),a=u.split(",")}else Array.isArray(i.scope)?a=i.scope:a=[""];let l=-1;if(typeof i.settings.fontStyle=="string"){l=0;let u=i.settings.fontStyle.split(" ");for(let h=0,d=u.length;h<d;h++)switch(u[h]){case"italic":l=l|1;break;case"bold":l=l|2;break;case"underline":l=l|4;break;case"strikethrough":l=l|8;break}}let c=null;typeof i.settings.foreground=="string"&&Un(i.settings.foreground)&&(c=i.settings.foreground);let f=null;typeof i.settings.background=="string"&&Un(i.settings.background)&&(f=i.settings.background);for(let u=0,h=a.length;u<h;u++){let p=a[u].trim().split(" "),b=p[p.length-1],C=null;p.length>1&&(C=p.slice(0,p.length-1),C.reverse()),n[r++]=new io(b,C,s,l,c,f)}}return n}var io=class{constructor(t,e,n,r,s,o){this.scope=t,this.parentScopes=e,this.index=n,this.fontStyle=r,this.foreground=s,this.background=o}},z=(t=>(t[t.NotSet=-1]="NotSet",t[t.None=0]="None",t[t.Italic=1]="Italic",t[t.Bold=2]="Bold",t[t.Underline=4]="Underline",t[t.Strikethrough=8]="Strikethrough",t))(z||{});function ao(t,e){t.sort((l,c)=>{let f=Br(l.scope,c.scope);return f!==0||(f=Fr(l.parentScopes,c.parentScopes),f!==0)?f:l.index-c.index});let n=0,r="#000000",s="#ffffff";for(;t.length>=1&&t[0].scope==="";){let l=t.shift();l.fontStyle!==-1&&(n=l.fontStyle),l.foreground!==null&&(r=l.foreground),l.background!==null&&(s=l.background)}let o=new lo(e),i=new Wr(n,o.getId(r),o.getId(s)),a=new uo(new nn(0,null,-1,0,0),[]);for(let l=0,c=t.length;l<c;l++){let f=t[l];a.insert(0,f.scope,f.parentScopes,f.fontStyle,o.getId(f.foreground),o.getId(f.background))}return new gt(o,i,a)}var lo=class{constructor(t){m(this,"_isFrozen");m(this,"_lastColorId");m(this,"_id2color");m(this,"_color2id");if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(t)){this._isFrozen=!0;for(let e=0,n=t.length;e<n;e++)this._color2id[t[e]]=e,this._id2color[e]=t[e]}else this._isFrozen=!1}getId(t){if(t===null)return 0;t=t.toUpperCase();let e=this._color2id[t];if(e)return e;if(this._isFrozen)throw new Error(`Missing color in color map - ${t}`);return e=++this._lastColorId,this._color2id[t]=e,this._id2color[e]=t,e}getColorMap(){return this._id2color.slice(0)}},co=Object.freeze([]),nn=class zr{constructor(e,n,r,s,o){m(this,"scopeDepth");m(this,"parentScopes");m(this,"fontStyle");m(this,"foreground");m(this,"background");this.scopeDepth=e,this.parentScopes=n||co,this.fontStyle=r,this.foreground=s,this.background=o}clone(){return new zr(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let n=[];for(let r=0,s=e.length;r<s;r++)n[r]=e[r].clone();return n}acceptOverwrite(e,n,r,s){this.scopeDepth>e?console.log("how did this happen?"):this.scopeDepth=e,n!==-1&&(this.fontStyle=n),r!==0&&(this.foreground=r),s!==0&&(this.background=s)}},uo=class rn{constructor(e,n=[],r={}){m(this,"_rulesWithParentScopes");this._mainRule=e,this._children=r,this._rulesWithParentScopes=n}static _cmpBySpecificity(e,n){if(e.scopeDepth!==n.scopeDepth)return n.scopeDepth-e.scopeDepth;let r=0,s=0;for(;e.parentScopes[r]===">"&&r++,n.parentScopes[s]===">"&&s++,!(r>=e.parentScopes.length||s>=n.parentScopes.length);){const o=n.parentScopes[s].length-e.parentScopes[r].length;if(o!==0)return o;r++,s++}return n.parentScopes.length-e.parentScopes.length}match(e){if(e!==""){let r=e.indexOf("."),s,o;if(r===-1?(s=e,o=""):(s=e.substring(0,r),o=e.substring(r+1)),this._children.hasOwnProperty(s))return this._children[s].match(o)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(rn._cmpBySpecificity),n}insert(e,n,r,s,o,i){if(n===""){this._doInsertHere(e,r,s,o,i);return}let a=n.indexOf("."),l,c;a===-1?(l=n,c=""):(l=n.substring(0,a),c=n.substring(a+1));let f;this._children.hasOwnProperty(l)?f=this._children[l]:(f=new rn(this._mainRule.clone(),nn.cloneArr(this._rulesWithParentScopes)),this._children[l]=f),f.insert(e+1,c,r,s,o,i)}_doInsertHere(e,n,r,s,o){if(n===null){this._mainRule.acceptOverwrite(e,r,s,o);return}for(let i=0,a=this._rulesWithParentScopes.length;i<a;i++){let l=this._rulesWithParentScopes[i];if(Fr(l.parentScopes,n)===0){l.acceptOverwrite(e,r,s,o);return}}r===-1&&(r=this._mainRule.fontStyle),s===0&&(s=this._mainRule.foreground),o===0&&(o=this._mainRule.background),this._rulesWithParentScopes.push(new nn(e,n,r,s,o))}},Me=class Q{static toBinaryStr(e){return e.toString(2).padStart(32,"0")}static print(e){const n=Q.getLanguageId(e),r=Q.getTokenType(e),s=Q.getFontStyle(e),o=Q.getForeground(e),i=Q.getBackground(e);console.log({languageId:n,tokenType:r,fontStyle:s,foreground:o,background:i})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return(e&1024)!==0}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(e,n,r,s,o,i,a){let l=Q.getLanguageId(e),c=Q.getTokenType(e),f=Q.containsBalancedBrackets(e)?1:0,u=Q.getFontStyle(e),h=Q.getForeground(e),d=Q.getBackground(e);return n!==0&&(l=n),r!==8&&(c=r),s!==null&&(f=s?1:0),o!==-1&&(u=o),i!==0&&(h=i),a!==0&&(d=a),(l<<0|c<<8|f<<10|u<<11|h<<15|d<<24)>>>0}};function mt(t,e){const n=[],r=fo(t);let s=r.next();for(;s!==null;){let l=0;if(s.length===2&&s.charAt(1)===":"){switch(s.charAt(0)){case"R":l=1;break;case"L":l=-1;break;default:console.log(`Unknown priority ${s} in scope selector`)}s=r.next()}let c=i();if(n.push({matcher:c,priority:l}),s!==",")break;s=r.next()}return n;function o(){if(s==="-"){s=r.next();const l=o();return c=>!!l&&!l(c)}if(s==="("){s=r.next();const l=a();return s===")"&&(s=r.next()),l}if(jn(s)){const l=[];do l.push(s),s=r.next();while(jn(s));return c=>e(l,c)}return null}function i(){const l=[];let c=o();for(;c;)l.push(c),c=o();return f=>l.every(u=>u(f))}function a(){const l=[];let c=i();for(;c&&(l.push(c),s==="|"||s===",");){do s=r.next();while(s==="|"||s===",");c=i()}return f=>l.some(u=>u(f))}}function jn(t){return!!t&&!!t.match(/[\w\.:]+/)}function fo(t){let e=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=e.exec(t);return{next:()=>{if(!n)return null;const r=n[0];return n=e.exec(t),r}}}function Hr(t){typeof t.dispose=="function"&&t.dispose()}var qe=class{constructor(t){this.scopeName=t}toKey(){return this.scopeName}},ho=class{constructor(t,e){this.scopeName=t,this.ruleName=e}toKey(){return`${this.scopeName}#${this.ruleName}`}},po=class{constructor(){m(this,"_references",[]);m(this,"_seenReferenceKeys",new Set);m(this,"visitedRule",new Set)}get references(){return this._references}add(t){const e=t.toKey();this._seenReferenceKeys.has(e)||(this._seenReferenceKeys.add(e),this._references.push(t))}},go=class{constructor(t,e){m(this,"seenFullScopeRequests",new Set);m(this,"seenPartialScopeRequests",new Set);m(this,"Q");this.repo=t,this.initialScopeName=e,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new qe(this.initialScopeName)]}processQueue(){const t=this.Q;this.Q=[];const e=new po;for(const n of t)mo(n,this.initialScopeName,this.repo,e);for(const n of e.references)if(n instanceof qe){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 mo(t,e,n,r){const s=n.lookup(t.scopeName);if(!s){if(t.scopeName===e)throw new Error(`No grammar provided for <${e}>`);return}const o=n.lookup(e);t instanceof qe?ht({baseGrammar:o,selfGrammar:s},r):sn(t.ruleName,{baseGrammar:o,selfGrammar:s,repository:s.repository},r);const i=n.injections(t.scopeName);if(i)for(const a of i)r.add(new qe(a))}function sn(t,e,n){if(e.repository&&e.repository[t]){const r=e.repository[t];yt([r],e,n)}}function ht(t,e){t.selfGrammar.patterns&&Array.isArray(t.selfGrammar.patterns)&&yt(t.selfGrammar.patterns,{...t,repository:t.selfGrammar.repository},e),t.selfGrammar.injections&&yt(Object.values(t.selfGrammar.injections),{...t,repository:t.selfGrammar.repository},e)}function yt(t,e,n){for(const r of t){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);const s=r.repository?Dr({},e.repository,r.repository):e.repository;Array.isArray(r.patterns)&&yt(r.patterns,{...e,repository:s},n);const o=r.include;if(!o)continue;const i=qr(o);switch(i.kind){case 0:ht({...e,selfGrammar:e.baseGrammar},n);break;case 1:ht(e,n);break;case 2:sn(i.ruleName,{...e,repository:s},n);break;case 3:case 4:const a=i.scopeName===e.selfGrammar.scopeName?e.selfGrammar:i.scopeName===e.baseGrammar.scopeName?e.baseGrammar:void 0;if(a){const l={baseGrammar:e.baseGrammar,selfGrammar:a,repository:s};i.kind===4?sn(i.ruleName,l,n):ht(l,n)}else i.kind===4?n.add(new ho(i.scopeName,i.ruleName)):n.add(new qe(i.scopeName));break}}}var yo=class{constructor(){m(this,"kind",0)}},bo=class{constructor(){m(this,"kind",1)}},wo=class{constructor(t){m(this,"kind",2);this.ruleName=t}},Co=class{constructor(t){m(this,"kind",3);this.scopeName=t}},_o=class{constructor(t,e){m(this,"kind",4);this.scopeName=t,this.ruleName=e}};function qr(t){if(t==="$base")return new yo;if(t==="$self")return new bo;const e=t.indexOf("#");if(e===-1)return new Co(t);if(e===0)return new wo(t.substring(1));{const n=t.substring(0,e),r=t.substring(e+1);return new _o(n,r)}}var So=/\\(\d+)/,Wn=/\\(\d+)/g,ko=-1,Vr=-2;var Je=class{constructor(t,e,n,r){m(this,"$location");m(this,"id");m(this,"_nameIsCapturing");m(this,"_name");m(this,"_contentNameIsCapturing");m(this,"_contentName");this.$location=t,this.id=e,this._name=n||null,this._nameIsCapturing=nt.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=nt.hasCaptures(this._contentName)}get debugName(){const t=this.$location?`${Gr(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${t}`}getName(t,e){return!this._nameIsCapturing||this._name===null||t===null||e===null?this._name:nt.replaceCaptures(this._name,t,e)}getContentName(t,e){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:nt.replaceCaptures(this._contentName,t,e)}},xo=class extends Je{constructor(e,n,r,s,o){super(e,n,r,s);m(this,"retokenizeCapturedWithRuleId");this.retokenizeCapturedWithRuleId=o}dispose(){}collectPatterns(e,n){throw new Error("Not supported!")}compile(e,n){throw new Error("Not supported!")}compileAG(e,n,r,s){throw new Error("Not supported!")}},vo=class extends Je{constructor(e,n,r,s,o){super(e,n,r,null);m(this,"_match");m(this,"captures");m(this,"_cachedCompiledPatterns");this._match=new Ve(s,this.id),this.captures=o,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,n){n.push(this._match)}compile(e,n){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,n,r,s){return this._getCachedCompiledPatterns(e).compileAG(e,r,s)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Xe,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},zn=class extends Je{constructor(e,n,r,s,o){super(e,n,r,s);m(this,"hasMissingPatterns");m(this,"patterns");m(this,"_cachedCompiledPatterns");this.patterns=o.patterns,this.hasMissingPatterns=o.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(e,n){for(const r of this.patterns)e.getRule(r).collectPatterns(e,n)}compile(e,n){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,n,r,s){return this._getCachedCompiledPatterns(e).compileAG(e,r,s)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Xe,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},on=class extends Je{constructor(e,n,r,s,o,i,a,l,c,f){super(e,n,r,s);m(this,"_begin");m(this,"beginCaptures");m(this,"_end");m(this,"endHasBackReferences");m(this,"endCaptures");m(this,"applyEndPatternLast");m(this,"hasMissingPatterns");m(this,"patterns");m(this,"_cachedCompiledPatterns");this._begin=new Ve(o,this.id),this.beginCaptures=i,this._end=new Ve(a||"",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=l,this.applyEndPatternLast=c||!1,this.patterns=f.patterns,this.hasMissingPatterns=f.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(e,n){return this._end.resolveBackReferences(e,n)}collectPatterns(e,n){n.push(this._begin)}compile(e,n){return this._getCachedCompiledPatterns(e,n).compile(e)}compileAG(e,n,r,s){return this._getCachedCompiledPatterns(e,n).compileAG(e,r,s)}_getCachedCompiledPatterns(e,n){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Xe;for(const r of this.patterns)e.getRule(r).collectPatterns(e,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}},bt=class extends Je{constructor(e,n,r,s,o,i,a,l,c){super(e,n,r,s);m(this,"_begin");m(this,"beginCaptures");m(this,"whileCaptures");m(this,"_while");m(this,"whileHasBackReferences");m(this,"hasMissingPatterns");m(this,"patterns");m(this,"_cachedCompiledPatterns");m(this,"_cachedCompiledWhilePatterns");this._begin=new Ve(o,this.id),this.beginCaptures=i,this.whileCaptures=l,this._while=new Ve(a,Vr),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=c.patterns,this.hasMissingPatterns=c.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(e,n){return this._while.resolveBackReferences(e,n)}collectPatterns(e,n){n.push(this._begin)}compile(e,n){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,n,r,s){return this._getCachedCompiledPatterns(e).compileAG(e,r,s)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Xe;for(const n of this.patterns)e.getRule(n).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,n){return this._getCachedCompiledWhilePatterns(e,n).compile(e)}compileWhileAG(e,n,r,s){return this._getCachedCompiledWhilePatterns(e,n).compileAG(e,r,s)}_getCachedCompiledWhilePatterns(e,n){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new Xe,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,n||""),this._cachedCompiledWhilePatterns}},Xr=class W{static createCaptureRule(e,n,r,s,o){return e.registerRule(i=>new xo(n,i,r,s,o))}static getCompiledRuleId(e,n,r){return e.id||n.registerRule(s=>{if(e.id=s,e.match)return new vo(e.$vscodeTextmateLocation,e.id,e.name,e.match,W._compileCaptures(e.captures,n,r));if(typeof e.begin>"u"){e.repository&&(r=Dr({},r,e.repository));let o=e.patterns;return typeof o>"u"&&e.include&&(o=[{include:e.include}]),new zn(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,W._compilePatterns(o,n,r))}return e.while?new bt(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,W._compileCaptures(e.beginCaptures||e.captures,n,r),e.while,W._compileCaptures(e.whileCaptures||e.captures,n,r),W._compilePatterns(e.patterns,n,r)):new on(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,W._compileCaptures(e.beginCaptures||e.captures,n,r),e.end,W._compileCaptures(e.endCaptures||e.captures,n,r),e.applyEndPatternLast,W._compilePatterns(e.patterns,n,r))}),e.id}static _compileCaptures(e,n,r){let s=[];if(e){let o=0;for(const i in e){if(i==="$vscodeTextmateLocation")continue;const a=parseInt(i,10);a>o&&(o=a)}for(let i=0;i<=o;i++)s[i]=null;for(const i in e){if(i==="$vscodeTextmateLocation")continue;const a=parseInt(i,10);let l=0;e[i].patterns&&(l=W.getCompiledRuleId(e[i],n,r)),s[a]=W.createCaptureRule(n,e[i].$vscodeTextmateLocation,e[i].name,e[i].contentName,l)}}return s}static _compilePatterns(e,n,r){let s=[];if(e)for(let o=0,i=e.length;o<i;o++){const a=e[o];let l=-1;if(a.include){const c=qr(a.include);switch(c.kind){case 0:case 1:l=W.getCompiledRuleId(r[a.include],n,r);break;case 2:let f=r[c.ruleName];f&&(l=W.getCompiledRuleId(f,n,r));break;case 3:case 4:const u=c.scopeName,h=c.kind===4?c.ruleName:null,d=n.getExternalGrammar(u,r);if(d)if(h){let p=d.repository[h];p&&(l=W.getCompiledRuleId(p,n,d.repository))}else l=W.getCompiledRuleId(d.repository.$self,n,d.repository);break}}else l=W.getCompiledRuleId(a,n,r);if(l!==-1){const c=n.getRule(l);let f=!1;if((c instanceof zn||c instanceof on||c instanceof bt)&&c.hasMissingPatterns&&c.patterns.length===0&&(f=!0),f)continue;s.push(l)}}return{patterns:s,hasMissingPatterns:(e?e.length:0)!==s.length}}},Ve=class Kr{constructor(e,n){m(this,"source");m(this,"ruleId");m(this,"hasAnchor");m(this,"hasBackReferences");m(this,"_anchorCache");if(e&&typeof e=="string"){const r=e.length;let s=0,o=[],i=!1;for(let a=0;a<r;a++)if(e.charAt(a)==="\\"&&a+1<r){const c=e.charAt(a+1);c==="z"?(o.push(e.substring(s,a)),o.push("$(?!\\n)(?<!\\n)"),s=a+2):(c==="A"||c==="G")&&(i=!0),a++}this.hasAnchor=i,s===0?this.source=e:(o.push(e.substring(s,r)),this.source=o.join(""))}else this.hasAnchor=!1,this.source=e;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=n,typeof this.source=="string"?this.hasBackReferences=So.test(this.source):this.hasBackReferences=!1}clone(){return new Kr(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,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=>e.substring(s.start,s.end));return Wn.lastIndex=0,this.source.replace(Wn,(s,o)=>Ur(r[parseInt(o,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let e=[],n=[],r=[],s=[],o,i,a,l;for(o=0,i=this.source.length;o<i;o++)a=this.source.charAt(o),e[o]=a,n[o]=a,r[o]=a,s[o]=a,a==="\\"&&o+1<i&&(l=this.source.charAt(o+1),l==="A"?(e[o+1]="",n[o+1]="",r[o+1]="A",s[o+1]="A"):l==="G"?(e[o+1]="",n[o+1]="G",r[o+1]="",s[o+1]="G"):(e[o+1]=l,n[o+1]=l,r[o+1]=l,s[o+1]=l),o++);return{A0_G0:e.join(""),A0_G1:n.join(""),A1_G0:r.join(""),A1_G1:s.join("")}}resolveAnchors(e,n){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:e?n?this._anchorCache.A1_G1:this._anchorCache.A1_G0:n?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},Xe=class{constructor(){m(this,"_items");m(this,"_hasAnchors");m(this,"_cached");m(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(t){this._items.push(t),this._hasAnchors=this._hasAnchors||t.hasAnchor}unshift(t){this._items.unshift(t),this._hasAnchors=this._hasAnchors||t.hasAnchor}length(){return this._items.length}setSource(t,e){this._items[t].source!==e&&(this._disposeCaches(),this._items[t].setSource(e))}compile(t){if(!this._cached){let e=this._items.map(n=>n.source);this._cached=new Hn(t,e,this._items.map(n=>n.ruleId))}return this._cached}compileAG(t,e,n){return this._hasAnchors?e?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(t,e,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(t,e,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(t,e,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(t,e,n)),this._anchorCache.A0_G0):this.compile(t)}_resolveAnchors(t,e,n){let r=this._items.map(s=>s.resolveAnchors(e,n));return new Hn(t,r,this._items.map(s=>s.ruleId))}},Hn=class{constructor(t,e,n){m(this,"scanner");this.regExps=e,this.rules=n,this.scanner=t.createOnigScanner(e)}dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const t=[];for(let e=0,n=this.rules.length;e<n;e++)t.push(" - "+this.rules[e]+": "+this.regExps[e]);return t.join(`
|
|
2
|
+
`)}findNextMatchSync(t,e,n){const r=this.scanner.findNextMatchSync(t,e,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},Ft=class{constructor(t,e){this.languageId=t,this.tokenType=e}},ce,Io=(ce=class{constructor(e,n){m(this,"_defaultAttributes");m(this,"_embeddedLanguagesMatcher");m(this,"_getBasicScopeAttributes",new jr(e=>{const n=this._scopeToLanguage(e),r=this._toStandardTokenType(e);return new Ft(n,r)}));this._defaultAttributes=new Ft(e,8),this._embeddedLanguagesMatcher=new Eo(Object.entries(n||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(e){return e===null?ce._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(e)}_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(e){const n=e.match(ce.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!")}},m(ce,"_NULL_SCOPE_METADATA",new Ft(0,0)),m(ce,"STANDARD_TOKEN_TYPE_REGEXP",/\b(comment|string|regex|meta\.embedded)\b/),ce),Eo=class{constructor(t){m(this,"values");m(this,"scopesRegExp");if(t.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(t);const e=t.map(([n,r])=>Ur(n));e.sort(),e.reverse(),this.scopesRegExp=new RegExp(`^((${e.join(")|(")}))($|\\.)`,"")}}match(t){if(!this.scopesRegExp)return;const e=t.match(this.scopesRegExp);if(e)return this.values.get(e[1])}},qn=class{constructor(t,e){this.stack=t,this.stoppedEarly=e}};function Zr(t,e,n,r,s,o,i,a){const l=e.content.length;let c=!1,f=-1;if(i){const d=Ao(t,e,n,r,s,o);s=d.stack,r=d.linePos,n=d.isFirstLine,f=d.anchorPosition}const u=Date.now();for(;!c;){if(a!==0&&Date.now()-u>a)return new qn(s,!0);h()}return new qn(s,!1);function h(){const d=Ro(t,e,n,r,s,f);if(!d){o.produce(s,l),c=!0;return}const p=d.captureIndices,b=d.matchedRuleId,C=p&&p.length>0?p[0].end>r:!1;if(b===ko){const w=s.getRule(t);o.produce(s,p[0].start),s=s.withContentNameScopesList(s.nameScopesList),We(t,e,n,s,o,w.endCaptures,p),o.produce(s,p[0].end);const y=s;if(s=s.parent,f=y.getAnchorPos(),!C&&y.getEnterPos()===r){s=y,o.produce(s,l),c=!0;return}}else{const w=t.getRule(b);o.produce(s,p[0].start);const y=s,g=w.getName(e.content,p),_=s.contentNameScopesList.pushAttributed(g,t);if(s=s.push(b,r,f,p[0].end===l,null,_,_),w instanceof on){const k=w;We(t,e,n,s,o,k.beginCaptures,p),o.produce(s,p[0].end),f=p[0].end;const I=k.getContentName(e.content,p),v=_.pushAttributed(I,t);if(s=s.withContentNameScopesList(v),k.endHasBackReferences&&(s=s.withEndRule(k.getEndWithResolvedBackReferences(e.content,p))),!C&&y.hasSameRuleAs(s)){s=s.pop(),o.produce(s,l),c=!0;return}}else if(w instanceof bt){const k=w;We(t,e,n,s,o,k.beginCaptures,p),o.produce(s,p[0].end),f=p[0].end;const I=k.getContentName(e.content,p),v=_.pushAttributed(I,t);if(s=s.withContentNameScopesList(v),k.whileHasBackReferences&&(s=s.withEndRule(k.getWhileWithResolvedBackReferences(e.content,p))),!C&&y.hasSameRuleAs(s)){s=s.pop(),o.produce(s,l),c=!0;return}}else if(We(t,e,n,s,o,w.captures,p),o.produce(s,p[0].end),s=s.pop(),!C){s=s.safePop(),o.produce(s,l),c=!0;return}}p[0].end>r&&(r=p[0].end,n=!1)}}function Ao(t,e,n,r,s,o){let i=s.beginRuleCapturedEOL?0:-1;const a=[];for(let l=s;l;l=l.pop()){const c=l.getRule(t);c instanceof bt&&a.push({rule:c,stack:l})}for(let l=a.pop();l;l=a.pop()){const{ruleScanner:c,findOptions:f}=Po(l.rule,t,l.stack.endRule,n,r===i),u=c.findNextMatchSync(e,r,f);if(u){if(u.ruleId!==Vr){s=l.stack.pop();break}u.captureIndices&&u.captureIndices.length&&(o.produce(l.stack,u.captureIndices[0].start),We(t,e,n,l.stack,o,l.rule.whileCaptures,u.captureIndices),o.produce(l.stack,u.captureIndices[0].end),i=u.captureIndices[0].end,u.captureIndices[0].end>r&&(r=u.captureIndices[0].end,n=!1))}else{s=l.stack.pop();break}}return{stack:s,linePos:r,anchorPosition:i,isFirstLine:n}}function Ro(t,e,n,r,s,o){const i=Lo(t,e,n,r,s,o),a=t.getInjections();if(a.length===0)return i;const l=No(a,t,e,n,r,s,o);if(!l)return i;if(!i)return l;const c=i.captureIndices[0].start,f=l.captureIndices[0].start;return f<c||l.priorityMatch&&f===c?l:i}function Lo(t,e,n,r,s,o){const i=s.getRule(t),{ruleScanner:a,findOptions:l}=Qr(i,t,s.endRule,n,r===o),c=a.findNextMatchSync(e,r,l);return c?{captureIndices:c.captureIndices,matchedRuleId:c.ruleId}:null}function No(t,e,n,r,s,o,i){let a=Number.MAX_VALUE,l=null,c,f=0;const u=o.contentNameScopesList.getScopeNames();for(let h=0,d=t.length;h<d;h++){const p=t[h];if(!p.matcher(u))continue;const b=e.getRule(p.ruleId),{ruleScanner:C,findOptions:w}=Qr(b,e,null,r,s===i),y=C.findNextMatchSync(n,s,w);if(!y)continue;const g=y.captureIndices[0].start;if(!(g>=a)&&(a=g,l=y.captureIndices,c=y.ruleId,f=p.priority,a===s))break}return l?{priorityMatch:f===-1,captureIndices:l,matchedRuleId:c}:null}function Qr(t,e,n,r,s){return{ruleScanner:t.compileAG(e,n,r,s),findOptions:0}}function Po(t,e,n,r,s){return{ruleScanner:t.compileWhileAG(e,n,r,s),findOptions:0}}function We(t,e,n,r,s,o,i){if(o.length===0)return;const a=e.content,l=Math.min(o.length,i.length),c=[],f=i[0].end;for(let u=0;u<l;u++){const h=o[u];if(h===null)continue;const d=i[u];if(d.length===0)continue;if(d.start>f)break;for(;c.length>0&&c[c.length-1].endPos<=d.start;)s.produceFromScopes(c[c.length-1].scopes,c[c.length-1].endPos),c.pop();if(c.length>0?s.produceFromScopes(c[c.length-1].scopes,d.start):s.produce(r,d.start),h.retokenizeCapturedWithRuleId){const b=h.getName(a,i),C=r.contentNameScopesList.pushAttributed(b,t),w=h.getContentName(a,i),y=C.pushAttributed(w,t),g=r.push(h.retokenizeCapturedWithRuleId,d.start,-1,!1,null,C,y),_=t.createOnigString(a.substring(0,d.end));Zr(t,_,n&&d.start===0,d.start,g,s,!1,0),Hr(_);continue}const p=h.getName(a,i);if(p!==null){const C=(c.length>0?c[c.length-1].scopes:r.contentNameScopesList).pushAttributed(p,t);c.push(new To(C,d.end))}}for(;c.length>0;)s.produceFromScopes(c[c.length-1].scopes,c[c.length-1].endPos),c.pop()}var To=class{constructor(t,e){m(this,"scopes");m(this,"endPos");this.scopes=t,this.endPos=e}};function $o(t,e,n,r,s,o,i,a){return new Oo(t,e,n,r,s,o,i,a)}function Vn(t,e,n,r,s){const o=mt(e,wt),i=Xr.getCompiledRuleId(n,r,s.repository);for(const a of o)t.push({debugSelector:e,matcher:a.matcher,ruleId:i,grammar:s,priority:a.priority})}function wt(t,e){if(e.length<t.length)return!1;let n=0;return t.every(r=>{for(let s=n;s<e.length;s++)if(Mo(e[s],r))return n=s+1,!0;return!1})}function Mo(t,e){if(!t)return!1;if(t===e)return!0;const n=e.length;return t.length>n&&t.substr(0,n)===e&&t[n]==="."}var Oo=class{constructor(t,e,n,r,s,o,i,a){m(this,"_rootId");m(this,"_lastRuleId");m(this,"_ruleId2desc");m(this,"_includedGrammars");m(this,"_grammarRepository");m(this,"_grammar");m(this,"_injections");m(this,"_basicScopeAttributesProvider");m(this,"_tokenTypeMatchers");if(this._rootScopeName=t,this.balancedBracketSelectors=o,this._onigLib=a,this._basicScopeAttributesProvider=new Io(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=i,this._grammar=Xn(e,null),this._injections=null,this._tokenTypeMatchers=[],s)for(const l of Object.keys(s)){const c=mt(l,wt);for(const f of c)this._tokenTypeMatchers.push({matcher:f.matcher,type:s[l]})}}get themeProvider(){return this._grammarRepository}dispose(){for(const t of this._ruleId2desc)t&&t.dispose()}createOnigScanner(t){return this._onigLib.createOnigScanner(t)}createOnigString(t){return this._onigLib.createOnigString(t)}getMetadataForScope(t){return this._basicScopeAttributesProvider.getBasicScopeAttributes(t)}_collectInjections(){const t={lookup:s=>s===this._rootScopeName?this._grammar:this.getExternalGrammar(s),injections:s=>this._grammarRepository.injections(s)},e=[],n=this._rootScopeName,r=t.lookup(n);if(r){const s=r.injections;if(s)for(let i in s)Vn(e,i,s[i],this,r);const o=this._grammarRepository.injections(n);o&&o.forEach(i=>{const a=this.getExternalGrammar(i);if(a){const l=a.injectionSelector;l&&Vn(e,l,a,this,a)}})}return e.sort((s,o)=>s.priority-o.priority),e}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(t){const e=++this._lastRuleId,n=t(e);return this._ruleId2desc[e]=n,n}getRule(t){return this._ruleId2desc[t]}getExternalGrammar(t,e){if(this._includedGrammars[t])return this._includedGrammars[t];if(this._grammarRepository){const n=this._grammarRepository.lookup(t);if(n)return this._includedGrammars[t]=Xn(n,e&&e.$base),this._includedGrammars[t]}}tokenizeLine(t,e,n=0){const r=this._tokenize(t,e,!1,n);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(t,e,n=0){const r=this._tokenize(t,e,!0,n);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(t,e,n,r){this._rootId===-1&&(this._rootId=Xr.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let s;if(!e||e===an.NULL){s=!0;const c=this._basicScopeAttributesProvider.getDefaultAttributes(),f=this.themeProvider.getDefaults(),u=Me.set(0,c.languageId,c.tokenType,null,f.fontStyle,f.foregroundId,f.backgroundId),h=this.getRule(this._rootId).getName(null,null);let d;h?d=ze.createRootAndLookUpScopeName(h,u,this):d=ze.createRoot("unknown",u),e=new an(null,this._rootId,-1,-1,!1,null,d,d)}else s=!1,e.reset();t=t+`
|
|
3
|
+
`;const o=this.createOnigString(t),i=o.content.length,a=new Go(n,t,this._tokenTypeMatchers,this.balancedBracketSelectors),l=Zr(this,o,s,0,e,a,!0,r);return Hr(o),{lineLength:i,lineTokens:a,ruleStack:l.stack,stoppedEarly:l.stoppedEarly}}};function Xn(t,e){return t=eo(t),t.repository=t.repository||{},t.repository.$self={$vscodeTextmateLocation:t.$vscodeTextmateLocation,patterns:t.patterns,name:t.scopeName},t.repository.$base=e||t.repository.$self,t}var ze=class se{constructor(e,n,r){this.parent=e,this.scopePath=n,this.tokenAttributes=r}static fromExtension(e,n){let r=e,s=(e==null?void 0:e.scopePath)??null;for(const o of n)s=Bt.push(s,o.scopeNames),r=new se(r,s,o.encodedTokenAttributes);return r}static createRoot(e,n){return new se(null,new Bt(null,e),n)}static createRootAndLookUpScopeName(e,n,r){const s=r.getMetadataForScope(e),o=new Bt(null,e),i=r.themeProvider.themeMatch(o),a=se.mergeAttributes(n,s,i);return new se(null,o,a)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(e){return se.equals(this,e)}static equals(e,n){do{if(e===n||!e&&!n)return!0;if(!e||!n||e.scopeName!==n.scopeName||e.tokenAttributes!==n.tokenAttributes)return!1;e=e.parent,n=n.parent}while(!0)}static mergeAttributes(e,n,r){let s=-1,o=0,i=0;return r!==null&&(s=r.fontStyle,o=r.foregroundId,i=r.backgroundId),Me.set(e,n.languageId,n.tokenType,null,s,o,i)}pushAttributed(e,n){if(e===null)return this;if(e.indexOf(" ")===-1)return se._pushAttributed(this,e,n);const r=e.split(/ /g);let s=this;for(const o of r)s=se._pushAttributed(s,o,n);return s}static _pushAttributed(e,n,r){const s=r.getMetadataForScope(n),o=e.scopePath.push(n),i=r.themeProvider.themeMatch(o),a=se.mergeAttributes(e.tokenAttributes,s,i);return new se(e,o,a)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){var s;const n=[];let r=this;for(;r&&r!==e;)n.push({encodedTokenAttributes:r.tokenAttributes,scopeNames:r.scopePath.getExtensionIfDefined(((s=r.parent)==null?void 0:s.scopePath)??null)}),r=r.parent;return r===e?n.reverse():void 0}},Y,an=(Y=class{constructor(e,n,r,s,o,i,a,l){m(this,"_stackElementBrand");m(this,"_enterPos");m(this,"_anchorPos");m(this,"depth");this.parent=e,this.ruleId=n,this.beginRuleCapturedEOL=o,this.endRule=i,this.nameScopesList=a,this.contentNameScopesList=l,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=r,this._anchorPos=s}equals(e){return e===null?!1:Y._equals(this,e)}static _equals(e,n){return e===n?!0:this._structuralEquals(e,n)?ze.equals(e.contentNameScopesList,n.contentNameScopesList):!1}static _structuralEquals(e,n){do{if(e===n||!e&&!n)return!0;if(!e||!n||e.depth!==n.depth||e.ruleId!==n.ruleId||e.endRule!==n.endRule)return!1;e=e.parent,n=n.parent}while(!0)}clone(){return this}static _reset(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){Y._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(e,n,r,s,o,i,a){return new Y(this,e,n,r,s,o,i,a)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){const e=[];return this._writeString(e,0),"["+e.join(",")+"]"}_writeString(e,n){var r,s;return this.parent&&(n=this.parent._writeString(e,n)),e[n++]=`(${this.ruleId}, ${(r=this.nameScopesList)==null?void 0:r.toString()}, ${(s=this.contentNameScopesList)==null?void 0:s.toString()})`,n}withContentNameScopesList(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(e){return this.endRule===e?this:new Y(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,e,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let n=this;for(;n&&n._enterPos===e._enterPos;){if(n.ruleId===e.ruleId)return!0;n=n.parent}return!1}toStateStackFrame(){var e,n,r;return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:((n=this.nameScopesList)==null?void 0:n.getExtensionIfDefined(((e=this.parent)==null?void 0:e.nameScopesList)??null))??[],contentNameScopesList:((r=this.contentNameScopesList)==null?void 0:r.getExtensionIfDefined(this.nameScopesList))??[]}}static pushFrame(e,n){const r=ze.fromExtension((e==null?void 0:e.nameScopesList)??null,n.nameScopesList);return new Y(e,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,ze.fromExtension(r,n.contentNameScopesList))}},m(Y,"NULL",new Y(null,0,0,0,!1,null,null,null)),Y),Do=class{constructor(t,e){m(this,"balancedBracketScopes");m(this,"unbalancedBracketScopes");m(this,"allowAny",!1);this.balancedBracketScopes=t.flatMap(n=>n==="*"?(this.allowAny=!0,[]):mt(n,wt).map(r=>r.matcher)),this.unbalancedBracketScopes=e.flatMap(n=>mt(n,wt).map(r=>r.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(t){for(const e of this.unbalancedBracketScopes)if(e(t))return!1;for(const e of this.balancedBracketScopes)if(e(t))return!0;return this.allowAny}},Go=class{constructor(t,e,n,r){m(this,"_emitBinaryTokens");m(this,"_lineText");m(this,"_tokens");m(this,"_binaryTokens");m(this,"_lastTokenEndIndex");m(this,"_tokenTypeOverrides");this.balancedBracketSelectors=r,this._emitBinaryTokens=t,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}produce(t,e){this.produceFromScopes(t.contentNameScopesList,e)}produceFromScopes(t,e){var r;if(this._lastTokenEndIndex>=e)return;if(this._emitBinaryTokens){let s=(t==null?void 0:t.tokenAttributes)??0,o=!1;if((r=this.balancedBracketSelectors)!=null&&r.matchesAlways&&(o=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const i=(t==null?void 0:t.getScopeNames())??[];for(const a of this._tokenTypeOverrides)a.matcher(i)&&(s=Me.set(s,0,a.type,null,-1,0,0));this.balancedBracketSelectors&&(o=this.balancedBracketSelectors.match(i))}if(o&&(s=Me.set(s,0,8,o,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===s){this._lastTokenEndIndex=e;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(s),this._lastTokenEndIndex=e;return}const n=(t==null?void 0:t.getScopeNames())??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:e,scopes:n}),this._lastTokenEndIndex=e}getResult(t,e){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===e-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(t,e),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(t,e){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===e-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(t,e),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}},Bo=class{constructor(t,e){m(this,"_grammars",new Map);m(this,"_rawGrammars",new Map);m(this,"_injectionGrammars",new Map);m(this,"_theme");this._onigLib=e,this._theme=t}dispose(){for(const t of this._grammars.values())t.dispose()}setTheme(t){this._theme=t}getColorMap(){return this._theme.getColorMap()}addGrammar(t,e){this._rawGrammars.set(t.scopeName,t),e&&this._injectionGrammars.set(t.scopeName,e)}lookup(t){return this._rawGrammars.get(t)}injections(t){return this._injectionGrammars.get(t)}getDefaults(){return this._theme.getDefaults()}themeMatch(t){return this._theme.match(t)}grammarForScopeName(t,e,n,r,s){if(!this._grammars.has(t)){let o=this._rawGrammars.get(t);if(!o)return null;this._grammars.set(t,$o(t,o,e,n,r,s,this,this._onigLib))}return this._grammars.get(t)}},Fo=class{constructor(e){m(this,"_options");m(this,"_syncRegistry");m(this,"_ensureGrammarCache");this._options=e,this._syncRegistry=new Bo(gt.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,n){this._syncRegistry.setTheme(gt.createFromRawTheme(e,n))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(e,n,r){return this.loadGrammarWithConfiguration(e,n,{embeddedLanguages:r})}loadGrammarWithConfiguration(e,n,r){return this._loadGrammar(e,n,r.embeddedLanguages,r.tokenTypes,new Do(r.balancedBracketSelectors||[],r.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,n,r,s,o){const i=new go(this._syncRegistry,e);for(;i.Q.length>0;)i.Q.map(a=>this._loadSingleGrammar(a.scopeName)),i.processQueue();return this._grammarForScopeName(e,n,r,s,o)}_loadSingleGrammar(e){this._ensureGrammarCache.has(e)||(this._doLoadSingleGrammar(e),this._ensureGrammarCache.set(e,!0))}_doLoadSingleGrammar(e){const n=this._options.loadGrammar(e);if(n){const r=typeof this._options.getInjections=="function"?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(n,r)}}addGrammar(e,n=[],r=0,s=null){return this._syncRegistry.addGrammar(e,n),this._grammarForScopeName(e.scopeName,r,s)}_grammarForScopeName(e,n=0,r=null,s=null,o=null){return this._syncRegistry.grammarForScopeName(e,n,r,s,o)}},ln=an.NULL;const Uo=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class et{constructor(e,n,r){this.normal=n,this.property=e,r&&(this.space=r)}}et.prototype.normal={};et.prototype.property={};et.prototype.space=void 0;function Yr(t,e){const n={},r={};for(const s of t)Object.assign(n,s.property),Object.assign(r,s.normal);return new et(n,r,e)}function cn(t){return t.toLowerCase()}class V{constructor(e,n){this.attribute=n,this.property=e}}V.prototype.attribute="";V.prototype.booleanish=!1;V.prototype.boolean=!1;V.prototype.commaOrSpaceSeparated=!1;V.prototype.commaSeparated=!1;V.prototype.defined=!1;V.prototype.mustUseProperty=!1;V.prototype.number=!1;V.prototype.overloadedBoolean=!1;V.prototype.property="";V.prototype.spaceSeparated=!1;V.prototype.space=void 0;let jo=0;const R=Ie(),O=Ie(),un=Ie(),S=Ie(),T=Ie(),Te=Ie(),X=Ie();function Ie(){return 2**++jo}var fn=Object.freeze({__proto__:null,boolean:R,booleanish:O,commaOrSpaceSeparated:X,commaSeparated:Te,number:S,overloadedBoolean:un,spaceSeparated:T});const Ut=Object.keys(fn);class kn extends V{constructor(e,n,r,s){let o=-1;if(super(e,n),Kn(this,"space",s),typeof r=="number")for(;++o<Ut.length;){const i=Ut[o];Kn(this,Ut[o],(r&fn[i])===fn[i])}}}kn.prototype.defined=!0;function Kn(t,e,n){n&&(t[e]=n)}function Oe(t){const e={},n={};for(const[r,s]of Object.entries(t.properties)){const o=new kn(r,t.transform(t.attributes||{},r),s,t.space);t.mustUseProperty&&t.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),e[r]=o,n[cn(r)]=r,n[cn(o.attribute)]=r}return new et(e,n,t.space)}const Jr=Oe({properties:{ariaActiveDescendant:null,ariaAtomic:O,ariaAutoComplete:null,ariaBusy:O,ariaChecked:O,ariaColCount:S,ariaColIndex:S,ariaColSpan:S,ariaControls:T,ariaCurrent:null,ariaDescribedBy:T,ariaDetails:null,ariaDisabled:O,ariaDropEffect:T,ariaErrorMessage:null,ariaExpanded:O,ariaFlowTo:T,ariaGrabbed:O,ariaHasPopup:null,ariaHidden:O,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:T,ariaLevel:S,ariaLive:null,ariaModal:O,ariaMultiLine:O,ariaMultiSelectable:O,ariaOrientation:null,ariaOwns:T,ariaPlaceholder:null,ariaPosInSet:S,ariaPressed:O,ariaReadOnly:O,ariaRelevant:null,ariaRequired:O,ariaRoleDescription:T,ariaRowCount:S,ariaRowIndex:S,ariaRowSpan:S,ariaSelected:O,ariaSetSize:S,ariaSort:null,ariaValueMax:S,ariaValueMin:S,ariaValueNow:S,ariaValueText:null,role:null},transform(t,e){return e==="role"?e:"aria-"+e.slice(4).toLowerCase()}});function es(t,e){return e in t?t[e]:e}function ts(t,e){return es(t,e.toLowerCase())}const Wo=Oe({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Te,acceptCharset:T,accessKey:T,action:null,allow:null,allowFullScreen:R,allowPaymentRequest:R,allowUserMedia:R,alt:null,as:null,async:R,autoCapitalize:null,autoComplete:T,autoFocus:R,autoPlay:R,blocking:T,capture:null,charSet:null,checked:R,cite:null,className:T,cols:S,colSpan:null,content:null,contentEditable:O,controls:R,controlsList:T,coords:S|Te,crossOrigin:null,data:null,dateTime:null,decoding:null,default:R,defer:R,dir:null,dirName:null,disabled:R,download:un,draggable:O,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:R,formTarget:null,headers:T,height:S,hidden:un,high:S,href:null,hrefLang:null,htmlFor:T,httpEquiv:T,id:null,imageSizes:null,imageSrcSet:null,inert:R,inputMode:null,integrity:null,is:null,isMap:R,itemId:null,itemProp:T,itemRef:T,itemScope:R,itemType:T,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:R,low:S,manifest:null,max:null,maxLength:S,media:null,method:null,min:null,minLength:S,multiple:R,muted:R,name:null,nonce:null,noModule:R,noValidate:R,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:R,optimum:S,pattern:null,ping:T,placeholder:null,playsInline:R,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:R,referrerPolicy:null,rel:T,required:R,reversed:R,rows:S,rowSpan:S,sandbox:T,scope:null,scoped:R,seamless:R,selected:R,shadowRootClonable:R,shadowRootDelegatesFocus:R,shadowRootMode:null,shape:null,size:S,sizes:null,slot:null,span:S,spellCheck:O,src:null,srcDoc:null,srcLang:null,srcSet:null,start:S,step:null,style:null,tabIndex:S,target:null,title:null,translate:null,type:null,typeMustMatch:R,useMap:null,value:O,width:S,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:T,axis:null,background:null,bgColor:null,border:S,borderColor:null,bottomMargin:S,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:R,declare:R,event:null,face:null,frame:null,frameBorder:null,hSpace:S,leftMargin:S,link:null,longDesc:null,lowSrc:null,marginHeight:S,marginWidth:S,noResize:R,noHref:R,noShade:R,noWrap:R,object:null,profile:null,prompt:null,rev:null,rightMargin:S,rules:null,scheme:null,scrolling:O,standby:null,summary:null,text:null,topMargin:S,valueType:null,version:null,vAlign:null,vLink:null,vSpace:S,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:R,disableRemotePlayback:R,prefix:null,property:null,results:S,security:null,unselectable:null},space:"html",transform:ts}),zo=Oe({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:X,accentHeight:S,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:S,amplitude:S,arabicForm:null,ascent:S,attributeName:null,attributeType:null,azimuth:S,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:S,by:null,calcMode:null,capHeight:S,className:T,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:S,diffuseConstant:S,direction:null,display:null,dur:null,divisor:S,dominantBaseline:null,download:R,dx:null,dy:null,edgeMode:null,editable:null,elevation:S,enableBackground:null,end:null,event:null,exponent:S,externalResourcesRequired:null,fill:null,fillOpacity:S,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:Te,g2:Te,glyphName:Te,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:S,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:S,horizOriginX:S,horizOriginY:S,id:null,ideographic:S,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:S,k:S,k1:S,k2:S,k3:S,k4:S,kernelMatrix:X,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:S,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:S,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:S,overlineThickness:S,paintOrder:null,panose1:null,path:null,pathLength:S,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:T,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:S,pointsAtY:S,pointsAtZ:S,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:X,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:X,rev:X,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:X,requiredFeatures:X,requiredFonts:X,requiredFormats:X,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:S,specularExponent:S,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:S,strikethroughThickness:S,string:null,stroke:null,strokeDashArray:X,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:S,strokeOpacity:S,strokeWidth:null,style:null,surfaceScale:S,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:X,tabIndex:S,tableValues:null,target:null,targetX:S,targetY:S,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:X,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:S,underlineThickness:S,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:S,values:null,vAlphabetic:S,vMathematical:S,vectorEffect:null,vHanging:S,vIdeographic:S,version:null,vertAdvY:S,vertOriginX:S,vertOriginY:S,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:S,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:es}),ns=Oe({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(t,e){return"xlink:"+e.slice(5).toLowerCase()}}),rs=Oe({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:ts}),ss=Oe({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(t,e){return"xml:"+e.slice(3).toLowerCase()}}),Ho=/[A-Z]/g,Zn=/-[a-z]/g,qo=/^data[-\w.:]+$/i;function Vo(t,e){const n=cn(e);let r=e,s=V;if(n in t.normal)return t.property[t.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&qo.test(e)){if(e.charAt(4)==="-"){const o=e.slice(5).replace(Zn,Ko);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=e.slice(4);if(!Zn.test(o)){let i=o.replace(Ho,Xo);i.charAt(0)!=="-"&&(i="-"+i),e="data"+i}}s=kn}return new s(r,e)}function Xo(t){return"-"+t.toLowerCase()}function Ko(t){return t.charAt(1).toUpperCase()}const Zo=Yr([Jr,Wo,ns,rs,ss],"html"),os=Yr([Jr,zo,ns,rs,ss],"svg"),Qn={}.hasOwnProperty;function Qo(t,e){const n=e||{};function r(s,...o){let i=r.invalid;const a=r.handlers;if(s&&Qn.call(s,t)){const l=String(s[t]);i=Qn.call(a,l)?a[l]:r.unknown}if(i)return i.call(this,s,...o)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const Yo=/["&'<>`]/g,Jo=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,ei=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,ti=/[|\\{}()[\]^$+*?.]/g,Yn=new WeakMap;function ni(t,e){if(t=t.replace(e.subset?ri(e.subset):Yo,r),e.subset||e.escapeOnly)return t;return t.replace(Jo,n).replace(ei,r);function n(s,o,i){return e.format((s.charCodeAt(0)-55296)*1024+s.charCodeAt(1)-56320+65536,i.charCodeAt(o+2),e)}function r(s,o,i){return e.format(s.charCodeAt(0),i.charCodeAt(o+1),e)}}function ri(t){let e=Yn.get(t);return e||(e=si(t),Yn.set(t,e)),e}function si(t){const e=[];let n=-1;for(;++n<t.length;)e.push(t[n].replace(ti,"\\$&"));return new RegExp("(?:"+e.join("|")+")","g")}const oi=/[\dA-Fa-f]/;function ii(t,e,n){const r="&#x"+t.toString(16).toUpperCase();return n&&e&&!oi.test(String.fromCharCode(e))?r:r+";"}const ai=/\d/;function li(t,e,n){const r="&#"+String(t);return n&&e&&!ai.test(String.fromCharCode(e))?r:r+";"}const ci=["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"],jt={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:"€"},ui=["cent","copy","divide","gt","lt","not","para","times"],is={}.hasOwnProperty,hn={};let rt;for(rt in jt)is.call(jt,rt)&&(hn[jt[rt]]=rt);const fi=/[^\dA-Za-z]/;function hi(t,e,n,r){const s=String.fromCharCode(t);if(is.call(hn,s)){const o=hn[s],i="&"+o;return n&&ci.includes(o)&&!ui.includes(o)&&(!r||e&&e!==61&&fi.test(String.fromCharCode(e)))?i:i+";"}return""}function di(t,e,n){let r=ii(t,e,n.omitOptionalSemicolons),s;if((n.useNamedReferences||n.useShortestReferences)&&(s=hi(t,e,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!s)&&n.useShortestReferences){const o=li(t,e,n.omitOptionalSemicolons);o.length<r.length&&(r=o)}return s&&(!n.useShortestReferences||s.length<r.length)?s:r}function $e(t,e){return ni(t,Object.assign({format:di},e))}const pi=/^>|^->|<!--|-->|--!>|<!-$/g,gi=[">"],mi=["<",">"];function yi(t,e,n,r){return r.settings.bogusComments?"<?"+$e(t.value,Object.assign({},r.settings.characterReferences,{subset:gi}))+">":"<!--"+t.value.replace(pi,s)+"-->";function s(o){return $e(o,Object.assign({},r.settings.characterReferences,{subset:mi}))}}function bi(t,e,n,r){return"<!"+(r.settings.upperDoctype?"DOCTYPE":"doctype")+(r.settings.tightDoctype?"":" ")+"html>"}function Jn(t,e){const n=String(t);if(typeof e!="string")throw new TypeError("Expected character");let r=0,s=n.indexOf(e);for(;s!==-1;)r++,s=n.indexOf(e,s+e.length);return r}function wi(t,e){const n=e||{};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function Ci(t){return t.join(" ").trim()}const _i=/[ \t\n\f\r]/g;function xn(t){return typeof t=="object"?t.type==="text"?er(t.value):!1:er(t)}function er(t){return t.replace(_i,"")===""}const B=ls(1),as=ls(-1),Si=[];function ls(t){return e;function e(n,r,s){const o=n?n.children:Si;let i=(r||0)+t,a=o[i];if(!s)for(;a&&xn(a);)i+=t,a=o[i];return a}}const ki={}.hasOwnProperty;function cs(t){return e;function e(n,r,s){return ki.call(t,n.tagName)&&t[n.tagName](n,r,s)}}const vn=cs({body:vi,caption:Wt,colgroup:Wt,dd:Ri,dt:Ai,head:Wt,html:xi,li:Ei,optgroup:Li,option:Ni,p:Ii,rp:tr,rt:tr,tbody:Ti,td:nr,tfoot:$i,th:nr,thead:Pi,tr:Mi});function Wt(t,e,n){const r=B(n,e,!0);return!r||r.type!=="comment"&&!(r.type==="text"&&xn(r.value.charAt(0)))}function xi(t,e,n){const r=B(n,e);return!r||r.type!=="comment"}function vi(t,e,n){const r=B(n,e);return!r||r.type!=="comment"}function Ii(t,e,n){const r=B(n,e);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 Ei(t,e,n){const r=B(n,e);return!r||r.type==="element"&&r.tagName==="li"}function Ai(t,e,n){const r=B(n,e);return!!(r&&r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd"))}function Ri(t,e,n){const r=B(n,e);return!r||r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd")}function tr(t,e,n){const r=B(n,e);return!r||r.type==="element"&&(r.tagName==="rp"||r.tagName==="rt")}function Li(t,e,n){const r=B(n,e);return!r||r.type==="element"&&r.tagName==="optgroup"}function Ni(t,e,n){const r=B(n,e);return!r||r.type==="element"&&(r.tagName==="option"||r.tagName==="optgroup")}function Pi(t,e,n){const r=B(n,e);return!!(r&&r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot"))}function Ti(t,e,n){const r=B(n,e);return!r||r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot")}function $i(t,e,n){return!B(n,e)}function Mi(t,e,n){const r=B(n,e);return!r||r.type==="element"&&r.tagName==="tr"}function nr(t,e,n){const r=B(n,e);return!r||r.type==="element"&&(r.tagName==="td"||r.tagName==="th")}const Oi=cs({body:Bi,colgroup:Fi,head:Gi,html:Di,tbody:Ui});function Di(t){const e=B(t,-1);return!e||e.type!=="comment"}function Gi(t){const e=new Set;for(const r of t.children)if(r.type==="element"&&(r.tagName==="base"||r.tagName==="title")){if(e.has(r.tagName))return!1;e.add(r.tagName)}const n=t.children[0];return!n||n.type==="element"}function Bi(t){const e=B(t,-1,!0);return!e||e.type!=="comment"&&!(e.type==="text"&&xn(e.value.charAt(0)))&&!(e.type==="element"&&(e.tagName==="meta"||e.tagName==="link"||e.tagName==="script"||e.tagName==="style"||e.tagName==="template"))}function Fi(t,e,n){const r=as(n,e),s=B(t,-1,!0);return n&&r&&r.type==="element"&&r.tagName==="colgroup"&&vn(r,n.children.indexOf(r),n)?!1:!!(s&&s.type==="element"&&s.tagName==="col")}function Ui(t,e,n){const r=as(n,e),s=B(t,-1);return n&&r&&r.type==="element"&&(r.tagName==="thead"||r.tagName==="tbody")&&vn(r,n.children.indexOf(r),n)?!1:!!(s&&s.type==="element"&&s.tagName==="tr")}const st={name:[[`
|
|
4
|
+
\f\r &/=>`.split(""),`
|
|
5
|
+
\f\r "&'/=>\``.split("")],[`\0
|
|
6
|
+
\f\r "&'/<=>`.split(""),`\0
|
|
7
|
+
\f\r "&'/<=>\``.split("")]],unquoted:[[`
|
|
8
|
+
\f\r &>`.split(""),`\0
|
|
9
|
+
\f\r "&'<=>\``.split("")],[`\0
|
|
10
|
+
\f\r "&'<=>\``.split(""),`\0
|
|
11
|
+
\f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function ji(t,e,n,r){const s=r.schema,o=s.space==="svg"?!1:r.settings.omitOptionalTags;let i=s.space==="svg"?r.settings.closeEmptyElements:r.settings.voids.includes(t.tagName.toLowerCase());const a=[];let l;s.space==="html"&&t.tagName==="svg"&&(r.schema=os);const c=Wi(r,t.properties),f=r.all(s.space==="html"&&t.tagName==="template"?t.content:t);return r.schema=s,f&&(i=!1),(c||!o||!Oi(t,e,n))&&(a.push("<",t.tagName,c?" "+c:""),i&&(s.space==="svg"||r.settings.closeSelfClosing)&&(l=c.charAt(c.length-1),(!r.settings.tightSelfClosing||l==="/"||l&&l!=='"'&&l!=="'")&&a.push(" "),a.push("/")),a.push(">")),a.push(f),!i&&(!o||!vn(t,e,n))&&a.push("</"+t.tagName+">"),a.join("")}function Wi(t,e){const n=[];let r=-1,s;if(e){for(s in e)if(e[s]!==null&&e[s]!==void 0){const o=zi(t,s,e[s]);o&&n.push(o)}}for(;++r<n.length;){const o=t.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&o!=='"'&&o!=="'"&&(n[r]+=" ")}return n.join("")}function zi(t,e,n){const r=Vo(t.schema,e),s=t.settings.allowParseErrors&&t.schema.space==="html"?0:1,o=t.settings.allowDangerousCharacters?0:1;let i=t.quote,a;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 l=$e(r.attribute,Object.assign({},t.settings.characterReferences,{subset:st.name[s][o]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?wi:Ci)(n,{padLeft:!t.settings.tightCommaSeparatedLists}):String(n),t.settings.collapseEmptyAttributes&&!n)?l:(t.settings.preferUnquoted&&(a=$e(n,Object.assign({},t.settings.characterReferences,{attribute:!0,subset:st.unquoted[s][o]}))),a!==n&&(t.settings.quoteSmart&&Jn(n,i)>Jn(n,t.alternative)&&(i=t.alternative),a=i+$e(n,Object.assign({},t.settings.characterReferences,{subset:(i==="'"?st.single:st.double)[s][o],attribute:!0}))+i),l+(a&&"="+a))}const Hi=["<","&"];function us(t,e,n,r){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?t.value:$e(t.value,Object.assign({},r.settings.characterReferences,{subset:Hi}))}function qi(t,e,n,r){return r.settings.allowDangerousHtml?t.value:us(t,e,n,r)}function Vi(t,e,n,r){return r.all(t)}const Xi=Qo("type",{invalid:Ki,unknown:Zi,handlers:{comment:yi,doctype:bi,element:ji,raw:qi,root:Vi,text:us}});function Ki(t){throw new Error("Expected node, not `"+t+"`")}function Zi(t){const e=t;throw new Error("Cannot compile unknown node `"+e.type+"`")}const Qi={},Yi={},Ji=[];function ea(t,e){const n=e||Qi,r=n.quote||'"',s=r==='"'?"'":'"';if(r!=='"'&&r!=="'")throw new Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:ta,all:na,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||Uo,characterReferences:n.characterReferences||Yi,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?os:Zo,quote:r,alternative:s}.one(Array.isArray(t)?{type:"root",children:t}:t,void 0,void 0)}function ta(t,e,n){return Xi(t,e,n,this)}function na(t){const e=[],n=t&&t.children||Ji;let r=-1;for(;++r<n.length;)e[r]=this.one(n[r],r,t);return e.join("")}function Ct(t,e){const n=typeof t=="string"?{}:{...t.colorReplacements},r=typeof t=="string"?t:t.name;for(const[s,o]of Object.entries((e==null?void 0:e.colorReplacements)||{}))typeof o=="string"?n[s]=o:s===r&&Object.assign(n,o);return n}function ge(t,e){return t&&((e==null?void 0:e[t==null?void 0:t.toLowerCase()])||t)}function ra(t){return Array.isArray(t)?t:[t]}async function fs(t){return Promise.resolve(typeof t=="function"?t():t).then(e=>e.default||e)}function In(t){return!t||["plaintext","txt","text","plain"].includes(t)}function sa(t){return t==="ansi"||In(t)}function En(t){return t==="none"}function oa(t){return En(t)}function hs(t,e){var r;if(!e)return t;t.properties||(t.properties={}),(r=t.properties).class||(r.class=[]),typeof t.properties.class=="string"&&(t.properties.class=t.properties.class.split(/\s+/g)),Array.isArray(t.properties.class)||(t.properties.class=[]);const n=Array.isArray(e)?e:e.split(/\s+/g);for(const s of n)s&&!t.properties.class.includes(s)&&t.properties.class.push(s);return t}function It(t,e=!1){var o;if(t.length===0)return[["",0]];const n=t.split(/(\r?\n)/g);let r=0;const s=[];for(let i=0;i<n.length;i+=2){const a=e?n[i]+(n[i+1]||""):n[i];s.push([a,r]),r+=n[i].length,r+=((o=n[i+1])==null?void 0:o.length)||0}return s}function ia(t){const e=It(t,!0).map(([s])=>s);function n(s){if(s===t.length)return{line:e.length-1,character:e[e.length-1].length};let o=s,i=0;for(const a of e){if(o<a.length)break;o-=a.length,i++}return{line:i,character:o}}function r(s,o){let i=0;for(let a=0;a<s;a++)i+=e[a].length;return i+=o,i}return{lines:e,indexToPos:n,posToIndex:r}}const An="light-dark()",aa=["color","background-color"];function la(t,e){let n=0;const r=[];for(const s of e)s>n&&r.push({...t,content:t.content.slice(n,s),offset:t.offset+n}),n=s;return n<t.content.length&&r.push({...t,content:t.content.slice(n),offset:t.offset+n}),r}function ca(t,e){const n=Array.from(e instanceof Set?e:new Set(e)).sort((r,s)=>r-s);return n.length?t.map(r=>r.flatMap(s=>{const o=n.filter(i=>s.offset<i&&i<s.offset+s.content.length).map(i=>i-s.offset).sort((i,a)=>i-a);return o.length?la(s,o):s})):t}function ua(t,e,n,r,s="css-vars"){const o={content:t.content,explanation:t.explanation,offset:t.offset},i=e.map(f=>_t(t.variants[f])),a=new Set(i.flatMap(f=>Object.keys(f))),l={},c=(f,u)=>{const h=u==="color"?"":u==="background-color"?"-bg":`-${u}`;return n+e[f]+(u==="color"?"":h)};return i.forEach((f,u)=>{for(const h of a){const d=f[h]||"inherit";if(u===0&&r&&aa.includes(h))if(r===An&&i.length>1){const p=e.findIndex(y=>y==="light"),b=e.findIndex(y=>y==="dark");if(p===-1||b===-1)throw new U('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const C=i[p][h]||"inherit",w=i[b][h]||"inherit";l[h]=`light-dark(${C}, ${w})`,s==="css-vars"&&(l[c(u,h)]=d)}else l[h]=d;else s==="css-vars"&&(l[c(u,h)]=d)}}),o.htmlStyle=l,o}function _t(t){const e={};if(t.color&&(e.color=t.color),t.bgColor&&(e["background-color"]=t.bgColor),t.fontStyle){t.fontStyle&z.Italic&&(e["font-style"]="italic"),t.fontStyle&z.Bold&&(e["font-weight"]="bold");const n=[];t.fontStyle&z.Underline&&n.push("underline"),t.fontStyle&z.Strikethrough&&n.push("line-through"),n.length&&(e["text-decoration"]=n.join(" "))}return e}function dn(t){return typeof t=="string"?t:Object.entries(t).map(([e,n])=>`${e}:${n}`).join(";")}const ds=new WeakMap;function Et(t,e){ds.set(t,e)}function Ke(t){return ds.get(t)}class De{constructor(...e){m(this,"_stacks",{});m(this,"lang");if(e.length===2){const[n,r]=e;this.lang=r,this._stacks=n}else{const[n,r,s]=e;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(e,n){return new De(Object.fromEntries(ra(n).map(r=>[r,ln])),e)}getInternalStack(e=this.theme){return this._stacks[e]}getScopes(e=this.theme){return fa(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}}function fa(t){const e=[],n=new Set;function r(s){var i;if(n.has(s))return;n.add(s);const o=(i=s==null?void 0:s.nameScopesList)==null?void 0:i.scopeName;o&&e.push(o),s.parent&&r(s.parent)}return r(t),e}function ha(t,e){if(!(t instanceof De))throw new U("Invalid grammar state");return t.getInternalStack(e)}function da(){const t=new WeakMap;function e(n){if(!t.has(n.meta)){let r=function(i){if(typeof i=="number"){if(i<0||i>n.source.length)throw new U(`Invalid decoration offset: ${i}. Code length: ${n.source.length}`);return{...s.indexToPos(i),offset:i}}else{const a=s.lines[i.line];if(a===void 0)throw new U(`Invalid decoration position ${JSON.stringify(i)}. Lines length: ${s.lines.length}`);let l=i.character;if(l<0&&(l=a.length+l),l<0||l>a.length)throw new U(`Invalid decoration position ${JSON.stringify(i)}. Line ${i.line} length: ${a.length}`);return{...i,character:l,offset:s.posToIndex(i.line,l)}}};const s=ia(n.source),o=(n.options.decorations||[]).map(i=>({...i,start:r(i.start),end:r(i.end)}));pa(o),t.set(n.meta,{decorations:o,converter:s,source:n.source})}return t.get(n.meta)}return{name:"shiki:decorations",tokens(n){var i;if(!((i=this.options.decorations)!=null&&i.length))return;const s=e(this).decorations.flatMap(a=>[a.start.offset,a.end.offset]);return ca(n,s)},code(n){var f;if(!((f=this.options.decorations)!=null&&f.length))return;const r=e(this),s=Array.from(n.children).filter(u=>u.type==="element"&&u.tagName==="span");if(s.length!==r.converter.lines.length)throw new U(`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 o(u,h,d,p){const b=s[u];let C="",w=-1,y=-1;if(h===0&&(w=0),d===0&&(y=0),d===Number.POSITIVE_INFINITY&&(y=b.children.length),w===-1||y===-1)for(let _=0;_<b.children.length;_++)C+=ps(b.children[_]),w===-1&&C.length===h&&(w=_+1),y===-1&&C.length===d&&(y=_+1);if(w===-1)throw new U(`Failed to find start index for decoration ${JSON.stringify(p.start)}`);if(y===-1)throw new U(`Failed to find end index for decoration ${JSON.stringify(p.end)}`);const g=b.children.slice(w,y);if(!p.alwaysWrap&&g.length===b.children.length)a(b,p,"line");else if(!p.alwaysWrap&&g.length===1&&g[0].type==="element")a(g[0],p,"token");else{const _={type:"element",tagName:"span",properties:{},children:g};a(_,p,"wrapper"),b.children.splice(w,g.length,_)}}function i(u,h){s[u]=a(s[u],h,"line")}function a(u,h,d){var C;const p=h.properties||{},b=h.transform||(w=>w);return u.tagName=h.tagName||"span",u.properties={...u.properties,...p,class:u.properties.class},(C=h.properties)!=null&&C.class&&hs(u,h.properties.class),u=b(u,d)||u,u}const l=[],c=r.decorations.sort((u,h)=>h.start.offset-u.start.offset||u.end.offset-h.end.offset);for(const u of c){const{start:h,end:d}=u;if(h.line===d.line)o(h.line,h.character,d.character,u);else if(h.line<d.line){o(h.line,h.character,Number.POSITIVE_INFINITY,u);for(let p=h.line+1;p<d.line;p++)l.unshift(()=>i(p,u));o(d.line,0,d.character,u)}}l.forEach(u=>u())}}}function pa(t){for(let e=0;e<t.length;e++){const n=t[e];if(n.start.offset>n.end.offset)throw new U(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let r=e+1;r<t.length;r++){const s=t[r],o=n.start.offset<=s.start.offset&&s.start.offset<n.end.offset,i=n.start.offset<s.end.offset&&s.end.offset<=n.end.offset,a=s.start.offset<=n.start.offset&&n.start.offset<s.end.offset,l=s.start.offset<n.end.offset&&n.end.offset<=s.end.offset;if(o||i||a||l){if(o&&i||a&&l||a&&n.start.offset===n.end.offset||i&&s.start.offset===s.end.offset)continue;throw new U(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(s.start)} intersect.`)}}}}function ps(t){return t.type==="text"?t.value:t.type==="element"?t.children.map(ps).join(""):""}const ga=[da()];function St(t){const e=ma(t.transformers||[]);return[...e.pre,...e.normal,...e.post,...ga]}function ma(t){const e=[],n=[],r=[];for(const s of t)switch(s.enforce){case"pre":e.push(s);break;case"post":n.push(s);break;default:r.push(s)}return{pre:e,post:n,normal:r}}var Ce=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],zt={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function ya(t,e){const n=t.indexOf("\x1B",e);if(n!==-1&&t[n+1]==="["){const r=t.indexOf("m",n);if(r!==-1)return{sequence:t.substring(n+2,r).split(";"),startPosition:n,position:r+1}}return{position:t.length}}function rr(t){const e=t.shift();if(e==="2"){const n=t.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(e==="5"){const n=t.shift();if(n)return{type:"table",index:Number(n)}}}function ba(t){const e=[];for(;t.length>0;){const n=t.shift();if(!n)continue;const r=Number.parseInt(n);if(!Number.isNaN(r))if(r===0)e.push({type:"resetAll"});else if(r<=9)zt[r]&&e.push({type:"setDecoration",value:zt[r]});else if(r<=29){const s=zt[r-20];s&&(e.push({type:"resetDecoration",value:s}),s==="dim"&&e.push({type:"resetDecoration",value:"bold"}))}else if(r<=37)e.push({type:"setForegroundColor",value:{type:"named",name:Ce[r-30]}});else if(r===38){const s=rr(t);s&&e.push({type:"setForegroundColor",value:s})}else if(r===39)e.push({type:"resetForegroundColor"});else if(r<=47)e.push({type:"setBackgroundColor",value:{type:"named",name:Ce[r-40]}});else if(r===48){const s=rr(t);s&&e.push({type:"setBackgroundColor",value:s})}else r===49?e.push({type:"resetBackgroundColor"}):r===53?e.push({type:"setDecoration",value:"overline"}):r===55?e.push({type:"resetDecoration",value:"overline"}):r>=90&&r<=97?e.push({type:"setForegroundColor",value:{type:"named",name:Ce[r-90+8]}}):r>=100&&r<=107&&e.push({type:"setBackgroundColor",value:{type:"named",name:Ce[r-100+8]}})}return e}function wa(){let t=null,e=null,n=new Set;return{parse(r){const s=[];let o=0;do{const i=ya(r,o),a=i.sequence?r.substring(o,i.startPosition):r.substring(o);if(a.length>0&&s.push({value:a,foreground:t,background:e,decorations:new Set(n)}),i.sequence){const l=ba(i.sequence);for(const c of l)c.type==="resetAll"?(t=null,e=null,n.clear()):c.type==="resetForegroundColor"?t=null:c.type==="resetBackgroundColor"?e=null:c.type==="resetDecoration"&&n.delete(c.value);for(const c of l)c.type==="setForegroundColor"?t=c.value:c.type==="setBackgroundColor"?e=c.value:c.type==="setDecoration"&&n.add(c.value)}o=i.position}while(o<r.length);return s}}}var Ca={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 _a(t=Ca){function e(a){return t[a]}function n(a){return`#${a.map(l=>Math.max(0,Math.min(l,255)).toString(16).padStart(2,"0")).join("")}`}let r;function s(){if(r)return r;r=[];for(let c=0;c<Ce.length;c++)r.push(e(Ce[c]));let a=[0,95,135,175,215,255];for(let c=0;c<6;c++)for(let f=0;f<6;f++)for(let u=0;u<6;u++)r.push(n([a[c],a[f],a[u]]));let l=8;for(let c=0;c<24;c++,l+=10)r.push(n([l,l,l]));return r}function o(a){return s()[a]}function i(a){switch(a.type){case"named":return e(a.name);case"rgb":return n(a.rgb);case"table":return o(a.index)}}return{value:i}}const Sa={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 ka(t,e,n){const r=Ct(t,n),s=It(e),o=Object.fromEntries(Ce.map(l=>{var u;const c=`terminal.ansi${l[0].toUpperCase()}${l.substring(1)}`,f=(u=t.colors)==null?void 0:u[c];return[l,f||Sa[l]]})),i=_a(o),a=wa();return s.map(l=>a.parse(l[0]).map(c=>{let f,u;c.decorations.has("reverse")?(f=c.background?i.value(c.background):t.bg,u=c.foreground?i.value(c.foreground):t.fg):(f=c.foreground?i.value(c.foreground):t.fg,u=c.background?i.value(c.background):void 0),f=ge(f,r),u=ge(u,r),c.decorations.has("dim")&&(f=xa(f));let h=z.None;return c.decorations.has("bold")&&(h|=z.Bold),c.decorations.has("italic")&&(h|=z.Italic),c.decorations.has("underline")&&(h|=z.Underline),c.decorations.has("strikethrough")&&(h|=z.Strikethrough),{content:c.value,offset:l[1],color:f,bgColor:u,fontStyle:h}}))}function xa(t){const e=t.match(/#([0-9a-f]{3,8})/i);if(e){const r=e[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],o=r[1],i=r[2],a=r[3],l=Math.round(Number.parseInt(`${a}${a}`,16)/2).toString(16).padStart(2,"0");return`#${s}${s}${o}${o}${i}${i}${l}`}else if(r.length===3){const s=r[0],o=r[1],i=r[2];return`#${s}${s}${o}${o}${i}${i}80`}}}const n=t.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);return n?`var(${n[1]}-dim)`:t}function Rn(t,e,n={}){const{theme:r=t.getLoadedThemes()[0]}=n,s=t.resolveLangAlias(n.lang||"text");if(In(s)||En(r))return It(e).map(l=>[{content:l[0],offset:l[1]}]);const{theme:o,colorMap:i}=t.setTheme(r);if(s==="ansi")return ka(o,e,n);const a=t.getLanguage(n.lang||"text");if(n.grammarState){if(n.grammarState.lang!==a.name)throw new U(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${a.name}"`);if(!n.grammarState.themes.includes(o.name))throw new U(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${o.name}"`)}return Ia(e,a,o,i,n)}function va(...t){if(t.length===2)return Ke(t[1]);const[e,n,r={}]=t,{lang:s="text",theme:o=e.getLoadedThemes()[0]}=r;if(In(s)||En(o))throw new U("Plain language does not have grammar state");if(s==="ansi")throw new U("ANSI language does not have grammar state");const{theme:i,colorMap:a}=e.setTheme(o),l=e.getLanguage(s);return new De(Ln(n,l,i,a,r).stateStack,l.name,i.name)}function Ia(t,e,n,r,s){const o=Ln(t,e,n,r,s),i=new De(o.stateStack,e.name,n.name);return Et(o.tokens,i),o.tokens}function Ln(t,e,n,r,s){const o=Ct(n,s),{tokenizeMaxLineLength:i=0,tokenizeTimeLimit:a=500}=s,l=It(t);let c=s.grammarState?ha(s.grammarState,n.name)??ln:s.grammarContextCode!=null?Ln(s.grammarContextCode,e,n,r,{...s,grammarState:void 0,grammarContextCode:void 0}).stateStack:ln,f=[];const u=[];for(let h=0,d=l.length;h<d;h++){const[p,b]=l[h];if(p===""){f=[],u.push([]);continue}if(i>0&&p.length>=i){f=[],u.push([{content:p,offset:b,color:"",fontStyle:0}]);continue}let C,w,y;s.includeExplanation&&(C=e.tokenizeLine(p,c,a),w=C.tokens,y=0);const g=e.tokenizeLine2(p,c,a),_=g.tokens.length/2;for(let k=0;k<_;k++){const I=g.tokens[2*k],v=k+1<_?g.tokens[2*k+2]:p.length;if(I===v)continue;const x=g.tokens[2*k+1],E=ge(r[Me.getForeground(x)],o),L=Me.getFontStyle(x),$={content:p.substring(I,v),offset:b+I,color:E,fontStyle:L};if(s.includeExplanation){const N=[];if(s.includeExplanation!=="scopeName")for(const P of n.settings){let Z;switch(typeof P.scope){case"string":Z=P.scope.split(/,/).map(Fe=>Fe.trim());break;case"object":Z=P.scope;break;default:continue}N.push({settings:P,selectors:Z.map(Fe=>Fe.split(/ /))})}$.explanation=[];let q=0;for(;I+q<v;){const P=w[y],Z=p.substring(P.startIndex,P.endIndex);q+=Z.length,$.explanation.push({content:Z,scopes:s.includeExplanation==="scopeName"?Ea(P.scopes):Aa(N,P.scopes)}),y+=1}}f.push($)}u.push(f),f=[],c=g.ruleStack}return{tokens:u,stateStack:c}}function Ea(t){return t.map(e=>({scopeName:e}))}function Aa(t,e){const n=[];for(let r=0,s=e.length;r<s;r++){const o=e[r];n[r]={scopeName:o,themeMatches:La(t,o,e.slice(0,r))}}return n}function sr(t,e){return t===e||e.substring(0,t.length)===t&&e[t.length]==="."}function Ra(t,e,n){if(!sr(t[t.length-1],e))return!1;let r=t.length-2,s=n.length-1;for(;r>=0&&s>=0;)sr(t[r],n[s])&&(r-=1),s-=1;return r===-1}function La(t,e,n){const r=[];for(const{selectors:s,settings:o}of t)for(const i of s)if(Ra(i,e,n)){r.push(o);break}return r}function gs(t,e,n){const r=Object.entries(n.themes).filter(l=>l[1]).map(l=>({color:l[0],theme:l[1]})),s=r.map(l=>{const c=Rn(t,e,{...n,theme:l.theme}),f=Ke(c),u=typeof l.theme=="string"?l.theme:l.theme.name;return{tokens:c,state:f,theme:u}}),o=Na(...s.map(l=>l.tokens)),i=o[0].map((l,c)=>l.map((f,u)=>{const h={content:f.content,variants:{},offset:f.offset};return"includeExplanation"in n&&n.includeExplanation&&(h.explanation=f.explanation),o.forEach((d,p)=>{const{content:b,explanation:C,offset:w,...y}=d[c][u];h.variants[r[p].color]=y}),h})),a=s[0].state?new De(Object.fromEntries(s.map(l=>{var c;return[l.theme,(c=l.state)==null?void 0:c.getInternalStack(l.theme)]})),s[0].state.lang):void 0;return a&&Et(i,a),i}function Na(...t){const e=t.map(()=>[]),n=t.length;for(let r=0;r<t[0].length;r++){const s=t.map(l=>l[r]),o=e.map(()=>[]);e.forEach((l,c)=>l.push(o[c]));const i=s.map(()=>0),a=s.map(l=>l[0]);for(;a.every(l=>l);){const l=Math.min(...a.map(c=>c.content.length));for(let c=0;c<n;c++){const f=a[c];f.content.length===l?(o[c].push(f),i[c]+=1,a[c]=s[c][i[c]]):(o[c].push({...f,content:f.content.slice(0,l)}),a[c]={...f,content:f.content.slice(l),offset:f.offset+l})}}}return e}function kt(t,e,n){let r,s,o,i,a,l;if("themes"in n){const{defaultColor:c="light",cssVariablePrefix:f="--shiki-",colorsRendering:u="css-vars"}=n,h=Object.entries(n.themes).filter(w=>w[1]).map(w=>({color:w[0],theme:w[1]})).sort((w,y)=>w.color===c?-1:y.color===c?1:0);if(h.length===0)throw new U("`themes` option must not be empty");const d=gs(t,e,n);if(l=Ke(d),c&&An!==c&&!h.find(w=>w.color===c))throw new U(`\`themes\` option must contain the defaultColor key \`${c}\``);const p=h.map(w=>t.getTheme(w.theme)),b=h.map(w=>w.color);o=d.map(w=>w.map(y=>ua(y,b,f,c,u))),l&&Et(o,l);const C=h.map(w=>Ct(w.theme,n));s=or(h,p,C,f,c,"fg",u),r=or(h,p,C,f,c,"bg",u),i=`shiki-themes ${p.map(w=>w.name).join(" ")}`,a=c?void 0:[s,r].join(";")}else if("theme"in n){const c=Ct(n.theme,n);o=Rn(t,e,n);const f=t.getTheme(n.theme);r=ge(f.bg,c),s=ge(f.fg,c),i=f.name,l=Ke(o)}else throw new U("Invalid options, either `theme` or `themes` must be provided");return{tokens:o,fg:s,bg:r,themeName:i,rootStyle:a,grammarState:l}}function or(t,e,n,r,s,o,i){return t.map((a,l)=>{const c=ge(e[l][o],n[l])||"inherit",f=`${r+a.color}${o==="bg"?"-bg":""}:${c}`;if(l===0&&s){if(s===An&&t.length>1){const u=t.findIndex(b=>b.color==="light"),h=t.findIndex(b=>b.color==="dark");if(u===-1||h===-1)throw new U('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const d=ge(e[u][o],n[u])||"inherit",p=ge(e[h][o],n[h])||"inherit";return`light-dark(${d}, ${p});${f}`}return c}return i==="css-vars"?f:null}).filter(a=>!!a).join(";")}function xt(t,e,n,r={meta:{},options:n,codeToHast:(s,o)=>xt(t,s,o),codeToTokens:(s,o)=>kt(t,s,o)}){var p,b;let s=e;for(const C of St(n))s=((p=C.preprocess)==null?void 0:p.call(r,s,n))||s;let{tokens:o,fg:i,bg:a,themeName:l,rootStyle:c,grammarState:f}=kt(t,s,n);const{mergeWhitespaces:u=!0,mergeSameStyleTokens:h=!1}=n;u===!0?o=Ta(o):u==="never"&&(o=$a(o)),h&&(o=Ma(o));const d={...r,get source(){return s}};for(const C of St(n))o=((b=C.tokens)==null?void 0:b.call(d,o))||o;return Pa(o,{...n,fg:i,bg:a,themeName:l,rootStyle:n.rootStyle===!1?!1:n.rootStyle??c},d,f)}function Pa(t,e,n,r=Ke(t)){var b,C,w,y;const s=St(e),o=[],i={type:"root",children:[]},{structure:a="classic",tabindex:l="0"}=e,c={class:`shiki ${e.themeName||""}`};e.rootStyle!==!1&&(e.rootStyle!=null?c.style=e.rootStyle:c.style=`background-color:${e.bg};color:${e.fg}`),l!==!1&&l!=null&&(c.tabindex=l.toString());for(const[g,_]of Object.entries(e.meta||{}))g.startsWith("_")||(c[g]=_);let f={type:"element",tagName:"pre",properties:c,children:[],data:e.data},u={type:"element",tagName:"code",properties:{},children:o};const h=[],d={...n,structure:a,addClassToHast:hs,get source(){return n.source},get tokens(){return t},get options(){return e},get root(){return i},get pre(){return f},get code(){return u},get lines(){return h}};if(t.forEach((g,_)=>{var v,x;_&&(a==="inline"?i.children.push({type:"element",tagName:"br",properties:{},children:[]}):a==="classic"&&o.push({type:"text",value:`
|
|
12
|
+
`}));let k={type:"element",tagName:"span",properties:{class:"line"},children:[]},I=0;for(const E of g){let L={type:"element",tagName:"span",properties:{...E.htmlAttrs},children:[{type:"text",value:E.content}]};const $=dn(E.htmlStyle||_t(E));$&&(L.properties.style=$);for(const N of s)L=((v=N==null?void 0:N.span)==null?void 0:v.call(d,L,_+1,I,k,E))||L;a==="inline"?i.children.push(L):a==="classic"&&k.children.push(L),I+=E.content.length}if(a==="classic"){for(const E of s)k=((x=E==null?void 0:E.line)==null?void 0:x.call(d,k,_+1))||k;h.push(k),o.push(k)}else a==="inline"&&h.push(k)}),a==="classic"){for(const g of s)u=((b=g==null?void 0:g.code)==null?void 0:b.call(d,u))||u;f.children.push(u);for(const g of s)f=((C=g==null?void 0:g.pre)==null?void 0:C.call(d,f))||f;i.children.push(f)}else if(a==="inline"){const g=[];let _={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(const v of i.children)v.type==="element"&&v.tagName==="br"?(g.push(_),_={type:"element",tagName:"span",properties:{class:"line"},children:[]}):(v.type==="element"||v.type==="text")&&_.children.push(v);g.push(_);let I={type:"element",tagName:"code",properties:{},children:g};for(const v of s)I=((w=v==null?void 0:v.code)==null?void 0:w.call(d,I))||I;i.children=[];for(let v=0;v<I.children.length;v++){v>0&&i.children.push({type:"element",tagName:"br",properties:{},children:[]});const x=I.children[v];x.type==="element"&&i.children.push(...x.children)}}let p=i;for(const g of s)p=((y=g==null?void 0:g.root)==null?void 0:y.call(d,p))||p;return r&&Et(p,r),p}function Ta(t){return t.map(e=>{const n=[];let r="",s;return e.forEach((o,i)=>{const l=!(o.fontStyle&&(o.fontStyle&z.Underline||o.fontStyle&z.Strikethrough));l&&o.content.match(/^\s+$/)&&e[i+1]?(s===void 0&&(s=o.offset),r+=o.content):r?(l?n.push({...o,offset:s,content:r+o.content}):n.push({content:r,offset:s},o),s=void 0,r=""):n.push(o)}),n})}function $a(t){return t.map(e=>e.flatMap(n=>{if(n.content.match(/^\s+$/))return n;const r=n.content.match(/^(\s*)(.*?)(\s*)$/);if(!r)return n;const[,s,o,i]=r;if(!s&&!i)return n;const a=[{...n,offset:n.offset+s.length,content:o}];return s&&a.unshift({content:s,offset:n.offset}),i&&a.push({content:i,offset:n.offset+s.length+o.length}),a}))}function Ma(t){return t.map(e=>{const n=[];for(const r of e){if(n.length===0){n.push({...r});continue}const s=n[n.length-1],o=dn(s.htmlStyle||_t(s)),i=dn(r.htmlStyle||_t(r)),a=s.fontStyle&&(s.fontStyle&z.Underline||s.fontStyle&z.Strikethrough),l=r.fontStyle&&(r.fontStyle&z.Underline||r.fontStyle&z.Strikethrough);!a&&!l&&o===i?s.content+=r.content:n.push({...r})}return n})}const Oa=ea;function Da(t,e,n){var o;const r={meta:{},options:n,codeToHast:(i,a)=>xt(t,i,a),codeToTokens:(i,a)=>kt(t,i,a)};let s=Oa(xt(t,e,n,r));for(const i of St(n))s=((o=i.postprocess)==null?void 0:o.call(r,s,n))||s;return s}const ir={light:"#333333",dark:"#bbbbbb"},ar={light:"#fffffe",dark:"#1e1e1e"},lr="__shiki_resolved";function Nn(t){var a,l,c,f,u;if(t!=null&&t[lr])return t;const e={...t};e.tokenColors&&!e.settings&&(e.settings=e.tokenColors,delete e.tokenColors),e.type||(e.type="dark"),e.colorReplacements={...e.colorReplacements},e.settings||(e.settings=[]);let{bg:n,fg:r}=e;if(!n||!r){const h=e.settings?e.settings.find(d=>!d.name&&!d.scope):void 0;(a=h==null?void 0:h.settings)!=null&&a.foreground&&(r=h.settings.foreground),(l=h==null?void 0:h.settings)!=null&&l.background&&(n=h.settings.background),!r&&((c=e==null?void 0:e.colors)!=null&&c["editor.foreground"])&&(r=e.colors["editor.foreground"]),!n&&((f=e==null?void 0:e.colors)!=null&&f["editor.background"])&&(n=e.colors["editor.background"]),r||(r=e.type==="light"?ir.light:ir.dark),n||(n=e.type==="light"?ar.light:ar.dark),e.fg=r,e.bg=n}e.settings[0]&&e.settings[0].settings&&!e.settings[0].scope||e.settings.unshift({settings:{foreground:e.fg,background:e.bg}});let s=0;const o=new Map;function i(h){var p;if(o.has(h))return o.get(h);s+=1;const d=`#${s.toString(16).padStart(8,"0").toLowerCase()}`;return(p=e.colorReplacements)!=null&&p[`#${d}`]?i(h):(o.set(h,d),d)}e.settings=e.settings.map(h=>{var C,w;const d=((C=h.settings)==null?void 0:C.foreground)&&!h.settings.foreground.startsWith("#"),p=((w=h.settings)==null?void 0:w.background)&&!h.settings.background.startsWith("#");if(!d&&!p)return h;const b={...h,settings:{...h.settings}};if(d){const y=i(h.settings.foreground);e.colorReplacements[y]=h.settings.foreground,b.settings.foreground=y}if(p){const y=i(h.settings.background);e.colorReplacements[y]=h.settings.background,b.settings.background=y}return b});for(const h of Object.keys(e.colors||{}))if((h==="editor.foreground"||h==="editor.background"||h.startsWith("terminal.ansi"))&&!((u=e.colors[h])!=null&&u.startsWith("#"))){const d=i(e.colors[h]);e.colorReplacements[d]=e.colors[h],e.colors[h]=d}return Object.defineProperty(e,lr,{enumerable:!1,writable:!1,value:!0}),e}async function ms(t){return Array.from(new Set((await Promise.all(t.filter(e=>!sa(e)).map(async e=>await fs(e).then(n=>Array.isArray(n)?n:[n])))).flat()))}async function ys(t){return(await Promise.all(t.map(async n=>oa(n)?null:Nn(await fs(n))))).filter(n=>!!n)}let Ga=3;function Ba(t,e=3){e>Ga||console.trace(`[SHIKI DEPRECATE]: ${t}`)}let Pe=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function bs(t,e){if(!e)return t;if(e[t]){const n=new Set([t]);for(;e[t];){if(t=e[t],n.has(t))throw new Pe(`Circular alias \`${Array.from(n).join(" -> ")} -> ${t}\``);n.add(t)}}return t}class Fa extends Fo{constructor(n,r,s,o={}){super(n);m(this,"_resolvedThemes",new Map);m(this,"_resolvedGrammars",new Map);m(this,"_langMap",new Map);m(this,"_langGraph",new Map);m(this,"_textmateThemeCache",new WeakMap);m(this,"_loadedThemesCache",null);m(this,"_loadedLanguagesCache",null);this._resolver=n,this._themes=r,this._langs=s,this._alias=o,this._themes.map(i=>this.loadTheme(i)),this.loadLanguages(this._langs)}getTheme(n){return typeof n=="string"?this._resolvedThemes.get(n):this.loadTheme(n)}loadTheme(n){const r=Nn(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=gt.createFromRawTheme(n),this._textmateThemeCache.set(n,r)),this._syncRegistry.setTheme(r)}getGrammar(n){return n=bs(n,this._alias),this._resolvedGrammars.get(n)}loadLanguage(n){var i,a,l,c;if(this.getGrammar(n.name))return;const r=new Set([...this._langMap.values()].filter(f=>{var u;return(u=f.embeddedLangsLazy)==null?void 0:u.includes(n.name)}));this._resolver.addLanguage(n);const s={balancedBracketSelectors:n.balancedBracketSelectors||["*"],unbalancedBracketSelectors:n.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(n.scopeName,n);const o=this.loadGrammarWithConfiguration(n.scopeName,1,s);if(o.name=n.name,this._resolvedGrammars.set(n.name,o),n.aliases&&n.aliases.forEach(f=>{this._alias[f]=n.name}),this._loadedLanguagesCache=null,r.size)for(const f of r)this._resolvedGrammars.delete(f.name),this._loadedLanguagesCache=null,(a=(i=this._syncRegistry)==null?void 0:i._injectionGrammars)==null||a.delete(f.scopeName),(c=(l=this._syncRegistry)==null?void 0:l._grammars)==null||c.delete(f.scopeName),this.loadLanguage(this._langMap.get(f.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(n){for(const o of n)this.resolveEmbeddedLanguages(o);const r=Array.from(this._langGraph.entries()),s=r.filter(([o,i])=>!i);if(s.length){const o=r.filter(([i,a])=>{if(!a)return!1;const l=a.embeddedLanguages||a.embeddedLangs;return l==null?void 0:l.some(c=>s.map(([f])=>f).includes(c))}).filter(i=>!s.includes(i));throw new Pe(`Missing languages ${s.map(([i])=>`\`${i}\``).join(", ")}, required by ${o.map(([i])=>`\`${i}\``).join(", ")}`)}for(const[o,i]of r)this._resolver.addLanguage(i);for(const[o,i]of r)this.loadLanguage(i)}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 Ua{constructor(e,n){m(this,"_langs",new Map);m(this,"_scopeToLang",new Map);m(this,"_injections",new Map);m(this,"_onigLib");this._onigLib={createOnigScanner:r=>e.createScanner(r),createOnigString:r=>e.createString(r)},n.forEach(r=>this.addLanguage(r))}get onigLib(){return this._onigLib}getLangRegistration(e){return this._langs.get(e)}loadGrammar(e){return this._scopeToLang.get(e)}addLanguage(e){this._langs.set(e.name,e),e.aliases&&e.aliases.forEach(n=>{this._langs.set(n,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(n=>{this._injections.get(n)||this._injections.set(n,[]),this._injections.get(n).push(e.scopeName)})}getInjections(e){const n=e.split(".");let r=[];for(let s=1;s<=n.length;s++){const o=n.slice(0,s).join(".");r=[...r,...this._injections.get(o)||[]]}return r}}let Ue=0;function ja(t){Ue+=1,t.warnings!==!1&&Ue>=10&&Ue%10===0&&console.warn(`[Shiki] ${Ue} 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 e=!1;if(!t.engine)throw new Pe("`engine` option is required for synchronous mode");const n=(t.langs||[]).flat(1),r=(t.themes||[]).flat(1).map(Nn),s=new Ua(t.engine,n),o=new Fa(s,r,n,t.langAlias);let i;function a(g){return bs(g,t.langAlias)}function l(g){w();const _=o.getGrammar(typeof g=="string"?g:g.name);if(!_)throw new Pe(`Language \`${g}\` not found, you may need to load it first`);return _}function c(g){if(g==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};w();const _=o.getTheme(g);if(!_)throw new Pe(`Theme \`${g}\` not found, you may need to load it first`);return _}function f(g){w();const _=c(g);i!==g&&(o.setTheme(_),i=g);const k=o.getColorMap();return{theme:_,colorMap:k}}function u(){return w(),o.getLoadedThemes()}function h(){return w(),o.getLoadedLanguages()}function d(...g){w(),o.loadLanguages(g.flat(1))}async function p(...g){return d(await ms(g))}function b(...g){w();for(const _ of g.flat(1))o.loadTheme(_)}async function C(...g){return w(),b(await ys(g))}function w(){if(e)throw new Pe("Shiki instance has been disposed")}function y(){e||(e=!0,o.dispose(),Ue-=1)}return{setTheme:f,getTheme:c,getLanguage:l,getLoadedThemes:u,getLoadedLanguages:h,resolveLangAlias:a,loadLanguage:p,loadLanguageSync:d,loadTheme:C,loadThemeSync:b,dispose:y,[Symbol.dispose]:y}}async function Wa(t){t.engine||Ba("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[e,n,r]=await Promise.all([ys(t.themes||[]),ms(t.langs||[]),t.engine]);return ja({...t,themes:e,langs:n,engine:r})}async function za(t){const e=await Wa(t);return{getLastGrammarState:(...n)=>va(e,...n),codeToTokensBase:(n,r)=>Rn(e,n,r),codeToTokensWithThemes:(n,r)=>gs(e,n,r),codeToTokens:(n,r)=>kt(e,n,r),codeToHast:(n,r)=>xt(e,n,r),codeToHtml:(n,r)=>Da(e,n,r),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...e,getInternalContext:()=>e}}function Ge(t){if([...t].length!==1)throw new Error(`Expected "${t}" to be a single code point`);return t.codePointAt(0)}function Ha(t,e,n){return t.has(e)||t.set(e,n),t.get(e)}const Pn=new Set(["alnum","alpha","ascii","blank","cntrl","digit","graph","lower","print","punct","space","upper","word","xdigit"]),j=String.raw;function Be(t,e){if(t==null)throw new Error(e??"Value expected");return t}const ws=j`\[\^?`,Cs=`c.? | C(?:-.?)?|${j`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${j`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${j`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${j`o\{[^\}]*\}?`}|${j`\d{1,3}`}`,Tn=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,ot=new RegExp(j`
|
|
13
|
+
\\ (?:
|
|
14
|
+
${Cs}
|
|
15
|
+
| [gk]<[^>]*>?
|
|
16
|
+
| [gk]'[^']*'?
|
|
17
|
+
| .
|
|
18
|
+
)
|
|
19
|
+
| \( (?:
|
|
20
|
+
\? (?:
|
|
21
|
+
[:=!>({]
|
|
22
|
+
| <[=!]
|
|
23
|
+
| <[^>]*>
|
|
24
|
+
| '[^']*'
|
|
25
|
+
| ~\|?
|
|
26
|
+
| #(?:[^)\\]|\\.?)*
|
|
27
|
+
| [^:)]*[:)]
|
|
28
|
+
)?
|
|
29
|
+
| \*[^\)]*\)?
|
|
30
|
+
)?
|
|
31
|
+
| (?:${Tn.source})+
|
|
32
|
+
| ${ws}
|
|
33
|
+
| .
|
|
34
|
+
`.replace(/\s+/g,""),"gsu"),Ht=new RegExp(j`
|
|
35
|
+
\\ (?:
|
|
36
|
+
${Cs}
|
|
37
|
+
| .
|
|
38
|
+
)
|
|
39
|
+
| \[:(?:\^?\p{Alpha}+|\^):\]
|
|
40
|
+
| ${ws}
|
|
41
|
+
| &&
|
|
42
|
+
| .
|
|
43
|
+
`.replace(/\s+/g,""),"gsu");function qa(t,e={}){const n={flags:"",...e,rules:{captureGroup:!1,singleline:!1,...e.rules}};if(typeof t!="string")throw new Error("String expected as pattern");const r=fl(n.flags),s=[r.extended],o={captureGroup:n.rules.captureGroup,getCurrentModX(){return s.at(-1)},numOpenGroups:0,popModX(){s.pop()},pushModX(u){s.push(u)},replaceCurrentModX(u){s[s.length-1]=u},singleline:n.rules.singleline};let i=[],a;for(ot.lastIndex=0;a=ot.exec(t);){const u=Va(o,t,a[0],ot.lastIndex);u.tokens?i.push(...u.tokens):u.token&&i.push(u.token),u.lastIndex!==void 0&&(ot.lastIndex=u.lastIndex)}const l=[];let c=0;i.filter(u=>u.type==="GroupOpen").forEach(u=>{u.kind==="capturing"?u.number=++c:u.raw==="("&&l.push(u)}),c||l.forEach((u,h)=>{u.kind="capturing",u.number=h+1});const f=c||l.length;return{tokens:i.map(u=>u.type==="EscapedNumber"?dl(u,f):u).flat(),flags:r}}function Va(t,e,n,r){const[s,o]=n;if(n==="["||n==="[^"){const i=Xa(e,n,r);return{tokens:i.tokens,lastIndex:i.lastIndex}}if(s==="\\"){if("AbBGyYzZ".includes(o))return{token:cr(n,n)};if(/^\\g[<']/.test(n)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:sl(n)}}if(/^\\k[<']/.test(n)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:Ss(n)}}if(o==="K")return{token:ks("keep",n)};if(o==="N"||o==="R")return{token:_e("newline",n,{negate:o==="N"})};if(o==="O")return{token:_e("any",n)};if(o==="X")return{token:_e("text_segment",n)};const i=_s(n,{inCharClass:!1});return Array.isArray(i)?{tokens:i}:{token:i}}if(s==="("){if(o==="*")return{token:ll(n)};if(n==="(?{")throw new Error(`Unsupported callout "${n}"`);if(n.startsWith("(?#")){if(e[r]!==")")throw new Error('Unclosed comment group "(?#"');return{lastIndex:r+1}}if(/^\(\?[-imx]+[:)]$/.test(n))return{token:al(n,t)};if(t.pushModX(t.getCurrentModX()),t.numOpenGroups++,n==="("&&!t.captureGroup||n==="(?:")return{token:Le("group",n)};if(n==="(?>")return{token:Le("atomic",n)};if(n==="(?="||n==="(?!"||n==="(?<="||n==="(?<!")return{token:Le(n[2]==="<"?"lookbehind":"lookahead",n,{negate:n.endsWith("!")})};if(n==="("&&t.captureGroup||n.startsWith("(?<")&&n.endsWith(">")||n.startsWith("(?'")&&n.endsWith("'"))return{token:Le("capturing",n,{...n!=="("&&{name:n.slice(3,-1)}})};if(n.startsWith("(?~")){if(n==="(?~|")throw new Error(`Unsupported absence function kind "${n}"`);return{token:Le("absence_repeater",n)}}throw n==="(?("?new Error(`Unsupported conditional "${n}"`):new Error(`Invalid or unsupported group option "${n}"`)}if(n===")"){if(t.popModX(),t.numOpenGroups--,t.numOpenGroups<0)throw new Error('Unmatched ")"');return{token:tl(n)}}if(t.getCurrentModX()){if(n==="#"){const i=e.indexOf(`
|
|
44
|
+
`,r);return{lastIndex:i===-1?e.length:i}}if(/^\s$/.test(n)){const i=/\s+/y;return i.lastIndex=r,{lastIndex:i.exec(e)?i.lastIndex:r}}}if(n===".")return{token:_e("dot",n)};if(n==="^"||n==="$"){const i=t.singleline?{"^":j`\A`,$:j`\Z`}[n]:n;return{token:cr(i,n)}}return n==="|"?{token:Za(n)}:Tn.test(n)?{tokens:pl(n)}:{token:ue(Ge(n),n)}}function Xa(t,e,n){const r=[ur(e[1]==="^",e)];let s=1,o;for(Ht.lastIndex=n;o=Ht.exec(t);){const i=o[0];if(i[0]==="["&&i[1]!==":")s++,r.push(ur(i[1]==="^",i));else if(i==="]"){if(r.at(-1).type==="CharacterClassOpen")r.push(ue(93,i));else if(s--,r.push(Qa(i)),!s)break}else{const a=Ka(i);Array.isArray(a)?r.push(...a):r.push(a)}}return{tokens:r,lastIndex:Ht.lastIndex||t.length}}function Ka(t){if(t[0]==="\\")return _s(t,{inCharClass:!0});if(t[0]==="["){const e=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(t);if(!e||!Pn.has(e.groups.name))throw new Error(`Invalid POSIX class "${t}"`);return _e("posix",t,{value:e.groups.name,negate:!!e.groups.negate})}return t==="-"?Ya(t):t==="&&"?Ja(t):ue(Ge(t),t)}function _s(t,{inCharClass:e}){const n=t[1];if(n==="c"||n==="C")return il(t);if("dDhHsSwW".includes(n))return cl(t);if(t.startsWith(j`\o{`))throw new Error(`Incomplete, invalid, or unsupported octal code point "${t}"`);if(/^\\[pP]\{/.test(t)){if(t.length===3)throw new Error(`Incomplete or invalid Unicode property "${t}"`);return ul(t)}if(new RegExp("^\\\\x[89A-Fa-f]\\p{AHex}","u").test(t))try{const r=t.split(/\\x/).slice(1).map(i=>parseInt(i,16)),s=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}).decode(new Uint8Array(r)),o=new TextEncoder;return[...s].map(i=>{const a=[...o.encode(i)].map(l=>`\\x${l.toString(16)}`).join("");return ue(Ge(i),a)})}catch{throw new Error(`Multibyte code "${t}" incomplete or invalid in Oniguruma`)}if(n==="u"||n==="x")return ue(hl(t),t);if(fr.has(n))return ue(fr.get(n),t);if(/\d/.test(n))return el(e,t);if(t==="\\")throw new Error(j`Incomplete escape "\"`);if(n==="M")throw new Error(`Unsupported meta "${t}"`);if([...t].length===2)return ue(t.codePointAt(1),t);throw new Error(`Unexpected escape "${t}"`)}function Za(t){return{type:"Alternator",raw:t}}function cr(t,e){return{type:"Assertion",kind:t,raw:e}}function Ss(t){return{type:"Backreference",raw:t}}function ue(t,e){return{type:"Character",value:t,raw:e}}function Qa(t){return{type:"CharacterClassClose",raw:t}}function Ya(t){return{type:"CharacterClassHyphen",raw:t}}function Ja(t){return{type:"CharacterClassIntersector",raw:t}}function ur(t,e){return{type:"CharacterClassOpen",negate:t,raw:e}}function _e(t,e,n={}){return{type:"CharacterSet",kind:t,...n,raw:e}}function ks(t,e,n={}){return t==="keep"?{type:"Directive",kind:t,raw:e}:{type:"Directive",kind:t,flags:Be(n.flags),raw:e}}function el(t,e){return{type:"EscapedNumber",inCharClass:t,raw:e}}function tl(t){return{type:"GroupClose",raw:t}}function Le(t,e,n={}){return{type:"GroupOpen",kind:t,...n,raw:e}}function nl(t,e,n,r){return{type:"NamedCallout",kind:t,tag:e,arguments:n,raw:r}}function rl(t,e,n,r){return{type:"Quantifier",kind:t,min:e,max:n,raw:r}}function sl(t){return{type:"Subroutine",raw:t}}const ol=new Set(["COUNT","CMP","ERROR","FAIL","MAX","MISMATCH","SKIP","TOTAL_COUNT"]),fr=new Map([["a",7],["b",8],["e",27],["f",12],["n",10],["r",13],["t",9],["v",11]]);function il(t){const e=t[1]==="c"?t[2]:t[3];if(!e||!/[A-Za-z]/.test(e))throw new Error(`Unsupported control character "${t}"`);return ue(Ge(e.toUpperCase())-64,t)}function al(t,e){let{on:n,off:r}=/^\(\?(?<on>[imx]*)(?:-(?<off>[-imx]*))?/.exec(t).groups;r??(r="");const s=(e.getCurrentModX()||n.includes("x"))&&!r.includes("x"),o=dr(n),i=dr(r),a={};if(o&&(a.enable=o),i&&(a.disable=i),t.endsWith(")"))return e.replaceCurrentModX(s),ks("flags",t,{flags:a});if(t.endsWith(":"))return e.pushModX(s),e.numOpenGroups++,Le("group",t,{...(o||i)&&{flags:a}});throw new Error(`Unexpected flag modifier "${t}"`)}function ll(t){const e=/\(\*(?<name>[A-Za-z_]\w*)?(?:\[(?<tag>(?:[A-Za-z_]\w*)?)\])?(?:\{(?<args>[^}]*)\})?\)/.exec(t);if(!e)throw new Error(`Incomplete or invalid named callout "${t}"`);const{name:n,tag:r,args:s}=e.groups;if(!n)throw new Error(`Invalid named callout "${t}"`);if(r==="")throw new Error(`Named callout tag with empty value not allowed "${t}"`);const o=s?s.split(",").filter(f=>f!=="").map(f=>/^[+-]?\d+$/.test(f)?+f:f):[],[i,a,l]=o,c=ol.has(n)?n.toLowerCase():"custom";switch(c){case"fail":case"mismatch":case"skip":if(o.length>0)throw new Error(`Named callout arguments not allowed "${o}"`);break;case"error":if(o.length>1)throw new Error(`Named callout allows only one argument "${o}"`);if(typeof i=="string")throw new Error(`Named callout argument must be a number "${i}"`);break;case"max":if(!o.length||o.length>2)throw new Error(`Named callout must have one or two arguments "${o}"`);if(typeof i=="string"&&!/^[A-Za-z_]\w*$/.test(i))throw new Error(`Named callout argument one must be a tag or number "${i}"`);if(o.length===2&&(typeof a=="number"||!/^[<>X]$/.test(a)))throw new Error(`Named callout optional argument two must be '<', '>', or 'X' "${a}"`);break;case"count":case"total_count":if(o.length>1)throw new Error(`Named callout allows only one argument "${o}"`);if(o.length===1&&(typeof i=="number"||!/^[<>X]$/.test(i)))throw new Error(`Named callout optional argument must be '<', '>', or 'X' "${i}"`);break;case"cmp":if(o.length!==3)throw new Error(`Named callout must have three arguments "${o}"`);if(typeof i=="string"&&!/^[A-Za-z_]\w*$/.test(i))throw new Error(`Named callout argument one must be a tag or number "${i}"`);if(typeof a=="number"||!/^(?:[<>!=]=|[<>])$/.test(a))throw new Error(`Named callout argument two must be '==', '!=', '>', '<', '>=', or '<=' "${a}"`);if(typeof l=="string"&&!/^[A-Za-z_]\w*$/.test(l))throw new Error(`Named callout argument three must be a tag or number "${l}"`);break;case"custom":throw new Error(`Undefined callout name "${n}"`);default:throw new Error(`Unexpected named callout kind "${c}"`)}return nl(c,r??null,(s==null?void 0:s.split(","))??null,t)}function hr(t){let e=null,n,r;if(t[0]==="{"){const{minStr:s,maxStr:o}=/^\{(?<minStr>\d*)(?:,(?<maxStr>\d*))?/.exec(t).groups,i=1e5;if(+s>i||o&&+o>i)throw new Error("Quantifier value unsupported in Oniguruma");if(n=+s,r=o===void 0?+s:o===""?1/0:+o,n>r&&(e="possessive",[n,r]=[r,n]),t.endsWith("?")){if(e==="possessive")throw new Error('Unsupported possessive interval quantifier chain with "?"');e="lazy"}else e||(e="greedy")}else n=t[0]==="+"?1:0,r=t[0]==="?"?1:1/0,e=t[1]==="+"?"possessive":t[1]==="?"?"lazy":"greedy";return rl(e,n,r,t)}function cl(t){const e=t[1].toLowerCase();return _e({d:"digit",h:"hex",s:"space",w:"word"}[e],t,{negate:t[1]!==e})}function ul(t){const{p:e,neg:n,value:r}=/^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(t).groups;return _e("property",t,{value:r,negate:e==="P"&&!n||e==="p"&&!!n})}function dr(t){const e={};return t.includes("i")&&(e.ignoreCase=!0),t.includes("m")&&(e.dotAll=!0),t.includes("x")&&(e.extended=!0),Object.keys(e).length?e:null}function fl(t){const e={ignoreCase:!1,dotAll:!1,extended:!1,digitIsAscii:!1,posixIsAscii:!1,spaceIsAscii:!1,wordIsAscii:!1,textSegmentMode:null};for(let n=0;n<t.length;n++){const r=t[n];if(!"imxDPSWy".includes(r))throw new Error(`Invalid flag "${r}"`);if(r==="y"){if(!/^y{[gw]}/.test(t.slice(n)))throw new Error('Invalid or unspecified flag "y" mode');e.textSegmentMode=t[n+2]==="g"?"grapheme":"word",n+=3;continue}e[{i:"ignoreCase",m:"dotAll",x:"extended",D:"digitIsAscii",P:"posixIsAscii",S:"spaceIsAscii",W:"wordIsAscii"}[r]]=!0}return e}function hl(t){if(new RegExp("^(?:\\\\u(?!\\p{AHex}{4})|\\\\x(?!\\p{AHex}{1,2}|\\{\\p{AHex}{1,8}\\}))","u").test(t))throw new Error(`Incomplete or invalid escape "${t}"`);const e=t[2]==="{"?new RegExp("^\\\\x\\{\\s*(?<hex>\\p{AHex}+)","u").exec(t).groups.hex:t.slice(2);return parseInt(e,16)}function dl(t,e){const{raw:n,inCharClass:r}=t,s=n.slice(1);if(!r&&(s!=="0"&&s.length===1||s[0]!=="0"&&+s<=e))return[Ss(n)];const o=[],i=s.match(/^[0-7]+|\d/g);for(let a=0;a<i.length;a++){const l=i[a];let c;if(a===0&&l!=="8"&&l!=="9"){if(c=parseInt(l,8),c>127)throw new Error(j`Octal encoded byte above 177 unsupported "${n}"`)}else c=Ge(l);o.push(ue(c,(a===0?"\\":"")+l))}return o}function pl(t){const e=[],n=new RegExp(Tn,"gy");let r;for(;r=n.exec(t);){const s=r[0];if(s[0]==="{"){const o=/^\{(?<min>\d+),(?<max>\d+)\}\??$/.exec(s);if(o){const{min:i,max:a}=o.groups;if(+i>+a&&s.endsWith("?")){n.lastIndex--,e.push(hr(s.slice(0,-1)));continue}}}e.push(hr(s))}return e}function xs(t,e){if(!Array.isArray(t.body))throw new Error("Expected node with body array");if(t.body.length!==1)return!1;const n=t.body[0];return!e||Object.keys(e).every(r=>e[r]===n[r])}function gl(t){return ml.has(t.type)}const ml=new Set(["AbsenceFunction","Backreference","CapturingGroup","Character","CharacterClass","CharacterSet","Group","Quantifier","Subroutine"]);function vs(t,e={}){const n={flags:"",normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...e,rules:{captureGroup:!1,singleline:!1,...e.rules}},r=qa(t,{flags:n.flags,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline}}),s=(h,d)=>{const p=r.tokens[o.nextIndex];switch(o.parent=h,o.nextIndex++,p.type){case"Alternator":return ve();case"Assertion":return yl(p);case"Backreference":return bl(p,o);case"Character":return At(p.value,{useLastValid:!!d.isCheckingRangeEnd});case"CharacterClassHyphen":return wl(p,o,d);case"CharacterClassOpen":return Cl(p,o,d);case"CharacterSet":return _l(p,o);case"Directive":return El(p.kind,{flags:p.flags});case"GroupOpen":return Sl(p,o,d);case"NamedCallout":return Rl(p.kind,p.tag,p.arguments);case"Quantifier":return kl(p,o);case"Subroutine":return xl(p,o);default:throw new Error(`Unexpected token type "${p.type}"`)}},o={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},i=Nl(Al(r.flags));let a=i.body[0];for(;o.nextIndex<r.tokens.length;){const h=s(a,{});h.type==="Alternative"?(i.body.push(h),a=h):a.body.push(h)}const{capturingGroups:l,hasNumberedRef:c,namedGroupsByName:f,subroutines:u}=o;if(c&&f.size&&!n.rules.captureGroup)throw new Error("Numbered backref/subroutine not allowed when using named capture");for(const{ref:h}of u)if(typeof h=="number"){if(h>l.length)throw new Error("Subroutine uses a group number that's not defined");h&&(l[h-1].isSubroutined=!0)}else if(f.has(h)){if(f.get(h).length>1)throw new Error(j`Subroutine uses a duplicate group name "\g<${h}>"`);f.get(h)[0].isSubroutined=!0}else throw new Error(j`Subroutine uses a group name that's not defined "\g<${h}>"`);return i}function yl({kind:t}){return pn(Be({"^":"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"}[t],`Unexpected assertion kind "${t}"`),{negate:t===j`\B`||t===j`\Y`})}function bl({raw:t},e){const n=/^\\k[<']/.test(t),r=n?t.slice(3,-1):t.slice(1),s=(o,i=!1)=>{const a=e.capturingGroups.length;let l=!1;if(o>a)if(e.skipBackrefValidation)l=!0;else throw new Error(`Not enough capturing groups defined to the left "${t}"`);return e.hasNumberedRef=!0,gn(i?a+1-o:o,{orphan:l})};if(n){const o=/^(?<sign>-?)0*(?<num>[1-9]\d*)$/.exec(r);if(o)return s(+o.groups.num,!!o.groups.sign);if(/[-+]/.test(r))throw new Error(`Invalid backref name "${t}"`);if(!e.namedGroupsByName.has(r))throw new Error(`Group name not defined to the left "${t}"`);return gn(r)}return s(+r)}function wl(t,e,n){const{tokens:r,walk:s}=e,o=e.parent,i=o.body.at(-1),a=r[e.nextIndex];if(!n.isCheckingRangeEnd&&i&&i.type!=="CharacterClass"&&i.type!=="CharacterClassRange"&&a&&a.type!=="CharacterClassOpen"&&a.type!=="CharacterClassClose"&&a.type!=="CharacterClassIntersector"){const l=s(o,{...n,isCheckingRangeEnd:!0});if(i.type==="Character"&&l.type==="Character")return o.body.pop(),Il(i,l);throw new Error("Invalid character class range")}return At(Ge("-"))}function Cl({negate:t},e,n){const{tokens:r,walk:s}=e,o=r[e.nextIndex],i=[dt()];let a=mr(o);for(;a.type!=="CharacterClassClose";){if(a.type==="CharacterClassIntersector")i.push(dt()),e.nextIndex++;else{const c=i.at(-1);c.body.push(s(c,n))}a=mr(r[e.nextIndex],o)}const l=dt({negate:t});return i.length===1?l.body=i[0].body:(l.kind="intersection",l.body=i.map(c=>c.body.length===1?c.body[0]:c)),e.nextIndex++,l}function _l({kind:t,negate:e,value:n},r){const{normalizeUnknownPropertyNames:s,skipPropertyNameValidation:o,unicodePropertyMap:i}=r;if(t==="property"){const a=Rt(n);if(Pn.has(a)&&!(i!=null&&i.has(a)))t="posix",n=a;else return Ne(n,{negate:e,normalizeUnknownPropertyNames:s,skipPropertyNameValidation:o,unicodePropertyMap:i})}return t==="posix"?Ll(n,{negate:e}):mn(t,{negate:e})}function Sl(t,e,n){const{tokens:r,capturingGroups:s,namedGroupsByName:o,skipLookbehindValidation:i,walk:a}=e,l=Pl(t),c=l.type==="AbsenceFunction",f=gr(l),u=f&&l.negate;if(l.type==="CapturingGroup"&&(s.push(l),l.name&&Ha(o,l.name,[]).push(l)),c&&n.isInAbsenceFunction)throw new Error("Nested absence function not supported by Oniguruma");let h=yr(r[e.nextIndex]);for(;h.type!=="GroupClose";){if(h.type==="Alternator")l.body.push(ve()),e.nextIndex++;else{const d=l.body.at(-1),p=a(d,{...n,isInAbsenceFunction:n.isInAbsenceFunction||c,isInLookbehind:n.isInLookbehind||f,isInNegLookbehind:n.isInNegLookbehind||u});if(d.body.push(p),(f||n.isInLookbehind)&&!i){const b="Lookbehind includes a pattern not allowed by Oniguruma";if(u||n.isInNegLookbehind){if(pr(p)||p.type==="CapturingGroup")throw new Error(b)}else if(pr(p)||gr(p)&&p.negate)throw new Error(b)}}h=yr(r[e.nextIndex])}return e.nextIndex++,l}function kl({kind:t,min:e,max:n},r){const s=r.parent,o=s.body.at(-1);if(!o||!gl(o))throw new Error("Quantifier requires a repeatable token");const i=Es(t,e,n,o);return s.body.pop(),i}function xl({raw:t},e){const{capturingGroups:n,subroutines:r}=e;let s=t.slice(3,-1);const o=/^(?<sign>[-+]?)0*(?<num>[1-9]\d*)$/.exec(s);if(o){const a=+o.groups.num,l=n.length;if(e.hasNumberedRef=!0,s={"":a,"+":l+a,"-":l+1-a}[o.groups.sign],s<1)throw new Error("Invalid subroutine number")}else s==="0"&&(s=0);const i=As(s);return r.push(i),i}function vl(t,e){return{type:"AbsenceFunction",kind:t,body:tt(e==null?void 0:e.body)}}function ve(t){return{type:"Alternative",body:Rs(t==null?void 0:t.body)}}function pn(t,e){const n={type:"Assertion",kind:t};return(t==="word_boundary"||t==="text_segment_boundary")&&(n.negate=!!(e!=null&&e.negate)),n}function gn(t,e){const n=!!(e!=null&&e.orphan);return{type:"Backreference",ref:t,...n&&{orphan:n}}}function Is(t,e){const n={name:void 0,isSubroutined:!1,...e};if(n.name!==void 0&&!Tl(n.name))throw new Error(`Group name "${n.name}" invalid in Oniguruma`);return{type:"CapturingGroup",number:t,...n.name&&{name:n.name},...n.isSubroutined&&{isSubroutined:n.isSubroutined},body:tt(e==null?void 0:e.body)}}function At(t,e){const n={useLastValid:!1,...e};if(t>1114111){const r=t.toString(16);if(n.useLastValid)t=1114111;else throw t>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:t}}function dt(t){const e={kind:"union",negate:!1,...t};return{type:"CharacterClass",kind:e.kind,negate:e.negate,body:Rs(t==null?void 0:t.body)}}function Il(t,e){if(e.value<t.value)throw new Error("Character class range out of order");return{type:"CharacterClassRange",min:t,max:e}}function mn(t,e){const n=!!(e!=null&&e.negate),r={type:"CharacterSet",kind:t};return(t==="digit"||t==="hex"||t==="newline"||t==="space"||t==="word")&&(r.negate=n),(t==="text_segment"||t==="newline"&&!n)&&(r.variableLength=!0),r}function El(t,e={}){if(t==="keep")return{type:"Directive",kind:t};if(t==="flags")return{type:"Directive",kind:t,flags:Be(e.flags)};throw new Error(`Unexpected directive kind "${t}"`)}function Al(t){return{type:"Flags",...t}}function ne(t){const e=t==null?void 0:t.atomic,n=t==null?void 0:t.flags;if(e&&n)throw new Error("Atomic group cannot have flags");return{type:"Group",...e&&{atomic:e},...n&&{flags:n},body:tt(t==null?void 0:t.body)}}function we(t){const e={behind:!1,negate:!1,...t};return{type:"LookaroundAssertion",kind:e.behind?"lookbehind":"lookahead",negate:e.negate,body:tt(t==null?void 0:t.body)}}function Rl(t,e,n){return{type:"NamedCallout",kind:t,tag:e,arguments:n}}function Ll(t,e){const n=!!(e!=null&&e.negate);if(!Pn.has(t))throw new Error(`Invalid POSIX class "${t}"`);return{type:"CharacterSet",kind:"posix",value:t,negate:n}}function Es(t,e,n,r){if(e>n)throw new Error("Invalid reversed quantifier range");return{type:"Quantifier",kind:t,min:e,max:n,body:r}}function Nl(t,e){return{type:"Regex",body:tt(e==null?void 0:e.body),flags:t}}function As(t){return{type:"Subroutine",ref:t}}function Ne(t,e){var s;const n={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...e};let r=(s=n.unicodePropertyMap)==null?void 0:s.get(Rt(t));if(!r){if(n.normalizeUnknownPropertyNames)r=$l(t);else if(n.unicodePropertyMap&&!n.skipPropertyNameValidation)throw new Error(j`Invalid Unicode property "\p{${t}}"`)}return{type:"CharacterSet",kind:"property",value:r??t,negate:n.negate}}function Pl({flags:t,kind:e,name:n,negate:r,number:s}){switch(e){case"absence_repeater":return vl("repeater");case"atomic":return ne({atomic:!0});case"capturing":return Is(s,{name:n});case"group":return ne({flags:t});case"lookahead":case"lookbehind":return we({behind:e==="lookbehind",negate:r});default:throw new Error(`Unexpected group kind "${e}"`)}}function tt(t){if(t===void 0)t=[ve()];else if(!Array.isArray(t)||!t.length||!t.every(e=>e.type==="Alternative"))throw new Error("Invalid body; expected array of one or more Alternative nodes");return t}function Rs(t){if(t===void 0)t=[];else if(!Array.isArray(t)||!t.every(e=>!!e.type))throw new Error("Invalid body; expected array of nodes");return t}function pr(t){return t.type==="LookaroundAssertion"&&t.kind==="lookahead"}function gr(t){return t.type==="LookaroundAssertion"&&t.kind==="lookbehind"}function Tl(t){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(t)}function $l(t){return t.trim().replace(/[- _]+/g,"_").replace(/[A-Z][a-z]+(?=[A-Z])/g,"$&_").replace(/[A-Za-z]+/g,e=>e[0].toUpperCase()+e.slice(1).toLowerCase())}function Rt(t){return t.replace(/[- _]+/g,"").toLowerCase()}function mr(t,e){return Be(t,`${(e==null?void 0:e.type)==="Character"&&e.value===93?"Empty":"Unclosed"} character class`)}function yr(t){return Be(t,"Unclosed group")}function He(t,e,n=null){function r(o,i){for(let a=0;a<o.length;a++){const l=s(o[a],i,a,o);a=Math.max(-1,a+l)}}function s(o,i=null,a=null,l=null){var w,y;let c=0,f=!1;const u={node:o,parent:i,key:a,container:l,root:t,remove(){it(l).splice(Math.max(0,Ee(a)+c),1),c--,f=!0},removeAllNextSiblings(){return it(l).splice(Ee(a)+1)},removeAllPrevSiblings(){const g=Ee(a)+c;return c-=g,it(l).splice(0,Math.max(0,g))},replaceWith(g,_={}){const k=!!_.traverse;l?l[Math.max(0,Ee(a)+c)]=g:Be(i,"Can't replace root node")[a]=g,k&&s(g,i,a,l),f=!0},replaceWithMultiple(g,_={}){const k=!!_.traverse;if(it(l).splice(Math.max(0,Ee(a)+c),1,...g),c+=g.length-1,k){let I=0;for(let v=0;v<g.length;v++)I+=s(g[v],i,Ee(a)+v+I,l)}f=!0},skip(){f=!0}},{type:h}=o,d=e["*"],p=e[h],b=typeof d=="function"?d:d==null?void 0:d.enter,C=typeof p=="function"?p:p==null?void 0:p.enter;if(b==null||b(u,n),C==null||C(u,n),!f)switch(h){case"AbsenceFunction":case"CapturingGroup":case"Group":r(o.body,o);break;case"Alternative":case"CharacterClass":r(o.body,o);break;case"Assertion":case"Backreference":case"Character":case"CharacterSet":case"Directive":case"Flags":case"NamedCallout":case"Subroutine":break;case"CharacterClassRange":s(o.min,o,"min"),s(o.max,o,"max");break;case"LookaroundAssertion":r(o.body,o);break;case"Quantifier":s(o.body,o,"body");break;case"Regex":r(o.body,o),s(o.flags,o,"flags");break;default:throw new Error(`Unexpected node type "${h}"`)}return(w=p==null?void 0:p.exit)==null||w.call(p,u,n),(y=d==null?void 0:d.exit)==null||y.call(d,u,n),c}return s(t),t}function it(t){if(!Array.isArray(t))throw new Error("Container expected");return t}function Ee(t){if(typeof t!="number")throw new Error("Numeric key expected");return t}const Ml=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;function Ol(t,e){for(let n=0;n<t.length;n++)t[n]>=e&&t[n]++}function Dl(t,e,n,r){return t.slice(0,e)+r+t.slice(e+n.length)}const ee=Object.freeze({DEFAULT:"DEFAULT",CHAR_CLASS:"CHAR_CLASS"});function $n(t,e,n,r){const s=new RegExp(String.raw`${e}|(?<$skip>\[\^?|\\?.)`,"gsu"),o=[!1];let i=0,a="";for(const l of t.matchAll(s)){const{0:c,groups:{$skip:f}}=l;if(!f&&(!r||r===ee.DEFAULT==!i)){n instanceof Function?a+=n(l,{context:i?ee.CHAR_CLASS:ee.DEFAULT,negated:o[o.length-1]}):a+=n;continue}c[0]==="["?(i++,o.push(c[1]==="^")):c==="]"&&i&&(i--,o.pop()),a+=c}return a}function Ls(t,e,n,r){$n(t,e,n,r)}function Gl(t,e,n=0,r){if(!new RegExp(e,"su").test(t))return null;const s=new RegExp(`${e}|(?<$skip>\\\\?.)`,"gsu");s.lastIndex=n;let o=0,i;for(;i=s.exec(t);){const{0:a,groups:{$skip:l}}=i;if(!l&&(!r||r===ee.DEFAULT==!o))return i;a==="["?o++:a==="]"&&o&&o--,s.lastIndex==i.index&&s.lastIndex++}return null}function at(t,e,n){return!!Gl(t,e,0,n)}function Bl(t,e){const n=/\\?./gsu;n.lastIndex=e;let r=t.length,s=0,o=1,i;for(;i=n.exec(t);){const[a]=i;if(a==="[")s++;else if(s)a==="]"&&s--;else if(a==="(")o++;else if(a===")"&&(o--,!o)){r=i.index;break}}return t.slice(e,r)}const br=new RegExp(String.raw`(?<noncapturingStart>${Ml})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,"gsu");function Fl(t,e){const n=(e==null?void 0:e.hiddenCaptures)??[];let r=(e==null?void 0:e.captureTransfers)??new Map;if(!/\(\?>/.test(t))return{pattern:t,captureTransfers:r,hiddenCaptures:n};const s="(?>",o="(?:(?=(",i=[0],a=[];let l=0,c=0,f=NaN,u;do{u=!1;let h=0,d=0,p=!1,b;for(br.lastIndex=Number.isNaN(f)?0:f+o.length;b=br.exec(t);){const{0:C,index:w,groups:{capturingStart:y,noncapturingStart:g}}=b;if(C==="[")h++;else if(h)C==="]"&&h--;else if(C===s&&!p)f=w,p=!0;else if(p&&g)d++;else if(y)p?d++:(l++,i.push(l+c));else if(C===")"&&p){if(!d){c++;const _=l+c;if(t=`${t.slice(0,f)}${o}${t.slice(f+s.length,w)}))<$$${_}>)${t.slice(w+1)}`,u=!0,a.push(_),Ol(n,_),r.size){const k=new Map;r.forEach((I,v)=>{k.set(v>=_?v+1:v,I.map(x=>x>=_?x+1:x))}),r=k}break}d--}}}while(u);return n.push(...a),t=$n(t,String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,({0:h,groups:{backrefNum:d,wrappedBackrefNum:p}})=>{if(d){const b=+d;if(b>i.length-1)throw new Error(`Backref "${h}" greater than number of captures`);return`\\${i[b]}`}return`\\${p}`},ee.DEFAULT),{pattern:t,captureTransfers:r,hiddenCaptures:n}}const Ns=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,qt=new RegExp(String.raw`
|
|
45
|
+
\\(?: \d+
|
|
46
|
+
| c[A-Za-z]
|
|
47
|
+
| [gk]<[^>]+>
|
|
48
|
+
| [pPu]\{[^\}]+\}
|
|
49
|
+
| u[A-Fa-f\d]{4}
|
|
50
|
+
| x[A-Fa-f\d]{2}
|
|
51
|
+
)
|
|
52
|
+
| \((?: \? (?: [:=!>]
|
|
53
|
+
| <(?:[=!]|[^>]+>)
|
|
54
|
+
| [A-Za-z\-]+:
|
|
55
|
+
| \(DEFINE\)
|
|
56
|
+
))?
|
|
57
|
+
| (?<qBase>${Ns})(?<qMod>[?+]?)(?<invalidQ>[?*+\{]?)
|
|
58
|
+
| \\?.
|
|
59
|
+
`.replace(/\s+/g,""),"gsu");function Ul(t){if(!new RegExp(`${Ns}\\+`).test(t))return{pattern:t};const e=[];let n=null,r=null,s="",o=0,i;for(qt.lastIndex=0;i=qt.exec(t);){const{0:a,index:l,groups:{qBase:c,qMod:f,invalidQ:u}}=i;if(a==="[")o||(r=l),o++;else if(a==="]")o?o--:r=null;else if(!o)if(f==="+"&&s&&!s.startsWith("(")){if(u)throw new Error(`Invalid quantifier "${a}"`);let h=-1;if(/^\{\d+\}$/.test(c))t=Dl(t,l+c.length,f,"");else{if(s===")"||s==="]"){const d=s===")"?n:r;if(d===null)throw new Error(`Invalid unmatched "${s}"`);t=`${t.slice(0,d)}(?>${t.slice(d,l)}${c})${t.slice(l+a.length)}`}else t=`${t.slice(0,l-s.length)}(?>${s}${c})${t.slice(l+a.length)}`;h+=4}qt.lastIndex+=h}else a[0]==="("?e.push(l):a===")"&&(n=e.length?e.pop():null);s=a}return{pattern:t}}const J=String.raw,jl=J`\\g<(?<gRNameOrNum>[^>&]+)&R=(?<gRDepth>[^>]+)>`,yn=J`\(\?R=(?<rDepth>[^\)]+)\)|${jl}`,Lt=J`\(\?<(?![=!])(?<captureName>[^>]+)>`,Ps=J`${Lt}|(?<unnamed>\()(?!\?)`,be=new RegExp(J`${Lt}|${yn}|\(\?|\\?.`,"gsu"),Vt="Cannot use multiple overlapping recursions";function Wl(t,e){const{hiddenCaptures:n,mode:r}={hiddenCaptures:[],mode:"plugin",...e};let s=(e==null?void 0:e.captureTransfers)??new Map;if(!new RegExp(yn,"su").test(t))return{pattern:t,captureTransfers:s,hiddenCaptures:n};if(r==="plugin"&&at(t,J`\(\?\(DEFINE\)`,ee.DEFAULT))throw new Error("DEFINE groups cannot be used with recursion");const o=[],i=at(t,J`\\[1-9]`,ee.DEFAULT),a=new Map,l=[];let c=!1,f=0,u=0,h;for(be.lastIndex=0;h=be.exec(t);){const{0:d,groups:{captureName:p,rDepth:b,gRNameOrNum:C,gRDepth:w}}=h;if(d==="[")f++;else if(f)d==="]"&&f--;else if(b){if(wr(b),c)throw new Error(Vt);if(i)throw new Error(`${r==="external"?"Backrefs":"Numbered backrefs"} cannot be used with global recursion`);const y=t.slice(0,h.index),g=t.slice(be.lastIndex);if(at(g,yn,ee.DEFAULT))throw new Error(Vt);const _=+b-1;t=Cr(y,g,_,!1,n,o,u),s=Sr(s,y,_,o.length,0,u);break}else if(C){wr(w);let y=!1;for(const N of l)if(N.name===C||N.num===+C){if(y=!0,N.hasRecursedWithin)throw new Error(Vt);break}if(!y)throw new Error(J`Recursive \g cannot be used outside the referenced group "${r==="external"?C:J`\g<${C}&R=${w}>`}"`);const g=a.get(C),_=Bl(t,g);if(i&&at(_,J`${Lt}|\((?!\?)`,ee.DEFAULT))throw new Error(`${r==="external"?"Backrefs":"Numbered backrefs"} cannot be used with recursion of capturing groups`);const k=t.slice(g,h.index),I=_.slice(k.length+d.length),v=o.length,x=+w-1,E=Cr(k,I,x,!0,n,o,u);s=Sr(s,k,x,o.length-v,v,u);const L=t.slice(0,g),$=t.slice(g+_.length);t=`${L}${E}${$}`,be.lastIndex+=E.length-d.length-k.length-I.length,l.forEach(N=>N.hasRecursedWithin=!0),c=!0}else if(p)u++,a.set(String(u),be.lastIndex),a.set(p,be.lastIndex),l.push({num:u,name:p});else if(d[0]==="("){const y=d==="(";y&&(u++,a.set(String(u),be.lastIndex)),l.push(y?{num:u}:{})}else d===")"&&l.pop()}return n.push(...o),{pattern:t,captureTransfers:s,hiddenCaptures:n}}function wr(t){const e=`Max depth must be integer between 2 and 100; used ${t}`;if(!/^[1-9]\d*$/.test(t))throw new Error(e);if(t=+t,t<2||t>100)throw new Error(e)}function Cr(t,e,n,r,s,o,i){const a=new Set;r&&Ls(t+e,Lt,({groups:{captureName:c}})=>{a.add(c)},ee.DEFAULT);const l=[n,r?a:null,s,o,i];return`${t}${_r(`(?:${t}`,"forward",...l)}(?:)${_r(`${e})`,"backward",...l)}${e}`}function _r(t,e,n,r,s,o,i){const l=f=>e==="forward"?f+2:n-f+2-1;let c="";for(let f=0;f<n;f++){const u=l(f);c+=$n(t,J`${Ps}|\\k<(?<backref>[^>]+)>`,({0:h,groups:{captureName:d,unnamed:p,backref:b}})=>{if(b&&r&&!r.has(b))return h;const C=`_$${u}`;if(p||d){const w=i+o.length+1;return o.push(w),zl(s,w),p?h:`(?<${d}${C}>`}return J`\k<${b}${C}>`},ee.DEFAULT)}return c}function zl(t,e){for(let n=0;n<t.length;n++)t[n]>=e&&t[n]++}function Sr(t,e,n,r,s,o){if(t.size&&r){let i=0;Ls(e,Ps,()=>i++,ee.DEFAULT);const a=o-i+s,l=new Map;return t.forEach((c,f)=>{const u=(r-i*n)/n,h=i*n,d=f>a+i?f+r:f,p=[];for(const b of c)if(b<=a)p.push(b);else if(b>a+i+u)p.push(b+r);else if(b<=a+i)for(let C=0;C<=n;C++)p.push(b+i*C);else for(let C=0;C<=n;C++)p.push(b+h+u*C);l.set(d,p)}),l}return t}var D=String.fromCodePoint,A=String.raw,re={},Nt=globalThis.RegExp;re.flagGroups=(()=>{try{new Nt("(?i:)")}catch{return!1}return!0})();re.unicodeSets=(()=>{try{new Nt("[[]]","v")}catch{return!1}return!0})();re.bugFlagVLiteralHyphenIsRange=re.unicodeSets?(()=>{try{new Nt(A`[\d\-a]`,"v")}catch{return!0}return!1})():!1;re.bugNestedClassIgnoresNegation=re.unicodeSets&&new Nt("[[^a]]","v").test("a");function vt(t,{enable:e,disable:n}){return{dotAll:!(n!=null&&n.dotAll)&&!!(e!=null&&e.dotAll||t.dotAll),ignoreCase:!(n!=null&&n.ignoreCase)&&!!(e!=null&&e.ignoreCase||t.ignoreCase)}}function Ze(t,e,n){return t.has(e)||t.set(e,n),t.get(e)}function bn(t,e){return kr[t]>=kr[e]}function Hl(t,e){if(t==null)throw new Error(e??"Value expected");return t}var kr={ES2025:2025,ES2024:2024,ES2018:2018},ql={auto:"auto",ES2025:"ES2025",ES2024:"ES2024",ES2018:"ES2018"};function Ts(t={}){if({}.toString.call(t)!=="[object Object]")throw new Error("Unexpected options");if(t.target!==void 0&&!ql[t.target])throw new Error(`Unexpected target "${t.target}"`);const e={accuracy:"default",avoidSubclass:!1,flags:"",global:!1,hasIndices:!1,lazyCompileLength:1/0,target:"auto",verbose:!1,...t,rules:{allowOrphanBackrefs:!1,asciiWordBoundaries:!1,captureGroup:!1,recursionLimit:20,singleline:!1,...t.rules}};return e.target==="auto"&&(e.target=re.flagGroups?"ES2025":re.unicodeSets?"ES2024":"ES2018"),e}var Vl="[ -\r ]",Xl=new Set([D(304),D(305)]),ie=A`[\p{L}\p{M}\p{N}\p{Pc}]`;function $s(t){if(Xl.has(t))return[t];const e=new Set,n=t.toLowerCase(),r=n.toUpperCase(),s=Ql.get(n),o=Kl.get(n),i=Zl.get(n);return[...r].length===1&&e.add(r),i&&e.add(i),s&&e.add(s),e.add(n),o&&e.add(o),[...e]}var Mn=new Map(`C Other
|
|
60
|
+
Cc Control cntrl
|
|
61
|
+
Cf Format
|
|
62
|
+
Cn Unassigned
|
|
63
|
+
Co Private_Use
|
|
64
|
+
Cs Surrogate
|
|
65
|
+
L Letter
|
|
66
|
+
LC Cased_Letter
|
|
67
|
+
Ll Lowercase_Letter
|
|
68
|
+
Lm Modifier_Letter
|
|
69
|
+
Lo Other_Letter
|
|
70
|
+
Lt Titlecase_Letter
|
|
71
|
+
Lu Uppercase_Letter
|
|
72
|
+
M Mark Combining_Mark
|
|
73
|
+
Mc Spacing_Mark
|
|
74
|
+
Me Enclosing_Mark
|
|
75
|
+
Mn Nonspacing_Mark
|
|
76
|
+
N Number
|
|
77
|
+
Nd Decimal_Number digit
|
|
78
|
+
Nl Letter_Number
|
|
79
|
+
No Other_Number
|
|
80
|
+
P Punctuation punct
|
|
81
|
+
Pc Connector_Punctuation
|
|
82
|
+
Pd Dash_Punctuation
|
|
83
|
+
Pe Close_Punctuation
|
|
84
|
+
Pf Final_Punctuation
|
|
85
|
+
Pi Initial_Punctuation
|
|
86
|
+
Po Other_Punctuation
|
|
87
|
+
Ps Open_Punctuation
|
|
88
|
+
S Symbol
|
|
89
|
+
Sc Currency_Symbol
|
|
90
|
+
Sk Modifier_Symbol
|
|
91
|
+
Sm Math_Symbol
|
|
92
|
+
So Other_Symbol
|
|
93
|
+
Z Separator
|
|
94
|
+
Zl Line_Separator
|
|
95
|
+
Zp Paragraph_Separator
|
|
96
|
+
Zs Space_Separator
|
|
97
|
+
ASCII
|
|
98
|
+
ASCII_Hex_Digit AHex
|
|
99
|
+
Alphabetic Alpha
|
|
100
|
+
Any
|
|
101
|
+
Assigned
|
|
102
|
+
Bidi_Control Bidi_C
|
|
103
|
+
Bidi_Mirrored Bidi_M
|
|
104
|
+
Case_Ignorable CI
|
|
105
|
+
Cased
|
|
106
|
+
Changes_When_Casefolded CWCF
|
|
107
|
+
Changes_When_Casemapped CWCM
|
|
108
|
+
Changes_When_Lowercased CWL
|
|
109
|
+
Changes_When_NFKC_Casefolded CWKCF
|
|
110
|
+
Changes_When_Titlecased CWT
|
|
111
|
+
Changes_When_Uppercased CWU
|
|
112
|
+
Dash
|
|
113
|
+
Default_Ignorable_Code_Point DI
|
|
114
|
+
Deprecated Dep
|
|
115
|
+
Diacritic Dia
|
|
116
|
+
Emoji
|
|
117
|
+
Emoji_Component EComp
|
|
118
|
+
Emoji_Modifier EMod
|
|
119
|
+
Emoji_Modifier_Base EBase
|
|
120
|
+
Emoji_Presentation EPres
|
|
121
|
+
Extended_Pictographic ExtPict
|
|
122
|
+
Extender Ext
|
|
123
|
+
Grapheme_Base Gr_Base
|
|
124
|
+
Grapheme_Extend Gr_Ext
|
|
125
|
+
Hex_Digit Hex
|
|
126
|
+
IDS_Binary_Operator IDSB
|
|
127
|
+
IDS_Trinary_Operator IDST
|
|
128
|
+
ID_Continue IDC
|
|
129
|
+
ID_Start IDS
|
|
130
|
+
Ideographic Ideo
|
|
131
|
+
Join_Control Join_C
|
|
132
|
+
Logical_Order_Exception LOE
|
|
133
|
+
Lowercase Lower
|
|
134
|
+
Math
|
|
135
|
+
Noncharacter_Code_Point NChar
|
|
136
|
+
Pattern_Syntax Pat_Syn
|
|
137
|
+
Pattern_White_Space Pat_WS
|
|
138
|
+
Quotation_Mark QMark
|
|
139
|
+
Radical
|
|
140
|
+
Regional_Indicator RI
|
|
141
|
+
Sentence_Terminal STerm
|
|
142
|
+
Soft_Dotted SD
|
|
143
|
+
Terminal_Punctuation Term
|
|
144
|
+
Unified_Ideograph UIdeo
|
|
145
|
+
Uppercase Upper
|
|
146
|
+
Variation_Selector VS
|
|
147
|
+
White_Space space
|
|
148
|
+
XID_Continue XIDC
|
|
149
|
+
XID_Start XIDS`.split(/\s/).map(t=>[Rt(t),t])),Kl=new Map([["s",D(383)],[D(383),"s"]]),Zl=new Map([[D(223),D(7838)],[D(107),D(8490)],[D(229),D(8491)],[D(969),D(8486)]]),Ql=new Map([fe(453),fe(456),fe(459),fe(498),...Xt(8072,8079),...Xt(8088,8095),...Xt(8104,8111),fe(8124),fe(8140),fe(8188)]),Yl=new Map([["alnum",A`[\p{Alpha}\p{Nd}]`],["alpha",A`\p{Alpha}`],["ascii",A`\p{ASCII}`],["blank",A`[\p{Zs}\t]`],["cntrl",A`\p{Cc}`],["digit",A`\p{Nd}`],["graph",A`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],["lower",A`\p{Lower}`],["print",A`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],["punct",A`[\p{P}\p{S}]`],["space",A`\p{space}`],["upper",A`\p{Upper}`],["word",A`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],["xdigit",A`\p{AHex}`]]);function Jl(t,e){const n=[];for(let r=t;r<=e;r++)n.push(r);return n}function fe(t){const e=D(t);return[e.toLowerCase(),e]}function Xt(t,e){return Jl(t,e).map(n=>fe(n))}var Ms=new Set(["Lower","Lowercase","Upper","Uppercase","Ll","Lowercase_Letter","Lt","Titlecase_Letter","Lu","Uppercase_Letter"]);function ec(t,e){const n={accuracy:"default",asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:"ES2025",...e};Os(t);const r={accuracy:n.accuracy,asciiWordBoundaries:n.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:bn(n.bestEffortTarget,"ES2024"),passedLookbehind:!1,strategy:null,subroutineRefMap:new Map,supportedGNodes:new Set,digitIsAscii:t.flags.digitIsAscii,spaceIsAscii:t.flags.spaceIsAscii,wordIsAscii:t.flags.wordIsAscii};He(t,tc,r);const s={dotAll:t.flags.dotAll,ignoreCase:t.flags.ignoreCase},o={currentFlags:s,prevFlags:null,globalFlags:s,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:r.subroutineRefMap};He(t,nc,o);const i={groupsByName:o.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:o.reffedNodesByReferencer};return He(t,rc,i),t._originMap=o.groupOriginByCopy,t._strategy=r.strategy,t}var tc={AbsenceFunction({node:t,parent:e,replaceWith:n}){const{body:r,kind:s}=t;if(s==="repeater"){const o=ne();o.body[0].body.push(we({negate:!0,body:r}),Ne("Any"));const i=ne();i.body[0].body.push(Es("greedy",0,1/0,o)),n(M(i,e),{traverse:!0})}else throw new Error('Unsupported absence function "(?~|"')},Alternative:{enter({node:t,parent:e,key:n},{flagDirectivesByAlt:r}){const s=t.body.filter(o=>o.kind==="flags");for(let o=n+1;o<e.body.length;o++){const i=e.body[o];Ze(r,i,[]).push(...s)}},exit({node:t},{flagDirectivesByAlt:e}){var n;if((n=e.get(t))!=null&&n.length){const r=Gs(e.get(t));if(r){const s=ne({flags:r});s.body[0].body=t.body,t.body=[M(s,t)]}}}},Assertion({node:t,parent:e,key:n,container:r,root:s,remove:o,replaceWith:i},a){const{kind:l,negate:c}=t,{asciiWordBoundaries:f,avoidSubclass:u,supportedGNodes:h,wordIsAscii:d}=a;if(l==="text_segment_boundary")throw new Error(`Unsupported text segment boundary "\\${c?"Y":"y"}"`);if(l==="line_end")i(M(we({body:[ve({body:[pn("string_end")]}),ve({body:[At(10)]})]}),e));else if(l==="line_start")i(M(ae(A`(?<=\A|\n(?!\z))`,{skipLookbehindValidation:!0}),e));else if(l==="search_start")if(h.has(t))s.flags.sticky=!0,o();else{const p=r[n-1];if(p&&cc(p))i(M(we({negate:!0}),e));else{if(u)throw new Error(A`Uses "\G" in a way that requires a subclass`);i(he(pn("string_start"),e)),a.strategy="clip_search"}}else if(!(l==="string_end"||l==="string_start"))if(l==="string_end_newline")i(M(ae(A`(?=\n?\z)`),e));else if(l==="word_boundary"){if(!d&&!f){const p=`(?:(?<=${ie})(?!${ie})|(?<!${ie})(?=${ie}))`,b=`(?:(?<=${ie})(?=${ie})|(?<!${ie})(?!${ie}))`;i(M(ae(c?b:p),e))}}else throw new Error(`Unexpected assertion kind "${l}"`)},Backreference({node:t},{jsGroupNameMap:e}){let{ref:n}=t;typeof n=="string"&&!Zt(n)&&(n=Kt(n,e),t.ref=n)},CapturingGroup({node:t},{jsGroupNameMap:e,subroutineRefMap:n}){let{name:r}=t;r&&!Zt(r)&&(r=Kt(r,e),t.name=r),n.set(t.number,t),r&&n.set(r,t)},CharacterClassRange({node:t,parent:e,replaceWith:n}){if(e.kind==="intersection"){const r=dt({body:[t]});n(M(r,e),{traverse:!0})}},CharacterSet({node:t,parent:e,replaceWith:n},{accuracy:r,minTargetEs2024:s,digitIsAscii:o,spaceIsAscii:i,wordIsAscii:a}){const{kind:l,negate:c,value:f}=t;if(o&&(l==="digit"||f==="digit")){n(he(mn("digit",{negate:c}),e));return}if(i&&(l==="space"||f==="space")){n(M(Qt(ae(Vl),c),e));return}if(a&&(l==="word"||f==="word")){n(he(mn("word",{negate:c}),e));return}if(l==="any")n(he(Ne("Any"),e));else if(l==="digit")n(he(Ne("Nd",{negate:c}),e));else if(l!=="dot")if(l==="text_segment"){if(r==="strict")throw new Error(A`Use of "\X" requires non-strict accuracy`);const u="\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?",h=A`\p{RI}{2}|${u}(?:\u200D${u})*`;n(M(ae(A`(?>\r\n|${s?A`\p{RGI_Emoji}`:h}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),e))}else if(l==="hex")n(he(Ne("AHex",{negate:c}),e));else if(l==="newline")n(M(ae(c?`[^
|
|
150
|
+
]`:`(?>\r
|
|
151
|
+
?|[
|
|
152
|
+
\v\f
\u2028\u2029])`),e));else if(l==="posix")if(!s&&(f==="graph"||f==="print")){if(r==="strict")throw new Error(`POSIX class "${f}" requires min target ES2024 or non-strict accuracy`);let u={graph:"!-~",print:" -~"}[f];c&&(u=`\0-${D(u.codePointAt(0)-1)}${D(u.codePointAt(2)+1)}-`),n(M(ae(`[${u}]`),e))}else n(M(Qt(ae(Yl.get(f)),c),e));else if(l==="property")Mn.has(Rt(f))||(t.key="sc");else if(l==="space")n(he(Ne("space",{negate:c}),e));else if(l==="word")n(M(Qt(ae(ie),c),e));else throw new Error(`Unexpected character set kind "${l}"`)},Directive({node:t,parent:e,root:n,remove:r,replaceWith:s,removeAllPrevSiblings:o,removeAllNextSiblings:i}){const{kind:a,flags:l}=t;if(a==="flags")if(!l.enable&&!l.disable)r();else{const c=ne({flags:l});c.body[0].body=i(),s(M(c,e),{traverse:!0})}else if(a==="keep"){const c=n.body[0],u=n.body.length===1&&xs(c,{type:"Group"})&&c.body[0].body.length===1?c.body[0]:n;if(e.parent!==u||u.body.length>1)throw new Error(A`Uses "\K" in a way that's unsupported`);const h=we({behind:!0});h.body[0].body=o(),s(M(h,e))}else throw new Error(`Unexpected directive kind "${a}"`)},Flags({node:t,parent:e}){if(t.posixIsAscii)throw new Error('Unsupported flag "P"');if(t.textSegmentMode==="word")throw new Error('Unsupported flag "y{w}"');["digitIsAscii","extended","posixIsAscii","spaceIsAscii","wordIsAscii","textSegmentMode"].forEach(n=>delete t[n]),Object.assign(t,{global:!1,hasIndices:!1,multiline:!1,sticky:t.sticky??!1}),e.options={disable:{x:!0,n:!0},force:{v:!0}}},Group({node:t}){if(!t.flags)return;const{enable:e,disable:n}=t.flags;e!=null&&e.extended&&delete e.extended,n!=null&&n.extended&&delete n.extended,e!=null&&e.dotAll&&(n!=null&&n.dotAll)&&delete e.dotAll,e!=null&&e.ignoreCase&&(n!=null&&n.ignoreCase)&&delete e.ignoreCase,e&&!Object.keys(e).length&&delete t.flags.enable,n&&!Object.keys(n).length&&delete t.flags.disable,!t.flags.enable&&!t.flags.disable&&delete t.flags},LookaroundAssertion({node:t},e){const{kind:n}=t;n==="lookbehind"&&(e.passedLookbehind=!0)},NamedCallout({node:t,parent:e,replaceWith:n}){const{kind:r}=t;if(r==="fail")n(M(we({negate:!0}),e));else throw new Error(`Unsupported named callout "(*${r.toUpperCase()}"`)},Quantifier({node:t}){if(t.body.type==="Quantifier"){const e=ne();e.body[0].body.push(t.body),t.body=M(e,t)}},Regex:{enter({node:t},{supportedGNodes:e}){const n=[];let r=!1,s=!1;for(const o of t.body)if(o.body.length===1&&o.body[0].kind==="search_start")o.body.pop();else{const i=Fs(o.body);i?(r=!0,Array.isArray(i)?n.push(...i):n.push(i)):s=!0}r&&!s&&n.forEach(o=>e.add(o))},exit(t,{accuracy:e,passedLookbehind:n,strategy:r}){if(e==="strict"&&n&&r)throw new Error(A`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:t},{jsGroupNameMap:e}){let{ref:n}=t;typeof n=="string"&&!Zt(n)&&(n=Kt(n,e),t.ref=n)}},nc={Backreference({node:t},{multiplexCapturesToLeftByRef:e,reffedNodesByReferencer:n}){const{orphan:r,ref:s}=t;r||n.set(t,[...e.get(s).map(({node:o})=>o)])},CapturingGroup:{enter({node:t,parent:e,replaceWith:n,skip:r},{groupOriginByCopy:s,groupsByName:o,multiplexCapturesToLeftByRef:i,openRefs:a,reffedNodesByReferencer:l}){const c=s.get(t);if(c&&a.has(t.number)){const u=he(xr(t.number),e);l.set(u,a.get(t.number)),n(u);return}a.set(t.number,t),i.set(t.number,[]),t.name&&Ze(i,t.name,[]);const f=i.get(t.name??t.number);for(let u=0;u<f.length;u++){const h=f[u];if(c===h.node||c&&c===h.origin||t===h.origin){f.splice(u,1);break}}if(i.get(t.number).push({node:t,origin:c}),t.name&&i.get(t.name).push({node:t,origin:c}),t.name){const u=Ze(o,t.name,new Map);let h=!1;if(c)h=!0;else for(const d of u.values())if(!d.hasDuplicateNameToRemove){h=!0;break}o.get(t.name).set(t,{node:t,hasDuplicateNameToRemove:h})}},exit({node:t},{openRefs:e}){e.delete(t.number)}},Group:{enter({node:t},e){e.prevFlags=e.currentFlags,t.flags&&(e.currentFlags=vt(e.currentFlags,t.flags))},exit(t,e){e.currentFlags=e.prevFlags}},Subroutine({node:t,parent:e,replaceWith:n},r){const{isRecursive:s,ref:o}=t;if(s){let f=e;for(;(f=f.parent)&&!(f.type==="CapturingGroup"&&(f.name===o||f.number===o)););r.reffedNodesByReferencer.set(t,f);return}const i=r.subroutineRefMap.get(o),a=o===0,l=a?xr(0):Ds(i,r.groupOriginByCopy,null);let c=l;if(!a){const f=Gs(ic(i,h=>h.type==="Group"&&!!h.flags)),u=f?vt(r.globalFlags,f):r.globalFlags;sc(u,r.currentFlags)||(c=ne({flags:ac(u)}),c.body[0].body.push(l))}n(M(c,e),{traverse:!a})}},rc={Backreference({node:t,parent:e,replaceWith:n},r){if(t.orphan){r.highestOrphanBackref=Math.max(r.highestOrphanBackref,t.ref);return}const o=r.reffedNodesByReferencer.get(t).filter(i=>oc(i,t));if(!o.length)n(M(we({negate:!0}),e));else if(o.length>1){const i=ne({atomic:!0,body:o.reverse().map(a=>ve({body:[gn(a.number)]}))});n(M(i,e))}else t.ref=o[0].number},CapturingGroup({node:t},e){t.number=++e.numCapturesToLeft,t.name&&e.groupsByName.get(t.name).get(t).hasDuplicateNameToRemove&&delete t.name},Regex:{exit({node:t},e){const n=Math.max(e.highestOrphanBackref-e.numCapturesToLeft,0);for(let r=0;r<n;r++){const s=Is();t.body.at(-1).body.push(s)}}},Subroutine({node:t},e){!t.isRecursive||t.ref===0||(t.ref=e.reffedNodesByReferencer.get(t).number)}};function Os(t){He(t,{"*"({node:e,parent:n}){e.parent=n}})}function sc(t,e){return t.dotAll===e.dotAll&&t.ignoreCase===e.ignoreCase}function oc(t,e){let n=e;do{if(n.type==="Regex")return!1;if(n.type==="Alternative")continue;if(n===t)return!1;const r=Bs(n.parent);for(const s of r){if(s===n)break;if(s===t||Us(s,t))return!0}}while(n=n.parent);throw new Error("Unexpected path")}function Ds(t,e,n,r){const s=Array.isArray(t)?[]:{};for(const[o,i]of Object.entries(t))o==="parent"?s.parent=Array.isArray(n)?r:n:i&&typeof i=="object"?s[o]=Ds(i,e,s,n):(o==="type"&&i==="CapturingGroup"&&e.set(s,e.get(t)??t),s[o]=i);return s}function xr(t){const e=As(t);return e.isRecursive=!0,e}function ic(t,e){const n=[];for(;t=t.parent;)(!e||e(t))&&n.push(t);return n}function Kt(t,e){if(e.has(t))return e.get(t);const n=`$${e.size}_${t.replace(/^[^$_\p{IDS}]|[^$\u200C\u200D\p{IDC}]/ug,"_")}`;return e.set(t,n),n}function Gs(t){const e=["dotAll","ignoreCase"],n={enable:{},disable:{}};return t.forEach(({flags:r})=>{e.forEach(s=>{var o,i;(o=r.enable)!=null&&o[s]&&(delete n.disable[s],n.enable[s]=!0),(i=r.disable)!=null&&i[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 ac({dotAll:t,ignoreCase:e}){const n={};return(t||e)&&(n.enable={},t&&(n.enable.dotAll=!0),e&&(n.enable.ignoreCase=!0)),(!t||!e)&&(n.disable={},!t&&(n.disable.dotAll=!0),!e&&(n.disable.ignoreCase=!0)),n}function Bs(t){if(!t)throw new Error("Node expected");const{body:e}=t;return Array.isArray(e)?e:e?[e]:null}function Fs(t){const e=t.find(n=>n.kind==="search_start"||uc(n,{negate:!1})||!lc(n));if(!e)return null;if(e.kind==="search_start")return e;if(e.type==="LookaroundAssertion")return e.body[0].body[0];if(e.type==="CapturingGroup"||e.type==="Group"){const n=[];for(const r of e.body){const s=Fs(r.body);if(!s)return null;Array.isArray(s)?n.push(...s):n.push(s)}return n}return null}function Us(t,e){const n=Bs(t)??[];for(const r of n)if(r===e||Us(r,e))return!0;return!1}function lc({type:t}){return t==="Assertion"||t==="Directive"||t==="LookaroundAssertion"}function cc(t){const e=["Character","CharacterClass","CharacterSet"];return e.includes(t.type)||t.type==="Quantifier"&&t.min&&e.includes(t.body.type)}function uc(t,e){const n={negate:null,...e};return t.type==="LookaroundAssertion"&&(n.negate===null||t.negate===n.negate)&&t.body.length===1&&xs(t.body[0],{type:"Assertion",kind:"search_start"})}function Zt(t){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(t)}function ae(t,e){const r=vs(t,{...e,unicodePropertyMap:Mn}).body;return r.length>1||r[0].body.length>1?ne({body:r}):r[0].body[0]}function Qt(t,e){return t.negate=e,t}function he(t,e){return t.parent=e,t}function M(t,e){return Os(t),t.parent=e,t}function fc(t,e){const n=Ts(e),r=bn(n.target,"ES2024"),s=bn(n.target,"ES2025"),o=n.rules.recursionLimit;if(!Number.isInteger(o)||o<2||o>20)throw new Error("Invalid recursionLimit; use 2-20");let i=null,a=null;if(!s){const d=[t.flags.ignoreCase];He(t,hc,{getCurrentModI:()=>d.at(-1),popModI(){d.pop()},pushModI(p){d.push(p)},setHasCasedChar(){d.at(-1)?i=!0:a=!0}})}const l={dotAll:t.flags.dotAll,ignoreCase:!!((t.flags.ignoreCase||i)&&!a)};let c=t;const f={accuracy:n.accuracy,appliedGlobalFlags:l,captureMap:new Map,currentFlags:{dotAll:t.flags.dotAll,ignoreCase:t.flags.ignoreCase},inCharClass:!1,lastNode:c,originMap:t._originMap,recursionLimit:o,useAppliedIgnoreCase:!!(!s&&i&&a),useFlagMods:s,useFlagV:r,verbose:n.verbose};function u(d){return f.lastNode=c,c=d,Hl(dc[d.type],`Unexpected node type "${d.type}"`)(d,f,u)}const h={pattern:t.body.map(u).join("|"),flags:u(t.flags),options:{...t.options}};return r||(delete h.options.force.v,h.options.disable.v=!0,h.options.unicodeSetsPlugin=null),h._captureTransfers=new Map,h._hiddenCaptures=[],f.captureMap.forEach((d,p)=>{d.hidden&&h._hiddenCaptures.push(p),d.transferTo&&Ze(h._captureTransfers,d.transferTo,[]).push(p)}),h}var hc={"*":{enter({node:t},e){if(Ir(t)){const n=e.getCurrentModI();e.pushModI(t.flags?vt({ignoreCase:n},t.flags).ignoreCase:n)}},exit({node:t},e){Ir(t)&&e.popModI()}},Backreference(t,e){e.setHasCasedChar()},Character({node:t},e){On(D(t.value))&&e.setHasCasedChar()},CharacterClassRange({node:t,skip:e},n){e(),js(t,{firstOnly:!0}).length&&n.setHasCasedChar()},CharacterSet({node:t},e){t.kind==="property"&&Ms.has(t.value)&&e.setHasCasedChar()}},dc={Alternative({body:t},e,n){return t.map(n).join("")},Assertion({kind:t,negate:e}){if(t==="string_end")return"$";if(t==="string_start")return"^";if(t==="word_boundary")return e?A`\B`:A`\b`;throw new Error(`Unexpected assertion kind "${t}"`)},Backreference({ref:t},e){if(typeof t!="number")throw new Error("Unexpected named backref in transformed AST");if(!e.useFlagMods&&e.accuracy==="strict"&&e.currentFlags.ignoreCase&&!e.captureMap.get(t).ignoreCase)throw new Error("Use of case-insensitive backref to case-sensitive group requires target ES2025 or non-strict accuracy");return"\\"+t},CapturingGroup(t,e,n){const{body:r,name:s,number:o}=t,i={ignoreCase:e.currentFlags.ignoreCase},a=e.originMap.get(t);return a&&(i.hidden=!0,o>a.number&&(i.transferTo=a.number)),e.captureMap.set(o,i),`(${s?`?<${s}>`:""}${r.map(n).join("|")})`},Character({value:t},e){const n=D(t),r=Ae(t,{escDigit:e.lastNode.type==="Backreference",inCharClass:e.inCharClass,useFlagV:e.useFlagV});if(r!==n)return r;if(e.useAppliedIgnoreCase&&e.currentFlags.ignoreCase&&On(n)){const s=$s(n);return e.inCharClass?s.join(""):s.length>1?`[${s.join("")}]`:s[0]}return n},CharacterClass(t,e,n){const{kind:r,negate:s,parent:o}=t;let{body:i}=t;if(r==="intersection"&&!e.useFlagV)throw new Error("Use of character class intersection requires min target ES2024");re.bugFlagVLiteralHyphenIsRange&&e.useFlagV&&i.some(Er)&&(i=[At(45),...i.filter(c=>!Er(c))]);const a=()=>`[${s?"^":""}${i.map(n).join(r==="intersection"?"&&":"")}]`;if(!e.inCharClass){if((!e.useFlagV||re.bugNestedClassIgnoresNegation)&&!s){const f=i.filter(u=>u.type==="CharacterClass"&&u.kind==="union"&&u.negate);if(f.length){const u=ne(),h=u.body[0];return u.parent=o,h.parent=u,i=i.filter(d=>!f.includes(d)),t.body=i,i.length?(t.parent=h,h.body.push(t)):u.body.pop(),f.forEach(d=>{const p=ve({body:[d]});d.parent=p,p.parent=u,u.body.push(p)}),n(u)}}e.inCharClass=!0;const c=a();return e.inCharClass=!1,c}const l=i[0];if(r==="union"&&!s&&l&&((!e.useFlagV||!e.verbose)&&o.kind==="union"&&!(re.bugFlagVLiteralHyphenIsRange&&e.useFlagV)||!e.verbose&&o.kind==="intersection"&&i.length===1&&l.type!=="CharacterClassRange"))return i.map(n).join("");if(!e.useFlagV&&o.type==="CharacterClass")throw new Error("Uses nested character class in a way that requires min target ES2024");return a()},CharacterClassRange(t,e){const n=t.min.value,r=t.max.value,s={escDigit:!1,inCharClass:!0,useFlagV:e.useFlagV},o=Ae(n,s),i=Ae(r,s),a=new Set;if(e.useAppliedIgnoreCase&&e.currentFlags.ignoreCase){const l=js(t);bc(l).forEach(f=>{a.add(Array.isArray(f)?`${Ae(f[0],s)}-${Ae(f[1],s)}`:Ae(f,s))})}return`${o}-${i}${[...a].join("")}`},CharacterSet({kind:t,negate:e,value:n,key:r},s){if(t==="dot")return s.currentFlags.dotAll?s.appliedGlobalFlags.dotAll||s.useFlagMods?".":"[^]":A`[^\n]`;if(t==="digit")return e?A`\D`:A`\d`;if(t==="property"){if(s.useAppliedIgnoreCase&&s.currentFlags.ignoreCase&&Ms.has(n))throw new Error(`Unicode property "${n}" can't be case-insensitive when other chars have specific case`);return`${e?A`\P`:A`\p`}{${r?`${r}=`:""}${n}}`}if(t==="word")return e?A`\W`:A`\w`;throw new Error(`Unexpected character set kind "${t}"`)},Flags(t,e){return(e.appliedGlobalFlags.ignoreCase?"i":"")+(t.dotAll?"s":"")+(t.sticky?"y":"")},Group({atomic:t,body:e,flags:n,parent:r},s,o){const i=s.currentFlags;n&&(s.currentFlags=vt(i,n));const a=e.map(o).join("|"),l=!s.verbose&&e.length===1&&r.type!=="Quantifier"&&!t&&(!s.useFlagMods||!n)?a:`(?${wc(t,n,s.useFlagMods)}${a})`;return s.currentFlags=i,l},LookaroundAssertion({body:t,kind:e,negate:n},r,s){return`(?${`${e==="lookahead"?"":"<"}${n?"!":"="}`}${t.map(s).join("|")})`},Quantifier(t,e,n){return n(t.body)+Cc(t)},Subroutine({isRecursive:t,ref:e},n){if(!t)throw new Error("Unexpected non-recursive subroutine in transformed AST");const r=n.recursionLimit;return e===0?`(?R=${r})`:A`\g<${e}&R=${r}>`}},pc=new Set(["$","(",")","*","+",".","?","[","\\","]","^","{","|","}"]),gc=new Set(["-","\\","]","^","["]),mc=new Set(["(",")","-","/","[","\\","]","^","{","|","}","!","#","$","%","&","*","+",",",".",":",";","<","=",">","?","@","`","~"]),vr=new Map([[9,A`\t`],[10,A`\n`],[11,A`\v`],[12,A`\f`],[13,A`\r`],[8232,A`\u2028`],[8233,A`\u2029`],[65279,A`\uFEFF`]]),yc=new RegExp("^\\p{Cased}$","u");function On(t){return yc.test(t)}function js(t,e){const n=!!(e!=null&&e.firstOnly),r=t.min.value,s=t.max.value,o=[];if(r<65&&(s===65535||s>=131071)||r===65536&&s>=131071)return o;for(let i=r;i<=s;i++){const a=D(i);if(!On(a))continue;const l=$s(a).filter(c=>{const f=c.codePointAt(0);return f<r||f>s});if(l.length&&(o.push(...l),n))break}return o}function Ae(t,{escDigit:e,inCharClass:n,useFlagV:r}){if(vr.has(t))return vr.get(t);if(t<32||t>126&&t<160||t>262143||e&&_c(t))return t>255?`\\u{${t.toString(16).toUpperCase()}}`:`\\x${t.toString(16).toUpperCase().padStart(2,"0")}`;const s=n?r?mc:gc:pc,o=D(t);return(s.has(o)?"\\":"")+o}function bc(t){const e=t.map(s=>s.codePointAt(0)).sort((s,o)=>s-o),n=[];let r=null;for(let s=0;s<e.length;s++)e[s+1]===e[s]+1?r??(r=e[s]):r===null?n.push(e[s]):(n.push([r,e[s]]),r=null);return n}function wc(t,e,n){if(t)return">";let r="";if(e&&n){const{enable:s,disable:o}=e;r=(s!=null&&s.ignoreCase?"i":"")+(s!=null&&s.dotAll?"s":"")+(o?"-":"")+(o!=null&&o.ignoreCase?"i":"")+(o!=null&&o.dotAll?"s":"")}return`${r}:`}function Cc({kind:t,max:e,min:n}){let r;return!n&&e===1?r="?":!n&&e===1/0?r="*":n===1&&e===1/0?r="+":n===e?r=`{${n}}`:r=`{${n},${e===1/0?"":e}}`,r+{greedy:"",lazy:"?",possessive:"+"}[t]}function Ir({type:t}){return t==="CapturingGroup"||t==="Group"||t==="LookaroundAssertion"}function _c(t){return t>47&&t<58}function Er({type:t,value:e}){return t==="Character"&&e===45}var de,le,Se,pe,ke,Ye,wn,me,Sc=(me=class extends RegExp{constructor(n,r,s){var e=(...pf)=>(super(...pf),ye(this,Ye),ye(this,de,new Map),ye(this,le,null),ye(this,Se),ye(this,pe,null),ye(this,ke,null),m(this,"rawOptions",{}),this);const o=!!(s!=null&&s.lazyCompile);if(n instanceof RegExp){if(s)throw new Error("Cannot provide options when copying a regexp");const i=n;e(i,r),te(this,Se,i.source),i instanceof me&&(te(this,de,H(i,de)),te(this,pe,H(i,pe)),te(this,ke,H(i,ke)),this.rawOptions=i.rawOptions)}else{const i={hiddenCaptures:[],strategy:null,transfers:[],...s};e(o?"":n,r),te(this,Se,n),te(this,de,xc(i.hiddenCaptures,i.transfers)),te(this,ke,i.strategy),this.rawOptions=s??{}}o||te(this,le,this)}get source(){return H(this,Se)||"(?:)"}exec(n){if(!H(this,le)){const{lazyCompile:o,...i}=this.rawOptions;te(this,le,new me(H(this,Se),this.flags,i))}const r=this.global||this.sticky,s=this.lastIndex;if(H(this,ke)==="clip_search"&&r&&s){this.lastIndex=0;const o=Dt(this,Ye,wn).call(this,n.slice(s));return o&&(kc(o,s,n,this.hasIndices),this.lastIndex+=s),o}return Dt(this,Ye,wn).call(this,n)}},de=new WeakMap,le=new WeakMap,Se=new WeakMap,pe=new WeakMap,ke=new WeakMap,Ye=new WeakSet,wn=function(n){H(this,le).lastIndex=this.lastIndex;const r=Fn(me.prototype,this,"exec").call(H(this,le),n);if(this.lastIndex=H(this,le).lastIndex,!r||!H(this,de).size)return r;const s=[...r];r.length=1;let o;this.hasIndices&&(o=[...r.indices],r.indices.length=1);const i=[0];for(let a=1;a<s.length;a++){const{hidden:l,transferTo:c}=H(this,de).get(a)??{};if(l?i.push(null):(i.push(r.length),r.push(s[a]),this.hasIndices&&r.indices.push(o[a])),c&&s[a]!==void 0){const f=i[c];if(!f)throw new Error(`Invalid capture transfer to "${f}"`);if(r[f]=s[a],this.hasIndices&&(r.indices[f]=o[a]),r.groups){H(this,pe)||te(this,pe,vc(this.source));const u=H(this,pe).get(c);u&&(r.groups[u]=s[a],this.hasIndices&&(r.indices.groups[u]=o[a]))}}}return r},me);function kc(t,e,n,r){if(t.index+=e,t.input=n,r){const s=t.indices;for(let i=0;i<s.length;i++){const a=s[i];a&&(s[i]=[a[0]+e,a[1]+e])}const o=s.groups;o&&Object.keys(o).forEach(i=>{const a=o[i];a&&(o[i]=[a[0]+e,a[1]+e])})}}function xc(t,e){const n=new Map;for(const r of t)n.set(r,{hidden:!0});for(const[r,s]of e)for(const o of s)Ze(n,o,{}).transferTo=r;return n}function vc(t){const e=/(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu,n=new Map;let r=0,s=0,o;for(;o=e.exec(t);){const{0:i,groups:{capture:a,name:l}}=o;i==="["?r++:r?i==="]"&&r--:a&&(s++,l&&n.set(s,l))}return n}function Ic(t,e){const n=Ec(t,e);return n.options?new Sc(n.pattern,n.flags,n.options):new RegExp(n.pattern,n.flags)}function Ec(t,e){const n=Ts(e),r=vs(t,{flags:n.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline},skipBackrefValidation:n.rules.allowOrphanBackrefs,unicodePropertyMap:Mn}),s=ec(r,{accuracy:n.accuracy,asciiWordBoundaries:n.rules.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,bestEffortTarget:n.target}),o=fc(s,n),i=Wl(o.pattern,{captureTransfers:o._captureTransfers,hiddenCaptures:o._hiddenCaptures,mode:"external"}),a=Ul(i.pattern),l=Fl(a.pattern,{captureTransfers:i.captureTransfers,hiddenCaptures:i.hiddenCaptures}),c={pattern:l.pattern,flags:`${n.hasIndices?"d":""}${n.global?"g":""}${o.flags}${o.options.disable.v?"u":"v"}`};if(n.avoidSubclass){if(n.lazyCompileLength!==1/0)throw new Error("Lazy compilation requires subclass")}else{const f=l.hiddenCaptures.sort((p,b)=>p-b),u=Array.from(l.captureTransfers),h=s._strategy,d=c.pattern.length>=n.lazyCompileLength;(f.length||u.length||h||d)&&(c.options={...f.length&&{hiddenCaptures:f},...u.length&&{transfers:u},...h&&{strategy:h},...d&&{lazyCompile:d}})}return c}const Ar=4294967295;class Ac{constructor(e,n={}){m(this,"regexps");this.patterns=e,this.options=n;const{forgiving:r=!1,cache:s,regexConstructor:o}=n;if(!o)throw new Error("Option `regexConstructor` is not provided");this.regexps=e.map(i=>{if(typeof i!="string")return i;const a=s==null?void 0:s.get(i);if(a){if(a instanceof RegExp)return a;if(r)return null;throw a}try{const l=o(i);return s==null||s.set(i,l),l}catch(l){if(s==null||s.set(i,l),r)return null;throw l}})}findNextMatchSync(e,n,r){const s=typeof e=="string"?e:e.content,o=[];function i(a,l,c=0){return{index:a,captureIndices:l.indices.map(f=>f==null?{start:Ar,end:Ar,length:0}:{start:f[0]+c,end:f[1]+c,length:f[1]-f[0]})}}for(let a=0;a<this.regexps.length;a++){const l=this.regexps[a];if(l)try{l.lastIndex=n;const c=l.exec(s);if(!c)continue;if(c.index===n)return i(a,c,0);o.push([a,c,0])}catch(c){if(this.options.forgiving)continue;throw c}}if(o.length){const a=Math.min(...o.map(l=>l[1].index));for(const[l,c,f]of o)if(c.index===a)return i(l,c,f)}return null}}function Rc(t,e){return Ic(t,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...e})}function Lc(t={}){const e=Object.assign({target:"auto",cache:new Map},t);return e.regexConstructor||(e.regexConstructor=n=>Rc(n,{target:e.target})),{createScanner(n){return new Ac(n,e)},createString(n){return{content:n}}}}class Dn extends Error{constructor(e){super(e),this.name="ShikiError"}}function Nc(){return 2147483648}function Pc(){return typeof performance<"u"?performance.now():Date.now()}const Tc=(t,e)=>t+(e-t%e)%e;async function $c(t){let e,n;const r={};function s(d){n=d,r.HEAPU8=new Uint8Array(d),r.HEAPU32=new Uint32Array(d)}function o(d,p,b){r.HEAPU8.copyWithin(d,p,p+b)}function i(d){try{return e.grow(d-n.byteLength+65535>>>16),s(e.buffer),1}catch{}}function a(d){const p=r.HEAPU8.length;d=d>>>0;const b=Nc();if(d>b)return!1;for(let C=1;C<=4;C*=2){let w=p*(1+.2/C);w=Math.min(w,d+100663296);const y=Math.min(b,Tc(Math.max(d,w),65536));if(i(y))return!0}return!1}const l=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function c(d,p,b=1024){const C=p+b;let w=p;for(;d[w]&&!(w>=C);)++w;if(w-p>16&&d.buffer&&l)return l.decode(d.subarray(p,w));let y="";for(;p<w;){let g=d[p++];if(!(g&128)){y+=String.fromCharCode(g);continue}const _=d[p++]&63;if((g&224)===192){y+=String.fromCharCode((g&31)<<6|_);continue}const k=d[p++]&63;if((g&240)===224?g=(g&15)<<12|_<<6|k:g=(g&7)<<18|_<<12|k<<6|d[p++]&63,g<65536)y+=String.fromCharCode(g);else{const I=g-65536;y+=String.fromCharCode(55296|I>>10,56320|I&1023)}}return y}function f(d,p){return d?c(r.HEAPU8,d,p):""}const u={emscripten_get_now:Pc,emscripten_memcpy_big:o,emscripten_resize_heap:a,fd_write:()=>0};async function h(){const p=await t({env:u,wasi_snapshot_preview1:u});e=p.memory,s(e.buffer),Object.assign(r,p),r.UTF8ToString=f}return await h(),r}var Mc=Object.defineProperty,Oc=(t,e,n)=>e in t?Mc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,G=(t,e,n)=>Oc(t,typeof e!="symbol"?e+"":e,n);let F=null;function Dc(t){throw new Dn(t.UTF8ToString(t.getLastOnigError()))}class Pt{constructor(e){G(this,"utf16Length"),G(this,"utf8Length"),G(this,"utf16Value"),G(this,"utf8Value"),G(this,"utf16OffsetToUtf8"),G(this,"utf8OffsetToUtf16");const n=e.length,r=Pt._utf8ByteLength(e),s=r!==n,o=s?new Uint32Array(n+1):null;s&&(o[n]=r);const i=s?new Uint32Array(r+1):null;s&&(i[r]=n);const a=new Uint8Array(r);let l=0;for(let c=0;c<n;c++){const f=e.charCodeAt(c);let u=f,h=!1;if(f>=55296&&f<=56319&&c+1<n){const d=e.charCodeAt(c+1);d>=56320&&d<=57343&&(u=(f-55296<<10)+65536|d-56320,h=!0)}s&&(o[c]=l,h&&(o[c+1]=l),u<=127?i[l+0]=c:u<=2047?(i[l+0]=c,i[l+1]=c):u<=65535?(i[l+0]=c,i[l+1]=c,i[l+2]=c):(i[l+0]=c,i[l+1]=c,i[l+2]=c,i[l+3]=c)),u<=127?a[l++]=u:u<=2047?(a[l++]=192|(u&1984)>>>6,a[l++]=128|(u&63)>>>0):u<=65535?(a[l++]=224|(u&61440)>>>12,a[l++]=128|(u&4032)>>>6,a[l++]=128|(u&63)>>>0):(a[l++]=240|(u&1835008)>>>18,a[l++]=128|(u&258048)>>>12,a[l++]=128|(u&4032)>>>6,a[l++]=128|(u&63)>>>0),h&&c++}this.utf16Length=n,this.utf8Length=r,this.utf16Value=e,this.utf8Value=a,this.utf16OffsetToUtf8=o,this.utf8OffsetToUtf16=i}static _utf8ByteLength(e){let n=0;for(let r=0,s=e.length;r<s;r++){const o=e.charCodeAt(r);let i=o,a=!1;if(o>=55296&&o<=56319&&r+1<s){const l=e.charCodeAt(r+1);l>=56320&&l<=57343&&(i=(o-55296<<10)+65536|l-56320,a=!0)}i<=127?n+=1:i<=2047?n+=2:i<=65535?n+=3:n+=4,a&&r++}return n}createString(e){const n=e.omalloc(this.utf8Length);return e.HEAPU8.set(this.utf8Value,n),n}}const Tt=class oe{constructor(e){if(G(this,"id",++oe.LAST_ID),G(this,"_onigBinding"),G(this,"content"),G(this,"utf16Length"),G(this,"utf8Length"),G(this,"utf16OffsetToUtf8"),G(this,"utf8OffsetToUtf16"),G(this,"ptr"),!F)throw new Dn("Must invoke loadWasm first.");this._onigBinding=F,this.content=e;const n=new Pt(e);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!oe._sharedPtrInUse?(oe._sharedPtr||(oe._sharedPtr=F.omalloc(1e4)),oe._sharedPtrInUse=!0,F.HEAPU8.set(n.utf8Value,oe._sharedPtr),this.ptr=oe._sharedPtr):this.ptr=n.createString(F)}convertUtf8OffsetToUtf16(e){return this.utf8OffsetToUtf16?e<0?0:e>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[e]:e}convertUtf16OffsetToUtf8(e){return this.utf16OffsetToUtf8?e<0?0:e>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[e]:e}dispose(){this.ptr===oe._sharedPtr?oe._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};G(Tt,"LAST_ID",0);G(Tt,"_sharedPtr",0);G(Tt,"_sharedPtrInUse",!1);let Ws=Tt;class Gc{constructor(e){if(G(this,"_onigBinding"),G(this,"_ptr"),!F)throw new Dn("Must invoke loadWasm first.");const n=[],r=[];for(let a=0,l=e.length;a<l;a++){const c=new Pt(e[a]);n[a]=c.createString(F),r[a]=c.utf8Length}const s=F.omalloc(4*e.length);F.HEAPU32.set(n,s/4);const o=F.omalloc(4*e.length);F.HEAPU32.set(r,o/4);const i=F.createOnigScanner(s,o,e.length);for(let a=0,l=e.length;a<l;a++)F.ofree(n[a]);F.ofree(o),F.ofree(s),i===0&&Dc(F),this._onigBinding=F,this._ptr=i}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(e,n,r){let s=0;if(typeof r=="number"&&(s=r),typeof e=="string"){e=new Ws(e);const o=this._findNextMatchSync(e,n,!1,s);return e.dispose(),o}return this._findNextMatchSync(e,n,!1,s)}_findNextMatchSync(e,n,r,s){const o=this._onigBinding,i=o.findNextOnigScannerMatch(this._ptr,e.id,e.ptr,e.utf8Length,e.convertUtf16OffsetToUtf8(n),s);if(i===0)return null;const a=o.HEAPU32;let l=i/4;const c=a[l++],f=a[l++],u=[];for(let h=0;h<f;h++){const d=e.convertUtf8OffsetToUtf16(a[l++]),p=e.convertUtf8OffsetToUtf16(a[l++]);u[h]={start:d,end:p,length:p-d}}return{index:c,captureIndices:u}}}function Bc(t){return typeof t.instantiator=="function"}function Fc(t){return typeof t.default=="function"}function Uc(t){return typeof t.data<"u"}function jc(t){return typeof Response<"u"&&t instanceof Response}function Wc(t){var e;return typeof ArrayBuffer<"u"&&(t instanceof ArrayBuffer||ArrayBuffer.isView(t))||typeof Buffer<"u"&&((e=Buffer.isBuffer)==null?void 0:e.call(Buffer,t))||typeof SharedArrayBuffer<"u"&&t instanceof SharedArrayBuffer||typeof Uint32Array<"u"&&t instanceof Uint32Array}let lt;function zc(t){if(lt)return lt;async function e(){F=await $c(async n=>{let r=t;return r=await r,typeof r=="function"&&(r=await r(n)),typeof r=="function"&&(r=await r(n)),Bc(r)?r=await r.instantiator(n):Fc(r)?r=await r.default(n):(Uc(r)&&(r=r.data),jc(r)?typeof WebAssembly.instantiateStreaming=="function"?r=await Hc(r)(n):r=await qc(r)(n):Wc(r)?r=await Yt(r)(n):r instanceof WebAssembly.Module?r=await Yt(r)(n):"default"in r&&r.default instanceof WebAssembly.Module&&(r=await Yt(r.default)(n))),"instance"in r&&(r=r.instance),"exports"in r&&(r=r.exports),r})}return lt=e(),lt}function Yt(t){return e=>WebAssembly.instantiate(t,e)}function Hc(t){return e=>WebAssembly.instantiateStreaming(t,e)}function qc(t){return async e=>{const n=await t.arrayBuffer();return WebAssembly.instantiate(n,e)}}async function Vc(t){return t&&await zc(t),{createScanner(e){return new Gc(e.map(n=>typeof n=="string"?n:n.source))},createString(e){return new Ws(e)}}}class zs{diff(e,n,r={}){let s;typeof r=="function"?(s=r,r={}):"callback"in r&&(s=r.callback);const o=this.castInput(e,r),i=this.castInput(n,r),a=this.removeEmpty(this.tokenize(o,r)),l=this.removeEmpty(this.tokenize(i,r));return this.diffWithOptionsObj(a,l,r,s)}diffWithOptionsObj(e,n,r,s){var o;const i=y=>{if(y=this.postProcess(y,r),s){setTimeout(function(){s(y)},0);return}else return y},a=n.length,l=e.length;let c=1,f=a+l;r.maxEditLength!=null&&(f=Math.min(f,r.maxEditLength));const u=(o=r.timeout)!==null&&o!==void 0?o:1/0,h=Date.now()+u,d=[{oldPos:-1,lastComponent:void 0}];let p=this.extractCommon(d[0],n,e,0,r);if(d[0].oldPos+1>=l&&p+1>=a)return i(this.buildValues(d[0].lastComponent,n,e));let b=-1/0,C=1/0;const w=()=>{for(let y=Math.max(b,-c);y<=Math.min(C,c);y+=2){let g;const _=d[y-1],k=d[y+1];_&&(d[y-1]=void 0);let I=!1;if(k){const x=k.oldPos-y;I=k&&0<=x&&x<a}const v=_&&_.oldPos+1<l;if(!I&&!v){d[y]=void 0;continue}if(!v||I&&_.oldPos<k.oldPos?g=this.addToPath(k,!0,!1,0,r):g=this.addToPath(_,!1,!0,1,r),p=this.extractCommon(g,n,e,y,r),g.oldPos+1>=l&&p+1>=a)return i(this.buildValues(g.lastComponent,n,e))||!0;d[y]=g,g.oldPos+1>=l&&(C=Math.min(C,y-1)),p+1>=a&&(b=Math.max(b,y+1))}c++};if(s)(function y(){setTimeout(function(){if(c>f||Date.now()>h)return s(void 0);w()||y()},0)})();else for(;c<=f&&Date.now()<=h;){const y=w();if(y)return y}}addToPath(e,n,r,s,o){const i=e.lastComponent;return i&&!o.oneChangePerToken&&i.added===n&&i.removed===r?{oldPos:e.oldPos+s,lastComponent:{count:i.count+1,added:n,removed:r,previousComponent:i.previousComponent}}:{oldPos:e.oldPos+s,lastComponent:{count:1,added:n,removed:r,previousComponent:i}}}extractCommon(e,n,r,s,o){const i=n.length,a=r.length;let l=e.oldPos,c=l-s,f=0;for(;c+1<i&&l+1<a&&this.equals(r[l+1],n[c+1],o);)c++,l++,f++,o.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return f&&!o.oneChangePerToken&&(e.lastComponent={count:f,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=l,c}equals(e,n,r){return r.comparator?r.comparator(e,n):e===n||!!r.ignoreCase&&e.toLowerCase()===n.toLowerCase()}removeEmpty(e){const n=[];for(let r=0;r<e.length;r++)e[r]&&n.push(e[r]);return n}castInput(e,n){return e}tokenize(e,n){return Array.from(e)}join(e){return e.join("")}postProcess(e,n){return e}get useLongestToken(){return!1}buildValues(e,n,r){const s=[];let o;for(;e;)s.push(e),o=e.previousComponent,delete e.previousComponent,e=o;s.reverse();const i=s.length;let a=0,l=0,c=0;for(;a<i;a++){const f=s[a];if(f.removed)f.value=this.join(r.slice(c,c+f.count)),c+=f.count;else{if(!f.added&&this.useLongestToken){let u=n.slice(l,l+f.count);u=u.map(function(h,d){const p=r[c+d];return p.length>h.length?p:h}),f.value=this.join(u)}else f.value=this.join(n.slice(l,l+f.count));l+=f.count,f.added||(c+=f.count)}}return s}}class Xc extends zs{}const Kc=new Xc;function Zc(t,e,n){return Kc.diff(t,e,n)}const Rr="a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}";class Qc extends zs{tokenize(e){const n=new RegExp(`(\\r?\\n)|[${Rr}]+|[^\\S\\n\\r]+|[^${Rr}]`,"ug");return e.match(n)||[]}}const Yc=new Qc;function Jc(t,e,n){return Yc.diff(t,e,n)}function eu(t={}){const{classPrefix:e="__shiki_",classSuffix:n="",classReplacer:r=a=>a}=t,s=new Map;function o(a){return Object.entries(a).map(([l,c])=>`${l}:${c}`).join(";")}function i(a){const l=typeof a=="string"?a:o(a);let c=e+tu(l)+n;return c=r(c),s.has(c)||s.set(c,typeof a=="string"?a:{...a}),c}return{name:"@shikijs/transformers:style-to-class",pre(a){if(!a.properties.style)return;const l=i(a.properties.style);delete a.properties.style,this.addClassToHast(a,l)},tokens(a){for(const l of a)for(const c of l){if(!c.htmlStyle)continue;const f=i(c.htmlStyle);c.htmlStyle={},c.htmlAttrs||(c.htmlAttrs={}),c.htmlAttrs.class?c.htmlAttrs.class+=` ${f}`:c.htmlAttrs.class=f}},getClassRegistry(){return s},getCSS(){let a="";for(const[l,c]of s.entries())a+=`.${l}{${typeof c=="string"?c:o(c)}}`;return a},clearRegistry(){s.clear()}}}function tu(t,e=0){let n=3735928559^e,r=1103547991^e;for(let s=0,o;s<t.length;s++)o=t.charCodeAt(s),n=Math.imul(n^o,2654435761),r=Math.imul(r^o,1597334677);return n=Math.imul(n^n>>>16,2246822507),n^=Math.imul(r^r>>>13,3266489909),r=Math.imul(r^r>>>16,2246822507),r^=Math.imul(n^n>>>13,3266489909),(4294967296*(2097151&r)+(n>>>0)).toString(36).slice(0,6)}const nu=new RegExp("(?<=\\n)"),$t={dark:"pierre-dark",light:"pierre-light"},Hs=1,Lr=new Map,Nr=new Set;function Gn(t,e){t=Array.isArray(t)?t:[t];for(const n of t){if(Nr.has(n.name))continue;let r=Lr.get(n.name);r==null&&(r=n,Lr.set(n.name,r)),Nr.add(r.name),e.loadLanguageSync(r.data)}}const Jt=new Map,Pr=new Set;function qs(t,e){t=Array.isArray(t)?t:[t];for(let n of t){let r;if(typeof n=="string"){if(r=Jt.get(n),r==null)throw new Error(`loadResolvedThemes: ${n} is not resolved, you must resolve it before calling loadResolvedThemes`)}else r=n,n=n.name,Jt.has(n)||Jt.set(n,r);Pr.has(n)||(Pr.add(n),e.loadThemeSync(r))}}function Qe(t){return t.replace(/\n$|\r\n$/,"")}function ru(t){return{type:"text",value:t}}function su({tagName:t,children:e=[],properties:n={}}){return{type:"element",tagName:t,properties:n,children:e}}function ou(t){let e=t.children[0];for(;e!=null;){if(e.type==="element"&&e.tagName==="code")return e;"children"in e?e=e.children[0]:e=null}}function iu(t,e,n){const r=typeof n.lineInfo=="function"?n.lineInfo(e):n.lineInfo[e-1];if(r==null){const s=`processLine: line ${e}, contains no state.lineInfo`;throw console.error(s,{node:t,line:e,state:n}),new Error(s)}return t.tagName="div",t.properties["data-line"]=r.lineNumber,t.properties["data-alt-line"]=r.altLineNumber,t.properties["data-line-type"]=r.type,t.properties["data-line-index"]=r.lineIndex,t.children.length===0&&t.children.push(ru(`
|
|
153
|
+
`)),t}const ct=Symbol("no-token"),en=Symbol("multiple-tokens");function Vs(t){const e=au(t);if(e!=null)return e;let n=ct;const r=[];let s=[],o;const i=()=>{if(s.length===0||o==null){s=[],o=void 0;return}if(s.length===1){const l=s[0];if((l==null?void 0:l.type)==="element"){lu(l,o);for(const c of l.children)pt(c)}else pt(l);r.push(l),s=[],o=void 0;return}for(const l of s)pt(l);r.push(su({tagName:"span",properties:{"data-char":o},children:s})),s=[],o=void 0},a=l=>{if(l!==ct){if(l===en){n=en;return}if(n===ct){n=l;return}n!==l&&(n=en)}};for(const l of t.children){const c=l.type==="element"?Vs(l):ct;if(a(c),typeof c!="number"){i(),r.push(l);continue}o!=null&&o!==c&&i(),o??(o=c),s.push(l)}return i(),t.children=r,n}function au(t){const e=t.properties["data-char"];if(typeof e=="number")return e}function pt(t){if(t.type==="element"){t.properties["data-char"]=void 0;for(const e of t.children)pt(e)}}function lu(t,e){t.properties["data-char"]=e}function Xs(t=!1,e=!1){const n={lineInfo:[]},r=[{line(s){return delete s.properties.class,s},pre(s){const o=ou(s),i=[];if(o!=null){let a=1;for(const l of o.children)l.type==="element"&&(t&&Vs(l),i.push(iu(l,a,n)),a++);o.children=i}return s},...t?{tokens(s){for(const o of s){let i=0;for(const a of o){const l=a;l.__lineChar??(l.__lineChar=i),i+=a.content.length}}},preprocess(s,o){o.mergeWhitespaces="never"},span(s,o,i,a,l){if((l==null?void 0:l.offset)!=null&&l.content!=null){const c=l.__lineChar;return c!=null&&(s.properties["data-char"]=c),s}return s}}:null}];return e&&r.push(cu,Tr),{state:n,transformers:r,toClass:Tr}}const Tr=eu({classPrefix:"hl-"}),cu={name:"token-style-normalizer",tokens(t){for(const e of t)for(const n of e){if(n.htmlStyle!=null)continue;const r={};n.color!=null&&(r.color=n.color),n.bgColor!=null&&(r["background-color"]=n.bgColor),n.fontStyle!=null&&n.fontStyle!==0&&((n.fontStyle&1)!==0&&(r["font-style"]="italic"),(n.fontStyle&2)!==0&&(r["font-weight"]="bold"),(n.fontStyle&4)!==0&&(r["text-decoration"]="underline")),Object.keys(r).length>0&&(n.htmlStyle=r)}}};function K(t){return`--${t==="token"?"diffs-token":"diffs"}-`}const Re=new Map,je={"1c":"1c",abap:"abap",as:"actionscript-3",ada:"ada",adb:"ada",ads:"ada",adoc:"asciidoc",asciidoc:"asciidoc","component.html":"angular-html","component.ts":"angular-ts",conf:"nginx",htaccess:"apache",cls:"tex",trigger:"apex",apl:"apl",applescript:"applescript",scpt:"applescript",ara:"ara",asm:"asm",s:"riscv",astro:"astro",awk:"awk",bal:"ballerina",sh:"zsh",bash:"zsh",bat:"cmd",cmd:"cmd",be:"berry",beancount:"beancount",bib:"bibtex",bicep:"bicep","blade.php":"blade",bsl:"bsl",c:"c",h:"objective-cpp",cs:"csharp",cpp:"cpp",hpp:"cpp",cc:"cpp",cxx:"cpp",hh:"cpp",cdc:"cdc",cairo:"cairo",clar:"clarity",clj:"clojure",cljs:"clojure",cljc:"clojure",soy:"soy",cmake:"cmake","CMakeLists.txt":"cmake",cob:"cobol",cbl:"cobol",cobol:"cobol",CODEOWNERS:"codeowners",ql:"ql",coffee:"coffeescript",lisp:"lisp",cl:"lisp",lsp:"lisp",log:"log",v:"verilog",cql:"cql",cr:"crystal",css:"css",csv:"csv",cue:"cue",cypher:"cypher",cyp:"cypher",d:"d",dart:"dart",dax:"dax",desktop:"desktop",diff:"diff",patch:"diff",Dockerfile:"dockerfile",dockerfile:"dockerfile",env:"dotenv",dm:"dream-maker",edge:"edge",el:"emacs-lisp",ex:"elixir",exs:"elixir",elm:"elm",erb:"erb",erl:"erlang",hrl:"erlang",f:"fortran-fixed-form",for:"fortran-fixed-form",fs:"fsharp",fsi:"fsharp",fsx:"fsharp",f03:"f03",f08:"f08",f18:"f18",f77:"f77",f90:"fortran-free-form",f95:"fortran-free-form",fnl:"fennel",fish:"fish",ftl:"ftl",tres:"gdresource",res:"gdresource",gd:"gdscript",gdshader:"gdshader",gs:"genie",feature:"gherkin",COMMIT_EDITMSG:"git-commit","git-rebase-todo":"git-rebase",gjs:"glimmer-js",gleam:"gleam",gts:"glimmer-ts",glsl:"glsl",vert:"glsl",frag:"glsl",shader:"shaderlab",gp:"gnuplot",plt:"gnuplot",gnuplot:"gnuplot",go:"go",graphql:"graphql",gql:"graphql",groovy:"groovy",gvy:"groovy",hack:"hack",haml:"haml",hbs:"handlebars",handlebars:"handlebars",hs:"haskell",lhs:"haskell",hx:"haxe",hcl:"hcl",hjson:"hjson",hlsl:"hlsl",fx:"hlsl",html:"html",htm:"html",http:"http",rest:"http",hxml:"hxml",hy:"hy",imba:"imba",ini:"ini",cfg:"ini",jade:"pug",pug:"pug",java:"java",js:"javascript",mjs:"javascript",cjs:"javascript",jinja:"jinja",jinja2:"jinja",j2:"jinja",jison:"jison",jl:"julia",json:"json",json5:"json5",jsonc:"jsonc",jsonl:"jsonl",jsonnet:"jsonnet",libsonnet:"jsonnet",jssm:"jssm",jsx:"jsx",kt:"kotlin",kts:"kts",kql:"kusto",tex:"tex",ltx:"tex",lean:"lean4",less:"less",liquid:"liquid",lit:"lit",ll:"llvm",logo:"logo",lua:"lua",luau:"luau",Makefile:"makefile",mk:"makefile",makefile:"makefile",md:"markdown",markdown:"markdown",marko:"marko",m:"wolfram",mat:"matlab",mdc:"mdc",mdx:"mdx",wiki:"wikitext",mediawiki:"wikitext",mmd:"mermaid",mermaid:"mermaid",mips:"mipsasm",mojo:"mojo","🔥":"mojo",move:"move",nar:"narrat",nf:"nextflow",nim:"nim",nims:"nim",nimble:"nim",nix:"nix",nu:"nushell",mm:"objective-cpp",ml:"ocaml",mli:"ocaml",mll:"ocaml",mly:"ocaml",pas:"pascal",p:"pascal",pl:"prolog",pm:"perl",t:"perl",raku:"raku",p6:"raku",pl6:"raku",php:"php",phtml:"php",pls:"plsql",sql:"sql",po:"po",polar:"polar",pcss:"postcss",pot:"pot",potx:"potx",pq:"powerquery",pqm:"powerquery",ps1:"powershell",psm1:"powershell",psd1:"powershell",prisma:"prisma",pro:"prolog",P:"prolog",properties:"properties",proto:"protobuf",pp:"puppet",purs:"purescript",py:"python",pyw:"python",pyi:"python",qml:"qml",qmldir:"qmldir",qss:"qss",r:"r",R:"r",rkt:"racket",rktl:"racket",razor:"razor",cshtml:"razor",rb:"ruby",rbw:"ruby",reg:"reg",regex:"regexp",rel:"rel",rs:"rust",rst:"rst",rake:"ruby",gemspec:"ruby",sas:"sas",sass:"sass",scala:"scala",sc:"scala",scm:"scheme",ss:"scheme",sld:"scheme",scss:"scss",sdbl:"sdbl",shadergraph:"shader",st:"smalltalk",sol:"solidity",sparql:"sparql",rq:"sparql",spl:"splunk",config:"ssh-config",do:"stata",ado:"stata",dta:"stata",styl:"stylus",stylus:"stylus",svelte:"svelte",swift:"swift",sv:"system-verilog",svh:"system-verilog",service:"systemd",socket:"systemd",device:"systemd",timer:"systemd",talon:"talonscript",tasl:"tasl",tcl:"tcl",templ:"templ",tf:"tf",tfvars:"tfvars",toml:"toml",ts:"typescript",tsp:"typespec",tsv:"tsv",tsx:"tsx",ttl:"turtle",twig:"twig",typ:"typst",vv:"v",vala:"vala",vapi:"vala",vb:"vb",vbs:"vb",bas:"vb",vh:"verilog",vhd:"vhdl",vhdl:"vhdl",vim:"vimscript",vue:"vue","vine.ts":"vue-vine",vy:"vyper",wasm:"wasm",wat:"wasm",wy:"文言",wgsl:"wgsl",wit:"wit",wl:"wolfram",nb:"wolfram",xml:"xml",xsl:"xsl",xslt:"xsl",yaml:"yaml",yml:"yml",zs:"zenscript",zig:"zig",zsh:"zsh",sty:"tex"};function Cn(t){var r;if(Re.has(t))return Re.get(t)??"text";if(je[t]!=null)return je[t];const e=t.match(/\.([^/\\]+\.[^/\\]+)$/);if(e!=null){if(Re.has(e[1]))return Re.get(e[1])??"text";if(je[e[1]]!=null)return je[e[1]]??"text"}const n=((r=t.match(/\.([^.]+)$/))==null?void 0:r[1])??"";return Re.has(n)?Re.get(n)??"text":je[n]??"text"}function Ks({theme:t=$t,highlighter:e,prefix:n}){let r="";if(typeof t=="string"){const s=e.getTheme(t);r+=`color:${s.fg};`,r+=`background-color:${s.bg};`,r+=`${K("global")}fg:${s.fg};`,r+=`${K("global")}bg:${s.bg};`,r+=tn(s,n)}else{let s=e.getTheme(t.dark);r+=`${K("global")}dark:${s.fg};`,r+=`${K("global")}dark-bg:${s.bg};`,r+=tn(s,"dark"),s=e.getTheme(t.light),r+=`${K("global")}light:${s.fg};`,r+=`${K("global")}light-bg:${s.bg};`,r+=tn(s,"light")}return r}function tn(t,e){var i,a,l,c,f,u;e=e!=null?`${e}-`:"";let n="";const r=((i=t.colors)==null?void 0:i["gitDecoration.addedResourceForeground"])??((a=t.colors)==null?void 0:a["terminal.ansiGreen"]);r!=null&&(n+=`${K("global")}${e}addition-color:${r};`);const s=((l=t.colors)==null?void 0:l["gitDecoration.deletedResourceForeground"])??((c=t.colors)==null?void 0:c["terminal.ansiRed"]);s!=null&&(n+=`${K("global")}${e}deletion-color:${s};`);const o=((f=t.colors)==null?void 0:f["gitDecoration.modifiedResourceForeground"])??((u=t.colors)==null?void 0:u["terminal.ansiBlue"]);return o!=null&&(n+=`${K("global")}${e}modified-color:${o};`),n}function _n(t){let e=t.children[0];for(;e!=null;){if(e.type==="element"&&e.tagName==="code")return e.children;"children"in e?e=e.children[0]:e=null}throw console.error(t),new Error("getLineNodes: Unable to find children")}function uu({diff:t,diffStyle:e,startingLine:n=0,totalLines:r=1/0,expandedHunks:s,collapsedContextThreshold:o=Hs,callback:i}){const a={finalHunk:t.hunks.at(-1),viewportStart:n,viewportEnd:n+r,isWindowedHighlight:n>0||r<1/0,splitCount:0,unifiedCount:0,shouldBreak(){if(!a.isWindowedHighlight)return!1;const f=a.unifiedCount>=n+r,u=a.splitCount>=n+r;return f&&u},shouldSkip(f,u){if(!a.isWindowedHighlight)return!1;const h=a.unifiedCount+f<n,d=a.splitCount+u<n;return h&&d},incrementCounts(f,u){a.unifiedCount+=f,a.splitCount+=u},isInWindow(f,u){if(!a.isWindowedHighlight)return!0;const h=a.isInUnifiedWindow(f),d=a.isInSplitWindow(u);return h||d},isInUnifiedWindow(f){return!a.isWindowedHighlight||a.unifiedCount>=n-f&&a.unifiedCount<n+r},isInSplitWindow(f){return!a.isWindowedHighlight||a.splitCount>=n-f&&a.splitCount<n+r},emit(f,u=!1){return u||a.incrementCounts(1,1),i(f)??!1}};e:for(const[f,u]of t.hunks.entries()){let b=function(x,E){return d==null||d.collapsedLines<=0||d.fromStart+d.fromEnd>0?0:E===u.splitLineStart+u.splitLineCount-1?d.collapsedLines:0},C=function(){if(h.collapsedLines===0)return 0;const x=h.collapsedLines;return h.collapsedLines=0,x};var l=b,c=C;if(a.shouldBreak())break;const h=$r(t.isPartial,u.collapsedBefore,s,f,o),d=(()=>{if(u!==a.finalHunk||!fu(t))return;const x=t.additionLines.length-(u.additionLineIndex+u.additionCount),E=t.deletionLines.length-(u.deletionLineIndex+u.deletionCount);if(x!==E)throw new Error(`iterateOverDiff: trailing context mismatch (additions=${x}, deletions=${E}) for ${t.name}`);const L=Math.min(x,E);return $r(t.isPartial,L,s,t.hunks.length,o)})(),p=h.fromStart+h.fromEnd;if(a.shouldSkip(p,p))a.incrementCounts(p,p),C();else{let x=u.unifiedLineStart-h.rangeSize,E=u.splitLineStart-h.rangeSize,L=u.deletionLineIndex-h.rangeSize,$=u.additionLineIndex-h.rangeSize,N=u.deletionStart-h.rangeSize,q=u.additionStart-h.rangeSize,P=0;for(;P<h.fromStart;){if(a.isInWindow(0,0)){if(a.emit({hunkIndex:f,hunk:u,collapsedBefore:0,collapsedAfter:0,type:"context-expanded",deletionLine:{lineNumber:N+P,lineIndex:L+P,noEOFCR:!1,unifiedLineIndex:x+P,splitLineIndex:E+P},additionLine:{unifiedLineIndex:x+P,splitLineIndex:E+P,lineIndex:$+P,lineNumber:q+P,noEOFCR:!1}}))break e}else a.incrementCounts(1,1);P++}for(x=u.unifiedLineStart-h.fromEnd,E=u.splitLineStart-h.fromEnd,L=u.deletionLineIndex-h.fromEnd,$=u.additionLineIndex-h.fromEnd,N=u.deletionStart-h.fromEnd,q=u.additionStart-h.fromEnd,P=0;P<h.fromEnd;){if(a.isInWindow(0,0)){if(a.emit({hunkIndex:f,hunk:u,collapsedBefore:C(),collapsedAfter:0,type:"context-expanded",deletionLine:{lineNumber:N+P,lineIndex:L+P,noEOFCR:!1,unifiedLineIndex:x+P,splitLineIndex:E+P},additionLine:{unifiedLineIndex:x+P,splitLineIndex:E+P,lineIndex:$+P,lineNumber:q+P,noEOFCR:!1}}))break e}else a.incrementCounts(1,1);P++}}let w=u.unifiedLineStart,y=u.splitLineStart,g=u.deletionLineIndex,_=u.additionLineIndex,k=u.deletionStart,I=u.additionStart;const v=u.hunkContent.at(-1);for(const x of u.hunkContent){if(a.shouldBreak())break e;const E=x===v;if(x.type==="context"){if(a.shouldSkip(x.lines,x.lines))a.incrementCounts(x.lines,x.lines),C();else{let L=0;for(;L<x.lines;){if(a.isInWindow(0,0)){const $=E&&L===x.lines-1,N=w+L,q=y+L;if(a.emit({hunkIndex:f,hunk:u,collapsedBefore:C(),collapsedAfter:b(N,q),type:"context",deletionLine:{lineNumber:k+L,lineIndex:g+L,noEOFCR:$&&u.noEOFCRDeletions,unifiedLineIndex:N,splitLineIndex:q},additionLine:{unifiedLineIndex:N,splitLineIndex:q,lineIndex:_+L,lineNumber:I+L,noEOFCR:$&&u.noEOFCRAdditions}}))break e}else a.incrementCounts(1,1);L++}}w+=x.lines,y+=x.lines,g+=x.lines,_+=x.lines,k+=x.lines,I+=x.lines}else{const L=Math.max(x.deletions,x.additions),$=x.deletions+x.additions;if(!a.shouldSkip($,L)){const N=hu(a,x);for(const[q,P]of N)for(let Z=q;Z<P;Z++){const Fe=b(w+Z,y+Z);if(a.emit(du({hunkIndex:f,hunk:u,collapsedBefore:C(),collapsedAfter:Fe,diffStyle:e,index:Z,unifiedLineIndex:w,splitLineIndex:y,additionLineIndex:_,deletionLineIndex:g,additionLineNumber:I,deletionLineNumber:k,content:x,isLastContent:E,unifiedCount:$,splitCount:L}),!0))break e}}C(),a.incrementCounts($,L),w+=$,y+=L,g+=x.deletions,_+=x.additions,k+=x.deletions,I+=x.additions}}if(d!=null){const{collapsedLines:x,fromStart:E,fromEnd:L}=d,$=E+L;let N=0;for(;N<$;){if(a.shouldBreak())break e;if(a.isInWindow(0,0)){const q=N===$-1;if(a.emit({hunkIndex:t.hunks.length,hunk:void 0,collapsedBefore:0,collapsedAfter:q?x:0,type:"context-expanded",deletionLine:{lineNumber:k+N,lineIndex:g+N,noEOFCR:!1,unifiedLineIndex:w+N,splitLineIndex:y+N},additionLine:{unifiedLineIndex:w+N,splitLineIndex:y+N,lineIndex:_+N,lineNumber:I+N,noEOFCR:!1}}))break e}else a.incrementCounts(1,1);N++}}}}function $r(t,e,n,r,s){if(e=Math.max(e,0),e===0||t)return{fromStart:0,fromEnd:0,rangeSize:e,collapsedLines:Math.max(e,0)};if(n===!0||e<=s)return{fromStart:e,fromEnd:0,rangeSize:e,collapsedLines:0};const o=n==null?void 0:n.get(r),i=Math.min(Math.max((o==null?void 0:o.fromStart)??0,0),e),a=Math.min(Math.max((o==null?void 0:o.fromEnd)??0,0),e),l=i+a,c=l>=e;return{fromStart:c?e:i,fromEnd:c?0:a,rangeSize:e,collapsedLines:Math.max(e-l,0)}}function fu(t){const e=t.hunks.at(-1);return e==null||t.isPartial||t.additionLines.length===0||t.deletionLines.length===0?!1:e.additionLineIndex+e.additionCount<t.additionLines.length||e.deletionLineIndex+e.deletionCount<t.deletionLines.length}function hu(t,e,n){if(!t.isWindowedHighlight)return[[0,Math.max(e.deletions,e.additions)]];const r=[];function s(l,c){if(l+c<=t.viewportStart||l>=t.viewportEnd)return;const f=Math.max(0,t.viewportStart-l),u=Math.min(c,t.viewportEnd-l);return u>f?[f,u]:void 0}function o(l,c){return l}function i(l,c){if(l==null)return;const[f,u]=o(l);u>f&&r.push([f,u])}if(i(s(t.unifiedCount,e.deletions)),i(s(t.unifiedCount+e.deletions,e.additions)),i(s(t.splitCount,e.deletions)),i(s(t.splitCount,e.additions)),r.length===0)return r;r.sort((l,c)=>l[0]-c[0]);const a=[r[0]];for(const[l,c]of r.slice(1)){const f=a[a.length-1];l<=f[1]?f[1]=Math.max(f[1],c):a.push([l,c])}return a}function du({hunkIndex:t,hunk:e,collapsedAfter:n,collapsedBefore:r,diffStyle:s,index:o,unifiedLineIndex:i,splitLineIndex:a,additionLineIndex:l,deletionLineIndex:c,additionLineNumber:f,deletionLineNumber:u,content:h,isLastContent:d,unifiedCount:p,splitCount:b}){const C=o<h.deletions?i+o:void 0,w=o<h.additions?i+h.deletions+o:void 0,y=a+o,g=o<h.deletions?c+o:void 0,_=o<h.deletions?u+o:void 0,k=o<h.additions?l+o:void 0,I=o<h.additions?f+o:void 0,v=d&&o===b-1&&e.noEOFCRDeletions,x=d&&o===b-1&&e.noEOFCRAdditions,E=g!=null&&_!=null&&C!=null?{lineNumber:_,lineIndex:g,noEOFCR:v,unifiedLineIndex:C,splitLineIndex:y}:void 0,L=k!=null&&I!=null&&w!=null?{unifiedLineIndex:w,splitLineIndex:y,lineIndex:k,lineNumber:I,noEOFCR:x}:void 0;if(E==null&&L!=null)return{type:"change",hunkIndex:t,hunk:e,collapsedAfter:n,collapsedBefore:r,deletionLine:void 0,additionLine:L};if(E!=null&&L==null)return{type:"change",hunkIndex:t,hunk:e,collapsedAfter:n,collapsedBefore:r,deletionLine:E,additionLine:void 0};if(E==null||L==null)throw new Error("iterateOverDiff: missing change line data");return{type:"change",hunkIndex:t,hunk:e,collapsedAfter:n,collapsedBefore:r,deletionLine:E,additionLine:L}}function Mr({line:t,spanStart:e,spanLength:n}){return{start:{line:t,character:e},end:{line:t,character:e+n},properties:{"data-diff-span":""},alwaysWrap:!0}}function ut({item:t,arr:e,enableJoin:n,isNeutral:r=!1,isLastItem:s=!1}){const o=e[e.length-1];if(o==null||s||!n){e.push([r?0:1,t.value]);return}const i=o[0]===0;if(r===i||r&&t.value.length===1&&!i){o[1]+=t.value;return}e.push([r?0:1,t.value])}const pu={forcePlainText:!1};function gu(t,e,n,{forcePlainText:r,startingLine:s,totalLines:o,expandedHunks:i,collapsedContextThreshold:a=Hs}=pu){r?(s??(s=0),o??(o=1/0)):(s=0,o=1/0);const l=s>0||o<1/0,c=typeof n.theme=="string"?e.getTheme(n.theme).type:void 0,f=Ks({theme:n.theme,highlighter:e}),u=r&&!l&&(t.unifiedLineCount>1e3||t.splitLineCount>1e3)?"none":n.lineDiffType,h={deletionLines:[],additionLines:[]},{maxLineDiffLength:d}=n,p=!r&&!t.isPartial,b=r?i:void 0,C=new Map;function w(g){const _=p?0:g,k=C.get(_)??yu();return C.set(_,k),k}function y(g,_,k,I){if(l){let v=k.at(-1);(v==null||v.targetIndex+v.count!==_)&&(v={targetIndex:_,originalOffset:I.length,count:0},k.push(v)),v.count++}I.push(g)}uu({diff:t,diffStyle:"both",startingLine:s,totalLines:o,expandedHunks:l?b:!0,collapsedContextThreshold:a,callback:({hunkIndex:g,additionLine:_,deletionLine:k,type:I})=>{const v=w(g),x=_!=null?_.splitLineIndex:k.splitLineIndex;I==="change"&&_!=null&&k!=null&&mu({additionLine:t.additionLines[_.lineIndex],deletionLine:t.deletionLines[k.lineIndex],deletionLineIndex:v.deletionContent.length,additionLineIndex:v.additionContent.length,deletionDecorations:v.deletionDecorations,additionDecorations:v.additionDecorations,lineDiffType:u,maxLineDiffLength:d}),k!=null&&(y(t.deletionLines[k.lineIndex],k.lineIndex,v.deletionSegments,v.deletionContent),v.deletionInfo.push({type:I==="change"?"change-deletion":I,lineNumber:k.lineNumber,altLineNumber:I==="change"?void 0:_.lineNumber??void 0,lineIndex:`${k.unifiedLineIndex},${x}`})),_!=null&&(y(t.additionLines[_.lineIndex],_.lineIndex,v.additionSegments,v.additionContent),v.additionInfo.push({type:I==="change"?"change-addition":I,lineNumber:_.lineNumber,altLineNumber:I==="change"?void 0:k.lineNumber??void 0,lineIndex:`${_.unifiedLineIndex},${x}`}))}});for(const g of C.values()){if(g.deletionContent.length===0&&g.additionContent.length===0)continue;const _={name:t.prevName??t.name,contents:g.deletionContent.value},k={name:t.name,contents:g.additionContent.value},{deletionLines:I,additionLines:v}=bu({deletionFile:_,deletionInfo:g.deletionInfo,deletionDecorations:g.deletionDecorations,additionFile:k,additionInfo:g.additionInfo,additionDecorations:g.additionDecorations,highlighter:e,options:n,languageOverride:r?"text":t.lang});if(p){h.deletionLines=I,h.additionLines=v;continue}if(g.deletionSegments.length>0)for(const x of g.deletionSegments)for(let E=0;E<x.count;E++)h.deletionLines[x.targetIndex+E]=I[x.originalOffset+E];else h.deletionLines.push(...I);if(g.additionSegments.length>0)for(const x of g.additionSegments)for(let E=0;E<x.count;E++)h.additionLines[x.targetIndex+E]=v[x.originalOffset+E];else h.additionLines.push(...v)}return{code:h,themeStyles:f,baseThemeType:c}}function mu({deletionLine:t,additionLine:e,deletionLineIndex:n,additionLineIndex:r,deletionDecorations:s,additionDecorations:o,lineDiffType:i,maxLineDiffLength:a}){if(t==null||e==null||i==="none"||(t=Qe(t),e=Qe(e),t.length>a||e.length>a))return;const l=i==="char"?Zc(t,e):Jc(t,e),c=[],f=[],u=i==="word-alt",h=l.at(-1);for(const p of l){const b=p===h;!p.added&&!p.removed?(ut({item:p,arr:c,enableJoin:u,isNeutral:!0,isLastItem:b}),ut({item:p,arr:f,enableJoin:u,isNeutral:!0,isLastItem:b})):p.removed?ut({item:p,arr:c,enableJoin:u,isLastItem:b}):ut({item:p,arr:f,enableJoin:u,isLastItem:b})}let d=0;for(const p of c)p[0]===1&&s.push(Mr({line:n,spanStart:d,spanLength:p[1].length})),d+=p[1].length;d=0;for(const p of f)p[0]===1&&o.push(Mr({line:r,spanStart:d,spanLength:p[1].length})),d+=p[1].length}function yu(){return{deletionContent:{push(t){this.value+=t,this.length++},value:"",length:0},additionContent:{push(t){this.value+=t,this.length++},value:"",length:0},deletionInfo:[],additionInfo:[],deletionDecorations:[],additionDecorations:[],deletionSegments:[],additionSegments:[]}}function bu({deletionFile:t,additionFile:e,deletionInfo:n,additionInfo:r,highlighter:s,deletionDecorations:o,additionDecorations:i,languageOverride:a,options:{theme:l=$t,...c}}){const f=a??Cn(t.name),u=a??Cn(e.name),{state:h,transformers:d}=Xs(c.useTokenTransformer),p=typeof l=="string"?{...c,lang:"text",theme:l,transformers:d,decorations:void 0,defaultColor:!1,cssVariablePrefix:K("token")}:{...c,lang:"text",themes:l,transformers:d,decorations:void 0,defaultColor:!1,cssVariablePrefix:K("token")};return{deletionLines:t.contents===""?[]:(p.lang=f,h.lineInfo=n,p.decorations=o,_n(s.codeToHast(Qe(t.contents),p))),additionLines:e.contents===""?[]:(p.lang=u,p.decorations=i,h.lineInfo=r,_n(s.codeToHast(Qe(e.contents),p)))}}function wu({lines:t,startingLine:e=0,totalLines:n=1/0,callback:r}){const s=Math.min(e+n,t.length),o=(()=>{const i=t.at(-1);return i===""||i===`
|
|
154
|
+
`||i===`\r
|
|
155
|
+
`||i==="\r"?Math.max(0,t.length-2):t.length-1})();for(let i=e;i<s;i++){const a=i===o;if(r({lineIndex:i,lineNumber:i+1,content:t[i],isLastLine:a})===!0||a)break}}function Cu(t){return t!==""?t.split(nu):[]}const _u={forcePlainText:!1};function Su(t,e,{theme:n=$t,tokenizeMaxLineLength:r,useTokenTransformer:s},{forcePlainText:o,startingLine:i,totalLines:a,lines:l}=_u){o?(i??(i=0),a??(a=1/0)):(i=0,a=1/0);const c=i>0||a<1/0,{state:f,transformers:u}=Xs(s),h=o?"text":t.lang??Cn(t.name),d=typeof n=="string"?e.getTheme(n).type:void 0,p=Ks({theme:n,highlighter:e});f.lineInfo=y=>({type:"context",lineIndex:y-1+i,lineNumber:y+i});const b=typeof n=="string"?{lang:h,theme:n,transformers:u,defaultColor:!1,cssVariablePrefix:K("token"),tokenizeMaxLineLength:r}:{lang:h,themes:n,transformers:u,defaultColor:!1,cssVariablePrefix:K("token"),tokenizeMaxLineLength:r},C=_n(e.codeToHast(c?ku(l??Cu(t.contents),i,a):Qe(t.contents),b)),w=c?new Array(i):C;return c&&w.push(...C),{code:w,themeStyles:p,baseThemeType:d}}function ku(t,e,n){let r="";return wu({lines:t,startingLine:e,totalLines:n,callback({content:s}){r+=s}}),r}let Or,xe={theme:$t,useTokenTransformer:!1,tokenizeMaxLineLength:1e3,lineDiffType:"word-alt",maxLineDiffLength:1e3};self.addEventListener("error",t=>{console.error("[Shiki Worker] Unhandled error:",t.error)});self.addEventListener("message",t=>{xu(t.data)});async function xu(t){try{switch(t.type){case"initialize":await vu(t);break;case"set-render-options":await Iu(t);break;case"file":await Eu(t);break;case"diff":await Au(t);break;default:throw new Error(`Unknown request type: ${t.type}`)}}catch(e){console.error("Worker error:",e),Nu(t.id,e)}}async function vu({id:t,renderOptions:e,preferredHighlighter:n,resolvedThemes:r,resolvedLanguages:s}){let o=Mt(n);"then"in o&&(o=await o),qs(r,o),s!=null&&Gn(s,o),xe=e,postMessage({type:"success",id:t,requestType:"initialize",sentAt:Date.now()})}async function Iu({id:t,renderOptions:e,resolvedThemes:n}){let r=Mt();"then"in r&&(r=await r),qs(n,r),xe=e,postMessage({type:"success",id:t,requestType:"set-render-options",sentAt:Date.now()})}async function Eu({id:t,file:e,resolvedLanguages:n}){let r=Mt();"then"in r&&(r=await r),n!=null&&Gn(n,r);const s={theme:xe.theme,useTokenTransformer:xe.useTokenTransformer,tokenizeMaxLineLength:xe.tokenizeMaxLineLength};Ru(t,Su(e,r,s),s)}async function Au({id:t,diff:e,resolvedLanguages:n}){let r=Mt();"then"in r&&(r=await r),n!=null&&Gn(n,r),Lu(t,gu(e,r,xe),xe)}function Mt(t="shiki-js"){return Or??(Or=za({themes:[],langs:[],engine:t==="shiki-wasm"?Vc(import("./wasm-CG6Dc4jp.js")):Lc()})),Or}function Ru(t,e,n){postMessage({type:"success",requestType:"file",id:t,result:e,options:n,sentAt:Date.now()})}function Lu(t,e,n){postMessage({type:"success",requestType:"diff",id:t,result:e,options:n,sentAt:Date.now()})}function Nu(t,e){const n={type:"error",id:t,error:e instanceof Error?e.message:String(e),stack:e instanceof Error?e.stack:void 0};postMessage(n)}
|