Files
cours/.obsidian/plugins/languagetool/main.js
T

38 lines
179 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/* Obsidian LanguageTool v1.4.4 */
var o6=Object.create;var{getPrototypeOf:t6,defineProperty:F0,getOwnPropertyNames:Q2,getOwnPropertyDescriptor:e6}=Object,X2=Object.prototype.hasOwnProperty;function G2(Y){return this[Y]}var Y7,Z7,K2=(Y,Z,Q)=>{var X=Y!=null&&typeof Y==="object";if(X){var G=Z?Y7??=new WeakMap:Z7??=new WeakMap,$=G.get(Y);if($)return $}Q=Y!=null?o6(t6(Y)):{};let K=Z||!Y||!Y.__esModule?F0(Q,"default",{value:Y,enumerable:!0}):Q;for(let V of Q2(Y))if(!X2.call(K,V))F0(K,V,{get:G2.bind(Y,V),enumerable:!0});if(X)G.set(Y,K);return K},Q7=(Y)=>{var Z=(Z2??=new WeakMap).get(Y),Q;if(Z)return Z;if(Z=F0({},"__esModule",{value:!0}),Y&&typeof Y==="object"||typeof Y==="function"){for(var X of Q2(Y))if(!X2.call(Z,X))F0(Z,X,{get:G2.bind(Y,X),enumerable:!(Q=e6(Y,X))||Q.enumerable})}return Z2.set(Y,Z),Z},Z2,C0=(Y,Z)=>()=>(Z||Y((Z={exports:{}}).exports,Z),Z.exports);var X7=(Y)=>Y;function G7(Y,Z){this[Y]=X7.bind(null,Z)}var $2=(Y,Z)=>{for(var Q in Z)F0(Y,Q,{get:Z[Q],enumerable:!0,configurable:!0,set:G7.bind(Z,Q)})};var Q6=C0(($X,Z6)=>{var G0=1000,K0=G0*60,$0=K0*60,f1=$0*24,m4=f1*7,u4=f1*365.25;Z6.exports=function(Y,Z){Z=Z||{};var Q=typeof Y;if(Q==="string"&&Y.length>0)return p4(Y);else if(Q==="number"&&isFinite(Y))return Z.long?f4(Y):l4(Y);throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(Y))};function p4(Y){if(Y=String(Y),Y.length>100)return;var Z=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(Y);if(!Z)return;var Q=parseFloat(Z[1]),X=(Z[2]||"ms").toLowerCase();switch(X){case"years":case"year":case"yrs":case"yr":case"y":return Q*u4;case"weeks":case"week":case"w":return Q*m4;case"days":case"day":case"d":return Q*f1;case"hours":case"hour":case"hrs":case"hr":case"h":return Q*$0;case"minutes":case"minute":case"mins":case"min":case"m":return Q*K0;case"seconds":case"second":case"secs":case"sec":case"s":return Q*G0;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return Q;default:return}}function l4(Y){var Z=Math.abs(Y);if(Z>=f1)return Math.round(Y/f1)+"d";if(Z>=$0)return Math.round(Y/$0)+"h";if(Z>=K0)return Math.round(Y/K0)+"m";if(Z>=G0)return Math.round(Y/G0)+"s";return Y+"ms"}function f4(Y){var Z=Math.abs(Y);if(Z>=f1)return f0(Y,Z,f1,"day");if(Z>=$0)return f0(Y,Z,$0,"hour");if(Z>=K0)return f0(Y,Z,K0,"minute");if(Z>=G0)return f0(Y,Z,G0,"second");return Y+" ms"}function f0(Y,Z,Q,X){var G=Z>=Q*1.5;return Math.round(Y/Q)+" "+X+(G?"s":"")}});var G6=C0((HX,X6)=>{function i4(Y){Q.debug=Q,Q.default=Q,Q.coerce=U,Q.disable=K,Q.enable=G,Q.enabled=V,Q.humanize=Q6(),Q.destroy=q,Object.keys(Y).forEach((M)=>{Q[M]=Y[M]}),Q.names=[],Q.skips=[],Q.formatters={};function Z(M){let F=0;for(let R=0;R<M.length;R++)F=(F<<5)-F+M.charCodeAt(R),F|=0;return Q.colors[Math.abs(F)%Q.colors.length]}Q.selectColor=Z;function Q(M){let F,R=null,L,j;function I(...w){if(!I.enabled)return;let A=I,x=Number(new Date),S=x-(F||x);if(A.diff=S,A.prev=F,A.curr=x,F=x,w[0]=Q.coerce(w[0]),typeof w[0]!=="string")w.unshift("%O");let m=0;w[0]=w[0].replace(/%([a-zA-Z%])/g,(P,y)=>{if(P==="%%")return"%";m++;let a=Q.formatters[y];if(typeof a==="function"){let r=w[m];P=a.call(A,r),w.splice(m,1),m--}return P}),Q.formatArgs.call(A,w),(A.log||Q.log).apply(A,w)}if(I.namespace=M,I.useColors=Q.useColors(),I.color=Q.selectColor(M),I.extend=X,I.destroy=Q.destroy,Object.defineProperty(I,"enabled",{enumerable:!0,configurable:!1,get:()=>{if(R!==null)return R;if(L!==Q.namespaces)L=Q.namespaces,j=Q.enabled(M);return j},set:(w)=>{R=w}}),typeof Q.init==="function")Q.init(I);return I}function X(M,F){let R=Q(this.namespace+(typeof F>"u"?":":F)+M);return R.log=this.log,R}function G(M){Q.save(M),Q.namespaces=M,Q.names=[],Q.skips=[];let F=(typeof M==="string"?M:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let R of F)if(R[0]==="-")Q.skips.push(R.slice(1));else Q.names.push(R)}function $(M,F){let R=0,L=0,j=-1,I=0;while(R<M.length)if(L<F.length&&(F[L]===M[R]||F[L]==="*"))if(F[L]==="*")j=L,I=R,L++;else R++,L++;else if(j!==-1)L=j+1,I++,R=I;else return!1;while(L<F.length&&F[L]==="*")L++;return L===F.length}function K(){let M=[...Q.names,...Q.skips.map((F)=>"-"+F)].join(",");return Q.enable(""),M}function V(M){for(let F of Q.skips)if($(M,F))return!1;for(let F of Q.names)if($(M,F))return!0;return!1}function U(M){if(M instanceof Error)return M.stack||M.message;return M}function q(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return Q.enable(Q.load()),Q}X6.exports=i4});var K6=C0((V1,i0)=>{V1.formatArgs=a4;V1.save=d4;V1.load=n4;V1.useColors=r4;V1.storage=s4();V1.destroy=(()=>{let Y=!1;return()=>{if(!Y)Y=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}})();V1.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function r4(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let Y;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(Y=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(Y[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function a4(Y){if(Y[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+Y[0]+(this.useColors?"%c ":" ")+"+"+i0.exports.humanize(this.diff),!this.useColors)return;let Z="color: "+this.color;Y.splice(1,0,Z,"color: inherit");let Q=0,X=0;Y[0].replace(/%[a-zA-Z%]/g,(G)=>{if(G==="%%")return;if(Q++,G==="%c")X=Q}),Y.splice(X,0,Z)}V1.log=console.debug||console.log||(()=>{});function d4(Y){try{if(Y)V1.storage.setItem("debug",Y);else V1.storage.removeItem("debug")}catch(Z){}}function n4(){let Y;try{Y=V1.storage.getItem("debug")||V1.storage.getItem("DEBUG")}catch(Z){}if(!Y&&typeof process<"u"&&"env"in process)Y=process.env.DEBUG;return Y}function s4(){try{return localStorage}catch(Y){}}i0.exports=G6()(V1);var{formatters:c4}=i0.exports;c4.j=function(Y){try{return JSON.stringify(Y)}catch(Z){return"[UnexpectedJSONParseError]: "+Z.message}}});var b6=C0((iK,f5)=>{(function(){var Y;if(typeof f5<"u")Y=f5.exports=X;else Y=function(){return this||(0,eval)("this")}();if(Y.format=X,Y.vsprintf=Q,typeof console<"u"&&typeof console.log==="function")Y.printf=Z;function Z(){console.log(X.apply(null,arguments))}function Q(G,$){return X.apply(null,[G].concat($))}function X(G){var $=1,K=[].slice.call(arguments),V=0,U=G.length,q="",M,F=!1,R,L,j=!1,I,w=function(){return K[$++]},A=function(){var x="";while(/\d/.test(G[V]))x+=G[V++],M=G[V];return x.length>0?parseInt(x):null};for(;V<U;++V)if(M=G[V],F){if(F=!1,M==".")j=!1,M=G[++V];else if(M=="0"&&G[V+1]==".")j=!0,V+=2,M=G[V];else j=!0;switch(I=A(),M){case"b":q+=parseInt(w(),10).toString(2);break;case"c":if(R=w(),typeof R==="string"||R instanceof String)q+=R;else q+=String.fromCharCode(parseInt(R,10));break;case"d":q+=parseInt(w(),10);break;case"f":L=String(parseFloat(w()).toFixed(I||6)),q+=j?L:L.replace(/^0/,"");break;case"j":q+=JSON.stringify(w());break;case"o":q+="0"+parseInt(w(),10).toString(8);break;case"s":q+=w();break;case"x":q+="0x"+parseInt(w(),10).toString(16);break;case"X":q+="0x"+parseInt(w(),10).toString(16).toUpperCase();break;default:q+=M;break}}else if(M==="%")F=!0;else q+=M;return q}})()});var C3={};$2(C3,{default:()=>s5});module.exports=Q7(C3);var Q1=require("obsidian");var f=require("obsidian");var Y5=require("obsidian");class V2{add(Y,Z,Q){if(typeof arguments[0]!="string")for(let X in arguments[0])this.add(X,arguments[0][X],arguments[1]);else(Array.isArray(Y)?Y:[Y]).forEach(function(X){if(this[X]=this[X]||[],Z)this[X][Q?"unshift":"push"](Z)},this)}run(Y,Z){this[Y]=this[Y]||[],this[Y].forEach(function(Q){Q.call(Z&&Z.context?Z.context:Z,Z)})}}class W2{constructor(Y){this.jsep=Y,this.registered={}}register(){for(var Y=arguments.length,Z=Array(Y),Q=0;Q<Y;Q++)Z[Q]=arguments[Q];Z.forEach((X)=>{if(typeof X!=="object"||!X.name||!X.init)throw Error("Invalid JSEP plugin format");if(this.registered[X.name])return;X.init(this.jsep),this.registered[X.name]=X})}}class B{static get version(){return"1.4.0"}static toString(){return"JavaScript Expression Parser (JSEP) v"+B.version}static addUnaryOp(Y){return B.max_unop_len=Math.max(Y.length,B.max_unop_len),B.unary_ops[Y]=1,B}static addBinaryOp(Y,Z,Q){if(B.max_binop_len=Math.max(Y.length,B.max_binop_len),B.binary_ops[Y]=Z,Q)B.right_associative.add(Y);else B.right_associative.delete(Y);return B}static addIdentifierChar(Y){return B.additional_identifier_chars.add(Y),B}static addLiteral(Y,Z){return B.literals[Y]=Z,B}static removeUnaryOp(Y){if(delete B.unary_ops[Y],Y.length===B.max_unop_len)B.max_unop_len=B.getMaxKeyLen(B.unary_ops);return B}static removeAllUnaryOps(){return B.unary_ops={},B.max_unop_len=0,B}static removeIdentifierChar(Y){return B.additional_identifier_chars.delete(Y),B}static removeBinaryOp(Y){if(delete B.binary_ops[Y],Y.length===B.max_binop_len)B.max_binop_len=B.getMaxKeyLen(B.binary_ops);return B.right_associative.delete(Y),B}static removeAllBinaryOps(){return B.binary_ops={},B.max_binop_len=0,B}static removeLiteral(Y){return delete B.literals[Y],B}static removeAllLiterals(){return B.literals={},B}get char(){return this.expr.charAt(this.index)}get code(){return this.expr.charCodeAt(this.index)}constructor(Y){this.expr=Y,this.index=0}static parse(Y){return new B(Y).parse()}static getMaxKeyLen(Y){return Math.max(0,...Object.keys(Y).map((Z)=>Z.length))}static isDecimalDigit(Y){return Y>=48&&Y<=57}static binaryPrecedence(Y){return B.binary_ops[Y]||0}static isIdentifierStart(Y){return Y>=65&&Y<=90||Y>=97&&Y<=122||Y>=128&&!B.binary_ops[String.fromCharCode(Y)]||B.additional_identifier_chars.has(String.fromCharCode(Y))}static isIdentifierPart(Y){return B.isIdentifierStart(Y)||B.isDecimalDigit(Y)}throwError(Y){let Z=Error(Y+" at character "+this.index);throw Z.index=this.index,Z.description=Y,Z}runHook(Y,Z){if(B.hooks[Y]){let Q={context:this,node:Z};return B.hooks.run(Y,Q),Q.node}return Z}searchHook(Y){if(B.hooks[Y]){let Z={context:this};return B.hooks[Y].find(function(Q){return Q.call(Z.context,Z),Z.node}),Z.node}}gobbleSpaces(){let Y=this.code;while(Y===B.SPACE_CODE||Y===B.TAB_CODE||Y===B.LF_CODE||Y===B.CR_CODE)Y=this.expr.charCodeAt(++this.index);this.runHook("gobble-spaces")}parse(){this.runHook("before-all");let Y=this.gobbleExpressions(),Z=Y.length===1?Y[0]:{type:B.COMPOUND,body:Y};return this.runHook("after-all",Z)}gobbleExpressions(Y){let Z=[],Q,X;while(this.index<this.expr.length)if(Q=this.code,Q===B.SEMCOL_CODE||Q===B.COMMA_CODE)this.index++;else if(X=this.gobbleExpression())Z.push(X);else if(this.index<this.expr.length){if(Q===Y)break;this.throwError('Unexpected "'+this.char+'"')}return Z}gobbleExpression(){let Y=this.searchHook("gobble-expression")||this.gobbleBinaryExpression();return this.gobbleSpaces(),this.runHook("after-expression",Y)}gobbleBinaryOp(){this.gobbleSpaces();let Y=this.expr.substr(this.index,B.max_binop_len),Z=Y.length;while(Z>0){if(B.binary_ops.hasOwnProperty(Y)&&(!B.isIdentifierStart(this.code)||this.index+Y.length<this.expr.length&&!B.isIdentifierPart(this.expr.charCodeAt(this.index+Y.length))))return this.index+=Z,Y;Y=Y.substr(0,--Z)}return!1}gobbleBinaryExpression(){let Y,Z,Q,X,G,$,K,V,U;if($=this.gobbleToken(),!$)return $;if(Z=this.gobbleBinaryOp(),!Z)return $;if(G={value:Z,prec:B.binaryPrecedence(Z),right_a:B.right_associative.has(Z)},K=this.gobbleToken(),!K)this.throwError("Expected expression after "+Z);X=[$,G,K];while(Z=this.gobbleBinaryOp()){if(Q=B.binaryPrecedence(Z),Q===0){this.index-=Z.length;break}G={value:Z,prec:Q,right_a:B.right_associative.has(Z)},U=Z;let q=(M)=>G.right_a&&M.right_a?Q>M.prec:Q<=M.prec;while(X.length>2&&q(X[X.length-2]))K=X.pop(),Z=X.pop().value,$=X.pop(),Y={type:B.BINARY_EXP,operator:Z,left:$,right:K},X.push(Y);if(Y=this.gobbleToken(),!Y)this.throwError("Expected expression after "+U);X.push(G,Y)}V=X.length-1,Y=X[V];while(V>1)Y={type:B.BINARY_EXP,operator:X[V-1].value,left:X[V-2],right:Y},V-=2;return Y}gobbleToken(){let Y,Z,Q,X;if(this.gobbleSpaces(),X=this.searchHook("gobble-token"),X)return this.runHook("after-token",X);if(Y=this.code,B.isDecimalDigit(Y)||Y===B.PERIOD_CODE)return this.gobbleNumericLiteral();if(Y===B.SQUOTE_CODE||Y===B.DQUOTE_CODE)X=this.gobbleStringLiteral();else if(Y===B.OBRACK_CODE)X=this.gobbleArray();else{Z=this.expr.substr(this.index,B.max_unop_len),Q=Z.length;while(Q>0){if(B.unary_ops.hasOwnProperty(Z)&&(!B.isIdentifierStart(this.code)||this.index+Z.length<this.expr.length&&!B.isIdentifierPart(this.expr.charCodeAt(this.index+Z.length)))){this.index+=Q;let G=this.gobbleToken();if(!G)this.throwError("missing unaryOp argument");return this.runHook("after-token",{type:B.UNARY_EXP,operator:Z,argument:G,prefix:!0})}Z=Z.substr(0,--Q)}if(B.isIdentifierStart(Y)){if(X=this.gobbleIdentifier(),B.literals.hasOwnProperty(X.name))X={type:B.LITERAL,value:B.literals[X.name],raw:X.name};else if(X.name===B.this_str)X={type:B.THIS_EXP}}else if(Y===B.OPAREN_CODE)X=this.gobbleGroup()}if(!X)return this.runHook("after-token",!1);return X=this.gobbleTokenProperty(X),this.runHook("after-token",X)}gobbleTokenProperty(Y){this.gobbleSpaces();let Z=this.code;while(Z===B.PERIOD_CODE||Z===B.OBRACK_CODE||Z===B.OPAREN_CODE||Z===B.QUMARK_CODE){let Q;if(Z===B.QUMARK_CODE){if(this.expr.charCodeAt(this.index+1)!==B.PERIOD_CODE)break;Q=!0,this.index+=2,this.gobbleSpaces(),Z=this.code}if(this.index++,Z===B.OBRACK_CODE){if(Y={type:B.MEMBER_EXP,computed:!0,object:Y,property:this.gobbleExpression()},!Y.property)this.throwError('Unexpected "'+this.char+'"');if(this.gobbleSpaces(),Z=this.code,Z!==B.CBRACK_CODE)this.throwError("Unclosed [");this.index++}else if(Z===B.OPAREN_CODE)Y={type:B.CALL_EXP,arguments:this.gobbleArguments(B.CPAREN_CODE),callee:Y};else if(Z===B.PERIOD_CODE||Q){if(Q)this.index--;this.gobbleSpaces(),Y={type:B.MEMBER_EXP,computed:!1,object:Y,property:this.gobbleIdentifier()}}if(Q)Y.optional=!0;this.gobbleSpaces(),Z=this.code}return Y}gobbleNumericLiteral(){let Y="",Z,Q;while(B.isDecimalDigit(this.code))Y+=this.expr.charAt(this.index++);if(this.code===B.PERIOD_CODE){Y+=this.expr.charAt(this.index++);while(B.isDecimalDigit(this.code))Y+=this.expr.charAt(this.index++)}if(Z=this.char,Z==="e"||Z==="E"){if(Y+=this.expr.charAt(this.index++),Z=this.char,Z==="+"||Z==="-")Y+=this.expr.charAt(this.index++);while(B.isDecimalDigit(this.code))Y+=this.expr.charAt(this.index++);if(!B.isDecimalDigit(this.expr.charCodeAt(this.index-1)))this.throwError("Expected exponent ("+Y+this.char+")")}if(Q=this.code,B.isIdentifierStart(Q))this.throwError("Variable names cannot start with a number ("+Y+this.char+")");else if(Q===B.PERIOD_CODE||Y.length===1&&Y.charCodeAt(0)===B.PERIOD_CODE)this.throwError("Unexpected period");return{type:B.LITERAL,value:parseFloat(Y),raw:Y}}gobbleStringLiteral(){let Y="",Z=this.index,Q=this.expr.charAt(this.index++),X=!1;while(this.index<this.expr.length){let G=this.expr.charAt(this.index++);if(G===Q){X=!0;break}else if(G==="\\")switch(G=this.expr.charAt(this.index++),G){case"n":Y+=`
`;break;case"r":Y+="\r";break;case"t":Y+="\t";break;case"b":Y+="\b";break;case"f":Y+="\f";break;case"v":Y+="\v";break;default:Y+=G}else Y+=G}if(!X)this.throwError('Unclosed quote after "'+Y+'"');return{type:B.LITERAL,value:Y,raw:this.expr.substring(Z,this.index)}}gobbleIdentifier(){let Y=this.code,Z=this.index;if(B.isIdentifierStart(Y))this.index++;else this.throwError("Unexpected "+this.char);while(this.index<this.expr.length)if(Y=this.code,B.isIdentifierPart(Y))this.index++;else break;return{type:B.IDENTIFIER,name:this.expr.slice(Z,this.index)}}gobbleArguments(Y){let Z=[],Q=!1,X=0;while(this.index<this.expr.length){this.gobbleSpaces();let G=this.code;if(G===Y){if(Q=!0,this.index++,Y===B.CPAREN_CODE&&X&&X>=Z.length)this.throwError("Unexpected token "+String.fromCharCode(Y));break}else if(G===B.COMMA_CODE){if(this.index++,X++,X!==Z.length){if(Y===B.CPAREN_CODE)this.throwError("Unexpected token ,");else if(Y===B.CBRACK_CODE)for(let $=Z.length;$<X;$++)Z.push(null)}}else if(Z.length!==X&&X!==0)this.throwError("Expected comma");else{let $=this.gobbleExpression();if(!$||$.type===B.COMPOUND)this.throwError("Expected comma");Z.push($)}}if(!Q)this.throwError("Expected "+String.fromCharCode(Y));return Z}gobbleGroup(){this.index++;let Y=this.gobbleExpressions(B.CPAREN_CODE);if(this.code===B.CPAREN_CODE)if(this.index++,Y.length===1)return Y[0];else if(!Y.length)return!1;else return{type:B.SEQUENCE_EXP,expressions:Y};else this.throwError("Unclosed (")}gobbleArray(){return this.index++,{type:B.ARRAY_EXP,elements:this.gobbleArguments(B.CBRACK_CODE)}}}var K7=new V2;Object.assign(B,{hooks:K7,plugins:new W2(B),COMPOUND:"Compound",SEQUENCE_EXP:"SequenceExpression",IDENTIFIER:"Identifier",MEMBER_EXP:"MemberExpression",LITERAL:"Literal",THIS_EXP:"ThisExpression",CALL_EXP:"CallExpression",UNARY_EXP:"UnaryExpression",BINARY_EXP:"BinaryExpression",ARRAY_EXP:"ArrayExpression",TAB_CODE:9,LF_CODE:10,CR_CODE:13,SPACE_CODE:32,PERIOD_CODE:46,COMMA_CODE:44,SQUOTE_CODE:39,DQUOTE_CODE:34,OPAREN_CODE:40,CPAREN_CODE:41,OBRACK_CODE:91,CBRACK_CODE:93,QUMARK_CODE:63,SEMCOL_CODE:59,COLON_CODE:58,unary_ops:{"-":1,"!":1,"~":1,"+":1},binary_ops:{"||":1,"??":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10,"**":11},right_associative:new Set(["**"]),additional_identifier_chars:new Set(["$","_"]),literals:{true:!0,false:!1,null:null},this_str:"this"});B.max_unop_len=B.getMaxKeyLen(B.unary_ops);B.max_binop_len=B.getMaxKeyLen(B.binary_ops);var R1=(Y)=>new B(Y).parse(),$7=Object.getOwnPropertyNames(class{});Object.getOwnPropertyNames(B).filter((Y)=>!$7.includes(Y)&&R1[Y]===void 0).forEach((Y)=>{R1[Y]=B[Y]});R1.Jsep=B;var H7="ConditionalExpression",V7={name:"ternary",init(Y){Y.hooks.add("after-expression",function(Q){if(Q.node&&this.code===Y.QUMARK_CODE){this.index++;let X=Q.node,G=this.gobbleExpression();if(!G)this.throwError("Expected expression");if(this.gobbleSpaces(),this.code===Y.COLON_CODE){this.index++;let $=this.gobbleExpression();if(!$)this.throwError("Expected expression");if(Q.node={type:H7,test:X,consequent:G,alternate:$},X.operator&&Y.binary_ops[X.operator]<=0.9){let K=X;while(K.right.operator&&Y.binary_ops[K.right.operator]<=0.9)K=K.right;Q.node.test=K.right,K.right=Q.node,Q.node=X}}else this.throwError("Expected :")}})}};R1.plugins.register(V7);var H2=47,W7=92,q7={name:"regex",init(Y){Y.hooks.add("gobble-token",function(Q){if(this.code===H2){let X=++this.index,G=!1;while(this.index<this.expr.length){if(this.code===H2&&!G){let $=this.expr.slice(X,this.index),K="";while(++this.index<this.expr.length){let U=this.code;if(U>=97&&U<=122||U>=65&&U<=90||U>=48&&U<=57)K+=this.char;else break}let V;try{V=new RegExp($,K)}catch(U){this.throwError(U.message)}return Q.node={type:Y.LITERAL,value:V,raw:this.expr.slice(X-1,this.index)},Q.node=this.gobbleTokenProperty(Q.node),Q.node}if(this.code===Y.OBRACK_CODE)G=!0;else if(G&&this.code===Y.CBRACK_CODE)G=!1;this.index+=this.code===W7?2:1}this.throwError("Unclosed Regex")}})}},t0=43,M7=45,c1={name:"assignment",assignmentOperators:new Set(["=","*=","**=","/=","%=","+=","-=","<<=",">>=",">>>=","&=","^=","|=","||=","&&=","??="]),updateOperators:[t0,M7],assignmentPrecedence:0.9,init(Y){let Z=[Y.IDENTIFIER,Y.MEMBER_EXP];c1.assignmentOperators.forEach((X)=>Y.addBinaryOp(X,c1.assignmentPrecedence,!0)),Y.hooks.add("gobble-token",function(G){let $=this.code;if(c1.updateOperators.some((K)=>K===$&&K===this.expr.charCodeAt(this.index+1))){if(this.index+=2,G.node={type:"UpdateExpression",operator:$===t0?"++":"--",argument:this.gobbleTokenProperty(this.gobbleIdentifier()),prefix:!0},!G.node.argument||!Z.includes(G.node.argument.type))this.throwError(`Unexpected ${G.node.operator}`)}}),Y.hooks.add("after-token",function(G){if(G.node){let $=this.code;if(c1.updateOperators.some((K)=>K===$&&K===this.expr.charCodeAt(this.index+1))){if(!Z.includes(G.node.type))this.throwError(`Unexpected ${G.node.operator}`);this.index+=2,G.node={type:"UpdateExpression",operator:$===t0?"++":"--",argument:G.node,prefix:!1}}}}),Y.hooks.add("after-expression",function(G){if(G.node)Q(G.node)});function Q(X){if(c1.assignmentOperators.has(X.operator))X.type="AssignmentExpression",Q(X.left),Q(X.right);else if(!X.operator)Object.values(X).forEach((G)=>{if(G&&typeof G==="object")Q(G)})}}};R1.plugins.register(q7,c1);R1.addUnaryOp("typeof");R1.addUnaryOp("void");R1.addLiteral("null",null);R1.addLiteral("undefined",void 0);var U7=new Set(["constructor","__proto__","__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__"]),s={evalAst(Y,Z){switch(Y.type){case"BinaryExpression":case"LogicalExpression":return s.evalBinaryExpression(Y,Z);case"Compound":return s.evalCompound(Y,Z);case"ConditionalExpression":return s.evalConditionalExpression(Y,Z);case"Identifier":return s.evalIdentifier(Y,Z);case"Literal":return s.evalLiteral(Y,Z);case"MemberExpression":return s.evalMemberExpression(Y,Z);case"UnaryExpression":return s.evalUnaryExpression(Y,Z);case"ArrayExpression":return s.evalArrayExpression(Y,Z);case"CallExpression":return s.evalCallExpression(Y,Z);case"AssignmentExpression":return s.evalAssignmentExpression(Y,Z);default:throw SyntaxError("Unexpected expression",Y)}},evalBinaryExpression(Y,Z){return{"||":(X,G)=>X||G(),"&&":(X,G)=>X&&G(),"|":(X,G)=>X|G(),"^":(X,G)=>X^G(),"&":(X,G)=>X&G(),"==":(X,G)=>X==G(),"!=":(X,G)=>X!=G(),"===":(X,G)=>X===G(),"!==":(X,G)=>X!==G(),"<":(X,G)=>X<G(),">":(X,G)=>X>G(),"<=":(X,G)=>X<=G(),">=":(X,G)=>X>=G(),"<<":(X,G)=>X<<G(),">>":(X,G)=>X>>G(),">>>":(X,G)=>X>>>G(),"+":(X,G)=>X+G(),"-":(X,G)=>X-G(),"*":(X,G)=>X*G(),"/":(X,G)=>X/G(),"%":(X,G)=>X%G()}[Y.operator](s.evalAst(Y.left,Z),()=>s.evalAst(Y.right,Z))},evalCompound(Y,Z){let Q;for(let X=0;X<Y.body.length;X++){if(Y.body[X].type==="Identifier"&&["var","let","const"].includes(Y.body[X].name)&&Y.body[X+1]&&Y.body[X+1].type==="AssignmentExpression")X+=1;let G=Y.body[X];Q=s.evalAst(G,Z)}return Q},evalConditionalExpression(Y,Z){if(s.evalAst(Y.test,Z))return s.evalAst(Y.consequent,Z);return s.evalAst(Y.alternate,Z)},evalIdentifier(Y,Z){if(Object.hasOwn(Z,Y.name))return Z[Y.name];throw ReferenceError(`${Y.name} is not defined`)},evalLiteral(Y){return Y.value},evalMemberExpression(Y,Z){let Q=String(Y.computed?s.evalAst(Y.property):Y.property.name),X=s.evalAst(Y.object,Z);if(X===void 0||X===null)throw TypeError(`Cannot read properties of ${X} (reading '${Q}')`);if(!Object.hasOwn(X,Q)&&U7.has(Q))throw TypeError(`Cannot read properties of ${X} (reading '${Q}')`);let G=X[Q];if(typeof G==="function")return G.bind(X);return G},evalUnaryExpression(Y,Z){return{"-":(X)=>-s.evalAst(X,Z),"!":(X)=>!s.evalAst(X,Z),"~":(X)=>~s.evalAst(X,Z),"+":(X)=>+s.evalAst(X,Z),typeof:(X)=>typeof s.evalAst(X,Z),void:(X)=>void s.evalAst(X,Z)}[Y.operator](Y.argument)},evalArrayExpression(Y,Z){return Y.elements.map((Q)=>s.evalAst(Q,Z))},evalCallExpression(Y,Z){let Q=Y.arguments.map((G)=>s.evalAst(G,Z)),X=s.evalAst(Y.callee,Z);if(X===Function)throw Error("Function constructor is disabled");return X(...Q)},evalAssignmentExpression(Y,Z){if(Y.left.type!=="Identifier")throw SyntaxError("Invalid left-hand side in assignment");let Q=Y.left.name,X=s.evalAst(Y.right,Z);return Z[Q]=X,Z[Q]}};class q2{constructor(Y){this.code=Y,this.ast=R1(this.code)}runInNewContext(Y){let Z=Object.assign(Object.create(null),Y);return s.evalAst(this.ast,Z)}}function C1(Y,Z){return Y=Y.slice(),Y.push(Z),Y}function e0(Y,Z){return Z=Z.slice(),Z.unshift(Y),Z}class M2 extends Error{constructor(Y){super('JSONPath should not be called with "new" (it prevents return of (unwrapped) scalar values)');this.avoidNew=!0,this.value=Y,this.name="NewError"}}function i(Y,Z,Q,X,G){if(!(this instanceof i))try{return new i(Y,Z,Q,X,G)}catch(K){if(!K.avoidNew)throw K;return K.value}if(typeof Y==="string")G=X,X=Q,Q=Z,Z=Y,Y=null;let $=Y&&typeof Y==="object";if(Y=Y||{},this.json=Y.json||Q,this.path=Y.path||Z,this.resultType=Y.resultType||"value",this.flatten=Y.flatten||!1,this.wrap=Object.hasOwn(Y,"wrap")?Y.wrap:!0,this.sandbox=Y.sandbox||{},this.eval=Y.eval===void 0?"safe":Y.eval,this.ignoreEvalErrors=typeof Y.ignoreEvalErrors>"u"?!1:Y.ignoreEvalErrors,this.parent=Y.parent||null,this.parentProperty=Y.parentProperty||null,this.callback=Y.callback||X||null,this.otherTypeCallback=Y.otherTypeCallback||G||function(){throw TypeError("You must supply an otherTypeCallback callback option with the @other() operator.")},Y.autostart!==!1){let K={path:$?Y.path:Z};if(!$)K.json=Q;else if("json"in Y)K.json=Y.json;let V=this.evaluate(K);if(!V||typeof V!=="object")throw new M2(V);return V}}i.prototype.evaluate=function(Y,Z,Q,X){let G=this.parent,$=this.parentProperty,{flatten:K,wrap:V}=this;if(this.currResultType=this.resultType,this.currEval=this.eval,this.currSandbox=this.sandbox,Q=Q||this.callback,this.currOtherTypeCallback=X||this.otherTypeCallback,Z=Z||this.json,Y=Y||this.path,Y&&typeof Y==="object"&&!Array.isArray(Y)){if(!Y.path&&Y.path!=="")throw TypeError('You must supply a "path" property when providing an object argument to JSONPath.evaluate().');if(!Object.hasOwn(Y,"json"))throw TypeError('You must supply a "json" property when providing an object argument to JSONPath.evaluate().');({json:Z}=Y),K=Object.hasOwn(Y,"flatten")?Y.flatten:K,this.currResultType=Object.hasOwn(Y,"resultType")?Y.resultType:this.currResultType,this.currSandbox=Object.hasOwn(Y,"sandbox")?Y.sandbox:this.currSandbox,V=Object.hasOwn(Y,"wrap")?Y.wrap:V,this.currEval=Object.hasOwn(Y,"eval")?Y.eval:this.currEval,Q=Object.hasOwn(Y,"callback")?Y.callback:Q,this.currOtherTypeCallback=Object.hasOwn(Y,"otherTypeCallback")?Y.otherTypeCallback:this.currOtherTypeCallback,G=Object.hasOwn(Y,"parent")?Y.parent:G,$=Object.hasOwn(Y,"parentProperty")?Y.parentProperty:$,Y=Y.path}if(G=G||null,$=$||null,Array.isArray(Y))Y=i.toPathString(Y);if(!Y&&Y!==""||!Z)return;let U=i.toPathArray(Y);if(U[0]==="$"&&U.length>1)U.shift();this._hasParentSelector=null;let q=this._trace(U,Z,["$"],G,$,Q).filter(function(M){return M&&!M.isParentSelector});if(!q.length)return V?[]:void 0;if(!V&&q.length===1&&!q[0].hasArrExpr)return this._getPreferredOutput(q[0]);return q.reduce((M,F)=>{let R=this._getPreferredOutput(F);if(K&&Array.isArray(R))M=M.concat(R);else M.push(R);return M},[])};i.prototype._getPreferredOutput=function(Y){let Z=this.currResultType;switch(Z){case"all":{let Q=Array.isArray(Y.path)?Y.path:i.toPathArray(Y.path);return Y.pointer=i.toPointer(Q),Y.path=typeof Y.path==="string"?Y.path:i.toPathString(Y.path),Y}case"value":case"parent":case"parentProperty":return Y[Z];case"path":return i.toPathString(Y[Z]);case"pointer":return i.toPointer(Y.path);default:throw TypeError("Unknown result type")}};i.prototype._handleCallback=function(Y,Z,Q){if(Z){let X=this._getPreferredOutput(Y);Y.path=typeof Y.path==="string"?Y.path:i.toPathString(Y.path),Z(X,Q,Y)}};i.prototype._trace=function(Y,Z,Q,X,G,$,K,V){let U;if(!Y.length)return U={path:Q,value:Z,parent:X,parentProperty:G,hasArrExpr:K},this._handleCallback(U,$,"value"),U;let q=Y[0],M=Y.slice(1),F=[];function R(L){if(Array.isArray(L))L.forEach((j)=>{F.push(j)});else F.push(L)}if((typeof q!=="string"||V)&&Z&&Object.hasOwn(Z,q))R(this._trace(M,Z[q],C1(Q,q),Z,q,$,K));else if(q==="*")this._walk(Z,(L)=>{R(this._trace(M,Z[L],C1(Q,L),Z,L,$,!0,!0))});else if(q==="..")R(this._trace(M,Z,Q,X,G,$,K)),this._walk(Z,(L)=>{if(typeof Z[L]==="object")R(this._trace(Y.slice(),Z[L],C1(Q,L),Z,L,$,!0))});else if(q==="^")return this._hasParentSelector=!0,{path:Q.slice(0,-1),expr:M,isParentSelector:!0};else if(q==="~")return U={path:C1(Q,q),value:G,parent:X,parentProperty:null},this._handleCallback(U,$,"property"),U;else if(q==="$")R(this._trace(M,Z,Q,null,null,$,K));else if(/^(-?\d*):(-?\d*):?(\d*)$/u.test(q))R(this._slice(q,M,Z,Q,X,G,$));else if(q.indexOf("?(")===0){if(this.currEval===!1)throw Error("Eval [?(expr)] prevented in JSONPath expression.");let L=q.replace(/^\?\((.*?)\)$/u,"$1"),j=/@.?([^?]*)[['](\??\(.*?\))(?!.\)\])[\]']/gu.exec(L);if(j)this._walk(Z,(I)=>{let w=[j[2]],A=j[1]?Z[I][j[1]]:Z[I];if(this._trace(w,A,Q,X,G,$,!0).length>0)R(this._trace(M,Z[I],C1(Q,I),Z,I,$,!0))});else this._walk(Z,(I)=>{if(this._eval(L,Z[I],I,Q,X,G))R(this._trace(M,Z[I],C1(Q,I),Z,I,$,!0))})}else if(q[0]==="("){if(this.currEval===!1)throw Error("Eval [(expr)] prevented in JSONPath expression.");R(this._trace(e0(this._eval(q,Z,Q.at(-1),Q.slice(0,-1),X,G),M),Z,Q,X,G,$,K))}else if(q[0]==="@"){let L=!1,j=q.slice(1,-2);switch(j){case"scalar":if(!Z||!["object","function"].includes(typeof Z))L=!0;break;case"boolean":case"string":case"undefined":case"function":if(typeof Z===j)L=!0;break;case"integer":if(Number.isFinite(Z)&&!(Z%1))L=!0;break;case"number":if(Number.isFinite(Z))L=!0;break;case"nonFinite":if(typeof Z==="number"&&!Number.isFinite(Z))L=!0;break;case"object":if(Z&&typeof Z===j)L=!0;break;case"array":if(Array.isArray(Z))L=!0;break;case"other":L=this.currOtherTypeCallback(Z,Q,X,G);break;case"null":if(Z===null)L=!0;break;default:throw TypeError("Unknown value type "+j)}if(L)return U={path:Q,value:Z,parent:X,parentProperty:G},this._handleCallback(U,$,"value"),U}else if(q[0]==="`"&&Z&&Object.hasOwn(Z,q.slice(1))){let L=q.slice(1);R(this._trace(M,Z[L],C1(Q,L),Z,L,$,K,!0))}else if(q.includes(",")){let L=q.split(",");for(let j of L)R(this._trace(e0(j,M),Z,Q,X,G,$,!0))}else if(!V&&Z&&Object.hasOwn(Z,q))R(this._trace(M,Z[q],C1(Q,q),Z,q,$,K,!0));if(this._hasParentSelector)for(let L=0;L<F.length;L++){let j=F[L];if(j&&j.isParentSelector){let I=this._trace(j.expr,Z,j.path,X,G,$,K);if(Array.isArray(I)){F[L]=I[0];let w=I.length;for(let A=1;A<w;A++)L++,F.splice(L,0,I[A])}else F[L]=I}}return F};i.prototype._walk=function(Y,Z){if(Array.isArray(Y)){let Q=Y.length;for(let X=0;X<Q;X++)Z(X)}else if(Y&&typeof Y==="object")Object.keys(Y).forEach((Q)=>{Z(Q)})};i.prototype._slice=function(Y,Z,Q,X,G,$,K){if(!Array.isArray(Q))return;let V=Q.length,U=Y.split(":"),q=U[2]&&Number.parseInt(U[2])||1,M=U[0]&&Number.parseInt(U[0])||0,F=U[1]&&Number.parseInt(U[1])||V;M=M<0?Math.max(0,M+V):Math.min(V,M),F=F<0?Math.max(0,F+V):Math.min(V,F);let R=[];for(let L=M;L<F;L+=q)this._trace(e0(L,Z),Q,X,G,$,K,!0).forEach((I)=>{R.push(I)});return R};i.prototype._eval=function(Y,Z,Q,X,G,$){this.currSandbox._$_parentProperty=$,this.currSandbox._$_parent=G,this.currSandbox._$_property=Q,this.currSandbox._$_root=this.json,this.currSandbox._$_v=Z;let K=Y.includes("@path");if(K)this.currSandbox._$_path=i.toPathString(X.concat([Q]));let V=this.currEval+"Script:"+Y;if(!i.cache[V]){let U=Y.replaceAll("@parentProperty","_$_parentProperty").replaceAll("@parent","_$_parent").replaceAll("@property","_$_property").replaceAll("@root","_$_root").replaceAll(/@([.\s)[])/gu,"_$_v$1");if(K)U=U.replaceAll("@path","_$_path");if(this.currEval==="safe"||this.currEval===!0||this.currEval===void 0)i.cache[V]=new this.safeVm.Script(U);else if(this.currEval==="native")i.cache[V]=new this.vm.Script(U);else if(typeof this.currEval==="function"&&this.currEval.prototype&&Object.hasOwn(this.currEval.prototype,"runInNewContext")){let q=this.currEval;i.cache[V]=new q(U)}else if(typeof this.currEval==="function")i.cache[V]={runInNewContext:(q)=>this.currEval(U,q)};else throw TypeError(`Unknown "eval" property "${this.currEval}"`)}try{return i.cache[V].runInNewContext(this.currSandbox)}catch(U){if(this.ignoreEvalErrors)return!1;throw Error("jsonPath: "+U.message+": "+Y)}};i.cache={};i.toPathString=function(Y){let Z=Y,Q=Z.length,X="$";for(let G=1;G<Q;G++)if(!/^(~|\^|@.*?\(\))$/u.test(Z[G]))X+=/^[0-9*]+$/u.test(Z[G])?"["+Z[G]+"]":"['"+Z[G]+"']";return X};i.toPointer=function(Y){let Z=Y,Q=Z.length,X="";for(let G=1;G<Q;G++)if(!/^(~|\^|@.*?\(\))$/u.test(Z[G]))X+="/"+Z[G].toString().replaceAll("~","~0").replaceAll("/","~1");return X};i.toPathArray=function(Y){let{cache:Z}=i;if(Z[Y])return Z[Y].concat();let Q=[],G=Y.replaceAll(/@(?:null|boolean|number|string|integer|undefined|nonFinite|scalar|array|object|function|other)\(\)/gu,";$&;").replaceAll(/[['](\??\(.*?\))[\]'](?!.\])/gu,function($,K){return"[#"+(Q.push(K)-1)+"]"}).replaceAll(/\[['"]([^'\]]*)['"]\]/gu,function($,K){return"['"+K.replaceAll(".","%@%").replaceAll("~","%%@@%%")+"']"}).replaceAll("~",";~;").replaceAll(/['"]?\.['"]?(?![^[]*\])|\[['"]?/gu,";").replaceAll("%@%",".").replaceAll("%%@@%%","~").replaceAll(/(?:;)?(\^+)(?:;)?/gu,function($,K){return";"+K.split("").join(";")+";"}).replaceAll(/;;;|;;/gu,";..;").replaceAll(/;$|'?\]|'$/gu,"").split(";").map(function($){let K=$.match(/#(\d+)/u);return!K||!K[1]?$:Q[K[1]]});return Z[Y]=G,Z[Y].concat()};i.prototype.safeVm={Script:q2};var F7=function(Y,Z,Q){let X=Y.length;for(let G=0;G<X;G++){let $=Y[G];if(Q($))Z.push(Y.splice(G--,1)[0])}};class U2{constructor(Y){this.code=Y}runInNewContext(Y){let Z=this.code,Q=Object.keys(Y),X=[];F7(Q,X,(U)=>{return typeof Y[U]==="function"});let G=Q.map((U)=>{return Y[U]});if(Z=X.reduce((U,q)=>{let M=Y[q].toString();if(!/function/u.test(M))M="function "+M;return"var "+q+"="+M+";"+U},"")+Z,!/(['"])use strict\1/u.test(Z)&&!Q.includes("arguments"))Z="var arguments = undefined;"+Z;Z=Z.replace(/;\s*$/u,"");let K=Z.lastIndexOf(";"),V=K!==-1?Z.slice(0,K+1)+" return "+Z.slice(K+1):" return "+Z;return Function(...Q,V)(...G)}}i.prototype.vm={Script:U2};async function F2(Y,Z,Q){let X=Q.stringify(),G=Y.staticLanguage??"auto",$={data:X,language:G,enabledOnly:"false",level:Y.pickyMode?"picky":"default"};if(Y.motherTongue)$.motherTongue=Y.motherTongue;if(Y.enabledCategories)$.enabledCategories=Y.enabledCategories;if(Y.disabledCategories)$.disabledCategories=Y.disabledCategories;if(Y.enabledRules)$.enabledRules=Y.enabledRules;if(Y.disabledRules)$.disabledRules=Y.disabledRules;if(G=="auto")$.preferredVariants=Object.values(Y.languageVariety).join(",");if(g1(Y.serverUrl)!=="standard"&&Y.apikey&&Y.username)$.username=Y.username,$.apiKey=Y.apikey;let V=await t1({url:`${Y.serverUrl}/v2/check`,method:"POST",body:new URLSearchParams($).toString(),headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"}});if(V.json==null)throw Error("Error processing response from LanguageTool.");return L0("$.matches[*]",V.json).map((q)=>{let M=I1("$.offset@number()",q),F=M+I1("$.length@number()",q);return{range:{from:Z+M,to:Z+F},text:Q.extractSlice(M,F)||"",title:I1("$.shortMessage@string()",q),message:I1("$.message@string()",q),replacements:L0("$.replacements[*].value@string()",q),categoryId:I1("$.rule.category.id@string()",q),ruleId:I1("$.rule.id@string()",q)}})}async function L2(Y){let Z=await Y5.requestUrl({url:`${Y}/v2/languages`}).json;if(Z==null||!(Z instanceof Array))throw Error("Error processing response from LanguageTool.");return Z}async function R2(Y){if(Y.username==null||Y.apikey==null)throw Error("Syncing words is only supported for premium users");try{let Z=(await t1({url:I0(`${Y.serverUrl}/v2/words`,{username:Y.username,apiKey:Y.apikey,limit:"1000"}).href})).json;return L0("$.words[*]@string()",Z)}catch(Z){throw Error(`Requesting words failed
${Z}`)}}async function _2(Y,Z){if(Y.username==null||Y.apikey==null)throw Error("Syncing words is only supported for premium users");try{let Q=(await t1({url:I0(`${Y.serverUrl}/v2/words/add`,{username:Y.username,apiKey:Y.apikey,word:Z}).href,method:"POST"})).json;return I1("$.added@boolean()",Q)}catch(Q){throw Error(`Adding words failed
${Q}`)}}async function N2(Y,Z){if(Y.username==null||Y.apikey==null)throw Error("Syncing words is only supported for premium users");try{let Q=(await t1({url:I0(`${Y.serverUrl}/v2/words/delete`,{username:Y.username,apiKey:Y.apikey,word:Z}).href,method:"POST"})).json;return I1("$.deleted@boolean()",Q)}catch(Q){throw Error(`Deleting words failed
${Q}`)}}class D2{url="https://qb-grammar-en.languagetool.org/phrasal-paraphraser/subscribe";async query(Y,Z){let Q=Y.slice(0,Z.from).split(/\s+/).length,X=Y.slice(Z.from,Z.to),G={message:{indices:[Q],mode:0,phrases:[X],text:Y},meta:{clientStatus:"string",product:"string",traceID:"string",userID:"string"},response_queue:"string"};try{let $=(await t1({url:this.url,method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(G)})).json;return L0("$.data.suggestions[*][*]@string()",$)}catch($){throw Error(`Requesting synonyms failed
${$}`)}}}class j2{url="https://synonyms.languagetool.org/synonyms/de";async query(Y,Z){let Q=Y.slice(Z.from,Z.to).trim(),X=Y.slice(0,Z.from).split(/\s+/).join("+"),G=Y.slice(Z.to).split(/\s+/).join("+");try{let $=(await t1({url:I0(`${this.url}/${Q}`,{before:X,after:G}).href,method:"GET"})).json;return L0("$.synsets[*].terms[*].term@string()",$)}catch($){throw Error(`Requesting synonyms failed
${$}`)}}}var o1={en:new D2,de:new j2};async function t1(Y){let Z;try{Z=await Y5.requestUrl({...Y,throw:!1})}catch(Q){throw Error(`Request to LanguageTool failed: Please check your connection and server URL.
${Q}`)}if(Z.status===504||Z.status===503)throw Error("Request to LanguageTool timed out. Please try again later.");if(Z.status!==200){let Q=Z.text;if(Q.length>310)Q=Q.substring(0,300)+"...";throw Error(`Request to LanguageTool failed ${Z.status}:
${Q}`)}return Z}function I1(Y,Z){let Q=i({path:Y,json:Z,wrap:!1,eval:!1});if(Q==null)throw Error("Error parsing response.");return Q}function L0(Y,Z){let Q=i({path:Y,json:Z,wrap:!0,eval:!1});if(Q==null||!(Q instanceof Array))throw Error("Error parsing response.");return Q}function I0(Y,Z){let Q=new URL(Y);return Q.search=new URLSearchParams(Z).toString(),Q}function J0(Y){switch(Y){case"COLLOQUIALISMS":case"REDUNDANCY":case"STYLE":case"SYNONYMS":return"lt-style";case"TYPOS":return"lt-major";default:return"lt-minor"}}function e1(Y,Z){let Q=new Set(Y);for(let X of Z)Q.delete(X);return Q}function z2(Y,Z){let Q=new Set(Y);for(let X of Z)Q.add(X);return Q}function T2(Y,Z){let Q=new Set;for(let X of Z)if(Y.has(X))Q.add(X);return Q}function Y0(Y,Z){return Y=Y.toLowerCase(),Z=Z.toLowerCase(),Y>Z?1:Y<Z?-1:0}var O2=5000,L7=250,_0=8,R7={ar:"Arabic",ca:"Catalan",da:"Danish",de:"German",en:"English",es:"Spanish",fr:"French",gl:"Galician",it:"Italian",ja:"Japanese",nl:"Dutch",pl:"Polish",pt:"Portuguese",ru:"Russian",sv:"Swedish",uk:"Ukrainian",zh:"Chinese"};class S0{url;requestsPerSec;maxSize;constructor(Y,Z,Q){this.url=Y,this.requestsPerSec=Z,this.maxSize=Q}get minDelay(){return 60/this.requestsPerSec*1000}}var R0={standard:new S0("https://api.languagetool.org",20,20000),premium:new S0("https://api.languagetoolplus.com",80,75000),custom:new S0("",120,1e6)};function g1(Y){for(let[Z,Q]of Object.entries(R0))if(Q.url===Y)return Z;return"custom"}class Z5{_options;constructor(){this._options={...P2}}get options(){return this._options}async update(Y){let Z={...this._options,...Y};if(JSON.stringify(Z)!==JSON.stringify(this._options))this._options=Z,await this.save(this._options)}async load(){let Y=await this.loadOptions();this._options={...P2,...Y}}}var P2={serverUrl:R0.standard.url,autoCheckDelay:R0.standard.minDelay,shouldAutoCheck:!1,languageVariety:{en:"en-US",de:"de-DE",pt:"pt-PT",ca:"ca-ES"},dictionary:[],syncDictionary:!1,remoteDictionary:[],pickyMode:!1,longCheckNotification:!0,injectProperties:!0};function A2(Y,Z){return Y=Y.filter((Q)=>Q.code===Z).filter((Q)=>Q.longCode!==Q.code),Object.fromEntries(Y.map((Q)=>[Q.longCode,Q.name]))}class Q5 extends f.PluginSettingTab{plugin;endpointListeners=[];languageListeners=[];languages=[];constructor(Y,Z){super(Y,Z);this.icon="spell-check",this.plugin=Z}async configureCheckDelay(Y,Z){let Q=R0[Z].minDelay;await this.plugin.settings.update({autoCheckDelay:Math.clamp(this.plugin.settings.options.autoCheckDelay,Q,O2)}),Y.setLimits(Q,O2,L7)}async notifyEndpointChange(Y){for(let Z of this.endpointListeners)await Z(Y.serverUrl)}async configureLanguageVariants(Y,Z){let Q=this.plugin.settings.options.languageVariety,X=A2(this.languages,Z);Q[Z]=Q[Z]??Object.keys(X)[0],Y.addOptions(X).setValue(Q[Z]).onChange(async(G)=>{Q[Z]=G,await this.plugin.settings.update({languageVariety:Q})}),this.languageListeners.push(async(G)=>{while(Y.selectEl.options.length>0)Y.selectEl.remove(0);let $=A2(G,Z);Q[Z]=Q[Z]??Object.keys($)[0],Y.addOptions($).setValue(Q[Z])})}display(){this.displayAsync().catch((Y)=>console.error(Y))}async displayAsync(){let{containerEl:Y}=this;Y.empty();let Z=this.plugin.settings;this.plugin.autoCheckSuppressErrorsUntil=0,this.endpointListeners=[],this.endpointListeners.push(async(q)=>{let M=[];if(q)M=await L2(q);this.languages=M;for(let F of this.languageListeners)await F(M)}),this.endpointListeners.push(async(q)=>{await this.plugin.syncDictionary()}),this.languageListeners=[],new f.Setting(Y).setName("Error logs").setDesc(`${this.plugin.logs.length} messages`).addButton((q)=>{q.setButtonText("Copy to clipboard").onClick(async()=>{await window.navigator.clipboard.writeText(this.plugin.logs.join(`
`)),new f.Notice("Logs copied to clipboard")})});let Q=g1(Z.options.serverUrl),X=null,G=null,$=null;new f.Setting(Y).setName("Endpoint").setDesc("Choose the LanguageTool server URL").then((q)=>{q.controlEl.classList.add("lt-settings-grid");let M=null,F=null;q.addDropdown((R)=>{M=R,R.addOptions({standard:"(Standard) api.languagetool.org",premium:"(Premium) api.languagetoolplus.com",custom:"Custom URL"}).setValue(Q).onChange(async(L)=>{if(Q=L,await Z.update({serverUrl:R0[Q].url}),F)F.setValue(Z.options.serverUrl).setDisabled(L!=="custom");if(X)await this.configureCheckDelay(X,Q);await this.notifyEndpointChange(Z.options)})}),q.addText((R)=>{F=R,R.setPlaceholder("http://your-custom-url.com").setValue(Z.options.serverUrl).setDisabled(Q!=="custom").onChange(async(L)=>{if(await Z.update({serverUrl:L.replace(/\/v2\/check\/$/,"").replace(/\/$/,"")}),Q=g1(Z.options.serverUrl),Q!=="custom")M?.setValue(Q),F?.setDisabled(!0);if(G)window.clearTimeout(G);G=window.setTimeout(()=>{this.notifyEndpointChange(Z.options).then(()=>{if($)$.hide();$=new f.Notice("Successfully contacted LanguageTool server.",3000)},(j)=>{let I=j;if($)$.hide();$=new f.Notice(`Error contacting LanguageTool server:
${I.message}`,3000)})},600)})})}),new f.Setting(Y).setName("API username").setDesc("Enter a username/mail for API access").addText((q)=>q.setPlaceholder("peterlustig@example.com").setValue(Z.options.username||"").onChange(async(M)=>{await Z.update({username:M.replace(/\s+/g,"")})})),new f.Setting(Y).setName("API key").setDesc(createFragment((q)=>{q.createEl("a",{text:"Click here for information about premium access",href:"https://github.com/wrenger/obsidian-languagetool#premium-accounts",attr:{target:"_blank"}})})).addText((q)=>q.setValue(Z.options.apikey||"").onChange(async(M)=>{if(await Z.update({apikey:M.replace(/\s+/g,"")}),Z.options.apikey&&Q!=="premium")new f.Notice("You have entered an API key but you are not using the premium endpoint")})),new f.Setting(Y).setName("Auto check text").setDesc("Check text as you type").addToggle((q)=>{q.setValue(Z.options.shouldAutoCheck).onChange(async(M)=>{await Z.update({shouldAutoCheck:M})})}),new f.Setting(Y).setName("Auto check delay (ms)").setDesc("Time to wait for autocheck after the last key press").addSlider(async(q)=>{X=q,await this.configureCheckDelay(q,Q),q.setValue(Z.options.autoCheckDelay).onChange(async(M)=>{await Z.update({autoCheckDelay:M})}).setDynamicTooltip()});function K(q){if(q.appendText("Enables the context menu for synonyms fetched from"),q.createEl("br"),Z.options.synonyms!=null){let M=o1[Z.options.synonyms];if(!M){q.appendText(" (unknown API)");return}q.createEl("a",{text:M.url,href:M.url,attr:{target:"_blank"}})}else q.appendText("(none)")}let V=new f.Setting(Y).setName("Find synonyms").setDesc(createFragment(K));V.addDropdown((q)=>{q.addOption("none","---");for(let M of Object.keys(o1))q.addOption(M,M);q.setValue(Z.options.synonyms??"none").onChange(async(M)=>{await Z.update({synonyms:M!=="none"?M:void 0}),V.setDesc(createFragment(K))})}),new f.Setting(Y).setName("Language").setHeading(),new f.Setting(Y).setName("Mother tongue").setDesc("Set mother tongue if you want to be warned about false friends when writing in other languages. This setting will also be used for automatic language detection.").addDropdown((q)=>{q.addOption("none","---").addOptions(R7).setValue(Z.options.motherTongue??"none").onChange(async(M)=>{await Z.update({motherTongue:M!=="none"?M:void 0})})}),new f.Setting(Y).setName("Static language").setDesc("Set a static language that will always be used(LanguageTool tries to auto detect the language, this is usually not necessary)").addDropdown((q)=>{this.languageListeners.push(async(M)=>{let F=M.filter((R)=>R.longCode.length>2||R.longCode!==R.code||M.filter((L)=>L.code==R.code).length<=1);while(q.selectEl.options.length>0)q.selectEl.remove(0);q.addOption("auto","Auto detect").addOptions(Object.fromEntries(F.map((R)=>[R.longCode,R.name]))).setValue(Z.options.staticLanguage??"auto").onChange(async(R)=>{await Z.update({staticLanguage:R!=="auto"?R:void 0})})})}),new f.Setting(Y).setName("Language varieties").setHeading().setDesc("Some languages have varieties depending on the country they are spoken in.");let U={en:"English",de:"German",pt:"Portuguese",ca:"Catalan"};for(let[q,M]of Object.entries(U))new f.Setting(Y).setName(`Interpret ${M} as`).addDropdown(async(F)=>{await this.configureLanguageVariants(F,q)});new f.Setting(Y).setName("Spellcheck dictionary").setHeading(),new f.Setting(Y).setName("Ignored words").setDesc("Words that should not be highlighted as spelling mistakes.").addButton((q)=>{q.setIcon("settings").setTooltip("Edit dictionary").onClick(()=>{new C2(this.app,this.plugin).open()})}),new f.Setting(Y).setName("Sync with LanguageTool").setDesc("This is only supported for premium users.").addToggle((q)=>{q.setDisabled(Q!=="premium").setValue(Z.options.syncDictionary).onChange(async(M)=>{if(await Z.update({syncDictionary:M}),M)await this.plugin.syncDictionary()}),this.endpointListeners.push(async(M)=>{q.setDisabled(g1(M)!=="premium")})}),new f.Setting(Y).setName("Rule categories").setHeading().setDesc(createFragment((q)=>{q.appendText("The picky mode enables a lot of extra categories and rules. Additionally, you can enable or disable specific rules down below."),q.createEl("br"),q.createEl("a",{text:"Click here for a list of rules and categories",href:"https://community.languagetool.org/rule/list",attr:{target:"_blank"}})})),new f.Setting(Y).setName("Picky mode").setDesc("Provides more style and tonality suggestions, detects long or complex sentences, recognizes colloquialism and redundancies, proactively suggests synonyms for commonly overused words").addToggle((q)=>{q.setValue(Z.options.pickyMode).onChange(async(M)=>{await Z.update({pickyMode:M})})}),new f.Setting(Y).setName("Enabled categories").setDesc("Comma-separated list of categories").addText((q)=>q.setPlaceholder("CATEGORY_1,CATEGORY_2").setValue(Z.options.enabledCategories??"").onChange(async(M)=>{await Z.update({enabledCategories:M.replace(/\s+/g,"")})})),new f.Setting(Y).setName("Disabled categories").setDesc("Comma-separated list of categories").addText((q)=>q.setPlaceholder("CATEGORY_1,CATEGORY_2").setValue(Z.options.disabledCategories??"").onChange(async(M)=>{await Z.update({disabledCategories:M.replace(/\s+/g,"")})})),new f.Setting(Y).setName("Enabled rules").setDesc("Comma-separated list of rules").addText((q)=>q.setPlaceholder("RULE_1,RULE_2").setValue(Z.options.enabledRules??"").onChange(async(M)=>{await Z.update({enabledRules:M.replace(/\s+/g,"")})})),new f.Setting(Y).setName("Disabled rules").setDesc("Comma-separated list of rules").addText((q)=>q.setPlaceholder("RULE_1,RULE_2").setValue(Z.options.disabledRules??"").onChange(async(M)=>{await Z.update({disabledRules:M.replace(/\s+/g,"")})})),new f.Setting(Y).setName("Advanced").setHeading(),new f.Setting(Y).setName("Long check notification").setDesc("Show the 'check spelling...' notification when a manual check is taking a long time").addToggle((q)=>{q.setValue(Z.options.longCheckNotification).onChange(async(M)=>{await Z.update({longCheckNotification:M})})}),new f.Setting(Y).setName("Inject property types").setDesc("Define the properties for note-specific LanguageTool settings.").addToggle((q)=>{q.setValue(Z.options.injectProperties).onChange(async(M)=>{await Z.update({injectProperties:M}),this.plugin.injectProperties(M)})}),await this.notifyEndpointChange(Z.options)}}class C2 extends f.Modal{plugin;words;constructor(Y,Z){super(Y);this.setTitle("Spellcheck dictionary"),this.plugin=Z,this.words=Z.settings.options.dictionary}async onOpen(){this.words=this.plugin.settings.options.dictionary;let{contentEl:Y}=this,Z=(K)=>{K.replaceChildren(...this.words.map((V)=>K.createDiv({cls:"multi-select-pill"},(U)=>{U.createDiv({cls:"multi-select-pill-content"},(q)=>q.createSpan({text:V})),U.createDiv({cls:"multi-select-pill-remove-button"},(q)=>{q.appendChild(f.getIcon("x")),q.onClickEvent(()=>{this.words.remove(V),Z(K)})})})))},Q=null;Y.createDiv({cls:["multi-select-container","lt-dictionary-words"]},(K)=>{Q=K,Z(K)}),this.plugin.syncDictionary().then(()=>{if(this.words=this.plugin.settings.options.dictionary,Q)Z(Q)},(K)=>{});let X="",G=null,$=()=>{if(X){if(this.words=[...new Set([...this.words,X])].sort(Y0),Q)Z(Q);if(G)G.setValue("");X=""}};new f.Setting(Y).setName("Add").addText((K)=>{G=K.setValue(X).onChange((V)=>X=V.trim()),K.inputEl.addEventListener("keypress",(V)=>{if(V.key==="Enter")$()})}).addExtraButton((K)=>{K.setIcon("plus").setTooltip("Add").onClick(()=>{$()})})}onClose(){this.onCloseAsync().catch((Y)=>console.error(Y))}async onCloseAsync(){this.contentEl.empty(),await this.plugin.settings.update({dictionary:this.words}),await this.plugin.syncDictionary()}}var I2=require("@codemirror/view"),J2=require("obsidian");function S2(Y){let Z=-1,Q={from:1/0,to:-1/0};return I2.EditorView.updateListener.of((X)=>{let G=Y.getActiveFileSettings();if(!X.docChanged||!G.shouldAutoCheck)return;X.changes.iterChangedRanges((K,V,U,q)=>{Q.from=Math.min(Q.from,U,q),Q.to=Math.max(Q.to,U,q)});let $=X.view;window.clearTimeout(Z),Z=window.setTimeout(()=>{let K=Q;Q={from:1/0,to:-1/0},Y.runDetection($,!0,K).then(()=>{},(V)=>{let U=V;if(Date.now()>Y.autoCheckSuppressErrorsUntil)Y.autoCheckSuppressErrorsUntil=Date.now()+900000,new J2.Notice(`Auto-check failed:
`+U.message,1e4);console.error("Auto-check failed",V)})},Y.settings.options.autoCheckDelay)})}var Z0=require("@codemirror/view"),h1=require("@codemirror/state");var E0=h1.StateEffect.define(),N0=h1.StateEffect.define(),_1=h1.StateEffect.define(),x1=h1.StateEffect.define();function E2(Y,Z){return Y.from<=Z.from&&Z.from<=Y.to||Y.from<=Z.to&&Z.to<=Y.to||Z.from<=Y.from&&Y.from<=Z.to||Z.from<=Y.to&&Y.to<=Z.to}var P1=h1.StateField.define({create(){return Z0.Decoration.none},update(Y,Z){if(Y=Y.map(Z.changes),Z.docChanged&&Z.selection&&Y.size)Y=Y.update({filter:(Q,X)=>!E2({from:Q,to:X},Z.selection.main)});for(let Q of Z.effects)if(Q.is(E0)){let X=Q.value,G=X.range;Y=Y.update({add:[Z0.Decoration.mark({class:`lt-underline ${J0(X.categoryId)}`,underline:X}).range(G.from,G.to)]})}else if(Q.is(N0))Y=Z0.Decoration.none;else if(Q.is(_1))Y=Y.update({filterFrom:Q.value.from,filterTo:Q.value.to,filter:(X,G)=>!E2({from:X,to:G},Q.value)});else if(Q.is(x1))Y=Y.update({filter:(X,G,$)=>!Q.value($.spec.underline)});return Y},provide:(Y)=>Z0.EditorView.decorations.from(Y)});var w0=require("@codemirror/view");var k1=require("obsidian");function _7(Y,Z,Q,X){let G=Q.replacements.slice(0,_0/2),$=Q.categoryId,K=Q.ruleId;return createDiv({cls:["lt-tooltip",J0($)]},(V)=>{if(Q.title)V.createSpan({cls:"lt-title",text:Q.title});if(Q.message)V.createSpan({cls:"lt-message",text:Q.message});V.createDiv({cls:"lt-bottom"},(U)=>{U.createDiv({cls:"lt-buttoncontainer"},(q)=>{for(let M of G){let F=new k1.ButtonComponent(q);F.setButtonText(M||"(delete)"),F.onClick(()=>{Z.dispatch({changes:[{...X,insert:M}],effects:[_1.of(X)]})})}})}),V.createDiv({cls:"lt-ignore-container"},(U)=>{if($==="TYPOS")U.createDiv({cls:"lt-ignore-btn"},(q)=>{k1.setIcon(q.createSpan(),"plus-with-circle"),q.createSpan({text:"Add to dictionary"}),q.onclick=async()=>{let M=[...Y.settings.options.dictionary,Q.text.trim()];await Y.settings.update({dictionary:M}),Z.dispatch({effects:[x1.of((F)=>F.text===Q.text)]})}});else if(U.createDiv({cls:"lt-ignore-btn"},(q)=>{k1.setIcon(q.createSpan(),"cross"),q.createSpan({text:"Ignore"}),q.onclick=()=>Z.dispatch({effects:[_1.of(X)]})}),$!=="SYNONYMS")U.createDiv({cls:"lt-ignore-btn"},(q)=>{k1.setIcon(q.createSpan(),"circle-off"),q.createSpan({text:"Disable rule"}),q.onclick=async()=>{let M=Y.settings.options.disabledRules;if(M)M+=","+K;else M=K;await Y.settings.update({disabledRules:M}),Z.dispatch({effects:[x1.of((F)=>F.ruleId===K)]})}});U.createDiv({cls:"lt-info-container"},(q)=>{q.createDiv({cls:"lt-info-button clickable-icon"},(M)=>{k1.setIcon(M,"info"),M.onclick=()=>{let F=activeDocument.getElementsByClassName("lt-info-box").item(0);if(F)F.toggleAttribute("hidden")}})})}),V.createDiv({cls:"lt-info-box",attr:{hidden:!0}},(U)=>{U.createDiv({cls:"lt-info",text:`Category: ${$}`}),U.createDiv({cls:"lt-info",text:`Rule: ${K}`}),U.createDiv({cls:"lt-info",text:`Text: ${Q.text} (${X.from}-${X.to})`})})})}function N7(Y,Z,Q,X){let G=Z.state,$=G.field(P1);if($.size===0||G.selection.ranges.length>1)return null;let K=$.iter(Q);if(K.value!=null&&K.from<=Q&&K.to>=Q){let V=K.value.spec.underline;return{pos:K.from,end:K.to,above:!0,strictSide:!1,arrow:!1,clip:!1,create:(U)=>({dom:_7(Y,U,V,K)})}}return null}function w2(Y){return w0.hoverTooltip(N7.bind(null,Y),{hideOnChange:!0})}var y2=w0.EditorView.baseTheme({".cm-tooltip.cm-tooltip-hover":{padding:"var(--size-2-3)",border:"1px solid var(--background-modifier-border-hover)",backgroundColor:"var(--background-secondary)",borderRadius:"var(--radius-m)",boxShadow:"var(--shadow-s)",zIndex:"var(--layer-menu)",userSelect:"none",overflow:"hidden","& > .lt-tooltip":{fontFamily:"var(--default-font)",fontSize:"var(--font-ui-small)",width:"300px",lineHeight:1.5,"& > .lt-title":{display:"block",fontWeight:600,marginBottom:"6px",padding:"0 12px",textDecoration:"underline 2px var(--lt-highlight)","-webkit-text-decoration":"underline 2px var(--lt-highlight)"},"& > .lt-message":{display:"block",padding:"0 12px"},"& > .lt-bottom":{minHeight:"10px",padding:"0 12px",position:"relative","& > .lt-buttoncontainer":{"&:not(:empty)":{paddingTop:"10px"},"& > button":{marginRight:"4px",marginBottom:"4px",padding:"4px 6px"}}},"& > .lt-ignore-container":{display:"flex","& > .lt-ignore-btn":{fontSize:"var(--font-ui-small)",padding:"4px",display:"flex",flex:1,width:"100%",textAlign:"left",alignItems:"center",lineHeight:1,color:"var(--text-muted)","& > span":{display:"flex","&:last-child":{marginLeft:"5px"}},"&:hover":{color:"var(--text-normal)"}},"& > .lt-info-container":{display:"flex",flex:0,"& > .lt-info-button":{color:"var(--text-faint)",height:"100%"}}},"& > .lt-info-box":{padding:"5px 0px 0px 0px",overflowX:"scroll",color:"var(--text-muted)"}}},".lt-underline":{cursor:"pointer",transition:"background-color 100ms ease-out",textDecoration:"wavy underline var(--lt-highlight)","-webkit-text-decoration":"wavy underline var(--lt-highlight)","&:hover":{backgroundColor:"color-mix(in srgb, var(--lt-highlight), transparent 80%)"}}});function b2(Y){return[P1,S2(Y),w2(Y),y2]}class g2 extends Error{name="Assertion";code="ERR_ASSERTION";constructor(Y,Z,Q,X,G){super(Y);if(Error.captureStackTrace)Error.captureStackTrace(this,this.constructor);this.actual=Z,this.expected=Q,this.generated=G,this.operator=X}}function _(Y,Z){D7(Boolean(Y),!1,!0,"ok","Expected value to be truthy",Z)}function D7(Y,Z,Q,X,G,$){if(!Y)throw $ instanceof Error?$:new g2($||G,Z,Q,X,!$)}var j7={};function X5(Y,Z){let Q=Z||j7,X=typeof Q.includeImageAlt==="boolean"?Q.includeImageAlt:!0,G=typeof Q.includeHtml==="boolean"?Q.includeHtml:!0;return x2(Y,X,G)}function x2(Y,Z,Q){if(B7(Y)){if("value"in Y)return Y.type==="html"&&!Q?"":Y.value;if(Z&&"alt"in Y&&Y.alt)return Y.alt;if("children"in Y)return h2(Y.children,Z,Q)}if(Array.isArray(Y))return h2(Y,Z,Q);return""}function h2(Y,Z,Q){let X=[],G=-1;while(++G<Y.length)X[G]=x2(Y[G],Z,Q);return X.join("")}function B7(Y){return Boolean(Y&&typeof Y==="object")}var k2=document.createElement("i");function Q0(Y){let Z="&"+Y+";";k2.innerHTML=Z;let Q=k2.textContent;if(Q.charCodeAt(Q.length-1)===59&&Y!=="semi")return!1;return Q===Z?!1:Q}var H={carriageReturn:-5,lineFeed:-4,carriageReturnLineFeed:-3,horizontalTab:-2,virtualSpace:-1,eof:null,nul:0,soh:1,stx:2,etx:3,eot:4,enq:5,ack:6,bel:7,bs:8,ht:9,lf:10,vt:11,ff:12,cr:13,so:14,si:15,dle:16,dc1:17,dc2:18,dc3:19,dc4:20,nak:21,syn:22,etb:23,can:24,em:25,sub:26,esc:27,fs:28,gs:29,rs:30,us:31,space:32,exclamationMark:33,quotationMark:34,numberSign:35,dollarSign:36,percentSign:37,ampersand:38,apostrophe:39,leftParenthesis:40,rightParenthesis:41,asterisk:42,plusSign:43,comma:44,dash:45,dot:46,slash:47,digit0:48,digit1:49,digit2:50,digit3:51,digit4:52,digit5:53,digit6:54,digit7:55,digit8:56,digit9:57,colon:58,semicolon:59,lessThan:60,equalsTo:61,greaterThan:62,questionMark:63,atSign:64,uppercaseA:65,uppercaseB:66,uppercaseC:67,uppercaseD:68,uppercaseE:69,uppercaseF:70,uppercaseG:71,uppercaseH:72,uppercaseI:73,uppercaseJ:74,uppercaseK:75,uppercaseL:76,uppercaseM:77,uppercaseN:78,uppercaseO:79,uppercaseP:80,uppercaseQ:81,uppercaseR:82,uppercaseS:83,uppercaseT:84,uppercaseU:85,uppercaseV:86,uppercaseW:87,uppercaseX:88,uppercaseY:89,uppercaseZ:90,leftSquareBracket:91,backslash:92,rightSquareBracket:93,caret:94,underscore:95,graveAccent:96,lowercaseA:97,lowercaseB:98,lowercaseC:99,lowercaseD:100,lowercaseE:101,lowercaseF:102,lowercaseG:103,lowercaseH:104,lowercaseI:105,lowercaseJ:106,lowercaseK:107,lowercaseL:108,lowercaseM:109,lowercaseN:110,lowercaseO:111,lowercaseP:112,lowercaseQ:113,lowercaseR:114,lowercaseS:115,lowercaseT:116,lowercaseU:117,lowercaseV:118,lowercaseW:119,lowercaseX:120,lowercaseY:121,lowercaseZ:122,leftCurlyBrace:123,verticalBar:124,rightCurlyBrace:125,tilde:126,del:127,byteOrderMarker:65279,replacementCharacter:65533};var C={attentionSideAfter:2,attentionSideBefore:1,atxHeadingOpeningFenceSizeMax:6,autolinkDomainSizeMax:63,autolinkSchemeSizeMax:32,cdataOpeningString:"CDATA[",characterGroupPunctuation:2,characterGroupWhitespace:1,characterReferenceDecimalSizeMax:7,characterReferenceHexadecimalSizeMax:6,characterReferenceNamedSizeMax:31,codeFencedSequenceSizeMin:3,contentTypeContent:"content",contentTypeDocument:"document",contentTypeFlow:"flow",contentTypeString:"string",contentTypeText:"text",hardBreakPrefixSizeMin:2,htmlBasic:6,htmlCdata:5,htmlComment:2,htmlComplete:7,htmlDeclaration:4,htmlInstruction:3,htmlRawSizeMax:8,htmlRaw:1,linkResourceDestinationBalanceMax:32,linkReferenceSizeMax:999,listItemValueSizeMax:10,numericBaseDecimal:10,numericBaseHexadecimal:16,tabSize:4,thematicBreakMarkerCountMin:3,v8MaxSafeChunkSize:1e4};var W={data:"data",whitespace:"whitespace",lineEnding:"lineEnding",lineEndingBlank:"lineEndingBlank",linePrefix:"linePrefix",lineSuffix:"lineSuffix",atxHeading:"atxHeading",atxHeadingSequence:"atxHeadingSequence",atxHeadingText:"atxHeadingText",autolink:"autolink",autolinkEmail:"autolinkEmail",autolinkMarker:"autolinkMarker",autolinkProtocol:"autolinkProtocol",characterEscape:"characterEscape",characterEscapeValue:"characterEscapeValue",characterReference:"characterReference",characterReferenceMarker:"characterReferenceMarker",characterReferenceMarkerNumeric:"characterReferenceMarkerNumeric",characterReferenceMarkerHexadecimal:"characterReferenceMarkerHexadecimal",characterReferenceValue:"characterReferenceValue",codeFenced:"codeFenced",codeFencedFence:"codeFencedFence",codeFencedFenceSequence:"codeFencedFenceSequence",codeFencedFenceInfo:"codeFencedFenceInfo",codeFencedFenceMeta:"codeFencedFenceMeta",codeFlowValue:"codeFlowValue",codeIndented:"codeIndented",codeText:"codeText",codeTextData:"codeTextData",codeTextPadding:"codeTextPadding",codeTextSequence:"codeTextSequence",content:"content",definition:"definition",definitionDestination:"definitionDestination",definitionDestinationLiteral:"definitionDestinationLiteral",definitionDestinationLiteralMarker:"definitionDestinationLiteralMarker",definitionDestinationRaw:"definitionDestinationRaw",definitionDestinationString:"definitionDestinationString",definitionLabel:"definitionLabel",definitionLabelMarker:"definitionLabelMarker",definitionLabelString:"definitionLabelString",definitionMarker:"definitionMarker",definitionTitle:"definitionTitle",definitionTitleMarker:"definitionTitleMarker",definitionTitleString:"definitionTitleString",emphasis:"emphasis",emphasisSequence:"emphasisSequence",emphasisText:"emphasisText",escapeMarker:"escapeMarker",hardBreakEscape:"hardBreakEscape",hardBreakTrailing:"hardBreakTrailing",htmlFlow:"htmlFlow",htmlFlowData:"htmlFlowData",htmlText:"htmlText",htmlTextData:"htmlTextData",image:"image",label:"label",labelText:"labelText",labelLink:"labelLink",labelImage:"labelImage",labelMarker:"labelMarker",labelImageMarker:"labelImageMarker",labelEnd:"labelEnd",link:"link",paragraph:"paragraph",reference:"reference",referenceMarker:"referenceMarker",referenceString:"referenceString",resource:"resource",resourceDestination:"resourceDestination",resourceDestinationLiteral:"resourceDestinationLiteral",resourceDestinationLiteralMarker:"resourceDestinationLiteralMarker",resourceDestinationRaw:"resourceDestinationRaw",resourceDestinationString:"resourceDestinationString",resourceMarker:"resourceMarker",resourceTitle:"resourceTitle",resourceTitleMarker:"resourceTitleMarker",resourceTitleString:"resourceTitleString",setextHeading:"setextHeading",setextHeadingText:"setextHeadingText",setextHeadingLine:"setextHeadingLine",setextHeadingLineSequence:"setextHeadingLineSequence",strong:"strong",strongSequence:"strongSequence",strongText:"strongText",thematicBreak:"thematicBreak",thematicBreakSequence:"thematicBreakSequence",blockQuote:"blockQuote",blockQuotePrefix:"blockQuotePrefix",blockQuoteMarker:"blockQuoteMarker",blockQuotePrefixWhitespace:"blockQuotePrefixWhitespace",listOrdered:"listOrdered",listUnordered:"listUnordered",listItemIndent:"listItemIndent",listItemMarker:"listItemMarker",listItemPrefix:"listItemPrefix",listItemPrefixWhitespace:"listItemPrefixWhitespace",listItemValue:"listItemValue",chunkDocument:"chunkDocument",chunkContent:"chunkContent",chunkFlow:"chunkFlow",chunkText:"chunkText",chunkString:"chunkString"};var M1={ht:"\t",lf:`
`,cr:"\r",space:" ",exclamationMark:"!",quotationMark:'"',numberSign:"#",dollarSign:"$",percentSign:"%",ampersand:"&",apostrophe:"'",leftParenthesis:"(",rightParenthesis:")",asterisk:"*",plusSign:"+",comma:",",dash:"-",dot:".",slash:"/",digit0:"0",digit1:"1",digit2:"2",digit3:"3",digit4:"4",digit5:"5",digit6:"6",digit7:"7",digit8:"8",digit9:"9",colon:":",semicolon:";",lessThan:"<",equalsTo:"=",greaterThan:">",questionMark:"?",atSign:"@",uppercaseA:"A",uppercaseB:"B",uppercaseC:"C",uppercaseD:"D",uppercaseE:"E",uppercaseF:"F",uppercaseG:"G",uppercaseH:"H",uppercaseI:"I",uppercaseJ:"J",uppercaseK:"K",uppercaseL:"L",uppercaseM:"M",uppercaseN:"N",uppercaseO:"O",uppercaseP:"P",uppercaseQ:"Q",uppercaseR:"R",uppercaseS:"S",uppercaseT:"T",uppercaseU:"U",uppercaseV:"V",uppercaseW:"W",uppercaseX:"X",uppercaseY:"Y",uppercaseZ:"Z",leftSquareBracket:"[",backslash:"\\",rightSquareBracket:"]",caret:"^",underscore:"_",graveAccent:"`",lowercaseA:"a",lowercaseB:"b",lowercaseC:"c",lowercaseD:"d",lowercaseE:"e",lowercaseF:"f",lowercaseG:"g",lowercaseH:"h",lowercaseI:"i",lowercaseJ:"j",lowercaseK:"k",lowercaseL:"l",lowercaseM:"m",lowercaseN:"n",lowercaseO:"o",lowercaseP:"p",lowercaseQ:"q",lowercaseR:"r",lowercaseS:"s",lowercaseT:"t",lowercaseU:"u",lowercaseV:"v",lowercaseW:"w",lowercaseX:"x",lowercaseY:"y",lowercaseZ:"z",leftCurlyBrace:"{",verticalBar:"|",rightCurlyBrace:"}",tilde:"~",replacementCharacter:""};function o(Y,Z,Q,X){let G=Y.length,$=0,K;if(Z<0)Z=-Z>G?0:G+Z;else Z=Z>G?G:Z;if(Q=Q>0?Q:0,X.length<C.v8MaxSafeChunkSize)K=Array.from(X),K.unshift(Z,Q),Y.splice(...K);else{if(Q)Y.splice(Z,Q);while($<X.length)K=X.slice($,$+C.v8MaxSafeChunkSize),K.unshift(Z,0),Y.splice(...K),$+=C.v8MaxSafeChunkSize,Z+=C.v8MaxSafeChunkSize}}function $1(Y,Z){if(Y.length>0)return o(Y,Y.length,0,Z),Y;return Z}var v2={}.hasOwnProperty;function y0(Y){let Z={},Q=-1;while(++Q<Y.length)z7(Z,Y[Q]);return Z}function z7(Y,Z){let Q;for(Q in Z){let G=(v2.call(Y,Q)?Y[Q]:void 0)||(Y[Q]={}),$=Z[Q],K;if($)for(K in $){if(!v2.call(G,K))G[K]=[];let V=$[K];T7(G[K],Array.isArray(V)?V:V?[V]:[])}}}function T7(Y,Z){let Q=-1,X=[];while(++Q<Z.length)(Z[Q].add==="after"?Y:X).push(Z[Q]);o(Y,0,0,X)}function b0(Y,Z){let Q=Number.parseInt(Y,Z);if(Q<H.ht||Q===H.vt||Q>H.cr&&Q<H.space||Q>H.tilde&&Q<160||Q>55295&&Q<57344||Q>64975&&Q<65008||(Q&65535)===65535||(Q&65535)===65534||Q>1114111)return M1.replacementCharacter;return String.fromCodePoint(Q)}function G1(Y){return Y.replace(/[\t\n\r ]+/g,M1.space).replace(/^ | $/g,"").toLowerCase().toUpperCase()}var Y1=J1(/[A-Za-z]/),Z1=J1(/[\dA-Za-z]/),m2=J1(/[#-'*+\--9=?A-Z^-~]/);function v1(Y){return Y!==null&&(Y<H.space||Y===H.del)}var D0=J1(/\d/),u2=J1(/[\dA-Fa-f]/),p2=J1(/[!-/:-@[-`{-~]/);function J(Y){return Y!==null&&Y<H.horizontalTab}function l(Y){return Y!==null&&(Y<H.nul||Y===H.space)}function h(Y){return Y===H.horizontalTab||Y===H.virtualSpace||Y===H.space}var m1=J1(/\p{P}|\p{S}/u),N1=J1(/\s/);function J1(Y){return Z;function Z(Q){return Q!==null&&Q>-1&&Y.test(String.fromCharCode(Q))}}function k(Y,Z,Q,X){let G=X?X-1:Number.POSITIVE_INFINITY,$=0;return K;function K(U){if(h(U))return Y.enter(Q),V(U);return Z(U)}function V(U){if(h(U)&&$++<G)return Y.consume(U),V;return Y.exit(Q),Z(U)}}var l2={tokenize:O7};function O7(Y){let Z=Y.attempt(this.parser.constructs.contentInitial,X,G),Q;return Z;function X(V){if(_(V===H.eof||J(V),"expected eol or eof"),V===H.eof){Y.consume(V);return}return Y.enter(W.lineEnding),Y.consume(V),Y.exit(W.lineEnding),k(Y,Z,W.linePrefix)}function G(V){return _(V!==H.eof&&!J(V),"expected anything other than a line ending or EOF"),Y.enter(W.paragraph),$(V)}function $(V){let U=Y.enter(W.chunkText,{contentType:C.contentTypeText,previous:Q});if(Q)Q.next=U;return Q=U,K(V)}function K(V){if(V===H.eof){Y.exit(W.chunkText),Y.exit(W.paragraph),Y.consume(V);return}if(J(V))return Y.consume(V),Y.exit(W.chunkText),$;return Y.consume(V),K}}var i2={tokenize:P7},f2={tokenize:A7};function P7(Y){let Z=this,Q=[],X=0,G,$,K;return V;function V(S){if(X<Q.length){let m=Q[X];return Z.containerState=m[1],_(m[0].continuation,"expected `continuation` to be defined on container construct"),Y.attempt(m[0].continuation,U,q)(S)}return q(S)}function U(S){if(_(Z.containerState,"expected `containerState` to be defined after continuation"),X++,Z.containerState._closeFlow){if(Z.containerState._closeFlow=void 0,G)x();let m=Z.events.length,E=m,P;while(E--)if(Z.events[E][0]==="exit"&&Z.events[E][1].type===W.chunkFlow){P=Z.events[E][1].end;break}_(P,"could not find previous flow chunk"),A(X);let y=m;while(y<Z.events.length)Z.events[y][1].end={...P},y++;return o(Z.events,E+1,0,Z.events.slice(m)),Z.events.length=y,q(S)}return V(S)}function q(S){if(X===Q.length){if(!G)return R(S);if(G.currentConstruct&&G.currentConstruct.concrete)return j(S);Z.interrupt=Boolean(G.currentConstruct&&!G._gfmTableDynamicInterruptHack)}return Z.containerState={},Y.check(f2,M,F)(S)}function M(S){if(G)x();return A(X),R(S)}function F(S){return Z.parser.lazy[Z.now().line]=X!==Q.length,K=Z.now().offset,j(S)}function R(S){return Z.containerState={},Y.attempt(f2,L,j)(S)}function L(S){return _(Z.currentConstruct,"expected `currentConstruct` to be defined on tokenizer"),_(Z.containerState,"expected `containerState` to be defined on tokenizer"),X++,Q.push([Z.currentConstruct,Z.containerState]),R(S)}function j(S){if(S===H.eof){if(G)x();A(0),Y.consume(S);return}return G=G||Z.parser.flow(Z.now()),Y.enter(W.chunkFlow,{_tokenizer:G,contentType:C.contentTypeFlow,previous:$}),I(S)}function I(S){if(S===H.eof){w(Y.exit(W.chunkFlow),!0),A(0),Y.consume(S);return}if(J(S))return Y.consume(S),w(Y.exit(W.chunkFlow)),X=0,Z.interrupt=void 0,V;return Y.consume(S),I}function w(S,m){_(G,"expected `childFlow` to be defined when continuing");let E=Z.sliceStream(S);if(m)E.push(null);if(S.previous=$,$)$.next=S;if($=S,G.defineSkip(S.start),G.write(E),Z.parser.lazy[S.start.line]){let P=G.events.length;while(P--)if(G.events[P][1].start.offset<K&&(!G.events[P][1].end||G.events[P][1].end.offset>K))return;let y=Z.events.length,a=y,r,z;while(a--)if(Z.events[a][0]==="exit"&&Z.events[a][1].type===W.chunkFlow){if(r){z=Z.events[a][1].end;break}r=!0}_(z,"could not find previous flow chunk"),A(X),P=y;while(P<Z.events.length)Z.events[P][1].end={...z},P++;o(Z.events,a+1,0,Z.events.slice(y)),Z.events.length=P}}function A(S){let m=Q.length;while(m-- >S){let E=Q[m];Z.containerState=E[1],_(E[0].exit,"expected `exit` to be defined on container construct"),E[0].exit.call(Z,Y)}Q.length=S}function x(){_(Z.containerState,"expected `containerState` to be defined when closing flow"),_(G,"expected `childFlow` to be defined when closing it"),G.write([H.eof]),$=void 0,G=void 0,Z.containerState._closeFlow=void 0}}function A7(Y,Z,Q){return _(this.parser.constructs.disable.null,"expected `disable.null` to be populated"),k(Y,Y.attempt(this.parser.constructs.document,Z,Q),W.linePrefix,this.parser.constructs.disable.null.includes("codeIndented")?void 0:C.tabSize)}function X0(Y){if(Y===H.eof||l(Y)||N1(Y))return C.characterGroupWhitespace;if(m1(Y))return C.characterGroupPunctuation}function S1(Y,Z,Q){let X=[],G=-1;while(++G<Y.length){let $=Y[G].resolveAll;if($&&!X.includes($))Z=$(Z,Q),X.push($)}return Z}var j0={name:"attention",resolveAll:C7,tokenize:I7};function C7(Y,Z){let Q=-1,X,G,$,K,V,U,q,M;while(++Q<Y.length)if(Y[Q][0]==="enter"&&Y[Q][1].type==="attentionSequence"&&Y[Q][1]._close){X=Q;while(X--)if(Y[X][0]==="exit"&&Y[X][1].type==="attentionSequence"&&Y[X][1]._open&&Z.sliceSerialize(Y[X][1]).charCodeAt(0)===Z.sliceSerialize(Y[Q][1]).charCodeAt(0)){if((Y[X][1]._close||Y[Q][1]._open)&&(Y[Q][1].end.offset-Y[Q][1].start.offset)%3&&!((Y[X][1].end.offset-Y[X][1].start.offset+Y[Q][1].end.offset-Y[Q][1].start.offset)%3))continue;U=Y[X][1].end.offset-Y[X][1].start.offset>1&&Y[Q][1].end.offset-Y[Q][1].start.offset>1?2:1;let F={...Y[X][1].end},R={...Y[Q][1].start};if(r2(F,-U),r2(R,U),K={type:U>1?W.strongSequence:W.emphasisSequence,start:F,end:{...Y[X][1].end}},V={type:U>1?W.strongSequence:W.emphasisSequence,start:{...Y[Q][1].start},end:R},$={type:U>1?W.strongText:W.emphasisText,start:{...Y[X][1].end},end:{...Y[Q][1].start}},G={type:U>1?W.strong:W.emphasis,start:{...K.start},end:{...V.end}},Y[X][1].end={...K.start},Y[Q][1].start={...V.end},q=[],Y[X][1].end.offset-Y[X][1].start.offset)q=$1(q,[["enter",Y[X][1],Z],["exit",Y[X][1],Z]]);if(q=$1(q,[["enter",G,Z],["enter",K,Z],["exit",K,Z],["enter",$,Z]]),_(Z.parser.constructs.insideSpan.null,"expected `insideSpan` to be populated"),q=$1(q,S1(Z.parser.constructs.insideSpan.null,Y.slice(X+1,Q),Z)),q=$1(q,[["exit",$,Z],["enter",V,Z],["exit",V,Z],["exit",G,Z]]),Y[Q][1].end.offset-Y[Q][1].start.offset)M=2,q=$1(q,[["enter",Y[Q][1],Z],["exit",Y[Q][1],Z]]);else M=0;o(Y,X-1,Q-X+3,q),Q=X+q.length-M-2;break}}Q=-1;while(++Q<Y.length)if(Y[Q][1].type==="attentionSequence")Y[Q][1].type="data";return Y}function I7(Y,Z){let Q=this.parser.constructs.attentionMarkers.null,X=this.previous,G=X0(X),$;return K;function K(U){return _(U===H.asterisk||U===H.underscore,"expected asterisk or underscore"),$=U,Y.enter("attentionSequence"),V(U)}function V(U){if(U===$)return Y.consume(U),V;let q=Y.exit("attentionSequence"),M=X0(U);_(Q,"expected `attentionMarkers` to be populated");let F=!M||M===C.characterGroupPunctuation&&G||Q.includes(U),R=!G||G===C.characterGroupPunctuation&&M||Q.includes(X);return q._open=Boolean($===H.asterisk?F:F&&(G||!R)),q._close=Boolean($===H.asterisk?R:R&&(M||!F)),Z(U)}}function r2(Y,Z){Y.column+=Z,Y.offset+=Z,Y._bufferIndex+=Z}var G5={name:"autolink",tokenize:J7};function J7(Y,Z,Q){let X=0;return G;function G(L){return _(L===H.lessThan,"expected `<`"),Y.enter(W.autolink),Y.enter(W.autolinkMarker),Y.consume(L),Y.exit(W.autolinkMarker),Y.enter(W.autolinkProtocol),$}function $(L){if(Y1(L))return Y.consume(L),K;if(L===H.atSign)return Q(L);return q(L)}function K(L){if(L===H.plusSign||L===H.dash||L===H.dot||Z1(L))return X=1,V(L);return q(L)}function V(L){if(L===H.colon)return Y.consume(L),X=0,U;if((L===H.plusSign||L===H.dash||L===H.dot||Z1(L))&&X++<C.autolinkSchemeSizeMax)return Y.consume(L),V;return X=0,q(L)}function U(L){if(L===H.greaterThan)return Y.exit(W.autolinkProtocol),Y.enter(W.autolinkMarker),Y.consume(L),Y.exit(W.autolinkMarker),Y.exit(W.autolink),Z;if(L===H.eof||L===H.space||L===H.lessThan||v1(L))return Q(L);return Y.consume(L),U}function q(L){if(L===H.atSign)return Y.consume(L),M;if(m2(L))return Y.consume(L),q;return Q(L)}function M(L){return Z1(L)?F(L):Q(L)}function F(L){if(L===H.dot)return Y.consume(L),X=0,M;if(L===H.greaterThan)return Y.exit(W.autolinkProtocol).type=W.autolinkEmail,Y.enter(W.autolinkMarker),Y.consume(L),Y.exit(W.autolinkMarker),Y.exit(W.autolink),Z;return R(L)}function R(L){if((L===H.dash||Z1(L))&&X++<C.autolinkDomainSizeMax){let j=L===H.dash?R:F;return Y.consume(L),j}return Q(L)}}var D1={partial:!0,tokenize:S7};function S7(Y,Z,Q){return X;function X($){return h($)?k(Y,G,W.linePrefix)($):G($)}function G($){return $===H.eof||J($)?Z($):Q($)}}var g0={continuation:{tokenize:w7},exit:y7,name:"blockQuote",tokenize:E7};function E7(Y,Z,Q){let X=this;return G;function G(K){if(K===H.greaterThan){let V=X.containerState;if(_(V,"expected `containerState` to be defined in container"),!V.open)Y.enter(W.blockQuote,{_container:!0}),V.open=!0;return Y.enter(W.blockQuotePrefix),Y.enter(W.blockQuoteMarker),Y.consume(K),Y.exit(W.blockQuoteMarker),$}return Q(K)}function $(K){if(h(K))return Y.enter(W.blockQuotePrefixWhitespace),Y.consume(K),Y.exit(W.blockQuotePrefixWhitespace),Y.exit(W.blockQuotePrefix),Z;return Y.exit(W.blockQuotePrefix),Z(K)}}function w7(Y,Z,Q){let X=this;return G;function G(K){if(h(K))return _(X.parser.constructs.disable.null,"expected `disable.null` to be populated"),k(Y,$,W.linePrefix,X.parser.constructs.disable.null.includes("codeIndented")?void 0:C.tabSize)(K);return $(K)}function $(K){return Y.attempt(g0,Z,Q)(K)}}function y7(Y){Y.exit(W.blockQuote)}var h0={name:"characterEscape",tokenize:b7};function b7(Y,Z,Q){return X;function X($){return _($===H.backslash,"expected `\\`"),Y.enter(W.characterEscape),Y.enter(W.escapeMarker),Y.consume($),Y.exit(W.escapeMarker),G}function G($){if(p2($))return Y.enter(W.characterEscapeValue),Y.consume($),Y.exit(W.characterEscapeValue),Y.exit(W.characterEscape),Z;return Q($)}}var x0={name:"characterReference",tokenize:g7};function g7(Y,Z,Q){let X=this,G=0,$,K;return V;function V(F){return _(F===H.ampersand,"expected `&`"),Y.enter(W.characterReference),Y.enter(W.characterReferenceMarker),Y.consume(F),Y.exit(W.characterReferenceMarker),U}function U(F){if(F===H.numberSign)return Y.enter(W.characterReferenceMarkerNumeric),Y.consume(F),Y.exit(W.characterReferenceMarkerNumeric),q;return Y.enter(W.characterReferenceValue),$=C.characterReferenceNamedSizeMax,K=Z1,M(F)}function q(F){if(F===H.uppercaseX||F===H.lowercaseX)return Y.enter(W.characterReferenceMarkerHexadecimal),Y.consume(F),Y.exit(W.characterReferenceMarkerHexadecimal),Y.enter(W.characterReferenceValue),$=C.characterReferenceHexadecimalSizeMax,K=u2,M;return Y.enter(W.characterReferenceValue),$=C.characterReferenceDecimalSizeMax,K=D0,M(F)}function M(F){if(F===H.semicolon&&G){let R=Y.exit(W.characterReferenceValue);if(K===Z1&&!Q0(X.sliceSerialize(R)))return Q(F);return Y.enter(W.characterReferenceMarker),Y.consume(F),Y.exit(W.characterReferenceMarker),Y.exit(W.characterReference),Z}if(K(F)&&G++<$)return Y.consume(F),M;return Q(F)}}var a2={partial:!0,tokenize:x7},k0={concrete:!0,name:"codeFenced",tokenize:h7};function h7(Y,Z,Q){let X=this,G={partial:!0,tokenize:E},$=0,K=0,V;return U;function U(P){return q(P)}function q(P){_(P===H.graveAccent||P===H.tilde,"expected `` ` `` or `~`");let y=X.events[X.events.length-1];return $=y&&y[1].type===W.linePrefix?y[2].sliceSerialize(y[1],!0).length:0,V=P,Y.enter(W.codeFenced),Y.enter(W.codeFencedFence),Y.enter(W.codeFencedFenceSequence),M(P)}function M(P){if(P===V)return K++,Y.consume(P),M;if(K<C.codeFencedSequenceSizeMin)return Q(P);return Y.exit(W.codeFencedFenceSequence),h(P)?k(Y,F,W.whitespace)(P):F(P)}function F(P){if(P===H.eof||J(P))return Y.exit(W.codeFencedFence),X.interrupt?Z(P):Y.check(a2,I,m)(P);return Y.enter(W.codeFencedFenceInfo),Y.enter(W.chunkString,{contentType:C.contentTypeString}),R(P)}function R(P){if(P===H.eof||J(P))return Y.exit(W.chunkString),Y.exit(W.codeFencedFenceInfo),F(P);if(h(P))return Y.exit(W.chunkString),Y.exit(W.codeFencedFenceInfo),k(Y,L,W.whitespace)(P);if(P===H.graveAccent&&P===V)return Q(P);return Y.consume(P),R}function L(P){if(P===H.eof||J(P))return F(P);return Y.enter(W.codeFencedFenceMeta),Y.enter(W.chunkString,{contentType:C.contentTypeString}),j(P)}function j(P){if(P===H.eof||J(P))return Y.exit(W.chunkString),Y.exit(W.codeFencedFenceMeta),F(P);if(P===H.graveAccent&&P===V)return Q(P);return Y.consume(P),j}function I(P){return _(J(P),"expected eol"),Y.attempt(G,m,w)(P)}function w(P){return _(J(P),"expected eol"),Y.enter(W.lineEnding),Y.consume(P),Y.exit(W.lineEnding),A}function A(P){return $>0&&h(P)?k(Y,x,W.linePrefix,$+1)(P):x(P)}function x(P){if(P===H.eof||J(P))return Y.check(a2,I,m)(P);return Y.enter(W.codeFlowValue),S(P)}function S(P){if(P===H.eof||J(P))return Y.exit(W.codeFlowValue),x(P);return Y.consume(P),S}function m(P){return Y.exit(W.codeFenced),Z(P)}function E(P,y,a){let r=0;return z;function z(u){return _(J(u),"expected eol"),P.enter(W.lineEnding),P.consume(u),P.exit(W.lineEnding),X1}function X1(u){return _(X.parser.constructs.disable.null,"expected `disable.null` to be populated"),P.enter(W.codeFencedFence),h(u)?k(P,d,W.linePrefix,X.parser.constructs.disable.null.includes("codeIndented")?void 0:C.tabSize)(u):d(u)}function d(u){if(u===V)return P.enter(W.codeFencedFenceSequence),b(u);return a(u)}function b(u){if(u===V)return r++,P.consume(u),b;if(r>=K)return P.exit(W.codeFencedFenceSequence),h(u)?k(P,v,W.whitespace)(u):v(u);return a(u)}function v(u){if(u===H.eof||J(u))return P.exit(W.codeFencedFence),y(u);return a(u)}}}function x7(Y,Z,Q){let X=this;return G;function G(K){if(K===H.eof)return Q(K);return _(J(K),"expected eol"),Y.enter(W.lineEnding),Y.consume(K),Y.exit(W.lineEnding),$}function $(K){return X.parser.lazy[X.now().line]?Q(K):Z(K)}}var B0={name:"codeIndented",tokenize:v7},k7={partial:!0,tokenize:m7};function v7(Y,Z,Q){let X=this;return G;function G(q){return _(h(q)),Y.enter(W.codeIndented),k(Y,$,W.linePrefix,C.tabSize+1)(q)}function $(q){let M=X.events[X.events.length-1];return M&&M[1].type===W.linePrefix&&M[2].sliceSerialize(M[1],!0).length>=C.tabSize?K(q):Q(q)}function K(q){if(q===H.eof)return U(q);if(J(q))return Y.attempt(k7,K,U)(q);return Y.enter(W.codeFlowValue),V(q)}function V(q){if(q===H.eof||J(q))return Y.exit(W.codeFlowValue),K(q);return Y.consume(q),V}function U(q){return Y.exit(W.codeIndented),Z(q)}}function m7(Y,Z,Q){let X=this;return G;function G(K){if(X.parser.lazy[X.now().line])return Q(K);if(J(K))return Y.enter(W.lineEnding),Y.consume(K),Y.exit(W.lineEnding),G;return k(Y,$,W.linePrefix,C.tabSize+1)(K)}function $(K){let V=X.events[X.events.length-1];return V&&V[1].type===W.linePrefix&&V[2].sliceSerialize(V[1],!0).length>=C.tabSize?Z(K):J(K)?G(K):Q(K)}}var K5={name:"codeText",previous:d2,resolve:u7,tokenize:p7};function u7(Y){let Z=Y.length-4,Q=3,X,G;if((Y[Q][1].type===W.lineEnding||Y[Q][1].type==="space")&&(Y[Z][1].type===W.lineEnding||Y[Z][1].type==="space")){X=Q;while(++X<Z)if(Y[X][1].type===W.codeTextData){Y[Q][1].type=W.codeTextPadding,Y[Z][1].type=W.codeTextPadding,Q+=2,Z-=2;break}}X=Q-1,Z++;while(++X<=Z)if(G===void 0){if(X!==Z&&Y[X][1].type!==W.lineEnding)G=X}else if(X===Z||Y[X][1].type===W.lineEnding){if(Y[G][1].type=W.codeTextData,X!==G+2)Y[G][1].end=Y[X-1][1].end,Y.splice(G+2,X-G-2),Z-=X-G-2,X=G+2;G=void 0}return Y}function d2(Y){return Y!==H.graveAccent||this.events[this.events.length-1][1].type===W.characterEscape}function p7(Y,Z,Q){let X=this,G=0,$,K;return V;function V(R){return _(R===H.graveAccent,"expected `` ` ``"),_(d2.call(X,X.previous),"expected correct previous"),Y.enter(W.codeText),Y.enter(W.codeTextSequence),U(R)}function U(R){if(R===H.graveAccent)return Y.consume(R),G++,U;return Y.exit(W.codeTextSequence),q(R)}function q(R){if(R===H.eof)return Q(R);if(R===H.space)return Y.enter("space"),Y.consume(R),Y.exit("space"),q;if(R===H.graveAccent)return K=Y.enter(W.codeTextSequence),$=0,F(R);if(J(R))return Y.enter(W.lineEnding),Y.consume(R),Y.exit(W.lineEnding),q;return Y.enter(W.codeTextData),M(R)}function M(R){if(R===H.eof||R===H.space||R===H.graveAccent||J(R))return Y.exit(W.codeTextData),q(R);return Y.consume(R),M}function F(R){if(R===H.graveAccent)return Y.consume(R),$++,F;if($===G)return Y.exit(W.codeTextSequence),Y.exit(W.codeText),Z(R);return K.type=W.codeTextData,M(R)}}class $5{constructor(Y){this.left=Y?[...Y]:[],this.right=[]}get(Y){if(Y<0||Y>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+Y+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");if(Y<this.left.length)return this.left[Y];return this.right[this.right.length-Y+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(Y,Z){let Q=Z===null||Z===void 0?Number.POSITIVE_INFINITY:Z;if(Q<this.left.length)return this.left.slice(Y,Q);if(Y>this.left.length)return this.right.slice(this.right.length-Q+this.left.length,this.right.length-Y+this.left.length).reverse();return this.left.slice(Y).concat(this.right.slice(this.right.length-Q+this.left.length).reverse())}splice(Y,Z,Q){let X=Z||0;this.setCursor(Math.trunc(Y));let G=this.right.splice(this.right.length-X,Number.POSITIVE_INFINITY);if(Q)z0(this.left,Q);return G.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(Y){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(Y)}pushMany(Y){this.setCursor(Number.POSITIVE_INFINITY),z0(this.left,Y)}unshift(Y){this.setCursor(0),this.right.push(Y)}unshiftMany(Y){this.setCursor(0),z0(this.right,Y.reverse())}setCursor(Y){if(Y===this.left.length||Y>this.left.length&&this.right.length===0||Y<0&&this.left.length===0)return;if(Y<this.left.length){let Z=this.left.splice(Y,Number.POSITIVE_INFINITY);z0(this.right,Z.reverse())}else{let Z=this.right.splice(this.left.length+this.right.length-Y,Number.POSITIVE_INFINITY);z0(this.left,Z.reverse())}}}function z0(Y,Z){let Q=0;if(Z.length<C.v8MaxSafeChunkSize)Y.push(...Z);else while(Q<Z.length)Y.push(...Z.slice(Q,Q+C.v8MaxSafeChunkSize)),Q+=C.v8MaxSafeChunkSize}function v0(Y){let Z={},Q=-1,X,G,$,K,V,U,q,M=new $5(Y);while(++Q<M.length){while(Q in Z)Q=Z[Q];if(X=M.get(Q),Q&&X[1].type===W.chunkFlow&&M.get(Q-1)[1].type===W.listItemPrefix){if(_(X[1]._tokenizer,"expected `_tokenizer` on subtokens"),U=X[1]._tokenizer.events,$=0,$<U.length&&U[$][1].type===W.lineEndingBlank)$+=2;if($<U.length&&U[$][1].type===W.content)while(++$<U.length){if(U[$][1].type===W.content)break;if(U[$][1].type===W.chunkText)U[$][1]._isInFirstContentOfListItem=!0,$++}}if(X[0]==="enter"){if(X[1].contentType)Object.assign(Z,l7(M,Q)),Q=Z[Q],q=!0}else if(X[1]._container){$=Q,G=void 0;while($--)if(K=M.get($),K[1].type===W.lineEnding||K[1].type===W.lineEndingBlank){if(K[0]==="enter"){if(G)M.get(G)[1].type=W.lineEndingBlank;K[1].type=W.lineEnding,G=$}}else if(K[1].type===W.linePrefix||K[1].type===W.listItemIndent);else break;if(G)X[1].end={...M.get(G)[1].start},V=M.slice(G,Q),V.unshift(X),M.splice(G,Q-G+1,V)}}return o(Y,0,Number.POSITIVE_INFINITY,M.slice(0)),!q}function l7(Y,Z){let Q=Y.get(Z)[1],X=Y.get(Z)[2],G=Z-1,$=[];_(Q.contentType,"expected `contentType` on subtokens");let K=Q._tokenizer;if(!K){if(K=X.parser[Q.contentType](Q.start),Q._contentTypeTextTrailing)K._contentTypeTextTrailing=!0}let V=K.events,U=[],q={},M,F,R=-1,L=Q,j=0,I=0,w=[I];while(L){while(Y.get(++G)[1]!==L);if(_(!F||L.previous===F,"expected previous to match"),_(!F||F.next===L,"expected next to match"),$.push(G),!L._tokenizer){if(M=X.sliceStream(L),!L.next)M.push(H.eof);if(F)K.defineSkip(L.start);if(L._isInFirstContentOfListItem)K._gfmTasklistFirstContentOfListItem=!0;if(K.write(M),L._isInFirstContentOfListItem)K._gfmTasklistFirstContentOfListItem=void 0}F=L,L=L.next}L=Q;while(++R<V.length)if(V[R][0]==="exit"&&V[R-1][0]==="enter"&&V[R][1].type===V[R-1][1].type&&V[R][1].start.line!==V[R][1].end.line)_(L,"expected a current token"),I=R+1,w.push(I),L._tokenizer=void 0,L.previous=void 0,L=L.next;if(K.events=[],L)L._tokenizer=void 0,L.previous=void 0,_(!L.next,"expected no next token");else w.pop();R=w.length;while(R--){let A=V.slice(w[R],w[R+1]),x=$.pop();_(x!==void 0,"expected a start position when splicing"),U.push([x,x+A.length-1]),Y.splice(x,2,A)}U.reverse(),R=-1;while(++R<U.length)q[j+U[R][0]]=j+U[R][1],j+=U[R][1]-U[R][0]-1;return q}var H5={resolve:i7,tokenize:r7},f7={partial:!0,tokenize:a7};function i7(Y){return v0(Y),Y}function r7(Y,Z){let Q;return X;function X(V){return _(V!==H.eof&&!J(V),"expected no eof or eol"),Y.enter(W.content),Q=Y.enter(W.chunkContent,{contentType:C.contentTypeContent}),G(V)}function G(V){if(V===H.eof)return $(V);if(J(V))return Y.check(f7,K,$)(V);return Y.consume(V),G}function $(V){return Y.exit(W.chunkContent),Y.exit(W.content),Z(V)}function K(V){return _(J(V),"expected eol"),Y.consume(V),Y.exit(W.chunkContent),_(Q,"expected previous token"),Q.next=Y.enter(W.chunkContent,{contentType:C.contentTypeContent,previous:Q}),Q=Q.next,G}}function a7(Y,Z,Q){let X=this;return G;function G(K){return _(J(K),"expected a line ending"),Y.exit(W.chunkContent),Y.enter(W.lineEnding),Y.consume(K),Y.exit(W.lineEnding),k(Y,$,W.linePrefix)}function $(K){if(K===H.eof||J(K))return Q(K);_(X.parser.constructs.disable.null,"expected `disable.null` to be populated");let V=X.events[X.events.length-1];if(!X.parser.constructs.disable.null.includes("codeIndented")&&V&&V[1].type===W.linePrefix&&V[2].sliceSerialize(V[1],!0).length>=C.tabSize)return Z(K);return Y.interrupt(X.parser.constructs.flow,Q,Z)(K)}}function m0(Y,Z,Q,X,G,$,K,V,U){let q=U||Number.POSITIVE_INFINITY,M=0;return F;function F(A){if(A===H.lessThan)return Y.enter(X),Y.enter(G),Y.enter($),Y.consume(A),Y.exit($),R;if(A===H.eof||A===H.space||A===H.rightParenthesis||v1(A))return Q(A);return Y.enter(X),Y.enter(K),Y.enter(V),Y.enter(W.chunkString,{contentType:C.contentTypeString}),I(A)}function R(A){if(A===H.greaterThan)return Y.enter($),Y.consume(A),Y.exit($),Y.exit(G),Y.exit(X),Z;return Y.enter(V),Y.enter(W.chunkString,{contentType:C.contentTypeString}),L(A)}function L(A){if(A===H.greaterThan)return Y.exit(W.chunkString),Y.exit(V),R(A);if(A===H.eof||A===H.lessThan||J(A))return Q(A);return Y.consume(A),A===H.backslash?j:L}function j(A){if(A===H.lessThan||A===H.greaterThan||A===H.backslash)return Y.consume(A),L;return L(A)}function I(A){if(!M&&(A===H.eof||A===H.rightParenthesis||l(A)))return Y.exit(W.chunkString),Y.exit(V),Y.exit(K),Y.exit(X),Z(A);if(M<q&&A===H.leftParenthesis)return Y.consume(A),M++,I;if(A===H.rightParenthesis)return Y.consume(A),M--,I;if(A===H.eof||A===H.space||A===H.leftParenthesis||v1(A))return Q(A);return Y.consume(A),A===H.backslash?w:I}function w(A){if(A===H.leftParenthesis||A===H.rightParenthesis||A===H.backslash)return Y.consume(A),I;return I(A)}}function u0(Y,Z,Q,X,G,$){let K=this,V=0,U;return q;function q(L){return _(L===H.leftSquareBracket,"expected `[`"),Y.enter(X),Y.enter(G),Y.consume(L),Y.exit(G),Y.enter($),M}function M(L){if(V>C.linkReferenceSizeMax||L===H.eof||L===H.leftSquareBracket||L===H.rightSquareBracket&&!U||L===H.caret&&!V&&"_hiddenFootnoteSupport"in K.parser.constructs)return Q(L);if(L===H.rightSquareBracket)return Y.exit($),Y.enter(G),Y.consume(L),Y.exit(G),Y.exit(X),Z;if(J(L))return Y.enter(W.lineEnding),Y.consume(L),Y.exit(W.lineEnding),M;return Y.enter(W.chunkString,{contentType:C.contentTypeString}),F(L)}function F(L){if(L===H.eof||L===H.leftSquareBracket||L===H.rightSquareBracket||J(L)||V++>C.linkReferenceSizeMax)return Y.exit(W.chunkString),M(L);if(Y.consume(L),!U)U=!h(L);return L===H.backslash?R:F}function R(L){if(L===H.leftSquareBracket||L===H.backslash||L===H.rightSquareBracket)return Y.consume(L),V++,F;return F(L)}}function p0(Y,Z,Q,X,G,$){let K;return V;function V(R){if(R===H.quotationMark||R===H.apostrophe||R===H.leftParenthesis)return Y.enter(X),Y.enter(G),Y.consume(R),Y.exit(G),K=R===H.leftParenthesis?H.rightParenthesis:R,U;return Q(R)}function U(R){if(R===K)return Y.enter(G),Y.consume(R),Y.exit(G),Y.exit(X),Z;return Y.enter($),q(R)}function q(R){if(R===K)return Y.exit($),U(K);if(R===H.eof)return Q(R);if(J(R))return Y.enter(W.lineEnding),Y.consume(R),Y.exit(W.lineEnding),k(Y,q,W.linePrefix);return Y.enter(W.chunkString,{contentType:C.contentTypeString}),M(R)}function M(R){if(R===K||R===H.eof||J(R))return Y.exit(W.chunkString),q(R);return Y.consume(R),R===H.backslash?F:M}function F(R){if(R===K||R===H.backslash)return Y.consume(R),M;return M(R)}}function u1(Y,Z){let Q;return X;function X(G){if(J(G))return Y.enter(W.lineEnding),Y.consume(G),Y.exit(W.lineEnding),Q=!0,X;if(h(G))return k(Y,X,Q?W.linePrefix:W.lineSuffix)(G);return Z(G)}}var V5={name:"definition",tokenize:n7},d7={partial:!0,tokenize:s7};function n7(Y,Z,Q){let X=this,G;return $;function $(L){return Y.enter(W.definition),K(L)}function K(L){return _(L===H.leftSquareBracket,"expected `[`"),u0.call(X,Y,V,Q,W.definitionLabel,W.definitionLabelMarker,W.definitionLabelString)(L)}function V(L){if(G=G1(X.sliceSerialize(X.events[X.events.length-1][1]).slice(1,-1)),L===H.colon)return Y.enter(W.definitionMarker),Y.consume(L),Y.exit(W.definitionMarker),U;return Q(L)}function U(L){return l(L)?u1(Y,q)(L):q(L)}function q(L){return m0(Y,M,Q,W.definitionDestination,W.definitionDestinationLiteral,W.definitionDestinationLiteralMarker,W.definitionDestinationRaw,W.definitionDestinationString)(L)}function M(L){return Y.attempt(d7,F,F)(L)}function F(L){return h(L)?k(Y,R,W.whitespace)(L):R(L)}function R(L){if(L===H.eof||J(L))return Y.exit(W.definition),X.parser.defined.push(G),Z(L);return Q(L)}}function s7(Y,Z,Q){return X;function X(V){return l(V)?u1(Y,G)(V):Q(V)}function G(V){return p0(Y,$,Q,W.definitionTitle,W.definitionTitleMarker,W.definitionTitleString)(V)}function $(V){return h(V)?k(Y,K,W.whitespace)(V):K(V)}function K(V){return V===H.eof||J(V)?Z(V):Q(V)}}var W5={name:"hardBreakEscape",tokenize:c7};function c7(Y,Z,Q){return X;function X($){return _($===H.backslash,"expected `\\`"),Y.enter(W.hardBreakEscape),Y.consume($),G}function G($){if(J($))return Y.exit(W.hardBreakEscape),Z($);return Q($)}}var q5={name:"headingAtx",resolve:o7,tokenize:t7};function o7(Y,Z){let Q=Y.length-2,X=3,G,$;if(Y[X][1].type===W.whitespace)X+=2;if(Q-2>X&&Y[Q][1].type===W.whitespace)Q-=2;if(Y[Q][1].type===W.atxHeadingSequence&&(X===Q-1||Q-4>X&&Y[Q-2][1].type===W.whitespace))Q-=X+1===Q?2:4;if(Q>X)G={type:W.atxHeadingText,start:Y[X][1].start,end:Y[Q][1].end},$={type:W.chunkText,start:Y[X][1].start,end:Y[Q][1].end,contentType:C.contentTypeText},o(Y,X,Q-X+1,[["enter",G,Z],["enter",$,Z],["exit",$,Z],["exit",G,Z]]);return Y}function t7(Y,Z,Q){let X=0;return G;function G(M){return Y.enter(W.atxHeading),$(M)}function $(M){return _(M===H.numberSign,"expected `#`"),Y.enter(W.atxHeadingSequence),K(M)}function K(M){if(M===H.numberSign&&X++<C.atxHeadingOpeningFenceSizeMax)return Y.consume(M),K;if(M===H.eof||l(M))return Y.exit(W.atxHeadingSequence),V(M);return Q(M)}function V(M){if(M===H.numberSign)return Y.enter(W.atxHeadingSequence),U(M);if(M===H.eof||J(M))return Y.exit(W.atxHeading),Z(M);if(h(M))return k(Y,V,W.whitespace)(M);return Y.enter(W.atxHeadingText),q(M)}function U(M){if(M===H.numberSign)return Y.consume(M),U;return Y.exit(W.atxHeadingSequence),V(M)}function q(M){if(M===H.eof||M===H.numberSign||l(M))return Y.exit(W.atxHeadingText),V(M);return Y.consume(M),q}}var n2=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],M5=["pre","script","style","textarea"];var U5={concrete:!0,name:"htmlFlow",resolveTo:Z4,tokenize:Q4},e7={partial:!0,tokenize:G4},Y4={partial:!0,tokenize:X4};function Z4(Y){let Z=Y.length;while(Z--)if(Y[Z][0]==="enter"&&Y[Z][1].type===W.htmlFlow)break;if(Z>1&&Y[Z-2][1].type===W.linePrefix)Y[Z][1].start=Y[Z-2][1].start,Y[Z+1][1].start=Y[Z-2][1].start,Y.splice(Z-2,2);return Y}function Q4(Y,Z,Q){let X=this,G,$,K,V,U;return q;function q(D){return M(D)}function M(D){return _(D===H.lessThan,"expected `<`"),Y.enter(W.htmlFlow),Y.enter(W.htmlFlowData),Y.consume(D),F}function F(D){if(D===H.exclamationMark)return Y.consume(D),R;if(D===H.slash)return Y.consume(D),$=!0,I;if(D===H.questionMark)return Y.consume(D),G=C.htmlInstruction,X.interrupt?Z:N;if(Y1(D))return _(D!==null),Y.consume(D),K=String.fromCharCode(D),w;return Q(D)}function R(D){if(D===H.dash)return Y.consume(D),G=C.htmlComment,L;if(D===H.leftSquareBracket)return Y.consume(D),G=C.htmlCdata,V=0,j;if(Y1(D))return Y.consume(D),G=C.htmlDeclaration,X.interrupt?Z:N;return Q(D)}function L(D){if(D===H.dash)return Y.consume(D),X.interrupt?Z:N;return Q(D)}function j(D){let W1=C.cdataOpeningString;if(D===W1.charCodeAt(V++)){if(Y.consume(D),V===W1.length)return X.interrupt?Z:d;return j}return Q(D)}function I(D){if(Y1(D))return _(D!==null),Y.consume(D),K=String.fromCharCode(D),w;return Q(D)}function w(D){if(D===H.eof||D===H.slash||D===H.greaterThan||l(D)){let W1=D===H.slash,w1=K.toLowerCase();if(!W1&&!$&&M5.includes(w1))return G=C.htmlRaw,X.interrupt?Z(D):d(D);if(n2.includes(K.toLowerCase())){if(G=C.htmlBasic,W1)return Y.consume(D),A;return X.interrupt?Z(D):d(D)}return G=C.htmlComplete,X.interrupt&&!X.parser.lazy[X.now().line]?Q(D):$?x(D):S(D)}if(D===H.dash||Z1(D))return Y.consume(D),K+=String.fromCharCode(D),w;return Q(D)}function A(D){if(D===H.greaterThan)return Y.consume(D),X.interrupt?Z:d;return Q(D)}function x(D){if(h(D))return Y.consume(D),x;return z(D)}function S(D){if(D===H.slash)return Y.consume(D),z;if(D===H.colon||D===H.underscore||Y1(D))return Y.consume(D),m;if(h(D))return Y.consume(D),S;return z(D)}function m(D){if(D===H.dash||D===H.dot||D===H.colon||D===H.underscore||Z1(D))return Y.consume(D),m;return E(D)}function E(D){if(D===H.equalsTo)return Y.consume(D),P;if(h(D))return Y.consume(D),E;return S(D)}function P(D){if(D===H.eof||D===H.lessThan||D===H.equalsTo||D===H.greaterThan||D===H.graveAccent)return Q(D);if(D===H.quotationMark||D===H.apostrophe)return Y.consume(D),U=D,y;if(h(D))return Y.consume(D),P;return a(D)}function y(D){if(D===U)return Y.consume(D),U=null,r;if(D===H.eof||J(D))return Q(D);return Y.consume(D),y}function a(D){if(D===H.eof||D===H.quotationMark||D===H.apostrophe||D===H.slash||D===H.lessThan||D===H.equalsTo||D===H.greaterThan||D===H.graveAccent||l(D))return E(D);return Y.consume(D),a}function r(D){if(D===H.slash||D===H.greaterThan||h(D))return S(D);return Q(D)}function z(D){if(D===H.greaterThan)return Y.consume(D),X1;return Q(D)}function X1(D){if(D===H.eof||J(D))return d(D);if(h(D))return Y.consume(D),X1;return Q(D)}function d(D){if(D===H.dash&&G===C.htmlComment)return Y.consume(D),c;if(D===H.lessThan&&G===C.htmlRaw)return Y.consume(D),t;if(D===H.greaterThan&&G===C.htmlDeclaration)return Y.consume(D),F1;if(D===H.questionMark&&G===C.htmlInstruction)return Y.consume(D),N;if(D===H.rightSquareBracket&&G===C.htmlCdata)return Y.consume(D),L1;if(J(D)&&(G===C.htmlBasic||G===C.htmlComplete))return Y.exit(W.htmlFlowData),Y.check(e7,B1,b)(D);if(D===H.eof||J(D))return Y.exit(W.htmlFlowData),b(D);return Y.consume(D),d}function b(D){return Y.check(Y4,v,B1)(D)}function v(D){return _(J(D)),Y.enter(W.lineEnding),Y.consume(D),Y.exit(W.lineEnding),u}function u(D){if(D===H.eof||J(D))return b(D);return Y.enter(W.htmlFlowData),d(D)}function c(D){if(D===H.dash)return Y.consume(D),N;return d(D)}function t(D){if(D===H.slash)return Y.consume(D),K="",U1;return d(D)}function U1(D){if(D===H.greaterThan){let W1=K.toLowerCase();if(M5.includes(W1))return Y.consume(D),F1;return d(D)}if(Y1(D)&&K.length<C.htmlRawSizeMax)return _(D!==null),Y.consume(D),K+=String.fromCharCode(D),U1;return d(D)}function L1(D){if(D===H.rightSquareBracket)return Y.consume(D),N;return d(D)}function N(D){if(D===H.greaterThan)return Y.consume(D),F1;if(D===H.dash&&G===C.htmlComment)return Y.consume(D),N;return d(D)}function F1(D){if(D===H.eof||J(D))return Y.exit(W.htmlFlowData),B1(D);return Y.consume(D),F1}function B1(D){return Y.exit(W.htmlFlow),Z(D)}}function X4(Y,Z,Q){let X=this;return G;function G(K){if(J(K))return Y.enter(W.lineEnding),Y.consume(K),Y.exit(W.lineEnding),$;return Q(K)}function $(K){return X.parser.lazy[X.now().line]?Q(K):Z(K)}}function G4(Y,Z,Q){return X;function X(G){return _(J(G),"expected a line ending"),Y.enter(W.lineEnding),Y.consume(G),Y.exit(W.lineEnding),Y.attempt(D1,Z,Q)}}var F5={name:"htmlText",tokenize:K4};function K4(Y,Z,Q){let X=this,G,$,K;return V;function V(N){return _(N===H.lessThan,"expected `<`"),Y.enter(W.htmlText),Y.enter(W.htmlTextData),Y.consume(N),U}function U(N){if(N===H.exclamationMark)return Y.consume(N),q;if(N===H.slash)return Y.consume(N),E;if(N===H.questionMark)return Y.consume(N),S;if(Y1(N))return Y.consume(N),a;return Q(N)}function q(N){if(N===H.dash)return Y.consume(N),M;if(N===H.leftSquareBracket)return Y.consume(N),$=0,j;if(Y1(N))return Y.consume(N),x;return Q(N)}function M(N){if(N===H.dash)return Y.consume(N),L;return Q(N)}function F(N){if(N===H.eof)return Q(N);if(N===H.dash)return Y.consume(N),R;if(J(N))return K=F,t(N);return Y.consume(N),F}function R(N){if(N===H.dash)return Y.consume(N),L;return F(N)}function L(N){return N===H.greaterThan?c(N):N===H.dash?R(N):F(N)}function j(N){let F1=C.cdataOpeningString;if(N===F1.charCodeAt($++))return Y.consume(N),$===F1.length?I:j;return Q(N)}function I(N){if(N===H.eof)return Q(N);if(N===H.rightSquareBracket)return Y.consume(N),w;if(J(N))return K=I,t(N);return Y.consume(N),I}function w(N){if(N===H.rightSquareBracket)return Y.consume(N),A;return I(N)}function A(N){if(N===H.greaterThan)return c(N);if(N===H.rightSquareBracket)return Y.consume(N),A;return I(N)}function x(N){if(N===H.eof||N===H.greaterThan)return c(N);if(J(N))return K=x,t(N);return Y.consume(N),x}function S(N){if(N===H.eof)return Q(N);if(N===H.questionMark)return Y.consume(N),m;if(J(N))return K=S,t(N);return Y.consume(N),S}function m(N){return N===H.greaterThan?c(N):S(N)}function E(N){if(Y1(N))return Y.consume(N),P;return Q(N)}function P(N){if(N===H.dash||Z1(N))return Y.consume(N),P;return y(N)}function y(N){if(J(N))return K=y,t(N);if(h(N))return Y.consume(N),y;return c(N)}function a(N){if(N===H.dash||Z1(N))return Y.consume(N),a;if(N===H.slash||N===H.greaterThan||l(N))return r(N);return Q(N)}function r(N){if(N===H.slash)return Y.consume(N),c;if(N===H.colon||N===H.underscore||Y1(N))return Y.consume(N),z;if(J(N))return K=r,t(N);if(h(N))return Y.consume(N),r;return c(N)}function z(N){if(N===H.dash||N===H.dot||N===H.colon||N===H.underscore||Z1(N))return Y.consume(N),z;return X1(N)}function X1(N){if(N===H.equalsTo)return Y.consume(N),d;if(J(N))return K=X1,t(N);if(h(N))return Y.consume(N),X1;return r(N)}function d(N){if(N===H.eof||N===H.lessThan||N===H.equalsTo||N===H.greaterThan||N===H.graveAccent)return Q(N);if(N===H.quotationMark||N===H.apostrophe)return Y.consume(N),G=N,b;if(J(N))return K=d,t(N);if(h(N))return Y.consume(N),d;return Y.consume(N),v}function b(N){if(N===G)return Y.consume(N),G=void 0,u;if(N===H.eof)return Q(N);if(J(N))return K=b,t(N);return Y.consume(N),b}function v(N){if(N===H.eof||N===H.quotationMark||N===H.apostrophe||N===H.lessThan||N===H.equalsTo||N===H.graveAccent)return Q(N);if(N===H.slash||N===H.greaterThan||l(N))return r(N);return Y.consume(N),v}function u(N){if(N===H.slash||N===H.greaterThan||l(N))return r(N);return Q(N)}function c(N){if(N===H.greaterThan)return Y.consume(N),Y.exit(W.htmlTextData),Y.exit(W.htmlText),Z;return Q(N)}function t(N){return _(K,"expected return state"),_(J(N),"expected eol"),Y.exit(W.htmlTextData),Y.enter(W.lineEnding),Y.consume(N),Y.exit(W.lineEnding),U1}function U1(N){return _(X.parser.constructs.disable.null,"expected `disable.null` to be populated"),h(N)?k(Y,L1,W.linePrefix,X.parser.constructs.disable.null.includes("codeIndented")?void 0:C.tabSize)(N):L1(N)}function L1(N){return Y.enter(W.htmlTextData),K(N)}}var p1={name:"labelEnd",resolveAll:W4,resolveTo:q4,tokenize:M4},$4={tokenize:U4},H4={tokenize:F4},V4={tokenize:L4};function W4(Y){let Z=-1,Q=[];while(++Z<Y.length){let X=Y[Z][1];if(Q.push(Y[Z]),X.type===W.labelImage||X.type===W.labelLink||X.type===W.labelEnd){let G=X.type===W.labelImage?4:2;X.type=W.data,Z+=G}}if(Y.length!==Q.length)o(Y,0,Y.length,Q);return Y}function q4(Y,Z){let Q=Y.length,X=0,G,$,K,V;while(Q--)if(G=Y[Q][1],$){if(G.type===W.link||G.type===W.labelLink&&G._inactive)break;if(Y[Q][0]==="enter"&&G.type===W.labelLink)G._inactive=!0}else if(K){if(Y[Q][0]==="enter"&&(G.type===W.labelImage||G.type===W.labelLink)&&!G._balanced){if($=Q,G.type!==W.labelLink){X=2;break}}}else if(G.type===W.labelEnd)K=Q;_($!==void 0,"`open` is supposed to be found"),_(K!==void 0,"`close` is supposed to be found");let U={type:Y[$][1].type===W.labelLink?W.link:W.image,start:{...Y[$][1].start},end:{...Y[Y.length-1][1].end}},q={type:W.label,start:{...Y[$][1].start},end:{...Y[K][1].end}},M={type:W.labelText,start:{...Y[$+X+2][1].end},end:{...Y[K-2][1].start}};return V=[["enter",U,Z],["enter",q,Z]],V=$1(V,Y.slice($+1,$+X+3)),V=$1(V,[["enter",M,Z]]),_(Z.parser.constructs.insideSpan.null,"expected `insideSpan.null` to be populated"),V=$1(V,S1(Z.parser.constructs.insideSpan.null,Y.slice($+X+4,K-3),Z)),V=$1(V,[["exit",M,Z],Y[K-2],Y[K-1],["exit",q,Z]]),V=$1(V,Y.slice(K+1)),V=$1(V,[["exit",U,Z]]),o(Y,$,Y.length,V),Y}function M4(Y,Z,Q){let X=this,G=X.events.length,$,K;while(G--)if((X.events[G][1].type===W.labelImage||X.events[G][1].type===W.labelLink)&&!X.events[G][1]._balanced){$=X.events[G][1];break}return V;function V(R){if(_(R===H.rightSquareBracket,"expected `]`"),!$)return Q(R);if($._inactive)return F(R);return K=X.parser.defined.includes(G1(X.sliceSerialize({start:$.end,end:X.now()}))),Y.enter(W.labelEnd),Y.enter(W.labelMarker),Y.consume(R),Y.exit(W.labelMarker),Y.exit(W.labelEnd),U}function U(R){if(R===H.leftParenthesis)return Y.attempt($4,M,K?M:F)(R);if(R===H.leftSquareBracket)return Y.attempt(H4,M,K?q:F)(R);return K?M(R):F(R)}function q(R){return Y.attempt(V4,M,F)(R)}function M(R){return Z(R)}function F(R){return $._balanced=!0,Q(R)}}function U4(Y,Z,Q){return X;function X(F){return _(F===H.leftParenthesis,"expected left paren"),Y.enter(W.resource),Y.enter(W.resourceMarker),Y.consume(F),Y.exit(W.resourceMarker),G}function G(F){return l(F)?u1(Y,$)(F):$(F)}function $(F){if(F===H.rightParenthesis)return M(F);return m0(Y,K,V,W.resourceDestination,W.resourceDestinationLiteral,W.resourceDestinationLiteralMarker,W.resourceDestinationRaw,W.resourceDestinationString,C.linkResourceDestinationBalanceMax)(F)}function K(F){return l(F)?u1(Y,U)(F):M(F)}function V(F){return Q(F)}function U(F){if(F===H.quotationMark||F===H.apostrophe||F===H.leftParenthesis)return p0(Y,q,Q,W.resourceTitle,W.resourceTitleMarker,W.resourceTitleString)(F);return M(F)}function q(F){return l(F)?u1(Y,M)(F):M(F)}function M(F){if(F===H.rightParenthesis)return Y.enter(W.resourceMarker),Y.consume(F),Y.exit(W.resourceMarker),Y.exit(W.resource),Z;return Q(F)}}function F4(Y,Z,Q){let X=this;return G;function G(V){return _(V===H.leftSquareBracket,"expected left bracket"),u0.call(X,Y,$,K,W.reference,W.referenceMarker,W.referenceString)(V)}function $(V){return X.parser.defined.includes(G1(X.sliceSerialize(X.events[X.events.length-1][1]).slice(1,-1)))?Z(V):Q(V)}function K(V){return Q(V)}}function L4(Y,Z,Q){return X;function X($){return _($===H.leftSquareBracket,"expected left bracket"),Y.enter(W.reference),Y.enter(W.referenceMarker),Y.consume($),Y.exit(W.referenceMarker),G}function G($){if($===H.rightSquareBracket)return Y.enter(W.referenceMarker),Y.consume($),Y.exit(W.referenceMarker),Y.exit(W.reference),Z;return Q($)}}var L5={name:"labelStartImage",resolveAll:p1.resolveAll,tokenize:R4};function R4(Y,Z,Q){let X=this;return G;function G(V){return _(V===H.exclamationMark,"expected `!`"),Y.enter(W.labelImage),Y.enter(W.labelImageMarker),Y.consume(V),Y.exit(W.labelImageMarker),$}function $(V){if(V===H.leftSquareBracket)return Y.enter(W.labelMarker),Y.consume(V),Y.exit(W.labelMarker),Y.exit(W.labelImage),K;return Q(V)}function K(V){return V===H.caret&&"_hiddenFootnoteSupport"in X.parser.constructs?Q(V):Z(V)}}var R5={name:"labelStartLink",resolveAll:p1.resolveAll,tokenize:_4};function _4(Y,Z,Q){let X=this;return G;function G(K){return _(K===H.leftSquareBracket,"expected `[`"),Y.enter(W.labelLink),Y.enter(W.labelMarker),Y.consume(K),Y.exit(W.labelMarker),Y.exit(W.labelLink),$}function $(K){return K===H.caret&&"_hiddenFootnoteSupport"in X.parser.constructs?Q(K):Z(K)}}var T0={name:"lineEnding",tokenize:N4};function N4(Y,Z){return Q;function Q(X){return _(J(X),"expected eol"),Y.enter(W.lineEnding),Y.consume(X),Y.exit(W.lineEnding),k(Y,Z,W.linePrefix)}}var l1={name:"thematicBreak",tokenize:D4};function D4(Y,Z,Q){let X=0,G;return $;function $(q){return Y.enter(W.thematicBreak),K(q)}function K(q){return _(q===H.asterisk||q===H.dash||q===H.underscore,"expected `*`, `-`, or `_`"),G=q,V(q)}function V(q){if(q===G)return Y.enter(W.thematicBreakSequence),U(q);if(X>=C.thematicBreakMarkerCountMin&&(q===H.eof||J(q)))return Y.exit(W.thematicBreak),Z(q);return Q(q)}function U(q){if(q===G)return Y.consume(q),X++,U;return Y.exit(W.thematicBreakSequence),h(q)?k(Y,V,W.whitespace)(q):V(q)}}var K1={continuation:{tokenize:T4},exit:P4,name:"list",tokenize:z4},j4={partial:!0,tokenize:A4},B4={partial:!0,tokenize:O4};function z4(Y,Z,Q){let X=this,G=X.events[X.events.length-1],$=G&&G[1].type===W.linePrefix?G[2].sliceSerialize(G[1],!0).length:0,K=0;return V;function V(L){_(X.containerState,"expected state");let j=X.containerState.type||(L===H.asterisk||L===H.plusSign||L===H.dash?W.listUnordered:W.listOrdered);if(j===W.listUnordered?!X.containerState.marker||L===X.containerState.marker:D0(L)){if(!X.containerState.type)X.containerState.type=j,Y.enter(j,{_container:!0});if(j===W.listUnordered)return Y.enter(W.listItemPrefix),L===H.asterisk||L===H.dash?Y.check(l1,Q,q)(L):q(L);if(!X.interrupt||L===H.digit1)return Y.enter(W.listItemPrefix),Y.enter(W.listItemValue),U(L)}return Q(L)}function U(L){if(_(X.containerState,"expected state"),D0(L)&&++K<C.listItemValueSizeMax)return Y.consume(L),U;if((!X.interrupt||K<2)&&(X.containerState.marker?L===X.containerState.marker:L===H.rightParenthesis||L===H.dot))return Y.exit(W.listItemValue),q(L);return Q(L)}function q(L){return _(X.containerState,"expected state"),_(L!==H.eof,"eof (`null`) is not a marker"),Y.enter(W.listItemMarker),Y.consume(L),Y.exit(W.listItemMarker),X.containerState.marker=X.containerState.marker||L,Y.check(D1,X.interrupt?Q:M,Y.attempt(j4,R,F))}function M(L){return _(X.containerState,"expected state"),X.containerState.initialBlankLine=!0,$++,R(L)}function F(L){if(h(L))return Y.enter(W.listItemPrefixWhitespace),Y.consume(L),Y.exit(W.listItemPrefixWhitespace),R;return Q(L)}function R(L){return _(X.containerState,"expected state"),X.containerState.size=$+X.sliceSerialize(Y.exit(W.listItemPrefix),!0).length,Z(L)}}function T4(Y,Z,Q){let X=this;return _(X.containerState,"expected state"),X.containerState._closeFlow=void 0,Y.check(D1,G,$);function G(V){return _(X.containerState,"expected state"),_(typeof X.containerState.size==="number","expected size"),X.containerState.furtherBlankLines=X.containerState.furtherBlankLines||X.containerState.initialBlankLine,k(Y,Z,W.listItemIndent,X.containerState.size+1)(V)}function $(V){if(_(X.containerState,"expected state"),X.containerState.furtherBlankLines||!h(V))return X.containerState.furtherBlankLines=void 0,X.containerState.initialBlankLine=void 0,K(V);return X.containerState.furtherBlankLines=void 0,X.containerState.initialBlankLine=void 0,Y.attempt(B4,Z,K)(V)}function K(V){return _(X.containerState,"expected state"),X.containerState._closeFlow=!0,X.interrupt=void 0,_(X.parser.constructs.disable.null,"expected `disable.null` to be populated"),k(Y,Y.attempt(K1,Z,Q),W.linePrefix,X.parser.constructs.disable.null.includes("codeIndented")?void 0:C.tabSize)(V)}}function O4(Y,Z,Q){let X=this;return _(X.containerState,"expected state"),_(typeof X.containerState.size==="number","expected size"),k(Y,G,W.listItemIndent,X.containerState.size+1);function G($){_(X.containerState,"expected state");let K=X.events[X.events.length-1];return K&&K[1].type===W.listItemIndent&&K[2].sliceSerialize(K[1],!0).length===X.containerState.size?Z($):Q($)}}function P4(Y){_(this.containerState,"expected state"),_(typeof this.containerState.type==="string","expected type"),Y.exit(this.containerState.type)}function A4(Y,Z,Q){let X=this;return _(X.parser.constructs.disable.null,"expected `disable.null` to be populated"),k(Y,G,W.listItemPrefixWhitespace,X.parser.constructs.disable.null.includes("codeIndented")?void 0:C.tabSize+1);function G($){let K=X.events[X.events.length-1];return!h($)&&K&&K[1].type===W.listItemPrefixWhitespace?Z($):Q($)}}var l0={name:"setextUnderline",resolveTo:C4,tokenize:I4};function C4(Y,Z){let Q=Y.length,X,G,$;while(Q--)if(Y[Q][0]==="enter"){if(Y[Q][1].type===W.content){X=Q;break}if(Y[Q][1].type===W.paragraph)G=Q}else{if(Y[Q][1].type===W.content)Y.splice(Q,1);if(!$&&Y[Q][1].type===W.definition)$=Q}_(G!==void 0,"expected a `text` index to be found"),_(X!==void 0,"expected a `text` index to be found"),_(Y[X][2]===Z,"enter context should be same"),_(Y[Y.length-1][2]===Z,"enter context should be same");let K={type:W.setextHeading,start:{...Y[X][1].start},end:{...Y[Y.length-1][1].end}};if(Y[G][1].type=W.setextHeadingText,$)Y.splice(G,0,["enter",K,Z]),Y.splice($+1,0,["exit",Y[X][1],Z]),Y[X][1].end={...Y[$][1].end};else Y[X][1]=K;return Y.push(["exit",K,Z]),Y}function I4(Y,Z,Q){let X=this,G;return $;function $(q){let M=X.events.length,F;_(q===H.dash||q===H.equalsTo,"expected `=` or `-`");while(M--)if(X.events[M][1].type!==W.lineEnding&&X.events[M][1].type!==W.linePrefix&&X.events[M][1].type!==W.content){F=X.events[M][1].type===W.paragraph;break}if(!X.parser.lazy[X.now().line]&&(X.interrupt||F))return Y.enter(W.setextHeadingLine),G=q,K(q);return Q(q)}function K(q){return Y.enter(W.setextHeadingLineSequence),V(q)}function V(q){if(q===G)return Y.consume(q),V;return Y.exit(W.setextHeadingLineSequence),h(q)?k(Y,U,W.lineSuffix)(q):U(q)}function U(q){if(q===H.eof||J(q))return Y.exit(W.setextHeadingLine),Z(q);return Q(q)}}var s2={tokenize:J4};function J4(Y){let Z=this,Q=Y.attempt(D1,X,Y.attempt(this.parser.constructs.flowInitial,G,k(Y,Y.attempt(this.parser.constructs.flow,G,Y.attempt(H5,G)),W.linePrefix)));return Q;function X($){if(_($===H.eof||J($),"expected eol or eof"),$===H.eof){Y.consume($);return}return Y.enter(W.lineEndingBlank),Y.consume($),Y.exit(W.lineEndingBlank),Z.currentConstruct=void 0,Q}function G($){if(_($===H.eof||J($),"expected eol or eof"),$===H.eof){Y.consume($);return}return Y.enter(W.lineEnding),Y.consume($),Y.exit(W.lineEnding),Z.currentConstruct=void 0,Q}}var c2={resolveAll:Y6()},o2=e2("string"),t2=e2("text");function e2(Y){return{resolveAll:Y6(Y==="text"?S4:void 0),tokenize:Z};function Z(Q){let X=this,G=this.parser.constructs[Y],$=Q.attempt(G,K,V);return K;function K(M){return q(M)?$(M):V(M)}function V(M){if(M===H.eof){Q.consume(M);return}return Q.enter(W.data),Q.consume(M),U}function U(M){if(q(M))return Q.exit(W.data),$(M);return Q.consume(M),U}function q(M){if(M===H.eof)return!0;let F=G[M],R=-1;if(F){_(Array.isArray(F),"expected `disable.null` to be populated");while(++R<F.length){let L=F[R];if(!L.previous||L.previous.call(X,X.previous))return!0}}return!1}}}function Y6(Y){return Z;function Z(Q,X){let G=-1,$;while(++G<=Q.length)if($===void 0){if(Q[G]&&Q[G][1].type===W.data)$=G,G++}else if(!Q[G]||Q[G][1].type!==W.data){if(G!==$+2)Q[$][1].end=Q[G-1][1].end,Q.splice($+2,G-$-2),G=$+2;$=void 0}return Y?Y(Q,X):Q}}function S4(Y,Z){let Q=0;while(++Q<=Y.length)if((Q===Y.length||Y[Q][1].type===W.lineEnding)&&Y[Q-1][1].type===W.data){let X=Y[Q-1][1],G=Z.sliceStream(X),$=G.length,K=-1,V=0,U;while($--){let q=G[$];if(typeof q==="string"){K=q.length;while(q.charCodeAt(K-1)===H.space)V++,K--;if(K)break;K=-1}else if(q===H.horizontalTab)U=!0,V++;else if(q===H.virtualSpace);else{$++;break}}if(Z._contentTypeTextTrailing&&Q===Y.length)V=0;if(V){let q={type:Q===Y.length||U||V<C.hardBreakPrefixSizeMin?W.lineSuffix:W.hardBreakTrailing,start:{_bufferIndex:$?K:X.start._bufferIndex+K,_index:X.start._index+$,line:X.end.line,column:X.end.column-V,offset:X.end.offset-V},end:{...X.end}};if(X.end={...q.start},X.start.offset===X.end.offset)Object.assign(X,q);else Y.splice(Q,0,["enter",q,Z],["exit",q,Z]),Q+=2}Q++}return Y}var _5={};$2(_5,{text:()=>h4,string:()=>g4,insideSpan:()=>x4,flowInitial:()=>y4,flow:()=>b4,document:()=>E4,disable:()=>v4,contentInitial:()=>w4,attentionMarkers:()=>k4});var E4={[H.asterisk]:K1,[H.plusSign]:K1,[H.dash]:K1,[H.digit0]:K1,[H.digit1]:K1,[H.digit2]:K1,[H.digit3]:K1,[H.digit4]:K1,[H.digit5]:K1,[H.digit6]:K1,[H.digit7]:K1,[H.digit8]:K1,[H.digit9]:K1,[H.greaterThan]:g0},w4={[H.leftSquareBracket]:V5},y4={[H.horizontalTab]:B0,[H.virtualSpace]:B0,[H.space]:B0},b4={[H.numberSign]:q5,[H.asterisk]:l1,[H.dash]:[l0,l1],[H.lessThan]:U5,[H.equalsTo]:l0,[H.underscore]:l1,[H.graveAccent]:k0,[H.tilde]:k0},g4={[H.ampersand]:x0,[H.backslash]:h0},h4={[H.carriageReturn]:T0,[H.lineFeed]:T0,[H.carriageReturnLineFeed]:T0,[H.exclamationMark]:L5,[H.ampersand]:x0,[H.asterisk]:j0,[H.lessThan]:[G5,F5],[H.leftSquareBracket]:R5,[H.backslash]:[W5,h0],[H.rightSquareBracket]:p1,[H.underscore]:j0,[H.graveAccent]:K5},x4={null:[j0,c2]},k4={null:[H.asterisk,H.underscore]},v4={null:[]};var $6=K2(K6(),1);var i1=$6.default("micromark");function H6(Y,Z,Q){let X={_bufferIndex:-1,_index:0,line:Q&&Q.line||1,column:Q&&Q.column||1,offset:Q&&Q.offset||0},G={},$=[],K=[],V=[],U=!0,q={attempt:r(y),check:r(a),consume:m,enter:E,exit:P,interrupt:r(a,{interrupt:!0})},M={code:H.eof,containerState:{},defineSkip:A,events:[],now:w,parser:Y,previous:H.eof,sliceSerialize:j,sliceStream:I,write:L},F=Z.tokenize.call(M,q),R;if(Z.resolveAll)$.push(Z);return M;function L(b){if(K=$1(K,b),x(),K[K.length-1]!==H.eof)return[];return z(Z,0),M.events=S1($,M.events,M),M.events}function j(b,v){return t4(I(b),v)}function I(b){return o4(K,b)}function w(){let{_bufferIndex:b,_index:v,line:u,column:c,offset:t}=X;return{_bufferIndex:b,_index:v,line:u,column:c,offset:t}}function A(b){G[b.line]=b.column,d(),i1("position: define skip: `%j`",X)}function x(){let b;while(X._index<K.length){let v=K[X._index];if(typeof v==="string"){if(b=X._index,X._bufferIndex<0)X._bufferIndex=0;while(X._index===b&&X._bufferIndex<v.length)S(v.charCodeAt(X._bufferIndex))}else S(v)}}function S(b){_(U===!0,"expected character to be consumed"),U=void 0,i1("main: passing `%s` to %s",b,F&&F.name),R=b,_(typeof F==="function","expected state"),F=F(b)}function m(b){if(_(b===R,"expected given code to equal expected code"),i1("consume: `%s`",b),_(U===void 0,"expected code to not have been consumed: this might be because `return x(code)` instead of `return x` was used"),_(b===null?M.events.length===0||M.events[M.events.length-1][0]==="exit":M.events[M.events.length-1][0]==="enter","expected last token to be open"),J(b))X.line++,X.column=1,X.offset+=b===H.carriageReturnLineFeed?2:1,d(),i1("position: after eol: `%j`",X);else if(b!==H.virtualSpace)X.column++,X.offset++;if(X._bufferIndex<0)X._index++;else if(X._bufferIndex++,X._bufferIndex===K[X._index].length)X._bufferIndex=-1,X._index++;M.previous=b,U=!0}function E(b,v){let u=v||{};return u.type=b,u.start=w(),_(typeof b==="string","expected string type"),_(b.length>0,"expected non-empty string"),i1("enter: `%s`",b),M.events.push(["enter",u,M]),V.push(u),u}function P(b){_(typeof b==="string","expected string type"),_(b.length>0,"expected non-empty string");let v=V.pop();return _(v,"cannot close w/o open tokens"),v.end=w(),_(b===v.type,"expected exit token to match current token"),_(!(v.start._index===v.end._index&&v.start._bufferIndex===v.end._bufferIndex),"expected non-empty token (`"+b+"`)"),i1("exit: `%s`",v.type),M.events.push(["exit",v,M]),v}function y(b,v){z(b,v.from)}function a(b,v){v.restore()}function r(b,v){return u;function u(c,t,U1){let L1,N,F1,B1;return Array.isArray(c)?W1(c):("tokenize"in c)?W1([c]):D(c);function D(e){return q0;function q0(z1){let y1=z1!==null&&e[z1],n1=z1!==null&&e.null,o0=[...Array.isArray(y1)?y1:y1?[y1]:[],...Array.isArray(n1)?n1:n1?[n1]:[]];return W1(o0)(z1)}}function W1(e){if(L1=e,N=0,e.length===0)return _(U1,"expected `bogusState` to be given"),U1;return w1(e[N])}function w1(e){return q0;function q0(z1){if(B1=X1(),F1=e,!e.partial)M.currentConstruct=e;if(_(M.parser.constructs.disable.null,"expected `disable.null` to be populated"),e.name&&M.parser.constructs.disable.null.includes(e.name))return A0(z1);return e.tokenize.call(v?Object.assign(Object.create(M),v):M,q,c0,A0)(z1)}}function c0(e){return _(e===R,"expected code"),U=!0,b(F1,B1),t}function A0(e){if(_(e===R,"expected code"),U=!0,B1.restore(),++N<L1.length)return w1(L1[N]);return U1}}}function z(b,v){if(b.resolveAll&&!$.includes(b))$.push(b);if(b.resolve)o(M.events,v,M.events.length-v,b.resolve(M.events.slice(v),M));if(b.resolveTo)M.events=b.resolveTo(M.events,M);_(b.partial||M.events.length===0||M.events[M.events.length-1][0]==="exit","expected last token to end")}function X1(){let b=w(),v=M.previous,u=M.currentConstruct,c=M.events.length,t=Array.from(V);return{from:c,restore:U1};function U1(){X=b,M.previous=v,M.currentConstruct=u,M.events.length=c,V=t,d(),i1("position: restore: `%j`",X)}}function d(){if(X.line in G&&X.column<2)X.column=G[X.line],X.offset+=G[X.line]-1}}function o4(Y,Z){let Q=Z.start._index,X=Z.start._bufferIndex,G=Z.end._index,$=Z.end._bufferIndex,K;if(Q===G)_($>-1,"expected non-negative end buffer index"),_(X>-1,"expected non-negative start buffer index"),K=[Y[Q].slice(X,$)];else{if(K=Y.slice(Q,G),X>-1){let V=K[0];if(typeof V==="string")K[0]=V.slice(X);else _(X===0,"expected `startBufferIndex` to be `0`"),K.shift()}if($>0)K.push(Y[G].slice(0,$))}return K}function t4(Y,Z){let Q=-1,X=[],G;while(++Q<Y.length){let $=Y[Q],K;if(typeof $==="string")K=$;else switch($){case H.carriageReturn:{K=M1.cr;break}case H.lineFeed:{K=M1.lf;break}case H.carriageReturnLineFeed:{K=M1.cr+M1.lf;break}case H.horizontalTab:{K=Z?M1.space:M1.ht;break}case H.virtualSpace:{if(!Z&&G)continue;K=M1.space;break}default:_(typeof $==="number","expected number"),K=String.fromCharCode($)}G=$===H.horizontalTab,X.push(K)}return X.join("")}function N5(Y){let X={constructs:y0([_5,...(Y||{}).extensions||[]]),content:G(l2),defined:[],document:G(i2),flow:G(s2),lazy:{},string:G(o2),text:G(t2)};return X;function G($){return K;function K(V){return H6(X,$,V)}}}function D5(Y){while(!v0(Y));return Y}var V6=/[\0\t\n\r]/g;function j5(){let Y=1,Z="",Q=!0,X;return G;function G($,K,V){let U=[],q,M,F,R,L;if($=Z+(typeof $==="string"?$.toString():new TextDecoder(K||void 0).decode($)),F=0,Z="",Q){if($.charCodeAt(0)===H.byteOrderMarker)F++;Q=void 0}while(F<$.length){if(V6.lastIndex=F,q=V6.exec($),R=q&&q.index!==void 0?q.index:$.length,L=$.charCodeAt(R),!q){Z=$.slice(F);break}if(L===H.lf&&F===R&&X)U.push(H.carriageReturnLineFeed),X=void 0;else{if(X)U.push(H.carriageReturn),X=void 0;if(F<R)U.push($.slice(F,R)),Y+=R-F;switch(L){case H.nul:{U.push(H.replacementCharacter),Y++;break}case H.ht:{M=Math.ceil(Y/C.tabSize)*C.tabSize,U.push(H.horizontalTab);while(Y++<M)U.push(H.virtualSpace);break}case H.lf:{U.push(H.lineFeed),Y=1;break}default:X=!0,Y=1}}F=R+1}if(V){if(X)U.push(H.carriageReturn);if(Z)U.push(Z);U.push(H.eof)}return U}}var e4=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function W6(Y){return Y.replace(e4,Y9)}function Y9(Y,Z,Q){if(Z)return Z;if(Q.charCodeAt(0)===H.numberSign){let G=Q.charCodeAt(1),$=G===H.lowercaseX||G===H.uppercaseX;return b0(Q.slice($?2:1),$?C.numericBaseHexadecimal:C.numericBaseDecimal)}return Q0(Q)||Y}function H0(Y){if(!Y||typeof Y!=="object")return"";if("position"in Y||"type"in Y)return q6(Y.position);if("start"in Y||"end"in Y)return q6(Y);if("line"in Y||"column"in Y)return B5(Y);return""}function B5(Y){return M6(Y&&Y.line)+":"+M6(Y&&Y.column)}function q6(Y){return B5(Y&&Y.start)+"-"+B5(Y&&Y.end)}function M6(Y){return Y&&typeof Y==="number"?Y:1}var F6={}.hasOwnProperty;function z5(Y,Z,Q){if(Z&&typeof Z==="object")Q=Z,Z=void 0;return Z9(Q)(D5(N5(Q).document().write(j5()(Y,Z,!0))))}function Z9(Y){let Z={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:$(e5),autolinkProtocol:r,autolinkEmail:r,atxHeading:$(c5),blockQuote:$(z1),characterEscape:r,characterReference:r,codeFenced:$(y1),codeFencedFenceInfo:K,codeFencedFenceMeta:K,codeIndented:$(y1,K),codeText:$(n1,K),codeTextData:r,data:r,codeFlowValue:r,definition:$(o0),definitionDestinationString:K,definitionLabelString:K,definitionTitleString:K,emphasis:$(i6),hardBreakEscape:$(o5),hardBreakTrailing:$(o5),htmlFlow:$(t5,K),htmlFlowData:r,htmlText:$(t5,K),htmlTextData:r,image:$(r6),label:K,link:$(e5),listItem:$(a6),listItemValue:R,listOrdered:$(Y2,F),listUnordered:$(Y2),paragraph:$(d6),reference:D,referenceString:K,resourceDestinationString:K,resourceTitleString:K,setextHeading:$(c5),strong:$(n6),thematicBreak:$(c6)},exit:{atxHeading:U(),atxHeadingSequence:E,autolink:U(),autolinkEmail:q0,autolinkProtocol:e,blockQuote:U(),characterEscapeValue:z,characterReferenceMarkerHexadecimal:w1,characterReferenceMarkerNumeric:w1,characterReferenceValue:c0,characterReference:A0,codeFenced:U(w),codeFencedFence:I,codeFencedFenceInfo:L,codeFencedFenceMeta:j,codeFlowValue:z,codeIndented:U(A),codeText:U(u),codeTextData:z,data:z,definition:U(),definitionDestinationString:m,definitionLabelString:x,definitionTitleString:S,emphasis:U(),hardBreakEscape:U(d),hardBreakTrailing:U(d),htmlFlow:U(b),htmlFlowData:z,htmlText:U(v),htmlTextData:z,image:U(t),label:L1,labelText:U1,lineEnding:X1,link:U(c),listItem:U(),listOrdered:U(),listUnordered:U(),paragraph:U(),referenceString:W1,resourceDestinationString:N,resourceTitleString:F1,resource:B1,setextHeading:U(a),setextHeadingLineSequence:y,setextHeadingText:P,strong:U(),thematicBreak:U()}};L6(Z,(Y||{}).mdastExtensions||[]);let Q={};return X;function X(T){let O={type:"root",children:[]},g={stack:[O],tokenStack:[],config:Z,enter:V,exit:q,buffer:K,resume:M,data:Q},p=[],n=-1;while(++n<T.length)if(T[n][1].type===W.listOrdered||T[n][1].type===W.listUnordered)if(T[n][0]==="enter")p.push(n);else{let H1=p.pop();_(typeof H1==="number","expected list to be open"),n=G(T,H1,n)}n=-1;while(++n<T.length){let H1=Z[T[n][0]];if(F6.call(H1,T[n][1].type))H1[T[n][1].type].call(Object.assign({sliceSerialize:T[n][2].sliceSerialize},g),T[n][1])}if(g.tokenStack.length>0){let H1=g.tokenStack[g.tokenStack.length-1];(H1[1]||U6).call(g,void 0,H1[0])}O.position={start:E1(T.length>0?T[0][1].start:{line:1,column:1,offset:0}),end:E1(T.length>0?T[T.length-2][1].end:{line:1,column:1,offset:0})},n=-1;while(++n<Z.transforms.length)O=Z.transforms[n](O)||O;return O}function G(T,O,g){let p=O-1,n=-1,H1=!1,b1,T1,M0,U0;while(++p<=g){let q1=T[p];switch(q1[1].type){case W.listUnordered:case W.listOrdered:case W.blockQuote:{if(q1[0]==="enter")n++;else n--;U0=void 0;break}case W.lineEndingBlank:{if(q1[0]==="enter"){if(b1&&!U0&&!n&&!M0)M0=p;U0=void 0}break}case W.linePrefix:case W.listItemValue:case W.listItemMarker:case W.listItemPrefix:case W.listItemPrefixWhitespace:break;default:U0=void 0}if(!n&&q1[0]==="enter"&&q1[1].type===W.listItemPrefix||n===-1&&q1[0]==="exit"&&(q1[1].type===W.listUnordered||q1[1].type===W.listOrdered)){if(b1){let s1=p;T1=void 0;while(s1--){let O1=T[s1];if(O1[1].type===W.lineEnding||O1[1].type===W.lineEndingBlank){if(O1[0]==="exit")continue;if(T1)T[T1][1].type=W.lineEndingBlank,H1=!0;O1[1].type=W.lineEnding,T1=s1}else if(O1[1].type===W.linePrefix||O1[1].type===W.blockQuotePrefix||O1[1].type===W.blockQuotePrefixWhitespace||O1[1].type===W.blockQuoteMarker||O1[1].type===W.listItemIndent);else break}if(M0&&(!T1||M0<T1))b1._spread=!0;b1.end=Object.assign({},T1?T[T1][1].start:q1[1].end),T.splice(T1||p,0,["exit",b1,q1[2]]),p++,g++}if(q1[1].type===W.listItemPrefix){let s1={type:"listItem",_spread:!1,start:Object.assign({},q1[1].start),end:void 0};b1=s1,T.splice(p,0,["enter",s1,q1[2]]),p++,g++,M0=void 0,U0=!0}}}return T[O][1]._spread=H1,g}function $(T,O){return g;function g(p){if(V.call(this,T(p),p),O)O.call(this,p)}}function K(){this.stack.push({type:"fragment",children:[]})}function V(T,O,g){let p=this.stack[this.stack.length-1];_(p,"expected `parent`"),_("children"in p,"expected `parent`"),p.children.push(T),this.stack.push(T),this.tokenStack.push([O,g||void 0]),T.position={start:E1(O.start),end:void 0}}function U(T){return O;function O(g){if(T)T.call(this,g);q.call(this,g)}}function q(T,O){let g=this.stack.pop();_(g,"expected `node`");let p=this.tokenStack.pop();if(!p)throw Error("Cannot close `"+T.type+"` ("+H0({start:T.start,end:T.end})+"): its not open");else if(p[0].type!==T.type)if(O)O.call(this,T,p[0]);else(p[1]||U6).call(this,T,p[0]);_(g.type!=="fragment","unexpected fragment `exit`ed"),_(g.position,"expected `position` to be defined"),g.position.end=E1(T.end)}function M(){return X5(this.stack.pop())}function F(){this.data.expectingFirstListItemValue=!0}function R(T){if(this.data.expectingFirstListItemValue){let O=this.stack[this.stack.length-2];_(O,"expected nodes on stack"),_(O.type==="list","expected list on stack"),O.start=Number.parseInt(this.sliceSerialize(T),C.numericBaseDecimal),this.data.expectingFirstListItemValue=void 0}}function L(){let T=this.resume(),O=this.stack[this.stack.length-1];_(O,"expected node on stack"),_(O.type==="code","expected code on stack"),O.lang=T}function j(){let T=this.resume(),O=this.stack[this.stack.length-1];_(O,"expected node on stack"),_(O.type==="code","expected code on stack"),O.meta=T}function I(){if(this.data.flowCodeInside)return;this.buffer(),this.data.flowCodeInside=!0}function w(){let T=this.resume(),O=this.stack[this.stack.length-1];_(O,"expected node on stack"),_(O.type==="code","expected code on stack"),O.value=T.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function A(){let T=this.resume(),O=this.stack[this.stack.length-1];_(O,"expected node on stack"),_(O.type==="code","expected code on stack"),O.value=T.replace(/(\r?\n|\r)$/g,"")}function x(T){let O=this.resume(),g=this.stack[this.stack.length-1];_(g,"expected node on stack"),_(g.type==="definition","expected definition on stack"),g.label=O,g.identifier=G1(this.sliceSerialize(T)).toLowerCase()}function S(){let T=this.resume(),O=this.stack[this.stack.length-1];_(O,"expected node on stack"),_(O.type==="definition","expected definition on stack"),O.title=T}function m(){let T=this.resume(),O=this.stack[this.stack.length-1];_(O,"expected node on stack"),_(O.type==="definition","expected definition on stack"),O.url=T}function E(T){let O=this.stack[this.stack.length-1];if(_(O,"expected node on stack"),_(O.type==="heading","expected heading on stack"),!O.depth){let g=this.sliceSerialize(T).length;_(g===1||g===2||g===3||g===4||g===5||g===6,"expected `depth` between `1` and `6`"),O.depth=g}}function P(){this.data.setextHeadingSlurpLineEnding=!0}function y(T){let O=this.stack[this.stack.length-1];_(O,"expected node on stack"),_(O.type==="heading","expected heading on stack"),O.depth=this.sliceSerialize(T).codePointAt(0)===H.equalsTo?1:2}function a(){this.data.setextHeadingSlurpLineEnding=void 0}function r(T){let O=this.stack[this.stack.length-1];_(O,"expected node on stack"),_("children"in O,"expected parent on stack");let g=O.children,p=g[g.length-1];if(!p||p.type!=="text")p=s6(),p.position={start:E1(T.start),end:void 0},g.push(p);this.stack.push(p)}function z(T){let O=this.stack.pop();_(O,"expected a `node` to be on the stack"),_("value"in O,"expected a `literal` to be on the stack"),_(O.position,"expected `node` to have an open position"),O.value+=this.sliceSerialize(T),O.position.end=E1(T.end)}function X1(T){let O=this.stack[this.stack.length-1];if(_(O,"expected `node`"),this.data.atHardBreak){_("children"in O,"expected `parent`");let g=O.children[O.children.length-1];_(g.position,"expected tail to have a starting position"),g.position.end=E1(T.end),this.data.atHardBreak=void 0;return}if(!this.data.setextHeadingSlurpLineEnding&&Z.canContainEols.includes(O.type))r.call(this,T),z.call(this,T)}function d(){this.data.atHardBreak=!0}function b(){let T=this.resume(),O=this.stack[this.stack.length-1];_(O,"expected node on stack"),_(O.type==="html","expected html on stack"),O.value=T}function v(){let T=this.resume(),O=this.stack[this.stack.length-1];_(O,"expected node on stack"),_(O.type==="html","expected html on stack"),O.value=T}function u(){let T=this.resume(),O=this.stack[this.stack.length-1];_(O,"expected node on stack"),_(O.type==="inlineCode","expected inline code on stack"),O.value=T}function c(){let T=this.stack[this.stack.length-1];if(_(T,"expected node on stack"),_(T.type==="link","expected link on stack"),this.data.inReference){let O=this.data.referenceType||"shortcut";T.type+="Reference",T.referenceType=O,delete T.url,delete T.title}else delete T.identifier,delete T.label;this.data.referenceType=void 0}function t(){let T=this.stack[this.stack.length-1];if(_(T,"expected node on stack"),_(T.type==="image","expected image on stack"),this.data.inReference){let O=this.data.referenceType||"shortcut";T.type+="Reference",T.referenceType=O,delete T.url,delete T.title}else delete T.identifier,delete T.label;this.data.referenceType=void 0}function U1(T){let O=this.sliceSerialize(T),g=this.stack[this.stack.length-2];_(g,"expected ancestor on stack"),_(g.type==="image"||g.type==="link","expected image or link on stack"),g.label=W6(O),g.identifier=G1(O).toLowerCase()}function L1(){let T=this.stack[this.stack.length-1];_(T,"expected node on stack"),_(T.type==="fragment","expected fragment on stack");let O=this.resume(),g=this.stack[this.stack.length-1];if(_(g,"expected node on stack"),_(g.type==="image"||g.type==="link","expected image or link on stack"),this.data.inReference=!0,g.type==="link"){let p=T.children;g.children=p}else g.alt=O}function N(){let T=this.resume(),O=this.stack[this.stack.length-1];_(O,"expected node on stack"),_(O.type==="image"||O.type==="link","expected image or link on stack"),O.url=T}function F1(){let T=this.resume(),O=this.stack[this.stack.length-1];_(O,"expected node on stack"),_(O.type==="image"||O.type==="link","expected image or link on stack"),O.title=T}function B1(){this.data.inReference=void 0}function D(){this.data.referenceType="collapsed"}function W1(T){let O=this.resume(),g=this.stack[this.stack.length-1];_(g,"expected node on stack"),_(g.type==="image"||g.type==="link","expected image reference or link reference on stack"),g.label=O,g.identifier=G1(this.sliceSerialize(T)).toLowerCase(),this.data.referenceType="full"}function w1(T){_(T.type==="characterReferenceMarkerNumeric"||T.type==="characterReferenceMarkerHexadecimal"),this.data.characterReferenceType=T.type}function c0(T){let O=this.sliceSerialize(T),g=this.data.characterReferenceType,p;if(g)p=b0(O,g===W.characterReferenceMarkerNumeric?C.numericBaseDecimal:C.numericBaseHexadecimal),this.data.characterReferenceType=void 0;else{let H1=Q0(O);_(H1!==!1,"expected reference to decode"),p=H1}let n=this.stack[this.stack.length-1];_(n,"expected `node`"),_("value"in n,"expected `node.value`"),n.value+=p}function A0(T){let O=this.stack.pop();_(O,"expected `node`"),_(O.position,"expected `node.position`"),O.position.end=E1(T.end)}function e(T){z.call(this,T);let O=this.stack[this.stack.length-1];_(O,"expected node on stack"),_(O.type==="link","expected link on stack"),O.url=this.sliceSerialize(T)}function q0(T){z.call(this,T);let O=this.stack[this.stack.length-1];_(O,"expected node on stack"),_(O.type==="link","expected link on stack"),O.url="mailto:"+this.sliceSerialize(T)}function z1(){return{type:"blockquote",children:[]}}function y1(){return{type:"code",lang:null,meta:null,value:""}}function n1(){return{type:"inlineCode",value:""}}function o0(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function i6(){return{type:"emphasis",children:[]}}function c5(){return{type:"heading",depth:0,children:[]}}function o5(){return{type:"break"}}function t5(){return{type:"html",value:""}}function r6(){return{type:"image",title:null,url:"",alt:null}}function e5(){return{type:"link",title:null,url:"",children:[]}}function Y2(T){return{type:"list",ordered:T.type==="listOrdered",start:null,spread:T._spread,children:[]}}function a6(T){return{type:"listItem",spread:T._spread,checked:null,children:[]}}function d6(){return{type:"paragraph",children:[]}}function n6(){return{type:"strong",children:[]}}function s6(){return{type:"text",value:""}}function c6(){return{type:"thematicBreak"}}}function E1(Y){return{line:Y.line,column:Y.column,offset:Y.offset}}function L6(Y,Z){let Q=-1;while(++Q<Z.length){let X=Z[Q];if(Array.isArray(X))L6(Y,X);else Q9(Y,X)}}function Q9(Y,Z){let Q;for(Q in Z)if(F6.call(Z,Q))switch(Q){case"canContainEols":{let X=Z[Q];if(X)Y[Q].push(...X);break}case"transforms":{let X=Z[Q];if(X)Y[Q].push(...X);break}case"enter":case"exit":{let X=Z[Q];if(X)Object.assign(Y[Q],X);break}}}function U6(Y,Z){if(Y)throw Error("Cannot close `"+Y.type+"` ("+H0({start:Y.start,end:Y.end})+"): a different token (`"+Z.type+"`, "+H0({start:Z.start,end:Z.end})+") is open");else throw Error("Cannot close document, a token (`"+Z.type+"`, "+H0({start:Z.start,end:Z.end})+") is still open")}var X9={tokenize:V9,partial:!0},R6={tokenize:W9,partial:!0},_6={tokenize:q9,partial:!0},N6={tokenize:M9,partial:!0},G9={tokenize:U9,partial:!0},D6={name:"wwwAutolink",tokenize:$9,previous:B6},j6={name:"protocolAutolink",tokenize:H9,previous:z6},A1={name:"emailAutolink",tokenize:K9,previous:T6},j1={};function O5(){return{text:j1}}var r1=H.digit0;while(r1<H.leftCurlyBrace)if(j1[r1]=A1,r1++,r1===H.colon)r1=H.uppercaseA;else if(r1===H.leftSquareBracket)r1=H.lowercaseA;j1[H.plusSign]=A1;j1[H.dash]=A1;j1[H.dot]=A1;j1[H.underscore]=A1;j1[H.uppercaseH]=[A1,j6];j1[H.lowercaseH]=[A1,j6];j1[H.uppercaseW]=[A1,D6];j1[H.lowercaseW]=[A1,D6];function K9(Y,Z,Q){let X=this,G,$;return K;function K(F){if(!T5(F)||!T6.call(X,X.previous)||P5(X.events))return Q(F);return Y.enter("literalAutolink"),Y.enter("literalAutolinkEmail"),V(F)}function V(F){if(T5(F))return Y.consume(F),V;if(F===H.atSign)return Y.consume(F),U;return Q(F)}function U(F){if(F===H.dot)return Y.check(G9,M,q)(F);if(F===H.dash||F===H.underscore||Z1(F))return $=!0,Y.consume(F),U;return M(F)}function q(F){return Y.consume(F),G=!0,U}function M(F){if($&&G&&Y1(X.previous))return Y.exit("literalAutolinkEmail"),Y.exit("literalAutolink"),Z(F);return Q(F)}}function $9(Y,Z,Q){let X=this;return G;function G(K){if(K!==H.uppercaseW&&K!==H.lowercaseW||!B6.call(X,X.previous)||P5(X.events))return Q(K);return Y.enter("literalAutolink"),Y.enter("literalAutolinkWww"),Y.check(X9,Y.attempt(R6,Y.attempt(_6,$),Q),Q)(K)}function $(K){return Y.exit("literalAutolinkWww"),Y.exit("literalAutolink"),Z(K)}}function H9(Y,Z,Q){let X=this,G="",$=!1;return K;function K(F){if((F===H.uppercaseH||F===H.lowercaseH)&&z6.call(X,X.previous)&&!P5(X.events))return Y.enter("literalAutolink"),Y.enter("literalAutolinkHttp"),G+=String.fromCodePoint(F),Y.consume(F),V;return Q(F)}function V(F){if(Y1(F)&&G.length<5)return G+=String.fromCodePoint(F),Y.consume(F),V;if(F===H.colon){let R=G.toLowerCase();if(R==="http"||R==="https")return Y.consume(F),U}return Q(F)}function U(F){if(F===H.slash){if(Y.consume(F),$)return q;return $=!0,U}return Q(F)}function q(F){return F===H.eof||v1(F)||l(F)||N1(F)||m1(F)?Q(F):Y.attempt(R6,Y.attempt(_6,M),Q)(F)}function M(F){return Y.exit("literalAutolinkHttp"),Y.exit("literalAutolink"),Z(F)}}function V9(Y,Z,Q){let X=0;return G;function G(K){if((K===H.uppercaseW||K===H.lowercaseW)&&X<3)return X++,Y.consume(K),G;if(K===H.dot&&X===3)return Y.consume(K),$;return Q(K)}function $(K){return K===H.eof?Q(K):Z(K)}}function W9(Y,Z,Q){let X,G,$;return K;function K(q){if(q===H.dot||q===H.underscore)return Y.check(N6,U,V)(q);if(q===H.eof||l(q)||N1(q)||q!==H.dash&&m1(q))return U(q);return $=!0,Y.consume(q),K}function V(q){if(q===H.underscore)X=!0;else G=X,X=void 0;return Y.consume(q),K}function U(q){if(G||X||!$)return Q(q);return Z(q)}}function q9(Y,Z){let Q=0,X=0;return G;function G(K){if(K===H.leftParenthesis)return Q++,Y.consume(K),G;if(K===H.rightParenthesis&&X<Q)return $(K);if(K===H.exclamationMark||K===H.quotationMark||K===H.ampersand||K===H.apostrophe||K===H.rightParenthesis||K===H.asterisk||K===H.comma||K===H.dot||K===H.colon||K===H.semicolon||K===H.lessThan||K===H.questionMark||K===H.rightSquareBracket||K===H.underscore||K===H.tilde)return Y.check(N6,Z,$)(K);if(K===H.eof||l(K)||N1(K))return Z(K);return Y.consume(K),G}function $(K){if(K===H.rightParenthesis)X++;return Y.consume(K),G}}function M9(Y,Z,Q){return X;function X(V){if(V===H.exclamationMark||V===H.quotationMark||V===H.apostrophe||V===H.rightParenthesis||V===H.asterisk||V===H.comma||V===H.dot||V===H.colon||V===H.semicolon||V===H.questionMark||V===H.underscore||V===H.tilde)return Y.consume(V),X;if(V===H.ampersand)return Y.consume(V),$;if(V===H.rightSquareBracket)return Y.consume(V),G;if(V===H.lessThan||V===H.eof||l(V)||N1(V))return Z(V);return Q(V)}function G(V){if(V===H.eof||V===H.leftParenthesis||V===H.leftSquareBracket||l(V)||N1(V))return Z(V);return X(V)}function $(V){return Y1(V)?K(V):Q(V)}function K(V){if(V===H.semicolon)return Y.consume(V),X;if(Y1(V))return Y.consume(V),K;return Q(V)}}function U9(Y,Z,Q){return X;function X($){return Y.consume($),G}function G($){return Z1($)?Q($):Z($)}}function B6(Y){return Y===H.eof||Y===H.leftParenthesis||Y===H.asterisk||Y===H.underscore||Y===H.leftSquareBracket||Y===H.rightSquareBracket||Y===H.tilde||l(Y)}function z6(Y){return!Y1(Y)}function T6(Y){return!(Y===H.slash||T5(Y))}function T5(Y){return Y===H.plusSign||Y===H.dash||Y===H.dot||Y===H.underscore||Z1(Y)}function P5(Y){let Z=Y.length,Q=!1;while(Z--){let X=Y[Z][1];if((X.type==="labelLink"||X.type==="labelImage")&&!X._balanced){Q=!0;break}if(X._gfmAutolinkLiteralWalkedInto){Q=!1;break}}if(Y.length>0&&!Q)Y[Y.length-1][1]._gfmAutolinkLiteralWalkedInto=!0;return Q}var F9={tokenize:B9,partial:!0};function A5(){return{document:{[H.leftSquareBracket]:{name:"gfmFootnoteDefinition",tokenize:N9,continuation:{tokenize:D9},exit:j9}},text:{[H.leftSquareBracket]:{name:"gfmFootnoteCall",tokenize:_9},[H.rightSquareBracket]:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:L9,resolveTo:R9}}}}function L9(Y,Z,Q){let X=this,G=X.events.length,$=X.parser.gfmFootnotes||(X.parser.gfmFootnotes=[]),K;while(G--){let U=X.events[G][1];if(U.type===W.labelImage){K=U;break}if(U.type==="gfmFootnoteCall"||U.type===W.labelLink||U.type===W.label||U.type===W.image||U.type===W.link)break}return V;function V(U){if(_(U===H.rightSquareBracket,"expected `]`"),!K||!K._balanced)return Q(U);let q=G1(X.sliceSerialize({start:K.end,end:X.now()}));if(q.codePointAt(0)!==H.caret||!$.includes(q.slice(1)))return Q(U);return Y.enter("gfmFootnoteCallLabelMarker"),Y.consume(U),Y.exit("gfmFootnoteCallLabelMarker"),Z(U)}}function R9(Y,Z){let Q=Y.length,X;while(Q--)if(Y[Q][1].type===W.labelImage&&Y[Q][0]==="enter"){X=Y[Q][1];break}_(X,"expected `labelStart` to resolve"),Y[Q+1][1].type=W.data,Y[Q+3][1].type="gfmFootnoteCallLabelMarker";let G={type:"gfmFootnoteCall",start:Object.assign({},Y[Q+3][1].start),end:Object.assign({},Y[Y.length-1][1].end)},$={type:"gfmFootnoteCallMarker",start:Object.assign({},Y[Q+3][1].end),end:Object.assign({},Y[Q+3][1].end)};$.end.column++,$.end.offset++,$.end._bufferIndex++;let K={type:"gfmFootnoteCallString",start:Object.assign({},$.end),end:Object.assign({},Y[Y.length-1][1].start)},V={type:W.chunkString,contentType:"string",start:Object.assign({},K.start),end:Object.assign({},K.end)},U=[Y[Q+1],Y[Q+2],["enter",G,Z],Y[Q+3],Y[Q+4],["enter",$,Z],["exit",$,Z],["enter",K,Z],["enter",V,Z],["exit",V,Z],["exit",K,Z],Y[Y.length-2],Y[Y.length-1],["exit",G,Z]];return Y.splice(Q,Y.length-Q+1,...U),Y}function _9(Y,Z,Q){let X=this,G=X.parser.gfmFootnotes||(X.parser.gfmFootnotes=[]),$=0,K;return V;function V(F){return _(F===H.leftSquareBracket,"expected `[`"),Y.enter("gfmFootnoteCall"),Y.enter("gfmFootnoteCallLabelMarker"),Y.consume(F),Y.exit("gfmFootnoteCallLabelMarker"),U}function U(F){if(F!==H.caret)return Q(F);return Y.enter("gfmFootnoteCallMarker"),Y.consume(F),Y.exit("gfmFootnoteCallMarker"),Y.enter("gfmFootnoteCallString"),Y.enter("chunkString").contentType="string",q}function q(F){if($>C.linkReferenceSizeMax||F===H.rightSquareBracket&&!K||F===H.eof||F===H.leftSquareBracket||l(F))return Q(F);if(F===H.rightSquareBracket){Y.exit("chunkString");let R=Y.exit("gfmFootnoteCallString");if(!G.includes(G1(X.sliceSerialize(R))))return Q(F);return Y.enter("gfmFootnoteCallLabelMarker"),Y.consume(F),Y.exit("gfmFootnoteCallLabelMarker"),Y.exit("gfmFootnoteCall"),Z}if(!l(F))K=!0;return $++,Y.consume(F),F===H.backslash?M:q}function M(F){if(F===H.leftSquareBracket||F===H.backslash||F===H.rightSquareBracket)return Y.consume(F),$++,q;return q(F)}}function N9(Y,Z,Q){let X=this,G=X.parser.gfmFootnotes||(X.parser.gfmFootnotes=[]),$,K=0,V;return U;function U(j){return _(j===H.leftSquareBracket,"expected `[`"),Y.enter("gfmFootnoteDefinition")._container=!0,Y.enter("gfmFootnoteDefinitionLabel"),Y.enter("gfmFootnoteDefinitionLabelMarker"),Y.consume(j),Y.exit("gfmFootnoteDefinitionLabelMarker"),q}function q(j){if(j===H.caret)return Y.enter("gfmFootnoteDefinitionMarker"),Y.consume(j),Y.exit("gfmFootnoteDefinitionMarker"),Y.enter("gfmFootnoteDefinitionLabelString"),Y.enter("chunkString").contentType="string",M;return Q(j)}function M(j){if(K>C.linkReferenceSizeMax||j===H.rightSquareBracket&&!V||j===H.eof||j===H.leftSquareBracket||l(j))return Q(j);if(j===H.rightSquareBracket){Y.exit("chunkString");let I=Y.exit("gfmFootnoteDefinitionLabelString");return $=G1(X.sliceSerialize(I)),Y.enter("gfmFootnoteDefinitionLabelMarker"),Y.consume(j),Y.exit("gfmFootnoteDefinitionLabelMarker"),Y.exit("gfmFootnoteDefinitionLabel"),R}if(!l(j))V=!0;return K++,Y.consume(j),j===H.backslash?F:M}function F(j){if(j===H.leftSquareBracket||j===H.backslash||j===H.rightSquareBracket)return Y.consume(j),K++,M;return M(j)}function R(j){if(j===H.colon){if(Y.enter("definitionMarker"),Y.consume(j),Y.exit("definitionMarker"),!G.includes($))G.push($);return k(Y,L,"gfmFootnoteDefinitionWhitespace")}return Q(j)}function L(j){return Z(j)}}function D9(Y,Z,Q){return Y.check(D1,Z,Y.attempt(F9,Z,Q))}function j9(Y){Y.exit("gfmFootnoteDefinition")}function B9(Y,Z,Q){let X=this;return k(Y,G,"gfmFootnoteDefinitionIndent",C.tabSize+1);function G($){let K=X.events[X.events.length-1];return K&&K[1].type==="gfmFootnoteDefinitionIndent"&&K[2].sliceSerialize(K[1],!0).length===C.tabSize?Z($):Q($)}}function C5(Y){let Q=(Y||{}).singleTilde,X={name:"strikethrough",tokenize:$,resolveAll:G};if(Q===null||Q===void 0)Q=!0;return{text:{[H.tilde]:X},insideSpan:{null:[X]},attentionMarkers:{null:[H.tilde]}};function G(K,V){let U=-1;while(++U<K.length)if(K[U][0]==="enter"&&K[U][1].type==="strikethroughSequenceTemporary"&&K[U][1]._close){let q=U;while(q--)if(K[q][0]==="exit"&&K[q][1].type==="strikethroughSequenceTemporary"&&K[q][1]._open&&K[U][1].end.offset-K[U][1].start.offset===K[q][1].end.offset-K[q][1].start.offset){K[U][1].type="strikethroughSequence",K[q][1].type="strikethroughSequence";let M={type:"strikethrough",start:Object.assign({},K[q][1].start),end:Object.assign({},K[U][1].end)},F={type:"strikethroughText",start:Object.assign({},K[q][1].end),end:Object.assign({},K[U][1].start)},R=[["enter",M,V],["enter",K[q][1],V],["exit",K[q][1],V],["enter",F,V]],L=V.parser.constructs.insideSpan.null;if(L)o(R,R.length,0,S1(L,K.slice(q+1,U),V));o(R,R.length,0,[["exit",F,V],["enter",K[U][1],V],["exit",K[U][1],V],["exit",M,V]]),o(K,q-1,U-q+3,R),U=q+R.length-2;break}}U=-1;while(++U<K.length)if(K[U][1].type==="strikethroughSequenceTemporary")K[U][1].type=W.data;return K}function $(K,V,U){let q=this.previous,M=this.events,F=0;return R;function R(j){if(_(j===H.tilde,"expected `~`"),q===H.tilde&&M[M.length-1][1].type!==W.characterEscape)return U(j);return K.enter("strikethroughSequenceTemporary"),L(j)}function L(j){let I=X0(q);if(j===H.tilde){if(F>1)return U(j);return K.consume(j),F++,L}if(F<2&&!Q)return U(j);let w=K.exit("strikethroughSequenceTemporary"),A=X0(j);return w._open=!A||A===C.attentionSideAfter&&Boolean(I),w._close=!I||I===C.attentionSideAfter&&Boolean(A),V(j)}}}class I5{constructor(){this.map=[]}add(Y,Z,Q){z9(this,Y,Z,Q)}consume(Y){if(this.map.sort(function(G,$){return G[0]-$[0]}),this.map.length===0)return;let Z=this.map.length,Q=[];while(Z>0)Z-=1,Q.push(Y.slice(this.map[Z][0]+this.map[Z][1]),this.map[Z][2]),Y.length=this.map[Z][0];Q.push(Y.slice()),Y.length=0;let X=Q.pop();while(X){for(let G of X)Y.push(G);X=Q.pop()}this.map.length=0}}function z9(Y,Z,Q,X){let G=0;if(Q===0&&X.length===0)return;while(G<Y.map.length){if(Y.map[G][0]===Z){Y.map[G][1]+=Q,Y.map[G][2].push(...X);return}G+=1}Y.map.push([Z,Q,X])}function O6(Y,Z){_(Y[Z][1].type==="table","expected table");let Q=!1,X=[];while(Z<Y.length){let G=Y[Z];if(Q){if(G[0]==="enter"){if(G[1].type==="tableContent")X.push(Y[Z+1][1].type==="tableDelimiterMarker"?"left":"none")}else if(G[1].type==="tableContent"){if(Y[Z-1][1].type==="tableDelimiterMarker"){let $=X.length-1;X[$]=X[$]==="left"?"center":"right"}}else if(G[1].type==="tableDelimiterRow")break}else if(G[0]==="enter"&&G[1].type==="tableDelimiterRow")Q=!0;Z+=1}return X}function J5(){return{flow:{null:{name:"table",tokenize:T9,resolveAll:O9}}}}function T9(Y,Z,Q){let X=this,G=0,$=0,K;return V;function V(z){let X1=X.events.length-1;while(X1>-1){let v=X.events[X1][1].type;if(v===W.lineEnding||v===W.linePrefix)X1--;else break}let d=X1>-1?X.events[X1][1].type:null,b=d==="tableHead"||d==="tableRow"?P:U;if(b===P&&X.parser.lazy[X.now().line])return Q(z);return b(z)}function U(z){return Y.enter("tableHead"),Y.enter("tableRow"),q(z)}function q(z){if(z===H.verticalBar)return M(z);return K=!0,$+=1,M(z)}function M(z){if(z===H.eof)return Q(z);if(J(z)){if($>1)return $=0,X.interrupt=!0,Y.exit("tableRow"),Y.enter(W.lineEnding),Y.consume(z),Y.exit(W.lineEnding),L;return Q(z)}if(h(z))return k(Y,M,W.whitespace)(z);if($+=1,K)K=!1,G+=1;if(z===H.verticalBar)return Y.enter("tableCellDivider"),Y.consume(z),Y.exit("tableCellDivider"),K=!0,M;return Y.enter(W.data),F(z)}function F(z){if(z===H.eof||z===H.verticalBar||l(z))return Y.exit(W.data),M(z);return Y.consume(z),z===H.backslash?R:F}function R(z){if(z===H.backslash||z===H.verticalBar)return Y.consume(z),F;return F(z)}function L(z){if(X.interrupt=!1,X.parser.lazy[X.now().line])return Q(z);if(Y.enter("tableDelimiterRow"),K=!1,h(z))return _(X.parser.constructs.disable.null,"expected `disabled.null`"),k(Y,j,W.linePrefix,X.parser.constructs.disable.null.includes("codeIndented")?void 0:C.tabSize)(z);return j(z)}function j(z){if(z===H.dash||z===H.colon)return w(z);if(z===H.verticalBar)return K=!0,Y.enter("tableCellDivider"),Y.consume(z),Y.exit("tableCellDivider"),I;return E(z)}function I(z){if(h(z))return k(Y,w,W.whitespace)(z);return w(z)}function w(z){if(z===H.colon)return $+=1,K=!0,Y.enter("tableDelimiterMarker"),Y.consume(z),Y.exit("tableDelimiterMarker"),A;if(z===H.dash)return $+=1,A(z);if(z===H.eof||J(z))return m(z);return E(z)}function A(z){if(z===H.dash)return Y.enter("tableDelimiterFiller"),x(z);return E(z)}function x(z){if(z===H.dash)return Y.consume(z),x;if(z===H.colon)return K=!0,Y.exit("tableDelimiterFiller"),Y.enter("tableDelimiterMarker"),Y.consume(z),Y.exit("tableDelimiterMarker"),S;return Y.exit("tableDelimiterFiller"),S(z)}function S(z){if(h(z))return k(Y,m,W.whitespace)(z);return m(z)}function m(z){if(z===H.verticalBar)return j(z);if(z===H.eof||J(z)){if(!K||G!==$)return E(z);return Y.exit("tableDelimiterRow"),Y.exit("tableHead"),Z(z)}return E(z)}function E(z){return Q(z)}function P(z){return Y.enter("tableRow"),y(z)}function y(z){if(z===H.verticalBar)return Y.enter("tableCellDivider"),Y.consume(z),Y.exit("tableCellDivider"),y;if(z===H.eof||J(z))return Y.exit("tableRow"),Z(z);if(h(z))return k(Y,y,W.whitespace)(z);return Y.enter(W.data),a(z)}function a(z){if(z===H.eof||z===H.verticalBar||l(z))return Y.exit(W.data),y(z);return Y.consume(z),z===H.backslash?r:a}function r(z){if(z===H.backslash||z===H.verticalBar)return Y.consume(z),a;return a(z)}}function O9(Y,Z){let Q=-1,X=!0,G=0,$=[0,0,0,0],K=[0,0,0,0],V=!1,U=0,q,M,F,R=new I5;while(++Q<Y.length){let L=Y[Q],j=L[1];if(L[0]==="enter"){if(j.type==="tableHead"){if(V=!1,U!==0)_(q,"there should be a table opening"),P6(R,Z,U,q,M),M=void 0,U=0;q={type:"table",start:Object.assign({},j.start),end:Object.assign({},j.end)},R.add(Q,0,[["enter",q,Z]])}else if(j.type==="tableRow"||j.type==="tableDelimiterRow"){if(X=!0,F=void 0,$=[0,0,0,0],K=[0,Q+1,0,0],V)V=!1,M={type:"tableBody",start:Object.assign({},j.start),end:Object.assign({},j.end)},R.add(Q,0,[["enter",M,Z]]);G=j.type==="tableDelimiterRow"?2:M?3:1}else if(G&&(j.type===W.data||j.type==="tableDelimiterMarker"||j.type==="tableDelimiterFiller")){if(X=!1,K[2]===0){if($[1]!==0)K[0]=K[1],F=r0(R,Z,$,G,void 0,F),$=[0,0,0,0];K[2]=Q}}else if(j.type==="tableCellDivider")if(X)X=!1;else{if($[1]!==0)K[0]=K[1],F=r0(R,Z,$,G,void 0,F);$=K,K=[$[1],Q,0,0]}}else if(j.type==="tableHead")V=!0,U=Q;else if(j.type==="tableRow"||j.type==="tableDelimiterRow"){if(U=Q,$[1]!==0)K[0]=K[1],F=r0(R,Z,$,G,Q,F);else if(K[1]!==0)F=r0(R,Z,K,G,Q,F);G=0}else if(G&&(j.type===W.data||j.type==="tableDelimiterMarker"||j.type==="tableDelimiterFiller"))K[3]=Q}if(U!==0)_(q,"expected table opening"),P6(R,Z,U,q,M);R.consume(Z.events),Q=-1;while(++Q<Z.events.length){let L=Z.events[Q];if(L[0]==="enter"&&L[1].type==="table")L[1]._align=O6(Z.events,Q)}return Y}function r0(Y,Z,Q,X,G,$){let K=X===1?"tableHeader":X===2?"tableDelimiter":"tableData",V="tableContent";if(Q[0]!==0)_($,"expected previous cell enter"),$.end=Object.assign({},V0(Z.events,Q[0])),Y.add(Q[0],0,[["exit",$,Z]]);let U=V0(Z.events,Q[1]);if($={type:K,start:Object.assign({},U),end:Object.assign({},U)},Y.add(Q[1],0,[["enter",$,Z]]),Q[2]!==0){let q=V0(Z.events,Q[2]),M=V0(Z.events,Q[3]),F={type:"tableContent",start:Object.assign({},q),end:Object.assign({},M)};if(Y.add(Q[2],0,[["enter",F,Z]]),_(Q[3]!==0),X!==2){let R=Z.events[Q[2]],L=Z.events[Q[3]];if(R[1].end=Object.assign({},L[1].end),R[1].type=W.chunkText,R[1].contentType=C.contentTypeText,Q[3]>Q[2]+1){let j=Q[2]+1,I=Q[3]-Q[2]-1;Y.add(j,I,[])}}Y.add(Q[3]+1,0,[["exit",F,Z]])}if(G!==void 0)$.end=Object.assign({},V0(Z.events,G)),Y.add(G,0,[["exit",$,Z]]),$=void 0;return $}function P6(Y,Z,Q,X,G){let $=[],K=V0(Z.events,Q);if(G)G.end=Object.assign({},K),$.push(["exit",G,Z]);X.end=Object.assign({},K),$.push(["exit",X,Z]),Y.add(Q+1,0,$)}function V0(Y,Z){let Q=Y[Z],X=Q[0]==="enter"?"start":"end";return Q[1][X]}var P9={name:"tasklistCheck",tokenize:A9};function S5(){return{text:{[H.leftSquareBracket]:P9}}}function A9(Y,Z,Q){let X=this;return G;function G(U){if(_(U===H.leftSquareBracket,"expected `[`"),X.previous!==H.eof||!X._gfmTasklistFirstContentOfListItem)return Q(U);return Y.enter("taskListCheck"),Y.enter("taskListCheckMarker"),Y.consume(U),Y.exit("taskListCheckMarker"),$}function $(U){if(l(U))return Y.enter("taskListCheckValueUnchecked"),Y.consume(U),Y.exit("taskListCheckValueUnchecked"),K;if(U===H.uppercaseX||U===H.lowercaseX)return Y.enter("taskListCheckValueChecked"),Y.consume(U),Y.exit("taskListCheckValueChecked"),K;return Q(U)}function K(U){if(U===H.rightSquareBracket)return Y.enter("taskListCheckMarker"),Y.consume(U),Y.exit("taskListCheckMarker"),Y.exit("taskListCheck"),V;return Q(U)}function V(U){if(J(U))return Z(U);if(h(U))return Y.check({tokenize:C9},Z,Q)(U);return Q(U)}}function C9(Y,Z,Q){return k(Y,X,W.whitespace);function X(G){return G===H.eof?Q(G):Z(G)}}function A6(Y){return y0([O5(),A5(),C5(Y),J5(),S5()])}function E5(Y,Z){let Q=String(Y);if(typeof Z!=="string")throw TypeError("Expected character");let X=0,G=Q.indexOf(Z);while(G!==-1)X++,G=Q.indexOf(Z,G+Z.length);return X}function w5(Y){if(typeof Y!=="string")throw TypeError("Expected a string");return Y.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var W0=function(Y){if(Y===null||Y===void 0)return E9;if(typeof Y==="function")return a0(Y);if(typeof Y==="object")return Array.isArray(Y)?I9(Y):J9(Y);if(typeof Y==="string")return S9(Y);throw Error("Expected function, string, or object as test")};function I9(Y){let Z=[],Q=-1;while(++Q<Y.length)Z[Q]=W0(Y[Q]);return a0(X);function X(...G){let $=-1;while(++$<Z.length)if(Z[$].apply(this,G))return!0;return!1}}function J9(Y){let Z=Y;return a0(Q);function Q(X){let G=X,$;for($ in Y)if(G[$]!==Z[$])return!1;return!0}}function S9(Y){return a0(Z);function Z(Q){return Q&&Q.type===Y}}function a0(Y){return Z;function Z(Q,X,G){return Boolean(w9(Q)&&Y.call(this,Q,typeof X==="number"?X:void 0,G||void 0))}}function E9(){return!0}function w9(Y){return Y!==null&&typeof Y==="object"&&"type"in Y}function C6(Y){return Y}var I6=[],J6=!0,y5=!1,S6="skip";function b5(Y,Z,Q,X){let G;if(typeof Z==="function"&&typeof Q!=="function")X=Q,Q=Z;else G=Z;let $=W0(G),K=X?-1:1;V(Y,void 0,[])();function V(U,q,M){let F=U&&typeof U==="object"?U:{};if(typeof F.type==="string"){let L=typeof F.tagName==="string"?F.tagName:typeof F.name==="string"?F.name:void 0;Object.defineProperty(R,"name",{value:"node ("+C6(U.type+(L?"<"+L+">":""))+")"})}return R;function R(){let L=I6,j,I,w;if(!Z||$(U,q,M[M.length-1]||void 0)){if(L=y9(Q(U,M)),L[0]===y5)return L}if("children"in U&&U.children){let A=U;if(A.children&&L[0]!==S6){I=(X?A.children.length:-1)+K,w=M.concat(A);while(I>-1&&I<A.children.length){let x=A.children[I];if(j=V(x,I,w)(),j[0]===y5)return j;I=typeof j[1]==="number"?j[1]:I+K}}}return L}}}function y9(Y){if(Array.isArray(Y))return Y;if(typeof Y==="number")return[J6,Y];return Y===null||Y===void 0?I6:[Y]}function g5(Y,Z,Q){let G=W0((Q||{}).ignore||[]),$=b9(Z),K=-1;while(++K<$.length)b5(Y,"text",V);function V(q,M){let F=-1,R;while(++F<M.length){let L=M[F],j=R?R.children:void 0;if(G(L,j?j.indexOf(L):void 0,R))return;R=L}if(R)return U(q,M)}function U(q,M){let F=M[M.length-1],R=$[K][0],L=$[K][1],j=0,w=F.children.indexOf(q),A=!1,x=[];R.lastIndex=0;let S=R.exec(q.value);while(S){let m=S.index,E={index:S.index,input:S.input,stack:[...M,q]},P=L(...S,E);if(typeof P==="string")P=P.length>0?{type:"text",value:P}:void 0;if(P===!1)R.lastIndex=m+1;else{if(j!==m)x.push({type:"text",value:q.value.slice(j,m)});if(Array.isArray(P))x.push(...P);else if(P)x.push(P);j=m+S[0].length,A=!0}if(!R.global)break;S=R.exec(q.value)}if(A){if(j<q.value.length)x.push({type:"text",value:q.value.slice(j)});F.children.splice(w,1,...x)}else x=[q];return w+x.length}}function b9(Y){let Z=[];if(!Array.isArray(Y))throw TypeError("Expected find and replace tuple or list of tuples");let Q=!Y[0]||Array.isArray(Y[0])?Y:[Y],X=-1;while(++X<Q.length){let G=Q[X];Z.push([g9(G[0]),h9(G[1])])}return Z}function g9(Y){return typeof Y==="string"?new RegExp(w5(Y),"g"):Y}function h9(Y){return typeof Y==="function"?Y:function(){return Y}}function x5(){return{transforms:[p9],enter:{literalAutolink:x9,literalAutolinkEmail:h5,literalAutolinkHttp:h5,literalAutolinkWww:h5},exit:{literalAutolink:u9,literalAutolinkEmail:m9,literalAutolinkHttp:k9,literalAutolinkWww:v9}}}function x9(Y){this.enter({type:"link",title:null,url:"",children:[]},Y)}function h5(Y){this.config.enter.autolinkProtocol.call(this,Y)}function k9(Y){this.config.exit.autolinkProtocol.call(this,Y)}function v9(Y){this.config.exit.data.call(this,Y);let Z=this.stack[this.stack.length-1];_(Z.type==="link"),Z.url="http://"+this.sliceSerialize(Y)}function m9(Y){this.config.exit.autolinkEmail.call(this,Y)}function u9(Y){this.exit(Y)}function p9(Y){g5(Y,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,l9],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,f9]],{ignore:["link","linkReference"]})}function l9(Y,Z,Q,X,G){let $="";if(!E6(G))return!1;if(/^w/i.test(Z))Q=Z+Q,Z="",$="http://";if(!i9(Q))return!1;let K=r9(Q+X);if(!K[0])return!1;let V={type:"link",title:null,url:$+Z+K[0],children:[{type:"text",value:Z+K[0]}]};if(K[1])return[V,{type:"text",value:K[1]}];return V}function f9(Y,Z,Q,X){if(!E6(X,!0)||/[-\d_]$/.test(Q))return!1;return{type:"link",title:null,url:"mailto:"+Z+"@"+Q,children:[{type:"text",value:Z+"@"+Q}]}}function i9(Y){let Z=Y.split(".");if(Z.length<2||Z[Z.length-1]&&(/_/.test(Z[Z.length-1])||!/[a-zA-Z\d]/.test(Z[Z.length-1]))||Z[Z.length-2]&&(/_/.test(Z[Z.length-2])||!/[a-zA-Z\d]/.test(Z[Z.length-2])))return!1;return!0}function r9(Y){let Z=/[!"&'),.:;<>?\]}]+$/.exec(Y);if(!Z)return[Y,void 0];Y=Y.slice(0,Z.index);let Q=Z[0],X=Q.indexOf(")"),G=E5(Y,"("),$=E5(Y,")");while(X!==-1&&G>$)Y+=Q.slice(0,X+1),Q=Q.slice(X+1),X=Q.indexOf(")"),$++;return[Y,Q]}function E6(Y,Z){let Q=Y.input.charCodeAt(Y.index-1);return(Y.index===0||N1(Q)||m1(Q))&&(!Z||Q!==47)}Q3.peek=Z3;function d9(){this.buffer()}function n9(Y){this.enter({type:"footnoteReference",identifier:"",label:""},Y)}function s9(){this.buffer()}function c9(Y){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},Y)}function o9(Y){let Z=this.resume(),Q=this.stack[this.stack.length-1];_(Q.type==="footnoteReference"),Q.identifier=G1(this.sliceSerialize(Y)).toLowerCase(),Q.label=Z}function t9(Y){this.exit(Y)}function e9(Y){let Z=this.resume(),Q=this.stack[this.stack.length-1];_(Q.type==="footnoteDefinition"),Q.identifier=G1(this.sliceSerialize(Y)).toLowerCase(),Q.label=Z}function Y3(Y){this.exit(Y)}function Z3(){return"["}function Q3(Y,Z,Q,X){let G=Q.createTracker(X),$=G.move("[^"),K=Q.enter("footnoteReference"),V=Q.enter("reference");return $+=G.move(Q.safe(Q.associationId(Y),{after:"]",before:$})),V(),K(),$+=G.move("]"),$}function k5(){return{enter:{gfmFootnoteCallString:d9,gfmFootnoteCall:n9,gfmFootnoteDefinitionLabelString:s9,gfmFootnoteDefinition:c9},exit:{gfmFootnoteCallString:o9,gfmFootnoteCall:t9,gfmFootnoteDefinitionLabelString:e9,gfmFootnoteDefinition:Y3}}}$3.peek=H3;function v5(){return{canContainEols:["delete"],enter:{strikethrough:G3},exit:{strikethrough:K3}}}function G3(Y){this.enter({type:"delete",children:[]},Y)}function K3(Y){this.exit(Y)}function $3(Y,Z,Q,X){let G=Q.createTracker(X),$=Q.enter("strikethrough"),K=G.move("~~");return K+=Q.containerPhrasing(Y,{...G.current(),before:K,after:"~"}),K+=G.move("~~"),$(),K}function H3(){return"~"}function u5(){return{enter:{table:W3,tableData:w6,tableHeader:w6,tableRow:M3},exit:{codeText:U3,table:q3,tableData:m5,tableHeader:m5,tableRow:m5}}}function W3(Y){let Z=Y._align;_(Z,"expected `_align` on table"),this.enter({type:"table",align:Z.map(function(Q){return Q==="none"?null:Q}),children:[]},Y),this.data.inTable=!0}function q3(Y){this.exit(Y),this.data.inTable=void 0}function M3(Y){this.enter({type:"tableRow",children:[]},Y)}function m5(Y){this.exit(Y)}function w6(Y){this.enter({type:"tableCell",children:[]},Y)}function U3(Y){let Z=this.resume();if(this.data.inTable)Z=Z.replace(/\\([\\|])/g,F3);let Q=this.stack[this.stack.length-1];_(Q.type==="inlineCode"),Q.value=Z,this.exit(Y)}function F3(Y,Z){return Z==="|"?Z:Y}function p5(){return{exit:{taskListCheckValueChecked:y6,taskListCheckValueUnchecked:y6,paragraph:R3}}}function y6(Y){let Z=this.stack[this.stack.length-2];_(Z.type==="listItem"),Z.checked=Y.type==="taskListCheckValueChecked"}function R3(Y){let Z=this.stack[this.stack.length-2];if(Z&&Z.type==="listItem"&&typeof Z.checked==="boolean"){let Q=this.stack[this.stack.length-1];_(Q.type==="paragraph");let X=Q.children[0];if(X&&X.type==="text"){let G=Z.children,$=-1,K;while(++$<G.length){let V=G[$];if(V.type==="paragraph"){K=V;break}}if(K===Q){if(X.value=X.value.slice(1),X.value.length===0)Q.children.shift();else if(Q.position&&X.position&&typeof X.position.start.offset==="number")X.position.start.column++,X.position.start.offset++,Q.position.start=Object.assign({},X.position.start)}}}this.exit(Y)}function l5(){return[x5(),k5(),v5(),u5(),p5()]}var g6=K2(b6(),1),O0=Object.assign(a1(Error),{eval:a1(EvalError),range:a1(RangeError),reference:a1(ReferenceError),syntax:a1(SyntaxError),type:a1(TypeError),uri:a1(URIError)});function a1(Y){return Z.displayName=Y.displayName||Y.name,Z;function Z(Q,...X){let G=Q?g6.default(Q,...X):Q;return new Y(G)}}var d0={}.hasOwnProperty,h6={yaml:"-",toml:"+"};function P0(Y){let Z=[],Q=-1,X=Array.isArray(Y)?Y:Y?[Y]:["yaml"];while(++Q<X.length)Z[Q]=N3(X[Q]);return Z}function N3(Y){let Z=Y;if(typeof Z==="string"){if(!d0.call(h6,Z))throw O0("Missing matter definition for `%s`",Z);Z={type:Z,marker:h6[Z]}}else if(typeof Z!=="object")throw O0("Expected matter to be an object, not `%j`",Z);if(!d0.call(Z,"type"))throw O0("Missing `type` in matter `%j`",Z);if(!d0.call(Z,"fence")&&!d0.call(Z,"marker"))throw O0("Missing `marker` or `fence` in matter `%j`",Z);return Z}function r5(Y){let Z=P0(Y),Q={},X=-1;while(++X<Z.length){let G=Z[X],$=i5(G,"open").charCodeAt(0),K=D3(G),V=Q[$];if(Array.isArray(V))V.push(K);else Q[$]=[K]}return{flow:Q}}function D3(Y){let{anywhere:Z,type:Q}=Y,X=Q+"Fence",G=X+"Sequence",$=Q+"Value",K={tokenize:M,partial:!0},V,U=0;return{tokenize:q,concrete:!0};function q(F,R,L){let j=this;return I;function I(y){let a=j.now();if(a.column===1&&(a.line===1||Z)){if(V=i5(Y,"open"),U=0,y===V.charCodeAt(U))return F.enter(Q),F.enter(X),F.enter(G),w(y)}return L(y)}function w(y){if(U===V.length){if(F.exit(G),h(y))return F.enter(W.whitespace),A(y);return x(y)}if(y===V.charCodeAt(U++))return F.consume(y),w;return L(y)}function A(y){if(h(y))return F.consume(y),A;return F.exit(W.whitespace),x(y)}function x(y){if(J(y))return F.exit(X),F.enter(W.lineEnding),F.consume(y),F.exit(W.lineEnding),V=i5(Y,"close"),U=0,F.attempt(K,P,S);return L(y)}function S(y){if(y===H.eof||J(y))return E(y);return F.enter($),m(y)}function m(y){if(y===H.eof||J(y))return F.exit($),E(y);return F.consume(y),m}function E(y){if(y===H.eof)return L(y);return F.enter(W.lineEnding),F.consume(y),F.exit(W.lineEnding),F.attempt(K,P,S)}function P(y){return F.exit(Q),R(y)}}function M(F,R,L){let j=0;return I;function I(S){if(S===V.charCodeAt(j))return F.enter(X),F.enter(G),w(S);return L(S)}function w(S){if(j===V.length){if(F.exit(G),h(S))return F.enter(W.whitespace),A(S);return x(S)}if(S===V.charCodeAt(j++))return F.consume(S),w;return L(S)}function A(S){if(h(S))return F.consume(S),A;return F.exit(W.whitespace),x(S)}function x(S){if(S===H.eof||J(S))return F.exit(X),R(S);return L(S)}}}function i5(Y,Z){return Y.marker?x6(Y.marker,Z).repeat(3):x6(Y.fence,Z)}function x6(Y,Z){return typeof Y==="string"?Y:Y[Z]}function a5(Y){let Z=P0(Y),Q={},X={},G=-1;while(++G<Z.length){let $=Z[G];Q[$.type]=B3($),X[$.type]=z3,X[$.type+"Value"]=T3}return{enter:Q,exit:X}}function B3(Y){return Z;function Z(Q){this.enter({type:Y.type,value:""},Q),this.buffer()}}function z3(Y){let Z=this.resume(),Q=this.stack[this.stack.length-1];_("value"in Q),this.exit(Y),Q.value=Z.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,"")}function T3(Y){this.config.enter.data.call(this,Y),this.config.exit.data.call(this,Y)}class n0{annotations;constructor(Y=[]){this.annotations=Y}pushText(Y){if(Y.length>0)this.annotations.push({text:Y})}pushMarkup(Y,Z){this.annotations.push({markup:Y,interpretAs:Z})}extend(Y){for(let Z of Y.annotations)if("text"in Z)this.pushText(Z.text);else this.pushMarkup(Z.markup,Z.interpretAs)}optimize(){let Y=[];for(let Q of this.annotations){if("text"in Q&&Q.text.length===0||"markup"in Q&&Q.markup.length===0&&!Q.interpretAs)continue;let X=Y.at(-1);if(X===void 0)Y.push(Q);else if("text"in X&&"text"in Q)X.text+=Q.text;else if("markup"in X&&"markup"in Q){if(X.markup+=Q.markup,X.interpretAs&&Q.interpretAs)X.interpretAs+=Q.interpretAs;else if(Q.interpretAs)X.interpretAs=Q.interpretAs}else Y.push(Q)}for(let Q of Y)if("markup"in Q&&Q.interpretAs)Q.interpretAs=Q.interpretAs.replace(/\n{3,}/g,`
`);for(let Q=Y.at(-1);Q&&"markup"in Q;Q=Y.at(-1))Y.pop();let Z=0;for(let Q=Y.at(0);Q&&"markup"in Q;Q=Y.at(0))Z+=Q.markup.length,Y.shift();return this.annotations=Y,Z}extractSlice(Y,Z){let Q=0;for(;Q<this.annotations.length;Q++){let G=this.annotations[Q],$="text"in G?G.text:G.markup;if($.length<Y)Y-=$.length,Z-=$.length;else break}let X="";for(;Q<this.annotations.length;Q++){let G=this.annotations[Q];if("text"in G)X+=G.text;else{if(X.length<Y)Y-=G.markup.length,Y+=G.interpretAs?.length||0;X+=G.interpretAs??"",Z-=G.markup.length,Z+=G.interpretAs?.length||0}if(X.length>=Z)return X.slice(Y,Z).trim()}return null}length(){return this.annotations.reduce((Y,Z)=>{if("text"in Z)return Y+Z.text.length;if("markup"in Z)return Y+Z.markup.length;return Y},0)}stringify(){return JSON.stringify({annotation:this.annotations})}}var d1={horizontalTab:-2,virtualSpace:-1,nul:0,eof:null,space:32,leftSquareBracket:91};function k6(Y){return Y!=null&&(Y<d1.nul||Y===d1.space)}function d5(Y){return Y!=null&&Y<d1.horizontalTab}function v6(Y={}){let Q=Y.aliasDivider||"|",X="[[",G="]]";function $(K,V,U){let q=!1,M=!1,F=0,R=0,L=0;return j;function j(E){if(E!=="[[".charCodeAt(R))return U(E);return K.enter("wikiLink"),K.enter("wikiLinkMarker"),I(E)}function I(E){if(R===2)return K.exit("wikiLinkMarker"),w(E);if(E!=="[[".charCodeAt(R))return U(E);return K.consume(E),R++,I}function w(E){if(d5(E)||E===d1.eof)return U(E);return K.enter("wikiLinkData"),K.enter("wikiLinkTarget"),A(E)}function A(E){if(E===Q.charCodeAt(F)){if(!q)return U(E);return K.exit("wikiLinkTarget"),K.enter("wikiLinkAliasMarker"),x(E)}if(E==="]]".charCodeAt(L)){if(!q)return U(E);return K.exit("wikiLinkTarget"),K.exit("wikiLinkData"),K.enter("wikiLinkMarker"),m(E)}if(d5(E)||E===d1.eof)return U(E);if(!k6(E))q=!0;return K.consume(E),A}function x(E){if(F===Q.length)return K.exit("wikiLinkAliasMarker"),K.enter("wikiLinkAlias"),S(E);if(E!==Q.charCodeAt(F))return U(E);return K.consume(E),F++,x}function S(E){if(E==="]]".charCodeAt(L)){if(!M)return U(E);return K.exit("wikiLinkAlias"),K.exit("wikiLinkData"),K.enter("wikiLinkMarker"),m(E)}if(d5(E)||E===d1.eof)return U(E);if(!k6(E))M=!0;return K.consume(E),S}function m(E){if(L===2)return K.exit("wikiLinkMarker"),K.exit("wikiLink"),V(E);if(E!=="]]".charCodeAt(L))return U(E);return K.consume(E),L++,m}}return{text:{[d1.leftSquareBracket]:{name:"wikilink",tokenize:$}}}}function m6(Y={}){let Z=(U)=>U.replace(/ /g,"_").toLowerCase(),Q;function X(U){Q={type:"wikiLink",children:[]},this.enter(Q,U)}function G(U){let q=U.at(-1);if(q&&q.type==="wikiLink")return q;throw Error("Expected wikiLink node")}function $(U){let q=this.sliceSerialize(U),M=G(this.stack);M.data={value:q,link:Z(q)},M.children=[{type:"text",value:q,position:{start:U.start,end:U.end}}]}function K(U){let q=this.sliceSerialize(U),M=G(this.stack);if(M.data!=null)M.data.value=q;M.children=[{type:"text",value:q,position:{start:U.start,end:U.end}}]}function V(U){this.exit(U)}return{enter:{wikiLink:X},exit:{wikiLinkTarget:$,wikiLinkAlias:K,wikiLink:V}}}var p6=/\\[!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~]/g;class n5{#Z;#Y;constructor(Y){this.#Z=Y,this.#Y=z5(Y,{extensions:[A6(),r5(["yaml"]),v6({aliasDivider:"|"})],mdastExtensions:[l5(),a5(["yaml"]),m6()]})}annotate(Y){let Z=new l6(this.#Z,Y);try{this.#Y.children.forEach((Q)=>Z.visitRoot(Q))}catch(Q){throw console.error(`Error while parsing markdown:
`,JSON.stringify(this.#Y,void 0," ")),Q}return{offset:Z.output_start??0,annotations:Z.output}}isInside(Y,Z){function Q(X){let G=X?.position?.start.offset,$=X?.position?.end.offset;if(G==null||$==null)throw Error("Markdown parsing: unknown position for text node");if(G<=Y&&Y<$){if(X.type===Z)return!0;if("children"in X)return X.children.some((K)=>Q(K))}return!1}return this.#Y.children.some((X)=>Q(X))}}class l6{raw;output;output_start;output_end;offset;range;constructor(Y,Z){this.raw=Y,this.output=new n0,this.offset=0,this.range=Z}visitText(Y){let Z=Y?.position?.start.offset,Q=Y?.position?.end.offset;if(Z==null||Q==null)throw Error("Markdown parsing: unknown position for text node");let X=this.raw.slice(Z,Q);if(O3(X,Y.value,this.output),this.output.length()!==Q-(this.output_start||0))throw console.error("Invalid output length",this.output.length(),Q,JSON.stringify(Y,void 0," ")),Error("Markdown parsing: invalid output length");this.offset=Q}visitRoot(Y){if(Y.position==null)throw Error("Markdown parsing: unknown position");let Z=Y?.position?.start.offset,Q=Y?.position?.end.offset;if(Z==null||Q==null)throw Error("Markdown parsing: unknown position for text node");if(this.range&&P3(Y)){if(Q<=this.range.from-1)return;if(Z>=this.range.to+1)return;if(Z<=this.range.from&&this.range.from<=Q)this.output=new n0,this.offset=Z,this.output_start=this.offset,console.debug("Start from",this.output_start);if(Z<=this.range.to&&this.range.to<=Q)this.output_end=Q,console.debug("End at",this.output_end)}if(this.offset<Z)this.output.pushMarkup(" ".repeat(Z-this.offset)),this.offset=Z;switch(Y.type){case"text":this.visitText(Y);break;case"yaml":case"code":case"html":case"image":case"imageReference":case"footnoteReference":case"definition":break;case"strong":case"emphasis":case"delete":case"footnoteDefinition":case"linkReference":Y.children.forEach((X)=>this.visitRoot(X));break;case"list":case"heading":Y.children.forEach((X)=>this.visitRoot(X)),this.output.pushMarkup("",`
`);break;case"inlineCode":this.output.pushMarkup(s0(Z,Q),Y.value),this.offset=Q;break;case"break":this.output.pushMarkup(s0(Z,Q),`
`),this.offset=Q;break;case"blockquote":case"paragraph":if(Y.children.length>0)Y.children.forEach((X)=>this.visitRoot(X)),this.output.pushMarkup("",`
`);break;case"listItem":if(Y.children.length>0)this.output.pushMarkup("","• "),Y.children.forEach((X)=>this.visitRoot(X));break;case"link":case"wikiLink":if(Y.children)Y.children.forEach((X)=>this.visitRoot(X));else this.output.pushMarkup(s0(Z,Q),"DUMMY"),this.offset=Q;break;case"table":this.output.pushMarkup("",`
`),Y.children.forEach((X)=>this.visitRoot(X));break;case"tableRow":Y.children.forEach((X)=>this.visitRoot(X)),this.output.pushMarkup("",`
`);break;case"tableCell":Y.children.forEach((X)=>this.visitRoot(X)),this.output.pushMarkup("",`
`);break;case"thematicBreak":this.output.pushMarkup(s0(Z,Q),`
`),this.offset=Q;break}if(this.offset<Q)this.output.pushMarkup(" ".repeat(Q-this.offset)),this.offset=Q}}function u6(Y,Z){let Q=0;for(let X of Y.matchAll(p6)){let G=X.index;Z.pushText(Y.slice(Q,G)),Z.pushMarkup(" ",""),Z.pushText(Y.slice(G+1,G+2)),Q=G+2}Z.pushText(Y.slice(Q))}function O3(Y,Z,Q){let[X,...G]=Y.replace(/\n$/,"").split(`
`),[$,...K]=Z.replace(/\n$/,"").split(`
`);if(G.length!==K.length)throw console.error("Invalid number of lines",G.length,K.length,Y,Z),Error("Markdown parsing: invalid number of lines");u6(X,Q);for(let V=0;V<G.length;V++){let U=G[V],q=K[V],M=U.length-q.length;for(let F of U.matchAll(p6))M-=1;if(M<0)throw console.error("Invalid indent",M,U,q),Error("Markdown parsing: invalid indent");Q.pushText(`
`),Q.pushMarkup(" ".repeat(M)),u6(U.substring(M),Q)}if(Y.endsWith(`
`))Q.pushText(`
`)}function s0(Y,Z){return" ".repeat(Z-Y)}function P3(Y){return["blockquote","code","heading","html","list","paragraph","table","thematicBreak"].contains(Y.type)}class f6 extends Z5{plugin;constructor(Y){super();this.plugin=Y}loadOptions(){return this.plugin.loadData()}save(Y){return console.debug("Saving settings",Y),this.plugin.saveData(Y)}}class s5 extends Q1.Plugin{settings=new f6(this);statusBarItem;isLoading=!1;logs=[];settingTab;autoCheckSuppressErrorsUntil=0;async onload(){if(await this.settings.load(),this.settingTab=new Q5(this.app,this),this.addSettingTab(this.settingTab),this.statusBarItem=this.addStatusBarItem(),this.statusBarItem.addClass("status-bar-item-icon","lt-status-bar-btn"),this.statusBarItem.onclick=()=>this.handleStatusBarClick(),this.setStatusBarReady(),this.registerEditorExtension(b2(this)),this.registerCommands(),this.registerMenuItems(),this.settings.options.injectProperties)this.injectProperties(!0);let Y=new Set(this.settings.options.dictionary.map((Z)=>Z.trim()));Y.delete(""),await this.settings.update({dictionary:[...Y].sort(Y0)}),await this.syncDictionary()}onunload(){this.logs=[],this.isLoading=!1}injectProperties(Y){let Z={"lt-language":"text","lt-picky":"checkbox","lt-autoCheck":"checkbox","lt-dictionary":"multitext","lt-disabledRules":"multitext","lt-disabledCategories":"multitext"};try{let Q=this.app.metadataTypeManager;for(let[X,G]of Object.entries(Z))if(Y)Q.setType(X,G);else Q.unsetType(X)}catch{console.error("Failed to set metadata types")}}registerCommands(){this.addCommand({id:"check",name:"Check text",icon:"spell-check",editorCallback:(Y,Z)=>{let Q=Y.cm;this.runDetection(Q).then((X)=>{if(!X)new Q1.Notice("No suggestions found.")},(X)=>console.error(X))}}),this.addCommand({id:"toggle-auto-check",name:"Toggle automatic checking",icon:"uppercase-lowercase-a",callback:async()=>{await this.settings.update({shouldAutoCheck:!this.settings.options.shouldAutoCheck})}}),this.addCommand({id:"clear",name:"Clear suggestions",icon:"cross",editorCallback:(Y)=>{Y.cm.dispatch({effects:[N0.of(null)]})}}),this.addCommand({id:"accept-all",name:"Accept all suggestions",icon:"circle-check-big",editorCallback:(Y)=>{let Z=Y.cm,Q=[],X=[];Z.state.field(P1).between(0,1/0,(G,$,K)=>{let V=K.spec.underline;if(V?.replacements?.length)Q.push({from:G,to:$,insert:V.replacements[0]}),X.push(_1.of({from:G,to:$}))}),Z.dispatch({changes:Q,effects:X})}}),this.addCommand({id:"next",name:"Jump to next suggestion",icon:"chevron-right",editorCheckCallback:(Y,Z)=>{let Q=Z.cm,X=Z.posToOffset(Z.getCursor()),G=null;if(Q.state.field(P1).between(X+1,1/0,($,K)=>{if(!G||G.from>$)G={from:$,to:K}}),Y)return G!=null;if(G!=null)Q.dispatch({selection:{anchor:G.from,head:G.to}})}});for(let Y=1;Y<=_0;Y++)this.addCommand(this.applySuggestionCommand(Y));this.addCommand({id:"synonyms",name:"Show synonyms",icon:"square-stack",editorCheckCallback:(Y,Z)=>this.showSynonyms(Z,Y)})}applySuggestionCommand(Y){return{id:`accept-${Y}`,name:`Accept suggestion ${Y}`,icon:"circle-check",editorCheckCallback(Z,Q){let X=Q.cm,G=Q.posToOffset(Q.getCursor()),$=[];if(X.state.field(P1).between(G,G,(R,L,j)=>{$.push({from:R,to:L,value:j})}),!$||$.length!==1)return!1;let{from:K,to:V,value:U}=$[0],q=U.spec.underline,M=q&&q.replacements.length>=Y;if(Z)return M;if(!M)return;let F={from:K,to:V,insert:q.replacements[Y-1]};X.dispatch({changes:[F],effects:[_1.of({from:K,to:V})]})}}}registerMenuItems(){this.registerEvent(this.app.workspace.on("editor-menu",(Y,Z,Q)=>{console.debug(Y);let X=Z.cm;if(this.populateSuggestionMenu(Y,X),this.showSynonyms(Z,!0))Y.addItem((G)=>{G.setTitle("Synonyms"),G.setIcon("square-stack"),G.setSection("spellcheck"),G.onClick(()=>this.showSynonyms(Z))})}))}populateSuggestionMenu(Y,Z){let Q=Z.state.field(P1),X=Z.state.selection.main,G=!1,$=Q.iter(X.from);while($.value!=null&&$.from<=X.to){G=!0;let K=$.value.spec.underline;Y.addItem((V)=>{V.setTitle(`LanguageTool (${K.text})`),V.setIcon("spell-check"),V.setSection("spellcheck");let U=V.setSubmenu();this.populateSuggestionSubmenu(U,K,$,Z)}),$.next()}return G}populateSuggestionSubmenu(Y,Z,Q,X){if(Z.message||Z.title)Y.addItem((G)=>{let $=new DocumentFragment;$.appendChild(createDiv({cls:"lt-menu-info"},(K)=>{if(Z.title)K.createDiv({text:Z.title,cls:"lt-menu-title"});if(Z.message)K.createDiv({text:Z.message,cls:"lt-menu-message"})})),G.setIsLabel(!0),G.setTitle($)}),Y.addSeparator();for(let G of Z.replacements.slice(0,_0))Y.addItem(($)=>{$.setTitle(G?JSON.stringify(G):"(delete)"),$.onClick(()=>{X.dispatch({changes:{...Q,insert:G},effects:[_1.of(Q)]})})});if(Y.addSeparator(),Z.categoryId==="TYPOS")Y.addItem((G)=>{G.setTitle("Add to dictionary"),G.setIcon("plus-with-circle"),G.onClick(async()=>{let $=[...this.settings.options.dictionary,Z.text.trim()];$.sort(Y0),await this.settings.update({dictionary:$}),await this.syncDictionary(),X.dispatch({effects:[x1.of((K)=>K.text===Z.text)]})})});else if(Y.addItem((G)=>{G.setTitle("Ignore suggestion"),G.setIcon("cross"),G.onClick(()=>{X.dispatch({effects:[_1.of(Q)]})})}),Z.ruleId&&Z.ruleId!=="SYNONYMS")Y.addItem((G)=>{G.setTitle("Disable rule"),G.setIcon("circle-off"),G.onClick(async()=>{let K=this.settings.options.disabledRules;if(K)K+=","+Z.ruleId;else K=Z.ruleId;await this.settings.update({disabledRules:K}),X.dispatch({effects:[x1.of((V)=>V.ruleId===Z.ruleId)]})});let $=G.dom;Q1.setTooltip($,`${Z.categoryId} > ${Z.ruleId}`)})}showSynonyms(Y,Z=!1){if(!this.settings.options.synonyms||!(this.settings.options.synonyms in o1))return!1;let Q=o1[this.settings.options.synonyms];if(!Q)return!1;let X=Y.cm,G=X.state.selection.main;if(G.empty)return!1;let $=X.state.sliceDoc(X.state.selection.main.from,X.state.selection.main.to);if($.match(/[\s.]/))return!1;if(Z)return!0;let K=X.state.doc.lineAt(G.from),V=K.text.slice(0,G.from-K.from).lastIndexOf(".")+1,U=K.text.slice(V),q=U.trimStart(),M=K.from+V+U.length-q.length,F={from:G.from-M,to:G.to-M};q=q.trimEnd();let R=q.indexOf(".");if(R!==-1)q=q.slice(0,R+1);return Q.query(q,F).then((L)=>X.dispatch({effects:[E0.of({text:$,range:G,title:"Synonyms",message:"",categoryId:"SYNONYMS",ruleId:"SYNONYMS",replacements:L})]}),(L)=>{let j=L;console.error(j),this.pushLogs(j),new Q1.Notice(j.message,30000)}),!0}setStatusBarReady(){this.isLoading=!1,Q1.setIcon(this.statusBarItem,"spell-check")}setStatusBarWorking(){if(this.isLoading)return;this.isLoading=!0,Q1.setIcon(this.statusBarItem,"sync-small")}handleStatusBarClick(){let Y=this.statusBarItem.getBoundingClientRect(),Z=this.statusBarItem.getBoundingClientRect();new Q1.Menu().addItem((Q)=>{Q.setTitle("Check text"),Q.setIcon("spell-check"),Q.onClick(async()=>{let X=this.app.workspace.getActiveViewOfType(Q1.MarkdownView);if(X&&X.getMode()==="source"){let G=X.editor.cm;if(!await this.runDetection(G))new Q1.Notice("No suggestions found.")}})}).addItem((Q)=>{Q.setTitle(this.settings.options.shouldAutoCheck?"Disable automatic checking":"Enable automatic checking"),Q.setIcon("uppercase-lowercase-a"),Q.onClick(async()=>{await this.settings.update({shouldAutoCheck:!this.settings.options.shouldAutoCheck})})}).addItem((Q)=>{Q.setTitle("Clear suggestions"),Q.setIcon("cross"),Q.onClick(()=>{let X=this.app.workspace.getActiveViewOfType(Q1.MarkdownView);if(!X)return;X.editor.cm.dispatch({effects:[N0.of(null)]})})}).showAtPosition({x:Z.right+5,y:(Y?.top||0)-5})}getActiveFileSettings(){let Y=this.app.workspace.getActiveFile(),Z=Y&&this.app.metadataCache.getFileCache(Y);if(Z?.frontmatter!=null){let Q=Z.frontmatter["lt-language"]??Z.frontmatter.lt_language,X=Z.frontmatter["lt-picky"],G=Z.frontmatter["lt-autoCheck"],$=Z.frontmatter["lt-dictionary"],K=Z.frontmatter["lt-disabledRules"],V=Z.frontmatter["lt-disabledCategories"],U={...this.settings.options};if(typeof Q==="string")U.staticLanguage=Q;if(typeof G==="boolean")U.shouldAutoCheck=G;if(typeof X==="boolean")U.pickyMode=X;if(Array.isArray($))U.dictionary=$;if(Array.isArray(K)&&K.length)U.disabledRules+=","+K.join(",");if(Array.isArray(V)&&V.length)U.disabledCategories+=","+V.join(",");return U}return this.settings.options}async runDetection(Y,Z=!1,Q){let X=this.getActiveFileSettings(),G=Y.state.selection.main;if(!Q&&!G.empty)Q={...G};let $=Y.state,K=$.doc,V=$.sliceDoc();if(!V.trim())return!1;let U,q=void 0,M;try{this.setStatusBarWorking(),M=new n5(V);let{offset:R,annotations:L}=M.annotate(Q);if(R+=L.optimize(),L.length()===0)return!1;if(X.longCheckNotification&&!Z&&L.length()>500)q=new Q1.Notice("Checking spelling...",30000);if(console.debug(`Checking ${L.length()} characters...`),U=await F2(X,R,L),Q)Q={from:R,to:R+L.length()}}catch(R){if(console.error(R),R instanceof Error){if(this.pushLogs(R),!Z)new Q1.Notice(R.message,30000)}if(Z)throw R;return!0}finally{if(this.setStatusBarReady(),q)q.hide()}if(K!==Y.state.doc)return!0;let F=[];if(Q)F.push(_1.of(Q));else F.push(N0.of(null));if(U){let R=X.dictionary;for(let L of U){if(L.range.to>Y.state.doc.length)continue;if(L.categoryId==="TYPOS"&&R.includes(L.text))continue;if(L.categoryId==="WHITESPACE"&&(M.isInside(L.range.from,"table")||M.isInside(L.range.to,"table")))continue;F.push(E0.of(L))}}if(F.length)Y.dispatch({effects:F});return console.debug(`Found ${F.length-1} suggestions.`),this.autoCheckSuppressErrorsUntil=0,F.length>1}pushLogs(Y){let Z=`${new Date().toLocaleString()}:
Error: '${Y.message}'
Settings: ${JSON.stringify({...this.settings,username:"REDACTED",apikey:"REDACTED"})}
`;if(this.logs.push(Z),this.logs.length>10)this.logs.shift()}async onExternalSettingsChange(){await this.settings.load(),await this.settingTab.notifyEndpointChange(this.settings.options)}async syncDictionary(){if(!this.settings.options.syncDictionary||g1(this.settings.options.serverUrl)!=="premium")return;try{let Y=new Set(this.settings.options.remoteDictionary),Z=new Set(this.settings.options.dictionary),Q=new Set(await R2(this.settings.options)),X=e1(Y,Z);X=T2(X,Q);for(let U of X)await N2(this.settings.options,U);let G=e1(Y,Q);Q=e1(Q,X),Z=e1(Z,G);let $=e1(Z,Q);for(let U of $)await _2(this.settings.options,U);let V=[...z2(Q,Z)].sort(Y0);await this.settings.update({dictionary:V,remoteDictionary:V})}catch(Y){let Z=Y;this.pushLogs(Z),new Q1.Notice(Z.message,30000),console.error("Failed sync spellcheck with LanguageTool",Y)}}}
/* nosourcemap */