@chunklib/agentic 1.1.0 → 1.1.1

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.
Files changed (128) hide show
  1. package/README.md +16 -32
  2. package/bin/agentic.js +66 -64
  3. package/bin/cli/tui/worker.js +7 -3
  4. package/bin/web/assets/{LROKH5N7-Cgdi6ogL.js → LROKH5N7-CufzWEns.js} +2 -2
  5. package/bin/web/assets/ar-BwLzFtrk.js +8 -0
  6. package/bin/web/assets/ar-C3abecgF.js +2 -0
  7. package/bin/web/assets/az-CE5LLqzy.js +8 -0
  8. package/bin/web/assets/az-CTrkzoUY.js +2 -0
  9. package/bin/web/assets/br-C6eWgdLc.js +8 -0
  10. package/bin/web/assets/br-DPsjeLV1.js +2 -0
  11. package/bin/web/assets/bs-Bs-WieSp.js +2 -0
  12. package/bin/web/assets/bs-DXhZIkW2.js +8 -0
  13. package/bin/web/assets/da-CnHHIur0.js +8 -0
  14. package/bin/web/assets/da-DzYOPLp5.js +2 -0
  15. package/bin/web/assets/de-BJacEZDA.js +8 -0
  16. package/bin/web/assets/de-CAZZkD7r.js +2 -0
  17. package/bin/web/assets/{dialog-command-palette-v2-B41e0R0T.js → dialog-command-palette-v2-BdsfOt98.js} +2 -2
  18. package/bin/web/assets/dialog-connect-provider-cMnfONyq.js +2 -0
  19. package/bin/web/assets/{dialog-edit-project-ENsoKieS.js → dialog-edit-project-BTKo4L8c.js} +2 -2
  20. package/bin/web/assets/{dialog-edit-project-v2-TbsDREdW.js → dialog-edit-project-v2-BgxhNrB_.js} +2 -2
  21. package/bin/web/assets/{dialog-fork-CvXAqG0y.js → dialog-fork-DM2MD9h9.js} +2 -2
  22. package/bin/web/assets/{dialog-manage-models-Ca3CtDo1.js → dialog-manage-models-CZ-wSXas.js} +2 -2
  23. package/bin/web/assets/{dialog-select-directory-v2-DgRK6caR.js → dialog-select-directory-v2-BjsOiAsW.js} +2 -2
  24. package/bin/web/assets/{dialog-select-file-W4qjeG1v.js → dialog-select-file-DQfBi0lB.js} +3 -3
  25. package/bin/web/assets/{dialog-select-mcp-MpnNunKg.js → dialog-select-mcp-BAPSNwQR.js} +2 -2
  26. package/bin/web/assets/{dialog-settings-BWcr4izq.js → dialog-settings-DTc_Rfqx.js} +3 -3
  27. package/bin/web/assets/{edit-project-Br24T75k.js → edit-project-CuOMp3mF.js} +2 -2
  28. package/bin/web/assets/es-Bus963Aj.js +2 -0
  29. package/bin/web/assets/es-CoFvHMiq.js +8 -0
  30. package/bin/web/assets/fi-BxFpA3sy.js +2 -0
  31. package/bin/web/assets/fi-DNRVJEPq.js +8 -0
  32. package/bin/web/assets/fr-BSxYcqpM.js +2 -0
  33. package/bin/web/assets/fr-BUGMj6SW.js +8 -0
  34. package/bin/web/assets/{ghostty-web-D7Ty6Ejz.js → ghostty-web-BqSBMlIl.js} +2 -2
  35. package/bin/web/assets/hi-38BcxEkk.js +2 -0
  36. package/bin/web/assets/hi-CKPvfKWe.js +8 -0
  37. package/bin/web/assets/id-CIrwWmtd.js +8 -0
  38. package/bin/web/assets/id-CQavIbiH.js +2 -0
  39. package/bin/web/assets/index-B5UCYzgt.js +3 -0
  40. package/bin/web/assets/index-BH1J9J8E.js +1524 -0
  41. package/bin/web/assets/index-DoggtF0n.css +1 -0
  42. package/bin/web/assets/index-GGAIvKVQ.css +1 -0
  43. package/bin/web/assets/it-17NlHkKQ.js +8 -0
  44. package/bin/web/assets/it-BB46hSUz.js +2 -0
  45. package/bin/web/assets/ja-Cg62k4Hq.js +2 -0
  46. package/bin/web/assets/ja-DTzmMP0I.js +8 -0
  47. package/bin/web/assets/ko-BWAIIDYz.js +8 -0
  48. package/bin/web/assets/ko-k06DU9Nv.js +2 -0
  49. package/bin/web/assets/{list-Bgkj60uj.js → list-BK0ZBxm_.js} +2 -2
  50. package/bin/web/assets/markdown.worker-Bu_Dc9RP.js +503 -0
  51. package/bin/web/assets/mcp-CnUj_8Pe.js +2 -0
  52. package/bin/web/assets/{new-session-HkDD85pv.js → new-session-CexkpdBg.js} +3 -3
  53. package/bin/web/assets/nl-BWmwmMiu.js +2 -0
  54. package/bin/web/assets/nl-Cvn5nbPq.js +8 -0
  55. package/bin/web/assets/no-BxXcGy-n.js +8 -0
  56. package/bin/web/assets/no-DsRI2Z0y.js +2 -0
  57. package/bin/web/assets/pa-D7MCm8Kt.js +8 -0
  58. package/bin/web/assets/pa-W0ArODx2.js +2 -0
  59. package/bin/web/assets/pl-Bet_AQ8e.js +2 -0
  60. package/bin/web/assets/pl-WzVN3ybR.js +8 -0
  61. package/bin/web/assets/{row-DVVVLbFk.css → row-BjpwzvFU.css} +1 -1
  62. package/bin/web/assets/{row-cHDMR1XO.js → row-DgKhGiK9.js} +2 -2
  63. package/bin/web/assets/ru-CwmMfH4n.js +2 -0
  64. package/bin/web/assets/ru-DPS1hMlO.js +8 -0
  65. package/bin/web/assets/{settings-keybinds-DFbfIb2V.js → settings-keybinds-C8R--jLJ.js} +3 -3
  66. package/bin/web/assets/{sprite-Chb7ocDN.svg → sprite-B9ixRF_T.svg} +2 -27
  67. package/bin/web/assets/{status-popover-body-DNA3h-5H.js → status-popover-body-Jl0oR5U2.js} +3 -3
  68. package/bin/web/assets/sv-CNxtFx1x.js +2 -0
  69. package/bin/web/assets/sv-YsyKpECF.js +8 -0
  70. package/bin/web/assets/{switch-D8_cvKev.js → switch-BnUb38m8.js} +2 -2
  71. package/bin/web/assets/th-BM9lxrwF.js +8 -0
  72. package/bin/web/assets/th-VvW38onH.js +2 -0
  73. package/bin/web/assets/tr-BV9Bmn8X.js +2 -0
  74. package/bin/web/assets/tr-DBhHCAc2.js +8 -0
  75. package/bin/web/assets/uk-Bl62aPxY.js +8 -0
  76. package/bin/web/assets/uk-gpwOqShu.js +2 -0
  77. package/bin/web/assets/ur-BbDVKvlg.js +2 -0
  78. package/bin/web/assets/ur-nGv5wQGp.js +8 -0
  79. package/bin/web/assets/vi-DUs03mzm.js +8 -0
  80. package/bin/web/assets/vi-ac_kFMcG.js +2 -0
  81. package/bin/web/assets/zh-BDTj0-qK.js +8 -0
  82. package/bin/web/assets/zh-Db1rGmjT.js +2 -0
  83. package/bin/web/assets/zht-CTieoXNG.js +2 -0
  84. package/bin/web/assets/zht-CU7BHTWv.js +8 -0
  85. package/bin/web/index.html +2 -2
  86. package/docs/configuration.md +16 -32
  87. package/package.json +1 -1
  88. package/bin/web/assets/ar-C4xsRFR0.js +0 -2
  89. package/bin/web/assets/ar-D7_40HDV.js +0 -4
  90. package/bin/web/assets/br-CwfNwpqU.js +0 -4
  91. package/bin/web/assets/br-XyupthPW.js +0 -2
  92. package/bin/web/assets/bs-BW2PeAiy.js +0 -2
  93. package/bin/web/assets/bs-C9w8bnld.js +0 -4
  94. package/bin/web/assets/da-CgNNle9H.js +0 -2
  95. package/bin/web/assets/da-_o-yW1c-.js +0 -4
  96. package/bin/web/assets/de-CELw_bn8.js +0 -2
  97. package/bin/web/assets/de-u4ZRSSGs.js +0 -4
  98. package/bin/web/assets/dialog-connect-provider-B-kgBHKk.js +0 -2
  99. package/bin/web/assets/es-DCGlYCXN.js +0 -2
  100. package/bin/web/assets/es-pMkLqpGW.js +0 -4
  101. package/bin/web/assets/fr-Du5j-zoY.js +0 -2
  102. package/bin/web/assets/fr-Rs650oVj.js +0 -4
  103. package/bin/web/assets/index-B2L_xsSX.js +0 -1831
  104. package/bin/web/assets/index-CFMuAFJa.css +0 -1
  105. package/bin/web/assets/index-CZitxknW.css +0 -1
  106. package/bin/web/assets/index-D9JOa7-H.js +0 -3
  107. package/bin/web/assets/ja-iJh2cVB-.js +0 -2
  108. package/bin/web/assets/ja-mSoA7GSH.js +0 -4
  109. package/bin/web/assets/ko-C92hX257.js +0 -2
  110. package/bin/web/assets/ko-CtAd082Z.js +0 -4
  111. package/bin/web/assets/markdown-shiki.worker-sTYREXj-.js +0 -156
  112. package/bin/web/assets/mcp-C5TFvBHS.js +0 -2
  113. package/bin/web/assets/no-CQNbtNrq.js +0 -4
  114. package/bin/web/assets/no-CsX2bvW2.js +0 -2
  115. package/bin/web/assets/pl-BH_iOtUo.js +0 -4
  116. package/bin/web/assets/pl-U1SU7oID.js +0 -2
  117. package/bin/web/assets/ru-CkmmQ1_k.js +0 -2
  118. package/bin/web/assets/ru-Dj20Kckp.js +0 -4
  119. package/bin/web/assets/th-BWKOZ0j_.js +0 -2
  120. package/bin/web/assets/th-D0m3tYTd.js +0 -4
  121. package/bin/web/assets/tr-DFDOk0cA.js +0 -4
  122. package/bin/web/assets/tr-Ds4_hniB.js +0 -2
  123. package/bin/web/assets/uk-PaABnp9Y.js +0 -4
  124. package/bin/web/assets/uk-fqr0bcE9.js +0 -2
  125. package/bin/web/assets/zh-B268Sls8.js +0 -2
  126. package/bin/web/assets/zh-BSCC1HAl.js +0 -4
  127. package/bin/web/assets/zht-Br909_dL.js +0 -2
  128. package/bin/web/assets/zht-DKWnEJJ6.js +0 -4
