streamlit-nightly 1.31.2.dev20240229__py2.py3-none-any.whl → 1.31.2.dev20240301__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. streamlit/elements/doc_string.py +25 -20
  2. streamlit/elements/media.py +11 -12
  3. streamlit/static/asset-manifest.json +12 -12
  4. streamlit/static/index.html +1 -1
  5. streamlit/static/static/css/3142.95a45cfe.chunk.css +1 -0
  6. streamlit/static/static/js/1074.71719df6.chunk.js +1 -0
  7. streamlit/static/static/js/3142.c56745f3.chunk.js +1 -0
  8. streamlit/static/static/js/4253.ffc51ffe.chunk.js +2 -0
  9. streamlit/static/static/js/{43.36939bb1.chunk.js → 43.770724a5.chunk.js} +1 -1
  10. streamlit/static/static/js/5345.65c91ee7.chunk.js +1 -0
  11. streamlit/static/static/js/{5791.c5138157.chunk.js → 5791.9a42fb4b.chunk.js} +1 -1
  12. streamlit/static/static/js/6405.ac5a6f23.chunk.js +1 -0
  13. streamlit/static/static/js/7142.83028745.chunk.js +1 -0
  14. streamlit/static/static/js/9865.fd93213d.chunk.js +1 -0
  15. streamlit/static/static/js/main.1661a802.js +2 -0
  16. {streamlit_nightly-1.31.2.dev20240229.dist-info → streamlit_nightly-1.31.2.dev20240301.dist-info}/METADATA +1 -1
  17. {streamlit_nightly-1.31.2.dev20240229.dist-info → streamlit_nightly-1.31.2.dev20240301.dist-info}/RECORD +23 -28
  18. streamlit/static/static/css/6692.65519639.chunk.css +0 -1
  19. streamlit/static/static/js/1011.232347f3.chunk.js +0 -1
  20. streamlit/static/static/js/1074.161eb70d.chunk.js +0 -1
  21. streamlit/static/static/js/5733.57e8e28c.chunk.js +0 -2
  22. streamlit/static/static/js/5733.57e8e28c.chunk.js.LICENSE.txt +0 -45
  23. streamlit/static/static/js/6692.6496cbc2.chunk.js +0 -1
  24. streamlit/static/static/js/7142.400eefdd.chunk.js +0 -1
  25. streamlit/static/static/js/7673.0828a05e.chunk.js +0 -2
  26. streamlit/static/static/js/main.b7ed447a.js +0 -2
  27. streamlit/static/static/media/index.1e3d64b0fcde879f0060.cjs +0 -1
  28. streamlit/static/static/media/index.294a0edb7af7d19b781b.cjs +0 -1
  29. streamlit/static/static/media/index.85823dd8655ed4119d0c.cjs +0 -1
  30. streamlit/static/static/media/index.9659d9c420d8750cbee8.cjs +0 -1
  31. streamlit/static/static/media/index.b599194a631d76b49328.cjs +0 -1
  32. /streamlit/static/static/js/{7673.0828a05e.chunk.js.LICENSE.txt → 4253.ffc51ffe.chunk.js.LICENSE.txt} +0 -0
  33. /streamlit/static/static/js/{main.b7ed447a.js.LICENSE.txt → main.1661a802.js.LICENSE.txt} +0 -0
  34. {streamlit_nightly-1.31.2.dev20240229.data → streamlit_nightly-1.31.2.dev20240301.data}/scripts/streamlit.cmd +0 -0
  35. {streamlit_nightly-1.31.2.dev20240229.dist-info → streamlit_nightly-1.31.2.dev20240301.dist-info}/WHEEL +0 -0
  36. {streamlit_nightly-1.31.2.dev20240229.dist-info → streamlit_nightly-1.31.2.dev20240301.dist-info}/entry_points.txt +0 -0
  37. {streamlit_nightly-1.31.2.dev20240229.dist-info → streamlit_nightly-1.31.2.dev20240301.dist-info}/top_level.txt +0 -0
@@ -1,2 +0,0 @@
1
- /*! For license information please see 5733.57e8e28c.chunk.js.LICENSE.txt */
2
- (self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[5733],{45610:(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,s=Object.freeze,a=Object.seal,l=Object.create,c="undefined"!==typeof Reflect&&Reflect,u=c.apply,p=c.construct;u||(u=function(e,t,n){return e.apply(t,n)}),s||(s=function(e){return e}),a||(a=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),h=x(Array.prototype.pop),f=x(Array.prototype.push),m=x(String.prototype.toLowerCase),g=x(String.prototype.match),v=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 u(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 s=m(o);s!==o&&(r(t)||(t[i]=s),o=s)}e[o]=!0}return e}function E(e){var n=l(null),r=void 0;for(r in e)u(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=s(["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=s(["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=s(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),L=s(["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=s(["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=s(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),I=s(["#text"]),R=s(["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","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),P=s(["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=s(["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=s(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),H=a(/\{\{[\s\S]*|[\s\S]*\}\}/gm),q=a(/<%[\s\S]*|[\s\S]*%>/gm),z=a(/^data-[\-\w.\u00B7-\uFFFF]/),j=a(/^aria-[\-\w]+$/),V=a(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),_=a(/^(?:\w+script|data):/i),U=a(/[\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 W(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 G=function(){return"undefined"===typeof window?null:window},J=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 K(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:G(),t=function(e){return K(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,a=e.Node,l=e.Element,c=e.NodeFilter,u=e.NamedNodeMap,p=void 0===u?e.NamedNodeMap||e.MozNamedAttrMap:u,x=e.Text,C=e.Comment,Z=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=J(X,n),oe=ie&&Fe?ie.createHTML(""):"",se=r,ae=se.implementation,le=se.createNodeIterator,ce=se.createDocumentFragment,ue=se.getElementsByTagName,pe=n.importNode,de={};try{de=E(r).documentMode?r.documentMode:{}}catch(xt){}var he={};t.isSupported="function"===typeof ne&&ae&&"undefined"!==typeof ae.createHTMLDocument&&9!==de;var fe=H,me=q,ge=z,ve=j,ye=_,be=U,we=V,ke=null,xe=T({},[].concat(W(N),W(S),W(D),W(A),W(I))),Ce=null,Te=T({},[].concat(W(R),W(P),W(B),W(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"]),We=null,Ge=T({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Je="http://www.w3.org/1998/Math/MathML",Ke="http://www.w3.org/2000/svg",Ze="http://www.w3.org/1999/xhtml",Xe=Ze,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,We="ADD_URI_SAFE_ATTR"in e?T(E(Ge),e.ADD_URI_SAFE_ATTR):Ge,Ue="ADD_DATA_URI_TAGS"in e?T(E($e),e.ADD_DATA_URI_TAGS):$e,Ve="FORBID_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||Ze,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(W(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(We,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),s&&s(e),rt=e)},st=T({},["mi","mo","mn","ms","mtext"]),at=T({},["foreignobject","desc","title","annotation-xml"]),lt=T({},S);T(lt,D),T(lt,L);var ct=T({},A);T(ct,O);var ut=function(e){var t=ne(e);t&&t.tagName||(t={namespaceURI:Ze,tagName:"template"});var n=m(e.tagName),r=m(t.tagName);if(e.namespaceURI===Ke)return t.namespaceURI===Ze?"svg"===n:t.namespaceURI===Je?"svg"===n&&("annotation-xml"===r||st[r]):Boolean(lt[n]);if(e.namespaceURI===Je)return t.namespaceURI===Ze?"math"===n:t.namespaceURI===Ke?"math"===n&&at[r]:Boolean(ct[n]);if(e.namespaceURI===Ze){if(t.namespaceURI===Ke&&!at[r])return!1;if(t.namespaceURI===Je&&!st[r])return!1;var i=T({},["title","style","font","a","script"]);return!ct[n]&&(i[n]||!lt[n])}return!1},pt=function(e){f(t.removed,{element:e});try{e.parentNode.removeChild(e)}catch(xt){try{e.outerHTML=oe}catch(xt){e.remove()}}},dt=function(e,n){try{f(t.removed,{attribute:n.getAttributeNode(e),from:n})}catch(xt){f(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){}},ht=function(e){var t=void 0,n=void 0;if(Ie)e="<remove></remove>"+e;else{var i=g(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===Ze)try{t=(new Z).parseFromString(o,Ye)}catch(xt){}if(!t||!t.documentElement){t=ae.createDocument(Xe,"template",null);try{t.documentElement.innerHTML=Qe?"":o}catch(xt){}}var s=t.body||t.documentElement;return e&&n&&s.insertBefore(r.createTextNode(n),s.childNodes[0]||null),Xe===Ze?ue.call(t,Ae?"html":"body")[0]:Ae?t.documentElement:s},ft=function(e){return le.call(e.ownerDocument||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.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)},gt=function(e){return"object"===("undefined"===typeof a?"undefined":$(a))?e instanceof a:e&&"object"===("undefined"===typeof e?"undefined":$(e))&&"number"===typeof e.nodeType&&"string"===typeof e.nodeName},vt=function(e,n,r){he[e]&&d(he[e],(function(e){e.call(t,n,r,rt)}))},yt=function(e){var n=void 0;if(vt("beforeSanitizeElements",e,null),mt(e))return pt(e),!0;if(g(e.nodeName,/[\u0080-\uFFFF]/))return pt(e),!0;var r=nt(e.nodeName);if(vt("uponSanitizeElement",e,{tagName:r,allowedTags:ke}),!gt(e.firstElementChild)&&(!gt(e.content)||!gt(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 s=o.length-1;s>=0;--s)i.insertBefore(Y(o[s],!0),ee(e))}return pt(e),!0}return e instanceof l&&!ut(e)?(pt(e),!0):"noscript"!==r&&"noembed"!==r||!w(/<\/no(script|embed)/i,e.innerHTML)?(Le&&3===e.nodeType&&(n=e.textContent,n=v(n,fe," "),n=v(n,me," "),e.textContent!==n&&(f(t.removed,{element:e.cloneNode()}),e.textContent=n)),vt("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(ge,t));else if(Ne&&w(ve,t));else{if(!Ce[t]||Me[t])return!1;if(We[t]);else if(w(we,v(n,be,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==y(n,"data:")||!Ue[e])if(De&&!w(ye,v(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;vt("beforeSanitizeAttributes",e,null);var s=e.attributes;if(s){var a={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Ce};for(o=s.length;o--;){var l=n=s[o],c=l.name,u=l.namespaceURI;if(r=b(n.value),i=nt(c),a.attrName=i,a.attrValue=r,a.keepAttr=!0,a.forceKeepAttr=void 0,vt("uponSanitizeAttribute",e,a),r=a.attrValue,!a.forceKeepAttr&&(dt(c,e),a.keepAttr))if(w(/\/>/i,r))dt(c,e);else{Le&&(r=v(r,fe," "),r=v(r,me," "));var p=nt(e.nodeName);if(bt(p,i,r))try{u?e.setAttributeNS(u,c,r):e.setAttribute(c,r),h(t.removed)}catch(xt){}}}vt("afterSanitizeAttributes",e,null)}},kt=function e(t){var n=void 0,r=ft(t);for(vt("beforeSanitizeShadowDOM",t,null);n=r.nextNode();)vt("uponSanitizeShadowNode",n,null),yt(n)||(n.content instanceof i&&e(n.content),wt(n));vt("afterSanitizeShadowDOM",t,null)};return t.sanitize=function(r,o){var s=void 0,l=void 0,c=void 0,u=void 0,p=void 0;if((Qe=!r)&&(r="\x3c!--\x3e"),"string"!==typeof r&&!gt(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(gt(r))return e.toStaticHTML(r.outerHTML)}return r}if(Oe||ot(o),t.removed=[],"string"===typeof r&&(ze=!1),ze);else if(r instanceof a)1===(l=(s=ht("\x3c!----\x3e")).ownerDocument.importNode(r,!0)).nodeType&&"BODY"===l.nodeName||"HTML"===l.nodeName?s=l:s.appendChild(l);else{if(!Re&&!Le&&!Ae&&-1===r.indexOf("<"))return ie&&Fe?ie.createHTML(r):r;if(!(s=ht(r)))return Re?null:oe}s&&Ie&&pt(s.firstChild);for(var d=ft(ze?r:s);c=d.nextNode();)3===c.nodeType&&c===u||yt(c)||(c.content instanceof i&&kt(c.content),wt(c),u=c);if(u=null,ze)return r;if(Re){if(Pe)for(p=ce.call(s.ownerDocument);s.firstChild;)p.appendChild(s.firstChild);else p=s;return Be&&(p=pe.call(n,p,!0)),p}var h=Ae?s.outerHTML:s.innerHTML;return Le&&(h=v(h,fe," "),h=v(h,me," ")),ie&&Fe?ie.createHTML(h):h},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&&(he[e]=he[e]||[],f(he[e],t))},t.removeHook=function(e){he[e]&&h(he[e])},t.removeHooks=function(e){he[e]&&(he[e]=[])},t.removeAllHooks=function(){he={}},t}return K()}()},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 s(e,t,n){var r,s=o(e,t);n?(i(s,(function(i,o){return n!==i.handler||(a(e,t,i.wrappedHandler),r=o,!1)})),s.splice(r,1)):(i(s,(function(n){a(e,t,n.wrappedHandler)})),s.splice(0,s.length))}function a(e,t,n){"removeEventListener"in e?e.removeEventListener(t,n):"detachEvent"in e&&e.detachEvent("on"+t,n)}e.exports=function(e,t,n){r(t)?i(t.split(/\s+/g),(function(t){s(e,t,n)})):i(t,(function(t,n){s(e,n,t)}))}},348:function(e,t,n){"use strict";var r=n(758),i=n(690),o=n(755);function s(e,t,n,r){function s(t){n.call(r||e,t||window.event)}"addEventListener"in e?e.addEventListener(t,s):"attachEvent"in e&&e.attachEvent("on"+t,s),function(e,t,n,r){var s=o(e,t),a=!1;i(s,(function(e){return e.handler!==n||(a=!0,!1)})),a||s.push({handler:n,wrappedHandler:r})}(e,t,n,s)}e.exports=function(e,t,n,o){r(t)?i(t.split(/\s+/g),(function(t){s(e,t,n,o)})):i(t,(function(t,r){s(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),s=n(24);e.exports=function(e){var t,n=Array.prototype.slice.call(arguments,1),a=e.classList,l=[];a?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)})),s(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,s=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 s.call(e,t)}},462:function(e,t,n){"use strict";var r=n(893),i=n(928),o=n(902),s=n(24);e.exports=function(e){var t,n,a=Array.prototype.slice.call(arguments,1),l=e.classList;l?r(a,(function(e){l.remove(e)})):(t=o(e).split(/\s+/),n=[],r(t,(function(e){i(e,a)<0&&n.push(e)})),s(e,n))}},969:function(e){"use strict";e.exports=function(e,t){var n,r,i,o,s=Object.prototype.hasOwnProperty;for(i=1,o=arguments.length;i<o;i+=1)for(r in n=arguments[i])s.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,s="TOAST UI "+e+" for "+n+": Statistics",a=window.localStorage.getItem(s);(r(window.tui)||!1!==window.tui.usageStatistics)&&(a&&!function(e){return(new Date).getTime()-e>o}(a)||(window.localStorage.setItem(s,(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}},s={};function a(e){var t=s[e];if(void 0!==t)return t.exports;var n=s[e]={exports:{}};return o[e].call(n.exports,n,n.exports,a),n.exports}a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,{a:t}),t},a.d=function(e,t){for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},a.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}(),a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};var l={};return function(){"use strict";a.d(l,{default:function(){return Zr}});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 s="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window?window:"undefined"!==typeof a.g?a.g:"undefined"!==typeof self?self:{},c={};function u(e,t,n){var r,i,o,s,a,l="";for("string"!==typeof t&&(n=t,t=u.defaultChars),"undefined"===typeof n&&(n=!0),a=function(e){var t,n,r=c[e];if(r)return r;for(r=c[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+=a[o];else if(o>=55296&&o<=57343){if(o>=55296&&o<=56319&&r+1<i&&(s=e.charCodeAt(r+1))>=56320&&s<=57343){l+=encodeURIComponent(e[r]+e[r+1]),r++;continue}l+="%EF%BF%BD"}else l+=encodeURIComponent(e[r]);return l}u.defaultChars=";/?:@&=+$,-_.!~*'()#",u.componentChars="-_.!~*'()";var p=u,d={},h={},f={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:"\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",Edot:"\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:"\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",minus:"\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:"\u03bd",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:"\u03f1",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:"\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",xodot:"\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:"&",Aring:"\xc5",aring:"\xe5",Atilde:"\xc3",atilde:"\xe3",Auml:"\xc4",auml:"\xe4",brvbar:"\xa6",Ccedil:"\xc7",ccedil:"\xe7",cedil:"\xb8",cent:"\xa2",copy:"\xa9",COPY:"\xa9",curren:"\xa4",deg:"\xb0",divide:"\xf7",Eacute:"\xc9",eacute:"\xe9",Ecirc:"\xca",ecirc:"\xea",Egrave:"\xc8",egrave:"\xe8",ETH:"\xd0",eth:"\xf0",Euml:"\xcb",euml:"\xeb",frac12:"\xbd",frac14:"\xbc",frac34:"\xbe",gt:">",GT:">",Iacute:"\xcd",iacute:"\xed",Icirc:"\xce",icirc:"\xee",iexcl:"\xa1",Igrave:"\xcc",igrave:"\xec",iquest:"\xbf",Iuml:"\xcf",iuml:"\xef",laquo:"\xab",lt:"<",LT:"<",macr:"\xaf",micro:"\xb5",middot:"\xb7",nbsp:"\xa0",not:"\xac",Ntilde:"\xd1",ntilde:"\xf1",Oacute:"\xd3",oacute:"\xf3",Ocirc:"\xd4",ocirc:"\xf4",Ograve:"\xd2",ograve:"\xf2",ordf:"\xaa",ordm:"\xba",Oslash:"\xd8",oslash:"\xf8",Otilde:"\xd5",otilde:"\xf5",Ouml:"\xd6",ouml:"\xf6",para:"\xb6",plusmn:"\xb1",pound:"\xa3",quot:'"',QUOT:'"',raquo:"\xbb",reg:"\xae",REG:"\xae",sect:"\xa7",shy:"\xad",sup1:"\xb9",sup2:"\xb2",sup3:"\xb3",szlig:"\xdf",THORN:"\xde",thorn:"\xfe",times:"\xd7",Uacute:"\xda",uacute:"\xfa",Ucirc:"\xdb",ucirc:"\xfb",Ugrave:"\xd9",ugrave:"\xf9",uml:"\xa8",Uuml:"\xdc",uuml:"\xfc",Yacute:"\xdd",yacute:"\xfd",yen:"\xa5",yuml:"\xff"},g={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'},v={},y=s&&s.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(v,"__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)};v.default=function(e){return e>=55296&&e<=57343||e>1114111?"\ufffd":(e in b.default&&(e=b.default[e]),w(e))};var k=s&&s.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(h,"__esModule",{value:!0}),h.decodeHTML=h.decodeHTMLStrict=h.decodeXML=void 0;var x=k(f),C=k(m),T=k(g),E=k(v),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)}}h.decodeXML=N(T.default),h.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}}h.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 s(e){return";"!==e.substr(-1)&&(e+=";"),o(e)}return function(e){return String(e).replace(i,s)}}();var L={},A=s&&s.__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(g).default),I=q(O);L.encodeXML=U(O);var R,P,B=H(A(f).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 s=0;s<t.length-1;s++){for(var a=s;a<t.length-1&&t[a].charCodeAt(1)+1===t[a+1].charCodeAt(1);)a+=1;var l=1+a-s;l<3||t.splice(s,l,t[s]+"-"+t[a])}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)},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=h,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=h;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});",W=/[\\&]/,G="[!\"#$%&'()*+,./:;<=>?@[\\\\\\]^_`{|}~-]",J=new RegExp("\\\\"+G+"|"+$,"gi"),K=new RegExp('[&<>"]',"g"),Z=function(e){return 92===e.charCodeAt(0)?e.charAt(1):d.decodeHTML(e)};function X(e){return W.test(e)?e.replace(J,Z):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 K.test(e)?e.replace(K,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,se={};function ae(e){delete se[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,se[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}(),ce=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),ue=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.listData=null,t}return r(t,e),t}(ce),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}(ce),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}(ce),he=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.columns=[],t}return r(t,e),t}(ce),fe=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}(ce),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}(ce),ge=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}(ce),ve=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.htmlBlockType=-1,t}return r(t,e),t}(ce),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 ue(e,t);case"link":case"image":return new ye(e,t);case"codeBlock":return new de(e,t);case"htmlBlock":return new ve(e,t);case"table":return new he(e,t);case"tableCell":return new fe(e,t);case"document":case"paragraph":case"blockQuote":case"thematicBreak":case"tableRow":case"tableBody":case"tableHead":case"frontMatter":return new ce(e,t);case"code":return new be(e,t);case"refDef":return new me(e,t);case"customBlock":return new ge(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,s=e.length;if(!s)return"";for(var a="";++o<s;){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===s||i.length>16384)&&(a+=Oe.apply(void 0,i),i.length=0)}return a}}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 s=Math.min(-n,t[0].length);return e.substring(0,e.length-s)}}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,We=39,Ge=34,Je=36,Ke="\\\\"+G,Ze=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('^(?:"('+Ke+'|[^"\\x00])*"|\'('+Ke+"|[^'\\x00])*'|\\(("+Ke+"|[^()\\x00])*\\))"),Qe=/^(?:<(?:[^<>\n\\\x00]|\\.)*>)/,Ye=new RegExp("^"+G),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])?)*)>/,st=/^<[A-Za-z][A-Za-z0-9.+-]{1,31}:[^<>\x00-\x20]*>/i,at=/^ *(?:\n *)?/,lt=/^[ \t\n\x0b\x0c\x0d]/,ct=/^\s/,ut=/ *$/,pt=/^ */,dt=/^ *(?:\n|$)/,ht=/^\[(?:[^\\\[\]]|\\.){0,1000}\]/,ft=/^[^\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(at),!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),s=this.sourcepos(t,this.pos),a=o.split("\n");if(a.length>1){var l=je(a);this.lineIdx+=a.length-1,this.linePosOffset=-(this.pos-l.length-n.length),s[1]=this.sourcepos(this.pos),o=a.join(" ")}var c=ke("code",s);return o.length>0&&null!==o.match(/[^ ]/)&&" "==o[0]&&" "==o[o.length-1]?c.literal=o.slice(1,o.length-1):c.literal=o,c.tickCount=n.length,e.appendChild(c),!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(st))&&(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===We||e===Ge)t++,this.pos++;else for(;this.peek()===e;)t++,this.pos++;if(0===t||t<2&&(e===$e||e===Je))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 s,a,l=ct.test(r),c=Ze.test(r),u=ct.test(i),p=Ze.test(i),d=!l&&(!c||u||p),h=!u&&(!p||l||c);return 95===e?(s=d&&(!h||p),a=h&&(!d||c)):e===We||e===Ge?(s=d&&!h,a=h):e===Je?(s=!l,a=!u):(s=d,a=h),this.pos=n,{numdelims:t,canOpen:s,canClose:a}},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===We?"\u2019":e===Ge?"\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!==We&&e!==Ge)&&(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,s,a,l=!1,c=((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 u=r.cc,p=95===u||42===u;if(r.canClose){for(n=r.previous,a=!1;null!==n&&n!==e&&n!==c[u][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){a=!0;break}n=n.previous}if(i=r,p||u===$e||u===Je)if(a){if(n){var d=r.numdelims>=2&&n.numdelims>=2?2:1,h=p?0:1;o=n.node,s=r.node;var f=p?1===d?"emph":"strong":"strike";u===Je&&(f="customInline");var m=ke(f),g=o.sourcepos[1],v=s.sourcepos[0];m.sourcepos=[[g[0],g[1]-d+1],[v[0],v[1]+d-1]],o.sourcepos[1][1]-=d,s.sourcepos[0][1]+=d,o.literal=o.literal.slice(d),s.literal=s.literal.slice(d),n.numdelims-=d,r.numdelims-=d;for(var y=o.next,b=void 0;y&&y!==s;)b=y.next,y.unlink(),m.appendChild(y),y=b;if(u===Je){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<=h&&(0===n.numdelims&&o.unlink(),this.removeDelimiter(n)),r.numdelims<=h){0===r.numdelims&&s.unlink();var C=r.next;this.removeDelimiter(r),r=C}}}else r=r.next;else u===We?(r.node.literal="\u2019",a&&(n.node.literal="\u2018"),r=r.next):u===Ge&&(r.node.literal="\u201d",a&&(n.node.literal="\u201c"),r=r.next);a||(c[u][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(ht);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 s=o.image,a=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=a);var l="";if(!r){var c=this.pos,u=this.parseLinkLabel();if(u>2?l=this.subject.slice(c,c+u):o.bracketAfter||(l=this.subject.slice(o.index,i)),0===u&&(this.pos=a),l){l=Ve(l);var p=this.refMap[l];p&&(t=p.destination,n=p.title,r=!0)}}if(r){var d=ke(s?"image":"link");d.destination=t,d.title=n||"",d.sourcepos=[o.startpos,this.sourcepos(this.pos)];for(var h=o.node.next,f=void 0;h;)f=h.next,h.unlink(),d.appendChild(h),h=f;if(e.appendChild(d),this.processEmphasis(o.previousDelimiter),this.removeBracket(),o.node.unlink(),!s)for(o=this.brackets;null!==o;)o.image||(o.active=!1),o=o.previous;return this.options.referenceDefinition&&(this.refLinkCandidateMap[e.id]={node:e,refLabel: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(ft)){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(ut,"");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 s=this.parseLinkDestination();if(null===s)return this.pos=r,0;var a=this.pos;this.spnl(),this.pos!==a&&(n=this.parseLinkTitle()),null===n&&(n="",this.pos=a);var l=!0;if(null===this.match(dt)&&(""===n?l=!1:(n="",this.pos=a,l=null!==this.match(dt))),!l)return this.pos=r,0;var c=Ve(o);if(""===c)return this.pos=r,0;var u=this.getReferenceDefSourcepos(e);e.sourcepos[0][0]=u[1][0]+1;var p=ke("refDef",u);return p.title=n,p.dest=s,p.label=c,e.insertBefore(p),t[c]?this.refDefCandidateMap[p.id]=p:t[c]=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],s=n[n.length-1];o.sourcepos&&s.sourcepos&&(o.sourcepos[1]=s.sourcepos[1]),o.next=s.next,o.next&&(o.next.prev=o);for(var a=1;a<n.length;a+=1)o.literal+=n[a].literal,n[a].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 s=t[o];if(lt.test(s))break;if(/\:/.test(s)&&0===r){if(n)break;var a=s.indexOf(":")===s.length-1?o+1:o;i={line:a,ch:t[a].length},n=!0}var l=s.match(/'|"/g);if(l&&(r+=l.length),2===r){i={line:o,ch:s.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 Je:n=this.handleDelim(r,e);break;case We:case Ge: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 s=0,a=r.sourcepos[0],l=a[0],c=a[1],u=function(e,t){return[[l,c+e],[l,c+t]]},p=[],d=0,h=o;d<h.length;d++){var f=h[d],m=f.range,g=f.url,v=f.text;m[0]>s&&p.push(Me(i.substring(s,m[0]),u(s,m[0]-1)));var y=ke("link",u.apply(void 0,m));y.appendChild(Me(v,u.apply(void 0,m))),y.destination=g,y.extendedAutolink=!0,p.push(y),s=m[1]+1}s<i.length&&p.push(Me(i.substring(s),u(s,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 s=i.node,a=i.entering;r[s.type]&&r[s.type](s,{entering:a,options:this.options})}},e}(),gt=/^\[([ \txX])\][ \t]+/,vt=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===vt}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),s=i.match(/^(\s*)(.*)/);t.info=X(s[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(gt);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),s=r.slice(i+1),a=o.match(/^(\s*)(.*)/);t.infoPadding=a[1].length,t.info=X(a[2].trim()),t.literal=s}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,s=t;o<s.length;o++){var a=s[o],l=a.match(/^[ \t]+/),c=l?l[0].length:0,u=void 0,p=void 0;if(c===a.length)c=0,u=0,p="";else{var d=a.match(/[ \t]+$/);u=d?d[0].length:0,p=a.slice(c,a.length-u)}var h=r+c,f=ke(e,[[n,r],[n,r+a.length-1]]);f.stringContent=p.replace(/\\\|/g,"|"),f.startIdx=i.length,f.endIdx=i.length,f.lineOffsets=[h-1],f.paddingLeft=c,f.paddingRight=u,i.push(f),r+=a.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|[/]?[>]|$)/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 Wt=[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!==vt&&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 s=e.column,a=e.offset;do{e.advanceOffset(1,!0),r=xt(e.currentLine,e.offset)}while(e.column-s<5&&Tt(r));var l=-1===xt(e.currentLine,e.offset),c=e.column-s;return c>=5||c<1||l?(o.padding=n[0].length+1,e.column=s,e.offset=a,Tt(xt(e.currentLine,e.offset))&&e.advanceOffset(1,!0)):o.padding=n[0].length+c,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),s=e.currentLine.slice(e.nextNonspace),a=It(o),l=a[0],c=a[1],u=It(s),p=u[0],d=u[1],h=/^[ \t]*:?-+:?[ \t]*$/;if(!c.length||!d.length||d.some((function(e){return!h.test(e)}))||1===d.length&&0!==s.indexOf("|"))return 0;var f=t.lineOffsets,m=e.lineNumber-1,g=je(f)+1,v=ke("table",[[m,g],[e.lineNumber,e.offset]]);if(v.columns=d.map((function(){return{align:null}})),t.insertAfter(v),1===f.length)t.unlink();else{t.stringContent=n.slice(0,i);var y=i-(n.lastIndexOf("\n",i-2)+1)-1;e.lastLineLength=f[f.length-2]+y,e.finalize(t,m-1)}e.advanceOffset(e.currentLine.length-e.offset,!1);var b=ke("tableHead",[[m,g],[e.lineNumber,e.offset]]);v.appendChild(b);var w=ke("tableRow",[[m,g],[m,g+o.length-1]]),k=ke("tableDelimRow",[[e.lineNumber,e.nextNonspace+1],[e.lineNumber,e.offset]]);b.appendChild(w),b.appendChild(k),Rt("tableCell",c,m,g+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)})),v.columns=x.map(Pt),e.tip=v,2}return 0},function(e,t){if("table"!==t.type&&"tableBody"!==t.type||!e.blank&&-1===e.currentLine.indexOf("|"))return 0;if(e.advanceOffset(e.currentLine.length-e.offset,!1),e.blank){var n=t;return"tableBody"===t.type&&(n=t.parent,e.finalize(t,e.lineNumber-1)),e.finalize(n,e.lineNumber-1),0}var r=t;"table"===t.type&&((r=e.addChild("tableBody",e.nextNonspace)).stringContent=null);var i=ke("tableRow",[[e.lineNumber,e.nextNonspace+1],[e.lineNumber,e.currentLine.length]]);r.appendChild(i);var o=r.parent,s=It(e.currentLine.slice(e.nextNonspace)),a=s[0];return Rt("tableCell",s[1],e.lineNumber,e.nextNonspace+1+a).forEach((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}],Gt=/^(-{3}|\+{3}|;{3})$/,Jt=function(e,t){var n=e.currentLine,r=e.lineNumber,i=e.indented;return 1===r&&!i&&"document"===t.type&&Gt.test(n)?(e.closeUnmatchedBlocks(),e.addChild("frontMatter",e.nextNonspace).stringContent=n,e.advanceNextNonspace(),e.advanceOffset(n.length,!1),2):0},Kt={continue:function(e,t){var n=e.currentLine,r=n.match(Gt);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},Zt=[/./,/<\/(?: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=Kt,Wt.unshift(Jt)),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,s=i.type;n&&n[s]&&n[s](i,{entering:o,options:this.options}),o||"paragraph"!==s&&"heading"!==s&&("tableCell"!==s||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=Wt.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 s=0;s<o;){var a=Wt[s](this,t);if(1===a){t=this.tip;break}if(2===a){t=this.tip,i=!0;break}s++}if(s===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,c=this.blank&&!("blockQuote"===l||xe(t)&&t.isFenced||"item"===l&&!t.firstChild&&t.sourcepos[0][0]===this.lineNumber),u=t;u;)u.lastLineBlank=c,u=u.parent;Ot[l].acceptsLines?(this.addLine(),"htmlBlock"===t.type&&t.htmlBlockType>=1&&t.htmlBlockType<=5&&Zt[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])},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 sn(e,t){var n=e[0];return e[1][0]<t?1:n[0]>t?-1:0}function an(e,t){for(var n=e.firstChild;n;){var r=sn(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 se[e]}(e)||null}function cn(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 un=/\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(un),this.root=this.parser.parse(e,this.lineTexts)}return e.prototype.updateLineTexts=function(e,t,n){var r,i=e[0],s=e[1],a=t[0],l=t[1],c=n.split(un),u=c.length,p=this.lineTexts[i-1],d=this.lineTexts[a-1];c[0]=p.slice(0,s-1)+c[0],c[u-1]=c[u-1]+d.slice(l-1);var h=a-i+1;return(r=this.lineTexts).splice.apply(r,o([i-1,h],c)),u-h},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 s=o[i];n[s]&&(ae(n[s].id),n[s]=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 ae(e)})),e.unlink()):t?(on(t,n),ae(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=an(this.root,e[0]),r=an(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),s=this.parser.partialParseStart(n,o),a=t?t.next:this.root.firstChild,l=s.lastChild,c=l&&xe(l)&&l.open,u=l&&Ee(l)&&l.open,p=l&&Ce(l);(c||u)&&a||p&&a&&("list"===a.type||a.sourcepos[0][1]>=2);){var d=this.extendEndLine(a.sourcepos[1][0]);this.parser.partialParseExtends(this.lineTexts.slice(r,d)),e||(e=t),t=a,r=d,a=a.next}return this.parser.partialParseFinish(),{newNodes:function(e){for(var t=[],n=e.firstChild;n;)t.push(n),n=n.next;return t}(s),extStartNode:e,extEndNode:t}},e.prototype.getRemovedNodeRange=function(e,t){return!e||e&&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&&cn(r,e.parent,t),t&&cn(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){cn(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=an(this.root,e-1),s=an(this.root,t+1);o&&Te(o)&&o!==n&&o!==r&&(e=(n=o).sourcepos[0][0]),s&&Te(s)&&s!==n&&s!==r&&(r=s,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],s=i?Math.min(i.sourcepos[0][0],e[0]):e[0],a=this.extendEndLine((o?Math.max(o.sourcepos[1][0],t[0]):t[0])+n),l=this.parseRange.apply(this,this.getRangeWithRefDef(s,a,i,o,n)),c=l.newNodes,u=l.extStartNode,p=l.extEndNode,d=this.getRemovedNodeRange(u,p),h=p?p.next:this.root.firstChild;return this.referenceDefinition?(this.markDeletedRefMap(u,p),this.replaceRangeNodes(u,p,c),this.replaceWithNewRefDefState(c)):this.replaceRangeNodes(u,p,c),{nodes:c,removedNodeRange:d,nextNode:h}},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].forEach((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),s=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 a=[s];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=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=sn(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(){se={}},e}(),hn=new RegExp("<(/?(?:"+["title","textarea","style","xmp","iframe","noembed","noframes","script","plaintext"].join("|")+")[^>]*>)","ig");function fn(e){return hn.test(e)?e.replace(hn,(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,s="bullet"===i?"ul":"ol",a={};return"ol"===s&&null!==o&&1!==o&&(a.start=o.toString()),{type:n?"openTag":"closeTag",tagName:s,attributes:a,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?fn(e.literal):e.literal}},htmlBlock:function(e,t){var n=t.options,r=n.tagFilter?fn(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,s=o.title,a=o.destination;return r(),{type:"openTag",tagName:"img",selfClose:!0,attributes:i({src:ee(a),alt:n(e)},s&&{title:ee(s)})}},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,s=i.trim().toLowerCase(),a=n[s],l=t.entering;if(a)try{return a(e,t)}catch(c){console.warn("[@toast-ui/editor] - The error occurred when "+s+" inline node was parsed in markdown renderer: "+c)}return l?[{type:"openTag",tagName:"span"},{type:"text",content:"$$"+i+(o?" ":"")}]:[{type:"text",content:"$$"},{type:"closeTag",tagName:"span"}]}},gn={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,s=r.task;if(n){var a={type:"openTag",tagName:"li",outerNewLine:!0};return s?[a,{type:"openTag",tagName:"input",selfClose:!0,attributes:i(i({},o&&{checked:""}),{disabled:"",type:"checkbox"})},{type:"text",content:" "}]:a}return{type:"closeTag",tagName:"li",outerNewLine:!0}},table:function(e,t){return{type:t.entering?"openTag":"closeTag",tagName:"table",outerNewLine:!0}},tableHead:function(e,t){return{type:t.entering?"openTag":"closeTag",tagName:"thead",outerNewLine:!0}},tableBody:function(e,t){return{type:t.entering?"openTag":"closeTag",tagName:"tbody",outerNewLine:!0}},tableRow:function(e,t){if(t.entering)return{type:"openTag",tagName:"tr",outerNewLine:!0};var n=[];if(e.lastChild)for(var r=e.parent.parent.columns.length,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",s=r.parent.columns[e.startIdx],a=(null===s||void 0===s?void 0:s.align)?{align:s.align}:null;return n?i({type:"openTag",tagName:o,outerNewLine:!0},a&&{attributes:a}):{type:"closeTag",tagName:o,outerNewLine:!0}}},vn={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({},vn),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),gn)),this.options.convertors){var t=this.options.convertors,n=Object.keys(t),r=i(i({},mn),gn);n.forEach((function(n){var i=e[n],o=t[n],s=-1===Object.keys(r).indexOf(n)?n.toLowerCase():n;e[s]=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,s=o.convertors[e.type];if(!s)return"continue";var a=!1,l={entering:i,leaf:!ie(e),options:o.options,getChildrenText:yn,skipChildren:function(){a=!0}},c=Ee(e)||function(e){return"customInline"===e.type}(e)?s(e,l,o.convertors):s(e,l);c&&((Array.isArray(c)?c:[c]).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)})),a&&(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).forEach((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=a(956),kn=a.n(wn),xn=a(969),Cn=a.n(xn),Tn=a(348),En=a.n(Tn),Mn=a(349),Nn=a.n(Mn),Sn=a(204),Dn=a.n(Sn),Ln=a(462),An=a.n(Ln),On=a(522),In=a.n(On),Rn=a(990),Pn=a.n(Rn),Bn=a(322),Fn=a.n(Bn),Hn=a(758),qn=a.n(Hn),zn=a(929),jn=a.n(zn),Vn=a(714),_n=a.n(Vn),Un=(a(471),"[A-Za-z][A-Za-z0-9-]*"),$n="(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^\"'=<>`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)",Wn=new RegExp("^(?:<("+Un+")("+$n+")*\\s*/?>|</("+Un+")\\s*[>])","i");function Gn(e,t){return-1!==e.indexOf(t)}a(934),a(391),/Mac/.test(navigator.platform),new RegExp('[&<>"]',"g");var Jn=["rel","target","hreflang","type"];function Kn(e){return"object"===typeof e&&null!==e}function Zn(t,n){var r=e({},t);return t&&n&&Object.keys(n).forEach((function(e){Kn(r[e])?Array.isArray(n[e])?r[e]=Xn(n[e]):r.hasOwnProperty(e)?r[e]=Zn(r[e],n[e]):r[e]=Qn(n[e]):r[e]=n[e]})),r}function Xn(e){return e.map((function(e){return Kn(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 Kn(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],s=void 0;(s=Array.isArray(o)?o[0]?o[1]:null:o)&&n.push(""+tr+s)}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=a(294),sr=a.n(or);function ar(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={},cr=/\$\$widget\d+\s/;function ur(e){var t=e.search(cr);if(-1!==t){var n=e.substring(t).replace(cr,"").replace("$$","");e=e.substring(0,t),e+=ur(n)}return e}var pr=a(368),dr=a.n(pr),hr=["iframe","embed"],fr=[];function mr(t,n){return dr().sanitize(t,e({ADD_TAGS:fr,ADD_ATTR:["rel","target","hreflang","type"],FORBID_TAGS:["input","script","textarea","form","button","select","meta","style","link","title","object","base"]},n))}var gr=/^\s*<\s*\//,vr={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=[],s={};if(n>3&&(s["data-backticks"]=n),i.length>0&&i[0].length>0){var a=i[0];o.push("lang-"+a),s["data-language"]=a}return[{type:"openTag",tagName:"pre",classNames:o},{type:"openTag",tagName:"code",attributes:s},{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 s=function(e){for(var t,n="",r=e.walker();t=r.next();){var i=t.node;t.entering&&(i!==e&&"text"!==i.type?(n+=ar(i),r.resumeAt(e,!1),r.next()):"text"===i.type&&(n+=i.literal))}return n}(e),a=function(e,t){var n=lr[e],r=n.rule,i=n.toDOM,o=ur(t).match(r);return o&&(t=o[0]),i(t)}(o,s).outerHTML;return[{type:"openTag",tagName:"span",classNames:["tui-widget"]},{type:"html",content:a},{type:"closeTag",tagName:"span"}]}return n()}};function yr(t,n){var r=e({},vr);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}),n&&Object.keys(n).forEach((function(t){var i=r[t],o=n[t];i&&sr()(o)?r[t]=function(t,n){var r=e({},n);return r.origin=function(){return i(t,n)},o(t,r)}:Gn(["htmlBlock","htmlInline"],t)&&!sr()(o)?r[t]=function(t,n){var r=t.literal.match(Wn);if(r){var i=r[0],s=r[1],a=r[3],l=(s||a).toLowerCase(),c=o[l],u=function(e,t){return e.literal.replace(new RegExp("(<\\s*"+t+"[^>]*>)|(</"+t+"\\s*[>])","ig"),"").trim()}(t,l);if(c){var p=e({},t);return p.attrs=function(e){var t=(e=e.match(Wn)[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=u,p.type=l,n.entering=!gr.test(t.literal),c(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&&(Gn(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,s=t.highlight,a=void 0!==s&&s;this.renderer=new bn({gfm:!0,nodeId:!0,convertors:yr(r,i)}),this.cursorNodeId=null,this.sanitizer=o,this.initEvent(a),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 s=r.id,a=s[0],l=s[1],c=this.getElementByNodeId(a),u=this.getElementByNodeId(l);if(c){c.insertAdjacentHTML("beforebegin",o);for(var p=c;p&&p!==u;){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=a(814),Sr=a(479),Dr=a(311),Lr=a(481),Ar=a(43),Or=a(928),Ir=a.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)>-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,s=Hr.get(r);if((null===s||void 0===s?void 0:s.tableStartPos)===o+1)return s;var a=[],l=t.start(i),c=r.child(0),u=r.child(1),p=zr(c,l),d=zr(u,l+c.nodeSize);c.forEach((function(e){return a.push(e)})),u.forEach((function(e){return a.push(e)}));var h=new e(r,a,l,p.concat(d));return Hr.set(r,h),h}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),s=o[0],a=o[1],l=this.getCellIndex(t),c=l[0],u=l[1];return s=(r=er(s,c))[0],c=r[1],a=(i=er(a,u))[0],u=i[1],this.getSpannedOffsets({startRowIdx:s,startColIdx:a,endRowIdx:c,endColIdx:u})},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,s=0;i[s];)s+=1;i[s]={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 s=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(!s)throw new Error("The return value of the executed plugin is empty.");var a=s.markdownParsers,l=s.toHTMLRenderers,c=s.toMarkdownRenderers,u=s.markdownPlugins,p=s.wysiwygPlugins,d=s.wysiwygNodeViews,h=s.markdownCommands,f=s.wysiwygCommands,m=s.toolbarItems;return l&&(t.toHTMLRenderers=Zn(t.toHTMLRenderers,l)),c&&(t.toMarkdownRenderers=Zn(t.toMarkdownRenderers,c)),u&&(t.mdPlugins=t.mdPlugins.concat(u)),p&&(t.wwPlugins=t.wwPlugins.concat(p)),d&&(t.wwNodeViews=e(e({},t.wwNodeViews),d)),h&&(t.mdCommands=e(e({},t.mdCommands),h)),f&&(t.wwCommands=e(e({},t.wwCommands),f)),m&&(t.toolbarItems=t.toolbarItems.concat(m)),a&&(t.markdownParsers=e(e({},t.markdownParsers),a)),t}),{toHTMLRenderers:{},toMarkdownRenderers:{},mdPlugins:[],wwPlugins:[],wwNodeViews:{},mdCommands:{},wwCommands:{},toolbarItems:[],markdownParsers:{}})}var _r=a(404),Ur=a.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"],Wr=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}(),Gr=Wr;function Jr(e){["htmlBlock","htmlInline"].forEach((function(t){e[t]&&Object.keys(e[t]).forEach((function(e){var t;Gn(hr,t=e)&&fr.push(t.toLowerCase())}))}))}var Kr=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 Gr;var r=function(e){if(!e)return null;var t={};return Jn.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,s=i.markdownParsers,a=this.options,l=a.customHTMLRenderer,c=a.extendedAutolinks,u=a.referenceDefinition,p=a.frontMatter,d=a.customHTMLSanitizer,h={linkAttributes:r,customHTMLRenderer:e(e({},o),l),extendedAutolinks:c,referenceDefinition:u,frontMatter:p,sanitizer:d||mr};Jr(h.customHTMLRenderer),this.options.events&&kn()(this.options.events,(function(e,t){n.on(t,e)}));var f=this.options,m=f.el,g=f.initialValue,v=f.theme,y=m.innerHTML;"light"!==v&&m.classList.add(nr(v)),m.innerHTML="",this.toastMark=new dn("",{disallowedHtmlBlockTags:["br","img"],extendedAutolinks:c,referenceDefinition:u,disallowDeepHeading:!0,frontMatter:p,customParser:s}),this.preview=new Mr(this.eventEmitter,e(e({},h),{isViewer:!0})),En()(this.preview.previewContent,"mousedown",this.toggleTask.bind(this)),g?this.setMarkdown(g):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),s=parseInt(e.height,10)+parseInt(e.paddingTop,10)+parseInt(e.paddingBottom,10);return t>=r&&t<=r+o&&n>=i&&n<=i+s}(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}(),Zr=Kr}(),l=l.default}()},e.exports=r(n(59140),n(64162),n(49484),n(48122),n(86087))},59140:(e,t,n)=>{"use strict";e.exports=n.p+"static/media/index.1e3d64b0fcde879f0060.cjs"},64162:(e,t,n)=>{"use strict";e.exports=n.p+"static/media/index.b599194a631d76b49328.cjs"},86087:(e,t,n)=>{"use strict";e.exports=n.p+"static/media/index.9659d9c420d8750cbee8.cjs"},49484:(e,t,n)=>{"use strict";e.exports=n.p+"static/media/index.85823dd8655ed4119d0c.cjs"},48122:(e,t,n)=>{"use strict";e.exports=n.p+"static/media/index.294a0edb7af7d19b781b.cjs"},45733:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>zb});var r=n(67487),i=n(66845);function o(e){this.content=e}o.prototype={constructor:o,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),s=r.content.slice();return-1==i?s.push(n||e,t):(s[i+1]=t,n&&(s[i]=n)),new o(s)},remove:function(e){var t=this.find(e);if(-1==t)return this;var n=this.content.slice();return n.splice(t,2),new o(n)},addToStart:function(e,t){return new o([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new o(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),s=r.find(e);return i.splice(-1==s?i.length:s,0,t,n),new o(i)},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=o.from(e)).size?new o(e.content.concat(this.subtract(e).content)):this},append:function(e){return(e=o.from(e)).size?new o(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=o.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}},o.from=function(e){if(e instanceof o)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new o(t)};const s=o;function a(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let 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(let e=0;i.text[e]==o.text[e];e++)n++;return n}if(i.content.size||o.content.size){let e=a(i.content,o.content,n+1);if(null!=e)return e}n+=i.nodeSize}else n+=i.nodeSize}}function l(e,t,n,r){for(let i=e.childCount,o=t.childCount;;){if(0==i||0==o)return i==o?null:{a:n,b:r};let s=e.child(--i),a=t.child(--o),c=s.nodeSize;if(s!=a){if(!s.sameMarkup(a))return{a:n,b:r};if(s.isText&&s.text!=a.text){let e=0,t=Math.min(s.text.length,a.text.length);for(;e<t&&s.text[s.text.length-e-1]==a.text[a.text.length-e-1];)e++,n--,r--;return{a:n,b:r}}if(s.content.size||a.content.size){let e=l(s.content,a.content,n-1,r-1);if(e)return e}n-=c,r-=c}else n-=c,r-=c}}class c{constructor(e,t){if(this.content=e,this.size=t||0,null==t)for(let n=0;n<e.length;n++)this.size+=e[n].nodeSize}nodesBetween(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4?arguments[4]:void 0;for(let o=0,s=0;s<t;o++){let a=this.content[o],l=s+a.nodeSize;if(l>e&&!1!==n(a,r+s,i||null,o)&&a.content.size){let i=s+1;a.nodesBetween(Math.max(0,e-i),Math.min(a.content.size,t-i),n,r+i)}s=l}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i="",o=!0;return this.nodesBetween(e,t,((s,a)=>{s.isText?(i+=s.text.slice(Math.max(e,a)-a,t-a),o=!n):s.isLeaf?(r?i+="function"===typeof r?r(s):r:s.type.spec.leafText&&(i+=s.type.spec.leafText(s)),o=!n):!o&&s.isBlock&&(i+=n,o=!0)}),0),i}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,n=e.firstChild,r=this.content.slice(),i=0;for(t.isText&&t.sameMarkup(n)&&(r[r.length-1]=t.withText(t.text+n.text),i=1);i<e.content.length;i++)r.push(e.content[i]);return new c(r,this.size+e.size)}cut(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.size;if(0==e&&t==this.size)return this;let n=[],r=0;if(t>e)for(let i=0,o=0;o<t;i++){let s=this.content[i],a=o+s.nodeSize;a>e&&((o<e||a>t)&&(s=s.isText?s.cut(Math.max(0,e-o),Math.min(s.text.length,t-o)):s.cut(Math.max(0,e-o-1),Math.min(s.content.size,t-o-1))),n.push(s),r+=s.nodeSize),o=a}return new c(n,r)}cutByIndex(e,t){return e==t?c.empty:0==e&&t==this.content.length?this:new c(this.content.slice(e,t))}replaceChild(e,t){let n=this.content[e];if(n==t)return this;let r=this.content.slice(),i=this.size+t.nodeSize-n.nodeSize;return r[e]=t,new c(r,i)}addToStart(e){return new c([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new c(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e){return a(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0)}findDiffEnd(e){return l(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.size,arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.size)}findIndex(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;if(0==e)return p(0,e);if(e==this.size)return p(this.content.length,e);if(e>this.size||e<0)throw new RangeError("Position ".concat(e," outside of fragment (").concat(this,")"));for(let n=0,r=0;;n++){let i=r+this.child(n).nodeSize;if(i>=e)return i==e||t>0?p(n+1,i):p(n,r);r=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map((e=>e.toJSON())):null}static fromJSON(e,t){if(!t)return c.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new c(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return c.empty;let t,n=0;for(let r=0;r<e.length;r++){let i=e[r];n+=i.nodeSize,r&&i.isText&&e[r-1].sameMarkup(i)?(t||(t=e.slice(0,r)),t[t.length-1]=i.withText(t[t.length-1].text+i.text)):t&&t.push(i)}return new c(t||e,n)}static from(e){if(!e)return c.empty;if(e instanceof c)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new c([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}c.empty=new c([],0);const u={index:0,offset:0};function p(e,t){return u.index=e,u.offset=t,u}function d(e,t){if(e===t)return!0;if(!e||"object"!=typeof e||!t||"object"!=typeof t)return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!d(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!d(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}class h{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let 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}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&d(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let 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)}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&0==e.length)return h.none;if(e instanceof h)return[e];let t=e.slice();return t.sort(((e,t)=>e.type.rank-t.type.rank)),t}}h.none=[];class f extends Error{}class m{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let n=v(this.content,e+this.openStart,t);return n&&new m(n,this.openStart,this.openEnd)}removeBetween(e,t){return new m(g(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return m.empty;let n=t.openStart||0,r=t.openEnd||0;if("number"!=typeof n||"number"!=typeof r)throw new RangeError("Invalid input for Slice.fromJSON");return new m(c.fromJSON(e,t.content),n,r)}static maxOpen(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=0,r=0;for(let i=e.firstChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.firstChild)n++;for(let i=e.lastChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.lastChild)r++;return new m(e,n,r)}}function g(e,t,n){let{index:r,offset:i}=e.findIndex(t),o=e.maybeChild(r),{index:s,offset:a}=e.findIndex(n);if(i==t||o.isText){if(a!=n&&!e.child(s).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return e.replaceChild(r,o.copy(g(o.content,t-i-1,n-i-1)))}function v(e,t,n,r){let{index:i,offset:o}=e.findIndex(t),s=e.maybeChild(i);if(o==t||s.isText)return r&&!r.canReplace(i,i,n)?null:e.cut(0,t).append(n).append(e.cut(t));let a=v(s.content,t-o-1,n);return a&&e.replaceChild(i,s.copy(a))}function y(e,t,n){if(n.openStart>e.depth)throw new f("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new f("Inconsistent open depths");return b(e,t,n,0)}function b(e,t,n,r){let i=e.index(r),o=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let s=b(e,t,n,r+1);return o.copy(o.content.replaceChild(i,s))}if(n.content.size){if(n.openStart||n.openEnd||e.depth!=r||t.depth!=r){let{start:i,end:s}=function(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let i=n-1;i>=0;i--)r=t.node(i).copy(c.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}(n,e);return T(o,E(e,i,s,t,r))}{let r=e.parent,i=r.content;return T(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}}return T(o,M(e,t,r))}function w(e,t){if(!t.type.compatibleContent(e.type))throw new f("Cannot join "+t.type.name+" onto "+e.type.name)}function k(e,t,n){let r=e.node(n);return w(r,t.node(n)),r}function x(e,t){let 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 C(e,t,n,r){let i=(t||e).node(n),o=0,s=t?t.index(n):i.childCount;e&&(o=e.index(n),e.depth>n?o++:e.textOffset&&(x(e.nodeAfter,r),o++));for(let a=o;a<s;a++)x(i.child(a),r);t&&t.depth==n&&t.textOffset&&x(t.nodeBefore,r)}function T(e,t){if(!e.type.validContent(t))throw new f("Invalid content for node "+e.type.name);return e.copy(t)}function E(e,t,n,r,i){let o=e.depth>i&&k(e,t,i+1),s=r.depth>i&&k(n,r,i+1),a=[];return C(null,e,i,a),o&&s&&t.index(i)==n.index(i)?(w(o,s),x(T(o,E(e,t,n,r,i+1)),a)):(o&&x(T(o,M(e,t,i+1)),a),C(t,n,i,a),s&&x(T(s,M(n,r,i+1)),a)),C(r,null,i,a),new c(a)}function M(e,t,n){let r=[];if(C(null,e,n,r),e.depth>n){x(T(k(e,t,n+1),M(e,t,n+1)),r)}return C(t,null,n,r),new c(r)}m.empty=new m(c.empty,0,0);class N{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return null==e?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[3*this.resolveDepth(e)]}index(e){return this.path[3*this.resolveDepth(e)+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e!=this.depth||this.textOffset?1:0)}start(e){return 0==(e=this.resolveDepth(e))?0:this.path[3*e-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(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]}after(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}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let 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)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[3*t],r=0==t?0:this.path[3*t-1]+1;for(let i=0;i<e;i++)r+=n.child(i).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(0==e.content.size)return h.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let i=n.marks;for(var o=0;o<i.length;o++)!1!==i[o].type.spec.inclusive||r&&i[o].isInSet(r.marks)||(i=i[o--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var 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}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(){let 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(let 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 A(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let n=[],r=0,i=t;for(let o=e;;){let{index:e,offset:t}=o.content.findIndex(i),s=i-t;if(n.push(o,e,r+t),!s)break;if(o=o.child(e),o.isText)break;i=s-1,r+=t+1}return new N(t,n,i)}static resolveCached(e,t){for(let r=0;r<S.length;r++){let n=S[r];if(n.pos==t&&n.doc==e)return n}let n=S[D]=N.resolve(e,t);return D=(D+1)%L,n}}let S=[],D=0,L=12;class A{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const O=Object.create(null);class I{constructor(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:h.none;this.type=e,this.attrs=t,this.marks=r,this.content=n||c.empty}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;this.content.nodesBetween(e,t,n,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,n,r){return this.content.textBetween(e,t,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&d(this.attrs,t||e.defaultAttrs||O)&&h.sameSet(this.marks,n||h.none)}copy(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return e==this.content?this:new I(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new I(this.type,this.attrs,this.content,e)}cut(e){let 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))}slice(e){let 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 m.empty;let r=this.resolve(e),i=this.resolve(t),o=n?0:r.sharedDepth(t),s=r.start(o),a=r.node(o).content.cut(r.pos-s,i.pos-s);return new m(a,r.depth-o,i.depth-o)}replace(e,t,n){return y(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(0==e)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return N.resolveCached(this,e)}resolveNoCache(e){return N.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,(e=>(n.isInSet(e.marks)&&(r=!0),!r))),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),P(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:c.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),s=o&&o.matchFragment(this.content,t);if(!s||!s.validEnd)return!1;for(let a=r;a<i;a++)if(!this.type.allowsMarks(n.child(a).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),o=i&&i.matchFragment(this.content,t);return!!o&&o.validEnd}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){if(!this.type.validContent(this.content))throw new RangeError("Invalid content for node ".concat(this.type.name,": ").concat(this.content.toString().slice(0,50)));let e=h.none;for(let t=0;t<this.marks.length;t++)e=this.marks[t].addToSet(e);if(!h.sameSet(e,this.marks))throw new RangeError("Invalid collection of marks for node ".concat(this.type.name,": ").concat(this.marks.map((e=>e.type.name))));this.content.forEach((e=>e.check()))}toJSON(){let e={type:this.type.name};for(let 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((e=>e.toJSON()))),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let 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)}let r=c.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,r,n)}}I.prototype.text=void 0;class R extends I{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):P(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new R(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new R(this.type,this.attrs,e,this.marks)}cut(){let 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))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function P(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class B{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let n=new F(e,t);if(null==n.next)return B.empty;let r=H(n);n.next&&n.err("Unexpected trailing text");let i=function(e){let t=Object.create(null);return n(U(e,0));function n(r){let i=[];r.forEach((t=>{e[t].forEach((t=>{let n,{term:r,to:o}=t;if(r){for(let e=0;e<i.length;e++)i[e][0]==r&&(n=i[e][1]);U(e,o).forEach((e=>{n||i.push([r,n=[]]),-1==n.indexOf(e)&&n.push(e)}))}}))}));let o=t[r.join(",")]=new B(r.indexOf(e.length-1)>-1);for(let e=0;e<i.length;e++){let r=i[e][1].sort(_);o.next.push({type:i[e][0],next:t[r.join(",")]||n(r)})}return o}}(function(e){let t=[[]];return i(o(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let i={term:r,to:n};return t[e].push(i),i}function i(e,t){e.forEach((e=>e.to=t))}function o(e,t){if("choice"==e.type)return e.exprs.reduce(((e,n)=>e.concat(o(n,t))),[]);if("seq"!=e.type){if("star"==e.type){let s=n();return r(t,s),i(o(e.expr,s),s),[r(s)]}if("plus"==e.type){let 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){let s=t;for(let t=0;t<e.min;t++){let t=n();i(o(e.expr,s),t),s=t}if(-1==e.max)i(o(e.expr,s),s);else for(let t=e.min;t<e.max;t++){let t=n();r(s,t),i(o(e.expr,s),t),s=t}return[r(s)]}if("name"==e.type)return[r(t,void 0,e.value)];throw new Error("Unknown expr type")}for(let r=0;;r++){let s=o(e.exprs[r],t);if(r==e.exprs.length-1)return s;i(s,t=n())}}}(r));return function(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],i=!e.validEnd,o=[];for(let t=0;t<e.next.length;t++){let{type:n,next:s}=e.next[t];o.push(n.name),!i||n.isText||n.hasRequiredAttrs()||(i=!1),-1==r.indexOf(s)&&r.push(s)}i&&t.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(i,n),i}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e){let 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;for(let i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}get inlineContent(){return this.next.length&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!t.isText&&!t.hasRequiredAttrs())return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e){let 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,s){let a=o.matchFragment(e,n);if(a&&(!t||a.validEnd))return c.from(s.map((e=>e.createAndFill())));for(let e=0;e<o.next.length;e++){let{type:t,next:n}=o.next[e];if(!t.isText&&!t.hasRequiredAttrs()&&-1==r.indexOf(n)){r.push(n);let e=i(n,s.concat(t));if(e)return e}}return null}(this,[])}findWrapping(e){for(let n=0;n<this.wrapCache.length;n+=2)if(this.wrapCache[n]==e)return this.wrapCache[n+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<i.next.length;e++){let{type:o,next:s}=i.next[e];o.isLeaf||o.hasRequiredAttrs()||o.name in t||r.type&&!s.validEnd||(n.push({match:o.contentMatch,type:o,via:r}),t[o.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError("There's no ".concat(e,"th edge in this content match"));return this.next[e]}toString(){let e=[];return function t(n){e.push(n);for(let r=0;r<n.next.length;r++)-1==e.indexOf(n.next[r].next)&&t(n.next[r].next)}(this),e.map(((t,n)=>{let r=n+(t.validEnd?"*":" ")+" ";for(let i=0;i<t.next.length;i++)r+=(i?", ":"")+t.next[i].type.name+"->"+e.indexOf(t.next[i].next);return r})).join("\n")}}B.empty=new B(!0);class F{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function H(e){let t=[];do{t.push(q(e))}while(e.eat("|"));return 1==t.length?t[0]:{type:"choice",exprs:t}}function q(e){let t=[];do{t.push(z(e))}while(e.next&&")"!=e.next&&"|"!=e.next);return 1==t.length?t[0]:{type:"seq",exprs:t}}function z(e){let t=function(e){if(e.eat("(")){let t=H(e);return e.eat(")")||e.err("Missing closing paren"),t}if(!/\W/.test(e.next)){let t=function(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let o in n){let e=n[o];e.groups.indexOf(t)>-1&&i.push(e)}0==i.length&&e.err("No node type or group '"+t+"' found");return i}(e,e.next).map((t=>(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==t.length?t[0]:{type:"choice",exprs:t}}e.err("Unexpected token '"+e.next+"'")}(e);for(;;)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=V(e,t)}return t}function j(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function V(e,t){let n=j(e),r=n;return e.eat(",")&&(r="}"!=e.next?j(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function _(e,t){return t-e}function U(e,t){let n=[];return function t(r){let i=e[r];if(1==i.length&&!i[0].term)return t(i[0].to);n.push(r);for(let e=0;e<i.length;e++){let{term:r,to:o}=i[e];r||-1!=n.indexOf(o)||t(o)}}(t),n.sort(_)}function $(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function W(e,t){let n=Object.create(null);for(let r in e){let i=t&&t[r];if(void 0===i){let t=e[r];if(!t.hasDefault)throw new RangeError("No value supplied for attribute "+r);i=t.default}n[r]=i}return n}function G(e){let t=Object.create(null);if(e)for(let n in e)t[n]=new K(e[n]);return t}class J{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=G(n.attrs),this.defaultAttrs=$(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||"text"==e),this.isText="text"==e}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==B.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:W(this.attrs,e)}create(){let 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 I(this,this.computeAttrs(e),c.from(t),h.setFrom(n))}createChecked(){let 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=c.from(t),!this.validContent(t))throw new RangeError("Invalid content for node "+this.name);return new I(this,this.computeAttrs(e),t,h.setFrom(n))}createAndFill(){let 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=c.from(t),t.size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let r=this.contentMatch.matchFragment(t),i=r&&r.fillBefore(c.empty,!0);return i?new I(this,e,t.append(i),h.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let n=0;n<e.childCount;n++)if(!this.allowsMarks(e.child(n).marks))return!1;return!0}allowsMarkType(e){return null==this.markSet||this.markSet.indexOf(e)>-1}allowsMarks(e){if(null==this.markSet)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(null==this.markSet)return e;let t;for(let 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:h.none:e}static compile(e,t){let n=Object.create(null);e.forEach(((e,r)=>n[e]=new J(e,t,r)));let r=t.spec.topNode||"doc";if(!n[r])throw new RangeError("Schema is missing its top node type ('"+r+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(let i in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n}}class K{constructor(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default}get isRequired(){return!this.hasDefault}}class Z{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=G(r.attrs),this.excluded=null;let i=$(this.attrs);this.instance=i?new h(this,i):null}create(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return!e&&this.instance?this.instance:new h(this,W(this.attrs,e))}static compile(e,t){let n=Object.create(null),r=0;return e.forEach(((e,i)=>n[e]=new Z(e,r++,t,i))),n}removeFromSet(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}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}excludes(e){return this.excluded.indexOf(e)>-1}}class X{constructor(e){this.cached=Object.create(null),this.spec={nodes:s.from(e.nodes),marks:s.from(e.marks||{}),topNode:e.topNode},this.nodes=J.compile(this.spec.nodes,this),this.marks=Z.compile(this.spec.marks,this);let t=Object.create(null);for(let n in this.nodes){if(n in this.marks)throw new RangeError(n+" can not be both a node and a mark");let e=this.nodes[n],r=e.spec.content||"",i=e.spec.marks;e.contentMatch=t[r]||(t[r]=B.parse(r,this.nodes)),e.inlineContent=e.contentMatch.inlineContent,e.markSet="_"==i?null:i?Q(this,i.split(" ")):""!=i&&e.inlineContent?null:[]}for(let n in this.marks){let e=this.marks[n],t=e.spec.excludes;e.excluded=null==t?[e]:""==t?[]:Q(this,t.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)}node(e){let 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 J))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)}text(e,t){let n=this.nodes.text;return new R(n,n.defaultAttrs,e,h.setFrom(t))}mark(e,t){return"string"==typeof e&&(e=this.marks[e]),e.create(t)}nodeFromJSON(e){return I.fromJSON(this,e)}markFromJSON(e){return h.fromJSON(this,e)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function Q(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],o=e.marks[i],s=o;if(o)n.push(o);else for(let t in e.marks){let r=e.marks[t];("_"==i||r.spec.group&&r.spec.group.split(" ").indexOf(i)>-1)&&n.push(s=r)}if(!s)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}class Y{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[],t.forEach((e=>{e.tag?this.tags.push(e):e.style&&this.styles.push(e)})),this.normalizeLists=!this.tags.some((t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let n=e.nodes[t.node];return n.contentMatch.matchType(n)}))}parse(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=new oe(this,t,!1);return n.addAll(e,t.from,t.to),n.finish()}parseSlice(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=new oe(this,t,!0);return n.addAll(e,t.from,t.to),m.maxOpen(n.finish())}matchTag(e,t,n){for(let r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){let n=this.tags[r];if(se(e,n.tag)&&(void 0===n.namespace||e.namespaceURI==n.namespace)&&(!n.context||t.matchesContext(n.context))){if(n.getAttrs){let t=n.getAttrs(e);if(!1===t)continue;n.attrs=t||void 0}return n}}}matchStyle(e,t,n,r){for(let i=r?this.styles.indexOf(r)+1:0;i<this.styles.length;i++){let r=this.styles[i],o=r.style;if(!(0!=o.indexOf(e)||r.context&&!n.matchesContext(r.context)||o.length>e.length&&(61!=o.charCodeAt(e.length)||o.slice(e.length+1)!=t))){if(r.getAttrs){let e=r.getAttrs(t);if(!1===e)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=null==e.priority?50:e.priority,r=0;for(;r<t.length;r++){let e=t[r];if((null==e.priority?50:e.priority)<n)break}t.splice(r,0,e)}for(let r in e.marks){let t=e.marks[r].spec.parseDOM;t&&t.forEach((e=>{n(e=ae(e)),e.mark=r}))}for(let r in e.nodes){let t=e.nodes[r].spec.parseDOM;t&&t.forEach((e=>{n(e=ae(e)),e.node=r}))}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Y(e,Y.schemaRules(e)))}}const ee={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},te={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},ne={ol:!0,ul:!0};function re(e,t,n){return null!=t?(t?1:0)|("full"===t?2:0):e&&"pre"==e.whitespace?3:-5&n}class ie{constructor(e,t,n,r,i,o,s){this.type=e,this.attrs=t,this.marks=n,this.pendingMarks=r,this.solid=i,this.options=s,this.content=[],this.activeMarks=h.none,this.stashMarks=[],this.match=o||(4&s?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(c.from(e));if(!t){let t,n=this.type.contentMatch;return(t=n.findWrapping(e.type))?(this.match=n,t):null}this.match=this.type.contentMatch.matchFragment(t)}return this.match.findWrapping(e.type)}finish(e){if(!(1&this.options)){let e,t=this.content[this.content.length-1];if(t&&t.isText&&(e=/[ \t\r\n\u000c]+$/.exec(t.text))){let n=t;t.text.length==e[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-e[0].length))}}let t=c.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(c.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}popFromStashMark(e){for(let t=this.stashMarks.length-1;t>=0;t--)if(e.eq(this.stashMarks[t]))return this.stashMarks.splice(t,1)[0]}applyPending(e){for(let t=0,n=this.pendingMarks;t<n.length;t++){let r=n[t];(this.type?this.type.allowsMarkType(r.type):le(r.type,e))&&!r.isInSet(this.activeMarks)&&(this.activeMarks=r.addToSet(this.activeMarks),this.pendingMarks=r.removeFromSet(this.pendingMarks))}}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!ee.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class oe{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0;let r,i=t.topNode,o=re(null,t.preserveWhitespace,0)|(n?4:0);r=i?new ie(i.type,i.attrs,h.none,h.none,!0,t.topMatch||i.type.contentMatch,o):new ie(n?null:e.schema.topNodeType,null,h.none,h.none,!0,null,o),this.nodes=[r],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e){if(3==e.nodeType)this.addTextNode(e);else if(1==e.nodeType){let t=e.getAttribute("style"),n=t?this.readStyles(function(e){let 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(let e=0;e<n.length;e++)this.addPendingMark(n[e]);if(this.addElement(e),null!=n)for(let e=0;e<n.length;e++)this.removePendingMark(n[e],r)}}addTextNode(e){let 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){let 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)}addElement(e,t){let n,r=e.nodeName.toLowerCase();ne.hasOwnProperty(r)&&this.parser.normalizeLists&&function(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=1==t.nodeType?t.nodeName.toLowerCase():null;e&&ne.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):"li"==e?n=t:e&&(n=null)}}(e);let i=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(n=this.parser.matchTag(e,this,t));if(i?i.ignore:te.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);let t,n=this.top,o=this.needsBlock;if(ee.hasOwnProperty(r))t=!0,n.type||(this.needsBlock=!0);else if(!e.firstChild)return void this.leafFallback(e);this.addAll(e),t&&this.sync(n),this.needsBlock=o}else this.addElementByRule(e,i,!1===i.consuming?n:void 0)}leafFallback(e){"BR"==e.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode("\n"))}ignoreFallback(e){"BR"!=e.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"))}readStyles(e){let t=h.none;e:for(let n=0;n<e.length;n+=2)for(let r;;){let 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}addElementByRule(e,t,n){let r,i,o;if(t.node)i=this.parser.schema.nodes[t.node],i.isLeaf?this.insertNode(i.create(t.attrs))||this.leafFallback(e):r=this.enter(i,t.attrs||null,t.preserveWhitespace);else{o=this.parser.schema.marks[t.mark].create(t.attrs),this.addPendingMark(o)}let 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).forEach((e=>this.insertNode(e)));else{let n=e;"string"==typeof t.contentElement?n=e.querySelector(t.contentElement):"function"==typeof t.contentElement?n=t.contentElement(e):t.contentElement&&(n=t.contentElement),this.findAround(e,n,!0),this.addAll(n)}r&&this.sync(s)&&this.open--,o&&this.removePendingMark(o,s)}addAll(e,t,n){let r=t||0;for(let 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)}findPlace(e){let t,n;for(let r=this.open;r>=0;r--){let 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(let r=0;r<t.length;r++)this.enterInner(t[r],null,!1);return!0}insertNode(e){if(e.isInline&&this.needsBlock&&!this.top.type){let e=this.textblockFromContext();e&&this.enterInner(e)}if(this.findPlace(e)){this.closeExtra();let t=this.top;t.applyPending(e.type),t.match&&(t.match=t.match.matchType(e.type));let n=t.activeMarks;for(let r=0;r<e.marks.length;r++)t.type&&!t.type.allowsMarkType(e.marks[r].type)||(n=e.marks[r].addToSet(n));return t.content.push(e.mark(n)),!0}return!1}enter(e,t,n){let r=this.findPlace(e.create(t));return r&&this.enterInner(e,t,!0,n),r}enterInner(e){let 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();let i=this.top;i.applyPending(e),i.match=i.match&&i.match.matchType(e);let o=re(e,r,i.options);4&i.options&&0==i.content.length&&(o|=4),this.nodes.push(new ie(e,t,i.activeMarks,i.pendingMarks,n,null,o)),this.open++}closeExtra(){let 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}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let 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)}findAround(e,t,n){if(e!=t&&this.find)for(let 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)}}findInText(e){if(this.find)for(let 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))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),n=this.options.context,r=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),i=-(n?n.depth+1:0)+(r?0:1),o=(e,s)=>{for(;e>=0;e--){let a=t[e];if(""==a){if(e==t.length-1||0==e)continue;for(;s>=i;s--)if(o(e-1,s))return!0;return!1}{let e=s>0||0==s&&r?this.nodes[s].type:n&&s>=i?n.node(s-i).type:null;if(!e||e.name!=a&&-1==e.groups.indexOf(a))return!1;s--}}return!0};return o(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let t in this.parser.schema.nodes){let e=this.parser.schema.nodes[t];if(e.isTextblock&&e.defaultAttrs)return e}}addPendingMark(e){let t=function(e,t){for(let 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)}removePendingMark(e,t){for(let n=this.open;n>=0;n--){let r=this.nodes[n];if(r.pendingMarks.lastIndexOf(e)>-1)r.pendingMarks=e.removeFromSet(r.pendingMarks);else{r.activeMarks=e.removeFromSet(r.activeMarks);let t=r.popFromStashMark(e);t&&r.type&&r.type.allowsMarkType(t.type)&&(r.activeMarks=t.addToSet(r.activeMarks))}if(r==t)break}}}function se(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function ae(e){let t={};for(let n in e)t[n]=e[n];return t}function le(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let o=[],s=e=>{o.push(e);for(let n=0;n<e.edgeCount;n++){let{type:r,next:i}=e.edge(n);if(r==t)return!0;if(o.indexOf(i)<0&&s(i))return!0}};if(s(i.contentMatch))return!0}}class ce{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;n||(n=pe(t).createDocumentFragment());let r=n,i=[];return e.forEach((e=>{if(i.length||e.marks.length){let n=0,o=0;for(;n<i.length&&o<e.marks.length;){let t=e.marks[o];if(this.marks[t.type.name]){if(!t.eq(i[n][0])||!1===t.type.spec.spanning)break;n++,o++}else o++}for(;n<i.length;)r=i.pop()[1];for(;o<e.marks.length;){let n=e.marks[o++],s=this.serializeMark(n,e.isInline,t);s&&(i.push([n,r]),r.appendChild(s.dom),r=s.contentDOM||s.dom)}}r.appendChild(this.serializeNodeInner(e,t))})),n}serializeNodeInner(e,t){let{dom:n,contentDOM:r}=ce.renderSpec(pe(t),this.nodes[e.type.name](e));if(r){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,r)}return n}serializeNode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.serializeNodeInner(e,t);for(let r=e.marks.length-1;r>=0;r--){let i=this.serializeMark(e.marks[r],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.marks[e.type.name];return r&&ce.renderSpec(pe(n),r(e,t))}static renderSpec(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if("string"==typeof t)return{dom:e.createTextNode(t)};if(null!=t.nodeType)return{dom:t};if(t.dom&&null!=t.dom.nodeType)return t;let r,i=t[0],o=i.indexOf(" ");o>0&&(n=i.slice(0,o),i=i.slice(o+1));let s=n?e.createElementNS(n,i):e.createElement(i),a=t[1],l=1;if(a&&"object"==typeof a&&null==a.nodeType&&!Array.isArray(a)){l=2;for(let e in a)if(null!=a[e]){let t=e.indexOf(" ");t>0?s.setAttributeNS(e.slice(0,t),e.slice(t+1),a[e]):s.setAttribute(e,a[e])}}for(let c=l;c<t.length;c++){let i=t[c];if(0===i){if(c<t.length-1||c>l)throw new RangeError("Content hole must be the only child of its parent node");return{dom:s,contentDOM:s}}{let{dom:t,contentDOM:o}=ce.renderSpec(e,i,n);if(s.appendChild(t),o){if(r)throw new RangeError("Multiple content holes");r=o}}}return{dom:s,contentDOM:r}}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new ce(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=ue(e.nodes);return t.text||(t.text=e=>e.text),t}static marksFromSchema(e){return ue(e.marks)}}function ue(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function pe(e){return e.document||window.document}const de=Math.pow(2,16);function he(e,t){return e+t*de}function fe(e){return 65535&e}class me{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}}class ge{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.ranges=e,this.inverted=t,!e.length&&ge.empty)return ge.empty}recover(e){let t=0,n=fe(e);if(!this.inverted)for(let 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))/de}(e)}mapResult(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this._map(e,t,!1)}map(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this._map(e,t,!0)}_map(e,t,n){let r=0,i=this.inverted?2:1,o=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let a=this.ranges[s]-(this.inverted?r:0);if(a>e)break;let l=this.ranges[s+i],c=this.ranges[s+o],u=a+l;if(e<=u){let i=a+r+((l?e==a?-1:e==u?1:t:t)<0?0:c);if(n)return i;let o=e==(t<0?a:u)?null:he(s/3,e-a),p=e==a?2:e==u?1:4;return(t<0?e!=a:e!=u)&&(p|=8),new me(i,p,o)}r+=c-l}return n?e+r:new me(e+r,0,null)}touches(e,t){let n=0,r=fe(t),i=this.inverted?2:1,o=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let t=this.ranges[s]-(this.inverted?n:0);if(t>e)break;let a=this.ranges[s+i];if(e<=t+a&&s==3*r)return!0;n+=this.ranges[s+o]-a}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r<this.ranges.length;r+=3){let o=this.ranges[r],s=o-(this.inverted?i:0),a=o+(this.inverted?0:i),l=this.ranges[r+t],c=this.ranges[r+n];e(s,s+l,a,a+c),i+=c-l}}invert(){return new ge(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return 0==e?ge.empty:new ge(e<0?[0,-e,0]:[0,0,e])}}ge.empty=new ge([]);class ve{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.length;this.maps=e,this.mirror=t,this.from=n,this.to=r}slice(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.maps.length;return new ve(this.maps,this.mirror,e,t)}copy(){return new ve(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(e,t){this.to=this.maps.push(e),null!=t&&this.setMirror(this.maps.length-1,t)}appendMapping(e){for(let t=0,n=this.maps.length;t<e.maps.length;t++){let r=e.getMirror(t);this.appendMap(e.maps[t],null!=r&&r<t?n+r:void 0)}}getMirror(e){if(this.mirror)for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,n=this.maps.length+e.maps.length;t>=0;t--){let r=e.getMirror(t);this.appendMap(e.maps[t].invert(),null!=r&&r>t?n-r-1:void 0)}}invert(){let e=new ve;return e.appendMappingInverted(this),e}map(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this.maps[n].map(e,t);return e}mapResult(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this._map(e,t,!1)}_map(e,t,n){let r=0;for(let i=this.from;i<this.to;i++){let n=this.maps[i].mapResult(e,t);if(null!=n.recover){let t=this.getMirror(i);if(null!=t&&t>i&&t<this.to){i=t,e=this.maps[t].recover(n.recover);continue}}r|=n.delInfo,e=n.pos}return n?e:new me(e,r,null)}}const ye=Object.create(null);class be{getMap(){return ge.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=ye[t.stepType];if(!n)throw new RangeError("No step type ".concat(t.stepType," defined"));return n.fromJSON(e,t)}static jsonID(e,t){if(e in ye)throw new RangeError("Duplicate use of step JSON ID "+e);return ye[e]=t,t.prototype.jsonID=e,t}}class we{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new we(e,null)}static fail(e){return new we(null,e)}static fromReplace(e,t,n,r){try{return we.ok(e.replace(t,n,r))}catch(i){if(i instanceof f)return we.fail(i.message);throw i}}}function ke(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let o=e.child(i);o.content.size&&(o=o.copy(ke(o.content,t,o))),o.isInline&&(o=t(o,n,i)),r.push(o)}return c.fromArray(r)}class xe extends be{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),r=n.node(n.sharedDepth(this.to)),i=new m(ke(t.content,((e,t)=>e.isAtom&&t.type.allowsMarkType(this.mark.type)?e.mark(this.mark.addToSet(e.marks)):e),r),t.openStart,t.openEnd);return we.fromReplace(e,this.from,this.to,i)}invert(){return new Ce(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new xe(t.pos,n.pos,this.mark)}merge(e){return e instanceof xe&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new xe(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new xe(t.from,t.to,e.markFromJSON(t.mark))}}be.jsonID("addMark",xe);class Ce extends be{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new m(ke(t.content,(e=>e.mark(this.mark.removeFromSet(e.marks))),e),t.openStart,t.openEnd);return we.fromReplace(e,this.from,this.to,n)}invert(){return new xe(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new Ce(t.pos,n.pos,this.mark)}merge(e){return e instanceof Ce&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Ce(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Ce(t.from,t.to,e.markFromJSON(t.mark))}}be.jsonID("removeMark",Ce);class Te extends be{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return we.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return we.fromReplace(e,this.pos,this.pos+1,new m(c.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let e=this.mark.addToSet(t.marks);if(e.length==t.marks.length){for(let n=0;n<t.marks.length;n++)if(!t.marks[n].isInSet(e))return new Te(this.pos,t.marks[n]);return new Te(this.pos,this.mark)}}return new Ee(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Te(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if("number"!=typeof t.pos)throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Te(t.pos,e.markFromJSON(t.mark))}}be.jsonID("addNodeMark",Te);class Ee extends be{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return we.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return we.fromReplace(e,this.pos,this.pos+1,new m(c.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return t&&this.mark.isInSet(t.marks)?new Te(this.pos,this.mark):this}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Ee(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if("number"!=typeof t.pos)throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Ee(t.pos,e.markFromJSON(t.mark))}}be.jsonID("removeNodeMark",Ee);class Me extends be{constructor(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&Se(e,this.from,this.to)?we.fail("Structure replace would overwrite content"):we.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new ge([this.from,this.to-this.from,this.slice.size])}invert(e){return new Me(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deletedAcross&&n.deletedAcross?null:new Me(t.pos,Math.max(t.pos,n.pos),this.slice)}merge(e){if(!(e instanceof Me)||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;{let t=this.slice.size+e.slice.size==0?m.empty:new m(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new Me(e.from,this.to,t,this.structure)}}{let t=this.slice.size+e.slice.size==0?m.empty:new m(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new Me(this.from,this.to+(e.to-e.from),t,this.structure)}}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Me(t.from,t.to,m.fromJSON(e,t.slice),!!t.structure)}}be.jsonID("replace",Me);class Ne extends be{constructor(e,t,n,r,i,o){let s=arguments.length>6&&void 0!==arguments[6]&&arguments[6];super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=i,this.insert=o,this.structure=s}apply(e){if(this.structure&&(Se(e,this.from,this.gapFrom)||Se(e,this.gapTo,this.to)))return we.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return we.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,t.content);return n?we.fromReplace(e,this.from,this.to,n):we.fail("Content does not fit in gap")}getMap(){return new ge([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new Ne(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)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1),r=e.map(this.gapFrom,-1),i=e.map(this.gapTo,1);return t.deletedAcross&&n.deletedAcross||r<t.pos||i>n.pos?null:new Ne(t.pos,n.pos,r,i,this.slice,this.insert,this.structure)}toJSON(){let 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}static fromJSON(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 Ne(t.from,t.to,t.gapFrom,t.gapTo,m.fromJSON(e,t.slice),t.insert,!!t.structure)}}function Se(e,t,n){let r=e.resolve(t),i=n-t,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let e=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,i--}}return!1}function De(e,t,n){return(0==t||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function Le(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth;;--n){let 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||!De(r,i,o))break}return null}function Ae(e){return{type:e,attrs:null}}function Oe(e,t){let 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,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let c=i.depth-1,u=n-2;c>o;c--,u--){let e=i.node(c),t=i.index(c);if(e.type.spec.isolating)return!1;let n=e.content.cutByIndex(t,e.childCount),o=r&&r[u]||e;if(o!=e&&(n=n.replaceChild(0,o.type.create(o.attrs))),!e.canReplace(t+1,e.childCount)||!o.type.validContent(n))return!1}let a=i.indexAfter(o),l=r&&r[0];return i.node(o).canReplaceWith(a,a,l?l.type:i.node(o+1).type)}function Ie(e,t){let n=e.resolve(t),r=n.index();return Re(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function Re(e,t){return!(!e||!t||e.isLeaf||!e.canAppend(t))}function Pe(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:m.empty;if(t==n&&!r.size)return null;let i=e.resolve(t),o=e.resolve(n);return Be(i,o,r)?new Me(t,n,r):new Fe(i,o,r).fit()}function Be(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}be.jsonID("replaceAround",Ne);class Fe{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=c.empty;for(let r=0;r<=e.depth;r++){let t=e.node(r);this.frontier.push({type:t.type,match:t.contentMatchAt(e.indexAfter(r))})}for(let r=e.depth;r>0;r--)this.placed=c.from(e.node(r).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,r=this.close(e<0?this.$to:n.doc.resolve(e));if(!r)return null;let i=this.placed,o=n.depth,s=r.depth;for(;o&&s&&1==i.childCount;)i=i.firstChild.content,o--,s--;let a=new m(i,o,s);return e>-1?new Ne(n.pos,e,this.$to.pos,this.$to.end(),a,t):a.size||n.pos!=this.$to.pos?new Me(n.pos,r.pos,a):null}findFittable(){for(let e=1;e<=2;e++)for(let t=this.unplaced.openStart;t>=0;t--){let n,r=null;t?(r=ze(this.unplaced.content,t-1).firstChild,n=r.content):n=this.unplaced.content;let i=n.firstChild;for(let o=this.depth;o>=0;o--){let n,{type:s,match:a}=this.frontier[o],l=null;if(1==e&&(i?a.matchType(i.type)||(l=a.fillBefore(c.from(i),!1)):r&&s.compatibleContent(r.type)))return{sliceDepth:t,frontierDepth:o,parent:r,inject:l};if(2==e&&i&&(n=a.findWrapping(i.type)))return{sliceDepth:t,frontierDepth:o,parent:r,wrap:n};if(r&&a.matchType(r.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=ze(e,t);return!(!r.childCount||r.firstChild.isLeaf)&&(this.unplaced=new m(e,t+1,Math.max(n,r.size+t>=e.size-n?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=ze(e,t);if(r.childCount<=1&&t>0){let i=e.size-t<=t+r.size;this.unplaced=new m(He(e,t-1,1),t-1,i?t-1:n)}else this.unplaced=new m(He(e,t,1),t,n)}placeNodes(e){let{sliceDepth:t,frontierDepth:n,parent:r,inject:i,wrap:o}=e;for(;this.depth>n;)this.closeFrontierNode();if(o)for(let c=0;c<o.length;c++)this.openFrontierNode(o[c]);let s=this.unplaced,a=r?r.content:s.content,l=s.openStart-t,u=0,p=[],{match:d,type:h}=this.frontier[n];if(i){for(let e=0;e<i.childCount;e++)p.push(i.child(e));d=d.matchFragment(i)}let f=a.size+t-(s.content.size-s.openEnd);for(;u<a.childCount;){let e=a.child(u),t=d.matchType(e.type);if(!t)break;u++,(u>1||0==l||e.content.size)&&(d=t,p.push(je(e.mark(h.allowedMarks(e.marks)),1==u?l:0,u==a.childCount?f:-1)))}let g=u==a.childCount;g||(f=-1),this.placed=qe(this.placed,n,c.from(p)),this.frontier[n].match=d,g&&f<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let c=0,m=a;c<f;c++){let e=m.lastChild;this.frontier.push({type:e.type,match:e.contentMatchAt(e.childCount)}),m=e.content}this.unplaced=g?0==t?m.empty:new m(He(s.content,t-1,1),t-1,f<0?s.openEnd:t-1):new m(He(s.content,t,u),s.openStart,s.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e,t=this.frontier[this.depth];if(!t.type.isTextblock||!Ve(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;let{depth:n}=this.$to,r=this.$to.after(n);for(;n>1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:r}=this.frontier[t],i=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),o=Ve(e,t,r,n,i);if(o){for(let n=t-1;n>=0;n--){let{match:t,type:r}=this.frontier[n],i=Ve(e,n,r,t,!0);if(!i||i.childCount)continue e}return{depth:t,fit:o,move:i?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=qe(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let t=e.node(n),r=t.type.contentMatch.fillBefore(t.content,!0,e.index(n));this.openFrontierNode(t.type,t.attrs,r)}return e}openFrontierNode(e){let 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=qe(this.placed,this.depth,c.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(c.empty,!0);e.childCount&&(this.placed=qe(this.placed,this.frontier.length,e))}}function He(e,t,n){return 0==t?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(He(e.firstChild.content,t-1,n)))}function qe(e,t,n){return 0==t?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(qe(e.lastChild.content,t-1,n)))}function ze(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function je(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,je(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(c.empty,!0)))),e.copy(r)}function Ve(e,t,n,r,i){let o=e.node(t),s=i?e.indexAfter(t):e.index(t);if(s==o.childCount&&!n.compatibleContent(o.type))return null;let a=r.fillBefore(o.content,!0,s);return a&&!function(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}(n,o.content,s)?a:null}function _e(e){return e.spec.defining||e.spec.definingForContent}function Ue(e,t,n,r,i){if(t<n){let i=e.firstChild;e=e.replaceChild(0,i.copy(Ue(i.content,t+1,n,r,i)))}if(t>r){let t=i.contentMatchAt(0),n=t.fillBefore(e).append(e);e=n.append(t.matchFragment(n).fillBefore(c.empty,!0))}return e}function $e(e,t){let n=[];for(let r=Math.min(e.depth,t.depth);r>=0;r--){let 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}class We extends be{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let t=e.nodeAt(this.pos);if(!t)return we.fail("No node at attribute step's position");let n=Object.create(null);for(let i in t.attrs)n[i]=t.attrs[i];n[this.attr]=this.value;let r=t.type.create(n,null,t.marks);return we.fromReplace(e,this.pos,this.pos+1,new m(c.from(r),0,t.isLeaf?0:1))}getMap(){return ge.empty}invert(e){return new We(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new We(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if("number"!=typeof t.pos||"string"!=typeof t.attr)throw new RangeError("Invalid input for AttrStep.fromJSON");return new We(t.pos,t.attr,t.value)}}be.jsonID("attr",We);let Ge=class extends Error{};Ge=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},(Ge.prototype=Object.create(Error.prototype)).constructor=Ge,Ge.prototype.name="TransformError";class Je{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new ve}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new Ge(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:m.empty,r=Pe(this.doc,e,t,n);return r&&this.step(r),this}replaceWith(e,t,n){return this.replace(e,t,new m(c.from(n),0,0))}delete(e,t){return this.replace(e,t,m.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return function(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let i=e.doc.resolve(t),o=e.doc.resolve(n);if(Be(i,o,r))return e.step(new Me(t,n,r));let s=$e(i,e.doc.resolve(n));0==s[s.length-1]&&s.pop();let a=-(i.depth+1);s.unshift(a);for(let d=i.depth,h=i.pos-1;d>0;d--,h--){let e=i.node(d).type.spec;if(e.defining||e.definingAsContext||e.isolating)break;s.indexOf(d)>-1?a=d:i.before(d)==h&&s.splice(1,0,-d)}let l=s.indexOf(a),c=[],u=r.openStart;for(let d=r.content,h=0;;h++){let e=d.firstChild;if(c.push(e),h==r.openStart)break;d=e.content}for(let d=u-1;d>=0;d--){let e=c[d].type,t=_e(e);if(t&&i.node(l).type!=e)u=d;else if(t||!e.isTextblock)break}for(let d=r.openStart;d>=0;d--){let t=(d+u+1)%(r.openStart+1),a=c[t];if(a)for(let c=0;c<s.length;c++){let u=s[(c+l)%s.length],p=!0;u<0&&(p=!1,u=-u);let d=i.node(u-1),h=i.index(u-1);if(d.canReplaceWith(h,h,a.type,a.marks))return e.replace(i.before(u),p?o.after(u):n,new m(Ue(r.content,0,r.openStart,t),t,r.openEnd))}}let p=e.steps.length;for(let d=s.length-1;d>=0&&(e.replace(t,n,r),!(e.steps.length>p));d--){let e=s[d];e<0||(t=i.before(e),n=o.after(e))}}(this,e,t,n),this}replaceRangeWith(e,t,n){return function(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let i=function(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(0==r.parentOffset)for(let i=r.depth-1;i>=0;i--){let e=r.index(i);if(r.node(i).canReplaceWith(e,e,n))return r.before(i+1);if(e>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let e=r.indexAfter(i);if(r.node(i).canReplaceWith(e,e,n))return r.after(i+1);if(e<r.node(i).childCount)return null}return null}(e.doc,t,r.type);null!=i&&(t=n=i)}e.replaceRange(t,n,new m(c.from(r),0,0))}(this,e,t,n),this}deleteRange(e,t){return function(e,t,n){let r=e.doc.resolve(t),i=e.doc.resolve(n),o=$e(r,i);for(let s=0;s<o.length;s++){let t=o[s],n=s==o.length-1;if(n&&0==t||r.node(t).type.contentMatch.validEnd)return e.delete(r.start(t),i.end(t));if(t>0&&(n||r.node(t-1).canReplace(r.index(t-1),i.indexAfter(t-1))))return e.delete(r.before(t),i.after(t))}for(let s=1;s<=r.depth&&s<=i.depth;s++)if(t-r.start(s)==r.depth-s&&n>r.end(s)&&i.end(s)-n!=i.depth-s)return e.delete(r.before(s),n);e.delete(t,n)}(this,e,t),this}lift(e,t){return function(e,t,n){let{$from:r,$to:i,depth:o}=t,s=r.before(o+1),a=i.after(o+1),l=s,u=a,p=c.empty,d=0;for(let m=o,g=!1;m>n;m--)g||r.index(m)>0?(g=!0,p=c.from(r.node(m).copy(p)),d++):l--;let h=c.empty,f=0;for(let m=o,g=!1;m>n;m--)g||i.after(m+1)<i.end(m)?(g=!0,h=c.from(i.node(m).copy(h)),f++):u++;e.step(new Ne(l,u,s,a,new m(p.append(h),d,f),p.size-d,!0))}(this,e,t),this}join(e){return function(e,t,n){let r=new Me(t-n,t+n,m.empty,!0);e.step(r)}(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:1),this}wrap(e,t){return function(e,t,n){let r=c.empty;for(let s=n.length-1;s>=0;s--){if(r.size){let e=n[s].type.contentMatch.matchFragment(r);if(!e||!e.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=c.from(n[s].type.create(n[s].attrs,r))}let i=t.start,o=t.end;e.step(new Ne(i,o,i,o,new m(r,0,0),n.length,!0))}(this,e,t),this}setBlockType(e){return function(e,t,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=e.steps.length;e.doc.nodesBetween(t,n,((t,n)=>{if(t.isTextblock&&!t.hasMarkup(r,i)&&function(e,t,n){let 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);let s=e.mapping.slice(o),a=s.map(n,1),l=s.map(n+t.nodeSize,1);return e.step(new Ne(a,l,a+1,l-1,new m(c.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}setNodeMarkup(e,t){return function(e,t,n,r,i){let o=e.doc.nodeAt(t);if(!o)throw new RangeError("No node at given position");n||(n=o.type);let s=n.create(r,null,i||o.marks);if(o.isLeaf)return e.replaceWith(t,t+o.nodeSize,s);if(!n.validContent(o.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new Ne(t,t+o.nodeSize,t+1,t+o.nodeSize-1,new m(c.from(s),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}setNodeAttribute(e,t,n){return this.step(new We(e,t,n)),this}addNodeMark(e,t){return this.step(new Te(e,t)),this}removeNodeMark(e,t){if(!(t instanceof h)){let 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 Ee(e,t)),this}split(e){return function(e,t){let 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=c.empty,s=c.empty;for(let a=i.depth,l=i.depth-n,u=n-1;a>l;a--,u--){o=c.from(i.node(a).copy(o));let e=r&&r[u];s=c.from(e?e.type.create(e.attrs,s):i.node(a).copy(s))}e.step(new Me(t,t,new m(o.append(s),n,n),!0))}(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,arguments.length>2?arguments[2]:void 0),this}addMark(e,t,n){return function(e,t,n,r){let i,o,s=[],a=[];e.doc.nodesBetween(t,n,((e,l,c)=>{if(!e.isInline)return;let u=e.marks;if(!r.isInSet(u)&&c.type.allowsMarkType(r.type)){let c=Math.max(l,t),p=Math.min(l+e.nodeSize,n),d=r.addToSet(u);for(let e=0;e<u.length;e++)u[e].isInSet(d)||(i&&i.to==c&&i.mark.eq(u[e])?i.to=p:s.push(i=new Ce(c,p,u[e])));o&&o.to==c?o.to=p:a.push(o=new xe(c,p,r))}})),s.forEach((t=>e.step(t))),a.forEach((t=>e.step(t)))}(this,e,t,n),this}removeMark(e,t,n){return function(e,t,n,r){let i=[],o=0;e.doc.nodesBetween(t,n,((e,s)=>{if(!e.isInline)return;o++;let a=null;if(r instanceof Z){let t,n=e.marks;for(;t=r.isInSet(n);)(a||(a=[])).push(t),n=t.removeFromSet(n)}else r?r.isInSet(e.marks)&&(a=[r]):a=e.marks;if(a&&a.length){let r=Math.min(s+e.nodeSize,n);for(let e=0;e<a.length;e++){let n,l=a[e];for(let e=0;e<i.length;e++){let t=i[e];t.step==o-1&&l.eq(i[e].style)&&(n=t)}n?(n.to=r,n.step=o):i.push({style:l,from:Math.max(s,t),to:r,step:o})}}})),i.forEach((t=>e.step(new Ce(t.from,t.to,t.style))))}(this,e,t,n),this}clearIncompatible(e,t,n){return function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:n.contentMatch,i=e.doc.nodeAt(t),o=[],s=t+1;for(let a=0;a<i.childCount;a++){let t=i.child(a),l=s+t.nodeSize,c=r.matchType(t.type);if(c){r=c;for(let r=0;r<t.marks.length;r++)n.allowsMarkType(t.marks[r].type)||e.step(new Ce(s,l,t.marks[r]))}else o.push(new Me(s,l,m.empty));s=l}if(!r.validEnd){let t=r.fillBefore(c.empty,!0);e.replace(s,s,new m(t,0,0))}for(let a=o.length-1;a>=0;a--)e.step(o[a])}(this,e,t,n),this}}const Ke=Object.create(null);class Ze{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new Xe(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:m.empty,n=t.content.lastChild,r=null;for(let s=0;s<t.openEnd;s++)r=n,n=n.lastChild;let i=e.steps.length,o=this.ranges;for(let s=0;s<o.length;s++){let{$from:a,$to:l}=o[s],c=e.mapping.slice(i);e.replaceRange(c.map(a.pos),c.map(l.pos),s?m.empty:t),0==s&&at(e,i,(n?n.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:o,$to:s}=r[i],a=e.mapping.slice(n),l=a.map(o.pos),c=a.map(s.pos);i?e.deleteRange(l,c):(e.replaceRangeWith(l,c,t),at(e,n,t.isInline?-1:1))}}static findFrom(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=e.parent.inlineContent?new et(e):st(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(let i=e.depth-1;i>=0;i--){let r=t<0?st(e.node(0),e.node(i),e.before(i+1),e.index(i),t,n):st(e.node(0),e.node(i),e.after(i+1),e.index(i)+1,t,n);if(r)return r}return null}static near(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this.findFrom(e,t)||this.findFrom(e,-t)||new it(e.node(0))}static atStart(e){return st(e,e,0,0,1)||new it(e)}static atEnd(e){return st(e,e,e.content.size,e.childCount,-1)||new it(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=Ke[t.type];if(!n)throw new RangeError("No selection type ".concat(t.type," defined"));return n.fromJSON(e,t)}static jsonID(e,t){if(e in Ke)throw new RangeError("Duplicate use of selection JSON ID "+e);return Ke[e]=t,t.prototype.jsonID=e,t}getBookmark(){return et.between(this.$anchor,this.$head).getBookmark()}}Ze.prototype.visible=!0;class Xe{constructor(e,t){this.$from=e,this.$to=t}}let Qe=!1;function Ye(e){Qe||e.parent.inlineContent||(Qe=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class et extends Ze{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;Ye(e),Ye(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let n=e.resolve(t.map(this.head));if(!n.parent.inlineContent)return Ze.near(n);let r=e.resolve(t.map(this.anchor));return new et(r.parent.inlineContent?r:n,n)}replace(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:m.empty;if(super.replace(e,t),t==m.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(e){return e instanceof et&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new tt(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if("number"!=typeof t.anchor||"number"!=typeof t.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new et(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t){let 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))}static between(e,t,n){let r=e.pos-t.pos;if(n&&!r||(n=r>=0?1:-1),!t.parent.inlineContent){let e=Ze.findFrom(t,n,!0)||Ze.findFrom(t,-n,!0);if(!e)return Ze.near(t,n);t=e.$head}return e.parent.inlineContent||(0==r||(e=(Ze.findFrom(e,-n,!0)||Ze.findFrom(e,n,!0)).$anchor).pos<t.pos!=r<0)&&(e=t),new et(e,t)}}Ze.jsonID("text",et);class tt{constructor(e,t){this.anchor=e,this.head=t}map(e){return new tt(e.map(this.anchor),e.map(this.head))}resolve(e){return et.between(e.resolve(this.anchor),e.resolve(this.head))}}class nt extends Ze{constructor(e){let t=e.nodeAfter,n=e.node(0).resolve(e.pos+t.nodeSize);super(e,n),this.node=t}map(e,t){let{deleted:n,pos:r}=t.mapResult(this.anchor),i=e.resolve(r);return n?Ze.near(i):new nt(i)}content(){return new m(c.from(this.node),0,0)}eq(e){return e instanceof nt&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new rt(this.anchor)}static fromJSON(e,t){if("number"!=typeof t.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new nt(e.resolve(t.anchor))}static create(e,t){return new nt(e.resolve(t))}static isSelectable(e){return!e.isText&&!1!==e.type.spec.selectable}}nt.prototype.visible=!1,Ze.jsonID("node",nt);class rt{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:n}=e.mapResult(this.anchor);return t?new tt(n,n):new rt(n)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&nt.isSelectable(n)?new nt(t):Ze.near(t)}}class it extends Ze{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:m.empty;if(t==m.empty){e.delete(0,e.doc.content.size);let t=Ze.atStart(e.doc);t.eq(e.selection)||e.setSelection(t)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new it(e)}map(e){return new it(e)}eq(e){return e instanceof it}getBookmark(){return ot}}Ze.jsonID("all",it);const ot={map(){return this},resolve:e=>new it(e)};function st(e,t,n,r,i){let o=arguments.length>5&&void 0!==arguments[5]&&arguments[5];if(t.inlineContent)return et.create(e,n);for(let s=r-(i>0?0:1);i>0?s<t.childCount:s>=0;s+=i){let r=t.child(s);if(r.isAtom){if(!o&&nt.isSelectable(r))return nt.create(e,n-(i<0?r.nodeSize:0))}else{let t=st(e,r,n+i,i<0?r.childCount:0,i,o);if(t)return t}n+=r.nodeSize*i}return null}function at(e,t,n){let r=e.steps.length-1;if(r<t)return;let i,o=e.steps[r];(o instanceof Me||o instanceof Ne)&&(e.mapping.maps[r].forEach(((e,t,n,r)=>{null==i&&(i=r)})),e.setSelection(Ze.near(e.doc.resolve(i),n)))}class lt extends Je{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){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}setSelection(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}get selectionSet(){return(1&this.updated)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=2,this}ensureMarks(e){return h.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(2&this.updated)>0}addStep(e,t){super.addStep(e,t),this.updated=-3&this.updated,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e){let 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)||h.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,n){let 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);let i=this.storedMarks;if(!i){let e=this.doc.resolve(t);i=n==t?e.marks():e.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,i)),this.selection.empty||this.setSelection(Ze.near(this.selection.$to)),this}}setMeta(e,t){return this.meta["string"==typeof e?e:e.key]=t,this}getMeta(e){return this.meta["string"==typeof e?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=4,this}get scrolledIntoView(){return(4&this.updated)>0}}function ct(e,t){return t&&e?e.bind(t):e}class ut{constructor(e,t,n){this.name=e,this.init=ct(t.init,n),this.apply=ct(t.apply,n)}}const pt=[new ut("doc",{init:e=>e.doc||e.schema.topNodeType.createAndFill(),apply:e=>e.doc}),new ut("selection",{init:(e,t)=>e.selection||Ze.atStart(t.doc),apply:e=>e.selection}),new ut("storedMarks",{init:e=>e.storedMarks||null,apply:(e,t,n,r)=>r.selection.$cursor?e.storedMarks:null}),new ut("scrollToSelection",{init:()=>0,apply:(e,t)=>e.scrolledIntoView?t+1:t})];class dt{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=pt.slice(),t&&t.forEach((e=>{if(this.pluginsByKey[e.key])throw new RangeError("Adding different instances of a keyed plugin ("+e.key+")");this.plugins.push(e),this.pluginsByKey[e.key]=e,e.spec.state&&this.fields.push(new ut(e.key,e.spec.state,e))}))}}class ht{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;for(let n=0;n<this.config.plugins.length;n++)if(n!=t){let t=this.config.plugins[n];if(t.spec.filterTransaction&&!t.spec.filterTransaction.call(t,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],n=this.applyInner(e),r=null;for(;;){let i=!1;for(let o=0;o<this.config.plugins.length;o++){let s=this.config.plugins[o];if(s.spec.appendTransaction){let a=r?r[o].n:0,l=r?r[o].state:this,c=a<t.length&&s.spec.appendTransaction.call(s,a?t.slice(a):t,l,n);if(c&&n.filterTransaction(c,o)){if(c.setMeta("appendedTransaction",e),!r){r=[];for(let e=0;e<this.config.plugins.length;e++)r.push(e<o?{state:n,n:t.length}:{state:this,n:0})}t.push(c),n=n.applyInner(c),i=!0}r&&(r[o]={state:n,n:t.length})}}if(!i)return{state:n,transactions:t}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let t=new ht(this.config),n=this.config.fields;for(let r=0;r<n.length;r++){let i=n[r];t[i.name]=i.apply(e,this[i.name],this,t)}return t}get tr(){return new lt(this)}static create(e){let t=new dt(e.doc?e.doc.type.schema:e.schema,e.plugins),n=new ht(t);for(let r=0;r<t.fields.length;r++)n[t.fields[r].name]=t.fields[r].init(e,n);return n}reconfigure(e){let t=new dt(this.schema,e.plugins),n=t.fields,r=new ht(t);for(let i=0;i<n.length;i++){let t=n[i].name;r[t]=this.hasOwnProperty(t)?this[t]:n[i].init(e,r)}return r}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map((e=>e.toJSON()))),e&&"object"==typeof e)for(let n in e){if("doc"==n||"selection"==n)throw new RangeError("The JSON fields `doc` and `selection` are reserved");let r=e[n],i=r.spec.state;i&&i.toJSON&&(t[n]=i.toJSON.call(r,this[r.key]))}return t}static fromJSON(e,t,n){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let r=new dt(e.schema,e.plugins),i=new ht(r);return r.fields.forEach((r=>{if("doc"==r.name)i.doc=I.fromJSON(e.schema,t.doc);else if("selection"==r.name)i.selection=Ze.fromJSON(i.doc,t.selection);else if("storedMarks"==r.name)t.storedMarks&&(i.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(n)for(let o in n){let s=n[o],a=s.spec.state;if(s.key==r.name&&a&&a.fromJSON&&Object.prototype.hasOwnProperty.call(t,o))return void(i[r.name]=a.fromJSON.call(s,e,t[o],i))}i[r.name]=r.init(e,i)}})),i}}function ft(e,t,n){for(let r in e){let i=e[r];i instanceof Function?i=i.bind(t):"handleDOMEvents"==r&&(i=ft(i,t,{})),n[r]=i}return n}class mt{constructor(e){this.spec=e,this.props={},e.props&&ft(e.props,this,this.props),this.key=e.key?e.key.key:vt("plugin")}getState(e){return e[this.key]}}const gt=Object.create(null);function vt(e){return e in gt?e+"$"+ ++gt[e]:(gt[e]=0,e+"$")}class yt{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"key";this.key=vt(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const bt="undefined"!=typeof navigator?navigator:null,wt="undefined"!=typeof document?document:null,kt=bt&&bt.userAgent||"",xt=/Edge\/(\d+)/.exec(kt),Ct=/MSIE \d/.exec(kt),Tt=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(kt),Et=!!(Ct||Tt||xt),Mt=Ct?document.documentMode:Tt?+Tt[1]:xt?+xt[1]:0,Nt=!Et&&/gecko\/(\d+)/i.test(kt);Nt&&(/Firefox\/(\d+)/.exec(kt)||[0,0])[1];const St=!Et&&/Chrome\/(\d+)/.exec(kt),Dt=!!St,Lt=St?+St[1]:0,At=!Et&&!!bt&&/Apple Computer/.test(bt.vendor),Ot=At&&(/Mobile\/\w+/.test(kt)||!!bt&&bt.maxTouchPoints>2),It=Ot||!!bt&&/Mac/.test(bt.platform),Rt=/Android \d/.test(kt),Pt=!!wt&&"webkitFontSmoothing"in wt.documentElement.style,Bt=Pt?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,Ft=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},Ht=function(e){let t=e.assignedSlot||e.parentNode;return t&&11==t.nodeType?t.host:t};let qt=null;const zt=function(e,t,n){let r=qt||(qt=document.createRange());return r.setEnd(e,null==n?e.nodeValue.length:n),r.setStart(e,t||0),r},jt=function(e,t,n,r){return n&&(_t(e,t,n,r,-1)||_t(e,t,n,r,1))},Vt=/^(img|br|input|textarea|hr)$/i;function _t(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:Ut(e))){let n=e.parentNode;if(!n||1!=n.nodeType||$t(e)||Vt.test(e.nodeName)||"false"==e.contentEditable)return!1;t=Ft(e)+(i<0?0:1),e=n}else{if(1!=e.nodeType)return!1;if("false"==(e=e.childNodes[t+(i<0?-1:0)]).contentEditable)return!1;t=i<0?Ut(e):0}}}function Ut(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function $t(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}const Wt=function(e){let t=e.isCollapsed;return t&&Dt&&e.rangeCount&&!e.getRangeAt(0).collapsed&&(t=!1),t};function Gt(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}function Jt(e){return{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function Kt(e,t){return"number"==typeof e?e:e[t]}function Zt(e){let 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 Xt(e,t,n){let r=e.someProp("scrollThreshold")||0,i=e.someProp("scrollMargin")||5,o=e.dom.ownerDocument;for(let s=n||e.dom;s;s=Ht(s)){if(1!=s.nodeType)continue;let e=s,n=e==o.body,a=n?Jt(o):Zt(e),l=0,c=0;if(t.top<a.top+Kt(r,"top")?c=-(a.top-t.top+Kt(i,"top")):t.bottom>a.bottom-Kt(r,"bottom")&&(c=t.bottom-a.bottom+Kt(i,"bottom")),t.left<a.left+Kt(r,"left")?l=-(a.left-t.left+Kt(i,"left")):t.right>a.right-Kt(r,"right")&&(l=t.right-a.right+Kt(i,"right")),l||c)if(n)o.defaultView.scrollBy(l,c);else{let n=e.scrollLeft,r=e.scrollTop;c&&(e.scrollTop+=c),l&&(e.scrollLeft+=l);let i=e.scrollLeft-n,o=e.scrollTop-r;t={left:t.left-i,top:t.top-o,right:t.right-i,bottom:t.bottom-o}}if(n)break}}function Qt(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=Ht(r));return t}function Yt(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:i,left:o}=e[n];r.scrollTop!=i+t&&(r.scrollTop=i+t),r.scrollLeft!=o&&(r.scrollLeft=o)}}let en=null;function tn(e,t){let n,r,i=2e8,o=0,s=t.top,a=t.top;for(let l=e.firstChild,c=0;l;l=l.nextSibling,c++){let e;if(1==l.nodeType)e=l.getClientRects();else{if(3!=l.nodeType)continue;e=zt(l).getClientRects()}for(let u=0;u<e.length;u++){let p=e[u];if(p.top<=s&&p.bottom>=a){s=Math.max(p.bottom,s),a=Math.min(p.top,a);let e=p.left>t.left?p.left-t.left:p.right<t.left?t.left-p.right:0;if(e<i){n=l,i=e,r=e&&3==n.nodeType?{left:p.right<t.left?p.right:p.left,top:t.top}:t,1==l.nodeType&&e&&(o=c+(t.left>=(p.left+p.right)/2?1:0));continue}}!n&&(t.left>=p.right&&t.top>=p.top||t.left>=p.left&&t.top>=p.bottom)&&(o=c+1)}}return n&&3==n.nodeType?function(e,t){let n=e.nodeValue.length,r=document.createRange();for(let i=0;i<n;i++){r.setEnd(e,i+1),r.setStart(e,i);let n=sn(r,1);if(n.top!=n.bottom&&nn(t,n))return{node:e,offset:i+(t.left>=(n.left+n.right)/2?1:0)}}return{node:e,offset:0}}(n,r):!n||i&&1==n.nodeType?{node:e,offset:o}:tn(n,r)}function nn(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function rn(e,t,n){let r=e.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(t.top-n.top)/(n.bottom-n.top))-2)),o=i;;){let n=e.childNodes[o];if(1==n.nodeType){let e=n.getClientRects();for(let r=0;r<e.length;r++){let i=e[r];if(nn(t,i))return rn(n,t,i)}}if((o=(o+1)%r)==i)break}return e}function on(e,t){let n,r=e.dom.ownerDocument,i=0;if(r.caretPositionFromPoint)try{let e=r.caretPositionFromPoint(t.left,t.top);e&&({offsetNode:n,offset:i}=e)}catch(l){}if(!n&&r.caretRangeFromPoint){let e=r.caretRangeFromPoint(t.left,t.top);e&&({startContainer:n,startOffset:i}=e)}let o,s=(e.root.elementFromPoint?e.root:r).elementFromPoint(t.left,t.top);if(!s||!e.dom.contains(1!=s.nodeType?s.parentNode:s)){let n=e.dom.getBoundingClientRect();if(!nn(t,n))return null;if(s=rn(e.dom,t,n),!s)return null}if(At)for(let c=s;n&&c;c=Ht(c))c.draggable&&(n=void 0);if(s=function(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}(s,t),n){if(Nt&&1==n.nodeType&&(i=Math.min(i,n.childNodes.length),i<n.childNodes.length)){let e,r=n.childNodes[i];"IMG"==r.nodeName&&(e=r.getBoundingClientRect()).right<=t.left&&e.bottom>t.top&&i++}n==e.dom&&i==n.childNodes.length-1&&1==n.lastChild.nodeType&&t.top>n.lastChild.getBoundingClientRect().bottom?o=e.state.doc.content.size:0!=i&&1==n.nodeType&&"BR"==n.childNodes[i-1].nodeName||(o=function(e,t,n,r){let i=-1;for(let o=t;o!=e.dom;){let t=e.docView.nearestDesc(o,!0);if(!t)return null;if(t.node.isBlock&&t.parent){let e=t.dom.getBoundingClientRect();if(e.left>r.left||e.top>r.top)i=t.posBefore;else{if(!(e.right<r.left||e.bottom<r.top))break;i=t.posAfter}}o=t.dom.parentNode}return i>-1?i:e.docView.posFromDOM(t,n,1)}(e,n,i,t))}null==o&&(o=function(e,t,n){let{node:r,offset:i}=tn(t,n),o=-1;if(1==r.nodeType&&!r.firstChild){let e=r.getBoundingClientRect();o=e.left!=e.right&&n.left>(e.left+e.right)/2?1:-1}return e.docView.posFromDOM(r,i,o)}(e,s,t));let a=e.docView.nearestDesc(s,!0);return{pos:o,inside:a?a.posAtStart-a.border:-1}}function sn(e,t){let n=e.getClientRects();return n.length?n[t<0?0:n.length-1]:e.getBoundingClientRect()}const an=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function ln(e,t,n){let{node:r,offset:i,atom:o}=e.docView.domFromPos(t,n<0?-1:1),s=Pt||Nt;if(3==r.nodeType){if(!s||!an.test(r.nodeValue)&&(n<0?i:i!=r.nodeValue.length)){let e=i,t=i,o=n<0?1:-1;return n<0&&!i?(t++,o=-1):n>=0&&i==r.nodeValue.length?(e--,o=1):n<0?e--:t++,cn(sn(zt(r,e,t),1),o<0)}{let e=sn(zt(r,i,i),n);if(Nt&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let t=sn(zt(r,i-1,i-1),-1);if(t.top==e.top){let n=sn(zt(r,i,i+1),-1);if(n.top!=e.top)return cn(n,n.left<t.left)}}return e}}if(!e.state.doc.resolve(t-(o||0)).parent.inlineContent){if(null==o&&i&&(n<0||i==Ut(r))){let e=r.childNodes[i-1];if(1==e.nodeType)return un(e.getBoundingClientRect(),!1)}if(null==o&&i<Ut(r)){let e=r.childNodes[i];if(1==e.nodeType)return un(e.getBoundingClientRect(),!0)}return un(r.getBoundingClientRect(),n>=0)}if(null==o&&i&&(n<0||i==Ut(r))){let e=r.childNodes[i-1],t=3==e.nodeType?zt(e,Ut(e)-(s?0:1)):1!=e.nodeType||"BR"==e.nodeName&&e.nextSibling?null:e;if(t)return cn(sn(t,1),!1)}if(null==o&&i<Ut(r)){let e=r.childNodes[i];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?3==e.nodeType?zt(e,0,s?0:1):1==e.nodeType?e:null:null;if(t)return cn(sn(t,-1),!0)}return cn(sn(3==r.nodeType?zt(r):r,-n),n>=0)}function cn(e,t){if(0==e.width)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function un(e,t){if(0==e.height)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function pn(e,t,n){let 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()}}const dn=/[\u0590-\u08ac]/;let hn=null,fn=null,mn=!1;function gn(e,t,n){return hn==t&&fn==n?mn:(hn=t,fn=n,mn="up"==n||"down"==n?function(e,t,n){let r=t.selection,i="up"==n?r.$from:r.$to;return pn(e,t,(()=>{let{node:t}=e.docView.domFromPos(i.pos,"up"==n?-1:1);for(;;){let n=e.docView.nearestDesc(t,!0);if(!n)break;if(n.node.isBlock){t=n.dom;break}t=n.dom.parentNode}let r=ln(e,i.pos,1);for(let e=t.firstChild;e;e=e.nextSibling){let t;if(1==e.nodeType)t=e.getClientRects();else{if(3!=e.nodeType)continue;t=zt(e,0,e.nodeValue.length).getClientRects()}for(let e=0;e<t.length;e++){let i=t[e];if(i.bottom>i.top+1&&("up"==n?r.top-i.top>2*(i.bottom-r.top):i.bottom-r.bottom>2*(r.bottom-i.top)))return!1}}return!0}))}(e,t,n):function(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=!i,s=i==r.parent.content.size,a=e.domSelection();return dn.test(r.parent.textContent)&&a.modify?pn(e,t,(()=>{let t=a.getRangeAt(0),i=a.focusNode,o=a.focusOffset,s=a.caretBidiLevel;a.modify("move",n,"character");let l=!(r.depth?e.docView.domAfterPos(r.before()):e.dom).contains(1==a.focusNode.nodeType?a.focusNode:a.focusNode.parentNode)||i==a.focusNode&&o==a.focusOffset;return a.removeAllRanges(),a.addRange(t),null!=s&&(a.caretBidiLevel=s),l})):"left"==n||"backward"==n?o:s}(e,t,n))}class vn{constructor(e,t,n,r){this.parent=e,this.children=t,this.dom=n,this.contentDOM=r,this.dirty=0,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,n){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let t=0,n=this.posAtStart;;t++){let r=this.children[t];if(r==e)return n;n+=r.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,t,n){if(this.contentDOM&&this.contentDOM.contains(1==e.nodeType?e:e.parentNode)){if(n<0){let n,r;if(e==this.contentDOM)n=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.previousSibling}for(;n&&(!(r=n.pmViewDesc)||r.parent!=this);)n=n.previousSibling;return n?this.posBeforeChild(r)+r.size:this.posAtStart}{let n,r;if(e==this.contentDOM)n=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.nextSibling}for(;n&&(!(r=n.pmViewDesc)||r.parent!=this);)n=n.nextSibling;return n?this.posBeforeChild(r):this.posAtEnd}}let r;if(e==this.dom&&this.contentDOM)r=t>Ft(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=2&e.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==t)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!1;break}if(t.previousSibling)break}if(null==r&&t==e.childNodes.length)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!0;break}if(t.nextSibling)break}}return(null==r?n>0:r)?this.posAtEnd:this.posAtStart}nearestDesc(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];for(let n=!0,r=e;r;r=r.parentNode){let i,o=this.getDesc(r);if(o&&(!t||o.node)){if(!n||!(i=o.nodeDOM)||(1==i.nodeType?i.contains(1==e.nodeType?e:e.parentNode):i==e))return o;n=!1}}}getDesc(e){let t=e.pmViewDesc;for(let n=t;n;n=n.parent)if(n==this)return t}posFromDOM(e,t,n){for(let r=e;r;r=r.parentNode){let i=this.getDesc(r);if(i)return i.localPosFromDOM(e,t,n)}return-1}descAt(e){for(let t=0,n=0;t<this.children.length;t++){let 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}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let n=0,r=0;for(let i=0;n<this.children.length;n++){let t=this.children[n],o=i+t.size;if(o>e||t instanceof Tn){r=e-i;break}i=o}if(r)return this.children[n].domFromPos(r-this.children[n].border,t);for(let i;n&&!(i=this.children[n-1]).size&&i instanceof yn&&i.side>=0;n--);if(t<=0){let e,r=!0;for(;e=n?this.children[n-1]:null,e&&e.dom.parentNode!=this.contentDOM;n--,r=!1);return e&&t&&r&&!e.border&&!e.domAtom?e.domFromPos(e.size,t):{node:this.contentDOM,offset:e?Ft(e.dom)+1:0}}{let e,r=!0;for(;e=n<this.children.length?this.children[n]:null,e&&e.dom.parentNode!=this.contentDOM;n++,r=!1);return e&&r&&!e.border&&!e.domAtom?e.domFromPos(0,t):{node:this.contentDOM,offset:e?Ft(e.dom):this.contentDOM.childNodes.length}}}parseRange(e,t){let 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};let r=-1,i=-1;for(let o=n,s=0;;s++){let n=this.children[s],a=o+n.size;if(-1==r&&e<=a){let i=o+n.border;if(e>=i&&t<=a-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(e,t,i);e=o;for(let t=s;t>0;t--){let n=this.children[t-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){r=Ft(n.dom)+1;break}e-=n.size}-1==r&&(r=0)}if(r>-1&&(a>t||s==this.children.length-1)){t=a;for(let e=s+1;e<this.children.length;e++){let n=this.children[e];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(-1)){i=Ft(n.dom);break}t+=n.size}-1==i&&(i=this.contentDOM.childNodes.length);break}o=a}return{node:this.contentDOM,from:e,to:t,fromOffset:r,toOffset:i}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return 0==t.size||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:n}=this.domFromPos(e,0);if(1!=t.nodeType||n==t.childNodes.length)throw new RangeError("No node after pos "+e);return t.childNodes[n]}setSelection(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=Math.min(e,t),o=Math.max(e,t);for(let d=0,h=0;d<this.children.length;d++){let s=this.children[d],a=h+s.size;if(i>h&&o<a)return s.setSelection(e-h-s.border,t-h-s.border,n,r);h=a}let s=this.domFromPos(e,e?-1:1),a=t==e?s:this.domFromPos(t,t?-1:1),l=n.getSelection(),c=!1;if((Nt||At)&&e==t){let{node:e,offset:t}=s;if(3==e.nodeType){if(c=!(!t||"\n"!=e.nodeValue[t-1]),c&&t==e.nodeValue.length)for(let n,r=e;r;r=r.parentNode){if(n=r.nextSibling){"BR"==n.nodeName&&(s=a={node:n.parentNode,offset:Ft(n)+1});break}let e=r.pmViewDesc;if(e&&e.node&&e.node.isBlock)break}}else{let n=e.childNodes[t-1];c=n&&("BR"==n.nodeName||"false"==n.contentEditable)}}if(Nt&&l.focusNode&&l.focusNode!=a.node&&1==l.focusNode.nodeType){let e=l.focusNode.childNodes[l.focusOffset];e&&"false"==e.contentEditable&&(r=!0)}if(!(r||c&&At)&&jt(s.node,s.offset,l.anchorNode,l.anchorOffset)&&jt(a.node,a.offset,l.focusNode,l.focusOffset))return;let u=!1;if((l.extend||e==t)&&!c){l.collapse(s.node,s.offset);try{e!=t&&l.extend(a.node,a.offset),u=!0}catch(p){if(!(p instanceof DOMException))throw p}}if(!u){if(e>t){let e=s;s=a,a=e}let n=document.createRange();n.setEnd(a.node,a.offset),n.setStart(s.node,s.offset),l.removeAllRanges(),l.addRange(n)}}ignoreMutation(e){return!this.contentDOM&&"selection"!=e.type}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let n=0,r=0;r<this.children.length;r++){let i=this.children[r],o=n+i.size;if(n==o?e<=o&&t>=n:e<o&&t>n){let r=n+i.border,s=o-i.border;if(e>=r&&t<=s)return this.dirty=e==n||t==o?2:1,void(e!=r||t!=s||!i.contentLost&&i.dom.parentNode==this.contentDOM?i.markDirty(e-r,t-r):i.dirty=3);i.dirty=i.dom!=i.contentDOM||i.dom.parentNode!=this.contentDOM||i.children.length?3:2}n=o}this.dirty=2}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=1==e?2:1;t.dirty<n&&(t.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}}class yn extends vn{constructor(e,t,n,r){let i,o=t.type.toDOM;if("function"==typeof o&&(o=o(n,(()=>i?i.parent?i.parent.posBeforeChild(i):void 0:r))),!t.type.spec.raw){if(1!=o.nodeType){let e=document.createElement("span");e.appendChild(o),o=e}o.contentEditable="false",o.classList.add("ProseMirror-widget")}super(e,[],o,null),this.widget=t,this.widget=t,i=this}matchesWidget(e){return 0==this.dirty&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return!!t&&t(e)}ignoreMutation(e){return"selection"!=e.type||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class bn extends vn{constructor(e,t,n,r){super(e,[],t,null),this.textDOM=n,this.text=r}get size(){return this.text.length}localPosFromDOM(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return"characterData"===e.type&&e.target.nodeValue==e.oldValue}}class wn extends vn{constructor(e,t,n,r){super(e,[],n,r),this.mark=t}static create(e,t,n,r){let i=r.nodeViews[t.type.name],o=i&&i(t,r,n);return o&&o.dom||(o=ce.renderSpec(document,t.type.spec.toDOM(t,n))),new wn(e,t,o.dom,o.contentDOM||o.dom)}parseRule(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM||void 0}}matchesMark(e){return 3!=this.dirty&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),0!=this.dirty){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty<this.dirty&&(e.dirty=this.dirty),this.dirty=0}}slice(e,t,n){let r=wn.create(this.parent,this.mark,!0,n),i=this.children,o=this.size;t<o&&(i=Fn(i,t,o,n)),e>0&&(i=Fn(i,0,e,n));for(let s=0;s<i.length;s++)i[s].parent=r;return r.children=i,r}}class kn extends vn{constructor(e,t,n,r,i,o,s,a,l){super(e,[],i,o),this.node=t,this.outerDeco=n,this.innerDeco=r,this.nodeDOM=s,o&&this.updateChildren(a,l)}static create(e,t,n,r,i,o){let s,a=i.nodeViews[t.type.name],l=a&&a(t,i,(()=>s?s.parent?s.parent.posBeforeChild(s):void 0:o),n,r),c=l&&l.dom,u=l&&l.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 c||({dom:c,contentDOM:u}=ce.renderSpec(document,t.type.spec.toDOM(t)));u||t.isText||"BR"==c.nodeName||(c.hasAttribute("contenteditable")||(c.contentEditable="false"),t.type.spec.draggable&&(c.draggable=!0));let p=c;return c=On(c,n,t),l?s=new En(e,t,n,r,c,u||null,p,l,i,o+1):t.isText?new Cn(e,t,n,r,c,p,i):new kn(e,t,n,r,c,u||null,p,i,o+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(e.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){for(let t=this.children.length-1;t>=0;t--){let n=this.children[t];if(this.dom.contains(n.dom.parentNode)){e.contentElement=n.dom.parentNode;break}}e.contentElement||(e.getContent=()=>c.empty)}else e.contentElement=this.contentDOM;else e.getContent=()=>this.node.content;return e}matchesNode(e,t,n){return 0==this.dirty&&e.eq(this.node)&&In(t,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,t){let n=this.node.inlineContent,r=t,i=e.composing?this.localCompositionInfo(e,t):null,o=i&&i.pos>-1?i:null,s=i&&i.pos<0,a=new Pn(this,o&&o.node,e);!function(e,t,n,r){let i=t.locals(e),o=0;if(0==i.length){for(let n=0;n<e.childCount;n++){let s=e.child(n);r(s,i,t.forChild(o,s),n),o+=s.nodeSize}return}let s=0,a=[],l=null;for(let c=0;;){if(s<i.length&&i[s].to==o){let e,t=i[s++];for(;s<i.length&&i[s].to==o;)(e||(e=[t])).push(i[s++]);if(e){e.sort(Bn);for(let t=0;t<e.length;t++)n(e[t],c,!!l)}else n(t,c,!!l)}let u,p;if(l)p=-1,u=l,l=null;else{if(!(c<e.childCount))break;p=c,u=e.child(c++)}for(let e=0;e<a.length;e++)a[e].to<=o&&a.splice(e--,1);for(;s<i.length&&i[s].from<=o&&i[s].to>o;)a.push(i[s++]);let d=o+u.nodeSize;if(u.isText){let e=d;s<i.length&&i[s].from<e&&(e=i[s].from);for(let t=0;t<a.length;t++)a[t].to<e&&(e=a[t].to);e<d&&(l=u.cut(e-o),u=u.cut(0,e-o),d=e,p=-1)}r(u,u.isInline&&!u.isLeaf?a.filter((e=>!e.inline)):a.slice(),t.forChild(o,u),p),o=d}}(this.node,this.innerDeco,((t,i,o)=>{t.spec.marks?a.syncToMarks(t.spec.marks,n,e):t.type.side>=0&&!o&&a.syncToMarks(i==this.node.childCount?h.none:this.node.child(i).marks,n,e),a.placeWidget(t,e,r)}),((t,o,l,c)=>{let u;a.syncToMarks(t.marks,n,e),a.findNodeMatch(t,o,l,c)||s&&e.state.selection.from>r&&e.state.selection.to<r+t.nodeSize&&(u=a.findIndexWithChild(i.node))>-1&&a.updateNodeAt(t,o,l,u,e)||a.updateNextNode(t,o,l,e,c)||a.addNode(t,o,l,e,r),r+=t.nodeSize})),a.syncToMarks([],n,e),this.node.isTextblock&&a.addTextblockHacks(),a.destroyRest(),(a.changed||2==this.dirty)&&(o&&this.protectLocalComposition(e,o),Mn(this.contentDOM,this.children,e),Ot&&function(e){if("UL"==e.nodeName||"OL"==e.nodeName){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}(this.dom))}localCompositionInfo(e,t){let{from:n,to:r}=e.state.selection;if(!(e.state.selection instanceof et)||n<t||r>t+this.node.content.size)return null;let i=e.domSelection(),o=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=Ut(e=e.childNodes[t-1])}else{if(!(1==e.nodeType&&t<e.childNodes.length))return null;e=e.childNodes[t],t=0}}}(i.focusNode,i.focusOffset);if(!o||!this.dom.contains(o.parentNode))return null;if(this.node.inlineContent){let e=o.nodeValue,i=function(e,t,n,r){for(let i=0,o=0;i<e.childCount&&o<=r;){let s=e.child(i++),a=o;if(o+=s.nodeSize,!s.isText)continue;let l=s.text;for(;i<e.childCount;){let t=e.child(i++);if(o+=t.nodeSize,!t.isText)break;l+=t.text}if(o>=n){let e=a<r?l.lastIndexOf(t,r-a-1):-1;if(e>=0&&e+t.length+a>=n)return a+e;if(n==r&&l.length>=r+t.length-a&&l.slice(r-a,r-a+t.length)==t)return r}}return-1}(this.node.content,e,n-t,r-t);return i<0?null:{node:o,pos:i,text:e}}return{node:o,pos:-1,text:""}}protectLocalComposition(e,t){let{node:n,pos:r,text:i}=t;if(this.getDesc(n))return;let o=n;for(;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)}let s=new bn(this,o,n,i);e.input.compositionNodes.push(s),this.children=Fn(this.children,r,r+i.length,e,s)}update(e,t,n,r){return!(3==this.dirty||!e.sameMarkup(this.node))&&(this.updateInner(e,t,n,r),!0)}updateInner(e,t,n,r){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=0}updateOuterDeco(e){if(In(e,this.outerDeco))return;let t=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=Ln(this.dom,this.nodeDOM,Dn(this.outerDeco,this.node,t),Dn(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.dom.draggable=!0)}deselectNode(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||this.dom.removeAttribute("draggable")}get domAtom(){return this.node.isAtom}}function xn(e,t,n,r,i){return On(r,t,e),new kn(void 0,e,t,n,r,r,r,i,0)}class Cn extends kn{constructor(e,t,n,r,i,o,s){super(e,t,n,r,i,null,o,s,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(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)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,n){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,n)}ignoreMutation(e){return"characterData"!=e.type&&"selection"!=e.type}slice(e,t,n){let r=this.node.cut(e,t),i=document.createTextNode(r.text);return new Cn(this.parent,r,this.outerDeco,this.innerDeco,i,i,n)}markDirty(e,t){super.markDirty(e,t),this.dom==this.nodeDOM||0!=e&&t!=this.nodeDOM.nodeValue.length||(this.dirty=3)}get domAtom(){return!1}}class Tn extends vn{parseRule(){return{ignore:!0}}matchesHack(e){return 0==this.dirty&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return"IMG"==this.dom.nodeName}}class En extends kn{constructor(e,t,n,r,i,o,s,a,l,c){super(e,t,n,r,i,o,s,l,c),this.spec=a}update(e,t,n,r){if(3==this.dirty)return!1;if(this.spec.update){let i=this.spec.update(e,t,n);return i&&this.updateInner(e,t,n,r),i}return!(!this.contentDOM&&!e.isLeaf)&&super.update(e,t,n,r)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,n,r){this.spec.setSelection?this.spec.setSelection(e,t,n):super.setSelection(e,t,n,r)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return!!this.spec.stopEvent&&this.spec.stopEvent(e)}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function Mn(e,t,n){let r=e.firstChild,i=!1;for(let o=0;o<t.length;o++){let s=t[o],a=s.dom;if(a.parentNode==e){for(;a!=r;)r=Rn(r),i=!0;r=r.nextSibling}else i=!0,e.insertBefore(a,r);if(s instanceof wn){let t=r?r.previousSibling:e.lastChild;Mn(s.contentDOM,s.children,n),r=t?t.nextSibling:e.firstChild}}for(;r;)r=Rn(r),i=!0;i&&n.trackWrites==e&&(n.trackWrites=null)}const Nn=function(e){e&&(this.nodeName=e)};Nn.prototype=Object.create(null);const Sn=[new Nn];function Dn(e,t,n){if(0==e.length)return Sn;let r=n?Sn[0]:new Nn,i=[r];for(let o=0;o<e.length;o++){let s=e[o].type.attrs;if(s){s.nodeName&&i.push(r=new Nn(s.nodeName));for(let e in s){let o=s[e];null!=o&&(n&&1==i.length&&i.push(r=new Nn(t.isInline?"span":"div")),"class"==e?r.class=(r.class?r.class+" ":"")+o:"style"==e?r.style=(r.style?r.style+";":"")+o:"nodeName"!=e&&(r[e]=o))}}}return i}function Ln(e,t,n,r){if(n==Sn&&r==Sn)return t;let i=t;for(let o=0;o<r.length;o++){let t=r[o],s=n[o];if(o){let n;s&&s.nodeName==t.nodeName&&i!=e&&(n=i.parentNode)&&n.nodeName.toLowerCase()==t.nodeName||(n=document.createElement(t.nodeName),n.pmIsDeco=!0,n.appendChild(i),s=Sn[0]),i=n}An(i,s||Sn[0],t)}return i}function An(e,t,n){for(let r in t)"class"==r||"style"==r||"nodeName"==r||r in n||e.removeAttribute(r);for(let r in n)"class"!=r&&"style"!=r&&"nodeName"!=r&&n[r]!=t[r]&&e.setAttribute(r,n[r]);if(t.class!=n.class){let r=t.class?t.class.split(" ").filter(Boolean):[],i=n.class?n.class.split(" ").filter(Boolean):[];for(let t=0;t<r.length;t++)-1==i.indexOf(r[t])&&e.classList.remove(r[t]);for(let t=0;t<i.length;t++)-1==r.indexOf(i[t])&&e.classList.add(i[t]);0==e.classList.length&&e.removeAttribute("class")}if(t.style!=n.style){if(t.style){let n,r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g;for(;n=r.exec(t.style);)e.style.removeProperty(n[1])}n.style&&(e.style.cssText+=n.style)}}function On(e,t,n){return Ln(e,e,Sn,Dn(t,n,1!=e.nodeType))}function In(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function Rn(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class Pn{constructor(e,t,n){this.lock=t,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=function(e,t){let n=t,r=n.children.length,i=e.childCount,o=new Map,s=[];e:for(;i>0;){let a;for(;;)if(r){let e=n.children[r-1];if(!(e instanceof wn)){a=e,r--;break}n=e,r=e.children.length}else{if(n==t)break e;r=n.parent.children.indexOf(n),n=n.parent}let l=a.node;if(l){if(l!=e.child(i-1))break;--i,o.set(a,i),s.push(a)}}return{index:i,matched:o,matches:s.reverse()}}(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let n=e;n<t;n++)this.top.children[n].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,n){let r=0,i=this.stack.length>>1,o=Math.min(i,e.length);for(;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);let r=-1;for(let t=this.index;t<Math.min(this.index+3,this.top.children.length);t++)if(this.top.children[t].matchesMark(e[i])){r=t;break}if(r>-1)r>this.index&&(this.changed=!0,this.destroyBetween(this.index,r)),this.top=this.top.children[this.index];else{let r=wn.create(this.top,e[i],t,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,i++}}findNodeMatch(e,t,n,r){let 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(let s=this.index,a=Math.min(this.top.children.length,s+5);s<a;s++){let r=this.top.children[s];if(r.matchesNode(e,t,n)&&!this.preMatch.matched.has(r)){o=s;break}}return!(o<0)&&(this.destroyBetween(this.index,o),this.index++,!0)}updateNodeAt(e,t,n,r,i){let 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)}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return-1;if(t==this.top.contentDOM){let t=e.pmViewDesc;if(t)for(let e=this.index;e<this.top.children.length;e++)if(this.top.children[e]==t)return e;return-1}e=t}}updateNextNode(e,t,n,r,i){for(let o=this.index;o<this.top.children.length;o++){let s=this.top.children[o];if(s instanceof kn){let a=this.preMatch.matched.get(s);if(null!=a&&a!=i)return!1;let l=s.dom;if(!(this.lock&&(l==this.lock||1==l.nodeType&&l.contains(this.lock.parentNode))&&!(e.isText&&s.node&&s.node.isText&&s.nodeDOM.nodeValue==e.text&&3!=s.dirty&&In(t,s.outerDeco)))&&s.update(e,t,n,r))return this.destroyBetween(this.index,o),s.dom!=l&&(this.changed=!0),this.index++,!0;break}}return!1}addNode(e,t,n,r,i){this.top.children.splice(this.index++,0,kn.create(this.top,e,t,n,r,i)),this.changed=!0}placeWidget(e,t,n){let 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){let r=new yn(this.top,e,t,n);this.top.children.splice(this.index++,0,r),this.changed=!0}else this.index++}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof wn;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof Cn)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((At||Dt)&&e&&"false"==e.dom.contentEditable&&this.addHackNode("IMG",t),this.addHackNode("BR",this.top))}addHackNode(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{let n=document.createElement(e);"IMG"==e&&(n.className="ProseMirror-separator",n.alt=""),"BR"==e&&(n.className="ProseMirror-trailingBreak");let r=new Tn(this.top,[],n,null);t!=this.top?t.children.push(r):t.children.splice(this.index++,0,r),this.changed=!0}}}function Bn(e,t){return e.type.side-t.type.side}function Fn(e,t,n,r,i){let o=[];for(let s=0,a=0;s<e.length;s++){let l=e[s],c=a,u=a+=l.size;c>=n||u<=t?o.push(l):(c<t&&o.push(l.slice(0,t-c,r)),i&&(o.push(i),i=void 0),u>n&&o.push(l.slice(n-c,l.size,r)))}return o}function Hn(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=e.domSelection(),r=e.state.doc;if(!n.focusNode)return null;let i=e.docView.nearestDesc(n.focusNode),o=i&&0==i.size,s=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let a,l,c=r.resolve(s);if(Wt(n)){for(a=c;i&&!i.node;)i=i.parent;let e=i.node;if(i&&e.isAtom&&nt.isSelectable(e)&&i.parent&&(!e.isInline||!function(e,t,n){for(let r=0==t,i=t==Ut(e);r||i;){if(e==n)return!0;let t=Ft(e);if(!(e=e.parentNode))return!1;r=r&&0==t,i=i&&t==Ut(e)}}(n.focusNode,n.focusOffset,i.dom))){let e=i.posBefore;l=new nt(s==e?c:r.resolve(e))}}else{let t=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(t<0)return null;a=r.resolve(t)}if(!l){l=Gn(e,a,c,"pointer"==t||e.state.selection.head<c.pos&&!o?1:-1)}return l}function qn(e){return e.editable?e.hasFocus():Kn(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function zn(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.state.selection;if($n(e,n),qn(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&Dt){let t=e.domSelection(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&jt(t.anchorNode,t.anchorOffset,n.anchorNode,n.anchorOffset))return e.input.mouseDown.delayedSelectionSync=!0,void e.domObserver.setCurSelection()}if(e.domObserver.disconnectSelection(),e.cursorWrapper)!function(e){let t=e.domSelection(),n=document.createRange(),r=e.cursorWrapper.dom,i="IMG"==r.nodeName;i?n.setEnd(r.parentNode,Ft(r)+1):n.setEnd(r,0);n.collapse(!1),t.removeAllRanges(),t.addRange(n),!i&&!e.state.selection.visible&&Et&&Mt<=11&&(r.disabled=!0,r.disabled=!1)}(e);else{let r,i,{anchor:o,head:s}=n;!jn||n instanceof et||(n.$from.parent.inlineContent||(r=Vn(e,n.from)),n.empty||n.$from.parent.inlineContent||(i=Vn(e,n.to))),e.docView.setSelection(o,s,e.root,t),jn&&(r&&Un(r),i&&Un(i)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&function(e){let t=e.dom.ownerDocument;t.removeEventListener("selectionchange",e.input.hideSelectionGuard);let n=e.domSelection(),r=n.anchorNode,i=n.anchorOffset;t.addEventListener("selectionchange",e.input.hideSelectionGuard=()=>{n.anchorNode==r&&n.anchorOffset==i||(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout((()=>{qn(e)&&!e.state.selection.visible||e.dom.classList.remove("ProseMirror-hideselection")}),20))})}(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}const jn=At||Dt&&Lt<63;function Vn(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),i=r<n.childNodes.length?n.childNodes[r]:null,o=r?n.childNodes[r-1]:null;if(At&&i&&"false"==i.contentEditable)return _n(i);if((!i||"false"==i.contentEditable)&&(!o||"false"==o.contentEditable)){if(i)return _n(i);if(o)return _n(o)}}function _n(e){return e.contentEditable="true",At&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function Un(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function $n(e,t){if(t instanceof nt){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(Wn(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else Wn(e)}function Wn(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function Gn(e,t,n,r){return e.someProp("createSelectionBetween",(r=>r(e,t,n)))||et.between(t,n,r)}function Jn(e){return(!e.editable||e.root.activeElement==e.dom)&&Kn(e)}function Kn(e){let 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 Zn(e,t){let{$anchor:n,$head:r}=e.selection,i=t>0?n.max(r):n.min(r),o=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return o&&Ze.findFrom(o,t)}function Xn(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function Qn(e,t,n){let r=e.state.selection;if(!(r instanceof et)){if(r instanceof nt&&r.node.isInline)return Xn(e,new et(t>0?r.$to:r.$from));{let n=Zn(e.state,t);return!!n&&Xn(e,n)}}if(!r.empty||n.indexOf("s")>-1)return!1;if(e.endOfTextblock(t>0?"right":"left")){let n=Zn(e.state,t);return!!(n&&n instanceof nt)&&Xn(e,n)}if(!(It&&n.indexOf("m")>-1)){let n,i=r.$head,o=i.textOffset?null:t<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText)return!1;let s=t<0?i.pos-o.nodeSize:i.pos;return!!(o.isAtom||(n=e.docView.descAt(s))&&!n.contentDOM)&&(nt.isSelectable(o)?Xn(e,new nt(t<0?e.state.doc.resolve(i.pos-o.nodeSize):i)):!!Pt&&Xn(e,new et(e.state.doc.resolve(t<0?s:s+o.nodeSize))))}}function Yn(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function er(e){let t=e.pmViewDesc;return t&&0==t.size&&(e.nextSibling||"BR"!=e.nodeName)}function tr(e){let t=e.domSelection(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,o,s=!1;for(Nt&&1==n.nodeType&&r<Yn(n)&&er(n.childNodes[r])&&(s=!0);;)if(r>0){if(1!=n.nodeType)break;{let e=n.childNodes[r-1];if(er(e))i=n,o=--r;else{if(3!=e.nodeType)break;n=e,r=n.nodeValue.length}}}else{if(rr(n))break;{let t=n.previousSibling;for(;t&&er(t);)i=n.parentNode,o=Ft(t),t=t.previousSibling;if(t)n=t,r=Yn(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}}s?ir(e,t,n,r):i&&ir(e,t,i,o)}function nr(e){let t=e.domSelection(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,o,s=Yn(n);for(;;)if(r<s){if(1!=n.nodeType)break;if(!er(n.childNodes[r]))break;i=n,o=++r}else{if(rr(n))break;{let t=n.nextSibling;for(;t&&er(t);)i=t.parentNode,o=Ft(t)+1,t=t.nextSibling;if(t)n=t,r=0,s=Yn(n);else{if(n=n.parentNode,n==e.dom)break;r=s=0}}}i&&ir(e,t,i,o)}function rr(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function ir(e,t,n,r){if(Wt(t)){let e=document.createRange();e.setEnd(n,r),e.setStart(n,r),t.removeAllRanges(),t.addRange(e)}else t.extend&&t.extend(n,r);e.domObserver.setCurSelection();let{state:i}=e;setTimeout((()=>{e.state==i&&zn(e)}),50)}function or(e,t,n){let r=e.state.selection;if(r instanceof et&&!r.empty||n.indexOf("s")>-1)return!1;if(It&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let n=Zn(e.state,t);if(n&&n instanceof nt)return Xn(e,n)}if(!i.parent.inlineContent){let n=t<0?i:o,s=r instanceof it?Ze.near(n,t):Ze.findFrom(n,t);return!!s&&Xn(e,s)}return!1}function sr(e,t){if(!(e.state.selection instanceof et))return!0;let{$head:n,$anchor:r,empty:i}=e.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let o=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(o&&!o.isText){let r=e.state.tr;return t<0?r.delete(n.pos-o.nodeSize,n.pos):r.delete(n.pos,n.pos+o.nodeSize),e.dispatch(r),!0}return!1}function ar(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function lr(e,t){let n=t.keyCode,r=function(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}(t);return 8==n||It&&72==n&&"c"==r?sr(e,-1)||tr(e):46==n||It&&68==n&&"c"==r?sr(e,1)||nr(e):13==n||27==n||(37==n||It&&66==n&&"c"==r?Qn(e,-1,r)||tr(e):39==n||It&&70==n&&"c"==r?Qn(e,1,r)||nr(e):38==n||It&&80==n&&"c"==r?or(e,-1,r)||tr(e):40==n||It&&78==n&&"c"==r?function(e){if(!At||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelection();if(t&&1==t.nodeType&&0==n&&t.firstChild&&"false"==t.firstChild.contentEditable){let n=t.firstChild;ar(e,n,"true"),setTimeout((()=>ar(e,n,"false")),20)}return!1}(e)||or(e,1,r)||nr(e):r==(It?"m":"c")&&(66==n||73==n||89==n||90==n))}function cr(e,t){let n=[],{content:r,openStart:i,openEnd:o}=t;for(;i>1&&o>1&&1==r.childCount&&1==r.firstChild.childCount;){i--,o--;let e=r.firstChild;n.push(e.type.name,e.attrs!=e.type.defaultAttrs?e.attrs:null),r=e.content}let s=e.someProp("clipboardSerializer")||ce.fromSchema(e.state.schema),a=br(),l=a.createElement("div");l.appendChild(s.serializeFragment(r,{document:a}));let c,u=l.firstChild,p=0;for(;u&&1==u.nodeType&&(c=vr[u.nodeName.toLowerCase()]);){for(let e=c.length-1;e>=0;e--){let t=a.createElement(c[e]);for(;l.firstChild;)t.appendChild(l.firstChild);l.appendChild(t),p++}u=l.firstChild}return u&&1==u.nodeType&&u.setAttribute("data-pm-slice","".concat(i," ").concat(o).concat(p?" -".concat(p):""," ").concat(JSON.stringify(n))),{dom:l,text:e.someProp("clipboardTextSerializer",(e=>e(t)))||t.content.textBetween(0,t.content.size,"\n\n")}}function ur(e,t,n,r,i){let o,s,a=i.parent.type.spec.code;if(!n&&!t)return null;let l=t&&(r||a||!n);if(l){if(e.someProp("transformPastedText",(e=>{t=e(t,a||r)})),a)return t?new m(c.from(e.state.schema.text(t.replace(/\r\n?/g,"\n"))),0,0):m.empty;let n=e.someProp("clipboardTextParser",(e=>e(t,i,r)));if(n)s=n;else{let n=i.marks(),{schema:r}=e.state,s=ce.fromSchema(r);o=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach((e=>{let t=o.appendChild(document.createElement("p"));e&&t.appendChild(s.serializeNode(r.text(e,n)))}))}}else e.someProp("transformPastedHTML",(e=>{n=e(n)})),o=function(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n,r=br().createElement("div"),i=/<([a-z][^>\s]+)/i.exec(e);(n=i&&vr[i[1].toLowerCase()])&&(e=n.map((e=>"<"+e+">")).join("")+e+n.map((e=>"</"+e+">")).reverse().join(""));if(r.innerHTML=e,n)for(let o=0;o<n.length;o++)r=r.querySelector(n[o])||r;return r}(n),Pt&&function(e){let t=e.querySelectorAll(Dt?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let r=t[n];1==r.childNodes.length&&"\xa0"==r.textContent&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),r)}}(o);let u=o&&o.querySelector("[data-pm-slice]"),p=u&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(u.getAttribute("data-pm-slice")||"");if(p&&p[3])for(let c=+p[3];c>0&&o.firstChild;c--)o=o.firstChild;if(!s){let t=e.someProp("clipboardParser")||e.someProp("domParser")||Y.fromSchema(e.state.schema);s=t.parseSlice(o,{preserveWhitespace:!(!l&&!p),context:i,ruleFromNode:e=>"BR"!=e.nodeName||e.nextSibling||!e.parentNode||pr.test(e.parentNode.nodeName)?null:{ignore:!0}})}if(p)s=function(e,t){if(!e.size)return e;let n,r=e.content.firstChild.type.schema;try{n=JSON.parse(t)}catch(a){return e}let{content:i,openStart:o,openEnd:s}=e;for(let l=n.length-2;l>=0;l-=2){let e=r.nodes[n[l]];if(!e||e.hasRequiredAttrs())break;i=c.from(e.create(n[l+1],i)),o++,s++}return new m(i,o,s)}(gr(s,+p[1],+p[2]),p[4]);else if(s=m.maxOpen(function(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r,i=t.node(n).contentMatchAt(t.index(n)),o=[];if(e.forEach((e=>{if(!o)return;let t,n=i.findWrapping(e.type);if(!n)return o=null;if(t=o.length&&r.length&&hr(n,r,e,o[o.length-1],0))o[o.length-1]=t;else{o.length&&(o[o.length-1]=fr(o[o.length-1],r.length));let t=dr(e,n);o.push(t),i=i.matchType(t.type),r=n}})),o)return c.from(o)}return e}(s.content,i),!0),s.openStart||s.openEnd){let e=0,t=0;for(let n=s.content.firstChild;e<s.openStart&&!n.type.spec.isolating;e++,n=n.firstChild);for(let n=s.content.lastChild;t<s.openEnd&&!n.type.spec.isolating;t++,n=n.lastChild);s=gr(s,e,t)}return e.someProp("transformPasted",(e=>{s=e(s)})),s}const pr=/^(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 dr(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;for(let r=t.length-1;r>=n;r--)e=t[r].create(null,c.from(e));return e}function hr(e,t,n,r,i){if(i<e.length&&i<t.length&&e[i]==t[i]){let o=hr(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(c.from(dr(n,e,i+1))))}}function fr(e,t){if(0==t)return e;let n=e.content.replaceChild(e.childCount-1,fr(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(c.empty,!0);return e.copy(n.append(r))}function mr(e,t,n,r,i,o){let s=t<0?e.firstChild:e.lastChild,a=s.content;return i<r-1&&(a=mr(a,t,n,r,i+1,o)),i>=n&&(a=t<0?s.contentMatchAt(0).fillBefore(a,e.childCount>1||o<=i).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(c.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,s.copy(a))}function gr(e,t,n){return t<e.openStart&&(e=new m(mr(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new m(mr(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const vr={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let yr=null;function br(){return yr||(yr=document.implementation.createHTMLDocument("title"))}const wr={},kr={},xr={touchstart:!0,touchmove:!0};class Cr{constructor(){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 Tr(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function Er(e){e.someProp("handleDOMEvents",(t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>Mr(e,t))}))}function Mr(e,t){return e.someProp("handleDOMEvents",(n=>{let r=n[t.type];return!!r&&(r(e,t)||t.defaultPrevented)}))}function Nr(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function Sr(e){return{left:e.clientX,top:e.clientY}}function Dr(e,t,n,r,i){if(-1==r)return!1;let o=e.state.doc.resolve(r);for(let s=o.depth+1;s>0;s--)if(e.someProp(t,(t=>s>o.depth?t(e,n,o.nodeAfter,o.before(s),i,!0):t(e,n,o.node(s),o.before(s),i,!1))))return!0;return!1}function Lr(e,t,n){e.focused||e.focus();let r=e.state.tr.setSelection(t);"pointer"==n&&r.setMeta("pointer",!0),e.dispatch(r)}function Ar(e,t,n,r,i){return Dr(e,"handleClickOn",t,n,r)||e.someProp("handleClick",(n=>n(e,t,r)))||(i?function(e,t){if(-1==t)return!1;let n,r,i=e.state.selection;i instanceof nt&&(n=i.node);let o=e.state.doc.resolve(t);for(let s=o.depth+1;s>0;s--){let e=s>o.depth?o.nodeAfter:o.node(s);if(nt.isSelectable(e)){r=n&&i.$from.depth>0&&s>=i.$from.depth&&o.before(i.$from.depth+1)==i.$from.pos?o.before(i.$from.depth):o.before(s);break}}return null!=r&&(Lr(e,nt.create(e.state.doc,r),"pointer"),!0)}(e,n):function(e,t){if(-1==t)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return!!(r&&r.isAtom&&nt.isSelectable(r))&&(Lr(e,new nt(n),"pointer"),!0)}(e,n))}function Or(e,t,n,r){return Dr(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",(n=>n(e,t,r)))}function Ir(e,t,n,r){return Dr(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",(n=>n(e,t,r)))||function(e,t,n){if(0!=n.button)return!1;let r=e.state.doc;if(-1==t)return!!r.inlineContent&&(Lr(e,et.create(r,0,r.content.size),"pointer"),!0);let i=r.resolve(t);for(let o=i.depth+1;o>0;o--){let t=o>i.depth?i.nodeAfter:i.node(o),n=i.before(o);if(t.inlineContent)Lr(e,et.create(r,n+1,n+1+t.content.size),"pointer");else{if(!nt.isSelectable(t))continue;Lr(e,nt.create(r,n),"pointer")}return!0}}(e,n,r)}function Rr(e){return jr(e)}kr.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=16==n.keyCode||n.shiftKey,!Fr(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!Rt||!Dt||13!=n.keyCode))if(229!=n.keyCode&&e.domObserver.forceFlush(),!Ot||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)e.someProp("handleKeyDown",(t=>t(e,n)))||lr(e,n)?n.preventDefault():Tr(e,"key");else{let t=Date.now();e.input.lastIOSEnter=t,e.input.lastIOSEnterFallbackTimeout=setTimeout((()=>{e.input.lastIOSEnter==t&&(e.someProp("handleKeyDown",(t=>t(e,Gt(13,"Enter")))),e.input.lastIOSEnter=0)}),200)}},kr.keyup=(e,t)=>{16==t.keyCode&&(e.input.shiftKey=!1)},kr.keypress=(e,t)=>{let n=t;if(Fr(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||It&&n.metaKey)return;if(e.someProp("handleKeyPress",(t=>t(e,n))))return void n.preventDefault();let r=e.state.selection;if(!(r instanceof et)||!r.$from.sameParent(r.$to)){let t=String.fromCharCode(n.charCode);e.someProp("handleTextInput",(n=>n(e,r.$from.pos,r.$to.pos,t)))||e.dispatch(e.state.tr.insertText(t).scrollIntoView()),n.preventDefault()}};const Pr=It?"metaKey":"ctrlKey";wr.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=Rr(e),i=Date.now(),o="singleClick";i-e.input.lastClick.time<500&&function(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}(n,e.input.lastClick)&&!n[Pr]&&("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};let s=e.posAtCoords(Sr(n));s&&("singleClick"==o?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new Br(e,s,n,!!r)):("doubleClick"==o?Or:Ir)(e,s.pos,s.inside,n)?n.preventDefault():Tr(e,"pointer"))};class Br{constructor(e,t,n,r){let i,o;if(this.view=e,this.pos=t,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!n[Pr],this.allowDefault=n.shiftKey,t.inside>-1)i=e.state.doc.nodeAt(t.inside),o=t.inside;else{let n=e.state.doc.resolve(t.pos);i=n.parent,o=n.depth?n.before():0}const s=r?null:n.target,a=s?e.docView.nearestDesc(s,!0):null;this.target=a?a.dom:null;let{selection:l}=e.state;(0==n.button&&i.type.spec.draggable&&!1!==i.type.spec.selectable||l instanceof nt&&l.from<=o&&l.to>o)&&(this.mightDrag={node:i,pos:o,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!Nt||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((()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")}),20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),Tr(e,"pointer")}done(){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((()=>zn(this.view))),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(Sr(e))),this.updateAllowDefault(e),this.allowDefault||!t?Tr(this.view,"pointer"):Ar(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():0==e.button&&(this.flushed||At&&this.mightDrag&&!this.mightDrag.node.isAtom||Dt&&!(this.view.state.selection instanceof et)&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(Lr(this.view,Ze.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):Tr(this.view,"pointer")}move(e){this.updateAllowDefault(e),Tr(this.view,"pointer"),0==e.buttons&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}function Fr(e,t){return!!e.composing||!!(At&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500)&&(e.input.compositionEndedAt=-2e8,!0)}wr.touchstart=e=>{e.input.lastTouch=Date.now(),Rr(e),Tr(e,"pointer")},wr.touchmove=e=>{e.input.lastTouch=Date.now(),Tr(e,"pointer")},wr.contextmenu=e=>Rr(e);const Hr=Rt?5e3:-1;function qr(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout((()=>jr(e)),t))}function zr(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=function(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function jr(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!(Rt&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),zr(e),t||e.docView&&e.docView.dirty){let t=Hn(e);return t&&!t.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(t)):e.updateState(e.state),!0}return!1}}kr.compositionstart=kr.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$from;if(t.selection.empty&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some((e=>!1===e.type.spec.inclusive))))e.markCursor=e.state.storedMarks||n.marks(),jr(e,!0),e.markCursor=null;else if(jr(e),Nt&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelection();for(let e=t.focusNode,n=t.focusOffset;e&&1==e.nodeType&&0!=n;){let r=n<0?e.lastChild:e.childNodes[n-1];if(!r)break;if(3==r.nodeType){t.collapse(r,r.nodeValue.length);break}e=r,n=-1}}e.input.composing=!0}qr(e,Hr)},kr.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,qr(e,20))};const Vr=Et&&Mt<15||Ot&&Bt<604;function _r(e,t,n,r){let i=ur(e,t,n,e.input.shiftKey,e.state.selection.$from);if(e.someProp("handlePaste",(t=>t(e,r,i||m.empty))))return!0;if(!i)return!1;let o=function(e){return 0==e.openStart&&0==e.openEnd&&1==e.content.childCount?e.content.firstChild:null}(i),s=o?e.state.tr.replaceSelectionWith(o,e.input.shiftKey):e.state.tr.replaceSelection(i);return e.dispatch(s.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}wr.copy=kr.cut=(e,t)=>{let n=t,r=e.state.selection,i="cut"==n.type;if(r.empty)return;let o=Vr?null:n.clipboardData,s=r.content(),{dom:a,text:l}=cr(e,s);o?(n.preventDefault(),o.clearData(),o.setData("text/html",a.innerHTML),o.setData("text/plain",l)):function(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout((()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()}),50)}(e,a),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},kr.paste=(e,t)=>{let n=t;if(e.composing&&!Rt)return;let r=Vr?null:n.clipboardData;r&&_r(e,r.getData("text/plain"),r.getData("text/html"),n)?n.preventDefault():function(e,t){if(!e.dom.parentNode)return;let 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((()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?_r(e,r.value,null,t):_r(e,r.textContent,r.innerHTML,t)}),50)}(e,n)};class Ur{constructor(e,t){this.slice=e,this.move=t}}const $r=It?"altKey":"ctrlKey";wr.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=e.state.selection,o=i.empty?null:e.posAtCoords(Sr(n));if(o&&o.pos>=i.from&&o.pos<=(i instanceof nt?i.to-1:i.to));else if(r&&r.mightDrag)e.dispatch(e.state.tr.setSelection(nt.create(e.state.doc,r.mightDrag.pos)));else if(n.target&&1==n.target.nodeType){let t=e.docView.nearestDesc(n.target,!0);t&&t.node.type.spec.draggable&&t!=e.docView&&e.dispatch(e.state.tr.setSelection(nt.create(e.state.doc,t.posBefore)))}let s=e.state.selection.content(),{dom:a,text:l}=cr(e,s);n.dataTransfer.clearData(),n.dataTransfer.setData(Vr?"Text":"text/html",a.innerHTML),n.dataTransfer.effectAllowed="copyMove",Vr||n.dataTransfer.setData("text/plain",l),e.dragging=new Ur(s,!n[$r])},wr.dragend=e=>{let t=e.dragging;window.setTimeout((()=>{e.dragging==t&&(e.dragging=null)}),50)},kr.dragover=kr.dragenter=(e,t)=>t.preventDefault(),kr.drop=(e,t)=>{let n=t,r=e.dragging;if(e.dragging=null,!n.dataTransfer)return;let i=e.posAtCoords(Sr(n));if(!i)return;let o=e.state.doc.resolve(i.pos),s=r&&r.slice;s?e.someProp("transformPasted",(e=>{s=e(s)})):s=ur(e,n.dataTransfer.getData(Vr?"Text":"text/plain"),Vr?null:n.dataTransfer.getData("text/html"),!1,o);let a=!(!r||n[$r]);if(e.someProp("handleDrop",(t=>t(e,n,s||m.empty,a))))return void n.preventDefault();if(!s)return;n.preventDefault();let l=s?function(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let i=n.content;for(let o=0;o<n.openStart;o++)i=i.firstChild.content;for(let o=1;o<=(0==n.openStart&&n.size?2:1);o++)for(let e=r.depth;e>=0;e--){let t=e==r.depth?0:r.pos<=(r.start(e+1)+r.end(e+1))/2?-1:1,n=r.index(e)+(t>0?1:0),s=r.node(e),a=!1;if(1==o)a=s.canReplace(n,n,i);else{let e=s.contentMatchAt(n).findWrapping(i.firstChild.type);a=e&&s.canReplaceWith(n,n,e[0])}if(a)return 0==t?r.pos:t<0?r.before(e+1):r.after(e+1)}return null}(e.state.doc,o.pos,s):o.pos;null==l&&(l=o.pos);let c=e.state.tr;a&&c.deleteSelection();let u=c.mapping.map(l),p=0==s.openStart&&0==s.openEnd&&1==s.content.childCount,d=c.doc;if(p?c.replaceRangeWith(u,u,s.content.firstChild):c.replaceRange(u,u,s),c.doc.eq(d))return;let h=c.doc.resolve(u);if(p&&nt.isSelectable(s.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(s.content.firstChild))c.setSelection(new nt(h));else{let t=c.mapping.map(l);c.mapping.maps[c.mapping.maps.length-1].forEach(((e,n,r,i)=>t=i)),c.setSelection(Gn(e,h,c.doc.resolve(t)))}e.focus(),e.dispatch(c.setMeta("uiEvent","drop"))},wr.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout((()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelection())&&zn(e)}),20))},wr.blur=(e,t)=>{let 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)},wr.beforeinput=(e,t)=>{if(Dt&&Rt&&"deleteContentBackward"==t.inputType){e.domObserver.flushSoon();let{domChangeCount:t}=e.input;setTimeout((()=>{if(e.input.domChangeCount!=t)return;if(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",(t=>t(e,Gt(8,"Backspace")))))return;let{$cursor:n}=e.state.selection;n&&n.pos>0&&e.dispatch(e.state.tr.delete(n.pos-1,n.pos).scrollIntoView())}),50)}};for(let os in kr)wr[os]=kr[os];function Wr(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}class Gr{constructor(e,t){this.toDOM=e,this.spec=t||Qr,this.side=this.spec.side||0}map(e,t,n,r){let{pos:i,deleted:o}=e.mapResult(t.from+r,this.side<0?-1:1);return o?null:new Zr(i-n,i-n,this)}valid(){return!0}eq(e){return this==e||e instanceof Gr&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Wr(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class Jr{constructor(e,t){this.attrs=e,this.spec=t||Qr}map(e,t,n,r){let 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 Zr(i,o,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof Jr&&Wr(this.attrs,e.attrs)&&Wr(this.spec,e.spec)}static is(e){return e.type instanceof Jr}destroy(){}}class Kr{constructor(e,t){this.attrs=e,this.spec=t||Qr}map(e,t,n,r){let i=e.mapResult(t.from+r,1);if(i.deleted)return null;let o=e.mapResult(t.to+r,-1);return o.deleted||o.pos<=i.pos?null:new Zr(i.pos-n,o.pos-n,this)}valid(e,t){let n,{index:r,offset:i}=e.content.findIndex(t.from);return i==t.from&&!(n=e.child(r)).isText&&i+n.nodeSize==t.to}eq(e){return this==e||e instanceof Kr&&Wr(this.attrs,e.attrs)&&Wr(this.spec,e.spec)}destroy(){}}class Zr{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(e,t){return new Zr(e,t,this.type)}eq(e){let 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}map(e,t,n){return this.type.map(e,this,t,n)}static widget(e,t,n){return new Zr(e,e,new Gr(t,n))}static inline(e,t,n,r){return new Zr(e,t,new Jr(n,r))}static node(e,t,n,r){return new Zr(e,t,new Kr(n,r))}get spec(){return this.type.spec}get inline(){return this.type instanceof Jr}}const Xr=[],Qr={};class Yr{constructor(e,t){this.local=e.length?e:Xr,this.children=t.length?t:Xr}static create(e,t){return t.length?oi(t,e,0,Qr):ei}find(e,t,n){let r=[];return this.findInner(null==e?0:e,null==t?1e9:t,r,0,n),r}findInner(e,t,n,r,i){for(let o=0;o<this.local.length;o++){let s=this.local[o];s.from<=t&&s.to>=e&&(!i||i(s.spec))&&n.push(s.copy(s.from+r,s.to+r))}for(let o=0;o<this.children.length;o+=3)if(this.children[o]<t&&this.children[o+1]>e){let s=this.children[o]+1;this.children[o+2].findInner(e-s,t-s,n,r+s,i)}}map(e,t,n){return this==ei||0==e.maps.length?this:this.mapInner(e,t,0,0,n||Qr)}mapInner(e,t,n,r,i){let o;for(let s=0;s<this.local.length;s++){let a=this.local[s].map(e,n,r);a&&a.type.valid(t,a)?(o||(o=[])).push(a):i.onRemove&&i.onRemove(this.local[s].spec)}return this.children.length?function(e,t,n,r,i,o,s){let a=e.slice();for(let c=0,u=o;c<n.maps.length;c++){let e=0;n.maps[c].forEach(((t,n,r,o)=>{let s=o-r-(n-t);for(let l=0;l<a.length;l+=3){let o=a[l+1];if(o<0||t>o+u-e)continue;let c=a[l]+u-e;n>=c?a[l+1]=t<=c?-2:-1:r>=i&&s&&(a[l]+=s,a[l+1]+=s)}e+=s})),u=n.maps[c].map(u,-1)}let l=!1;for(let c=0;c<a.length;c+=3)if(a[c+1]<0){if(-2==a[c+1]){l=!0,a[c+1]=-1;continue}let t=n.map(e[c]+o),u=t-i;if(u<0||u>=r.content.size){l=!0;continue}let p=n.map(e[c+1]+o,-1)-i,{index:d,offset:h}=r.content.findIndex(u),f=r.maybeChild(d);if(f&&h==u&&h+f.nodeSize==p){let r=a[c+2].mapInner(n,f,t+1,e[c]+o+1,s);r!=ei?(a[c]=u,a[c+1]=p,a[c+2]=r):(a[c+1]=-2,l=!0)}else l=!0}if(l){let l=function(e,t,n,r,i,o,s){function a(e,t){for(let o=0;o<e.local.length;o++){let a=e.local[o].map(r,i,t);a?n.push(a):s.onRemove&&s.onRemove(e.local[o].spec)}for(let n=0;n<e.children.length;n+=3)a(e.children[n+2],e.children[n]+t+1)}for(let l=0;l<e.length;l+=3)-1==e[l+1]&&a(e[l+2],t[l]+o+1);return n}(a,e,t,n,i,o,s),c=oi(l,r,0,s);t=c.local;for(let e=0;e<a.length;e+=3)a[e+1]<0&&(a.splice(e,3),e-=3);for(let e=0,t=0;e<c.children.length;e+=3){let n=c.children[e];for(;t<a.length&&a[t]<n;)t+=3;a.splice(t,0,c.children[e],c.children[e+1],c.children[e+2])}}return new Yr(t.sort(si),a)}(this.children,o||[],e,t,n,r,i):o?new Yr(o.sort(si),Xr):ei}add(e,t){return t.length?this==ei?Yr.create(e,t):this.addInner(e,t,0):this}addInner(e,t,n){let r,i=0;e.forEach(((e,o)=>{let s,a=o+n;if(s=ri(t,e,a)){for(r||(r=this.children.slice());i<r.length&&r[i]<o;)i+=3;r[i]==o?r[i+2]=r[i+2].addInner(e,s,a+1):r.splice(i,0,o,o+e.nodeSize,oi(s,e,a+1,Qr)),i+=3}}));let o=ni(i?ii(t):t,-n);for(let s=0;s<o.length;s++)o[s].type.valid(e,o[s])||o.splice(s--,1);return new Yr(o.length?this.local.concat(o).sort(si):this.local,r||this.children)}remove(e){return 0==e.length||this==ei?this:this.removeInner(e,0)}removeInner(e,t){let n=this.children,r=this.local;for(let i=0;i<n.length;i+=3){let r,o=n[i]+t,s=n[i+1]+t;for(let t,n=0;n<e.length;n++)(t=e[n])&&t.from>o&&t.to<s&&(e[n]=null,(r||(r=[])).push(t));if(!r)continue;n==this.children&&(n=this.children.slice());let a=n[i+2].removeInner(r,o+1);a!=ei?n[i+2]=a:(n.splice(i,3),i-=3)}if(r.length)for(let i,o=0;o<e.length;o++)if(i=e[o])for(let e=0;e<r.length;e++)r[e].eq(i,t)&&(r==this.local&&(r=this.local.slice()),r.splice(e--,1));return n==this.children&&r==this.local?this:r.length||n.length?new Yr(r,n):ei}forChild(e,t){if(this==ei)return this;if(t.isLeaf)return Yr.empty;let n,r;for(let s=0;s<this.children.length;s+=3)if(this.children[s]>=e){this.children[s]==e&&(n=this.children[s+2]);break}let i=e+1,o=i+t.content.size;for(let s=0;s<this.local.length;s++){let e=this.local[s];if(e.from<o&&e.to>i&&e.type instanceof Jr){let t=Math.max(i,e.from)-i,n=Math.min(o,e.to)-i;t<n&&(r||(r=[])).push(e.copy(t,n))}}if(r){let e=new Yr(r.sort(si),Xr);return n?new ti([e,n]):e}return n||ei}eq(e){if(this==e)return!0;if(!(e instanceof Yr)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let t=0;t<this.local.length;t++)if(!this.local[t].eq(e.local[t]))return!1;for(let t=0;t<this.children.length;t+=3)if(this.children[t]!=e.children[t]||this.children[t+1]!=e.children[t+1]||!this.children[t+2].eq(e.children[t+2]))return!1;return!0}locals(e){return ai(this.localsInner(e))}localsInner(e){if(this==ei)return Xr;if(e.inlineContent||!this.local.some(Jr.is))return this.local;let t=[];for(let n=0;n<this.local.length;n++)this.local[n].type instanceof Jr||t.push(this.local[n]);return t}}Yr.empty=new Yr([],[]),Yr.removeOverlap=ai;const ei=Yr.empty;class ti{constructor(e){this.members=e}map(e,t){const n=this.members.map((n=>n.map(e,t,Qr)));return ti.from(n)}forChild(e,t){if(t.isLeaf)return Yr.empty;let n=[];for(let r=0;r<this.members.length;r++){let i=this.members[r].forChild(e,t);i!=ei&&(i instanceof ti?n=n.concat(i.members):n.push(i))}return ti.from(n)}eq(e){if(!(e instanceof ti)||e.members.length!=this.members.length)return!1;for(let t=0;t<this.members.length;t++)if(!this.members[t].eq(e.members[t]))return!1;return!0}locals(e){let t,n=!0;for(let r=0;r<this.members.length;r++){let i=this.members[r].localsInner(e);if(i.length)if(t){n&&(t=t.slice(),n=!1);for(let e=0;e<i.length;e++)t.push(i[e])}else t=i}return t?ai(n?t:t.sort(si)):Xr}static from(e){switch(e.length){case 0:return ei;case 1:return e[0];default:return new ti(e)}}}function ni(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let i=e[r];n.push(new Zr(i.from+t,i.to+t,i.type))}return n}function ri(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,i=null;for(let o,s=0;s<e.length;s++)(o=e[s])&&o.from>n&&o.to<r&&((i||(i=[])).push(o),e[s]=null);return i}function ii(e){let t=[];for(let n=0;n<e.length;n++)null!=e[n]&&t.push(e[n]);return t}function oi(e,t,n,r){let i=[],o=!1;t.forEach(((t,s)=>{let a=ri(e,t,s+n);if(a){o=!0;let e=oi(a,t,n+s+1,r);e!=ei&&i.push(s,s+t.nodeSize,e)}}));let s=ni(o?ii(e):e,-n).sort(si);for(let a=0;a<s.length;a++)s[a].type.valid(t,s[a])||(r.onRemove&&r.onRemove(s[a].spec),s.splice(a--,1));return s.length||i.length?new Yr(s,i):ei}function si(e,t){return e.from-t.from||e.to-t.to}function ai(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let i=n+1;i<t.length;i++){let 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),li(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),li(t,i+1,o.copy(r.to,o.to)))}}return t}function li(e,t,n){for(;t<e.length&&si(n,e[t])>0;)t++;e.splice(t,0,n)}function ci(e){let t=[];return e.someProp("decorations",(n=>{let r=n(e.state);r&&r!=ei&&t.push(r)})),e.cursorWrapper&&t.push(Yr.create(e.state.doc,[e.cursorWrapper.deco])),ti.from(t)}const ui={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},pi=Et&&Mt<=11;class di{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class hi{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new di,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver((e=>{for(let t=0;t<e.length;t++)this.queue.push(e[t]);Et&&Mt<=11&&e.some((e=>"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length))?this.flushSoon():this.flush()})),pi&&(this.onCharData=e=>{this.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout((()=>{this.flushingSoon=-1,this.flush()}),20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,ui)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;t<e.length;t++)this.queue.push(e[t]);window.setTimeout((()=>this.flush()),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout((()=>this.suppressingSelectionUpdates=!1),50)}onSelectionChange(){if(Jn(this.view)){if(this.suppressingSelectionUpdates)return zn(this.view);if(Et&&Mt<=11&&!this.view.state.selection.empty){let e=this.view.domSelection();if(e.focusNode&&jt(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelection())}ignoreSelectionChange(e){if(0==e.rangeCount)return!0;let 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}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.observer?this.observer.takeRecords():[];this.queue.length&&(t=this.queue.concat(t),this.queue.length=0);let n=e.domSelection(),r=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&Jn(e)&&!this.ignoreSelectionChange(n),i=-1,o=-1,s=!1,a=[];if(e.editable)for(let c=0;c<t.length;c++){let e=this.registerMutation(t[c],a);e&&(i=i<0?e.from:Math.min(e.from,i),o=o<0?e.to:Math.max(e.to,o),e.typeOver&&(s=!0))}if(Nt&&a.length>1){let e=a.filter((e=>"BR"==e.nodeName));if(2==e.length){let t=e[0],n=e[1];t.parentNode&&t.parentNode.parentNode==n.parentNode?n.remove():t.remove()}}let l=null;i<0&&r&&e.input.lastFocus>Date.now()-200&&e.input.lastTouch<Date.now()-300&&Wt(n)&&(l=Hn(e))&&l.eq(Ze.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,zn(e),this.currentSelection.set(n),e.scrollToSelection()):(i>-1||r)&&(i>-1&&(e.docView.markDirty(i,o),function(e){if(fi.has(e))return;if(fi.set(e,null),-1!==["normal","nowrap","pre-line"].indexOf(getComputedStyle(e.dom).whiteSpace)){if(e.requiresGeckoHackNode=Nt,mi)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."),mi=!0}}(e)),this.handleDOMChange(i,o,s,a),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||zn(e),this.currentSelection.set(n))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let 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(let n=0;n<e.addedNodes.length;n++)t.push(e.addedNodes[n]);if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let r=e.previousSibling,i=e.nextSibling;if(Et&&Mt<=11&&e.addedNodes.length)for(let t=0;t<e.addedNodes.length;t++){let{previousSibling:n,nextSibling:o}=e.addedNodes[t];(!n||Array.prototype.indexOf.call(e.addedNodes,n)<0)&&(r=n),(!o||Array.prototype.indexOf.call(e.addedNodes,o)<0)&&(i=o)}let o=r&&r.parentNode==e.target?Ft(r)+1:0,s=n.localPosFromDOM(e.target,o,-1),a=i&&i.parentNode==e.target?Ft(i):e.target.childNodes.length;return{from:s,to:n.localPosFromDOM(e.target,a,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}}}let fi=new WeakMap,mi=!1;function gi(e){let t=e.pmViewDesc;if(t)return t.parseRule();if("BR"==e.nodeName&&e.parentNode){if(At&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let e=document.createElement("div");return e.appendChild(document.createElement("li")),{skip:e}}if(e.parentNode.lastChild==e||At&&/^(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 vi(e,t,n,r,i){if(t<0){let t=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,n=Hn(e,t);if(n&&!e.state.selection.eq(n)){let r=e.state.tr.setSelection(n);"pointer"==t?r.setMeta("pointer",!0):"key"==t&&r.scrollIntoView(),e.dispatch(r)}return}let o=e.state.doc.resolve(t),s=o.sharedDepth(n);t=o.before(s+1),n=e.state.doc.resolve(n).after(s+1);let a,l,u=e.state.selection,p=function(e,t,n){let r,{node:i,fromOffset:o,toOffset:s,from:a,to:l}=e.docView.parseRange(t,n),c=e.domSelection(),u=c.anchorNode;if(u&&e.dom.contains(1==u.nodeType?u:u.parentNode)&&(r=[{node:u,offset:c.anchorOffset}],Wt(c)||r.push({node:c.focusNode,offset:c.focusOffset})),Dt&&8===e.input.lastKeyCode)for(let g=s;g>o;g--){let e=i.childNodes[g-1],t=e.pmViewDesc;if("BR"==e.nodeName&&!t){s=g;break}if(!t||t.size)break}let p=e.state.doc,d=e.someProp("domParser")||Y.fromSchema(e.state.schema),h=p.resolve(a),f=null,m=d.parse(i,{topNode:h.parent,topMatch:h.parent.contentMatchAt(h.index()),topOpen:!0,from:o,to:s,preserveWhitespace:"pre"!=h.parent.type.whitespace||"full",findPositions:r,ruleFromNode:gi,context:h});if(r&&null!=r[0].pos){let e=r[0].pos,t=r[1]&&r[1].pos;null==t&&(t=e),f={anchor:e+a,head:t+a}}return{doc:m,sel:f,from:a,to:l}}(e,t,n),d=e.state.doc,h=d.slice(p.from,p.to);8===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime?(a=e.state.selection.to,l="end"):(a=e.state.selection.from,l="start"),e.input.lastKeyCode=null;let f=function(e,t,n,r,i){let o=e.findDiffStart(t,n);if(null==o)return null;let{a:s,b:a}=e.findDiffEnd(t,n+e.size,n+t.size);if("end"==i){r-=s+Math.max(0,o-Math.min(s,a))-o}if(s<o&&e.size<t.size){o-=r<=o&&r>=s?o-r:0,a=o+(a-s),s=o}else if(a<o){o-=r<=o&&r>=a?o-r:0,s=o+(s-a),a=o}return{start:o,endA:s,endB:a}}(h.content,p.doc.content,p.from,a,l);if((Ot&&e.input.lastIOSEnter>Date.now()-225||Rt)&&i.some((e=>"DIV"==e.nodeName||"P"==e.nodeName))&&(!f||f.endA>=f.endB)&&e.someProp("handleKeyDown",(t=>t(e,Gt(13,"Enter")))))return void(e.input.lastIOSEnter=0);if(!f){if(!(r&&u instanceof et&&!u.empty&&u.$head.sameParent(u.$anchor))||e.composing||p.sel&&p.sel.anchor!=p.sel.head){if(p.sel){let t=yi(e,e.state.doc,p.sel);t&&!t.eq(e.state.selection)&&e.dispatch(e.state.tr.setSelection(t))}return}f={start:u.from,endA:u.to,endB:u.to}}if(Dt&&e.cursorWrapper&&p.sel&&p.sel.anchor==e.cursorWrapper.deco.from&&p.sel.head==p.sel.anchor){let e=f.endB-f.start;p.sel={anchor:p.sel.anchor+e,head:p.sel.anchor+e}}e.input.domChangeCount++,e.state.selection.from<e.state.selection.to&&f.start==f.endB&&e.state.selection instanceof et&&(f.start>e.state.selection.from&&f.start<=e.state.selection.from+2&&e.state.selection.from>=p.from?f.start=e.state.selection.from:f.endA<e.state.selection.to&&f.endA>=e.state.selection.to-2&&e.state.selection.to<=p.to&&(f.endB+=e.state.selection.to-f.endA,f.endA=e.state.selection.to)),Et&&Mt<=11&&f.endB==f.start+1&&f.endA==f.start&&f.start>p.from&&" \xa0"==p.doc.textBetween(f.start-p.from-1,f.start-p.from+1)&&(f.start--,f.endA--,f.endB--);let m,g=p.doc.resolveNoCache(f.start-p.from),v=p.doc.resolveNoCache(f.endB-p.from),y=d.resolve(f.start),b=g.sameParent(v)&&g.parent.inlineContent&&y.end()>=f.endA;if((Ot&&e.input.lastIOSEnter>Date.now()-225&&(!b||i.some((e=>"DIV"==e.nodeName||"P"==e.nodeName)))||!b&&g.pos<p.doc.content.size&&(m=Ze.findFrom(p.doc.resolve(g.pos+1),1,!0))&&m.head==v.pos)&&e.someProp("handleKeyDown",(t=>t(e,Gt(13,"Enter")))))return void(e.input.lastIOSEnter=0);if(e.state.selection.anchor>f.start&&function(e,t,n,r,i){if(!r.parent.isTextblock||n-t<=i.pos-r.pos||bi(r,!0,!1)<i.pos)return!1;let o=e.resolve(t);if(o.parentOffset<o.parent.content.size||!o.parent.isTextblock)return!1;let s=e.resolve(bi(o,!0,!0));return!(!s.parent.isTextblock||s.pos>n||bi(s,!0,!1)<n)&&r.parent.content.cut(r.parentOffset).eq(s.parent.content)}(d,f.start,f.endA,g,v)&&e.someProp("handleKeyDown",(t=>t(e,Gt(8,"Backspace")))))return void(Rt&&Dt&&e.domObserver.suppressSelectionUpdates());Dt&&Rt&&f.endB==f.start&&(e.input.lastAndroidDelete=Date.now()),Rt&&!b&&g.start()!=v.start()&&0==v.parentOffset&&g.depth==v.depth&&p.sel&&p.sel.anchor==p.sel.head&&p.sel.head==f.endA&&(f.endB-=2,v=p.doc.resolveNoCache(f.endB-p.from),setTimeout((()=>{e.someProp("handleKeyDown",(function(t){return t(e,Gt(13,"Enter"))}))}),20));let w,k,x,C=f.start,T=f.endA;if(b)if(g.pos==v.pos)Et&&Mt<=11&&0==g.parentOffset&&(e.domObserver.suppressSelectionUpdates(),setTimeout((()=>zn(e)),20)),w=e.state.tr.delete(C,T),k=d.resolve(f.start).marksAcross(d.resolve(f.endA));else if(f.endA==f.endB&&(x=function(e,t){let n,r,i,o=e.firstChild.marks,s=t.firstChild.marks,a=o,l=s;for(let c=0;c<s.length;c++)a=s[c].removeFromSet(a);for(let c=0;c<o.length;c++)l=o[c].removeFromSet(l);if(1==a.length&&0==l.length)r=a[0],n="add",i=e=>e.mark(r.addToSet(e.marks));else{if(0!=a.length||1!=l.length)return null;r=l[0],n="remove",i=e=>e.mark(r.removeFromSet(e.marks))}let u=[];for(let c=0;c<t.childCount;c++)u.push(i(t.child(c)));if(c.from(u).eq(e))return{mark:r,type:n}}(g.parent.content.cut(g.parentOffset,v.parentOffset),y.parent.content.cut(y.parentOffset,f.endA-y.start()))))w=e.state.tr,"add"==x.type?w.addMark(C,T,x.mark):w.removeMark(C,T,x.mark);else if(g.parent.child(g.index()).isText&&g.index()==v.index()-(v.textOffset?0:1)){let t=g.parent.textBetween(g.parentOffset,v.parentOffset);if(e.someProp("handleTextInput",(n=>n(e,C,T,t))))return;w=e.state.tr.insertText(t,C,T)}if(w||(w=e.state.tr.replace(C,T,p.doc.slice(f.start-p.from,f.endB-p.from))),p.sel){let t=yi(e,w.doc,p.sel);t&&!(Dt&&Rt&&e.composing&&t.empty&&(f.start!=f.endB||e.input.lastAndroidDelete<Date.now()-100)&&(t.head==C||t.head==w.mapping.map(T)-1)||Et&&t.empty&&t.head==C)&&w.setSelection(t)}k&&w.ensureMarks(k),e.dispatch(w.scrollIntoView())}function yi(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:Gn(e,t.resolve(n.anchor),t.resolve(n.head))}function bi(e,t,n){let r=e.depth,i=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,i++,t=!1;if(n){let t=e.node(r).maybeChild(e.indexAfter(r));for(;t&&!t.isLeaf;)t=t.firstChild,i++}return i}class wi{constructor(e,t){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 Cr,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(Ei),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):"function"==typeof e?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=Ci(this),xi(this),this.nodeViews=Ti(this),this.docView=xn(this.state.doc,ki(this),ci(this),this.dom,this),this.domObserver=new hi(this,((e,t,n,r)=>vi(this,e,t,n,r))),this.domObserver.start(),function(e){for(let t in wr){let n=wr[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{!Nr(e,t)||Mr(e,t)||!e.editable&&t.type in kr||n(e,t)},xr[t]?{passive:!0}:void 0)}At&&e.dom.addEventListener("input",(()=>null)),Er(e)}(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Er(this),this._props=e,e.plugins&&(e.plugins.forEach(Ei),this.directPlugins=e.plugins),this.updateStateInner(e.state,!0)}setProps(e){let t={};for(let n in this._props)t[n]=this._props[n];t.state=this.state;for(let n in e)t[n]=e[n];this.update(t)}updateState(e){this.updateStateInner(e,this.state.plugins!=e.plugins)}updateStateInner(e,t){let n=this.state,r=!1,i=!1;if(e.storedMarks&&this.composing&&(zr(this),i=!0),this.state=e,t){let e=Ti(this);(function(e,t){let n=0,r=0;for(let i in e){if(e[i]!=t[i])return!0;n++}for(let i in t)r++;return n!=r})(e,this.nodeViews)&&(this.nodeViews=e,r=!0),Er(this)}this.editable=Ci(this),xi(this);let o=ci(this),s=ki(this),a=t?"reset":e.scrollToSelection>n.scrollToSelection?"to selection":"preserve",l=r||!this.docView.matchesNode(e.doc,s,o);!l&&e.selection.eq(n.selection)||(i=!0);let c="preserve"==a&&i&&null==this.dom.style.overflowAnchor&&function(e){let t,n,r=e.dom.getBoundingClientRect(),i=Math.max(0,r.top);for(let o=(r.left+r.right)/2,s=i+1;s<Math.min(innerHeight,r.bottom);s+=5){let r=e.root.elementFromPoint(o,s);if(!r||r==e.dom||!e.dom.contains(r))continue;let a=r.getBoundingClientRect();if(a.top>=i-20){t=r,n=a.top;break}}return{refDOM:t,refTop:n,stack:Qt(e.dom)}}(this);if(i){this.domObserver.stop();let t=l&&(Et||Dt)&&!this.composing&&!n.selection.empty&&!e.selection.empty&&function(e,t){let 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(l){let n=Dt?this.trackWrites=this.domSelection().focusNode:null;!r&&this.docView.update(e.doc,s,o,this)||(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=xn(e.doc,s,o,this.dom,this)),n&&!this.trackWrites&&(t=!0)}t||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelection())&&function(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelection();return jt(t.node,t.offset,n.anchorNode,n.anchorOffset)}(this))?zn(this,t):($n(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(n),"reset"==a?this.dom.scrollTop=0:"to selection"==a?this.scrollToSelection():c&&function(e){let{refDOM:t,refTop:n,stack:r}=e,i=t?t.getBoundingClientRect().top:0;Yt(r,0==i?0:i-n)}(c)}scrollToSelection(){let e=this.domSelection().focusNode;if(this.someProp("handleScrollToSelection",(e=>e(this))));else if(this.state.selection instanceof nt){let t=this.docView.domAfterPos(this.state.selection.from);1==t.nodeType&&Xt(this,t.getBoundingClientRect(),e)}else Xt(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(e&&e.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(let t=0;t<this.pluginViews.length;t++){let n=this.pluginViews[t];n.update&&n.update(this,e)}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let e=0;e<this.directPlugins.length;e++){let t=this.directPlugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}for(let e=0;e<this.state.plugins.length;e++){let t=this.state.plugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}}}someProp(e,t){let n,r=this._props&&this._props[e];if(null!=r&&(n=t?t(r):r))return n;for(let o=0;o<this.directPlugins.length;o++){let r=this.directPlugins[o].props[e];if(null!=r&&(n=t?t(r):r))return n}let i=this.state.plugins;if(i)for(let o=0;o<i.length;o++){let r=i[o].props[e];if(null!=r&&(n=t?t(r):r))return n}}hasFocus(){return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&function(e){if(e.setActive)return e.setActive();if(en)return e.focus(en);let t=Qt(e);e.focus(null==en?{get preventScroll(){return en={preventScroll:!0},!0}}:void 0),en||(en=!1,Yt(t,0))}(this.dom),zn(this),this.domObserver.start()}get root(){let e=this._root;if(null==e)for(let t=this.dom.parentNode;t;t=t.parentNode)if(9==t.nodeType||11==t.nodeType&&t.host)return t.getSelection||(Object.getPrototypeOf(t).getSelection=()=>t.ownerDocument.getSelection()),this._root=t;return e||document}posAtCoords(e){return on(this,e)}coordsAtPos(e){return ln(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:1)}domAtPos(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t){let 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}endOfTextblock(e,t){return gn(this,t||this.state,e)}destroy(){this.docView&&(!function(e){e.domObserver.stop();for(let t in 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,[],ci(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}get isDestroyed(){return null==this.docView}dispatchEvent(e){return function(e,t){Mr(e,t)||!wr[t.type]||!e.editable&&t.type in kr||wr[t.type](e,t)}(this,e)}dispatch(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))}domSelection(){return this.root.getSelection()}}function ki(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),t.translate="no",e.someProp("attributes",(n=>{if("function"==typeof n&&(n=n(e.state)),n)for(let e in n)"class"==e&&(t.class+=" "+n[e]),"style"==e?t.style=(t.style?t.style+";":"")+n[e]:t[e]||"contenteditable"==e||"nodeName"==e||(t[e]=String(n[e]))})),[Zr.node(0,e.state.doc.content.size,t)]}function xi(e){if(e.markCursor){let t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:Zr.widget(e.state.selection.head,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function Ci(e){return!e.someProp("editable",(t=>!1===t(e.state)))}function Ti(e){let t=Object.create(null);function n(e){for(let n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n])}return e.someProp("nodeViews",n),e.someProp("markViews",n),t}function Ei(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 Mi={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:"'"},Ni={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Si="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent),Di=("undefined"!=typeof navigator&&/Gecko\/\d+/.test(navigator.userAgent),"undefined"!=typeof navigator&&/Mac/.test(navigator.platform)),Li="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Ai=Di||Si&&+Si[1]<57,Oi=0;Oi<10;Oi++)Mi[48+Oi]=Mi[96+Oi]=String(Oi);for(Oi=1;Oi<=24;Oi++)Mi[Oi+111]="F"+Oi;for(Oi=65;Oi<=90;Oi++)Mi[Oi]=String.fromCharCode(Oi+32),Ni[Oi]=String.fromCharCode(Oi);for(var Ii in Mi)Ni.hasOwnProperty(Ii)||(Ni[Ii]=Mi[Ii]);const Ri="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function Pi(e){let t,n,r,i,o=e.split(/-(?!$)/),s=o[o.length-1];"Space"==s&&(s=" ");for(let a=0;a<o.length-1;a++){let e=o[a];if(/^(cmd|meta|m)$/i.test(e))i=!0;else if(/^a(lt)?$/i.test(e))t=!0;else if(/^(c|ctrl|control)$/i.test(e))n=!0;else if(/^s(hift)?$/i.test(e))r=!0;else{if(!/^mod$/i.test(e))throw new Error("Unrecognized modifier name: "+e);Ri?i=!0:n=!0}}return t&&(s="Alt-"+s),n&&(s="Ctrl-"+s),i&&(s="Meta-"+s),r&&(s="Shift-"+s),s}function Bi(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 Fi(e){return new mt({props:{handleKeyDown:Hi(e)}})}function Hi(e){let t=function(e){let t=Object.create(null);for(let n in e)t[Pi(n)]=e[n];return t}(e);return function(e,n){let r,i=function(e){var t=!(Ai&&(e.ctrlKey||e.altKey||e.metaKey)||Li&&e.shiftKey&&e.key&&1==e.key.length||"Unidentified"==e.key)&&e.key||(e.shiftKey?Ni:Mi)[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,s=t[Bi(i,n,!o)];if(s&&s(e.state,e.dispatch,e))return!0;if(o&&(n.shiftKey||n.altKey||n.metaKey||i.charCodeAt(0)>127)&&(r=Mi[n.keyCode])&&r!=i){let i=t[Bi(r,n,!0)];if(i&&i(e.state,e.dispatch,e))return!0}else if(o&&n.shiftKey){let r=t[Bi(i,n,!0)];if(r&&r(e.state,e.dispatch,e))return!0}return!1}}const qi=(e,t)=>!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function zi(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];for(let r=e;r;r="start"==t?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&1!=r.childCount)return!1}return!1}function ji(e){if(!e.parent.type.spec.isolating)for(let 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}const Vi=(e,t,n)=>{let{$cursor:r}=e.selection;if(!r||(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size))return!1;let i=_i(r);if(!i)return!1;let o=i.nodeAfter;if(Ki(e,i,t))return!0;if(0==r.parent.content.size&&(zi(o,"start")||nt.isSelectable(o))){let n=Pe(e.doc,r.before(),r.after(),m.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(zi(o,"start")?Ze.findFrom(r.doc.resolve(r.mapping.map(i.pos)),1):nt.create(r.doc,r.mapping.map(i.pos))),t(r.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 _i(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let 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}const Ui=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!(!n.parent.type.spec.code||!n.sameParent(r))&&(t&&t(e.tr.insertText("\n").scrollIntoView()),!0)};function $i(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const Wi=(e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),o=n.indexAfter(-1),s=$i(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(t){let r=n.after(),i=e.tr.replaceWith(r,r,s.createAndFill());i.setSelection(Ze.near(i.doc.resolve(r),1)),t(i.scrollIntoView())}return!0},Gi=(e,t)=>{let{$from:n,$to:r}=e.selection;if(e.selection instanceof nt&&e.selection.node.isBlock)return!(!n.parentOffset||!Oe(e.doc,n.pos))&&(t&&t(e.tr.split(n.pos).scrollIntoView()),!0);if(!n.parent.isBlock)return!1;if(t){let i=r.parentOffset==r.parent.content.size,o=e.tr;(e.selection instanceof et||e.selection instanceof it)&&o.deleteSelection();let s=0==n.depth?null:$i(n.node(-1).contentMatchAt(n.indexAfter(-1))),a=i&&s?[{type:s}]:void 0,l=Oe(o.doc,o.mapping.map(n.pos),1,a);if(a||l||!Oe(o.doc,o.mapping.map(n.pos),1,s?[{type:s}]:void 0)||(s&&(a=[{type:s}]),l=!0),l&&(o.split(o.mapping.map(n.pos),1,a),!i&&!n.parentOffset&&n.parent.type!=s)){let e=o.mapping.map(n.before()),t=o.doc.resolve(e);s&&n.node(-1).canReplaceWith(t.index(),t.index()+1,s)&&o.setNodeMarkup(o.mapping.map(n.before()),s)}t(o.scrollIntoView())}return!0},Ji=(e,t)=>(t&&t(e.tr.setSelection(new it(e.doc))),!0);function Ki(e,t,n){let r,i,o=t.nodeBefore,s=t.nodeAfter;if(o.type.spec.isolating||s.type.spec.isolating)return!1;if(function(e,t,n){let 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&&!Ie(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;let a=t.parent.canReplace(t.index(),t.index()+1);if(a&&(r=(i=o.contentMatchAt(o.childCount)).findWrapping(s.type))&&i.matchType(r[0]||s.type).validEnd){if(n){let i=t.pos+s.nodeSize,a=c.empty;for(let e=r.length-1;e>=0;e--)a=c.from(r[e].create(null,a));a=c.from(o.copy(a));let l=e.tr.step(new Ne(t.pos-1,i,t.pos,i,new m(a,1,0),r.length,!0)),u=i+2*r.length;Ie(l.doc,u)&&l.join(u),n(l.scrollIntoView())}return!0}let l=Ze.findFrom(t,1),u=l&&l.$from.blockRange(l.$to),p=u&&Le(u);if(null!=p&&p>=t.depth)return n&&n(e.tr.lift(u,p).scrollIntoView()),!0;if(a&&zi(s,"start",!0)&&zi(o,"end")){let r=o,i=[];for(;i.push(r),!r.isTextblock;)r=r.lastChild;let a=s,l=1;for(;!a.isTextblock;a=a.firstChild)l++;if(r.canReplace(r.childCount,r.childCount,a.content)){if(n){let r=c.empty;for(let e=i.length-1;e>=0;e--)r=c.from(i[e].copy(r));n(e.tr.step(new Ne(t.pos-i.length,t.pos+s.nodeSize,t.pos+l,t.pos+s.nodeSize-l,new m(r,i.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function Zi(e){return function(t,n){let r=t.selection,i=e<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return!!i.node(o).isTextblock&&(n&&n(t.tr.setSelection(et.create(t.doc,e<0?i.start(o):i.end(o)))),!0)}}const Xi=Zi(-1),Qi=Zi(1);function Yi(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),a=s&&function(e,t){let 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){let{parent:n,startIndex:r,endIndex:i}=e,o=n.contentMatchAt(r).findWrapping(t);if(!o)return null;let s=o.length?o[0]:t;return n.canReplaceWith(r,i,s)?o:null}(e,t),o=i&&function(e,t){let{parent:n,startIndex:r,endIndex:i}=e,o=n.child(r),s=t.contentMatch.findWrapping(o.type);if(!s)return null;let a=(s.length?s[s.length-1]:t).contentMatch;for(let l=r;a&&l<i;l++)a=a.matchType(n.child(l).type);return a&&a.validEnd?s:null}(r,t);return o?i.map(Ae).concat({type:t,attrs:n}).concat(o.map(Ae)):null}(s,e,t);return!!a&&(r&&r(n.tr.wrap(s,a).scrollIntoView()),!0)}}function eo(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return function(n,r){let{from:i,to:o}=n.selection,s=!1;return n.doc.nodesBetween(i,o,((r,i)=>{if(s)return!1;if(r.isTextblock&&!r.hasMarkup(e,t))if(r.type==e)s=!0;else{let t=n.doc.resolve(i),r=t.index();s=t.parent.canReplaceWith(r,r+1,e)}})),!!s&&(r&&r(n.tr.setBlockType(i,o,e,t).scrollIntoView()),!0)}}function to(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return function(n,r){let{empty:i,$cursor:o,ranges:s}=n.selection;if(i&&!o||!function(e,t,n){for(let r=0;r<t.length;r++){let{$from:i,$to:o}=t[r],s=0==i.depth&&e.type.allowsMarkType(n);if(e.nodesBetween(i.pos,o.pos,(e=>{if(s)return!1;s=e.inlineContent&&e.type.allowsMarkType(n)})),s)return!0}return!1}(n.doc,s,e))return!1;if(r)if(o)e.isInSet(n.storedMarks||o.marks())?r(n.tr.removeStoredMark(e)):r(n.tr.addStoredMark(e.create(t)));else{let i=!1,o=n.tr;for(let t=0;!i&&t<s.length;t++){let{$from:r,$to:o}=s[t];i=n.doc.rangeHasMark(r.pos,o.pos,e)}for(let n=0;n<s.length;n++){let{$from:r,$to:a}=s[n];if(i)o.removeMark(r.pos,a.pos,e);else{let n=r.pos,i=a.pos,s=r.nodeAfter,l=a.nodeBefore,c=s&&s.isText?/^\s*/.exec(s.text)[0].length:0,u=l&&l.isText?/\s*$/.exec(l.text)[0].length:0;n+c<i&&(n+=c,i-=u),o.addMark(n,i,e.create(t))}}r(o.scrollIntoView())}return!0}}function no(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e,n,r){for(let i=0;i<t.length;i++)if(t[i](e,n,r))return!0;return!1}}let ro=no(qi,((e,t,n)=>{let{$cursor:r}=e.selection;if(!r||(n?!n.endOfTextblock("backward",e):r.parentOffset>0))return!1;let i=ji(r);if(!i){let n=r.blockRange(),i=n&&Le(n);return null!=i&&(t&&t(e.tr.lift(n,i).scrollIntoView()),!0)}let o=i.nodeBefore;if(!o.type.spec.isolating&&Ki(e,i,t))return!0;if(0==r.parent.content.size&&(zi(o,"end")||nt.isSelectable(o))){let n=Pe(e.doc,r.before(),r.after(),m.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(zi(o,"end")?Ze.findFrom(r.doc.resolve(r.mapping.map(i.pos,-1)),-1):nt.create(r.doc,i.pos-o.nodeSize)),t(r.scrollIntoView())}return!0}}return!(!o.isAtom||i.depth!=r.depth-1)&&(t&&t(e.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),!0)}),((e,t,n)=>{let{$head:r,empty:i}=e.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):r.parentOffset>0)return!1;o=ji(r)}let s=o&&o.nodeBefore;return!(!s||!nt.isSelectable(s))&&(t&&t(e.tr.setSelection(nt.create(e.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)})),io=no(qi,Vi,((e,t,n)=>{let{$head:r,empty:i}=e.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size)return!1;o=_i(r)}let s=o&&o.nodeAfter;return!(!s||!nt.isSelectable(s))&&(t&&t(e.tr.setSelection(nt.create(e.doc,o.pos)).scrollIntoView()),!0)}));const oo={Enter:no(Ui,((e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof it||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=$i(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(t){let n=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,s=e.tr.insert(n,o.createAndFill());s.setSelection(et.create(s.doc,n+1)),t(s.scrollIntoView())}return!0}),((e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let r=n.before();if(Oe(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),i=r&&Le(r);return null!=i&&(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)}),Gi),"Mod-Enter":Wi,Backspace:ro,"Mod-Backspace":ro,"Shift-Backspace":ro,Delete:io,"Mod-Delete":io,"Mod-a":Ji},so={"Ctrl-h":oo.Backspace,"Alt-Backspace":oo["Mod-Backspace"],"Ctrl-d":oo.Delete,"Ctrl-Alt-Backspace":oo["Mod-Delete"],"Alt-Delete":oo["Mod-Delete"],"Alt-d":oo["Mod-Delete"],"Ctrl-a":Xi,"Ctrl-e":Qi};for(let os in oo)so[os]=oo[os];const ao=("undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!("undefined"==typeof os||!os.platform)&&"darwin"==os.platform())?so:oo;class lo{constructor(e,t){var n;this.match=e,this.match=e,this.handler="string"==typeof t?(n=t,function(e,t,r,i){let o=n;if(t[1]){let e=t[0].lastIndexOf(t[1]);o+=t[0].slice(e+t[1].length);let n=(r+=e)-i;n>0&&(o=t[0].slice(e-n,e)+o,r=i)}return e.tr.insertText(o,r,i)}):t}}const co=500;function uo(e){let{rules:t}=e,n=new mt({state:{init:()=>null,apply(e,t){let n=e.getMeta(this);return n||(e.selectionSet||e.docChanged?null:t)}},props:{handleTextInput:(e,r,i,o)=>po(e,r,i,o,t,n),handleDOMEvents:{compositionend:e=>{setTimeout((()=>{let{$cursor:r}=e.state.selection;r&&po(e,r.pos,r.pos,"",t,n)}))}}},isInputRules:!0});return n}function po(e,t,n,r,i,o){if(e.composing)return!1;let s=e.state,a=s.doc.resolve(t);if(a.parent.type.spec.code)return!1;let l=a.parent.textBetween(Math.max(0,a.parentOffset-co),a.parentOffset,null,"\ufffc")+r;for(let c=0;c<i.length;c++){let a=i[c].match.exec(l),u=a&&i[c].handler(s,a,t-(a[0].length-r.length),n);if(u)return e.dispatch(u.setMeta(o,{transform:u,from:t,to:n,text:r})),!0}return!1}const ho=(e,t)=>{let n=e.plugins;for(let r=0;r<n.length;r++){let i,o=n[r];if(o.spec.isInputRules&&(i=o.getState(e))){if(t){let n=e.tr,r=i.transform;for(let e=r.steps.length-1;e>=0;e--)n.step(r.steps[e].invert(r.docs[e]));if(i.text){let t=n.doc.resolve(i.from).marks();n.replaceWith(i.from,i.to,e.schema.text(i.text,t))}else n.delete(i.from,i.to);t(n)}return!0}}return!1};new lo(/--$/,"\u2014"),new lo(/\.\.\.$/,"\u2026"),new lo(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,"\u201c"),new lo(/"$/,"\u201d"),new lo(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,"\u2018"),new lo(/'$/,"\u2019");var fo=200,mo=function(){};mo.prototype.append=function(e){return e.length?(e=mo.from(e),!this.length&&e||e.length<fo&&this.leafAppend(e)||this.length<fo&&e.leafPrepend(this)||this.appendInner(e)):this},mo.prototype.prepend=function(e){return e.length?mo.from(e).append(this):this},mo.prototype.appendInner=function(e){return new vo(this,e)},mo.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t?mo.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},mo.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},mo.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)},mo.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},mo.from=function(e){return e instanceof mo?e:e&&e.length?new go(e):mo.empty};var go=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<=fo)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=fo)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}(mo);mo.empty=new go([]);var vo=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}(mo);const yo=mo;class bo{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(0==this.eventCount)return null;let n,r,i=this.items.length;for(;;i--){if(this.items.get(i-1).selection){--i;break}}t&&(n=this.remapping(i,this.items.length),r=n.maps.length);let o,s,a=e.tr,l=[],c=[];return this.items.forEach(((e,t)=>{if(!e.step)return n||(n=this.remapping(i,t+1),r=n.maps.length),r--,void c.push(e);if(n){c.push(new wo(e.map));let t,i=e.step.map(n.slice(r));i&&a.maybeStep(i).doc&&(t=a.mapping.maps[a.mapping.maps.length-1],l.push(new wo(t,void 0,void 0,l.length+c.length))),r--,t&&n.appendMap(t,r)}else a.maybeStep(e.step);return e.selection?(o=n?e.selection.map(n.slice(r)):e.selection,s=new bo(this.items.slice(0,i).append(c.reverse().concat(l)),this.eventCount-1),!1):void 0}),this.items.length,0),{remaining:s,transform:a,selection:o}}addTransform(e,t,n,r){let i=[],o=this.eventCount,s=this.items,a=!r&&s.length?s.get(s.length-1):null;for(let c=0;c<e.steps.length;c++){let n,l=e.steps[c].invert(e.docs[c]),u=new wo(e.mapping.maps[c],l,t);(n=a&&a.merge(u))&&(u=n,c?i.pop():s=s.slice(0,s.length-1)),i.push(u),t&&(o++,t=void 0),r||(a=u)}let l=o-n.depth;return l>xo&&(s=function(e,t){let n;return e.forEach(((e,r)=>{if(e.selection&&0==t--)return n=r,!1})),e.slice(n)}(s,l),o-=l),new bo(s.append(i),o)}remapping(e,t){let n=new ve;return this.items.forEach(((t,r)=>{let i=null!=t.mirrorOffset&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,i)}),e,t),n}addMaps(e){return 0==this.eventCount?this:new bo(this.items.append(e.map((e=>new wo(e)))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let n=[],r=Math.max(0,this.items.length-t),i=e.mapping,o=e.steps.length,s=this.eventCount;this.items.forEach((e=>{e.selection&&s--}),r);let a=t;this.items.forEach((t=>{let r=i.getMirror(--a);if(null==r)return;o=Math.min(o,r);let l=i.maps[r];if(t.step){let o=e.steps[r].invert(e.docs[r]),c=t.selection&&t.selection.map(i.slice(a+1,r));c&&s++,n.push(new wo(l,o,c))}else n.push(new wo(l))}),r);let l=[];for(let p=t;p<o;p++)l.push(new wo(i.maps[p]));let c=this.items.slice(0,r).append(l).append(n),u=new bo(c,s);return u.emptyItemCount()>500&&(u=u.compress(this.items.length-n.length)),u}emptyItemCount(){let e=0;return this.items.forEach((t=>{t.step||e++})),e}compress(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.items.length,t=this.remapping(0,e),n=t.maps.length,r=[],i=0;return this.items.forEach(((o,s)=>{if(s>=e)r.push(o),o.selection&&i++;else if(o.step){let e=o.step.map(t.slice(n)),s=e&&e.getMap();if(n--,s&&t.appendMap(s,n),e){let a=o.selection&&o.selection.map(t.slice(n));a&&i++;let l,c=new wo(s.invert(),e,a),u=r.length-1;(l=r.length&&r[u].merge(c))?r[u]=l:r.push(c)}}else o.map&&n--}),this.items.length,0),new bo(yo.from(r.reverse()),i)}}bo.empty=new bo(yo.empty,0);class wo{constructor(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new wo(t.getMap().invert(),t,this.selection)}}}class ko{constructor(e,t,n,r){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r}}const xo=20;function Co(e){let t=[];return e.forEach(((e,n,r,i)=>t.push(r,i))),t}function To(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let i=t.map(e[r],1),o=t.map(e[r+1],-1);i<=o&&n.push(i,o)}return n}function Eo(e,t,n,r){let i=So(t),o=Do.get(t).spec.config,s=(r?e.undone:e.done).popEvent(t,i);if(!s)return;let a=s.selection.resolve(s.transform.doc),l=(r?e.done:e.undone).addTransform(s.transform,t.selection.getBookmark(),o,i),c=new ko(r?l:s.remaining,r?s.remaining:l,null,0);n(s.transform.setSelection(a).setMeta(Do,{redo:r,historyState:c}).scrollIntoView())}let Mo=!1,No=null;function So(e){let t=e.plugins;if(No!=t){Mo=!1,No=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){Mo=!0;break}}return Mo}const Do=new yt("history"),Lo=new yt("closeHistory");function Ao(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new mt({key:Do,state:{init:()=>new ko(bo.empty,bo.empty,null,0),apply:(t,n,r)=>function(e,t,n,r){let i,o=n.getMeta(Do);if(o)return o.historyState;n.getMeta(Lo)&&(e=new ko(e.done,e.undone,null,0));let s=n.getMeta("appendedTransaction");if(0==n.steps.length)return e;if(s&&s.getMeta(Do))return s.getMeta(Do).redo?new ko(e.done.addTransform(n,void 0,r,So(t)),e.undone,Co(n.mapping.maps[n.steps.length-1]),e.prevTime):new ko(e.done,e.undone.addTransform(n,void 0,r,So(t)),null,e.prevTime);if(!1===n.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))return(i=n.getMeta("rebased"))?new ko(e.done.rebased(n,i),e.undone.rebased(n,i),To(e.prevRanges,n.mapping),e.prevTime):new ko(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),To(e.prevRanges,n.mapping),e.prevTime);{let i=0==e.prevTime||!s&&(e.prevTime<(n.time||0)-r.newGroupDelay||!function(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach(((e,r)=>{for(let i=0;i<t.length;i+=2)e<=t[i+1]&&r>=t[i]&&(n=!0)})),n}(n,e.prevRanges)),o=s?To(e.prevRanges,n.mapping):Co(n.mapping.maps[n.steps.length-1]);return new ko(e.done.addTransform(n,i?t.selection.getBookmark():void 0,r,So(t)),bo.empty,o,n.time)}}(n,r,t,e)},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r="historyUndo"==n?Oo:"historyRedo"==n?Io:null;return!!r&&(t.preventDefault(),r(e.state,e.dispatch))}}}})}const Oo=(e,t)=>{let n=Do.getState(e);return!(!n||0==n.done.eventCount)&&(t&&Eo(n,e,t,!1),!0)},Io=(e,t)=>{let n=Do.getState(e);return!(!n||0==n.undone.eventCount)&&(t&&Eo(n,e,t,!0),!0)};var Ro=function(e,t){return Ro=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])},Ro(e,t)};function Po(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}Ro(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var Bo=function(){return Bo=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},Bo.apply(this,arguments)};function Fo(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 Ho(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 zo=function(e,t){var n,r,i,o,s=Object.prototype.hasOwnProperty;for(i=1,o=arguments.length;i<o;i+=1)for(r in n=arguments[i])s.call(n,r)&&(e[r]=n[r]);return e};var jo=function(e){return"string"===typeof e||e instanceof String};var Vo=function(e){return e instanceof Array};var _o=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);},Uo=Vo,$o=_o,Wo=qo;var Go=function(e,t,n){Uo(e)?$o(e,t,n):Wo(e,t,n)},Jo=jo,Ko=Go;var Zo=function(e,t,n){var r=e.style;Jo(t)?r[t]=n:Ko(t,(function(e,t){r[t]=e}))},Xo=Vo;var Qo=function(e,t,n){var r,i;if(n=n||0,!Xo(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 Yo=function(e){return void 0===e},es=Yo;var ts=function(e){return e&&e.className?es(e.className.baseVal)?e.className:e.className.baseVal:""},ns=Vo,rs=Yo;var is=function(e,t){t=(t=ns(t)?t.join(" "):t).replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),rs(e.className.baseVal)?e.className=t:e.className.baseVal=t},ss=Go,as=Qo,ls=ts,cs=is;var us=function(e){var t,n=Array.prototype.slice.call(arguments,1),r=e.classList,i=[];r?ss(n,(function(t){e.classList.add(t)})):((t=ls(e))&&(n=[].concat(t.split(/\s+/),n)),ss(n,(function(e){as(e,i)<0&&i.push(e)})),cs(e,i))},ps=_o,ds=Qo,hs=ts,fs=is;var ms=function(e){var t,n,r=Array.prototype.slice.call(arguments,1),i=e.classList;i?ps(r,(function(e){i.remove(e)})):(t=hs(e).split(/\s+/),n=[],ps(t,(function(e){ds(e,r)<0&&n.push(e)})),fs(e,n))};var gs=function(e){return"number"===typeof e||e instanceof Number};var vs=function(e){return null===e},ys=qo;var bs=Yo,ws=function(e,t){var n=document.createElement("img"),r="";return ys(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},ks=6048e5;var xs=function(e,t){var n=location.hostname,r="TOAST UI "+e+" for "+n+": Statistics",i=window.localStorage.getItem(r);(bs(window.tui)||!1!==window.tui.usageStatistics)&&(i&&!function(e){return(new Date).getTime()-e>ks}(i)||(window.localStorage.setItem(r,(new Date).getTime()),setTimeout((function(){"interactive"!==document.readyState&&"complete"!==document.readyState||ws("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 Cs=/[\u0020]+/g,Ts=/[>(){}[\]+-.!#|]/g,Es=/<([a-zA-Z_][a-zA-Z0-9\-._]*)(\s|[^\\>])*\/?>|<(\/)([a-zA-Z_][a-zA-Z0-9\-._]*)\s*\/?>|<!--[^-]+-->|<([a-zA-Z_][a-zA-Z0-9\-.:/]*)>/g,Ms=/\\[!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~\\]/g,Ns=/[*_~`]/g,Ss=/!\[.*\]\(.*\)/g,Ds=/[[\]]/g,Ls=/(?:^|[^\\])\\(?!\\)/g,As=new RegExp('[&<>"]',"g");function Os(e){switch(e){case"&":return"&amp;";case"<":return"&lt;";case">":return"&gt;";case'"':return"&quot;";default:return e}}function Is(e){return As.test(e)?e.replace(As,Os):e}function Rs(e,t){return-1!==e.indexOf(t)}var Ps=["rel","target","hreflang","type"],Bs={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 Fs(e){if(!e)return null;var t={};return Ps.forEach((function(n){Yo(e[n])||(t[n]=e[n])})),t}function Hs(e,t){for(var n="",r=0;r<t;r+=1)n+=e;return n}function qs(e){for(var t=[],n=Ss.exec(e);n;)t.push([n.index,n.index+n[0].length]),n=Ss.exec(e);return e.replace(Ds,(function(e,n){var r=t.some((function(e){return n>e[0]&&n<e[1]}));return r?e:"\\"+e}))}function zs(e){var t=function(e){return"\\"+e},n=e.replace(Cs," ");return Ms.test(n)&&(n=n.replace(Ms,t)),Ls.test(n)&&(n=n.replace(Ls,(function(e){return e+"\\"}))),n=n.replace(Ns,t),Es.test(n)&&(n=n.replace(Es,t)),function(e){var t=!1;return qo(Bs,(function(n){return n.test(e)&&(t=!0),!t})),t}(n)&&(n=n.replace(Ts,t)),n}function js(e){var t;return(t=-1===e.indexOf('"')?'""':-1===e.indexOf("'")?"''":"()")[0]+e+t[1]}function Vs(e){return vs(e)||Yo(e)}function _s(e,t){if(null===e&&e===t)return!0;if("object"!==typeof e||"object"!==typeof t||Vs(e)||Vs(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 Us(e){return e[e.length-1]}function $s(e){return"object"===typeof e&&null!==e}function Ws(e,t){var n=Bo({},e);return e&&t&&Object.keys(t).forEach((function(e){$s(n[e])?Array.isArray(t[e])?n[e]=Gs(t[e]):n.hasOwnProperty(e)?n[e]=Ws(n[e],t[e]):n[e]=Js(t[e]):n[e]=t[e]})),n}function Gs(e){return e.map((function(e){return $s(e)?Array.isArray(e)?Gs(e):Js(e):e}))}function Js(e){var t=Object.keys(e);return t.length?t.reduce((function(t,n){return $s(e[n])?t[n]=Array.isArray(e[n])?Gs(e[n]):Js(e[n]):t[n]=e[n],t}),{}):e}function Ks(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]:Ks(e[n],t[n]):e[n]=t[n]})),e}function Zs(e,t){return e>t?[t,e]:[e,t]}var Xs=_o;var Qs=function(e){var t;try{t=Array.prototype.slice.call(e)}catch(n){t=[],Xs(e,(function(e){t.push(e)}))}return t};function Ys(e,t){var n=e.nodes.paragraph;return t?n.create(null,jo(t)?e.text(t):t):n.createAndFill()}function ea(e,t,n){return e.text(t,n)}function ta(e,t,n){void 0===n&&(n=t);var r=e.doc.content.size,i=r>0?r-1:1;return et.create(e.doc,Math.min(t,i),Math.min(n,i))}function na(e,t,n){var r=t.pos;return e.replaceWith(r,r,Ys(n)),e.setSelection(ta(e,r+1))}function ra(e){for(var t=e.state,n=e.from,r=e.startIndex,i=e.endIndex,o=e.createText,s=t.tr,a=t.doc,l=t.schema,u=r;u<=i;u+=1){var p=a.child(u),d=p.nodeSize,h=p.textContent,f=p.content,m=o(h),g=m?ea(l,m):c.empty,v=s.mapping.map(n),y=v+f.size;s.replaceWith(v,y,g),n+=d}return s}function ia(e,t,n,r){var i=n.length;e.split(t).delete(t-i,t).insert(e.mapping.map(t),r).setSelection(ta(e,e.mapping.map(t)-i))}function oa(e){return e.sourcepos[0][0]}function sa(e){return e.sourcepos[1][0]}function aa(e){return e.sourcepos[0][1]}function la(e){return e.sourcepos[1][1]}function ca(e){var t=e.type;return"strike"===t||"strong"===t||"emph"===t||"code"===t||"link"===t||"image"===t}function ua(e){return e&&("item"===e.type||"list"===e.type)}function pa(e){return ua(e)&&"ordered"===e.listData.type}function da(e){return ua(e)&&"ordered"!==e.listData.type}function ha(e){return e&&("tableCell"===e.type||"tableDelimCell"===e.type)}function fa(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 ma(e,t){return[e[0],e[1]+t]}function ga(e,t){return[e[0],t]}function va(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 ya(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}}function ba(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 wa=[],ka={},xa=/\$\$widget\d+\s/;function Ca(e){var t=e.search(xa);if(-1!==t){var n=e.substring(t).replace(xa,"").replace("$$","");e=e.substring(0,t),e+=Ca(n)}return e}function Ta(e,t){return"$$"+e+" "+t+"$$"}function Ea(e,t){var n=ka[e],r=n.rule,i=n.toDOM,o=Ca(t).match(r);return o&&(t=o[0]),i(t)}function Ma(){return wa}function Na(e){(wa=e).forEach((function(e,t){ka["widget"+t]=e}))}function Sa(e,t,n,r){return e.concat(Da(t,n,r))}function Da(e,t,n){void 0===n&&(n=0);var r=[],i=(wa[n]||{}).rule,o=n+1;if(e=Ca(e),i&&i.test(e)){for(var s=void 0;-1!==(s=e.search(i));){var a=e.substring(0,s);a&&(r=Sa(r,a,t,o));var l=(e=e.substring(s)).match(i)[0],c="widget"+n;r.push(t.nodes.widget.create({info:c},t.text(Ta(c,l)))),e=e.substring(l.length)}e&&(r=Sa(r,e,t,o))}else e&&(r=n<wa.length-1?Sa(r,e,t,o):[t.text(e)]);return r}function La(e){for(var t,n="",r=e.walker();t=r.next();){var i=t.node;t.entering&&(i!==e&&"text"!==i.type?(n+=va(i),r.resumeAt(e,!1),r.next()):"text"===i.type&&(n+=i.literal))}return n}function Aa(){return{deleteSelection:function(){return qi},selectAll:function(){return Ji},undo:function(){return Oo},redo:function(){return Io}}}var Oa=Qo,Ia=ts;var Ra=function(e,t){var n;return e.classList?e.classList.contains(t):(n=Ia(e).split(/\s+/),Oa(t,n)>-1)},Pa=Qo,Ba=Qs,Fa=Element.prototype,Ha=Fa.matches||Fa.webkitMatchesSelector||Fa.mozMatchesSelector||Fa.msMatchesSelector||function(e){var t=this.document||this.ownerDocument;return Pa(this,Ba(t.querySelectorAll(e)))>-1};var qa=function(e,t){return Ha.call(e,t)},za="[A-Za-z][A-Za-z0-9-]*",ja="(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^\"'=<>`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)",Va="<("+za+")("+ja+")*\\s*/?>",_a="(?:"+Va+"|"+("</("+za+")\\s*[>]")+")",Ua=new RegExp("^"+_a,"i"),$a=/<br\s*\/*>/i,Wa=/<! ---->|<!--(?:-?[^>-])(?:-?[^-])*-->/,Ga="</p><p>";function Ja(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),s=parseInt(e.height,10)+parseInt(e.paddingTop,10)+parseInt(e.paddingBottom,10);return t>=r&&t<=r+o&&n>=i&&n<=i+s}var Ka="toastui-editor-";function Za(){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],s=void 0;(s=Array.isArray(o)?o[0]?o[1]:null:o)&&n.push(""+Ka+s)}return n.join(" ")}function Xa(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.map((function(e){return Ka+"md-"+e})).join(" ")}function Qa(e){return e&&e.nodeType===Node.ELEMENT_NODE}function Ya(e){e.parentNode&&e.parentNode.removeChild(e)}function el(e,t,n){Yo(n)&&(n=!Ra(e,t)),(n?us:ms)(e,t)}function tl(e,t){var n=document.createElement("div");jo(e)?n.innerHTML=e:n.appendChild(e);var r=n.firstChild;return t&&t.appendChild(r),r}function nl(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 rl(e,t){var n;for(n=jo(t)?function(e){return qa(e,t)}:function(e){return e===t};e&&e!==document;){if(Qa(e)&&n(e))return e;e=e.parentNode}return null}function il(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 ol(e,t){Object.keys(e).forEach((function(n){Vs(e[n])?t.removeAttribute(n):t.setAttribute(n,e[n])}))}function sl(e){var t=e;return t=(t=t.replace(/<img class="ProseMirror-separator" alt="">/g,"")).replace(/ class="ProseMirror-trailingBreak"/g,"")}var al=new yt("widget"),ll=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=rl(e.dom.parentElement,"."+Za("defaultUI"))})),this.eventEmitter.listen("removePopupWidget",this.removeWidget)}return e.prototype.update=function(e){var t=al.getState(e.state);if(this.removeWidget(),t){var n=t.node,r=t.style,i=e.coordsAtPos(t.pos),o=i.top,s=i.left,a=i.bottom-o,l=this.rootEl.getBoundingClientRect(),c=o-l.top;Zo(n,{opacity:"0"}),this.rootEl.appendChild(n),Zo(n,{position:"absolute",left:s-l.left+5+"px",top:("bottom"===r?c+a-5:c-a)+"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 ul(e){var t=Qs(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 pl(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&&_o(i,(function(e){return-1===e.type.indexOf("image")||(n.preventDefault(),n.stopPropagation(),cl(t,e,n.type),!1)})),!0}}}})}var dl=function(){function e(){}return Object.defineProperty(e.prototype,"type",{get:function(){return"node"},enumerable:!1,configurable:!0}),e.prototype.setContext=function(e){this.context=e},e}();function hl(e){var t=document.createElement("span"),n=Ea(e.attrs.info,e.textContent);return t.className="tui-widget",t.appendChild(n),{dom:t}}function fl(e){return"widget"===e.type.name}var ml=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Po(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}(dl),gl=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 ht.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=Fo(Fo([],this.keymaps),[Fi(Bo({"Shift-Enter":ao.Enter},ao)),Ao(),(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 us(r,"placeholder"),t.className&&us(r,t.className),r.textContent=t.text,Yr.create(n,[Zr.widget(1,r)])}return null}}})),(e=this.eventEmitter,new mt({key:al,state:{init:function(){return null},apply:function(e){return e.getMeta("widget")}},view:function(t){return new ll(t,e)}})),pl(this.context)]);return n?r.concat(n):r},enumerable:!1,configurable:!0}),e.prototype.createInputRules=function(){var e=Ma().map((function(e){var t=e.rule;return new lo(t,(function(e,n,r,i){var o=e.schema,s=e.tr,a=e.doc,l=n.input.match(new RegExp(t,"g")),c=a.resolve(r),u=c.parent,p=0;if(fl(u)&&(u=c.node(c.depth-1)),u.forEach((function(e){return fl(e)&&(p+=1)})),l.length>p){var d=Us(l),h=Da(d,o);return s.replaceWith(i-d.length+1,i,h)}return null}))}));return e.length?uo({rules:e}):null},e.prototype.clearTimer=function(){this.timer&&(clearTimeout(this.timer),this.timer=null)},e.prototype.createSchema=function(){return new X({nodes:this.specs.nodes,marks:this.specs.marks})},e.prototype.createKeymaps=function(e){var t=Aa(),n=t.undo,r=t.redo,i=this.specs.keymaps(e),o={"Mod-z":n(),"Shift-Mod-z":r()};return e?i.concat(Fi(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(ta(t,1)).scrollIntoView()),e&&this.focus()},e.prototype.moveCursorToEnd=function(e){var t=this.view.state.tr;this.view.dispatch(t.setSelection(ta(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){Zo(this.el,{height:e+"px"})},e.prototype.setMinHeight=function(e){Zo(this.el,{minHeight:e+"px"})},e.prototype.getElement=function(){return this.el},e}();var vl=function(e){return e instanceof Function},yl=["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 bl(e,t,n){return e.focus(),t(n)(e.state,e.dispatch,e)}var wl=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 Bo(Bo({},e),((n={})[r]=i,n))}),{})},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 Bo(Bo({},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 vl(i)?r[n.name]=function(t){return bl(e,i,t)}:Object.keys(i).forEach((function(t){r[t]=function(n){return bl(e,i[t],n)}})),Bo(Bo({},t),r)}),{}),r=Aa();return Object.keys(r).forEach((function(t){n[t]=function(n){return bl(e,r[t],n)}})),t&&Object.keys(t).forEach((function(r){n[r]=function(n){return bl(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){Rs(yl,e)||delete t[e]})),Fi(t)}))},e.prototype.setContext=function(e){this.specs.forEach((function(t){t.setContext(e)}))},e}();function kl(e){var t=e.from,n=e.to;return e instanceof it?[t+1,n-1]:[t,n]}function xl(e){return e.index(0)+1}function Cl(e,t,n){void 0===n&&(n=1);var r=0;return e.forEach((function(e,i){fl(e)&&i+2<t&&(r+=2*n)})),r}function Tl(e,t,n){void 0===n&&(n=t);var r=t===n,i=e.resolve(t),o=xl(i),s=o,a=i.start(1),l=a;if(!r){var c=e.resolve(n===e.content.size?n-1:n);l=c.start(1),s=xl(c),c.pos===e.content.size&&(n=e.content.size-2)}var u=Math.max(t-a+1,1),p=Math.max(n-l+1,1);return[[o,u+Cl(e.child(o-1),u,-1)],[s,p+Cl(e.child(s-1),p,-1)]]}function El(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 Ml(e,t,n){var r=El(e,n[0]),i=t[0]-1,o=n[0]-1,s=e.child(i),a=e.child(o),l=r[i],c=r[o];return l+=t[1]+Cl(s,t[1]-1),c+=n[1]+Cl(a,n[1]-1),[l,Math.min(c,e.content.size)]}function Nl(e){var t=e.$from,n=e.$to,r=e.from,i=e.to,o=t.doc;return e instanceof it&&(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 Sl(e,t){for(var n=1,r=1,i=0,o=0;i<e.childCount;i+=1){var s=e.child(i).nodeSize;if(n=o+1,r=o+s-1,i===t)break;o+=s}return{startOffset:n,endOffset:r}}var Dl="heading",Ll="listItem",Al="link",Ol="code",Il="meta",Rl="delimiter",Pl="markedText",Bl={strong:2,emph:1,strike:2};function Fl(e,t,n,r){return{start:e,end:t,spec:{type:n,attrs:r}}}function Hl(e,t,n){var r=e.type,i=ma(t,Bl[r]),o=ma(n,-Bl[r]);return[Fl(i,o,r),Fl(t,i,Rl),Fl(o,n,Rl)]}function ql(e,t,n,r){return[Fl(e,t,Al),Fl(ga(e,n[1]+1),ga(t,r),Al,{desc:!0}),Fl(ga(t,r+2),ma(t,-1),Al,{url:!0})]}function zl(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?[Bo(Bo({},i),{end:t,spec:{attrs:{className:r+"-line-background start"}}}),Bo(Bo({},i),{start:[Math.min(t[0]+1,n[0]),t[1]]})]:null}function jl(e,t){for(var n=[];e;){var r=e.type;"paragraph"!==r&&"codeBlock"!==r||n.push(Fl([oa(e),aa(e)-1],[sa(e),la(e)+1],t)),e=e.next}return n}var Vl={heading:function(e,t,n){var r=e.level,i=e.headingType,o=[Fl(t,n,Dl,{level:r})];return"atx"===i?o.push(Fl(t,ma(t,r),Rl)):o.push(Fl(ga(n,0),n,Dl,{seText:!0})),o},strong:Hl,emph:Hl,strike:Hl,link:function(e,t,n){var r=e.lastChild,i=e.extendedAutolink,o=r?la(r)+1:2;return i?[Fl(t,n,Al,{desc:!0})]:ql(t,n,t,o)},image:function(e,t,n){var r=e.lastChild,i=r?la(r)+1:3,o=ma(t,1);return Fo([Fl(t,o,Il)],ql(t,n,o,i))},code:function(e,t,n){var r=e.tickCount,i=ma(t,r),o=ma(n,-r);return[Fl(t,n,Ol),Fl(t,i,Ol,{start:!0}),Fl(i,o,Ol,{marked:!0}),Fl(o,n,Ol,{end:!0})]},codeBlock:function(e,t,n,r){var i=e.fenceOffset,o=e.fenceLength,s=e.fenceChar,a=e.info,l=e.infoPadding,c=e.parent,u=i+o,p=[Fl(ga(t,1),n,"codeBlock")];s&&p.push(Fl(t,ma(t,u),Rl)),a&&p.push(Fl(ma(t,o),ma(t,o+l+a.length),Il)),new RegExp("^(\\s{0,4})("+s+"{"+o+",})").test(r)&&p.push(Fl(ga(n,1),n,Rl));var d=zl(c,t,n,"code-block");return d?p.concat(d):p},blockQuote:function(e,t,n){var r=e.parent&&"blockQuote"!==e.parent.type?[Fl(t,n,"blockQuote")]:[];if(e.firstChild){var i=[];"paragraph"===e.firstChild.type?i=function(e){for(var t=[];e;)t.push(Fl([oa(e),aa(e)],[sa(e),la(e)+1],Pl)),e=e.next;return t}(e.firstChild.firstChild):"list"===e.firstChild.type&&(i=jl(e.firstChild,Pl)),r=Fo(Fo([],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[Ll,Bo(Bo({},[{odd:!0},{even:!0}][t%2]),{listStyle:!0})]}(e),s=[Fl.apply(void 0,Fo([t,ma(t,r)],o))];return i&&(s.push(Fl(ma(t,r),ma(t,r+3),"taskDelimiter")),s.push(Fl(ma(t,r+1),ma(t,r+2),Il))),s.concat(jl(e.firstChild,Pl))},customBlock:function(e,t,n){var r=e,i=r.offset,o=r.syntaxLength,s=r.info,a=r.parent,l=i+o,c=[Fl(ga(t,1),n,"customBlock")];c.push(Fl(t,ma(t,l),Rl)),s&&c.push(Fl(ma(t,l),ma(t,o+s.length),Il)),c.push(Fl(ga(n,1),n,Rl));var u=zl(a,t,n,"custom-block");return u?c.concat(u):c}},_l={thematicBreak:"thematicBreak",table:"table",tableCell:"tableCell",htmlInline:"html"};function Ul(e,t,n,r){var i=e.type;return vl(Vl[i])?Vl[i](e,t,n,r):_l[i]?[Fl(t,n,_l[i])]:null}var $l={};function Wl(e){var t=e.schema,n=e.toastMark;return new mt({appendTransaction:function(e,r,i){var o=e[0],s=i.tr;if(o.docChanged){var a=[];o.getMeta("editResult").forEach((function(e){var t=e.nodes,r=e.removedNodeRange;if(t.length){a=a.concat(function(e,t){var n=e.doc,r=t[0].sourcepos[0],i=Us(t).sourcepos,o=i[1],s=[r[0],r[1]],a=[o[0],o[1]+1],l=[];return function(e,t,n){var r=[];$l={};for(var i=t[0]-1;i<n[0];i+=1){var o=e.child(i),s=o.attrs.codeEnd,a=o.attrs.codeStart;if(a&&s&&!Rs(r,a)){r.push(a),s=Math.min(s,e.childCount);for(var l=a-1,c=n[0],u=l;u<c;u+=1)$l[u]=!0}}}(n,r,o),l.push({start:s,end:a}),l}(s,t));for(var i=0,o=t;i<o.length;i++)for(var l=o[i].walker(),c=l.next();c;){var u=c.node;c.entering&&(a=a.concat(Jl(u,n))),c=l.next()}}else if(r)for(var p=s.doc.childCount-1,d=r.line,h=d[0],f=d[1],m=Math.min(h,p),g=Math.min(f,p),v=m;v<=g;v+=1)$l[v]=!0})),function(e,t,n){var r=e.doc,i=t.nodes.paragraph,o=El(r,r.childCount);n.forEach((function(n){var s=n.start,a=n.end,l=n.spec,c=n.lineBackground,u=Math.min(s[0],r.childCount)-1,p=Math.min(a[0],r.childCount)-1,d=r.child(u),h=r.child(p),f=o[u],m=o[p];(f+=s[1]+Cl(d,s[1]-1),m+=a[1]+Cl(h,a[1]-1),l)?c?function(e,t,n,r,i){void 0===i&&(i={});for(var o=r.startIndex,s=r.endIndex,a=r.from,l=r.to,c=!1,u=o;u<=s;u+=1)delete $l[u],c=Gl(t,u,i);c&&e.setBlockType(a,l,n,i)}(e,r,i,{from:f,to:m,startIndex:u,endIndex:p},l.attrs):e.addMark(f,m,t.mark(l.type,l.attrs)):e.removeMark(f,m)})),function(e,t,n){Object.keys($l).forEach((function(r){var i=Number(r),o=Math.min(Number(r)+1,e.doc.childCount-1),s=t[i],a=t[o]-1;i===o&&(a+=2),e.setBlockType(s,a,n)}))}(e,o,i)}(s,t,a)}return s.setMeta("widget",o.getMeta("widget"))}})}function Gl(e,t,n){return Object.keys(n).some((function(r){return n[r]!==e.child(t).attrs[r]}))}function Jl(e,t){var n=t.getLineTexts(),r=[oa(e),aa(e)],i=[sa(e),la(e)+1],o=Ul(e,r,i,n[i[0]-1]);return null!==o&&void 0!==o?o:[]}var Kl=["taskList","orderedList","bulletList","table","strong","emph","strike","heading","thematicBreak","blockQuote","code","codeBlock","indent","outdent"];function Zl(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 ua(e)?e.listData.task?"taskList":"ordered"===e.listData.type?"orderedList":"bulletList":-1!==t.indexOf("table")?"table":Rs(Kl,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 Xl(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,s=i.selection;if(!(r&&r.doc.eq(o)&&r.selection.eq(s))){var a=s.from,l=i.doc.resolve(a).start(),c=a-l;a===l&&(c+=1);var u=[i.doc.content.findIndex(a).index+1,c],p=t.findNodeAtPosition(u),d=Zl(p);n.emit("changeToolbarState",{cursorPos:u,mdNode:p,toolbarState:d}),n.emit("setFocusedNode",p)}}}}})}var Ql=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Po(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}(dl),Yl=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 ec(e,t){return tc(e,t-1)}function tc(e,t){return e.child(t).textContent}var nc=/^\s*> ?/,rc=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Po(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:Xa("block-quote")},0]}}},enumerable:!1,configurable:!0}),t.prototype.createBlockQuoteText=function(e,t){return t?e.replace(nc,"").trim():"> "+e.trim()},t.prototype.extendBlockQuote=function(){var e=this;return function(t,n){var r=t.selection,i=t.doc,o=t.tr,s=t.schema,a=Nl(r),l=a.endFromOffset,c=a.endToOffset,u=a.endIndex,p=a.to,d=tc(i,u);if(nc.test(d)&&p>l&&r.empty){if(!d.replace(nc,"").trim())o.deleteRange(l,c).split(o.mapping.map(c));else{var h=d.slice(p-l).trim();ia(o,c,h,ea(s,e.createBlockQuoteText(h)))}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=Nl(r),s=o.startFromOffset,a=o.endToOffset,l=o.startIndex,c=o.endIndex,u=nc.test(tc(i,l)),p=ra({state:t,startIndex:l,endIndex:c,from:s,createText:function(t){return e.createBlockQuoteText(t,u)}});return n(p.setSelection(ta(p,p.mapping.map(a)))),!0}}},t.prototype.keymaps=function(){var e=this.commands()();return{"alt-q":e,"alt-Q":e,Enter:this.extendBlockQuote()}},t}(Yl),ic=/(^\s*)([-*+] |[\d]+\. )/,oc=/(^\s*)([\d])+\.( \[[ xX]])? /,sc=/^(\s*)((\d+)([.)]\s(?:\[(?:x|\s)\]\s)?))(.*)/,ac=/(^\s*)([-*+]|[\d]+\.)( \[[ xX]])? /,lc=/^(\s*)([-*+]+(\s(?:\[(?:x|\s)\]\s)?))(.*)/,cc=/(^\s*)([-*+] |[\d]+\. )(\[[ xX]] )/,uc=/(^\s*)([-*+])( \[[ xX]]) /;function pc(e){return oc.test(e)?"ordered":"bullet"}function dc(e){for(var t=0;e&&"document"!==e.type;)"list"===e.type&&(t+=1),e=e.parent;return t}function hc(e,t,n,r){for(var i=e.getLineTexts().length,o=[],s=t;r?s<i:s>1;){s=r?s+1:s-1;var a=e.findFirstNodeAtLine(s),l=dc(a);if(l===n)o.push({line:s,depth:n,mdNode:a});else if(l<n)break}return o}function fc(e,t,n,r){void 0===r&&(r=0);var i=Number.MAX_VALUE,o=0,s=t.map((function(t,s){var a=t.line;i=Math.min(a-1,i),o=Math.max(a-1,o);var l=ec(e,a);return l="bullet"===n?function(e){if(!ic.test(e))return"* "+e;var t=pc(e);return"bullet"===t&&ac.test(e)?e=e.replace(uc,"$1$2 "):"ordered"===t&&(e=e.replace(oc,"$1* ")),e}(l):function(e,t){if(!ic.test(e))return t+". "+e;var n=pc(e);if("bullet"===n||"ordered"===n&&ac.test(e))e=e.replace(ac,"$1"+t+". ");else if("ordered"===n){var r=sc.exec(e)[3];Number(r)!==t&&(e=e.replace(oc,"$1"+t+". "))}return e}(l,s+1+r),{text:l,line:a}}));return{changedResults:s,firstIndex:i,lastIndex:o}}function mc(e,t){var n=function(e){var t=e.toastMark,n=e.mdNode,r=e.line,i=dc(n),o=hc(t,r,i,!1).reverse(),s=hc(t,r,i,!0);return o.concat([{line:r,depth:i,mdNode:n}]).concat(s)}(t);return fc(t.doc,n,e)}var gc={bullet:function(e){return mc("bullet",e)},ordered:function(e){return mc("ordered",e)},task:function(e){var t=e.mdNode,n=e.doc,r=e.line,i=ec(n,r);return t.listData.task?i=i.replace(cc,"$1$2"):ua(t)&&(i=i.replace(ic,"$1$2[ ] ")),{changedResults:[{text:i,line:r}]}}},vc={bullet:function(e){var t=e.doc,n=e.line;return{changedResults:[{text:"* "+ec(t,n),line:n}]}},ordered:function(e){for(var t=e.toastMark,n=e.doc,r=e.line,i=e.startLine,o=ec(n,r),s=1,a=i,l=0,c=i-1;c>0;c-=1){var u=t.findFirstNodeAtLine(c),p=ec(n,c)&&!!fa(u,(function(e){return ua(e)})),d=sc.exec(ec(n,c));if(!d&&!p)break;if(d||!p){var h=d,f=h[1],m=h[3];if(!f){s=Number(m),a=c;break}}else l+=1}return{changedResults:[{text:s+r-a-l+". "+o,line:r}]}},task:function(e){var t=e.doc,n=e.line;return{changedResults:[{text:"* [ ] "+ec(t,n),line:n}]}}},yc={bullet:function(e){var t=e.line,n=ec(e.doc,t),r=lc.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=dc(r),s=ec(i,n),a=sc.exec(s),l=a[1],c=a[3],u=a[4],p=Number(c)+1,d=""+l+p+u,h=hc(t,n,o,!0).filter((function(e){var t=sc.exec(ec(i,e.line));return t&&t[1].length===l.length&&!!fa(e.mdNode,(function(e){return pa(e)}))}));return Bo({listSyntax:d},fc(i,h,"ordered",p))}};function bc(e,t,n,r,i){for(var o=[],s=ec(e,n),a=sc.exec(s);a;){var l=a[1],c=a[4],u=a[5],p=l.length;if(p===i)o.push(ea(t,""+l+r+c+u)),r+=1,n+=1;else if(p>i){var d=bc(e,t,n,1,p);n=d.line,o=o.concat(d.nodes)}if(p<i||n>e.childCount)break;s=ec(e,n),a=sc.exec(s)}return{nodes:o,line:n}}var wc=/(^\s{1,4})(.*)/;function kc(e,t,n){return e<t||ic.test(n)||nc.test(n)}function xc(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),s=i.content.size;return i.rangeHasMark(0,s,t.marks.table)&&r.pos-o!==s&&r.pos!==o}function Cc(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 ta(e,n,r)}var Tc=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Po(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:Xa(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,s=r.state,a=s.tr,l=s.selection,c=s.doc,u=i.findFirstNodeAtLine(e),p=u;u&&!da(u)&&"document"!==u.parent.type;)if(pa(u=u.parent)){p=u;break}p&&(e=p.sourcepos[0][0]);var d=sc.exec(ec(c,e)),h=d[1],f=d[3],m=h.length,g=bc(c,o,e,Number(f),m),v=g.line,y=g.nodes;t=Math.max(t,v-1);for(var b=Sl(c,e-1).startOffset,w=e-1;w<=t-1;w+=1){var k=c.child(w),x=k.nodeSize,C=k.content,T=a.mapping.map(b),E=T+C.size;a.replaceWith(T,E,y[w-e+1]),b+=x}var M=ta(a,l.from,l.to);r.dispatch(a.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,s=n.doc,a=Nl(o),l=a.from,c=a.to,u=a.startFromOffset,p=a.startIndex,d=a.endIndex;if(e&&xc(s,i,o))return!1;var h=tc(s,p);if(e&&kc(l,c,h)||!e&&ic.test(h)){var f=ra({state:n,from:u,startIndex:p,endIndex:d,createText:function(e){return" "+e}}),m={type:"indent",from:l,to:c,lineLen:d-p};r(f.setSelection(Cc(f,m))),sc.test(h)&&t.reorderList(p+1,d+1)}else e&&r(n.tr.insert(c,ea(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,s=n.schema,a=Nl(i),l=a.from,c=a.to,u=a.startFromOffset,p=a.startIndex,d=a.endIndex;if(e&&xc(o,s,i))return!1;var h=tc(o,p);if(e&&kc(l,c,h)||!e&&ic.test(h)){var f=[],m=ra({state:n,from:u,startIndex:p,endIndex:d,createText:function(e){var t=wc.exec(e);return f.push(t?t[1].length:0),e.replace(wc,"$2")}}),g={type:"outdent",from:l,to:c,spaceLenList:f};r(m.setSelection(Cc(m,g))),sc.test(h)&&t.reorderList(p+1,d+1)}else if(e){var v=h.slice(0,c-u),y=v.replace(/\s{1,4}$/,""),b=c-(v.length-y.length);r(n.tr.delete(b,c))}return!0}}},t.prototype.deleteLines=function(){var e=this;return function(t,n){var r=e.context.view,i=Nl(t.selection),o=i.startFromOffset,s=i.endToOffset;return no((function(){return n(t.tr.deleteRange(o,s)),!0}),Vi)(t,n,r)}},t.prototype.moveDown=function(){return function(e,t){var n=e.doc,r=e.tr,i=e.selection,o=e.schema,s=Nl(i),a=s.startFromOffset,l=s.endToOffset,c=s.endIndex;if(c<n.content.childCount-1){var u=n.child(c+1),p=u.nodeSize,d=u.textContent;return r.delete(l,l+p).split(a).insert(r.mapping.map(a)-2,ea(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,s=Nl(i),a=s.startFromOffset,l=s.endToOffset,c=s.startIndex;if(c>0){var u=r.child(c-1),p=u.nodeSize,d=u.textContent;return n.delete(a-p,a).split(n.mapping.map(l)).insert(n.mapping.map(l),ea(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}(dl),Ec=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Po(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}(dl),Mc=/^#{1,6}\s/,Nc=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Po(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:Xa.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=Nl(n.selection),s=o.startFromOffset,a=o.endToOffset,l=ra({state:n,from:s,startIndex:o.startIndex,endIndex:o.endIndex,createText:function(t){var n=t.match(Mc),r=n?n[0]:"";return e.createHeadingText(i,t,r)}});return r(l.setSelection(ta(l,l.mapping.map(a)))),!0}}},t}(Yl),Sc="```",Dc=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Po(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"codeBlock"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return{toDOM:function(){return["span",{class:Xa("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=Nl(n),s=o.startFromOffset,a=o.endToOffset,l=ea(r,Sc);return i.insert(s,l).split(s+3),i.split(i.mapping.map(a)).insert(i.mapping.map(a),l),t(i.setSelection(ta(i,i.mapping.map(a)-5))),!0}}},t.prototype.keepIndentation=function(){var e=this;return function(t,n){var r=t.selection,i=t.tr,o=t.doc,s=t.schema,a=e.context.toastMark,l=Nl(r),c=l.startFromOffset,u=l.endToOffset,p=l.endIndex,d=l.from,h=l.to,f=tc(o,p);if(d===h&&f.trim()){var m=f.match(/^\s+/);if(function(e){return e&&"codeBlock"===e.type}(a.findFirstNodeAtLine(p+1))&&m){var g=m[0],v=f.slice(h-c);return ia(i,u,v,ea(s,g+v)),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}(Yl),Lc=/\||\s/g;function Ac(e,t){for(var n="|",r=0;r<e;r+=1)n+=t?" --- |":" |";return n}var Oc=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Po(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:Xa("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,s=t.schema;if(!r.empty)return!1;var a=Nl(r),l=a.endFromOffset,c=a.endToOffset,u=a.endIndex,p=a.to,d=tc(i,u),h=[u+1,p-l+1],f=fa(e.context.toastMark.findNodeAtPosition(h),(function(e){return ha(e)&&("tableDelimRow"===e.parent.type||"tableBody"===e.parent.parent.type)}));if(f){var m=!d.replace(Lc,"").trim(),g=Ac(f.parent.parent.parent.columns.length);return m?o.deleteRange(l,c).split(o.mapping.map(c)):o.split(c).insert(o.mapping.map(c),ea(s,g)).setSelection(ta(o,o.mapping.map(c)-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,s=Nl(i),a=s.endFromOffset,l=[s.endIndex+1,s.to-a],c=fa(t.context.toastMark.findNodeAtPosition(l),(function(e){return ha(e)}));if(c){var u=c.parent,p=function(e){return e?{type:"next",parentType:"tableHead",childType:"firstChild"}:{type:"prev",parentType:"tableBody",childType:"lastChild"}}(e),d=p.type,h=p.parentType,f=p.childType,m=la(c);if(c[d])m=la(c[d])-1;else{var g=u[d]||u.parent.type!==h?u[d]:u.parent[d][f];if("next"===d)m+=(g?la(g[f]):0)+2;else"prev"===d&&(m=g?-4:0)}return r(o.setSelection(ta(o,a+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,s=e,a=s.columnCount,l=s.rowCount,c=Nl(r).endToOffset,u=function(e){return[Ac(e),Ac(e,!0)]}(a),p=function(e,t){for(var n=[],r=0;r<t;r+=1)n.push(Ac(e));return n}(a,l-1);return Fo(Fo([],u),p).forEach((function(e){i.split(i.mapping.map(c)).insert(i.mapping.map(c),ea(o,e))})),n(i.setSelection(ta(i,c+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}(Yl),Ic=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Po(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:Xa("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=Nl(n),s=o.from,a=o.to,l=o.endToOffset,c=ea(r,"***");return i.split(s).replaceWith(i.mapping.map(s),i.mapping.map(a),c).split(i.mapping.map(a)).setSelection(ta(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}(Yl);function Rc(e,t){var n=e.type;return t<=e.sourcepos[0][0]&&("codeBlock"===n||"heading"===n||n.match("table"))}var Pc=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Po(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"listItem"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return{attrs:{odd:{default:!1},even:{default:!1},listStyle:{default:!1}},toDOM:function(e){var t=e.attrs,n=t.odd,r=t.even,i="list-item";return t.listStyle&&(i+="|list-item-style"),n&&(i+="|list-item-odd"),r&&(i+="|list-item-even"),["span",{class:Xa.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,s=t.tr,a=e.context.toastMark,l=Nl(r),c=l.to,u=l.startFromOffset,p=l.endFromOffset,d=l.endIndex,h=l.endToOffset,f=tc(i,d);if(!ic.test(f)||r.from===u||!r.empty)return!1;if(!f.replace(ac,"").trim())s.deleteRange(p,h).split(s.mapping.map(h));else{var m=pc(f),g=a.findFirstNodeAtLine(d+1),v=f.slice(c-p),y={toastMark:a,mdNode:g,doc:i,line:d+1},b=yc[m](y),w=b.listSyntax,k=b.changedResults;if(null===k||void 0===k?void 0:k.length){s.split(c),k.unshift({text:w+v,line:d+1}),e.changeToListPerLine(s,k,{from:c,startLine:k[0].line,endLine:Us(k).line});var x=s.mapping.map(h)-v.length;s.setSelection(ta(s,x))}else{ia(s,h,v,ea(o,w+v))}}return n(s),!0}},t.prototype.toList=function(e){var t=this;return function(){return function(n,r){for(var i=n.doc,o=n.tr,s=n.selection,a=t.context.toastMark,l=Nl(s),c=l.startIndex+1,u=l.endIndex+1,p=l.endToOffset,d=[],h=c;h<=u;h+=1){var f=a.findFirstNodeAtLine(h);if(f&&Rc(f,h))break;if(-1===d.indexOf(h)){var m={toastMark:a,mdNode:f,doc:i,line:h,startLine:c},g=(ua(f)?gc[e](m):vc[e](m)).changedResults,v=t.changeToListPerLine(o,g,{from:Sl(i,g[0].line-1).startOffset,startLine:g[0].line,endLine:Us(g).line,indexDiff:1});p=Math.max(v,p),g&&(d=d.concat(g.map((function(e){return e.line}))))}}return r(o.setSelection(ta(o,o.mapping.map(p)))),!0}}},t.prototype.changeToListPerLine=function(e,t,n){for(var r=n.from,i=n.startLine,o=n.endLine,s=n.indexDiff,a=void 0===s?0:s,l=0,c=function(n){var i=e.doc.child(n),o=i.nodeSize,s=i.content,c=e.mapping.map(r),p=c+s.size,d=t.filter((function(e){return e.line-a===n}))[0];d&&(e.replaceWith(c,p,ea(u.context.schema,d.text)),l=Math.max(l,r+s.size)),r+=o},u=this,p=i-a;p<=o-a;p+=1)c(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,s=t.schema,a=e.context.toastMark,l=Nl(r),c=l.startIndex,u=l.endIndex,p=null,d=c;d<=u;d+=1){var h=a.findFirstNodeAtLine(d+1);if(ua(h)&&h.listData.task){var f=h.listData,m=f.checked,g=f.padding,v=m?" ":"x",y=h.sourcepos[0],b=Sl(o,y[0]-1).startOffset;b+=y[1]+g,p=i.replaceWith(b,b+1,s.text(v))}}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}(Yl);function Bc(e,t){return function(){return function(n,r){var i=n.tr,o=n.selection,s=vl(e)?e:function(t){return e.test(t)},a=t.length,l=i.doc,c=kl(o),u=c[0],p=c[1],d=Math.max(u-a,1),h=Math.min(p+a,l.content.size-1),f=o.content(),m=f.content.textBetween(0,f.content.size,"\n"),g=l.textBetween(d,u,"\n"),v=l.textBetween(p,h,"\n");if(m=""+g+m+v,g&&v&&s(m))i.delete(h-a,h).delete(d,d+a);else{i.insertText(t,p).insertText(t,u);var y=o.empty?ta(i,u+a):ta(i,u+a,p+a);i.setSelection(y)}return r(i),!0}}}var Fc=/^(\*{2}|_{2}).*([\s\S]*)\1$/m,Hc=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Po(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:Xa("strong")},0]}}},enumerable:!1,configurable:!0}),t.prototype.bold=function(){return Bc(Fc,"**")},t.prototype.commands=function(){return{bold:this.bold()}},t.prototype.keymaps=function(){var e=this.bold()();return{"Mod-b":e,"Mod-B":e}},t}(Yl),qc=/^(~{2}).*([\s\S]*)\1$/m,zc=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Po(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"strike"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return{toDOM:function(){return["span",{class:Xa("strike")},0]}}},enumerable:!1,configurable:!0}),t.prototype.commands=function(){return Bc(qc,"~~")},t.prototype.keymaps=function(){var e=this.commands()();return{"Mod-s":e,"Mod-S":e}},t}(Yl),jc=/^(\*|_).*([\s\S]*)\1$/m,Vc=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Po(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:Xa("emph")},0]}}},enumerable:!1,configurable:!0}),t.prototype.italic=function(){return Bc(jc,"*")},t.prototype.commands=function(){return{italic:this.italic()}},t.prototype.keymaps=function(){var e=this.italic()();return{"Mod-i":e,"Mod-I":e}},t}(Yl),_c=/^(`).*([\s\S]*)\1$/m,Uc=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Po(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:Xa.apply(void 0,n.split("|"))},0]}}},enumerable:!1,configurable:!0}),t.prototype.commands=function(){return Bc(_c,"`")},t.prototype.keymaps=function(){var e=this.commands()();return{"Shift-Mod-c":e,"Shift-Mod-C":e}},t}(Yl),$c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Po(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:Xa.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,s=n.schema,a=kl(i),l=a[0],c=a[1],u=t,p=u.linkText,d=u.altText,h=u.linkUrl,f=u.imageUrl,m=p,g=h,v="";return"image"===e&&(m=d,g=f,v="!"),v+="["+(m=qs(m))+"]("+g+")",r(o.replaceWith(l,c,ea(s,v))),!0}}},t.prototype.commands=function(){return{addImage:this.addLinkOrImage("image"),addLink:this.addLinkOrImage("link")}},t}(Yl),Wc=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Po(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:Xa("delimiter","list-item")},0]}}},enumerable:!1,configurable:!0}),t}(Yl),Gc=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Po(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:Xa("delimiter")},0]}}},enumerable:!1,configurable:!0}),t}(Yl),Jc=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Po(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:Xa("meta")},0]}}},enumerable:!1,configurable:!0}),t}(Yl),Kc=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Po(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:Xa("marked-text")},0]}}},enumerable:!1,configurable:!0}),t}(Yl),Zc=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Po(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"tableCell"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return{toDOM:function(){return["span",{class:Xa("table-cell")},0]}}},enumerable:!1,configurable:!0}),t}(Yl),Xc=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Po(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:Xa("html")},0]}}},enumerable:!1,configurable:!0}),t}(Yl),Qc="$$",Yc=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Po(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:Xa("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,s=Nl(r),a=s.startFromOffset,l=s.endToOffset;if(!(null===e||void 0===e?void 0:e.info))return!1;var c="$$"+e.info,u=ea(i,c),p=ea(i,Qc);return o.insert(a,u).split(a+c.length),o.split(o.mapping.map(l)).insert(o.mapping.map(l),p),n(o.setSelection(ta(o,o.mapping.map(l)-4))),!0}}},t}(Yl),eu=/x|backspace/i,tu=/^\[(\s*)(x?)(\s*)\](?:\s+)/i;function nu(e){var t=e.schema,n=e.toastMark;return new mt({props:{handleDOMEvents:{keyup:function(e,r){var i,o=e.state,s=o.doc,a=o.tr,l=o.selection;if(l.empty&&eu.test(r.key)){var c=Nl(l),u=c.startIndex,p=c.startFromOffset,d=[u+1,c.from-p+1],h=fa(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===h||void 0===h?void 0:h.firstChild)||void 0===i?void 0:i.literal){var f=h.firstChild,m=f.literal.match(tu);if(m){var g=f.sourcepos[0],v=m[1],y=m[2],b=m[3],w=v.length+b.length,k=Sl(s,g[0]-1).startOffset,x=g[1]+k;if(y){var C=w?w+1:0;a.replaceWith(x,C+x,t.text(y)),e.dispatch(a)}else w||(a.insertText(" ",x),e.dispatch(a))}}}return!1}}}})}var ru="cut",iu=/\r\n|\n|\r/,ou=function(e){function t(t,n){var r=e.call(this,t)||this,i=n.toastMark,o=n.useCommandShortcut,s=void 0===o||o,a=n.mdPlugins,l=void 0===a?[]:a;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(s),r.view=r.createView(),r.commands=r.createCommands(),r.specs.setContext(Bo(Bo({},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 Po(t,e),t.prototype.toggleActive=function(e,t){el(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=Za("pseudo-clipboard"),this.clipboard.addEventListener("paste",(function(t){var n=t.clipboardData||window.clipboardData,r=n&&n.items;if(r){var i=Qs(r).some((function(e){return"string"===e.kind&&"text/rtf"===e.type}));if(!i){var o=ul(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 wl([new Ql,new Tc,new ml,new Ec,new Nc,new rc,new Dc,new Yc,new Oc,new Zc,new Ic,new Pc,new Hc,new zc,new Vc,new Uc,new $c,new Gc,new Wc,new Kc,new Jc,new Xc])},t.prototype.createPlugins=function(){return Fo([Wl(this.context),Xl(this.context),nu(this.context)],this.createPluginProps()).concat(this.defaultPlugins)},t.prototype.createView=function(){var e=this;return new wi(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,ru)},scroll:function(){return e.eventEmitter.emit("scroll","editor"),!0},keyup:function(t,n){return e.eventEmitter.emit("keyup",e.editorType,n),!1}},nodeViews:{widget:hl}})},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===ru&&this.view.dispatch(i.deleteSelection().scrollIntoView().setMeta("uiEvent",ru)),!0},t.prototype.updateMarkdown=function(e){var t=this;e.docChanged&&e.steps.forEach((function(n,r){if(n.slice&&!(n instanceof Ne)){var i=e.docs[r],o=[n.from,n.to],s=Tl(i,o[0],o[1]),a=s[0],l=s[1],c=t.getChanged(n.slice);a[0]===l[0]&&a[1]===l[1]&&""===c&&(c="\n");var u=t.toastMark.editMarkdown(a,l,c);t.eventEmitter.emit("updatePreview",u),e.setMeta("editResult",u).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=Ml(n.doc,e,t),i=r[0],o=r[1];this.view.dispatch(n.setSelection(ta(n,i,o)).scrollIntoView())},t.prototype.replaceSelection=function(e,t,n){var r,i=this.view.state,o=i.tr,s=i.schema,a=i.doc,l=e.split(iu).map((function(e){return Ys(s,Da(e,s))})),u=new m(c.from(l),1,1);if(this.focus(),t&&n){var p=Ml(a,t,n),d=p[0],h=p[1];r=o.replaceRange(d,h,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 s=Ml(o,e,t),a=s[0],l=s[1];n=i.deleteRange(a,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,s=i.to;if(e&&t){var a=Ml(r,e,t);o=a[0],s=a[1]}return r.textBetween(o,s,"\n")},t.prototype.getSelection=function(){var e=this.view.state.selection,t=e.from,n=e.to;return Tl(this.view.state.tr.doc,t,n)},t.prototype.setMarkdown=function(e,t){void 0===t&&(t=!0);var n=e.split(iu),r=this.view.state,i=r.tr,o=r.doc,s=r.schema,a=n.map((function(e){return Ys(s,Da(e,s))}));this.view.dispatch(i.replaceWith(0,o.content.size,a)),t&&this.moveCursorToEnd(!0)},t.prototype.addWidget=function(e,t,n){var r=this.view.state,i=r.tr,o=r.doc,s=r.selection,a=n?Ml(o,n,n)[0]:s.to;this.view.dispatch(i.setMeta("widget",{pos:a,node:e,style:t}))},t.prototype.replaceWithWidget=function(e,t,n){var r=this.view.state,i=r.tr,o=r.schema,s=Ml(r.doc,e,t),a=Da(n,o);this.view.dispatch(i.replaceWith(s[0],s[1],a))},t.prototype.getRangeInfoOfNode=function(e){var t=this.view.state,n=t.doc,r=t.selection,i=e||Tl(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 Ca(e)})).join("\n")},t.prototype.getToastMark=function(){return this.toastMark},t}(gl),su="_feEventKey";var au=function(e,t){var n,r=e[su];return r||(r=e[su]={}),(n=r[t])||(n=r[t]=[]),n},lu=jo,cu=Go,uu=au;function pu(e,t,n){var r,i=uu(e,t);n?(cu(i,(function(i,o){return n!==i.handler||(du(e,t,i.wrappedHandler),r=o,!1)})),i.splice(r,1)):(cu(i,(function(n){du(e,t,n.wrappedHandler)})),i.splice(0,i.length))}function du(e,t,n){"removeEventListener"in e?e.removeEventListener(t,n):"detachEvent"in e&&e.detachEvent("on"+t,n)}var hu=function(e,t,n){lu(t)?cu(t.split(/\s+/g),(function(t){pu(e,t,n)})):cu(t,(function(t,n){pu(e,n,t)}))},fu=jo,mu=Go,gu=au;function vu(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=gu(e,t),o=!1;mu(i,(function(e){return e.handler!==n||(o=!0,!1)})),o||i.push({handler:n,wrappedHandler:r})}(e,t,n,i)}var yu=function(e,t,n,r){fu(t)?mu(t.split(/\s+/g),(function(t){vu(e,t,n,r)})):mu(t,(function(t,r){vu(e,r,t,n)}))},bu=function(e,t){return bu=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])},bu(e,t)};function wu(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}bu(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var ku=function(){return ku=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},ku.apply(this,arguments)};function xu(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 Cu="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window?window:"undefined"!==typeof n.g?n.g:"undefined"!==typeof self?self:{},Tu={};function Eu(e,t,n){var r,i,o,s,a,l="";for("string"!==typeof t&&(n=t,t=Eu.defaultChars),"undefined"===typeof n&&(n=!0),a=function(e){var t,n,r=Tu[e];if(r)return r;for(r=Tu[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+=a[o];else if(o>=55296&&o<=57343){if(o>=55296&&o<=56319&&r+1<i&&(s=e.charCodeAt(r+1))>=56320&&s<=57343){l+=encodeURIComponent(e[r]+e[r+1]),r++;continue}l+="%EF%BF%BD"}else l+=encodeURIComponent(e[r]);return l}Eu.defaultChars=";/?:@&=+$,-_.!~*'()#",Eu.componentChars="-_.!~*'()";var Mu=Eu,Nu={},Su={},Du={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:"\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",Edot:"\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:"\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",minus:"\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:"\u03bd",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:"\u03f1",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:"\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",xodot:"\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"},Lu={Aacute:"\xc1",aacute:"\xe1",Acirc:"\xc2",acirc:"\xe2",acute:"\xb4",AElig:"\xc6",aelig:"\xe6",Agrave:"\xc0",agrave:"\xe0",amp:"&",AMP:"&",Aring:"\xc5",aring:"\xe5",Atilde:"\xc3",atilde:"\xe3",Auml:"\xc4",auml:"\xe4",brvbar:"\xa6",Ccedil:"\xc7",ccedil:"\xe7",cedil:"\xb8",cent:"\xa2",copy:"\xa9",COPY:"\xa9",curren:"\xa4",deg:"\xb0",divide:"\xf7",Eacute:"\xc9",eacute:"\xe9",Ecirc:"\xca",ecirc:"\xea",Egrave:"\xc8",egrave:"\xe8",ETH:"\xd0",eth:"\xf0",Euml:"\xcb",euml:"\xeb",frac12:"\xbd",frac14:"\xbc",frac34:"\xbe",gt:">",GT:">",Iacute:"\xcd",iacute:"\xed",Icirc:"\xce",icirc:"\xee",iexcl:"\xa1",Igrave:"\xcc",igrave:"\xec",iquest:"\xbf",Iuml:"\xcf",iuml:"\xef",laquo:"\xab",lt:"<",LT:"<",macr:"\xaf",micro:"\xb5",middot:"\xb7",nbsp:"\xa0",not:"\xac",Ntilde:"\xd1",ntilde:"\xf1",Oacute:"\xd3",oacute:"\xf3",Ocirc:"\xd4",ocirc:"\xf4",Ograve:"\xd2",ograve:"\xf2",ordf:"\xaa",ordm:"\xba",Oslash:"\xd8",oslash:"\xf8",Otilde:"\xd5",otilde:"\xf5",Ouml:"\xd6",ouml:"\xf6",para:"\xb6",plusmn:"\xb1",pound:"\xa3",quot:'"',QUOT:'"',raquo:"\xbb",reg:"\xae",REG:"\xae",sect:"\xa7",shy:"\xad",sup1:"\xb9",sup2:"\xb2",sup3:"\xb3",szlig:"\xdf",THORN:"\xde",thorn:"\xfe",times:"\xd7",Uacute:"\xda",uacute:"\xfa",Ucirc:"\xdb",ucirc:"\xfb",Ugrave:"\xd9",ugrave:"\xf9",uml:"\xa8",Uuml:"\xdc",uuml:"\xfc",Yacute:"\xdd",yacute:"\xfd",yen:"\xa5",yuml:"\xff"},Au={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'},Ou={},Iu=Cu&&Cu.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ou,"__esModule",{value:!0});var Ru=Iu({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}),Pu=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)};Ou.default=function(e){return e>=55296&&e<=57343||e>1114111?"\ufffd":(e in Ru.default&&(e=Ru.default[e]),Pu(e))};var Bu=Cu&&Cu.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Su,"__esModule",{value:!0}),Su.decodeHTML=Su.decodeHTMLStrict=Su.decodeXML=void 0;var Fu=Bu(Du),Hu=Bu(Lu),qu=Bu(Au),zu=Bu(Ou),ju=/&(?:[a-zA-Z0-9]+|#[xX][\da-fA-F]+|#\d+);/g;function Vu(e){var t=Uu(e);return function(e){return String(e).replace(ju,t)}}Su.decodeXML=Vu(qu.default),Su.decodeHTMLStrict=Vu(Fu.default);var _u=function(e,t){return e<t?1:-1};function Uu(e){return function(t){if("#"===t.charAt(1)){var n=t.charAt(2);return"X"===n||"x"===n?zu.default(parseInt(t.substr(3),16)):zu.default(parseInt(t.substr(2),10))}return e[t.slice(1,-1)]||t}}Su.decodeHTML=function(){for(var e=Object.keys(Hu.default).sort(_u),t=Object.keys(Fu.default).sort(_u),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=Uu(Fu.default);function s(e){return";"!==e.substr(-1)&&(e+=";"),o(e)}return function(e){return String(e).replace(i,s)}}();var $u={},Wu=Cu&&Cu.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty($u,"__esModule",{value:!0}),$u.escapeUTF8=$u.escape=$u.encodeNonAsciiHTML=$u.encodeHTML=$u.encodeXML=void 0;var Gu=Yu(Wu(Au).default),Ju=ep(Gu);$u.encodeXML=op(Gu);var Ku,Zu,Xu=Yu(Wu(Du).default),Qu=ep(Xu);function Yu(e){return Object.keys(e).sort().reduce((function(t,n){return t[e[n]]="&"+n+";",t}),{})}function ep(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 s=0;s<t.length-1;s++){for(var a=s;a<t.length-1&&t[a].charCodeAt(1)+1===t[a+1].charCodeAt(1);)a+=1;var l=1+a-s;l<3||t.splice(s,l,t[s]+"-"+t[a])}return n.unshift("["+t.join("")+"]"),new RegExp(n.join("|"),"g")}$u.encodeHTML=(Ku=Xu,Zu=Qu,function(e){return e.replace(Zu,(function(e){return Ku[e]})).replace(tp,rp)}),$u.encodeNonAsciiHTML=op(Xu);var tp=/(?:[\x80-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/g,np=null!=String.prototype.codePointAt?function(e){return e.codePointAt(0)}:function(e){return 1024*(e.charCodeAt(0)-55296)+e.charCodeAt(1)-56320+65536};function rp(e){return"&#x"+(e.length>1?np(e):e.charCodeAt(0)).toString(16).toUpperCase()+";"}var ip=new RegExp(Ju.source+"|"+tp.source,"g");function op(e){return function(t){return t.replace(ip,(function(t){return e[t]||rp(t)}))}}$u.escape=function(e){return e.replace(ip,rp)},$u.escapeUTF8=function(e){return e.replace(Ju,rp)},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=Su,n=$u;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=$u;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=Su;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}})}(Nu);var sp="&(?:#x[a-f0-9]{1,6}|#[0-9]{1,7}|[a-z][a-z0-9]{1,31});",ap=/[\\&]/,lp="[!\"#$%&'()*+,./:;<=>?@[\\\\\\]^_`{|}~-]",cp=new RegExp("\\\\"+lp+"|"+sp,"gi"),up=new RegExp('[&<>"]',"g"),pp=function(e){return 92===e.charCodeAt(0)?e.charAt(1):Nu.decodeHTML(e)};function dp(e){return ap.test(e)?e.replace(cp,pp):e}function hp(e){try{return Mu(e)}catch(t){return e}}function fp(e){switch(e){case"&":return"&amp;";case"<":return"&lt;";case">":return"&gt;";case'"':return"&quot;";default:return e}}function mp(e){return up.test(e)?e.replace(up,fp):e}function gp(e,t){for(var n=[],r=0;r<t;r++)n.push(e);return n.join("")}function vp(e){return!e||!/[^ \t]+/.test(e)}var yp=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=bp(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 bp(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 wp=1,kp={};function xp(e){delete kp[e]}var Cp=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:wp++,this.type=e,this.sourcepos=t,kp[this.id]=this}return e.prototype.isContainer=function(){return bp(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 yp(this)},e}(),Tp=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 wu(t,e),t}(Cp),Ep=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.listData=null,t}return wu(t,e),t}(Tp),Mp=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.level=0,t.headingType="atx",t}return wu(t,e),t}(Tp),Np=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 wu(t,e),t}(Tp),Sp=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.columns=[],t}return wu(t,e),t}(Tp),Dp=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 wu(t,e),t}(Tp),Lp=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.title="",t.dest="",t.label="",t}return wu(t,e),t}(Tp),Ap=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.syntaxLength=0,t.offset=-1,t.info="",t}return wu(t,e),t}(Tp),Op=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.htmlBlockType=-1,t}return wu(t,e),t}(Tp),Ip=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 wu(t,e),t}(Cp),Rp=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.tickCount=0,t}return wu(t,e),t}(Cp),Pp=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.info="",t}return wu(t,e),t}(Cp);function Bp(e,t){switch(e){case"heading":return new Mp(e,t);case"list":case"item":return new Ep(e,t);case"link":case"image":return new Ip(e,t);case"codeBlock":return new Np(e,t);case"htmlBlock":return new Op(e,t);case"table":return new Sp(e,t);case"tableCell":return new Dp(e,t);case"document":case"paragraph":case"blockQuote":case"thematicBreak":case"tableRow":case"tableBody":case"tableHead":case"frontMatter":return new Tp(e,t);case"code":return new Rp(e,t);case"refDef":return new Lp(e,t);case"customBlock":return new Ap(e,t);case"customInline":return new Pp(e,t);default:return new Cp(e,t)}}function Fp(e){return"codeBlock"===e.type}function Hp(e){return"list"===e.type}function qp(e){return"refDef"===e.type}function zp(e){return"customBlock"===e.type}function jp(e,t){var n=Bp("text",t);return n.literal=e,n}var Vp,_p="[A-Za-z][A-Za-z0-9-]*",Up="<"+_p+"(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^\"'=<>`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)*\\s*/?>",$p="</"+_p+"\\s*[>]",Wp=new RegExp("^"+("(?:"+Up+"|"+$p+"|\x3c!----\x3e|\x3c!--(?:-?[^>-])(?:-?[^-])*--\x3e|[<][?].*?[?][>]|<![A-Z]+\\s+[^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)"),"i");if(String.fromCodePoint)Vp=function(e){try{return String.fromCodePoint(e)}catch(t){if(t instanceof RangeError)return String.fromCharCode(65533);throw t}};else{var Gp=String.fromCharCode,Jp=Math.floor;Vp=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n,r,i=[],o=-1,s=e.length;if(!s)return"";for(var a="";++o<s;){var l=Number(e[o]);if(!isFinite(l)||l<0||l>1114111||Jp(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===s||i.length>16384)&&(a+=Gp.apply(void 0,i),i.length=0)}return a}}var Kp=Vp,Zp="(?:[w-]+.)*[A-Za-z0-9-]+.[A-Za-z0-9-]+",Xp="[^<\\s]*[^<?!.,:*_?~\\s]",Qp="[\\w.+-]+@(?:[\\w-]+\\.)+[\\w-]+";function Yp(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 s=Math.min(-n,t[0].length);return e.substring(0,e.length-s)}}return e}function ed(e){return e.replace(/&[A-Za-z0-9]+;$/,"")}function td(e){return xu(xu([],function(e){for(var t,n=new RegExp("(www|https?://)."+Zp+Xp,"g"),r=[];t=n.exec(e);){var i=ed(Yp(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(Qp,"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 nd(e){return e[e.length-1]}function rd(e){return e.slice(1,e.length-1).trim().replace(/[ \t\r\n]+/," ").toLowerCase().toUpperCase()}function id(e,t){Object.keys(e).forEach((function(n){t(n,e[n])}))}function od(e){return!Object.keys(e).length}var sd=126,ad=39,ld=34,cd=36,ud="\\\\"+lp,pd=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]/),dd=new RegExp('^(?:"('+ud+'|[^"\\x00])*"|\'('+ud+"|[^'\\x00])*'|\\(("+ud+"|[^()\\x00])*\\))"),hd=/^(?:<(?:[^<>\n\\\x00]|\\.)*>)/,fd=new RegExp("^"+lp),md=new RegExp("^"+sp,"i"),gd=/`+/,vd=/^`+/,yd=/\.\.\./g,bd=/--+/g,wd=/^<([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])?)*)>/,kd=/^<[A-Za-z][A-Za-z0-9.+-]{1,31}:[^<>\x00-\x20]*>/i,xd=/^ *(?:\n *)?/,Cd=/^[ \t\n\x0b\x0c\x0d]/,Td=/^\s/,Ed=/ *$/,Md=/^ */,Nd=/^ *(?:\n|$)/,Sd=/^\[(?:[^\\\[\]]|\\.){0,1000}\]/,Dd=/^[^\n`\[\]\\!<&*_'"~$]+/m,Ld=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(xd),!0},e.prototype.parseBackticks=function(e){var t=this.pos+1,n=this.match(vd);if(null===n)return!1;for(var r,i=this.pos;null!==(r=this.match(gd));)if(r===n){var o=this.subject.slice(i,this.pos-n.length),s=this.sourcepos(t,this.pos),a=o.split("\n");if(a.length>1){var l=nd(a);this.lineIdx+=a.length-1,this.linePosOffset=-(this.pos-l.length-n.length),s[1]=this.sourcepos(this.pos),o=a.join(" ")}var c=Bp("code",s);return o.length>0&&null!==o.match(/[^ ]/)&&" "==o[0]&&" "==o[o.length-1]?c.literal=o.slice(1,o.length-1):c.literal=o,c.tickCount=n.length,e.appendChild(c),!0}return this.pos=i,e.appendChild(jp(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=Bp("linebreak",this.sourcepos(this.pos-1,this.pos)),e.appendChild(t),this.nextLine()):fd.test(n.charAt(this.pos))?(e.appendChild(jp(n.charAt(this.pos),this.sourcepos(r,this.pos))),this.pos+=1):e.appendChild(jp("\\",this.sourcepos(r,r))),!0},e.prototype.parseAutolink=function(e){var t,n,r,i=this.pos+1;return(t=this.match(wd))?(n=t.slice(1,t.length-1),(r=Bp("link",this.sourcepos(i,this.pos))).destination=hp("mailto:"+n),r.title="",r.appendChild(jp(n,this.sourcepos(i+1,this.pos-1))),e.appendChild(r),!0):!!(t=this.match(kd))&&(n=t.slice(1,t.length-1),(r=Bp("link",this.sourcepos(i,this.pos))).destination=hp(n),r.title="",r.appendChild(jp(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(Wp);if(null===n)return!1;var r=Bp("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===ad||e===ld)t++,this.pos++;else for(;this.peek()===e;)t++,this.pos++;if(0===t||t<2&&(e===sd||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":Kp(o);var s,a,l=Td.test(r),c=pd.test(r),u=Td.test(i),p=pd.test(i),d=!l&&(!c||u||p),h=!u&&(!p||l||c);return 95===e?(s=d&&(!h||p),a=h&&(!d||c)):e===ad||e===ld?(s=d&&!h,a=h):e===cd?(s=!l,a=!u):(s=d,a=h),this.pos=n,{numdelims:t,canOpen:s,canClose:a}},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=jp(e===ad?"\u2019":e===ld?"\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!==ad&&e!==ld)&&(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,s,a,l=!1,c=((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 u=r.cc,p=95===u||42===u;if(r.canClose){for(n=r.previous,a=!1;null!==n&&n!==e&&n!==c[u][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){a=!0;break}n=n.previous}if(i=r,p||u===sd||u===cd)if(a){if(n){var d=r.numdelims>=2&&n.numdelims>=2?2:1,h=p?0:1;o=n.node,s=r.node;var f=p?1===d?"emph":"strong":"strike";u===cd&&(f="customInline");var m=Bp(f),g=o.sourcepos[1],v=s.sourcepos[0];m.sourcepos=[[g[0],g[1]-d+1],[v[0],v[1]+d-1]],o.sourcepos[1][1]-=d,s.sourcepos[0][1]+=d,o.literal=o.literal.slice(d),s.literal=s.literal.slice(d),n.numdelims-=d,r.numdelims-=d;for(var y=o.next,b=void 0;y&&y!==s;)b=y.next,y.unlink(),m.appendChild(y),y=b;if(u===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<=h&&(0===n.numdelims&&o.unlink(),this.removeDelimiter(n)),r.numdelims<=h){0===r.numdelims&&s.unlink();var C=r.next;this.removeDelimiter(r),r=C}}}else r=r.next;else u===ad?(r.node.literal="\u2019",a&&(n.node.literal="\u2018"),r=r.next):u===ld&&(r.node.literal="\u201d",a&&(n.node.literal="\u201c"),r=r.next);a||(c[u][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(dd);return null===e?null:dp(e.substr(1,e.length-2))},e.prototype.parseLinkDestination=function(){var e=this.match(hd);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&&fd.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!==Cd.exec(Kp(r)))break;this.pos+=1}return this.pos===t&&41!==r||0!==n?null:hp(dp(e=this.subject.substr(t,this.pos-t)))}return hp(dp(e.substr(1,e.length-2)))},e.prototype.parseLinkLabel=function(){var e=this.match(Sd);return null===e||e.length>1001?0:e.length},e.prototype.parseOpenBracket=function(e){var t=this.pos;this.pos+=1;var n=jp("[",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=jp("![",this.sourcepos(this.pos-1,this.pos));e.appendChild(n),this.addBracket(n,t+1,!0)}else{n=jp("!",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(jp("]",this.sourcepos(i,i))),!0;if(!o.active)return e.appendChild(jp("]",this.sourcepos(i,i))),this.removeBracket(),!0;var s=o.image,a=this.pos;40===this.peek()&&(this.pos++,this.spnl()&&null!==(t=this.parseLinkDestination())&&this.spnl()&&(Cd.test(this.subject.charAt(this.pos-1))&&(n=this.parseLinkTitle()),1)&&this.spnl()&&41===this.peek()?(this.pos+=1,r=!0):this.pos=a);var l="";if(!r){var c=this.pos,u=this.parseLinkLabel();if(u>2?l=this.subject.slice(c,c+u):o.bracketAfter||(l=this.subject.slice(o.index,i)),0===u&&(this.pos=a),l){l=rd(l);var p=this.refMap[l];p&&(t=p.destination,n=p.title,r=!0)}}if(r){var d=Bp(s?"image":"link");d.destination=t,d.title=n||"",d.sourcepos=[o.startpos,this.sourcepos(this.pos)];for(var h=o.node.next,f=void 0;h;)f=h.next,h.unlink(),d.appendChild(h),h=f;if(e.appendChild(d),this.processEmphasis(o.previousDelimiter),this.removeBracket(),o.node.unlink(),!s)for(o=this.brackets;null!==o;)o.image||(o.active=!1),o=o.previous;return this.options.referenceDefinition&&(this.refLinkCandidateMap[e.id]={node:e,refLabel:l}),!0}return this.removeBracket(),this.pos=i,e.appendChild(jp("]",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(md))&&(e.appendChild(jp(Nu.decodeHTML(t),this.sourcepos(n,this.pos))),!0)},e.prototype.parseString=function(e){var t,n=this.pos+1;if(t=this.match(Dd)){if(this.options.smart){var r=t.replace(yd,"\u2026").replace(bd,(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),gp("\u2014",n)+gp("\u2013",t)}));e.appendChild(jp(r,this.sourcepos(n,this.pos)))}else{var i=jp(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(Ed,"");var i=r-t.literal.length;t.sourcepos[1][1]-=i,e.appendChild(Bp(n?"linebreak":"softbreak",this.sourcepos(this.pos-i,this.pos)))}else e.appendChild(Bp("softbreak",this.sourcepos(this.pos,this.pos)));return this.nextLine(),this.match(Md),!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 s=this.parseLinkDestination();if(null===s)return this.pos=r,0;var a=this.pos;this.spnl(),this.pos!==a&&(n=this.parseLinkTitle()),null===n&&(n="",this.pos=a);var l=!0;if(null===this.match(Nd)&&(""===n?l=!1:(n="",this.pos=a,l=null!==this.match(Nd))),!l)return this.pos=r,0;var c=rd(o);if(""===c)return this.pos=r,0;var u=this.getReferenceDefSourcepos(e);e.sourcepos[0][0]=u[1][0]+1;var p=Bp("refDef",u);return p.title=n,p.dest=s,p.label=c,e.insertBefore(p),t[c]?this.refDefCandidateMap[p.id]=p:t[c]=Eh(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],s=n[n.length-1];o.sourcepos&&s.sourcepos&&(o.sourcepos[1]=s.sourcepos[1]),o.next=s.next,o.next&&(o.next.prev=o);for(var a=1;a<n.length;a+=1)o.literal+=n[a].literal,n[a].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 s=t[o];if(Cd.test(s))break;if(/\:/.test(s)&&0===r){if(n)break;var a=s.indexOf(":")===s.length-1?o+1:o;i={line:a,ch:t[a].length},n=!0}var l=s.match(/'|"/g);if(l&&(r+=l.length),2===r){i={line:o,ch:s.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 sd:case cd:n=this.handleDelim(r,e);break;case ad:case ld: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(jp(Kp(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=td);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 s=0,a=r.sourcepos[0],l=a[0],c=a[1],u=function(e,t){return[[l,c+e],[l,c+t]]},p=[],d=0,h=o;d<h.length;d++){var f=h[d],m=f.range,g=f.url,v=f.text;m[0]>s&&p.push(jp(i.substring(s,m[0]),u(s,m[0]-1)));var y=Bp("link",u.apply(void 0,m));y.appendChild(jp(v,u.apply(void 0,m))),y.destination=g,y.extendedAutolink=!0,p.push(y),s=m[1]+1}s<i.length&&p.push(jp(i.substring(s),u(s,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 s=i.node,a=i.entering;r[s.type]&&r[s.type](s,{entering:a,options:this.options})}},e}(),Ad=/^\[([ \txX])\][ \t]+/;var Od=9,Id=32,Rd=/[^ \t\f\v\r\n]/,Pd=/^(?:`{3,}|~{3,})(?= *$)/;function Bd(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 Fd(e,t){return t<e.length?e.charCodeAt(t):-1}function Hd(e){return!Rd.test(e)}function qd(e){return e===Id||e===Od}var zd=/^\$\$$/,jd={continue:function(e,t){var n=e.currentLine,r=n.match(zd);if(r)return e.lastLineLength=r[0].length,e.finalize(t,e.lineNumber),2;for(var i=t.offset;i>0&&qd(Fd(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),s=i.match(/^(\s*)(.*)/);t.info=dp(s[2].trim()),t.literal=o,t.stringContent=null}},canContain:function(){return!1},acceptsLines:!0},Vd={continue:function(){return 1},finalize:function(){},canContain:function(){return!1},acceptsLines:!0},_d={continue:function(){return 0},finalize:function(e,t){for(var n=t.firstChild;n;){if(Bd(n)&&n.next){t.listData.tight=!1;break}for(var r=n.firstChild;r;){if(Bd(r)&&(n.next||r.next)){t.listData.tight=!1;break}r=r.next}n=n.next}},canContain:function(e){return"item"===e},acceptsLines:!1},Ud={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(Ad);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},$d={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(Pd);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&&qd(Fd(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),s=r.slice(i+1),a=o.match(/^(\s*)(.*)/);t.infoPadding=a[1].length,t.info=dp(a[2].trim()),t.literal=s}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},Wd={continue:function(e){return e.blank?1:0},finalize:function(e,t){if(null!==t.stringContent){for(var n,r=!1;91===Fd(t.stringContent,0)&&(n=e.inlineParser.parseReference(t,e.refMap));)t.stringContent=t.stringContent.slice(n),r=!0;r&&Hd(t.stringContent)&&t.unlink()}},canContain:function(){return!1},acceptsLines:!0},Gd={document:{continue:function(){return 0},finalize:function(){},canContain:function(e){return"item"!==e},acceptsLines:!1},list:_d,blockQuote:{continue:function(e){var t=e.currentLine;return e.indented||62!==Fd(t,e.nextNonspace)?1:(e.advanceNextNonspace(),e.advanceOffset(1,!1),qd(Fd(t,e.offset))&&e.advanceOffset(1,!0),0)},finalize:function(){},canContain:function(e){return"item"!==e},acceptsLines:!1},item:Ud,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:$d,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:Wd,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:Vd,customBlock:jd,frontMatter:Vd};function Jd(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&&vp(o)?n=i+1:r.push(o),t=i+1}t<e.length&&(vp(o=e.substring(t,e.length))||r.push(o));return[n,r]}function Kd(e,t,n,r){for(var i=[],o=0,s=t;o<s.length;o++){var a=s[o],l=a.match(/^[ \t]+/),c=l?l[0].length:0,u=void 0,p=void 0;if(c===a.length)c=0,u=0,p="";else{var d=a.match(/[ \t]+$/);u=d?d[0].length:0,p=a.slice(c,a.length-u)}var h=r+c,f=Bp(e,[[n,r],[n,r+a.length-1]]);f.stringContent=p.replace(/\\\|/g,"|"),f.startIdx=i.length,f.endIdx=i.length,f.lineOffsets=[h-1],f.paddingLeft=c,f.paddingRight=u,i.push(f),r+=a.length+1}return i}function Zd(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 Xd=/^(\$\$)(\s*[a-zA-Z])+/,Qd=/^(\$\$)(\s*[a-zA-Z])+.*(\$\$)/,Yd=/^`{3,}(?!.*`)|^~{3,}/,eh=[/./,/^<(?: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("^(?:"+Up+"|"+$p+")\\s*$","i")],th=/^(?:=+|-+)[ \t]*$/,nh=/^#{1,6}(?:[ \t]+|$)/,rh=/^(?:(?:\*[ \t]*){3,}|(?:_[ \t]*){3,}|(?:-[ \t]*){3,})[ \t]*$/,ih=/^[*+-]/,oh=/^(\d{1,9})([.)])/;function sh(e,t){return e.options.disallowDeepHeading&&("blockQuote"===t.type||"item"===t.type)}var ah=[function(e){return e.indented||62!==Fd(e.currentLine,e.nextNonspace)?0:(e.advanceNextNonspace(),e.advanceOffset(1,!1),qd(Fd(e.currentLine,e.offset))&&e.advanceOffset(1,!0),e.closeUnmatchedBlocks(),e.addChild("blockQuote",e.nextNonspace),1)},function(e,t){var n;if(!e.indented&&!sh(e,t)&&(n=e.currentLine.slice(e.nextNonspace).match(nh))){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(Yd))){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===Fd(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(eh[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&&!sh(e,t.parent)&&(n=e.currentLine.slice(e.nextNonspace).match(th))){e.closeUnmatchedBlocks();for(var r=void 0;91===Fd(t.stringContent,0)&&(r=e.inlineParser.parseReference(t,e.refMap));)t.stringContent=t.stringContent.slice(r);if(t.stringContent.length>0){var i=Bp("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&&rh.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(ih))o.type="bullet",o.bulletChar=n[0][0];else{if(!(n=i.match(oh))||"paragraph"===t.type&&"1"!==n[1])return null;o.type="ordered",o.start=parseInt(n[1],10),o.delimiter=n[2]}if(-1!==(r=Fd(e.currentLine,e.nextNonspace+n[0].length))&&r!==Od&&r!==Id)return null;if("paragraph"===t.type&&!e.currentLine.slice(e.nextNonspace+n[0].length).match(Rd))return null;e.advanceNextNonspace(),e.advanceOffset(n[0].length,!0);var s=e.column,a=e.offset;do{e.advanceOffset(1,!0),r=Fd(e.currentLine,e.offset)}while(e.column-s<5&&qd(r));var l=-1===Fd(e.currentLine,e.offset),c=e.column-s;return c>=5||c<1||l?(o.padding=n[0].length+1,e.column=s,e.offset=a,qd(Fd(e.currentLine,e.offset))&&e.advanceOffset(1,!0)):o.padding=n[0].length+c,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),s=e.currentLine.slice(e.nextNonspace),a=Jd(o),l=a[0],c=a[1],u=Jd(s),p=u[0],d=u[1],h=/^[ \t]*:?-+:?[ \t]*$/;if(!c.length||!d.length||d.some((function(e){return!h.test(e)}))||1===d.length&&0!==s.indexOf("|"))return 0;var f=t.lineOffsets,m=e.lineNumber-1,g=nd(f)+1,v=Bp("table",[[m,g],[e.lineNumber,e.offset]]);if(v.columns=d.map((function(){return{align:null}})),t.insertAfter(v),1===f.length)t.unlink();else{t.stringContent=n.slice(0,i);var y=i-(n.lastIndexOf("\n",i-2)+1)-1;e.lastLineLength=f[f.length-2]+y,e.finalize(t,m-1)}e.advanceOffset(e.currentLine.length-e.offset,!1);var b=Bp("tableHead",[[m,g],[e.lineNumber,e.offset]]);v.appendChild(b);var w=Bp("tableRow",[[m,g],[m,g+o.length-1]]),k=Bp("tableDelimRow",[[e.lineNumber,e.nextNonspace+1],[e.lineNumber,e.offset]]);b.appendChild(w),b.appendChild(k),Kd("tableCell",c,m,g+l).forEach((function(e){w.appendChild(e)}));var x=Kd("tableDelimCell",d,e.lineNumber,e.nextNonspace+1+p);return x.forEach((function(e){k.appendChild(e)})),v.columns=x.map(Zd),e.tip=v,2}return 0},function(e,t){if("table"!==t.type&&"tableBody"!==t.type||!e.blank&&-1===e.currentLine.indexOf("|"))return 0;if(e.advanceOffset(e.currentLine.length-e.offset,!1),e.blank){var n=t;return"tableBody"===t.type&&(n=t.parent,e.finalize(t,e.lineNumber-1)),e.finalize(n,e.lineNumber-1),0}var r=t;"table"===t.type&&((r=e.addChild("tableBody",e.nextNonspace)).stringContent=null);var i=Bp("tableRow",[[e.lineNumber,e.nextNonspace+1],[e.lineNumber,e.currentLine.length]]);r.appendChild(i);var o=r.parent,s=Jd(e.currentLine.slice(e.nextNonspace)),a=s[0];return Kd("tableCell",s[1],e.lineNumber,e.nextNonspace+1+a).forEach((function(e,t){t>=o.columns.length&&(e.ignored=!0),i.appendChild(e)})),2},function(e){var t;if(!e.indented&&!Qd.test(e.currentLine)&&(t=e.currentLine.match(Xd))){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}],lh=/^(-{3}|\+{3}|;{3})$/,ch=function(e,t){var n=e.currentLine,r=e.lineNumber,i=e.indented;return 1===r&&!i&&"document"===t.type&&lh.test(n)?(e.closeUnmatchedBlocks(),e.addChild("frontMatter",e.nextNonspace).stringContent=n,e.advanceNextNonspace(),e.advanceOffset(n.length,!1),2):0},uh={continue:function(e,t){var n=e.currentLine,r=n.match(lh);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},ph=[/./,/<\/(?:script|pre|style)>/i,/-->/,/\?>/,/>/,/\]\]>/],dh=/^[#`~*+_=<>0-9-;$]/,hh=/\r\n|\n|\r/;function fh(){return Bp("document",[[1,1],[0,0]])}var mh={smart:!1,tagFilter:!1,extendedAutolinks:!1,disallowedHtmlBlockTags:[],referenceDefinition:!1,disallowDeepHeading:!1,customParser:null,frontMatter:!1},gh=function(){function e(e){this.options=ku(ku({},mh),e),this.doc=fh(),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&&(Gd.frontMatter=uh,ah.unshift(ch)),this.inlineParser=new Ld(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+=gp(" ",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(;!Gd[this.tip.type].canContain(e);)this.finalize(this.tip,this.lineNumber-1);var n=t+1,r=Bp(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],Gd[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,s=i.type;n&&n[s]&&n[s](i,{entering:o,options:this.options}),o||"paragraph"!==s&&"heading"!==s&&("tableCell"!==s||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(),Gd[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&&Gd[t.type].acceptsLines,o=ah.length;!i;){if(this.findNextNonspace(),"table"!==t.type&&"tableBody"!==t.type&&"paragraph"!==t.type&&!this.indented&&!dh.test(e.slice(this.nextNonspace))){this.advanceNextNonspace();break}for(var s=0;s<o;){var a=ah[s](this,t);if(1===a){t=this.tip;break}if(2===a){t=this.tip,i=!0;break}s++}if(s===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,c=this.blank&&!("blockQuote"===l||Fp(t)&&t.isFenced||"item"===l&&!t.firstChild&&t.sourcepos[0][0]===this.lineNumber),u=t;u;)u.lastLineBlank=c,u=u.parent;Gd[l].acceptsLines?(this.addLine(),"htmlBlock"===t.type&&t.htmlBlockType>=1&&t.htmlBlockType<=5&&ph[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=fh(),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(hh),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=fh(),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 vh(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 yh(e,t){var n=e[0];return 1===vh(e[1],t)?1:-1===vh(n,t)?-1:0}function bh(e,t){for(var n=0,r=t;n<r.length;n++){var i=r[n];e.insertBefore(i)}}function wh(e,t){var n=e[0];return e[1][0]<t?1:n[0]>t?-1:0}function kh(e,t){for(var n=e.firstChild;n;){var r=wh(n.sourcepos,t);if(0===r)return n;if(-1===r)return n.prev||n;n=n.next}return e.lastChild}function xh(e){return function(e){return kp[e]}(e)||null}function Ch(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 Th=/\r\n|\n|\r/;function Eh(e){return{id:e.id,title:e.title,sourcepos:e.sourcepos,unlinked:!1,destination:e.dest}}var Mh=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 gh(t),this.parser.setRefMaps(this.refMap,this.refLinkCandidateMap,this.refDefCandidateMap),this.eventHandlerMap={change:[]},e=e||"",this.lineTexts=e.split(Th),this.root=this.parser.parse(e,this.lineTexts)}return e.prototype.updateLineTexts=function(e,t,n){var r,i=e[0],o=e[1],s=t[0],a=t[1],l=n.split(Th),c=l.length,u=this.lineTexts[i-1],p=this.lineTexts[s-1];l[0]=u.slice(0,o-1)+l[0],l[c-1]=l[c-1]+p.slice(a-1);var d=s-i+1;return(r=this.lineTexts).splice.apply(r,xu([i-1,d],l)),c-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?(bh(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 s=o[i];n[s]&&(xp(n[s].id),n[s]=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 xp(e)})),e.unlink()):t?(bh(t,n),xp(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=kh(this.root,e[0]),r=kh(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&&(Hp(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 ih.test(n)||oh.test(n)}(this.lineTexts[n-1])||"table"===e.prev.type&&(!Hd(i=this.lineTexts[n-1])&&-1!==i.indexOf("|")))&&(n=(e=e.prev).sourcepos[0][0]);for(var o=this.lineTexts.slice(n-1,r),s=this.parser.partialParseStart(n,o),a=t?t.next:this.root.firstChild,l=s.lastChild,c=l&&Fp(l)&&l.open,u=l&&zp(l)&&l.open,p=l&&Hp(l);(c||u)&&a||p&&a&&("list"===a.type||a.sourcepos[0][1]>=2);){var d=this.extendEndLine(a.sourcepos[1][0]);this.parser.partialParseExtends(this.lineTexts.slice(r,d)),e||(e=t),t=a,r=d,a=a.next}return this.parser.partialParseFinish(),{newNodes:function(e){for(var t=[],n=e.firstChild;n;)t.push(n),n=n.next;return t}(s),extStartNode:e,extEndNode:t}},e.prototype.getRemovedNodeRange=function(e,t){return!e||e&&qp(e)||t&&qp(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(!od(this.refMap)){var r=function(e){if(qp(e)){var t=n.refMap[e.label];t&&e.id===t.id&&(t.unlinked=!0)}};e&&Ch(r,e.parent,t),t&&Ch(r,t)}},e.prototype.replaceWithNewRefDefState=function(e){var t=this;if(!od(this.refMap)){var n=function(e){if(qp(e)){var n=e.label,r=t.refMap[n];r&&!r.unlinked||(t.refMap[n]=Eh(e))}};e.forEach((function(e){Ch(n,e)}))}},e.prototype.replaceWithRefDefCandidate=function(){var e=this;od(this.refDefCandidateMap)||id(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]=Eh(n))}))},e.prototype.getRangeWithRefDef=function(e,t,n,r,i){if(this.referenceDefinition&&!od(this.refMap)){var o=kh(this.root,e-1),s=kh(this.root,t+1);o&&qp(o)&&o!==n&&o!==r&&(e=(n=o).sourcepos[0][0]),s&&qp(s)&&s!==n&&s!==r&&(r=s,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],s=i?Math.min(i.sourcepos[0][0],e[0]):e[0],a=this.extendEndLine((o?Math.max(o.sourcepos[1][0],t[0]):t[0])+n),l=this.parseRange.apply(this,this.getRangeWithRefDef(s,a,i,o,n)),c=l.newNodes,u=l.extStartNode,p=l.extEndNode,d=this.getRemovedNodeRange(u,p),h=p?p.next:this.root.firstChild;return this.referenceDefinition?(this.markDeletedRefMap(u,p),this.replaceRangeNodes(u,p,c),this.replaceWithNewRefDefState(c)):this.replaceRangeNodes(u,p,c),{nodes:c,removedNodeRange:d,nextNode:h}},e.prototype.parseRefLink=function(){var e=this,t=[];return od(this.refMap)||id(this.refMap,(function(n,r){r.unlinked&&delete e.refMap[n],id(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(){od(this.refDefCandidateMap)||[this.refLinkCandidateMap,this.refDefCandidateMap].forEach((function(e){id(e,(function(t){(function(e){var t=xh(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=ku({},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 s=[o];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=yh(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=wh(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 xh(e)},e.prototype.removeAllNode=function(){kp={}},e}(),Nh=new RegExp("<(/?(?:"+["title","textarea","style","xmp","iframe","noembed","noframes","script","plaintext"].join("|")+")[^>]*>)","ig");function Sh(e){return Nh.test(e)?e.replace(Nh,(function(e,t){return"&lt;"+t})):e}var Dh={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,s="bullet"===i?"ul":"ol",a={};return"ol"===s&&null!==o&&1!==o&&(a.start=o.toString()),{type:n?"openTag":"closeTag",tagName:s,attributes:a,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?Sh(e.literal):e.literal}},htmlBlock:function(e,t){var n=t.options,r=n.tagFilter?Sh(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-"+mp(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:ku({href:mp(i)},r&&{title:mp(r)})}}return{type:"closeTag",tagName:"a"}},image:function(e,t){var n=t.getChildrenText,r=t.skipChildren,i=e,o=i.title,s=i.destination;return r(),{type:"openTag",tagName:"img",selfClose:!0,attributes:ku({src:mp(s),alt:n(e)},o&&{title:mp(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,s=i.trim().toLowerCase(),a=n[s],l=t.entering;if(a)try{return a(e,t)}catch(c){console.warn("[@toast-ui/editor] - The error occurred when "+s+" inline node was parsed in markdown renderer: "+c)}return l?[{type:"openTag",tagName:"span"},{type:"text",content:"$$"+i+(o?" ":"")}]:[{type:"text",content:"$$"},{type:"closeTag",tagName:"span"}]}},Lh={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 s={type:"openTag",tagName:"li",outerNewLine:!0};return o?[s,{type:"openTag",tagName:"input",selfClose:!0,attributes:ku(ku({},i&&{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,i="tableHead"===r.type?"th":"td",o=r.parent.columns[e.startIdx],s=(null===o||void 0===o?void 0:o.align)?{align:o.align}:null;return n?ku({type:"openTag",tagName:i,outerNewLine:!0},s&&{attributes:s}):{type:"closeTag",tagName:i,outerNewLine:!0}}},Ah={softbreak:"\n",gfm:!1,tagFilter:!1,nodeId:!1};function Oh(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 Ih=function(){function e(e){this.buffer=[],this.options=ku(ku({},Ah),e),this.convertors=this.createConvertors(),delete this.options.convertors}return e.prototype.createConvertors=function(){var e=ku({},Dh);if(this.options.gfm&&(e=ku(ku({},e),Lh)),this.options.convertors){var t=this.options.convertors,n=Object.keys(t),r=ku(ku({},Dh),Lh);n.forEach((function(n){var i=e[n],o=t[n],s=-1===Object.keys(r).indexOf(n)?n.toLowerCase():n;e[s]=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,s=o.convertors[e.type];if(!s)return"continue";var a=!1,l={entering:i,leaf:!bp(e),options:o.options,getChildrenText:Oh,skipChildren:function(){a=!0}},c=zp(e)||function(e){return"customInline"===e.type}(e)?s(e,l,o.convertors):s(e,l);c&&((Array.isArray(c)?c:[c]).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)})),a&&(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).forEach((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"!==nd(nd(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(mp(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 Rh=Object.hasOwnProperty,Ph=Object.setPrototypeOf,Bh=Object.isFrozen,Fh=Object.getPrototypeOf,Hh=Object.getOwnPropertyDescriptor,qh=Object.freeze,zh=Object.seal,jh=Object.create,Vh="undefined"!==typeof Reflect&&Reflect,_h=Vh.apply,Uh=Vh.construct;_h||(_h=function(e,t,n){return e.apply(t,n)}),qh||(qh=function(e){return e}),zh||(zh=function(e){return e}),Uh||(Uh=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 $h,Wh=nf(Array.prototype.forEach),Gh=nf(Array.prototype.pop),Jh=nf(Array.prototype.push),Kh=nf(String.prototype.toLowerCase),Zh=nf(String.prototype.match),Xh=nf(String.prototype.replace),Qh=nf(String.prototype.indexOf),Yh=nf(String.prototype.trim),ef=nf(RegExp.prototype.test),tf=($h=TypeError,function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return Uh($h,t)});function nf(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 _h(e,t,r)}}function rf(e,t){Ph&&Ph(e,null);for(var n=t.length;n--;){var r=t[n];if("string"===typeof r){var i=Kh(r);i!==r&&(Bh(t)||(t[n]=i),r=i)}e[r]=!0}return e}function of(e){var t=jh(null),n=void 0;for(n in e)_h(Rh,e,[n])&&(t[n]=e[n]);return t}function sf(e,t){for(;null!==e;){var n=Hh(e,t);if(n){if(n.get)return nf(n.get);if("function"===typeof n.value)return nf(n.value)}e=Fh(e)}return function(e){return console.warn("fallback value for",e),null}}var af=qh(["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"]),lf=qh(["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"]),cf=qh(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),uf=qh(["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"]),pf=qh(["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"]),df=qh(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),hf=qh(["#text"]),ff=qh(["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","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),mf=qh(["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"]),gf=qh(["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"]),vf=qh(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),yf=zh(/\{\{[\s\S]*|[\s\S]*\}\}/gm),bf=zh(/<%[\s\S]*|[\s\S]*%>/gm),wf=zh(/^data-[\-\w.\u00B7-\uFFFF]/),kf=zh(/^aria-[\-\w]+$/),xf=zh(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Cf=zh(/^(?:\w+script|data):/i),Tf=zh(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Ef="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 Mf(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 Nf=function(){return"undefined"===typeof window?null:window};var Sf=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Nf(),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,s=t.HTMLTemplateElement,a=t.Node,l=t.Element,c=t.NodeFilter,u=t.NamedNodeMap,p=void 0===u?t.NamedNodeMap||t.MozNamedAttrMap:u,d=t.Text,h=t.Comment,f=t.DOMParser,m=t.trustedTypes,g=l.prototype,v=sf(g,"cloneNode"),y=sf(g,"nextSibling"),b=sf(g,"childNodes"),w=sf(g,"parentNode");if("function"===typeof s){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":Ef(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}}(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=of(i).documentMode?i.documentMode:{}}catch(Fe){}var A={};n.isSupported="function"===typeof w&&E&&"undefined"!==typeof E.createHTMLDocument&&9!==L;var O=yf,I=bf,R=wf,P=kf,B=Cf,F=Tf,H=xf,q=null,z=rf({},[].concat(Mf(af),Mf(lf),Mf(cf),Mf(pf),Mf(hf))),j=null,V=rf({},[].concat(Mf(ff),Mf(mf),Mf(gf),Mf(vf))),_=null,U=null,$=!0,W=!0,G=!1,J=!1,K=!1,Z=!1,X=!1,Q=!1,Y=!1,ee=!0,te=!1,ne=!0,re=!0,ie=!1,oe={},se=null,ae=rf({},["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,ce=rf({},["audio","video","img","source","image","track"]),ue=null,pe=rf({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),de="http://www.w3.org/1998/Math/MathML",he="http://www.w3.org/2000/svg",fe="http://www.w3.org/1999/xhtml",me=fe,ge=!1,ve=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":Ef(e))||(e={}),e=of(e),q="ALLOWED_TAGS"in e?rf({},e.ALLOWED_TAGS):z,j="ALLOWED_ATTR"in e?rf({},e.ALLOWED_ATTR):V,ue="ADD_URI_SAFE_ATTR"in e?rf(of(pe),e.ADD_URI_SAFE_ATTR):pe,le="ADD_DATA_URI_TAGS"in e?rf(of(ce),e.ADD_DATA_URI_TAGS):ce,se="FORBID_CONTENTS"in e?rf({},e.FORBID_CONTENTS):ae,_="FORBID_TAGS"in e?rf({},e.FORBID_TAGS):{},U="FORBID_ATTR"in e?rf({},e.FORBID_ATTR):{},oe="USE_PROFILES"in e&&e.USE_PROFILES,$=!1!==e.ALLOW_ARIA_ATTR,W=!1!==e.ALLOW_DATA_ATTR,G=e.ALLOW_UNKNOWN_PROTOCOLS||!1,J=e.SAFE_FOR_TEMPLATES||!1,K=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||fe,ve=ve=-1===ye.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,be="application/xhtml+xml"===ve?function(e){return e}:Kh,J&&(W=!1),Y&&(Q=!0),oe&&(q=rf({},[].concat(Mf(hf))),j=[],!0===oe.html&&(rf(q,af),rf(j,ff)),!0===oe.svg&&(rf(q,lf),rf(j,mf),rf(j,vf)),!0===oe.svgFilters&&(rf(q,cf),rf(j,mf),rf(j,vf)),!0===oe.mathMl&&(rf(q,pf),rf(j,gf),rf(j,vf))),e.ADD_TAGS&&(q===z&&(q=of(q)),rf(q,e.ADD_TAGS)),e.ADD_ATTR&&(j===V&&(j=of(j)),rf(j,e.ADD_ATTR)),e.ADD_URI_SAFE_ATTR&&rf(ue,e.ADD_URI_SAFE_ATTR),e.FORBID_CONTENTS&&(se===ae&&(se=of(se)),rf(se,e.FORBID_CONTENTS)),re&&(q["#text"]=!0),K&&rf(q,["html","head","body"]),q.table&&(rf(q,["tbody"]),delete _.tbody),qh&&qh(e),we=e)},Ce=rf({},["mi","mo","mn","ms","mtext"]),Te=rf({},["foreignobject","desc","title","annotation-xml"]),Ee=rf({},lf);rf(Ee,cf),rf(Ee,uf);var Me=rf({},pf);rf(Me,df);var Ne=function(e){Jh(n.removed,{element:e});try{e.parentNode.removeChild(e)}catch(Fe){try{e.outerHTML=C}catch(Fe){e.remove()}}},Se=function(e,t){try{Jh(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(Fe){Jh(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=Zh(e,/^[\r\n\t ]+/);n=r&&r[0]}"application/xhtml+xml"===ve&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");var o=x?x.createHTML(e):e;if(me===fe)try{t=(new f).parseFromString(o,ve)}catch(Fe){}if(!t||!t.documentElement){t=E.createDocument(me,"template",null);try{t.documentElement.innerHTML=ge?"":o}catch(Fe){}}var s=t.body||t.documentElement;return e&&n&&s.insertBefore(i.createTextNode(n),s.childNodes[0]||null),me===fe?S.call(t,K?"html":"body")[0]:K?t.documentElement:s},Le=function(e){return M.call(e.ownerDocument||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT,null,!1)},Ae=function(e){return"object"===("undefined"===typeof a?"undefined":Ef(a))?e instanceof a:e&&"object"===("undefined"===typeof e?"undefined":Ef(e))&&"number"===typeof e.nodeType&&"string"===typeof e.nodeName},Oe=function(e,t,r){A[e]&&Wh(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 h)&&!("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(Zh(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))&&ef(/<[/\w]/g,e.innerHTML)&&ef(/<[/\w]/g,e.textContent))return Ne(e),!0;if("select"===i&&ef(/<template/i,e.innerHTML))return Ne(e),!0;if(!q[i]||_[i]){if(re&&!se[i]){var o=w(e)||e.parentNode,s=b(e)||e.childNodes;if(s&&o)for(var a=s.length-1;a>=0;--a)o.insertBefore(v(s[a],!0),y(e))}return Ne(e),!0}return e instanceof l&&!function(e){var t=w(e);t&&t.tagName||(t={namespaceURI:fe,tagName:"template"});var n=Kh(e.tagName),r=Kh(t.tagName);if(e.namespaceURI===he)return t.namespaceURI===fe?"svg"===n:t.namespaceURI===de?"svg"===n&&("annotation-xml"===r||Ce[r]):Boolean(Ee[n]);if(e.namespaceURI===de)return t.namespaceURI===fe?"math"===n:t.namespaceURI===he?"math"===n&&Te[r]:Boolean(Me[n]);if(e.namespaceURI===fe){if(t.namespaceURI===he&&!Te[r])return!1;if(t.namespaceURI===de&&!Ce[r])return!1;var i=rf({},["title","style","font","a","script"]);return!Me[n]&&(i[n]||!Ee[n])}return!1}(e)?(Ne(e),!0):"noscript"!==i&&"noembed"!==i||!ef(/<\/no(script|embed)/i,e.innerHTML)?(J&&3===e.nodeType&&(r=e.textContent,r=Xh(r,O," "),r=Xh(r,I," "),e.textContent!==r&&(Jh(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(W&&!U[t]&&ef(R,t));else if($&&ef(P,t));else{if(!j[t]||U[t])return!1;if(ue[t]);else if(ef(H,Xh(n,F,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==Qh(n,"data:")||!le[e]){if(G&&!ef(B,Xh(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 s=e.attributes;if(s){var a={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:j};for(o=s.length;o--;){var l=t=s[o],c=l.name,u=l.namespaceURI;if(r=Yh(t.value),i=be(c),a.attrName=i,a.attrValue=r,a.keepAttr=!0,a.forceKeepAttr=void 0,Oe("uponSanitizeAttribute",e,a),r=a.attrValue,!a.forceKeepAttr&&(Se(c,e),a.keepAttr))if(ef(/\/>/i,r))Se(c,e);else{J&&(r=Xh(r,O," "),r=Xh(r,I," "));var p=be(e.nodeName);if(Re(p,i,r))try{u?e.setAttributeNS(u,c,r):e.setAttribute(c,r),Gh(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 s=void 0,l=void 0,c=void 0,u=void 0,p=void 0;if((ge=!e)&&(e="\x3c!--\x3e"),"string"!==typeof e&&!Ae(e)){if("function"!==typeof e.toString)throw tf("toString is not a function");if("string"!==typeof(e=e.toString()))throw tf("dirty is not a string, aborting")}if(!n.isSupported){if("object"===Ef(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(Z||xe(i),n.removed=[],"string"===typeof e&&(ie=!1),ie);else if(e instanceof a)1===(l=(s=De("\x3c!----\x3e")).ownerDocument.importNode(e,!0)).nodeType&&"BODY"===l.nodeName||"HTML"===l.nodeName?s=l:s.appendChild(l);else{if(!Q&&!J&&!K&&-1===e.indexOf("<"))return x&&te?x.createHTML(e):e;if(!(s=De(e)))return Q?null:C}s&&X&&Ne(s.firstChild);for(var d=Le(ie?e:s);c=d.nextNode();)3===c.nodeType&&c===u||Ie(c)||(c.content instanceof o&&Be(c.content),Pe(c),u=c);if(u=null,ie)return e;if(Q){if(Y)for(p=N.call(s.ownerDocument);s.firstChild;)p.appendChild(s.firstChild);else p=s;return ee&&(p=D.call(r,p,!0)),p}var h=K?s.outerHTML:s.innerHTML;return J&&(h=Xh(h,O," "),h=Xh(h,I," ")),x&&te?x.createHTML(h):h},n.setConfig=function(e){xe(e),Z=!0},n.clearConfig=function(){we=null,Z=!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]||[],Jh(A[e],t))},n.removeHook=function(e){A[e]&&Gh(A[e])},n.removeHooks=function(e){A[e]&&(A[e]=[])},n.removeAllHooks=function(){A={}},n}(),Df=["iframe","embed"],Lf=[];function Af(e){Rs(Df,e)&&Lf.push(e.toLowerCase())}function Of(e,t){return Sf.sanitize(e,Bo({ADD_TAGS:Lf,ADD_ATTR:["rel","target","hreflang","type"],FORBID_TAGS:["input","script","textarea","form","button","select","meta","style","link","title","object","base"]},t))}function If(e,t){return e.literal.replace(new RegExp("(<\\s*"+t+"[^>]*>)|(</"+t+"\\s*[>])","ig"),"").trim()}function Rf(e){var t=(e=e.match(Ua)[0]).match(new RegExp(ja,"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 Pf(e){return Qs(e.attributes).reduce((function(e,t){return e[t.nodeName]=t.nodeValue,e}),{})}function Bf(e,t,n,r){var i=r.getToDOMNode(t)(e),o=n(i.outerHTML),s=document.createElement("div");return s.innerHTML=o,{dom:i=s.firstChild,htmlAttrs:Pf(i)}}var Ff={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:Pf(e),childrenHTML:e.innerHTML}}}],toDOM:function(r){var i=Bf(r,e,t,n),o=i.dom,s=i.htmlAttrs;return s.class=s.class?s.class+" html-block":"html-block",Fo([e,s],Qs(o.childNodes))}}},htmlInline:function(e,t,n){return{attrs:{htmlAttrs:{default:{}},htmlInline:{default:!0}},parseDOM:[{tag:e,getAttrs:function(e){return{htmlAttrs:Pf(e)}}}],toDOM:function(r){var i=Bf(r,e,t,n).htmlAttrs;return[e,i,0]}}}};var Hf=/^\s*<\s*\//,qf={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=[],s={};if(n>3&&(s["data-backticks"]=n),i.length>0&&i[0].length>0){var a=i[0];o.push("lang-"+a),s["data-language"]=a}return[{type:"openTag",tagName:"pre",classNames:o},{type:"openTag",tagName:"code",attributes:s},{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:Ea(o,La(e)).outerHTML},{type:"closeTag",tagName:"span"}]):n()}};function zf(e,t){var n=Bo({},qf);return e&&(n.link=function(t,n){var r=n.entering,i=(0,n.origin)();return r&&(i.attributes=Bo(Bo({},i.attributes),e)),i}),t&&Object.keys(t).forEach((function(e){var r=n[e],i=t[e];r&&vl(i)?n[e]=function(e,t){var n=Bo({},t);return n.origin=function(){return r(e,t)},i(e,n)}:Rs(["htmlBlock","htmlInline"],e)&&!vl(i)?n[e]=function(e,t){var n=e.literal.match(Ua);if(n){var r=n[0],o=n[1],s=n[3],a=(o||s).toLowerCase(),l=i[a],c=If(e,a);if(l){var u=Bo({},e);return u.attrs=Rf(r),u.childrenHTML=c,u.type=a,t.entering=!Hf.test(e.literal),l(u,t)}}return t.origin()}:n[e]=i})),n}var jf=["list","item","blockQuote"],Vf=["UL","OL","BLOCKQUOTE"];function _f(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 Uf(e,t,n){var r=oa(t)-1,i=sa(t)-1,o=n[r].getBoundingClientRect(),s=n[i].offsetTop-n[r].offsetTop+n[i].clientHeight;return{height:s<=0?n[r].clientHeight:s+$f(e,n,Math.min(i+1,e.childCount-1)),rect:o}}function $f(e,t,n){for(var r=e.childCount-1,i=0;n<=r&&_f(e,n);)i+=t[n].clientHeight,n+=1;return i}function Wf(e,t){for(var n=0;e&&e!==t&&(Rs(Vf,e.tagName)||(n+=e.offsetTop),e.offsetParent!==t.offsetParent);)e=e.parentElement;return n}function Gf(e,t,n){return e&&t>n+e.offsetTop?Gf(e.nextElementSibling,t,n)||e:null}function Jf(e,t){for(var n=e.querySelector('[data-nodeid="'+t.id+'"]');!n||ca(t);)t=t.parent,n=e.querySelector('[data-nodeid="'+t.id+'"]');return function(e){var t=e.mdNode,n=e.el;for(;(Rs(jf,t.type)||"table"===t.type)&&t.firstChild;)t=t.firstChild,n=n.firstElementChild;return{mdNode:t,el:n}}({mdNode:t,el:n})}var Kf={};function Zf(e){e&&(delete Kf[Number(e.getAttribute("data-nodeid"))],Qs(e.children).forEach((function(e){Zf(e)})))}function Xf(e,t,n){var r,i=Kf[r=n]&&Kf[r].height,o=function(e){return Kf[e]&&Kf[e].offsetTop}(n),s=i||e.clientHeight,a=o||Wf(e,t)||e.offsetTop;return i||function(e,t){Kf[e]=Kf[e]||{},Kf[e].height=t}(n,s),o||function(e,t){Kf[e]=Kf[e]||{},Kf[e].offsetTop=t}(n,a),{nodeHeight:s,offsetTop:a}}var Qf=Za("md-preview-highlight");var Yf=function(){function e(e,t){var n=document.createElement("div");this.el=n,this.eventEmitter=e,this.isViewer=!!t.isViewer,this.el.className=Za("md-preview");var r=t.linkAttributes,i=t.customHTMLRenderer,o=t.sanitizer,s=t.highlight,a=void 0!==s&&s;this.renderer=new Ih({gfm:!0,nodeId:!0,convertors:zf(r,i)}),this.cursorNodeId=null,this.sanitizer=o,this.initEvent(a),this.initContentSection(),this.isViewer&&(this.previewContent.style.overflowWrap="break-word")}return e.prototype.initContentSection=function(){this.previewContent=tl('<div class="'+Za("contents")+'"></div>'),this.isViewer||this.el.appendChild(this.previewContent)},e.prototype.toggleActive=function(e){el(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()}))),yu(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=Gf(i,e,Wf(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&&ms(e,Qf)}},e.prototype.updateCursorNode=function(e,t){e&&("tableRow"===(e=fa(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&&!(aa(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&&ms(r,Qf),i&&us(i,Qf),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 s=r.id,a=s[0],l=s[1],c=this.getElementByNodeId(a),u=this.getElementByNodeId(l);if(c){c.insertAdjacentHTML("beforebegin",o);for(var p=c;p&&p!==u;){var d=p.nextElementSibling;Ya(p),Zf(p),p=d}(null===p||void 0===p?void 0:p.parentNode)&&(Ya(p),Zf(p))}}else i.insertAdjacentHTML("afterbegin",o)},e.prototype.getRenderer=function(){return this.renderer},e.prototype.destroy=function(){hu(this.el,"scroll"),this.el=null},e.prototype.getElement=function(){return this.el},e.prototype.getHTML=function(){return sl(this.previewContent.innerHTML)},e.prototype.setHTML=function(e){this.previewContent.innerHTML=e},e.prototype.setHeight=function(e){Zo(this.el,{height:e+"px"})},e.prototype.setMinHeight=function(e){Zo(this.el,{minHeight:e+"px"})},e}();function em(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}function tm(e){return!!em(e,(function(e){var t=e.type;return"listItem"===t.name||"bulletList"===t.name||"orderedList"===t.name}))}function nm(e){return!!em(e,(function(e){var t=e.type;return"tableHeadCell"===t.name||"tableBodyCell"===t.name}))}function rm(e){return em(e,(function(e){return"listItem"===e.type.name}))}function im(e){return{tag:e,getAttrs:function(e){var t=e.getAttribute("data-raw-html");return Bo({},t&&{rawHTML:t})}}}function om(e){return Object.keys(e).reduce((function(t,n){return"rawHTML"!==n&&e[n]&&(t[n="className"===n?"class":n]=e[n]),t}),{})}function sm(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]=Rs(["rawHTML","extended"],n)?i:Number(i)),t}),{})}}}function am(e){var t=e.htmlAttrs,n=e.classNames;return Bo(Bo({},t),{class:n?n.join(" "):null})}function lm(e,t,n,r){var i=t.$from,o=t.$to,s=t.depth,a=t,l=!1;if(s>=2&&i.node(s-1).type.compatibleContent(n)&&0===t.startIndex&&i.index(s-1)){var u=e.doc.resolve(t.start-2);a=new A(u,u,s),t.endIndex<t.parent.childCount&&(t=new A(i,e.doc.resolve(o.end(s)),s)),l=!0}var p=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 s=o.length?o[0]:t;return n.canReplaceWith(r,i,s)?o:null}return null}(e,n),o=function(e,t){var n=e.parent,r=e.startIndex,i=e.endIndex,o=n.child(r),s=t.contentMatch.findWrapping(o.type);if(s){for(var a=(s.length?s[s.length-1]:t).contentMatch,l=r;a&&l<i;l+=1)a=a.matchType(n.child(l).type);if(a&&a.validEnd)return s}return null}(t,n);if(i&&o){var s=i.map((function(e){return{type:e}})),a=o.map((function(e){return{type:e,attrs:r}}));return s.concat({type:n}).concat(a)}return null}(a,t,n,r);return p?function(e,t,n,r,i){for(var o=t.start,s=t.end,a=t.startIndex,l=t.endIndex,u=t.parent,p=c.empty,d=n.length-1;d>=0;d-=1)p=c.from(n[d].type.create(n[d].attrs,p));e.step(new Ne(o-(r?2:0),s,o,s,new m(p,0,0),n.length,!0));var h=0;for(d=0;d<n.length;d+=1)if(n[d].type===i){h=d+1;break}for(var f=n.length-h,g=o+n.length-(r?2:0),v=(d=a,l);d<v;d+=1)!(d===a)&&Oe(e.doc,g,f)&&(e.split(g,f),g+=2*f),g+=u.child(d).nodeSize;return e}(e,t,p,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 rm(n)}function um(e){return function(t,n){var r=t.selection,i=t.tr,o=r.$from,s=r.$to,a=o.blockRange(s);if(a){var l=tm(o)?function(e,t,n){var r=t.$from,i=t.$to,o=rm(r),s=rm(i);if(o&&s)for(;s;){var a=s.offset,l=s.node,c=s.depth;l.attrs.task&&e.setNodeMarkup(a,null,{task:!1,checked:!1});var u=e.doc.resolve(a);if(u.parent.type!==n){var p=u.before(c-1);e.setNodeMarkup(p,n)}if(a===o.offset)break;s=cm(e.doc,a)}return e}(i,a,e):lm(i,a,e);return n(l),!0}return!1}}function pm(){return function(e,t){var n=e.selection,r=e.tr,i=e.schema,o=n.$from,s=n.$to,a=o.blockRange(s);if(a){var l=tm(o)?function(e,t){var n=t.$from,r=t.$to,i=rm(n),o=rm(r);if(i&&o)for(;o;){var s=o.offset,a={task:!o.node.attrs.task,checked:!1};if(e.setNodeMarkup(s,null,a),s===i.offset)break;o=cm(e.doc,s)}return e}(r,a):lm(r,a,i.nodes.bulletList,{task:!0});return t(l),!0}return!1}}function dm(e){return function(t,n){var r=t.tr,i=t.selection,o=i.$from,s=i.$to,a=o.blockRange(s,(function(t){var n=t.childCount,r=t.firstChild;return!!n&&r.type===e}));if(a){var l=o.node(a.depth-1).type===e?function(e,t,n){var r=t.$from,i=t.$to,o=t.end,s=t.depth,a=t.parent,l=i.end(s);return o<l&&(e.step(new Ne(o-1,l,o,l,new m(c.from(n.create(null,a.copy())),1,0),1,!0)),t=new A(e.doc.resolve(r.pos),e.doc.resolve(l),s)),e.lift(t,Le(t)),e}(r,a,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 s=e.doc.resolve(t.start),a=s.nodeAfter,l=0===t.startIndex,u=t.endIndex===n.childCount,p=s.node(-1),d=s.index(-1),h=p.canReplace(d+(l?0:1),d+1,null===a||void 0===a?void 0:a.content.append(u?c.empty:c.from(n)));if(a&&h){var f=s.pos,g=f+a.nodeSize;e.step(new Ne(f-(l?1:0),g+(u?1:0),f+1,g-1,new m((l?c.empty:c.from(n.copy(c.empty))).append(u?c.empty:c.from(n.copy(c.empty))),l?0:1,u?0:1),l?0:1))}return e}(r,a);return n(l),!0}return!1}}function hm(){return function(){return function(e,t){var n=e.selection,r=e.schema,i=n.$from,o=n.$to;return!(!i.blockRange(o)||!tm(i))&&function(e){return function(t,n){var r=t.tr,i=t.selection,o=i.$from,s=i.$to,a=o.blockRange(s,(function(t){var n=t.childCount,r=t.firstChild;return!!n&&r.type===e}));if(a&&a.startIndex>0){var l=a.parent,u=l.child(a.startIndex-1);if(u.type!==e)return!1;var p=u.lastChild&&u.lastChild.type===l.type,d=p?c.from(e.create()):null,h=new m(c.from(e.create(null,c.from(l.type.create(null,d)))),p?3:1,0),f=a.start,g=a.end;return r.step(new Ne(f-(p?3:1),g,f,g,h,1,!0)),n(r),!0}return!1}}(r.nodes.listItem)(e,t)}}}function fm(){return{indent:hm(),outdent:function(){return function(e,t){var n=e.selection,r=e.schema,i=n.$from,o=n.$to;return!(!i.blockRange(o)||!tm(i))&&dm(r.nodes.listItem)(e,t)}}}}var mm=new Map,gm=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=em(t,(function(e){return"table"===e.type.name}));if(n){var r=n.node,i=n.depth,o=n.offset,s=mm.get(r);if((null===s||void 0===s?void 0:s.tableStartPos)===o+1)return s;var a=[],l=t.start(i),c=r.child(0),u=r.child(1),p=vm(c,l),d=vm(u,l+c.nodeSize);c.forEach((function(e){return a.push(e)})),u.forEach((function(e){return a.push(e)}));var h=new e(r,a,l,p.concat(d));return mm.set(r,h),h}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),s=o[0],a=o[1],l=this.getCellIndex(t),c=l[0],u=l[1];return s=(r=Zs(s,c))[0],c=r[1],a=(i=Zs(a,u))[0],u=i[1],this.getSpannedOffsets({startRowIdx:s,startColIdx:a,endRowIdx:c,endColIdx:u})},e.prototype.getSpannedOffsets=function(e){return e},e}(),vm=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,s=0;i[s];)s+=1;i[s]={offset:t+r+n+2,nodeSize:o},i.length+=1})),n.push(i)})),n};function ym(e,t){return Ks(gm.prototype,e),vm=t,gm}var bm=function(e){function t(t,n){void 0===n&&(n=t);var r=this,i=t.node(0),o=gm.create(t),s=o.getRectOffsets(t,n),a=function(e,t,n){for(var r=n.startRowIdx,i=n.startColIdx,o=n.endRowIdx,s=n.endColIdx,a=[],l=r;l<=o;l+=1)for(var c=i;c<=s;c+=1){var u=t.getCellInfo(l,c),p=u.offset,d=u.nodeSize;a.push(new Xe(e.resolve(p+1),e.resolve(p+d-1)))}return a}(i,o,s);return(r=e.call(this,a[0].$from,a[0].$to,a)||this).startCell=t,r.endCell=n,r.offsetMap=o,r.isCellSelection=!0,r.visible=!1,r}return Po(t,e),t.prototype.map=function(e,n){var r=this.startCell.pos,i=this.endCell.pos,o=e.resolve(n.map(r)),s=e.resolve(n.map(i)),a=gm.create(o);if(this.offsetMap.totalColumnCount>a.totalColumnCount||this.offsetMap.totalRowCount>a.totalRowCount){var l={tableBody:1,tableRow:2,tableCell:3,paragraph:4}[s.parent.type.name],c=s.end(s.depth-l),u=Math.min(c-4,s.pos);return et.create(e,u)}return new t(o,s)},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=gm.create(this.startCell),s=o.getRectOffsets(this.startCell,this.endCell),a=s.startRowIdx,l=s.startColIdx,u=s.endRowIdx,p=s.endColIdx,d=!1,h=a;h<=u;h+=1){for(var f=[],g=l;g<=p;g+=1){var v=o.getCellInfo(h,g).offset,y=e.nodeAt(v-t);y&&(d="tableHeadCell"===y.type.name,o.extendedRowspan(h,g)||o.extendedColspan(h,g)?f.push(y.type.create({extended:!0})):f.push(y.copy(y.content)))}var b=n.copy(c.from(f)),w=d?r:i;w.content=w.content.append(c.from(b))}return new m(function(e,t){var n=[];return e.childCount&&n.push(e),t.childCount&&n.push(t),c.from(n)}(r,i),1,1)},t.prototype.toJSON=function(){return JSON.stringify(this)},t}(Ze);function wm(e,t,n,r){for(var i=n.nodes,o=i.tableRow,s=i.tableBodyCell,a=i.paragraph,l=[],c=0;c<e;c+=1){for(var u=[],p=0;p<t;p+=1){var d=r&&r[c*t+p],h=a.create(null,d?n.text(d):[]);u.push(s.create(null,h))}l.push(o.create(null,u))}return l}function km(e,t,n,r){void 0===r&&(r=null);for(var i=n.nodes,o=i.tableHeadCell,s=i.tableBodyCell,a=i.paragraph,l=0===t?o:s,c=[],u=0;u<e;u+=1)c.push(l.create(r,a.create()));return c}function xm(e,t){for(;e&&e!==t;){if("TD"===e.nodeName||"TH"===e.nodeName)return e;e=e.parentNode}return null}function Cm(e){return em(e,(function(e){var t=e.type;return"tableHeadCell"===t.name||"tableBodyCell"===t.name}))}function Tm(e){if(e instanceof et){var t=e.$anchor,n=Cm(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 Em(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 Mm(e){var t=e.startRowIdx,n=e.startColIdx;return{rowCount:e.endRowIdx-t+1,columnCount:e.endColIdx-n+1}}function Nm(e,t){return Bo(Bo({},e.attrs),t)}var Sm=new yt("cellSelection"),Dm=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=xm(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=Sm.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!==Sm.getState(this.view.state)&&this.view.dispatch(this.view.state.tr.setMeta(Sm,-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),s=Cm(o);if(s){var a=o.before(s.depth);return i.resolve(a)}}return null},e.prototype.setCellSelection=function(e,t){var n=this.view.state,r=n.selection,i=n.tr,o=null===Sm.getState(this.view.state),s=new bm(e,t);if(o||!r.eq(s)){var a=i.setSelection(s);o&&a.setMeta(Sm,t.pos),this.view.dispatch(a)}},e.prototype.destroy=function(){this.view.dom.removeEventListener("mousedown",this.handlers.mousedown)},e}(),Lm=Za("cell-selected");function Am(e){var t=e.selection,n=e.doc;if(t instanceof bm){var r=[];return t.ranges.forEach((function(e){var t=e.$from,n=e.$to;r.push(Zr.node(t.pos-1,n.pos+1,{class:Lm}))})),Yr.create(n,r)}return null}var Om=function(){function e(){this.keys=[],this.values=[]}return e.prototype.getKeyIndex=function(e){return Qo(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}(),Im="en-US",Rm=function(){function e(){this.code=Im,this.langs=new Om}return e.prototype.setCode=function(e){this.code=e||Im},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,zo(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(Im));var r=n[e];if(!r)throw new Error('There is no text key "'+e+'" in '+t);return r},e}(),Pm=new Rm,Bm=[[{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 Fm(e,t){return Bm.map((function(n){return n.map((function(n){var r=n.action,i=n.command,o=n.payload,s=n.disableInThead,a=n.className;return{label:Pm.get(r),onClick:function(){e.emit("command",i,o)},disabled:t&&!!s,className:a}}))})).concat()}var Hm=["image","link","customBlock","frontMatter"],qm=["strong","strike","emph","code"],zm=["bulletList","orderedList","taskList"];function jm(e,t,n){var r=e.$from,i=e.$to,o=e.from,s=e.to,a={indent:{active:!1,disabled:!0},outdent:{active:!1,disabled:!0}};return t.nodesBetween(o,s,(function(e,t,o){var s=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);Rs(Hm,s)||(Rs(zm,s)?(!function(e,t){t[e]={active:!0},zm.filter((function(t){return t!==e})).forEach((function(e){t[e]&&delete t[e]}))}(s,a),a.indent.disabled=!1,a.outdent.disabled=!1):"paragraph"===s||"text"===s?function(e,t,n,r){qm.forEach((function(i){var o=n.marks[i],s=e.marksAcross(t)||[];o.isInSet(s)&&(r[i]={active:!0})}))}(r,i,n,a):a[s]={active:!0})})),a}function Vm(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:jm(r,i,o)})}}}})}var _m=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 wi(i.innerViewContainer,{state:ht.create({doc:i.node,plugins:[Fi({"Mod-z":function(){return Oo(i.innerEditorView.state,i.innerEditorView.dispatch)},"Shift-Mod-z":function(){return Io(i.innerEditorView.state,i.innerEditorView.dispatch)},Tab:function(e,t){return t(e.tr.insertText("\t")),!0},Enter:Ui,Escape:function(){return i.cancelEditing(),!0},"Ctrl-Enter":function(){return i.saveAndFinishEditing(),!0}}),Ao()]}),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=Za("custom-block"),this.wrapper=document.createElement("div"),this.wrapper.className=Za("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=Za("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(ta(t.tr,e))),this.editorView.focus(),this.renderCustomBlock(),this.closeEditor()},e.prototype.cancelEditing=function(){var e=function(e){let t=Do.getState(e);return t?t.done.eventCount:0}(this.innerEditorView.state);for(this.canceled=!0;e--;)Oo(this.innerEditorView.state,this.innerEditorView.dispatch),Oo(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(et.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&&vl(this.getPos)){for(var i=this.editorView.state.tr,o=ge.offset(this.getPos()+1),s=0;s<r.length;s+=1)for(var a=r[s].steps,l=0;l<a.length;l+=1)i.step(a[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}(),Um="image-link",$m=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&&vl(o.getPos)&&Ra(t,Um)){var i=getComputedStyle(t,":before");if(e.stopPropagation(),Ja(i,n,r)){var s=o.view.state.tr,a=o.getPos();s.setSelection(ta(s,a,a+1)),o.view.dispatch(s),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.name}))[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=Um,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=am(e.attrs);return t.src=r,i&&(t.alt=i),ol(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}(),Wm=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&&vl(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=am(this.node.attrs);return n&&t.setAttribute("data-language",n),ol(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 s=i.clientWidth;Zo(i,{top:n+10+"px",left:r-s-10+"px",width:s+"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&&vl(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,Ya(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}(),Gm=/MsoListParagraph/,Jm=/style=(.|\n)*mso-/,Km=/mso-list:(.*)/,Zm=/O:P/,Xm=/^(n|u|l)/,Qm="p.MsoListParagraph";function Ym(e){for(var t=[],n=document.createTreeWalker(e,1,null,!1);n.nextNode();){var r=n.currentNode;if(Qa(r)){var i=r,o=i.outerHTML,s=i.textContent,a=Jm.test(o),l=Km.test(o);a&&!l&&s?t.push([r,!0]):(Zm.test(r.nodeName)||a&&!s||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);Ya(e)}(t):Ya(t)})),e.innerHTML.trim()}function eg(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(Km)[1].trim().split(" ")[1];return{id:t,level:parseInt(r.replace("level",""),10),prev:null,parent:null,children:[],unordered:Xm.test(e.textContent||""),contents:Ym(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 tg(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");i.innerHTML=r,n.appendChild(i),t.length&&n.appendChild(tg(t))})),n}function ng(e){return tg(eg(e).filter((function(e){return!e.parent})))}function rg(e){var t=document.createElement("div");t.innerHTML=e;var n=[],r=function(e,t){var n=Qs(e.querySelectorAll(t));return n.length?n:[]}(t,Qm);return r.forEach((function(e){var r,i,o=function(e){for(;e&&!Qa(e);)e=e.nextSibling;return!e||!Gm.test(e.className)}(e.nextSibling);if(n.push(e),o){var s=ng(n),a=e.nextSibling;a?(r=s,(i=a).parentNode&&i.parentNode.insertBefore(r,i)):function(e,t){(t=Vo(t)?Qs(t):[t]).forEach((function(t){e.appendChild(t)}))}(t,s),n=[]}Ya(e)})),""+(r.length?"<p></p>":"")+t.innerHTML}var ig="\x3c!--StartFragment--\x3e",og="\x3c!--EndFragment--\x3e";function sg(e){return function(e){return Jm.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(ig),n=e.lastIndexOf(og);return t>-1&&n>-1&&(e=e.slice(t+ig.length,n)),e.replace(/<br[^>]*>/g,Ga)}(e)))&&(e=rg(e)),e}function ag(e,t,n){for(var r=[],i=e.childCount,o=0;o<i;o+=1)if(!e.child(o).attrs.extended){var s=o<i?n.create(e.child(o).attrs,e.child(o).content):n.createAndFill();r.push(s)}return r}function lg(e,t,n){var r=n.nodes,i=r.tableRow,o=ag(e,0,r.tableHeadCell);return i.create(null,o)}function cg(e,t,n){var r=n.nodes,i=r.tableRow,o=ag(e,0,r.tableBodyCell);return i.create(null,o)}function ug(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 Fo(Fo([],t),n)}function pg(e,t,n){var r=lg(e,0,n);return n.nodes.tableHead.create(null,r)}function dg(e,t,n){var r=e.map((function(e){return cg(e,0,n)}));if(!e.length){var i=function(e,t){for(var n=t.nodes,r=n.tableRow,i=n.tableBodyCell,o=[],s=0;s<e;s+=1){var a=i.createAndFill();o.push(a)}return r.create({dummyRowForPasting:!0},o)}(t,n);r.push(i)}return n.nodes.tableBody.create(null,r)}function hg(e,t,n){var r=[],i=e.content,o=e.openStart,s=e.openEnd;return i.forEach((function(e){if("table"===e.type.name){var i=Em(new m(c.from(e),0,0));if(i){var o=ug(i),s="tableBody"===i.firstChild.type.name,a=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,[dg(e,i,t)]);var o=e[0],s=e.slice(1),a=[pg(o,0,t)];return s.length&&a.push(dg(s,i,t)),t.nodes.table.create(null,a)}(o,t,s,n);r.push(a)}}else r.push(e)})),new m(c.from(r),o,s)}var fg=4,mg=2;function gg(e){return e*fg}function vg(e,t){var n=e.state,r=n.selection,i=n.schema,o=n.tr,s=Tm(r),a=s.anchor,l=s.head;if(a&&l){var c=Em(t);if(!c)return!1;var u=gm.create(a),p=u.getRectOffsets(a,l),d=function(e,t,n){var r=[],i=ug(e),o=(i[0].childCount,i.length),s=0===t.startRowIdx,a=i.slice(0,o);if(s){var l=a.shift();if(l){var c=lg(l,0,n).content;r.push(c)}}return a.forEach((function(e){if(!e.attrs.dummyRowForPasting){var t=cg(e,0,n).content;r.push(t)}})),r}(c,p,i),h=function(e,t,n){for(var r=t.startRowIdx,i=t.startColIdx,o=n.length,s=0,a=function(e){var t=n[e].childCount;n[e].forEach((function(e){var n=e.attrs.colspan;n>1&&(t+=n-1)})),s=Math.max(s,t)},l=0;l<o;l+=1)a(l);var c=r+o-1,u=i+s-1;return{startRowIdx:r,startColIdx:i,endRowIdx:c,endColIdx:u,addedRowCount:Math.max(c+1-e.totalRowCount,0),addedColumnCount:Math.max(u+1-e.totalColumnCount,0)}}(u,p,d),f=[];return function(e,t){var n=e.getSpannedOffsets(t),r=Mm(n),i=r.rowCount,o=r.columnCount,s=Mm(t),a=s.rowCount,l=s.columnCount;return i===a&&o===l}(u,h)&&(function(e,t){for(var n=e.startRowIdx,r=e.startColIdx,i=e.endRowIdx,o=e.endColIdx,s=e.addedRowCount,a=e.addedColumnCount,l=n;l<=i-s;l+=1)t.push({rowIdx:l,startColIdx:r,endColIdx:o-a})}(h,f),h.addedColumnCount&&function(e,t,n,r,i){for(var o=r.startRowIdx,s=r.startColIdx,a=r.endRowIdx,l=r.endColIdx,c=r.addedRowCount,u=r.addedColumnCount,p=n.totalRowCount,d=0,h=0;h<p;h+=1){var f=n.getCellInfo(h,l-u),m=f.offset,g=f.nodeSize,v=e.mapping.map(m+g),y=km(u,h,t);if(e.insert(v,y),h>=o&&h<=a-c){var b=n.getCellInfo(h,l-u),w=e.mapping.map(b.offset),k=v+gg(u);i[d]={rowIdx:h,startColIdx:s,endColIdx:l,dummyOffsets:[w,k]},d+=1}}}(o,i,u,h,f),h.addedRowCount&&function(e,t,n,r,i){var o=r.addedRowCount,s=r.addedColumnCount,a=r.startColIdx,l=r.endColIdx,c=e.mapping.maps.length,u=n.tableEndOffset-2,p=wm(o,n.totalColumnCount+s,t),d=u;e.insert(e.mapping.slice(c).map(d),p);for(var h=0;h<o;h+=1){var f=d+gg(a)+1,m=d+gg(l+1)+1,g=d+gg(n.totalColumnCount+s)+mg;i.push({rowIdx:h+n.totalRowCount,startColIdx:a,endColIdx:l,dummyOffsets:[f,m]}),d=g}}(o,i,u,h,f),function(e,t,n,r){var i=e.mapping.maps.length;n.forEach((function(n,o){var s=n.rowIdx,a=n.startColIdx,l=n.endColIdx,c=n.dummyOffsets,u=e.mapping.slice(i),p=new m(t[o],0,0),d=c?c[0]:r.getCellStartOffset(s,a),h=c?c[1]:r.getCellEndOffset(s,l);e.replace(u.map(d),u.map(h),p)}))}(o,d,f,u),e.dispatch(o),function(e,t,n){var r=e.state,i=r.tr,o=r.doc,s=gm.create(o.resolve(n)),a=t[0],l=a.rowIdx,c=a.startColIdx,u=Us(t),p=u.rowIdx,d=u.endColIdx,h=s.getCellInfo(l,c).offset,f=s.getCellInfo(p,d).offset;e.dispatch(i.setSelection(new bm(o.resolve(h),o.resolve(f))))}(e,f,u.getCellInfo(0,0).offset)),!0}return!1}var yg=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Po(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}(dl),bg=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Po(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:Bo({},{htmlAttrs:{default:null},classNames:{default:null}}),parseDOM:[{tag:"p"}],toDOM:function(e){return["p",am(e.attrs),0]}}},enumerable:!1,configurable:!0}),t}(dl),wg=/\s{1,4}$/,kg=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Po(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)||tm(i)||nm(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,s=n.from;if(i.blockRange(o)&&!tm(i)&&!nm(i)){var a=i.nodeBefore;if(a&&a.isText){var l=a.text,c=l.replace(wg,""),u=l.length-c.length;return t(r.delete(s-u,s)),!0}}return!1}},t.prototype.keymaps=function(){return{Tab:this.addSpaces(),"Shift-Tab":this.removeSpaces()}},t}(dl),xg=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Po(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 Bo({level:e},n&&{rawHTML:n})}}}));return{attrs:Bo({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,am(t),0]}}},enumerable:!1,configurable:!0}),t.prototype.commands=function(){return function(e){return function(t,n){return eo(t.schema.nodes[e.level?"heading":"paragraph"],e)(t,n)}}},t}(dl),Cg=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Po(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:Bo({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 Bo({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",Bo({"data-language":t.language},am(t)),0]]}}},enumerable:!1,configurable:!0}),t.prototype.commands=function(){return function(){return function(e,t){return eo(e.schema.nodes.codeBlock)(e,t)}}},t.prototype.moveCursor=function(e){var t=this;return function(n,r){var i,o,s=n.tr,a=n.doc,l=n.schema,c=n.selection.$from;if(t.context.view.endOfTextblock(e)&&"codeBlock"===c.node().type.name){var u=c.parent.textContent.split("\n"),p="up"===e?c.start():c.end(),d="up"===e?[p,u[0].length+p]:[p-Us(u).length,p],h=a.resolve("up"===e?c.before():c.after()),f="up"===e?h.nodeBefore:h.nodeAfter;if(i=c.pos,o=d[1],i>=d[0]&&i<=o&&!f){var m=na(s,h,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}(dl),Tg=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Po(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:Bo({rawHTML:{default:null}},{htmlAttrs:{default:null},classNames:{default:null}}),parseDOM:[im("ul")],toDOM:function(e){return["ul",am(e.attrs),0]}}},enumerable:!1,configurable:!0}),t.prototype.changeList=function(){return function(e,t){return um(e.schema.nodes.bulletList)(e,t)}},t.prototype.commands=function(){return{bulletList:this.changeList,taskList:pm}},t.prototype.keymaps=function(){var e=this.changeList(),t=fm(),n=t.indent,r=t.outdent;return{"Mod-u":e,"Mod-U":e,Tab:n(),"Shift-Tab":r()}},t}(dl),Eg=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Po(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:Bo({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 Bo({order:e.hasAttribute("start")?Number(t):1},n&&{rawHTML:n})}}],toDOM:function(e){var t=e.attrs;return[t.rawHTML||"ol",Bo({start:1===t.order?null:t.order},am(t)),0]}}},enumerable:!1,configurable:!0}),t.prototype.commands=function(){return function(){return function(e,t){return um(e.schema.nodes.orderedList)(e,t)}}},t.prototype.keymaps=function(){var e=this.commands()(),t=fm(),n=t.indent,r=t.outdent;return{"Mod-o":e,"Mod-O":e,Tab:n(),"Shift-Tab":r()}},t}(dl),Mg=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Po(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 Bo({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",Bo({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,s=n.empty,a=i.nodes.listItem,l=o.parent,c=o.node(-1);if(s&&!l.childCount&&c.type===a){if(o.index(-2)>=1)return r.delete(o.start(-1)-1,o.end(-1)),t(r),!0;if(o.node(-3).type===a)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,s=i.$to;if(o.depth<2||!o.sameParent(s))return!1;var a=o.node(-1);if(a.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=c.empty,p=o.depth-(l?1:2);p>=o.depth-3;p-=1)u=c.from(o.node(p).copy(u));return u=u.append(c.from(e.createAndFill())),r.replace(l?o.before():o.before(-1),o.after(-3),new m(u,l?3:2,2)),r.setSelection(Ze.near(r.doc.resolve(o.pos+(l?3:2)))),n(r),!0}var d=s.pos===o.end()?a.contentMatchAt(0).defaultType:null,h=d&&[null,{type:d}];return r.delete(o.pos,s.pos),!!Oe(r.doc,o.pos,2,h)&&(r.split(o.pos,2,h),n(r),!0)}}(e.schema.nodes.listItem)(e,t)}}},t}(dl),Ng=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Po(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"blockQuote"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return{attrs:Bo({rawHTML:{default:null}},{htmlAttrs:{default:null},classNames:{default:null}}),content:"block+",group:"block",parseDOM:[im("blockquote")],toDOM:function(e){return["blockquote",am(e.attrs),0]}}},enumerable:!1,configurable:!0}),t.prototype.commands=function(){return function(){return function(e,t){return Yi(e.schema.nodes.blockQuote)(e,t)}}},t.prototype.keymaps=function(){var e=this.commands()();return{"Alt-q":e,"Alt-Q":e}},t}(dl),Sg={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 s=t.getCellInfo(n,r);return s.offset+s.nodeSize-2}return null},right:function(e,t){var n=e[0],r=e[1],i=t.totalRowCount,o=t.totalColumnCount,s=r===o-1;if(n!==i-1||!s){var a=r+1,l=t.getColspanStartInfo(n,r);return(null===l||void 0===l?void 0:l.count)>1&&(a+=l.count-1),(s||a===o)&&(n+=1,a=0),t.getCellInfo(n,a).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,s=t.getRowspanStartInfo(n,r);return(null===s||void 0===s?void 0:s.count)>1&&(o+=s.count-1),t.getCellInfo(o,r).offset+2}return null}};function Dg(e,t,n){var r=n[0],i=n[1],o=t.getRowspanStartInfo(r,i),s="up"===e&&0===r,a="down"===e&&((null===o||void 0===o?void 0:o.count)>1?r+o.count-1:r)===t.totalRowCount-1;return s||a}function Lg(e,t,n,r){void 0===r&&(r=!1);var i=e.doc.resolve(t.tableEndOffset);return r||!i.nodeAfter?na(e,i,n):e.setSelection(Ze.near(i,1))}function Ag(e,t,n,r){var i=(0,Sg[e])(n,r);if(i){var o="right"===e||"down"===e?1:-1;return t.setSelection(Ze.near(t.doc.resolve(i),o))}return null}function Og(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 Ig=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Po(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:Bo({rawHTML:{default:null}},{htmlAttrs:{default:null},classNames:{default:null}}),parseDOM:[im("table")],toDOM:function(e){return["table",am(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,s=t.schema,a=t.selection,l=t.tr,c=a.from,u=a.to,p=a.$from;if(c===u&&!nm(p)){var d=s.nodes,h=d.tableHead,f=d.tableBody,m=null===o||void 0===o?void 0:o.slice(0,i),g=null===o||void 0===o?void 0:o.slice(i,o.length),v=function(e,t,n){for(var r=t.nodes,i=r.tableRow,o=r.tableHeadCell,s=r.paragraph,a=[],l=0;l<e;l+=1){var c=n&&n[l],u=s.create(null,c?t.text(c):[]);a.push(o.create(null,u))}return[i.create(null,a)]}(i,s,m),y=wm(r-1,i,s,g),b=s.nodes.table.create(null,[h.create(null,v),f.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=gm.create(n.$anchor);if(i){var o=i.tableStartOffset,s=i.tableEndOffset,a=o-1,l=ta(r.delete(a,s),a);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,s=Tm(r),a=s.anchor,l=s.head;if(a&&l){for(var c=gm.create(a),u=c.getRectOffsets(a,l),p="left"===e?u.startColIdx:u.endColIdx+1,d=Mm(u).columnCount,h=c.totalRowCount,f=0;f<h;f+=1){var m=km(d,f,o);i.insert(i.mapping.map(c.posAt(f,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=Tm(n),o=i.anchor,s=i.head;if(o&&s){var a=gm.create(o),l=a.getRectOffsets(o,s),c=a.totalColumnCount,u=a.totalRowCount;if(Mm(l).columnCount===c)return!1;for(var p=l.startColIdx,d=l.endColIdx,h=r.mapping.maps.length,f=0;f<u;f+=1)for(var m=d;m>=p;m-=1){var g=a.getCellInfo(f,m),v=g.offset,y=g.nodeSize,b=r.mapping.slice(h).map(v),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,s=Tm(r),a=s.anchor,l=s.head;if(a&&l){var c=gm.create(a),u=c.totalColumnCount,p=c.getRectOffsets(a,l),d=Mm(p).rowCount,h=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,c,p),f=h.targetRowIdx,m=h.insertColIdx,g=h.nodeSize;if(!(0===f)){for(var v=[],y=o.mapping.map(c.posAt(f,m))+g,b=[],w=0;w<u;w+=1)b=b.concat(km(1,f,i));for(var k=0;k<d;k+=1)v.push(i.nodes.tableRow.create(null,b));return n(o.insert(y,v)),!0}}return!1}}},t.prototype.removeRow=function(){return function(){return function(e,t){var n=e.selection,r=e.tr,i=Tm(n),o=i.anchor,s=i.head;if(o&&s){var a=gm.create(o),l=a.totalRowCount,c=a.totalColumnCount,u=a.getRectOffsets(o,s),p=Mm(u).rowCount,d=u.startRowIdx,h=u.endRowIdx;if(p===l-1||0===d)return!1;for(var f=h;f>=d;f-=1){var m=Og(a,f,c),g=m.from,v=m.to;r.delete(g-1,v+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,s=Tm(i),a=s.anchor,l=s.head;if(a&&l){for(var c=gm.create(a),u=c.totalRowCount,p=c.getRectOffsets(a,l),d=p.startColIdx,h=p.endColIdx,f=0;f<u;f+=1)for(var m=d;m<=h;m+=1)if(!c.extendedRowspan(f,m)&&!c.extendedColspan(f,m)){var g=c.getNodeAndPos(f,m),v=g.node,y=g.pos,b=Nm(v,{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,s=Tm(r),a=s.anchor,l=s.head;if(a&&l){var c=gm.create(a),u=c.getCellIndex(a),p=void 0;if(p=Dg(e,c,u)?Lg(i,c,o):Ag(e,i,u,c))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,s=n.doc,a=n.schema,l=i.$from;if(!t.context.view.endOfTextblock(e))return!1;var c=em(l,(function(e){var t=e.type;return"tableHeadCell"===t.name||"tableBodyCell"===t.name}));if(c){var u=em(l,(function(e){return"paragraph"===e.type.name})),p=c.depth;if(u&&function(e,t,n,r){var i=t[0],o=t[1],s=i+3,a=o>=s,l=a?i+1:o,c=function(e,t,n,r,i){var o=t[0],s=t[1],a=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,s]))return!1;var l=n.before(a);if(r.resolve(l).nodeBefore)return!1}return!0}(e,[o,s,l],n,r,a),u=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,a);return c&&u}(e,[p,u.depth],l,s)){var d=Tm(i).anchor,h=gm.create(d),f=h.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,s=t.tableEndOffset,a=t.getCellInfo(r,i),l=a.offset,c=a.nodeSize;return("left"===e?o:s)===("left"===e?l-2:l+c+3)}(e,h,f)?Dg(e,h,f)?"up"===e?m=function(e,t,n){var r=e.doc.resolve(t.tableStartOffset-1);return r.nodeBefore?e.setSelection(Ze.near(r,-1)):na(e,r,n)}(o,h,a):"down"===e&&(m=Lg(o,h,a)):m=Ag(e,o,f,h):m=function(e,t,n){var r=e.doc.resolve(t.before(n-3));return e.setSelection(new nt(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=Tm(r),s=o.anchor,a=o.head;if(s&&a&&!(r instanceof et)){for(var l=gm.create(s),c=l.getRectOffsets(s,a),u=c.startRowIdx,p=c.startColIdx,d=c.endRowIdx,h=c.endColIdx,f=u;f<=d;f+=1)for(var m=p;m<=h;m+=1)if(!l.extendedRowspan(f,m)&&!l.extendedColspan(f,m)){var g=l.getNodeAndPos(f,m),v=g.node,y=g.pos,b=km(1,f,n,v.attrs);i.replaceWith(i.mapping.map(y),i.mapping.map(y+v.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(em(o,(function(e){var t=e.type;return"tableHeadCell"===t.name||"tableBodyCell"===t.name}))&&em(o,(function(e){return"paragraph"===e.type.name}))){var s=Tm(n).anchor;return t(Lg(r,gm.create(s),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}(dl),Rg=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Po(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:Bo({rawHTML:{default:null}},{htmlAttrs:{default:null},classNames:{default:null}}),parseDOM:[im("thead")],toDOM:function(e){return["thead",am(e.attrs),0]}}},enumerable:!1,configurable:!0}),t}(dl),Pg=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Po(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:Bo({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&&Bo({},n&&{rawHTML:n})}}],toDOM:function(e){return["tbody",am(e.attrs),0]}}},enumerable:!1,configurable:!0}),t}(dl),Bg=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Po(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:Bo({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&&Bo({},n&&{rawHTML:n})}}],toDOM:function(e){return["tr",am(e.attrs),0]}}},enumerable:!1,configurable:!0}),t}(dl),Fg=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Po(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:Bo({align:{default:null},className:{default:null},rawHTML:{default:null},colspan:{default:null},extended:{default:null}},{htmlAttrs:{default:null},classNames:{default:null}}),isolating:!0,parseDOM:[sm("th")],toDOM:function(e){var t=e.attrs,n=om(t);return["th",Bo(Bo({},n),am(t)),0]}}},enumerable:!1,configurable:!0}),t}(dl),Hg=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Po(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:[sm("td")],toDOM:function(e){return["td",om(e.attrs),0]}}},enumerable:!1,configurable:!0}),t}(dl),qg=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Po(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:Bo({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=Of(e,{RETURN_DOM_FRAGMENT:!0}).firstChild,n=t.getAttribute("src")||"",r=t.getAttribute("data-raw-html"),i=t.getAttribute("alt");return Bo({imageUrl:n,altText:i},r&&{rawHTML:r})}}],toDOM:function(e){var t=e.attrs;return[t.rawHTML||"img",Bo(Bo({src:Is(t.imageUrl)},t.altText&&{alt:t.altText}),am(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,s=o.imageUrl,a=o.altText;if(!s)return!1;var l=r.nodes.image.createAndFill(Bo({imageUrl:s},a&&{altText:a}));return n(i.replaceSelectionWith(l).scrollIntoView()),!0}}},t.prototype.commands=function(){return{addImage:this.addImage()}},t}(dl),zg=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Po(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"thematicBreak"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return{attrs:Bo({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",am(t),[t.rawHTML||"hr"]]}}},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 s=t.doc,a=t.schema.nodes,l=a.thematicBreak,c=a.paragraph,u=[l.create()],p=o.node(1),d=s.child(s.childCount-1)===p,h=s.resolve(o.after(1)),f=(null===(r=o.nodeAfter)||void 0===r?void 0:r.type.name)===e.name;return(d||f)&&u.push(c.create()),n(t.tr.insert(h.pos,u).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}(dl),jg=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Po(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 Bo({},t&&{rawHTML:t})}}}));return{attrs:Bo({rawHTML:{default:null}},{htmlAttrs:{default:null},classNames:{default:null}}),parseDOM:e,toDOM:function(e){var t=e.attrs;return[t.rawHTML||"strong",am(t)]}}},enumerable:!1,configurable:!0}),t.prototype.bold=function(){return function(){return function(e,t){return to(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}(Yl),Vg=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Po(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 Bo({},t&&{rawHTML:t})}}}));return{attrs:Bo({rawHTML:{default:null}},{htmlAttrs:{default:null},classNames:{default:null}}),parseDOM:e,toDOM:function(e){var t=e.attrs;return[t.rawHTML||"em",am(t)]}}},enumerable:!1,configurable:!0}),t.prototype.italic=function(){return function(){return function(e,t){return to(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}(Yl),_g=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Po(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 Bo({},t&&{rawHTML:t})}}}));return{attrs:Bo({rawHTML:{default:null}},{htmlAttrs:{default:null},classNames:{default:null}}),parseDOM:e,toDOM:function(e){var t=e.attrs;return[t.rawHTML||"del",am(t)]}}},enumerable:!1,configurable:!0}),t.prototype.commands=function(){return function(){return function(e,t){return to(e.schema.marks.strike)(e,t)}}},t.prototype.keymaps=function(){var e=this.commands()();return{"Mod-s":e,"Mod-S":e}},t}(Yl),Ug=function(e){function t(t){var n=e.call(this)||this;return n.linkAttributes=t,n}return Po(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:Bo({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=Of(e,{RETURN_DOM_FRAGMENT:!0}).firstChild,n=t.getAttribute("href")||"",r=t.getAttribute("title")||"",i=t.getAttribute("data-raw-html");return Bo({linkUrl:n,title:r},i&&{rawHTML:i})}}],toDOM:function(t){var n=t.attrs;return[n.rawHTML||"a",Bo(Bo({href:Is(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,s=void 0===o?"":o,a=t.schema,l=t.tr,c=t.selection,u=c.empty,p=c.from,d=c.to;if(p&&d&&i){var h={linkUrl:i},f=a.mark("link",h);if(u&&s){var m=ea(a,s,f);l.replaceRangeWith(p,d,m)}else l.addMark(p,d,f);return n(l.scrollIntoView()),!0}return!1}}},t.prototype.toggleLink=function(){return function(e){return function(t,n){return to(t.schema.marks.link,e)(t,n)}}},t.prototype.commands=function(){return{addLink:this.addLink(),toggleLink:this.toggleLink()}},t}(Yl),$g=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Po(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"code"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return{attrs:Bo({rawHTML:{default:null}},{htmlAttrs:{default:null},classNames:{default:null}}),parseDOM:[{tag:"code",getAttrs:function(e){var t=e.getAttribute("data-raw-html");return Bo({},t&&{rawHTML:t})}}],toDOM:function(e){var t=e.attrs;return[t.rawHTML||"code",am(t)]}}},enumerable:!1,configurable:!0}),t.prototype.commands=function(){return function(){return function(e,t){return to(e.schema.marks.code)(e,t)}}},t.prototype.keymaps=function(){var e=this.commands()();return{"Shift-Mod-c":e,"Shift-Mod-C":e}},t}(Yl),Wg=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Po(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)&&eo(t.schema.nodes.customBlock,e)(t,n)}}},t}(dl),Gg=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Po(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)&&Wi(e,t)}}},t.prototype.keymaps=function(){return{Enter:this.commands()()}},t}(dl),Jg=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Po(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)&&Wi(e,t)}}},t.prototype.keymaps=function(){return{Enter:this.commands()()}},t}(dl);var Kg=Za("contents"),Zg=function(e){function t(t,n){var r=e.call(this,t)||this,i=n.toDOMAdaptor,o=n.htmlSchemaMap,s=void 0===o?{}:o,a=n.linkAttributes,l=void 0===a?{}:a,c=n.useCommandShortcut,u=void 0===c||c,p=n.wwPlugins,d=void 0===p?[]:p,h=n.wwNodeViews,f=void 0===h?{}:h;return r.editorType="wysiwyg",r.el.classList.add("ww-mode"),r.toDOMAdaptor=i,r.linkAttributes=l,r.extraPlugins=d,r.pluginNodeViews=f,r.specs=r.createSpecs(),r.schema=r.createSchema(s),r.context=r.createContext(),r.keymaps=r.createKeymaps(u),r.view=r.createView(),r.commands=r.createCommands(),r.specs.setContext(Bo(Bo({},r.context),{view:r.view})),r.initEvent(),r}return Po(t,e),t.prototype.createSpecs=function(){return e=this.linkAttributes,new wl([new yg,new bg,new kg,new xg,new Cg,new Tg,new Eg,new Mg,new Ng,new Ig,new Rg,new Pg,new Bg,new Fg,new Hg,new qg,new zg,new jg,new Vg,new _g,new Ug(e),new $g,new Wg,new Gg,new ml,new Jg]);var e},t.prototype.createContext=function(){return{schema:this.schema,eventEmitter:this.eventEmitter}},t.prototype.createSchema=function(e){return new X({nodes:Bo(Bo({},this.specs.nodes),e.nodes),marks:Bo(Bo({},this.specs.marks),e.marks)})},t.prototype.createPlugins=function(){return Fo([new mt({key:Sm,state:{init:function(){return null},apply:function(e,t){var n=e.getMeta(Sm);if(n)return-1===n?null:n;if(vs(t)||!e.docChanged)return t;var r=e.mapping.mapResult(t),i=r.deleted,o=r.pos;return i?null:o}},props:{decorations:Am,createSelectionBetween:function(e){var t=e.state;return vs(Sm.getState(t))?null:t.selection}},view:function(e){return new Dm(e)}}),(e=this.eventEmitter,new mt({props:{handleDOMEvents:{contextmenu:function(t,n){var r=xm(n.target,t.dom);if(r){n.preventDefault();var i=n,o=i.clientX,s=i.clientY,a=t.dom.parentNode.getBoundingClientRect(),l=a.left,c=a.top,u="TH"===r.nodeName;return e.emit("contextmenu",{pos:{left:o-l+10+"px",top:s-c+30+"px"},menuGroups:Fm(e,u),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});if(o){var s=e.state,a=s.doc,l=s.tr,c=a.resolve(o.pos),u=rm(c),p=t.target,d=getComputedStyle(p,":before"),h=t,f=h.offsetX,m=h.offsetY;if(!u||!Ja(d,f,m))return!1;t.preventDefault();var g=c.before(u.depth),v=u.node.attrs;return l.setNodeMarkup(g,null,Bo(Bo({},v),{checked:!v.checked})),e.dispatch(l),!0}return!1}}}}),Vm(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 wi(this.el,{state:this.createState(),attributes:{class:Kg},nodeViews:Bo({customBlock:function(e,n,r){return new _m(e,n,r,t)},image:function(e,t,r){return new $m(e,t,r,n)},codeBlock:function(e,t,r){return new Wm(e,t,r,n)},widget:hl},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:sg,transformPasted:function(t){return hg(t,e.schema,nm(e.view.state.selection.$from))},handlePaste:function(e,t,n){return vg(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=Qs(i).some((function(e){return"string"===e.kind&&"text/rtf"===e.type}));if(!o){var s=ul(i);s&&(n.preventDefault(),cl(e.eventEmitter,s,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,fm())},t.prototype.getHTML=function(){return sl(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,s=e.split("\n").map((function(e){return Ys(i,Da(e,i))})),a=new m(c.from(s),1,1),l=gs(t)&&gs(n)?o.replaceRange(t,n,a):o.replaceSelection(a);this.view.dispatch(l),this.focus()},t.prototype.deleteSelection=function(e,t){var n=this.view.state.tr,r=gs(e)&&gs(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,s=i.to;return gs(e)&&gs(t)&&(o=e,s=t),r.textBetween(o,s,"\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=ta(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=Da(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(),s=i.node(),a=i.start(),l=i.end(),c=s.type.name;if(o.length||"paragraph"===c){var u=o[o.length-1];c=u?u.type.name:"text",s.forEach((function(e,t){var n=e.isText,r=e.nodeSize,o=e.marks,s=i.pos-a;n&&t<=s&&t+r>=s&&function(e){return!e.length||Rs(e,u)}(o)&&(l=(a+=t)+r)}))}return{range:[a,l],type:c}},t}(gl),Xg=Yo,Qg=vs;var Yg=function(e){return!Xg(e)&&!Qg(e)};var ev=function(e){return Yg(e)&&!1!==e};var tv=function(e){return!ev(e)},nv=["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"],rv=function(){function e(){var e=this;this.events=new Om,this.eventTypes=nv.reduce((function(e,t){return Bo(Bo({},e),{type:t})}),{}),this.hold=!1,nv.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=[];return!this.hold&&i&&i.forEach((function(e){var n=e.apply(void 0,t);Yo(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,Fo([t],n));tv(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!Yo(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}(),iv=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 ov(e){return"\n"===e[e.length-1]?e.slice(0,e.length-1):e}function sv(e,t){var n=e.schema,r=t.literal.match(Ua);if(r){var i=r[1],o=r[3],s=(i||o).toLowerCase();return"htmlInline"===t.type&&!(!n.marks[s]&&!n.nodes[s])}return!1}function av(e){return Rs(["text","strong","emph","strike","image","link","code"],e.type)}function lv(e){return"softbreak"===(null===e||void 0===e?void 0:e.type)}function cv(e){var t=e.type,n=e.literal,r="htmlInline"===t&&n.match(Ua);if(r){var i=r[1],o=r[3],s=i||o;if(s)return Rs(["ul","ol","li"],s.toLowerCase())}return!1}function uv(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=document.createElement("div");r.innerHTML=Of(e);var i=r.firstChild;return t.map((function(e){return i.getAttribute(e)||""}))}var pv={"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=uv(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=uv(r,"src","alt"),o=i[0],s=i[1],a=e.schema.nodes.image;e.addNode(a,Bo({rawHTML:n,imageUrl:o},s&&{altText:s}))}},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)?(lv(i)&&e.openNode(n),lv(o)?e.closeNode():o&&(e.closeNode(),e.openNode(n))):"tableCell"===(null===r||void 0===r?void 0:r.type)&&(i&&(av(i)||sv(e,i))&&e.closeNode(),o&&(av(o)||sv(e,o))&&e.openNode(n))},pre:function(e,t,n){var r,i,o=document.createElement("div");o.innerHTML=t.literal;var s=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(ov(s)),e.closeNode()},"ul, ol":function(e,t,n){if("tableCell"===t.parent.type){var r=e.schema.nodes,i=r.bulletList,o=r.orderedList,s=r.paragraph,a="ul"===n?i:o;n?(t.prev&&!cv(t.prev)&&e.closeNode(),e.openNode(a,{rawHTML:n})):(e.closeNode(),t.next&&!cv(t.next)&&e.openNode(s))}},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,s=i.paragraph;if(n){var a=function(e){var t=e.literal;return{task:/data-task/.test(t),checked:/data-task-checked/.test(t)}}(t);t.prev&&!cv(t.prev)&&e.closeNode(),e.openNode(o,Bo({rawHTML:n},a)),t.next&&!cv(t.next)&&e.openNode(s)}else t.prev&&!cv(t.prev)&&e.closeNode(),e.closeNode()}}},dv=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}(pv);function hv(e){return"htmlInline"===e.type&&$a.test(e.literal)}function fv(e){Qs(e.childNodes).forEach((function(e){if(Qa(e)){var t=e.nodeName.toLowerCase();e.setAttribute("data-raw-html",t),e.childNodes&&fv(e)}}))}var mv={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,s=i.headingType;e.openNode(e.schema.nodes.heading,Bo({level:o,headingType:s},r))}else e.closeNode()},codeBlock:function(e,t,n){var r=e.schema.nodes.codeBlock,i=t,o=i.info,s=i.literal;e.openNode(r,Bo({language:o},n)),e.addText(ov(s||"")),e.closeNode()},list:function(e,t,n,r){if(n.entering){var i=e.schema.nodes,o=i.bulletList,s=i.orderedList,a=t.listData,l=a.type,c=a.start;"bullet"===l?e.openNode(o,r):e.openNode(s,Bo({order:c},r))}else e.closeNode()},item:function(e,t,n,r){var i=n.entering,o=e.schema.nodes.listItem,s=t.listData,a=s.task,l=s.checked;if(i){var c=Bo(Bo(Bo({},a&&{task:a}),l&&{checked:l}),r);e.openNode(o,c)}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,s=e.schema.nodes.image,a=t,l=a.destination,c=a.firstChild;i&&o&&o(),e.addNode(s,Bo(Bo({imageUrl:l},c&&{altText:c.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,s=t,a=s.destination,l=s.title;if(i){var c=Bo({linkUrl:a,title:l},r);e.openMark(o.create(c))}else e.closeMark(o)},softbreak:function(e,t){if("paragraph"===t.parent.type){var n=t.prev,r=t.next;n&&!hv(n)&&e.closeNode(),r&&!hv(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&&(av(t)||sv(e,t))};if(r){var o=e.schema.nodes,s=o.tableHeadCell,a=o.tableBodyCell,l=o.paragraph,c=t.parent.parent,u="tableHead"===c.type?s:a,p=(c.parent.columns[t.startIdx]||{}).align,d=Bo({},t.attrs);p&&(d.align=p),e.openNode(u,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(ov(t.literal||"")),e.closeMark(i)},customBlock:function(e,t){var n=e.schema.nodes,r=n.customBlock,i=n.paragraph,o=t,s=o.info,a=o.literal;e.openNode(r,{info:s}),e.addText(ov(a||"")),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(Ua),i=r[1],o=r[3],s=(i||o).toLowerCase(),a=e.schema.marks[s],l=Of(n);if(null===a||void 0===a?void 0:a.spec.attrs.htmlInline)if(i){var c=Rf(l);e.openMark(a.create({htmlAttrs:c}))}else e.closeMark(a);else{var u=dv[s];u&&u(e,t,i)}},htmlBlock:function(e,t){var n=t.literal,r=document.createElement("div");if(Wa.test(n))e.openNode(e.schema.nodes.htmlComment),e.addText(t.literal),e.closeNode();else{var i=n.match(Ua),o=i[1],s=i[3],a=(o||s).toLowerCase(),l=e.schema.nodes[a],c=Of(n);if(null===l||void 0===l?void 0:l.spec.attrs.htmlBlock){var u=Rf(c),p=If(t,a);e.addNode(l,{htmlAttrs:u,childrenHTML:p})}else r.innerHTML=c,fv(r),e.convertByDOMParser(r)}},customInline:function(e,t,n){var r=n.entering,i=n.skipChildren,o=t,s=o.info,a=o.firstChild,l=e.schema;if(-1!==s.indexOf("widget")&&r){var c=La(t);i(),e.addNode(l.nodes.widget,{info:s},[l.text(Ta(s,c))])}else{var u="$$";r&&(u+=a?s+" ":s),e.addText(u)}}};var gv=function(){function e(e,t){this.schema=e,this.convertors=t,this.stack=[{type:this.schema.topNodeType,attrs:null,content:[]}],this.marks=h.none}return e.prototype.top=function(){return Us(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=Us(t),r=this.schema.text(e,this.marks),i=n&&(s=r,!!((o=n).isText&&s.isText&&h.sameSet(o.marks,s.marks))&&o.withText(o.text+s.text));i?t[t.length-1]=i:t.push(r)}var o,s},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=h.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;Y.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,s=o.convertors[e.type],a=!1;if(s){var l={entering:i,leaf:!ya(e),getChildrenText:ba,options:{gfm:!0,nodeId:!1,tagFilter:!1,softbreak:"\n"},skipChildren:function(){a=!0}};if(o.closeUnmatchedHTMLInline(e,i),s(o,e,l),(null===t||void 0===t?void 0:t.node)===e){var c=o.stack.reduce((function(e,t){return e+t.content.reduce((function(e,t){return e+t.nodeSize}),0)}),0)+1;t.setMappedPos(c)}}a&&(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 vv={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(qs(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 s=0===o,a=!s&&r.child(o-1),l=a&&0===a.childCount,c=o<r.childCount-1&&r.child(o+1),u=c&&"paragraph"===c.type.name,p=0===n.childCount;if(p&&l)e.write("<br>\n");else if(!p||l||s)e.convertInline(n),u?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,s=i,a=s[0],l=s[1];e.write(a),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,Hs(" ",4),(function(){return i+" "}))},orderedList:function(e,t){var n=t.node,r=n.attrs.order||1;e.convertList(n,Hs(" ",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 s=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+Hs("-",Math.max(n,3))+i}(e.textContent,e.attrs.align);s+="| "+t+" "})),e.write(s+"|"),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,s=i,a=s[0],l=s[1];e.write(a),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 yv(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 s=i>0&&t>0?" `":"`",a=0;a<i;a+=1)s+="`";return i>0&&t<0&&(s+=" "),s}function bv(e){return e?["<"+e+">","</"+e+">"]:null}function wv(e){return e?"<"+e+">":null}function kv(e){return e?"</"+e+">":null}var xv={heading:function(e){var t=e.node.attrs,n=t.level,r=Hs("#",n);return"setext"===t.headingType&&(r=1===n?"===":"---"),{delim:r,rawHTML:bv(t.rawHTML)}},codeBlock:function(e){var t=e.node,n=t.attrs,r=t.textContent;return{delim:["```"+(n.language||""),"```"],rawHTML:bv(n.rawHTML),text:r}},blockQuote:function(e){return{delim:"> ",rawHTML:bv(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:bv(i)}},orderedList:function(e,t){var n=e.node,r=t.inTable,i=n.attrs.rawHTML;return r&&(i=i||"ol"),{rawHTML:bv(i)}},listItem:function(e,t){var n=e.node,r=t.inTable,i=n.attrs,o=i.task,s=i.checked,a=n.attrs.rawHTML;return r&&(a=a||"li"),{rawHTML:a?["<"+a+(o?' class="task-list-item'+(s?" checked":"")+'"':"")+(o?" data-task"+(s?" data-task-checked":""):"")+">","</"+a+">"]:null}},table:function(e){return{rawHTML:bv(e.node.attrs.rawHTML)}},tableHead:function(e){return{rawHTML:bv(e.node.attrs.rawHTML)}},tableBody:function(e){return{rawHTML:bv(e.node.attrs.rawHTML)}},tableRow:function(e){return{rawHTML:bv(e.node.attrs.rawHTML)}},tableHeadCell:function(e){return{rawHTML:bv(e.node.attrs.rawHTML)}},tableBodyCell:function(e){return{rawHTML:bv(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="'+Is(r)+'"':"";return{rawHTML:n?"<"+n+' src="'+Is(i)+'"'+o+">":null,attrs:{altText:qs(r||""),imageUrl:i}}},thematicBreak:function(e){return{delim:"***",rawHTML:wv(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,s="**";return n||(s=i?"<strong>":"</strong>"),{delim:s,rawHTML:i?wv(o):kv(o)}},emph:function(e,t,n){var r=e.node,i=t.entering,o=r.attrs.rawHTML,s="*";return n||(s=i?"<em>":"</em>"),{delim:s,rawHTML:i?wv(o):kv(o)}},strike:function(e,t,n){var r=e.node,i=t.entering,o=r.attrs.rawHTML,s="~~";return n||(s=i?"<del>":"</del>"),{delim:s,rawHTML:i?wv(o):kv(o)}},link:function(e,t){var n=e.node,r=t.entering,i=n.attrs,o=i.title,s=i.rawHTML,a=i.linkUrl.replace(/&amp;/g,"&"),l=o?' title="'+Is(o)+'"':"";return r?{delim:"[",rawHTML:s?"<"+s+' href="'+Is(a)+'"'+l+">":null}:{delim:"]("+a+(o?" "+js(qs(o)):"")+")",rawHTML:kv(s)}},code:function(e,t){var n=e.node,r=e.parent,i=e.index,o=void 0===i?0:i,s=t.entering;return{delim:s?yv(r.child(o),-1):yv(r.child(o-1),1),rawHTML:s?wv(n.attrs.rawHTML):kv(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,s="<"+i,a="</"+i+">";return Object.keys(o).forEach((function(e){s+=" "+e+'="'+o[e].replace(/"/g,"'")+'"'})),s+=">",n.attrs.htmlInline?{rawHTML:r?s:a}:{text:""+s+n.attrs.childrenHTML+a}}},Cv={strong:{mixable:!0,removedEnclosingWhitespace:!0},emph:{mixable:!0,removedEnclosingWhitespace:!0},strike:{mixable:!0,removedEnclosingWhitespace:!0},code:{escape:!1},link:null,html:null};function Tv(e){var t={};return Object.keys(vv).forEach((function(n){t[n]=function(t,r){if(vv[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?Qo(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):Qo(e,["image","thematicBreak"])>-1?n.write(o):function(e,t,n){var r=t.node,i=t.parent,o=n[0],s=n[1];e.stopNewline=!0,e.write(o),e.convertNode(r),e.write(s),"doc"===(null===i||void 0===i?void 0:i.type.name)&&(e.closeBlock(r),e.stopNewline=!1)}(n,r,o):vv[e](n,r,i)}(n,{state:t,nodeInfo:r,params:o})}}})),t}function Ev(e){Object.keys(e).forEach((function(t){var n=xv[t],r=e[t];xv[t]=n?function(e,t){return t.origin=function(){return n(e,t)},r(e,t)}:r,delete e[t]}));var t=Tv(xv),n=function(e){var t={};return Object.keys(Cv).forEach((function(n){t[n]=function(t,r,i){var o=Cv[n],s=e[n],a=s&&t&&!Yo(r)?s(t,{entering:r},i):{};return Bo(Bo({},a),o)}})),t}(xv);return{nodeTypeConvertors:t,markTypeConvertors:n}}var Mv=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,s=0===t||(i=null!==(n=o.child(t-1).text)&&void 0!==n?n:"a",/(\S*)\s$/g.test(i)),a=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 s&&a},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)),s=o.delim;return o.rawHTML||s}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?zs(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,s){var a=i?i.marks:[],l=r;r="";var c=i&&i.isText&&a.some((function(e){var n=t.getMarkConvertor(e),r=n&&n();return r&&r.removedEnclosingWhitespace}));if(c&&i&&i.text){var u=/^(\s*)(.*?)(\s*)$/m.exec(i.text),p=u[1],d=u[2],h=u[3];l+=p,r=h,(p||h)&&((i=d?i.withText(d):null)||(a=n))}for(var f=a.length&&Us(a),m=f&&t.getMarkConvertor(f),g=m&&m(),v=g&&!1===g.escape,y=a.length-(v?1:0),b=0;b<y;b+=1){d=a[b];if(g&&!g.mixable)break;for(var w=0;w<n.length;w+=1){var k=n[w];if(g&&!g.mixable)break;if(d.eq(k)){b>w?a=a.slice(0,w).concat(d).concat(a.slice(w,b)).concat(a.slice(b+1,y)):w>b&&(a=a.slice(0,b).concat(a.slice(b+1,w)).concat(d).concat(a.slice(w,y)));break}}}for(var x=0;x<Math.min(n.length,y)&&a[x].eq(n[x]);)x+=1;for(;x<n.length;){var C=n.pop();C&&t.text(t.markText(C,!1,e,s),!1)}if(l&&t.text(l),i){for(;n.length<y;){d=a[n.length];n.push(d),t.text(t.markText(d,!0,e,s),!1)}v&&i.isText?t.text(t.markText(f,!0,e,s)+i.text+t.markText(f,!1,e,s+1),!1):t.convertBlock(i,e,s)}};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,s=this.tightList;this.tightList=o,e.forEach((function(r,s,a){a&&o&&i.flushClose(1),i.wrapBlock(t,n(a),e,(function(){return i.convertBlock(r,e,a)}))})),this.tightList=s},e.prototype.convertTableCell=function(e){var t=this;this.stopNewline=!0,this.inTable=!0,e.forEach((function(n,r,i){Rs(["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 s=n.result.split("\n");t.setMappedPos([s.length,Us(s).length+1])}})),this.result},e}(),Nv=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=Bo({},mv),r=new Ih({gfm:!0,nodeId:!0,convertors:e}).getConvertors();return t.forEach((function(t){var i=mv[t];i&&!Rs(["htmlBlock","htmlInline"],t)&&(n[t]=function(n,o,s){s.origin=function(){return r[t](o,s,r)};var a,l=e[t](o,s);if(l){var c=Array.isArray(l)?l[0]:l;a={htmlAttrs:c.attributes,classNames:c.classNames}}i(n,o,s,a)})})),n}(n),this.toMdConvertors=Ev(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 gv(this.schema,this.toWwConvertors).convertNode(e,this.getInfoForPosSync())},e.prototype.toMarkdownText=function(e){var t=new Mv(this.toMdConvertors).convertNode(e,this.getInfoForPosSync());return t=this.eventEmitter.emitReduce("beforeConvertWysiwygToMarkdown",t)},e}();function Sv(e){var t=e.plugins,n=e.eventEmitter,r=e.usageStatistics,i=e.instance;return n.listen("mixinTableOffsetMapPrototype",ym),(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:yt,Selection:Ze,TextSelection:et},pmView:{Decoration:Zr,DecorationSet:Yr},pmModel:{Fragment:c},pmRules:{InputRule:lo,inputRules:uo,undoInputRule:ho},pmKeymap:{keymap:Fi},i18n:Pm};if(Vo(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 s=o.markdownParsers,a=o.toHTMLRenderers,l=o.toMarkdownRenderers,u=o.markdownPlugins,p=o.wysiwygPlugins,d=o.wysiwygNodeViews,h=o.markdownCommands,f=o.wysiwygCommands,m=o.toolbarItems;return a&&(e.toHTMLRenderers=Ws(e.toHTMLRenderers,a)),l&&(e.toMarkdownRenderers=Ws(e.toMarkdownRenderers,l)),u&&(e.mdPlugins=e.mdPlugins.concat(u)),p&&(e.wwPlugins=e.wwPlugins.concat(p)),d&&(e.wwNodeViews=Bo(Bo({},e.wwNodeViews),d)),h&&(e.mdCommands=Bo(Bo({},e.mdCommands),h)),f&&(e.wwCommands=Bo(Bo({},e.wwCommands),f)),m&&(e.toolbarItems=e.toolbarItems.concat(m)),s&&(e.markdownParsers=Bo(Bo({},e.markdownParsers),s)),e}),{toHTMLRenderers:{},toMarkdownRenderers:{},mdPlugins:[],wwPlugins:[],wwNodeViews:{},mdCommands:{},wwCommands:{},toolbarItems:[],markdownParsers:{}})}var Dv=function(){function e(e){var t=this;this.options=zo({linkAttributes:null,extendedAutolinks:!1,customHTMLRenderer:null,referenceDefinition:!1,customHTMLSanitizer:null,frontMatter:!1,usageStatistics:!0,theme:"light"},e),this.eventEmitter=new rv;var n,r=Fs(this.options.linkAttributes),i=Sv({plugins:this.options.plugins,eventEmitter:this.eventEmitter,usageStatistics:this.options.usageStatistics,instance:this})||{},o=i.toHTMLRenderers,s=i.markdownParsers,a=this.options,l=a.customHTMLRenderer,c=a.extendedAutolinks,u=a.referenceDefinition,p=a.frontMatter,d=a.customHTMLSanitizer,h={linkAttributes:r,customHTMLRenderer:Bo(Bo({},o),l),extendedAutolinks:c,referenceDefinition:u,frontMatter:p,sanitizer:d||Of};n=h.customHTMLRenderer,["htmlBlock","htmlInline"].forEach((function(e){n[e]&&Object.keys(n[e]).forEach((function(e){return Af(e)}))})),this.options.events&&qo(this.options.events,(function(e,n){t.on(n,e)}));var f=this.options,m=f.el,g=f.initialValue,v=f.theme,y=m.innerHTML;"light"!==v&&m.classList.add(Za(v)),m.innerHTML="",this.toastMark=new Mh("",{disallowedHtmlBlockTags:["br","img"],extendedAutolinks:c,referenceDefinition:u,disallowDeepHeading:!0,frontMatter:p,customParser:s}),this.preview=new Yf(this.eventEmitter,Bo(Bo({},h),{isViewer:!0})),yu(this.preview.previewContent,"mousedown",this.toggleTask.bind(this)),g?this.setMarkdown(g):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")&&Ja(n,e.offsetX,e.offsetY)&&(el(t,"checked"),this.eventEmitter.emit("change",{source:"viewer",date:e}))},e.prototype.setMarkdown=function(e){var t=this.toastMark.getLineTexts(),n=[t.length,Us(t).length+1],r=this.toastMark.editMarkdown([1,1],n,e||"");this.eventEmitter.emit("updatePreview",r)},e.prototype.on=function(e,t){this.eventEmitter.listen(e,t)},e.prototype.off=function(e){this.eventEmitter.removeEventHandler(e)},e.prototype.addHook=function(e,t){this.eventEmitter.removeEventHandler(e),this.eventEmitter.listen(e,t)},e.prototype.destroy=function(){hu(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 Lv(e){return e instanceof I}function Av(e){return Rs(["document","blockQuote","bulletList","orderedList","listItem","paragraph","heading","emph","strong","strike","link","image","table","tableHead","tableBody","tableRow","tableHeadCell","tableBodyCell"],e)}var Ov={openTag:function(e,t){var n=e,r=n.tagName,i=n.classNames,o=n.attributes,s=document.createElement(r),a={};i&&(s.className=i.join(" ")),o&&(a=Bo(Bo({},a),o)),ol(a,s),t.push(s)},closeTag:function(e,t){if(t.length>1){var n=t.pop();Us(t).appendChild(n)}},html:function(e,t){Us(t).insertAdjacentHTML("beforeend",e.content)},text:function(e,t){var n=document.createTextNode(e.content);Us(t).appendChild(n)}},Iv=function(){function e(e,t){var n=zf(e,t),r=Bo(Bo({},t.htmlBlock),t.htmlInline);this.customConvertorKeys=Object.keys(t).concat(Object.keys(r)),this.renderer=new Ih({gfm:!0,convertors:Bo(Bo({},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:!Av(n)&&Lv(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=Bo(Bo({},r),i),s=e.attrs,a=s.htmlAttrs,l=s.childrenHTML;return a?Bo(Bo({},o),{attrs:a,childrenHTML:l}):o}(e),n={entering:!0,leaf:!!Lv(e)&&e.isLeaf,options:this.renderer.getOptions(),getChildrenText:function(){return Lv(e)?e.textContent:""},skipChildren:function(){return!1}},r=this.convertors[e.type.name],i=r(t,n,this.convertors),o=Vo(i)?i:[i];return(Av(e.type.name)||e.attrs.htmlInline)&&(n.entering=!1,o.push({type:"text",content:Lv(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 Ov[e.type](e,n)})),n[0]},e.prototype.getToDOMNode=function(e){return Rs(this.customConvertorKeys,e)?this.toDOMNode.bind(this):null},e}(),Rv=15,Pv=null,Bv=null;function Fv(e,t){var n=t.syncScrollTop,r=t.releaseEventBlock;Bv&&clearTimeout(Bv),n(e),Bv=setTimeout((function(){r()}),Rv)}var Hv=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=Jf(this.previewRoot,t).el,i=(Wf(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(),s=o.left,a=o.top,l=n.posAtCoords({left:s,top:a}),c=n.state.doc,u=this.getMdNodeAtPos(c,l);if(u&&!function(e){var t=e.type;return"htmlBlock"===t||"htmlInline"===t}(u)){var p=r.scrollTop,d=n.dom,h=d.scrollTop,f=d.scrollHeight,m=d.clientHeight,g=d.children,v=f-h<=m+18,y=v?r.scrollHeight:0;if(h&&!v){if(e){var b=this.getScrollTopByCaretPos();if(!b)return;y=b}else{var w=Jf(this.previewRoot,u),k=w.el,x=Uf(c,w.mdNode,g),C=x.height,T=x.rect;y=(Wf(k,i)||k.offsetTop)+k.clientHeight*(a>T.top?Math.min((a-T.top)/C,1):0)}y=this.getResolvedScrollTop("editor",h,y,p),this.latestEditorScrollTop=h}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,s=r.dom,a=r.state,l=o.scrollTop,c=o.clientHeight,u=o.scrollHeight-l<=c,p=s.scrollTop,d=u?s.scrollHeight:0;if(l&&e&&!u){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 h=s.children,f=Number(e.getAttribute("data-nodeid")),m=Jf(this.previewRoot,n.findNodeById(f)),g=m.mdNode,v=m.el;d=h[oa(g)-1].offsetTop;var y=Uf(a.doc,g,h).height,b=Xf(v,i,f),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(),o=function(){var s,a=(Date.now()-i)/100;Pv&&clearTimeout(Pv),a<1?(s=e+r*Math.cos((1-a)*Math.PI/2),Fv(Math.ceil(s),n),Pv=setTimeout(o,1)):(Fv(t,n),Pv=null)};o()}(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}(),qv={getPopupInitialValues:function(e,t){return"link"===t.popupName?{linkText:e.getSelectedText()}:{}}};var zv=function(){function e(e){var t=this;this.initialHTML=e.el.innerHTML,e.el.innerHTML="",this.options=zo({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,s=n.frontMatter,a=n.customMarkdownRenderer,l=n.useCommandShortcut,c=n.initialEditType,u=n.widgetRules,p=n.customHTMLSanitizer;this.mode=c||"markdown",this.mdPreviewStyle=this.options.previewStyle,this.i18n=Pm,this.i18n.setCode(this.options.language),this.eventEmitter=new rv,Na(u);var d=Fs(this.options.linkAttributes);this.pluginInfo=Sv({plugins:this.options.plugins,eventEmitter:this.eventEmitter,usageStatistics:this.options.usageStatistics,instance:this});var h,f=this.pluginInfo,m=f.toHTMLRenderers,g=f.toMarkdownRenderers,v=f.mdPlugins,y=f.wwPlugins,b=f.wwNodeViews,w=f.mdCommands,k=f.wwCommands,x=f.markdownParsers,C={linkAttributes:d,customHTMLRenderer:Ws(m,r),extendedAutolinks:i,referenceDefinition:o,frontMatter:s,sanitizer:p||Of},T=new Iv(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";Af(e),r[o][e]=Ff[i](e,t,n)}))})),r}(C.customHTMLRenderer,C.sanitizer,T);this.toastMark=new Mh("",{disallowedHtmlBlockTags:["br","img"],extendedAutolinks:i,referenceDefinition:o,disallowDeepHeading:!0,frontMatter:s,customParser:x}),this.mdEditor=new ou(this.eventEmitter,{toastMark:this.toastMark,useCommandShortcut:l,mdPlugins:v}),this.preview=new Yf(this.eventEmitter,Bo(Bo({},C),{isViewer:!1,highlight:this.options.previewHighlight})),this.wwEditor=new Zg(this.eventEmitter,{toDOMAdaptor:T,useCommandShortcut:l,htmlSchemaMap:E,linkAttributes:d,wwPlugins:y,wwNodeViews:b}),this.convertor=new Nv(this.wwEditor.getSchema(),Bo(Bo({},g),a),zf(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 iv(this.eventEmitter,this.mdEditor.commands,this.wwEditor.commands,(function(){return t.mode})),this.options.usageStatistics&&xs("editor","UA-129966929-1"),this.scrollSync=new Hv(this.mdEditor,this.preview,this.eventEmitter),this.addInitEvent(),this.addInitCommand(w,k),(h=this).eventEmitter.listen("query",(function(e,t){return qv[e](h,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 Dv(t):new e(t)},e.setLanguage=function(e,t){Pm.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(_a,"ig"),r=t.match(n);return null===r||void 0===r||r.forEach((function(e,n){if($a.test(e)){var i=Ga;if(n){var o=r[n-1].match(Va);if(o&&!/br/i.test(o[1])){var s=o[1];i="</"+s+"><"+s+">"}}t=t.replace($a,i)}})),t}(e);var r=Y.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=sl(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;jo(e)&&("auto"===e?us(t,"auto-height"):ms(t,"auto-height"),this.setMinHeight(this.getMinHeight())),Zo(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("."+Za("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()&&gs(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().forEach((function(t,n){return e.off(n)}))},e.prototype.hide=function(){this.eventEmitter.emit("hide")},e.prototype.show=function(){this.eventEmitter.emit("show")},e.prototype.setScrollTop=function(e){this.getCurrentModeEditor().setScrollTop(e)},e.prototype.getScrollTop=function(){return this.getCurrentModeEditor().getScrollTop()},e.prototype.reset=function(){this.wwEditor.setModel([]),this.mdEditor.setMarkdown("")},e.prototype.getSelection=function(){return this.getCurrentModeEditor().getSelection()},e.prototype.setPlaceholder=function(e){this.placeholder=e,this.mdEditor.setPlaceholder(e),this.wwEditor.setPlaceholder(e)},e.prototype.getEditorElements=function(){return{mdEditor:this.mdEditor.getElement(),mdPreview:this.preview.getElement(),wwEditor:this.wwEditor.getElement()}},e.prototype.convertPosToMatchEditorMode=function(e,t,n){var r,i;void 0===t&&(t=e),void 0===n&&(n=this.mode);var o=this.mdEditor.view.state.doc,s=Array.isArray(e),a=Array.isArray(t),l=e,c=t;if(s!==a)throw new Error("Types of arguments must be same");return"markdown"!==n||s||a?"wysiwyg"===n&&s&&a&&(l=(i=Ml(o,e,t))[0],c=i[1]):(l=(r=Tl(o,e,t))[0],c=r[1]),[l,c]},e}();var jv=function(e){return"boolean"===typeof e||e instanceof Boolean},Vv=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}(),_v=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 Vv(this)},e.removalNodes=[],e}();function Uv(e,t){var n,r=e;jv(e)||null==e?r=null:(jo(e)||gs(e))&&(n=String(e),r=new _v("TEXT_NODE",{nodeValue:n},[])),r&&t.push(r)}var $v=function(e){for(var t,n,r=arguments,i=1,o="",s="",a=[0],l=function(e){1===i&&(e||(o=o.replace(/^\s*\n\s*|\s*\n\s*$/g,"")))?a.push(e?r[e]:o):3===i&&(e||o)?(a[1]=e?r[e]:o,i=2):2===i&&"..."===o&&e?a[2]=Ks(a[2]||{},r[e]):2===i&&o&&!e?(a[2]=a[2]||{})[o]=!0:i>=5&&(5===i?((a[2]=a[2]||{})[n]=e?o?o+r[e]:r[e]:o,i=6):(e||o)&&(a[2][n]+=e?o+r[e]:o)),o=""},c=0;c<e.length;c++){c&&(1===i&&l(),l(c));for(let r=0;r<e[c].length;r++)t=e[c][r],1===i?"<"===t?(l(),a=[a,"",null],i=3):o+=t:4===i?"--"===o&&">"===t?(i=1,o=""):o=t+o[0]:s?t===s?s="":o+=t:'"'===t||"'"===t?s=t:">"===t?(l(),i=1):i&&("="===t?(i=5,n=o,o=""):"/"===t&&(i<5||">"===e[c][r+1])?(l(),3===i&&(a=a[0]),i=a,(a=a[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,a=a[0])}return l(),a.length>2?a.slice(1):a[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){Uv(e,i)})):Uv(e,i)})),new _v(e,t||{},i)}));var Wv=function(e){return e===Object(e)};function Gv(e){var t;return"TEXT_NODE"===e.type?t=document.createTextNode(e.props.nodeValue):Xv(t=document.createElement(e.type),{},e.props),t}function Jv(e,t){e.node?t.removeChild(e.node):Jv(e.firstChild,t)}function Kv(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)})),Xv(e,t,n,(function(e){return!_s(t[e],n[e])}))}var Zv=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i;function Xv(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&&Wv(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]=gs(r)&&!Zv.test(t)?r+"px":r}))}(e,t[i],n[i]):"children"!==i&&(!1===n[i]?e.removeAttribute(i):e.setAttribute(i,n[i]))}))}function Qv(e){if(_v.removalNodes.forEach((function(e){return ey(e)})),e)for(var t=void 0,n=e.walker();t=n.walk();)if(e=t.vnode,t.entering)ey(e);else if(vl(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 Yv(e){for(var t=e.parent;!t.node;)t=t.parent;return t.node}function ey(e){if(e&&e.parent){if(e.node){var t=Yv(e);"A"===e.effect?t.appendChild(e.node):"U"===e.effect&&Kv(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(vl(e.type)){var i=e.component;i.beforeDestroy&&i.beforeDestroy()}else{Jv(e,t=Yv(e))}e.ref&&(e.component?e.ref(e.component):e.node&&e.ref(e.node))}}function ty(e,t){var n=t.props,r=t.component;return r?(r.prevProps=r.props,r.props=t.props,r):new e(n)}function ny(e){for(var t=e;e&&!e.skip;){if(vl(e.type)){var n=ty(e.type,e);n.vnode=e,e.component=n,e.props.children=e.children=[n.render()],ry(e)}else e.node||(e.node=Gv(e)),ry(e);if(e.firstChild)e=e.firstChild;else{for(;e&&e.parent&&!e.next&&(e=e.parent)!==t;);e=e.next}}}function ry(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&&(_v.removalNodes.push(n),n.effect="D"),n&&(n=n.next),0===i?e.firstChild=t:t&&(r.next=t),r=t}));var i=Us(t);if(!t.length)for(;n;)_v.removalNodes.push(n),n.effect="D",n=n.next;for(;n&&i;)n&&i.old!==n&&(_v.removalNodes.push(n),n.effect="D",n=n.next)}function iy(e,t){var n=new _v(e.tagName.toLowerCase(),{},[t]);return n.node=e,_v.removalNodes=[],ny(n),Qv(n),function(){return function(e){e.effect="D",_v.removalNodes=[e],Qv(),_v.removalNodes=[]}(n.firstChild)}}var oy,sy=function(){function e(e){this.props=e,this.state={},this.refs={}}return e.prototype.setState=function(e){var t=Bo(Bo({},this.state),e);_s(this.state,t)||(this.state=t,function(e){var t=e.vnode;t.effect="U",t.old=t,t.next&&(t.next.skip=!0),_v.removalNodes=[],ny(t),Qv(t),t.next&&(t.next.skip=!1)}(this))},e}(),ay=function(e){function t(t){var n=e.call(this,t)||this;return n.state={hide:!1},n}return Po(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 $v(oy||(oy=Ho(['\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 "])),Za("mode-switch"),this.state.hide?"none":"block","markdown"===t?" active":"",(function(){n.emit("needChangeMode","markdown")}),Pm.get("Markdown"),"wysiwyg"===t?" active":"",(function(){n.emit("needChangeMode","wysiwyg")}),Pm.get("WYSIWYG"))},t}(sy);var ly=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)}};var cy=function(e,t){var n,r,i,o,s=!0,a=function(t){e.apply(null,t),n=null};function l(){if(o=Array.prototype.slice.call(arguments),s)return a(o),void(s=!1);i=Number(new Date),n=n||i,r(o),i-n>=t&&a(o)}return r=ly(a,t=t||0),l.reset=function(){s=!0,n=null},l},uy=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}()}(),py="undefined"!==typeof window&&"undefined"!==typeof document&&window.document===document,dy="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")(),hy="function"===typeof requestAnimationFrame?requestAnimationFrame.bind(dy):function(e){return setTimeout((function(){return e(Date.now())}),1e3/60)};var fy=["top","right","bottom","left","width","height","size","weight"],my="undefined"!==typeof MutationObserver,gy=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&&a()}function s(){hy(o)}function a(){var e=Date.now();if(n){if(e-i<2)return;r=!0}else n=!0,r=!1,setTimeout(s,t);i=e}return a}(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()}));return e.forEach((function(e){return e.broadcastActive()})),e.length>0},e.prototype.connect_=function(){py&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),my?(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(){py&&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;fy.some((function(e){return!!~n.indexOf(e)}))&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),vy=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},yy=function(e){return e&&e.ownerDocument&&e.ownerDocument.defaultView||dy},by=Ey(0,0,0,0);function wy(e){return parseFloat(e)||0}function ky(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce((function(t,n){return t+wy(e["border-"+n+"-width"])}),0)}function xy(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return by;var r=yy(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]=wy(o)}return t}(r),o=i.left+i.right,s=i.top+i.bottom,a=wy(r.width),l=wy(r.height);if("border-box"===r.boxSizing&&(Math.round(a+o)!==t&&(a-=ky(r,"left","right")+o),Math.round(l+s)!==n&&(l-=ky(r,"top","bottom")+s)),!function(e){return e===yy(e).document.documentElement}(e)){var c=Math.round(a+o)-t,u=Math.round(l+s)-n;1!==Math.abs(c)&&(a-=c),1!==Math.abs(u)&&(l-=u)}return Ey(i.left,i.top,a,l)}var Cy="undefined"!==typeof SVGGraphicsElement?function(e){return e instanceof yy(e).SVGGraphicsElement}:function(e){return e instanceof yy(e).SVGElement&&"function"===typeof e.getBBox};function Ty(e){return py?Cy(e)?function(e){var t=e.getBBox();return Ey(0,0,t.width,t.height)}(e):xy(e):by}function Ey(e,t,n,r){return{x:e,y:t,width:n,height:r}}var My=function(){function e(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Ey(0,0,0,0),this.target=e}return e.prototype.isActive=function(){var e=Ty(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}(),Ny=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,s=Object.create(o.prototype);return vy(s,{x:t,y:n,width:r,height:i,top:n,right:t+r,bottom:i+n,left:t}),s}(t);vy(this,{target:e,contentRect:n})},Sy=function(){function e(e,t,n){if(this.activeObservations_=[],this.observations_=new uy,"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 yy(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new My(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 yy(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 Ny(e.target,e.broadcastRect())}));this.callback_.call(e,t,e),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),Dy="undefined"!==typeof WeakMap?new WeakMap:new uy,Ly=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=gy.getInstance(),r=new Sy(t,n,this);Dy.set(this,r)};["observe","unobserve","disconnect"].forEach((function(e){Ly.prototype[e]=function(){var t;return(t=Dy.get(this))[e].apply(t,arguments)}}));var Ay,Oy,Iy,Ry,Py,By,Fy,Hy,qy,zy,jy,Vy,_y,Uy,$y,Wy,Gy="undefined"!==typeof dy.ResizeObserver?dy.ResizeObserver:Ly,Jy=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Po(t,e),t.prototype.execCommand=function(e){var t=rl(e.target,"li");this.props.execCommand("heading",{level:Number(t.getAttribute("data-level"))})},t.prototype.render=function(){var e=this;return $v(Oy||(Oy=Ho(["\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)}),Pm.get("Headings"),[1,2,3,4,5,6].map((function(e){return $v(Ay||(Ay=Ho(['\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,Pm.get("Heading"),e)})),Pm.get("Paragraph"))},t}(sy),Ky=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Po(t,e),t.prototype.toggleTab=function(e,t){this.props.onClick(e,t)},t.prototype.render=function(){var e=this;return $v(Ry||(Ry=Ho(['\n <div class="','" aria-role="tabpanel">\n ',"\n </div>\n "],['\n <div class="','" aria-role="tabpanel">\n ',"\n </div>\n "])),Za("tabs"),this.props.tabs.map((function(t){var n=t.name,r=t.text,i=e.props.activeTab===n;return $v(Iy||(Iy=Ho(['\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)}),Pm.get(r),i?"true":"false",i?"0":"-1",Pm.get(r))})))},t}(sy),Zy=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="",ms(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 Po(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";ms(e,"wrong"),n.length?n&&this.props.execCommand("addImage",{imageUrl:n,altText:r}):us(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 $v(Py||(Py=Ho(['\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 "],['\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 "])),Pm.get("Insert image"),Ky,this.tabs,n,this.toggleTab,"url"===n?"block":"none",Pm.get("Image URL"),(function(t){return e.refs.url=t}),"file"===n?"block":"none",Pm.get("Select image file"),Za("file-name"),r?" has-file":i,this.showFileSelectBox,this.preventSelectStart,r?r.name:Pm.get("No file"),Za("file-select-button"),this.showFileSelectBox,Pm.get("Choose a file"),this.changeFile,(function(t){return e.refs.file=t}),Pm.get("Description"),(function(t){return e.refs.altText=t}),Za("button-container"),Za("close-button"),this.props.hidePopup,Pm.get("Cancel"),Za("ok-button"),this.execCommand,Pm.get("OK"))},t}(sy),Xy=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;(ms(e,"wrong"),ms(n,"wrong"),e.value.length<1)?us(e,"wrong"):Yo(t.props.initialValues.linkUrl)&&n.value.length<1?us(n,"wrong"):t.props.execCommand("addLink",{linkUrl:e.value,linkText:n.value})},t}return Po(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;ms(r,"wrong"),ms(i,"wrong","disabled"),i.removeAttribute("disabled"),t&&(us(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 $v(By||(By=Ho(['\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 "])),Pm.get("Insert link"),Pm.get("URL"),(function(t){return e.refs.url=t}),Pm.get("Link text"),(function(t){return e.refs.text=t}),Za("button-container"),Za("close-button"),this.props.hidePopup,Pm.get("Cancel"),Za("ok-button"),this.execCommand,Pm.get("OK"))},t}(sy),Qy=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,s=n.getSelectionRangeByOffset(i,o);n.setState(Bo({},s))},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 Po(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=[],s=0;s<t;s+=1){var a=Za("table-cell")+(i>0?"":" header");o.push($v(Fy||(Fy=Ho(['<div class="','"></div>'],['<div class="','"></div>'])),a))}r.push($v(Hy||(Hy=Ho(['<div class="','">',"</div>"],['<div class="','">',"</div>"])),Za("table-row"),o))}return $v(qy||(qy=Ho(['<div class="','">',"</div>"],['<div class="','">',"</div>"])),Za("table"),r)},t.prototype.render=function(){var e=this,t=this.getTableRange(),n=this.getSelectionAreaBound();return $v(zy||(zy=Ho(['\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 "])),Pm.get("Insert table"),Za("table-selection"),(function(t){return e.refs.tableEl=t}),this.extendSelectionRange,this.execCommand,this.createTableArea(t),Za("table-selection-layer"),n,Za("table-description"),this.getDescription())},t}(sy),Yy=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Po(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 $v(jy||(jy=Ho(["<div ref=","></div>"],["<div ref=","></div>"])),(function(t){return e.refs.el=t}))},t}(sy);function eb(e){return jo(e)?function(e){var t;switch(e){case"heading":t={name:"heading",className:"heading",tooltip:Pm.get("Headings"),state:"heading"};break;case"bold":t={name:"bold",className:"bold",command:"bold",tooltip:Pm.get("Bold"),state:"strong"};break;case"italic":t={name:"italic",className:"italic",command:"italic",tooltip:Pm.get("Italic"),state:"emph"};break;case"strike":t={name:"strike",className:"strike",command:"strike",tooltip:Pm.get("Strike"),state:"strike"};break;case"hr":t={name:"hr",className:"hrline",command:"hr",tooltip:Pm.get("Line"),state:"thematicBreak"};break;case"quote":t={name:"quote",className:"quote",command:"blockQuote",tooltip:Pm.get("Blockquote"),state:"blockQuote"};break;case"ul":t={name:"ul",className:"bullet-list",command:"bulletList",tooltip:Pm.get("Unordered list"),state:"bulletList"};break;case"ol":t={name:"ol",className:"ordered-list",command:"orderedList",tooltip:Pm.get("Ordered list"),state:"orderedList"};break;case"task":t={name:"task",className:"task-list",command:"taskList",tooltip:Pm.get("Task"),state:"taskList"};break;case"table":t={name:"table",className:"table",tooltip:Pm.get("Insert table"),state:"table"};break;case"image":t={name:"image",className:"image",tooltip:Pm.get("Insert image")};break;case"link":t={name:"link",className:"link",tooltip:Pm.get("Insert link")};break;case"code":t={name:"code",className:"code",command:"code",tooltip:Pm.get("Code"),state:"code"};break;case"codeblock":t={name:"codeblock",className:"codeblock",command:"codeBlock",tooltip:Pm.get("Insert CodeBlock"),state:"codeBlock"};break;case"indent":t={name:"indent",className:"indent",command:"indent",tooltip:Pm.get("Indent"),state:"indent"};break;case"outdent":t={name:"outdent",className:"outdent",command:"outdent",tooltip:Pm.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?us(e,"active"):ms(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:Pm.get("More")}}"scrollSync"!==t.name&&(t.className+=" "+Za("toolbar-icons"));return t}(e):e}function tb(e,t){var n=t.el,r=t.pos,i=t.popup,o=t.initialValues;switch(e){case"heading":return{render:function(e){return $v(Vy||(Vy=Ho(["<"," ..."," />"],["<"," ..."," />"])),Jy,e)},className:Za("popup-add-heading"),fromEl:n,pos:r};case"link":return{render:function(e){return $v(_y||(_y=Ho(["<"," ..."," />"],["<"," ..."," />"])),Xy,e)},className:Za("popup-add-link"),fromEl:n,pos:r,initialValues:o};case"image":return{render:function(e){return $v(Uy||(Uy=Ho(["<"," ..."," />"],["<"," ..."," />"])),Zy,e)},className:Za("popup-add-image"),fromEl:n,pos:r};case"table":return{render:function(e){return $v($y||($y=Ho(["<"," ..."," />"],["<"," ..."," />"])),Qy,e)},className:Za("popup-add-table"),fromEl:n,pos:r};case"customPopupBody":return i?Bo({render:function(e){return $v(Wy||(Wy=Ho(["<"," ..."," body="," />"],["<"," ..."," body="," />"])),Yy,e,i.body)},fromEl:n,pos:r},i):null;default:return null}}function nb(e){e.hidden=e.length===e.filter((function(e){return e.hidden})).length}function rb(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}(eb(e))})));var r=e[(e.length||1)-1];return r&&nb(r),e}),[])}var ib,ob,sb=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.handleMousedown=function(e){rl(e.target,"."+Za("popup"))||rl(e.target,t.props.info.fromEl)||t.props.hidePopup()},t}return Po(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=Bo({},r.pos),o=this.refs.el.offsetWidth,s=rl(this.refs.el,"."+Za("toolbar")).offsetWidth;i.left+o>=s&&(i.left=s-o-20),_s(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,s=t.execCommand,a=n||{},l=a.className,c=void 0===l?"":l,u=a.style,p=a.render,d=a.initialValues,h=void 0===d?{}:d,f=Bo(Bo({display:r?"block":"none"},u),this.state.popupPos);return $v(ib||(ib=Ho(['\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 "])),Za("popup"),c,f,(function(t){return e.refs.el=t}),Za("popup-body"),p&&p({eventEmitter:o,show:r,hidePopup:i,execCommand:s,initialValues:h}))},t}(sy);function ab(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";Zo(n.props.tooltipRef.current,{display:"block",left:i,top:o}),n.props.tooltipRef.current.querySelector(".text").textContent=t}},n.hideTooltip=function(){Zo(n.props.tooltipRef.current,"display","none")},n.state={active:!1,disabled:e.disabled},n.addEvent(),n}return Po(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,s=i.disabled;e.setState({active:!!o,disabled:null!==s&&void 0!==s?s:e.props.disabled})}))},n.prototype.getBound=function(e){var t=il(e,rl(e,"."+Za("toolbar"))),n=t.offsetLeft,r=t.offsetTop;return{left:n,top:e.offsetHeight+r}},n.prototype.render=function(){return $v(ob||(ob=Ho(["\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}(sy)}var lb,cb,ub,pb,db,hb,fb,mb,gb,vb,yb,bb,wb,kb,xb=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,s=e.eventEmitter,a=n.command,l=n.name,c=n.popup;if(a)r(a);else{var u=c?"customPopupBody":l,p=s.emit("query","getPopupInitialValues",{popupName:u})[0],d=tb(u,{el:t.refs.el,pos:o(t.refs.el),popup:c,initialValues:p});d&&i(d)}},t}return Po(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,nl(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,s=Bo({display:i.hidden?"none":null},i.style),a=(i.className||"")+(o?" active":"");return $v(lb||(lb=Ho(["\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}),s,a,this.execCommand,this.showTooltip,n,!!r,i.text||i.tooltip||"",i.text||"")},t}(sy),Cb=ab(xb),Tb=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=tb("customPopupBody",{el:t.refs.el,pos:t.props.getBound(t.refs.el),popup:t.props.item.popup});e&&t.props.setPopupInfo(e)},t}return Po(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,nl(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 $v(cb||(cb=Ho(["\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,Za("toolbar-item-wrapper"),i(this.showPopup),i(this.showTooltip),i(this.props.hideTooltip))},t}(sy),Eb=ab(Tb),Mb=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Po(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 $v(pb||(pb=Ho(['\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 "])),Za("toolbar-group"),i,n.map((function(t){var n=t.el?Eb:Cb;return $v(ub||(ub=Ho(["<"," key="," ..."," item="," />"],["<"," key="," ..."," item="," />"])),n,t.name,e.props,t)})),Za("toolbar-divider"),o)},t}(sy),Nb=function(e){function t(t){var n=e.call(this,t)||this;return n.handleClickDocument=function(e){var t=e.target;rl(t,"."+Za("dropdown-toolbar"))||rl(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 Po(t,e),t.prototype.getBound=function(){var e=this.props.getBound(this.refs.el);return e.top+=4,Bo(Bo({},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,s=i.item,a=i.items,l=i.hideTooltip,c=a.filter((function(e){return!e.hidden})),u=c.length?null:{display:"none"},p=n?null:{display:"none"};return $v(hb||(hb=Ho(['\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 "])),Za("toolbar-group"),u,(function(t){return e.refs.el=t}),s.className,(function(){return e.setState({showDropdown:!0})}),this.showTooltip,l,o,Za("dropdown-toolbar"),Bo(Bo({},p),r),(function(t){return e.refs.dropdownEl=t}),c.length?c.map((function(t,n){var r;return $v(db||(db=Ho(["\n <","\n group=","\n hiddenDivider=","\n ...","\n />\n "],["\n <","\n group=","\n hiddenDivider=","\n ...","\n />\n "])),Mb,t,n===c.length-1||(null===(r=c[n+1])||void 0===r?void 0:r.hidden),e.props)})):null)},t}(sy),Sb=ab(Nb),Db=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},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("."+Za("toolbar-group")+" ."+e);if(r){var i=il(r,rl(r,"."+Za("toolbar"))),o=i.offsetLeft,s=i.offsetTop,a=tb(e,{el:r,pos:{left:o,top:r.offsetHeight+s},initialValues:t});a&&n.setPopupInfo(a)}},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=rb(t.toolbarItems||[],n.hiddenScrollSync()),n.state={items:n.initialItems,dropdownItems:[],showPopup:!1,popupInfo:{},activeTab:"write"},n.tooltipRef={current:null},n.resizeObserver=new Gy((function(){return n.handleResize()})),n.addEvent(),n}return Po(t,e),t.prototype.insertToolbarItem=function(e,t){var n=e.groupIndex,r=e.itemIndex,i=this.initialItems[n];t=eb(t),i?i.splice(r,0,t):this.initialItems.push([t]),this.setState(this.classifyToolbarItems())},t.prototype.removeToolbarItem=function(e){var t=this;_o(this.initialItems,(function(n){var r=!1;return _o(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=cy((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="'+Za("tooltip")+'" style="display:none">\n <div class="arrow"></div>\n <span class="text"></span>\n </div>';this.tooltipRef.current=tl(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=Us(t);o&&i(o)}},t.prototype.classifyToolbarItems=function(){var e=this,t=0,n=this.refs.el.clientWidth,r=this.refs.el.querySelector("."+Za("toolbar-divider")),i=r?nl(r):0,o=[],s=[],a=!1;return this.initialItems.forEach((function(r,l){var c=[],u=[];r.forEach((function(r,i){r.hidden||((t+=e.itemWidthMap[r.name])>n-50?(a||(e.movePrevItemToDropdownToolbar(i,o,c,u),a=!0),u.push(r)):c.push(r))})),c.length&&(nb(c),o.push(c)),u.length&&(nb(u),s.push(u)),l<e.state.items.length-1&&(t+=i)})),{items:o,dropdownItems:s}},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,s=r.eventEmitter,a=o!==e.previewStyle,l=i!==e.editorType;if(a||l){t=this.initialItems,n=this.hiddenScrollSync(),t.forEach((function(e){e.forEach((function(e){return e.hidden="scrollSync"===e.name&&n})),nb(e)}));var c=this.classifyToolbarItems();(a||"tab"===o&&"markdown"===i)&&(s.emit("changePreviewTabWrite"),c.activeTab="write"),this.setState(c)}},t.prototype.beforeDestroy=function(){window.removeEventListener("resize",this.handleResize),this.resizeObserver.disconnect(),Ya(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,s=o.popupInfo,a=o.showPopup,l=o.activeTab,c=o.items,u=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 $v(mb||(mb=Ho(['\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 "])),Za("toolbar"),Za("md-tab-container"),"wysiwyg"===i||"vertical"===n?"none":"block",Ky,this.tabs,l,this.toggleTab,Za("defaultUI-toolbar"),(function(t){return e.refs.el=t}),d,c.map((function(t,n){var r;return $v(fb||(fb=Ho(["\n <","\n group=","\n hiddenDivider=","\n setItemWidth=","\n ...","\n />\n "],["\n <","\n group=","\n hiddenDivider=","\n setItemWidth=","\n ...","\n />\n "])),Mb,t,n===c.length-1||(null===(r=c[n+1])||void 0===r?void 0:r.hidden),e.setItemWidth,p)})),Sb,eb("more"),u,p,sb,s,a,r,this.hidePopup,this.execCommand)},t}(sy),Lb=function(e){function t(t){var n=e.call(this,t)||this;return n.handleClickDocument=function(e){rl(e.target,"."+Za("context-menu"))||n.setState({pos:null})},n.state={pos:null,menuGroups:[]},n.addEvent(),n}return Po(t,e),t.prototype.addEvent=function(){var e=this;this.props.eventEmitter.listen("contextmenu",(function(t){var n=t.pos,r=t.menuGroups;e.setState({pos:n,menuGroups:r})}))},t.prototype.mounted=function(){document.addEventListener("click",this.handleClickDocument)},t.prototype.beforeDestroy=function(){document.removeEventListener("click",this.handleClickDocument)},t.prototype.getMenuGroupElements=function(){var e=this,t=this.state,n=t.pos,r=t.menuGroups;return n?r.reduce((function(t,n){var r=[];return n.forEach((function(t){var n=t.label,i=t.className,o=void 0!==i&&i,s=t.disabled,a=t.onClick;r.push($v(gb||(gb=Ho(["\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(){s||(a(),e.setState({pos:null}))}),s?" disabled":"",o,n))})),t.push($v(vb||(vb=Ho(['<ul class="menu-group">\n ',"\n </ul>"],['<ul class="menu-group">\n ',"\n </ul>"])),r)),t}),[]):[]},t.prototype.render=function(){var e=Bo({display:this.state.pos?"block":"none"},this.state.pos);return $v(yb||(yb=Ho(['<div class="','" style=',' aria-role="menu">\n ',"\n </div>"],['<div class="','" style=',' aria-role="menu">\n ',"\n </div>"])),Za("context-menu"),e,this.getMenuGroupElements())},t}(sy),Ab=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 Po(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,s=this.state,a=s.hide,l=s.previewStyle,c=s.editorType,u=a?" hidden":"",p=Za("markdown"===c?"md-mode":"ww-mode"),d=Za("md")+"-"+l+"-style",h=Za(["light"!==o,o+" "]);return $v(wb||(wb=Ho(['\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 "])),h,Za("defaultUI"),u,(function(t){return e.refs.el=t}),Db,(function(t){return e.toolbar=t}),n,l,i,c,Za("main"),p,(function(t){return e.refs.editorSection=t}),Za("main-container"),Za("md-container"),d,(function(t){return e.refs.mdContainer=t}),Za("md-splitter"),Za("ww-container"),(function(t){return e.refs.wwContainer=t}),!r&&$v(bb||(bb=Ho(["<"," eventEmitter="," editorType="," />"],["<"," eventEmitter="," editorType="," />"])),ay,n,c),Lb,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}(sy),Ob=function(e){function t(t){var n,r,i=e.call(this,t)||this,o=iy(i.options.el,$v(kb||(kb=Ho(["\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 "])),Ab,(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},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 Po(t,e),t.factory=function(e){return e.viewer?new Dv(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}(zv);zv.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 Ib=n(45610),Rb=n.n(Ib),Pb=function(e,t){return Pb=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])},Pb(e,t)};function Bb(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}Pb(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var Fb=function(){return Fb=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},Fb.apply(this,arguments)},Hb=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.rootEl=i.createRef(),t}return Bb(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 Ob(Fb(Fb({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 i.createElement("div",{ref:this.rootEl})},t}(i.Component),qb=(function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.rootEl=i.createRef(),t}Bb(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;this.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(Rb())(Fb(Fb({el:this.rootEl.current},this.props),{events:this.getInitEvents()}))},t.prototype.shouldComponentUpdate=function(e){return this.bindEventHandlers(e),!1},t.prototype.render=function(){return i.createElement("div",{ref:this.rootEl})}}(i.Component),(0,r.d)("div")({name:"Wrapper",class:"wkyirgj"})),zb=e=>{const[t,n]=(0,i.useState)(e.value.data.markdown),r=(0,i.useCallback)((e=>{e.stopPropagation()}),[]),o=(0,i.useCallback)((()=>{e.onFinishedEditing({...e.value,data:{...e.value.data,markdown:t}})}),[e,t]),s=(0,i.useCallback)((()=>{e.onFinishedEditing(void 0)}),[e]);return(0,i.createElement)(qb,{id:"markdown-wysiwyg",onKeyDown:r},(0,i.createElement)(Hb,{initialEditType:"wysiwyg",autofocus:!0,initialValue:e.value.data.markdown,hideModeSwitch:!0,onChange:n,height:"75vh",usageStatistics:!1,toolbarItems:[["heading","bold","italic","strike"],["hr","quote"],["ul","ol","task","indent","outdent"],["table","link"],["code","codeblock"]]}),(0,i.createElement)("div",{className:"footer"},(0,i.createElement)("button",{className:"close-button",onClick:s},"Close"),(0,i.createElement)("button",{className:"save-button",onClick:o},"Save")))}}}]);