@kilocode/cli-darwin-x64-baseline 7.4.16 → 7.4.18

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