PageSourceSearch

https://opengvlab-videochat2.hf.space/static/js/5733.b3b2020b.chunk.js

js opengvlab-videochat2.hf.space collected 2026-10-03 10:22:08 UTC 718,936 bytes, 2 lines download raw bytes

1/*! For license information please see 5733.b3b2020b.chunk.js.LICENSE.txt */
2(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[5733],{45610:function(e,t,n){var r;self,r=function(e,t,n,r,i){return function(){var o={368:function(e){e.exports=function(){"use strict";function e(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var t=Object.hasOwnProperty,n=Object.setPrototypeOf,r=Object.isFrozen,i=Object.getPrototypeOf,o=Object.getOwnPropertyDescriptor,a=Object.freeze,s=Object.seal,l=Object.create,u="undefined"!==typeof Reflect&&Reflect,c=u.apply,p=u.construct;c||(c=function(e,t,n){return e.apply(t,n)}),a||(a=function(e){return e}),s||(s=function(e){return e}),p||(p=function(t,n){return new(Function.prototype.bind.apply(t,[null].concat(e(n))))});var d=x(Array.prototype.forEach),f=x(Array.prototype.pop),h=x(Array.prototype.push),m=x(String.prototype.toLowerCase),v=x(String.prototype.match),g=x(String.prototype.replace),y=x(String.prototype.indexOf),b=x(String.prototype.trim),w=x(RegExp.prototype.test),k=C(TypeError);function x(e){return function(t){for(var n=arguments.length,r=Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return c(e,t,r)}}function C(e){return function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return p(e,n)}}function T(e,t){n&&n(e,null);for(var i=t.length;i--;){var o=t[i];if("string"===typeof o){var a=m(o);a!==o&&(r(t)||(t[i]=a),o=a)}e[o]=!0}return e}function E(e){var n=l(null),r=void 0;for(r in e)c(t,e,[r])&&(n[r]=e[r]);return n}function M(e,t){for(;null!==e;){var n=o(e,t);if(n){if(n.get)return x(n.get);if("function"===typeof n.value)return x(n.value)}e=i(e)}function r(e){return console.warn("fallback value for",e),null}return r}var N=a(["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"]),S=a(["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"]),D=a(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),L=a(["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"]),A=a(["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"]),O=a(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),I=a(["#text"]),R=a(["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","
2spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),P=a(["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"]),B=a(["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"]),F=a(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),H=s(/\{\{[\s\S]*|[\s\S]*\}\}/gm),q=s(/<%[\s\S]*|[\s\S]*%>/gm),z=s(/^data-[\-\w.\u00B7-\uFFFF]/),j=s(/^aria-[\-\w]+$/),V=s(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),_=s(/^(?:\w+script|data):/i),U=s(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),$="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 Z(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var W=function(){return"undefined"===typeof window?null:window},G=function(e,t){if("object"!==("undefined"===typeof e?"undefined":$(e))||"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 i="dompurify"+(n?"#"+n:"");try{return e.createPolicy(i,{createHTML:function(e){return e}})}catch(o){return console.warn("TrustedTypes policy "+i+" could not be created."),null}};function J(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:W(),t=function(e){return J(e)};if(t.version="2.3.3",t.removed=[],!e||!e.document||9!==e.document.nodeType)return t.isSupported=!1,t;var n=e.document,r=e.document,i=e.DocumentFragment,o=e.HTMLTemplateElement,s=e.Node,l=e.Element,u=e.NodeFilter,c=e.NamedNodeMap,p=void 0===c?e.NamedNodeMap||e.MozNamedAttrMap:c,x=e.Text,C=e.Comment,K=e.DOMParser,X=e.trustedTypes,Q=l.prototype,Y=M(Q,"cloneNode"),ee=M(Q,"nextSibling"),te=M(Q,"childNodes"),ne=M(Q,"parentNode");if("function"===typeof o){var re=r.createElement("template");re.content&&re.content.ownerDocument&&(r=re.content.ownerDocument)}var ie=G(X,n),oe=ie&&Fe?ie.createHTML(""):"",ae=r,se=ae.implementation,le=ae.createNodeIterator,ue=ae.createDocumentFragment,ce=ae.getElementsByTagName,pe=n.importNode,de={};try{de=E(r).documentMode?r.documentMode:{}}catch(xt){}var fe={};t.isSupported="function"===typeof ne&&se&&"undefined"!==typeof se.createHTMLDocument&&9!==de;var he=H,me=q,ve=z,ge=j,ye=_,be=U,we=V,ke=null,xe=T({},[].concat(Z(N),Z(S),Z(D),Z(A),Z(I))),Ce=null,Te=T({},[].concat(Z(R),Z(P),Z(B),Z(F))),Ee=null,Me=null,Ne=!0,Se=!0,De=!1,Le=!1,Ae=!1,Oe=!1,Ie=!1,Re=!1,Pe=!1,Be=!0,Fe=!1,He=!0,qe=!0,ze=!1,je={},Ve=null,_e=T({},["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"]),Ue=null,$e=T({},["audio","video","img","source","image","track"]),Ze=null,We=T({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ge="http://www.w3.org/1998/Math/MathML",Je="http://www.w3.org/2000/svg",Ke="http://www.w3.org/1999/xhtml",Xe=Ke,Qe=!1,Ye=void 0,et=["application/xhtml+xml","text/html"],tt="text/html",nt=void 0,rt=null,it=r.createElement("form"),ot=function(e){rt&&rt===e||(e&&"object"===("undefined"===typeof e?"undefined":$(e))||(e={}),e=E(e),ke="ALLOWED_TAGS"in e?T({},e.ALLOWED_TAGS):xe,Ce="ALLOWED_ATTR"in e?T({},e.ALLOWED_ATTR):Te,Ze="ADD_URI_SAFE_ATTR"in e?T(E(We),e.ADD_URI_SAFE_ATTR):We,Ue="ADD_DATA_URI_TAGS"in e?T(E($e),e.ADD_DATA_URI_TAGS):$e,Ve="FORB
2ID_CONTENTS"in e?T({},e.FORBID_CONTENTS):_e,Ee="FORBID_TAGS"in e?T({},e.FORBID_TAGS):{},Me="FORBID_ATTR"in e?T({},e.FORBID_ATTR):{},je="USE_PROFILES"in e&&e.USE_PROFILES,Ne=!1!==e.ALLOW_ARIA_ATTR,Se=!1!==e.ALLOW_DATA_ATTR,De=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Le=e.SAFE_FOR_TEMPLATES||!1,Ae=e.WHOLE_DOCUMENT||!1,Re=e.RETURN_DOM||!1,Pe=e.RETURN_DOM_FRAGMENT||!1,Be=!1!==e.RETURN_DOM_IMPORT,Fe=e.RETURN_TRUSTED_TYPE||!1,Ie=e.FORCE_BODY||!1,He=!1!==e.SANITIZE_DOM,qe=!1!==e.KEEP_CONTENT,ze=e.IN_PLACE||!1,we=e.ALLOWED_URI_REGEXP||we,Xe=e.NAMESPACE||Ke,Ye=Ye=-1===et.indexOf(e.PARSER_MEDIA_TYPE)?tt:e.PARSER_MEDIA_TYPE,nt="application/xhtml+xml"===Ye?function(e){return e}:m,Le&&(Se=!1),Pe&&(Re=!0),je&&(ke=T({},[].concat(Z(I))),Ce=[],!0===je.html&&(T(ke,N),T(Ce,R)),!0===je.svg&&(T(ke,S),T(Ce,P),T(Ce,F)),!0===je.svgFilters&&(T(ke,D),T(Ce,P),T(Ce,F)),!0===je.mathMl&&(T(ke,A),T(Ce,B),T(Ce,F))),e.ADD_TAGS&&(ke===xe&&(ke=E(ke)),T(ke,e.ADD_TAGS)),e.ADD_ATTR&&(Ce===Te&&(Ce=E(Ce)),T(Ce,e.ADD_ATTR)),e.ADD_URI_SAFE_ATTR&&T(Ze,e.ADD_URI_SAFE_ATTR),e.FORBID_CONTENTS&&(Ve===_e&&(Ve=E(Ve)),T(Ve,e.FORBID_CONTENTS)),qe&&(ke["#text"]=!0),Ae&&T(ke,["html","head","body"]),ke.table&&(T(ke,["tbody"]),delete Ee.tbody),a&&a(e),rt=e)},at=T({},["mi","mo","mn","ms","mtext"]),st=T({},["foreignobject","desc","title","annotation-xml"]),lt=T({},S);T(lt,D),T(lt,L);var ut=T({},A);T(ut,O);var ct=function(e){var t=ne(e);t&&t.tagName||(t={namespaceURI:Ke,tagName:"template"});var n=m(e.tagName),r=m(t.tagName);if(e.namespaceURI===Je)return t.namespaceURI===Ke?"svg"===n:t.namespaceURI===Ge?"svg"===n&&("annotation-xml"===r||at[r]):Boolean(lt[n]);if(e.namespaceURI===Ge)return t.namespaceURI===Ke?"math"===n:t.namespaceURI===Je?"math"===n&&st[r]:Boolean(ut[n]);if(e.namespaceURI===Ke){if(t.namespaceURI===Je&&!st[r])return!1;if(t.namespaceURI===Ge&&!at[r])return!1;var i=T({},["title","style","font","a","script"]);return!ut[n]&&(i[n]||!lt[n])}return!1},pt=function(e){h(t.removed,{element:e});try{e.parentNode.removeChild(e)}catch(xt){try{e.outerHTML=oe}catch(xt){e.remove()}}},dt=function(e,n){try{h(t.removed,{attribute:n.getAttributeNode(e),from:n})}catch(xt){h(t.removed,{attribute:null,from:n})}if(n.removeAttribute(e),"is"===e&&!Ce[e])if(Re||Pe)try{pt(n)}catch(xt){}else try{n.setAttribute(e,"")}catch(xt){}},ft=function(e){var t=void 0,n=void 0;if(Ie)e="<remove></remove>"+e;else{var i=v(e,/^[\r\n\t ]+/);n=i&&i[0]}"application/xhtml+xml"===Ye&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");var o=ie?ie.createHTML(e):e;if(Xe===Ke)try{t=(new K).parseFromString(o,Ye)}catch(xt){}if(!t||!t.documentElement){t=se.createDocument(Xe,"template",null);try{t.documentElement.innerHTML=Qe?"":o}catch(xt){}}var a=t.body||t.documentElement;return e&&n&&a.insertBefore(r.createTextNode(n),a.childNodes[0]||null),Xe===Ke?ce.call(t,Ae?"html":"body")[0]:Ae?t.documentElement:a},ht=function(e){return le.call(e.ownerDocument||e,e,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT,null,!1)},mt=function(e){return!(e instanceof x||e instanceof C)&&!("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)},vt=function(e){return"object"===("undefined"===typeof s?"undefined":$(s))?e instanceof s:e&&"object"===("undefined"===typeof e?"undefined":$(e))&&"number"===typeof e.nodeType&&"string"===typeof e.nodeName},gt=function(e,n,r){fe[e]&&d(fe[e],(function(e){e.call(t,n,r,rt)}))},yt=function(e){var n=void 0;if(gt("beforeSanitizeElements",e,null),mt(e))return pt(e),!0;if(v(e.nodeName,/[\u0080-\uFFFF]/))return pt(e),!0;var r=nt(e.nodeName);if(gt("uponSanitizeElement",e,{tagName:r,allowedTags:ke}),!vt(e.firstElementChild)&&(!vt(e.content)||!vt(e.content.firstElementChild))&&w(/<[/\w]/g,e.innerHTML)&&w(/<[/\w]/g,e.textContent))return pt(e),!0;if("select"===r&&w(/<template/i,e.innerHTML))return pt(e),!0;if(!ke[r]||Ee[r]){if(qe&&!Ve[r]){var i=ne(e)||e.parentNode,o=te(e)||e.childNodes;if(o&&i)for(var a=o.length-1;a>=0;--a)i.insertBefore(Y(o[a],!0),ee(e))}return pt(e),!0}return e instanceof l&&!ct(e)?(pt(e),!0):"noscript"!==r&&"noembed"!==r||!w(/<\/no(script|embed)/i,e.innerHTML)?(Le&&3===e.n
2odeType&&(n=e.textContent,n=g(n,he," "),n=g(n,me," "),e.textContent!==n&&(h(t.removed,{element:e.cloneNode()}),e.textContent=n)),gt("afterSanitizeElements",e,null),!1):(pt(e),!0)},bt=function(e,t,n){if(He&&("id"===t||"name"===t)&&(n in r||n in it))return!1;if(Se&&!Me[t]&&w(ve,t));else if(Ne&&w(ge,t));else{if(!Ce[t]||Me[t])return!1;if(Ze[t]);else if(w(we,g(n,be,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==y(n,"data:")||!Ue[e])if(De&&!w(ye,g(n,be,"")));else if(n)return!1}return!0},wt=function(e){var n=void 0,r=void 0,i=void 0,o=void 0;gt("beforeSanitizeAttributes",e,null);var a=e.attributes;if(a){var s={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Ce};for(o=a.length;o--;){var l=n=a[o],u=l.name,c=l.namespaceURI;if(r=b(n.value),i=nt(u),s.attrName=i,s.attrValue=r,s.keepAttr=!0,s.forceKeepAttr=void 0,gt("uponSanitizeAttribute",e,s),r=s.attrValue,!s.forceKeepAttr&&(dt(u,e),s.keepAttr))if(w(/\/>/i,r))dt(u,e);else{Le&&(r=g(r,he," "),r=g(r,me," "));var p=nt(e.nodeName);if(bt(p,i,r))try{c?e.setAttributeNS(c,u,r):e.setAttribute(u,r),f(t.removed)}catch(xt){}}}gt("afterSanitizeAttributes",e,null)}},kt=function e(t){var n=void 0,r=ht(t);for(gt("beforeSanitizeShadowDOM",t,null);n=r.nextNode();)gt("uponSanitizeShadowNode",n,null),yt(n)||(n.content instanceof i&&e(n.content),wt(n));gt("afterSanitizeShadowDOM",t,null)};return t.sanitize=function(r,o){var a=void 0,l=void 0,u=void 0,c=void 0,p=void 0;if((Qe=!r)&&(r="\x3c!--\x3e"),"string"!==typeof r&&!vt(r)){if("function"!==typeof r.toString)throw k("toString is not a function");if("string"!==typeof(r=r.toString()))throw k("dirty is not a string, aborting")}if(!t.isSupported){if("object"===$(e.toStaticHTML)||"function"===typeof e.toStaticHTML){if("string"===typeof r)return e.toStaticHTML(r);if(vt(r))return e.toStaticHTML(r.outerHTML)}return r}if(Oe||ot(o),t.removed=[],"string"===typeof r&&(ze=!1),ze);else if(r instanceof s)1===(l=(a=ft("\x3c!----\x3e")).ownerDocument.importNode(r,!0)).nodeType&&"BODY"===l.nodeName||"HTML"===l.nodeName?a=l:a.appendChild(l);else{if(!Re&&!Le&&!Ae&&-1===r.indexOf("<"))return ie&&Fe?ie.createHTML(r):r;if(!(a=ft(r)))return Re?null:oe}a&&Ie&&pt(a.firstChild);for(var d=ht(ze?r:a);u=d.nextNode();)3===u.nodeType&&u===c||yt(u)||(u.content instanceof i&&kt(u.content),wt(u),c=u);if(c=null,ze)return r;if(Re){if(Pe)for(p=ue.call(a.ownerDocument);a.firstChild;)p.appendChild(a.firstChild);else p=a;return Be&&(p=pe.call(n,p,!0)),p}var f=Ae?a.outerHTML:a.innerHTML;return Le&&(f=g(f,he," "),f=g(f,me," ")),ie&&Fe?ie.createHTML(f):f},t.setConfig=function(e){ot(e),Oe=!0},t.clearConfig=function(){rt=null,Oe=!1},t.isValidAttribute=function(e,t,n){rt||ot({});var r=nt(e),i=nt(t);return bt(r,i,n)},t.addHook=function(e,t){"function"===typeof t&&(fe[e]=fe[e]||[],h(fe[e],t))},t.removeHook=function(e){fe[e]&&f(fe[e])},t.removeHooks=function(e){fe[e]&&(fe[e]=[])},t.removeAllHooks=function(){fe={}},t}return J()}()},928:function(e,t,n){"use strict";var r=n(322);e.exports=function(e,t,n){var i,o;if(n=n||0,!r(t))return-1;if(Array.prototype.indexOf)return Array.prototype.indexOf.call(t,e,n);for(o=t.length,i=n;n>=0&&i<o;i+=1)if(t[i]===e)return i;return-1}},690:function(e,t,n){"use strict";var r=n(322),i=n(893),o=n(956);e.exports=function(e,t,n){r(e)?i(e,t,n):o(e,t,n)}},893:function(e){"use strict";e.exports=function(e,t,n){var r=0,i=e.length;for(n=n||null;r<i&&!1!==t.call(n,e[r],r,e);r+=1);}},956:function(e){"use strict";e.exports=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}},990:function(e,t,n){"use strict";var r=n(893);e.exports=function(e){var t;try{t=Array.prototype.slice.call(e)}catch(n){t=[],r(e,(function(e){t.push(e)}))}return t}},755:function(e){"use strict";var t="_feEventKey";e.exports=function(e,n){var r,i=e[t];return i||(i=e[t]={}),(r=i[n])||(r=i[n]=[]),r}},349:function(e,t,n){"use strict";var r=n(758),i=n(690),o=n(755);function a(e,t,n){var r,a=o(e,t);n?(i(a,(function(i,o){return n!==i.handler||(s(e,t,i.wrappedHandler),r=o,!1)})),a.splice(r,1)):(i(a,(function(n){s(e,t,n.wrappedHandler)})),a.splice(0,a.length))}function s(e,t,n){"removeEventListener"in e?e.removeEventListener(t,n):"detachEvent"in e&&e.detachEvent("on"+t,n)}
2e.exports=function(e,t,n){r(t)?i(t.split(/\s+/g),(function(t){a(e,t,n)})):i(t,(function(t,n){a(e,n,t)}))}},348:function(e,t,n){"use strict";var r=n(758),i=n(690),o=n(755);function a(e,t,n,r){function a(t){n.call(r||e,t||window.event)}"addEventListener"in e?e.addEventListener(t,a):"attachEvent"in e&&e.attachEvent("on"+t,a),function(e,t,n,r){var a=o(e,t),s=!1;i(a,(function(e){return e.handler!==n||(s=!0,!1)})),s||a.push({handler:n,wrappedHandler:r})}(e,t,n,a)}e.exports=function(e,t,n,o){r(t)?i(t.split(/\s+/g),(function(t){a(e,t,n,o)})):i(t,(function(t,r){a(e,r,t,n)}))}},24:function(e,t,n){"use strict";var r=n(322),i=n(929);e.exports=function(e,t){t=(t=r(t)?t.join(" "):t).replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),i(e.className.baseVal)?e.className=t:e.className.baseVal=t}},204:function(e,t,n){"use strict";var r=n(690),i=n(928),o=n(902),a=n(24);e.exports=function(e){var t,n=Array.prototype.slice.call(arguments,1),s=e.classList,l=[];s?r(n,(function(t){e.classList.add(t)})):((t=o(e))&&(n=[].concat(t.split(/\s+/),n)),r(n,(function(e){i(e,l)<0&&l.push(e)})),a(e,l))}},522:function(e,t,n){"use strict";var r=n(758),i=n(690);e.exports=function(e,t,n){var o=e.style;r(t)?o[t]=n:i(t,(function(e,t){o[t]=e}))}},902:function(e,t,n){"use strict";var r=n(929);e.exports=function(e){return e&&e.className?r(e.className.baseVal)?e.className:e.className.baseVal:""}},714:function(e,t,n){"use strict";var r=n(928),i=n(902);e.exports=function(e,t){var n;return e.classList?e.classList.contains(t):(n=i(e).split(/\s+/),r(t,n)>-1)}},471:function(e,t,n){"use strict";var r=n(928),i=n(990),o=Element.prototype,a=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.msMatchesSelector||function(e){var t=this.document||this.ownerDocument;return r(this,i(t.querySelectorAll(e)))>-1};e.exports=function(e,t){return a.call(e,t)}},462:function(e,t,n){"use strict";var r=n(893),i=n(928),o=n(902),a=n(24);e.exports=function(e){var t,n,s=Array.prototype.slice.call(arguments,1),l=e.classList;l?r(s,(function(e){l.remove(e)})):(t=o(e).split(/\s+/),n=[],r(t,(function(e){i(e,s)<0&&n.push(e)})),a(e,n))}},969:function(e){"use strict";e.exports=function(e,t){var n,r,i,o,a=Object.prototype.hasOwnProperty;for(i=1,o=arguments.length;i<o;i+=1)for(r in n=arguments[i])a.call(n,r)&&(e[r]=n[r]);return e}},254:function(e,t,n){"use strict";var r=n(956);e.exports=function(e,t){var n=document.createElement("img"),i="";return r(t,(function(e,t){i+="&"+t+"="+e})),i=i.substring(1),n.src=e+"?"+i,n.style.display="none",document.body.appendChild(n),document.body.removeChild(n),n}},391:function(e,t,n){"use strict";var r=n(929),i=n(254),o=6048e5;e.exports=function(e,t){var n=location.hostname,a="TOAST UI "+e+" for "+n+": Statistics",s=window.localStorage.getItem(a);(r(window.tui)||!1!==window.tui.usageStatistics)&&(s&&!function(e){return(new Date).getTime()-e>o}(s)||(window.localStorage.setItem(a,(new Date).getTime()),setTimeout((function(){"interactive"!==document.readyState&&"complete"!==document.readyState||i("https://www.google-analytics.com/collect",{v:1,t:"event",tid:t,cid:n,dp:n,dh:e,el:e,ec:"use"})}),1e3)))}},322:function(e){"use strict";e.exports=function(e){return e instanceof Array}},65:function(e,t,n){"use strict";var r=n(929),i=n(934);e.exports=function(e){return!r(e)&&!i(e)}},404:function(e,t,n){"use strict";var r=n(790);e.exports=function(e){return!r(e)}},294:function(e){"use strict";e.exports=function(e){return e instanceof Function}},934:function(e){"use strict";e.exports=function(e){return null===e}},758:function(e){"use strict";e.exports=function(e){return"string"===typeof e||e instanceof String}},790:function(e,t,n){"use strict";var r=n(65);e.exports=function(e){return r(e)&&!1!==e}},929:function(e){"use strict";e.exports=function(e){return void 0===e}},479:function(t){"use strict";t.exports=e},481:function(e){"use strict";e.exports=t},43:function(e){"use strict";e.exports=n},814:function(e){"use strict";e.exports=r},311:function(e){"use strict";e.exports=i}},a={};function s(e){var t=a[e];if(void 0!==t)return t.exports;var n=a[e]={exports:{}};return o[e].call(n.exports,n,n.exports,s),n.exports}
2s.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(t,{a:t}),t},s.d=function(e,t){for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},s.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}(),s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};var l={};return function(){"use strict";s.d(l,{default:function(){return Kr}});var e=function(){return e=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},e.apply(this,arguments)};function t(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}Object.create,Object.create;var n=function(e,t){return n=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])},n(e,t)};function r(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var i=function(){return i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i.apply(this,arguments)};function o(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}var a="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window?window:"undefined"!==typeof s.g?s.g:"undefined"!==typeof self?self:{},u={};function c(e,t,n){var r,i,o,a,s,l="";for("string"!==typeof t&&(n=t,t=c.defaultChars),"undefined"===typeof n&&(n=!0),s=function(e){var t,n,r=u[e];if(r)return r;for(r=u[e]=[],t=0;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,i=e.length;r<i;r++)if(o=e.charCodeAt(r),n&&37===o&&r+2<i&&/^[0-9a-f]{2}$/i.test(e.slice(r+1,r+3)))l+=e.slice(r,r+3),r+=2;else if(o<128)l+=s[o];else if(o>=55296&&o<=57343){if(o>=55296&&o<=56319&&r+1<i&&(a=e.charCodeAt(r+1))>=56320&&a<=57343){l+=encodeURIComponent(e[r]+e[r+1]),r++;continue}l+="%EF%BF%BD"}else l+=encodeURIComponent(e[r]);return l}c.defaultChars=";/?:@&=+$,-_.!~*'()#",c.componentChars="-_.!~*'()";var p=c,d={},f={},h={Aacute:"\xc1",aacute:"\xe1",Abreve:"\u0102",abreve:"\u0103",ac:"\u223e",acd:"\u223f",acE:"\u223e\u0333",Acirc:"\xc2",acirc:"\xe2",acute:"\xb4",Acy:"\u0410",acy:"\u0430",AElig:"\xc6",aelig:"\xe6",af:"\u2061",Afr:"\ud835\udd04",afr:"\ud835\udd1e",Agrave:"\xc0",agrave:"\xe0",alefsym:"\u2135",aleph:"\u2135",Alpha:"\u0391",alpha:"\u03b1",Amacr:"\u0100",amacr:"\u0101",amalg:"\u2a3f",amp:"&",AMP:"&",andand:"\u2a55",And:"\u2a53",and:"\u2227",andd:"\u2a5c",andslope:"\u2a58",andv:"\u2a5a",ang:"\u2220",ange:"\u29a4",angle:"\u2220",angmsdaa:"\u29a8",angmsdab:"\u29a9",angmsdac:"\u29aa",angmsdad:"\u29ab",angmsdae:"\u29ac",angmsdaf:"\u29ad",angmsdag:"\u29ae",angmsdah:"\u29af",angmsd:"\u2221",angrt:"\u221f",angrtvb:"\u22be",angrtvbd:"\u299d",angsph:"\u2222",angst:"\xc5",angzarr:"\u237c",Aogon:"\u0104",aogon:"\u0105",Aopf:"\ud835\udd38",aopf:"\ud835\udd52",apacir:"\u2a6f",ap:"\u2248",apE:"\u2a70",ape:"\u224a",apid:"\u224b",apos:"'",ApplyFunction:"\u2061",approx:"\u2248",approxeq:"\u224a",Aring:"\xc5",aring:"\xe5",Ascr:"\ud835\udc9c",ascr:"\ud835\udcb6",Assign:"\u2254",ast:"*",asymp:"\u2248",asympeq:"\u224d",Atilde:"\xc3",atilde:"\xe3",Auml:"\xc4",auml:"\xe4",awconint:"\u2233",awint:"\u2a11",backcong:"\u224c",backepsilon:"\u03f6",backprime:"\u2035",backsim:"\u223d",backsimeq:"\u22cd",Backslash:"\u2216",Barv:"\u2ae7",barvee:"\u22bd",barwed:"\u2305",Barwed:"\u2306",barwedge:"\u2305",bbrk:"\u23b5",bbrktbrk:"\u23b6",bcong:"\u224c",Bcy:"\u0411",bcy:"\u0431",bdquo:"\u201e",becaus:"\u2235",because:"\u2235",Because:"\u2235",bemptyv:"\u29b0",bepsi:"\u03f6",bernou:"\u212c",Bernoullis:"\u212c",Beta:"\u0392",beta:"\u03b2",beth:"\u2136",between:"\u226c",Bfr:"\ud835\udd05",bfr:"\ud835\udd1f",bigcap:"\u22c2",bigcirc:"\u25ef",bigcup:"\u22c3",bigodot:"\u2a00",bigoplus:"\u2a01",bigotimes:"\u2a02",bigsqcup:"\u2a06",bigstar:"\u2605",bigtriangledown:"\u25bd",bigtriangleup:"\u25b3",biguplus:"\u2a04",bigvee:"\u22c1",bigwedge:"\u22c0",bkarow:"\u290d",blacklozenge:"\u29eb",blacksquare:"\u25aa",blacktriangle:"\u25b4",blacktriangledown:"\u25be",blacktriangleleft:"\u25c2",blacktriangleright:"\u25b8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20e5",bnequiv:"\u2261\u20e5",bNot:"\u2aed",bnot:"\u2310",Bopf:"\ud835\udd39",bopf:"\ud835\udd53",bot:"\u22a5",bottom:"\u22a5",bowtie:"\u22c8",boxbox:"\u29c9",boxdl:"\u2510",boxdL:"\u2555",boxDl:"\u2556",boxDL:"\u2557",boxdr:"\u250c",boxdR:"\u2552",boxDr:"\u2553",boxDR:"\u2554",boxh:"\u2500",boxH:"\u2550",boxhd:"\u252c",boxHd:"\u2564",boxhD:"\u2565",boxHD:"\u2566",boxhu:"\u2534",boxHu:"\u2567",boxhU:"\u2568",boxHU:"\u2569",boxminus:"\u229f",boxplus:"\u229e",boxtimes:"\u22a0",boxul:"\u2518",boxuL:"\u255b",boxUl:"\u255c",boxUL:"\u255d",boxur:"\u2514",boxuR:"\u2558",boxUr:"\u2559",boxUR:"\u255a",boxv:"\u2502",boxV:"\u2551",boxvh:"\u253c",boxvH:"\u256a",boxVh:"\u256b",boxVH:"\u256c",boxvl:"\u2524",boxvL:"\u2561",boxVl:"\u2562",boxVL:"\u2563",boxvr:"\u251c",boxvR:"\u255e",boxVr:"\u255f",boxVR:"\u2560",bprime:"\u2035",breve:"\u02d8",Breve:"\u02d8",brvbar:"\xa6",bscr:"\ud835\udcb7",Bscr:"\u212c",bsemi:"\u204f",bsim:"\u223d",bsime:"\u22cd",bsolb:"\u29c5",bsol:"\\",bsolhsub:"\u27c8",bull:"\u2022",bullet:"\u2022",bump:"\u224e",bumpE:"\u2aae",bumpe:"\u224f",Bumpeq:"\u224e",bumpeq:"\u224f",Cacute:"\u0106",cacute:"\u0107",capand:"\u2a44",capbrcup:"\u2a49",capcap:"\u2a4b",cap:"\u2229",Cap:"\u22d2",capcup:"\u2a47",capdot:"\u2a40",CapitalDifferentialD:"\u2145",caps:"\u2229\ufe00",caret:"\u2041",caron:"\u02c7",Cayleys:"\u212d",ccaps:"\u2a4d",Ccaron:"\u010c",ccaron:"\u010d",Ccedil
2:"\xc7",ccedil:"\xe7",Ccirc:"\u0108",ccirc:"\u0109",Cconint:"\u2230",ccups:"\u2a4c",ccupssm:"\u2a50",Cdot:"\u010a",cdot:"\u010b",cedil:"\xb8",Cedilla:"\xb8",cemptyv:"\u29b2",cent:"\xa2",centerdot:"\xb7",CenterDot:"\xb7",cfr:"\ud835\udd20",Cfr:"\u212d",CHcy:"\u0427",chcy:"\u0447",check:"\u2713",checkmark:"\u2713",Chi:"\u03a7",chi:"\u03c7",circ:"\u02c6",circeq:"\u2257",circlearrowleft:"\u21ba",circlearrowright:"\u21bb",circledast:"\u229b",circledcirc:"\u229a",circleddash:"\u229d",CircleDot:"\u2299",circledR:"\xae",circledS:"\u24c8",CircleMinus:"\u2296",CirclePlus:"\u2295",CircleTimes:"\u2297",cir:"\u25cb",cirE:"\u29c3",cire:"\u2257",cirfnint:"\u2a10",cirmid:"\u2aef",cirscir:"\u29c2",ClockwiseContourIntegral:"\u2232",CloseCurlyDoubleQuote:"\u201d",CloseCurlyQuote:"\u2019",clubs:"\u2663",clubsuit:"\u2663",colon:":",Colon:"\u2237",Colone:"\u2a74",colone:"\u2254",coloneq:"\u2254",comma:",",commat:"@",comp:"\u2201",compfn:"\u2218",complement:"\u2201",complexes:"\u2102",cong:"\u2245",congdot:"\u2a6d",Congruent:"\u2261",conint:"\u222e",Conint:"\u222f",ContourIntegral:"\u222e",copf:"\ud835\udd54",Copf:"\u2102",coprod:"\u2210",Coproduct:"\u2210",copy:"\xa9",COPY:"\xa9",copysr:"\u2117",CounterClockwiseContourIntegral:"\u2233",crarr:"\u21b5",cross:"\u2717",Cross:"\u2a2f",Cscr:"\ud835\udc9e",cscr:"\ud835\udcb8",csub:"\u2acf",csube:"\u2ad1",csup:"\u2ad0",csupe:"\u2ad2",ctdot:"\u22ef",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22de",cuesc:"\u22df",cularr:"\u21b6",cularrp:"\u293d",cupbrcap:"\u2a48",cupcap:"\u2a46",CupCap:"\u224d",cup:"\u222a",Cup:"\u22d3",cupcup:"\u2a4a",cupdot:"\u228d",cupor:"\u2a45",cups:"\u222a\ufe00",curarr:"\u21b7",curarrm:"\u293c",curlyeqprec:"\u22de",curlyeqsucc:"\u22df",curlyvee:"\u22ce",curlywedge:"\u22cf",curren:"\xa4",curvearrowleft:"\u21b6",curvearrowright:"\u21b7",cuvee:"\u22ce",cuwed:"\u22cf",cwconint:"\u2232",cwint:"\u2231",cylcty:"\u232d",dagger:"\u2020",Dagger:"\u2021",daleth:"\u2138",darr:"\u2193",Darr:"\u21a1",dArr:"\u21d3",dash:"\u2010",Dashv:"\u2ae4",dashv:"\u22a3",dbkarow:"\u290f",dblac:"\u02dd",Dcaron:"\u010e",dcaron:"\u010f",Dcy:"\u0414",dcy:"\u0434",ddagger:"\u2021",ddarr:"\u21ca",DD:"\u2145",dd:"\u2146",DDotrahd:"\u2911",ddotseq:"\u2a77",deg:"\xb0",Del:"\u2207",Delta:"\u0394",delta:"\u03b4",demptyv:"\u29b1",dfisht:"\u297f",Dfr:"\ud835\udd07",dfr:"\ud835\udd21",dHar:"\u2965",dharl:"\u21c3",dharr:"\u21c2",DiacriticalAcute:"\xb4",DiacriticalDot:"\u02d9",DiacriticalDoubleAcute:"\u02dd",DiacriticalGrave:"`",DiacriticalTilde:"\u02dc",diam:"\u22c4",diamond:"\u22c4",Diamond:"\u22c4",diamondsuit:"\u2666",diams:"\u2666",die:"\xa8",DifferentialD:"\u2146",digamma:"\u03dd",disin:"\u22f2",div:"\xf7",divide:"\xf7",divideontimes:"\u22c7",divonx:"\u22c7",DJcy:"\u0402",djcy:"\u0452",dlcorn:"\u231e",dlcrop:"\u230d",dollar:"$",Dopf:"\ud835\udd3b",dopf:"\ud835\udd55",Dot:"\xa8",dot:"\u02d9",DotDot:"\u20dc",doteq:"\u2250",doteqdot:"\u2251",DotEqual:"\u2250",dotminus:"\u2238",dotplus:"\u2214",dotsquare:"\u22a1",doublebarwedge:"\u2306",DoubleContourIntegral:"\u222f",DoubleDot:"\xa8",DoubleDownArrow:"\u21d3",DoubleLeftArrow:"\u21d0",DoubleLeftRightArrow:"\u21d4",DoubleLeftTee:"\u2ae4",DoubleLongLeftArrow:"\u27f8",DoubleLongLeftRightArrow:"\u27fa",DoubleLongRightArrow:"\u27f9",DoubleRightArrow:"\u21d2",DoubleRightTee:"\u22a8",DoubleUpArrow:"\u21d1",DoubleUpDownArrow:"\u21d5",DoubleVerticalBar:"\u2225",DownArrowBar:"\u2913",downarrow:"\u2193",DownArrow:"\u2193",Downarrow:"\u21d3",DownArrowUpArrow:"\u21f5",DownBreve:"\u0311",downdownarrows:"\u21ca",downharpoonleft:"\u21c3",downharpoonright:"\u21c2",DownLeftRightVector:"\u2950",DownLeftTeeVector:"\u295e",DownLeftVectorBar:"\u2956",DownLeftVector:"\u21bd",DownRightTeeVector:"\u295f",DownRightVectorBar:"\u2957",DownRightVector:"\u21c1",DownTeeArrow:"\u21a7",DownTee:"\u22a4",drbkarow:"\u2910",drcorn:"\u231f",drcrop:"\u230c",Dscr:"\ud835\udc9f",dscr:"\ud835\udcb9",DScy:"\u0405",dscy:"\u0455",dsol:"\u29f6",Dstrok:"\u0110",dstrok:"\u0111",dtdot:"\u22f1",dtri:"\u25bf",dtrif:"\u25be",duarr:"\u21f5",duhar:"\u296f",dwangle:"\u29a6",DZcy:"\u040f",dzcy:"\u045f",dzigrarr:"\u27ff",Eacute:"\xc9",eacute:"\xe9",easter:"\u2a6e",Ecaron:"\u011a",ecaron:"\u011b",Ecirc:"\xca",ecirc:"\xea",ecir:"\u2256",ecolon:"\u2255",Ecy:"\u042d",ecy:"\u044d",eDDot:"\u2a77",
2Edot:"\u0116",edot:"\u0117",eDot:"\u2251",ee:"\u2147",efDot:"\u2252",Efr:"\ud835\udd08",efr:"\ud835\udd22",eg:"\u2a9a",Egrave:"\xc8",egrave:"\xe8",egs:"\u2a96",egsdot:"\u2a98",el:"\u2a99",Element:"\u2208",elinters:"\u23e7",ell:"\u2113",els:"\u2a95",elsdot:"\u2a97",Emacr:"\u0112",emacr:"\u0113",empty:"\u2205",emptyset:"\u2205",EmptySmallSquare:"\u25fb",emptyv:"\u2205",EmptyVerySmallSquare:"\u25ab",emsp13:"\u2004",emsp14:"\u2005",emsp:"\u2003",ENG:"\u014a",eng:"\u014b",ensp:"\u2002",Eogon:"\u0118",eogon:"\u0119",Eopf:"\ud835\udd3c",eopf:"\ud835\udd56",epar:"\u22d5",eparsl:"\u29e3",eplus:"\u2a71",epsi:"\u03b5",Epsilon:"\u0395",epsilon:"\u03b5",epsiv:"\u03f5",eqcirc:"\u2256",eqcolon:"\u2255",eqsim:"\u2242",eqslantgtr:"\u2a96",eqslantless:"\u2a95",Equal:"\u2a75",equals:"=",EqualTilde:"\u2242",equest:"\u225f",Equilibrium:"\u21cc",equiv:"\u2261",equivDD:"\u2a78",eqvparsl:"\u29e5",erarr:"\u2971",erDot:"\u2253",escr:"\u212f",Escr:"\u2130",esdot:"\u2250",Esim:"\u2a73",esim:"\u2242",Eta:"\u0397",eta:"\u03b7",ETH:"\xd0",eth:"\xf0",Euml:"\xcb",euml:"\xeb",euro:"\u20ac",excl:"!",exist:"\u2203",Exists:"\u2203",expectation:"\u2130",exponentiale:"\u2147",ExponentialE:"\u2147",fallingdotseq:"\u2252",Fcy:"\u0424",fcy:"\u0444",female:"\u2640",ffilig:"\ufb03",fflig:"\ufb00",ffllig:"\ufb04",Ffr:"\ud835\udd09",ffr:"\ud835\udd23",filig:"\ufb01",FilledSmallSquare:"\u25fc",FilledVerySmallSquare:"\u25aa",fjlig:"fj",flat:"\u266d",fllig:"\ufb02",fltns:"\u25b1",fnof:"\u0192",Fopf:"\ud835\udd3d",fopf:"\ud835\udd57",forall:"\u2200",ForAll:"\u2200",fork:"\u22d4",forkv:"\u2ad9",Fouriertrf:"\u2131",fpartint:"\u2a0d",frac12:"\xbd",frac13:"\u2153",frac14:"\xbc",frac15:"\u2155",frac16:"\u2159",frac18:"\u215b",frac23:"\u2154",frac25:"\u2156",frac34:"\xbe",frac35:"\u2157",frac38:"\u215c",frac45:"\u2158",frac56:"\u215a",frac58:"\u215d",frac78:"\u215e",frasl:"\u2044",frown:"\u2322",fscr:"\ud835\udcbb",Fscr:"\u2131",gacute:"\u01f5",Gamma:"\u0393",gamma:"\u03b3",Gammad:"\u03dc",gammad:"\u03dd",gap:"\u2a86",Gbreve:"\u011e",gbreve:"\u011f",Gcedil:"\u0122",Gcirc:"\u011c",gcirc:"\u011d",Gcy:"\u0413",gcy:"\u0433",Gdot:"\u0120",gdot:"\u0121",ge:"\u2265",gE:"\u2267",gEl:"\u2a8c",gel:"\u22db",geq:"\u2265",geqq:"\u2267",geqslant:"\u2a7e",gescc:"\u2aa9",ges:"\u2a7e",gesdot:"\u2a80",gesdoto:"\u2a82",gesdotol:"\u2a84",gesl:"\u22db\ufe00",gesles:"\u2a94",Gfr:"\ud835\udd0a",gfr:"\ud835\udd24",gg:"\u226b",Gg:"\u22d9",ggg:"\u22d9",gimel:"\u2137",GJcy:"\u0403",gjcy:"\u0453",gla:"\u2aa5",gl:"\u2277",glE:"\u2a92",glj:"\u2aa4",gnap:"\u2a8a",gnapprox:"\u2a8a",gne:"\u2a88",gnE:"\u2269",gneq:"\u2a88",gneqq:"\u2269",gnsim:"\u22e7",Gopf:"\ud835\udd3e",gopf:"\ud835\udd58",grave:"`",GreaterEqual:"\u2265",GreaterEqualLess:"\u22db",GreaterFullEqual:"\u2267",GreaterGreater:"\u2aa2",GreaterLess:"\u2277",GreaterSlantEqual:"\u2a7e",GreaterTilde:"\u2273",Gscr:"\ud835\udca2",gscr:"\u210a",gsim:"\u2273",gsime:"\u2a8e",gsiml:"\u2a90",gtcc:"\u2aa7",gtcir:"\u2a7a",gt:">",GT:">",Gt:"\u226b",gtdot:"\u22d7",gtlPar:"\u2995",gtquest:"\u2a7c",gtrapprox:"\u2a86",gtrarr:"\u2978",gtrdot:"\u22d7",gtreqless:"\u22db",gtreqqless:"\u2a8c",gtrless:"\u2277",gtrsim:"\u2273",gvertneqq:"\u2269\ufe00",gvnE:"\u2269\ufe00",Hacek:"\u02c7",hairsp:"\u200a",half:"\xbd",hamilt:"\u210b",HARDcy:"\u042a",hardcy:"\u044a",harrcir:"\u2948",harr:"\u2194",hArr:"\u21d4",harrw:"\u21ad",Hat:"^",hbar:"\u210f",Hcirc:"\u0124",hcirc:"\u0125",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",hercon:"\u22b9",hfr:"\ud835\udd25",Hfr:"\u210c",HilbertSpace:"\u210b",hksearow:"\u2925",hkswarow:"\u2926",hoarr:"\u21ff",homtht:"\u223b",hookleftarrow:"\u21a9",hookrightarrow:"\u21aa",hopf:"\ud835\udd59",Hopf:"\u210d",horbar:"\u2015",HorizontalLine:"\u2500",hscr:"\ud835\udcbd",Hscr:"\u210b",hslash:"\u210f",Hstrok:"\u0126",hstrok:"\u0127",HumpDownHump:"\u224e",HumpEqual:"\u224f",hybull:"\u2043",hyphen:"\u2010",Iacute:"\xcd",iacute:"\xed",ic:"\u2063",Icirc:"\xce",icirc:"\xee",Icy:"\u0418",icy:"\u0438",Idot:"\u0130",IEcy:"\u0415",iecy:"\u0435",iexcl:"\xa1",iff:"\u21d4",ifr:"\ud835\udd26",Ifr:"\u2111",Igrave:"\xcc",igrave:"\xec",ii:"\u2148",iiiint:"\u2a0c",iiint:"\u222d",iinfin:"\u29dc",iiota:"\u2129",IJlig:"\u0132",ijlig:"\u0133",Imacr:"\u012a",imacr:"\u012b",image:"\u2111",ImaginaryI:"\u2148",imagline:"\u2110",imagpart:"\u2111",imath:"\u0131",Im:"\u2111",imof:"\u22b7",imped:"\u01b5",Implies:"\u21d2",incare:"\u2105",in:"\u2208",infin:"\u221e",infintie:"\u29dd",inodot:"\u0131",intcal:"\u22ba",int:"\u222b",Int:"\u222c",integers:"\u2124",Integral:"\u222b",intercal:"\u22ba",Intersection:"\u22c2",intlarhk:"\u2a17",intprod:"\u2a3c",InvisibleComma:"\u2063",InvisibleTimes:"\u2062",IOcy:"\u0401",iocy:"\u0451",Iogon:"\u012e",iogon:"\u012f",Iopf:"\ud835\udd40",iopf:"\ud835\udd5a",Iota:"\u0399",iota:"\u03b9",iprod:"\u2a3c",iquest:"\xbf",iscr:"\ud835\udcbe",Iscr:"\u2110",isin:"\u2208",isindot:"\u22f5",isinE:"\u22f9",isins:"\u22f4",isinsv:"\u22f3",isinv:"\u2208",it:"\u2062",Itilde:"\u0128",itilde:"\u0129",Iukcy:"\u0406",iukcy:"\u0456",Iuml:"\xcf",iuml:"\xef",Jcirc:"\u0134",jcirc:"\u0135",Jcy:"\u0419",jcy:"\u0439",Jfr:"\ud835\udd0d",jfr:"\ud835\udd27",jmath:"\u0237",Jopf:"\ud835\udd41",jopf:"\ud835\udd5b",Jscr:"\ud835\udca5",jscr:"\ud835\udcbf",Jsercy:"\u0408",jsercy:"\u0458",Jukcy:"\u0404",jukcy:"\u0454",Kappa:"\u039a",kappa:"\u03ba",kappav:"\u03f0",Kcedil:"\u0136",kcedil
2:"\u0137",Kcy:"\u041a",kcy:"\u043a",Kfr:"\ud835\udd0e",kfr:"\ud835\udd28",kgreen:"\u0138",KHcy:"\u0425",khcy:"\u0445",KJcy:"\u040c",kjcy:"\u045c",Kopf:"\ud835\udd42",kopf:"\ud835\udd5c",Kscr:"\ud835\udca6",kscr:"\ud835\udcc0",lAarr:"\u21da",Lacute:"\u0139",lacute:"\u013a",laemptyv:"\u29b4",lagran:"\u2112",Lambda:"\u039b",lambda:"\u03bb",lang:"\u27e8",Lang:"\u27ea",langd:"\u2991",langle:"\u27e8",lap:"\u2a85",Laplacetrf:"\u2112",laquo:"\xab",larrb:"\u21e4",larrbfs:"\u291f",larr:"\u2190",Larr:"\u219e",lArr:"\u21d0",larrfs:"\u291d",larrhk:"\u21a9",larrlp:"\u21ab",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21a2",latail:"\u2919",lAtail:"\u291b",lat:"\u2aab",late:"\u2aad",lates:"\u2aad\ufe00",lbarr:"\u290c",lBarr:"\u290e",lbbrk:"\u2772",lbrace:"{",lbrack:"[",lbrke:"\u298b",lbrksld:"\u298f",lbrkslu:"\u298d",Lcaron:"\u013d",lcaron:"\u013e",Lcedil:"\u013b",lcedil:"\u013c",lceil:"\u2308",lcub:"{",Lcy:"\u041b",lcy:"\u043b",ldca:"\u2936",ldquo:"\u201c",ldquor:"\u201e",ldrdhar:"\u2967",ldrushar:"\u294b",ldsh:"\u21b2",le:"\u2264",lE:"\u2266",LeftAngleBracket:"\u27e8",LeftArrowBar:"\u21e4",leftarrow:"\u2190",LeftArrow:"\u2190",Leftarrow:"\u21d0",LeftArrowRightArrow:"\u21c6",leftarrowtail:"\u21a2",LeftCeiling:"\u2308",LeftDoubleBracket:"\u27e6",LeftDownTeeVector:"\u2961",LeftDownVectorBar:"\u2959",LeftDownVector:"\u21c3",LeftFloor:"\u230a",leftharpoondown:"\u21bd",leftharpoonup:"\u21bc",leftleftarrows:"\u21c7",leftrightarrow:"\u2194",LeftRightArrow:"\u2194",Leftrightarrow:"\u21d4",leftrightarrows:"\u21c6",leftrightharpoons:"\u21cb",leftrightsquigarrow:"\u21ad",LeftRightVector:"\u294e",LeftTeeArrow:"\u21a4",LeftTee:"\u22a3",LeftTeeVector:"\u295a",leftthreetimes:"\u22cb",LeftTriangleBar:"\u29cf",LeftTriangle:"\u22b2",LeftTriangleEqual:"\u22b4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVectorBar:"\u2958",LeftUpVector:"\u21bf",LeftVectorBar:"\u2952",LeftVector:"\u21bc",lEg:"\u2a8b",leg:"\u22da",leq:"\u2264",leqq:"\u2266",leqslant:"\u2a7d",lescc:"\u2aa8",les:"\u2a7d",lesdot:"\u2a7f",lesdoto:"\u2a81",lesdotor:"\u2a83",lesg:"\u22da\ufe00",lesges:"\u2a93",lessapprox:"\u2a85",lessdot:"\u22d6",lesseqgtr:"\u22da",lesseqqgtr:"\u2a8b",LessEqualGreater:"\u22da",LessFullEqual:"\u2266",LessGreater:"\u2276",lessgtr:"\u2276",LessLess:"\u2aa1",lesssim:"\u2272",LessSlantEqual:"\u2a7d",LessTilde:"\u2272",lfisht:"\u297c",lfloor:"\u230a",Lfr:"\ud835\udd0f",lfr:"\ud835\udd29",lg:"\u2276",lgE:"\u2a91",lHar:"\u2962",lhard:"\u21bd",lharu:"\u21bc",lharul:"\u296a",lhblk:"\u2584",LJcy:"\u0409",ljcy:"\u0459",llarr:"\u21c7",ll:"\u226a",Ll:"\u22d8",llcorner:"\u231e",Lleftarrow:"\u21da",llhard:"\u296b",lltri:"\u25fa",Lmidot:"\u013f",lmidot:"\u0140",lmoustache:"\u23b0",lmoust:"\u23b0",lnap:"\u2a89",lnapprox:"\u2a89",lne:"\u2a87",lnE:"\u2268",lneq:"\u2a87",lneqq:"\u2268",lnsim:"\u22e6",loang:"\u27ec",loarr:"\u21fd",lobrk:"\u27e6",longleftarrow:"\u27f5",LongLeftArrow:"\u27f5",Longleftarrow:"\u27f8",longleftrightarrow:"\u27f7",LongLeftRightArrow:"\u27f7",Longleftrightarrow:"\u27fa",longmapsto:"\u27fc",longrightarrow:"\u27f6",LongRightArrow:"\u27f6",Longrightarrow:"\u27f9",looparrowleft:"\u21ab",looparrowright:"\u21ac",lopar:"\u2985",Lopf:"\ud835\udd43",lopf:"\ud835\udd5d",loplus:"\u2a2d",lotimes:"\u2a34",lowast:"\u2217",lowbar:"_",LowerLeftArrow:"\u2199",LowerRightArrow:"\u2198",loz:"\u25ca",lozenge:"\u25ca",lozf:"\u29eb",lpar:"(",lparlt:"\u2993",lrarr:"\u21c6",lrcorner:"\u231f",lrhar:"\u21cb",lrhard:"\u296d",lrm:"\u200e",lrtri:"\u22bf",lsaquo:"\u2039",lscr:"\ud835\udcc1",Lscr:"\u2112",lsh:"\u21b0",Lsh:"\u21b0",lsim:"\u2272",lsime:"\u2a8d",lsimg:"\u2a8f",lsqb:"[",lsquo:"\u2018",lsquor:"\u201a",Lstrok:"\u0141",lstrok:"\u0142",ltcc:"\u2aa6",ltcir:"\u2a79",lt:"<",LT:"<",Lt:"\u226a",ltdot:"\u22d6",lthree:"\u22cb",ltimes:"\u22c9",ltlarr:"\u2976",ltquest:"\u2a7b",ltri:"\u25c3",ltrie:"\u22b4",ltrif:"\u25c2",ltrPar:"\u2996",lurdshar:"\u294a",luruhar:"\u2966",lvertneqq:"\u2268\ufe00",lvnE:"\u2268\ufe00",macr:"\xaf",male:"\u2642",malt:"\u2720",maltese:"\u2720",Map:"\u2905",map:"\u21a6",mapsto:"\u21a6",mapstodown:"\u21a7",mapstoleft:"\u21a4",mapstoup:"\u21a5",marker:"\u25ae",mcomma:"\u2a29",Mcy:"\u041c",mcy:"\u043c",mdash:"\u2014",mDDot:"\u223a",measuredangle:"\u2221",MediumSpace:"\u205f",Mellintrf:"\u2133",Mfr:"\ud835\udd10",mfr:"\ud835\udd2a",mho:"\u2127",micro:"\xb5",midast:"*",midcir:"\u2af0",mid:"\u2223",middot:"\xb7",minusb:"\u229f",minu
2s:"\u2212",minusd:"\u2238",minusdu:"\u2a2a",MinusPlus:"\u2213",mlcp:"\u2adb",mldr:"\u2026",mnplus:"\u2213",models:"\u22a7",Mopf:"\ud835\udd44",mopf:"\ud835\udd5e",mp:"\u2213",mscr:"\ud835\udcc2",Mscr:"\u2133",mstpos:"\u223e",Mu:"\u039c",mu:"\u03bc",multimap:"\u22b8",mumap:"\u22b8",nabla:"\u2207",Nacute:"\u0143",nacute:"\u0144",nang:"\u2220\u20d2",nap:"\u2249",napE:"\u2a70\u0338",napid:"\u224b\u0338",napos:"\u0149",napprox:"\u2249",natural:"\u266e",naturals:"\u2115",natur:"\u266e",nbsp:"\xa0",nbump:"\u224e\u0338",nbumpe:"\u224f\u0338",ncap:"\u2a43",Ncaron:"\u0147",ncaron:"\u0148",Ncedil:"\u0145",ncedil:"\u0146",ncong:"\u2247",ncongdot:"\u2a6d\u0338",ncup:"\u2a42",Ncy:"\u041d",ncy:"\u043d",ndash:"\u2013",nearhk:"\u2924",nearr:"\u2197",neArr:"\u21d7",nearrow:"\u2197",ne:"\u2260",nedot:"\u2250\u0338",NegativeMediumSpace:"\u200b",NegativeThickSpace:"\u200b",NegativeThinSpace:"\u200b",NegativeVeryThinSpace:"\u200b",nequiv:"\u2262",nesear:"\u2928",nesim:"\u2242\u0338",NestedGreaterGreater:"\u226b",NestedLessLess:"\u226a",NewLine:"\n",nexist:"\u2204",nexists:"\u2204",Nfr:"\ud835\udd11",nfr:"\ud835\udd2b",ngE:"\u2267\u0338",nge:"\u2271",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2a7e\u0338",nges:"\u2a7e\u0338",nGg:"\u22d9\u0338",ngsim:"\u2275",nGt:"\u226b\u20d2",ngt:"\u226f",ngtr:"\u226f",nGtv:"\u226b\u0338",nharr:"\u21ae",nhArr:"\u21ce",nhpar:"\u2af2",ni:"\u220b",nis:"\u22fc",nisd:"\u22fa",niv:"\u220b",NJcy:"\u040a",njcy:"\u045a",nlarr:"\u219a",nlArr:"\u21cd",nldr:"\u2025",nlE:"\u2266\u0338",nle:"\u2270",nleftarrow:"\u219a",nLeftarrow:"\u21cd",nleftrightarrow:"\u21ae",nLeftrightarrow:"\u21ce",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2a7d\u0338",nles:"\u2a7d\u0338",nless:"\u226e",nLl:"\u22d8\u0338",nlsim:"\u2274",nLt:"\u226a\u20d2",nlt:"\u226e",nltri:"\u22ea",nltrie:"\u22ec",nLtv:"\u226a\u0338",nmid:"\u2224",NoBreak:"\u2060",NonBreakingSpace:"\xa0",nopf:"\ud835\udd5f",Nopf:"\u2115",Not:"\u2aec",not:"\xac",NotCongruent:"\u2262",NotCupCap:"\u226d",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226f",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226b\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2a7e\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224e\u0338",NotHumpEqual:"\u224f\u0338",notin:"\u2209",notindot:"\u22f5\u0338",notinE:"\u22f9\u0338",notinva:"\u2209",notinvb:"\u22f7",notinvc:"\u22f6",NotLeftTriangleBar:"\u29cf\u0338",NotLeftTriangle:"\u22ea",NotLeftTriangleEqual:"\u22ec",NotLess:"\u226e",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226a\u0338",NotLessSlantEqual:"\u2a7d\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2aa2\u0338",NotNestedLessLess:"\u2aa1\u0338",notni:"\u220c",notniva:"\u220c",notnivb:"\u22fe",notnivc:"\u22fd",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2aaf\u0338",NotPrecedesSlantEqual:"\u22e0",NotReverseElement:"\u220c",NotRightTriangleBar:"\u29d0\u0338",NotRightTriangle:"\u22eb",NotRightTriangleEqual:"\u22ed",NotSquareSubset:"\u228f\u0338",NotSquareSubsetEqual:"\u22e2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22e3",NotSubset:"\u2282\u20d2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2ab0\u0338",NotSucceedsSlantEqual:"\u22e1",NotSucceedsTilde:"\u227f\u0338",NotSuperset:"\u2283\u20d2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",nparallel:"\u2226",npar:"\u2226",nparsl:"\u2afd\u20e5",npart:"\u2202\u0338",npolint:"\u2a14",npr:"\u2280",nprcue:"\u22e0",nprec:"\u2280",npreceq:"\u2aaf\u0338",npre:"\u2aaf\u0338",nrarrc:"\u2933\u0338",nrarr:"\u219b",nrArr:"\u21cf",nrarrw:"\u219d\u0338",nrightarrow:"\u219b",nRightarrow:"\u21cf",nrtri:"\u22eb",nrtrie:"\u22ed",nsc:"\u2281",nsccue:"\u22e1",nsce:"\u2ab0\u0338",Nscr:"\ud835\udca9",nscr:"\ud835\udcc3",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22e2",nsqsupe:"\u22e3",nsub:"\u2284",nsubE:"\u2ac5\u0338",nsube:"\u2288",nsubset:"\u2282\u20d2",nsubseteq:"\u2288",nsubseteqq:"\u2ac5\u0338",nsucc:"\u2281",nsucceq:"\u2ab0\u0338",nsup:"\u2285",nsupE:"\u2ac6\u0338",nsupe:"\u2289",nsupset:"\u2283\u20d2",nsupseteq:"\u2289",nsupseteqq:"\u2ac6\u0338",ntgl:"\u2279",Ntilde:"\xd1",ntilde:"\xf1",ntlg:"\u2278",ntriangleleft:"\u22ea",ntrianglelefteq:"\u22ec",ntriangleright:"\u22eb",ntrianglerighteq:"\u22ed",Nu:"\u039d",nu:"\u
203bd",num:"#",numero:"\u2116",numsp:"\u2007",nvap:"\u224d\u20d2",nvdash:"\u22ac",nvDash:"\u22ad",nVdash:"\u22ae",nVDash:"\u22af",nvge:"\u2265\u20d2",nvgt:">\u20d2",nvHarr:"\u2904",nvinfin:"\u29de",nvlArr:"\u2902",nvle:"\u2264\u20d2",nvlt:"<\u20d2",nvltrie:"\u22b4\u20d2",nvrArr:"\u2903",nvrtrie:"\u22b5\u20d2",nvsim:"\u223c\u20d2",nwarhk:"\u2923",nwarr:"\u2196",nwArr:"\u21d6",nwarrow:"\u2196",nwnear:"\u2927",Oacute:"\xd3",oacute:"\xf3",oast:"\u229b",Ocirc:"\xd4",ocirc:"\xf4",ocir:"\u229a",Ocy:"\u041e",ocy:"\u043e",odash:"\u229d",Odblac:"\u0150",odblac:"\u0151",odiv:"\u2a38",odot:"\u2299",odsold:"\u29bc",OElig:"\u0152",oelig:"\u0153",ofcir:"\u29bf",Ofr:"\ud835\udd12",ofr:"\ud835\udd2c",ogon:"\u02db",Ograve:"\xd2",ograve:"\xf2",ogt:"\u29c1",ohbar:"\u29b5",ohm:"\u03a9",oint:"\u222e",olarr:"\u21ba",olcir:"\u29be",olcross:"\u29bb",oline:"\u203e",olt:"\u29c0",Omacr:"\u014c",omacr:"\u014d",Omega:"\u03a9",omega:"\u03c9",Omicron:"\u039f",omicron:"\u03bf",omid:"\u29b6",ominus:"\u2296",Oopf:"\ud835\udd46",oopf:"\ud835\udd60",opar:"\u29b7",OpenCurlyDoubleQuote:"\u201c",OpenCurlyQuote:"\u2018",operp:"\u29b9",oplus:"\u2295",orarr:"\u21bb",Or:"\u2a54",or:"\u2228",ord:"\u2a5d",order:"\u2134",orderof:"\u2134",ordf:"\xaa",ordm:"\xba",origof:"\u22b6",oror:"\u2a56",orslope:"\u2a57",orv:"\u2a5b",oS:"\u24c8",Oscr:"\ud835\udcaa",oscr:"\u2134",Oslash:"\xd8",oslash:"\xf8",osol:"\u2298",Otilde:"\xd5",otilde:"\xf5",otimesas:"\u2a36",Otimes:"\u2a37",otimes:"\u2297",Ouml:"\xd6",ouml:"\xf6",ovbar:"\u233d",OverBar:"\u203e",OverBrace:"\u23de",OverBracket:"\u23b4",OverParenthesis:"\u23dc",para:"\xb6",parallel:"\u2225",par:"\u2225",parsim:"\u2af3",parsl:"\u2afd",part:"\u2202",PartialD:"\u2202",Pcy:"\u041f",pcy:"\u043f",percnt:"%",period:".",permil:"\u2030",perp:"\u22a5",pertenk:"\u2031",Pfr:"\ud835\udd13",pfr:"\ud835\udd2d",Phi:"\u03a6",phi:"\u03c6",phiv:"\u03d5",phmmat:"\u2133",phone:"\u260e",Pi:"\u03a0",pi:"\u03c0",pitchfork:"\u22d4",piv:"\u03d6",planck:"\u210f",planckh:"\u210e",plankv:"\u210f",plusacir:"\u2a23",plusb:"\u229e",pluscir:"\u2a22",plus:"+",plusdo:"\u2214",plusdu:"\u2a25",pluse:"\u2a72",PlusMinus:"\xb1",plusmn:"\xb1",plussim:"\u2a26",plustwo:"\u2a27",pm:"\xb1",Poincareplane:"\u210c",pointint:"\u2a15",popf:"\ud835\udd61",Popf:"\u2119",pound:"\xa3",prap:"\u2ab7",Pr:"\u2abb",pr:"\u227a",prcue:"\u227c",precapprox:"\u2ab7",prec:"\u227a",preccurlyeq:"\u227c",Precedes:"\u227a",PrecedesEqual:"\u2aaf",PrecedesSlantEqual:"\u227c",PrecedesTilde:"\u227e",preceq:"\u2aaf",precnapprox:"\u2ab9",precneqq:"\u2ab5",precnsim:"\u22e8",pre:"\u2aaf",prE:"\u2ab3",precsim:"\u227e",prime:"\u2032",Prime:"\u2033",primes:"\u2119",prnap:"\u2ab9",prnE:"\u2ab5",prnsim:"\u22e8",prod:"\u220f",Product:"\u220f",profalar:"\u232e",profline:"\u2312",profsurf:"\u2313",prop:"\u221d",Proportional:"\u221d",Proportion:"\u2237",propto:"\u221d",prsim:"\u227e",prurel:"\u22b0",Pscr:"\ud835\udcab",pscr:"\ud835\udcc5",Psi:"\u03a8",psi:"\u03c8",puncsp:"\u2008",Qfr:"\ud835\udd14",qfr:"\ud835\udd2e",qint:"\u2a0c",qopf:"\ud835\udd62",Qopf:"\u211a",qprime:"\u2057",Qscr:"\ud835\udcac",qscr:"\ud835\udcc6",quaternions:"\u210d",quatint:"\u2a16",quest:"?",questeq:"\u225f",quot:'"',QUOT:'"',rAarr:"\u21db",race:"\u223d\u0331",Racute:"\u0154",racute:"\u0155",radic:"\u221a",raemptyv:"\u29b3",rang:"\u27e9",Rang:"\u27eb",rangd:"\u2992",range:"\u29a5",rangle:"\u27e9",raquo:"\xbb",rarrap:"\u2975",rarrb:"\u21e5",rarrbfs:"\u2920",rarrc:"\u2933",rarr:"\u2192",Rarr:"\u21a0",rArr:"\u21d2",rarrfs:"\u291e",rarrhk:"\u21aa",rarrlp:"\u21ac",rarrpl:"\u2945",rarrsim:"\u2974",Rarrtl:"\u2916",rarrtl:"\u21a3",rarrw:"\u219d",ratail:"\u291a",rAtail:"\u291c",ratio:"\u2236",rationals:"\u211a",rbarr:"\u290d",rBarr:"\u290f",RBarr:"\u2910",rbbrk:"\u2773",rbrace:"}",rbrack:"]",rbrke:"\u298c",rbrksld:"\u298e",rbrkslu:"\u2990",Rcaron:"\u0158",rcaron:"\u0159",Rcedil:"\u0156",rcedil:"\u0157",rceil:"\u2309",rcub:"}",Rcy:"\u0420",rcy:"\u0440",rdca:"\u2937",rdldhar:"\u2969",rdquo:"\u201d",rdquor:"\u201d",rdsh:"\u21b3",real:"\u211c",realine:"\u211b",realpart:"\u211c",reals:"\u211d",Re:"\u211c",rect:"\u25ad",reg:"\xae",REG:"\xae",ReverseElement:"\u220b",ReverseEquilibrium:"\u21cb",ReverseUpEquilibrium:"\u296f",rfisht:"\u297d",rfloor:"\u230b",rfr:"\ud835\udd2f",Rfr:"\u211c",rHar:"\u2964",rhard:"\u21c1",rharu:"\u21c0",rharul:"\u296c",Rho:"\u03a1",rho:"\u03c1",rhov:"\u
203f1",RightAngleBracket:"\u27e9",RightArrowBar:"\u21e5",rightarrow:"\u2192",RightArrow:"\u2192",Rightarrow:"\u21d2",RightArrowLeftArrow:"\u21c4",rightarrowtail:"\u21a3",RightCeiling:"\u2309",RightDoubleBracket:"\u27e7",RightDownTeeVector:"\u295d",RightDownVectorBar:"\u2955",RightDownVector:"\u21c2",RightFloor:"\u230b",rightharpoondown:"\u21c1",rightharpoonup:"\u21c0",rightleftarrows:"\u21c4",rightleftharpoons:"\u21cc",rightrightarrows:"\u21c9",rightsquigarrow:"\u219d",RightTeeArrow:"\u21a6",RightTee:"\u22a2",RightTeeVector:"\u295b",rightthreetimes:"\u22cc",RightTriangleBar:"\u29d0",RightTriangle:"\u22b3",RightTriangleEqual:"\u22b5",RightUpDownVector:"\u294f",RightUpTeeVector:"\u295c",RightUpVectorBar:"\u2954",RightUpVector:"\u21be",RightVectorBar:"\u2953",RightVector:"\u21c0",ring:"\u02da",risingdotseq:"\u2253",rlarr:"\u21c4",rlhar:"\u21cc",rlm:"\u200f",rmoustache:"\u23b1",rmoust:"\u23b1",rnmid:"\u2aee",roang:"\u27ed",roarr:"\u21fe",robrk:"\u27e7",ropar:"\u2986",ropf:"\ud835\udd63",Ropf:"\u211d",roplus:"\u2a2e",rotimes:"\u2a35",RoundImplies:"\u2970",rpar:")",rpargt:"\u2994",rppolint:"\u2a12",rrarr:"\u21c9",Rrightarrow:"\u21db",rsaquo:"\u203a",rscr:"\ud835\udcc7",Rscr:"\u211b",rsh:"\u21b1",Rsh:"\u21b1",rsqb:"]",rsquo:"\u2019",rsquor:"\u2019",rthree:"\u22cc",rtimes:"\u22ca",rtri:"\u25b9",rtrie:"\u22b5",rtrif:"\u25b8",rtriltri:"\u29ce",RuleDelayed:"\u29f4",ruluhar:"\u2968",rx:"\u211e",Sacute:"\u015a",sacute:"\u015b",sbquo:"\u201a",scap:"\u2ab8",Scaron:"\u0160",scaron:"\u0161",Sc:"\u2abc",sc:"\u227b",sccue:"\u227d",sce:"\u2ab0",scE:"\u2ab4",Scedil:"\u015e",scedil:"\u015f",Scirc:"\u015c",scirc:"\u015d",scnap:"\u2aba",scnE:"\u2ab6",scnsim:"\u22e9",scpolint:"\u2a13",scsim:"\u227f",Scy:"\u0421",scy:"\u0441",sdotb:"\u22a1",sdot:"\u22c5",sdote:"\u2a66",searhk:"\u2925",searr:"\u2198",seArr:"\u21d8",searrow:"\u2198",sect:"\xa7",semi:";",seswar:"\u2929",setminus:"\u2216",setmn:"\u2216",sext:"\u2736",Sfr:"\ud835\udd16",sfr:"\ud835\udd30",sfrown:"\u2322",sharp:"\u266f",SHCHcy:"\u0429",shchcy:"\u0449",SHcy:"\u0428",shcy:"\u0448",ShortDownArrow:"\u2193",ShortLeftArrow:"\u2190",shortmid:"\u2223",shortparallel:"\u2225",ShortRightArrow:"\u2192",ShortUpArrow:"\u2191",shy:"\xad",Sigma:"\u03a3",sigma:"\u03c3",sigmaf:"\u03c2",sigmav:"\u03c2",sim:"\u223c",simdot:"\u2a6a",sime:"\u2243",simeq:"\u2243",simg:"\u2a9e",simgE:"\u2aa0",siml:"\u2a9d",simlE:"\u2a9f",simne:"\u2246",simplus:"\u2a24",simrarr:"\u2972",slarr:"\u2190",SmallCircle:"\u2218",smallsetminus:"\u2216",smashp:"\u2a33",smeparsl:"\u29e4",smid:"\u2223",smile:"\u2323",smt:"\u2aaa",smte:"\u2aac",smtes:"\u2aac\ufe00",SOFTcy:"\u042c",softcy:"\u044c",solbar:"\u233f",solb:"\u29c4",sol:"/",Sopf:"\ud835\udd4a",sopf:"\ud835\udd64",spades:"\u2660",spadesuit:"\u2660",spar:"\u2225",sqcap:"\u2293",sqcaps:"\u2293\ufe00",sqcup:"\u2294",sqcups:"\u2294\ufe00",Sqrt:"\u221a",sqsub:"\u228f",sqsube:"\u2291",sqsubset:"\u228f",sqsubseteq:"\u2291",sqsup:"\u2290",sqsupe:"\u2292",sqsupset:"\u2290",sqsupseteq:"\u2292",square:"\u25a1",Square:"\u25a1",SquareIntersection:"\u2293",SquareSubset:"\u228f",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",squarf:"\u25aa",squ:"\u25a1",squf:"\u25aa",srarr:"\u2192",Sscr:"\ud835\udcae",sscr:"\ud835\udcc8",ssetmn:"\u2216",ssmile:"\u2323",sstarf:"\u22c6",Star:"\u22c6",star:"\u2606",starf:"\u2605",straightepsilon:"\u03f5",straightphi:"\u03d5",strns:"\xaf",sub:"\u2282",Sub:"\u22d0",subdot:"\u2abd",subE:"\u2ac5",sube:"\u2286",subedot:"\u2ac3",submult:"\u2ac1",subnE:"\u2acb",subne:"\u228a",subplus:"\u2abf",subrarr:"\u2979",subset:"\u2282",Subset:"\u22d0",subseteq:"\u2286",subseteqq:"\u2ac5",SubsetEqual:"\u2286",subsetneq:"\u228a",subsetneqq:"\u2acb",subsim:"\u2ac7",subsub:"\u2ad5",subsup:"\u2ad3",succapprox:"\u2ab8",succ:"\u227b",succcurlyeq:"\u227d",Succeeds:"\u227b",SucceedsEqual:"\u2ab0",SucceedsSlantEqual:"\u227d",SucceedsTilde:"\u227f",succeq:"\u2ab0",succnapprox:"\u2aba",succneqq:"\u2ab6",succnsim:"\u22e9",succsim:"\u227f",SuchThat:"\u220b",sum:"\u2211",Sum:"\u2211",sung:"\u266a",sup1:"\xb9",sup2:"\xb2",sup3:"\xb3",sup:"\u2283",Sup:"\u22d1",supdot:"\u2abe",supdsub:"\u2ad8",supE:"\u2ac6",supe:"\u2287",supedot:"\u2ac4",Superset:"\u2283",SupersetEqual:"\u2287",suphsol:"\u27c9",suphsub
2:"\u2ad7",suplarr:"\u297b",supmult:"\u2ac2",supnE:"\u2acc",supne:"\u228b",supplus:"\u2ac0",supset:"\u2283",Supset:"\u22d1",supseteq:"\u2287",supseteqq:"\u2ac6",supsetneq:"\u228b",supsetneqq:"\u2acc",supsim:"\u2ac8",supsub:"\u2ad4",supsup:"\u2ad6",swarhk:"\u2926",swarr:"\u2199",swArr:"\u21d9",swarrow:"\u2199",swnwar:"\u292a",szlig:"\xdf",Tab:"\t",target:"\u2316",Tau:"\u03a4",tau:"\u03c4",tbrk:"\u23b4",Tcaron:"\u0164",tcaron:"\u0165",Tcedil:"\u0162",tcedil:"\u0163",Tcy:"\u0422",tcy:"\u0442",tdot:"\u20db",telrec:"\u2315",Tfr:"\ud835\udd17",tfr:"\ud835\udd31",there4:"\u2234",therefore:"\u2234",Therefore:"\u2234",Theta:"\u0398",theta:"\u03b8",thetasym:"\u03d1",thetav:"\u03d1",thickapprox:"\u2248",thicksim:"\u223c",ThickSpace:"\u205f\u200a",ThinSpace:"\u2009",thinsp:"\u2009",thkap:"\u2248",thksim:"\u223c",THORN:"\xde",thorn:"\xfe",tilde:"\u02dc",Tilde:"\u223c",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",timesbar:"\u2a31",timesb:"\u22a0",times:"\xd7",timesd:"\u2a30",tint:"\u222d",toea:"\u2928",topbot:"\u2336",topcir:"\u2af1",top:"\u22a4",Topf:"\ud835\udd4b",topf:"\ud835\udd65",topfork:"\u2ada",tosa:"\u2929",tprime:"\u2034",trade:"\u2122",TRADE:"\u2122",triangle:"\u25b5",triangledown:"\u25bf",triangleleft:"\u25c3",trianglelefteq:"\u22b4",triangleq:"\u225c",triangleright:"\u25b9",trianglerighteq:"\u22b5",tridot:"\u25ec",trie:"\u225c",triminus:"\u2a3a",TripleDot:"\u20db",triplus:"\u2a39",trisb:"\u29cd",tritime:"\u2a3b",trpezium:"\u23e2",Tscr:"\ud835\udcaf",tscr:"\ud835\udcc9",TScy:"\u0426",tscy:"\u0446",TSHcy:"\u040b",tshcy:"\u045b",Tstrok:"\u0166",tstrok:"\u0167",twixt:"\u226c",twoheadleftarrow:"\u219e",twoheadrightarrow:"\u21a0",Uacute:"\xda",uacute:"\xfa",uarr:"\u2191",Uarr:"\u219f",uArr:"\u21d1",Uarrocir:"\u2949",Ubrcy:"\u040e",ubrcy:"\u045e",Ubreve:"\u016c",ubreve:"\u016d",Ucirc:"\xdb",ucirc:"\xfb",Ucy:"\u0423",ucy:"\u0443",udarr:"\u21c5",Udblac:"\u0170",udblac:"\u0171",udhar:"\u296e",ufisht:"\u297e",Ufr:"\ud835\udd18",ufr:"\ud835\udd32",Ugrave:"\xd9",ugrave:"\xf9",uHar:"\u2963",uharl:"\u21bf",uharr:"\u21be",uhblk:"\u2580",ulcorn:"\u231c",ulcorner:"\u231c",ulcrop:"\u230f",ultri:"\u25f8",Umacr:"\u016a",umacr:"\u016b",uml:"\xa8",UnderBar:"_",UnderBrace:"\u23df",UnderBracket:"\u23b5",UnderParenthesis:"\u23dd",Union:"\u22c3",UnionPlus:"\u228e",Uogon:"\u0172",uogon:"\u0173",Uopf:"\ud835\udd4c",uopf:"\ud835\udd66",UpArrowBar:"\u2912",uparrow:"\u2191",UpArrow:"\u2191",Uparrow:"\u21d1",UpArrowDownArrow:"\u21c5",updownarrow:"\u2195",UpDownArrow:"\u2195",Updownarrow:"\u21d5",UpEquilibrium:"\u296e",upharpoonleft:"\u21bf",upharpoonright:"\u21be",uplus:"\u228e",UpperLeftArrow:"\u2196",UpperRightArrow:"\u2197",upsi:"\u03c5",Upsi:"\u03d2",upsih:"\u03d2",Upsilon:"\u03a5",upsilon:"\u03c5",UpTeeArrow:"\u21a5",UpTee:"\u22a5",upuparrows:"\u21c8",urcorn:"\u231d",urcorner:"\u231d",urcrop:"\u230e",Uring:"\u016e",uring:"\u016f",urtri:"\u25f9",Uscr:"\ud835\udcb0",uscr:"\ud835\udcca",utdot:"\u22f0",Utilde:"\u0168",utilde:"\u0169",utri:"\u25b5",utrif:"\u25b4",uuarr:"\u21c8",Uuml:"\xdc",uuml:"\xfc",uwangle:"\u29a7",vangrt:"\u299c",varepsilon:"\u03f5",varkappa:"\u03f0",varnothing:"\u2205",varphi:"\u03d5",varpi:"\u03d6",varpropto:"\u221d",varr:"\u2195",vArr:"\u21d5",varrho:"\u03f1",varsigma:"\u03c2",varsubsetneq:"\u228a\ufe00",varsubsetneqq:"\u2acb\ufe00",varsupsetneq:"\u228b\ufe00",varsupsetneqq:"\u2acc\ufe00",vartheta:"\u03d1",vartriangleleft:"\u22b2",vartriangleright:"\u22b3",vBar:"\u2ae8",Vbar:"\u2aeb",vBarv:"\u2ae9",Vcy:"\u0412",vcy:"\u0432",vdash:"\u22a2",vDash:"\u22a8",Vdash:"\u22a9",VDash:"\u22ab",Vdashl:"\u2ae6",veebar:"\u22bb",vee:"\u2228",Vee:"\u22c1",veeeq:"\u225a",vellip:"\u22ee",verbar:"|",Verbar:"\u2016",vert:"|",Vert:"\u2016",VerticalBar:"\u2223",VerticalLine:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",VeryThinSpace:"\u200a",Vfr:"\ud835\udd19",vfr:"\ud835\udd33",vltri:"\u22b2",vnsub:"\u2282\u20d2",vnsup:"\u2283\u20d2",Vopf:"\ud835\udd4d",vopf:"\ud835\udd67",vprop:"\u221d",vrtri:"\u22b3",Vscr:"\ud835\udcb1",vscr:"\ud835\udccb",vsubnE:"\u2acb\ufe00",vsubne:"\u228a\ufe00",vsupnE:"\u2acc\ufe00",vsupne:"\u228b\ufe00",Vvdash:"\u22aa",vzigzag:"\u299a",Wcirc:"\u0174",wcirc:"\u0175",wedbar:"\u2a5f",wedge:"\u2227",Wedge:"\u22c0",wedgeq:"\u2259",weierp:"\u2118",Wfr:"\ud835\udd1a",wfr:"\ud835\udd34",Wopf:"\ud835\udd4e",wopf:"\ud835\udd68",wp:"\u2118",wr:"\u2240",wreath:"\u2240",Wscr:"\ud835\udcb2",wscr:"\ud835\udccc",xcap:"\u22c2",xcirc:"\u25ef",xcup:"\u22c3",xdtri:"\u25bd",Xfr:"\ud835\udd1b",xfr:"\ud835\udd35",xharr:"\u27f7",xhArr:"\u27fa",Xi:"\u039e",xi:"\u03be",xlarr:"\u27f5",xlArr:"\u27f8",xmap:"\u27fc",xnis:"\u22fb",xod
2ot:"\u2a00",Xopf:"\ud835\udd4f",xopf:"\ud835\udd69",xoplus:"\u2a01",xotime:"\u2a02",xrarr:"\u27f6",xrArr:"\u27f9",Xscr:"\ud835\udcb3",xscr:"\ud835\udccd",xsqcup:"\u2a06",xuplus:"\u2a04",xutri:"\u25b3",xvee:"\u22c1",xwedge:"\u22c0",Yacute:"\xdd",yacute:"\xfd",YAcy:"\u042f",yacy:"\u044f",Ycirc:"\u0176",ycirc:"\u0177",Ycy:"\u042b",ycy:"\u044b",yen:"\xa5",Yfr:"\ud835\udd1c",yfr:"\ud835\udd36",YIcy:"\u0407",yicy:"\u0457",Yopf:"\ud835\udd50",yopf:"\ud835\udd6a",Yscr:"\ud835\udcb4",yscr:"\ud835\udcce",YUcy:"\u042e",yucy:"\u044e",yuml:"\xff",Yuml:"\u0178",Zacute:"\u0179",zacute:"\u017a",Zcaron:"\u017d",zcaron:"\u017e",Zcy:"\u0417",zcy:"\u0437",Zdot:"\u017b",zdot:"\u017c",zeetrf:"\u2128",ZeroWidthSpace:"\u200b",Zeta:"\u0396",zeta:"\u03b6",zfr:"\ud835\udd37",Zfr:"\u2128",ZHcy:"\u0416",zhcy:"\u0436",zigrarr:"\u21dd",zopf:"\ud835\udd6b",Zopf:"\u2124",Zscr:"\ud835\udcb5",zscr:"\ud835\udccf",zwj:"\u200d",zwnj:"\u200c"},m={Aacute:"\xc1",aacute:"\xe1",Acirc:"\xc2",acirc:"\xe2",acute:"\xb4",AElig:"\xc6",aelig:"\xe6",Agrave:"\xc0",agrave:"\xe0",amp:"&",AMP:"&",Ar
2ing:"\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"},v={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'},g={},y=a&&a.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(g,"__esModule",{value:!0});var b=y({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}),w=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)};g.default=function(e){return e>=55296&&e<=57343||e>1114111?"\ufffd":(e in b.default&&(e=b.default[e]),w(e))};var k=a&&a.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(f,"__esModule",{value:!0}),f.decodeHTML=f.decodeHTMLStrict=f.decodeXML=void 0;var x=k(h),C=k(m),T=k(v),E=k(g),M=/&(?:[a-zA-Z0-9]+|#[xX][\da-fA-F]+|#\d+);/g;function N(e){var t=D(e);return function(e){return String(e).replace(M,t)}}f.decodeXML=N(T.default),f.decodeHTMLStrict=N(x.default);var S=function(e,t){return e<t?1:-1};function D(e){return function(t){if("#"===t.charAt(1)){var n=t.charAt(2);return"X"===n||"x"===n?E.default(parseInt(t.substr(3),16)):E.default(parseInt(t.substr(2),10))}return e[t.slice(1,-1)]||t}}f.decodeHTML=function(){for(var e=Object.keys(C.default).sort(S),t=Object.keys(x.default).sort(S),n=0,r=0;n<t.length;n++)e[r]===t[n]?(t[n]+=";?",r++):t[n]+=";";var i=new RegExp("&(?:"+t.join("|")+"|#[xX][\\da-fA-F]+;?|#\\d+;?)","g"),o=D(x.default);function a(e){return";"!==e.substr(-1)&&(e+=";"),o(e)}return function(e){return String(e).replace(i,a)}}();var L={},A=a&&a.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(L,"__esModule",{value:!0}),L.escapeUTF8=L.escape=L.encodeNonAsciiHTML=L.encodeHTML=L.encodeXML=void 0;var O=H(A(v).default),I=q(O);L.encodeXML=U(O);var R,P,B=H(A(h).default),F=q(B);function H(e){return Object.keys(e).sort().reduce((function(t,n){return t[e[n]]="&"+n+";",t}),{})}function q(e){for(var t=[],n=[],r=0,i=Object.keys(e);r<i.length;r++){var o=i[r];1===o.length?t.push("\\"+o):n.push(o)}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("")+"]"),new RegExp(n.join("|"),"g")}L.encodeHTML=(R=B,P=F,function(e){return e.replace(P,(function(e){return R[e]})).replace(z,V)}),L.encodeNonAsciiHTML=U(B);var z=/(?:[\x80-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/g,j=null!=String.prototype.codePointAt?function(e){return e.codePointAt(0)}:function(e){return 1024*(e.charCodeAt(0)-55296)+e.charCodeAt(1)-56320+65536};function V(e){return"&#x"+(e.length>1?j(e):e.charCodeAt(0)).toString(16).toUpperCase()+";"}var _=new RegExp(I.source+"|"+z.source,"g");function U(e){return function(t){return t.replace(_,(function(t){return e[t]||V(t)}))}}L.escape=function(e){return e.replace(_,V)},L.escapeUTF8=function(e){return e.replace(I,V)}
2,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;var t=f,n=L;e.decode=function(e,n){return(!n||n<=0?t.decodeXML:t.decodeHTML)(e)},e.decodeStrict=function(e,n){return(!n||n<=0?t.decodeXML:t.decodeHTMLStrict)(e)},e.encode=function(e,t){return(!t||t<=0?n.encodeXML:n.encodeHTML)(e)};var r=L;Object.defineProperty(e,"encodeXML",{enumerable:!0,get:function(){return r.encodeXML}}),Object.defineProperty(e,"encodeHTML",{enumerable:!0,get:function(){return r.encodeHTML}}),Object.defineProperty(e,"encodeNonAsciiHTML",{enumerable:!0,get:function(){return r.encodeNonAsciiHTML}}),Object.defineProperty(e,"escape",{enumerable:!0,get:function(){return r.escape}}),Object.defineProperty(e,"escapeUTF8",{enumerable:!0,get:function(){return r.escapeUTF8}}),Object.defineProperty(e,"encodeHTML4",{enumerable:!0,get:function(){return r.encodeHTML}}),Object.defineProperty(e,"encodeHTML5",{enumerable:!0,get:function(){return r.encodeHTML}});var i=f;Object.defineProperty(e,"decodeXML",{enumerable:!0,get:function(){return i.decodeXML}}),Object.defineProperty(e,"decodeHTML",{enumerable:!0,get:function(){return i.decodeHTML}}),Object.defineProperty(e,"decodeHTMLStrict",{enumerable:!0,get:function(){return i.decodeHTMLStrict}}),Object.defineProperty(e,"decodeHTML4",{enumerable:!0,get:function(){return i.decodeHTML}}),Object.defineProperty(e,"decodeHTML5",{enumerable:!0,get:function(){return i.decodeHTML}}),Object.defineProperty(e,"decodeHTML4Strict",{enumerable:!0,get:function(){return i.decodeHTMLStrict}}),Object.defineProperty(e,"decodeHTML5Strict",{enumerable:!0,get:function(){return i.decodeHTMLStrict}}),Object.defineProperty(e,"decodeXMLStrict",{enumerable:!0,get:function(){return i.decodeXML}})}(d);var $="&(?:#x[a-f0-9]{1,6}|#[0-9]{1,7}|[a-z][a-z0-9]{1,31});",Z=/[\\&]/,W="[!\"#$%&'()*+,./:;<=>?@[\\\\\\]^_`{|}~-]",G=new RegExp("\\\\"+W+"|"+$,"gi"),J=new RegExp('[&<>"]',"g"),K=function(e){return 92===e.charCodeAt(0)?e.charAt(1):d.decodeHTML(e)};function X(e){return Z.test(e)?e.replace(G,K):e}function Q(e){try{return p(e)}catch(t){return e}}function Y(e){switch(e){case"&":return"&amp;";case"<":return"&lt;";case">":return"&gt;";case'"':return"&quot;";default:return e}}function ee(e){return J.test(e)?e.replace(J,Y):e}function te(e,t){for(var n=[],r=0;r<t;r++)n.push(e);return n.join("")}function ne(e){return!e||!/[^ \t]+/.test(e)}var re=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=ie(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 ie(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 oe=1,ae={};function se(e){delete ae[e]}var le=function(){function e(e,t){this.parent=null,this.prev=null,this.next=null,this.firstChild=null,this.lastChild=null,this.literal=null,this.id="document"===e?-1:oe++,this.type=e,this.sourcepos=t,ae[this.id]=this}return e.prototype.isContainer=function(){return ie(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.lastChild=e):(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 re(this)},e}(),ue=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 r(t,e),t}(le),ce=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.listData=null,t}return r(t,e),t}(ue),pe=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.level=0,t.headingType="atx",t}return r(t,e),t}(ue),de=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 r(t,e),t}(ue),fe=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.columns=[],t}return r(t,e),t}(ue),he=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 r(t,e),t}(ue),me=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.title="",t.dest="",t.label="",t}return r(t,e),t}(ue),ve=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.syntaxLength=0,t.offset=-1,t.info="",t}return r(t,e),t}(ue),ge=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.htmlBlockType=-1,t}return r(t,e),t}(ue),ye=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 r(t,e),t}(le),be=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.tickCount=0,t}return r(t,e),t}(le),we=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.info="",t}return r(t,e),t}(le);function ke(e,t){switch(e){case"heading":return new pe(e,t);case"list":case"item":return new ce(e,t);case"link":case"image":return new ye(e,t);case"codeBlock":return new de(e,t);case"htmlBlock":return new ge(e,t);case"table":return new fe(e,t);case"tableCell":return new he(e,t);case"document":case"paragraph":case"blockQuote":case"thematicBreak":case"tableRow":case"tableBody":case"tableHead":case"frontMatter":return new ue(e,t);case"code":return new be(e,t);case"refDef":return new me(e,t);case"customBlock":return new ve(e,t);case"customInline":return new we(e,t);default:return new le(e,t)}}function xe(e){return"codeBlock"===e.type}function Ce(e){return"list"===e.type}function Te(e){return"refDef"===e.type}function Ee(e){return"customBlock"===e.type}function Me(e,t){var n=ke("text",t);return n.literal=e,n}var Ne,Se="[A-Za-z][A-Za-z0-9-]*",De="<"+Se+"(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^\"'=<>`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)*\\s*/?>",Le="</"+Se+"\\s*[>]",Ae=new RegExp("^(?:"+De+"|"+Le+"|\x3c!----\x3e|\x3c!--(?:-?[^>-])(?:-?[^-])*--\x3e|[<][?].*?[?][>]|<![A-Z]+\\s+[^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)","i");if(String.fromCodePoint)Ne=function(e){try{return String.fromCodePoint(e)}catch(t){if(t instanceof RangeError)return String.fromCharCode(65533);throw t}};else{var Oe=String.fromCharCode,Ie=Math.floor;Ne=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n,r,i=[],o=-1,a=e.length;if(!a)return"";for(var s="";++o<a;){var l=Number(e[o]);if(!isFinite(l)||l<0||l>1114111||Ie(l)!==l)return String.fromCharCode(65533);l<=65535?i.push(l):(n=55296+((l-=65536)>>10),r=l%1024+56320,i.push(n,r)),(o+1===a||i.length>16384)&&(s+=Oe.apply(void 0,i),i.length=0)}return s}}var Re=Ne,Pe="(?:[w-]+.)*[A-Za-z0-9-]+.[A-Za-z0-9-]+",Be="[^<\\s]*[^<?!.,:*_?~\\s]",Fe="[\\w.+-]+@(?:[\\w-]+\\.)+[\\w-]+";function He(e){var t=/\)+$/.exec(e);if(t){for(var n=0,r=0,i=e;r<i.length;r++){var o=i[r];"("===o?n<0?n=1:n+=1:")"===o&&(n-=1)}if(n<0){var a=Math.min(-n,t[0].length);return e.substring(0,e.length-a)}}return e}function qe(e){return e.replace(/&[A-Za-z0-9]+;$/,"")}function ze(e){return o(o([],function(e){for(var t,n=new RegExp("(www|https?://)."+Pe+Be,"g"),r=[];t=n.exec(e);){var i=qe(He(t[0])),o="www"===t[1]?"http://":"";r.push({text:i,range:[t.index,t.index+i.length-1],url:""+o+i})}return r}(e)),function(e){for(var t,n=new RegExp(Fe,"g"),r=[];t=n.exec(e);){var i=t[0];/[_-]+$/.test(i)||r.push({text:i,range:[t.index,t.index+i.length-1],url:"mailto:"+i})}return r}(e)).sort((function(e,t){return e.range[0]-t.range[0]}))}function je(e){return e[e.length-1]}function Ve(e){return e.slice(1,e.length-1).trim().replace(/[ \t\r\n]+/," ").toLowerCase().toUpperCase()}function _e(e,t){Object.keys(e).forEach((function(n){t(n,e[n])}))}function Ue(e){return!Object.keys(e).length}var $e=126,Ze=39,We=34,Ge=36,Je="\\\\"+W,Ke=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]/),Xe=new RegExp('^(?:"('+Je+'|[^"\\x00])*"|\'('+Je+"|[^'\\x00])*'|\\(("+Je+"|[^()\\x00])*\\))"),Qe=/^(?:<(?:[^<>\n\\\x00]|\\.)*>)/,Ye=new RegExp("^"+W),et=new RegExp("^"+$,"i"),tt=/`+/,nt=/^`+/,rt=/\.\.\./g,it=/--+/g,ot=/^<([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])?)*)>/,at=/^<[A-Za-z][A-Za-z0-9.+-]{1,31}:[^<>\x00-\x20]*>/i,st=/^ *(?:\n *)?/,lt=/^[ \t\n\x0b\x0c\x0d]/,ut=/^\s/,ct=/ *$/,pt=/^ */,dt=/^ *(?:\n|$)/,ft=/^\[(?:[^\\\[\]]|\\.){0,1000}\]/,ht=/^[^\n`\[\]\\!<&*_'"~$]+/m,mt=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,i=[r,e+n];return"number"===typeof t?[i,[r,t+n]]:i},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(st),!0},e.prototype.parseBackticks=function(e){var t=this.pos+1,n=this.match(nt);if(null===n)return!1;for(var r,i=this.pos;null!==(r=this.match(tt));)if(r===n){var o=this.subject.slice(i,this.pos-n.length),a=this.sourcepos(t,this.pos),s=o.split("\n");if(s.length>1){var l=je(s);this.lineIdx+=s.length-1,this.linePosOffset=-(this.pos-l.length-n.length),a[1]=this.sourcepos(this.pos),o=s.join(" ")}
2var u=ke("code",a);return o.length>0&&null!==o.match(/[^ ]/)&&" "==o[0]&&" "==o[o.length-1]?u.literal=o.slice(1,o.length-1):u.literal=o,u.tickCount=n.length,e.appendChild(u),!0}return this.pos=i,e.appendChild(Me(n,this.sourcepos(t,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=ke("linebreak",this.sourcepos(this.pos-1,this.pos)),e.appendChild(t),this.nextLine()):Ye.test(n.charAt(this.pos))?(e.appendChild(Me(n.charAt(this.pos),this.sourcepos(r,this.pos))),this.pos+=1):e.appendChild(Me("\\",this.sourcepos(r,r))),!0},e.prototype.parseAutolink=function(e){var t,n,r,i=this.pos+1;return(t=this.match(ot))?(n=t.slice(1,t.length-1),(r=ke("link",this.sourcepos(i,this.pos))).destination=Q("mailto:"+n),r.title="",r.appendChild(Me(n,this.sourcepos(i+1,this.pos-1))),e.appendChild(r),!0):!!(t=this.match(at))&&(n=t.slice(1,t.length-1),(r=ke("link",this.sourcepos(i,this.pos))).destination=Q(n),r.title="",r.appendChild(Me(n,this.sourcepos(i+1,this.pos-1))),e.appendChild(r),!0)},e.prototype.parseHtmlTag=function(e){var t=this.pos+1,n=this.match(Ae);if(null===n)return!1;var r=ke("htmlInline",this.sourcepos(t,this.pos));return r.literal=n,e.appendChild(r),!0},e.prototype.scanDelims=function(e){var t=0,n=this.pos;if(e===Ze||e===We)t++,this.pos++;else for(;this.peek()===e;)t++,this.pos++;if(0===t||t<2&&(e===$e||e===Ge))return this.pos=n,null;var r,i=0===n?"\n":this.subject.charAt(n-1),o=this.peek();r=-1===o?"\n":Re(o);var a,s,l=ut.test(r),u=Ke.test(r),c=ut.test(i),p=Ke.test(i),d=!l&&(!u||c||p),f=!c&&(!p||l||u);return 95===e?(a=d&&(!f||p),s=f&&(!d||u)):e===Ze||e===We?(a=d&&!f,s=f):e===Ge?(a=!l,s=!c):(a=d,s=f),this.pos=n,{numdelims:t,canOpen:a,canClose:s}},e.prototype.handleDelim=function(e,t){var n=this.scanDelims(e);if(!n)return!1;var r=n.numdelims,i=this.pos+1;this.pos+=r;var o=Me(e===Ze?"\u2019":e===We?"\u201c":this.subject.slice(i-1,this.pos),this.sourcepos(i,this.pos));return t.appendChild(o),(n.canOpen||n.canClose)&&(this.options.smart||e!==Ze&&e!==We)&&(this.delimiters={cc:e,numdelims:r,origdelims:r,node:o,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,i,o,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(i=r,p||c===$e||c===Ge)if(s){if(n){var d=r.numdelims>=2&&n.numdelims>=2?2:1,f=p?0:1;o=n.node,a=r.node;var h=p?1===d?"emph":"strong":"strike";c===Ge&&(h="customInline");var m=ke(h),v=o.sourcepos[1],g=a.sourcepos[0];m.sourcepos=[[v[0],v[1]-d+1],[g[0],g[1]+d-1]],o.sourcepos[1][1]-=d,a.sourcepos[0][1]+=d,o.literal=o.literal.slice(d),a.literal=a.literal.slice(d),n.numdelims-=d,r.numdelims-=d;for(var y=o.next,b=void 0;y&&y!==a;)b=y.next,y.unlink(),m.appendChild(y),y=b;if(c===Ge){var w=m.firstChild,k=w.literal||"",x=k.split(/\s/)[0];m.info=x,k.length<=x.length?w.unlink():(w.sourcepos[0][1]+=x.length,w.literal=k.replace(x+" ",""))}if(o.insertAfter(m),this.removeDelimitersBetween(n,r),n.numdelims<=f&&(0===n.numdelims&&o.unlink(),this.removeDelimiter(n)),r.numdelims<=f){0===r.numdelims&&a.unlink();var C=r.next;this.removeDelimiter(r),r=C}}}else r=r.next;else c===Ze?(r.node.literal="\u2019",s&&(n.node.literal="\u2018"),r=r.next):c===We&&(r.node.literal="\u201d",s&&(n.node.literal="\u201c"),r=r.next);s||(u[c][p?i.origdelims%3:0]=i.previous,i.canOpen||this.removeDelimiter(i))}else r=r.next}for(;null!==this.delimiters&&this.delimiters!==e;)this.removeDelimiter(this.delimiters)},e.prototype.parseLinkTitle=function(){var e=this.match(Xe);return null===e?null:X(e.substr(1,e.length-2))},e.prototype.parseLinkDestination=function(){var e=this.match(Qe);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&&Ye.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;this.pos+=1,n-=1}else{if(null!==lt.exec(Re(r)))break;this.pos+=1}return this.pos===t&&41!==r||0!==n?null:Q(X(e=this.subject.substr(t,this.pos-t)))}return Q(X(e.substr(1,e.length-2)))},e.prototype.parseLinkLabel=function(){var e=this.match(ft);return null===e||e.length>1001?0:e.length},e.prototype.parseOpenBracket=function(e){var t=this.pos;this.pos+=1;var n=Me("[",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=Me("![",this.sourcepos(this.pos-1,this.pos));e.appendChild(n),this.addBracket(n,t+1,!0)}else n=Me("!",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 i=this.pos,o=this.brackets;if(null===o)return e.appendChild(Me("]",this.sourcepos(i,i))),!0;if(!o.active)return e.appendChild(Me("]",this.sourcepos(i,i))),this.removeBracket(),!0;var a=o.image,s=this.pos;40===this.peek()&&(this.pos++,this.spnl()&&null!==(t=this.parseLinkDestination())&&this.spnl()&&(lt.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):o.bracketAfter||(l=this.subject.slice(o.index,i)),0===c&&(this.pos=s),l){l=Ve(l);var p=this.refMap[l];p&&(t=p.destination,n=p.title,r=!0)}}if(r){var d=ke(a?"image":"link");d.destination=t,d.title=n||"",d.sourcepos=[o.startpos,this.sourcepos(this.pos)];for(var f=o.node.next,h=void 0;f;)h=f.next,f.unlink(),d.appendChild(f),f=h;if(e.appendChild(d),this.processEmphasis(o.previousDelimiter),this.removeBracket(),o.node.unlink(),!a)for(o=this.brackets;null!==o;)o.image||(o.active=!1),o=o.previous;return this.options.referenceDefinition&&(this.refLinkCandidateMap[e.id]={node:e,refL
2abel:l}),!0}return this.removeBracket(),this.pos=i,e.appendChild(Me("]",this.sourcepos(i,i))),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?0:1)),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(et))&&(e.appendChild(Me(d.decodeHTML(t),this.sourcepos(n,this.pos))),!0)},e.prototype.parseString=function(e){var t,n=this.pos+1;if(t=this.match(ht)){if(this.options.smart){var r=t.replace(rt,"\u2026").replace(it,(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),te("\u2014",n)+te("\u2013",t)}));e.appendChild(Me(r,this.sourcepos(n,this.pos)))}else{var i=Me(t,this.sourcepos(n,this.pos));e.appendChild(i)}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(ct,"");var i=r-t.literal.length;t.sourcepos[1][1]-=i,e.appendChild(ke(n?"linebreak":"softbreak",this.sourcepos(this.pos-i,this.pos)))}else e.appendChild(ke("softbreak",this.sourcepos(this.pos,this.pos)));return this.nextLine(),this.match(pt),!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,i=this.parseLinkLabel();if(0===i)return 0;var o=this.subject.substr(0,i);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(dt)&&(""===n?l=!1:(n="",this.pos=s,l=null!==this.match(dt))),!l)return this.pos=r,0;var u=Ve(o);if(""===u)return this.pos=r,0;var c=this.getReferenceDefSourcepos(e);e.sourcepos[0][0]=c[1][0]+1;var p=ke("refDef",c);return p.title=n,p.dest=a,p.label=u,e.insertBefore(p),t[u]?this.refDefCandidateMap[p.id]=p:t[u]=pn(p),this.pos-r},e.prototype.mergeTextNodes=function(e){for(var t,n=[];t=e.next();){var r=t.entering,i=t.node;if(r&&"text"===i.type)n.push(i);else if(1===n.length)n=[];else if(n.length>1){var o=n[0],a=n[n.length-1];o.sourcepos&&a.sourcepos&&(o.sourcepos[1]=a.sourcepos[1]),o.next=a.next,o.next&&(o.next.prev=o);for(var s=1;s<n.length;s+=1)o.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,i={line:0,ch:0},o=0;o<t.length;o+=1){var a=t[o];if(lt.test(a))break;if(/\:/.test(a)&&0===r){if(n)break;var s=a.indexOf(":")===a.length-1?o+1:o;i={line:s,ch:t[s].length},n=!0}var l=a.match(/'|"/g);if(l&&(r+=l.length),2===r){i={line:o,ch:a.length};break}}return[[e.sourcepos[0][0],e.sourcepos[0][1]],[e.sourcepos[0][0]+i.line,i.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 $e:case Ge:n=this.handleDelim(r,e);break;case Ze:case We:n=!!(null===(t=this.options)||void 0===t?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(Me(Re(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],function(e){return"heading"===e.type}(e)&&(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;"boolean"===typeof t&&(t=ze);for(var r=function(){var e=n.entering,r=n.node;if(e&&"text"===r.type&&"link"!==r.parent.type){var i=r.literal,o=t(i);if(!o||!o.length)return"continue";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,f=o;d<f.length;d++){var h=f[d],m=h.range,v=h.url,g=h.text;m[0]>a&&p.push(Me(i.substring(a,m[0]),c(a,m[0]-1)));var y=ke("link",c.apply(void 0,m));y.appendChild(Me(g,c.apply(void 0,m))),y.destination=v,y.extendedAutolink=!0,p.push(y),a=m[1]+1}a<i.length&&p.push(Me(i.substring(a),c(a,i.length-1)));for(var b=0,w=p;b<w.length;b++){var k=w[b];r.insertBefore(k)}r.unlink()}};n=e.next();)r()}(e.walker(),n),r&&e.firstChild)for(var i,o=e.firstChild.walker();i=o.next();){var a=i.node,s=i.entering;r[a.type]&&r[a.type](a,{entering:s,options:this.options})}},e}(),vt=/^\[([ \txX])\][ \t]+/,gt=9,yt=32,bt=/[^ \t\f\v\r\n]/,wt=/^(?:`{3,}|~{3,})(?= *$)/;function kt(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 xt(e,t){return t<e.length?e.charCodeAt(t):-1}function Ct(e){return!bt.test(e)}function Tt(e){return e===yt||e===gt}var Et=/^\$\$$/,Mt={continue:function(e,t){var n=e.currentLine,r=n.match(Et);if(r)return e.lastLineLength=r[0].length,e.finalize(t,e.lineNumber),2;for(var i=t.offset;i>0&&Tt(xt(n,e.offset));)e.advanceOffset(1,!0),i--;return 0},finalize:function(e,t){if(null!==t.stringContent){var n=t.stringContent,r=n.indexOf("\n"),i=n.slice(0,r),o=n.slice(r+1),a=i.match(/^(\s*)(.*)/);t.info=X(a[2].trim()),t.literal=o,t.stringContent=null}},canContain:function(){return!1},acceptsLines:!0},Nt={continue:function(){return 1},finalize:function(){},canContain:function(){return!1},acceptsLines:!0},St={continue:function(){return 0},finalize:function(e,t){for(var n=t.firstChild;n;){if(kt(n)&&n.next){t.listData.tight=!1;break}for(var r=n.firstChild;r;){if(kt(r)&&(n.next||r.next)){t.listData.tight=!1;break}r=r.next}n=n.next}},canContain:function(e){return"item"===e},acceptsLines:!1},Dt={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(vt);if(r){var i=r[0].length;n.stringContent=n.stringContent.substring(i-1),n.sourcepos[0][1]+=i,n.lineOffsets[0]+=i,t.listData.task=!0,t.listData.checked=/[xX]/.test(r[1])}}},canContain:function(e){return"item"!==e},acceptsLines:!1},Lt={continue:function(e,t){var n=e.currentLine,r=e.indent;if(t.isFenced){var i=r<=3&&n.charAt(e.nextNonspace)===t.fenceChar&&n.slice(e.nextNonspace).match(wt);if(i&&i[0].length>=t.fenceLength)return e.lastLineLength=e.offset+r+i[0].length,e.finalize(t,e.lineNumber),2;for(var o=t.fenceOffset;o>0&&Tt(xt(n,e.offset));)e.advanceOffset(1,!0),o--}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,i=r.indexOf("\n"),o=r.slice(0,i),a=r.slice(i+1),s=o.match(/^(\s*)(.*)/);t.infoPadding=s[1].length,t.info=X(s[2].trim()),t.literal=a}else t.literal=null===(n=t.stringContent)||void 0===n?void 0:n.replace(/(\n *)+$/,"\n");t.stringContent=null}},canContain:function(){return!1},acceptsLines:!0},At={continue:function(e){return e.blank?1:0},finalize:function(e,t){if(null!==t.stringContent){for(var n,r=!1;91===xt(t.stringContent,0)&&(n=e.inlineParser.parseReference(t,e.refMap));)t.stringContent=t.stringContent.slice(n),r=!0;r&&Ct(t.stringContent)&&t.unlink()}},canContain:function(){return!1},acceptsLines:!0},Ot={document:{continue:function(){return 0},finalize:function(){},canContain:function(e){return"item"!==e},acceptsLines:!1},list:St,blockQuote:{continue:function(e){var t=e.currentLine;return e.indented||62!==xt(t,e.nextNonspace)?1:(e.advanceNextNonspace(),e.advanceOffset(1,!1),Tt(xt(t,e.offset))&&e.advanceOffset(1,!0),0)},finalize:function(){},canContain:function(e){return"item"!==e},acceptsLines:!1},item:Dt,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:Lt,htmlBlock:{continue:function(e,t){return!e.blank||6!==t.htmlBlockType&&7!==t.htmlBlockType?0:1},finalize:function(e,t){var n;t.literal=(null===(n=t.stringContent)||void 0===n?void 0:n.replace(/(\n *)+$/,""))||null,t.stringContent=null},canContain:function(){return!1},acceptsLines:!0},paragraph:At,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:Nt,customBlock:Mt,frontMatter:Nt};function It(e){for(var t=0,n=0,r=[],i=0;i<e.length;i+=1)if("|"===e[i]&&"\\"!==e[i-1]){var o=e.substring(t,i);0===t&&ne(o)?n=i+1:r.push(o),t=i+1}return t<e.length&&(ne(o=e.substring(t,e.length))||r.push(o)),[n,r]}function Rt(e,t,n,r){for(var i=[],o=0,a=t;o<a.length;o++){var s=a[o],l=s.match(/^[ \t]+/),u=l?l[0].length:0,c=void 0,p=void 0;if(u===s.length)u=0,c=0,p="";else{var d=s.match(/[ \t]+$/);c=d?d[0].length:0,p=s.slice(u,s.length-c)}var f=r+u,h=ke(e,[[n,r],[n,r+s.length-1]]);h.stringContent=p.replace(/\\\|/g,"|"),h.startIdx=i.length,h.endIdx=i.length,h.lineOffsets=[f-1],h.paddingLeft=u,h.paddingRight=c,i.push(h),r+=s.length+1}return i}function Pt(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 Bt=/^(\$\$)(\s*[a-zA-Z])+/,Ft=/^(\$\$)(\s*[a-zA-Z])+.*(\$\$)/,Ht=/^`{3,}(?!.*`)|^~{3,}/,qt=[/./,/^<(?: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|[/]?[>
2]|$)/i,new RegExp("^(?:"+De+"|"+Le+")\\s*$","i")],zt=/^(?:=+|-+)[ \t]*$/,jt=/^#{1,6}(?:[ \t]+|$)/,Vt=/^(?:(?:\*[ \t]*){3,}|(?:_[ \t]*){3,}|(?:-[ \t]*){3,})[ \t]*$/,_t=/^[*+-]/,Ut=/^(\d{1,9})([.)])/;function $t(e,t){return e.options.disallowDeepHeading&&("blockQuote"===t.type||"item"===t.type)}var Zt=[function(e){return e.indented||62!==xt(e.currentLine,e.nextNonspace)?0:(e.advanceNextNonspace(),e.advanceOffset(1,!1),Tt(xt(e.currentLine,e.offset))&&e.advanceOffset(1,!0),e.closeUnmatchedBlocks(),e.addChild("blockQuote",e.nextNonspace),1)},function(e,t){var n;if(!e.indented&&!$t(e,t)&&(n=e.currentLine.slice(e.nextNonspace).match(jt))){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(Ht))){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===xt(e.currentLine,e.nextNonspace)){var n=e.currentLine.slice(e.nextNonspace),r=e.options.disallowedHtmlBlockTags,i=void 0;for(i=1;i<=7;i++){var o=n.match(qt[i]);if(o){if(7===i){if("paragraph"===t.type)return 0;if(r.length>0&&new RegExp("</?(?:"+r.join("|")+")","i").test(o[0]))return 0}return e.closeUnmatchedBlocks(),e.addChild("htmlBlock",e.offset).htmlBlockType=i,2}}}return 0},function(e,t){var n;if(null!==t.stringContent&&!e.indented&&"paragraph"===t.type&&!$t(e,t.parent)&&(n=e.currentLine.slice(e.nextNonspace).match(zt))){e.closeUnmatchedBlocks();for(var r=void 0;91===xt(t.stringContent,0)&&(r=e.inlineParser.parseReference(t,e.refMap));)t.stringContent=t.stringContent.slice(r);if(t.stringContent.length>0){var i=ke("heading",t.sourcepos);return i.level="="===n[0][0]?1:2,i.headingType="setext",i.stringContent=t.stringContent,t.insertAfter(i),t.unlink(),e.tip=i,e.advanceOffset(e.currentLine.length-e.offset,!1),2}return 0}return 0},function(e){return!e.indented&&Vt.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,i,o=t;return e.indented&&"list"!==t.type||!(n=function(e,t){var n,r,i=e.currentLine.slice(e.nextNonspace),o={type:"bullet",tight:!0,bulletChar:"",start:0,delimiter:"",padding:0,markerOffset:e.indent,task:!1,checked:!1};if(e.indent>=4)return null;if(n=i.match(_t))o.type="bullet",o.bulletChar=n[0][0];else{if(!(n=i.match(Ut))||"paragraph"===t.type&&"1"!==n[1])return null;o.type="ordered",o.start=parseInt(n[1],10),o.delimiter=n[2]}if(-1!==(r=xt(e.currentLine,e.nextNonspace+n[0].length))&&r!==gt&&r!==yt)return null;if("paragraph"===t.type&&!e.currentLine.slice(e.nextNonspace+n[0].length).match(bt))return null;e.advanceNextNonspace(),e.advanceOffset(n[0].length,!0);var a=e.column,s=e.offset;do{e.advanceOffset(1,!0),r=xt(e.currentLine,e.offset)}while(e.column-a<5&&Tt(r));var l=-1===xt(e.currentLine,e.offset),u=e.column-a;return u>=5||u<1||l?(o.padding=n[0].length+1,e.column=a,e.offset=s,Tt(xt(e.currentLine,e.offset))&&e.advanceOffset(1,!0)):o.padding=n[0].length+u,o}(e,o))?0:(e.closeUnmatchedBlocks(),"list"===e.tip.type&&(r=o.listData,i=n,r.type===i.type&&r.delimiter===i.delimiter&&r.bulletChar===i.bulletChar)||((o=e.addChild("list",e.nextNonspace)).listData=n),(o=e.addChild("item",e.nextNonspace)).listData=n,1)},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,i=n.lastIndexOf("\n",r-1)+1,o=n.slice(i,r),a=e.currentLine.slice(e.nextNonspace),s=It(o),l=s[0],u=s[1],c=It(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=je(h)+1,g=ke("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,i);var y=i-(n.lastIndexOf("\n",i-2)+1)-1;e.lastLineLength=h[h.length-2]+y,e.finalize(t,m-1)}e.advanceOffset(e.currentLine.length-e.offset,!1);var b=ke("tableHead",[[m,v],[e.lineNumber,e.offset]]);g.appendChild(b);var w=ke("tableRow",[[m,v],[m,v+o.length-1]]),k=ke("tableDelimRow",[[e.lineNumber,e.nextNonspace+1],[e.lineNumber,e.offset]]);b.appendChild(w),b.appendChild(k),Rt("tableCell",u,m,v+l).forEach((function(e){w.appendChild(e)}));var x=Rt("tableDelimCell",d,e.lineNumber,e.nextNonspace+1+p);return x.forEach((function(e){k.appendChild(e)})),g.columns=x.map(Pt),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),r.stringContent=null);var i=ke("tableRow",[[e.lineNumber,e.nextNonspace+1],[e.lineNumber,e.currentLine.length]]);r.appendChild(i);var o=r.parent,a=It(e.currentLine.slice(e.nextNonspace)),s=a[0];return Rt("tableCell",a[1],e.lineNumber,e.nextNonspace+1+s).forEac
2h((function(e,t){t>=o.columns.length&&(e.ignored=!0),i.appendChild(e)})),2},function(e){var t;if(!e.indented&&!Ft.test(e.currentLine)&&(t=e.currentLine.match(Bt))){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}],Wt=/^(-{3}|\+{3}|;{3})$/,Gt=function(e,t){var n=e.currentLine,r=e.lineNumber,i=e.indented;return 1===r&&!i&&"document"===t.type&&Wt.test(n)?(e.closeUnmatchedBlocks(),e.addChild("frontMatter",e.nextNonspace).stringContent=n,e.advanceNextNonspace(),e.advanceOffset(n.length,!1),2):0},Jt={continue:function(e,t){var n=e.currentLine,r=n.match(Wt);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},Kt=[/./,/<\/(?:script|pre|style)>/i,/-->/,/\?>/,/>/,/\]\]>/],Xt=/^[#`~*+_=<>0-9-;$]/,Qt=/\r\n|\n|\r/;function Yt(){return ke("document",[[1,1],[0,0]])}var en={smart:!1,tagFilter:!1,extendedAutolinks:!1,disallowedHtmlBlockTags:[],referenceDefinition:!1,disallowDeepHeading:!1,customParser:null,frontMatter:!1},tn=function(){function e(e){this.options=i(i({},en),e),this.doc=Yt(),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&&(Ot.frontMatter=Jt,Zt.unshift(Gt)),this.inlineParser=new mt(this.options)}return e.prototype.advanceOffset=function(e,t){void 0===t&&(t=!1);for(var n,r,i,o=this.currentLine;e>0&&(i=o[this.offset]);)"\t"===i?(n=4-this.column%4,t?(this.partiallyConsumedTab=n>e,r=n>e?e:n,this.column+=r,this.offset+=this.partiallyConsumedTab?0:1,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("\t"!==e)break;n++,r+=4-r%4}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+=te(" ",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(;!Ot[this.tip.type].canContain(e);)this.finalize(this.tip,this.lineNumber-1);var n=t+1,r=ke(e,[[this.lineNumber,n],[0,0]]);return r.stringContent="",this.tip.appendChild(r),this.tip=r,r},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],Ot[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 i=t.node,o=t.entering,a=i.type;n&&n[a]&&n[a](i,{entering:o,options:this.options}),o||"paragraph"!==a&&"heading"!==a&&("tableCell"!==a||i.ignored)||this.inlineParser.parse(i)}},e.prototype.incorporateLine=function(e){var t=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,"\ufffd")),this.currentLine=e;for(var n,r=!0;(n=t.lastChild)&&n.open;){switch(t=n,this.findNextNonspace(),Ot[t.type].continue(this,t)){case 0:break;case 1:r=!1;break;case 2:return void(this.lastLineLength=e.length);default:throw new Error("continue returned illegal value, must be 0, 1, or 2")}if(!r){t=t.parent;break}}this.allClosed=t===this.oldtip,this.lastMatchedContainer=t;for(var i="paragraph"!==t.type&&Ot[t.type].acceptsLines,o=Zt.length;!i;){if(this.findNextNonspace(),"table"!==t.type&&"tableBody"!==t.type&&"paragraph"!==t.type&&!this.indented&&!Xt.test(e.slice(this.nextNonspace))){this.advanceNextNonspace();break}for(var a=0;a<o;){var s=Zt[a](this,t);if(1===s){t=this.tip;break}if(2===s){t=this.tip,i=!0;break}a++}if(a===o){this.advanceNextNonspace();break}}if(this.allClosed||this.blank||"paragraph"!==this.tip.type){this.closeUnmatchedBlocks(),this.blank&&t.lastChild&&(t.lastChild.lastLineBlank=!0);for(var l=t.type,u=this.blank&&!("blockQuote"===l||xe(t)&&t.isFenced||"item"===l&&!t.firstChild&&t.sourcepos[0][0]===this.lineNumber),c=t;c;)c.lastLineBlank=u,c=c.parent;Ot[l].acceptsLines?(this.addLine(),"htmlBlock"===t.type&&t.htmlBlockType>=1&&t.htmlBlockType<=5&&Kt[t.htmlBlockType].test(this.currentLine.slice(this.offset))&&(this.lastLineLength=e.length,this.finalize(t,this.lineNumber))):this.offset<e.length&&!this.blank&&(t=this.addChild("paragraph",this.offset),this.advanceNextNonspace(),this.addLine())}else this.addLine();this.lastLineLength=e.length},e.prototype.parse=function(e,t){this.doc=Yt(),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(Qt),r=n.length;this.lines=t||n,this.options.referenceDefinition&&this.clearRefMaps(),10===e.charCodeAt(e.length-1)&&(r-=1);for(var i=0;i<r;i++)this.incorporateLine(n[i]);for(;this.tip;)this.finalize(this.tip,r);return this.processInlines(this.doc),this.doc},e.prototype.partialParseStart=function(e,t){this.doc=Yt(),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])}
2,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){var t;t=e,Object.keys(t).forEach((function(e){delete t[e]}))}))},e}();function nn(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 rn(e,t){var n=e[0];return 1===nn(e[1],t)?1:-1===nn(n,t)?-1:0}function on(e,t){for(var n=0,r=t;n<r.length;n++){var i=r[n];e.insertBefore(i)}}function an(e,t){var n=e[0];return e[1][0]<t?1:n[0]>t?-1:0}function sn(e,t){for(var n=e.firstChild;n;){var r=an(n.sourcepos,t);if(0===r)return n;if(-1===r)return n.prev||n;n=n.next}return e.lastChild}function ln(e){return function(e){return ae[e]}(e)||null}function un(e,t,n){if(void 0===n&&(n=null),t)for(var r=t.walker();t&&t!==n;){e(t);var i=r.next();if(!i)break;t=i.node}}var cn=/\r\n|\n|\r/;function pn(e){return{id:e.id,title:e.title,sourcepos:e.sourcepos,unlinked:!1,destination:e.dest}}var dn=function(){function e(e,t){this.refMap={},this.refLinkCandidateMap={},this.refDefCandidateMap={},this.referenceDefinition=!!(null===t||void 0===t?void 0:t.referenceDefinition),this.parser=new tn(t),this.parser.setRefMaps(this.refMap,this.refLinkCandidateMap,this.refDefCandidateMap),this.eventHandlerMap={change:[]},e=e||"",this.lineTexts=e.split(cn),this.root=this.parser.parse(e,this.lineTexts)}return e.prototype.updateLineTexts=function(e,t,n){var r,i=e[0],a=e[1],s=t[0],l=t[1],u=n.split(cn),c=u.length,p=this.lineTexts[i-1],d=this.lineTexts[s-1];u[0]=p.slice(0,a-1)+u[0],u[c-1]=u[c-1]+d.slice(l-1);var f=s-i+1;return(r=this.lineTexts).splice.apply(r,o([i-1,f],u)),c-f},e.prototype.updateRootNodeState=function(){if(1===this.lineTexts.length&&""===this.lineTexts[0])return this.root.lastLineBlank=!0,void(this.root.sourcepos=[[1,1],[1,0]]);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){e?(on(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,i=0,o=["parent","prev","next"];i<o.length;i++){var a=o[i];n[a]&&(se(n[a].id),n[a]=null)}n=r}e.next=t.next,t.next?t.next.prev=e:e.parent.lastChild=e}}(e,t),[e.id,t.id].forEach((function(e){return se(e)})),e.unlink()):t?(on(t,n),se(t.id),t.unlink()):function(e,t){for(var n=t.length-1;n>=0;n-=1)e.prependChild(t[n])}(this.root,n)},e.prototype.getNodeRange=function(e,t){var n=sn(this.root,e[0]),r=sn(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){var i;e&&e.prev&&(Ce(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 _t.test(n)||Ut.test(n)}(this.lineTexts[n-1])||"table"===e.prev.type&&!Ct(i=this.lineTexts[n-1])&&-1!==i.indexOf("|"))&&(n=(e=e.prev).sourcepos[0][0]);for(var o=this.lineTexts.slice(n-1,r),a=this.parser.partialParseStart(n,o),s=t?t.next:this.root.firstChild,l=a.lastChild,u=l&&xe(l)&&l.open,c=l&&Ee(l)&&l.open,p=l&&Ce(l);(u||c)&&s||p&&s&&("list"===s.type||s.sourcepos[0][1]>=2);){var d=this.extendEndLine(s.sourcepos[1][0]);this.parser.partialParseExtends(this.lineTexts.slice(r,d)),e||(e=t),t=s,r=d,s=s.next}return this.parser.partialParseFinish(),{newNodes:function(e){for(var t=[],n=e.firstChild;n;)t.push(n),n=n.next;return t}(a),extStartNode:e,extEndNode:t}},e.prototype.getRemovedNodeRange=function(e,t){return!e||e&&Te(e)||t&&Te(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(!Ue(this.refMap)){var r=function(e){if(Te(e)){var t=n.refMap[e.label];t&&e.id===t.id&&(t.unlinked=!0)}};e&&un(r,e.parent,t),t&&un(r,t)}},e.prototype.replaceWithNewRefDefState=function(e){var t=this;if(!Ue(this.refMap)){var n=function(e){if(Te(e)){var n=e.label,r=t.refMap[n];r&&!r.unlinked||(t.refMap[n]=pn(e))}};e.forEach((function(e){un(n,e)}))}},e.prototype.replaceWithRefDefCandidate=function(){var e=this;Ue(this.refDefCandidateMap)||_e(this.refDefCandidateMap,(function(t,n){var r=n.label,i=n.sourcepos,o=e.refMap[r];(!o||o.unlinked||o.sourcepos[0][0]>i[0][0])&&(e.refMap[r]=pn(n))}))},e.prototype.getRangeWithRefDef=function(e,t,n,r,i){if(this.referenceDefinition&&!Ue(this.refMap)){var o=sn(this.root,e-1),a=sn(this.root,t+1);o&&Te(o)&&o!==n&&o!==r&&(e=(n=o).sourcepos[0][0]),a&&Te(a)&&a!==n&&a!==r&&(r=a,t=this.extendEndLine(r.sourcepos[1][0]+i))}return[n,r,e,t]},e.prototype.parse=function(e,t,n){void 0===n&&(n=0);var r=this.getNodeRange(e,t),i=r[0],o=r[1],a=i?Math.min(i.sourcepos[0][0],e[0]):e[0],s=this.extendEndLine((o?Math.max(o.sourcepos[1][0],t[0]):t[0])+n),l=this.parseRange.apply(this,this.getRangeWithRefDef(a,s,i,o,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 Ue(this.refMap)||_e(this.refMap,(function(n,r){r.unlinked&&delete e.refMap[n],_e(e.refLinkCandidateMap,(function(r,i){var o=i.node;i.refLabel===n&&t.push(e.parse(o.sourcepos[0],o.sourcepos[1]))}))})),t},e.prototype.removeUnlinkedCandidate=function(){Ue(this.refDefCandidateMap)||[this.refLinkCandidateMap,this.refDefCandidateMap].forEac
2h((function(e){_e(e,(function(t){(function(e){var t=ln(e);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),a=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=i({},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 i=n.node;n.entering&&(i.sourcepos[0][0]+=t,i.sourcepos[1][0]+=t)}}}(o.nextNode,r),this.updateRootNodeState();var s=[a];return this.referenceDefinition&&(this.removeUnlinkedCandidate(),this.replaceWithRefDefCandidate(),s=s.concat(this.parseRefLink())),this.trigger("change",s),s},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 i=rn(n.sourcepos,t);if(0===i){if(!n.firstChild)return n;r=n,n=n.firstChild}else{if(-1===i)return r;if(!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 i=an(n.sourcepos,t);if(0===i){if(n.sourcepos[0][0]===t||!n.firstChild)return n;r=n,n=n.firstChild}else{if(-1===i)break;r=n,n=n.next}}return r?function(e){for(;e.parent&&"document"!==e.parent.type&&e.parent.sourcepos[0][0]===e.sourcepos[0][0];)e=e.parent;return e}(function(e){for(;e.lastChild;)e=e.lastChild;return e}(r)):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 ln(e)},e.prototype.removeAllNode=function(){ae={}},e}(),fn=new RegExp("<(/?(?:"+["title","textarea","style","xmp","iframe","noembed","noframes","script","plaintext"].join("|")+")[^>]*>)","ig");function hn(e){return fn.test(e)?e.replace(fn,(function(e,t){return"&lt;"+t})):e}var mn={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,i=null===(n=e.parent)||void 0===n?void 0:n.parent;return i&&"list"===i.type&&i.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,i=r.type,o=r.start,a="bullet"===i?"ul":"ol",s={};return"ol"===a&&null!==o&&1!==o&&(s.start=o.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?hn(e.literal):e.literal}},htmlBlock:function(e,t){var n=t.options,r=n.tagFilter?hn(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-"+ee(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,r=n.title,o=n.destination;return{type:"openTag",tagName:"a",attributes:i({href:ee(o)},r&&{title:ee(r)})}}return{type:"closeTag",tagName:"a"}},image:function(e,t){var n=t.getChildrenText,r=t.skipChildren,o=e,a=o.title,s=o.destination;return r(),{type:"openTag",tagName:"img",selfClose:!0,attributes:i({src:ee(s),alt:n(e)},a&&{title:ee(a)})}},customBlock:function(e,t,n){var r=e.info.trim().toLowerCase(),i=n[r];if(i)try{return i(e,t)}catch(o){console.warn("[@toast-ui/editor] - The error occurred when "+r
2+" block node was parsed in markdown renderer: "+o)}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,i=r.info,o=r.firstChild,a=i.trim().toLowerCase(),s=n[a],l=t.entering;if(s)try{return s(e,t)}catch(u){console.warn("[@toast-ui/editor] - The error occurred when "+a+" inline node was parsed in markdown renderer: "+u)}return l?[{type:"openTag",tagName:"span"},{type:"text",content:"$$"+i+(o?" ":"")}]:[{type:"text",content:"$$"},{type:"closeTag",tagName:"span"}]}},vn={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,a=r.task;if(n){var s={type:"openTag",tagName:"li",outerNewLine:!0};return a?[s,{type:"openTag",tagName:"input",selfClose:!0,attributes:i(i({},o&&{checked:""}),{disabled:"",type:"checkbox"})},{type:"text",content:" "}]:s}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,i=e.lastChild.endIdx+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",a=r.parent.columns[e.startIdx],s=(null===a||void 0===a?void 0:a.align)?{align:a.align}:null;return n?i({type:"openTag",tagName:o,outerNewLine:!0},s&&{attributes:s}):{type:"closeTag",tagName:o,outerNewLine:!0}}},gn={softbreak:"\n",gfm:!1,tagFilter:!1,nodeId:!1};function yn(e){for(var t=[],n=e.walker(),r=null;r=n.next();){var i=r.node;"text"===i.type&&t.push(i.literal)}return t.join("")}var bn=function(){function e(e){this.buffer=[],this.options=i(i({},gn),e),this.convertors=this.createConvertors(),delete this.options.convertors}return e.prototype.createConvertors=function(){var e=i({},mn);if(this.options.gfm&&(e=i(i({},e),vn)),this.options.convertors){var t=this.options.convertors,n=Object.keys(t),r=i(i({},mn),vn);n.forEach((function(n){var i=e[n],o=t[n],a=-1===Object.keys(r).indexOf(n)?n.toLowerCase():n;e[a]=i?function(e,t,n){return t.origin=function(){return i(e,t,n)},o(e,t)}:o}))}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,i=function(){var e=r.node,i=r.entering,a=o.convertors[e.type];if(!a)return"continue";var s=!1,l={entering:i,leaf:!ie(e),options:o.options,getChildrenText:yn,skipChildren:function(){s=!0}},u=Ee(e)||function(e){return"customInline"===e.type}(e)?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()))},o=this;r=n.next();)i();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,i=e.attributes;this.buffer.push("<"+n),r&&r.length>0&&this.buffer.push(' class="'+r.join(" ")+'"'),i&&Object.keys(i).forEac
2h((function(e){var n=i[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"!==je(je(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(ee(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}(),wn=s(956),kn=s.n(wn),xn=s(969),Cn=s.n(xn),Tn=s(348),En=s.n(Tn),Mn=s(349),Nn=s.n(Mn),Sn=s(204),Dn=s.n(Sn),Ln=s(462),An=s.n(Ln),On=s(522),In=s.n(On),Rn=s(990),Pn=s.n(Rn),Bn=s(322),Fn=s.n(Bn),Hn=s(758),qn=s.n(Hn),zn=s(929),jn=s.n(zn),Vn=s(714),_n=s.n(Vn),Un=(s(471),"[A-Za-z][A-Za-z0-9-]*"),$n="(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^\"'=<>`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)",Zn=new RegExp("^(?:<("+Un+")("+$n+")*\\s*/?>|</("+Un+")\\s*[>])","i");function Wn(e,t){return-1!==e.indexOf(t)}s(934),s(391),/Mac/.test(navigator.platform),new RegExp('[&<>"]',"g");var Gn=["rel","target","hreflang","type"];function Jn(e){return"object"===typeof e&&null!==e}function Kn(t,n){var r=e({},t);return t&&n&&Object.keys(n).forEach((function(e){Jn(r[e])?Array.isArray(n[e])?r[e]=Xn(n[e]):r.hasOwnProperty(e)?r[e]=Kn(r[e],n[e]):r[e]=Qn(n[e]):r[e]=n[e]})),r}function Xn(e){return e.map((function(e){return Jn(e)?Array.isArray(e)?Xn(e):Qn(e):e}))}function Qn(e){var t=Object.keys(e);return t.length?t.reduce((function(t,n){return Jn(e[n])?t[n]=Array.isArray(e[n])?Xn(e[n]):Qn(e[n]):t[n]=e[n],t}),{}):e}function Yn(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]:Yn(e[n],t[n]):e[n]=t[n]})),e}function er(e,t){return e>t?[t,e]:[e,t]}var tr="toastui-editor-";function nr(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=[],r=0,i=e;r<i.length;r++){var o=i[r],a=void 0;(a=Array.isArray(o)?o[0]?o[1]:null:o)&&n.push(""+tr+a)}return n.join(" ")}function rr(e){e.parentNode&&e.parentNode.removeChild(e)}function ir(e,t,n){jn()(n)&&(n=!_n()(e,t)),(n?Dn():An())(e,t)}var or=s(294),ar=s.n(or);function sr(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,r=n.destination,i=n.title;return("link"===e.type?"":"!")+"["+t+"]("+r+(i?' "'+i+'"':"")+")";default:return null}}var lr={},ur=/\$\$widget\d+\s/;function cr(e){var t=e.search(ur);if(-1!==t){var n=e.substring(t).replace(ur,"").replace("$$","");e=e.substring(0,t),e+=cr(n)}return e}var pr=s(368),dr=s.n(pr),fr=["iframe","embed"],hr=[];function mr(t,n){return dr().sanitize(t,e({ADD_TAGS:hr,ADD_ATTR:["rel","target","hreflang","type"],FORBID_TAGS:["input","script","textarea","form","button","select","meta","style","link","title","object","base"]},n))}var vr=/^\s*<\s*\//,gr={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=[];return 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,n=t.fenceLength,r=t.info,i=r?r.split(/\s+/):[],o=[],a={};if(n>3&&(a["data-backticks"]=n),i.length>0&&i[0].length>0){var s=i[0];o.push("lang-"+s),a["data-language"]=s}return[{type:"openTag",tagName:"pre",classNames:o},{type:"openTag",tagName:"code",attributes:a},{type:"text",content:e.literal},{type:"closeTag",tagName:"code"},{type:"closeTag",tagName:"pre"}]},customInline:function(e,t){var n=t.origin,r=t.entering,i=t.skipChildren,o=e.info;if(-1!==o.indexOf("widget")&&r){i();var a=function(e){for(var t,n="",r=e.walker();t=r.next();){var i=t.node;t.entering&&(i!==e&&"text"!==i.type?(n+=sr(i),r.resumeAt(e,!1),r.next()):"text"===i.type&&(n+=i.literal))}return n}(e),s=function(e,t){var n=lr[e],r=n.rule,i=n.toDOM,o=cr(t).match(r);return o&&(t=o[0]),i(t)}(o,a).outerHTML;return[{type:"openTag",tagName:"span",classNames:["tui-widget"]},{type:"html",content:s},{type:"closeTag",tagName:"span"}]}return n()}};function yr(t,n){var r=e({},gr);return t&&(r.link=function(n,r){var i=r.entering,o=(0,r.origin)();return i&&(o.attributes=e(e({},o.attributes),t)),o}
2),n&&Object.keys(n).forEach((function(t){var i=r[t],o=n[t];i&&ar()(o)?r[t]=function(t,n){var r=e({},n);return r.origin=function(){return i(t,n)},o(t,r)}:Wn(["htmlBlock","htmlInline"],t)&&!ar()(o)?r[t]=function(t,n){var r=t.literal.match(Zn);if(r){var i=r[0],a=r[1],s=r[3],l=(a||s).toLowerCase(),u=o[l],c=function(e,t){return e.literal.replace(new RegExp("(<\\s*"+t+"[^>]*>)|(</"+t+"\\s*[>])","ig"),"").trim()}(t,l);if(u){var p=e({},t);return p.attrs=function(e){var t=(e=e.match(Zn)[0]).match(new RegExp($n,"g"));return t?t.reduce((function(e,t){var n=t.trim().split("="),r=n[0],i=n.slice(1);return i.length&&(e[r]=i.join("=").replace(/'|"/g,"").trim()),e}),{}):{}}(i),p.childrenHTML=c,p.type=l,n.entering=!vr.test(t.literal),u(p,n)}}return n.origin()}:r[t]=o})),r}var br=["UL","OL","BLOCKQUOTE"];function wr(e,t){for(var n=0;e&&e!==t&&(Wn(br,e.tagName)||(n+=e.offsetTop),e.offsetParent!==t.offsetParent);)e=e.parentElement;return n}function kr(e,t,n){return e&&t>n+e.offsetTop?kr(e.nextElementSibling,t,n)||e:null}var xr={};function Cr(e){e&&(delete xr[Number(e.getAttribute("data-nodeid"))],Pn()(e.children).forEach((function(e){Cr(e)})))}var Tr=nr("md-preview-highlight"),Er=function(){function e(e,t){var n=document.createElement("div");this.el=n,this.eventEmitter=e,this.isViewer=!!t.isViewer,this.el.className=nr("md-preview");var r=t.linkAttributes,i=t.customHTMLRenderer,o=t.sanitizer,a=t.highlight,s=void 0!==a&&a;this.renderer=new bn({gfm:!0,nodeId:!0,convertors:yr(r,i)}),this.cursorNodeId=null,this.sanitizer=o,this.initEvent(s),this.initContentSection(),this.isViewer&&(this.previewContent.style.overflowWrap="break-word")}return e.prototype.initContentSection=function(){this.previewContent=function(e,t){var n=document.createElement("div");qn()(e)?n.innerHTML=e:n.appendChild(e);var r=n.firstChild;return t&&t.appendChild(r),r}('<div class="'+nr("contents")+'"></div>'),this.isViewer||this.el.appendChild(this.previewContent)},e.prototype.toggleActive=function(e){ir(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()}))),En()(this.el,"scroll",(function(e){t.eventEmitter.emit("scroll","preview",function(e,t){for(var n=t,r=null;n;){var i=n.firstElementChild;if(!i)break;r=n,n=kr(i,e,wr(n,t))}var o=n||r;return o===t?null:o}(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&&An()(e,Tr)}},e.prototype.updateCursorNode=function(e,t){e&&("tableRow"===(e=function(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}(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&&!(n.next.sourcepos[0][1]>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),i=this.getElementByNodeId(n);r&&An()(r,Tr),i&&Dn()(i,Tr),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,i=this.previewContent,o=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",o);for(var p=u;p&&p!==c;){var d=p.nextElementSibling;rr(p),Cr(p),p=d}(null===p||void 0===p?void 0:p.parentNode)&&(rr(p),Cr(p))}}else i.insertAdjacentHTML("afterbegin",o)},e.prototype.getRenderer=function(){return this.renderer},e.prototype.destroy=function(){Nn()(this.el,"scroll"),this.el=null},e.prototype.getElement=function(){return this.el},e.prototype.getHTML=function(){return this.previewContent.innerHTML.replace(/<img class="ProseMirror-separator" alt="">/g,"").replace(/ class="ProseMirror-trailingBreak"/g,"")},e.prototype.setHTML=function(e){this.previewContent.innerHTML=e},e.prototype.setHeight=function(e){In()(this.el,{height:e+"px"})},e.prototype.setMinHeight=function(e){In()(this.el,{minHeight:e+"px"})},e}(),Mr=Er,Nr=s(814),Sr=s(479),Dr=s(311),Lr=s(481),Ar=s(43),Or=s(928),Ir=s.n(Or),Rr=function(){function e(){this.keys=[],this.values=[]}return e.prototype.getKeyIndex=function(e){return Ir()(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)>
2-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,i){r&&n.keys[i]&&e.call(t,r,n.keys[i],n)}))},e.prototype.clear=function(){this.keys=[],this.values=[]},e}(),Pr="en-US",Br=new(function(){function e(){this.code=Pr,this.langs=new Rr}return e.prototype.setCode=function(e){this.code=e||Pr},e.prototype.setLanguage=function(e,t){var n=this;(e=[].concat(e)).forEach((function(e){if(n.langs.has(e)){var r=n.langs.get(e);n.langs.set(e,Cn()(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(Pr));var r=n[e];if(!r)throw new Error('There is no text key "'+e+'" in '+t);return r},e}());function Fr(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};n-=1}return null}var Hr=new Map,qr=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=Fr(t,(function(e){return"table"===e.type.name}));if(n){var r=n.node,i=n.depth,o=n.offset,a=Hr.get(r);if((null===a||void 0===a?void 0:a.tableStartPos)===o+1)return a;var s=[],l=t.start(i),u=r.child(0),c=r.child(1),p=zr(u,l),d=zr(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 Hr.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 i=r+this.tableRows[n].nodeSize;if(n===e){for(var o=t;o<this.totalColumnCount&&this.rowInfo[n][o].offset<r;)o+=1;return o===this.totalColumnCount?i:this.rowInfo[n][o].offset}r=i}},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,i=n.nodeSize;return this.extendedRowspan(e,t)?this.posAt(e,t):r+i},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){var n,r,i;void 0===t&&(t=e),e.pos>t.pos&&(e=(n=[t,e])[0],t=n[1]);var o=this.getCellIndex(e),a=o[0],s=o[1],l=this.getCellIndex(t),u=l[0],c=l[1];
2return a=(r=er(a,u))[0],u=r[1],s=(i=er(s,c))[0],c=i[1],this.getSpannedOffsets({startRowIdx:a,startColIdx:s,endRowIdx:u,endColIdx:c})},e.prototype.getSpannedOffsets=function(e){return e},e}(),zr=function(e,t){var n=[];return e.forEach((function(e,r){var i={rowspanMap:{},colspanMap:{},length:0};e.forEach((function(e,n){for(var o=e.nodeSize,a=0;i[a];)a+=1;i[a]={offset:t+r+n+2,nodeSize:o},i.length+=1})),n.push(i)})),n};function jr(e,t){return Yn(qr.prototype,e),zr=t,qr}function Vr(t){var n=t.plugins,r=t.eventEmitter,i=t.usageStatistics,o=t.instance;return r.listen("mixinTableOffsetMapPrototype",jr),(null!==n&&void 0!==n?n:[]).reduce((function(t,n){var a=function(e){var t=e.plugin,n={eventEmitter:e.eventEmitter,usageStatistics:e.usageStatistics,instance:e.instance,pmState:{Plugin:Nr.Plugin,PluginKey:Nr.PluginKey,Selection:Nr.Selection,TextSelection:Nr.TextSelection},pmView:{Decoration:Dr.Decoration,DecorationSet:Dr.DecorationSet},pmModel:{Fragment:Ar.Fragment},pmRules:{InputRule:Sr.InputRule,inputRules:Sr.inputRules,undoInputRule:Sr.undoInputRule},pmKeymap:{keymap:Lr.keymap},i18n:Br};if(Fn()(t)){var r=t[0],i=t[1];return r(n,void 0===i?{}:i)}return t(n)}({plugin:n,eventEmitter:r,usageStatistics:i,instance:o});if(!a)throw new Error("The return value of the executed plugin is empty.");var s=a.markdownParsers,l=a.toHTMLRenderers,u=a.toMarkdownRenderers,c=a.markdownPlugins,p=a.wysiwygPlugins,d=a.wysiwygNodeViews,f=a.markdownCommands,h=a.wysiwygCommands,m=a.toolbarItems;return l&&(t.toHTMLRenderers=Kn(t.toHTMLRenderers,l)),u&&(t.toMarkdownRenderers=Kn(t.toMarkdownRenderers,u)),c&&(t.mdPlugins=t.mdPlugins.concat(c)),p&&(t.wwPlugins=t.wwPlugins.concat(p)),d&&(t.wwNodeViews=e(e({},t.wwNodeViews),d)),f&&(t.mdCommands=e(e({},t.mdCommands),f)),h&&(t.wwCommands=e(e({},t.wwCommands),h)),m&&(t.toolbarItems=t.toolbarItems.concat(m)),s&&(t.markdownParsers=e(e({},t.markdownParsers),s)),t}),{toHTMLRenderers:{},toMarkdownRenderers:{},mdPlugins:[],wwPlugins:[],wwNodeViews:{},mdCommands:{},wwCommands:{},toolbarItems:[],markdownParsers:{}})}var _r=s(404),Ur=s.n(_r),$r=["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"],Zr=function(){function n(){var t=this;this.events=new Rr,this.eventTypes=$r.reduce((function(t,n){return e(e({},t),{type:n})}),{}),this.hold=!1,$r.forEach((function(e){t.addEventType(e)}))}return n.prototype.listen=function(e,t){var n=this.getTypeInfo(e),r=this.events.get(n.type)||[];if(!this.hasEventType(n.type))throw new Error("There is no event type "+n.type);n.namespace&&(t.namespace=n.namespace),r.push(t),this.events.set(n.type,r)},n.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=this.getTypeInfo(e),i=this.events.get(r.type),o=[];return!this.hold&&i&&i.forEach((function(e){var n=e.apply(void 0,t);jn()(n)||o.push(n)})),o},n.prototype.emitReduce=function(e,n){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];var o=this.events.get(e);return!this.hold&&o&&o.forEach((function(e){var i=e.apply(void 0,t([n],r));Ur()(i)||(n=i)})),n},n.prototype.getTypeInfo=function(e){var t=e.split(".");return{type:t[0],namespace:t[1]}},n.prototype.hasEventType=function(e){return!jn()(this.eventTypes[this.getTypeInfo(e).type])},n.prototype.addEventType=function(e){if(this.hasEventType(e))throw new Error("There is already have event type "+e);this.eventTypes[e]=e},n.prototype.removeEventHandler=function(e,t){var n=this,r=this.getTypeInfo(e),i=r.type,o=r.namespace;i&&t?this.removeEventHandlerWithHandler(i,t):i&&!o?this.events.delete(i):!i&&o?this.events.forEach((function(e,t){n.removeEventHandlerWithTypeInfo(t,o)})):i&&o&&this.removeEventHandlerWithTypeInfo(i,o)},n.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)}},n.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))},n.prototype.getEvents=function(){return this.events},n.prototype.holdEventInvoke=function(e){this.hold=!0,e(),this.hold=!1},n}(),Wr=Zr;function Gr(e){["htmlBlock","htmlInline"].forEach((function(t){e[t]&&Object.keys(e[t]).forEac
2h((function(e){var t;Wn(fr,t=e)&&hr.push(t.toLowerCase())}))}))}var Jr=function(){function t(t){var n=this;this.options=Cn()({linkAttributes:null,extendedAutolinks:!1,customHTMLRenderer:null,referenceDefinition:!1,customHTMLSanitizer:null,frontMatter:!1,usageStatistics:!0,theme:"light"},t),this.eventEmitter=new Wr;var r=function(e){if(!e)return null;var t={};return Gn.forEach((function(n){jn()(e[n])||(t[n]=e[n])})),t}(this.options.linkAttributes),i=Vr({plugins:this.options.plugins,eventEmitter:this.eventEmitter,usageStatistics:this.options.usageStatistics,instance:this})||{},o=i.toHTMLRenderers,a=i.markdownParsers,s=this.options,l=s.customHTMLRenderer,u=s.extendedAutolinks,c=s.referenceDefinition,p=s.frontMatter,d=s.customHTMLSanitizer,f={linkAttributes:r,customHTMLRenderer:e(e({},o),l),extendedAutolinks:u,referenceDefinition:c,frontMatter:p,sanitizer:d||mr};Gr(f.customHTMLRenderer),this.options.events&&kn()(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(nr(g)),m.innerHTML="",this.toastMark=new dn("",{disallowedHtmlBlockTags:["br","img"],extendedAutolinks:u,referenceDefinition:c,disallowDeepHeading:!0,frontMatter:p,customParser:a}),this.preview=new Mr(this.eventEmitter,e(e({},f),{isViewer:!0})),En()(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 t.prototype.toggleTask=function(e){var t=e.target,n=getComputedStyle(t,":before");!t.hasAttribute("data-task-disabled")&&t.hasAttribute("data-task")&&function(e,t,n){var r=parseInt(e.left,10),i=parseInt(e.top,10),o=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+o&&n>=i&&n<=i+a}(n,e.offsetX,e.offsetY)&&(ir(t,"checked"),this.eventEmitter.emit("change",{source:"viewer",date:e}))},t.prototype.setMarkdown=function(e){var t,n=this.toastMark.getLineTexts(),r=[n.length,(t=n)[t.length-1].length+1],i=this.toastMark.editMarkdown([1,1],r,e||"");this.eventEmitter.emit("updatePreview",i)},t.prototype.on=function(e,t){this.eventEmitter.listen(e,t)},t.prototype.off=function(e){this.eventEmitter.removeEventHandler(e)},t.prototype.addHook=function(e,t){this.eventEmitter.removeEventHandler(e),this.eventEmitter.listen(e,t)},t.prototype.destroy=function(){Nn()(this.preview.el,"mousedown",this.toggleTask.bind(this)),this.preview.destroy(),this.eventEmitter.emit("destroy")},t.prototype.isViewer=function(){return!0},t.prototype.isMarkdownMode=function(){return!1},t.prototype.isWysiwygMode=function(){return!1},t}(),Kr=Jr}(),l=l.default}()},e.exports=r(n(59140),n(64162),n(49484),n(48122),n(86087))},59140:function(e,t,n){"use strict";e.exports=n.p+"static/media/index.1e3d64b0fcde879f0060.cjs"},64162:function(e,t,n){"use strict";e.exports=n.p+"static/media/index.b599194a631d76b49328.cjs"},86087:function(e,t,n){"use strict";e.exports=n.p+"static/media/index.9659d9c420d8750cbee8.cjs"},49484:function(e,t,n){"use strict";e.exports=n.p+"static/media/index.85823dd8655ed4119d0c.cjs"},48122:function(e,t,n){"use strict";e.exports=n.p+"static/media/index.294a0edb7af7d19b781b.cjs"},45733:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return tw}});var r=n(50189),i=n(11026),o=n(67487),a=n(66845),s=n(83138),l=n(27597),u=n(67591),c=n(94337),p=n(90434),d=n(22951),f=n(91976);function h(e){this.content=e}h.prototype={constructor:h,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return-1==t?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),o=r.content.slice();return-1==i?o.push(n||e,t):(o[i+1]=t,n&&(o[i]=n)),new h(o)},remove:function(e){var t=this.find(e);if(-1==t)return this;var n=this.content.slice();return n.splice(t,2),new h(n)},addToStart:function(e,t){return new h([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new h(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),o=r.find(e);return i.splice(-1==o?i.length:o,0,t,n),new h(i)}
2,forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return(e=h.from(e)).size?new h(e.content.concat(this.subtract(e).content)):this},append:function(e){return(e=h.from(e)).size?new h(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=h.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},get size(){return this.content.length>>1}},h.from=function(e){if(e instanceof h)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new h(t)};var m=h;function v(e,t,n){for(var r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;var i=e.child(r),o=t.child(r);if(i!=o){if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){for(var a=0;i.text[a]==o.text[a];a++)n++;return n}if(i.content.size||o.content.size){var s=v(i.content,o.content,n+1);if(null!=s)return s}n+=i.nodeSize}else n+=i.nodeSize}}function g(e,t,n,r){for(var i=e.childCount,o=t.childCount;;){if(0==i||0==o)return i==o?null:{a:n,b:r};var a=e.child(--i),s=t.child(--o),l=a.nodeSize;if(a!=s){if(!a.sameMarkup(s))return{a:n,b:r};if(a.isText&&a.text!=s.text){for(var u=0,c=Math.min(a.text.length,s.text.length);u<c&&a.text[a.text.length-u-1]==s.text[s.text.length-u-1];)u++,n--,r--;return{a:n,b:r}}if(a.content.size||s.content.size){var p=g(a.content,s.content,n-1,r-1);if(p)return p}n-=l,r-=l}else n-=l,r-=l}}var y=function(){function e(t,n){if((0,d.Z)(this,e),this.content=t,this.size=n||0,null==n)for(var r=0;r<t.length;r++)this.size+=t[r].nodeSize}return(0,f.Z)(e,[{key:"nodesBetween",value:function(e,t,n){for(var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4?arguments[4]:void 0,o=0,a=0;a<t;o++){var s=this.content[o],l=a+s.nodeSize;if(l>e&&!1!==n(s,r+a,i||null,o)&&s.content.size){var u=a+1;s.nodesBetween(Math.max(0,e-u),Math.min(s.content.size,t-u),n,r+u)}a=l}}},{key:"descendants",value:function(e){this.nodesBetween(0,this.size,e)}},{key:"textBetween",value:function(e,t,n,r){var i="",o=!0;return this.nodesBetween(e,t,(function(a,s){a.isText?(i+=a.text.slice(Math.max(e,s)-s,t-s),o=!n):a.isLeaf?(r?i+="function"===typeof r?r(a):r:a.type.spec.leafText&&(i+=a.type.spec.leafText(a)),o=!n):!o&&a.isBlock&&(i+=n,o=!0)}),0),i}},{key:"append",value:function(t){if(!t.size)return this;if(!this.size)return t;var n=this.lastChild,r=t.firstChild,i=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),o=1);o<t.content.length;o++)i.push(t.content[o]);return new e(i,this.size+t.size)}},{key:"cut",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.size;if(0==t&&n==this.size)return this;var r=[],i=0;if(n>t)for(var o=0,a=0;a<n;o++){var s=this.content[o],l=a+s.nodeSize;l>t&&((a<t||l>n)&&(s=s.isText?s.cut(Math.max(0,t-a),Math.min(s.text.length,n-a)):s.cut(Math.max(0,t-a-1),Math.min(s.content.size,n-a-1))),r.push(s),i+=s.nodeSize),a=l}return new e(r,i)}},{key:"cutByIndex",value:function(t,n){return t==n?e.empty:0==t&&n==this.content.length?this:new e(this.content.slice(t,n))}},{key:"replaceChild",value:function(t,n){var r=this.content[t];if(r==n)return this;var i=this.content.slice(),o=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new e(i,o)}},{key:"addToStart",value:function(t){return new e([t].concat(this.content),this.size+t.nodeSize)}},{key:"addToEnd",value:function(t){return new e(this.content.concat(t),this.size+t.nodeSize)}},{key:"eq",value:function(e){if(this.content.length!=e.content.length)return!1;for(var t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}},{key:"firstChild",get:function(){return this.content.length?this.content[0]:null}},{key:"lastChild",get:function(){return this.content.length?this.content[this.content.length-1]:null}},{key:"childCount",get:function(){return this.content.length}},{key:"child",value:function(e){var t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}},{key:"maybeChild",value:function(e){return this.content[e]||null}}
2,{key:"forEach",value:function(e){for(var t=0,n=0;t<this.content.length;t++){var r=this.content[t];e(r,n,t),n+=r.nodeSize}}},{key:"findDiffStart",value:function(e){return v(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0)}},{key:"findDiffEnd",value:function(e){return g(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.size,arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.size)}},{key:"findIndex",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;if(0==e)return w(0,e);if(e==this.size)return w(this.content.length,e);if(e>this.size||e<0)throw new RangeError("Position ".concat(e," outside of fragment (").concat(this,")"));for(var n=0,r=0;;n++){var i=r+this.child(n).nodeSize;if(i>=e)return i==e||t>0?w(n+1,i):w(n,r);r=i}}},{key:"toString",value:function(){return"<"+this.toStringInner()+">"}},{key:"toStringInner",value:function(){return this.content.join(", ")}},{key:"toJSON",value:function(){return this.content.length?this.content.map((function(e){return e.toJSON()})):null}}],[{key:"fromJSON",value:function(t,n){if(!n)return e.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new e(n.map(t.nodeFromJSON))}},{key:"fromArray",value:function(t){if(!t.length)return e.empty;for(var n,r=0,i=0;i<t.length;i++){var o=t[i];r+=o.nodeSize,i&&o.isText&&t[i-1].sameMarkup(o)?(n||(n=t.slice(0,i)),n[n.length-1]=o.withText(n[n.length-1].text+o.text)):n&&n.push(o)}return new e(n||t,r)}},{key:"from",value:function(t){if(!t)return e.empty;if(t instanceof e)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new e([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}]),e}();y.empty=new y([],0);var b={index:0,offset:0};function w(e,t){return b.index=e,b.offset=t,b}function k(e,t){if(e===t)return!0;if(!e||"object"!=typeof e||!t||"object"!=typeof t)return!1;var n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(var r=0;r<e.length;r++)if(!k(e[r],t[r]))return!1}else{for(var i in e)if(!(i in t)||!k(e[i],t[i]))return!1;for(var o in t)if(!(o in e))return!1}return!0}var x=function(){function e(t,n){(0,d.Z)(this,e),this.type=t,this.attrs=n}return(0,f.Z)(e,[{key:"addToSet",value:function(e){for(var t,n=!1,r=0;r<e.length;r++){var i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||(t=e.slice(0,r));else{if(i.type.excludes(this.type))return e;!n&&i.type.rank>this.type.rank&&(t||(t=e.slice(0,r)),t.push(this),n=!0),t&&t.push(i)}}return t||(t=e.slice()),n||t.push(this),t}},{key:"removeFromSet",value:function(e){for(var t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}},{key:"isInSet",value:function(e){for(var t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}},{key:"eq",value:function(e){return this==e||this.type==e.type&&k(this.attrs,e.attrs)}},{key:"toJSON",value:function(){var e={type:this.type.name};for(var t in this.attrs){e.attrs=this.attrs;break}return e}}],[{key:"fromJSON",value:function(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");var n=e.marks[t.type];if(!n)throw new RangeError("There is no mark type ".concat(t.type," in this schema"));return n.create(t.attrs)}},{key:"sameSet",value:function(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(var n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}},{key:"setFrom",value:function(t){if(!t||Array.isArray(t)&&0==t.length)return e.none;if(t instanceof e)return[t];var n=t.slice();return n.sort((function(e,t){return e.type.rank-t.type.rank})),n}}]),e}();x.none=[];var C=function(e){(0,u.Z)(n,e);var t=(0,c.Z)(n);function n(){return(0,d.Z)(this,n),t.apply(this,arguments)}return(0,f.Z)(n)}((0,p.Z)(Error)),T=function(){function e(t,n,r){(0,d.Z)(this,e),this.content=t,this.openStart=n,this.openEnd=r}return(0,f.Z)(e,[{key:"size",get:function(){return this.content.size-this.openStart-this.openEnd}},{key:"insertAt",value:function(t,n){var r=M(this.content,t+this.openStart,n);return r&&new e(r,this.openStart,this.openEnd)}},{key:"removeBetween",value:function(t,n){return new e(E(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}},{key:"eq",value:function(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}},{key:"toString",value:function(){return this.content+"("+this.openStart+","+this.openEnd+")"}},{key:"toJSON",value:function(){if(!this.content.size)return null;var e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}}],[{key:"fromJSON",value:function(t,n){if(!n)return e.empty;var r=n.openStart||0,i=n.openEnd||0;if("number"!=typeof r||"number"!=typeof i)throw new RangeError("Invalid input for Slice.fromJSON");return new e(y.fromJSON(t,n.content),r,i)}},{key:"maxOpen",value:function(t){for(var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=0,i=0,o=t.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)r++;for(var a=t.lastChild;a&&!a.isLeaf&&(n||!a.type.spec.isolating);a=a.lastChild)i++;return new e(t,r,i)}}]),e}();function E(e,t,n){var r=e.findIndex(t),i=r.index,o=r.offset,a=e.maybeChild(i),s=e.findIndex(n),l=s.index,u=s.offset;if(o==t||a.isText){if(u!=n&&!e.child(l).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(i!=l)throw new RangeError("Removing non-flat range");return e.replaceChild(i,a.copy(E(a.content,t-o-1,n-o-1)))}function M(e,t,n,r){var i=e.findIndex(t),o=i.index,a=i.offset,s=e.maybeChild(o);if(a==t||s.isText)return r&&!r.canReplace(o,o,n)?null:e.cut(0,t).append(n).append(e.cut(t));var l=M(s.content,t-a-1,n);return l&&e.replaceChild(o,s.copy(l))}function N(e,t,n){if(n.openStart>
2e.depth)throw new C("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new C("Inconsistent open depths");return S(e,t,n,0)}function S(e,t,n,r){var i=e.index(r),o=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){var a=S(e,t,n,r+1);return o.copy(o.content.replaceChild(i,a))}if(n.content.size){if(n.openStart||n.openEnd||e.depth!=r||t.depth!=r){var s=function(e,t){for(var n=t.depth-e.openStart,r=t.node(n).copy(e.content),i=n-1;i>=0;i--)r=t.node(i).copy(y.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}(n,e);return I(o,R(e,s.start,s.end,t,r))}var l=e.parent,u=l.content;return I(l,u.cut(0,e.parentOffset).append(n.content).append(u.cut(t.parentOffset)))}return I(o,P(e,t,r))}function D(e,t){if(!t.type.compatibleContent(e.type))throw new C("Cannot join "+t.type.name+" onto "+e.type.name)}function L(e,t,n){var r=e.node(n);return D(r,t.node(n)),r}function A(e,t){var n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function O(e,t,n,r){var i=(t||e).node(n),o=0,a=t?t.index(n):i.childCount;e&&(o=e.index(n),e.depth>n?o++:e.textOffset&&(A(e.nodeAfter,r),o++));for(var s=o;s<a;s++)A(i.child(s),r);t&&t.depth==n&&t.textOffset&&A(t.nodeBefore,r)}function I(e,t){if(!e.type.validContent(t))throw new C("Invalid content for node "+e.type.name);return e.copy(t)}function R(e,t,n,r,i){var o=e.depth>i&&L(e,t,i+1),a=r.depth>i&&L(n,r,i+1),s=[];return O(null,e,i,s),o&&a&&t.index(i)==n.index(i)?(D(o,a),A(I(o,R(e,t,n,r,i+1)),s)):(o&&A(I(o,P(e,t,i+1)),s),O(t,n,i,s),a&&A(I(a,P(n,r,i+1)),s)),O(r,null,i,s),new y(s)}function P(e,t,n){var r=[];(O(null,e,n,r),e.depth>n)&&A(I(L(e,t,n+1),P(e,t,n+1)),r);return O(t,null,n,r),new y(r)}T.empty=new T(y.empty,0,0);var B=function(){function e(t,n,r){(0,d.Z)(this,e),this.pos=t,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}return(0,f.Z)(e,[{key:"resolveDepth",value:function(e){return null==e?this.depth:e<0?this.depth+e:e}},{key:"parent",get:function(){return this.node(this.depth)}},{key:"doc",get:function(){return this.node(0)}},{key:"node",value:function(e){return this.path[3*this.resolveDepth(e)]}},{key:"index",value:function(e){return this.path[3*this.resolveDepth(e)+1]}},{key:"indexAfter",value:function(e){return e=this.resolveDepth(e),this.index(e)+(e!=this.depth||this.textOffset?1:0)}},{key:"start",value:function(e){return 0==(e=this.resolveDepth(e))?0:this.path[3*e-1]+1}},{key:"end",value:function(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}},{key:"before",value:function(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]}},{key:"after",value:function(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]+this.path[3*e].nodeSize}},{key:"textOffset",get:function(){return this.pos-this.path[this.path.length-1]}},{key:"nodeAfter",get:function(){var e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;var n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}},{key:"nodeBefore",get:function(){var e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):0==e?null:this.parent.child(e-1)}},{key:"posAtIndex",value:function(e,t){t=this.resolveDepth(t);for(var n=this.path[3*t],r=0==t?0:this.path[3*t-1]+1,i=0;i<e;i++)r+=n.child(i).nodeSize;return r}},{key:"marks",value:function(){var e=this.parent,t=this.index();if(0==e.content.size)return x.none;if(this.textOffset)return e.child(t).marks;var n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){var i=n;n=r,r=i}for(var o=n.marks,a=0;a<o.length;a++)!1!==o[a].type.spec.inclusive||r&&o[a].isInSet(r.marks)||(o=o[a--].removeFromSet(o));return o}},{key:"marksAcross",value:function(e){var t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;for(var n=t.marks,r=e.parent.maybeChild(e.index()),i=0;i<n.length;i++)!1!==n[i].type.spec.inclusive||r&&n[i].isInSet(r.marks)||(n=n[i--].removeFromSet(n));return n}},{key:"sharedDepth",value:function(e){for(var t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}},{key:"blockRange",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this,t=arguments.length>1?arguments[1]:void 0;if(e.pos<this.pos)return e.blockRange(this);for(var n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new z(this,e,n);return null}},{key:"sameParent",value:function(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}},{key:"max",value:function(e){return e.pos>this.pos?e:this}},{key:"min",value:function(e){return e.pos<this.pos?e:this}},{key:"toString",value:function(){for(var e="",t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}}],[{key:"resolve",value:function(t,n){if(!(n>=0&&n<=t.content.size))throw new RangeError("Position "+n+" out of range");for(var r=[],i=0,o=n,a=t;;){var s=a.content.findIndex(o),l=s.index,u=s.offset,c=o-u;if(r.push(a,l,i+u),!c)break;if((a=a.child(l)).isText)break;o=c-1,i+=u+1}return new e(n,r,o)}},{key:"resolveCached",value:function(t,n){for(var r=0;r<F.length;r++){var i=F[r];if(i.pos==n&&i.doc==t)return i}var o=F[H]=e.resolve(t,n);return H=(H+1)%q,o}}]),e}(),F=[],H=0,q=12,z=function(){function e(t,n,r){(0,d.Z)(this,e),this.$from=t,this.$to=n,this.depth=r}return(0,f.Z)(e,[{key:"start",get:function(){return this.$from.before(this.depth+1)}},{key:"end",get:function(){return this.$to.after(this.depth+1)}},{key:"parent",get:function(){return this.$from.node(this.depth)}},{key:"startIndex",get:function(){return this.$from.index(this.depth)}},{key:"endIndex",get:function(){return this.$to.indexAfter(this.depth)}}]),e}(),j=Object.create(null),V=function(){function e(t,n,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:x.none;(0,d.Z)(this,e),this.type=t,this.attrs=n,this.marks=i,this.content=r||y.empty}return(0,f.Z)(e,[{key:"nodeSize",get:function(){return this.isLeaf?1:2+this.content.size}},{key:"childCount",get:function(){return this.content.childCount}},{key:"child",value:function(e){return this.content.child(e)}},{key:"maybeChild",value:function(e){return this.content.maybeChild(e)}}
2,{key:"forEach",value:function(e){this.content.forEach(e)}},{key:"nodesBetween",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;this.content.nodesBetween(e,t,n,r,this)}},{key:"descendants",value:function(e){this.nodesBetween(0,this.content.size,e)}},{key:"textContent",get:function(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}},{key:"textBetween",value:function(e,t,n,r){return this.content.textBetween(e,t,n,r)}},{key:"firstChild",get:function(){return this.content.firstChild}},{key:"lastChild",get:function(){return this.content.lastChild}},{key:"eq",value:function(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}},{key:"sameMarkup",value:function(e){return this.hasMarkup(e.type,e.attrs,e.marks)}},{key:"hasMarkup",value:function(e,t,n){return this.type==e&&k(this.attrs,t||e.defaultAttrs||j)&&x.sameSet(this.marks,n||x.none)}},{key:"copy",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return t==this.content?this:new e(this.type,this.attrs,t,this.marks)}},{key:"mark",value:function(t){return t==this.marks?this:new e(this.type,this.attrs,this.content,t)}},{key:"cut",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.content.size;return 0==e&&t==this.content.size?this:this.copy(this.content.cut(e,t))}},{key:"slice",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.content.size,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(e==t)return T.empty;var r=this.resolve(e),i=this.resolve(t),o=n?0:r.sharedDepth(t),a=r.start(o),s=r.node(o).content.cut(r.pos-a,i.pos-a);return new T(s,r.depth-o,i.depth-o)}},{key:"replace",value:function(e,t,n){return N(this.resolve(e),this.resolve(t),n)}},{key:"nodeAt",value:function(e){for(var t=this;;){var n=t.content.findIndex(e),r=n.index,i=n.offset;if(!(t=t.maybeChild(r)))return null;if(i==e||t.isText)return t;e-=i+1}}},{key:"childAfter",value:function(e){var t=this.content.findIndex(e),n=t.index,r=t.offset;return{node:this.content.maybeChild(n),index:n,offset:r}}},{key:"childBefore",value:function(e){if(0==e)return{node:null,index:0,offset:0};var t=this.content.findIndex(e),n=t.index,r=t.offset;if(r<e)return{node:this.content.child(n),index:n,offset:r};var i=this.content.child(n-1);return{node:i,index:n-1,offset:r-i.nodeSize}}},{key:"resolve",value:function(e){return B.resolveCached(this,e)}},{key:"resolveNoCache",value:function(e){return B.resolve(this,e)}},{key:"rangeHasMark",value:function(e,t,n){var r=!1;return t>e&&this.nodesBetween(e,t,(function(e){return n.isInSet(e.marks)&&(r=!0),!r})),r}},{key:"isBlock",get:function(){return this.type.isBlock}},{key:"isTextblock",get:function(){return this.type.isTextblock}},{key:"inlineContent",get:function(){return this.type.inlineContent}},{key:"isInline",get:function(){return this.type.isInline}},{key:"isText",get:function(){return this.type.isText}},{key:"isLeaf",get:function(){return this.type.isLeaf}},{key:"isAtom",get:function(){return this.type.isAtom}},{key:"toString",value:function(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);var e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),U(this.marks,e)}},{key:"contentMatchAt",value:function(e){var t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}},{key:"canReplace",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:y.empty,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:n.childCount,o=this.contentMatchAt(e).matchFragment(n,r,i),a=o&&o.matchFragment(this.content,t);if(!a||!a.validEnd)return!1;for(var s=r;s<i;s++)if(!this.type.allowsMarks(n.child(s).marks))return!1;return!0}},{key:"canReplaceWith",value:function(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;var i=this.contentMatchAt(e).matchType(n),o=i&&i.matchFragment(this.content,t);return!!o&&o.validEnd}},{key:"canAppend",value:function(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}},{key:"check",value:function(){if(!this.type.validContent(this.content))throw new RangeError("Invalid content for node ".concat(this.t
2ype.name,": ").concat(this.content.toString().slice(0,50)));for(var e=x.none,t=0;t<this.marks.length;t++)e=this.marks[t].addToSet(e);if(!x.sameSet(e,this.marks))throw new RangeError("Invalid collection of marks for node ".concat(this.type.name,": ").concat(this.marks.map((function(e){return e.type.name}))));this.content.forEach((function(e){return e.check()}))}},{key:"toJSON",value:function(){var e={type:this.type.name};for(var t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map((function(e){return e.toJSON()}))),e}}],[{key:"fromJSON",value:function(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");var n=null;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=t.marks.map(e.markFromJSON)}if("text"==t.type){if("string"!=typeof t.text)throw new RangeError("Invalid text node in JSON");return e.text(t.text,n)}var r=y.fromJSON(e,t.content);return e.nodeType(t.type).
2create(t.attrs,r,n)}}]),e}();V.prototype.text=void 0;var _=function(e){(0,u.Z)(n,e);var t=(0,c.Z)(n);function n(e,r,i,o){var a;if((0,d.Z)(this,n),a=t.call(this,e,r,null,o),!i)throw new RangeError("Empty text nodes are not allowed");return a.text=i,a}return(0,f.Z)(n,[{key:"toString",value:function(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):U(this.marks,JSON.stringify(this.text))}},{key:"textContent",get:function(){return this.text}},{key:"textBetween",value:function(e,t){return this.text.slice(e,t)}},{key:"nodeSize",get:function(){return this.text.length}},{key:"mark",value:function(e){return e==this.marks?this:new n(this.type,this.attrs,this.text,e)}},{key:"withText",value:function(e){return e==this.text?this:new n(this.type,this.attrs,e,this.marks)}},{key:"cut",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.text.length;return 0==e&&t==this.text.length?this:this.withText(this.text.slice(e,t))}},{key:"eq",value:function(e){return this.sameMarkup(e)&&this.text==e.text}},{key:"toJSON",value:function(){var e=(0,s.Z)((0,l.Z)(n.prototype),"toJSON",this).call(this);return e.text=this.text,e}}]),n}(V);function U(e,t){for(var n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}var $=function(){function e(t){(0,d.Z)(this,e),this.validEnd=t,this.next=[],this.wrapCache=[]}return(0,f.Z)(e,[{key:"matchType",value:function(e){for(var t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}},{key:"matchFragment",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.childCount,r=this,i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}},{key:"inlineContent",get:function(){return this.next.length&&this.next[0].type.isInline}},{key:"defaultType",get:function(){for(var e=0;e<this.next.length;e++){var t=this.next[e].type;if(!t.isText&&!t.hasRequiredAttrs())return t}return null}},{key:"compatible",value:function(e){for(var t=0;t<this.next.length;t++)for(var n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}},{key:"fillBefore",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=[this];return function i(o,a){var s=o.matchFragment(e,n);if(s&&(!t||s.validEnd))return y.from(a.map((function(e){return e.createAndFill()})));for(var l=0;l<o.next.length;l++){var u=o.next[l],c=u.type,p=u.next;if(!c.isText&&!c.hasRequiredAttrs()&&-1==r.indexOf(p)){r.push(p);var d=i(p,a.concat(c));if(d)return d}}return null}(this,[])}},{key:"findWrapping",value:function(e){for(var t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];var n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}},{key:"computeWrapping",value:function(e){for(var t=Object.create(null),n=[{match:this,type:null,via:null}];n.length;){var r=n.shift(),i=r.match;if(i.matchType(e)){for(var o=[],a=r;a.type;a=a.via)o.push(a.type);return o.reverse()}for(var s=0;s<i.next.length;s++){var l=i.next[s],u=l.type,c=l.next;u.isLeaf||u.hasRequiredAttrs()||u.name in t||r.type&&!c.validEnd||(n.push({match:u.contentMatch,type:u,via:r}),t[u.name]=!0)}}return null}},{key:"edgeCount",get:function(){return this.next.length}},{key:"edge",value:function(e){if(e>=this.next.length)throw new RangeError("There's no ".concat(e,"th edge in this content match"));return this.next[e]}},{key:"toString",value:function(){var e=[];return function t(n){e.push(n);for(var r=0;r<n.next.length;r++)-1==e.indexOf(n.next[r].next)&&t(n.next[r].next)}(this),e.map((function(t,n){for(var r=n+(t.validEnd?"*":" ")+" ",i=0;i<t.next.length;i++)r+=(i?", ":"")+t.next[i].type.name+"->"+e.indexOf(t.next[i].next);return r})).join("\n")}}],[{key:"parse",value:function(t,n){var r=new Z(t,n);if(null==r.next)return e.empty;var i=W(r);r.next&&r.err("Unexpected trailing text");var o=ee(function(e){var t=[[]];return i(o(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){var i={term:r,to:n};return t[e].push(i),i}function i(e,t){e.forEach((function(e){return e.to=t}))}function o(e,t){if("choice"==e.type)return e.exprs.reduce((function(e,n){return e.concat(o(n,t))}),[]);if("seq"!=e.type){if("star"==e.type){var a=n();return r(t,a),i(o(e.expr,a),a),[r(a)]}if("plus"==e.type){var s=n();return i(o(e.expr,t),s),i(o(e.expr,s),s),[r(s)]}if("opt"==e.type)return[r(t)].concat(o(e.expr,t));if("range"==e.type){for(var l=t,u=0;u<e.min;u++){var c=n();i(o(e.expr,l),c),l=c}if(-1==e.max)i(o(e.expr,l),l);else for(var p=e.min;p<e.max;p++){var d=n();r(l,d),i(o(e.expr,l),d),l=d}return[r(l)]}if("name"==e.type)return[r(t,void 0,e.value)];throw new Error("Unknown expr type")}for(var f=0;;f++){var h=o(e.exprs[f],t);if(f==e.exprs.length-1)return h;i(h,t=n())}}}(i));return function(e,t){for(var n=0,r=[e];n<r.length;n++){for(var i=r[n],o=!i.validEnd,a=[],s=0;s<i.next.length;s++){var l=i.next[s],u=l.type,c=l.next;a.push(u.name),!o||u.isText||u.hasRequiredAttrs()||(o=!1),-1==r.indexOf(c)&&r.push(c)}o&&t.err("Only non-generatable nodes ("+a.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(o,r),o}}]),e}();$.empty=new $(!0);var Z=function(){function e(t,n){(0,d.Z)(this,e),this.string=t,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?
2=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()}return(0,f.Z)(e,[{key:"next",get:function(){return this.tokens[this.pos]}},{key:"eat",value:function(e){return this.next==e&&(this.pos++||!0)}},{key:"err",value:function(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}]),e}();function W(e){var t=[];do{t.push(G(e))}while(e.eat("|"));return 1==t.length?t[0]:{type:"choice",exprs:t}}function G(e){var t=[];do{t.push(J(e))}while(e.next&&")"!=e.next&&"|"!=e.next);return 1==t.length?t[0]:{type:"seq",exprs:t}}function J(e){for(var t=function(e){if(e.eat("(")){var t=W(e);return e.eat(")")||e.err("Missing closing paren"),t}if(!/\W/.test(e.next)){var n=function(e,t){var n=e.nodeTypes,r=n[t];if(r)return[r];var i=[];for(var o in n){var a=n[o];a.groups.indexOf(t)>-1&&i.push(a)}0==i.length&&e.err("No node type or group '"+t+"' found");return i}(e,e.next).map((function(t){return null==e.inline?e.inline=t.isInline:e.inline!=t.isInline&&e.err("Mixing inline and block content"),{type:"name",value:t}}));return e.pos++,1==n.length?n[0]:{type:"choice",exprs:n}}e.err("Unexpected token '"+e.next+"'")}(e);;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else{if(!e.eat("{"))break;t=X(e,t)}return t}function K(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");var t=Number(e.next);return e.pos++,t}function X(e,t){var n=K(e),r=n;return e.eat(",")&&(r="}"!=e.next?K(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function Q(e,t){return t-e}function Y(e,t){var n=[];return function t(r){var i=e[r];if(1==i.length&&!i[0].term)return t(i[0].to);n.push(r);for(var o=0;o<i.length;o++){var a=i[o],s=a.term,l=a.to;s||-1!=n.indexOf(l)||t(l)}}(t),n.sort(Q)}function ee(e){var t=Object.create(null);return function n(r){var i=[];r.forEach((function(t){e[t].forEach((function(t){var n=t.term,r=t.to;if(n){for(var o,a=0;a<i.length;a++)i[a][0]==n&&(o=i[a][1]);Y(e,r).forEach((function(e){o||i.push([n,o=[]]),-1==o.indexOf(e)&&o.push(e)}))}}))}));for(var o=t[r.join(",")]=new $(r.indexOf(e.length-1)>-1),a=0;a<i.length;a++){var s=i[a][1].sort(Q);o.next.push({type:i[a][0],next:t[s.join(",")]||n(s)})}return o}(Y(e,0))}function te(e){var t=Object.create(null);for(var n in e){var r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function ne(e,t){var n=Object.create(null);for(var r in e){var i=t&&t[r];if(void 0===i){var o=e[r];if(!o.hasDefault)throw new RangeError("No value supplied for attribute "+r);i=o.default}n[r]=i}return n}function re(e){var t=Object.create(null);if(e)for(var n in e)t[n]=new oe(e[n]);return t}var ie=function(){function e(t,n,r){(0,d.Z)(this,e),this.name=t,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=re(r.attrs),this.defaultAttrs=te(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||"text"==t),this.isText="text"==t}return(0,f.Z)(e,[{key:"isInline",get:function(){return!this.isBlock}},{key:"isTextblock",get:function(){return this.isBlock&&this.inlineContent}},{key:"isLeaf",get:function(){return this.contentMatch==$.empty}},{key:"isAtom",get:function(){return this.isLeaf||!!this.spec.atom}},{key:"whitespace",get:function(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}},{key:"hasRequiredAttrs",value:function(){for(var e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}},{key:"compatibleContent",value:function(e){return this==e||this.contentMatch.compatible(e.contentMatch)}},{key:"computeAttrs",value:function(e){return!e&&this.defaultAttrs?this.defaultAttrs:ne(this.attrs,e)}},{key:"create",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new V(this,this.computeAttrs(e),y.from(t),x.setFrom(n))}},{key:"createChecked",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;if(t=y.from(t),!this.validContent(t))throw new RangeError("Invalid content for node "+this.name);return new V(this,this.computeAttrs(e),t,x.setFrom(n))}},{key:"createAndFill",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;if(e=this.computeAttrs(e),(t=y.from(t)).size){var r=this.contentMatch.fillBefore(t);if(!r)return null;t=r.append(t)}var i=this.contentMatch.matchFragment(t),o=i&&i.fillBefore(y.empty,!0);return o?new V(this,e,t.append(o),x.setFrom(n)):null}},{key:"validContent",value:function(e){var t=this.contentMatch.matchFragment(e);
2if(!t||!t.validEnd)return!1;for(var n=0;n<e.childCount;n++)if(!this.allowsMarks(e.child(n).marks))return!1;return!0}},{key:"allowsMarkType",value:function(e){return null==this.markSet||this.markSet.indexOf(e)>-1}},{key:"allowsMarks",value:function(e){if(null==this.markSet)return!0;for(var t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}},{key:"allowedMarks",value:function(e){if(null==this.markSet)return e;for(var t,n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||(t=e.slice(0,n));return t?t.length?t:x.none:e}}],[{key:"compile",value:function(t,n){var r=Object.create(null);t.forEach((function(t,i){return r[t]=new e(t,n,i)}));var i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(var o in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}}]),e}(),oe=function(){function e(t){(0,d.Z)(this,e),this.hasDefault=Object.prototype.hasOwnProperty.call(t,"default"),this.default=t.default}return(0,f.Z)(e,[{key:"isRequired",get:function(){return!this.hasDefault}}]),e}(),ae=function(){function e(t,n,r,i){(0,d.Z)(this,e),this.name=t,this.rank=n,this.schema=r,this.spec=i,this.attrs=re(i.attrs),this.excluded=null;var o=te(this.attrs);this.instance=o?new x(this,o):null}return(0,f.Z)(e,[{key:"create",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return!e&&this.instance?this.instance:new x(this,ne(this.attrs,e))}},{key:"removeFromSet",value:function(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}},{key:"isInSet",value:function(e){for(var t=0;t<e.length;t++)if(e[t].type==this)return e[t]}},{key:"excludes",value:function(e){return this.excluded.indexOf(e)>-1}}],[{key:"compile",value:function(t,n){var r=Object.create(null),i=0;return t.forEach((function(t,o){return r[t]=new e(t,i++,n,o)})),r}}]),e}(),se=function(){function e(t){(0,d.Z)(this,e),this.cached=Object.create(null),this.spec={nodes:m.from(t.nodes),marks:m.from(t.marks||{}),topNode:t.topNode},this.nodes=ie.compile(this.spec.nodes,this),this.marks=ae.compile(this.spec.marks,this);var n=Object.create(null);for(var r in this.nodes){if(r in this.marks)throw new RangeError(r+" can not be both a node and a mark");var i=this.nodes[r],o=i.spec.content||"",a=i.spec.marks;i.contentMatch=n[o]||(n[o]=$.parse(o,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.markSet="_"==a?null:a?le(this,a.split(" ")):""!=a&&i.inlineContent?null:[]}for(var s in this.marks){var l=this.marks[s],u=l.spec.excludes;l.excluded=null==u?[l]:""==u?[]:le(this,u.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}return(0,f.Z)(e,[{key:"node",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;if("string"==typeof e)e=this.nodeType(e);else{if(!(e instanceof ie))throw new RangeError("Invalid node type: "+e);if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}return e.createChecked(t,n,r)}},{key:"text",value:function(e,t){var n=this.nodes.text;return new _(n,n.defaultAttrs,e,x.setFrom(t))}},{key:"mark",value:function(e,t){return"string"==typeof e&&(e=this.marks[e]),e.create(t)}},{key:"nodeFromJSON",value:function(e){return V.fromJSON(this,e)}},{key:"markFromJSON",value:function(e){return x.fromJSON(this,e)}},{key:"nodeType",value:function(e){var t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}]),e}();function le(e,t){for(var n=[],r=0;r<t.length;r++){var i=t[r],o=e.marks[i],a=o;if(o)n.push(o);else for(var s in e.marks){var l=e.marks[s];("_"==i||l.spec.group&&l.spec.group.split(" ").indexOf(i)>-1)&&n.push(a=l)}if(!a)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}var ue=function(){function e(t,n){var r=this;(0,d.Z)(this,e),this.schema=t,this.rules=n,this.tags=[],this.styles=[],n.forEac
2h((function(e){e.tag?r.tags.push(e):e.style&&r.styles.push(e)})),this.normalizeLists=!this.tags.some((function(e){if(!/^(ul|ol)\b/.test(e.tag)||!e.node)return!1;var n=t.nodes[e.node];return n.contentMatch.matchType(n)}))}return(0,f.Z)(e,[{key:"parse",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=new me(this,t,!1);return n.addAll(e,t.from,t.to),n.finish()}},{key:"parseSlice",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=new me(this,t,!0);return n.addAll(e,t.from,t.to),T.maxOpen(n.finish())}},{key:"matchTag",value:function(e,t,n){for(var r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){var i=this.tags[r];if(ve(e,i.tag)&&(void 0===i.namespace||e.namespaceURI==i.namespace)&&(!i.context||t.matchesContext(i.context))){if(i.getAttrs){var o=i.getAttrs(e);if(!1===o)continue;i.attrs=o||void 0}return i}}}},{key:"matchStyle",value:function(e,t,n,r){for(var i=r?this.styles.indexOf(r)+1:0;i<this.styles.length;i++){var o=this.styles[i],a=o.style;if(!(0!=a.indexOf(e)||o.context&&!n.matchesContext(o.context)||a.length>e.length&&(61!=a.charCodeAt(e.length)||a.slice(e.length+1)!=t))){if(o.getAttrs){var s=o.getAttrs(t);if(!1===s)continue;o.attrs=s||void 0}return o}}}}],[{key:"schemaRules",value:function(e){var t=[];function n(e){for(var n=null==e.priority?50:e.priority,r=0;r<t.length;r++){var i=t[r];if((null==i.priority?50:i.priority)<n)break}t.splice(r,0,e)}var r=function(t){var r=e.marks[t].spec.parseDOM;r&&r.forEach((function(e){n(e=ge(e)),e.mark=t}))};for(var i in e.marks)r(i);var o=function(t){var r=e.nodes[t].spec.parseDOM;r&&r.forEach((function(e){n(e=ge(e)),e.node=t}))};for(var a in e.nodes)o(a);return t}},{key:"fromSchema",value:function(t){return t.cached.domParser||(t.cached.domParser=new e(t,e.schemaRules(t)))}}]),e}(),ce={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},pe={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},de={ol:!0,ul:!0};function fe(e,t,n){return null!=t?(t?1:0)|("full"===t?2:0):e&&"pre"==e.whitespace?3:-5&n}var he=function(){function e(t,n,r,i,o,a,s){(0,d.Z)(this,e),this.type=t,this.attrs=n,this.marks=r,this.pendingMarks=i,this.solid=o,this.options=s,this.content=[],this.activeMarks=x.none,this.stashMarks=[],this.match=a||(4&s?null:t.contentMatch)}return(0,f.Z)(e,[{key:"findWrapping",value:function(e){if(!this.match){if(!this.type)return[];var t=this.type.contentMatch.fillBefore(y.from(e));if(!t){var n,r=this.type.contentMatch;return(n=r.findWrapping(e.type))?(this.match=r,n):null}this.match=this.type.contentMatch.matchFragment(t)}return this.match.findWrapping(e.type)}},{key:"finish",value:function(e){if(!(1&this.options)){var t,n=this.content[this.content.length-1];if(n&&n.isText&&(t=/[ \t\r\n\u000c]+$/.exec(n.text))){var r=n;n.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=r.withText(r.text.slice(0,r.text.length-t[0].length))}}var i=y.from(this.content);return!e&&this.match&&(i=i.append(this.match.fillBefore(y.empty,!0))),this.type?this.type.create(this.attrs,i,this.marks):i}},{key:"popFromStashMark",value:function(e){for(var t=this.stashMarks.length-1;t>=0;t--)if(e.eq(this.stashMarks[t]))return this.stashMarks.splice(t,1)[0]}},{key:"applyPending",value:function(e){for(var t=0,n=this.pendingMarks;t<n.length;t++){var r=n[t];(this.type?this.type.allowsMarkType(r.type):ye(r.type,e))&&!r.isInSet(this.activeMarks)&&(this.activeMarks=r.addToSet(this.activeMarks),this.pendingMarks=r.removeFromSet(this.pendingMarks))}}},{key:"inlineContext",value:function(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!ce.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}]),e}(),me=function(){function e(t,n,r){(0,d.Z)(this,e),this.parser=t,this.options=n,this.isOpen=r,this.open=0;var i,o=n.topNode,a=fe(null,n.preserveWhitespace,0)|(r?4:0);i=o?new he(o.type,o.attrs,x.none,x.none,!0,n.topMatch||o.type.contentMatch,a):new he(r?null:t.schema.topNodeType,null,x.none,x.none,!0,null,a),this.nodes=[i],this.find=n.findPositions,this.needsBlock=!1}return(0,f.Z)(e,[{key:"top",get:function(){return this.nodes[this.open]}},{key:"addDOM",value:function(e){if(3==e.nodeType)this.addTextNode(e);else if(1==e.nodeType){var t=e.getAttribute("style"),n=t?this.readStyles(function(e){var t,n=/\s*([\w-]+)\s*:\s*([^;]+)/g,r=[];for(;t=n.exec(e);)r.push(t[1],t[2].trim());return r}(t)):null,r=this.top;if(null!=n)for(var i=0;i<n.length;i++)this.addPendingMark(n[i]);if(this.addElement(e),null!=n)for(var o=0;o<n.length;o++)this.removePendingMark(n[o],r)}}},{key:"addTextNode",value:function(e){var t=e.nodeValue,n=this.top;if(2&n.options||n.inlineContext(e)||/[^ \t\r\n\u000c]/.test(t)){if(1&n.options)t=2&n.options?t.replace(/\r\n?/g,"\n"):t.replace(/\r?\n|\r/g," ");else if(t=t.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(t)&&this.open==this.nodes.length-1){var r=n.content[n.content.length-1],i=e.previousSibling;(!r||i&&"BR"==i.nodeName||r.isText&&/[ \t\r\n\u000c]$/.test(r.text))&&(t=t.slice(1))}t&&this.insertNode(this.parser.schema.text(t)),this.findInText(e)}else this.findInside(e)}},{key:"addElement",value:function(e,t){var n,r=e.nodeName.toLowerCase();de.hasOwnProperty(r)&&this.parser.normalizeLists&&function(e){for(var t=e.firstChild,n=null;t;t=t.nextSibling){var r=1==t.nodeType?t.nodeName.toLowerCase():null;r&&de.hasOwnProperty(r)&&n?(n.appendChild(t),t=n):"li"==r?n=t:r&&(n=null)}}(e);var i=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(n=this.parser.matchTag(e,this,t));if(i?i.ignore:pe.hasOwnProperty(r))this.findInside(e),this.ignoreFallback(e);else if(!i||i.skip||i.closeParent){i&&i.closeParent?this.open=Math.max(0,this.open-1):i&&i.skip.nodeType&&(e=i.skip);var o,a=this.top,s=this.needsBlock;if(ce.hasOwnProperty(r))o=!0,a.type||(this.needsBlock=!0);else if(!e.firstChild)return void this.leafFallback(e);this.addAll(e),o&&this.sync(a),this.needsBlock=s}else this.addElementByRule(e,i,!1===i.consuming?n:void 0)}},{key:"leafFallback",value:function(e){"BR"==e.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode("\n"))}},{key:"ignoreFallback",value:function(e){"BR"!=e.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"))}},{key:"readStyles",value:function(e){var t=x.none;e:for(var n=0;n<e.length;n+=2)for(var r=void 0;;){var i=this.parser.matchStyle(e[n],e[n+1],this,r);if(!i)continue e;if(i.ignore)return null;if(t=this.parser.schema.marks[i.mark].create(i.attrs).addToSet(t),!1!==i.consuming)break;r=i}return t}},{key:"addElementByRule",value:function(e,t,n){var r,i,o,a=this;t.node?(i=this.parser.schema.nodes[t.node]).isLeaf?this.insertNode(i.create(t.attrs))||this.leafFallback(e):r=this.enter(i,t.attrs||null,t.preserveWhitespace):(o=this.parser.schema.marks[t.mark].create(t.attrs),this.addPendingMark(o));var s=this.top;if(i&&i.isLeaf)this.findInside(e);else if(n)this.addElement(e,n);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEac
2h((function(e){return a.insertNode(e)}));else{var l=e;"string"==typeof t.contentElement?l=e.querySelector(t.contentElement):"function"==typeof t.contentElement?l=t.contentElement(e):t.contentElement&&(l=t.contentElement),this.findAround(e,l,!0),this.addAll(l)}r&&this.sync(s)&&this.open--,o&&this.removePendingMark(o,s)}},{key:"addAll",value:function(e,t,n){for(var r=t||0,i=t?e.childNodes[t]:e.firstChild,o=null==n?null:e.childNodes[n];i!=o;i=i.nextSibling,++r)this.findAtPoint(e,r),this.addDOM(i);this.findAtPoint(e,r)}},{key:"findPlace",value:function(e){for(var t,n,r=this.open;r>=0;r--){var i=this.nodes[r],o=i.findWrapping(e);if(o&&(!t||t.length>o.length)&&(t=o,n=i,!o.length))break;if(i.solid)break}if(!t)return!1;this.sync(n);for(var a=0;a<t.length;a++)this.enterInner(t[a],null,!1);return!0}},{key:"insertNode",value:function(e){if(e.isInline&&this.needsBlock&&!this.top.type){var t=this.textblockFromContext();t&&this.enterInner(t)}if(this.findPlace(e)){this.closeExtra();var n=this.top;n.applyPending(e.type),n.match&&(n.match=n.match.matchType(e.type));for(var r=n.activeMarks,i=0;i<e.marks.length;i++)n.type&&!n.type.allowsMarkType(e.marks[i].type)||(r=e.marks[i].addToSet(r));return n.content.push(e.mark(r)),!0}return!1}},{key:"enter",value:function(e,t,n){var r=this.findPlace(e.create(t));return r&&this.enterInner(e,t,!0,n),r}},{key:"enterInner",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3?arguments[3]:void 0;this.closeExtra();var i=this.top;i.applyPending(e),i.match=i.match&&i.match.matchType(e);var o=fe(e,r,i.options);4&i.options&&0==i.content.length&&(o|=4),this.nodes.push(new he(e,t,i.activeMarks,i.pendingMarks,n,null,o)),this.open++}},{key:"closeExtra",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}},{key:"finish",value:function(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}},{key:"sync",value:function(e){for(var t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;return!1}},{key:"currentPos",get:function(){this.closeExtra();for(var e=0,t=this.open;t>=0;t--){for(var n=this.nodes[t].content,r=n.length-1;r>=0;r--)e+=n[r].nodeSize;t&&e++}return e}},{key:"findAtPoint",value:function(e,t){if(this.find)for(var n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}},{key:"findInside",value:function(e){if(this.find)for(var t=0;t<this.find.length;t++)null==this.find[t].pos&&1==e.nodeType&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}},{key:"findAround",value:function(e,t,n){if(e!=t&&this.find)for(var r=0;r<this.find.length;r++){if(null==this.find[r].pos&&1==e.nodeType&&e.contains(this.find[r].node))t.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}}},{key:"findInText",value:function(e){if(this.find)for(var t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}},{key:"matchesContext",value:function(e){var t=this;if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);var n=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1);return function e(a,s){for(;a>=0;a--){var l=n[a];if(""==l){if(a==n.length-1||0==a)continue;for(;s>=o;s--)if(e(a-1,s))return!0;return!1}var u=s>0||0==s&&i?t.nodes[s].type:r&&s>=o?r.node(s-o).type:null;if(!u||u.name!=l&&-1==u.groups.indexOf(l))return!1;s--}return!0}(n.length-1,this.open)}},{key:"textblockFromContext",value:function(){var e=this.options.context;if(e)for(var t=e.depth;t>=0;t--){var n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(var r in this.parser.schema.nodes){var i=this.parser.schema.nodes[r];
2if(i.isTextblock&&i.defaultAttrs)return i}}},{key:"addPendingMark",value:function(e){var t=function(e,t){for(var n=0;n<t.length;n++)if(e.eq(t[n]))return t[n]}(e,this.top.pendingMarks);t&&this.top.stashMarks.push(t),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)}},{key:"removePendingMark",value:function(e,t){for(var n=this.open;n>=0;n--){var r=this.nodes[n];if(r.pendingMarks.lastIndexOf(e)>-1)r.pendingMarks=e.removeFromSet(r.pendingMarks);else{r.activeMarks=e.removeFromSet(r.activeMarks);var i=r.popFromStashMark(e);i&&r.type&&r.type.allowsMarkType(i.type)&&(r.activeMarks=i.addToSet(r.activeMarks))}if(r==t)break}}}]),e}();function ve(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function ge(e){var t={};for(var n in e)t[n]=e[n];return t}function ye(e,t){var n=t.schema.nodes,r=function(){var r=n[i];if(!r.allowsMarkType(e))return"continue";var o=[];return function e(n){o.push(n);for(var r=0;r<n.edgeCount;r++){var i=n.edge(r),a=i.type,s=i.next;if(a==t)return!0;if(o.indexOf(s)<0&&e(s))return!0}}(r.contentMatch)?{v:!0}:void 0};for(var i in n){var o=r();if("continue"!==o&&"object"===typeof o)return o.v}}var be=function(){function e(t,n){(0,d.Z)(this,e),this.nodes=t,this.marks=n}return(0,f.Z)(e,[{key:"serializeFragment",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;r||(r=ke(n).createDocumentFragment());var i=r,o=[];return e.forEach((function(e){if(o.length||e.marks.length){for(var r=0,a=0;r<o.length&&a<e.marks.length;){var s=e.marks[a];if(t.marks[s.type.name]){if(!s.eq(o[r][0])||!1===s.type.spec.spanning)break;r++,a++}else a++}for(;r<o.length;)i=o.pop()[1];for(;a<e.marks.length;){var l=e.marks[a++],u=t.serializeMark(l,e.isInline,n);u&&(o.push([l,i]),i.appendChild(u.dom),i=u.contentDOM||u.dom)}}i.appendChild(t.serializeNodeInner(e,n))})),r}},{key:"serializeNodeInner",value:function(t,n){var r=e.renderSpec(ke(n),this.nodes[t.type.name](t)),i=r.dom,o=r.contentDOM;if(o){if(t.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(t.content,n,o)}return i}},{key:"serializeNode",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.serializeNodeInner(e,t),r=e.marks.length-1;r>=0;r--){var i=this.serializeMark(e.marks[r],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}},{key:"serializeMark",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=this.marks[t.type.name];return i&&e.renderSpec(ke(r),i(t,n))}}],[{key:"renderSpec",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if("string"==typeof n)return{dom:t.createTextNode(n)};if(null!=n.nodeType)return{dom:n};if(n.dom&&null!=n.dom.nodeType)return n;var i,o=n[0],a=o.indexOf(" ");a>0&&(r=o.slice(0,a),o=o.slice(a+1));var s=r?t.createElementNS(r,o):t.createElement(o),l=n[1],u=1;if(l&&"object"==typeof l&&null==l.nodeType&&!Array.isArray(l))for(var c in u=2,l)if(null!=l[c]){var p=c.indexOf(" ");p>0?s.setAttributeNS(c.slice(0,p),c.slice(p+1),l[c]):s.setAttribute(c,l[c])}for(var d=u;d<n.length;d++){var f=n[d];if(0===f){if(d<n.length-1||d>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:s,contentDOM:s}}var h=e.renderSpec(t,f,r),m=h.dom,v=h.contentDOM;if(s.appendChild(m),v){if(i)throw new RangeError("Multiple content holes");i=v}}return{dom:s,contentDOM:i}}},{key:"fromSchema",value:function(t){return t.cached.domSerializer||(t.cached.domSerializer=new e(this.nodesFromSchema(t),this.marksFromSchema(t)))}},{key:"nodesFromSchema",value:function(e){var t=we(e.nodes);return t.text||(t.text=function(e){return e.text}),t}},{key:"marksFromSchema",value:function(e){return we(e.marks)}}]),e}();function we(e){var t={};for(var n in e){var r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function ke(e){return e.document||window.document}var xe=n(47169),Ce=Math.pow(2,16);function Te(e,t){return e+t*Ce}function Ee(e){return 65535&e}var Me=function(){function e(t,n,r){(0,d.Z)(this,e),this.pos=t,this.delInfo=n,this.recover=r}return(0,f.Z)(e,[{key:"deleted",get:function(){return(8&this.delInfo)>0}},{key:"deletedBefore",get:function(){return(5&this.delInfo)>0}},{key:"deletedAfter",get:function(){return(6&this.delInfo)>0}},{key:"deletedAcross",get:function(){return(4&this.delInfo)>0}}]),e}(),Ne=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if((0,d.Z)(this,e),this.ranges=t,this.inverted=n,!t.length&&e.empty)return e.empty}return(0,f.Z)(e,[{key:"recover",value:function(e){var t=0,n=Ee(e);if(!this.inverted)for(var r=0;r<n;r++)t+=this.ranges[3*r+2]-this.ranges[3*r+1];return this.ranges[3*n]+t+function(e){return(e-(65535&e))/Ce}(e)}},{key:"mapResult",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this._map(e,t,!1)}},{key:"map",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this._map(e,t,!0)}},{key:"_map",value:function(e,t,n){for(var r=0,i=this.inverted?2:1,o=this.inverted?1:2,a=0;a<this.ranges.length;a+=3){var s=this.ranges[a]-(this.inverted?r:0);if(s>e)break;var l=this.ranges[a+i],u=this.ranges[a+o],c=s+l;if(e<=c){var p=s+r+((l?e==s?-1:e==c?1:t:t)<0?0:u);if(n)return p;
2var d=e==(t<0?s:c)?null:Te(a/3,e-s),f=e==s?2:e==c?1:4;return(t<0?e!=s:e!=c)&&(f|=8),new Me(p,f,d)}r+=u-l}return n?e+r:new Me(e+r,0,null)}},{key:"touches",value:function(e,t){for(var n=0,r=Ee(t),i=this.inverted?2:1,o=this.inverted?1:2,a=0;a<this.ranges.length;a+=3){var s=this.ranges[a]-(this.inverted?n:0);if(s>e)break;var l=this.ranges[a+i];if(e<=s+l&&a==3*r)return!0;n+=this.ranges[a+o]-l}return!1}},{key:"forEach",value:function(e){for(var t=this.inverted?2:1,n=this.inverted?1:2,r=0,i=0;r<this.ranges.length;r+=3){var o=this.ranges[r],a=o-(this.inverted?i:0),s=o+(this.inverted?0:i),l=this.ranges[r+t],u=this.ranges[r+n];e(a,a+l,s,s+u),i+=u-l}}},{key:"invert",value:function(){return new e(this.ranges,!this.inverted)}},{key:"toString",value:function(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}}],[{key:"offset",value:function(t){return 0==t?e.empty:new e(t<0?[0,-t,0]:[0,0,t])}}]),e}();Ne.empty=new Ne([]);var Se=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t.length;(0,d.Z)(this,e),this.maps=t,this.mirror=n,this.from=r,this.to=i}return(0,f.Z)(e,[{key:"slice",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.maps.length;return new e(this.maps,this.mirror,t,n)}},{key:"copy",value:function(){return new e(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}},{key:"appendMap",value:function(e,t){this.to=this.maps.push(e),null!=t&&this.setMirror(this.maps.length-1,t)}},{key:"appendMapping",value:function(e){for(var t=0,n=this.maps.length;t<e.maps.length;t++){var r=e.getMirror(t);this.appendMap(e.maps[t],null!=r&&r<t?n+r:void 0)}}},{key:"getMirror",value:function(e){if(this.mirror)for(var t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}},{key:"setMirror",value:function(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}},{key:"appendMappingInverted",value:function(e){for(var t=e.maps.length-1,n=this.maps.length+e.maps.length;t>=0;t--){var r=e.getMirror(t);this.appendMap(e.maps[t].invert(),null!=r&&r>t?n-r-1:void 0)}}},{key:"invert",value:function(){var t=new e;return t.appendMappingInverted(this),t}},{key:"map",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(this.mirror)return this._map(e,t,!0);for(var n=this.from;n<this.to;n++)e=this.maps[n].map(e,t);return e}},{key:"mapResult",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this._map(e,t,!1)}},{key:"_map",value:function(e,t,n){for(var r=0,i=this.from;i<this.to;i++){var o=this.maps[i].mapResult(e,t);if(null!=o.recover){var a=this.getMirror(i);if(null!=a&&a>i&&a<this.to){i=a,e=this.maps[a].recover(o.recover);continue}}r|=o.delInfo,e=o.pos}return n?e:new Me(e,r,null)}}]),e}(),De=Object.create(null),Le=function(){function e(){(0,d.Z)(this,e)}return(0,f.Z)(e,[{key:"getMap",value:function(){return Ne.empty}},{key:"merge",value:function(e){return null}}],[{key:"fromJSON",value:function(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");var n=De[t.stepType];if(!n)throw new RangeError("No step type ".concat(t.stepType," defined"));return n.fromJSON(e,t)}},{key:"jsonID",value:function(e,t){if(e in De)throw new RangeError("Duplicate use of step JSON ID "+e);return De[e]=t,t.prototype.jsonID=e,t}}]),e}(),Ae=function(){function e(t,n){(0,d.Z)(this,e),this.doc=t,this.failed=n}return(0,f.Z)(e,null,[{key:"ok",value:function(t){return new e(t,null)}},{key:"fail",value:function(t){return new e(null,t)}},{key:"fromReplace",value:function(t,n,r,i){try{return e.ok(t.replace(n,r,i))}catch(o){if(o instanceof C)return e.fail(o.message);throw o}}}]),e}();function Oe(e,t,n){for(var r=[],i=0;i<e.childCount;i++){var o=e.child(i);o.content.size&&(o=o.copy(Oe(o.content,t,o))),o.isInline&&(o=t(o,n,i)),r.push(o)}return y.fromArray(r)}var Ie=function(e){(0,u.Z)(n,e);var t=(0,c.Z)(n);
2function n(e,r,i){var o;return(0,d.Z)(this,n),(o=t.call(this)).from=e,o.to=r,o.mark=i,o}return(0,f.Z)(n,[{key:"apply",value:function(e){var t=this,n=e.slice(this.from,this.to),r=e.resolve(this.from),i=r.node(r.sharedDepth(this.to)),o=new T(Oe(n.content,(function(e,n){return e.isAtom&&n.type.allowsMarkType(t.mark.type)?e.mark(t.mark.addToSet(e.marks)):e}),i),n.openStart,n.openEnd);return Ae.fromReplace(e,this.from,this.to,o)}},{key:"invert",value:function(){return new Re(this.from,this.to,this.mark)}},{key:"map",value:function(e){var t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new n(t.pos,r.pos,this.mark)}},{key:"merge",value:function(e){return e instanceof n&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new n(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}},{key:"toJSON",value:function(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}}],[{key:"fromJSON",value:function(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new n(t.from,t.to,e.markFromJSON(t.mark))}}]),n}(Le);Le.jsonID("addMark",Ie);var Re=function(e){(0,u.Z)(n,e);var t=(0,c.Z)(n);function n(e,r,i){var o;return(0,d.Z)(this,n),(o=t.call(this)).from=e,o.to=r,o.mark=i,o}return(0,f.Z)(n,[{key:"apply",value:function(e){var t=this,n=e.slice(this.from,this.to),r=new T(Oe(n.content,(function(e){return e.mark(t.mark.removeFromSet(e.marks))}),e),n.openStart,n.openEnd);return Ae.fromReplace(e,this.from,this.to,r)}},{key:"invert",value:function(){return new Ie(this.from,this.to,this.mark)}},{key:"map",value:function(e){var t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new n(t.pos,r.pos,this.mark)}},{key:"merge",value:function(e){return e instanceof n&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new n(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}},{key:"toJSON",value:function(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}}],[{key:"fromJSON",value:function(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new n(t.from,t.to,e.markFromJSON(t.mark))}}]),n}(Le);Le.jsonID("removeMark",Re);var Pe=function(e){(0,u.Z)(n,e);var t=(0,c.Z)(n);function n(e,r){var i;return(0,d.Z)(this,n),(i=t.call(this)).pos=e,i.mark=r,i}return(0,f.Z)(n,[{key:"apply",value:function(e){var t=e.nodeAt(this.pos);if(!t)return Ae.fail("No node at mark step's position");var n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return Ae.fromReplace(e,this.pos,this.pos+1,new T(y.from(n),0,t.isLeaf?0:1))}},{key:"invert",value:function(e){var t=e.nodeAt(this.pos);if(t){var r=this.mark.addToSet(t.marks);if(r.length==t.marks.length){for(var i=0;i<t.marks.length;i++)if(!t.marks[i].isInSet(r))return new n(this.pos,t.marks[i]);return new n(this.pos,this.mark)}}return new Be(this.pos,this.mark)}},{key:"map",value:function(e){var t=e.mapResult(this.pos,1);return t.deletedAfter?null:new n(t.pos,this.mark)}},{key:"toJSON",value:function(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}}],[{key:"fromJSON",value:function(e,t){if("number"!=typeof t.pos)throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new n(t.pos,e.markFromJSON(t.mark))}}]),n}(Le);Le.jsonID("addNodeMark",Pe);var Be=function(e){(0,u.Z)(n,e);var t=(0,c.Z)(n);function n(e,r){var i;return(0,d.Z)(this,n),(i=t.call(this)).pos=e,i.mark=r,i}return(0,f.Z)(n,[{key:"apply",value:function(e){var t=e.nodeAt(this.pos);if(!t)return Ae.fail("No node at mark step's position");var n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return Ae.fromReplace(e,this.pos,this.pos+1,new T(y.from(n),0,t.isLeaf?0:1))}},{key:"invert",value:function(e){var t=e.nodeAt(this.pos);return t&&this.mark.isInSet(t.marks)?new Pe(this.pos,this.mark):this}},{key:"map",value:function(e){var t=e.mapResult(this.pos,1);return t.deletedAfter?null:new n(t.pos,this.mark)}}
2,{key:"toJSON",value:function(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}}],[{key:"fromJSON",value:function(e,t){if("number"!=typeof t.pos)throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new n(t.pos,e.markFromJSON(t.mark))}}]),n}(Le);Le.jsonID("removeNodeMark",Be);var Fe=function(e){(0,u.Z)(n,e);var t=(0,c.Z)(n);function n(e,r,i){var o,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return(0,d.Z)(this,n),(o=t.call(this)).from=e,o.to=r,o.slice=i,o.structure=a,o}return(0,f.Z)(n,[{key:"apply",value:function(e){return this.structure&&qe(e,this.from,this.to)?Ae.fail("Structure replace would overwrite content"):Ae.fromReplace(e,this.from,this.to,this.slice)}},{key:"getMap",value:function(){return new Ne([this.from,this.to-this.from,this.slice.size])}},{key:"invert",value:function(e){return new n(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}},{key:"map",value:function(e){var t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deletedAcross&&r.deletedAcross?null:new n(t.pos,Math.max(t.pos,r.pos),this.slice)}},{key:"merge",value:function(e){if(!(e instanceof n)||e.structure||this.structure)return null;if(this.from+this.slice.size!=e.from||this.slice.openEnd||e.slice.openStart){if(e.to!=this.from||this.slice.openStart||e.slice.openEnd)return null;var t=this.slice.size+e.slice.size==0?T.empty:new T(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new n(e.from,this.to,t,this.structure)}var r=this.slice.size+e.slice.size==0?T.empty:new T(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new n(this.from,this.to+(e.to-e.from),r,this.structure)}},{key:"toJSON",value:function(){var e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}}],[{key:"fromJSON",value:function(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new n(t.from,t.to,T.fromJSON(e,t.slice),!!t.structure)}}]),n}(Le);Le.jsonID("replace",Fe);var He=function(e){(0,u.Z)(n,e);var t=(0,c.Z)(n);function n(e,r,i,o,a,s){var l,u=arguments.length>6&&void 0!==arguments[6]&&arguments[6];return(0,d.Z)(this,n),(l=t.call(this)).from=e,l.to=r,l.gapFrom=i,l.gapTo=o,l.slice=a,l.insert=s,l.structure=u,l}return(0,f.Z)(n,[{key:"apply",value:function(e){if(this.structure&&(qe(e,this.from,this.gapFrom)||qe(e,this.gapTo,this.to)))return Ae.fail("Structure gap-replace would overwrite content");var t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return Ae.fail("Gap is not a flat range");var n=this.slice.insertAt(this.insert,t.content);return n?Ae.fromReplace(e,this.from,this.to,n):Ae.fail("Content does not fit in gap")}},{key:"getMap",value:function(){return new Ne([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}},{key:"invert",value:function(e){var t=this.gapTo-this.gapFrom;return new n(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}},{key:"map",value:function(e){var t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),i=e.map(this.gapFrom,-1),o=e.map(this.gapTo,1);return t.deletedAcross&&r.deletedAcross||i<t.pos||o>r.pos?null:new n(t.pos,r.pos,i,o,this.slice,this.insert,this.structure)}},{key:"toJSON",value:function(){var e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}}],[{key:"fromJSON",value:function(e,t){if("number"!=typeof t.from||"number"!=typeof t.to||"number"!=typeof t.gapFrom||"number"!=typeof t.gapTo||"number"!=typeof t.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new n(t.from,t.to,t.gapFrom,t.gapTo,T.fromJSON(e,t.slice),t.insert,!!t.structure)}}]),n}(Le);function qe(e,t,n){for(var r=e.resolve(t),i=n-t,o=r.depth;i>0&&o>
20&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0)for(var a=r.node(o).maybeChild(r.indexAfter(o));i>0;){if(!a||a.isLeaf)return!0;a=a.firstChild,i--}return!1}function ze(e,t,n){return(0==t||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function je(e){for(var t=e.parent.content.cutByIndex(e.startIndex,e.endIndex),n=e.depth;;--n){var r=e.$from.node(n),i=e.$from.index(n),o=e.$to.indexAfter(n);if(n<e.depth&&r.canReplace(i,o,t))return n;if(0==n||r.type.spec.isolating||!ze(r,i,o))break}return null}function Ve(e){return{type:e,attrs:null}}function _e(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3?arguments[3]:void 0,i=e.resolve(t),o=i.depth-n,a=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!a.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(var s=i.depth-1,l=n-2;s>o;s--,l--){var u=i.node(s),c=i.index(s);if(u.type.spec.isolating)return!1;var p=u.content.cutByIndex(c,u.childCount),d=r&&r[l]||u;if(d!=u&&(p=p.replaceChild(0,d.type.create(d.attrs))),!u.canReplace(c+1,u.childCount)||!d.type.validContent(p))return!1}var f=i.indexAfter(o),h=r&&r[0];return i.node(o).canReplaceWith(f,f,h?h.type:i.node(o+1).type)}function Ue(e,t){var n=e.resolve(t),r=n.index();return $e(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function $e(e,t){return!(!e||!t||e.isLeaf||!e.canAppend(t))}function Ze(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:T.empty;if(t==n&&!r.size)return null;var i=e.resolve(t),o=e.resolve(n);return We(i,o,r)?new Fe(t,n,r):new Ge(i,o,r).fit()}function We(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}Le.jsonID("replaceAround",He);var Ge=function(){function e(t,n,r){(0,d.Z)(this,e),this.$from=t,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=y.empty;for(var i=0;i<=t.depth;i++){var o=t.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(t.indexAfter(i))})}for(var a=t.depth;a>0;a--)this.placed=y.from(t.node(a).copy(this.placed))}return(0,f.Z)(e,[{key:"depth",get:function(){return this.frontier.length-1}},{key:"fit",value:function(){for(;this.unplaced.size;){var e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}var t=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(t<0?this.$to:r.doc.resolve(t));if(!i)return null;for(var o=this.placed,a=r.depth,s=i.depth;a&&s&&1==o.childCount;)o=o.firstChild.content,a--,s--;var l=new T(o,a,s);return t>-1?new He(r.pos,t,this.$to.pos,this.$to.end(),l,n):l.size||r.pos!=this.$to.pos?new Fe(r.pos,i.pos,l):null}},{key:"findFittable",value:function(){for(var e=1;e<=2;e++)for(var t=this.unplaced.openStart;t>=0;t--)for(var n=null,r=(t?(n=Xe(this.unplaced.content,t-1).firstChild).content:this.unplaced.content).firstChild,i=this.depth;i>=0;i--){var o=this.frontier[i],a=o.type,s=o.match,l=void 0,u=null;if(1==e&&(r?s.matchType(r.type)||(u=s.fillBefore(y.from(r),!1)):n&&a.compatibleContent(n.type)))return{sliceDepth:t,frontierDepth:i,parent:n,inject:u};if(2==e&&r&&(l=s.findWrapping(r.type)))return{sliceDepth:t,frontierDepth:i,parent:n,wrap:l};if(n&&s.matchType(n.type))break}}},{key:"openMore",value:function(){var e=this.unplaced,t=e.content,n=e.openStart,r=e.openEnd,i=Xe(t,n);return!(!i.childCount||i.firstChild.isLeaf)&&(this.unplaced=new T(t,n+1,Math.max(r,i.size+n>=t.size-r?n+1:0)),!0)}},{key:"dropNode",value:function(){var e=this.unplaced,t=e.content,n=e.openStart,r=e.openEnd,i=Xe(t,n);if(i.childCount<=1&&n>0){var o=t.size-n<=n+i.size;this.unplaced=new T(Je(t,n-1,1),n-1,o?n-1:r)}else this.unplaced=new T(Je(t,n,1),n,r)}},{key:"placeNodes",value:function(e){for(var t=e.sliceDepth,n=e.frontierDepth,r=e.parent,i=e.inject,o=e.wrap;this.depth>n;)this.closeFrontierNode();if(o)for(var a=0;a<o.length;a++)this.openFrontierNode(o[a]);var s=this.unplaced,l=r?r.content:s.content,u=s.openStart-t,c=0,p=[],d=this.frontier[n],f=d.match,h=d.type;if(i){for(var m=0;m<i.childCount;m++)p.push(i.child(m));f=f.matchFragment(i)}for(var v=l.size+t-(s.content.size-s.openEnd);c<l.childCount;){var g=l.child(c),b=f.matchType(g.type);if(!b)break;(++c>1||0==u||g.content.size)&&(f=b,p.push(Qe(g.mark(h.allowedMarks(g.marks)),1==c?u:0,c==l.childCount?v:-1)))}var w=c==l.childCount;w||(v=-1),this.placed=Ke(this.placed,n,y.from(p)),this.frontier[n].match=f,w&&v<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(var k=0,x=l;k<v;k++){var C=x.lastChild;this.frontier.push({type:C.type,match:C.contentMatchAt(C.childCount)}),x=C.content}this.unplaced=w?0==t?T.empty:new T(Je(s.content,t-1,1),t-1,v<0?s.openEnd:t-1):new T(Je(s.content,t,c),s.openStart,s.openEnd)}},{key:"mustMoveInline",value:function(){if(!this.$to.parent.isTextblock)return-1;var e,t=this.frontier[this.depth];if(!t.type.isTextblock||!Ye(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(e=this.findCloseLevel(this.$to))&&e.depth==this.depth)return-1;for(var n=this.$to.depth,r=this.$to.after(n);n>1&&r==this.$to.end(--n);)++r;return r}},{key:"findCloseLevel",value:function(e){e:for(var t=Math.min(this.depth,e.depth);t>=0;t--){var n=this.frontier[t],r=n.match,i=n.type,o=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),a=Ye(e,t,i,r,o);if(a){for(var s=t-1;s>=0;s--){var l=this.frontier[s],u=l.match,c=Ye(e,s,l.type,u,!0);if(!c||c.childCount)continue e}return{depth:t,fit:a,move:o?e.doc.resolve(e.after(t+1)):e}}}}},{key:"close",value:function(e){var t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=Ke(this.placed,t.depth,t.fit)),e=t.move;for(var n=t.depth+1;n<=e.depth;n++){var r=e.node(n),i=r.type.contentMatch.fillBefore(r.content,!0,e.index(n));this.openFrontierNode(r.type,r.attrs,i)}return e}},{key:"openFrontierNode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2?arguments[2]:void 0,r=this.frontier[this.depth];r.match=r.match.matchType(e),this.placed=Ke(this.placed,this.depth,y.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}},{key:"closeFrontierNode",value:function(){var e=this.frontier.pop().match.fillBefore(y.empty,!0);e.childCount&&(this.placed=Ke(this.placed,this.frontier.length,e))}}]),e}();function Je(e,t,n){return 0==t?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(Je(e.firstChild.content,t-1,n)))}function Ke(e,t,n){return 0==t?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(Ke(e.lastChild.content,t-1,n)))}function Xe(e,t){for(var n=0;n<t;n++)e=e.firstChild.content;return e}function Qe(e,t,n){if(t<=0)return e;var r=e.content;return t>1&&(r=r.replaceChild(0,Qe(r.firstChild,t-1,1==r.childCount?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(y.empty,!0)))),e.copy(r)}
2function Ye(e,t,n,r,i){var o=e.node(t),a=i?e.indexAfter(t):e.index(t);if(a==o.childCount&&!n.compatibleContent(o.type))return null;var s=r.fillBefore(o.content,!0,a);return s&&!function(e,t,n){for(var r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}(n,o.content,a)?s:null}function et(e){return e.spec.defining||e.spec.definingForContent}function tt(e,t,n,r,i){if(t<n){var o=e.firstChild;e=e.replaceChild(0,o.copy(tt(o.content,t+1,n,r,o)))}if(t>r){var a=i.contentMatchAt(0),s=a.fillBefore(e).append(e);e=s.append(a.matchFragment(s).fillBefore(y.empty,!0))}return e}function nt(e,t){for(var n=[],r=Math.min(e.depth,t.depth);r>=0;r--){var i=e.start(r);if(i<e.pos-(e.depth-r)||t.end(r)>t.pos+(t.depth-r)||e.node(r).type.spec.isolating||t.node(r).type.spec.isolating)break;(i==t.start(r)||r==e.depth&&r==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&r&&t.start(r-1)==i-1)&&n.push(r)}return n}var rt=function(e){(0,u.Z)(n,e);var t=(0,c.Z)(n);function n(e,r,i){var o;return(0,d.Z)(this,n),(o=t.call(this)).pos=e,o.attr=r,o.value=i,o}return(0,f.Z)(n,[{key:"apply",value:function(e){var t=e.nodeAt(this.pos);if(!t)return Ae.fail("No node at attribute step's position");var n=Object.create(null);for(var r in t.attrs)n[r]=t.attrs[r];n[this.attr]=this.value;var i=t.type.create(n,null,t.marks);return Ae.fromReplace(e,this.pos,this.pos+1,new T(y.from(i),0,t.isLeaf?0:1))}},{key:"getMap",value:function(){return Ne.empty}},{key:"invert",value:function(e){return new n(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}},{key:"map",value:function(e){var t=e.mapResult(this.pos,1);return t.deletedAfter?null:new n(t.pos,this.attr,this.value)}},{key:"toJSON",value:function(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}}],[{key:"fromJSON",value:function(e,t){if("number"!=typeof t.pos||"string"!=typeof t.attr)throw new RangeError("Invalid input for AttrStep.fromJSON");return new n(t.pos,t.attr,t.value)}}]),n}(Le);Le.jsonID("attr",rt);var it=Error;((it=function e(t){var n=Error.call(this,t);return n.__proto__=e.prototype,n}).prototype=Object.create(Error.prototype)).constructor=it,it.prototype.name="TransformError";var ot=function(){function e(t){(0,d.Z)(this,e),this.doc=t,this.steps=[],this.docs=[],this.mapping=new Se}return(0,f.Z)(e,[{key:"before",get:function(){return this.docs.length?this.docs[0]:this.doc}},{key:"step",value:function(e){var t=this.maybeStep(e);if(t.failed)throw new it(t.failed);return this}},{key:"maybeStep",value:function(e){var t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}},{key:"docChanged",get:function(){return this.steps.length>0}},{key:"addStep",value:function(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}},{key:"replace",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:T.empty,r=Ze(this.doc,e,t,n);return r&&this.step(r),this}},{key:"replaceWith",value:function(e,t,n){return this.replace(e,t,new T(y.from(n),0,0))}},{key:"delete",value:function(e,t){return this.replace(e,t,T.empty)}},{key:"insert",value:function(e,t){return this.replaceWith(e,e,t)}},{key:"replaceRange",value:function(e,t,n){return function(e,t,n,r){if(!r.size)return e.deleteRange(t,n);var i=e.doc.resolve(t),o=e.doc.resolve(n);if(We(i,o,r))return e.step(new Fe(t,n,r));var a=nt(i,e.doc.resolve(n));0==a[a.length-1]&&a.pop();var s=-(i.depth+1);a.unshift(s);for(var l=i.depth,u=i.pos-1;l>0;l--,u--){var c=i.node(l).type.spec;if(c.defining||c.definingAsContext||c.isolating)break;a.indexOf(l)>-1?s=l:i.before(l)==u&&a.splice(1,0,-l)}for(var p=a.indexOf(s),d=[],f=r.openStart,h=r.content,m=0;;m++){var v=h.firstChild;if(d.push(v),m==r.openStart)break;h=v.content}for(var g=f-1;g>=0;g--){var y=d[g].type,b=et(y);if(b&&i.node(p).type!=y)f=g;else if(b||!y.isTextblock)break}for(var w=r.openStart;w>=0;w--){var k=(w+f+1)%(r.openStart+1),x=d[k];if(x)for(var C=0;C<a.length;C++){var E=a[(C+p)%a.length],M=!0;E<0&&(M=!1,E=-E);var N=i.node(E-1),S=i.index(E-1);if(N.canReplaceWith(S,S,x.type,x.marks))return e.replace(i.before(E),M?o.after(E):n,new T(tt(r.content,0,r.openStart,k),k,r.openEnd))}}for(var D=e.steps.length,L=a.length-1;L>=0&&(e.replace(t,n,r),!(e.steps.length>D));L--){var A=a[L];A<0||(t=i.before(A),n=o.after(A))}}(this,e,t,n),this}},{key:"replaceRangeWith",value:function(e,t,n){return function(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){var i=function(e,t,n){var r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(0==r.parentOffset)for(var i=r.depth-1;i>=0;i--){var o=r.index(i);if(r.node(i).canReplaceWith(o,o,n))return r.before(i+1);if(o>0)return null}if(r.parentOffset==r.parent.content.size)for(var a=r.depth-1;a>=0;a--){var s=r.indexAfter(a);if(r.node(a).canReplaceWith(s,s,n))return r.after(a+1);if(s<r.node(a).childCount)return null}return null}(e.doc,t,r.type);null!=i&&(t=n=i)}e.replaceRange(t,n,new T(y.from(r),0,0))}(this,e,t,n),this}},{key:"deleteRange",value:function(e,t){return function(e,t,n){for(var r=e.doc.resolve(t),i=e.doc.resolve(n),o=nt(r,i),a=0;a<o.length;a++){var s=o[a],l=a==o.length-1;if(l&&0==s||r.node(s).type.contentMatch.validEnd)return e.delete(r.start(s),i.end(s));if(s>0&&(l||r.node(s-1).canReplace(r.index(s-1),i.indexAfter(s-1))))return e.delete(r.before(s),i.after(s))}for(var u=1;u<=r.depth&&u<=i.depth;u++)if(t-r.start(u)==r.depth-u&&n>r.end(u)&&i.end(u)-n!=i.depth-u)return e.delete(r.before(u),n);e.delete(t,n)}(this,e,t),this}},{key:"lift",value:function(e,t){return function(e,t,n){for(var r=t.$from,i=t.$to,o=t.depth,a=r.before(o+1),s=i.after(o+1),l=a,u=s,c=y.empty,p=0,d=o,f=!1;d>n;d--)f||r.index(d)>0?(f=!0,c=y.from(r.node(d).copy(c)),p++):l--;for(var h=y.empty,m=0,v=o,g=!1;v>n;v--)g||i.after(v+1)<i.end(v)?(g=!0,h=y.from(i.node(v).copy(h)),m++):u++;e.step(new He(l,u,a,s,new T(c.append(h),p,m),c.size-p,!0))}(this,e,t),this}},{key:"join",value:function(e){return function(e,t,n){var r=new Fe(t-n,t+n,T.empty,!0);e.step(r)}(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:1),this}},{key:"wrap",value:function(e,t){return function(e,t,n){for(var r=y.empty,i=n.length-1;i>=0;i--){if(r.size){var o=n[i].type.contentMatch.matchFragment(r);if(!o||!o.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=y.from(n[i].type.create(n[i].attrs,r))}var a=t.start,s=t.end;e.step(new He(a,s,a,s,new T(r,0,0),n.length,!0))}(this,e,t),this}},{key:"setBlockType",value:function(e){return function(e,t,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");var o=e.steps.length;e.doc.nodesBetween(t,n,(function(t,n){if(t.isTextblock&&!t.hasMarkup(r,i)&&function(e,t,n){var r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}(e.doc,e.mapping.slice(o).map(n),r)){e.clearIncompatible(e.mapping.slice(o).map(n,1),r);var a=e.mapping.slice(o),s=a.map(n,1),l=a.map(n+t.nodeSize,1);return e.step(new He(s,l,s+1,l-1,new T(y.from(r.create(i,null,t.marks)),0,0),1,!0)),!1}}))}(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,arguments.length>2?arguments[2]:void 0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:null),this}},{key:"setNodeMarkup",value:function(e,t){return function(e,t,n,r,i){var o=e.doc.nodeAt(t);if(!o)throw new RangeError("No node at given position");n||(n=o.type);var a=n.create(r,null,i||o.marks);if(o.isLeaf)return e.replaceWith(t,t+o.nodeSize,a);if(!n.validContent(o.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new He(t,t+o.nodeSize,t+1,t+o.nodeSize-1,new T(y.from(a),0,0),1,!0))}(this,e,t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,arguments.length>3&&void 0!==arguments[3]?arguments[3]:[]),this}},{key:"setNodeAttribute",value:function(e,t,n){return this.step(new rt(e,t,n)),this}},{key:"addNodeMark",value:function(e,t){return this.step(new Pe(e,t)),this}}
2,{key:"removeNodeMark",value:function(e,t){if(!(t instanceof x)){var n=this.doc.nodeAt(e);if(!n)throw new RangeError("No node at position "+e);if(!(t=t.isInSet(n.marks)))return this}return this.step(new Be(e,t)),this}},{key:"split",value:function(e){return function(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3?arguments[3]:void 0,i=e.doc.resolve(t),o=y.empty,a=y.empty,s=i.depth,l=i.depth-n,u=n-1;s>l;s--,u--){o=y.from(i.node(s).copy(o));var c=r&&r[u];a=y.from(c?c.type.create(c.attrs,a):i.node(s).copy(a))}e.step(new Fe(t,t,new T(o.append(a),n,n),!0))}(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,arguments.length>2?arguments[2]:void 0),this}},{key:"addMark",value:function(e,t,n){return function(e,t,n,r){var i,o,a=[],s=[];e.doc.nodesBetween(t,n,(function(e,l,u){if(e.isInline){var c=e.marks;if(!r.isInSet(c)&&u.type.allowsMarkType(r.type)){for(var p=Math.max(l,t),d=Math.min(l+e.nodeSize,n),f=r.addToSet(c),h=0;h<c.length;h++)c[h].isInSet(f)||(i&&i.to==p&&i.mark.eq(c[h])?i.to=d:a.push(i=new Re(p,d,c[h
2])));o&&o.to==p?o.to=d:s.push(o=new Ie(p,d,r))}}})),a.forEach((function(t){return e.step(t)})),s.forEach((function(t){return e.step(t)}))}(this,e,t,n),this}},{key:"removeMark",value:function(e,t,n){return function(e,t,n,r){var i=[],o=0;e.doc.nodesBetween(t,n,(function(e,a){if(e.isInline){o++;var s=null;if(r instanceof ae)for(var l,u=e.marks;l=r.isInSet(u);)(s||(s=[])).push(l),u=l.removeFromSet(u);else r?r.isInSet(e.marks)&&(s=[r]):s=e.marks;if(s&&s.length)for(var c=Math.min(a+e.nodeSize,n),p=0;p<s.length;p++){for(var d=s[p],f=void 0,h=0;h<i.length;h++){var m=i[h];m.step==o-1&&d.eq(i[h].style)&&(f=m)}f?(f.to=c,f.step=o):i.push({style:d,from:Math.max(a,t),to:c,step:o})}}})),i.forEach((function(t){return e.step(new Re(t.from,t.to,t.style))}))}(this,e,t,n),this}},{key:"clearIncompatible",value:function(e,t,n){return function(e,t,n){for(var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:n.contentMatch,i=e.doc.nodeAt(t),o=[],a=t+1,s=0;s<i.childCount;s++){var l=i.child(s),u=a+l.nodeSize,c=r.matchType(l.type);if(c){r=c;for(var p=0;p<l.marks.length;p++)n.allowsMarkType(l.marks[p].type)||e.step(new Re(a,u,l.marks[p]))}else o.push(new Fe(a,u,T.empty));a=u}if(!r.validEnd){var d=r.fillBefore(y.empty,!0);e.replace(a,a,new T(d,0,0))}for(var f=o.length-1;f>=0;f--)e.step(o[f])}(this,e,t,n),this}}]),e}(),at=Object.create(null),st=function(){function e(t,n,r){(0,d.Z)(this,e),this.$anchor=t,this.$head=n,this.ranges=r||[new lt(t.min(n),t.max(n))]}return(0,f.Z)(e,[{key:"anchor",get:function(){return this.$anchor.pos}},{key:"head",get:function(){return this.$head.pos}},{key:"from",get:function(){return this.$from.pos}},{key:"to",get:function(){return this.$to.pos}},{key:"$from",get:function(){return this.ranges[0].$from}},{key:"$to",get:function(){return this.ranges[0].$to}},{key:"empty",get:function(){for(var e=this.ranges,t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}},{key:"content",value:function(){return this.$from.doc.slice(this.from,this.to,!0)}},{key:"replace",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:T.empty,n=t.content.lastChild,r=null,i=0;i<t.openEnd;i++)r=n,n=n.lastChild;for(var o=e.steps.length,a=this.ranges,s=0;s<a.length;s++){var l=a[s],u=l.$from,c=l.$to,p=e.mapping.slice(o);e.replaceRange(p.map(u.pos),p.map(c.pos),s?T.empty:t),0==s&&yt(e,o,(n?n.isInline:r&&r.isTextblock)?-1:1)}}},{key:"replaceWith",value:function(e,t){for(var n=e.steps.length,r=this.ranges,i=0;i<r.length;i++){var o=r[i],a=o.$from,s=o.$to,l=e.mapping.slice(n),u=l.map(a.pos),c=l.map(s.pos);i?e.deleteRange(u,c):(e.replaceRangeWith(u,c,t),yt(e,n,t.isInline?-1:1))}}},{key:"getBookmark",value:function(){return pt.between(this.$anchor,this.$head).getBookmark()}}],[{key:"findFrom",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=e.parent.inlineContent?new pt(e):gt(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(var i=e.depth-1;i>=0;i--){var o=t<0?gt(e.node(0),e.node(i),e.before(i+1),e.index(i),t,n):gt(e.node(0),e.node(i),e.after(i+1),e.index(i)+1,t,n);if(o)return o}return null}},{key:"near",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this.findFrom(e,t)||this.findFrom(e,-t)||new mt(e.node(0))}},{key:"atStart",value:function(e){return gt(e,e,0,0,1)||new mt(e)}},{key:"atEnd",value:function(e){return gt(e,e,e.content.size,e.childCount,-1)||new mt(e)}},{key:"fromJSON",value:function(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");var n=at[t.type];if(!n)throw new RangeError("No selection type ".concat(t.type," defined"));return n.fromJSON(e,t)}},{key:"jsonID",value:function(e,t){if(e in at)throw new RangeError("Duplicate use of selection JSON ID "+e);return at[e]=t,t.prototype.jsonID=e,t}}]),e}();st.prototype.visible=!0;var lt=(0,f.Z)((function e(t,n){(0,d.Z)(this,e),this.$from=t,this.$to=n})),ut=!1;function ct(e){ut||e.parent.inlineContent||(ut=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}var pt=function(e){(0,u.Z)(n,e);var t=(0,c.Z)(n);function n(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;return(0,d.Z)(this,n),ct(e),ct(r),t.call(this,e,r)}return(0,f.Z)(n,[{key:"$cursor",get:function(){return this.$anchor.pos==this.$head.pos?this.$head:null}},{key:"map",value:function(e,t){var r=e.resolve(t.map(this.head));if(!r.parent.inlineContent)return st.near(r);var i=e.resolve(t.map(this.anchor));return new n(i.parent.inlineContent?i:r,r)}},{key:"replace",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:T.empty;if((0,s.Z)((0,l.Z)(n.prototype),"replace",this).call(this,e,t),t==T.empty){var r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}},{key:"eq",value:function(e){return e instanceof n&&e.anchor==this.anchor&&e.head==this.head}},{key:"getBookmark",value:function(){return new dt(this.anchor,this.head)}},{key:"toJSON",value:function(){return{type:"text",anchor:this.anchor,head:this.head}}}],[{key:"fromJSON",value:function(e,t){if("number"!=typeof t.anchor||"number"!=typeof t.head)throw new RangeError("Invalid input for TextSelection.fromJSON");
2return new n(e.resolve(t.anchor),e.resolve(t.head))}},{key:"create",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t,r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))}},{key:"between",value:function(e,t,r){var i=e.pos-t.pos;if(r&&!i||(r=i>=0?1:-1),!t.parent.inlineContent){var o=st.findFrom(t,r,!0)||st.findFrom(t,-r,!0);if(!o)return st.near(t,r);t=o.$head}return e.parent.inlineContent||(0==i||(e=(st.findFrom(e,-r,!0)||st.findFrom(e,r,!0)).$anchor).pos<t.pos!=i<0)&&(e=t),new n(e,t)}}]),n}(st);st.jsonID("text",pt);var dt=function(){function e(t,n){(0,d.Z)(this,e),this.anchor=t,this.head=n}return(0,f.Z)(e,[{key:"map",value:function(t){return new e(t.map(this.anchor),t.map(this.head))}},{key:"resolve",value:function(e){return pt.between(e.resolve(this.anchor),e.resolve(this.head))}}]),e}(),ft=function(e){(0,u.Z)(n,e);var t=(0,c.Z)(n);function n(e){var r;(0,d.Z)(this,n);var i=e.nodeAfter,o=e.node(0).resolve(e.pos+i.nodeSize);return(r=t.call(this,e,o)).node=i,r}return(0,f.Z)(n,[{key:"map",value:function(e,t){var r=t.mapResult(this.anchor),i=r.deleted,o=r.pos,a=e.resolve(o);return i?st.near(a):new n(a)}},{key:"content",value:function(){return new T(y.from(this.node),0,0)}},{key:"eq",value:function(e){return e instanceof n&&e.anchor==this.anchor}},{key:"toJSON",value:function(){return{type:"node",anchor:this.anchor}}},{key:"getBookmark",value:function(){return new ht(this.anchor)}}],[{key:"fromJSON",value:function(e,t){if("number"!=typeof t.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new n(e.resolve(t.anchor))}},{key:"create",value:function(e,t){return new n(e.resolve(t))}},{key:"isSelectable",value:function(e){return!e.isText&&!1!==e.type.spec.selectable}}]),n}(st);ft.prototype.visible=!1,st.jsonID("node",ft);var ht=function(){function e(t){(0,d.Z)(this,e),this.anchor=t}return(0,f.Z)(e,[{key:"map",value:function(t){var n=t.mapResult(this.anchor),r=n.deleted,i=n.pos;return r?new dt(i,i):new e(i)}},{key:"resolve",value:function(e){var t=e.resolve(this.anchor),n=t.nodeAfter;return n&&ft.isSelectable(n)?new ft(t):st.near(t)}}]),e}(),mt=function(e){(0,u.Z)(n,e);var t=(0,c.Z)(n);function n(e){return(0,d.Z)(this,n),t.call(this,e.resolve(0),e.resolve(e.content.size))}return(0,f.Z)(n,[{key:"replace",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:T.empty;if(t==T.empty){e.delete(0,e.doc.content.size);var r=st.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else(0,s.Z)((0,l.Z)(n.prototype),"replace",this).call(this,e,t)}},{key:"toJSON",value:function(){return{type:"all"}}},{key:"map",value:function(e){return new n(e)}},{key:"eq",value:function(e){return e instanceof n}},{key:"getBookmark",value:function(){return vt}}],[{key:"fromJSON",value:function(e){return new n(e)}}]),n}(st);st.jsonID("all",mt);var vt={map:function(){return this},resolve:function(e){return new mt(e)}};function gt(e,t,n,r,i){var o=arguments.length>5&&void 0!==arguments[5]&&arguments[5];if(t.inlineContent)return pt.create(e,n);for(var a=r-(i>0?0:1);i>0?a<t.childCount:a>=0;a+=i){var s=t.child(a);if(s.isAtom){if(!o&&ft.isSelectable(s))return ft.create(e,n-(i<0?s.nodeSize:0))}else{var l=gt(e,s,n+i,i<0?s.childCount:0,i,o);if(l)return l}n+=s.nodeSize*i}return null}function yt(e,t,n){var r=e.steps.length-1;if(!(r<t)){var i,o=e.steps[r];if(o instanceof Fe||o instanceof He)e.mapping.maps[r].forEach((function(e,t,n,r){null==i&&(i=r)})),e.setSelection(st.near(e.doc.resolve(i),n))}}var bt=function(e){(0,u.Z)(n,e);var t=(0,c.Z)(n);function n(e){var r;return(0,d.Z)(this,n),(r=t.call(this,e.doc)).curSelectionFor=0,r.updated=0,r.meta=Object.create(null),r.time=Date.now(),r.curSelection=e.selection,r.storedMarks=e.storedMarks,r}return(0,f.Z)(n,[{key:"selection",get:function(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}},{key:"setSelection",value:function(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=-3&(1|this.updated),this.storedMarks=null,this}},{key:"selectionSet",get:function(){return(1&this.updated)>0}},{key:"setStoredMarks",value:function(e){return this.storedMarks=e,this.updated|=2,this}},{key:"ensureMarks",value:function(e){return x.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}},{key:"addStoredMark",value:function(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}},{key:"removeStoredMark",value:function(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}},{key:"storedMarksSet",get:function(){return(2&this.updated)>0}},{key:"addStep",value:function(e,t){(0,s.Z)((0,l.Z)(n.prototype),"addStep",this).call(this,e,t),this.updated=-3&this.updated,this.storedMarks=null}},{key:"setTime",value:function(e){return this.time=e,this}},{key:"replaceSelection",value:function(e){return this.selection.replace(this,e),this}},{key:"replaceSelectionWith",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||x.none))),n.replaceWith(this,e),this}},{key:"deleteSelection",value:function(){return this.selection.replace(this),this}},{key:"insertText",value:function(e,t,n){var r=this.doc.type.schema;if(null==t)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();if(null==n&&(n=t),n=null==n?t:n,!e)return this.deleteRange(t,n);var i=this.storedMarks;if(!i){var o=this.doc.resolve(t);i=n==t?o.marks():o.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,i)),this.selection.empty||this.setSelection(st.near(this.selection.$to)),this}},{key:"setMeta",value:function(e,t){return this.meta["string"==typeof e?e:e.key]=t,this}},{key:"getMeta",value:function(e){return this.meta["string"==typeof e?e:e.key]}},{key:"isGeneric",get:function(){for(var e in this.meta)return!1;return!0}},{key:"scrollIntoView",value:function(){return this.updated|=4,this}},{key:"scrolledIntoView",get:function(){return(4&this.updated)>0}}]),n}(ot);function wt(e,t){return t&&e?e.bind(t):e}var kt=(0,f.Z)((function e(t,n,r){(0,d.Z)(this,e),this.name=t,this.init=wt(n.init,r),this.apply=wt(n.apply,r)})),xt=[new kt("doc",{init:function(e){return e.doc||e.schema.topNodeType.createAndFill()},apply:function(e){return e.doc}}),new kt("selection",{init:function(e,t){return e.selection||st.atStart(t.doc)},apply:function(e){return e.selection}}),new kt("storedMarks",{init:function(e){return e.storedMarks||null},apply:function(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new kt("scrollToSelection",{init:function(){return 0},apply:function(e,t){return e.scrolledIntoView?t+1:t}})],Ct=(0,f.Z)((function e(t,n){var r=this;(0,d.Z)(this,e),this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=xt.slice(),n&&n.forEac
2h((function(e){if(r.pluginsByKey[e.key])throw new RangeError("Adding different instances of a keyed plugin ("+e.key+")");r.plugins.push(e),r.pluginsByKey[e.key]=e,e.spec.state&&r.fields.push(new kt(e.key,e.spec.state,e))}))})),Tt=function(){function e(t){(0,d.Z)(this,e),this.config=t}return(0,f.Z)(e,[{key:"schema",get:function(){return this.config.schema}},{key:"plugins",get:function(){return this.config.plugins}},{key:"apply",value:function(e){return this.applyTransaction(e).state}},{key:"filterTransaction",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,n=0;n<this.config.plugins.length;n++)if(n!=t){var r=this.config.plugins[n];if(r.spec.filterTransaction&&!r.spec.filterTransaction.call(r,e,this))return!1}return!0}},{key:"applyTransaction",value:function(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};for(var t=[e],n=this.applyInner(e),r=null;;){for(var i=!1,o=0;o<this.config.plugins.length;o++){var a=this.config.plugins[o];if(a.spec.appendTransaction){var s=r?r[o].n:0,l=r?r[o].state:this,u=s<t.length&&a.spec.appendTransaction.call(a,s?t.slice(s):t,l,n);if(u&&n.filterTransaction(u,o)){if(u.setMeta("appendedTransaction",e),!r){r=[];for(var c=0;c<this.config.plugins.length;c++)r.push(c<o?{state:n,n:t.length}:{state:this,n:0})}t.push(u),n=n.applyInner(u),i=!0}r&&(r[o]={state:n,n:t.length})}}if(!i)return{state:n,transactions:t}}}},{key:"applyInner",value:function(t){if(!t.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");for(var n=new e(this.config),r=this.config.fields,i=0;i<r.length;i++){var o=r[i];n[o.name]=o.apply(t,this[o.name],this,n)}return n}},{key:"tr",get:function(){return new bt(this)}},{key:"reconfigure",value:function(t){for(var n=new Ct(this.schema,t.plugins),r=n.fields,i=new e(n),o=0;o<r.length;o++){var a=r[o].name;i[a]=this.hasOwnProperty(a)?this[a]:r[o].init(t,i)}return i}},{key:"toJSON",value:function(e){var t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map((function(e){return e.toJSON()}))),e&&"object"==typeof e)for(var n in e){if("doc"==n||"selection"==n)throw new RangeError("The JSON fields `doc` and `selection` are reserved");var r=e[n],i=r.spec.state;i&&i.toJSON&&(t[n]=i.toJSON.call(r,this[r.key]))}return t}}],[{key:"create",value:function(t){for(var n=new Ct(t.doc?t.doc.type.schema:t.schema,t.plugins),r=new e(n),i=0;i<n.fields.length;i++)r[n.fields[i].name]=n.fields[i].init(t,r);return r}},{key:"fromJSON",value:function(t,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw new RangeError("Required config field 'schema' missing");var i=new Ct(t.schema,t.plugins),o=new e(i);return i.fields.forEach((function(e){if("doc"==e.name)o.doc=V.fromJSON(t.schema,n.doc);else if("selection"==e.name)o.selection=st.fromJSON(o.doc,n.selection);else if("storedMarks"==e.name)n.storedMarks&&(o.storedMarks=n.storedMarks.map(t.schema.markFromJSON));else{if(r)for(var i in r){var a=r[i],s=a.spec.state;if(a.key==e.name&&s&&s.fromJSON&&Object.prototype.hasOwnProperty.call(n,i))return void(o[e.name]=s.fromJSON.call(a,t,n[i],o))}o[e.name]=e.init(t,o)}})),o}}]),e}();function Et(e,t,n){for(var r in e){var i=e[r];i instanceof Function?i=i.bind(t):"handleDOMEvents"==r&&(i=Et(i,t,{})),n[r]=i}return n}var Mt=function(){function e(t){(0,d.Z)(this,e),this.spec=t,this.props={},t.props&&Et(t.props,this,this.props),this.key=t.key?t.key.key:St("plugin")}return(0,f.Z)(e,[{key:"getState",value:function(e){return e[this.key]}}]),e}(),Nt=Object.create(null);function St(e){return e in Nt?e+"$"+ ++Nt[e]:(Nt[e]=0,e+"$")}var Dt=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"key";(0,d.Z)(this,e),this.key=St(t)}return(0,f.Z)(e,[{key:"get",value:function(e){return e.config.pluginsByKey[this.key]}},{key:"getState",value:function(e){return e[this.key]}}]),e}(),Lt="undefined"!=typeof navigator?navigator:null,At="undefined"!=typeof document?document:null,Ot=Lt&&Lt.userAgent||"",It=/Edge\/(\d+)/.exec(Ot),Rt=/MSIE \d/.exec(Ot),Pt=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Ot),Bt=!!(Rt||Pt||It),Ft=Rt?document.documentMode:Pt?+Pt[1]:It?+It[1]:0,Ht=!Bt&&/gecko\/(\d+)/i.test(Ot);Ht&&(/Firefox\/(\d+)/.exec(Ot)||[0,0])[1];var qt=!Bt&&/Chrome\/(\d+)/.exec(Ot),zt=!!qt,jt=qt?+qt[1]:0,Vt=!Bt&&!!Lt&&/Apple Computer/.test(Lt.vendor),_t=Vt&&(/Mobile\/\w+/.test(Ot)||!!Lt&&Lt.maxTouchPoints>2),Ut=_t||!!Lt&&/Mac/.test(Lt.platform),$t=/Android \d/.test(Ot),Zt=!!At&&"webkitFontSmoothing"in At.documentElement.style,Wt=Zt?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,Gt=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},Jt=function(e){var t=e.assignedSlot||e.parentNode;return t&&11==t.nodeType?t.host:t},Kt=null,Xt=function(e,t,n){var r=Kt||(Kt=document.createRange());return r.setEnd(e,null==n?e.nodeValue.length:n),r.setStart(e,t||0),r},Qt=function(e,t,n,r){return n&&(en(e,t,n,r,-1)||en(e,t,n,r,1))},Yt=/^(img|br|input|textarea|hr)$/i;function en(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;
2if(t==(i<0?0:tn(e))){var o=e.parentNode;if(!o||1!=o.nodeType||nn(e)||Yt.test(e.nodeName)||"false"==e.contentEditable)return!1;t=Gt(e)+(i<0?0:1),e=o}else{if(1!=e.nodeType)return!1;if("false"==(e=e.childNodes[t+(i<0?-1:0)]).contentEditable)return!1;t=i<0?tn(e):0}}}function tn(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function nn(e){for(var t,n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}var rn=function(e){var t=e.isCollapsed;return t&&zt&&e.rangeCount&&!e.getRangeAt(0).collapsed&&(t=!1),t};function on(e,t){var n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}function an(e){return{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function sn(e,t){return"number"==typeof e?e:e[t]}function ln(e){var t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function un(e,t,n){for(var r=e.someProp("scrollThreshold")||0,i=e.someProp("scrollMargin")||5,o=e.dom.ownerDocument,a=n||e.dom;a;a=Jt(a))if(1==a.nodeType){var s=a,l=s==o.body,u=l?an(o):ln(s),c=0,p=0;if(t.top<u.top+sn(r,"top")?p=-(u.top-t.top+sn(i,"top")):t.bottom>u.bottom-sn(r,"bottom")&&(p=t.bottom-u.bottom+sn(i,"bottom")),t.left<u.left+sn(r,"left")?c=-(u.left-t.left+sn(i,"left")):t.right>u.right-sn(r,"right")&&(c=t.right-u.right+sn(i,"right")),c||p)if(l)o.defaultView.scrollBy(c,p);else{var d=s.scrollLeft,f=s.scrollTop;p&&(s.scrollTop+=p),c&&(s.scrollLeft+=c);var h=s.scrollLeft-d,m=s.scrollTop-f;t={left:t.left-h,top:t.top-m,right:t.right-h,bottom:t.bottom-m}}if(l)break}}function cn(e){for(var t=[],n=e.ownerDocument,r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=Jt(r));return t}function pn(e,t){for(var n=0;n<e.length;n++){var r=e[n],i=r.dom,o=r.top,a=r.left;i.scrollTop!=o+t&&(i.scrollTop=o+t),i.scrollLeft!=a&&(i.scrollLeft=a)}}var dn=null;function fn(e,t){for(var n,r,i=2e8,o=0,a=t.top,s=t.top,l=e.firstChild,u=0;l;l=l.nextSibling,u++){var c=void 0;if(1==l.nodeType)c=l.getClientRects();else{if(3!=l.nodeType)continue;c=Xt(l).getClientRects()}for(var p=0;p<c.length;p++){var d=c[p];if(d.top<=a&&d.bottom>=s){a=Math.max(d.bottom,a),s=Math.min(d.top,s);var f=d.left>t.left?d.left-t.left:d.right<t.left?t.left-d.right:0;if(f<i){n=l,i=f,r=f&&3==n.nodeType?{left:d.right<t.left?d.right:d.left,top:t.top}:t,1==l.nodeType&&f&&(o=u+(t.left>=(d.left+d.right)/2?1:0));continue}}!n&&(t.left>=d.right&&t.top>=d.top||t.left>=d.left&&t.top>=d.bottom)&&(o=u+1)}}return n&&3==n.nodeType?function(e,t){for(var n=e.nodeValue.length,r=document.createRange(),i=0;i<n;i++){r.setEnd(e,i+1),r.setStart(e,i);var o=gn(r,1);if(o.top!=o.bottom&&hn(t,o))return{node:e,offset:i+(t.left>=(o.left+o.right)/2?1:0)}}return{node:e,offset:0}}(n,r):!n||i&&1==n.nodeType?{node:e,offset:o}:fn(n,r)}function hn(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function mn(e,t,n){var r=e.childNodes.length;if(r&&n.top<n.bottom)for(var i=Math.max(0,Math.min(r-1,Math.floor(r*(t.top-n.top)/(n.bottom-n.top))-2)),o=i;;){var a=e.childNodes[o];if(1==a.nodeType)for(var s=a.getClientRects(),l=0;l<s.length;l++){var u=s[l];if(hn(t,u))return mn(a,t,u)}if((o=(o+1)%r)==i)break}return e}function vn(e,t){var n,r=e.dom.ownerDocument,i=0;if(r.caretPositionFromPoint)try{var o=r.caretPositionFromPoint(t.left,t.top);o&&(n=o.offsetNode,i=o.offset)}catch(h){}if(!n&&r.caretRangeFromPoint){var a=r.caretRangeFromPoint(t.left,t.top);a&&(n=a.startContainer,i=a.startOffset)}var s,l=(e.root.elementFromPoint?e.root:r).elementFromPoint(t.left,t.top);if(!l||!e.dom.contains(1!=l.nodeType?l.parentNode:l)){var u=e.dom.getBoundingClientRect();if(!hn(t,u))return null;if(!(l=mn(e.dom,t,u)))return null}if(Vt)for(var c=l;n&&c;c=Jt(c))c.draggable&&(n=void 0);if(l=function(e,t){var n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}(l,t),n){if(Ht&&1==n.nodeType&&(i=Math.min(i,n.childNodes.length))<n.childNodes.length){var p,d=n.childNodes[i];"IMG"==d.nodeName&&(p=d.getBoundingClientRect()).right<=t.left&&p.bottom>t.top&&i++}n==e.dom&&i==n.childNodes.length-1&&1==n.lastChild.nodeType&&t.top>
2n.lastChild.getBoundingClientRect().bottom?s=e.state.doc.content.size:0!=i&&1==n.nodeType&&"BR"==n.childNodes[i-1].nodeName||(s=function(e,t,n,r){for(var i=-1,o=t;o!=e.dom;){var a=e.docView.nearestDesc(o,!0);if(!a)return null;if(a.node.isBlock&&a.parent){var s=a.dom.getBoundingClientRect();if(s.left>r.left||s.top>r.top)i=a.posBefore;else{if(!(s.right<r.left||s.bottom<r.top))break;i=a.posAfter}}o=a.dom.parentNode}return i>-1?i:e.docView.posFromDOM(t,n,1)}(e,n,i,t))}null==s&&(s=function(e,t,n){var r=fn(t,n),i=r.node,o=r.offset,a=-1;if(1==i.nodeType&&!i.firstChild){var s=i.getBoundingClientRect();a=s.left!=s.right&&n.left>(s.left+s.right)/2?1:-1}return e.docView.posFromDOM(i,o,a)}(e,l,t));var f=e.docView.nearestDesc(l,!0);return{pos:s,inside:f?f.posAtStart-f.border:-1}}function gn(e,t){var n=e.getClientRects();return n.length?n[t<0?0:n.length-1]:e.getBoundingClientRect()}var yn=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function bn(e,t,n){var r=e.docView.domFromPos(t,n<0?-1:1),i=r.node,o=r.offset,a=r.atom,s=Zt||Ht;if(3==i.nodeType){if(!s||!yn.test(i.nodeValue)&&(n<0?o:o!=i.nodeValue.length)){var l=o,u=o,c=n<0?1:-1;return n<0&&!o?(u++,c=-1):n>=0&&o==i.nodeValue.length?(l--,c=1):n<0?l--:u++,wn(gn(Xt(i,l,u),1),c<0)}var p=gn(Xt(i,o,o),n);if(Ht&&o&&/\s/.test(i.nodeValue[o-1])&&o<i.nodeValue.length){var d=gn(Xt(i,o-1,o-1),-1);if(d.top==p.top){var f=gn(Xt(i,o,o+1),-1);if(f.top!=p.top)return wn(f,f.left<d.left)}}return p}if(!e.state.doc.resolve(t-(a||0)).parent.inlineContent){if(null==a&&o&&(n<0||o==tn(i))){var h=i.childNodes[o-1];if(1==h.nodeType)return kn(h.getBoundingClientRect(),!1)}if(null==a&&o<tn(i)){var m=i.childNodes[o];if(1==m.nodeType)return kn(m.getBoundingClientRect(),!0)}return kn(i.getBoundingClientRect(),n>=0)}if(null==a&&o&&(n<0||o==tn(i))){var v=i.childNodes[o-1],g=3==v.nodeType?Xt(v,tn(v)-(s?0:1)):1!=v.nodeType||"BR"==v.nodeName&&v.nextSibling?null:v;if(g)return wn(gn(g,1),!1)}if(null==a&&o<tn(i)){for(var y=i.childNodes[o];y.pmViewDesc&&y.pmViewDesc.ignoreForCoords;)y=y.nextSibling;var b=y?3==y.nodeType?Xt(y,0,s?0:1):1==y.nodeType?y:null:null;if(b)return wn(gn(b,-1),!0)}return wn(gn(3==i.nodeType?Xt(i):i,-n),n>=0)}function wn(e,t){if(0==e.width)return e;var n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function kn(e,t){if(0==e.height)return e;var n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function xn(e,t,n){var r=e.state,i=e.root.activeElement;r!=t&&e.updateState(t),i!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),i!=e.dom&&i&&i.focus()}}var Cn=/[\u0590-\u08ac]/;var Tn=null,En=null,Mn=!1;function Nn(e,t,n){return Tn==t&&En==n?Mn:(Tn=t,En=n,Mn="up"==n||"down"==n?function(e,t,n){var r=t.selection,i="up"==n?r.$from:r.$to;return xn(e,t,(function(){for(var t=e.docView.domFromPos(i.pos,"up"==n?-1:1).node;;){var r=e.docView.nearestDesc(t,!0);if(!r)break;if(r.node.isBlock){t=r.dom;break}t=r.dom.parentNode}for(var o=bn(e,i.pos,1),a=t.firstChild;a;a=a.nextSibling){var s=void 0;if(1==a.nodeType)s=a.getClientRects();else{if(3!=a.nodeType)continue;s=Xt(a,0,a.nodeValue.length).getClientRects()}for(var l=0;l<s.length;l++){var u=s[l];if(u.bottom>u.top+1&&("up"==n?o.top-u.top>2*(u.bottom-o.top):u.bottom-o.bottom>2*(o.bottom-u.top)))return!1}}return!0}))}(e,t,n):function(e,t,n){var r=t.selection.$head;if(!r.parent.isTextblock)return!1;var i=r.parentOffset,o=!i,a=i==r.parent.content.size,s=e.domSelection();return Cn.test(r.parent.textContent)&&s.modify?xn(e,t,(function(){var t=s.getRangeAt(0),i=s.focusNode,o=s.focusOffset,a=s.caretBidiLevel;s.modify("move",n,"character");var l=!(r.depth?e.docView.domAfterPos(r.before()):e.dom).contains(1==s.focusNode.nodeType?s.focusNode:s.focusNode.parentNode)||i==s.focusNode&&o==s.focusOffset;return s.removeAllRanges(),s.addRange(t),null!=a&&(s.caretBidiLevel=a),l})):"left"==n||"backward"==n?o:a}(e,t,n))}var Sn=function(){function e(t,n,r,i){(0,d.Z)(this,e),this.parent=t,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=0,r.pmViewDesc=this}return(0,f.Z)(e,[{key:"matchesWidget",value:function(e){return!1}},{key:"matchesMark",value:function(e){return!1}},{key:"matchesNode",value:function(e,t,n){return!1}},{key:"matchesHack",value:function(e){return!1}},{key:"parseRule",value:function(){return null}},{key:"stopEvent",value:function(e){return!1}},{key:"size",get:function(){for(var e=0,t=0;t<this.children.length;t++)e+=this.children[t].size;return e}},{key:"border",get:function(){return 0}},{key:"destroy",value:function(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(var e=0;e<this.children.length;e++)this.children[e].destroy()}},{key:"posBeforeChild",value:function(e){for(var t=0,n=this.posAtStart;;t++){var r=this.children[t];if(r==e)return n;n+=r.size}}},{key:"posBefore",get:function(){return this.parent.posBeforeChild(this)}},{key:"posAtStart",get:function(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}},{key:"posAfter",get:function(){return this.posBefore+this.size}},{key:"posAtEnd",get:function(){return this.posAtStart+this.size-2*this.border}},{key:"localPosFromDOM",value:function(e,t,n){if(this.contentDOM&&this.contentDOM.contains(1==e.nodeType?e:e.parentNode)){if(n<0){var r,i;if(e==this.contentDOM)r=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;r=e.previousSibling}for(;r&&(!(i=r.pmViewDesc)||i.parent!=this);)r=r.previousSibling;return r?this.posBeforeChild(i)+i.size:this.posAtStart}var o,a;if(e==this.contentDOM)o=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;o=e.nextSibling}for(;o&&(!(a=o.pmViewDesc)||a.parent!=this);)o=o.nextSibling;return o?this.posBeforeChild(a):this.posAtEnd}var s;if(e==this.dom&&this.contentDOM)s=t>Gt(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))s=2&e.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==t)for(var l=e;;l=l.parentNode){if(l==this.dom){s=!1;break}if(l.previousSibling)break}if(null==s&&t==e.childNodes.length)for(var u=e;;u=u.parentNode){if(u==this.dom){s=!0;break}if(u.nextSibling)break}}return(null==s?n>0:s)?this.posAtEnd:this.posAtStart}},{key:"nearestDesc",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=!0,r=e;r;r=r.parentNode){var i=this.getDesc(r),o=void 0;if(i&&(!t||i.node)){if(!n||!(o=i.nodeDOM)||(1==o.nodeType?o.contains(1==e.nodeType?e:e.parentNode):o==e))return i;n=!1}}}},{key:"getDesc",value:function(e){for(var t=e.pmViewDesc,n=t;n;n=n.parent)if(n==this)return t}},{key:"posFromDOM",value:function(e,t,n){for(var r=e;r;r=r.parentNode){var i=this.getDesc(r);if(i)return i.localPosFromDOM(e,t,n)}return-1}},{key:"descAt",value:function(e){for(var t=0,n=0;t<this.children.length;t++){var r=this.children[t],i=n+r.size;if(n==e&&i!=n){for(;!r.border&&r.children.length;)r=r.children[0];return r}if(e<i)return r.descAt(e-n-r.border);n=i}}},{key:"domFromPos",value:function(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};for(var n,r=0,i=0,o=0;r<this.children.length;r++){var a=this.children[r],s=o+a.size;if(s>
2e||a instanceof Pn){i=e-o;break}o=s}if(i)return this.children[r].domFromPos(i-this.children[r].border,t);for(;r&&!(n=this.children[r-1]).size&&n instanceof Dn&&n.side>=0;r--);if(t<=0){for(var l,u=!0;(l=r?this.children[r-1]:null)&&l.dom.parentNode!=this.contentDOM;r--,u=!1);return l&&t&&u&&!l.border&&!l.domAtom?l.domFromPos(l.size,t):{node:this.contentDOM,offset:l?Gt(l.dom)+1:0}}for(var c,p=!0;(c=r<this.children.length?this.children[r]:null)&&c.dom.parentNode!=this.contentDOM;r++,p=!1);return c&&p&&!c.border&&!c.domAtom?c.domFromPos(0,t):{node:this.contentDOM,offset:c?Gt(c.dom):this.contentDOM.childNodes.length}}},{key:"parseRange",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(0==this.children.length)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};for(var r=-1,i=-1,o=n,a=0;;a++){var s=this.children[a],l=o+s.size;if(-1==r&&e<=l){var u=o+s.border;if(e>=u&&t<=l-s.border&&s.node&&s.contentDOM&&this.contentDOM.contains(s.contentDOM))return s.parseRange(e,t,u);e=o;for(var c=a;c>0;c--){var p=this.children[c-1];if(p.size&&p.dom.parentNode==this.contentDOM&&!p.emptyChildAt(1)){r=Gt(p.dom)+1;break}e-=p.size}-1==r&&(r=0)}if(r>-1&&(l>t||a==this.children.length-1)){t=l;for(var d=a+1;d<this.children.length;d++){var f=this.children[d];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(-1)){i=Gt(f.dom);break}t+=f.size}-1==i&&(i=this.contentDOM.childNodes.length);break}o=l}return{node:this.contentDOM,from:e,to:t,fromOffset:r,toOffset:i}}},{key:"emptyChildAt",value:function(e){if(this.border||!this.contentDOM||!this.children.length)return!1;var t=this.children[e<0?0:this.children.length-1];return 0==t.size||t.emptyChildAt(e)}},{key:"domAfterPos",value:function(e){var t=this.domFromPos(e,0),n=t.node,r=t.offset;if(1!=n.nodeType||r==n.childNodes.length)throw new RangeError("No node after pos "+e);return n.childNodes[r]}},{key:"setSelection",value:function(e,t,n){for(var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=Math.min(e,t),o=Math.max(e,t),a=0,s=0;a<this.children.length;a++){var l=this.children[a],u=s+l.size;if(i>s&&o<u)return l.setSelection(e-s-l.border,t-s-l.border,n,r);s=u}var c=this.domFromPos(e,e?-1:1),p=t==e?c:this.domFromPos(t,t?-1:1),d=n.getSelection(),f=!1;if((Ht||Vt)&&e==t){var h=c,m=h.node,v=h.offset;if(3==m.nodeType){if((f=!(!v||"\n"!=m.nodeValue[v-1]))&&v==m.nodeValue.length)for(var g,y=m;y;y=y.parentNode){if(g=y.nextSibling){"BR"==g.nodeName&&(c=p={node:g.parentNode,offset:Gt(g)+1});break}var b=y.pmViewDesc;if(b&&b.node&&b.node.isBlock)break}}else{var w=m.childNodes[v-1];f=w&&("BR"==w.nodeName||"false"==w.contentEditable)}}if(Ht&&d.focusNode&&d.focusNode!=p.node&&1==d.focusNode.nodeType){var k=d.focusNode.childNodes[d.focusOffset];k&&"false"==k.contentEditable&&(r=!0)}if(r||f&&Vt||!Qt(c.node,c.offset,d.anchorNode,d.anchorOffset)||!Qt(p.node,p.offset,d.focusNode,d.focusOffset)){var x=!1;if((d.extend||e==t)&&!f){d.collapse(c.node,c.offset);try{e!=t&&d.extend(p.node,p.offset),x=!0}catch(E){if(!(E instanceof DOMException))throw E}}if(!x){if(e>t){var C=c;c=p,p=C}var T=document.createRange();T.setEnd(p.node,p.offset),T.setStart(c.node,c.offset),d.removeAllRanges(),d.addRange(T)}}}},{key:"ignoreMutation",value:function(e){return!this.contentDOM&&"selection"!=e.type}},{key:"contentLost",get:function(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}},{key:"markDirty",value:function(e,t){for(var n=0,r=0;r<this.children.length;r++){var i=this.children[r],o=n+i.size;if(n==o?e<=o&&t>=n:e<o&&t>n){var a=n+i.border,s=o-i.border;if(e>=a&&t<=s)return this.dirty=e==n||t==o?2:1,void(e!=a||t!=s||!i.contentLost&&i.dom.parentNode==this.contentDOM?i.markDirty(e-a,t-a):i.dirty=3);i.dirty=i.dom!=i.contentDOM||i.dom.parentNode!=this.contentDOM||i.children.length?3:2}n=o}this.dirty=2}},{key:"markParentsDirty",value:function(){for(var e=1,t=this.parent;t;t=t.parent,e++){var n=1==e?2:1;t.dirty<n&&(t.dirty=n)}}},{key:"domAtom",get:function(){return!1}},{key:"ignoreForCoords",get:function(){return!1}}]),e}(),Dn=function(e){(0,u.Z)(n,e);var t=(0,c.Z)(n);function n(e,r,i,o){var a;(0,d.Z)(this,n);var s,l=r.type.toDOM;if("function"==typeof l&&(l=l(i,(function(){return s?s.parent?s.parent.posBeforeChild(s):void 0:o}))),!r.type.spec.raw){if(1!=l.nodeType){var u=document.createElement("span");u.appendChild(l),l=u}l.contentEditable="false",l.classList.add("ProseMirror-widget")}return(a=t.call(this,e,[],l,null)).widget=r,a.widget=r,s=(0,xe.Z)(a),a}return(0,f.Z)(n,[{key:"matchesWidget",value:function(e){return 0==this.dirty&&e.type.eq(this.widget.type)}},{key:"parseRule",value:function(){return{ignore:!0}}},{key:"stopEvent",value:function(e){var t=this.widget.spec.stopEvent;return!!t&&t(e)}},{key:"ignoreMutation",value:function(e){return"selection"!=e.type||this.widget.spec.ignoreSelection}},{key:"destroy",value:function(){this.widget.type.destroy(this.dom),(0,s.Z)((0,l.Z)(n.prototype),"destroy",this).call(this)}},{key:"domAtom",get:function(){return!0}},{key:"side",get:function(){return this.widget.type.side}}]),n}(Sn),Ln=function(e){(0,u.Z)(n,e);var t=(0,c.Z)(n);function n(e,r,i,o){var a;return(0,d.Z)(this,n),(a=t.call(this,e,[],r,null)).textDOM=i,a.text=o,a}return(0,f.Z)(n,[{key:"size",get:function(){return this.text.length}},{key:"localPosFromDOM",value:function(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t}},{key:"domFromPos",value:function(e){return{node:this.textDOM,offset:e}}},{key:"ignoreMutation",value:function(e){return"characterData"===e.type&&e.target.nodeValue==e.oldValue}}]),n}(Sn),An=function(e){(0,u.Z)(n,e);var t=(0,c.Z)(n);function n(e,r,i,o){var a;return(0,d.Z)(this,n),(a=t.call(this,e,[],i,o)).mark=r,a}return(0,f.Z)(n,[{key:"parseRule",value:function(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM||void 0}}},{key:"matchesMark",value:function(e){return 3!=this.dirty&&this.mark.eq(e)}},{key:"markDirty",value:function(e,t){if((0,s.Z)((0,l.Z)(n.prototype),"markDirty",this).call(this,e,t),0!=this.dirty){for(var r=this.parent;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=0}}},{key:"slice",value:function(e,t,r){var i=n.create(this.parent,this.mark,!0,r),o=this.children,a=this.size;t<a&&(o=Gn(o,t,a,r)),e>0&&(o=Gn(o,0,e,r));for(var s=0;s<o.length;s++)o[s].parent=i;return i.children=o,i}}],[{key:"create",value:function(e,t,r,i){var o=i.nodeViews[t.type.n
2ame],a=o&&o(t,i,r);return a&&a.dom||(a=be.renderSpec(document,t.type.spec.toDOM(t,r))),new n(e,t,a.dom,a.contentDOM||a.dom)}}]),n}(Sn),On=function(e){(0,u.Z)(n,e);var t=(0,c.Z)(n);function n(e,r,i,o,a,s,l,u,c){var p;return(0,d.Z)(this,n),(p=t.call(this,e,[],a,s)).node=r,p.outerDeco=i,p.innerDeco=o,p.nodeDOM=l,s&&p.updateChildren(u,c),p}return(0,f.Z)(n,[{key:"parseRule",value:function(){var e=this;if(this.node.type.spec.reparseInView)return null;var t={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(t.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){for(var n=this.children.length-1;n>=0;n--){var r=this.children[n];if(this.dom.contains(r.dom.parentNode)){t.contentElement=r.dom.parentNode;break}}t.contentElement||(t.getContent=function(){return y.empty})}else t.contentElement=this.contentDOM;else t.getContent=function(){return e.node.content};return t}},{key:"matchesNode",value:function(e,t,n){return 0==this.dirty&&e.eq(this.node)&&Un(t,this.outerDeco)&&n.eq(this.innerDeco)}},{key:"size",get:function(){return this.node.nodeSize}},{key:"border",get:function(){return this.node.isLeaf?0:1}},{key:"updateChildren",value:function(e,t){var n=this,r=this.node.inlineContent,i=t,o=e.composing?this.localCompositionInfo(e,t):null,a=o&&o.pos>-1?o:null,s=o&&o.pos<0,l=new Zn(this,a&&a.node,e);!function(e,t,n,r){var i=t.locals(e),o=0;if(0==i.length){for(var a=0;a<e.childCount;a++){var s=e.child(a);r(s,i,t.forChild(o,s),a),o+=s.nodeSize}return}for(var l=0,u=[],c=null,p=0;;){if(l<i.length&&i[l].to==o){for(var d=i[l++],f=void 0;l<i.length&&i[l].to==o;)(f||(f=[d])).push(i[l++]);if(f){f.sort(Wn);for(var h=0;h<f.length;h++)n(f[h],p,!!c)}else n(d,p,!!c)}var m=void 0,v=void 0;if(c)v=-1,m=c,c=null;else{if(!(p<e.childCount))break;v=p,m=e.child(p++)}for(var g=0;g<u.length;g++)u[g].to<=o&&u.splice(g--,1);for(;l<i.length&&i[l].from<=o&&i[l].to>o;)u.push(i[l++]);var y=o+m.nodeSize;if(m.isText){var b=y;l<i.length&&i[l].from<b&&(b=i[l].from);for(var w=0;w<u.length;w++)u[w].to<b&&(b=u[w].to);b<y&&(c=m.cut(b-o),m=m.cut(0,b-o),y=b,v=-1)}r(m,m.isInline&&!m.isLeaf?u.filter((function(e){return!e.inline})):u.slice(),t.forChild(o,m),v),o=y}}(this.node,this.innerDeco,(function(t,o,a){t.spec.marks?l.syncToMarks(t.spec.marks,r,e):t.type.side>=0&&!a&&l.syncToMarks(o==n.node.childCount?x.none:n.node.child(o).marks,r,e),l.placeWidget(t,e,i)}),(function(t,n,a,u){var c;l.syncToMarks(t.marks,r,e),l.findNodeMatch(t,n,a,u)||s&&e.state.selection.from>i&&e.state.selection.to<i+t.nodeSize&&(c=l.findIndexWithChild(o.node))>-1&&l.updateNodeAt(t,n,a,c,e)||l.updateNextNode(t,n,a,e,u)||l.addNode(t,n,a,e,i),i+=t.nodeSize})),l.syncToMarks([],r,e),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||2==this.dirty)&&(a&&this.protectLocalComposition(e,a),Fn(this.contentDOM,this.children,e),_t&&function(e){if("UL"==e.nodeName||"OL"==e.nodeName){var t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}(this.dom))}},{key:"localCompositionInfo",value:function(e,t){var n=e.state.selection,r=n.from,i=n.to;if(!(e.state.selection instanceof pt)||r<t||i>t+this.node.content.size)return null;var o=e.domSelection(),a=function(e,t){for(;;){if(3==e.nodeType)return e;if(1==e.nodeType&&t>0){if(e.childNodes.length>t&&3==e.childNodes[t].nodeType)return e.childNodes[t];t=tn(e=e.childNodes[t-1])}else{if(!(1==e.nodeType&&t<e.childNodes.length))return null;e=e.childNodes[t],t=0}}}(o.focusNode,o.focusOffset);if(!a||!this.dom.contains(a.parentNode))return null;if(this.node.inlineContent){var s=a.nodeValue,l=function(e,t,n,r){for(var i=0,o=0;i<e.childCount&&o<=r;){var a=e.child(i++),s=o;if(o+=a.nodeSize,a.isText){for(var l=a.text;i<e.childCount;){var u=e.child(i++);if(o+=u.nodeSize,!u.isText)break;l+=u.text}if(o>=n){var c=s<r?l.lastIndexOf(t,r-s-1):-1;if(c>=0&&c+t.length+s>=n)return s+c;if(n==r&&l.length>=r+t.length-s&&l.slice(r-s,r-s+t.length)==t)return r}}}return-1}(this.node.content,s,r-t,i-t);return l<0?null:{node:a,pos:l,text:s}}return{node:a,pos:-1,text:""}}},{key:"protectLocalComposition",value:function(e,t){var n=t.node,r=t.pos,i=t.text;if(!this.getDesc(n)){for(var o=n;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}var a=new Ln(this,o,n,i);e.input.compositionNodes.push(a),this.children=Gn(this.children,r,r+i.length,e,a)}}},{key:"update",value:function(e,t,n,r){return!(3==this.dirty||!e.sameMarkup(this.node))&&(this.updateInner(e,t,n,r),!0)}},{key:"updateInner",value:function(e,t,n,r){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=0}},{key:"updateOuterDeco",value:function(e){if(!Un(e,this.outerDeco)){var t=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=jn(this.dom,this.nodeDOM,zn(this.outerDeco,this.node,t),zn(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}}},{key:"selectNode",value:function(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.dom.draggable=!0)}},{key:"deselectNode",value:function(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||this.dom.removeAttribute("draggable")}},{key:"domAtom",get:function(){return this.node.isAtom}}],[{key:"create",value:function(e,t,r,i,o,a){var s,l=o.nodeViews[t.type.n
2ame],u=l&&l(t,o,(function(){return s?s.parent?s.parent.posBeforeChild(s):void 0:a}),r,i),c=u&&u.dom,p=u&&u.contentDOM;if(t.isText)if(c){if(3!=c.nodeType)throw new RangeError("Text must be rendered as a DOM text node")}else c=document.createTextNode(t.text);else if(!c){var d=be.renderSpec(document,t.type.spec.toDOM(t));c=d.dom,p=d.contentDOM}p||t.isText||"BR"==c.nodeName||(c.hasAttribute("contenteditable")||(c.contentEditable="false"),t.type.spec.draggable&&(c.draggable=!0));var f=c;return c=_n(c,r,t),u?s=new Bn(e,t,r,i,c,p||null,f,u,o,a+1):t.isText?new Rn(e,t,r,i,c,f,o):new n(e,t,r,i,c,p||null,f,o,a+1)}}]),n}(Sn);function In(e,t,n,r,i){return _n(r,t,e),new On(void 0,e,t,n,r,r,r,i,0)}var Rn=function(e){(0,u.Z)(n,e);var t=(0,c.Z)(n);function n(e,r,i,o,a,s,l){return(0,d.Z)(this,n),t.call(this,e,r,i,o,a,null,s,l,0)}return(0,f.Z)(n,[{key:"parseRule",value:function(){for(var e=this.nodeDOM.parentNode;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}},{key:"update",value:function(e,t,n,r){return!(3==this.dirty||0!=this.dirty&&!this.inParent()||!e.sameMarkup(this.node))&&(this.updateOuterDeco(t),0==this.dirty&&e.text==this.node.text||e.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=e.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=e,this.dirty=0,!0)}},{key:"inParent",value:function(){for(var e=this.parent.contentDOM,t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}},{key:"domFromPos",value:function(e){return{node:this.nodeDOM,offset:e}}},{key:"localPosFromDOM",value:function(e,t,r){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):(0,s.Z)((0,l.Z)(n.prototype),"localPosFromDOM",this).call(this,e,t,r)}},{key:"ignoreMutation",value:function(e){return"characterData"!=e.type&&"selection"!=e.type}},{key:"slice",value:function(e,t,r){var i=this.node.cut(e,t),o=document.createTextNode(i.text);return new n(this.parent,i,this.outerDeco,this.innerDeco,o,o,r)}},{key:"markDirty",value:function(e,t){(0,s.Z)((0,l.Z)(n.prototype),"markDirty",this).call(this,e,t),this.dom==this.nodeDOM||0!=e&&t!=this.nodeDOM.nodeValue.length||(this.dirty=3)}},{key:"domAtom",get:function(){return!1}}]),n}(On),Pn=function(e){(0,u.Z)(n,e);var t=(0,c.Z)(n);function n(){return(0,d.Z)(this,n),t.apply(this,arguments)}return(0,f.Z)(n,[{key:"parseRule",value:function(){return{ignore:!0}}},{key:"matchesHack",value:function(e){return 0==this.dirty&&this.dom.nodeName==e}},{key:"domAtom",get:function(){return!0}},{key:"ignoreForCoords",get:function(){return"IMG"==this.dom.nodeName}}]),n}(Sn),Bn=function(e){(0,u.Z)(n,e);var t=(0,c.Z)(n);function n(e,r,i,o,a,s,l,u,c,p){var f;return(0,d.Z)(this,n),(f=t.call(this,e,r,i,o,a,s,l,c,p)).spec=u,f}return(0,f.Z)(n,[{key:"update",value:function(e,t,r,i){if(3==this.dirty)return!1;if(this.spec.update){var o=this.spec.update(e,t,r);return o&&this.updateInner(e,t,r,i),o}return!(!this.contentDOM&&!e.isLeaf)&&(0,s.Z)((0,l.Z)(n.prototype),"update",this).call(this,e,t,r,i)}},{key:"selectNode",value:function(){this.spec.selectNode?this.spec.selectNode():(0,s.Z)((0,l.Z)(n.prototype),"selectNode",this).call(this)}},{key:"deselectNode",value:function(){this.spec.deselectNode?this.spec.deselectNode():(0,s.Z)((0,l.Z)(n.prototype),"deselectNode",this).call(this)}},{key:"setSelection",value:function(e,t,r,i){this.spec.setSelection?this.spec.setSelection(e,t,r):(0,s.Z)((0,l.Z)(n.prototype),"setSelection",this).call(this,e,t,r,i)}},{key:"destroy",value:function(){this.spec.destroy&&this.spec.destroy(),(0,s.Z)((0,l.Z)(n.prototype),"destroy",this).call(this)}},{key:"stopEvent",value:function(e){return!!this.spec.stopEvent&&this.spec.stopEvent(e)}},{key:"ignoreMutation",value:function(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):(0,s.Z)((0,l.Z)(n.prototype),"ignoreMutation",this).call(this,e)}}]),n}(On);function Fn(e,t,n){for(var r=e.firstChild,i=!1,o=0;o<t.length;o++){var a=t[o],s=a.dom;if(s.parentNode==e){for(;s!=r;)r=$n(r),i=!0;r=r.nextSibling}else i=!0,e.insertBefore(s,r);if(a instanceof An){var l=r?r.previousSibling:e.lastChild;Fn(a.contentDOM,a.children,n),r=l?l.nextSibling:e.firstChild}}for(;r;)r=$n(r),i=!0;i&&n.trackWrites==e&&(n.trackWrites=null)}var Hn=function(e){e&&(this.nodeName=e)};Hn.prototype=Object.create(null);var qn=[new Hn];function zn(e,t,n){if(0==e.length)return qn;for(var r=n?qn[0]:new Hn,i=[r],o=0;o<e.length;o++){var a=e[o].type.attrs;if(a)for(var s in a.nodeName&&i.push(r=new Hn(a.nodeName)),a){var l=a[s];null!=l&&(n&&1==i.length&&i.push(r=new Hn(t.isInline?"span":"div")),"class"==s?r.class=(r.class?r.class+" ":"")+l:"style"==s?r.style=(r.style?r.style+";":"")+l:"nodeName"!=s&&(r[s]=l))}}return i}function jn(e,t,n,r){if(n==qn&&r==qn)return t;for(var i=t,o=0;o<r.length;o++){var a=r[o],s=n[o];if(o){var l=void 0;s&&s.nodeName==a.nodeName&&i!=e&&(l=i.parentNode)&&l.nodeName.toLowerCase()==a.nodeName||((l=document.createElement(a.nodeName)).pmIsDeco=!0,l.appendChild(i),s=qn[0]),i=l}Vn(i,s||qn[0],a)}return i}function Vn(e,t,n){for(var r in t)"class"==r||"style"==r||"nodeName"==r||r in n||e.removeAttribute(r);for(var i in n)"class"!=i&&"style"!=i&&"nodeName"!=i&&n[i]!=t[i]&&e.setAttribute(i,n[i]);if(t.class!=n.class){for(var o=t.class?t.class.split(" ").filter(
2Boolean):[],a=n.class?n.class.split(" ").filter(Boolean):[],s=0;s<o.length;s++)-1==a.indexOf(o[s])&&e.classList.remove(o[s]);for(var l=0;l<a.length;l++)-1==o.indexOf(a[l])&&e.classList.add(a[l]);0==e.classList.length&&e.removeAttribute("class")}if(t.style!=n.style){if(t.style)for(var u,c=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g;u=c.exec(t.style);)e.style.removeProperty(u[1]);n.style&&(e.style.cssText+=n.style)}}function _n(e,t,n){return jn(e,e,qn,zn(t,n,1!=e.nodeType))}function Un(e,t){if(e.length!=t.length)return!1;for(var n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function $n(e){var t=e.nextSibling;return e.parentNode.removeChild(e),t}var Zn=function(){function e(t,n,r){(0,d.Z)(this,e),this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=t,this.preMatch=function(e,t){var n=t,r=n.children.length,i=e.childCount,o=new Map,a=[];e:for(;i>0;){for(var s=void 0;;)if(r){var l=n.children[r-1];if(!(l instanceof An)){s=l,r--;break}n=l,r=l.children.length}else{if(n==t)break e;r=n.parent.children.indexOf(n),n=n.parent}var u=s.node;if(u){if(u!=e.child(i-1))break;--i,o.set(s,i),a.push(s)}}return{index:i,matched:o,matches:a.reverse()}}(t.node.content,t)}return(0,f.Z)(e,[{key:"destroyBetween",value:function(e,t){if(e!=t){for(var n=e;n<t;n++)this.top.children[n].destroy();this.top.children.splice(e,t-e),this.changed=!0}}},{key:"destroyRest",value:function(){this.destroyBetween(this.index,this.top.children.length)}},{key:"syncToMarks",value:function(e,t,n){for(var r=0,i=this.stack.length>>1,o=Math.min(i,e.length);r<o&&(r==i-1?this.top:this.stack[r+1<<1]).matchesMark(e[r])&&!1!==e[r].type.spec.spanning;)r++;for(;r<i;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),i--;for(;i<e.length;){this.stack.push(this.top,this.index+1);for(var a=-1,s=this.index;s<Math.min(this.index+3,this.top.children.length);s++)if(this.top.children[s].matchesMark(e[i])){a=s;break}if(a>-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{var l=An.create(this.top,e[i],t,n);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0}this.index=0,i++}}},{key:"findNodeMatch",value:function(e,t,n,r){var i,o=-1;if(r>=this.preMatch.index&&(i=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&i.matchesNode(e,t,n))o=this.top.children.indexOf(i,this.index);else for(var a=this.index,s=Math.min(this.top.children.length,a+5);a<s;a++){var l=this.top.children[a];if(l.matchesNode(e,t,n)&&!this.preMatch.matched.has(l)){o=a;break}}return!(o<0)&&(this.destroyBetween(this.index,o),this.index++,!0)}},{key:"updateNodeAt",value:function(e,t,n,r,i){var o=this.top.children[r];return 3==o.dirty&&o.dom==o.contentDOM&&(o.dirty=2),!!o.update(e,t,n,i)&&(this.destroyBetween(this.index,r),this.index++,!0)}},{key:"findIndexWithChild",value:function(e){for(;;){var t=e.parentNode;if(!t)return-1;if(t==this.top.contentDOM){var n=e.pmViewDesc;if(n)for(var r=this.index;r<this.top.children.length;r++)if(this.top.children[r]==n)return r;return-1}e=t}}},{key:"updateNextNode",value:function(e,t,n,r,i){for(var o=this.index;o<this.top.children.length;o++){var a=this.top.children[o];if(a instanceof On){var s=this.preMatch.matched.get(a);if(null!=s&&s!=i)return!1;var l=a.dom;if(!(this.lock&&(l==this.lock||1==l.nodeType&&l.contains(this.lock.parentNode))&&!(e.isText&&a.node&&a.node.isText&&a.nodeDOM.nodeValue==e.text&&3!=a.dirty&&Un(t,a.outerDeco)))&&a.update(e,t,n,r))return this.destroyBetween(this.index,o),a.dom!=l&&(this.changed=!0),this.index++,!0;break}}return!1}},{key:"addNode",value:function(e,t,n,r,i){this.top.children.splice(this.index++,0,On.create(this.top,e,t,n,r,i)),this.changed=!0}},{key:"placeWidget",value:function(e,t,n){var r=this.index<this.top.children.length?this.top.children[this.index]:null;if(!r||!r.matchesWidget(e)||e!=r.widget&&r.widget.type.toDOM.parentNode){var i=new Dn(this.top,e,t,n);this.top.children.splice(this.index++,0,i),this.changed=!0}else this.index++}},{key:"addTextblockHacks",value:function(){for(var e=this.top.children[this.index-1],t=this.top;e instanceof An;)e=(t=e).children[t.children.length-1];(!e||!(e instanceof Rn)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((Vt||zt)&&e&&"false"==e.dom.contentEditable&&this.addHackNode("IMG",t),this.addHackNode("BR",this.top))}},{key:"addHackNode",value:function(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{var n=document.createElement(e);"IMG"==e&&(n.className="ProseMirror-separator",n.alt=""),"BR"==e&&(n.className="ProseMirror-trailingBreak");
2var r=new Pn(this.top,[],n,null);t!=this.top?t.children.push(r):t.children.splice(this.index++,0,r),this.changed=!0}}}]),e}();function Wn(e,t){return e.type.side-t.type.side}function Gn(e,t,n,r,i){for(var o=[],a=0,s=0;a<e.length;a++){var l=e[a],u=s,c=s+=l.size;u>=n||c<=t?o.push(l):(u<t&&o.push(l.slice(0,t-u,r)),i&&(o.push(i),i=void 0),c>n&&o.push(l.slice(n-u,l.size,r)))}return o}function Jn(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=e.domSelection(),r=e.state.doc;if(!n.focusNode)return null;var i=e.docView.nearestDesc(n.focusNode),o=i&&0==i.size,a=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(a<0)return null;var s,l,u=r.resolve(a);if(rn(n)){for(s=u;i&&!i.node;)i=i.parent;var c=i.node;if(i&&c.isAtom&&ft.isSelectable(c)&&i.parent&&(!c.isInline||!function(e,t,n){for(var r=0==t,i=t==tn(e);r||i;){if(e==n)return!0;var o=Gt(e);if(!(e=e.parentNode))return!1;r=r&&0==o,i=i&&o==tn(e)}}(n.focusNode,n.focusOffset,i.dom))){var p=i.posBefore;l=new ft(a==p?u:r.resolve(p))}}else{var d=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(d<0)return null;s=r.resolve(d)}l||(l=ir(e,s,u,"pointer"==t||e.state.selection.head<u.pos&&!o?1:-1));return l}function Kn(e){return e.editable?e.hasFocus():ar(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function Xn(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.state.selection;
2if(nr(e,n),Kn(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&zt){var r=e.domSelection(),i=e.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&Qt(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset))return e.input.mouseDown.delayedSelectionSync=!0,void e.domObserver.setCurSelection()}if(e.domObserver.disconnectSelection(),e.cursorWrapper)!function(e){var t=e.domSelection(),n=document.createRange(),r=e.cursorWrapper.dom,i="IMG"==r.nodeName;i?n.setEnd(r.parentNode,Gt(r)+1):n.setEnd(r,0);n.collapse(!1),t.removeAllRanges(),t.addRange(n),!i&&!e.state.selection.visible&&Bt&&Ft<=11&&(r.disabled=!0,r.disabled=!1)}(e);else{var o,a,s=n.anchor,l=n.head;!Qn||n instanceof pt||(n.$from.parent.inlineContent||(o=Yn(e,n.from)),n.empty||n.$from.parent.inlineContent||(a=Yn(e,n.to))),e.docView.setSelection(s,l,e.root,t),Qn&&(o&&tr(o),a&&tr(a)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&function(e){var t=e.dom.ownerDocument;t.removeEventListener("selectionchange",e.input.hideSelectionGuard);var n=e.domSelection(),r=n.anchorNode,i=n.anchorOffset;t.addEventListener("selectionchange",e.input.hideSelectionGuard=function(){n.anchorNode==r&&n.anchorOffset==i||(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout((function(){Kn(e)&&!e.state.selection.visible||e.dom.classList.remove("ProseMirror-hideselection")}),20))})}(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}var Qn=Vt||zt&&jt<63;function Yn(e,t){var n=e.docView.domFromPos(t,0),r=n.node,i=n.offset,o=i<r.childNodes.length?r.childNodes[i]:null,a=i?r.childNodes[i-1]:null;if(Vt&&o&&"false"==o.contentEditable)return er(o);if((!o||"false"==o.contentEditable)&&(!a||"false"==a.contentEditable)){if(o)return er(o);if(a)return er(a)}}function er(e){return e.contentEditable="true",Vt&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function tr(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function nr(e,t){if(t instanceof ft){var n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(rr(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else rr(e)}function rr(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function ir(e,t,n,r){return e.someProp("createSelectionBetween",(function(r){return r(e,t,n)}))||pt.between(t,n,r)}function or(e){return(!e.editable||e.root.activeElement==e.dom)&&ar(e)}function ar(e){var t=e.domSelection();if(!t.anchorNode)return!1;try{return e.dom.contains(3==t.anchorNode.nodeType?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(3==t.focusNode.nodeType?t.focusNode.parentNode:t.focusNode))}catch(n){return!1}}function sr(e,t){var n=e.selection,r=n.$anchor,i=n.$head,o=t>0?r.max(i):r.min(i),a=o.parent.inlineContent?o.depth?e.doc.resolve(t>0?o.after():o.before()):null:o;return a&&st.findFrom(a,t)}function lr(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function ur(e,t,n){var r=e.state.selection;if(!(r instanceof pt)){if(r instanceof ft&&r.node.isInline)return lr(e,new pt(t>0?r.$to:r.$from));var i=sr(e.state,t);return!!i&&lr(e,i)}if(!r.empty||n.indexOf("s")>-1)return!1;if(e.endOfTextblock(t>0?"right":"left")){var o=sr(e.state,t);return!!(o&&o instanceof ft)&&lr(e,o)}if(!(Ut&&n.indexOf("m")>-1)){var a,s=r.$head,l=s.textOffset?null:t<0?s.nodeBefore:s.nodeAfter;if(!l||l.isText)return!1;var u=t<0?s.pos-l.nodeSize:s.pos;return!!(l.isAtom||(a=e.docView.descAt(u))&&!a.contentDOM)&&(ft.isSelectable(l)?lr(e,new ft(t<0?e.state.doc.resolve(s.pos-l.nodeSize):s)):!!Zt&&lr(e,new pt(e.state.doc.resolve(t<0?u:u+l.nodeSize))))}}function cr(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function pr(e){var t=e.pmViewDesc;return t&&0==t.size&&(e.nextSibling||"BR"!=e.nodeName)}function dr(e){var t=e.domSelection(),n=t.focusNode,r=t.focusOffset;if(n){var i,o,a=!1;for(Ht&&1==n.nodeType&&r<cr(n)&&pr(n.childNodes[r])&&(a=!0);;)if(r>0){if(1!=n.nodeType)break;var s=n.childNodes[r-1];if(pr(s))i=n,o=--r;else{if(3!=s.nodeType)break;r=(n=s).nodeValue.length}}else{if(hr(n))break;for(var l=n.previousSibling;l&&pr(l);)i=n.parentNode,o=Gt(l),l=l.previousSibling;if(l)r=cr(n=l);else{if((n=n.parentNode)==e.dom)break;r=0}}a?mr(e,t,n,r):i&&mr(e,t,i,o)}}function fr(e){var t=e.domSelection(),n=t.focusNode,r=t.focusOffset;if(n){for(var i,o,a=cr(n);;)if(r<a){if(1!=n.nodeType)break;if(!pr(n.childNodes[r]))break;i=n,o=++r}else{if(hr(n))break;for(var s=n.nextSibling;s&&pr(s);)i=s.parentNode,o=Gt(s)+1,s=s.nextSibling;if(s)r=0,a=cr(n=s);else{if((n=n.parentNode)==e.dom)break;r=a=0}}i&&mr(e,t,i,o)}}function hr(e){var t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function mr(e,t,n,r){if(rn(t)){var i=document.createRange();i.setEnd(n,r),i.setStart(n,r),t.removeAllRanges(),t.addRange(i)}else t.extend&&t.extend(n,r);e.domObserver.setCurSelection();var o=e.state;setTimeout((function(){e.state==o&&Xn(e)}),50)}function vr(e,t,n){var r=e.state.selection;if(r instanceof pt&&!r.empty||n.indexOf("s")>-1)return!1;if(Ut&&n.indexOf("m")>-1)return!1;var i=r.$from,o=r.$to;if(!i.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){var a=sr(e.state,t);if(a&&a instanceof ft)return lr(e,a)}if(!i.parent.inlineContent){var s=t<0?i:o,l=r instanceof mt?st.near(s,t):st.findFrom(s,t);return!!l&&lr(e,l)}return!1}function gr(e,t){if(!(e.state.selection instanceof pt))return!0;var n=e.state.selection,r=n.$head,i=n.$anchor,o=n.empty;if(!r.sameParent(i))return!0;
2if(!o)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;var a=!r.textOffset&&(t<0?r.nodeBefore:r.nodeAfter);if(a&&!a.isText){var s=e.state.tr;return t<0?s.delete(r.pos-a.nodeSize,r.pos):s.delete(r.pos,r.pos+a.nodeSize),e.dispatch(s),!0}return!1}function yr(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function br(e,t){var n=t.keyCode,r=function(e){var t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}(t);return 8==n||Ut&&72==n&&"c"==r?gr(e,-1)||dr(e):46==n||Ut&&68==n&&"c"==r?gr(e,1)||fr(e):13==n||27==n||(37==n||Ut&&66==n&&"c"==r?ur(e,-1,r)||dr(e):39==n||Ut&&70==n&&"c"==r?ur(e,1,r)||fr(e):38==n||Ut&&80==n&&"c"==r?vr(e,-1,r)||dr(e):40==n||Ut&&78==n&&"c"==r?function(e){if(!Vt||e.state.selection.$head.parentOffset>0)return!1;var t=e.domSelection(),n=t.focusNode,r=t.focusOffset;if(n&&1==n.nodeType&&0==r&&n.firstChild&&"false"==n.firstChild.contentEditable){var i=n.firstChild;yr(e,i,"true"),setTimeout((function(){return yr(e,i,"false")}),20)}return!1}(e)||vr(e,1,r)||fr(e):r==(Ut?"m":"c")&&(66==n||73==n||89==n||90==n))}function wr(e,t){for(var n=[],r=t.content,i=t.openStart,o=t.openEnd;i>1&&o>1&&1==r.childCount&&1==r.firstChild.childCount;){i--,o--;var a=r.firstChild;n.push(a.type.name,a.attrs!=a.type.defaultAttrs?a.attrs:null),r=a.content}var s=e.someProp("clipboardSerializer")||be.fromSchema(e.state.schema),l=Lr(),u=l.createElement("div");u.appendChild(s.serializeFragment(r,{document:l}));for(var c,p=u.firstChild,d=0;p&&1==p.nodeType&&(c=Sr[p.nodeName.toLowerCase()]);){for(var f=c.length-1;f>=0;f--){for(var h=l.createElement(c[f]);u.firstChild;)h.appendChild(u.firstChild);u.appendChild(h),d++}p=u.firstChild}return p&&1==p.nodeType&&p.setAttribute("data-pm-slice","".concat(i," ").concat(o).concat(d?" -".concat(d):""," ").concat(JSON.stringify(n))),{dom:u,text:e.someProp("clipboardTextSerializer",(function(e){return e(t)}))||t.content.textBetween(0,t.content.size,"\n\n")}}function kr(e,t,n,r,i){var o,a,s=i.parent.type.spec.code;if(!n&&!t)return null;var l=t&&(r||s||!n);if(l){if(e.someProp("transformPastedText",(function(e){t=e(t,s||r)})),s)return t?new T(y.from(e.state.schema.text(t.replace(/\r\n?/g,"\n"))),0,0):T.empty;var u=e.someProp("clipboardTextParser",(function(e){return e(t,i,r)}));if(u)a=u;else{var c=i.marks(),p=e.state.schema,d=be.fromSchema(p);o=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach((function(e){var t=o.appendChild(document.createElement("p"));e&&t.appendChild(d.serializeNode(p.text(e,c)))}))}}else e.someProp("transformPastedHTML",(function(e){n=e(n)})),o=function(e){var t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));var n,r=Lr().createElement("div"),i=/<([a-z][^>\s]+)/i.exec(e);(n=i&&Sr[i[1].toLowerCase()])&&(e=n.map((function(e){return"<"+e+">"})).join("")+e+n.map((function(e){return"</"+e+">"})).reverse().join(""));if(r.innerHTML=e,n)for(var o=0;o<n.length;o++)r=r.querySelector(n[o])||r;return r}(n),Zt&&function(e){for(var t=e.querySelectorAll(zt?"span:not([class]):not([style])":"span.Apple-converted-space"),n=0;n<t.length;n++){var r=t[n];1==r.childNodes.length&&"\xa0"==r.textContent&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),r)}}(o);var f=o&&o.querySelector("[data-pm-slice]"),h=f&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(f.getAttribute("data-pm-slice")||"");
2if(h&&h[3])for(var m=+h[3];m>0&&o.firstChild;m--)o=o.firstChild;if(!a){var v=e.someProp("clipboardParser")||e.someProp("domParser")||ue.fromSchema(e.state.schema);a=v.parseSlice(o,{preserveWhitespace:!(!l&&!h),context:i,ruleFromNode:function(e){return"BR"!=e.nodeName||e.nextSibling||!e.parentNode||xr.test(e.parentNode.nodeName)?null:{ignore:!0}}})}if(h)a=function(e,t){if(!e.size)return e;var n,r=e.content.firstChild.type.schema;try{n=JSON.parse(t)}catch(u){return e}for(var i=e.content,o=e.openStart,a=e.openEnd,s=n.length-2;s>=0;s-=2){var l=r.nodes[n[s]];if(!l||l.hasRequiredAttrs())break;i=y.from(l.create(n[s+1],i)),o++,a++}return new T(i,o,a)}(Nr(a,+h[1],+h[2]),h[4]);else if(a=T.maxOpen(function(e,t){if(e.childCount<2)return e;for(var n=function(){var n,i=t.node(r).contentMatchAt(t.index(r)),o=[];if(e.forEach((function(e){if(o){var t,r=i.findWrapping(e.type);if(!r)return o=null;if(t=o.length&&n.length&&Tr(r,n,e,o[o.length-1],0))o[o.length-1]=t;else{o.length&&(o[o.length-1]=Er(o[o.length-1],n.length));var a=Cr(e,r);o.push(a),i=i.matchType(a.type),n=r}}})),o)return{v:y.from(o)}},r=t.depth;r>=0;r--){var i=n();if("object"===typeof i)return i.v}return e}(a.content,i),!0),a.openStart||a.openEnd){for(var g=0,b=0,w=a.content.firstChild;g<a.openStart&&!w.type.spec.isolating;g++,w=w.firstChild);for(var k=a.content.lastChild;b<a.openEnd&&!k.type.spec.isolating;b++,k=k.lastChild);a=Nr(a,g,b)}return e.someProp("transformPasted",(function(e){a=e(a)})),a}var xr=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function Cr(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=t.length-1;r>=n;r--)e=t[r].create(null,y.from(e));return e}function Tr(e,t,n,r,i){if(i<e.length&&i<t.length&&e[i]==t[i]){var o=Tr(e,t,n,r.lastChild,i+1);if(o)return r.copy(r.content.replaceChild(r.childCount-1,o));if(r.contentMatchAt(r.childCount).matchType(i==e.length-1?n.type:e[i+1]))return r.copy(r.content.append(y.from(Cr(n,e,i+1))))}}function Er(e,t){if(0==t)return e;var n=e.content.replaceChild(e.childCount-1,Er(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(y.empty,!0);return e.copy(n.append(r))}function Mr(e,t,n,r,i,o){var a=t<0?e.firstChild:e.lastChild,s=a.content;return i<r-1&&(s=Mr(s,t,n,r,i+1,o)),i>=n&&(s=t<0?a.contentMatchAt(0).fillBefore(s,e.childCount>1||o<=i).append(s):s.append(a.contentMatchAt(a.childCount).fillBefore(y.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,a.copy(s))}function Nr(e,t,n){return t<e.openStart&&(e=new T(Mr(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new T(Mr(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}var Sr={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]},Dr=null;function Lr(){return Dr||(Dr=document.implementation.createHTMLDocument("title"))}var Ar={},Or={},Ir={touchstart:!0,touchmove:!0},Rr=(0,f.Z)((function e(){(0,d.Z)(this,e),this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastAndroidDelete=0,this.composing=!1,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}));function Pr(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function Br(e){e.someProp("handleDOMEvents",(function(t){for(var n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=function(t){return Fr(e,t)})}))}function Fr(e,t){return e.someProp("handleDOMEvents",(function(n){var r=n[t.type];return!!r&&(r(e,t)||t.defaultPrevented)}))}function Hr(e){return{left:e.clientX,top:e.clientY}}function qr(e,t,n,r,i){if(-1==r)return!1;for(var o=e.state.doc.resolve(r),a=function(r){if(e.someProp(t,(function(t){return r>o.depth?t(e,n,o.nodeAfter,o.before(r),i,!0):t(e,n,o.node(r),o.before(r),i,!1)})))return{v:!0}},s=o.depth+1;s>0;s--){var l=a(s);if("object"===typeof l)return l.v}return!1}function zr(e,t,n){e.focused||e.focus();var r=e.state.tr.setSelection(t);"pointer"==n&&r.setMeta("pointer",!0),e.dispatch(r)}function jr(e,t,n,r,i){return qr(e,"handleClickOn",t,n,r)||e.someProp("handleClick",(function(n){return n(e,t,r)}))||(i?function(e,t){if(-1==t)return!1;var n,r,i=e.state.selection;i instanceof ft&&(n=i.node);for(var o=e.state.doc.resolve(t),a=o.depth+1;a>0;a--){var s=a>o.depth?o.nodeAfter:o.node(a);if(ft.isSelectable(s)){r=n&&i.$from.depth>0&&a>=i.$from.depth&&o.before(i.$from.depth+1)==i.$from.pos?o.before(i.$from.depth):o.before(a);break}}
2return null!=r&&(zr(e,ft.create(e.state.doc,r),"pointer"),!0)}(e,n):function(e,t){if(-1==t)return!1;var n=e.state.doc.resolve(t),r=n.nodeAfter;return!!(r&&r.isAtom&&ft.isSelectable(r))&&(zr(e,new ft(n),"pointer"),!0)}(e,n))}function Vr(e,t,n,r){return qr(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",(function(n){return n(e,t,r)}))}function _r(e,t,n,r){return qr(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",(function(n){return n(e,t,r)}))||function(e,t,n){if(0!=n.button)return!1;var r=e.state.doc;if(-1==t)return!!r.inlineContent&&(zr(e,pt.create(r,0,r.content.size),"pointer"),!0);for(var i=r.resolve(t),o=i.depth+1;o>0;o--){var a=o>i.depth?i.nodeAfter:i.node(o),s=i.before(o);if(a.inlineContent)zr(e,pt.create(r,s+1,s+1+a.content.size),"pointer");else{if(!ft.isSelectable(a))continue;zr(e,ft.create(r,s),"pointer")}return!0}}(e,n,r)}function Ur(e){return Xr(e)}Or.keydown=function(e,t){var n=t;if(e.input.shiftKey=16==n.keyCode||n.shiftKey,!Wr(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!$t||!zt||13!=n.keyCode))if(229!=n.keyCode&&e.domObserver.forceFlush(),!_t||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)e.someProp("handleKeyDown",(function(t){return t(e,n)}))||br(e,n)?n.preventDefault():Pr(e,"key");else{var r=Date.now();e.input.lastIOSEnter=r,e.input.lastIOSEnterFallbackTimeout=setTimeout((function(){e.input.lastIOSEnter==r&&(e.someProp("handleKeyDown",(function(t){return t(e,on(13,"Enter"))})),e.input.lastIOSEnter=0)}),200)}},Or.keyup=function(e,t){16==t.keyCode&&(e.input.shiftKey=!1)},Or.keypress=function(e,t){var n=t;if(!(Wr(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||Ut&&n.metaKey))if(e.someProp("handleKeyPress",(function(t){return t(e,n)})))n.preventDefault();else{var r=e.state.selection;if(!(r instanceof pt)||!r.$from.sameParent(r.$to)){var i=String.fromCharCode(n.charCode);e.someProp("handleTextInput",(function(t){return t(e,r.$from.pos,r.$to.pos,i)}))||e.dispatch(e.state.tr.insertText(i).scrollIntoView()),n.preventDefault()}}};var $r=Ut?"metaKey":"ctrlKey";Ar.mousedown=function(e,t){var n=t;e.input.shiftKey=n.shiftKey;var r=Ur(e),i=Date.now(),o="singleClick";i-e.input.lastClick.time<500&&function(e,t){var n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}(n,e.input.lastClick)&&!n[$r]&&("singleClick"==e.input.lastClick.type?o="doubleClick":"doubleClick"==e.input.lastClick.type&&(o="tripleClick")),e.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:o};var a=e.posAtCoords(Hr(n));a&&("singleClick"==o?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new Zr(e,a,n,!!r)):("doubleClick"==o?Vr:_r)(e,a.pos,a.inside,n)?n.preventDefault():Pr(e,"pointer"))};var Zr=function(){function e(t,n,r,i){var o,a,s=this;if((0,d.Z)(this,e),this.view=t,this.pos=n,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=t.state.doc,this.selectNode=!!r[$r],this.allowDefault=r.shiftKey,n.inside>-1)o=t.state.doc.nodeAt(n.inside),a=n.inside;else{var l=t.state.doc.resolve(n.pos);o=l.parent,a=l.depth?l.before():0}var u=i?null:r.target,c=u?t.docView.nearestDesc(u,!0):null;this.target=c?c.dom:null;var p=t.state.selection;(0==r.button&&o.type.spec.draggable&&!1!==o.type.spec.selectable||p instanceof ft&&p.from<=a&&p.to>a)&&(this.mightDrag={node:o,pos:a,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!Ht||this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout((function(){s.view.input.mouseDown==s&&s.target.setAttribute("contentEditable","false")}),20),this.view.domObserver.start()),t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),Pr(t,"pointer")}return(0,f.Z)(e,[{key:"done",value:function(){var e=this;this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout((function(){return Xn(e.view
2)})),this.view.input.mouseDown=null}},{key:"up",value:function(e){if(this.done(),this.view.dom.contains(e.target)){var t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(Hr(e))),this.updateAllowDefault(e),this.allowDefault||!t?Pr(this.view,"pointer"):jr(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():0==e.button&&(this.flushed||Vt&&this.mightDrag&&!this.mightDrag.node.isAtom||zt&&!(this.view.state.selection instanceof pt)&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(zr(this.view,st.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):Pr(this.view,"pointer")}}},{key:"move",value:function(e){this.updateAllowDefault(e),Pr(this.view,"pointer"),0==e.buttons&&this.done()}},{key:"updateAllowDefault",value:function(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}]),e}();function Wr(e,t){return!!e.composing||!!(Vt&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500)&&(e.input.compositionEndedAt=-2e8,!0)}Ar.touchstart=function(e){e.input.lastTouch=Date.now(),Ur(e),Pr(e,"pointer")},Ar.touchmove=function(e){e.input.lastTouch=Date.now(),Pr(e,"pointer")},Ar.contextmenu=function(e){return Ur(e)};var Gr=$t?5e3:-1;function Jr(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout((function(){return Xr(e)}),t))}function Kr(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=function(){var e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function Xr(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!($t&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),Kr(e),t||e.docView&&e.docView.dirty){var n=Jn(e);return n&&!n.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(n)):e.updateState(e.state),!0}return!1}}Or.compositionstart=Or.compositionupdate=function(e){if(!e.composing){e.domObserver.flush();var t=e.state,n=t.selection.$from;if(t.selection.empty&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some((function(e){return!1===e.type.spec.inclusive}))))e.markCursor=e.state.storedMarks||n.marks(),Xr(e,!0),e.markCursor=null;else if(Xr(e),Ht&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length)for(var r=e.domSelection(),i=r.focusNode,o=r.focusOffset;i&&1==i.nodeType&&0!=o;){var a=o<0?i.lastChild:i.childNodes[o-1];if(!a)break;if(3==a.nodeType){r.collapse(a,a.nodeValue.length);break}i=a,o=-1}e.input.composing=!0}Jr(e,Gr)},Or.compositionend=function(e,t){e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,Jr(e,20))};var Qr=Bt&&Ft<15||_t&&Wt<604;function Yr(e,t,n,r){var i=kr(e,t,n,e.input.shiftKey,e.state.selection.$from);if(e.someProp("handlePaste",(function(t){return t(e,r,i||T.empty)})))return!0;if(!i)return!1;var o=function(e){return 0==e.openStart&&0==e.openEnd&&1==e.content.childCount?e.content.firstChild:null}(i),a=o?e.state.tr.replaceSelectionWith(o,e.input.shiftKey):e.state.tr.replaceSelection(i);return e.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}Ar.copy=Or.cut=function(e,t){var n=t,r=e.state.selection,i="cut"==n.type;if(!r.empty){var o=Qr?null:n.clipboardData,a=wr(e,r.content()),s=a.dom,l=a.text;o?(n.preventDefault(),o.clearData(),o.setData("text/html",s.innerHTML),o.setData("text/plain",l)):function(e,t){if(e.dom.parentNode){var n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";var r=getSelection(),i=document.createRange();i.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout((function(){n.parentNode&&n.parentNode.removeChild(n),e.focus()}),50)}}(e,s),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))}},Or.paste=function(e,t){var n=t;if(!e.composing||$t){var r=Qr?null:n.clipboardData;r&&Yr(e,r.getData("text/plain"),r.getData("text/html"),n)?n.preventDefault():function(e,t){if(e.dom.parentNode){var n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus(),setTimeout((function(){e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Yr(e,r.value,null,t):Yr(e,r.textContent,r.innerHTML,t)}),50)}}(e,n)}};var ei=(0,f.Z)((function e(t,n){(0,d.Z)(this,e),this.slice=t,this.move=n})),ti=Ut?"altKey":"ctrlKey";for(var ni in Ar.dragstart=function(e,t){var n=t,r=e.input.mouseDown;if(r&&r.done(),n.dataTransfer){var i=e.state.selection,o=i.empty?null:e.posAtCoords(Hr(n));if(o&&o.pos>=i.from&&o.pos<=(i instanceof ft?i.to-1:i.to));else if(r&&r.mightDrag)e.dispatch(e.state.tr.setSelection(ft.create(e.state.doc,r.mightDrag.pos)));else if(n.target&&1==n.target.nodeType){var a=e.docView.nearestDesc(n.target,!0);a&&a.node.type.spec.draggable&&a!=e.docView&&e.dispatch(e.state.tr.setSelection(ft.create(e.state.doc,a.posBefore)))}var s=e.state.selection.content(),l=wr(e,s),u=l.dom,c=l.text;n.dataTransfer.clearData(),n.dataTransfer.setData(Qr?"Text":"text/html",u.innerHTML),n.dataTransfer.effectAllowed="copyMove",Qr||n.dataTransfer.setData("text/plain",c),e.dragging=new ei(s,!n[ti])}},Ar.dragend=function(e){var t=e.dragging;window.setTimeout((function(){e.dragging==t&&(e.dragging=null)}),50)},Or.dragover=Or.dragenter=function(e,t){return t.preventDefault()},Or.drop=function(e,t){var n=t,r=e.dragging;if(e.dragging=null,n.dataTransfer){var i=e.posAtCoords(Hr(n));if(i){var o=e.state.doc.resolve(i.pos),a=r&&r.slice;a?e.someProp("transformPasted",(function(e){a=e(a)})):a=kr(e,n.dataTransfer.getData(Qr?"Text":"text/plain"),Qr?null:n.dataTransfer.getData("text/html"),!1,o);var s=!(!r||n[ti]);if(e.someProp("handleDrop",(function(t){return t(e,n,a||T.empty,s)})))n.preventDefault();else if(a){n.preventDefault();var l=a?function(e,t,n){var r=e.resolve(t);if(!n.content.size)return t;for(var i=n.content,o=0;o<n.openStart;o++)i=i.firstChild.content;for(var a=1;a<=(0==n.openStart&&n.size?2:1);a++)for(var s=r.depth;s>=0;s--){var l=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,u=r.index(s)+(l>0?1:0),c=r.node(s),p=!1;
2if(1==a)p=c.canReplace(u,u,i);else{var d=c.contentMatchAt(u).findWrapping(i.firstChild.type);p=d&&c.canReplaceWith(u,u,d[0])}if(p)return 0==l?r.pos:l<0?r.before(s+1):r.after(s+1)}return null}(e.state.doc,o.pos,a):o.pos;null==l&&(l=o.pos);var u=e.state.tr;s&&u.deleteSelection();var c=u.mapping.map(l),p=0==a.openStart&&0==a.openEnd&&1==a.content.childCount,d=u.doc;if(p?u.replaceRangeWith(c,c,a.content.firstChild):u.replaceRange(c,c,a),!u.doc.eq(d)){var f=u.doc.resolve(c);if(p&&ft.isSelectable(a.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(a.content.firstChild))u.setSelection(new ft(f));else{var h=u.mapping.map(l);u.mapping.maps[u.mapping.maps.length-1].forEach((function(e,t,n,r){return h=r})),u.setSelection(ir(e,f,u.doc.resolve(h)))}e.focus(),e.dispatch(u.setMeta("uiEvent","drop"))}}}}},Ar.focus=function(e){e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout((function(){e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelection())&&Xn(e)}),20))},Ar.blur=function(e,t){var n=t;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)},Ar.beforeinput=function(e,t){if(zt&&$t&&"deleteContentBackward"==t.inputType){e.domObserver.flushSoon();var n=e.input.domChangeCount;setTimeout((function(){if(e.input.domChangeCount==n&&(e.dom.blur(),e.focus(),!e.someProp("handleKeyDown",(function(t){return t(e,on(8,"Backspace"))})))){var t=e.state.selection.$cursor;t&&t.pos>0&&e.dispatch(e.state.tr.delete(t.pos-1,t.pos).scrollIntoView())}}),50)}},Or)Ar[ni]=Or[ni];function ri(e,t){if(e==t)return!0;for(var n in e)if(e[n]!==t[n])return!1;for(var r in t)if(!(r in e))return!1;return!0}var ii=function(){function e(t,n){(0,d.Z)(this,e),this.toDOM=t,this.spec=n||ui,this.side=this.spec.side||0}return(0,f.Z)(e,[{key:"map",value:function(e,t,n,r){var i=e.mapResult(t.from+r,this.side<0?-1:1),o=i.pos;return i.deleted?null:new si(o-n,o-n,this)}},{key:"valid",value:function(){return!0}},{key:"eq",value:function(t){return this==t||t instanceof e&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&ri(this.spec,t.spec))}},{key:"destroy",value:function(e){this.spec.destroy&&this.spec.destroy(e)}}]),e}(),oi=function(){function e(t,n){(0,d.Z)(this,e),this.attrs=t,this.spec=n||ui}return(0,f.Z)(e,[{key:"map",value:function(e,t,n,r){var i=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,o=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return i>=o?null:new si(i,o,this)}},{key:"valid",value:function(e,t){return t.from<t.to}},{key:"eq",value:function(t){return this==t||t instanceof e&&ri(this.attrs,t.attrs)&&ri(this.spec,t.spec)}},{key:"destroy",value:function(){}}],[{key:"is",value:function(t){return t.type instanceof e}}]),e}(),ai=function(){function e(t,n){(0,d.Z)(this,e),this.attrs=t,this.spec=n||ui}return(0,f.Z)(e,[{key:"map",value:function(e,t,n,r){var i=e.mapResult(t.from+r,1);if(i.deleted)return null;var o=e.mapResult(t.to+r,-1);return o.deleted||o.pos<=i.pos?null:new si(i.pos-n,o.pos-n,this)}},{key:"valid",value:function(e,t){var n,r=e.content.findIndex(t.from),i=r.index,o=r.offset;return o==t.from&&!(n=e.child(i)).isText&&o+n.nodeSize==t.to}},{key:"eq",value:function(t){return this==t||t instanceof e&&ri(this.attrs,t.attrs)&&ri(this.spec,t.spec)}},{key:"destroy",value:function(){}}]),e}(),si=function(){function e(t,n,r){(0,d.Z)(this,e),this.from=t,this.to=n,this.type=r}return(0,f.Z)(e,[{key:"copy",value:function(t,n){return new e(t,n,this.type)}},{key:"eq",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}},{key:"map",value:function(e,t,n){return this.type.map(e,this,t,n)}},{key:"spec",get:function(){return this.type.spec}},{key:"inline",get:function(){return this.type instanceof oi}}],[{key:"widget",value:function(t,n,r){return new e(t,t,new ii(n,r))}},{key:"inline",value:function(t,n,r,i){return new e(t,n,new oi(r,i))}},{key:"node",value:function(t,n,r,i){return new e(t,n,new ai(r,i))}}]),e}(),li=[],ui={},ci=function(){function e(t,n){(0,d.Z)(this,e),this.local=t.length?t:li,this.children=n.length?n:li}return(0,f.Z)(e,[{key:"find",value:function(e,t,n){var r=[];return this.findInner(null==e?0:e,null==t?1e9:t,r,0,n),r}},{key:"findInner",value:function(e,t,n,r,i){for(var o=0;o<this.local.length;o++){var a=this.local[o];a.from<=t&&a.to>=e&&(!i||i(a.spec))&&n.push(a.copy(a.from+r,a.to+r))}for(var s=0;s<this.children.length;s+=3)if(this.children[s]<t&&this.children[s+1]>e){var l=this.children[s]+1;this.children[s+2].findInner(e-l,t-l,n,r+l,i)}}}
2,{key:"map",value:function(e,t,n){return this==pi||0==e.maps.length?this:this.mapInner(e,t,0,0,n||ui)}},{key:"mapInner",value:function(t,n,r,i,o){for(var a,s=0;s<this.local.length;s++){var l=this.local[s].map(t,r,i);l&&l.type.valid(n,l)?(a||(a=[])).push(l):o.onRemove&&o.onRemove(this.local[s].spec)}return this.children.length?fi(this.children,a||[],t,n,r,i,o):a?new e(a.sort(yi),li):pi}},{key:"add",value:function(t,n){return n.length?this==pi?e.create(t,n):this.addInner(t,n,0):this}},{key:"addInner",value:function(t,n,r){var i,o=this,a=0;t.forEach((function(e,t){var s,l=t+r;if(s=mi(n,e,l)){for(i||(i=o.children.slice());a<i.length&&i[a]<t;)a+=3;i[a]==t?i[a+2]=i[a+2].addInner(e,s,l+1):i.splice(a,0,t,t+e.nodeSize,gi(s,e,l+1,ui)),a+=3}}));for(var s=hi(a?vi(n):n,-r),l=0;l<s.length;l++)s[l].type.valid(t,s[l])||s.splice(l--,1);return new e(s.length?this.local.concat(s).sort(yi):this.local,i||this.children)}},{key:"remove",value:function(e){return 0==e.length||this==pi?this:this.removeInner(e,0)}},{key:"removeInner",value:function(t,n){for(var r=this.children,i=this.local,o=0;o<r.length;o+=3){for(var a,s=void 0,l=r[o]+n,u=r[o+1]+n,c=0;c<t.length;c++)(a=t[c])&&a.from>l&&a.to<u&&(t[c]=null,(s||(s=[])).push(a));if(s){r==this.children&&(r=this.children.slice());var p=r[o+2].removeInner(s,l+1);p!=pi?r[o+2]=p:(r.splice(o,3),o-=3)}}if(i.length)for(var d,f=0;f<t.length;f++)if(d=t[f])for(var h=0;h<i.length;h++)i[h].eq(d,n)&&(i==this.local&&(i=this.local.slice()),i.splice(h--,1));return r==this.children&&i==this.local?this:i.length||r.length?new e(i,r):pi}},{key:"forChild",value:function(t,n){if(this==pi)return this;if(n.isLeaf)return e.empty;for(var r,i,o=0;o<this.children.length;o+=3)if(this.children[o]>=t){this.children[o]==t&&(r=this.children[o+2]);break}for(var a=t+1,s=a+n.content.size,l=0;l<this.local.length;l++){var u=this.local[l];if(u.from<s&&u.to>a&&u.type instanceof oi){var c=Math.max(a,u.from)-a,p=Math.min(s,u.to)-a;c<p&&(i||(i=[])).push(u.copy(c,p))}}if(i){var d=new e(i.sort(yi),li);return r?new di([d,r]):d}return r||pi}},{key:"eq",value:function(t){if(this==t)return!0;if(!(t instanceof e)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(var n=0;n<this.local.length;n++)if(!this.local[n].eq(t.local[n]))return!1;for(var r=0;r<this.children.length;r+=3)if(this.children[r]!=t.children[r]||this.children[r+1]!=t.children[r+1]||!this.children[r+2].eq(t.children[r+2]))return!1;return!0}},{key:"locals",value:function(e){return bi(this.localsInner(e))}},{key:"localsInner",value:function(e){if(this==pi)return li;if(e.inlineContent||!this.local.some(oi.is))return this.local;for(var t=[],n=0;n<this.local.length;n++)this.local[n].type instanceof oi||t.push(this.local[n]);return t}}],[{key:"create",value:function(e,t){return t.length?gi(t,e,0,ui):pi}}]),e}();ci.empty=new ci([],[]),ci.removeOverlap=bi;var pi=ci.empty,di=function(){function e(t){(0,d.Z)(this,e),this.members=t}return(0,f.Z)(e,[{key:"map",value:function(t,n){var r=this.members.map((function(e){return e.map(t,n,ui)}));return e.from(r)}},{key:"forChild",value:function(t,n){if(n.isLeaf)return ci.empty;for(var r=[],i=0;i<this.members.length;i++){var o=this.members[i].forChild(t,n);o!=pi&&(o instanceof e?r=r.concat(o.members):r.push(o))}return e.from(r)}},{key:"eq",value:function(t){if(!(t instanceof e)||t.members.length!=this.members.length)return!1;for(var n=0;n<this.members.length;n++)if(!this.members[n].eq(t.members[n]))return!1;return!0}},{key:"locals",value:function(e){for(var t,n=!0,r=0;r<this.members.length;r++){var i=this.members[r].localsInner(e);if(i.length)if(t){n&&(t=t.slice(),n=!1);for(var o=0;o<i.length;o++)t.push(i[o])}else t=i}return t?bi(n?t:t.sort(yi)):li}}],[{key:"from",value:function(t){switch(t.length){case 0:return pi;case 1:return t[0];default:return new e(t)}}}]),e}();function fi(e,t,n,r,i,o,a){for(var s=e.slice(),l=function(e){var t=0;n.maps[u].forEach((function(n,r,o,a){for(var l=a-o-(r-n),u=0;u<s.length;u+=3){var c=s[u+1];if(!(c<0||n>c+e-t)){var p=s[u]+e-t;r>=p?s[u+1]=n<=p?-2:-1:o>=i&&l&&(s[u]+=l,s[u+1]+=l)}}t+=l})),e=n.maps[u].map(e,-1),c=e},u=0,c=o;u<n.maps.length;u++)l(c);for(var p=!1,d=0;d<s.length;d+=3)if(s[d+1]<0){if(-2==s[d+1]){p=!0,s[d+1]=-1;continue}var f=n.map(e[d]+o),h=f-i;if(h<0||h>=r.content.size){p=!0;continue}var m=n.map(e[d+1]+o,-1)-i,v=r.content.findIndex(h),g=v.index,y=v.offset,b=r.maybeChild(g);if(b&&y==h&&y+b.nodeSize==m){var w=s[d+2].mapInner(n,b,f+1,e[d]+o+1,a);w!=pi?(s[d]=h,s[d+1]=m,s[d+2]=w):(s[d+1]=-2,p=!0)}else p=!0}if(p){var k=function(e,t,n,r,i,o,a){function s(e,t){for(var o=0;o<e.local.length;o++){var l=e.local[o].map(r,i,t);l?n.push(l):a.onRemove&&a.onRemove(e.local[o].spec)}for(var u=0;u<e.children.length;u+=3)s(e.children[u+2],e.children[u]+t+1)}for(var l=0;l<e.length;l+=3)-1==e[l+1]&&s(e[l+2],t[l]+o+1);return n}(s,e,t,n,i,o,a),x=gi(k,r,0,a);t=x.local;for(var C=0;C<s.length;C+=3)s[C+1]<0&&(s.splice(C,3),C-=3);for(var T=0,E=0;T<x.children.length;T+=3){for(var M=x.children[T];E<s.length&&s[E]<M;)E+=3;s.splice(E,0,x.children[T],x.children[T+1],x.children[T+2])}}return new ci(t.sort(yi),s)}function hi(e,t){if(!t||!e.length)return e;for(var n=[],r=0;r<e.length;r++){var i=e[r];n.push(new si(i.from+t,i.to+t,i.type))}return n}
2function mi(e,t,n){if(t.isLeaf)return null;for(var r,i=n+t.nodeSize,o=null,a=0;a<e.length;a++)(r=e[a])&&r.from>n&&r.to<i&&((o||(o=[])).push(r),e[a]=null);return o}function vi(e){for(var t=[],n=0;n<e.length;n++)null!=e[n]&&t.push(e[n]);return t}function gi(e,t,n,r){var i=[],o=!1;t.forEach((function(t,a){var s=mi(e,t,a+n);if(s){o=!0;var l=gi(s,t,n+a+1,r);l!=pi&&i.push(a,a+t.nodeSize,l)}}));for(var a=hi(o?vi(e):e,-n).sort(yi),s=0;s<a.length;s++)a[s].type.valid(t,a[s])||(r.onRemove&&r.onRemove(a[s].spec),a.splice(s--,1));return a.length||i.length?new ci(a,i):pi}function yi(e,t){return e.from-t.from||e.to-t.to}function bi(e){for(var t=e,n=0;n<t.length-1;n++){var r=t[n];if(r.from!=r.to)for(var i=n+1;i<t.length;i++){var o=t[i];if(o.from!=r.from){o.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,o.from),wi(t,i,r.copy(o.from,r.to)));break}o.to!=r.to&&(t==e&&(t=e.slice()),t[i]=o.copy(o.from,r.to),wi(t,i+1,o.copy(r.to,o.to)))}}return t}function wi(e,t,n){for(;t<e.length&&yi(n,e[t])>0;)t++;e.splice(t,0,n)}function ki(e){var t=[];return e.someProp("decorations",(function(n){var r=n(e.state);r&&r!=pi&&t.push(r)})),e.cursorWrapper&&t.push(ci.create(e.state.doc,[e.cursorWrapper.deco])),di.from(t)}var xi={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Ci=Bt&&Ft<=11,Ti=function(){function e(){(0,d.Z)(this,e),this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}return(0,f.Z)(e,[{key:"set",value:function(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}},{key:"clear",value:function(){this.anchorNode=this.focusNode=null}},{key:"eq",value:function(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}]),e}(),Ei=function(){function e(t,n){var r=this;(0,d.Z)(this,e),this.view=t,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new Ti,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver((function(e){for(var t=0;t<e.length;t++)r.queue.push(e[t]);Bt&&Ft<=11&&e.some((function(e){return"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length}))?r.flushSoon():r.flush()})),Ci&&(this.onCharData=function(e){r.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),r.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}return(0,f.Z)(e,[{key:"flushSoon",value:function(){var e=this;this.flushingSoon<0&&(this.flushingSoon=window.setTimeout((function(){e.flushingSoon=-1,e.flush()}),20))}},{key:"forceFlush",value:function(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}},{key:"start",value:function(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,xi)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}},{key:"stop",value:function(){var e=this;if(this.observer){var t=this.observer.takeRecords();if(t.length){for(var n=0;n<t.length;n++)this.queue.push(t[n]);window.setTimeout((function(){return e.flush()}),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}},{key:"connectSelection",value:function(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}},{key:"disconnectSelection",value:function(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}},{key:"suppressSelectionUpdates",value:function(){var e=this;this.suppressingSelectionUpdates=!0,setTimeout((function(){return e.suppressingSelectionUpdates=!1}),50)}},{key:"onSelectionChange",value:function(){if(or(this.view)){if(this.suppressingSelectionUpdates)return Xn(this.view);if(Bt&&Ft<=11&&!this.view.state.selection.empty){var e=this.view.domSelection();if(e.focusNode&&Qt(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}},{key:"setCurSelection",value:function(){this.currentSelection.set(this.view.domSelection())}},{key:"ignoreSelectionChange",value:function(e){if(0==e.rangeCount)return!0;var t=e.getRangeAt(0).commonAncestorContainer,n=this.view.docView.nearestDesc(t);return n&&n.ignoreMutation({type:"selection",target:3==t.nodeType?t.parentNode:t})?(this.setCurSelection(),!0):void 0}},{key:"flush",value:function(){var e=this.view;if(e.docView&&!(this.flushingSoon>-1)){var t=this.observer?this.observer.takeRecords():[];this.queue.length&&(t=this.queue.concat(t),this.queue.length=0);var n=e.domSelection(),r=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&or(e)&&!this.ignoreSelectionChange(n),i=-1,o=-1,a=!1,s=[];if(e.editable)for(var l=0;l<t.length;l++){var u=this.registerMutation(t[l],s);u&&(i=i<0?u.from:Math.min(u.from,i),o=o<0?u.to:Math.max(u.to,o),u.typeOver&&(a=!0))}if(Ht&&s.length>1){var c=s.filter((function(e){return"BR"==e.nodeName}));if(2==c.length){var p=c[0],d=c[1];p.parentNode&&p.parentNode.parentNode==d.parentNode?d.remove():p.remove()}}var f=null;i<0&&r&&e.input.lastFocus>Date.now()-200&&e.input.lastTouch<Date.now()-300&&rn(n)&&(f=Jn(e))&&f.eq(st.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Xn(e),this.currentSelection.set(n),e.scrollToSelection()):(i>-1||r)&&(i>-1&&(e.docView.markDirty(i,o),function(e){if(Mi.has(e))return;if(Mi.set(e,null),-1!==["normal","nowrap","pre-line"].indexOf(getComputedStyle(e.dom).whiteSpace)){if(e.requiresGeckoHackNode=Ht,Ni)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),Ni=!0}}(e)),this.handleDOMChange(i,o,a,s),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||Xn(e),this.currentSelection.set(n))}}},{key:"registerMutation",value:function(e,t){if(t.indexOf(e.target)>-1)return null;var n=this.view.docView.nearestDesc(e.target);if("attributes"==e.type&&(n==this.view.docView||"contenteditable"==e.attributeName||"style"==e.attributeName&&!e.oldValue&&!e.target.getAttribute("style")))return null;if(!n||n.ignoreMutation(e))return null;if("childList"==e.type){for(var r=0;r<e.addedNodes.length;r++)t.push(e.addedNodes[r]);if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};var i=e.previousSibling,o=e.nextSibling;if(Bt&&Ft<=11&&e.addedNodes.length)for(var a=0;a<e.addedNodes.length;a++){var s=e.addedNodes[a],l=s.previousSibling,u=s.nextSibling;(!l||Array.prototype.indexOf.call(e.addedNodes,l)<0)&&(i=l),(!u||Array.prototype.indexOf.call(e.addedNodes,u)<0)&&(o=u)}var c=i&&i.parentNode==e.target?Gt(i)+1:0,p=n.localPosFromDOM(e.target,c,-1),d=o&&o.parentNode==e.target?Gt(o):e.target.childNodes.length;return{from:p,to:n.localPosFromDOM(e.target,d,1)}}return"attributes"==e.type?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}}}]),e}(),Mi=new WeakMap,Ni=!1;function Si(e){var t=e.pmViewDesc;if(t)return t.parseRule();if("BR"==e.nodeName&&e.parentNode){if(Vt&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){var n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}if(e.parentNode.lastChild==e||Vt&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if("IMG"==e.nodeName&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}function Di(e,t,n,r,i){if(t<0){var o=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,a=Jn(e,o);if(a&&!e.state.selection.eq(a)){var s=e.state.tr.setSelection(a);"pointer"==o?s.setMeta("pointer",!0):"key"==o&&s.scrollIntoView(),e.dispatch(s)}}else{var l=e.state.doc.resolve(t),u=l.sharedDepth(n);t=l.before(u+1),n=e.state.doc.resolve(n).after(u+1);var c,p,d=e.state.selection,f=function(e,t,n){var r,i=e.docView.parseRange(t,n),o=i.node,a=i.fromOffset,s=i.toOffset,l=i.from,u=i.to,c=e.domSelection(),p=c.anch
2orNode;if(p&&e.dom.contains(1==p.nodeType?p:p.parentNode)&&(r=[{node:p,offset:c.anchorOffset}],rn(c)||r.push({node:c.focusNode,offset:c.focusOffset})),zt&&8===e.input.lastKeyCode)for(var d=s;d>a;d--){var f=o.childNodes[d-1],h=f.pmViewDesc;if("BR"==f.nodeName&&!h){s=d;break}if(!h||h.size)break}var m=e.state.doc,v=e.someProp("domParser")||ue.fromSchema(e.state.schema),g=m.resolve(l),y=null,b=v.parse(o,{topNode:g.parent,topMatch:g.parent.contentMatchAt(g.index()),topOpen:!0,from:a,to:s,preserveWhitespace:"pre"!=g.parent.type.whitespace||"full",findPositions:r,ruleFromNode:Si,context:g});if(r&&null!=r[0].pos){var w=r[0].pos,k=r[1]&&r[1].pos;null==k&&(k=w),y={anchor:w+l,head:k+l}}return{doc:b,sel:y,from:l,to:u}}(e,t,n),h=e.state.doc,m=h.slice(f.from,f.to);8===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime?(c=e.state.selection.to,p="end"):(c=e.state.selection.from,p="start"),e.input.lastKeyCode=null;var v=function(e,t,n,r,i){var o=e.findDiffStart(t,n);if(null==o)return null;var a=e.findDiffEnd(t,n+e.size,n+t.size),s=a.a,l=a.b;if("end"==i){r-=s+Math.max(0,o-Math.min(s,l))-o}if(s<o&&e.size<t.size){l=(o-=r<=o&&r>=s?o-r:0)+(l-s),s=o}else if(l<o){s=(o-=r<=o&&r>=l?o-r:0)+(s-l),l=o}return{start:o,endA:s,endB:l}}(m.content,f.doc.content,f.from,c,p);if((_t&&e.input.lastIOSEnter>Date.now()-225||$t)&&i.some((function(e){return"DIV"==e.nodeName||"P"==e.nodeName}))&&(!v||v.endA>=v.endB)&&e.someProp("handleKeyDown",(function(t){return t(e,on(13,"Enter"))})))e.input.lastIOSEnter=0;else{if(!v){if(!(r&&d instanceof pt&&!d.empty&&d.$head.sameParent(d.$anchor))||e.composing||f.sel&&f.sel.anchor!=f.sel.head){if(f.sel){var g=Li(e,e.state.doc,f.sel);g&&!g.eq(e.state.selection)&&e.dispatch(e.state.tr.setSelection(g))}return}v={start:d.from,endA:d.to,endB:d.to}}if(zt&&e.cursorWrapper&&f.sel&&f.sel.anchor==e.cursorWrapper.deco.from&&f.sel.head==f.sel.anchor){var b=v.endB-v.start;f.sel={anchor:f.sel.anchor+b,head:f.sel.anchor+b}}e.input.domChangeCount++,e.state.selection.from<e.state.selection.to&&v.start==v.endB&&e.state.selection instanceof pt&&(v.start>e.state.selection.from&&v.start<=e.state.selection.from+2&&e.state.selection.from>=f.from?v.start=e.state.selection.from:v.endA<e.state.selection.to&&v.endA>=e.state.selection.to-2&&e.state.selection.to<=f.to&&(v.endB+=e.state.selection.to-v.endA,v.endA=e.state.selection.to)),Bt&&Ft<=11&&v.endB==v.start+1&&v.endA==v.start&&v.start>f.from&&" \xa0"==f.doc.textBetween(v.start-f.from-1,v.start-f.from+1)&&(v.start--,v.endA--,v.endB--);var w,k=f.doc.resolveNoCache(v.start-f.from),x=f.doc.resolveNoCache(v.endB-f.from),C=h.resolve(v.start),T=k.sameParent(x)&&k.parent.inlineContent&&C.end()>=v.endA;if((_t&&e.input.lastIOSEnter>Date.now()-225&&(!T||i.some((function(e){return"DIV"==e.nodeName||"P"==e.nodeName})))||!T&&k.pos<f.doc.content.size&&(w=st.findFrom(f.doc.resolve(k.pos+1),1,!0))&&w.head==x.pos)&&e.someProp("handleKeyDown",(function(t){return t(e,on(13,"Enter"))})))e.input.lastIOSEnter=0;else if(e.state.selection.anchor>v.start&&function(e,t,n,r,i){if(!r.parent.isTextblock||n-t<=i.pos-r.pos||Ai(r,!0,!1)<i.pos)return!1;var o=e.resolve(t);if(o.parentOffset<o.parent.content.size||!o.parent.isTextblock)return!1;var a=e.resolve(Ai(o,!0,!0));return!(!a.parent.isTextblock||a.pos>n||Ai(a,!0,!1)<n)&&r.parent.content.cut(r.parentOffset).eq(a.parent.content)}(h,v.start,v.endA,k,x)&&e.someProp("handleKeyDown",(function(t){return t(e,on(8,"Backspace"))})))$t&&zt&&e.domObserver.suppressSelectionUpdates();else{zt&&$t&&v.endB==v.start&&(e.input.lastAndroidDelete=Date.now()),$t&&!T&&k.start()!=x.start()&&0==x.parentOffset&&k.depth==x.depth&&f.sel&&f.sel.anchor==f.sel.head&&f.sel.head==v.endA&&(v.endB-=2,x=f.doc.resolveNoCache(v.endB-f.from),setTimeout((function(){e.someProp("handleKeyDown",(function(t){return t(e,on(13,"Enter"))}))}),20));var E,M,N,S=v.start,D=v.endA;if(T)if(k.pos==x.pos)Bt&&Ft<=11&&0==k.parentOffset&&(e.domObserver.suppressSelectionUpdates(),setTimeout((function(){return Xn(e)}),20)),E=e.state.tr.delete(S,D),M=h.resolve(v.start).marksAcross(h.resolve(v.endA));else if(v.endA==v.endB&&(N=function(e,t){for(var n,r,i,o=e.firstChild.marks,a=t.firstChild.marks,s=o,l=a,u=0;u<a.length;u++)s=a[u].removeFromSet(s);for(var c=0;c<o.length;c++)l=o[c].removeFromSet(l);if(1==s.length&&0==l.length)r=s[0],n="add",i=function(e){return e.mark(r.addToSet(e.marks))};else{if(0!=s.length||1!=l.length)return null;r=l[0],n="remove",i=function(e){return e.mark(r.removeFromSet(e.marks))}}for(var p=[],d=0;d<t.childCount;d++)p.push(i(t.child(d)));if(y.from(p).eq(e))return{mark:r,type:n}}(k.parent.content.cut(k.parentOffset,x.parentOffset),C.parent.content.cut(C.parentOffset,v.endA-C.start()))))E=e.state.tr,"add"==N.type?E.addMark(S,D,N.mark):E.removeMark(S,D,N.mark);else if(k.parent.child(k.index()).isText&&k.index()==x.index()-(x.textOffset?0:1)){var L=k.parent.textBetween(k.parentOffset,x.parentOffset);if(e.someProp("handleTextInput",(function(t){return t(e,S,D,L)})))return;E=e.state.tr.insertText(L,S,D)}if(E||(E=e.state.tr.replace(S,D,f.doc.slice(v.start-f.from,v.endB-f.from))),f.sel){var A=Li(e,E.doc,f.sel);A&&!(zt&&$t&&e.composing&&A.empty&&(v.start!=v.endB||e.input.lastAndroidDelete<Date.now()-100)&&(A.head==S||A.head==E.mapping.map(D)-1)||Bt&&A.empty&&A.head==S)&&E.setSelection(A)}M&&E.ensureMarks(M),e.dispatch(E.scrollIntoView())}}}}
2function Li(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:ir(e,t.resolve(n.anchor),t.resolve(n.head))}function Ai(e,t,n){for(var r=e.depth,i=t?e.end():e.pos;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,i++,t=!1;if(n)for(var o=e.node(r).maybeChild(e.indexAfter(r));o&&!o.isLeaf;)o=o.firstChild,i++;return i}var Oi=function(){function e(t,n){var r=this;(0,d.Z)(this,e),this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new Rr,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(Fi),this.dispatch=this.dispatch.bind(this),this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):"function"==typeof t?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=Pi(this),Ri(this),this.nodeViews=Bi(this),this.docView=In(this.state.doc,Ii(this),ki(this),this.dom,this),this.domObserver=new Ei(this,(function(e,t,n,i){return Di(r,e,t,n,i)})),this.domObserver.start(),function(e){var t=function(){var t=Ar[n];e.dom.addEventListener(n,e.input.eventHandlers[n]=function(n){!function(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(var n=t.target;n!=e.dom;n=n.parentNode)if(!n||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}(e,n)||Fr(e,n)||!e.editable&&n.type in Or||t(e,n)},Ir[n]?{passive:!0}:void 0)};for(var n in Ar)t();Vt&&e.dom.addEventListener("input",(function(){return null})),Br(e)}(this),this.updatePluginViews()}return(0,f.Z)(e,[{key:"composing",get:function(){return this.input.composing}},{key:"props",get:function(){if(this._props.state!=this.state){var e=this._props;for(var t in this._props={},e)this._props[t]=e[t];this._props.state=this.state}return this._props}},{key:"update",value:function(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Br(this),this._props=e,e.plugins&&(e.plugins.forEach(Fi),this.directPlugins=e.plugins),this.updateStateInner(e.state,!0)}},{key:"setProps",value:function(e){var t={};for(var n in this._props)t[n]=this._props[n];for(var r in t.state=this.state,e)t[r]=e[r];this.update(t)}},{key:"updateState",value:function(e){this.updateStateInner(e,this.state.plugins!=e.plugins)}},{key:"updateStateInner",value:function(e,t){var n=this.state,r=!1,i=!1;if(e.storedMarks&&this.composing&&(Kr(this),i=!0),this.state=e,t){var o=Bi(this);(function(e,t){var n=0,r=0;for(var i in e){if(e[i]!=t[i])return!0;n++}for(var o in t)r++;return n!=r})(o,this.nodeViews)&&(this.nodeViews=o,r=!0),Br(this)}this.editable=Pi(this),Ri(this);var a=ki(this),s=Ii(this),l=t?"reset":e.scrollToSelection>n.scrollToSelection?"to selection":"preserve",u=r||!this.docView.matchesNode(e.doc,s,a);!u&&e.selection.eq(n.selection)||(i=!0);var c="preserve"==l&&i&&null==this.dom.style.overflowAnchor&&function(e){for(var t,n,r=e.dom.getBoundingClientRect(),i=Math.max(0,r.top),o=(r.left+r.right)/2,a=i+1;a<Math.min(innerHeight,r.bottom);a+=5){var s=e.root.elementFromPoint(o,a);if(s&&s!=e.dom&&e.dom.contains(s)){var l=s.getBoundingClientRect();if(l.top>=i-20){t=s,n=l.top;break}}}return{refDOM:t,refTop:n,stack:cn(e.dom)}}(this);if(i){this.domObserver.stop();var p=u&&(Bt||zt)&&!this.composing&&!n.selection.empty&&!e.selection.empty&&function(e,t){var n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}(n.selection,e.selection);if(u){var d=zt?this.trackWrites=this.domSelection().focusNode:null;!r&&this.docView.update(e.doc,s,a,this)||(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=In(e.doc,s,a,this.dom,this)),d&&!this.trackWrites&&(p=!0)}p||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelection())&&function(e){var t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelection();return Qt(t.node,t.offset,n.anchorNode,n.anchorOffset)}(this))?Xn(this,p):(nr(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(n),"reset"==l?this.dom.scrollTop=0:"to selection"==l?this.scrollToSelection():c&&function(e){var t=e.refDOM,n=e.refTop,r=e.stack,i=t?t.getBoundingClientRect().top:0;pn(r,0==i?0:i-n)}(c)}},{key:"scrollToSelection",value:function(){var e=this,t=this.domSelection().focusNode;if(this.someProp("handleScrollToSelection",(function(t){return t(e)})));else if(this.state.selection instanceof ft){var n=this.docView.domAfterPos(this.state.selection.from);1==n.nodeType&&un(this,n.getBoundingClientRect(),t)}else un(this,this.coordsAtPos(this.state.selection.head,1),t)}},{key:"destroyPluginViews",value:function(){for(var e;e=this.pluginViews.pop();)e.destroy&&e.destroy()}},{key:"updatePluginViews",value:function(e){if(e&&e.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(var t=0;t<this.pluginViews.length;t++){var n=this.pluginViews[t];n.update&&n.update(this,e)}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(var r=0;r<this.directPlugins.length;r++){var i=this.directPlugins[r];i.spec.view&&this.pluginViews.push(i.spec.view(this))}for(var o=0;o<this.state.plugins.length;o++){var a=this.state.plugins[o];a.spec.view&&this.pluginViews.push(a.spec.view(this))}}}},{key:"someProp",value:function(e,t){var n,r=this._props&&this._props[e];if(null!=r&&(n=t?t(r):r))return n;for(var i=0;i<this.directPlugins.length;i++){var o=this.directPlugins[i].props[e];if(null!=o&&(n=t?t(o):o))return n}var a=this.state.plugins;if(a)for(var s=0;s<a.length;s++){var l=a[s].props[e];if(null!=l&&(n=t?t(l):l))return n}}},{key:"hasFocus",value:function(){return this.root.activeElement==this.dom}},{key:"focus",value:function(){this.domObserver.stop(),this.editable&&function(e){if(e.setActive)return e.setActive();if(dn)return e.focus(dn);var t=cn(e);e.focus(null==dn?{get preventScroll(){return dn={preventScroll:!0},!0}}:void 0),dn||(dn=!1,pn(t,0))}(this.dom),Xn(this),this.domObserver.start()}},{key:"root",get:function(){var e=this,t=this._root;if(null==t)for(var n=function(t){if(9==t.nodeType||11==t.nodeType&&t.host)return t.getSelection||(Object.getPrototypeOf(t).getSelection=function(){return t.ownerDocument.getSelection()}),{v:e._root=t}},r=this.dom.parentNode;r;r=r.parentNode){var i=n(r);if("object"===typeof i)return i.v}return t||document}},{key:"posAtCoords",value:function(e){return vn(this,e)}},{key:"coordsAtPos",value:function(e){return bn(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:1)}},{key:"domAtPos",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.docView.domFromPos(e,t)}},{key:"nodeDOM",value:function(e){var t=this.docView.descAt(e);return t?t.nodeDOM:null}},{key:"posAtDOM",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,r=this.docView.posFromDOM(e,t,n);if(null==r)throw new RangeError("DOM position not inside the editor");return r}},{key:"endOfTextblock",value:function(e,t){return Nn(this,t||this.state,e)}},{key:"destroy",value:function(){this.docView&&(!function(e){for(var t in e.domObserver.stop(),e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],ki(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}},{key:"isDestroyed",get:function(){return null==this.docView}},{key:"dispatchEvent",value:function(e){return function(e,t){Fr(e,t)||!Ar[t.type]||!e.editable&&t.type in Or||Ar[t.type](e,t)}(this,e)}},{key:"dispatch",value:function(e){var t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))}},{key:"domSelection",value:function(){return this.root.getSelection()}}]),e}();function Ii(e){var t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),t.translate="no",e.
2someProp("attributes",(function(n){if("function"==typeof n&&(n=n(e.state)),n)for(var r in n)"class"==r&&(t.class+=" "+n[r]),"style"==r?t.style=(t.style?t.style+";":"")+n[r]:t[r]||"contenteditable"==r||"nodeName"==r||(t[r]=String(n[r]))})),[si.node(0,e.state.doc.content.size,t)]}function Ri(e){if(e.markCursor){var t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:si.widget(e.state.selection.head,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function Pi(e){return!e.someProp("editable",(function(t){return!1===t(e.state)}))}function Bi(e){var t=Object.create(null);function n(e){for(var n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n])}return e.someProp("nodeViews",n),e.someProp("markViews",n),t}function Fi(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}for(var Hi={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},qi={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},zi="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent),ji=("undefined"!=typeof navigator&&/Gecko\/\d+/.test(navigator.userAgent),"undefined"!=typeof navigator&&/Mac/.test(navigator.platform)),Vi="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),_i=ji||zi&&+zi[1]<57,Ui=0;Ui<10;Ui++)Hi[48+Ui]=Hi[96+Ui]=String(Ui);for(Ui=1;Ui<=24;Ui++)Hi[Ui+111]="F"+Ui;for(Ui=65;Ui<=90;Ui++)Hi[Ui]=String.fromCharCode(Ui+32),qi[Ui]=String.fromCharCode(Ui);for(var $i in Hi)qi.hasOwnProperty($i)||(qi[$i]=Hi[$i]);var Zi="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function Wi(e){var t,n,r,i,o=e.split(/-(?!$)/),a=o[o.length-1];"Space"==a&&(a=" ");for(var s=0;s<o.length-1;s++){var l=o[s];if(/^(cmd|meta|m)$/i.test(l))i=!0;else if(/^a(lt)?$/i.test(l))t=!0;else if(/^(c|ctrl|control)$/i.test(l))n=!0;else if(/^s(hift)?$/i.test(l))r=!0;else{if(!/^mod$/i.test(l))throw new Error("Unrecognized modifier name: "+l);Zi?i=!0:n=!0}}return t&&(a="Alt-"+a),n&&(a="Ctrl-"+a),i&&(a="Meta-"+a),r&&(a="Shift-"+a),a}function Gi(e,t,n){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),!1!==n&&t.shiftKey&&(e="Shift-"+e),e}function Ji(e){return new Mt({props:{handleKeyDown:Ki(e)}})}function Ki(e){var t=function(e){var t=Object.create(null);for(var n in e)t[Wi(n)]=e[n];return t}(e);return function(e,n){var r,i=function(e){var t=!(_i&&(e.ctrlKey||e.altKey||e.metaKey)||Vi&&e.shiftKey&&e.key&&1==e.key.length||"Unidentified"==e.key)&&e.key||(e.shiftKey?qi:Hi)[e.keyCode]||e.key||"Unidentified";return"Esc"==t&&(t="Escape"),"Del"==t&&(t="Delete"),"Left"==t&&(t="ArrowLeft"),"Up"==t&&(t="ArrowUp"),"Right"==t&&(t="ArrowRight"),"Down"==t&&(t="ArrowDown"),t}(n),o=1==i.length&&" "!=i,a=t[Gi(i,n,!o)];if(a&&a(e.state,e.dispatch,e))return!0;if(o&&(n.shiftKey||n.altKey||n.metaKey||i.charCodeAt(0)>127)&&(r=Hi[n.keyCode])&&r!=i){var s=t[Gi(r,n,!0)];if(s&&s(e.state,e.dispatch,e))return!0}else if(o&&n.shiftKey){var l=t[Gi(i,n,!0)];if(l&&l(e.state,e.dispatch,e))return!0}return!1}}var Xi=function(e,t){return!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0)};function Qi(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=e;r;r="start"==t?r.firstChild:r.lastChild){if(r.isTextblock)return!0;
2if(n&&1!=r.childCount)return!1}return!1}function Yi(e){if(!e.parent.type.spec.isolating)for(var t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}var eo=function(e,t,n){var r=e.selection.$cursor;if(!r||(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size))return!1;var i=to(r);if(!i)return!1;var o=i.nodeAfter;if(so(e,i,t))return!0;if(0==r.parent.content.size&&(Qi(o,"start")||ft.isSelectable(o))){var a=Ze(e.doc,r.before(),r.after(),T.empty);if(a&&a.slice.size<a.to-a.from){if(t){var s=e.tr.step(a);s.setSelection(Qi(o,"start")?st.findFrom(s.doc.resolve(s.mapping.map(i.pos)),1):ft.create(s.doc,s.mapping.map(i.pos))),t(s.scrollIntoView())}return!0}}return!(!o.isAtom||i.depth!=r.depth-1)&&(t&&t(e.tr.delete(i.pos,i.pos+o.nodeSize).scrollIntoView()),!0)};function to(e){if(!e.parent.type.spec.isolating)for(var t=e.depth-1;t>=0;t--){var n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}var no=function(e,t){var n=e.selection,r=n.$head,i=n.$anchor;return!(!r.parent.type.spec.code||!r.sameParent(i))&&(t&&t(e.tr.insertText("\n").scrollIntoView()),!0)};function ro(e){for(var t=0;t<e.edgeCount;t++){var n=e.edge(t).type;if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}var io=function(e,t){var n=e.selection,r=n.$head,i=n.$anchor;if(!r.parent.type.spec.code||!r.sameParent(i))return!1;var o=r.node(-1),a=r.indexAfter(-1),s=ro(o.contentMatchAt(a));if(!s||!o.canReplaceWith(a,a,s))return!1;if(t){var l=r.after(),u=e.tr.replaceWith(l,l,s.createAndFill());u.setSelection(st.near(u.doc.resolve(l),1)),t(u.scrollIntoView())}return!0},oo=function(e,t){var n=e.selection,r=n.$from,i=n.$to;if(e.selection instanceof ft&&e.selection.node.isBlock)return!(!r.parentOffset||!_e(e.doc,r.pos))&&(t&&t(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.parent.isBlock)return!1;if(t){var o=i.parentOffset==i.parent.content.size,a=e.tr;(e.selection instanceof pt||e.selection instanceof mt)&&a.deleteSelection();var s=0==r.depth?null:ro(r.node(-1).contentMatchAt(r.indexAfter(-1))),l=o&&s?[{type:s}]:void 0,u=_e(a.doc,a.mapping.map(r.pos),1,l);if(l||u||!_e(a.doc,a.mapping.map(r.pos),1,s?[{type:s}]:void 0)||(s&&(l=[{type:s}]),u=!0),u&&(a.split(a.mapping.map(r.pos),1,l),!o&&!r.parentOffset&&r.parent.type!=s)){var c=a.mapping.map(r.before()),p=a.doc.resolve(c);s&&r.node(-1).canReplaceWith(p.index(),p.index()+1,s)&&a.setNodeMarkup(a.mapping.map(r.before()),s)}t(a.scrollIntoView())}return!0},ao=function(e,t){return t&&t(e.tr.setSelection(new mt(e.doc))),!0};function so(e,t,n){var r,i,o=t.nodeBefore,a=t.nodeAfter;if(o.type.spec.isolating||a.type.spec.isolating)return!1;if(function(e,t,n){var r=t.nodeBefore,i=t.nodeAfter,o=t.index();return!!(r&&i&&r.type.compatibleContent(i.type))&&(!r.content.size&&t.parent.canReplace(o-1,o)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),!0):!(!t.parent.canReplace(o,o+1)||!i.isTextblock&&!Ue(e.doc,t.pos))&&(n&&n(e.tr.clearIncompatible(t.pos,r.type,r.contentMatchAt(r.childCount)).join(t.pos).scrollIntoView()),!0))}(e,t,n))return!0;var s=t.parent.canReplace(t.index(),t.index()+1);if(s&&(r=(i=o.contentMatchAt(o.childCount)).findWrapping(a.type))&&i.matchType(r[0]||a.type).validEnd){if(n){for(var l=t.pos+a.nodeSize,u=y.empty,c=r.length-1;c>=0;c--)u=y.from(r[c].create(null,u));u=y.from(o.copy(u));var p=e.tr.step(new He(t.pos-1,l,t.pos,l,new T(u,1,0),r.length,!0)),d=l+2*r.length;Ue(p.doc,d)&&p.join(d),n(p.scrollIntoView())}return!0}var f=st.findFrom(t,1),h=f&&f.$from.blockRange(f.$to),m=h&&je(h);if(null!=m&&m>=t.depth)return n&&n(e.tr.lift(h,m).scrollIntoView()),!0;if(s&&Qi(a,"start",!0)&&Qi(o,"end")){for(var v=o,g=[];g.push(v),!v.isTextblock;)v=v.lastChild;for(var b=a,w=1;!b.isTextblock;b=b.firstChild)w++;if(v.canReplace(v.childCount,v.childCount,b.content)){if(n){for(var k=y.empty,x=g.length-1;x>=0;x--)k=y.from(g[x].copy(k));n(e.tr.step(new He(t.pos-g.length,t.pos+a.nodeSize,t.pos+w,t.pos+a.nodeSize-w,new T(k,g.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function lo(e){return function(t,n){for(var r=t.selection,i=e<0?r.$from:r.$to,o=i.depth;i.node(o).isInline;){if(!o)return!1;o--}return!!i.node(o).isTextblock&&(n&&n(t.tr.setSelection(pt.create(t.doc,e<0?i.start(o):i.end(o)))),!0)}}var uo=lo(-1),co=lo(1);function po(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return function(n,r){var i=n.selection,o=i.$from,a=i.$to,s=o.blockRange(a),l=s&&function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e,i=function(e,t){var n=e.parent,r=e.startIndex,i=e.endIndex,o=n.contentMatchAt(r).findWrapping(t);if(!o)return null;var a=o.length?o[0]:t;return n.canReplaceWith(r,i,a)?o:null}(e,t),o=i&&function(e,t){var n=e.parent,r=e.startIndex,i=e.endIndex,o=n.child(r),a=t.contentMatch.findWrapping(o.type);if(!a)return null;for(var s=(a.length?a[a.length-1]:t).contentMatch,l=r;s&&l<i;l++)s=s.matchType(n.child(l).type);return s&&s.validEnd?a:null}(r,t);return o?i.map(Ve).concat({type:t,attrs:n}).concat(o.map(Ve)):null}(s,e,t);return!!l&&(r&&r(n.tr.wrap(s,l).scrollIntoView()),!0)}}function fo(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return function(n,r){var i=n.selection,o=i.from,a=i.to,s=!1;return n.doc.nodesBetween(o,a,(function(r,i){if(s)return!1;if(r.isTextblock&&!r.hasMarkup(e,t))if(r.type==e)s=!0;else{var o=n.doc.resolve(i),a=o.index();s=o.parent.canReplaceWith(a,a+1,e)}})),!!s&&(r&&r(n.tr.setBlockType(o,a,e,t).scrollIntoView()),!0)}}function ho(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;
2return function(n,r){var i=n.selection,o=i.empty,a=i.$cursor,s=i.ranges;if(o&&!a||!function(e,t,n){for(var r=function(){var r=t[i],o=r.$from,a=r.$to,s=0==o.depth&&e.type.allowsMarkType(n);if(e.nodesBetween(o.pos,a.pos,(function(e){if(s)return!1;s=e.inlineContent&&e.type.allowsMarkType(n)})),s)return{v:!0}},i=0;i<t.length;i++){var o=r();if("object"===typeof o)return o.v}return!1}(n.doc,s,e))return!1;if(r)if(a)e.isInSet(n.storedMarks||a.marks())?r(n.tr.removeStoredMark(e)):r(n.tr.addStoredMark(e.create(t)));else{for(var l=!1,u=n.tr,c=0;!l&&c<s.length;c++){var p=s[c],d=p.$from,f=p.$to;l=n.doc.rangeHasMark(d.pos,f.pos,e)}for(var h=0;h<s.length;h++){var m=s[h],v=m.$from,g=m.$to;if(l)u.removeMark(v.pos,g.pos,e);else{var y=v.pos,b=g.pos,w=v.nodeAfter,k=g.nodeBefore,x=w&&w.isText?/^\s*/.exec(w.text)[0].length:0,C=k&&k.isText?/\s*$/.exec(k.text)[0].length:0;y+x<b&&(y+=x,b-=C),u.addMark(y,b,e.create(t))}}r(u.scrollIntoView())}return!0}}function mo(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e,n,r){for(var i=0;i<t.length;i++)if(t[i](e,n,r))return!0;return!1}}var vo=mo(Xi,(function(e,t,n){var r=e.selection.$cursor;if(!r||(n?!n.endOfTextblock("backward",e):r.parentOffset>0))return!1;var i=Yi(r);if(!i){var o=r.blockRange(),a=o&&je(o);return null!=a&&(t&&t(e.tr.lift(o,a).scrollIntoView()),!0)}var s=i.nodeBefore;if(!s.type.spec.isolating&&so(e,i,t))return!0;if(0==r.parent.content.size&&(Qi(s,"end")||ft.isSelectable(s))){var l=Ze(e.doc,r.before(),r.after(),T.empty);if(l&&l.slice.size<l.to-l.from){if(t){var u=e.tr.step(l);u.setSelection(Qi(s,"end")?st.findFrom(u.doc.resolve(u.mapping.map(i.pos,-1)),-1):ft.create(u.doc,i.pos-s.nodeSize)),t(u.scrollIntoView())}return!0}}return!(!s.isAtom||i.depth!=r.depth-1)&&(t&&t(e.tr.delete(i.pos-s.nodeSize,i.pos).scrollIntoView()),!0)}),(function(e,t,n){var r=e.selection,i=r.$head,o=i;if(!r.empty)return!1;if(i.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):i.parentOffset>0)return!1;o=Yi(i)}var a=o&&o.nodeBefore;return!(!a||!ft.isSelectable(a))&&(t&&t(e.tr.setSelection(ft.create(e.doc,o.pos-a.nodeSize)).scrollIntoView()),!0)})),go=mo(Xi,eo,(function(e,t,n){var r=e.selection,i=r.$head,o=i;if(!r.empty)return!1;if(i.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):i.parentOffset<i.parent.content.size)return!1;o=to(i)}var a=o&&o.nodeAfter;return!(!a||!ft.isSelectable(a))&&(t&&t(e.tr.setSelection(ft.create(e.doc,o.pos)).scrollIntoView()),!0)})),yo={Enter:mo(no,(function(e,t){var n=e.selection,r=n.$from,i=n.$to;if(n instanceof mt||r.parent.inlineContent||i.parent.inlineContent)return!1;var o=ro(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(t){var a=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,s=e.tr.insert(a,o.createAndFill());s.setSelection(pt.create(s.doc,a+1)),t(s.scrollIntoView())}return!0}),(function(e,t){var n=e.selection.$cursor;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){var r=n.before();if(_e(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}var i=n.blockRange(),o=i&&je(i);return null!=o&&(t&&t(e.tr.lift(i,o).scrollIntoView()),!0)}),oo),"Mod-Enter":io,Backspace:vo,"Mod-Backspace":vo,"Shift-Backspace":vo,Delete:go,"Mod-Delete":go,"Mod-a":ao},bo={"Ctrl-h":yo.Backspace,"Alt-Backspace":yo["Mod-Backspace"],"Ctrl-d":yo.Delete,"Ctrl-Alt-Backspace":yo["Mod-Delete"],"Alt-Delete":yo["Mod-Delete"],"Alt-d":yo["Mod-Delete"],"Ctrl-a":uo,"Ctrl-e":co};for(var wo in yo)bo[wo]=yo[wo];var ko=("undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!("undefined"==typeof os||!os.platform)&&"darwin"==os.platform())?bo:yo,xo=(0,f.Z)((function e(t,n){var r;(0,d.Z)(this,e),this.match=t,this.match=t,this.handler="string"==typeof n?(r=n,function(e,t,n,i){var o=r;if(t[1]){var a=t[0].lastIndexOf(t[1]);o+=t[0].slice(a+t[1].length);var s=(n+=a)-i;s>0&&(o=t[0].slice(a-s,a)+o,n=i)}return e.tr.insertText(o,n,i)}):n}));var Co=500;function To(e){var t=e.rules,n=new Mt({state:{init:function(){return null},apply:function(e,t){var n=e.getMeta(this);return n||(e.selectionSet||e.docChanged?null:t)}},props:{handleTextInput:function(e,r,i,o){return Eo(e,r,i,o,t,n)},handleDOMEvents:{compositionend:function(e){setTimeout((function(){var r=e.state.selection.$cursor;r&&Eo(e,r.pos,r.pos,"",t,n)}))}}},isInputRules:!0});return n}function Eo(e,t,n,r,i,o){if(e.composing)return!1;var a=e.state,s=a.doc.resolve(t);if(s.parent.type.spec.code)return!1;for(var l=s.parent.textBetween(Math.max(0,s.parentOffset-Co),s.parentOffset,null,"\ufffc")+r,u=0;u<i.length;u++){var c=i[u].match.exec(l),p=c&&i[u].handler(a,c,t-(c[0].length-r.length),n);if(p)return e.dispatch(p.setMeta(o,{transform:p,from:t,to:n,text:r})),!0}return!1}var Mo=function(e,t){for(var n=e.plugins,r=0;r<n.length;r++){var i=n[r],o=void 0;if(i.spec.isInputRules&&(o=i.getState(e))){if(t){for(var a=e.tr,s=o.transform,l=s.steps.length-1;l>=0;l--)a.step(s.steps[l].invert(s.docs[l]));if(o.text){var u=a.doc.resolve(o.from).marks();a.replaceWith(o.from,o.to,e.schema.text(o.text,u))}else a.delete(o.from,o.to);t(a)}return!0}}return!1};new xo(/--$/,"\u2014"),new xo(/\.\.\.$/,"\u2026"),new xo(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,"\u201c"),new xo(/"$/,"\u201d"),new xo(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,"\u2018"),new xo(/'$/,"\u2019");var No=200,So=function(){};So.prototype.append=function(e){return e.length?(e=So.from(e),!this.length&&e||e.length<No&&this.leafAppend(e)||this.length<No&&e.leafPrepend(this)||this.appendInner(e)):this},So.prototype.prepend=function(e){return e.length?So.from(e).append(this):this},So.prototype.appendInner=function(e){return new Lo(this,e)},So.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t?So.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},So.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},So.prototype.forEach=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},So.prototype.map=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length);var r=[];return this.forEach((function(t,n){return r.push(e(t,n))}),t,n),r},So.from=function(e){return e instanceof So?e:e&&e.length?new Do(e):So.empty};var Do=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return 0==e&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var i=t;i<n;i++)if(!1===e(this.values[i],r+i))return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var i=t-1;i>=n;i--)if(!1===e(this.values[i],r+i))return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=No)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=No)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(So);So.empty=new Do([]);var Lo=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,n,r){var i=this.left.length;return!(t<i&&!1===this.left.forEachInner(e,t,Math.min(n,i),r))&&(!(n>i&&!1===this.right.forEachInner(e,Math.max(t-i,0),Math.min(this.length,n)-i,r+i))&&void 0)},t.prototype.forEachInvertedInner=function(e,t,n,r){var i=this.left.length;return!(t>i&&!1===this.right.forEachInvertedInner(e,t-i,Math.max(n,i)-i,r+i))&&(!(n<i&&!1===this.left.forEachInvertedInner(e,Math.min(t,i),n,r))&&void 0)},t.prototype.sliceInner=function(e,t){if(0==e&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(So),Ao=So,Oo=function(){function e(t,n){(0,d.Z)(this,e),this.items=t,this.eventCount=n}return(0,f.Z)(e,[{key:"popEvent",value:function(t,n){var r=this;if(0==this.eventCount)return null;for(var i,o,a=this.items.length;;a--){if(this.items.get(a-1).selection){--a;break}}n&&(i=this.remapping(a,this.items.length),o=i.maps.length);var s,l,u=t.tr,c=[],p=[];
2return this.items.forEach((function(t,n){if(!t.step)return i||(i=r.remapping(a,n+1),o=i.maps.length),o--,void p.push(t);if(i){p.push(new Io(t.map));var d,f=t.step.map(i.slice(o));f&&u.maybeStep(f).doc&&(d=u.mapping.maps[u.mapping.maps.length-1],c.push(new Io(d,void 0,void 0,c.length+p.length))),o--,d&&i.appendMap(d,o)}else u.maybeStep(t.step);return t.selection?(s=i?t.selection.map(i.slice(o)):t.selection,l=new e(r.items.slice(0,a).append(p.reverse().concat(c)),r.eventCount-1),!1):void 0}),this.items.length,0),{remaining:l,transform:u,selection:s}}},{key:"addTransform",value:function(t,n,r,i){for(var o=[],a=this.eventCount,s=this.items,l=!i&&s.length?s.get(s.length-1):null,u=0;u<t.steps.length;u++){var c,p=t.steps[u].invert(t.docs[u]),d=new Io(t.mapping.maps[u],p,n);(c=l&&l.merge(d))&&(d=c,u?o.pop():s=s.slice(0,s.length-1)),o.push(d),n&&(a++,n=void 0),i||(l=d)}var f=a-r.depth;return f>Po&&(s=function(e,t){var n;return e.forEach((function(e,r){if(e.selection&&0==t--)return n=r,!1})),e.slice(n)}(s,f),a-=f),new e(s.append(o),a)}},{key:"remapping",value:function(e,t){var n=new Se;return this.items.forEach((function(t,r){var i=null!=t.mirrorOffset&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,i)}),e,t),n}},{key:"addMaps",value:function(t){return 0==this.eventCount?this:new e(this.items.append(t.map((function(e){return new Io(e)}))),this.eventCount)}},{key:"rebased",value:function(t,n){if(!this.eventCount)return this;var r=[],i=Math.max(0,this.items.length-n),o=t.mapping,a=t.steps.length,s=this.eventCount;this.items.forEach((function(e){e.selection&&s--}),i);var l=n;this.items.forEach((function(e){var n=o.getMirror(--l);if(null!=n){a=Math.min(a,n);var i=o.maps[n];if(e.step){var u=t.steps[n].invert(t.docs[n]),c=e.selection&&e.selection.map(o.slice(l+1,n));c&&s++,r.push(new Io(i,u,c))}else r.push(new Io(i))}}),i);for(var u=[],c=n;c<a;c++)u.push(new Io(o.maps[c]));var p=new e(this.items.slice(0,i).append(u).append(r),s);return p.emptyItemCount()>500&&(p=p.compress(this.items.length-r.length)),p}},{key:"emptyItemCount",value:function(){var e=0;return this.items.forEach((function(t){t.step||e++})),e}},{key:"compress",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.items.length,n=this.remapping(0,t),r=n.maps.length,i=[],o=0;return this.items.forEach((function(e,a){if(a>=t)i.push(e),e.selection&&o++;else if(e.step){var s=e.step.map(n.slice(r)),l=s&&s.getMap();if(r--,l&&n.appendMap(l,r),s){var u=e.selection&&e.selection.map(n.slice(r));u&&o++;var c,p=new Io(l.invert(),s,u),d=i.length-1;(c=i.length&&i[d].merge(p))?i[d]=c:i.push(p)}}else e.map&&r--}),this.items.length,0),new e(Ao.from(i.reverse()),o)}}]),e}();Oo.empty=new Oo(Ao.empty,0);var Io=function(){function e(t,n,r,i){(0,d.Z)(this,e),this.map=t,this.step=n,this.selection=r,this.mirrorOffset=i}return(0,f.Z)(e,[{key:"merge",value:function(t){if(this.step&&t.step&&!t.selection){var n=t.step.merge(this.step);if(n)return new e(n.getMap().invert(),n,this.selection)}}}]),e}(),Ro=(0,f.Z)((function e(t,n,r,i){(0,d.Z)(this,e),this.done=t,this.undone=n,this.prevRanges=r,this.prevTime=i})),Po=20;function Bo(e){var t=[];return e.forEach((function(e,n,r,i){return t.push(r,i)})),t}function Fo(e,t){if(!e)return null;for(var n=[],r=0;r<e.length;r+=2){var i=t.map(e[r],1),o=t.map(e[r+1],-1);i<=o&&n.push(i,o)}return n}function Ho(e,t,n,r){var i=jo(t),o=Vo.get(t).spec.config,a=(r?e.undone:e.done).popEvent(t,i);if(a){var s=a.selection.resolve(a.transform.doc),l=(r?e.done:e.undone).addTransform(a.transform,t.selection.getBookmark(),o,i),u=new Ro(r?l:a.remaining,r?a.remaining:l,null,0);n(a.transform.setSelection(s).setMeta(Vo,{redo:r,historyState:u}).scrollIntoView())}}var qo=!1,zo=null;function jo(e){var t=e.plugins;if(zo!=t){qo=!1,zo=t;for(var n=0;n<t.length;n++)if(t[n].spec.historyPreserveItems){qo=!0;break}}return qo}var Vo=new Dt("history"),_o=new Dt("closeHistory");function Uo(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new Mt({key:Vo,state:{init:function(){return new Ro(Oo.empty,Oo.empty,null,0)},apply:function(t,n,r){return function(e,t,n,r){var i,o=n.getMeta(Vo);if(o)return o.historyState;n.getMeta(_o)&&(e=new Ro(e.done,e.undone,null,0));var a=n.getMeta("appendedTransaction");if(0==n.steps.length)return e;if(a&&a.getMeta(Vo))return a.getMeta(Vo).redo?new Ro(e.done.addTransform(n,void 0,r,jo(t)),e.undone,Bo(n.mapping.maps[n.steps.length-1]),e.prevTime):new Ro(e.done,e.undone.addTransform(n,void 0,r,jo(t)),null,e.prevTime);if(!1===n.getMeta("addToHistory")||a&&!1===a.getMeta("addToHistory"))return(i=n.getMeta("rebased"))?new Ro(e.done.rebased(n,i),e.undone.rebased(n,i),Fo(e.prevRanges,n.mapping),e.prevTime):new Ro(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),Fo(e.prevRanges,n.mapping),e.prevTime);var s=0==e.prevTime||!a&&(e.prevTime<(n.time||0)-r.newGroupDelay||!function(e,t){if(!t)return!1;if(!e.docChanged)return!0;var n=!1;
2return e.mapping.maps[0].forEach((function(e,r){for(var i=0;i<t.length;i+=2)e<=t[i+1]&&r>=t[i]&&(n=!0)})),n}(n,e.prevRanges)),l=a?Fo(e.prevRanges,n.mapping):Bo(n.mapping.maps[n.steps.length-1]);return new Ro(e.done.addTransform(n,s?t.selection.getBookmark():void 0,r,jo(t)),Oo.empty,l,n.time)}(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput:function(e,t){var n=t.inputType,r="historyUndo"==n?$o:"historyRedo"==n?Zo:null;return!!r&&(t.preventDefault(),r(e.state,e.dispatch))}}}})}var $o=function(e,t){var n=Vo.getState(e);return!(!n||0==n.done.eventCount)&&(t&&Ho(n,e,t,!1),!0)},Zo=function(e,t){var n=Vo.getState(e);return!(!n||0==n.undone.eventCount)&&(t&&Ho(n,e,t,!0),!0)};var Wo=function(e,t){return Wo=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])},Wo(e,t)};function Go(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}Wo(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var Jo=function(){return Jo=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Jo.apply(this,arguments)};function Ko(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}function Xo(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var Qo=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};var Yo=function(e,t){var n,r,i,o,a=Object.prototype.hasOwnProperty;for(i=1,o=arguments.length;i<o;i+=1)for(r in n=arguments[i])a.call(n,r)&&(e[r]=n[r]);return e};var ea=function(e){return"string"===typeof e||e instanceof String};var ta=function(e){return e instanceof Array};var na=function(e,t,n){var r=0,i=e.length;for(n=n||null;r<i&&!1!==t.call(n,e[r],r,e);r+=1);},ra=ta,ia=na,oa=Qo;var aa=function(e,t,n){ra(e)?ia(e,t,n):oa(e,t,n)},sa=ea,la=aa;var ua=function(e,t,n){var r=e.style;sa(t)?r[t]=n:la(t,(function(e,t){r[t]=e}))},ca=ta;var pa=function(e,t,n){var r,i;if(n=n||0,!ca(t))return-1;if(Array.prototype.indexOf)return Array.prototype.indexOf.call(t,e,n);for(i=t.length,r=n;n>=0&&r<i;r+=1)if(t[r]===e)return r;return-1};var da=function(e){return void 0===e},fa=da;var ha=function(e){return e&&e.className?fa(e.className.baseVal)?e.className:e.className.baseVal:""},ma=ta,va=da;var ga=function(e,t){t=(t=ma(t)?t.join(" "):t).replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),va(e.className.baseVal)?e.className=t:e.className.baseVal=t},ya=aa,ba=pa,wa=ha,ka=ga;var xa=function(e){var t,n=Array.prototype.slice.call(arguments,1),r=e.classList,i=[];r?ya(n,(function(t){e.classList.add(t)})):((t=wa(e))&&(n=[].concat(t.split(/\s+/),n)),ya(n,(function(e){ba(e,i)<0&&i.push(e)})),ka(e,i))},Ca=na,Ta=pa,Ea=ha,Ma=ga;var Na=function(e){var t,n,r=Array.prototype.slice.call(arguments,1),i=e.classList;i?Ca(r,(function(e){i.remove(e)})):(t=Ea(e).split(/\s+/),n=[],Ca(t,(function(e){Ta(e,r)<0&&n.push(e)})),Ma(e,n))};var Sa=function(e){return"number"===typeof e||e instanceof Number};var Da=function(e){return null===e},La=Qo;var Aa=function(e,t){var n=document.createElement("img"),r="";return La(t,(function(e,t){r+="&"+t+"="+e})),r=r.substring(1),n.src=e+"?"+r,n.style.display="none",document.body.appendChild(n),document.body.removeChild(n),n},Oa=da,Ia=Aa,Ra=6048e5;var Pa=function(e,t){var n=location.hostname,r="TOAST UI "+e+" for "+n+": Statistics",i=window.localStorage.getItem(r);(Oa(window.tui)||!1!==window.tui.usageStatistics)&&(i&&!function(e){return(new Date).getTime()-e>Ra}(i)||(window.localStorage.setItem(r,(new Date).getTime()),setTimeout((function(){"interactive"!==document.readyState&&"complete"!==document.readyState||Ia("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 Ba=/[\u0020]+/g,Fa=/[>(){}[\]+-.!#|]/g,Ha=/<([a-zA-Z_][a-zA-Z0-9\-._]*)(\s|[^\\>])*\/?>|<(\/)([a-zA-Z_][a-zA-Z0-9\-._]*)\s*\/?>|<!--[^-]+-->|<([a-zA-Z_][a-zA-Z0-9\-.:/]*)>/g,qa=/\\[!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~\\]/g,za=/[*_~`]/g,ja=/!\[.*\]\(.*\)/g,Va=/[[\]]/g,_a=/(?:^|[^\\])\\(?!\\)/g,Ua=new RegExp('[&<>"]',"g");function $a(e){switch(e){case"&":return"&amp;";case"<":return"&lt;";case">":return"&gt;";
2case'"':return"&quot;";default:return e}}function Za(e){return Ua.test(e)?e.replace(Ua,$a):e}function Wa(e,t){return-1!==e.indexOf(t)}var Ga=["rel","target","hreflang","type"],Ja={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 Ka(e){if(!e)return null;var t={};return Ga.forEach((function(n){da(e[n])||(t[n]=e[n])})),t}function Xa(e,t){for(var n="",r=0;r<t;r+=1)n+=e;return n}function Qa(e){for(var t=[],n=ja.exec(e);n;)t.push([n.index,n.index+n[0].length]),n=ja.exec(e);return e.replace(Va,(function(e,n){var r=t.some((function(e){return n>e[0]&&n<e[1]}));return r?e:"\\"+e}))}function Ya(e){var t=function(e){return"\\"+e},n=e.replace(Ba," ");return qa.test(n)&&(n=n.replace(qa,t)),_a.test(n)&&(n=n.replace(_a,(function(e){return e+"\\"}))),n=n.replace(za,t),Ha.test(n)&&(n=n.replace(Ha,t)),function(e){var t=!1;return Qo(Ja,(function(n){return n.test(e)&&(t=!0),!t})),t}(n)&&(n=n.replace(Fa,t)),n}function es(e){var t;return(t=-1===e.indexOf('"')?'""':-1===e.indexOf("'")?"''":"()")[0]+e+t[1]}function ts(e){return Da(e)||da(e)}function ns(e,t){if(null===e&&e===t)return!0;if("object"!==typeof e||"object"!==typeof t||ts(e)||ts(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 rs(e){return e[e.length-1]}function is(e){return"object"===typeof e&&null!==e}function as(e,t){var n=Jo({},e);return e&&t&&Object.keys(t).forEach((function(e){is(n[e])?Array.isArray(t[e])?n[e]=ss(t[e]):n.hasOwnProperty(e)?n[e]=as(n[e],t[e]):n[e]=ls(t[e]):n[e]=t[e]})),n}function ss(e){return e.map((function(e){return is(e)?Array.isArray(e)?ss(e):ls(e):e}))}function ls(e){var t=Object.keys(e);return t.length?t.reduce((function(t,n){return is(e[n])?t[n]=Array.isArray(e[n])?ss(e[n]):ls(e[n]):t[n]=e[n],t}),{}):e}function us(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]:us(e[n],t[n]):e[n]=t[n]})),e}function cs(e,t){return e>t?[t,e]:[e,t]}var ps=na;var ds=function(e){var t;try{t=Array.prototype.slice.call(e)}catch(n){t=[],ps(e,(function(e){t.push(e)}))}return t};function fs(e,t){var n=e.nodes.paragraph;return t?n.create(null,ea(t)?e.text(t):t):n.createAndFill()}function hs(e,t,n){return e.text(t,n)}function ms(e,t,n){void 0===n&&(n=t);var r=e.doc.content.size,i=r>0?r-1:1;return pt.create(e.doc,Math.min(t,i),Math.min(n,i))}function vs(e,t,n){var r=t.pos;return e.replaceWith(r,r,fs(n)),e.setSelection(ms(e,r+1))}function gs(e){for(var t=e.state,n=e.from,r=e.startIndex,i=e.endIndex,o=e.createText,a=t.tr,s=t.doc,l=t.schema,u=r;u<=i;u+=1){var c=s.child(u),p=c.nodeSize,d=c.textContent,f=c.content,h=o(d),m=h?hs(l,h):y.empty,v=a.mapping.map(n),g=v+f.size;a.replaceWith(v,g,m),n+=p}return a}function ys(e,t,n,r){var i=n.length;e.split(t).delete(t-i,t).insert(e.mapping.map(t),r).setSelection(ms(e,e.mapping.map(t)-i))}function bs(e){return e.sourcepos[0][0]}function ws(e){return e.sourcepos[1][0]}function ks(e){return e.sourcepos[0][1]}function xs(e){return e.sourcepos[1][1]}function Cs(e){var t=e.type;return"strike"===t||"strong"===t||"emph"===t||"code"===t||"link"===t||"image"===t}function Ts(e){return e&&("item"===e.type||"list"===e.type)}function Es(e){return Ts(e)&&"ordered"===e.listData.type}function Ms(e){return Ts(e)&&"ordered"!==e.listData.type}function Ns(e){return e&&("tableCell"===e.type||"tableDelimCell"===e.type)}function Ss(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 Ds(e,t){return[e[0],e[1]+t]}function Ls(e,t){return[e[0],t]}function As(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,r=n.destination,i=n.title;return("link"===e.type?"":"!")+"["+t+"]("+r+(i?' "'+i+'"':"")+")";default:return null}}function Os(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}}
2function Is(e){for(var t=[],n=e.walker(),r=null;r=n.next();){var i=r.node;"text"===i.type&&t.push(i.literal)}return t.join("")}var Rs=[],Ps={},Bs=/\$\$widget\d+\s/;function Fs(e){var t=e.search(Bs);if(-1!==t){var n=e.substring(t).replace(Bs,"").replace("$$","");e=e.substring(0,t),e+=Fs(n)}return e}function Hs(e,t){return"$$"+e+" "+t+"$$"}function qs(e,t){var n=Ps[e],r=n.rule,i=n.toDOM,o=Fs(t).match(r);return o&&(t=o[0]),i(t)}function zs(){return Rs}function js(e){(Rs=e).forEach((function(e,t){Ps["widget"+t]=e}))}function Vs(e,t,n,r){return e.concat(_s(t,n,r))}function _s(e,t,n){void 0===n&&(n=0);var r=[],i=(Rs[n]||{}).rule,o=n+1;if(e=Fs(e),i&&i.test(e)){for(var a=void 0;-1!==(a=e.search(i));){var s=e.substring(0,a);s&&(r=Vs(r,s,t,o));var l=(e=e.substring(a)).match(i)[0],u="widget"+n;r.push(t.nodes.widget.create({info:u},t.text(Hs(u,l)))),e=e.substring(l.length)}e&&(r=Vs(r,e,t,o))}else e&&(r=n<Rs.length-1?Vs(r,e,t,o):[t.text(e)]);return r}function Us(e){for(var t,n="",r=e.walker();t=r.next();){var i=t.node;t.entering&&(i!==e&&"text"!==i.type?(n+=As(i),r.resumeAt(e,!1),r.next()):"text"===i.type&&(n+=i.literal))}return n}function $s(){return{deleteSelection:function(){return Xi},selectAll:function(){return ao},undo:function(){return $o},redo:function(){return Zo}}}var Zs=pa,Ws=ha;var Gs=function(e,t){var n;return e.classList?e.classList.contains(t):(n=Ws(e).split(/\s+/),Zs(t,n)>-1)},Js=pa,Ks=ds,Xs=Element.prototype,Qs=Xs.matches||Xs.webkitMatchesSelector||Xs.mozMatchesSelector||Xs.msMatchesSelector||function(e){var t=this.document||this.ownerDocument;return Js(this,Ks(t.querySelectorAll(e)))>-1};var Ys=function(e,t){return Qs.call(e,t)},el="[A-Za-z][A-Za-z0-9-]*",tl="(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^\"'=<>`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)",nl="<("+el+")("+tl+")*\\s*/?>",rl="(?:"+nl+"|"+("</("+el+")\\s*[>]")+")",il=new RegExp("^"+rl,"i"),ol=/<br\s*\/*>/i,al=/<! ---->|<!--(?:-?[^>-])(?:-?[^-])*-->/,sl="</p><p>";function ll(e,t,n){var r=parseInt(e.left,10),i=parseInt(e.top,10),o=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+o&&n>=i&&n<=i+a}var ul="toastui-editor-";function cl(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=[],r=0,i=e;r<i.length;r++){var o=i[r],a=void 0;(a=Array.isArray(o)?o[0]?o[1]:null:o)&&n.push(""+ul+a)}return n.join(" ")}function pl(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.map((function(e){return ul+"md-"+e})).join(" ")}function dl(e){return e&&e.nodeType===Node.ELEMENT_NODE}function fl(e){e.parentNode&&e.parentNode.removeChild(e)}function hl(e,t,n){da(n)&&(n=!Gs(e,t)),(n?xa:Na)(e,t)}function ml(e,t){var n=document.createElement("div");ea(e)?n.innerHTML=e:n.appendChild(e);var r=n.firstChild;return t&&t.appendChild(r),r}function vl(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 gl(e,t){var n;for(n=ea(t)?function(e){return Ys(e,t)}:function(e){return e===t};e&&e!==document;){if(dl(e)&&n(e))return e;e=e.parentNode}return null}function yl(e,t){for(var n=0,r=0;e&&e!==t;){if(n+=e.offsetTop,r+=e.offsetLeft,e.offsetParent===t.offsetParent)break;e=e.offsetParent}return{offsetTop:n,offsetLeft:r}}function bl(e,t){Object.keys(e).forEach((function(n){ts(e[n])?t.removeAttribute(n):t.setAttribute(n,e[n])}))}function wl(e){var t=e;return t=(t=t.replace(/<img class="ProseMirror-separator" alt="">/g,"")).replace(/ class="ProseMirror-trailingBreak"/g,"")}var kl=new Dt("widget"),xl=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=gl(e.dom.parentElement,"."+cl("defaultUI"))})),this.eventEmitter.listen("removePopupWidget",this.removeWidget)}return e.prototype.update=function(e){var t=kl.getState(e.state);if(this.removeWidget(),t){var n=t.node,r=t.style,i=e.coordsAtPos(t.pos),o=i.top,a=i.left,s=i.bottom-o,l=this.rootEl.getBoundingClientRect(),u=o-l.top;ua(n,{opacity:"0"}),this.rootEl.appendChild(n),ua(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 Cl(e,t,n){e.emit("addImageBlobHook",t,(function(n,r){e.emit("command","addImage",{imageUrl:n,altText:r||t.name||"image"})}),n)}function Tl(e){var t=ds(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}function El(e){var t=e.eventEmitter;return new Mt({props:{handleDOMEvents:{drop:function(e,n){var r,i=null===(r=n.dataTransfer)||void 0===r?void 0:r.files;return i&&na(i,(function(e){return-1===e.type.indexOf("image")||(n.preventDefault(),n.stopPropagation(),Cl(t,e,n.type),!1)})),!0}}}})}var Ml=function(){function e(){}return Object.defineProperty(e.prototype,"type",{get:function(){return"node"}
2,enumerable:!1,configurable:!0}),e.prototype.setContext=function(e){this.context=e},e}();function Nl(e){var t=document.createElement("span"),n=qs(e.attrs.info,e.textContent);return t.className="tui-widget",t.appendChild(n),{dom:t}}function Sl(e){return"widget"===e.type.name}var Dl=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Go(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}(Ml),Ll=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 Tt.create({schema:this.schema,plugins:this.createPlugins()})},e.prototype.initEvent=function(){var e=this,t=e.eventEmitter,n=e.view,r=e.editorType;n.dom.addEventListener("focus",(function(){return t.emit("focus",r)})),n.dom.addEventListener("blur",(function(){return t.emit("blur",r)}))},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=this.createInputRules(),r=Ko(Ko([],this.keymaps),[Ji(Jo({"Shift-Enter":ko.Enter},ko)),Uo(),(t=this.placeholder,new Mt({props:{decorations:function(e){var n=e.doc;if(t.text&&1===n.childCount&&n.firstChild.isTextblock&&0===n.firstChild.content.size){var r=document.createElement("span");return xa(r,"placeholder"),t.className&&xa(r,t.className),r.textContent=t.text,ci.create(n,[si.widget(1,r)])}return null}}})),(e=this.eventEmitter,new Mt({key:kl,state:{init:function(){return null},apply:function(e){return e.getMeta("widget")}},view:function(t){return new xl(t,e)}})),El(this.context)]);return n?r.concat(n):r},enumerable:!1,configurable:!0}),e.prototype.createInputRules=function(){var e=zs().map((function(e){var t=e.rule;return new xo(t,(function(e,n,r,i){var o=e.schema,a=e.tr,s=e.doc,l=n.input.match(new RegExp(t,"g")),u=s.resolve(r),c=u.parent,p=0;if(Sl(c)&&(c=u.node(u.depth-1)),c.forEach((function(e){return Sl(e)&&(p+=1)})),l.length>p){var d=rs(l),f=_s(d,o);return a.replaceWith(i-d.length+1,i,f)}return null}))}));return e.length?To({rules:e}):null},e.prototype.clearTimer=function(){this.timer&&(clearTimeout(this.timer),this.timer=null)},e.prototype.createSchema=function(){return new se({nodes:this.specs.nodes,marks:this.specs.marks})},e.prototype.createKeymaps=function(e){var t=$s(),n=t.undo,r=t.redo,i=this.specs.keymaps(e),o={"Mod-z":n(),"Shift-Mod-z":r()};return e?i.concat(Ji(o)):i},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(ms(t,1)).scrollIntoView()),e&&this.focus()},e.prototype.moveCursorToEnd=function(e){var t=this.view.state.tr;this.view.dispatch(t.setSelection(ms(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){ua(this.el,{height:e+"px"})},e.prototype.setMinHeight=function(e){ua(this.el,{minHeight:e+"px"})},e.prototype.getElement=function(){return this.el},e}();var Al=function(e){return e instanceof Function},Ol=["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 Il(e,t,n){return e.focus(),t(n)(e.state,e.dispatch,e)}var Rl=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,i=t.schema;return Jo(Jo({},e),((n={})[r]=i,n))}),{})}
2,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,i=t.schema;return Jo(Jo({},e),((n={})[r]=i,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={},i=n.commands();return Al(i)?r[n.name]=function(t){return Il(e,i,t)}:Object.keys(i).forEach((function(t){r[t]=function(n){return Il(e,i[t],n)}})),Jo(Jo({},t),r)}),{}),r=$s();return Object.keys(r).forEach((function(t){n[t]=function(n){return Il(e,r[t],n)}})),t&&Object.keys(t).forEach((function(r){n[r]=function(n){return Il(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){Wa(Ol,e)||delete t[e]})),Ji(t)}))},e.prototype.setContext=function(e){this.specs.forEach((function(t){t.setContext(e)}))},e}();function Pl(e){var t=e.from,n=e.to;return e instanceof mt?[t+1,n-1]:[t,n]}function Bl(e){return e.index(0)+1}function Fl(e,t,n){void 0===n&&(n=1);var r=0;return e.forEach((function(e,i){Sl(e)&&i+2<t&&(r+=2*n)})),r}function Hl(e,t,n){void 0===n&&(n=t);var r=t===n,i=e.resolve(t),o=Bl(i),a=o,s=i.start(1),l=s;if(!r){var u=e.resolve(n===e.content.size?n-1:n);l=u.start(1),a=Bl(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[[o,c+Fl(e.child(o-1),c,-1)],[a,p+Fl(e.child(a-1),p,-1)]]}function ql(e,t){for(var n=[],r=0,i=0;r<t;r+=1){var o=e.child(r);n[r]=i,i+=o.nodeSize}return n}function zl(e,t,n){var r=ql(e,n[0]),i=t[0]-1,o=n[0]-1,a=e.child(i),s=e.child(o),l=r[i],u=r[o];return l+=t[1]+Fl(a,t[1]-1),u+=n[1]+Fl(s,n[1]-1),[l,Math.min(u,e.content.size)]}function jl(e){var t=e.$from,n=e.$to,r=e.from,i=e.to,o=t.doc;return e instanceof mt&&(t=o.resolve(r+1),n=o.resolve(i-1)),0===t.depth&&(n=t=o.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 Vl(e,t){for(var n=1,r=1,i=0,o=0;i<e.childCount;i+=1){var a=e.child(i).nodeSize;if(n=o+1,r=o+a-1,i===t)break;o+=a}return{startOffset:n,endOffset:r}}var _l="heading",Ul="listItem",$l="link",Zl="code",Wl="meta",Gl="delimiter",Jl="markedText",Kl={strong:2,emph:1,strike:2};function Xl(e,t,n,r){return{start:e,end:t,spec:{type:n,attrs:r}}}function Ql(e,t,n){var r=e.type,i=Ds(t,Kl[r]),o=Ds(n,-Kl[r]);return[Xl(i,o,r),Xl(t,i,Gl),Xl(o,n,Gl)]}function Yl(e,t,n,r){return[Xl(e,t,$l),Xl(Ls(e,n[1]+1),Ls(t,r),$l,{desc:!0}),Xl(Ls(t,r+2),Ds(t,-1),$l,{url:!0})]}function eu(e,t,n,r){var i={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?[Jo(Jo({},i),{end:t,spec:{attrs:{className:r+"-line-background start"}}}),Jo(Jo({},i),{start:[Math.min(t[0]+1,n[0]),t[1]]})]:null}function tu(e,t){for(var n=[];e;){var r=e.type;"paragraph"!==r&&"codeBlock"!==r||n.push(Xl([bs(e),ks(e)-1],[ws(e),xs(e)+1],t)),e=e.next}return n}var nu={heading:function(e,t,n){var r=e.level,i=e.headingType,o=[Xl(t,n,_l,{level:r})];return"atx"===i?o.push(Xl(t,Ds(t,r),Gl)):o.push(Xl(Ls(n,0),n,_l,{seText:!0})),o},strong:Ql,emph:Ql,strike:Ql,link:function(e,t,n){var r=e.lastChild,i=e.extendedAutolink,o=r?xs(r)+1:2;return i?[Xl(t,n,$l,{desc:!0})]:Yl(t,n,t,o)},image:function(e,t,n){var r=e.lastChild,i=r?xs(r)+1:3,o=Ds(t,1);return Ko([Xl(t,o,Wl)],Yl(t,n,o,i))},code:function(e,t,n){var r=e.tickCount,i=Ds(t,r),o=Ds(n,-r);return[Xl(t,n,Zl),Xl(t,i,Zl,{start:!0}),Xl(i,o,Zl,{marked:!0}),Xl(o,n,Zl,{end:!0})]},codeBlock:function(e,t,n,r){var i=e.fenceOffset,o=e.fenceLength,a=e.fenceChar,s=e.info,l=e.infoPadding,u=e.parent,c=i+o,p=[Xl(Ls(t,1),n,"codeBlock")];a&&p.push(Xl(t,Ds(t,c),Gl)),s&&p.push(Xl(Ds(t,o),Ds(t,o+l+s.length),Wl)),new RegExp("^(\\s{0,4})("+a+"{"+o+",})").test(r)&&p.push(Xl(Ls(n,1),n,Gl));var d=eu(u,t,n,"code-block");return d?p.concat(d):p},blockQuote:function(e,t,n){var r=e.parent&&"blockQuote"!==e.parent.type?[Xl(t,n,"blockQuote")]:[];if(e.firstChild){var i=[];"paragraph"===e.firstChild.type?i=function(e){for(var t=[];e;)t.push(Xl([bs(e),ks(e)],[ws(e),xs(e)+1],Jl)),e=e.next;return t}(e.firstChild.firstChild):"list"===e.firstChild.type&&(i=tu(e.firstChild,Jl)),r=Ko(Ko([],r),i)}return r},item:function(e,t){var n=e.listData,r=n.padding,i=n.task,o=function(e){for(var t=0;e.parent.parent&&"item"===e.parent.parent.type;)e=e.parent.parent,t+=1;return[Ul,Jo(Jo({},[{odd:!0},{even:!0}][t%2]),{listStyle:!0})]}(e),a=[Xl.apply(void 0,Ko([t,Ds(t,r)],o))];return i&&(a.push(Xl(Ds(t,r),Ds(t,r+3),"taskDelimiter")),a.push(Xl(Ds(t,r+1),Ds(t,r+2),Wl))),a.concat(tu(e.firstChild,Jl))},customBlock:function(e,t,n){var r=e,i=r.offset,o=r.syntaxLength,a=r.info,s=r.parent,l=i+o,u=[Xl(Ls(t,1),n,"customBlock")];u.push(Xl(t,Ds(t,l),Gl)),a&&u.push(Xl(Ds(t,l),Ds(t,o+a.length),Wl)),u.push(Xl(Ls(n,1),n,Gl));var c=eu(s,t,n,"custom-block");return c?u.concat(c):u}},ru={thematicBreak:"thematicBreak",table:"table",tableCell:"tableCell",htmlInline:"html"};function iu(e,t,n,r){var i=e.type;return Al(nu[i])?nu[i](e,t,n,r):ru[i]?[Xl(t,n,ru[i])]:null}var ou={};function au(e){var t=e.schema,n=e.toastMark;return new Mt({appendTransaction:function(e,r,i){var o=e[0],a=i.tr;if(o.docChanged){var s=[];o.getMeta("editResult").forEach((function(e){var t=e.nodes,r=e.removedNodeRange;if(t.length){s=s.concat(function(e,t){var n=e.doc,r=t[0].sourcepos[0],i=rs(t).sourcepos,o=i[1],a=[r[0],r[1]],s=[o[0],o[1]+1],l=[];return function(e,t,n){var r=[];ou={};for(var i=t[0]-1;i<n[0];i+=1){var o=e.child(i),a=o.attrs.codeEnd,s=o.attrs.codeStart;if(s&&a&&!Wa(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)ou[c]=!0}}}(n,r,o),l.push({start:a,end:s}),l}(a,t));for(var i=0,o=t;i<o.length;i++)for(var l=o[i].walker(),u=l.next();u;){var c=u.node;u.entering&&(s=s.concat(lu(c,n))),u=l.next()}}else if(r)for(var p=a.doc.childCount-1,d=r.line,f=d[0],h=d[1],m=Math.min(f,p),v=Math.min(h,p),g=m;g<=v;g+=1)ou[g]=!0})),function(e,t,n){var r=e.doc,i=t.nodes.paragraph,o=ql(r,r.childCount);
2n.forEach((function(n){var a=n.start,s=n.end,l=n.spec,u=n.lineBackground,c=Math.min(a[0],r.childCount)-1,p=Math.min(s[0],r.childCount)-1,d=r.child(c),f=r.child(p),h=o[c],m=o[p];(h+=a[1]+Fl(d,a[1]-1),m+=s[1]+Fl(f,s[1]-1),l)?u?function(e,t,n,r,i){void 0===i&&(i={});for(var o=r.startIndex,a=r.endIndex,s=r.from,l=r.to,u=!1,c=o;c<=a;c+=1)delete ou[c],u=su(t,c,i);u&&e.setBlockType(s,l,n,i)}(e,r,i,{from:h,to:m,startIndex:c,endIndex:p},l.attrs):e.addMark(h,m,t.mark(l.type,l.attrs)):e.removeMark(h,m)})),function(e,t,n){Object.keys(ou).forEach((function(r){var i=Number(r),o=Math.min(Number(r)+1,e.doc.childCount-1),a=t[i],s=t[o]-1;i===o&&(s+=2),e.setBlockType(a,s,n)}))}(e,o,i)}(a,t,s)}return a.setMeta("widget",o.getMeta("widget"))}})}function su(e,t,n){return Object.keys(n).some((function(r){return n[r]!==e.child(t).attrs[r]}))}function lu(e,t){var n=t.getLineTexts(),r=[bs(e),ks(e)],i=[ws(e),xs(e)+1],o=iu(e,r,i,n[i[0]-1]);return null!==o&&void 0!==o?o:[]}var uu=["taskList","orderedList","bulletList","table","strong","emph","strike","heading","thematicBreak","blockQuote","code","codeBlock","indent","outdent"];function cu(e){var t={indent:{active:!1,disabled:!0},outdent:{active:!1,disabled:!0}},n=!0;return function(e,t,n){for(void 0===n&&(n=!0),e=n?e:e.parent;e&&"document"!==e.type;)t(e),e=e.parent}(e,(function(e){var r=function(e){var t=e.type;return Ts(e)?e.listData.task?"taskList":"ordered"===e.listData.type?"orderedList":"bulletList":-1!==t.indexOf("table")?"table":Wa(uu,t)?t:null}(e);r&&("bulletList"===r||"orderedList"===r?n&&(t[r]={active:!0},t.indent.disabled=!1,t.outdent.disabled=!1,n=!1):t[r]={active:!0})})),t}function pu(e){var t=e.toastMark,n=e.eventEmitter;return new Mt({view:function(){return{update:function(e,r){var i=e.state,o=i.doc,a=i.selection;if(!(r&&r.doc.eq(o)&&r.selection.eq(a))){var s=a.from,l=i.doc.resolve(s).start(),u=s-l;s===l&&(u+=1);var c=[i.doc.content.findIndex(s).index+1,u],p=t.findNodeAtPosition(c),d=cu(p);n.emit("changeToolbarState",{cursorPos:c,mdNode:p,toolbarState:d}),n.emit("setFocusedNode",p)}}}}})}var du=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Go(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}(Ml),fu=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 hu(e,t){return mu(e,t-1)}function mu(e,t){return e.child(t).textContent}var vu=/^\s*> ?/,gu=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Go(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:pl("block-quote")},0]}}},enumerable:!1,configurable:!0}),t.prototype.createBlockQuoteText=function(e,t){return t?e.replace(vu,"").trim():"> "+e.trim()},t.prototype.extendBlockQuote=function(){var e=this;return function(t,n){var r=t.selection,i=t.doc,o=t.tr,a=t.schema,s=jl(r),l=s.endFromOffset,u=s.endToOffset,c=s.endIndex,p=s.to,d=mu(i,c);if(vu.test(d)&&p>l&&r.empty){if(!d.replace(vu,"").trim())o.deleteRange(l,u).split(o.mapping.map(u));else{var f=d.slice(p-l).trim();ys(o,u,f,hs(a,e.createBlockQuoteText(f)))}return n(o),!0}return!1}},t.prototype.commands=function(){var e=this;return function(){return function(t,n){var r=t.selection,i=t.doc,o=jl(r),a=o.startFromOffset,s=o.endToOffset,l=o.startIndex,u=o.endIndex,c=vu.test(mu(i,l)),p=gs({state:t,startIndex:l,endIndex:u,from:a,createText:function(t){return e.createBlockQuoteText(t,c)}});return n(p.setSelection(ms(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}
2(fu),yu=/(^\s*)([-*+] |[\d]+\. )/,bu=/(^\s*)([\d])+\.( \[[ xX]])? /,wu=/^(\s*)((\d+)([.)]\s(?:\[(?:x|\s)\]\s)?))(.*)/,ku=/(^\s*)([-*+]|[\d]+\.)( \[[ xX]])? /,xu=/^(\s*)([-*+]+(\s(?:\[(?:x|\s)\]\s)?))(.*)/,Cu=/(^\s*)([-*+] |[\d]+\. )(\[[ xX]] )/,Tu=/(^\s*)([-*+])( \[[ xX]]) /;function Eu(e){return bu.test(e)?"ordered":"bullet"}function Mu(e){for(var t=0;e&&"document"!==e.type;)"list"===e.type&&(t+=1),e=e.parent;return t}function Nu(e,t,n,r){for(var i=e.getLineTexts().length,o=[],a=t;r?a<i:a>1;){a=r?a+1:a-1;var s=e.findFirstNodeAtLine(a),l=Mu(s);if(l===n)o.push({line:a,depth:n,mdNode:s});else if(l<n)break}return o}function Su(e,t,n,r){void 0===r&&(r=0);var i=Number.MAX_VALUE,o=0,a=t.map((function(t,a){var s=t.line;i=Math.min(s-1,i),o=Math.max(s-1,o);var l=hu(e,s);return l="bullet"===n?function(e){if(!yu.test(e))return"* "+e;var t=Eu(e);return"bullet"===t&&ku.test(e)?e=e.replace(Tu,"$1$2 "):"ordered"===t&&(e=e.replace(bu,"$1* ")),e}(l):function(e,t){if(!yu.test(e))return t+". "+e;var n=Eu(e);if("bullet"===n||"ordered"===n&&ku.test(e))e=e.replace(ku,"$1"+t+". ");else if("ordered"===n){var r=wu.exec(e)[3];Number(r)!==t&&(e=e.replace(bu,"$1"+t+". "))}return e}(l,a+1+r),{text:l,line:s}}));return{changedResults:a,firstIndex:i,lastIndex:o}}function Du(e,t){var n=function(e){var t=e.toastMark,n=e.mdNode,r=e.line,i=Mu(n),o=Nu(t,r,i,!1).reverse(),a=Nu(t,r,i,!0);return o.concat([{line:r,depth:i,mdNode:n}]).concat(a)}(t);return Su(t.doc,n,e)}var Lu={bullet:function(e){return Du("bullet",e)},ordered:function(e){return Du("ordered",e)},task:function(e){var t=e.mdNode,n=e.doc,r=e.line,i=hu(n,r);return t.listData.task?i=i.replace(Cu,"$1$2"):Ts(t)&&(i=i.replace(yu,"$1$2[ ] ")),{changedResults:[{text:i,line:r}]}}},Au={bullet:function(e){var t=e.doc,n=e.line;return{changedResults:[{text:"* "+hu(t,n),line:n}]}},ordered:function(e){for(var t=e.toastMark,n=e.doc,r=e.line,i=e.startLine,o=hu(n,r),a=1,s=i,l=0,u=i-1;u>0;u-=1){var c=t.findFirstNodeAtLine(u),p=hu(n,u)&&!!Ss(c,(function(e){return Ts(e)})),d=wu.exec(hu(n,u));if(!d&&!p)break;if(d||!p){var f=d,h=f[1],m=f[3];if(!h){a=Number(m),s=u;break}}else l+=1}return{changedResults:[{text:a+r-s-l+". "+o,line:r}]}},task:function(e){var t=e.doc,n=e.line;return{changedResults:[{text:"* [ ] "+hu(t,n),line:n}]}}},Ou={bullet:function(e){var t=e.line,n=hu(e.doc,t),r=xu.exec(n);return{listSyntax:""+r[1]+r[2]}},ordered:function(e){var t=e.toastMark,n=e.line,r=e.mdNode,i=e.doc,o=Mu(r),a=hu(i,n),s=wu.exec(a),l=s[1],u=s[3],c=s[4],p=Number(u)+1,d=""+l+p+c,f=Nu(t,n,o,!0).filter((function(e){var t=wu.exec(hu(i,e.line));return t&&t[1].length===l.length&&!!Ss(e.mdNode,(function(e){return Es(e)}))}));return Jo({listSyntax:d},Su(i,f,"ordered",p))}};function Iu(e,t,n,r,i){for(var o=[],a=hu(e,n),s=wu.exec(a);s;){var l=s[1],u=s[4],c=s[5],p=l.length;if(p===i)o.push(hs(t,""+l+r+u+c)),r+=1,n+=1;else if(p>i){var d=Iu(e,t,n,1,p);n=d.line,o=o.concat(d.nodes)}if(p<i||n>e.childCount)break;a=hu(e,n),s=wu.exec(a)}return{nodes:o,line:n}}var Ru=/(^\s{1,4})(.*)/;function Pu(e,t,n){return e<t||yu.test(n)||vu.test(n)}function Bu(e,t,n){var r=n.$from;0===r.depth&&(r=e.resolve(r.pos-1));var i=r.node(1),o=r.start(1),a=i.content.size;return i.rangeHasMark(0,a,t.marks.table)&&r.pos-o!==a&&r.pos!==o}function Fu(e,t){var n=t.from,r=t.to;if("indent"===t.type){n+=4,r+=4*(t.lineLen+1)}else{var i=t.spaceLenList;n-=i[0];for(var o=0;o<i.length;o+=1)r-=i[o]}return ms(e,n,r)}var Hu=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Go(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:pl(t.className)},0]:["div",0]}}},enumerable:!1,configurable:!0}),t.prototype.reorderList=function(e,t){for(var n=this.context,r=n.view,i=n.toastMark,o=n.schema,a=r.state,s=a.tr,l=a.selection,u=a.doc,c=i.findFirstNodeAtLine(e),p=c;c&&!Ms(c)&&"document"!==c.parent.type;)if(Es(c=c.parent)){p=c;break}p&&(e=p.sourcepos[0][0]);
2var d=wu.exec(hu(u,e)),f=d[1],h=d[3],m=f.length,v=Iu(u,o,e,Number(h),m),g=v.line,y=v.nodes;t=Math.max(t,g-1);for(var b=Vl(u,e-1).startOffset,w=e-1;w<=t-1;w+=1){var k=u.child(w),x=k.nodeSize,C=k.content,T=s.mapping.map(b),E=T+C.size;s.replaceWith(T,E,y[w-e+1]),b+=x}var M=ms(s,l.from,l.to);r.dispatch(s.setSelection(M))},t.prototype.indent=function(e){var t=this;return void 0===e&&(e=!1),function(){return function(n,r){var i=n.schema,o=n.selection,a=n.doc,s=jl(o),l=s.from,u=s.to,c=s.startFromOffset,p=s.startIndex,d=s.endIndex;if(e&&Bu(a,i,o))return!1;var f=mu(a,p);if(e&&Pu(l,u,f)||!e&&yu.test(f)){var h=gs({state:n,from:c,startIndex:p,endIndex:d,createText:function(e){return"    "+e}}),m={type:"indent",from:l,to:u,lineLen:d-p};r(h.setSelection(Fu(h,m))),wu.test(f)&&t.reorderList(p+1,d+1)}else e&&r(n.tr.insert(u,hs(i,"    ")));return!0}}},t.prototype.outdent=function(e){var t=this;return void 0===e&&(e=!1),function(){return function(n,r){var i=n.selection,o=n.doc,a=n.schema,s=jl(i),l=s.from,u=s.to,c=s.startFromOffset,p=s.startIndex,d=s.endIndex;if(e&&Bu(o,a,i))return!1;var f=mu(o,p);if(e&&Pu(l,u,f)||!e&&yu.test(f)){var h=[],m=gs({state:n,from:c,startIndex:p,endIndex:d,createText:function(e){var t=Ru.exec(e);return h.push(t?t[1].length:0),e.replace(Ru,"$2")}}),v={type:"outdent",from:l,to:u,spaceLenList:h};r(m.setSelection(Fu(m,v))),wu.test(f)&&t.reorderList(p+1,d+1)}else if(e){var g=f.slice(0,u-c),y=g.replace(/\s{1,4}$/,""),b=u-(g.length-y.length);r(n.tr.delete(b,u))}return!0}}},t.prototype.deleteLines=function(){var e=this;return function(t,n){var r=e.context.view,i=jl(t.selection),o=i.startFromOffset,a=i.endToOffset;return mo((function(){return n(t.tr.deleteRange(o,a)),!0}),eo)(t,n,r)}},t.prototype.moveDown=function(){return function(e,t){var n=e.doc,r=e.tr,i=e.selection,o=e.schema,a=jl(i),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,hs(o,d)),t(r),!0}return!1}},t.prototype.moveUp=function(){return function(e,t){var n=e.tr,r=e.doc,i=e.selection,o=e.schema,a=jl(i),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),hs(o,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}(Ml),qu=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Go(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}(Ml),zu=/^#{1,6}\s/,ju=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Go(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="heading|heading"+t.level;return t.seText&&(n+="|delimiter|setext"),["span",{class:pl.apply(void 0,n.split("|"))},0]}}},enumerable:!1,configurable:!0}),t.prototype.createHeadingText=function(e,t,n){for(var r=t.replace(n,"").trim(),i="";e>0;)i+="#",e-=1;return i+" "+r},t.prototype.commands=function(){var e=this;return function(t){return function(n,r){var i=t.level,o=jl(n.selection),a=o.startFromOffset,s=o.endToOffset,l=gs({state:n,from:a,startIndex:o.startIndex,endIndex:o.endIndex,createText:function(t){var n=t.match(zu),r=n?n[0]:"";return e.createHeadingText(i,t,r)}});return r(l.setSelection(ms(l,l.mapping.map(s)))),!0}}},t}(fu),Vu="```",_u=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Go(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"codeBlock"}
2,enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return{toDOM:function(){return["span",{class:pl("code-block")},0]}}},enumerable:!1,configurable:!0}),t.prototype.commands=function(){return function(){return function(e,t){var n=e.selection,r=e.schema,i=e.tr,o=jl(n),a=o.startFromOffset,s=o.endToOffset,l=hs(r,Vu);return i.insert(a,l).split(a+3),i.split(i.mapping.map(s)).insert(i.mapping.map(s),l),t(i.setSelection(ms(i,i.mapping.map(s)-5))),!0}}},t.prototype.keepIndentation=function(){var e=this;return function(t,n){var r=t.selection,i=t.tr,o=t.doc,a=t.schema,s=e.context.toastMark,l=jl(r),u=l.startFromOffset,c=l.endToOffset,p=l.endIndex,d=l.from,f=l.to,h=mu(o,p);if(d===f&&h.trim()){var m=h.match(/^\s+/);if(function(e){return e&&"codeBlock"===e.type}(s.findFirstNodeAtLine(p+1))&&m){var v=m[0],g=h.slice(f-u);return ys(i,c,g,hs(a,v+g)),n(i),!0}}return!1}},t.prototype.keymaps=function(){var e=this.commands()();return{"Shift-Mod-p":e,"Shift-Mod-P":e,Enter:this.keepIndentation()}},t}(fu),Uu=/\||\s/g;function $u(e,t){for(var n="|",r=0;r<e;r+=1)n+=t?" --- |":"  |";return n}var Zu=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Go(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:pl("table")},0]}}},enumerable:!1,configurable:!0}),t.prototype.extendTable=function(){var e=this;return function(t,n){var r=t.selection,i=t.doc,o=t.tr,a=t.schema;if(!r.empty)return!1;var s=jl(r),l=s.endFromOffset,u=s.endToOffset,c=s.endIndex,p=s.to,d=mu(i,c),f=[c+1,p-l+1],h=Ss(e.context.toastMark.findNodeAtPosition(f),(function(e){return Ns(e)&&("tableDelimRow"===e.parent.type||"tableBody"===e.parent.parent.type)}));if(h){var m=!d.replace(Uu,"").trim(),v=$u(h.parent.parent.parent.columns.length);return m?o.deleteRange(l,u).split(o.mapping.map(u)):o.split(u).insert(o.mapping.map(u),hs(a,v)).setSelection(ms(o,o.mapping.map(u)-2)),n(o),!0}return!1}},t.prototype.moveTableCell=function(e){var t=this;return function(n,r){var i=n.selection,o=n.tr,a=jl(i),s=a.endFromOffset,l=[a.endIndex+1,a.to-s],u=Ss(t.context.toastMark.findNodeAtPosition(l),(function(e){return Ns(e)}));if(u){var c=u.parent,p=function(e){return e?{type:"next",parentType:"tableHead",childType:"firstChild"}:{type:"prev",parentType:"tableBody",childType:"lastChild"}}(e),d=p.type,f=p.parentType,h=p.childType,m=xs(u);if(u[d])m=xs(u[d])-1;else{var v=c[d]||c.parent.type!==f?c[d]:c.parent[d][h];if("next"===d)m+=(v?xs(v[h]):0)+2;else"prev"===d&&(m=v?-4:0)}return r(o.setSelection(ms(o,s+m))),!0}return!1}},t.prototype.addTable=function(){return function(e){return function(t,n){var r=t.selection,i=t.tr,o=t.schema,a=e,s=a.columnCount,l=a.rowCount,u=jl(r).endToOffset,c=function(e){return[$u(e),$u(e,!0)]}(s),p=function(e,t){for(var n=[],r=0;r<t;r+=1)n.push($u(e));return n}(s,l-1);return Ko(Ko([],c),p).forEach((function(e){i.split(i.mapping.map(u)).insert(i.mapping.map(u),hs(o,e))})),n(i.setSelection(ms(i,u+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}(fu),Wu=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Go(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:pl("thematic-break")},0]}}},enumerable:!1,configurable:!0}),t.prototype.hr=function(){return function(){return function(e,t){var n=e.selection,r=e.schema,i=e.tr,o=jl(n),a=o.from,s=o.to,l=o.endToOffset,u=hs(r,"***");return i.split(a).replaceWith(i.mapping.map(a),i.mapping.map(s),u).split(i.mapping.map(s)).setSelection(ms(i,i.mapping.map(l))),t(i),!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}(fu);function Gu(e,t){var n=e.type;return t<=e.sourcepos[0][0]&&("codeBlock"===n||"heading"===n||n.match("table"))}var Ju=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Go(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"listItem"}
2,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,i="list-item";return t.listStyle&&(i+="|list-item-style"),n&&(i+="|list-item-odd"),r&&(i+="|list-item-even"),["span",{class:pl.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,i=t.doc,o=t.schema,a=t.tr,s=e.context.toastMark,l=jl(r),u=l.to,c=l.startFromOffset,p=l.endFromOffset,d=l.endIndex,f=l.endToOffset,h=mu(i,d);if(!yu.test(h)||r.from===c||!r.empty)return!1;if(!h.replace(ku,"").trim())a.deleteRange(p,f).split(a.mapping.map(f));else{var m=Eu(h),v=s.findFirstNodeAtLine(d+1),g=h.slice(u-p),y={toastMark:s,mdNode:v,doc:i,line:d+1},b=Ou[m](y),w=b.listSyntax,k=b.changedResults;if(null===k||void 0===k?void 0:k.length){a.split(u),k.unshift({text:w+g,line:d+1}),e.changeToListPerLine(a,k,{from:u,startLine:k[0].line,endLine:rs(k).line});var x=a.mapping.map(f)-g.length;a.setSelection(ms(a,x))}else{ys(a,f,g,hs(o,w+g))}}return n(a),!0}},t.prototype.toList=function(e){var t=this;return function(){return function(n,r){for(var i=n.doc,o=n.tr,a=n.selection,s=t.context.toastMark,l=jl(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&&Gu(h,f))break;if(-1===d.indexOf(f)){var m={toastMark:s,mdNode:h,doc:i,line:f,startLine:u},v=(Ts(h)?Lu[e](m):Au[e](m)).changedResults,g=t.changeToListPerLine(o,v,{from:Vl(i,v[0].line-1).startOffset,startLine:v[0].line,endLine:rs(v).line,indexDiff:1});p=Math.max(g,p),v&&(d=d.concat(v.map((function(e){return e.line}))))}}return r(o.setSelection(ms(o,o.mapping.map(p)))),!0}}},t.prototype.changeToListPerLine=function(e,t,n){for(var r=n.from,i=n.startLine,o=n.endLine,a=n.indexDiff,s=void 0===a?0:a,l=0,u=function(n){var i=e.doc.child(n),o=i.nodeSize,a=i.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,hs(c.context.schema,d.text)),l=Math.max(l,r+a.size)),r+=o},c=this,p=i-s;p<=o-s;p+=1)u(p);return l},t.prototype.toggleTask=function(){var e=this;return function(t,n){for(var r=t.selection,i=t.tr,o=t.doc,a=t.schema,s=e.context.toastMark,l=jl(r),u=l.startIndex,c=l.endIndex,p=null,d=u;d<=c;d+=1){var f=s.findFirstNodeAtLine(d+1);if(Ts(f)&&f.listData.task){var h=f.listData,m=h.checked,v=h.padding,g=m?" ":"x",y=f.sourcepos[0],b=Vl(o,y[0]-1).startOffset;b+=y[1]+v,p=i.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}(fu);function Ku(e,t){return function(){return function(n,r){var i=n.tr,o=n.selection,a=Al(e)?e:function(t){return e.test(t)},s=t.length,l=i.doc,u=Pl(o),c=u[0],p=u[1],d=Math.max(c-s,1),f=Math.min(p+s,l.content.size-1),h=o.content(),m=h.content.textBetween(0,h.content.size,"\n"),v=l.textBetween(d,c,"\n"),g=l.textBetween(p,f,"\n");if(m=""+v+m+g,v&&g&&a(m))i.delete(f-s,f).delete(d,d+s);else{i.insertText(t,p).insertText(t,c);var y=o.empty?ms(i,c+s):ms(i,c+s,p+s);i.setSelection(y)}return r(i),!0}}}var Xu=/^(\*{2}|_{2}).*([\s\S]*)\1$/m,Qu=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Go(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:pl("strong")},0]}}},enumerable:!1,configurable:!0}),t.prototype.bold=function(){return Ku(Xu,"**")},t.prototype.commands=function(){return{bold:this.bold()}},t.prototype.keymaps=function(){var e=this.bold()();return{"Mod-b":e,"Mod-B":e}},t}(fu),Yu=/^(~{2}).*([\s\S]*)\1$/m,ec=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Go(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"strike"}
2,enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return{toDOM:function(){return["span",{class:pl("strike")},0]}}},enumerable:!1,configurable:!0}),t.prototype.commands=function(){return Ku(Yu,"~~")},t.prototype.keymaps=function(){var e=this.commands()();return{"Mod-s":e,"Mod-S":e}},t}(fu),tc=/^(\*|_).*([\s\S]*)\1$/m,nc=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Go(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:pl("emph")},0]}}},enumerable:!1,configurable:!0}),t.prototype.italic=function(){return Ku(tc,"*")},t.prototype.commands=function(){return{italic:this.italic()}},t.prototype.keymaps=function(){var e=this.italic()();return{"Mod-i":e,"Mod-I":e}},t}(fu),rc=/^(`).*([\s\S]*)\1$/m,ic=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Go(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="code";return t.start&&(n+="|delimiter|start"),t.end&&(n+="|delimiter|end"),t.marked&&(n+="|marked-text"),["span",{class:pl.apply(void 0,n.split("|"))},0]}}},enumerable:!1,configurable:!0}),t.prototype.commands=function(){return Ku(rc,"`")},t.prototype.keymaps=function(){var e=this.commands()();return{"Shift-Mod-c":e,"Shift-Mod-C":e}},t}(fu),oc=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Go(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}},toDOM:function(e){var t=e.attrs,n="link";return t.url&&(n+="|link-url|marked-text"),t.desc&&(n+="|link-desc|marked-text"),["span",{class:pl.apply(void 0,n.split("|"))},0]}}},enumerable:!1,configurable:!0}),t.prototype.addLinkOrImage=function(e){return function(t){return function(n,r){var i=n.selection,o=n.tr,a=n.schema,s=Pl(i),l=s[0],u=s[1],c=t,p=c.linkText,d=c.altText,f=c.linkUrl,h=c.imageUrl,m=p,v=f,g="";return"image"===e&&(m=d,v=h,g="!"),g+="["+(m=Qa(m))+"]("+v+")",r(o.replaceWith(l,u,hs(a,g))),!0}}},t.prototype.commands=function(){return{addImage:this.addLinkOrImage("image"),addLink:this.addLinkOrImage("link")}},t}(fu),ac=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Go(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:pl("delimiter","list-item")},0]}}},enumerable:!1,configurable:!0}),t}(fu),sc=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Go(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:pl("delimiter")},0]}}},enumerable:!1,configurable:!0}),t}(fu),lc=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Go(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:pl("meta")},0]}}},enumerable:!1,configurable:!0}),t}(fu),uc=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Go(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:pl("marked-text")},0]}}},enumerable:!1,configurable:!0}),t}(fu),cc=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Go(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"tableCell"}
2,enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return{toDOM:function(){return["span",{class:pl("table-cell")},0]}}},enumerable:!1,configurable:!0}),t}(fu),pc=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Go(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:pl("html")},0]}}},enumerable:!1,configurable:!0}),t}(fu),dc="$$",fc=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Go(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:pl("custom-block")},0]}}},enumerable:!1,configurable:!0}),t.prototype.commands=function(){return function(e){return function(t,n){var r=t.selection,i=t.schema,o=t.tr,a=jl(r),s=a.startFromOffset,l=a.endToOffset;if(!(null===e||void 0===e?void 0:e.info))return!1;var u="$$"+e.info,c=hs(i,u),p=hs(i,dc);return o.insert(s,c).split(s+u.length),o.split(o.mapping.map(l)).insert(o.mapping.map(l),p),n(o.setSelection(ms(o,o.mapping.map(l)-4))),!0}}},t}(fu),hc=/x|backspace/i,mc=/^\[(\s*)(x?)(\s*)\](?:\s+)/i;function vc(e){var t=e.schema,n=e.toastMark;return new Mt({props:{handleDOMEvents:{keyup:function(e,r){var i,o=e.state,a=o.doc,s=o.tr,l=o.selection;if(l.empty&&hc.test(r.key)){var u=jl(l),c=u.startIndex,p=u.startFromOffset,d=[c+1,u.from-p+1],f=Ss(n.findNodeAtPosition(d),(function(e){var t;return"paragraph"===e.type&&"item"===(null===(t=e.parent)||void 0===t?void 0:t.type)}));if(null===(i=null===f||void 0===f?void 0:f.firstChild)||void 0===i?void 0:i.literal){var h=f.firstChild,m=h.literal.match(mc);if(m){var v=h.sourcepos[0],g=m[1],y=m[2],b=m[3],w=g.length+b.length,k=Vl(a,v[0]-1).startOffset,x=v[1]+k;if(y){var C=w?w+1:0;s.replaceWith(x,C+x,t.text(y)),e.dispatch(s)}else w||(s.insertText(" ",x),e.dispatch(s))}}}return!1}}}})}var gc="cut",yc=/\r\n|\n|\r/,bc=function(e){function t(t,n){var r=e.call(this,t)||this,i=n.toastMark,o=n.useCommandShortcut,a=void 0===o||o,s=n.mdPlugins,l=void 0===s?[]:s;return r.editorType="markdown",r.el.classList.add("md-mode"),r.toastMark=i,r.extraPlugins=l,r.specs=r.createSpecs(),r.schema=r.createSchema(),r.context=r.createContext(),r.keymaps=r.createKeymaps(a),r.view=r.createView(),r.commands=r.createCommands(),r.specs.setContext(Jo(Jo({},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 Go(t,e),t.prototype.toggleActive=function(e,t){hl(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=cl("pseudo-clipboard"),this.clipboard.addEventListener("paste",(function(t){var n=t.clipboardData||window.clipboardData,r=n&&n.items;if(r){var i=ds(r).some((function(e){return"string"===e.kind&&"text/rtf"===e.type}));if(!i){var o=Tl(r);o&&(t.preventDefault(),Cl(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 Rl([new du,new Hu,new Dl,new qu,new ju,new gu,new _u,new fc,new Zu,new cc,new Wu,new Ju,new Qu,new ec,new nc,new ic,new oc,new sc,new ac,new uc,new lc,new pc])},t.prototype.createPlugins=function(){return Ko([au(this.context),pu(this.context),vc(this.context)],this.createPluginProps()).concat(this.defaultPlugins)},t.prototype.createView=function(){var e=this;return new Oi(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,gc)},scroll:function(){return e.eventEmitter.emit("scroll","editor"),!0},keyup:function(t,n){return e.eventEmitter.emit("keyup",e.editorType,n),!1}},nodeViews:{widget:Nl}})},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,i=n.tr;if(r.empty)return!0;var o=this.getChanged(r.content());return e.clipboardData?e.clipboardData.setData("text/plain",o):window.clipboardData.setData("Text",o),t===gc&&this.view.dispatch(i.deleteSelection().scrollIntoView().setMeta("uiEvent",gc)),!0},t.prototype.updateMarkdown=function(e){var t=this;e.docChanged&&e.steps.forEach((function(n,r){if(n.slice&&!(n instanceof He)){var i=e.docs[r],o=[n.from,n.to],a=Hl(i,o[0],o[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=zl(n.doc,e,t),i=r[0],o=r[1];this.view.dispatch(n.setSelection(ms(n,i,o)).scrollIntoView())},t.prototype.replaceSelection=function(e,t,n){var r,i=this.view.state,o=i.tr,a=i.schema,s=i.doc,l=e.split(yc).map((function(e){return fs(a,_s(e,a))})),u=new T(y.from(l),1,1);if(this.focus(),t&&n){var c=zl(s,t,n),p=c[0],d=c[1];r=o.replaceRange(p,d,u)}else r=o.replaceSelection(u);this.view.dispatch(r.scrollIntoView())},t.prototype.deleteSelection=function(e,t){var n,r=this.view.state,i=r.tr,o=r.doc;if(e&&t){var a=zl(o,e,t),s=a[0],l=a[1];n=i.deleteRange(s,l)}else n=i.deleteSelection();this.view.dispatch(n.scrollIntoView())},t.prototype.getSelectedText=function(e,t){var n=this.view.state,r=n.doc,i=n.selection,o=i.from,a=i.to;if(e&&t){var s=zl(r,e,t);o=s[0],a=s[1]}return r.textBetween(o,a,"\n")},t.prototype.getSelection=function(){var e=this.view.state.selection,t=e.from,n=e.to;return Hl(this.view.state.tr.doc,t,n)},t.prototype.setMarkdown=function(e,t){void 0===t&&(t=!0);var n=e.split(yc),r=this.view.state,i=r.tr,o=r.doc,a=r.schema,s=n.map((function(e){return fs(a,_s(e,a))}));this.view.dispatch(i.replaceWith(0,o.content.size,s)),t&&this.moveCursorToEnd(!0)},t.prototype.addWidget=function(e,t,n){var r=this.view.state,i=r.tr,o=r.doc,a=r.selection,s=n?zl(o,n,n)[0]:a.to;this.view.dispatch(i.setMeta("widget",{pos:s,node:e,style:t}))},t.prototype.replaceWithWidget=function(e,t,n){var r=this.view.state,i=r.tr,o=r.schema,a=zl(r.doc,e,t),s=_s(n,o);this.view.dispatch(i.replaceWith(a[0],a[1],s))},t.prototype.getRangeInfoOfNode=function(e){var t=this.view.state,n=t.doc,r=t.selection,i=e||Hl(n,r.from)[0],o=this.toastMark.findNodeAtPosition(i);return"text"===o.type&&"paragraph"!==o.parent.type&&(o=o.parent),o.sourcepos[1][1]+=1,{range:o.sourcepos,type:o.type}},t.prototype.getMarkdown=function(){return this.toastMark.getLineTexts().map((function(e){return Fs(e)})).join("\n")},t.prototype.getToastMark=function(){return this.toastMark},t}(Ll),wc="_feEventKey";var kc=function(e,t){var n,r=e[wc];return r||(r=e[wc]={}),(n=r[t])||(n=r[t]=[]),n},xc=ea,Cc=aa,Tc=kc;function Ec(e,t,n){var r,i=Tc(e,t);n?(Cc(i,(function(i,o){return n!==i.handler||(Mc(e,t,i.wrappedHandler),r=o,!1)})),i.splice(r,1)):(Cc(i,(function(n){Mc(e,t,n.wrappedHandler)})),i.splice(0,i.length))}function Mc(e,t,n){"removeEventListener"in e?e.removeEventListener(t,n):"detachEvent"in e&&e.detachEvent("on"+t,n)}var Nc=function(e,t,n){xc(t)?Cc(t.split(/\s+/g),(function(t){Ec(e,t,n)})):Cc(t,(function(t,n){Ec(e,n,t)}))},Sc=ea,Dc=aa,Lc=kc;function Ac(e,t,n,r){function i(t){n.call(r||e,t||window.event)}"addEventListener"in e?e.addEventListener(t,i):"attachEvent"in e&&e.attachEvent("on"+t,i),function(e,t,n,r){var i=Lc(e,t),o=!1;Dc(i,(function(e){return e.handler!==n||(o=!0,!1)})),o||i.push({handler:n,wrappedHandler:r})}(e,t,n,i)}var Oc=function(e,t,n,r){Sc(t)?Dc(t.split(/\s+/g),(function(t){Ac(e,t,n,r)})):Dc(t,(function(t,r){Ac(e,r,t,n)}))}
2,Ic=function(e,t){return Ic=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])},Ic(e,t)};function Rc(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}Ic(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var Pc=function(){return Pc=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Pc.apply(this,arguments)};function Bc(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}var Fc="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window?window:"undefined"!==typeof n.g?n.g:"undefined"!==typeof self?self:{},Hc={};function qc(e,t,n){var r,i,o,a,s,l="";for("string"!==typeof t&&(n=t,t=qc.defaultChars),"undefined"===typeof n&&(n=!0),s=function(e){var t,n,r=Hc[e];if(r)return r;for(r=Hc[e]=[],t=0;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,i=e.length;r<i;r++)if(o=e.charCodeAt(r),n&&37===o&&r+2<i&&/^[0-9a-f]{2}$/i.test(e.slice(r+1,r+3)))l+=e.slice(r,r+3),r+=2;else if(o<128)l+=s[o];else if(o>=55296&&o<=57343){if(o>=55296&&o<=56319&&r+1<i&&(a=e.charCodeAt(r+1))>=56320&&a<=57343){l+=encodeURIComponent(e[r]+e[r+1]),r++;continue}l+="%EF%BF%BD"}else l+=encodeURIComponent(e[r]);return l}qc.defaultChars=";/?:@&=+$,-_.!~*'()#",qc.componentChars="-_.!~*'()";var zc=qc,jc={},Vc={},_c={Aacute:"\xc1",aacute:"\xe1",Abreve:"\u0102",abreve:"\u0103",ac:"\u223e",acd:"\u223f",acE:"\u223e\u0333",Acirc:"\xc2",acirc:"\xe2",acute:"\xb4",Acy:"\u0410",acy:"\u0430",AElig:"\xc6",aelig:"\xe6",af:"\u2061",Afr:"\ud835\udd04",afr:"\ud835\udd1e",Agrave:"\xc0",agrave:"\xe0",alefsym:"\u2135",aleph:"\u2135",Alpha:"\u0391",alpha:"\u03b1",Amacr:"\u0100",amacr:"\u0101",amalg:"\u2a3f",amp:"&",AMP:"&",andand:"\u2a55",And:"\u2a53",and:"\u2227",andd:"\u2a5c",andslope:"\u2a58",andv:"\u2a5a",ang:"\u2220",ange:"\u29a4",angle:"\u2220",angmsdaa:"\u29a8",angmsdab:"\u29a9",angmsdac:"\u29aa",angmsdad:"\u29ab",angmsdae:"\u29ac",angmsdaf:"\u29ad",angmsdag:"\u29ae",angmsdah:"\u29af",angmsd:"\u2221",angrt:"\u221f",angrtvb:"\u22be",angrtvbd:"\u299d",angsph:"\u2222",angst:"\xc5",angzarr:"\u237c",Aogon:"\u0104",aogon:"\u0105",Aopf:"\ud835\udd38",aopf:"\ud835\udd52",apacir:"\u2a6f",ap:"\u2248",apE:"\u2a70",ape:"\u224a",apid:"\u224b",apos:"'",ApplyFunction:"\u2061",approx:"\u2248",approxeq:"\u224a",Aring:"\xc5",aring:"\xe5",Ascr:"\ud835\udc9c",ascr:"\ud835\udcb6",Assign:"\u2254",ast:"*",asymp:"\u2248",asympeq:"\u224d",Atilde:"\xc3",atilde:"\xe3",Auml:"\xc4",auml:"\xe4",awconint:"\u2233",awint:"\u2a11",backcong:"\u224c",backepsilon:"\u03f6",backprime:"\u2035",backsim:"\u223d",backsimeq:"\u22cd",Backslash:"\u2216",Barv:"\u2ae7",barvee:"\u22bd",barwed:"\u2305",Barwed:"\u2306",barwedge:"\u2305",bbrk:"\u23b5",bbrktbrk:"\u23b6",bcong:"\u224c",Bcy:"\u0411",bcy:"\u0431",bdquo:"\u201e",becaus:"\u2235",because:"\u2235",Because:"\u2235",bemptyv:"\u29b0",bepsi:"\u03f6",bernou:"\u212c",Bernoullis:"\u212c",Beta:"\u0392",beta:"\u03b2",beth:"\u2136",between:"\u226c",Bfr:"\ud835\udd05",bfr:"\ud835\udd1f",bigcap:"\u22c2",bigcirc:"\u25ef",bigcup:"\u22c3",bigodot:"\u2a00",bigoplus:"\u2a01",bigotimes:"\u2a02",bigsqcup:"\u2a06",bigstar:"\u2605",bigtriangledown:"\u25bd",bigtriangleup:"\u25b3",biguplus:"\u2a04",bigvee:"\u22c1",bigwedge:"\u22c0",bkarow:"\u290d",blacklozenge:"\u29eb",blacksquare:"\u25aa",blacktriangle:"\u25b4",blacktriangledown:"\u25be",blacktriangleleft:"\u25c2",blacktriangleright:"\u25b8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20e5",bnequiv:"\u2261\u20e5",bNot:"\u2aed",bnot:"\u2310",Bopf:"\ud835\udd39",bopf:"\ud835\udd53",bot:"\u22a5",bottom:"\u22a5",bowtie:"\u22c8",boxbox:"\u29c9",boxdl:"\u2510",boxdL:"\u2555",boxDl:"\u2556",boxDL:"\u2557",boxdr:"\u250c",boxdR:"\u2552",boxDr:"\u2553",boxDR:"\u2554",boxh:"\u2500",boxH:"\u2550",boxhd:"\u252c",boxHd:"\u2564",boxhD:"\u2565",boxHD:"\u2566",boxhu:"\u2534",boxHu:"\u2567",boxhU:"\u2568",boxHU:"\u2569",boxminus:"\u229f",boxplus:"\u229e",boxtimes:"\u22a0",boxul:"\u2518",boxuL:"\u255b",boxUl:"\u255c",boxUL:"\u255d",boxur:"\u2514",boxuR:"\u2558",boxUr:"\u2559",boxUR:"\u255a",boxv:"\u2502",boxV:"\u2551",boxvh:"\u253c",boxvH:"\u256a",boxVh:"\u256b",boxVH:"\u256c",boxvl:"\u2524",boxvL:"\u2561",boxVl:"\u2562",boxVL:"\u2563",boxvr:"\u251c",boxvR:"\u255e",boxVr:"\u255f",boxVR:"\u2560",bprime:"\u2035",breve:"\u02d8",Breve:"\u02d8",brvbar:"\xa6",bscr:"\ud835\udcb7",Bscr:"\u212c",bsemi:"\u204f",bsim:"\u223d",bsime:"\u22cd",bsolb:"\u29c5",bsol:"\\",bsolhsub:"\u27c8",bull:"\u2022",bullet:"\u2022",bump:"\u224e",bumpE:"\u2aae",bumpe:"\u224f",Bumpeq:"\u224e",bumpeq:"\u224f",Cacute:"\u0106",cacute:"\u0107",capand:"\u2a44",capbrcup:"\u2a49",capcap:"\u2a4b",cap:"\u2229",Cap:"\u22d2",capcup:"\u2a47",capdot:"\u2a40",CapitalDifferentialD:"\u2145",caps:"\u2229\ufe00",caret:"\u2041",caron:"\u02c7",Cayleys:"\u212d",ccaps:"\u2a4d",Ccaron:"\u010c",ccaron:"\u010d",Ccedil
2:"\xc7",ccedil:"\xe7",Ccirc:"\u0108",ccirc:"\u0109",Cconint:"\u2230",ccups:"\u2a4c",ccupssm:"\u2a50",Cdot:"\u010a",cdot:"\u010b",cedil:"\xb8",Cedilla:"\xb8",cemptyv:"\u29b2",cent:"\xa2",centerdot:"\xb7",CenterDot:"\xb7",cfr:"\ud835\udd20",Cfr:"\u212d",CHcy:"\u0427",chcy:"\u0447",check:"\u2713",checkmark:"\u2713",Chi:"\u03a7",chi:"\u03c7",circ:"\u02c6",circeq:"\u2257",circlearrowleft:"\u21ba",circlearrowright:"\u21bb",circledast:"\u229b",circledcirc:"\u229a",circleddash:"\u229d",CircleDot:"\u2299",circledR:"\xae",circledS:"\u24c8",CircleMinus:"\u2296",CirclePlus:"\u2295",CircleTimes:"\u2297",cir:"\u25cb",cirE:"\u29c3",cire:"\u2257",cirfnint:"\u2a10",cirmid:"\u2aef",cirscir:"\u29c2",ClockwiseContourIntegral:"\u2232",CloseCurlyDoubleQuote:"\u201d",CloseCurlyQuote:"\u2019",clubs:"\u2663",clubsuit:"\u2663",colon:":",Colon:"\u2237",Colone:"\u2a74",colone:"\u2254",coloneq:"\u2254",comma:",",commat:"@",comp:"\u2201",compfn:"\u2218",complement:"\u2201",complexes:"\u2102",cong:"\u2245",congdot:"\u2a6d",Congruent:"\u2261",conint:"\u222e",Conint:"\u222f",ContourIntegral:"\u222e",copf:"\ud835\udd54",Copf:"\u2102",coprod:"\u2210",Coproduct:"\u2210",copy:"\xa9",COPY:"\xa9",copysr:"\u2117",CounterClockwiseContourIntegral:"\u2233",crarr:"\u21b5",cross:"\u2717",Cross:"\u2a2f",Cscr:"\ud835\udc9e",cscr:"\ud835\udcb8",csub:"\u2acf",csube:"\u2ad1",csup:"\u2ad0",csupe:"\u2ad2",ctdot:"\u22ef",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22de",cuesc:"\u22df",cularr:"\u21b6",cularrp:"\u293d",cupbrcap:"\u2a48",cupcap:"\u2a46",CupCap:"\u224d",cup:"\u222a",Cup:"\u22d3",cupcup:"\u2a4a",cupdot:"\u228d",cupor:"\u2a45",cups:"\u222a\ufe00",curarr:"\u21b7",curarrm:"\u293c",curlyeqprec:"\u22de",curlyeqsucc:"\u22df",curlyvee:"\u22ce",curlywedge:"\u22cf",curren:"\xa4",curvearrowleft:"\u21b6",curvearrowright:"\u21b7",cuvee:"\u22ce",cuwed:"\u22cf",cwconint:"\u2232",cwint:"\u2231",cylcty:"\u232d",dagger:"\u2020",Dagger:"\u2021",daleth:"\u2138",darr:"\u2193",Darr:"\u21a1",dArr:"\u21d3",dash:"\u2010",Dashv:"\u2ae4",dashv:"\u22a3",dbkarow:"\u290f",dblac:"\u02dd",Dcaron:"\u010e",dcaron:"\u010f",Dcy:"\u0414",dcy:"\u0434",ddagger:"\u2021",ddarr:"\u21ca",DD:"\u2145",dd:"\u2146",DDotrahd:"\u2911",ddotseq:"\u2a77",deg:"\xb0",Del:"\u2207",Delta:"\u0394",delta:"\u03b4",demptyv:"\u29b1",dfisht:"\u297f",Dfr:"\ud835\udd07",dfr:"\ud835\udd21",dHar:"\u2965",dharl:"\u21c3",dharr:"\u21c2",DiacriticalAcute:"\xb4",DiacriticalDot:"\u02d9",DiacriticalDoubleAcute:"\u02dd",DiacriticalGrave:"`",DiacriticalTilde:"\u02dc",diam:"\u22c4",diamond:"\u22c4",Diamond:"\u22c4",diamondsuit:"\u2666",diams:"\u2666",die:"\xa8",DifferentialD:"\u2146",digamma:"\u03dd",disin:"\u22f2",div:"\xf7",divide:"\xf7",divideontimes:"\u22c7",divonx:"\u22c7",DJcy:"\u0402",djcy:"\u0452",dlcorn:"\u231e",dlcrop:"\u230d",dollar:"$",Dopf:"\ud835\udd3b",dopf:"\ud835\udd55",Dot:"\xa8",dot:"\u02d9",DotDot:"\u20dc",doteq:"\u2250",doteqdot:"\u2251",DotEqual:"\u2250",dotminus:"\u2238",dotplus:"\u2214",dotsquare:"\u22a1",doublebarwedge:"\u2306",DoubleContourIntegral:"\u222f",DoubleDot:"\xa8",DoubleDownArrow:"\u21d3",DoubleLeftArrow:"\u21d0",DoubleLeftRightArrow:"\u21d4",DoubleLeftTee:"\u2ae4",DoubleLongLeftArrow:"\u27f8",DoubleLongLeftRightArrow:"\u27fa",DoubleLongRightArrow:"\u27f9",DoubleRightArrow:"\u21d2",DoubleRightTee:"\u22a8",DoubleUpArrow:"\u21d1",DoubleUpDownArrow:"\u21d5",DoubleVerticalBar:"\u2225",DownArrowBar:"\u2913",downarrow:"\u2193",DownArrow:"\u2193",Downarrow:"\u21d3",DownArrowUpArrow:"\u21f5",DownBreve:"\u0311",downdownarrows:"\u21ca",downharpoonleft:"\u21c3",downharpoonright:"\u21c2",DownLeftRightVector:"\u2950",DownLeftTeeVector:"\u295e",DownLeftVectorBar:"\u2956",DownLeftVector:"\u21bd",DownRightTeeVector:"\u295f",DownRightVectorBar:"\u2957",DownRightVector:"\u21c1",DownTeeArrow:"\u21a7",DownTee:"\u22a4",drbkarow:"\u2910",drcorn:"\u231f",drcrop:"\u230c",Dscr:"\ud835\udc9f",dscr:"\ud835\udcb9",DScy:"\u0405",dscy:"\u0455",dsol:"\u29f6",Dstrok:"\u0110",dstrok:"\u0111",dtdot:"\u22f1",dtri:"\u25bf",dtrif:"\u25be",duarr:"\u21f5",duhar:"\u296f",dwangle:"\u29a6",DZcy:"\u040f",dzcy:"\u045f",dzigrarr:"\u27ff",Eacute:"\xc9",eacute:"\xe9",easter:"\u2a6e",Ecaron:"\u011a",ecaron:"\u011b",Ecirc:"\xca",ecirc:"\xea",ecir:"\u2256",ecolon:"\u2255",Ecy:"\u042d",ecy:"\u044d",eDDot:"\u2a77",
2Edot:"\u0116",edot:"\u0117",eDot:"\u2251",ee:"\u2147",efDot:"\u2252",Efr:"\ud835\udd08",efr:"\ud835\udd22",eg:"\u2a9a",Egrave:"\xc8",egrave:"\xe8",egs:"\u2a96",egsdot:"\u2a98",el:"\u2a99",Element:"\u2208",elinters:"\u23e7",ell:"\u2113",els:"\u2a95",elsdot:"\u2a97",Emacr:"\u0112",emacr:"\u0113",empty:"\u2205",emptyset:"\u2205",EmptySmallSquare:"\u25fb",emptyv:"\u2205",EmptyVerySmallSquare:"\u25ab",emsp13:"\u2004",emsp14:"\u2005",emsp:"\u2003",ENG:"\u014a",eng:"\u014b",ensp:"\u2002",Eogon:"\u0118",eogon:"\u0119",Eopf:"\ud835\udd3c",eopf:"\ud835\udd56",epar:"\u22d5",eparsl:"\u29e3",eplus:"\u2a71",epsi:"\u03b5",Epsilon:"\u0395",epsilon:"\u03b5",epsiv:"\u03f5",eqcirc:"\u2256",eqcolon:"\u2255",eqsim:"\u2242",eqslantgtr:"\u2a96",eqslantless:"\u2a95",Equal:"\u2a75",equals:"=",EqualTilde:"\u2242",equest:"\u225f",Equilibrium:"\u21cc",equiv:"\u2261",equivDD:"\u2a78",eqvparsl:"\u29e5",erarr:"\u2971",erDot:"\u2253",escr:"\u212f",Escr:"\u2130",esdot:"\u2250",Esim:"\u2a73",esim:"\u2242",Eta:"\u0397",eta:"\u03b7",ETH:"\xd0",eth:"\xf0",Euml:"\xcb",euml:"\xeb",euro:"\u20ac",excl:"!",exist:"\u2203",Exists:"\u2203",expectation:"\u2130",exponentiale:"\u2147",ExponentialE:"\u2147",fallingdotseq:"\u2252",Fcy:"\u0424",fcy:"\u0444",female:"\u2640",ffilig:"\ufb03",fflig:"\ufb00",ffllig:"\ufb04",Ffr:"\ud835\udd09",ffr:"\ud835\udd23",filig:"\ufb01",FilledSmallSquare:"\u25fc",FilledVerySmallSquare:"\u25aa",fjlig:"fj",flat:"\u266d",fllig:"\ufb02",fltns:"\u25b1",fnof:"\u0192",Fopf:"\ud835\udd3d",fopf:"\ud835\udd57",forall:"\u2200",ForAll:"\u2200",fork:"\u22d4",forkv:"\u2ad9",Fouriertrf:"\u2131",fpartint:"\u2a0d",frac12:"\xbd",frac13:"\u2153",frac14:"\xbc",frac15:"\u2155",frac16:"\u2159",frac18:"\u215b",frac23:"\u2154",frac25:"\u2156",frac34:"\xbe",frac35:"\u2157",frac38:"\u215c",frac45:"\u2158",frac56:"\u215a",frac58:"\u215d",frac78:"\u215e",frasl:"\u2044",frown:"\u2322",fscr:"\ud835\udcbb",Fscr:"\u2131",gacute:"\u01f5",Gamma:"\u0393",gamma:"\u03b3",Gammad:"\u03dc",gammad:"\u03dd",gap:"\u2a86",Gbreve:"\u011e",gbreve:"\u011f",Gcedil:"\u0122",Gcirc:"\u011c",gcirc:"\u011d",Gcy:"\u0413",gcy:"\u0433",Gdot:"\u0120",gdot:"\u0121",ge:"\u2265",gE:"\u2267",gEl:"\u2a8c",gel:"\u22db",geq:"\u2265",geqq:"\u2267",geqslant:"\u2a7e",gescc:"\u2aa9",ges:"\u2a7e",gesdot:"\u2a80",gesdoto:"\u2a82",gesdotol:"\u2a84",gesl:"\u22db\ufe00",gesles:"\u2a94",Gfr:"\ud835\udd0a",gfr:"\ud835\udd24",gg:"\u226b",Gg:"\u22d9",ggg:"\u22d9",gimel:"\u2137",GJcy:"\u0403",gjcy:"\u0453",gla:"\u2aa5",gl:"\u2277",glE:"\u2a92",glj:"\u2aa4",gnap:"\u2a8a",gnapprox:"\u2a8a",gne:"\u2a88",gnE:"\u2269",gneq:"\u2a88",gneqq:"\u2269",gnsim:"\u22e7",Gopf:"\ud835\udd3e",gopf:"\ud835\udd58",grave:"`",GreaterEqual:"\u2265",GreaterEqualLess:"\u22db",GreaterFullEqual:"\u2267",GreaterGreater:"\u2aa2",GreaterLess:"\u2277",GreaterSlantEqual:"\u2a7e",GreaterTilde:"\u2273",Gscr:"\ud835\udca2",gscr:"\u210a",gsim:"\u2273",gsime:"\u2a8e",gsiml:"\u2a90",gtcc:"\u2aa7",gtcir:"\u2a7a",gt:">",GT:">",Gt:"\u226b",gtdot:"\u22d7",gtlPar:"\u2995",gtquest:"\u2a7c",gtrapprox:"\u2a86",gtrarr:"\u2978",gtrdot:"\u22d7",gtreqless:"\u22db",gtreqqless:"\u2a8c",gtrless:"\u2277",gtrsim:"\u2273",gvertneqq:"\u2269\ufe00",gvnE:"\u2269\ufe00",Hacek:"\u02c7",hairsp:"\u200a",half:"\xbd",hamilt:"\u210b",HARDcy:"\u042a",hardcy:"\u044a",harrcir:"\u2948",harr:"\u2194",hArr:"\u21d4",harrw:"\u21ad",Hat:"^",hbar:"\u210f",Hcirc:"\u0124",hcirc:"\u0125",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",hercon:"\u22b9",hfr:"\ud835\udd25",Hfr:"\u210c",HilbertSpace:"\u210b",hksearow:"\u2925",hkswarow:"\u2926",hoarr:"\u21ff",homtht:"\u223b",hookleftarrow:"\u21a9",hookrightarrow:"\u21aa",hopf:"\ud835\udd59",Hopf:"\u210d",horbar:"\u2015",HorizontalLine:"\u2500",hscr:"\ud835\udcbd",Hscr:"\u210b",hslash:"\u210f",Hstrok:"\u0126",hstrok:"\u0127",HumpDownHump:"\u224e",HumpEqual:"\u224f",hybull:"\u2043",hyphen:"\u2010",Iacute:"\xcd",iacute:"\xed",ic:"\u2063",Icirc:"\xce",icirc:"\xee",Icy:"\u0418",icy:"\u0438",Idot:"\u0130",IEcy:"\u0415",iecy:"\u0435",iexcl:"\xa1",iff:"\u21d4",ifr:"\ud835\udd26",Ifr:"\u2111",Igrave:"\xcc",igrave:"\xec",ii:"\u2148",iiiint:"\u2a0c",iiint:"\u222d",iinfin:"\u29dc",iiota:"\u2129",IJlig:"\u0132",ijlig:"\u0133",Imacr:"\u012a",imacr:"\u012b",image:"\u2111",ImaginaryI:"\u2148",imagline:"\u2110",imagpart:"\u2111",imath:"\u0131",Im:"\u2111",imof:"\u22b7",imped:"\u01b5",Implies:"\u21d2",incare:"\u2105",in:"\u2208",infin:"\u221e",infintie:"\u29dd",inodot:"\u0131",intcal:"\u22ba",int:"\u222b",Int:"\u222c",integers:"\u2124",Integral:"\u222b",intercal:"\u22ba",Intersection:"\u22c2",intlarhk:"\u2a17",intprod:"\u2a3c",InvisibleComma:"\u2063",InvisibleTimes:"\u2062",IOcy:"\u0401",iocy:"\u0451",Iogon:"\u012e",iogon:"\u012f",Iopf:"\ud835\udd40",iopf:"\ud835\udd5a",Iota:"\u0399",iota:"\u03b9",iprod:"\u2a3c",iquest:"\xbf",iscr:"\ud835\udcbe",Iscr:"\u2110",isin:"\u2208",isindot:"\u22f5",isinE:"\u22f9",isins:"\u22f4",isinsv:"\u22f3",isinv:"\u2208",it:"\u2062",Itilde:"\u0128",itilde:"\u0129",Iukcy:"\u0406",iukcy:"\u0456",Iuml:"\xcf",iuml:"\xef",Jcirc:"\u0134",jcirc:"\u0135",Jcy:"\u0419",jcy:"\u0439",Jfr:"\ud835\udd0d",jfr:"\ud835\udd27",jmath:"\u0237",Jopf:"\ud835\udd41",jopf:"\ud835\udd5b",Jscr:"\ud835\udca5",jscr:"\ud835\udcbf",Jsercy:"\u0408",jsercy:"\u0458",Jukcy:"\u0404",jukcy:"\u0454",Kappa:"\u039a",kappa:"\u03ba",kappav:"\u03f0",Kcedil:"\u0136",kcedil
2:"\u0137",Kcy:"\u041a",kcy:"\u043a",Kfr:"\ud835\udd0e",kfr:"\ud835\udd28",kgreen:"\u0138",KHcy:"\u0425",khcy:"\u0445",KJcy:"\u040c",kjcy:"\u045c",Kopf:"\ud835\udd42",kopf:"\ud835\udd5c",Kscr:"\ud835\udca6",kscr:"\ud835\udcc0",lAarr:"\u21da",Lacute:"\u0139",lacute:"\u013a",laemptyv:"\u29b4",lagran:"\u2112",Lambda:"\u039b",lambda:"\u03bb",lang:"\u27e8",Lang:"\u27ea",langd:"\u2991",langle:"\u27e8",lap:"\u2a85",Laplacetrf:"\u2112",laquo:"\xab",larrb:"\u21e4",larrbfs:"\u291f",larr:"\u2190",Larr:"\u219e",lArr:"\u21d0",larrfs:"\u291d",larrhk:"\u21a9",larrlp:"\u21ab",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21a2",latail:"\u2919",lAtail:"\u291b",lat:"\u2aab",late:"\u2aad",lates:"\u2aad\ufe00",lbarr:"\u290c",lBarr:"\u290e",lbbrk:"\u2772",lbrace:"{",lbrack:"[",lbrke:"\u298b",lbrksld:"\u298f",lbrkslu:"\u298d",Lcaron:"\u013d",lcaron:"\u013e",Lcedil:"\u013b",lcedil:"\u013c",lceil:"\u2308",lcub:"{",Lcy:"\u041b",lcy:"\u043b",ldca:"\u2936",ldquo:"\u201c",ldquor:"\u201e",ldrdhar:"\u2967",ldrushar:"\u294b",ldsh:"\u21b2",le:"\u2264",lE:"\u2266",LeftAngleBracket:"\u27e8",LeftArrowBar:"\u21e4",leftarrow:"\u2190",LeftArrow:"\u2190",Leftarrow:"\u21d0",LeftArrowRightArrow:"\u21c6",leftarrowtail:"\u21a2",LeftCeiling:"\u2308",LeftDoubleBracket:"\u27e6",LeftDownTeeVector:"\u2961",LeftDownVectorBar:"\u2959",LeftDownVector:"\u21c3",LeftFloor:"\u230a",leftharpoondown:"\u21bd",leftharpoonup:"\u21bc",leftleftarrows:"\u21c7",leftrightarrow:"\u2194",LeftRightArrow:"\u2194",Leftrightarrow:"\u21d4",leftrightarrows:"\u21c6",leftrightharpoons:"\u21cb",leftrightsquigarrow:"\u21ad",LeftRightVector:"\u294e",LeftTeeArrow:"\u21a4",LeftTee:"\u22a3",LeftTeeVector:"\u295a",leftthreetimes:"\u22cb",LeftTriangleBar:"\u29cf",LeftTriangle:"\u22b2",LeftTriangleEqual:"\u22b4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVectorBar:"\u2958",LeftUpVector:"\u21bf",LeftVectorBar:"\u2952",LeftVector:"\u21bc",lEg:"\u2a8b",leg:"\u22da",leq:"\u2264",leqq:"\u2266",leqslant:"\u2a7d",lescc:"\u2aa8",les:"\u2a7d",lesdot:"\u2a7f",lesdoto:"\u2a81",lesdotor:"\u2a83",lesg:"\u22da\ufe00",lesges:"\u2a93",lessapprox:"\u2a85",lessdot:"\u22d6",lesseqgtr:"\u22da",lesseqqgtr:"\u2a8b",LessEqualGreater:"\u22da",LessFullEqual:"\u2266",LessGreater:"\u2276",lessgtr:"\u2276",LessLess:"\u2aa1",lesssim:"\u2272",LessSlantEqual:"\u2a7d",LessTilde:"\u2272",lfisht:"\u297c",lfloor:"\u230a",Lfr:"\ud835\udd0f",lfr:"\ud835\udd29",lg:"\u2276",lgE:"\u2a91",lHar:"\u2962",lhard:"\u21bd",lharu:"\u21bc",lharul:"\u296a",lhblk:"\u2584",LJcy:"\u0409",ljcy:"\u0459",llarr:"\u21c7",ll:"\u226a",Ll:"\u22d8",llcorner:"\u231e",Lleftarrow:"\u21da",llhard:"\u296b",lltri:"\u25fa",Lmidot:"\u013f",lmidot:"\u0140",lmoustache:"\u23b0",lmoust:"\u23b0",lnap:"\u2a89",lnapprox:"\u2a89",lne:"\u2a87",lnE:"\u2268",lneq:"\u2a87",lneqq:"\u2268",lnsim:"\u22e6",loang:"\u27ec",loarr:"\u21fd",lobrk:"\u27e6",longleftarrow:"\u27f5",LongLeftArrow:"\u27f5",Longleftarrow:"\u27f8",longleftrightarrow:"\u27f7",LongLeftRightArrow:"\u27f7",Longleftrightarrow:"\u27fa",longmapsto:"\u27fc",longrightarrow:"\u27f6",LongRightArrow:"\u27f6",Longrightarrow:"\u27f9",looparrowleft:"\u21ab",looparrowright:"\u21ac",lopar:"\u2985",Lopf:"\ud835\udd43",lopf:"\ud835\udd5d",loplus:"\u2a2d",lotimes:"\u2a34",lowast:"\u2217",lowbar:"_",LowerLeftArrow:"\u2199",LowerRightArrow:"\u2198",loz:"\u25ca",lozenge:"\u25ca",lozf:"\u29eb",lpar:"(",lparlt:"\u2993",lrarr:"\u21c6",lrcorner:"\u231f",lrhar:"\u21cb",lrhard:"\u296d",lrm:"\u200e",lrtri:"\u22bf",lsaquo:"\u2039",lscr:"\ud835\udcc1",Lscr:"\u2112",lsh:"\u21b0",Lsh:"\u21b0",lsim:"\u2272",lsime:"\u2a8d",lsimg:"\u2a8f",lsqb:"[",lsquo:"\u2018",lsquor:"\u201a",Lstrok:"\u0141",lstrok:"\u0142",ltcc:"\u2aa6",ltcir:"\u2a79",lt:"<",LT:"<",Lt:"\u226a",ltdot:"\u22d6",lthree:"\u22cb",ltimes:"\u22c9",ltlarr:"\u2976",ltquest:"\u2a7b",ltri:"\u25c3",ltrie:"\u22b4",ltrif:"\u25c2",ltrPar:"\u2996",lurdshar:"\u294a",luruhar:"\u2966",lvertneqq:"\u2268\ufe00",lvnE:"\u2268\ufe00",macr:"\xaf",male:"\u2642",malt:"\u2720",maltese:"\u2720",Map:"\u2905",map:"\u21a6",mapsto:"\u21a6",mapstodown:"\u21a7",mapstoleft:"\u21a4",mapstoup:"\u21a5",marker:"\u25ae",mcomma:"\u2a29",Mcy:"\u041c",mcy:"\u043c",mdash:"\u2014",mDDot:"\u223a",measuredangle:"\u2221",MediumSpace:"\u205f",Mellintrf:"\u2133",Mfr:"\ud835\udd10",mfr:"\ud835\udd2a",mho:"\u2127",micro:"\xb5",midast:"*",midcir:"\u2af0",mid:"\u2223",middot:"\xb7",minusb:"\u229f",minu
2s:"\u2212",minusd:"\u2238",minusdu:"\u2a2a",MinusPlus:"\u2213",mlcp:"\u2adb",mldr:"\u2026",mnplus:"\u2213",models:"\u22a7",Mopf:"\ud835\udd44",mopf:"\ud835\udd5e",mp:"\u2213",mscr:"\ud835\udcc2",Mscr:"\u2133",mstpos:"\u223e",Mu:"\u039c",mu:"\u03bc",multimap:"\u22b8",mumap:"\u22b8",nabla:"\u2207",Nacute:"\u0143",nacute:"\u0144",nang:"\u2220\u20d2",nap:"\u2249",napE:"\u2a70\u0338",napid:"\u224b\u0338",napos:"\u0149",napprox:"\u2249",natural:"\u266e",naturals:"\u2115",natur:"\u266e",nbsp:"\xa0",nbump:"\u224e\u0338",nbumpe:"\u224f\u0338",ncap:"\u2a43",Ncaron:"\u0147",ncaron:"\u0148",Ncedil:"\u0145",ncedil:"\u0146",ncong:"\u2247",ncongdot:"\u2a6d\u0338",ncup:"\u2a42",Ncy:"\u041d",ncy:"\u043d",ndash:"\u2013",nearhk:"\u2924",nearr:"\u2197",neArr:"\u21d7",nearrow:"\u2197",ne:"\u2260",nedot:"\u2250\u0338",NegativeMediumSpace:"\u200b",NegativeThickSpace:"\u200b",NegativeThinSpace:"\u200b",NegativeVeryThinSpace:"\u200b",nequiv:"\u2262",nesear:"\u2928",nesim:"\u2242\u0338",NestedGreaterGreater:"\u226b",NestedLessLess:"\u226a",NewLine:"\n",nexist:"\u2204",nexists:"\u2204",Nfr:"\ud835\udd11",nfr:"\ud835\udd2b",ngE:"\u2267\u0338",nge:"\u2271",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2a7e\u0338",nges:"\u2a7e\u0338",nGg:"\u22d9\u0338",ngsim:"\u2275",nGt:"\u226b\u20d2",ngt:"\u226f",ngtr:"\u226f",nGtv:"\u226b\u0338",nharr:"\u21ae",nhArr:"\u21ce",nhpar:"\u2af2",ni:"\u220b",nis:"\u22fc",nisd:"\u22fa",niv:"\u220b",NJcy:"\u040a",njcy:"\u045a",nlarr:"\u219a",nlArr:"\u21cd",nldr:"\u2025",nlE:"\u2266\u0338",nle:"\u2270",nleftarrow:"\u219a",nLeftarrow:"\u21cd",nleftrightarrow:"\u21ae",nLeftrightarrow:"\u21ce",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2a7d\u0338",nles:"\u2a7d\u0338",nless:"\u226e",nLl:"\u22d8\u0338",nlsim:"\u2274",nLt:"\u226a\u20d2",nlt:"\u226e",nltri:"\u22ea",nltrie:"\u22ec",nLtv:"\u226a\u0338",nmid:"\u2224",NoBreak:"\u2060",NonBreakingSpace:"\xa0",nopf:"\ud835\udd5f",Nopf:"\u2115",Not:"\u2aec",not:"\xac",NotCongruent:"\u2262",NotCupCap:"\u226d",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226f",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226b\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2a7e\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224e\u0338",NotHumpEqual:"\u224f\u0338",notin:"\u2209",notindot:"\u22f5\u0338",notinE:"\u22f9\u0338",notinva:"\u2209",notinvb:"\u22f7",notinvc:"\u22f6",NotLeftTriangleBar:"\u29cf\u0338",NotLeftTriangle:"\u22ea",NotLeftTriangleEqual:"\u22ec",NotLess:"\u226e",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226a\u0338",NotLessSlantEqual:"\u2a7d\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2aa2\u0338",NotNestedLessLess:"\u2aa1\u0338",notni:"\u220c",notniva:"\u220c",notnivb:"\u22fe",notnivc:"\u22fd",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2aaf\u0338",NotPrecedesSlantEqual:"\u22e0",NotReverseElement:"\u220c",NotRightTriangleBar:"\u29d0\u0338",NotRightTriangle:"\u22eb",NotRightTriangleEqual:"\u22ed",NotSquareSubset:"\u228f\u0338",NotSquareSubsetEqual:"\u22e2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22e3",NotSubset:"\u2282\u20d2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2ab0\u0338",NotSucceedsSlantEqual:"\u22e1",NotSucceedsTilde:"\u227f\u0338",NotSuperset:"\u2283\u20d2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",nparallel:"\u2226",npar:"\u2226",nparsl:"\u2afd\u20e5",npart:"\u2202\u0338",npolint:"\u2a14",npr:"\u2280",nprcue:"\u22e0",nprec:"\u2280",npreceq:"\u2aaf\u0338",npre:"\u2aaf\u0338",nrarrc:"\u2933\u0338",nrarr:"\u219b",nrArr:"\u21cf",nrarrw:"\u219d\u0338",nrightarrow:"\u219b",nRightarrow:"\u21cf",nrtri:"\u22eb",nrtrie:"\u22ed",nsc:"\u2281",nsccue:"\u22e1",nsce:"\u2ab0\u0338",Nscr:"\ud835\udca9",nscr:"\ud835\udcc3",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22e2",nsqsupe:"\u22e3",nsub:"\u2284",nsubE:"\u2ac5\u0338",nsube:"\u2288",nsubset:"\u2282\u20d2",nsubseteq:"\u2288",nsubseteqq:"\u2ac5\u0338",nsucc:"\u2281",nsucceq:"\u2ab0\u0338",nsup:"\u2285",nsupE:"\u2ac6\u0338",nsupe:"\u2289",nsupset:"\u2283\u20d2",nsupseteq:"\u2289",nsupseteqq:"\u2ac6\u0338",ntgl:"\u2279",Ntilde:"\xd1",ntilde:"\xf1",ntlg:"\u2278",ntriangleleft:"\u22ea",ntrianglelefteq:"\u22ec",ntriangleright:"\u22eb",ntrianglerighteq:"\u22ed",Nu:"\u039d",nu:"\u
203bd",num:"#",numero:"\u2116",numsp:"\u2007",nvap:"\u224d\u20d2",nvdash:"\u22ac",nvDash:"\u22ad",nVdash:"\u22ae",nVDash:"\u22af",nvge:"\u2265\u20d2",nvgt:">\u20d2",nvHarr:"\u2904",nvinfin:"\u29de",nvlArr:"\u2902",nvle:"\u2264\u20d2",nvlt:"<\u20d2",nvltrie:"\u22b4\u20d2",nvrArr:"\u2903",nvrtrie:"\u22b5\u20d2",nvsim:"\u223c\u20d2",nwarhk:"\u2923",nwarr:"\u2196",nwArr:"\u21d6",nwarrow:"\u2196",nwnear:"\u2927",Oacute:"\xd3",oacute:"\xf3",oast:"\u229b",Ocirc:"\xd4",ocirc:"\xf4",ocir:"\u229a",Ocy:"\u041e",ocy:"\u043e",odash:"\u229d",Odblac:"\u0150",odblac:"\u0151",odiv:"\u2a38",odot:"\u2299",odsold:"\u29bc",OElig:"\u0152",oelig:"\u0153",ofcir:"\u29bf",Ofr:"\ud835\udd12",ofr:"\ud835\udd2c",ogon:"\u02db",Ograve:"\xd2",ograve:"\xf2",ogt:"\u29c1",ohbar:"\u29b5",ohm:"\u03a9",oint:"\u222e",olarr:"\u21ba",olcir:"\u29be",olcross:"\u29bb",oline:"\u203e",olt:"\u29c0",Omacr:"\u014c",omacr:"\u014d",Omega:"\u03a9",omega:"\u03c9",Omicron:"\u039f",omicron:"\u03bf",omid:"\u29b6",ominus:"\u2296",Oopf:"\ud835\udd46",oopf:"\ud835\udd60",opar:"\u29b7",OpenCurlyDoubleQuote:"\u201c",OpenCurlyQuote:"\u2018",operp:"\u29b9",oplus:"\u2295",orarr:"\u21bb",Or:"\u2a54",or:"\u2228",ord:"\u2a5d",order:"\u2134",orderof:"\u2134",ordf:"\xaa",ordm:"\xba",origof:"\u22b6",oror:"\u2a56",orslope:"\u2a57",orv:"\u2a5b",oS:"\u24c8",Oscr:"\ud835\udcaa",oscr:"\u2134",Oslash:"\xd8",oslash:"\xf8",osol:"\u2298",Otilde:"\xd5",otilde:"\xf5",otimesas:"\u2a36",Otimes:"\u2a37",otimes:"\u2297",Ouml:"\xd6",ouml:"\xf6",ovbar:"\u233d",OverBar:"\u203e",OverBrace:"\u23de",OverBracket:"\u23b4",OverParenthesis:"\u23dc",para:"\xb6",parallel:"\u2225",par:"\u2225",parsim:"\u2af3",parsl:"\u2afd",part:"\u2202",PartialD:"\u2202",Pcy:"\u041f",pcy:"\u043f",percnt:"%",period:".",permil:"\u2030",perp:"\u22a5",pertenk:"\u2031",Pfr:"\ud835\udd13",pfr:"\ud835\udd2d",Phi:"\u03a6",phi:"\u03c6",phiv:"\u03d5",phmmat:"\u2133",phone:"\u260e",Pi:"\u03a0",pi:"\u03c0",pitchfork:"\u22d4",piv:"\u03d6",planck:"\u210f",planckh:"\u210e",plankv:"\u210f",plusacir:"\u2a23",plusb:"\u229e",pluscir:"\u2a22",plus:"+",plusdo:"\u2214",plusdu:"\u2a25",pluse:"\u2a72",PlusMinus:"\xb1",plusmn:"\xb1",plussim:"\u2a26",plustwo:"\u2a27",pm:"\xb1",Poincareplane:"\u210c",pointint:"\u2a15",popf:"\ud835\udd61",Popf:"\u2119",pound:"\xa3",prap:"\u2ab7",Pr:"\u2abb",pr:"\u227a",prcue:"\u227c",precapprox:"\u2ab7",prec:"\u227a",preccurlyeq:"\u227c",Precedes:"\u227a",PrecedesEqual:"\u2aaf",PrecedesSlantEqual:"\u227c",PrecedesTilde:"\u227e",preceq:"\u2aaf",precnapprox:"\u2ab9",precneqq:"\u2ab5",precnsim:"\u22e8",pre:"\u2aaf",prE:"\u2ab3",precsim:"\u227e",prime:"\u2032",Prime:"\u2033",primes:"\u2119",prnap:"\u2ab9",prnE:"\u2ab5",prnsim:"\u22e8",prod:"\u220f",Product:"\u220f",profalar:"\u232e",profline:"\u2312",profsurf:"\u2313",prop:"\u221d",Proportional:"\u221d",Proportion:"\u2237",propto:"\u221d",prsim:"\u227e",prurel:"\u22b0",Pscr:"\ud835\udcab",pscr:"\ud835\udcc5",Psi:"\u03a8",psi:"\u03c8",puncsp:"\u2008",Qfr:"\ud835\udd14",qfr:"\ud835\udd2e",qint:"\u2a0c",qopf:"\ud835\udd62",Qopf:"\u211a",qprime:"\u2057",Qscr:"\ud835\udcac",qscr:"\ud835\udcc6",quaternions:"\u210d",quatint:"\u2a16",quest:"?",questeq:"\u225f",quot:'"',QUOT:'"',rAarr:"\u21db",race:"\u223d\u0331",Racute:"\u0154",racute:"\u0155",radic:"\u221a",raemptyv:"\u29b3",rang:"\u27e9",Rang:"\u27eb",rangd:"\u2992",range:"\u29a5",rangle:"\u27e9",raquo:"\xbb",rarrap:"\u2975",rarrb:"\u21e5",rarrbfs:"\u2920",rarrc:"\u2933",rarr:"\u2192",Rarr:"\u21a0",rArr:"\u21d2",rarrfs:"\u291e",rarrhk:"\u21aa",rarrlp:"\u21ac",rarrpl:"\u2945",rarrsim:"\u2974",Rarrtl:"\u2916",rarrtl:"\u21a3",rarrw:"\u219d",ratail:"\u291a",rAtail:"\u291c",ratio:"\u2236",rationals:"\u211a",rbarr:"\u290d",rBarr:"\u290f",RBarr:"\u2910",rbbrk:"\u2773",rbrace:"}",rbrack:"]",rbrke:"\u298c",rbrksld:"\u298e",rbrkslu:"\u2990",Rcaron:"\u0158",rcaron:"\u0159",Rcedil:"\u0156",rcedil:"\u0157",rceil:"\u2309",rcub:"}",Rcy:"\u0420",rcy:"\u0440",rdca:"\u2937",rdldhar:"\u2969",rdquo:"\u201d",rdquor:"\u201d",rdsh:"\u21b3",real:"\u211c",realine:"\u211b",realpart:"\u211c",reals:"\u211d",Re:"\u211c",rect:"\u25ad",reg:"\xae",REG:"\xae",ReverseElement:"\u220b",ReverseEquilibrium:"\u21cb",ReverseUpEquilibrium:"\u296f",rfisht:"\u297d",rfloor:"\u230b",rfr:"\ud835\udd2f",Rfr:"\u211c",rHar:"\u2964",rhard:"\u21c1",rharu:"\u21c0",rharul:"\u296c",Rho:"\u03a1",rho:"\u03c1",rhov:"\u
203f1",RightAngleBracket:"\u27e9",RightArrowBar:"\u21e5",rightarrow:"\u2192",RightArrow:"\u2192",Rightarrow:"\u21d2",RightArrowLeftArrow:"\u21c4",rightarrowtail:"\u21a3",RightCeiling:"\u2309",RightDoubleBracket:"\u27e7",RightDownTeeVector:"\u295d",RightDownVectorBar:"\u2955",RightDownVector:"\u21c2",RightFloor:"\u230b",rightharpoondown:"\u21c1",rightharpoonup:"\u21c0",rightleftarrows:"\u21c4",rightleftharpoons:"\u21cc",rightrightarrows:"\u21c9",rightsquigarrow:"\u219d",RightTeeArrow:"\u21a6",RightTee:"\u22a2",RightTeeVector:"\u295b",rightthreetimes:"\u22cc",RightTriangleBar:"\u29d0",RightTriangle:"\u22b3",RightTriangleEqual:"\u22b5",RightUpDownVector:"\u294f",RightUpTeeVector:"\u295c",RightUpVectorBar:"\u2954",RightUpVector:"\u21be",RightVectorBar:"\u2953",RightVector:"\u21c0",ring:"\u02da",risingdotseq:"\u2253",rlarr:"\u21c4",rlhar:"\u21cc",rlm:"\u200f",rmoustache:"\u23b1",rmoust:"\u23b1",rnmid:"\u2aee",roang:"\u27ed",roarr:"\u21fe",robrk:"\u27e7",ropar:"\u2986",ropf:"\ud835\udd63",Ropf:"\u211d",roplus:"\u2a2e",rotimes:"\u2a35",RoundImplies:"\u2970",rpar:")",rpargt:"\u2994",rppolint:"\u2a12",rrarr:"\u21c9",Rrightarrow:"\u21db",rsaquo:"\u203a",rscr:"\ud835\udcc7",Rscr:"\u211b",rsh:"\u21b1",Rsh:"\u21b1",rsqb:"]",rsquo:"\u2019",rsquor:"\u2019",rthree:"\u22cc",rtimes:"\u22ca",rtri:"\u25b9",rtrie:"\u22b5",rtrif:"\u25b8",rtriltri:"\u29ce",RuleDelayed:"\u29f4",ruluhar:"\u2968",rx:"\u211e",Sacute:"\u015a",sacute:"\u015b",sbquo:"\u201a",scap:"\u2ab8",Scaron:"\u0160",scaron:"\u0161",Sc:"\u2abc",sc:"\u227b",sccue:"\u227d",sce:"\u2ab0",scE:"\u2ab4",Scedil:"\u015e",scedil:"\u015f",Scirc:"\u015c",scirc:"\u015d",scnap:"\u2aba",scnE:"\u2ab6",scnsim:"\u22e9",scpolint:"\u2a13",scsim:"\u227f",Scy:"\u0421",scy:"\u0441",sdotb:"\u22a1",sdot:"\u22c5",sdote:"\u2a66",searhk:"\u2925",searr:"\u2198",seArr:"\u21d8",searrow:"\u2198",sect:"\xa7",semi:";",seswar:"\u2929",setminus:"\u2216",setmn:"\u2216",sext:"\u2736",Sfr:"\ud835\udd16",sfr:"\ud835\udd30",sfrown:"\u2322",sharp:"\u266f",SHCHcy:"\u0429",shchcy:"\u0449",SHcy:"\u0428",shcy:"\u0448",ShortDownArrow:"\u2193",ShortLeftArrow:"\u2190",shortmid:"\u2223",shortparallel:"\u2225",ShortRightArrow:"\u2192",ShortUpArrow:"\u2191",shy:"\xad",Sigma:"\u03a3",sigma:"\u03c3",sigmaf:"\u03c2",sigmav:"\u03c2",sim:"\u223c",simdot:"\u2a6a",sime:"\u2243",simeq:"\u2243",simg:"\u2a9e",simgE:"\u2aa0",siml:"\u2a9d",simlE:"\u2a9f",simne:"\u2246",simplus:"\u2a24",simrarr:"\u2972",slarr:"\u2190",SmallCircle:"\u2218",smallsetminus:"\u2216",smashp:"\u2a33",smeparsl:"\u29e4",smid:"\u2223",smile:"\u2323",smt:"\u2aaa",smte:"\u2aac",smtes:"\u2aac\ufe00",SOFTcy:"\u042c",softcy:"\u044c",solbar:"\u233f",solb:"\u29c4",sol:"/",Sopf:"\ud835\udd4a",sopf:"\ud835\udd64",spades:"\u2660",spadesuit:"\u2660",spar:"\u2225",sqcap:"\u2293",sqcaps:"\u2293\ufe00",sqcup:"\u2294",sqcups:"\u2294\ufe00",Sqrt:"\u221a",sqsub:"\u228f",sqsube:"\u2291",sqsubset:"\u228f",sqsubseteq:"\u2291",sqsup:"\u2290",sqsupe:"\u2292",sqsupset:"\u2290",sqsupseteq:"\u2292",square:"\u25a1",Square:"\u25a1",SquareIntersection:"\u2293",SquareSubset:"\u228f",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",squarf:"\u25aa",squ:"\u25a1",squf:"\u25aa",srarr:"\u2192",Sscr:"\ud835\udcae",sscr:"\ud835\udcc8",ssetmn:"\u2216",ssmile:"\u2323",sstarf:"\u22c6",Star:"\u22c6",star:"\u2606",starf:"\u2605",straightepsilon:"\u03f5",straightphi:"\u03d5",strns:"\xaf",sub:"\u2282",Sub:"\u22d0",subdot:"\u2abd",subE:"\u2ac5",sube:"\u2286",subedot:"\u2ac3",submult:"\u2ac1",subnE:"\u2acb",subne:"\u228a",subplus:"\u2abf",subrarr:"\u2979",subset:"\u2282",Subset:"\u22d0",subseteq:"\u2286",subseteqq:"\u2ac5",SubsetEqual:"\u2286",subsetneq:"\u228a",subsetneqq:"\u2acb",subsim:"\u2ac7",subsub:"\u2ad5",subsup:"\u2ad3",succapprox:"\u2ab8",succ:"\u227b",succcurlyeq:"\u227d",Succeeds:"\u227b",SucceedsEqual:"\u2ab0",SucceedsSlantEqual:"\u227d",SucceedsTilde:"\u227f",succeq:"\u2ab0",succnapprox:"\u2aba",succneqq:"\u2ab6",succnsim:"\u22e9",succsim:"\u227f",SuchThat:"\u220b",sum:"\u2211",Sum:"\u2211",sung:"\u266a",sup1:"\xb9",sup2:"\xb2",sup3:"\xb3",sup:"\u2283",Sup:"\u22d1",supdot:"\u2abe",supdsub:"\u2ad8",supE:"\u2ac6",supe:"\u2287",supedot:"\u2ac4",Superset:"\u2283",SupersetEqual:"\u2287",suphsol:"\u27c9",suphsub
2:"\u2ad7",suplarr:"\u297b",supmult:"\u2ac2",supnE:"\u2acc",supne:"\u228b",supplus:"\u2ac0",supset:"\u2283",Supset:"\u22d1",supseteq:"\u2287",supseteqq:"\u2ac6",supsetneq:"\u228b",supsetneqq:"\u2acc",supsim:"\u2ac8",supsub:"\u2ad4",supsup:"\u2ad6",swarhk:"\u2926",swarr:"\u2199",swArr:"\u21d9",swarrow:"\u2199",swnwar:"\u292a",szlig:"\xdf",Tab:"\t",target:"\u2316",Tau:"\u03a4",tau:"\u03c4",tbrk:"\u23b4",Tcaron:"\u0164",tcaron:"\u0165",Tcedil:"\u0162",tcedil:"\u0163",Tcy:"\u0422",tcy:"\u0442",tdot:"\u20db",telrec:"\u2315",Tfr:"\ud835\udd17",tfr:"\ud835\udd31",there4:"\u2234",therefore:"\u2234",Therefore:"\u2234",Theta:"\u0398",theta:"\u03b8",thetasym:"\u03d1",thetav:"\u03d1",thickapprox:"\u2248",thicksim:"\u223c",ThickSpace:"\u205f\u200a",ThinSpace:"\u2009",thinsp:"\u2009",thkap:"\u2248",thksim:"\u223c",THORN:"\xde",thorn:"\xfe",tilde:"\u02dc",Tilde:"\u223c",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",timesbar:"\u2a31",timesb:"\u22a0",times:"\xd7",timesd:"\u2a30",tint:"\u222d",toea:"\u2928",topbot:"\u2336",topcir:"\u2af1",top:"\u22a4",Topf:"\ud835\udd4b",topf:"\ud835\udd65",topfork:"\u2ada",tosa:"\u2929",tprime:"\u2034",trade:"\u2122",TRADE:"\u2122",triangle:"\u25b5",triangledown:"\u25bf",triangleleft:"\u25c3",trianglelefteq:"\u22b4",triangleq:"\u225c",triangleright:"\u25b9",trianglerighteq:"\u22b5",tridot:"\u25ec",trie:"\u225c",triminus:"\u2a3a",TripleDot:"\u20db",triplus:"\u2a39",trisb:"\u29cd",tritime:"\u2a3b",trpezium:"\u23e2",Tscr:"\ud835\udcaf",tscr:"\ud835\udcc9",TScy:"\u0426",tscy:"\u0446",TSHcy:"\u040b",tshcy:"\u045b",Tstrok:"\u0166",tstrok:"\u0167",twixt:"\u226c",twoheadleftarrow:"\u219e",twoheadrightarrow:"\u21a0",Uacute:"\xda",uacute:"\xfa",uarr:"\u2191",Uarr:"\u219f",uArr:"\u21d1",Uarrocir:"\u2949",Ubrcy:"\u040e",ubrcy:"\u045e",Ubreve:"\u016c",ubreve:"\u016d",Ucirc:"\xdb",ucirc:"\xfb",Ucy:"\u0423",ucy:"\u0443",udarr:"\u21c5",Udblac:"\u0170",udblac:"\u0171",udhar:"\u296e",ufisht:"\u297e",Ufr:"\ud835\udd18",ufr:"\ud835\udd32",Ugrave:"\xd9",ugrave:"\xf9",uHar:"\u2963",uharl:"\u21bf",uharr:"\u21be",uhblk:"\u2580",ulcorn:"\u231c",ulcorner:"\u231c",ulcrop:"\u230f",ultri:"\u25f8",Umacr:"\u016a",umacr:"\u016b",uml:"\xa8",UnderBar:"_",UnderBrace:"\u23df",UnderBracket:"\u23b5",UnderParenthesis:"\u23dd",Union:"\u22c3",UnionPlus:"\u228e",Uogon:"\u0172",uogon:"\u0173",Uopf:"\ud835\udd4c",uopf:"\ud835\udd66",UpArrowBar:"\u2912",uparrow:"\u2191",UpArrow:"\u2191",Uparrow:"\u21d1",UpArrowDownArrow:"\u21c5",updownarrow:"\u2195",UpDownArrow:"\u2195",Updownarrow:"\u21d5",UpEquilibrium:"\u296e",upharpoonleft:"\u21bf",upharpoonright:"\u21be",uplus:"\u228e",UpperLeftArrow:"\u2196",UpperRightArrow:"\u2197",upsi:"\u03c5",Upsi:"\u03d2",upsih:"\u03d2",Upsilon:"\u03a5",upsilon:"\u03c5",UpTeeArrow:"\u21a5",UpTee:"\u22a5",upuparrows:"\u21c8",urcorn:"\u231d",urcorner:"\u231d",urcrop:"\u230e",Uring:"\u016e",uring:"\u016f",urtri:"\u25f9",Uscr:"\ud835\udcb0",uscr:"\ud835\udcca",utdot:"\u22f0",Utilde:"\u0168",utilde:"\u0169",utri:"\u25b5",utrif:"\u25b4",uuarr:"\u21c8",Uuml:"\xdc",uuml:"\xfc",uwangle:"\u29a7",vangrt:"\u299c",varepsilon:"\u03f5",varkappa:"\u03f0",varnothing:"\u2205",varphi:"\u03d5",varpi:"\u03d6",varpropto:"\u221d",varr:"\u2195",vArr:"\u21d5",varrho:"\u03f1",varsigma:"\u03c2",varsubsetneq:"\u228a\ufe00",varsubsetneqq:"\u2acb\ufe00",varsupsetneq:"\u228b\ufe00",varsupsetneqq:"\u2acc\ufe00",vartheta:"\u03d1",vartriangleleft:"\u22b2",vartriangleright:"\u22b3",vBar:"\u2ae8",Vbar:"\u2aeb",vBarv:"\u2ae9",Vcy:"\u0412",vcy:"\u0432",vdash:"\u22a2",vDash:"\u22a8",Vdash:"\u22a9",VDash:"\u22ab",Vdashl:"\u2ae6",veebar:"\u22bb",vee:"\u2228",Vee:"\u22c1",veeeq:"\u225a",vellip:"\u22ee",verbar:"|",Verbar:"\u2016",vert:"|",Vert:"\u2016",VerticalBar:"\u2223",VerticalLine:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",VeryThinSpace:"\u200a",Vfr:"\ud835\udd19",vfr:"\ud835\udd33",vltri:"\u22b2",vnsub:"\u2282\u20d2",vnsup:"\u2283\u20d2",Vopf:"\ud835\udd4d",vopf:"\ud835\udd67",vprop:"\u221d",vrtri:"\u22b3",Vscr:"\ud835\udcb1",vscr:"\ud835\udccb",vsubnE:"\u2acb\ufe00",vsubne:"\u228a\ufe00",vsupnE:"\u2acc\ufe00",vsupne:"\u228b\ufe00",Vvdash:"\u22aa",vzigzag:"\u299a",Wcirc:"\u0174",wcirc:"\u0175",wedbar:"\u2a5f",wedge:"\u2227",Wedge:"\u22c0",wedgeq:"\u2259",weierp:"\u2118",Wfr:"\ud835\udd1a",wfr:"\ud835\udd34",Wopf:"\ud835\udd4e",wopf:"\ud835\udd68",wp:"\u2118",wr:"\u2240",wreath:"\u2240",Wscr:"\ud835\udcb2",wscr:"\ud835\udccc",xcap:"\u22c2",xcirc:"\u25ef",xcup:"\u22c3",xdtri:"\u25bd",Xfr:"\ud835\udd1b",xfr:"\ud835\udd35",xharr:"\u27f7",xhArr:"\u27fa",Xi:"\u039e",xi:"\u03be",xlarr:"\u27f5",xlArr:"\u27f8",xmap:"\u27fc",xnis:"\u22fb",xod
2ot:"\u2a00",Xopf:"\ud835\udd4f",xopf:"\ud835\udd69",xoplus:"\u2a01",xotime:"\u2a02",xrarr:"\u27f6",xrArr:"\u27f9",Xscr:"\ud835\udcb3",xscr:"\ud835\udccd",xsqcup:"\u2a06",xuplus:"\u2a04",xutri:"\u25b3",xvee:"\u22c1",xwedge:"\u22c0",Yacute:"\xdd",yacute:"\xfd",YAcy:"\u042f",yacy:"\u044f",Ycirc:"\u0176",ycirc:"\u0177",Ycy:"\u042b",ycy:"\u044b",yen:"\xa5",Yfr:"\ud835\udd1c",yfr:"\ud835\udd36",YIcy:"\u0407",yicy:"\u0457",Yopf:"\ud835\udd50",yopf:"\ud835\udd6a",Yscr:"\ud835\udcb4",yscr:"\ud835\udcce",YUcy:"\u042e",yucy:"\u044e",yuml:"\xff",Yuml:"\u0178",Zacute:"\u0179",zacute:"\u017a",Zcaron:"\u017d",zcaron:"\u017e",Zcy:"\u0417",zcy:"\u0437",Zdot:"\u017b",zdot:"\u017c",zeetrf:"\u2128",ZeroWidthSpace:"\u200b",Zeta:"\u0396",zeta:"\u03b6",zfr:"\ud835\udd37",Zfr:"\u2128",ZHcy:"\u0416",zhcy:"\u0436",zigrarr:"\u21dd",zopf:"\ud835\udd6b",Zopf:"\u2124",Zscr:"\ud835\udcb5",zscr:"\ud835\udccf",zwj:"\u200d",zwnj:"\u200c"},Uc={Aacute:"\xc1",aacute:"\xe1",Acirc:"\xc2",acirc:"\xe2",acute:"\xb4",AElig:"\xc6",aelig:"\xe6",Agrave:"\xc0",agrave:"\xe0",amp:"&",AMP:"&",Ar
2ing:"\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"},$c={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'},Zc={},Wc=Fc&&Fc.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Zc,"__esModule",{value:!0});var Gc=Wc({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}),Jc=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)};Zc.default=function(e){return e>=55296&&e<=57343||e>1114111?"\ufffd":(e in Gc.default&&(e=Gc.default[e]),Jc(e))};var Kc=Fc&&Fc.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Vc,"__esModule",{value:!0}),Vc.decodeHTML=Vc.decodeHTMLStrict=Vc.decodeXML=void 0;var Xc=Kc(_c),Qc=Kc(Uc),Yc=Kc($c),ep=Kc(Zc),tp=/&(?:[a-zA-Z0-9]+|#[xX][\da-fA-F]+|#\d+);/g;function np(e){var t=ip(e);return function(e){return String(e).replace(tp,t)}}Vc.decodeXML=np(Yc.default),Vc.decodeHTMLStrict=np(Xc.default);var rp=function(e,t){return e<t?1:-1};function ip(e){return function(t){if("#"===t.charAt(1)){var n=t.charAt(2);return"X"===n||"x"===n?ep.default(parseInt(t.substr(3),16)):ep.default(parseInt(t.substr(2),10))}return e[t.slice(1,-1)]||t}}Vc.decodeHTML=function(){for(var e=Object.keys(Qc.default).sort(rp),t=Object.keys(Xc.default).sort(rp),n=0,r=0;n<t.length;n++)e[r]===t[n]?(t[n]+=";?",r++):t[n]+=";";var i=new RegExp("&(?:"+t.join("|")+"|#[xX][\\da-fA-F]+;?|#\\d+;?)","g"),o=ip(Xc.default);function a(e){return";"!==e.substr(-1)&&(e+=";"),o(e)}return function(e){return String(e).replace(i,a)}}();var op={},ap=Fc&&Fc.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(op,"__esModule",{value:!0}),op.escapeUTF8=op.escape=op.encodeNonAsciiHTML=op.encodeHTML=op.encodeXML=void 0;var sp=fp(ap($c).default),lp=hp(sp);op.encodeXML=bp(sp);var up,cp,pp=fp(ap(_c).default),dp=hp(pp);function fp(e){return Object.keys(e).sort().reduce((function(t,n){return t[e[n]]="&"+n+";",t}),{})}function hp(e){for(var t=[],n=[],r=0,i=Object.keys(e);r<i.length;r++){var o=i[r];1===o.length?t.push("\\"+o):n.push(o)}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("")+"]"),new RegExp(n.join("|"),"g")}op.encodeHTML=(up=pp,cp=dp,function(e){return e.replace(cp,(function(e){return up[e]})).replace(mp,gp)}),op.encodeNonAsciiHTML=bp(pp);var mp=/(?:[\x80-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/g,vp=null!=String.prototype.codePointAt?function(e){return e.codePointAt(0)}:function(e){return 1024*(e.charCodeAt(0)-55296)+e.charCodeAt(1)-56320+65536};function gp(e){return"&#x"+(e.length>1?vp(e):e.charCodeAt(0)).toString(16).toUpperCase()+";"}var yp=new RegExp(lp.source+"|"+mp.source,"g");function bp(e){return function(t){return t.replace(yp,(function(t){return e[t]||gp(t)}))}}op.escape=function(e){return e.replace(yp,gp)},op.escapeUTF8=function(e){return e.replace(lp,gp)}
2,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;var t=Vc,n=op;e.decode=function(e,n){return(!n||n<=0?t.decodeXML:t.decodeHTML)(e)},e.decodeStrict=function(e,n){return(!n||n<=0?t.decodeXML:t.decodeHTMLStrict)(e)},e.encode=function(e,t){return(!t||t<=0?n.encodeXML:n.encodeHTML)(e)};var r=op;Object.defineProperty(e,"encodeXML",{enumerable:!0,get:function(){return r.encodeXML}}),Object.defineProperty(e,"encodeHTML",{enumerable:!0,get:function(){return r.encodeHTML}}),Object.defineProperty(e,"encodeNonAsciiHTML",{enumerable:!0,get:function(){return r.encodeNonAsciiHTML}}),Object.defineProperty(e,"escape",{enumerable:!0,get:function(){return r.escape}}),Object.defineProperty(e,"escapeUTF8",{enumerable:!0,get:function(){return r.escapeUTF8}}),Object.defineProperty(e,"encodeHTML4",{enumerable:!0,get:function(){return r.encodeHTML}}),Object.defineProperty(e,"encodeHTML5",{enumerable:!0,get:function(){return r.encodeHTML}});var i=Vc;Object.defineProperty(e,"decodeXML",{enumerable:!0,get:function(){return i.decodeXML}}),Object.defineProperty(e,"decodeHTML",{enumerable:!0,get:function(){return i.decodeHTML}}),Object.defineProperty(e,"decodeHTMLStrict",{enumerable:!0,get:function(){return i.decodeHTMLStrict}}),Object.defineProperty(e,"decodeHTML4",{enumerable:!0,get:function(){return i.decodeHTML}}),Object.defineProperty(e,"decodeHTML5",{enumerable:!0,get:function(){return i.decodeHTML}}),Object.defineProperty(e,"decodeHTML4Strict",{enumerable:!0,get:function(){return i.decodeHTMLStrict}}),Object.defineProperty(e,"decodeHTML5Strict",{enumerable:!0,get:function(){return i.decodeHTMLStrict}}),Object.defineProperty(e,"decodeXMLStrict",{enumerable:!0,get:function(){return i.decodeXML}})}(jc);var wp="&(?:#x[a-f0-9]{1,6}|#[0-9]{1,7}|[a-z][a-z0-9]{1,31});",kp=/[\\&]/,xp="[!\"#$%&'()*+,./:;<=>?@[\\\\\\]^_`{|}~-]",Cp=new RegExp("\\\\"+xp+"|"+wp,"gi"),Tp=new RegExp('[&<>"]',"g"),Ep=function(e){return 92===e.charCodeAt(0)?e.charAt(1):jc.decodeHTML(e)};function Mp(e){return kp.test(e)?e.replace(Cp,Ep):e}function Np(e){try{return zc(e)}catch(t){return e}}function Sp(e){switch(e){case"&":return"&amp;";case"<":return"&lt;";case">":return"&gt;";case'"':return"&quot;";default:return e}}function Dp(e){return Tp.test(e)?e.replace(Tp,Sp):e}function Lp(e,t){for(var n=[],r=0;r<t;r++)n.push(e);return n.join("")}function Ap(e){return!e||!/[^ \t]+/.test(e)}var Op=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=Ip(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 Ip(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 Rp=1,Pp={};function Bp(e){delete Pp[e]}var Fp=function(){function e(e,t){this.parent=null,this.prev=null,this.next=null,this.firstChild=null,this.lastChild=null,this.literal=null,this.id="document"===e?-1:Rp++,this.type=e,this.sourcepos=t,Pp[this.id]=this}return e.prototype.isContainer=function(){return Ip(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.lastChild=e):(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 Op(this)},e}(),Hp=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 Rc(t,e),t}(Fp),qp=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.listData=null,t}return Rc(t,e),t}(Hp),zp=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.level=0,t.headingType="atx",t}return Rc(t,e),t}(Hp),jp=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 Rc(t,e),t}(Hp),Vp=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.columns=[],t}return Rc(t,e),t}(Hp),_p=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 Rc(t,e),t}(Hp),Up=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.title="",t.dest="",t.label="",t}return Rc(t,e),t}(Hp),$p=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.syntaxLength=0,t.offset=-1,t.info="",t}return Rc(t,e),t}(Hp),Zp=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.htmlBlockType=-1,t}return Rc(t,e),t}(Hp),Wp=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 Rc(t,e),t}(Fp),Gp=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.tickCount=0,t}return Rc(t,e),t}(Fp),Jp=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.info="",t}return Rc(t,e),t}(Fp);function Kp(e,t){switch(e){case"heading":return new zp(e,t);case"list":case"item":return new qp(e,t);case"link":case"image":return new Wp(e,t);case"codeBlock":return new jp(e,t);case"htmlBlock":return new Zp(e,t);case"table":return new Vp(e,t);case"tableCell":return new _p(e,t);case"document":case"paragraph":case"blockQuote":case"thematicBreak":case"tableRow":case"tableBody":case"tableHead":case"frontMatter":return new Hp(e,t);case"code":return new Gp(e,t);case"refDef":return new Up(e,t);case"customBlock":return new $p(e,t);case"customInline":return new Jp(e,t);default:return new Fp(e,t)}}function Xp(e){return"codeBlock"===e.type}function Qp(e){return"list"===e.type}function Yp(e){return"refDef"===e.type}function ed(e){return"customBlock"===e.type}function td(e,t){var n=Kp("text",t);return n.literal=e,n}var nd,rd="[A-Za-z][A-Za-z0-9-]*",id="<"+rd+"(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^\"'=<>`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)*\\s*/?>",od="</"+rd+"\\s*[>]",ad=new RegExp("^"+("(?:"+id+"|"+od+"|\x3c!----\x3e|\x3c!--(?:-?[^>-])(?:-?[^-])*--\x3e|[<][?].*?[?][>]|<![A-Z]+\\s+[^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)"),"i");if(String.fromCodePoint)nd=function(e){try{return String.fromCodePoint(e)}catch(t){if(t instanceof RangeError)return String.fromCharCode(65533);throw t}};else{var sd=String.fromCharCode,ld=Math.floor;nd=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n,r,i=[],o=-1,a=e.length;if(!a)return"";for(var s="";++o<a;){var l=Number(e[o]);if(!isFinite(l)||l<0||l>1114111||ld(l)!==l)return String.fromCharCode(65533);l<=65535?i.push(l):(n=55296+((l-=65536)>>10),r=l%1024+56320,i.push(n,r)),(o+1===a||i.length>16384)&&(s+=sd.apply(void 0,i),i.length=0)}return s}}var ud=nd,cd="(?:[w-]+.)*[A-Za-z0-9-]+.[A-Za-z0-9-]+",pd="[^<\\s]*[^<?!.,:*_?~\\s]",dd="[\\w.+-]+@(?:[\\w-]+\\.)+[\\w-]+";function fd(e){var t=/\)+$/.exec(e);if(t){for(var n=0,r=0,i=e;r<i.length;r++){var o=i[r];"("===o?n<0?n=1:n+=1:")"===o&&(n-=1)}if(n<0){var a=Math.min(-n,t[0].length);return e.substring(0,e.length-a)}}return e}function hd(e){return e.replace(/&[A-Za-z0-9]+;$/,"")}function md(e){return Bc(Bc([],function(e){for(var t,n=new RegExp("(www|https?://)."+cd+pd,"g"),r=[];t=n.exec(e);){var i=hd(fd(t[0])),o="www"===t[1]?"http://":"";r.push({text:i,range:[t.index,t.index+i.length-1],url:""+o+i})}return r}(e)),function(e){for(var t,n=new RegExp(dd,"g"),r=[];t=n.exec(e);){var i=t[0];/[_-]+$/.test(i)||r.push({text:i,range:[t.index,t.index+i.length-1],url:"mailto:"+i})}return r}(e)).sort((function(e,t){return e.range[0]-t.range[0]}))}function vd(e){return e[e.length-1]}function gd(e){return e.slice(1,e.length-1).trim().replace(/[ \t\r\n]+/," ").toLowerCase().toUpperCase()}function yd(e,t){Object.keys(e).forEach((function(n){t(n,e[n])}))}function bd(e){return!Object.keys(e).length}var wd=126,kd=39,xd=34,Cd=36,Td="\\\\"+xp,Ed=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]/),Md=new RegExp('^(?:"('+Td+'|[^"\\x00])*"|\'('+Td+"|[^'\\x00])*'|\\(("+Td+"|[^()\\x00])*\\))"),Nd=/^(?:<(?:[^<>\n\\\x00]|\\.)*>)/,Sd=new RegExp("^"+xp),Dd=new RegExp("^"+wp,"i"),Ld=/`+/,Ad=/^`+/,Od=/\.\.\./g,Id=/--+/g,Rd=/^<([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])?)*)>/,Pd=/^<[A-Za-z][A-Za-z0-9.+-]{1,31}:[^<>\x00-\x20]*>/i,Bd=/^ *(?:\n *)?/,Fd=/^[ \t\n\x0b\x0c\x0d]/,Hd=/^\s/,qd=/ *$/,zd=/^ */,jd=/^ *(?:\n|$)/,Vd=/^\[(?:[^\\\[\]]|\\.){0,1000}\]/,_d=/^[^\n`\[\]\\!<&*_'"~$]+/m,Ud=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,i=[r,e+n];return"number"===typeof t?[i,[r,t+n]]:i},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(Bd),!0},e.prototype.parseBackticks=function(e){var t=this.pos+1,n=this.match(Ad);if(null===n)return!1;for(var r,i=this.pos;null!==(r=this.match(Ld));)if(r===n){var o=this.subject.slice(i,this.pos-n.length),a=this.sourcepos(t,this.pos),s=o.split("\n");if(s.length>1){var l=vd(s);this.lineIdx+=s.length-1,this.linePosOffset=-(this.pos-l.length-n.length),a[1]=this.sourcepos(this.pos),o=s.join(" ")}var u=Kp("code",a);return o.length>0&&null!==o.match(/[^ ]/)&&" "==o[0]&&" "==o[o.length-1]?u.literal=o.slice(1,o.length-1):u.literal=o,u.tickCount=n.length,e.appendChild(u),!0}return this.pos=i,e.appendChild(td(n,this.sourcepos(t,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=Kp("linebreak",this.sourcepos(this.pos-1,this.pos)),e.appendChild(t),this.nextLine()
2):Sd.test(n.charAt(this.pos))?(e.appendChild(td(n.charAt(this.pos),this.sourcepos(r,this.pos))),this.pos+=1):e.appendChild(td("\\",this.sourcepos(r,r))),!0},e.prototype.parseAutolink=function(e){var t,n,r,i=this.pos+1;return(t=this.match(Rd))?(n=t.slice(1,t.length-1),(r=Kp("link",this.sourcepos(i,this.pos))).destination=Np("mailto:"+n),r.title="",r.appendChild(td(n,this.sourcepos(i+1,this.pos-1))),e.appendChild(r),!0):!!(t=this.match(Pd))&&(n=t.slice(1,t.length-1),(r=Kp("link",this.sourcepos(i,this.pos))).destination=Np(n),r.title="",r.appendChild(td(n,this.sourcepos(i+1,this.pos-1))),e.appendChild(r),!0)},e.prototype.parseHtmlTag=function(e){var t=this.pos+1,n=this.match(ad);if(null===n)return!1;var r=Kp("htmlInline",this.sourcepos(t,this.pos));return r.literal=n,e.appendChild(r),!0},e.prototype.scanDelims=function(e){var t=0,n=this.pos;if(e===kd||e===xd)t++,this.pos++;else for(;this.peek()===e;)t++,this.pos++;if(0===t||t<2&&(e===wd||e===Cd))return this.pos=n,null;var r,i=0===n?"\n":this.subject.charAt(n-1),o=this.peek();r=-1===o?"\n":ud(o);var a,s,l=Hd.test(r),u=Ed.test(r),c=Hd.test(i),p=Ed.test(i),d=!l&&(!u||c||p),f=!c&&(!p||l||u);return 95===e?(a=d&&(!f||p),s=f&&(!d||u)):e===kd||e===xd?(a=d&&!f,s=f):e===Cd?(a=!l,s=!c):(a=d,s=f),this.pos=n,{numdelims:t,canOpen:a,canClose:s}},e.prototype.handleDelim=function(e,t){var n=this.scanDelims(e);if(!n)return!1;var r=n.numdelims,i=this.pos+1;this.pos+=r;var o=td(e===kd?"\u2019":e===xd?"\u201c":this.subject.slice(i-1,this.pos),this.sourcepos(i,this.pos));return t.appendChild(o),(n.canOpen||n.canClose)&&(this.options.smart||e!==kd&&e!==xd)&&(this.delimiters={cc:e,numdelims:r,origdelims:r,node:o,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,i,o,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(i=r,p||c===wd||c===Cd)if(s){if(n){var d=r.numdelims>=2&&n.numdelims>=2?2:1,f=p?0:1;o=n.node,a=r.node;var h=p?1===d?"emph":"strong":"strike";c===Cd&&(h="customInline");var m=Kp(h),v=o.sourcepos[1],g=a.sourcepos[0];m.sourcepos=[[v[0],v[1]-d+1],[g[0],g[1]+d-1]],o.sourcepos[1][1]-=d,a.sourcepos[0][1]+=d,o.literal=o.literal.slice(d),a.literal=a.literal.slice(d),n.numdelims-=d,r.numdelims-=d;for(var y=o.next,b=void 0;y&&y!==a;)b=y.next,y.unlink(),m.appendChild(y),y=b;if(c===Cd){var w=m.firstChild,k=w.literal||"",x=k.split(/\s/)[0];m.info=x,k.length<=x.length?w.unlink():(w.sourcepos[0][1]+=x.length,w.literal=k.replace(x+" ",""))}if(o.insertAfter(m),this.removeDelimitersBetween(n,r),n.numdelims<=f&&(0===n.numdelims&&o.unlink(),this.removeDelimiter(n)),r.numdelims<=f){0===r.numdelims&&a.unlink();var C=r.next;this.removeDelimiter(r),r=C}}}else r=r.next;else c===kd?(r.node.literal="\u2019",s&&(n.node.literal="\u2018"),r=r.next):c===xd&&(r.node.literal="\u201d",s&&(n.node.literal="\u201c"),r=r.next);s||(u[c][p?i.origdelims%3:0]=i.previous,i.canOpen||this.removeDelimiter(i))}else r=r.next}for(;null!==this.delimiters&&this.delimiters!==e;)this.removeDelimiter(this.delimiters)},e.prototype.parseLinkTitle=function(){var e=this.match(Md);return null===e?null:Mp(e.substr(1,e.length-2))},e.prototype.parseLinkDestination=function(){var e=this.match(Nd);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&&Sd.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;this.pos+=1,n-=1}else{if(null!==Fd.exec(ud(r)))break;this.pos+=1}return this.pos===t&&41!==r||0!==n?null:Np(Mp(e=this.subject.substr(t,this.pos-t)))}return Np(Mp(e.substr(1,e.length-2)))},e.prototype.parseLinkLabel=function(){var e=this.match(Vd);return null===e||e.length>1001?0:e.length},e.prototype.parseOpenBracket=function(e){var t=this.pos;this.pos+=1;var n=td("[",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=td("![",this.sourcepos(this.pos-1,this.pos));e.appendChild(n),this.addBracket(n,t+1,!0)}else{n=td("!",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 i=this.pos,o=this.brackets;if(null===o)return e.appendChild(td("]",this.sourcepos(i,i))),!0;if(!o.active)return e.appendChild(td("]",this.sourcepos(i,i))),this.removeBracket(),!0;var a=o.image,s=this.pos;40===this.peek()&&(this.pos++,this.spnl()&&null!==(t=this.parseLinkDestination())&&this.spnl()&&(Fd.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):o.bracketAfter||(l=this.subject.slice(o.index,i)),0===c&&(this.pos=s),l){l=gd(l);var p=this.refMap[l];p&&(t=p.destination,n=p.title,r=!0)}}if(r){var d=Kp(a?"image":"link");d.destination=t,d.title=n||"",d.sourcepos=[o.startpos,this.sourcepos(this.pos)];for(var f=o.node.next,h=void 0;f;)h=f.next,f.unlink(),d.appendChild(f),f=h;if(e.appendChild(d),this.processEmphasis(o.previousDelimiter),this.removeBracket(),o.node.unlink(),!a)for(o=this.brackets;null!==o;)o.image||(o.active=!1),o=o.previous;return this.options.referenceDefinition&&(this.refLinkCandidateMap[e.id]={node:e,refL
2abel:l}),!0}return this.removeBracket(),this.pos=i,e.appendChild(td("]",this.sourcepos(i,i))),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?0:1)),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(Dd))&&(e.appendChild(td(jc.decodeHTML(t),this.sourcepos(n,this.pos))),!0)},e.prototype.parseString=function(e){var t,n=this.pos+1;if(t=this.match(_d)){if(this.options.smart){var r=t.replace(Od,"\u2026").replace(Id,(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),Lp("\u2014",n)+Lp("\u2013",t)}));e.appendChild(td(r,this.sourcepos(n,this.pos)))}else{var i=td(t,this.sourcepos(n,this.pos));e.appendChild(i)}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(qd,"");var i=r-t.literal.length;t.sourcepos[1][1]-=i,e.appendChild(Kp(n?"linebreak":"softbreak",this.sourcepos(this.pos-i,this.pos)))}else e.appendChild(Kp("softbreak",this.sourcepos(this.pos,this.pos)));return this.nextLine(),this.match(zd),!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,i=this.parseLinkLabel();if(0===i)return 0;var o=this.subject.substr(0,i);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(jd)&&(""===n?l=!1:(n="",this.pos=s,l=null!==this.match(jd))),!l)return this.pos=r,0;var u=gd(o);if(""===u)return this.pos=r,0;var c=this.getReferenceDefSourcepos(e);e.sourcepos[0][0]=c[1][0]+1;var p=Kp("refDef",c);return p.title=n,p.dest=a,p.label=u,e.insertBefore(p),t[u]?this.refDefCandidateMap[p.id]=p:t[u]=zf(p),this.pos-r},e.prototype.mergeTextNodes=function(e){for(var t,n=[];t=e.next();){var r=t.entering,i=t.node;if(r&&"text"===i.type)n.push(i);else if(1===n.length)n=[];else if(n.length>1){var o=n[0],a=n[n.length-1];o.sourcepos&&a.sourcepos&&(o.sourcepos[1]=a.sourcepos[1]),o.next=a.next,o.next&&(o.next.prev=o);for(var s=1;s<n.length;s+=1)o.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,i={line:0,ch:0},o=0;o<t.length;o+=1){var a=t[o];if(Fd.test(a))break;if(/\:/.test(a)&&0===r){if(n)break;var s=a.indexOf(":")===a.length-1?o+1:o;i={line:s,ch:t[s].length},n=!0}var l=a.match(/'|"/g);if(l&&(r+=l.length),2===r){i={line:o,ch:a.length};break}}return[[e.sourcepos[0][0],e.sourcepos[0][1]],[e.sourcepos[0][0]+i.line,i.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 wd:case Cd:n=this.handleDelim(r,e);break;case kd:case xd:n=!!(null===(t=this.options)||void 0===t?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(td(ud(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],function(e){return"heading"===e.type}(e)&&(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;"boolean"===typeof t&&(t=md);for(var r=function(){var e=n.entering,r=n.node;if(e&&"text"===r.type&&"link"!==r.parent.type){var i=r.literal,o=t(i);if(!o||!o.length)return"continue";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,f=o;d<f.length;d++){var h=f[d],m=h.range,v=h.url,g=h.text;m[0]>a&&p.push(td(i.substring(a,m[0]),c(a,m[0]-1)));var y=Kp("link",c.apply(void 0,m));y.appendChild(td(g,c.apply(void 0,m))),y.destination=v,y.extendedAutolink=!0,p.push(y),a=m[1]+1}a<i.length&&p.push(td(i.substring(a),c(a,i.length-1)));for(var b=0,w=p;b<w.length;b++){var k=w[b];r.insertBefore(k)}r.unlink()}};n=e.next();)r()}(e.walker(),n),r&&e.firstChild)for(var i,o=e.firstChild.walker();i=o.next();){var a=i.node,s=i.entering;r[a.type]&&r[a.type](a,{entering:s,options:this.options})}},e}(),$d=/^\[([ \txX])\][ \t]+/;var Zd=9,Wd=32,Gd=/[^ \t\f\v\r\n]/,Jd=/^(?:`{3,}|~{3,})(?= *$)/;function Kd(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 Xd(e,t){return t<e.length?e.charCodeAt(t):-1}function Qd(e){return!Gd.test(e)}function Yd(e){return e===Wd||e===Zd}var ef=/^\$\$$/,tf={continue:function(e,t){var n=e.currentLine,r=n.match(ef);if(r)return e.lastLineLength=r[0].length,e.finalize(t,e.lineNumber),2;for(var i=t.offset;i>0&&Yd(Xd(n,e.offset));)e.advanceOffset(1,!0),i--;return 0},finalize:function(e,t){if(null!==t.stringContent){var n=t.stringContent,r=n.indexOf("\n"),i=n.slice(0,r),o=n.slice(r+1),a=i.match(/^(\s*)(.*)/);t.info=Mp(a[2].trim()),t.literal=o,t.stringContent=null}},canContain:function(){return!1},acceptsLines:!0},nf={continue:function(){return 1},finalize:function(){},canContain:function(){return!1},acceptsLines:!0},rf={continue:function(){return 0},finalize:function(e,t){for(var n=t.firstChild;n;){if(Kd(n)&&n.next){t.listData.tight=!1;break}for(var r=n.firstChild;r;){if(Kd(r)&&(n.next||r.next)){t.listData.tight=!1;break}r=r.next}n=n.next}},canContain:function(e){return"item"===e},acceptsLines:!1},of={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($d);if(r){var i=r[0].length;n.stringContent=n.stringContent.substring(i-1),n.sourcepos[0][1]+=i,n.lineOffsets[0]+=i,t.listData.task=!0,t.listData.checked=/[xX]/.test(r[1])}}},canContain:function(e){return"item"!==e},acceptsLines:!1},af={continue:function(e,t){var n=e.currentLine,r=e.indent;if(t.isFenced){var i=r<=3&&n.charAt(e.nextNonspace)===t.fenceChar&&n.slice(e.nextNonspace).match(Jd);if(i&&i[0].length>=t.fenceLength)return e.lastLineLength=e.offset+r+i[0].length,e.finalize(t,e.lineNumber),2;for(var o=t.fenceOffset;o>0&&Yd(Xd(n,e.offset));)e.advanceOffset(1,!0),o--}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,i=r.indexOf("\n"),o=r.slice(0,i),a=r.slice(i+1),s=o.match(/^(\s*)(.*)/);t.infoPadding=s[1].length,t.info=Mp(s[2].trim()),t.literal=a}else t.literal=null===(n=t.stringContent)||void 0===n?void 0:n.replace(/(\n *)+$/,"\n");t.stringContent=null}},canContain:function(){return!1},acceptsLines:!0},sf={continue:function(e){return e.blank?1:0},finalize:function(e,t){if(null!==t.stringContent){for(var n,r=!1;91===Xd(t.stringContent,0)&&(n=e.inlineParser.parseReference(t,e.refMap));)t.stringContent=t.stringContent.slice(n),r=!0;r&&Qd(t.stringContent)&&t.unlink()}},canContain:function(){return!1},acceptsLines:!0},lf={document:{continue:function(){return 0},finalize:function(){},canContain:function(e){return"item"!==e},acceptsLines:!1},list:rf,blockQuote:{continue:function(e){var t=e.currentLine;return e.indented||62!==Xd(t,e.nextNonspace)?1:(e.advanceNextNonspace(),e.advanceOffset(1,!1),Yd(Xd(t,e.offset))&&e.advanceOffset(1,!0),0)},finalize:function(){},canContain:function(e){return"item"!==e},acceptsLines:!1},item:of,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:af,htmlBlock:{continue:function(e,t){return!e.blank||6!==t.htmlBlockType&&7!==t.htmlBlockType?0:1},finalize:function(e,t){var n;t.literal=(null===(n=t.stringContent)||void 0===n?void 0:n.replace(/(\n *)+$/,""))||null,t.stringContent=null},canContain:function(){return!1},acceptsLines:!0},paragraph:sf,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:nf,customBlock:tf,frontMatter:nf};function uf(e){for(var t=0,n=0,r=[],i=0;i<e.length;i+=1)if("|"===e[i]&&"\\"!==e[i-1]){var o=e.substring(t,i);0===t&&Ap(o)?n=i+1:r.push(o),t=i+1}t<e.length&&(Ap(o=e.substring(t,e.length))||r.push(o));return[n,r]}function cf(e,t,n,r){for(var i=[],o=0,a=t;o<a.length;o++){var s=a[o],l=s.match(/^[ \t]+/),u=l?l[0].length:0,c=void 0,p=void 0;if(u===s.length)u=0,c=0,p="";else{var d=s.match(/[ \t]+$/);c=d?d[0].length:0,p=s.slice(u,s.length-c)}var f=r+u,h=Kp(e,[[n,r],[n,r+s.length-1]]);h.stringContent=p.replace(/\\\|/g,"|"),h.startIdx=i.length,h.endIdx=i.length,h.lineOffsets=[f-1],h.paddingLeft=u,h.paddingRight=c,i.push(h),r+=s.length+1}return i}function pf(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 df=/^(\$\$)(\s*[a-zA-Z])+/,ff=/^(\$\$)(\s*[a-zA-Z])+.*(\$\$)/,hf=/^`{3,}(?!.*`)|^~{3,}/,mf=[/./,/^<(?: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,new RegExp("^(?:"+id+"|"+od+")\\s*$","i")],vf=/^(?:=+|-+)[ \t]*$/,gf=/^#{1,6}(?:[ \t]+|$)/,yf=/^(?:(?:\*[ \t]*){3,}|(?:_[ \t]*){3,}|(?:-[ \t]*){3,})[ \t]*$/,bf=/^[*+-]/,wf=/^(\d{1,9})([.)])/;function kf(e,t){return e.options.disallowDeepHeading&&("blockQuote"===t.type||"item"===t.type)}var xf=[function(e){return e.indented||62!==Xd(e.currentLine,e.nextNonspace)?0:(e.advanceNextNonspace(),e.advanceOffset(1,!1),Yd(Xd(e.currentLine,e.offset))&&e.advanceOffset(1,!0),e.closeUnmatchedBlocks(),e.addChild("blockQuote",e.nextNonspace),1)},function(e,t){var n;if(!e.indented&&!kf(e,t)&&(n=e.currentLine.slice(e.nextNonspace).match(gf))){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(hf))){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===Xd(e.currentLine,e.nextNonspace)){var n=e.currentLine.slice(e.nextNonspace),r=e.options.disallowedHtmlBlockTags,i=void 0;for(i=1;i<=7;i++){var o=n.match(mf[i]);if(o){if(7===i){if("paragraph"===t.type)return 0;if(r.length>0)if(new RegExp("</?(?:"+r.join("|")+")","i").test(o[0]))return 0}return e.closeUnmatchedBlocks(),e.addChild("htmlBlock",e.offset).htmlBlockType=i,2}}}return 0},function(e,t){var n;if(null!==t.stringContent&&!e.indented&&"paragraph"===t.type&&!kf(e,t.parent)&&(n=e.currentLine.slice(e.nextNonspace).match(vf))){e.closeUnmatchedBlocks();for(var r=void 0;91===Xd(t.stringContent,0)&&(r=e.inlineParser.parseReference(t,e.refMap));)t.stringContent=t.stringContent.slice(r);if(t.stringContent.length>0){var i=Kp("heading",t.sourcepos);return i.level="="===n[0][0]?1:2,i.headingType="setext",i.stringContent=t.stringContent,t.insertAfter(i),t.unlink(),e.tip=i,e.advanceOffset(e.currentLine.length-e.offset,!1),2}return 0}return 0},function(e){return!e.indented&&yf.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,i,o=t;return e.indented&&"list"!==t.type||!(n=function(e,t){var n,r,i=e.currentLine.slice(e.nextNonspace),o={type:"bullet",tight:!0,bulletChar:"",start:0,delimiter:"",padding:0,markerOffset:e.indent,task:!1,checked:!1}
2;if(e.indent>=4)return null;if(n=i.match(bf))o.type="bullet",o.bulletChar=n[0][0];else{if(!(n=i.match(wf))||"paragraph"===t.type&&"1"!==n[1])return null;o.type="ordered",o.start=parseInt(n[1],10),o.delimiter=n[2]}if(-1!==(r=Xd(e.currentLine,e.nextNonspace+n[0].length))&&r!==Zd&&r!==Wd)return null;if("paragraph"===t.type&&!e.currentLine.slice(e.nextNonspace+n[0].length).match(Gd))return null;e.advanceNextNonspace(),e.advanceOffset(n[0].length,!0);var a=e.column,s=e.offset;do{e.advanceOffset(1,!0),r=Xd(e.currentLine,e.offset)}while(e.column-a<5&&Yd(r));var l=-1===Xd(e.currentLine,e.offset),u=e.column-a;return u>=5||u<1||l?(o.padding=n[0].length+1,e.column=a,e.offset=s,Yd(Xd(e.currentLine,e.offset))&&e.advanceOffset(1,!0)):o.padding=n[0].length+u,o}(e,o))?0:(e.closeUnmatchedBlocks(),"list"===e.tip.type&&(r=o.listData,i=n,r.type===i.type&&r.delimiter===i.delimiter&&r.bulletChar===i.bulletChar)||((o=e.addChild("list",e.nextNonspace)).listData=n),(o=e.addChild("item",e.nextNonspace)).listData=n,1)},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,i=n.lastIndexOf("\n",r-1)+1,o=n.slice(i,r),a=e.currentLine.slice(e.nextNonspace),s=uf(o),l=s[0],u=s[1],c=uf(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=vd(h)+1,g=Kp("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,i);var y=i-(n.lastIndexOf("\n",i-2)+1)-1;e.lastLineLength=h[h.length-2]+y,e.finalize(t,m-1)}e.advanceOffset(e.currentLine.length-e.offset,!1);var b=Kp("tableHead",[[m,v],[e.lineNumber,e.offset]]);g.appendChild(b);var w=Kp("tableRow",[[m,v],[m,v+o.length-1]]),k=Kp("tableDelimRow",[[e.lineNumber,e.nextNonspace+1],[e.lineNumber,e.offset]]);b.appendChild(w),b.appendChild(k),cf("tableCell",u,m,v+l).forEach((function(e){w.appendChild(e)}));var x=cf("tableDelimCell",d,e.lineNumber,e.nextNonspace+1+p);return x.forEach((function(e){k.appendChild(e)})),g.columns=x.map(pf),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),r.stringContent=null);var i=Kp("tableRow",[[e.lineNumber,e.nextNonspace+1],[e.lineNumber,e.currentLine.length]]);r.appendChild(i);var o=r.parent,a=uf(e.currentLine.slice(e.nextNonspace)),s=a[0];return cf("tableCell",a[1],e.lineNumber,e.nextNonspace+1+s).forEach((function(e,t){t>=o.columns.length&&(e.ignored=!0),i.appendChild(e)})),2},function(e){var t;if(!e.indented&&!ff.test(e.currentLine)&&(t=e.currentLine.match(df))){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}],Cf=/^(-{3}|\+{3}|;{3})$/,Tf=function(e,t){var n=e.currentLine,r=e.lineNumber,i=e.indented;return 1===r&&!i&&"document"===t.type&&Cf.test(n)?(e.closeUnmatchedBlocks(),e.addChild("frontMatter",e.nextNonspace).stringContent=n,e.advanceNextNonspace(),e.advanceOffset(n.length,!1),2):0},Ef={continue:function(e,t){var n=e.currentLine,r=n.match(Cf);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},Mf=[/./,/<\/(?:script|pre|style)>/i,/-->/,/\?>/,/>/,/\]\]>/],Nf=/^[#`~*+_=<>0-9-;$]/,Sf=/\r\n|\n|\r/;function Df(){return Kp("document",[[1,1],[0,0]])}var Lf={smart:!1,tagFilter:!1,extendedAutolinks:!1,disallowedHtmlBlockTags:[],referenceDefinition:!1,disallowDeepHeading:!1,customParser:null,frontMatter:!1},Af=function(){function e(e){this.options=Pc(Pc({},Lf),e),this.doc=Df(),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&&(lf.frontMatter=Ef,xf.unshift(Tf)),this.inlineParser=new Ud(this.options)}return e.prototype.advanceOffset=function(e,t){void 0===t&&(t=!1);for(var n,r,i,o=this.currentLine;e>0&&(i=o[this.offset]);)"\t"===i?(n=4-this.column%4,t?(this.partiallyConsumedTab=n>e,r=n>e?e:n,this.column+=r,this.offset+=this.partiallyConsumedTab?0:1,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("\t"!==e)break;n++,r+=4-r%4}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+=Lp(" ",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(;!lf[this.tip.type].canContain(e);)this.finalize(this.tip,this.lineNumber-1);var n=t+1,r=Kp(e,[[this.lineNumber,n],[0,0]]);return r.stringContent="",this.tip.appendChild(r),this.tip=r,r},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],lf[e.type].finalize(this,e),this.tip=n},e.prototype.processInlines=function(e){var t,n=this.options.customParser,r=e.walker();
2for(this.inlineParser.refMap=this.refMap,this.inlineParser.refLinkCandidateMap=this.refLinkCandidateMap,this.inlineParser.refDefCandidateMap=this.refDefCandidateMap,this.inlineParser.options=this.options;t=r.next();){var i=t.node,o=t.entering,a=i.type;n&&n[a]&&n[a](i,{entering:o,options:this.options}),o||"paragraph"!==a&&"heading"!==a&&("tableCell"!==a||i.ignored)||this.inlineParser.parse(i)}},e.prototype.incorporateLine=function(e){var t=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,"\ufffd")),this.currentLine=e;for(var n,r=!0;(n=t.lastChild)&&n.open;){switch(t=n,this.findNextNonspace(),lf[t.type].continue(this,t)){case 0:break;case 1:r=!1;break;case 2:return void(this.lastLineLength=e.length);default:throw new Error("continue returned illegal value, must be 0, 1, or 2")}if(!r){t=t.parent;break}}this.allClosed=t===this.oldtip,this.lastMatchedContainer=t;for(var i="paragraph"!==t.type&&lf[t.type].acceptsLines,o=xf.length;!i;){if(this.findNextNonspace(),"table"!==t.type&&"tableBody"!==t.type&&"paragraph"!==t.type&&!this.indented&&!Nf.test(e.slice(this.nextNonspace))){this.advanceNextNonspace();break}for(var a=0;a<o;){var s=xf[a](this,t);if(1===s){t=this.tip;break}if(2===s){t=this.tip,i=!0;break}a++}if(a===o){this.advanceNextNonspace();break}}if(this.allClosed||this.blank||"paragraph"!==this.tip.type){this.closeUnmatchedBlocks(),this.blank&&t.lastChild&&(t.lastChild.lastLineBlank=!0);for(var l=t.type,u=this.blank&&!("blockQuote"===l||Xp(t)&&t.isFenced||"item"===l&&!t.firstChild&&t.sourcepos[0][0]===this.lineNumber),c=t;c;)c.lastLineBlank=u,c=c.parent;lf[l].acceptsLines?(this.addLine(),"htmlBlock"===t.type&&t.htmlBlockType>=1&&t.htmlBlockType<=5&&Mf[t.htmlBlockType].test(this.currentLine.slice(this.offset))&&(this.lastLineLength=e.length,this.finalize(t,this.lineNumber))):this.offset<e.length&&!this.blank&&(t=this.addChild("paragraph",this.offset),this.advanceNextNonspace(),this.addLine())}else this.addLine();this.lastLineLength=e.length},e.prototype.parse=function(e,t){this.doc=Df(),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(Sf),r=n.length;this.lines=t||n,this.options.referenceDefinition&&this.clearRefMaps(),10===e.charCodeAt(e.length-1)&&(r-=1);for(var i=0;i<r;i++)this.incorporateLine(n[i]);for(;this.tip;)this.finalize(this.tip,r);return this.processInlines(this.doc),this.doc},e.prototype.partialParseStart=function(e,t){this.doc=Df(),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){var t;t=e,Object.keys(t).forEach((function(e){delete t[e]}))}))},e}();function Of(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 If(e,t){var n=e[0];return 1===Of(e[1],t)?1:-1===Of(n,t)?-1:0}function Rf(e,t){for(var n=0,r=t;n<r.length;n++){var i=r[n];e.insertBefore(i)}}function Pf(e,t){var n=e[0];return e[1][0]<t?1:n[0]>t?-1:0}function Bf(e,t){for(var n=e.firstChild;n;){var r=Pf(n.sourcepos,t);if(0===r)return n;if(-1===r)return n.prev||n;n=n.next}return e.lastChild}function Ff(e){return function(e){return Pp[e]}(e)||null}function Hf(e,t,n){if(void 0===n&&(n=null),t)for(var r=t.walker();t&&t!==n;){e(t);var i=r.next();if(!i)break;t=i.node}}var qf=/\r\n|\n|\r/;function zf(e){return{id:e.id,title:e.title,sourcepos:e.sourcepos,unlinked:!1,destination:e.dest}}var jf=function(){function e(e,t){this.refMap={},this.refLinkCandidateMap={},this.refDefCandidateMap={},this.referenceDefinition=!!(null===t||void 0===t?void 0:t.referenceDefinition),this.parser=new Af(t),this.parser.setRefMaps(this.refMap,this.refLinkCandidateMap,this.refDefCandidateMap),this.eventHandlerMap={change:[]},e=e||"",this.lineTexts=e.split(qf),this.root=this.parser.parse(e,this.lineTexts)}return e.prototype.updateLineTexts=function(e,t,n){var r,i=e[0],o=e[1],a=t[0],s=t[1],l=n.split(qf),u=l.length,c=this.lineTexts[i-1],p=this.lineTexts[a-1];l[0]=c.slice(0,o-1)+l[0],l[u-1]=l[u-1]+p.slice(s-1);var d=a-i+1;return(r=this.lineTexts).splice.apply(r,Bc([i-1,d],l)),u-d},e.prototype.updateRootNodeState=function(){if(1===this.lineTexts.length&&""===this.lineTexts[0])return this.root.lastLineBlank=!0,void(this.root.sourcepos=[[1,1],[1,0]]);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){e?(Rf(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,i=0,o=["parent","prev","next"];i<o.length;i++){var a=o[i];n[a]&&(Bp(n[a].id),n[a]=null)}n=r}e.next=t.next,t.next?t.next.prev=e:e.parent.lastChild=e}}
2(e,t),[e.id,t.id].forEach((function(e){return Bp(e)})),e.unlink()):t?(Rf(t,n),Bp(t.id),t.unlink()):function(e,t){for(var n=t.length-1;n>=0;n-=1)e.prependChild(t[n])}(this.root,n)},e.prototype.getNodeRange=function(e,t){var n=Bf(this.root,e[0]),r=Bf(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){var i;e&&e.prev&&(Qp(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 bf.test(n)||wf.test(n)}(this.lineTexts[n-1])||"table"===e.prev.type&&(!Qd(i=this.lineTexts[n-1])&&-1!==i.indexOf("|")))&&(n=(e=e.prev).sourcepos[0][0]);for(var o=this.lineTexts.slice(n-1,r),a=this.parser.partialParseStart(n,o),s=t?t.next:this.root.firstChild,l=a.lastChild,u=l&&Xp(l)&&l.open,c=l&&ed(l)&&l.open,p=l&&Qp(l);(u||c)&&s||p&&s&&("list"===s.type||s.sourcepos[0][1]>=2);){var d=this.extendEndLine(s.sourcepos[1][0]);this.parser.partialParseExtends(this.lineTexts.slice(r,d)),e||(e=t),t=s,r=d,s=s.next}return this.parser.partialParseFinish(),{newNodes:function(e){for(var t=[],n=e.firstChild;n;)t.push(n),n=n.next;return t}(a),extStartNode:e,extEndNode:t}},e.prototype.getRemovedNodeRange=function(e,t){return!e||e&&Yp(e)||t&&Yp(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(!bd(this.refMap)){var r=function(e){if(Yp(e)){var t=n.refMap[e.label];t&&e.id===t.id&&(t.unlinked=!0)}};e&&Hf(r,e.parent,t),t&&Hf(r,t)}},e.prototype.replaceWithNewRefDefState=function(e){var t=this;if(!bd(this.refMap)){var n=function(e){if(Yp(e)){var n=e.label,r=t.refMap[n];r&&!r.unlinked||(t.refMap[n]=zf(e))}};e.forEach((function(e){Hf(n,e)}))}},e.prototype.replaceWithRefDefCandidate=function(){var e=this;bd(this.refDefCandidateMap)||yd(this.refDefCandidateMap,(function(t,n){var r=n.label,i=n.sourcepos,o=e.refMap[r];(!o||o.unlinked||o.sourcepos[0][0]>i[0][0])&&(e.refMap[r]=zf(n))}))},e.prototype.getRangeWithRefDef=function(e,t,n,r,i){if(this.referenceDefinition&&!bd(this.refMap)){var o=Bf(this.root,e-1),a=Bf(this.root,t+1);o&&Yp(o)&&o!==n&&o!==r&&(e=(n=o).sourcepos[0][0]),a&&Yp(a)&&a!==n&&a!==r&&(r=a,t=this.extendEndLine(r.sourcepos[1][0]+i))}return[n,r,e,t]},e.prototype.parse=function(e,t,n){void 0===n&&(n=0);var r=this.getNodeRange(e,t),i=r[0],o=r[1],a=i?Math.min(i.sourcepos[0][0],e[0]):e[0],s=this.extendEndLine((o?Math.max(o.sourcepos[1][0],t[0]):t[0])+n),l=this.parseRange.apply(this,this.getRangeWithRefDef(a,s,i,o,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 bd(this.refMap)||yd(this.refMap,(function(n,r){r.unlinked&&delete e.refMap[n],yd(e.refLinkCandidateMap,(function(r,i){var o=i.node;i.refLabel===n&&t.push(e.parse(o.sourcepos[0],o.sourcepos[1]))}))})),t},e.prototype.removeUnlinkedCandidate=function(){bd(this.refDefCandidateMap)||[this.refLinkCandidateMap,this.refDefCandidateMap].forEach((function(e){yd(e,(function(t){(function(e){var t=Ff(e);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),i=this.parse(e,t,r),o=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=Pc({},e);return t.forEach((function(e){delete r[e]})),r}(i,"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 i=n.node;n.entering&&(i.sourcepos[0][0]+=t,i.sourcepos[1][0]+=t)}}}(i.nextNode,r),this.updateRootNodeState();var a=[o];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 i=If(n.sourcepos,t);if(0===i){if(!n.firstChild)return n;r=n,n=n.firstChild}else{if(-1===i)return r;if(!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 i=Pf(n.sourcepos,t);if(0===i){if(n.sourcepos[0][0]===t||!n.firstChild)return n;r=n,n=n.firstChild}else{if(-1===i)break;r=n,n=n.next}}return r?function(e){for(;e.parent&&"document"!==e.parent.type&&e.parent.sourcepos[0][0]===e.sourcepos[0][0];)e=e.parent;return e}(function(e){for(;e.lastChild;)e=e.lastChild;return e}(r)):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 Ff(e)},e.prototype.removeAllNode=function(){Pp={}},e}(),Vf=new RegExp("<(/?(?:"+["title","textarea","style","xmp","iframe","noembed","noframes","script","plaintext"].join("|")+")[^>]*>)","ig");function _f(e){return Vf.test(e)?e.replace(Vf,(function(e,t){return"&lt;"+t})):e}var Uf={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,i=null===(n=e.parent)||void 0===n?void 0:n.parent;return i&&"list"===i.type&&i.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,inner
2NewLine:!0}},list:function(e,t){var n=t.entering,r=e.listData,i=r.type,o=r.start,a="bullet"===i?"ul":"ol",s={};return"ol"===a&&null!==o&&1!==o&&(s.start=o.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?_f(e.literal):e.literal}},htmlBlock:function(e,t){var n=t.options,r=n.tagFilter?_f(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-"+Dp(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,r=n.title,i=n.destination;return{type:"openTag",tagName:"a",attributes:Pc({href:Dp(i)},r&&{title:Dp(r)})}}return{type:"closeTag",tagName:"a"}},image:function(e,t){var n=t.getChildrenText,r=t.skipChildren,i=e,o=i.title,a=i.destination;return r(),{type:"openTag",tagName:"img",selfClose:!0,attributes:Pc({src:Dp(a),alt:n(e)},o&&{title:Dp(o)})}},customBlock:function(e,t,n){var r=e.info.trim().toLowerCase(),i=n[r];if(i)try{return i(e,t)}catch(o){console.warn("[@toast-ui/editor] - The error occurred when "+r+" block node was parsed in markdown renderer: "+o)}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,i=r.info,o=r.firstChild,a=i.trim().toLowerCase(),s=n[a],l=t.entering;if(s)try{return s(e,t)}catch(u){console.warn("[@toast-ui/editor] - The error occurred when "+a+" inline node was parsed in markdown renderer: "+u)}return l?[{type:"openTag",tagName:"span"},{type:"text",content:"$$"+i+(o?" ":"")}]:[{type:"text",content:"$$"},{type:"closeTag",tagName:"span"}]}},$f={strike:function(e,t){return{type:t.entering?"openTag":"closeTag",tagName:"del"}},item:function(e,t){var n=t.entering,r=e.listData,i=r.checked,o=r.task;if(n){var a={type:"openTag",tagName:"li",outerNewLine:!0};return o?[a,{type:"openTag",tagName:"input",selfClose:!0,attributes:Pc(Pc({},i&&{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,i=e.lastChild.endIdx+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,i="tableHead"===r.type?"th":"td",o=r.parent.columns[e.startIdx],a=(null===o||void 0===o?void 0:o.align)?{align:o.align}:null;return n?Pc({type:"openTag",tagName:i,outerNewLine:!0},a&&{attributes:a}):{type:"closeTag",tagName:i,outerNewLine:!0}}},Zf={softbreak:"\n",gfm:!1,tagFilter:!1,nodeId:!1};function Wf(e){for(var t=[],n=e.walker(),r=null;r=n.next();){var i=r.node;"text"===i.type&&t.push(i.literal)}return t.join("")}var Gf=function(){function e(e){this.buffer=[],this.options=Pc(Pc({},Zf),e),this.convertors=this.createConvertors(),delete this.options.convertors}return e.prototype.createConvertors=function(){var e=Pc({},Uf);if(this.options.gfm&&(e=Pc(Pc({},e),$f)),this.options.convertors){var t=this.options.convertors,n=Object.keys(t),r=Pc(Pc({},Uf),$f);
2n.forEach((function(n){var i=e[n],o=t[n],a=-1===Object.keys(r).indexOf(n)?n.toLowerCase():n;e[a]=i?function(e,t,n){return t.origin=function(){return i(e,t,n)},o(e,t)}:o}))}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,i=function(){var e=r.node,i=r.entering,a=o.convertors[e.type];if(!a)return"continue";var s=!1,l={entering:i,leaf:!Ip(e),options:o.options,getChildrenText:Wf,skipChildren:function(){s=!0}},u=ed(e)||function(e){return"customInline"===e.type}(e)?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()))},o=this;r=n.next();)i();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,i=e.attributes;this.buffer.push("<"+n),r&&r.length>0&&this.buffer.push(' class="'+r.join(" ")+'"'),i&&Object.keys(i).forEac
2h((function(e){var n=i[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"!==vd(vd(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(Dp(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}();var Jf=Object.hasOwnProperty,Kf=Object.setPrototypeOf,Xf=Object.isFrozen,Qf=Object.getPrototypeOf,Yf=Object.getOwnPropertyDescriptor,eh=Object.freeze,th=Object.seal,nh=Object.create,rh="undefined"!==typeof Reflect&&Reflect,ih=rh.apply,oh=rh.construct;ih||(ih=function(e,t,n){return e.apply(t,n)}),eh||(eh=function(e){return e}),th||(th=function(e){return e}),oh||(oh=function(e,t){return new(Function.prototype.bind.apply(e,[null].concat(function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(t))))});var ah,sh=gh(Array.prototype.forEach),lh=gh(Array.prototype.pop),uh=gh(Array.prototype.push),ch=gh(String.prototype.toLowerCase),ph=gh(String.prototype.match),dh=gh(String.prototype.replace),fh=gh(String.prototype.indexOf),hh=gh(String.prototype.trim),mh=gh(RegExp.prototype.test),vh=(ah=TypeError,function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return oh(ah,t)});function gh(e){return function(t){for(var n=arguments.length,r=Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return ih(e,t,r)}}function yh(e,t){Kf&&Kf(e,null);for(var n=t.length;n--;){var r=t[n];if("string"===typeof r){var i=ch(r);i!==r&&(Xf(t)||(t[n]=i),r=i)}e[r]=!0}return e}function bh(e){var t=nh(null),n=void 0;for(n in e)ih(Jf,e,[n])&&(t[n]=e[n]);return t}function wh(e,t){for(;null!==e;){var n=Yf(e,t);if(n){if(n.get)return gh(n.get);if("function"===typeof n.value)return gh(n.value)}e=Qf(e)}return function(e){return console.warn("fallback value for",e),null}}var kh=eh(["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"]),xh=eh(["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"]),Ch=eh(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Th=eh(["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"]),Eh=eh(["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"]),Mh=eh(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Nh=eh(["#text"]),Sh=eh(["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","
2spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),Dh=eh(["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"]),Lh=eh(["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"]),Ah=eh(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Oh=th(/\{\{[\s\S]*|[\s\S]*\}\}/gm),Ih=th(/<%[\s\S]*|[\s\S]*%>/gm),Rh=th(/^data-[\-\w.\u00B7-\uFFFF]/),Ph=th(/^aria-[\-\w]+$/),Bh=th(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Fh=th(/^(?:\w+script|data):/i),Hh=th(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),qh="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 zh(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var jh=function(){return"undefined"===typeof window?null:window};var Vh=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:jh(),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,i=t.document,o=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=wh(v,"cloneNode"),y=wh(v,"nextSibling"),b=wh(v,"childNodes"),w=wh(v,"parentNode");if("function"===typeof a){var k=i.createElement("template");k.content&&k.content.ownerDocument&&(i=k.content.ownerDocument)}var x=function(e,t){if("object"!==("undefined"===typeof e?"undefined":qh(e))||"function"!==typeof e.createPolicy)return null;
2var n=null,r="data-tt-policy-suffix";t.currentScript&&t.currentScript.hasAttribute(r)&&(n=t.currentScript.getAttribute(r));var i="dompurify"+(n?"#"+n:"");try{return e.createPolicy(i,{createHTML:function(e){return e}})}catch(o){return console.warn("TrustedTypes policy "+i+" could not be created."),null}}(m,r),C=x&&te?x.createHTML(""):"",T=i,E=T.implementation,M=T.createNodeIterator,N=T.createDocumentFragment,S=T.getElementsByTagName,D=r.importNode,L={};try{L=bh(i).documentMode?i.documentMode:{}}catch(Fe){}var A={};n.isSupported="function"===typeof w&&E&&"undefined"!==typeof E.createHTMLDocument&&9!==L;var O=Oh,I=Ih,R=Rh,P=Ph,B=Fh,F=Hh,H=Bh,q=null,z=yh({},[].concat(zh(kh),zh(xh),zh(Ch),zh(Eh),zh(Nh))),j=null,V=yh({},[].concat(zh(Sh),zh(Dh),zh(Lh),zh(Ah))),_=null,U=null,$=!0,Z=!0,W=!1,G=!1,J=!1,K=!1,X=!1,Q=!1,Y=!1,ee=!0,te=!1,ne=!0,re=!0,ie=!1,oe={},ae=null,se=yh({},["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"]),le=null,ue=yh({},["audio","video","img","source","image","track"]),ce=null,pe=yh({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),de="http://www.w3.org/1998/Math/MathML",fe="http://www.w3.org/2000/svg",he="http://www.w3.org/1999/xhtml",me=he,ve=!1,ge=void 0,ye=["application/xhtml+xml","text/html"],be=void 0,we=null,ke=i.createElement("form"),xe=function(e){we&&we===e||(e&&"object"===("undefined"===typeof e?"undefined":qh(e))||(e={}),e=bh(e),q="ALLOWED_TAGS"in e?yh({},e.ALLOWED_TAGS):z,j="ALLOWED_ATTR"in e?yh({},e.ALLOWED_ATTR):V,ce="ADD_URI_SAFE_ATTR"in e?yh(bh(pe),e.ADD_URI_SAFE_ATTR):pe,le="ADD_DATA_URI_TAGS"in e?yh(bh(ue),e.ADD_DATA_URI_TAGS):ue,ae="FORBID_CONTENTS"in e?yh({},e.FORBID_CONTENTS):se,_="FORBID_TAGS"in e?yh({},e.FORBID_TAGS):{},U="FORBID_ATTR"in e?yh({},e.FORBID_ATTR):{},oe="USE_PROFILES"in e&&e.USE_PROFILES,$=!1!==e.ALLOW_ARIA_ATTR,Z=!1!==e.ALLOW_DATA_ATTR,W=e.ALLOW_UNKNOWN_PROTOCOLS||!1,G=e.SAFE_FOR_TEMPLATES||!1,J=e.WHOLE_DOCUMENT||!1,Q=e.RETURN_DOM||!1,Y=e.RETURN_DOM_FRAGMENT||!1,ee=!1!==e.RETURN_DOM_IMPORT,te=e.RETURN_TRUSTED_TYPE||!1,X=e.FORCE_BODY||!1,ne=!1!==e.SANITIZE_DOM,re=!1!==e.KEEP_CONTENT,ie=e.IN_PLACE||!1,H=e.ALLOWED_URI_REGEXP||H,me=e.NAMESPACE||he,ge=ge=-1===ye.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,be="application/xhtml+xml"===ge?function(e){return e}:ch,G&&(Z=!1),Y&&(Q=!0),oe&&(q=yh({},[].concat(zh(Nh))),j=[],!0===oe.html&&(yh(q,kh),yh(j,Sh)),!0===oe.svg&&(yh(q,xh),yh(j,Dh),yh(j,Ah)),!0===oe.svgFilters&&(yh(q,Ch),yh(j,Dh),yh(j,Ah)),!0===oe.mathMl&&(yh(q,Eh),yh(j,Lh),yh(j,Ah))),e.ADD_TAGS&&(q===z&&(q=bh(q)),yh(q,e.ADD_TAGS)),e.ADD_ATTR&&(j===V&&(j=bh(j)),yh(j,e.ADD_ATTR)),e.ADD_URI_SAFE_ATTR&&yh(ce,e.ADD_URI_SAFE_ATTR),e.FORBID_CONTENTS&&(ae===se&&(ae=bh(ae)),yh(ae,e.FORBID_CONTENTS)),re&&(q["#text"]=!0),J&&yh(q,["html","head","body"]),q.table&&(yh(q,["tbody"]),delete _.tbody),eh&&eh(e),we=e)},Ce=yh({},["mi","mo","mn","ms","mtext"]),Te=yh({},["foreignobject","desc","title","annotation-xml"]),Ee=yh({},xh);yh(Ee,Ch),yh(Ee,Th);var Me=yh({},Eh);yh(Me,Mh);var Ne=function(e){uh(n.removed,{element:e});try{e.parentNode.removeChild(e)}catch(Fe){try{e.outerHTML=C}catch(Fe){e.remove()}}},Se=function(e,t){try{uh(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(Fe){uh(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!j[e])if(Q||Y)try{Ne(t)}catch(Fe){}else try{t.setAttribute(e,"")}catch(Fe){}},De=function(e){var t=void 0,n=void 0;if(X)e="<remove></remove>"+e;else{var r=ph(e,/^[\r\n\t ]+/);n=r&&r[0]}"application/xhtml+xml"===ge&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");var o=x?x.createHTML(e):e;if(me===he)try{t=(new h).parseFromString(o,ge)}catch(Fe){}if(!t||!t.documentElement){t=E.createDocument(me,"template",null);try{t.documentElement.innerHTML=ve?"":o}catch(Fe){}}var a=t.body||t.documentElement;return e&&n&&a.insertBefore(i.createTextNode(n),a.childNodes[0]||null),me===he?S.call(t,J?"html":"body")[0]:J?t.documentElement:a},Le=function(e){return M.call(e.ownerDocument||e,e,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT,null,!1)},Ae=function(e){return"object"===("undefined"===typeof s?"undefined":qh(s))?e instanceof s:e&&"object"===("undefined"===typeof e?"undefined":qh(e))&&"number"===typeof e.nodeType&&"string"===typeof e.nodeName},Oe=function(e,t,r){A[e]&&sh(A[e],(function(e){e.call(n,t,r,we)}))},Ie=function(e){var t,r=void 0;if(Oe("beforeSanitizeElements",e,null),!((t=e)instanceof d||t instanceof f)&&!("string"===typeof t.nodeName&&"string"===typeof t.textContent&&"function"===typeof t.removeChild&&t.attributes instanceof p&&"function"===typeof t.removeAttribute&&"function"===typeof t.setAttribute&&"string"===typeof t.namespaceURI&&"function"===typeof t.insertBefore))return Ne(e),!0;if(ph(e.nodeName,/[\u0080-\uFFFF]/))return Ne(e),!0;var i=be(e.nodeName);if(Oe("uponSanitizeElement",e,{tagName:i,allowedTags:q}),!Ae(e.firstElementChild)&&(!Ae(e.content)||!Ae(e.content.firstElementChild))&&mh(/<[/\w]/g,e.innerHTML)&&mh(/<[/\w]/g,e.textContent))return Ne(e),!0;if("select"===i&&mh(/<template/i,e.innerHTML))return Ne(e),!0;if(!q[i]||_[i]){if(re&&!ae[i]){var o=w(e)||e.parentNode,a=b(e)||e.childNodes;if(a&&o)for(var s=a.length-1;s>=0;--s)o.insertBefore(g(a[s],!0),y(e))}return Ne(e),!0}return e instanceof l&&!function(e){var t=w(e);t&&t.tagName||(t={namespaceURI:he,tagName:"template"});var n=ch(e.tagName),r=ch(t.tagName);if(e.namespaceURI===fe)return t.namespaceURI===he?"svg"===n:t.namespaceURI===de?"svg"===n&&("annotation-xml"===r||Ce[r]):Boolean(Ee[n]);if(e.namespaceURI===de)return t.namespaceURI===he?"math"===n:t.namespaceURI===fe?"math"===n&&Te[r]:Boolean(Me[n]);if(e.namespaceURI===he){if(t.namespaceURI===fe&&!Te[r])return!1;if(t.namespaceURI===de&&!Ce[r])return!1;var i=yh({}
2,["title","style","font","a","script"]);return!Me[n]&&(i[n]||!Ee[n])}return!1}(e)?(Ne(e),!0):"noscript"!==i&&"noembed"!==i||!mh(/<\/no(script|embed)/i,e.innerHTML)?(G&&3===e.nodeType&&(r=e.textContent,r=dh(r,O," "),r=dh(r,I," "),e.textContent!==r&&(uh(n.removed,{element:e.cloneNode()}),e.textContent=r)),Oe("afterSanitizeElements",e,null),!1):(Ne(e),!0)},Re=function(e,t,n){if(ne&&("id"===t||"name"===t)&&(n in i||n in ke))return!1;if(Z&&!U[t]&&mh(R,t));else if($&&mh(P,t));else{if(!j[t]||U[t])return!1;if(ce[t]);else if(mh(H,dh(n,F,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==fh(n,"data:")||!le[e]){if(W&&!mh(B,dh(n,F,"")));else if(n)return!1}else;}return!0},Pe=function(e){var t=void 0,r=void 0,i=void 0,o=void 0;Oe("beforeSanitizeAttributes",e,null);var a=e.attributes;if(a){var s={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:j};for(o=a.length;o--;){var l=t=a[o],u=l.name,c=l.namespaceURI;if(r=hh(t.value),i=be(u),s.attrName=i,s.attrValue=r,s.keepAttr=!0,s.forceKeepAttr=void 0,Oe("uponSanitizeAttribute",e,s),r=s.attrValue,!s.forceKeepAttr&&(Se(u,e),s.keepAttr))if(mh(/\/>/i,r))Se(u,e);else{G&&(r=dh(r,O," "),r=dh(r,I," "));var p=be(e.nodeName);if(Re(p,i,r))try{c?e.setAttributeNS(c,u,r):e.setAttribute(u,r),lh(n.removed)}catch(Fe){}}}Oe("afterSanitizeAttributes",e,null)}},Be=function e(t){var n=void 0,r=Le(t);for(Oe("beforeSanitizeShadowDOM",t,null);n=r.nextNode();)Oe("uponSanitizeShadowNode",n,null),Ie(n)||(n.content instanceof o&&e(n.content),Pe(n));Oe("afterSanitizeShadowDOM",t,null)};return n.sanitize=function(e,i){var a=void 0,l=void 0,u=void 0,c=void 0,p=void 0;if((ve=!e)&&(e="\x3c!--\x3e"),"string"!==typeof e&&!Ae(e)){if("function"!==typeof e.toString)throw vh("toString is not a function");if("string"!==typeof(e=e.toString()))throw vh("dirty is not a string, aborting")}if(!n.isSupported){if("object"===qh(t.toStaticHTML)||"function"===typeof t.toStaticHTML){if("string"===typeof e)return t.toStaticHTML(e);if(Ae(e))return t.toStaticHTML(e.outerHTML)}return e}if(K||xe(i),n.removed=[],"string"===typeof e&&(ie=!1),ie);else if(e instanceof s)1===(l=(a=De("\x3c!----\x3e")).ownerDocument.importNode(e,!0)).nodeType&&"BODY"===l.nodeName||"HTML"===l.nodeName?a=l:a.appendChild(l);else{if(!Q&&!G&&!J&&-1===e.indexOf("<"))return x&&te?x.createHTML(e):e;if(!(a=De(e)))return Q?null:C}a&&X&&Ne(a.firstChild);for(var d=Le(ie?e:a);u=d.nextNode();)3===u.nodeType&&u===c||Ie(u)||(u.content instanceof o&&Be(u.content),Pe(u),c=u);if(c=null,ie)return e;if(Q){if(Y)for(p=N.call(a.ownerDocument);a.firstChild;)p.appendChild(a.firstChild);else p=a;return ee&&(p=D.call(r,p,!0)),p}var f=J?a.outerHTML:a.innerHTML;return G&&(f=dh(f,O," "),f=dh(f,I," ")),x&&te?x.createHTML(f):f},n.setConfig=function(e){xe(e),K=!0},n.clearConfig=function(){we=null,K=!1},n.isValidAttribute=function(e,t,n){we||xe({});var r=be(e),i=be(t);return Re(r,i,n)},n.addHook=function(e,t){"function"===typeof t&&(A[e]=A[e]||[],uh(A[e],t))},n.removeHook=function(e){A[e]&&lh(A[e])},n.removeHooks=function(e){A[e]&&(A[e]=[])},n.removeAllHooks=function(){A={}},n}(),_h=["iframe","embed"],Uh=[];function $h(e){Wa(_h,e)&&Uh.push(e.toLowerCase())}function Zh(e,t){return Vh.sanitize(e,Jo({ADD_TAGS:Uh,ADD_ATTR:["rel","target","hreflang","type"],FORBID_TAGS:["input","script","textarea","form","button","select","meta","style","link","title","object","base"]},t))}function Wh(e,t){return e.literal.replace(new RegExp("(<\\s*"+t+"[^>]*>)|(</"+t+"\\s*[>])","ig"),"").trim()}function Gh(e){var t=(e=e.match(il)[0]).match(new RegExp(tl,"g"));return t?t.reduce((function(e,t){var n=t.trim().split("="),r=n[0],i=n.slice(1);return i.length&&(e[r]=i.join("=").replace(/'|"/g,"").trim()),e}),{}):{}}function Jh(e){return ds(e.attributes).reduce((function(e,t){return e[t.nodeName]=t.nodeValue,e}),{})}function Kh(e,t,n,r){var i=r.getToDOMNode(t)(e),o=n(i.outerHTML),a=document.createElement("div");return a.innerHTML=o,{dom:i=a.firstChild,htmlAttrs:Jh(i)}}var Xh={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:Jh(e),childrenHTML:e.innerHTML}}}],toDOM:function(r){var i=Kh(r,e,t,n),o=i.dom,a=i.htmlAttrs;return a.class=a.class?a.class+" html-block":"html-block",Ko([e,a],ds(o.childNodes))}}},htmlInline:function(e,t,n){return{attrs:{htmlAttrs:{default:{}},htmlInline:{default:!0}},parseDOM:[{tag:e,getAttrs:function(e){return{htmlAttrs:Jh(e)}}}],toDOM:function(r){var i=Kh(r,e,t,n).htmlAttrs;return[e,i,0]}}}};var Qh=/^\s*<\s*\//,Yh={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=[];
2return 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,n=t.fenceLength,r=t.info,i=r?r.split(/\s+/):[],o=[],a={};if(n>3&&(a["data-backticks"]=n),i.length>0&&i[0].length>0){var s=i[0];o.push("lang-"+s),a["data-language"]=s}return[{type:"openTag",tagName:"pre",classNames:o},{type:"openTag",tagName:"code",attributes:a},{type:"text",content:e.literal},{type:"closeTag",tagName:"code"},{type:"closeTag",tagName:"pre"}]},customInline:function(e,t){var n=t.origin,r=t.entering,i=t.skipChildren,o=e.info;return-1!==o.indexOf("widget")&&r?(i(),[{type:"openTag",tagName:"span",classNames:["tui-widget"]},{type:"html",content:qs(o,Us(e)).outerHTML},{type:"closeTag",tagName:"span"}]):n()}};function em(e,t){var n=Jo({},Yh);return e&&(n.link=function(t,n){var r=n.entering,i=(0,n.origin)();return r&&(i.attributes=Jo(Jo({},i.attributes),e)),i}),t&&Object.keys(t).forEach((function(e){var r=n[e],i=t[e];r&&Al(i)?n[e]=function(e,t){var n=Jo({},t);return n.origin=function(){return r(e,t)},i(e,n)}:Wa(["htmlBlock","htmlInline"],e)&&!Al(i)?n[e]=function(e,t){var n=e.literal.match(il);if(n){var r=n[0],o=n[1],a=n[3],s=(o||a).toLowerCase(),l=i[s],u=Wh(e,s);if(l){var c=Jo({},e);return c.attrs=Gh(r),c.childrenHTML=u,c.type=s,t.entering=!Qh.test(e.literal),l(c,t)}}return t.origin()}:n[e]=i})),n}var tm=["list","item","blockQuote"],nm=["UL","OL","BLOCKQUOTE"];function rm(e,t){var n,r=e.child(t);return!r.childCount||1===r.childCount&&!(null===(n=r.firstChild.text)||void 0===n?void 0:n.trim())}function im(e,t,n){var r=bs(t)-1,i=ws(t)-1,o=n[r].getBoundingClientRect(),a=n[i].offsetTop-n[r].offsetTop+n[i].clientHeight;return{height:a<=0?n[r].clientHeight:a+om(e,n,Math.min(i+1,e.childCount-1)),rect:o}}function om(e,t,n){for(var r=e.childCount-1,i=0;n<=r&&rm(e,n);)i+=t[n].clientHeight,n+=1;return i}function am(e,t){for(var n=0;e&&e!==t&&(Wa(nm,e.tagName)||(n+=e.offsetTop),e.offsetParent!==t.offsetParent);)e=e.parentElement;return n}function sm(e,t,n){return e&&t>n+e.offsetTop?sm(e.nextElementSibling,t,n)||e:null}function lm(e,t){for(var n=e.querySelector('[data-nodeid="'+t.id+'"]');!n||Cs(t);)t=t.parent,n=e.querySelector('[data-nodeid="'+t.id+'"]');return function(e){var t=e.mdNode,n=e.el;for(;(Wa(tm,t.type)||"table"===t.type)&&t.firstChild;)t=t.firstChild,n=n.firstElementChild;return{mdNode:t,el:n}}({mdNode:t,el:n})}var um={};function cm(e){e&&(delete um[Number(e.getAttribute("data-nodeid"))],ds(e.children).forEach((function(e){cm(e)})))}function pm(e,t,n){var r,i=um[r=n]&&um[r].height,o=function(e){return um[e]&&um[e].offsetTop}(n),a=i||e.clientHeight,s=o||am(e,t)||e.offsetTop;return i||function(e,t){um[e]=um[e]||{},um[e].height=t}(n,a),o||function(e,t){um[e]=um[e]||{},um[e].offsetTop=t}(n,s),{nodeHeight:a,offsetTop:s}}var dm=cl("md-preview-highlight");var fm=function(){function e(e,t){var n=document.createElement("div");this.el=n,this.eventEmitter=e,this.isViewer=!!t.isViewer,this.el.className=cl("md-preview");var r=t.linkAttributes,i=t.customHTMLRenderer,o=t.sanitizer,a=t.highlight,s=void 0!==a&&a;this.renderer=new Gf({gfm:!0,nodeId:!0,convertors:em(r,i)}),this.cursorNodeId=null,this.sanitizer=o,this.initEvent(s),this.initContentSection(),this.isViewer&&(this.previewContent.style.overflowWrap="break-word")}return e.prototype.initContentSection=function(){this.previewContent=ml('<div class="'+cl("contents")+'"></div>'),this.isViewer||this.el.appendChild(this.previewContent)},e.prototype.toggleActive=function(e){hl(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()}))),Oc(this.el,"scroll",(function(e){t.eventEmitter.emit("scroll","preview",function(e,t){for(var n=t,r=null;n;){var i=n.firstElementChild;if(!i)break;r=n,n=sm(i,e,am(n,t))}var o=n||r;return o===t?null:o}(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&&Na(e,dm)}},e.prototype.updateCursorNode=function(e,t){e&&("tableRow"===(e=Ss(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&&!(ks(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),i=this.getElementByNodeId(n);r&&Na(r,dm),i&&xa(i,dm),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,i=this.previewContent,o=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",o);for(var p=u;p&&p!==c;){var d=p.nextElementSibling;fl(p),cm(p),p=d}(null===p||void 0===p?void 0:p.parentNode)&&(fl(p),cm(p))}}else i.insertAdjacentHTML("afterbegin",o)},e.prototype.getRenderer=function(){return this.renderer},e.prototype.destroy=function(){Nc(this.el,"scroll"),this.el=null},e.prototype.getElement=function(){return this.el},e.prototype.getHTML=function(){return wl(this.previewContent.innerHTML)},e.prototype.setHTML=function(e){this.previewContent.innerHTML=e},e.prototype.setHeight=function(e){ua(this.el,{height:e+"px"})},e.prototype.setMinHeight=function(e){ua(this.el,{minHeight:e+"px"})},e}();function hm(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}
2;n-=1}return null}function mm(e){return!!hm(e,(function(e){var t=e.type;return"listItem"===t.name||"bulletList"===t.name||"orderedList"===t.name}))}function vm(e){return!!hm(e,(function(e){var t=e.type;return"tableHeadCell"===t.name||"tableBodyCell"===t.name}))}function gm(e){return hm(e,(function(e){return"listItem"===e.type.name}))}function ym(e){return{tag:e,getAttrs:function(e){var t=e.getAttribute("data-raw-html");return Jo({},t&&{rawHTML:t})}}}function bm(e){return Object.keys(e).reduce((function(t,n){return"rawHTML"!==n&&e[n]&&(t[n="className"===n?"class":n]=e[n]),t}),{})}function wm(e){return{tag:e,getAttrs:function(e){return["rawHTML","colspan","rowspan","extended"].reduce((function(t,n){var r="rawHTML"===n?"data-raw-html":n,i=e.getAttribute(r);return i&&(t[n]=Wa(["rawHTML","extended"],n)?i:Number(i)),t}),{})}}}function km(e){var t=e.htmlAttrs,n=e.classNames;return Jo(Jo({},t),{class:n?n.join(" "):null})}function xm(e,t,n,r){var i=t.$from,o=t.$to,a=t.depth,s=t,l=!1;if(a>=2&&i.node(a-1).type.compatibleContent(n)&&0===t.startIndex&&i.index(a-1)){var u=e.doc.resolve(t.start-2);s=new z(u,u,a),t.endIndex<t.parent.childCount&&(t=new z(i,e.doc.resolve(o.end(a)),a)),l=!0}var c=function(e,t,n,r){var i=function(e,t){var n=e.parent,r=e.startIndex,i=e.endIndex,o=n.contentMatchAt(r).findWrapping(t);if(o){var a=o.length?o[0]:t;return n.canReplaceWith(r,i,a)?o:null}return null}(e,n),o=function(e,t){var n=e.parent,r=e.startIndex,i=e.endIndex,o=n.child(r),a=t.contentMatch.findWrapping(o.type);if(a){for(var s=(a.length?a[a.length-1]:t).contentMatch,l=r;s&&l<i;l+=1)s=s.matchType(n.child(l).type);if(s&&s.validEnd)return a}return null}(t,n);if(i&&o){var a=i.map((function(e){return{type:e}})),s=o.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,i){for(var o=t.start,a=t.end,s=t.startIndex,l=t.endIndex,u=t.parent,c=y.empty,p=n.length-1;p>=0;p-=1)c=y.from(n[p].type.create(n[p].attrs,c));e.step(new He(o-(r?2:0),a,o,a,new T(c,0,0),n.length,!0));var d=0;for(p=0;p<n.length;p+=1)if(n[p].type===i){d=p+1;break}for(var f=n.length-d,h=o+n.length-(r?2:0),m=(p=s,l);p<m;p+=1)!(p===s)&&_e(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 Cm(e,t){for(var n=e.resolve(t);"paragraph"!==n.node().type.name;)t-=2,n=e.resolve(t);return gm(n)}function Tm(e){return function(t,n){var r=t.selection,i=t.tr,o=r.$from,a=r.$to,s=o.blockRange(a);if(s){var l=mm(o)?function(e,t,n){var r=t.$from,i=t.$to,o=gm(r),a=gm(i);if(o&&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===o.offset)break;a=Cm(e.doc,s)}return e}(i,s,e):xm(i,s,e);return n(l),!0}return!1}}function Em(){return function(e,t){var n=e.selection,r=e.tr,i=e.schema,o=n.$from,a=n.$to,s=o.blockRange(a);if(s){var l=mm(o)?function(e,t){var n=t.$from,r=t.$to,i=gm(n),o=gm(r);if(i&&o)for(;o;){var a=o.offset,s={task:!o.node.attrs.task,checked:!1};if(e.setNodeMarkup(a,null,s),a===i.offset)break;o=Cm(e.doc,a)}return e}(r,s):xm(r,s,i.nodes.bulletList,{task:!0});return t(l),!0}return!1}}function Mm(e){return function(t,n){var r=t.tr,i=t.selection,o=i.$from,a=i.$to,s=o.blockRange(a,(function(t){var n=t.childCount,r=t.firstChild;return!!n&&r.type===e}));if(s){var l=o.node(s.depth-1).type===e?function(e,t,n){var r=t.$from,i=t.$to,o=t.end,a=t.depth,s=t.parent,l=i.end(a);return o<l&&(e.step(new He(o-1,l,o,l,new T(y.from(n.create(null,s.copy())),1,0),1,!0)),t=new z(e.doc.resolve(r.pos),e.doc.resolve(l),a)),e.lift(t,je(t)),e}(r,s,e):function(e,t){for(var n=t.parent,r=t.end,i=t.endIndex-1,o=t.startIndex;i>o;i-=1)r-=n.child(i).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?0:1),p+1,null===s||void 0===s?void 0:s.content.append(u?y.empty:y.from(n)));if(s&&d){var f=a.pos,h=f+s.nodeSize;e.step(new He(f-(l?1:0),h+(u?1:0),f+1,h-1,new T((l?y.empty:y.from(n.copy(y.empty))).append(u?y.empty:y.from(n.copy(y.empty))),l?0:1,u?0:1),l?0:1))}return e}(r,s);return n(l),!0}return!1}}function Nm(){return function(){return function(e,t){var n=e.selection,r=e.schema,i=n.$from,o=n.$to;return!(!i.blockRange(o)||!mm(i))&&function(e){return function(t,n){var r=t.tr,i=t.selection,o=i.$from,a=i.$to,s=o.blockRange(a,(function(t){var n=t.childCount,r=t.firstChild;return!!n&&r.type===e}));if(s&&s.startIndex>0){var l=s.parent,u=l.child(s.startIndex-1);if(u.type!==e)return!1;
2var c=u.lastChild&&u.lastChild.type===l.type,p=c?y.from(e.create()):null,d=new T(y.from(e.create(null,y.from(l.type.create(null,p)))),c?3:1,0),f=s.start,h=s.end;return r.step(new He(f-(c?3:1),h,f,h,d,1,!0)),n(r),!0}return!1}}(r.nodes.listItem)(e,t)}}}function Sm(){return{indent:Nm(),outdent:function(){return function(e,t){var n=e.selection,r=e.schema,i=n.$from,o=n.$to;return!(!i.blockRange(o)||!mm(i))&&Mm(r.nodes.listItem)(e,t)}}}}var Dm=new Map,Lm=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=hm(t,(function(e){return"table"===e.type.name}));if(n){var r=n.node,i=n.depth,o=n.offset,a=Dm.get(r);if((null===a||void 0===a?void 0:a.tableStartPos)===o+1)return a;var s=[],l=t.start(i),u=r.child(0),c=r.child(1),p=Am(u,l),d=Am(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 Dm.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 i=r+this.tableRows[n].nodeSize;if(n===e){for(var o=t;o<this.totalColumnCount&&this.rowInfo[n][o].offset<r;)o+=1;return o===this.totalColumnCount?i:this.rowInfo[n][o].offset}r=i}},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,i=n.nodeSize;return this.extendedRowspan(e,t)?this.posAt(e,t):r+i},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){var n,r,i;void 0===t&&(t=e),e.pos>t.pos&&(e=(n=[t,e])[0],t=n[1]);var o=this.getCellIndex(e),a=o[0],s=o[1],l=this.getCellIndex(t),u=l[0],c=l[1];
2return a=(r=cs(a,u))[0],u=r[1],s=(i=cs(s,c))[0],c=i[1],this.getSpannedOffsets({startRowIdx:a,startColIdx:s,endRowIdx:u,endColIdx:c})},e.prototype.getSpannedOffsets=function(e){return e},e}(),Am=function(e,t){var n=[];return e.forEach((function(e,r){var i={rowspanMap:{},colspanMap:{},length:0};e.forEach((function(e,n){for(var o=e.nodeSize,a=0;i[a];)a+=1;i[a]={offset:t+r+n+2,nodeSize:o},i.length+=1})),n.push(i)})),n};function Om(e,t){return us(Lm.prototype,e),Am=t,Lm}var Im=function(e){function t(t,n){void 0===n&&(n=t);var r=this,i=t.node(0),o=Lm.create(t),a=o.getRectOffsets(t,n),s=function(e,t,n){for(var r=n.startRowIdx,i=n.startColIdx,o=n.endRowIdx,a=n.endColIdx,s=[],l=r;l<=o;l+=1)for(var u=i;u<=a;u+=1){var c=t.getCellInfo(l,u),p=c.offset,d=c.nodeSize;s.push(new lt(e.resolve(p+1),e.resolve(p+d-1)))}return s}(i,o,a);return(r=e.call(this,s[0].$from,s[0].$to,s)||this).startCell=t,r.endCell=n,r.offsetMap=o,r.isCellSelection=!0,r.visible=!1,r}return Go(t,e),t.prototype.map=function(e,n){var r=this.startCell.pos,i=this.endCell.pos,o=e.resolve(n.map(r)),a=e.resolve(n.map(i)),s=Lm.create(o);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=a.end(a.depth-l),c=Math.min(u-4,a.pos);return pt.create(e,c)}return new t(o,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=this.startCell.node(-2),t=this.startCell.start(-2),n=e.child(1).firstChild,r=e.child(0).type.create(),i=e.child(1).type.create(),o=Lm.create(this.startCell),a=o.getRectOffsets(this.startCell,this.endCell),s=a.startRowIdx,l=a.startColIdx,u=a.endRowIdx,c=a.endColIdx,p=!1,d=s;d<=u;d+=1){for(var f=[],h=l;h<=c;h+=1){var m=o.getCellInfo(d,h).offset,v=e.nodeAt(m-t);v&&(p="tableHeadCell"===v.type.name,o.extendedRowspan(d,h)||o.extendedColspan(d,h)?f.push(v.type.create({extended:!0})):f.push(v.copy(v.content)))}var g=n.copy(y.from(f)),b=p?r:i;b.content=b.content.append(y.from(g))}return new T(function(e,t){var n=[];return e.childCount&&n.push(e),t.childCount&&n.push(t),y.from(n)}(r,i),1,1)},t.prototype.toJSON=function(){return JSON.stringify(this)},t}(st);function Rm(e,t,n,r){for(var i=n.nodes,o=i.tableRow,a=i.tableBodyCell,s=i.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(o.create(null,c))}return l}function Pm(e,t,n,r){void 0===r&&(r=null);for(var i=n.nodes,o=i.tableHeadCell,a=i.tableBodyCell,s=i.paragraph,l=0===t?o:a,u=[],c=0;c<e;c+=1)u.push(l.create(r,s.create()));return u}function Bm(e,t){for(;e&&e!==t;){if("TD"===e.nodeName||"TH"===e.nodeName)return e;e=e.parentNode}return null}function Fm(e){return hm(e,(function(e){var t=e.type;return"tableHeadCell"===t.name||"tableBodyCell"===t.name}))}function Hm(e){if(e instanceof pt){var t=e.$anchor,n=Fm(t);if(n){var r=t.node(0).resolve(t.before(n.depth));return{anchor:r,head:r}}}var i=e;return{anchor:i.startCell,head:i.endCell}}function qm(e){var t;if(e.size){var n=e.content,r=e.openStart,i=e.openEnd;if(1!==n.childCount)return null;for(;1===n.childCount&&(r>0&&i>0||"table"===(null===(t=n.firstChild)||void 0===t?void 0:t.type.name));)r-=1,i-=1,n=n.firstChild.content;if("tableHead"===n.firstChild.type.name||"tableBody"===n.firstChild.type.name)return n}return null}function zm(e){var t=e.startRowIdx,n=e.startColIdx;return{rowCount:e.endRowIdx-t+1,columnCount:e.endColIdx-n+1}}function jm(e,t){return Jo(Jo({},e.attrs),t)}var Vm=new Dt("cellSelection"),_m=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=Bm(e.target,this.view.dom);if(2!==e.button){if(t){var n=this.getCellPos(e);n&&(this.startCellPos=n),this.bindEvent()}}else e.preventDefault()},e.prototype.handleMousemove=function(e){var t,n=Vm.getState(this.view.state),r=this.getCellPos(e),i=this.startCellPos;n?t=this.view.state.doc.resolve(n):i!==r&&(t=i),t&&i&&r&&this.setCellSelection(i,r)},e.prototype.handleMouseup=function(){this.startCellPos=null,this.unbindEvent(),null!==Vm.getState(this.view.state)&&this.view.dispatch(this.view.state.tr.setMeta(Vm,-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 i=this.view.state.doc,o=i.resolve(r.pos),a=Fm(o);if(a){var s=o.before(a.depth);return i.resolve(s)}}return null},e.prototype.setCellSelection=function(e,t){var n=this.view.state,r=n.selection,i=n.tr,o=null===Vm.getState(this.view.state),a=new Im(e,t);if(o||!r.eq(a)){var s=i.setSelection(a);o&&s.setMeta(Vm,t.pos),this.view.dispatch(s)}},e.prototype.destroy=function(){this.view.dom.removeEventListener("mousedown",this.handlers.mousedown)},e}(),Um=cl("cell-selected");function $m(e){var t=e.selection,n=e.doc;if(t instanceof Im){var r=[];
2return t.ranges.forEach((function(e){var t=e.$from,n=e.$to;r.push(si.node(t.pos-1,n.pos+1,{class:Um}))})),ci.create(n,r)}return null}var Zm=function(){function e(){this.keys=[],this.values=[]}return e.prototype.getKeyIndex=function(e){return pa(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,i){r&&n.keys[i]&&e.call(t,r,n.keys[i],n)}))},e.prototype.clear=function(){this.keys=[],this.values=[]},e}(),Wm="en-US",Gm=function(){function e(){this.code=Wm,this.langs=new Zm}return e.prototype.setCode=function(e){this.code=e||Wm},e.prototype.setLanguage=function(e,t){var n=this;(e=[].concat(e)).forEac
2h((function(e){if(n.langs.has(e)){var r=n.langs.get(e);n.langs.set(e,Yo(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(Wm));var r=n[e];if(!r)throw new Error('There is no text key "'+e+'" in '+t);return r},e}(),Jm=new Gm,Km=[[{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"}]];function Xm(e,t){return Km.map((function(n){return n.map((function(n){var r=n.action,i=n.command,o=n.payload,a=n.disableInThead,s=n.className;return{label:Jm.get(r),onClick:function(){e.emit("command",i,o)},disabled:t&&!!a,className:s}}))})).concat()}var Qm=["image","link","customBlock","frontMatter"],Ym=["strong","strike","emph","code"],ev=["bulletList","orderedList","taskList"];function tv(e,t,n){var r=e.$from,i=e.$to,o=e.from,a=e.to,s={indent:{active:!1,disabled:!0},outdent:{active:!1,disabled:!0}};return t.nodesBetween(o,a,(function(e,t,o){var a=function(e,t){var n=e.type.name;return"listItem"===n?e.attrs.task?"taskList":t.type.name:-1!==n.indexOf("table")?"table":n}(e,o);Wa(Qm,a)||(Wa(ev,a)?(!function(e,t){t[e]={active:!0},ev.filter((function(t){return t!==e})).forEach((function(e){t[e]&&delete t[e]}))}(a,s),s.indent.disabled=!1,s.outdent.disabled=!1):"paragraph"===a||"text"===a?function(e,t,n,r){Ym.forEach((function(i){var o=n.marks[i],a=e.marksAcross(t)||[];o.isInSet(a)&&(r[i]={active:!0})}))}(r,i,n,s):s[a]={active:!0})})),s}function nv(e){return new Mt({view:function(){return{update:function(t){var n=t.state,r=n.selection,i=n.doc,o=n.schema;e.emit("changeToolbarState",{toolbarState:tv(r,i,o)})}}}})}var rv=function(){function e(e,t,n,r){var i=this;this.openEditor=function(){if(i.innerEditorView)throw new Error("The editor is already opened.");i.dom.draggable=!1,i.wrapper.style.display="none",i.innerViewContainer.style.display="block",i.innerEditorView=new Oi(i.innerViewContainer,{state:Tt.create({doc:i.node,plugins:[Ji({"Mod-z":function(){return $o(i.innerEditorView.state,i.innerEditorView.dispatch)},"Shift-Mod-z":function(){return Zo(i.innerEditorView.state,i.innerEditorView.dispatch)},Tab:function(e,t){return t(e.tr.insertText("\t")),!0},Enter:no,Escape:function(){return i.cancelEditing(),!0},"Ctrl-Enter":function(){return i.saveAndFinishEditing(),!0}}),Uo()]}),dispatchTransaction:function(e){return i.dispatchInner(e)},handleDOMEvents:{mousedown:function(){return i.editorView.hasFocus()&&i.innerEditorView.focus(),!0},blur:function(){return i.saveAndFinishEditing(),!0}}}),i.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=cl("custom-block"),this.wrapper=document.createElement("div"),this.wrapper.className=cl("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=cl("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(ms(t.tr,e))),this.editorView.focus(),this.renderCustomBlock(),this.closeEditor()},e.prototype.cancelEditing=function(){var e=function(e){var t=Vo.getState(e);return t?t.done.eventCount:0}(this.innerEditorView.state);for(this.canceled=!0;e--;)$o(this.innerEditorView.state,this.innerEditorView.dispatch),$o(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(pt.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&&Al(this.getPos)){for(var i=this.editorView.state.tr,o=Ne.offset(this.getPos()+1),a=0;a<r.length;a+=1)for(var s=r[a].steps,l=0;l<s.length;l+=1)i.step(s[l].map(o));i.docChanged&&this.editorView.dispatch(i)}},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}(),iv="image-link",ov=function(){function e(e,t,n,r){var i,o=this;this.handleMousedown=function(e){e.preventDefault();var t=e.target,n=e.offsetX,r=e.offsetY;if(o.imageLink&&Al(o.getPos)&&Gs(t,iv)){var i=getComputedStyle(t,":before");if(e.stopPropagation(),ll(i,n,r)){var a=o.view.state.tr,s=o.getPos();a.setSelection(ms(a,s,s+1)),o.view.dispatch(a),o.eventEmitter.emit("openPopup","link",o.imageLink.attrs)}}},this.node=e,this.view=t,this.getPos=n,this.eventEmitter=r,this.imageLink=null!==(i=e.marks.filter((function(e){return"link"===e.type.n
2ame}))[0])&&void 0!==i?i: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=iv,t.appendChild(e),t}return e},e.prototype.createImageElement=function(e){var t=document.createElement("img"),n=e.attrs,r=n.imageUrl,i=n.altText,o=km(e.attrs);return t.src=r,i&&(t.alt=i),bl(o,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}(),av=function(){function e(e,t,n,r){var i=this;this.contentDOM=null,this.input=null,this.timer=null,this.handleMousedown=function(e){var t=e.target;if("none"!==getComputedStyle(t,":after").backgroundImage&&Al(i.getPos)){var n=i.view.coordsAtPos(i.getPos()),r=n.top,o=n.right;i.createLanguageEditor({top:r,right:o})}},this.handleKeydown=function(e){"Enter"===e.key&&i.input&&(e.preventDefault(),i.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=km(this.node.attrs);return n&&t.setAttribute("data-language",n),bl(r,e),e.appendChild(t),e},e.prototype.createLanguageEditor=function(e){var t=this,n=e.top,r=e.right,i=document.createElement("span");i.className="toastui-editor-ww-code-block-language";var o=document.createElement("input");o.type="text",o.value=this.node.attrs.language,i.appendChild(o),this.view.dom.parentElement.appendChild(i);var a=i.clientWidth;ua(i,{top:n+10+"px",left:r-a-10+"px",width:a+"px"}),this.input=o,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&&Al(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?void 0:e.parentElement){var t=this.input.parentElement;this.input=null,fl(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}(),sv=/MsoListParagraph/,lv=/style=(.|\n)*mso-/,uv=/mso-list:(.*)/,cv=/O:P/,pv=/^(n|u|l)/,dv="p.MsoListParagraph";function fv(e){for(var t=[],n=document.createTreeWalker(e,1,null,!1);n.nextNode();){var r=n.currentNode;if(dl(r)){var i=r,o=i.outerHTML,a=i.textContent,s=lv.test(o),l=uv.test(o);s&&!l&&a?t.push([r,!0]):(cv.test(r.nodeName)||s&&!a||l)&&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);fl(e)}(t):fl(t)})),e.innerHTML.trim()}function hv(e){var t=[];return e.forEach((function(e,n){var r=t[n-1],i=function(e,t){var n=e.getAttribute("style");if(n){var r=n.match(uv)[1].trim().split(" ")[1];return{id:t,level:parseInt(r.replace("level",""),10),prev:null,parent:null,children:[],unordered:pv.test(e.textContent||""),contents:fv(e)}}return null}(e,n);i&&(r&&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,r),t.push(i))})),t}function mv(e){var t=e[0].unordered?"ul":"ol",n=document.createElement(t);return e.forEach((function(e){var t=e.children,r=e.contents,i=document.createElement("li");
2i.innerHTML=r,n.appendChild(i),t.length&&n.appendChild(mv(t))})),n}function vv(e){return mv(hv(e).filter((function(e){return!e.parent})))}function gv(e){var t=document.createElement("div");t.innerHTML=e;var n=[],r=function(e,t){var n=ds(e.querySelectorAll(t));return n.length?n:[]}(t,dv);return r.forEach((function(e){var r,i,o=function(e){for(;e&&!dl(e);)e=e.nextSibling;return!e||!sv.test(e.className)}(e.nextSibling);if(n.push(e),o){var a=vv(n),s=e.nextSibling;s?(r=a,(i=s).parentNode&&i.parentNode.insertBefore(r,i)):function(e,t){(t=ta(t)?ds(t):[t]).forEach((function(t){e.appendChild(t)}))}(t,a),n=[]}fl(e)})),""+(r.length?"<p></p>":"")+t.innerHTML}var yv="\x3c!--StartFragment--\x3e",bv="\x3c!--EndFragment--\x3e";function wv(e){return function(e){return lv.test(e)}(e=function(e){return/<\/td>((?!<\/tr>)[\s\S])*$/i.test(e)&&(e="<tr>"+e+"</tr>"),/<\/tr>((?!<\/table>)[\s\S])*$/i.test(e)&&(e="<table>"+e+"</table>"),e}(e=function(e){var t=e.indexOf(yv),n=e.lastIndexOf(bv);return t>-1&&n>-1&&(e=e.slice(t+yv.length,n)),e.replace(/<br[^>]*>/g,sl)}(e)))&&(e=gv(e)),e}function kv(e,t,n){for(var r=[],i=e.childCount,o=0;o<i;o+=1)if(!e.child(o).attrs.extended){var a=o<i?n.create(e.child(o).attrs,e.child(o).content):n.createAndFill();r.push(a)}return r}function xv(e,t,n){var r=n.nodes,i=r.tableRow,o=kv(e,0,r.tableHeadCell);return i.create(null,o)}function Cv(e,t,n){var r=n.nodes,i=r.tableRow,o=kv(e,0,r.tableBodyCell);return i.create(null,o)}function Tv(e){var t=[],n=[];"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)}));return Ko(Ko([],t),n)}function Ev(e,t,n){var r=xv(e,0,n);return n.nodes.tableHead.create(null,r)}function Mv(e,t,n){var r=e.map((function(e){return Cv(e,0,n)}));if(!e.length){var i=function(e,t){for(var n=t.nodes,r=n.tableRow,i=n.tableBodyCell,o=[],a=0;a<e;a+=1){var s=i.createAndFill();o.push(s)}return r.create({dummyRowForPasting:!0},o)}(t,n);r.push(i)}return n.nodes.tableBody.create(null,r)}function Nv(e,t,n){var r=[],i=e.content,o=e.openStart,a=e.openEnd;return i.forEach((function(e){if("table"===e.type.name){var i=qm(new T(y.from(e),0,0));if(i){var o=Tv(i),a="tableBody"===i.firstChild.type.name,s=function(e,t,n,r){var i=function(e){return e.reduce((function(e,t){return e.childCount>t.childCount?e:t})).childCount}(e);if(n&&r)return t.nodes.table.create(null,[Mv(e,i,t)]);var o=e[0],a=e.slice(1),s=[Ev(o,0,t)];return a.length&&s.push(Mv(a,i,t)),t.nodes.table.create(null,s)}(o,t,a,n);r.push(s)}}else r.push(e)})),new T(y.from(r),o,a)}var Sv=4,Dv=2;function Lv(e){return e*Sv}function Av(e,t){var n=e.state,r=n.selection,i=n.schema,o=n.tr,a=Hm(r),s=a.anchor,l=a.head;if(s&&l){var u=qm(t);if(!u)return!1;var c=Lm.create(s),p=c.getRectOffsets(s,l),d=function(e,t,n){var r=[],i=Tv(e),o=(i[0].childCount,i.length),a=0===t.startRowIdx,s=i.slice(0,o);if(a){var l=s.shift();if(l){var u=xv(l,0,n).content;r.push(u)}}return s.forEach((function(e){if(!e.attrs.dummyRowForPasting){var t=Cv(e,0,n).content;r.push(t)}})),r}(u,p,i),f=function(e,t,n){for(var r=t.startRowIdx,i=t.startColIdx,o=n.length,a=0,s=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)},l=0;l<o;l+=1)s(l);var u=r+o-1,c=i+a-1;return{startRowIdx:r,startColIdx:i,endRowIdx:u,endColIdx:c,addedRowCount:Math.max(u+1-e.totalRowCount,0),addedColumnCount:Math.max(c+1-e.totalColumnCount,0)}}(c,p,d),h=[];return function(e,t){var n=e.getSpannedOffsets(t),r=zm(n),i=r.rowCount,o=r.columnCount,a=zm(t),s=a.rowCount,l=a.columnCount;return i===s&&o===l}(c,f)&&(function(e,t){for(var n=e.startRowIdx,r=e.startColIdx,i=e.endRowIdx,o=e.endColIdx,a=e.addedRowCount,s=e.addedColumnCount,l=n;l<=i-a;l+=1)t.push({rowIdx:l,startColIdx:r,endColIdx:o-s})}(f,h),f.addedColumnCount&&function(e,t,n,r,i){for(var o=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=Pm(c,f,t);if(e.insert(g,y),f>=o&&f<=s-u){var b=n.getCellInfo(f,l-c),w=e.mapping.map(b.offset),k=g+Lv(c);
2i[d]={rowIdx:f,startColIdx:a,endColIdx:l,dummyOffsets:[w,k]},d+=1}}}(o,i,c,f,h),f.addedRowCount&&function(e,t,n,r,i){var o=r.addedRowCount,a=r.addedColumnCount,s=r.startColIdx,l=r.endColIdx,u=e.mapping.maps.length,c=n.tableEndOffset-2,p=Rm(o,n.totalColumnCount+a,t),d=c;e.insert(e.mapping.slice(u).map(d),p);for(var f=0;f<o;f+=1){var h=d+Lv(s)+1,m=d+Lv(l+1)+1,v=d+Lv(n.totalColumnCount+a)+Dv;i.push({rowIdx:f+n.totalRowCount,startColIdx:s,endColIdx:l,dummyOffsets:[h,m]}),d=v}}(o,i,c,f,h),function(e,t,n,r){var i=e.mapping.maps.length;n.forEach((function(n,o){var a=n.rowIdx,s=n.startColIdx,l=n.endColIdx,u=n.dummyOffsets,c=e.mapping.slice(i),p=new T(t[o],0,0),d=u?u[0]:r.getCellStartOffset(a,s),f=u?u[1]:r.getCellEndOffset(a,l);e.replace(c.map(d),c.map(f),p)}))}(o,d,h,c),e.dispatch(o),function(e,t,n){var r=e.state,i=r.tr,o=r.doc,a=Lm.create(o.resolve(n)),s=t[0],l=s.rowIdx,u=s.startColIdx,c=rs(t),p=c.rowIdx,d=c.endColIdx,f=a.getCellInfo(l,u).offset,h=a.getCellInfo(p,d).offset;e.dispatch(i.setSelection(new Im(o.resolve(f),o.resolve(h))))}(e,h,c.getCellInfo(0,0).offset)),!0}return!1}var Ov=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Go(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}(Ml),Iv=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Go(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:Jo({},{htmlAttrs:{default:null},classNames:{default:null}}),parseDOM:[{tag:"p"}],toDOM:function(e){return["p",km(e.attrs),0]}}},enumerable:!1,configurable:!0}),t}(Ml),Rv=/\s{1,4}$/,Pv=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Go(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,i=n.$from,o=n.$to;return!(!i.blockRange(o)||mm(i)||vm(i))&&(t(r.insertText("    ",i.pos,o.pos)),!0)}},t.prototype.removeSpaces=function(){return function(e,t){var n=e.selection,r=e.tr,i=n.$from,o=n.$to,a=n.from;if(i.blockRange(o)&&!mm(i)&&!vm(i)){var s=i.nodeBefore;if(s&&s.isText){var l=s.text,u=l.replace(Rv,""),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}(Ml),Bv=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Go(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"heading"},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 Jo({level:e},n&&{rawHTML:n})}}}));return{attrs:Jo({level:{default:1},headingType:{default:"atx"},rawHTML:{default:null}},{htmlAttrs:{default:null},classNames:{default:null}}),content:"inline*",group:"block",defining:!0,parseDOM:e,toDOM:function(e){var t=e.attrs;return["h"+t.level,km(t),0]}}},enumerable:!1,configurable:!0}),t.prototype.commands=function(){return function(e){return function(t,n){return fo(t.schema.nodes[e.level?"heading":"paragraph"],e)(t,n)}}},t}(Ml),Fv=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Go(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:Jo({language:{default:null},rawHTML:{default:null}},{htmlAttrs:{default:null},classNames:{default:null}}),code:!0,defining:!0,marks:"",parseDOM:[{tag:"pre",preserveWhitespace:"full",getAttrs:function(e){var t=e.getAttribute("data-raw-html"),n=e.firstElementChild;return Jo({language:(null===n||void 0===n?void 0:n.getAttribute("data-language"))||null},t&&{rawHTML:t})}}],toDOM:function(e){var t=e.attrs;return[t.rawHTML||"pre",["code",Jo({"data-language":t.language},km(t)),0]]}}}
2,enumerable:!1,configurable:!0}),t.prototype.commands=function(){return function(){return function(e,t){return fo(e.schema.nodes.codeBlock)(e,t)}}},t.prototype.moveCursor=function(e){var t=this;return function(n,r){var i,o,a=n.tr,s=n.doc,l=n.schema,u=n.selection.$from;if(t.context.view.endOfTextblock(e)&&"codeBlock"===u.node().type.name){var c=u.parent.textContent.split("\n"),p="up"===e?u.start():u.end(),d="up"===e?[p,c[0].length+p]:[p-rs(c).length,p],f=s.resolve("up"===e?u.before():u.after()),h="up"===e?f.nodeBefore:f.nodeAfter;if(i=u.pos,o=d[1],i>=d[0]&&i<=o&&!h){var m=vs(a,f,l);if(m)return r(m),!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}(Ml),Hv=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Go(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:Jo({rawHTML:{default:null}},{htmlAttrs:{default:null},classNames:{default:null}}),parseDOM:[ym("ul")],toDOM:function(e){return["ul",km(e.attrs),0]}}},enumerable:!1,configurable:!0}),t.prototype.changeList=function(){return function(e,t){return Tm(e.schema.nodes.bulletList)(e,t)}},t.prototype.commands=function(){return{bulletList:this.changeList,taskList:Em}},t.prototype.keymaps=function(){var e=this.changeList(),t=Sm(),n=t.indent,r=t.outdent;return{"Mod-u":e,"Mod-U":e,Tab:n(),"Shift-Tab":r()}},t}(Ml),qv=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Go(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:Jo({order:{default:1},rawHTML:{default:null}},{htmlAttrs:{default:null},classNames:{default:null}}),parseDOM:[{tag:"ol",getAttrs:function(e){var t=e.getAttribute("start"),n=e.getAttribute("data-raw-html");return Jo({order:e.hasAttribute("start")?Number(t):1},n&&{rawHTML:n})}}],toDOM:function(e){var t=e.attrs;return[t.rawHTML||"ol",Jo({start:1===t.order?null:t.order},km(t)),0]}}},enumerable:!1,configurable:!0}),t.prototype.commands=function(){return function(){return function(e,t){return Tm(e.schema.nodes.orderedList)(e,t)}}},t.prototype.keymaps=function(){var e=this.commands()(),t=Sm(),n=t.indent,r=t.outdent;return{"Mod-o":e,"Mod-O":e,Tab:n(),"Shift-Tab":r()}},t}(Ml),zv=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Go(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"listItem"},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 Jo({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 i=["task-list-item"];return r&&i.push("checked"),[t.rawHTML||"li",Jo({class:i.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,i=e.schema,o=n.$from,a=n.empty,s=i.nodes.listItem,l=o.parent,u=o.node(-1);if(a&&!l.childCount&&u.type===s){if(o.index(-2)>=1)return r.delete(o.start(-1)-1,o.end(-1)),t(r),!0;if(o.node(-3).type===s)return r.delete(o.start(-2)-1,o.end(-1)),t(r),!0}return!1}},t.prototype.keymaps=function(){return{Backspace:this.liftToPrevListItem(),Enter:function(e,t){return function(e){return function(t,n){var r=t.tr,i=t.selection,o=i.$from,a=i.$to;if(o.depth<2||!o.sameParent(a))return!1;var s=o.node(-1);if(s.type!==e)return!1;if(0===o.parent.content.size&&o.node(-1).childCount===o.indexAfter(-1)){if(2===o.depth||o.node(-3).type!==e||o.index(-2)!==o.node(-2).childCount-1)return!1;for(var l=o.index(-1)>0,u=y.empty,c=o.depth-(l?1:2);c>=o.depth-3;c-=1)u=y.from(o.node(c).copy(u));return u=u.append(y.from(e.createAndFill())),r.replace(l?o.before():o.before(-1),o.after(-3),new T(u,l?3:2,2)),r.setSelection(st.near(r.doc.resolve(o.pos+(l?3:2)))),n(r),!0}var p=a.pos===o.end()?s.contentMatchAt(0).defaultType:null,d=p&&[null,{type:p}];return r.delete(o.pos,a.pos),!!_e(r.doc,o.pos,2,d)&&(r.split(o.pos,2,d),n(r),!0)}}(e.schema.nodes.listItem)(e,t)}}},t}(Ml),jv=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Go(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"blockQuote"}
2,enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return{attrs:Jo({rawHTML:{default:null}},{htmlAttrs:{default:null},classNames:{default:null}}),content:"block+",group:"block",parseDOM:[ym("blockquote")],toDOM:function(e){return["blockquote",km(e.attrs),0]}}},enumerable:!1,configurable:!0}),t.prototype.commands=function(){return function(){return function(e,t){return po(e.schema.nodes.blockQuote)(e,t)}}},t.prototype.keymaps=function(){var e=this.commands()();return{"Alt-q":e,"Alt-Q":e}},t}(Ml),Vv={left:function(e,t){var n=e[0],r=e[1],i=t.totalColumnCount,o=0===r;if(0!==n||!o){r-=1,o&&(n-=1,r=i-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],i=t.totalRowCount,o=t.totalColumnCount,a=r===o-1;if(n!==i-1||!a){var s=r+1,l=t.getColspanStartInfo(n,r);return(null===l||void 0===l?void 0:l.count)>1&&(s+=l.count-1),(a||s===o)&&(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 i=t.getCellInfo(n-1,r);return i.offset+i.nodeSize-2}return null},down:function(e,t){var n=e[0],r=e[1],i=t.totalRowCount;if(n<i-1){var o=n+1,a=t.getRowspanStartInfo(n,r);return(null===a||void 0===a?void 0:a.count)>1&&(o+=a.count-1),t.getCellInfo(o,r).offset+2}return null}};function _v(e,t,n){var r=n[0],i=n[1],o=t.getRowspanStartInfo(r,i),a="up"===e&&0===r,s="down"===e&&((null===o||void 0===o?void 0:o.count)>1?r+o.count-1:r)===t.totalRowCount-1;return a||s}function Uv(e,t,n,r){void 0===r&&(r=!1);var i=e.doc.resolve(t.tableEndOffset);return r||!i.nodeAfter?vs(e,i,n):e.setSelection(st.near(i,1))}function $v(e,t,n,r){var i=(0,Vv[e])(n,r);if(i){var o="right"===e||"down"===e?1:-1;return t.setSelection(st.near(t.doc.resolve(i),o))}return null}function Zv(e,t,n){var r=e.getCellInfo(t,0).offset,i=e.getCellInfo(t,n-1);return{from:r,to:i.offset+i.nodeSize}}var Wv=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Go(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:Jo({rawHTML:{default:null}},{htmlAttrs:{default:null},classNames:{default:null}}),parseDOM:[ym("table")],toDOM:function(e){return["table",km(e.attrs),0]}}},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,i=e.columnCount,o=e.data,a=t.schema,s=t.selection,l=t.tr,u=s.from,c=s.to,p=s.$from;if(u===c&&!vm(p)){var d=a.nodes,f=d.tableHead,h=d.tableBody,m=null===o||void 0===o?void 0:o.slice(0,i),v=null===o||void 0===o?void 0:o.slice(i,o.length),g=function(e,t,n){for(var r=t.nodes,i=r.tableRow,o=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(o.create(null,c))}return[i.create(null,s)]}(i,a,m),y=Rm(r-1,i,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,i=Lm.create(n.$anchor);if(i){var o=i.tableStartOffset,a=i.tableEndOffset,s=o-1,l=ms(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,i=t.tr,o=t.schema,a=Hm(r),s=a.anchor,l=a.head;if(s&&l){for(var u=Lm.create(s),c=u.getRectOffsets(s,l),p="left"===e?c.startColIdx:c.endColIdx+1,d=zm(c).columnCount,f=u.totalRowCount,h=0;h<f;h+=1){var m=Pm(d,h,o);i.insert(i.mapping.map(u.posAt(h,p)),m)}return n(i),!0}return!1}}},t.prototype.removeColumn=function(){return function(){return function(e,t){var n=e.selection,r=e.tr,i=Hm(n),o=i.anchor,a=i.head;if(o&&a){var s=Lm.create(o),l=s.getRectOffsets(o,a),u=s.totalColumnCount,c=s.totalRowCount;if(zm(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,i=t.schema,o=t.tr,a=Hm(r),s=a.anchor,l=a.head;if(s&&l){var u=Lm.create(s),c=u.totalColumnCount,p=u.getRectOffsets(s,l),d=zm(p).rowCount,f=function(e,t,n){var r,i,o;return"up"===e?(r=n.startRowIdx,i=0,o=-1):(r=n.endRowIdx,i=t.totalColumnCount-1,o=t.getCellInfo(r,i).nodeSize+1),{targetRowIdx:r,insertColIdx:i,nodeSize:o}}(e,u,p),h=f.targetRowIdx,m=f.insertColIdx,v=f.nodeSize;if(!(0===h)){for(var g=[],y=o.mapping.map(u.posAt(h,m))+v,b=[],w=0;w<c;w+=1)b=b.concat(Pm(1,h,i));for(var k=0;k<d;k+=1)g.push(i.nodes.tableRow.create(null,b));return n(o.insert(y,g)),!0}}return!1}}},t.prototype.removeRow=function(){return function(){return function(e,t){var n=e.selection,r=e.tr,i=Hm(n),o=i.anchor,a=i.head;if(o&&a){var s=Lm.create(o),l=s.totalRowCount,u=s.totalColumnCount,c=s.getRectOffsets(o,a),p=zm(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=Zv(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,i=t.selection,o=t.tr,a=Hm(i),s=a.anchor,l=a.head;if(s&&l){for(var u=Lm.create(s),c=u.totalRowCount,p=u.getRectOffsets(s,l),d=p.startColId
2x,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=u.getNodeAndPos(h,m),g=v.node,y=v.pos,b=jm(g,{align:r});o.setNodeMarkup(y,null,b)}return n(o),!0}return!1}}},t.prototype.moveToCell=function(e){return function(t,n){var r=t.selection,i=t.tr,o=t.schema,a=Hm(r),s=a.anchor,l=a.head;if(s&&l){var u=Lm.create(s),c=u.getCellIndex(s),p=void 0;if(p=_v(e,u,c)?Uv(i,u,o):$v(e,i,c,u))return n(p),!0}return!1}},t.prototype.moveInCell=function(e){var t=this;return function(n,r){var i=n.selection,o=n.tr,a=n.doc,s=n.schema,l=i.$from;if(!t.context.view.endOfTextblock(e))return!1;var u=hm(l,(function(e){var t=e.type;return"tableHeadCell"===t.name||"tableBodyCell"===t.name}));if(u){var c=hm(l,(function(e){return"paragraph"===e.type.name})),p=u.depth;if(c&&function(e,t,n,r){var i=t[0],o=t[1],a=i+3,s=o>=a,l=s?i+1:o,u=function(e,t,n,r,i){var o=t[0],a=t[1],s=t[2];if("left"===e||"up"===e){if(i&&!function(e,t,n){var r=n[0],i=n[1],o=t.resolve(e.before(r-1));return i===r&&!o.nodeBefore}(n,r,[o,a]))return!1;var l=n.before(s);if(r.resolve(l).nodeBefore)return!1}return!0}(e,[o,a,l],n,r,s),c=function(e,t,n,r,i){if("right"===e||"down"===e){if(i&&!function(e){for(var t,n,r=e.depth;r&&"tableBodyCell"!==(n=e.node(r)).type.name;){if("listItem"===n.type.name){var i=e.node(r-1).lastChild===n,o="paragraph"!==(null===(t=n.lastChild)||void 0===t?void 0:t.type.name);return!!i&&!o}r-=1}return!1}(n))return!1;var o=n.after(t);if(r.resolve(o).nodeAfter)return!1}return!0}(e,l,n,r,s);return u&&c}(e,[p,c.depth],l,a)){var d=Hm(i).anchor,f=Lm.create(d),h=f.getCellIndex(d),m=void 0;if(!function(e,t,n){var r=n[0],i=n[1];if("up"===e||"down"===e)return!1;var o=t.tableStartOffset,a=t.tableEndOffset,s=t.getCellInfo(r,i),l=s.offset,u=s.nodeSize;return("left"===e?o:a)===("left"===e?l-2:l+u+3)}(e,f,h)?_v(e,f,h)?"up"===e?m=function(e,t,n){var r=e.doc.resolve(t.tableStartOffset-1);return r.nodeBefore?e.setSelection(st.near(r,-1)):vs(e,r,n)}(o,f,s):"down"===e&&(m=Uv(o,f,s)):m=$v(e,o,h,f):m=function(e,t,n){var r=e.doc.resolve(t.before(n-3));return e.setSelection(new ft(r))}(o,l,p),m)return r(m),!0}}return!1}},t.prototype.deleteCells=function(){return function(e,t){var n=e.schema,r=e.selection,i=e.tr,o=Hm(r),a=o.anchor,s=o.head;if(a&&s&&!(r instanceof pt)){for(var l=Lm.create(a),u=l.getRectOffsets(a,s),c=u.startRowIdx,p=u.startColIdx,d=u.endRowIdx,f=u.endColIdx,h=c;h<=d;h+=1)for(var m=p;m<=f;m+=1)if(!l.extendedRowspan(h,m)&&!l.extendedColspan(h,m)){var v=l.getNodeAndPos(h,m),g=v.node,y=v.pos,b=Pm(1,h,n,g.attrs);i.replaceWith(i.mapping.map(y),i.mapping.map(y+g.nodeSize),b)}return t(i),!0}return!1}},t.prototype.exitTable=function(){return function(e,t){var n=e.selection,r=e.tr,i=e.schema,o=n.$from;if(hm(o,(function(e){var t=e.type;return"tableHeadCell"===t.name||"tableBodyCell"===t.name}))&&hm(o,(function(e){return"paragraph"===e.type.name}))){var a=Hm(n).anchor;return t(Uv(r,Lm.create(a),i,!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}(Ml),Gv=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Go(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:Jo({rawHTML:{default:null}},{htmlAttrs:{default:null},classNames:{default:null}}),parseDOM:[ym("thead")],toDOM:function(e){return["thead",km(e.attrs),0]}}}
2,enumerable:!1,configurable:!0}),t}(Ml),Jv=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Go(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:Jo({rawHTML:{default:null}},{htmlAttrs:{default:null},classNames:{default:null}}),parseDOM:[{tag:"tbody",getAttrs:function(e){var t=e.querySelectorAll("tr")[0].children.length,n=e.getAttribute("data-raw-html");return!!t&&Jo({},n&&{rawHTML:n})}}],toDOM:function(e){return["tbody",km(e.attrs),0]}}},enumerable:!1,configurable:!0}),t}(Ml),Kv=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Go(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:Jo({rawHTML:{default:null}},{htmlAttrs:{default:null},classNames:{default:null}}),parseDOM:[{tag:"tr",getAttrs:function(e){var t=e.children.length,n=e.getAttribute("data-raw-html");return!!t&&Jo({},n&&{rawHTML:n})}}],toDOM:function(e){return["tr",km(e.attrs),0]}}},enumerable:!1,configurable:!0}),t}(Ml),Xv=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Go(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:Jo({align:{default:null},className:{default:null},rawHTML:{default:null},colspan:{default:null},extended:{default:null}},{htmlAttrs:{default:null},classNames:{default:null}}),isolating:!0,parseDOM:[wm("th")],toDOM:function(e){var t=e.attrs,n=bm(t);return["th",Jo(Jo({},n),km(t)),0]}}},enumerable:!1,configurable:!0}),t}(Ml),Qv=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Go(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:[wm("td")],toDOM:function(e){return["td",bm(e.attrs),0]}}},enumerable:!1,configurable:!0}),t}(Ml),Yv=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Go(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:Jo({imageUrl:{default:""},altText:{default:null},rawHTML:{default:null}},{htmlAttrs:{default:null},classNames:{default:null}}),group:"inline",selectable:!1,parseDOM:[{tag:"img[src]",getAttrs:function(e){var t=Zh(e,{RETURN_DOM_FRAGMENT:!0}).firstChild,n=t.getAttribute("src")||"",r=t.getAttribute("data-raw-html"),i=t.getAttribute("alt");return Jo({imageUrl:n,altText:i},r&&{rawHTML:r})}}],toDOM:function(e){var t=e.attrs;return[t.rawHTML||"img",Jo(Jo({src:Za(t.imageUrl)},t.altText&&{alt:t.altText}),km(t))]}}},enumerable:!1,configurable:!0}),t.prototype.addImage=function(){return function(e){return function(t,n){var r=t.schema,i=t.tr,o=e,a=o.imageUrl,s=o.altText;if(!a)return!1;var l=r.nodes.image.createAndFill(Jo({imageUrl:a},s&&{altText:s}));return n(i.replaceSelectionWith(l).scrollIntoView()),!0}}},t.prototype.commands=function(){return{addImage:this.addImage()}},t}(Ml),eg=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Go(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"thematicBreak"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return{attrs:Jo({rawHTML:{default:null}},{htmlAttrs:{default:null},classNames:{default:null}}),group:"block",parseDOM:[{tag:"hr"}],selectable:!1,toDOM:function(e){var t=e.attrs;return["div",km(t),[t.rawHTML||"hr"]]}}}
2,enumerable:!1,configurable:!0}),t.prototype.hr=function(){var e=this;return function(){return function(t,n){var r,i=t.selection,o=i.$from;if(o===i.$to){var a=t.doc,s=t.schema.nodes,l=s.thematicBreak,u=s.paragraph,c=[l.create()],p=o.node(1),d=a.child(a.childCount-1)===p,f=a.resolve(o.after(1)),h=(null===(r=o.nodeAfter)||void 0===r?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}(Ml),tg=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Go(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 Jo({},t&&{rawHTML:t})}}}));return{attrs:Jo({rawHTML:{default:null}},{htmlAttrs:{default:null},classNames:{default:null}}),parseDOM:e,toDOM:function(e){var t=e.attrs;return[t.rawHTML||"strong",km(t)]}}},enumerable:!1,configurable:!0}),t.prototype.bold=function(){return function(){return function(e,t){return ho(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}(fu),ng=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Go(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"emph"},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 Jo({},t&&{rawHTML:t})}}}));return{attrs:Jo({rawHTML:{default:null}},{htmlAttrs:{default:null},classNames:{default:null}}),parseDOM:e,toDOM:function(e){var t=e.attrs;return[t.rawHTML||"em",km(t)]}}},enumerable:!1,configurable:!0}),t.prototype.italic=function(){return function(){return function(e,t){return ho(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}(fu),rg=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Go(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 Jo({},t&&{rawHTML:t})}}}));return{attrs:Jo({rawHTML:{default:null}},{htmlAttrs:{default:null},classNames:{default:null}}),parseDOM:e,toDOM:function(e){var t=e.attrs;return[t.rawHTML||"del",km(t)]}}},enumerable:!1,configurable:!0}),t.prototype.commands=function(){return function(){return function(e,t){return ho(e.schema.marks.strike)(e,t)}}},t.prototype.keymaps=function(){var e=this.commands()();return{"Mod-s":e,"Mod-S":e}},t}(fu),ig=function(e){function t(t){var n=e.call(this)||this;return n.linkAttributes=t,n}return Go(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:Jo({linkUrl:{default:""},title:{default:null},rawHTML:{default:null}},{htmlAttrs:{default:null},classNames:{default:null}}),inclusive:!1,parseDOM:[{tag:"a[href]",getAttrs:function(e){var t=Zh(e,{RETURN_DOM_FRAGMENT:!0}).firstChild,n=t.getAttribute("href")||"",r=t.getAttribute("title")||"",i=t.getAttribute("data-raw-html");return Jo({linkUrl:n,title:r},i&&{rawHTML:i})}}],toDOM:function(t){var n=t.attrs;return[n.rawHTML||"a",Jo(Jo({href:Za(n.linkUrl)},e.linkAttributes),getCustomAttrs(n))]}}},enumerable:!1,configurable:!0}),t.prototype.addLink=function(){return function(e){return function(t,n){var r=e,i=r.linkUrl,o=r.linkText,a=void 0===o?"":o,s=t.schema,l=t.tr,u=t.selection,c=u.empty,p=u.from,d=u.to;if(p&&d&&i){var f={linkUrl:i},h=s.mark("link",f);if(c&&a){var m=hs(s,a,h);l.replaceRangeWith(p,d,m)}else l.addMark(p,d,h);return n(l.scrollIntoView()),!0}return!1}}},t.prototype.toggleLink=function(){return function(e){return function(t,n){return ho(t.schema.marks.link,e)(t,n)}}},t.prototype.commands=function(){return{addLink:this.addLink(),toggleLink:this.toggleLink()}},t}(fu),og=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Go(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"code"}
2,enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return{attrs:Jo({rawHTML:{default:null}},{htmlAttrs:{default:null},classNames:{default:null}}),parseDOM:[{tag:"code",getAttrs:function(e){var t=e.getAttribute("data-raw-html");return Jo({},t&&{rawHTML:t})}}],toDOM:function(e){var t=e.attrs;return[t.rawHTML||"code",km(t)]}}},enumerable:!1,configurable:!0}),t.prototype.commands=function(){return function(){return function(e,t){return ho(e.schema.marks.code)(e,t)}}},t.prototype.keymaps=function(){var e=this.commands()();return{"Shift-Mod-c":e,"Shift-Mod-C":e}},t}(fu),ag=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Go(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||void 0===e?void 0:e.info)&&fo(t.schema.nodes.customBlock,e)(t,n)}}},t}(Ml),sg=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Go(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"frontMatter"},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)&&io(e,t)}}},t.prototype.keymaps=function(){return{Enter:this.commands()()}},t}(Ml),lg=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Go(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)&&io(e,t)}}},t.prototype.keymaps=function(){return{Enter:this.commands()()}},t}(Ml);var ug=cl("contents"),cg=function(e){function t(t,n){var r=e.call(this,t)||this,i=n.toDOMAdaptor,o=n.htmlSchemaMap,a=void 0===o?{}:o,s=n.linkAttributes,l=void 0===s?{}:s,u=n.useCommandShortcut,c=void 0===u||u,p=n.wwPlugins,d=void 0===p?[]:p,f=n.wwNodeViews,h=void 0===f?{}:f;return r.editorType="wysiwyg",r.el.classList.add("ww-mode"),r.toDOMAdaptor=i,r.linkAttributes=l,r.extraPlugins=d,r.pluginNodeViews=h,r.specs=r.createSpecs(),r.schema=r.createSchema(a),r.context=r.createContext(),r.keymaps=r.createKeymaps(c),r.view=r.createView(),r.commands=r.createCommands(),r.specs.setContext(Jo(Jo({},r.context),{view:r.view})),r.initEvent(),r}return Go(t,e),t.prototype.createSpecs=function(){return e=this.linkAttributes,new Rl([new Ov,new Iv,new Pv,new Bv,new Fv,new Hv,new qv,new zv,new jv,new Wv,new Gv,new Jv,new Kv,new Xv,new Qv,new Yv,new eg,new tg,new ng,new rg,new ig(e),new og,new ag,new sg,new Dl,new lg]);var e},t.prototype.createContext=function(){return{schema:this.schema,eventEmitter:this.eventEmitter}},t.prototype.createSchema=function(e){return new se({nodes:Jo(Jo({},this.specs.nodes),e.nodes),marks:Jo(Jo({},this.specs.marks),e.marks)})},t.prototype.createPlugins=function(){return Ko([new Mt({key:Vm,state:{init:function(){return null},apply:function(e,t){var n=e.getMeta(Vm);if(n)return-1===n?null:n;if(Da(t)||!e.docChanged)return t;var r=e.mapping.mapResult(t),i=r.deleted,o=r.pos;return i?null:o}},props:{decorations:$m,createSelectionBetween:function(e){var t=e.state;return Da(Vm.getState(t))?null:t.selection}},view:function(e){return new _m(e)}}),(e=this.eventEmitter,new Mt({props:{handleDOMEvents:{contextmenu:function(t,n){var r=Bm(n.target,t.dom);if(r){n.preventDefault();var i=n,o=i.clientX,a=i.clientY,s=t.dom.parentNode.getBoundingClientRect(),l=s.left,u=s.top,c="TH"===r.nodeName;return e.emit("contextmenu",{pos:{left:o-l+10+"px",top:a-u+30+"px"},menuGroups:Xm(e,c),tableCell:r}),!0}return!1}}}})),new Mt({props:{handleDOMEvents:{mousedown:function(e,t){var n=t,r=n.clientX,i=n.clientY,o=e.posAtCoords({left:r,top:i}
2);if(o){var a=e.state,s=a.doc,l=a.tr,u=s.resolve(o.pos),c=gm(u),p=t.target,d=getComputedStyle(p,":before"),f=t,h=f.offsetX,m=f.offsetY;if(!c||!ll(d,h,m))return!1;t.preventDefault();var v=u.before(c.depth),g=c.node.attrs;return l.setNodeMarkup(v,null,Jo(Jo({},g),{checked:!g.checked})),e.dispatch(l),!0}return!1}}}}),nv(this.eventEmitter)],this.createPluginProps()).concat(this.defaultPlugins);var e},t.prototype.createPluginNodeViews=function(){var e=this.eventEmitter,t=this.pluginNodeViews,n={};return t&&Object.keys(t).forEach((function(r){n[r]=function(n,i,o){return t[r](n,i,o,e)}})),n},t.prototype.createView=function(){var e=this,t=this.toDOMAdaptor,n=this.eventEmitter;return new Oi(this.el,{state:this.createState(),attributes:{class:ug},nodeViews:Jo({customBlock:function(e,n,r){return new rv(e,n,r,t)},image:function(e,t,r){return new ov(e,t,r,n)},codeBlock:function(e,t,r){return new av(e,t,r,n)},widget:Nl},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:wv,transformPasted:function(t){return Nv(t,e.schema,vm(e.view.state.selection.$from))},handlePaste:function(e,t,n){return Av(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,i=null===r||void 0===r?void 0:r.items;if(i){var o=ds(i).some((function(e){return"string"===e.kind&&"text/rtf"===e.type}));if(!o){var a=Tl(i);a&&(n.preventDefault(),Cl(e.eventEmitter,a,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,Sm())},t.prototype.getHTML=function(){return wl(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,i=r.schema,o=r.tr,a=e.split("\n").map((function(e){return fs(i,_s(e,i))})),s=new T(y.from(a),1,1),l=Sa(t)&&Sa(n)?o.replaceRange(t,n,s):o.replaceSelection(s);this.view.dispatch(l),this.focus()},t.prototype.deleteSelection=function(e,t){var n=this.view.state.tr,r=Sa(e)&&Sa(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,i=n.selection,o=i.from,a=i.to;return Sa(e)&&Sa(t)&&(o=e,a=t),r.textBetween(o,a,"\n")},t.prototype.setModel=function(e,t){void 0===t&&(t=!1);var n=this.view.state,r=n.tr,i=n.doc;this.view.dispatch(r.replaceWith(0,i.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=ms(n,e,t);this.view.dispatch(n.setSelection(r).scrollIntoView())},t.prototype.addWidget=function(e,t,n){var r=this.view,i=r.dispatch,o=r.state;i(o.tr.setMeta("widget",{pos:null!==n&&void 0!==n?n:o.selection.to,node:e,style:t}))},t.prototype.replaceWithWidget=function(e,t,n){var r=this.view.state,i=r.tr,o=_s(n,r.schema);this.view.dispatch(i.replaceWith(e,t,o))},t.prototype.getRangeInfoOfNode=function(e){var t=this.view.state,n=t.doc,r=t.selection,i=e?n.resolve(e):r.$from,o=i.marks(),a=i.node(),s=i.start(),l=i.end(),u=a.type.name;if(o.length||"paragraph"===u){var c=o[o.length-1];u=c?c.type.name:"text",a.forEach((function(e,t){var n=e.isText,r=e.nodeSize,o=e.marks,a=i.pos-s;n&&t<=a&&t+r>=a&&function(e){return!e.length||Wa(e,c)}(o)&&(l=(s+=t)+r)}))}return{range:[s,l],type:u}},t}(Ll),pg=da,dg=Da;var fg=function(e){return!pg(e)&&!dg(e)};var hg=function(e){return fg(e)&&!1!==e};var mg=function(e){return!hg(e)},vg=["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"],gg=function(){function e(){var e=this;this.events=new Zm,this.eventTypes=vg.reduce((function(e,t){return Jo(Jo({},e),{type:t})}),{}),this.hold=!1,vg.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 new 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),i=this.events.get(r.type),o=[];
2return!this.hold&&i&&i.forEach((function(e){var n=e.apply(void 0,t);da(n)||o.push(n)})),o},e.prototype.emitReduce=function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i=this.events.get(e);return!this.hold&&i&&i.forEach((function(e){var r=e.apply(void 0,Ko([t],n));mg(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!da(this.eventTypes[this.getTypeInfo(e).type])},e.prototype.addEventType=function(e){if(this.hasEventType(e))throw new 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),i=r.type,o=r.namespace;i&&t?this.removeEventHandlerWithHandler(i,t):i&&!o?this.events.delete(i):!i&&o?this.events.forEach((function(e,t){n.removeEventHandlerWithTypeInfo(t,o)})):i&&o&&this.removeEventHandlerWithTypeInfo(i,o)},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}(),yg=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 bg(e){return"\n"===e[e.length-1]?e.slice(0,e.length-1):e}function wg(e,t){var n=e.schema,r=t.literal.match(il);if(r){var i=r[1],o=r[3],a=(i||o).toLowerCase();return"htmlInline"===t.type&&!(!n.marks[a]&&!n.nodes[a])}return!1}function kg(e){return Wa(["text","strong","emph","strike","image","link","code"],e.type)}function xg(e){return"softbreak"===(null===e||void 0===e?void 0:e.type)}function Cg(e){var t=e.type,n=e.literal,r="htmlInline"===t&&n.match(il);if(r){var i=r[1],o=r[3],a=i||o;if(a)return Wa(["ul","ol","li"],a.toLowerCase())}return!1}function Tg(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=document.createElement("div");r.innerHTML=Zh(e);var i=r.firstChild;return t.map((function(e){return i.getAttribute(e)||""}))}var Eg={"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,i=e.schema.marks.link;if(n){var o=Tg(r,"href")[0];e.openMark(i.create({linkUrl:o,rawHTML:n}))}else e.closeMark(i)},img:function(e,t,n){var r=t.literal;if(n){var i=Tg(r,"src","alt"),o=i[0],a=i[1],s=e.schema.nodes.image;e.addNode(s,Jo({rawHTML:n,imageUrl:o},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,i=t.prev,o=t.next;"paragraph"===(null===r||void 0===r?void 0:r.type)?(xg(i)&&e.openNode(n),xg(o)?e.closeNode():o&&(e.closeNode(),e.openNode(n))):"tableCell"===(null===r||void 0===r?void 0:r.type)&&(i&&(kg(i)||wg(e,i))&&e.closeNode(),o&&(kg(o)||wg(e,o))&&e.openNode(n))},pre:function(e,t,n){var r,i,o=document.createElement("div");o.innerHTML=t.literal;var a=null===(i=null===(r=o.firstChild)||void 0===r?void 0:r.firstChild)||void 0===i?void 0:i.textContent;e.openNode(e.schema.nodes.codeBlock,{rawHTML:n}),e.addText(bg(a)),e.closeNode()},"ul, ol":function(e,t,n){if("tableCell"===t.parent.type){var r=e.schema.nodes,i=r.bulletList,o=r.orderedList,a=r.paragraph,s="ul"===n?i:o;n?(t.prev&&!Cg(t.prev)&&e.closeNode(),e.openNode(s,{rawHTML:n})):(e.closeNode(),t.next&&!Cg(t.next)&&e.openNode(a))}},li:function(e,t,n){var r;if("tableCell"===(null===(r=t.parent)||void 0===r?void 0:r.type)){var i=e.schema.nodes,o=i.listItem,a=i.paragraph;if(n){var s=function(e){var t=e.literal;return{task:/data-task/.test(t),checked:/data-task-checked/.test(t)}}(t);t.prev&&!Cg(t.prev)&&e.closeNode(),e.openNode(o,Jo({rawHTML:n},s)),t.next&&!Cg(t.next)&&e.openNode(a)}else t.prev&&!Cg(t.prev)&&e.closeNode(),e.closeNode()}}},Mg=function(e){var t={};return Object.keys(e).forEach((function(n){n.split(", ").forEach((function(r){var i=r.toLowerCase();t[i]=e[n]}))})),t}(Eg);function Ng(e){return"htmlInline"===e.type&&ol.test(e.literal)}
2function Sg(e){ds(e.childNodes).forEach((function(e){if(dl(e)){var t=e.nodeName.toLowerCase();e.setAttribute("data-raw-html",t),e.childNodes&&Sg(e)}}))}var Dg={text:function(e,t){e.addText(t.literal||"")},paragraph:function(e,t,n,r){var i;if(n.entering){var o=e.schema.nodes.paragraph;"paragraph"===(null===(i=t.prev)||void 0===i?void 0:i.type)&&(e.openNode(o,r),e.closeNode()),e.openNode(o,r)}else e.closeNode()},heading:function(e,t,n,r){if(n.entering){var i=t,o=i.level,a=i.headingType;e.openNode(e.schema.nodes.heading,Jo({level:o,headingType:a},r))}else e.closeNode()},codeBlock:function(e,t,n){var r=e.schema.nodes.codeBlock,i=t,o=i.info,a=i.literal;e.openNode(r,Jo({language:o},n)),e.addText(bg(a||"")),e.closeNode()},list:function(e,t,n,r){if(n.entering){var i=e.schema.nodes,o=i.bulletList,a=i.orderedList,s=t.listData,l=s.type,u=s.start;"bullet"===l?e.openNode(o,r):e.openNode(a,Jo({order:u},r))}else e.closeNode()},item:function(e,t,n,r){var i=n.entering,o=e.schema.nodes.listItem,a=t.listData,s=a.task,l=a.checked;if(i){var u=Jo(Jo(Jo({},s&&{task:s}),l&&{checked:l}),r);e.openNode(o,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 i=n.entering,o=n.skipChildren,a=e.schema.nodes.image,s=t,l=s.destination,u=s.firstChild;i&&o&&o(),e.addNode(a,Jo(Jo({imageUrl:l},u&&{altText:u.literal}),r))},thematicBreak:function(e,t,n,r){e.addNode(e.schema.nodes.thematicBreak,r)},strong:function(e,t,n,r){var i=n.entering,o=e.schema.marks.strong;i?e.openMark(o.create(r)):e.closeMark(o)},emph:function(e,t,n,r){var i=n.entering,o=e.schema.marks.emph;i?e.openMark(o.create(r)):e.closeMark(o)},link:function(e,t,n,r){var i=n.entering,o=e.schema.marks.link,a=t,s=a.destination,l=a.title;if(i){var u=Jo({linkUrl:s,title:l},r);e.openMark(o.create(u))}else e.closeMark(o)},softbreak:function(e,t){if("paragraph"===t.parent.type){var n=t.prev,r=t.next;n&&!Ng(n)&&e.closeNode(),r&&!Ng(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 i=function(t){return t&&(kg(t)||wg(e,t))};if(r){var o=e.schema.nodes,a=o.tableHeadCell,s=o.tableBodyCell,l=o.paragraph,u=t.parent.parent,c="tableHead"===u.type?a:s,p=(u.parent.columns[t.startIdx]||{}).align,d=Jo({},t.attrs);p&&(d.align=p),e.openNode(c,d),i(t.firstChild)&&e.openNode(l)}else i(t.lastChild)&&e.closeNode(),e.closeNode()}},strike:function(e,t,n,r){var i=n.entering,o=e.schema.marks.strike;i?e.openMark(o.create(r)):e.closeMark(o)},code:function(e,t,n,r){var i=e.schema.marks.code;e.openMark(i.create(r)),e.addText(bg(t.literal||"")),e.closeMark(i)},customBlock:function(e,t){var n=e.schema.nodes,r=n.customBlock,i=n.paragraph,o=t,a=o.info,s=o.literal;e.openNode(r,{info:a}),e.addText(bg(s||"")),e.closeNode(),t.next||(e.openNode(i),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(il),i=r[1],o=r[3],a=(i||o).toLowerCase(),s=e.schema.marks[a],l=Zh(n);if(null===s||void 0===s?void 0:s.spec.attrs.htmlInline)if(i){var u=Gh(l);e.openMark(s.create({htmlAttrs:u}))}else e.closeMark(s);else{var c=Mg[a];c&&c(e,t,i)}},htmlBlock:function(e,t){var n=t.literal,r=document.createElement("div");if(al.test(n))e.openNode(e.schema.nodes.htmlComment),e.addText(t.literal),e.closeNode();else{var i=n.match(il),o=i[1],a=i[3],s=(o||a).toLowerCase(),l=e.schema.nodes[s],u=Zh(n);if(null===l||void 0===l?void 0:l.spec.attrs.htmlBlock){var c=Gh(u),p=Wh(t,s);e.addNode(l,{htmlAttrs:c,childrenHTML:p})}else r.innerHTML=u,Sg(r),e.convertByDOMParser(r)}},customInline:function(e,t,n){var r=n.entering,i=n.skipChildren,o=t,a=o.info,s=o.firstChild,l=e.schema;if(-1!==a.indexOf("widget")&&r){var u=Us(t);i(),e.addNode(l.nodes.widget,{info:a},[l.text(Hs(a,u))])}else{var c="$$";r&&(c+=s?a+" ":a),e.addText(c)}}};var Lg=function(){function e(e,t){this.schema=e,this.convertors=t,this.stack=[{type:this.schema.topNodeType,attrs:null,content:[]}],this.marks=x.none}return e.prototype.top=function(){return rs(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=rs(t),r=this.schema.text(e,this.marks),i=n&&(a=r,!!((o=n).isText&&a.isText&&x.sameSet(o.marks,a.marks))&&o.withText(o.text+a.text));i?t[t.length-1]=i:t.push(r)}var o,a},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=x.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;
2ue.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;r>=0;r-=1){var i=this.stack[r];if(!(null===(n=i.attrs)||void 0===n?void 0:n.rawHTML))break;i.content.length?this.closeNode():this.stack.pop()}},e.prototype.convert=function(e,t){for(var n=e.walker(),r=n.next(),i=function(){var e=r.node,i=r.entering,a=o.convertors[e.type],s=!1;if(a){var l={entering:i,leaf:!Os(e),getChildrenText:Is,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?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()},o=this;r;)i()},e.prototype.convertNode=function(e,t){return this.convert(e,t),this.stack.length?this.closeNode():null},e}();var Ag={text:function(e,t){var n,r=t.node,i=null!==(n=r.text)&&void 0!==n?n:"";(r.marks||[]).some((function(e){return"link"===e.type.name}))?e.text(Qa(i),!1):e.text(i)},paragraph:function(e,t){var n=t.node,r=t.parent,i=t.index,o=void 0===i?0:i;if(e.stopNewline)e.convertInline(n);else{var a=0===o,s=!a&&r.child(o-1),l=s&&0===s.childCount,u=o<r.childCount-1&&r.child(o+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("listItem"===(null===r||void 0===r?void 0:r.type.name)){var d=e.getDelim();e.setDelim(""),e.write("<br>"),e.setDelim(d)}e.write("\n")}}},heading:function(e,t,n){var r=t.node,i=n.delim;"atx"===r.attrs.headingType?(e.write(i+" "),e.convertInline(r),e.closeBlock(r)):(e.convertInline(r),e.ensureNewLine(),e.write(i),e.closeBlock(r))},codeBlock:function(e,t,n){var r=t.node,i=n.delim,o=n.text,a=i,s=a[0],l=a[1];
2e.write(s),e.ensureNewLine(),e.text(o,!1),e.ensureNewLine(),e.write(l),e.closeBlock(r)},blockQuote:function(e,t,n){var r=t.node,i=t.parent,o=n.delim;(null===i||void 0===i?void 0:i.type.name)===r.type.name&&e.flushClose(1),e.wrapBlock(o,null,r,(function(){return e.convertNode(r)}))},bulletList:function(e,t,n){var r=t.node,i=n.delim;e.convertList(r,Xa(" ",4),(function(){return i+" "}))},orderedList:function(e,t){var n=t.node,r=n.attrs.order||1;e.convertList(n,Xa(" ",4),(function(e){return String(r+e)+". "}))},listItem:function(e,t){var n=t.node,r=n.attrs,i=r.task,o=r.checked;i&&e.write("["+(o?"x":" ")+"] "),e.convertNode(n)},image:function(e,t,n){var r=n.attrs;e.write("!["+(null===r||void 0===r?void 0:r.altText)+"]("+(null===r||void 0===r?void 0:r.imageUrl)+")")},thematicBreak:function(e,t,n){var r=t.node,i=n.delim;e.write(i),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,i=n.delim,o=r.firstChild;e.convertNode(r);var a=null!==i&&void 0!==i?i:"";!i&&o&&o.forEach((function(e){var t=function(e,t){var n=e.length,r="",i="";return"left"===t?(r=":",n-=1):"right"===t?(i=":",n-=1):"center"===t&&(r=":",i=":",n-=2),""+r+Xa("-",Math.max(n,3))+i}(e.textContent,e.attrs.align);a+="| "+t+" "})),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,i=n.delim,o=void 0===i?"| ":i;e.write(o),e.convertTableCell(r),e.write(" ")},tableBodyCell:function(e,t,n){var r=t.node,i=n.delim,o=void 0===i?"| ":i;e.write(o),e.convertTableCell(r),e.write(" ")},customBlock:function(e,t,n){var r=t.node,i=n.delim,o=n.text,a=i,s=a[0],l=a[1];
2e.write(s),e.ensureNewLine(),e.text(o,!1),e.ensureNewLine(),e.write(l),e.closeBlock(r)},frontMatter:function(e,t,n){var r=t.node,i=n.text;e.text(i,!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,i=n.text;e.write(i),r.attrs.htmlBlock&&e.closeBlock(r)},htmlComment:function(e,t,n){var r=t.node,i=n.text;e.write(i),e.closeBlock(r)}};function Og(e,t){var n=e.text,r=/`+/g,i=0;if(e.isText&&n)for(var o=r.exec(n);o;)i=Math.max(i,o[0].length),o=r.exec(n);for(var a=i>0&&t>0?" `":"`",s=0;s<i;s+=1)a+="`";return i>0&&t<0&&(a+=" "),a}function Ig(e){return e?["<"+e+">","</"+e+">"]:null}function Rg(e){return e?"<"+e+">":null}function Pg(e){return e?"</"+e+">":null}var Bg={heading:function(e){var t=e.node.attrs,n=t.level,r=Xa("#",n);return"setext"===t.headingType&&(r=1===n?"===":"---"),{delim:r,rawHTML:Ig(t.rawHTML)}},codeBlock:function(e){var t=e.node,n=t.attrs,r=t.textContent;return{delim:["```"+(n.language||""),"```"],rawHTML:Ig(n.rawHTML),text:r}},blockQuote:function(e){return{delim:"> ",rawHTML:Ig(e.node.attrs.rawHTML)}},bulletList:function(e,t){var n=e.node,r=t.inTable,i=n.attrs.rawHTML;return r&&(i=i||"ul"),{delim:"*",rawHTML:Ig(i)}},orderedList:function(e,t){var n=e.node,r=t.inTable,i=n.attrs.rawHTML;return r&&(i=i||"ol"),{rawHTML:Ig(i)}},listItem:function(e,t){var n=e.node,r=t.inTable,i=n.attrs,o=i.task,a=i.checked,s=n.attrs.rawHTML;return r&&(s=s||"li"),{rawHTML:s?["<"+s+(o?' class="task-list-item'+(a?" checked":"")+'"':"")+(o?" data-task"+(a?" data-task-checked":""):"")+">","</"+s+">"]:null}},table:function(e){return{rawHTML:Ig(e.node.attrs.rawHTML)}},tableHead:function(e){return{rawHTML:Ig(e.node.attrs.rawHTML)}},tableBody:function(e){return{rawHTML:Ig(e.node.attrs.rawHTML)}},tableRow:function(e){return{rawHTML:Ig(e.node.attrs.rawHTML)}},tableHeadCell:function(e){return{rawHTML:Ig(e.node.attrs.rawHTML)}},tableBodyCell:function(e){return{rawHTML:Ig(e.node.attrs.rawHTML)}},image:function(e){var t=e.node.attrs,n=t.rawHTML,r=t.altText,i=t.imageUrl.replace(/&amp;/g,"&"),o=r?' alt="'+Za(r)+'"':"";return{rawHTML:n?"<"+n+' src="'+Za(i)+'"'+o+">":null,attrs:{altText:Qa(r||""),imageUrl:i}}},thematicBreak:function(e){return{delim:"***",rawHTML:Rg(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,n){var r=e.node,i=t.entering,o=r.attrs.rawHTML,a="**";return n||(a=i?"<strong>":"</strong>"),{delim:a,rawHTML:i?Rg(o):Pg(o)}},emph:function(e,t,n){var r=e.node,i=t.entering,o=r.attrs.rawHTML,a="*";return n||(a=i?"<em>":"</em>"),{delim:a,rawHTML:i?Rg(o):Pg(o)}},strike:function(e,t,n){var r=e.node,i=t.entering,o=r.attrs.rawHTML,a="~~";return n||(a=i?"<del>":"</del>"),{delim:a,rawHTML:i?Rg(o):Pg(o)}},link:function(e,t){var n=e.node,r=t.entering,i=n.attrs,o=i.title,a=i.rawHTML,s=i.linkUrl.replace(/&amp;/g,"&"),l=o?' title="'+Za(o)+'"':"";return r?{delim:"[",rawHTML:a?"<"+a+' href="'+Za(s)+'"'+l+">":null}:{delim:"]("+s+(o?" "+es(Qa(o)):"")+")",rawHTML:Pg(a)}},code:function(e,t){var n=e.node,r=e.parent,i=e.index,o=void 0===i?0:i,a=t.entering;return{delim:a?Og(r.child(o),-1):Og(r.child(o-1),1),rawHTML:a?Rg(n.attrs.rawHTML):Pg(n.attrs.rawHTML)}},htmlComment:function(e){return{text:e.node.textContent}},html:function(e,t){var n=e.node,r=t.entering,i=n.type.name,o=n.attrs.htmlAttrs,a="<"+i,s="</"+i+">";return Object.keys(o).forEach((function(e){a+=" "+e+'="'+o[e].replace(/"/g,"'")+'"'})),a+=">",n.attrs.htmlInline?{rawHTML:r?a:s}:{text:""+a+n.attrs.childrenHTML+s}}},Fg={strong:{mixable:!0,removedEnclosingWhitespace:!0},emph:{mixable:!0,removedEnclosingWhitespace:!0},strike:{mixable:!0,removedEnclosingWhitespace:!0},code:{escape:!1},link:null,html:null};function Hg(e){var t={};return Object.keys(Ag).forEach((function(n){t[n]=function(t,r){if(Ag[n]){var i=e[n],o=i?i(r,{inTable:t.inTable}):{};!function(e,t){var n=t.state,r=t.nodeInfo,i=t.params,o=i.rawHTML;o?pa(e,["heading","codeBlock"])>-1?function(e,t,n){var r=n[0],i=n[1];e.write(r),e.convertInline(t),e.write(i)}(n,r.node,o):pa(e,["image","thematicBreak"])>
2-1?n.write(o):function(e,t,n){var r=t.node,i=t.parent,o=n[0],a=n[1];e.stopNewline=!0,e.write(o),e.convertNode(r),e.write(a),"doc"===(null===i||void 0===i?void 0:i.type.name)&&(e.closeBlock(r),e.stopNewline=!1)}(n,r,o):Ag[e](n,r,i)}(n,{state:t,nodeInfo:r,params:o})}}})),t}function qg(e){Object.keys(e).forEach((function(t){var n=Bg[t],r=e[t];Bg[t]=n?function(e,t){return t.origin=function(){return n(e,t)},r(e,t)}:r,delete e[t]}));var t=Hg(Bg),n=function(e){var t={};return Object.keys(Fg).forEach((function(n){t[n]=function(t,r,i){var o=Fg[n],a=e[n],s=a&&t&&!da(r)?a(t,{entering:r},i):{};return Jo(Jo({},s),o)}})),t}(Bg);return{nodeTypeConvertors:t,markTypeConvertors:n}}var zg=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.isBetweenSpaces=function(e,t){var n,r,i,o=e.content,a=0===t||(i=null!==(n=o.child(t-1).text)&&void 0!==n?n:"a",/(\S*)\s$/g.test(i)),s=t>=o.childCount-1||function(e){return/^\s(\S*)/g.test(e)}(null!==(r=o.child(t+1).text)&&void 0!==r?r:"a");return a&&s},e.prototype.markText=function(e,t,n,r){var i=this.getMarkConvertor(e);if(i){var o=i({node:e,parent:n,index:r},t,this.isBetweenSpaces(n,t?r:r-1)),a=o.delim;return o.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 i=this.getDelim();this.write(t||e),this.setDelim(this.getDelim()+e),r(),this.setDelim(i),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?Ya(n[r]):n[r],r!==n.length-1&&(this.result+="\n")},e.prototype.convertBlock=function(e,t,n){var r=e.type.name,i=this.nodeTypeConvertors[r],o={node:e,parent:t,index:n};e.attrs.htmlBlock?this.nodeTypeConvertors.html(this,o):i&&i(this,o)},e.prototype.convertInline=function(e){var t=this,n=[],r="",i=function(i,o,a){var s=i?i.marks:[],l=r;r="";var u=i&&i.isText&&s.some((function(e){var n=t.getMarkConvertor(e),r=n&&n();return r&&r.removedEnclosingWhitespace}));if(u&&i&&i.text){var c=/^(\s*)(.*?)(\s*)$/m.exec(i.text),p=c[1],d=c[2],f=c[3];l+=p,r=f,(p||f)&&((i=d?i.withText(d):null)||(s=n))}for(var h=s.length&&rs(s),m=h&&t.getMarkConvertor(h),v=m&&m(),g=v&&!1===v.escape,y=s.length-(g?1:0),b=0;b<y;b+=1){d=s[b];if(v&&!v.mixable)break;for(var w=0;w<n.length;w+=1){var k=n[w];if(v&&!v.mixable)break;if(d.eq(k)){b>w?s=s.slice(0,w).concat(d).concat(s.slice(w,b)).concat(s.slice(b+1,y)):w>b&&(s=s.slice(0,b).concat(s.slice(b+1,w)).concat(d).concat(s.slice(w,y)));break}}}for(var x=0;x<Math.min(n.length,y)&&s[x].eq(n[x]);)x+=1;for(;x<n.length;){var C=n.pop();C&&t.text(t.markText(C,!1,e,a),!1)}if(l&&t.text(l),i){for(;n.length<y;){d=s[n.length];n.push(d),t.text(t.markText(d,!0,e,a),!1)}g&&i.isText?t.text(t.markText(h,!0,e,a)+i.text+t.markText(h,!1,e,a+1),!1):t.convertBlock(i,e,a)}};e.forEach(i),i(null,0,e.childCount)},e.prototype.convertList=function(e,t,n){var r,i=this;this.closed&&this.closed.type===e.type?this.flushClose(3):this.tightList&&this.flushClose(1);var o=null===(r=e.attrs.tight)||void 0===r||r,a=this.tightList;this.tightList=o,e.forEach((function(r,a,s){s&&o&&i.flushClose(1),i.wrapBlock(t,n(s),e,(function(){return i.convertBlock(r,e,s)}
2))})),this.tightList=a},e.prototype.convertTableCell=function(e){var t=this;this.stopNewline=!0,this.inTable=!0,e.forEach((function(n,r,i){Wa(["bulletList","orderedList"],n.type.name)?(t.convertBlock(n,e,i),t.closed=!1):(t.convertInline(n),i<e.childCount-1&&"paragraph"===e.child(i+1).type.name&&t.write("<br>"))})),this.stopNewline=!1,this.inTable=!1},e.prototype.convertNode=function(e,t){var n=this;return e.forEach((function(r,i,o){if(n.convertBlock(r,e,o),(null===t||void 0===t?void 0:t.node)===r){var a=n.result.split("\n");t.setMappedPos([a.length,rs(a).length+1])}})),this.result},e}(),jg=function(){function e(e,t,n,r){var i=this;this.setMappedPos=function(e){i.mappedPosWhenConverting=e},this.schema=e,this.eventEmitter=r,this.focusedNode=null,this.mappedPosWhenConverting=null,this.toWwConvertors=function(e){var t=Object.keys(e),n=Jo({},Dg),r=new Gf({gfm:!0,nodeId:!0,convertors:e}).getConvertors();return t.forEach((function(t){var i=Dg[t];i&&!Wa(["htmlBlock","htmlInline"],t)&&(n[t]=function(n,o,a){a.origin=function(){return r[t](o,a,r)};var s,l=e[t](o,a);if(l){var u=Array.isArray(l)?l[0]:l;s={htmlAttrs:u.attributes,classNames:u.classNames}}i(n,o,a,s)})})),n}(n),this.toMdConvertors=qg(t||{}),this.eventEmitter.listen("setFocusedNode",(function(e){return i.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 Lg(this.schema,this.toWwConvertors).convertNode(e,this.getInfoForPosSync())},e.prototype.toMarkdownText=function(e){var t=new zg(this.toMdConvertors).convertNode(e,this.getInfoForPosSync());return t=this.eventEmitter.emitReduce("beforeConvertWysiwygToMarkdown",t)},e}();function Vg(e){var t=e.plugins,n=e.eventEmitter,r=e.usageStatistics,i=e.instance;return n.listen("mixinTableOffsetMapPrototype",Om),(null!==t&&void 0!==t?t:[]).reduce((function(e,t){var o=function(e){var t=e.plugin,n={eventEmitter:e.eventEmitter,usageStatistics:e.usageStatistics,instance:e.instance,pmState:{Plugin:Mt,PluginKey:Dt,Selection:st,TextSelection:pt},pmView:{Decoration:si,DecorationSet:ci},pmModel:{Fragment:y},pmRules:{InputRule:xo,inputRules:To,undoInputRule:Mo},pmKeymap:{keymap:Ji},i18n:Jm};if(ta(t)){var r=t[0],i=t[1];return r(n,void 0===i?{}:i)}return t(n)}({plugin:t,eventEmitter:n,usageStatistics:r,instance:i});if(!o)throw new Error("The return value of the executed plugin is empty.");var a=o.markdownParsers,s=o.toHTMLRenderers,l=o.toMarkdownRenderers,u=o.markdownPlugins,c=o.wysiwygPlugins,p=o.wysiwygNodeViews,d=o.markdownCommands,f=o.wysiwygCommands,h=o.toolbarItems;return s&&(e.toHTMLRenderers=as(e.toHTMLRenderers,s)),l&&(e.toMarkdownRenderers=as(e.toMarkdownRenderers,l)),u&&(e.mdPlugins=e.mdPlugins.concat(u)),c&&(e.wwPlugins=e.wwPlugins.concat(c)),p&&(e.wwNodeViews=Jo(Jo({},e.wwNodeViews),p)),d&&(e.mdCommands=Jo(Jo({},e.mdCommands),d)),f&&(e.wwCommands=Jo(Jo({},e.wwCommands),f)),h&&(e.toolbarItems=e.toolbarItems.concat(h)),a&&(e.markdownParsers=Jo(Jo({},e.markdownParsers),a)),e}),{toHTMLRenderers:{},toMarkdownRenderers:{},mdPlugins:[],wwPlugins:[],wwNodeViews:{},mdCommands:{},wwCommands:{},toolbarItems:[],markdownParsers:{}})}var _g=function(){function e(e){var t=this;this.options=Yo({linkAttributes:null,extendedAutolinks:!1,customHTMLRenderer:null,referenceDefinition:!1,customHTMLSanitizer:null,frontMatter:!1,usageStatistics:!0,theme:"light"},e),this.eventEmitter=new gg;var n,r=Ka(this.options.linkAttributes),i=Vg({plugins:this.options.plugins,eventEmitter:this.eventEmitter,usageStatistics:this.options.usageStatistics,instance:this})||{},o=i.toHTMLRenderers,a=i.markdownParsers,s=this.options,l=s.customHTMLRenderer,u=s.extendedAutolinks,c=s.referenceDefinition,p=s.frontMatter,d=s.customHTMLSanitizer,f={linkAttributes:r,customHTMLRenderer:Jo(Jo({},o),l),extendedAutolinks:u,referenceDefinition:c,frontMatter:p,sanitizer:d||Zh};n=f.customHTMLRenderer,["htmlBlock","htmlInline"].forEach((function(e){n[e]&&Object.keys(n[e]).forEach((function(e){return $h(e)}))})),this.options.events&&Qo(this.options.events,(function(e,n){t.on(n,e)}));var h=this.options,m=h.el,v=h.initialValue,g=h.theme,y=m.innerHTML;"light"!==g&&m.classList.add(cl(g)),m.innerHTML="",this.toastMark=new jf("",{disallowedHtmlBlockTags:["br","img"],extendedAutolinks:u,referenceDefinition:c,disallowDeepHeading:!0,frontMatter:p,customParser:a}),this.preview=new fm(this.eventEmitter,Jo(Jo({},f),{isViewer:!0})),Oc(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")&&ll(n,e.offsetX,e.offsetY)&&(hl(t,"checked"),this.eventEmitter.emit("change",{source:"viewer",date:e}))},e.prototype.setMarkdown=function(e){var t=this.toastMark.getLineTexts(),n=[t.length,rs(t).length+1],r
2=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(){Nc(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 Ug(e){return e instanceof V}function $g(e){return Wa(["document","blockQuote","bulletList","orderedList","listItem","paragraph","heading","emph","strong","strike","link","image","table","tableHead","tableBody","tableRow","tableHeadCell","tableBodyCell"],e)}var Zg={openTag:function(e,t){var n=e,r=n.tagName,i=n.classNames,o=n.attributes,a=document.createElement(r),s={};i&&(a.className=i.join(" ")),o&&(s=Jo(Jo({},s),o)),bl(s,a),t.push(a)},closeTag:function(e,t){if(t.length>1){var n=t.pop();rs(t).appendChild(n)}},html:function(e,t){rs(t).insertAdjacentHTML("beforeend",e.content)},text:function(e,t){var n=document.createTextNode(e.content);rs(t).appendChild(n)}},Wg=function(){function e(e,t){var n=em(e,t),r=Jo(Jo({},t.htmlBlock),t.htmlInline);this.customConvertorKeys=Object.keys(t).concat(Object.keys(r)),this.renderer=new Gf({gfm:!0,convertors:Jo(Jo({},n),r)}),this.convertors=this.renderer.getConvertors()}return e.prototype.generateTokens=function(e){var t=function(e){var t=e.attrs,n=e.type.name,r={type:n,wysiwygNode:!0,literal:!$g(n)&&Ug(e)?e.textContent:null},i={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],o=Jo(Jo({},r),i),a=e.attrs,s=a.htmlAttrs,l=a.childrenHTML;return s?Jo(Jo({},o),{attrs:s,childrenHTML:l}):o}(e),n={entering:!0,leaf:!!Ug(e)&&e.isLeaf,options:this.renderer.getOptions(),getChildrenText:function(){return Ug(e)?e.textContent:""},skipChildren:function(){return!1}},r=this.convertors[e.type.name],i=r(t,n,this.convertors),o=ta(i)?i:[i];return($g(e.type.name)||e.attrs.htmlInline)&&(n.entering=!1,o.push({type:"text",content:Ug(e)?e.textContent:""}),o=o.concat(r(t,n,this.convertors))),o},e.prototype.toDOMNode=function(e){var t=this.generateTokens(e),n=[];return t.forEach((function(e){return Zg[e.type](e,n)})),n[0]},e.prototype.getToDOMNode=function(e){return Wa(this.customConvertorKeys,e)?this.toDOMNode.bind(this):null},e}(),Gg=15,Jg=null,Kg=null;function Xg(e,t){var n=t.syncScrollTop,r=t.releaseEventBlock;Kg&&clearTimeout(Kg),n(e),Kg=setTimeout((function(){r()}),Gg)}var Qg=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,i=t.el;this.previewRoot=r,this.previewEl=i,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=lm(this.previewRoot,t).el,i=(am(r,this.previewRoot)||r.offsetTop)+r.clientHeight-.5*n;return this.latestEditorScrollTop=null,r.getBoundingClientRect().top-this.previewEl.getBoundingClientRect().top<n?null:i},e.prototype.syncPreviewScrollTop=function(e){void 0===e&&(e=!1);var t=this,n=t.editorView,r=t.previewEl,i=t.previewRoot,o=n.dom.getBoundingClientRect(),a=o.left,s=o.top,l=n.posAtCoords({left:a,top:s}),u=n.state.doc,c=this.getMdNodeAtPos(u,l);if(c&&!function(e){var t=e.type;return"htmlBlock"===t||"htmlInline"===t}(c)){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=lm(this.previewRoot,c),k=w.el,x=im(u,w.mdNode,v),C=x.height,T=x.rect;y=(am(k,i)||k.offsetTop)+k.clientHeight*(s>T.top?Math.min((s-T.top)/C,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,n=t.toastMark,r=t.editorView,i=t.previewRoot,o=t.previewEl,a=r.dom,s=r.state,l=o.scrollTop,u=o.clientHeight,c=o.scrollHeight-l<=u,p=a.scrollTop,d=c?a.scrollHeight:0;if(l&&e&&!c){if(e=function(e,t){for(;!e.getAttribute("data-nodeid")&&e.parentElement!==t;)e=e.parentElement;return e}(e,i),!e.getAttribute("data-nodeid"))return;var f=a.children,h=Number(e.getAttribute("data-nodeid")),m=lm(this.previewRoot,n.findNodeById(h)),v=m.mdNode,g=m.el;d=f[bs(v)-1].offsetTop;var y=im(s.doc,v,f).height,b=pm(g,i,h),w=b.nodeHeight;d+=function(e,t,n,r){return Math.min((e-t)/n,1)*r}(l,b.offsetTop,w,y),d=this.getResolvedScrollTop("preview",l,d,p),this.latestPreviewScrollTop=l}d!==p&&this.run("preview",d,p)},e.prototype.getResolvedScrollTop=function(e,t,n,r){var i="editor"===e?this.latestEditorScrollTop:this.latestPreviewScrollTop;return null===i?n:i<t?Math.max(n,r):Math.min(n,r)},e.prototype.run=function(e,t,n){var r,i=this;"editor"===e?(r=this.previewEl,this.blockedScroll="preview"):(r=this.editorView.dom,this.blockedScroll="editor"),function(e,t,n){var r=t-e,i=Date.now();!function o(){var a,s=(Date.now()-i)/100;Jg&&clearTimeout(Jg),s<1?(a=e+r*Math.cos((1-s)*Math.PI/2),Xg(Math.ceil(a),n),Jg=setTimeout(o,1)):(Xg(t,n),Jg=null)}()}(n,t,{syncScrollTop:function(e){return r.scrollTop=e},releaseEventBlock:function(){return i.blockedScroll=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}(),Yg={getPopupInitialValues:function(e,t){return"link"===t.popupName?{linkText:e.getSelectedText()}:{}}};var ey=function(){function e(e){var t=this;this.initialHTML=e.el.innerHTML,e.el.innerHTML="",this.options=Yo({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 n=this.options,r=n.customHTMLRenderer,i=n.extendedAutolinks,o=n.referenceDefinition,a=n.frontMatter,s=n.customMarkdownRenderer,l=n.useCommandShortcut,u=n.initialEditType,c=n.widgetRules,p=n.customHTMLSanitizer;this.mode=u||"markdown",this.mdPreviewStyle=this.options.previewStyle,this.i18n=Jm,this.i18n.setCode(this.options.language),this.eventEmitter=new gg,js(c);var d=Ka(this.options.linkAttributes);this.pluginInfo=Vg({plugins:this.options.plugins,eventEmitter:this.eventEmitter,usageStatistics:this.options.usageStatistics,instance:this});var f,h=this.pluginInfo,m=h.toHTMLRenderers,v=h.toMarkdownRenderers,g=h.mdPlugins,y=h.wwPlugins,b=h.wwNodeViews,w=h.mdCommands,k=h.wwCommands,x=h.markdownParsers,C={linkAttributes:d,customHTMLRenderer:as(m,r),extendedAutolinks:i,referenceDefinition:o,frontMatter:a,sanitizer:p||Zh}
2,T=new Wg(d,C.customHTMLRenderer),E=function(e,t,n){var r={nodes:{},marks:{}};return["htmlBlock","htmlInline"].forEach((function(i){e[i]&&Object.keys(e[i]).forEach((function(e){var o="htmlBlock"===i?"nodes":"marks";$h(e),r[o][e]=Xh[i](e,t,n)}))})),r}(C.customHTMLRenderer,C.sanitizer,T);this.toastMark=new jf("",{disallowedHtmlBlockTags:["br","img"],extendedAutolinks:i,referenceDefinition:o,disallowDeepHeading:!0,frontMatter:a,customParser:x}),this.mdEditor=new bc(this.eventEmitter,{toastMark:this.toastMark,useCommandShortcut:l,mdPlugins:g}),this.preview=new fm(this.eventEmitter,Jo(Jo({},C),{isViewer:!1,highlight:this.options.previewHighlight})),this.wwEditor=new cg(this.eventEmitter,{toDOMAdaptor:T,useCommandShortcut:l,htmlSchemaMap:E,linkAttributes:d,wwPlugins:y,wwNodeViews:b}),this.convertor=new jg(this.wwEditor.getSchema(),Jo(Jo({},v),s),em(d,C.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 yg(this.eventEmitter,this.mdEditor.commands,this.wwEditor.commands,(function(){return t.mode})),this.options.usageStatistics&&Pa("editor","UA-129966929-1"),this.scrollSync=new Qg(this.mdEditor,this.preview,this.eventEmitter),this.addInitEvent(),this.addInitCommand(w,k),(f=this).eventEmitter.listen("query",(function(e,t){return Yg[e](f,t)})),this.options.hooks&&Qo(this.options.hooks,(function(e,n){return t.addHook(n,e)})),this.options.events&&Qo(this.options.events,(function(e,n){return t.on(n,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){var n=e.target;return t(n.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 _g(t):new e(t)},e.setLanguage=function(e,t){Jm.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 i=("markdown"===e?r.mdEditor:r.wwEditor).view;n(t,i.state,i.dispatch,i)}))},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)},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=document.createElement("div");n.innerHTML=function(e){var t=e.replace(/<p><br\s*\/*><\/p>/gi,"<p></p>"),n=new RegExp(rl,"ig"),r=t.match(n);return null===r||void 0===r||r.forEach((function(e,n){if(ol.test(e)){var i=sl;if(n){var o=r[n-1].match(nl);if(o&&!/br/i.test(o[1])){var a=o[1];i="</"+a+"><"+a+">"}}t=t.replace(ol,i)}})),t}(e);var r=ue.fromSchema(this.wwEditor.schema).parse(n);this.isMarkdownMode()?this.mdEditor.setMarkdown(this.convertor.toMarkdownText(r),t):this.wwEditor.setModel(r,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=wl(this.wwEditor.view.dom.innerHTML);if(this.placeholder){var n=new 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;ea(e)&&("auto"===e?xa(t,"auto-height"):Na(t,"auto-height"),this.setMinHeight(this.getMinHeight())),ua(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("."+cl("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{r=this.wwEditor.getModel();this.mdEditor.setMarkdown(this.convertor.toMarkdownText(r),!t)}if(this.eventEmitter.emit("removePopupWidget"),this.eventEmitter.emit("changeMode",e),!t){var i=this.convertor.getMappedPos();this.focus(),this.isWysiwygMode()&&Sa(i)?this.wwEditor.setSelection(i):Array.isArray(i)&&this.mdEditor.setSelection(i)}}},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().forEac
2h((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){var r,i;void 0===t&&(t=e),void 0===n&&(n=this.mode);var o=this.mdEditor.view.state.doc,a=Array.isArray(e),s=Array.isArray(t),l=e,u=t;if(a!==s)throw new Error("Types of arguments must be same");return"markdown"!==n||a||s?"wysiwyg"===n&&a&&s&&(l=(i=zl(o,e,t))[0],u=i[1]):(l=(r=Hl(o,e,t))[0],u=r[1]),[l,u]},e}();var ty=function(e){return"boolean"===typeof e||e instanceof Boolean},ny=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}(),ry=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 ny(this)},e.removalNodes=[],e}();function iy(e,t){var n,r=e;ty(e)||null==e?r=null:(ea(e)||Sa(e))&&(n=String(e),r=new ry("TEXT_NODE",{nodeValue:n},[])),r&&t.push(r)}var oy=function(e){for(var t,n,r=arguments,i=1,o="",a="",s=[0],l=function(e){1===i&&(e||(o=o.replace(/^\s*\n\s*|\s*\n\s*$/g,"")))?s.push(e?r[e]:o):3===i&&(e||o)?(s[1]=e?r[e]:o,i=2):2===i&&"..."===o&&e?s[2]=us(s[2]||{},r[e]):2===i&&o&&!e?(s[2]=s[2]||{})[o]=!0:i>=5&&(5===i?((s[2]=s[2]||{})[n]=e?o?o+r[e]:r[e]:o,i=6):(e||o)&&(s[2][n]+=e?o+r[e]:o)),o=""},u=0;u<e.length;u++){u&&(1===i&&l(),l(u));for(var c=0;c<e[u].length;c++)t=e[u][c],1===i?"<"===t?(l(),s=[s,"",null],i=3):o+=t:4===i?"--"===o&&">"===t?(i=1,o=""):o=t+o[0]:a?t===a?a="":o+=t:'"'===t||"'"===t?a=t:">"===t?(l(),i=1):i&&("="===t?(i=5,n=o,o=""):"/"===t&&(i<5||">"===e[u][c+1])?(l(),3===i&&(s=s[0]),i=s,(s=s[0]).push(this.apply(null,i.slice(1))),i=0):" "===t||"\t"===t||"\n"===t||"\r"===t?(l(),i=2):o+=t),3===i&&"!--"===o&&(i=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 i=[];return n.forEach((function(e){Array.isArray(e)?e.forEach((function(e){iy(e,i)})):iy(e,i)})),new ry(e,t||{},i)}));var ay=function(e){return e===Object(e)};function sy(e){var t;return"TEXT_NODE"===e.type?t=document.createTextNode(e.props.nodeValue):py(t=document.createElement(e.type),{},e.props),t}function ly(e,t){e.node?t.removeChild(e.node):ly(e.firstChild,t)}function uy(e,t,n){Object.keys(t).forEach((function(r){if(/^on/.test(r)){if(!n[r]||t[r]!==n[r]){var i=r.slice(2).toLowerCase();e.removeEventListener(i,t[r])}}else"children"===r||n[r]||function(e){return(null===e||void 0===e?void 0:e.nodeType)===Node.TEXT_NODE}(e)||e.removeAttribute(r)})),py(e,t,n,(function(e){return!ns(t[e],n[e])}))}var cy=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i;function py(e,t,n,r){Object.keys(n).forEach((function(i){if(!r||r(i))if(/^on/.test(i)){var o=i.slice(2).toLowerCase();e.addEventListener(o,n[i])}else"nodeValue"===i?e[i]=n[i]:"style"===i&&ay(n[i])?function(e,t,n){t&&Object.keys(t).forEach((function(t){e.style[t]=""}));Object.keys(n).forEach((function(t){var r=n[t];e.style[t]=Sa(r)&&!cy.test(t)?r+"px":r}))}(e,t[i],n[i]):"children"!==i&&(!1===n[i]?e.removeAttribute(i):e.setAttribute(i,n[i]))}))}
2function dy(e){if(ry.removalNodes.forEach((function(e){return hy(e)})),e)for(var t=void 0,n=e.walker();t=n.walk();)if(e=t.vnode,t.entering)hy(e);else if(Al(e.type)){var r=e.component;if(!e.old&&r.mounted&&r.mounted(),e.old&&r.updated){var i=r.prevProps||{};r.updated(i)}}}function fy(e){for(var t=e.parent;!t.node;)t=t.parent;return t.node}function hy(e){if(e&&e.parent){if(e.node){var t=fy(e);"A"===e.effect?t.appendChild(e.node):"U"===e.effect&&uy(e.node,e.old.props,e.props)}if("D"===e.effect)for(var n=void 0,r=e.walker();n=r.walk();)if(e=n.vnode,!n.entering)if(Al(e.type)){var i=e.component;i.beforeDestroy&&i.beforeDestroy()}else{ly(e,t=fy(e))}e.ref&&(e.component?e.ref(e.component):e.node&&e.ref(e.node))}}function my(e,t){var n=t.props,r=t.component;return r?(r.prevProps=r.props,r.props=t.props,r):new e(n)}function vy(e){for(var t=e;e&&!e.skip;){if(Al(e.type)){var n=my(e.type,e);n.vnode=e,e.component=n,e.props.children=e.children=[n.render()],gy(e)}else e.node||(e.node=sy(e)),gy(e);if(e.firstChild)e=e.firstChild;else{for(;e&&e.parent&&!e.next&&(e=e.parent)!==t;);e=e.next}}}function gy(e){var t=e.children,n=e.old?e.old.firstChild:null,r=null;t.forEach((function(t,i){var o=function(e,t){return e&&t&&t.type===e.type&&(!t.key||t.key===e.key)}(n,t);o&&(t.old=n,t.parent=e,t.node=n.node,t.component=n.component,t.effect="U"),t&&!o&&(t.old=null,t.parent=e,t.node=null,t.effect="A"),n&&!o&&(ry.removalNodes.push(n),n.effect="D"),n&&(n=n.next),0===i?e.firstChild=t:t&&(r.next=t),r=t}));var i=rs(t);if(!t.length)for(;n;)ry.removalNodes.push(n),n.effect="D",n=n.next;for(;n&&i;)n&&i.old!==n&&(ry.removalNodes.push(n),n.effect="D",n=n.next)}function yy(e,t){var n=new ry(e.tagName.toLowerCase(),{},[t]);return n.node=e,ry.removalNodes=[],vy(n),dy(n),function(){return function(e){e.effect="D",ry.removalNodes=[e],dy(),ry.removalNodes=[]}(n.firstChild)}}var by,wy=function(){function e(e){this.props=e,this.state={},this.refs={}}return e.prototype.setState=function(e){var t=Jo(Jo({},this.state),e);ns(this.state,t)||(this.state=t,function(e){var t=e.vnode;t.effect="U",t.old=t,t.next&&(t.next.skip=!0),ry.removalNodes=[],vy(t),dy(t),t.next&&(t.next.skip=!1)}(this))},e}(),ky=function(e){function t(t){var n=e.call(this,t)||this;return n.state={hide:!1},n}return Go(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 oy(by||(by=Xo(['\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    "])),cl("mode-switch"),this.state.hide?"none":"block","markdown"===t?" active":"",(function(){n.emit("needChangeMode","markdown")}),Jm.get("Markdown"),"wysiwyg"===t?" active":"",(function(){n.emit("needChangeMode","wysiwyg")}),Jm.get("WYSIWYG"))},t}(wy);var xy=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)}},Cy=xy;var Ty=function(e,t){var n,r,i,o,a=!0,s=function(t){e.apply(null,t),n=null};function l(){if(o=Array.prototype.slice.call(arguments),a)return s(o),void(a=!1);i=Number(new Date),n=n||i,r(o),i-n>=t&&s(o)}return r=Cy(s,t=t||0),l.reset=function(){a=!0,n=null},l},Ey=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}return function(){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 i=r[n];e.call(t,i[1],i[0])}},t}()}(),My="undefined"!==typeof window&&"undefined"!==typeof document&&window.document===document,Ny="undefined"!==typeof 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")(),Sy="function"===typeof requestAnimationFrame?requestAnimationFrame.bind(Ny):function(e){return setTimeout((function(){return e(Date.now())}),1e3/60)};var Dy=["top","right","bottom","left","width","height","size","weight"],Ly="undefined"!==typeof MutationObserver,Ay=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,i=0;function o(){n&&(n=!1,e()),r&&s()}function a(){Sy(o)}function s(){var e=Date.now();if(n){if(e-i<2)return;r=!0}else n=!0,r=!1,setTimeout(a,t);i=e}return s}(this.refresh.bind(this),20)}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()}
vendor: 4,723 bytes, line 2
2));return e.forEach((function(e){return e.broadcastActive()})),e.length>0},e.prototype.connect_=function(){My&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),Ly?(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(){My&&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,r=Dy.some((function(e){return!!~n.indexOf(e)}));r&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),Oy=function(e,t){for(var n=0,r=Object.keys(t);n<r.length;n++){var i=r[n];Object.defineProperty(e,i,{value:t[i],enumerable:!1,writable:!1,configurable:!0})}return e},Iy=function(e){return e&&e.ownerDocument&&e.ownerDocument.defaultView||Ny},Ry=zy(0,0,0,0);function Py(e){return parseFloat(e)||0}function By(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce((function(t,n){return t+Py(e["border-"+n+"-width"])}),0)}function Fy(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return Ry;var r=Iy(e).getComputedStyle(e),i=function(e){for(var t={},n=0,r=["top","right","bottom","left"];n<r.length;n++){var i=r[n],o=e["padding-"+i];t[i]=Py(o)}return t}(r),o=i.left+i.right,a=i.top+i.bottom,s=Py(r.width),l=Py(r.height);if("border-box"===r.boxSizing&&(Math.round(s+o)!==t&&(s-=By(r,"left","right")+o),Math.round(l+a)!==n&&(l-=By(r,"top","bottom")+a)),!function(e){return e===Iy(e).document.documentElement}(e)){var u=Math.round(s+o)-t,c=Math.round(l+a)-n;1!==Math.abs(u)&&(s-=u),1!==Math.abs(c)&&(l-=c)}return zy(i.left,i.top,s,l)}var Hy="undefined"!==typeof SVGGraphicsElement?function(e){return e instanceof Iy(e).SVGGraphicsElement}:function(e){return e instanceof Iy(e).SVGElement&&"function"===typeof e.getBBox};function qy(e){return My?Hy(e)?function(e){var t=e.getBBox();return zy(0,0,t.width,t.height)}(e):Fy(e):Ry}function zy(e,t,n,r){return{x:e,y:t,width:n,height:r}}var jy=function(){function e(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=zy(0,0,0,0),this.target=e}return e.prototype.isActive=function(){var e=qy(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}(),Vy=function(e,t){var n=function(e){var t=e.x,n=e.y,r=e.width,i=e.height,o="undefined"!==typeof DOMRectReadOnly?DOMRectReadOnly:Object,a=Object.create(o.prototype);return Oy(a,{x:t,y:n,width:r,height:i,top:n,right:t+r,bottom:i+n,left:t}),a}(t);Oy(this,{target:e,contentRect:n})},_y=function(){function e(e,t,n){if(this.activeObservations_=[],this.observations_=new Ey,"function"!==typeof e)throw new 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 new TypeError("1 argument required, but only 0 present.");if("undefined"!==typeof Element&&Element instanceof Object){if(!(e instanceof Iy(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new jy(e)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!==typeof Element&&Element instanceof Object){if(!(e instanceof Iy(e).Element))throw new 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 Vy(e.target,e.broadcastRect())}
2));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}(),Uy="undefined"!==typeof WeakMap?new WeakMap:new Ey,$y=function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=Ay.getInstance(),r=new _y(t,n,this);Uy.set(this,r)};["observe","unobserve","disconnect"].forEach((function(e){$y.prototype[e]=function(){var t;return(t=Uy.get(this))[e].apply(t,arguments)}}));var Zy,Wy,Gy,Jy,Ky,Xy,Qy,Yy,eb,tb,nb,rb,ib,ob,ab,sb,lb="undefined"!==typeof Ny.ResizeObserver?Ny.ResizeObserver:$y,ub=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Go(t,e),t.prototype.execCommand=function(e){var t=gl(e.target,"li");this.props.execCommand("heading",{level:Number(t.getAttribute("data-level"))})},t.prototype.render=function(){var e=this;return oy(Wy||(Wy=Xo(["\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)}),Jm.get("Headings"),[1,2,3,4,5,6].map((function(e){return oy(Zy||(Zy=Xo(['\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,Jm.get("Heading"),e)})),Jm.get("Paragraph"))},t}(wy),cb=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Go(t,e),t.prototype.toggleTab=function(e,t){this.props.onClick(e,t)},t.prototype.render=function(){var e=this;return oy(Jy||(Jy=Xo(['\n      <div class="','" aria-role="tabpanel">\n        ',"\n      </div>\n    "],['\n      <div class="','" aria-role="tabpanel">\n        ',"\n      </div>\n    "])),cl("tabs"),this.props.tabs.map((function(t){var n=t.name,r=t.text,i=e.props.activeTab===n;return oy(Gy||(Gy=Xo(['\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          "])),i?" active":"",(function(t){return e.toggleTab(t,n)}),Jm.get(r),i?"true":"false",i?"0":"-1",Jm.get(r))})))},t}(wy),pb=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="",Na(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?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 Go(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?void 0:t.length){r="";var i=t.item(0);this.props.eventEmitter.emit("addImageBlobHook",i,(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";Na(e,"wrong"),n.length?n&&this.props.execCommand("addImage",{imageUrl:n,altText:r}):xa(e,"wrong")},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,i=t.fileNameElClassName;return oy(Ky||(Ky=Xo(['\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>
2\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    "])),Jm.get("Insert image"),cb,this.tabs,n,this.toggleTab,"url"===n?"block":"none",Jm.get("Image URL"),(function(t){return e.refs.url=t}),"file"===n?"block":"none",Jm.get("Select image file"),cl("file-name"),r?" has-file":i,this.showFileSelectBox,this.preventSelectStart,r?r.name:Jm.get("No file"),cl("file-select-button"),this.showFileSelectBox,Jm.get("Choose a file"),this.changeFile,(function(t){return e.refs.file=t}),Jm.get("Description"),(function(t){return e.refs.altText=t}),cl("button-container"),cl("close-button"),this.props.hidePopup,Jm.get("Cancel"),cl("ok-button"),this.execCommand,Jm.get("OK"))},t}(wy),db=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;(Na(e,"wrong"),Na(n,"wrong"),e.value.length<1)?xa(e,"wrong"):da(t.props.initialValues.linkUrl)&&n.value.length<1?xa(n,"wrong"):t.props.execCommand("addLink",{linkUrl:e.value,linkText:n.value})},t}return Go(t,e),t.prototype.initialize=function(){var e=this.props.initialValues,t=e.linkUrl,n=e.linkText,r=this.refs.url,i=this.refs.text;Na(r,"wrong"),Na(i,"wrong","disabled"),i.removeAttribute("disabled"),t&&(xa(i,"disabled"),i.setAttribute("disabled","disabled")),r.value=t||"",i.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 oy(Xy||(Xy=Xo(['\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    "])),Jm.get("Insert link"),Jm.get("URL"),(function(t){return e.refs.url=t}),Jm.get("Link text"),(function(t){return e.refs.text=t}),cl("button-container"),cl("close-button"),this.props.hidePopup,Jm.get("Cancel"),cl("ok-button"),this.execCommand,Jm.get("OK"))},t}(wy),fb=function(e){function t(t){var n=e.call(this,t)||this;return n.extendSelectionRange=function(e){var t=e.pageX,r=e.pageY,i=t-n.offsetRect.left,o=r-n.offsetRect.top,a=n.get
2SelectionRangeByOffset(i,o);n.setState(Jo({},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 Go(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:20*(e+1),height:20*(t+1)}},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),i=Math.max(n,5);return t>=5&&r<9&&(r+=1),n>=5&&i<14&&(i+=1),{colIdx:r+1,rowIdx:i+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=[],i=0;i<n;i+=1){for(var o=[],a=0;a<t;a+=1){var s=cl("table-cell")+(i>0?"":" header");o.push(oy(Qy||(Qy=Xo(['<div class="','"></div>'],['<div class="','"></div>'])),s))}r.push(oy(Yy||(Yy=Xo(['<div class="','">',"</div>"],['<div class="','">',"</div>"])),cl("table-row"),o))}return oy(eb||(eb=Xo(['<div class="','">',"</div>"],['<div class="','">',"</div>"])),cl("table"),r)},t.prototype.render=function(){var e=this,t=this.getTableRange(),n=this.getSelectionAreaBound();return oy(tb||(tb=Xo(['\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    "])),Jm.get("Insert table"),cl("table-selection"),(function(t){return e.refs.tableEl=t}),this.extendSelectionRange,this.execCommand,this.createTableArea(t),cl("table-selection-layer"),n,cl("table-description"),this.getDescription())},t}(wy),hb=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Go(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 oy(nb||(nb=Xo(["<div ref=","></div>"],["<div ref=","></div>"])),(function(t){return e.refs.el=t}))},t}(wy);function mb(e){return ea(e)?function(e){var t;switch(e){case"heading":t={name:"heading",className:"heading",tooltip:Jm.get("Headings"),state:"heading"};break;case"bold":t={name:"bold",className:"bold",command:"bold",tooltip:Jm.get("Bold"),state:"strong"};break;case"italic":t={name:"italic",className:"italic",command:"italic",tooltip:Jm.get("Italic"),state:"emph"};break;case"strike":t={name:"strike",className:"strike",command:"strike",tooltip:Jm.get("Strike"),state:"strike"};break;case"hr":t={name:"hr",className:"hrline",command:"hr",tooltip:Jm.get("Line"),state:"thematicBreak"};break;case"quote":t={name:"quote",className:"quote",command:"blockQuote",tooltip:Jm.get("Blockquote"),state:"blockQuote"};break;case"ul":t={name:"ul",className:"bullet-list",command:"bulletList",tooltip:Jm.get("Unordered list"),state:"bulletList"};break;case"ol":t={name:"ol",className:"ordered-list",command:"orderedList",tooltip:Jm.get("Ordered list"),state:"orderedList"};break;case"task":t={name:"task",className:"task-list",command:"taskList",tooltip:Jm.get("Task"),state:"taskList"};break;case"table":t={name:"table",className:"table",tooltip:Jm.get("Insert table"),state:"table"};break;case"image":t={name:"image",className:"image",tooltip:Jm.get("Insert image")};break;case"link":t={name:"link",className:"link",tooltip:Jm.get("Insert link")};break;case"code":t={name:"code",className:"code",command:"code",tooltip:Jm.get("Code"),state:"co
2de"};break;case"codeblock":t={name:"codeblock",className:"codeblock",command:"codeBlock",tooltip:Jm.get("Insert CodeBlock"),state:"codeBlock"};break;case"indent":t={name:"indent",className:"indent",command:"indent",tooltip:Jm.get("Indent"),state:"indent"};break;case"outdent":t={name:"outdent",className:"outdent",command:"outdent",tooltip:Jm.get("Outdent"),state:"outdent"};break;case"scrollSync":t=function(){var e=document.createElement("label"),t=document.createElement("input"),n=document.createElement("span");e.className="scroll-sync active",t.type="checkbox",t.checked=!0,n.className="switch";var r=function(n){return t.addEventListener("change",(function(t){var r=t.target.checked;r?xa(e,"active"):Na(e,"active"),n("toggleScrollSync",{active:r})}))};return e.appendChild(t),e.appendChild(n),{name:"scrollSync",el:e,onMounted:r}}();break;case"more":t={name:"more",className:"more",tooltip:Jm.get("More")}}"scrollSync"!==t.name&&(t.className+=" "+cl("toolbar-icons"));return t}(e):e}function vb(e,t){var n=t.el,r=t.pos,i=t.popup,o=t.initialValues;switch(e){case"heading":return{render:function(e){return oy(rb||(rb=Xo(["<"," ..."," />"],["<"," ..."," />"])),ub,e)},className:cl("popup-add-heading"),fromEl:n,pos:r};case"link":return{render:function(e){return oy(ib||(ib=Xo(["<"," ..."," />"],["<"," ..."," />"])),db,e)},className:cl("popup-add-link"),fromEl:n,pos:r,initialValues:o};case"image":return{render:function(e){return oy(ob||(ob=Xo(["<"," ..."," />"],["<"," ..."," />"])),pb,e)},className:cl("popup-add-image"),fromEl:n,pos:r};case"table":return{render:function(e){return oy(ab||(ab=Xo(["<"," ..."," />"],["<"," ..."," />"])),fb,e)},className:cl("popup-add-table"),fromEl:n,pos:r};case"customPopupBody":return i?Jo({render:function(e){return oy(sb||(sb=Xo(["<"," ..."," body="," />"],["<"," ..."," body="," />"])),hb,e,i.body)},fromEl:n,pos:r},i):null;default:return null}}function gb(e){e.hidden=e.length===e.filter((function(e){return e.hidden})).length}function yb(e,t){return e.reduce((function(e,n){e.push(n.map((function(e){return function(e){return e.hidden="scrollSync"===e.name&&t,e}(mb(e))})));var r=e[(e.length||1)-1];return r&&gb(r),e}),[])}var bb,wb,kb=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.handleMousedown=function(e){gl(e.target,"."+cl("popup"))||gl(e.target,t.props.info.fromEl)||t.props.hidePopup()},t}return Go(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 i=Jo({},r.pos),o=this.refs.el.offsetWidth,a=gl(this.refs.el,"."+cl("toolbar")).offsetWidth;i.left+o>=a&&(i.left=a-o-20),ns(this.state.popupPos,i)||this.setState({popupPos:i})}},t.prototype.render=function(){var e=this,t=this.props,n=t.info,r=t.show,i=t.hidePopup,o=t.eventEmitter,a=t.execCommand,s=n||{},l=s.className,u=void 0===l?"":l,c=s.style,p=s.render,d=s.initialValues,f=void 0===d?{}:d,h=Jo(Jo({display:r?"block":"none"},c),this.state.popupPos);return oy(bb||(bb=Xo(['\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    "])),cl("popup"),u,h,(function(t){return e.refs.el=t}),cl("popup-body"),p&&p({eventEmitter:o,show:r,hidePopup:i,execCommand:a,initialValues:f}))},t}(wy);function xb(e){return function(t){function n(e){var n=t.call(this,e)||this;return n.showTooltip=function(e){var t=n.props.item.tooltip;if(!n.props.disabled&&t){var r=n.getBound(e),i=r.left+6+"px",o=r.top+6+"px";ua(n.props.tooltipRef.current,{display:"block",left:i,top:o}),n.props.tooltipRef.current.querySelector(".text").textContent=t}},n.hideTooltip=function(){ua(n.props.tooltipRef.current,"display","none")},n.state={active:!1,disabled:e.disabled},n.addEvent(),n}return Go(n,t),n.prototype.addEvent=function(){var e=this,t=this.props,n=t.item,r=t.eventEmitter;n.state&&r.listen("changeToolbarState",(function(t){var r,i=null!==(r=t.toolbarState[n.state])&&void 0!==r?r:{},o=i.active,a=i.disabled;e.setState({active:!!o,disabled:null!==a&&void 0!==a?a:e.props.disabled})}
2))},n.prototype.getBound=function(e){var t=yl(e,gl(e,"."+cl("toolbar"))),n=t.offsetLeft,r=t.offsetTop;return{left:n,top:e.offsetHeight+r}},n.prototype.render=function(){return oy(wb||(wb=Xo(["\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)},n}(wy)}var Cb,Tb,Eb,Mb,Nb,Sb,Db,Lb,Ab,Ob,Ib,Rb,Pb,Bb,Fb=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,i=e.setPopupInfo,o=e.getBound,a=e.eventEmitter,s=n.command,l=n.name,u=n.popup;if(s)r(s);else{var c=u?"customPopupBody":l,p=a.emit("query","getPopupInitialValues",{popupName:c})[0],d=vb(c,{el:t.refs.el,pos:o(t.refs.el),popup:u,initialValues:p});d&&i(d)}},t}return Go(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,vl(this.refs.el)+(n.hidden?80:0))},t.prototype.render=function(){var e=this,t=this.props,n=t.hideTooltip,r=t.disabled,i=t.item,o=t.active,a=Jo({display:i.hidden?"none":null},i.style),s=(i.className||"")+(o?" active":"");return oy(Cb||(Cb=Xo(["\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,i.text||i.tooltip||"",i.text||"")},t}(wy),Hb=xb(Fb),qb=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=vb("customPopupBody",{el:t.refs.el,pos:t.props.getBound(t.refs.el),popup:t.props.item.popup});e&&t.props.setPopupInfo(e)},t}return Go(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,vl(this.refs.el)),n.onMounted&&n.onMounted(this.props.execCommand)},t.prototype.updated=function(e){var t,n=this.props,r=n.item,i=n.active,o=n.disabled;e.active===i&&e.disabled===o||null===(t=r.onUpdated)||void 0===t||t.call(r,{active:i,disabled:o})},t.prototype.render=function(){var e=this,t=this.props,n=t.disabled,r={display:t.item.hidden?"none":"inline-block"},i=function(e){return n?null:e};return oy(Tb||(Tb=Xo(["\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,cl("toolbar-item-wrapper"),i(this.showPopup),i(this.showTooltip),i(this.props.hideTooltip))},t}(wy),zb=xb(qb),jb=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Go(t,e),t.prototype.render=function(){var e=this,t=this.props,n=t.group,r=t.hiddenDivider,i=n.hidden?{display:"none"}:null,o=r?{display:"none"}:null;return oy(Mb||(Mb=Xo(['\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    "])),cl("toolbar-group"),i,n.map((function(t){var n=t.el?zb:Hb;return oy(Eb||(Eb=Xo(["<"," key="," ..."," item="," />"],["<"," key="," ..."," item="," />"])),n,t.name,e.props,t)})),cl("toolbar-divider"),o)},t}(wy),Vb=function(e){function t(t){var n=e.call(this,t)||this;return n.handleClickDocument=function(e){var t=e.target;gl(t,"."+cl("dropdown-toolbar"))||gl(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 Go(t,e),t.prototype.getBound=function(){var e=this.props.getBound(this.refs.el);return e.top+=4,Jo(Jo({},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,i=this.props,o=i.disabled,a=i.item,s=i.items,l=i.hideTooltip,u=s.filter((function(e){return!e.hidden})),c=u.length?null:{display:"none"},p=n?null:{display:"none"};return oy(Sb||(Sb=Xo(['\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    "])),cl("toolbar-group"),c,(function(t){return e.refs.el=t}),a.className,(function(){return e.setState({showDropdown:!0})}),this.showTooltip,l,o,cl("dropdown-toolbar"),Jo(Jo({},p),r),(function(t){return e.refs.dropdownEl=t}),u.length?u.map((function(t,n){var r;return oy(Nb||(Nb=Xo(["\n                  <","\n                    group=","\n                    hiddenDivider=","\n                    ...","\n                  />\n                "],["\n                  <","\n                    group=","\n                    hiddenDivider=","\n                    ...","\n                  />\n                "])),jb,t,n===u.length-1||(null===(r=u[n+1])||void 0===r?void 0:r.hidden),e.props)})):null)},t}(wy),_b=xb(Vb),Ub=function(e){function t(t){var n=e.call(this,t)||this;return n.toggleTab=function(e,t){var r=n.props.eventEmitter;if(n.state.activeTab!==t){var i="write"===t?"changePreviewTabWrite":"changePreviewTabPreview";r.emit(i),n.setState({activeTab:t})}},n.setItemWidth=function(e,t){n.itemWidthMap[e]=t}
2,n.setPopupInfo=function(e){n.setState({showPopup:!0,popupInfo:e})},n.openPopup=function(e,t){void 0===t&&(t={});var r=n.refs.el.querySelector("."+cl("toolbar-group")+" ."+e);if(r){var i=yl(r,gl(r,"."+cl("toolbar"))),o=i.offsetLeft,a=i.offsetTop,s=vb(e,{el:r,pos:{left:o,top:r.offsetHeight+a},initialValues:t});s&&n.setPopupInfo(s)}},n.hidePopup=function(){n.state.showPopup&&n.setState({showPopup:!1})},n.execCommand=function(e,t){n.props.eventEmitter.emit("command",e,t),n.hidePopup()},n.tabs=[{name:"write",text:"Write"},{name:"preview",text:"Preview"}],n.itemWidthMap={},n.initialItems=yb(t.toolbarItems||[],n.hiddenScrollSync()),n.state={items:n.initialItems,dropdownItems:[],showPopup:!1,popupInfo:{},activeTab:"write"},n.tooltipRef={current:null},n.resizeObserver=new lb((function(){return n.handleResize()})),n.addEvent(),n}return Go(t,e),t.prototype.insertToolbarItem=function(e,t){var n=e.groupIndex,r=e.itemIndex,i=this.initialItems[n];t=mb(t),i?i.splice(r,0,t):this.initialItems.push([t]),this.setState(this.classifyToolbarItems())},t.prototype.removeToolbarItem=function(e){var t=this;na(this.initialItems,(function(n){var r=!1;return na(n,(function(i,o){return i.name!==e||(r=!0,n.splice(o,1),t.setState(t.classifyToolbarItems()),!1)})),!r}))},t.prototype.addEvent=function(){var e=this,t=this.props.eventEmitter;this.handleResize=Ty((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="'+cl("tooltip")+'" style="display:none">\n        <div class="arrow"></div>\n        <span class="text"></span>\n      </div>';this.tooltipRef.current=ml(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 i=function(e){var t=e.pop();t&&r.push(t)};if(e>1)i(n);else{var o=rs(t);o&&i(o)}},t.prototype.classifyToolbarItems=function(){var e=this,t=0,n=this.refs.el.clientWidth,r=this.refs.el.querySelector("."+cl("toolbar-divider")),i=r?vl(r):0,o=[],a=[],s=!1;return this.initialItems.forEach((function(r,l){var u=[],c=[];r.forEach((function(r,i){r.hidden||((t+=e.itemWidthMap[r.name])>n-50?(s||(e.movePrevItemToDropdownToolbar(i,o,u,c),s=!0),c.push(r)):u.push(r))})),u.length&&(gb(u),o.push(u)),c.length&&(gb(c),a.push(c)),l<e.state.items.length-1&&(t+=i)})),{items:o,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,n,r=this.props,i=r.editorType,o=r.previewStyle,a=r.eventEmitter,s=o!==e.previewStyle,l=i!==e.editorType;if(s||l){t=this.initialItems,n=this.hiddenScrollSync(),t.forEach((function(e){e.forEach((function(e){return e.hidden="scrollSync"===e.name&&n})),gb(e)}));var u=this.classifyToolbarItems();(s||"tab"===o&&"markdown"===i)&&(a.emit("changePreviewTabWrite"),u.activeTab="write"),this.setState(u)}},t.prototype.beforeDestroy=function(){window.removeEventListener("resize",this.handleResize),this.resizeObserver.disconnect(),fl(this.tooltipRef.current)},t.prototype.render=function(){var e=this,t=this.props,n=t.previewStyle,r=t.eventEmitter,i=t.editorType,o=this.state,a=o.popupInfo,s=o.showPopup,l=o.activeTab,u=o.items,c=o.dropdownItems,p={eventEmitter:r,tooltipRef:this.tooltipRef,disabled:"markdown"===i&&"tab"===n&&"preview"===l,execCommand:this.execCommand,setPopupInfo:this.setPopupInfo},d="tab"===n?{borderTopLeftRadius:0}:null;return oy(Lb||(Lb=Xo(['\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    "])),cl("toolbar"),cl("md-tab-container"),"wysiwyg"===i||"vertical"===n?"none":"block",cb,this.tabs,l,this.toggleTab,cl("defaultUI-toolbar"),(function(t){return e.refs.el=t}),d,u.map((function(t,n){var r;return oy(Db||(Db=Xo(["\n              <","\n                group=","\n                hiddenDivider=","\n                setItemWidth=","\n                ...","\n              />\n            "],["\n              <","\n                group=","\n                hiddenDivider=","\n                setItemWidth=","\n                ...","\n              />\n            "])),jb,t,n===u.length-1||(null===(r=u[n+1])||void 0===r?void 0:r.hidden),e.setItemWidth,p)})),_b,mb("more"),c,p,kb,a,s,r,this.hidePopup,this.execCommand)},t}(wy),$b=function(e){function t(t){var n=e.call(this,t)||this;return n.handleClickDocument=function(e){gl(e.target,"."+cl("context-menu"))||n.setState({pos:null})},n.state={pos:null,menuGroups:[]},n.addEvent(),n}return Go(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=[];
2return n.forEach((function(t){var n=t.label,i=t.className,o=void 0!==i&&i,a=t.disabled,s=t.onClick;r.push(oy(Ab||(Ab=Xo(["\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(){a||(s(),e.setState({pos:null}))}),a?" disabled":"",o,n))})),t.push(oy(Ob||(Ob=Xo(['<ul class="menu-group">\n              ',"\n            </ul>"],['<ul class="menu-group">\n              ',"\n            </ul>"])),r)),t}),[]):[]},t.prototype.render=function(){var e=Jo({display:this.state.pos?"block":"none"},this.state.pos);return oy(Ib||(Ib=Xo(['<div class="','" style=',' aria-role="menu">\n      ',"\n    </div>"],['<div class="','" style=',' aria-role="menu">\n      ',"\n    </div>"])),cl("context-menu"),e,this.getMenuGroupElements())},t}(wy),Zb=function(e){function t(t){var n=e.call(this,t)||this;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})};var r=t.editorType,i=t.previewStyle;return n.state={editorType:r,previewStyle:i,hide:!1},n.addEvent(),n}return Go(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,i=t.toolbarItems,o=t.theme,a=this.state,s=a.hide,l=a.previewStyle,u=a.editorType,c=s?" hidden":"",p=cl("markdown"===u?"md-mode":"ww-mode"),d=cl("md")+"-"+l+"-style",f=cl(["light"!==o,o+" "]);return oy(Pb||(Pb=Xo(['\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    "])),f,cl("defaultUI"),c,(function(t){return e.refs.el=t}),Ub,(function(t){return e.toolbar=t}),n,l,i,u,cl("main"),p,(function(t){return e.refs.editorSection=t}),cl("main-container"),cl("md-container"),d,(function(t){return e.refs.mdContainer=t}),cl("md-splitter"),cl("ww-container"),(function(t){return e.refs.wwContainer=t}),!r&&oy(Rb||(Rb=Xo(["<"," eventEmitter="," editorType="," />"],["<"," eventEmitter="," editorType="," />"])),ky,n,u),$b,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}(wy),Wb=function(e){function t(t){var n,r,i=e.call(this,t)||this,o=yy(i.options.el,oy(Bb||(Bb=Xo(["\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      "])),Zb,(function(e){return r=e}),i.eventEmitter,i.getEditorElements(),i.options.hideModeSwitch,i.options.toolbarItems,i.options.previewStyle,i.options.initialEditType,i.options.theme));return i.setMinHeight(i.options.minHeight),i.setHeight(i.options.height),i.defaultUI={insertToolbarItem:r.insertToolbarItem.bind(r),removeToolbarItem:r.removeToolbarItem.bind(r),destroy:o}
2,null===(n=i.pluginInfo.toolbarItems)||void 0===n||n.forEach((function(e){var t=e.groupIndex,n=e.itemIndex,r=e.item;i.defaultUI.insertToolbarItem({groupIndex:t,itemIndex:n},r)})),i.eventEmitter.emit("loadUI",i),i}return Go(t,e),t.factory=function(e){return e.viewer?new _g(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}(ey);ey.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"});var Gb=n(45610),Jb=n.n(Gb),Kb=function(e,t){return Kb=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])},Kb(e,t)};function Xb(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}Kb(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var Qb=function(){return Qb=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Qb.apply(this,arguments)},Yb=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.rootEl=a.createRef(),t}return Xb(t,e),t.prototype.getRootElement=function(){return this.rootEl.current},t.prototype.getInstance=function(){return this.editorInst},t.prototype.getBindingEventNames=function(){var e=this;return Object.keys(this.props).filter((function(e){return/^on[A-Z][a-zA-Z]+/.test(e)})).filter((function(t){return e.props[t]}))},t.prototype.bindEventHandlers=function(e){var t=this;this.getBindingEventNames().forEach((function(n){var r=n[2].toLowerCase()+n.slice(3);t.editorInst.off(r),t.editorInst.on(r,e[n])}))},t.prototype.getInitEvents=function(){var e=this;return this.getBindingEventNames().reduce((function(t,n){return t[n[2].toLowerCase()+n.slice(3)]=e.props[n],t}),{})},t.prototype.componentDidMount=function(){this.editorInst=new Wb(Qb(Qb({el:this.rootEl.current},this.props),{events:this.getInitEvents()}))},t.prototype.shouldComponentUpdate=function(e){var t=this.getInstance(),n=e.height,r=e.previewStyle;return n&&this.props.height!==n&&t.setHeight(n),r&&this.props.previewStyle!==r&&t.changePreviewStyle(r),this.bindEventHandlers(e),!1},t.prototype.render=function(){return a.createElement("div",{ref:this.rootEl})},t}(a.Component),ew=(function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.rootEl=a.createRef(),t}Xb(t,e),t.prototype.getRootElement=function(){return this.rootEl.current},t.prototype.getInstance=function(){return this.viewerInst},t.prototype.getBindingEventNames=function(){var e=this;return Object.keys(this.props).filter((function(e){return/^on[A-Z][a-zA-Z]+/.test(e)})).filter((function(t){return e.props[t]}))},t.prototype.bindEventHandlers=function(e){var t=this;
2this.getBindingEventNames().forEach((function(n){var r=n[2].toLowerCase()+n.slice(3);t.viewerInst.off(r),t.viewerInst.on(r,e[n])}))},t.prototype.getInitEvents=function(){var e=this;return this.getBindingEventNames().reduce((function(t,n){return t[n[2].toLowerCase()+n.slice(3)]=e.props[n],t}),{})},t.prototype.componentDidMount=function(){this.viewerInst=new(Jb())(Qb(Qb({el:this.rootEl.current},this.props),{events:this.getInitEvents()}))},t.prototype.shouldComponentUpdate=function(e){return this.bindEventHandlers(e),!1},t.prototype.render=function(){return a.createElement("div",{ref:this.rootEl})}}(a.Component),(0,o.d)("div")({name:"Wrapper",class:"wkyirgj"})),tw=function(e){var t=(0,a.useState)(e.value.data.markdown),n=(0,i.Z)(t,2),o=n[0],s=n[1],l=(0,a.useCallback)((function(e){e.stopPropagation()}),[]),u=(0,a.useCallback)((function(){e.onFinishedEditing((0,r.Z)((0,r.Z)({},e.value),{},{data:(0,r.Z)((0,r.Z)({},e.value.data),{},{markdown:o})}))}),[e,o]),c=(0,a.useCallback)((function(){e.onFinishedEditing(void 0)}),[e]);return(0,a.createElement)(ew,{id:"markdown-wysiwyg",onKeyDown:l},(0,a.createElement)(Yb,{initialEditType:"wysiwyg",autofocus:!0,initialValue:e.value.data.markdown,hideModeSwitch:!0,onChange:s,height:"75vh",usageStatistics:!1,toolbarItems:[["heading","bold","italic","strike"],["hr","quote"],["ul","ol","task","indent","outdent"],["table","link"],["code","codeblock"]]}),(0,a.createElement)("div",{className:"footer"},(0,a.createElement)("button",{className:"close-button",onClick:c},"Close"),(0,a.createElement)("button",{className:"save-button",onClick:u},"Save")))}}}]);

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.