markedin-parser 0.2.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/NOTICE +8 -0
- package/README.md +8 -4
- package/dist/markedin.browser.js +4295 -0
- package/dist/markedin.browser.min.js +126 -0
- package/package.json +8 -4
- package/parse.js +12 -10
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
var markedin=(()=>{var Ce=Object.defineProperty;var ci=Object.getOwnPropertyDescriptor;var pi=Object.getOwnPropertyNames;var hi=Object.prototype.hasOwnProperty;var fi=(e,r)=>()=>(e&&(r=e(e=0)),r);var y=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),di=(e,r)=>{for(var n in r)Ce(e,n,{get:r[n],enumerable:!0})},gi=(e,r,n,t)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of pi(r))!hi.call(e,i)&&i!==n&&Ce(e,i,{get:()=>r[i],enumerable:!(t=ci(r,i))||t.enumerable});return e};var xi=e=>gi(Ce({},"__esModule",{value:!0}),e);var H=y((Po,P)=>{"use strict";function wr(e){return typeof e>"u"||e===null}function mi(e){return typeof e=="object"&&e!==null}function ki(e){return Array.isArray(e)?e:wr(e)?[]:[e]}function bi(e,r){var n,t,i,o;if(r)for(o=Object.keys(r),n=0,t=o.length;n<t;n+=1)i=o[n],e[i]=r[i];return e}function wi(e,r){var n="",t;for(t=0;t<r;t+=1)n+=e;return n}function yi(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}P.exports.isNothing=wr;P.exports.isObject=mi;P.exports.toArray=ki;P.exports.repeat=wi;P.exports.isNegativeZero=yi;P.exports.extend=bi});var j=y((Mo,Ar)=>{"use strict";function yr(e,r){var n="",t=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(n+='in "'+e.mark.name+'" '),n+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!r&&e.mark.snippet&&(n+=`
|
|
2
|
+
|
|
3
|
+
`+e.mark.snippet),t+" "+n):t}function X(e,r){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=r,this.message=yr(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}X.prototype=Object.create(Error.prototype);X.prototype.constructor=X;X.prototype.toString=function(r){return this.name+": "+yr(this,r)};Ar.exports=X});var vr=y((Do,Sr)=>{"use strict";var V=H();function Ee(e,r,n,t,i){var o="",l="",a=Math.floor(i/2)-1;return t-r>a&&(o=" ... ",r=t-a+o.length),n-t>a&&(l=" ...",n=t+a-l.length),{str:o+e.slice(r,n).replace(/\t/g,"\u2192")+l,pos:t-r+o.length}}function Re(e,r){return V.repeat(" ",r-e.length)+e}function Ai(e,r){if(r=Object.create(r||null),!e.buffer)return null;r.maxLength||(r.maxLength=79),typeof r.indent!="number"&&(r.indent=1),typeof r.linesBefore!="number"&&(r.linesBefore=3),typeof r.linesAfter!="number"&&(r.linesAfter=2);for(var n=/\r?\n|\r|\0/g,t=[0],i=[],o,l=-1;o=n.exec(e.buffer);)i.push(o.index),t.push(o.index+o[0].length),e.position<=o.index&&l<0&&(l=t.length-2);l<0&&(l=t.length-1);var a="",s,u,c=Math.min(e.line+r.linesAfter,i.length).toString().length,p=r.maxLength-(r.indent+c+3);for(s=1;s<=r.linesBefore&&!(l-s<0);s++)u=Ee(e.buffer,t[l-s],i[l-s],e.position-(t[l]-t[l-s]),p),a=V.repeat(" ",r.indent)+Re((e.line-s+1).toString(),c)+" | "+u.str+`
|
|
4
|
+
`+a;for(u=Ee(e.buffer,t[l],i[l],e.position,p),a+=V.repeat(" ",r.indent)+Re((e.line+1).toString(),c)+" | "+u.str+`
|
|
5
|
+
`,a+=V.repeat("-",r.indent+c+3+u.pos)+`^
|
|
6
|
+
`,s=1;s<=r.linesAfter&&!(l+s>=i.length);s++)u=Ee(e.buffer,t[l+s],i[l+s],e.position-(t[l]-t[l+s]),p),a+=V.repeat(" ",r.indent)+Re((e.line+s+1).toString(),c)+" | "+u.str+`
|
|
7
|
+
`;return a.replace(/\n$/,"")}Sr.exports=Ai});var v=y((Bo,_r)=>{"use strict";var Tr=j(),Si=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],vi=["scalar","sequence","mapping"];function Ti(e){var r={};return e!==null&&Object.keys(e).forEach(function(n){e[n].forEach(function(t){r[String(t)]=n})}),r}function _i(e,r){if(r=r||{},Object.keys(r).forEach(function(n){if(Si.indexOf(n)===-1)throw new Tr('Unknown option "'+n+'" is met in definition of "'+e+'" YAML type.')}),this.options=r,this.tag=e,this.kind=r.kind||null,this.resolve=r.resolve||function(){return!0},this.construct=r.construct||function(n){return n},this.instanceOf=r.instanceOf||null,this.predicate=r.predicate||null,this.represent=r.represent||null,this.representName=r.representName||null,this.defaultStyle=r.defaultStyle||null,this.multi=r.multi||!1,this.styleAliases=Ti(r.styleAliases||null),vi.indexOf(this.kind)===-1)throw new Tr('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}_r.exports=_i});var Fe=y((zo,Er)=>{"use strict";var J=j(),Ie=v();function Cr(e,r){var n=[];return e[r].forEach(function(t){var i=n.length;n.forEach(function(o,l){o.tag===t.tag&&o.kind===t.kind&&o.multi===t.multi&&(i=l)}),n[i]=t}),n}function Ci(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},r,n;function t(i){i.multi?(e.multi[i.kind].push(i),e.multi.fallback.push(i)):e[i.kind][i.tag]=e.fallback[i.tag]=i}for(r=0,n=arguments.length;r<n;r+=1)arguments[r].forEach(t);return e}function Le(e){return this.extend(e)}Le.prototype.extend=function(r){var n=[],t=[];if(r instanceof Ie)t.push(r);else if(Array.isArray(r))t=t.concat(r);else if(r&&(Array.isArray(r.implicit)||Array.isArray(r.explicit)))r.implicit&&(n=n.concat(r.implicit)),r.explicit&&(t=t.concat(r.explicit));else throw new J("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");n.forEach(function(o){if(!(o instanceof Ie))throw new J("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(o.loadKind&&o.loadKind!=="scalar")throw new J("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(o.multi)throw new J("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),t.forEach(function(o){if(!(o instanceof Ie))throw new J("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var i=Object.create(Le.prototype);return i.implicit=(this.implicit||[]).concat(n),i.explicit=(this.explicit||[]).concat(t),i.compiledImplicit=Cr(i,"implicit"),i.compiledExplicit=Cr(i,"explicit"),i.compiledTypeMap=Ci(i.compiledImplicit,i.compiledExplicit),i};Er.exports=Le});var Oe=y((Yo,Rr)=>{"use strict";var Ei=v();Rr.exports=new Ei("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}})});var qe=y((Ho,Ir)=>{"use strict";var Ri=v();Ir.exports=new Ri("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}})});var $e=y((jo,Lr)=>{"use strict";var Ii=v();Lr.exports=new Ii("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}})});var Ne=y((Uo,Fr)=>{"use strict";var Li=Fe();Fr.exports=new Li({explicit:[Oe(),qe(),$e()]})});var Pe=y((Go,Or)=>{"use strict";var Fi=v();function Oi(e){if(e===null)return!0;var r=e.length;return r===1&&e==="~"||r===4&&(e==="null"||e==="Null"||e==="NULL")}function qi(){return null}function $i(e){return e===null}Or.exports=new Fi("tag:yaml.org,2002:null",{kind:"scalar",resolve:Oi,construct:qi,predicate:$i,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"})});var Me=y((Ko,qr)=>{"use strict";var Ni=v();function Pi(e){if(e===null)return!1;var r=e.length;return r===4&&(e==="true"||e==="True"||e==="TRUE")||r===5&&(e==="false"||e==="False"||e==="FALSE")}function Mi(e){return e==="true"||e==="True"||e==="TRUE"}function Di(e){return Object.prototype.toString.call(e)==="[object Boolean]"}qr.exports=new Ni("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Pi,construct:Mi,predicate:Di,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"})});var De=y((Zo,$r)=>{"use strict";var Bi=H(),zi=v();function Yi(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function Hi(e){return 48<=e&&e<=55}function ji(e){return 48<=e&&e<=57}function Ui(e){if(e===null)return!1;var r=e.length,n=0,t=!1,i;if(!r)return!1;if(i=e[n],(i==="-"||i==="+")&&(i=e[++n]),i==="0"){if(n+1===r)return!0;if(i=e[++n],i==="b"){for(n++;n<r;n++)if(i=e[n],i!=="_"){if(i!=="0"&&i!=="1")return!1;t=!0}return t&&i!=="_"}if(i==="x"){for(n++;n<r;n++)if(i=e[n],i!=="_"){if(!Yi(e.charCodeAt(n)))return!1;t=!0}return t&&i!=="_"}if(i==="o"){for(n++;n<r;n++)if(i=e[n],i!=="_"){if(!Hi(e.charCodeAt(n)))return!1;t=!0}return t&&i!=="_"}}if(i==="_")return!1;for(;n<r;n++)if(i=e[n],i!=="_"){if(!ji(e.charCodeAt(n)))return!1;t=!0}return!(!t||i==="_")}function Gi(e){var r=e,n=1,t;if(r.indexOf("_")!==-1&&(r=r.replace(/_/g,"")),t=r[0],(t==="-"||t==="+")&&(t==="-"&&(n=-1),r=r.slice(1),t=r[0]),r==="0")return 0;if(t==="0"){if(r[1]==="b")return n*parseInt(r.slice(2),2);if(r[1]==="x")return n*parseInt(r.slice(2),16);if(r[1]==="o")return n*parseInt(r.slice(2),8)}return n*parseInt(r,10)}function Ki(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!Bi.isNegativeZero(e)}$r.exports=new zi("tag:yaml.org,2002:int",{kind:"scalar",resolve:Ui,construct:Gi,predicate:Ki,represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}})});var Be=y((Qo,Pr)=>{"use strict";var Nr=H(),Zi=v(),Qi=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Wi(e){return!(e===null||!Qi.test(e)||e[e.length-1]==="_")}function Xi(e){var r,n;return r=e.replace(/_/g,"").toLowerCase(),n=r[0]==="-"?-1:1,"+-".indexOf(r[0])>=0&&(r=r.slice(1)),r===".inf"?n===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:r===".nan"?NaN:n*parseFloat(r,10)}var Vi=/^[-+]?[0-9]+e/;function Ji(e,r){var n;if(isNaN(e))switch(r){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(r){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(r){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(Nr.isNegativeZero(e))return"-0.0";return n=e.toString(10),Vi.test(n)?n.replace("e",".e"):n}function et(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||Nr.isNegativeZero(e))}Pr.exports=new Zi("tag:yaml.org,2002:float",{kind:"scalar",resolve:Wi,construct:Xi,predicate:et,represent:Ji,defaultStyle:"lowercase"})});var ze=y((Wo,Mr)=>{"use strict";Mr.exports=Ne().extend({implicit:[Pe(),Me(),De(),Be()]})});var Ye=y((Xo,Dr)=>{"use strict";Dr.exports=ze()});var He=y((Vo,Yr)=>{"use strict";var rt=v(),Br=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),zr=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function nt(e){return e===null?!1:Br.exec(e)!==null||zr.exec(e)!==null}function it(e){var r,n,t,i,o,l,a,s=0,u=null,c,p,h;if(r=Br.exec(e),r===null&&(r=zr.exec(e)),r===null)throw new Error("Date resolve error");if(n=+r[1],t=+r[2]-1,i=+r[3],!r[4])return new Date(Date.UTC(n,t,i));if(o=+r[4],l=+r[5],a=+r[6],r[7]){for(s=r[7].slice(0,3);s.length<3;)s+="0";s=+s}return r[9]&&(c=+r[10],p=+(r[11]||0),u=(c*60+p)*6e4,r[9]==="-"&&(u=-u)),h=new Date(Date.UTC(n,t,i,o,l,a,s)),u&&h.setTime(h.getTime()-u),h}function tt(e){return e.toISOString()}Yr.exports=new rt("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:nt,construct:it,instanceOf:Date,represent:tt})});var je=y((Jo,Hr)=>{"use strict";var lt=v();function ot(e){return e==="<<"||e===null}Hr.exports=new lt("tag:yaml.org,2002:merge",{kind:"scalar",resolve:ot})});var Ge=y((es,jr)=>{"use strict";var st=v(),Ue=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
8
|
+
\r`;function at(e){if(e===null)return!1;var r,n,t=0,i=e.length,o=Ue;for(n=0;n<i;n++)if(r=o.indexOf(e.charAt(n)),!(r>64)){if(r<0)return!1;t+=6}return t%8===0}function ut(e){var r,n,t=e.replace(/[\r\n=]/g,""),i=t.length,o=Ue,l=0,a=[];for(r=0;r<i;r++)r%4===0&&r&&(a.push(l>>16&255),a.push(l>>8&255),a.push(l&255)),l=l<<6|o.indexOf(t.charAt(r));return n=i%4*6,n===0?(a.push(l>>16&255),a.push(l>>8&255),a.push(l&255)):n===18?(a.push(l>>10&255),a.push(l>>2&255)):n===12&&a.push(l>>4&255),new Uint8Array(a)}function ct(e){var r="",n=0,t,i,o=e.length,l=Ue;for(t=0;t<o;t++)t%3===0&&t&&(r+=l[n>>18&63],r+=l[n>>12&63],r+=l[n>>6&63],r+=l[n&63]),n=(n<<8)+e[t];return i=o%3,i===0?(r+=l[n>>18&63],r+=l[n>>12&63],r+=l[n>>6&63],r+=l[n&63]):i===2?(r+=l[n>>10&63],r+=l[n>>4&63],r+=l[n<<2&63],r+=l[64]):i===1&&(r+=l[n>>2&63],r+=l[n<<4&63],r+=l[64],r+=l[64]),r}function pt(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}jr.exports=new st("tag:yaml.org,2002:binary",{kind:"scalar",resolve:at,construct:ut,predicate:pt,represent:ct})});var Ke=y((rs,Ur)=>{"use strict";var ht=v(),ft=Object.prototype.hasOwnProperty,dt=Object.prototype.toString;function gt(e){if(e===null)return!0;var r=[],n,t,i,o,l,a=e;for(n=0,t=a.length;n<t;n+=1){if(i=a[n],l=!1,dt.call(i)!=="[object Object]")return!1;for(o in i)if(ft.call(i,o))if(!l)l=!0;else return!1;if(!l)return!1;if(r.indexOf(o)===-1)r.push(o);else return!1}return!0}function xt(e){return e!==null?e:[]}Ur.exports=new ht("tag:yaml.org,2002:omap",{kind:"sequence",resolve:gt,construct:xt})});var Ze=y((ns,Gr)=>{"use strict";var mt=v(),kt=Object.prototype.toString;function bt(e){if(e===null)return!0;var r,n,t,i,o,l=e;for(o=new Array(l.length),r=0,n=l.length;r<n;r+=1){if(t=l[r],kt.call(t)!=="[object Object]"||(i=Object.keys(t),i.length!==1))return!1;o[r]=[i[0],t[i[0]]]}return!0}function wt(e){if(e===null)return[];var r,n,t,i,o,l=e;for(o=new Array(l.length),r=0,n=l.length;r<n;r+=1)t=l[r],i=Object.keys(t),o[r]=[i[0],t[i[0]]];return o}Gr.exports=new mt("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:bt,construct:wt})});var Qe=y((is,Kr)=>{"use strict";var yt=v(),At=Object.prototype.hasOwnProperty;function St(e){if(e===null)return!0;var r,n=e;for(r in n)if(At.call(n,r)&&n[r]!==null)return!1;return!0}function vt(e){return e!==null?e:{}}Kr.exports=new yt("tag:yaml.org,2002:set",{kind:"mapping",resolve:St,construct:vt})});var he=y((ts,Zr)=>{"use strict";Zr.exports=Ye().extend({implicit:[He(),je()],explicit:[Ge(),Ke(),Ze(),Qe()]})});var hn=y((ls,Je)=>{"use strict";var D=H(),rn=j(),Tt=vr(),_t=he(),$=Object.prototype.hasOwnProperty,fe=1,nn=2,tn=3,de=4,We=1,Ct=2,Qr=3,Et=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Rt=/[\x85\u2028\u2029]/,It=/[,\[\]\{\}]/,ln=/^(?:!|!!|![a-z\-]+!)$/i,on=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function Wr(e){return Object.prototype.toString.call(e)}function L(e){return e===10||e===13}function B(e){return e===9||e===32}function E(e){return e===9||e===32||e===10||e===13}function U(e){return e===44||e===91||e===93||e===123||e===125}function Lt(e){var r;return 48<=e&&e<=57?e-48:(r=e|32,97<=r&&r<=102?r-97+10:-1)}function Ft(e){return e===120?2:e===117?4:e===85?8:0}function Ot(e){return 48<=e&&e<=57?e-48:-1}function Xr(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
|
|
9
|
+
`:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"\x85":e===95?"\xA0":e===76?"\u2028":e===80?"\u2029":""}function qt(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function sn(e,r,n){r==="__proto__"?Object.defineProperty(e,r,{configurable:!0,enumerable:!0,writable:!0,value:n}):e[r]=n}var an=new Array(256),un=new Array(256);for(M=0;M<256;M++)an[M]=Xr(M)?1:0,un[M]=Xr(M);var M;function $t(e,r){this.input=e,this.filename=r.filename||null,this.schema=r.schema||_t,this.onWarning=r.onWarning||null,this.legacy=r.legacy||!1,this.json=r.json||!1,this.listener=r.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function cn(e,r){var n={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return n.snippet=Tt(n),new rn(r,n)}function g(e,r){throw cn(e,r)}function ge(e,r){e.onWarning&&e.onWarning.call(null,cn(e,r))}var Vr={YAML:function(r,n,t){var i,o,l;r.version!==null&&g(r,"duplication of %YAML directive"),t.length!==1&&g(r,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(t[0]),i===null&&g(r,"ill-formed argument of the YAML directive"),o=parseInt(i[1],10),l=parseInt(i[2],10),o!==1&&g(r,"unacceptable YAML version of the document"),r.version=t[0],r.checkLineBreaks=l<2,l!==1&&l!==2&&ge(r,"unsupported YAML version of the document")},TAG:function(r,n,t){var i,o;t.length!==2&&g(r,"TAG directive accepts exactly two arguments"),i=t[0],o=t[1],ln.test(i)||g(r,"ill-formed tag handle (first argument) of the TAG directive"),$.call(r.tagMap,i)&&g(r,'there is a previously declared suffix for "'+i+'" tag handle'),on.test(o)||g(r,"ill-formed tag prefix (second argument) of the TAG directive");try{o=decodeURIComponent(o)}catch{g(r,"tag prefix is malformed: "+o)}r.tagMap[i]=o}};function q(e,r,n,t){var i,o,l,a;if(r<n){if(a=e.input.slice(r,n),t)for(i=0,o=a.length;i<o;i+=1)l=a.charCodeAt(i),l===9||32<=l&&l<=1114111||g(e,"expected valid JSON character");else Et.test(a)&&g(e,"the stream contains non-printable characters");e.result+=a}}function Jr(e,r,n,t){var i,o,l,a;for(D.isObject(n)||g(e,"cannot merge mappings; the provided source object is unacceptable"),i=Object.keys(n),l=0,a=i.length;l<a;l+=1)o=i[l],$.call(r,o)||(sn(r,o,n[o]),t[o]=!0)}function G(e,r,n,t,i,o,l,a,s){var u,c;if(Array.isArray(i))for(i=Array.prototype.slice.call(i),u=0,c=i.length;u<c;u+=1)Array.isArray(i[u])&&g(e,"nested arrays are not supported inside keys"),typeof i=="object"&&Wr(i[u])==="[object Object]"&&(i[u]="[object Object]");if(typeof i=="object"&&Wr(i)==="[object Object]"&&(i="[object Object]"),i=String(i),r===null&&(r={}),t==="tag:yaml.org,2002:merge")if(Array.isArray(o))for(u=0,c=o.length;u<c;u+=1)Jr(e,r,o[u],n);else Jr(e,r,o,n);else!e.json&&!$.call(n,i)&&$.call(r,i)&&(e.line=l||e.line,e.lineStart=a||e.lineStart,e.position=s||e.position,g(e,"duplicated mapping key")),sn(r,i,o),delete n[i];return r}function Xe(e){var r;r=e.input.charCodeAt(e.position),r===10?e.position++:r===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):g(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function A(e,r,n){for(var t=0,i=e.input.charCodeAt(e.position);i!==0;){for(;B(i);)i===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),i=e.input.charCodeAt(++e.position);if(r&&i===35)do i=e.input.charCodeAt(++e.position);while(i!==10&&i!==13&&i!==0);if(L(i))for(Xe(e),i=e.input.charCodeAt(e.position),t++,e.lineIndent=0;i===32;)e.lineIndent++,i=e.input.charCodeAt(++e.position);else break}return n!==-1&&t!==0&&e.lineIndent<n&&ge(e,"deficient indentation"),t}function xe(e){var r=e.position,n;return n=e.input.charCodeAt(r),!!((n===45||n===46)&&n===e.input.charCodeAt(r+1)&&n===e.input.charCodeAt(r+2)&&(r+=3,n=e.input.charCodeAt(r),n===0||E(n)))}function Ve(e,r){r===1?e.result+=" ":r>1&&(e.result+=D.repeat(`
|
|
10
|
+
`,r-1))}function Nt(e,r,n){var t,i,o,l,a,s,u,c,p=e.kind,h=e.result,f;if(f=e.input.charCodeAt(e.position),E(f)||U(f)||f===35||f===38||f===42||f===33||f===124||f===62||f===39||f===34||f===37||f===64||f===96||(f===63||f===45)&&(i=e.input.charCodeAt(e.position+1),E(i)||n&&U(i)))return!1;for(e.kind="scalar",e.result="",o=l=e.position,a=!1;f!==0;){if(f===58){if(i=e.input.charCodeAt(e.position+1),E(i)||n&&U(i))break}else if(f===35){if(t=e.input.charCodeAt(e.position-1),E(t))break}else{if(e.position===e.lineStart&&xe(e)||n&&U(f))break;if(L(f))if(s=e.line,u=e.lineStart,c=e.lineIndent,A(e,!1,-1),e.lineIndent>=r){a=!0,f=e.input.charCodeAt(e.position);continue}else{e.position=l,e.line=s,e.lineStart=u,e.lineIndent=c;break}}a&&(q(e,o,l,!1),Ve(e,e.line-s),o=l=e.position,a=!1),B(f)||(l=e.position+1),f=e.input.charCodeAt(++e.position)}return q(e,o,l,!1),e.result?!0:(e.kind=p,e.result=h,!1)}function Pt(e,r){var n,t,i;if(n=e.input.charCodeAt(e.position),n!==39)return!1;for(e.kind="scalar",e.result="",e.position++,t=i=e.position;(n=e.input.charCodeAt(e.position))!==0;)if(n===39)if(q(e,t,e.position,!0),n=e.input.charCodeAt(++e.position),n===39)t=e.position,e.position++,i=e.position;else return!0;else L(n)?(q(e,t,i,!0),Ve(e,A(e,!1,r)),t=i=e.position):e.position===e.lineStart&&xe(e)?g(e,"unexpected end of the document within a single quoted scalar"):(e.position++,i=e.position);g(e,"unexpected end of the stream within a single quoted scalar")}function Mt(e,r){var n,t,i,o,l,a;if(a=e.input.charCodeAt(e.position),a!==34)return!1;for(e.kind="scalar",e.result="",e.position++,n=t=e.position;(a=e.input.charCodeAt(e.position))!==0;){if(a===34)return q(e,n,e.position,!0),e.position++,!0;if(a===92){if(q(e,n,e.position,!0),a=e.input.charCodeAt(++e.position),L(a))A(e,!1,r);else if(a<256&&an[a])e.result+=un[a],e.position++;else if((l=Ft(a))>0){for(i=l,o=0;i>0;i--)a=e.input.charCodeAt(++e.position),(l=Lt(a))>=0?o=(o<<4)+l:g(e,"expected hexadecimal character");e.result+=qt(o),e.position++}else g(e,"unknown escape sequence");n=t=e.position}else L(a)?(q(e,n,t,!0),Ve(e,A(e,!1,r)),n=t=e.position):e.position===e.lineStart&&xe(e)?g(e,"unexpected end of the document within a double quoted scalar"):(e.position++,t=e.position)}g(e,"unexpected end of the stream within a double quoted scalar")}function Dt(e,r){var n=!0,t,i,o,l=e.tag,a,s=e.anchor,u,c,p,h,f,d=Object.create(null),x,w,S,m;if(m=e.input.charCodeAt(e.position),m===91)c=93,f=!1,a=[];else if(m===123)c=125,f=!0,a={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=a),m=e.input.charCodeAt(++e.position);m!==0;){if(A(e,!0,r),m=e.input.charCodeAt(e.position),m===c)return e.position++,e.tag=l,e.anchor=s,e.kind=f?"mapping":"sequence",e.result=a,!0;n?m===44&&g(e,"expected the node content, but found ','"):g(e,"missed comma between flow collection entries"),w=x=S=null,p=h=!1,m===63&&(u=e.input.charCodeAt(e.position+1),E(u)&&(p=h=!0,e.position++,A(e,!0,r))),t=e.line,i=e.lineStart,o=e.position,K(e,r,fe,!1,!0),w=e.tag,x=e.result,A(e,!0,r),m=e.input.charCodeAt(e.position),(h||e.line===t)&&m===58&&(p=!0,m=e.input.charCodeAt(++e.position),A(e,!0,r),K(e,r,fe,!1,!0),S=e.result),f?G(e,a,d,w,x,S,t,i,o):p?a.push(G(e,null,d,w,x,S,t,i,o)):a.push(x),A(e,!0,r),m=e.input.charCodeAt(e.position),m===44?(n=!0,m=e.input.charCodeAt(++e.position)):n=!1}g(e,"unexpected end of the stream within a flow collection")}function Bt(e,r){var n,t,i=We,o=!1,l=!1,a=r,s=0,u=!1,c,p;if(p=e.input.charCodeAt(e.position),p===124)t=!1;else if(p===62)t=!0;else return!1;for(e.kind="scalar",e.result="";p!==0;)if(p=e.input.charCodeAt(++e.position),p===43||p===45)We===i?i=p===43?Qr:Ct:g(e,"repeat of a chomping mode identifier");else if((c=Ot(p))>=0)c===0?g(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):l?g(e,"repeat of an indentation width identifier"):(a=r+c-1,l=!0);else break;if(B(p)){do p=e.input.charCodeAt(++e.position);while(B(p));if(p===35)do p=e.input.charCodeAt(++e.position);while(!L(p)&&p!==0)}for(;p!==0;){for(Xe(e),e.lineIndent=0,p=e.input.charCodeAt(e.position);(!l||e.lineIndent<a)&&p===32;)e.lineIndent++,p=e.input.charCodeAt(++e.position);if(!l&&e.lineIndent>a&&(a=e.lineIndent),L(p)){s++;continue}if(e.lineIndent<a){i===Qr?e.result+=D.repeat(`
|
|
11
|
+
`,o?1+s:s):i===We&&o&&(e.result+=`
|
|
12
|
+
`);break}for(t?B(p)?(u=!0,e.result+=D.repeat(`
|
|
13
|
+
`,o?1+s:s)):u?(u=!1,e.result+=D.repeat(`
|
|
14
|
+
`,s+1)):s===0?o&&(e.result+=" "):e.result+=D.repeat(`
|
|
15
|
+
`,s):e.result+=D.repeat(`
|
|
16
|
+
`,o?1+s:s),o=!0,l=!0,s=0,n=e.position;!L(p)&&p!==0;)p=e.input.charCodeAt(++e.position);q(e,n,e.position,!1)}return!0}function en(e,r){var n,t=e.tag,i=e.anchor,o=[],l,a=!1,s;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=o),s=e.input.charCodeAt(e.position);s!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,g(e,"tab characters must not be used in indentation")),!(s!==45||(l=e.input.charCodeAt(e.position+1),!E(l))));){if(a=!0,e.position++,A(e,!0,-1)&&e.lineIndent<=r){o.push(null),s=e.input.charCodeAt(e.position);continue}if(n=e.line,K(e,r,tn,!1,!0),o.push(e.result),A(e,!0,-1),s=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>r)&&s!==0)g(e,"bad indentation of a sequence entry");else if(e.lineIndent<r)break}return a?(e.tag=t,e.anchor=i,e.kind="sequence",e.result=o,!0):!1}function zt(e,r,n){var t,i,o,l,a,s,u=e.tag,c=e.anchor,p={},h=Object.create(null),f=null,d=null,x=null,w=!1,S=!1,m;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=p),m=e.input.charCodeAt(e.position);m!==0;){if(!w&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,g(e,"tab characters must not be used in indentation")),t=e.input.charCodeAt(e.position+1),o=e.line,(m===63||m===58)&&E(t))m===63?(w&&(G(e,p,h,f,d,null,l,a,s),f=d=x=null),S=!0,w=!0,i=!0):w?(w=!1,i=!0):g(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,m=t;else{if(l=e.line,a=e.lineStart,s=e.position,!K(e,n,nn,!1,!0))break;if(e.line===o){for(m=e.input.charCodeAt(e.position);B(m);)m=e.input.charCodeAt(++e.position);if(m===58)m=e.input.charCodeAt(++e.position),E(m)||g(e,"a whitespace character is expected after the key-value separator within a block mapping"),w&&(G(e,p,h,f,d,null,l,a,s),f=d=x=null),S=!0,w=!1,i=!1,f=e.tag,d=e.result;else if(S)g(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=u,e.anchor=c,!0}else if(S)g(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=u,e.anchor=c,!0}if((e.line===o||e.lineIndent>r)&&(w&&(l=e.line,a=e.lineStart,s=e.position),K(e,r,de,!0,i)&&(w?d=e.result:x=e.result),w||(G(e,p,h,f,d,x,l,a,s),f=d=x=null),A(e,!0,-1),m=e.input.charCodeAt(e.position)),(e.line===o||e.lineIndent>r)&&m!==0)g(e,"bad indentation of a mapping entry");else if(e.lineIndent<r)break}return w&&G(e,p,h,f,d,null,l,a,s),S&&(e.tag=u,e.anchor=c,e.kind="mapping",e.result=p),S}function Yt(e){var r,n=!1,t=!1,i,o,l;if(l=e.input.charCodeAt(e.position),l!==33)return!1;if(e.tag!==null&&g(e,"duplication of a tag property"),l=e.input.charCodeAt(++e.position),l===60?(n=!0,l=e.input.charCodeAt(++e.position)):l===33?(t=!0,i="!!",l=e.input.charCodeAt(++e.position)):i="!",r=e.position,n){do l=e.input.charCodeAt(++e.position);while(l!==0&&l!==62);e.position<e.length?(o=e.input.slice(r,e.position),l=e.input.charCodeAt(++e.position)):g(e,"unexpected end of the stream within a verbatim tag")}else{for(;l!==0&&!E(l);)l===33&&(t?g(e,"tag suffix cannot contain exclamation marks"):(i=e.input.slice(r-1,e.position+1),ln.test(i)||g(e,"named tag handle cannot contain such characters"),t=!0,r=e.position+1)),l=e.input.charCodeAt(++e.position);o=e.input.slice(r,e.position),It.test(o)&&g(e,"tag suffix cannot contain flow indicator characters")}o&&!on.test(o)&&g(e,"tag name cannot contain such characters: "+o);try{o=decodeURIComponent(o)}catch{g(e,"tag name is malformed: "+o)}return n?e.tag=o:$.call(e.tagMap,i)?e.tag=e.tagMap[i]+o:i==="!"?e.tag="!"+o:i==="!!"?e.tag="tag:yaml.org,2002:"+o:g(e,'undeclared tag handle "'+i+'"'),!0}function Ht(e){var r,n;if(n=e.input.charCodeAt(e.position),n!==38)return!1;for(e.anchor!==null&&g(e,"duplication of an anchor property"),n=e.input.charCodeAt(++e.position),r=e.position;n!==0&&!E(n)&&!U(n);)n=e.input.charCodeAt(++e.position);return e.position===r&&g(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(r,e.position),!0}function jt(e){var r,n,t;if(t=e.input.charCodeAt(e.position),t!==42)return!1;for(t=e.input.charCodeAt(++e.position),r=e.position;t!==0&&!E(t)&&!U(t);)t=e.input.charCodeAt(++e.position);return e.position===r&&g(e,"name of an alias node must contain at least one character"),n=e.input.slice(r,e.position),$.call(e.anchorMap,n)||g(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],A(e,!0,-1),!0}function K(e,r,n,t,i){var o,l,a,s=1,u=!1,c=!1,p,h,f,d,x,w;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,o=l=a=de===n||tn===n,t&&A(e,!0,-1)&&(u=!0,e.lineIndent>r?s=1:e.lineIndent===r?s=0:e.lineIndent<r&&(s=-1)),s===1)for(;Yt(e)||Ht(e);)A(e,!0,-1)?(u=!0,a=o,e.lineIndent>r?s=1:e.lineIndent===r?s=0:e.lineIndent<r&&(s=-1)):a=!1;if(a&&(a=u||i),(s===1||de===n)&&(fe===n||nn===n?x=r:x=r+1,w=e.position-e.lineStart,s===1?a&&(en(e,w)||zt(e,w,x))||Dt(e,x)?c=!0:(l&&Bt(e,x)||Pt(e,x)||Mt(e,x)?c=!0:jt(e)?(c=!0,(e.tag!==null||e.anchor!==null)&&g(e,"alias node should not have any properties")):Nt(e,x,fe===n)&&(c=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):s===0&&(c=a&&en(e,w))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&g(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),p=0,h=e.implicitTypes.length;p<h;p+=1)if(d=e.implicitTypes[p],d.resolve(e.result)){e.result=d.construct(e.result),e.tag=d.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if($.call(e.typeMap[e.kind||"fallback"],e.tag))d=e.typeMap[e.kind||"fallback"][e.tag];else for(d=null,f=e.typeMap.multi[e.kind||"fallback"],p=0,h=f.length;p<h;p+=1)if(e.tag.slice(0,f[p].tag.length)===f[p].tag){d=f[p];break}d||g(e,"unknown tag !<"+e.tag+">"),e.result!==null&&d.kind!==e.kind&&g(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+d.kind+'", not "'+e.kind+'"'),d.resolve(e.result,e.tag)?(e.result=d.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):g(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||c}function Ut(e){var r=e.position,n,t,i,o=!1,l;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(l=e.input.charCodeAt(e.position))!==0&&(A(e,!0,-1),l=e.input.charCodeAt(e.position),!(e.lineIndent>0||l!==37));){for(o=!0,l=e.input.charCodeAt(++e.position),n=e.position;l!==0&&!E(l);)l=e.input.charCodeAt(++e.position);for(t=e.input.slice(n,e.position),i=[],t.length<1&&g(e,"directive name must not be less than one character in length");l!==0;){for(;B(l);)l=e.input.charCodeAt(++e.position);if(l===35){do l=e.input.charCodeAt(++e.position);while(l!==0&&!L(l));break}if(L(l))break;for(n=e.position;l!==0&&!E(l);)l=e.input.charCodeAt(++e.position);i.push(e.input.slice(n,e.position))}l!==0&&Xe(e),$.call(Vr,t)?Vr[t](e,t,i):ge(e,'unknown document directive "'+t+'"')}if(A(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,A(e,!0,-1)):o&&g(e,"directives end mark is expected"),K(e,e.lineIndent-1,de,!1,!0),A(e,!0,-1),e.checkLineBreaks&&Rt.test(e.input.slice(r,e.position))&&ge(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&xe(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,A(e,!0,-1));return}if(e.position<e.length-1)g(e,"end of the stream or a document separator is expected");else return}function pn(e,r){e=String(e),r=r||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
|
|
17
|
+
`),e.charCodeAt(0)===65279&&(e=e.slice(1)));var n=new $t(e,r),t=e.indexOf("\0");for(t!==-1&&(n.position=t,g(n,"null byte is not allowed in input")),n.input+="\0";n.input.charCodeAt(n.position)===32;)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)Ut(n);return n.documents}function Gt(e,r,n){r!==null&&typeof r=="object"&&typeof n>"u"&&(n=r,r=null);var t=pn(e,n);if(typeof r!="function")return t;for(var i=0,o=t.length;i<o;i+=1)r(t[i])}function Kt(e,r){var n=pn(e,r);if(n.length!==0){if(n.length===1)return n[0];throw new rn("expected a single document in the stream, but found more")}}Je.exports.loadAll=Gt;Je.exports.load=Kt});var On=y((os,Fn)=>{"use strict";var be=H(),te=j(),Zt=he(),yn=Object.prototype.toString,An=Object.prototype.hasOwnProperty,tr=65279,Qt=9,re=10,Wt=13,Xt=32,Vt=33,Jt=34,er=35,el=37,rl=38,nl=39,il=42,Sn=44,tl=45,me=58,ll=61,ol=62,sl=63,al=64,vn=91,Tn=93,ul=96,_n=123,cl=124,Cn=125,T={};T[0]="\\0";T[7]="\\a";T[8]="\\b";T[9]="\\t";T[10]="\\n";T[11]="\\v";T[12]="\\f";T[13]="\\r";T[27]="\\e";T[34]='\\"';T[92]="\\\\";T[133]="\\N";T[160]="\\_";T[8232]="\\L";T[8233]="\\P";var pl=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],hl=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function fl(e,r){var n,t,i,o,l,a,s;if(r===null)return{};for(n={},t=Object.keys(r),i=0,o=t.length;i<o;i+=1)l=t[i],a=String(r[l]),l.slice(0,2)==="!!"&&(l="tag:yaml.org,2002:"+l.slice(2)),s=e.compiledTypeMap.fallback[l],s&&An.call(s.styleAliases,a)&&(a=s.styleAliases[a]),n[l]=a;return n}function dl(e){var r,n,t;if(r=e.toString(16).toUpperCase(),e<=255)n="x",t=2;else if(e<=65535)n="u",t=4;else if(e<=4294967295)n="U",t=8;else throw new te("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+n+be.repeat("0",t-r.length)+r}var gl=1,ne=2;function xl(e){this.schema=e.schema||Zt,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=be.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=fl(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType==='"'?ne:gl,this.forceQuotes=e.forceQuotes||!1,this.replacer=typeof e.replacer=="function"?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function fn(e,r){for(var n=be.repeat(" ",r),t=0,i=-1,o="",l,a=e.length;t<a;)i=e.indexOf(`
|
|
18
|
+
`,t),i===-1?(l=e.slice(t),t=a):(l=e.slice(t,i+1),t=i+1),l.length&&l!==`
|
|
19
|
+
`&&(o+=n),o+=l;return o}function rr(e,r){return`
|
|
20
|
+
`+be.repeat(" ",e.indent*r)}function ml(e,r){var n,t,i;for(n=0,t=e.implicitTypes.length;n<t;n+=1)if(i=e.implicitTypes[n],i.resolve(r))return!0;return!1}function ke(e){return e===Xt||e===Qt}function ie(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==tr||65536<=e&&e<=1114111}function dn(e){return ie(e)&&e!==tr&&e!==Wt&&e!==re}function gn(e,r,n){var t=dn(e),i=t&&!ke(e);return(n?t:t&&e!==Sn&&e!==vn&&e!==Tn&&e!==_n&&e!==Cn)&&e!==er&&!(r===me&&!i)||dn(r)&&!ke(r)&&e===er||r===me&&i}function kl(e){return ie(e)&&e!==tr&&!ke(e)&&e!==tl&&e!==sl&&e!==me&&e!==Sn&&e!==vn&&e!==Tn&&e!==_n&&e!==Cn&&e!==er&&e!==rl&&e!==il&&e!==Vt&&e!==cl&&e!==ll&&e!==ol&&e!==nl&&e!==Jt&&e!==el&&e!==al&&e!==ul}function bl(e){return!ke(e)&&e!==me}function ee(e,r){var n=e.charCodeAt(r),t;return n>=55296&&n<=56319&&r+1<e.length&&(t=e.charCodeAt(r+1),t>=56320&&t<=57343)?(n-55296)*1024+t-56320+65536:n}function En(e){var r=/^\n* /;return r.test(e)}var Rn=1,nr=2,In=3,Ln=4,Z=5;function wl(e,r,n,t,i,o,l,a){var s,u=0,c=null,p=!1,h=!1,f=t!==-1,d=-1,x=kl(ee(e,0))&&bl(ee(e,e.length-1));if(r||l)for(s=0;s<e.length;u>=65536?s+=2:s++){if(u=ee(e,s),!ie(u))return Z;x=x&&gn(u,c,a),c=u}else{for(s=0;s<e.length;u>=65536?s+=2:s++){if(u=ee(e,s),u===re)p=!0,f&&(h=h||s-d-1>t&&e[d+1]!==" ",d=s);else if(!ie(u))return Z;x=x&&gn(u,c,a),c=u}h=h||f&&s-d-1>t&&e[d+1]!==" "}return!p&&!h?x&&!l&&!i(e)?Rn:o===ne?Z:nr:n>9&&En(e)?Z:l?o===ne?Z:nr:h?Ln:In}function yl(e,r,n,t,i){e.dump=(function(){if(r.length===0)return e.quotingType===ne?'""':"''";if(!e.noCompatMode&&(pl.indexOf(r)!==-1||hl.test(r)))return e.quotingType===ne?'"'+r+'"':"'"+r+"'";var o=e.indent*Math.max(1,n),l=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-o),a=t||e.flowLevel>-1&&n>=e.flowLevel;function s(u){return ml(e,u)}switch(wl(r,a,e.indent,l,s,e.quotingType,e.forceQuotes&&!t,i)){case Rn:return r;case nr:return"'"+r.replace(/'/g,"''")+"'";case In:return"|"+xn(r,e.indent)+mn(fn(r,o));case Ln:return">"+xn(r,e.indent)+mn(fn(Al(r,l),o));case Z:return'"'+Sl(r,l)+'"';default:throw new te("impossible error: invalid scalar style")}})()}function xn(e,r){var n=En(e)?String(r):"",t=e[e.length-1]===`
|
|
21
|
+
`,i=t&&(e[e.length-2]===`
|
|
22
|
+
`||e===`
|
|
23
|
+
`),o=i?"+":t?"":"-";return n+o+`
|
|
24
|
+
`}function mn(e){return e[e.length-1]===`
|
|
25
|
+
`?e.slice(0,-1):e}function Al(e,r){for(var n=/(\n+)([^\n]*)/g,t=(function(){var u=e.indexOf(`
|
|
26
|
+
`);return u=u!==-1?u:e.length,n.lastIndex=u,kn(e.slice(0,u),r)})(),i=e[0]===`
|
|
27
|
+
`||e[0]===" ",o,l;l=n.exec(e);){var a=l[1],s=l[2];o=s[0]===" ",t+=a+(!i&&!o&&s!==""?`
|
|
28
|
+
`:"")+kn(s,r),i=o}return t}function kn(e,r){if(e===""||e[0]===" ")return e;for(var n=/ [^ ]/g,t,i=0,o,l=0,a=0,s="";t=n.exec(e);)a=t.index,a-i>r&&(o=l>i?l:a,s+=`
|
|
29
|
+
`+e.slice(i,o),i=o+1),l=a;return s+=`
|
|
30
|
+
`,e.length-i>r&&l>i?s+=e.slice(i,l)+`
|
|
31
|
+
`+e.slice(l+1):s+=e.slice(i),s.slice(1)}function Sl(e){for(var r="",n=0,t,i=0;i<e.length;n>=65536?i+=2:i++)n=ee(e,i),t=T[n],!t&&ie(n)?(r+=e[i],n>=65536&&(r+=e[i+1])):r+=t||dl(n);return r}function vl(e,r,n){var t="",i=e.tag,o,l,a;for(o=0,l=n.length;o<l;o+=1)a=n[o],e.replacer&&(a=e.replacer.call(n,String(o),a)),(O(e,r,a,!1,!1)||typeof a>"u"&&O(e,r,null,!1,!1))&&(t!==""&&(t+=","+(e.condenseFlow?"":" ")),t+=e.dump);e.tag=i,e.dump="["+t+"]"}function bn(e,r,n,t){var i="",o=e.tag,l,a,s;for(l=0,a=n.length;l<a;l+=1)s=n[l],e.replacer&&(s=e.replacer.call(n,String(l),s)),(O(e,r+1,s,!0,!0,!1,!0)||typeof s>"u"&&O(e,r+1,null,!0,!0,!1,!0))&&((!t||i!=="")&&(i+=rr(e,r)),e.dump&&re===e.dump.charCodeAt(0)?i+="-":i+="- ",i+=e.dump);e.tag=o,e.dump=i||"[]"}function Tl(e,r,n){var t="",i=e.tag,o=Object.keys(n),l,a,s,u,c;for(l=0,a=o.length;l<a;l+=1)c="",t!==""&&(c+=", "),e.condenseFlow&&(c+='"'),s=o[l],u=n[s],e.replacer&&(u=e.replacer.call(n,s,u)),O(e,r,s,!1,!1)&&(e.dump.length>1024&&(c+="? "),c+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),O(e,r,u,!1,!1)&&(c+=e.dump,t+=c));e.tag=i,e.dump="{"+t+"}"}function _l(e,r,n,t){var i="",o=e.tag,l=Object.keys(n),a,s,u,c,p,h;if(e.sortKeys===!0)l.sort();else if(typeof e.sortKeys=="function")l.sort(e.sortKeys);else if(e.sortKeys)throw new te("sortKeys must be a boolean or a function");for(a=0,s=l.length;a<s;a+=1)h="",(!t||i!=="")&&(h+=rr(e,r)),u=l[a],c=n[u],e.replacer&&(c=e.replacer.call(n,u,c)),O(e,r+1,u,!0,!0,!0)&&(p=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,p&&(e.dump&&re===e.dump.charCodeAt(0)?h+="?":h+="? "),h+=e.dump,p&&(h+=rr(e,r)),O(e,r+1,c,!0,p)&&(e.dump&&re===e.dump.charCodeAt(0)?h+=":":h+=": ",h+=e.dump,i+=h));e.tag=o,e.dump=i||"{}"}function wn(e,r,n){var t,i,o,l,a,s;for(i=n?e.explicitTypes:e.implicitTypes,o=0,l=i.length;o<l;o+=1)if(a=i[o],(a.instanceOf||a.predicate)&&(!a.instanceOf||typeof r=="object"&&r instanceof a.instanceOf)&&(!a.predicate||a.predicate(r))){if(n?a.multi&&a.representName?e.tag=a.representName(r):e.tag=a.tag:e.tag="?",a.represent){if(s=e.styleMap[a.tag]||a.defaultStyle,yn.call(a.represent)==="[object Function]")t=a.represent(r,s);else if(An.call(a.represent,s))t=a.represent[s](r,s);else throw new te("!<"+a.tag+'> tag resolver accepts not "'+s+'" style');e.dump=t}return!0}return!1}function O(e,r,n,t,i,o,l){e.tag=null,e.dump=n,wn(e,n,!1)||wn(e,n,!0);var a=yn.call(e.dump),s=t,u;t&&(t=e.flowLevel<0||e.flowLevel>r);var c=a==="[object Object]"||a==="[object Array]",p,h;if(c&&(p=e.duplicates.indexOf(n),h=p!==-1),(e.tag!==null&&e.tag!=="?"||h||e.indent!==2&&r>0)&&(i=!1),h&&e.usedDuplicates[p])e.dump="*ref_"+p;else{if(c&&h&&!e.usedDuplicates[p]&&(e.usedDuplicates[p]=!0),a==="[object Object]")t&&Object.keys(e.dump).length!==0?(_l(e,r,e.dump,i),h&&(e.dump="&ref_"+p+e.dump)):(Tl(e,r,e.dump),h&&(e.dump="&ref_"+p+" "+e.dump));else if(a==="[object Array]")t&&e.dump.length!==0?(e.noArrayIndent&&!l&&r>0?bn(e,r-1,e.dump,i):bn(e,r,e.dump,i),h&&(e.dump="&ref_"+p+e.dump)):(vl(e,r,e.dump),h&&(e.dump="&ref_"+p+" "+e.dump));else if(a==="[object String]")e.tag!=="?"&&yl(e,e.dump,r,o,s);else{if(a==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new te("unacceptable kind of an object to dump "+a)}e.tag!==null&&e.tag!=="?"&&(u=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?u="!"+u:u.slice(0,18)==="tag:yaml.org,2002:"?u="!!"+u.slice(18):u="!<"+u+">",e.dump=u+" "+e.dump)}return!0}function Cl(e,r){var n=[],t=[],i,o;for(ir(e,n,t),i=0,o=t.length;i<o;i+=1)r.duplicates.push(n[t[i]]);r.usedDuplicates=new Array(o)}function ir(e,r,n){var t,i,o;if(e!==null&&typeof e=="object")if(i=r.indexOf(e),i!==-1)n.indexOf(i)===-1&&n.push(i);else if(r.push(e),Array.isArray(e))for(i=0,o=e.length;i<o;i+=1)ir(e[i],r,n);else for(t=Object.keys(e),i=0,o=t.length;i<o;i+=1)ir(e[t[i]],r,n)}function El(e,r){r=r||{};var n=new xl(r);n.noRefs||Cl(e,n);var t=e;return n.replacer&&(t=n.replacer.call({"":t},"",t)),O(n,0,t,!0,!0)?n.dump+`
|
|
32
|
+
`:""}Fn.exports.dump=El});var $n=y((ss,_)=>{"use strict";var qn=hn(),Rl=On();function lr(e,r){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+r+" instead, which is now safe by default.")}}_.exports.Type=v();_.exports.Schema=Fe();_.exports.FAILSAFE_SCHEMA=Ne();_.exports.JSON_SCHEMA=ze();_.exports.CORE_SCHEMA=Ye();_.exports.DEFAULT_SCHEMA=he();_.exports.load=qn.load;_.exports.loadAll=qn.loadAll;_.exports.dump=Rl.dump;_.exports.YAMLException=j();_.exports.types={binary:Ge(),float:Be(),map:$e(),null:Pe(),pairs:Ze(),set:Qe(),timestamp:He(),bool:Me(),int:De(),merge:je(),omap:Ke(),seq:qe(),str:Oe()};_.exports.safeLoad=lr("safeLoad","load");_.exports.safeLoadAll=lr("safeLoadAll","loadAll");_.exports.safeDump=lr("safeDump","dump")});var ri={};di(ri,{Hooks:()=>Q,Lexer:()=>R,Marked:()=>ei,Parser:()=>I,Renderer:()=>ae,TextRenderer:()=>Te,Tokenizer:()=>se,defaults:()=>N,getDefaults:()=>Ae,lexer:()=>_o,marked:()=>b,options:()=>bo,parse:()=>vo,parseInline:()=>So,parser:()=>To,setOptions:()=>wo,use:()=>yo,walkTokens:()=>Ao});function Ae(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}function Yn(e){N=e}function k(e,r=""){let n=typeof e=="string"?e:e.source,t={replace:(i,o)=>{let l=typeof o=="string"?o:o.source;return l=l.replace(C.caret,"$1"),n=n.replace(i,l),t},getRegex:()=>new RegExp(n,r)};return t}function F(e,r){if(r){if(C.escapeTest.test(e))return e.replace(C.escapeReplace,Mn)}else if(C.escapeTestNoEncode.test(e))return e.replace(C.escapeReplaceNoEncode,Mn);return e}function Dn(e){try{e=encodeURI(e).replace(C.percentDecode,"%")}catch{return null}return e}function Bn(e,r){let n=e.replace(C.findPipe,(o,l,a)=>{let s=!1,u=l;for(;--u>=0&&a[u]==="\\";)s=!s;return s?"|":" |"}),t=n.split(C.splitPipe),i=0;if(t[0].trim()||t.shift(),t.length>0&&!t.at(-1)?.trim()&&t.pop(),r)if(t.length>r)t.splice(r);else for(;t.length<r;)t.push("");for(;i<t.length;i++)t[i]=t[i].trim().replace(C.slashPipe,"|");return t}function oe(e,r,n){let t=e.length;if(t===0)return"";let i=0;for(;i<t;){let o=e.charAt(t-i-1);if(o===r&&!n)i++;else if(o!==r&&n)i++;else break}return e.slice(0,t-i)}function xo(e,r){if(e.indexOf(r[1])===-1)return-1;let n=0;for(let t=0;t<e.length;t++)if(e[t]==="\\")t++;else if(e[t]===r[0])n++;else if(e[t]===r[1]&&(n--,n<0))return t;return n>0?-2:-1}function mo(e,r=0){let n=r,t="";for(let i of e)if(i===" "){let o=4-n%4;t+=" ".repeat(o),n+=o}else t+=i,n++;return t}function zn(e,r,n,t,i){let o=r.href,l=r.title||null,a=e[1].replace(i.other.outputLinkReplace,"$1");t.state.inLink=!0;let s={type:e[0].charAt(0)==="!"?"image":"link",raw:n,href:o,title:l,text:a,tokens:t.inlineTokens(a)};return t.state.inLink=!1,s}function ko(e,r,n){let t=e.match(n.other.indentCodeCompensation);if(t===null)return r;let i=t[1];return r.split(`
|
|
33
|
+
`).map(o=>{let l=o.match(n.other.beginningSpace);if(l===null)return o;let[a]=l;return a.length>=i.length?o.slice(i.length):o}).join(`
|
|
34
|
+
`)}function b(e,r){return Y.parse(e,r)}var N,z,Il,C,Ll,Fl,Ol,ue,ql,ur,Hn,jn,$l,cr,Nl,pr,Pl,Ml,Se,hr,Dl,Un,Bl,fr,Nn,zl,Yl,Hl,jl,Gn,Ul,ve,dr,Kn,Gl,Zn,Kl,Zl,Qn,Ql,Wl,Xl,Wn,Vl,Jl,Xn,eo,ro,no,io,to,lo,oo,so,ao,uo,ye,co,Vn,Jn,po,Pn,gr,ho,or,fo,we,le,go,Mn,se,R,ae,Te,I,Q,ei,Y,bo,wo,yo,Ao,So,vo,To,_o,ni=fi(()=>{N=Ae();z={exec:()=>null};Il=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),C={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}>`)},Ll=/^(?:[ \t]*(?:\n|$))+/,Fl=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Ol=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,ue=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,ql=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,ur=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Hn=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,jn=k(Hn).replace(/bull/g,ur).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),$l=k(Hn).replace(/bull/g,ur).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),cr=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Nl=/^[^\n]+/,pr=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Pl=k(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",pr).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Ml=k(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,ur).getRegex(),Se="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|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",hr=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Dl=k("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",hr).replace("tag",Se).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Un=k(cr).replace("hr",ue).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Se).getRegex(),Bl=k(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Un).getRegex(),fr={blockquote:Bl,code:Fl,def:Pl,fences:Ol,heading:ql,hr:ue,html:Dl,lheading:jn,list:Ml,newline:Ll,paragraph:Un,table:z,text:Nl},Nn=k("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",ue).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Se).getRegex(),zl={...fr,lheading:$l,table:Nn,paragraph:k(cr).replace("hr",ue).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Nn).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Se).getRegex()},Yl={...fr,html:k(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",hr).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:z,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:k(cr).replace("hr",ue).replace("heading",` *#{1,6} *[^
|
|
35
|
+
]`).replace("lheading",jn).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Hl=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,jl=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Gn=/^( {2,}|\\)\n(?!\s*$)/,Ul=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,ve=/[\p{P}\p{S}]/u,dr=/[\s\p{P}\p{S}]/u,Kn=/[^\s\p{P}\p{S}]/u,Gl=k(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,dr).getRegex(),Zn=/(?!~)[\p{P}\p{S}]/u,Kl=/(?!~)[\s\p{P}\p{S}]/u,Zl=/(?:[^\s\p{P}\p{S}]|~)/u,Qn=/(?![*_])[\p{P}\p{S}]/u,Ql=/(?![*_])[\s\p{P}\p{S}]/u,Wl=/(?:[^\s\p{P}\p{S}]|[*_])/u,Xl=k(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Il?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Wn=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Vl=k(Wn,"u").replace(/punct/g,ve).getRegex(),Jl=k(Wn,"u").replace(/punct/g,Zn).getRegex(),Xn="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",eo=k(Xn,"gu").replace(/notPunctSpace/g,Kn).replace(/punctSpace/g,dr).replace(/punct/g,ve).getRegex(),ro=k(Xn,"gu").replace(/notPunctSpace/g,Zl).replace(/punctSpace/g,Kl).replace(/punct/g,Zn).getRegex(),no=k("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Kn).replace(/punctSpace/g,dr).replace(/punct/g,ve).getRegex(),io=k(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Qn).getRegex(),to="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",lo=k(to,"gu").replace(/notPunctSpace/g,Wl).replace(/punctSpace/g,Ql).replace(/punct/g,Qn).getRegex(),oo=k(/\\(punct)/,"gu").replace(/punct/g,ve).getRegex(),so=k(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),ao=k(hr).replace("(?:-->|$)","-->").getRegex(),uo=k("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",ao).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ye=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,co=k(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",ye).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Vn=k(/^!?\[(label)\]\[(ref)\]/).replace("label",ye).replace("ref",pr).getRegex(),Jn=k(/^!?\[(ref)\](?:\[\])?/).replace("ref",pr).getRegex(),po=k("reflink|nolink(?!\\()","g").replace("reflink",Vn).replace("nolink",Jn).getRegex(),Pn=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,gr={_backpedal:z,anyPunctuation:oo,autolink:so,blockSkip:Xl,br:Gn,code:jl,del:z,delLDelim:z,delRDelim:z,emStrongLDelim:Vl,emStrongRDelimAst:eo,emStrongRDelimUnd:no,escape:Hl,link:co,nolink:Jn,punctuation:Gl,reflink:Vn,reflinkSearch:po,tag:uo,text:Ul,url:z},ho={...gr,link:k(/^!?\[(label)\]\((.*?)\)/).replace("label",ye).getRegex(),reflink:k(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ye).getRegex()},or={...gr,emStrongRDelimAst:ro,emStrongLDelim:Jl,delLDelim:io,delRDelim:lo,url:k(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Pn).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:k(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Pn).getRegex()},fo={...or,br:k(Gn).replace("{2,}","*").getRegex(),text:k(or.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},we={normal:fr,gfm:zl,pedantic:Yl},le={normal:gr,gfm:or,breaks:fo,pedantic:ho},go={"&":"&","<":"<",">":">",'"':""","'":"'"},Mn=e=>go[e];se=class{options;rules;lexer;constructor(e){this.options=e||N}space(e){let r=this.rules.block.newline.exec(e);if(r&&r[0].length>0)return{type:"space",raw:r[0]}}code(e){let r=this.rules.block.code.exec(e);if(r){let n=r[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:r[0],codeBlockStyle:"indented",text:this.options.pedantic?n:oe(n,`
|
|
36
|
+
`)}}}fences(e){let r=this.rules.block.fences.exec(e);if(r){let n=r[0],t=ko(n,r[3]||"",this.rules);return{type:"code",raw:n,lang:r[2]?r[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):r[2],text:t}}}heading(e){let r=this.rules.block.heading.exec(e);if(r){let n=r[2].trim();if(this.rules.other.endingHash.test(n)){let t=oe(n,"#");(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(n=t.trim())}return{type:"heading",raw:r[0],depth:r[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){let r=this.rules.block.hr.exec(e);if(r)return{type:"hr",raw:oe(r[0],`
|
|
37
|
+
`)}}blockquote(e){let r=this.rules.block.blockquote.exec(e);if(r){let n=oe(r[0],`
|
|
38
|
+
`).split(`
|
|
39
|
+
`),t="",i="",o=[];for(;n.length>0;){let l=!1,a=[],s;for(s=0;s<n.length;s++)if(this.rules.other.blockquoteStart.test(n[s]))a.push(n[s]),l=!0;else if(!l)a.push(n[s]);else break;n=n.slice(s);let u=a.join(`
|
|
40
|
+
`),c=u.replace(this.rules.other.blockquoteSetextReplace,`
|
|
41
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");t=t?`${t}
|
|
42
|
+
${u}`:u,i=i?`${i}
|
|
43
|
+
${c}`:c;let p=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,o,!0),this.lexer.state.top=p,n.length===0)break;let h=o.at(-1);if(h?.type==="code")break;if(h?.type==="blockquote"){let f=h,d=f.raw+`
|
|
44
|
+
`+n.join(`
|
|
45
|
+
`),x=this.blockquote(d);o[o.length-1]=x,t=t.substring(0,t.length-f.raw.length)+x.raw,i=i.substring(0,i.length-f.text.length)+x.text;break}else if(h?.type==="list"){let f=h,d=f.raw+`
|
|
46
|
+
`+n.join(`
|
|
47
|
+
`),x=this.list(d);o[o.length-1]=x,t=t.substring(0,t.length-h.raw.length)+x.raw,i=i.substring(0,i.length-f.raw.length)+x.raw,n=d.substring(o.at(-1).raw.length).split(`
|
|
48
|
+
`);continue}}return{type:"blockquote",raw:t,tokens:o,text:i}}}list(e){let r=this.rules.block.list.exec(e);if(r){let n=r[1].trim(),t=n.length>1,i={type:"list",raw:"",ordered:t,start:t?+n.slice(0,-1):"",loose:!1,items:[]};n=t?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=t?n:"[*+-]");let o=this.rules.other.listItemRegex(n),l=!1;for(;e;){let s=!1,u="",c="";if(!(r=o.exec(e))||this.rules.block.hr.test(e))break;u=r[0],e=e.substring(u.length);let p=mo(r[2].split(`
|
|
49
|
+
`,1)[0],r[1].length),h=e.split(`
|
|
50
|
+
`,1)[0],f=!p.trim(),d=0;if(this.options.pedantic?(d=2,c=p.trimStart()):f?d=r[1].length+1:(d=p.search(this.rules.other.nonSpaceChar),d=d>4?1:d,c=p.slice(d),d+=r[1].length),f&&this.rules.other.blankLine.test(h)&&(u+=h+`
|
|
51
|
+
`,e=e.substring(h.length+1),s=!0),!s){let x=this.rules.other.nextBulletRegex(d),w=this.rules.other.hrRegex(d),S=this.rules.other.fencesBeginRegex(d),m=this.rules.other.headingBeginRegex(d),ai=this.rules.other.htmlBeginRegex(d),ui=this.rules.other.blockquoteBeginRegex(d);for(;e;){let _e=e.split(`
|
|
52
|
+
`,1)[0],W;if(h=_e,this.options.pedantic?(h=h.replace(this.rules.other.listReplaceNesting," "),W=h):W=h.replace(this.rules.other.tabCharGlobal," "),S.test(h)||m.test(h)||ai.test(h)||ui.test(h)||x.test(h)||w.test(h))break;if(W.search(this.rules.other.nonSpaceChar)>=d||!h.trim())c+=`
|
|
53
|
+
`+W.slice(d);else{if(f||p.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||S.test(p)||m.test(p)||w.test(p))break;c+=`
|
|
54
|
+
`+h}f=!h.trim(),u+=_e+`
|
|
55
|
+
`,e=e.substring(_e.length+1),p=W.slice(d)}}i.loose||(l?i.loose=!0:this.rules.other.doubleBlankLine.test(u)&&(l=!0)),i.items.push({type:"list_item",raw:u,task:!!this.options.gfm&&this.rules.other.listIsTask.test(c),loose:!1,text:c,tokens:[]}),i.raw+=u}let a=i.items.at(-1);if(a)a.raw=a.raw.trimEnd(),a.text=a.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let s of i.items){if(this.lexer.state.top=!1,s.tokens=this.lexer.blockTokens(s.text,[]),s.task){if(s.text=s.text.replace(this.rules.other.listReplaceTask,""),s.tokens[0]?.type==="text"||s.tokens[0]?.type==="paragraph"){s.tokens[0].raw=s.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),s.tokens[0].text=s.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let c=this.lexer.inlineQueue.length-1;c>=0;c--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[c].src)){this.lexer.inlineQueue[c].src=this.lexer.inlineQueue[c].src.replace(this.rules.other.listReplaceTask,"");break}}let u=this.rules.other.listTaskCheckbox.exec(s.raw);if(u){let c={type:"checkbox",raw:u[0]+" ",checked:u[0]!=="[ ]"};s.checked=c.checked,i.loose?s.tokens[0]&&["paragraph","text"].includes(s.tokens[0].type)&&"tokens"in s.tokens[0]&&s.tokens[0].tokens?(s.tokens[0].raw=c.raw+s.tokens[0].raw,s.tokens[0].text=c.raw+s.tokens[0].text,s.tokens[0].tokens.unshift(c)):s.tokens.unshift({type:"paragraph",raw:c.raw,text:c.raw,tokens:[c]}):s.tokens.unshift(c)}}if(!i.loose){let u=s.tokens.filter(p=>p.type==="space"),c=u.length>0&&u.some(p=>this.rules.other.anyLine.test(p.raw));i.loose=c}}if(i.loose)for(let s of i.items){s.loose=!0;for(let u of s.tokens)u.type==="text"&&(u.type="paragraph")}return i}}html(e){let r=this.rules.block.html.exec(e);if(r)return{type:"html",block:!0,raw:r[0],pre:r[1]==="pre"||r[1]==="script"||r[1]==="style",text:r[0]}}def(e){let r=this.rules.block.def.exec(e);if(r){let n=r[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),t=r[2]?r[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=r[3]?r[3].substring(1,r[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):r[3];return{type:"def",tag:n,raw:r[0],href:t,title:i}}}table(e){let r=this.rules.block.table.exec(e);if(!r||!this.rules.other.tableDelimiter.test(r[2]))return;let n=Bn(r[1]),t=r[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=r[3]?.trim()?r[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
56
|
+
`):[],o={type:"table",raw:r[0],header:[],align:[],rows:[]};if(n.length===t.length){for(let l of t)this.rules.other.tableAlignRight.test(l)?o.align.push("right"):this.rules.other.tableAlignCenter.test(l)?o.align.push("center"):this.rules.other.tableAlignLeft.test(l)?o.align.push("left"):o.align.push(null);for(let l=0;l<n.length;l++)o.header.push({text:n[l],tokens:this.lexer.inline(n[l]),header:!0,align:o.align[l]});for(let l of i)o.rows.push(Bn(l,o.header.length).map((a,s)=>({text:a,tokens:this.lexer.inline(a),header:!1,align:o.align[s]})));return o}}lheading(e){let r=this.rules.block.lheading.exec(e);if(r)return{type:"heading",raw:r[0],depth:r[2].charAt(0)==="="?1:2,text:r[1],tokens:this.lexer.inline(r[1])}}paragraph(e){let r=this.rules.block.paragraph.exec(e);if(r){let n=r[1].charAt(r[1].length-1)===`
|
|
57
|
+
`?r[1].slice(0,-1):r[1];return{type:"paragraph",raw:r[0],text:n,tokens:this.lexer.inline(n)}}}text(e){let r=this.rules.block.text.exec(e);if(r)return{type:"text",raw:r[0],text:r[0],tokens:this.lexer.inline(r[0])}}escape(e){let r=this.rules.inline.escape.exec(e);if(r)return{type:"escape",raw:r[0],text:r[1]}}tag(e){let r=this.rules.inline.tag.exec(e);if(r)return!this.lexer.state.inLink&&this.rules.other.startATag.test(r[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(r[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(r[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(r[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:r[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:r[0]}}link(e){let r=this.rules.inline.link.exec(e);if(r){let n=r[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let o=oe(n.slice(0,-1),"\\");if((n.length-o.length)%2===0)return}else{let o=xo(r[2],"()");if(o===-2)return;if(o>-1){let l=(r[0].indexOf("!")===0?5:4)+r[1].length+o;r[2]=r[2].substring(0,o),r[0]=r[0].substring(0,l).trim(),r[3]=""}}let t=r[2],i="";if(this.options.pedantic){let o=this.rules.other.pedanticHrefTitle.exec(t);o&&(t=o[1],i=o[3])}else i=r[3]?r[3].slice(1,-1):"";return t=t.trim(),this.rules.other.startAngleBracket.test(t)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?t=t.slice(1):t=t.slice(1,-1)),zn(r,{href:t&&t.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},r[0],this.lexer,this.rules)}}reflink(e,r){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let t=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),i=r[t.toLowerCase()];if(!i){let o=n[0].charAt(0);return{type:"text",raw:o,text:o}}return zn(n,i,n[0],this.lexer,this.rules)}}emStrong(e,r,n=""){let t=this.rules.inline.emStrongLDelim.exec(e);if(!(!t||t[3]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(t[1]||t[2])||!n||this.rules.inline.punctuation.exec(n))){let i=[...t[0]].length-1,o,l,a=i,s=0,u=t[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(u.lastIndex=0,r=r.slice(-1*e.length+i);(t=u.exec(r))!=null;){if(o=t[1]||t[2]||t[3]||t[4]||t[5]||t[6],!o)continue;if(l=[...o].length,t[3]||t[4]){a+=l;continue}else if((t[5]||t[6])&&i%3&&!((i+l)%3)){s+=l;continue}if(a-=l,a>0)continue;l=Math.min(l,l+a+s);let c=[...t[0]][0].length,p=e.slice(0,i+t.index+c+l);if(Math.min(i,l)%2){let f=p.slice(1,-1);return{type:"em",raw:p,text:f,tokens:this.lexer.inlineTokens(f)}}let h=p.slice(2,-2);return{type:"strong",raw:p,text:h,tokens:this.lexer.inlineTokens(h)}}}}codespan(e){let r=this.rules.inline.code.exec(e);if(r){let n=r[2].replace(this.rules.other.newLineCharGlobal," "),t=this.rules.other.nonSpaceChar.test(n),i=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return t&&i&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:r[0],text:n}}}br(e){let r=this.rules.inline.br.exec(e);if(r)return{type:"br",raw:r[0]}}del(e,r,n=""){let t=this.rules.inline.delLDelim.exec(e);if(t&&(!t[1]||!n||this.rules.inline.punctuation.exec(n))){let i=[...t[0]].length-1,o,l,a=i,s=this.rules.inline.delRDelim;for(s.lastIndex=0,r=r.slice(-1*e.length+i);(t=s.exec(r))!=null;){if(o=t[1]||t[2]||t[3]||t[4]||t[5]||t[6],!o||(l=[...o].length,l!==i))continue;if(t[3]||t[4]){a+=l;continue}if(a-=l,a>0)continue;l=Math.min(l,l+a);let u=[...t[0]][0].length,c=e.slice(0,i+t.index+u+l),p=c.slice(i,-i);return{type:"del",raw:c,text:p,tokens:this.lexer.inlineTokens(p)}}}}autolink(e){let r=this.rules.inline.autolink.exec(e);if(r){let n,t;return r[2]==="@"?(n=r[1],t="mailto:"+n):(n=r[1],t=n),{type:"link",raw:r[0],text:n,href:t,tokens:[{type:"text",raw:n,text:n}]}}}url(e){let r;if(r=this.rules.inline.url.exec(e)){let n,t;if(r[2]==="@")n=r[0],t="mailto:"+n;else{let i;do i=r[0],r[0]=this.rules.inline._backpedal.exec(r[0])?.[0]??"";while(i!==r[0]);n=r[0],r[1]==="www."?t="http://"+r[0]:t=r[0]}return{type:"link",raw:r[0],text:n,href:t,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(e){let r=this.rules.inline.text.exec(e);if(r){let n=this.lexer.state.inRawBlock;return{type:"text",raw:r[0],text:r[0],escaped:n}}}},R=class sr{tokens;options;state;inlineQueue;tokenizer;constructor(r){this.tokens=[],this.tokens.links=Object.create(null),this.options=r||N,this.options.tokenizer=this.options.tokenizer||new se,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let n={other:C,block:we.normal,inline:le.normal};this.options.pedantic?(n.block=we.pedantic,n.inline=le.pedantic):this.options.gfm&&(n.block=we.gfm,this.options.breaks?n.inline=le.breaks:n.inline=le.gfm),this.tokenizer.rules=n}static get rules(){return{block:we,inline:le}}static lex(r,n){return new sr(n).lex(r)}static lexInline(r,n){return new sr(n).inlineTokens(r)}lex(r){r=r.replace(C.carriageReturn,`
|
|
58
|
+
`),this.blockTokens(r,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let t=this.inlineQueue[n];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(r,n=[],t=!1){for(this.options.pedantic&&(r=r.replace(C.tabCharGlobal," ").replace(C.spaceLine,""));r;){let i;if(this.options.extensions?.block?.some(l=>(i=l.call({lexer:this},r,n))?(r=r.substring(i.raw.length),n.push(i),!0):!1))continue;if(i=this.tokenizer.space(r)){r=r.substring(i.raw.length);let l=n.at(-1);i.raw.length===1&&l!==void 0?l.raw+=`
|
|
59
|
+
`:n.push(i);continue}if(i=this.tokenizer.code(r)){r=r.substring(i.raw.length);let l=n.at(-1);l?.type==="paragraph"||l?.type==="text"?(l.raw+=(l.raw.endsWith(`
|
|
60
|
+
`)?"":`
|
|
61
|
+
`)+i.raw,l.text+=`
|
|
62
|
+
`+i.text,this.inlineQueue.at(-1).src=l.text):n.push(i);continue}if(i=this.tokenizer.fences(r)){r=r.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.heading(r)){r=r.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.hr(r)){r=r.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.blockquote(r)){r=r.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.list(r)){r=r.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.html(r)){r=r.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.def(r)){r=r.substring(i.raw.length);let l=n.at(-1);l?.type==="paragraph"||l?.type==="text"?(l.raw+=(l.raw.endsWith(`
|
|
63
|
+
`)?"":`
|
|
64
|
+
`)+i.raw,l.text+=`
|
|
65
|
+
`+i.raw,this.inlineQueue.at(-1).src=l.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title},n.push(i));continue}if(i=this.tokenizer.table(r)){r=r.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.lheading(r)){r=r.substring(i.raw.length),n.push(i);continue}let o=r;if(this.options.extensions?.startBlock){let l=1/0,a=r.slice(1),s;this.options.extensions.startBlock.forEach(u=>{s=u.call({lexer:this},a),typeof s=="number"&&s>=0&&(l=Math.min(l,s))}),l<1/0&&l>=0&&(o=r.substring(0,l+1))}if(this.state.top&&(i=this.tokenizer.paragraph(o))){let l=n.at(-1);t&&l?.type==="paragraph"?(l.raw+=(l.raw.endsWith(`
|
|
66
|
+
`)?"":`
|
|
67
|
+
`)+i.raw,l.text+=`
|
|
68
|
+
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):n.push(i),t=o.length!==r.length,r=r.substring(i.raw.length);continue}if(i=this.tokenizer.text(r)){r=r.substring(i.raw.length);let l=n.at(-1);l?.type==="text"?(l.raw+=(l.raw.endsWith(`
|
|
69
|
+
`)?"":`
|
|
70
|
+
`)+i.raw,l.text+=`
|
|
71
|
+
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):n.push(i);continue}if(r){let l="Infinite loop on byte: "+r.charCodeAt(0);if(this.options.silent){console.error(l);break}else throw new Error(l)}}return this.state.top=!0,n}inline(r,n=[]){return this.inlineQueue.push({src:r,tokens:n}),n}inlineTokens(r,n=[]){let t=r,i=null;if(this.tokens.links){let s=Object.keys(this.tokens.links);if(s.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(t))!=null;)s.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(t=t.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+t.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(t))!=null;)t=t.slice(0,i.index)+"++"+t.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let o;for(;(i=this.tokenizer.rules.inline.blockSkip.exec(t))!=null;)o=i[2]?i[2].length:0,t=t.slice(0,i.index+o)+"["+"a".repeat(i[0].length-o-2)+"]"+t.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);t=this.options.hooks?.emStrongMask?.call({lexer:this},t)??t;let l=!1,a="";for(;r;){l||(a=""),l=!1;let s;if(this.options.extensions?.inline?.some(c=>(s=c.call({lexer:this},r,n))?(r=r.substring(s.raw.length),n.push(s),!0):!1))continue;if(s=this.tokenizer.escape(r)){r=r.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.tag(r)){r=r.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.link(r)){r=r.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.reflink(r,this.tokens.links)){r=r.substring(s.raw.length);let c=n.at(-1);s.type==="text"&&c?.type==="text"?(c.raw+=s.raw,c.text+=s.text):n.push(s);continue}if(s=this.tokenizer.emStrong(r,t,a)){r=r.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.codespan(r)){r=r.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.br(r)){r=r.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.del(r,t,a)){r=r.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.autolink(r)){r=r.substring(s.raw.length),n.push(s);continue}if(!this.state.inLink&&(s=this.tokenizer.url(r))){r=r.substring(s.raw.length),n.push(s);continue}let u=r;if(this.options.extensions?.startInline){let c=1/0,p=r.slice(1),h;this.options.extensions.startInline.forEach(f=>{h=f.call({lexer:this},p),typeof h=="number"&&h>=0&&(c=Math.min(c,h))}),c<1/0&&c>=0&&(u=r.substring(0,c+1))}if(s=this.tokenizer.inlineText(u)){r=r.substring(s.raw.length),s.raw.slice(-1)!=="_"&&(a=s.raw.slice(-1)),l=!0;let c=n.at(-1);c?.type==="text"?(c.raw+=s.raw,c.text+=s.text):n.push(s);continue}if(r){let c="Infinite loop on byte: "+r.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return n}},ae=class{options;parser;constructor(e){this.options=e||N}space(e){return""}code({text:e,lang:r,escaped:n}){let t=(r||"").match(C.notSpaceStart)?.[0],i=e.replace(C.endingNewline,"")+`
|
|
72
|
+
`;return t?'<pre><code class="language-'+F(t)+'">'+(n?i:F(i,!0))+`</code></pre>
|
|
73
|
+
`:"<pre><code>"+(n?i:F(i,!0))+`</code></pre>
|
|
74
|
+
`}blockquote({tokens:e}){return`<blockquote>
|
|
75
|
+
${this.parser.parse(e)}</blockquote>
|
|
76
|
+
`}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:r}){return`<h${r}>${this.parser.parseInline(e)}</h${r}>
|
|
77
|
+
`}hr(e){return`<hr>
|
|
78
|
+
`}list(e){let r=e.ordered,n=e.start,t="";for(let l=0;l<e.items.length;l++){let a=e.items[l];t+=this.listitem(a)}let i=r?"ol":"ul",o=r&&n!==1?' start="'+n+'"':"";return"<"+i+o+`>
|
|
79
|
+
`+t+"</"+i+`>
|
|
80
|
+
`}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
|
|
81
|
+
`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|
82
|
+
`}table(e){let r="",n="";for(let i=0;i<e.header.length;i++)n+=this.tablecell(e.header[i]);r+=this.tablerow({text:n});let t="";for(let i=0;i<e.rows.length;i++){let o=e.rows[i];n="";for(let l=0;l<o.length;l++)n+=this.tablecell(o[l]);t+=this.tablerow({text:n})}return t&&(t=`<tbody>${t}</tbody>`),`<table>
|
|
83
|
+
<thead>
|
|
84
|
+
`+r+`</thead>
|
|
85
|
+
`+t+`</table>
|
|
86
|
+
`}tablerow({text:e}){return`<tr>
|
|
87
|
+
${e}</tr>
|
|
88
|
+
`}tablecell(e){let r=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+r+`</${n}>
|
|
89
|
+
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${F(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:r,tokens:n}){let t=this.parser.parseInline(n),i=Dn(e);if(i===null)return t;e=i;let o='<a href="'+e+'"';return r&&(o+=' title="'+F(r)+'"'),o+=">"+t+"</a>",o}image({href:e,title:r,text:n,tokens:t}){t&&(n=this.parser.parseInline(t,this.parser.textRenderer));let i=Dn(e);if(i===null)return F(n);e=i;let o=`<img src="${e}" alt="${F(n)}"`;return r&&(o+=` title="${F(r)}"`),o+=">",o}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:F(e.text)}},Te=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}checkbox({raw:e}){return e}},I=class ar{options;renderer;textRenderer;constructor(r){this.options=r||N,this.options.renderer=this.options.renderer||new ae,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Te}static parse(r,n){return new ar(n).parse(r)}static parseInline(r,n){return new ar(n).parseInline(r)}parse(r){let n="";for(let t=0;t<r.length;t++){let i=r[t];if(this.options.extensions?.renderers?.[i.type]){let l=i,a=this.options.extensions.renderers[l.type].call({parser:this},l);if(a!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(l.type)){n+=a||"";continue}}let o=i;switch(o.type){case"space":{n+=this.renderer.space(o);break}case"hr":{n+=this.renderer.hr(o);break}case"heading":{n+=this.renderer.heading(o);break}case"code":{n+=this.renderer.code(o);break}case"table":{n+=this.renderer.table(o);break}case"blockquote":{n+=this.renderer.blockquote(o);break}case"list":{n+=this.renderer.list(o);break}case"checkbox":{n+=this.renderer.checkbox(o);break}case"html":{n+=this.renderer.html(o);break}case"def":{n+=this.renderer.def(o);break}case"paragraph":{n+=this.renderer.paragraph(o);break}case"text":{n+=this.renderer.text(o);break}default:{let l='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return n}parseInline(r,n=this.renderer){let t="";for(let i=0;i<r.length;i++){let o=r[i];if(this.options.extensions?.renderers?.[o.type]){let a=this.options.extensions.renderers[o.type].call({parser:this},o);if(a!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(o.type)){t+=a||"";continue}}let l=o;switch(l.type){case"escape":{t+=n.text(l);break}case"html":{t+=n.html(l);break}case"link":{t+=n.link(l);break}case"image":{t+=n.image(l);break}case"checkbox":{t+=n.checkbox(l);break}case"strong":{t+=n.strong(l);break}case"em":{t+=n.em(l);break}case"codespan":{t+=n.codespan(l);break}case"br":{t+=n.br(l);break}case"del":{t+=n.del(l);break}case"text":{t+=n.text(l);break}default:{let a='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return t}},Q=class{options;block;constructor(e){this.options=e||N}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(){return this.block?R.lex:R.lexInline}provideParser(){return this.block?I.parse:I.parseInline}},ei=class{defaults=Ae();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=I;Renderer=ae;TextRenderer=Te;Lexer=R;Tokenizer=se;Hooks=Q;constructor(...e){this.use(...e)}walkTokens(e,r){let n=[];for(let t of e)switch(n=n.concat(r.call(this,t)),t.type){case"table":{let i=t;for(let o of i.header)n=n.concat(this.walkTokens(o.tokens,r));for(let o of i.rows)for(let l of o)n=n.concat(this.walkTokens(l.tokens,r));break}case"list":{let i=t;n=n.concat(this.walkTokens(i.items,r));break}default:{let i=t;this.defaults.extensions?.childTokens?.[i.type]?this.defaults.extensions.childTokens[i.type].forEach(o=>{let l=i[o].flat(1/0);n=n.concat(this.walkTokens(l,r))}):i.tokens&&(n=n.concat(this.walkTokens(i.tokens,r)))}}return n}use(...e){let r=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{let t={...n};if(t.async=this.defaults.async||t.async||!1,n.extensions&&(n.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){let o=r.renderers[i.name];o?r.renderers[i.name]=function(...l){let a=i.renderer.apply(this,l);return a===!1&&(a=o.apply(this,l)),a}:r.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let o=r[i.level];o?o.unshift(i.tokenizer):r[i.level]=[i.tokenizer],i.start&&(i.level==="block"?r.startBlock?r.startBlock.push(i.start):r.startBlock=[i.start]:i.level==="inline"&&(r.startInline?r.startInline.push(i.start):r.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(r.childTokens[i.name]=i.childTokens)}),t.extensions=r),n.renderer){let i=this.defaults.renderer||new ae(this.defaults);for(let o in n.renderer){if(!(o in i))throw new Error(`renderer '${o}' does not exist`);if(["options","parser"].includes(o))continue;let l=o,a=n.renderer[l],s=i[l];i[l]=(...u)=>{let c=a.apply(i,u);return c===!1&&(c=s.apply(i,u)),c||""}}t.renderer=i}if(n.tokenizer){let i=this.defaults.tokenizer||new se(this.defaults);for(let o in n.tokenizer){if(!(o in i))throw new Error(`tokenizer '${o}' does not exist`);if(["options","rules","lexer"].includes(o))continue;let l=o,a=n.tokenizer[l],s=i[l];i[l]=(...u)=>{let c=a.apply(i,u);return c===!1&&(c=s.apply(i,u)),c}}t.tokenizer=i}if(n.hooks){let i=this.defaults.hooks||new Q;for(let o in n.hooks){if(!(o in i))throw new Error(`hook '${o}' does not exist`);if(["options","block"].includes(o))continue;let l=o,a=n.hooks[l],s=i[l];Q.passThroughHooks.has(o)?i[l]=u=>{if(this.defaults.async&&Q.passThroughHooksRespectAsync.has(o))return(async()=>{let p=await a.call(i,u);return s.call(i,p)})();let c=a.call(i,u);return s.call(i,c)}:i[l]=(...u)=>{if(this.defaults.async)return(async()=>{let p=await a.apply(i,u);return p===!1&&(p=await s.apply(i,u)),p})();let c=a.apply(i,u);return c===!1&&(c=s.apply(i,u)),c}}t.hooks=i}if(n.walkTokens){let i=this.defaults.walkTokens,o=n.walkTokens;t.walkTokens=function(l){let a=[];return a.push(o.call(this,l)),i&&(a=a.concat(i.call(this,l))),a}}this.defaults={...this.defaults,...t}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,r){return R.lex(e,r??this.defaults)}parser(e,r){return I.parse(e,r??this.defaults)}parseMarkdown(e){return(r,n)=>{let t={...n},i={...this.defaults,...t},o=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&t.async===!1)return o(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof r>"u"||r===null)return o(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let l=i.hooks?await i.hooks.preprocess(r):r,a=await(i.hooks?await i.hooks.provideLexer():e?R.lex:R.lexInline)(l,i),s=i.hooks?await i.hooks.processAllTokens(a):a;i.walkTokens&&await Promise.all(this.walkTokens(s,i.walkTokens));let u=await(i.hooks?await i.hooks.provideParser():e?I.parse:I.parseInline)(s,i);return i.hooks?await i.hooks.postprocess(u):u})().catch(o);try{i.hooks&&(r=i.hooks.preprocess(r));let l=(i.hooks?i.hooks.provideLexer():e?R.lex:R.lexInline)(r,i);i.hooks&&(l=i.hooks.processAllTokens(l)),i.walkTokens&&this.walkTokens(l,i.walkTokens);let a=(i.hooks?i.hooks.provideParser():e?I.parse:I.parseInline)(l,i);return i.hooks&&(a=i.hooks.postprocess(a)),a}catch(l){return o(l)}}}onError(e,r){return n=>{if(n.message+=`
|
|
90
|
+
Please report this to https://github.com/markedjs/marked.`,e){let t="<p>An error occurred:</p><pre>"+F(n.message+"",!0)+"</pre>";return r?Promise.resolve(t):t}if(r)return Promise.reject(n);throw n}}},Y=new ei;b.options=b.setOptions=function(e){return Y.setOptions(e),b.defaults=Y.defaults,Yn(b.defaults),b};b.getDefaults=Ae;b.defaults=N;b.use=function(...e){return Y.use(...e),b.defaults=Y.defaults,Yn(b.defaults),b};b.walkTokens=function(e,r){return Y.walkTokens(e,r)};b.parseInline=Y.parseInline;b.Parser=I;b.parser=I.parse;b.Renderer=ae;b.TextRenderer=Te;b.Lexer=R;b.lexer=R.lex;b.Tokenizer=se;b.Hooks=Q;b.parse=b;bo=b.options,wo=b.setOptions,yo=b.use,Ao=b.walkTokens,So=b.parseInline,vo=b,To=I.parse,_o=R.lex});var $o=y((fs,si)=>{var Co="0.4.0",li=$n(),{marked:kr}=(ni(),xi(ri));function br(e){let r=/^---\r?\n---\r?\n?([\s\S]*)$/,n=e.match(r);if(n)return{data:{},body:n[1]};let t=/^---\r?\n([\s\S]*?)\r?\n---\r?\n?([\s\S]*)$/,i=e.match(t);if(!i)return{data:{},body:e};let o=li.load(i[1])??{},l=i[2];return{data:o,body:l}}function ce(e,r){let n=r.replace(/\[(\d+)\]/g,".$1").split("."),t=e;for(let i of n){if(t==null)return;t=t[i]}return t}function Eo(e){return e==null?!1:typeof e=="boolean"?e:typeof e=="number"?e!==0:typeof e=="string"?e!=="":Array.isArray(e)?e.length>0:typeof e=="object"?Object.keys(e).length>0:!0}function Ro(e){return e==null?"":Array.isArray(e)?e.join(", "):typeof e=="object"?JSON.stringify(e):String(e)}function mr(e,r,n){let t=r;for(;t>0&&e[t-1]!==`
|
|
91
|
+
`;)t--;for(let o=t;o<r;o++)if(e[o]!==" "&&e[o]!==" ")return null;let i=n;for(;i<e.length&&e[i]!==`
|
|
92
|
+
`&&e[i]!=="\r";){if(e[i]!==" "&&e[i]!==" ")return null;i++}return i<e.length&&e[i]==="\r"&&i++,i<e.length&&e[i]===`
|
|
93
|
+
`&&i++,{lineStart:t,lineEnd:i}}function Io(e,r,n,t){let i=1,o=t;for(;i>0;){let l=e.indexOf(n,o);if(l===-1)return-1;r.lastIndex=o;let a;for(;(a=r.exec(e))!==null&&a.index<l;)i++;if(--i===0)return l;o=l+n.length}return-1}function Lo(e){let r=/\{\{#if [\w.[\]]+\}\}|\{\{\/if\}\}|\{\{else\}\}/g,n=0,t;for(;(t=r.exec(e))!==null;)if(t[0].startsWith("{{#if "))n++;else if(t[0]==="{{/if}}")n--;else if(t[0]==="{{else}}"&&n===0)return t.index;return-1}function ii(e,r,n,t,i){let o="",l=0,a;for(;(a=r.exec(e))!==null;){let s=a.index,u=a.index+a[0].length,c=Io(e,n,t,u);if(c===-1)continue;let p=c+t.length,h=s,f=p,d=u,x=c,w=mr(e,s,u);w&&(h=w.lineStart,d=w.lineEnd);let S=mr(e,c,p);S&&(f=S.lineEnd);let m=e.slice(d,x);o+=e.slice(l,h),o+=i(a[1],m),l=f,r.lastIndex=l}return o+e.slice(l)}function oi(e,{embed:r=!1}={}){let{data:n,body:t}=br(e),i=pe(t,n);return r&&(i=i.trimEnd()+`
|
|
94
|
+
|
|
95
|
+
<!-- frontmatter
|
|
96
|
+
`+JSON.stringify(n,null,2)+`
|
|
97
|
+
-->
|
|
98
|
+
`),i}function Fo(e){let r=oi(e);return kr.parse(r,{gfm:!0})}function Oo(e,{embed:r=!1}={}){let{data:n,body:t}=br(e),i=pe(t,n),o=kr.parse(i,{gfm:!0}),l=n.title||"",a="";return r&&(a=`
|
|
99
|
+
<script type="application/json" id="frontmatter">
|
|
100
|
+
`+JSON.stringify(n,null,2)+`
|
|
101
|
+
<\/script>`),qo.replace("%TITLE%",l).replace("%DATA_BLOCK%",a).replace("%BODY%",o)}var qo=`<!doctype html>
|
|
102
|
+
<html lang="en">
|
|
103
|
+
<head>
|
|
104
|
+
<meta charset="UTF-8" />
|
|
105
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
106
|
+
<title>%TITLE%</title>%DATA_BLOCK%
|
|
107
|
+
<style>
|
|
108
|
+
body { max-width: 720px; margin: 0 auto; padding: 3rem 1.5rem; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 1.0625rem; line-height: 1.65; color: #1f2937; }
|
|
109
|
+
h1, h2, h3 { color: #111827; letter-spacing: -.02em; }
|
|
110
|
+
h1 { font-size: 2rem; margin-bottom: .5rem; }
|
|
111
|
+
h2 { font-size: 1.4rem; margin-top: 2.5rem; }
|
|
112
|
+
h3 { font-size: 1.1rem; margin-top: 2rem; }
|
|
113
|
+
code { font-family: "SF Mono", ui-monospace, Menlo, monospace; font-size: .875em; background: #f3f4f6; padding: .1em .35em; border-radius: 3px; }
|
|
114
|
+
pre { background: #f3f4f6; border-radius: 6px; padding: 1.25rem; overflow-x: auto; }
|
|
115
|
+
pre code { background: none; padding: 0; }
|
|
116
|
+
table { border-collapse: collapse; width: 100%; }
|
|
117
|
+
th, td { text-align: left; padding: .5rem .75rem; border-bottom: 1px solid #e5e7eb; }
|
|
118
|
+
th { font-size: .8125rem; text-transform: uppercase; letter-spacing: .05em; color: #6b7280; }
|
|
119
|
+
a { color: #2563eb; }
|
|
120
|
+
hr { border: none; border-top: 1px solid #e5e7eb; margin: 2.5rem 0; }
|
|
121
|
+
</style>
|
|
122
|
+
</head>
|
|
123
|
+
<body>
|
|
124
|
+
%BODY%
|
|
125
|
+
</body>
|
|
126
|
+
</html>`,xr,ti;function pe(e,r,n){let t=n!==!1;t&&(xr=new Map,ti=0);function i(a){let s=`${ti++}`;return xr.set(s,a),s}function o(a){let s=a;for(let[u,c]of[...xr.entries()].reverse())s=s.split(u).join(c);return s}let l=e;return l=l.replace(/\\\{\{/g,()=>i("{{")),l=ii(l,/\{\{#each ([\w.[\]]+)\}\}/g,/\{\{#each [\w.[\]]+\}\}/g,"{{/each}}",(a,s)=>{let u=ce(r,a);return Array.isArray(u)?i(u.map((c,p)=>{let h={...r,this:c,"@index":p,"@first":p===0,"@last":p===u.length-1};return c&&typeof c=="object"&&!Array.isArray(c)&&Object.assign(h,c),pe(s,h,!1)}).join("")):i("")}),l=ii(l,/\{\{#if ([\w.[\]]+)\}\}/g,/\{\{#if [\w.[\]]+\}\}/g,"{{/if}}",(a,s)=>{let u=ce(r,a),c=Lo(s),p,h;if(c===-1)p=s,h="";else{let f=c+8,d=mr(s,c,f);d?(p=s.slice(0,d.lineStart),h=s.slice(d.lineEnd)):(p=s.slice(0,c),h=s.slice(f))}return i(pe(Eo(u)?p:h,r,!1))}),l=l.replace(/\{\{> ?([\w.[\]]+)\}\}/g,(a,s)=>{let u=ce(r,s);return u!=null?i(String(u)):""}),l=l.replace(/\{\{([\w.[\]@]+)\}\}/g,(a,s)=>{let u=ce(r,s);return u==null?"":i(Ro(u))}),t?o(l):l}si.exports={SPEC_VERSION:Co,parse:br,render:oi,renderHtmlFrag:Fo,renderHtml:Oo,renderTemplate:pe,resolvePath:ce,yaml:li,marked:kr}});return $o();})();
|
package/package.json
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "markedin-parser",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.4.1",
|
|
4
|
+
"description": "The Markedin parser for .mi files — structured data (YAML) plus a Markdown document that renders from it.",
|
|
5
5
|
"main": "parse.js",
|
|
6
6
|
"files": [
|
|
7
|
-
"parse.js"
|
|
7
|
+
"parse.js",
|
|
8
|
+
"dist/",
|
|
9
|
+
"LICENSE",
|
|
10
|
+
"NOTICE"
|
|
8
11
|
],
|
|
9
12
|
"scripts": {
|
|
13
|
+
"build": "esbuild parse.js --bundle --format=iife --global-name=markedin --outfile=dist/markedin.browser.js && esbuild parse.js --bundle --format=iife --global-name=markedin --minify --outfile=dist/markedin.browser.min.js",
|
|
10
14
|
"test": "node --test tests/parse.test.js"
|
|
11
15
|
},
|
|
12
16
|
"repository": {
|
|
@@ -19,7 +23,7 @@
|
|
|
19
23
|
"url": "https://github.com/stonebraker/markedin/issues"
|
|
20
24
|
},
|
|
21
25
|
"author": "Jason Stonebraker",
|
|
22
|
-
"license": "
|
|
26
|
+
"license": "Apache-2.0",
|
|
23
27
|
"keywords": [
|
|
24
28
|
"markedin",
|
|
25
29
|
"mi",
|
package/parse.js
CHANGED
|
@@ -220,19 +220,21 @@ const HTML_TEMPLATE = `<!doctype html>
|
|
|
220
220
|
</body>
|
|
221
221
|
</html>`;
|
|
222
222
|
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
223
|
+
let _registry, _seq;
|
|
224
|
+
|
|
225
|
+
function renderTemplate(template, ctx, _isRoot) {
|
|
226
|
+
const isRoot = _isRoot !== false;
|
|
227
|
+
if (isRoot) { _registry = new Map(); _seq = 0; }
|
|
226
228
|
|
|
227
229
|
function protect(str) {
|
|
228
|
-
const tok = `\x02${
|
|
229
|
-
|
|
230
|
+
const tok = `\x02${_seq++}\x03`;
|
|
231
|
+
_registry.set(tok, str);
|
|
230
232
|
return tok;
|
|
231
233
|
}
|
|
232
234
|
|
|
233
235
|
function restore(str) {
|
|
234
236
|
let out = str;
|
|
235
|
-
for (const [tok, val] of [...
|
|
237
|
+
for (const [tok, val] of [..._registry.entries()].reverse()) {
|
|
236
238
|
out = out.split(tok).join(val);
|
|
237
239
|
}
|
|
238
240
|
return out;
|
|
@@ -254,7 +256,7 @@ function renderTemplate(template, ctx) {
|
|
|
254
256
|
return protect(arr.map((item, i) => {
|
|
255
257
|
const itemCtx = { ...ctx, this: item, '@index': i, '@first': i === 0, '@last': i === arr.length - 1 };
|
|
256
258
|
if (item && typeof item === 'object' && !Array.isArray(item)) Object.assign(itemCtx, item);
|
|
257
|
-
return renderTemplate(inner, itemCtx);
|
|
259
|
+
return renderTemplate(inner, itemCtx, false);
|
|
258
260
|
}).join(''));
|
|
259
261
|
}
|
|
260
262
|
);
|
|
@@ -282,7 +284,7 @@ function renderTemplate(template, ctx) {
|
|
|
282
284
|
falsy = inner.slice(elseEnd);
|
|
283
285
|
}
|
|
284
286
|
}
|
|
285
|
-
return protect(renderTemplate(isTruthy(val) ? truthy : falsy, ctx));
|
|
287
|
+
return protect(renderTemplate(isTruthy(val) ? truthy : falsy, ctx, false));
|
|
286
288
|
}
|
|
287
289
|
);
|
|
288
290
|
|
|
@@ -299,7 +301,7 @@ function renderTemplate(template, ctx) {
|
|
|
299
301
|
return protect(formatValue(val));
|
|
300
302
|
});
|
|
301
303
|
|
|
302
|
-
return restore(out);
|
|
304
|
+
return isRoot ? restore(out) : out;
|
|
303
305
|
}
|
|
304
306
|
|
|
305
|
-
module.exports = { SPEC_VERSION, parse, render, renderHtmlFrag, renderHtml, renderTemplate, resolvePath };
|
|
307
|
+
module.exports = { SPEC_VERSION, parse, render, renderHtmlFrag, renderHtml, renderTemplate, resolvePath, yaml, marked };
|