`}tablecell(n){let e=this.parser.parseInline(n.tokens),r=n.header?"th":"td";return(n.align?`<${r} align="${n.align}">`:`<${r}>`)+e+`${r}>
`}strong({tokens:n}){return`${this.parser.parseInline(n)}`}em({tokens:n}){return`${this.parser.parseInline(n)}`}codespan({text:n}){return`${T(n,!0)}`}br(n){return" "}del({tokens:n}){return`${this.parser.parseInline(n)}`}link({href:n,title:e,tokens:r}){let s=this.parser.parseInline(r),t=De(n);if(t===null)return s;n=t;let l='"+s+"",l}image({href:n,title:e,text:r,tokens:s}){s&&(r=this.parser.parseInline(s,this.parser.textRenderer));let t=De(n);if(t===null)return T(r);n=t;let l=`",l}text(n){return"tokens"in n&&n.tokens?this.parser.parseInline(n.tokens):"escaped"in n&&n.escaped?n.text:T(n.text)}},me=class{static{p(this,"$")}strong({text:n}){return n}em({text:n}){return n}codespan({text:n}){return n}del({text:n}){return n}html({text:n}){return n}text({text:n}){return n}link({text:n}){return""+n}image({text:n}){return""+n}br(){return""}},R=class le{static{p(this,"l")}options;renderer;textRenderer;constructor(e){this.options=e||E,this.options.renderer=this.options.renderer||new H,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new me}static parse(e,r){return new le(r).parse(e)}static parseInline(e,r){return new le(r).parseInline(e)}parse(e,r=!0){let s="";for(let t=0;t{let i=t[l].flat(1/0);r=r.concat(this.walkTokens(i,e))}):t.tokens&&(r=r.concat(this.walkTokens(t.tokens,e)))}}return r}use(...n){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return n.forEach(r=>{let s={...r};if(s.async=this.defaults.async||s.async||!1,r.extensions&&(r.extensions.forEach(t=>{if(!t.name)throw new Error("extension name required");if("renderer"in t){let l=e.renderers[t.name];l?e.renderers[t.name]=function(...i){let o=t.renderer.apply(this,i);return o===!1&&(o=l.apply(this,i)),o}:e.renderers[t.name]=t.renderer}if("tokenizer"in t){if(!t.level||t.level!=="block"&&t.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let l=e[t.level];l?l.unshift(t.tokenizer):e[t.level]=[t.tokenizer],t.start&&(t.level==="block"?e.startBlock?e.startBlock.push(t.start):e.startBlock=[t.start]:t.level==="inline"&&(e.startInline?e.startInline.push(t.start):e.startInline=[t.start]))}"childTokens"in t&&t.childTokens&&(e.childTokens[t.name]=t.childTokens)}),s.extensions=e),r.renderer){let t=this.defaults.renderer||new H(this.defaults);for(let l in r.renderer){if(!(l in t))throw new Error(`renderer '${l}' does not exist`);if(["options","parser"].includes(l))continue;let i=l,o=r.renderer[i],a=t[i];t[i]=(...c)=>{let h=o.apply(t,c);return h===!1&&(h=a.apply(t,c)),h||""}}s.renderer=t}if(r.tokenizer){let t=this.defaults.tokenizer||new Z(this.defaults);for(let l in r.tokenizer){if(!(l in t))throw new Error(`tokenizer '${l}' does not exist`);if(["options","rules","lexer"].includes(l))continue;let i=l,o=r.tokenizer[i],a=t[i];t[i]=(...c)=>{let h=o.apply(t,c);return h===!1&&(h=a.apply(t,c)),h}}s.tokenizer=t}if(r.hooks){let t=this.defaults.hooks||new D;for(let l in r.hooks){if(!(l in t))throw new Error(`hook '${l}' does not exist`);if(["options","block"].includes(l))continue;let i=l,o=r.hooks[i],a=t[i];D.passThroughHooks.has(l)?t[i]=c=>{if(this.defaults.async&&D.passThroughHooksRespectAsync.has(l))return Promise.resolve(o.call(t,c)).then(f=>a.call(t,f));let h=o.call(t,c);return a.call(t,h)}:t[i]=(...c)=>{let h=o.apply(t,c);return h===!1&&(h=a.apply(t,c)),h}}s.hooks=t}if(r.walkTokens){let t=this.defaults.walkTokens,l=r.walkTokens;s.walkTokens=function(i){let o=[];return o.push(l.call(this,i)),t&&(o=o.concat(t.call(this,i))),o}}this.defaults={...this.defaults,...s}}),this}setOptions(n){return this.defaults={...this.defaults,...n},this}lexer(n,e){return $.lex(n,e??this.defaults)}parser(n,e){return R.parse(n,e??this.defaults)}parseMarkdown(n){return(e,r)=>{let s={...r},t={...this.defaults,...s},l=this.onError(!!t.silent,!!t.async);if(this.defaults.async===!0&&s.async===!1)return l(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 e>"u"||e===null)return l(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return l(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));t.hooks&&(t.hooks.options=t,t.hooks.block=n);let i=t.hooks?t.hooks.provideLexer():n?$.lex:$.lexInline,o=t.hooks?t.hooks.provideParser():n?R.parse:R.parseInline;if(t.async)return Promise.resolve(t.hooks?t.hooks.preprocess(e):e).then(a=>i(a,t)).then(a=>t.hooks?t.hooks.processAllTokens(a):a).then(a=>t.walkTokens?Promise.all(this.walkTokens(a,t.walkTokens)).then(()=>a):a).then(a=>o(a,t)).then(a=>t.hooks?t.hooks.postprocess(a):a).catch(l);try{t.hooks&&(e=t.hooks.preprocess(e));let a=i(e,t);t.hooks&&(a=t.hooks.processAllTokens(a)),t.walkTokens&&this.walkTokens(a,t.walkTokens);let c=o(a,t);return t.hooks&&(c=t.hooks.postprocess(c)),c}catch(a){return l(a)}}}onError(n,e){return r=>{if(r.message+=`
Please report this to https://github.com/markedjs/marked.`,n){let s="