PageSourceSearch

https://metallab.ai/_next/static/chunks/27166076.3aac92bb6dc111b8.js

js metallab.ai collected 2026-10-05 12:15:49 UTC 339,651 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[774],{69010:(e,t,n)=>{n.r(t),n.d(t,{Editor:()=>uh,EditorCore:()=>lT,default:()=>uh});var r,o,i,a,s,l,u,c,p,d,f,h,m,v,g,y,b,w,k,C,x,T,E,M,L,N,S,A,D,I,O,R,P,H,B,F,q,_=n(92322),j=n(32806),z=n(62463),U=n(51876),V=n(24945),$=n(72107),W=n(93900),G=n(1441),K=function(e,t){return(K=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function Z(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}K(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var X=function(){return(X=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function Q(e,t,n){if(n||2==arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}function Y(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var J=function(e,t,n){var r;for(r in n=n||null,e)if(e.hasOwnProperty(r)&&!1===t.call(n,e[r],r,e))break},ee=function(e,t){var n,r,o,i,a=Object.prototype.hasOwnProperty;for(o=1,i=arguments.length;o<i;o+=1)for(r in n=arguments[o])a.call(n,r)&&(e[r]=n[r]);return e},et=function(e){return"string"==typeof e||e instanceof String},en=function(e){return e instanceof Array},er=function(e,t,n){var r=0,o=e.length;for(n=n||null;r<o&&!1!==t.call(n,e[r],r,e);r+=1);},eo=function(e,t,n){en(e)?er(e,t,n):J(e,t,n)},ei=function(e,t,n){var r=e.style;if(et(t)){r[t]=n;return}eo(t,function(e,t){r[t]=e})},ea=function(e,t,n){var r,o;if(n=n||0,!en(t))return -1;if(Array.prototype.indexOf)return Array.prototype.indexOf.call(t,e,n);for(o=t.length,r=n;n>=0&&r<o;r+=1)if(t[r]===e)return r;return -1},es=function(e){return void 0===e},el=function(e){return e&&e.className?es(e.className.baseVal)?e.className:e.className.baseVal:""},eu=function(e,t){if(t=(t=en(t)?t.join(" "):t).replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),es(e.className.baseVal)){e.className=t;return}e.className.baseVal=t},ec=function(e){var t,n=Array.prototype.slice.call(arguments,1),r=e.classList,o=[];if(r)return void eo(n,function(t){e.classList.add(t)});(t=el(e))&&(n=[].concat(t.split(/\s+/),n)),eo(n,function(e){0>ea(e,o)&&o.push(e)}),eu(e,o)},ep=function(e){var t,n,r=Array.prototype.slice.call(arguments,1),o=e.classList;if(o)return void er(r,function(e){o.remove(e)});t=el(e).split(/\s+/),n=[],er(t,function(e){0>ea(e,r)&&n.push(e)}),eu(e,n)},ed=function(e){return"number"==typeof e||e instanceof Number},ef=function(e){return null===e},eh=function(e,t){var n=document.createElement("img"),r="";return J(t,function(e,t){r+="&"+t+"="+e}),n.src=e+"?"+(r=r.substring(1)),n.style.display="none",document.body.appendChild(n),document.body.removeChild(n),n},em=function(e,t){var n=location.hostname,r="TOAST UI "+e+" for "+n+": Statistics",o=window.localStorage.getItem(r);(es(window.tui)||!1!==window.tui.usageStatistics)&&(!o||new Date().getTime()-o>6048e5)&&(window.localStorage.setItem(r,new Date().getTime()),setTimeout(function(){("interactive"===document.readyState||"complete"===document.readyState)&&eh("https://www.google-analytics.com/collect",{v:1,t:"event",tid:t,cid:n,dp:n,dh:e,el:e,ec:"use"})},1e3))};/Mac/.test(navigator.platform);var ev=/[\u0020]+/g,eg=/[>(){}[\]+-.!#|]/g,ey=/<([a-zA-Z_][a-zA-Z0-9\-._]*)(\s|[^\\>])*\/?>|<(\/)([a-zA-Z_][a-zA-Z0-9\-._]*)\s*\/?>|<!--[^-]+-->|<([a-zA-Z_][a-zA-Z0-9\-.:/]*)>/g,eb=/\\[!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~\\]/g,ew=/[*_~`]/g,ek=/!\[.*\]\(.*\)/g,eC=/[[\]]/g,ex=/(?:^|[^\\])\\(?!\\)/g,eT=RegExp('[&<>"]',"g");function eE(e){switch(e){case"&":return"&amp;";case"<":return"&lt;";case">":return"&gt;";case'"':return"&quot;";default:return e}}function eM(e){return eT.test(e)?e.replace(eT,eE):e}function eL(e,t){return -1!==e.indexOf(t)}var eN=["rel","target","hreflang","type"],eS={codeblock:/(^ {4}[^\n]+\n*)+/,thematicBreak:/^ *((\* *){3,}|(- *){3,} *|(_ *){3,}) */,atxHeading:/^(#{1,6}) +[\s\S]+/,seTextheading:/^([^\n]+)\n *(=|-){2,} */,blockquote:/^( *>[^\n]+.*)+/,list:/^ *(\*+|-+|\d+\.) [\s\S]+/,def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +["(]([^\n]+)[")])? */,link:/!?\[.*\]\(.*\)/,reflink:/!?\[.*\]\s*\[([^\]]*)\]/,verticalBar:/\u007C/,fencedCodeblock:/^((`|~){3,})/};function eA(e){if(!e)return null;var t={};
1return eN.forEach(function(n){es(e[n])||(t[n]=e[n])}),t}function eD(e,t){for(var n="",r=0;r<t;r+=1)n+=e;return n}function eI(e){for(var t=[],n=ek.exec(e);n;)t.push([n.index,n.index+n[0].length]),n=ek.exec(e);return e.replace(eC,function(e,n){return t.some(function(e){return n>e[0]&&n<e[1]})?e:"\\"+e})}function eO(e){return ef(e)||es(e)}function eR(e,t){if(null===e&&e===t)return!0;if("object"!=typeof e||"object"!=typeof t||eO(e)||eO(t))return e===t;for(var n in e)if(e[n]!==t[n])return!1;for(var n in t)if(!(n in e))return!1;return!0}function eP(e){return e[e.length-1]}function eH(e){return"object"==typeof e&&null!==e}function eB(e,t){var n=X({},e);return e&&t&&Object.keys(t).forEach(function(e){eH(n[e])?Array.isArray(t[e])?n[e]=eF(t[e]):n.hasOwnProperty(e)?n[e]=eB(n[e],t[e]):n[e]=eq(t[e]):n[e]=t[e]}),n}function eF(e){return e.map(function(e){return eH(e)?Array.isArray(e)?eF(e):eq(e):e})}function eq(e){var t=Object.keys(e);return t.length?t.reduce(function(t,n){return eH(e[n])?t[n]=Array.isArray(e[n])?eF(e[n]):eq(e[n]):t[n]=e[n],t},{}):e}function e_(e,t){return void 0===t&&(t={}),Object.keys(t).forEach(function(n){e.hasOwnProperty(n)&&"object"==typeof e[n]?Array.isArray(t[n])?e[n]=t[n]:e_(e[n],t[n]):e[n]=t[n]}),e}function ej(e,t){return e>t?[t,e]:[e,t]}var ez=function(e){var t;try{t=Array.prototype.slice.call(e)}catch(n){t=[],er(e,function(e){t.push(e)})}return t};function eU(e,t){var n=e.nodes.paragraph;return t?n.create(null,et(t)?e.text(t):t):n.createAndFill()}function eV(e,t,n){return e.text(t,n)}function e$(e,t,n){void 0===n&&(n=t);var r=e.doc.content.size,o=r>0?r-1:1;return U.U3.create(e.doc,Math.min(t,o),Math.min(n,o))}function eW(e,t,n){var r=t.pos;return e.replaceWith(r,r,eU(n)),e.setSelection(e$(e,r+1))}function eG(e){for(var t=e.state,n=e.from,r=e.startIndex,o=e.endIndex,i=e.createText,a=t.tr,s=t.doc,l=t.schema,u=r;u<=o;u+=1){var c=s.child(u),p=c.nodeSize,d=c.textContent,f=c.content,h=i(d),m=h?eV(l,h):_.FK.empty,v=a.mapping.map(n),g=v+f.size;a.replaceWith(v,g,m),n+=p}return a}function eK(e,t,n,r){var o=n.length;e.split(t).delete(t-o,t).insert(e.mapping.map(t),r).setSelection(e$(e,e.mapping.map(t)-o))}function eZ(e){return e.sourcepos[0][0]}function eX(e){return e.sourcepos[1][0]}function eQ(e){return e.sourcepos[0][1]}function eY(e){return e.sourcepos[1][1]}function eJ(e){return e&&("item"===e.type||"list"===e.type)}function e0(e){return eJ(e)&&"ordered"===e.listData.type}function e1(e){return e&&("tableCell"===e.type||"tableDelimCell"===e.type)}function e2(e,t,n){for(void 0===n&&(n=!0),e=n?e:e.parent;e&&"document"!==e.type;){if(t(e))return e;e=e.parent}return null}function e3(e,t){return[e[0],e[1]+t]}function e5(e,t){return[e[0],t]}function e4(e){for(var t=[],n=e.walker(),r=null;r=n.next();){var o=r.node;"text"===o.type&&t.push(o.literal)}return t.join("")}var e6=[],e9={},e8=/\$\$widget\d+\s/;function e7(e){var t=e.search(e8);if(-1!==t){var n=e.substring(t).replace(e8,"").replace("$$","");e=e.substring(0,t)+e7(n)}return e}function te(e,t){return"$$"+e+" "+t+"$$"}function tt(e,t){var n=e9[e],r=n.rule,o=n.toDOM,i=e7(t).match(r);return i&&(t=i[0]),o(t)}function tn(e,t,n,r){return e.concat(tr(t,n,r))}function tr(e,t,n){void 0===n&&(n=0);var r=[],o=(e6[n]||{}).rule,i=n+1;if(e=e7(e),o&&o.test(e)){for(var a=void 0;-1!==(a=e.search(o));){var s=e.substring(0,a);s&&(r=tn(r,s,t,i));var l=(e=e.substring(a)).match(o)[0],u="widget"+n;r.push(t.nodes.widget.create({info:u},t.text(te(u,l)))),e=e.substring(l.length)}e&&(r=tn(r,e,t,i))}else e&&(r=n<e6.length-1?tn(r,e,t,i):[t.text(e)]);return r}function to(e){for(var t,n="",r=e.walker();t=r.next();){var o=t.node;t.entering&&(o!==e&&"text"!==o.type?(n+=function(e){var t=e.firstChild.literal;switch(e.type){case"emph":return"*"+t+"*";case"strong":return"**"+t+"**";case"strike":return"~~"+t+"~~";case"code":return"`"+t+"`";case"link":case"image":var n=e.destination,r=e.title;return("link"===e.type?"":"!")+"["+t+"]("+n+(r?' "'+r+'"':"")+")";default:return null}}(o),r.resumeAt(e,!1),r.next()):"text"===o.type&&(n+=o.literal))}return n}function ti(){return{deleteSelection:function(){return $.ic},selectAll:function(){return $.Ub},undo:function(){return G.tN},redo:function(){return G.ZS}}}var ta=function(e,t){return e.classList?e.classList.contains(t):ea(t,el(e).split(/\s+/))>-1},ts=Element.prototype,tl=ts.matches||ts.webkitMatchesSelector||ts.mozMatchesSelector||ts.msMatchesSelector||function(e){return ea(this,ez((this.document||this.ownerDocument).querySelectorAll(e)))>-1},tu="[A-Za-z][A-Za-z0-9-]*",tc="(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^\"'=<>`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)",tp="<("+tu+")("+tc+")*\\s*/?>",td="(?:"+tp+"|</("+tu+")\\s*[>])",tf=RegExp("^"+td,"i"),th=/<br\s*\/*>/i,tm=/<! ---->|<!--(?:-?[^>-])(?:-?[^-])*-->/,tv="</p><p>";function tg(e,t,n){var r=parseInt(e.left,10),o=parseInt(e.top,10),i=parseInt(e.width,10)+parseInt(e.paddingLeft,10)+parseInt(e.paddingRight,10),a=parseInt(e.height,10)+parseInt(e.paddingTop,10)+parseInt(e.paddingBottom,10);return t>=r&&t<=r+i&&n>=o&&n<=o+a}var ty="toastui-editor-";function tb(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=[],r=0;r<e.length;r++){var o=e[r],i=void 0;(i=Array.isArray(o)?o[0]?o[1]:null:o)&&n.push(""+ty+i)}return n.join(" ")}function tw(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.map(function(e){return ty+"md-"+e}).join(" ")}function tk(e){return e&&e.nodeType===Node.ELEMENT_NODE}function tC(e){e.parentNode&&e.parentNode.removeChild(e)}function tx(e,t,n){es(n)&&(n=!ta(e,t)),(n?ec:ep)(e,t)}function tT(e,t){var n=document.createElement("div");et(e)?n.innerHTML=e:n.appendChild(e);var r=n.firstChild;return t&&t.appendChild(r),r}function tE(e){var t=window.getComputedStyle(e);return["margin-left","margin-right"].reduce(function(e,n){return e+parseInt(t.getPropertyValue(n),10)},0)+e.offsetWidth}function tM(e,t){var n;for(n=et(t)?function(e){return tl.call(e,t)}:function(e){return e===t};e&&e!==document;){if(tk(e)&&n(e))return e;e=e.parentNode}return null}function tL(e,t){for(var n=0,r=0;e&&e!==t;){var o=e.offsetTop,i=e.offsetLeft,a=e.offsetParent;if(n+=o,r+=i,a===t.offsetParent)break;e=e.offsetParent}return{offsetTop:n,offsetLeft:r}}function tN(e,t){Object.keys(e).forEach(function(n){eO(e[n])?t.removeAttribute(n):t.setAttribute(n,e[n])})}function tS(e){var t=e;return(t=t.replace(/<img class="ProseMirror-separator" alt="">/g,"")).replace(/ class="ProseMirror-trailingBreak"/g,"")}var tA=new U.hs("widget"),tD=function(){function e(e,t){var n=this;this.popup=null,this.removeWidget=function(){n.popup&&(n.rootEl.removeChild(n.popup),n.popup=null)},this.rootEl=e.dom.parentElement,this.eventEmitter=t,this.eventEmitter.listen("blur",this.removeWidget),this.eventEmitter.listen("loadUI",function(){n.rootEl=tM(e.dom.parentElement,"."+tb("defaultUI"))}),this.eventEmitter.listen("removePopupWidget",this.removeWidget)}return e.prototype.update=function(e){var t=tA.getState(e.state);if(this.removeWidget(),t){var n=t.node,r=t.style,o=e.coordsAtPos(t.pos),i=o.top,a=o.left,s=o.bottom-i,l=this.rootEl.getBoundingClientRect(),u=i-l.top;ei(n,{opacity:"0"}),this.rootEl.appendChild(n),ei(n,{position:"absolute",left:a-l.left+5+"px",top:("bottom"===r?u+s-5:u-s)+"px",opacity:"1"}),this.popup=n,e.focus()}},e.prototype.destroy=function(){this.eventEmitter.removeEventHandler("blur",this.removeWidget)},e}();function tI(e,t,n){e.emit("addImageBlobHook",t,function(n,r){e.emit("command","addImage",{imageUrl:n,altText:r||t.name||"image"})},n)}function tO(e){var t=ez(e).filter(function(e){return -1!==e.type.indexOf("image")});if(1===t.length){var n=t[0];if(n)return n.getAsFile()}return null}var tR=function(){function e(){}return Object.defineProperty(e.prototype,"type",{get:function(){return"node"}
1,enumerable:!1,configurable:!0}),e.prototype.setContext=function(e){this.context=e},e}();function tP(e){var t=document.createElement("span"),n=tt(e.attrs.info,e.textContent);return t.className="tui-widget",t.appendChild(n),{dom:t}}function tH(e){return"widget"===e.type.name}var tB=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Z(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"widget"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return{attrs:{info:{default:null}},group:"inline",inline:!0,content:"text*",selectable:!1,atom:!0,toDOM:function(){return["span",{class:"tui-widget"},0]},parseDOM:[{tag:"span.tui-widget",getAttrs:function(e){return{info:e.textContent.match(/\$\$(widget\d+)/)[1]}}}]}},enumerable:!1,configurable:!0}),t}(tR),tF=function(){function e(e){this.timer=null,this.el=document.createElement("div"),this.el.className="toastui-editor",this.eventEmitter=e,this.placeholder={text:""}}return e.prototype.createState=function(){return U.$t.create({schema:this.schema,plugins:this.createPlugins()})},e.prototype.initEvent=function(){var e=this.eventEmitter,t=this.view,n=this.editorType;t.dom.addEventListener("focus",function(){return e.emit("focus",n)}),t.dom.addEventListener("blur",function(){return e.emit("blur",n)})},e.prototype.emitChangeEvent=function(e){this.eventEmitter.emit("caretChange",this.editorType),e.docChanged&&this.eventEmitter.emit("change",this.editorType)},Object.defineProperty(e.prototype,"defaultPlugins",{get:function(){var e,t,n,r=this.createInputRules(),o=Q(Q([],this.keymaps),[(0,V.w)(X({"Shift-Enter":$.RV.Enter},$.RV)),(0,G.b6)(),(e=this.placeholder,new U.k_({props:{decorations:function(t){var n=t.doc;if(e.text&&1===n.childCount&&n.firstChild.isTextblock&&0===n.firstChild.content.size){var r=document.createElement("span");return ec(r,"placeholder"),e.className&&ec(r,e.className),r.textContent=e.text,j.zF.create(n,[j.NZ.widget(1,r)])}return null}}})),(t=this.eventEmitter,new U.k_({key:tA,state:{init:function(){return null},apply:function(e){return e.getMeta("widget")}},view:function(e){return new tD(e,t)}})),(n=this.context.eventEmitter,new U.k_({props:{handleDOMEvents:{drop:function(e,t){var r,o=null==(r=t.dataTransfer)?void 0:r.files;return o&&er(o,function(e){return -1===e.type.indexOf("image")||(t.preventDefault(),t.stopPropagation(),tI(n,e,t.type),!1)}),!0}}}}))]);return r?o.concat(r):o},enumerable:!1,configurable:!0}),e.prototype.createInputRules=function(){var e=e6.map(function(e){var t=e.rule;return new W.fV(t,function(e,n,r,o){var i=e.schema,a=e.tr,s=e.doc,l=n.input.match(RegExp(t,"g")),u=s.resolve(r),c=u.parent,p=0;if(tH(c)&&(c=u.node(u.depth-1)),c.forEach(function(e){return tH(e)&&(p+=1)}),l.length>p){var d=eP(l),f=tr(d,i);return a.replaceWith(o-d.length+1,o,f)}return null})});return e.length?(0,W.sM)({rules:e}):null},e.prototype.clearTimer=function(){this.timer&&(clearTimeout(this.timer),this.timer=null)},e.prototype.createSchema=function(){return new _.Sj({nodes:this.specs.nodes,marks:this.specs.marks})},e.prototype.createKeymaps=function(e){var t=ti(),n=t.undo,r=t.redo,o=this.specs.keymaps(e),i={"Mod-z":n(),"Shift-Mod-z":r()};return e?o.concat((0,V.w)(i)):o},e.prototype.createCommands=function(){return this.specs.commands(this.view)},e.prototype.createPluginProps=function(){var e=this;return this.extraPlugins.map(function(t){return t(e.eventEmitter)})},e.prototype.focus=function(){var e=this;this.clearTimer(),this.timer=setTimeout(function(){e.view.focus(),e.view.dispatch(e.view.state.tr.scrollIntoView())})},e.prototype.blur=function(){this.view.dom.blur()},e.prototype.destroy=function(){var e=this;this.clearTimer(),this.view.destroy(),Object.keys(this).forEach(function(t){delete e[t]})},e.prototype.moveCursorToStart=function(e){var t=this.view.state.tr;this.view.dispatch(t.setSelection(e$(t,1)).scrollIntoView()),e&&this.focus()},e.prototype.moveCursorToEnd=function(e){var t=this.view.state.tr;this.view.dispatch(t.setSelection(e$(t,t.doc.content.size-1)).scrollIntoView()),e&&this.focus()},e.prototype.setScrollTop=function(e){this.view.dom.scrollTop=e},e.prototype.getScrollTop=function(){return this.view.dom.scrollTop},e.prototype.setPlaceholder=function(e){this.placeholder.text=e,this.view.dispatch(this.view.state.tr.scrollIntoView())},e.prototype.setHeight=function(e){ei(this.el,{height:e+"px"})},e.prototype.setMinHeight=function(e){ei(this.el,{minHeight:e+"px"})},e.prototype.getElement=function(){return this.el},e}(),tq=function(e){return e instanceof Function},t_=["Enter","Shift-Enter","Mod-Enter","Tab","Shift-Tab","Delete","Backspace","Mod-Delete","Mod-Backspace","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Mod-d","Mod-D","Alt-ArrowUp","Alt-ArrowDown"];function tj(e,t,n){return e.focus(),t(n)(e.state,e.dispatch,e)}var tz=function(){function e(e){this.specs=e}return Object.defineProperty(e.prototype,"nodes",{get:function(){return this.specs.filter(function(e){return"node"===e.type}).reduce(function(e,t){var n,r=t.name,o=t.schema;return X(X({},e),((n={})[r]=o,n))},{})}
1,enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"marks",{get:function(){return this.specs.filter(function(e){return"mark"===e.type}).reduce(function(e,t){var n,r=t.name,o=t.schema;return X(X({},e),((n={})[r]=o,n))},{})},enumerable:!1,configurable:!0}),e.prototype.commands=function(e,t){var n=this.specs.filter(function(e){return e.commands}).reduce(function(t,n){var r={},o=n.commands();return tq(o)?r[n.name]=function(t){return tj(e,o,t)}:Object.keys(o).forEach(function(t){r[t]=function(n){return tj(e,o[t],n)}}),X(X({},t),r)},{}),r=ti();return Object.keys(r).forEach(function(t){n[t]=function(n){return tj(e,r[t],n)}}),t&&Object.keys(t).forEach(function(r){n[r]=function(n){return tj(e,t[r],n)}}),n},e.prototype.keymaps=function(e){return this.specs.filter(function(e){return e.keymaps}).map(function(e){return e.keymaps()}).map(function(t){return e||Object.keys(t).forEach(function(e){eL(t_,e)||delete t[e]}),(0,V.w)(t)})},e.prototype.setContext=function(e){this.specs.forEach(function(t){t.setContext(e)})},e}();function tU(e){var t=e.from,n=e.to;return e instanceof U.i5?[t+1,n-1]:[t,n]}function tV(e){return e.index(0)+1}function t$(e,t,n){void 0===n&&(n=1);var r=0;return e.forEach(function(e,o){tH(e)&&o+2<t&&(r+=2*n)}),r}function tW(e,t,n){void 0===n&&(n=t);var r=t===n,o=e.resolve(t),i=tV(o),a=i,s=o.start(1),l=s;if(!r){var u=e.resolve(n===e.content.size?n-1:n);l=u.start(1),a=tV(u),u.pos===e.content.size&&(n=e.content.size-2)}var c=Math.max(t-s+1,1),p=Math.max(n-l+1,1);return[[i,c+t$(e.child(i-1),c,-1)],[a,p+t$(e.child(a-1),p,-1)]]}function tG(e,t){for(var n=[],r=0,o=0;r<t;r+=1){var i=e.child(r);n[r]=o,o+=i.nodeSize}return n}function tK(e,t,n){var r=tG(e,n[0]),o=t[0]-1,i=n[0]-1,a=e.child(o),s=e.child(i),l=r[o],u=r[i];return[l+=t[1]+t$(a,t[1]-1),Math.min(u+=n[1]+t$(s,n[1]-1),e.content.size)]}function tZ(e){var t=e.$from,n=e.$to,r=e.from,o=e.to,i=t.doc;return e instanceof U.i5&&(t=i.resolve(r+1),n=i.resolve(o-1)),0===t.depth&&(n=t=i.resolve(r-1)),{startFromOffset:t.start(1),endFromOffset:n.start(1),startToOffset:t.end(1),endToOffset:n.end(1),startIndex:t.index(0),endIndex:n.index(0),from:t.pos,to:n.pos}}function tX(e,t){for(var n=1,r=1,o=0,i=0;o<e.childCount;o+=1){var a=e.child(o).nodeSize;if(n=i+1,r=i+a-1,o===t)break;i+=a}return{startOffset:n,endOffset:r}}var tQ="heading",tY="link",tJ="code",t0="meta",t1="delimiter",t2="markedText",t3={strong:2,emph:1,strike:2};function t5(e,t,n,r){return{start:e,end:t,spec:{type:n,attrs:r}}}function t4(e,t,n){var r=e.type,o=e3(t,t3[r]),i=e3(n,-t3[r]);return[t5(o,i,r),t5(t,o,t1),t5(i,n,t1)]}function t6(e,t,n,r){return[t5(e,t,tY),t5(e5(e,n[1]+1),e5(t,r),tY,{desc:!0}),t5(e5(t,r+2),e3(t,-1),tY,{url:!0})]}function t9(e,t,n,r){var o={start:t,end:n,spec:{attrs:{className:r+"-line-background",codeStart:t[0],codeEnd:n[0]}},lineBackground:!0};return"item"!==e.type&&"blockQuote"!==e.type?[X(X({},o),{end:t,spec:{attrs:{className:r+"-line-background start"}}}),X(X({},o),{start:[Math.min(t[0]+1,n[0]),t[1]]})]:null}function t8(e,t){for(var n=[];e;){var r=e.type;("paragraph"===r||"codeBlock"===r)&&n.push(t5([eZ(e),eQ(e)-1],[eX(e),eY(e)+1],t)),e=e.next}return n}var t7={heading:function(e,t,n){var r=e.level,o=e.headingType,i=[t5(t,n,tQ,{level:r})];return"atx"===o?i.push(t5(t,e3(t,r),t1)):i.push(t5(e5(n,0),n,tQ,{seText:!0})),i},strong:t4,emph:t4,strike:t4,link:function(e,t,n){var r=e.lastChild,o=e.extendedAutolink,i=r?eY(r)+1:2;return o?[t5(t,n,tY,{desc:!0})]:t6(t,n,t,i)},image:function(e,t,n){var r=e.lastChild,o=r?eY(r)+1:3,i=e3(t,1);return Q([t5(t,i,t0)],t6(t,n,i,o))},code:function(e,t,n){var r=e.tickCount,o=e3(t,r),i=e3(n,-r);return[t5(t,n,tJ),t5(t,o,tJ,{start:!0}),t5(o,i,tJ,{marked:!0}),t5(i,n,tJ,{end:!0})]},codeBlock:function(e,t,n,r){var o=e.fenceOffset,i=e.fenceLength,a=e.fenceChar,s=e.info,l=e.infoPadding,u=e.parent,c=[t5(e5(t,1),n,"codeBlock")];a&&c.push(t5(t,e3(t,o+i),t1)),s&&c.push(t5(e3(t,i),e3(t,i+l+s.length),t0)),RegExp("^(\\s{0,4})("+a+"{"+i+",})").test(r)&&c.push(t5(e5(n,1),n,t1));var p=t9(u,t,n,"code-block");return p?c.concat(p):c},blockQuote:function(e,t,n){var r=e.parent&&"blockQuote"!==e.parent.type?[t5(t,n,"blockQuote")]:[];if(e.firstChild){var o=[];"paragraph"===e.firstChild.type?o=function(e){for(var t=[];e;)t.push(t5([eZ(e),eQ(e)],[eX(e),eY(e)+1],t2)),e=e.next;return t}(e.firstChild.firstChild):"list"===e.firstChild.type&&(o=t8(e.firstChild,t2)),r=Q(Q([],r),o)}return r},item:function(e,t){var n=e.listData,r=n.padding,o=n.task,i=function(e){for(var t=0;e.parent.parent&&"item"===e.parent.parent.type;)e=e.parent.parent,t+=1;var n=[{odd:!0},{even:!0}][t%2];return["listItem",X(X({},n),{listStyle:!0})]}(e),a=[t5.apply(void 0,Q([t,e3(t,r)],i))];return o&&(a.push(t5(e3(t,r),e3(t,r+3),"taskDelimiter")),a.push(t5(e3(t,r+1),e3(t,r+2),t0))),a.concat(t8(e.firstChild,t2))},customBlock:function(e,t,n){var r=e.offset,o=e.syntaxLength,i=e.info,a=e.parent,s=r+
1o,l=[t5(e5(t,1),n,"customBlock")];l.push(t5(t,e3(t,s),t1)),i&&l.push(t5(e3(t,s),e3(t,o+i.length),t0)),l.push(t5(e5(n,1),n,t1));var u=t9(a,t,n,"custom-block");return u?l.concat(u):l}},ne={thematicBreak:"thematicBreak",table:"table",tableCell:"tableCell",htmlInline:"html"},nt={},nn=["taskList","orderedList","bulletList","table","strong","emph","strike","heading","thematicBreak","blockQuote","code","codeBlock","indent","outdent"],nr=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Z(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"doc"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return{content:"block+"}},enumerable:!1,configurable:!0}),t}(tR),no=function(){function e(){}return Object.defineProperty(e.prototype,"type",{get:function(){return"mark"},enumerable:!1,configurable:!0}),e.prototype.setContext=function(e){this.context=e},e}();function ni(e,t){return na(e,t-1)}function na(e,t){return e.child(t).textContent}var ns=/^\s*> ?/,nl=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Z(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"blockQuote"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return{toDOM:function(){return["span",{class:tw("block-quote")},0]}}},enumerable:!1,configurable:!0}),t.prototype.createBlockQuoteText=function(e,t){return t?e.replace(ns,"").trim():"> "+e.trim()},t.prototype.extendBlockQuote=function(){var e=this;return function(t,n){var r=t.selection,o=t.doc,i=t.tr,a=t.schema,s=tZ(r),l=s.endFromOffset,u=s.endToOffset,c=s.endIndex,p=s.to,d=na(o,c);if(ns.test(d)&&p>l&&r.empty){if(d.replace(ns,"").trim()){var f=d.slice(p-l).trim(),h=eV(a,e.createBlockQuoteText(f));eK(i,u,f,h)}else i.deleteRange(l,u).split(i.mapping.map(u));return n(i),!0}return!1}},t.prototype.commands=function(){var e=this;return function(){return function(t,n){var r=t.selection,o=t.doc,i=tZ(r),a=i.startFromOffset,s=i.endToOffset,l=i.startIndex,u=i.endIndex,c=ns.test(na(o,l)),p=eG({state:t,startIndex:l,endIndex:u,from:a,createText:function(t){return e.createBlockQuoteText(t,c)}});return n(p.setSelection(e$(p,p.mapping.map(s)))),!0}}},t.prototype.keymaps=function(){var e=this.commands()();return{"alt-q":e,"alt-Q":e,Enter:this.extendBlockQuote()}},t}
1(no),nu=/(^\s*)([-*+] |[\d]+\. )/,nc=/(^\s*)([\d])+\.( \[[ xX]])? /,np=/^(\s*)((\d+)([.)]\s(?:\[(?:x|\s)\]\s)?))(.*)/,nd=/(^\s*)([-*+]|[\d]+\.)( \[[ xX]])? /,nf=/^(\s*)([-*+]+(\s(?:\[(?:x|\s)\]\s)?))(.*)/,nh=/(^\s*)([-*+] |[\d]+\. )(\[[ xX]] )/,nm=/(^\s*)([-*+])( \[[ xX]]) /;function nv(e){return nc.test(e)?"ordered":"bullet"}function ng(e){for(var t=0;e&&"document"!==e.type;)"list"===e.type&&(t+=1),e=e.parent;return t}function ny(e,t,n,r){for(var o=e.getLineTexts().length,i=[],a=t;r?a<o:a>1;){a=r?a+1:a-1;var s=e.findFirstNodeAtLine(a),l=ng(s);if(l===n)i.push({line:a,depth:n,mdNode:s});else if(l<n)break}return i}function nb(e,t,n,r){void 0===r&&(r=0);var o=Number.MAX_VALUE,i=0;return{changedResults:t.map(function(t,a){var s=t.line;o=Math.min(s-1,o),i=Math.max(s-1,i);var l=ni(e,s);return{text:l="bullet"===n?function(e){if(!nu.test(e))return"* "+e;var t=nv(e);return"bullet"===t&&nd.test(e)?e=e.replace(nm,"$1$2 "):"ordered"===t&&(e=e.replace(nc,"$1* ")),e}(l):function(e,t){if(!nu.test(e))return t+". "+e;var n=nv(e);return"bullet"===n||"ordered"===n&&nd.test(e)?e=e.replace(nd,"$1"+t+". "):"ordered"===n&&Number(np.exec(e)[3])!==t&&(e=e.replace(nc,"$1"+t+". ")),e}(l,a+1+r),line:s}}),firstIndex:o,lastIndex:i}}function nw(e,t){var n,r,o,i,a,s,l=(n=t.toastMark,r=t.mdNode,a=ny(n,o=t.line,i=ng(r),!1).reverse(),s=ny(n,o,i,!0),a.concat([{line:o,depth:i,mdNode:r}]).concat(s));return nb(t.doc,l,e)}var nk={bullet:function(e){return nw("bullet",e)},ordered:function(e){return nw("ordered",e)},task:function(e){var t=e.mdNode,n=e.doc,r=e.line,o=ni(n,r);return t.listData.task?o=o.replace(nh,"$1$2"):eJ(t)&&(o=o.replace(nu,"$1$2[ ] ")),{changedResults:[{text:o,line:r}]}}},nC={bullet:function(e){var t=e.doc,n=e.line;return{changedResults:[{text:"* "+ni(t,n),line:n}]}},ordered:function(e){for(var t=e.toastMark,n=e.doc,r=e.line,o=e.startLine,i=ni(n,r),a=1,s=o,l=0,u=o-1;u>0;u-=1){var c=t.findFirstNodeAtLine(u),p=ni(n,u)&&!!e2(c,function(e){return eJ(e)}
1),d=np.exec(ni(n,u));if(!d&&!p)break;if(!d&&p){l+=1;continue}var f=d[1],h=d[3];if(!f){a=Number(h),s=u;break}}return{changedResults:[{text:a+r-s-l+". "+i,line:r}]}},task:function(e){var t=e.doc,n=e.line;return{changedResults:[{text:"* [ ] "+ni(t,n),line:n}]}}},nx={bullet:function(e){var t=e.line,n=ni(e.doc,t),r=nf.exec(n);return{listSyntax:""+r[1]+r[2]}},ordered:function(e){var t=e.toastMark,n=e.line,r=e.mdNode,o=e.doc,i=ng(r),a=ni(o,n),s=np.exec(a),l=s[1],u=s[3],c=s[4],p=Number(u)+1,d=""+l+p+c,f=ny(t,n,i,!0).filter(function(e){var t=np.exec(ni(o,e.line));return t&&t[1].length===l.length&&!!e2(e.mdNode,function(e){return e0(e)})});return X({listSyntax:d},nb(o,f,"ordered",p))}},nT=/(^\s{1,4})(.*)/;function nE(e,t,n){return e<t||nu.test(n)||ns.test(n)}function nM(e,t,n){var r=n.$from;0===r.depth&&(r=e.resolve(r.pos-1));var o=r.node(1),i=r.start(1),a=o.content.size;return o.rangeHasMark(0,a,t.marks.table)&&r.pos-i!==a&&r.pos!==i}function nL(e,t){var n=t.from,r=t.to;if("indent"===t.type)n+=4,r+=(t.lineLen+1)*4;else{var o=t.spaceLenList;n-=o[0];for(var i=0;i<o.length;i+=1)r-=o[i]}return e$(e,n,r)}var nN=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Z(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"paragraph"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return{content:"inline*",attrs:{className:{default:null},codeStart:{default:null},codeEnd:{default:null}},selectable:!1,group:"block",parseDOM:[{tag:"div"}],toDOM:function(e){var t=e.attrs;return t.className?["div",{class:tw(t.className)},0]:["div",0]}}},enumerable:!1,configurable:!0}),t.prototype.reorderList=function(e,t){for(var n,r=this.context,o=r.view,i=r.toastMark,a=r.schema,s=o.state,l=s.tr,u=s.selection,c=s.doc,p=i.findFirstNodeAtLine(e),d=p;p&&!(eJ(n=p)&&"ordered"!==n.listData.type)&&"document"!==p.parent.type;)if(e0(p=p.parent)){d=p;break}d&&(e=d.sourcepos[0][0]);var f=np.exec(ni(c,e)),h=f[1],m=f[3],v=h.length,g=function e(t,n,r,o,i){for(var a=[],s=ni(t,r),l=np.exec(s);l;){var u=l[1],c=l[4],p=l[5],d=u.length;if(d===i)a.push(eV(n,""+u+o+c+p)),o+=1,r+=1;else if(d>i){var f=e(t,n,r,1,d);r=f.line,a=a.concat(f.nodes)}if(d<i||r>t.childCount)break;s=ni(t,r),l=np.exec(s)}return{nodes:a,line:r}}(c,a,e,Number(m),v),y=g.line,b=g.nodes;t=Math.max(t,y-1);for(var w=tX(c,e-1).startOffset,k=e-1;k<=t-1;k+=1){var C=c.child(k),x=C.nodeSize,T=C.content,E=l.mapping.map(w),M=E+T.size;l.replaceWith(E,M,b[k-e+1]),w+=x}var L=e$(l,u.from,u.to);o.dispatch(l.setSelection(L))},t.prototype.indent=function(e){var t=this;return void 0===e&&(e=!1),function(){return function(n,r){var o=n.schema,i=n.selection,a=n.doc,s=tZ(i),l=s.from,u=s.to,c=s.startFromOffset,p=s.startIndex,d=s.endIndex;if(e&&nM(a,o,i))return!1;var f=na(a,p);if(e&&nE(l,u,f)||!e&&nu.test(f)){var h=eG({state:n,from:c,startIndex:p,endIndex:d,createText:function(e){return"    "+e}});r(h.setSelection(nL(h,{type:"indent",from:l,to:u,lineLen:d-p}))),np.test(f)&&t.reorderList(p+1,d+1)}else e&&r(n.tr.insert(u,eV(o,"    ")));return!0}}},t.prototype.outdent=function(e){var t=this;return void 0===e&&(e=!1),function(){return function(n,r){var o=n.selection,i=n.doc,a=n.schema,s=tZ(o),l=s.from,u=s.to,c=s.startFromOffset,p=s.startIndex,d=s.endIndex;if(e&&nM(i,a,o))return!1;var f=na(i,p);if(e&&nE(l,u,f)||!e&&nu.test(f)){var h=[],m=eG({state:n,from:c,startIndex:p,endIndex:d,createText:function(e){var t=nT.exec(e);return h.push(t?t[1].length:0),e.replace(nT,"$2")}});r(m.setSelection(nL(m,{type:"outdent",from:l,to:u,spaceLenList:h}))),np.test(f)&&t.reorderList(p+1,d+1)}else if(e){var v=f.slice(0,u-c),g=v.replace(/\s{1,4}$/,""),y=u-(v.length-g.length);r(n.tr.delete(y,u))}return!0}}},t.prototype.deleteLines=function(){var e=this;return function(t,n){var r=e.context.view,o=tZ(t.selection),i=o.startFromOffset,a=o.endToOffset;return(0,$.st)(function(){return n(t.tr.deleteRange(i,a)),!0},$.eT)(t,n,r)}},t.prototype.moveDown=function(){return function(e,t){var n=e.doc,r=e.tr,o=e.selection,i=e.schema,a=tZ(o),s=a.startFromOffset,l=a.endToOffset,u=a.endIndex;if(u<n.content.childCount-1){var c=n.child(u+1),p=c.nodeSize,d=c.textContent;return r.delete(l,l+p).split(s).insert(r.mapping.map(s)-2,eV(i,d)),t(r),!0}return!1}},t.prototype.moveUp=function(){return function(e,t){var n=e.tr,r=e.doc,o=e.selection,i=e.sc
1hema,a=tZ(o),s=a.startFromOffset,l=a.endToOffset,u=a.startIndex;if(u>0){var c=r.child(u-1),p=c.nodeSize,d=c.textContent;return n.delete(s-p,s).split(n.mapping.map(l)).insert(n.mapping.map(l),eV(i,d)),t(n),!0}return!1}},t.prototype.commands=function(){return{indent:this.indent(),outdent:this.outdent()}},t.prototype.keymaps=function(){return{Tab:this.indent(!0)(),"Shift-Tab":this.outdent(!0)(),"Mod-d":this.deleteLines(),"Mod-D":this.deleteLines(),"Alt-ArrowUp":this.moveUp(),"Alt-ArrowDown":this.moveDown()}},t}(tR),nS=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Z(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"text"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return{group:"inline"}},enumerable:!1,configurable:!0}),t}(tR),nA=/^#{1,6}\s/,nD=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Z(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"heading"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return{attrs:{level:{default:1},seText:{default:!1}},toDOM:function(e){var t=e.attrs,n=t.level,r=t.seText,o="heading|heading"+n;return r&&(o+="|delimiter|setext"),["span",{class:tw.apply(void 0,o.split("|"))},0]}}},enumerable:!1,configurable:!0}),t.prototype.createHeadingText=function(e,t,n){for(var r=t.replace(n,"").trim(),o="";e>0;)o+="#",e-=1;return o+" "+r},t.prototype.commands=function(){var e=this;return function(t){return function(n,r){var o=t.level,i=tZ(n.selection),a=i.startFromOffset,s=i.endToOffset,l=eG({state:n,from:a,startIndex:i.startIndex,endIndex:i.endIndex,createText:function(t){var n=t.match(nA),r=n?n[0]:"";return e.createHeadingText(o,t,r)}});return r(l.setSelection(e$(l,l.mapping.map(s)))),!0}}},t}(no),nI=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Z(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"codeBlock"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return{toDOM:function(){return["span",{class:tw("code-block")},0]}}},enumerable:!1,configurable:!0}),t.prototype.commands=function(){return function(){return function(e,t){var n=e.selection,r=e.schema,o=e.tr,i=tZ(n),a=i.startFromOffset,s=i.endToOffset,l=eV(r,"```");return o.insert(a,l).split(a+3),o.split(o.mapping.map(s)).insert(o.mapping.map(s),l),t(o.setSelection(e$(o,o.mapping.map(s)-5))),!0}}},t.prototype.keepIndentation=function(){var e=this;return function(t,n){var r=t.selection,o=t.tr,i=t.doc,a=t.schema,s=e.context.toastMark,l=tZ(r),u=l.startFromOffset,c=l.endToOffset,p=l.endIndex,d=l.from,f=l.to,h=na(i,p);if(d===f&&h.trim()){var m,v=h.match(/^\s+/);if((m=s.findFirstNodeAtLine(p+1))&&"codeBlock"===m.type&&v){var g=v[0],y=h.slice(f-u),b=eV(a,g+y);return eK(o,c,y,b),n(o),!0}}return!1}},t.prototype.keymaps=function(){var e=this.commands()();return{"Shift-Mod-p":e,"Shift-Mod-P":e,Enter:this.keepIndentation()}},t}(no),nO=/\||\s/g;function nR(e,t){for(var n="|",r=0;r<e;r+=1)n+=t?" --- |":"  |";return n}var nP=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Z(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"table"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return{toDOM:function(){return["span",{class:tw("table")},0]}}},enumerable:!1,configurable:!0}),t.prototype.extendTable=function(){var e=this;return function(t,n){var r=t.selection,o=t.doc,i=t.tr,a=t.schema;if(!r.empty)return!1;var s=tZ(r),l=s.endFromOffset,u=s.endToOffset,c=s.endIndex,p=s.to,d=na(o,c),f=e2(e.context.toastMark.findNodeAtPosition([c+1,p-l+1]),function(e){return e1(e)&&("tableDelimRow"===e.parent.type||"tableBody"===e.parent.parent.type)});if(f){var h=!d.replace(nO,"").trim(),m=nR(f.parent.parent.parent.columns.length);return h?i.deleteRange(l,u).split(i.mapping.map(u)):i.split(u).insert(i.mapping.map(u),eV(a,m)).setSelection(e$(i,i.mapping.map(u)-2)),n(i),!0}return!1}},t.prototype.moveTableCell=function(e){var t=this;return function(n,r){var o=n.selection,i=n.tr,a=tZ(o),s=a.endFromOffset,l=a.endIndex,u=a.to,c=e2(t.context.toastMark.findNodeAtPosition([l+1,u-s]),function(e){return e1(e)});if(c){var p=c.parent,d=e?{type:"next",parentType:"tableHead",childType:"firstChild"}:{type:"prev",parentType:"tableBody",childType:"lastChild"},f=d.type,h=d.parentType,m=d.childType,v=eY(c);if(c[f])v=eY(c[f])-1;else{var g=p[f]||p.parent.type!==h?p[f]:p.parent[f][m];
1"next"===f?v+=(g?eY(g[m]):0)+2:"prev"===f&&(v=g?-4:0)}return r(i.setSelection(e$(i,s+v))),!0}return!1}},t.prototype.addTable=function(){return function(e){return function(t,n){var r=t.selection,o=t.tr,i=t.schema,a=e.columnCount,s=e.rowCount,l=tZ(r).endToOffset,u=[nR(a),nR(a,!0)],c=function(e,t){for(var n=[],r=0;r<t;r+=1)n.push(nR(e));return n}(a,s-1);return Q(Q([],u),c).forEach(function(e){o.split(o.mapping.map(l)).insert(o.mapping.map(l),eV(i,e))}),n(o.setSelection(e$(o,l+4))),!0}}},t.prototype.commands=function(){return{addTable:this.addTable()}},t.prototype.keymaps=function(){return{Enter:this.extendTable(),Tab:this.moveTableCell(!0),"Shift-Tab":this.moveTableCell(!1)}},t}(no),nH=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Z(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"thematicBreak"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return{toDOM:function(){return["span",{class:tw("thematic-break")},0]}}},enumerable:!1,configurable:!0}),t.prototype.hr=function(){return function(){return function(e,t){var n=e.selection,r=e.schema,o=e.tr,i=tZ(n),a=i.from,s=i.to,l=i.endToOffset,u=eV(r,"***");return o.split(a).replaceWith(o.mapping.map(a),o.mapping.map(s),u).split(o.mapping.map(s)).setSelection(e$(o,o.mapping.map(l))),t(o),!0}}},t.prototype.commands=function(){return{hr:this.hr()}},t.prototype.keymaps=function(){var e=this.hr()();return{"Mod-l":e,"Mod-L":e}},t}(no),nB=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Z(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"listItem"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return{attrs:{odd:{default:!1},even:{default:!1},listStyle:{default:!1}},toDOM:function(e){var t=e.attrs,n=t.odd,r=t.even,o=t.listStyle,i="list-item";return o&&(i+="|list-item-style"),n&&(i+="|list-item-odd"),r&&(i+="|list-item-even"),["span",{class:tw.apply(void 0,i.split("|"))},0]}}},enumerable:!1,configurable:!0}),t.prototype.extendList=function(){var e=this;return function(t,n){var r=t.selection,o=t.doc,i=t.schema,a=t.tr,s=e.context.toastMark,l=tZ(r),u=l.to,c=l.startFromOffset,p=l.endFromOffset,d=l.endIndex,f=l.endToOffset,h=na(o,d);if(!nu.test(h)||r.from===c||!r.empty)return!1;if(h.replace(nd,"").trim()){var m=nv(h),v=s.findFirstNodeAtLine(d+1),g=h.slice(u-p),y=nx[m]({toastMark:s,mdNode:v,doc:o,line:d+1}),b=y.listSyntax,w=y.changedResults;if(null==w?void 0:w.length){a.split(u),w.unshift({text:b+g,line:d+1}),e.changeToListPerLine(a,w,{from:u,startLine:w[0].line,endLine:eP(w).line});var k=a.mapping.map(f)-g.length;a.setSelection(e$(a,k))}else{var C=eV(i,b+g);eK(a,f,g,C)}}else a.deleteRange(p,f).split(a.mapping.map(f));return n(a),!0}},t.prototype.toList=function(e){var t=this;return function(){return function(n,r){for(var o=n.doc,i=n.tr,a=n.selection,s=t.context.toastMark,l=tZ(a),u=l.startIndex+1,c=l.endIndex+1,p=l.endToOffset,d=[],f=u;f<=c;f+=1){var h=s.findFirstNodeAtLine(f);if(h&&function(e,t){var n=e.type;return t<=e.sourcepos[0][0]&&("codeBlock"===n||"heading"===n||n.match("table"))}(h,f))break;if(-1===d.indexOf(f)){var m={toastMark:s,mdNode:h,doc:o,line:f,startLine:u},v=(eJ(h)?nk[e](m):nC[e](m)).changedResults;p=Math.max(t.changeToListPerLine(i,v,{from:tX(o,v[0].line-1).startOffset,startLine:v[0].line,endLine:eP(v).line,indexDiff:1}),p),v&&(d=d.concat(v.map(function(e){return e.line})))}}return r(i.setSelection(e$(i,i.mapping.map(p)))),!0}}},t.prototype.changeToListPerLine=function(e,t,n){for(var r=n.from,o=n.startLine,i=n.endLine,a=n.indexDiff,s=void 0===a?0:a,l=0,u=function(n){var o=e.doc.child(n),i=o.nodeSize,a=o.content,u=e.mapping.map(r),p=u+a.size,d=t.filter(function(e){return e.line-s===n})[0];d&&(e.replaceWith(u,p,eV(c.context.schema,d.text)),l=Math.max(l,r+a.size)),r+=i},c=this,p=o-s;p<=i-s;p+=1)u(p);return l},t.prototype.toggleTask=function(){var e=this;return function(t,n){for(var r=t.selection,o=t.tr,i=t.doc,a=t.schema,s=e.context.toastMark,l=tZ(r),u=l.startIndex,c=l.endIndex,p=null,d=u;d<=c;d+=1){var f=s.findFirstNodeAtLine(d+1);if(eJ(f)&&f.listData.task){var h=f.listData,m=h.checked,v=h.padding,g=m?" ":"x",y=f.sourcepos[0],b=tX(i,y[0]-1).startOffset;b+=y[1]+v,p=o.replaceWith(b,b+1,a.text(g))}}return!!p&&(n(p),!0)}},t.prototype.commands=function(){return{bulletList:this.toList("bullet"),orderedList:this.toList("ordered"),taskList:this.toList("task")}},t.prototype.keymaps=function(){var e=this.toList("bullet")(),t=this.toList("ordered")(),n=this.toList("task")(),r=this.toggleTask();return{"Mod-u":e,"Mod-U":e,"Mod-o":t,"Mod-O":t,"alt-t":n,"alt-T":n,"Shift-Ctrl-x":r,"Shift-Ctrl-X":r,Enter:this.extendList()}},t}(no);function nF(e,t){return function(){return function(n,r){var o=n.tr,i=n.selection,a=tq(e)?e:function(t){return e.test(t)},s=t.length,l=o.doc,u=tU(i),c=u[0],p=u[1],d=Math.max(c-s,1),f=Math.min(p+s,l.content.size-1),h=i.content(),m=h.content.textBetween(0,h.content.size,"\n"),v=l.textBetween(d,c,"\n"),g=l.textBetween(p,f,"\n");
1if(m=""+v+m+g,v&&g&&a(m))o.delete(f-s,f).delete(d,d+s);else{o.insertText(t,p).insertText(t,c);var y=i.empty?e$(o,c+s):e$(o,c+s,p+s);o.setSelection(y)}return r(o),!0}}}var nq=/^(\*{2}|_{2}).*([\s\S]*)\1$/m,n_=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Z(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"strong"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return{toDOM:function(){return["span",{class:tw("strong")},0]}}},enumerable:!1,configurable:!0}),t.prototype.bold=function(){return nF(nq,"**")},t.prototype.commands=function(){return{bold:this.bold()}},t.prototype.keymaps=function(){var e=this.bold()();return{"Mod-b":e,"Mod-B":e}},t}(no),nj=/^(~{2}).*([\s\S]*)\1$/m,nz=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Z(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"strike"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return{toDOM:function(){return["span",{class:tw("strike")},0]}}},enumerable:!1,configurable:!0}),t.prototype.commands=function(){return nF(nj,"~~")},t.prototype.keymaps=function(){var e=this.commands()();return{"Mod-s":e,"Mod-S":e}},t}(no),nU=/^(\*|_).*([\s\S]*)\1$/m,nV=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Z(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"emph"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return{toDOM:function(){return["span",{class:tw("emph")},0]}}},enumerable:!1,configurable:!0}),t.prototype.italic=function(){return nF(nU,"*")},t.prototype.commands=function(){return{italic:this.italic()}},t.prototype.keymaps=function(){var e=this.italic()();return{"Mod-i":e,"Mod-I":e}},t}(no),n$=/^(`).*([\s\S]*)\1$/m,nW=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Z(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"code"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return{attrs:{start:{default:!1},end:{default:!1},marked:{default:!1}},toDOM:function(e){var t=e.attrs,n=t.start,r=t.end,o=t.marked,i="code";return n&&(i+="|delimiter|start"),r&&(i+="|delimiter|end"),o&&(i+="|marked-text"),["span",{class:tw.apply(void 0,i.split("|"))},0]}}},enumerable:!1,configurable:!0}),t.prototype.commands=function(){return nF(n$,"`")},t.prototype.keymaps=function(){var e=this.commands()();return{"Shift-Mod-c":e,"Shift-Mod-C":e}},t}(no),nG=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Z(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"link"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return{attrs:{url:{default:!1},desc:{default:!1}}
1,toDOM:function(e){var t=e.attrs,n=t.url,r=t.desc,o="link";return n&&(o+="|link-url|marked-text"),r&&(o+="|link-desc|marked-text"),["span",{class:tw.apply(void 0,o.split("|"))},0]}}},enumerable:!1,configurable:!0}),t.prototype.addLinkOrImage=function(e){return function(t){return function(n,r){var o=n.selection,i=n.tr,a=n.schema,s=tU(o),l=s[0],u=s[1],c=t.linkText,p=t.altText,d=t.linkUrl,f=t.imageUrl,h=c,m=d,v="";return"image"===e&&(h=p,m=f,v="!"),v+="["+(h=eI(h))+"]("+m+")",r(i.replaceWith(l,u,eV(a,v))),!0}}},t.prototype.commands=function(){return{addImage:this.addLinkOrImage("image"),addLink:this.addLinkOrImage("link")}},t}(no),nK=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Z(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"taskDelimiter"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return{toDOM:function(){return["span",{class:tw("delimiter","list-item")},0]}}},enumerable:!1,configurable:!0}),t}(no),nZ=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Z(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"delimiter"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return{toDOM:function(){return["span",{class:tw("delimiter")},0]}}},enumerable:!1,configurable:!0}),t}(no),nX=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Z(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"meta"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return{toDOM:function(){return["span",{class:tw("meta")},0]}}},enumerable:!1,configurable:!0}),t}(no),nQ=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Z(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"markedText"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return{toDOM:function(){return["span",{class:tw("marked-text")},0]}}},enumerable:!1,configurable:!0}),t}(no),nY=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Z(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"tableCell"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return{toDOM:function(){return["span",{class:tw("table-cell")},0]}}},enumerable:!1,configurable:!0}),t}(no),nJ=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Z(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"html"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return{toDOM:function(){return["span",{class:tw("html")},0]}}},enumerable:!1,configurable:!0}),t}(no),n0=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Z(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"customBlock"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return{toDOM:function(){return["span",{class:tw("custom-block")},0]}}},enumerable:!1,configurable:!0}),t.prototype.commands=function(){return function(e){return function(t,n){var r=t.selection,o=t.schema,i=t.tr,a=tZ(r),s=a.startFromOffset,l=a.endToOffset;if(!(null==e?void 0:e.info))return!1;var u="$$"+e.info,c=eV(o,u),p=eV(o,"$$");return i.insert(s,c).split(s+u.length),i.split(i.mapping.map(l)).insert(i.mapping.map(l),p),n(i.setSelection(e$(i,i.mapping.map(l)-4))),!0}}},t}(no),n1=/x|backspace/i,n2=/^\[(\s*)(x?)(\s*)\](?:\s+)/i,n3=/\r\n|\n|\r/,n5=function(e){function t(t,n){var r=e.call(this,t)||this,o=n.toastMark,i=n.useCommandShortcut,a=n.mdPlugins;return r.editorType="markdown",r.el.classList.add("md-mode"),r.toastMark=o,r.extraPlugins=void 0===a?[]:a,r.specs=r.createSpecs(),r.schema=r.createSchema(),r.context=r.createContext(),r.keymaps=r.createKeymaps(void 0===i||i),r.view=r.createView(),r.commands=r.createCommands(),r.specs.setContext(X(X({},r.context),{view:r.view})),r.createClipboard(),r.eventEmitter.listen("changePreviewTabWrite",function(e){return r.toggleActive(!0,e)}),r.eventEmitter.listen("changePreviewTabPreview",function(){return r.toggleActive(!1)}),r.initEvent(),r}return Z(t,e),t.prototype.toggleActive=function(e,t){tx(this.el,"active",e),e?t||this.focus():this.blur()},t.prototype.createClipboard=function(){var e=this;this.clipboard=document.createElement("textarea"),this.clipboard.className=tb("pseudo-clipboard"),this.clipboard.addEventListener("paste",function(t){var n=t.clipboardData||window.clipboardData,r=n&&n.items;if(r&&!ez(r).some(function(e){return"string"===e.kind&&"text/rtf"===e.type})){var o=tO(r);o&&(t.preventDefault(),tI(e.eventEmitter,o,t.type))}}),this.clipboard.addEventListener("input",function(t){var n=t.target.value;e.replaceSelection(n),t.preventDefault(),t.target.value=""}),this.el.insertBefore(this.clipboard,this.view.dom)},t.prototype.createContext=function(){return{toastMark:this.toastMark,schema:this.schema,eventEmitter:this.eventEmitter}},t.prototype.createSpecs=function(){return new tz([new nr,new nN,new tB,new nS,new nD,new nl,new nI,new n0,new nP,new nY,new nH,new nB,new n_,new nz,new nV,new nW,new nG,new nZ,new nK,new nQ,new nX,new nJ])},t.prototype.createPlugins=function(){var e,t,n,r,o,i,a,s,l;return Q([(t=(e=this.context).schema,n=e.toastMark,new U.k_({appendTransaction:function(e,r,o){var i=e[0],a=o.tr;if(i.docChanged){var s,l,u,c,p,d,f,h,m,v=[];i.getMeta("editResult").forEach(function(e){var t=e.nodes,r=e.removedNodeRange;if(t.length){v=v.concat((o=a,i=t,s=o.doc,l=i[0].sourcepos[0],u=eP(i).sourcepos[1],c=[l[0],l[1]],p=[u[0],u[1]+1],d=[],!function(e,t,n){var r=[];nt={};for(var o=t[0]-1;o<n[0];o+=1){var i=e.child(o),a=i.attrs.codeEnd,s=i.attrs.codeStart;if(s&&a&&!eL(r,s)){r.push(s),a=Math.min(a,e.childCount);for(var l=s-1,u=n[0],c=l;c<u;c+=1)nt[c]=!0}}}(s,l,u),d.push({start:c,end:p}),d));for(var o,i,s,l,u,c,p,d,f=0;f<t.length;f++)for(var h=t[f].walker(),m=h.next();m;){var g=m.node;m.entering&&(v=v.concat(function(e,t){var n,r,o=t.getLineTexts(),i=[eZ(e),eQ(e)],a=[eX(e),eY(e)+1],s=(n=o[a[0]-1],tq(t7[r
1=e.type])?t7[r](e,i,a,n):ne[r]?[t5(i,a,ne[r])]:null);return null!=s?s:[]}(g,n))),m=h.next()}}else if(r)for(var y=a.doc.childCount-1,b=r.line,w=b[0],k=b[1],C=Math.min(w,y),x=Math.min(k,y),T=C;T<=x;T+=1)nt[T]=!0}),s=a,l=t,u=v,c=s.doc,p=l.nodes.paragraph,d=tG(c,c.childCount),u.forEach(function(e){var t=e.start,n=e.end,r=e.spec,o=e.lineBackground,i=Math.min(t[0],c.childCount)-1,a=Math.min(n[0],c.childCount)-1,u=c.child(i),f=c.child(a),h=d[i],m=d[a];h+=t[1]+t$(u,t[1]-1),m+=n[1]+t$(f,n[1]-1),r?o?function(e,t,n,r,o){void 0===o&&(o={});for(var i=r.startIndex,a=r.endIndex,s=r.from,l=r.to,u=!1,c=i;c<=a;c+=1)delete nt[c],u=function(e,t,n){return Object.keys(n).some(function(r){return n[r]!==e.child(t).attrs[r]})}(t,c,o);u&&e.setBlockType(s,l,n,o)}(s,c,p,{from:h,to:m,startIndex:i,endIndex:a},r.attrs):s.addMark(h,m,l.mark(r.type,r.attrs)):s.removeMark(h,m)}),f=s,h=d,m=p,Object.keys(nt).forEach(function(e){var t=Number(e),n=Math.min(Number(e)+1,f.doc.childCount-1),r=h[t],o=h[n]-1;t===n&&(o+=2),f.setBlockType(r,o,m)})}return a.setMeta("widget",i.getMeta("widget"))}})),(o=(r=this.context).toastMark,i=r.eventEmitter,new U.k_({view:function(){return{update:function(e,t){var n=e.state,r=n.doc,a=n.selection;if(!(t&&t.doc.eq(r)&&t.selection.eq(a))){var s=a.from,l=n.doc.resolve(s).start(),u=n.doc.content.findIndex(s).index+1,c=s-l;s===l&&(c+=1);var p=[u,c],d=o.findNodeAtPosition(p),f=function(e){var t,n={indent:{active:!1,disabled:!0},outdent:{active:!1,disabled:!0}},r=!0,o=e;for(void 0===t&&(t=!0),o=t?o:o.parent;o&&"document"!==o.type;)(function(e){var t,o,i=(o=(t=e).type,eJ(t)?t.listData.task?"taskList":"ordered"===t.listData.type?"orderedList":"bulletList":-1!==o.indexOf("table")?"table":eL(nn,o)?o:null);i&&("bulletList"===i||"orderedList"===i?r&&(n[i]={active:!0},n.indent.disabled=!1,n.outdent.disabled=!1,r=!1):n[i]={active:!0})})(o),o=o.parent;return n}(d);i.emit("changeToolbarState",{cursorPos:p,mdNode:d,toolbarState:f}),i.emit("setFocusedNode",d)}}}}})),(s=(a=this.context).schema,l=a.toastMark,new U.k_({props:{handleDOMEvents:{keyup:function(e,t){var n,r=e.state,o=r.doc,i=r.tr,a=r.selection;if(a.empty&&n1.test(t.key)){var u=tZ(a),c=u.startIndex,p=u.startFromOffset,d=u.from,f=e2(l.findNodeAtPosition([c+1,d-p+1]),function(e){var t;return"paragraph"===e.type&&(null==(t=e.parent)?void 0:t.type)==="item"});if(null==(n=null==f?void 0:f.firstChild)?void 0:n.literal){var h=f.firstChild,m=h.literal.match(n2);if(m){var v=h.sourcepos[0],g=m[1],y=m[2],b=m[3],w=g.length+b.length,k=tX(o,v[0]-1).startOffset,C=v[1]+k;y?(i.replaceWith(C,(w?w+1:0)+C,s.text(y)),e.dispatch(i)):w||(i.insertText(" ",C),e.dispatch(i))}}}return!1}}}}))],this.createPluginProps()).concat(this.defaultPlugins)},t.prototype.createView=function(){var e=this;return new j.Lz(this.el,{state:this.createState(),dispatchTransaction:function(t){e.updateMarkdown(t);var n=e.view.state.applyTransaction(t).state;e.view.updateState(n),e.emitChangeEvent(t)},handleKeyDown:function(t,n){return(n.metaKey||n.ctrlKey)&&"V"===n.key.toUpperCase()&&e.clipboard.focus(),e.eventEmitter.emit("keydown",e.editorType,n),!1},handleDOMEvents:{copy:function(t,n){return e.captureCopy(n)},cut:function(t,n){return e.captureCopy(n,"cut")},scroll:function(){return e.eventEmitter.emit("scroll","editor"),!0},keyup:function(t,n){return e.eventEmitter.emit("keyup",e.editorType,n),!1}},nodeViews:{widget:tP}})},t.prototype.createCommands=function(){return this.specs.commands(this.view)},t.prototype.captureCopy=function(e,t){e.preventDefault();var n=this.view.state,r=n.selection,o=n.tr;if(r.empty)return!0;var i=this.getChanged(r.content());return e.clipboardData?e.clipboardData.setData("text/plain",i):window.clipboardData.setData("Text",i),"cut"===t&&this.view.dispatch(o.deleteSelection().scrollIntoView().setMeta("uiEvent","cut")),!0},t.prototype.updateMarkdown=function(e){var t=this;e.docChanged&&e.steps.forEach(function(n,r){if(n.slice&&!(n instanceof z.Wg)){var o=e.docs[r],i=[n.from,n.to],a=tW(o,i[0],i[1]),s=a[0],l=a[1],u=t.getChanged(n.slice);s[0]===l[0]&&s[1]===l[1]&&""===u&&(u="\n");var c=t.toastMark.editMarkdown(s,l,u);t.eventEmitter.emit("updatePreview",c),e.setMeta("editResult",c).scrollIntoView()}})},t.prototype.getChanged=function(e){var t="",n=e.content.size;return e.content.nodesBetween(0,n,function(e,r){e.isText?t+=e.text.slice(Math.max(0,r)-r,n-r):e.isBlock&&r>0&&(t+="\n")}),t},t.prototype.setSelection=function(e,t){void 0===t&&(t=e);var n=this.view.state.tr,r=tK(n.doc,e,t),o=r[0],i=r[1];this.view.dispatch(n.setSelection(e$(n,o,i)).scrollIntoView())},t.prototype.replaceSelection=function(e,t,n){var r,o=this.view.state,i=o.tr,a=o.schema,s=o.doc,l=e.split(n3).map(function(e){return eU(a,tr(e,a))}),u=new _.Ji(_.FK.from(l),1,1);if(this.focus(),t&&n){var c=tK(s,t,n),p=c[0],d=c[1];r=i.replaceRange(p,d,u)}else r=i.replaceSelection(u);this.view.dispatch(r.scrollIntoView())},t.prototype.deleteSelection=function(e,t){var n,r=this.view.state,o=r.tr,i=r.doc;if(e&&t){var a=tK(i,e,t),s=a[0],l=a[1];n=o.deleteRange(s,l)}else n=o.deleteSelection();this.view.dispatch(n.scrollIntoView())},t.prototype.getSelectedText=function(e,t){var n=this.view.state,r=n.doc,o=n.selection,i=o.from,a=o.to;
1if(e&&t){var s=tK(r,e,t);i=s[0],a=s[1]}return r.textBetween(i,a,"\n")},t.prototype.getSelection=function(){var e=this.view.state.selection,t=e.from,n=e.to;return tW(this.view.state.tr.doc,t,n)},t.prototype.setMarkdown=function(e,t){void 0===t&&(t=!0);var n=e.split(n3),r=this.view.state,o=r.tr,i=r.doc,a=r.schema,s=n.map(function(e){return eU(a,tr(e,a))});this.view.dispatch(o.replaceWith(0,i.content.size,s)),t&&this.moveCursorToEnd(!0)},t.prototype.addWidget=function(e,t,n){var r=this.view.state,o=r.tr,i=r.doc,a=r.selection,s=n?tK(i,n,n)[0]:a.to;this.view.dispatch(o.setMeta("widget",{pos:s,node:e,style:t}))},t.prototype.replaceWithWidget=function(e,t,n){var r=this.view.state,o=r.tr,i=r.schema,a=tK(r.doc,e,t),s=tr(n,i);this.view.dispatch(o.replaceWith(a[0],a[1],s))},t.prototype.getRangeInfoOfNode=function(e){var t=this.view.state,n=t.doc,r=t.selection,o=e||tW(n,r.from)[0],i=this.toastMark.findNodeAtPosition(o);return"text"===i.type&&"paragraph"!==i.parent.type&&(i=i.parent),i.sourcepos[1][1]+=1,{range:i.sourcepos,type:i.type}},t.prototype.getMarkdown=function(){return this.toastMark.getLineTexts().map(function(e){return e7(e)}).join("\n")},t.prototype.getToastMark=function(){return this.toastMark},t}(tF),n4="_feEventKey",n6=function(e,t){var n,r=e[n4];return r||(r=e[n4]={}),(n=r[t])||(n=r[t]=[]),n};function n9(e,t,n){var r,o=n6(e,t);n?(eo(o,function(o,i){return n!==o.handler||(n8(e,t,o.wrappedHandler),r=i,!1)}),o.splice(r,1)):(eo(o,function(n){n8(e,t,n.wrappedHandler)}),o.splice(0,o.length))}function n8(e,t,n){"removeEventListener"in e?e.removeEventListener(t,n):"detachEvent"in e&&e.detachEvent("on"+t,n)}var n7=function(e,t,n){if(et(t))return void eo(t.split(/\s+/g),function(t){n9(e,t,n)});eo(t,function(t,n){n9(e,n,t)})};function re(e,t,n,r){var o,i,a,s,l,u;function c(t){n.call(r||e,t||window.event)}"addEventListener"in e?e.addEventListener(t,c):"attachEvent"in e&&e.attachEvent("on"+t,c),o=e,i=t,a=n,s=c,l=n6(o,i),u=!1,eo(l,function(e){return e.handler!==a||(u=!0,!1)}),u||l.push({handler:a,wrappedHandler:s})}var rt=function(e,t,n,r){if(et(t))return void eo(t.split(/\s+/g),function(t){re(e,t,n,r)});eo(t,function(t,r){re(e,r,t,n)})},rn=function(e,t){return(rn=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function rr(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}rn(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var ro=function(){return(ro=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function ri(e,t,n){if(n||2==arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}var ra="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{},rs={};function rl(e,t,n){var r,o,i,a,s,l="";for("string"!=typeof t&&(n=t,t=rl.defaultChars),void 0===n&&(n=!0),s=function(e){var t,n,r=rs[e];if(r)return r;for(t=0,r=rs[e]=[];t<128;t++)n=String.fromCharCode(t),/^[0-9a-z]$/i.test(n)?r.push(n):r.push("%"+("0"+t.toString(16).toUpperCase()).slice(-2));for(t=0;t<e.length;t++)r[e.charCodeAt(t)]=e[t];return r}(t),r=0,o=e.length;r<o;r++){if(i=e.charCodeAt(r),n&&37===i&&r+2<o&&/^[0-9a-f]{2}$/i.test(e.slice(r+1,r+3))){l+=e.slice(r,r+3),r+=2;continue}if(i<128){l+=s[i];continue}if(i>=55296&&i<=57343){if(i>=55296&&i<=56319&&r+1<o&&(a=e.charCodeAt(r+1))>=56320&&a<=57343){l+=encodeURIComponent(e[r]+e[r+1]),r++;continue}l+="%EF%BF%BD";continue}l+=encodeURIComponent(e[r])}return l}rl.defaultChars=";/?:@&=+$,-_.!~*'()#",rl.componentChars="-_.!~*'()";var ru={},rc={},rp={Aacute:"\xc1",aacute:"\xe1",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"\xc2",acirc:"\xe2",acute:"\xb4",Acy:"А",acy:"а",AElig:"\xc6",aelig:"\xe6",af:"⁡",Afr:"\uD835\uDD04",afr:"\uD835\uDD1E",Agrave:"\xc0",agrave:"\xe0",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",amp:"&",AMP:"&",andand:"⩕",And:"⩓",and:"∧",andd:"⩜",andslo
1pe:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angmsd:"∡",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"\xc5",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"\uD835\uDD38",aopf:"\uD835\uDD52",apacir:"⩯",ap:"≈",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"⁡",approx:"≈",approxeq:"≊",Aring:"\xc5",aring:"\xe5",Ascr:"\uD835\uDC9C",ascr:"\uD835\uDCB6",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"\xc3",atilde:"\xe3",Auml:"\xc4",auml:"\xe4",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",barwed:"⌅",Barwed:"⌆",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",because:"∵",Because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"\uD835\uDD05",bfr:"\uD835\uDD1F",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"\uD835\uDD39",bopf:"\uD835\uDD53",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxdl:"┐",boxdL:"╕",boxDl:"╖",boxDL:"╗",boxdr:"┌",boxdR:"╒",boxDr:"╓",boxDR:"╔",boxh:"─",boxH:"═",boxhd:"┬",boxHd:"╤",boxhD:"╥",boxHD:"╦",boxhu:"┴",boxHu:"╧",boxhU:"╨",boxHU:"╩",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxul:"┘",boxuL:"╛",boxUl:"╜",boxUL:"╝",boxur:"└",boxuR:"╘",boxUr:"╙",boxUR:"╚",boxv:"│",boxV:"║",boxvh:"┼",boxvH:"╪",boxVh:"╫",boxVH:"╬",boxvl:"┤",boxvL:"╡",boxVl:"╢",boxVL:"╣",boxvr:"├",boxvR:"╞",boxVr:"╟",boxVR:"╠",bprime:"‵",breve:"˘",Breve:"˘",brvbar:"\xa6",bscr:"\uD835\uDCB7",Bscr:"ℬ",bsemi:"⁏",bsim:"∽",b
1sime:"⋍",bsolb:"⧅",bsol:"\\",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",capand:"⩄",capbrcup:"⩉",capcap:"⩋",cap:"∩",Cap:"⋒",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"\xc7",ccedil:"\xe7",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"\xb8",Cedilla:"\xb8",cemptyv:"⦲",cent:"\xa2",centerdot:"\xb7",CenterDot:"\xb7",cfr:"\uD835\uDD20",Cfr:"ℭ",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"\xae",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cir:"○",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",colon:":",Colon:"∷",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",conint:"∮",Conint:"∯",ContourIntegral:"∮",copf:"\uD835\uDD54",Copf:"ℂ",coprod:"∐",Coproduct:"∐",copy:"\xa9",COPY:"\xa9",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",cross:"✗",Cross:"⨯",Cscr:"\uD835\uDC9E",cscr:"\uD835\uDCB8",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",cupbrcap:"⩈",cupcap:"⩆",CupCap:"≍",cup:"∪",Cup:"⋓",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"\xa4",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",dagger:"†",Dagger:"‡",daleth:"ℸ",darr:"↓",Darr:"↡",dArr:"⇓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",ddagger:"‡",ddarr:"⇊",DD:"ⅅ",dd:"ⅆ",DDotrahd:"⤑",ddotseq:"⩷",deg:"\xb0",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"\uD835\uDD07",dfr:"\uD835\uDD21",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"\xb4",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",diamond:"⋄",Diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"\xa8",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"\xf7",divide:"\xf7",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"\uD835\uDD3B",dopf:"\uD835\uDD55",Dot:"\xa8",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"\xa8",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrowBar:"⤓",downarrow:"↓",DownArrow:"↓",Downarrow:"⇓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVectorBar:"⥖",DownLeftVector:"↽",DownRightTeeVector:"⥟",DownRightVectorBar:"⥗",DownRightVector:"⇁",DownTeeArrow:"↧",DownTee:"⊤",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"\uD835\uDC9F",dscr:"\uD835\uDCB9",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"\xc9",eacute:"\xe9",easter:"⩮",Ecaron:"Ě",ecaron:"ě",Ecirc:"\xca",ecirc:"\xea",ecir:"≖",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",edot:"ė",eDot:"≑",ee:"ⅇ",efDot:"≒",Efr:"\uD835\uDD08",efr:"\uD835\uDD22",eg:"⪚",Egrave:"\xc8",egrave:"\xe8",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp13:" ",emsp14:" ",emsp:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"\uD835\uDD3C",eopf:"\uD835\uDD56",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",escr:"ℯ",Escr:"ℰ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"\xd0",eth:"\xf0",Euml:"\xcb",euml:"\xeb",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",exponentiale:"ⅇ",ExponentialE:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"\uD835\uDD09",ffr:"\uD835\uDD23",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"\uD835\uDD3D",fopf:"\uD835\uDD57",forall:"∀",ForAll:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"\xbd",frac13:"⅓",frac14:"\xbc",frac15:"⅕",frac16:"⅙",frac18
1:"⅛",frac23:"⅔",frac25:"⅖",frac34:"\xbe",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",fscr:"\uD835\uDCBB",Fscr:"ℱ",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ä¢",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ä ",gdot:"Ä¡",ge:"≥",gE:"≧",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",gescc:"⪩",ges:"⩾",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"\uD835\uDD0A",gfr:"\uD835\uDD24",gg:"≫",Gg:"⋙",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gla:"⪥",gl:"≷",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gne:"⪈",gnE:"≩",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"\uD835\uDD3E",gopf:"\uD835\uDD58",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"\uD835\uDCA2",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",gtcc:"⪧",gtcir:"⩺",gt:">",GT:">",Gt:"≫",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"\xbd",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",harrcir:"⥈",harr:"↔",hArr:"⇔",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"Ä¥",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",hfr:"\uD835\uDD25",Hfr:"ℌ",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",hopf:"\uD835\uDD59",Hopf:"ℍ",horbar:"―",HorizontalLine:"─",hscr:"\uD835\uDCBD",Hscr:"ℋ",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"\xcd",iacute:"\xed",ic:"⁣",Icirc:"\xce",icirc:"\xee",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"\xa1",iff:"⇔",ifr:"\uD835\uDD26",Ifr:"ℑ",Igrave:"\xcc",igrave:"\xec",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Imacr:"Ī",imacr:"Ä«",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",Im:"ℑ",imof:"⊷",imped:"Ƶ",Implies:"⇒",incare:"℅",in:"∈",infin:"∞",infintie:"⧝",inodot:"ı",intcal:"⊺",int:"∫",Int:"∬",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"⁣",InvisibleTimes:"⁢",IOcy:"Ё",iocy:"ё",Iogon:"Ä®",iogon:"į",Iopf:"\uD835\uDD40",iopf:"\uD835\uDD5A",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"\xbf",iscr:"\uD835\uDCBE",Iscr:"ℐ",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",Itilde:"Ĩ",itilde:"Ä©",Iukcy:"І",iukcy:"і",Iuml:"\xcf",iuml:"\xef",Jcirc:"Ä´",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"\uD835\uDD0D",jfr:"\uD835\uDD27",jmath:"È·",Jopf:"\uD835\uDD41",jopf:"\uD835\uDD5B",Jscr:"\uD835\uDCA5",jscr:"\uD835\uDCBF",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"Ä·",Kcy:"К",kcy:"к",Kfr:"\uD835\uDD0E",kfr:"\uD835\uDD28",kgreen:"ĸ",KHcy:"Ð¥",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"\uD835\uDD42",kopf:"\uD835\uDD5C",Kscr:"\uD835\uDCA6",kscr:"\uD835\uDCC0",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",lang:"⟨",Lang:"⟪",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"\xab",larrb:"⇤",larrbfs:"⤟",larr:"←",Larr:"↞",lArr:"⇐",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",latail:"⤙",lAtail:"⤛",lat:"⪫",late:"⪭",lates:"⪭︀",lbarr:"⤌",lBarr:"⤎",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ä»",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",le:"≤",lE:"≦",LeftAngleBracket:"⟨",LeftArrowBar:"⇤",leftarrow:"←",LeftArrow:"←",Leftarrow:"⇐",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVectorBar:"⥙",LeftDownVector:"⇃",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",leftrightarrow:"↔",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTeeArrow:"↤",LeftTee:"⊣",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangleBar:"⧏",LeftTriangle:"⊲",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVectorBar:"⥘",LeftUpVector:"↿",LeftVectorBar:"⥒",LeftVector:"↼",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",lescc:"⪨",les:"⩽",lesdot:"â©¿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"â
1‹–",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"\uD835\uDD0F",lfr:"\uD835\uDD29",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",llarr:"⇇",ll:"≪",Ll:"⋘",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ä¿",lmidot:"ŀ",lmoustache:"⎰",lmoust:"⎰",lnap:"⪉",lnapprox:"⪉",lne:"⪇",lnE:"≨",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",longleftarrow:"⟵",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftrightarrow:"⟷",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longmapsto:"⟼",longrightarrow:"⟶",LongRightArrow:"⟶",Longrightarrow:"⟹",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"\uD835\uDD43",lopf:"\uD835\uDD5D",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"â§«",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",lscr:"\uD835\uDCC1",Lscr:"ℒ",lsh:"↰",Lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",ltcc:"⪦",ltcir:"⩹",lt:"<",LT:"<",Lt:"≪",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"â©»",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"\xaf",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"\uD835\uDD10",mfr:"\uD835\uDD2A",mho:"℧",micro:"\xb5",midast:"*",midcir:"â«°",mid:"∣",middot:"\xb7",minusb:"⊟",minus:"−",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"\uD835\uDD44",mopf:"\uD835\uDD5E",mp:"∓",mscr:"\uD835\uDCC2",Mscr:"ℳ",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natural:"♮",naturals:"ℕ",natur:"♮",nbsp:"\xa0",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",nearhk:"⤤",nearr:"↗",neArr:"⇗",nearrow:"↗",ne:"≠",nedot:"≐̸",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:"\n",nexist:"∄",nexists:"∄",Nfr:"\uD835\uDD11",nfr:"\uD835\uDD2B",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nharr:"↮",nhArr:"⇎",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlarr:"↚",nlArr:"⇍",nldr:"‥",nlE:"≦̸",nle:"≰",nleftarrow:"↚",nLeftarrow:"⇍",nleftrightarrow:"↮",nLeftrightarrow:"⇎",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:"\xa0",nopf:"\uD835\uDD5F",Nopf:"ℕ",Not:"⫬",not:"\xac",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangleBar:"⧏̸",NotLeftTriangle:"⋪",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangleBar:"⧐̸",NotRightTriangle:"⋫",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",nparallel:"∦",npar:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"â
1‹ ",nprec:"⊀",npreceq:"⪯̸",npre:"⪯̸",nrarrc:"⤳̸",nrarr:"↛",nrArr:"⇏",nrarrw:"↝̸",nrightarrow:"↛",nRightarrow:"⇏",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"\uD835\uDCA9",nscr:"\uD835\uDCC3",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"\xd1",ntilde:"\xf1",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nvdash:"⊬",nvDash:"⊭",nVdash:"⊮",nVDash:"⊯",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwarr:"↖",nwArr:"⇖",nwarrow:"↖",nwnear:"⤧",Oacute:"\xd3",oacute:"\xf3",oast:"⊛",Ocirc:"\xd4",ocirc:"\xf4",ocir:"⊚",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"\uD835\uDD12",ofr:"\uD835\uDD2C",ogon:"˛",Ograve:"\xd2",ograve:"\xf2",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"\uD835\uDD46",oopf:"\uD835\uDD60",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",orarr:"↻",Or:"⩔",or:"∨",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"\xaa",ordm:"\xba",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"\uD835\uDCAA",oscr:"ℴ",Oslash:"\xd8",oslash:"\xf8",osol:"⊘",Otilde:"\xd5",otilde:"\xf5",otimesas:"⨶",Otimes:"⨷",otimes:"⊗",Ouml:"\xd6",ouml:"\xf6",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",para:"\xb6",parallel:"∥",par:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"\uD835\uDD13",pfr:"\uD835\uDD2D",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plus:"+",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"\xb1",plusmn:"\xb1",plussim:"⨦",plustwo:"⨧",pm:"\xb1",Poincareplane:"ℌ",pointint:"⨕",popf:"\uD835\uDD61",Popf:"ℙ",pound:"\xa3",prap:"⪷",Pr:"⪻",pr:"≺",prcue:"≼",precapprox:"⪷",prec:"≺",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",pre:"⪯",prE:"⪳",precsim:"≾",prime:"′",Prime:"″",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportional:"∝",Proportion:"∷",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"\uD835\uDCAB",pscr:"\uD835\uDCC5",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"\uD835\uDD14",qfr:"\uD835\uDD2E",qint:"⨌",qopf:"\uD835\uDD62",Qopf:"ℚ",qprime:"⁗",Qscr:"\uD835\uDCAC",qscr:"\uD835\uDCC6",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",quot:'"',QUOT:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",rang:"⟩",Rang:"⟫",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"\xbb",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarr:"→",Rarr:"↠",rArr:"⇒",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",ratail:"⤚",rAtail:"⤜",ratio:"∶",rationals:"ℚ",rbarr:"⤍",rBarr:"⤏",RBarr:"⤐",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",Re:"ℜ",rect:"▭",reg:"\xae",REG:"\xae",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rf
1isht:"⥽",rfloor:"⌋",rfr:"\uD835\uDD2F",Rfr:"ℜ",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrowBar:"⇥",rightarrow:"→",RightArrow:"→",Rightarrow:"⇒",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVectorBar:"⥕",RightDownVector:"⇂",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTeeArrow:"↦",RightTee:"⊢",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangleBar:"⧐",RightTriangle:"⊳",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVectorBar:"⥔",RightUpVector:"↾",RightVectorBar:"⥓",RightVector:"⇀",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoustache:"⎱",rmoust:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",ropf:"\uD835\uDD63",Ropf:"ℝ",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",rscr:"\uD835\uDCC7",Rscr:"ℛ",rsh:"↱",Rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",scap:"⪸",Scaron:"Š",scaron:"š",Sc:"⪼",sc:"≻",sccue:"≽",sce:"⪰",scE:"⪴",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdotb:"⊡",sdot:"⋅",sdote:"⩦",searhk:"⤥",searr:"↘",seArr:"⇘",searrow:"↘",sect:"\xa7",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"\uD835\uDD16",sfr:"\uD835\uDD30",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"\xad",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",solbar:"⌿",solb:"⧄",sol:"/",Sopf:"\uD835\uDD4A",sopf:"\uD835\uDD64",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",square:"□",Square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squ:"□",squf:"▪",srarr:"→",Sscr:"\uD835\uDCAE",sscr:"\uD835\uDCC8",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"\xaf",sub:"⊂",Sub:"⋐",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",subset:"⊂",Subset:"⋐",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succapprox:"⪸",succ:"≻",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",sum:"∑",Sum:"∑",sung:"♪",sup1:"\xb9",sup2:"\xb2",sup3:"\xb3",sup:"⊃",Sup:"⋑",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",supset:"⊃",Supset:"⋑",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swarr:"↙",swArr:"⇙",swarrow:"↙",swnwar:"⤪",szlig:"\xdf",Tab:"	",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"\uD835\uDD17",tfr:"\uD835\uDD31",there4:"∴",therefore:"∴",Therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickS
1pace:"  ",ThinSpace:" ",thinsp:" ",thkap:"≈",thksim:"∼",THORN:"\xde",thorn:"\xfe",tilde:"˜",Tilde:"∼",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",timesbar:"⨱",timesb:"⊠",times:"\xd7",timesd:"⨰",tint:"∭",toea:"⤨",topbot:"⌶",topcir:"⫱",top:"⊤",Topf:"\uD835\uDD4B",topf:"\uD835\uDD65",topfork:"⫚",tosa:"⤩",tprime:"‴",trade:"™",TRADE:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"\uD835\uDCAF",tscr:"\uD835\uDCC9",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"\xda",uacute:"\xfa",uarr:"↑",Uarr:"↟",uArr:"⇑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"\xdb",ucirc:"\xfb",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"\uD835\uDD18",ufr:"\uD835\uDD32",Ugrave:"\xd9",ugrave:"\xf9",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"\xa8",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"\uD835\uDD4C",uopf:"\uD835\uDD66",UpArrowBar:"⤒",uparrow:"↑",UpArrow:"↑",Uparrow:"⇑",UpArrowDownArrow:"⇅",updownarrow:"↕",UpDownArrow:"↕",Updownarrow:"⇕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",upsi:"υ",Upsi:"ϒ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTeeArrow:"↥",UpTee:"⊥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"\uD835\uDCB0",uscr:"\uD835\uDCCA",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"\xdc",uuml:"\xfc",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",varr:"↕",vArr:"⇕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",vBar:"⫨",Vbar:"⫫",vBarv:"⫩",Vcy:"В",vcy:"в",vdash:"⊢",vDash:"⊨",Vdash:"⊩",VDash:"⊫",Vdashl:"⫦",veebar:"⊻",vee:"∨",Vee:"⋁",veeeq:"≚",vellip:"⋮",verbar:"|",Verbar:"‖",vert:"|",Vert:"‖",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"\uD835\uDD19",vfr:"\uD835\uDD33",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"\uD835\uDD4D",vopf:"\uD835\uDD67",vprop:"∝",vrtri:"⊳",Vscr:"\uD835\uDCB1",vscr:"\uD835\uDCCB",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",wedge:"∧",Wedge:"⋀",wedgeq:"≙",weierp:"℘",Wfr:"\uD835\uDD1A",wfr:"\uD835\uDD34",Wopf:"\uD835\uDD4E",wopf:"\uD835\uDD68",wp:"℘",wr:"≀",wreath:"≀",Wscr:"\uD835\uDCB2",wscr:"\uD835\uDCCC",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"\uD835\uDD1B",xfr:"\uD835\uDD35",xharr:"⟷",xhArr:"⟺",Xi:"Ξ",xi:"ξ",xlarr:"⟵",xlArr:"⟸",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"\uD835\uDD4F",xopf:"\uD835\uDD69",xoplus:"⨁",xotime:"⨂",xrarr:"⟶",xrArr:"⟹",Xscr:"\uD835\uDCB3",xscr:"\uD835\uDCCD",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"\xdd",yacute:"\xfd",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"\xa5",Yfr:"\uD835\uDD1C",yfr:"\uD835\uDD36",YIcy:"Ї",yicy:"ї",Yopf:"\uD835\uDD50",yopf:"\uD835\uDD6A",Yscr:"\uD835\uDCB4",yscr:"\uD835\uDCCE",YUcy:"Ю",yucy:"ю",yuml:"\xff",Yuml:"Ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"​",Zeta:"Ζ",zeta:"ζ",zfr:"\uD835\uDD37",Zfr:"ℨ",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",zopf:"\uD835\uDD6B",Zopf:"ℤ",Zscr:"\uD835\uDCB5",zscr:"\uD835\uDCCF",zwj:"‍",zwnj:"‌"},rd={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'},rf={}
1,rh=ra&&ra.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(rf,"__esModule",{value:!0});var rm=rh({0:65533,128:8364,130:8218,131:402,132:8222,133:8230,134:8224,135:8225,136:710,137:8240,138:352,139:8249,140:338,142:381,145:8216,146:8217,147:8220,148:8221,149:8226,150:8211,151:8212,152:732,153:8482,154:353,155:8250,156:339,158:382,159:376}),rv=String.fromCodePoint||function(e){var t="";return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|1023&e),t+=String.fromCharCode(e)};rf.default=function(e){return e>=55296&&e<=57343||e>1114111?"�":(e in rm.default&&(e=rm.default[e]),rv(e))};var rg=ra&&ra.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(rc,"__esModule",{value:!0}),rc.decodeHTML=rc.decodeHTMLStrict=rc.decodeXML=void 0;var ry=rg(rp),rb=rg({Aacute:"\xc1",aacute:"\xe1",Acirc:"\xc2",acirc:"\xe2",acute:"\xb4",AElig:"\xc6",aelig:"\xe6",Agrave:"\xc0",agrave:"\xe0",amp:"&",AMP:"&",Aring:"\xc5",aring:"\xe5",Atilde:"\xc3",atilde:"\xe3",Auml:"\xc4",auml:"\xe4",brvbar:"\xa6",Ccedil:"\xc7",ccedil:"\xe7",cedil:"\xb8",cent:"\xa2",copy:"\xa9",COPY:"\xa9",curren:"\xa4",deg:"\xb0",divide:"\xf7",Eacute:"\xc9",eacute:"\xe9",Ecirc:"\xca",ecirc:"\xea",Egrave:"\xc8",egrave:"\xe8",ETH:"\xd0",eth:"\xf0",Euml:"\xcb",euml:"\xeb",frac12:"\xbd",frac14:"\xbc",frac34:"\xbe",gt:">",GT:">",Iacute:"\xcd",iacute:"\xed",Icirc:"\xce",icirc:"\xee",iexcl:"\xa1",Igrave:"\xcc",igrave:"\xec",iquest:"\xbf",Iuml:"\xcf",iuml:"\xef",laquo:"\xab",lt:"<",LT:"<",macr:"\xaf",micro:"\xb5",middot:"\xb7",nbsp:"\xa0",not:"\xac",Ntilde:"\xd1",ntilde:"\xf1",Oacute:"\xd3",oacute:"\xf3",Ocirc:"\xd4",ocirc:"\xf4",Ograve:"\xd2",ograve:"\xf2",ordf:"\xaa",ordm:"\xba",Oslash:"\xd8",oslash:"\xf8",Otilde:"\xd5",otilde:"\xf5",Ouml:"\xd6",ouml:"\xf6",para:"\xb6",plusmn:"\xb1",pound:"\xa3",quot:'"',QUOT:'"',raquo:"\xbb",reg:"\xae",REG:"\xae",sect:"\xa7",shy:"\xad",sup1:"\xb9",sup2:"\xb2",sup3:"\xb3",szlig:"\xdf",THORN:"\xde",thorn:"\xfe",times:"\xd7",Uacute:"\xda",uacute:"\xfa",Ucirc:"\xdb",ucirc:"\xfb",Ugrave:"\xd9",ugrave:"\xf9",uml:"\xa8",Uuml:"\xdc",uuml:"\xfc",Yacute:"\xdd",yacute:"\xfd",yen:"\xa5",yuml:"\xff"}),rw=rg(rd),rk=rg(rf),rC=/&(?:[a-zA-Z0-9]+|#[xX][\da-fA-F]+|#\d+);/g;function rx(e){var t=rE(e);return function(e){return String(e).replace(rC,t)}}rc.decodeXML=rx(rw.default),rc.decodeHTMLStrict=rx(ry.default);var rT=function(e,t){return e<t?1:-1};function rE(e){return function(t){if("#"===t.charAt(1)){var n=t.charAt(2);return"X"===n||"x"===n?rk.default(parseInt(t.substr(3),16)):rk.default(parseInt(t.substr(2),10))}return e[t.slice(1,-1)]||t}}rc.decodeHTML=function(){for(var e=Object.keys(rb.default).sort(rT),t=Object.keys(ry.default).sort(rT),n=0,r=0;n<t.length;n++)e[r]===t[n]?(t[n]+=";?",r++):t[n]+=";";var o=RegExp("&(?:"+t.join("|")+"|#[xX][\\da-fA-F]+;?|#\\d+;?)","g"),i=rE(ry.default);function a(e){return";"!==e.substr(-1)&&(e+=";"),i(e)}return function(e){return String(e).replace(o,a)}}();var rM={},rL=ra&&ra.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(rM,"__esModule",{value:!0}),rM.escapeUTF8=rM.escape=rM.encodeNonAsciiHTML=rM.encodeHTML=rM.encodeXML=void 0;var rN=rI(rL(rd).default),rS=rO(rN);rM.encodeXML=rF(rN);var rA=rI(rL(rp).default),rD=rO(rA);function rI(e){return Object.keys(e).sort().reduce(function(t,n){return t[e[n]]="&"+n+";",t},{})}function rO(e){for(var t=[],n=[],r=0,o=Object.keys(e);r<o.length;r++){var i=o[r];1===i.length?t.push("\\"+i):n.push(i)}t.sort();for(var a=0;a<t.length-1;a++){for(var s=a;s<t.length-1&&t[s].charCodeAt(1)+1===t[s+1].charCodeAt(1);)s+=1;var l=1+s-a;l<3||t.splice(a,l,t[a]+"-"+t[s])}return n.unshift("["+t.join("")+"]"),RegExp(n.join("|"),"g")}r=rA,o=rD,rM.encodeHTML=function(e){return e.replace(o,function(e){return r[e]}).replace(rR,rH)},rM.encodeNonAsciiHTML=rF(rA);var rR=/(?:[\x80-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/g,rP=null!=String.prototype.codePointAt?function(e){return e.codePointAt(0)}:function(e){return(e.charCodeAt(0)-55296)*1024+e.charCodeAt(1)-56320+65536};function rH(e){return"&#x"+(e.length>1?rP(e):e.charCodeAt(0)).toString(16).toUpperCase()+";"}var rB=RegExp(rS.source+"|"+rR.source,"g");function rF(e){return function(t){return t.replace(rB,function(t){return e[t]||rH(t)})}}rM.escape=function(e){return e.replace(rB,rH)},rM.escapeUTF8=function(e){return e.replace(rS,rH)}
1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.decodeXMLStrict=e.decodeHTML5Strict=e.decodeHTML4Strict=e.decodeHTML5=e.decodeHTML4=e.decodeHTMLStrict=e.decodeHTML=e.decodeXML=e.encodeHTML5=e.encodeHTML4=e.escapeUTF8=e.escape=e.encodeNonAsciiHTML=e.encodeHTML=e.encodeXML=e.encode=e.decodeStrict=e.decode=void 0,e.decode=function(e,t){return(!t||t<=0?rc.decodeXML:rc.decodeHTML)(e)},e.decodeStrict=function(e,t){return(!t||t<=0?rc.decodeXML:rc.decodeHTMLStrict)(e)},e.encode=function(e,t){return(!t||t<=0?rM.encodeXML:rM.encodeHTML)(e)},Object.defineProperty(e,"encodeXML",{enumerable:!0,get:function(){return rM.encodeXML}}),Object.defineProperty(e,"encodeHTML",{enumerable:!0,get:function(){return rM.encodeHTML}}),Object.defineProperty(e,"encodeNonAsciiHTML",{enumerable:!0,get:function(){return rM.encodeNonAsciiHTML}}),Object.defineProperty(e,"escape",{enumerable:!0,get:function(){return rM.escape}}),Object.defineProperty(e,"escapeUTF8",{enumerable:!0,get:function(){return rM.escapeUTF8}}),Object.defineProperty(e,"encodeHTML4",{enumerable:!0,get:function(){return rM.encodeHTML}}),Object.defineProperty(e,"encodeHTML5",{enumerable:!0,get:function(){return rM.encodeHTML}}),Object.defineProperty(e,"decodeXML",{enumerable:!0,get:function(){return rc.decodeXML}}),Object.defineProperty(e,"decodeHTML",{enumerable:!0,get:function(){return rc.decodeHTML}}),Object.defineProperty(e,"decodeHTMLStrict",{enumerable:!0,get:function(){return rc.decodeHTMLStrict}}),Object.defineProperty(e,"decodeHTML4",{enumerable:!0,get:function(){return rc.decodeHTML}}),Object.defineProperty(e,"decodeHTML5",{enumerable:!0,get:function(){return rc.decodeHTML}}),Object.defineProperty(e,"decodeHTML4Strict",{enumerable:!0,get:function(){return rc.decodeHTMLStrict}}),Object.defineProperty(e,"decodeHTML5Strict",{enumerable:!0,get:function(){return rc.decodeHTMLStrict}}),Object.defineProperty(e,"decodeXMLStrict",{enumerable:!0,get:function(){return rc.decodeXML}})}(ru);var rq="&(?:#x[a-f0-9]{1,6}|#[0-9]{1,7}|[a-z][a-z0-9]{1,31});",r_=/[\\&]/,rj="[!\"#$%&'()*+,./:;<=>?@[\\\\\\]^_`{|}~-]",rz=RegExp("\\\\"+rj+"|"+rq,"gi"),rU=RegExp('[&<>"]',"g"),rV=function(e){return 92===e.charCodeAt(0)?e.charAt(1):ru.decodeHTML(e)};function r$(e){return r_.test(e)?e.replace(rz,rV):e}function rW(e){try{return rl(e)}catch(t){return e}}function rG(e){switch(e){case"&":return"&amp;";case"<":return"&lt;";case">":return"&gt;";case'"':return"&quot;";default:return e}}function rK(e){return rU.test(e)?e.replace(rU,rG):e}function rZ(e,t){for(var n=[],r=0;r<t;r++)n.push(e);return n.join("")}function rX(e){return!e||!/[^ \t]+/.test(e)}var rQ=function(){function e(e){this.current=e,this.root=e,this.entering=!0}return e.prototype.next=function(){var e=this.current,t=this.entering;if(null===e)return null;var n=rY(e);return t&&n?e.firstChild?(this.current=e.firstChild,this.entering=!0):this.entering=!1:e===this.root?this.current=null:null===e.next?(this.current=e.parent,this.entering=!1):(this.current=e.next,this.entering=!0),{entering:t,node:e}},e.prototype.resumeAt=function(e,t){this.current=e,this.entering=!0===t},e}();function rY(e){switch(e.type){case"document":case"blockQuote":case"list":case"item":case"paragraph":case"heading":case"emph":case"strong":case"strike":case"link":case"image":case"table":case"tableHead":case"tableBody":case"tableRow":case"tableCell":case"tableDelimRow":case"customInline":return!0;default:return!1}}var rJ=1,r0={};function r1(e){delete r0[e]}var r2=function(){function e(e,t){this.parent=null,this.prev=null,this.next=null,this.firstChild=null,this.lastChild=null,this.literal=null,"document"===e?this.id=-1:this.id=rJ++,this.type=e,this.sourcepos=t,r0[this.id]=this}return e.prototype.isContainer=function(){return rY(this)},e.prototype.unlink=function(){this.prev?this.prev.next=this.next:this.parent&&(this.parent.firstChild=this.next),this.next?this.next.prev=this.prev:this.parent&&(this.parent.lastChild=this.prev),this.parent=null,this.next=null,this.prev=null},e.prototype.replaceWith=function(e){this.insertBefore(e),this.unlink()},e.prototype.insertAfter=function(e){e.unlink(),e.next=this.next,e.next&&(e.next.prev=e),e.prev=this,this.next=e,this.parent&&(e.parent=this.parent,e.next||(e.parent.lastChild=e))},e.prototype.insertBefore=function(e){e.unlink(),e.prev=this.prev,e.prev&&(e.prev.next=e),e.next=this,this.prev=e,e.parent=this.parent,e.prev||(e.parent.firstChild=e)},e.prototype.appendChild=function(e){e.unlink(),e.parent=this,this.lastChild?(this.lastChild.next=e,e.prev=this.lastChild):this.firstChild=e,this.lastChild=e},e.prototype.prependChild=function(e){e.unlink(),e.parent=this,this.firstChild?(this.firstChild.prev=e,e.next=this.firstChild,this.firstChild=e):(this.firstChild=e,this.lastChild=e)},e.prototype.walker=function(){return new rQ(this)},e}(),r3=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.open=!0,r.lineOffsets=null,r.stringContent=null,r.lastLineBlank=!1,r.lastLineChecked=!1,r.type=t,r}return rr(t,e),t}(r2),r5=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.listData=null,t}return rr(t,e),t}(r3),r4=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.level=0,t.headingType="atx",t}return rr(t,e),t}(r3),r6=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.isFenced=!1,t.fenceChar=null,t.fenceLength=0,t.fenceOffset=-1,t.info=null,t.infoPadding=0,t}return rr(t,e),t}(r3),r9=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.columns=[],t}return rr(t,e),t}(r3),r8=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.startIdx=0,t.endIdx=0,t.paddingLeft=0,t.paddingRight=0,t.ignored=!1,t}return rr(t,e),t}(r3),r7=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.title="",t.dest="",t.label="",t}return rr(t,e),t}(r3),oe=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.syntaxLength=0,t.offset=-1,t.info="",t}return rr(t,e),t}(r3),ot=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.htmlBlockType=-1,t}return rr(t,e),t}(r3),on=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.destination=null,t.title=null,t.extendedAutolink=!1,t}return rr(t,e),t}(r2),or=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.tickCount=0,t}return rr(t,e),t}(r2),oo=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.info="",t}return rr(t,e),t}(r2);function oi(e,t){switch(e){case"heading":return new r4(e,t);case"list":case"item":return new r5(e,t);case"link":case"image":return new on(e,t);case"codeBlock":return new r6(e,t);case"htmlBlock":return new ot(e,t);case"table":return new r9(e,t);case"tableCell":return new r8(e,t);case"document":case"paragraph":case"blockQuote":case"thematicBreak":case"tableRow":case"tableBody":case"tableHead":case"frontMatter":return new r3(e,t);case"code":return new or(e,t);case"refDef":return new r7(e,t);case"customBlock":return new oe(e,t);case"customInline":return new oo(e,t);default:return new r2(e,t)}}function oa(e){return"codeBlock"===e.type}function os(e){return"list"===e.type}function ol(e){return"refDef"===e.type}function ou(e){return"customBlock"===e.type}function oc(e,t){var n=oi("text",t);return n.literal=e,n}var op="[A-Za-z][A-Za-z0-9-]*",od="<"+op+"(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^\"'=<>`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)*\\s*/?>",of="</"+op+"\\s*[>]",oh=RegExp("^"+("(?:"+od+"|"+of)+"|\x3c!----\x3e|\x3c!--(?:-?[^>-])(?:-?[^-])*--\x3e|[<][?].*?[?][>]|<![A-Z]+\\s+[^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)","i");if(String.fromCodePoint)a=function(e){try{return String.fromCodePoint(e)}catch(e){if(e instanceof RangeError)return String.fromCharCode(65533);throw e}};
1else{var om=String.fromCharCode,ov=Math.floor;a=function(){for(var e,t,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=[],i=-1,a=n.length;if(!a)return"";for(var s="";++i<a;){var l=Number(n[i]);if(!isFinite(l)||l<0||l>1114111||ov(l)!==l)return String.fromCharCode(65533);l<=65535?o.push(l):(l-=65536,e=(l>>10)+55296,t=l%1024+56320,o.push(e,t)),(i+1===a||o.length>16384)&&(s+=om.apply(void 0,o),o.length=0)}return s}}var og=a;function oy(e){return ri(ri([],function(e){for(var t,n=RegExp("(www|https?://).(?:[w-]+.)*[A-Za-z0-9-]+.[A-Za-z0-9-]+[^<\\s]*[^<?!.,:*_?~\\s]","g"),r=[];t=n.exec(e);){var o=(function(e){var t=/\)+$/.exec(e);if(t){for(var n=0,r=0;r<e.length;r++){var o=e[r];"("===o?n<0?n=1:n+=1:")"===o&&(n-=1)}if(n<0){var i=Math.min(-n,t[0].length);return e.substring(0,e.length-i)}}return e})(t[0]).replace(/&[A-Za-z0-9]+;$/,""),i="www"===t[1]?"http://":"";r.push({text:o,range:[t.index,t.index+o.length-1],url:""+i+o})}return r}(e)),function(e){for(var t,n=RegExp("[\\w.+-]+@(?:[\\w-]+\\.)+[\\w-]+","g"),r=[];t=n.exec(e);){var o=t[0];/[_-]+$/.test(o)||r.push({text:o,range:[t.index,t.index+o.length-1],url:"mailto:"+o})}return r}(e)).sort(function(e,t){return e.range[0]-t.range[0]})}function ob(e){return e[e.length-1]}function ow(e){return e.slice(1,e.length-1).trim().replace(/[ \t\r\n]+/," ").toLowerCase().toUpperCase()}function ok(e,t){Object.keys(e).forEach(function(n){t(n,e[n])})}function oC(e){return!Object.keys(e).length}var ox="\\\\"+rj,oT=new RegExp(/[!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/),oE=RegExp('^(?:"('+ox+'|[^"\\x00])*"|\'('+ox+"|[^'\\x00])*'|\\(("+ox+"|[^()\\x00])*\\))"),oM=/^(?:<(?:[^<>\n\\\x00]|\\.)*>)/,oL=RegExp("^"+rj),oN=RegExp("^"+rq,"i"),oS=/`+/,oA=/^`+/,oD=/\.\.\./g,oI=/--+/g,oO=/^<([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])?)*)>/,oR=/^<[A-Za-z][A-Za-z0-9.+-]{1,31}:[^<>\x00-\x20]*>/i,oP=/^ *(?:\n *)?/,oH=/^[ \t\n\x0b\x0c\x0d]/,oB=/^\s/,oF=/ *$/,oq=/^ */,o_=/^ *(?:\n|$)/,oj=/^\[(?:[^\\\[\]]|\\.){0,1000}\]/,oz=/^[^\n`\[\]\\!<&*_'"~$]+/m,oU=function(){function e(e){this.subject="",this.delimiters=null,this.brackets=null,this.pos=0,this.lineStartNum=0,this.lineIdx=0,this.lineOffsets=[0],this.linePosOffset=0,this.refMap={},this.refLinkCandidateMap={},this.refDefCandidateMap={},this.options=e}return e.prototype.sourcepos=function(e,t){var n=this.linePosOffset+this.lineOffsets[this.lineIdx],r=this.lineStartNum+this.lineIdx,o=[r,e+n];return"number"==typeof t?[o,[r,t+n]]:o},e.prototype.nextLine=function(){this.lineIdx+=1,this.linePosOffset=-this.pos},e.prototype.match=function(e){var t=e.exec(this.subject.slice(this.pos));return null===t?null:(this.pos+=t.index+t[0].length,t[0])},e.prototype.peek=function(){return this.pos<this.subject.length?this.subject.charCodeAt(this.pos):-1},e.prototype.spnl=function(){return this.match(oP),!0},e.prototype.parseBackticks=function(e){var t,n=this.pos+1,r=this.match(oA);
1if(null===r)return!1;for(var o=this.pos;null!==(t=this.match(oS));)if(t===r){var i=this.subject.slice(o,this.pos-r.length),a=this.sourcepos(n,this.pos),s=i.split("\n");if(s.length>1){var l=ob(s);this.lineIdx+=s.length-1,this.linePosOffset=-(this.pos-l.length-r.length),a[1]=this.sourcepos(this.pos),i=s.join(" ")}var u=oi("code",a);return i.length>0&&null!==i.match(/[^ ]/)&&" "==i[0]&&" "==i[i.length-1]?u.literal=i.slice(1,i.length-1):u.literal=i,u.tickCount=r.length,e.appendChild(u),!0}return this.pos=o,e.appendChild(oc(r,this.sourcepos(n,this.pos-1))),!0},e.prototype.parseBackslash=function(e){var t,n=this.subject;this.pos+=1;var r=this.pos;return 10===this.peek()?(this.pos+=1,t=oi("linebreak",this.sourcepos(this.pos-1,this.pos)),e.appendChild(t),this.nextLine()):oL.test(n.charAt(this.pos))?(e.appendChild(oc(n.charAt(this.pos),this.sourcepos(r,this.pos))),this.pos+=1):e.appendChild(oc("\\",this.sourcepos(r,r))),!0},e.prototype.parseAutolink=function(e){var t,n,r,o=this.pos+1;return(t=this.match(oO))?(n=t.slice(1,t.length-1),(r=oi("link",this.sourcepos(o,this.pos))).destination=rW("mailto:"+n),r.title="",r.appendChild(oc(n,this.sourcepos(o+1,this.pos-1))),e.appendChild(r),!0):!!(t=this.match(oR))&&(n=t.slice(1,t.length-1),(r=oi("link",this.sourcepos(o,this.pos))).destination=rW(n),r.title="",r.appendChild(oc(n,this.sourcepos(o+1,this.pos-1))),e.appendChild(r),!0)},e.prototype.parseHtmlTag=function(e){var t=this.pos+1,n=this.match(oh);if(null===n)return!1;var r=oi("htmlInline",this.sourcepos(t,this.pos));return r.literal=n,e.appendChild(r),!0},e.prototype.scanDelims=function(e){var t,n,r,o=0,i=this.pos;if(39===e||34===e)o++,this.pos++;else for(;this.peek()===e;)o++,this.pos++;if(0===o||o<2&&(126===e||36===e))return this.pos=i,null;var a=0===i?"\n":this.subject.charAt(i-1),s=this.peek();t=-1===s?"\n":og(s);var l=oB.test(t),u=oT.test(t),c=oB.test(a),p=oT.test(a),d=!l&&(!u||c||p),f=!c&&(!p||l||u);return 95===e?(n=d&&(!f||p),r=f&&(!d||u)):39===e||34===e?(n=d&&!f,r=f):36===e?(n=!l,r=!c):(n=d,r=f),this.pos=i,{numdelims:o,canOpen:n,canClose:r}},e.prototype.handleDelim=function(e,t){var n=this.scanDelims(e);if(!n)return!1;var r=n.numdelims,o=this.pos+1;this.pos+=r;var i=oc(39===e?"’":34===e?"“":this.subject.slice(o-1,this.pos),this.sourcepos(o,this.pos));return t.appendChild(i),(n.canOpen||n.canClose)&&(this.options.smart||39!==e&&34!==e)&&(this.delimiters={cc:e,numdelims:r,origdelims:r,node:i,previous:this.delimiters,next:null,canOpen:n.canOpen,canClose:n.canClose},this.delimiters.previous&&(this.delimiters.previous.next=this.delimiters)),!0},e.prototype.removeDelimiter=function(e){null!==e.previous&&(e.previous.next=e.next),null===e.next?this.delimiters=e.previous:e.next.previous=e.previous},e.prototype.removeDelimitersBetween=function(e,t){e.next!==t&&(e.next=t,t.previous=e)},e.prototype.processEmphasis=function(e){var t,n,r,o,i,a,s,l=!1,u=((t={})[95]=[e,e,e],t[42]=[e,e,e],t[39]=[e],t[34]=[e],t[126]=[e],t[36]=[e],t);for(r=this.delimiters;null!==r&&r.previous!==e;)r=r.previous;for(;null!==r;){var c=r.cc,p=95===c||42===c;if(r.canClose){for(n=r.previous,s=!1;null!==n&&n!==e&&n!==u[c][p?r.origdelims%3:0];){if(l=p&&(r.canOpen||n.canClose)&&r.origdelims%3!=0&&(n.origdelims+r.origdelims)%3==0,n.cc===r.cc&&n.canOpen&&!l){s=!0;break}n=n.previous}if(o=r,p||126===c||36===c)if(s){if(n){var d=r.numdelims>=2&&n.numdelims>=2?2:1,f=+!p;i=n.node,a=r.node;var h=p?1===d?"emph":"strong":"strike";36===c&&(h="customInline");var m=oi(h),v=i.sourcepos[1],g=a.sourcepos[0];m.sourcepos=[[v[0],v[1]-d+1],[g[0],g[1]+d-1]],i.sourcepos[1][1]-=d,a.sourcepos[0][1]+=d,i.literal=i.literal.slice(d),a.literal=a.literal.slice(d),n.numdelims-=d,r.numdelims-=d;for(var y=i.next,b=void 0;y&&y!==a;)b=y.next,y.unlink(),m.appendChild(y),y=b;if(36===c){var w=m.firstChild,k=w.literal||"",C=k.split(/\s/)[0];m.info=C,k.length<=C.length?w.unlink():(w.sourcepos[0][1]+=C.length,w.literal=k.replace(C+" ",""))}if(i.insertAfter(m),this.removeDelimitersBetween(n,r),n.numdelims<=f&&(0===n.numdelims&&i.unlink(),this.removeDelimiter(n)),r.numdelims<=f){0===r.numdelims&&a.unlink();var x=r.next;this.removeDelimiter(r),r=x}}}else r=r.next;
1else 39===c?(r.node.literal="’",s&&(n.node.literal="‘"),r=r.next):34===c&&(r.node.literal="”",s&&(n.node.literal="“"),r=r.next);!s&&(u[c][p?o.origdelims%3:0]=o.previous,o.canOpen||this.removeDelimiter(o))}else r=r.next}for(;null!==this.delimiters&&this.delimiters!==e;)this.removeDelimiter(this.delimiters)},e.prototype.parseLinkTitle=function(){var e=this.match(oE);return null===e?null:r$(e.substr(1,e.length-2))},e.prototype.parseLinkDestination=function(){var e=this.match(oM);if(null===e){if(60===this.peek())return null;for(var t=this.pos,n=0,r=void 0;-1!==(r=this.peek());)if(92===r&&oL.test(this.subject.charAt(this.pos+1)))this.pos+=1,-1!==this.peek()&&(this.pos+=1);else if(40===r)this.pos+=1,n+=1;else if(41===r)if(n<1)break;else this.pos+=1,n-=1;else if(null!==oH.exec(og(r)))break;else this.pos+=1;return this.pos===t&&41!==r||0!==n?null:rW(r$(e=this.subject.substr(t,this.pos-t)))}return rW(r$(e.substr(1,e.length-2)))},e.prototype.parseLinkLabel=function(){var e=this.match(oj);return null===e||e.length>1001?0:e.length},e.prototype.parseOpenBracket=function(e){var t=this.pos;this.pos+=1;var n=oc("[",this.sourcepos(this.pos,this.pos));return e.appendChild(n),this.addBracket(n,t,!1),!0},e.prototype.parseBang=function(e){var t=this.pos;if(this.pos+=1,91===this.peek()){this.pos+=1;var n=oc("![",this.sourcepos(this.pos-1,this.pos));e.appendChild(n),this.addBracket(n,t+1,!0)}else{var n=oc("!",this.sourcepos(this.pos,this.pos));e.appendChild(n)}return!0},e.prototype.parseCloseBracket=function(e){var t=null,n=null,r=!1;this.pos+=1;var o=this.pos,i=this.brackets;if(null===i)return e.appendChild(oc("]",this.sourcepos(o,o))),!0;if(!i.active)return e.appendChild(oc("]",this.sourcepos(o,o))),this.removeBracket(),!0;var a=i.image,s=this.pos;40===this.peek()&&(this.pos++,this.spnl()&&null!==(t=this.parseLinkDestination())&&this.spnl()&&(oH.test(this.subject.charAt(this.pos-1))&&(n=this.parseLinkTitle())||1)&&this.spnl()&&41===this.peek()?(this.pos+=1,r=!0):this.pos=s);var l="";if(!r){var u=this.pos,c=this.parseLinkLabel();if(c>2?l=this.subject.slice(u,u+c):i.bracketAfter||(l=this.subject.slice(i.index,o)),0===c&&(this.pos=s),l){l=ow(l);var p=this.refMap[l];p&&(t=p.destination,n=p.title,r=!0)}}if(r){var d=oi(a?"image":"link");d.destination=t,d.title=n||"",d.sourcepos=[i.startpos,this.sourcepos(this.pos)];for(var f=i.node.next,h=void 0;f;)h=f.next,f.unlink(),d.appendChild(f),f=h;if(e.appendChild(d),this.processEmphasis(i.previousDelimiter),this.removeBracket(),i.node.unlink(),!a)for(i=this.brackets;null!==i;)i.image||(i.active=!1),i=i.previous;return this.options.referenceDefinition&&(this.refLinkCandidateMap[e.id]={node:e,refLabel:l}),!0}return this.removeBracket(),this.pos=o,e.appendChild(oc("]",this.sourcepos(o,o))),this.options.referenceDefinition&&(this.refLinkCandidateMap[e.id]={node:e,refLabel:l}),!0},e.prototype.addBracket=function(e,t,n){null!==this.brackets&&(this.brackets.bracketAfter=!0),this.brackets={node:e,startpos:this.sourcepos(t+ +!n),previous:this.brackets,previousDelimiter:this.delimiters,index:t,image:n,active:!0}},e.prototype.removeBracket=function(){this.brackets&&(this.brackets=this.brackets.previous)},e.prototype.parseEntity=function(e){var t,n=this.pos+1;return!!(t=this.match(oN))&&(e.appendChild(oc(ru.decodeHTML(t),this.sourcepos(n,this.pos))),!0)},e.prototype.parseString=function(e){var t,n=this.pos+1;if(t=this.match(oz)){if(this.options.smart){var r=t.replace(oD,"…").replace(oI,function(e){var t=0,n=0;return e.length%3==0?n=e.length/3:e.length%2==0?t=e.length/2:e.length%3==2?(t=1,n=(e.length-2)/3):(t=2,n=(e.length-4)/3),rZ("—",n)+rZ("–",t)});e.appendChild(oc(r,this.sourcepos(n,this.pos)))}else{var o=oc(t,this.sourcepos(n,this.pos));e.appendChild(o)}return!0}return!1},e.prototype.parseNewline=function(e){this.pos+=1;var t=e.lastChild;if(t&&"text"===t.type&&" "===t.literal[t.literal.length-1]){var n=" "===t.literal[t.literal.length-2],r=t.literal.length;t.literal=t.literal.replace(oF,"");var o=r-t.literal.length;t.sourcepos[1][1]-=o,e.appendChild(oi(n?"linebreak":"softbreak",this.sourcepos(this.pos-o,this.pos)))}
1else e.appendChild(oi("softbreak",this.sourcepos(this.pos,this.pos)));return this.nextLine(),this.match(oq),!0},e.prototype.parseReference=function(e,t){if(!this.options.referenceDefinition)return 0;this.subject=e.stringContent,this.pos=0;var n=null,r=this.pos,o=this.parseLinkLabel();if(0===o)return 0;var i=this.subject.substr(0,o);if(58!==this.peek())return this.pos=r,0;this.pos++,this.spnl();var a=this.parseLinkDestination();if(null===a)return this.pos=r,0;var s=this.pos;this.spnl(),this.pos!==s&&(n=this.parseLinkTitle()),null===n&&(n="",this.pos=s);var l=!0;if(null===this.match(o_)&&(""===n?l=!1:(n="",this.pos=s,l=null!==this.match(o_))),!l)return this.pos=r,0;var u=ow(i);if(""===u)return this.pos=r,0;var c=this.getReferenceDefSourcepos(e);e.sourcepos[0][0]=c[1][0]+1;var p=oi("refDef",c);return p.title=n,p.dest=a,p.label=u,e.insertBefore(p),t[u]?this.refDefCandidateMap[p.id]=p:t[u]=iw(p),this.pos-r},e.prototype.mergeTextNodes=function(e){for(var t,n=[];t=e.next();){var r=t.entering,o=t.node;if(r&&"text"===o.type)n.push(o);else if(1===n.length)n=[];else if(n.length>1){var i=n[0],a=n[n.length-1];i.sourcepos&&a.sourcepos&&(i.sourcepos[1]=a.sourcepos[1]),i.next=a.next,i.next&&(i.next.prev=i);for(var s=1;s<n.length;s+=1)i.literal+=n[s].literal,n[s].unlink();n=[]}}},e.prototype.getReferenceDefSourcepos=function(e){for(var t=e.stringContent.split(/\n|\r\n/),n=!1,r=0,o={line:0,ch:0},i=0;i<t.length;i+=1){var a=t[i];if(oH.test(a))break;if(/\:/.test(a)&&0===r){if(n)break;var s=a.indexOf(":")===a.length-1?i+1:i;o={line:s,ch:t[s].length},n=!0}var l=a.match(/'|"/g);if(l&&(r+=l.length),2===r){o={line:i,ch:a.length};break}}return[[e.sourcepos[0][0],e.sourcepos[0][1]],[e.sourcepos[0][0]+o.line,o.ch]]},e.prototype.parseInline=function(e){var t,n=!1,r=this.peek();if(-1===r)return!1;switch(r){case 10:n=this.parseNewline(e);break;case 92:n=this.parseBackslash(e);break;case 96:n=this.parseBackticks(e);break;case 42:case 95:case 126:case 36:n=this.handleDelim(r,e);break;case 39:case 34:n=!!(null==(t=this.options)?void 0:t.smart)&&this.handleDelim(r,e);break;case 91:n=this.parseOpenBracket(e);break;case 33:n=this.parseBang(e);break;case 93:n=this.parseCloseBracket(e);break;case 60:n=this.parseAutolink(e)||this.parseHtmlTag(e);break;case 38:e.disabledEntityParse||(n=this.parseEntity(e));break;default:n=this.parseString(e)}return n||(this.pos+=1,e.appendChild(oc(og(r),this.sourcepos(this.pos,this.pos+1)))),!0},e.prototype.parse=function(e){for(this.subject=e.stringContent.trim(),this.pos=0,this.delimiters=null,this.brackets=null,this.lineOffsets=e.lineOffsets||[0],this.lineIdx=0,this.linePosOffset=0,this.lineStartNum=e.sourcepos[0][0],"heading"===e.type&&(this.lineOffsets[0]+=e.level+1);this.parseInline(e););e.stringContent=null,this.processEmphasis(null),this.mergeTextNodes(e.walker());var t=this.options,n=t.extendedAutolinks,r=t.customParser;if(n&&function(e,t){var n;for("boolean"==typeof t&&(t=oy);n=e.next();)!function(){var e=n.entering,r=n.node;if(e&&"text"===r.type&&"link"!==r.parent.type){var o=r.literal,i=t(o);if(!i||!i.length)return;for(var a=0,s=r.sourcepos[0],l=s[0],u=s[1],c=function(e,t){return[[l,u+e],[l,u+t]]},p=[],d=0;d<i.length;d++){var f=i[d],h=f.range,m=f.url,v=f.text;h[0]>a&&p.push(oc(o.substring(a,h[0]),c(a,h[0]-1)));var g=oi("link",c.apply(void 0,h));g.appendChild(oc(v,c.apply(void 0,h))),g.destination=m,g.extendedAutolink=!0,p.push(g),a=h[1]+1}a<o.length&&p.push(oc(o.substring(a),c(a,o.length-1)));for(var y=0;y<p.length;y++){var b=p[y];r.insertBefore(b)}r.unlink()}}()}(e.walker(),n),r&&e.firstChild)for(var o,i=e.firstChild.walker();o=i.next();){var a=o.node,s=o.entering;r[a.type]&&r[a.type](a,{entering:s,options:this.options})}},e}(),oV=/^\[([ \txX])\][ \t]+/,o$=/[^ \t\f\v\r\n]/,oW=/^(?:`{3,}|~{3,})(?= *$)/;function oG(e){for(var t=e;t;){if(t.lastLineBlank)return!0;var n=t.type;if(t.lastLineChecked||"list"!==n&&"item"!==n){t.lastLineChecked=!0;break}t.lastLineChecked=!0,t=t.lastChild}return!1}function oK(e,t){return t<e.length?e.charCodeAt(t):-1}function oZ(e){return 32===e||9===e}var oX=/^\$\$$/,oQ={continue:function(){return 1},finalize:function(){},canContain:function(){return!1},acceptsLines:!0},oY={document:{continue:function(){return 0},finalize:function(){},canContain:function(e){return"item"!==e},acceptsLines:!1},list:{continue:function(){return 0},finalize:function(e,t){for(var n=t.firstChild;n;){if(oG(n)&&n.next){t.listData.tight=!1;break}for(var r=n.firstChild;r;){if(oG(r)&&(n.next||r.next)){t.listData.tight=!1;break}r=r.next}n=n.next}},canContain:function(e){return"item"===e},acceptsLines:!1},blockQuote:{continue:function(e){var t=e.currentLine;
1return e.indented||62!==oK(t,e.nextNonspace)?1:(e.advanceNextNonspace(),e.advanceOffset(1,!1),oZ(oK(t,e.offset))&&e.advanceOffset(1,!0),0)},finalize:function(){},canContain:function(e){return"item"!==e},acceptsLines:!1},item:{continue:function(e,t){if(e.blank){if(null===t.firstChild)return 1;e.advanceNextNonspace()}else{if(!(e.indent>=t.listData.markerOffset+t.listData.padding))return 1;e.advanceOffset(t.listData.markerOffset+t.listData.padding,!0)}return 0},finalize:function(e,t){if(t.firstChild&&"paragraph"===t.firstChild.type){var n=t.firstChild,r=n.stringContent.match(oV);if(r){var o=r[0].length;n.stringContent=n.stringContent.substring(o-1),n.sourcepos[0][1]+=o,n.lineOffsets[0]+=o,t.listData.task=!0,t.listData.checked=/[xX]/.test(r[1])}}},canContain:function(e){return"item"!==e},acceptsLines:!1},heading:{continue:function(){return 1},finalize:function(){},canContain:function(){return!1},acceptsLines:!1},thematicBreak:{continue:function(){return 1},finalize:function(){},canContain:function(){return!1},acceptsLines:!1},codeBlock:{continue:function(e,t){var n=e.currentLine,r=e.indent;if(t.isFenced){var o=r<=3&&n.charAt(e.nextNonspace)===t.fenceChar&&n.slice(e.nextNonspace).match(oW);if(o&&o[0].length>=t.fenceLength)return e.lastLineLength=e.offset+r+o[0].length,e.finalize(t,e.lineNumber),2;for(var i=t.fenceOffset;i>0&&oZ(oK(n,e.offset));)e.advanceOffset(1,!0),i--}else if(r>=4)e.advanceOffset(4,!0);else{if(!e.blank)return 1;e.advanceNextNonspace()}return 0},finalize:function(e,t){var n;if(null!==t.stringContent){if(t.isFenced){var r=t.stringContent,o=r.indexOf("\n"),i=r.slice(0,o),a=r.slice(o+1),s=i.match(/^(\s*)(.*)/);t.infoPadding=s[1].length,t.info=r$(s[2].trim()),t.literal=a}else t.literal=null==(n=t.stringContent)?void 0:n.replace(/(\n *)+$/,"\n");t.stringContent=null}},canContain:function(){return!1},acceptsLines:!0},htmlBlock:{continue:function(e,t){return e.blank&&(6===t.htmlBlockType||7===t.htmlBlockType)?1:0},finalize:function(e,t){var n;t.literal=(null==(n=t.stringContent)?void 0:n.replace(/(\n *)+$/,""))||null,t.stringContent=null},canContain:function(){return!1},acceptsLines:!0},paragraph:{continue:function(e){return+!!e.blank},finalize:function(e,t){if(null!==t.stringContent){for(var n,r,o=!1;91===oK(t.stringContent,0)&&(r=e.inlineParser.parseReference(t,e.refMap));)t.stringContent=t.stringContent.slice(r),o=!0;o&&(n=t.stringContent,!o$.test(n))&&t.unlink()}},canContain:function(){return!1},acceptsLines:!0},table:{continue:function(){return 0},finalize:function(){},canContain:function(e){return"tableHead"===e||"tableBody"===e},acceptsLines:!1},tableBody:{continue:function(){return 0},finalize:function(){},canContain:function(e){return"tableRow"===e},acceptsLines:!1},tableHead:{continue:function(){return 1},finalize:function(){},canContain:function(e){return"tableRow"===e||"tableDelimRow"===e},acceptsLines:!1},tableRow:{continue:function(){return 1},finalize:function(){},canContain:function(e){return"tableCell"===e},acceptsLines:!1},tableCell:{continue:function(){return 1},finalize:function(){},canContain:function(){return!1},acceptsLines:!1},tableDelimRow:{continue:function(){return 1},finalize:function(){},canContain:function(e){return"tableDelimCell"===e},acceptsLines:!1},tableDelimCell:{continue:function(){return 1},finalize:function(){},canContain:function(){return!1},acceptsLines:!1},refDef:oQ,customBlock:{continue:function(e,t){var n=e.currentLine,r=n.match(oX);if(r)return e.lastLineLength=r[0].length,e.finalize(t,e.lineNumber),2;for(var o=t.offset;o>0&&oZ(oK(n,e.offset));)e.advanceOffset(1,!0),o--;return 0},finalize:function(e,t){if(null!==t.stringContent){var n=t.stringContent,r=n.indexOf("\n"),o=n.slice(0,r),i=n.slice(r+1);t.info=r$(o.match(/^(\s*)(.*)/)[2].trim()),t.literal=i,t.stringContent=null}},canContain:function(){return!1},acceptsLines:!0},frontMatter:oQ};function oJ(e){for(var t=0,n=0,r=[],o=0;o<e.length;o+=1)if("|"===e[o]&&"\\"!==e[o-1]){var i=e.substring(t,o);0===t&&rX(i)?n=o+1:r.push(i),t=o+1}if(t<e.length){var i=e.substring(t,e.length);rX(i)||r.push(i)}return[n,r]}function o0(e,t,n,r){for(var o=[],i=0;i<t.length;i++){var a=t[i],s=a.match(/^[ \t]+/),l=s?s[0].length:0,u=void 0,c=void 0;if(l===a.length)l=0,u=0,c="";else{var p=a.match(/[ \t]+$/);u=p?p[0].length:0,c=a.slice(l,a.length-u)}var d=r+l,f=oi(e,[[n,r],[n,r+a.length-1]]);f.stringContent=c.replace(/\\\|/g,"|"),f.startIdx=o.length,f.endIdx=o.length,f.lineOffsets=[d-1],f.paddingLeft=l,f.paddingRight=u,o.push(f),r+=a.length+1}return o}function o1(e){var t=null,n=e.stringContent,r=n[0];return":"===n[n.length-1]?t=":"===r?"center":"right":":"===r&&(t="left"),{align:t}}var o2=/^(\$\$)(\s*[a-zA-Z])+/,o3=/^(\$\$)(\s*[a-zA-Z])+.*(\$\$)/,o5=/^`{3,}(?!.*`)|^~{3,}/,o4=[/./,/^<(?:script|pre|style)(?:\s|>|$)/i,/^<!--/,/^<[?]/,/^<![A-Z]/,/^<!\[CDATA\[/,/^<[/]?(?: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[123456]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:\s|[/]?[>]|$)/i,RegExp("^(?:"+od+"|"+of+")\\s*$","i")],o6=/^(?:=+|-+)[ \t]*$/,o9=/^#{1,6}(?:[ \t]+|$)/,o8=/^(?:(?:\*[ \t]*){3,}|(?:_[ \t]*){3,}|(?:-[ \t]*){3,})[ \t]*$/,o7=/^[*+-]/,ie=/^(\d{1,9})([.)])/;function it(e,t){return e.options.disallowDeepHeading&&("blockQuote"===t.type||"item"===t.type)}var ir=[function(e){return e.indented||62!==oK(e.currentLine,e.nextNonspace)?0:(e.advanceNextNonspace(),e.advanceOffset(1,!1),oZ(oK(e.currentLine,e.offset))&&e.advanceOffset(1,!0),e.closeUnmatchedBlocks(),e.addChild("blockQuote",e.nextNonspace),1)},function(e,t){var n;if(!e.indented&&!it(e,t)&&(n=e.currentLine.slice(e.nextNonspace).match(o9))){e.advanceNextNonspace(),e.advanceOffset(n[0].length,!1),e.closeUnmatchedBlocks();var r=e.addChild("heading",e.nextNonspace);return r.level=n[0].trim().length,r.headingType="atx",r.stringContent=e.currentLine.slice(e.offset).replace(/^[ \t]*#+[ \t]*$/,"").replace(/[ \t]+#+[ \t]*$/,""),e.advanceOffset(e.currentLine.length-e.offset),2}return 0},function(e){var t;if(!e.indented&&(t=e.currentLine.slice(e.nextNonspace).match(o5))){var n=t[0].length;e.closeUnmatchedBlocks();var r=e.addChild("codeBlock",e.nextNonspace);return r.isFenced=!0,r.fenceLength=n,r.fenceChar=t[0][0],r.fenceOffset=e.indent,e.advanceNextNonspace(),e.advanceOffset(n,!1),2}return 0},function(e,t){if(!e.indented&&60===oK(e.currentLine,e.nextNonspace)){var n=e.currentLine.slice(e.nextNonspace),r=e.options.disallowedHtmlBlockTags,o=void 0;for(o=1;o<=7;o++){var i=n.match(o4[o]);if(i){if(7===o&&("paragraph"===t.type||r.length>0&&RegExp("</?(?:"+r.join("|")+")","i").test(i[0])))return 0;return e.closeUnmatchedBlocks(),e.addChild("htmlBlock",e.offset).htmlBlockType=o,2}}}return 0},function(e,t){var n;if(null!==t.stringContent&&!e.indented&&"paragraph"===t.type&&!it(e,t.parent)&&(n=e.currentLine.slice(e.nextNonspace).match(o6))){e.closeUnmatchedBlocks();for(var r=void 0;91===oK(t.stringContent,0)&&(r=e.inlineParser.parseReference(t,e.refMap));)t.stringContent=t.stringContent.slice(r);if(t.stringContent.length>0){var o=oi("heading",t.sourcepos);return o.level="="===n[0][0]?1:2,o.headingType="setext",o.stringContent=t.stringContent,t.insertAfter(o),t.unlink(),e.tip=o,e.advanceOffset(e.currentLine.length-e.offset,!1),2}}return 0},function(e){return!e.indented&&o8.test(e.currentLine.slice(e.nextNonspace))?(e.closeUnmatchedBlocks(),e.addChild("thematicBreak",e.nextNonspace),e.advanceOffset(e.currentLine.length-e.offset,!1),2):0},function(e,t){var n,r,o,i=t;return(!e.indented||"list"===t.type)&&(o=function(e,t){var n,r,o=e.currentLine.slice(e.nextNonspace),i={type:"bullet",tight:!0,bulletChar:"",start:0,delimiter:"",padding:0,markerOffset:e.indent,task:!1,checked:!1}
1;if(e.indent>=4)return null;if(n=o.match(o7))i.type="bullet",i.bulletChar=n[0][0];else{if(!(n=o.match(ie))||"paragraph"===t.type&&"1"!==n[1])return null;i.type="ordered",i.start=parseInt(n[1],10),i.delimiter=n[2]}if(-1!==(r=oK(e.currentLine,e.nextNonspace+n[0].length))&&9!==r&&32!==r||"paragraph"===t.type&&!e.currentLine.slice(e.nextNonspace+n[0].length).match(o$))return null;e.advanceNextNonspace(),e.advanceOffset(n[0].length,!0);var a=e.column,s=e.offset;do e.advanceOffset(1,!0),r=oK(e.currentLine,e.offset);while(e.column-a<5&&oZ(r));var l=-1===oK(e.currentLine,e.offset),u=e.column-a;return u>=5||u<1||l?(i.padding=n[0].length+1,e.column=a,e.offset=s,oZ(oK(e.currentLine,e.offset))&&e.advanceOffset(1,!0)):i.padding=n[0].length+u,i}(e,i))?(e.closeUnmatchedBlocks(),("list"!==e.tip.type||(n=i.listData,r=o,n.type!==r.type||n.delimiter!==r.delimiter||n.bulletChar!==r.bulletChar))&&((i=e.addChild("list",e.nextNonspace)).listData=o),(i=e.addChild("item",e.nextNonspace)).listData=o,1):0},function(e){return e.indented&&"paragraph"!==e.tip.type&&!e.blank?(e.advanceOffset(4,!0),e.closeUnmatchedBlocks(),e.addChild("codeBlock",e.offset),2):0},function(e,t){var n=t.stringContent;if("paragraph"===t.type&&!e.indented&&!e.blank){var r=n.length-1,o=n.lastIndexOf("\n",r-1)+1,i=n.slice(o,r),a=e.currentLine.slice(e.nextNonspace),s=oJ(i),l=s[0],u=s[1],c=oJ(a),p=c[0],d=c[1],f=/^[ \t]*:?-+:?[ \t]*$/;if(!u.length||!d.length||d.some(function(e){return!f.test(e)})||1===d.length&&0!==a.indexOf("|"))return 0;var h=t.lineOffsets,m=e.lineNumber-1,v=ob(h)+1,g=oi("table",[[m,v],[e.lineNumber,e.offset]]);if(g.columns=d.map(function(){return{align:null}}),t.insertAfter(g),1===h.length)t.unlink();else{t.stringContent=n.slice(0,o);var y=n.lastIndexOf("\n",o-2)+1,b=o-y-1;e.lastLineLength=h[h.length-2]+b,e.finalize(t,m-1)}e.advanceOffset(e.currentLine.length-e.offset,!1);var w=oi("tableHead",[[m,v],[e.lineNumber,e.offset]]);g.appendChild(w);var k=oi("tableRow",[[m,v],[m,v+i.length-1]]),C=oi("tableDelimRow",[[e.lineNumber,e.nextNonspace+1],[e.lineNumber,e.offset]]);w.appendChild(k),w.appendChild(C),o0("tableCell",u,m,v+l).forEach(function(e){k.appendChild(e)});var x=o0("tableDelimCell",d,e.lineNumber,e.nextNonspace+1+p);return x.forEach(function(e){C.appendChild(e)}),g.columns=x.map(o1),e.tip=g,2}return 0},function(e,t){if("table"!==t.type&&"tableBody"!==t.type||!e.blank&&-1===e.currentLine.indexOf("|"))return 0;if(e.advanceOffset(e.currentLine.length-e.offset,!1),e.blank){var n=t;return"tableBody"===t.type&&(n=t.parent,e.finalize(t,e.lineNumber-1)),e.finalize(n,e.lineNumber-1),0}var r=t;"table"===t.type&&((r=e.addChild("tableBody",e.nextNonspace)).stringContent=null);var o=oi("tableRow",[[e.lineNumber,e.nextNonspace+1],[e.lineNumber,e.currentLine.length]]);r.appendChild(o);var i=r.parent,a=oJ(e.currentLine.slice(e.nextNonspace)),s=a[0];return o0("tableCell",a[1],e.lineNumber,e.nextNonspace+1+s).forEach(function(e,t){t>=i.columns.length&&(e.ignored=!0),o.appendChild(e)}),2},function(e){var t;if(!e.indented&&!o3.test(e.currentLine)&&(t=e.currentLine.match(o2))){var n=t[1].length;e.closeUnmatchedBlocks();var r=e.addChild("customBlock",e.nextNonspace);return r.syntaxLength=n,r.offset=e.indent,e.advanceNextNonspace(),e.advanceOffset(n,!1),2}return 0}],io=/^(-{3}|\+{3}|;{3})$/,ii=function(e,t){var n=e.currentLine,r=e.lineNumber,o=e.indented;return 1===r&&!o&&"document"===t.type&&io.test(n)?(e.closeUnmatchedBlocks(),e.addChild("frontMatter",e.nextNonspace).stringContent=n,e.advanceNextNonspace(),e.advanceOffset(n.length,!1),2):0},ia={continue:function(e,t){var n=e.currentLine,r=n.match(io);return"frontMatter"===t.type&&r?(t.stringContent+=n,e.lastLineLength=r[0].length,e.finalize(t,e.lineNumber),2):0},finalize:function(e,t){null!==t.stringContent&&(t.literal=t.stringContent,t.stringContent=null)},canContain:function(){return!1},acceptsLines:!0},is=[/./,/<\/(?:script|pre|style)>/i,/-->/,/\?>/,/>/,/\]\]>/],il=/^[#`~*+_=<>0-9-;$]/,iu=/\r\n|\n|\r/;function ic(){return oi("document",[[1,1],[0,0]])}var ip={smart:!1,tagFilter:!1,extendedAutolinks:!1,disallowedHtmlBlockTags:[],referenceDefinition:!1,disallowDeepHeading:!1,customParser:null,frontMatter:!1},id=function(){function e(e){this.options=ro(ro({},ip),e),this.doc=ic(),this.tip=this.doc,this.oldtip=this.doc,this.lineNumber=0,this.offset=0,this.column=0,this.nextNonspace=0,this.nextNonspaceColumn=0,this.indent=0,this.currentLine="",this.indented=!1,this.blank=!1,this.partiallyConsumedTab=!1,this.allClosed=!0,this.lastMatchedContainer=this.doc,this.refMap={},this.refLinkCandidateMap={},this.refDefCandidateMap={},this.lastLineLength=0,this.lines=[],this.options.frontMatter&&(oY.frontMatter=ia,ir.unshift(ii)),this.inlineParser=new oU(this.options)}return e.prototype.advanceOffset=function(e,t){void 0===t&&(t=!1);for(var n,r,o,i=this.currentLine;e>0&&(o=i[this.offset]);)"	"===o?(n=4-this.column%4,t?(this.partiallyConsumedTab=n>e,r=n>e?e:n,this.column+=r,this.offset+=+!this.partiallyConsumedTab,e-=r):(this.partiallyConsumedTab=!1,this.column+=n,this.offset+=1,e-=1)):(this.partiallyConsumedTab=!1,this.offset+=1,this.column+=1,e-=1)},e.prototype.advanceNextNonspace=function(){this.offset=this.nextNonspace,this.column=this.nextNonspaceColumn,this.partiallyConsumedTab=!1},e.prototype.findNextNonspace=function(){for(var e,t=this.currentLine,n=this.offset,r=this.column;""!==(e=t.charAt(n));)if(" "===e)n++,r++;else if("	"===e)n++,r+=4-r%4;else break;this.blank="\n"===e||"\r"===e||""===e,this.nextNonspace=n,this.nextNonspaceColumn=r,this.indent=this.nextNonspaceColumn-this.column,this.indented=this.indent>=4},e.prototype.addLine=function(){if(this.partiallyConsumedTab){this.offset+=1;var e=4-this.column%4;this.tip.stringContent+=rZ(" ",e)}this.tip.lineOffsets?this.tip.lineOffsets.push(this.offset):this.tip.lineOffsets=[this.offset],this.tip.stringContent+=this.currentLine.slice(this.offset)+"\n"},e.prototype.addChild=function(e,t){for(;!oY[this.tip.type].canContain(e);)this.finalize(this.tip,this.lineNumber-1);
1var n=oi(e,[[this.lineNumber,t+1],[0,0]]);return n.stringContent="",this.tip.appendChild(n),this.tip=n,n},e.prototype.closeUnmatchedBlocks=function(){if(!this.allClosed){for(;this.oldtip!==this.lastMatchedContainer;){var e=this.oldtip.parent;this.finalize(this.oldtip,this.lineNumber-1),this.oldtip=e}this.allClosed=!0}},e.prototype.finalize=function(e,t){var n=e.parent;e.open=!1,e.sourcepos[1]=[t,this.lastLineLength],oY[e.type].finalize(this,e),this.tip=n},e.prototype.processInlines=function(e){var t,n=this.options.customParser,r=e.walker();for(this.inlineParser.refMap=this.refMap,this.inlineParser.refLinkCandidateMap=this.refLinkCandidateMap,this.inlineParser.refDefCandidateMap=this.refDefCandidateMap,this.inlineParser.options=this.options;t=r.next();){var o=t.node,i=t.entering,a=o.type;n&&n[a]&&n[a](o,{entering:i,options:this.options}),i||"paragraph"!==a&&"heading"!==a&&("tableCell"!==a||o.ignored)||this.inlineParser.parse(o)}},e.prototype.incorporateLine=function(e){var t,n=this.doc;this.oldtip=this.tip,this.offset=0,this.column=0,this.blank=!1,this.partiallyConsumedTab=!1,this.lineNumber+=1,-1!==e.indexOf("\0")&&(e=e.replace(/\0/g,"�")),this.currentLine=e;for(var r=!0;(t=n.lastChild)&&t.open;){switch(n=t,this.findNextNonspace(),oY[n.type].continue(this,n)){case 0:break;case 1:r=!1;break;case 2:this.lastLineLength=e.length;return;default:throw Error("continue returned illegal value, must be 0, 1, or 2")}if(!r){n=n.parent;break}}this.allClosed=n===this.oldtip,this.lastMatchedContainer=n;for(var o="paragraph"!==n.type&&oY[n.type].acceptsLines,i=ir.length;!o;){if(this.findNextNonspace(),"table"!==n.type&&"tableBody"!==n.type&&"paragraph"!==n.type&&!this.indented&&!il.test(e.slice(this.nextNonspace))){this.advanceNextNonspace();break}for(var a=0;a<i;){var s=ir[a](this,n);if(1===s){n=this.tip;break}if(2===s){n=this.tip,o=!0;break}a++}if(a===i){this.advanceNextNonspace();break}}if(this.allClosed||this.blank||"paragraph"!==this.tip.type){this.closeUnmatchedBlocks(),this.blank&&n.lastChild&&(n.lastChild.lastLineBlank=!0);for(var l=n.type,u=this.blank&&!("blockQuote"===l||oa(n)&&n.isFenced||"item"===l&&!n.firstChild&&n.sourcepos[0][0]===this.lineNumber),c=n;c;)c.lastLineBlank=u,c=c.parent;oY[l].acceptsLines?(this.addLine(),"htmlBlock"===n.type&&n.htmlBlockType>=1&&n.htmlBlockType<=5&&is[n.htmlBlockType].test(this.currentLine.slice(this.offset))&&(this.lastLineLength=e.length,this.finalize(n,this.lineNumber))):this.offset<e.length&&!this.blank&&(n=this.addChild("paragraph",this.offset),this.advanceNextNonspace(),this.addLine())}else this.addLine();this.lastLineLength=e.length},e.prototype.parse=function(e,t){this.doc=ic(),this.tip=this.doc,this.lineNumber=0,this.lastLineLength=0,this.offset=0,this.column=0,this.lastMatchedContainer=this.doc,this.currentLine="";var n=e.split(iu),r=n.length;this.lines=t||n,this.options.referenceDefinition&&this.clearRefMaps(),10===e.charCodeAt(e.length-1)&&(r-=1);for(var o=0;o<r;o++)this.incorporateLine(n[o]);for(;this.tip;)this.finalize(this.tip,r);return this.processInlines(this.doc),this.doc},e.prototype.partialParseStart=function(e,t){this.doc=ic(),this.tip=this.doc,this.lineNumber=e-1,this.lastLineLength=0,this.offset=0,this.column=0,this.lastMatchedContainer=this.doc,this.currentLine="";for(var n=t.length,r=0;r<n;r++)this.incorporateLine(t[r]);return this.doc},e.prototype.partialParseExtends=function(e){for(var t=0;t<e.length;t++)this.incorporateLine(e[t])},e.prototype.partialParseFinish=function(){for(;this.tip;)this.finalize(this.tip,this.lineNumber);this.processInlines(this.doc)},e.prototype.setRefMaps=function(e,t,n){this.refMap=e,this.refLinkCandidateMap=t,this.refDefCandidateMap=n},e.prototype.clearRefMaps=function(){[this.refMap,this.refLinkCandidateMap,this.refDefCandidateMap].forEach(function(e){Object.keys(e).forEach(function(t){delete e[t]})})},e}();function ih(e,t){return e[0]<t[0]?1:e[0]>t[0]?-1:e[1]<t[1]?1:e[1]>t[1]?-1:0}function im(e,t){for(var n=0;n<t.length;n++){var r=t[n];e.insertBefore(r)}}function iv(e,t){var n=e[0];return e[1][0]<t?1:n[0]>t?-1:0}function ig(e,t){for(var n=e.firstChild;n;){var r=iv(n.sourcepos,t);if(0===r)return n;if(-1===r)return n.prev||n;n=n.next}return e.lastChild}function iy(e,t,n){if(void 0===n&&(n=null),t)for(var r=t.walker();t&&t!==n;){e(t);var o=r.next();if(o)t=o.node;else break}}var ib=/\r\n|\n|\r/;function iw(e){return{id:e.id,title:e.title,sourcepos:e.sourcepos,unlinked:!1,destination:e.dest}}var ik=function(){function e(e,t){this.refMap={},this.refLinkCandidateMap={},this.refDefCandidateMap={},this.referenceDefinition=!!(null==t?void 0:t.referenceDefinition),this.parser=new id(t),this.parser.setRefMaps(this.refMap,this.refLinkCandidateMap,this.refDefCandidateMap),this.eventHandlerMap={change:[]},e=e||"",this.lineTexts=e.split(ib),this.root=this.parser.parse(e,this.lineTexts)}return e.prototype.updateLineTexts=function(e,t,n){var r,o=e[0],i=e[1],a=t[0],s=t[1],l=n.split(ib),u=l.length,c=this.lineTexts[o-1],p=this.lineTexts[a-1];l[0]=c.slice(0,i-1)+l[0],l[u-1]=l[u-1]+p.slice(s-1);var d=a-o+1;return(r=this.lineTexts).splice.apply(r,ri([o-1,d],l)),u-d},e.prototype.updateRootNodeState=function(){if(1===this.lineTexts.length&&""===this.lineTexts[0]){this.root.lastLineBlank=!0,this.root.sourcepos=[[1,1],[1,0]];return}this.root.lastChild&&(this.root.lastLineBlank=this.root.lastChild.lastLineBlank);for(var e=this.lineTexts,t=e.length-1;""===e[t];)t-=1;e.length-2>t&&(t+=1),this.root.sourcepos[1]=[t+1,e[t].length]},e.prototype.replaceRangeNodes=function(e,t,n){if(e)im(e,n),function(e,t){if(e.parent===t.parent&&e!==t){for(var n=e.next;n&&n!==t;){for(var r=n.next,o=0,i=["parent","prev","next"];o<i.length;o++){var a=i[o];n[a]&&(r1(n[a].id),n[a]=null)}n=r}e.next=t.next,t.next?t.next.prev=e:e.parent.lastChild=e}}
1(e,t),[e.id,t.id].forEach(function(e){return r1(e)}),e.unlink();else if(t)im(t,n),r1(t.id),t.unlink();else for(var r=this.root,o=n.length-1;o>=0;o-=1)r.prependChild(n[o])},e.prototype.getNodeRange=function(e,t){var n=ig(this.root,e[0]),r=ig(this.root,t[0]);return r&&r.next&&t[0]+1===r.next.sourcepos[0][0]&&(r=r.next),[n,r]},e.prototype.trigger=function(e,t){this.eventHandlerMap[e].forEach(function(e){e(t)})},e.prototype.extendEndLine=function(e){for(;""===this.lineTexts[e];)e+=1;return e},e.prototype.parseRange=function(e,t,n,r){e&&e.prev&&(os(e.prev)&&function(e){var t=e.match(/^[ \t]+/);if(t&&(t[0].length>=2||/\t/.test(t[0])))return!0;var n=t?e.slice(t.length):e;return o7.test(n)||ie.test(n)}(this.lineTexts[n-1])||"table"===e.prev.type&&(i=o=this.lineTexts[n-1],o$.test(i))&&-1!==o.indexOf("|"))&&(n=(e=e.prev).sourcepos[0][0]);for(var o,i,a=this.lineTexts.slice(n-1,r),s=this.parser.partialParseStart(n,a),l=t?t.next:this.root.firstChild,u=s.lastChild,c=u&&oa(u)&&u.open,p=u&&ou(u)&&u.open,d=u&&os(u);(c||p)&&l||d&&l&&("list"===l.type||l.sourcepos[0][1]>=2);){var f=this.extendEndLine(l.sourcepos[1][0]);this.parser.partialParseExtends(this.lineTexts.slice(r,f)),e||(e=t),t=l,r=f,l=l.next}return this.parser.partialParseFinish(),{newNodes:function(e){for(var t=[],n=e.firstChild;n;)t.push(n),n=n.next;return t}(s),extStartNode:e,extEndNode:t}},e.prototype.getRemovedNodeRange=function(e,t){return!e||e&&ol(e)||t&&ol(t)?null:{id:[e.id,t.id],line:[e.sourcepos[0][0]-1,t.sourcepos[1][0]-1]}},e.prototype.markDeletedRefMap=function(e,t){var n=this;if(!oC(this.refMap)){var r=function(e){if(ol(e)){var t=n.refMap[e.label];t&&e.id===t.id&&(t.unlinked=!0)}};e&&iy(r,e.parent,t),t&&iy(r,t)}},e.prototype.replaceWithNewRefDefState=function(e){var t=this;if(!oC(this.refMap)){var n=function(e){if(ol(e)){var n=e.label,r=t.refMap[n];(!r||r.unlinked)&&(t.refMap[n]=iw(e))}};e.forEach(function(e){iy(n,e)})}},e.prototype.replaceWithRefDefCandidate=function(){var e=this;oC(this.refDefCandidateMap)||ok(this.refDefCandidateMap,function(t,n){var r=n.label,o=n.sourcepos,i=e.refMap[r];(!i||i.unlinked||i.sourcepos[0][0]>o[0][0])&&(e.refMap[r]=iw(n))})},e.prototype.getRangeWithRefDef=function(e,t,n,r,o){if(this.referenceDefinition&&!oC(this.refMap)){var i=ig(this.root,e-1),a=ig(this.root,t+1);i&&ol(i)&&i!==n&&i!==r&&(e=(n=i).sourcepos[0][0]),a&&ol(a)&&a!==n&&a!==r&&(r=a,t=this.extendEndLine(r.sourcepos[1][0]+o))}return[n,r,e,t]},e.prototype.parse=function(e,t,n){void 0===n&&(n=0);var r=this.getNodeRange(e,t),o=r[0],i=r[1],a=o?Math.min(o.sourcepos[0][0],e[0]):e[0],s=this.extendEndLine((i?Math.max(i.sourcepos[1][0],t[0]):t[0])+n),l=this.parseRange.apply(this,this.getRangeWithRefDef(a,s,o,i,n)),u=l.newNodes,c=l.extStartNode,p=l.extEndNode,d=this.getRemovedNodeRange(c,p),f=p?p.next:this.root.firstChild;return this.referenceDefinition?(this.markDeletedRefMap(c,p),this.replaceRangeNodes(c,p,u),this.replaceWithNewRefDefState(u)):this.replaceRangeNodes(c,p,u),{nodes:u,removedNodeRange:d,nextNode:f}},e.prototype.parseRefLink=function(){var e=this,t=[];return oC(this.refMap)||ok(this.refMap,function(n,r){r.unlinked&&delete e.refMap[n],ok(e.refLinkCandidateMap,function(r,o){var i=o.node;o.refLabel===n&&t.push(e.parse(i.sourcepos[0],i.sourcepos[1]))})}),t},e.prototype.removeUnlinkedCandidate=function(){oC(this.refDefCandidateMap)||[this.refLinkCandidateMap,this.refDefCandidateMap].forEach(function(e){ok(e,function(t){(function(e){var t=r0[e]||null;if(!t)return!0;for(;t&&"document"!==t.type;){if(!t.parent&&!t.prev&&!t.next)return!0;t=t.parent}return!1})(t)&&delete e[t]})})},e.prototype.editMarkdown=function(e,t,n){var r=this.updateLineTexts(e,t,n),o=this.parse(e,t,r),i=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=ro({},e);return t.forEach(function(e){delete r[e]}),r}(o,"nextNode");!function(e,t){if(e&&e.parent&&0!==t){var n,r=e.parent.walker();for(r.resumeAt(e,!0);n=r.next();){var o=n.node;n.entering&&(o.sourcepos[0][0]+=t,o.sourcepos[1][0]+=t)}}}(o.nextNode,r),this.updateRootNodeState();var a=[i];return this.referenceDefinition&&(this.removeUnlinkedCandidate(),this.replaceWithRefDefCandidate(),a=a.concat(this.parseRefLink())),this.trigger("change",a),a},e.prototype.getLineTexts=function(){return this.lineTexts},e.prototype.getRootNode=function(){return this.root},e.prototype.findNodeAtPosition=function(e){var t=function(e,t){for(var n=e,r=null;n;){var o=function(e,t){var n=e[0];return 1===ih(e[1],t)?1:-1===ih(n,t)?-1:0}(n.sourcepos,t);if(0===o)if(n.firstChild)r=n,n=n.firstChild;else break;else{if(-1===o||!n.next)return r;n=n.next}}return n}(this.root,e);return t&&t!==this.root?t:null},e.prototype.findFirstNodeAtLine=function(e){return function(e,t){for(var n=e.firstChild,r=null;n;){var o=iv(n.sourcepos,t);if(0===o){if(n.sourcepos[0][0]===t||!n.firstChild)return n;r=n,n=n.firstChild}else if(-1===o)break;else r=n,n=n.next}if(r){for(var i=function(e){for(;e.lastChild;)e=e.lastChild;return e}(r);i.parent&&"document"!==i.parent.type&&i.parent.sourcepos[0][0]===i.sourcepos[0][0];)i=i.parent;return i}return null}(this.root,e)},e.prototype.on=function(e,t){this.eventHandlerMap[e].push(t)},e.prototype.off=function(e,t){var n=this.eventHandlerMap[e],r=n.indexOf(t);n.splice(r,1)},e.prototype.findNodeById=function(e){return r0[e]||null},e.prototype.removeAllNode=function(){r0={}},e}
1(),iC=RegExp("<(/?(?:title|textarea|style|xmp|iframe|noembed|noframes|script|plaintext)[^>]*>)","ig");function ix(e){return iC.test(e)?e.replace(iC,function(e,t){return"&lt;"+t}):e}var iT={heading:function(e,t){return{type:t.entering?"openTag":"closeTag",tagName:"h"+e.level,outerNewLine:!0}},text:function(e){return{type:"text",content:e.literal}},softbreak:function(e,t){return{type:"html",content:t.options.softbreak}},linebreak:function(){return{type:"html",content:"<br />\n"}},emph:function(e,t){return{type:t.entering?"openTag":"closeTag",tagName:"em"}},strong:function(e,t){return{type:t.entering?"openTag":"closeTag",tagName:"strong"}},paragraph:function(e,t){var n,r=t.entering,o=null==(n=e.parent)?void 0:n.parent;return o&&"list"===o.type&&o.listData.tight?null:{type:r?"openTag":"closeTag",tagName:"p",outerNewLine:!0}},thematicBreak:function(){return{type:"openTag",tagName:"hr",outerNewLine:!0,selfClose:!0}},blockQuote:function(e,t){return{type:t.entering?"openTag":"closeTag",tagName:"blockquote",outerNewLine:!0,innerNewLine:!0}},list:function(e,t){var n=t.entering,r=e.listData,o=r.type,i=r.start,a="bullet"===o?"ul":"ol",s={};return"ol"===a&&null!==i&&1!==i&&(s.start=i.toString()),{type:n?"openTag":"closeTag",tagName:a,attributes:s,outerNewLine:!0}},item:function(e,t){return{type:t.entering?"openTag":"closeTag",tagName:"li",outerNewLine:!0}},htmlInline:function(e,t){return{type:"html",content:t.options.tagFilter?ix(e.literal):e.literal}},htmlBlock:function(e,t){var n=t.options,r=n.tagFilter?ix(e.literal):e.literal;return n.nodeId?[{type:"openTag",tagName:"div",outerNewLine:!0},{type:"html",content:r},{type:"closeTag",tagName:"div",outerNewLine:!0}]:{type:"html",content:r,outerNewLine:!0}},code:function(e){return[{type:"openTag",tagName:"code"},{type:"text",content:e.literal},{type:"closeTag",tagName:"code"}]},codeBlock:function(e){var t=e.info,n=t?t.split(/\s+/):[],r=[];return n.length>0&&n[0].length>0&&r.push("language-"+rK(n[0])),[{type:"openTag",tagName:"pre",outerNewLine:!0},{type:"openTag",tagName:"code",classNames:r},{type:"text",content:e.literal},{type:"closeTag",tagName:"code"},{type:"closeTag",tagName:"pre",outerNewLine:!0}]},link:function(e,t){if(t.entering){var n=e.title,r=e.destination;return{type:"openTag",tagName:"a",attributes:ro({href:rK(r)},n&&{title:rK(n)})}}return{type:"closeTag",tagName:"a"}},image:function(e,t){var n=t.getChildrenText,r=t.skipChildren,o=e.title,i=e.destination;return r(),{type:"openTag",tagName:"img",selfClose:!0,attributes:ro({src:rK(i),alt:n(e)},o&&{title:rK(o)})}},customBlock:function(e,t,n){var r=e.info.trim().toLowerCase(),o=n[r];if(o)try{return o(e,t)}catch(e){console.warn("[@toast-ui/editor] - The error occurred when "+r+" block node was parsed in markdown renderer: "+e)}return[{type:"openTag",tagName:"div",outerNewLine:!0},{type:"text",content:e.literal},{type:"closeTag",tagName:"div",outerNewLine:!0}]},frontMatter:function(e){return[{type:"openTag",tagName:"div",outerNewLine:!0,attributes:{style:"white-space: pre; display: none;"}},{type:"text",content:e.literal},{type:"closeTag",tagName:"div",outerNewLine:!0}]},customInline:function(e,t,n){var r=e.info,o=e.firstChild,i=r.trim().toLowerCase(),a=n[i],s=t.entering;if(a)try{return a(e,t)}catch(e){console.warn("[@toast-ui/editor] - The error occurred when "+i+" inline node was parsed in markdown renderer: "+e)}return s?[{type:"openTag",tagName:"span"},{type:"text",content:"$$"+r+(o?" ":"")}]:[{type:"text",content:"$$"},{type:"closeTag",tagName:"span"}]}},iE={strike:function(e,t){return{type:t.entering?"openTag":"closeTag",tagName:"del"}},item:function(e,t){var n=t.entering,r=e.listData,o=r.checked,i=r.task;if(n){var a={type:"openTag",tagName:"li",outerNewLine:!0};return i?[a,{type:"openTag",tagName:"input",selfClose:!0,attributes:ro(ro({},o&&{checked:""}),{disabled:"",type:"checkbox"})},{type:"text",content:" "}]:a}return{type:"closeTag",tagName:"li",outerNewLine:!0}},table:function(e,t){return{type:t.entering?"openTag":"closeTag",tagName:"table",outerNewLine:!0}},tableHead:function(e,t){return{type:t.entering?"openTag":"closeTag",tagName:"thead",outerNewLine:!0}},tableBody:function(e,t){return{type:t.entering?"openTag":"closeTag",tagName:"tbody",outerNewLine:!0}},tableRow:function(e,t){if(t.entering)return{type:"openTag",tagName:"tr",outerNewLine:!0};var n=[];if(e.lastChild)for(var r=e.parent.parent.columns.length,o=e.last
1Child.endIdx,i=o+1;i<r;i+=1)n.push({type:"openTag",tagName:"td",outerNewLine:!0},{type:"closeTag",tagName:"td",outerNewLine:!0});return n.push({type:"closeTag",tagName:"tr",outerNewLine:!0}),n},tableCell:function(e,t){var n=t.entering;if(e.ignored)return{type:"text",content:""};var r=e.parent.parent,o="tableHead"===r.type?"th":"td",i=r.parent.columns[e.startIdx],a=(null==i?void 0:i.align)?{align:i.align}:null;return n?ro({type:"openTag",tagName:o,outerNewLine:!0},a&&{attributes:a}):{type:"closeTag",tagName:o,outerNewLine:!0}}},iM={softbreak:"\n",gfm:!1,tagFilter:!1,nodeId:!1};function iL(e){for(var t=[],n=e.walker(),r=null;r=n.next();){var o=r.node;"text"===o.type&&t.push(o.literal)}return t.join("")}var iN=function(){function e(e){this.buffer=[],this.options=ro(ro({},iM),e),this.convertors=this.createConvertors(),delete this.options.convertors}return e.prototype.createConvertors=function(){var e=ro({},iT);if(this.options.gfm&&(e=ro(ro({},e),iE)),this.options.convertors){var t=this.options.convertors,n=Object.keys(t),r=ro(ro({},iT),iE);n.forEach(function(n){var o=e[n],i=t[n],a=-1===Object.keys(r).indexOf(n)?n.toLowerCase():n;o?e[a]=function(e,t,n){return t.origin=function(){return o(e,t,n)},i(e,t)}:e[a]=i})}return e},e.prototype.getConvertors=function(){return this.convertors},e.prototype.getOptions=function(){return this.options},e.prototype.render=function(e){var t=this;this.buffer=[];for(var n=e.walker(),r=null,o=this;r=n.next();)!function(){var e=r.node,i=r.entering,a=o.convertors[e.type];if(a){var s=!1,l={entering:i,leaf:!rY(e),options:o.options,getChildrenText:iL,skipChildren:function(){s=!0}},u=ou(e)||"customInline"===e.type?a(e,l,o.convertors):a(e,l);u&&((Array.isArray(u)?u:[u]).forEach(function(n,r){"openTag"===n.type&&t.options.nodeId&&0===r&&(n.attributes||(n.attributes={}),n.attributes["data-nodeid"]=String(e.id)),t.renderHTMLNode(n)}),s&&(n.resumeAt(e,!1),n.next()))}}();return this.addNewLine(),this.buffer.join("")},e.prototype.renderHTMLNode=function(e){switch(e.type){case"openTag":case"closeTag":this.renderElementNode(e);break;case"text":this.renderTextNode(e);break;case"html":this.renderRawHtmlNode(e)}},e.prototype.generateOpenTagString=function(e){var t=this,n=e.tagName,r=e.classNames,o=e.attributes;this.buffer.push("<"+n),r&&r.length>0&&this.buffer.push(' class="'+r.join(" ")+'"'),o&&Object.keys(o).forEach(function(e){var n=o[e];t.buffer.push(" "+e+'="'+n+'"')}),e.selfClose&&this.buffer.push(" /"),this.buffer.push(">")},e.prototype.generateCloseTagString=function(e){var t=e.tagName;this.buffer.push("</"+t+">")},e.prototype.addNewLine=function(){this.buffer.length&&"\n"!==ob(ob(this.buffer))&&this.buffer.push("\n")},e.prototype.addOuterNewLine=function(e){e.outerNewLine&&this.addNewLine()},e.prototype.addInnerNewLine=function(e){e.innerNewLine&&this.addNewLine()},e.prototype.renderTextNode=function(e){this.buffer.push(rK(e.content))},e.prototype.renderRawHtmlNode=function(e){this.addOuterNewLine(e),this.buffer.push(e.content),this.addOuterNewLine(e)},e.prototype.renderElementNode=function(e){"openTag"===e.type?(this.addOuterNewLine(e),this.generateOpenTagString(e),e.selfClose?this.addOuterNewLine(e):this.addInnerNewLine(e)):(this.addInnerNewLine(e),this.generateCloseTagString(e),this.addOuterNewLine(e))},e}(),iS=Object.hasOwnProperty,iA=Object.setPrototypeOf,iD=Object.isFrozen,iI=Object.getPrototypeOf,iO=Object.getOwnPropertyDescriptor,iR=Object.freeze,iP=Object.seal,iH=Object.create,iB="undefined"!=typeof Reflect&&Reflect,iF=iB.apply,iq=iB.construct;iF||(iF=function(e,t,n){return e.apply(t,n)}),iR||(iR=function(e){return e}),iP||(iP=function(e){return e}),iq||(iq=function(e,t){return new(Function.prototype.bind.apply(e,[null].concat(function(e){if(!Array.isArray(e))return Array.from(e);for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}(t))))});var i_=iX(Array.prototype.forEach),ij=iX(Array.prototype.pop),iz=iX(Array.prototype.push),iU=iX(String.prototype.toLowerCase),iV=iX(String.prototype.match),i$=iX(String.prototype.replace),iW=iX(String.prototype.indexOf),iG=iX(String.prototype.trim),iK=iX(RegExp.prototype.test),iZ=(i=TypeError,function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return iq(i,t)});function iX(e){return function(t){for(var n=arguments.length,r=Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return iF(e,t,r)}}function iQ(e,t){iA&&iA(e,null);for(var n=t.length;n--;){var r=t[n];if("string"==typeof r){var o=iU(r);o!==r&&(iD(t)||(t[n]=o),r=o)}e[r]=!0}return e}function iY(e){var t=iH(null),n=void 0;for(n in e)iF(iS,e,[n])&&(t[n]=e[n]);return t}function iJ(e,t){for(;null!==e;){var n=iO(e,t);if(n){if(n.get)return iX(n.get);if("function"==typeof n.value)return iX(n.value)}e=iI(e)}return function(e){return console.warn("fallback value for",e),null}}var i0=iR(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),i1=iR(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),i2=iR(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),i3=iR(["animate","color-profile","cursor","discard","fedropshadow","feimage","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),i5=iR(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"]),i4=iR(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),i6=iR(["#text"]),i9=iR(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","
1spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),i8=iR(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),i7=iR(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),ae=iR(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),at=iP(/\{\{[\s\S]*|[\s\S]*\}\}/gm),an=iP(/<%[\s\S]*|[\s\S]*%>/gm),ar=iP(/^data-[\-\w.\u00B7-\uFFFF]/),ao=iP(/^aria-[\-\w]+$/),ai=iP(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),aa=iP(/^(?:\w+script|data):/i),as=iP(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),al="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function au(e){if(!Array.isArray(e))return Array.from(e);for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}var ac=function(e,t){if((void 0===e?"undefined":al(e))!=="object"||"function"!=typeof e.createPolicy)return null;var n=null,r="data-tt-policy-suffix";t.currentScript&&t.currentScript.hasAttribute(r)&&(n=t.currentScript.getAttribute(r));var o="dompurify"+(n?"#"+n:"");try{return e.createPolicy(o,{createHTML:function(e){return e}})}catch(e){return console.warn("TrustedTypes policy "+o+" could not be created."),null}},ap=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"undefined"==typeof window?null:window,n=function(t){return e(t)};if(n.version="2.3.3",n.removed=[],!t||!t.document||9!==t.document.nodeType)return n.isSupported=!1,n;var r=t.document,o=t.document,i=t.DocumentFragment,a=t.HTMLTemplateElement,s=t.Node,l=t.Element,u=t.NodeFilter,c=t.NamedNodeMap,p=void 0===c?t.NamedNodeMap||t.MozNamedAttrMap:c,d=t.Text,f=t.Comment,h=t.DOMParser,m=t.trustedTypes,v=l.prototype,g=iJ(v,"cloneNode"),y=iJ(v,"nextSibling"),b=iJ(v,"childNodes"),w=iJ(v,"parentNode");if("function"==typeof a){var k=o.createElement("template");k.content&&k.content.ownerDocument&&(o=k.content.ownerDocument)}var C=ac(m,r),x=C&&Z?C.createHTML(""):"",T=o,E=T.implementation,M=T.createNodeIterator,L=T.createDocumentFragment,N=T.getElementsByTagName,S=r.importNode,A={};try{A=iY(o).documentMode?o.documentMode:{}}catch(e){}var D={};n.isSupported="function"==typeof w&&E&&void 0!==E.createHTMLDocument&&9!==A;var I=ai,O=null,R=iQ({},[].concat(au(i0),au(i1),au(i2),au(i5),au(i6))),P=null,H=iQ({},[].concat(au(i9),au(i8),au(i7),au(ae))),B=null,F=null,q=!0,_=!0,j=!1,z=!1,U=!1,V=!1,$=!1,W=!1,G=!1,K=!0,Z=!1,X=!0,Q=!0,Y=!1,J={},ee=null,et=iQ({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),en=null,er=iQ({},["audio","video","img","source","image","track"]),eo=null,ei=iQ({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ea="http://www.w3.org/1998/Math/MathML",es="http://www.w3.org/2000/svg",el="http://www.w3.org/1999/xhtml",eu=el,ec=!1,ep=void 0,ed=["application/xhtml+xml","text/html"],ef=void 0,eh=null,em=o.createElement("form"),ev=function(e){eh&&eh===e||(e&&(void 0===e?"undefined":al(e))==="object"||(e={}),O="ALLOWED_TAGS"in(e=iY(e))?iQ({},e.ALLOWED_TAGS):R,P="ALLOWED_ATTR"in e?iQ({},e.ALLOWED_ATTR):H,eo="ADD_URI_SAFE_ATTR"in e?iQ(iY(ei),e.ADD_URI_SAFE_ATTR):ei,en="ADD_DATA_URI_TAGS"in e?iQ(iY(er),e.ADD_DATA_URI_TAGS):er,ee="FORBID_CONTENTS"in e?iQ({},e.FORBID_CONTENTS):et,B="FORBID_TAGS"in e?iQ({},e.FORBID_TAGS):{},F="FORBID_ATTR"in e?iQ({},e.FORBID_ATTR):{},J="USE_PROFILES"in e&&e.USE_PROFILES,q=!1!==e.ALLOW_ARIA_ATTR,_=!1!==e.ALLOW_DATA_ATTR,j=e.ALLOW_UNKNOWN_PROTOCOLS||!1,z=e.SAFE_FOR_TEMPLATES||!1,U=e.WHOLE_DOCUMENT||!1,W=e.RETURN_DOM||!1,G=e.RETURN_DOM_FRAGMENT||!1,K=!1!==e.RETURN_DOM_IMPORT,Z=e.RETURN_TRUSTED_TYPE||!1,$=e.FORCE_BODY||!1,X=!1!==e.
1SANITIZE_DOM,Q=!1!==e.KEEP_CONTENT,Y=e.IN_PLACE||!1,I=e.ALLOWED_URI_REGEXP||I,eu=e.NAMESPACE||el,ef="application/xhtml+xml"===(ep=ep=-1===ed.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE)?function(e){return e}:iU,z&&(_=!1),G&&(W=!0),J&&(O=iQ({},[].concat(au(i6))),P=[],!0===J.html&&(iQ(O,i0),iQ(P,i9)),!0===J.svg&&(iQ(O,i1),iQ(P,i8),iQ(P,ae)),!0===J.svgFilters&&(iQ(O,i2),iQ(P,i8),iQ(P,ae)),!0===J.mathMl&&(iQ(O,i5),iQ(P,i7),iQ(P,ae))),e.ADD_TAGS&&(O===R&&(O=iY(O)),iQ(O,e.ADD_TAGS)),e.ADD_ATTR&&(P===H&&(P=iY(P)),iQ(P,e.ADD_ATTR)),e.ADD_URI_SAFE_ATTR&&iQ(eo,e.ADD_URI_SAFE_ATTR),e.FORBID_CONTENTS&&(ee===et&&(ee=iY(ee)),iQ(ee,e.FORBID_CONTENTS)),Q&&(O["#text"]=!0),U&&iQ(O,["html","head","body"]),O.table&&(iQ(O,["tbody"]),delete B.tbody),iR&&iR(e),eh=e)},eg=iQ({},["mi","mo","mn","ms","mtext"]),ey=iQ({},["foreignobject","desc","title","annotation-xml"]),eb=iQ({},i1);iQ(eb,i2),iQ(eb,i3);var ew=iQ({},i5);iQ(ew,i4);var ek=function(e){var t=w(e);t&&t.tagName||(t={namespaceURI:el,tagName:"template"});var n=iU(e.tagName),r=iU(t.tagName);if(e.namespaceURI===es)return t.namespaceURI===el?"svg"===n:t.namespaceURI===ea?"svg"===n&&("annotation-xml"===r||eg[r]):!!eb[n];if(e.namespaceURI===ea)return t.namespaceURI===el?"math"===n:t.namespaceURI===es?"math"===n&&ey[r]:!!ew[n];if(e.namespaceURI===el){if(t.namespaceURI===es&&!ey[r]||t.namespaceURI===ea&&!eg[r])return!1;var o=iQ({},["title","style","font","a","script"]);return!ew[n]&&(o[n]||!eb[n])}return!1},eC=function(e){iz(n.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){try{e.outerHTML=x}catch(t){e.remove()}}},ex=function(e,t){try{iz(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){iz(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!P[e])if(W||G)try{eC(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},eT=function(e){var t=void 0,n=void 0;if($)e="<remove></remove>"+e;else{var r=iV(e,/^[\r\n\t ]+/);n=r&&r[0]}"application/xhtml+xml"===ep&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");var i=C?C.createHTML(e):e;if(eu===el)try{t=new h().parseFromString(i,ep)}catch(e){}if(!t||!t.documentElement){t=E.createDocument(eu,"template",null);try{t.documentElement.innerHTML=ec?"":i}catch(e){}}var a=t.body||t.documentElement;return(e&&n&&a.insertBefore(o.createTextNode(n),a.childNodes[0]||null),eu===el)?N.call(t,U?"html":"body")[0]:U?t.documentElement:a},eE=function(e){return M.call(e.ownerDocument||e,e,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT,null,!1)},eM=function(e){return(void 0===s?"undefined":al(s))==="object"?e instanceof s:e&&(void 0===e?"undefined":al(e))==="object"&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},eL=function(e,t,r){D[e]&&i_(D[e],function(e){e.call(n,t,r,eh)})},eN=function(e){var t=void 0;if(eL("beforeSanitizeElements",e,null),!(e instanceof d)&&!(e instanceof f)&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof p)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||0)||iV(e.nodeName,/[\u0080-\uFFFF]/))return eC(e),!0;var r=ef(e.nodeName);if(eL("uponSanitizeElement",e,{tagName:r,allowedTags:O}),!eM(e.firstElementChild)&&(!eM(e.content)||!eM(e.content.firstElementChild))&&iK(/<[/\w]/g,e.innerHTML)&&iK(/<[/\w]/g,e.textContent)||"select"===r&&iK(/<template/i,e.innerHTML))return eC(e),!0;if(!O[r]||B[r]){if(Q&&!ee[r]){var o=w(e)||e.parentNode,i=b(e)||e.childNodes;if(i&&o)for(var a=i.length,s=a-1;s>=0;--s)o.insertBefore(g(i[s],!0),y(e))}return eC(e),!0}return e instanceof l&&!ek(e)||("noscript"===r||"noembed"===r)&&iK(/<\/no(script|embed)/i,e.innerHTML)?(eC(e),!0):(z&&3===e.nodeType&&(t=i$(t=e.textContent,at," "),t=i$(t,an," "),e.textContent!==t&&(iz(n.removed,{element:e.cloneNode()}),e.textContent=t)),eL("afterSanitizeElements",e,null),!1)},eS=function(e,t,n){if(X&&("id"===t||"name"===t)&&(n in o||n in em))return!1;if(_&&!F[t]&&iK(ar,t));else if(q&&iK(ao,t));else if(!P[t]||F[t])return!1;else if(eo[t]);else if(iK(I,i$(n,as,"")));else if(("src"===t||"xlink:href"===t||"href"===t)&&"script"!==e&&0===iW(n,"data:")&&en[e]);
1else if(j&&!iK(aa,i$(n,as,"")));else if(n)return!1;return!0},eA=function(e){var t=void 0,r=void 0,o=void 0,i=void 0;eL("beforeSanitizeAttributes",e,null);var a=e.attributes;if(a){var s={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:P};for(i=a.length;i--;){var l=t=a[i],u=l.name,c=l.namespaceURI;if(r=iG(t.value),s.attrName=o=ef(u),s.attrValue=r,s.keepAttr=!0,s.forceKeepAttr=void 0,eL("uponSanitizeAttribute",e,s),r=s.attrValue,!s.forceKeepAttr&&(ex(u,e),s.keepAttr)){if(iK(/\/>/i,r)){ex(u,e);continue}if(z&&(r=i$(r,at," "),r=i$(r,an," ")),eS(ef(e.nodeName),o,r))try{c?e.setAttributeNS(c,u,r):e.setAttribute(u,r),ij(n.removed)}catch(e){}}}eL("afterSanitizeAttributes",e,null)}},eD=function e(t){var n=void 0,r=eE(t);for(eL("beforeSanitizeShadowDOM",t,null);n=r.nextNode();)eL("uponSanitizeShadowNode",n,null),eN(n)||(n.content instanceof i&&e(n.content),eA(n));eL("afterSanitizeShadowDOM",t,null)};return n.sanitize=function(e,o){var a=void 0,l=void 0,u=void 0,c=void 0,p=void 0;if((ec=!e)&&(e="\x3c!--\x3e"),"string"!=typeof e&&!eM(e)){if("function"!=typeof e.toString)throw iZ("toString is not a function");else if("string"!=typeof(e=e.toString()))throw iZ("dirty is not a string, aborting")}if(!n.isSupported){if("object"===al(t.toStaticHTML)||"function"==typeof t.toStaticHTML){if("string"==typeof e)return t.toStaticHTML(e);if(eM(e))return t.toStaticHTML(e.outerHTML)}return e}if(V||ev(o),n.removed=[],"string"==typeof e&&(Y=!1),Y);else if(e instanceof s)1===(l=(a=eT("\x3c!----\x3e")).ownerDocument.importNode(e,!0)).nodeType&&"BODY"===l.nodeName||"HTML"===l.nodeName?a=l:a.appendChild(l);else{if(!W&&!z&&!U&&-1===e.indexOf("<"))return C&&Z?C.createHTML(e):e;if(!(a=eT(e)))return W?null:x}a&&$&&eC(a.firstChild);for(var d=eE(Y?e:a);u=d.nextNode();)3===u.nodeType&&u===c||eN(u)||(u.content instanceof i&&eD(u.content),eA(u),c=u);if(c=null,Y)return e;if(W){if(G)for(p=L.call(a.ownerDocument);a.firstChild;)p.appendChild(a.firstChild);else p=a;return K&&(p=S.call(r,p,!0)),p}var f=U?a.outerHTML:a.innerHTML;return z&&(f=i$(f,at," "),f=i$(f,an," ")),C&&Z?C.createHTML(f):f},n.setConfig=function(e){ev(e),V=!0},n.clearConfig=function(){eh=null,V=!1},n.isValidAttribute=function(e,t,n){return eh||ev({}),eS(ef(e),ef(t),n)},n.addHook=function(e,t){"function"==typeof t&&(D[e]=D[e]||[],iz(D[e],t))},n.removeHook=function(e){D[e]&&ij(D[e])},n.removeHooks=function(e){D[e]&&(D[e]=[])},n.removeAllHooks=function(){D={}},n}(),ad=["iframe","embed"],af=[];function ah(e){eL(ad,e)&&af.push(e.toLowerCase())}function am(e,t){return ap.sanitize(e,X({ADD_TAGS:af,ADD_ATTR:["rel","target","hreflang","type"],FORBID_TAGS:["input","script","textarea","form","button","select","meta","style","link","title","object","base"]},t))}function av(e,t){return e.literal.replace(RegExp("(<\\s*"+t+"[^>]*>)|(</"+t+"\\s*[>])","ig"),"").trim()}function ag(e){var t=(e=e.match(tf)[0]).match(RegExp(tc,"g"));return t?t.reduce(function(e,t){var n=t.trim().split("="),r=n[0],o=n.slice(1);return o.length&&(e[r]=o.join("=").replace(/'|"/g,"").trim()),e},{}):{}}function ay(e){return ez(e.attributes).reduce(function(e,t){return e[t.nodeName]=t.nodeValue,e},{})}function ab(e,t,n,r){var o=r.getToDOMNode(t)(e),i=n(o.outerHTML),a=document.createElement("div");a.innerHTML=i;var s=ay(o=a.firstChild);return{dom:o,htmlAttrs:s}}var aw={htmlBlock:function(e,t,n){return{atom:!0,content:"block+",group:"block",attrs:{htmlAttrs:{default:{}},childrenHTML:{default:""},htmlBlock:{default:!0}},parseDOM:[{tag:e,getAttrs:function(e){return{htmlAttrs:ay(e),childrenHTML:e.innerHTML}}}],toDOM:function(r){var o=ab(r,e,t,n),i=o.dom,a=o.htmlAttrs;return a.class=a.class?a.class+" html-block":"html-block",Q([e,a],ez(i.childNodes))}}},htmlInline:function(e,t,n){return{attrs:{htmlAttrs:{default:{}},htmlInline:{default:!0}},parseDOM:[{tag:e,getAttrs:function(e){return{htmlAttrs:ay(e)}}}],toDOM:function(r){var o=ab(r,e,t,n).htmlAttrs;return[e,o,0]}}}},ak=/^\s*<\s*\//,aC={paragraph:function(e,t){var n=t.entering,r=t.origin;return t.options.nodeId?{type:n?"openTag":"closeTag",outerNewLine:!0,tagName:"p"}:r()},softbreak:function(e){return{type:"html",content:e.prev&&"htmlInline"===e.prev.type&&/<br ?\/?>/.test(e.prev.literal)?"\n":"<br>\n"}},item:function(e,t){if(t.entering){var n={},r=[];
1return e.listData.task&&(n["data-task"]="",r.push("task-list-item"),e.listData.checked&&(r.push("checked"),n["data-task-checked"]="")),{type:"openTag",tagName:"li",classNames:r,attributes:n,outerNewLine:!0}}return{type:"closeTag",tagName:"li",outerNewLine:!0}},code:function(e){return[{type:"openTag",tagName:"code",attributes:{"data-backticks":String(e.tickCount)}},{type:"text",content:e.literal},{type:"closeTag",tagName:"code"}]},codeBlock:function(e){var t=e.fenceLength,n=e.info,r=n?n.split(/\s+/):[],o=[],i={};if(t>3&&(i["data-backticks"]=t),r.length>0&&r[0].length>0){var a=r[0];o.push("lang-"+a),i["data-language"]=a}return[{type:"openTag",tagName:"pre",classNames:o},{type:"openTag",tagName:"code",attributes:i},{type:"text",content:e.literal},{type:"closeTag",tagName:"code"},{type:"closeTag",tagName:"pre"}]},customInline:function(e,t){var n=t.origin,r=t.entering,o=t.skipChildren,i=e.info;return -1!==i.indexOf("widget")&&r?(o(),[{type:"openTag",tagName:"span",classNames:["tui-widget"]},{type:"html",content:tt(i,to(e)).outerHTML},{type:"closeTag",tagName:"span"}]):n()}};function ax(e,t){var n=X({},aC);return e&&(n.link=function(t,n){var r=n.entering,o=(0,n.origin)();return r&&(o.attributes=X(X({},o.attributes),e)),o}),t&&Object.keys(t).forEach(function(e){var r=n[e],o=t[e];r&&tq(o)?n[e]=function(e,t){var n=X({},t);return n.origin=function(){return r(e,t)},o(e,n)}:eL(["htmlBlock","htmlInline"],e)&&!tq(o)?n[e]=function(e,t){var n=e.literal.match(tf);if(n){var r=n[0],i=n[1],a=n[3],s=(i||a).toLowerCase(),l=o[s],u=av(e,s);if(l){var c=X({},e);return c.attrs=ag(r),c.childrenHTML=u,c.type=s,t.entering=!ak.test(e.literal),l(c,t)}}return t.origin()}:n[e]=o}),n}var aT=["list","item","blockQuote"],aE=["UL","OL","BLOCKQUOTE"];function aM(e,t,n){var r=eZ(t)-1,o=eX(t)-1,i=n[r].getBoundingClientRect(),a=n[o].offsetTop-n[r].offsetTop+n[o].clientHeight;return{height:a<=0?n[r].clientHeight:a+function(e,t,n){for(var r,o,i,a=e.childCount-1,s=0;n<=a&&(r=n,!(i=e.child(r)).childCount||1===i.childCount&&!(null==(o=i.firstChild.text)?void 0:o.trim()));)s+=t[n].clientHeight,n+=1;return s}(e,n,Math.min(o+1,e.childCount-1)),rect:i}}function aL(e,t){for(var n=0;e&&e!==t&&(eL(aE,e.tagName)||(n+=e.offsetTop),e.offsetParent!==t.offsetParent);)e=e.parentElement;return n}function aN(e,t){for(var n,r=e.querySelector('[data-nodeid="'+t.id+'"]');!r||"strike"===(n=t.type)||"strong"===n||"emph"===n||"code"===n||"link"===n||"image"===n;)t=t.parent,r=e.querySelector('[data-nodeid="'+t.id+'"]');for(var o={mdNode:t,el:r},i=o.mdNode,a=o.el;(eL(aT,i.type)||"table"===i.type)&&i.firstChild;)i=i.firstChild,a=a.firstElementChild;return{mdNode:i,el:a}}var aS={};function aA(e){e&&(delete aS[Number(e.getAttribute("data-nodeid"))],ez(e.children).forEach(function(e){aA(e)}))}var aD=tb("md-preview-highlight"),aI=function(){function e(e,t){var n=document.createElement("div");this.el=n,this.eventEmitter=e,this.isViewer=!!t.isViewer,this.el.className=tb("md-preview");var r=t.linkAttributes,o=t.customHTMLRenderer,i=t.sanitizer,a=t.highlight;this.renderer=new iN({gfm:!0,nodeId:!0,convertors:ax(r,o)}),this.cursorNodeId=null,this.sanitizer=i,this.initEvent(void 0!==a&&a),this.initContentSection(),this.isViewer&&(this.previewContent.style.overflowWrap="break-word")}return e.prototype.initContentSection=function(){this.previewContent=tT('<div class="'+tb("contents")+'"></div>'),this.isViewer||this.el.appendChild(this.previewContent)},e.prototype.toggleActive=function(e){tx(this.el,"active",e)},e.prototype.initEvent=function(e){var t=this;this.eventEmitter.listen("updatePreview",this.update.bind(this)),this.isViewer||(e&&(this.eventEmitter.listen("changeToolbarState",function(e){var n=e.mdNode,r=e.cursorPos;t.updateCursorNode(n,r)}),this.eventEmitter.listen("blur",function(){t.removeHighlight()})),rt(this.el,"scroll",function(e){t.eventEmitter.emit("scroll","preview",function(e,t){for(var n=t,r=null;n;){var o=n.firstElementChild;if(!o)break;var i=function e(t,n,r){return t&&n>r+t.offsetTop?e(t.nextElementSibling,n,r)||t:null}(o,e,aL(n,t));r=n,n=i}var a=n||r;return a===t?null:a}(e.target.scrollTop,t.previewContent))}),this.eventEmitter.listen("changePreviewTabPreview",function(){return t.toggleActive(!0)}),this.eventEmitter.listen("changePreviewTabWrite",function(){return t.toggleActive(!1)}))},e.prototype.removeHighlight=function(){if(this.cursorNodeId){var e=this.getElementByNodeId(this.cursorNodeId);e&&ep(e,aD)}},e.prototype.updateCursorNode=function(e,t){e&&("tableRow"===(e=e2(e,function(e){return!function(e){switch(e.type){case"code":case"text":case"emph":case"strong":case"strike":case"link":case"image":case"htmlInline":case"linebreak":case"softbreak":case"customInline":return!0;default:return!1}}(e)})).type?e=function(e,t){for(var n=e.firstChild;n&&n.next&&!(eQ(n.next)>t+1);)n=n.next;return n}(e,t[1]):"tableBody"===e.type&&(e=null));var n=e?e.id:null;if(this.cursorNodeId!==n){var r=this.getElementByNodeId(this.cursorNodeId),o=this.getElementByNodeId(n);r&&ep(r,aD),o&&ec(o,aD),this.cursorNodeId=n}},e.prototype.getElementByNodeId=function(e){return e?this.previewContent.querySelector('[data-nodeid="'+e+'"]'):null},e.prototype.update=function(e){var t=this;e.forEach(function(e){return t.replaceRangeNodes(e)}),this.eventEmitter.emit("afterPreviewRender",this)},e.prototype.replaceRangeNodes=function(e){var t=this,n=e.nodes,r=e.removedNodeRange,o=this.previewContent,i=this.eventEmitter.emitReduce("beforePreviewRender",this.sanitizer(n.map(function(e){return t.renderer.render(e)}).join("")));if(r){var a=r.id,s=a[0],l=a[1],u=this.getElementByNodeId(s),c=this.getElementByNodeId(l);if(u){u.insertAdjacentHTML("beforebegin",i);for(var p=u;p&&p!==c;){var d=p.nextElementSibling;tC(p),aA(p),p=d}(null==p?void 0:p.parentNode)&&(tC(p),aA(p))}}else o.insertAdjacentHTML("afterbegin",i)},e.prototype.getRenderer=function(){return this.renderer},e.prototype.destroy=function(){n7(this.el,"scroll"),this.el=null},e.prototype.getElement=function(){return this.el},e.prototype.getHTML=function(){return tS(this.previewContent.innerHTML)},e.prototype.setHTML=function(e){this.previewContent.innerHTML=e},e.prototype.setHeight=function(e){ei(this.el,{height:e+"px"})},e.prototype.setMinHeight=function(e){ei(this.el,{minHeight:e+"px"})},e}();function aO(e,t){for(var n=e.depth;n;){var r=e.node(n);if(t(r,n))return{node:r,depth:n,offset:n>0?e.before(n):0}
1;n-=1}return null}function aR(e){return!!aO(e,function(e){var t=e.type;return"listItem"===t.name||"bulletList"===t.name||"orderedList"===t.name})}function aP(e){return!!aO(e,function(e){var t=e.type;return"tableHeadCell"===t.name||"tableBodyCell"===t.name})}function aH(e){return aO(e,function(e){return"listItem"===e.type.name})}function aB(e){return{tag:e,getAttrs:function(e){var t=e.getAttribute("data-raw-html");return X({},t&&{rawHTML:t})}}}function aF(e){return Object.keys(e).reduce(function(t,n){return"rawHTML"!==n&&e[n]&&(t[n="className"===n?"class":n]=e[n]),t},{})}function aq(e){return{tag:e,getAttrs:function(e){return["rawHTML","colspan","rowspan","extended"].reduce(function(t,n){var r=e.getAttribute("rawHTML"===n?"data-raw-html":n);return r&&(t[n]=eL(["rawHTML","extended"],n)?r:Number(r)),t},{})}}}function a_(){return{htmlAttrs:{default:null},classNames:{default:null}}}function aj(e){var t=e.htmlAttrs,n=e.classNames;return X(X({},t),{class:n?n.join(" "):null})}function az(e,t,n,r){var o=t.$from,i=t.$to,a=t.depth,s=t,l=!1;if(a>=2&&o.node(a-1).type.compatibleContent(n)&&0===t.startIndex&&o.index(a-1)){var u=e.doc.resolve(t.start-2);s=new _.u$(u,u,a),t.endIndex<t.parent.childCount&&(t=new _.u$(o,e.doc.resolve(i.end(a)),a)),l=!0}var c=function(e,t,n,r){var o=function(e,t){var n=e.parent,r=e.startIndex,o=e.endIndex,i=n.contentMatchAt(r).findWrapping(t);if(i){var a=i.length?i[0]:t;return n.canReplaceWith(r,o,a)?i:null}return null}(e,n),i=function(e,t){var n=e.parent,r=e.startIndex,o=e.endIndex,i=n.child(r),a=t.contentMatch.findWrapping(i.type);if(a){for(var s=(a.length?a[a.length-1]:t).contentMatch,l=r;s&&l<o;l+=1)s=s.matchType(n.child(l).type);if(s&&s.validEnd)return a}return null}(t,n);if(o&&i){var a=o.map(function(e){return{type:e}}),s=i.map(function(e){return{type:e,attrs:r}});return a.concat({type:n}).concat(s)}return null}(s,t,n,r);return c?function(e,t,n,r,o){for(var i=t.start,a=t.end,s=t.startIndex,l=t.endIndex,u=t.parent,c=_.FK.empty,p=n.length-1;p>=0;p-=1)c=_.FK.from(n[p].type.create(n[p].attrs,c));e.step(new z.Wg(i-2*!!r,a,i,a,new _.Ji(c,0,0),n.length,!0));for(var d=0,p=0;p<n.length;p+=1)if(n[p].type===o){d=p+1;break}for(var f=n.length-d,h=i+n.length-2*!!r,p=s;p<l;p+=1)p!==s&&(0,z.zy)(e.doc,h,f)&&(e.split(h,f),h+=2*f),h+=u.child(p).nodeSize;return e}(e,t,c,l,n):e}function aU(e,t){for(var n=e.resolve(t);"paragraph"!==n.node().type.name;)t-=2,n=e.resolve(t);return aH(n)}function aV(e){return function(t,n){var r=t.selection,o=t.tr,i=r.$from,a=r.$to,s=i.blockRange(a);return!!s&&(n(aR(i)?function(e,t,n){var r=t.$from,o=t.$to,i=aH(r),a=aH(o);if(i&&a)for(;a;){var s=a.offset,l=a.node,u=a.depth;l.attrs.task&&e.setNodeMarkup(s,null,{task:!1,checked:!1});var c=e.doc.resolve(s);if(c.parent.type!==n){var p=c.before(u-1);e.setNodeMarkup(p,n)}if(s===i.offset)break;a=aU(e.doc,s)}return e}(o,s,e):az(o,s,e)),!0)}}function a$(){return function(e,t){var n=e.selection,r=e.tr,o=e.schema,i=n.$from,a=n.$to,s=i.blockRange(a);return!!s&&(t(aR(i)?function(e,t){var n=t.$from,r=t.$to,o=aH(n),i=aH(r);if(o&&i)for(;i;){var a=i.offset,s={task:!i.node.attrs.task,checked:!1};if(e.setNodeMarkup(a,null,s),a===o.offset)break;i=aU(e.doc,a)}return e}(r,s):az(r,s,o.nodes.bulletList,{task:!0})),!0)}}function aW(){return{indent:function(){return function(e,t){var n,r=e.selection,o=e.schema,i=r.$from,a=r.$to;return!!(i.blockRange(a)&&aR(i))&&(n=o.nodes.listItem,function(e,t){var r=e.tr,o=e.selection,i=o.$from,a=o.$to,s=i.blockRange(a,function(e){var t=e.childCount,r=e.firstChild;return!!t&&r.type===n});if(s&&s.startIndex>0){var l=s.parent,u=l.child(s.startIndex-1);if(u.type!==n)return!1;var c=u.lastChild&&u.lastChild.type===l.type,p=c?_.FK.from(n.create()):null,d=new _.Ji(_.FK.from(n.create(null,_.FK.from(l.type.create(null,p)))),c?3:1,0),f=s.start,h=s.end;return r.step(new z.Wg(f-(c?3:1),h,f,h,d,1,!0)),t(r),!0}return!1})(e,t)}},outdent:function(){return function(e,t){var n,r=e.selection,o=e.schema,i=r.$from,a=r.$to;return!!(i.blockRange(a)&&aR(i))&&(n=o.nodes.listItem,function(e,t){var r,o,i,a,s,l,u,c=e.tr,p=e.selection,d=p.$from,f=p.$to,h=d.blockRange(f,function(e){var t=e.childCount,r=e.firstChild;return!!t&&r.type===n});return!!h&&(t(d.node(h.depth-1).type===n?(o=(r=h).$from,i=r.$to,a=r.end,s=r.depth,l=r.parent,a<(u=i.end(s))&&(c.step(new z.Wg(a-1,u,a,u,new _.Ji(_.FK.from(n.create(null,l.copy())),1,0),1,!0)),r=new _.u$(c.doc.resolve(o.pos),c.doc.resolve(u),s)),c.lift(r,(0,z.jP)(r)),c):function(e,t){for(var n=t.parent,r=t.end,o=t.endIndex-1,i=t.startIndex;o>i;o-=1)r-=n.child(o).nodeSize,e.delete(r-1,r+1);var a=e.doc.resolve(t.start),s=a.nodeAfter,l=0===t.startIndex,u=t.endIndex===n.childCount,c=a.node(-1),p=a.index(-1),d=c.canReplace(p+ +!l,p+1,null==s?void 0:s.content.append(u?_.FK.empty:_.FK.from(n)));if(s&&d){var f=a.pos,h=f+s.nodeSize;e.step(new z.Wg(f-!!l,h+ +!!u,f+1,h-1,new _.Ji((l?_.FK.empty:_.FK.from(n.copy(_.FK.empty))).append(u?_.FK.empty:_.FK.from(n.copy(_.FK.empty))),+!l,+!u),+!l))}return e}(c,h)),!0)})(e,t)}}}}var aG=new Map,aK=function(){function e(e,t,n,r){this.table=e,this.tableRows=t,this.tableStartPos=n,this.rowInfo=r}return e.create=function(t){var n=aO(t,function(e){return"table"===e.type.n
1ame});if(n){var r=n.node,o=n.depth,i=n.offset,a=aG.get(r);if((null==a?void 0:a.tableStartPos)===i+1)return a;var s=[],l=t.start(o),u=r.child(0),c=r.child(1),p=aZ(u,l),d=aZ(c,l+u.nodeSize);u.forEach(function(e){return s.push(e)}),c.forEach(function(e){return s.push(e)});var f=new e(r,s,l,p.concat(d));return aG.set(r,f),f}return null},Object.defineProperty(e.prototype,"totalRowCount",{get:function(){return this.rowInfo.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"totalColumnCount",{get:function(){return this.rowInfo[0].length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tableStartOffset",{get:function(){return this.tableStartPos},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tableEndOffset",{get:function(){return this.tableStartPos+this.table.nodeSize-1},enumerable:!1,configurable:!0}),e.prototype.getCellInfo=function(e,t){return this.rowInfo[e][t]},e.prototype.posAt=function(e,t){for(var n=0,r=this.tableStartPos;;n+=1){var o=r+this.tableRows[n].nodeSize;if(n===e){for(var i=t;i<this.totalColumnCount&&this.rowInfo[n][i].offset<r;)i+=1;return i===this.totalColumnCount?o:this.rowInfo[n][i].offset}r=o}},e.prototype.getNodeAndPos=function(e,t){var n=this.rowInfo[e][t];return{node:this.table.nodeAt(n.offset-this.tableStartOffset),pos:n.offset}},e.prototype.extendedRowspan=function(e,t){return!1},e.prototype.extendedColspan=function(e,t){return!1},e.prototype.getRowspanCount=function(e,t){return 0},e.prototype.getColspanCount=function(e,t){return 0},e.prototype.decreaseColspanCount=function(e,t){return 0},e.prototype.decreaseRowspanCount=function(e,t){return 0},e.prototype.getColspanStartInfo=function(e,t){return null},e.prototype.getRowspanStartInfo=function(e,t){return null},e.prototype.getCellStartOffset=function(e,t){var n=this.rowInfo[e][t].offset;return this.extendedRowspan(e,t)?this.posAt(e,t):n},e.prototype.getCellEndOffset=function(e,t){var n=this.rowInfo[e][t],r=n.offset,o=n.nodeSize;return this.extendedRowspan(e,t)?this.posAt(e,t):r+o},e.prototype.getCellIndex=function(e){for(var t=0;t<this.totalRowCount;t+=1)for(var n=this.rowInfo[t],r=0;r<this.totalColumnCount;r+=1)if(n[r].offset+1>e.pos)return[t,r];return[0,0]},e.prototype.getRectOffsets=function(e,t){void 0===t&&(t=e),e.pos>t.pos&&(e=(n=[t,e])[0],t=n[1]);var n,r,o,i=this.getCellIndex(e),a=i[0],s=i[1],l=this.getCellIndex(t),u=l[0],c=l[1];
1return a=(r=ej(a,u))[0],u=r[1],s=(o=ej(s,c))[0],c=o[1],this.getSpannedOffsets({startRowIdx:a,startColIdx:s,endRowIdx:u,endColIdx:c})},e.prototype.getSpannedOffsets=function(e){return e},e}(),aZ=function(e,t){var n=[];return e.forEach(function(e,r){var o={rowspanMap:{},colspanMap:{},length:0};e.forEach(function(e,n){for(var i=e.nodeSize,a=0;o[a];)a+=1;o[a]={offset:t+r+n+2,nodeSize:i},o.length+=1}),n.push(o)}),n};function aX(e,t){return e_(aK.prototype,e),aZ=t,aK}var aQ=function(e){function t(t,n){void 0===n&&(n=t);var r=this,o=t.node(0),i=aK.create(t),a=i.getRectOffsets(t,n),s=function(e,t,n){for(var r=n.startRowIdx,o=n.startColIdx,i=n.endRowIdx,a=n.endColIdx,s=[],l=r;l<=i;l+=1)for(var u=o;u<=a;u+=1){var c=t.getCellInfo(l,u),p=c.offset,d=c.nodeSize;s.push(new U.yn(e.resolve(p+1),e.resolve(p+d-1)))}return s}(o,i,a);return(r=e.call(this,s[0].$from,s[0].$to,s)||this).startCell=t,r.endCell=n,r.offsetMap=i,r.isCellSelection=!0,r.visible=!1,r}return Z(t,e),t.prototype.map=function(e,n){var r=this.startCell.pos,o=this.endCell.pos,i=e.resolve(n.map(r)),a=e.resolve(n.map(o)),s=aK.create(i);if(this.offsetMap.totalColumnCount>s.totalColumnCount||this.offsetMap.totalRowCount>s.totalRowCount){var l={tableBody:1,tableRow:2,tableCell:3,paragraph:4}[a.parent.type.name],u=Math.min(a.end(a.depth-l)-4,a.pos);return U.U3.create(e,u)}return new t(i,a)},t.prototype.eq=function(e){return e instanceof t&&e.startCell.pos===this.startCell.pos&&e.endCell.pos===this.endCell.pos},t.prototype.content=function(){for(var e,t=this.startCell.node(-2),n=this.startCell.start(-2),r=t.child(1).firstChild,o=t.child(0).type.create(),i=t.child(1).type.create(),a=aK.create(this.startCell),s=a.getRectOffsets(this.startCell,this.endCell),l=s.startRowIdx,u=s.startColIdx,c=s.endRowIdx,p=s.endColIdx,d=!1,f=l;f<=c;f+=1){for(var h=[],m=u;m<=p;m+=1){var v=a.getCellInfo(f,m).offset,g=t.nodeAt(v-n);g&&(d="tableHeadCell"===g.type.name,a.extendedRowspan(f,m)||a.extendedColspan(f,m)?h.push(g.type.create({extended:!0})):h.push(g.copy(g.content)))}var y=r.copy(_.FK.from(h)),b=d?o:i;b.content=b.content.append(_.FK.from(y))}return new _.Ji((e=[],o.childCount&&e.push(o),i.childCount&&e.push(i),_.FK.from(e)),1,1)},t.prototype.toJSON=function(){return JSON.stringify(this)},t}(U.LN);function aY(e,t,n,r){for(var o=n.nodes,i=o.tableRow,a=o.tableBodyCell,s=o.paragraph,l=[],u=0;u<e;u+=1){for(var c=[],p=0;p<t;p+=1){var d=r&&r[u*t+p],f=s.create(null,d?n.text(d):[]);c.push(a.create(null,f))}l.push(i.create(null,c))}return l}function aJ(e,t,n,r){void 0===r&&(r=null);for(var o=n.nodes,i=o.tableHeadCell,a=o.tableBodyCell,s=o.paragraph,l=0===t?i:a,u=[],c=0;c<e;c+=1)u.push(l.create(r,s.create()));return u}function a0(e,t){for(;e&&e!==t;){if("TD"===e.nodeName||"TH"===e.nodeName)return e;e=e.parentNode}return null}function a1(e){return aO(e,function(e){var t=e.type;return"tableHeadCell"===t.name||"tableBodyCell"===t.name})}function a2(e){if(e instanceof U.U3){var t=e.$anchor,n=a1(t);if(n){var r=t.node(0).resolve(t.before(n.depth));return{anchor:r,head:r}}}return{anchor:e.startCell,head:e.endCell}}function a3(e){var t;if(e.size){var n=e.content,r=e.openStart,o=e.openEnd;if(1!==n.childCount)return null;for(;1===n.childCount&&(r>0&&o>0||(null==(t=n.firstChild)?void 0:t.type.name)==="table");)r-=1,o-=1,n=n.firstChild.content;if("tableHead"===n.firstChild.type.name||"tableBody"===n.firstChild.type.name)return n}return null}function a5(e){var t=e.startRowIdx,n=e.startColIdx;return{rowCount:e.endRowIdx-t+1,columnCount:e.endColIdx-n+1}}var a4=new U.hs("cellSelection"),a6=function(){function e(e){this.view=e,this.handlers={mousedown:this.handleMousedown.bind(this),mousemove:this.handleMousemove.bind(this),mouseup:this.handleMouseup.bind(this)},this.startCellPos=null,this.init()}return e.prototype.init=function(){this.view.dom.addEventListener("mousedown",this.handlers.mousedown)},e.prototype.handleMousedown=function(e){var t=a0(e.target,this.view.dom);if(2===e.button)return void e.preventDefault();if(t){var n=this.getCellPos(e);n&&(this.startCellPos=n),this.bindEvent()}},e.prototype.handleMousemove=function(e){var t,n=a4.getState(this.view.state),r=this.getCellPos(e),o=this.startCellPos;n?t=this.view.state.doc.resolve(n):o!==r&&(t=o),t&&o&&r&&this.setCellSelection(o,r)},e.prototype.handleMouseup=function(){this.startCellPos=null,this.unbindEvent(),null!==a4.getState(this.view.state)&&this.view.dispatch(this.view.state.tr.setMeta(a4,-1))},e.prototype.bindEvent=function(){var e=this.view.dom;e.addEventListener("mousemove",this.handlers.mousemove),e.addEventListener("mouseup",this.handlers.mouseup)},e.prototype.unbindEvent=function(){var e=this.view.dom;e.removeEventListener("mousemove",this.handlers.mousemove),e.removeEventListener("mouseup",this.handlers.mouseup)},e.prototype.getCellPos=function(e){var t=e.clientX,n=e.clientY,r=this.view.posAtCoords({left:t,top:n});if(r){var o=this.view.state.doc,i=o.resolve(r.pos),a=a1(i);if(a){var s=i.before(a.depth);return o.resolve(s)}}return null},e.prototype.setCellSelection=function(e,t){var n=this.view.state,r=n.selection,o=n.tr,i=null===a4.getState(this.view.state),a=new aQ(e,t);if(i||!r.eq(a)){var s=o.setSelection(a);i&&s.setMeta(a4,t.pos),this.view.dispatch(s)}},e.prototype.destroy=function(){this.view.dom.removeEventListener("mousedown",this.handlers.mousedown)},e}(),a9=tb("cell-selected");function a8(e){var t=e.selection,n=e.doc;if(t instanceof aQ){var r=[];
1return t.ranges.forEach(function(e){var t=e.$from,n=e.$to;r.push(j.NZ.node(t.pos-1,n.pos+1,{class:a9}))}),j.zF.create(n,r)}return null}var a7=function(){function e(){this.keys=[],this.values=[]}return e.prototype.getKeyIndex=function(e){return ea(e,this.keys)},e.prototype.get=function(e){return this.values[this.getKeyIndex(e)]},e.prototype.set=function(e,t){var n=this.getKeyIndex(e);return n>-1?this.values[n]=t:(this.keys.push(e),this.values.push(t)),this},e.prototype.has=function(e){return this.getKeyIndex(e)>-1},e.prototype.delete=function(e){var t=this.getKeyIndex(e);return t>-1&&(this.keys.splice(t,1),this.values.splice(t,1),!0)},e.prototype.forEach=function(e,t){var n=this;void 0===t&&(t=this),this.values.forEach(function(r,o){r&&n.keys[o]&&e.call(t,r,n.keys[o],n)})},e.prototype.clear=function(){this.keys=[],this.values=[]},e}(),se="en-US",st=new(function(){function e(){this.code=se,this.langs=new a7}return e.prototype.setCode=function(e){this.code=e||se},e.prototype.setLanguage=function(e,t){var n=this;(e=[].concat(e)).forEac
1h(function(e){if(n.langs.has(e)){var r=n.langs.get(e);n.langs.set(e,ee(r,t))}else n.langs.set(e,t)})},e.prototype.get=function(e,t){t||(t=this.code);var n=this.langs.get(t);n||(n=this.langs.get(se));var r=n[e];if(!r)throw Error('There is no text key "'+e+'" in '+t);return r},e}()),sn=[[{action:"Add row to up",command:"addRowToUp",disableInThead:!0,className:"add-row-up"},{action:"Add row to down",command:"addRowToDown",disableInThead:!0,className:"add-row-down"},{action:"Remove row",command:"removeRow",disableInThead:!0,className:"remove-row"}],[{action:"Add column to left",command:"addColumnToLeft",className:"add-column-left"},{action:"Add column to right",command:"addColumnToRight",className:"add-column-right"},{action:"Remove column",command:"removeColumn",className:"remove-column"}],[{action:"Align column to left",command:"alignColumn",payload:{align:"left"},className:"align-column-left"},{action:"Align column to center",command:"alignColumn",payload:{align:"center"},className:"align-column-center"},{action:"Align column to right",command:"alignColumn",payload:{align:"right"},className:"align-column-right"}],[{action:"Remove table",command:"removeTable",className:"remove-table"}]],sr=["image","link","customBlock","frontMatter"],so=["strong","strike","emph","code"],si=["bulletList","orderedList","taskList"],sa=function(){function e(e,t,n,r){var o=this;this.openEditor=function(){if(o.innerEditorView)throw Error("The editor is already opened.");o.dom.draggable=!1,o.wrapper.style.display="none",o.innerViewContainer.style.display="block",o.innerEditorView=new j.Lz(o.innerViewContainer,{state:U.$t.create({doc:o.node,plugins:[(0,V.w)({"Mod-z":function(){return(0,G.tN)(o.innerEditorView.state,o.innerEditorView.dispatch)},"Shift-Mod-z":function(){return(0,G.ZS)(o.innerEditorView.state,o.innerEditorView.dispatch)},Tab:function(e,t){return t(e.tr.insertText("	")),!0},Enter:$.pC,Escape:function(){return o.cancelEditing(),!0},"Ctrl-Enter":function(){return o.saveAndFinishEditing(),!0}}),(0,G.b6)()]}),dispatchTransaction:function(e){return o.dispatchInner(e)},handleDOMEvents:{mousedown:function(){return o.editorView.hasFocus()&&o.innerEditorView.focus(),!0},blur:function(){return o.saveAndFinishEditing(),!0}}}),o.innerEditorView.focus()},this.node=e,this.editorView=t,this.getPos=n,this.toDOMAdaptor=r,this.innerEditorView=null,this.canceled=!1,this.dom=document.createElement("div"),this.dom.className=tb("custom-block"),this.wrapper=document.createElement("div"),this.wrapper.className=tb("custom-block-view"),this.createInnerViewContainer(),this.renderCustomBlock(),this.dom.appendChild(this.innerViewContainer),this.dom.appendChild(this.wrapper)}return e.prototype.renderToolArea=function(){var e=this,t=document.createElement("div"),n=document.createElement("span"),r=document.createElement("button");t.className="tool",n.textContent=this.node.attrs.info,n.className="info",r.type="button",r.addEventListener("click",function(){return e.openEditor()}),t.appendChild(n),t.appendChild(r),this.wrapper.appendChild(t)},e.prototype.renderCustomBlock=function(){var e=this.toDOMAdaptor.getToDOMNode(this.node.attrs.info);if(e){for(var t=e(this.node);this.wrapper.hasChildNodes();)this.wrapper.removeChild(this.wrapper.lastChild);t&&this.wrapper.appendChild(t),this.renderToolArea()}},e.prototype.createInnerViewContainer=function(){this.innerViewContainer=document.createElement("div"),this.innerViewContainer.className=tb("custom-block-editor"),this.innerViewContainer.style.display="none"},e.prototype.closeEditor=function(){this.innerEditorView&&(this.innerEditorView.destroy(),this.innerEditorView=null,this.innerViewContainer.style.display="none"),this.wrapper.style.display="block"},e.prototype.saveAndFinishEditing=function(){var e=this.editorView.state.selection.to,t=this.editorView.state;this.editorView.dispatch(t.tr.setSelection(e$(t.tr,e))),this.editorView.focus(),this.renderCustomBlock(),this.closeEditor()},e.prototype.cancelEditing=function(){var e=(0,G.mk)(this.innerEditorView.state);for(this.canceled=!0;e--;)(0,G.tN)(this.innerEditorView.state,this.innerEditorView.dispatch),(0,G.tN)(this.editorView.state,this.editorView.dispatch);this.canceled=!1;var t=this.editorView.state.selection.to,n=this.editorView.state;this.editorView.dispatch(n.tr.setSelection(U.U3.create(n.doc,t))),this.editorView.focus(),this.closeEditor()},e.prototype.dispatchInner=function(e){var t=this.innerEditorView.state.applyTransaction(e),n=t.state,r=t.transactions;if(this.innerEditorView.updateState(n),!this.canceled&&tq(this.getPos)){for(var o=this.editorView.state.tr,i=z.Lm.offset(this.getPos()+1),a=0;a<r.length;a+=1)for(var s=r[a].steps,l=0;l<s.length;l+=1)o.step(s[l].map(i));o.docChanged&&this.editorView.dispatch(o)}},e.prototype.update=function(e){return!!e.sameMarkup(this.node)&&(this.node=e,this.innerEditorView||this.renderCustomBlock(),!0)},e.prototype.stopEvent=function(e){return!!this.innerEditorView&&!!e.target&&this.innerEditorView.dom.contains(e.target)},e.prototype.ignoreMutation=function(){return!0},e.prototype.destroy=function(){this.dom.removeEventListener("dblclick",this.openEditor),this.closeEditor()},e}(),ss="image-link",sl=function(){function e(e,t,n,r){var o,i=this;this.handleMousedown=function(e){e.preventDefault();var t=e.target,n=e.offsetX,r=e.offsetY;if(i.imageLink&&tq(i.getPos)&&ta(t,ss)){var o=getComputedStyle(t,":before");if(e.stopPropagation(),tg(o,n,r)){var a=i.view.state.tr,s=i.getPos();a.setSelection(e$(a,s,s+1)),i.view.dispatch(a),i.eventEmitter.emit("openPopup","link",i.imageLink.attrs)}}},this.node=e,this.view=t,this.getPos=n,this.eventEmitter=r,this.imageLink=null!=(o=e.marks.filter(function(e){return"link"===e.type.n
1ame})[0])?o:null,this.dom=this.createElement(),this.bindEvent()}return e.prototype.createElement=function(){var e=this.createImageElement(this.node);if(this.imageLink){var t=document.createElement("span");return t.className=ss,t.appendChild(e),t}return e},e.prototype.createImageElement=function(e){var t=document.createElement("img"),n=e.attrs,r=n.imageUrl,o=n.altText,i=aj(e.attrs);return t.src=r,o&&(t.alt=o),tN(i,t),t},e.prototype.bindEvent=function(){this.imageLink&&this.dom.addEventListener("mousedown",this.handleMousedown)},e.prototype.stopEvent=function(){return!0},e.prototype.destroy=function(){this.imageLink&&this.dom.removeEventListener("mousedown",this.handleMousedown)},e}(),su=function(){function e(e,t,n,r){var o=this;this.contentDOM=null,this.input=null,this.timer=null,this.handleMousedown=function(e){if("none"!==getComputedStyle(e.target,":after").backgroundImage&&tq(o.getPos)){var t=o.view.coordsAtPos(o.getPos()),n=t.top,r=t.right;o.createLanguageEditor({top:n,right:r})}},this.handleKeydown=function(e){"Enter"===e.key&&o.input&&(e.preventDefault(),o.changeLanguage())},this.node=e,this.view=t,this.getPos=n,this.eventEmitter=r,this.createElement(),this.bindDOMEvent(),this.bindEvent()}return e.prototype.createElement=function(){var e=this.node.attrs.language,t=document.createElement("div");t.setAttribute("data-language",e||"text"),t.className="toastui-editor-ww-code-block";var n=this.createCodeBlockElement(),r=n.firstChild;t.appendChild(n),this.dom=t,this.contentDOM=r},e.prototype.createCodeBlockElement=function(){var e=document.createElement("pre"),t=document.createElement("code"),n=this.node.attrs.language,r=aj(this.node.attrs);return n&&t.setAttribute("data-language",n),tN(r,e),e.appendChild(t),e},e.prototype.createLanguageEditor=function(e){var t=this,n=e.top,r=e.right,o=document.createElement("span");o.className="toastui-editor-ww-code-block-language";var i=document.createElement("input");i.type="text",i.value=this.node.attrs.language,o.appendChild(i),this.view.dom.parentElement.appendChild(o);var a=o.clientWidth;ei(o,{top:n+10+"px",left:r-a-10+"px",width:a+"px"}),this.input=i,this.input.addEventListener("blur",function(){return t.changeLanguage()}),this.input.addEventListener("keydown",this.handleKeydown),this.clearTimer(),this.timer=setTimeout(function(){t.input.focus()})},e.prototype.bindDOMEvent=function(){this.dom&&this.dom.addEventListener("click",this.handleMousedown)},e.prototype.bindEvent=function(){var e=this;this.eventEmitter.listen("scroll",function(){e.input&&e.reset()})},e.prototype.changeLanguage=function(){if(this.input&&tq(this.getPos)){var e=this.input.value;this.reset();var t=this.getPos(),n=this.view.state.tr;n.setNodeMarkup(t,null,{language:e}),this.view.dispatch(n)}},e.prototype.reset=function(){var e;if(null==(e=this.input)?void 0:e.parentElement){var t=this.input.parentElement;this.input=null,tC(t)}},e.prototype.clearTimer=function(){this.timer&&(clearTimeout(this.timer),this.timer=null)},e.prototype.stopEvent=function(){return!0},e.prototype.update=function(e){return!!e.sameMarkup(this.node)&&(this.node=e,!0)},e.prototype.destroy=function(){this.reset(),this.clearTimer(),this.dom&&this.dom.removeEventListener("click",this.handleMousedown)},e}(),sc=/MsoListParagraph/,sp=/style=(.|\n)*mso-/,sd=/mso-list:(.*)/,sf=/O:P/,sh=/^(n|u|l)/,sm="\x3c!--StartFragment--\x3e";function sv(e){var t,n,r,o,i,a,s,l,u,c;return n=(t=e).indexOf(sm),r=t.lastIndexOf("\x3c!--EndFragment--\x3e"),n>-1&&r>-1&&(t=t.slice(n+sm.length,r)),o=e=t.replace(/<br[^>]*>/g,tv),/<\/td>((?!<\/tr>)[\s\S])*$/i.test(o)&&(o="<tr>"+o+"</tr>"),/<\/tr>((?!<\/table>)[\s\S])*$/i.test(o)&&(o="<table>"+o+"</table>"),i=e=o,sp.test(i)&&(a=e,(s=document.createElement("div")).innerHTML=a,l=[],(c=(u=ez(s.querySelectorAll("p.MsoListParagraph"))).length?u:[]).forEac
1h(function(e){var t=function(e){for(;e&&!tk(e);)e=e.nextSibling;return!e||!sc.test(e.className)}(e.nextSibling);if(l.push(e),t){var n,r,o=function e(t){var n=t[0].unordered?"ul":"ol",r=document.createElement(n);return t.forEach(function(t){var n=t.children,o=t.contents,i=document.createElement("li");i.innerHTML=o,r.appendChild(i),n.length&&r.appendChild(e(n))}),r}((n=[],l.forEach(function(e,t){var r,o=n[t-1],i=(r=e.getAttribute("style"))?{id:t,level:parseInt(r.match(sd)[1].trim().split(" ")[1].replace("level",""),10),prev:null,parent:null,children:[],unordered:sh.test(e.textContent||""),contents:function(e){for(var t=[],n=document.createTreeWalker(e,1,null,!1);n.nextNode();){var r=n.currentNode;if(tk(r)){var o=r.outerHTML,i=r.textContent,a=sp.test(o),s=sd.test(o);a&&!s&&i?t.push([r,!0]):(sf.test(r.nodeName)||a&&!i||s)&&t.push([r,!1])}}return t.forEach(function(e){var t=e[0];e[1]?function(e){for(var t=[];e.firstChild;)t.push(e.firstChild),e.parentNode&&e.parentNode.insertBefore(e.firstChild,e);tC(e)}(t):tC(t)}),e.innerHTML.trim()}(e)}:null;i&&(o&&function(e,t){if(t.level<e.level)t.children.push(e),e.parent=t;else{for(;t&&t.level!==e.level;)t=t.parent;t&&(e.prev=t,e.parent=t.parent,e.parent&&e.parent.children.push(e))}}(i,o),n.push(i))}),n).filter(function(e){return!e.parent})),i=e.nextSibling;i?i.parentNode&&i.parentNode.insertBefore(o,i):(r=en(r=o)?ez(r):[r]).forEach(function(e){s.appendChild(e)}),l=[]}tC(e)}),e=(c.length?"<p></p>":"")+s.innerHTML),e}function sg(e,t,n){for(var r=[],o=e.childCount,i=0;i<o;i+=1)if(!e.child(i).attrs.extended){var a=i<o?n.create(e.child(i).attrs,e.child(i).content):n.createAndFill();r.push(a)}return r}function sy(e,t,n){var r=n.nodes,o=r.tableRow,i=sg(e,t,r.tableHeadCell);return o.create(null,i)}function sb(e,t,n){var r=n.nodes,o=r.tableRow,i=sg(e,t,r.tableBodyCell);return o.create(null,i)}function sw(e){var t=[],n=[];return"tableHead"===e.firstChild.type.name&&e.firstChild.forEach(function(e){return t.push(e)}),"tableBody"===e.lastChild.type.name&&e.lastChild.forEach(function(e){return n.push(e)}),Q(Q([],t),n)}function sk(e,t,n){var r=e.map(function(e){return sb(e,t,n)});if(!e.length){var o=function(e,t){for(var n=t.nodes,r=n.tableRow,o=n.tableBodyCell,i=[],a=0;a<e;a+=1){var s=o.createAndFill();i.push(s)}return r.create({dummyRowForPasting:!0},i)}(t,n);r.push(o)}return n.nodes.tableBody.create(null,r)}var sC=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Z(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"doc"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return{content:"block+"}},enumerable:!1,configurable:!0}),t}(tR),sx=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Z(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"paragraph"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return{content:"inline*",group:"block",attrs:X({},a_()),parseDOM:[{tag:"p"}],toDOM:function(e){return["p",aj(e.attrs),0]}}},enumerable:!1,configurable:!0}),t}(tR),sT=/\s{1,4}$/,sE=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Z(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"text"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return{group:"inline"}},enumerable:!1,configurable:!0}),t.prototype.addSpaces=function(){return function(e,t){var n=e.selection,r=e.tr,o=n.$from,i=n.$to;return!(!o.blockRange(i)||aR(o)||aP(o))&&(t(r.insertText("    ",o.pos,i.pos)),!0)}},t.prototype.removeSpaces=function(){return function(e,t){var n=e.selection,r=e.tr,o=n.$from,i=n.$to,a=n.from;if(o.blockRange(i)&&!aR(o)&&!aP(o)){var s=o.nodeBefore;if(s&&s.isText){var l=s.text,u=l.replace(sT,""),c=l.length-u.length;return t(r.delete(a-c,a)),!0}}return!1}},t.prototype.keymaps=function(){return{Tab:this.addSpaces(),"Shift-Tab":this.removeSpaces()}},t}(tR),sM=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Z(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"heading"}
1,enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"levels",{get:function(){return[1,2,3,4,5,6]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){var e=this.levels.map(function(e){return{tag:"h"+e,getAttrs:function(t){var n=t.getAttribute("data-raw-html");return X({level:e},n&&{rawHTML:n})}}});return{attrs:X({level:{default:1},headingType:{default:"atx"},rawHTML:{default:null}},a_()),content:"inline*",group:"block",defining:!0,parseDOM:e,toDOM:function(e){var t=e.attrs;return["h"+t.level,aj(t),0]}}},enumerable:!1,configurable:!0}),t.prototype.commands=function(){return function(e){return function(t,n){var r=t.schema.nodes[e.level?"heading":"paragraph"];return(0,$.y_)(r,e)(t,n)}}},t}(tR),sL=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Z(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"codeBlock"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return{content:"text*",group:"block",attrs:X({language:{default:null},rawHTML:{default:null}},a_()),code:!0,defining:!0,marks:"",parseDOM:[{tag:"pre",preserveWhitespace:"full",getAttrs:function(e){var t=e.getAttribute("data-raw-html"),n=e.firstElementChild;return X({language:(null==n?void 0:n.getAttribute("data-language"))||null},t&&{rawHTML:t})}}],toDOM:function(e){var t=e.attrs;return[t.rawHTML||"pre",["code",X({"data-language":t.language},aj(t)),0]]}}},enumerable:!1,configurable:!0}),t.prototype.commands=function(){return function(){return function(e,t){return(0,$.y_)(e.schema.nodes.codeBlock)(e,t)}}},t.prototype.moveCursor=function(e){var t=this;return function(n,r){var o=n.tr,i=n.doc,a=n.schema,s=n.selection.$from;if(t.context.view.endOfTextblock(e)&&"codeBlock"===s.node().type.name){var l,u,c,p=s.parent.textContent.split("\n"),d="up"===e?s.start():s.end(),f="up"===e?[d,p[0].length+d]:[d-eP(p).length,d],h=i.resolve("up"===e?s.before():s.after()),m="up"===e?h.nodeBefore:h.nodeAfter;if(l=s.pos,u=f[0],c=f[1],l>=u&&l<=c&&!m){var v=eW(o,h,a);if(v)return r(v),!0}}return!1}},t.prototype.keymaps=function(){var e=this.commands()();return{"Shift-Mod-p":e,"Shift-Mod-P":e,ArrowUp:this.moveCursor("up"),ArrowDown:this.moveCursor("down")}},t}(tR),sN=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Z(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"bulletList"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return{content:"listItem+",group:"block",attrs:X({rawHTML:{default:null}},a_()),parseDOM:[aB("ul")],toDOM:function(e){return["ul",aj(e.attrs),0]}}},enumerable:!1,configurable:!0}),t.prototype.changeList=function(){return function(e,t){return aV(e.schema.nodes.bulletList)(e,t)}},t.prototype.commands=function(){return{bulletList:this.changeList,taskList:a$}},t.prototype.keymaps=function(){var e=this.changeList(),t=aW(),n=t.indent,r=t.outdent;return{"Mod-u":e,"Mod-U":e,Tab:n(),"Shift-Tab":r()}},t}(tR),sS=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Z(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"orderedList"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return{content:"listItem+",group:"block",attrs:X({order:{default:1},rawHTML:{default:null}},a_()),parseDOM:[{tag:"ol",getAttrs:function(e){var t=e.getAttribute("start"),n=e.getAttribute("data-raw-html");return X({order:e.hasAttribute("start")?Number(t):1},n&&{rawHTML:n})}}],toDOM:function(e){var t=e.attrs;return[t.rawHTML||"ol",X({start:1===t.order?null:t.order},aj(t)),0]}}},enumerable:!1,configurable:!0}),t.prototype.commands=function(){return function(){return function(e,t){return aV(e.schema.nodes.orderedList)(e,t)}}},t.prototype.keymaps=function(){var e=this.commands()(),t=aW(),n=t.indent,r=t.outdent;return{"Mod-o":e,"Mod-O":e,Tab:n(),"Shift-Tab":r()}},t}(tR),sA=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Z(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"listItem"}
1,enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return{content:"paragraph block*",selectable:!1,attrs:{task:{default:!1},checked:{default:!1},rawHTML:{default:null}},defining:!0,parseDOM:[{tag:"li",getAttrs:function(e){var t=e.getAttribute("data-raw-html");return X({task:e.hasAttribute("data-task"),checked:e.hasAttribute("data-task-checked")},t&&{rawHTML:t})}}],toDOM:function(e){var t=e.attrs,n=t.task,r=t.checked;if(!n)return[t.rawHTML||"li",0];var o=["task-list-item"];return r&&o.push("checked"),[t.rawHTML||"li",X({class:o.join(" "),"data-task":n},r&&{"data-task-checked":r}),0]}}},enumerable:!1,configurable:!0}),t.prototype.liftToPrevListItem=function(){return function(e,t){var n=e.selection,r=e.tr,o=e.schema,i=n.$from,a=n.empty,s=o.nodes.listItem,l=i.parent,u=i.node(-1);if(a&&!l.childCount&&u.type===s){if(i.index(-2)>=1)return r.delete(i.start(-1)-1,i.end(-1)),t(r),!0;if(i.node(-3).type===s)return r.delete(i.start(-2)-1,i.end(-1)),t(r),!0}return!1}},t.prototype.keymaps=function(){return{Backspace:this.liftToPrevListItem(),Enter:function(e,t){var n;return(n=e.schema.nodes.listItem,function(e,t){var r=e.tr,o=e.selection,i=o.$from,a=o.$to;if(i.depth<2||!i.sameParent(a))return!1;var s=i.node(-1);if(s.type!==n)return!1;if(0===i.parent.content.size&&i.node(-1).childCount===i.indexAfter(-1)){if(2===i.depth||i.node(-3).type!==n||i.index(-2)!==i.node(-2).childCount-1)return!1;for(var l=i.index(-1)>0,u=_.FK.empty,c=i.depth-(l?1:2);c>=i.depth-3;c-=1)u=_.FK.from(i.node(c).copy(u));return u=u.append(_.FK.from(n.createAndFill())),r.replace(l?i.before():i.before(-1),i.after(-3),new _.Ji(u,l?3:2,2)),r.setSelection(U.LN.near(r.doc.resolve(i.pos+(l?3:2)))),t(r),!0}var p=a.pos===i.end()?s.contentMatchAt(0).defaultType:null,d=p&&[null,{type:p}];return r.delete(i.pos,a.pos),!!(0,z.zy)(r.doc,i.pos,2,d)&&(r.split(i.pos,2,d),t(r),!0)})(e,t)}}},t}(tR),sD=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Z(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"blockQuote"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return{attrs:X({rawHTML:{default:null}},a_()),content:"block+",group:"block",parseDOM:[aB("blockquote")],toDOM:function(e){return["blockquote",aj(e.attrs),0]}}},enumerable:!1,configurable:!0}),t.prototype.commands=function(){return function(){return function(e,t){return(0,$.Im)(e.schema.nodes.blockQuote)(e,t)}}},t.prototype.keymaps=function(){var e=this.commands()();return{"Alt-q":e,"Alt-Q":e}},t}(tR),sI={left:function(e,t){var n=e[0],r=e[1],o=t.totalColumnCount,i=0===r;if(!(0===n&&i)){r-=1,i&&(n-=1,r=o-1);var a=t.getCellInfo(n,r);return a.offset+a.nodeSize-2}return null},right:function(e,t){var n=e[0],r=e[1],o=t.totalRowCount,i=t.totalColumnCount,a=r===i-1;if(!(n===o-1&&a)){var s=r+1,l=t.getColspanStartInfo(n,r);return(null==l?void 0:l.count)>1&&(s+=l.count-1),(a||s===i)&&(n+=1,s=0),t.getCellInfo(n,s).offset+2}return null},up:function(e,t){var n=e[0],r=e[1];if(n>0){var o=t.getCellInfo(n-1,r);return o.offset+o.nodeSize-2}return null},down:function(e,t){var n=e[0],r=e[1];if(n<t.totalRowCount-1){var o=n+1,i=t.getRowspanStartInfo(n,r);return(null==i?void 0:i.count)>1&&(o+=i.count-1),t.getCellInfo(o,r).offset+2}return null}};function sO(e,t,n){var r=n[0],o=n[1],i=t.getRowspanStartInfo(r,o),a="up"===e&&0===r,s="down"===e&&((null==i?void 0:i.count)>1?r+i.count-1:r)===t.totalRowCount-1;return a||s}function sR(e,t,n,r){void 0===r&&(r=!1);var o=e.doc.resolve(t.tableEndOffset);return r||!o.nodeAfter?eW(e,o,n):e.setSelection(U.LN.near(o,1))}function sP(e,t,n,r){var o=(0,sI[e])(n,r);return o?t.setSelection(U.LN.near(t.doc.resolve(o),"right"===e||"down"===e?1:-1)):null}var sH=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Z(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"table"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return{content:"tableHead{1} tableBody{1}",group:"block",attrs:X({rawHTML:{default:null}},a_()),parseDOM:[aB("table")],toDOM:function(e){return["table",aj(e.attrs),0]}}}
1,enumerable:!1,configurable:!0}),t.prototype.addTable=function(){return function(e){return void 0===e&&(e={rowCount:2,columnCount:1,data:[]}),function(t,n){var r=e.rowCount,o=e.columnCount,i=e.data,a=t.schema,s=t.selection,l=t.tr,u=s.from,c=s.to,p=s.$from;if(u===c&&!aP(p)){var d=a.nodes,f=d.tableHead,h=d.tableBody,m=null==i?void 0:i.slice(0,o),v=null==i?void 0:i.slice(o,i.length),g=function(e,t,n){for(var r=t.nodes,o=r.tableRow,i=r.tableHeadCell,a=r.paragraph,s=[],l=0;l<e;l+=1){var u=n&&n[l],c=a.create(null,u?t.text(u):[]);s.push(i.create(null,c))}return[o.create(null,s)]}(o,a,m),y=aY(r-1,o,a,v),b=a.nodes.table.create(null,[f.create(null,g),h.create(null,y)]);return n(l.replaceSelectionWith(b)),!0}return!1}}},t.prototype.removeTable=function(){return function(){return function(e,t){var n=e.selection,r=e.tr,o=aK.create(n.$anchor);if(o){var i=o.tableStartOffset,a=o.tableEndOffset,s=i-1,l=e$(r.delete(s,a),s);return t(r.setSelection(l)),!0}return!1}}},t.prototype.addColumn=function(e){return function(){return function(t,n){var r=t.selection,o=t.tr,i=t.schema,a=a2(r),s=a.anchor,l=a.head;if(s&&l){for(var u=aK.create(s),c=u.getRectOffsets(s,l),p="left"===e?c.startColIdx:c.endColIdx+1,d=a5(c).columnCount,f=u.totalRowCount,h=0;h<f;h+=1){var m=aJ(d,h,i);o.insert(o.mapping.map(u.posAt(h,p)),m)}return n(o),!0}return!1}}},t.prototype.removeColumn=function(){return function(){return function(e,t){var n=e.selection,r=e.tr,o=a2(n),i=o.anchor,a=o.head;if(i&&a){var s=aK.create(i),l=s.getRectOffsets(i,a),u=s.totalColumnCount,c=s.totalRowCount;if(a5(l).columnCount===u)return!1;for(var p=l.startColIdx,d=l.endColIdx,f=r.mapping.maps.length,h=0;h<c;h+=1)for(var m=d;m>=p;m-=1){var v=s.getCellInfo(h,m),g=v.offset,y=v.nodeSize,b=r.mapping.slice(f).map(g),w=b+y;r.delete(b,w)}return t(r),!0}return!1}}},t.prototype.addRow=function(e){return function(){return function(t,n){var r=t.selection,o=t.schema,i=t.tr,a=a2(r),s=a.anchor,l=a.head;if(s&&l){var u,c,p,d=aK.create(s),f=d.totalColumnCount,h=d.getRectOffsets(s,l),m=a5(h).rowCount,v=("up"===e?(u=h.startRowIdx,c=0,p=-1):(u=h.endRowIdx,c=d.totalColumnCount-1,p=d.getCellInfo(u,c).nodeSize+1),{targetRowIdx:u,insertColIdx:c,nodeSize:p}),g=v.targetRowIdx,y=v.insertColIdx,b=v.nodeSize;if(0!==g){for(var w=[],k=i.mapping.map(d.posAt(g,y))+b,C=[],x=0;x<f;x+=1)C=C.concat(aJ(1,g,o));for(var T=0;T<m;T+=1)w.push(o.nodes.tableRow.create(null,C));return n(i.insert(k,w)),!0}}return!1}}},t.prototype.removeRow=function(){return function(){return function(e,t){var n=e.selection,r=e.tr,o=a2(n),i=o.anchor,a=o.head;if(i&&a){var s=aK.create(i),l=s.totalRowCount,u=s.totalColumnCount,c=s.getRectOffsets(i,a),p=a5(c).rowCount,d=c.startRowIdx,f=c.endRowIdx;if(p===l-1||0===d)return!1;for(var h=f;h>=d;h-=1){var m=function(e,t,n){var r=e.getCellInfo(t,0).offset,o=e.getCellInfo(t,n-1);return{from:r,to:o.offset+o.nodeSize}}(s,h,u),v=m.from,g=m.to;r.delete(v-1,g+1)}return t(r),!0}return!1}}},t.prototype.alignColumn=function(){return function(e){return void 0===e&&(e={align:"center"}),function(t,n){var r=e.align,o=t.selection,i=t.tr,a=a2(o),s=a.anchor,l=a.head;if(s&&l){for(var u=aK.create(s),c=u.totalRowCount,p=u.getRectOffsets(s,l),d=p.startColIdx,f=p.endColIdx,h=0;h<c;h+=1)for(var m=d;m<=f;m+=1)if(!u.extendedRowspan(h,m)&&!u.extendedColspan(h,m)){var v,g=u.getNodeAndPos(h,m),y=g.node,b=g.pos,w=(v={align:r},X(X({},y.attrs),v));i.setNodeMarkup(b,null,w)}return n(i),!0}return!1}}},t.prototype.moveToCell=function(e){return function(t,n){var r=t.selection,o=t.tr,i=t.schema,a=a2(r),s=a.anchor,l=a.head;if(s&&l){var u=aK.create(s),c=u.getCellIndex(s),p=void 0;if(p=sO(e,u,c)?sR(o,u,i):sP(e,o,c,u))return n(p),!0}return!1}},t.prototype.moveInCell=function(e){var t=this;return function(n,r){var o=n.selection,i=n.tr,a=n.doc,s=n.schema,l=o.$from;if(!t.context.view.endOfTextblock(e))return!1;var u=aO(l,function(e){var t=e.type;return"tableHeadCell"===t.name||"tableBodyCell"===t.name});if(u){var c=aO(l,function(e){return"paragraph"===e.type.name}),p=u.depth;
1if(c&&(d=[p,c.depth],f=d[0],g=(v=(h=d[1])>=(m=f+3))?f+1:h,y=function(e,t,n,r,o){var i=t[0],a=t[1],s=t[2];if("left"===e||"up"===e){if(o&&(u=(l=[i,a])[0],c=l[1],p=r.resolve(n.before(u-1)),c!==u||p.nodeBefore))return!1;var l,u,c,p,d=n.before(s);if(r.resolve(d).nodeBefore)return!1}return!0}(e,[h,m,g],l,a,v),b=function(e,t,n,r,o){if("right"===e||"down"===e){if(o&&!function(e){for(var t,n,r=e.depth;r&&"tableBodyCell"!==(n=e.node(r)).type.name;){if("listItem"===n.type.name){var o=e.node(r-1).lastChild===n,i=(null==(t=n.lastChild)?void 0:t.type.name)!=="paragraph";if(!o)return!1;return!i}r-=1}return!1}(n))return!1;var i=n.after(t);if(r.resolve(i).nodeAfter)return!1}return!0}(e,g,l,a,v),y&&b)){var d,f,h,m,v,g,y,b,w,k,C=a2(o).anchor,x=aK.create(C),T=x.getCellIndex(C),E=void 0;if(function(e,t,n){var r=n[0],o=n[1];if("up"===e||"down"===e)return!1;var i=t.tableStartOffset,a=t.tableEndOffset,s=t.getCellInfo(r,o),l=s.offset,u=s.nodeSize;return("left"===e?i:a)===("left"===e?l-2:l+u+3)}(e,x,T)?(w=i.doc.resolve(l.before(p-3)),E=i.setSelection(new U.nh(w))):sO(e,x,T)?"up"===e?E=(k=i.doc.resolve(x.tableStartOffset-1)).nodeBefore?i.setSelection(U.LN.near(k,-1)):eW(i,k,s):"down"===e&&(E=sR(i,x,s)):E=sP(e,i,T,x),E)return r(E),!0}}return!1}},t.prototype.deleteCells=function(){return function(e,t){var n=e.schema,r=e.selection,o=e.tr,i=a2(r),a=i.anchor,s=i.head,l=r instanceof U.U3;if(a&&s&&!l){for(var u=aK.create(a),c=u.getRectOffsets(a,s),p=c.startRowIdx,d=c.startColIdx,f=c.endRowIdx,h=c.endColIdx,m=p;m<=f;m+=1)for(var v=d;v<=h;v+=1)if(!u.extendedRowspan(m,v)&&!u.extendedColspan(m,v)){var g=u.getNodeAndPos(m,v),y=g.node,b=g.pos,w=aJ(1,m,n,y.attrs);o.replaceWith(o.mapping.map(b),o.mapping.map(b+y.nodeSize),w)}return t(o),!0}return!1}},t.prototype.exitTable=function(){return function(e,t){var n=e.selection,r=e.tr,o=e.schema,i=n.$from;if(aO(i,function(e){var t=e.type;return"tableHeadCell"===t.name||"tableBodyCell"===t.name})&&aO(i,function(e){return"paragraph"===e.type.name})){var a=a2(n).anchor;return t(sR(r,aK.create(a),o,!0)),!0}return!1}},t.prototype.commands=function(){return{addTable:this.addTable(),removeTable:this.removeTable(),addColumnToLeft:this.addColumn("left"),addColumnToRight:this.addColumn("right"),removeColumn:this.removeColumn(),addRowToUp:this.addRow("up"),addRowToDown:this.addRow("down"),removeRow:this.removeRow(),alignColumn:this.alignColumn()}},t.prototype.keymaps=function(){var e=this.deleteCells();return{Tab:this.moveToCell("right"),"Shift-Tab":this.moveToCell("left"),ArrowUp:this.moveInCell("up"),ArrowDown:this.moveInCell("down"),ArrowLeft:this.moveInCell("left"),ArrowRight:this.moveInCell("right"),Backspace:e,"Mod-Backspace":e,Delete:e,"Mod-Delete":e,"Mod-Enter":this.exitTable()}},t}(tR),sB=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Z(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"tableHead"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return{content:"tableRow{1}",attrs:X({rawHTML:{default:null}},a_()),parseDOM:[aB("thead")],toDOM:function(e){return["thead",aj(e.attrs),0]}}},enumerable:!1,configurable:!0}),t}(tR),sF=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Z(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"tableBody"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return{content:"tableRow+",attrs:X({rawHTML:{default:null}},a_()),parseDOM:[{tag:"tbody",getAttrs:function(e){var t=e.querySelectorAll("tr")[0].children.length,n=e.getAttribute("data-raw-html");return!!t&&X({},n&&{rawHTML:n})}}],toDOM:function(e){return["tbody",aj(e.attrs),0]}}},enumerable:!1,configurable:!0}),t}(tR),sq=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Z(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"tableRow"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return{content:"(tableHeadCell | tableBodyCell)*",attrs:X({rawHTML:{default:null}},a_()),parseDOM:[{tag:"tr",getAttrs:function(e){var t=e.children.length,n=e.getAttribute("data-raw-html");return!!t&&X({},n&&{rawHTML:n})}}],toDOM:function(e){return["tr",aj(e.attrs),0]}}}
1,enumerable:!1,configurable:!0}),t}(tR),s_=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Z(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"tableHeadCell"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return{content:"paragraph+",attrs:X({align:{default:null},className:{default:null},rawHTML:{default:null},colspan:{default:null},extended:{default:null}},a_()),isolating:!0,parseDOM:[aq("th")],toDOM:function(e){var t=e.attrs,n=aF(t);return["th",X(X({},n),aj(t)),0]}}},enumerable:!1,configurable:!0}),t}(tR),sj=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Z(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"tableBodyCell"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return{content:"(paragraph | bulletList | orderedList)+",attrs:{align:{default:null},className:{default:null},rawHTML:{default:null},colspan:{default:null},rowspan:{default:null},extended:{default:null}},isolating:!0,parseDOM:[aq("td")],toDOM:function(e){return["td",aF(e.attrs),0]}}},enumerable:!1,configurable:!0}),t}(tR),sz=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Z(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"image"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return{inline:!0,attrs:X({imageUrl:{default:""},altText:{default:null},rawHTML:{default:null}},a_()),group:"inline",selectable:!1,parseDOM:[{tag:"img[src]",getAttrs:function(e){var t=am(e,{RETURN_DOM_FRAGMENT:!0}).firstChild,n=t.getAttribute("src")||"",r=t.getAttribute("data-raw-html"),o=t.getAttribute("alt");return X({imageUrl:n,altText:o},r&&{rawHTML:r})}}],toDOM:function(e){var t=e.attrs;return[t.rawHTML||"img",X(X({src:eM(t.imageUrl)},t.altText&&{alt:t.altText}),aj(t))]}}},enumerable:!1,configurable:!0}),t.prototype.addImage=function(){return function(e){return function(t,n){var r=t.schema,o=t.tr,i=e.imageUrl,a=e.altText;if(!i)return!1;var s=r.nodes.image.createAndFill(X({imageUrl:i},a&&{altText:a}));return n(o.replaceSelectionWith(s).scrollIntoView()),!0}}},t.prototype.commands=function(){return{addImage:this.addImage()}},t}(tR),sU=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Z(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"thematicBreak"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return{attrs:X({rawHTML:{default:null}},a_()),group:"block",parseDOM:[{tag:"hr"}],selectable:!1,toDOM:function(e){var t=e.attrs;return["div",aj(t),[t.rawHTML||"hr"]]}}},enumerable:!1,configurable:!0}),t.prototype.hr=function(){var e=this;return function(){return function(t,n){var r,o=t.selection,i=o.$from;if(i===o.$to){var a=t.doc,s=t.schema.nodes,l=s.thematicBreak,u=s.paragraph,c=[l.create()],p=i.node(1),d=a.child(a.childCount-1)===p,f=a.resolve(i.after(1)),h=(null==(r=i.nodeAfter)?void 0:r.type.name)===e.name;return(d||h)&&c.push(u.create()),n(t.tr.insert(f.pos,c).scrollIntoView()),!0}return!1}}},t.prototype.commands=function(){return{hr:this.hr()}},t.prototype.keymaps=function(){var e=this.hr()();return{"Mod-l":e,"Mod-L":e}},t}(tR),sV=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Z(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"strong"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){var e=["b","strong"].map(function(e){return{tag:e,getAttrs:function(e){var t=e.getAttribute("data-raw-html");return X({},t&&{rawHTML:t})}}});return{attrs:X({rawHTML:{default:null}},a_()),parseDOM:e,toDOM:function(e){var t=e.attrs;return[t.rawHTML||"strong",aj(t)]}}},enumerable:!1,configurable:!0}),t.prototype.bold=function(){return function(){return function(e,t){return(0,$.wh)(e.schema.marks.strong)(e,t)}}},t.prototype.commands=function(){return{bold:this.bold()}},t.prototype.keymaps=function(){var e=this.bold()();return{"Mod-b":e,"Mod-B":e}},t}(no),s$=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Z(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"emph"}
1,enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){var e=["i","em"].map(function(e){return{tag:e,getAttrs:function(e){var t=e.getAttribute("data-raw-html");return X({},t&&{rawHTML:t})}}});return{attrs:X({rawHTML:{default:null}},a_()),parseDOM:e,toDOM:function(e){var t=e.attrs;return[t.rawHTML||"em",aj(t)]}}},enumerable:!1,configurable:!0}),t.prototype.italic=function(){return function(){return function(e,t){return(0,$.wh)(e.schema.marks.emph)(e,t)}}},t.prototype.commands=function(){return{italic:this.italic()}},t.prototype.keymaps=function(){var e=this.italic()();return{"Mod-i":e,"Mod-I":e}},t}(no),sW=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Z(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"strike"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){var e=["s","del"].map(function(e){return{tag:e,getAttrs:function(e){var t=e.getAttribute("data-raw-html");return X({},t&&{rawHTML:t})}}});return{attrs:X({rawHTML:{default:null}},a_()),parseDOM:e,toDOM:function(e){var t=e.attrs;return[t.rawHTML||"del",aj(t)]}}},enumerable:!1,configurable:!0}),t.prototype.commands=function(){return function(){return function(e,t){return(0,$.wh)(e.schema.marks.strike)(e,t)}}},t.prototype.keymaps=function(){var e=this.commands()();return{"Mod-s":e,"Mod-S":e}},t}(no),sG=function(e){function t(t){var n=e.call(this)||this;return n.linkAttributes=t,n}return Z(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"link"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){var e=this;return{attrs:X({linkUrl:{default:""},title:{default:null},rawHTML:{default:null}},a_()),inclusive:!1,parseDOM:[{tag:"a[href]",getAttrs:function(e){var t=am(e,{RETURN_DOM_FRAGMENT:!0}).firstChild,n=t.getAttribute("href")||"",r=t.getAttribute("title")||"",o=t.getAttribute("data-raw-html");return X({linkUrl:n,title:r},o&&{rawHTML:o})}}],toDOM:function(t){var n=t.attrs;return[n.rawHTML||"a",X(X({href:eM(n.linkUrl)},e.linkAttributes),aj(n))]}}},enumerable:!1,configurable:!0}),t.prototype.addLink=function(){return function(e){return function(t,n){var r=e.linkUrl,o=e.linkText,i=void 0===o?"":o,a=t.schema,s=t.tr,l=t.selection,u=l.empty,c=l.from,p=l.to;if(c&&p&&r){var d=a.mark("link",{linkUrl:r});if(u&&i){var f=eV(a,i,d);s.replaceRangeWith(c,p,f)}else s.addMark(c,p,d);return n(s.scrollIntoView()),!0}return!1}}},t.prototype.toggleLink=function(){return function(e){return function(t,n){return(0,$.wh)(t.schema.marks.link,e)(t,n)}}},t.prototype.commands=function(){return{addLink:this.addLink(),toggleLink:this.toggleLink()}},t}(no),sK=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Z(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"code"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return{attrs:X({rawHTML:{default:null}},a_()),parseDOM:[{tag:"code",getAttrs:function(e){var t=e.getAttribute("data-raw-html");return X({},t&&{rawHTML:t})}}],toDOM:function(e){var t=e.attrs;return[t.rawHTML||"code",aj(t)]}}},enumerable:!1,configurable:!0}),t.prototype.commands=function(){return function(){return function(e,t){return(0,$.wh)(e.schema.marks.code)(e,t)}}},t.prototype.keymaps=function(){var e=this.commands()();return{"Shift-Mod-c":e,"Shift-Mod-C":e}},t}(no),sZ=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Z(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"customBlock"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return{content:"text*",group:"block",attrs:{info:{default:null}},atom:!0,code:!0,defining:!0,parseDOM:[{tag:"div[data-custom-info]",getAttrs:function(e){return{info:e.getAttribute("data-custom-info")}}}],toDOM:function(e){return["div",{"data-custom-info":e.attrs.info||null},0]}}},enumerable:!1,configurable:!0}),t.prototype.commands=function(){return function(e){return function(t,n){return null!=e&&!!e.info&&(0,$.y_)(t.schema.nodes.customBlock,e)(t,n)}}},t}(tR),sX=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Z(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"frontMatter"}
1,enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return{content:"text*",group:"block",code:!0,defining:!0,parseDOM:[{preserveWhitespace:"full",tag:"div[data-front-matter]"}],toDOM:function(){return["div",{"data-front-matter":"true"},0]}}},enumerable:!1,configurable:!0}),t.prototype.commands=function(){return function(){return function(e,t,n){var r=e.selection.$from;return!!n.endOfTextblock("down")&&"frontMatter"===r.node().type.name&&(0,$.I$)(e,t)}}},t.prototype.keymaps=function(){return{Enter:this.commands()()}},t}(tR),sQ=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Z(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"htmlComment"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return{content:"text*",group:"block",code:!0,defining:!0,parseDOM:[{preserveWhitespace:"full",tag:"div[data-html-comment]"}],toDOM:function(){return["div",{"data-html-comment":"true"},0]}}},enumerable:!1,configurable:!0}),t.prototype.commands=function(){return function(){return function(e,t,n){var r=e.selection.$from;return!!n.endOfTextblock("down")&&"htmlComment"===r.node().type.name&&(0,$.I$)(e,t)}}},t.prototype.keymaps=function(){return{Enter:this.commands()()}},t}(tR),sY=tb("contents"),sJ=function(e){function t(t,n){var r=e.call(this,t)||this,o=n.toDOMAdaptor,i=n.htmlSchemaMap,a=n.linkAttributes,s=n.useCommandShortcut,l=n.wwPlugins,u=n.wwNodeViews;return r.editorType="wysiwyg",r.el.classList.add("ww-mode"),r.toDOMAdaptor=o,r.linkAttributes=void 0===a?{}:a,r.extraPlugins=void 0===l?[]:l,r.pluginNodeViews=void 0===u?{}:u,r.specs=r.createSpecs(),r.schema=r.createSchema(void 0===i?{}:i),r.context=r.createContext(),r.keymaps=r.createKeymaps(void 0===s||s),r.view=r.createView(),r.commands=r.createCommands(),r.specs.setContext(X(X({},r.context),{view:r.view})),r.initEvent(),r}return Z(t,e),t.prototype.createSpecs=function(){var e;return e=this.linkAttributes,new tz([new sC,new sx,new sE,new sM,new sL,new sN,new sS,new sA,new sD,new sH,new sB,new sF,new sq,new s_,new sj,new sz,new sU,new sV,new s$,new sW,new sG(e),new sK,new sZ,new sX,new tB,new sQ])},t.prototype.createContext=function(){return{schema:this.schema,eventEmitter:this.eventEmitter}},t.prototype.createSchema=function(e){return new _.Sj({nodes:X(X({},this.specs.nodes),e.nodes),marks:X(X({},this.specs.marks),e.marks)})},t.prototype.createPlugins=function(){var e,t;return Q([new U.k_({key:a4,state:{init:function(){return null},apply:function(e,t){var n=e.getMeta(a4);if(n)return -1===n?null:n;if(ef(t)||!e.docChanged)return t;var r=e.mapping.mapResult(t),o=r.deleted,i=r.pos;return o?null:i}},props:{decorations:a8,createSelectionBetween:function(e){var t=e.state;return ef(a4.getState(t))?null:t.selection}},view:function(e){return new a6(e)}}),(e=this.eventEmitter,new U.k_({props:{handleDOMEvents:{contextmenu:function(t,n){var r=a0(n.target,t.dom);if(r){n.preventDefault();var o=n.clientX,i=n.clientY,a=t.dom.parentNode.getBoundingClientRect(),s=a.left,l=a.top,u="TH"===r.nodeName;return e.emit("contextmenu",{pos:{left:o-s+10+"px",top:i-l+30+"px"},menuGroups:sn.map(function(t){return t.map(function(t){var n=t.action,r=t.command,o=t.payload,i=t.disableInThead,a=t.className;return{label:st.get(n),onClick:function(){e.emit("command",r,o)},disabled:u&&!!i,className:a}})}).concat(),tableCell:r}),!0}return!1}}}})),new U.k_({props:{handleDOMEvents:{mousedown:function(e,t){var n=t.clientX,r=t.clientY,o=e.posAtCoords({left:n,top:r});if(o){var i=e.state,a=i.doc,s=i.tr,l=a.resolve(o.pos),u=aH(l),c=getComputedStyle(t.target,":before"),p=t.offsetX,d=t.offsetY;if(!u||!tg(c,p,d))return!1;t.preventDefault();var f=l.before(u.depth),h=u.node.attrs;return s.setNodeMarkup(f,null,X(X({},h),{checked:!h.checked})),e.dispatch(s),!0}return!1}}}}),(t=this.eventEmitter,new U.k_({view:function(){return{update:function(e){var n,r,o,i,a,s=e.state,l=s.selection,u=s.doc,c=s.schema;t.emit("changeToolbarState",{toolbarState:(n=l.$from,r=l.$to,o=l.from,i=l.to,a={indent:{active:!1,disabled:!0},outdent:{active:!1,disabled:!0}},u.nodesBetween(o,i,function(e,t,o){var i,s="listItem"===(i=e.type.n
1ame)?e.attrs.task?"taskList":o.type.name:-1!==i.indexOf("table")?"table":i;eL(sr,s)||(eL(si,s)?(a[s]={active:!0},si.filter(function(e){return e!==s}).forEach(function(e){a[e]&&delete a[e]}),a.indent.disabled=!1,a.outdent.disabled=!1):"paragraph"===s||"text"===s?so.forEach(function(e){var t=c.marks[e],o=n.marksAcross(r)||[];t.isInSet(o)&&(a[e]={active:!0})}):a[s]={active:!0})}),a)})}}}}))],this.createPluginProps()).concat(this.defaultPlugins)},t.prototype.createPluginNodeViews=function(){var e=this.eventEmitter,t=this.pluginNodeViews,n={};return t&&Object.keys(t).forEach(function(r){n[r]=function(n,o,i){return t[r](n,o,i,e)}}),n},t.prototype.createView=function(){var e=this,t=this.toDOMAdaptor,n=this.eventEmitter;return new j.Lz(this.el,{state:this.createState(),attributes:{class:sY},nodeViews:X({customBlock:function(e,n,r){return new sa(e,n,r,t)},image:function(e,t,r){return new sl(e,t,r,n)},codeBlock:function(e,t,r){return new su(e,t,r,n)},widget:tP},this.createPluginNodeViews()),dispatchTransaction:function(t){var n=e.view.state.applyTransaction(t).state;e.view.updateState(n),e.emitChangeEvent(t.scrollIntoView()),e.eventEmitter.emit("setFocusedNode",n.selection.$from.node(1))},transformPastedHTML:sv,transformPasted:function(t){var n,r,o,i,a,s;return n=e.schema,r=aP(e.view.state.selection.$from),o=[],i=t.content,a=t.openStart,s=t.openEnd,i.forEach(function(e){if("table"===e.type.name){var t=a3(new _.Ji(_.FK.from(e),0,0));if(t){var i=function(e,t,n,r){var o,i=e.reduce(function(e,t){return e.childCount>t.childCount?e:t}).childCount;if(n&&r)return t.nodes.table.create(null,[sk(e,i,t)]);var a=e[0],s=e.slice(1),l=[(o=sy(a,i,t),t.nodes.tableHead.create(null,o))];return s.length&&l.push(sk(s,i,t)),t.nodes.table.create(null,l)}(sw(t),n,"tableBody"===t.firstChild.type.name,r);o.push(i)}}else o.push(e)}),new _.Ji(_.FK.from(o),a,s)},handlePaste:function(e,t,n){return function(e,t){var n=e.state,r=n.selection,o=n.schema,i=n.tr,a=a2(r),s=a.anchor,l=a.head;if(s&&l){var u,c,p,d,f,h,m,v,g,y,b,w,k,C,x,T,E,M,L,N,S,A,D,I,O=a3(t);if(!O)return!1;var R=aK.create(s),P=R.getRectOffsets(s,l),H=function(e,t,n){var r=[],o=sw(e),i=o[0].childCount,a=o.length,s=0===t.startRowIdx,l=o.slice(0,a);if(s){var u=l.shift();if(u){var c=sy(u,i,n).content;r.push(c)}}return l.forEach(function(e){if(!e.attrs.dummyRowForPasting){var t=sb(e,i,n).content;r.push(t)}}),r}(O,P,o),B=function(e,t,n){for(var r=t.startRowIdx,o=t.startColIdx,i=n.length,a=0,s=0;s<i;s+=1)!function(e){var t=n[e].childCount;n[e].forEach(function(e){var n=e.attrs.colspan;n>1&&(t+=n-1)}),a=Math.max(a,t)}(s);var l=r+i-1,u=o+a-1,c=Math.max(l+1-e.totalRowCount,0),p=Math.max(u+1-e.totalColumnCount,0);return{startRowIdx:r,startColIdx:o,endRowIdx:l,endColIdx:u,addedRowCount:c,addedColumnCount:p}}(R,P,H),F=[];if(u=R,c=B,d=(p=a5(u.getSpannedOffsets(c))).rowCount,f=p.columnCount,m=(h=a5(c)).rowCount,v=h.columnCount,d===m&&f===v){!function(e,t){for(var n=e.startRowIdx,r=e.startColIdx,o=e.endRowIdx,i=e.endColIdx,a=e.addedRowCount,s=e.addedColumnCount,l=n;l<=o-a;l+=1)t.push({rowIdx:l,startColIdx:r,endColIdx:i-s})}(B,F),B.addedColumnCount&&function(e,t,n,r,o){for(var i=r.startRowIdx,a=r.startColIdx,s=r.endRowIdx,l=r.endColIdx,u=r.addedRowCount,c=r.addedColumnCount,p=n.totalRowCount,d=0,f=0;f<p;f+=1){var h=n.getCellInfo(f,l-c),m=h.offset,v=h.nodeSize,g=e.mapping.map(m+v),y=aJ(c,f,t);if(e.insert(g,y),f>=i&&f<=s-u){var b=n.getCellInfo(f,l-c),w=e.mapping.map(b.offset),k=g+4*c;o[d]={rowIdx:f,startColIdx:a,endColIdx:l,dummyOffsets:[w,k]},d+=1}}}(i,o,R,B,F),B.addedRowCount&&function(e,t,n,r,o){var i=r.addedRowCount,a=r.addedColumnCount,s=r.startColIdx,l=r.endColIdx,u=e.mapping.maps.length,c=n.tableEndOffset-2,p=aY(i,n.totalColumnCount+a,t),d=c;e.insert(e.mapping.slice(u).map(d),p);for(var f=0;f<i;f+=1){var h=d+4*s+1,m=d+(l+1)*4+1,v=d+(n.totalColumnCount+a)*4+2;o.push({rowIdx:f+n.totalRowCount,startColIdx:s,endColIdx:l,dummyOffsets:[h,m]}),d=v}}(i,o,R,B,F),I=i.mapping.maps.length,F.forEach(function(e,t){var n=e.rowIdx,r=e.startColIdx,o=e.endColIdx,a=e.dummyOffsets,s=i.mapping.slice(I),l=new _.Ji(H[t],0,0),u=a?a[0]:R.getCellStartOffset(n,r),c=a?a[1]:R.getCellEndOffset(n,o);i.replace(s.map(u),s.map(c),l)}),e.dispatch(i),g=e,y=F,b=R.getCellInfo(0,0).offset,k=(w=g.state).tr,C=w.doc,x=aK.create(C.resolve(b)),E=(T=y[0]).rowIdx,M=T.startColId
1x,N=(L=eP(y)).rowIdx,S=L.endColIdx,A=x.getCellInfo(E,M).offset,D=x.getCellInfo(N,S).offset,g.dispatch(k.setSelection(new aQ(C.resolve(A),C.resolve(D))))}return!0}return!1}(e,n)},handleKeyDown:function(t,n){return e.eventEmitter.emit("keydown",e.editorType,n),!1},handleDOMEvents:{paste:function(t,n){var r=n.clipboardData||window.clipboardData,o=null==r?void 0:r.items;if(o&&!ez(o).some(function(e){return"string"===e.kind&&"text/rtf"===e.type})){var i=tO(o);i&&(n.preventDefault(),tI(e.eventEmitter,i,n.type))}return!1},keyup:function(t,n){return e.eventEmitter.emit("keyup",e.editorType,n),!1},scroll:function(){return e.eventEmitter.emit("scroll","editor"),!0}}})},t.prototype.createCommands=function(){return this.specs.commands(this.view,aW())},t.prototype.getHTML=function(){return tS(this.view.dom.innerHTML)},t.prototype.getModel=function(){return this.view.state.doc},t.prototype.getSelection=function(){var e=this.view.state.selection;return[e.from,e.to]},t.prototype.getSchema=function(){return this.view.state.schema},t.prototype.replaceSelection=function(e,t,n){var r=this.view.state,o=r.schema,i=r.tr,a=e.split("\n").map(function(e){return eU(o,tr(e,o))}),s=new _.Ji(_.FK.from(a),1,1),l=ed(t)&&ed(n)?i.replaceRange(t,n,s):i.replaceSelection(s);this.view.dispatch(l),this.focus()},t.prototype.deleteSelection=function(e,t){var n=this.view.state.tr,r=ed(e)&&ed(t)?n.deleteRange(e,t):n.deleteSelection();this.view.dispatch(r.scrollIntoView())},t.prototype.getSelectedText=function(e,t){var n=this.view.state,r=n.doc,o=n.selection,i=o.from,a=o.to;return ed(e)&&ed(t)&&(i=e,a=t),r.textBetween(i,a,"\n")},t.prototype.setModel=function(e,t){void 0===t&&(t=!1);var n=this.view.state,r=n.tr,o=n.doc;this.view.dispatch(r.replaceWith(0,o.content.size,e)),t&&this.moveCursorToEnd(!0)},t.prototype.setSelection=function(e,t){void 0===t&&(t=e);var n=this.view.state.tr,r=e$(n,e,t);this.view.dispatch(n.setSelection(r).scrollIntoView())},t.prototype.addWidget=function(e,t,n){var r=this.view,o=r.dispatch,i=r.state;o(i.tr.setMeta("widget",{pos:null!=n?n:i.selection.to,node:e,style:t}))},t.prototype.replaceWithWidget=function(e,t,n){var r=this.view.state,o=r.tr,i=tr(n,r.schema);this.view.dispatch(o.replaceWith(e,t,i))},t.prototype.getRangeInfoOfNode=function(e){var t=this.view.state,n=t.doc,r=t.selection,o=e?n.resolve(e):r.$from,i=o.marks(),a=o.node(),s=o.start(),l=o.end(),u=a.type.name;if(i.length||"paragraph"===u){var c=i[i.length-1];u=c?c.type.name:"text",a.forEach(function(e,t){var n=e.isText,r=e.nodeSize,i=e.marks,a=o.pos-s;n&&t<=a&&t+r>=a&&(!i.length||eL(i,c))&&(s+=t,l=s+r)})}return{range:[s,l],type:u}},t}(tF),s0=function(e){return!es(e)&&!ef(e)&&!1!==e},s1=["afterPreviewRender","updatePreview","changeMode","needChangeMode","command","changePreviewStyle","changePreviewTabPreview","changePreviewTabWrite","scroll","contextmenu","show","hide","changeLanguage","changeToolbarState","toggleScrollSync","mixinTableOffsetMapPrototype","setFocusedNode","removePopupWidget","query","openPopup","closePopup","addImageBlobHook","beforePreviewRender","beforeConvertWysiwygToMarkdown","load","loadUI","change","caretChange","destroy","focus","blur","keydown","keyup"],s2=function(){function e(){var e=this;this.events=new a7,this.eventTypes=s1.reduce(function(e,t){return X(X({},e),{type:t})},{}),this.hold=!1,s1.forEach(function(t){e.addEventType(t)})}return e.prototype.listen=function(e,t){var n=this.getTypeInfo(e),r=this.events.get(n.type)||[];if(!this.hasEventType(n.type))throw Error("There is no event type "+n.type);n.namespace&&(t.namespace=n.namespace),r.push(t),this.events.set(n.type,r)},e.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=this.getTypeInfo(e),o=this.events.get(r.type),i=[];return!this.hold&&o&&o.forEach(function(e){var n=e.apply(void 0,t);es(n)||i.push(n)}),i},e.prototype.emitReduce=function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var o=this.events.get(e);return!this.hold&&o&&o.forEach(function(e){var r=e.apply(void 0,Q([t],n));s0(r)&&(t=r)}),t},e.prototype.getTypeInfo=function(e){var t=e.split(".");return{type:t[0],namespace:t[1]}},e.prototype.hasEventType=function(e){return!es(this.eventTypes[this.getTypeInfo(e).t
1ype])},e.prototype.addEventType=function(e){if(this.hasEventType(e))throw Error("There is already have event type "+e);this.eventTypes[e]=e},e.prototype.removeEventHandler=function(e,t){var n=this,r=this.getTypeInfo(e),o=r.type,i=r.namespace;o&&t?this.removeEventHandlerWithHandler(o,t):o&&!i?this.events.delete(o):!o&&i?this.events.forEach(function(e,t){n.removeEventHandlerWithTypeInfo(t,i)}):o&&i&&this.removeEventHandlerWithTypeInfo(o,i)},e.prototype.removeEventHandlerWithHandler=function(e,t){var n=this.events.get(e);if(n){var r=n.indexOf(t);n.indexOf(t)>=0&&n.splice(r,1)}},e.prototype.removeEventHandlerWithTypeInfo=function(e,t){var n=[],r=this.events.get(e);r&&(r.map(function(e){return e.namespace!==t&&n.push(e),null}),this.events.set(e,n))},e.prototype.getEvents=function(){return this.events},e.prototype.holdEventInvoke=function(e){this.hold=!0,e(),this.hold=!1},e}(),s3=function(){function e(e,t,n,r){this.eventEmitter=e,this.mdCommands=t,this.wwCommands=n,this.getEditorType=r,this.initEvent()}return e.prototype.initEvent=function(){var e=this;this.eventEmitter.listen("command",function(t,n){e.exec(t,n)})},e.prototype.addCommand=function(e,t,n){"markdown"===e?this.mdCommands[t]=n:this.wwCommands[t]=n},e.prototype.deleteCommand=function(e,t){"markdown"===e?delete this.mdCommands[t]:delete this.wwCommands[t]},e.prototype.exec=function(e,t){"markdown"===this.getEditorType()?this.mdCommands[e](t):this.wwCommands[e](t)},e}();function s5(e){return"\n"===e[e.length-1]?e.slice(0,e.length-1):e}function s4(e,t){var n=e.schema,r=t.literal.match(tf);if(r){var o=r[1],i=r[3],a=(o||i).toLowerCase();return"htmlInline"===t.type&&!!(n.marks[a]||n.nodes[a])}return!1}function s6(e){return eL(["text","strong","emph","strike","image","link","code"],e.type)}function s9(e){return(null==e?void 0:e.type)==="softbreak"}function s8(e){var t=e.type,n=e.literal,r="htmlInline"===t&&n.match(tf);if(r){var o=r[1],i=r[3],a=o||i;if(a)return eL(["ul","ol","li"],a.toLowerCase())}return!1}function s7(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=document.createElement("div");r.innerHTML=am(e);var o=r.firstChild;return t.map(function(e){return o.getAttribute(e)||""})}var le=function(e){var t={};return Object.keys(e).forEach(function(n){n.split(", ").forEach(function(r){t[r.toLowerCase()]=e[n]})}),t}({"b, strong":function(e,t,n){var r=e.schema.marks.strong;n?e.openMark(r.create({rawHTML:n})):e.closeMark(r)},"i, em":function(e,t,n){var r=e.schema.marks.emph;n?e.openMark(r.create({rawHTML:n})):e.closeMark(r)},"s, del":function(e,t,n){var r=e.schema.marks.strike;n?e.openMark(r.create({rawHTML:n})):e.closeMark(r)},code:function(e,t,n){var r=e.schema.marks.code;n?e.openMark(r.create({rawHTML:n})):e.closeMark(r)},a:function(e,t,n){var r=t.literal,o=e.schema.marks.link;if(n){var i=s7(r,"href")[0];e.openMark(o.create({linkUrl:i,rawHTML:n}))}else e.closeMark(o)},img:function(e,t,n){var r=t.literal;if(n){var o=s7(r,"src","alt"),i=o[0],a=o[1],s=e.schema.nodes.image;e.addNode(s,X({rawHTML:n,imageUrl:i},a&&{altText:a}))}},hr:function(e,t,n){e.addNode(e.schema.nodes.thematicBreak,{rawHTML:n})},br:function(e,t){var n=e.schema.nodes.paragraph,r=t.parent,o=t.prev,i=t.next;(null==r?void 0:r.type)==="paragraph"?(s9(o)&&e.openNode(n),s9(i)?e.closeNode():i&&(e.closeNode(),e.openNode(n))):(null==r?void 0:r.type)==="tableCell"&&(o&&(s6(o)||s4(e,o))&&e.closeNode(),i&&(s6(i)||s4(e,i))&&e.openNode(n))},pre:function(e,t,n){var r,o,i=document.createElement("div");i.innerHTML=t.literal;var a=null==(o=null==(r=i.firstChild)?void 0:r.firstChild)?void 0:o.textContent;e.openNode(e.schema.nodes.codeBlock,{rawHTML:n}),e.addText(s5(a)),e.closeNode()},"ul, ol":function(e,t,n){if("tableCell"===t.parent.type){var r=e.schema.nodes,o=r.bulletList,i=r.orderedList,a=r.paragraph;n?(t.prev&&!s8(t.prev)&&e.closeNode(),e.openNode("ul"===n?o:i,{rawHTML:n})):(e.closeNode(),t.next&&!s8(t.next)&&e.openNode(a))}},li:function(e,t,n){var r;if((null==(r=t.parent)?void 0:r.type)==="tableCell"){var o=e.schema.nodes,i=o.listItem,a=o.paragraph;if(n){var s,l=(s=t.literal,{task:/data-task/.test(s),checked:/data-task-checked/.test(s)});t.prev&&!s8(t.prev)&&e.closeNode(),e.openNode(i,X({rawHTML:n},l)),t.next&&!s8(t.next)&&e.openNode(a)}else t.prev&&!s8(t.prev)&&e.closeNode(),e.closeNode()}}});function lt(e){return"htmlInline"===e.type&&th.test(e.literal)}var ln={text:function(e,t){e.addText(t.literal||"")},paragraph:function(e,t,n,r){var o;if(n.entering){var i=e.schema.nodes.paragraph;(null==(o=t.prev)?void 0:o.type)==="paragraph"&&(e.openNode(i,r),e.closeNode()),e.openNode(i,r)}else e.closeNode()},heading:function(e,t,n,r){if(n.entering){var o=t.level,i=t.headingType;e.openNode(e.schema.nodes.heading,X({level:o,headingType:i},r))}else e.closeNode()},codeBlock:function(e,t,n){var r=e.schema.nodes.codeBlock,o=t.info,i=t.literal;e.openNode(r,X({language:o},n)),e.addText(s5(i||"")),e.closeNode()},list:function(e,t,n,r){if(n.entering){var o=e.schema.nodes,i=o.bulletList,a=o.orderedList,s=t.listData,l=s.type,u=s.start;"bullet"===l?e.openNode(i,r):e.openNode(a,X({order:u},r))}else e.closeNode()},item:function(e,t,n,r){var o=n.entering,i=e.schema.nodes.listItem,a=t.listData,s=a.task,l=a.checked;if(o){var u=X(X(X({},s&&{task:s}),l&&{checked:l}),r);e.openNode(i,u)}else e.closeNode()},blockQuote:function(e,t,n,r){n.entering?e.openNode(e.schema.nodes.blockQuote,r):e.closeNode()},image:function(e,t,n,r){var o=n.entering,i=n.skipChildren,a=e.schema.nodes.image,s=t.destination,l=t.firstChild;o&&i&&i(),e.addNode(a,X(X({imageUrl:s},l&&{altText:l.literal}),r))},thematicBreak:function(e,t,n,r){e.addNode(e.schema.nodes.thematicBreak,r)},strong:function(e,t,n,r){var o=n.entering,i=e.schema.marks.strong;o?e.openMark(i.create(r)):e.closeMark(i)},emph:function(e,t,n,r){var o=n.entering,i=e.schema.marks.emph;o?e.openMark(i.create(r)):e.closeMark(i)},link:function(e,t,n,r){var o=n.entering,i=e.schema.marks.link,a=t.destination,s=t.title;if(o){var l=X({linkUrl:a,title:s},r);e.openMark(i.create(l))}else e.closeMark(i)},softbreak:function(e,t){if("paragraph"===t.parent.type){var n=t.prev,r=t.next;n&&!lt(n)&&e.closeNode(),r&&!lt(r)&&e.openNode(e.schema.nodes.paragraph)}},table:function(e,t,n,r){n.entering?e.openNode(e.schema.nodes.table,r):e.closeNode()},tableHead:function(e,t,n,r){n.entering?e.openNode(e.schema.nodes.tableHead,r):e.closeNode()},tableBody:function(e,t,n,r){n.entering?e.openNode(e.schema.nodes.tableBody,r):e.closeNode()},tableRow:function(e,t,n,r){n.entering?e.openNode(e.schema.nodes.tableRow,r):e.closeNode()},tableCell:function(e,t,n){var r=n.entering;if(!t.ignored){var o=function(t){return t&&(s6(t)||s4(e,t))};if(r){var i=e.schema.nodes,a=i.tableHeadCell,s=i.tableBodyCell,l=i.paragraph,u=t.parent.parent,c="tableHead"===u.type?a:s,p=(u.parent.columns[t.startIdx]||{}).align,d=X({},t.attrs);
1p&&(d.align=p),e.openNode(c,d),o(t.firstChild)&&e.openNode(l)}else o(t.lastChild)&&e.closeNode(),e.closeNode()}},strike:function(e,t,n,r){var o=n.entering,i=e.schema.marks.strike;o?e.openMark(i.create(r)):e.closeMark(i)},code:function(e,t,n,r){var o=e.schema.marks.code;e.openMark(o.create(r)),e.addText(s5(t.literal||"")),e.closeMark(o)},customBlock:function(e,t){var n=e.schema.nodes,r=n.customBlock,o=n.paragraph,i=t.info,a=t.literal;e.openNode(r,{info:i}),e.addText(s5(a||"")),e.closeNode(),t.next||(e.openNode(o),e.closeNode())},frontMatter:function(e,t){e.openNode(e.schema.nodes.frontMatter),e.addText(t.literal),e.closeNode()},htmlInline:function(e,t){var n=t.literal,r=n.match(tf),o=r[1],i=r[3],a=(o||i).toLowerCase(),s=e.schema.marks[a],l=am(n);if(null==s?void 0:s.spec.attrs.htmlInline)if(o){var u=ag(l);e.openMark(s.create({htmlAttrs:u}))}else e.closeMark(s);else{var c=le[a];c&&c(e,t,o)}},htmlBlock:function(e,t){var n=t.literal,r=document.createElement("div");if(tm.test(n))e.openNode(e.schema.nodes.htmlComment),e.addText(t.literal),e.closeNode();else{var o=n.match(tf),i=o[1],a=o[3],s=(i||a).toLowerCase(),l=e.schema.nodes[s],u=am(n);if(null==l?void 0:l.spec.attrs.htmlBlock){var c=ag(u),p=av(t,s);e.addNode(l,{htmlAttrs:c,childrenHTML:p})}else r.innerHTML=u,function e(t){ez(t.childNodes).forEach(function(t){if(tk(t)){var n=t.nodeName.toLowerCase();t.setAttribute("data-raw-html",n),t.childNodes&&e(t)}})}(r),e.convertByDOMParser(r)}},customInline:function(e,t,n){var r=n.entering,o=n.skipChildren,i=t.info,a=t.firstChild,s=e.schema;if(-1!==i.indexOf("widget")&&r){var l=to(t);o(),e.addNode(s.nodes.widget,{info:i},[s.text(te(i,l))])}else{var u="$$";r&&(u+=a?i+" ":i),e.addText(u)}}},lr=function(){function e(e,t){this.schema=e,this.convertors=t,this.stack=[{type:this.schema.topNodeType,attrs:null,content:[]}],this.marks=_.CU.none}return e.prototype.top=function(){return eP(this.stack)},e.prototype.push=function(e){this.stack.length&&this.top().content.push(e)},e.prototype.addText=function(e){if(e){var t=this.top().content,n=eP(t),r=this.schema.text(e,this.marks),o=n&&!!(n.isText&&r.isText&&_.CU.sameSet(n.marks,r.marks))&&n.withText(n.text+r.text);o?t[t.length-1]=o:t.push(r)}},e.prototype.openMark=function(e){this.marks=e.addToSet(this.marks)},e.prototype.closeMark=function(e){this.marks=e.removeFromSet(this.marks)},e.prototype.addNode=function(e,t,n){var r=e.createAndFill(t,n,this.marks);return r?(this.push(r),r):null},e.prototype.openNode=function(e,t){this.stack.push({type:e,attrs:t,content:[]})},e.prototype.closeNode=function(){this.marks.length&&(this.marks=_.CU.none);var e=this.stack.pop(),t=e.type,n=e.attrs,r=e.content;return this.addNode(t,n,r)},e.prototype.convertByDOMParser=function(e){var t=this;_.S4.fromSchema(this.schema).parse(e).content.forEach(function(e){return t.push(e)})},e.prototype.closeUnmatchedHTMLInline=function(e,t){var n;if(!t&&"htmlInline"!==e.type)for(var r=this.stack.length-1,o=r;o>=0;o-=1){var i=this.stack[o];if(null==(n=i.attrs)?void 0:n.rawHTML)i.content.length?this.closeNode():this.stack.pop();else break}},e.prototype.convert=function(e,t){for(var n=e.walker(),r=n.next(),o=this;r;)!function(){var e=r.node,i=r.entering,a=o.convertors[e.type],s=!1;if(a){var l={entering:i,leaf:!function(e){switch(e.type){case"document":case"blockQuote":case"list":case"item":case"paragraph":case"heading":case"emph":case"strong":case"strike":case"link":case"image":case"table":case"tableHead":case"tableBody":case"tableRow":case"tableCell":case"tableDelimRow":case"customInline":return!0;default:return!1}}(e),getChildrenText:e4,options:{gfm:!0,nodeId:!1,tagFilter:!1,softbreak:"\n"},skipChildren:function(){s=!0}};if(o.closeUnmatchedHTMLInline(e,i),a(o,e,l),(null==t?void 0:t.node)===e){var u=o.stack.reduce(function(e,t){return e+t.content.reduce(function(e,t){return e+t.nodeSize},0)},0)+1;t.setMappedPos(u)}}s&&(n.resumeAt(e,!1),n.next()),r=n.next()}()},e.prototype.convertNode=function(e,t){return(this.convert(e,t),this.stack.length)?this.closeNode():null},e}(),lo={text:function(e,t){var n,r=t.node,o=null!=(n=r.text)?n:"";
1(r.marks||[]).some(function(e){return"link"===e.type.name})?e.text(eI(o),!1):e.text(o)},paragraph:function(e,t){var n=t.node,r=t.parent,o=t.index,i=void 0===o?0:o;if(e.stopNewline)e.convertInline(n);else{var a=0===i,s=!a&&r.child(i-1),l=s&&0===s.childCount,u=i<r.childCount-1&&r.child(i+1),c=u&&"paragraph"===u.type.name,p=0===n.childCount;if(p&&l)e.write("<br>\n");else if(!p||l||a)e.convertInline(n),c?e.write("\n"):e.closeBlock(n);else{if((null==r?void 0:r.type.name)==="listItem"){var d=e.getDelim();e.setDelim(""),e.write("<br>"),e.setDelim(d)}e.write("\n")}}},heading:function(e,t,n){var r=t.node,o=n.delim;"atx"===r.attrs.headingType?(e.write(o+" "),e.convertInline(r)):(e.convertInline(r),e.ensureNewLine(),e.write(o)),e.closeBlock(r)},codeBlock:function(e,t,n){var r=t.node,o=n.delim,i=n.text,a=o[0],s=o[1];e.write(a),e.ensureNewLine(),e.text(i,!1),e.ensureNewLine(),e.write(s),e.closeBlock(r)},blockQuote:function(e,t,n){var r=t.node,o=t.parent,i=n.delim;(null==o?void 0:o.type.name)===r.type.name&&e.flushClose(1),e.wrapBlock(i,null,r,function(){return e.convertNode(r)})},bulletList:function(e,t,n){var r=t.node,o=n.delim;e.convertList(r,eD(" ",4),function(){return o+" "})},orderedList:function(e,t){var n=t.node,r=n.attrs.order||1;e.convertList(n,eD(" ",4),function(e){return String(r+e)+". "})},listItem:function(e,t){var n=t.node,r=n.attrs,o=r.task,i=r.checked;o&&e.write("["+(i?"x":" ")+"] "),e.convertNode(n)},image:function(e,t,n){var r=n.attrs;e.write("!["+(null==r?void 0:r.altText)+"]("+(null==r?void 0:r.imageUrl)+")")},thematicBreak:function(e,t,n){var r=t.node,o=n.delim;e.write(o),e.closeBlock(r)},table:function(e,t){var n=t.node;e.convertNode(n),e.closeBlock(n)},tableHead:function(e,t,n){var r=t.node,o=n.delim,i=r.firstChild;e.convertNode(r);var a=null!=o?o:"";!o&&i&&i.forEach(function(e){var t,n,r,o,i=e.textContent,s=(t=e.attrs.align,n=i.length,r="",o="","left"===t?(r=":",n-=1):"right"===t?(o=":",n-=1):"center"===t&&(r=":",o=":",n-=2),""+r+eD("-",Math.max(n,3))+o);a+="| "+s+" "}),e.write(a+"|"),e.ensureNewLine()},tableBody:function(e,t){var n=t.node;e.convertNode(n)},tableRow:function(e,t){var n=t.node;e.convertNode(n),e.write("|"),e.ensureNewLine()},tableHeadCell:function(e,t,n){var r=t.node,o=n.delim;e.write(void 0===o?"| ":o),e.convertTableCell(r),e.write(" ")},tableBodyCell:function(e,t,n){var r=t.node,o=n.delim;e.write(void 0===o?"| ":o),e.convertTableCell(r),e.write(" ")},customBlock:function(e,t,n){var r=t.node,o=n.delim,i=n.text,a=o[0],s=o[1];e.write(a),e.ensureNewLine(),e.text(i,!1),e.ensureNewLine(),e.write(s),e.closeBlock(r)},frontMatter:function(e,t,n){var r=t.node,o=n.text;e.text(o,!1),e.closeBlock(r)},widget:function(e,t,n){var r=n.text;e.write(r)},html:function(e,t,n){var r=t.node,o=n.text;e.write(o),r.attrs.htmlBlock&&e.closeBlock(r)},htmlComment:function(e,t,n){var r=t.node,o=n.text;e.write(o),e.closeBlock(r)}};function li(e,t){var n=e.text,r=/`+/g,o=0;if(e.isText&&n)for(var i=r.exec(n);i;)o=Math.max(o,i[0].length),i=r.exec(n);for(var a=o>0&&t>0?" `":"`",s=0;s<o;s+=1)a+="`";return o>0&&t<0&&(a+=" "),a}function la(e){return e?["<"+e+">","</"+e+">"]:null}function ls(e){return e?"<"+e+">":null}function ll(e){return e?"</"+e+">":null}var lu={heading:function(e){var t=e.node.attrs,n=t.level,r=eD("#",n);return"setext"===t.headingType&&(r=1===n?"===":"---"),{delim:r,rawHTML:la(t.rawHTML)}},codeBlock:function(e){var t=e.node,n=t.attrs,r=t.textContent;return{delim:["```"+(n.language||""),"```"],rawHTML:la(n.rawHTML),text:r}},blockQuote:function(e){return{delim:"> ",rawHTML:la(e.node.attrs.rawHTML)}},bulletList:function(e,t){var n=e.node,r=t.inTable,o=n.attrs.rawHTML;return r&&(o=o||"ul"),{delim:"*",rawHTML:la(o)}},orderedList:function(e,t){var n=e.node,r=t.inTable,o=n.attrs.rawHTML;return r&&(o=o||"ol"),{rawHTML:la(o)}},listItem:function(e,t){var n=e.node,r=t.inTable,o=n.attrs,i=o.task,a=o.checked,s=n.attrs.rawHTML;return r&&(s=s||"li"),{rawHTML:s?["<"+s+(i?' class="task-list-item'+(a?" checked":"")+'"':"")+(i?" data-task"+(a?" data-task-checked":""):"")+">","</"+s+">"]:null}},table:function(e){return{rawHTML:la(e.node.attrs.rawHTML)}},tableHead:function(e){return{rawHTML:la(e.node.attrs.rawHTML)}},tableBody:function(e){return{rawHTML:la(e.node.attrs.rawHTML)}},tableRow:function(e){return{rawHTML:la(e.node.attrs.rawHTML)}},tableHeadCell:function(e){return{rawHTML:la(e.node.attrs.rawHTML)}},tableBodyCell:function(e){return{rawHTML:la(e.node.attrs.rawHTML)}},image:function(e){var t=e.node.attrs,n=t.rawHTML,r=t.altText,o=t.imageUrl.replace(/&amp;/g,"&"),i=r?' alt="'+eM(r)+'"':"";return{rawHTML:n?"<"+n+' src="'+eM(o)+'"'+i+">":null,attrs:{altText:eI(r||""),imageUrl:o}}},thematicBreak:function(e){return{delim:"***",rawHTML:ls(e.node.attrs.rawHTML)}},customBlock:function(e){var t=e.node,n=t.attrs,r=t.textContent;return{delim:["$$"+n.info,"$$"],text:r}},frontMatter:function(e){return{text:e.node.textContent}},widget:function(e){return{text:e.node.textContent}},strong:function(e,t){var n=e.node,r=t.entering,o=n.attrs.rawHTML;return{delim:"**",rawHTML:r?ls(o):ll(o)}},emph:function(e,t){var n=e.node,r=t.entering,o=n.attrs.rawHTML;return{delim:"*",rawHTML:r?ls(o):ll(o)}}
1,strike:function(e,t){var n=e.node,r=t.entering,o=n.attrs.rawHTML;return{delim:"~~",rawHTML:r?ls(o):ll(o)}},link:function(e,t){var n,r,o=e.node,i=t.entering,a=o.attrs,s=a.title,l=a.rawHTML,u=a.linkUrl.replace(/&amp;/g,"&"),c=s?' title="'+eM(s)+'"':"";return i?{delim:"[",rawHTML:l?"<"+l+' href="'+eM(u)+'"'+c+">":null}:{delim:"]("+u+(s?" "+((r=-1===(n=eI(s)).indexOf('"')?'""':-1===n.indexOf("'")?"''":"()")[0]+n+r[1]):"")+")",rawHTML:ll(l)}},code:function(e,t){var n=e.node,r=e.parent,o=e.index,i=void 0===o?0:o,a=t.entering;return{delim:a?li(r.child(i),-1):li(r.child(i-1),1),rawHTML:a?ls(n.attrs.rawHTML):ll(n.attrs.rawHTML)}},htmlComment:function(e){return{text:e.node.textContent}},html:function(e,t){var n=e.node,r=t.entering,o=n.type.name,i=n.attrs.htmlAttrs,a="<"+o,s="</"+o+">";return(Object.keys(i).forEach(function(e){a+=" "+e+'="'+i[e].replace(/"/g,"'")+'"'}),a+=">",n.attrs.htmlInline)?{rawHTML:r?a:s}:{text:""+a+n.attrs.childrenHTML+s}}},lc={strong:{mixable:!0,removedEnclosingWhitespace:!0},emph:{mixable:!0,removedEnclosingWhitespace:!0},strike:{mixable:!0,removedEnclosingWhitespace:!0},code:{escape:!1},link:null,html:null},lp=function(){function e(e){var t=e.nodeTypeConvertors,n=e.markTypeConvertors;this.nodeTypeConvertors=t,this.markTypeConvertors=n,this.delim="",this.result="",this.closed=!1,this.tightList=!1,this.stopNewline=!1,this.inTable=!1}return e.prototype.getMarkConvertor=function(e){var t=e.attrs.htmlInline?"html":e.type.name;return this.markTypeConvertors[t]},e.prototype.isInBlank=function(){return/(^|\n)$/.test(this.result)},e.prototype.markText=function(e,t,n,r){var o=this.getMarkConvertor(e);if(o){var i=o({node:e,parent:n,index:r},t),a=i.delim;return i.rawHTML||a}return""},e.prototype.setDelim=function(e){this.delim=e},e.prototype.getDelim=function(){return this.delim},e.prototype.flushClose=function(e){if(!this.stopNewline&&this.closed){if(this.isInBlank()||(this.result+="\n"),e||(e=2),e>1){var t=this.delim,n=/\s+$/.exec(t);n&&(t=t.slice(0,t.length-n[0].length));for(var r=1;r<e;r+=1)this.result+=t+"\n"}this.closed=!1}},e.prototype.wrapBlock=function(e,t,n,r){var o=this.getDelim();this.write(t||e),this.setDelim(this.getDelim()+e),r(),this.setDelim(o),this.closeBlock(n)},e.prototype.ensureNewLine=function(){this.isInBlank()||(this.result+="\n")},e.prototype.write=function(e){void 0===e&&(e=""),this.flushClose(),this.delim&&this.isInBlank()&&(this.result+=this.delim),e&&(this.result+=e)},e.prototype.closeBlock=function(e){this.closed=e},e.prototype.text=function(e,t){void 0===t&&(t=!0);for(var n=e.split("\n"),r=0;r<n.length;r+=1)this.write(),this.result+=t?function(e){var t,n,r=function(e){return"\\"+e},o=e.replace(ev," ");return eb.test(o)&&(o=o.replace(eb,r)),ex.test(o)&&(o=o.replace(ex,function(e){return e+"\\"})),o=o.replace(ew,r),ey.test(o)&&(o=o.replace(ey,r)),t=o,n=!1,J(eS,function(e){return e.test(t)&&(n=!0),!n}),n&&(o=o.replace(eg,r)),o}(n[r]):n[r],r!==n.length-1&&(this.result+="\n")},e.prototype.convertBlock=function(e,t,n){var r=e.type.name,o=this.nodeTypeConvertors[r],i={node:e,parent:t,index:n};e.attrs.htmlBlock?this.nodeTypeConvertors.html(this,i):o&&o(this,i)},e.prototype.convertInline=function(e){var t=this,n=[],r="",o=function(o,i,a){var s=o?o.marks:[],l=r;if(r="",o&&o.isText&&s.some(function(e){var n=t.getMarkConvertor(e),r=n&&n();return r&&r.removedEnclosingWhitespace})&&o&&o.text){var u=/^(\s*)(.*?)(\s*)$/m.exec(o.text),c=u[1],p=u[2],d=u[3];l+=c,r=d,(c||d)&&((o=p?o.withText(p):null)||(s=n))}for(var f=s.length&&eP(s),h=f&&t.getMarkConvertor(f),m=h&&h(),v=m&&!1===m.escape,g=s.length-!!v,y=0;y<g;y+=1){var p=s[y];if(m&&!m.mixable)break;for(var b=0;b<n.length;b+=1){var w=n[b];if(m&&!m.mixable)break;if(p.eq(w)){y>b?s=s.slice(0,b).concat(p).concat(s.slice(b,y)).concat(s.slice(y+1,g)):b>y&&(s=s.slice(0,y).concat(s.slice(y+1,b)).concat(p).concat(s.slice(b,g)));break}}}for(var k=0;k<Math.min(n.length,g)&&s[k].eq(n[k]);)k+=1;for(;k<n.length;){var C=n.pop();C&&t.text(t.markText(C,!1,e,a),!1)}if(l&&t.text(l),o){for(;n.length<g;){var p=s[n.length];n.push(p),t.text(t.markText(p,!0,e,a),!1)}v&&o.isText?t.text(t.markText(f,!0,e,a)+o.text+t.markText(f,!1,e,a+1),!1):t.convertBlock(o,e,a)}};e.forEach(o),o(null,null,e.childCount)},e.prototype.convertList=function(e,t,n){var r,o=this;this.closed&&this.closed.type===e.type?this.flushClose(3):this.tightList&&this.flushClose(1);var i=null==(r=e.attrs.tight)||r,a=this.tightList;this.tightList=i,e.forEach(function(r,a,s){s&&i&&o.flushClose(1),o.wrapBlock(t,n(s),e,function(){return o.convertBlock(r,e,s)})}),this.tightList=a},e.prototype.convertTableCell=function(e){var t=this;this.stopNewline=!0,this.inTable=!0,e.forEach(function(n,r,o){eL(["bulletList","orderedList"],n.type.name)?(t.convertBlock(n,e,o),t.closed=!1):(t.convertInline(n),o<e.childCount-1&&"paragraph"===e.child(o+1).type.name&&t.write("<br>"))}),this.stopNewline=!1,this.inTable=!1},e.prototype.convertNode=function(e,t){var n=this;
1return e.forEach(function(r,o,i){if(n.convertBlock(r,e,i),(null==t?void 0:t.node)===r){var a=n.result.split("\n");t.setMappedPos([a.length,eP(a).length+1])}}),this.result},e}(),ld=function(){function e(e,t,n,r){var o,i,a,s,l,u,c=this;this.setMappedPos=function(e){c.mappedPosWhenConverting=e},this.schema=e,this.eventEmitter=r,this.focusedNode=null,this.mappedPosWhenConverting=null,this.toWwConvertors=(o=Object.keys(n),i=X({},ln),a=new iN({gfm:!0,nodeId:!0,convertors:n}).getConvertors(),o.forEach(function(e){var t=ln[e];t&&!eL(["htmlBlock","htmlInline"],e)&&(i[e]=function(r,o,i){i.origin=function(){return a[e](o,i,a)};var s,l=n[e](o,i);if(l){var u=Array.isArray(l)?l[0]:l;s={htmlAttrs:u.attributes,classNames:u.classNames}}t(r,o,i,s)})}),i),this.toMdConvertors=(Object.keys(s=t||{}).forEach(function(e){var t=lu[e],n=s[e];t?lu[e]=function(e,r){return r.origin=function(){return t(e,r)},n(e,r)}:lu[e]=n,delete s[e]}),{nodeTypeConvertors:(l={},Object.keys(lo).forEach(function(e){l[e]=function(t,n){if(lo[e]){var r=lu[e],o=r?r(n,{inTable:t.inTable}):{};!function(e,t){var n,r,o,i,a,s,l,u=t.state,c=t.nodeInfo,p=t.params,d=p.rawHTML;d?ea(e,["heading","codeBlock"])>-1?(n=c.node,r=d[0],o=d[1],u.write(r),u.convertInline(n),u.write(o)):ea(e,["image","thematicBreak"])>-1?u.write(d):(i=c.node,a=c.parent,s=d[0],l=d[1],u.stopNewline=!0,u.write(s),u.convertNode(i),u.write(l),(null==a?void 0:a.type.name)==="doc"&&(u.closeBlock(i),u.stopNewline=!1)):lo[e](u,c,p)}(e,{state:t,nodeInfo:n,params:o})}}}),l),markTypeConvertors:(u={},Object.keys(lc).forEach(function(e){u[e]=function(t,n){var r=lc[e],o=lu[e],i=o&&t&&!es(n)?o(t,{entering:n}):{};return X(X({},i),r)}}),u)}),this.eventEmitter.listen("setFocusedNode",function(e){return c.focusedNode=e})}return e.prototype.getMappedPos=function(){return this.mappedPosWhenConverting},e.prototype.getInfoForPosSync=function(){return{node:this.focusedNode,setMappedPos:this.setMappedPos}},e.prototype.toWysiwygModel=function(e){return new lr(this.schema,this.toWwConvertors).convertNode(e,this.getInfoForPosSync())},e.prototype.toMarkdownText=function(e){var t=new lp(this.toMdConvertors).convertNode(e,this.getInfoForPosSync());return this.eventEmitter.emitReduce("beforeConvertWysiwygToMarkdown",t)},e}();function lf(e){var t=e.plugins,n=e.eventEmitter,r=e.usageStatistics,o=e.instance;return n.listen("mixinTableOffsetMapPrototype",aX),(null!=t?t:[]).reduce(function(e,t){var i=function(e){var t=e.plugin,n={eventEmitter:e.eventEmitter,usageStatistics:e.usageStatistics,instance:e.instance,pmState:{Plugin:U.k_,PluginKey:U.hs,Selection:U.LN,TextSelection:U.U3},pmView:{Decoration:j.NZ,DecorationSet:j.zF},pmModel:{Fragment:_.FK},pmRules:{InputRule:W.fV,inputRules:W.sM,undoInputRule:W.dv},pmKeymap:{keymap:V.w},i18n:st};if(en(t)){var r=t[0],o=t[1];return r(n,void 0===o?{}:o)}return t(n)}({plugin:t,eventEmitter:n,usageStatistics:r,instance:o});if(!i)throw Error("The return value of the executed plugin is empty.");var a=i.markdownParsers,s=i.toHTMLRenderers,l=i.toMarkdownRenderers,u=i.markdownPlugins,c=i.wysiwygPlugins,p=i.wysiwygNodeViews,d=i.markdownCommands,f=i.wysiwygCommands,h=i.toolbarItems;return s&&(e.toHTMLRenderers=eB(e.toHTMLRenderers,s)),l&&(e.toMarkdownRenderers=eB(e.toMarkdownRenderers,l)),u&&(e.mdPlugins=e.mdPlugins.concat(u)),c&&(e.wwPlugins=e.wwPlugins.concat(c)),p&&(e.wwNodeViews=X(X({},e.wwNodeViews),p)),d&&(e.mdCommands=X(X({},e.mdCommands),d)),f&&(e.wwCommands=X(X({},e.wwCommands),f)),h&&(e.toolbarItems=e.toolbarItems.concat(h)),a&&(e.markdownParsers=X(X({},e.markdownParsers),a)),e},{toHTMLRenderers:{},toMarkdownRenderers:{},mdPlugins:[],wwPlugins:[],wwNodeViews:{},mdCommands:{},wwCommands:{},toolbarItems:[],markdownParsers:{}})}var lh=function(){function e(e){var t,n=this;this.options=ee({linkAttributes:null,extendedAutolinks:!1,customHTMLRenderer:null,referenceDefinition:!1,customHTMLSanitizer:null,frontMatter:!1,usageStatistics:!0,theme:"light"},e),this.eventEmitter=new s2;var r=eA(this.options.linkAttributes),o=lf({plugins:this.options.plugins,eventEmitter:this.eventEmitter,usageStatistics:this.options.usageStatistics,instance:this})||{},i=o.toHTMLRenderers,a=o.markdownParsers,s=this.options,l=s.customHTMLRenderer,u=s.extendedAutolinks,c=s.referenceDefinition,p=s.frontMatter,d=s.customHTMLSanitizer,f={linkAttributes:r,customHTMLRenderer:X(X({},i),l),extendedAutolinks:u,referenceDefinition:c,frontMatter:p,sanitizer:d||am};t=f.customHTMLRenderer,["htmlBlock","htmlInline"].forEach(function(e){t[e]&&Object.keys(t[e]).forEac
1h(function(e){return ah(e)})}),this.options.events&&J(this.options.events,function(e,t){n.on(t,e)});var h=this.options,m=h.el,v=h.initialValue,g=h.theme,y=m.innerHTML;"light"!==g&&m.classList.add(tb(g)),m.innerHTML="",this.toastMark=new ik("",{disallowedHtmlBlockTags:["br","img"],extendedAutolinks:u,referenceDefinition:c,disallowDeepHeading:!0,frontMatter:p,customParser:a}),this.preview=new aI(this.eventEmitter,X(X({},f),{isViewer:!0})),rt(this.preview.previewContent,"mousedown",this.toggleTask.bind(this)),v?this.setMarkdown(v):y&&this.preview.setHTML(y),m.appendChild(this.preview.previewContent),this.eventEmitter.emit("load",this)}return e.prototype.toggleTask=function(e){var t=e.target,n=getComputedStyle(t,":before");!t.hasAttribute("data-task-disabled")&&t.hasAttribute("data-task")&&tg(n,e.offsetX,e.offsetY)&&(tx(t,"checked"),this.eventEmitter.emit("change",{source:"viewer",date:e}))},e.prototype.setMarkdown=function(e){var t=this.toastMark.getLineTexts(),n=[t.length,eP(t).length+1],r=this.toastMark.editMarkdown([1,1],n,e||"");this.eventEmitter.emit("updatePreview",r)},e.prototype.on=function(e,t){this.eventEmitter.listen(e,t)},e.prototype.off=function(e){this.eventEmitter.removeEventHandler(e)},e.prototype.addHook=function(e,t){this.eventEmitter.removeEventHandler(e),this.eventEmitter.listen(e,t)},e.prototype.destroy=function(){n7(this.preview.el,"mousedown",this.toggleTask.bind(this)),this.preview.destroy(),this.eventEmitter.emit("destroy")},e.prototype.isViewer=function(){return!0},e.prototype.isMarkdownMode=function(){return!1},e.prototype.isWysiwygMode=function(){return!1},e}();function lm(e){return e instanceof _.bP}function lv(e){return eL(["document","blockQuote","bulletList","orderedList","listItem","paragraph","heading","emph","strong","strike","link","image","table","tableHead","tableBody","tableRow","tableHeadCell","tableBodyCell"],e)}var lg={openTag:function(e,t){var n=e.tagName,r=e.classNames,o=e.attributes,i=document.createElement(n),a={};r&&(i.className=r.join(" ")),o&&(a=X(X({},a),o)),tN(a,i),t.push(i)},closeTag:function(e,t){if(t.length>1){var n=t.pop();eP(t).appendChild(n)}},html:function(e,t){eP(t).insertAdjacentHTML("beforeend",e.content)},text:function(e,t){var n=document.createTextNode(e.content);eP(t).appendChild(n)}},ly=function(){function e(e,t){var n=ax(e,t),r=X(X({},t.htmlBlock),t.htmlInline);this.customConvertorKeys=Object.keys(t).concat(Object.keys(r)),this.renderer=new iN({gfm:!0,convertors:X(X({},n),r)}),this.convertors=this.renderer.getConvertors()}return e.prototype.generateTokens=function(e){var t,n,r,o,i,a,s,l,u=(t=e.attrs,r={type:n=e.type.name,wysiwygNode:!0,literal:!lv(n)&&lm(e)?e.textContent:null},o=({heading:{level:t.level},link:{destination:t.linkUrl,title:t.title},image:{destination:t.imageUrl},codeBlock:{info:t.language},bulletList:{type:"list",listData:{type:"bullet"}},orderedList:{type:"list",listData:{type:"ordered",start:t.order}},listItem:{type:"item",listData:{task:t.task,checked:t.checked}},tableHeadCell:{type:"tableCell",cellType:"head",align:t.align},tableBodyCell:{type:"tableCell",cellType:"body",align:t.align},customBlock:{info:t.info}})[n],i=X(X({},r),o),s=(a=e.attrs).htmlAttrs,l=a.childrenHTML,s?X(X({},i),{attrs:s,childrenHTML:l}):i),c={entering:!0,leaf:!!lm(e)&&e.isLeaf,options:this.renderer.getOptions(),getChildrenText:function(){return lm(e)?e.textContent:""},skipChildren:function(){return!1}},p=this.convertors[e.type.name],d=p(u,c,this.convertors),f=en(d)?d:[d];return(lv(e.type.name)||e.attrs.htmlInline)&&(c.entering=!1,f.push({type:"text",content:lm(e)?e.textContent:""}),f=f.concat(p(u,c,this.convertors))),f},e.prototype.toDOMNode=function(e){var t=this.generateTokens(e),n=[];return t.forEach(function(e){return lg[e.type](e,n)}),n[0]},e.prototype.getToDOMNode=function(e){return eL(this.customConvertorKeys,e)?this.toDOMNode.bind(this):null},e}(),lb=null,lw=null;function lk(e,t){var n=t.syncScrollTop,r=t.releaseEventBlock;lw&&clearTimeout(lw),n(e),lw=setTimeout(function(){r()},15)}var lC=function(){function e(e,t,n){this.latestEditorScrollTop=null,this.latestPreviewScrollTop=null,this.blockedScroll=null,this.active=!0,this.timer=null;var r=t.previewContent,o=t.el;this.previewRoot=r,this.previewEl=o,this.mdEditor=e,this.editorView=e.view,this.toastMark=e.getToastMark(),this.eventEmitter=n,this.addScrollSyncEvent()}return e.prototype.addScrollSyncEvent=function(){var e=this;this.eventEmitter.listen("afterPreviewRender",function(){e.clearTimer(),e.timer=setTimeout(function(){e.syncPreviewScrollTop(!0)},200)}),this.eventEmitter.listen("scroll",function(t,n){e.active&&("editor"===t&&"editor"!==e.blockedScroll?e.syncPreviewScrollTop():"preview"===t&&"preview"!==e.blockedScroll&&e.syncEditorScrollTop(n))}),this.eventEmitter.listen("toggleScrollSync",function(t){e.active=t})},e.prototype.getMdNodeAtPos=function(e,t){var n=e.content.findIndex(t.pos).index;return this.toastMark.findFirstNodeAtLine(n+1)},e.prototype.getScrollTopByCaretPos=function(){var e=this.mdEditor.getSelection(),t=this.toastMark.findFirstNodeAtLine(e[0][0]),n=this.previewEl.clientHeight,r=aN(this.previewRoot,t).el,o=aL(r,this.previewRoot)||r.offsetTop,i=r.clientHeight;return this.latestEditorScrollTop=null,r.getBoundingClientRect().top-this.previewEl.getBoundingClientRect().top<n?null:o+i-.5*n},e.prototype.syncPreviewScrollTop=function(e){void 0===e&&(e=!1);var t,n=this.editorView,r=this.previewEl,o=this.previewRoot,i=n.dom.getBoundingClientRect(),a=i.left,s=i.top,l=n.posAtCoords({left:a,top:s}),u=n.state.doc,c=this.getMdNodeAtPos(u,l);if(!(!c||"htmlBlock"===(t=c.type)||"htmlInline"===t)){var p=r.scrollTop,d=n.dom,f=d.scrollTop,h=d.scrollHeight,m=d.clientHeight,v=d.children,g=h-f<=m+18,y=g?r.scrollHeight:0;if(f&&!g){if(e){var b=this.getScrollTopByCaretPos();if(!b)return;y=b}else{var w=aN(this.previewRoot,c),k=w.el,C=aM(u,w.mdNode,v),x=C.height,T=C.rect;y=(aL(k,o)||k.offsetTop)+k.clientHeight*(s>T.top?Math.min((s-T.top)/x,1):0)}y=this.getResolvedScrollTop("editor",f,y,p),this.latestEditorScrollTop=f}y!==p&&this.run("editor",y,p)}},e.prototype.syncEditorScrollTop=function(e){var t=this.toastMark,n=this.editorView,r=this.previewRoot,o=this.previewEl,i=n.dom,a=n.state,s=o.scrollTop,l=o.clientHeight,u=o.scrollHeight-s<=l,c=i.scrollTop,p=u?i.scrollHeight:0;if(s&&e&&!u){if(!(e=function(e,t){for(;!e.getAttribute("data-nodeid")&&e.parentElement!==t;)e=e.parentElement;return e}(e,r)).getAttribute("data-nodeid"))return;var d,f,h,m,v=i.children,g=Number(e.getAttribute("data-nodeid")),y=aN(this.previewRoot,t.findNodeById(g)),b=y.mdNode,w=y.el;p=v[eZ(b)-1].offsetTop;var k=aM(a.doc,b,v).height,C=(d=aS[g]&&aS[g].height,f=aS[g]&&aS[g].offsetTop,h=d||w.clientHeight,m=f||aL(w,r)||w.offsetTop,d||(aS[g]=aS[g]||{},aS[g].height=h),f||(aS[g]=aS[g]||{},aS[g].offsetTop=m),{nodeHeight:h,offsetTop:m}),x=C.nodeHeight;p+=Math.min((s-C.offsetTop)/x,1)*k,p=this.getResolvedScrollTop("preview",s,p,c),this.latestPreviewScrollTop=s}p!==c&&this.run("preview",p,c)},e.prototype.getResolvedScrollTop=function(e,t,n,r){var o="editor"===e?this.latestEditorScrollTop:this.latestPreviewScrollTop;return null===o?n:o<t?Math.max(n,r):Math.min(n,r)},e.prototype.run=function(e,t,n){var r,o,i,a,s,l=this;"editor"===e?(s=this.previewEl,this.blockedScroll="preview"):(s=this.editorView.dom,this.blockedScroll="editor"),r={syncScrollTop:function(e){return s.scrollTop=e},releaseEventBlock:function(){return l.blockedScroll=null}},o=t-n,i=Date.now(),(a=function(){var e=(Date.now()-i)/100;lb&&clearTimeout(lb),e<1?(lk(Math.ceil(n+o*Math.cos((1-e)*Math.PI/2)),r),lb=setTimeout(a,1)):(lk(t,r),lb=null)})()},e.prototype.clearTimer=function(){this.timer&&(clearTimeout(this.timer),this.timer=null)},e.prototype.destroy=function(){this.clearTimer(),this.eventEmitter.removeEventHandler("scroll"),this.eventEmitter.removeEventHandler("afterPreviewRender")},e}(),lx={getPopupInitialValues:function(e,t){return"link"===t.popupName?{linkText:e.getSelectedText()}:{}}},lT=function(){function e(e){var t,n,r,o,i=this;this.initialHTML=e.el.innerHTML,e.el.innerHTML="",this.options=ee
1({previewStyle:"tab",previewHighlight:!0,initialEditType:"markdown",height:"300px",minHeight:"200px",language:"en-US",useCommandShortcut:!0,usageStatistics:!0,toolbarItems:[["heading","bold","italic","strike"],["hr","quote"],["ul","ol","task","indent","outdent"],["table","image","link"],["code","codeblock"],["scrollSync"]],hideModeSwitch:!1,linkAttributes:null,extendedAutolinks:!1,customHTMLRenderer:null,customMarkdownRenderer:null,referenceDefinition:!1,customHTMLSanitizer:null,frontMatter:!1,widgetRules:[],theme:"light",autofocus:!0},e);var a=this.options,s=a.customHTMLRenderer,l=a.extendedAutolinks,u=a.referenceDefinition,c=a.frontMatter,p=a.customMarkdownRenderer,d=a.useCommandShortcut,f=a.initialEditType,h=a.widgetRules,m=a.customHTMLSanitizer;this.mode=f||"markdown",this.mdPreviewStyle=this.options.previewStyle,this.i18n=st,this.i18n.setCode(this.options.language),this.eventEmitter=new s2,(e6=h).forEach(function(e,t){e9["widget"+t]=e});var v=eA(this.options.linkAttributes);this.pluginInfo=lf({plugins:this.options.plugins,eventEmitter:this.eventEmitter,usageStatistics:this.options.usageStatistics,instance:this});var g=this.pluginInfo,y=g.toHTMLRenderers,b=g.toMarkdownRenderers,w=g.mdPlugins,k=g.wwPlugins,C=g.wwNodeViews,x=g.mdCommands,T=g.wwCommands,E=g.markdownParsers,M={linkAttributes:v,customHTMLRenderer:eB(y,s),extendedAutolinks:l,referenceDefinition:u,frontMatter:c,sanitizer:m||am},L=new ly(v,M.customHTMLRenderer),N=(t=M.customHTMLRenderer,n=M.sanitizer,r={nodes:{},marks:{}},["htmlBlock","htmlInline"].forEach(function(e){t[e]&&Object.keys(t[e]).forEach(function(t){ah(t),r["htmlBlock"===e?"nodes":"marks"][t]=aw[e](t,n,L)})}),r);this.toastMark=new ik("",{disallowedHtmlBlockTags:["br","img"],extendedAutolinks:l,referenceDefinition:u,disallowDeepHeading:!0,frontMatter:c,customParser:E}),this.mdEditor=new n5(this.eventEmitter,{toastMark:this.toastMark,useCommandShortcut:d,mdPlugins:w}),this.preview=new aI(this.eventEmitter,X(X({},M),{isViewer:!1,highlight:this.options.previewHighlight})),this.wwEditor=new sJ(this.eventEmitter,{toDOMAdaptor:L,useCommandShortcut:d,htmlSchemaMap:N,linkAttributes:v,wwPlugins:k,wwNodeViews:C}),this.convertor=new ld(this.wwEditor.getSchema(),X(X({},b),p),ax(v,M.customHTMLRenderer),this.eventEmitter),this.setMinHeight(this.options.minHeight),this.setHeight(this.options.height),this.setMarkdown(this.options.initialValue,!1),this.options.placeholder&&this.setPlaceholder(this.options.placeholder),this.options.initialValue||this.setHTML(this.initialHTML,!1),this.commandManager=new s3(this.eventEmitter,this.mdEditor.commands,this.wwEditor.commands,function(){return i.mode}),this.options.usageStatistics&&em("editor","UA-129966929-1"),this.scrollSync=new lC(this.mdEditor,this.preview,this.eventEmitter),this.addInitEvent(),this.addInitCommand(x,T),o=this,o.eventEmitter.listen("query",function(e,t){return lx[e](o,t)}),this.options.hooks&&J(this.options.hooks,function(e,t){return i.addHook(t,e)}),this.options.events&&J(this.options.events,function(e,t){return i.on(t,e)}),this.eventEmitter.emit("load",this),this.moveCursorToStart(this.options.autofocus)}return e.prototype.addInitEvent=function(){var e=this;this.on("needChangeMode",this.changeMode.bind(this)),this.on("loadUI",function(){if("auto"!==e.height){var t=Math.min(parseInt(e.minHeight,10),parseInt(e.height,10)-75)+"px";e.setMinHeight(t)}}),this.eventEmitter.listen("addImageBlobHook",function(e,t){var n=new FileReader;n.onload=function(e){return t(e.target.result)},n.readAsDataURL(e)})},e.prototype.addInitCommand=function(e,t){var n=this,r=function(e,t){Object.keys(t).forEach(function(r){n.addCommand(e,r,t[r])})};this.addCommand("markdown","toggleScrollSync",function(e){return n.eventEmitter.emit("toggleScrollSync",e.active),!0}),r("markdown",e),r("wysiwyg",t)},e.prototype.getCurrentModeEditor=function(){return this.isMarkdownMode()?this.mdEditor:this.wwEditor},e.factory=function(t){return t.viewer?new lh(t):new e(t)},e.setLanguage=function(e,t){st.setLanguage(e,t)},e.prototype.changePreviewStyle=function(e){this.mdPreviewStyle!==e&&(this.mdPreviewStyle=e,this.eventEmitter.emit("changePreviewStyle",e))},e.prototype.exec=function(e,t){this.commandManager.exec(e,t)},e.prototype.addCommand=function(e,t,n){var r=this;this.commandManager.addCommand(e,t,function(t){void 0===t&&(t={});var o=("markdown"===e?r.mdEditor:r.wwEditor).view;n(t,o.state,o.dispatch,o)})},e.prototype.on=function(e,t){this.eventEmitter.listen(e,t)},e.prototype.off=function(e){this.eventEmitter.removeEventHandler(e)},e.prototype.addHook=function(e,t){this.eventEmitter.removeEventHandler(e),this.eventEmitter.listen(e,t)},e.prototype.removeHook=function(e){this.eventEmitter.removeEventHandler(e)}
1,e.prototype.focus=function(){this.getCurrentModeEditor().focus()},e.prototype.blur=function(){this.getCurrentModeEditor().blur()},e.prototype.moveCursorToEnd=function(e){void 0===e&&(e=!0),this.getCurrentModeEditor().moveCursorToEnd(e)},e.prototype.moveCursorToStart=function(e){void 0===e&&(e=!0),this.getCurrentModeEditor().moveCursorToStart(e)},e.prototype.setMarkdown=function(e,t){if(void 0===e&&(e=""),void 0===t&&(t=!0),this.mdEditor.setMarkdown(e,t),this.isWysiwygMode()){var n=this.toastMark.getRootNode(),r=this.convertor.toWysiwygModel(n);this.wwEditor.setModel(r,t)}},e.prototype.setHTML=function(e,t){void 0===e&&(e=""),void 0===t&&(t=!0);var n,r,o,i=document.createElement("div");n=e.replace(/<p><br\s*\/*><\/p>/gi,"<p></p>"),r=RegExp(td,"ig"),null==(o=n.match(r))||o.forEach(function(e,t){if(th.test(e)){var r=tv;if(t){var i=o[t-1].match(tp);if(i&&!/br/i.test(i[1])){var a=i[1];r="</"+a+"><"+a+">"}}n=n.replace(th,r)}}),i.innerHTML=n;var a=_.S4.fromSchema(this.wwEditor.schema).parse(i);this.isMarkdownMode()?this.mdEditor.setMarkdown(this.convertor.toMarkdownText(a),t):this.wwEditor.setModel(a,t)},e.prototype.getMarkdown=function(){return this.isMarkdownMode()?this.mdEditor.getMarkdown():this.convertor.toMarkdownText(this.wwEditor.getModel())},e.prototype.getHTML=function(){var e=this;this.eventEmitter.holdEventInvoke(function(){if(e.isMarkdownMode()){var t=e.toastMark.getRootNode(),n=e.convertor.toWysiwygModel(t);e.wwEditor.setModel(n)}});var t=tS(this.wwEditor.view.dom.innerHTML);if(this.placeholder){var n=RegExp('<span class="placeholder[^>]+>'+this.placeholder+"</span>","i");return t.replace(n,"")}return t},e.prototype.insertText=function(e){this.getCurrentModeEditor().replaceSelection(e)},e.prototype.setSelection=function(e,t){this.getCurrentModeEditor().setSelection(e,t)},e.prototype.replaceSelection=function(e,t,n){this.getCurrentModeEditor().replaceSelection(e,t,n)},e.prototype.deleteSelection=function(e,t){this.getCurrentModeEditor().deleteSelection(e,t)},e.prototype.getSelectedText=function(e,t){return this.getCurrentModeEditor().getSelectedText(e,t)},e.prototype.getRangeInfoOfNode=function(e){return this.getCurrentModeEditor().getRangeInfoOfNode(e)},e.prototype.addWidget=function(e,t,n){this.getCurrentModeEditor().addWidget(e,t,n)},e.prototype.replaceWithWidget=function(e,t,n){this.getCurrentModeEditor().replaceWithWidget(e,t,n)},e.prototype.setHeight=function(e){var t=this.options.el;et(e)&&("auto"===e?ec(t,"auto-height"):ep(t,"auto-height"),this.setMinHeight(this.getMinHeight())),ei(t,{height:e}),this.height=e},e.prototype.getHeight=function(){return this.height},e.prototype.setMinHeight=function(e){if(e!==this.minHeight){var t=this.height||this.options.height;"auto"!==t&&this.options.el.querySelector("."+tb("main"))&&(e=Math.min(parseInt(e,10),parseInt(t,10)-75)+"px");var n=parseInt(e,10);this.minHeight=e,this.wwEditor.setMinHeight(n),this.mdEditor.setMinHeight(n),this.preview.setMinHeight(n)}},e.prototype.getMinHeight=function(){return this.minHeight},e.prototype.isMarkdownMode=function(){return"markdown"===this.mode},e.prototype.isWysiwygMode=function(){return"wysiwyg"===this.mode},e.prototype.isViewer=function(){return!1},e.prototype.getCurrentPreviewStyle=function(){return this.mdPreviewStyle},e.prototype.changeMode=function(e,t){if(this.mode!==e){if(this.mode=e,this.isWysiwygMode()){var n=this.toastMark.getRootNode(),r=this.convertor.toWysiwygModel(n);this.wwEditor.setModel(r)}else{var r=this.wwEditor.getModel();this.mdEditor.setMarkdown(this.convertor.toMarkdownText(r),!t)}if(this.eventEmitter.emit("removePopupWidget"),this.eventEmitter.emit("changeMode",e),!t){var o=this.convertor.getMappedPos();this.focus(),this.isWysiwygMode()&&ed(o)?this.wwEditor.setSelection(o):Array.isArray(o)&&this.mdEditor.setSelection(o)}}},e.prototype.destroy=function(){var e=this;this.wwEditor.destroy(),this.mdEditor.destroy(),this.preview.destroy(),this.scrollSync.destroy(),this.eventEmitter.emit("destroy"),this.eventEmitter.getEvents().forEach(function(t,n){return e.off(n)})},e.prototype.hide=function(){this.eventEmitter.emit("hide")},e.prototype.show=function(){this.eventEmitter.emit("show")},e.prototype.setScrollTop=function(e){this.getCurrentModeEditor().setScrollTop(e)},e.prototype.getScrollTop=function(){return this.getCurrentModeEditor().getScrollTop()},e.prototype.reset=function(){this.wwEditor.setModel([]),this.mdEditor.setMarkdown("")},e.prototype.getSelection=function(){return this.getCurrentModeEditor().getSelection()},e.prototype.setPlaceholder=function(e){this.placeholder=e,this.mdEditor.setPlaceholder(e),this.wwEditor.setPlaceholder(e)},e.prototype.getEditorElements=function(){return{mdEditor:this.mdEditor.getElement(),mdPreview:this.preview.getElement(),wwEditor:this.wwEditor.getElement()}},e.prototype.convertPosToMatchEditorMode=function(e,t,n){void 0===t&&(t=e),void 0===n&&(n=this.mode);var r,o,i=this.mdEditor.view.state.doc,a=Array.isArray(e),s=Array.isArray(t),l=e,u=t;if(a!==s)throw Error("Types of arguments must be same");return"markdown"!==n||a||s?"wysiwyg"===n&&a&&s&&(l=(o=tK(i,e,t))[0],u=o[1]):(l=(r=tW(i,e,t))[0],u=r[1]),[l,u]},e}(),lE=function(){function e(e){this.current=e,this.root=e,this.entering=!0}return e.prototype.walk=function(){var e=this.entering,t=this.current;return t?(e?t.firstChild?(this.current=t.firstChild,this.entering=!0):this.entering=!1:t===this.root?this.current=null:t.next?(this.current=t.next,this.entering=!0):(this.current=t.parent,this.entering=!1),{vnode:t,entering:e}):null},e}(),lM=function(){function e(e,t,n){this.parent=null,this.old=null,this.firstChild=null,this.next=null,this.skip=!1,this.type=e,this.props=t,this.children=n,this.props.children=n,t.ref&&(this.ref=t.ref,delete t.ref),t.key&&(this.key=t.key,delete t.key)}return e.prototype.walker=function(){return new lE(this)},e.removalNodes=[],e}();function lL(e,t){var n=e;"boolean"==typeof e||e instanceof Boolean||null==e?n=null:(et(e)||ed(e))&&(n=new lM("TEXT_NODE",{nodeValue:String(e)},[])),n&&t.push(n)}var lN=(function(e){for(var t,n,r=arguments,o=1,i="",a="",s=[0],l=function(e){1===o&&(e||(i=i.replace(/^\s*\n\s*|\s*\n\s*$/g,"")))?s.push(e?r[e]:i):3===o&&(e||i)?(s[1]=e?r[e]:i,o=2):2===o&&"..."===i&&e?s[2]=e_(s[2]||{}
1,r[e]):2===o&&i&&!e?(s[2]=s[2]||{})[i]=!0:o>=5&&(5===o?((s[2]=s[2]||{})[n]=e?i?i+r[e]:r[e]:i,o=6):(e||i)&&(s[2][n]+=e?i+r[e]:i)),i=""},u=0;u<e.length;u++){u&&(1===o&&l(),l(u));for(let r=0;r<e[u].length;r++)t=e[u][r],1===o?"<"===t?(l(),s=[s,"",null],o=3):i+=t:4===o?"--"===i&&">"===t?(o=1,i=""):i=t+i[0]:a?t===a?a="":i+=t:'"'===t||"'"===t?a=t:">"===t?(l(),o=1):o&&("="===t?(o=5,n=i,i=""):"/"===t&&(o<5||">"===e[u][r+1])?(l(),3===o&&(s=s[0]),o=s,(s=s[0]).push(this.apply(null,o.slice(1))),o=0):" "===t||"	"===t||"\n"===t||"\r"===t?(l(),o=2):i+=t),3===o&&"!--"===i&&(o=4,s=s[0])}return l(),s.length>2?s.slice(1):s[1]}).bind(function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var o=[];return n.forEach(function(e){Array.isArray(e)?e.forEach(function(e){lL(e,o)}):lL(e,o)}),new lM(e,t||{},o)}),lS=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i;function lA(e,t,n,r){Object.keys(n).forEach(function(o){if(!r||r(o))if(/^on/.test(o)){var i,a,s,l,u=o.slice(2).toLowerCase();e.addEventListener(u,n[o])}else if("nodeValue"===o)e[o]=n[o];else if("style"===o&&(l=n[o])===Object(l)){i=e,a=t[o],s=n[o],a&&Object.keys(a).forEach(function(e){i.style[e]=""}),Object.keys(s).forEach(function(e){var t=s[e];i.style[e]=ed(t)&&!lS.test(e)?t+"px":t})}else"children"!==o&&(!1===n[o]?e.removeAttribute(o):e.setAttribute(o,n[o]))})}function lD(e){if(lM.removalNodes.forEach(function(e){return lO(e)}),e){for(var t=void 0,n=e.walker();t=n.walk();)if(e=t.vnode,t.entering)lO(e);else if(tq(e.type)){var r=e.component;if(!e.old&&r.mounted&&r.mounted(),e.old&&r.updated){var o=r.prevProps||{};r.updated(o)}}}}function lI(e){for(var t=e.parent;!t.node;)t=t.parent;return t.node}function lO(e){if(e&&e.parent){if(e.node){var t,n,r,o=lI(e);"A"===e.effect?o.appendChild(e.node):"U"===e.effect&&(t=e.node,n=e.old.props,r=e.props,Object.keys(n).forEach(function(e){if(/^on/.test(e)){if(!r[e]||n[e]!==r[e]){var o=e.slice(2).toLowerCase();t.removeEventListener(o,n[e])}}else"children"===e||r[e]||(null==t?void 0:t.nodeType)===Node.TEXT_NODE||t.removeAttribute(e)}),lA(t,n,r,function(e){return!eR(n[e],r[e])}))}if("D"===e.effect){for(var i=void 0,a=e.walker();i=a.walk();)if(e=i.vnode,!i.entering)if(tq(e.type)){var s=e.component;s.beforeDestroy&&s.beforeDestroy()}else{var o=lI(e);!function e(t,n){t.node?n.removeChild(t.node):e(t.firstChild,n)}(e,o)}}e.ref&&(e.component?e.ref(e.component):e.node&&e.ref(e.node))}}function lR(e){for(var t=e;e&&!e.skip;){if(tq(e.type)){var n=function(e,t){var n=t.props,r=t.component;return r?(r.prevProps=r.props,r.props=t.props,r):new e(n)}(e.type,e);n.vnode=e,e.component=n,e.props.children=e.children=[n.render()],lP(e)}else e.node||(e.node=function(e){var t;return"TEXT_NODE"===e.type?t=document.createTextNode(e.props.nodeValue):lA(t=document.createElement(e.type),{},e.props),t}(e)),lP(e);if(e.firstChild)e=e.firstChild;else{for(;e&&e.parent&&!e.next&&(e=e.parent)!==t;);e=e.next}}}function lP(e){var t=e.children,n=e.old?e.old.firstChild:null,r=null;t.forEach(function(t,o){var i,a=(i=n)&&t&&t.type===i.type&&(!t.key||t.key===i.key);a&&(t.old=n,t.parent=e,t.node=n.node,t.component=n.component,t.effect="U"),t&&!a&&(t.old=null,t.parent=e,t.node=null,t.effect="A"),n&&!a&&
1(lM.removalNodes.push(n),n.effect="D"),n&&(n=n.next),0===o?e.firstChild=t:t&&(r.next=t),r=t});var o=eP(t);if(!t.length)for(;n;)lM.removalNodes.push(n),n.effect="D",n=n.next;for(;n&&o;)n&&o.old!==n&&(lM.removalNodes.push(n),n.effect="D",n=n.next)}var lH=function(){function e(e){this.props=e,this.state={},this.refs={}}return e.prototype.setState=function(e){var t,n=X(X({},this.state),e);!eR(this.state,n)&&(this.state=n,(t=this.vnode).effect="U",t.old=t,t.next&&(t.next.skip=!0),lM.removalNodes=[],lR(t),lD(t),t.next&&(t.next.skip=!1))},e}(),lB=function(e){function t(t){var n=e.call(this,t)||this;return n.state={hide:!1},n}return Z(t,e),t.prototype.show=function(){this.setState({hide:!1})},t.prototype.hide=function(){this.setState({hide:!0})},t.prototype.render=function(){var e=this.props,t=e.editorType,n=e.eventEmitter;return lN(s||(s=Y(['\n      <div class="','" style="display: ','">\n        <div\n          class="tab-item','"\n          onClick=',"\n        >\n          ",'\n        </div>\n        <div\n          class="tab-item','"\n          onClick=',"\n        >\n          ","\n        </div>\n      </div>\n    "],['\n      <div class="','" style="display: ','">\n        <div\n          class="tab-item','"\n          onClick=',"\n        >\n          ",'\n        </div>\n        <div\n          class="tab-item','"\n          onClick=',"\n        >\n          ","\n        </div>\n      </div>\n    "])),tb("mode-switch"),this.state.hide?"none":"block","markdown"===t?" active":"",function(){n.emit("needChangeMode","markdown")},st.get("Markdown"),"wysiwyg"===t?" active":"",function(){n.emit("needChangeMode","wysiwyg")},st.get("WYSIWYG"))},t}(lH),lF=function(e,t){var n,r;return t=t||0,function(){r=Array.prototype.slice.call(arguments),window.clearTimeout(n),n=window.setTimeout(function(){e.apply(null,r)},t)}},lq=function(e,t){var n,r,o,i,a=!0,s=function(t){e.apply(null,t),n=null};function l(){if(i=Array.prototype.slice.call(arguments),a){s(i),a=!1;return}o=Number(new Date),n=n||o,r(i),o-n>=t&&s(i)}return r=lF(s,t=t||0),l.reset=function(){a=!0,n=null},l},l_=function(){if("undefined"!=typeof Map)return Map;function e(e,t){var n=-1;return e.some(function(e,r){return e[0]===t&&(n=r,!0)}),n}function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(t){var n=e(this.__entries__,t),r=this.__entries__[n];return r&&r[1]},t.prototype.set=function(t,n){var r=e(this.__entries__,t);~r?this.__entries__[r][1]=n:this.__entries__.push([t,n])},t.prototype.delete=function(t){var n=this.__entries__,r=e(n,t);~r&&n.splice(r,1)},t.prototype.has=function(t){return!!~e(this.__entries__,t)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(e,t){void 0===t&&(t=null);for(var n=0,r=this.__entries__;n<r.length;n++){var o=r[n];e.call(t,o[1],o[0])}},t}(),lj="undefined"!=typeof window&&"undefined"!=typeof document&&window.document===document,lz=void 0!==n.g&&n.g.Math===Math?n.g:"undefined"!=typeof self&&self.Math===Math?self:"undefined"!=typeof window&&window.Math===Math?window:Function("return this")(),lU="function"==typeof requestAnimationFrame?requestAnimationFrame.bind(lz):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)},lV=["top","right","bottom","left","width","height","size","weight"],l$="undefined"!=typeof MutationObserver,lW=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(e,t){var n=!1,r=!1,o=0;function i(){n&&(n=!1,e()),r&&s()}function a(){lU(i)}function s(){var e=Date.now();if(n){if(e-o<2)return;r=!0}else n=!0,r=!1,setTimeout(a,20);o=e}return s}(this.refresh.bind(this),0)}return e.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},e.prototype.removeObserver=function(e){var t=this.observers_,n=t.indexOf(e);~n&&t.splice(n,1),!t.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},e.prototype.updateObservers_=function(){var e=this.observers_.filter(function(e){return e.gatherActive(),e.hasActive()});return e.forEach(function(e){return e.broadcastActive()}),e.length>0},e.prototype.connect_=function(){lj&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),l$?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){lj&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(e){var t=e.propertyName,n=void 0===t?"":t;lV.some(function(e){return!!~n.indexOf(e)})&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=ne
1w e),this.instance_},e.instance_=null,e}(),lG=function(e,t){for(var n=0,r=Object.keys(t);n<r.length;n++){var o=r[n];Object.defineProperty(e,o,{value:t[o],enumerable:!1,writable:!1,configurable:!0})}return e},lK=function(e){return e&&e.ownerDocument&&e.ownerDocument.defaultView||lz},lZ=lJ(0,0,0,0);function lX(e){return parseFloat(e)||0}function lQ(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce(function(t,n){return t+lX(e["border-"+n+"-width"])},0)}var lY="undefined"!=typeof SVGGraphicsElement?function(e){return e instanceof lK(e).SVGGraphicsElement}:function(e){return e instanceof lK(e).SVGElement&&"function"==typeof e.getBBox};function lJ(e,t,n,r){return{x:e,y:t,width:n,height:r}}var l0=function(){function e(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=lJ(0,0,0,0),this.target=e}return e.prototype.isActive=function(){var e=function(e){if(!lj)return lZ;if(lY(e)){var t;return lJ(0,0,(t=e.getBBox()).width,t.height)}return function(e){var t,n=e.clientWidth,r=e.clientHeight;if(!n&&!r)return lZ;var o=lK(e).getComputedStyle(e),i=function(e){for(var t={},n=0,r=["top","right","bottom","left"];n<r.length;n++){var o=r[n],i=e["padding-"+o];t[o]=lX(i)}return t}(o),a=i.left+i.right,s=i.top+i.bottom,l=lX(o.width),u=lX(o.height);if("border-box"===o.boxSizing&&(Math.round(l+a)!==n&&(l-=lQ(o,"left","right")+a),Math.round(u+s)!==r&&(u-=lQ(o,"top","bottom")+s)),(t=e)!==lK(t).document.documentElement){var c=Math.round(l+a)-n,p=Math.round(u+s)-r;1!==Math.abs(c)&&(l-=c),1!==Math.abs(p)&&(u-=p)}return lJ(i.left,i.top,l,u)}(e)}(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e},e}(),l1=function(e,t){var n,r,o,i,a,s=(n=t.x,r=t.y,o=t.width,i=t.height,lG(a=Object.create(("undefined"!=typeof DOMRectReadOnly?DOMRectReadOnly:Object).prototype),{x:n,y:r,width:o,height:i,top:r,right:n+o,bottom:i+r,left:n}),a);lG(this,{target:e,contentRect:s})},l2=function(){function e(e,t,n){if(this.activeObservations_=[],this.observations_=new l_,"function"!=typeof e)throw TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=t,this.callbackCtx_=n}return e.prototype.observe=function(e){if(!arguments.length)throw TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof lK(e).Element))throw TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new l0(e)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(e){if(!arguments.length)throw TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof lK(e).Element))throw TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)&&(t.delete(e),t.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach(function(t){t.isActive()&&e.activeObservations_.push(t)})},e.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map(function(e){return new l1(e.target,e.broadcastRect())});this.callback_.call(e,t,e),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),l3="undefined"!=typeof WeakMap?new WeakMap:new l_,l5=function e(t){if(!(this instanceof e))throw TypeError("Cannot call a class as a function.");if(!arguments.length)throw TypeError("1 argument required, but only 0 present.");var n=new l2(t,lW.getInstance(),this);l3.set(this,n)};["observe","unobserve","disconnect"].forEach(function(e){l5.prototype[e]=function(){var t;return(t=l3.get(this))[e].apply(t,arguments)}});var l4=void 0!==lz.ResizeObserver?lz.ResizeObserver:l5,l6=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Z(t,e),t.prototype.execCommand=function(e){var t=tM(e.target,"li");this.props.execCommand("heading",{level:Number(t.getAttribute("data-level"))})},t.prototype.render=function(){var e=this;return lN(u||(u=Y(["\n      <ul\n        onClick=",'\n        aria-role="menu"\n        aria-label="','"\n      >\n        ','\n        <li data-type="Paragraph" aria-role="menuitem">\n          <div>',"</div>\n        </li>\n      </ul>\n    "],["\n      <ul\n        onClick=",'\n        aria-role="menu"\n        aria-label="','"\n      >\n        ','\n        <li data-type="Paragraph" aria-role="menuitem">\n          <div>',"</div>\n        </li>\n      </ul>\n    "])),function(t){return e.execCommand(t)},st.get("Headings"),[1,2,3,4,5,6].map(function(e){return lN(l||(l=Y(['\n              <li data-level="','" data-type="Heading" aria-role="menuitem">\n                <',">"," ","</$>\n              </li>\n            "],['\n              <li data-level="','" data-type="Heading" aria-role="menuitem">\n                <',">"," ","</$>\n              </li>\n            "])),e,"h"+e,st.get("Heading"),e)}),st.get("Paragraph"))},t}(lH),l9=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Z(t,e),t.prototype.toggleTab=function(e,t){this.props.onClick(e,t)},t.prototype.render=function(){var e=this;return lN(p||(p=Y(['\n      <div class="','" aria-role="tabpanel">\n        ',"\n      </div>\n    "],['\n      <div class="','" aria-role="tabpanel">\n        ',"\n      </div>\n    "])),tb("tabs"),this.props.tabs.map(function(t){var n=t.name,r=t.text,o=e.props.activeTab===n;return lN(c||(c=Y(['\n            <div\n              class="tab-item','"\n              onClick=','\n              aria-role="tab"\n              aria-label="','"\n              aria-selected="','"\n              tabindex="','"\n            >\n              ',"\n            </div>\n          "],['\n            <div\n              class="tab-item','"\n              onClick=','\n              aria-role="tab"\n              aria-label="','"\n              aria-selected="','"\n              tabindex="','"\n            >\n              ',"\n            </div>\n          "])),o?" active":"",function(t){return e.toggleTab(t,n)},st.get(r),o?"true":"false",o?"0":"-1",st.get(r))}))},t}(lH),l8=function(e){function t(t){var n=e.call(this,t)||this;return n.initialize=function(e){void 0===e&&(e="file");var t=n.refs.url;t.value="",n.refs.altText.value="",n.refs.file.value="",ep(t,"wrong"),n.setState({activeTab:e,file:null,fileNameElClassName:""})},n.execCommand=function(){"file"===n.state.activeTab?n.emitAddImageBlob():n.emitAddImage()},n.toggleTab=function(e,t){t!==n.state.activeTab&&n.initialize(t)},n.showFileSelectBox=function(){n.refs.file.click()},n.changeFile=function(e){var t=e.target.files;(null==t?void 0:t.length)&&n.setState({file:t[0]})},n.state={activeTab:"file",file:null,fileNameElClassName:""},n.tabs=[{name:"file",text:"File"},{name:"url",text:"URL"}],n}return Z(t,e),t.prototype.emitAddImageBlob=function(){var e=this,t=this.refs.file.files,n=this.refs.altText,r=" wrong";if(null==t?void 0:t.length){r="";var o=t.item(0);this.props.eventEmitter.emit("addImageBlobHook",o,function(t,r){return e.props.execCommand("addImage",{imageUrl:t,altText:r||n.value})},"ui")}this.setState({fileNameElClassName:r})},t.prototype.emitAddImage=function(){var e=this.refs.url,t=this.refs.altText,n=e.value,r=t.value||"image";if(ep(e,"wrong"),!n.length)return void ec(e,"wrong");n&&this.props.execCommand("addImage",{imageUrl:n,altText:r})},t.prototype.preventSelectStart=function(e){e.preventDefault()},t.prototype.updated=function(){this.props.show||this.initialize()},t.prototype.render=function(){var e=this,t=this.state,n=t.activeTab,r=t.file,o=t.fileNameElClassName;return lN(d||(d=Y(['\n      <div aria-label="','">\n        <'," tabs="," activeTab="," onClick=",' />\n        <div style="display:','">\n          <label for="toastuiImageUrlInput">','</label>\n          <input\n            id="toastuiImageUrlInput"\n            type="text"\n            ref=','\n          />\n        </div>\n        <div style="display:',';position: relative;">\n          <label for="toastuiImageFileInput">','</label>
1\n          <span\n            class="',"",'"\n            onClick=',"\n            onSelectstart=","\n          >\n            ",'\n          </span>\n          <button\n            type="button"\n            class="','"\n            onClick=',"\n          >\n            ",'\n          </button>\n          <input\n            id="toastuiImageFileInput"\n            type="file"\n            accept="image/*"\n            onChange=',"\n            ref=",'\n          />\n        </div>\n        <label for="toastuiAltTextInput">','</label>\n        <input\n          id="toastuiAltTextInput"\n          type="text"\n          ref=','\n        />\n        <div class="','">\n          <button type="button" class="','" onClick=',">\n            ",'\n          </button>\n          <button type="button" class="','" onClick=',">\n            ","\n          </button>\n        </div>\n      </div>\n    "],['\n      <div aria-label="','">\n        <'," tabs="," activeTab="," onClick=",' />\n        <div style="display:','">\n          <label for="toastuiImageUrlInput">','</label>\n          <input\n            id="toastuiImageUrlInput"\n            type="text"\n            ref=','\n          />\n        </div>\n        <div style="display:',';position: relative;">\n          <label for="toastuiImageFileInput">','</label>\n          <span\n            class="',"",'"\n            onClick=',"\n            onSelectstart=","\n          >\n            ",'\n          </span>\n          <button\n            type="button"\n            class="','"\n            onClick=',"\n          >\n            ",'\n          </button>\n          <input\n            id="toastuiImageFileInput"\n            type="file"\n            accept="image/*"\n            onChange=',"\n            ref=",'\n          />\n        </div>\n        <label for="toastuiAltTextInput">','</label>\n        <input\n          id="toastuiAltTextInput"\n          type="text"\n          ref=','\n        />\n        <div class="','">\n          <button type="button" class="','" onClick=',">\n            ",'\n          </button>\n          <button type="button" class="','" onClick=',">\n            ","\n          </button>\n        </div>\n      </div>\n    "])),st.get("Insert image"),l9,this.tabs,n,this.toggleTab,"url"===n?"block":"none",st.get("Image URL"),function(t){return e.refs.url=t},"file"===n?"block":"none",st.get("Select image file"),tb("file-name"),r?" has-file":o,this.showFileSelectBox,this.preventSelectStart,r?r.name:st.get("No file"),tb("file-select-button"),this.showFileSelectBox,st.get("Choose a file"),this.changeFile,function(t){return e.refs.file=t},st.get("Description"),function(t){return e.refs.altText=t},tb("button-container"),tb("close-button"),this.props.hidePopup,st.get("Cancel"),tb("ok-button"),this.execCommand,st.get("OK"))},t}(lH),l7=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.execCommand=function(){var e=t.refs.url,n=t.refs.text;return(ep(e,"wrong"),ep(n,"wrong"),e.value.length<1)?void ec(e,"wrong"):es(t.props.initialValues.linkUrl)&&n.value.length<1?void ec(n,"wrong"):void t.props.execCommand("addLink",{linkUrl:e.value,linkText:n.value})},t}return Z(t,e),t.prototype.initialize=function(){var e=this.props.initialValues,t=e.linkUrl,n=e.linkText,r=this.refs.url,o=this.refs.text;ep(r,"wrong"),ep(o,"wrong","disabled"),o.removeAttribute("disabled"),t&&(ec(o,"disabled"),o.setAttribute("disabled","disabled")),r.value=t||"",o.value=n||""},t.prototype.mounted=function(){this.initialize()},t.prototype.updated=function(e){!e.show&&this.props.show&&this.initialize()},t.prototype.render=function(){var e=this;return lN(f||(f=Y(['\n      <div aria-label="','">\n        <label for="toastuiLinkUrlInput">','</label>\n        <input\n          id="toastuiLinkUrlInput"\n          type="text"\n          ref=','\n        />\n        <label for="toastuiLinkTextInput">','</label>\n        <input\n          id="toastuiLinkTextInput"\n          type="text"\n          ref=','\n        />\n        <div class="','">\n          <button type="button" class="','" onClick=',">\n            ",'\n          </button>\n          <button type="button" class="','" onClick=',">\n            ","\n          </button>\n        </div>\n      </div>\n    "],['\n      <div aria-label="','">\n        <label for="toastuiLinkUrlInput">','</label>\n        <input\n          id="toastuiLinkUrlInput"\n          type="text"\n          ref=','\n        />\n        <label for="toastuiLinkTextInput">','</label>\n        <input\n          id="toastuiLinkTextInput"\n          type="text"\n          ref=','\n        />\n        <div class="','">\n          <button type="button" class="','" onClick=',">\n            ",'\n          </button>\n          <button type="button" class="','" onClick=',">\n            ","\n          </button>\n        </div>\n      </div>\n    "])),st.get("Insert link"),st.get("URL"),function(t){return e.refs.url=t},st.get("Link text"),function(t){return e.refs.text=t},tb("button-container"),tb("close-button"),this.props.hidePopup,st.get("Cancel"),tb("ok-button"),this.execCommand,st.get("OK"))},t}(lH),ue=function(e){function t(t){var n=e.call(this,t)||this;return n.extendSelectionRange=function(e){var t=e.pageX,r=e.pageY,o=t-n.offsetRect.left,i=r-n.offsetRect.top,a=n.get
1SelectionRangeByOffset(o,i);n.setState(X({},a))},n.execCommand=function(){n.props.execCommand("addTable",{rowCount:n.state.rowIdx+1,columnCount:n.state.colIdx+1})},n.state={rowIdx:-1,colIdx:-1},n}return Z(t,e),t.prototype.getDescription=function(){return -1===this.state.colIdx?"":this.state.colIdx+1+" x "+(this.state.rowIdx+1)},t.prototype.getBoundByRange=function(e,t){return{width:(e+1)*20,height:(t+1)*20}},t.prototype.getRangeByOffset=function(e,t){return{colIdx:Math.floor(e/20),rowIdx:Math.floor(t/20)}},t.prototype.getTableRange=function(){var e=this.state,t=e.colIdx,n=e.rowIdx,r=Math.max(t,5),o=Math.max(n,5);return t>=5&&r<9&&(r+=1),n>=5&&o<14&&(o+=1),{colIdx:r+1,rowIdx:o+1}},t.prototype.getSelectionAreaBound=function(){var e=this.getBoundByRange(this.state.colIdx,this.state.rowIdx),t=e.width,n=e.height;return t||n?{width:t-1,height:n-1,display:"block"}:{display:"none"}},t.prototype.getSelectionRangeByOffset=function(e,t){var n=this.getRangeByOffset(e,t);return n.rowIdx=Math.min(Math.max(n.rowIdx,1),14),n.colIdx=Math.min(Math.max(n.colIdx,1),9),n},t.prototype.updated=function(){if(this.props.show){if(-1===this.state.colIdx&&-1===this.state.rowIdx){var e=this.refs.tableEl.getBoundingClientRect(),t=e.left,n=e.top;this.offsetRect={left:window.pageXOffset+t,top:window.pageYOffset+n}}}else this.setState({colIdx:-1,rowIdx:-1})},t.prototype.createTableArea=function(e){for(var t=e.colIdx,n=e.rowIdx,r=[],o=0;o<n;o+=1){for(var i=[],a=0;a<t;a+=1){var s=""+tb("table-cell")+(o>0?"":" header");i.push(lN(h||(h=Y(['<div class="','"></div>'],['<div class="','"></div>'])),s))}r.push(lN(m||(m=Y(['<div class="','">',"</div>"],['<div class="','">',"</div>"])),tb("table-row"),i))}return lN(v||(v=Y(['<div class="','">',"</div>"],['<div class="','">',"</div>"])),tb("table"),r)},t.prototype.render=function(){var e=this,t=this.getTableRange(),n=this.getSelectionAreaBound();return lN(g||(g=Y(['\n      <div aria-label="','">\n        <div\n          class="','"\n          ref=',"\n          onMousemove=","\n          onClick=","\n        >\n          ",'\n          <div class="','" style=','></div>\n        </div>\n        <p class="','">',"</p>\n      </div>\n    "],['\n      <div aria-label="','">\n        <div\n          class="','"\n          ref=',"\n          onMousemove=","\n          onClick=","\n        >\n          ",'\n          <div class="','" style=','></div>\n        </div>\n        <p class="','">',"</p>\n      </div>\n    "])),st.get("Insert table"),tb("table-selection"),function(t){return e.refs.tableEl=t},this.extendSelectionRange,this.execCommand,this.createTableArea(t),tb("table-selection-layer"),n,tb("table-description"),this.getDescription())},t}(lH),ut=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Z(t,e),t.prototype.mounted=function(){this.refs.el.appendChild(this.props.body)},t.prototype.updated=function(e){this.refs.el.replaceChild(this.props.body,e.body)},t.prototype.render=function(){var e=this;return lN(y||(y=Y(["<div ref=","></div>"],["<div ref=","></div>"])),function(t){return e.refs.el=t})},t}(lH);function un(e){return et(e)?function(e){var t,n,r,o;switch(e){case"heading":t={name:"heading",className:"heading",tooltip:st.get("Headings"),state:"heading"};break;case"bold":t={name:"bold",className:"bold",command:"bold",tooltip:st.get("Bold"),state:"strong"};break;case"italic":t={name:"italic",className:"italic",command:"italic",tooltip:st.get("Italic"),state:"emph"};break;case"strike":t={name:"strike",className:"strike",command:"strike",tooltip:st.get("Strike"),state:"strike"};break;case"hr":t={name:"hr",className:"hrline",command:"hr",tooltip:st.get("Line"),state:"thematicBreak"};break;case"quote":t={name:"quote",className:"quote",command:"blockQuote",tooltip:st.get("Blockquote"),state:"blockQuote"};break;case"ul":t={name:"ul",className:"bullet-list",command:"bulletList",tooltip:st.get("Unordered list"),state:"bulletList"};break;case"ol":t={name:"ol",className:"ordered-list",command:"orderedList",tooltip:st.get("Ordered list"),state:"orderedList"};break;case"task":t={name:"task",className:"task-list",command:"taskList",tooltip:st.get("Task"),state:"taskList"};break;case"table":t={name:"table",className:"table",tooltip:st.get("Insert table"),state:"table"};break;case"image":t={name:"image",className:"image",tooltip:st.get("Insert image")};break;case"link":t={name:"link",className:"link",tooltip:st.get("Insert link")};break;case"code":t={name:"code",className:"code",command:"code",tooltip:st.get("Code"),state:"co
1de"};break;case"codeblock":t={name:"codeblock",className:"codeblock",command:"codeBlock",tooltip:st.get("Insert CodeBlock"),state:"codeBlock"};break;case"indent":t={name:"indent",className:"indent",command:"indent",tooltip:st.get("Indent"),state:"indent"};break;case"outdent":t={name:"outdent",className:"outdent",command:"outdent",tooltip:st.get("Outdent"),state:"outdent"};break;case"scrollSync":n=document.createElement("label"),r=document.createElement("input"),o=document.createElement("span"),n.className="scroll-sync active",r.type="checkbox",r.checked=!0,o.className="switch",n.appendChild(r),n.appendChild(o),t={name:"scrollSync",el:n,onMounted:function(e){return r.addEventListener("change",function(t){var r=t.target.checked;r?ec(n,"active"):ep(n,"active"),e("toggleScrollSync",{active:r})})}};break;case"more":t={name:"more",className:"more",tooltip:st.get("More")}}return"scrollSync"!==t.name&&(t.className+=" "+tb("toolbar-icons")),t}(e):e}function ur(e,t){var n=t.el,r=t.pos,o=t.popup,i=t.initialValues;switch(e){case"heading":return{render:function(e){return lN(b||(b=Y(["<"," ..."," />"],["<"," ..."," />"])),l6,e)},className:tb("popup-add-heading"),fromEl:n,pos:r};case"link":return{render:function(e){return lN(w||(w=Y(["<"," ..."," />"],["<"," ..."," />"])),l7,e)},className:tb("popup-add-link"),fromEl:n,pos:r,initialValues:i};case"image":return{render:function(e){return lN(k||(k=Y(["<"," ..."," />"],["<"," ..."," />"])),l8,e)},className:tb("popup-add-image"),fromEl:n,pos:r};case"table":return{render:function(e){return lN(C||(C=Y(["<"," ..."," />"],["<"," ..."," />"])),ue,e)},className:tb("popup-add-table"),fromEl:n,pos:r};case"customPopupBody":if(!o)return null;return X({render:function(e){return lN(x||(x=Y(["<"," ..."," body="," />"],["<"," ..."," body="," />"])),ut,e,o.body)},fromEl:n,pos:r},o);default:return null}}function uo(e){e.hidden=e.length===e.filter(function(e){return e.hidden}).length}var ui=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.handleMousedown=function(e){tM(e.target,"."+tb("popup"))||tM(e.target,t.props.info.fromEl)||t.props.hidePopup()},t}return Z(t,e),t.prototype.mounted=function(){document.addEventListener("mousedown",this.handleMousedown),this.props.eventEmitter.listen("closePopup",this.props.hidePopup)},t.prototype.beforeDestroy=function(){document.removeEventListener("mousedown",this.handleMousedown)},t.prototype.updated=function(e){var t=this.props,n=t.show,r=t.info;if(n&&r.pos&&e.show!==n){var o=X({},r.pos),i=this.refs.el.offsetWidth,a=tM(this.refs.el,"."+tb("toolbar")).offsetWidth;o.left+i>=a&&(o.left=a-i-20),eR(this.state.popupPos,o)||this.setState({popupPos:o})}},t.prototype.render=function(){var e=this,t=this.props,n=t.info,r=t.show,o=t.hidePopup,i=t.eventEmitter,a=t.execCommand,s=n||{},l=s.className,u=s.style,c=s.render,p=s.initialValues,d=X(X({display:r?"block":"none"},u),this.state.popupPos);return lN(T||(T=Y(['\n      <div\n        class="'," ",'"\n        style=',"\n        ref=",'\n        aria-role="dialog"\n      >\n        <div class="','">\n          ',"\n        </div>\n      </div>\n    "],['\n      <div\n        class="'," ",'"\n        style=',"\n        ref=",'\n        aria-role="dialog"\n      >\n        <div class="','">\n          ',"\n        </div>\n      </div>\n    "])),tb("popup"),void 0===l?"":l,d,function(t){return e.refs.el=t},tb("popup-body"),c&&c({eventEmitter:i,show:r,hidePopup:o,execCommand:a,initialValues:void 0===p?{}:p}))},t}(lH);function ua(e){function t(e){var t=lH.call(this,e)||this;return t.showTooltip=function(e){var n=t.props.item.tooltip;if(!t.props.disabled&&n){var r=t.getBound(e),o=r.left+6+"px",i=r.top+6+"px";ei(t.props.tooltipRef.current,{display:"block",left:o,top:i}),t.props.tooltipRef.current.querySelector(".text").textContent=n}},t.hideTooltip=function(){ei(t.props.tooltipRef.current,"display","none")},t.state={active:!1,disabled:e.disabled},t.addEvent(),t}return Z(t,lH),t.prototype.addEvent=function(){var e=this,t=this.props,n=t.item,r=t.eventEmitter;n.state&&r.listen("changeToolbarState",function(t){var r,o=null!=(r=t.toolbarState[n.state])?r:{},i=o.active,a=o.disabled;e.setState({active:!!i,disabled:null!=a?a:e.props.disabled})})},t.prototype.getBound=function(e){var t=tL(e,tM(e,"."+tb("toolbar"))),n=t.offsetLeft,r=t.offsetTop;return{left:n,top:e.offsetHeight+r}},t.prototype.render=function(){return lN(E||(E=Y(["\n        <","\n          ...","\n          active=","\n          showTooltip=","\n          hideTooltip=","\n          getBound=","\n          disabled=","\n        />\n      "],["\n        <","\n          ...","\n          active=","\n          showTooltip=","\n          hideTooltip=","\n          getBound=","\n          disabled=","\n        />\n      "])),e,this.props,this.state.active,this.showTooltip,this.hideTooltip,this.getBound,this.state.disabled||this.props.disabled)},t}var us=ua(function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.showTooltip=function(){t.props.showTooltip(t.refs.el)},t.execCommand=function(){var e=t.props,n=e.item,r=e.execCommand,o=e.setPopupInfo,i=e.getBound,a=e.eventEmitter,s=n.command,l=n.name,u=n.popup;
1if(s)r(s);else{var c=u?"customPopupBody":l,p=a.emit("query","getPopupInitialValues",{popupName:c})[0],d=ur(c,{el:t.refs.el,pos:i(t.refs.el),popup:u,initialValues:p});d&&o(d)}},t}return Z(t,e),t.prototype.mounted=function(){this.setItemWidth()},t.prototype.updated=function(e){e.item.name!==this.props.item.name&&this.setItemWidth()},t.prototype.setItemWidth=function(){var e=this.props,t=e.setItemWidth,n=e.item;t&&t(n.name,tE(this.refs.el)+80*!!n.hidden)},t.prototype.render=function(){var e=this,t=this.props,n=t.hideTooltip,r=t.disabled,o=t.item,i=t.active,a=X({display:o.hidden?"none":null},o.style),s=""+(o.className||"")+(i?" active":"");return lN(M||(M=Y(["\n      <button\n        ref=",'\n        type="button"\n        style=',"\n        class=","\n        onClick=","\n        onMouseover=","\n        onMouseout=","\n        disabled=","\n        aria-label=","\n      >\n        ","\n      </button>\n    "],["\n      <button\n        ref=",'\n        type="button"\n        style=',"\n        class=","\n        onClick=","\n        onMouseover=","\n        onMouseout=","\n        disabled=","\n        aria-label=","\n      >\n        ","\n      </button>\n    "])),function(t){return e.refs.el=t},a,s,this.execCommand,this.showTooltip,n,!!r,o.text||o.tooltip||"",o.text||"")},t}(lH)),ul=ua(function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.showTooltip=function(){t.props.showTooltip(t.refs.el)},t.showPopup=function(){var e=ur("customPopupBody",{el:t.refs.el,pos:t.props.getBound(t.refs.el),popup:t.props.item.popup});e&&t.props.setPopupInfo(e)},t}return Z(t,e),t.prototype.mounted=function(){var e=this.props,t=e.setItemWidth,n=e.item;this.refs.el.appendChild(n.el),t&&t(n.name,tE(this.refs.el)),n.onMounted&&n.onMounted(this.props.execCommand)},t.prototype.updated=function(e){var t,n=this.props,r=n.item,o=n.active,i=n.disabled;(e.active!==o||e.disabled!==i)&&(null==(t=r.onUpdated)||t.call(r,{active:o,disabled:i}))},t.prototype.render=function(){var e=this,t=this.props,n=t.disabled,r={display:t.item.hidden?"none":"inline-block"},o=function(e){return n?null:e};return lN(L||(L=Y(["\n      <div\n        ref=","\n        style=","\n        class=","\n        onClick=","\n        onMouseover=","\n        onMouseout=","\n      ></div>\n    "],["\n      <div\n        ref=","\n        style=","\n        class=","\n        onClick=","\n        onMouseover=","\n        onMouseout=","\n      ></div>\n    "])),function(t){return e.refs.el=t},r,tb("toolbar-item-wrapper"),o(this.showPopup),o(this.showTooltip),o(this.props.hideTooltip))},t}(lH)),uu=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Z(t,e),t.prototype.render=function(){var e=this,t=this.props,n=t.group,r=t.hiddenDivider,o=n.hidden?{display:"none"}:null;return lN(S||(S=Y(['\n      <div class="','" style=',">\n        ",'\n        <div class="','" style=',"></div>\n      </div>\n    "],['\n      <div class="','" style=',">\n        ",'\n        <div class="','" style=',"></div>\n      </div>\n    "])),tb("toolbar-group"),o,n.map(function(t){var n=t.el?ul:us;return lN(N||(N=Y(["<"," key="," ..."," item="," />"],["<"," key="," ..."," item="," />"])),n,t.name,e.props,t)}),tb("toolbar-divider"),r?{display:"none"}:null)},t}(lH),uc=ua(function(e){function t(t){var n=e.call(this,t)||this;return n.handleClickDocument=function(e){var t=e.target;tM(t,"."+tb("dropdown-toolbar"))||tM(t,".more")||n.setState({showDropdown:!1,dropdownPos:null})},n.showTooltip=function(){n.props.showTooltip(n.refs.el)},n.state={showDropdown:!1,dropdownPos:null},n}return Z(t,e),t.prototype.getBound=function(){var e=this.props.getBound(this.refs.el);return e.top+=4,X(X({},e),{left:null,right:10})},t.prototype.mounted=function(){document.addEventListener("click",this.handleClickDocument)},t.prototype.updated=function(){this.state.showDropdown&&!this.state.dropdownPos&&this.setState({dropdownPos:this.getBound()})},t.prototype.beforeDestroy=function(){document.removeEventListener("click",this.handleClickDocument)},t.prototype.render=function(){var e=this,t=this.state,n=t.showDropdown,r=t.dropdownPos,o=this.props,i=o.disabled,a=o.item,s=o.items,l=o.hideTooltip,u=s.filter(function(e){return!e.hidden}),c=u.length?null:{display:"none"};return lN(D||(D=Y(['\n      <div class="','" style=',">\n        <button\n          ref=",'\n          type="button"\n          class=',"\n          onClick=","\n          onMouseover=","\n          onMouseout=","\n          disabled=",'\n        ></button>\n        <div\n          class="','"\n          style=',"\n          ref=","\n        >\n          ","\n        </div>\n      </div>\n    "],['\n      <div class="','" style=',">\n        <button\n          ref=",'\n          type="button"\n          class=',"\n          onClick=","\n          onMouseover=","\n          onMouseout=","\n          disabled=",'\n        ></button>\n        <div\n          class="','"\n          style=',"\n          ref=","\n        >\n          ","\n        </div>\n      </div>\n    "])),tb("toolbar-group"),c,function(t){return e.refs.el=t},a.className,function(){return e.setState({showDropdown:!0})},this.showTooltip,l,i,tb("dropdown-toolbar"),X(X({},n?null:{display:"none"}),r),function(t){return e.refs.dropdownEl=t},u.length?u.map(function(t,n){var r;return lN(A||(A=Y(["\n                  <","\n                    group=","\n                    hiddenDivider=","\n                    ...","\n                  />\n                "],["\n                  <","\n                    group=","\n                    hiddenDivider=","\n                    ...","\n                  />
1\n                "])),uu,t,n===u.length-1||(null==(r=u[n+1])?void 0:r.hidden),e.props)}):null)},t}(lH)),up=function(e){function t(t){var n,r,o=e.call(this,t)||this;return o.toggleTab=function(e,t){var n=o.props.eventEmitter;o.state.activeTab!==t&&(n.emit("write"===t?"changePreviewTabWrite":"changePreviewTabPreview"),o.setState({activeTab:t}))},o.setItemWidth=function(e,t){o.itemWidthMap[e]=t},o.setPopupInfo=function(e){o.setState({showPopup:!0,popupInfo:e})},o.openPopup=function(e,t){void 0===t&&(t={});var n=o.refs.el.querySelector("."+tb("toolbar-group")+" ."+e);if(n){var r=tL(n,tM(n,"."+tb("toolbar"))),i=r.offsetLeft,a=r.offsetTop,s=ur(e,{el:n,pos:{left:i,top:n.offsetHeight+a},initialValues:t});s&&o.setPopupInfo(s)}},o.hidePopup=function(){o.state.showPopup&&o.setState({showPopup:!1})},o.execCommand=function(e,t){o.props.eventEmitter.emit("command",e,t),o.hidePopup()},o.tabs=[{name:"write",text:"Write"},{name:"preview",text:"Preview"}],o.itemWidthMap={},n=t.toolbarItems||[],r=o.hiddenScrollSync(),o.initialItems=n.reduce(function(e,t){e.push(t.map(function(e){var t;return(t=un(e)).hidden="scrollSync"===t.name&&r,t}));var n=e[(e.length||1)-1];return n&&uo(n),e},[]),o.state={items:o.initialItems,dropdownItems:[],showPopup:!1,popupInfo:{},activeTab:"write"},o.tooltipRef={current:null},o.resizeObserver=new l4(function(){return o.handleResize()}),o.addEvent(),o}return Z(t,e),t.prototype.insertToolbarItem=function(e,t){var n=e.groupIndex,r=e.itemIndex,o=this.initialItems[n];t=un(t),o?o.splice(r,0,t):this.initialItems.push([t]),this.setState(this.classifyToolbarItems())},t.prototype.removeToolbarItem=function(e){var t=this;er(this.initialItems,function(n){var r=!1;return er(n,function(o,i){return o.name!==e||(r=!0,n.splice(i,1),t.setState(t.classifyToolbarItems()),!1)}),!r})},t.prototype.addEvent=function(){var e=this,t=this.props.eventEmitter;this.handleResize=lq(function(){e.setState({items:e.initialItems,dropdownItems:[]}),e.setState(e.classifyToolbarItems())},200),t.listen("openPopup",this.openPopup)},t.prototype.appendTooltipToRoot=function(){var e='<div class="'+tb("tooltip")+'" style="display:none">\n        <div class="arrow"></div>\n        <span class="text"></span>\n      </div>';this.tooltipRef.current=tT(e,this.refs.el)},t.prototype.hiddenScrollSync=function(){return"wysiwyg"===this.props.editorType||"tab"===this.props.previewStyle},t.prototype.movePrevItemToDropdownToolbar=function(e,t,n,r){var o=function(e){var t=e.pop();t&&r.push(t)};if(e>1)o(n);else{var i=eP(t);i&&o(i)}},t.prototype.classifyToolbarItems=function(){var e=this,t=0,n=this.refs.el.clientWidth,r=this.refs.el.querySelector("."+tb("toolbar-divider")),o=r?tE(r):0,i=[],a=[],s=!1;return this.initialItems.forEach(function(r,l){var u=[],c=[];r.forEach(function(r,o){r.hidden||((t+=e.itemWidthMap[r.name])>n-50?(s||(e.movePrevItemToDropdownToolbar(o,i,u,c),s=!0),c.push(r)):u.push(r))}),u.length&&(uo(u),i.push(u)),c.length&&(uo(c),a.push(c)),l<e.state.items.length-1&&(t+=o)}),{items:i,dropdownItems:a}},t.prototype.mounted=function(){"tab"===this.props.previewStyle&&this.props.eventEmitter.emit("changePreviewTabWrite",!0),this.setState(this.classifyToolbarItems()),this.appendTooltipToRoot(),this.resizeObserver.observe(this.refs.el)},t.prototype.updated=function(e){var t=this.props,n=t.editorType,r=t.previewStyle,o=t.eventEmitter,i=r!==e.previewStyle,a=n!==e.editorType;if(i||a){s=this.initialItems,l=this.hiddenScrollSync(),s.forEach(function(e){e.forEach(function(e){return e.hidden="scrollSync"===e.name&&l}),uo(e)});var s,l,u=this.classifyToolbarItems();(i||"tab"===r&&"markdown"===n)&&(o.emit("changePreviewTabWrite"),u.activeTab="write"),this.setState(u)}},t.prototype.beforeDestroy=function(){window.removeEventListener("resize",this.handleResize),this.resizeObserver.disconnect(),tC(this.tooltipRef.current)},t.prototype.render=function(){var e=this,t=this.props,n=t.previewStyle,r=t.eventEmitter,o=t.editorType,i=this.state,a=i.popupInfo,s=i.showPopup,l=i.activeTab,u=i.items,c=i.dropdownItems,p={eventEmitter:r,tooltipRef:this.tooltipRef,disabled:"markdown"===o&&"tab"===n&&"preview"===l,execCommand:this.execCommand,setPopupInfo:this.setPopupInfo};return lN(O||(O=Y(['\n      <div class="','">\n        <div\n          class="','"\n          style="display: ','"\n        >\n          <'," tabs="," activeTab="," onClick=",' />\n        </div>\n        <div\n          class="','"\n          ref=',"\n          style=","\n        >\n          ","\n          <","\n            item=","\n            items=","\n            ...","\n          />\n        </div>\n        <","\n          info=","\n          show=","\n          eventEmitter=","\n          hidePopup=","\n          execCommand=","\n        />\n      </div>\n    "],['\n      <div class="','">\n        <div\n          class="','"\n          style="display: ','"\n        >\n          <'," tabs="," activeTab="," onClick=",' />\n        </div>\n        <div\n          class="','"\n          ref=',"\n          style=","\n        >\n          ","\n          <","\n            item=","\n            items=","\n            ...","\n          />\n        </div>\n        <","\n          info=","\n          show=","\n          eventEmitter=","\n          hidePopup=","\n          execCommand=","\n        />\n      </div>\n    "])),tb("toolbar"),tb("md-tab-container"),"wysiwyg"===o||"vertical"===n?"none":"block",l9,this.tabs,l,this.toggleTab,tb("defaultUI-toolbar"),function(t){return e.refs.el=t},"tab"===n?{borderTopLeftRadius:0}:null,u.map(function(t,n){var r;return lN(I||(I=Y(["\n              <","\n                group=","\n                hiddenDivider=","\n                setItemWidth=","\n                ...","\n              />\n            "],["\n              <","\n                group=","\n                hiddenDivider=","\n                setItemWidth=","\n                ...","\n              />
1\n            "])),uu,t,n===u.length-1||(null==(r=u[n+1])?void 0:r.hidden),e.setItemWidth,p)}),uc,un("more"),c,p,ui,a,s,r,this.hidePopup,this.execCommand)},t}(lH),ud=function(e){function t(t){var n=e.call(this,t)||this;return n.handleClickDocument=function(e){tM(e.target,"."+tb("context-menu"))||n.setState({pos:null})},n.state={pos:null,menuGroups:[]},n.addEvent(),n}return Z(t,e),t.prototype.addEvent=function(){var e=this;this.props.eventEmitter.listen("contextmenu",function(t){var n=t.pos,r=t.menuGroups;e.setState({pos:n,menuGroups:r})})},t.prototype.mounted=function(){document.addEventListener("click",this.handleClickDocument)},t.prototype.beforeDestroy=function(){document.removeEventListener("click",this.handleClickDocument)},t.prototype.getMenuGroupElements=function(){var e=this,t=this.state,n=t.pos,r=t.menuGroups;return n?r.reduce(function(t,n){var r=[];return n.forEach(function(t){var n=t.label,o=t.className,i=t.disabled,a=t.onClick;r.push(lN(R||(R=Y(["\n                <li\n                  onClick=",'\n                  class="menu-item','"\n                  aria-role="menuitem"\n                >\n                  <span class="','">',"</span>\n                </li>\n              "],["\n                <li\n                  onClick=",'\n                  class="menu-item','"\n                  aria-role="menuitem"\n                >\n                  <span class="','">',"</span>\n                </li>\n              "])),function(){i||(a(),e.setState({pos:null}))},i?" disabled":"",void 0!==o&&o,n))}),t.push(lN(P||(P=Y(['<ul class="menu-group">\n              ',"\n            </ul>"],['<ul class="menu-group">\n              ',"\n            </ul>"])),r)),t},[]):[]},t.prototype.render=function(){var e=X({display:this.state.pos?"block":"none"},this.state.pos);return lN(H||(H=Y(['<div class="','" style=',' aria-role="menu">\n      ',"\n    </div>"],['<div class="','" style=',' aria-role="menu">\n      ',"\n    </div>"])),tb("context-menu"),e,this.getMenuGroupElements())},t}(lH),uf=function(e){function t(t){var n=e.call(this,t)||this;return n.changeMode=function(e){e!==n.state.editorType&&n.setState({editorType:e})},n.changePreviewStyle=function(e){e!==n.state.previewStyle&&n.setState({previewStyle:e})},n.hide=function(){n.setState({hide:!0})},n.show=function(){n.setState({hide:!1})},n.state={editorType:t.editorType,previewStyle:t.previewStyle,hide:!1},n.addEvent(),n}return Z(t,e),t.prototype.mounted=function(){var e=this.props.slots,t=e.wwEditor,n=e.mdEditor,r=e.mdPreview;this.refs.wwContainer.appendChild(t),this.refs.mdContainer.insertAdjacentElement("afterbegin",n),this.refs.mdContainer.appendChild(r)},t.prototype.insertToolbarItem=function(e,t){this.toolbar.insertToolbarItem(e,t)},t.prototype.removeToolbarItem=function(e){this.toolbar.removeToolbarItem(e)},t.prototype.render=function(){var e=this,t=this.props,n=t.eventEmitter,r=t.hideModeSwitch,o=t.toolbarItems,i=t.theme,a=this.state,s=a.hide,l=a.previewStyle,u=a.editorType,c=tb("markdown"===u?"md-mode":"ww-mode"),p=tb("md")+"-"+l+"-style",d=tb(["light"!==i,i+" "]);return lN(F||(F=Y(['\n      <div\n        class="',"","",'"\n        ref=',"\n      >\n        <","\n          ref=","\n          eventEmitter=","\n          previewStyle=","\n          toolbarItems=","\n          editorType=",'\n        />\n        <div\n          class="'," ",'"\n          ref=','\n        >\n          <div class="','">\n            <div\n              class="'," ",'"\n              ref=','\n            >\n              <div class="','"></div>\n            </div>\n            <div\n              class="','"\n              ref=',"\n            />\n          </div>\n        </div>\n        ","\n        <"," eventEmitter="," />\n      </div>\n    "],['\n      <div\n        class="',"","",'"\n        ref=',"\n      >\n        <","\n          ref=","\n          eventEmitter=","\n          previewStyle=","\n          toolbarItems=","\n          editorType=",'\n        />\n        <div\n          class="'," ",'"\n          ref=','\n        >\n          <div class="','">\n            <div\n              class="'," ",'"\n              ref=','\n            >\n              <div class="','"></div>\n            </div>\n            <div\n              class="','"\n              ref=',"\n            />\n          </div>\n        </div>\n        ","\n        <"," eventEmitter="," />\n      </div>\n    "])),d,tb("defaultUI"),s?" hidden":"",function(t){return e.refs.el=t},up,function(t){return e.toolbar=t},n,l,o,u,tb("main"),c,function(t){return e.refs.editorSection=t},tb("main-container"),tb("md-container"),p,function(t){return e.refs.mdContainer=t},tb("md-splitter"),tb("ww-container"),function(t){return e.refs.wwContainer=t}
1,!r&&lN(B||(B=Y(["<"," eventEmitter="," editorType="," />"],["<"," eventEmitter="," editorType="," />"])),lB,n,u),ud,n)},t.prototype.addEvent=function(){var e=this.props.eventEmitter;e.listen("hide",this.hide),e.listen("show",this.show),e.listen("changeMode",this.changeMode),e.listen("changePreviewStyle",this.changePreviewStyle)},t}(lH),uh=function(e){function t(t){var n,r,o,i,a,s=e.call(this,t)||this,l=(n=s.options.el,r=lN(q||(q=Y(["\n        <","\n          ref=","\n          eventEmitter=","\n          slots=","\n          hideModeSwitch=","\n          toolbarItems=","\n          previewStyle=","\n          editorType=","\n          theme=","\n        />\n      "],["\n        <","\n          ref=","\n          eventEmitter=","\n          slots=","\n          hideModeSwitch=","\n          toolbarItems=","\n          previewStyle=","\n          editorType=","\n          theme=","\n        />\n      "])),uf,function(e){return a=e},s.eventEmitter,s.getEditorElements(),s.options.hideModeSwitch,s.options.toolbarItems,s.options.previewStyle,s.options.initialEditType,s.options.theme),(o=new lM(n.tagName.toLowerCase(),{},[r])).node=n,lM.removalNodes=[],lR(o),lD(o),function(){var e;(e=o.firstChild).effect="D",lM.removalNodes=[e],lD(),lM.removalNodes=[]});return s.setMinHeight(s.options.minHeight),s.setHeight(s.options.height),s.defaultUI={insertToolbarItem:a.insertToolbarItem.bind(a),removeToolbarItem:a.removeToolbarItem.bind(a),destroy:l},null==(i=s.pluginInfo.toolbarItems)||i.forEach(function(e){var t=e.groupIndex,n=e.itemIndex,r=e.item;s.defaultUI.insertToolbarItem({groupIndex:t,itemIndex:n},r)}),s.eventEmitter.emit("loadUI",s),s}return Z(t,e),t.factory=function(e){return e.viewer?new lh(e):new t(e)},t.prototype.insertToolbarItem=function(e,t){this.defaultUI.insertToolbarItem(e,t)},t.prototype.removeToolbarItem=function(e){this.defaultUI.removeToolbarItem(e)},t.prototype.destroy=function(){e.prototype.destroy.call(this),this.defaultUI.destroy()},t}(lT);lT.setLanguage(["en","en-US"],{Markdown:"Markdown",WYSIWYG:"WYSIWYG",Write:"Write",Preview:"Preview",Headings:"Headings",Paragraph:"Paragraph",Bold:"Bold",Italic:"Italic",Strike:"Strike",Code:"Inline code",Line:"Line",Blockquote:"Blockquote","Unordered list":"Unordered list","Ordered list":"Ordered list",Task:"Task",Indent:"Indent",Outdent:"Outdent","Insert link":"Insert link","Insert CodeBlock":"Insert codeBlock","Insert table":"Insert table","Insert image":"Insert image",Heading:"Heading","Image URL":"Image URL","Select image file":"Select image file","Choose a file":"Choose a file","No file":"No file",Description:"Description",OK:"OK",More:"More",Cancel:"Cancel",File:"File",URL:"URL","Link text":"Link text","Add row to up":"Add row to up","Add row to down":"Add row to down","Add column to left":"Add column to left","Add column to right":"Add column to right","Remove row":"Remove row","Remove column":"Remove column","Align column to left":"Align column to left","Align column to center":"Align column to center","Align column to right":"Align column to right","Remove table":"Remove table","Would you like to paste as table?":"Would you like to paste as table?","Text color":"Text color","Auto scroll enabled":"Auto scroll enabled","Auto scroll disabled":"Auto scroll disabled","Choose language":"Choose language"})}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.