@@ -1,156 +0,0 @@
1
- class st{options;tokensStable=[];tokensUnstable=[];lastUnstableCodeChunk="";lastStableGrammarState;constructor(t){this.options=t}async enqueue(t){const n=(this.lastUnstableCodeChunk+t).split(`
2
- `),r=[];let i=[];const s=this.tokensUnstable.length;return n.forEach((o,a)=>{const l=a===n.length-1,c=this.options.highlighter.codeToTokens(o,{...this.options,grammarState:this.lastStableGrammarState}),p=c.tokens[0];l||p.push({content:`
3
- `,offset:0}),l?(i=p,this.lastUnstableCodeChunk=o):(this.lastStableGrammarState=c.grammarState,r.push(...p))}),this.tokensStable.push(...r),this.tokensUnstable=i,{recall:s,stable:r,unstable:i}}close(){const t=this.tokensUnstable;return this.tokensUnstable=[],this.lastUnstableCodeChunk="",this.lastStableGrammarState=void 0,{stable:t}}clear(){this.tokensStable=[],this.tokensUnstable=[],this.lastUnstableCodeChunk="",this.lastStableGrammarState=void 0}clone(){const t=new st(this.options);return t.lastUnstableCodeChunk=this.lastUnstableCodeChunk,t.tokensUnstable=this.tokensUnstable,t.tokensStable=this.tokensStable,t.lastStableGrammarState=this.lastStableGrammarState,t}}class Xc extends TransformStream{tokenizer;options;constructor(t){const n=new st(t),{allowRecalls:r=!1}=t;super({async transform(i,s){const{stable:o,unstable:a,recall:l}=await n.enqueue(i);r&&l>0&&s.enqueue({recall:l});for(const c of o)s.enqueue(c);if(r)for(const c of a)s.enqueue(c)},async flush(i){const{stable:s}=n.close();if(!r)for(const o of s)i.enqueue(o)}}),this.tokenizer=n,this.options=t}}var Gt=Object.defineProperty,Gi=Object.getOwnPropertyDescriptor,Bi=Object.getOwnPropertyNames,Di=Object.prototype.hasOwnProperty,nn=(e,t)=>{let n={};for(var r in e)Gt(n,r,{get:e[r],enumerable:!0});return Gt(n,Symbol.toStringTag,{value:"Module"}),n},Ui=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(var i=Bi(t),s=0,o=i.length,a;s<o;s++)a=i[s],!Di.call(e,a)&&a!==n&&Gt(e,a,{get:(l=>t[l]).bind(null,a),enumerable:!(r=Gi(t,a))||r.enumerable});return e},dr=(e,t,n)=>(Ui(e,t,"default"),n);const ot=[{id:"abap",name:"ABAP",import:(()=>import("./abap-Dg923wIy.js"))},{id:"actionscript-3",name:"ActionScript",import:(()=>import("./actionscript-3-8WTK4YD2.js"))},{id:"ada",name:"Ada",import:(()=>import("./ada-CTi7YQtL.js"))},{id:"angular-html",name:"Angular HTML",import:(()=>import("./angular-html-BOXu3q2S.js").then(function(e){return e.a}))},{id:"angular-ts",name:"Angular TypeScript",import:(()=>import("./angular-ts-Ch9MZP00.js"))},{id:"apache",name:"Apache Conf",import:(()=>import("./apache-PcO-DBxQ.js"))},{id:"apex",name:"Apex",import:(()=>import("./apex-4lMl2vhg.js"))},{id:"apl",name:"APL",import:(()=>import("./apl-Dz5ncP8G.js"))},{id:"applescript",name:"AppleScript",import:(()=>import("./applescript-Ds_W2jPS.js"))},{id:"ara",name:"Ara",import:(()=>import("./ara-C1--7J61.js"))},{id:"asciidoc",name:"AsciiDoc",aliases:["adoc"],import:(()=>import("./asciidoc-nTfEFGxb.js"))},{id:"asm",name:"Assembly",import:(()=>import("./asm-CTFRnVOM.js"))},{id:"astro",name:"Astro",import:(()=>import("./astro-BWgTGUF8.js"))},{id:"awk",name:"AWK",import:(()=>import("./awk-CrWgQKhV.js"))},{id:"ballerina",name:"Ballerina",import:(()=>import("./ballerina-a0yOSyc5.js"))},{id:"bat",name:"Batch File",aliases:["batch"],import:(()=>import("./bat-B0cHNp6s.js"))},{id:"beancount",name:"Beancount",import:(()=>import("./beancount-dPJi_gci.js"))},{id:"berry",name:"Berry",aliases:["be"],import:(()=>import("./berry-CVKoklHx.js"))},{id:"bibtex",name:"BibTeX",import:(()=>import("./bibtex-DRcCXNgM.js"))},{id:"bicep",name:"Bicep",import:(()=>import("./bicep-jWz-hQ8I.js"))},{id:"bird2",name:"BIRD2 Configuration",aliases:["bird"],import:(()=>import("./bird2-OwWL2xOz.js"))},{id:"blade",name:"Blade",import:(()=>import("./blade-DFktsHST.js"))},{id:"bsl",name:"1C (Enterprise)",aliases:["1c"],import:(()=>import("./bsl-jNujDQK2.js"))},{id:"c",name:"C",import:(()=>import("./c-BG-tZi7o.js"))},{id:"c3",name:"C3",import:(()=>import("./c3-crbJOFTy.js"))},{id:"cadence",name:"Cadence",aliases:["cdc"],import:(()=>import("./cadence-BuaeHeSu.js"))},{id:"cairo",name:"Cairo",import:(()=>import("./cairo-BYiDgOF2.js"))},{id:"clarity",name:"Clarity",import:(()=>import("./clarity-CC_0IFDj.js"))},{id:"clojure",name:"Clojure",aliases:["clj"],import:(()=>import("./clojure-KnfDkB_V.js"))},{id:"cmake",name:"CMake",import:(()=>import("./cmake-bh2MLnkv.js"))},{id:"cobol",name:"COBOL",import:(()=>import("./cobol-DbURsbuN.js"))},{id:"codeowners",name:"CODEOWNERS",import:(()=>import("./codeowners-CtwIM3TN.js"))},{id:"codeql",name:"CodeQL",aliases:["ql"],import:(()=>import("./codeql-D164juXQ.js"))},{id:"coffee",name:"CoffeeScript",aliases:["coffeescript"],import:(()=>import("./coffee-Bk-z6oI_.js"))},{id:"common-lisp",name:"Common Lisp",aliases:["lisp"],import:(()=>import("./common-lisp-DXc9XcIM.js"))},{id:"coq",name:"Coq",import:(()=>import("./coq-BBL5-mG4.js"))},{id:"cpp",name:"C++",aliases:["c++"],import:(()=>import("./cpp-B28oCXVK.js"))},{id:"crystal",name:"Crystal",import:(()=>import("./crystal-Dvqzbpz8.js"))},{id:"csharp",name:"C#",aliases:["c#","cs"],import:(()=>import("./csharp-CFxe5pRo.js"))},{id:"css",name:"CSS",import:(()=>import("./css-Br67jR8j.js"))},{id:"csv",name:"CSV",import:(()=>import("./csv-D5aBhKLr.js"))},{id:"cue",name:"CUE",import:(()=>import("./cue-WCin6O4e.js"))},{id:"cypher",name:"Cypher",aliases:["cql"],import:(()=>import("./cypher-DYQk2G82.js"))},{id:"d",name:"D",import:(()=>import("./d-DVc-yF-l.js"))},{id:"dart",name:"Dart",import:(()=>import("./dart-ByalkS20.js"))},{id:"dax",name:"DAX",import:(()=>import("./dax-oldcCaJg.js"))},{id:"desktop",name:"Desktop",import:(()=>import("./desktop-DZfyBMgF.js"))},{id:"diff",name:"Diff",import:(()=>import("./diff-jW5kmiru.js"))},{id:"docker",name:"Dockerfile",aliases:["dockerfile"],import:(()=>import("./docker-DG9neUKd.js"))},{id:"dotenv",name:"dotEnv",import:(()=>import("./dotenv-Bea-FkXq.js"))},{id:"dream-maker",name:"Dream Maker",import:(()=>import("./dream-maker-DAHQwpwp.js"))},{id:"edge",name:"Edge",import:(()=>import("./edge-DTiORMU5.js"))},{id:"elixir",name:"Elixir",import:(()=>import("./elixir-DnIH90qd.js"))},{id:"elm",name:"Elm",import:(()=>import("./elm-BjIDgKzz.js"))},{id:"emacs-lisp",name:"Emacs Lisp",aliases:["elisp"],import:(()=>import("./emacs-lisp-DaE6cnv4.js"))},{id:"erb",name:"ERB",import:(()=>import("./erb-DjWesHSX.js"))},{id:"erlang",name:"Erlang",aliases:["erl"],import:(()=>import("./erlang-DNeY46SW.js"))},{id:"fennel",name:"Fennel",import:(()=>import("./fennel-DBMsxtrh.js"))},{id:"fish",name:"Fish",import:(()=>import("./fish-BxskpYPN.js"))},{id:"fluent",name:"Fluent",aliases:["ftl"],import:(()=>import("./fluent-Bwo2XpEt.js"))},{id:"fortran-fixed-form",name:"Fortran (Fixed Form)",aliases:["f","for","f77"],import:(()=>import("./fortran-fixed-form-DFFnVrrY.js"))},{id:"fortran-free-form",name:"Fortran (Free Form)",aliases:["f90","f95","f03","f08","f18"],import:(()=>import("./fortran-free-form-DB5N_DgY.js"))},{id:"fsharp",name:"F#",aliases:["f#","fs"],import:(()=>import("./fsharp-DRAF1jsN.js"))},{id:"gdresource",name:"GDResource",aliases:["tscn","tres"],import:(()=>import("./gdresource-BD-1uzY7.js"))},{id:"gdscript",name:"GDScript",aliases:["gd"],import:(()=>import("./gdscript-C3mT4Uym.js"))},{id:"gdshader",name:"GDShader",import:(()=>import("./gdshader-G7X6ysY3.js"))},{id:"genie",name:"Genie",import:(()=>import("./genie-DSsjfZMX.js"))},{id:"gherkin",name:"Gherkin",import:(()=>import("./gherkin-Cl2Fw-_0.js"))},{id:"git-commit",name:"Git Commit Message",import:(()=>import("./git-commit-CJPsQObV.js"))},{id:"git-rebase",name:"Git Rebase Message",import:(()=>import("./git-rebase-DeZqv4fp.js"))},{id:"gleam",name:"Gleam",import:(()=>import("./gleam-BeBqoPwE.js"))},{id:"glimmer-js",name:"Glimmer JS",aliases:["gjs"],import:(()=>import("./glimmer-js-F_qk9EQT.js"))},{id:"glimmer-ts",name:"Glimmer TS",aliases:["gts"],import:(()=>import("./glimmer-ts-Dhzi-GJU.js"))},{id:"glsl",name:"GLSL",import:(()=>import("./glsl-BOG9l2nV.js"))},{id:"gn",name:"GN",import:(()=>import("./gn-Dxr0sSUf.js"))},{id:"gnuplot",name:"Gnuplot",import:(()=>import("./gnuplot-CtW3R_Hz.js"))},{id:"go",name:"Go",import:(()=>import("./go-B7VTfpnm.js"))},{id:"graphql",name:"GraphQL",aliases:["gql"],import:(()=>import("./graphql-B6XHM4uj.js"))},{id:"groovy",name:"Groovy",import:(()=>import("./groovy-DFxE31Qs.js"))},{id:"hack",name:"Hack",import:(()=>import("./hack-CJGL07zV.js"))},{id:"haml",name:"Ruby Haml",import:(()=>import("./haml-C4vGXCDX.js"))},{id:"handlebars",name:"Handlebars",aliases:["hbs"],import:(()=>import("./handlebars-BsldGL5W.js"))},{id:"haskell",name:"Haskell",aliases:["hs"],import:(()=>import("./haskell-BfdhR_WN.js"))},{id:"haxe",name:"Haxe",import:(()=>import("./haxe-DVIybFAS.js"))},{id:"hcl",name:"HashiCorp HCL",import:(()=>import("./hcl-B6OePqme.js"))},{id:"hjson",name:"Hjson",import:(()=>import("./hjson-D2jn7IRw.js"))},{id:"hlsl",name:"HLSL",import:(()=>import("./hlsl-MKeth5V9.js"))},{id:"html",name:"HTML",import:(()=>import("./html-BW_6VhB7.js"))},{id:"html-derivative",name:"HTML (Derivative)",import:(()=>import("./html-derivative-BxANmYVz.js"))},{id:"http",name:"HTTP",import:(()=>import("./http-CG3jvXcS.js"))},{id:"hurl",name:"Hurl",import:(()=>import("./hurl-CxQrh4RI.js"))},{id:"hxml",name:"HXML",import:(()=>import("./hxml-CkS3Eie7.js"))},{id:"hy",name:"Hy",import:(()=>import("./hy-DI6mCUnw.js"))},{id:"imba",name:"Imba",import:(()=>import("./imba-D-Pk5S0X.js"))},{id:"ini",name:"INI",aliases:["properties"],import:(()=>import("./ini-Dix3pTmg.js"))},{id:"java",name:"Java",import:(()=>import("./java-BTDmaRNO.js"))},{id:"javascript",name:"JavaScript",aliases:["js","cjs","mjs"],import:(()=>import("./javascript-WyGyM1wV.js"))},{id:"jinja",name:"Jinja",import:(()=>import("./jinja-CGKoJZuT.js"))},{id:"jison",name:"Jison",import:(()=>import("./jison-B9XHrcYJ.js"))},{id:"json",name:"JSON",import:(()=>import("./json-B8JryHcM.js"))},{id:"json5",name:"JSON5",import:(()=>import("./json5-Cdatmj9n.js"))},{id:"jsonc",name:"JSON with Comments",import:(()=>import("./jsonc-CvUCa1o5.js"))},{id:"jsonl",name:"JSON Lines",import:(()=>import("./jsonl-9I_GBd5L.js"))},{id:"jsonnet",name:"Jsonnet",import:(()=>import("./jsonnet-XoenQ2oc.js"))},{id:"jssm",name:"JSSM",aliases:["fsl"],import:(()=>import("./jssm-CWE2S0Z5.js"))},{id:"jsx",name:"JSX",import:(()=>import("./jsx-8cLv2Six.js"))},{id:"julia",name:"Julia",aliases:["jl"],import:(()=>import("./julia-z72n2X8P.js"))},{id:"just",name:"Just",import:(()=>import("./just-WcmGqwHQ.js"))},{id:"kdl",name:"KDL",import:(()=>import("./kdl-CMbyIXjQ.js"))},{id:"kotlin",name:"Kotlin",aliases:["kt","kts"],import:(()=>import("./kotlin-BQy537ds.js"))},{id:"kusto",name:"Kusto",aliases:["kql"],import:(()=>import("./kusto-Bh6esMjd.js"))},{id:"latex",name:"LaTeX",import:(()=>import("./latex-DDhGBJRe.js"))},{id:"lean",name:"Lean 4",aliases:["lean4"],import:(()=>import("./lean-C4RHkN41.js"))},{id:"less",name:"Less",import:(()=>import("./less-XNfgnZC7.js"))},{id:"liquid",name:"Liquid",import:(()=>import("./liquid-VEiCTF4k.js"))},{id:"llvm",name:"LLVM IR",import:(()=>import("./llvm-BJRUtCev.js"))},{id:"log",name:"Log file",import:(()=>import("./log-CcaF_xNv.js"))},{id:"logo",name:"Logo",import:(()=>import("./logo-D9WQLoKQ.js"))},{id:"lua",name:"Lua",import:(()=>import("./lua-8Av-h-ns.js"))},{id:"luau",name:"Luau",import:(()=>import("./luau-CrdyyxLX.js"))},{id:"make",name:"Makefile",aliases:["makefile"],import:(()=>import("./make-DXVx14cr.js"))},{id:"markdown",name:"Markdown",aliases:["md"],import:(()=>import("./markdown-DX-TNHnc.js"))},{id:"marko",name:"Marko",import:(()=>import("./marko-6XzqJfhW.js"))},{id:"matlab",name:"MATLAB",import:(()=>import("./matlab-DzreyMvm.js"))},{id:"mdc",name:"MDC",import:(()=>import("./mdc-DuMdwZAv.js"))},{id:"mdx",name:"MDX",import:(()=>import("./mdx-C2fqO2XY.js"))},{id:"mermaid",name:"Mermaid",aliases:["mmd"],import:(()=>import("./mermaid-Cwy4Up_p.js"))},{id:"mipsasm",name:"MIPS Assembly",aliases:["mips"],import:(()=>import("./mipsasm-yE_Aqo9y.js"))},{id:"mojo",name:"Mojo",import:(()=>import("./mojo-M6pJPbMk.js"))},{id:"moonbit",name:"MoonBit",aliases:["mbt","mbti"],import:(()=>import("./moonbit-CR8uFLGd.js"))},{id:"move",name:"Move",import:(()=>import("./move-CyYMWVy5.js"))},{id:"narrat",name:"Narrat Language",aliases:["nar"],import:(()=>import("./narrat-DXUZ_ZkW.js"))},{id:"nextflow",name:"Nextflow",aliases:["nf"],import:(()=>import("./nextflow-D9i3Mg89.js"))},{id:"nextflow-groovy",name:"Nextflow Groovy",import:(()=>import("./nextflow-groovy-BtKenbWl.js"))},{id:"nginx",name:"Nginx",import:(()=>import("./nginx-DSXkacNc.js"))},{id:"nim",name:"Nim",import:(()=>import("./nim-D9lokC5T.js"))},{id:"nix",name:"Nix",import:(()=>import("./nix-Ckjrpg0r.js"))},{id:"nushell",name:"nushell",aliases:["nu"],import:(()=>import("./nushell-DtHLcZf1.js"))},{id:"objective-c",name:"Objective-C",aliases:["objc"],import:(()=>import("./objective-c-BoaBTdtz.js"))},{id:"objective-cpp",name:"Objective-C++",import:(()=>import("./objective-cpp-DstR8hNy.js"))},{id:"ocaml",name:"OCaml",import:(()=>import("./ocaml-DTbn2Hv7.js"))},{id:"odin",name:"Odin",import:(()=>import("./odin-Bxc4S6Xn.js"))},{id:"openscad",name:"OpenSCAD",aliases:["scad"],import:(()=>import("./openscad-CXHpNBsb.js"))},{id:"pascal",name:"Pascal",import:(()=>import("./pascal-Sr-XLSE6.js"))},{id:"perl",name:"Perl",import:(()=>import("./perl-CP_GSK0L.js"))},{id:"php",name:"PHP",import:(()=>import("./php-CNeTOyEV.js"))},{id:"pkl",name:"Pkl",import:(()=>import("./pkl-CRusufhw.js"))},{id:"plsql",name:"PL/SQL",import:(()=>import("./plsql-Dbm3tV2N.js"))},{id:"po",name:"Gettext PO",aliases:["pot","potx"],import:(()=>import("./po-LG0lFwH4.js"))},{id:"polar",name:"Polar",import:(()=>import("./polar-DjOs3GWb.js"))},{id:"postcss",name:"PostCSS",import:(()=>import("./postcss-GRRkWn2F.js"))},{id:"powerquery",name:"PowerQuery",import:(()=>import("./powerquery-DHf-dtTS.js"))},{id:"powershell",name:"PowerShell",aliases:["ps","ps1"],import:(()=>import("./powershell-DXrKVo3G.js"))},{id:"prisma",name:"Prisma",import:(()=>import("./prisma-Dgf8IN_C.js"))},{id:"prolog",name:"Prolog",import:(()=>import("./prolog-9JcfiY6I.js"))},{id:"proto",name:"Protocol Buffer 3",aliases:["protobuf"],import:(()=>import("./proto-dqx_Sj2i.js"))},{id:"pug",name:"Pug",aliases:["jade"],import:(()=>import("./pug-kUpeg2wB.js"))},{id:"puppet",name:"Puppet",import:(()=>import("./puppet-Di57VbSS.js"))},{id:"purescript",name:"PureScript",import:(()=>import("./purescript-BgpM7rDH.js"))},{id:"python",name:"Python",aliases:["py"],import:(()=>import("./python-B6Ihcp-E.js"))},{id:"qml",name:"QML",import:(()=>import("./qml-DmGQGbca.js"))},{id:"qmldir",name:"QML Directory",import:(()=>import("./qmldir-DXd9s5XC.js"))},{id:"qss",name:"Qt Style Sheets",import:(()=>import("./qss-B7NnhfIi.js"))},{id:"r",name:"R",import:(()=>import("./r-1ts4xG1r.js"))},{id:"racket",name:"Racket",import:(()=>import("./racket-CeDx7KO2.js"))},{id:"raku",name:"Raku",aliases:["perl6"],import:(()=>import("./raku-BMJwmrCS.js"))},{id:"razor",name:"ASP.NET Razor",import:(()=>import("./razor-C2a5o_rD.js"))},{id:"reg",name:"Windows Registry Script",import:(()=>import("./reg-Cvyu2Gnx.js"))},{id:"regexp",name:"RegExp",aliases:["regex"],import:(()=>import("./regexp-DK-WlHNu.js"))},{id:"rel",name:"Rel",import:(()=>import("./rel-BlqNHz8k.js"))},{id:"riscv",name:"RISC-V",import:(()=>import("./riscv-C5dpdlr7.js"))},{id:"ron",name:"RON",import:(()=>import("./ron-j5NfrB3z.js"))},{id:"rosmsg",name:"ROS Interface",import:(()=>import("./rosmsg-ZkSIzPhc.js"))},{id:"rst",name:"reStructuredText",import:(()=>import("./rst-DNugHtZA.js"))},{id:"ruby",name:"Ruby",aliases:["rb"],import:(()=>import("./ruby-DtA7rz7D.js"))},{id:"rust",name:"Rust",aliases:["rs"],import:(()=>import("./rust-CxuBE0J8.js"))},{id:"sas",name:"SAS",import:(()=>import("./sas-DPMpzP9X.js"))},{id:"sass",name:"Sass",import:(()=>import("./sass-bfEVHPJ8.js"))},{id:"scala",name:"Scala",import:(()=>import("./scala-Dtw19ca_.js"))},{id:"scheme",name:"Scheme",import:(()=>import("./scheme-OJppFQF3.js"))},{id:"scss",name:"SCSS",import:(()=>import("./scss-n48HZsmL.js"))},{id:"sdbl",name:"1C (Query)",aliases:["1c-query"],import:(()=>import("./sdbl-CvZs3G9c.js"))},{id:"shaderlab",name:"ShaderLab",aliases:["shader"],import:(()=>import("./shaderlab-CEJedz68.js"))},{id:"shellscript",name:"Shell",aliases:["bash","sh","shell","zsh"],import:(()=>import("./shellscript-DgJyDXW6.js"))},{id:"shellsession",name:"Shell Session",aliases:["console"],import:(()=>import("./shellsession-DSlzxnCM.js"))},{id:"smalltalk",name:"Smalltalk",import:(()=>import("./smalltalk-B9IHbYt7.js"))},{id:"solidity",name:"Solidity",import:(()=>import("./solidity-B3CjIuAd.js"))},{id:"soy",name:"Closure Templates",aliases:["closure-templates"],import:(()=>import("./soy-DEV4yxgM.js"))},{id:"sparql",name:"SPARQL",import:(()=>import("./sparql-BJh4JEw-.js"))},{id:"splunk",name:"Splunk Query Language",aliases:["spl"],import:(()=>import("./splunk-h-bNAnbk.js"))},{id:"sql",name:"SQL",import:(()=>import("./sql-Dq2MiB0T.js"))},{id:"ssh-config",name:"SSH Config",import:(()=>import("./ssh-config-CywOjoXH.js"))},{id:"stata",name:"Stata",import:(()=>import("./stata-BcICKvEt.js"))},{id:"stylus",name:"Stylus",aliases:["styl"],import:(()=>import("./stylus-CIg617SB.js"))},{id:"surrealql",name:"SurrealQL",aliases:["surql"],import:(()=>import("./surrealql-2KNEnAt7.js"))},{id:"svelte",name:"Svelte",import:(()=>import("./svelte-B-Z8GLL9.js"))},{id:"swift",name:"Swift",import:(()=>import("./swift-tEesUtni.js"))},{id:"system-verilog",name:"SystemVerilog",import:(()=>import("./system-verilog-Qdm_1g2q.js"))},{id:"systemd",name:"Systemd Units",import:(()=>import("./systemd-DKMPPZjB.js"))},{id:"talonscript",name:"TalonScript",aliases:["talon"],import:(()=>import("./talonscript-eRuyeYHl.js"))},{id:"tasl",name:"Tasl",import:(()=>import("./tasl-B9CVvjfG.js"))},{id:"tcl",name:"Tcl",import:(()=>import("./tcl-Bq9dbVAF.js"))},{id:"templ",name:"Templ",import:(()=>import("./templ-W185oS4p.js"))},{id:"terraform",name:"Terraform",aliases:["tf","tfvars"],import:(()=>import("./terraform-CAp711iT.js"))},{id:"tex",name:"TeX",import:(()=>import("./tex-BHxF5DMe.js"))},{id:"toml",name:"TOML",import:(()=>import("./toml-Ms459DBw.js"))},{id:"ts-tags",name:"TypeScript with Tags",aliases:["lit"],import:(()=>import("./ts-tags-xUT7JH_c.js"))},{id:"tsv",name:"TSV",import:(()=>import("./tsv-BFtm7NXx.js"))},{id:"tsx",name:"TSX",import:(()=>import("./tsx-D6116Ycy.js"))},{id:"turtle",name:"Turtle",import:(()=>import("./turtle-DpRhbQZY.js"))},{id:"twig",name:"Twig",import:(()=>import("./twig-7VFzIvA2.js"))},{id:"typescript",name:"TypeScript",aliases:["ts","cts","mts"],import:(()=>import("./typescript-BqvgUolh.js"))},{id:"typespec",name:"TypeSpec",aliases:["tsp"],import:(()=>import("./typespec-B09nCZui.js"))},{id:"typst",name:"Typst",aliases:["typ"],import:(()=>import("./typst-Dfd71gQj.js"))},{id:"v",name:"V",import:(()=>import("./v-BH76v7br.js"))},{id:"vala",name:"Vala",import:(()=>import("./vala-z59IxkFd.js"))},{id:"vb",name:"Visual Basic",aliases:["cmd"],import:(()=>import("./vb-4AxSLKIU.js"))},{id:"verilog",name:"Verilog",import:(()=>import("./verilog-LfQUkHDc.js"))},{id:"vhdl",name:"VHDL",import:(()=>import("./vhdl-DJCsFYgn.js"))},{id:"viml",name:"Vim Script",aliases:["vim","vimscript"],import:(()=>import("./viml-pbKHW3Ia.js"))},{id:"vue",name:"Vue",import:(()=>import("./vue-CzubQWux.js"))},{id:"vue-html",name:"Vue HTML",import:(()=>import("./vue-html-zEfNEgpj.js"))},{id:"vue-vine",name:"Vue Vine",import:(()=>import("./vue-vine-DQRWX4iy.js"))},{id:"vyper",name:"Vyper",aliases:["vy"],import:(()=>import("./vyper-DpazWNpx.js"))},{id:"wasm",name:"WebAssembly",import:(()=>import("./wasm-CFi-k9--.js"))},{id:"wenyan",name:"Wenyan",aliases:["文言"],import:(()=>import("./wenyan-CYFFG9DK.js"))},{id:"wgsl",name:"WGSL",import:(()=>import("./wgsl-CxjTZs-b.js"))},{id:"wikitext",name:"Wikitext",aliases:["mediawiki","wiki"],import:(()=>import("./wikitext-Bx2qct8O.js"))},{id:"wit",name:"WebAssembly Interface Types",import:(()=>import("./wit-DDW3hD69.js"))},{id:"wolfram",name:"Wolfram",aliases:["wl"],import:(()=>import("./wolfram-pu21K997.js"))},{id:"xml",name:"XML",import:(()=>import("./xml-BkAJuBCc.js"))},{id:"xsl",name:"XSL",import:(()=>import("./xsl-C6UUWSil.js"))},{id:"yaml",name:"YAML",aliases:["yml"],import:(()=>import("./yaml-Bopit2L3.js"))},{id:"zenscript",name:"ZenScript",import:(()=>import("./zenscript-BIAKq-aR.js"))},{id:"zig",name:"Zig",import:(()=>import("./zig-bSFrHQ7n.js"))}],rn=Object.fromEntries(ot.map(e=>[e.id,e.import])),sn=Object.fromEntries(ot.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),xe={...rn,...sn},on=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:(()=>import("./andromeeda-CT0vplkN.js"))},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:(()=>import("./aurora-x-C0VKFdlO.js"))},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:(()=>import("./ayu-dark-wZ6ORhBL.js"))},{id:"ayu-light",displayName:"Ayu Light",type:"light",import:(()=>import("./ayu-light-xXLJ_Ch1.js"))},{id:"ayu-mirage",displayName:"Ayu Mirage",type:"dark",import:(()=>import("./ayu-mirage-CQckA_sP.js"))},{id:"catppuccin-frappe",displayName:"Catppuccin Frappé",type:"dark",import:(()=>import("./catppuccin-frappe-CfssSZMA.js"))},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:(()=>import("./catppuccin-latte-DoBaWTGn.js"))},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:(()=>import("./catppuccin-macchiato-BkAuvdZC.js"))},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:(()=>import("./catppuccin-mocha-D9fcC0iT.js"))},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:(()=>import("./dark-plus-DLU5INA3.js"))},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:(()=>import("./dracula-XcYHBZy6.js"))},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:(()=>import("./dracula-soft-BPeX9gxW.js"))},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:(()=>import("./everforest-dark-WOub3wle.js"))},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:(()=>import("./everforest-light-DCUg8VH8.js"))},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:(()=>import("./github-dark-BQV5ugrc.js"))},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:(()=>import("./github-dark-default-DLWDM7FH.js"))},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:(()=>import("./github-dark-dimmed-D1FmiR_p.js"))},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:(()=>import("./github-dark-high-contrast-BilLoi0o.js"))},{id:"github-light",displayName:"GitHub Light",type:"light",import:(()=>import("./github-light-Rcb2q3L5.js"))},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:(()=>import("./github-light-default-CQ75esMw.js"))},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:(()=>import("./github-light-high-contrast-CRF1wyLy.js"))},{id:"gruvbox-dark-hard",displayName:"Gruvbox Dark Hard",type:"dark",import:(()=>import("./gruvbox-dark-hard-C37G1gbc.js"))},{id:"gruvbox-dark-medium",displayName:"Gruvbox Dark Medium",type:"dark",import:(()=>import("./gruvbox-dark-medium-C3G9m3TV.js"))},{id:"gruvbox-dark-soft",displayName:"Gruvbox Dark Soft",type:"dark",import:(()=>import("./gruvbox-dark-soft-eZmcmZ9I.js"))},{id:"gruvbox-light-hard",displayName:"Gruvbox Light Hard",type:"light",import:(()=>import("./gruvbox-light-hard-BYj-vz_3.js"))},{id:"gruvbox-light-medium",displayName:"Gruvbox Light Medium",type:"light",import:(()=>import("./gruvbox-light-medium-BdQlDiiF.js"))},{id:"gruvbox-light-soft",displayName:"Gruvbox Light Soft",type:"light",import:(()=>import("./gruvbox-light-soft-BGNwjiRh.js"))},{id:"horizon",displayName:"Horizon",type:"dark",import:(()=>import("./horizon-cslQss18.js"))},{id:"horizon-bright",displayName:"Horizon Bright",type:"light",import:(()=>import("./horizon-bright-BVMyA0so.js"))},{id:"houston",displayName:"Houston",type:"dark",import:(()=>import("./houston-RHIKkNfR.js"))},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:(()=>import("./kanagawa-dragon-BOvIHJVT.js"))},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:(()=>import("./kanagawa-lotus-Bwcd7Bvx.js"))},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:(()=>import("./kanagawa-wave-0SAlpf0s.js"))},{id:"laserwave",displayName:"LaserWave",type:"dark",import:(()=>import("./laserwave-si7wuSrt.js"))},{id:"light-plus",displayName:"Light Plus",type:"light",import:(()=>import("./light-plus-g_Fi9vkG.js"))},{id:"material-theme",displayName:"Material Theme",type:"dark",import:(()=>import("./material-theme-CIJ3cGaW.js"))},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:(()=>import("./material-theme-darker-BWg3m1GB.js"))},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:(()=>import("./material-theme-lighter-DR8HWMN7.js"))},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:(()=>import("./material-theme-ocean-CZf9pk28.js"))},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:(()=>import("./material-theme-palenight-BF01YeZy.js"))},{id:"min-dark",displayName:"Min Dark",type:"dark",import:(()=>import("./min-dark-DhfaepVE.js"))},{id:"min-light",displayName:"Min Light",type:"light",import:(()=>import("./min-light-6xx0uMgm.js"))},{id:"monokai",displayName:"Monokai",type:"dark",import:(()=>import("./monokai-BodnsaDQ.js"))},{id:"night-owl",displayName:"Night Owl",type:"dark",import:(()=>import("./night-owl-EdP2Hztp.js"))},{id:"night-owl-light",displayName:"Night Owl Light",type:"light",import:(()=>import("./night-owl-light-Bk-lYVyk.js"))},{id:"nord",displayName:"Nord",type:"dark",import:(()=>import("./nord-BAu0wM6c.js"))},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:(()=>import("./one-dark-pro-utPxbBbJ.js"))},{id:"one-light",displayName:"One Light",type:"light",import:(()=>import("./one-light-BuCQ22aO.js"))},{id:"plastic",displayName:"Plastic",type:"dark",import:(()=>import("./plastic-CXnNNlFZ.js"))},{id:"poimandres",displayName:"Poimandres",type:"dark",import:(()=>import("./poimandres-BrOVMvuE.js"))},{id:"red",displayName:"Red",type:"dark",import:(()=>import("./red-DR6ZwibK.js"))},{id:"rose-pine",displayName:"Rosé Pine",type:"dark",import:(()=>import("./rose-pine-CN2F2lJl.js"))},{id:"rose-pine-dawn",displayName:"Rosé Pine Dawn",type:"light",import:(()=>import("./rose-pine-dawn-0S8NEhsA.js"))},{id:"rose-pine-moon",displayName:"Rosé Pine Moon",type:"dark",import:(()=>import("./rose-pine-moon-DzBDT4rc.js"))},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:(()=>import("./slack-dark-CWRQmTmo.js"))},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:(()=>import("./slack-ochin-DO_ok7XK.js"))},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:(()=>import("./snazzy-light-B5llO_gK.js"))},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:(()=>import("./solarized-dark-G9yBjKj_.js"))},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:(()=>import("./solarized-light-DeSzljQz.js"))},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:(()=>import("./synthwave-84-DRVv-_m_.js"))},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:(()=>import("./tokyo-night-BvwC8l2v.js"))},{id:"vesper",displayName:"Vesper",type:"dark",import:(()=>import("./vesper-DxfWgk_t.js"))},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:(()=>import("./vitesse-black-B_BYPdvp.js"))},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:(()=>import("./vitesse-dark-DOSOf2Sz.js"))},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:(()=>import("./vitesse-light-gUX51GpB.js"))}],an=Object.fromEntries(on.map(e=>[e.id,e.import]));var ln=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function Fi(){return 2147483648}function ji(){return typeof performance<"u"?performance.now():Date.now()}const Hi=(e,t)=>e+(t-e%t)%t;async function Wi(e){let t,n;const r={};function i(d){n=d,r.HEAPU8=new Uint8Array(d),r.HEAPU32=new Uint32Array(d)}function s(d,f,w){r.HEAPU8.copyWithin(d,f,f+w)}function o(d){try{return t.grow(d-n.byteLength+65535>>>16),i(t.buffer),1}catch{}}function a(d){const f=r.HEAPU8.length;d=d>>>0;const w=Fi();if(d>w)return!1;for(let b=1;b<=4;b*=2){let m=f*(1+.2/b);m=Math.min(m,d+100663296);const g=Math.min(w,Hi(Math.max(d,m),65536));if(o(g))return!0}return!1}const l=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function c(d,f,w=1024){const b=f+w;let m=f;for(;d[m]&&!(m>=b);)++m;if(m-f>16&&d.buffer&&l)return l.decode(d.subarray(f,m));let g="";for(;f<m;){let C=d[f++];if(!(C&128)){g+=String.fromCharCode(C);continue}const k=d[f++]&63;if((C&224)===192){g+=String.fromCharCode((C&31)<<6|k);continue}const v=d[f++]&63;if((C&240)===224?C=(C&15)<<12|k<<6|v:C=(C&7)<<18|k<<12|v<<6|d[f++]&63,C<65536)g+=String.fromCharCode(C);else{const T=C-65536;g+=String.fromCharCode(55296|T>>10,56320|T&1023)}}return g}function p(d,f){return d?c(r.HEAPU8,d,f):""}const u={emscripten_get_now:ji,emscripten_memcpy_big:s,emscripten_resize_heap:a,fd_write:()=>0};async function h(){const f=await e({env:u,wasi_snapshot_preview1:u});t=f.memory,i(t.buffer),Object.assign(r,f),r.UTF8ToString=p}return await h(),r}var zi=Object.defineProperty,Vi=(e,t,n)=>t in e?zi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,L=(e,t,n)=>Vi(e,typeof t!="symbol"?t+"":t,n);let P=null;function qi(e){throw new ln(e.UTF8ToString(e.getLastOnigError()))}class at{constructor(t){L(this,"utf16Length"),L(this,"utf8Length"),L(this,"utf16Value"),L(this,"utf8Value"),L(this,"utf16OffsetToUtf8"),L(this,"utf8OffsetToUtf16");const n=t.length,r=at._utf8ByteLength(t),i=r!==n,s=i?new Uint32Array(n+1):null;i&&(s[n]=r);const o=i?new Uint32Array(r+1):null;i&&(o[r]=n);const a=new Uint8Array(r);let l=0;for(let c=0;c<n;c++){const p=t.charCodeAt(c);let u=p,h=!1;if(p>=55296&&p<=56319&&c+1<n){const d=t.charCodeAt(c+1);d>=56320&&d<=57343&&(u=(p-55296<<10)+65536|d-56320,h=!0)}i&&(s[c]=l,h&&(s[c+1]=l),u<=127?o[l+0]=c:u<=2047?(o[l+0]=c,o[l+1]=c):u<=65535?(o[l+0]=c,o[l+1]=c,o[l+2]=c):(o[l+0]=c,o[l+1]=c,o[l+2]=c,o[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=t,this.utf8Value=a,this.utf16OffsetToUtf8=s,this.utf8OffsetToUtf16=o}static _utf8ByteLength(t){let n=0;for(let r=0,i=t.length;r<i;r++){const s=t.charCodeAt(r);let o=s,a=!1;if(s>=55296&&s<=56319&&r+1<i){const l=t.charCodeAt(r+1);l>=56320&&l<=57343&&(o=(s-55296<<10)+65536|l-56320,a=!0)}o<=127?n+=1:o<=2047?n+=2:o<=65535?n+=3:n+=4,a&&r++}return n}createString(t){const n=t.omalloc(this.utf8Length);return t.HEAPU8.set(this.utf8Value,n),n}}const lt=class z{constructor(t){if(L(this,"id",++z.LAST_ID),L(this,"_onigBinding"),L(this,"content"),L(this,"utf16Length"),L(this,"utf8Length"),L(this,"utf16OffsetToUtf8"),L(this,"utf8OffsetToUtf16"),L(this,"ptr"),!P)throw new ln("Must invoke loadWasm first.");this._onigBinding=P,this.content=t;const n=new at(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!z._sharedPtrInUse?(z._sharedPtr||(z._sharedPtr=P.omalloc(1e4)),z._sharedPtrInUse=!0,P.HEAPU8.set(n.utf8Value,z._sharedPtr),this.ptr=z._sharedPtr):this.ptr=n.createString(P)}convertUtf8OffsetToUtf16(t){return this.utf8OffsetToUtf16?t<0?0:t>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[t]:t}convertUtf16OffsetToUtf8(t){return this.utf16OffsetToUtf8?t<0?0:t>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[t]:t}dispose(){this.ptr===z._sharedPtr?z._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};L(lt,"LAST_ID",0);L(lt,"_sharedPtr",0);L(lt,"_sharedPtrInUse",!1);let hr=lt;class Xi{constructor(t){if(L(this,"_onigBinding"),L(this,"_ptr"),!P)throw new ln("Must invoke loadWasm first.");const n=[],r=[];for(let a=0,l=t.length;a<l;a++){const c=new at(t[a]);n[a]=c.createString(P),r[a]=c.utf8Length}const i=P.omalloc(4*t.length);P.HEAPU32.set(n,i/4);const s=P.omalloc(4*t.length);P.HEAPU32.set(r,s/4);const o=P.createOnigScanner(i,s,t.length);for(let a=0,l=t.length;a<l;a++)P.ofree(n[a]);P.ofree(s),P.ofree(i),o===0&&qi(P),this._onigBinding=P,this._ptr=o}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(t,n,r){let i=0;if(typeof r=="number"&&(i=r),typeof t=="string"){t=new hr(t);const s=this._findNextMatchSync(t,n,!1,i);return t.dispose(),s}return this._findNextMatchSync(t,n,!1,i)}_findNextMatchSync(t,n,r,i){const s=this._onigBinding,o=s.findNextOnigScannerMatch(this._ptr,t.id,t.ptr,t.utf8Length,t.convertUtf16OffsetToUtf8(n),i);if(o===0)return null;const a=s.HEAPU32;let l=o/4;const c=a[l++],p=a[l++],u=[];for(let h=0;h<p;h++){const d=t.convertUtf8OffsetToUtf16(a[l++]),f=t.convertUtf8OffsetToUtf16(a[l++]);u[h]={start:d,end:f,length:f-d}}return{index:c,captureIndices:u}}}function Ki(e){return typeof e.instantiator=="function"}function Qi(e){return typeof e.default=="function"}function Ji(e){return typeof e.data<"u"}function Zi(e){return typeof Response<"u"&&e instanceof Response}function Yi(e){return typeof ArrayBuffer<"u"&&(e instanceof ArrayBuffer||ArrayBuffer.isView(e))||typeof Buffer<"u"&&Buffer.isBuffer?.(e)||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer||typeof Uint32Array<"u"&&e instanceof Uint32Array}let Oe;function cn(e){if(Oe)return Oe;async function t(){P=await Wi(async n=>{let r=e;return r=await r,typeof r=="function"&&(r=await r(n)),typeof r=="function"&&(r=await r(n)),Ki(r)?r=await r.instantiator(n):Qi(r)?r=await r.default(n):(Ji(r)&&(r=r.data),Zi(r)?typeof WebAssembly.instantiateStreaming=="function"?r=await es(r)(n):r=await ts(r)(n):Yi(r)?r=await _t(r)(n):r instanceof WebAssembly.Module?r=await _t(r)(n):"default"in r&&r.default instanceof WebAssembly.Module&&(r=await _t(r.default)(n))),"instance"in r&&(r=r.instance),"exports"in r&&(r=r.exports),r})}return Oe=t(),Oe}function _t(e){return t=>WebAssembly.instantiate(e,t)}function es(e){return t=>WebAssembly.instantiateStreaming(e,t)}function ts(e){return async t=>{const n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}let fr;function ns(e){fr=e}function rs(){return fr}async function mr(e){return e&&await cn(e),{createScanner(t){return new Xi(t.map(n=>typeof n=="string"?n:n.source))},createString(t){return new hr(t)}}}var is=Object.freeze({__proto__:null,createOnigurumaEngine:mr,getDefaultWasmLoader:rs,loadWasm:cn,setDefaultWasmLoader:ns}),gr=nn({});dr(gr,is);var A=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function ss(e){return un(e)}function un(e){return Array.isArray(e)?os(e):e instanceof RegExp?e:typeof e=="object"?as(e):e}function os(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=un(e[n]);return t}function as(e){let t={};for(let n in e)t[n]=un(e[n]);return t}function yr(e,...t){return t.forEach(n=>{for(let r in n)e[r]=n[r]}),e}function br(e){const t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?br(e.substring(0,e.length-1)):e.substr(~t+1)}var St=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Ge=class{static hasCaptures(e){return e===null?!1:(St.lastIndex=0,St.test(e))}static replaceCaptures(e,t,n){return e.replace(St,(r,i,s,o)=>{let a=n[parseInt(i||s,10)];if(a){let l=t.substring(a.start,a.end);for(;l[0]===".";)l=l.substring(1);switch(o){case"downcase":return l.toLowerCase();case"upcase":return l.toUpperCase();default:return l}}else return r})}};function wr(e,t){return e<t?-1:e>t?1:0}function Cr(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let i=0;i<n;i++){let s=wr(e[i],t[i]);if(s!==0)return s}return 0}return n-r}function Sn(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function _r(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var Sr=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);const t=this.fn(e);return this.cache.set(e,t),t}},Xe=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(us(e),t)}static createFromParsedTheme(e,t){return ds(e,t)}_cachedMatchRoot=new Sr(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;const t=e.scopeName,r=this._cachedMatchRoot.get(t).find(i=>ls(e.parent,i.parentScopes));return r?new kr(r.fontStyle,r.foreground,r.background):null}},kt=class He{constructor(t,n){this.parent=t,this.scopeName=n}static push(t,n){for(const r of n)t=new He(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new He(n,t[r]);return n}push(t){return new He(this,t)}getSegments(){let t=this;const n=[];for(;t;)n.push(t.scopeName),t=t.parent;return n.reverse(),n}toString(){return this.getSegments().join(" ")}extends(t){return this===t?!0:this.parent===null?!1:this.parent.extends(t)}getExtensionIfDefined(t){const n=[];let r=this;for(;r&&r!==t;)n.push(r.scopeName),r=r.parent;return r===t?n.reverse():void 0}};function ls(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let r=t[n],i=!1;if(r===">"){if(n===t.length-1)return!1;r=t[++n],i=!0}for(;e&&!cs(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function cs(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var kr=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function us(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let i=0,s=t.length;i<s;i++){let o=t[i];if(!o.settings)continue;let a;if(typeof o.scope=="string"){let u=o.scope;u=u.replace(/^[,]+/,""),u=u.replace(/[,]+$/,""),a=u.split(",")}else Array.isArray(o.scope)?a=o.scope:a=[""];let l=-1;if(typeof o.settings.fontStyle=="string"){l=0;let u=o.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 o.settings.foreground=="string"&&Sn(o.settings.foreground)&&(c=o.settings.foreground);let p=null;typeof o.settings.background=="string"&&Sn(o.settings.background)&&(p=o.settings.background);for(let u=0,h=a.length;u<h;u++){let f=a[u].trim().split(" "),w=f[f.length-1],b=null;f.length>1&&(b=f.slice(0,f.length-1),b.reverse()),n[r++]=new ps(w,b,i,l,c,p)}}return n}var ps=class{constructor(e,t,n,r,i,s){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=i,this.background=s}},O=(e=>(e[e.NotSet=-1]="NotSet",e[e.None=0]="None",e[e.Italic=1]="Italic",e[e.Bold=2]="Bold",e[e.Underline=4]="Underline",e[e.Strikethrough=8]="Strikethrough",e))(O||{});function ds(e,t){e.sort((l,c)=>{let p=wr(l.scope,c.scope);return p!==0||(p=Cr(l.parentScopes,c.parentScopes),p!==0)?p:l.index-c.index});let n=0,r="#000000",i="#ffffff";for(;e.length>=1&&e[0].scope==="";){let l=e.shift();l.fontStyle!==-1&&(n=l.fontStyle),l.foreground!==null&&(r=l.foreground),l.background!==null&&(i=l.background)}let s=new hs(t),o=new kr(n,s.getId(r),s.getId(i)),a=new ms(new Bt(0,null,-1,0,0),[]);for(let l=0,c=e.length;l<c;l++){let p=e[l];a.insert(0,p.scope,p.parentScopes,p.fontStyle,s.getId(p.foreground),s.getId(p.background))}return new Xe(s,o,a)}var hs=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw new Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},fs=Object.freeze([]),Bt=class vr{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(t,n,r,i,s){this.scopeDepth=t,this.parentScopes=n||fs,this.fontStyle=r,this.foreground=i,this.background=s}clone(){return new vr(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(t){let n=[];for(let r=0,i=t.length;r<i;r++)n[r]=t[r].clone();return n}acceptOverwrite(t,n,r,i){this.scopeDepth>t?console.log("how did this happen?"):this.scopeDepth=t,n!==-1&&(this.fontStyle=n),r!==0&&(this.foreground=r),i!==0&&(this.background=i)}},ms=class Dt{constructor(t,n=[],r={}){this._mainRule=t,this._children=r,this._rulesWithParentScopes=n}_rulesWithParentScopes;static _cmpBySpecificity(t,n){if(t.scopeDepth!==n.scopeDepth)return n.scopeDepth-t.scopeDepth;let r=0,i=0;for(;t.parentScopes[r]===">"&&r++,n.parentScopes[i]===">"&&i++,!(r>=t.parentScopes.length||i>=n.parentScopes.length);){const s=n.parentScopes[i].length-t.parentScopes[r].length;if(s!==0)return s;r++,i++}return n.parentScopes.length-t.parentScopes.length}match(t){if(t!==""){let r=t.indexOf("."),i,s;if(r===-1?(i=t,s=""):(i=t.substring(0,r),s=t.substring(r+1)),this._children.hasOwnProperty(i))return this._children[i].match(s)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(Dt._cmpBySpecificity),n}insert(t,n,r,i,s,o){if(n===""){this._doInsertHere(t,r,i,s,o);return}let a=n.indexOf("."),l,c;a===-1?(l=n,c=""):(l=n.substring(0,a),c=n.substring(a+1));let p;this._children.hasOwnProperty(l)?p=this._children[l]:(p=new Dt(this._mainRule.clone(),Bt.cloneArr(this._rulesWithParentScopes)),this._children[l]=p),p.insert(t+1,c,r,i,s,o)}_doInsertHere(t,n,r,i,s){if(n===null){this._mainRule.acceptOverwrite(t,r,i,s);return}for(let o=0,a=this._rulesWithParentScopes.length;o<a;o++){let l=this._rulesWithParentScopes[o];if(Cr(l.parentScopes,n)===0){l.acceptOverwrite(t,r,i,s);return}}r===-1&&(r=this._mainRule.fontStyle),i===0&&(i=this._mainRule.foreground),s===0&&(s=this._mainRule.background),this._rulesWithParentScopes.push(new Bt(t,n,r,i,s))}},ge=class U{static toBinaryStr(t){return t.toString(2).padStart(32,"0")}static print(t){const n=U.getLanguageId(t),r=U.getTokenType(t),i=U.getFontStyle(t),s=U.getForeground(t),o=U.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:i,foreground:s,background:o})}static getLanguageId(t){return(t&255)>>>0}static getTokenType(t){return(t&768)>>>8}static containsBalancedBrackets(t){return(t&1024)!==0}static getFontStyle(t){return(t&30720)>>>11}static getForeground(t){return(t&16744448)>>>15}static getBackground(t){return(t&4278190080)>>>24}static set(t,n,r,i,s,o,a){let l=U.getLanguageId(t),c=U.getTokenType(t),p=U.containsBalancedBrackets(t)?1:0,u=U.getFontStyle(t),h=U.getForeground(t),d=U.getBackground(t);return n!==0&&(l=n),r!==8&&(c=r),i!==null&&(p=i?1:0),s!==-1&&(u=s),o!==0&&(h=o),a!==0&&(d=a),(l<<0|c<<8|p<<10|u<<11|h<<15|d<<24)>>>0}};function Ke(e,t){const n=[],r=gs(e);let i=r.next();for(;i!==null;){let l=0;if(i.length===2&&i.charAt(1)===":"){switch(i.charAt(0)){case"R":l=1;break;case"L":l=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let c=o();if(n.push({matcher:c,priority:l}),i!==",")break;i=r.next()}return n;function s(){if(i==="-"){i=r.next();const l=s();return c=>!!l&&!l(c)}if(i==="("){i=r.next();const l=a();return i===")"&&(i=r.next()),l}if(kn(i)){const l=[];do l.push(i),i=r.next();while(kn(i));return c=>t(l,c)}return null}function o(){const l=[];let c=s();for(;c;)l.push(c),c=s();return p=>l.every(u=>u(p))}function a(){const l=[];let c=o();for(;c&&(l.push(c),i==="|"||i===",");){do i=r.next();while(i==="|"||i===",");c=o()}return p=>l.some(u=>u(p))}}function kn(e){return!!e&&!!e.match(/[\w\.:]+/)}function gs(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;const r=n[0];return n=t.exec(e),r}}}function xr(e){typeof e.dispose=="function"&&e.dispose()}var Ae=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},ys=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},bs=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){const t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},ws=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new Ae(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const e=this.Q;this.Q=[];const t=new bs;for(const n of e)Cs(n,this.initialScopeName,this.repo,t);for(const n of t.references)if(n instanceof Ae){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 Cs(e,t,n,r){const i=n.lookup(e.scopeName);if(!i){if(e.scopeName===t)throw new Error(`No grammar provided for <${t}>`);return}const s=n.lookup(t);e instanceof Ae?We({baseGrammar:s,selfGrammar:i},r):Ut(e.ruleName,{baseGrammar:s,selfGrammar:i,repository:i.repository},r);const o=n.injections(e.scopeName);if(o)for(const a of o)r.add(new Ae(a))}function Ut(e,t,n){if(t.repository&&t.repository[e]){const r=t.repository[e];Qe([r],t,n)}}function We(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&Qe(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&Qe(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function Qe(e,t,n){for(const r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);const i=r.repository?yr({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&Qe(r.patterns,{...t,repository:i},n);const s=r.include;if(!s)continue;const o=Ar(s);switch(o.kind){case 0:We({...t,selfGrammar:t.baseGrammar},n);break;case 1:We(t,n);break;case 2:Ut(o.ruleName,{...t,repository:i},n);break;case 3:case 4:const a=o.scopeName===t.selfGrammar.scopeName?t.selfGrammar:o.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(a){const l={baseGrammar:t.baseGrammar,selfGrammar:a,repository:i};o.kind===4?Ut(o.ruleName,l,n):We(l,n)}else o.kind===4?n.add(new ys(o.scopeName,o.ruleName)):n.add(new Ae(o.scopeName));break}}}var _s=class{kind=0},Ss=class{kind=1},ks=class{constructor(e){this.ruleName=e}kind=2},vs=class{constructor(e){this.scopeName=e}kind=3},xs=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function Ar(e){if(e==="$base")return new _s;if(e==="$self")return new Ss;const t=e.indexOf("#");if(t===-1)return new vs(e);if(t===0)return new ks(e.substring(1));{const n=e.substring(0,t),r=e.substring(t+1);return new xs(n,r)}}var As=/\\(\d+)/,vn=/\\(\d+)/g,Es=-1,Er=-2;var Te=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=Ge.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=Ge.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${br(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:Ge.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:Ge.replaceCaptures(this._contentName,e,t)}},Ns=class extends Te{retokenizeCapturedWithRuleId;constructor(e,t,n,r,i){super(e,t,n,r),this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(e,t){throw new Error("Not supported!")}compile(e,t){throw new Error("Not supported!")}compileAG(e,t,n,r){throw new Error("Not supported!")}},Ls=class extends Te{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new Ee(r,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Ne,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},xn=class extends Te{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,r),this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(e,t){for(const n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Ne,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Ft=class extends Te{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i,s,o,a,l,c){super(e,t,n,r),this._begin=new Ee(i,this.id),this.beginCaptures=s,this._end=new Ee(o||"￿",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=a,this.applyEndPatternLast=l||!1,this.patterns=c.patterns,this.hasMissingPatterns=c.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,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,r)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Ne;for(const n of this.patterns)e.getRule(n).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,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},Je=class extends Te{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,r,i,s,o,a,l){super(e,t,n,r),this._begin=new Ee(i,this.id),this.beginCaptures=s,this.whileCaptures=a,this._while=new Ee(o,Er),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=l.patterns,this.hasMissingPatterns=l.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,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Ne;for(const t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,r)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new Ne,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||"￿"),this._cachedCompiledWhilePatterns}},Nr=class M{static createCaptureRule(t,n,r,i,s){return t.registerRule(o=>new Ns(n,o,r,i,s))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new Ls(t.$vscodeTextmateLocation,t.id,t.name,t.match,M._compileCaptures(t.captures,n,r));if(typeof t.begin>"u"){t.repository&&(r=yr({},r,t.repository));let s=t.patterns;return typeof s>"u"&&t.include&&(s=[{include:t.include}]),new xn(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,M._compilePatterns(s,n,r))}return t.while?new Je(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,M._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,M._compileCaptures(t.whileCaptures||t.captures,n,r),M._compilePatterns(t.patterns,n,r)):new Ft(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,M._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,M._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,M._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let i=[];if(t){let s=0;for(const o in t){if(o==="$vscodeTextmateLocation")continue;const a=parseInt(o,10);a>s&&(s=a)}for(let o=0;o<=s;o++)i[o]=null;for(const o in t){if(o==="$vscodeTextmateLocation")continue;const a=parseInt(o,10);let l=0;t[o].patterns&&(l=M.getCompiledRuleId(t[o],n,r)),i[a]=M.createCaptureRule(n,t[o].$vscodeTextmateLocation,t[o].name,t[o].contentName,l)}}return i}static _compilePatterns(t,n,r){let i=[];if(t)for(let s=0,o=t.length;s<o;s++){const a=t[s];let l=-1;if(a.include){const c=Ar(a.include);switch(c.kind){case 0:case 1:l=M.getCompiledRuleId(r[a.include],n,r);break;case 2:let p=r[c.ruleName];p&&(l=M.getCompiledRuleId(p,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 f=d.repository[h];f&&(l=M.getCompiledRuleId(f,n,d.repository))}else l=M.getCompiledRuleId(d.repository.$self,n,d.repository);break}}else l=M.getCompiledRuleId(a,n,r);if(l!==-1){const c=n.getRule(l);let p=!1;if((c instanceof xn||c instanceof Ft||c instanceof Je)&&c.hasMissingPatterns&&c.patterns.length===0&&(p=!0),p)continue;i.push(l)}}return{patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}}},Ee=class Lr{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(t,n){if(t&&typeof t=="string"){const r=t.length;let i=0,s=[],o=!1;for(let a=0;a<r;a++)if(t.charAt(a)==="\\"&&a+1<r){const c=t.charAt(a+1);c==="z"?(s.push(t.substring(i,a)),s.push("$(?!\\n)(?<!\\n)"),i=a+2):(c==="A"||c==="G")&&(o=!0),a++}this.hasAnchor=o,i===0?this.source=t:(s.push(t.substring(i,r)),this.source=s.join(""))}else this.hasAnchor=!1,this.source=t;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=n,typeof this.source=="string"?this.hasBackReferences=As.test(this.source):this.hasBackReferences=!1}clone(){return new Lr(this.source,this.ruleId)}setSource(t){this.source!==t&&(this.source=t,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(t,n){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let r=n.map(i=>t.substring(i.start,i.end));return vn.lastIndex=0,this.source.replace(vn,(i,s)=>_r(r[parseInt(s,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let t=[],n=[],r=[],i=[],s,o,a,l;for(s=0,o=this.source.length;s<o;s++)a=this.source.charAt(s),t[s]=a,n[s]=a,r[s]=a,i[s]=a,a==="\\"&&s+1<o&&(l=this.source.charAt(s+1),l==="A"?(t[s+1]="￿",n[s+1]="￿",r[s+1]="A",i[s+1]="A"):l==="G"?(t[s+1]="￿",n[s+1]="G",r[s+1]="￿",i[s+1]="G"):(t[s+1]=l,n[s+1]=l,r[s+1]=l,i[s+1]=l),s++);return{A0_G0:t.join(""),A0_G1:n.join(""),A1_G0:r.join(""),A1_G1:i.join("")}}resolveAnchors(t,n){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:t?n?this._anchorCache.A1_G1:this._anchorCache.A1_G0:n?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},Ne=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached.dispose(),this._cached=null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(n=>n.source);this._cached=new An(e,t,this._items.map(n=>n.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){let r=this._items.map(i=>i.resolveAnchors(t,n));return new An(e,r,this._items.map(i=>i.ruleId))}},An=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(" - "+this.rules[t]+": "+this.regExps[t]);return e.join(`
4
- `)}findNextMatchSync(e,t,n){const r=this.scanner.findNextMatchSync(e,t,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},vt=class{constructor(e,t){this.languageId=e,this.tokenType=t}},Rs=class jt{_defaultAttributes;_embeddedLanguagesMatcher;constructor(t,n){this._defaultAttributes=new vt(t,8),this._embeddedLanguagesMatcher=new Is(Object.entries(n||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?jt._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new vt(0,0);_getBasicScopeAttributes=new Sr(t=>{const n=this._scopeToLanguage(t),r=this._toStandardTokenType(t);return new vt(n,r)});_scopeToLanguage(t){return this._embeddedLanguagesMatcher.match(t)||0}_toStandardTokenType(t){const n=t.match(jt.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!")}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},Is=class{values;scopesRegExp;constructor(e){if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);const t=e.map(([n,r])=>_r(n));t.sort(),t.reverse(),this.scopesRegExp=new RegExp(`^((${t.join(")|(")}))($|\\.)`,"")}}match(e){if(!this.scopesRegExp)return;const t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}},En=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function Rr(e,t,n,r,i,s,o,a){const l=t.content.length;let c=!1,p=-1;if(o){const d=Ts(e,t,n,r,i,s);i=d.stack,r=d.linePos,n=d.isFirstLine,p=d.anchorPosition}const u=Date.now();for(;!c;){if(a!==0&&Date.now()-u>a)return new En(i,!0);h()}return new En(i,!1);function h(){const d=Ps(e,t,n,r,i,p);if(!d){s.produce(i,l),c=!0;return}const f=d.captureIndices,w=d.matchedRuleId,b=f&&f.length>0?f[0].end>r:!1;if(w===Es){const m=i.getRule(e);s.produce(i,f[0].start),i=i.withContentNameScopesList(i.nameScopesList),Se(e,t,n,i,s,m.endCaptures,f),s.produce(i,f[0].end);const g=i;if(i=i.parent,p=g.getAnchorPos(),!b&&g.getEnterPos()===r){i=g,s.produce(i,l),c=!0;return}}else{const m=e.getRule(w);s.produce(i,f[0].start);const g=i,C=m.getName(t.content,f),k=i.contentNameScopesList.pushAttributed(C,e);if(i=i.push(w,r,p,f[0].end===l,null,k,k),m instanceof Ft){const v=m;Se(e,t,n,i,s,v.beginCaptures,f),s.produce(i,f[0].end),p=f[0].end;const T=v.getContentName(t.content,f),G=k.pushAttributed(T,e);if(i=i.withContentNameScopesList(G),v.endHasBackReferences&&(i=i.withEndRule(v.getEndWithResolvedBackReferences(t.content,f))),!b&&g.hasSameRuleAs(i)){i=i.pop(),s.produce(i,l),c=!0;return}}else if(m instanceof Je){const v=m;Se(e,t,n,i,s,v.beginCaptures,f),s.produce(i,f[0].end),p=f[0].end;const T=v.getContentName(t.content,f),G=k.pushAttributed(T,e);if(i=i.withContentNameScopesList(G),v.whileHasBackReferences&&(i=i.withEndRule(v.getWhileWithResolvedBackReferences(t.content,f))),!b&&g.hasSameRuleAs(i)){i=i.pop(),s.produce(i,l),c=!0;return}}else if(Se(e,t,n,i,s,m.captures,f),s.produce(i,f[0].end),i=i.pop(),!b){i=i.safePop(),s.produce(i,l),c=!0;return}}f[0].end>r&&(r=f[0].end,n=!1)}}function Ts(e,t,n,r,i,s){let o=i.beginRuleCapturedEOL?0:-1;const a=[];for(let l=i;l;l=l.pop()){const c=l.getRule(e);c instanceof Je&&a.push({rule:c,stack:l})}for(let l=a.pop();l;l=a.pop()){const{ruleScanner:c,findOptions:p}=Os(l.rule,e,l.stack.endRule,n,r===o),u=c.findNextMatchSync(t,r,p);if(u){if(u.ruleId!==Er){i=l.stack.pop();break}u.captureIndices&&u.captureIndices.length&&(s.produce(l.stack,u.captureIndices[0].start),Se(e,t,n,l.stack,s,l.rule.whileCaptures,u.captureIndices),s.produce(l.stack,u.captureIndices[0].end),o=u.captureIndices[0].end,u.captureIndices[0].end>r&&(r=u.captureIndices[0].end,n=!1))}else{i=l.stack.pop();break}}return{stack:i,linePos:r,anchorPosition:o,isFirstLine:n}}function Ps(e,t,n,r,i,s){const o=$s(e,t,n,r,i,s),a=e.getInjections();if(a.length===0)return o;const l=Ms(a,e,t,n,r,i,s);if(!l)return o;if(!o)return l;const c=o.captureIndices[0].start,p=l.captureIndices[0].start;return p<c||l.priorityMatch&&p===c?l:o}function $s(e,t,n,r,i,s){const o=i.getRule(e),{ruleScanner:a,findOptions:l}=Ir(o,e,i.endRule,n,r===s),c=a.findNextMatchSync(t,r,l);return c?{captureIndices:c.captureIndices,matchedRuleId:c.ruleId}:null}function Ms(e,t,n,r,i,s,o){let a=Number.MAX_VALUE,l=null,c,p=0;const u=s.contentNameScopesList.getScopeNames();for(let h=0,d=e.length;h<d;h++){const f=e[h];if(!f.matcher(u))continue;const w=t.getRule(f.ruleId),{ruleScanner:b,findOptions:m}=Ir(w,t,null,r,i===o),g=b.findNextMatchSync(n,i,m);if(!g)continue;const C=g.captureIndices[0].start;if(!(C>=a)&&(a=C,l=g.captureIndices,c=g.ruleId,p=f.priority,a===i))break}return l?{priorityMatch:p===-1,captureIndices:l,matchedRuleId:c}:null}function Ir(e,t,n,r,i){return{ruleScanner:e.compileAG(t,n,r,i),findOptions:0}}function Os(e,t,n,r,i){return{ruleScanner:e.compileWhileAG(t,n,r,i),findOptions:0}}function Se(e,t,n,r,i,s,o){if(s.length===0)return;const a=t.content,l=Math.min(s.length,o.length),c=[],p=o[0].end;for(let u=0;u<l;u++){const h=s[u];if(h===null)continue;const d=o[u];if(d.length===0)continue;if(d.start>p)break;for(;c.length>0&&c[c.length-1].endPos<=d.start;)i.produceFromScopes(c[c.length-1].scopes,c[c.length-1].endPos),c.pop();if(c.length>0?i.produceFromScopes(c[c.length-1].scopes,d.start):i.produce(r,d.start),h.retokenizeCapturedWithRuleId){const w=h.getName(a,o),b=r.contentNameScopesList.pushAttributed(w,e),m=h.getContentName(a,o),g=b.pushAttributed(m,e),C=r.push(h.retokenizeCapturedWithRuleId,d.start,-1,!1,null,b,g),k=e.createOnigString(a.substring(0,d.end));Rr(e,k,n&&d.start===0,d.start,C,i,!1,0),xr(k);continue}const f=h.getName(a,o);if(f!==null){const b=(c.length>0?c[c.length-1].scopes:r.contentNameScopesList).pushAttributed(f,e);c.push(new Gs(b,d.end))}}for(;c.length>0;)i.produceFromScopes(c[c.length-1].scopes,c[c.length-1].endPos),c.pop()}var Gs=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function Bs(e,t,n,r,i,s,o,a){return new Us(e,t,n,r,i,s,o,a)}function Nn(e,t,n,r,i){const s=Ke(t,Ze),o=Nr.getCompiledRuleId(n,r,i.repository);for(const a of s)e.push({debugSelector:t,matcher:a.matcher,ruleId:o,grammar:i,priority:a.priority})}function Ze(e,t){if(t.length<e.length)return!1;let n=0;return e.every(r=>{for(let i=n;i<t.length;i++)if(Ds(t[i],r))return n=i+1,!0;return!1})}function Ds(e,t){if(!e)return!1;if(e===t)return!0;const n=t.length;return e.length>n&&e.substr(0,n)===t&&e[n]==="."}var Us=class{constructor(e,t,n,r,i,s,o,a){if(this._rootScopeName=e,this.balancedBracketSelectors=s,this._onigLib=a,this._basicScopeAttributesProvider=new Rs(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=Ln(t,null),this._injections=null,this._tokenTypeMatchers=[],i)for(const l of Object.keys(i)){const c=Ke(l,Ze);for(const p of c)this._tokenTypeMatchers.push({matcher:p.matcher,type:i[l]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(const e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){const e={lookup:i=>i===this._rootScopeName?this._grammar:this.getExternalGrammar(i),injections:i=>this._grammarRepository.injections(i)},t=[],n=this._rootScopeName,r=e.lookup(n);if(r){const i=r.injections;if(i)for(let o in i)Nn(t,o,i[o],this,r);const s=this._grammarRepository.injections(n);s&&s.forEach(o=>{const a=this.getExternalGrammar(o);if(a){const l=a.injectionSelector;l&&Nn(t,l,a,this,a)}})}return t.sort((i,s)=>i.priority-s.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){const t=++this._lastRuleId,n=e(t);return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[e]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){const n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=Ln(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){const r=this._tokenize(e,t,!1,n);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(e,t,n=0){const r=this._tokenize(e,t,!0,n);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(e,t,n,r){this._rootId===-1&&(this._rootId=Nr.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let i;if(!t||t===Ht.NULL){i=!0;const c=this._basicScopeAttributesProvider.getDefaultAttributes(),p=this.themeProvider.getDefaults(),u=ge.set(0,c.languageId,c.tokenType,null,p.fontStyle,p.foregroundId,p.backgroundId),h=this.getRule(this._rootId).getName(null,null);let d;h?d=ke.createRootAndLookUpScopeName(h,u,this):d=ke.createRoot("unknown",u),t=new Ht(null,this._rootId,-1,-1,!1,null,d,d)}else i=!1,t.reset();e=e+`
5
- `;const s=this.createOnigString(e),o=s.content.length,a=new js(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),l=Rr(this,s,i,0,t,a,!0,r);return xr(s),{lineLength:o,lineTokens:a,ruleStack:l.stack,stoppedEarly:l.stoppedEarly}}};function Ln(e,t){return e=ss(e),e.repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var ke=class V{constructor(t,n,r){this.parent=t,this.scopePath=n,this.tokenAttributes=r}static fromExtension(t,n){let r=t,i=t?.scopePath??null;for(const s of n)i=kt.push(i,s.scopeNames),r=new V(r,i,s.encodedTokenAttributes);return r}static createRoot(t,n){return new V(null,new kt(null,t),n)}static createRootAndLookUpScopeName(t,n,r){const i=r.getMetadataForScope(t),s=new kt(null,t),o=r.themeProvider.themeMatch(s),a=V.mergeAttributes(n,i,o);return new V(null,s,a)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return V.equals(this,t)}static equals(t,n){do{if(t===n||!t&&!n)return!0;if(!t||!n||t.scopeName!==n.scopeName||t.tokenAttributes!==n.tokenAttributes)return!1;t=t.parent,n=n.parent}while(!0)}static mergeAttributes(t,n,r){let i=-1,s=0,o=0;return r!==null&&(i=r.fontStyle,s=r.foregroundId,o=r.backgroundId),ge.set(t,n.languageId,n.tokenType,null,i,s,o)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(" ")===-1)return V._pushAttributed(this,t,n);const r=t.split(/ /g);let i=this;for(const s of r)i=V._pushAttributed(i,s,n);return i}static _pushAttributed(t,n,r){const i=r.getMetadataForScope(n),s=t.scopePath.push(n),o=r.themeProvider.themeMatch(s),a=V.mergeAttributes(t.tokenAttributes,i,o);return new V(t,s,a)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(t){const n=[];let r=this;for(;r&&r!==t;)n.push({encodedTokenAttributes:r.tokenAttributes,scopeNames:r.scopePath.getExtensionIfDefined(r.parent?.scopePath??null)}),r=r.parent;return r===t?n.reverse():void 0}},Ht=class re{constructor(t,n,r,i,s,o,a,l){this.parent=t,this.ruleId=n,this.beginRuleCapturedEOL=s,this.endRule=o,this.nameScopesList=a,this.contentNameScopesList=l,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=r,this._anchorPos=i}_stackElementBrand=void 0;static NULL=new re(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t===null?!1:re._equals(this,t)}static _equals(t,n){return t===n?!0:this._structuralEquals(t,n)?ke.equals(t.contentNameScopesList,n.contentNameScopesList):!1}static _structuralEquals(t,n){do{if(t===n||!t&&!n)return!0;if(!t||!n||t.depth!==n.depth||t.ruleId!==n.ruleId||t.endRule!==n.endRule)return!1;t=t.parent,n=n.parent}while(!0)}clone(){return this}static _reset(t){for(;t;)t._enterPos=-1,t._anchorPos=-1,t=t.parent}reset(){re._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,r,i,s,o,a){return new re(this,t,n,r,i,s,o,a)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(t){return t.getRule(this.ruleId)}toString(){const t=[];return this._writeString(t,0),"["+t.join(",")+"]"}_writeString(t,n){return this.parent&&(n=this.parent._writeString(t,n)),t[n++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,n}withContentNameScopesList(t){return this.contentNameScopesList===t?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,t)}withEndRule(t){return this.endRule===t?this:new re(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(t){let n=this;for(;n&&n._enterPos===t._enterPos;){if(n.ruleId===t.ruleId)return!0;n=n.parent}return!1}toStateStackFrame(){return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(t,n){const r=ke.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new re(t,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,ke.fromExtension(r,n.contentNameScopesList))}},Fs=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(n=>n==="*"?(this.allowAny=!0,[]):Ke(n,Ze).map(r=>r.matcher)),this.unbalancedBracketScopes=t.flatMap(n=>Ke(n,Ze).map(r=>r.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(const t of this.unbalancedBracketScopes)if(t(e))return!1;for(const t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},js=class{constructor(e,t,n,r){this.balancedBracketSelectors=r,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let r=e?.tokenAttributes??0,i=!1;if(this.balancedBracketSelectors?.matchesAlways&&(i=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const s=e?.getScopeNames()??[];for(const o of this._tokenTypeOverrides)o.matcher(s)&&(r=ge.set(r,0,o.type,null,-1,0,0));this.balancedBracketSelectors&&(i=this.balancedBracketSelectors.match(s))}if(i&&(r=ge.set(r,0,8,i,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===r){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(r),this._lastTokenEndIndex=t;return}const n=e?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:n}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);const n=new Uint32Array(this._binaryTokens.length);for(let r=0,i=this._binaryTokens.length;r<i;r++)n[r]=this._binaryTokens[r];return n}},Hs=class{constructor(e,t){this._onigLib=t,this._theme=e}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(const e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}grammarForScopeName(e,t,n,r,i){if(!this._grammars.has(e)){let s=this._rawGrammars.get(e);if(!s)return null;this._grammars.set(e,Bs(e,s,t,n,r,i,this,this._onigLib))}return this._grammars.get(e)}},Ws=class{_options;_syncRegistry;_ensureGrammarCache;constructor(t){this._options=t,this._syncRegistry=new Hs(Xe.createFromRawTheme(t.theme,t.colorMap),t.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(t,n){this._syncRegistry.setTheme(Xe.createFromRawTheme(t,n))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(t,n,r){return this.loadGrammarWithConfiguration(t,n,{embeddedLanguages:r})}loadGrammarWithConfiguration(t,n,r){return this._loadGrammar(t,n,r.embeddedLanguages,r.tokenTypes,new Fs(r.balancedBracketSelectors||[],r.unbalancedBracketSelectors||[]))}loadGrammar(t){return this._loadGrammar(t,0,null,null,null)}_loadGrammar(t,n,r,i,s){const o=new ws(this._syncRegistry,t);for(;o.Q.length>0;)o.Q.map(a=>this._loadSingleGrammar(a.scopeName)),o.processQueue();return this._grammarForScopeName(t,n,r,i,s)}_loadSingleGrammar(t){this._ensureGrammarCache.has(t)||(this._doLoadSingleGrammar(t),this._ensureGrammarCache.set(t,!0))}_doLoadSingleGrammar(t){const n=this._options.loadGrammar(t);if(n){const r=typeof this._options.getInjections=="function"?this._options.getInjections(t):void 0;this._syncRegistry.addGrammar(n,r)}}addGrammar(t,n=[],r=0,i=null){return this._syncRegistry.addGrammar(t,n),this._grammarForScopeName(t.scopeName,r,i)}_grammarForScopeName(t,n=0,r=null,i=null,s=null){return this._syncRegistry.grammarForScopeName(t,n,r,i,s)}},Wt=Ht.NULL;function Ye(e,t){const n=typeof e=="string"?{}:{...e.colorReplacements},r=typeof e=="string"?e:e.name;for(const[i,s]of Object.entries(t?.colorReplacements||{}))typeof s=="string"?n[i]=s:i===r&&Object.assign(n,s);return n}function te(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function zs(e){return Array.isArray(e)?e:[e]}async function Tr(e){return Promise.resolve(typeof e=="function"?e():e).then(t=>t.default||t)}function ct(e){return!e||["plaintext","txt","text","plain"].includes(e)}function Pr(e){return e==="ansi"||ct(e)}function ut(e){return e==="none"}function $r(e){return ut(e)}const Vs=/(\r?\n)/g;function pt(e,t=!1){if(e.length===0)return[["",0]];const n=e.split(Vs);let r=0;const i=[];for(let s=0;s<n.length;s+=2){const o=t?n[s]+(n[s+1]||""):n[s];i.push([o,r]),r+=n[s].length,r+=n[s+1]?.length||0}return i}const Rn={light:"#333333",dark:"#bbbbbb"},In={light:"#fffffe",dark:"#1e1e1e"},Tn="__shiki_resolved";function pn(e){if(e?.[Tn])return e;const t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||="dark",t.colorReplacements={...t.colorReplacements},t.settings||=[];let{bg:n,fg:r}=t;if(!n||!r){const a=t.settings?t.settings.find(l=>!l.name&&!l.scope):void 0;a?.settings?.foreground&&(r=a.settings.foreground),a?.settings?.background&&(n=a.settings.background),!r&&t?.colors?.["editor.foreground"]&&(r=t.colors["editor.foreground"]),!n&&t?.colors?.["editor.background"]&&(n=t.colors["editor.background"]),r||(r=t.type==="light"?Rn.light:Rn.dark),n||(n=t.type==="light"?In.light:In.dark),t.fg=r,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let i=0;const s=new Map;function o(a){if(s.has(a))return s.get(a);i+=1;const l=`#${i.toString(16).padStart(8,"0").toLowerCase()}`;return t.colorReplacements?.[`#${l}`]?o(a):(s.set(a,l),l)}t.settings=t.settings.map(a=>{const l=a.settings?.foreground&&!a.settings.foreground.startsWith("#"),c=a.settings?.background&&!a.settings.background.startsWith("#");if(!l&&!c)return a;const p={...a,settings:{...a.settings}};if(l){const u=o(a.settings.foreground);t.colorReplacements[u]=a.settings.foreground,p.settings.foreground=u}if(c){const u=o(a.settings.background);t.colorReplacements[u]=a.settings.background,p.settings.background=u}return p});for(const a of Object.keys(t.colors||{}))if((a==="editor.foreground"||a==="editor.background"||a.startsWith("terminal.ansi"))&&!t.colors[a]?.startsWith("#")){const l=o(t.colors[a]);t.colorReplacements[l]=t.colors[a],t.colors[a]=l}return Object.defineProperty(t,Tn,{enumerable:!1,writable:!1,value:!0}),t}async function Mr(e){return[...new Set((await Promise.all(e.filter(t=>!Pr(t)).map(async t=>await Tr(t).then(n=>Array.isArray(n)?n:[n])))).flat())]}async function Or(e){return(await Promise.all(e.map(async t=>$r(t)?null:pn(await Tr(t))))).filter(t=>!!t)}function Gr(e,t){if(!t)return e;if(t[e]){const n=new Set([e]);for(;t[e];){if(e=t[e],n.has(e))throw new A(`Circular alias \`${[...n].join(" -> ")} -> ${e}\``);n.add(e)}}return e}var qs=class extends Ws{_resolver;_themes;_langs;_alias;_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;constructor(e,t,n,r={}){super(e),this._resolver=e,this._themes=t,this._langs=n,this._alias=r,this._themes.map(i=>this.loadTheme(i)),this.loadLanguages(this._langs)}getTheme(e){return typeof e=="string"?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){const t=pn(e);return t.name&&(this._resolvedThemes.set(t.name,t),this._loadedThemesCache=null),t}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(e){let t=this._textmateThemeCache.get(e);t||(t=Xe.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=Gr(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;const t=new Set([...this._langMap.values()].filter(i=>i.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);const n={balancedBracketSelectors:e.balancedBracketSelectors||["*"],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);const r=this.loadGrammarWithConfiguration(e.scopeName,1,n);if(r.name=e.name,this._resolvedGrammars.set(e.name,r),e.aliases&&e.aliases.forEach(i=>{this._alias[i]=e.name}),this._loadedLanguagesCache=null,t.size)for(const i of t)this._resolvedGrammars.delete(i.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(i.scopeName),this._syncRegistry?._grammars?.delete(i.scopeName),this.loadLanguage(this._langMap.get(i.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(const r of e)this.resolveEmbeddedLanguages(r);const t=[...this._langGraph.entries()],n=t.filter(([r,i])=>!i);if(n.length){const r=t.filter(([i,s])=>s?(s.embeddedLanguages||s.embeddedLangs)?.some(o=>n.map(([a])=>a).includes(o)):!1).filter(i=>!n.includes(i));throw new A(`Missing languages ${n.map(([i])=>`\`${i}\``).join(", ")}, required by ${r.map(([i])=>`\`${i}\``).join(", ")}`)}for(const[r,i]of t)this._resolver.addLanguage(i);for(const[r,i]of t)this.loadLanguage(i)}getLoadedLanguages(){return this._loadedLanguagesCache||(this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])]),this._loadedLanguagesCache}resolveEmbeddedLanguages(e){this._langMap.set(e.name,e),this._langGraph.set(e.name,e);const t=e.embeddedLanguages??e.embeddedLangs;if(t)for(const n of t)this._langGraph.set(n,this._langMap.get(n))}},Xs=class{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,t){this._onigLib={createOnigScanner:n=>e.createScanner(n),createOnigString:n=>e.createString(n)},t.forEach(n=>this.addLanguage(n))}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(t=>{this._langs.set(t,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(t=>{this._injections.get(t)||this._injections.set(t,[]),this._injections.get(t).push(e.scopeName)})}getInjections(e){const t=e.split(".");let n=[];for(let r=1;r<=t.length;r++){const i=t.slice(0,r).join(".");n=[...n,...this._injections.get(i)||[]]}return n}};let _e=0;function Ks(e){_e+=1,e.warnings!==!1&&_e>=10&&_e%10===0&&console.warn(`[Shiki] ${_e} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let t=!1;if(!e.engine)throw new A("`engine` option is required for synchronous mode");const n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(pn),i=new qs(new Xs(e.engine,n),r,n,e.langAlias);let s;function o(g){return Gr(g,e.langAlias)}function a(g){b();const C=i.getGrammar(typeof g=="string"?g:g.name);if(!C)throw new A(`Language \`${g}\` not found, you may need to load it first`);return C}function l(g){if(g==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};b();const C=i.getTheme(g);if(!C)throw new A(`Theme \`${g}\` not found, you may need to load it first`);return C}function c(g){b();const C=l(g);return s!==g&&(i.setTheme(C),s=g),{theme:C,colorMap:i.getColorMap()}}function p(){return b(),i.getLoadedThemes()}function u(){return b(),i.getLoadedLanguages()}function h(...g){b(),i.loadLanguages(g.flat(1))}async function d(...g){return h(await Mr(g))}function f(...g){b();for(const C of g.flat(1))i.loadTheme(C)}async function w(...g){return b(),f(await Or(g))}function b(){if(t)throw new A("Shiki instance has been disposed")}function m(){t||(t=!0,i.dispose(),_e-=1)}return{setTheme:c,getTheme:l,getLanguage:a,getLoadedThemes:p,getLoadedLanguages:u,resolveLangAlias:o,loadLanguage:d,loadLanguageSync:h,loadTheme:w,loadThemeSync:f,dispose:m,[Symbol.dispose]:m}}async function Qs(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[t,n,r]=await Promise.all([Or(e.themes||[]),Mr(e.langs||[]),e.engine]);return Ks({...e,themes:t,langs:n,engine:r})}const Br=new WeakMap;function dt(e,t){Br.set(e,t)}function Le(e){return Br.get(e)}var ht=class Dr{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(t,n){return new Dr(Object.fromEntries(zs(n).map(r=>[r,Wt])),t)}constructor(...t){if(t.length===2){const[n,r]=t;this.lang=r,this._stacks=n}else{const[n,r,i]=t;this.lang=r,this._stacks={[i]:n}}}getInternalStack(t=this.theme){return this._stacks[t]}getScopes(t=this.theme){return Js(this._stacks[t])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function Js(e){const t=[],n=new Set;function r(i){if(n.has(i))return;n.add(i);const s=i?.nameScopesList?.scopeName;s&&t.push(s),i.parent&&r(i.parent)}return r(e),t}function Zs(e,t){if(!(e instanceof ht))throw new A("Invalid grammar state");return e.getInternalStack(t)}const Ys=/,/,eo=/ /;function Ur(e,t,n={}){const{theme:r=e.getLoadedThemes()[0]}=n;if(ct(e.resolveLangAlias(n.lang||"text"))||ut(r))return pt(t).map(a=>[{content:a[0],offset:a[1]}]);const{theme:i,colorMap:s}=e.setTheme(r),o=e.getLanguage(n.lang||"text");if(n.grammarState){if(n.grammarState.lang!==o.name)throw new A(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${o.name}"`);if(!n.grammarState.themes.includes(i.name))throw new A(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${i.name}"`)}return no(t,o,i,s,n)}function to(...e){if(e.length===2)return Le(e[1]);const[t,n,r={}]=e,{lang:i="text",theme:s=t.getLoadedThemes()[0]}=r;if(ct(i)||ut(s))throw new A("Plain language does not have grammar state");if(i==="ansi")throw new A("ANSI language does not have grammar state");const{theme:o,colorMap:a}=t.setTheme(s),l=t.getLanguage(i);return new ht(dn(n,l,o,a,r).stateStack,l.name,o.name)}function no(e,t,n,r,i){const s=dn(e,t,n,r,i),o=new ht(s.stateStack,t.name,n.name);return dt(s.tokens,o),s.tokens}function dn(e,t,n,r,i){const s=Ye(n,i),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:a=500}=i,l=pt(e);let c=i.grammarState?Zs(i.grammarState,n.name)??Wt:i.grammarContextCode!=null?dn(i.grammarContextCode,t,n,r,{...i,grammarState:void 0,grammarContextCode:void 0}).stateStack:Wt,p=[];const u=[];for(let h=0,d=l.length;h<d;h++){const[f,w]=l[h];if(f===""){p=[],u.push([]);continue}if(o>0&&f.length>=o){p=[],u.push([{content:f,offset:w,color:"",fontStyle:0}]);continue}let b,m,g;i.includeExplanation&&(b=t.tokenizeLine(f,c,a),m=b.tokens,g=0);const C=t.tokenizeLine2(f,c,a),k=C.tokens.length/2;for(let v=0;v<k;v++){const T=C.tokens[2*v],G=v+1<k?C.tokens[2*v+2]:f.length;if(T===G)continue;const q=C.tokens[2*v+1],Me=te(r[ge.getForeground(q)],s),wt=ge.getFontStyle(q),Ce={content:f.substring(T,G),offset:w+T,color:Me,fontStyle:wt};if(i.includeExplanation){const Z=[];if(i.includeExplanation!=="scopeName")for(const X of n.settings){let ce;switch(typeof X.scope){case"string":ce=X.scope.split(Ys).map(Ct=>Ct.trim());break;case"object":ce=X.scope;break;default:continue}Z.push({settings:X,selectors:ce.map(Ct=>Ct.split(eo))})}Ce.explanation=[];let _n=0;for(;T+_n<G;){const X=m[g],ce=f.substring(X.startIndex,X.endIndex);_n+=ce.length,Ce.explanation.push({content:ce,scopes:i.includeExplanation==="scopeName"?ro(X.scopes):io(Z,X.scopes)}),g+=1}}p.push(Ce)}u.push(p),p=[],c=C.ruleStack}return{tokens:u,stateStack:c}}function ro(e){return e.map(t=>({scopeName:t}))}function io(e,t){const n=[];for(let r=0,i=t.length;r<i;r++){const s=t[r];n[r]={scopeName:s,themeMatches:oo(e,s,t.slice(0,r))}}return n}function Pn(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]==="."}function so(e,t,n){if(!Pn(e.at(-1),t))return!1;let r=e.length-2,i=n.length-1;for(;r>=0&&i>=0;)Pn(e[r],n[i])&&(r-=1),i-=1;return r===-1}function oo(e,t,n){const r=[];for(const{selectors:i,settings:s}of e)for(const o of i)if(so(o,t,n)){r.push(s);break}return r}function Fr(e,t,n,r=Ur){const i=Object.entries(n.themes).filter(c=>c[1]).map(c=>({color:c[0],theme:c[1]})),s=i.map(c=>{const p=r(e,t,{...n,theme:c.theme});return{tokens:p,state:Le(p),theme:typeof c.theme=="string"?c.theme:c.theme.name}}),o=ao(...s.map(c=>c.tokens)),a=o[0].map((c,p)=>c.map((u,h)=>{const d={content:u.content,variants:{},offset:u.offset};return"includeExplanation"in n&&n.includeExplanation&&(d.explanation=u.explanation),o.forEach((f,w)=>{const{content:b,explanation:m,offset:g,...C}=f[p][h];d.variants[i[w].color]=C}),d})),l=s[0].state?new ht(Object.fromEntries(s.map(c=>[c.theme,c.state?.getInternalStack(c.theme)])),s[0].state.lang):void 0;return l&&dt(a,l),a}function ao(...e){const t=e.map(()=>[]),n=e.length;for(let r=0;r<e[0].length;r++){const i=e.map(l=>l[r]),s=t.map(()=>[]);t.forEach((l,c)=>l.push(s[c]));const o=i.map(()=>0),a=i.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 p=a[c];p.content.length===l?(s[c].push(p),o[c]+=1,a[c]=i[c][o[c]]):(s[c].push({...p,content:p.content.slice(0,l)}),a[c]={...p,content:p.content.slice(l),offset:p.offset+l})}}}return t}const lo=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class Pe{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Pe.prototype.normal={};Pe.prototype.property={};Pe.prototype.space=void 0;function jr(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Pe(n,r,t)}function zt(e){return e.toLowerCase()}class B{constructor(t,n){this.attribute=n,this.property=t}}B.prototype.attribute="";B.prototype.booleanish=!1;B.prototype.boolean=!1;B.prototype.commaOrSpaceSeparated=!1;B.prototype.commaSeparated=!1;B.prototype.defined=!1;B.prototype.mustUseProperty=!1;B.prototype.number=!1;B.prototype.overloadedBoolean=!1;B.prototype.property="";B.prototype.spaceSeparated=!1;B.prototype.space=void 0;let co=0;const S=le(),N=le(),Vt=le(),y=le(),x=le(),fe=le(),D=le();function le(){return 2**++co}var qt=Object.freeze({__proto__:null,boolean:S,booleanish:N,commaOrSpaceSeparated:D,commaSeparated:fe,number:y,overloadedBoolean:Vt,spaceSeparated:x});const xt=Object.keys(qt);class hn extends B{constructor(t,n,r,i){let s=-1;if(super(t,n),$n(this,"space",i),typeof r=="number")for(;++s<xt.length;){const o=xt[s];$n(this,xt[s],(r&qt[o])===qt[o])}}}hn.prototype.defined=!0;function $n(e,t,n){n&&(e[t]=n)}function ye(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const s=new hn(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),t[r]=s,n[zt(r)]=r,n[zt(s.attribute)]=r}return new Pe(t,n,e.space)}const Hr=ye({properties:{ariaActiveDescendant:null,ariaAtomic:N,ariaAutoComplete:null,ariaBusy:N,ariaChecked:N,ariaColCount:y,ariaColIndex:y,ariaColSpan:y,ariaControls:x,ariaCurrent:null,ariaDescribedBy:x,ariaDetails:null,ariaDisabled:N,ariaDropEffect:x,ariaErrorMessage:null,ariaExpanded:N,ariaFlowTo:x,ariaGrabbed:N,ariaHasPopup:null,ariaHidden:N,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:x,ariaLevel:y,ariaLive:null,ariaModal:N,ariaMultiLine:N,ariaMultiSelectable:N,ariaOrientation:null,ariaOwns:x,ariaPlaceholder:null,ariaPosInSet:y,ariaPressed:N,ariaReadOnly:N,ariaRelevant:null,ariaRequired:N,ariaRoleDescription:x,ariaRowCount:y,ariaRowIndex:y,ariaRowSpan:y,ariaSelected:N,ariaSetSize:y,ariaSort:null,ariaValueMax:y,ariaValueMin:y,ariaValueNow:y,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Wr(e,t){return t in e?e[t]:t}function zr(e,t){return Wr(e,t.toLowerCase())}const uo=ye({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:fe,acceptCharset:x,accessKey:x,action:null,allow:null,allowFullScreen:S,allowPaymentRequest:S,allowUserMedia:S,alt:null,as:null,async:S,autoCapitalize:null,autoComplete:x,autoFocus:S,autoPlay:S,blocking:x,capture:null,charSet:null,checked:S,cite:null,className:x,cols:y,colSpan:null,content:null,contentEditable:N,controls:S,controlsList:x,coords:y|fe,crossOrigin:null,data:null,dateTime:null,decoding:null,default:S,defer:S,dir:null,dirName:null,disabled:S,download:Vt,draggable:N,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:S,formTarget:null,headers:x,height:y,hidden:Vt,high:y,href:null,hrefLang:null,htmlFor:x,httpEquiv:x,id:null,imageSizes:null,imageSrcSet:null,inert:S,inputMode:null,integrity:null,is:null,isMap:S,itemId:null,itemProp:x,itemRef:x,itemScope:S,itemType:x,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:S,low:y,manifest:null,max:null,maxLength:y,media:null,method:null,min:null,minLength:y,multiple:S,muted:S,name:null,nonce:null,noModule:S,noValidate:S,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:S,optimum:y,pattern:null,ping:x,placeholder:null,playsInline:S,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:S,referrerPolicy:null,rel:x,required:S,reversed:S,rows:y,rowSpan:y,sandbox:x,scope:null,scoped:S,seamless:S,selected:S,shadowRootClonable:S,shadowRootDelegatesFocus:S,shadowRootMode:null,shape:null,size:y,sizes:null,slot:null,span:y,spellCheck:N,src:null,srcDoc:null,srcLang:null,srcSet:null,start:y,step:null,style:null,tabIndex:y,target:null,title:null,translate:null,type:null,typeMustMatch:S,useMap:null,value:N,width:y,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:x,axis:null,background:null,bgColor:null,border:y,borderColor:null,bottomMargin:y,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:S,declare:S,event:null,face:null,frame:null,frameBorder:null,hSpace:y,leftMargin:y,link:null,longDesc:null,lowSrc:null,marginHeight:y,marginWidth:y,noResize:S,noHref:S,noShade:S,noWrap:S,object:null,profile:null,prompt:null,rev:null,rightMargin:y,rules:null,scheme:null,scrolling:N,standby:null,summary:null,text:null,topMargin:y,valueType:null,version:null,vAlign:null,vLink:null,vSpace:y,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:S,disableRemotePlayback:S,prefix:null,property:null,results:y,security:null,unselectable:null},space:"html",transform:zr}),po=ye({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:D,accentHeight:y,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:y,amplitude:y,arabicForm:null,ascent:y,attributeName:null,attributeType:null,azimuth:y,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:y,by:null,calcMode:null,capHeight:y,className:x,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:y,diffuseConstant:y,direction:null,display:null,dur:null,divisor:y,dominantBaseline:null,download:S,dx:null,dy:null,edgeMode:null,editable:null,elevation:y,enableBackground:null,end:null,event:null,exponent:y,externalResourcesRequired:null,fill:null,fillOpacity:y,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:fe,g2:fe,glyphName:fe,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:y,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:y,horizOriginX:y,horizOriginY:y,id:null,ideographic:y,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:y,k:y,k1:y,k2:y,k3:y,k4:y,kernelMatrix:D,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:y,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:y,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:y,overlineThickness:y,paintOrder:null,panose1:null,path:null,pathLength:y,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:x,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:y,pointsAtY:y,pointsAtZ:y,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:D,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:D,rev:D,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:D,requiredFeatures:D,requiredFonts:D,requiredFormats:D,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:y,specularExponent:y,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:y,strikethroughThickness:y,string:null,stroke:null,strokeDashArray:D,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:y,strokeOpacity:y,strokeWidth:null,style:null,surfaceScale:y,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:D,tabIndex:y,tableValues:null,target:null,targetX:y,targetY:y,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:D,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:y,underlineThickness:y,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:y,values:null,vAlphabetic:y,vMathematical:y,vectorEffect:null,vHanging:y,vIdeographic:y,version:null,vertAdvY:y,vertOriginX:y,vertOriginY:y,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:y,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Wr}),Vr=ye({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),qr=ye({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:zr}),Xr=ye({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),ho=/[A-Z]/g,Mn=/-[a-z]/g,fo=/^data[-\w.:]+$/i;function mo(e,t){const n=zt(t);let r=t,i=B;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&fo.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(Mn,yo);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!Mn.test(s)){let o=s.replace(ho,go);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=hn}return new i(r,t)}function go(e){return"-"+e.toLowerCase()}function yo(e){return e.charAt(1).toUpperCase()}const bo=jr([Hr,uo,Vr,qr,Xr],"html"),Kr=jr([Hr,po,Vr,qr,Xr],"svg"),On={}.hasOwnProperty;function wo(e,t){const n=t||{};function r(i,...s){let o=r.invalid;const a=r.handlers;if(i&&On.call(i,e)){const l=String(i[e]);o=On.call(a,l)?a[l]:r.unknown}if(o)return o.call(this,i,...s)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const Co=/["&'<>`]/g,_o=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,So=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,ko=/[|\\{}()[\]^$+*?.]/g,Gn=new WeakMap;function vo(e,t){if(e=e.replace(t.subset?xo(t.subset):Co,r),t.subset||t.escapeOnly)return e;return e.replace(_o,n).replace(So,r);function n(i,s,o){return t.format((i.charCodeAt(0)-55296)*1024+i.charCodeAt(1)-56320+65536,o.charCodeAt(s+2),t)}function r(i,s,o){return t.format(i.charCodeAt(0),o.charCodeAt(s+1),t)}}function xo(e){let t=Gn.get(e);return t||(t=Ao(e),Gn.set(e,t)),t}function Ao(e){const t=[];let n=-1;for(;++n<e.length;)t.push(e[n].replace(ko,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}const Eo=/[\dA-Fa-f]/;function No(e,t,n){const r="&#x"+e.toString(16).toUpperCase();return n&&t&&!Eo.test(String.fromCharCode(t))?r:r+";"}const Lo=/\d/;function Ro(e,t,n){const r="&#"+String(e);return n&&t&&!Lo.test(String.fromCharCode(t))?r:r+";"}const Io=["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"],At={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:"€"},To=["cent","copy","divide","gt","lt","not","para","times"],Qr={}.hasOwnProperty,Xt={};let Be;for(Be in At)Qr.call(At,Be)&&(Xt[At[Be]]=Be);const Po=/[^\dA-Za-z]/;function $o(e,t,n,r){const i=String.fromCharCode(e);if(Qr.call(Xt,i)){const s=Xt[i],o="&"+s;return n&&Io.includes(s)&&!To.includes(s)&&(!r||t&&t!==61&&Po.test(String.fromCharCode(t)))?o:o+";"}return""}function Mo(e,t,n){let r=No(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=$o(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){const s=Ro(e,t,n.omitOptionalSemicolons);s.length<r.length&&(r=s)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}function me(e,t){return vo(e,Object.assign({format:Mo},t))}const Oo=/^>|^->|<!--|-->|--!>|<!-$/g,Go=[">"],Bo=["<",">"];function Do(e,t,n,r){return r.settings.bogusComments?"<?"+me(e.value,Object.assign({},r.settings.characterReferences,{subset:Go}))+">":"<!--"+e.value.replace(Oo,i)+"-->";function i(s){return me(s,Object.assign({},r.settings.characterReferences,{subset:Bo}))}}function Uo(e,t,n,r){return"<!"+(r.settings.upperDoctype?"DOCTYPE":"doctype")+(r.settings.tightDoctype?"":" ")+"html>"}function Bn(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function Fo(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function jo(e){return e.join(" ").trim()}const Ho=/[ \t\n\f\r]/g;function fn(e){return typeof e=="object"?e.type==="text"?Dn(e.value):!1:Dn(e)}function Dn(e){return e.replace(Ho,"")===""}const I=Zr(1),Jr=Zr(-1),Wo=[];function Zr(e){return t;function t(n,r,i){const s=n?n.children:Wo;let o=(r||0)+e,a=s[o];if(!i)for(;a&&fn(a);)o+=e,a=s[o];return a}}const zo={}.hasOwnProperty;function Yr(e){return t;function t(n,r,i){return zo.call(e,n.tagName)&&e[n.tagName](n,r,i)}}const mn=Yr({body:qo,caption:Et,colgroup:Et,dd:Jo,dt:Qo,head:Et,html:Vo,li:Ko,optgroup:Zo,option:Yo,p:Xo,rp:Un,rt:Un,tbody:ta,td:Fn,tfoot:na,th:Fn,thead:ea,tr:ra});function Et(e,t,n){const r=I(n,t,!0);return!r||r.type!=="comment"&&!(r.type==="text"&&fn(r.value.charAt(0)))}function Vo(e,t,n){const r=I(n,t);return!r||r.type!=="comment"}function qo(e,t,n){const r=I(n,t);return!r||r.type!=="comment"}function Xo(e,t,n){const r=I(n,t);return r?r.type==="element"&&(r.tagName==="address"||r.tagName==="article"||r.tagName==="aside"||r.tagName==="blockquote"||r.tagName==="details"||r.tagName==="div"||r.tagName==="dl"||r.tagName==="fieldset"||r.tagName==="figcaption"||r.tagName==="figure"||r.tagName==="footer"||r.tagName==="form"||r.tagName==="h1"||r.tagName==="h2"||r.tagName==="h3"||r.tagName==="h4"||r.tagName==="h5"||r.tagName==="h6"||r.tagName==="header"||r.tagName==="hgroup"||r.tagName==="hr"||r.tagName==="main"||r.tagName==="menu"||r.tagName==="nav"||r.tagName==="ol"||r.tagName==="p"||r.tagName==="pre"||r.tagName==="section"||r.tagName==="table"||r.tagName==="ul"):!n||!(n.type==="element"&&(n.tagName==="a"||n.tagName==="audio"||n.tagName==="del"||n.tagName==="ins"||n.tagName==="map"||n.tagName==="noscript"||n.tagName==="video"))}function Ko(e,t,n){const r=I(n,t);return!r||r.type==="element"&&r.tagName==="li"}function Qo(e,t,n){const r=I(n,t);return!!(r&&r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd"))}function Jo(e,t,n){const r=I(n,t);return!r||r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd")}function Un(e,t,n){const r=I(n,t);return!r||r.type==="element"&&(r.tagName==="rp"||r.tagName==="rt")}function Zo(e,t,n){const r=I(n,t);return!r||r.type==="element"&&r.tagName==="optgroup"}function Yo(e,t,n){const r=I(n,t);return!r||r.type==="element"&&(r.tagName==="option"||r.tagName==="optgroup")}function ea(e,t,n){const r=I(n,t);return!!(r&&r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot"))}function ta(e,t,n){const r=I(n,t);return!r||r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot")}function na(e,t,n){return!I(n,t)}function ra(e,t,n){const r=I(n,t);return!r||r.type==="element"&&r.tagName==="tr"}function Fn(e,t,n){const r=I(n,t);return!r||r.type==="element"&&(r.tagName==="td"||r.tagName==="th")}const ia=Yr({body:aa,colgroup:la,head:oa,html:sa,tbody:ca});function sa(e){const t=I(e,-1);return!t||t.type!=="comment"}function oa(e){const t=new Set;for(const r of e.children)if(r.type==="element"&&(r.tagName==="base"||r.tagName==="title")){if(t.has(r.tagName))return!1;t.add(r.tagName)}const n=e.children[0];return!n||n.type==="element"}function aa(e){const t=I(e,-1,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&fn(t.value.charAt(0)))&&!(t.type==="element"&&(t.tagName==="meta"||t.tagName==="link"||t.tagName==="script"||t.tagName==="style"||t.tagName==="template"))}function la(e,t,n){const r=Jr(n,t),i=I(e,-1,!0);return n&&r&&r.type==="element"&&r.tagName==="colgroup"&&mn(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="col")}function ca(e,t,n){const r=Jr(n,t),i=I(e,-1);return n&&r&&r.type==="element"&&(r.tagName==="thead"||r.tagName==="tbody")&&mn(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="tr")}const De={name:[[`
6
- \f\r &/=>`.split(""),`
7
- \f\r "&'/=>\``.split("")],[`\0
8
- \f\r "&'/<=>`.split(""),`\0
9
- \f\r "&'/<=>\``.split("")]],unquoted:[[`
10
- \f\r &>`.split(""),`\0
11
- \f\r "&'<=>\``.split("")],[`\0
12
- \f\r "&'<=>\``.split(""),`\0
13
- \f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function ua(e,t,n,r){const i=r.schema,s=i.space==="svg"?!1:r.settings.omitOptionalTags;let o=i.space==="svg"?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase());const a=[];let l;i.space==="html"&&e.tagName==="svg"&&(r.schema=Kr);const c=pa(r,e.properties),p=r.all(i.space==="html"&&e.tagName==="template"?e.content:e);return r.schema=i,p&&(o=!1),(c||!s||!ia(e,t,n))&&(a.push("<",e.tagName,c?" "+c:""),o&&(i.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(p),!o&&(!s||!mn(e,t,n))&&a.push("</"+e.tagName+">"),a.join("")}function pa(e,t){const n=[];let r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){const s=da(e,i,t[i]);s&&n.push(s)}}for(;++r<n.length;){const s=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&s!=='"'&&s!=="'"&&(n[r]+=" ")}return n.join("")}function da(e,t,n){const r=mo(e.schema,t),i=e.settings.allowParseErrors&&e.schema.space==="html"?0:1,s=e.settings.allowDangerousCharacters?0:1;let o=e.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=me(r.attribute,Object.assign({},e.settings.characterReferences,{subset:De.name[i][s]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?Fo:jo)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?l:(e.settings.preferUnquoted&&(a=me(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:De.unquoted[i][s]}))),a!==n&&(e.settings.quoteSmart&&Bn(n,o)>Bn(n,e.alternative)&&(o=e.alternative),a=o+me(n,Object.assign({},e.settings.characterReferences,{subset:(o==="'"?De.single:De.double)[i][s],attribute:!0}))+o),l+(a&&"="+a))}const ha=["<","&"];function ei(e,t,n,r){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?e.value:me(e.value,Object.assign({},r.settings.characterReferences,{subset:ha}))}function fa(e,t,n,r){return r.settings.allowDangerousHtml?e.value:ei(e,t,n,r)}function ma(e,t,n,r){return r.all(e)}const ga=wo("type",{invalid:ya,unknown:ba,handlers:{comment:Do,doctype:Uo,element:ua,raw:fa,root:ma,text:ei}});function ya(e){throw new Error("Expected node, not `"+e+"`")}function ba(e){const t=e;throw new Error("Cannot compile unknown node `"+t.type+"`")}const wa={},Ca={},_a=[];function Sa(e,t){const n=t||wa,r=n.quote||'"',i=r==='"'?"'":'"';if(r!=='"'&&r!=="'")throw new Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:ka,all:va,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||lo,characterReferences:n.characterReferences||Ca,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?Kr:bo,quote:r,alternative:i}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}function ka(e,t,n){return ga(e,t,n,this)}function va(e){const t=[],n=e&&e.children||_a;let r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join("")}const jn=/\s+/g;function ti(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class=="string"&&(e.properties.class=e.properties.class.split(jn)),Array.isArray(e.properties.class)||(e.properties.class=[]);const n=Array.isArray(t)?t:t.split(jn);for(const r of n)r&&!e.properties.class.includes(r)&&e.properties.class.push(r);return e}const xa=/:?lang=["']([^"']+)["']/g,Aa=/(?:```|~~~)([\w-]+)/g,Ea=/\\begin\{([\w-]+)\}/g,Na=/<script\s+(?:type|lang)=["']([^"']+)["']/gi;function La(e){const t=pt(e,!0).map(([i])=>i);function n(i){if(i===e.length)return{line:t.length-1,character:t.at(-1).length};let s=i,o=0;for(const a of t){if(s<a.length)break;s-=a.length,o++}return{line:o,character:s}}function r(i,s){let o=0;for(let a=0;a<i;a++)o+=t[a].length;return o+=s,o}return{lines:t,indexToPos:n,posToIndex:r}}function Ra(e,t,n){const r=new Set;for(const s of e.matchAll(xa)){const o=s[1].toLowerCase().trim();o&&r.add(o)}for(const s of e.matchAll(Aa)){const o=s[1].toLowerCase().trim();o&&r.add(o)}for(const s of e.matchAll(Ea)){const o=s[1].toLowerCase().trim();o&&r.add(o)}for(const s of e.matchAll(Na)){const o=s[1].toLowerCase().trim(),a=o.includes("/")?o.split("/").pop():o;a&&r.add(a)}if(!n)return[...r];const i=n.getBundledLanguages();return[...r].filter(s=>s&&i[s])}const Ia=["color","background-color"];function Ta(e,t){let n=0;const r=[];for(const i of t)i>n&&r.push({...e,content:e.content.slice(n,i),offset:e.offset+n}),n=i;return n<e.content.length&&r.push({...e,content:e.content.slice(n),offset:e.offset+n}),r}function Pa(e,t){const n=[...t instanceof Set?t:new Set(t)].sort((r,i)=>r-i);return n.length?e.map(r=>r.flatMap(i=>{const s=n.filter(o=>i.offset<o&&o<i.offset+i.content.length).map(o=>o-i.offset).sort((o,a)=>o-a);return s.length?Ta(i,s):i})):e}function $a(e,t,n,r,i="css-vars"){const s={content:e.content,explanation:e.explanation,offset:e.offset},o=t.map(p=>Re(e.variants[p])),a=new Set(o.flatMap(p=>Object.keys(p))),l={},c=(p,u)=>{const h=u==="color"?"":u==="background-color"?"-bg":`-${u}`;return n+t[p]+(u==="color"?"":h)};return o.forEach((p,u)=>{for(const h of a){const d=p[h]||"inherit";if(u===0&&r&&Ia.includes(h))if(r==="light-dark()"&&o.length>1){const f=t.findIndex(b=>b==="light"),w=t.findIndex(b=>b==="dark");if(f===-1||w===-1)throw new A('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');l[h]=`light-dark(${o[f][h]||"inherit"}, ${o[w][h]||"inherit"})`,i==="css-vars"&&(l[c(u,h)]=d)}else l[h]=d;else i==="css-vars"&&(l[c(u,h)]=d)}}),s.htmlStyle=l,s}function Re(e){const t={};if(e.color&&(t.color=e.color),e.bgColor&&(t["background-color"]=e.bgColor),e.fontStyle){e.fontStyle&O.Italic&&(t["font-style"]="italic"),e.fontStyle&O.Bold&&(t["font-weight"]="bold");const n=[];e.fontStyle&O.Underline&&n.push("underline"),e.fontStyle&O.Strikethrough&&n.push("line-through"),n.length&&(t["text-decoration"]=n.join(" "))}return t}function et(e){return typeof e=="string"?e:Object.entries(e).map(([t,n])=>`${t}:${n}`).join(";")}function Ma(){const e=new WeakMap;function t(n){if(!e.has(n.meta)){let s=function(a){if(typeof a=="number"){if(a<0||a>n.source.length)throw new A(`Invalid decoration offset: ${a}. Code length: ${n.source.length}`);return{...i.indexToPos(a),offset:a}}else{const l=i.lines[a.line];if(l===void 0)throw new A(`Invalid decoration position ${JSON.stringify(a)}. Lines length: ${i.lines.length}`);let c=a.character;if(c<0&&(c=l.length+c),c<0||c>l.length)throw new A(`Invalid decoration position ${JSON.stringify(a)}. Line ${a.line} length: ${l.length}`);return{...a,character:c,offset:i.posToIndex(a.line,c)}}};var r=s;const i=La(n.source),o=(n.options.decorations||[]).map(a=>({...a,start:s(a.start),end:s(a.end)}));Oa(o),e.set(n.meta,{decorations:o,converter:i,source:n.source})}return e.get(n.meta)}return{name:"shiki:decorations",tokens(n){if(this.options.decorations?.length)return Pa(n,t(this).decorations.flatMap(r=>[r.start.offset,r.end.offset]))},code(n){if(!this.options.decorations?.length)return;const r=t(this),i=[...n.children].filter(p=>p.type==="element"&&p.tagName==="span");if(i.length!==r.converter.lines.length)throw new A(`Number of lines in code element (${i.length}) does not match the number of lines in the source (${r.converter.lines.length}). Failed to apply decorations.`);function s(p,u,h,d){const f=i[p];let w="",b=-1,m=-1;if(u===0&&(b=0),h===0&&(m=0),h===Number.POSITIVE_INFINITY&&(m=f.children.length),b===-1||m===-1)for(let C=0;C<f.children.length;C++)w+=ni(f.children[C]),b===-1&&w.length===u&&(b=C+1),m===-1&&w.length===h&&(m=C+1);if(b===-1)throw new A(`Failed to find start index for decoration ${JSON.stringify(d.start)}`);if(m===-1)throw new A(`Failed to find end index for decoration ${JSON.stringify(d.end)}`);const g=f.children.slice(b,m);if(!d.alwaysWrap&&g.length===f.children.length)a(f,d,"line");else if(!d.alwaysWrap&&g.length===1&&g[0].type==="element")a(g[0],d,"token");else{const C={type:"element",tagName:"span",properties:{},children:g};a(C,d,"wrapper"),f.children.splice(b,g.length,C)}}function o(p,u){i[p]=a(i[p],u,"line")}function a(p,u,h){const d=u.properties||{},f=u.transform||(w=>w);return p.tagName=u.tagName||"span",p.properties={...p.properties,...d,class:p.properties.class},u.properties?.class&&ti(p,u.properties.class),p=f(p,h)||p,p}const l=[],c=r.decorations.sort((p,u)=>u.start.offset-p.start.offset||p.end.offset-u.end.offset);for(const p of c){const{start:u,end:h}=p;if(u.line===h.line)s(u.line,u.character,h.character,p);else if(u.line<h.line){s(u.line,u.character,Number.POSITIVE_INFINITY,p);for(let d=u.line+1;d<h.line;d++)l.unshift(()=>o(d,p));s(h.line,0,h.character,p)}}l.forEach(p=>p())}}}function Oa(e){for(let t=0;t<e.length;t++){const n=e[t];if(n.start.offset>n.end.offset)throw new A(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let r=t+1;r<e.length;r++){const i=e[r],s=n.start.offset<=i.start.offset&&i.start.offset<n.end.offset,o=n.start.offset<i.end.offset&&i.end.offset<=n.end.offset,a=i.start.offset<=n.start.offset&&n.start.offset<i.end.offset,l=i.start.offset<n.end.offset&&n.end.offset<=i.end.offset;if(s||o||a||l){if(s&&o||a&&l||a&&n.start.offset===n.end.offset||o&&i.start.offset===i.end.offset)continue;throw new A(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(i.start)} intersect.`)}}}}function ni(e){return e.type==="text"?e.value:e.type==="element"?e.children.map(ni).join(""):""}const Ga=[Ma()];function tt(e){const t=Ba(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...Ga]}function Ba(e){const t=[],n=[],r=[];for(const i of e)switch(i.enforce){case"pre":t.push(i);break;case"post":n.push(i);break;default:r.push(i)}return{pre:t,post:n,normal:r}}var se=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],Nt={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function Da(e,t){const n=e.indexOf("\x1B",t);if(n!==-1&&e[n+1]==="["){const r=e.indexOf("m",n);if(r!==-1)return{sequence:e.substring(n+2,r).split(";"),startPosition:n,position:r+1}}return{position:e.length}}function Hn(e){const t=e.shift();if(t==="2"){const n=e.splice(0,3).map(r=>Number.parseInt(r));return n.length!==3||n.some(r=>Number.isNaN(r))?void 0:{type:"rgb",rgb:n}}else if(t==="5"){const n=e.shift();if(n)return{type:"table",index:Number(n)}}}function Ua(e){const t=[];for(;e.length>0;){const n=e.shift();if(!n)continue;const r=Number.parseInt(n);if(!Number.isNaN(r))if(r===0)t.push({type:"resetAll"});else if(r<=9)Nt[r]&&t.push({type:"setDecoration",value:Nt[r]});else if(r<=29){const i=Nt[r-20];i&&(t.push({type:"resetDecoration",value:i}),i==="dim"&&t.push({type:"resetDecoration",value:"bold"}))}else if(r<=37)t.push({type:"setForegroundColor",value:{type:"named",name:se[r-30]}});else if(r===38){const i=Hn(e);i&&t.push({type:"setForegroundColor",value:i})}else if(r===39)t.push({type:"resetForegroundColor"});else if(r<=47)t.push({type:"setBackgroundColor",value:{type:"named",name:se[r-40]}});else if(r===48){const i=Hn(e);i&&t.push({type:"setBackgroundColor",value:i})}else r===49?t.push({type:"resetBackgroundColor"}):r===53?t.push({type:"setDecoration",value:"overline"}):r===55?t.push({type:"resetDecoration",value:"overline"}):r>=90&&r<=97?t.push({type:"setForegroundColor",value:{type:"named",name:se[r-90+8]}}):r>=100&&r<=107&&t.push({type:"setBackgroundColor",value:{type:"named",name:se[r-100+8]}})}return t}function Fa(){let e=null,t=null,n=new Set;return{parse(r){const i=[];let s=0;do{const o=Da(r,s),a=o.sequence?r.substring(s,o.startPosition):r.substring(s);if(a.length>0&&i.push({value:a,foreground:e,background:t,decorations:new Set(n)}),o.sequence){const l=Ua(o.sequence);for(const c of l)c.type==="resetAll"?(e=null,t=null,n.clear()):c.type==="resetForegroundColor"?e=null:c.type==="resetBackgroundColor"?t=null:c.type==="resetDecoration"&&n.delete(c.value);for(const c of l)c.type==="setForegroundColor"?e=c.value:c.type==="setBackgroundColor"?t=c.value:c.type==="setDecoration"&&n.add(c.value)}s=o.position}while(s<r.length);return i}}}var ja={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 Ha(e=ja){function t(a){return e[a]}function n(a){return`#${a.map(l=>Math.max(0,Math.min(l,255)).toString(16).padStart(2,"0")).join("")}`}let r;function i(){if(r)return r;r=[];for(let c=0;c<se.length;c++)r.push(t(se[c]));let a=[0,95,135,175,215,255];for(let c=0;c<6;c++)for(let p=0;p<6;p++)for(let u=0;u<6;u++)r.push(n([a[c],a[p],a[u]]));let l=8;for(let c=0;c<24;c++,l+=10)r.push(n([l,l,l]));return r}function s(a){return i()[a]}function o(a){switch(a.type){case"named":return t(a.name);case"rgb":return n(a.rgb);case"table":return s(a.index)}}return{value:o}}const Wa=/#([0-9a-f]{3,8})/i,za=/var\((--[\w-]+-ansi-[\w-]+)\)/,Va={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 qa(e,t,n){const r=Ye(e,n),i=pt(t),s=Ha(Object.fromEntries(se.map(a=>{const l=`terminal.ansi${a[0].toUpperCase()}${a.substring(1)}`;return[a,e.colors?.[l]||Va[a]]}))),o=Fa();return i.map(a=>o.parse(a[0]).map(l=>{let c,p;l.decorations.has("reverse")?(c=l.background?s.value(l.background):e.bg,p=l.foreground?s.value(l.foreground):e.fg):(c=l.foreground?s.value(l.foreground):e.fg,p=l.background?s.value(l.background):void 0),c=te(c,r),p=te(p,r),l.decorations.has("dim")&&(c=Xa(c));let u=O.None;return l.decorations.has("bold")&&(u|=O.Bold),l.decorations.has("italic")&&(u|=O.Italic),l.decorations.has("underline")&&(u|=O.Underline),l.decorations.has("strikethrough")&&(u|=O.Strikethrough),{content:l.value,offset:a[1],color:c,bgColor:p,fontStyle:u}}))}function Xa(e){const t=e.match(Wa);if(t){const r=t[1];if(r.length===8){const i=Math.round(Number.parseInt(r.slice(6,8),16)/2).toString(16).padStart(2,"0");return`#${r.slice(0,6)}${i}`}else{if(r.length===6)return`#${r}80`;if(r.length===4){const i=r[0],s=r[1],o=r[2],a=r[3];return`#${i}${i}${s}${s}${o}${o}${Math.round(Number.parseInt(`${a}${a}`,16)/2).toString(16).padStart(2,"0")}`}else if(r.length===3){const i=r[0],s=r[1],o=r[2];return`#${i}${i}${s}${s}${o}${o}80`}}}const n=e.match(za);return n?`var(${n[1]}-dim)`:e}function Kt(e,t,n={}){const r=e.resolveLangAlias(n.lang||"text"),{theme:i=e.getLoadedThemes()[0]}=n;if(!ct(r)&&!ut(i)&&r==="ansi"){const{theme:s}=e.setTheme(i);return qa(s,t,n)}return Ur(e,t,n)}function nt(e,t,n){let r,i,s,o,a,l;if("themes"in n){const{defaultColor:c="light",cssVariablePrefix:p="--shiki-",colorsRendering:u="css-vars"}=n,h=Object.entries(n.themes).filter(m=>m[1]).map(m=>({color:m[0],theme:m[1]})).sort((m,g)=>m.color===c?-1:g.color===c?1:0);if(h.length===0)throw new A("`themes` option must not be empty");const d=Fr(e,t,n,Kt);if(l=Le(d),c&&c!=="light-dark()"&&!h.some(m=>m.color===c))throw new A(`\`themes\` option must contain the defaultColor key \`${c}\``);const f=h.map(m=>e.getTheme(m.theme)),w=h.map(m=>m.color);s=d.map(m=>m.map(g=>$a(g,w,p,c,u))),l&&dt(s,l);const b=h.map(m=>Ye(m.theme,n));i=Wn(h,f,b,p,c,"fg",u),r=Wn(h,f,b,p,c,"bg",u),o=`shiki-themes ${f.map(m=>m.name).join(" ")}`,a=c?void 0:[i,r].join(";")}else if("theme"in n){const c=Ye(n.theme,n);s=Kt(e,t,n);const p=e.getTheme(n.theme);r=te(p.bg,c),i=te(p.fg,c),o=p.name,l=Le(s)}else throw new A("Invalid options, either `theme` or `themes` must be provided");return{tokens:s,fg:i,bg:r,themeName:o,rootStyle:a,grammarState:l}}function Wn(e,t,n,r,i,s,o){return e.map((a,l)=>{const c=te(t[l][s],n[l])||"inherit",p=`${r+a.color}${s==="bg"?"-bg":""}:${c}`;if(l===0&&i){if(i==="light-dark()"&&e.length>1){const u=e.findIndex(d=>d.color==="light"),h=e.findIndex(d=>d.color==="dark");if(u===-1||h===-1)throw new A('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${te(t[u][s],n[u])||"inherit"}, ${te(t[h][s],n[h])||"inherit"});${p}`}return c}return o==="css-vars"?p:null}).filter(a=>!!a).join(";")}const ri=/^\s+$/,Ka=/^(\s*)(.*?)(\s*)$/;function rt(e,t,n,r={meta:{},options:n,codeToHast:(i,s)=>rt(e,i,s),codeToTokens:(i,s)=>nt(e,i,s)}){let i=t;for(const f of tt(n))i=f.preprocess?.call(r,i,n)||i;let{tokens:s,fg:o,bg:a,themeName:l,rootStyle:c,grammarState:p}=nt(e,i,n);const{mergeWhitespaces:u=!0,mergeSameStyleTokens:h=!1}=n;u===!0?s=Ja(s):u==="never"&&(s=Za(s)),h&&(s=Ya(s));const d={...r,get source(){return i}};for(const f of tt(n))s=f.tokens?.call(d,s)||s;return Qa(s,{...n,fg:o,bg:a,themeName:l,rootStyle:n.rootStyle===!1?!1:n.rootStyle??c},d,p)}function Qa(e,t,n,r=Le(e)){const i=tt(t),s=[],o={type:"root",children:[]},{structure:a="classic",tabindex:l="0"}=t,c={class:`shiki ${t.themeName||""}`};t.rootStyle!==!1&&(t.rootStyle!=null?c.style=t.rootStyle:c.style=`background-color:${t.bg};color:${t.fg}`),l!==!1&&l!=null&&(c.tabindex=l.toString());for(const[w,b]of Object.entries(t.meta||{}))w.startsWith("_")||(c[w]=b);let p={type:"element",tagName:"pre",properties:c,children:[],data:t.data},u={type:"element",tagName:"code",properties:{},children:s};const h=[],d={...n,structure:a,addClassToHast:ti,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return o},get pre(){return p},get code(){return u},get lines(){return h}};if(e.forEach((w,b)=>{b&&(a==="inline"?o.children.push({type:"element",tagName:"br",properties:{},children:[]}):a==="classic"&&s.push({type:"text",value:`
14
- `}));let m={type:"element",tagName:"span",properties:{class:"line"},children:[]},g=0;for(const C of w){let k={type:"element",tagName:"span",properties:{...C.htmlAttrs},children:[{type:"text",value:C.content}]};const v=et(C.htmlStyle||Re(C));v&&(k.properties.style=v);for(const T of i)k=T?.span?.call(d,k,b+1,g,m,C)||k;a==="inline"?o.children.push(k):a==="classic"&&m.children.push(k),g+=C.content.length}if(a==="classic"){for(const C of i)m=C?.line?.call(d,m,b+1)||m;h.push(m),s.push(m)}else a==="inline"&&h.push(m)}),a==="classic"){for(const w of i)u=w?.code?.call(d,u)||u;p.children.push(u);for(const w of i)p=w?.pre?.call(d,p)||p;o.children.push(p)}else if(a==="inline"){const w=[];let b={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(const g of o.children)g.type==="element"&&g.tagName==="br"?(w.push(b),b={type:"element",tagName:"span",properties:{class:"line"},children:[]}):(g.type==="element"||g.type==="text")&&b.children.push(g);w.push(b);let m={type:"element",tagName:"code",properties:{},children:w};for(const g of i)m=g?.code?.call(d,m)||m;o.children=[];for(let g=0;g<m.children.length;g++){g>0&&o.children.push({type:"element",tagName:"br",properties:{},children:[]});const C=m.children[g];C.type==="element"&&o.children.push(...C.children)}}let f=o;for(const w of i)f=w?.root?.call(d,f)||f;return r&&dt(f,r),f}function Ja(e){return e.map(t=>{const n=[];let r="",i;return t.forEach((s,o)=>{const a=!(s.fontStyle&&(s.fontStyle&O.Underline||s.fontStyle&O.Strikethrough));a&&ri.test(s.content)&&t[o+1]?(i===void 0&&(i=s.offset),r+=s.content):r?(a?n.push({...s,offset:i,content:r+s.content}):n.push({content:r,offset:i},s),i=void 0,r=""):n.push(s)}),n})}function Za(e){return e.map(t=>t.flatMap(n=>{if(ri.test(n.content))return n;const r=n.content.match(Ka);if(!r)return n;const[,i,s,o]=r;if(!i&&!o)return n;const a=[{...n,offset:n.offset+i.length,content:s}];return i&&a.unshift({content:i,offset:n.offset}),o&&a.push({content:o,offset:n.offset+i.length+s.length}),a}))}function Ya(e){return e.map(t=>{const n=[];for(const r of t){if(n.length===0){n.push({...r});continue}const i=n.at(-1),s=et(i.htmlStyle||Re(i)),o=et(r.htmlStyle||Re(r)),a=i.fontStyle&&(i.fontStyle&O.Underline||i.fontStyle&O.Strikethrough),l=r.fontStyle&&(r.fontStyle&O.Underline||r.fontStyle&O.Strikethrough);!a&&!l&&s===o?i.content+=r.content:n.push({...r})}return n})}const el=Sa;function tl(e,t,n){const r={meta:{},options:n,codeToHast:(s,o)=>rt(e,s,o),codeToTokens:(s,o)=>nt(e,s,o)};let i=el(rt(e,t,n,r));for(const s of tt(n))i=s.postprocess?.call(r,i,n)||i;return i}async function nl(e){const t=await Qs(e);return{getLastGrammarState:(...n)=>to(t,...n),codeToTokensBase:(n,r)=>Kt(t,n,r),codeToTokensWithThemes:(n,r)=>Fr(t,n,r),codeToTokens:(n,r)=>nt(t,n,r),codeToHast:(n,r)=>rt(t,n,r),codeToHtml:(n,r)=>tl(t,n,r),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function rl(e){const t=e.langs,n=e.themes,r=e.engine;async function i(s){function o(u){if(typeof u=="string"){if(u=s.langAlias?.[u]||u,Pr(u))return[];const h=t[u];if(!h)throw new A(`Language \`${u}\` is not included in this bundle. You may want to load it from external source.`);return h}return u}function a(u){if($r(u))return"none";if(typeof u=="string"){const h=n[u];if(!h)throw new A(`Theme \`${u}\` is not included in this bundle. You may want to load it from external source.`);return h}return u}const l=(s.themes??[]).map(u=>a(u)),c=(s.langs??[]).map(u=>o(u)),p=await nl({engine:s.engine??r(),...s,themes:l,langs:c});return{...p,loadLanguage(...u){return p.loadLanguage(...u.map(o))},loadTheme(...u){return p.loadTheme(...u.map(a))},getBundledLanguages(){return t},getBundledThemes(){return n}}}return i}function il(e){let t;async function n(r={}){if(t){const i=await t;return await Promise.all([i.loadTheme(...r.themes||[]),i.loadLanguage(...r.langs||[])]),i}else{t=e({...r,themes:[],langs:[]});const i=await t;return await Promise.all([i.loadTheme(...r.themes||[]),i.loadLanguage(...r.langs||[])]),i}}return n}function sl(e,t){const n=il(e);async function r(i,s){const o=await n({langs:[s.lang],themes:"theme"in s?[s.theme]:Object.values(s.themes)}),a=await t?.guessEmbeddedLanguages?.(i,s.lang,o);return a&&await o.loadLanguage(...a),o}return{getSingletonHighlighter(i){return n(i)},async codeToHtml(i,s){return(await r(i,s)).codeToHtml(i,s)},async codeToHast(i,s){return(await r(i,s)).codeToHast(i,s)},async codeToTokens(i,s){return(await r(i,s)).codeToTokens(i,s)},async codeToTokensBase(i,s){return(await r(i,s)).codeToTokensBase(i,s)},async codeToTokensWithThemes(i,s){return(await r(i,s)).codeToTokensWithThemes(i,s)},async getLastGrammarState(i,s){return(await n({langs:[s.lang],themes:[s.theme]})).getLastGrammarState(i,s)}}}var ol=nn({bundledLanguages:()=>xe,bundledLanguagesAlias:()=>sn,bundledLanguagesBase:()=>rn,bundledLanguagesInfo:()=>ot,bundledThemes:()=>an,bundledThemesInfo:()=>on,codeToHast:()=>si,codeToHtml:()=>ii,codeToTokens:()=>oi,codeToTokensBase:()=>ai,codeToTokensWithThemes:()=>li,createHighlighter:()=>ft,getLastGrammarState:()=>ui,getSingletonHighlighter:()=>ci});const ft=rl({langs:xe,themes:an,engine:()=>(0,gr.createOnigurumaEngine)(import("./wasm-CG6Dc4jp.js"))}),{codeToHtml:ii,codeToHast:si,codeToTokens:oi,codeToTokensBase:ai,codeToTokensWithThemes:li,getSingletonHighlighter:ci,getLastGrammarState:ui}=sl(ft,{guessEmbeddedLanguages:Ra}),zn=4294967295;var al=class{patterns;options;regexps;constructor(e,t={}){this.patterns=e,this.options=t;const{forgiving:n=!1,cache:r,regexConstructor:i}=t;if(!i)throw new Error("Option `regexConstructor` is not provided");this.regexps=e.map(s=>{if(typeof s!="string")return s;const o=r?.get(s);if(o){if(o instanceof RegExp)return o;if(n)return null;throw o}try{const a=i(s);return r?.set(s,a),a}catch(a){if(r?.set(s,a),n)return null;throw a}})}findNextMatchSync(e,t,n){const r=typeof e=="string"?e:e.content,i=[];function s(o,a,l=0){return{index:o,captureIndices:a.indices.map(c=>c==null?{start:zn,end:zn,length:0}:{start:c[0]+l,end:c[1]+l,length:c[1]-c[0]})}}for(let o=0;o<this.regexps.length;o++){const a=this.regexps[o];if(a)try{a.lastIndex=t;const l=a.exec(r);if(!l)continue;if(l.index===t)return s(o,l,0);i.push([o,l,0])}catch(l){if(this.options.forgiving)continue;throw l}}if(i.length){const o=Math.min(...i.map(a=>a[1].index));for(const[a,l,c]of i)if(l.index===o)return s(a,l,c)}return null}};function be(e){if([...e].length!==1)throw new Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function ll(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}const gn=new Set(["alnum","alpha","ascii","blank","cntrl","digit","graph","lower","print","punct","space","upper","word","xdigit"]),$=String.raw;function we(e,t){if(e==null)throw new Error(t??"Value expected");return e}const pi=$`\[\^?`,di=`c.? | C(?:-.?)?|${$`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${$`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${$`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${$`o\{[^\}]*\}?`}|${$`\d{1,3}`}`,yn=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,Ue=new RegExp($`
15
- \\ (?:
16
- ${di}
17
- | [gk]<[^>]*>?
18
- | [gk]'[^']*'?
19
- | .
20
- )
21
- | \( (?:
22
- \? (?:
23
- [:=!>({]
24
- | <[=!]
25
- | <[^>]*>
26
- | '[^']*'
27
- | ~\|?
28
- | #(?:[^)\\]|\\.?)*
29
- | [^:)]*[:)]
30
- )?
31
- | \*[^\)]*\)?
32
- )?
33
- | (?:${yn.source})+
34
- | ${pi}
35
- | .
36
- `.replace(/\s+/g,""),"gsu"),Lt=new RegExp($`
37
- \\ (?:
38
- ${di}
39
- | .
40
- )
41
- | \[:(?:\^?\p{Alpha}+|\^):\]
42
- | ${pi}
43
- | &&
44
- | .
45
- `.replace(/\s+/g,""),"gsu");function cl(e,t={}){const n={flags:"",...t,rules:{captureGroup:!1,singleline:!1,...t.rules}};if(typeof e!="string")throw new Error("String expected as pattern");const r=Nl(n.flags),i=[r.extended],s={captureGroup:n.rules.captureGroup,getCurrentModX(){return i.at(-1)},numOpenGroups:0,popModX(){i.pop()},pushModX(u){i.push(u)},replaceCurrentModX(u){i[i.length-1]=u},singleline:n.rules.singleline};let o=[],a;for(Ue.lastIndex=0;a=Ue.exec(e);){const u=ul(s,e,a[0],Ue.lastIndex);u.tokens?o.push(...u.tokens):u.token&&o.push(u.token),u.lastIndex!==void 0&&(Ue.lastIndex=u.lastIndex)}const l=[];let c=0;o.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 p=c||l.length;return{tokens:o.map(u=>u.type==="EscapedNumber"?Rl(u,p):u).flat(),flags:r}}function ul(e,t,n,r){const[i,s]=n;if(n==="["||n==="[^"){const o=pl(t,n,r);return{tokens:o.tokens,lastIndex:o.lastIndex}}if(i==="\\"){if("AbBGyYzZ".includes(s))return{token:Vn(n,n)};if(/^\\g[<']/.test(n)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:_l(n)}}if(/^\\k[<']/.test(n)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:fi(n)}}if(s==="K")return{token:mi("keep",n)};if(s==="N"||s==="R")return{token:oe("newline",n,{negate:s==="N"})};if(s==="O")return{token:oe("any",n)};if(s==="X")return{token:oe("text_segment",n)};const o=hi(n,{inCharClass:!1});return Array.isArray(o)?{tokens:o}:{token:o}}if(i==="("){if(s==="*")return{token:xl(n)};if(n==="(?{")throw new Error(`Unsupported callout "${n}"`);if(n.startsWith("(?#")){if(t[r]!==")")throw new Error('Unclosed comment group "(?#"');return{lastIndex:r+1}}if(/^\(\?[-imx]+[:)]$/.test(n))return{token:vl(n,e)};if(e.pushModX(e.getCurrentModX()),e.numOpenGroups++,n==="("&&!e.captureGroup||n==="(?:")return{token:de("group",n)};if(n==="(?>")return{token:de("atomic",n)};if(n==="(?="||n==="(?!"||n==="(?<="||n==="(?<!")return{token:de(n[2]==="<"?"lookbehind":"lookahead",n,{negate:n.endsWith("!")})};if(n==="("&&e.captureGroup||n.startsWith("(?<")&&n.endsWith(">")||n.startsWith("(?'")&&n.endsWith("'"))return{token:de("capturing",n,{...n!=="("&&{name:n.slice(3,-1)}})};if(n.startsWith("(?~")){if(n==="(?~|")throw new Error(`Unsupported absence function kind "${n}"`);return{token:de("absence_repeater",n)}}throw n==="(?("?new Error(`Unsupported conditional "${n}"`):new Error(`Invalid or unsupported group option "${n}"`)}if(n===")"){if(e.popModX(),e.numOpenGroups--,e.numOpenGroups<0)throw new Error('Unmatched ")"');return{token:bl(n)}}if(e.getCurrentModX()){if(n==="#"){const o=t.indexOf(`
46
- `,r);return{lastIndex:o===-1?t.length:o}}if(/^\s$/.test(n)){const o=/\s+/y;return o.lastIndex=r,{lastIndex:o.exec(t)?o.lastIndex:r}}}if(n===".")return{token:oe("dot",n)};if(n==="^"||n==="$"){const o=e.singleline?{"^":$`\A`,$:$`\Z`}[n]:n;return{token:Vn(o,n)}}return n==="|"?{token:hl(n)}:yn.test(n)?{tokens:Il(n)}:{token:J(be(n),n)}}function pl(e,t,n){const r=[qn(t[1]==="^",t)];let i=1,s;for(Lt.lastIndex=n;s=Lt.exec(e);){const o=s[0];if(o[0]==="["&&o[1]!==":")i++,r.push(qn(o[1]==="^",o));else if(o==="]"){if(r.at(-1).type==="CharacterClassOpen")r.push(J(93,o));else if(i--,r.push(fl(o)),!i)break}else{const a=dl(o);Array.isArray(a)?r.push(...a):r.push(a)}}return{tokens:r,lastIndex:Lt.lastIndex||e.length}}function dl(e){if(e[0]==="\\")return hi(e,{inCharClass:!0});if(e[0]==="["){const t=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(e);if(!t||!gn.has(t.groups.name))throw new Error(`Invalid POSIX class "${e}"`);return oe("posix",e,{value:t.groups.name,negate:!!t.groups.negate})}return e==="-"?ml(e):e==="&&"?gl(e):J(be(e),e)}function hi(e,{inCharClass:t}){const n=e[1];if(n==="c"||n==="C")return kl(e);if("dDhHsSwW".includes(n))return Al(e);if(e.startsWith($`\o{`))throw new Error(`Incomplete, invalid, or unsupported octal code point "${e}"`);if(/^\\[pP]\{/.test(e)){if(e.length===3)throw new Error(`Incomplete or invalid Unicode property "${e}"`);return El(e)}if(/^\\x[89A-Fa-f]\p{AHex}/u.test(e))try{const r=e.split(/\\x/).slice(1).map(o=>parseInt(o,16)),i=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}).decode(new Uint8Array(r)),s=new TextEncoder;return[...i].map(o=>{const a=[...s.encode(o)].map(l=>`\\x${l.toString(16)}`).join("");return J(be(o),a)})}catch{throw new Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`)}if(n==="u"||n==="x")return J(Ll(e),e);if(Xn.has(n))return J(Xn.get(n),e);if(/\d/.test(n))return yl(t,e);if(e==="\\")throw new Error($`Incomplete escape "\"`);if(n==="M")throw new Error(`Unsupported meta "${e}"`);if([...e].length===2)return J(e.codePointAt(1),e);throw new Error(`Unexpected escape "${e}"`)}function hl(e){return{type:"Alternator",raw:e}}function Vn(e,t){return{type:"Assertion",kind:e,raw:t}}function fi(e){return{type:"Backreference",raw:e}}function J(e,t){return{type:"Character",value:e,raw:t}}function fl(e){return{type:"CharacterClassClose",raw:e}}function ml(e){return{type:"CharacterClassHyphen",raw:e}}function gl(e){return{type:"CharacterClassIntersector",raw:e}}function qn(e,t){return{type:"CharacterClassOpen",negate:e,raw:t}}function oe(e,t,n={}){return{type:"CharacterSet",kind:e,...n,raw:t}}function mi(e,t,n={}){return e==="keep"?{type:"Directive",kind:e,raw:t}:{type:"Directive",kind:e,flags:we(n.flags),raw:t}}function yl(e,t){return{type:"EscapedNumber",inCharClass:e,raw:t}}function bl(e){return{type:"GroupClose",raw:e}}function de(e,t,n={}){return{type:"GroupOpen",kind:e,...n,raw:t}}function wl(e,t,n,r){return{type:"NamedCallout",kind:e,tag:t,arguments:n,raw:r}}function Cl(e,t,n,r){return{type:"Quantifier",kind:e,min:t,max:n,raw:r}}function _l(e){return{type:"Subroutine",raw:e}}const Sl=new Set(["COUNT","CMP","ERROR","FAIL","MAX","MISMATCH","SKIP","TOTAL_COUNT"]),Xn=new Map([["a",7],["b",8],["e",27],["f",12],["n",10],["r",13],["t",9],["v",11]]);function kl(e){const t=e[1]==="c"?e[2]:e[3];if(!t||!/[A-Za-z]/.test(t))throw new Error(`Unsupported control character "${e}"`);return J(be(t.toUpperCase())-64,e)}function vl(e,t){let{on:n,off:r}=/^\(\?(?<on>[imx]*)(?:-(?<off>[-imx]*))?/.exec(e).groups;r??="";const i=(t.getCurrentModX()||n.includes("x"))&&!r.includes("x"),s=Qn(n),o=Qn(r),a={};if(s&&(a.enable=s),o&&(a.disable=o),e.endsWith(")"))return t.replaceCurrentModX(i),mi("flags",e,{flags:a});if(e.endsWith(":"))return t.pushModX(i),t.numOpenGroups++,de("group",e,{...(s||o)&&{flags:a}});throw new Error(`Unexpected flag modifier "${e}"`)}function xl(e){const t=/\(\*(?<name>[A-Za-z_]\w*)?(?:\[(?<tag>(?:[A-Za-z_]\w*)?)\])?(?:\{(?<args>[^}]*)\})?\)/.exec(e);if(!t)throw new Error(`Incomplete or invalid named callout "${e}"`);const{name:n,tag:r,args:i}=t.groups;if(!n)throw new Error(`Invalid named callout "${e}"`);if(r==="")throw new Error(`Named callout tag with empty value not allowed "${e}"`);const s=i?i.split(",").filter(p=>p!=="").map(p=>/^[+-]?\d+$/.test(p)?+p:p):[],[o,a,l]=s,c=Sl.has(n)?n.toLowerCase():"custom";switch(c){case"fail":case"mismatch":case"skip":if(s.length>0)throw new Error(`Named callout arguments not allowed "${s}"`);break;case"error":if(s.length>1)throw new Error(`Named callout allows only one argument "${s}"`);if(typeof o=="string")throw new Error(`Named callout argument must be a number "${o}"`);break;case"max":if(!s.length||s.length>2)throw new Error(`Named callout must have one or two arguments "${s}"`);if(typeof o=="string"&&!/^[A-Za-z_]\w*$/.test(o))throw new Error(`Named callout argument one must be a tag or number "${o}"`);if(s.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(s.length>1)throw new Error(`Named callout allows only one argument "${s}"`);if(s.length===1&&(typeof o=="number"||!/^[<>X]$/.test(o)))throw new Error(`Named callout optional argument must be '<', '>', or 'X' "${o}"`);break;case"cmp":if(s.length!==3)throw new Error(`Named callout must have three arguments "${s}"`);if(typeof o=="string"&&!/^[A-Za-z_]\w*$/.test(o))throw new Error(`Named callout argument one must be a tag or number "${o}"`);if(typeof 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 wl(c,r??null,i?.split(",")??null,e)}function Kn(e){let t=null,n,r;if(e[0]==="{"){const{minStr:i,maxStr:s}=/^\{(?<minStr>\d*)(?:,(?<maxStr>\d*))?/.exec(e).groups,o=1e5;if(+i>o||s&&+s>o)throw new Error("Quantifier value unsupported in Oniguruma");if(n=+i,r=s===void 0?+i:s===""?1/0:+s,n>r&&(t="possessive",[n,r]=[r,n]),e.endsWith("?")){if(t==="possessive")throw new Error('Unsupported possessive interval quantifier chain with "?"');t="lazy"}else t||(t="greedy")}else n=e[0]==="+"?1:0,r=e[0]==="?"?1:1/0,t=e[1]==="+"?"possessive":e[1]==="?"?"lazy":"greedy";return Cl(t,n,r,e)}function Al(e){const t=e[1].toLowerCase();return oe({d:"digit",h:"hex",s:"space",w:"word"}[t],e,{negate:e[1]!==t})}function El(e){const{p:t,neg:n,value:r}=/^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(e).groups;return oe("property",e,{value:r,negate:t==="P"&&!n||t==="p"&&!!n})}function Qn(e){const t={};return e.includes("i")&&(t.ignoreCase=!0),e.includes("m")&&(t.dotAll=!0),e.includes("x")&&(t.extended=!0),Object.keys(t).length?t:null}function Nl(e){const t={ignoreCase:!1,dotAll:!1,extended:!1,digitIsAscii:!1,posixIsAscii:!1,spaceIsAscii:!1,wordIsAscii:!1,textSegmentMode:null};for(let n=0;n<e.length;n++){const r=e[n];if(!"imxDPSWy".includes(r))throw new Error(`Invalid flag "${r}"`);if(r==="y"){if(!/^y{[gw]}/.test(e.slice(n)))throw new Error('Invalid or unspecified flag "y" mode');t.textSegmentMode=e[n+2]==="g"?"grapheme":"word",n+=3;continue}t[{i:"ignoreCase",m:"dotAll",x:"extended",D:"digitIsAscii",P:"posixIsAscii",S:"spaceIsAscii",W:"wordIsAscii"}[r]]=!0}return t}function Ll(e){if(/^(?:\\u(?!\p{AHex}{4})|\\x(?!\p{AHex}{1,2}|\{\p{AHex}{1,8}\}))/u.test(e))throw new Error(`Incomplete or invalid escape "${e}"`);const t=e[2]==="{"?/^\\x\{\s*(?<hex>\p{AHex}+)/u.exec(e).groups.hex:e.slice(2);return parseInt(t,16)}function Rl(e,t){const{raw:n,inCharClass:r}=e,i=n.slice(1);if(!r&&(i!=="0"&&i.length===1||i[0]!=="0"&&+i<=t))return[fi(n)];const s=[],o=i.match(/^[0-7]+|\d/g);for(let a=0;a<o.length;a++){const l=o[a];let c;if(a===0&&l!=="8"&&l!=="9"){if(c=parseInt(l,8),c>127)throw new Error($`Octal encoded byte above 177 unsupported "${n}"`)}else c=be(l);s.push(J(c,(a===0?"\\":"")+l))}return s}function Il(e){const t=[],n=new RegExp(yn,"gy");let r;for(;r=n.exec(e);){const i=r[0];if(i[0]==="{"){const s=/^\{(?<min>\d+),(?<max>\d+)\}\??$/.exec(i);if(s){const{min:o,max:a}=s.groups;if(+o>+a&&i.endsWith("?")){n.lastIndex--,t.push(Kn(i.slice(0,-1)));continue}}}t.push(Kn(i))}return t}function gi(e,t){if(!Array.isArray(e.body))throw new Error("Expected node with body array");if(e.body.length!==1)return!1;const n=e.body[0];return!t||Object.keys(t).every(r=>t[r]===n[r])}function Tl(e){return Pl.has(e.type)}const Pl=new Set(["AbsenceFunction","Backreference","CapturingGroup","Character","CharacterClass","CharacterSet","Group","Quantifier","Subroutine"]);function yi(e,t={}){const n={flags:"",normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}},r=cl(e,{flags:n.flags,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline}}),i=(h,d)=>{const f=r.tokens[s.nextIndex];switch(s.parent=h,s.nextIndex++,f.type){case"Alternator":return ae();case"Assertion":return $l(f);case"Backreference":return Ml(f,s);case"Character":return mt(f.value,{useLastValid:!!d.isCheckingRangeEnd});case"CharacterClassHyphen":return Ol(f,s,d);case"CharacterClassOpen":return Gl(f,s,d);case"CharacterSet":return Bl(f,s);case"Directive":return Wl(f.kind,{flags:f.flags});case"GroupOpen":return Dl(f,s,d);case"NamedCallout":return Vl(f.kind,f.tag,f.arguments);case"Quantifier":return Ul(f,s);case"Subroutine":return Fl(f,s);default:throw new Error(`Unexpected token type "${f.type}"`)}},s={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:i},o=Xl(zl(r.flags));let a=o.body[0];for(;s.nextIndex<r.tokens.length;){const h=i(a,{});h.type==="Alternative"?(o.body.push(h),a=h):a.body.push(h)}const{capturingGroups:l,hasNumberedRef:c,namedGroupsByName:p,subroutines:u}=s;if(c&&p.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(p.has(h)){if(p.get(h).length>1)throw new Error($`Subroutine uses a duplicate group name "\g<${h}>"`);p.get(h)[0].isSubroutined=!0}else throw new Error($`Subroutine uses a group name that's not defined "\g<${h}>"`);return o}function $l({kind:e}){return Qt(we({"^":"line_start",$:"line_end","\\A":"string_start","\\b":"word_boundary","\\B":"word_boundary","\\G":"search_start","\\y":"text_segment_boundary","\\Y":"text_segment_boundary","\\z":"string_end","\\Z":"string_end_newline"}[e],`Unexpected assertion kind "${e}"`),{negate:e===$`\B`||e===$`\Y`})}function Ml({raw:e},t){const n=/^\\k[<']/.test(e),r=n?e.slice(3,-1):e.slice(1),i=(s,o=!1)=>{const a=t.capturingGroups.length;let l=!1;if(s>a)if(t.skipBackrefValidation)l=!0;else throw new Error(`Not enough capturing groups defined to the left "${e}"`);return t.hasNumberedRef=!0,Jt(o?a+1-s:s,{orphan:l})};if(n){const s=/^(?<sign>-?)0*(?<num>[1-9]\d*)$/.exec(r);if(s)return i(+s.groups.num,!!s.groups.sign);if(/[-+]/.test(r))throw new Error(`Invalid backref name "${e}"`);if(!t.namedGroupsByName.has(r))throw new Error(`Group name not defined to the left "${e}"`);return Jt(r)}return i(+r)}function Ol(e,t,n){const{tokens:r,walk:i}=t,s=t.parent,o=s.body.at(-1),a=r[t.nextIndex];if(!n.isCheckingRangeEnd&&o&&o.type!=="CharacterClass"&&o.type!=="CharacterClassRange"&&a&&a.type!=="CharacterClassOpen"&&a.type!=="CharacterClassClose"&&a.type!=="CharacterClassIntersector"){const l=i(s,{...n,isCheckingRangeEnd:!0});if(o.type==="Character"&&l.type==="Character")return s.body.pop(),Hl(o,l);throw new Error("Invalid character class range")}return mt(be("-"))}function Gl({negate:e},t,n){const{tokens:r,walk:i}=t,s=[ze()],o=r[t.nextIndex];let a=Yn(o);for(;a.type!=="CharacterClassClose";){if(a.type==="CharacterClassIntersector")s.push(ze()),t.nextIndex++;else{const c=s.at(-1);c.body.push(i(c,n))}a=Yn(r[t.nextIndex],o)}const l=ze({negate:e});return s.length===1?l.body=s[0].body:(l.kind="intersection",l.body=s.map(c=>c.body.length===1?c.body[0]:c)),t.nextIndex++,l}function Bl({kind:e,negate:t,value:n},r){const{normalizeUnknownPropertyNames:i,skipPropertyNameValidation:s,unicodePropertyMap:o}=r;if(e==="property"){const a=gt(n);if(gn.has(a)&&!o?.has(a))e="posix",n=a;else return he(n,{negate:t,normalizeUnknownPropertyNames:i,skipPropertyNameValidation:s,unicodePropertyMap:o})}return e==="posix"?ql(n,{negate:t}):Zt(e,{negate:t})}function Dl(e,t,n){const{tokens:r,capturingGroups:i,namedGroupsByName:s,skipLookbehindValidation:o,walk:a}=t,l=Kl(e),c=l.type==="AbsenceFunction",p=Zn(l),u=p&&l.negate;if(l.type==="CapturingGroup"&&(i.push(l),l.name&&ll(s,l.name,[]).push(l)),c&&n.isInAbsenceFunction)throw new Error("Nested absence function not supported by Oniguruma");let h=er(r[t.nextIndex]);for(;h.type!=="GroupClose";){if(h.type==="Alternator")l.body.push(ae()),t.nextIndex++;else{const d=l.body.at(-1),f=a(d,{...n,isInAbsenceFunction:n.isInAbsenceFunction||c,isInLookbehind:n.isInLookbehind||p,isInNegLookbehind:n.isInNegLookbehind||u});if(d.body.push(f),(p||n.isInLookbehind)&&!o){const w="Lookbehind includes a pattern not allowed by Oniguruma";if(u||n.isInNegLookbehind){if(Jn(f)||f.type==="CapturingGroup")throw new Error(w)}else if(Jn(f)||Zn(f)&&f.negate)throw new Error(w)}}h=er(r[t.nextIndex])}return t.nextIndex++,l}function Ul({kind:e,min:t,max:n},r){const i=r.parent,s=i.body.at(-1);if(!s||!Tl(s))throw new Error("Quantifier requires a repeatable token");const o=wi(e,t,n,s);return i.body.pop(),o}function Fl({raw:e},t){const{capturingGroups:n,subroutines:r}=t;let i=e.slice(3,-1);const s=/^(?<sign>[-+]?)0*(?<num>[1-9]\d*)$/.exec(i);if(s){const a=+s.groups.num,l=n.length;if(t.hasNumberedRef=!0,i={"":a,"+":l+a,"-":l+1-a}[s.groups.sign],i<1)throw new Error("Invalid subroutine number")}else i==="0"&&(i=0);const o=Ci(i);return r.push(o),o}function jl(e,t){return{type:"AbsenceFunction",kind:e,body:$e(t?.body)}}function ae(e){return{type:"Alternative",body:_i(e?.body)}}function Qt(e,t){const n={type:"Assertion",kind:e};return(e==="word_boundary"||e==="text_segment_boundary")&&(n.negate=!!t?.negate),n}function Jt(e,t){const n=!!t?.orphan;return{type:"Backreference",ref:e,...n&&{orphan:n}}}function bi(e,t){const n={name:void 0,isSubroutined:!1,...t};if(n.name!==void 0&&!Ql(n.name))throw new Error(`Group name "${n.name}" invalid in Oniguruma`);return{type:"CapturingGroup",number:e,...n.name&&{name:n.name},...n.isSubroutined&&{isSubroutined:n.isSubroutined},body:$e(t?.body)}}function mt(e,t){const n={useLastValid:!1,...t};if(e>1114111){const r=e.toString(16);if(n.useLastValid)e=1114111;else throw e>1310719?new Error(`Invalid code point out of range "\\x{${r}}"`):new Error(`Invalid code point out of range in JS "\\x{${r}}"`)}return{type:"Character",value:e}}function ze(e){const t={kind:"union",negate:!1,...e};return{type:"CharacterClass",kind:t.kind,negate:t.negate,body:_i(e?.body)}}function Hl(e,t){if(t.value<e.value)throw new Error("Character class range out of order");return{type:"CharacterClassRange",min:e,max:t}}function Zt(e,t){const n=!!t?.negate,r={type:"CharacterSet",kind:e};return(e==="digit"||e==="hex"||e==="newline"||e==="space"||e==="word")&&(r.negate=n),(e==="text_segment"||e==="newline"&&!n)&&(r.variableLength=!0),r}function Wl(e,t={}){if(e==="keep")return{type:"Directive",kind:e};if(e==="flags")return{type:"Directive",kind:e,flags:we(t.flags)};throw new Error(`Unexpected directive kind "${e}"`)}function zl(e){return{type:"Flags",...e}}function H(e){const t=e?.atomic,n=e?.flags;if(t&&n)throw new Error("Atomic group cannot have flags");return{type:"Group",...t&&{atomic:t},...n&&{flags:n},body:$e(e?.body)}}function ie(e){const t={behind:!1,negate:!1,...e};return{type:"LookaroundAssertion",kind:t.behind?"lookbehind":"lookahead",negate:t.negate,body:$e(e?.body)}}function Vl(e,t,n){return{type:"NamedCallout",kind:e,tag:t,arguments:n}}function ql(e,t){const n=!!t?.negate;if(!gn.has(e))throw new Error(`Invalid POSIX class "${e}"`);return{type:"CharacterSet",kind:"posix",value:e,negate:n}}function wi(e,t,n,r){if(t>n)throw new Error("Invalid reversed quantifier range");return{type:"Quantifier",kind:e,min:t,max:n,body:r}}function Xl(e,t){return{type:"Regex",body:$e(t?.body),flags:e}}function Ci(e){return{type:"Subroutine",ref:e}}function he(e,t){const n={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t};let r=n.unicodePropertyMap?.get(gt(e));if(!r){if(n.normalizeUnknownPropertyNames)r=Jl(e);else if(n.unicodePropertyMap&&!n.skipPropertyNameValidation)throw new Error($`Invalid Unicode property "\p{${e}}"`)}return{type:"CharacterSet",kind:"property",value:r??e,negate:n.negate}}function Kl({flags:e,kind:t,name:n,negate:r,number:i}){switch(t){case"absence_repeater":return jl("repeater");case"atomic":return H({atomic:!0});case"capturing":return bi(i,{name:n});case"group":return H({flags:e});case"lookahead":case"lookbehind":return ie({behind:t==="lookbehind",negate:r});default:throw new Error(`Unexpected group kind "${t}"`)}}function $e(e){if(e===void 0)e=[ae()];else if(!Array.isArray(e)||!e.length||!e.every(t=>t.type==="Alternative"))throw new Error("Invalid body; expected array of one or more Alternative nodes");return e}function _i(e){if(e===void 0)e=[];else if(!Array.isArray(e)||!e.every(t=>!!t.type))throw new Error("Invalid body; expected array of nodes");return e}function Jn(e){return e.type==="LookaroundAssertion"&&e.kind==="lookahead"}function Zn(e){return e.type==="LookaroundAssertion"&&e.kind==="lookbehind"}function Ql(e){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(e)}function Jl(e){return e.trim().replace(/[- _]+/g,"_").replace(/[A-Z][a-z]+(?=[A-Z])/g,"$&_").replace(/[A-Za-z]+/g,t=>t[0].toUpperCase()+t.slice(1).toLowerCase())}function gt(e){return e.replace(/[- _]+/g,"").toLowerCase()}function Yn(e,t){const n=t;return we(e,`Unclosed character class${n?.type==="Character"&&n.value===93&&n.raw==="]"?' (started with "]")':""}`)}function er(e){return we(e,"Unclosed group")}function ve(e,t,n=null){function r(s,o){for(let a=0;a<s.length;a++){const l=i(s[a],o,a,s);a=Math.max(-1,a+l)}}function i(s,o=null,a=null,l=null){let c=0,p=!1;const u={node:s,parent:o,key:a,container:l,root:e,remove(){Fe(l).splice(Math.max(0,ue(a)+c),1),c--,p=!0},removeAllNextSiblings(){return Fe(l).splice(ue(a)+1)},removeAllPrevSiblings(){const m=ue(a)+c;return c-=m,Fe(l).splice(0,Math.max(0,m))},replaceWith(m,g={}){const C=!!g.traverse;l?l[Math.max(0,ue(a)+c)]=m:we(o,"Can't replace root node")[a]=m,C&&i(m,o,a,l),p=!0},replaceWithMultiple(m,g={}){const C=!!g.traverse;if(Fe(l).splice(Math.max(0,ue(a)+c),1,...m),c+=m.length-1,C){let k=0;for(let v=0;v<m.length;v++)k+=i(m[v],o,ue(a)+v+k,l)}p=!0},skip(){p=!0}},{type:h}=s,d=t["*"],f=t[h],w=typeof d=="function"?d:d?.enter,b=typeof f=="function"?f:f?.enter;if(w?.(u,n),b?.(u,n),!p)switch(h){case"AbsenceFunction":case"Alternative":case"CapturingGroup":case"CharacterClass":case"Group":case"LookaroundAssertion":r(s.body,s);break;case"Assertion":case"Backreference":case"Character":case"CharacterSet":case"Directive":case"Flags":case"NamedCallout":case"Subroutine":break;case"CharacterClassRange":i(s.min,s,"min"),i(s.max,s,"max");break;case"Quantifier":i(s.body,s,"body");break;case"Regex":r(s.body,s),i(s.flags,s,"flags");break;default:throw new Error(`Unexpected node type "${h}"`)}return f?.exit?.(u,n),d?.exit?.(u,n),c}return i(e),e}function Fe(e){if(!Array.isArray(e))throw new Error("Container expected");return e}function ue(e){if(typeof e!="number")throw new Error("Numeric key expected");return e}const Zl=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;function Yl(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function ec(e,t,n,r){return e.slice(0,t)+r+e.slice(t+n.length)}const j=Object.freeze({DEFAULT:"DEFAULT",CHAR_CLASS:"CHAR_CLASS"});function bn(e,t,n,r){const i=new RegExp(String.raw`${t}|(?<$skip>\[\^?|\\?.)`,"gsu"),s=[!1];let o=0,a="";for(const l of e.matchAll(i)){const{0:c,groups:{$skip:p}}=l;if(!p&&(!r||r===j.DEFAULT==!o)){n instanceof Function?a+=n(l,{context:o?j.CHAR_CLASS:j.DEFAULT,negated:s[s.length-1]}):a+=n;continue}c[0]==="["?(o++,s.push(c[1]==="^")):c==="]"&&o&&(o--,s.pop()),a+=c}return a}function Si(e,t,n,r){bn(e,t,n,r)}function tc(e,t,n=0,r){if(!new RegExp(t,"su").test(e))return null;const i=new RegExp(`${t}|(?<$skip>\\\\?.)`,"gsu");i.lastIndex=n;let s=0,o;for(;o=i.exec(e);){const{0:a,groups:{$skip:l}}=o;if(!l&&(!r||r===j.DEFAULT==!s))return o;a==="["?s++:a==="]"&&s&&s--,i.lastIndex==o.index&&i.lastIndex++}return null}function je(e,t,n){return!!tc(e,t,0,n)}function nc(e,t){const n=/\\?./gsu;n.lastIndex=t;let r=e.length,i=0,s=1,o;for(;o=n.exec(e);){const[a]=o;if(a==="[")i++;else if(i)a==="]"&&i--;else if(a==="(")s++;else if(a===")"&&(s--,!s)){r=o.index;break}}return e.slice(t,r)}const tr=new RegExp(String.raw`(?<noncapturingStart>${Zl})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,"gsu");function rc(e,t){const n=t?.hiddenCaptures??[];let r=t?.captureTransfers??new Map;if(!/\(\?>/.test(e))return{pattern:e,captureTransfers:r,hiddenCaptures:n};const i="(?>",s="(?:(?=(",o=[0],a=[];let l=0,c=0,p=NaN,u;do{u=!1;let h=0,d=0,f=!1,w;for(tr.lastIndex=Number.isNaN(p)?0:p+s.length;w=tr.exec(e);){const{0:b,index:m,groups:{capturingStart:g,noncapturingStart:C}}=w;if(b==="[")h++;else if(h)b==="]"&&h--;else if(b===i&&!f)p=m,f=!0;else if(f&&C)d++;else if(g)f?d++:(l++,o.push(l+c));else if(b===")"&&f){if(!d){c++;const k=l+c;if(e=`${e.slice(0,p)}${s}${e.slice(p+i.length,m)}))<$$${k}>)${e.slice(m+1)}`,u=!0,a.push(k),Yl(n,k),r.size){const v=new Map;r.forEach((T,G)=>{v.set(G>=k?G+1:G,T.map(q=>q>=k?q+1:q))}),r=v}break}d--}}}while(u);return n.push(...a),e=bn(e,String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,({0:h,groups:{backrefNum:d,wrappedBackrefNum:f}})=>{if(d){const w=+d;if(w>o.length-1)throw new Error(`Backref "${h}" greater than number of captures`);return`\\${o[w]}`}return`\\${f}`},j.DEFAULT),{pattern:e,captureTransfers:r,hiddenCaptures:n}}const ki=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,Rt=new RegExp(String.raw`
47
- \\(?: \d+
48
- | c[A-Za-z]
49
- | [gk]<[^>]+>
50
- | [pPu]\{[^\}]+\}
51
- | u[A-Fa-f\d]{4}
52
- | x[A-Fa-f\d]{2}
53
- )
54
- | \((?: \? (?: [:=!>]
55
- | <(?:[=!]|[^>]+>)
56
- | [A-Za-z\-]+:
57
- | \(DEFINE\)
58
- ))?
59
- | (?<qBase>${ki})(?<qMod>[?+]?)(?<invalidQ>[?*+\{]?)
60
- | \\?.
61
- `.replace(/\s+/g,""),"gsu");function ic(e){if(!new RegExp(`${ki}\\+`).test(e))return{pattern:e};const t=[];let n=null,r=null,i="",s=0,o;for(Rt.lastIndex=0;o=Rt.exec(e);){const{0:a,index:l,groups:{qBase:c,qMod:p,invalidQ:u}}=o;if(a==="[")s||(r=l),s++;else if(a==="]")s?s--:r=null;else if(!s)if(p==="+"&&i&&!i.startsWith("(")){if(u)throw new Error(`Invalid quantifier "${a}"`);let h=-1;if(/^\{\d+\}$/.test(c))e=ec(e,l+c.length,p,"");else{if(i===")"||i==="]"){const d=i===")"?n:r;if(d===null)throw new Error(`Invalid unmatched "${i}"`);e=`${e.slice(0,d)}(?>${e.slice(d,l)}${c})${e.slice(l+a.length)}`}else e=`${e.slice(0,l-i.length)}(?>${i}${c})${e.slice(l+a.length)}`;h+=4}Rt.lastIndex+=h}else a[0]==="("?t.push(l):a===")"&&(n=t.length?t.pop():null);i=a}return{pattern:e}}const F=String.raw,sc=F`\\g<(?<gRNameOrNum>[^>&]+)&R=(?<gRDepth>[^>]+)>`,Yt=F`\(\?R=(?<rDepth>[^\)]+)\)|${sc}`,yt=F`\(\?<(?![=!])(?<captureName>[^>]+)>`,vi=F`${yt}|(?<unnamed>\()(?!\?)`,ne=new RegExp(F`${yt}|${Yt}|\(\?|\\?.`,"gsu"),It="Cannot use multiple overlapping recursions";function oc(e,t){const{hiddenCaptures:n,mode:r}={hiddenCaptures:[],mode:"plugin",...t};let i=t?.captureTransfers??new Map;if(!new RegExp(Yt,"su").test(e))return{pattern:e,captureTransfers:i,hiddenCaptures:n};if(r==="plugin"&&je(e,F`\(\?\(DEFINE\)`,j.DEFAULT))throw new Error("DEFINE groups cannot be used with recursion");const s=[],o=je(e,F`\\[1-9]`,j.DEFAULT),a=new Map,l=[];let c=!1,p=0,u=0,h;for(ne.lastIndex=0;h=ne.exec(e);){const{0:d,groups:{captureName:f,rDepth:w,gRNameOrNum:b,gRDepth:m}}=h;if(d==="[")p++;else if(p)d==="]"&&p--;else if(w){if(nr(w),c)throw new Error(It);if(o)throw new Error(`${r==="external"?"Backrefs":"Numbered backrefs"} cannot be used with global recursion`);const g=e.slice(0,h.index),C=e.slice(ne.lastIndex);if(je(C,Yt,j.DEFAULT))throw new Error(It);const k=+w-1;e=rr(g,C,k,!1,n,s,u),i=sr(i,g,k,s.length,0,u);break}else if(b){nr(m);let g=!1;for(const Z of l)if(Z.name===b||Z.num===+b){if(g=!0,Z.hasRecursedWithin)throw new Error(It);break}if(!g)throw new Error(F`Recursive \g cannot be used outside the referenced group "${r==="external"?b:F`\g<${b}&R=${m}>`}"`);const C=a.get(b),k=nc(e,C);if(o&&je(k,F`${yt}|\((?!\?)`,j.DEFAULT))throw new Error(`${r==="external"?"Backrefs":"Numbered backrefs"} cannot be used with recursion of capturing groups`);const v=e.slice(C,h.index),T=k.slice(v.length+d.length),G=s.length,q=+m-1,Me=rr(v,T,q,!0,n,s,u);i=sr(i,v,q,s.length-G,G,u);const wt=e.slice(0,C),Ce=e.slice(C+k.length);e=`${wt}${Me}${Ce}`,ne.lastIndex+=Me.length-d.length-v.length-T.length,l.forEach(Z=>Z.hasRecursedWithin=!0),c=!0}else if(f)u++,a.set(String(u),ne.lastIndex),a.set(f,ne.lastIndex),l.push({num:u,name:f});else if(d[0]==="("){const g=d==="(";g&&(u++,a.set(String(u),ne.lastIndex)),l.push(g?{num:u}:{})}else d===")"&&l.pop()}return n.push(...s),{pattern:e,captureTransfers:i,hiddenCaptures:n}}function nr(e){const t=`Max depth must be integer between 2 and 100; used ${e}`;if(!/^[1-9]\d*$/.test(e))throw new Error(t);if(e=+e,e<2||e>100)throw new Error(t)}function rr(e,t,n,r,i,s,o){const a=new Set;r&&Si(e+t,yt,({groups:{captureName:c}})=>{a.add(c)},j.DEFAULT);const l=[n,r?a:null,i,s,o];return`${e}${ir(`(?:${e}`,"forward",...l)}(?:)${ir(`${t})`,"backward",...l)}${t}`}function ir(e,t,n,r,i,s,o){const l=p=>t==="forward"?p+2:n-p+2-1;let c="";for(let p=0;p<n;p++){const u=l(p);c+=bn(e,F`${vi}|\\k<(?<backref>[^>]+)>`,({0:h,groups:{captureName:d,unnamed:f,backref:w}})=>{if(w&&r&&!r.has(w))return h;const b=`_$${u}`;if(f||d){const m=o+s.length+1;return s.push(m),ac(i,m),f?h:`(?<${d}${b}>`}return F`\k<${w}${b}>`},j.DEFAULT)}return c}function ac(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function sr(e,t,n,r,i,s){if(e.size&&r){let o=0;Si(t,vi,()=>o++,j.DEFAULT);const a=s-o+i,l=new Map;return e.forEach((c,p)=>{const u=(r-o*n)/n,h=o*n,d=p>a+o?p+r:p,f=[];for(const w of c)if(w<=a)f.push(w);else if(w>a+o+u)f.push(w+r);else if(w<=a+o)for(let b=0;b<=n;b++)f.push(w+o*b);else for(let b=0;b<=n;b++)f.push(w+h+u*b);l.set(d,f)}),l}return e}var R=String.fromCodePoint,_=String.raw,W={},bt=globalThis.RegExp;W.flagGroups=(()=>{try{new bt("(?i:)")}catch{return!1}return!0})();W.unicodeSets=(()=>{try{new bt("[[]]","v")}catch{return!1}return!0})();W.bugFlagVLiteralHyphenIsRange=W.unicodeSets?(()=>{try{new bt(_`[\d\-a]`,"v")}catch{return!0}return!1})():!1;W.bugNestedClassIgnoresNegation=W.unicodeSets&&new bt("[[^a]]","v").test("a");function it(e,{enable:t,disable:n}){return{dotAll:!n?.dotAll&&!!(t?.dotAll||e.dotAll),ignoreCase:!n?.ignoreCase&&!!(t?.ignoreCase||e.ignoreCase)}}function Ie(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}function en(e,t){return or[e]>=or[t]}function lc(e,t){if(e==null)throw new Error(t??"Value expected");return e}var or={ES2025:2025,ES2024:2024,ES2018:2018},cc={auto:"auto",ES2025:"ES2025",ES2024:"ES2024",ES2018:"ES2018"};function xi(e={}){if({}.toString.call(e)!=="[object Object]")throw new Error("Unexpected options");if(e.target!==void 0&&!cc[e.target])throw new Error(`Unexpected target "${e.target}"`);const t={accuracy:"default",avoidSubclass:!1,flags:"",global:!1,hasIndices:!1,lazyCompileLength:1/0,target:"auto",verbose:!1,...e,rules:{allowOrphanBackrefs:!1,asciiWordBoundaries:!1,captureGroup:!1,recursionLimit:20,singleline:!1,...e.rules}};return t.target==="auto"&&(t.target=W.flagGroups?"ES2025":W.unicodeSets?"ES2024":"ES2018"),t}var uc="[ -\r ]",pc=new Set([R(304),R(305)]),K=_`[\p{L}\p{M}\p{N}\p{Pc}]`;function Ai(e){if(pc.has(e))return[e];const t=new Set,n=e.toLowerCase(),r=n.toUpperCase(),i=fc.get(n),s=dc.get(n),o=hc.get(n);return[...r].length===1&&t.add(r),o&&t.add(o),i&&t.add(i),t.add(n),s&&t.add(s),[...t]}var wn=new Map(`C Other
62
- Cc Control cntrl
63
- Cf Format
64
- Cn Unassigned
65
- Co Private_Use
66
- Cs Surrogate
67
- L Letter
68
- LC Cased_Letter
69
- Ll Lowercase_Letter
70
- Lm Modifier_Letter
71
- Lo Other_Letter
72
- Lt Titlecase_Letter
73
- Lu Uppercase_Letter
74
- M Mark Combining_Mark
75
- Mc Spacing_Mark
76
- Me Enclosing_Mark
77
- Mn Nonspacing_Mark
78
- N Number
79
- Nd Decimal_Number digit
80
- Nl Letter_Number
81
- No Other_Number
82
- P Punctuation punct
83
- Pc Connector_Punctuation
84
- Pd Dash_Punctuation
85
- Pe Close_Punctuation
86
- Pf Final_Punctuation
87
- Pi Initial_Punctuation
88
- Po Other_Punctuation
89
- Ps Open_Punctuation
90
- S Symbol
91
- Sc Currency_Symbol
92
- Sk Modifier_Symbol
93
- Sm Math_Symbol
94
- So Other_Symbol
95
- Z Separator
96
- Zl Line_Separator
97
- Zp Paragraph_Separator
98
- Zs Space_Separator
99
- ASCII
100
- ASCII_Hex_Digit AHex
101
- Alphabetic Alpha
102
- Any
103
- Assigned
104
- Bidi_Control Bidi_C
105
- Bidi_Mirrored Bidi_M
106
- Case_Ignorable CI
107
- Cased
108
- Changes_When_Casefolded CWCF
109
- Changes_When_Casemapped CWCM
110
- Changes_When_Lowercased CWL
111
- Changes_When_NFKC_Casefolded CWKCF
112
- Changes_When_Titlecased CWT
113
- Changes_When_Uppercased CWU
114
- Dash
115
- Default_Ignorable_Code_Point DI
116
- Deprecated Dep
117
- Diacritic Dia
118
- Emoji
119
- Emoji_Component EComp
120
- Emoji_Modifier EMod
121
- Emoji_Modifier_Base EBase
122
- Emoji_Presentation EPres
123
- Extended_Pictographic ExtPict
124
- Extender Ext
125
- Grapheme_Base Gr_Base
126
- Grapheme_Extend Gr_Ext
127
- Hex_Digit Hex
128
- IDS_Binary_Operator IDSB
129
- IDS_Trinary_Operator IDST
130
- ID_Continue IDC
131
- ID_Start IDS
132
- Ideographic Ideo
133
- Join_Control Join_C
134
- Logical_Order_Exception LOE
135
- Lowercase Lower
136
- Math
137
- Noncharacter_Code_Point NChar
138
- Pattern_Syntax Pat_Syn
139
- Pattern_White_Space Pat_WS
140
- Quotation_Mark QMark
141
- Radical
142
- Regional_Indicator RI
143
- Sentence_Terminal STerm
144
- Soft_Dotted SD
145
- Terminal_Punctuation Term
146
- Unified_Ideograph UIdeo
147
- Uppercase Upper
148
- Variation_Selector VS
149
- White_Space space
150
- XID_Continue XIDC
151
- XID_Start XIDS`.split(/\s/).map(e=>[gt(e),e])),dc=new Map([["s",R(383)],[R(383),"s"]]),hc=new Map([[R(223),R(7838)],[R(107),R(8490)],[R(229),R(8491)],[R(969),R(8486)]]),fc=new Map([Y(453),Y(456),Y(459),Y(498),...Tt(8072,8079),...Tt(8088,8095),...Tt(8104,8111),Y(8124),Y(8140),Y(8188)]),mc=new Map([["alnum",_`[\p{Alpha}\p{Nd}]`],["alpha",_`\p{Alpha}`],["ascii",_`\p{ASCII}`],["blank",_`[\p{Zs}\t]`],["cntrl",_`\p{Cc}`],["digit",_`\p{Nd}`],["graph",_`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],["lower",_`\p{Lower}`],["print",_`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],["punct",_`[\p{P}\p{S}]`],["space",_`\p{space}`],["upper",_`\p{Upper}`],["word",_`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],["xdigit",_`\p{AHex}`]]);function gc(e,t){const n=[];for(let r=e;r<=t;r++)n.push(r);return n}function Y(e){const t=R(e);return[t.toLowerCase(),t]}function Tt(e,t){return gc(e,t).map(n=>Y(n))}var Ei=new Set(["Lower","Lowercase","Upper","Uppercase","Ll","Lowercase_Letter","Lt","Titlecase_Letter","Lu","Uppercase_Letter"]);function yc(e,t){const n={accuracy:"default",asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:"ES2025",...t};Ni(e);const r={accuracy:n.accuracy,asciiWordBoundaries:n.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:en(n.bestEffortTarget,"ES2024"),passedLookbehind:!1,strategy:null,subroutineRefMap:new Map,supportedGNodes:new Set,digitIsAscii:e.flags.digitIsAscii,spaceIsAscii:e.flags.spaceIsAscii,wordIsAscii:e.flags.wordIsAscii};ve(e,bc,r);const i={dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},s={currentFlags:i,prevFlags:null,globalFlags:i,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:r.subroutineRefMap};ve(e,wc,s);const o={groupsByName:s.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:s.reffedNodesByReferencer};return ve(e,Cc,o),e._originMap=s.groupOriginByCopy,e._strategy=r.strategy,e}var bc={AbsenceFunction({node:e,parent:t,replaceWith:n}){const{body:r,kind:i}=e;if(i==="repeater"){const s=H();s.body[0].body.push(ie({negate:!0,body:r}),he("Any"));const o=H();o.body[0].body.push(wi("greedy",0,1/0,s)),n(E(o,t),{traverse:!0})}else throw new Error('Unsupported absence function "(?~|"')},Alternative:{enter({node:e,parent:t,key:n},{flagDirectivesByAlt:r}){const i=e.body.filter(s=>s.kind==="flags");for(let s=n+1;s<t.body.length;s++){const o=t.body[s];Ie(r,o,[]).push(...i)}},exit({node:e},{flagDirectivesByAlt:t}){if(t.get(e)?.length){const n=Ri(t.get(e));if(n){const r=H({flags:n});r.body[0].body=e.body,e.body=[E(r,e)]}}}},Assertion({node:e,parent:t,key:n,container:r,root:i,remove:s,replaceWith:o},a){const{kind:l,negate:c}=e,{asciiWordBoundaries:p,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")o(E(ie({body:[ae({body:[Qt("string_end")]}),ae({body:[mt(10)]})]}),t));else if(l==="line_start")o(E(Q(_`(?<=\A|\n(?!\z))`,{skipLookbehindValidation:!0}),t));else if(l==="search_start")if(h.has(e))i.flags.sticky=!0,s();else{const f=r[n-1];if(f&&Ac(f))o(E(ie({negate:!0}),t));else{if(u)throw new Error(_`Uses "\G" in a way that requires a subclass`);o(ee(Qt("string_start"),t)),a.strategy="clip_search"}}else if(!(l==="string_end"||l==="string_start"))if(l==="string_end_newline")o(E(Q(_`(?=\n?\z)`),t));else if(l==="word_boundary"){if(!d&&!p){const f=`(?:(?<=${K})(?!${K})|(?<!${K})(?=${K}))`,w=`(?:(?<=${K})(?=${K})|(?<!${K})(?!${K}))`;o(E(Q(c?w:f),t))}}else throw new Error(`Unexpected assertion kind "${l}"`)},Backreference({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n=="string"&&!$t(n)&&(n=Pt(n,t),e.ref=n)},CapturingGroup({node:e},{jsGroupNameMap:t,subroutineRefMap:n}){let{name:r}=e;r&&!$t(r)&&(r=Pt(r,t),e.name=r),n.set(e.number,e),r&&n.set(r,e)},CharacterClassRange({node:e,parent:t,replaceWith:n}){if(t.kind==="intersection"){const r=ze({body:[e]});n(E(r,t),{traverse:!0})}},CharacterSet({node:e,parent:t,replaceWith:n},{accuracy:r,minTargetEs2024:i,digitIsAscii:s,spaceIsAscii:o,wordIsAscii:a}){const{kind:l,negate:c,value:p}=e;if(s&&(l==="digit"||p==="digit")){n(ee(Zt("digit",{negate:c}),t));return}if(o&&(l==="space"||p==="space")){n(E(Mt(Q(uc),c),t));return}if(a&&(l==="word"||p==="word")){n(ee(Zt("word",{negate:c}),t));return}if(l==="any")n(ee(he("Any"),t));else if(l==="digit")n(ee(he("Nd",{negate:c}),t));else if(l!=="dot")if(l==="text_segment"){if(r==="strict")throw new Error(_`Use of "\X" requires non-strict accuracy`);const u="\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?",h=_`\p{RI}{2}|${u}(?:\u200D${u})*`;n(E(Q(_`(?>\r\n|${i?_`\p{RGI_Emoji}`:h}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),t))}else if(l==="hex")n(ee(he("AHex",{negate:c}),t));else if(l==="newline")n(E(Q(c?`[^
152
- ]`:`(?>\r
153
- ?|[
154
- \v\f…\u2028\u2029])`),t));else if(l==="posix")if(!i&&(p==="graph"||p==="print")){if(r==="strict")throw new Error(`POSIX class "${p}" requires min target ES2024 or non-strict accuracy`);let u={graph:"!-~",print:" -~"}[p];c&&(u=`\0-${R(u.codePointAt(0)-1)}${R(u.codePointAt(2)+1)}-􏿿`),n(E(Q(`[${u}]`),t))}else n(E(Mt(Q(mc.get(p)),c),t));else if(l==="property")wn.has(gt(p))||(e.key="sc");else if(l==="space")n(ee(he("space",{negate:c}),t));else if(l==="word")n(E(Mt(Q(K),c),t));else throw new Error(`Unexpected character set kind "${l}"`)},Directive({node:e,parent:t,root:n,remove:r,replaceWith:i,removeAllPrevSiblings:s,removeAllNextSiblings:o}){const{kind:a,flags:l}=e;if(a==="flags")if(!l.enable&&!l.disable)r();else{const c=H({flags:l});c.body[0].body=o(),i(E(c,t),{traverse:!0})}else if(a==="keep"){const c=n.body[0],u=n.body.length===1&&gi(c,{type:"Group"})&&c.body[0].body.length===1?c.body[0]:n;if(t.parent!==u||u.body.length>1)throw new Error(_`Uses "\K" in a way that's unsupported`);const h=ie({behind:!0});h.body[0].body=s(),i(E(h,t))}else throw new Error(`Unexpected directive kind "${a}"`)},Flags({node:e,parent:t}){if(e.posixIsAscii)throw new Error('Unsupported flag "P"');if(e.textSegmentMode==="word")throw new Error('Unsupported flag "y{w}"');["digitIsAscii","extended","posixIsAscii","spaceIsAscii","wordIsAscii","textSegmentMode"].forEach(n=>delete e[n]),Object.assign(e,{global:!1,hasIndices:!1,multiline:!1,sticky:e.sticky??!1}),t.options={disable:{x:!0,n:!0},force:{v:!0}}},Group({node:e}){if(!e.flags)return;const{enable:t,disable:n}=e.flags;t?.extended&&delete t.extended,n?.extended&&delete n.extended,t?.dotAll&&n?.dotAll&&delete t.dotAll,t?.ignoreCase&&n?.ignoreCase&&delete t.ignoreCase,t&&!Object.keys(t).length&&delete e.flags.enable,n&&!Object.keys(n).length&&delete e.flags.disable,!e.flags.enable&&!e.flags.disable&&delete e.flags},LookaroundAssertion({node:e},t){const{kind:n}=e;n==="lookbehind"&&(t.passedLookbehind=!0)},NamedCallout({node:e,parent:t,replaceWith:n}){const{kind:r}=e;if(r==="fail")n(E(ie({negate:!0}),t));else throw new Error(`Unsupported named callout "(*${r.toUpperCase()}"`)},Quantifier({node:e}){if(e.body.type==="Quantifier"){const t=H();t.body[0].body.push(e.body),e.body=E(t,e)}},Regex:{enter({node:e},{supportedGNodes:t}){const n=[];let r=!1,i=!1;for(const s of e.body)if(s.body.length===1&&s.body[0].kind==="search_start")s.body.pop();else{const o=Ti(s.body);o?(r=!0,Array.isArray(o)?n.push(...o):n.push(o)):i=!0}r&&!i&&n.forEach(s=>t.add(s))},exit(e,{accuracy:t,passedLookbehind:n,strategy:r}){if(t==="strict"&&n&&r)throw new Error(_`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n=="string"&&!$t(n)&&(n=Pt(n,t),e.ref=n)}},wc={Backreference({node:e},{multiplexCapturesToLeftByRef:t,reffedNodesByReferencer:n}){const{orphan:r,ref:i}=e;r||n.set(e,[...t.get(i).map(({node:s})=>s)])},CapturingGroup:{enter({node:e,parent:t,replaceWith:n,skip:r},{groupOriginByCopy:i,groupsByName:s,multiplexCapturesToLeftByRef:o,openRefs:a,reffedNodesByReferencer:l}){const c=i.get(e);if(c&&a.has(e.number)){const u=ee(ar(e.number),t);l.set(u,a.get(e.number)),n(u);return}a.set(e.number,e),o.set(e.number,[]),e.name&&Ie(o,e.name,[]);const p=o.get(e.name??e.number);for(let u=0;u<p.length;u++){const h=p[u];if(c===h.node||c&&c===h.origin||e===h.origin){p.splice(u,1);break}}if(o.get(e.number).push({node:e,origin:c}),e.name&&o.get(e.name).push({node:e,origin:c}),e.name){const u=Ie(s,e.name,new Map);let h=!1;if(c)h=!0;else for(const d of u.values())if(!d.hasDuplicateNameToRemove){h=!0;break}s.get(e.name).set(e,{node:e,hasDuplicateNameToRemove:h})}},exit({node:e},{openRefs:t}){t.get(e.number)===e&&t.delete(e.number)}},Group:{enter({node:e},t){t.prevFlags=t.currentFlags,e.flags&&(t.currentFlags=it(t.currentFlags,e.flags))},exit(e,t){t.currentFlags=t.prevFlags}},Subroutine({node:e,parent:t,replaceWith:n},r){const{isRecursive:i,ref:s}=e;if(i){let p=t;for(;(p=p.parent)&&!(p.type==="CapturingGroup"&&(p.name===s||p.number===s)););r.reffedNodesByReferencer.set(e,p);return}const o=r.subroutineRefMap.get(s),a=s===0,l=a?ar(0):Li(o,r.groupOriginByCopy,null);let c=l;if(!a){const p=Ri(kc(o,h=>h.type==="Group"&&!!h.flags)),u=p?it(r.globalFlags,p):r.globalFlags;_c(u,r.currentFlags)||(c=H({flags:vc(u)}),c.body[0].body.push(l))}n(E(c,t),{traverse:!a})}},Cc={Backreference({node:e,parent:t,replaceWith:n},r){if(e.orphan){r.highestOrphanBackref=Math.max(r.highestOrphanBackref,e.ref);return}const s=r.reffedNodesByReferencer.get(e).filter(o=>Sc(o,e));if(!s.length)n(E(ie({negate:!0}),t));else if(s.length>1){const o=H({atomic:!0,body:s.reverse().map(a=>ae({body:[Jt(a.number)]}))});n(E(o,t))}else e.ref=s[0].number},CapturingGroup({node:e},t){e.number=++t.numCapturesToLeft,e.name&&t.groupsByName.get(e.name).get(e).hasDuplicateNameToRemove&&delete e.name},Regex:{exit({node:e},t){const n=Math.max(t.highestOrphanBackref-t.numCapturesToLeft,0);for(let r=0;r<n;r++){const i=bi();e.body.at(-1).body.push(i)}}},Subroutine({node:e},t){!e.isRecursive||e.ref===0||(e.ref=t.reffedNodesByReferencer.get(e).number)}};function Ni(e){ve(e,{"*"({node:t,parent:n}){t.parent=n}})}function _c(e,t){return e.dotAll===t.dotAll&&e.ignoreCase===t.ignoreCase}function Sc(e,t){let n=t;do{if(n.type==="Regex")return!1;if(n.type==="Alternative")continue;if(n===e)return!1;const r=Ii(n.parent);for(const i of r){if(i===n)break;if(i===e||Pi(i,e))return!0}}while(n=n.parent);throw new Error("Unexpected path")}function Li(e,t,n,r){const i=Array.isArray(e)?[]:{};for(const[s,o]of Object.entries(e))s==="parent"?i.parent=Array.isArray(n)?r:n:o&&typeof o=="object"?i[s]=Li(o,t,i,n):(s==="type"&&o==="CapturingGroup"&&t.set(i,t.get(e)??e),i[s]=o);return i}function ar(e){const t=Ci(e);return t.isRecursive=!0,t}function kc(e,t){const n=[];for(;e=e.parent;)(!t||t(e))&&n.push(e);return n}function Pt(e,t){if(t.has(e))return t.get(e);const n=`$${t.size}_${e.replace(/^[^$_\p{IDS}]|[^$\u200C\u200D\p{IDC}]/ug,"_")}`;return t.set(e,n),n}function Ri(e){const t=["dotAll","ignoreCase"],n={enable:{},disable:{}};return e.forEach(({flags:r})=>{t.forEach(i=>{r.enable?.[i]&&(delete n.disable[i],n.enable[i]=!0),r.disable?.[i]&&(n.disable[i]=!0)})}),Object.keys(n.enable).length||delete n.enable,Object.keys(n.disable).length||delete n.disable,n.enable||n.disable?n:null}function vc({dotAll:e,ignoreCase:t}){const n={};return(e||t)&&(n.enable={},e&&(n.enable.dotAll=!0),t&&(n.enable.ignoreCase=!0)),(!e||!t)&&(n.disable={},!e&&(n.disable.dotAll=!0),!t&&(n.disable.ignoreCase=!0)),n}function Ii(e){if(!e)throw new Error("Node expected");const{body:t}=e;return Array.isArray(t)?t:t?[t]:null}function Ti(e){const t=e.find(n=>n.kind==="search_start"||Ec(n,{negate:!1})||!xc(n));if(!t)return null;if(t.kind==="search_start")return t;if(t.type==="LookaroundAssertion")return t.body[0].body[0];if(t.type==="CapturingGroup"||t.type==="Group"){const n=[];for(const r of t.body){const i=Ti(r.body);if(!i)return null;Array.isArray(i)?n.push(...i):n.push(i)}return n}return null}function Pi(e,t){const n=Ii(e)??[];for(const r of n)if(r===t||Pi(r,t))return!0;return!1}function xc({type:e}){return e==="Assertion"||e==="Directive"||e==="LookaroundAssertion"}function Ac(e){const t=["Character","CharacterClass","CharacterSet"];return t.includes(e.type)||e.type==="Quantifier"&&e.min&&t.includes(e.body.type)}function Ec(e,t){const n={negate:null,...t};return e.type==="LookaroundAssertion"&&(n.negate===null||e.negate===n.negate)&&e.body.length===1&&gi(e.body[0],{type:"Assertion",kind:"search_start"})}function $t(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function Q(e,t){const r=yi(e,{...t,unicodePropertyMap:wn}).body;return r.length>1||r[0].body.length>1?H({body:r}):r[0].body[0]}function Mt(e,t){return e.negate=t,e}function ee(e,t){return e.parent=t,e}function E(e,t){return Ni(e),e.parent=t,e}function Nc(e,t){const n=xi(t),r=en(n.target,"ES2024"),i=en(n.target,"ES2025"),s=n.rules.recursionLimit;if(!Number.isInteger(s)||s<2||s>20)throw new Error("Invalid recursionLimit; use 2-20");let o=null,a=null;if(!i){const d=[e.flags.ignoreCase];ve(e,Lc,{getCurrentModI:()=>d.at(-1),popModI(){d.pop()},pushModI(f){d.push(f)},setHasCasedChar(){d.at(-1)?o=!0:a=!0}})}const l={dotAll:e.flags.dotAll,ignoreCase:!!((e.flags.ignoreCase||o)&&!a)};let c=e;const p={accuracy:n.accuracy,appliedGlobalFlags:l,captureMap:new Map,currentFlags:{dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},inCharClass:!1,lastNode:c,originMap:e._originMap,recursionLimit:s,useAppliedIgnoreCase:!!(!i&&o&&a),useFlagMods:i,useFlagV:r,verbose:n.verbose};function u(d){return p.lastNode=c,c=d,lc(Rc[d.type],`Unexpected node type "${d.type}"`)(d,p,u)}const h={pattern:e.body.map(u).join("|"),flags:u(e.flags),options:{...e.options}};return r||(delete h.options.force.v,h.options.disable.v=!0,h.options.unicodeSetsPlugin=null),h._captureTransfers=new Map,h._hiddenCaptures=[],p.captureMap.forEach((d,f)=>{d.hidden&&h._hiddenCaptures.push(f),d.transferTo&&Ie(h._captureTransfers,d.transferTo,[]).push(f)}),h}var Lc={"*":{enter({node:e},t){if(cr(e)){const n=t.getCurrentModI();t.pushModI(e.flags?it({ignoreCase:n},e.flags).ignoreCase:n)}},exit({node:e},t){cr(e)&&t.popModI()}},Backreference(e,t){t.setHasCasedChar()},Character({node:e},t){Cn(R(e.value))&&t.setHasCasedChar()},CharacterClassRange({node:e,skip:t},n){t(),$i(e,{firstOnly:!0}).length&&n.setHasCasedChar()},CharacterSet({node:e},t){e.kind==="property"&&Ei.has(e.value)&&t.setHasCasedChar()}},Rc={Alternative({body:e},t,n){return e.map(n).join("")},Assertion({kind:e,negate:t}){if(e==="string_end")return"$";if(e==="string_start")return"^";if(e==="word_boundary")return t?_`\B`:_`\b`;throw new Error(`Unexpected assertion kind "${e}"`)},Backreference({ref:e},t){if(typeof e!="number")throw new Error("Unexpected named backref in transformed AST");if(!t.useFlagMods&&t.accuracy==="strict"&&t.currentFlags.ignoreCase&&!t.captureMap.get(e).ignoreCase)throw new Error("Use of case-insensitive backref to case-sensitive group requires target ES2025 or non-strict accuracy");return"\\"+e},CapturingGroup(e,t,n){const{body:r,name:i,number:s}=e,o={ignoreCase:t.currentFlags.ignoreCase},a=t.originMap.get(e);return a&&(o.hidden=!0,s>a.number&&(o.transferTo=a.number)),t.captureMap.set(s,o),`(${i?`?<${i}>`:""}${r.map(n).join("|")})`},Character({value:e},t){const n=R(e),r=pe(e,{escDigit:t.lastNode.type==="Backreference",inCharClass:t.inCharClass,useFlagV:t.useFlagV});if(r!==n)return r;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&Cn(n)){const i=Ai(n);return t.inCharClass?i.join(""):i.length>1?`[${i.join("")}]`:i[0]}return n},CharacterClass(e,t,n){const{kind:r,negate:i,parent:s}=e;let{body:o}=e;if(r==="intersection"&&!t.useFlagV)throw new Error("Use of character class intersection requires min target ES2024");W.bugFlagVLiteralHyphenIsRange&&t.useFlagV&&o.some(ur)&&(o=[mt(45),...o.filter(c=>!ur(c))]);const a=()=>`[${i?"^":""}${o.map(n).join(r==="intersection"?"&&":"")}]`;if(!t.inCharClass){if((!t.useFlagV||W.bugNestedClassIgnoresNegation)&&!i){const p=o.filter(u=>u.type==="CharacterClass"&&u.kind==="union"&&u.negate);if(p.length){const u=H(),h=u.body[0];return u.parent=s,h.parent=u,o=o.filter(d=>!p.includes(d)),e.body=o,o.length?(e.parent=h,h.body.push(e)):u.body.pop(),p.forEach(d=>{const f=ae({body:[d]});d.parent=f,f.parent=u,u.body.push(f)}),n(u)}}t.inCharClass=!0;const c=a();return t.inCharClass=!1,c}const l=o[0];if(r==="union"&&!i&&l&&((!t.useFlagV||!t.verbose)&&s.kind==="union"&&!(W.bugFlagVLiteralHyphenIsRange&&t.useFlagV)||!t.verbose&&s.kind==="intersection"&&o.length===1&&l.type!=="CharacterClassRange"))return o.map(n).join("");if(!t.useFlagV&&s.type==="CharacterClass")throw new Error("Uses nested character class in a way that requires min target ES2024");return a()},CharacterClassRange(e,t){const n=e.min.value,r=e.max.value,i={escDigit:!1,inCharClass:!0,useFlagV:t.useFlagV},s=pe(n,i),o=pe(r,i),a=new Set;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase){const l=$i(e);Mc(l).forEach(p=>{a.add(Array.isArray(p)?`${pe(p[0],i)}-${pe(p[1],i)}`:pe(p,i))})}return`${s}-${o}${[...a].join("")}`},CharacterSet({kind:e,negate:t,value:n,key:r},i){if(e==="dot")return i.currentFlags.dotAll?i.appliedGlobalFlags.dotAll||i.useFlagMods?".":"[^]":_`[^\n]`;if(e==="digit")return t?_`\D`:_`\d`;if(e==="property"){if(i.useAppliedIgnoreCase&&i.currentFlags.ignoreCase&&Ei.has(n))throw new Error(`Unicode property "${n}" can't be case-insensitive when other chars have specific case`);return`${t?_`\P`:_`\p`}{${r?`${r}=`:""}${n}}`}if(e==="word")return t?_`\W`:_`\w`;throw new Error(`Unexpected character set kind "${e}"`)},Flags(e,t){return(t.appliedGlobalFlags.ignoreCase?"i":"")+(e.dotAll?"s":"")+(e.sticky?"y":"")},Group({atomic:e,body:t,flags:n,parent:r},i,s){const o=i.currentFlags;n&&(i.currentFlags=it(o,n));const a=t.map(s).join("|"),l=!i.verbose&&t.length===1&&r.type!=="Quantifier"&&!e&&(!i.useFlagMods||!n)?a:`(?${Oc(e,n,i.useFlagMods)}${a})`;return i.currentFlags=o,l},LookaroundAssertion({body:e,kind:t,negate:n},r,i){return`(?${`${t==="lookahead"?"":"<"}${n?"!":"="}`}${e.map(i).join("|")})`},Quantifier(e,t,n){return n(e.body)+Gc(e)},Subroutine({isRecursive:e,ref:t},n){if(!e)throw new Error("Unexpected non-recursive subroutine in transformed AST");const r=n.recursionLimit;return t===0?`(?R=${r})`:_`\g<${t}&R=${r}>`}},Ic=new Set(["$","(",")","*","+",".","?","[","\\","]","^","{","|","}"]),Tc=new Set(["-","\\","]","^","["]),Pc=new Set(["(",")","-","/","[","\\","]","^","{","|","}","!","#","$","%","&","*","+",",",".",":",";","<","=",">","?","@","`","~"]),lr=new Map([[9,_`\t`],[10,_`\n`],[11,_`\v`],[12,_`\f`],[13,_`\r`],[8232,_`\u2028`],[8233,_`\u2029`],[65279,_`\uFEFF`]]),$c=/^\p{Cased}$/u;function Cn(e){return $c.test(e)}function $i(e,t){const n=!!t?.firstOnly,r=e.min.value,i=e.max.value,s=[];if(r<65&&(i===65535||i>=131071)||r===65536&&i>=131071)return s;for(let o=r;o<=i;o++){const a=R(o);if(!Cn(a))continue;const l=Ai(a).filter(c=>{const p=c.codePointAt(0);return p<r||p>i});if(l.length&&(s.push(...l),n))break}return s}function pe(e,{escDigit:t,inCharClass:n,useFlagV:r}){if(lr.has(e))return lr.get(e);if(e<32||e>126&&e<160||e>262143||t&&Bc(e))return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,"0")}`;const i=n?r?Pc:Tc:Ic,s=R(e);return(i.has(s)?"\\":"")+s}function Mc(e){const t=e.map(i=>i.codePointAt(0)).sort((i,s)=>i-s),n=[];let r=null;for(let i=0;i<t.length;i++)t[i+1]===t[i]+1?r??=t[i]:r===null?n.push(t[i]):(n.push([r,t[i]]),r=null);return n}function Oc(e,t,n){if(e)return">";let r="";if(t&&n){const{enable:i,disable:s}=t;r=(i?.ignoreCase?"i":"")+(i?.dotAll?"s":"")+(s?"-":"")+(s?.ignoreCase?"i":"")+(s?.dotAll?"s":"")}return`${r}:`}function Gc({kind:e,max:t,min:n}){let r;return!n&&t===1?r="?":!n&&t===1/0?r="*":n===1&&t===1/0?r="+":n===t?r=`{${n}}`:r=`{${n},${t===1/0?"":t}}`,r+{greedy:"",lazy:"?",possessive:"+"}[e]}function cr({type:e}){return e==="CapturingGroup"||e==="Group"||e==="LookaroundAssertion"}function Bc(e){return e>47&&e<58}function ur({type:e,value:t}){return e==="Character"&&t===45}var Dc=class tn extends RegExp{#t=new Map;#e=null;#r;#n=null;#i=null;rawOptions={};get source(){return this.#r||"(?:)"}constructor(t,n,r){const i=!!r?.lazyCompile;if(t instanceof RegExp){if(r)throw new Error("Cannot provide options when copying a regexp");const s=t;super(s,n),this.#r=s.source,s instanceof tn&&(this.#t=s.#t,this.#n=s.#n,this.#i=s.#i,this.rawOptions=s.rawOptions)}else{const s={hiddenCaptures:[],strategy:null,transfers:[],...r};super(i?"":t,n),this.#r=t,this.#t=Fc(s.hiddenCaptures,s.transfers),this.#i=s.strategy,this.rawOptions=r??{}}i||(this.#e=this)}exec(t){if(!this.#e){const{lazyCompile:i,...s}=this.rawOptions;this.#e=new tn(this.#r,this.flags,s)}const n=this.global||this.sticky,r=this.lastIndex;if(this.#i==="clip_search"&&n&&r){this.lastIndex=0;const i=this.#s(t.slice(r));return i&&(Uc(i,r,t,this.hasIndices),this.lastIndex+=r),i}return this.#s(t)}#s(t){this.#e.lastIndex=this.lastIndex;const n=super.exec.call(this.#e,t);if(this.lastIndex=this.#e.lastIndex,!n||!this.#t.size)return n;const r=[...n];n.length=1;let i;this.hasIndices&&(i=[...n.indices],n.indices.length=1);const s=[0];for(let o=1;o<r.length;o++){const{hidden:a,transferTo:l}=this.#t.get(o)??{};if(a?s.push(null):(s.push(n.length),n.push(r[o]),this.hasIndices&&n.indices.push(i[o])),l&&r[o]!==void 0){const c=s[l];if(!c)throw new Error(`Invalid capture transfer to "${c}"`);if(n[c]=r[o],this.hasIndices&&(n.indices[c]=i[o]),n.groups){this.#n||(this.#n=jc(this.source));const p=this.#n.get(l);p&&(n.groups[p]=r[o],this.hasIndices&&(n.indices.groups[p]=i[o]))}}}return n}};function Uc(e,t,n,r){if(e.index+=t,e.input=n,r){const i=e.indices;for(let o=0;o<i.length;o++){const a=i[o];a&&(i[o]=[a[0]+t,a[1]+t])}const s=i.groups;s&&Object.keys(s).forEach(o=>{const a=s[o];a&&(s[o]=[a[0]+t,a[1]+t])})}}function Fc(e,t){const n=new Map;for(const r of e)n.set(r,{hidden:!0});for(const[r,i]of t)for(const s of i)Ie(n,s,{}).transferTo=r;return n}function jc(e){const t=/(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu,n=new Map;let r=0,i=0,s;for(;s=t.exec(e);){const{0:o,groups:{capture:a,name:l}}=s;o==="["?r++:r?o==="]"&&r--:a&&(i++,l&&n.set(i,l))}return n}function Hc(e,t){const n=Wc(e,t);return n.options?new Dc(n.pattern,n.flags,n.options):new RegExp(n.pattern,n.flags)}function Wc(e,t){const n=xi(t),r=yi(e,{flags:n.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline},skipBackrefValidation:n.rules.allowOrphanBackrefs,unicodePropertyMap:wn}),i=yc(r,{accuracy:n.accuracy,asciiWordBoundaries:n.rules.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,bestEffortTarget:n.target}),s=Nc(i,n),o=oc(s.pattern,{captureTransfers:s._captureTransfers,hiddenCaptures:s._hiddenCaptures,mode:"external"}),a=ic(o.pattern),l=rc(a.pattern,{captureTransfers:o.captureTransfers,hiddenCaptures:o.hiddenCaptures}),c={pattern:l.pattern,flags:`${n.hasIndices?"d":""}${n.global?"g":""}${s.flags}${s.options.disable.v?"u":"v"}`};if(n.avoidSubclass){if(n.lazyCompileLength!==1/0)throw new Error("Lazy compilation requires subclass")}else{const p=l.hiddenCaptures.sort((f,w)=>f-w),u=Array.from(l.captureTransfers),h=i._strategy,d=c.pattern.length>=n.lazyCompileLength;(p.length||u.length||h||d)&&(c.options={...p.length&&{hiddenCaptures:p},...u.length&&{transfers:u},...h&&{strategy:h},...d&&{lazyCompile:d}})}return c}function Mi(e,t){return Hc(e,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...t})}function zc(e={}){const t={target:"auto",cache:new Map,...e};return t.regexConstructor||=n=>Mi(n,{target:t.target}),{createScanner(n){return new al(n,t)},createString(n){return{content:n}}}}dr(nn({bundledLanguages:()=>xe,bundledLanguagesAlias:()=>sn,bundledLanguagesBase:()=>rn,bundledLanguagesInfo:()=>ot,bundledThemes:()=>an,bundledThemesInfo:()=>on,codeToHast:()=>si,codeToHtml:()=>ii,codeToTokens:()=>oi,codeToTokensBase:()=>ai,codeToTokensWithThemes:()=>li,createHighlighter:()=>ft,createJavaScriptRegexEngine:()=>zc,createOnigurumaEngine:()=>mr,defaultJavaScriptRegexConstructor:()=>Mi,getLastGrammarState:()=>ui,getSingletonHighlighter:()=>ci,loadWasm:()=>cn}),ol);function Vc(e){const t=[],n=new Map;let r,i=0;const s=()=>{r||(r=Promise.resolve().then(async()=>{for(;i<t.length;){const o=t[i++];if(o.type==="dispose"){e.dispose(o.key);continue}n.get(o.key)===o&&n.delete(o.key);const a=o.request;o.request=void 0,a&&await e.run(a)}}).finally(()=>{t.splice(0,i),i=0,r=void 0,t.length>0&&s()}))};return{highlight(o){const a=n.get(o.key);if(a){a.request&&e.supersede(a.request),a.request=o;return}const l={type:"highlight",key:o.key,request:o};n.set(o.key,l),t.push(l),s()},dispose(o){const a=n.get(o);a?.request&&e.supersede(a.request),a&&(a.request=void 0,n.delete(o)),t.push({type:"dispose",key:o}),s()},pending:()=>n.size,async idle(){for(;r;)await r}}}const Ve=new Map;let Oi;const pr=Vc({run:qc,supersede:e=>qe({type:"superseded",id:e.id,key:e.key}),dispose:e=>void Ve.delete(e)});self.onmessage=e=>{if(e.data.type==="init"){Oi??=ft({themes:[e.data.theme],langs:[]});return}if(e.data.type==="dispose"){pr.dispose(e.data.key);return}pr.highlight(e.data)};async function qc(e){try{const t=await Oi;if(!t)throw new Error("Shiki worker is not initialized");const n=e.language in xe?e.language:"text";if(t.getLoadedLanguages().includes(n)||await t.loadLanguage(xe[n]),e.complete){const a=t.codeToTokens(e.text,{lang:n,theme:"OpenCode"});Ve.delete(e.key),qe({type:"highlight",id:e.id,key:e.key,reset:!0,stable:a.tokens.flatMap((l,c)=>c===a.tokens.length-1?l:[...l,{content:`
155
- `,offset:0}]).map(Ot),unstable:[]});return}const r=Ve.get(e.key),i=!r||r.language!==n||!e.text.startsWith(r.source),s=i?{language:n,source:"",tokenizer:new st({highlighter:t,lang:n,theme:"OpenCode"})}:r,o=await s.tokenizer.enqueue(e.text.slice(s.source.length));s.source=e.text,Ve.set(e.key,s),qe({type:"highlight",id:e.id,key:e.key,reset:i,stable:o.stable.filter(a=>a.content.length>0).map(Ot),unstable:o.unstable.filter(a=>a.content.length>0).map(Ot)})}catch(t){qe({type:"error",id:e.id,key:e.key,message:t instanceof Error?t.message:String(t)})}}function qe(e){self.postMessage(e)}function Ot(e){return[e.content,et(e.htmlStyle??Re(e))]}
156
- //# sourceMappingURL=markdown-shiki.worker-sTYREXj-.js.map