pinomad 0.13.0 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-0dh2k3er.js +43 -0
- package/dist/{chunk-kmzzjv53.js → chunk-1mjbt2z2.js} +143 -10
- package/dist/{chunk-s0h7c7da.js → chunk-1rdbnvy6.js} +1 -1
- package/dist/{chunk-53xv3fny.js → chunk-35szq73k.js} +2446 -416
- package/dist/{chunk-aapsc9g0.js → chunk-5j7ybhjj.js} +1952 -295
- package/dist/{chunk-m51mq8vh.js → chunk-5pv0g1nj.js} +12 -10
- package/dist/{chunk-7mn38n4f.js → chunk-63ymn5c9.js} +2 -2
- package/dist/{chunk-563fnad9.js → chunk-6j6hkfbj.js} +8 -4
- package/dist/{chunk-pqe7q1s7.js → chunk-6vbp1vva.js} +2 -1
- package/dist/{chunk-g3ahp7b9.js → chunk-9trbbz4r.js} +1 -1
- package/dist/{chunk-d9mq5d46.js → chunk-b0nwq1dt.js} +10 -8
- package/dist/chunk-dsr19q5h.js +23 -0
- package/dist/{chunk-6th9xv39.js → chunk-e53c0s8z.js} +9 -7
- package/dist/{chunk-4fferbxw.js → chunk-e59k3bmz.js} +213 -30
- package/dist/chunk-eerpgvy9.js +315 -0
- package/dist/chunk-eewxy4cp.js +240 -0
- package/dist/{chunk-maqv34cs.js → chunk-evbv1fkn.js} +3 -3
- package/dist/{chunk-ra86wjp5.js → chunk-ex5yr09h.js} +11 -6
- package/dist/{chunk-t91zt5f0.js → chunk-hg9gs396.js} +1 -1
- package/dist/{chunk-90g1cg9n.js → chunk-mtkvft88.js} +1 -1
- package/dist/{chunk-wd7aracm.js → chunk-mxwcnnkg.js} +1 -303
- package/dist/{chunk-d4tq62yr.js → chunk-w927q9m1.js} +12 -11
- package/dist/pinomad.js +12 -12
- package/package.json +5 -1
- package/web/assets/{core-BHm2gdHL.js → core-BWHGsFpV.js} +1 -1
- package/web/assets/{highlighted-diff-DrHvSLK9.js → highlighted-diff-DJ7KZCpS.js} +2 -2
- package/web/assets/{highlights-1aLwssz-.js → highlights-CyEmo6OI.js} +1 -1
- package/web/assets/{highlights-themes-C1p4pFYS.js → highlights-themes-CSNkBojy.js} +1 -1
- package/web/assets/index-C_qkbyL7.css +1 -0
- package/web/assets/index-DefQtCI2.js +396 -0
- package/web/assets/{shiki-BwyCm3kZ.js → shiki-BzCmRG-v.js} +2 -2
- package/web/assets/{shiki-langs-CMlALLSg.js → shiki-langs-DOkjyV4d.js} +1 -1
- package/web/assets/{stream-tokenizer-BlgIhw0y.js → stream-tokenizer-CBPqFe4Z.js} +1 -1
- package/web/assets/{theming-themes-DDvoqEqT.js → theming-themes-wKVca0aB.js} +1 -1
- package/web/assets/{xterm-view-BnKOnF3C.js → xterm-view-CKa1-QCM.js} +12 -12
- package/web/index.html +3 -2
- package/web/theme-boot.js +11 -0
- package/dist/chunk-sd640dt7.js +0 -22
- package/dist/chunk-t6fw0wa9.js +0 -96
- package/web/assets/index-A_AUJoO6.css +0 -1
- package/web/assets/index-BafYMKiN.js +0 -396
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var Ot=Object.defineProperty;var jt=(n,e,t)=>e in n?Ot(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var h=(n,e,t)=>jt(n,typeof e!="symbol"?e+"":e,t);import{t as Wt}from"./highlighted-diff-DrHvSLK9.js";var R=class extends Error{constructor(n){super(n),this.name="ShikiError"}};function Ft(n){return Le(n)}function Le(n){return Array.isArray(n)?Dt(n):n instanceof RegExp?n:typeof n=="object"?Ht(n):n}function Dt(n){let e=[];for(let t=0,r=n.length;t<r;t++)e[t]=Le(n[t]);return e}function Ht(n){let e={};for(let t in n)e[t]=Le(n[t]);return e}function st(n,...e){return e.forEach(t=>{for(let r in t)n[r]=t[r]}),n}function rt(n){const e=~n.lastIndexOf("/")||~n.lastIndexOf("\\");return e===0?n:~e===n.length-1?rt(n.substring(0,n.length-1)):n.substr(~e+1)}var be=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,re=class{static hasCaptures(n){return n===null?!1:(be.lastIndex=0,be.test(n))}static replaceCaptures(n,e,t){return n.replace(be,(r,s,i,o)=>{let c=t[parseInt(s||i,10)];if(c){let a=e.substring(c.start,c.end);for(;a[0]===".";)a=a.substring(1);switch(o){case"downcase":return a.toLowerCase();case"upcase":return a.toUpperCase();default:return a}}else return r})}};function it(n,e){return n<e?-1:n>e?1:0}function ot(n,e){if(n===null&&e===null)return 0;if(!n)return-1;if(!e)return 1;let t=n.length,r=e.length;if(t===r){for(let s=0;s<t;s++){let i=it(n[s],e[s]);if(i!==0)return i}return 0}return t-r}function De(n){return!!(/^#[0-9a-f]{6}$/i.test(n)||/^#[0-9a-f]{8}$/i.test(n)||/^#[0-9a-f]{3}$/i.test(n)||/^#[0-9a-f]{4}$/i.test(n))}function at(n){return n.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var ct=class{constructor(n){h(this,"fn");h(this,"cache",new Map);this.fn=n}get(n){if(this.cache.has(n))return this.cache.get(n);const e=this.fn(n);return this.cache.set(n,e),e}},ae=class{constructor(n,e,t){h(this,"_colorMap");h(this,"_defaults");h(this,"_root");h(this,"_cachedMatchRoot",new ct(n=>this._root.match(n)));this._colorMap=n,this._defaults=e,this._root=t}static createFromRawTheme(n,e){return this.createFromParsedTheme(Ut(n),e)}static createFromParsedTheme(n,e){return Vt(n,e)}getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(n){if(n===null)return this._defaults;const e=n.scopeName,r=this._cachedMatchRoot.get(e).find(s=>zt(n.parent,s.parentScopes));return r?new lt(r.fontStyle,r.foreground,r.background):null}},we=class ie{constructor(e,t){h(this,"parent");h(this,"scopeName");this.parent=e,this.scopeName=t}static push(e,t){for(const r of t)e=new ie(e,r);return e}static from(...e){let t=null;for(let r=0;r<e.length;r++)t=new ie(t,e[r]);return t}push(e){return new ie(this,e)}getSegments(){let e=this;const t=[];for(;e;)t.push(e.scopeName),e=e.parent;return t.reverse(),t}toString(){return this.getSegments().join(" ")}extends(e){return this===e?!0:this.parent===null?!1:this.parent.extends(e)}getExtensionIfDefined(e){const t=[];let r=this;for(;r&&r!==e;)t.push(r.scopeName),r=r.parent;return r===e?t.reverse():void 0}};function zt(n,e){if(e.length===0)return!0;for(let t=0;t<e.length;t++){let r=e[t],s=!1;if(r===">"){if(t===e.length-1)return!1;r=e[++t],s=!0}for(;n&&!qt(n.scopeName,r);){if(s)return!1;n=n.parent}if(!n)return!1;n=n.parent}return!0}function qt(n,e){return e===n||n.startsWith(e)&&n[e.length]==="."}var lt=class{constructor(n,e,t){h(this,"fontStyle");h(this,"foregroundId");h(this,"backgroundId");this.fontStyle=n,this.foregroundId=e,this.backgroundId=t}};function Ut(n){if(!n)return[];if(!n.settings||!Array.isArray(n.settings))return[];let e=n.settings,t=[],r=0;for(let s=0,i=e.length;s<i;s++){let o=e[s];if(!o.settings)continue;let c;if(typeof o.scope=="string"){let u=o.scope;u=u.replace(/^[,]+/,""),u=u.replace(/[,]+$/,""),c=u.split(",")}else Array.isArray(o.scope)?c=o.scope:c=[""];let a=-1;if(typeof o.settings.fontStyle=="string"){a=0;let u=o.settings.fontStyle.split(" ");for(let f=0,g=u.length;f<g;f++)switch(u[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 l=null;typeof o.settings.foreground=="string"&&De(o.settings.foreground)&&(l=o.settings.foreground);let d=null;typeof o.settings.background=="string"&&De(o.settings.background)&&(d=o.settings.background);for(let u=0,f=c.length;u<f;u++){let p=c[u].trim().split(" "),b=p[p.length-1],S=null;p.length>1&&(S=p.slice(0,p.length-1),S.reverse()),t[r++]=new Kt(b,S,s,a,l,d)}}return t}var Kt=class{constructor(n,e,t,r,s,i){h(this,"scope");h(this,"parentScopes");h(this,"index");h(this,"fontStyle");h(this,"foreground");h(this,"background");this.scope=n,this.parentScopes=e,this.index=t,this.fontStyle=r,this.foreground=s,this.background=i}},I=(n=>(n[n.NotSet=-1]="NotSet",n[n.None=0]="None",n[n.Italic=1]="Italic",n[n.Bold=2]="Bold",n[n.Underline=4]="Underline",n[n.Strikethrough=8]="Strikethrough",n))(I||{});function Vt(n,e){n.sort((a,l)=>{let d=it(a.scope,l.scope);return d!==0||(d=ot(a.parentScopes,l.parentScopes),d!==0)?d:a.index-l.index});let t=0,r="#000000",s="#ffffff";for(;n.length>=1&&n[0].scope==="";){let a=n.shift();a.fontStyle!==-1&&(t=a.fontStyle),a.foreground!==null&&(r=a.foreground),a.background!==null&&(s=a.background)}let i=new Yt(e),o=new lt(t,i.getId(r),i.getId(s)),c=new Qt(new Re(0,null,-1,0,0),[]);for(let a=0,l=n.length;a<l;a++){let d=n[a];c.insert(0,d.scope,d.parentScopes,d.fontStyle,i.getId(d.foreground),i.getId(d.background))}return new ae(i,o,c)}var Yt=class{constructor(n){h(this,"_isFrozen");h(this,"_lastColorId");h(this,"_id2color");h(this,"_color2id");if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(n)){this._isFrozen=!0;for(let e=0,t=n.length;e<t;e++)this._color2id[n[e]]=e,this._id2color[e]=n[e]}else this._isFrozen=!1}getId(n){if(n===null)return 0;n=n.toUpperCase();let e=this._color2id[n];if(e)return e;if(this._isFrozen)throw new Error(`Missing color in color map - ${n}`);return e=++this._lastColorId,this._color2id[n]=e,this._id2color[e]=n,e}getColorMap(){return this._id2color.slice(0)}},Jt=Object.freeze([]),Re=class ht{constructor(e,t,r,s,i){h(this,"scopeDepth");h(this,"parentScopes");h(this,"fontStyle");h(this,"foreground");h(this,"background");this.scopeDepth=e,this.parentScopes=t||Jt,this.fontStyle=r,this.foreground=s,this.background=i}clone(){return new ht(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let t=[];for(let r=0,s=e.length;r<s;r++)t[r]=e[r].clone();return t}acceptOverwrite(e,t,r,s){this.scopeDepth>e?console.log("how did this happen?"):this.scopeDepth=e,t!==-1&&(this.fontStyle=t),r!==0&&(this.foreground=r),s!==0&&(this.background=s)}},Qt=class Te{constructor(e,t=[],r={}){h(this,"_mainRule");h(this,"_children");h(this,"_rulesWithParentScopes");this._mainRule=e,this._children=r,this._rulesWithParentScopes=t}static _cmpBySpecificity(e,t){if(e.scopeDepth!==t.scopeDepth)return t.scopeDepth-e.scopeDepth;let r=0,s=0;for(;e.parentScopes[r]===">"&&r++,t.parentScopes[s]===">"&&s++,!(r>=e.parentScopes.length||s>=t.parentScopes.length);){const i=t.parentScopes[s].length-e.parentScopes[r].length;if(i!==0)return i;r++,s++}return t.parentScopes.length-e.parentScopes.length}match(e){if(e!==""){let r=e.indexOf("."),s,i;if(r===-1?(s=e,i=""):(s=e.substring(0,r),i=e.substring(r+1)),this._children.hasOwnProperty(s))return this._children[s].match(i)}const t=this._rulesWithParentScopes.concat(this._mainRule);return t.sort(Te._cmpBySpecificity),t}insert(e,t,r,s,i,o){if(t===""){this._doInsertHere(e,r,s,i,o);return}let c=t.indexOf("."),a,l;c===-1?(a=t,l=""):(a=t.substring(0,c),l=t.substring(c+1));let d;this._children.hasOwnProperty(a)?d=this._children[a]:(d=new Te(this._mainRule.clone(),Re.cloneArr(this._rulesWithParentScopes)),this._children[a]=d),d.insert(e+1,l,r,s,i,o)}_doInsertHere(e,t,r,s,i){if(t===null){this._mainRule.acceptOverwrite(e,r,s,i);return}for(let o=0,c=this._rulesWithParentScopes.length;o<c;o++){let a=this._rulesWithParentScopes[o];if(ot(a.parentScopes,t)===0){a.acceptOverwrite(e,r,s,i);return}}r===-1&&(r=this._mainRule.fontStyle),s===0&&(s=this._mainRule.foreground),i===0&&(i=this._mainRule.background),this._rulesWithParentScopes.push(new Re(e,t,r,s,i))}},O=class N{static toBinaryStr(e){return e.toString(2).padStart(32,"0")}static print(e){const t=N.getLanguageId(e),r=N.getTokenType(e),s=N.getFontStyle(e),i=N.getForeground(e),o=N.getBackground(e);console.log({languageId:t,tokenType:r,fontStyle:s,foreground:i,background:o})}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,t,r,s,i,o,c){let a=N.getLanguageId(e),l=N.getTokenType(e),d=N.containsBalancedBrackets(e)?1:0,u=N.getFontStyle(e),f=N.getForeground(e),g=N.getBackground(e);return t!==0&&(a=t),r!==8&&(l=r),s!==null&&(d=s?1:0),i!==-1&&(u=i),o!==0&&(f=o),c!==0&&(g=c),(a<<0|l<<8|d<<10|u<<11|f<<15|g<<24)>>>0}};function ce(n,e){const t=[],r=Xt(n);let s=r.next();for(;s!==null;){let a=0;if(s.length===2&&s.charAt(1)===":"){switch(s.charAt(0)){case"R":a=1;break;case"L":a=-1;break;default:console.log(`Unknown priority ${s} in scope selector`)}s=r.next()}let l=o();if(t.push({matcher:l,priority:a}),s!==",")break;s=r.next()}return t;function i(){if(s==="-"){s=r.next();const a=i();return l=>!!a&&!a(l)}if(s==="("){s=r.next();const a=c();return s===")"&&(s=r.next()),a}if(He(s)){const a=[];do a.push(s),s=r.next();while(He(s));return l=>e(a,l)}return null}function o(){const a=[];let l=i();for(;l;)a.push(l),l=i();return d=>a.every(u=>u(d))}function c(){const a=[];let l=o();for(;l&&(a.push(l),s==="|"||s===",");){do s=r.next();while(s==="|"||s===",");l=o()}return d=>a.some(u=>u(d))}}function He(n){return!!n&&!!n.match(/[\w\.:]+/)}function Xt(n){let e=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,t=e.exec(n);return{next:()=>{if(!t)return null;const r=t[0];return t=e.exec(n),r}}}function ut(n){typeof n.dispose=="function"&&n.dispose()}var U=class{constructor(n){h(this,"scopeName");this.scopeName=n}toKey(){return this.scopeName}},Zt=class{constructor(n,e){h(this,"scopeName");h(this,"ruleName");this.scopeName=n,this.ruleName=e}toKey(){return`${this.scopeName}#${this.ruleName}`}},en=class{constructor(){h(this,"_references",[]);h(this,"_seenReferenceKeys",new Set);h(this,"visitedRule",new Set)}get references(){return this._references}add(n){const e=n.toKey();this._seenReferenceKeys.has(e)||(this._seenReferenceKeys.add(e),this._references.push(n))}},tn=class{constructor(n,e){h(this,"repo");h(this,"initialScopeName");h(this,"seenFullScopeRequests",new Set);h(this,"seenPartialScopeRequests",new Set);h(this,"Q");this.repo=n,this.initialScopeName=e,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new U(this.initialScopeName)]}processQueue(){const n=this.Q;this.Q=[];const e=new en;for(const t of n)nn(t,this.initialScopeName,this.repo,e);for(const t of e.references)if(t instanceof U){if(this.seenFullScopeRequests.has(t.scopeName))continue;this.seenFullScopeRequests.add(t.scopeName),this.Q.push(t)}else{if(this.seenFullScopeRequests.has(t.scopeName)||this.seenPartialScopeRequests.has(t.toKey()))continue;this.seenPartialScopeRequests.add(t.toKey()),this.Q.push(t)}}};function nn(n,e,t,r){const s=t.lookup(n.scopeName);if(!s){if(n.scopeName===e)throw new Error(`No grammar provided for <${e}>`);return}const i=t.lookup(e);n instanceof U?oe({baseGrammar:i,selfGrammar:s},r):Ie(n.ruleName,{baseGrammar:i,selfGrammar:s,repository:s.repository},r);const o=t.injections(n.scopeName);if(o)for(const c of o)r.add(new U(c))}function Ie(n,e,t){if(e.repository&&e.repository[n]){const r=e.repository[n];le([r],e,t)}}function oe(n,e){n.selfGrammar.patterns&&Array.isArray(n.selfGrammar.patterns)&&le(n.selfGrammar.patterns,{...n,repository:n.selfGrammar.repository},e),n.selfGrammar.injections&&le(Object.values(n.selfGrammar.injections),{...n,repository:n.selfGrammar.repository},e)}function le(n,e,t){for(const r of n){if(t.visitedRule.has(r))continue;t.visitedRule.add(r);const s=r.repository?st({},e.repository,r.repository):e.repository;Array.isArray(r.patterns)&&le(r.patterns,{...e,repository:s},t);const i=r.include;if(!i)continue;const o=ft(i);switch(o.kind){case 0:oe({...e,selfGrammar:e.baseGrammar},t);break;case 1:oe(e,t);break;case 2:Ie(o.ruleName,{...e,repository:s},t);break;case 3:case 4:const c=o.scopeName===e.selfGrammar.scopeName?e.selfGrammar:o.scopeName===e.baseGrammar.scopeName?e.baseGrammar:void 0;if(c){const a={baseGrammar:e.baseGrammar,selfGrammar:c,repository:s};o.kind===4?Ie(o.ruleName,a,t):oe(a,t)}else o.kind===4?t.add(new Zt(o.scopeName,o.ruleName)):t.add(new U(o.scopeName));break}}}var sn=class{constructor(){h(this,"kind",0)}},rn=class{constructor(){h(this,"kind",1)}},on=class{constructor(n){h(this,"ruleName");h(this,"kind",2);this.ruleName=n}},an=class{constructor(n){h(this,"scopeName");h(this,"kind",3);this.scopeName=n}},cn=class{constructor(n,e){h(this,"scopeName");h(this,"ruleName");h(this,"kind",4);this.scopeName=n,this.ruleName=e}};function ft(n){if(n==="$base")return new sn;if(n==="$self")return new rn;const e=n.indexOf("#");if(e===-1)return new an(n);if(e===0)return new on(n.substring(1));{const t=n.substring(0,e),r=n.substring(e+1);return new cn(t,r)}}var ln=/\\(\d+)/,ze=/\\(\d+)/g,hn=-1,dt=-2;var Z=class{constructor(n,e,t,r){h(this,"$location");h(this,"id");h(this,"_nameIsCapturing");h(this,"_name");h(this,"_contentNameIsCapturing");h(this,"_contentName");this.$location=n,this.id=e,this._name=t||null,this._nameIsCapturing=re.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=re.hasCaptures(this._contentName)}get debugName(){const n=this.$location?`${rt(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${n}`}getName(n,e){return!this._nameIsCapturing||this._name===null||n===null||e===null?this._name:re.replaceCaptures(this._name,n,e)}getContentName(n,e){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:re.replaceCaptures(this._contentName,n,e)}},un=class extends Z{constructor(e,t,r,s,i){super(e,t,r,s);h(this,"retokenizeCapturedWithRuleId");this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(e,t){throw new Error("Not supported!")}compile(e,t){throw new Error("Not supported!")}compileAG(e,t,r,s){throw new Error("Not supported!")}},fn=class extends Z{constructor(e,t,r,s,i){super(e,t,r,null);h(this,"_match");h(this,"captures");h(this,"_cachedCompiledPatterns");this._match=new K(s,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,r,s){return this._getCachedCompiledPatterns(e).compileAG(e,r,s)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new V,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},qe=class extends Z{constructor(e,t,r,s,i){super(e,t,r,s);h(this,"hasMissingPatterns");h(this,"patterns");h(this,"_cachedCompiledPatterns");this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(e,t){for(const r of this.patterns)e.getRule(r).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,r,s){return this._getCachedCompiledPatterns(e).compileAG(e,r,s)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new V,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},ve=class extends Z{constructor(e,t,r,s,i,o,c,a,l,d){super(e,t,r,s);h(this,"_begin");h(this,"beginCaptures");h(this,"_end");h(this,"endHasBackReferences");h(this,"endCaptures");h(this,"applyEndPatternLast");h(this,"hasMissingPatterns");h(this,"patterns");h(this,"_cachedCompiledPatterns");this._begin=new K(i,this.id),this.beginCaptures=o,this._end=new K(c||"",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=a,this.applyEndPatternLast=l||!1,this.patterns=d.patterns,this.hasMissingPatterns=d.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,r,s){return this._getCachedCompiledPatterns(e,t).compileAG(e,r,s)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new V;for(const r of this.patterns)e.getRule(r).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},he=class extends Z{constructor(e,t,r,s,i,o,c,a,l){super(e,t,r,s);h(this,"_begin");h(this,"beginCaptures");h(this,"whileCaptures");h(this,"_while");h(this,"whileHasBackReferences");h(this,"hasMissingPatterns");h(this,"patterns");h(this,"_cachedCompiledPatterns");h(this,"_cachedCompiledWhilePatterns");this._begin=new K(i,this.id),this.beginCaptures=o,this.whileCaptures=a,this._while=new K(c,dt),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,r,s){return this._getCachedCompiledPatterns(e).compileAG(e,r,s)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new V;for(const t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,r,s){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,r,s)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new V,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||""),this._cachedCompiledWhilePatterns}},gt=class T{static createCaptureRule(e,t,r,s,i){return e.registerRule(o=>new un(t,o,r,s,i))}static getCompiledRuleId(e,t,r){return e.id||t.registerRule(s=>{if(e.id=s,e.match)return new fn(e.$vscodeTextmateLocation,e.id,e.name,e.match,T._compileCaptures(e.captures,t,r));if(typeof e.begin>"u"){e.repository&&(r=st({},r,e.repository));let i=e.patterns;return typeof i>"u"&&e.include&&(i=[{include:e.include}]),new qe(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,T._compilePatterns(i,t,r))}return e.while?new he(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,T._compileCaptures(e.beginCaptures||e.captures,t,r),e.while,T._compileCaptures(e.whileCaptures||e.captures,t,r),T._compilePatterns(e.patterns,t,r)):new ve(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,T._compileCaptures(e.beginCaptures||e.captures,t,r),e.end,T._compileCaptures(e.endCaptures||e.captures,t,r),e.applyEndPatternLast,T._compilePatterns(e.patterns,t,r))}),e.id}static _compileCaptures(e,t,r){let s=[];if(e){let i=0;for(const o in e){if(o==="$vscodeTextmateLocation")continue;const c=parseInt(o,10);c>i&&(i=c)}for(let o=0;o<=i;o++)s[o]=null;for(const o in e){if(o==="$vscodeTextmateLocation")continue;const c=parseInt(o,10);let a=0;e[o].patterns&&(a=T.getCompiledRuleId(e[o],t,r)),s[c]=T.createCaptureRule(t,e[o].$vscodeTextmateLocation,e[o].name,e[o].contentName,a)}}return s}static _compilePatterns(e,t,r){let s=[];if(e)for(let i=0,o=e.length;i<o;i++){const c=e[i];let a=-1;if(c.include){const l=ft(c.include);switch(l.kind){case 0:case 1:a=T.getCompiledRuleId(r[c.include],t,r);break;case 2:let d=r[l.ruleName];d&&(a=T.getCompiledRuleId(d,t,r));break;case 3:case 4:const u=l.scopeName,f=l.kind===4?l.ruleName:null,g=t.getExternalGrammar(u,r);if(g)if(f){let p=g.repository[f];p&&(a=T.getCompiledRuleId(p,t,g.repository))}else a=T.getCompiledRuleId(g.repository.$self,t,g.repository);break}}else a=T.getCompiledRuleId(c,t,r);if(a!==-1){const l=t.getRule(a);let d=!1;if((l instanceof qe||l instanceof ve||l instanceof he)&&l.hasMissingPatterns&&l.patterns.length===0&&(d=!0),d)continue;s.push(a)}}return{patterns:s,hasMissingPatterns:(e?e.length:0)!==s.length}}},K=class pt{constructor(e,t){h(this,"source");h(this,"ruleId");h(this,"hasAnchor");h(this,"hasBackReferences");h(this,"_anchorCache");if(e&&typeof e=="string"){const r=e.length;let s=0,i=[],o=!1;for(let c=0;c<r;c++)if(e.charAt(c)==="\\"&&c+1<r){const l=e.charAt(c+1);l==="z"?(i.push(e.substring(s,c)),i.push("$(?!\\n)(?<!\\n)"),s=c+2):(l==="A"||l==="G")&&(o=!0),c++}this.hasAnchor=o,s===0?this.source=e:(i.push(e.substring(s,r)),this.source=i.join(""))}else this.hasAnchor=!1,this.source=e;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=t,typeof this.source=="string"?this.hasBackReferences=ln.test(this.source):this.hasBackReferences=!1}clone(){return new pt(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,t){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let r=t.map(s=>e.substring(s.start,s.end));return ze.lastIndex=0,this.source.replace(ze,(s,i)=>at(r[parseInt(i,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let e=[],t=[],r=[],s=[],i,o,c,a;for(i=0,o=this.source.length;i<o;i++)c=this.source.charAt(i),e[i]=c,t[i]=c,r[i]=c,s[i]=c,c==="\\"&&i+1<o&&(a=this.source.charAt(i+1),a==="A"?(e[i+1]="",t[i+1]="",r[i+1]="A",s[i+1]="A"):a==="G"?(e[i+1]="",t[i+1]="G",r[i+1]="",s[i+1]="G"):(e[i+1]=a,t[i+1]=a,r[i+1]=a,s[i+1]=a),i++);return{A0_G0:e.join(""),A0_G1:t.join(""),A1_G0:r.join(""),A1_G1:s.join("")}}resolveAnchors(e,t){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:e?t?this._anchorCache.A1_G1:this._anchorCache.A1_G0:t?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},V=class{constructor(){h(this,"_items");h(this,"_hasAnchors");h(this,"_cached");h(this,"_anchorCache");this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached.dispose(),this._cached=null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(n){this._items.push(n),this._hasAnchors=this._hasAnchors||n.hasAnchor}unshift(n){this._items.unshift(n),this._hasAnchors=this._hasAnchors||n.hasAnchor}length(){return this._items.length}setSource(n,e){this._items[n].source!==e&&(this._disposeCaches(),this._items[n].setSource(e))}compile(n){if(!this._cached){let e=this._items.map(t=>t.source);this._cached=new Ue(n,e,this._items.map(t=>t.ruleId))}return this._cached}compileAG(n,e,t){return this._hasAnchors?e?t?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(n,e,t)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(n,e,t)),this._anchorCache.A1_G0):t?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(n,e,t)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(n,e,t)),this._anchorCache.A0_G0):this.compile(n)}_resolveAnchors(n,e,t){let r=this._items.map(s=>s.resolveAnchors(e,t));return new Ue(n,r,this._items.map(s=>s.ruleId))}},Ue=class{constructor(n,e,t){h(this,"regExps");h(this,"rules");h(this,"scanner");this.regExps=e,this.rules=t,this.scanner=n.createOnigScanner(e)}dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const n=[];for(let e=0,t=this.rules.length;e<t;e++)n.push(" - "+this.rules[e]+": "+this.regExps[e]);return n.join(`
|
|
1
|
+
var Ot=Object.defineProperty;var jt=(n,e,t)=>e in n?Ot(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var h=(n,e,t)=>jt(n,typeof e!="symbol"?e+"":e,t);import{t as Wt}from"./highlighted-diff-DJ7KZCpS.js";var R=class extends Error{constructor(n){super(n),this.name="ShikiError"}};function Ft(n){return Le(n)}function Le(n){return Array.isArray(n)?Dt(n):n instanceof RegExp?n:typeof n=="object"?Ht(n):n}function Dt(n){let e=[];for(let t=0,r=n.length;t<r;t++)e[t]=Le(n[t]);return e}function Ht(n){let e={};for(let t in n)e[t]=Le(n[t]);return e}function st(n,...e){return e.forEach(t=>{for(let r in t)n[r]=t[r]}),n}function rt(n){const e=~n.lastIndexOf("/")||~n.lastIndexOf("\\");return e===0?n:~e===n.length-1?rt(n.substring(0,n.length-1)):n.substr(~e+1)}var be=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,re=class{static hasCaptures(n){return n===null?!1:(be.lastIndex=0,be.test(n))}static replaceCaptures(n,e,t){return n.replace(be,(r,s,i,o)=>{let c=t[parseInt(s||i,10)];if(c){let a=e.substring(c.start,c.end);for(;a[0]===".";)a=a.substring(1);switch(o){case"downcase":return a.toLowerCase();case"upcase":return a.toUpperCase();default:return a}}else return r})}};function it(n,e){return n<e?-1:n>e?1:0}function ot(n,e){if(n===null&&e===null)return 0;if(!n)return-1;if(!e)return 1;let t=n.length,r=e.length;if(t===r){for(let s=0;s<t;s++){let i=it(n[s],e[s]);if(i!==0)return i}return 0}return t-r}function De(n){return!!(/^#[0-9a-f]{6}$/i.test(n)||/^#[0-9a-f]{8}$/i.test(n)||/^#[0-9a-f]{3}$/i.test(n)||/^#[0-9a-f]{4}$/i.test(n))}function at(n){return n.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var ct=class{constructor(n){h(this,"fn");h(this,"cache",new Map);this.fn=n}get(n){if(this.cache.has(n))return this.cache.get(n);const e=this.fn(n);return this.cache.set(n,e),e}},ae=class{constructor(n,e,t){h(this,"_colorMap");h(this,"_defaults");h(this,"_root");h(this,"_cachedMatchRoot",new ct(n=>this._root.match(n)));this._colorMap=n,this._defaults=e,this._root=t}static createFromRawTheme(n,e){return this.createFromParsedTheme(Ut(n),e)}static createFromParsedTheme(n,e){return Vt(n,e)}getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(n){if(n===null)return this._defaults;const e=n.scopeName,r=this._cachedMatchRoot.get(e).find(s=>zt(n.parent,s.parentScopes));return r?new lt(r.fontStyle,r.foreground,r.background):null}},we=class ie{constructor(e,t){h(this,"parent");h(this,"scopeName");this.parent=e,this.scopeName=t}static push(e,t){for(const r of t)e=new ie(e,r);return e}static from(...e){let t=null;for(let r=0;r<e.length;r++)t=new ie(t,e[r]);return t}push(e){return new ie(this,e)}getSegments(){let e=this;const t=[];for(;e;)t.push(e.scopeName),e=e.parent;return t.reverse(),t}toString(){return this.getSegments().join(" ")}extends(e){return this===e?!0:this.parent===null?!1:this.parent.extends(e)}getExtensionIfDefined(e){const t=[];let r=this;for(;r&&r!==e;)t.push(r.scopeName),r=r.parent;return r===e?t.reverse():void 0}};function zt(n,e){if(e.length===0)return!0;for(let t=0;t<e.length;t++){let r=e[t],s=!1;if(r===">"){if(t===e.length-1)return!1;r=e[++t],s=!0}for(;n&&!qt(n.scopeName,r);){if(s)return!1;n=n.parent}if(!n)return!1;n=n.parent}return!0}function qt(n,e){return e===n||n.startsWith(e)&&n[e.length]==="."}var lt=class{constructor(n,e,t){h(this,"fontStyle");h(this,"foregroundId");h(this,"backgroundId");this.fontStyle=n,this.foregroundId=e,this.backgroundId=t}};function Ut(n){if(!n)return[];if(!n.settings||!Array.isArray(n.settings))return[];let e=n.settings,t=[],r=0;for(let s=0,i=e.length;s<i;s++){let o=e[s];if(!o.settings)continue;let c;if(typeof o.scope=="string"){let u=o.scope;u=u.replace(/^[,]+/,""),u=u.replace(/[,]+$/,""),c=u.split(",")}else Array.isArray(o.scope)?c=o.scope:c=[""];let a=-1;if(typeof o.settings.fontStyle=="string"){a=0;let u=o.settings.fontStyle.split(" ");for(let f=0,g=u.length;f<g;f++)switch(u[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 l=null;typeof o.settings.foreground=="string"&&De(o.settings.foreground)&&(l=o.settings.foreground);let d=null;typeof o.settings.background=="string"&&De(o.settings.background)&&(d=o.settings.background);for(let u=0,f=c.length;u<f;u++){let p=c[u].trim().split(" "),b=p[p.length-1],S=null;p.length>1&&(S=p.slice(0,p.length-1),S.reverse()),t[r++]=new Kt(b,S,s,a,l,d)}}return t}var Kt=class{constructor(n,e,t,r,s,i){h(this,"scope");h(this,"parentScopes");h(this,"index");h(this,"fontStyle");h(this,"foreground");h(this,"background");this.scope=n,this.parentScopes=e,this.index=t,this.fontStyle=r,this.foreground=s,this.background=i}},I=(n=>(n[n.NotSet=-1]="NotSet",n[n.None=0]="None",n[n.Italic=1]="Italic",n[n.Bold=2]="Bold",n[n.Underline=4]="Underline",n[n.Strikethrough=8]="Strikethrough",n))(I||{});function Vt(n,e){n.sort((a,l)=>{let d=it(a.scope,l.scope);return d!==0||(d=ot(a.parentScopes,l.parentScopes),d!==0)?d:a.index-l.index});let t=0,r="#000000",s="#ffffff";for(;n.length>=1&&n[0].scope==="";){let a=n.shift();a.fontStyle!==-1&&(t=a.fontStyle),a.foreground!==null&&(r=a.foreground),a.background!==null&&(s=a.background)}let i=new Yt(e),o=new lt(t,i.getId(r),i.getId(s)),c=new Qt(new Re(0,null,-1,0,0),[]);for(let a=0,l=n.length;a<l;a++){let d=n[a];c.insert(0,d.scope,d.parentScopes,d.fontStyle,i.getId(d.foreground),i.getId(d.background))}return new ae(i,o,c)}var Yt=class{constructor(n){h(this,"_isFrozen");h(this,"_lastColorId");h(this,"_id2color");h(this,"_color2id");if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(n)){this._isFrozen=!0;for(let e=0,t=n.length;e<t;e++)this._color2id[n[e]]=e,this._id2color[e]=n[e]}else this._isFrozen=!1}getId(n){if(n===null)return 0;n=n.toUpperCase();let e=this._color2id[n];if(e)return e;if(this._isFrozen)throw new Error(`Missing color in color map - ${n}`);return e=++this._lastColorId,this._color2id[n]=e,this._id2color[e]=n,e}getColorMap(){return this._id2color.slice(0)}},Jt=Object.freeze([]),Re=class ht{constructor(e,t,r,s,i){h(this,"scopeDepth");h(this,"parentScopes");h(this,"fontStyle");h(this,"foreground");h(this,"background");this.scopeDepth=e,this.parentScopes=t||Jt,this.fontStyle=r,this.foreground=s,this.background=i}clone(){return new ht(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let t=[];for(let r=0,s=e.length;r<s;r++)t[r]=e[r].clone();return t}acceptOverwrite(e,t,r,s){this.scopeDepth>e?console.log("how did this happen?"):this.scopeDepth=e,t!==-1&&(this.fontStyle=t),r!==0&&(this.foreground=r),s!==0&&(this.background=s)}},Qt=class Te{constructor(e,t=[],r={}){h(this,"_mainRule");h(this,"_children");h(this,"_rulesWithParentScopes");this._mainRule=e,this._children=r,this._rulesWithParentScopes=t}static _cmpBySpecificity(e,t){if(e.scopeDepth!==t.scopeDepth)return t.scopeDepth-e.scopeDepth;let r=0,s=0;for(;e.parentScopes[r]===">"&&r++,t.parentScopes[s]===">"&&s++,!(r>=e.parentScopes.length||s>=t.parentScopes.length);){const i=t.parentScopes[s].length-e.parentScopes[r].length;if(i!==0)return i;r++,s++}return t.parentScopes.length-e.parentScopes.length}match(e){if(e!==""){let r=e.indexOf("."),s,i;if(r===-1?(s=e,i=""):(s=e.substring(0,r),i=e.substring(r+1)),this._children.hasOwnProperty(s))return this._children[s].match(i)}const t=this._rulesWithParentScopes.concat(this._mainRule);return t.sort(Te._cmpBySpecificity),t}insert(e,t,r,s,i,o){if(t===""){this._doInsertHere(e,r,s,i,o);return}let c=t.indexOf("."),a,l;c===-1?(a=t,l=""):(a=t.substring(0,c),l=t.substring(c+1));let d;this._children.hasOwnProperty(a)?d=this._children[a]:(d=new Te(this._mainRule.clone(),Re.cloneArr(this._rulesWithParentScopes)),this._children[a]=d),d.insert(e+1,l,r,s,i,o)}_doInsertHere(e,t,r,s,i){if(t===null){this._mainRule.acceptOverwrite(e,r,s,i);return}for(let o=0,c=this._rulesWithParentScopes.length;o<c;o++){let a=this._rulesWithParentScopes[o];if(ot(a.parentScopes,t)===0){a.acceptOverwrite(e,r,s,i);return}}r===-1&&(r=this._mainRule.fontStyle),s===0&&(s=this._mainRule.foreground),i===0&&(i=this._mainRule.background),this._rulesWithParentScopes.push(new Re(e,t,r,s,i))}},O=class N{static toBinaryStr(e){return e.toString(2).padStart(32,"0")}static print(e){const t=N.getLanguageId(e),r=N.getTokenType(e),s=N.getFontStyle(e),i=N.getForeground(e),o=N.getBackground(e);console.log({languageId:t,tokenType:r,fontStyle:s,foreground:i,background:o})}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,t,r,s,i,o,c){let a=N.getLanguageId(e),l=N.getTokenType(e),d=N.containsBalancedBrackets(e)?1:0,u=N.getFontStyle(e),f=N.getForeground(e),g=N.getBackground(e);return t!==0&&(a=t),r!==8&&(l=r),s!==null&&(d=s?1:0),i!==-1&&(u=i),o!==0&&(f=o),c!==0&&(g=c),(a<<0|l<<8|d<<10|u<<11|f<<15|g<<24)>>>0}};function ce(n,e){const t=[],r=Xt(n);let s=r.next();for(;s!==null;){let a=0;if(s.length===2&&s.charAt(1)===":"){switch(s.charAt(0)){case"R":a=1;break;case"L":a=-1;break;default:console.log(`Unknown priority ${s} in scope selector`)}s=r.next()}let l=o();if(t.push({matcher:l,priority:a}),s!==",")break;s=r.next()}return t;function i(){if(s==="-"){s=r.next();const a=i();return l=>!!a&&!a(l)}if(s==="("){s=r.next();const a=c();return s===")"&&(s=r.next()),a}if(He(s)){const a=[];do a.push(s),s=r.next();while(He(s));return l=>e(a,l)}return null}function o(){const a=[];let l=i();for(;l;)a.push(l),l=i();return d=>a.every(u=>u(d))}function c(){const a=[];let l=o();for(;l&&(a.push(l),s==="|"||s===",");){do s=r.next();while(s==="|"||s===",");l=o()}return d=>a.some(u=>u(d))}}function He(n){return!!n&&!!n.match(/[\w\.:]+/)}function Xt(n){let e=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,t=e.exec(n);return{next:()=>{if(!t)return null;const r=t[0];return t=e.exec(n),r}}}function ut(n){typeof n.dispose=="function"&&n.dispose()}var U=class{constructor(n){h(this,"scopeName");this.scopeName=n}toKey(){return this.scopeName}},Zt=class{constructor(n,e){h(this,"scopeName");h(this,"ruleName");this.scopeName=n,this.ruleName=e}toKey(){return`${this.scopeName}#${this.ruleName}`}},en=class{constructor(){h(this,"_references",[]);h(this,"_seenReferenceKeys",new Set);h(this,"visitedRule",new Set)}get references(){return this._references}add(n){const e=n.toKey();this._seenReferenceKeys.has(e)||(this._seenReferenceKeys.add(e),this._references.push(n))}},tn=class{constructor(n,e){h(this,"repo");h(this,"initialScopeName");h(this,"seenFullScopeRequests",new Set);h(this,"seenPartialScopeRequests",new Set);h(this,"Q");this.repo=n,this.initialScopeName=e,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new U(this.initialScopeName)]}processQueue(){const n=this.Q;this.Q=[];const e=new en;for(const t of n)nn(t,this.initialScopeName,this.repo,e);for(const t of e.references)if(t instanceof U){if(this.seenFullScopeRequests.has(t.scopeName))continue;this.seenFullScopeRequests.add(t.scopeName),this.Q.push(t)}else{if(this.seenFullScopeRequests.has(t.scopeName)||this.seenPartialScopeRequests.has(t.toKey()))continue;this.seenPartialScopeRequests.add(t.toKey()),this.Q.push(t)}}};function nn(n,e,t,r){const s=t.lookup(n.scopeName);if(!s){if(n.scopeName===e)throw new Error(`No grammar provided for <${e}>`);return}const i=t.lookup(e);n instanceof U?oe({baseGrammar:i,selfGrammar:s},r):Ie(n.ruleName,{baseGrammar:i,selfGrammar:s,repository:s.repository},r);const o=t.injections(n.scopeName);if(o)for(const c of o)r.add(new U(c))}function Ie(n,e,t){if(e.repository&&e.repository[n]){const r=e.repository[n];le([r],e,t)}}function oe(n,e){n.selfGrammar.patterns&&Array.isArray(n.selfGrammar.patterns)&&le(n.selfGrammar.patterns,{...n,repository:n.selfGrammar.repository},e),n.selfGrammar.injections&&le(Object.values(n.selfGrammar.injections),{...n,repository:n.selfGrammar.repository},e)}function le(n,e,t){for(const r of n){if(t.visitedRule.has(r))continue;t.visitedRule.add(r);const s=r.repository?st({},e.repository,r.repository):e.repository;Array.isArray(r.patterns)&&le(r.patterns,{...e,repository:s},t);const i=r.include;if(!i)continue;const o=ft(i);switch(o.kind){case 0:oe({...e,selfGrammar:e.baseGrammar},t);break;case 1:oe(e,t);break;case 2:Ie(o.ruleName,{...e,repository:s},t);break;case 3:case 4:const c=o.scopeName===e.selfGrammar.scopeName?e.selfGrammar:o.scopeName===e.baseGrammar.scopeName?e.baseGrammar:void 0;if(c){const a={baseGrammar:e.baseGrammar,selfGrammar:c,repository:s};o.kind===4?Ie(o.ruleName,a,t):oe(a,t)}else o.kind===4?t.add(new Zt(o.scopeName,o.ruleName)):t.add(new U(o.scopeName));break}}}var sn=class{constructor(){h(this,"kind",0)}},rn=class{constructor(){h(this,"kind",1)}},on=class{constructor(n){h(this,"ruleName");h(this,"kind",2);this.ruleName=n}},an=class{constructor(n){h(this,"scopeName");h(this,"kind",3);this.scopeName=n}},cn=class{constructor(n,e){h(this,"scopeName");h(this,"ruleName");h(this,"kind",4);this.scopeName=n,this.ruleName=e}};function ft(n){if(n==="$base")return new sn;if(n==="$self")return new rn;const e=n.indexOf("#");if(e===-1)return new an(n);if(e===0)return new on(n.substring(1));{const t=n.substring(0,e),r=n.substring(e+1);return new cn(t,r)}}var ln=/\\(\d+)/,ze=/\\(\d+)/g,hn=-1,dt=-2;var Z=class{constructor(n,e,t,r){h(this,"$location");h(this,"id");h(this,"_nameIsCapturing");h(this,"_name");h(this,"_contentNameIsCapturing");h(this,"_contentName");this.$location=n,this.id=e,this._name=t||null,this._nameIsCapturing=re.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=re.hasCaptures(this._contentName)}get debugName(){const n=this.$location?`${rt(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${n}`}getName(n,e){return!this._nameIsCapturing||this._name===null||n===null||e===null?this._name:re.replaceCaptures(this._name,n,e)}getContentName(n,e){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:re.replaceCaptures(this._contentName,n,e)}},un=class extends Z{constructor(e,t,r,s,i){super(e,t,r,s);h(this,"retokenizeCapturedWithRuleId");this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(e,t){throw new Error("Not supported!")}compile(e,t){throw new Error("Not supported!")}compileAG(e,t,r,s){throw new Error("Not supported!")}},fn=class extends Z{constructor(e,t,r,s,i){super(e,t,r,null);h(this,"_match");h(this,"captures");h(this,"_cachedCompiledPatterns");this._match=new K(s,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,r,s){return this._getCachedCompiledPatterns(e).compileAG(e,r,s)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new V,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},qe=class extends Z{constructor(e,t,r,s,i){super(e,t,r,s);h(this,"hasMissingPatterns");h(this,"patterns");h(this,"_cachedCompiledPatterns");this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(e,t){for(const r of this.patterns)e.getRule(r).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,r,s){return this._getCachedCompiledPatterns(e).compileAG(e,r,s)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new V,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},ve=class extends Z{constructor(e,t,r,s,i,o,c,a,l,d){super(e,t,r,s);h(this,"_begin");h(this,"beginCaptures");h(this,"_end");h(this,"endHasBackReferences");h(this,"endCaptures");h(this,"applyEndPatternLast");h(this,"hasMissingPatterns");h(this,"patterns");h(this,"_cachedCompiledPatterns");this._begin=new K(i,this.id),this.beginCaptures=o,this._end=new K(c||"",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=a,this.applyEndPatternLast=l||!1,this.patterns=d.patterns,this.hasMissingPatterns=d.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,r,s){return this._getCachedCompiledPatterns(e,t).compileAG(e,r,s)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new V;for(const r of this.patterns)e.getRule(r).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},he=class extends Z{constructor(e,t,r,s,i,o,c,a,l){super(e,t,r,s);h(this,"_begin");h(this,"beginCaptures");h(this,"whileCaptures");h(this,"_while");h(this,"whileHasBackReferences");h(this,"hasMissingPatterns");h(this,"patterns");h(this,"_cachedCompiledPatterns");h(this,"_cachedCompiledWhilePatterns");this._begin=new K(i,this.id),this.beginCaptures=o,this.whileCaptures=a,this._while=new K(c,dt),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,r,s){return this._getCachedCompiledPatterns(e).compileAG(e,r,s)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new V;for(const t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,r,s){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,r,s)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new V,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||""),this._cachedCompiledWhilePatterns}},gt=class T{static createCaptureRule(e,t,r,s,i){return e.registerRule(o=>new un(t,o,r,s,i))}static getCompiledRuleId(e,t,r){return e.id||t.registerRule(s=>{if(e.id=s,e.match)return new fn(e.$vscodeTextmateLocation,e.id,e.name,e.match,T._compileCaptures(e.captures,t,r));if(typeof e.begin>"u"){e.repository&&(r=st({},r,e.repository));let i=e.patterns;return typeof i>"u"&&e.include&&(i=[{include:e.include}]),new qe(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,T._compilePatterns(i,t,r))}return e.while?new he(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,T._compileCaptures(e.beginCaptures||e.captures,t,r),e.while,T._compileCaptures(e.whileCaptures||e.captures,t,r),T._compilePatterns(e.patterns,t,r)):new ve(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,T._compileCaptures(e.beginCaptures||e.captures,t,r),e.end,T._compileCaptures(e.endCaptures||e.captures,t,r),e.applyEndPatternLast,T._compilePatterns(e.patterns,t,r))}),e.id}static _compileCaptures(e,t,r){let s=[];if(e){let i=0;for(const o in e){if(o==="$vscodeTextmateLocation")continue;const c=parseInt(o,10);c>i&&(i=c)}for(let o=0;o<=i;o++)s[o]=null;for(const o in e){if(o==="$vscodeTextmateLocation")continue;const c=parseInt(o,10);let a=0;e[o].patterns&&(a=T.getCompiledRuleId(e[o],t,r)),s[c]=T.createCaptureRule(t,e[o].$vscodeTextmateLocation,e[o].name,e[o].contentName,a)}}return s}static _compilePatterns(e,t,r){let s=[];if(e)for(let i=0,o=e.length;i<o;i++){const c=e[i];let a=-1;if(c.include){const l=ft(c.include);switch(l.kind){case 0:case 1:a=T.getCompiledRuleId(r[c.include],t,r);break;case 2:let d=r[l.ruleName];d&&(a=T.getCompiledRuleId(d,t,r));break;case 3:case 4:const u=l.scopeName,f=l.kind===4?l.ruleName:null,g=t.getExternalGrammar(u,r);if(g)if(f){let p=g.repository[f];p&&(a=T.getCompiledRuleId(p,t,g.repository))}else a=T.getCompiledRuleId(g.repository.$self,t,g.repository);break}}else a=T.getCompiledRuleId(c,t,r);if(a!==-1){const l=t.getRule(a);let d=!1;if((l instanceof qe||l instanceof ve||l instanceof he)&&l.hasMissingPatterns&&l.patterns.length===0&&(d=!0),d)continue;s.push(a)}}return{patterns:s,hasMissingPatterns:(e?e.length:0)!==s.length}}},K=class pt{constructor(e,t){h(this,"source");h(this,"ruleId");h(this,"hasAnchor");h(this,"hasBackReferences");h(this,"_anchorCache");if(e&&typeof e=="string"){const r=e.length;let s=0,i=[],o=!1;for(let c=0;c<r;c++)if(e.charAt(c)==="\\"&&c+1<r){const l=e.charAt(c+1);l==="z"?(i.push(e.substring(s,c)),i.push("$(?!\\n)(?<!\\n)"),s=c+2):(l==="A"||l==="G")&&(o=!0),c++}this.hasAnchor=o,s===0?this.source=e:(i.push(e.substring(s,r)),this.source=i.join(""))}else this.hasAnchor=!1,this.source=e;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=t,typeof this.source=="string"?this.hasBackReferences=ln.test(this.source):this.hasBackReferences=!1}clone(){return new pt(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,t){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let r=t.map(s=>e.substring(s.start,s.end));return ze.lastIndex=0,this.source.replace(ze,(s,i)=>at(r[parseInt(i,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let e=[],t=[],r=[],s=[],i,o,c,a;for(i=0,o=this.source.length;i<o;i++)c=this.source.charAt(i),e[i]=c,t[i]=c,r[i]=c,s[i]=c,c==="\\"&&i+1<o&&(a=this.source.charAt(i+1),a==="A"?(e[i+1]="",t[i+1]="",r[i+1]="A",s[i+1]="A"):a==="G"?(e[i+1]="",t[i+1]="G",r[i+1]="",s[i+1]="G"):(e[i+1]=a,t[i+1]=a,r[i+1]=a,s[i+1]=a),i++);return{A0_G0:e.join(""),A0_G1:t.join(""),A1_G0:r.join(""),A1_G1:s.join("")}}resolveAnchors(e,t){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:e?t?this._anchorCache.A1_G1:this._anchorCache.A1_G0:t?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},V=class{constructor(){h(this,"_items");h(this,"_hasAnchors");h(this,"_cached");h(this,"_anchorCache");this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached.dispose(),this._cached=null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(n){this._items.push(n),this._hasAnchors=this._hasAnchors||n.hasAnchor}unshift(n){this._items.unshift(n),this._hasAnchors=this._hasAnchors||n.hasAnchor}length(){return this._items.length}setSource(n,e){this._items[n].source!==e&&(this._disposeCaches(),this._items[n].setSource(e))}compile(n){if(!this._cached){let e=this._items.map(t=>t.source);this._cached=new Ue(n,e,this._items.map(t=>t.ruleId))}return this._cached}compileAG(n,e,t){return this._hasAnchors?e?t?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(n,e,t)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(n,e,t)),this._anchorCache.A1_G0):t?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(n,e,t)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(n,e,t)),this._anchorCache.A0_G0):this.compile(n)}_resolveAnchors(n,e,t){let r=this._items.map(s=>s.resolveAnchors(e,t));return new Ue(n,r,this._items.map(s=>s.ruleId))}},Ue=class{constructor(n,e,t){h(this,"regExps");h(this,"rules");h(this,"scanner");this.regExps=e,this.rules=t,this.scanner=n.createOnigScanner(e)}dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const n=[];for(let e=0,t=this.rules.length;e<t;e++)n.push(" - "+this.rules[e]+": "+this.regExps[e]);return n.join(`
|
|
2
2
|
`)}findNextMatchSync(n,e,t){const r=this.scanner.findNextMatchSync(n,e,t);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},Ce=class{constructor(n,e){h(this,"languageId");h(this,"tokenType");this.languageId=n,this.tokenType=e}},x,dn=(x=class{constructor(e,t){h(this,"_defaultAttributes");h(this,"_embeddedLanguagesMatcher");h(this,"_getBasicScopeAttributes",new ct(e=>{const t=this._scopeToLanguage(e),r=this._toStandardTokenType(e);return new Ce(t,r)}));this._defaultAttributes=new Ce(e,8),this._embeddedLanguagesMatcher=new gn(Object.entries(t||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(e){return e===null?x._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(e)}_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(e){const t=e.match(x.STANDARD_TOKEN_TYPE_REGEXP);if(!t)return 8;switch(t[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!")}},h(x,"_NULL_SCOPE_METADATA",new Ce(0,0)),h(x,"STANDARD_TOKEN_TYPE_REGEXP",/\b(comment|string|regex|meta\.embedded)\b/),x),gn=class{constructor(n){h(this,"values");h(this,"scopesRegExp");if(n.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(n);const e=n.map(([t,r])=>at(t));e.sort(),e.reverse(),this.scopesRegExp=new RegExp(`^((${e.join(")|(")}))($|\\.)`,"")}}match(n){if(!this.scopesRegExp)return;const e=n.match(this.scopesRegExp);if(e)return this.values.get(e[1])}},Ke=class{constructor(n,e){h(this,"stack");h(this,"stoppedEarly");this.stack=n,this.stoppedEarly=e}};function mt(n,e,t,r,s,i,o,c){const a=e.content.length;let l=!1,d=-1;if(o){const g=pn(n,e,t,r,s,i);s=g.stack,r=g.linePos,t=g.isFirstLine,d=g.anchorPosition}const u=Date.now();for(;!l;){if(c!==0&&Date.now()-u>c)return new Ke(s,!0);f()}return new Ke(s,!1);function f(){const g=mn(n,e,t,r,s,d);if(!g){i.produce(s,a),l=!0;return}const p=g.captureIndices,b=g.matchedRuleId,S=p&&p.length>0?p[0].end>r:!1;if(b===hn){const _=s.getRule(n);i.produce(s,p[0].start),s=s.withContentNameScopesList(s.nameScopesList),z(n,e,t,s,i,_.endCaptures,p),i.produce(s,p[0].end);const m=s;if(s=s.parent,d=m.getAnchorPos(),!S&&m.getEnterPos()===r){s=m,i.produce(s,a),l=!0;return}}else{const _=n.getRule(b);i.produce(s,p[0].start);const m=s,y=_.getName(e.content,p),w=s.contentNameScopesList.pushAttributed(y,n);if(s=s.push(b,r,d,p[0].end===a,null,w,w),_ instanceof ve){const C=_;z(n,e,t,s,i,C.beginCaptures,p),i.produce(s,p[0].end),d=p[0].end;const k=C.getContentName(e.content,p),v=w.pushAttributed(k,n);if(s=s.withContentNameScopesList(v),C.endHasBackReferences&&(s=s.withEndRule(C.getEndWithResolvedBackReferences(e.content,p))),!S&&m.hasSameRuleAs(s)){s=s.pop(),i.produce(s,a),l=!0;return}}else if(_ instanceof he){const C=_;z(n,e,t,s,i,C.beginCaptures,p),i.produce(s,p[0].end),d=p[0].end;const k=C.getContentName(e.content,p),v=w.pushAttributed(k,n);if(s=s.withContentNameScopesList(v),C.whileHasBackReferences&&(s=s.withEndRule(C.getWhileWithResolvedBackReferences(e.content,p))),!S&&m.hasSameRuleAs(s)){s=s.pop(),i.produce(s,a),l=!0;return}}else if(z(n,e,t,s,i,_.captures,p),i.produce(s,p[0].end),s=s.pop(),!S){s=s.safePop(),i.produce(s,a),l=!0;return}}p[0].end>r&&(r=p[0].end,t=!1)}}function pn(n,e,t,r,s,i){let o=s.beginRuleCapturedEOL?0:-1;const c=[];for(let a=s;a;a=a.pop()){const l=a.getRule(n);l instanceof he&&c.push({rule:l,stack:a})}for(let a=c.pop();a;a=c.pop()){const{ruleScanner:l,findOptions:d}=Sn(a.rule,n,a.stack.endRule,t,r===o),u=l.findNextMatchSync(e,r,d);if(u){if(u.ruleId!==dt){s=a.stack.pop();break}u.captureIndices&&u.captureIndices.length&&(i.produce(a.stack,u.captureIndices[0].start),z(n,e,t,a.stack,i,a.rule.whileCaptures,u.captureIndices),i.produce(a.stack,u.captureIndices[0].end),o=u.captureIndices[0].end,u.captureIndices[0].end>r&&(r=u.captureIndices[0].end,t=!1))}else{s=a.stack.pop();break}}return{stack:s,linePos:r,anchorPosition:o,isFirstLine:t}}function mn(n,e,t,r,s,i){const o=_n(n,e,t,r,s,i),c=n.getInjections();if(c.length===0)return o;const a=yn(c,n,e,t,r,s,i);if(!a)return o;if(!o)return a;const l=o.captureIndices[0].start,d=a.captureIndices[0].start;return d<l||a.priorityMatch&&d===l?a:o}function _n(n,e,t,r,s,i){const o=s.getRule(n),{ruleScanner:c,findOptions:a}=_t(o,n,s.endRule,t,r===i),l=c.findNextMatchSync(e,r,a);return l?{captureIndices:l.captureIndices,matchedRuleId:l.ruleId}:null}function yn(n,e,t,r,s,i,o){let c=Number.MAX_VALUE,a=null,l,d=0;const u=i.contentNameScopesList.getScopeNames();for(let f=0,g=n.length;f<g;f++){const p=n[f];if(!p.matcher(u))continue;const b=e.getRule(p.ruleId),{ruleScanner:S,findOptions:_}=_t(b,e,null,r,s===o),m=S.findNextMatchSync(t,s,_);if(!m)continue;const y=m.captureIndices[0].start;if(!(y>=c)&&(c=y,a=m.captureIndices,l=m.ruleId,d=p.priority,c===s))break}return a?{priorityMatch:d===-1,captureIndices:a,matchedRuleId:l}:null}function _t(n,e,t,r,s){return{ruleScanner:n.compileAG(e,t,r,s),findOptions:0}}function Sn(n,e,t,r,s){return{ruleScanner:n.compileWhileAG(e,t,r,s),findOptions:0}}function z(n,e,t,r,s,i,o){if(i.length===0)return;const c=e.content,a=Math.min(i.length,o.length),l=[],d=o[0].end;for(let u=0;u<a;u++){const f=i[u];if(f===null)continue;const g=o[u];if(g.length===0)continue;if(g.start>d)break;for(;l.length>0&&l[l.length-1].endPos<=g.start;)s.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop();if(l.length>0?s.produceFromScopes(l[l.length-1].scopes,g.start):s.produce(r,g.start),f.retokenizeCapturedWithRuleId){const b=f.getName(c,o),S=r.contentNameScopesList.pushAttributed(b,n),_=f.getContentName(c,o),m=S.pushAttributed(_,n),y=r.push(f.retokenizeCapturedWithRuleId,g.start,-1,!1,null,S,m),w=n.createOnigString(c.substring(0,g.end));mt(n,w,t&&g.start===0,g.start,y,s,!1,0),ut(w);continue}const p=f.getName(c,o);if(p!==null){const S=(l.length>0?l[l.length-1].scopes:r.contentNameScopesList).pushAttributed(p,n);l.push(new bn(S,g.end))}}for(;l.length>0;)s.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop()}var bn=class{constructor(n,e){h(this,"scopes");h(this,"endPos");this.scopes=n,this.endPos=e}};function wn(n,e,t,r,s,i,o,c){return new kn(n,e,t,r,s,i,o,c)}function Ve(n,e,t,r,s){const i=ce(e,ue),o=gt.getCompiledRuleId(t,r,s.repository);for(const c of i)n.push({debugSelector:e,matcher:c.matcher,ruleId:o,grammar:s,priority:c.priority})}function ue(n,e){if(e.length<n.length)return!1;let t=0;return n.every(r=>{for(let s=t;s<e.length;s++)if(Cn(e[s],r))return t=s+1,!0;return!1})}function Cn(n,e){if(!n)return!1;if(n===e)return!0;const t=e.length;return n.length>t&&n.substr(0,t)===e&&n[t]==="."}var kn=class{constructor(n,e,t,r,s,i,o,c){h(this,"_rootScopeName");h(this,"balancedBracketSelectors");h(this,"_onigLib");h(this,"_rootId");h(this,"_lastRuleId");h(this,"_ruleId2desc");h(this,"_includedGrammars");h(this,"_grammarRepository");h(this,"_grammar");h(this,"_injections");h(this,"_basicScopeAttributesProvider");h(this,"_tokenTypeMatchers");if(this._rootScopeName=n,this.balancedBracketSelectors=i,this._onigLib=c,this._basicScopeAttributesProvider=new dn(t,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=Ye(e,null),this._injections=null,this._tokenTypeMatchers=[],s)for(const a of Object.keys(s)){const l=ce(a,ue);for(const d of l)this._tokenTypeMatchers.push({matcher:d.matcher,type:s[a]})}}get themeProvider(){return this._grammarRepository}dispose(){for(const n of this._ruleId2desc)n&&n.dispose()}createOnigScanner(n){return this._onigLib.createOnigScanner(n)}createOnigString(n){return this._onigLib.createOnigString(n)}getMetadataForScope(n){return this._basicScopeAttributesProvider.getBasicScopeAttributes(n)}_collectInjections(){const n={lookup:s=>s===this._rootScopeName?this._grammar:this.getExternalGrammar(s),injections:s=>this._grammarRepository.injections(s)},e=[],t=this._rootScopeName,r=n.lookup(t);if(r){const s=r.injections;if(s)for(let o in s)Ve(e,o,s[o],this,r);const i=this._grammarRepository.injections(t);i&&i.forEach(o=>{const c=this.getExternalGrammar(o);if(c){const a=c.injectionSelector;a&&Ve(e,a,c,this,c)}})}return e.sort((s,i)=>s.priority-i.priority),e}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(n){const e=++this._lastRuleId,t=n(e);return this._ruleId2desc[e]=t,t}getRule(n){return this._ruleId2desc[n]}getExternalGrammar(n,e){if(this._includedGrammars[n])return this._includedGrammars[n];if(this._grammarRepository){const t=this._grammarRepository.lookup(n);if(t)return this._includedGrammars[n]=Ye(t,e&&e.$base),this._includedGrammars[n]}}tokenizeLine(n,e,t=0){const r=this._tokenize(n,e,!1,t);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(n,e,t=0){const r=this._tokenize(n,e,!0,t);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(n,e,t,r){this._rootId===-1&&(this._rootId=gt.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let s;if(!e||e===Ae.NULL){s=!0;const l=this._basicScopeAttributesProvider.getDefaultAttributes(),d=this.themeProvider.getDefaults(),u=O.set(0,l.languageId,l.tokenType,null,d.fontStyle,d.foregroundId,d.backgroundId),f=this.getRule(this._rootId).getName(null,null);let g;f?g=q.createRootAndLookUpScopeName(f,u,this):g=q.createRoot("unknown",u),e=new Ae(null,this._rootId,-1,-1,!1,null,g,g)}else s=!1,e.reset();n=n+`
|
|
3
3
|
`;const i=this.createOnigString(n),o=i.content.length,c=new Tn(t,n,this._tokenTypeMatchers,this.balancedBracketSelectors),a=mt(this,i,s,0,e,c,!0,r);return ut(i),{lineLength:o,lineTokens:c,ruleStack:a.stack,stoppedEarly:a.stoppedEarly}}};function Ye(n,e){return n=Ft(n),n.repository=n.repository||{},n.repository.$self={$vscodeTextmateLocation:n.$vscodeTextmateLocation,patterns:n.patterns,name:n.scopeName},n.repository.$base=e||n.repository.$self,n}var q=class E{constructor(e,t,r){h(this,"parent");h(this,"scopePath");h(this,"tokenAttributes");this.parent=e,this.scopePath=t,this.tokenAttributes=r}static fromExtension(e,t){let r=e,s=(e==null?void 0:e.scopePath)??null;for(const i of t)s=we.push(s,i.scopeNames),r=new E(r,s,i.encodedTokenAttributes);return r}static createRoot(e,t){return new E(null,new we(null,e),t)}static createRootAndLookUpScopeName(e,t,r){const s=r.getMetadataForScope(e),i=new we(null,e),o=r.themeProvider.themeMatch(i),c=E.mergeAttributes(t,s,o);return new E(null,i,c)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(e){return E.equals(this,e)}static equals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.scopeName!==t.scopeName||e.tokenAttributes!==t.tokenAttributes)return!1;e=e.parent,t=t.parent}while(!0)}static mergeAttributes(e,t,r){let s=-1,i=0,o=0;return r!==null&&(s=r.fontStyle,i=r.foregroundId,o=r.backgroundId),O.set(e,t.languageId,t.tokenType,null,s,i,o)}pushAttributed(e,t){if(e===null)return this;if(e.indexOf(" ")===-1)return E._pushAttributed(this,e,t);const r=e.split(/ /g);let s=this;for(const i of r)s=E._pushAttributed(s,i,t);return s}static _pushAttributed(e,t,r){const s=r.getMetadataForScope(t),i=e.scopePath.push(t),o=r.themeProvider.themeMatch(i),c=E.mergeAttributes(e.tokenAttributes,s,o);return new E(e,i,c)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){var s;const t=[];let r=this;for(;r&&r!==e;)t.push({encodedTokenAttributes:r.tokenAttributes,scopeNames:r.scopePath.getExtensionIfDefined(((s=r.parent)==null?void 0:s.scopePath)??null)}),r=r.parent;return r===e?t.reverse():void 0}},L,Ae=(L=class{constructor(e,t,r,s,i,o,c,a){h(this,"parent");h(this,"ruleId");h(this,"beginRuleCapturedEOL");h(this,"endRule");h(this,"nameScopesList");h(this,"contentNameScopesList");h(this,"_stackElementBrand");h(this,"_enterPos");h(this,"_anchorPos");h(this,"depth");this.parent=e,this.ruleId=t,this.beginRuleCapturedEOL=i,this.endRule=o,this.nameScopesList=c,this.contentNameScopesList=a,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=r,this._anchorPos=s}equals(e){return e===null?!1:L._equals(this,e)}static _equals(e,t){return e===t?!0:this._structuralEquals(e,t)?q.equals(e.contentNameScopesList,t.contentNameScopesList):!1}static _structuralEquals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.depth!==t.depth||e.ruleId!==t.ruleId||e.endRule!==t.endRule)return!1;e=e.parent,t=t.parent}while(!0)}clone(){return this}static _reset(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){L._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(e,t,r,s,i,o,c){return new L(this,e,t,r,s,i,o,c)}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,t){var r,s;return this.parent&&(t=this.parent._writeString(e,t)),e[t++]=`(${this.ruleId}, ${(r=this.nameScopesList)==null?void 0:r.toString()}, ${(s=this.contentNameScopesList)==null?void 0:s.toString()})`,t}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 L(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,e,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let t=this;for(;t&&t._enterPos===e._enterPos;){if(t.ruleId===e.ruleId)return!0;t=t.parent}return!1}toStateStackFrame(){var e,t,r;return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:((t=this.nameScopesList)==null?void 0:t.getExtensionIfDefined(((e=this.parent)==null?void 0:e.nameScopesList)??null))??[],contentNameScopesList:((r=this.contentNameScopesList)==null?void 0:r.getExtensionIfDefined(this.nameScopesList))??[]}}static pushFrame(e,t){const r=q.fromExtension((e==null?void 0:e.nameScopesList)??null,t.nameScopesList);return new L(e,t.ruleId,t.enterPos??-1,t.anchorPos??-1,t.beginRuleCapturedEOL,t.endRule,r,q.fromExtension(r,t.contentNameScopesList))}},h(L,"NULL",new L(null,0,0,0,!1,null,null,null)),L),Rn=class{constructor(n,e){h(this,"balancedBracketScopes");h(this,"unbalancedBracketScopes");h(this,"allowAny",!1);this.balancedBracketScopes=n.flatMap(t=>t==="*"?(this.allowAny=!0,[]):ce(t,ue).map(r=>r.matcher)),this.unbalancedBracketScopes=e.flatMap(t=>ce(t,ue).map(r=>r.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(n){for(const e of this.unbalancedBracketScopes)if(e(n))return!1;for(const e of this.balancedBracketScopes)if(e(n))return!0;return this.allowAny}},Tn=class{constructor(n,e,t,r){h(this,"balancedBracketSelectors");h(this,"_emitBinaryTokens");h(this,"_lineText");h(this,"_tokens");h(this,"_binaryTokens");h(this,"_lastTokenEndIndex");h(this,"_tokenTypeOverrides");this.balancedBracketSelectors=r,this._emitBinaryTokens=n,this._tokenTypeOverrides=t,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}produce(n,e){this.produceFromScopes(n.contentNameScopesList,e)}produceFromScopes(n,e){var r;if(this._lastTokenEndIndex>=e)return;if(this._emitBinaryTokens){let s=(n==null?void 0:n.tokenAttributes)??0,i=!1;if((r=this.balancedBracketSelectors)!=null&&r.matchesAlways&&(i=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const o=(n==null?void 0:n.getScopeNames())??[];for(const c of this._tokenTypeOverrides)c.matcher(o)&&(s=O.set(s,0,c.type,null,-1,0,0));this.balancedBracketSelectors&&(i=this.balancedBracketSelectors.match(o))}if(i&&(s=O.set(s,0,8,i,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===s){this._lastTokenEndIndex=e;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(s),this._lastTokenEndIndex=e;return}const t=(n==null?void 0:n.getScopeNames())??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:e,scopes:t}),this._lastTokenEndIndex=e}getResult(n,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(n,e),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(n,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(n,e),this._binaryTokens[this._binaryTokens.length-2]=0);const t=new Uint32Array(this._binaryTokens.length);for(let r=0,s=this._binaryTokens.length;r<s;r++)t[r]=this._binaryTokens[r];return t}},In=class{constructor(n,e){h(this,"_onigLib");h(this,"_grammars",new Map);h(this,"_rawGrammars",new Map);h(this,"_injectionGrammars",new Map);h(this,"_theme");this._onigLib=e,this._theme=n}dispose(){for(const n of this._grammars.values())n.dispose()}setTheme(n){this._theme=n}getColorMap(){return this._theme.getColorMap()}addGrammar(n,e){this._rawGrammars.set(n.scopeName,n),e&&this._injectionGrammars.set(n.scopeName,e)}lookup(n){return this._rawGrammars.get(n)}injections(n){return this._injectionGrammars.get(n)}getDefaults(){return this._theme.getDefaults()}themeMatch(n){return this._theme.match(n)}grammarForScopeName(n,e,t,r,s){if(!this._grammars.has(n)){let i=this._rawGrammars.get(n);if(!i)return null;this._grammars.set(n,wn(n,i,e,t,r,s,this,this._onigLib))}return this._grammars.get(n)}},vn=class{constructor(e){h(this,"_options");h(this,"_syncRegistry");h(this,"_ensureGrammarCache");this._options=e,this._syncRegistry=new In(ae.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,t){this._syncRegistry.setTheme(ae.createFromRawTheme(e,t))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(e,t,r){return this.loadGrammarWithConfiguration(e,t,{embeddedLanguages:r})}loadGrammarWithConfiguration(e,t,r){return this._loadGrammar(e,t,r.embeddedLanguages,r.tokenTypes,new Rn(r.balancedBracketSelectors||[],r.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,t,r,s,i){const o=new tn(this._syncRegistry,e);for(;o.Q.length>0;)o.Q.map(c=>this._loadSingleGrammar(c.scopeName)),o.processQueue();return this._grammarForScopeName(e,t,r,s,i)}_loadSingleGrammar(e){this._ensureGrammarCache.has(e)||(this._doLoadSingleGrammar(e),this._ensureGrammarCache.set(e,!0))}_doLoadSingleGrammar(e){const t=this._options.loadGrammar(e);if(t){const r=typeof this._options.getInjections=="function"?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(t,r)}}addGrammar(e,t=[],r=0,s=null){return this._syncRegistry.addGrammar(e,t),this._grammarForScopeName(e.scopeName,r,s)}_grammarForScopeName(e,t=0,r=null,s=null,i=null){return this._syncRegistry.grammarForScopeName(e,t,r,s,i)}},Ne=Ae.NULL;function Y(n,e){const t=typeof n=="string"?{}:{...n.colorReplacements},r=typeof n=="string"?n:n.name;for(const[s,i]of Object.entries((e==null?void 0:e.colorReplacements)||{}))typeof i=="string"?t[s]=i:s===r&&Object.assign(t,i);return t}function G(n,e){return n&&((e==null?void 0:e[n==null?void 0:n.toLowerCase()])||n)}function yt(n){return Array.isArray(n)?n:[n]}async function Ee(n){return Promise.resolve(typeof n=="function"?n():n).then(e=>e.default||e)}function ee(n){return!n||["plaintext","txt","text","plain"].includes(n)}function Pe(n){return n==="ansi"||ee(n)}function te(n){return n==="none"}function xe(n){return te(n)}const An=/(\r?\n)/g;function ne(n,e=!1){var i;if(n.length===0)return[["",0]];const t=n.split(An);let r=0;const s=[];for(let o=0;o<t.length;o+=2){const c=e?t[o]+(t[o+1]||""):t[o];s.push([c,r]),r+=t[o].length,r+=((i=t[o+1])==null?void 0:i.length)||0}return s}const Je={light:"#333333",dark:"#bbbbbb"},Qe={light:"#fffffe",dark:"#1e1e1e"},Xe="__shiki_resolved";function ge(n){var c,a,l,d,u;if(n!=null&&n[Xe])return n;const e={...n};e.tokenColors&&!e.settings&&(e.settings=e.tokenColors,delete e.tokenColors),e.type||(e.type="dark"),e.colorReplacements={...e.colorReplacements},e.settings||(e.settings=[]);let{bg:t,fg:r}=e;if(!t||!r){const f=e.settings?e.settings.find(g=>!g.name&&!g.scope):void 0;(c=f==null?void 0:f.settings)!=null&&c.foreground&&(r=f.settings.foreground),(a=f==null?void 0:f.settings)!=null&&a.background&&(t=f.settings.background),!r&&((l=e==null?void 0:e.colors)!=null&&l["editor.foreground"])&&(r=e.colors["editor.foreground"]),!t&&((d=e==null?void 0:e.colors)!=null&&d["editor.background"])&&(t=e.colors["editor.background"]),r||(r=e.type==="light"?Je.light:Je.dark),t||(t=e.type==="light"?Qe.light:Qe.dark),e.fg=r,e.bg=t}e.settings[0]&&e.settings[0].settings&&!e.settings[0].scope||e.settings.unshift({settings:{foreground:e.fg,background:e.bg}});let s=0;const i=new Map;function o(f){var p;if(i.has(f))return i.get(f);s+=1;const g=`#${s.toString(16).padStart(8,"0").toLowerCase()}`;return(p=e.colorReplacements)!=null&&p[`#${g}`]?o(f):(i.set(f,g),g)}e.settings=e.settings.map(f=>{var S,_;const g=((S=f.settings)==null?void 0:S.foreground)&&!f.settings.foreground.startsWith("#"),p=((_=f.settings)==null?void 0:_.background)&&!f.settings.background.startsWith("#");if(!g&&!p)return f;const b={...f,settings:{...f.settings}};if(g){const m=o(f.settings.foreground);e.colorReplacements[m]=f.settings.foreground,b.settings.foreground=m}if(p){const m=o(f.settings.background);e.colorReplacements[m]=f.settings.background,b.settings.background=m}return b});for(const f of Object.keys(e.colors||{}))if((f==="editor.foreground"||f==="editor.background"||f.startsWith("terminal.ansi"))&&!((u=e.colors[f])!=null&&u.startsWith("#"))){const g=o(e.colors[f]);e.colorReplacements[g]=e.colors[f],e.colors[f]=g}return Object.defineProperty(e,Xe,{enumerable:!1,writable:!1,value:!0}),e}async function St(n){return[...new Set((await Promise.all(n.filter(e=>!Pe(e)).map(async e=>await Ee(e).then(t=>Array.isArray(t)?t:[t])))).flat())]}async function bt(n){return(await Promise.all(n.map(async e=>xe(e)?null:ge(await Ee(e))))).filter(e=>!!e)}function wt(n,e){if(!e)return n;if(e[n]){const t=new Set([n]);for(;e[n];){if(n=e[n],t.has(n))throw new R(`Circular alias \`${[...t].join(" -> ")} -> ${n}\``);t.add(n)}}return n}var Nn=class extends vn{constructor(e,t,r,s={}){super(e);h(this,"_resolver");h(this,"_themes");h(this,"_langs");h(this,"_alias");h(this,"_resolvedThemes",new Map);h(this,"_resolvedGrammars",new Map);h(this,"_langMap",new Map);h(this,"_langGraph",new Map);h(this,"_textmateThemeCache",new WeakMap);h(this,"_loadedThemesCache",null);h(this,"_loadedLanguagesCache",null);this._resolver=e,this._themes=t,this._langs=r,this._alias=s,this._themes.map(i=>this.loadTheme(i)),this.loadLanguages(this._langs)}getTheme(e){return typeof e=="string"?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){const t=ge(e);return t.name&&(this._resolvedThemes.set(t.name,t),this._loadedThemesCache=null),t}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(e){let t=this._textmateThemeCache.get(e);t||(t=ae.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=wt(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){var i,o,c,a,l,d,u;if(this.getGrammar(e.name))return;const t=new Set([...this._langMap.values()].filter(f=>{var g;return(g=f.embeddedLangsLazy)==null?void 0:g.includes(e.name)}));this._resolver.addLanguage(e);const r={balancedBracketSelectors:e.balancedBracketSelectors||["*"],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);const s=this.loadGrammarWithConfiguration(e.scopeName,1,r);if(s.name=e.name,this._resolvedGrammars.set(e.name,s),e.aliases&&e.aliases.forEach(f=>{this._alias[f]=e.name}),this._loadedLanguagesCache=null,t.size)for(const f of t)(c=(o=(i=this._syncRegistry)==null?void 0:i._grammars)==null?void 0:o.get(f.scopeName))==null||c.dispose(),this._resolvedGrammars.delete(f.name),this._loadedLanguagesCache=null,(l=(a=this._syncRegistry)==null?void 0:a._injectionGrammars)==null||l.delete(f.scopeName),(u=(d=this._syncRegistry)==null?void 0:d._grammars)==null||u.delete(f.scopeName),this.loadLanguage(this._langMap.get(f.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(const s of e)this.resolveEmbeddedLanguages(s);const t=[...this._langGraph.entries()],r=t.filter(([s,i])=>!i);if(r.length){const s=t.filter(([i,o])=>{var c;return o?(c=o.embeddedLanguages||o.embeddedLangs)==null?void 0:c.some(a=>r.map(([l])=>l).includes(a)):!1}).filter(i=>!r.includes(i));throw new R(`Missing languages ${r.map(([i])=>`\`${i}\``).join(", ")}, required by ${s.map(([i])=>`\`${i}\``).join(", ")}`)}for(const[s,i]of t)this._resolver.addLanguage(i);for(const[s,i]of t)this.loadLanguage(i)}getLoadedLanguages(){return this._loadedLanguagesCache||(this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])]),this._loadedLanguagesCache}resolveEmbeddedLanguages(e){this._langMap.set(e.name,e),this._langGraph.set(e.name,e);const t=e.embeddedLanguages??e.embeddedLangs;if(t)for(const r of t)this._langGraph.set(r,this._langMap.get(r))}},Ln=class{constructor(n,e){h(this,"_langs",new Map);h(this,"_scopeToLang",new Map);h(this,"_injections",new Map);h(this,"_onigLib");this._onigLib={createOnigScanner:t=>n.createScanner(t),createOnigString:t=>n.createString(t)},e.forEach(t=>this.addLanguage(t))}get onigLib(){return this._onigLib}getLangRegistration(n){return this._langs.get(n)}loadGrammar(n){return this._scopeToLang.get(n)}addLanguage(n){this._langs.set(n.name,n),n.aliases&&n.aliases.forEach(e=>{this._langs.set(e,n)}),this._scopeToLang.set(n.scopeName,n),n.injectTo&&n.injectTo.forEach(e=>{this._injections.get(e)||this._injections.set(e,[]),this._injections.get(e).includes(n.scopeName)||this._injections.get(e).push(n.scopeName)})}getInjections(n){const e=n.split(".");let t=[];for(let r=1;r<=e.length;r++){const s=e.slice(0,r).join(".");t=[...t,...this._injections.get(s)||[]]}return t}};let H=0;function pe(n){H+=1,n.warnings!==!1&&H>=10&&H%10===0&&console.warn(`[Shiki] ${H} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let e=!1;if(!n.engine)throw new R("`engine` option is required for synchronous mode");const t=(n.langs||[]).flat(1),r=(n.themes||[]).flat(1).map(ge),s=new Nn(new Ln(n.engine,t),r,t,n.langAlias);let i;function o(m){return wt(m,n.langAlias)}function c(m){S();const y=s.getGrammar(typeof m=="string"?m:m.name);if(!y)throw new R(`Language \`${m}\` not found, you may need to load it first`);return y}function a(m){if(m==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};S();const y=s.getTheme(m);if(!y)throw new R(`Theme \`${m}\` not found, you may need to load it first`);return y}function l(m){S();const y=a(m);return i!==m&&(s.setTheme(y),i=m),{theme:y,colorMap:s.getColorMap()}}function d(){return S(),s.getLoadedThemes()}function u(){return S(),s.getLoadedLanguages()}function f(...m){S(),s.loadLanguages(m.flat(1))}async function g(...m){return f(await St(m))}function p(...m){S();for(const y of m.flat(1))s.loadTheme(y)}async function b(...m){return S(),p(await bt(m))}function S(){if(e)throw new R("Shiki instance has been disposed")}function _(){e||(e=!0,s.dispose(),H-=1)}return{setTheme:l,getTheme:a,getLanguage:c,getLoadedThemes:d,getLoadedLanguages:u,resolveLangAlias:o,loadLanguage:g,loadLanguageSync:f,loadTheme:b,loadThemeSync:p,dispose:_,[Symbol.dispose]:_}}const En=pe;async function Ge(n){n.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[e,t,r]=await Promise.all([bt(n.themes||[]),St(n.langs||[]),n.engine]);return pe({...n,themes:e,langs:t,engine:r})}const Pn=Ge,Ct=new WeakMap;function me(n,e){Ct.set(n,e)}function J(n){return Ct.get(n)}var _e=class kt{constructor(...e){h(this,"_stacks",{});h(this,"lang");if(e.length===2){const[t,r]=e;this.lang=r,this._stacks=t}else{const[t,r,s]=e;this.lang=r,this._stacks={[s]:t}}}get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(e,t){return new kt(Object.fromEntries(yt(t).map(r=>[r,Ne])),e)}getInternalStack(e=this.theme){return this._stacks[e]}getScopes(e=this.theme){return xn(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function xn(n){const e=[],t=new Set;function r(s){var o;if(t.has(s))return;t.add(s);const i=(o=s==null?void 0:s.nameScopesList)==null?void 0:o.scopeName;i&&e.push(i),s.parent&&r(s.parent)}return r(n),e}function Gn(n,e){if(!(n instanceof _e))throw new R("Invalid grammar state");return n.getInternalStack(e)}const Bn=/,/,$n=/ /;function Rt(n,e,t={}){const{theme:r=n.getLoadedThemes()[0]}=t;if(ee(n.resolveLangAlias(t.lang||"text"))||te(r))return ne(e).map(c=>[{content:c[0],offset:c[1]}]);const{theme:s,colorMap:i}=n.setTheme(r),o=n.getLanguage(t.lang||"text");if(t.grammarState){if(t.grammarState.lang!==o.name)throw new R(`Grammar state language "${t.grammarState.lang}" does not match highlight language "${o.name}"`);if(!t.grammarState.themes.includes(s.name))throw new R(`Grammar state themes "${t.grammarState.themes}" do not contain highlight theme "${s.name}"`)}return Tt(e,o,s,i,t)}function Be(...n){if(n.length===2)return J(n[1]);const[e,t,r={}]=n,{lang:s="text",theme:i=e.getLoadedThemes()[0]}=r;if(ee(s)||te(i))throw new R("Plain language does not have grammar state");if(s==="ansi")throw new R("ANSI language does not have grammar state");const{theme:o,colorMap:c}=e.setTheme(i),a=e.getLanguage(s);return new _e($e(t,a,o,c,r).stateStack,a.name,o.name)}function Tt(n,e,t,r,s){const i=$e(n,e,t,r,s),o=new _e(i.stateStack,e.name,t.name);return me(i.tokens,o),i.tokens}function $e(n,e,t,r,s){const i=Y(t,s),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:c=500,includeExplanation:a=!1}=s,l=ne(n);let d=s.grammarState?Gn(s.grammarState,t.name)??Ne:s.grammarContextCode!=null?$e(s.grammarContextCode,e,t,r,{...s,grammarState:void 0,grammarContextCode:void 0}).stateStack:Ne,u=[];const f=[];for(let g=0,p=l.length;g<p;g++){const[b,S]=l[g];if(b===""){u=[],f.push([]);continue}if(o>0&&b.length>=o){u=[],f.push([{content:b,offset:S,color:"",fontStyle:0}]);continue}let _,m,y;a&&a!=="tokenType"&&(_=e.tokenizeLine(b,d,c),m=_.tokens,y=0);const w=e.tokenizeLine2(b,d,c),C=w.tokens.length/2;for(let k=0;k<C;k++){const v=w.tokens[2*k],j=k+1<C?w.tokens[2*k+2]:b.length;if(v===j)continue;const A=w.tokens[2*k+1],B=G(r[O.getForeground(A)],i),se=O.getFontStyle(A),$={content:b.substring(v,j),offset:S+v,color:B,fontStyle:se};if(a==="tokenType")$.type=O.getTokenType(A);else if(a){const We=[];if(a!=="scopeName")for(const P of t.settings){let W;switch(typeof P.scope){case"string":W=P.scope.split(Bn).map(Se=>Se.trim());break;case"object":W=P.scope;break;default:continue}We.push({settings:P,selectors:W.map(Se=>Se.split($n))})}$.explanation=[];let Fe=0;for(;v+Fe<j;){const P=m[y],W=b.substring(P.startIndex,P.endIndex);Fe+=W.length,$.explanation.push({content:W,scopes:a==="scopeName"?Mn(P.scopes):On(We,P.scopes)}),y+=1}}u.push($)}f.push(u),u=[],d=w.ruleStack}return{tokens:f,stateStack:d}}function Mn(n){return n.map(e=>({scopeName:e}))}function On(n,e){const t=[];for(let r=0,s=e.length;r<s;r++){const i=e[r];t[r]={scopeName:i,themeMatches:Wn(n,i,e.slice(0,r))}}return t}function Ze(n,e){return n===e||e.substring(0,n.length)===n&&e[n.length]==="."}function jn(n,e,t){if(!Ze(n.at(-1),e))return!1;let r=n.length-2,s=t.length-1;for(;r>=0&&s>=0;)Ze(n[r],t[s])&&(r-=1),s-=1;return r===-1}function Wn(n,e,t){const r=[];for(const{selectors:s,settings:i}of n)for(const o of s)if(jn(o,e,t)){r.push(i);break}return r}function ye(n,e,t,r=Rt){const s=Object.entries(t.themes).filter(l=>l[1]).map(l=>({color:l[0],theme:l[1]})),i=s.map(l=>{const d=r(n,e,{...t,theme:l.theme});return{tokens:d,state:J(d),theme:typeof l.theme=="string"?l.theme:l.theme.name}}),o=Fn(...i.map(l=>l.tokens)),c=o[0].map((l,d)=>l.map((u,f)=>{const g={content:u.content,variants:{},offset:u.offset};return"includeExplanation"in t&&t.includeExplanation&&(g.explanation=u.explanation),o.forEach((p,b)=>{const{content:S,explanation:_,offset:m,...y}=p[d][f];g.variants[s[b].color]=y}),g})),a=i[0].state?new _e(Object.fromEntries(i.map(l=>{var d;return[l.theme,(d=l.state)==null?void 0:d.getInternalStack(l.theme)]})),i[0].state.lang):void 0;return a&&me(c,a),c}function Fn(...n){const e=n.map(()=>[]),t=n.length;for(let r=0;r<n[0].length;r++){const s=n.map(a=>a[r]),i=e.map(()=>[]);e.forEach((a,l)=>a.push(i[l]));const o=s.map(()=>0),c=s.map(a=>a[0]);for(;c.every(a=>a);){const a=Math.min(...c.map(l=>l.content.length));for(let l=0;l<t;l++){const d=c[l];d.content.length===a?(i[l].push(d),o[l]+=1,c[l]=s[l][o[l]]):(i[l].push({...d,content:d.content.slice(0,a)}),c[l]={...d,content:d.content.slice(a),offset:d.offset+a})}}}return e}const et=/\s+/g;function Me(n,e){var r;if(!e)return n;n.properties||(n.properties={}),(r=n.properties).class||(r.class=[]),typeof n.properties.class=="string"&&(n.properties.class=n.properties.class.split(et)),Array.isArray(n.properties.class)||(n.properties.class=[]);const t=Array.isArray(e)?e:e.split(et);for(const s of t)s&&!n.properties.class.includes(s)&&n.properties.class.push(s);return n}const Dn=/:?lang=["']([^"']+)["']/g,Hn=/(?:```|~~~)([\w-]+)/g,zn=/\\begin\{([\w-]+)\}/g,qn=/<script\s+(?:type|lang)=["']([^"']+)["']/gi,Un=/^\s*---\r?\n[\s\S]*?\r?\n---(?:\r?\n|\s*$)/;function It(n){const e=ne(n,!0).map(([s])=>s);function t(s){if(s===n.length)return{line:e.length-1,character:e.at(-1).length};let i=s,o=0;for(const c of e){if(i<c.length)break;i-=c.length,o++}return{line:o,character:i}}function r(s,i){let o=0;for(let c=0;c<s;c++)o+=e[c].length;return o+=i,o}return{lines:e,indexToPos:t,posToIndex:r}}function Kn(n,e,t){const r=new Set;for(const i of n.matchAll(Dn)){const o=i[1].toLowerCase().trim();o&&r.add(o)}for(const i of n.matchAll(Hn)){const o=i[1].toLowerCase().trim();o&&r.add(o)}for(const i of n.matchAll(zn)){const o=i[1].toLowerCase().trim();o&&r.add(o)}for(const i of n.matchAll(qn)){const o=i[1].toLowerCase().trim(),c=o.includes("/")?o.split("/").pop():o;c&&r.add(c)}if(Un.test(n)&&r.add("yaml"),!t)return[...r];const s=t.getBundledLanguages();return[...r].filter(i=>i&&s[i])}const Vn=["color","background-color"];function vt(n,e){let t=0;const r=[];for(const s of e)s>t&&r.push({...n,content:n.content.slice(t,s),offset:n.offset+t}),t=s;return t<n.content.length&&r.push({...n,content:n.content.slice(t),offset:n.offset+t}),r}function Yn(n,e){let t=0,r=n.length;for(;t<r;){const s=t+(r-t>>1);n[s]<=e?t=s+1:r=s}return t}function At(n,e){const t=[...e instanceof Set?e:new Set(e)].sort((r,s)=>r-s);return t.length?n.map(r=>r.flatMap(s=>{const i=s.offset+s.content.length,o=Yn(t,s.offset);let c=o;for(;c<t.length&&t[c]<i;)c++;if(o===c)return s;const a=t.slice(o,c);for(let l=0;l<a.length;l++)a[l]-=s.offset;return vt(s,a)})):n}function Nt(n,e,t,r,s="css-vars"){const i={content:n.content,explanation:n.explanation,offset:n.offset},o=e.map(d=>Q(n.variants[d])),c=new Set(o.flatMap(d=>Object.keys(d))),a={},l=(d,u)=>{const f=u==="color"?"":u==="background-color"?"-bg":`-${u}`;return t+e[d]+(u==="color"?"":f)};return o.forEach((d,u)=>{for(const f of c){const g=d[f]||"inherit";if(u===0&&r&&Vn.includes(f))if(r==="light-dark()"&&o.length>1){const p=e.findIndex(m=>m==="light"),b=e.findIndex(m=>m==="dark");if(p===-1||b===-1)throw new R('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const S=o[p][f]||"inherit",_=o[b][f]||"inherit";a[f]=`light-dark(${S}, ${_})`,s==="css-vars"&&(a[l(u,f)]=g)}else a[f]=g;else s==="css-vars"&&(a[l(u,f)]=g)}}),i.htmlStyle=a,i}function Q(n){const e={};if(n.color&&(e.color=n.color),n.bgColor&&(e["background-color"]=n.bgColor),n.fontStyle){n.fontStyle&I.Italic&&(e["font-style"]="italic"),n.fontStyle&I.Bold&&(e["font-weight"]="bold");const t=[];n.fontStyle&I.Underline&&t.push("underline"),n.fontStyle&I.Strikethrough&&t.push("line-through"),t.length&&(e["text-decoration"]=t.join(" "))}return e}function fe(n){return typeof n=="string"?n:Object.entries(n).map(([e,t])=>`${e}:${t}`).join(";")}function Lt(){const n=new WeakMap;function e(t){if(!n.has(t.meta)){let s=function(o){if(typeof o=="number"){if(o<0||o>t.source.length)throw new R(`Invalid decoration offset: ${o}. Code length: ${t.source.length}`);return{...r.indexToPos(o),offset:o}}else{const c=r.lines[o.line];if(c===void 0)throw new R(`Invalid decoration position ${JSON.stringify(o)}. Lines length: ${r.lines.length}`);let a=o.character;if(a<0&&(a=c.length+a),a<0||a>c.length)throw new R(`Invalid decoration position ${JSON.stringify(o)}. Line ${o.line} length: ${c.length}`);return{...o,character:a,offset:r.posToIndex(o.line,a)}}};const r=It(t.source),i=(t.options.decorations||[]).map(o=>({...o,start:s(o.start),end:s(o.end)}));Jn(i),n.set(t.meta,{decorations:i,converter:r,source:t.source})}return n.get(t.meta)}return{name:"shiki:decorations",tokens(t){var r;if((r=this.options.decorations)!=null&&r.length)return At(t,e(this).decorations.flatMap(s=>[s.start.offset,s.end.offset]))},code(t){var d;if(!((d=this.options.decorations)!=null&&d.length))return;const r=e(this),s=[...t.children].filter(u=>u.type==="element"&&u.tagName==="span");if(s.length!==r.converter.lines.length)throw new R(`Number of lines in code element (${s.length}) does not match the number of lines in the source (${r.converter.lines.length}). Failed to apply decorations.`);function i(u,f,g,p){const b=s[u];let S="",_=-1,m=-1;if(f===0&&(_=0),g===0&&(m=0),g===Number.POSITIVE_INFINITY&&(m=b.children.length),_===-1||m===-1)for(let w=0;w<b.children.length;w++)S+=Et(b.children[w]),_===-1&&S.length===f&&(_=w+1),m===-1&&S.length===g&&(m=w+1);if(_===-1)throw new R(`Failed to find start index for decoration ${JSON.stringify(p.start)}`);if(m===-1)throw new R(`Failed to find end index for decoration ${JSON.stringify(p.end)}`);const y=b.children.slice(_,m);if(!p.alwaysWrap&&y.length===b.children.length)c(b,p,"line");else if(!p.alwaysWrap&&y.length===1&&y[0].type==="element")c(y[0],p,"token");else{const w={type:"element",tagName:"span",properties:{},children:y};c(w,p,"wrapper"),b.children.splice(_,y.length,w)}}function o(u,f){s[u]=c(s[u],f,"line")}function c(u,f,g){var S;const p=f.properties||{},b=f.transform||(_=>_);return u.tagName=f.tagName||"span",u.properties={...u.properties,...p,class:u.properties.class},(S=f.properties)!=null&&S.class&&Me(u,f.properties.class),u=b(u,g)||u,u}const a=[],l=r.decorations.sort((u,f)=>f.start.offset-u.start.offset||u.end.offset-f.end.offset);for(const u of l){const{start:f,end:g}=u;if(f.line===g.line)i(f.line,f.character,g.character,u);else if(f.line<g.line){i(f.line,f.character,Number.POSITIVE_INFINITY,u);for(let p=f.line+1;p<g.line;p++)a.unshift(()=>o(p,u));i(g.line,0,g.character,u)}}a.forEach(u=>u())}}}function Jn(n){for(let e=0;e<n.length;e++){const t=n[e];if(t.start.offset>t.end.offset)throw new R(`Invalid decoration range: ${JSON.stringify(t.start)} - ${JSON.stringify(t.end)}`);for(let r=e+1;r<n.length;r++){const s=n[r],i=t.start.offset<=s.start.offset&&s.start.offset<t.end.offset,o=t.start.offset<s.end.offset&&s.end.offset<=t.end.offset,c=s.start.offset<=t.start.offset&&t.start.offset<s.end.offset,a=s.start.offset<t.end.offset&&t.end.offset<=s.end.offset;if(i||o||c||a){if(i&&o||c&&a||c&&t.start.offset===t.end.offset||o&&s.start.offset===s.end.offset)continue;throw new R(`Decorations ${JSON.stringify(t.start)} and ${JSON.stringify(s.start)} intersect.`)}}}}function Et(n){return n.type==="text"?n.value:n.type==="element"?n.children.map(Et).join(""):""}const Qn=[Lt()];function de(n){const e=Xn(n.transformers||[]);return[...e.pre,...e.normal,...e.post,...Qn]}function Xn(n){const e=[],t=[],r=[];for(const s of n)switch(s.enforce){case"pre":e.push(s);break;case"post":t.push(s);break;default:r.push(s)}return{pre:e,post:t,normal:r}}var M=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],ke={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function Zn(n,e){const t=n.indexOf("\x1B",e);if(t!==-1&&n[t+1]==="["){const r=n.indexOf("m",t);if(r!==-1)return{sequence:n.substring(t+2,r).split(";"),startPosition:t,position:r+1}}return{position:n.length}}function tt(n){const e=n.shift();if(e==="2"){const t=n.splice(0,3).map(r=>Number.parseInt(r));return t.length!==3||t.some(r=>Number.isNaN(r))?void 0:{type:"rgb",rgb:t}}else if(e==="5"){const t=n.shift();if(t)return{type:"table",index:Number(t)}}}function es(n){const e=[];for(;n.length>0;){const t=n.shift();if(!t)continue;const r=Number.parseInt(t);if(!Number.isNaN(r))if(r===0)e.push({type:"resetAll"});else if(r<=9)ke[r]&&e.push({type:"setDecoration",value:ke[r]});else if(r<=29){const s=ke[r-20];s&&(e.push({type:"resetDecoration",value:s}),s==="dim"&&e.push({type:"resetDecoration",value:"bold"}))}else if(r<=37)e.push({type:"setForegroundColor",value:{type:"named",name:M[r-30]}});else if(r===38){const s=tt(n);s&&e.push({type:"setForegroundColor",value:s})}else if(r===39)e.push({type:"resetForegroundColor"});else if(r<=47)e.push({type:"setBackgroundColor",value:{type:"named",name:M[r-40]}});else if(r===48){const s=tt(n);s&&e.push({type:"setBackgroundColor",value:s})}else r===49?e.push({type:"resetBackgroundColor"}):r===53?e.push({type:"setDecoration",value:"overline"}):r===55?e.push({type:"resetDecoration",value:"overline"}):r>=90&&r<=97?e.push({type:"setForegroundColor",value:{type:"named",name:M[r-90+8]}}):r>=100&&r<=107&&e.push({type:"setBackgroundColor",value:{type:"named",name:M[r-100+8]}})}return e}function ts(){let n=null,e=null,t=new Set;return{parse(r){const s=[];let i=0;do{const o=Zn(r,i),c=o.sequence?r.substring(i,o.startPosition):r.substring(i);if(c.length>0&&s.push({value:c,foreground:n,background:e,decorations:new Set(t)}),o.sequence){const a=es(o.sequence);for(const l of a)l.type==="resetAll"?(n=null,e=null,t.clear()):l.type==="resetForegroundColor"?n=null:l.type==="resetBackgroundColor"?e=null:l.type==="resetDecoration"&&t.delete(l.value);for(const l of a)l.type==="setForegroundColor"?n=l.value:l.type==="setBackgroundColor"?e=l.value:l.type==="setDecoration"&&t.add(l.value)}i=o.position}while(i<r.length);return s}}}var ns={black:"#000000",red:"#bb0000",green:"#00bb00",yellow:"#bbbb00",blue:"#0000bb",magenta:"#ff00ff",cyan:"#00bbbb",white:"#eeeeee",brightBlack:"#555555",brightRed:"#ff5555",brightGreen:"#00ff00",brightYellow:"#ffff55",brightBlue:"#5555ff",brightMagenta:"#ff55ff",brightCyan:"#55ffff",brightWhite:"#ffffff"};function ss(n=ns){function e(c){return n[c]}function t(c){return`#${c.map(a=>Math.max(0,Math.min(a,255)).toString(16).padStart(2,"0")).join("")}`}let r;function s(){if(r)return r;r=[];for(let l=0;l<M.length;l++)r.push(e(M[l]));let c=[0,95,135,175,215,255];for(let l=0;l<6;l++)for(let d=0;d<6;d++)for(let u=0;u<6;u++)r.push(t([c[l],c[d],c[u]]));let a=8;for(let l=0;l<24;l++,a+=10)r.push(t([a,a,a]));return r}function i(c){return s()[c]}function o(c){switch(c.type){case"named":return e(c.name);case"rgb":return t(c.rgb);case"table":return i(c.index)}}return{value:o}}const rs=/#([0-9a-f]{3,8})/i,is=/var\((--[\w-]+-ansi-[\w-]+)\)/,os={black:"#000000",red:"#cd3131",green:"#0DBC79",yellow:"#E5E510",blue:"#2472C8",magenta:"#BC3FBC",cyan:"#11A8CD",white:"#E5E5E5",brightBlack:"#666666",brightRed:"#F14C4C",brightGreen:"#23D18B",brightYellow:"#F5F543",brightBlue:"#3B8EEA",brightMagenta:"#D670D6",brightCyan:"#29B8DB",brightWhite:"#FFFFFF"};function Pt(n,e,t){const r=Y(n,t),s=ne(e),i=ss(Object.fromEntries(M.map(c=>{var l;const a=`terminal.ansi${c[0].toUpperCase()}${c.substring(1)}`;return[c,((l=n.colors)==null?void 0:l[a])||os[c]]}))),o=ts();return s.map(c=>o.parse(c[0]).map(a=>{let l,d;a.decorations.has("reverse")?(l=a.background?i.value(a.background):n.bg,d=a.foreground?i.value(a.foreground):n.fg):(l=a.foreground?i.value(a.foreground):n.fg,d=a.background?i.value(a.background):void 0),l=G(l,r),d=G(d,r),a.decorations.has("dim")&&(l=as(l));let u=I.None;return a.decorations.has("bold")&&(u|=I.Bold),a.decorations.has("italic")&&(u|=I.Italic),a.decorations.has("underline")&&(u|=I.Underline),a.decorations.has("strikethrough")&&(u|=I.Strikethrough),{content:a.value,offset:c[1],color:l,bgColor:d,fontStyle:u}}))}function as(n){const e=n.match(rs);if(e){const r=e[1];if(r.length===8){const s=Math.round(Number.parseInt(r.slice(6,8),16)/2).toString(16).padStart(2,"0");return`#${r.slice(0,6)}${s}`}else{if(r.length===6)return`#${r}80`;if(r.length===4){const s=r[0],i=r[1],o=r[2],c=r[3];return`#${s}${s}${i}${i}${o}${o}${Math.round(Number.parseInt(`${c}${c}`,16)/2).toString(16).padStart(2,"0")}`}else if(r.length===3){const s=r[0],i=r[1],o=r[2];return`#${s}${s}${i}${i}${o}${o}80`}}}const t=n.match(is);return t?`var(${t[1]}-dim)`:n}function X(n,e,t={}){const r=n.resolveLangAlias(t.lang||"text"),{theme:s=n.getLoadedThemes()[0]}=t;if(!ee(r)&&!te(s)&&r==="ansi"){const{theme:i}=n.setTheme(s);return Pt(i,e,t)}return Rt(n,e,t)}function F(n,e,t){let r,s,i,o,c,a;if("themes"in t){const{defaultColor:l="light",cssVariablePrefix:d="--shiki-",colorsRendering:u="css-vars"}=t,f=Object.entries(t.themes).filter(_=>_[1]).map(_=>({color:_[0],theme:_[1]})).sort((_,m)=>_.color===l?-1:m.color===l?1:0);if(f.length===0)throw new R("`themes` option must not be empty");const g=ye(n,e,t,X);if(a=J(g),l&&l!=="light-dark()"&&!f.some(_=>_.color===l))throw new R(`\`themes\` option must contain the defaultColor key \`${l}\``);const p=f.map(_=>n.getTheme(_.theme)),b=f.map(_=>_.color);i=g.map(_=>_.map(m=>Nt(m,b,d,l,u))),a&&me(i,a);const S=f.map(_=>Y(_.theme,t));s=nt(f,p,S,d,l,"fg",u),r=nt(f,p,S,d,l,"bg",u),o=`shiki-themes ${p.map(_=>_.name).join(" ")}`,c=l?void 0:[s,r].join(";")}else if("theme"in t){const l=Y(t.theme,t);i=X(n,e,t);const d=n.getTheme(t.theme);r=G(d.bg,l),s=G(d.fg,l),o=d.name,a=J(i)}else throw new R("Invalid options, either `theme` or `themes` must be provided");return{tokens:i,fg:s,bg:r,themeName:o,rootStyle:c,grammarState:a}}function nt(n,e,t,r,s,i,o){return n.map((c,a)=>{const l=G(e[a][i],t[a])||"inherit",d=`${r+c.color}${i==="bg"?"-bg":""}:${l}`;if(a===0&&s){if(s==="light-dark()"&&n.length>1){const u=n.findIndex(g=>g.color==="light"),f=n.findIndex(g=>g.color==="dark");if(u===-1||f===-1)throw new R('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${G(e[u][i],t[u])||"inherit"}, ${G(e[f][i],t[f])||"inherit"});${d}`}return l}return o==="css-vars"?d:null}).filter(c=>!!c).join(";")}const xt=/^\s+$/,cs=/^(\s*)(.*?)(\s*)$/;function D(n,e,t,r={meta:{},options:t,codeToHast:(s,i)=>D(n,s,i),codeToTokens:(s,i)=>F(n,s,i)}){var p,b;let s=e;for(const S of de(t))s=((p=S.preprocess)==null?void 0:p.call(r,s,t))||s;let{tokens:i,fg:o,bg:c,themeName:a,rootStyle:l,grammarState:d}=F(n,s,t);const{mergeWhitespaces:u=!0,mergeSameStyleTokens:f=!1}=t;u===!0?i=ls(i):u==="never"&&(i=hs(i)),f&&(i=us(i));const g={...r,get source(){return s}};for(const S of de(t))i=((b=S.tokens)==null?void 0:b.call(g,i))||i;return Gt(i,{...t,fg:o,bg:c,themeName:a,rootStyle:t.rootStyle===!1?!1:t.rootStyle??l},g,d)}function Gt(n,e,t,r=J(n)){var b,S,_,m;const s=de(e),i=[],o={type:"root",children:[]},{structure:c="classic",tabindex:a="0"}=e,l={class:`shiki ${e.themeName||""}`};e.rootStyle!==!1&&(e.rootStyle!=null?l.style=e.rootStyle:l.style=`background-color:${e.bg};color:${e.fg}`),a!==!1&&a!=null&&(l.tabindex=a.toString());for(const[y,w]of Object.entries(e.meta||{}))y.startsWith("_")||(l[y]=w);let d={type:"element",tagName:"pre",properties:l,children:[],data:e.data},u={type:"element",tagName:"code",properties:{},children:i};const f=[],g={...t,structure:c,addClassToHast:Me,get source(){return t.source},get tokens(){return n},get options(){return e},get root(){return o},get pre(){return d},get code(){return u},get lines(){return f}};if(n.forEach((y,w)=>{var v,j;w&&(c==="inline"?o.children.push({type:"element",tagName:"br",properties:{},children:[]}):c==="classic"&&i.push({type:"text",value:`
|
|
4
4
|
`}));let C={type:"element",tagName:"span",properties:{class:"line"},children:[]},k=0;for(const A of y){let B={type:"element",tagName:"span",properties:{...A.htmlAttrs},children:[{type:"text",value:A.content}]};const se=fe(A.htmlStyle||Q(A));se&&(B.properties.style=se);for(const $ of s)B=((v=$==null?void 0:$.span)==null?void 0:v.call(g,B,w+1,k,C,A))||B;c==="inline"?o.children.push(B):c==="classic"&&C.children.push(B),k+=A.content.length}if(c==="classic"){for(const A of s)C=((j=A==null?void 0:A.line)==null?void 0:j.call(g,C,w+1))||C;f.push(C),i.push(C)}else c==="inline"&&f.push(C)}),c==="classic"){for(const y of s)u=((b=y==null?void 0:y.code)==null?void 0:b.call(g,u))||u;d.children.push(u);for(const y of s)d=((S=y==null?void 0:y.pre)==null?void 0:S.call(g,d))||d;o.children.push(d)}else if(c==="inline"){const y=[];let w={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(const k of o.children)k.type==="element"&&k.tagName==="br"?(y.push(w),w={type:"element",tagName:"span",properties:{class:"line"},children:[]}):(k.type==="element"||k.type==="text")&&w.children.push(k);y.push(w);let C={type:"element",tagName:"code",properties:{},children:y};for(const k of s)C=((_=k==null?void 0:k.code)==null?void 0:_.call(g,C))||C;o.children=[];for(let k=0;k<C.children.length;k++){k>0&&o.children.push({type:"element",tagName:"br",properties:{},children:[]});const v=C.children[k];v.type==="element"&&o.children.push(...v.children)}}let p=o;for(const y of s)p=((m=y==null?void 0:y.root)==null?void 0:m.call(g,p))||p;return r&&me(p,r),p}function ls(n){return n.map(e=>{const t=[];let r="",s;return e.forEach((i,o)=>{const c=!(i.fontStyle&&(i.fontStyle&I.Underline||i.fontStyle&I.Strikethrough));c&&xt.test(i.content)&&e[o+1]?(s===void 0&&(s=i.offset),r+=i.content):r?(c?t.push({...i,offset:s,content:r+i.content}):t.push({content:r,offset:s},i),s=void 0,r=""):t.push(i)}),t})}function hs(n){return n.map(e=>e.flatMap(t=>{if(xt.test(t.content))return t;const r=t.content.match(cs);if(!r)return t;const[,s,i,o]=r;if(!s&&!o)return t;const c=[{...t,offset:t.offset+s.length,content:i}];return s&&c.unshift({content:s,offset:t.offset}),o&&c.push({content:o,offset:t.offset+s.length+i.length}),c}))}function us(n){return n.map(e=>{const t=[];for(const r of e){if(t.length===0){t.push({...r});continue}const s=t.at(-1),i=fe(s.htmlStyle||Q(s)),o=fe(r.htmlStyle||Q(r)),c=s.fontStyle&&(s.fontStyle&I.Underline||s.fontStyle&I.Strikethrough),a=r.fontStyle&&(r.fontStyle&I.Underline||r.fontStyle&I.Strikethrough);!c&&!a&&i===o?s.content+=r.content:t.push({...r})}return t})}const Bt=Wt;function Oe(n,e,t){var i;const r={meta:{},options:t,codeToHast:(o,c)=>D(n,o,c),codeToTokens:(o,c)=>F(n,o,c)};let s=Bt(D(n,e,t,r));for(const o of de(t))s=((i=o.postprocess)==null?void 0:i.call(r,s,t))||s;return s}async function je(n){const e=await Ge(n);return{getLastGrammarState:(...t)=>Be(e,...t),codeToTokensBase:(t,r)=>X(e,t,r),codeToTokensWithThemes:(t,r)=>ye(e,t,r),codeToTokens:(t,r)=>F(e,t,r),codeToHast:(t,r)=>D(e,t,r),codeToHtml:(t,r)=>Oe(e,t,r),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...e,getInternalContext:()=>e}}function fs(n){const e=pe(n);return{getLastGrammarState:(...t)=>Be(e,...t),codeToTokensBase:(t,r)=>X(e,t,r),codeToTokensWithThemes:(t,r)=>ye(e,t,r),codeToTokens:(t,r)=>F(e,t,r),codeToHast:(t,r)=>D(e,t,r),codeToHtml:(t,r)=>Oe(e,t,r),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...e,getInternalContext:()=>e}}function $t(n){let e;async function t(r){if(e){const s=await e;return await Promise.all([s.loadTheme(...r.themes||[]),s.loadLanguage(...r.langs||[])]),s}else return e=n({...r,themes:r.themes||[],langs:r.langs||[]}),e}return t}const ds=$t(je);function gs(n){const e=n.langs,t=n.themes,r=n.engine;async function s(i){function o(u){var f;if(typeof u=="string"){if(u=((f=i.langAlias)==null?void 0:f[u])||u,Pe(u))return[];const g=e[u];if(!g)throw new R(`Language \`${u}\` is not included in this bundle. You may want to load it from external source.`);return g}return u}function c(u){if(xe(u))return"none";if(typeof u=="string"){const f=t[u];if(!f)throw new R(`Theme \`${u}\` is not included in this bundle. You may want to load it from external source.`);return f}return u}const a=(i.themes??[]).map(u=>c(u)),l=(i.langs??[]).map(u=>o(u)),d=await je({engine:i.engine??r(),...i,themes:a,langs:l});return{...d,loadLanguage(...u){return d.loadLanguage(...u.map(o))},loadTheme(...u){return d.loadTheme(...u.map(c))},getBundledLanguages(){return e},getBundledThemes(){return t}}}return s}function Mt(n){let e;async function t(r={}){if(e){const s=await e;return await Promise.all([s.loadTheme(...r.themes||[]),s.loadLanguage(...r.langs||[])]),s}else{e=n({...r,themes:[],langs:[]});const s=await e;return await Promise.all([s.loadTheme(...r.themes||[]),s.loadLanguage(...r.langs||[])]),s}}return t}function ps(n,e){const t=Mt(n);async function r(s,i){var a;const o=await t({langs:[i.lang],themes:"theme"in i?[i.theme]:Object.values(i.themes)}),c=await((a=e==null?void 0:e.guessEmbeddedLanguages)==null?void 0:a.call(e,s,i.lang,o));return c&&await o.loadLanguage(...c),o}return{getSingletonHighlighter(s){return t(s)},async codeToHtml(s,i){return(await r(s,i)).codeToHtml(s,i)},async codeToHast(s,i){return(await r(s,i)).codeToHast(s,i)},async codeToTokens(s,i){return(await r(s,i)).codeToTokens(s,i)},async codeToTokensBase(s,i){return(await r(s,i)).codeToTokensBase(s,i)},async codeToTokensWithThemes(s,i){return(await r(s,i)).codeToTokensWithThemes(s,i)},async getLastGrammarState(s,i){return(await t({langs:[i.lang],themes:[i.theme]})).getLastGrammarState(s,i)}}}function ms(n={}){var o;const{name:e="css-variables",variablePrefix:t="--shiki-",fontStyle:r=!0}=n,s=c=>{var a;return(a=n.variableDefaults)!=null&&a[c]?`var(${t}${c}, ${n.variableDefaults[c]})`:`var(${t}${c})`},i={name:e,type:"dark",colors:{"editor.foreground":s("foreground"),"editor.background":s("background"),"terminal.ansiBlack":s("ansi-black"),"terminal.ansiRed":s("ansi-red"),"terminal.ansiGreen":s("ansi-green"),"terminal.ansiYellow":s("ansi-yellow"),"terminal.ansiBlue":s("ansi-blue"),"terminal.ansiMagenta":s("ansi-magenta"),"terminal.ansiCyan":s("ansi-cyan"),"terminal.ansiWhite":s("ansi-white"),"terminal.ansiBrightBlack":s("ansi-bright-black"),"terminal.ansiBrightRed":s("ansi-bright-red"),"terminal.ansiBrightGreen":s("ansi-bright-green"),"terminal.ansiBrightYellow":s("ansi-bright-yellow"),"terminal.ansiBrightBlue":s("ansi-bright-blue"),"terminal.ansiBrightMagenta":s("ansi-bright-magenta"),"terminal.ansiBrightCyan":s("ansi-bright-cyan"),"terminal.ansiBrightWhite":s("ansi-bright-white")},tokenColors:[{scope:["keyword.operator.accessor","meta.group.braces.round.function.arguments","meta.template.expression","markup.fenced_code meta.embedded.block"],settings:{foreground:s("foreground")}},{scope:"emphasis",settings:{fontStyle:"italic"}},{scope:["strong","markup.heading.markdown","markup.bold.markdown"],settings:{fontStyle:"bold"}},{scope:["markup.italic.markdown"],settings:{fontStyle:"italic"}},{scope:"meta.link.inline.markdown",settings:{fontStyle:"underline",foreground:s("token-link")}},{scope:["string","markup.fenced_code","markup.inline"],settings:{foreground:s("token-string")}},{scope:["comment","string.quoted.docstring.multi"],settings:{foreground:s("token-comment")}},{scope:["constant.numeric","constant.language","constant.other.placeholder","constant.character.format.placeholder","variable.language.this","variable.other.object","variable.other.class","variable.other.constant","meta.property-name","meta.property-value","support"],settings:{foreground:s("token-constant")}},{scope:["keyword","storage.modifier","storage.type","storage.control.clojure","entity.name.function.clojure","entity.name.tag.yaml","support.function.node","support.type.property-name.json","punctuation.separator.key-value","punctuation.definition.template-expression"],settings:{foreground:s("token-keyword")}},{scope:"variable.parameter.function",settings:{foreground:s("token-parameter")}},{scope:["support.function","entity.name.type","entity.other.inherited-class","meta.function-call","meta.instance.constructor","entity.other.attribute-name","entity.name.function","constant.keyword.clojure"],settings:{foreground:s("token-function")}},{scope:["entity.name.tag","string.quoted","string.regexp","string.interpolated","string.template","string.unquoted.plain.out.yaml","keyword.other.template"],settings:{foreground:s("token-string-expression")}},{scope:["punctuation.definition.arguments","punctuation.definition.dict","punctuation.separator","meta.function-call.arguments"],settings:{foreground:s("token-punctuation")}},{scope:["markup.underline.link","punctuation.definition.metadata.markdown"],settings:{foreground:s("token-link")}},{scope:["beginning.punctuation.definition.list.markdown"],settings:{foreground:s("token-string")}},{scope:["punctuation.definition.string.begin.markdown","punctuation.definition.string.end.markdown","string.other.link.title.markdown","string.other.link.description.markdown"],settings:{foreground:s("token-keyword")}},{scope:["markup.inserted","meta.diff.header.to-file","punctuation.definition.inserted"],settings:{foreground:s("token-inserted")}},{scope:["markup.deleted","meta.diff.header.from-file","punctuation.definition.deleted"],settings:{foreground:s("token-deleted")}},{scope:["markup.changed","punctuation.definition.changed"],settings:{foreground:s("token-changed")}}]};return r||(i.tokenColors=(o=i.tokenColors)==null?void 0:o.map(c=>{var a;return(a=c.settings)!=null&&a.fontStyle&&delete c.settings.fontStyle,c})),i}const bs=Object.freeze(Object.defineProperty({__proto__:null,ShikiError:R,addClassToHast:Me,applyColorReplacements:G,codeToHast:D,codeToHtml:Oe,codeToTokens:F,codeToTokensBase:X,codeToTokensWithThemes:ye,createBundledHighlighter:gs,createCssVariablesTheme:ms,createHighlighterCore:je,createHighlighterCoreSync:fs,createPositionConverter:It,createShikiInternal:Pn,createShikiInternalSync:En,createShikiPrimitive:pe,createShikiPrimitiveAsync:Ge,createSingletonShorthands:ps,flatTokenVariants:Nt,getLastGrammarState:Be,getSingletonHighlighterCore:ds,getTokenStyleObject:Q,guessEmbeddedLanguages:Kn,hastToHtml:Bt,isNoneTheme:te,isPlainLang:ee,isSpecialLang:Pe,isSpecialTheme:xe,makeSingletonHighlighter:Mt,makeSingletonHighlighterCore:$t,normalizeGetter:Ee,normalizeTheme:ge,resolveColorReplacements:Y,splitLines:ne,splitToken:vt,splitTokens:At,stringifyTokenStyle:fe,toArray:yt,tokenizeAnsiWithTheme:Pt,tokenizeWithTheme:Tt,tokensToHast:Gt,transformerDecorations:Lt},Symbol.toStringTag,{value:"Module"}));export{O as E,Ne as I,ms as a,bs as b,je as c};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/highlights-themes-
|
|
2
|
-
var io=Object.defineProperty;var ro=(e,t,n)=>t in e?io(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var w=(e,t,n)=>ro(e,typeof t!="symbol"?t+"":t,n);import{_ as dt,r as G,j as X}from"./index-BafYMKiN.js";const qi="diffs-container";(()=>{try{return!1}catch{return!1}})();const oo=/(?=^From [a-f0-9]+ .+$)/m,Ki=/(?=^diff --git)/gm,so=new RegExp("(?<=\\n)"),ao=/^(---|\+\+\+)\s+([^\t\r\n]+)/,lo=/^index ([0-9a-f]+)\.\.([0-9a-f]+)(?: (\d+))?$/i,Yi="header-prefix",Xi="header-filename-suffix",Zi="header-metadata",Dn="header-custom",Le={dark:"pierre-dark",light:"pierre-light"},uo="data-theme-css",co="data-unsafe-css",ho="data-diffs-scrollbar-measure",Ji="--diffs-scrollbar-gutter-measured",fo=1e5,go={hunkLineCount:50,lineHeight:20,diffHeaderHeight:44,spacing:8},po=Object.freeze({fromStart:0,fromEnd:0}),Wn={startingLine:0,totalLines:1/0,bufferBefore:0,bufferAfter:0},Qi=Object.freeze([]),mo={startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:0};let Ie,an=0;var Mt=class extends Error{constructor(){super("Highlighter is disposed"),this.name="HighlighterDisposedError"}};function vo(){return Ie}function Tn(e){return e??Ie??"shiki-js"}function bo(e){if(Ie!=null&&Ie!==e)throw new Error(`Cannot load the "${e}" highlighter while "${Ie}" is in use. Only one highlighter type can be active at a time; dispose every "${Ie}" instance (disposeHighlighter() disposes the shared one) before switching.`)}function yo(e){bo(e),Ie=e,an++}function So(){an--,an===0&&(Ie=void 0)}const Ec=new Map,Rc=new Map,Ac=new Map,Co=new Set;function Hn(e=Le){const t=[];return typeof e=="string"?t.push(e):(t.push(e.dark),t.push(e.light)),t}function xo(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}function Mn(e){let t;return()=>t??(t=e().then(n=>(t=n,n),n=>{throw t=void 0,n}))}function ko(e){return e!==null&&typeof e=="object"&&"default"in e?e.default:e}var wo=class extends Error{constructor(e){super(`Theme "${e}" is already registered`),this.name="DuplicateThemeError"}},Bn=class extends Error{constructor(e){super(`No loader registered for theme "${e}"`),this.name="UnregisteredThemeError"}},Lo=class extends Error{constructor(e){super(`Theme "${e}" has not been resolved`),this.name="UnresolvedThemeError"}};function Eo(e={}){const t=new Map,n=new Map,i=new Map;let r=0;function o(m,v){if(t.has(m))throw new wo(m);t.set(m,v)}function s(m,v){return t.has(m)?!1:(t.set(m,v),!0)}function l(m){return t.has(m)}function a(m){const v=n.get(m);if(v!==void 0)return Promise.resolve(v);const C=i.get(m);if(C!==void 0)return C;const y=t.get(m);if(y===void 0&&e.fallbackLoader===void 0)return Promise.reject(new Bn(m));const x=r,L=Promise.resolve().then(()=>{var k;return y!==void 0?y():(k=e.fallbackLoader)==null?void 0:k.call(e,m)}).then(async k=>{if(k===void 0)throw new Bn(m);const R=ko(k),H=e.normalizeTheme===void 0?R:await e.normalizeTheme(R,m);return x===r&&n.set(m,H),i.get(m)===L&&i.delete(m),H}).catch(k=>{throw i.get(m)===L&&i.delete(m),k});return i.set(m,L),L}function u(m){return Promise.all(m.map(v=>a(v)))}function d(m,v){n.set(m,v)}function c(m){for(const[v,C]of m)d(v,C)}function f(m){return n.get(m)}function h(m){const v=[];for(const C of m){const y=n.get(C);if(y===void 0)throw new Lo(C);v.push(y)}return v}function g(m){return n.has(m)}function p(m){for(const v of m)if(!n.has(v))return!1;return!0}function b(m){const v=n.get(m);return v!==void 0?v:a(m)}function S(){r++,n.clear(),i.clear()}return{clearResolvedThemes:S,getResolvedOrResolveTheme:b,getResolvedTheme:f,getResolvedThemes:h,hasRegisteredTheme:l,hasResolvedTheme:g,hasResolvedThemes:p,registerTheme:o,registerThemeIfAbsent:s,resolveTheme:a,resolveThemes:u,seedResolvedTheme:d,seedResolvedThemes:c}}const Ro=new Map,Vn=new Map,Ao=Mn(()=>dt(()=>import("./highlights-themes-C1p4pFYS.js"),__vite__mapDeps([0,1,2]))),Do=Mn(()=>dt(()=>import("./theming-themes-DDvoqEqT.js"),__vite__mapDeps([3,1,2]))),To=Mn(()=>dt(()=>import("./core-BHm2gdHL.js").then(e=>e.b),[])),Ho=[["editor.lineHighlightBackground","editor.active_line.background"],["editor.selectionBackground","element.selected"],["editor.findMatchBackground","search.match_background"],["editor.findMatchHighlightBackground","search.match_background"],["editorBracketMatch.background","editor.document_highlight.bracket_background"],["editorError.foreground","error"],["editorWarning.foreground","warning"],["editorInfo.foreground","info"],["editorHint.foreground","hint"],["gitDecoration.addedResourceForeground","created","terminal.ansi.green"],["gitDecoration.deletedResourceForeground","deleted","terminal.ansi.red"],["gitDecoration.modifiedResourceForeground","modified","terminal.ansi.blue"]];function jn(e,t){var l;const n="themes"in t?t.themes[0]:t;if(n==null)throw new Error(`Theme "${e}" is an empty Zed theme family.`);const i={...n,name:e},r={};for(const[a,u]of Object.entries(i.style))typeof u=="string"&&(r[a]=u);const o=(l=i.style.players)==null?void 0:l[0];(o==null?void 0:o.cursor)!=null&&(r["editorCursor.foreground"]??(r["editorCursor.foreground"]=o.cursor)),(o==null?void 0:o.selection)!=null&&(r["editor.selectionBackground"]??(r["editor.selectionBackground"]=o.selection));for(const[a,...u]of Ho){if(r[a]!=null)continue;const d=u.find(c=>r[c]!=null);d!=null&&(r[a]=r[d])}if(i.cssVariables===!0)r["editor.foreground"]="var(--hls-foreground)",r["editor.background"]="var(--hls-background)";else if(typeof i.cssVariables=="object"){r["editor.foreground"]??(r["editor.foreground"]=r.text??r.foreground??"foreground"),r["editor.background"]??(r["editor.background"]=r.background??"background");const{prefix:a="--hls-",defaults:u}=i.cssVariables;for(const[d,c]of Object.entries(r)){const f=u==null?void 0:u[c];r[d]=`var(${a}${c}${f?`, ${f}`:""})`}}const s=i.appearance==="light"?"light":"dark";return{name:e,type:s,colors:r,zed:i,fg:r["editor.foreground"]??r.text??r.foreground??(s==="light"?"#333333":"#bbbbbb"),bg:r["editor.background"]??r.background??(s==="light"?"#ffffff":"#1e1e1e")}}function Mo(e){let t=Vn.get(e);return t!=null||(t=Eo({fallbackLoader:async n=>{if(typeof __DIFFS_WORKER__<"u"?__DIFFS_WORKER__:xo())throw new Error(`Theme "${n}" cannot be resolved from a worker context. Themes must be pre-resolved on the main thread and passed to the worker via the resolvedThemes parameter.`);const i=Ro.get(n);if(e==="highlights"){const r=(i==null?void 0:i.zed)??(i==null?void 0:i.diffs);if(r!=null){const a=await r(),u="default"in a?a.default:a;if("zed"in u&&u.zed!=null)return u;if("style"in u||"themes"in u)return jn(n,u);throw new Error(`Theme "${n}" is a TextMate theme; register a Zed theme with registerCustomTheme(name, loader, 'zed') for Highlights.`)}const o=Ao(),{themes:s}=o instanceof Promise?await o:o,l=s[n];if(l!=null)return jn(n,(await l()).default);if((i==null?void 0:i.textmate)!=null)throw new Error(`Theme "${n}" is only registered for TextMate; use registerCustomTheme(name, loader, 'zed') for Highlights.`)}else{const r=(i==null?void 0:i.textmate)??(i==null?void 0:i.diffs);let o;if(r!=null){const d=await r();o="default"in d?d.default:d}else{const d=Do(),{themes:c}=d instanceof Promise?await d:d,f=c.getTheme(n);if(f==null&&(i==null?void 0:i.zed)!=null)throw new Error(`Theme "${n}" is only registered for Zed; use registerCustomTheme(name, loader, 'textmate') for Shiki.`);if(f==null)throw new Error(`No valid theme loader registered for "${n}"`);const h=await f.load();o="default"in h?h.default:h}if("style"in o||"themes"in o)throw new Error(`Theme "${n}" is a Zed theme; use preferredHighlighter: 'highlights' or register a TextMate theme for Shiki.`);const s=To(),{normalizeTheme:l,createCssVariablesTheme:a}=s instanceof Promise?await s:s;if("cssVariables"in o&&o.cssVariables!=null)return{...o,textmate:l(a(o.cssVariables))};if("textmate"in o&&o.textmate!=null)return{...o,textmate:l(o.textmate)};const u=l(o);return{name:u.name,type:u.type,fg:u.fg,bg:u.bg,colors:u.colors,textmate:u}}throw new Error(`No valid theme loader registered for "${n}"`)},normalizeTheme:(n,i)=>{if(n.name!==i)throw new Error(`resolvedTheme: themeName: ${i} does not match theme.name: ${n.name}`);return n}}),Vn.set(e,t)),t}function ln(e,t=Tn()){return typeof t!="string"&&t.isDisposed?!1:(typeof t=="string"?Mo(t):t.themeResolver).hasResolvedThemes(Hn(e))}let me;async function Io(e){const t=Tn(e);yo(t);try{if(t==="highlights"){const{HighlightsHighlighter:i}=await dt(async()=>{const{HighlightsHighlighter:r}=await import("./highlights-1aLwssz-.js");return{HighlightsHighlighter:r}},__vite__mapDeps([4,5,1,2]));return new i}const{ShikiHighlighter:n}=await dt(async()=>{const{ShikiHighlighter:i}=await import("./shiki-BwyCm3kZ.js");return{ShikiHighlighter:i}},__vite__mapDeps([6,1,2,5,7]));return await n.create(t)}finally{So()}}async function In({themes:e,langs:t,preferredHighlighter:n}){er();const i=me??(me=Io(vo()??n));let r;try{r=await i}catch(o){throw me===i&&(me=void 0),o}if(me===i&&(me=r),await Promise.all([r.themeResolver.resolveThemes(e),r.loadLanguages(t)]),r.isDisposed)throw new Mt;return r}function er(){me!=null&&!("then"in me)&&me.isDisposed&&(me=void 0)}function Ge({theme:e,lang:t,langs:n}={}){er();const i=me;if(!(i==null||"then"in i||e!=null&&!ln(e,i)||(t!=null||n!=null)&&!i.hasLoadedLanguages([...t!=null?[t]:[],...n??[]])))return i}async function Po(e){await In(e)}const Ke=new Set;let Ye=null;function tr(e){Ke.add(e),Ye??(Ye=requestAnimationFrame(nr))}function dn(e){Ke.delete(e)&&Ke.size===0&&Ye!=null&&(cancelAnimationFrame(Ye),Ye=null)}function nr(e){const t=new Set(Ke);Ke.clear();for(const n of t)try{n(e)}catch(i){console.error(i)}Ke.size>0?Ye=requestAnimationFrame(nr):Ye=null}function un(e,t,n){if(e===t||e==null||t==null)return e===t;const i=new Set(n),r=Object.keys(e),o=new Set(Object.keys(t));for(const s of r)if(o.delete(s),!i.has(s)&&(!(s in t)||e[s]!==t[s]))return!1;for(const s of Array.from(o))if(!i.has(s))return!1;return!0}function Pn(e,t){return e==null||t==null||typeof e=="string"||typeof t=="string"?e===t:e.dark===t.dark&&e.light===t.light}function ir(e,t){const n=(e==null?void 0:e.theme)??Le,i=(t==null?void 0:t.theme)??Le,r=Gn(e),o=Gn(t);return Pn(n,i)&&un(e,t,["theme","parseDiffOptions"])&&un(r,o)}function Gn(e){if(e!=null&&"parseDiffOptions"in e)return e.parseDiffOptions}function cn(e,t){return(e==null?void 0:e.start)===(t==null?void 0:t.start)&&(e==null?void 0:e.end)===(t==null?void 0:t.end)&&(e==null?void 0:e.side)===(t==null?void 0:t.side)&&(e==null?void 0:e.endSide)===(t==null?void 0:t.endSide)}function ve(e){return{type:"text",value:e}}function z({tagName:e,children:t=[],properties:n={}}){return{type:"element",tagName:e,properties:n,children:t}}function It({name:e,width:t=16,height:n=16,properties:i}){return z({tagName:"svg",properties:{width:t,height:n,viewBox:"0 0 16 16",...i},children:[z({tagName:"use",properties:{href:`#${e.replace(/^#/,"")}`}})]})}function ht(e){return z({tagName:"div",properties:{"data-gutter":""},children:e})}function No(e,t,n,i={}){return z({tagName:"div",properties:{"data-line-type":e,"data-column-number":t,"data-line-index":n,...i},children:t!=null?[z({tagName:"span",properties:{"data-line-number-content":""},children:[ve(`${t}`)]})]:void 0})}function he(e,t,n){return z({tagName:"div",properties:{"data-gutter-buffer":t,"data-buffer-size":n,"data-line-type":t==="annotation"?void 0:e,style:t==="annotation"?`grid-row: span ${n};`:`grid-row: span ${n};min-height:calc(${n} * 1lh);`}})}function Fo(){return z({tagName:"button",properties:{"data-utility-button":"",type:"button"},children:[It({name:"diffs-icon-plus",properties:{"data-icon":""}})]})}const Oo=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class ct{constructor(t,n,i){this.normal=n,this.property=t,i&&(this.space=i)}}ct.prototype.normal={};ct.prototype.property={};ct.prototype.space=void 0;function rr(e,t){const n={},i={};for(const r of e)Object.assign(n,r.property),Object.assign(i,r.normal);return new ct(n,i,t)}function hn(e){return e.toLowerCase()}class oe{constructor(t,n){this.attribute=n,this.property=t}}oe.prototype.attribute="";oe.prototype.booleanish=!1;oe.prototype.boolean=!1;oe.prototype.commaOrSpaceSeparated=!1;oe.prototype.commaSeparated=!1;oe.prototype.defined=!1;oe.prototype.mustUseProperty=!1;oe.prototype.number=!1;oe.prototype.overloadedBoolean=!1;oe.prototype.property="";oe.prototype.spaceSeparated=!1;oe.prototype.space=void 0;let zo=0;const P=We(),q=We(),fn=We(),A=We(),V=We(),Ue=We(),ae=We();function We(){return 2**++zo}const gn=Object.freeze(Object.defineProperty({__proto__:null,boolean:P,booleanish:q,commaOrSpaceSeparated:ae,commaSeparated:Ue,number:A,overloadedBoolean:fn,spaceSeparated:V},Symbol.toStringTag,{value:"Module"})),_t=Object.keys(gn);class Nn extends oe{constructor(t,n,i,r){let o=-1;if(super(t,n),qn(this,"space",r),typeof i=="number")for(;++o<_t.length;){const s=_t[o];qn(this,_t[o],(i&gn[s])===gn[s])}}}Nn.prototype.defined=!0;function qn(e,t,n){n&&(e[t]=n)}function Ze(e){const t={},n={};for(const[i,r]of Object.entries(e.properties)){const o=new Nn(i,e.transform(e.attributes||{},i),r,e.space);e.mustUseProperty&&e.mustUseProperty.includes(i)&&(o.mustUseProperty=!0),t[i]=o,n[hn(i)]=i,n[hn(o.attribute)]=i}return new ct(t,n,e.space)}const or=Ze({properties:{ariaActiveDescendant:null,ariaAtomic:q,ariaAutoComplete:null,ariaBusy:q,ariaChecked:q,ariaColCount:A,ariaColIndex:A,ariaColSpan:A,ariaControls:V,ariaCurrent:null,ariaDescribedBy:V,ariaDetails:null,ariaDisabled:q,ariaDropEffect:V,ariaErrorMessage:null,ariaExpanded:q,ariaFlowTo:V,ariaGrabbed:q,ariaHasPopup:null,ariaHidden:q,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:V,ariaLevel:A,ariaLive:null,ariaModal:q,ariaMultiLine:q,ariaMultiSelectable:q,ariaOrientation:null,ariaOwns:V,ariaPlaceholder:null,ariaPosInSet:A,ariaPressed:q,ariaReadOnly:q,ariaRelevant:null,ariaRequired:q,ariaRoleDescription:V,ariaRowCount:A,ariaRowIndex:A,ariaRowSpan:A,ariaSelected:q,ariaSetSize:A,ariaSort:null,ariaValueMax:A,ariaValueMin:A,ariaValueNow:A,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function sr(e,t){return t in e?e[t]:t}function ar(e,t){return sr(e,t.toLowerCase())}const Uo=Ze({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ue,acceptCharset:V,accessKey:V,action:null,allow:null,allowFullScreen:P,allowPaymentRequest:P,allowUserMedia:P,alpha:P,alt:null,as:null,async:P,autoCapitalize:null,autoComplete:V,autoFocus:P,autoPlay:P,blocking:V,capture:null,charSet:null,checked:P,cite:null,className:V,closedBy:null,colorSpace:null,cols:A,colSpan:A,command:null,commandFor:null,content:null,contentEditable:q,controls:P,controlsList:V,coords:A|Ue,crossOrigin:null,data:null,dateTime:null,decoding:null,default:P,defer:P,dir:null,dirName:null,disabled:P,download:fn,draggable:q,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:P,formTarget:null,headers:V,height:A,hidden:fn,high:A,href:null,hrefLang:null,htmlFor:V,httpEquiv:V,id:null,imageSizes:null,imageSrcSet:null,inert:P,inputMode:null,integrity:null,is:null,isMap:P,itemId:null,itemProp:V,itemRef:V,itemScope:P,itemType:V,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:P,low:A,manifest:null,max:null,maxLength:A,media:null,method:null,min:null,minLength:A,multiple:P,muted:P,name:null,nonce:null,noModule:P,noValidate:P,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:P,optimum:A,pattern:null,ping:V,placeholder:null,playsInline:P,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:P,referrerPolicy:null,rel:V,required:P,reversed:P,rows:A,rowSpan:A,sandbox:V,scope:null,scoped:P,seamless:P,selected:P,shadowRootClonable:P,shadowRootCustomElementRegistry:P,shadowRootDelegatesFocus:P,shadowRootMode:null,shadowRootSerializable:P,shape:null,size:A,sizes:null,slot:null,span:A,spellCheck:q,src:null,srcDoc:null,srcLang:null,srcSet:null,start:A,step:null,style:null,tabIndex:A,target:null,title:null,translate:null,type:null,typeMustMatch:P,useMap:null,value:q,width:A,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:V,axis:null,background:null,bgColor:null,border:A,borderColor:null,bottomMargin:A,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:P,declare:P,event:null,face:null,frame:null,frameBorder:null,hSpace:A,leftMargin:A,link:null,longDesc:null,lowSrc:null,marginHeight:A,marginWidth:A,noResize:P,noHref:P,noShade:P,noWrap:P,object:null,profile:null,prompt:null,rev:null,rightMargin:A,rules:null,scheme:null,scrolling:q,standby:null,summary:null,text:null,topMargin:A,valueType:null,version:null,vAlign:null,vLink:null,vSpace:A,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:P,disablePictureInPicture:P,disableRemotePlayback:P,exportParts:Ue,part:V,prefix:null,property:null,results:A,security:null,unselectable:null},space:"html",transform:ar}),_o=Ze({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:ae,accentHeight:A,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:A,amplitude:A,arabicForm:null,ascent:A,attributeName:null,attributeType:null,azimuth:A,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:A,by:null,calcMode:null,capHeight:A,className:V,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:A,diffuseConstant:A,direction:null,display:null,dur:null,divisor:A,dominantBaseline:null,download:P,dx:null,dy:null,edgeMode:null,editable:null,elevation:A,enableBackground:null,end:null,event:null,exponent:A,externalResourcesRequired:null,fill:null,fillOpacity:A,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:Ue,g2:Ue,glyphName:Ue,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:A,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:A,horizOriginX:A,horizOriginY:A,id:null,ideographic:A,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:A,k:A,k1:A,k2:A,k3:A,k4:A,kernelMatrix:ae,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:A,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:A,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:A,overlineThickness:A,paintOrder:null,panose1:null,path:null,pathLength:A,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:V,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:A,pointsAtY:A,pointsAtZ:A,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ae,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ae,rev:ae,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ae,requiredFeatures:ae,requiredFonts:ae,requiredFormats:ae,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:A,specularExponent:A,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:A,strikethroughThickness:A,string:null,stroke:null,strokeDashArray:ae,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:A,strokeOpacity:A,strokeWidth:null,style:null,surfaceScale:A,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ae,tabIndex:A,tableValues:null,target:null,targetX:A,targetY:A,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ae,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:A,underlineThickness:A,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:A,values:null,vAlphabetic:A,vMathematical:A,vectorEffect:null,vHanging:A,vIdeographic:A,version:null,vertAdvY:A,vertOriginX:A,vertOriginY:A,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:A,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:sr}),lr=Ze({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),dr=Ze({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:ar}),ur=Ze({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),$o=/[A-Z]/g,Kn=/-[a-z]/g,Wo=/^data[-\w.:]+$/i;function Bo(e,t){const n=hn(t);let i=t,r=oe;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Wo.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(Kn,jo);i="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!Kn.test(o)){let s=o.replace($o,Vo);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}r=Nn}return new r(i,t)}function Vo(e){return"-"+e.toLowerCase()}function jo(e){return e.charAt(1).toUpperCase()}const Go=rr([or,Uo,lr,dr,ur],"html"),cr=rr([or,_o,lr,dr,ur],"svg"),Yn={}.hasOwnProperty;function qo(e,t){const n=t||{};function i(r,...o){let s=i.invalid;const l=i.handlers;if(r&&Yn.call(r,e)){const a=String(r[e]);s=Yn.call(l,a)?l[a]:i.unknown}if(s)return s.call(this,r,...o)}return i.handlers=n.handlers||{},i.invalid=n.invalid,i.unknown=n.unknown,i}const Ko=/["&'<>`]/g,Yo=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Xo=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,Zo=/[|\\{}()[\]^$+*?.]/g,Xn=new WeakMap;function Jo(e,t){if(e=e.replace(t.subset?Qo(t.subset):Ko,i),t.subset||t.escapeOnly)return e;return e.replace(Yo,n).replace(Xo,i);function n(r,o,s){return t.format((r.charCodeAt(0)-55296)*1024+r.charCodeAt(1)-56320+65536,s.charCodeAt(o+2),t)}function i(r,o,s){return t.format(r.charCodeAt(0),s.charCodeAt(o+1),t)}}function Qo(e){let t=Xn.get(e);return t||(t=es(e),Xn.set(e,t)),t}function es(e){const t=[];let n=-1;for(;++n<e.length;)t.push(e[n].replace(Zo,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}const ts=/[\dA-Fa-f]/;function ns(e,t,n){const i="&#x"+e.toString(16).toUpperCase();return n&&t&&!ts.test(String.fromCharCode(t))?i:i+";"}const is=/\d/;function rs(e,t,n){const i="&#"+String(e);return n&&t&&!is.test(String.fromCharCode(t))?i:i+";"}const os=["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"],$t={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:"€"},ss=["cent","copy","divide","gt","lt","not","para","times"],hr={}.hasOwnProperty,pn={};let ft;for(ft in $t)hr.call($t,ft)&&(pn[$t[ft]]=ft);const as=/[^\dA-Za-z]/;function ls(e,t,n,i){const r=String.fromCharCode(e);if(hr.call(pn,r)){const o=pn[r],s="&"+o;return n&&os.includes(o)&&!ss.includes(o)&&(!i||t&&t!==61&&as.test(String.fromCharCode(t)))?s:s+";"}return""}function ds(e,t,n){let i=ns(e,t,n.omitOptionalSemicolons),r;if((n.useNamedReferences||n.useShortestReferences)&&(r=ls(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!r)&&n.useShortestReferences){const o=rs(e,t,n.omitOptionalSemicolons);o.length<i.length&&(i=o)}return r&&(!n.useShortestReferences||r.length<i.length)?r:i}function Xe(e,t){return Jo(e,Object.assign({format:ds},t))}const us=/^>|^->|<!--|-->|--!>|<!-$/g,cs=[">"],hs=["<",">"];function fs(e,t,n,i){return i.settings.bogusComments?"<?"+Xe(e.value,Object.assign({},i.settings.characterReferences,{subset:cs}))+">":"<!--"+e.value.replace(us,r)+"-->";function r(o){return Xe(o,Object.assign({},i.settings.characterReferences,{subset:hs}))}}function gs(e,t,n,i){return"<!"+(i.settings.upperDoctype?"DOCTYPE":"doctype")+(i.settings.tightDoctype?"":" ")+"html>"}function Zn(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let i=0,r=n.indexOf(t);for(;r!==-1;)i++,r=n.indexOf(t,r+t.length);return i}function ps(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function ms(e){return e.join(" ").trim()}const vs=/[ \t\n\f\r]/g;function Fn(e){return typeof e=="object"?e.type==="text"?Jn(e.value):!1:Jn(e)}function Jn(e){return e.replace(vs,"")===""}const Y=gr(1),fr=gr(-1),bs=[];function gr(e){return t;function t(n,i,r){const o=n?n.children:bs;let s=(i||0)+e,l=o[s];if(!r)for(;l&&Fn(l);)s+=e,l=o[s];return l}}const ys={}.hasOwnProperty;function pr(e){return t;function t(n,i,r){return ys.call(e,n.tagName)&&e[n.tagName](n,i,r)}}const On=pr({body:Cs,caption:Wt,colgroup:Wt,dd:Ls,dt:ws,head:Wt,html:Ss,li:ks,optgroup:Es,option:Rs,p:xs,rp:Qn,rt:Qn,tbody:Ds,td:ei,tfoot:Ts,th:ei,thead:As,tr:Hs});function Wt(e,t,n){const i=Y(n,t,!0);return!i||i.type!=="comment"&&!(i.type==="text"&&Fn(i.value.charAt(0)))}function Ss(e,t,n){const i=Y(n,t);return!i||i.type!=="comment"}function Cs(e,t,n){const i=Y(n,t);return!i||i.type!=="comment"}function xs(e,t,n){const i=Y(n,t);return i?i.type==="element"&&(i.tagName==="address"||i.tagName==="article"||i.tagName==="aside"||i.tagName==="blockquote"||i.tagName==="details"||i.tagName==="div"||i.tagName==="dl"||i.tagName==="fieldset"||i.tagName==="figcaption"||i.tagName==="figure"||i.tagName==="footer"||i.tagName==="form"||i.tagName==="h1"||i.tagName==="h2"||i.tagName==="h3"||i.tagName==="h4"||i.tagName==="h5"||i.tagName==="h6"||i.tagName==="header"||i.tagName==="hgroup"||i.tagName==="hr"||i.tagName==="main"||i.tagName==="menu"||i.tagName==="nav"||i.tagName==="ol"||i.tagName==="p"||i.tagName==="pre"||i.tagName==="section"||i.tagName==="table"||i.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 ks(e,t,n){const i=Y(n,t);return!i||i.type==="element"&&i.tagName==="li"}function ws(e,t,n){const i=Y(n,t);return!!(i&&i.type==="element"&&(i.tagName==="dt"||i.tagName==="dd"))}function Ls(e,t,n){const i=Y(n,t);return!i||i.type==="element"&&(i.tagName==="dt"||i.tagName==="dd")}function Qn(e,t,n){const i=Y(n,t);return!i||i.type==="element"&&(i.tagName==="rp"||i.tagName==="rt")}function Es(e,t,n){const i=Y(n,t);return!i||i.type==="element"&&i.tagName==="optgroup"}function Rs(e,t,n){const i=Y(n,t);return!i||i.type==="element"&&(i.tagName==="option"||i.tagName==="optgroup")}function As(e,t,n){const i=Y(n,t);return!!(i&&i.type==="element"&&(i.tagName==="tbody"||i.tagName==="tfoot"))}function Ds(e,t,n){const i=Y(n,t);return!i||i.type==="element"&&(i.tagName==="tbody"||i.tagName==="tfoot")}function Ts(e,t,n){return!Y(n,t)}function Hs(e,t,n){const i=Y(n,t);return!i||i.type==="element"&&i.tagName==="tr"}function ei(e,t,n){const i=Y(n,t);return!i||i.type==="element"&&(i.tagName==="td"||i.tagName==="th")}const Ms=pr({body:Ns,colgroup:Fs,head:Ps,html:Is,tbody:Os});function Is(e){const t=Y(e,-1);return!t||t.type!=="comment"}function Ps(e){const t=new Set;for(const i of e.children)if(i.type==="element"&&(i.tagName==="base"||i.tagName==="title")){if(t.has(i.tagName))return!1;t.add(i.tagName)}const n=e.children[0];return!n||n.type==="element"}function Ns(e){const t=Y(e,-1,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&Fn(t.value.charAt(0)))&&!(t.type==="element"&&(t.tagName==="meta"||t.tagName==="link"||t.tagName==="script"||t.tagName==="style"||t.tagName==="template"))}function Fs(e,t,n){const i=fr(n,t),r=Y(e,-1,!0);return n&&i&&i.type==="element"&&i.tagName==="colgroup"&&On(i,n.children.indexOf(i),n)?!1:!!(r&&r.type==="element"&&r.tagName==="col")}function Os(e,t,n){const i=fr(n,t),r=Y(e,-1);return n&&i&&i.type==="element"&&(i.tagName==="thead"||i.tagName==="tbody")&&On(i,n.children.indexOf(i),n)?!1:!!(r&&r.type==="element"&&r.tagName==="tr")}const gt={name:[[`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/highlights-themes-CSNkBojy.js","assets/index-DefQtCI2.js","assets/index-C_qkbyL7.css","assets/theming-themes-wKVca0aB.js","assets/highlights-CyEmo6OI.js","assets/stream-tokenizer-CBPqFe4Z.js","assets/shiki-BzCmRG-v.js","assets/core-BWHGsFpV.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
var io=Object.defineProperty;var ro=(e,t,n)=>t in e?io(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var w=(e,t,n)=>ro(e,typeof t!="symbol"?t+"":t,n);import{_ as dt,r as G,j as X}from"./index-DefQtCI2.js";const qi="diffs-container";(()=>{try{return!1}catch{return!1}})();const oo=/(?=^From [a-f0-9]+ .+$)/m,Ki=/(?=^diff --git)/gm,so=new RegExp("(?<=\\n)"),ao=/^(---|\+\+\+)\s+([^\t\r\n]+)/,lo=/^index ([0-9a-f]+)\.\.([0-9a-f]+)(?: (\d+))?$/i,Yi="header-prefix",Xi="header-filename-suffix",Zi="header-metadata",Dn="header-custom",Le={dark:"pierre-dark",light:"pierre-light"},uo="data-theme-css",co="data-unsafe-css",ho="data-diffs-scrollbar-measure",Ji="--diffs-scrollbar-gutter-measured",fo=1e5,go={hunkLineCount:50,lineHeight:20,diffHeaderHeight:44,spacing:8},po=Object.freeze({fromStart:0,fromEnd:0}),Wn={startingLine:0,totalLines:1/0,bufferBefore:0,bufferAfter:0},Qi=Object.freeze([]),mo={startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:0};let Ie,an=0;var Mt=class extends Error{constructor(){super("Highlighter is disposed"),this.name="HighlighterDisposedError"}};function vo(){return Ie}function Tn(e){return e??Ie??"shiki-js"}function bo(e){if(Ie!=null&&Ie!==e)throw new Error(`Cannot load the "${e}" highlighter while "${Ie}" is in use. Only one highlighter type can be active at a time; dispose every "${Ie}" instance (disposeHighlighter() disposes the shared one) before switching.`)}function yo(e){bo(e),Ie=e,an++}function So(){an--,an===0&&(Ie=void 0)}const Ec=new Map,Rc=new Map,Ac=new Map,Co=new Set;function Hn(e=Le){const t=[];return typeof e=="string"?t.push(e):(t.push(e.dark),t.push(e.light)),t}function xo(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}function Mn(e){let t;return()=>t??(t=e().then(n=>(t=n,n),n=>{throw t=void 0,n}))}function ko(e){return e!==null&&typeof e=="object"&&"default"in e?e.default:e}var wo=class extends Error{constructor(e){super(`Theme "${e}" is already registered`),this.name="DuplicateThemeError"}},Bn=class extends Error{constructor(e){super(`No loader registered for theme "${e}"`),this.name="UnregisteredThemeError"}},Lo=class extends Error{constructor(e){super(`Theme "${e}" has not been resolved`),this.name="UnresolvedThemeError"}};function Eo(e={}){const t=new Map,n=new Map,i=new Map;let r=0;function o(m,v){if(t.has(m))throw new wo(m);t.set(m,v)}function s(m,v){return t.has(m)?!1:(t.set(m,v),!0)}function l(m){return t.has(m)}function a(m){const v=n.get(m);if(v!==void 0)return Promise.resolve(v);const C=i.get(m);if(C!==void 0)return C;const y=t.get(m);if(y===void 0&&e.fallbackLoader===void 0)return Promise.reject(new Bn(m));const x=r,L=Promise.resolve().then(()=>{var k;return y!==void 0?y():(k=e.fallbackLoader)==null?void 0:k.call(e,m)}).then(async k=>{if(k===void 0)throw new Bn(m);const R=ko(k),H=e.normalizeTheme===void 0?R:await e.normalizeTheme(R,m);return x===r&&n.set(m,H),i.get(m)===L&&i.delete(m),H}).catch(k=>{throw i.get(m)===L&&i.delete(m),k});return i.set(m,L),L}function u(m){return Promise.all(m.map(v=>a(v)))}function d(m,v){n.set(m,v)}function c(m){for(const[v,C]of m)d(v,C)}function f(m){return n.get(m)}function h(m){const v=[];for(const C of m){const y=n.get(C);if(y===void 0)throw new Lo(C);v.push(y)}return v}function g(m){return n.has(m)}function p(m){for(const v of m)if(!n.has(v))return!1;return!0}function b(m){const v=n.get(m);return v!==void 0?v:a(m)}function S(){r++,n.clear(),i.clear()}return{clearResolvedThemes:S,getResolvedOrResolveTheme:b,getResolvedTheme:f,getResolvedThemes:h,hasRegisteredTheme:l,hasResolvedTheme:g,hasResolvedThemes:p,registerTheme:o,registerThemeIfAbsent:s,resolveTheme:a,resolveThemes:u,seedResolvedTheme:d,seedResolvedThemes:c}}const Ro=new Map,Vn=new Map,Ao=Mn(()=>dt(()=>import("./highlights-themes-CSNkBojy.js"),__vite__mapDeps([0,1,2]))),Do=Mn(()=>dt(()=>import("./theming-themes-wKVca0aB.js"),__vite__mapDeps([3,1,2]))),To=Mn(()=>dt(()=>import("./core-BWHGsFpV.js").then(e=>e.b),[])),Ho=[["editor.lineHighlightBackground","editor.active_line.background"],["editor.selectionBackground","element.selected"],["editor.findMatchBackground","search.match_background"],["editor.findMatchHighlightBackground","search.match_background"],["editorBracketMatch.background","editor.document_highlight.bracket_background"],["editorError.foreground","error"],["editorWarning.foreground","warning"],["editorInfo.foreground","info"],["editorHint.foreground","hint"],["gitDecoration.addedResourceForeground","created","terminal.ansi.green"],["gitDecoration.deletedResourceForeground","deleted","terminal.ansi.red"],["gitDecoration.modifiedResourceForeground","modified","terminal.ansi.blue"]];function jn(e,t){var l;const n="themes"in t?t.themes[0]:t;if(n==null)throw new Error(`Theme "${e}" is an empty Zed theme family.`);const i={...n,name:e},r={};for(const[a,u]of Object.entries(i.style))typeof u=="string"&&(r[a]=u);const o=(l=i.style.players)==null?void 0:l[0];(o==null?void 0:o.cursor)!=null&&(r["editorCursor.foreground"]??(r["editorCursor.foreground"]=o.cursor)),(o==null?void 0:o.selection)!=null&&(r["editor.selectionBackground"]??(r["editor.selectionBackground"]=o.selection));for(const[a,...u]of Ho){if(r[a]!=null)continue;const d=u.find(c=>r[c]!=null);d!=null&&(r[a]=r[d])}if(i.cssVariables===!0)r["editor.foreground"]="var(--hls-foreground)",r["editor.background"]="var(--hls-background)";else if(typeof i.cssVariables=="object"){r["editor.foreground"]??(r["editor.foreground"]=r.text??r.foreground??"foreground"),r["editor.background"]??(r["editor.background"]=r.background??"background");const{prefix:a="--hls-",defaults:u}=i.cssVariables;for(const[d,c]of Object.entries(r)){const f=u==null?void 0:u[c];r[d]=`var(${a}${c}${f?`, ${f}`:""})`}}const s=i.appearance==="light"?"light":"dark";return{name:e,type:s,colors:r,zed:i,fg:r["editor.foreground"]??r.text??r.foreground??(s==="light"?"#333333":"#bbbbbb"),bg:r["editor.background"]??r.background??(s==="light"?"#ffffff":"#1e1e1e")}}function Mo(e){let t=Vn.get(e);return t!=null||(t=Eo({fallbackLoader:async n=>{if(typeof __DIFFS_WORKER__<"u"?__DIFFS_WORKER__:xo())throw new Error(`Theme "${n}" cannot be resolved from a worker context. Themes must be pre-resolved on the main thread and passed to the worker via the resolvedThemes parameter.`);const i=Ro.get(n);if(e==="highlights"){const r=(i==null?void 0:i.zed)??(i==null?void 0:i.diffs);if(r!=null){const a=await r(),u="default"in a?a.default:a;if("zed"in u&&u.zed!=null)return u;if("style"in u||"themes"in u)return jn(n,u);throw new Error(`Theme "${n}" is a TextMate theme; register a Zed theme with registerCustomTheme(name, loader, 'zed') for Highlights.`)}const o=Ao(),{themes:s}=o instanceof Promise?await o:o,l=s[n];if(l!=null)return jn(n,(await l()).default);if((i==null?void 0:i.textmate)!=null)throw new Error(`Theme "${n}" is only registered for TextMate; use registerCustomTheme(name, loader, 'zed') for Highlights.`)}else{const r=(i==null?void 0:i.textmate)??(i==null?void 0:i.diffs);let o;if(r!=null){const d=await r();o="default"in d?d.default:d}else{const d=Do(),{themes:c}=d instanceof Promise?await d:d,f=c.getTheme(n);if(f==null&&(i==null?void 0:i.zed)!=null)throw new Error(`Theme "${n}" is only registered for Zed; use registerCustomTheme(name, loader, 'textmate') for Shiki.`);if(f==null)throw new Error(`No valid theme loader registered for "${n}"`);const h=await f.load();o="default"in h?h.default:h}if("style"in o||"themes"in o)throw new Error(`Theme "${n}" is a Zed theme; use preferredHighlighter: 'highlights' or register a TextMate theme for Shiki.`);const s=To(),{normalizeTheme:l,createCssVariablesTheme:a}=s instanceof Promise?await s:s;if("cssVariables"in o&&o.cssVariables!=null)return{...o,textmate:l(a(o.cssVariables))};if("textmate"in o&&o.textmate!=null)return{...o,textmate:l(o.textmate)};const u=l(o);return{name:u.name,type:u.type,fg:u.fg,bg:u.bg,colors:u.colors,textmate:u}}throw new Error(`No valid theme loader registered for "${n}"`)},normalizeTheme:(n,i)=>{if(n.name!==i)throw new Error(`resolvedTheme: themeName: ${i} does not match theme.name: ${n.name}`);return n}}),Vn.set(e,t)),t}function ln(e,t=Tn()){return typeof t!="string"&&t.isDisposed?!1:(typeof t=="string"?Mo(t):t.themeResolver).hasResolvedThemes(Hn(e))}let me;async function Io(e){const t=Tn(e);yo(t);try{if(t==="highlights"){const{HighlightsHighlighter:i}=await dt(async()=>{const{HighlightsHighlighter:r}=await import("./highlights-CyEmo6OI.js");return{HighlightsHighlighter:r}},__vite__mapDeps([4,5,1,2]));return new i}const{ShikiHighlighter:n}=await dt(async()=>{const{ShikiHighlighter:i}=await import("./shiki-BzCmRG-v.js");return{ShikiHighlighter:i}},__vite__mapDeps([6,1,2,5,7]));return await n.create(t)}finally{So()}}async function In({themes:e,langs:t,preferredHighlighter:n}){er();const i=me??(me=Io(vo()??n));let r;try{r=await i}catch(o){throw me===i&&(me=void 0),o}if(me===i&&(me=r),await Promise.all([r.themeResolver.resolveThemes(e),r.loadLanguages(t)]),r.isDisposed)throw new Mt;return r}function er(){me!=null&&!("then"in me)&&me.isDisposed&&(me=void 0)}function Ge({theme:e,lang:t,langs:n}={}){er();const i=me;if(!(i==null||"then"in i||e!=null&&!ln(e,i)||(t!=null||n!=null)&&!i.hasLoadedLanguages([...t!=null?[t]:[],...n??[]])))return i}async function Po(e){await In(e)}const Ke=new Set;let Ye=null;function tr(e){Ke.add(e),Ye??(Ye=requestAnimationFrame(nr))}function dn(e){Ke.delete(e)&&Ke.size===0&&Ye!=null&&(cancelAnimationFrame(Ye),Ye=null)}function nr(e){const t=new Set(Ke);Ke.clear();for(const n of t)try{n(e)}catch(i){console.error(i)}Ke.size>0?Ye=requestAnimationFrame(nr):Ye=null}function un(e,t,n){if(e===t||e==null||t==null)return e===t;const i=new Set(n),r=Object.keys(e),o=new Set(Object.keys(t));for(const s of r)if(o.delete(s),!i.has(s)&&(!(s in t)||e[s]!==t[s]))return!1;for(const s of Array.from(o))if(!i.has(s))return!1;return!0}function Pn(e,t){return e==null||t==null||typeof e=="string"||typeof t=="string"?e===t:e.dark===t.dark&&e.light===t.light}function ir(e,t){const n=(e==null?void 0:e.theme)??Le,i=(t==null?void 0:t.theme)??Le,r=Gn(e),o=Gn(t);return Pn(n,i)&&un(e,t,["theme","parseDiffOptions"])&&un(r,o)}function Gn(e){if(e!=null&&"parseDiffOptions"in e)return e.parseDiffOptions}function cn(e,t){return(e==null?void 0:e.start)===(t==null?void 0:t.start)&&(e==null?void 0:e.end)===(t==null?void 0:t.end)&&(e==null?void 0:e.side)===(t==null?void 0:t.side)&&(e==null?void 0:e.endSide)===(t==null?void 0:t.endSide)}function ve(e){return{type:"text",value:e}}function z({tagName:e,children:t=[],properties:n={}}){return{type:"element",tagName:e,properties:n,children:t}}function It({name:e,width:t=16,height:n=16,properties:i}){return z({tagName:"svg",properties:{width:t,height:n,viewBox:"0 0 16 16",...i},children:[z({tagName:"use",properties:{href:`#${e.replace(/^#/,"")}`}})]})}function ht(e){return z({tagName:"div",properties:{"data-gutter":""},children:e})}function No(e,t,n,i={}){return z({tagName:"div",properties:{"data-line-type":e,"data-column-number":t,"data-line-index":n,...i},children:t!=null?[z({tagName:"span",properties:{"data-line-number-content":""},children:[ve(`${t}`)]})]:void 0})}function he(e,t,n){return z({tagName:"div",properties:{"data-gutter-buffer":t,"data-buffer-size":n,"data-line-type":t==="annotation"?void 0:e,style:t==="annotation"?`grid-row: span ${n};`:`grid-row: span ${n};min-height:calc(${n} * 1lh);`}})}function Fo(){return z({tagName:"button",properties:{"data-utility-button":"",type:"button"},children:[It({name:"diffs-icon-plus",properties:{"data-icon":""}})]})}const Oo=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class ct{constructor(t,n,i){this.normal=n,this.property=t,i&&(this.space=i)}}ct.prototype.normal={};ct.prototype.property={};ct.prototype.space=void 0;function rr(e,t){const n={},i={};for(const r of e)Object.assign(n,r.property),Object.assign(i,r.normal);return new ct(n,i,t)}function hn(e){return e.toLowerCase()}class oe{constructor(t,n){this.attribute=n,this.property=t}}oe.prototype.attribute="";oe.prototype.booleanish=!1;oe.prototype.boolean=!1;oe.prototype.commaOrSpaceSeparated=!1;oe.prototype.commaSeparated=!1;oe.prototype.defined=!1;oe.prototype.mustUseProperty=!1;oe.prototype.number=!1;oe.prototype.overloadedBoolean=!1;oe.prototype.property="";oe.prototype.spaceSeparated=!1;oe.prototype.space=void 0;let zo=0;const P=We(),q=We(),fn=We(),A=We(),V=We(),Ue=We(),ae=We();function We(){return 2**++zo}const gn=Object.freeze(Object.defineProperty({__proto__:null,boolean:P,booleanish:q,commaOrSpaceSeparated:ae,commaSeparated:Ue,number:A,overloadedBoolean:fn,spaceSeparated:V},Symbol.toStringTag,{value:"Module"})),_t=Object.keys(gn);class Nn extends oe{constructor(t,n,i,r){let o=-1;if(super(t,n),qn(this,"space",r),typeof i=="number")for(;++o<_t.length;){const s=_t[o];qn(this,_t[o],(i&gn[s])===gn[s])}}}Nn.prototype.defined=!0;function qn(e,t,n){n&&(e[t]=n)}function Ze(e){const t={},n={};for(const[i,r]of Object.entries(e.properties)){const o=new Nn(i,e.transform(e.attributes||{},i),r,e.space);e.mustUseProperty&&e.mustUseProperty.includes(i)&&(o.mustUseProperty=!0),t[i]=o,n[hn(i)]=i,n[hn(o.attribute)]=i}return new ct(t,n,e.space)}const or=Ze({properties:{ariaActiveDescendant:null,ariaAtomic:q,ariaAutoComplete:null,ariaBusy:q,ariaChecked:q,ariaColCount:A,ariaColIndex:A,ariaColSpan:A,ariaControls:V,ariaCurrent:null,ariaDescribedBy:V,ariaDetails:null,ariaDisabled:q,ariaDropEffect:V,ariaErrorMessage:null,ariaExpanded:q,ariaFlowTo:V,ariaGrabbed:q,ariaHasPopup:null,ariaHidden:q,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:V,ariaLevel:A,ariaLive:null,ariaModal:q,ariaMultiLine:q,ariaMultiSelectable:q,ariaOrientation:null,ariaOwns:V,ariaPlaceholder:null,ariaPosInSet:A,ariaPressed:q,ariaReadOnly:q,ariaRelevant:null,ariaRequired:q,ariaRoleDescription:V,ariaRowCount:A,ariaRowIndex:A,ariaRowSpan:A,ariaSelected:q,ariaSetSize:A,ariaSort:null,ariaValueMax:A,ariaValueMin:A,ariaValueNow:A,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function sr(e,t){return t in e?e[t]:t}function ar(e,t){return sr(e,t.toLowerCase())}const Uo=Ze({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ue,acceptCharset:V,accessKey:V,action:null,allow:null,allowFullScreen:P,allowPaymentRequest:P,allowUserMedia:P,alpha:P,alt:null,as:null,async:P,autoCapitalize:null,autoComplete:V,autoFocus:P,autoPlay:P,blocking:V,capture:null,charSet:null,checked:P,cite:null,className:V,closedBy:null,colorSpace:null,cols:A,colSpan:A,command:null,commandFor:null,content:null,contentEditable:q,controls:P,controlsList:V,coords:A|Ue,crossOrigin:null,data:null,dateTime:null,decoding:null,default:P,defer:P,dir:null,dirName:null,disabled:P,download:fn,draggable:q,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:P,formTarget:null,headers:V,height:A,hidden:fn,high:A,href:null,hrefLang:null,htmlFor:V,httpEquiv:V,id:null,imageSizes:null,imageSrcSet:null,inert:P,inputMode:null,integrity:null,is:null,isMap:P,itemId:null,itemProp:V,itemRef:V,itemScope:P,itemType:V,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:P,low:A,manifest:null,max:null,maxLength:A,media:null,method:null,min:null,minLength:A,multiple:P,muted:P,name:null,nonce:null,noModule:P,noValidate:P,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:P,optimum:A,pattern:null,ping:V,placeholder:null,playsInline:P,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:P,referrerPolicy:null,rel:V,required:P,reversed:P,rows:A,rowSpan:A,sandbox:V,scope:null,scoped:P,seamless:P,selected:P,shadowRootClonable:P,shadowRootCustomElementRegistry:P,shadowRootDelegatesFocus:P,shadowRootMode:null,shadowRootSerializable:P,shape:null,size:A,sizes:null,slot:null,span:A,spellCheck:q,src:null,srcDoc:null,srcLang:null,srcSet:null,start:A,step:null,style:null,tabIndex:A,target:null,title:null,translate:null,type:null,typeMustMatch:P,useMap:null,value:q,width:A,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:V,axis:null,background:null,bgColor:null,border:A,borderColor:null,bottomMargin:A,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:P,declare:P,event:null,face:null,frame:null,frameBorder:null,hSpace:A,leftMargin:A,link:null,longDesc:null,lowSrc:null,marginHeight:A,marginWidth:A,noResize:P,noHref:P,noShade:P,noWrap:P,object:null,profile:null,prompt:null,rev:null,rightMargin:A,rules:null,scheme:null,scrolling:q,standby:null,summary:null,text:null,topMargin:A,valueType:null,version:null,vAlign:null,vLink:null,vSpace:A,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:P,disablePictureInPicture:P,disableRemotePlayback:P,exportParts:Ue,part:V,prefix:null,property:null,results:A,security:null,unselectable:null},space:"html",transform:ar}),_o=Ze({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:ae,accentHeight:A,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:A,amplitude:A,arabicForm:null,ascent:A,attributeName:null,attributeType:null,azimuth:A,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:A,by:null,calcMode:null,capHeight:A,className:V,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:A,diffuseConstant:A,direction:null,display:null,dur:null,divisor:A,dominantBaseline:null,download:P,dx:null,dy:null,edgeMode:null,editable:null,elevation:A,enableBackground:null,end:null,event:null,exponent:A,externalResourcesRequired:null,fill:null,fillOpacity:A,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:Ue,g2:Ue,glyphName:Ue,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:A,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:A,horizOriginX:A,horizOriginY:A,id:null,ideographic:A,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:A,k:A,k1:A,k2:A,k3:A,k4:A,kernelMatrix:ae,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:A,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:A,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:A,overlineThickness:A,paintOrder:null,panose1:null,path:null,pathLength:A,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:V,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:A,pointsAtY:A,pointsAtZ:A,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ae,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ae,rev:ae,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ae,requiredFeatures:ae,requiredFonts:ae,requiredFormats:ae,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:A,specularExponent:A,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:A,strikethroughThickness:A,string:null,stroke:null,strokeDashArray:ae,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:A,strokeOpacity:A,strokeWidth:null,style:null,surfaceScale:A,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ae,tabIndex:A,tableValues:null,target:null,targetX:A,targetY:A,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ae,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:A,underlineThickness:A,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:A,values:null,vAlphabetic:A,vMathematical:A,vectorEffect:null,vHanging:A,vIdeographic:A,version:null,vertAdvY:A,vertOriginX:A,vertOriginY:A,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:A,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:sr}),lr=Ze({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),dr=Ze({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:ar}),ur=Ze({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),$o=/[A-Z]/g,Kn=/-[a-z]/g,Wo=/^data[-\w.:]+$/i;function Bo(e,t){const n=hn(t);let i=t,r=oe;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Wo.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(Kn,jo);i="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!Kn.test(o)){let s=o.replace($o,Vo);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}r=Nn}return new r(i,t)}function Vo(e){return"-"+e.toLowerCase()}function jo(e){return e.charAt(1).toUpperCase()}const Go=rr([or,Uo,lr,dr,ur],"html"),cr=rr([or,_o,lr,dr,ur],"svg"),Yn={}.hasOwnProperty;function qo(e,t){const n=t||{};function i(r,...o){let s=i.invalid;const l=i.handlers;if(r&&Yn.call(r,e)){const a=String(r[e]);s=Yn.call(l,a)?l[a]:i.unknown}if(s)return s.call(this,r,...o)}return i.handlers=n.handlers||{},i.invalid=n.invalid,i.unknown=n.unknown,i}const Ko=/["&'<>`]/g,Yo=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Xo=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,Zo=/[|\\{}()[\]^$+*?.]/g,Xn=new WeakMap;function Jo(e,t){if(e=e.replace(t.subset?Qo(t.subset):Ko,i),t.subset||t.escapeOnly)return e;return e.replace(Yo,n).replace(Xo,i);function n(r,o,s){return t.format((r.charCodeAt(0)-55296)*1024+r.charCodeAt(1)-56320+65536,s.charCodeAt(o+2),t)}function i(r,o,s){return t.format(r.charCodeAt(0),s.charCodeAt(o+1),t)}}function Qo(e){let t=Xn.get(e);return t||(t=es(e),Xn.set(e,t)),t}function es(e){const t=[];let n=-1;for(;++n<e.length;)t.push(e[n].replace(Zo,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}const ts=/[\dA-Fa-f]/;function ns(e,t,n){const i="&#x"+e.toString(16).toUpperCase();return n&&t&&!ts.test(String.fromCharCode(t))?i:i+";"}const is=/\d/;function rs(e,t,n){const i="&#"+String(e);return n&&t&&!is.test(String.fromCharCode(t))?i:i+";"}const os=["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"],$t={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:"€"},ss=["cent","copy","divide","gt","lt","not","para","times"],hr={}.hasOwnProperty,pn={};let ft;for(ft in $t)hr.call($t,ft)&&(pn[$t[ft]]=ft);const as=/[^\dA-Za-z]/;function ls(e,t,n,i){const r=String.fromCharCode(e);if(hr.call(pn,r)){const o=pn[r],s="&"+o;return n&&os.includes(o)&&!ss.includes(o)&&(!i||t&&t!==61&&as.test(String.fromCharCode(t)))?s:s+";"}return""}function ds(e,t,n){let i=ns(e,t,n.omitOptionalSemicolons),r;if((n.useNamedReferences||n.useShortestReferences)&&(r=ls(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!r)&&n.useShortestReferences){const o=rs(e,t,n.omitOptionalSemicolons);o.length<i.length&&(i=o)}return r&&(!n.useShortestReferences||r.length<i.length)?r:i}function Xe(e,t){return Jo(e,Object.assign({format:ds},t))}const us=/^>|^->|<!--|-->|--!>|<!-$/g,cs=[">"],hs=["<",">"];function fs(e,t,n,i){return i.settings.bogusComments?"<?"+Xe(e.value,Object.assign({},i.settings.characterReferences,{subset:cs}))+">":"<!--"+e.value.replace(us,r)+"-->";function r(o){return Xe(o,Object.assign({},i.settings.characterReferences,{subset:hs}))}}function gs(e,t,n,i){return"<!"+(i.settings.upperDoctype?"DOCTYPE":"doctype")+(i.settings.tightDoctype?"":" ")+"html>"}function Zn(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let i=0,r=n.indexOf(t);for(;r!==-1;)i++,r=n.indexOf(t,r+t.length);return i}function ps(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function ms(e){return e.join(" ").trim()}const vs=/[ \t\n\f\r]/g;function Fn(e){return typeof e=="object"?e.type==="text"?Jn(e.value):!1:Jn(e)}function Jn(e){return e.replace(vs,"")===""}const Y=gr(1),fr=gr(-1),bs=[];function gr(e){return t;function t(n,i,r){const o=n?n.children:bs;let s=(i||0)+e,l=o[s];if(!r)for(;l&&Fn(l);)s+=e,l=o[s];return l}}const ys={}.hasOwnProperty;function pr(e){return t;function t(n,i,r){return ys.call(e,n.tagName)&&e[n.tagName](n,i,r)}}const On=pr({body:Cs,caption:Wt,colgroup:Wt,dd:Ls,dt:ws,head:Wt,html:Ss,li:ks,optgroup:Es,option:Rs,p:xs,rp:Qn,rt:Qn,tbody:Ds,td:ei,tfoot:Ts,th:ei,thead:As,tr:Hs});function Wt(e,t,n){const i=Y(n,t,!0);return!i||i.type!=="comment"&&!(i.type==="text"&&Fn(i.value.charAt(0)))}function Ss(e,t,n){const i=Y(n,t);return!i||i.type!=="comment"}function Cs(e,t,n){const i=Y(n,t);return!i||i.type!=="comment"}function xs(e,t,n){const i=Y(n,t);return i?i.type==="element"&&(i.tagName==="address"||i.tagName==="article"||i.tagName==="aside"||i.tagName==="blockquote"||i.tagName==="details"||i.tagName==="div"||i.tagName==="dl"||i.tagName==="fieldset"||i.tagName==="figcaption"||i.tagName==="figure"||i.tagName==="footer"||i.tagName==="form"||i.tagName==="h1"||i.tagName==="h2"||i.tagName==="h3"||i.tagName==="h4"||i.tagName==="h5"||i.tagName==="h6"||i.tagName==="header"||i.tagName==="hgroup"||i.tagName==="hr"||i.tagName==="main"||i.tagName==="menu"||i.tagName==="nav"||i.tagName==="ol"||i.tagName==="p"||i.tagName==="pre"||i.tagName==="section"||i.tagName==="table"||i.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 ks(e,t,n){const i=Y(n,t);return!i||i.type==="element"&&i.tagName==="li"}function ws(e,t,n){const i=Y(n,t);return!!(i&&i.type==="element"&&(i.tagName==="dt"||i.tagName==="dd"))}function Ls(e,t,n){const i=Y(n,t);return!i||i.type==="element"&&(i.tagName==="dt"||i.tagName==="dd")}function Qn(e,t,n){const i=Y(n,t);return!i||i.type==="element"&&(i.tagName==="rp"||i.tagName==="rt")}function Es(e,t,n){const i=Y(n,t);return!i||i.type==="element"&&i.tagName==="optgroup"}function Rs(e,t,n){const i=Y(n,t);return!i||i.type==="element"&&(i.tagName==="option"||i.tagName==="optgroup")}function As(e,t,n){const i=Y(n,t);return!!(i&&i.type==="element"&&(i.tagName==="tbody"||i.tagName==="tfoot"))}function Ds(e,t,n){const i=Y(n,t);return!i||i.type==="element"&&(i.tagName==="tbody"||i.tagName==="tfoot")}function Ts(e,t,n){return!Y(n,t)}function Hs(e,t,n){const i=Y(n,t);return!i||i.type==="element"&&i.tagName==="tr"}function ei(e,t,n){const i=Y(n,t);return!i||i.type==="element"&&(i.tagName==="td"||i.tagName==="th")}const Ms=pr({body:Ns,colgroup:Fs,head:Ps,html:Is,tbody:Os});function Is(e){const t=Y(e,-1);return!t||t.type!=="comment"}function Ps(e){const t=new Set;for(const i of e.children)if(i.type==="element"&&(i.tagName==="base"||i.tagName==="title")){if(t.has(i.tagName))return!1;t.add(i.tagName)}const n=e.children[0];return!n||n.type==="element"}function Ns(e){const t=Y(e,-1,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&Fn(t.value.charAt(0)))&&!(t.type==="element"&&(t.tagName==="meta"||t.tagName==="link"||t.tagName==="script"||t.tagName==="style"||t.tagName==="template"))}function Fs(e,t,n){const i=fr(n,t),r=Y(e,-1,!0);return n&&i&&i.type==="element"&&i.tagName==="colgroup"&&On(i,n.children.indexOf(i),n)?!1:!!(r&&r.type==="element"&&r.tagName==="col")}function Os(e,t,n){const i=fr(n,t),r=Y(e,-1);return n&&i&&i.type==="element"&&(i.tagName==="thead"||i.tagName==="tbody")&&On(i,n.children.indexOf(i),n)?!1:!!(r&&r.type==="element"&&r.tagName==="tr")}const gt={name:[[`
|
|
3
3
|
\f\r &/=>`.split(""),`
|
|
4
4
|
\f\r "&'/=>\``.split("")],[`\0
|
|
5
5
|
\f\r "&'/<=>`.split(""),`\0
|