UNPKG

node-red-contrib-uibuilder

Version:

Easily create data-driven web UI's for Node-RED. Single- & Multi-page. Multiple UI's. Work with existing web development workflows or mix and match with no-code/low-code features.

1 lines 201 kB
(()=>{var bi=Object.create;var lt=Object.defineProperty;var yi=Object.getOwnPropertyDescriptor;var wi=Object.getOwnPropertyNames;var ki=Object.getPrototypeOf,xi=Object.prototype.hasOwnProperty;var Ee=(H,C)=>()=>(H&&(C=H(H=0)),C);var $n=(H,C)=>()=>(C||H((C={exports:{}}).exports,C),C.exports);var Si=(H,C,$,m)=>{if(C&&typeof C=="object"||typeof C=="function")for(let A of wi(C))!xi.call(H,A)&&A!==$&&lt(H,A,{get:()=>C[A],enumerable:!(m=yi(C,A))||m.enumerable});return H};var gt=(H,C,$)=>($=H!=null?bi(ki(H)):{},Si(C||!H||!H.__esModule?lt($,"default",{value:H,enumerable:!0}):$,H));var vt=Ee(()=>{(function(){function H(t){var n=Object.create(null);return function(e){var i=A(e)?e:JSON.stringify(e);return n[i]||(n[i]=t(e))}}var C=H(function(t){return t.replace(/([A-Z])/g,function(n){return"-"+n.toLowerCase()})}),$=Object.prototype.hasOwnProperty,m=Object.assign||function(t){for(var n=arguments,e=1;e<arguments.length;e++){var i,o=Object(n[e]);for(i in o)$.call(o,i)&&(t[i]=o[i])}return t};function A(t){return typeof t=="string"||typeof t=="number"}function b(){}function R(t){return typeof t=="function"}function G(t){var n=t.match(/^([^:/?#]+:)?(?:\/{2,}([^/?#]*))?([^?#]+)?(\?[^#]*)?(#.*)?/);return typeof n[1]=="string"&&0<n[1].length&&n[1].toLowerCase()!==location.protocol||typeof n[2]=="string"&&0<n[2].length&&n[2].replace(new RegExp(":("+{"http:":80,"https:":443}[location.protocol]+")?$"),"")!==location.host||!!/^\/\\/.test(t)}var te=document.body.clientWidth<=600,ie=window.history&&window.history.pushState&&window.history.replaceState&&!navigator.userAgent.match(/((iPod|iPhone|iPad).+\bOS\s+[1-4]\D|WebApps\/.+CFNetwork)/),ee={};function J(t,n){if(n===void 0&&(n=!1),typeof t=="string"){if(window.Vue!==void 0)return T(t);t=n?T(t):ee[t]||(ee[t]=T(t))}return t}var D=document,L=D.body,K=D.head;function T(t,n){return n?t.querySelector(n):D.querySelector(t)}function w(t,n){return[].slice.call(n?t.querySelectorAll(n):D.querySelectorAll(t))}function p(t,n){return t=D.createElement(t),n&&(t.innerHTML=n),t}function x(t,n){return t.appendChild(n)}function B(t,n){return t.insertBefore(n,t.children[0])}function F(t,n,e){R(n)?window.addEventListener(t,n):t.addEventListener(n,e)}function j(t,n,e){R(n)?window.removeEventListener(t,n):t.removeEventListener(n,e)}function M(t,n,e){t&&t.classList[e?n:"toggle"](e||n)}function l(t,n){var e=(n=n===void 0?document:n).readyState;if(e==="complete"||e==="interactive")return setTimeout(t,0);n.addEventListener("DOMContentLoaded",t)}var S=Object.freeze({__proto__:null,getNode:J,$:D,body:L,head:K,find:T,findAll:w,create:p,appendTo:x,before:B,on:F,off:j,toggleClass:M,style:function(t){x(K,p("style",t))},documentReady:l});function Z(t,n){return t.indexOf(n,t.length-n.length)!==-1}var N=decodeURIComponent,ne=encodeURIComponent;function V(t){var n={};return(t=t.trim().replace(/^(\?|#|&)/,""))&&t.split("&").forEach(function(e){e=e.replace(/\+/g," ").split("="),n[e[0]]=e[1]&&N(e[1])}),n}function Q(t,n){n===void 0&&(n=[]);var e,i=[];for(e in t)-1<n.indexOf(e)||i.push(t[e]?(ne(e)+"="+ne(t[e])).toLowerCase():ne(e));return i.length?"?"+i.join("&"):""}var ae=H(function(t){return/(:|(\/{2}))/g.test(t)}),ue=H(function(t){return t.split(/[?#]/)[0]}),re=H(function(t){return/\/$/g.test(t)?t:(t=t.match(/(\S*\/)[^/]+$/),t?t[1]:"")}),fe=H(function(t){return t.replace(/^\/+/,"/").replace(/([^:])\/{2,}/g,"$1/")}),pe=H(function(t){for(var n=t.replace(/^\//,"").split("/"),e=[],i=0,o=n.length;i<o;i++){var a=n[i];a===".."?e.pop():a!=="."&&e.push(a)}return"/"+e.join("/")});function Te(t){return t.split("/").filter(function(n){return n.indexOf("#")===-1}).join("/")}function le(){for(var t=[],n=arguments.length;n--;)t[n]=arguments[n];return fe(t.map(Te).join("/"))}var un=H(function(t){return t.replace("#","?id=")}),dn={};function ke(t){this.config=t}function Cn(t){var n=location.href.indexOf("#");location.replace(location.href.slice(0,0<=n?n:0)+"#"+t)}ke.prototype.getBasePath=function(){return this.config.basePath},ke.prototype.getFile=function(t,n){t===void 0&&(t=this.getCurrentPath());var e,i,o=this.config,a=this.getBasePath(),r=typeof o.ext=="string"?o.ext:".md";return t=o.alias?function c(u,s,d){var f=Object.keys(s).filter(function(E){return(dn[E]||(dn[E]=new RegExp("^"+E+"$"))).test(u)&&u!==d})[0];return f?c(u.replace(dn[f],s[f]),s,u):u}(t,o.alias):t,e=t,i=r,t=(t=new RegExp("\\.("+i.replace(/^\./,"")+"|html)$","g").test(e)?e:/\/$/g.test(e)?e+"README"+i:""+e+i)==="/README"+r&&o.homepage||t,t=ae(t)?t:le(a,t),t=n?t.replace(new RegExp("^"+a),""):t},ke.prototype.onchange=function(t){(t=t===void 0?b:t)()},ke.prototype.getCurrentPath=function(){},ke.prototype.normalize=function(){},ke.prototype.parse=function(){},ke.prototype.toURL=function(t,n,e){var i=e&&t[0]==="#",o=this.parse(un(t));return o.query=m({},o.query,n),t=(t=o.path+Q(o.query)).replace(/\.md(\?)|\.md$/,"$1"),i&&(t=(0<(i=e.indexOf("?"))?e.substring(0,i):e)+t),this.config.relativePath&&t.indexOf("/")!==0?(e=e.substring(0,e.lastIndexOf("/")+1),fe(pe(e+t))):fe("/"+t)};var zt=function(t){function n(e){t.call(this,e),this.mode="hash"}return t&&(n.__proto__=t),((n.prototype=Object.create(t&&t.prototype)).constructor=n).prototype.getBasePath=function(){var i=window.location.pathname||"",e=this.config.basePath,i=Z(i,".html")?i+"#/"+e:i+"/"+e;return/^(\/|https?:)/g.test(e)?e:fe(i)},n.prototype.getCurrentPath=function(){var e=location.href,i=e.indexOf("#");return i===-1?"":e.slice(i+1)},n.prototype.onchange=function(e){e===void 0&&(e=b);var i=!1;F("click",function(o){o=o.target.tagName==="A"?o.target:o.target.parentNode,o&&o.tagName==="A"&&!G(o.href)&&(i=!0)}),F("hashchange",function(o){var a=i?"navigate":"history";i=!1,e({event:o,source:a})})},n.prototype.normalize=function(){var e=this.getCurrentPath();if((e=un(e)).charAt(0)==="/")return Cn(e);Cn("/"+e)},n.prototype.parse=function(e){var i="",o=(e=e===void 0?location.href:e).indexOf("#"),o=(e=0<=o?e.slice(o+1):e).indexOf("?");return 0<=o&&(i=e.slice(o+1),e=e.slice(0,o)),{path:e,file:this.getFile(e,!0),query:V(i)}},n.prototype.toURL=function(e,i,o){return"#"+t.prototype.toURL.call(this,e,i,o)},n}(ke),Ct=function(t){function n(e){t.call(this,e),this.mode="history"}return t&&(n.__proto__=t),((n.prototype=Object.create(t&&t.prototype)).constructor=n).prototype.getCurrentPath=function(){var e=this.getBasePath(),i=window.location.pathname;return((i=e&&i.indexOf(e)===0?i.slice(e.length):i)||"/")+window.location.search+window.location.hash},n.prototype.onchange=function(e){e===void 0&&(e=b),F("click",function(i){var o=i.target.tagName==="A"?i.target:i.target.parentNode;o&&o.tagName==="A"&&!G(o.href)&&(i.preventDefault(),o=o.href,window.history.pushState({key:o},"",o),e({event:i,source:"navigate"}))}),F("popstate",function(i){e({event:i,source:"history"})})},n.prototype.parse=function(e){var i="",a=(e=e===void 0?location.href:e).indexOf("?");0<=a&&(i=e.slice(a+1),e=e.slice(0,a));var o=le(location.origin),a=e.indexOf(o);return{path:e=-1<a?e.slice(a+o.length):e,file:this.getFile(e),query:V(i)}},n}(ke),fn={},$e,Tn,Tt=/([^{]*?)\w(?=\})/g,sn={YYYY:"getFullYear",YY:"getYear",MM:function(t){return t.getMonth()+1},DD:"getDate",HH:"getHours",mm:"getMinutes",ss:"getSeconds",fff:"getMilliseconds"};function pn(t){var n,e=t.loaded,i=t.total,o=t.step;$e||((t=p("div")).classList.add("progress"),x(L,t),$e=t),n=o?80<(n=parseInt($e.style.width||0,10)+o)?80:n:Math.floor(e/i*100),$e.style.opacity=1,$e.style.width=95<=n?"100%":n+"%",95<=n&&(clearTimeout(Tn),Tn=setTimeout(function(a){$e.style.opacity=0,$e.style.width="0%"},200))}var Rn={};function Re(t,n,e){n===void 0&&(n=!1),e===void 0&&(e={});function i(){a.addEventListener.apply(a,arguments)}var o,a=new XMLHttpRequest,r=Rn[t];if(r)return{then:function(c){return c(r.content,r.opt)},abort:b};for(o in a.open("GET",t),e)$.call(e,o)&&a.setRequestHeader(o,e[o]);return a.send(),{then:function(c,u){var s;u===void 0&&(u=b),n&&(s=setInterval(function(d){return pn({step:Math.floor(5*Math.random()+1)})},500),i("progress",pn),i("loadend",function(d){pn(d),clearInterval(s)})),i("error",u),i("load",function(f){var f=f.target;400<=f.status?u(f):(f=Rn[t]={content:f.response,opt:{updatedAt:a.getResponseHeader("last-modified")}},c(f.content,f.opt))})},abort:function(c){return a.readyState!==4&&a.abort()}}}function Fn(t,n){t.innerHTML=t.innerHTML.replace(/var\(\s*--theme-color.*?\)/g,n)}var Ln=D.title;function jn(){var t,n=J("section.cover");n&&(t=n.getBoundingClientRect().height,window.pageYOffset>=t||n.classList.contains("hidden")?M(L,"add","sticky"):M(L,"remove","sticky"))}function Ue(t,n,e,i){var o=[];(n=J(n))!=null&&(o=w(n,"a"));var a,r=decodeURI(t.toURL(t.getCurrentPath()));return o.sort(function(c,u){return u.href.length-c.href.length}).forEach(function(c){var u=decodeURI(c.getAttribute("href")),s=e?c.parentNode:c;c.title=c.title||c.innerText,r.indexOf(u)!==0||a?M(s,"remove","active"):(a=c,M(s,"add","active"))}),i&&(D.title=a?a.title||a.innerText+" - "+Ln:Ln),a}function On(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var Rt=(function(t,n,e){return n&&On(t.prototype,n),e&&On(t,e),t}(ln,[{key:"getIntermediateValue",value:function(t){return this.decimal?t:Math.round(t)}},{key:"getFinalValue",value:function(){return this.end}}]),ln);function ln(){var t=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{};(function(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")})(this,ln),this.start=t.start,this.end=t.end,this.decimal=t.decimal}function Mn(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var Ft=(function(t,n,e){return n&&Mn(t.prototype,n),e&&Mn(t,e),t}(gn,[{key:"begin",value:function(){return this.isRunning||this.next===this.end||(this.frame=window.requestAnimationFrame(this._tick.bind(this))),this}},{key:"stop",value:function(){return window.cancelAnimationFrame(this.frame),this.isRunning=!1,this.frame=null,this.timeStart=null,this.next=null,this}},{key:"on",value:function(t,n){return this.events[t]=this.events[t]||[],this.events[t].push(n),this}},{key:"_emit",value:function(i,n){var e=this,i=this.events[i];i&&i.forEach(function(o){return o.call(e,n)})}},{key:"_tick",value:function(t){this.isRunning=!0;var n=this.next||this.start;this.timeStart||(this.timeStart=t),this.timeElapsed=t-this.timeStart,this.next=this.ease(this.timeElapsed,this.start,this.end-this.start,this.duration),this._shouldTick(n)?(this._emit("tick",this.tweener.getIntermediateValue(this.next)),this.frame=window.requestAnimationFrame(this._tick.bind(this))):(this._emit("tick",this.tweener.getFinalValue()),this._emit("done",null))}},{key:"_shouldTick",value:function(t){return{up:this.next<this.end&&t<=this.next,down:this.next>this.end&&t>=this.next}[this.direction]}},{key:"_defaultEase",value:function(t,n,e,i){return(t/=i/2)<1?e/2*t*t+n:-e/2*(--t*(t-2)-1)+n}}]),gn);function gn(){var t=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{};(function(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")})(this,gn),this.duration=t.duration||1e3,this.ease=t.easing||this._defaultEase,this.tweener=t.tweener||new Rt(t),this.start=this.tweener.start,this.end=this.tweener.end,this.frame=null,this.next=null,this.isRunning=!1,this.events={},this.direction=this.start<this.end?"up":"down"}var Lt=document.currentScript;function Nn(t){var n,e=m({auto2top:!1,autoHeader:!1,basePath:"",catchPluginErrors:!0,cornerExternalLinkTarget:"_blank",coverpage:"",el:"#app",executeScript:null,ext:".md",externalLinkRel:"noopener",externalLinkTarget:"_blank",formatUpdated:"",ga:"",homepage:"README.md",loadNavbar:null,loadSidebar:null,maxLevel:6,mergeNavbar:!1,name:"",nameLink:window.location.pathname,nativeEmoji:!1,noCompileLinks:[],noEmoji:!1,notFoundPage:!0,relativePath:!1,repo:"",routes:{},routerMode:"hash",subMaxLevel:0,themeColor:"",topMargin:0},typeof window.$docsify=="function"?window.$docsify(t):window.$docsify),i=Lt||[].slice.call(document.getElementsByTagName("script")).filter(function(a){return/docsify\./.test(a.src)})[0];if(i)for(var o in e)!$.call(e,o)||A(n=i.getAttribute("data-"+C(o)))&&(e[o]=n===""||n);return e.loadSidebar===!0&&(e.loadSidebar="_sidebar"+e.ext),e.loadNavbar===!0&&(e.loadNavbar="_navbar"+e.ext),e.coverpage===!0&&(e.coverpage="_coverpage"+e.ext),e.repo===!0&&(e.repo=""),e.name===!0&&(e.name=""),window.$docsify=e}var vn={},hn=!1,Ze=null,mn=!0,qn=0;function Pn(t){if(mn){for(var n,e=J(".sidebar"),i=w(".anchor"),o=T(e,".sidebar-nav"),a=T(e,"li.active"),r=document.documentElement,c=(r&&r.scrollTop||document.body.scrollTop)-qn,u=0,s=i.length;u<s;u+=1){var d=i[u];if(d.offsetTop>c){n=n||d;break}n=d}!n||(r=vn[_n(t,n.getAttribute("data-id"))])&&r!==a&&(a&&a.classList.remove("active"),r.classList.add("active"),a=r,!hn&&L.classList.contains("sticky")&&(t=e.clientHeight,r=a.offsetTop+a.clientHeight+40,a=a.offsetTop>=o.scrollTop&&r<=o.scrollTop+t,e.scrollTop=a?o.scrollTop:+r<t?0:r-t))}}function _n(t,n){return decodeURIComponent(t)+"?id="+decodeURIComponent(n)}function jt(t,n){var e,i;n&&(i=Nn().topMargin,(e=T("#"+n))&&(e=e,(i=i)===void 0&&(i=0),Ze&&Ze.stop(),mn=!1,Ze=new Ft({start:window.pageYOffset,end:Math.round(e.getBoundingClientRect().top)+window.pageYOffset-i,duration:500}).on("tick",function(o){return window.scrollTo(0,o)}).on("done",function(){mn=!0,Ze=null}).begin()),t=vn[_n(t,n)],(n=T(J(".sidebar"),"li.active"))&&n.classList.remove("active"),t&&t.classList.add("active"))}var Ot=D.scrollingElement||D.documentElement,Dn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function In(t,n){return t(n={exports:{}},n.exports),n.exports}function Hn(t){return Dt[t]}var ve=In(function(t){function n(){return{baseUrl:null,breaks:!1,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}}t.exports={defaults:n(),getDefaults:n,changeDefaults:function(e){t.exports.defaults=e}}}),Mt=(ve.defaults,ve.getDefaults,ve.changeDefaults,/[&<>"']/),Nt=/[&<>"']/g,qt=/[<>"']|&(?!#?\w+;)/,Pt=/[<>"']|&(?!#?\w+;)/g,Dt={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},It=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function Bn(t){return t.replace(It,function(n,e){return(e=e.toLowerCase())==="colon"?":":e.charAt(0)==="#"?e.charAt(1)==="x"?String.fromCharCode(parseInt(e.substring(2),16)):String.fromCharCode(+e.substring(1)):""})}var Ht=/(^|[^\[])\^/g,Bt=/[^\w:]/g,Ut=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i,Ve={},Zt=/^[^:]+:\/*[^/]*$/,Vt=/^([^:]+:)[\s\S]*$/,Yt=/^([^:]+:\/*[^/]*)[\s\S]*$/;function Gt(t,n){Ve[" "+t]||(Zt.test(t)?Ve[" "+t]=t+"/":Ve[" "+t]=Un(t,"/",!0));var e=(t=Ve[" "+t]).indexOf(":")===-1;return n.substring(0,2)==="//"?e?n:t.replace(Vt,"$1")+n:n.charAt(0)==="/"?e?n:t.replace(Yt,"$1")+n:t+n}function Un(t,n,e){var i=t.length;if(i===0)return"";for(var o=0;o<i;){var a=t.charAt(i-o-1);if(a!==n||e){if(a===n||!e)break;o++}else o++}return t.substr(0,i-o)}var ze=function(t,n){if(n){if(Mt.test(t))return t.replace(Nt,Hn)}else if(qt.test(t))return t.replace(Pt,Hn);return t},Xt=Bn,X=function(t,n){t=t.source||t,n=n||"";var e={replace:function(i,o){return o=(o=o.source||o).replace(Ht,"$1"),t=t.replace(i,o),e},getRegex:function(){return new RegExp(t,n)}};return e},Wt=function(t,n,e){if(t){var i;try{i=decodeURIComponent(Bn(e)).replace(Bt,"").toLowerCase()}catch{return null}if(i.indexOf("javascript:")===0||i.indexOf("vbscript:")===0||i.indexOf("data:")===0)return null}n&&!Ut.test(e)&&(e=Gt(n,e));try{e=encodeURI(e).replace(/%25/g,"%")}catch{return null}return e},xe={exec:function(){}},Zn=function(t){for(var n,e,i=arguments,o=1;o<arguments.length;o++)for(e in n=i[o])Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e]);return t},k=function(t,n){var e=t.replace(/\|/g,function(o,a,r){for(var c=!1,u=a;0<=--u&&r[u]==="\\";)c=!c;return c?"|":" |"}).split(/ \|/),i=0;if(e.length>n)e.splice(n);else for(;e.length<n;)e.push("");for(;i<e.length;i++)e[i]=e[i].trim().replace(/\\\|/g,"|");return e},Kt=Un,oe=function(t,n){if(t.indexOf(n[1])===-1)return-1;for(var e=t.length,i=0,o=0;o<e;o++)if(t[o]==="\\")o++;else if(t[o]===n[0])i++;else if(t[o]===n[1]&&--i<0)return o;return-1},Jt=function(t){t&&t.sanitize&&!t.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")},Qt=function(t,n){if(n<1)return"";for(var e="";1<n;)1&n&&(e+=t),n>>=1,t+=t;return e+t},ei=ve.defaults,bn=Kt,Ye=k,he=ze,ni=oe;function Vn(t,a,e){var i=a.href,o=a.title?he(a.title):null,a=t[1].replace(/\\([\[\]])/g,"$1");return t[0].charAt(0)!=="!"?{type:"link",raw:e,href:i,title:o,text:a}:{type:"image",raw:e,href:i,title:o,text:he(a)}}var yn=function(){function t(n){this.options=n||ei}return t.prototype.space=function(n){if(n=this.rules.block.newline.exec(n),n)return 1<n[0].length?{type:"space",raw:n[0]}:{raw:"\n"}},t.prototype.code=function(n,e){if(n=this.rules.block.code.exec(n),n)return e=e[e.length-1],e&&e.type==="paragraph"?{raw:n[0],text:n[0].trimRight()}:(e=n[0].replace(/^ {1,4}/gm,""),{type:"code",raw:n[0],codeBlockStyle:"indented",text:this.options.pedantic?e:bn(e,"\n")})},t.prototype.fences=function(n){var e=this.rules.block.fences.exec(n);if(e){var i=e[0],n=function(a,r){if((a=a.match(/^(\s+)(?:```)/))===null)return r;var c=a[1];return r.split("\n").map(function(u){var s=u.match(/^\s+/);return s!==null&&s[0].length>=c.length?u.slice(c.length):u}).join("\n")}(i,e[3]||"");return{type:"code",raw:i,lang:e[2]&&e[2].trim(),text:n}}},t.prototype.heading=function(n){var e=this.rules.block.heading.exec(n);if(e){var i=e[2].trim();return/#$/.test(i)&&(n=bn(i,"#"),!this.options.pedantic&&n&&!/ $/.test(n)||(i=n.trim())),{type:"heading",raw:e[0],depth:e[1].length,text:i}}},t.prototype.nptable=function(n){if(n=this.rules.block.nptable.exec(n),n){var e={type:"table",header:Ye(n[1].replace(/^ *| *\| *$/g,"")),align:n[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:n[3]?n[3].replace(/\n$/,"").split("\n"):[],raw:n[0]};if(e.header.length===e.align.length){for(var i=e.align.length,o=0;o<i;o++)/^ *-+: *$/.test(e.align[o])?e.align[o]="right":/^ *:-+: *$/.test(e.align[o])?e.align[o]="center":/^ *:-+ *$/.test(e.align[o])?e.align[o]="left":e.align[o]=null;for(i=e.cells.length,o=0;o<i;o++)e.cells[o]=Ye(e.cells[o],e.header.length);return e}}},t.prototype.hr=function(n){if(n=this.rules.block.hr.exec(n),n)return{type:"hr",raw:n[0]}},t.prototype.blockquote=function(n){var e=this.rules.block.blockquote.exec(n);if(e)return n=e[0].replace(/^ *> ?/gm,""),{type:"blockquote",raw:e[0],text:n}},t.prototype.list=function(n){if(n=this.rules.block.list.exec(n),n){for(var e,i,o,a,r,c=n[0],u=n[2],s=1<u.length,d={type:"list",raw:c,ordered:s,start:s?+u.slice(0,-1):"",loose:!1,items:[]},f=n[0].match(this.rules.block.item),E=!1,_=f.length,y=this.rules.block.listItemStart.exec(f[0]),q=0;q<_;q++){if(c=e=f[q],q!==_-1){if(o=this.rules.block.listItemStart.exec(f[q+1]),this.options.pedantic?o[1].length>y[1].length:o[1].length>y[0].length||3<o[1].length){f.splice(q,2,f[q]+"\n"+f[q+1]),q--,_--;continue}(!this.options.pedantic||this.options.smartLists?o[2][o[2].length-1]!==u[u.length-1]:s==(o[2].length===1))&&(i=f.slice(q+1).join("\n"),d.raw=d.raw.substring(0,d.raw.length-i.length),q=_-1),y=o}o=e.length,~(e=e.replace(/^ *([*+-]|\d+[.)]) ?/,"")).indexOf("\n ")&&(o-=e.length,e=this.options.pedantic?e.replace(/^ {1,4}/gm,""):e.replace(new RegExp("^ {1,"+o+"}","gm"),"")),o=E||/\n\n(?!\s*$)/.test(e),q!==_-1&&(E=e.charAt(e.length-1)==="\n",o=o||E),o&&(d.loose=!0),this.options.gfm&&(r=void 0,(a=/^\[[ xX]\] /.test(e))&&(r=e[1]!==" ",e=e.replace(/^\[[ xX]\] +/,""))),d.items.push({type:"list_item",raw:c,task:a,checked:r,loose:o,text:e})}return d}},t.prototype.html=function(n){if(n=this.rules.block.html.exec(n),n)return{type:this.options.sanitize?"paragraph":"html",raw:n[0],pre:!this.options.sanitizer&&(n[1]==="pre"||n[1]==="script"||n[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):he(n[0]):n[0]}},t.prototype.def=function(n){if(n=this.rules.block.def.exec(n),n)return n[3]&&(n[3]=n[3].substring(1,n[3].length-1)),{tag:n[1].toLowerCase().replace(/\s+/g," "),raw:n[0],href:n[2],title:n[3]}},t.prototype.table=function(n){if(n=this.rules.block.table.exec(n),n){var e={type:"table",header:Ye(n[1].replace(/^ *| *\| *$/g,"")),align:n[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:n[3]?n[3].replace(/\n$/,"").split("\n"):[]};if(e.header.length===e.align.length){e.raw=n[0];for(var i=e.align.length,o=0;o<i;o++)/^ *-+: *$/.test(e.align[o])?e.align[o]="right":/^ *:-+: *$/.test(e.align[o])?e.align[o]="center":/^ *:-+ *$/.test(e.align[o])?e.align[o]="left":e.align[o]=null;for(i=e.cells.length,o=0;o<i;o++)e.cells[o]=Ye(e.cells[o].replace(/^ *\| *| *\| *$/g,""),e.header.length);return e}}},t.prototype.lheading=function(n){if(n=this.rules.block.lheading.exec(n),n)return{type:"heading",raw:n[0],depth:n[2].charAt(0)==="="?1:2,text:n[1]}},t.prototype.paragraph=function(n){if(n=this.rules.block.paragraph.exec(n),n)return{type:"paragraph",raw:n[0],text:n[1].charAt(n[1].length-1)==="\n"?n[1].slice(0,-1):n[1]}},t.prototype.text=function(n,e){if(n=this.rules.block.text.exec(n),n)return e=e[e.length-1],e&&e.type==="text"?{raw:n[0],text:n[0]}:{type:"text",raw:n[0],text:n[0]}},t.prototype.escape=function(n){if(n=this.rules.inline.escape.exec(n),n)return{type:"escape",raw:n[0],text:he(n[1])}},t.prototype.tag=function(n,e,i){if(n=this.rules.inline.tag.exec(n),n)return!e&&/^<a /i.test(n[0])?e=!0:e&&/^<\/a>/i.test(n[0])&&(e=!1),!i&&/^<(pre|code|kbd|script)(\s|>)/i.test(n[0])?i=!0:i&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(n[0])&&(i=!1),{type:this.options.sanitize?"text":"html",raw:n[0],inLink:e,inRawBlock:i,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):he(n[0]):n[0]}},t.prototype.link=function(n){var e=this.rules.inline.link.exec(n);if(e){if(n=e[2].trim(),!this.options.pedantic&&/^</.test(n)){if(!/>$/.test(n))return;var o=bn(n.slice(0,-1),"\\");if((n.length-o.length)%2==0)return}else{var a=ni(e[2],"()");-1<a&&(i=(e[0].indexOf("!")===0?5:4)+e[1].length+a,e[2]=e[2].substring(0,a),e[0]=e[0].substring(0,i).trim(),e[3]="")}var i,o=e[2],a="";return this.options.pedantic?(i=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(o))&&(o=i[1],a=i[3]):a=e[3]?e[3].slice(1,-1):"",o=o.trim(),Vn(e,{href:(o=/^</.test(o)?this.options.pedantic&&!/>$/.test(n)?o.slice(1):o.slice(1,-1):o)&&o.replace(this.rules.inline._escapes,"$1"),title:a&&a.replace(this.rules.inline._escapes,"$1")},e[0])}},t.prototype.reflink=function(n,e){if((i=this.rules.inline.reflink.exec(n))||(i=this.rules.inline.nolink.exec(n))){var n=(i[2]||i[1]).replace(/\s+/g," ");if((n=e[n.toLowerCase()])&&n.href)return Vn(i,n,i[0]);var i=i[0].charAt(0);return{type:"text",raw:i,text:i}}},t.prototype.strong=function(n,e,i){i===void 0&&(i="");var o=this.rules.inline.strong.start.exec(n);if(o&&(!o[1]||o[1]&&(i===""||this.rules.inline.punctuation.exec(i)))){e=e.slice(-1*n.length);var a,r=o[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;for(r.lastIndex=0;(o=r.exec(e))!=null;)if(a=this.rules.inline.strong.middle.exec(e.slice(0,o.index+3)))return{type:"strong",raw:n.slice(0,a[0].length),text:n.slice(2,a[0].length-2)}}},t.prototype.em=function(n,e,i){i===void 0&&(i="");var o=this.rules.inline.em.start.exec(n);if(o&&(!o[1]||o[1]&&(i===""||this.rules.inline.punctuation.exec(i)))){e=e.slice(-1*n.length);var a,r=o[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;for(r.lastIndex=0;(o=r.exec(e))!=null;)if(a=this.rules.inline.em.middle.exec(e.slice(0,o.index+2)))return{type:"em",raw:n.slice(0,a[0].length),text:n.slice(1,a[0].length-1)}}},t.prototype.codespan=function(n){var e=this.rules.inline.code.exec(n);if(e){var i=e[2].replace(/\n/g," "),o=/[^ ]/.test(i),n=/^ /.test(i)&&/ $/.test(i);return o&&n&&(i=i.substring(1,i.length-1)),i=he(i,!0),{type:"codespan",raw:e[0],text:i}}},t.prototype.br=function(n){if(n=this.rules.inline.br.exec(n),n)return{type:"br",raw:n[0]}},t.prototype.del=function(n){if(n=this.rules.inline.del.exec(n),n)return{type:"del",raw:n[0],text:n[2]}},t.prototype.autolink=function(n,e){if(n=this.rules.inline.autolink.exec(n),n){var i,e=n[2]==="@"?"mailto:"+(i=he(this.options.mangle?e(n[1]):n[1])):i=he(n[1]);return{type:"link",raw:n[0],text:i,href:e,tokens:[{type:"text",raw:i,text:i}]}}},t.prototype.url=function(n,e){var i,o,a,r;if(i=this.rules.inline.url.exec(n)){if(i[2]==="@")a="mailto:"+(o=he(this.options.mangle?e(i[0]):i[0]));else{for(;r=i[0],i[0]=this.rules.inline._backpedal.exec(i[0])[0],r!==i[0];);o=he(i[0]),a=i[1]==="www."?"http://"+o:o}return{type:"link",raw:i[0],text:o,href:a,tokens:[{type:"text",raw:o,text:o}]}}},t.prototype.inlineText=function(n,e,i){if(n=this.rules.inline.text.exec(n),n)return i=e?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):he(n[0]):n[0]:he(this.options.smartypants?i(n[0]):n[0]),{type:"text",raw:n[0],text:i}},t}(),k=xe,oe=X,xe=Zn,X={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?! {0,3}bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\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{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:k,table:k,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};X.def=oe(X.def).replace("label",X._label).replace("title",X._title).getRegex(),X.bullet=/(?:[*+-]|\d{1,9}[.)])/,X.item=/^( *)(bull) ?[^\n]*(?:\n(?! *bull ?)[^\n]*)*/,X.item=oe(X.item,"gm").replace(/bull/g,X.bullet).getRegex(),X.listItemStart=oe(/^( *)(bull)/).replace("bull",X.bullet).getRegex(),X.list=oe(X.list).replace(/bull/g,X.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+X.def.source+")").getRegex(),X._tag="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|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",X._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,X.html=oe(X.html,"i").replace("comment",X._comment).replace("tag",X._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),X.paragraph=oe(X._paragraph).replace("hr",X.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",X._tag).getRegex(),X.blockquote=oe(X.blockquote).replace("paragraph",X.paragraph).getRegex(),X.normal=xe({},X),X.gfm=xe({},X.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n {0,3}([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n {0,3}\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),X.gfm.nptable=oe(X.gfm.nptable).replace("hr",X.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",X._tag).getRegex(),X.gfm.table=oe(X.gfm.table).replace("hr",X.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",X._tag).getRegex(),X.pedantic=xe({},X.normal,{html:oe("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",X._comment).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:k,paragraph:oe(X.normal._paragraph).replace("hr",X.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",X.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()}),k={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:k,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",strong:{start:/^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/,middle:/^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,endAst:/[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation_\s]|$))/,endUnd:/[^\s]__(?!_)(?:(?=[punctuation*\s])|$)/},em:{start:/^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/,middle:/^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,endAst:/[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation_\s]|$))/,endUnd:/[^\s]_(?!_)(?:(?=[punctuation*\s])|$)/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:k,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\s*punctuation])/,_punctuation:"!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~"},k.punctuation=oe(k.punctuation).replace(/punctuation/g,k._punctuation).getRegex(),k._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",k._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",k._comment=oe(X._comment).replace("(?:-->|$)","-->").getRegex(),k.em.start=oe(k.em.start).replace(/punctuation/g,k._punctuation).getRegex(),k.em.middle=oe(k.em.middle).replace(/punctuation/g,k._punctuation).replace(/overlapSkip/g,k._overlapSkip).getRegex(),k.em.endAst=oe(k.em.endAst,"g").replace(/punctuation/g,k._punctuation).getRegex(),k.em.endUnd=oe(k.em.endUnd,"g").replace(/punctuation/g,k._punctuation).getRegex(),k.strong.start=oe(k.strong.start).replace(/punctuation/g,k._punctuation).getRegex(),k.strong.middle=oe(k.strong.middle).replace(/punctuation/g,k._punctuation).replace(/overlapSkip/g,k._overlapSkip).getRegex(),k.strong.endAst=oe(k.strong.endAst,"g").replace(/punctuation/g,k._punctuation).getRegex(),k.strong.endUnd=oe(k.strong.endUnd,"g").replace(/punctuation/g,k._punctuation).getRegex(),k.blockSkip=oe(k._blockSkip,"g").getRegex(),k.overlapSkip=oe(k._overlapSkip,"g").getRegex(),k._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,k._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,k._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])?)+(?![-_])/,k.autolink=oe(k.autolink).replace("scheme",k._scheme).replace("email",k._email).getRegex(),k._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,k.tag=oe(k.tag).replace("comment",k._comment).replace("attribute",k._attribute).getRegex(),k._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,k._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,k._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,k.link=oe(k.link).replace("label",k._label).replace("href",k._href).replace("title",k._title).getRegex(),k.reflink=oe(k.reflink).replace("label",k._label).getRegex(),k.reflinkSearch=oe(k.reflinkSearch,"g").replace("reflink",k.reflink).replace("nolink",k.nolink).getRegex(),k.normal=xe({},k),k.pedantic=xe({},k.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:oe(/^!?\[(label)\]\((.*?)\)/).replace("label",k._label).getRegex(),reflink:oe(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",k._label).getRegex()}),k.gfm=xe({},k.normal,{escape:oe(k.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*~]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))/}),k.gfm.url=oe(k.gfm.url,"i").replace("email",k.gfm._extended_email).getRegex(),k.breaks=xe({},k.gfm,{br:oe(k.br).replace("{2,}","*").getRegex(),text:oe(k.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var k={block:X,inline:k},ti=ve.defaults,Ge=k.block,Me=k.inline,Yn=Qt;function ii(t){return t.replace(/---/g,"\u2014").replace(/--/g,"\u2013").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1\u2018").replace(/'/g,"\u2019").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1\u201C").replace(/"/g,"\u201D").replace(/\.{3}/g,"\u2026")}function Gn(t){for(var n,e="",i=t.length,o=0;o<i;o++)n=t.charCodeAt(o),e+="&#"+(n=.5<Math.random()?"x"+n.toString(16):n)+";";return e}var Ne=function(){function t(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||ti,this.options.tokenizer=this.options.tokenizer||new yn,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,e={block:Ge.normal,inline:Me.normal},this.options.pedantic?(e.block=Ge.pedantic,e.inline=Me.pedantic):this.options.gfm&&(e.block=Ge.gfm,this.options.breaks?e.inline=Me.breaks:e.inline=Me.gfm),this.tokenizer.rules=e}var n={rules:{configurable:!0}};return n.rules.get=function(){return{block:Ge,inline:Me}},t.lex=function(e,i){return new t(i).lex(e)},t.lexInline=function(e,i){return new t(i).inlineTokens(e)},t.prototype.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," "),this.blockTokens(e,this.tokens,!0),this.inline(this.tokens),this.tokens},t.prototype.blockTokens=function(e,i,o){var a,r,c,u;for(i===void 0&&(i=[]),o===void 0&&(o=!0),this.options.pedantic&&(e=e.replace(/^ +$/gm,""));e;)if(a=this.tokenizer.space(e))e=e.substring(a.raw.length),a.type&&i.push(a);else if(a=this.tokenizer.code(e,i))e=e.substring(a.raw.length),a.type?i.push(a):((u=i[i.length-1]).raw+="\n"+a.raw,u.text+="\n"+a.text);else if(a=this.tokenizer.fences(e))e=e.substring(a.raw.length),i.push(a);else if(a=this.tokenizer.heading(e))e=e.substring(a.raw.length),i.push(a);else if(a=this.tokenizer.nptable(e))e=e.substring(a.raw.length),i.push(a);else if(a=this.tokenizer.hr(e))e=e.substring(a.raw.length),i.push(a);else if(a=this.tokenizer.blockquote(e))e=e.substring(a.raw.length),a.tokens=this.blockTokens(a.text,[],o),i.push(a);else if(a=this.tokenizer.list(e)){for(e=e.substring(a.raw.length),c=a.items.length,r=0;r<c;r++)a.items[r].tokens=this.blockTokens(a.items[r].text,[],!1);i.push(a)}else if(a=this.tokenizer.html(e))e=e.substring(a.raw.length),i.push(a);else if(o&&(a=this.tokenizer.def(e)))e=e.substring(a.raw.length),this.tokens.links[a.tag]||(this.tokens.links[a.tag]={href:a.href,title:a.title});else if(a=this.tokenizer.table(e))e=e.substring(a.raw.length),i.push(a);else if(a=this.tokenizer.lheading(e))e=e.substring(a.raw.length),i.push(a);else if(o&&(a=this.tokenizer.paragraph(e)))e=e.substring(a.raw.length),i.push(a);else if(a=this.tokenizer.text(e,i))e=e.substring(a.raw.length),a.type?i.push(a):((u=i[i.length-1]).raw+="\n"+a.raw,u.text+="\n"+a.text);else if(e){var s="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(s);break}throw new Error(s)}return i},t.prototype.inline=function(e){for(var i,o,a,r,c,u=e.length,s=0;s<u;s++)switch((c=e[s]).type){case"paragraph":case"text":case"heading":c.tokens=[],this.inlineTokens(c.text,c.tokens);break;case"table":for(c.tokens={header:[],cells:[]},a=c.header.length,i=0;i<a;i++)c.tokens.header[i]=[],this.inlineTokens(c.header[i],c.tokens.header[i]);for(a=c.cells.length,i=0;i<a;i++)for(r=c.cells[i],c.tokens.cells[i]=[],o=0;o<r.length;o++)c.tokens.cells[i][o]=[],this.inlineTokens(r[o],c.tokens.cells[i][o]);break;case"blockquote":this.inline(c.tokens);break;case"list":for(a=c.items.length,i=0;i<a;i++)this.inline(c.items[i].tokens)}return e},t.prototype.inlineTokens=function(e,i,o,a){var r;i===void 0&&(i=[]),o===void 0&&(o=!1),a===void 0&&(a=!1);var c,u,s,d=e;if(this.tokens.links){var f=Object.keys(this.tokens.links);if(0<f.length)for(;(c=this.tokenizer.rules.inline.reflinkSearch.exec(d))!=null;)f.includes(c[0].slice(c[0].lastIndexOf("[")+1,-1))&&(d=d.slice(0,c.index)+"["+Yn("a",c[0].length-2)+"]"+d.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(c=this.tokenizer.rules.inline.blockSkip.exec(d))!=null;)d=d.slice(0,c.index)+"["+Yn("a",c[0].length-2)+"]"+d.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;e;)if(u||(s=""),u=!1,r=this.tokenizer.escape(e))e=e.substring(r.raw.length),i.push(r);else if(r=this.tokenizer.tag(e,o,a))e=e.substring(r.raw.length),o=r.inLink,a=r.inRawBlock,i.push(r);else if(r=this.tokenizer.link(e))e=e.substring(r.raw.length),r.type==="link"&&(r.tokens=this.inlineTokens(r.text,[],!0,a)),i.push(r);else if(r=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(r.raw.length),r.type==="link"&&(r.tokens=this.inlineTokens(r.text,[],!0,a)),i.push(r);else if(r=this.tokenizer.strong(e,d,s))e=e.substring(r.raw.length),r.tokens=this.inlineTokens(r.text,[],o,a),i.push(r);else if(r=this.tokenizer.em(e,d,s))e=e.substring(r.raw.length),r.tokens=this.inlineTokens(r.text,[],o,a),i.push(r);else if(r=this.tokenizer.codespan(e))e=e.substring(r.raw.length),i.push(r);else if(r=this.tokenizer.br(e))e=e.substring(r.raw.length),i.push(r);else if(r=this.tokenizer.del(e))e=e.substring(r.raw.length),r.tokens=this.inlineTokens(r.text,[],o,a),i.push(r);else if(r=this.tokenizer.autolink(e,Gn))e=e.substring(r.raw.length),i.push(r);else if(o||!(r=this.tokenizer.url(e,Gn))){if(r=this.tokenizer.inlineText(e,a,ii))e=e.substring(r.raw.length),s=r.raw.slice(-1),u=!0,i.push(r);else if(e){var E="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(E);break}throw new Error(E)}}else e=e.substring(r.raw.length),i.push(r);return i},Object.defineProperties(t,n),t}(),oi=ve.defaults,Xn=Wt,Xe=ze,wn=function(){function t(n){this.options=n||oi}return t.prototype.code=function(n,e,i){var o=(e||"").match(/\S*/)[0];return!this.options.highlight||(e=this.options.highlight(n,o))!=null&&e!==n&&(i=!0,n=e),n=n.replace(/\n$/,"")+"\n",o?'<pre><code class="'+this.options.langPrefix+Xe(o,!0)+'">'+(i?n:Xe(n,!0))+"</code></pre>\n":"<pre><code>"+(i?n:Xe(n,!0))+"</code></pre>\n"},t.prototype.blockquote=function(n){return"<blockquote>\n"+n+"</blockquote>\n"},t.prototype.html=function(n){return n},t.prototype.heading=function(n,e,i,o){return this.options.headerIds?"<h"+e+' id="'+this.options.headerPrefix+o.slug(i)+'">'+n+"</h"+e+">\n":"<h"+e+">"+n+"</h"+e+">\n"},t.prototype.hr=function(){return this.options.xhtml?"<hr/>\n":"<hr>\n"},t.prototype.list=function(n,e,i){var o=e?"ol":"ul";return"<"+o+(e&&i!==1?' start="'+i+'"':"")+">\n"+n+"</"+o+">\n"},t.prototype.listitem=function(n){return"<li>"+n+"</li>\n"},t.prototype.checkbox=function(n){return"<input "+(n?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},t.prototype.paragraph=function(n){return"<p>"+n+"</p>\n"},t.prototype.table=function(n,e){return"<table>\n<thead>\n"+n+"</thead>\n"+(e=e&&"<tbody>"+e+"</tbody>")+"</table>\n"},t.prototype.tablerow=function(n){return"<tr>\n"+n+"</tr>\n"},t.prototype.tablecell=function(n,e){var i=e.header?"th":"td";return(e.align?"<"+i+' align="'+e.align+'">':"<"+i+">")+n+"</"+i+">\n"},t.prototype.strong=function(n){return"<strong>"+n+"</strong>"},t.prototype.em=function(n){return"<em>"+n+"</em>"},t.prototype.codespan=function(n){return"<code>"+n+"</code>"},t.prototype.br=function(){return this.options.xhtml?"<br/>":"<br>"},t.prototype.del=function(n){return"<del>"+n+"</del>"},t.prototype.link=function(n,e,i){return(n=Xn(this.options.sanitize,this.options.baseUrl,n))===null?i:(n='<a href="'+Xe(n)+'"',e&&(n+=' title="'+e+'"'),n+=">"+i+"</a>")},t.prototype.image=function(n,e,i){return(n=Xn(this.options.sanitize,this.options.baseUrl,n))===null?i:(i='<img src="'+n+'" alt="'+i+'"',e&&(i+=' title="'+e+'"'),i+=this.options.xhtml?"/>":">")},t.prototype.text=function(n){return n},t}(),Wn=function(){function t(){}return t.prototype.strong=function(n){return n},t.prototype.em=function(n){return n},t.prototype.codespan=function(n){return n},t.prototype.del=function(n){return n},t.prototype.html=function(n){return n},t.prototype.text=function(n){return n},t.prototype.link=function(n,e,i){return""+i},t.prototype.image=function(n,e,i){return""+i},t.prototype.br=function(){return""},t}(),Kn=function(){function t(){this.seen={}}return t.prototype.serialize=function(n){return n.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},t.prototype.getNextSafeSlug=function(n,e){var i=n,o=0;if(this.seen.hasOwnProperty(i))for(o=this.seen[n];i=n+"-"+ ++o,this.seen.hasOwnProperty(i););return e||(this.seen[n]=o,this.seen[i]=0),i},t.prototype.slug=function(n,e){return e===void 0&&(e={}),n=this.serialize(n),this.getNextSafeSlug(n,e.dryrun)},t}(),ai=ve.defaults,ri=Xt,qe=function(){function t(n){this.options=n||ai,this.options.renderer=this.options.renderer||new wn,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Wn,this.slugger=new Kn}return t.parse=function(n,e){return new t(e).parse(n)},t.parseInline=function(n,e){return new t(e).parseInline(n)},t.prototype.parse=function(n,e){e===void 0&&(e=!0);for(var i,o,a,r,c,u,s,d,f,E,_,y,q,I,Y,z="",g=n.length,v=0;v<g;v++)switch((d=n[v]).type){case"space":continue;case"hr":z+=this.renderer.hr();continue;case"heading":z+=this.renderer.heading(this.parseInline(d.tokens),d.depth,ri(this.parseInline(d.tokens,this.textRenderer)),this.slugger);continue;case"code":z+=this.renderer.code(d.text,d.lang,d.escaped);continue;case"table":for(u=f="",a=d.header.length,i=0;i<a;i++)u+=this.renderer.tablecell(this.parseInline(d.tokens.header[i]),{header:!0,align:d.align[i]});for(f+=this.renderer.tablerow(u),s="",a=d.cells.length,i=0;i<a;i++){for(u="",r=(c=d.tokens.cells[i]).length,o=0;o<r;o++)u+=this.renderer.tablecell(this.parseInline(c[o]),{header:!1,align:d.align[o]});s+=this.renderer.tablerow(u)}z+=this.renderer.table(f,s);continue;case"blockquote":s=this.parse(d.tokens),z+=this.renderer.blockquote(s);continue;case"list":for(f=d.ordered,h=d.start,E=d.loose,a=d.items.length,s="",i=0;i<a;i++)q=(y=d.items[i]).checked,I=y.task,_="",y.task&&(Y=this.renderer.checkbox(q),E?0<y.tokens.length&&y.tokens[0].type==="text"?(y.tokens[0].text=Y+" "+y.tokens[0].text,y.tokens[0].tokens&&0<y.tokens[0].tokens.length&&y.tokens[0].tokens[0].type==="text"&&(y.tokens[0].tokens[0].text=Y+" "+y.tokens[0].tokens[0].text)):y.tokens.unshift({type:"text",text:Y}):_+=Y),_+=this.parse(y.tokens,E),s+=this.renderer.listitem(_,I,q);z+=this.renderer.list(s,f,h);continue;case"html":z+=this.renderer.html(d.text);continue;case"paragraph":z+=this.renderer.paragraph(this.parseInline(d.tokens));continue;case"text":for(s=d.tokens?this.parseInline(d.tokens):d.text;v+1<g&&n[v+1].type==="text";)s+="\n"+((d=n[++v]).tokens?this.parseInline(d.tokens):d.text);z+=e?this.renderer.paragraph(s):s;continue;default:var h='Token with "'+d.type+'" type was not found.';if(this.options.silent)return void console.error(h);throw new Error(h)}return z},t.prototype.parseInline=function(n,e){e=e||this.renderer;for(var i,o="",a=n.length,r=0;r<a;r++)switch((i=n[r]).type){case"escape":o+=e.text(i.text);break;case"html":o+=e.html(i.text);break;case"link":o+=e.link(i.href,i.title,this.parseInline(i.tokens,e));break;case"image":o+=e.image(i.href,i.title,i.text);break;case"strong":o+=e.strong(this.parseInline(i.tokens,e));break;case"em":o+=e.em(this.parseInline(i.tokens,e));break;case"codespan":o+=e.codespan(i.text);break;case"br":o+=e.br();break;case"del":o+=e.del(this.parseInline(i.tokens,e));break;case"text":o+=e.text(i.text);break;default:var c='Token with "'+i.type+'" type was not found.';if(this.options.silent)return void console.error(c);throw new Error(c)}return o},t}(),We=Zn,Jn=Jt,Qn=ze,ze=ve.getDefaults,ci=ve.changeDefaults,ve=ve.defaults;function de(t,n,e){if(t==null)throw new Error("marked(): input parameter is undefined or null");if(typeof t!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected");if(typeof n=="function"&&(e=n,n=null),n=We({},de.defaults,n||{}),Jn(n),e){let u=function(s){var d;if(!s)try{d=qe.parse(i,n)}catch(f){s=f}return n.highlight=o,s?e(s):e(null,d)};var c=u,i,o=n.highlight;try{i=Ne.lex(t,n)}catch(s){return e(s)}if(!o||o.length<3||(delete n.highlight,!i.length))return u();var a=0;return de.walkTokens(i,function(s){s.type==="code"&&(a++,setTimeout(function(){o(s.text,s.lang,function(d,f){return d?u(d):(f!=null&&f!==s.text&&(s.text=f,s.escaped=!0),void(--a===0&&u()))})},0))}),void(a===0&&u())}try{var r=Ne.lex(t,n);return n.walkTokens&&de.walkTokens(r,n.walkTokens),qe.parse(r,n)}catch(u){if(u.message+="\nPlease report this to https://github.com/markedjs/marked.",n.silent)return"<p>An error occurred:</p><pre>"+Qn(u.message+"",!0)+"</pre>";throw u}}de.options=de.setOptions=function(t){return We(de.defaults,t),ci(de.defaults),de},de.getDefaults=ze,de.defaults=ve,de.use=function(t){var n,e=We({},t);if(t.renderer){var i,o=de.defaults.renderer||new wn;for(i in t.renderer)(function(c){var u=o[c];o[c]=function(){for(var s=[],d=arguments.length;d--;)s[d]=arguments[d];var f=t.renderer[c].apply(o,s);return f=f===!1?u.apply(o,s):f}})(i);e.renderer=o}if(t.tokenizer){var a,r=de.defaults.tokenizer||new yn;for(a in t.tokenizer)(function(){var c=r[a];r[a]=function(){for(var u=[],s=arguments.length;s--;)u[s]=arguments[s];var d=t.tokenizer[a].apply(r,u);return d=d===!1?c.apply(r,u):d}})();e.tokenizer=r}t.walkTokens&&(n=de.defaults.walkTokens,e.walkTokens=function(c){t.walkTokens(c),n&&n(c)}),de.setOptions(e)},de.walkTokens=function(t,n){for(var e=0,i=t;e<i.length;e+=1){var o=i[e];switch(n(o),o.type){case"table":for(var a=0,r=o.tokens.header;a<r.length;a+=1){var c=r[a];de.walkTokens(c,n)}for(var u=0,s=o.tokens.cells;u<s.length;u+=1)for(var d=0,f=s[u];d<f.length;d+=1){var E=f[d];de.walkTokens(E,n)}break;case"list":de.walkTokens(o.items,n);break;default:o.tokens&&de.walkTokens(o.tokens,n)}}},de.parseInline=function(t,n){if(t==null)throw new Error("marked.parseInline(): input parameter is undefined or null");if(typeof t!="string")throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected");n=We({},de.defaults,n||{}),Jn(n);try{var e=Ne.lexInline(t,n);return n.walkTokens&&de.walkTokens(e,n.walkTokens),qe.parseInline(e,n)}catch(i){if(i.message+="\nPlease report this to https://github.com/markedjs/marked.",n.silent)return"<p>An error occurred:</p><pre>"+Qn(i.message+"",!0)+"</pre>";throw i}},de.Parser=qe,de.parser=qe.parse,de.Renderer=wn,de.TextRenderer=Wn,de.Lexer=Ne,de.lexer=Ne.lex,de.Tokenizer=yn,de.Slugger=Kn;var Pe=de.parse=de;function kn(t,n){if(n===void 0&&(n='<ul class="app-sub-sidebar">{inner}</ul>'),!t||!t.length)return"";var e="";return t.forEach(function(i){var o=i.title.replace(/(<([^>]+)>)/g,"");e+='<li><a class="section-link" href="'+i.slug+'" title="'+o+'">'+i.title+"</a></li>",i.children&&(e+=kn(i.children,n))}),n.replace("{inner}",e)}function et(t,n){return'<p class="'+t+'">'+n.slice(5).trim()+"</p>"}function nt(t,n){var e=[],i={};return t.forEach(function(o){var a=o.level||1,r=a-1;n<a||(i[r]?i[r].children=(i[r].children||[]).concat(o):e.push(o),i[a]=o)}),e}var Ke={},ui=/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g;function di(t){return t.toLowerCase()}function Je(e){if(typeof e!="string")return"";var n=e.trim().replace(/[A-Z]+/g,di).replace(/<[^>]+>/g,"").replace(ui,"").replace(/\s/g,"-").replac