UNPKG

hljs-mermaid

Version:

Highlight.js / lowlight grammar for Mermaid diagrams. Enables syntax highlighting in editors like Tiptap with @tiptap/extension-code-block-lowlight.

15 lines 329 kB
"use strict";var od=Object.create;var Xn=Object.defineProperty;var ad=Object.getOwnPropertyDescriptor;var cd=Object.getOwnPropertyNames;var ld=Object.getPrototypeOf,ud=Object.prototype.hasOwnProperty;var fd=(e,t,n)=>t in e?Xn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ka=(e,t)=>()=>(e&&(t=e(e=0)),t);var kt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),hd=(e,t)=>{for(var n in t)Xn(e,n,{get:t[n],enumerable:!0})},dd=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of cd(t))!ud.call(e,i)&&i!==n&&Xn(e,i,{get:()=>t[i],enumerable:!(r=ad(t,i))||r.enumerable});return e};var Ri=(e,t,n)=>(n=e!=null?od(ld(e)):{},dd(t||!e||!e.__esModule?Xn(n,"default",{value:e,enumerable:!0}):n,e));var Z=(e,t,n)=>fd(e,typeof t!="symbol"?t+"":t,n);var Bu=kt((Z0,Fu)=>{"use strict";var ju,Yr,Zr,Qr,ei,ti,$n,Co,Pn,ni,Lu,ri,kn,ii,si,oi,Jt,Du,ai,ci,fy;ii=/\/(?![*\/])(?:\[(?:[^\]\\\n\r\u2028\u2029]+|\\.)*\]?|[^\/[\\\n\r\u2028\u2029]+|\\.)*(\/[$_\u200C\u200D\p{ID_Continue}]*|\\)?/yu;kn=/--|\+\+|=>|\.{3}|\??\.(?!\d)|(?:&&|\|\||\?\?|[+\-%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2}|\/(?![\/*]))=?|[?~,:;[\](){}]/y;Yr=/(\x23?)(?=[$_\p{ID_Start}\\])(?:[$_\u200C\u200D\p{ID_Continue}]+|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+/yu;oi=/(['"])(?:[^'"\\\n\r]+|(?!\1)['"]|\\(?:\r\n|[^]))*(\1)?/y;ri=/(?:0[xX][\da-fA-F](?:_?[\da-fA-F])*|0[oO][0-7](?:_?[0-7])*|0[bB][01](?:_?[01])*)n?|0n|[1-9](?:_?\d)*n|(?:(?:0(?!\d)|0\d*[89]\d*|[1-9](?:_?\d)*)(?:\.(?:\d(?:_?\d)*)?)?|\.\d(?:_?\d)*)(?:[eE][+-]?\d(?:_?\d)*)?|0[0-7]+/y;Jt=/[`}](?:[^`\\$]+|\\[^]|\$(?!\{))*(`|\$\{)?/y;ci=/[\t\v\f\ufeff\p{Zs}]+/yu;Pn=/\r?\n|[\r\u2028\u2029]/y;ni=/\/\*(?:[^*]+|\*(?!\/))*(\*\/)?/y;si=/\/\/.*/y;ju=/^#!.*/;Qr=/[<>.:={}]|\/(?![\/*])/y;Zr=/[$_\p{ID_Start}][$_\u200C\u200D\p{ID_Continue}-]*/yu;ei=/(['"])(?:[^'"]+|(?!\1)['"])*(\1)?/y;ti=/[^<>{}]+/y;ai=/^(?:[\/+-]|\.{3}|\?(?:InterpolationIn(?:JSX|Template)|NoLineTerminatorHere|NonExpressionParenEnd|UnaryIncDec))?$|[{}([,;<>=*%&|^!~?:]$/;Du=/^(?:=>|[;\]){}]|else|\?(?:NoLineTerminatorHere|NonExpressionParenEnd))?$/;$n=/^(?:await|case|default|delete|do|else|instanceof|new|return|throw|typeof|void|yield)$/;Co=/^(?:return|throw|yield)$/;Lu=RegExp(Pn.source);Fu.exports=fy=function*(e,{jsx:t=!1}={}){var n,r,i,s,o,a,c,l,u,f,p,h,m,d;for({length:a}=e,s=0,o="",d=[{tag:"JS"}],n=[],p=0,h=!1,(c=ju.exec(e))&&(yield{type:"HashbangComment",value:c[0]},s=c[0].length);s<a;){switch(l=d[d.length-1],l.tag){case"JS":case"JSNonExpressionParen":case"InterpolationInTemplate":case"InterpolationInJSX":if(e[s]==="/"&&(ai.test(o)||$n.test(o))&&(ii.lastIndex=s,c=ii.exec(e))){s=ii.lastIndex,o=c[0],h=!0,yield{type:"RegularExpressionLiteral",value:c[0],closed:c[1]!==void 0&&c[1]!=="\\"};continue}if(kn.lastIndex=s,c=kn.exec(e)){switch(m=c[0],u=kn.lastIndex,f=m,m){case"(":o==="?NonExpressionParenKeyword"&&d.push({tag:"JSNonExpressionParen",nesting:p}),p++,h=!1;break;case")":p--,h=!0,l.tag==="JSNonExpressionParen"&&p===l.nesting&&(d.pop(),f="?NonExpressionParenEnd",h=!1);break;case"{":kn.lastIndex=0,i=!Du.test(o)&&(ai.test(o)||$n.test(o)),n.push(i),h=!1;break;case"}":switch(l.tag){case"InterpolationInTemplate":if(n.length===l.nesting){Jt.lastIndex=s,c=Jt.exec(e),s=Jt.lastIndex,o=c[0],c[1]==="${"?(o="?InterpolationInTemplate",h=!1,yield{type:"TemplateMiddle",value:c[0]}):(d.pop(),h=!0,yield{type:"TemplateTail",value:c[0],closed:c[1]==="`"});continue}break;case"InterpolationInJSX":if(n.length===l.nesting){d.pop(),s+=1,o="}",yield{type:"JSXPunctuator",value:"}"};continue}}h=n.pop(),f=h?"?ExpressionBraceEnd":"}";break;case"]":h=!0;break;case"++":case"--":f=h?"?PostfixIncDec":"?UnaryIncDec";break;case"<":if(t&&(ai.test(o)||$n.test(o))){d.push({tag:"JSXTag"}),s+=1,o="<",yield{type:"JSXPunctuator",value:m};continue}h=!1;break;default:h=!1}s=u,o=f,yield{type:"Punctuator",value:m};continue}if(Yr.lastIndex=s,c=Yr.exec(e)){switch(s=Yr.lastIndex,f=c[0],c[0]){case"for":case"if":case"while":case"with":o!=="."&&o!=="?."&&(f="?NonExpressionParenKeyword")}o=f,h=!$n.test(c[0]),yield{type:c[1]==="#"?"PrivateIdentifier":"IdentifierName",value:c[0]};continue}if(oi.lastIndex=s,c=oi.exec(e)){s=oi.lastIndex,o=c[0],h=!0,yield{type:"StringLiteral",value:c[0],closed:c[2]!==void 0};continue}if(ri.lastIndex=s,c=ri.exec(e)){s=ri.lastIndex,o=c[0],h=!0,yield{type:"NumericLiteral",value:c[0]};continue}if(Jt.lastIndex=s,c=Jt.exec(e)){s=Jt.lastIndex,o=c[0],c[1]==="${"?(o="?InterpolationInTemplate",d.push({tag:"InterpolationInTemplate",nesting:n.length}),h=!1,yield{type:"TemplateHead",value:c[0]}):(h=!0,yield{type:"NoSubstitutionTemplate",value:c[0],closed:c[1]==="`"});continue}break;case"JSXTag":case"JSXTagEnd":if(Qr.lastIndex=s,c=Qr.exec(e)){switch(s=Qr.lastIndex,f=c[0],c[0]){case"<":d.push({tag:"JSXTag"});break;case">":d.pop(),o==="/"||l.tag==="JSXTagEnd"?(f="?JSX",h=!0):d.push({tag:"JSXChildren"});break;case"{":d.push({tag:"InterpolationInJSX",nesting:n.length}),f="?InterpolationInJSX",h=!1;break;case"/":o==="<"&&(d.pop(),d[d.length-1].tag==="JSXChildren"&&d.pop(),d.push({tag:"JSXTagEnd"}))}o=f,yield{type:"JSXPunctuator",value:c[0]};continue}if(Zr.lastIndex=s,c=Zr.exec(e)){s=Zr.lastIndex,o=c[0],yield{type:"JSXIdentifier",value:c[0]};continue}if(ei.lastIndex=s,c=ei.exec(e)){s=ei.lastIndex,o=c[0],yield{type:"JSXString",value:c[0],closed:c[2]!==void 0};continue}break;case"JSXChildren":if(ti.lastIndex=s,c=ti.exec(e)){s=ti.lastIndex,o=c[0],yield{type:"JSXText",value:c[0]};continue}switch(e[s]){case"<":d.push({tag:"JSXTag"}),s++,o="<",yield{type:"JSXPunctuator",value:"<"};continue;case"{":d.push({tag:"InterpolationInJSX",nesting:n.length}),s++,o="?InterpolationInJSX",h=!1,yield{type:"JSXPunctuator",value:"{"};continue}}if(ci.lastIndex=s,c=ci.exec(e)){s=ci.lastIndex,yield{type:"WhiteSpace",value:c[0]};continue}if(Pn.lastIndex=s,c=Pn.exec(e)){s=Pn.lastIndex,h=!1,Co.test(o)&&(o="?NoLineTerminatorHere"),yield{type:"LineTerminatorSequence",value:c[0]};continue}if(ni.lastIndex=s,c=ni.exec(e)){s=ni.lastIndex,Lu.test(c[0])&&(h=!1,Co.test(o)&&(o="?NoLineTerminatorHere")),yield{type:"MultiLineComment",value:c[0],closed:c[1]!==void 0};continue}if(si.lastIndex=s,c=si.exec(e)){s=si.lastIndex,h=!1,yield{type:"SingleLineComment",value:c[0]};continue}r=String.fromCodePoint(e.codePointAt(s)),s+=r.length,o=r,h=!1,yield{type:l.tag.startsWith("JSX")?"JSXInvalid":"Invalid",value:r}}}});function Ln(e,t,n){let r=t-n;r=r<0?-r<<1|1:r<<1;do{let i=r&31;r>>>=5,r>0&&(i|=32),e.write(Sf[i])}while(r>0);return t}function Ef(e){let t=new Qy,n=0,r=0,i=0,s=0;for(let o=0;o<e.length;o++){let a=e[o];if(o>0&&t.write(Yy),a.length===0)continue;let c=0;for(let l=0;l<a.length;l++){let u=a[l];l>0&&t.write(Hy),c=Ln(t,u[0],c),u.length!==1&&(n=Ln(t,u[1],n),r=Ln(t,u[2],r),i=Ln(t,u[3],i),u.length!==4&&(s=Ln(t,u[4],s)))}}return t.flush()}var Hy,Yy,yf,Sf,Zy,bf,wf,Qy,xf=ka(()=>{"use strict";Hy=44,Yy=59,yf="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Sf=new Uint8Array(64),Zy=new Uint8Array(128);for(let e=0;e<yf.length;e++){let t=yf.charCodeAt(e);Sf[e]=t,Zy[t]=e}bf=1024*16,wf=typeof TextDecoder!="undefined"?new TextDecoder:typeof Buffer!="undefined"?{decode(e){return Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString()}}:{decode(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return t}},Qy=class{constructor(){this.pos=0,this.out="",this.buffer=new Uint8Array(bf)}write(e){let{buffer:t}=this;t[this.pos++]=e,this.pos===bf&&(this.out+=wf.decode(t),this.pos=0)}flush(){let{buffer:e,out:t,pos:n}=this;return n>0?t+wf.decode(e.subarray(0,n)):t}}});var Cf={};hd(Cf,{Bundle:()=>qo,SourceMap:()=>Fn,default:()=>Bn});function eb(){return typeof globalThis!="undefined"&&typeof globalThis.btoa=="function"?e=>globalThis.btoa(unescape(encodeURIComponent(e))):typeof Buffer=="function"?e=>Buffer.from(e,"utf-8").toString("base64"):()=>{throw new Error("Unsupported environment: `window.btoa` or `Buffer` should be supported.")}}function nb(e){let t=e.split(` `),n=t.filter(s=>/^\t+/.test(s)),r=t.filter(s=>/^ {2,}/.test(s));if(n.length===0&&r.length===0)return null;if(n.length>=r.length)return" ";let i=r.reduce((s,o)=>{let a=/^ +/.exec(o)[0].length;return Math.min(a,s)},1/0);return new Array(i+1).join(" ")}function vf(e,t){let n=e.split(/[/\\]/),r=t.split(/[/\\]/);for(n.pop();n[0]===r[0];)n.shift(),r.shift();if(n.length){let i=n.length;for(;i--;)n[i]=".."}return n.concat(r).join("/")}function _f(e){return rb.call(e)==="[object Object]"}function Bo(e){let t=e.split(` `),n=[];for(let r=0,i=0;r<t.length;r++)n.push(i),i+=t[r].length+1;return function(i){let s=0,o=n.length;for(;s<o;){let l=s+o>>1;i<n[l]?o=l:s=l+1}let a=s-1,c=i-n[a];return{line:a,column:c}}}var gi,yi,tb,Fn,rb,ib,bi,Dn,an,Bn,Tf,qo,Of=ka(()=>{"use strict";xf();gi=class e{constructor(t){this.bits=t instanceof e?t.bits.slice():[]}add(t){this.bits[t>>5]|=1<<(t&31)}has(t){return!!(this.bits[t>>5]&1<<(t&31))}},yi=class e{constructor(t,n,r){this.start=t,this.end=n,this.original=r,this.intro="",this.outro="",this.content=r,this.storeName=!1,this.edited=!1,this.previous=null,this.next=null}appendLeft(t){this.outro+=t}appendRight(t){this.intro=this.intro+t}clone(){let t=new e(this.start,this.end,this.original);return t.intro=this.intro,t.outro=this.outro,t.content=this.content,t.storeName=this.storeName,t.edited=this.edited,t}contains(t){return this.start<t&&t<this.end}eachNext(t){let n=this;for(;n;)t(n),n=n.next}eachPrevious(t){let n=this;for(;n;)t(n),n=n.previous}edit(t,n,r){return this.content=t,r||(this.intro="",this.outro=""),this.storeName=n,this.edited=!0,this}prependLeft(t){this.outro=t+this.outro}prependRight(t){this.intro=t+this.intro}reset(){this.intro="",this.outro="",this.edited&&(this.content=this.original,this.storeName=!1,this.edited=!1)}split(t){let n=t-this.start,r=this.original.slice(0,n),i=this.original.slice(n);this.original=r;let s=new e(t,this.end,i);return s.outro=this.outro,this.outro="",this.end=t,this.edited?(s.edit("",!1),this.content=""):this.content=r,s.next=this.next,s.next&&(s.next.previous=s),s.previous=this,this.next=s,s}toString(){return this.intro+this.content+this.outro}trimEnd(t){if(this.outro=this.outro.replace(t,""),this.outro.length)return!0;let n=this.content.replace(t,"");if(n.length)return n!==this.content&&(this.split(this.start+n.length).edit("",void 0,!0),this.edited&&this.edit(n,this.storeName,!0)),!0;if(this.edit("",void 0,!0),this.intro=this.intro.replace(t,""),this.intro.length)return!0}trimStart(t){if(this.intro=this.intro.replace(t,""),this.intro.length)return!0;let n=this.content.replace(t,"");if(n.length){if(n!==this.content){let r=this.split(this.end-n.length);this.edited&&r.edit(n,this.storeName,!0),this.edit("",void 0,!0)}return!0}else if(this.edit("",void 0,!0),this.outro=this.outro.replace(t,""),this.outro.length)return!0}};tb=eb(),Fn=class{constructor(t){this.version=3,this.file=t.file,this.sources=t.sources,this.sourcesContent=t.sourcesContent,this.names=t.names,this.mappings=Ef(t.mappings),typeof t.x_google_ignoreList!="undefined"&&(this.x_google_ignoreList=t.x_google_ignoreList),typeof t.debugId!="undefined"&&(this.debugId=t.debugId)}toString(){return JSON.stringify(this)}toUrl(){return"data:application/json;charset=utf-8;base64,"+tb(this.toString())}};rb=Object.prototype.toString;ib=/\w/,bi=class{constructor(t){this.hires=t,this.generatedCodeLine=0,this.generatedCodeColumn=0,this.raw=[],this.rawSegments=this.raw[this.generatedCodeLine]=[],this.pending=null}addEdit(t,n,r,i){if(n.length){let s=n.length-1,o=n.indexOf(` `,0),a=-1;for(;o>=0&&s>o;){let l=[this.generatedCodeColumn,t,r.line,r.column];i>=0&&l.push(i),this.rawSegments.push(l),this.generatedCodeLine+=1,this.raw[this.generatedCodeLine]=this.rawSegments=[],this.generatedCodeColumn=0,a=o,o=n.indexOf(` `,o+1)}let c=[this.generatedCodeColumn,t,r.line,r.column];i>=0&&c.push(i),this.rawSegments.push(c),this.advance(n.slice(a+1))}else this.pending&&(this.rawSegments.push(this.pending),this.advance(n));this.pending=null}addUneditedChunk(t,n,r,i,s){let o=n.start,a=!0,c=!1;for(;o<n.end;){if(r[o]===` `)i.line+=1,i.column=0,this.generatedCodeLine+=1,this.raw[this.generatedCodeLine]=this.rawSegments=[],this.generatedCodeColumn=0,a=!0,c=!1;else{if(this.hires||a||s.has(o)){let l=[this.generatedCodeColumn,t,i.line,i.column];this.hires==="boundary"?ib.test(r[o])?c||(this.rawSegments.push(l),c=!0):(this.rawSegments.push(l),c=!1):this.rawSegments.push(l)}i.column+=1,this.generatedCodeColumn+=1,a=!1}o+=1}this.pending=null}advance(t){if(!t)return;let n=t.split(` `);if(n.length>1){for(let r=0;r<n.length-1;r++)this.generatedCodeLine++,this.raw[this.generatedCodeLine]=this.rawSegments=[];this.generatedCodeColumn=0}this.generatedCodeColumn+=n[n.length-1].length}},Dn=` `,an={insertLeft:!1,insertRight:!1,storeName:!1},Bn=class e{constructor(t,n={}){let r=new yi(0,t.length,t);Object.defineProperties(this,{original:{writable:!0,value:t},outro:{writable:!0,value:""},intro:{writable:!0,value:""},firstChunk:{writable:!0,value:r},lastChunk:{writable:!0,value:r},lastSearchedChunk:{writable:!0,value:r},byStart:{writable:!0,value:{}},byEnd:{writable:!0,value:{}},filename:{writable:!0,value:n.filename},indentExclusionRanges:{writable:!0,value:n.indentExclusionRanges},sourcemapLocations:{writable:!0,value:new gi},storedNames:{writable:!0,value:{}},indentStr:{writable:!0,value:void 0},ignoreList:{writable:!0,value:n.ignoreList},offset:{writable:!0,value:n.offset||0}}),this.byStart[0]=r,this.byEnd[t.length]=r}addSourcemapLocation(t){this.sourcemapLocations.add(t)}append(t){if(typeof t!="string")throw new TypeError("outro content must be a string");return this.outro+=t,this}appendLeft(t,n){if(t=t+this.offset,typeof n!="string")throw new TypeError("inserted content must be a string");this._split(t);let r=this.byEnd[t];return r?r.appendLeft(n):this.intro+=n,this}appendRight(t,n){if(t=t+this.offset,typeof n!="string")throw new TypeError("inserted content must be a string");this._split(t);let r=this.byStart[t];return r?r.appendRight(n):this.outro+=n,this}clone(){let t=new e(this.original,{filename:this.filename,offset:this.offset}),n=this.firstChunk,r=t.firstChunk=t.lastSearchedChunk=n.clone();for(;n;){t.byStart[r.start]=r,t.byEnd[r.end]=r;let i=n.next,s=i&&i.clone();s&&(r.next=s,s.previous=r,r=s),n=i}return t.lastChunk=r,this.indentExclusionRanges&&(t.indentExclusionRanges=this.indentExclusionRanges.slice()),t.sourcemapLocations=new gi(this.sourcemapLocations),t.intro=this.intro,t.outro=this.outro,t}generateDecodedMap(t){t=t||{};let n=0,r=Object.keys(this.storedNames),i=new bi(t.hires),s=Bo(this.original);return this.intro&&i.advance(this.intro),this.firstChunk.eachNext(o=>{let a=s(o.start);o.intro.length&&i.advance(o.intro),o.edited?i.addEdit(n,o.content,a,o.storeName?r.indexOf(o.original):-1):i.addUneditedChunk(n,o,this.original,a,this.sourcemapLocations),o.outro.length&&i.advance(o.outro)}),this.outro&&i.advance(this.outro),{file:t.file?t.file.split(/[/\\]/).pop():void 0,sources:[t.source?vf(t.file||"",t.source):t.file||""],sourcesContent:t.includeContent?[this.original]:void 0,names:r,mappings:i.raw,x_google_ignoreList:this.ignoreList?[n]:void 0}}generateMap(t){return new Fn(this.generateDecodedMap(t))}_ensureindentStr(){this.indentStr===void 0&&(this.indentStr=nb(this.original))}_getRawIndentString(){return this._ensureindentStr(),this.indentStr}getIndentString(){return this._ensureindentStr(),this.indentStr===null?" ":this.indentStr}indent(t,n){let r=/^[^\r\n]/gm;if(_f(t)&&(n=t,t=void 0),t===void 0&&(this._ensureindentStr(),t=this.indentStr||" "),t==="")return this;n=n||{};let i={};n.exclude&&(typeof n.exclude[0]=="number"?[n.exclude]:n.exclude).forEach(u=>{for(let f=u[0];f<u[1];f+=1)i[f]=!0});let s=n.indentStart!==!1,o=l=>s?`${t}${l}`:(s=!0,l);this.intro=this.intro.replace(r,o);let a=0,c=this.firstChunk;for(;c;){let l=c.end;if(c.edited)i[a]||(c.content=c.content.replace(r,o),c.content.length&&(s=c.content[c.content.length-1]===` `));else for(a=c.start;a<l;){if(!i[a]){let u=this.original[a];u===` `?s=!0:u!=="\r"&&s&&(s=!1,a===c.start||(this._splitChunk(c,a),c=c.next),c.prependRight(t))}a+=1}a=c.end,c=c.next}return this.outro=this.outro.replace(r,o),this}insert(){throw new Error("magicString.insert(...) is deprecated. Use prependRight(...) or appendLeft(...)")}insertLeft(t,n){return an.insertLeft||(console.warn("magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead"),an.insertLeft=!0),this.appendLeft(t,n)}insertRight(t,n){return an.insertRight||(console.warn("magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead"),an.insertRight=!0),this.prependRight(t,n)}move(t,n,r){if(t=t+this.offset,n=n+this.offset,r=r+this.offset,r>=t&&r<=n)throw new Error("Cannot move a selection inside itself");this._split(t),this._split(n),this._split(r);let i=this.byStart[t],s=this.byEnd[n],o=i.previous,a=s.next,c=this.byStart[r];if(!c&&s===this.lastChunk)return this;let l=c?c.previous:this.lastChunk;return o&&(o.next=a),a&&(a.previous=o),l&&(l.next=i),c&&(c.previous=s),i.previous||(this.firstChunk=s.next),s.next||(this.lastChunk=i.previous,this.lastChunk.next=null),i.previous=l,s.next=c||null,l||(this.firstChunk=i),c||(this.lastChunk=s),this}overwrite(t,n,r,i){return i=i||{},this.update(t,n,r,{...i,overwrite:!i.contentOnly})}update(t,n,r,i){if(t=t+this.offset,n=n+this.offset,typeof r!="string")throw new TypeError("replacement content must be a string");if(this.original.length!==0){for(;t<0;)t+=this.original.length;for(;n<0;)n+=this.original.length}if(n>this.original.length)throw new Error("end is out of bounds");if(t===n)throw new Error("Cannot overwrite a zero-length range \u2013 use appendLeft or prependRight instead");this._split(t),this._split(n),i===!0&&(an.storeName||(console.warn("The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string"),an.storeName=!0),i={storeName:!0});let s=i!==void 0?i.storeName:!1,o=i!==void 0?i.overwrite:!1;if(s){let l=this.original.slice(t,n);Object.defineProperty(this.storedNames,l,{writable:!0,value:!0,enumerable:!0})}let a=this.byStart[t],c=this.byEnd[n];if(a){let l=a;for(;l!==c;){if(l.next!==this.byStart[l.end])throw new Error("Cannot overwrite across a split point");l=l.next,l.edit("",!1)}a.edit(r,s,!o)}else{let l=new yi(t,n,"").edit(r,s);c.next=l,l.previous=c}return this}prepend(t){if(typeof t!="string")throw new TypeError("outro content must be a string");return this.intro=t+this.intro,this}prependLeft(t,n){if(t=t+this.offset,typeof n!="string")throw new TypeError("inserted content must be a string");this._split(t);let r=this.byEnd[t];return r?r.prependLeft(n):this.intro=n+this.intro,this}prependRight(t,n){if(t=t+this.offset,typeof n!="string")throw new TypeError("inserted content must be a string");this._split(t);let r=this.byStart[t];return r?r.prependRight(n):this.outro=n+this.outro,this}remove(t,n){if(t=t+this.offset,n=n+this.offset,this.original.length!==0){for(;t<0;)t+=this.original.length;for(;n<0;)n+=this.original.length}if(t===n)return this;if(t<0||n>this.original.length)throw new Error("Character is out of bounds");if(t>n)throw new Error("end must be greater than start");this._split(t),this._split(n);let r=this.byStart[t];for(;r;)r.intro="",r.outro="",r.edit(""),r=n>r.end?this.byStart[r.end]:null;return this}reset(t,n){if(t=t+this.offset,n=n+this.offset,this.original.length!==0){for(;t<0;)t+=this.original.length;for(;n<0;)n+=this.original.length}if(t===n)return this;if(t<0||n>this.original.length)throw new Error("Character is out of bounds");if(t>n)throw new Error("end must be greater than start");this._split(t),this._split(n);let r=this.byStart[t];for(;r;)r.reset(),r=n>r.end?this.byStart[r.end]:null;return this}lastChar(){if(this.outro.length)return this.outro[this.outro.length-1];let t=this.lastChunk;do{if(t.outro.length)return t.outro[t.outro.length-1];if(t.content.length)return t.content[t.content.length-1];if(t.intro.length)return t.intro[t.intro.length-1]}while(t=t.previous);return this.intro.length?this.intro[this.intro.length-1]:""}lastLine(){let t=this.outro.lastIndexOf(Dn);if(t!==-1)return this.outro.substr(t+1);let n=this.outro,r=this.lastChunk;do{if(r.outro.length>0){if(t=r.outro.lastIndexOf(Dn),t!==-1)return r.outro.substr(t+1)+n;n=r.outro+n}if(r.content.length>0){if(t=r.content.lastIndexOf(Dn),t!==-1)return r.content.substr(t+1)+n;n=r.content+n}if(r.intro.length>0){if(t=r.intro.lastIndexOf(Dn),t!==-1)return r.intro.substr(t+1)+n;n=r.intro+n}}while(r=r.previous);return t=this.intro.lastIndexOf(Dn),t!==-1?this.intro.substr(t+1)+n:this.intro+n}slice(t=0,n=this.original.length-this.offset){if(t=t+this.offset,n=n+this.offset,this.original.length!==0){for(;t<0;)t+=this.original.length;for(;n<0;)n+=this.original.length}let r="",i=this.firstChunk;for(;i&&(i.start>t||i.end<=t);){if(i.start<n&&i.end>=n)return r;i=i.next}if(i&&i.edited&&i.start!==t)throw new Error(`Cannot use replaced character ${t} as slice start anchor.`);let s=i;for(;i;){i.intro&&(s!==i||i.start===t)&&(r+=i.intro);let o=i.start<n&&i.end>=n;if(o&&i.edited&&i.end!==n)throw new Error(`Cannot use replaced character ${n} as slice end anchor.`);let a=s===i?t-i.start:0,c=o?i.content.length+n-i.end:i.content.length;if(r+=i.content.slice(a,c),i.outro&&(!o||i.end===n)&&(r+=i.outro),o)break;i=i.next}return r}snip(t,n){let r=this.clone();return r.remove(0,t),r.remove(n,r.original.length),r}_split(t){if(this.byStart[t]||this.byEnd[t])return;let n=this.lastSearchedChunk,r=n,i=t>n.end;for(;n;){if(n.contains(t))return this._splitChunk(n,t);if(n=i?this.byStart[n.end]:this.byEnd[n.start],n===r)return;r=n}}_splitChunk(t,n){if(t.edited&&t.content.length){let i=Bo(this.original)(n);throw new Error(`Cannot split a chunk that has already been edited (${i.line}:${i.column} \u2013 "${t.original}")`)}let r=t.split(n);return this.byEnd[n]=t,this.byStart[n]=r,this.byEnd[r.end]=r,t===this.lastChunk&&(this.lastChunk=r),this.lastSearchedChunk=t,!0}toString(){let t=this.intro,n=this.firstChunk;for(;n;)t+=n.toString(),n=n.next;return t+this.outro}isEmpty(){let t=this.firstChunk;do if(t.intro.length&&t.intro.trim()||t.content.length&&t.content.trim()||t.outro.length&&t.outro.trim())return!1;while(t=t.next);return!0}length(){let t=this.firstChunk,n=0;do n+=t.intro.length+t.content.length+t.outro.length;while(t=t.next);return n}trimLines(){return this.trim("[\\r\\n]")}trim(t){return this.trimStart(t).trimEnd(t)}trimEndAborted(t){let n=new RegExp((t||"\\s")+"+$");if(this.outro=this.outro.replace(n,""),this.outro.length)return!0;let r=this.lastChunk;do{let i=r.end,s=r.trimEnd(n);if(r.end!==i&&(this.lastChunk===r&&(this.lastChunk=r.next),this.byEnd[r.end]=r,this.byStart[r.next.start]=r.next,this.byEnd[r.next.end]=r.next),s)return!0;r=r.previous}while(r);return!1}trimEnd(t){return this.trimEndAborted(t),this}trimStartAborted(t){let n=new RegExp("^"+(t||"\\s")+"+");if(this.intro=this.intro.replace(n,""),this.intro.length)return!0;let r=this.firstChunk;do{let i=r.end,s=r.trimStart(n);if(r.end!==i&&(r===this.lastChunk&&(this.lastChunk=r.next),this.byEnd[r.end]=r,this.byStart[r.next.start]=r.next,this.byEnd[r.next.end]=r.next),s)return!0;r=r.next}while(r);return!1}trimStart(t){return this.trimStartAborted(t),this}hasChanged(){return this.original!==this.toString()}_replaceRegexp(t,n){function r(s,o){return typeof n=="string"?n.replace(/\$(\$|&|\d+)/g,(a,c)=>c==="$"?"$":c==="&"?s[0]:+c<s.length?s[+c]:`$${c}`):n(...s,s.index,o,s.groups)}function i(s,o){let a,c=[];for(;a=s.exec(o);)c.push(a);return c}if(t.global)i(t,this.original).forEach(o=>{if(o.index!=null){let a=r(o,this.original);a!==o[0]&&this.overwrite(o.index,o.index+o[0].length,a)}});else{let s=this.original.match(t);if(s&&s.index!=null){let o=r(s,this.original);o!==s[0]&&this.overwrite(s.index,s.index+s[0].length,o)}}return this}_replaceString(t,n){let{original:r}=this,i=r.indexOf(t);return i!==-1&&(typeof n=="function"&&(n=n(t,i,r)),t!==n&&this.overwrite(i,i+t.length,n)),this}replace(t,n){return typeof t=="string"?this._replaceString(t,n):this._replaceRegexp(t,n)}_replaceAllString(t,n){let{original:r}=this,i=t.length;for(let s=r.indexOf(t);s!==-1;s=r.indexOf(t,s+i)){let o=r.slice(s,s+i),a=n;typeof n=="function"&&(a=n(o,s,r)),o!==a&&this.overwrite(s,s+i,a)}return this}replaceAll(t,n){if(typeof t=="string")return this._replaceAllString(t,n);if(!t.global)throw new TypeError("MagicString.prototype.replaceAll called with a non-global RegExp argument");return this._replaceRegexp(t,n)}},Tf=Object.prototype.hasOwnProperty,qo=class e{constructor(t={}){this.intro=t.intro||"",this.separator=t.separator!==void 0?t.separator:` `,this.sources=[],this.uniqueSources=[],this.uniqueSourceIndexByFilename={}}addSource(t){if(t instanceof Bn)return this.addSource({content:t,filename:t.filename,separator:this.separator});if(!_f(t)||!t.content)throw new Error("bundle.addSource() takes an object with a `content` property, which should be an instance of MagicString, and an optional `filename`");if(["filename","ignoreList","indentExclusionRanges","separator"].forEach(n=>{Tf.call(t,n)||(t[n]=t.content[n])}),t.separator===void 0&&(t.separator=this.separator),t.filename)if(!Tf.call(this.uniqueSourceIndexByFilename,t.filename))this.uniqueSourceIndexByFilename[t.filename]=this.uniqueSources.length,this.uniqueSources.push({filename:t.filename,content:t.content.original});else{let n=this.uniqueSources[this.uniqueSourceIndexByFilename[t.filename]];if(t.content.original!==n.content)throw new Error(`Illegal source: same filename (${t.filename}), different contents`)}return this.sources.push(t),this}append(t,n){return this.addSource({content:new Bn(t),separator:n&&n.separator||""}),this}clone(){let t=new e({intro:this.intro,separator:this.separator});return this.sources.forEach(n=>{t.addSource({filename:n.filename,content:n.content.clone(),separator:n.separator})}),t}generateDecodedMap(t={}){let n=[],r;this.sources.forEach(s=>{Object.keys(s.content.storedNames).forEach(o=>{~n.indexOf(o)||n.push(o)})});let i=new bi(t.hires);return this.intro&&i.advance(this.intro),this.sources.forEach((s,o)=>{o>0&&i.advance(this.separator);let a=s.filename?this.uniqueSourceIndexByFilename[s.filename]:-1,c=s.content,l=Bo(c.original);c.intro&&i.advance(c.intro),c.firstChunk.eachNext(u=>{let f=l(u.start);u.intro.length&&i.advance(u.intro),s.filename?u.edited?i.addEdit(a,u.content,f,u.storeName?n.indexOf(u.original):-1):i.addUneditedChunk(a,u,c.original,f,c.sourcemapLocations):i.advance(u.content),u.outro.length&&i.advance(u.outro)}),c.outro&&i.advance(c.outro),s.ignoreList&&a!==-1&&(r===void 0&&(r=[]),r.push(a))}),{file:t.file?t.file.split(/[/\\]/).pop():void 0,sources:this.uniqueSources.map(s=>t.file?vf(t.file,s.filename):s.filename),sourcesContent:this.uniqueSources.map(s=>t.includeContent?s.content:null),names:n,mappings:i.raw,x_google_ignoreList:r}}generateMap(t){return new Fn(this.generateDecodedMap(t))}getIndentString(){let t={};return this.sources.forEach(n=>{let r=n.content._getRawIndentString();r!==null&&(t[r]||(t[r]=0),t[r]+=1)}),Object.keys(t).sort((n,r)=>t[n]-t[r])[0]||" "}indent(t){if(arguments.length||(t=this.getIndentString()),t==="")return this;let n=!this.intro||this.intro.slice(-1)===` `;return this.sources.forEach((r,i)=>{let s=r.separator!==void 0?r.separator:this.separator,o=n||i>0&&/\r?\n$/.test(s);r.content.indent(t,{exclude:r.indentExclusionRanges,indentStart:o}),n=r.content.lastChar()===` `}),this.intro&&(this.intro=t+this.intro.replace(/^[^\n]/gm,(r,i)=>i>0?t+r:r)),this}prepend(t){return this.intro=t+this.intro,this}toString(){let t=this.sources.map((n,r)=>{let i=n.separator!==void 0?n.separator:this.separator;return(r>0?i:"")+n.content.toString()}).join("");return this.intro+t}isEmpty(){return!(this.intro.length&&this.intro.trim()||this.sources.some(t=>!t.content.isEmpty()))}length(){return this.sources.reduce((t,n)=>t+n.content.length(),this.intro.length)}trimLines(){return this.trim("[\\r\\n]")}trim(t){return this.trimStart(t).trimEnd(t)}trimStart(t){let n=new RegExp("^"+(t||"\\s")+"+");if(this.intro=this.intro.replace(n,""),!this.intro){let r,i=0;do if(r=this.sources[i++],!r)break;while(!r.content.trimStartAborted(t))}return this}trimEnd(t){let n=new RegExp((t||"\\s")+"+$"),r,i=this.sources.length-1;do if(r=this.sources[i--],!r){this.intro=this.intro.replace(n,"");break}while(!r.content.trimEndAborted(t));return this}}});var Mh=kt(Ah=>{"use strict";Object.defineProperty(Ah,"__esModule",{value:!0})});var $h=kt(Nh=>{"use strict";Object.defineProperty(Nh,"__esModule",{value:!0});var _T=Symbol("inverted"),CT=Symbol("expectNull"),OT=Symbol("expectUndefined"),IT=Symbol("expectNumber"),AT=Symbol("expectString"),MT=Symbol("expectBoolean"),NT=Symbol("expectVoid"),$T=Symbol("expectFunction"),kT=Symbol("expectObject"),PT=Symbol("expectArray"),RT=Symbol("expectSymbol"),jT=Symbol("expectAny"),LT=Symbol("expectUnknown"),DT=Symbol("expectNever"),FT=Symbol("expectNullable"),BT=Symbol("expectBigInt")});var Ph=kt(kh=>{"use strict";Object.defineProperty(kh,"__esModule",{value:!0})});var jh=kt(Rh=>{"use strict";Object.defineProperty(Rh,"__esModule",{value:!0});var UT=Symbol("secret"),WT=Symbol("mismatch"),JT=Symbol("avalue")});var Lh=kt(_e=>{"use strict";var mS=_e&&_e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),Ii=_e&&_e.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&mS(t,e,n)};Object.defineProperty(_e,"__esModule",{value:!0});_e.expectTypeOf=void 0;Ii(Mh(),_e);Ii($h(),_e);Ii(Ph(),_e);Ii(jh(),_e);var Ie=()=>!0,gS=e=>{let t=["parameters","returns","resolves","not","items","constructorParameters","thisParameter","instance","guards","asserts","branded"],n={toBeAny:Ie,toBeUnknown:Ie,toBeNever:Ie,toBeFunction:Ie,toBeObject:Ie,toBeArray:Ie,toBeString:Ie,toBeNumber:Ie,toBeBoolean:Ie,toBeVoid:Ie,toBeSymbol:Ie,toBeNull:Ie,toBeUndefined:Ie,toBeNullable:Ie,toBeBigInt:Ie,toMatchTypeOf:Ie,toEqualTypeOf:Ie,toBeConstructibleWith:Ie,toMatchObjectType:Ie,toExtend:Ie,map:_e.expectTypeOf,toBeCallableWith:_e.expectTypeOf,extract:_e.expectTypeOf,exclude:_e.expectTypeOf,pick:_e.expectTypeOf,omit:_e.expectTypeOf,toHaveProperty:_e.expectTypeOf,parameter:_e.expectTypeOf};return t.forEach(i=>Object.defineProperty(n,i,{get:()=>(0,_e.expectTypeOf)({})})),n};_e.expectTypeOf=gS});var id=kt((tv,rd)=>{"use strict";function Jh(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{let n=e[t],r=typeof n;(r==="object"||r==="function")&&!Object.isFrozen(n)&&Jh(n)}),e}var Mi=class{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function Vh(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function $t(e,...t){let n=Object.create(null);for(let r in e)n[r]=e[r];return t.forEach(function(r){for(let i in r)n[i]=r[i]}),n}var bS="</span>",Fh=e=>!!e.scope,wS=(e,{prefix:t})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){let n=e.split(".");return[`${t}${n.shift()}`,...n.map((r,i)=>`${r}${"_".repeat(i+1)}`)].join(" ")}return`${t}${e}`},va=class{constructor(t,n){this.buffer="",this.classPrefix=n.classPrefix,t.walk(this)}addText(t){this.buffer+=Vh(t)}openNode(t){if(!Fh(t))return;let n=wS(t.scope,{prefix:this.classPrefix});this.span(n)}closeNode(t){Fh(t)&&(this.buffer+=bS)}value(){return this.buffer}span(t){this.buffer+=`<span class="${t}">`}},Bh=(e={})=>{let t={children:[]};return Object.assign(t,e),t},_a=class e{constructor(){this.rootNode=Bh(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(t){this.top.children.push(t)}openNode(t){let n=Bh({scope:t});this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(t){return this.constructor._walk(t,this.rootNode)}static _walk(t,n){return typeof n=="string"?t.addText(n):n.children&&(t.openNode(n),n.children.forEach(r=>this._walk(t,r)),t.closeNode(n)),t}static _collapse(t){typeof t!="string"&&t.children&&(t.children.every(n=>typeof n=="string")?t.children=[t.children.join("")]:t.children.forEach(n=>{e._collapse(n)}))}},Ca=class extends _a{constructor(t){super(),this.options=t}addText(t){t!==""&&this.add(t)}startScope(t){this.openNode(t)}endScope(){this.closeNode()}__addSublanguage(t,n){let r=t.root;n&&(r.scope=`language:${n}`),this.add(r)}toHTML(){return new va(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function Jn(e){return e?typeof e=="string"?e:e.source:null}function Xh(e){return Gt("(?=",e,")")}function SS(e){return Gt("(?:",e,")*")}function ES(e){return Gt("(?:",e,")?")}function Gt(...e){return e.map(n=>Jn(n)).join("")}function xS(e){let t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function Ia(...e){return"("+(xS(e).capture?"":"?:")+e.map(r=>Jn(r)).join("|")+")"}function Kh(e){return new RegExp(e.toString()+"|").exec("").length-1}function TS(e,t){let n=e&&e.exec(t);return n&&n.index===0}var vS=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Aa(e,{joinWith:t}){let n=0;return e.map(r=>{n+=1;let i=n,s=Jn(r),o="";for(;s.length>0;){let a=vS.exec(s);if(!a){o+=s;break}o+=s.substring(0,a.index),s=s.substring(a.index+a[0].length),a[0][0]==="\\"&&a[1]?o+="\\"+String(Number(a[1])+i):(o+=a[0],a[0]==="("&&n++)}return o}).map(r=>`(${r})`).join(t)}var _S=/\b\B/,Gh="[a-zA-Z]\\w*",Ma="[a-zA-Z_]\\w*",Hh="\\b\\d+(\\.\\d+)?",Yh="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Zh="\\b(0b[01]+)",CS="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",OS=(e={})=>{let t=/^#![ ]*\//;return e.binary&&(e.begin=Gt(t,/.*\b/,e.binary,/\b.*/)),$t({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},e)},Vn={begin:"\\\\[\\s\\S]",relevance:0},IS={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Vn]},AS={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Vn]},MS={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},$i=function(e,t,n={}){let r=$t({scope:"comment",begin:e,end:t,contains:[]},n);r.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let i=Ia("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:Gt(/[ ]+/,"(",i,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},NS=$i("//","$"),$S=$i("/\\*","\\*/"),kS=$i("#","$"),PS={scope:"number",begin:Hh,relevance:0},RS={scope:"number",begin:Yh,relevance:0},jS={scope:"number",begin:Zh,relevance:0},LS={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Vn,{begin:/\[/,end:/\]/,relevance:0,contains:[Vn]}]},DS={scope:"title",begin:Gh,relevance:0},FS={scope:"title",begin:Ma,relevance:0},BS={begin:"\\.\\s*"+Ma,relevance:0},qS=function(e){return Object.assign(e,{"on:begin":(t,n)=>{n.data._beginMatch=t[1]},"on:end":(t,n)=>{n.data._beginMatch!==t[1]&&n.ignoreMatch()}})},Ai=Object.freeze({__proto__:null,APOS_STRING_MODE:IS,BACKSLASH_ESCAPE:Vn,BINARY_NUMBER_MODE:jS,BINARY_NUMBER_RE:Zh,COMMENT:$i,C_BLOCK_COMMENT_MODE:$S,C_LINE_COMMENT_MODE:NS,C_NUMBER_MODE:RS,C_NUMBER_RE:Yh,END_SAME_AS_BEGIN:qS,HASH_COMMENT_MODE:kS,IDENT_RE:Gh,MATCH_NOTHING_RE:_S,METHOD_GUARD:BS,NUMBER_MODE:PS,NUMBER_RE:Hh,PHRASAL_WORDS_MODE:MS,QUOTE_STRING_MODE:AS,REGEXP_MODE:LS,RE_STARTERS_RE:CS,SHEBANG:OS,TITLE_MODE:DS,UNDERSCORE_IDENT_RE:Ma,UNDERSCORE_TITLE_MODE:FS});function zS(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function US(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function WS(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=zS,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function JS(e,t){Array.isArray(e.illegal)&&(e.illegal=Ia(...e.illegal))}function VS(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function XS(e,t){e.relevance===void 0&&(e.relevance=1)}var KS=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");let n=Object.assign({},e);Object.keys(e).forEach(r=>{delete e[r]}),e.keywords=n.keywords,e.begin=Gt(n.beforeMatch,Xh(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},GS=["of","and","for","in","not","or","if","then","parent","list","value"],HS="keyword";function Qh(e,t,n=HS){let r=Object.create(null);return typeof e=="string"?i(n,e.split(" ")):Array.isArray(e)?i(n,e):Object.keys(e).forEach(function(s){Object.assign(r,Qh(e[s],t,s))}),r;function i(s,o){t&&(o=o.map(a=>a.toLowerCase())),o.forEach(function(a){let c=a.split("|");r[c[0]]=[s,YS(c[0],c[1])]})}}function YS(e,t){return t?Number(t):ZS(e)?0:1}function ZS(e){return GS.includes(e.toLowerCase())}var qh={},Kt=e=>{console.error(e)},zh=(e,...t)=>{console.log(`WARN: ${e}`,...t)},fn=(e,t)=>{qh[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),qh[`${e}/${t}`]=!0)},Ni=new Error;function ed(e,t,{key:n}){let r=0,i=e[n],s={},o={};for(let a=1;a<=t.length;a++)o[a+r]=i[a],s[a+r]=!0,r+=Kh(t[a-1]);e[n]=o,e[n]._emit=s,e[n]._multi=!0}function QS(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw Kt("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Ni;if(typeof e.beginScope!="object"||e.beginScope===null)throw Kt("beginScope must be object"),Ni;ed(e,e.begin,{key:"beginScope"}),e.begin=Aa(e.begin,{joinWith:""})}}function eE(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw Kt("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Ni;if(typeof e.endScope!="object"||e.endScope===null)throw Kt("endScope must be object"),Ni;ed(e,e.end,{key:"endScope"}),e.end=Aa(e.end,{joinWith:""})}}function tE(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function nE(e){tE(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),QS(e),eE(e)}function rE(e){function t(o,a){return new RegExp(Jn(o),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(a?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(a,c){c.position=this.position++,this.matchIndexes[this.matchAt]=c,this.regexes.push([c,a]),this.matchAt+=Kh(a)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);let a=this.regexes.map(c=>c[1]);this.matcherRe=t(Aa(a,{joinWith:"|"}),!0),this.lastIndex=0}exec(a){this.matcherRe.lastIndex=this.lastIndex;let c=this.matcherRe.exec(a);if(!c)return null;let l=c.findIndex((f,p)=>p>0&&f!==void 0),u=this.matchIndexes[l];return c.splice(0,l),Object.assign(c,u)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(a){if(this.multiRegexes[a])return this.multiRegexes[a];let c=new n;return this.rules.slice(a).forEach(([l,u])=>c.addRule(l,u)),c.compile(),this.multiRegexes[a]=c,c}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(a,c){this.rules.push([a,c]),c.type==="begin"&&this.count++}exec(a){let c=this.getMatcher(this.regexIndex);c.lastIndex=this.lastIndex;let l=c.exec(a);if(this.resumingScanAtSamePosition()&&!(l&&l.index===this.lastIndex)){let u=this.getMatcher(0);u.lastIndex=this.lastIndex+1,l=u.exec(a)}return l&&(this.regexIndex+=l.position+1,this.regexIndex===this.count&&this.considerAll()),l}}function i(o){let a=new r;return o.contains.forEach(c=>a.addRule(c.begin,{rule:c,type:"begin"})),o.terminatorEnd&&a.addRule(o.terminatorEnd,{type:"end"}),o.illegal&&a.addRule(o.illegal,{type:"illegal"}),a}function s(o,a){let c=o;if(o.isCompiled)return c;[US,VS,nE,KS].forEach(u=>u(o,a)),e.compilerExtensions.forEach(u=>u(o,a)),o.__beforeBegin=null,[WS,JS,XS].forEach(u=>u(o,a)),o.isCompiled=!0;let l=null;return typeof o.keywords=="object"&&o.keywords.$pattern&&(o.keywords=Object.assign({},o.keywords),l=o.keywords.$pattern,delete o.keywords.$pattern),l=l||/\w+/,o.keywords&&(o.keywords=Qh(o.keywords,e.case_insensitive)),c.keywordPatternRe=t(l,!0),a&&(o.begin||(o.begin=/\B|\b/),c.beginRe=t(c.begin),!o.end&&!o.endsWithParent&&(o.end=/\B|\b/),o.end&&(c.endRe=t(c.end)),c.terminatorEnd=Jn(c.end)||"",o.endsWithParent&&a.terminatorEnd&&(c.terminatorEnd+=(o.end?"|":"")+a.terminatorEnd)),o.illegal&&(c.illegalRe=t(o.illegal)),o.contains||(o.contains=[]),o.contains=[].concat(...o.contains.map(function(u){return iE(u==="self"?o:u)})),o.contains.forEach(function(u){s(u,c)}),o.starts&&s(o.starts,a),c.matcher=i(c),c}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=$t(e.classNameAliases||{}),s(e)}function td(e){return e?e.endsWithParent||td(e.starts):!1}function iE(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return $t(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:td(e)?$t(e,{starts:e.starts?$t(e.starts):null}):Object.isFrozen(e)?$t(e):e}var sE="11.11.1",Oa=class extends Error{constructor(t,n){super(t),this.name="HTMLInjectionError",this.html=n}},Ta=Vh,Uh=$t,Wh=Symbol("nomatch"),oE=7,nd=function(e){let t=Object.create(null),n=Object.create(null),r=[],i=!0,s="Could not find the language '{}', did you forget to load/include a language module?",o={disableAutodetect:!0,name:"Plain text",contains:[]},a={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:Ca};function c(T){return a.noHighlightRe.test(T)}function l(T){let F=T.className+" ";F+=T.parentNode?T.parentNode.className:"";let R=a.languageDetectRe.exec(F);if(R){let X=I(R[1]);return X||(zh(s.replace("{}",R[1])),zh("Falling back to no-highlight mode for this block.",T)),X?R[1]:"no-highlight"}return F.split(/\s+/).find(X=>c(X)||I(X))}function u(T,F,R){let X="",re="";typeof F=="object"?(X=T,R=F.ignoreIllegals,re=F.language):(fn("10.7.0","highlight(lang, code, ...args) has been deprecated."),fn("10.7.0",`Please use highlight(code, options) instead. https://github.com/highlightjs/highlight.js/issues/2277`),re=T,X=F),R===void 0&&(R=!0);let ge={code:X,language:re};Y("before:highlight",ge);let de=ge.result?ge.result:f(ge.language,ge.code,R);return de.code=ge.code,Y("after:highlight",de),de}function f(T,F,R,X){let re=Object.create(null);function ge(M,k){return M.keywords[k]}function de(){if(!P.keywords){U.addText(W);return}let M=0;P.keywordPatternRe.lastIndex=0;let k=P.keywordPatternRe.exec(W),z="";for(;k;){z+=W.substring(M,k.index);let K=E.case_insensitive?k[0].toLowerCase():k[0],pe=ge(P,K);if(pe){let[xe,Oe]=pe;if(U.addText(z),z="",re[K]=(re[K]||0)+1,re[K]<=oE&&(ee+=Oe),xe.startsWith("_"))z+=k[0];else{let je=E.classNameAliases[xe]||xe;be(k[0],je)}}else z+=k[0];M=P.keywordPatternRe.lastIndex,k=P.keywordPatternRe.exec(W)}z+=W.substring(M),U.addText(z)}function Ee(){if(W==="")return;let M=null;if(typeof P.subLanguage=="string"){if(!t[P.subLanguage]){U.addText(W);return}M=f(P.subLanguage,W,!0,w[P.subLanguage]),w[P.subLanguage]=M._top}else M=h(W,P.subLanguage.length?P.subLanguage:null);P.relevance>0&&(ee+=M.relevance),U.__addSublanguage(M._emitter,M.language)}function ye(){P.subLanguage!=null?Ee():de(),W=""}function be(M,k){M!==""&&(U.startScope(k),U.addText(M),U.endScope())}function Ae(M,k){let z=1,K=k.length-1;for(;z<=K;){if(!M._emit[z]){z++;continue}let pe=E.classNameAliases[M[z]]||M[z],xe=k[z];pe?be(xe,pe):(W=xe,de(),W=""),z++}}function Me(M,k){return M.scope&&typeof M.scope=="string"&&U.openNode(E.classNameAliases[M.scope]||M.scope),M.beginScope&&(M.beginScope._wrap?(be(W,E.classNameAliases[M.beginScope._wrap]||M.beginScope._wrap),W=""):M.beginScope._multi&&(Ae(M.beginScope,k),W="")),P=Object.create(M,{parent:{value:P}}),P}function Qe(M,k,z){let K=TS(M.endRe,z);if(K){if(M["on:end"]){let pe=new Mi(M);M["on:end"](k,pe),pe.isMatchIgnored&&(K=!1)}if(K){for(;M.endsParent&&M.parent;)M=M.parent;return M}}if(M.endsWithParent)return Qe(M.parent,k,z)}function ze(M){return P.matcher.regexIndex===0?(W+=M[0],1):(q=!0,0)}function ft(M){let k=M[0],z=M.rule,K=new Mi(z),pe=[z.__beforeBegin,z["on:begin"]];for(let xe of pe)if(xe&&(xe(M,K),K.isMatchIgnored))return ze(k);return z.skip?W+=k:(z.excludeBegin&&(W+=k),ye(),!z.returnBegin&&!z.excludeBegin&&(W=k)),Me(z,M),z.returnBegin?0:k.length}function Ce(M){let k=M[0],z=F.substring(M.index),K=Qe(P,M,z);if(!K)return Wh;let pe=P;P.endScope&&P.endScope._wrap?(ye(),be(k,P.endScope._wrap)):P.endScope&&P.endScope._multi?(ye(),Ae(P.endScope,M)):pe.skip?W+=k:(pe.returnEnd||pe.excludeEnd||(W+=k),ye(),pe.excludeEnd&&(W=k));do P.scope&&U.closeNode(),!P.skip&&!P.subLanguage&&(ee+=P.relevance),P=P.parent;while(P!==K.parent);return K.starts&&Me(K.starts,M),pe.returnEnd?0:k.length}function Je(){let M=[];for(let k=P;k!==E;k=k.parent)k.scope&&M.unshift(k.scope);M.forEach(k=>U.openNode(k))}let ht={};function J(M,k){let z=k&&k[0];if(W+=M,z==null)return ye(),0;if(ht.type==="begin"&&k.type==="end"&&ht.index===k.index&&z===""){if(W+=F.slice(k.index,k.index+1),!i){let K=new Error(`0 width match regex (${T})`);throw K.languageName=T,K.badRule=ht.rule,K}return 1}if(ht=k,k.type==="begin")return ft(k);if(k.type==="illegal"&&!R){let K=new Error('Illegal lexeme "'+z+'" for mode "'+(P.scope||"<unnamed>")+'"');throw K.mode=P,K}else if(k.type==="end"){let K=Ce(k);if(K!==Wh)return K}if(k.type==="illegal"&&z==="")return W+=` `,1;if(V>1e5&&V>k.index*3)throw new Error("potential infinite loop, way more iterations than matches");return W+=z,z.length}let E=I(T);if(!E)throw Kt(s.replace("{}",T)),new Error('Unknown language: "'+T+'"');let O=rE(E),L="",P=X||O,w={},U=new a.__emitter(a);Je();let W="",ee=0,Q=0,V=0,q=!1;try{if(E.__emitTokens)E.__emitTokens(F,U);else{for(P.matcher.considerAll();;){V++,q?q=!1:P.matcher.considerAll(),P.matcher.lastIndex=Q;let M=P.matcher.exec(F);if(!M)break;let k=F.substring(Q,M.index),z=J(k,M);Q=M.index+z}J(F.substring(Q))}return U.finalize(),L=U.toHTML(),{language:T,value:L,relevance:ee,illegal:!1,_emitter:U,_top:P}}catch(M){if(M.message&&M.message.includes("Illegal"))return{language:T,value:Ta(F),illegal:!0,relevance:0,_illegalBy:{message:M.message,index:Q,context:F.slice(Q-100,Q+100),mode:M.mode,resultSoFar:L},_emitter:U};if(i)return{language:T,value:Ta(F),illegal:!1,relevance:0,errorRaised:M,_emitter:U,_top:P};throw M}}function p(T){let F={value:Ta(T),illegal:!1,relevance:0,_top:o,_emitter:new a.__emitter(a)};return F._emitter.addText(T),F}function h(T,F){F=F||a.languages||Object.keys(t);let R=p(T),X=F.filter(I).filter(H).map(ye=>f(ye,T,!1));X.unshift(R);let re=X.sort((ye,be)=>{if(ye.relevance!==be.relevance)return be.relevance-ye.relevance;if(ye.language&&be.language){if(I(ye.language).supersetOf===be.language)return 1;if(I(be.language).supersetOf===ye.language)return-1}return 0}),[ge,de]=re,Ee=ge;return Ee.secondBest=de,Ee}function m(T,F,R){let X=F&&n[F]||R;T.classList.add("hljs"),T.classList.add(`language-${X}`)}function d(T){let F=null,R=l(T);if(c(R))return;if(Y("before:highlightElement",{el:T,language:R}),T.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",T);return}if(T.children.length>0&&(a.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(T)),a.throwUnescapedHTML))throw new Oa("One of your code blocks includes unescaped HTML.",T.innerHTML);F=T;let X=F.textContent,re=R?u(X,{language:R,ignoreIllegals:!0}):h(X);T.innerHTML=re.value,T.dataset.highlighted="yes",m(T,R,re.language),T.result={language:re.language,re:re.relevance,relevance:re.relevance},re.secondBest&&(T.secondBest={language:re.secondBest.language,relevance:re.secondBest.relevance}),Y("after:highlightElement",{el:T,result:re,text:X})}function b(T){a=Uh(a,T)}let S=()=>{N(),fn("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function _(){N(),fn("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let A=!1;function N(){function T(){N()}if(document.readyState==="loading"){A||window.addEventListener("DOMContentLoaded",T,!1),A=!0;return}document.querySelectorAll(a.cssSelector).forEach(d)}function $(T,F){let R=null;try{R=F(e)}catch(X){if(Kt("Language definition for '{}' could not be registered.".replace("{}",T)),i)Kt(X);else throw X;R=o}R.name||(R.name=T),t[T]=R,R.rawDefinition=F.bind(null,e),R.aliases&&D(R.aliases,{languageName:T})}function B(T){delete t[T];for(let F of Object.keys(n))n[F]===T&&delete n[F]}function j(){return Object.keys(t)}function I(T){return T=(T||"").toLowerCase(),t[T]||t[n[T]]}function D(T,{languageName:F}){typeof T=="string"&&(T=[T]),T.forEach(R=>{n[R.toLowerCase()]=F})}function H(T){let F=I(T);return F&&!F.disableAutodetect}function C(T){T["before:highlightBlock"]&&!T["befor