@refrakt-md/editor 0.9.8 → 0.9.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/dist/assets/{index-CDTHaQ-c.js → index-B9fp5Adw.js} +1 -1
- package/app/dist/assets/{index-CNYrYMen.js → index-BL3HqF34.js} +1 -1
- package/app/dist/assets/{index-fHWG7gTV.js → index-BOmkb0ft.js} +1 -1
- package/app/dist/assets/{index-B5NZH8Ad.js → index-BdRXcGC-.js} +1 -1
- package/app/dist/assets/{index-DVhlkzDR.js → index-CErBsE-A.js} +1 -1
- package/app/dist/assets/{index-DgeOzQoU.js → index-CH9ppf9G.js} +1 -1
- package/app/dist/assets/{index-DrZ9HXGS.js → index-CHLUMzKN.js} +1 -1
- package/app/dist/assets/{index-CHUnUf0V.js → index-CM9qeaA6.js} +1 -1
- package/app/dist/assets/{index-DyVqJ0K2.js → index-CZHl8b0e.js} +22 -22
- package/app/dist/assets/{index-BasMo-yt.js → index-C_tzxYaI.js} +1 -1
- package/app/dist/assets/{index-DODTKuOq.js → index-Cd9FBCbP.js} +1 -1
- package/app/dist/assets/{index-CuT2ffAo.js → index-Ce5Y0a8W.js} +1 -1
- package/app/dist/assets/{index-DB44Anmj.js → index-CgSSkHmz.js} +1 -1
- package/app/dist/assets/{index-BiLzMmUM.js → index-DBfakUQk.js} +1 -1
- package/app/dist/assets/{index-B_ZKOtMV.js → index-DCB1NXCb.js} +1 -1
- package/app/dist/assets/{index-DCx14GS5.js → index-DNcHG3HN.js} +1 -1
- package/app/dist/assets/{index-0EA4tQWR.js → index-DUzRsuRM.js} +1 -1
- package/app/dist/assets/{index-DhLPPpOf.js → index-DiG9Z2vq.js} +1 -1
- package/app/dist/assets/{index-CEKKVh_6.js → index-iMa7gjbl.js} +1 -1
- package/app/dist/index.html +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +1 -56
- package/dist/server.js.map +1 -1
- package/package.json +6 -6
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/angular-html-CU67Zn6k.js","assets/html-GMplVEZG.js","assets/javascript-wDzz0qaB.js","assets/css-DPfMkruS.js","assets/angular-ts-BwZT4LLn.js","assets/scss-OYdSNvt2.js","assets/apl-dKokRX4l.js","assets/xml-sdJ4AIDG.js","assets/java-CylS5w8V.js","assets/json-Cp-IABpG.js","assets/astro-CbQHKStN.js","assets/typescript-BPQ3VLAy.js","assets/postcss-CXtECtnM.js","assets/tsx-COt5Ahok.js","assets/blade-D4QpJJKB.js","assets/html-derivative-BFtXZ54Q.js","assets/sql-BLtJtn59.js","assets/bsl-BO_Y6i37.js","assets/sdbl-DVxCFoDh.js","assets/cairo-KRGpt6FW.js","assets/python-B6aJPvgy.js","assets/cobol-nwyudZeR.js","assets/coffee-Ch7k5sss.js","assets/cpp-CofmeUqb.js","assets/regexp-CDVJQ6XC.js","assets/glsl-DplSGwfg.js","assets/c-BIGW1oBm.js","assets/crystal-tKQVLTB8.js","assets/shellscript-Yzrsuije.js","assets/edge-BkV0erSs.js","assets/elixir-CDX3lj18.js","assets/elm-DbKCFpqz.js","assets/erb-CgJxNhIT.js","assets/ruby-Cw6WdidG.js","assets/haml-B8DHNrY2.js","assets/graphql-ChdNCCLP.js","assets/jsx-g9-lgVsj.js","assets/lua-BaeVxFsk.js","assets/yaml-Buea-lGh.js","assets/erlang-DsQrWhSR.js","assets/markdown-Cvjx9yec.js","assets/fortran-fixed-form-CkoXwp7k.js","assets/fortran-free-form-BxgE0vQu.js","assets/fsharp-CXgrBDvD.js","assets/gdresource-BOOCDP_w.js","assets/gdshader-DkwncUOv.js","assets/gdscript-C5YyOfLZ.js","assets/git-commit-F4YmCXRG.js","assets/diff-D97Zzqfu.js","assets/git-rebase-r7XF79zn.js","assets/glimmer-js-Rg0-pVw9.js","assets/glimmer-ts-U6CK756n.js","assets/hack-CaT9iCJl.js","assets/handlebars-BL8al0AC.js","assets/http-jrhK8wxY.js","assets/hurl-irOxFIW8.js","assets/csv-fuZLfV_i.js","assets/hxml-Bvhsp5Yf.js","assets/haxe-CzTSHFRz.js","assets/jinja-4LBKfQ-Z.js","assets/jison-wvAkD_A8.js","assets/julia-CxzCAyBv.js","assets/r-Dspwwk_N.js","assets/latex-DGMBWnxU.js","assets/tex-CvyZ59Mk.js","assets/liquid-DYVedYrR.js","assets/marko-DZsq8hO1.js","assets/less-B1dDrJ26.js","assets/mdc-DUICxH0z.js","assets/nginx-BpAMiNFr.js","assets/nim-CVrawwO9.js","assets/perl-C0TMdlhV.js","assets/php-Dhbhpdrm.js","assets/pug-CGlum2m_.js","assets/qml-3beO22l8.js","assets/razor-Uh8Bk_45.js","assets/csharp-COcwbKMJ.js","assets/rst-D5oM4XIm.js","assets/cmake-D1j8_8rp.js","assets/sas-cz2c8ADy.js","assets/shaderlab-Dg9Lc6iA.js","assets/hlsl-D3lLCCz7.js","assets/shellsession-BADoaaVG.js","assets/soy-Brmx7dQM.js","assets/sparql-rVzFXLq3.js","assets/turtle-BsS91CYL.js","assets/stata-BH5u7GGu.js","assets/surrealql-Bq5Q-fJD.js","assets/svelte-zxCyuUbr.js","assets/templ-P3uqSqPl.js","assets/go-CxLEBnE3.js","assets/ts-tags-zn1MmPIZ.js","assets/twig-ChbOoGGc.js","assets/vue-DN_0RTcg.js","assets/vue-html-AaS7Mt5G.js","assets/vue-vine-CQOfvN7w.js","assets/stylus-BEDo0Tqx.js","assets/xsl-CtQFsRM5.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{_ as c,i as Ln}from"./index-DyVqJ0K2.js";let S=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function An(t){return Xe(t)}function Xe(t){return Array.isArray(t)?Tn(t):t instanceof RegExp?t:typeof t=="object"?kn(t):t}function Tn(t){let e=[];for(let n=0,r=t.length;n<r;n++)e[n]=Xe(t[n]);return e}function kn(t){let e={};for(let n in t)e[n]=Xe(t[n]);return e}function Dt(t,...e){return e.forEach(n=>{for(let r in n)t[r]=n[r]}),t}function xt(t){const e=~t.lastIndexOf("/")||~t.lastIndexOf("\\");return e===0?t:~e===t.length-1?xt(t.substring(0,t.length-1)):t.substr(~e+1)}var Ie=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,ae=class{static hasCaptures(t){return t===null?!1:(Ie.lastIndex=0,Ie.test(t))}static replaceCaptures(t,e,n){return t.replace(Ie,(r,i,o,s)=>{let l=n[parseInt(i||o,10)];if(l){let a=e.substring(l.start,l.end);for(;a[0]===".";)a=a.substring(1);switch(s){case"downcase":return a.toLowerCase();case"upcase":return a.toUpperCase();default:return a}}else return r})}};function Nt(t,e){return t<e?-1:t>e?1:0}function Vt(t,e){if(t===null&&e===null)return 0;if(!t)return-1;if(!e)return 1;let n=t.length,r=e.length;if(n===r){for(let i=0;i<n;i++){let o=Nt(t[i],e[i]);if(o!==0)return o}return 0}return n-r}function dt(t){return!!(/^#[0-9a-f]{6}$/i.test(t)||/^#[0-9a-f]{8}$/i.test(t)||/^#[0-9a-f]{3}$/i.test(t)||/^#[0-9a-f]{4}$/i.test(t))}function Mt(t){return t.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var Bt=class{constructor(t){this.fn=t}cache=new Map;get(t){if(this.cache.has(t))return this.cache.get(t);const e=this.fn(t);return this.cache.set(t,e),e}},pe=class{constructor(t,e,n){this._colorMap=t,this._defaults=e,this._root=n}static createFromRawTheme(t,e){return this.createFromParsedTheme(In(t),e)}static createFromParsedTheme(t,e){return wn(t,e)}_cachedMatchRoot=new Bt(t=>this._root.match(t));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(t){if(t===null)return this._defaults;const e=t.scopeName,r=this._cachedMatchRoot.get(e).find(i=>Sn(t.parent,i.parentScopes));return r?new Gt(r.fontStyle,r.foreground,r.background):null}},Oe=class de{constructor(e,n){this.parent=e,this.scopeName=n}static push(e,n){for(const r of n)e=new de(e,r);return e}static from(...e){let n=null;for(let r=0;r<e.length;r++)n=new de(n,e[r]);return n}push(e){return new de(this,e)}getSegments(){let e=this;const n=[];for(;e;)n.push(e.scopeName),e=e.parent;return n.reverse(),n}toString(){return this.getSegments().join(" ")}extends(e){return this===e?!0:this.parent===null?!1:this.parent.extends(e)}getExtensionIfDefined(e){const n=[];let r=this;for(;r&&r!==e;)n.push(r.scopeName),r=r.parent;return r===e?n.reverse():void 0}};function Sn(t,e){if(e.length===0)return!0;for(let n=0;n<e.length;n++){let r=e[n],i=!1;if(r===">"){if(n===e.length-1)return!1;r=e[++n],i=!0}for(;t&&!Pn(t.scopeName,r);){if(i)return!1;t=t.parent}if(!t)return!1;t=t.parent}return!0}function Pn(t,e){return e===t||t.startsWith(e)&&t[e.length]==="."}var Gt=class{constructor(t,e,n){this.fontStyle=t,this.foregroundId=e,this.backgroundId=n}};function In(t){if(!t)return[];if(!t.settings||!Array.isArray(t.settings))return[];let e=t.settings,n=[],r=0;for(let i=0,o=e.length;i<o;i++){let s=e[i];if(!s.settings)continue;let l;if(typeof s.scope=="string"){let m=s.scope;m=m.replace(/^[,]+/,""),m=m.replace(/[,]+$/,""),l=m.split(",")}else Array.isArray(s.scope)?l=s.scope:l=[""];let a=-1;if(typeof s.settings.fontStyle=="string"){a=0;let m=s.settings.fontStyle.split(" ");for(let f=0,p=m.length;f<p;f++)switch(m[f]){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 u=null;typeof s.settings.foreground=="string"&&dt(s.settings.foreground)&&(u=s.settings.foreground);let d=null;typeof s.settings.background=="string"&&dt(s.settings.background)&&(d=s.settings.background);for(let m=0,f=l.length;m<f;m++){let h=l[m].trim().split(" "),E=h[h.length-1],b=null;h.length>1&&(b=h.slice(0,h.length-1),b.reverse()),n[r++]=new On(E,b,i,a,u,d)}}return n}var On=class{constructor(t,e,n,r,i,o){this.scope=t,this.parentScopes=e,this.index=n,this.fontStyle=r,this.foreground=i,this.background=o}},C=(t=>(t[t.NotSet=-1]="NotSet",t[t.None=0]="None",t[t.Italic=1]="Italic",t[t.Bold=2]="Bold",t[t.Underline=4]="Underline",t[t.Strikethrough=8]="Strikethrough",t))(C||{});function wn(t,e){t.sort((a,u)=>{let d=Nt(a.scope,u.scope);return d!==0||(d=Vt(a.parentScopes,u.parentScopes),d!==0)?d:a.index-u.index});let n=0,r="#000000",i="#ffffff";for(;t.length>=1&&t[0].scope==="";){let a=t.shift();a.fontStyle!==-1&&(n=a.fontStyle),a.foreground!==null&&(r=a.foreground),a.background!==null&&(i=a.background)}let o=new Cn(e),s=new Gt(n,o.getId(r),o.getId(i)),l=new xn(new Ge(0,null,-1,0,0),[]);for(let a=0,u=t.length;a<u;a++){let d=t[a];l.insert(0,d.scope,d.parentScopes,d.fontStyle,o.getId(d.foreground),o.getId(d.background))}return new pe(o,s,l)}var Cn=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(t){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(t)){this._isFrozen=!0;for(let e=0,n=t.length;e<n;e++)this._color2id[t[e]]=e,this._id2color[e]=t[e]}else this._isFrozen=!1}getId(t){if(t===null)return 0;t=t.toUpperCase();let e=this._color2id[t];if(e)return e;if(this._isFrozen)throw new Error(`Missing color in color map - ${t}`);return e=++this._lastColorId,this._color2id[t]=e,this._id2color[e]=t,e}getColorMap(){return this._id2color.slice(0)}},Dn=Object.freeze([]),Ge=class jt{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,n,r,i,o){this.scopeDepth=e,this.parentScopes=n||Dn,this.fontStyle=r,this.foreground=i,this.background=o}clone(){return new jt(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let n=[];for(let r=0,i=e.length;r<i;r++)n[r]=e[r].clone();return n}acceptOverwrite(e,n,r,i){this.scopeDepth>e?console.log("how did this happen?"):this.scopeDepth=e,n!==-1&&(this.fontStyle=n),r!==0&&(this.foreground=r),i!==0&&(this.background=i)}},xn=class je{constructor(e,n=[],r={}){this._mainRule=e,this._children=r,this._rulesWithParentScopes=n}_rulesWithParentScopes;static _cmpBySpecificity(e,n){if(e.scopeDepth!==n.scopeDepth)return n.scopeDepth-e.scopeDepth;let r=0,i=0;for(;e.parentScopes[r]===">"&&r++,n.parentScopes[i]===">"&&i++,!(r>=e.parentScopes.length||i>=n.parentScopes.length);){const o=n.parentScopes[i].length-e.parentScopes[r].length;if(o!==0)return o;r++,i++}return n.parentScopes.length-e.parentScopes.length}match(e){if(e!==""){let r=e.indexOf("."),i,o;if(r===-1?(i=e,o=""):(i=e.substring(0,r),o=e.substring(r+1)),this._children.hasOwnProperty(i))return this._children[i].match(o)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(je._cmpBySpecificity),n}insert(e,n,r,i,o,s){if(n===""){this._doInsertHere(e,r,i,o,s);return}let l=n.indexOf("."),a,u;l===-1?(a=n,u=""):(a=n.substring(0,l),u=n.substring(l+1));let d;this._children.hasOwnProperty(a)?d=this._children[a]:(d=new je(this._mainRule.clone(),Ge.cloneArr(this._rulesWithParentScopes)),this._children[a]=d),d.insert(e+1,u,r,i,o,s)}_doInsertHere(e,n,r,i,o){if(n===null){this._mainRule.acceptOverwrite(e,r,i,o);return}for(let s=0,l=this._rulesWithParentScopes.length;s<l;s++){let a=this._rulesWithParentScopes[s];if(Vt(a.parentScopes,n)===0){a.acceptOverwrite(e,r,i,o);return}}r===-1&&(r=this._mainRule.fontStyle),i===0&&(i=this._mainRule.foreground),o===0&&(o=this._mainRule.background),this._rulesWithParentScopes.push(new Ge(e,n,r,i,o))}},Y=class V{static toBinaryStr(e){return e.toString(2).padStart(32,"0")}static print(e){const n=V.getLanguageId(e),r=V.getTokenType(e),i=V.getFontStyle(e),o=V.getForeground(e),s=V.getBackground(e);console.log({languageId:n,tokenType:r,fontStyle:i,foreground:o,background:s})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return(e&1024)!==0}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(e,n,r,i,o,s,l){let a=V.getLanguageId(e),u=V.getTokenType(e),d=V.containsBalancedBrackets(e)?1:0,m=V.getFontStyle(e),f=V.getForeground(e),p=V.getBackground(e);return n!==0&&(a=n),r!==8&&(u=r),i!==null&&(d=i?1:0),o!==-1&&(m=o),s!==0&&(f=s),l!==0&&(p=l),(a<<0|u<<8|d<<10|m<<11|f<<15|p<<24)>>>0}};function he(t,e){const n=[],r=Nn(t);let i=r.next();for(;i!==null;){let a=0;if(i.length===2&&i.charAt(1)===":"){switch(i.charAt(0)){case"R":a=1;break;case"L":a=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let u=s();if(n.push({matcher:u,priority:a}),i!==",")break;i=r.next()}return n;function o(){if(i==="-"){i=r.next();const a=o();return u=>!!a&&!a(u)}if(i==="("){i=r.next();const a=l();return i===")"&&(i=r.next()),a}if(mt(i)){const a=[];do a.push(i),i=r.next();while(mt(i));return u=>e(a,u)}return null}function s(){const a=[];let u=o();for(;u;)a.push(u),u=o();return d=>a.every(m=>m(d))}function l(){const a=[];let u=s();for(;u&&(a.push(u),i==="|"||i===",");){do i=r.next();while(i==="|"||i===",");u=s()}return d=>a.some(m=>m(d))}}function mt(t){return!!t&&!!t.match(/[\w\.:]+/)}function Nn(t){let e=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=e.exec(t);return{next:()=>{if(!n)return null;const r=n[0];return n=e.exec(t),r}}}function $t(t){typeof t.dispose=="function"&&t.dispose()}var te=class{constructor(t){this.scopeName=t}toKey(){return this.scopeName}},Vn=class{constructor(t,e){this.scopeName=t,this.ruleName=e}toKey(){return`${this.scopeName}#${this.ruleName}`}},Mn=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(t){const e=t.toKey();this._seenReferenceKeys.has(e)||(this._seenReferenceKeys.add(e),this._references.push(t))}},Bn=class{constructor(t,e){this.repo=t,this.initialScopeName=e,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new te(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const t=this.Q;this.Q=[];const e=new Mn;for(const n of t)Gn(n,this.initialScopeName,this.repo,e);for(const n of e.references)if(n instanceof te){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 Gn(t,e,n,r){const i=n.lookup(t.scopeName);if(!i){if(t.scopeName===e)throw new Error(`No grammar provided for <${e}>`);return}const o=n.lookup(e);t instanceof te?me({baseGrammar:o,selfGrammar:i},r):$e(t.ruleName,{baseGrammar:o,selfGrammar:i,repository:i.repository},r);const s=n.injections(t.scopeName);if(s)for(const l of s)r.add(new te(l))}function $e(t,e,n){if(e.repository&&e.repository[t]){const r=e.repository[t];fe([r],e,n)}}function me(t,e){t.selfGrammar.patterns&&Array.isArray(t.selfGrammar.patterns)&&fe(t.selfGrammar.patterns,{...t,repository:t.selfGrammar.repository},e),t.selfGrammar.injections&&fe(Object.values(t.selfGrammar.injections),{...t,repository:t.selfGrammar.repository},e)}function fe(t,e,n){for(const r of t){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);const i=r.repository?Dt({},e.repository,r.repository):e.repository;Array.isArray(r.patterns)&&fe(r.patterns,{...e,repository:i},n);const o=r.include;if(!o)continue;const s=Ut(o);switch(s.kind){case 0:me({...e,selfGrammar:e.baseGrammar},n);break;case 1:me(e,n);break;case 2:$e(s.ruleName,{...e,repository:i},n);break;case 3:case 4:const l=s.scopeName===e.selfGrammar.scopeName?e.selfGrammar:s.scopeName===e.baseGrammar.scopeName?e.baseGrammar:void 0;if(l){const a={baseGrammar:e.baseGrammar,selfGrammar:l,repository:i};s.kind===4?$e(s.ruleName,a,n):me(a,n)}else s.kind===4?n.add(new Vn(s.scopeName,s.ruleName)):n.add(new te(s.scopeName));break}}}var jn=class{kind=0},$n=class{kind=1},Un=class{constructor(t){this.ruleName=t}kind=2},Hn=class{constructor(t){this.scopeName=t}kind=3},Fn=class{constructor(t,e){this.scopeName=t,this.ruleName=e}kind=4};function Ut(t){if(t==="$base")return new jn;if(t==="$self")return new $n;const e=t.indexOf("#");if(e===-1)return new Hn(t);if(e===0)return new Un(t.substring(1));{const n=t.substring(0,e),r=t.substring(e+1);return new Fn(n,r)}}var Wn=/\\(\d+)/,pt=/\\(\d+)/g,zn=-1,Ht=-2;var oe=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(t,e,n,r){this.$location=t,this.id=e,this._name=n||null,this._nameIsCapturing=ae.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=ae.hasCaptures(this._contentName)}get debugName(){const t=this.$location?`${xt(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${t}`}getName(t,e){return!this._nameIsCapturing||this._name===null||t===null||e===null?this._name:ae.replaceCaptures(this._name,t,e)}getContentName(t,e){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:ae.replaceCaptures(this._contentName,t,e)}},qn=class extends oe{retokenizeCapturedWithRuleId;constructor(t,e,n,r,i){super(t,e,n,r),this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(t,e){throw new Error("Not supported!")}compile(t,e){throw new Error("Not supported!")}compileAG(t,e,n,r){throw new Error("Not supported!")}},Kn=class extends oe{_match;captures;_cachedCompiledPatterns;constructor(t,e,n,r,i){super(t,e,n,null),this._match=new ne(r,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(t,e){e.push(this._match)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,n,r){return this._getCachedCompiledPatterns(t).compileAG(t,n,r)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new re,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},ht=class extends oe{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(t,e,n,r,i){super(t,e,n,r),this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(t,e){for(const n of this.patterns)t.getRule(n).collectPatterns(t,e)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,n,r){return this._getCachedCompiledPatterns(t).compileAG(t,n,r)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new re,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Ue=class extends oe{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(t,e,n,r,i,o,s,l,a,u){super(t,e,n,r),this._begin=new ne(i,this.id),this.beginCaptures=o,this._end=new ne(s||"",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=l,this.applyEndPatternLast=a||!1,this.patterns=u.patterns,this.hasMissingPatterns=u.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(t,e){return this._end.resolveBackReferences(t,e)}collectPatterns(t,e){e.push(this._begin)}compile(t,e){return this._getCachedCompiledPatterns(t,e).compile(t)}compileAG(t,e,n,r){return this._getCachedCompiledPatterns(t,e).compileAG(t,n,r)}_getCachedCompiledPatterns(t,e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new re;for(const n of this.patterns)t.getRule(n).collectPatterns(t,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,e):this._cachedCompiledPatterns.setSource(0,e)),this._cachedCompiledPatterns}},_e=class extends oe{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(t,e,n,r,i,o,s,l,a){super(t,e,n,r),this._begin=new ne(i,this.id),this.beginCaptures=o,this.whileCaptures=l,this._while=new ne(s,Ht),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(t,e){return this._while.resolveBackReferences(t,e)}collectPatterns(t,e){e.push(this._begin)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,n,r){return this._getCachedCompiledPatterns(t).compileAG(t,n,r)}_getCachedCompiledPatterns(t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new re;for(const e of this.patterns)t.getRule(e).collectPatterns(t,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(t,e){return this._getCachedCompiledWhilePatterns(t,e).compile(t)}compileWhileAG(t,e,n,r){return this._getCachedCompiledWhilePatterns(t,e).compileAG(t,n,r)}_getCachedCompiledWhilePatterns(t,e){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new re,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,e||""),this._cachedCompiledWhilePatterns}},Ft=class w{static createCaptureRule(e,n,r,i,o){return e.registerRule(s=>new qn(n,s,r,i,o))}static getCompiledRuleId(e,n,r){return e.id||n.registerRule(i=>{if(e.id=i,e.match)return new Kn(e.$vscodeTextmateLocation,e.id,e.name,e.match,w._compileCaptures(e.captures,n,r));if(typeof e.begin>"u"){e.repository&&(r=Dt({},r,e.repository));let o=e.patterns;return typeof o>"u"&&e.include&&(o=[{include:e.include}]),new ht(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,w._compilePatterns(o,n,r))}return e.while?new _e(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,w._compileCaptures(e.beginCaptures||e.captures,n,r),e.while,w._compileCaptures(e.whileCaptures||e.captures,n,r),w._compilePatterns(e.patterns,n,r)):new Ue(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,w._compileCaptures(e.beginCaptures||e.captures,n,r),e.end,w._compileCaptures(e.endCaptures||e.captures,n,r),e.applyEndPatternLast,w._compilePatterns(e.patterns,n,r))}),e.id}static _compileCaptures(e,n,r){let i=[];if(e){let o=0;for(const s in e){if(s==="$vscodeTextmateLocation")continue;const l=parseInt(s,10);l>o&&(o=l)}for(let s=0;s<=o;s++)i[s]=null;for(const s in e){if(s==="$vscodeTextmateLocation")continue;const l=parseInt(s,10);let a=0;e[s].patterns&&(a=w.getCompiledRuleId(e[s],n,r)),i[l]=w.createCaptureRule(n,e[s].$vscodeTextmateLocation,e[s].name,e[s].contentName,a)}}return i}static _compilePatterns(e,n,r){let i=[];if(e)for(let o=0,s=e.length;o<s;o++){const l=e[o];let a=-1;if(l.include){const u=Ut(l.include);switch(u.kind){case 0:case 1:a=w.getCompiledRuleId(r[l.include],n,r);break;case 2:let d=r[u.ruleName];d&&(a=w.getCompiledRuleId(d,n,r));break;case 3:case 4:const m=u.scopeName,f=u.kind===4?u.ruleName:null,p=n.getExternalGrammar(m,r);if(p)if(f){let h=p.repository[f];h&&(a=w.getCompiledRuleId(h,n,p.repository))}else a=w.getCompiledRuleId(p.repository.$self,n,p.repository);break}}else a=w.getCompiledRuleId(l,n,r);if(a!==-1){const u=n.getRule(a);let d=!1;if((u instanceof ht||u instanceof Ue||u instanceof _e)&&u.hasMissingPatterns&&u.patterns.length===0&&(d=!0),d)continue;i.push(a)}}return{patterns:i,hasMissingPatterns:(e?e.length:0)!==i.length}}},ne=class Wt{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,n){if(e&&typeof e=="string"){const r=e.length;let i=0,o=[],s=!1;for(let l=0;l<r;l++)if(e.charAt(l)==="\\"&&l+1<r){const u=e.charAt(l+1);u==="z"?(o.push(e.substring(i,l)),o.push("$(?!\\n)(?<!\\n)"),i=l+2):(u==="A"||u==="G")&&(s=!0),l++}this.hasAnchor=s,i===0?this.source=e:(o.push(e.substring(i,r)),this.source=o.join(""))}else this.hasAnchor=!1,this.source=e;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=n,typeof this.source=="string"?this.hasBackReferences=Wn.test(this.source):this.hasBackReferences=!1}clone(){return new Wt(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,n){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let r=n.map(i=>e.substring(i.start,i.end));return pt.lastIndex=0,this.source.replace(pt,(i,o)=>Mt(r[parseInt(o,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let e=[],n=[],r=[],i=[],o,s,l,a;for(o=0,s=this.source.length;o<s;o++)l=this.source.charAt(o),e[o]=l,n[o]=l,r[o]=l,i[o]=l,l==="\\"&&o+1<s&&(a=this.source.charAt(o+1),a==="A"?(e[o+1]="",n[o+1]="",r[o+1]="A",i[o+1]="A"):a==="G"?(e[o+1]="",n[o+1]="G",r[o+1]="",i[o+1]="G"):(e[o+1]=a,n[o+1]=a,r[o+1]=a,i[o+1]=a),o++);return{A0_G0:e.join(""),A0_G1:n.join(""),A1_G0:r.join(""),A1_G1:i.join("")}}resolveAnchors(e,n){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:e?n?this._anchorCache.A1_G1:this._anchorCache.A1_G0:n?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},re=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(t){this._items.push(t),this._hasAnchors=this._hasAnchors||t.hasAnchor}unshift(t){this._items.unshift(t),this._hasAnchors=this._hasAnchors||t.hasAnchor}length(){return this._items.length}setSource(t,e){this._items[t].source!==e&&(this._disposeCaches(),this._items[t].setSource(e))}compile(t){if(!this._cached){let e=this._items.map(n=>n.source);this._cached=new ft(t,e,this._items.map(n=>n.ruleId))}return this._cached}compileAG(t,e,n){return this._hasAnchors?e?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(t,e,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(t,e,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(t,e,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(t,e,n)),this._anchorCache.A0_G0):this.compile(t)}_resolveAnchors(t,e,n){let r=this._items.map(i=>i.resolveAnchors(e,n));return new ft(t,r,this._items.map(i=>i.ruleId))}},ft=class{constructor(t,e,n){this.regExps=e,this.rules=n,this.scanner=t.createOnigScanner(e)}scanner;dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const t=[];for(let e=0,n=this.rules.length;e<n;e++)t.push(" - "+this.rules[e]+": "+this.regExps[e]);return t.join(`
|
|
2
|
+
import{_ as c,i as Ln}from"./index-CZHl8b0e.js";let S=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function An(t){return Xe(t)}function Xe(t){return Array.isArray(t)?Tn(t):t instanceof RegExp?t:typeof t=="object"?kn(t):t}function Tn(t){let e=[];for(let n=0,r=t.length;n<r;n++)e[n]=Xe(t[n]);return e}function kn(t){let e={};for(let n in t)e[n]=Xe(t[n]);return e}function Dt(t,...e){return e.forEach(n=>{for(let r in n)t[r]=n[r]}),t}function xt(t){const e=~t.lastIndexOf("/")||~t.lastIndexOf("\\");return e===0?t:~e===t.length-1?xt(t.substring(0,t.length-1)):t.substr(~e+1)}var Ie=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,ae=class{static hasCaptures(t){return t===null?!1:(Ie.lastIndex=0,Ie.test(t))}static replaceCaptures(t,e,n){return t.replace(Ie,(r,i,o,s)=>{let l=n[parseInt(i||o,10)];if(l){let a=e.substring(l.start,l.end);for(;a[0]===".";)a=a.substring(1);switch(s){case"downcase":return a.toLowerCase();case"upcase":return a.toUpperCase();default:return a}}else return r})}};function Nt(t,e){return t<e?-1:t>e?1:0}function Vt(t,e){if(t===null&&e===null)return 0;if(!t)return-1;if(!e)return 1;let n=t.length,r=e.length;if(n===r){for(let i=0;i<n;i++){let o=Nt(t[i],e[i]);if(o!==0)return o}return 0}return n-r}function dt(t){return!!(/^#[0-9a-f]{6}$/i.test(t)||/^#[0-9a-f]{8}$/i.test(t)||/^#[0-9a-f]{3}$/i.test(t)||/^#[0-9a-f]{4}$/i.test(t))}function Mt(t){return t.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var Bt=class{constructor(t){this.fn=t}cache=new Map;get(t){if(this.cache.has(t))return this.cache.get(t);const e=this.fn(t);return this.cache.set(t,e),e}},pe=class{constructor(t,e,n){this._colorMap=t,this._defaults=e,this._root=n}static createFromRawTheme(t,e){return this.createFromParsedTheme(In(t),e)}static createFromParsedTheme(t,e){return wn(t,e)}_cachedMatchRoot=new Bt(t=>this._root.match(t));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(t){if(t===null)return this._defaults;const e=t.scopeName,r=this._cachedMatchRoot.get(e).find(i=>Sn(t.parent,i.parentScopes));return r?new Gt(r.fontStyle,r.foreground,r.background):null}},Oe=class de{constructor(e,n){this.parent=e,this.scopeName=n}static push(e,n){for(const r of n)e=new de(e,r);return e}static from(...e){let n=null;for(let r=0;r<e.length;r++)n=new de(n,e[r]);return n}push(e){return new de(this,e)}getSegments(){let e=this;const n=[];for(;e;)n.push(e.scopeName),e=e.parent;return n.reverse(),n}toString(){return this.getSegments().join(" ")}extends(e){return this===e?!0:this.parent===null?!1:this.parent.extends(e)}getExtensionIfDefined(e){const n=[];let r=this;for(;r&&r!==e;)n.push(r.scopeName),r=r.parent;return r===e?n.reverse():void 0}};function Sn(t,e){if(e.length===0)return!0;for(let n=0;n<e.length;n++){let r=e[n],i=!1;if(r===">"){if(n===e.length-1)return!1;r=e[++n],i=!0}for(;t&&!Pn(t.scopeName,r);){if(i)return!1;t=t.parent}if(!t)return!1;t=t.parent}return!0}function Pn(t,e){return e===t||t.startsWith(e)&&t[e.length]==="."}var Gt=class{constructor(t,e,n){this.fontStyle=t,this.foregroundId=e,this.backgroundId=n}};function In(t){if(!t)return[];if(!t.settings||!Array.isArray(t.settings))return[];let e=t.settings,n=[],r=0;for(let i=0,o=e.length;i<o;i++){let s=e[i];if(!s.settings)continue;let l;if(typeof s.scope=="string"){let m=s.scope;m=m.replace(/^[,]+/,""),m=m.replace(/[,]+$/,""),l=m.split(",")}else Array.isArray(s.scope)?l=s.scope:l=[""];let a=-1;if(typeof s.settings.fontStyle=="string"){a=0;let m=s.settings.fontStyle.split(" ");for(let f=0,p=m.length;f<p;f++)switch(m[f]){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 u=null;typeof s.settings.foreground=="string"&&dt(s.settings.foreground)&&(u=s.settings.foreground);let d=null;typeof s.settings.background=="string"&&dt(s.settings.background)&&(d=s.settings.background);for(let m=0,f=l.length;m<f;m++){let h=l[m].trim().split(" "),E=h[h.length-1],b=null;h.length>1&&(b=h.slice(0,h.length-1),b.reverse()),n[r++]=new On(E,b,i,a,u,d)}}return n}var On=class{constructor(t,e,n,r,i,o){this.scope=t,this.parentScopes=e,this.index=n,this.fontStyle=r,this.foreground=i,this.background=o}},C=(t=>(t[t.NotSet=-1]="NotSet",t[t.None=0]="None",t[t.Italic=1]="Italic",t[t.Bold=2]="Bold",t[t.Underline=4]="Underline",t[t.Strikethrough=8]="Strikethrough",t))(C||{});function wn(t,e){t.sort((a,u)=>{let d=Nt(a.scope,u.scope);return d!==0||(d=Vt(a.parentScopes,u.parentScopes),d!==0)?d:a.index-u.index});let n=0,r="#000000",i="#ffffff";for(;t.length>=1&&t[0].scope==="";){let a=t.shift();a.fontStyle!==-1&&(n=a.fontStyle),a.foreground!==null&&(r=a.foreground),a.background!==null&&(i=a.background)}let o=new Cn(e),s=new Gt(n,o.getId(r),o.getId(i)),l=new xn(new Ge(0,null,-1,0,0),[]);for(let a=0,u=t.length;a<u;a++){let d=t[a];l.insert(0,d.scope,d.parentScopes,d.fontStyle,o.getId(d.foreground),o.getId(d.background))}return new pe(o,s,l)}var Cn=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(t){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(t)){this._isFrozen=!0;for(let e=0,n=t.length;e<n;e++)this._color2id[t[e]]=e,this._id2color[e]=t[e]}else this._isFrozen=!1}getId(t){if(t===null)return 0;t=t.toUpperCase();let e=this._color2id[t];if(e)return e;if(this._isFrozen)throw new Error(`Missing color in color map - ${t}`);return e=++this._lastColorId,this._color2id[t]=e,this._id2color[e]=t,e}getColorMap(){return this._id2color.slice(0)}},Dn=Object.freeze([]),Ge=class jt{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,n,r,i,o){this.scopeDepth=e,this.parentScopes=n||Dn,this.fontStyle=r,this.foreground=i,this.background=o}clone(){return new jt(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let n=[];for(let r=0,i=e.length;r<i;r++)n[r]=e[r].clone();return n}acceptOverwrite(e,n,r,i){this.scopeDepth>e?console.log("how did this happen?"):this.scopeDepth=e,n!==-1&&(this.fontStyle=n),r!==0&&(this.foreground=r),i!==0&&(this.background=i)}},xn=class je{constructor(e,n=[],r={}){this._mainRule=e,this._children=r,this._rulesWithParentScopes=n}_rulesWithParentScopes;static _cmpBySpecificity(e,n){if(e.scopeDepth!==n.scopeDepth)return n.scopeDepth-e.scopeDepth;let r=0,i=0;for(;e.parentScopes[r]===">"&&r++,n.parentScopes[i]===">"&&i++,!(r>=e.parentScopes.length||i>=n.parentScopes.length);){const o=n.parentScopes[i].length-e.parentScopes[r].length;if(o!==0)return o;r++,i++}return n.parentScopes.length-e.parentScopes.length}match(e){if(e!==""){let r=e.indexOf("."),i,o;if(r===-1?(i=e,o=""):(i=e.substring(0,r),o=e.substring(r+1)),this._children.hasOwnProperty(i))return this._children[i].match(o)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(je._cmpBySpecificity),n}insert(e,n,r,i,o,s){if(n===""){this._doInsertHere(e,r,i,o,s);return}let l=n.indexOf("."),a,u;l===-1?(a=n,u=""):(a=n.substring(0,l),u=n.substring(l+1));let d;this._children.hasOwnProperty(a)?d=this._children[a]:(d=new je(this._mainRule.clone(),Ge.cloneArr(this._rulesWithParentScopes)),this._children[a]=d),d.insert(e+1,u,r,i,o,s)}_doInsertHere(e,n,r,i,o){if(n===null){this._mainRule.acceptOverwrite(e,r,i,o);return}for(let s=0,l=this._rulesWithParentScopes.length;s<l;s++){let a=this._rulesWithParentScopes[s];if(Vt(a.parentScopes,n)===0){a.acceptOverwrite(e,r,i,o);return}}r===-1&&(r=this._mainRule.fontStyle),i===0&&(i=this._mainRule.foreground),o===0&&(o=this._mainRule.background),this._rulesWithParentScopes.push(new Ge(e,n,r,i,o))}},Y=class V{static toBinaryStr(e){return e.toString(2).padStart(32,"0")}static print(e){const n=V.getLanguageId(e),r=V.getTokenType(e),i=V.getFontStyle(e),o=V.getForeground(e),s=V.getBackground(e);console.log({languageId:n,tokenType:r,fontStyle:i,foreground:o,background:s})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return(e&1024)!==0}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(e,n,r,i,o,s,l){let a=V.getLanguageId(e),u=V.getTokenType(e),d=V.containsBalancedBrackets(e)?1:0,m=V.getFontStyle(e),f=V.getForeground(e),p=V.getBackground(e);return n!==0&&(a=n),r!==8&&(u=r),i!==null&&(d=i?1:0),o!==-1&&(m=o),s!==0&&(f=s),l!==0&&(p=l),(a<<0|u<<8|d<<10|m<<11|f<<15|p<<24)>>>0}};function he(t,e){const n=[],r=Nn(t);let i=r.next();for(;i!==null;){let a=0;if(i.length===2&&i.charAt(1)===":"){switch(i.charAt(0)){case"R":a=1;break;case"L":a=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let u=s();if(n.push({matcher:u,priority:a}),i!==",")break;i=r.next()}return n;function o(){if(i==="-"){i=r.next();const a=o();return u=>!!a&&!a(u)}if(i==="("){i=r.next();const a=l();return i===")"&&(i=r.next()),a}if(mt(i)){const a=[];do a.push(i),i=r.next();while(mt(i));return u=>e(a,u)}return null}function s(){const a=[];let u=o();for(;u;)a.push(u),u=o();return d=>a.every(m=>m(d))}function l(){const a=[];let u=s();for(;u&&(a.push(u),i==="|"||i===",");){do i=r.next();while(i==="|"||i===",");u=s()}return d=>a.some(m=>m(d))}}function mt(t){return!!t&&!!t.match(/[\w\.:]+/)}function Nn(t){let e=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=e.exec(t);return{next:()=>{if(!n)return null;const r=n[0];return n=e.exec(t),r}}}function $t(t){typeof t.dispose=="function"&&t.dispose()}var te=class{constructor(t){this.scopeName=t}toKey(){return this.scopeName}},Vn=class{constructor(t,e){this.scopeName=t,this.ruleName=e}toKey(){return`${this.scopeName}#${this.ruleName}`}},Mn=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(t){const e=t.toKey();this._seenReferenceKeys.has(e)||(this._seenReferenceKeys.add(e),this._references.push(t))}},Bn=class{constructor(t,e){this.repo=t,this.initialScopeName=e,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new te(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const t=this.Q;this.Q=[];const e=new Mn;for(const n of t)Gn(n,this.initialScopeName,this.repo,e);for(const n of e.references)if(n instanceof te){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 Gn(t,e,n,r){const i=n.lookup(t.scopeName);if(!i){if(t.scopeName===e)throw new Error(`No grammar provided for <${e}>`);return}const o=n.lookup(e);t instanceof te?me({baseGrammar:o,selfGrammar:i},r):$e(t.ruleName,{baseGrammar:o,selfGrammar:i,repository:i.repository},r);const s=n.injections(t.scopeName);if(s)for(const l of s)r.add(new te(l))}function $e(t,e,n){if(e.repository&&e.repository[t]){const r=e.repository[t];fe([r],e,n)}}function me(t,e){t.selfGrammar.patterns&&Array.isArray(t.selfGrammar.patterns)&&fe(t.selfGrammar.patterns,{...t,repository:t.selfGrammar.repository},e),t.selfGrammar.injections&&fe(Object.values(t.selfGrammar.injections),{...t,repository:t.selfGrammar.repository},e)}function fe(t,e,n){for(const r of t){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);const i=r.repository?Dt({},e.repository,r.repository):e.repository;Array.isArray(r.patterns)&&fe(r.patterns,{...e,repository:i},n);const o=r.include;if(!o)continue;const s=Ut(o);switch(s.kind){case 0:me({...e,selfGrammar:e.baseGrammar},n);break;case 1:me(e,n);break;case 2:$e(s.ruleName,{...e,repository:i},n);break;case 3:case 4:const l=s.scopeName===e.selfGrammar.scopeName?e.selfGrammar:s.scopeName===e.baseGrammar.scopeName?e.baseGrammar:void 0;if(l){const a={baseGrammar:e.baseGrammar,selfGrammar:l,repository:i};s.kind===4?$e(s.ruleName,a,n):me(a,n)}else s.kind===4?n.add(new Vn(s.scopeName,s.ruleName)):n.add(new te(s.scopeName));break}}}var jn=class{kind=0},$n=class{kind=1},Un=class{constructor(t){this.ruleName=t}kind=2},Hn=class{constructor(t){this.scopeName=t}kind=3},Fn=class{constructor(t,e){this.scopeName=t,this.ruleName=e}kind=4};function Ut(t){if(t==="$base")return new jn;if(t==="$self")return new $n;const e=t.indexOf("#");if(e===-1)return new Hn(t);if(e===0)return new Un(t.substring(1));{const n=t.substring(0,e),r=t.substring(e+1);return new Fn(n,r)}}var Wn=/\\(\d+)/,pt=/\\(\d+)/g,zn=-1,Ht=-2;var oe=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(t,e,n,r){this.$location=t,this.id=e,this._name=n||null,this._nameIsCapturing=ae.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=ae.hasCaptures(this._contentName)}get debugName(){const t=this.$location?`${xt(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${t}`}getName(t,e){return!this._nameIsCapturing||this._name===null||t===null||e===null?this._name:ae.replaceCaptures(this._name,t,e)}getContentName(t,e){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:ae.replaceCaptures(this._contentName,t,e)}},qn=class extends oe{retokenizeCapturedWithRuleId;constructor(t,e,n,r,i){super(t,e,n,r),this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(t,e){throw new Error("Not supported!")}compile(t,e){throw new Error("Not supported!")}compileAG(t,e,n,r){throw new Error("Not supported!")}},Kn=class extends oe{_match;captures;_cachedCompiledPatterns;constructor(t,e,n,r,i){super(t,e,n,null),this._match=new ne(r,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(t,e){e.push(this._match)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,n,r){return this._getCachedCompiledPatterns(t).compileAG(t,n,r)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new re,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},ht=class extends oe{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(t,e,n,r,i){super(t,e,n,r),this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(t,e){for(const n of this.patterns)t.getRule(n).collectPatterns(t,e)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,n,r){return this._getCachedCompiledPatterns(t).compileAG(t,n,r)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new re,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Ue=class extends oe{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(t,e,n,r,i,o,s,l,a,u){super(t,e,n,r),this._begin=new ne(i,this.id),this.beginCaptures=o,this._end=new ne(s||"",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=l,this.applyEndPatternLast=a||!1,this.patterns=u.patterns,this.hasMissingPatterns=u.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(t,e){return this._end.resolveBackReferences(t,e)}collectPatterns(t,e){e.push(this._begin)}compile(t,e){return this._getCachedCompiledPatterns(t,e).compile(t)}compileAG(t,e,n,r){return this._getCachedCompiledPatterns(t,e).compileAG(t,n,r)}_getCachedCompiledPatterns(t,e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new re;for(const n of this.patterns)t.getRule(n).collectPatterns(t,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,e):this._cachedCompiledPatterns.setSource(0,e)),this._cachedCompiledPatterns}},_e=class extends oe{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(t,e,n,r,i,o,s,l,a){super(t,e,n,r),this._begin=new ne(i,this.id),this.beginCaptures=o,this.whileCaptures=l,this._while=new ne(s,Ht),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(t,e){return this._while.resolveBackReferences(t,e)}collectPatterns(t,e){e.push(this._begin)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,n,r){return this._getCachedCompiledPatterns(t).compileAG(t,n,r)}_getCachedCompiledPatterns(t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new re;for(const e of this.patterns)t.getRule(e).collectPatterns(t,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(t,e){return this._getCachedCompiledWhilePatterns(t,e).compile(t)}compileWhileAG(t,e,n,r){return this._getCachedCompiledWhilePatterns(t,e).compileAG(t,n,r)}_getCachedCompiledWhilePatterns(t,e){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new re,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,e||""),this._cachedCompiledWhilePatterns}},Ft=class w{static createCaptureRule(e,n,r,i,o){return e.registerRule(s=>new qn(n,s,r,i,o))}static getCompiledRuleId(e,n,r){return e.id||n.registerRule(i=>{if(e.id=i,e.match)return new Kn(e.$vscodeTextmateLocation,e.id,e.name,e.match,w._compileCaptures(e.captures,n,r));if(typeof e.begin>"u"){e.repository&&(r=Dt({},r,e.repository));let o=e.patterns;return typeof o>"u"&&e.include&&(o=[{include:e.include}]),new ht(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,w._compilePatterns(o,n,r))}return e.while?new _e(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,w._compileCaptures(e.beginCaptures||e.captures,n,r),e.while,w._compileCaptures(e.whileCaptures||e.captures,n,r),w._compilePatterns(e.patterns,n,r)):new Ue(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,w._compileCaptures(e.beginCaptures||e.captures,n,r),e.end,w._compileCaptures(e.endCaptures||e.captures,n,r),e.applyEndPatternLast,w._compilePatterns(e.patterns,n,r))}),e.id}static _compileCaptures(e,n,r){let i=[];if(e){let o=0;for(const s in e){if(s==="$vscodeTextmateLocation")continue;const l=parseInt(s,10);l>o&&(o=l)}for(let s=0;s<=o;s++)i[s]=null;for(const s in e){if(s==="$vscodeTextmateLocation")continue;const l=parseInt(s,10);let a=0;e[s].patterns&&(a=w.getCompiledRuleId(e[s],n,r)),i[l]=w.createCaptureRule(n,e[s].$vscodeTextmateLocation,e[s].name,e[s].contentName,a)}}return i}static _compilePatterns(e,n,r){let i=[];if(e)for(let o=0,s=e.length;o<s;o++){const l=e[o];let a=-1;if(l.include){const u=Ut(l.include);switch(u.kind){case 0:case 1:a=w.getCompiledRuleId(r[l.include],n,r);break;case 2:let d=r[u.ruleName];d&&(a=w.getCompiledRuleId(d,n,r));break;case 3:case 4:const m=u.scopeName,f=u.kind===4?u.ruleName:null,p=n.getExternalGrammar(m,r);if(p)if(f){let h=p.repository[f];h&&(a=w.getCompiledRuleId(h,n,p.repository))}else a=w.getCompiledRuleId(p.repository.$self,n,p.repository);break}}else a=w.getCompiledRuleId(l,n,r);if(a!==-1){const u=n.getRule(a);let d=!1;if((u instanceof ht||u instanceof Ue||u instanceof _e)&&u.hasMissingPatterns&&u.patterns.length===0&&(d=!0),d)continue;i.push(a)}}return{patterns:i,hasMissingPatterns:(e?e.length:0)!==i.length}}},ne=class Wt{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,n){if(e&&typeof e=="string"){const r=e.length;let i=0,o=[],s=!1;for(let l=0;l<r;l++)if(e.charAt(l)==="\\"&&l+1<r){const u=e.charAt(l+1);u==="z"?(o.push(e.substring(i,l)),o.push("$(?!\\n)(?<!\\n)"),i=l+2):(u==="A"||u==="G")&&(s=!0),l++}this.hasAnchor=s,i===0?this.source=e:(o.push(e.substring(i,r)),this.source=o.join(""))}else this.hasAnchor=!1,this.source=e;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=n,typeof this.source=="string"?this.hasBackReferences=Wn.test(this.source):this.hasBackReferences=!1}clone(){return new Wt(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,n){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let r=n.map(i=>e.substring(i.start,i.end));return pt.lastIndex=0,this.source.replace(pt,(i,o)=>Mt(r[parseInt(o,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let e=[],n=[],r=[],i=[],o,s,l,a;for(o=0,s=this.source.length;o<s;o++)l=this.source.charAt(o),e[o]=l,n[o]=l,r[o]=l,i[o]=l,l==="\\"&&o+1<s&&(a=this.source.charAt(o+1),a==="A"?(e[o+1]="",n[o+1]="",r[o+1]="A",i[o+1]="A"):a==="G"?(e[o+1]="",n[o+1]="G",r[o+1]="",i[o+1]="G"):(e[o+1]=a,n[o+1]=a,r[o+1]=a,i[o+1]=a),o++);return{A0_G0:e.join(""),A0_G1:n.join(""),A1_G0:r.join(""),A1_G1:i.join("")}}resolveAnchors(e,n){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:e?n?this._anchorCache.A1_G1:this._anchorCache.A1_G0:n?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},re=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(t){this._items.push(t),this._hasAnchors=this._hasAnchors||t.hasAnchor}unshift(t){this._items.unshift(t),this._hasAnchors=this._hasAnchors||t.hasAnchor}length(){return this._items.length}setSource(t,e){this._items[t].source!==e&&(this._disposeCaches(),this._items[t].setSource(e))}compile(t){if(!this._cached){let e=this._items.map(n=>n.source);this._cached=new ft(t,e,this._items.map(n=>n.ruleId))}return this._cached}compileAG(t,e,n){return this._hasAnchors?e?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(t,e,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(t,e,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(t,e,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(t,e,n)),this._anchorCache.A0_G0):this.compile(t)}_resolveAnchors(t,e,n){let r=this._items.map(i=>i.resolveAnchors(e,n));return new ft(t,r,this._items.map(i=>i.ruleId))}},ft=class{constructor(t,e,n){this.regExps=e,this.rules=n,this.scanner=t.createOnigScanner(e)}scanner;dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const t=[];for(let e=0,n=this.rules.length;e<n;e++)t.push(" - "+this.rules[e]+": "+this.regExps[e]);return t.join(`
|
|
3
3
|
`)}findNextMatchSync(t,e,n){const r=this.scanner.findNextMatchSync(t,e,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},we=class{constructor(t,e){this.languageId=t,this.tokenType=e}},Yn=class He{_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,n){this._defaultAttributes=new we(e,8),this._embeddedLanguagesMatcher=new Jn(Object.entries(n||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(e){return e===null?He._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(e)}static _NULL_SCOPE_METADATA=new we(0,0);_getBasicScopeAttributes=new Bt(e=>{const n=this._scopeToLanguage(e),r=this._toStandardTokenType(e);return new we(n,r)});_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(e){const n=e.match(He.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/},Jn=class{values;scopesRegExp;constructor(t){if(t.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(t);const e=t.map(([n,r])=>Mt(n));e.sort(),e.reverse(),this.scopesRegExp=new RegExp(`^((${e.join(")|(")}))($|\\.)`,"")}}match(t){if(!this.scopesRegExp)return;const e=t.match(this.scopesRegExp);if(e)return this.values.get(e[1])}},_t=class{constructor(t,e){this.stack=t,this.stoppedEarly=e}};function zt(t,e,n,r,i,o,s,l){const a=e.content.length;let u=!1,d=-1;if(s){const p=Xn(t,e,n,r,i,o);i=p.stack,r=p.linePos,n=p.isFirstLine,d=p.anchorPosition}const m=Date.now();for(;!u;){if(l!==0&&Date.now()-m>l)return new _t(i,!0);f()}return new _t(i,!1);function f(){const p=Qn(t,e,n,r,i,d);if(!p){o.produce(i,a),u=!0;return}const h=p.captureIndices,E=p.matchedRuleId,b=h&&h.length>0?h[0].end>r:!1;if(E===zn){const y=i.getRule(t);o.produce(i,h[0].start),i=i.withContentNameScopesList(i.nameScopesList),Z(t,e,n,i,o,y.endCaptures,h),o.produce(i,h[0].end);const v=i;if(i=i.parent,d=v.getAnchorPos(),!b&&v.getEnterPos()===r){i=v,o.produce(i,a),u=!0;return}}else{const y=t.getRule(E);o.produce(i,h[0].start);const v=i,g=y.getName(e.content,h),L=i.contentNameScopesList.pushAttributed(g,t);if(i=i.push(E,r,d,h[0].end===a,null,L,L),y instanceof Ue){const T=y;Z(t,e,n,i,o,T.beginCaptures,h),o.produce(i,h[0].end),d=h[0].end;const x=T.getContentName(e.content,h),$=L.pushAttributed(x,t);if(i=i.withContentNameScopesList($),T.endHasBackReferences&&(i=i.withEndRule(T.getEndWithResolvedBackReferences(e.content,h))),!b&&v.hasSameRuleAs(i)){i=i.pop(),o.produce(i,a),u=!0;return}}else if(y instanceof _e){const T=y;Z(t,e,n,i,o,T.beginCaptures,h),o.produce(i,h[0].end),d=h[0].end;const x=T.getContentName(e.content,h),$=L.pushAttributed(x,t);if(i=i.withContentNameScopesList($),T.whileHasBackReferences&&(i=i.withEndRule(T.getWhileWithResolvedBackReferences(e.content,h))),!b&&v.hasSameRuleAs(i)){i=i.pop(),o.produce(i,a),u=!0;return}}else if(Z(t,e,n,i,o,y.captures,h),o.produce(i,h[0].end),i=i.pop(),!b){i=i.safePop(),o.produce(i,a),u=!0;return}}h[0].end>r&&(r=h[0].end,n=!1)}}function Xn(t,e,n,r,i,o){let s=i.beginRuleCapturedEOL?0:-1;const l=[];for(let a=i;a;a=a.pop()){const u=a.getRule(t);u instanceof _e&&l.push({rule:u,stack:a})}for(let a=l.pop();a;a=l.pop()){const{ruleScanner:u,findOptions:d}=tr(a.rule,t,a.stack.endRule,n,r===s),m=u.findNextMatchSync(e,r,d);if(m){if(m.ruleId!==Ht){i=a.stack.pop();break}m.captureIndices&&m.captureIndices.length&&(o.produce(a.stack,m.captureIndices[0].start),Z(t,e,n,a.stack,o,a.rule.whileCaptures,m.captureIndices),o.produce(a.stack,m.captureIndices[0].end),s=m.captureIndices[0].end,m.captureIndices[0].end>r&&(r=m.captureIndices[0].end,n=!1))}else{i=a.stack.pop();break}}return{stack:i,linePos:r,anchorPosition:s,isFirstLine:n}}function Qn(t,e,n,r,i,o){const s=Zn(t,e,n,r,i,o),l=t.getInjections();if(l.length===0)return s;const a=er(l,t,e,n,r,i,o);if(!a)return s;if(!s)return a;const u=s.captureIndices[0].start,d=a.captureIndices[0].start;return d<u||a.priorityMatch&&d===u?a:s}function Zn(t,e,n,r,i,o){const s=i.getRule(t),{ruleScanner:l,findOptions:a}=qt(s,t,i.endRule,n,r===o),u=l.findNextMatchSync(e,r,a);return u?{captureIndices:u.captureIndices,matchedRuleId:u.ruleId}:null}function er(t,e,n,r,i,o,s){let l=Number.MAX_VALUE,a=null,u,d=0;const m=o.contentNameScopesList.getScopeNames();for(let f=0,p=t.length;f<p;f++){const h=t[f];if(!h.matcher(m))continue;const E=e.getRule(h.ruleId),{ruleScanner:b,findOptions:y}=qt(E,e,null,r,i===s),v=b.findNextMatchSync(n,i,y);if(!v)continue;const g=v.captureIndices[0].start;if(!(g>=l)&&(l=g,a=v.captureIndices,u=v.ruleId,d=h.priority,l===i))break}return a?{priorityMatch:d===-1,captureIndices:a,matchedRuleId:u}:null}function qt(t,e,n,r,i){return{ruleScanner:t.compileAG(e,n,r,i),findOptions:0}}function tr(t,e,n,r,i){return{ruleScanner:t.compileWhileAG(e,n,r,i),findOptions:0}}function Z(t,e,n,r,i,o,s){if(o.length===0)return;const l=e.content,a=Math.min(o.length,s.length),u=[],d=s[0].end;for(let m=0;m<a;m++){const f=o[m];if(f===null)continue;const p=s[m];if(p.length===0)continue;if(p.start>d)break;for(;u.length>0&&u[u.length-1].endPos<=p.start;)i.produceFromScopes(u[u.length-1].scopes,u[u.length-1].endPos),u.pop();if(u.length>0?i.produceFromScopes(u[u.length-1].scopes,p.start):i.produce(r,p.start),f.retokenizeCapturedWithRuleId){const E=f.getName(l,s),b=r.contentNameScopesList.pushAttributed(E,t),y=f.getContentName(l,s),v=b.pushAttributed(y,t),g=r.push(f.retokenizeCapturedWithRuleId,p.start,-1,!1,null,b,v),L=t.createOnigString(l.substring(0,p.end));zt(t,L,n&&p.start===0,p.start,g,i,!1,0),$t(L);continue}const h=f.getName(l,s);if(h!==null){const b=(u.length>0?u[u.length-1].scopes:r.contentNameScopesList).pushAttributed(h,t);u.push(new nr(b,p.end))}}for(;u.length>0;)i.produceFromScopes(u[u.length-1].scopes,u[u.length-1].endPos),u.pop()}var nr=class{scopes;endPos;constructor(t,e){this.scopes=t,this.endPos=e}};function rr(t,e,n,r,i,o,s,l){return new or(t,e,n,r,i,o,s,l)}function gt(t,e,n,r,i){const o=he(e,ge),s=Ft.getCompiledRuleId(n,r,i.repository);for(const l of o)t.push({debugSelector:e,matcher:l.matcher,ruleId:s,grammar:i,priority:l.priority})}function ge(t,e){if(e.length<t.length)return!1;let n=0;return t.every(r=>{for(let i=n;i<e.length;i++)if(ir(e[i],r))return n=i+1,!0;return!1})}function ir(t,e){if(!t)return!1;if(t===e)return!0;const n=e.length;return t.length>n&&t.substr(0,n)===e&&t[n]==="."}var or=class{constructor(t,e,n,r,i,o,s,l){if(this._rootScopeName=t,this.balancedBracketSelectors=o,this._onigLib=l,this._basicScopeAttributesProvider=new Yn(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=s,this._grammar=yt(e,null),this._injections=null,this._tokenTypeMatchers=[],i)for(const a of Object.keys(i)){const u=he(a,ge);for(const d of u)this._tokenTypeMatchers.push({matcher:d.matcher,type:i[a]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(const t of this._ruleId2desc)t&&t.dispose()}createOnigScanner(t){return this._onigLib.createOnigScanner(t)}createOnigString(t){return this._onigLib.createOnigString(t)}getMetadataForScope(t){return this._basicScopeAttributesProvider.getBasicScopeAttributes(t)}_collectInjections(){const t={lookup:i=>i===this._rootScopeName?this._grammar:this.getExternalGrammar(i),injections:i=>this._grammarRepository.injections(i)},e=[],n=this._rootScopeName,r=t.lookup(n);if(r){const i=r.injections;if(i)for(let s in i)gt(e,s,i[s],this,r);const o=this._grammarRepository.injections(n);o&&o.forEach(s=>{const l=this.getExternalGrammar(s);if(l){const a=l.injectionSelector;a&>(e,a,l,this,l)}})}return e.sort((i,o)=>i.priority-o.priority),e}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(t){const e=++this._lastRuleId,n=t(e);return this._ruleId2desc[e]=n,n}getRule(t){return this._ruleId2desc[t]}getExternalGrammar(t,e){if(this._includedGrammars[t])return this._includedGrammars[t];if(this._grammarRepository){const n=this._grammarRepository.lookup(t);if(n)return this._includedGrammars[t]=yt(n,e&&e.$base),this._includedGrammars[t]}}tokenizeLine(t,e,n=0){const r=this._tokenize(t,e,!1,n);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(t,e,n=0){const r=this._tokenize(t,e,!0,n);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(t,e,n,r){this._rootId===-1&&(this._rootId=Ft.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let i;if(!e||e===Fe.NULL){i=!0;const u=this._basicScopeAttributesProvider.getDefaultAttributes(),d=this.themeProvider.getDefaults(),m=Y.set(0,u.languageId,u.tokenType,null,d.fontStyle,d.foregroundId,d.backgroundId),f=this.getRule(this._rootId).getName(null,null);let p;f?p=ee.createRootAndLookUpScopeName(f,m,this):p=ee.createRoot("unknown",m),e=new Fe(null,this._rootId,-1,-1,!1,null,p,p)}else i=!1,e.reset();t=t+`
|
|
4
4
|
`;const o=this.createOnigString(t),s=o.content.length,l=new ar(n,t,this._tokenTypeMatchers,this.balancedBracketSelectors),a=zt(this,o,i,0,e,l,!0,r);return $t(o),{lineLength:s,lineTokens:l,ruleStack:a.stack,stoppedEarly:a.stoppedEarly}}};function yt(t,e){return t=An(t),t.repository=t.repository||{},t.repository.$self={$vscodeTextmateLocation:t.$vscodeTextmateLocation,patterns:t.patterns,name:t.scopeName},t.repository.$base=e||t.repository.$self,t}var ee=class M{constructor(e,n,r){this.parent=e,this.scopePath=n,this.tokenAttributes=r}static fromExtension(e,n){let r=e,i=e?.scopePath??null;for(const o of n)i=Oe.push(i,o.scopeNames),r=new M(r,i,o.encodedTokenAttributes);return r}static createRoot(e,n){return new M(null,new Oe(null,e),n)}static createRootAndLookUpScopeName(e,n,r){const i=r.getMetadataForScope(e),o=new Oe(null,e),s=r.themeProvider.themeMatch(o),l=M.mergeAttributes(n,i,s);return new M(null,o,l)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(e){return M.equals(this,e)}static equals(e,n){do{if(e===n||!e&&!n)return!0;if(!e||!n||e.scopeName!==n.scopeName||e.tokenAttributes!==n.tokenAttributes)return!1;e=e.parent,n=n.parent}while(!0)}static mergeAttributes(e,n,r){let i=-1,o=0,s=0;return r!==null&&(i=r.fontStyle,o=r.foregroundId,s=r.backgroundId),Y.set(e,n.languageId,n.tokenType,null,i,o,s)}pushAttributed(e,n){if(e===null)return this;if(e.indexOf(" ")===-1)return M._pushAttributed(this,e,n);const r=e.split(/ /g);let i=this;for(const o of r)i=M._pushAttributed(i,o,n);return i}static _pushAttributed(e,n,r){const i=r.getMetadataForScope(n),o=e.scopePath.push(n),s=r.themeProvider.themeMatch(o),l=M.mergeAttributes(e.tokenAttributes,i,s);return new M(e,o,l)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){const n=[];let r=this;for(;r&&r!==e;)n.push({encodedTokenAttributes:r.tokenAttributes,scopeNames:r.scopePath.getExtensionIfDefined(r.parent?.scopePath??null)}),r=r.parent;return r===e?n.reverse():void 0}},Fe=class U{constructor(e,n,r,i,o,s,l,a){this.parent=e,this.ruleId=n,this.beginRuleCapturedEOL=o,this.endRule=s,this.nameScopesList=l,this.contentNameScopesList=a,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=r,this._anchorPos=i}_stackElementBrand=void 0;static NULL=new U(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(e){return e===null?!1:U._equals(this,e)}static _equals(e,n){return e===n?!0:this._structuralEquals(e,n)?ee.equals(e.contentNameScopesList,n.contentNameScopesList):!1}static _structuralEquals(e,n){do{if(e===n||!e&&!n)return!0;if(!e||!n||e.depth!==n.depth||e.ruleId!==n.ruleId||e.endRule!==n.endRule)return!1;e=e.parent,n=n.parent}while(!0)}clone(){return this}static _reset(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){U._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(e,n,r,i,o,s,l){return new U(this,e,n,r,i,o,s,l)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){const e=[];return this._writeString(e,0),"["+e.join(",")+"]"}_writeString(e,n){return this.parent&&(n=this.parent._writeString(e,n)),e[n++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,n}withContentNameScopesList(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(e){return this.endRule===e?this:new U(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,e,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let n=this;for(;n&&n._enterPos===e._enterPos;){if(n.ruleId===e.ruleId)return!0;n=n.parent}return!1}toStateStackFrame(){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(e,n){const r=ee.fromExtension(e?.nameScopesList??null,n.nameScopesList);return new U(e,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,ee.fromExtension(r,n.contentNameScopesList))}},sr=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(t,e){this.balancedBracketScopes=t.flatMap(n=>n==="*"?(this.allowAny=!0,[]):he(n,ge).map(r=>r.matcher)),this.unbalancedBracketScopes=e.flatMap(n=>he(n,ge).map(r=>r.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(t){for(const e of this.unbalancedBracketScopes)if(e(t))return!1;for(const e of this.balancedBracketScopes)if(e(t))return!0;return this.allowAny}},ar=class{constructor(t,e,n,r){this.balancedBracketSelectors=r,this._emitBinaryTokens=t,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(t,e){this.produceFromScopes(t.contentNameScopesList,e)}produceFromScopes(t,e){if(this._lastTokenEndIndex>=e)return;if(this._emitBinaryTokens){let r=t?.tokenAttributes??0,i=!1;if(this.balancedBracketSelectors?.matchesAlways&&(i=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const o=t?.getScopeNames()??[];for(const s of this._tokenTypeOverrides)s.matcher(o)&&(r=Y.set(r,0,s.type,null,-1,0,0));this.balancedBracketSelectors&&(i=this.balancedBracketSelectors.match(o))}if(i&&(r=Y.set(r,0,8,i,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===r){this._lastTokenEndIndex=e;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(r),this._lastTokenEndIndex=e;return}const n=t?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:e,scopes:n}),this._lastTokenEndIndex=e}getResult(t,e){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===e-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(t,e),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(t,e){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===e-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(t,e),this._binaryTokens[this._binaryTokens.length-2]=0);const n=new Uint32Array(this._binaryTokens.length);for(let r=0,i=this._binaryTokens.length;r<i;r++)n[r]=this._binaryTokens[r];return n}},lr=class{constructor(t,e){this._onigLib=e,this._theme=t}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(const t of this._grammars.values())t.dispose()}setTheme(t){this._theme=t}getColorMap(){return this._theme.getColorMap()}addGrammar(t,e){this._rawGrammars.set(t.scopeName,t),e&&this._injectionGrammars.set(t.scopeName,e)}lookup(t){return this._rawGrammars.get(t)}injections(t){return this._injectionGrammars.get(t)}getDefaults(){return this._theme.getDefaults()}themeMatch(t){return this._theme.match(t)}grammarForScopeName(t,e,n,r,i){if(!this._grammars.has(t)){let o=this._rawGrammars.get(t);if(!o)return null;this._grammars.set(t,rr(t,o,e,n,r,i,this,this._onigLib))}return this._grammars.get(t)}},cr=class{_options;_syncRegistry;_ensureGrammarCache;constructor(e){this._options=e,this._syncRegistry=new lr(pe.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,n){this._syncRegistry.setTheme(pe.createFromRawTheme(e,n))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(e,n,r){return this.loadGrammarWithConfiguration(e,n,{embeddedLanguages:r})}loadGrammarWithConfiguration(e,n,r){return this._loadGrammar(e,n,r.embeddedLanguages,r.tokenTypes,new sr(r.balancedBracketSelectors||[],r.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,n,r,i,o){const s=new Bn(this._syncRegistry,e);for(;s.Q.length>0;)s.Q.map(l=>this._loadSingleGrammar(l.scopeName)),s.processQueue();return this._grammarForScopeName(e,n,r,i,o)}_loadSingleGrammar(e){this._ensureGrammarCache.has(e)||(this._doLoadSingleGrammar(e),this._ensureGrammarCache.set(e,!0))}_doLoadSingleGrammar(e){const n=this._options.loadGrammar(e);if(n){const r=typeof this._options.getInjections=="function"?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(n,r)}}addGrammar(e,n=[],r=0,i=null){return this._syncRegistry.addGrammar(e,n),this._grammarForScopeName(e.scopeName,r,i)}_grammarForScopeName(e,n=0,r=null,i=null,o=null){return this._syncRegistry.grammarForScopeName(e,n,r,i,o)}},We=Fe.NULL;const ur=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class se{constructor(e,n,r){this.normal=n,this.property=e,r&&(this.space=r)}}se.prototype.normal={};se.prototype.property={};se.prototype.space=void 0;function Kt(t,e){const n={},r={};for(const i of t)Object.assign(n,i.property),Object.assign(r,i.normal);return new se(n,r,e)}function ze(t){return t.toLowerCase()}class D{constructor(e,n){this.attribute=n,this.property=e}}D.prototype.attribute="";D.prototype.booleanish=!1;D.prototype.boolean=!1;D.prototype.commaOrSpaceSeparated=!1;D.prototype.commaSeparated=!1;D.prototype.defined=!1;D.prototype.mustUseProperty=!1;D.prototype.number=!1;D.prototype.overloadedBoolean=!1;D.prototype.property="";D.prototype.spaceSeparated=!1;D.prototype.space=void 0;let dr=0;const R=F(),k=F(),qe=F(),_=F(),A=F(),q=F(),N=F();function F(){return 2**++dr}const Ke=Object.freeze(Object.defineProperty({__proto__:null,boolean:R,booleanish:k,commaOrSpaceSeparated:N,commaSeparated:q,number:_,overloadedBoolean:qe,spaceSeparated:A},Symbol.toStringTag,{value:"Module"})),Ce=Object.keys(Ke);class Qe extends D{constructor(e,n,r,i){let o=-1;if(super(e,n),Et(this,"space",i),typeof r=="number")for(;++o<Ce.length;){const s=Ce[o];Et(this,Ce[o],(r&Ke[s])===Ke[s])}}}Qe.prototype.defined=!0;function Et(t,e,n){n&&(t[e]=n)}function J(t){const e={},n={};for(const[r,i]of Object.entries(t.properties)){const o=new Qe(r,t.transform(t.attributes||{},r),i,t.space);t.mustUseProperty&&t.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),e[r]=o,n[ze(r)]=r,n[ze(o.attribute)]=r}return new se(e,n,t.space)}const Yt=J({properties:{ariaActiveDescendant:null,ariaAtomic:k,ariaAutoComplete:null,ariaBusy:k,ariaChecked:k,ariaColCount:_,ariaColIndex:_,ariaColSpan:_,ariaControls:A,ariaCurrent:null,ariaDescribedBy:A,ariaDetails:null,ariaDisabled:k,ariaDropEffect:A,ariaErrorMessage:null,ariaExpanded:k,ariaFlowTo:A,ariaGrabbed:k,ariaHasPopup:null,ariaHidden:k,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:A,ariaLevel:_,ariaLive:null,ariaModal:k,ariaMultiLine:k,ariaMultiSelectable:k,ariaOrientation:null,ariaOwns:A,ariaPlaceholder:null,ariaPosInSet:_,ariaPressed:k,ariaReadOnly:k,ariaRelevant:null,ariaRequired:k,ariaRoleDescription:A,ariaRowCount:_,ariaRowIndex:_,ariaRowSpan:_,ariaSelected:k,ariaSetSize:_,ariaSort:null,ariaValueMax:_,ariaValueMin:_,ariaValueNow:_,ariaValueText:null,role:null},transform(t,e){return e==="role"?e:"aria-"+e.slice(4).toLowerCase()}});function Jt(t,e){return e in t?t[e]:e}function Xt(t,e){return Jt(t,e.toLowerCase())}const mr=J({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:q,acceptCharset:A,accessKey:A,action:null,allow:null,allowFullScreen:R,allowPaymentRequest:R,allowUserMedia:R,alt:null,as:null,async:R,autoCapitalize:null,autoComplete:A,autoFocus:R,autoPlay:R,blocking:A,capture:null,charSet:null,checked:R,cite:null,className:A,cols:_,colSpan:null,content:null,contentEditable:k,controls:R,controlsList:A,coords:_|q,crossOrigin:null,data:null,dateTime:null,decoding:null,default:R,defer:R,dir:null,dirName:null,disabled:R,download:qe,draggable:k,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:R,formTarget:null,headers:A,height:_,hidden:qe,high:_,href:null,hrefLang:null,htmlFor:A,httpEquiv:A,id:null,imageSizes:null,imageSrcSet:null,inert:R,inputMode:null,integrity:null,is:null,isMap:R,itemId:null,itemProp:A,itemRef:A,itemScope:R,itemType:A,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:R,low:_,manifest:null,max:null,maxLength:_,media:null,method:null,min:null,minLength:_,multiple:R,muted:R,name:null,nonce:null,noModule:R,noValidate:R,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:R,optimum:_,pattern:null,ping:A,placeholder:null,playsInline:R,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:R,referrerPolicy:null,rel:A,required:R,reversed:R,rows:_,rowSpan:_,sandbox:A,scope:null,scoped:R,seamless:R,selected:R,shadowRootClonable:R,shadowRootDelegatesFocus:R,shadowRootMode:null,shape:null,size:_,sizes:null,slot:null,span:_,spellCheck:k,src:null,srcDoc:null,srcLang:null,srcSet:null,start:_,step:null,style:null,tabIndex:_,target:null,title:null,translate:null,type:null,typeMustMatch:R,useMap:null,value:k,width:_,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:A,axis:null,background:null,bgColor:null,border:_,borderColor:null,bottomMargin:_,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:R,declare:R,event:null,face:null,frame:null,frameBorder:null,hSpace:_,leftMargin:_,link:null,longDesc:null,lowSrc:null,marginHeight:_,marginWidth:_,noResize:R,noHref:R,noShade:R,noWrap:R,object:null,profile:null,prompt:null,rev:null,rightMargin:_,rules:null,scheme:null,scrolling:k,standby:null,summary:null,text:null,topMargin:_,valueType:null,version:null,vAlign:null,vLink:null,vSpace:_,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:R,disableRemotePlayback:R,prefix:null,property:null,results:_,security:null,unselectable:null},space:"html",transform:Xt}),pr=J({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:N,accentHeight:_,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:_,amplitude:_,arabicForm:null,ascent:_,attributeName:null,attributeType:null,azimuth:_,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:_,by:null,calcMode:null,capHeight:_,className:A,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:_,diffuseConstant:_,direction:null,display:null,dur:null,divisor:_,dominantBaseline:null,download:R,dx:null,dy:null,edgeMode:null,editable:null,elevation:_,enableBackground:null,end:null,event:null,exponent:_,externalResourcesRequired:null,fill:null,fillOpacity:_,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:q,g2:q,glyphName:q,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:_,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:_,horizOriginX:_,horizOriginY:_,id:null,ideographic:_,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:_,k:_,k1:_,k2:_,k3:_,k4:_,kernelMatrix:N,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:_,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:_,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:_,overlineThickness:_,paintOrder:null,panose1:null,path:null,pathLength:_,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:A,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:_,pointsAtY:_,pointsAtZ:_,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:N,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:N,rev:N,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:N,requiredFeatures:N,requiredFonts:N,requiredFormats:N,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:_,specularExponent:_,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:_,strikethroughThickness:_,string:null,stroke:null,strokeDashArray:N,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:_,strokeOpacity:_,strokeWidth:null,style:null,surfaceScale:_,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:N,tabIndex:_,tableValues:null,target:null,targetX:_,targetY:_,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:N,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:_,underlineThickness:_,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:_,values:null,vAlphabetic:_,vMathematical:_,vectorEffect:null,vHanging:_,vIdeographic:_,version:null,vertAdvY:_,vertOriginX:_,vertOriginY:_,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:_,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Jt}),Qt=J({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(t,e){return"xlink:"+e.slice(5).toLowerCase()}}),Zt=J({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Xt}),en=J({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(t,e){return"xml:"+e.slice(3).toLowerCase()}}),hr=/[A-Z]/g,vt=/-[a-z]/g,fr=/^data[-\w.:]+$/i;function _r(t,e){const n=ze(e);let r=e,i=D;if(n in t.normal)return t.property[t.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&fr.test(e)){if(e.charAt(4)==="-"){const o=e.slice(5).replace(vt,yr);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=e.slice(4);if(!vt.test(o)){let s=o.replace(hr,gr);s.charAt(0)!=="-"&&(s="-"+s),e="data"+s}}i=Qe}return new i(r,e)}function gr(t){return"-"+t.toLowerCase()}function yr(t){return t.charAt(1).toUpperCase()}const Er=Kt([Yt,mr,Qt,Zt,en],"html"),tn=Kt([Yt,pr,Qt,Zt,en],"svg"),bt={}.hasOwnProperty;function vr(t,e){const n=e||{};function r(i,...o){let s=r.invalid;const l=r.handlers;if(i&&bt.call(i,t)){const a=String(i[t]);s=bt.call(l,a)?l[a]:r.unknown}if(s)return s.call(this,i,...o)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const br=/["&'<>`]/g,Rr=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Lr=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,Ar=/[|\\{}()[\]^$+*?.]/g,Rt=new WeakMap;function Tr(t,e){if(t=t.replace(e.subset?kr(e.subset):br,r),e.subset||e.escapeOnly)return t;return t.replace(Rr,n).replace(Lr,r);function n(i,o,s){return e.format((i.charCodeAt(0)-55296)*1024+i.charCodeAt(1)-56320+65536,s.charCodeAt(o+2),e)}function r(i,o,s){return e.format(i.charCodeAt(0),s.charCodeAt(o+1),e)}}function kr(t){let e=Rt.get(t);return e||(e=Sr(t),Rt.set(t,e)),e}function Sr(t){const e=[];let n=-1;for(;++n<t.length;)e.push(t[n].replace(Ar,"\\$&"));return new RegExp("(?:"+e.join("|")+")","g")}const Pr=/[\dA-Fa-f]/;function Ir(t,e,n){const r="&#x"+t.toString(16).toUpperCase();return n&&e&&!Pr.test(String.fromCharCode(e))?r:r+";"}const Or=/\d/;function wr(t,e,n){const r="&#"+String(t);return n&&e&&!Or.test(String.fromCharCode(e))?r:r+";"}const Cr=["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"],De={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:"€"},Dr=["cent","copy","divide","gt","lt","not","para","times"],nn={}.hasOwnProperty,Ye={};let le;for(le in De)nn.call(De,le)&&(Ye[De[le]]=le);const xr=/[^\dA-Za-z]/;function Nr(t,e,n,r){const i=String.fromCharCode(t);if(nn.call(Ye,i)){const o=Ye[i],s="&"+o;return n&&Cr.includes(o)&&!Dr.includes(o)&&(!r||e&&e!==61&&xr.test(String.fromCharCode(e)))?s:s+";"}return""}function Vr(t,e,n){let r=Ir(t,e,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=Nr(t,e,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){const o=wr(t,e,n.omitOptionalSemicolons);o.length<r.length&&(r=o)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}function K(t,e){return Tr(t,Object.assign({format:Vr},e))}const Mr=/^>|^->|<!--|-->|--!>|<!-$/g,Br=[">"],Gr=["<",">"];function jr(t,e,n,r){return r.settings.bogusComments?"<?"+K(t.value,Object.assign({},r.settings.characterReferences,{subset:Br}))+">":"<!--"+t.value.replace(Mr,i)+"-->";function i(o){return K(o,Object.assign({},r.settings.characterReferences,{subset:Gr}))}}function $r(t,e,n,r){return"<!"+(r.settings.upperDoctype?"DOCTYPE":"doctype")+(r.settings.tightDoctype?"":" ")+"html>"}function Lt(t,e){const n=String(t);if(typeof e!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(e);for(;i!==-1;)r++,i=n.indexOf(e,i+e.length);return r}function Ur(t,e){const n=e||{};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function Hr(t){return t.join(" ").trim()}const Fr=/[ \t\n\f\r]/g;function Ze(t){return typeof t=="object"?t.type==="text"?At(t.value):!1:At(t)}function At(t){return t.replace(Fr,"")===""}const I=on(1),rn=on(-1),Wr=[];function on(t){return e;function e(n,r,i){const o=n?n.children:Wr;let s=(r||0)+t,l=o[s];if(!i)for(;l&&Ze(l);)s+=t,l=o[s];return l}}const zr={}.hasOwnProperty;function sn(t){return e;function e(n,r,i){return zr.call(t,n.tagName)&&t[n.tagName](n,r,i)}}const et=sn({body:Kr,caption:xe,colgroup:xe,dd:Qr,dt:Xr,head:xe,html:qr,li:Jr,optgroup:Zr,option:ei,p:Yr,rp:Tt,rt:Tt,tbody:ni,td:kt,tfoot:ri,th:kt,thead:ti,tr:ii});function xe(t,e,n){const r=I(n,e,!0);return!r||r.type!=="comment"&&!(r.type==="text"&&Ze(r.value.charAt(0)))}function qr(t,e,n){const r=I(n,e);return!r||r.type!=="comment"}function Kr(t,e,n){const r=I(n,e);return!r||r.type!=="comment"}function Yr(t,e,n){const r=I(n,e);return r?r.type==="element"&&(r.tagName==="address"||r.tagName==="article"||r.tagName==="aside"||r.tagName==="blockquote"||r.tagName==="details"||r.tagName==="div"||r.tagName==="dl"||r.tagName==="fieldset"||r.tagName==="figcaption"||r.tagName==="figure"||r.tagName==="footer"||r.tagName==="form"||r.tagName==="h1"||r.tagName==="h2"||r.tagName==="h3"||r.tagName==="h4"||r.tagName==="h5"||r.tagName==="h6"||r.tagName==="header"||r.tagName==="hgroup"||r.tagName==="hr"||r.tagName==="main"||r.tagName==="menu"||r.tagName==="nav"||r.tagName==="ol"||r.tagName==="p"||r.tagName==="pre"||r.tagName==="section"||r.tagName==="table"||r.tagName==="ul"):!n||!(n.type==="element"&&(n.tagName==="a"||n.tagName==="audio"||n.tagName==="del"||n.tagName==="ins"||n.tagName==="map"||n.tagName==="noscript"||n.tagName==="video"))}function Jr(t,e,n){const r=I(n,e);return!r||r.type==="element"&&r.tagName==="li"}function Xr(t,e,n){const r=I(n,e);return!!(r&&r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd"))}function Qr(t,e,n){const r=I(n,e);return!r||r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd")}function Tt(t,e,n){const r=I(n,e);return!r||r.type==="element"&&(r.tagName==="rp"||r.tagName==="rt")}function Zr(t,e,n){const r=I(n,e);return!r||r.type==="element"&&r.tagName==="optgroup"}function ei(t,e,n){const r=I(n,e);return!r||r.type==="element"&&(r.tagName==="option"||r.tagName==="optgroup")}function ti(t,e,n){const r=I(n,e);return!!(r&&r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot"))}function ni(t,e,n){const r=I(n,e);return!r||r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot")}function ri(t,e,n){return!I(n,e)}function ii(t,e,n){const r=I(n,e);return!r||r.type==="element"&&r.tagName==="tr"}function kt(t,e,n){const r=I(n,e);return!r||r.type==="element"&&(r.tagName==="td"||r.tagName==="th")}const oi=sn({body:li,colgroup:ci,head:ai,html:si,tbody:ui});function si(t){const e=I(t,-1);return!e||e.type!=="comment"}function ai(t){const e=new Set;for(const r of t.children)if(r.type==="element"&&(r.tagName==="base"||r.tagName==="title")){if(e.has(r.tagName))return!1;e.add(r.tagName)}const n=t.children[0];return!n||n.type==="element"}function li(t){const e=I(t,-1,!0);return!e||e.type!=="comment"&&!(e.type==="text"&&Ze(e.value.charAt(0)))&&!(e.type==="element"&&(e.tagName==="meta"||e.tagName==="link"||e.tagName==="script"||e.tagName==="style"||e.tagName==="template"))}function ci(t,e,n){const r=rn(n,e),i=I(t,-1,!0);return n&&r&&r.type==="element"&&r.tagName==="colgroup"&&et(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="col")}function ui(t,e,n){const r=rn(n,e),i=I(t,-1);return n&&r&&r.type==="element"&&(r.tagName==="thead"||r.tagName==="tbody")&&et(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="tr")}const ce={name:[[`
|
|
5
5
|
\f\r &/=>`.split(""),`
|