!function(e,t){"object"==typeofexports&&"undefined"!=typeofmodule?module.exports=t():"function"==typeofdefine&&define.amd?define(t):(e="undefined"!=typeofglobalThis?globalThis:e||self).RevealMarkdown=t()}(this,(function(){"use strict";functione(){return{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}lett={baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1};constn=/[&<>"']/,r=/[&<>"']/g,s=/[<>"']|&(?!#?\w+;)/,i=/[<>"']|&(?!#?\w+;)/g,l={"&":"&","<":"<",">":">",'"':""","'":"'"},a=e=>l[e];functiono(e,t){if(t){if(n.test(e))returne.replace(r,a)}elseif(s.test(e))returne.replace(i,a);returne}constc=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;functionh(e){returne.replace(c,((e,t)=>"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""))}constp=/(^|[^\[])\^/g;functionu(e,t){e=e.source||e,t=t||"";constn={replace:(t,r)=>(r=(r=r.source||r).replace(p,"$1"),e=e.replace(t,r),n),getRegex:()=>newRegExp(e,t)};returnn}constg=/[^\w:]/g,d=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;functionf(e,t,n){if(e){lete;try{e=decodeURIComponent(h(n)).replace(g,"").toLowerCase()}catch(e){returnnull}if(0===e.indexOf("javascript:")||0===e.indexOf("vbscript:")||0===e.indexOf("data:"))returnnull}t&&!d.test(n)&&(n=function(e,t){k[" "+e]||(x.test(e)?k[" "+e]=e+"/":k[" "+e]=z(e,"/",!0));constn=-1===(e=k[" "+e]).indexOf(":");return"//"===t.substring(0,2)?n?t:e.replace(m,"$1")+t:"/"===t.charAt(0)?n?t:e.replace(b,"$1")+t:e+t}(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch(e){returnnull}returnn}constk={},x=/^[^:]+:\/*[^/]*$/,m=/^([^:]+:)[\s\S]*$/,b=/^([^:]+:\/*[^/]*)[\s\S]*$/;constw={exec:function(){}};functiony(e){lett,n,r=1;for(;r<arguments.length;r++)for(nint=arguments[r],t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);returne}function_(e,t){constn=e.replace(/\|/g,((e,t,n)=>{letr=!1,s=t;for(;--s>=0&&"\\"===n[s];)r=!r;returnr?"|":" |"})).split(/ \|/);letr=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),n.length>t)n.splice(t);elsefor(;n.length<t;)n.push("");for(;r<n.length;r++)n[r]=n[r].trim().replace(/\\\|/g,"|");returnn}functionz(e,t,n){constr=e.length;if(0===r)return"";lets=0;for(;s<r;){consti=e.charAt(r-s-1);if(i!==t||n){if(i===t||!n)break;s++}elses++}returne.substr(0,r-s)}functionS(e){e&&e.sanitize&&!e.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function$(e,t){if(t<1)return"";letn="";for(;t>1;)1&t&&(n+=e),t>>=1,e+=e;returnn+e}functionT(e,t,n,r){consts=t.href,i=t.title?o(t.title):null,l=e[1].replace(/\\([\[\]])/g,"$1");if("!"!==e[0].charAt(0)){r.state.inLink=!0;conste={type:"link",raw:n,href:s,title:i,text:l,tokens:r.inlineTokens(l,[])};returnr.state.inLink=!1,e}return{type:"image",raw:n,href:s,title:i,text:o(l)}}classA{constructor(e){this.options=e||t}space(e){constt=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){constt=this.rules.block.code.exec(e);if(t){conste=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:z(e,"\n")}}}fences(e){constt=this.rules.block.fences.exec(e);if(t){conste=t[0],n=function(e,t){constn=e.match(/^(\s+)(?:```)/);if(null===n)returnt;constr=n[1];returnt.split("\n").map((e=>{constt=e.match(/^\s+/);if(null===t)returne;const[n]=t;returnn.length>=r.length?e.slice(r.length):e})).join("\n")}(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].t
constD="__SCRIPT_END__",M=/\[([\s\d,|-]*)\]/,P={"&":"&","<":"<",">":">",'"':""","'":"'"};return()=>{lete;functiont(e){vart=(e.querySelector("[data-template]")||e.querySelector("script")||e).textContent,n=(t=t.replace(newRegExp(D,"g"),"<\/script>")).match(/^\n?(\s*)/)[1].length,r=t.match(/^\n?(\t*)/)[1].length;returnr>0?t=t.replace(newRegExp("\\n?\\t{"+r+"}","g"),"\n"):n>1&&(t=t.replace(newRegExp("\\n? {"+n+"}","g"),"\n")),t}functionn(e){for(vart=e.attributes,n=[],r=0,s=t.length;r<s;r++){vari=t[r].name,l=t[r].value;/data\-(markdown|separator|vertical|notes)/gi.test(i)||(l?n.push(i+'="'+l+'"'):n.push(i))}returnn.join(" ")}functionr(e){return(e=e||{}).separator=e.separator||"\r?\n---\r?\n",e.notesSeparator=e.notesSeparator||"notes?:",e.attributes=e.attributes||"",e}functions(e,t){t=r(t);varn=e.split(newRegExp(t.notesSeparator,"mgi"));return2===n.length&&(e=n[0]+'<aside class="notes">'+N(n[1].trim())+"</aside>"),'<script type="text/template">'+(e=e.replace(/<\/script>/g,D))+"<\/script>"}functioni(e,t){t=r(t);for(varn,i,l,a=newRegExp(t.separator+(t.verticalSeparator?"|"+t.verticalSeparator:""),"mg"),o=newRegExp(t.separator),c=0,h=!0,p=[];n=a.exec(e);)!(i=o.test(n[0]))&&h&&p.push([]),l=e.substring(c,n.index),i&&h?p.push(l):p[p.length-1].push(l),c=a.lastIndex,h=i;(h?p:p[p.length-1]).push(e.substring(c));for(varu="",g=0,d=p.length;g<d;g++)p[g]instanceofArray?(u+="<section "+t.attributes+">",p[g].forEach((function(e){u+="<section data-markdown>"+s(e,t)+"</section>"})),u+="</section>"):u+="<section "+t.attributes+" data-markdown>"+s(p[g],t)+"</section>";returnu}functionl(e){returnnewPromise((function(r){vars=[];[].slice.call(e.querySelectorAll("section[data-markdown]:not([data-markdown-parsed])")).forEach((function(e,r){e.getAttribute("data-markdown").length?s.push(function(e){returnnewPromise((function(t,n){varr=newXMLHttpRequest,s=e.getAttribute("data-markdown"),i=e.getAttribute("data-charset");null!=i&&""!=i&&r.overrideMimeType("text/html; charset="+i),r.onreadystatechange=function(e,r){4===r.readyState&&(r.status>=200&&r.status<300||0===r.status?t(r,s):n(r,s))}.bind(this,e,r),r.open("GET",s,!0);try{r.send()}catch(e){console.warn("Failed to get the Markdown file "+s+". Make sure that the presentation and the file are served by a HTTP server and the file can be found there. "+e),t(r,s)}}))}(e).then((function(t,r){e.outerHTML=i(t.responseText,{separator:e.getAttribute("data-separator"),verticalSeparator:e.getAttribute("data-separator-vertical"),notesSeparator:e.getAttribute("data-separator-notes"),attributes:n(e)})}),(function(t,n){e.outerHTML='<section data-state="alert">ERROR: The attempt to fetch '+n+" failed with HTTP status "+t.status+".Check your browser's JavaScript console for more details.<p>Remember that you need to serve the presentation HTML from a HTTP server.</p></section>"}))):e.outerHTML=i(t(e),{separator:e.getAttribute("data-separator"),verticalSeparator:e.getAttribute("data-separator-vertical"),notesSeparator:e.getAttribute("data-separator-notes"),attributes:n(e)})})),Promise.all(s).then(r)}))}functiona(e,t,n){varr,s,i=newRegExp(n,"mg"),l=newRegExp('([^"= ]+?)="([^"]+?)"|(data-[^"= ]+?)(?=[" ])',"mg"),a=e.nodeValue;if(r=i.exec(a)){varo=r[1];for(a=a.substring(0,r.index)+a.substring(i.lastIndex),e.nodeValue=a;s=l.exec(o);)s[2]?t.setAttribute(s[1],s[2]):t.setAttribute(s[3],"");return!0}return!1}functiono(e,t,n,r,s){if(null!=t&&null!=t.childNodes&&t.childNodes.length>0)for(vari=t,l=0;l<t.childNodes.length;l++){varc=t.childNodes[l];if(l>0)for(varh=l-1;h>=0;){varp=t.childNodes[h];if("function"==typeofp.setAttribute&&"BR"!=p.tagName){i=p;break}h-=1}varu=e;"section"==c.nodeName&&(u=c,i=c),"function"!=typeofc.setAttribute&&c.nodeType!=Node.COMMENT_NODE||o(u,c,i,r,s)}t.nodeType==Node.COMMENT_NODE&&0==a(t,n,r)&&a(t,e,s)}functionc(){varn=e.getRevealElement().querySelectorAll("[data-markdown]:not([data-markdown-parsed])");return[].slice.call(n).forEach((function(e){e.setAttribute("data-markdown-parsed",!0);varn=e.querySelector("aside.notes"),r=t(e);e.innerHT