@stlite/desktop 0.47.2 → 0.48.1

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 (42) hide show
  1. package/README.md +1 -1
  2. package/bin/dump_artifacts.js +1 -1
  3. package/build/asset-manifest.json +20 -20
  4. package/build/index.html +1 -1
  5. package/build/static/css/8957.cd5b39ce.chunk.css +1 -0
  6. package/build/static/js/1122.cbaa29b2.chunk.js +1 -0
  7. package/build/static/js/{144.7b870b6f.chunk.js → 144.a72a0130.chunk.js} +1 -1
  8. package/build/static/js/{1740.893c6c48.chunk.js → 1740.f2cc8a49.chunk.js} +1 -1
  9. package/build/static/js/{2448.e6f85eda.chunk.js → 2448.7dff34e3.chunk.js} +1 -1
  10. package/build/static/js/2694.2ef7325a.chunk.js +2 -0
  11. package/build/static/js/4004.725eef9d.chunk.js +1 -0
  12. package/build/static/js/{4021.ec2e87b0.chunk.js → 4021.d0a55d54.chunk.js} +1 -1
  13. package/build/static/js/{4785.f0fa2d5d.chunk.js → 4785.f21e0ace.chunk.js} +1 -1
  14. package/build/static/js/5599.f94de6cb.chunk.js +1 -0
  15. package/build/static/js/5783.26aeaea5.chunk.js +1 -0
  16. package/build/static/js/6134.243d4a10.chunk.js +1 -0
  17. package/build/static/js/7125.0ba671ec.chunk.js +1 -0
  18. package/build/static/js/{7332.b2a91ff6.chunk.js → 7332.71a3c522.chunk.js} +1 -1
  19. package/build/static/js/{8050.029f3dc8.chunk.js → 8050.54afb9d0.chunk.js} +1 -1
  20. package/build/static/js/8957.ff10b5e2.chunk.js +1 -0
  21. package/build/static/js/main.b5316fd2.js +28 -0
  22. package/build/static/js/{main.99099e40.js.LICENSE.txt → main.b5316fd2.js.LICENSE.txt} +23 -25
  23. package/package.json +8 -8
  24. package/wheels/stlite_server-0.1.0-py3-none-any.whl +0 -0
  25. package/wheels/streamlit-1.32.2-cp311-none-any.whl +0 -0
  26. package/build/static/css/9699.7ce51b75.chunk.css +0 -1
  27. package/build/static/js/1122.422f58fc.chunk.js +0 -1
  28. package/build/static/js/2372.844b5190.chunk.js +0 -2
  29. package/build/static/js/4949.391c96be.chunk.js +0 -2
  30. package/build/static/js/4949.391c96be.chunk.js.LICENSE.txt +0 -45
  31. package/build/static/js/6134.20400e9e.chunk.js +0 -1
  32. package/build/static/js/7125.afecc159.chunk.js +0 -1
  33. package/build/static/js/790.4b5acd65.chunk.js +0 -1
  34. package/build/static/js/9699.fd4930f2.chunk.js +0 -1
  35. package/build/static/js/main.99099e40.js +0 -28
  36. package/build/static/media/index.294a0edb7af7d19b781b.cjs +0 -1
  37. package/build/static/media/index.c05687ef19f5bac24939.cjs +0 -1
  38. package/build/static/media/index.cf5b321a6e04bf47c12e.cjs +0 -1
  39. package/build/static/media/index.db61103fb7fdd62b9c44.cjs +0 -1
  40. package/build/static/media/index.f29488c1099d5e3883ac.cjs +0 -1
  41. package/wheels/streamlit-1.31.0-cp311-none-any.whl +0 -0
  42. /package/build/static/js/{2372.844b5190.chunk.js.LICENSE.txt → 2694.2ef7325a.chunk.js.LICENSE.txt} +0 -0
@@ -1,2 +0,0 @@
1
- /*! For license information please see 4949.391c96be.chunk.js.LICENSE.txt */
2
- (globalThis.webpackChunk_stlite_desktop=globalThis.webpackChunk_stlite_desktop||[]).push([[4949],{87878:(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),$=a(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),U="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":U(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=$,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"]),$e=null,Ue=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":U(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,$e="ADD_DATA_URI_TAGS"in e?T(E(Ue),e.ADD_DATA_URI_TAGS):Ue,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":U(a))?e instanceof a:e&&"object"===("undefined"===typeof e?"undefined":U(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:")||!$e[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"===U(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=$(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=$(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 $(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 U="&(?:#x[a-f0-9]{1,6}|#[0-9]{1,7}|[a-z][a-z0-9]{1,31});",W=/[\\&]/,G="[!\"#$%&'()*+,./:;<=>?@[\\\\\\]^_`{|}~-]",J=new RegExp("\\\\"+G+"|"+U,"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 $e(e){return!Object.keys(e).length}var Ue=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("^"+U,"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===Ue||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===Ue||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 Ue: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=/^[*+-]/,$t=/^(\d{1,9})([.)])/;function Ut(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&&!Ut(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&&!Ut(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($t))||"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)||$t.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(!$e(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(!$e(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;$e(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&&!$e(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 $e(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(){$e(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),$n=(a(471),"[A-Za-z][A-Za-z0-9-]*"),Un="(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^\"'=<>`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)",Wn=new RegExp("^(?:<("+$n+")("+Un+")*\\s*/?>|</("+$n+")\\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(Un,"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),$r=a.n(_r),Ur=["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=Ur.reduce((function(t,n){return e(e({},t),{type:n})}),{}),this.hold=!1,Ur.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));$r()(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(3087),n(77915),n(11014),n(28242),n(27407))},3087:(e,t,n)=>{"use strict";e.exports=n.p+"static/media/index.db61103fb7fdd62b9c44.cjs"},77915:(e,t,n)=>{"use strict";e.exports=n.p+"static/media/index.c05687ef19f5bac24939.cjs"},11014:(e,t,n)=>{"use strict";e.exports=n.p+"static/media/index.f29488c1099d5e3883ac.cjs"},28242:(e,t,n)=>{"use strict";e.exports=n.p+"static/media/index.294a0edb7af7d19b781b.cjs"},27407:(e,t,n)=>{"use strict";e.exports=n.p+"static/media/index.cf5b321a6e04bf47c12e.cjs"},54949:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>Wb});var r=n(49270),i=n(5057);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},toObject:function(){var e={};return this.forEach((function(t,n){e[t]=n})),e},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,r=0,i){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)=>{let l=s.isText?s.text.slice(Math.max(e,a)-a,t-a):s.isLeaf?r?"function"===typeof r?r(s):r:s.type.spec.leafText?s.type.spec.leafText(s):"":"";s.isBlock&&(s.isLeaf&&l||s.isTextblock)&&n&&(o?o=!1:i+=n),i+=l}),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,t=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,t=0){return a(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return l(this,e,t,n)}findIndex(e,t=-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 ${e} outside of fragment (${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 ${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,t=!0){let 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){return e.type.checkContent(t),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(e=this,t){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,r=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,r=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(e=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,t=this.content.size){return 0==e&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){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,n=c.empty,r=0,i=n.childCount){let 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(){this.type.checkContent(this.content);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 ${this.type.name}: ${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(e=0,t=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($(e,0));function n(r){let i=[];r.forEach((t=>{e[t].forEach((({term:t,to:n})=>{if(!t)return;let r;for(let e=0;e<i.length;e++)i[e][0]==t&&(r=i[e][1]);$(e,n).forEach((e=>{r||i.push([t,r=[]]),-1==r.indexOf(e)&&r.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,t=0,n=e.childCount){let r=this;for(let i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}get inlineContent(){return 0!=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,t=!1,n=0){let 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 ${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 $(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 U(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=U(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(e=null,t,n){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(e=null,t,n){return t=c.from(t),this.checkContent(t),new I(this,this.computeAttrs(e),t,h.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),(t=c.from(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}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}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=U(this.attrs);this.instance=i?new h(this,i):null}create(e=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);let t=this.spec={};for(let r in e)t[r]=e[r];t.nodes=s.from(e.nodes),t.marks=s.from(e.marks||{}),this.nodes=J.compile(this.spec.nodes,this),this.marks=Z.compile(this.spec.marks,this);let n=Object.create(null);for(let r in this.nodes){if(r in this.marks)throw new RangeError(r+" can not be both a node and a mark");let e=this.nodes[r],t=e.spec.content||"",i=e.spec.marks;e.contentMatch=n[t]||(n[t]=B.parse(t,this.nodes)),e.inlineContent=e.contentMatch.inlineContent,e.markSet="_"==i?null:i?Q(this,i.split(" ")):""!=i&&e.inlineContent?null:[]}for(let r in this.marks){let e=this.marks[r],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,t=null,n,r){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,t={}){let n=new oe(this,t,!1);return n.addAll(e,t.from,t.to),n.finish()}parseSlice(e,t={}){let 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||e.ignore||e.clearMark||(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||e.ignore||e.mark||(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){3==e.nodeType?this.addTextNode(e):1==e.nodeType&&this.addElement(e)}withStyleRules(e,t){let n=e.getAttribute("style");if(!n)return t();let r=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}(n));if(!r)return;let[i,o]=r,s=this.top;for(let a=0;a<o.length;a++)this.removePendingMark(o[a],s);for(let a=0;a<i.length;a++)this.addPendingMark(i[a]);t();for(let a=0;a<i.length;a++)this.removePendingMark(i[a],s);for(let a=0;a<o.length;a++)this.addPendingMark(o[a])}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))n.content.length&&n.content[0].isInline&&this.open&&(this.open--,n=this.top),t=!0,n.type||(this.needsBlock=!0);else if(!e.firstChild)return void this.leafFallback(e);i&&i.skip?this.addAll(e):this.withStyleRules(e,(()=>this.addAll(e))),t&&this.sync(n),this.needsBlock=o}else this.withStyleRules(e,(()=>{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,n=h.none;for(let r=0;r<e.length;r+=2)for(let i;;){let o=this.parser.matchStyle(e[r],e[r+1],this,i);if(!o)break;if(o.ignore)return null;if(o.clearMark?this.top.pendingMarks.concat(this.top.activeMarks).forEach((e=>{o.clearMark(e)&&(n=e.addToSet(n))})):t=this.parser.schema.marks[o.mark].create(o.attrs).addToSet(t),!1!==o.consuming)break;i=o}return[t,n]}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,t=null,n=!1,r){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(e=!1){let 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,t={},n){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,t={}){let 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,n={}){let r=this.marks[e.type.name];return r&&ce.renderSpec(pe(n),r(e,t))}static renderSpec(e,t,n=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,t=!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,t=1){return this._map(e,t,!1)}map(e,t=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(e=[],t,n=0,r=e.length){this.maps=e,this.mirror=t,this.from=n,this.to=r}slice(e=0,t=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,t=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,t=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 ${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,r=!1){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,s=!1){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,n=1,r){let 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+1];o&&(n=n.replaceChild(0,o.type.create(o.attrs)));let s=r&&r[u]||e;if(!e.canReplace(t+1,e.childCount)||!s.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,n=t,r=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(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,n=0,r=this.unplaced.openEnd;n<e;n++){let i=t.firstChild;if(t.childCount>1&&(r=0),i.type.spec.isolating&&r<=n){e=n;break}t=i.content}for(let t=1;t<=2;t++)for(let n=1==t?e:this.unplaced.openStart;n>=0;n--){let e,r=null;n?(r=ze(this.unplaced.content,n-1).firstChild,e=r.content):e=this.unplaced.content;let i=e.firstChild;for(let o=this.depth;o>=0;o--){let e,{type:s,match:a}=this.frontier[o],l=null;if(1==t&&(i?a.matchType(i.type)||(l=a.fillBefore(c.from(i),!1)):r&&s.compatibleContent(r.type)))return{sliceDepth:n,frontierDepth:o,parent:r,inject:l};if(2==t&&i&&(e=a.findWrapping(i.type)))return{sliceDepth:n,frontierDepth:o,parent:r,wrap:e};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({sliceDepth:e,frontierDepth:t,parent:n,inject:r,wrap:i}){for(;this.depth>t;)this.closeFrontierNode();if(i)for(let c=0;c<i.length;c++)this.openFrontierNode(i[c]);let o=this.unplaced,s=n?n.content:o.content,a=o.openStart-e,l=0,u=[],{match:p,type:d}=this.frontier[t];if(r){for(let e=0;e<r.childCount;e++)u.push(r.child(e));p=p.matchFragment(r)}let h=s.size+e-(o.content.size-o.openEnd);for(;l<s.childCount;){let e=s.child(l),t=p.matchType(e.type);if(!t)break;l++,(l>1||0==a||e.content.size)&&(p=t,u.push(je(e.mark(d.allowedMarks(e.marks)),1==l?a:0,l==s.childCount?h:-1)))}let f=l==s.childCount;f||(h=-1),this.placed=qe(this.placed,t,c.from(u)),this.frontier[t].match=p,f&&h<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let c=0,m=s;c<h;c++){let e=m.lastChild;this.frontier.push({type:e.type,match:e.contentMatchAt(e.childCount)}),m=e.content}this.unplaced=f?0==e?m.empty:new m(He(o.content,e-1,1),e-1,h<0?o.openEnd:e-1):new m(He(o.content,e,l),o.openStart,o.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,t=null,n){let 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,t,n,r,i){if(t<n){let i=e.firstChild;e=e.replaceChild(0,i.copy(_e(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 Ue 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 Ue(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 Ue(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 Ue(t.pos,t.attr,t.value)}}be.jsonID("attr",Ue);class We extends be{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let r in e.attrs)t[r]=e.attrs[r];t[this.attr]=this.value;let n=e.type.create(t,e.content,e.marks);return we.ok(n)}getMap(){return ge.empty}invert(e){return new We(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if("string"!=typeof t.attr)throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new We(t.attr,t.value)}}be.jsonID("docAttr",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,t=e,n=m.empty){let 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 h=i.depth,f=i.pos-1;h>0;h--,f--){let e=i.node(h).type.spec;if(e.defining||e.definingAsContext||e.isolating)break;s.indexOf(h)>-1?a=h:i.before(h)==f&&s.splice(1,0,-h)}let l=s.indexOf(a),c=[],u=r.openStart;for(let h=r.content,f=0;;f++){let e=h.firstChild;if(c.push(e),f==r.openStart)break;h=e.content}for(let h=u-1;h>=0;h--){let e=c[h],t=(p=e.type).spec.defining||p.spec.definingForContent;if(t&&!e.sameMarkup(i.node(Math.abs(a)-1)))u=h;else if(t||!e.type.isTextblock)break}var p;for(let h=r.openStart;h>=0;h--){let t=(h+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(_e(r.content,0,r.openStart,t),t,r.openEnd))}}let d=e.steps.length;for(let h=s.length-1;h>=0&&(e.replace(t,n,r),!(e.steps.length>d));h--){let e=s[h];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,t=1){return function(e,t,n){let r=new Me(t-n,t+n,m.empty,!0);e.step(r)}(this,e,t),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,t=e,n,r=null){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,t,n,r),this}setNodeMarkup(e,t,n=null,r){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,n,r),this}setNodeAttribute(e,t,n){return this.step(new Ue(e,t,n)),this}setDocAttribute(e,t){return this.step(new We(e,t)),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,t=1,n){return function(e,t,n=1,r){let 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,t,n),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,r=n.contentMatch){let 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,u=r.matchType(t.type);if(u){r=u;for(let r=0;r<t.marks.length;r++)n.allowsMarkType(t.marks[r].type)||e.step(new Ce(s,l,t.marks[r]));if(t.isText&&!n.spec.code){let e,r,i=/\r?\n|\r/g;for(;e=i.exec(t.text);)r||(r=new m(c.from(n.schema.text(" ",n.allowedMarks(t.marks))),0,0)),o.push(new Me(s+e.index,s+e.index+e[0].length,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,t=m.empty){let 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,n=!1){let 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,t=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 ${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,t=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,t=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,n=t){let 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,t=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,o=!1){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,t=!0){let 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,t=-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(e="key"){this.key=vt(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const bt=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},wt=function(e){let t=e.assignedSlot||e.parentNode;return t&&11==t.nodeType?t.host:t};let kt=null;const xt=function(e,t,n){let r=kt||(kt=document.createRange());return r.setEnd(e,null==n?e.nodeValue.length:n),r.setStart(e,t||0),r},Ct=function(e,t,n,r){return n&&(Et(e,t,n,r,-1)||Et(e,t,n,r,1))},Tt=/^(img|br|input|textarea|hr)$/i;function Et(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:Mt(e))){let n=e.parentNode;if(!n||1!=n.nodeType||Nt(e)||Tt.test(e.nodeName)||"false"==e.contentEditable)return!1;t=bt(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?Mt(e):0}}}function Mt(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function Nt(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 St=function(e){return e.focusNode&&Ct(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function Dt(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}const Lt="undefined"!=typeof navigator?navigator:null,At="undefined"!=typeof document?document:null,Ot=Lt&&Lt.userAgent||"",It=/Edge\/(\d+)/.exec(Ot),Rt=/MSIE \d/.exec(Ot),Pt=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Ot),Bt=!!(Rt||Pt||It),Ft=Rt?document.documentMode:Pt?+Pt[1]:It?+It[1]:0,Ht=!Bt&&/gecko\/(\d+)/i.test(Ot);Ht&&(/Firefox\/(\d+)/.exec(Ot)||[0,0])[1];const qt=!Bt&&/Chrome\/(\d+)/.exec(Ot),zt=!!qt,jt=qt?+qt[1]:0,Vt=!Bt&&!!Lt&&/Apple Computer/.test(Lt.vendor),_t=Vt&&(/Mobile\/\w+/.test(Ot)||!!Lt&&Lt.maxTouchPoints>2),$t=_t||!!Lt&&/Mac/.test(Lt.platform),Ut=!!Lt&&/Win/.test(Lt.platform),Wt=/Android \d/.test(Ot),Gt=!!At&&"webkitFontSmoothing"in At.documentElement.style,Jt=Gt?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function Kt(e){return{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function Zt(e,t){return"number"==typeof e?e:e[t]}function Xt(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 Qt(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=wt(s)){if(1!=s.nodeType)continue;let e=s,n=e==o.body,a=n?Kt(o):Xt(e),l=0,c=0;if(t.top<a.top+Zt(r,"top")?c=-(a.top-t.top+Zt(i,"top")):t.bottom>a.bottom-Zt(r,"bottom")&&(c=t.bottom-t.top>a.bottom-a.top?t.top+Zt(i,"top")-a.top:t.bottom-a.bottom+Zt(i,"bottom")),t.left<a.left+Zt(r,"left")?l=-(a.left-t.left+Zt(i,"left")):t.right>a.right-Zt(r,"right")&&(l=t.right-a.right+Zt(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||/^(fixed|sticky)$/.test(getComputedStyle(s).position))break}}function Yt(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=wt(r));return t}function en(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 tn=null;function nn(e,t){let n,r,i,o,s=2e8,a=0,l=t.top,c=t.top;for(let u=e.firstChild,p=0;u;u=u.nextSibling,p++){let e;if(1==u.nodeType)e=u.getClientRects();else{if(3!=u.nodeType)continue;e=xt(u).getClientRects()}for(let d=0;d<e.length;d++){let h=e[d];if(h.top<=l&&h.bottom>=c){l=Math.max(h.bottom,l),c=Math.min(h.top,c);let e=h.left>t.left?h.left-t.left:h.right<t.left?t.left-h.right:0;if(e<s){n=u,s=e,r=e&&3==n.nodeType?{left:h.right<t.left?h.right:h.left,top:t.top}:t,1==u.nodeType&&e&&(a=p+(t.left>=(h.left+h.right)/2?1:0));continue}}else h.top>t.top&&!i&&h.left<=t.left&&h.right>=t.left&&(i=u,o={left:Math.max(h.left,Math.min(h.right,t.left)),top:h.top});!n&&(t.left>=h.right&&t.top>=h.top||t.left>=h.left&&t.top>=h.bottom)&&(a=p+1)}}return!n&&i&&(n=i,r=o,s=0),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=ln(r,1);if(n.top!=n.bottom&&rn(t,n))return{node:e,offset:i+(t.left>=(n.left+n.right)/2?1:0)}}return{node:e,offset:0}}(n,r):!n||s&&1==n.nodeType?{node:e,offset:a}:nn(n,r)}function rn(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function on(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(rn(t,i))return on(n,t,i)}}if((o=(o+1)%r)==i)break}return e}function sn(e,t){let n,r=e.dom.ownerDocument,i=0,o=function(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:r.offset}}catch(r){}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:r.startOffset}}}(r,t.left,t.top);o&&({node:n,offset:i}=o);let s,a=(e.root.elementFromPoint?e.root:r).elementFromPoint(t.left,t.top);if(!a||!e.dom.contains(1!=a.nodeType?a.parentNode:a)){let n=e.dom.getBoundingClientRect();if(!rn(t,n))return null;if(a=on(e.dom,t,n),!a)return null}if(Vt)for(let c=a;n&&c;c=wt(c))c.draggable&&(n=void 0);if(a=function(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}(a,t),n){if(Ht&&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++}let r;Gt&&i&&1==n.nodeType&&1==(r=n.childNodes[i-1]).nodeType&&"false"==r.contentEditable&&r.getBoundingClientRect().top>=t.top&&i--,n==e.dom&&i==n.childNodes.length-1&&1==n.lastChild.nodeType&&t.top>n.lastChild.getBoundingClientRect().bottom?s=e.state.doc.content.size:0!=i&&1==n.nodeType&&"BR"==n.childNodes[i-1].nodeName||(s=function(e,t,n,r){let i=-1;for(let o=t,s=!1;o!=e.dom;){let t=e.docView.nearestDesc(o,!0);if(!t)return null;if(1==t.dom.nodeType&&(t.node.isBlock&&t.parent&&!s||!t.contentDOM)){let e=t.dom.getBoundingClientRect();if(t.node.isBlock&&t.parent&&!s&&(s=!0,e.left>r.left||e.top>r.top?i=t.posBefore:(e.right<r.left||e.bottom<r.top)&&(i=t.posAfter)),!t.contentDOM&&i<0&&!t.node.isText)return(t.node.isBlock?r.top<(e.top+e.bottom)/2:r.left<(e.left+e.right)/2)?t.posBefore:t.posAfter}o=t.dom.parentNode}return i>-1?i:e.docView.posFromDOM(t,n,-1)}(e,n,i,t))}null==s&&(s=function(e,t,n){let{node:r,offset:i}=nn(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,a,t));let l=e.docView.nearestDesc(a,!0);return{pos:s,inside:l?l.posAtStart-l.border:-1}}function an(e){return e.top<e.bottom||e.left<e.right}function ln(e,t){let n=e.getClientRects();if(n.length){let e=n[t<0?0:n.length-1];if(an(e))return e}return Array.prototype.find.call(n,an)||e.getBoundingClientRect()}const cn=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function un(e,t,n){let{node:r,offset:i,atom:o}=e.docView.domFromPos(t,n<0?-1:1),s=Gt||Ht;if(3==r.nodeType){if(!s||!cn.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++,pn(ln(xt(r,e,t),o),o<0)}{let e=ln(xt(r,i,i),n);if(Ht&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let t=ln(xt(r,i-1,i-1),-1);if(t.top==e.top){let n=ln(xt(r,i,i+1),-1);if(n.top!=e.top)return pn(n,n.left<t.left)}}return e}}if(!e.state.doc.resolve(t-(o||0)).parent.inlineContent){if(null==o&&i&&(n<0||i==Mt(r))){let e=r.childNodes[i-1];if(1==e.nodeType)return dn(e.getBoundingClientRect(),!1)}if(null==o&&i<Mt(r)){let e=r.childNodes[i];if(1==e.nodeType)return dn(e.getBoundingClientRect(),!0)}return dn(r.getBoundingClientRect(),n>=0)}if(null==o&&i&&(n<0||i==Mt(r))){let e=r.childNodes[i-1],t=3==e.nodeType?xt(e,Mt(e)-(s?0:1)):1!=e.nodeType||"BR"==e.nodeName&&e.nextSibling?null:e;if(t)return pn(ln(t,1),!1)}if(null==o&&i<Mt(r)){let e=r.childNodes[i];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?3==e.nodeType?xt(e,0,s?0:1):1==e.nodeType?e:null:null;if(t)return pn(ln(t,-1),!0)}return pn(ln(3==r.nodeType?xt(r):r,-n),n>=0)}function pn(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 dn(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 hn(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 fn=/[\u0590-\u08ac]/;let mn=null,gn=null,vn=!1;function yn(e,t,n){return mn==t&&gn==n?vn:(mn=t,gn=n,vn="up"==n||"down"==n?function(e,t,n){let r=t.selection,i="up"==n?r.$from:r.$to;return hn(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.contentDOM||n.dom;break}t=n.dom.parentNode}let r=un(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=xt(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 fn.test(r.parent.textContent)&&a.modify?hn(e,t,(()=>{let{focusNode:t,focusOffset:i,anchorNode:o,anchorOffset:s}=e.domSelectionRange(),l=a.caretBidiLevel;a.modify("move",n,"character");let c=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:u,focusOffset:p}=e.domSelectionRange(),d=u&&!c.contains(1==u.nodeType?u:u.parentNode)||t==u&&i==p;try{a.collapse(o,s),t&&(t!=o||i!=s)&&a.extend&&a.extend(t,i)}catch(h){}return null!=l&&(a.caretBidiLevel=l),d})):"left"==n||"backward"==n?o:s}(e,t,n))}class bn{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>bt(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,t=!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 Mn){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 wn&&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?bt(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?bt(e.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,n=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=bt(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=bt(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,r=!1){let 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((Ht||Vt)&&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:bt(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(Ht&&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&&Vt)&&Ct(s.node,s.offset,l.anchorNode,l.anchorOffset)&&Ct(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(!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 wn extends bn{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 kn extends bn{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 xn extends bn{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 xn(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}}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=xn.create(this.parent,this.mark,!0,n),i=this.children,o=this.size;t<o&&(i=qn(i,t,o,n)),e>0&&(i=qn(i,0,e,n));for(let s=0;s<i.length;s++)i[s].parent=r;return r.children=i,r}}class Cn extends bn{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}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=Rn(c,n,t),l?s=new Nn(e,t,n,r,c,u||null,p,l,i,o+1):t.isText?new En(e,t,n,r,c,p,i):new Cn(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)&&Pn(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 Fn(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;;){let u,p,d,h;for(;s<i.length&&i[s].to==o;){let e=i[s++];e.widget&&(u?(p||(p=[u])).push(e):u=e)}if(u)if(p){p.sort(Hn);for(let e=0;e<p.length;e++)n(p[e],c,!!l)}else n(u,c,!!l);if(l)h=-1,d=l,l=null;else{if(!(c<e.childCount))break;h=c,d=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 f=o+d.nodeSize;if(d.isText){let e=f;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<f&&(l=d.cut(e-o),d=d.cut(0,e-o),f=e,h=-1)}else for(;s<i.length&&i[s].to<f;)s++;r(d,d.isInline&&!d.isLeaf?a.filter((e=>!e.inline)):a.slice(),t.forChild(o,d),h),o=f}}(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,r)||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),Sn(this.contentDOM,this.children,e),_t&&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.domSelectionRange(),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=Mt(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){if(o>=r&&l.slice(r-t.length-a,r-a)==t)return r-t.length;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,{node:t,pos:n,text:r}){if(this.getDesc(t))return;let i=t;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let o=new kn(this,i,t,r);e.input.compositionNodes.push(o),this.children=qn(this.children,n,n+r.length,e,o)}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(Pn(e,this.outerDeco))return;let t=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=On(this.dom,this.nodeDOM,An(this.outerDeco,this.node,t),An(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 Tn(e,t,n,r,i){Rn(r,t,e);let o=new Cn(void 0,e,t,n,r,r,r,i,0);return o.contentDOM&&o.updateChildren(i,0),o}class En extends Cn{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 En(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 Mn extends bn{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 Nn extends Cn{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 Sn(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=Bn(r),i=!0;r=r.nextSibling}else i=!0,e.insertBefore(a,r);if(s instanceof xn){let t=r?r.previousSibling:e.lastChild;Sn(s.contentDOM,s.children,n),r=t?t.nextSibling:e.firstChild}}for(;r;)r=Bn(r),i=!0;i&&n.trackWrites==e&&(n.trackWrites=null)}const Dn=function(e){e&&(this.nodeName=e)};Dn.prototype=Object.create(null);const Ln=[new Dn];function An(e,t,n){if(0==e.length)return Ln;let r=n?Ln[0]:new Dn,i=[r];for(let o=0;o<e.length;o++){let s=e[o].type.attrs;if(s){s.nodeName&&i.push(r=new Dn(s.nodeName));for(let e in s){let o=s[e];null!=o&&(n&&1==i.length&&i.push(r=new Dn(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 On(e,t,n,r){if(n==Ln&&r==Ln)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=Ln[0]),i=n}In(i,s||Ln[0],t)}return i}function In(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 Rn(e,t,n){return On(e,e,Ln,An(t,n,1!=e.nodeType))}function Pn(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 Bn(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class Fn{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 xn)){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++){let n=this.top.children[t];if(n.matchesMark(e[i])&&!this.isLocked(n.dom)){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=xn.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,o){for(let s=this.index;s<this.top.children.length;s++){let a=this.top.children[s];if(a instanceof Cn){let l=this.preMatch.matched.get(a);if(null!=l&&l!=i)return!1;let c,u=a.dom,p=this.isLocked(u)&&!(e.isText&&a.node&&a.node.isText&&a.nodeDOM.nodeValue==e.text&&3!=a.dirty&&Pn(t,a.outerDeco));if(!p&&a.update(e,t,n,r))return this.destroyBetween(this.index,s),a.dom!=u&&(this.changed=!0),this.index++,!0;if(!p&&(c=this.recreateWrapper(a,e,t,n,r,o)))return this.top.children[this.index]=c,c.contentDOM&&(c.dirty=2,c.updateChildren(r,o+1),c.dirty=0),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,n,r,i,o){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content))return null;let s=Cn.create(this.top,t,n,r,i,o);if(s.contentDOM){s.children=e.children,e.children=[];for(let e of s.children)e.parent=s}return e.destroy(),s}addNode(e,t,n,r,i){let o=Cn.create(this.top,e,t,n,r,i);o.contentDOM&&o.updateChildren(r,i+1),this.top.children.splice(this.index++,0,o),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 wn(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 xn;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof En)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((Vt||zt)&&e&&"false"==e.dom.contentEditable&&this.addHackNode("IMG",t),this.addHackNode("BR",this.top))}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 Mn(this.top,[],n,null);t!=this.top?t.children.push(r):t.children.splice(this.index++,0,r),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||1==e.nodeType&&e.contains(this.lock.parentNode))}}function Hn(e,t){return e.type.side-t.type.side}function qn(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 zn(e,t=null){let n=e.domSelectionRange(),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(St(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==Mt(e);r||i;){if(e==n)return!0;let t=bt(e);if(!(e=e.parentNode))return!1;r=r&&0==t,i=i&&t==Mt(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=Kn(e,a,c,"pointer"==t||e.state.selection.head<c.pos&&!o?1:-1)}return l}function jn(e){return e.editable?e.hasFocus():Xn(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function Vn(e,t=!1){let n=e.state.selection;if(Gn(e,n),jn(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&zt){let t=e.domSelectionRange(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&Ct(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,bt(r)+1):n.setEnd(r,0);n.collapse(!1),t.removeAllRanges(),t.addRange(n),!i&&!e.state.selection.visible&&Bt&&Ft<=11&&(r.disabled=!0,r.disabled=!1)}(e);else{let r,i,{anchor:o,head:s}=n;!_n||n instanceof et||(n.$from.parent.inlineContent||(r=$n(e,n.from)),n.empty||n.$from.parent.inlineContent||(i=$n(e,n.to))),e.docView.setSelection(o,s,e.root,t),_n&&(r&&Wn(r),i&&Wn(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.domSelectionRange(),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((()=>{jn(e)&&!e.state.selection.visible||e.dom.classList.remove("ProseMirror-hideselection")}),20))})}(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}const _n=Vt||zt&&jt<63;function $n(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(Vt&&i&&"false"==i.contentEditable)return Un(i);if((!i||"false"==i.contentEditable)&&(!o||"false"==o.contentEditable)){if(i)return Un(i);if(o)return Un(o)}}function Un(e){return e.contentEditable="true",Vt&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function Wn(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function Gn(e,t){if(t instanceof nt){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(Jn(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else Jn(e)}function Jn(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function Kn(e,t,n,r){return e.someProp("createSelectionBetween",(r=>r(e,t,n)))||et.between(t,n,r)}function Zn(e){return!(e.editable&&!e.hasFocus())&&Xn(e)}function Xn(e){let t=e.domSelectionRange();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 Qn(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 Yn(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function er(e,t,n){let r=e.state.selection;if(!(r instanceof et)){if(r instanceof nt&&r.node.isInline)return Yn(e,new et(t>0?r.$to:r.$from));{let n=Qn(e.state,t);return!!n&&Yn(e,n)}}if(n.indexOf("s")>-1){let{$head:n}=r,i=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let o=e.state.doc.resolve(n.pos+i.nodeSize*(t<0?-1:1));return Yn(e,new et(r.$anchor,o))}if(!r.empty)return!1;if(e.endOfTextblock(t>0?"forward":"backward")){let n=Qn(e.state,t);return!!(n&&n instanceof nt)&&Yn(e,n)}if(!($t&&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)?Yn(e,new nt(t<0?e.state.doc.resolve(i.pos-o.nodeSize):i)):!!Gt&&Yn(e,new et(e.state.doc.resolve(t<0?s:s+o.nodeSize))))}}function tr(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function nr(e,t){let n=e.pmViewDesc;return n&&0==n.size&&(t<0||e.nextSibling||"BR"!=e.nodeName)}function rr(e,t){return t<0?function(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,o,s=!1;Ht&&1==n.nodeType&&r<tr(n)&&nr(n.childNodes[r],-1)&&(s=!0);for(;;)if(r>0){if(1!=n.nodeType)break;{let e=n.childNodes[r-1];if(nr(e,-1))i=n,o=--r;else{if(3!=e.nodeType)break;n=e,r=n.nodeValue.length}}}else{if(ir(n))break;{let t=n.previousSibling;for(;t&&nr(t,-1);)i=n.parentNode,o=bt(t),t=t.previousSibling;if(t)n=t,r=tr(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}}s?or(e,n,r):i&&or(e,i,o)}(e):function(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,o,s=tr(n);for(;;)if(r<s){if(1!=n.nodeType)break;if(!nr(n.childNodes[r],1))break;i=n,o=++r}else{if(ir(n))break;{let t=n.nextSibling;for(;t&&nr(t,1);)i=t.parentNode,o=bt(t)+1,t=t.nextSibling;if(t)n=t,r=0,s=tr(n);else{if(n=n.parentNode,n==e.dom)break;r=s=0}}}i&&or(e,i,o)}(e)}function ir(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function or(e,t,n){if(3!=t.nodeType){let e,r;(r=function(e,t){for(;e&&t==e.childNodes.length&&!Nt(e);)t=bt(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(3==n.nodeType)return n;if(1==n.nodeType&&"false"==n.contentEditable)break;e=n,t=0}}(t,n))?(t=r,n=0):(e=function(e,t){for(;e&&!t&&!Nt(e);)t=bt(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(3==n.nodeType)return n;if(1==n.nodeType&&"false"==n.contentEditable)break;t=(e=n).childNodes.length}}(t,n))&&(t=e,n=e.nodeValue.length)}let r=e.domSelection();if(St(r)){let e=document.createRange();e.setEnd(t,n),e.setStart(t,n),r.removeAllRanges(),r.addRange(e)}else r.extend&&r.extend(t,n);e.domObserver.setCurSelection();let{state:i}=e;setTimeout((()=>{e.state==i&&Vn(e)}),50)}function sr(e,t){let n=e.state.doc.resolve(t);if(!zt&&!Ut&&n.parent.inlineContent){let r=e.coordsAtPos(t);if(t>n.start()){let n=e.coordsAtPos(t-1),i=(n.top+n.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(n.left-r.left)>1)return n.left<r.left?"ltr":"rtl"}if(t<n.end()){let n=e.coordsAtPos(t+1),i=(n.top+n.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(n.left-r.left)>1)return n.left>r.left?"ltr":"rtl"}}return"rtl"==getComputedStyle(e.dom).direction?"rtl":"ltr"}function ar(e,t,n){let r=e.state.selection;if(r instanceof et&&!r.empty||n.indexOf("s")>-1)return!1;if($t&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let n=Qn(e.state,t);if(n&&n instanceof nt)return Yn(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&&Yn(e,s)}return!1}function lr(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 cr(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function ur(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);if(8==n||$t&&72==n&&"c"==r)return lr(e,-1)||rr(e,-1);if(46==n&&!t.shiftKey||$t&&68==n&&"c"==r)return lr(e,1)||rr(e,1);if(13==n||27==n)return!0;if(37==n||$t&&66==n&&"c"==r){let t=37==n?"ltr"==sr(e,e.state.selection.from)?-1:1:-1;return er(e,t,r)||rr(e,t)}if(39==n||$t&&70==n&&"c"==r){let t=39==n?"ltr"==sr(e,e.state.selection.from)?1:-1:1;return er(e,t,r)||rr(e,t)}return 38==n||$t&&80==n&&"c"==r?ar(e,-1,r)||rr(e,-1):40==n||$t&&78==n&&"c"==r?function(e){if(!Vt||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&1==t.nodeType&&0==n&&t.firstChild&&"false"==t.firstChild.contentEditable){let n=t.firstChild;cr(e,n,"true"),setTimeout((()=>cr(e,n,"false")),20)}return!1}(e)||ar(e,1,r)||rr(e,1):r==($t?"m":"c")&&(66==n||73==n||89==n||90==n)}function pr(e,t){e.someProp("transformCopied",(n=>{t=n(t,e)}));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=kr(),l=a.createElement("div");l.appendChild(s.serializeFragment(r,{document:a}));let c,u=l.firstChild,p=0;for(;u&&1==u.nodeType&&(c=br[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",`${i} ${o}${p?` -${p}`:""} ${JSON.stringify(n)}`),{dom:l,text:e.someProp("clipboardTextSerializer",(n=>n(t,e)))||t.content.textBetween(0,t.content.size,"\n\n")}}function dr(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",(n=>{t=n(t,a||r,e)})),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",(n=>n(t,i,r,e)));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",(t=>{n=t(n,e)})),o=function(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n,r=kr().createElement("div"),i=/<([a-z][^>\s]+)/i.exec(e);(n=i&&br[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),Gt&&function(e){let t=e.querySelectorAll(zt?"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;c--){let e=o.firstChild;for(;e&&1!=e.nodeType;)e=e.nextSibling;if(!e)break;o=e}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||hr.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)}(yr(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&&mr(n,r,e,o[o.length-1],0))o[o.length-1]=t;else{o.length&&(o[o.length-1]=gr(o[o.length-1],r.length));let t=fr(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=yr(s,e,t)}return e.someProp("transformPasted",(t=>{s=t(s,e)})),s}const hr=/^(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 fr(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,c.from(e));return e}function mr(e,t,n,r,i){if(i<e.length&&i<t.length&&e[i]==t[i]){let o=mr(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(fr(n,e,i+1))))}}function gr(e,t){if(0==t)return e;let n=e.content.replaceChild(e.childCount-1,gr(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(c.empty,!0);return e.copy(n.append(r))}function vr(e,t,n,r,i,o){let s=t<0?e.firstChild:e.lastChild,a=s.content;return e.childCount>1&&(o=0),i<r-1&&(a=vr(a,t,n,r,i+1,o)),i>=n&&(a=t<0?s.contentMatchAt(0).fillBefore(a,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 yr(e,t,n){return t<e.openStart&&(e=new m(vr(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new m(vr(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const br={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 wr=null;function kr(){return wr||(wr=document.implementation.createHTMLDocument("title"))}const xr={},Cr={},Tr={touchstart:!0,touchmove:!0};class Er{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.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function Mr(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function Nr(e){e.someProp("handleDOMEvents",(t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>Sr(e,t))}))}function Sr(e,t){return e.someProp("handleDOMEvents",(n=>{let r=n[t.type];return!!r&&(r(e,t)||t.defaultPrevented)}))}function Dr(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 Lr(e){return{left:e.clientX,top:e.clientY}}function Ar(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 Or(e,t,n){e.focused||e.focus();let r=e.state.tr.setSelection(t);"pointer"==n&&r.setMeta("pointer",!0),e.dispatch(r)}function Ir(e,t,n,r,i){return Ar(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&&(Or(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))&&(Or(e,new nt(n),"pointer"),!0)}(e,n))}function Rr(e,t,n,r){return Ar(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",(n=>n(e,t,r)))}function Pr(e,t,n,r){return Ar(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&&(Or(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)Or(e,et.create(r,n+1,n+1+t.content.size),"pointer");else{if(!nt.isSelectable(t))continue;Or(e,nt.create(r,n),"pointer")}return!0}}(e,n,r)}function Br(e){return _r(e)}Cr.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=16==n.keyCode||n.shiftKey,!qr(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!Wt||!zt||13!=n.keyCode))if(229!=n.keyCode&&e.domObserver.forceFlush(),!_t||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)e.someProp("handleKeyDown",(t=>t(e,n)))||ur(e,n)?n.preventDefault():Mr(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,Dt(13,"Enter")))),e.input.lastIOSEnter=0)}),200)}},Cr.keyup=(e,t)=>{16==t.keyCode&&(e.input.shiftKey=!1)},Cr.keypress=(e,t)=>{let n=t;if(qr(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||$t&&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);/[\r\n]/.test(t)||e.someProp("handleTextInput",(n=>n(e,r.$from.pos,r.$to.pos,t)))||e.dispatch(e.state.tr.insertText(t).scrollIntoView()),n.preventDefault()}};const Fr=$t?"metaKey":"ctrlKey";xr.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=Br(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[Fr]&&("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(Lr(n));s&&("singleClick"==o?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new Hr(e,s,n,!!r)):("doubleClick"==o?Rr:Pr)(e,s.pos,s.inside,n)?n.preventDefault():Mr(e,"pointer"))};class Hr{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[Fr],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||!Ht||this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout((()=>{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)),Mr(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((()=>Vn(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(Lr(e))),this.updateAllowDefault(e),this.allowDefault||!t?Mr(this.view,"pointer"):Ir(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():0==e.button&&(this.flushed||Vt&&this.mightDrag&&!this.mightDrag.node.isAtom||zt&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(Or(this.view,Ze.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):Mr(this.view,"pointer")}move(e){this.updateAllowDefault(e),Mr(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 qr(e,t){return!!e.composing||!!(Vt&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500)&&(e.input.compositionEndedAt=-2e8,!0)}xr.touchstart=e=>{e.input.lastTouch=Date.now(),Br(e),Mr(e,"pointer")},xr.touchmove=e=>{e.input.lastTouch=Date.now(),Mr(e,"pointer")},xr.contextmenu=e=>Br(e);const zr=Wt?5e3:-1;function jr(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout((()=>_r(e)),t))}function Vr(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 _r(e,t=!1){if(!(Wt&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),Vr(e),t||e.docView&&e.docView.dirty){let t=zn(e);return t&&!t.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(t)):e.updateState(e.state),!0}return!1}}Cr.compositionstart=Cr.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(),_r(e,!0),e.markCursor=null;else if(_r(e),Ht&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelectionRange();for(let n=t.focusNode,r=t.focusOffset;n&&1==n.nodeType&&0!=r;){let t=r<0?n.lastChild:n.childNodes[r-1];if(!t)break;if(3==t.nodeType){e.domSelection().collapse(t,t.nodeValue.length);break}n=t,r=-1}}e.input.composing=!0}jr(e,zr)},Cr.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionPendingChanges&&Promise.resolve().then((()=>e.domObserver.flush())),e.input.compositionID++,jr(e,20))};const $r=Bt&&Ft<15||_t&&Jt<604;function Ur(e,t,n,r,i){let o=dr(e,t,n,r,e.state.selection.$from);if(e.someProp("handlePaste",(t=>t(e,i,o||m.empty))))return!0;if(!o)return!1;let s=function(e){return 0==e.openStart&&0==e.openEnd&&1==e.content.childCount?e.content.firstChild:null}(o),a=s?e.state.tr.replaceSelectionWith(s,r):e.state.tr.replaceSelection(o);return e.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function Wr(e){let t=e.getData("text/plain")||e.getData("Text");if(t)return t;let n=e.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}xr.copy=Cr.cut=(e,t)=>{let n=t,r=e.state.selection,i="cut"==n.type;if(r.empty)return;let o=$r?null:n.clipboardData,s=r.content(),{dom:a,text:l}=pr(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"))},Cr.paste=(e,t)=>{let n=t;if(e.composing&&!Wt)return;let r=$r?null:n.clipboardData,i=e.input.shiftKey&&45!=e.input.lastKeyCode;r&&Ur(e,Wr(r),r.getData("text/html"),i,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();let i=e.input.shiftKey&&45!=e.input.lastKeyCode;setTimeout((()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Ur(e,r.value,null,i,t):Ur(e,r.textContent,r.innerHTML,i,t)}),50)}(e,n)};class Gr{constructor(e,t,n){this.slice=e,this.move=t,this.node=n}}const Jr=$t?"altKey":"ctrlKey";xr.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i,o=e.state.selection,s=o.empty?null:e.posAtCoords(Lr(n));if(s&&s.pos>=o.from&&s.pos<=(o instanceof nt?o.to-1:o.to));else if(r&&r.mightDrag)i=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&&(i=nt.create(e.state.doc,t.posBefore))}let a=(i||e.state.selection).content(),{dom:l,text:c}=pr(e,a);n.dataTransfer.clearData(),n.dataTransfer.setData($r?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",$r||n.dataTransfer.setData("text/plain",c),e.dragging=new Gr(a,!n[Jr],i)},xr.dragend=e=>{let t=e.dragging;window.setTimeout((()=>{e.dragging==t&&(e.dragging=null)}),50)},Cr.dragover=Cr.dragenter=(e,t)=>t.preventDefault(),Cr.drop=(e,t)=>{let n=t,r=e.dragging;if(e.dragging=null,!n.dataTransfer)return;let i=e.posAtCoords(Lr(n));if(!i)return;let o=e.state.doc.resolve(i.pos),s=r&&r.slice;s?e.someProp("transformPasted",(t=>{s=t(s,e)})):s=dr(e,Wr(n.dataTransfer),$r?null:n.dataTransfer.getData("text/html"),!1,o);let a=!(!r||n[Jr]);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;if(a){let{node:e}=r;e?e.replace(c):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(Kn(e,h,c.doc.resolve(t)))}e.focus(),e.dispatch(c.setMeta("uiEvent","drop"))},xr.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.domSelectionRange())&&Vn(e)}),20))},xr.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)},xr.beforeinput=(e,t)=>{if(zt&&Wt&&"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,Dt(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 Cr)xr[os]=Cr[os];function Kr(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 Zr{constructor(e,t){this.toDOM=e,this.spec=t||ti,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 Yr(i-n,i-n,this)}valid(){return!0}eq(e){return this==e||e instanceof Zr&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Kr(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class Xr{constructor(e,t){this.attrs=e,this.spec=t||ti}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 Yr(i,o,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof Xr&&Kr(this.attrs,e.attrs)&&Kr(this.spec,e.spec)}static is(e){return e.type instanceof Xr}destroy(){}}class Qr{constructor(e,t){this.attrs=e,this.spec=t||ti}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 Yr(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 Qr&&Kr(this.attrs,e.attrs)&&Kr(this.spec,e.spec)}destroy(){}}class Yr{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(e,t){return new Yr(e,t,this.type)}eq(e,t=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 Yr(e,e,new Zr(t,n))}static inline(e,t,n,r){return new Yr(e,t,new Xr(n,r))}static node(e,t,n,r){return new Yr(e,t,new Qr(n,r))}get spec(){return this.type.spec}get inline(){return this.type instanceof Xr}get widget(){return this.type instanceof Zr}}const ei=[],ti={};class ni{constructor(e,t){this.local=e.length?e:ei,this.children=t.length?t:ei}static create(e,t){return t.length?li(t,e,0,ti):ri}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==ri||0==e.maps.length?this:this.mapInner(e,t,0,0,n||ti)}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,i)=>{let o=i-r-(n-t);for(let s=0;s<a.length;s+=3){let r=a[s+1];if(r<0||t>r+u-e)continue;let i=a[s]+u-e;n>=i?a[s+1]=t<=i?-2:-1:t>=u&&o&&(a[s]+=o,a[s+1]+=o)}e+=o})),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!=ri?(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=li(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 ni(t.sort(ci),a)}(this.children,o||[],e,t,n,r,i):o?new ni(o.sort(ci),ei):ri}add(e,t){return t.length?this==ri?ni.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=si(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,li(s,e,a+1,ti)),i+=3}}));let o=oi(i?ai(t):t,-n);for(let s=0;s<o.length;s++)o[s].type.valid(e,o[s])||o.splice(s--,1);return new ni(o.length?this.local.concat(o).sort(ci):this.local,r||this.children)}remove(e){return 0==e.length||this==ri?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!=ri?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 ni(r,n):ri}forChild(e,t){if(this==ri)return this;if(t.isLeaf)return ni.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 Xr){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 ni(r.sort(ci),ei);return n?new ii([e,n]):e}return n||ri}eq(e){if(this==e)return!0;if(!(e instanceof ni)||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 ui(this.localsInner(e))}localsInner(e){if(this==ri)return ei;if(e.inlineContent||!this.local.some(Xr.is))return this.local;let t=[];for(let n=0;n<this.local.length;n++)this.local[n].type instanceof Xr||t.push(this.local[n]);return t}}ni.empty=new ni([],[]),ni.removeOverlap=ui;const ri=ni.empty;class ii{constructor(e){this.members=e}map(e,t){const n=this.members.map((n=>n.map(e,t,ti)));return ii.from(n)}forChild(e,t){if(t.isLeaf)return ni.empty;let n=[];for(let r=0;r<this.members.length;r++){let i=this.members[r].forChild(e,t);i!=ri&&(i instanceof ii?n=n.concat(i.members):n.push(i))}return ii.from(n)}eq(e){if(!(e instanceof ii)||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?ui(n?t:t.sort(ci)):ei}static from(e){switch(e.length){case 0:return ri;case 1:return e[0];default:return new ii(e.every((e=>e instanceof ni))?e:e.reduce(((e,t)=>e.concat(t instanceof ni?t:t.members)),[]))}}}function oi(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 Yr(i.from+t,i.to+t,i.type))}return n}function si(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 ai(e){let t=[];for(let n=0;n<e.length;n++)null!=e[n]&&t.push(e[n]);return t}function li(e,t,n,r){let i=[],o=!1;t.forEach(((t,s)=>{let a=si(e,t,s+n);if(a){o=!0;let e=li(a,t,n+s+1,r);e!=ri&&i.push(s,s+t.nodeSize,e)}}));let s=oi(o?ai(e):e,-n).sort(ci);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 ni(s,i):ri}function ci(e,t){return e.from-t.from||e.to-t.to}function ui(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),pi(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),pi(t,i+1,o.copy(r.to,o.to)))}}return t}function pi(e,t,n){for(;t<e.length&&ci(n,e[t])>0;)t++;e.splice(t,0,n)}function di(e){let t=[];return e.someProp("decorations",(n=>{let r=n(e.state);r&&r!=ri&&t.push(r)})),e.cursorWrapper&&t.push(ni.create(e.state.doc,[e.cursorWrapper.deco])),ii.from(t)}const hi={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},fi=Bt&&Ft<=11;class mi{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 gi{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new mi,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]);Bt&&Ft<=11&&e.some((e=>"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length))?this.flushSoon():this.flush()})),fi&&(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,hi)),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(Zn(this.view)){if(this.suppressingSelectionUpdates)return Vn(this.view);if(Bt&&Ft<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Ct(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t,n=new Set;for(let i=e.focusNode;i;i=wt(i))n.add(i);for(let i=e.anchorNode;i;i=wt(i))if(n.has(i)){t=i;break}let r=t&&this.view.docView.nearestDesc(t);return r&&r.ignoreMutation({type:"selection",target:3==t.nodeType?t.parentNode:t})?(this.setCurSelection(),!0):void 0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.pendingRecords();t.length&&(this.queue=[]);let n=e.domSelectionRange(),r=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&Zn(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(Ht&&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&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&St(n)&&(l=zn(e))&&l.eq(Ze.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Vn(e),this.currentSelection.set(n),e.scrollToSelection()):(i>-1||r)&&(i>-1&&(e.docView.markDirty(i,o),function(e){if(vi.has(e))return;if(vi.set(e,null),-1!==["normal","nowrap","pre-line"].indexOf(getComputedStyle(e.dom).whiteSpace)){if(e.requiresGeckoHackNode=Ht,yi)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."),yi=!0}}(e)),this.handleDOMChange(i,o,s,a),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||Vn(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(Bt&&Ft<=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?bt(r)+1:0,s=n.localPosFromDOM(e.target,o,-1),a=i&&i.parentNode==e.target?bt(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 vi=new WeakMap,yi=!1;function bi(e){let t=e.pmViewDesc;if(t)return t.parseRule();if("BR"==e.nodeName&&e.parentNode){if(Vt&&/^(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||Vt&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if("IMG"==e.nodeName&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}const wi=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function ki(e,t,n,r,i){let o=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let t=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,n=zn(e,t);if(n&&!e.state.selection.eq(n)){if(zt&&Wt&&13===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp("handleKeyDown",(t=>t(e,Dt(13,"Enter")))))return;let r=e.state.tr.setSelection(n);"pointer"==t?r.setMeta("pointer",!0):"key"==t&&r.scrollIntoView(),o&&r.setMeta("composition",o),e.dispatch(r)}return}let s=e.state.doc.resolve(t),a=s.sharedDepth(n);t=s.before(a+1),n=e.state.doc.resolve(n).after(a+1);let l,u,p=e.state.selection,d=function(e,t,n){let r,{node:i,fromOffset:o,toOffset:s,from:a,to:l}=e.docView.parseRange(t,n),c=e.domSelectionRange(),u=c.anchorNode;if(u&&e.dom.contains(1==u.nodeType?u:u.parentNode)&&(r=[{node:u,offset:c.anchorOffset}],St(c)||r.push({node:c.focusNode,offset:c.focusOffset})),zt&&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:bi,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),h=e.state.doc,f=h.slice(d.from,d.to);8===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime?(l=e.state.selection.to,u="end"):(l=e.state.selection.from,u="start"),e.input.lastKeyCode=null;let m=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){let e=r<=o&&r>=s?o-r:0;o-=e,o&&o<t.size&&Ti(t.textBetween(o-1,o+1))&&(o+=e?1:-1),a=o+(a-s),s=o}else if(a<o){let t=r<=o&&r>=a?o-r:0;o-=t,o&&o<e.size&&Ti(e.textBetween(o-1,o+1))&&(o+=t?1:-1),s=o+(s-a),a=o}return{start:o,endA:s,endB:a}}(f.content,d.doc.content,d.from,l,u);if((_t&&e.input.lastIOSEnter>Date.now()-225||Wt)&&i.some((e=>1==e.nodeType&&!wi.test(e.nodeName)))&&(!m||m.endA>=m.endB)&&e.someProp("handleKeyDown",(t=>t(e,Dt(13,"Enter")))))return void(e.input.lastIOSEnter=0);if(!m){if(!(r&&p instanceof et&&!p.empty&&p.$head.sameParent(p.$anchor))||e.composing||d.sel&&d.sel.anchor!=d.sel.head){if(d.sel){let t=xi(e,e.state.doc,d.sel);if(t&&!t.eq(e.state.selection)){let n=e.state.tr.setSelection(t);o&&n.setMeta("composition",o),e.dispatch(n)}}return}m={start:p.from,endA:p.to,endB:p.to}}if(zt&&e.cursorWrapper&&d.sel&&d.sel.anchor==e.cursorWrapper.deco.from&&d.sel.head==d.sel.anchor){let e=m.endB-m.start;d.sel={anchor:d.sel.anchor+e,head:d.sel.anchor+e}}e.input.domChangeCount++,e.state.selection.from<e.state.selection.to&&m.start==m.endB&&e.state.selection instanceof et&&(m.start>e.state.selection.from&&m.start<=e.state.selection.from+2&&e.state.selection.from>=d.from?m.start=e.state.selection.from:m.endA<e.state.selection.to&&m.endA>=e.state.selection.to-2&&e.state.selection.to<=d.to&&(m.endB+=e.state.selection.to-m.endA,m.endA=e.state.selection.to)),Bt&&Ft<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>d.from&&" \xa0"==d.doc.textBetween(m.start-d.from-1,m.start-d.from+1)&&(m.start--,m.endA--,m.endB--);let g,v=d.doc.resolveNoCache(m.start-d.from),y=d.doc.resolveNoCache(m.endB-d.from),b=h.resolve(m.start),w=v.sameParent(y)&&v.parent.inlineContent&&b.end()>=m.endA;if((_t&&e.input.lastIOSEnter>Date.now()-225&&(!w||i.some((e=>"DIV"==e.nodeName||"P"==e.nodeName)))||!w&&v.pos<d.doc.content.size&&!v.sameParent(y)&&(g=Ze.findFrom(d.doc.resolve(v.pos+1),1,!0))&&g.head==y.pos)&&e.someProp("handleKeyDown",(t=>t(e,Dt(13,"Enter")))))return void(e.input.lastIOSEnter=0);if(e.state.selection.anchor>m.start&&function(e,t,n,r,i){if(!r.parent.isTextblock||n-t<=i.pos-r.pos||Ci(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(Ci(o,!0,!0));return!(!s.parent.isTextblock||s.pos>n||Ci(s,!0,!1)<n)&&r.parent.content.cut(r.parentOffset).eq(s.parent.content)}(h,m.start,m.endA,v,y)&&e.someProp("handleKeyDown",(t=>t(e,Dt(8,"Backspace")))))return void(Wt&&zt&&e.domObserver.suppressSelectionUpdates());zt&&Wt&&m.endB==m.start&&(e.input.lastAndroidDelete=Date.now()),Wt&&!w&&v.start()!=y.start()&&0==y.parentOffset&&v.depth==y.depth&&d.sel&&d.sel.anchor==d.sel.head&&d.sel.head==m.endA&&(m.endB-=2,y=d.doc.resolveNoCache(m.endB-d.from),setTimeout((()=>{e.someProp("handleKeyDown",(function(t){return t(e,Dt(13,"Enter"))}))}),20));let k,x,C,T=m.start,E=m.endA;if(w)if(v.pos==y.pos)Bt&&Ft<=11&&0==v.parentOffset&&(e.domObserver.suppressSelectionUpdates(),setTimeout((()=>Vn(e)),20)),k=e.state.tr.delete(T,E),x=h.resolve(m.start).marksAcross(h.resolve(m.endA));else if(m.endA==m.endB&&(C=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}}(v.parent.content.cut(v.parentOffset,y.parentOffset),b.parent.content.cut(b.parentOffset,m.endA-b.start()))))k=e.state.tr,"add"==C.type?k.addMark(T,E,C.mark):k.removeMark(T,E,C.mark);else if(v.parent.child(v.index()).isText&&v.index()==y.index()-(y.textOffset?0:1)){let t=v.parent.textBetween(v.parentOffset,y.parentOffset);if(e.someProp("handleTextInput",(n=>n(e,T,E,t))))return;k=e.state.tr.insertText(t,T,E)}if(k||(k=e.state.tr.replace(T,E,d.doc.slice(m.start-d.from,m.endB-d.from))),d.sel){let t=xi(e,k.doc,d.sel);t&&!(zt&&Wt&&e.composing&&t.empty&&(m.start!=m.endB||e.input.lastAndroidDelete<Date.now()-100)&&(t.head==T||t.head==k.mapping.map(E)-1)||Bt&&t.empty&&t.head==T)&&k.setSelection(t)}x&&k.ensureMarks(x),o&&k.setMeta("composition",o),e.dispatch(k.scrollIntoView())}function xi(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:Kn(e,t.resolve(n.anchor),t.resolve(n.head))}function Ci(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}function Ti(e){if(2!=e.length)return!1;let t=e.charCodeAt(0),n=e.charCodeAt(1);return t>=56320&&t<=57343&&n>=55296&&n<=56319}class Ei{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 Er,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(Li),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=Si(this),Ni(this),this.nodeViews=Di(this),this.docView=Tn(this.state.doc,Mi(this),di(this),this.dom,this),this.domObserver=new gi(this,((e,t,n,r)=>ki(this,e,t,n,r))),this.domObserver.start(),function(e){for(let t in xr){let n=xr[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{!Dr(e,t)||Sr(e,t)||!e.editable&&t.type in Cr||n(e,t)},Tr[t]?{passive:!0}:void 0)}Vt&&e.dom.addEventListener("input",(()=>null)),Nr(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&&Nr(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Li),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}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._props)}updateStateInner(e,t){var n;let r=this.state,i=!1,o=!1;e.storedMarks&&this.composing&&(Vr(this),o=!0),this.state=e;let s=r.plugins!=e.plugins||this._props.plugins!=t.plugins;if(s||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let e=Di(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,i=!0)}(s||t.handleDOMEvents!=this._props.handleDOMEvents)&&Nr(this),this.editable=Si(this),Ni(this);let a=di(this),l=Mi(this),c=r.plugins==e.plugins||r.doc.eq(e.doc)?e.scrollToSelection>r.scrollToSelection?"to selection":"preserve":"reset",u=i||!this.docView.matchesNode(e.doc,l,a);!u&&e.selection.eq(r.selection)||(o=!0);let p="preserve"==c&&o&&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:Yt(e.dom)}}(this);if(o){this.domObserver.stop();let t=u&&(Bt||zt)&&!this.composing&&!r.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)}(r.selection,e.selection);if(u){let n=zt?this.trackWrites=this.domSelectionRange().focusNode:null;!i&&this.docView.update(e.doc,l,a,this)||(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=Tn(e.doc,l,a,this.dom,this)),n&&!this.trackWrites&&(t=!0)}t||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&function(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return Ct(t.node,t.offset,n.anchorNode,n.anchorOffset)}(this))?Vn(this,t):(Gn(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(r),(null===(n=this.dragging)||void 0===n?void 0:n.node)&&!r.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,r),"reset"==c?this.dom.scrollTop=0:"to selection"==c?this.scrollToSelection():p&&function({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;en(n,0==r?0:r-t)}(p)}scrollToSelection(){let e=this.domSelectionRange().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&&Qt(this,t.getBoundingClientRect(),e)}else Qt(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))}}}updateDraggedNode(e,t){let n=e.node,r=-1;if(this.state.doc.nodeAt(n.from)==n.node)r=n.from;else{let e=n.from+(this.state.doc.content.size-t.doc.content.size);(e>0&&this.state.doc.nodeAt(e))==n.node&&(r=e)}this.dragging=new Gr(e.slice,e.move,r<0?void 0:nt.create(this.state.doc,r))}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(){if(Bt){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if("false"==e.contentEditable)return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&function(e){if(e.setActive)return e.setActive();if(tn)return e.focus(tn);let t=Yt(e);e.focus(null==tn?{get preventScroll(){return tn={preventScroll:!0},!0}}:void 0),tn||(tn=!1,en(t,0))}(this.dom),Vn(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}updateRoot(){this._root=null}posAtCoords(e){return sn(this,e)}coordsAtPos(e,t=1){return un(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,n=-1){let 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 yn(this,t||this.state,e)}pasteHTML(e,t){return Ur(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return Ur(this,e,null,!0,t||new ClipboardEvent("paste"))}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,[],di(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){Sr(e,t)||!xr[t.type]||!e.editable&&t.type in Cr||xr[t.type](e,t)}(this,e)}dispatch(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){return Vt&&11===this.root.nodeType&&function(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}(this.dom.ownerDocument)==this.dom?function(e){let t;function n(e){e.preventDefault(),e.stopImmediatePropagation(),t=e.getTargetRanges()[0]}e.dom.addEventListener("beforeinput",n,!0),document.execCommand("indent"),e.dom.removeEventListener("beforeinput",n,!0);let r=t.startContainer,i=t.startOffset,o=t.endContainer,s=t.endOffset,a=e.domAtPos(e.state.selection.anchor);return Ct(a.node,a.offset,o,s)&&([r,i,o,s]=[o,s,r,i]),{anchorNode:r,anchorOffset:i,focusNode:o,focusOffset:s}}(this):this.domSelection()}domSelection(){return this.root.getSelection()}}function Mi(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),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]))})),t.translate||(t.translate="no"),[Yr.node(0,e.state.doc.content.size,t)]}function Ni(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:Yr.widget(e.state.selection.head,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function Si(e){return!e.someProp("editable",(t=>!1===t(e.state)))}function Di(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 Li(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 Ai={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:"'"},Oi={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Ii="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),Ri="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Pi=0;Pi<10;Pi++)Ai[48+Pi]=Ai[96+Pi]=String(Pi);for(Pi=1;Pi<=24;Pi++)Ai[Pi+111]="F"+Pi;for(Pi=65;Pi<=90;Pi++)Ai[Pi]=String.fromCharCode(Pi+32),Oi[Pi]=String.fromCharCode(Pi);for(var Bi in Ai)Oi.hasOwnProperty(Bi)||(Oi[Bi]=Ai[Bi]);const Fi="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function Hi(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);Fi?i=!0:n=!0}}return t&&(s="Alt-"+s),n&&(s="Ctrl-"+s),i&&(s="Meta-"+s),r&&(s="Shift-"+s),s}function qi(e,t,n=!0){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),n&&t.shiftKey&&(e="Shift-"+e),e}function zi(e){return new mt({props:{handleKeyDown:ji(e)}})}function ji(e){let t=function(e){let t=Object.create(null);for(let n in e)t[Hi(n)]=e[n];return t}(e);return function(e,n){let r,i=function(e){var t=!(Ii&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||Ri&&e.shiftKey&&e.key&&1==e.key.length||"Unidentified"==e.key)&&e.key||(e.shiftKey?Oi:Ai)[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=t[qi(i,n)];if(o&&o(e.state,e.dispatch,e))return!0;if(1==i.length&&" "!=i){if(n.shiftKey){let r=t[qi(i,n,!1)];if(r&&r(e.state,e.dispatch,e))return!0}if((n.shiftKey||n.altKey||n.metaKey||i.charCodeAt(0)>127)&&(r=Ai[n.keyCode])&&r!=i){let i=t[qi(r,n)];if(i&&i(e.state,e.dispatch,e))return!0}}return!1}}const Vi=(e,t)=>!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function _i(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("backward",e):n.parentOffset>0)?null:n}function $i(e,t,n=!1){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 Ui(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}function Wi(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("forward",e):n.parentOffset<n.parent.content.size)?null:n}const Gi=(e,t,n)=>{let r=Wi(e,n);if(!r)return!1;let i=Ji(r);if(!i)return!1;let o=i.nodeAfter;if(to(e,i,t))return!0;if(0==r.parent.content.size&&($i(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($i(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 Ji(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 Ki=(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 Zi(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 Xi=(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=Zi(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};const Qi=(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:Zi(n.node(-1).contentMatchAt(n.indexAfter(-1))),a=Yi&&Yi(r.parent,i),l=a?[a]:i&&s?[{type:s}]:void 0,c=Oe(o.doc,o.mapping.map(n.pos),1,l);if(l||c||!Oe(o.doc,o.mapping.map(n.pos),1,s?[{type:s}]:void 0)||(s&&(l=[{type:s}]),c=!0),c&&(o.split(o.mapping.map(n.pos),1,l),!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};var Yi;const eo=(e,t)=>(t&&t(e.tr.setSelection(new it(e.doc))),!0);function to(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&&$i(s,"start",!0)&&$i(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 no(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 ro=no(-1),io=no(1);function oo(e,t=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),a=s&&function(e,t,n=null,r=e){let 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 so(e,t=null){return function(n,r){let i=!1;for(let o=0;o<n.selection.ranges.length&&!i;o++){let{$from:{pos:r},$to:{pos:s}}=n.selection.ranges[o];n.doc.nodesBetween(r,s,((r,o)=>{if(i)return!1;if(r.isTextblock&&!r.hasMarkup(e,t))if(r.type==e)i=!0;else{let t=n.doc.resolve(o),r=t.index();i=t.parent.canReplaceWith(r,r+1,e)}}))}if(!i)return!1;if(r){let i=n.tr;for(let r=0;r<n.selection.ranges.length;r++){let{$from:{pos:o},$to:{pos:s}}=n.selection.ranges[r];i.setBlockType(o,s,e,t)}r(i.scrollIntoView())}return!0}}function ao(e,t=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.inlineContent&&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 lo(...e){return function(t,n,r){for(let i=0;i<e.length;i++)if(e[i](t,n,r))return!0;return!1}}let co=lo(Vi,((e,t,n)=>{let r=_i(e,n);if(!r)return!1;let i=Ui(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&&to(e,i,t))return!0;if(0==r.parent.content.size&&($i(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($i(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=Ui(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)})),uo=lo(Vi,Gi,((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=Ji(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 po={Enter:lo(Ki,((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=Zi(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)}),Qi),"Mod-Enter":Xi,Backspace:co,"Mod-Backspace":co,"Shift-Backspace":co,Delete:uo,"Mod-Delete":uo,"Mod-a":eo},ho={"Ctrl-h":po.Backspace,"Alt-Backspace":po["Mod-Backspace"],"Ctrl-d":po.Delete,"Ctrl-Alt-Backspace":po["Mod-Delete"],"Alt-Delete":po["Mod-Delete"],"Alt-d":po["Mod-Delete"],"Ctrl-a":ro,"Ctrl-e":io};for(let os in po)ho[os]=po[os];const fo=("undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!("undefined"==typeof os||!os.platform)&&"darwin"==os.platform())?ho:po;class mo{constructor(e,t,n={}){var r;this.match=e,this.match=e,this.handler="string"==typeof t?(r=t,function(e,t,n,i){let o=r;if(t[1]){let e=t[0].lastIndexOf(t[1]);o+=t[0].slice(e+t[1].length);let r=(n+=e)-i;r>0&&(o=t[0].slice(e-r,e)+o,n=i)}return e.tr.insertText(o,n,i)}):t,this.undoable=!1!==n.undoable}}const go=500;function vo({rules:e}){let t=new mt({state:{init:()=>null,apply(e,t){let n=e.getMeta(this);return n||(e.selectionSet||e.docChanged?null:t)}},props:{handleTextInput:(n,r,i,o)=>yo(n,r,i,o,e,t),handleDOMEvents:{compositionend:n=>{setTimeout((()=>{let{$cursor:r}=n.state.selection;r&&yo(n,r.pos,r.pos,"",e,t)}))}}},isInputRules:!0});return t}function yo(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-go),a.parentOffset,null,"\ufffc")+r;for(let c=0;c<i.length;c++){let a=i[c],u=a.match.exec(l),p=u&&a.handler(s,u,t-(u[0].length-r.length),n);if(p)return a.undoable&&p.setMeta(o,{transform:p,from:t,to:n,text:r}),e.dispatch(p),!0}return!1}const bo=(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 mo(/--$/,"\u2014"),new mo(/\.\.\.$/,"\u2026"),new mo(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,"\u201c"),new mo(/"$/,"\u201d"),new mo(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,"\u2018"),new mo(/'$/,"\u2019");var wo=200,ko=function(){};ko.prototype.append=function(e){return e.length?(e=ko.from(e),!this.length&&e||e.length<wo&&this.leafAppend(e)||this.length<wo&&e.leafPrepend(this)||this.appendInner(e)):this},ko.prototype.prepend=function(e){return e.length?ko.from(e).append(this):this},ko.prototype.appendInner=function(e){return new Co(this,e)},ko.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t?ko.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},ko.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},ko.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)},ko.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},ko.from=function(e){return e instanceof ko?e:e&&e.length?new xo(e):ko.empty};var xo=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<=wo)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=wo)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}(ko);ko.empty=new xo([]);var Co=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}(ko);const To=ko;class Eo{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 Mo(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 Mo(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 Eo(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 Mo(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>So&&(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 Eo(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 Eo(this.items.append(e.map((e=>new Mo(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 Mo(l,o,c))}else n.push(new Mo(l))}),r);let l=[];for(let p=t;p<o;p++)l.push(new Mo(i.maps[p]));let c=this.items.slice(0,r).append(l).append(n),u=new Eo(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(e=this.items.length){let 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 Mo(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 Eo(To.from(r.reverse()),i)}}Eo.empty=new Eo(To.empty,0);class Mo{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 Mo(t.getMap().invert(),t,this.selection)}}}class No{constructor(e,t,n,r,i){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=i}}const So=20;function Do(e){let t=[];return e.forEach(((e,n,r,i)=>t.push(r,i))),t}function Lo(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 Ao(e,t,n,r){let i=Ro(t),o=Po.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 No(r?l:s.remaining,r?s.remaining:l,null,0,-1);n(s.transform.setSelection(a).setMeta(Po,{redo:r,historyState:c}).scrollIntoView())}let Oo=!1,Io=null;function Ro(e){let t=e.plugins;if(Io!=t){Oo=!1,Io=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){Oo=!0;break}}return Oo}const Po=new yt("history"),Bo=new yt("closeHistory");function Fo(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new mt({key:Po,state:{init:()=>new No(Eo.empty,Eo.empty,null,0,-1),apply:(t,n,r)=>function(e,t,n,r){let i,o=n.getMeta(Po);if(o)return o.historyState;n.getMeta(Bo)&&(e=new No(e.done,e.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(0==n.steps.length)return e;if(s&&s.getMeta(Po))return s.getMeta(Po).redo?new No(e.done.addTransform(n,void 0,r,Ro(t)),e.undone,Do(n.mapping.maps[n.steps.length-1]),e.prevTime,e.prevComposition):new No(e.done,e.undone.addTransform(n,void 0,r,Ro(t)),null,e.prevTime,e.prevComposition);if(!1===n.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))return(i=n.getMeta("rebased"))?new No(e.done.rebased(n,i),e.undone.rebased(n,i),Lo(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new No(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),Lo(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);{let i=n.getMeta("composition"),o=0==e.prevTime||!s&&e.prevComposition!=i&&(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)),a=s?Lo(e.prevRanges,n.mapping):Do(n.mapping.maps[n.steps.length-1]);return new No(e.done.addTransform(n,o?t.selection.getBookmark():void 0,r,Ro(t)),Eo.empty,a,n.time,null==i?e.prevComposition:i)}}(n,r,t,e)},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r="historyUndo"==n?Ho:"historyRedo"==n?qo:null;return!!r&&(t.preventDefault(),r(e.state,e.dispatch))}}}})}const Ho=(e,t)=>{let n=Po.getState(e);return!(!n||0==n.done.eventCount)&&(t&&Ao(n,e,t,!1),!0)},qo=(e,t)=>{let n=Po.getState(e);return!(!n||0==n.undone.eventCount)&&(t&&Ao(n,e,t,!0),!0)};var zo=function(e,t){return zo=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])},zo(e,t)};function jo(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}zo(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var Vo=function(){return Vo=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},Vo.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))}function $o(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var Uo=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 Wo=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 Go=function(e){return"string"===typeof e||e instanceof String};var Jo=function(e){return e instanceof Array};var Ko=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);},Zo=Jo,Xo=Ko,Qo=Uo;var Yo=function(e,t,n){Zo(e)?Xo(e,t,n):Qo(e,t,n)},es=Go,ts=Yo;var ns=function(e,t,n){var r=e.style;es(t)?r[t]=n:ts(t,(function(e,t){r[t]=e}))},rs=Jo;var is=function(e,t,n){var r,i;if(n=n||0,!rs(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 ss=function(e){return void 0===e},as=ss;var ls=function(e){return e&&e.className?as(e.className.baseVal)?e.className:e.className.baseVal:""},cs=Jo,us=ss;var ps=function(e,t){t=(t=cs(t)?t.join(" "):t).replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),us(e.className.baseVal)?e.className=t:e.className.baseVal=t},ds=Yo,hs=is,fs=ls,ms=ps;var gs=function(e){var t,n=Array.prototype.slice.call(arguments,1),r=e.classList,i=[];r?ds(n,(function(t){e.classList.add(t)})):((t=fs(e))&&(n=[].concat(t.split(/\s+/),n)),ds(n,(function(e){hs(e,i)<0&&i.push(e)})),ms(e,i))},vs=Ko,ys=is,bs=ls,ws=ps;var ks=function(e){var t,n,r=Array.prototype.slice.call(arguments,1),i=e.classList;i?vs(r,(function(e){i.remove(e)})):(t=bs(e).split(/\s+/),n=[],vs(t,(function(e){ys(e,r)<0&&n.push(e)})),ws(e,n))};var xs=function(e){return"number"===typeof e||e instanceof Number};var Cs=function(e){return null===e},Ts=Uo;var Es=ss,Ms=function(e,t){var n=document.createElement("img"),r="";return Ts(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},Ns=6048e5;var Ss=function(e,t){var n=location.hostname,r="TOAST UI "+e+" for "+n+": Statistics",i=window.localStorage.getItem(r);(Es(window.tui)||!1!==window.tui.usageStatistics)&&(i&&!function(e){return(new Date).getTime()-e>Ns}(i)||(window.localStorage.setItem(r,(new Date).getTime()),setTimeout((function(){"interactive"!==document.readyState&&"complete"!==document.readyState||Ms("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 Ds=/[\u0020]+/g,Ls=/[>(){}[\]+-.!#|]/g,As=/<([a-zA-Z_][a-zA-Z0-9\-._]*)(\s|[^\\>])*\/?>|<(\/)([a-zA-Z_][a-zA-Z0-9\-._]*)\s*\/?>|<!--[^-]+-->|<([a-zA-Z_][a-zA-Z0-9\-.:/]*)>/g,Os=/\\[!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~\\]/g,Is=/[*_~`]/g,Rs=/!\[.*\]\(.*\)/g,Ps=/[[\]]/g,Bs=/(?:^|[^\\])\\(?!\\)/g,Fs=new RegExp('[&<>"]',"g");function Hs(e){switch(e){case"&":return"&amp;";case"<":return"&lt;";case">":return"&gt;";case'"':return"&quot;";default:return e}}function qs(e){return Fs.test(e)?e.replace(Fs,Hs):e}function zs(e,t){return-1!==e.indexOf(t)}var js=["rel","target","hreflang","type"],Vs={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 _s(e){if(!e)return null;var t={};return js.forEach((function(n){ss(e[n])||(t[n]=e[n])})),t}function $s(e,t){for(var n="",r=0;r<t;r+=1)n+=e;return n}function Us(e){for(var t=[],n=Rs.exec(e);n;)t.push([n.index,n.index+n[0].length]),n=Rs.exec(e);return e.replace(Ps,(function(e,n){var r=t.some((function(e){return n>e[0]&&n<e[1]}));return r?e:"\\"+e}))}function Ws(e){var t=function(e){return"\\"+e},n=e.replace(Ds," ");return Os.test(n)&&(n=n.replace(Os,t)),Bs.test(n)&&(n=n.replace(Bs,(function(e){return e+"\\"}))),n=n.replace(Is,t),As.test(n)&&(n=n.replace(As,t)),function(e){var t=!1;return Uo(Vs,(function(n){return n.test(e)&&(t=!0),!t})),t}(n)&&(n=n.replace(Ls,t)),n}function Gs(e){var t;return(t=-1===e.indexOf('"')?'""':-1===e.indexOf("'")?"''":"()")[0]+e+t[1]}function Js(e){return Cs(e)||ss(e)}function Ks(e,t){if(null===e&&e===t)return!0;if("object"!==typeof e||"object"!==typeof t||Js(e)||Js(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 Zs(e){return e[e.length-1]}function Xs(e){return"object"===typeof e&&null!==e}function Qs(e,t){var n=Vo({},e);return e&&t&&Object.keys(t).forEach((function(e){Xs(n[e])?Array.isArray(t[e])?n[e]=Ys(t[e]):n.hasOwnProperty(e)?n[e]=Qs(n[e],t[e]):n[e]=ea(t[e]):n[e]=t[e]})),n}function Ys(e){return e.map((function(e){return Xs(e)?Array.isArray(e)?Ys(e):ea(e):e}))}function ea(e){var t=Object.keys(e);return t.length?t.reduce((function(t,n){return Xs(e[n])?t[n]=Array.isArray(e[n])?Ys(e[n]):ea(e[n]):t[n]=e[n],t}),{}):e}function ta(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]:ta(e[n],t[n]):e[n]=t[n]})),e}function na(e,t){return e>t?[t,e]:[e,t]}var ra=Ko;var ia=function(e){var t;try{t=Array.prototype.slice.call(e)}catch(n){t=[],ra(e,(function(e){t.push(e)}))}return t};function oa(e,t){var n=e.nodes.paragraph;return t?n.create(null,Go(t)?e.text(t):t):n.createAndFill()}function sa(e,t,n){return e.text(t,n)}function aa(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 la(e,t,n){var r=t.pos;return e.replaceWith(r,r,oa(n)),e.setSelection(aa(e,r+1))}function ca(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?sa(l,m):c.empty,v=s.mapping.map(n),y=v+f.size;s.replaceWith(v,y,g),n+=d}return s}function ua(e,t,n,r){var i=n.length;e.split(t).delete(t-i,t).insert(e.mapping.map(t),r).setSelection(aa(e,e.mapping.map(t)-i))}function pa(e){return e.sourcepos[0][0]}function da(e){return e.sourcepos[1][0]}function ha(e){return e.sourcepos[0][1]}function fa(e){return e.sourcepos[1][1]}function ma(e){var t=e.type;return"strike"===t||"strong"===t||"emph"===t||"code"===t||"link"===t||"image"===t}function ga(e){return e&&("item"===e.type||"list"===e.type)}function va(e){return ga(e)&&"ordered"===e.listData.type}function ya(e){return ga(e)&&"ordered"!==e.listData.type}function ba(e){return e&&("tableCell"===e.type||"tableDelimCell"===e.type)}function wa(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 ka(e,t){return[e[0],e[1]+t]}function xa(e,t){return[e[0],t]}function Ca(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 Ta(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 Ea(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 Ma=[],Na={},Sa=/\$\$widget\d+\s/;function Da(e){var t=e.search(Sa);if(-1!==t){var n=e.substring(t).replace(Sa,"").replace("$$","");e=e.substring(0,t),e+=Da(n)}return e}function La(e,t){return"$$"+e+" "+t+"$$"}function Aa(e,t){var n=Na[e],r=n.rule,i=n.toDOM,o=Da(t).match(r);return o&&(t=o[0]),i(t)}function Oa(){return Ma}function Ia(e){(Ma=e).forEach((function(e,t){Na["widget"+t]=e}))}function Ra(e,t,n,r){return e.concat(Pa(t,n,r))}function Pa(e,t,n){void 0===n&&(n=0);var r=[],i=(Ma[n]||{}).rule,o=n+1;if(e=Da(e),i&&i.test(e)){for(var s=void 0;-1!==(s=e.search(i));){var a=e.substring(0,s);a&&(r=Ra(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(La(c,l)))),e=e.substring(l.length)}e&&(r=Ra(r,e,t,o))}else e&&(r=n<Ma.length-1?Ra(r,e,t,o):[t.text(e)]);return r}function Ba(e){for(var t,n="",r=e.walker();t=r.next();){var i=t.node;t.entering&&(i!==e&&"text"!==i.type?(n+=Ca(i),r.resumeAt(e,!1),r.next()):"text"===i.type&&(n+=i.literal))}return n}function Fa(){return{deleteSelection:function(){return Vi},selectAll:function(){return eo},undo:function(){return Ho},redo:function(){return qo}}}var Ha=is,qa=ls;var za=function(e,t){var n;return e.classList?e.classList.contains(t):(n=qa(e).split(/\s+/),Ha(t,n)>-1)},ja=is,Va=ia,_a=Element.prototype,$a=_a.matches||_a.webkitMatchesSelector||_a.mozMatchesSelector||_a.msMatchesSelector||function(e){var t=this.document||this.ownerDocument;return ja(this,Va(t.querySelectorAll(e)))>-1};var Ua=function(e,t){return $a.call(e,t)},Wa="[A-Za-z][A-Za-z0-9-]*",Ga="(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^\"'=<>`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)",Ja="<("+Wa+")("+Ga+")*\\s*/?>",Ka="(?:"+Ja+"|"+("</("+Wa+")\\s*[>]")+")",Za=new RegExp("^"+Ka,"i"),Xa=/<br\s*\/*>/i,Qa=/<! ---->|<!--(?:-?[^>-])(?:-?[^-])*-->/,Ya="</p><p>";function el(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 tl="toastui-editor-";function nl(){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(""+tl+s)}return n.join(" ")}function rl(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.map((function(e){return tl+"md-"+e})).join(" ")}function il(e){return e&&e.nodeType===Node.ELEMENT_NODE}function ol(e){e.parentNode&&e.parentNode.removeChild(e)}function sl(e,t,n){ss(n)&&(n=!za(e,t)),(n?gs:ks)(e,t)}function al(e,t){var n=document.createElement("div");Go(e)?n.innerHTML=e:n.appendChild(e);var r=n.firstChild;return t&&t.appendChild(r),r}function ll(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 cl(e,t){var n;for(n=Go(t)?function(e){return Ua(e,t)}:function(e){return e===t};e&&e!==document;){if(il(e)&&n(e))return e;e=e.parentNode}return null}function ul(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 pl(e,t){Object.keys(e).forEach((function(n){Js(e[n])?t.removeAttribute(n):t.setAttribute(n,e[n])}))}function dl(e){var t=e;return t=(t=t.replace(/<img class="ProseMirror-separator" alt="">/g,"")).replace(/ class="ProseMirror-trailingBreak"/g,"")}var hl=new yt("widget"),fl=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=cl(e.dom.parentElement,"."+nl("defaultUI"))})),this.eventEmitter.listen("removePopupWidget",this.removeWidget)}return e.prototype.update=function(e){var t=hl.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;ns(n,{opacity:"0"}),this.rootEl.appendChild(n),ns(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 ml(e,t,n){e.emit("addImageBlobHook",t,(function(n,r){e.emit("command","addImage",{imageUrl:n,altText:r||t.name||"image"})}),n)}function gl(e){var t=ia(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 vl(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&&Ko(i,(function(e){return-1===e.type.indexOf("image")||(n.preventDefault(),n.stopPropagation(),ml(t,e,n.type),!1)})),!0}}}})}var yl=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 bl(e){var t=document.createElement("span"),n=Aa(e.attrs.info,e.textContent);return t.className="tui-widget",t.appendChild(n),{dom:t}}function wl(e){return"widget"===e.type.name}var kl=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return jo(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}(yl),xl=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=_o(_o([],this.keymaps),[zi(Vo({"Shift-Enter":fo.Enter},fo)),Fo(),(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 gs(r,"placeholder"),t.className&&gs(r,t.className),r.textContent=t.text,ni.create(n,[Yr.widget(1,r)])}return null}}})),(e=this.eventEmitter,new mt({key:hl,state:{init:function(){return null},apply:function(e){return e.getMeta("widget")}},view:function(t){return new fl(t,e)}})),vl(this.context)]);return n?r.concat(n):r},enumerable:!1,configurable:!0}),e.prototype.createInputRules=function(){var e=Oa().map((function(e){var t=e.rule;return new mo(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(wl(u)&&(u=c.node(c.depth-1)),u.forEach((function(e){return wl(e)&&(p+=1)})),l.length>p){var d=Zs(l),h=Pa(d,o);return s.replaceWith(i-d.length+1,i,h)}return null}))}));return e.length?vo({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=Fa(),n=t.undo,r=t.redo,i=this.specs.keymaps(e),o={"Mod-z":n(),"Shift-Mod-z":r()};return e?i.concat(zi(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(aa(t,1)).scrollIntoView()),e&&this.focus()},e.prototype.moveCursorToEnd=function(e){var t=this.view.state.tr;this.view.dispatch(t.setSelection(aa(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){ns(this.el,{height:e+"px"})},e.prototype.setMinHeight=function(e){ns(this.el,{minHeight:e+"px"})},e.prototype.getElement=function(){return this.el},e}();var Cl=function(e){return e instanceof Function},Tl=["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 El(e,t,n){return e.focus(),t(n)(e.state,e.dispatch,e)}var Ml=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 Vo(Vo({},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 Vo(Vo({},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 Cl(i)?r[n.name]=function(t){return El(e,i,t)}:Object.keys(i).forEach((function(t){r[t]=function(n){return El(e,i[t],n)}})),Vo(Vo({},t),r)}),{}),r=Fa();return Object.keys(r).forEach((function(t){n[t]=function(n){return El(e,r[t],n)}})),t&&Object.keys(t).forEach((function(r){n[r]=function(n){return El(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){zs(Tl,e)||delete t[e]})),zi(t)}))},e.prototype.setContext=function(e){this.specs.forEach((function(t){t.setContext(e)}))},e}();function Nl(e){var t=e.from,n=e.to;return e instanceof it?[t+1,n-1]:[t,n]}function Sl(e){return e.index(0)+1}function Dl(e,t,n){void 0===n&&(n=1);var r=0;return e.forEach((function(e,i){wl(e)&&i+2<t&&(r+=2*n)})),r}function Ll(e,t,n){void 0===n&&(n=t);var r=t===n,i=e.resolve(t),o=Sl(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=Sl(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+Dl(e.child(o-1),u,-1)],[s,p+Dl(e.child(s-1),p,-1)]]}function Al(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 Ol(e,t,n){var r=Al(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]+Dl(s,t[1]-1),c+=n[1]+Dl(a,n[1]-1),[l,Math.min(c,e.content.size)]}function Il(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 Rl(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 Pl="heading",Bl="listItem",Fl="link",Hl="code",ql="meta",zl="delimiter",jl="markedText",Vl={strong:2,emph:1,strike:2};function _l(e,t,n,r){return{start:e,end:t,spec:{type:n,attrs:r}}}function $l(e,t,n){var r=e.type,i=ka(t,Vl[r]),o=ka(n,-Vl[r]);return[_l(i,o,r),_l(t,i,zl),_l(o,n,zl)]}function Ul(e,t,n,r){return[_l(e,t,Fl),_l(xa(e,n[1]+1),xa(t,r),Fl,{desc:!0}),_l(xa(t,r+2),ka(t,-1),Fl,{url:!0})]}function Wl(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?[Vo(Vo({},i),{end:t,spec:{attrs:{className:r+"-line-background start"}}}),Vo(Vo({},i),{start:[Math.min(t[0]+1,n[0]),t[1]]})]:null}function Gl(e,t){for(var n=[];e;){var r=e.type;"paragraph"!==r&&"codeBlock"!==r||n.push(_l([pa(e),ha(e)-1],[da(e),fa(e)+1],t)),e=e.next}return n}var Jl={heading:function(e,t,n){var r=e.level,i=e.headingType,o=[_l(t,n,Pl,{level:r})];return"atx"===i?o.push(_l(t,ka(t,r),zl)):o.push(_l(xa(n,0),n,Pl,{seText:!0})),o},strong:$l,emph:$l,strike:$l,link:function(e,t,n){var r=e.lastChild,i=e.extendedAutolink,o=r?fa(r)+1:2;return i?[_l(t,n,Fl,{desc:!0})]:Ul(t,n,t,o)},image:function(e,t,n){var r=e.lastChild,i=r?fa(r)+1:3,o=ka(t,1);return _o([_l(t,o,ql)],Ul(t,n,o,i))},code:function(e,t,n){var r=e.tickCount,i=ka(t,r),o=ka(n,-r);return[_l(t,n,Hl),_l(t,i,Hl,{start:!0}),_l(i,o,Hl,{marked:!0}),_l(o,n,Hl,{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=[_l(xa(t,1),n,"codeBlock")];s&&p.push(_l(t,ka(t,u),zl)),a&&p.push(_l(ka(t,o),ka(t,o+l+a.length),ql)),new RegExp("^(\\s{0,4})("+s+"{"+o+",})").test(r)&&p.push(_l(xa(n,1),n,zl));var d=Wl(c,t,n,"code-block");return d?p.concat(d):p},blockQuote:function(e,t,n){var r=e.parent&&"blockQuote"!==e.parent.type?[_l(t,n,"blockQuote")]:[];if(e.firstChild){var i=[];"paragraph"===e.firstChild.type?i=function(e){for(var t=[];e;)t.push(_l([pa(e),ha(e)],[da(e),fa(e)+1],jl)),e=e.next;return t}(e.firstChild.firstChild):"list"===e.firstChild.type&&(i=Gl(e.firstChild,jl)),r=_o(_o([],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[Bl,Vo(Vo({},[{odd:!0},{even:!0}][t%2]),{listStyle:!0})]}(e),s=[_l.apply(void 0,_o([t,ka(t,r)],o))];return i&&(s.push(_l(ka(t,r),ka(t,r+3),"taskDelimiter")),s.push(_l(ka(t,r+1),ka(t,r+2),ql))),s.concat(Gl(e.firstChild,jl))},customBlock:function(e,t,n){var r=e,i=r.offset,o=r.syntaxLength,s=r.info,a=r.parent,l=i+o,c=[_l(xa(t,1),n,"customBlock")];c.push(_l(t,ka(t,l),zl)),s&&c.push(_l(ka(t,l),ka(t,o+s.length),ql)),c.push(_l(xa(n,1),n,zl));var u=Wl(a,t,n,"custom-block");return u?c.concat(u):c}},Kl={thematicBreak:"thematicBreak",table:"table",tableCell:"tableCell",htmlInline:"html"};function Zl(e,t,n,r){var i=e.type;return Cl(Jl[i])?Jl[i](e,t,n,r):Kl[i]?[_l(t,n,Kl[i])]:null}var Xl={};function Ql(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=Zs(t).sourcepos,o=i[1],s=[r[0],r[1]],a=[o[0],o[1]+1],l=[];return function(e,t,n){var r=[];Xl={};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&&!zs(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)Xl[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(ec(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)Xl[v]=!0})),function(e,t,n){var r=e.doc,i=t.nodes.paragraph,o=Al(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]+Dl(d,s[1]-1),m+=a[1]+Dl(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 Xl[u],c=Yl(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(Xl).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 Yl(e,t,n){return Object.keys(n).some((function(r){return n[r]!==e.child(t).attrs[r]}))}function ec(e,t){var n=t.getLineTexts(),r=[pa(e),ha(e)],i=[da(e),fa(e)+1],o=Zl(e,r,i,n[i[0]-1]);return null!==o&&void 0!==o?o:[]}var tc=["taskList","orderedList","bulletList","table","strong","emph","strike","heading","thematicBreak","blockQuote","code","codeBlock","indent","outdent"];function nc(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 ga(e)?e.listData.task?"taskList":"ordered"===e.listData.type?"orderedList":"bulletList":-1!==t.indexOf("table")?"table":zs(tc,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 rc(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=nc(p);n.emit("changeToolbarState",{cursorPos:u,mdNode:p,toolbarState:d}),n.emit("setFocusedNode",p)}}}}})}var ic=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return jo(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}(yl),oc=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 sc(e,t){return ac(e,t-1)}function ac(e,t){return e.child(t).textContent}var lc=/^\s*> ?/,cc=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return jo(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:rl("block-quote")},0]}}},enumerable:!1,configurable:!0}),t.prototype.createBlockQuoteText=function(e,t){return t?e.replace(lc,"").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=Il(r),l=a.endFromOffset,c=a.endToOffset,u=a.endIndex,p=a.to,d=ac(i,u);if(lc.test(d)&&p>l&&r.empty){if(!d.replace(lc,"").trim())o.deleteRange(l,c).split(o.mapping.map(c));else{var h=d.slice(p-l).trim();ua(o,c,h,sa(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=Il(r),s=o.startFromOffset,a=o.endToOffset,l=o.startIndex,c=o.endIndex,u=lc.test(ac(i,l)),p=ca({state:t,startIndex:l,endIndex:c,from:s,createText:function(t){return e.createBlockQuoteText(t,u)}});return n(p.setSelection(aa(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}(oc),uc=/(^\s*)([-*+] |[\d]+\. )/,pc=/(^\s*)([\d])+\.( \[[ xX]])? /,dc=/^(\s*)((\d+)([.)]\s(?:\[(?:x|\s)\]\s)?))(.*)/,hc=/(^\s*)([-*+]|[\d]+\.)( \[[ xX]])? /,fc=/^(\s*)([-*+]+(\s(?:\[(?:x|\s)\]\s)?))(.*)/,mc=/(^\s*)([-*+] |[\d]+\. )(\[[ xX]] )/,gc=/(^\s*)([-*+])( \[[ xX]]) /;function vc(e){return pc.test(e)?"ordered":"bullet"}function yc(e){for(var t=0;e&&"document"!==e.type;)"list"===e.type&&(t+=1),e=e.parent;return t}function bc(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=yc(a);if(l===n)o.push({line:s,depth:n,mdNode:a});else if(l<n)break}return o}function wc(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=sc(e,a);return l="bullet"===n?function(e){if(!uc.test(e))return"* "+e;var t=vc(e);return"bullet"===t&&hc.test(e)?e=e.replace(gc,"$1$2 "):"ordered"===t&&(e=e.replace(pc,"$1* ")),e}(l):function(e,t){if(!uc.test(e))return t+". "+e;var n=vc(e);if("bullet"===n||"ordered"===n&&hc.test(e))e=e.replace(hc,"$1"+t+". ");else if("ordered"===n){var r=dc.exec(e)[3];Number(r)!==t&&(e=e.replace(pc,"$1"+t+". "))}return e}(l,s+1+r),{text:l,line:a}}));return{changedResults:s,firstIndex:i,lastIndex:o}}function kc(e,t){var n=function(e){var t=e.toastMark,n=e.mdNode,r=e.line,i=yc(n),o=bc(t,r,i,!1).reverse(),s=bc(t,r,i,!0);return o.concat([{line:r,depth:i,mdNode:n}]).concat(s)}(t);return wc(t.doc,n,e)}var xc={bullet:function(e){return kc("bullet",e)},ordered:function(e){return kc("ordered",e)},task:function(e){var t=e.mdNode,n=e.doc,r=e.line,i=sc(n,r);return t.listData.task?i=i.replace(mc,"$1$2"):ga(t)&&(i=i.replace(uc,"$1$2[ ] ")),{changedResults:[{text:i,line:r}]}}},Cc={bullet:function(e){var t=e.doc,n=e.line;return{changedResults:[{text:"* "+sc(t,n),line:n}]}},ordered:function(e){for(var t=e.toastMark,n=e.doc,r=e.line,i=e.startLine,o=sc(n,r),s=1,a=i,l=0,c=i-1;c>0;c-=1){var u=t.findFirstNodeAtLine(c),p=sc(n,c)&&!!wa(u,(function(e){return ga(e)})),d=dc.exec(sc(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:"* [ ] "+sc(t,n),line:n}]}}},Tc={bullet:function(e){var t=e.line,n=sc(e.doc,t),r=fc.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=yc(r),s=sc(i,n),a=dc.exec(s),l=a[1],c=a[3],u=a[4],p=Number(c)+1,d=""+l+p+u,h=bc(t,n,o,!0).filter((function(e){var t=dc.exec(sc(i,e.line));return t&&t[1].length===l.length&&!!wa(e.mdNode,(function(e){return va(e)}))}));return Vo({listSyntax:d},wc(i,h,"ordered",p))}};function Ec(e,t,n,r,i){for(var o=[],s=sc(e,n),a=dc.exec(s);a;){var l=a[1],c=a[4],u=a[5],p=l.length;if(p===i)o.push(sa(t,""+l+r+c+u)),r+=1,n+=1;else if(p>i){var d=Ec(e,t,n,1,p);n=d.line,o=o.concat(d.nodes)}if(p<i||n>e.childCount)break;s=sc(e,n),a=dc.exec(s)}return{nodes:o,line:n}}var Mc=/(^\s{1,4})(.*)/;function Nc(e,t,n){return e<t||uc.test(n)||lc.test(n)}function Sc(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 Dc(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 aa(e,n,r)}var Lc=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return jo(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:rl(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&&!ya(u)&&"document"!==u.parent.type;)if(va(u=u.parent)){p=u;break}p&&(e=p.sourcepos[0][0]);var d=dc.exec(sc(c,e)),h=d[1],f=d[3],m=h.length,g=Ec(c,o,e,Number(f),m),v=g.line,y=g.nodes;t=Math.max(t,v-1);for(var b=Rl(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=aa(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=Il(o),l=a.from,c=a.to,u=a.startFromOffset,p=a.startIndex,d=a.endIndex;if(e&&Sc(s,i,o))return!1;var h=ac(s,p);if(e&&Nc(l,c,h)||!e&&uc.test(h)){var f=ca({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(Dc(f,m))),dc.test(h)&&t.reorderList(p+1,d+1)}else e&&r(n.tr.insert(c,sa(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=Il(i),l=a.from,c=a.to,u=a.startFromOffset,p=a.startIndex,d=a.endIndex;if(e&&Sc(o,s,i))return!1;var h=ac(o,p);if(e&&Nc(l,c,h)||!e&&uc.test(h)){var f=[],m=ca({state:n,from:u,startIndex:p,endIndex:d,createText:function(e){var t=Mc.exec(e);return f.push(t?t[1].length:0),e.replace(Mc,"$2")}}),g={type:"outdent",from:l,to:c,spaceLenList:f};r(m.setSelection(Dc(m,g))),dc.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=Il(t.selection),o=i.startFromOffset,s=i.endToOffset;return lo((function(){return n(t.tr.deleteRange(o,s)),!0}),Gi)(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=Il(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,sa(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=Il(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),sa(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}(yl),Ac=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return jo(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}(yl),Oc=/^#{1,6}\s/,Ic=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return jo(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:rl.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=Il(n.selection),s=o.startFromOffset,a=o.endToOffset,l=ca({state:n,from:s,startIndex:o.startIndex,endIndex:o.endIndex,createText:function(t){var n=t.match(Oc),r=n?n[0]:"";return e.createHeadingText(i,t,r)}});return r(l.setSelection(aa(l,l.mapping.map(a)))),!0}}},t}(oc),Rc="```",Pc=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return jo(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:rl("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=Il(n),s=o.startFromOffset,a=o.endToOffset,l=sa(r,Rc);return i.insert(s,l).split(s+3),i.split(i.mapping.map(a)).insert(i.mapping.map(a),l),t(i.setSelection(aa(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=Il(r),c=l.startFromOffset,u=l.endToOffset,p=l.endIndex,d=l.from,h=l.to,f=ac(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 ua(i,u,v,sa(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}(oc),Bc=/\||\s/g;function Fc(e,t){for(var n="|",r=0;r<e;r+=1)n+=t?" --- |":" |";return n}var Hc=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return jo(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:rl("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=Il(r),l=a.endFromOffset,c=a.endToOffset,u=a.endIndex,p=a.to,d=ac(i,u),h=[u+1,p-l+1],f=wa(e.context.toastMark.findNodeAtPosition(h),(function(e){return ba(e)&&("tableDelimRow"===e.parent.type||"tableBody"===e.parent.parent.type)}));if(f){var m=!d.replace(Bc,"").trim(),g=Fc(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),sa(s,g)).setSelection(aa(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=Il(i),a=s.endFromOffset,l=[s.endIndex+1,s.to-a],c=wa(t.context.toastMark.findNodeAtPosition(l),(function(e){return ba(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=fa(c);if(c[d])m=fa(c[d])-1;else{var g=u[d]||u.parent.type!==h?u[d]:u.parent[d][f];if("next"===d)m+=(g?fa(g[f]):0)+2;else"prev"===d&&(m=g?-4:0)}return r(o.setSelection(aa(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=Il(r).endToOffset,u=function(e){return[Fc(e),Fc(e,!0)]}(a),p=function(e,t){for(var n=[],r=0;r<t;r+=1)n.push(Fc(e));return n}(a,l-1);return _o(_o([],u),p).forEach((function(e){i.split(i.mapping.map(c)).insert(i.mapping.map(c),sa(o,e))})),n(i.setSelection(aa(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}(oc),qc=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return jo(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:rl("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=Il(n),s=o.from,a=o.to,l=o.endToOffset,c=sa(r,"***");return i.split(s).replaceWith(i.mapping.map(s),i.mapping.map(a),c).split(i.mapping.map(a)).setSelection(aa(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}(oc);function zc(e,t){var n=e.type;return t<=e.sourcepos[0][0]&&("codeBlock"===n||"heading"===n||n.match("table"))}var jc=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return jo(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:rl.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=Il(r),c=l.to,u=l.startFromOffset,p=l.endFromOffset,d=l.endIndex,h=l.endToOffset,f=ac(i,d);if(!uc.test(f)||r.from===u||!r.empty)return!1;if(!f.replace(hc,"").trim())s.deleteRange(p,h).split(s.mapping.map(h));else{var m=vc(f),g=a.findFirstNodeAtLine(d+1),v=f.slice(c-p),y={toastMark:a,mdNode:g,doc:i,line:d+1},b=Tc[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:Zs(k).line});var x=s.mapping.map(h)-v.length;s.setSelection(aa(s,x))}else{ua(s,h,v,sa(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=Il(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&&zc(f,h))break;if(-1===d.indexOf(h)){var m={toastMark:a,mdNode:f,doc:i,line:h,startLine:c},g=(ga(f)?xc[e](m):Cc[e](m)).changedResults,v=t.changeToListPerLine(o,g,{from:Rl(i,g[0].line-1).startOffset,startLine:g[0].line,endLine:Zs(g).line,indexDiff:1});p=Math.max(v,p),g&&(d=d.concat(g.map((function(e){return e.line}))))}}return r(o.setSelection(aa(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,sa(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=Il(r),c=l.startIndex,u=l.endIndex,p=null,d=c;d<=u;d+=1){var h=a.findFirstNodeAtLine(d+1);if(ga(h)&&h.listData.task){var f=h.listData,m=f.checked,g=f.padding,v=m?" ":"x",y=h.sourcepos[0],b=Rl(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}(oc);function Vc(e,t){return function(){return function(n,r){var i=n.tr,o=n.selection,s=Cl(e)?e:function(t){return e.test(t)},a=t.length,l=i.doc,c=Nl(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?aa(i,u+a):aa(i,u+a,p+a);i.setSelection(y)}return r(i),!0}}}var _c=/^(\*{2}|_{2}).*([\s\S]*)\1$/m,$c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return jo(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:rl("strong")},0]}}},enumerable:!1,configurable:!0}),t.prototype.bold=function(){return Vc(_c,"**")},t.prototype.commands=function(){return{bold:this.bold()}},t.prototype.keymaps=function(){var e=this.bold()();return{"Mod-b":e,"Mod-B":e}},t}(oc),Uc=/^(~{2}).*([\s\S]*)\1$/m,Wc=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return jo(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:rl("strike")},0]}}},enumerable:!1,configurable:!0}),t.prototype.commands=function(){return Vc(Uc,"~~")},t.prototype.keymaps=function(){var e=this.commands()();return{"Mod-s":e,"Mod-S":e}},t}(oc),Gc=/^(\*|_).*([\s\S]*)\1$/m,Jc=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return jo(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:rl("emph")},0]}}},enumerable:!1,configurable:!0}),t.prototype.italic=function(){return Vc(Gc,"*")},t.prototype.commands=function(){return{italic:this.italic()}},t.prototype.keymaps=function(){var e=this.italic()();return{"Mod-i":e,"Mod-I":e}},t}(oc),Kc=/^(`).*([\s\S]*)\1$/m,Zc=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return jo(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:rl.apply(void 0,n.split("|"))},0]}}},enumerable:!1,configurable:!0}),t.prototype.commands=function(){return Vc(Kc,"`")},t.prototype.keymaps=function(){var e=this.commands()();return{"Shift-Mod-c":e,"Shift-Mod-C":e}},t}(oc),Xc=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return jo(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:rl.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=Nl(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=Us(m))+"]("+g+")",r(o.replaceWith(l,c,sa(s,v))),!0}}},t.prototype.commands=function(){return{addImage:this.addLinkOrImage("image"),addLink:this.addLinkOrImage("link")}},t}(oc),Qc=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return jo(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:rl("delimiter","list-item")},0]}}},enumerable:!1,configurable:!0}),t}(oc),Yc=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return jo(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:rl("delimiter")},0]}}},enumerable:!1,configurable:!0}),t}(oc),eu=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return jo(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:rl("meta")},0]}}},enumerable:!1,configurable:!0}),t}(oc),tu=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return jo(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:rl("marked-text")},0]}}},enumerable:!1,configurable:!0}),t}(oc),nu=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return jo(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:rl("table-cell")},0]}}},enumerable:!1,configurable:!0}),t}(oc),ru=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return jo(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:rl("html")},0]}}},enumerable:!1,configurable:!0}),t}(oc),iu="$$",ou=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return jo(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:rl("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=Il(r),a=s.startFromOffset,l=s.endToOffset;if(!(null===e||void 0===e?void 0:e.info))return!1;var c="$$"+e.info,u=sa(i,c),p=sa(i,iu);return o.insert(a,u).split(a+c.length),o.split(o.mapping.map(l)).insert(o.mapping.map(l),p),n(o.setSelection(aa(o,o.mapping.map(l)-4))),!0}}},t}(oc),su=/x|backspace/i,au=/^\[(\s*)(x?)(\s*)\](?:\s+)/i;function lu(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&&su.test(r.key)){var c=Il(l),u=c.startIndex,p=c.startFromOffset,d=[u+1,c.from-p+1],h=wa(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(au);if(m){var g=f.sourcepos[0],v=m[1],y=m[2],b=m[3],w=v.length+b.length,k=Rl(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 cu="cut",uu=/\r\n|\n|\r/,pu=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(Vo(Vo({},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 jo(t,e),t.prototype.toggleActive=function(e,t){sl(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=nl("pseudo-clipboard"),this.clipboard.addEventListener("paste",(function(t){var n=t.clipboardData||window.clipboardData,r=n&&n.items;if(r){var i=ia(r).some((function(e){return"string"===e.kind&&"text/rtf"===e.type}));if(!i){var o=gl(r);o&&(t.preventDefault(),ml(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 Ml([new ic,new Lc,new kl,new Ac,new Ic,new cc,new Pc,new ou,new Hc,new nu,new qc,new jc,new $c,new Wc,new Jc,new Zc,new Xc,new Yc,new Qc,new tu,new eu,new ru])},t.prototype.createPlugins=function(){return _o([Ql(this.context),rc(this.context),lu(this.context)],this.createPluginProps()).concat(this.defaultPlugins)},t.prototype.createView=function(){var e=this;return new Ei(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,cu)},scroll:function(){return e.eventEmitter.emit("scroll","editor"),!0},keyup:function(t,n){return e.eventEmitter.emit("keyup",e.editorType,n),!1}},nodeViews:{widget:bl}})},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===cu&&this.view.dispatch(i.deleteSelection().scrollIntoView().setMeta("uiEvent",cu)),!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=Ll(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=Ol(n.doc,e,t),i=r[0],o=r[1];this.view.dispatch(n.setSelection(aa(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(uu).map((function(e){return oa(s,Pa(e,s))})),u=new m(c.from(l),1,1);if(this.focus(),t&&n){var p=Ol(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=Ol(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=Ol(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 Ll(this.view.state.tr.doc,t,n)},t.prototype.setMarkdown=function(e,t){void 0===t&&(t=!0);var n=e.split(uu),r=this.view.state,i=r.tr,o=r.doc,s=r.schema,a=n.map((function(e){return oa(s,Pa(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?Ol(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=Ol(r.doc,e,t),a=Pa(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||Ll(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 Da(e)})).join("\n")},t.prototype.getToastMark=function(){return this.toastMark},t}(xl),du="_feEventKey";var hu=function(e,t){var n,r=e[du];return r||(r=e[du]={}),(n=r[t])||(n=r[t]=[]),n},fu=Go,mu=Yo,gu=hu;function vu(e,t,n){var r,i=gu(e,t);n?(mu(i,(function(i,o){return n!==i.handler||(yu(e,t,i.wrappedHandler),r=o,!1)})),i.splice(r,1)):(mu(i,(function(n){yu(e,t,n.wrappedHandler)})),i.splice(0,i.length))}function yu(e,t,n){"removeEventListener"in e?e.removeEventListener(t,n):"detachEvent"in e&&e.detachEvent("on"+t,n)}var bu=function(e,t,n){fu(t)?mu(t.split(/\s+/g),(function(t){vu(e,t,n)})):mu(t,(function(t,n){vu(e,n,t)}))},wu=Go,ku=Yo,xu=hu;function Cu(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=xu(e,t),o=!1;ku(i,(function(e){return e.handler!==n||(o=!0,!1)})),o||i.push({handler:n,wrappedHandler:r})}(e,t,n,i)}var Tu=function(e,t,n,r){wu(t)?ku(t.split(/\s+/g),(function(t){Cu(e,t,n,r)})):ku(t,(function(t,r){Cu(e,r,t,n)}))},Eu=function(e,t){return Eu=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])},Eu(e,t)};function Mu(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}Eu(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var Nu=function(){return Nu=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},Nu.apply(this,arguments)};function Su(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 Du="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window?window:"undefined"!==typeof n.g?n.g:"undefined"!==typeof self?self:{},Lu={};function Au(e,t,n){var r,i,o,s,a,l="";for("string"!==typeof t&&(n=t,t=Au.defaultChars),"undefined"===typeof n&&(n=!0),a=function(e){var t,n,r=Lu[e];if(r)return r;for(r=Lu[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}Au.defaultChars=";/?:@&=+$,-_.!~*'()#",Au.componentChars="-_.!~*'()";var Ou=Au,Iu={},Ru={},Pu={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"},Bu={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"},Fu={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'},Hu={},qu=Du&&Du.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Hu,"__esModule",{value:!0});var zu=qu({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}),ju=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)};Hu.default=function(e){return e>=55296&&e<=57343||e>1114111?"\ufffd":(e in zu.default&&(e=zu.default[e]),ju(e))};var Vu=Du&&Du.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ru,"__esModule",{value:!0}),Ru.decodeHTML=Ru.decodeHTMLStrict=Ru.decodeXML=void 0;var _u=Vu(Pu),$u=Vu(Bu),Uu=Vu(Fu),Wu=Vu(Hu),Gu=/&(?:[a-zA-Z0-9]+|#[xX][\da-fA-F]+|#\d+);/g;function Ju(e){var t=Zu(e);return function(e){return String(e).replace(Gu,t)}}Ru.decodeXML=Ju(Uu.default),Ru.decodeHTMLStrict=Ju(_u.default);var Ku=function(e,t){return e<t?1:-1};function Zu(e){return function(t){if("#"===t.charAt(1)){var n=t.charAt(2);return"X"===n||"x"===n?Wu.default(parseInt(t.substr(3),16)):Wu.default(parseInt(t.substr(2),10))}return e[t.slice(1,-1)]||t}}Ru.decodeHTML=function(){for(var e=Object.keys($u.default).sort(Ku),t=Object.keys(_u.default).sort(Ku),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=Zu(_u.default);function s(e){return";"!==e.substr(-1)&&(e+=";"),o(e)}return function(e){return String(e).replace(i,s)}}();var Xu={},Qu=Du&&Du.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Xu,"__esModule",{value:!0}),Xu.escapeUTF8=Xu.escape=Xu.encodeNonAsciiHTML=Xu.encodeHTML=Xu.encodeXML=void 0;var Yu=op(Qu(Fu).default),ep=sp(Yu);Xu.encodeXML=pp(Yu);var tp,np,rp=op(Qu(Pu).default),ip=sp(rp);function op(e){return Object.keys(e).sort().reduce((function(t,n){return t[e[n]]="&"+n+";",t}),{})}function sp(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")}Xu.encodeHTML=(tp=rp,np=ip,function(e){return e.replace(np,(function(e){return tp[e]})).replace(ap,cp)}),Xu.encodeNonAsciiHTML=pp(rp);var ap=/(?:[\x80-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/g,lp=null!=String.prototype.codePointAt?function(e){return e.codePointAt(0)}:function(e){return 1024*(e.charCodeAt(0)-55296)+e.charCodeAt(1)-56320+65536};function cp(e){return"&#x"+(e.length>1?lp(e):e.charCodeAt(0)).toString(16).toUpperCase()+";"}var up=new RegExp(ep.source+"|"+ap.source,"g");function pp(e){return function(t){return t.replace(up,(function(t){return e[t]||cp(t)}))}}Xu.escape=function(e){return e.replace(up,cp)},Xu.escapeUTF8=function(e){return e.replace(ep,cp)},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=Ru,n=Xu;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=Xu;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=Ru;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}})}(Iu);var dp="&(?:#x[a-f0-9]{1,6}|#[0-9]{1,7}|[a-z][a-z0-9]{1,31});",hp=/[\\&]/,fp="[!\"#$%&'()*+,./:;<=>?@[\\\\\\]^_`{|}~-]",mp=new RegExp("\\\\"+fp+"|"+dp,"gi"),gp=new RegExp('[&<>"]',"g"),vp=function(e){return 92===e.charCodeAt(0)?e.charAt(1):Iu.decodeHTML(e)};function yp(e){return hp.test(e)?e.replace(mp,vp):e}function bp(e){try{return Ou(e)}catch(t){return e}}function wp(e){switch(e){case"&":return"&amp;";case"<":return"&lt;";case">":return"&gt;";case'"':return"&quot;";default:return e}}function kp(e){return gp.test(e)?e.replace(gp,wp):e}function xp(e,t){for(var n=[],r=0;r<t;r++)n.push(e);return n.join("")}function Cp(e){return!e||!/[^ \t]+/.test(e)}var Tp=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=Ep(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 Ep(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 Mp=1,Np={};function Sp(e){delete Np[e]}var Dp=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:Mp++,this.type=e,this.sourcepos=t,Np[this.id]=this}return e.prototype.isContainer=function(){return Ep(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 Tp(this)},e}(),Lp=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 Mu(t,e),t}(Dp),Ap=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.listData=null,t}return Mu(t,e),t}(Lp),Op=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.level=0,t.headingType="atx",t}return Mu(t,e),t}(Lp),Ip=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 Mu(t,e),t}(Lp),Rp=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.columns=[],t}return Mu(t,e),t}(Lp),Pp=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 Mu(t,e),t}(Lp),Bp=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.title="",t.dest="",t.label="",t}return Mu(t,e),t}(Lp),Fp=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.syntaxLength=0,t.offset=-1,t.info="",t}return Mu(t,e),t}(Lp),Hp=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.htmlBlockType=-1,t}return Mu(t,e),t}(Lp),qp=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 Mu(t,e),t}(Dp),zp=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.tickCount=0,t}return Mu(t,e),t}(Dp),jp=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.info="",t}return Mu(t,e),t}(Dp);function Vp(e,t){switch(e){case"heading":return new Op(e,t);case"list":case"item":return new Ap(e,t);case"link":case"image":return new qp(e,t);case"codeBlock":return new Ip(e,t);case"htmlBlock":return new Hp(e,t);case"table":return new Rp(e,t);case"tableCell":return new Pp(e,t);case"document":case"paragraph":case"blockQuote":case"thematicBreak":case"tableRow":case"tableBody":case"tableHead":case"frontMatter":return new Lp(e,t);case"code":return new zp(e,t);case"refDef":return new Bp(e,t);case"customBlock":return new Fp(e,t);case"customInline":return new jp(e,t);default:return new Dp(e,t)}}function _p(e){return"codeBlock"===e.type}function $p(e){return"list"===e.type}function Up(e){return"refDef"===e.type}function Wp(e){return"customBlock"===e.type}function Gp(e,t){var n=Vp("text",t);return n.literal=e,n}var Jp,Kp="[A-Za-z][A-Za-z0-9-]*",Zp="<"+Kp+"(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^\"'=<>`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)*\\s*/?>",Xp="</"+Kp+"\\s*[>]",Qp=new RegExp("^"+("(?:"+Zp+"|"+Xp+"|\x3c!----\x3e|\x3c!--(?:-?[^>-])(?:-?[^-])*--\x3e|[<][?].*?[?][>]|<![A-Z]+\\s+[^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)"),"i");if(String.fromCodePoint)Jp=function(e){try{return String.fromCodePoint(e)}catch(t){if(t instanceof RangeError)return String.fromCharCode(65533);throw t}};else{var Yp=String.fromCharCode,ed=Math.floor;Jp=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||ed(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+=Yp.apply(void 0,i),i.length=0)}return a}}var td=Jp,nd="(?:[w-]+.)*[A-Za-z0-9-]+.[A-Za-z0-9-]+",rd="[^<\\s]*[^<?!.,:*_?~\\s]",id="[\\w.+-]+@(?:[\\w-]+\\.)+[\\w-]+";function od(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 sd(e){return e.replace(/&[A-Za-z0-9]+;$/,"")}function ad(e){return Su(Su([],function(e){for(var t,n=new RegExp("(www|https?://)."+nd+rd,"g"),r=[];t=n.exec(e);){var i=sd(od(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(id,"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 ld(e){return e[e.length-1]}function cd(e){return e.slice(1,e.length-1).trim().replace(/[ \t\r\n]+/," ").toLowerCase().toUpperCase()}function ud(e,t){Object.keys(e).forEach((function(n){t(n,e[n])}))}function pd(e){return!Object.keys(e).length}var dd=126,hd=39,fd=34,md=36,gd="\\\\"+fp,vd=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]/),yd=new RegExp('^(?:"('+gd+'|[^"\\x00])*"|\'('+gd+"|[^'\\x00])*'|\\(("+gd+"|[^()\\x00])*\\))"),bd=/^(?:<(?:[^<>\n\\\x00]|\\.)*>)/,wd=new RegExp("^"+fp),kd=new RegExp("^"+dp,"i"),xd=/`+/,Cd=/^`+/,Td=/\.\.\./g,Ed=/--+/g,Md=/^<([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])?)*)>/,Nd=/^<[A-Za-z][A-Za-z0-9.+-]{1,31}:[^<>\x00-\x20]*>/i,Sd=/^ *(?:\n *)?/,Dd=/^[ \t\n\x0b\x0c\x0d]/,Ld=/^\s/,Ad=/ *$/,Od=/^ */,Id=/^ *(?:\n|$)/,Rd=/^\[(?:[^\\\[\]]|\\.){0,1000}\]/,Pd=/^[^\n`\[\]\\!<&*_'"~$]+/m,Bd=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(Sd),!0},e.prototype.parseBackticks=function(e){var t=this.pos+1,n=this.match(Cd);if(null===n)return!1;for(var r,i=this.pos;null!==(r=this.match(xd));)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=ld(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=Vp("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(Gp(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=Vp("linebreak",this.sourcepos(this.pos-1,this.pos)),e.appendChild(t),this.nextLine()):wd.test(n.charAt(this.pos))?(e.appendChild(Gp(n.charAt(this.pos),this.sourcepos(r,this.pos))),this.pos+=1):e.appendChild(Gp("\\",this.sourcepos(r,r))),!0},e.prototype.parseAutolink=function(e){var t,n,r,i=this.pos+1;return(t=this.match(Md))?(n=t.slice(1,t.length-1),(r=Vp("link",this.sourcepos(i,this.pos))).destination=bp("mailto:"+n),r.title="",r.appendChild(Gp(n,this.sourcepos(i+1,this.pos-1))),e.appendChild(r),!0):!!(t=this.match(Nd))&&(n=t.slice(1,t.length-1),(r=Vp("link",this.sourcepos(i,this.pos))).destination=bp(n),r.title="",r.appendChild(Gp(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(Qp);if(null===n)return!1;var r=Vp("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===hd||e===fd)t++,this.pos++;else for(;this.peek()===e;)t++,this.pos++;if(0===t||t<2&&(e===dd||e===md))return this.pos=n,null;var r,i=0===n?"\n":this.subject.charAt(n-1),o=this.peek();r=-1===o?"\n":td(o);var s,a,l=Ld.test(r),c=vd.test(r),u=Ld.test(i),p=vd.test(i),d=!l&&(!c||u||p),h=!u&&(!p||l||c);return 95===e?(s=d&&(!h||p),a=h&&(!d||c)):e===hd||e===fd?(s=d&&!h,a=h):e===md?(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=Gp(e===hd?"\u2019":e===fd?"\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!==hd&&e!==fd)&&(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===dd||u===md)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===md&&(f="customInline");var m=Vp(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===md){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===hd?(r.node.literal="\u2019",a&&(n.node.literal="\u2018"),r=r.next):u===fd&&(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(yd);return null===e?null:yp(e.substr(1,e.length-2))},e.prototype.parseLinkDestination=function(){var e=this.match(bd);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&&wd.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!==Dd.exec(td(r)))break;this.pos+=1}return this.pos===t&&41!==r||0!==n?null:bp(yp(e=this.subject.substr(t,this.pos-t)))}return bp(yp(e.substr(1,e.length-2)))},e.prototype.parseLinkLabel=function(){var e=this.match(Rd);return null===e||e.length>1001?0:e.length},e.prototype.parseOpenBracket=function(e){var t=this.pos;this.pos+=1;var n=Gp("[",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=Gp("![",this.sourcepos(this.pos-1,this.pos));e.appendChild(n),this.addBracket(n,t+1,!0)}else{n=Gp("!",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(Gp("]",this.sourcepos(i,i))),!0;if(!o.active)return e.appendChild(Gp("]",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()&&(Dd.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=cd(l);var p=this.refMap[l];p&&(t=p.destination,n=p.title,r=!0)}}if(r){var d=Vp(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(Gp("]",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(kd))&&(e.appendChild(Gp(Iu.decodeHTML(t),this.sourcepos(n,this.pos))),!0)},e.prototype.parseString=function(e){var t,n=this.pos+1;if(t=this.match(Pd)){if(this.options.smart){var r=t.replace(Td,"\u2026").replace(Ed,(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),xp("\u2014",n)+xp("\u2013",t)}));e.appendChild(Gp(r,this.sourcepos(n,this.pos)))}else{var i=Gp(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(Ad,"");var i=r-t.literal.length;t.sourcepos[1][1]-=i,e.appendChild(Vp(n?"linebreak":"softbreak",this.sourcepos(this.pos-i,this.pos)))}else e.appendChild(Vp("softbreak",this.sourcepos(this.pos,this.pos)));return this.nextLine(),this.match(Od),!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(Id)&&(""===n?l=!1:(n="",this.pos=a,l=null!==this.match(Id))),!l)return this.pos=r,0;var c=cd(o);if(""===c)return this.pos=r,0;var u=this.getReferenceDefSourcepos(e);e.sourcepos[0][0]=u[1][0]+1;var p=Vp("refDef",u);return p.title=n,p.dest=s,p.label=c,e.insertBefore(p),t[c]?this.refDefCandidateMap[p.id]=p:t[c]=Ah(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(Dd.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 dd:case md:n=this.handleDelim(r,e);break;case hd:case fd: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(Gp(td(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=ad);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(Gp(i.substring(s,m[0]),u(s,m[0]-1)));var y=Vp("link",u.apply(void 0,m));y.appendChild(Gp(v,u.apply(void 0,m))),y.destination=g,y.extendedAutolink=!0,p.push(y),s=m[1]+1}s<i.length&&p.push(Gp(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}(),Fd=/^\[([ \txX])\][ \t]+/;var Hd=9,qd=32,zd=/[^ \t\f\v\r\n]/,jd=/^(?:`{3,}|~{3,})(?= *$)/;function Vd(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 _d(e,t){return t<e.length?e.charCodeAt(t):-1}function $d(e){return!zd.test(e)}function Ud(e){return e===qd||e===Hd}var Wd=/^\$\$$/,Gd={continue:function(e,t){var n=e.currentLine,r=n.match(Wd);if(r)return e.lastLineLength=r[0].length,e.finalize(t,e.lineNumber),2;for(var i=t.offset;i>0&&Ud(_d(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=yp(s[2].trim()),t.literal=o,t.stringContent=null}},canContain:function(){return!1},acceptsLines:!0},Jd={continue:function(){return 1},finalize:function(){},canContain:function(){return!1},acceptsLines:!0},Kd={continue:function(){return 0},finalize:function(e,t){for(var n=t.firstChild;n;){if(Vd(n)&&n.next){t.listData.tight=!1;break}for(var r=n.firstChild;r;){if(Vd(r)&&(n.next||r.next)){t.listData.tight=!1;break}r=r.next}n=n.next}},canContain:function(e){return"item"===e},acceptsLines:!1},Zd={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(Fd);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},Xd={continue:function(e,t){var n=e.currentLine,r=e.indent;if(t.isFenced){var i=r<=3&&n.charAt(e.nextNonspace)===t.fenceChar&&n.slice(e.nextNonspace).match(jd);if(i&&i[0].length>=t.fenceLength)return e.lastLineLength=e.offset+r+i[0].length,e.finalize(t,e.lineNumber),2;for(var o=t.fenceOffset;o>0&&Ud(_d(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=yp(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},Qd={continue:function(e){return e.blank?1:0},finalize:function(e,t){if(null!==t.stringContent){for(var n,r=!1;91===_d(t.stringContent,0)&&(n=e.inlineParser.parseReference(t,e.refMap));)t.stringContent=t.stringContent.slice(n),r=!0;r&&$d(t.stringContent)&&t.unlink()}},canContain:function(){return!1},acceptsLines:!0},Yd={document:{continue:function(){return 0},finalize:function(){},canContain:function(e){return"item"!==e},acceptsLines:!1},list:Kd,blockQuote:{continue:function(e){var t=e.currentLine;return e.indented||62!==_d(t,e.nextNonspace)?1:(e.advanceNextNonspace(),e.advanceOffset(1,!1),Ud(_d(t,e.offset))&&e.advanceOffset(1,!0),0)},finalize:function(){},canContain:function(e){return"item"!==e},acceptsLines:!1},item:Zd,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:Xd,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:Qd,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:Jd,customBlock:Gd,frontMatter:Jd};function eh(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&&Cp(o)?n=i+1:r.push(o),t=i+1}t<e.length&&(Cp(o=e.substring(t,e.length))||r.push(o));return[n,r]}function th(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=Vp(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 nh(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 rh=/^(\$\$)(\s*[a-zA-Z])+/,ih=/^(\$\$)(\s*[a-zA-Z])+.*(\$\$)/,oh=/^`{3,}(?!.*`)|^~{3,}/,sh=[/./,/^<(?: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("^(?:"+Zp+"|"+Xp+")\\s*$","i")],ah=/^(?:=+|-+)[ \t]*$/,lh=/^#{1,6}(?:[ \t]+|$)/,ch=/^(?:(?:\*[ \t]*){3,}|(?:_[ \t]*){3,}|(?:-[ \t]*){3,})[ \t]*$/,uh=/^[*+-]/,ph=/^(\d{1,9})([.)])/;function dh(e,t){return e.options.disallowDeepHeading&&("blockQuote"===t.type||"item"===t.type)}var hh=[function(e){return e.indented||62!==_d(e.currentLine,e.nextNonspace)?0:(e.advanceNextNonspace(),e.advanceOffset(1,!1),Ud(_d(e.currentLine,e.offset))&&e.advanceOffset(1,!0),e.closeUnmatchedBlocks(),e.addChild("blockQuote",e.nextNonspace),1)},function(e,t){var n;if(!e.indented&&!dh(e,t)&&(n=e.currentLine.slice(e.nextNonspace).match(lh))){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(oh))){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===_d(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(sh[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&&!dh(e,t.parent)&&(n=e.currentLine.slice(e.nextNonspace).match(ah))){e.closeUnmatchedBlocks();for(var r=void 0;91===_d(t.stringContent,0)&&(r=e.inlineParser.parseReference(t,e.refMap));)t.stringContent=t.stringContent.slice(r);if(t.stringContent.length>0){var i=Vp("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&&ch.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(uh))o.type="bullet",o.bulletChar=n[0][0];else{if(!(n=i.match(ph))||"paragraph"===t.type&&"1"!==n[1])return null;o.type="ordered",o.start=parseInt(n[1],10),o.delimiter=n[2]}if(-1!==(r=_d(e.currentLine,e.nextNonspace+n[0].length))&&r!==Hd&&r!==qd)return null;if("paragraph"===t.type&&!e.currentLine.slice(e.nextNonspace+n[0].length).match(zd))return null;e.advanceNextNonspace(),e.advanceOffset(n[0].length,!0);var s=e.column,a=e.offset;do{e.advanceOffset(1,!0),r=_d(e.currentLine,e.offset)}while(e.column-s<5&&Ud(r));var l=-1===_d(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,Ud(_d(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=eh(o),l=a[0],c=a[1],u=eh(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=ld(f)+1,v=Vp("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=Vp("tableHead",[[m,g],[e.lineNumber,e.offset]]);v.appendChild(b);var w=Vp("tableRow",[[m,g],[m,g+o.length-1]]),k=Vp("tableDelimRow",[[e.lineNumber,e.nextNonspace+1],[e.lineNumber,e.offset]]);b.appendChild(w),b.appendChild(k),th("tableCell",c,m,g+l).forEach((function(e){w.appendChild(e)}));var x=th("tableDelimCell",d,e.lineNumber,e.nextNonspace+1+p);return x.forEach((function(e){k.appendChild(e)})),v.columns=x.map(nh),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=Vp("tableRow",[[e.lineNumber,e.nextNonspace+1],[e.lineNumber,e.currentLine.length]]);r.appendChild(i);var o=r.parent,s=eh(e.currentLine.slice(e.nextNonspace)),a=s[0];return th("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&&!ih.test(e.currentLine)&&(t=e.currentLine.match(rh))){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}],fh=/^(-{3}|\+{3}|;{3})$/,mh=function(e,t){var n=e.currentLine,r=e.lineNumber,i=e.indented;return 1===r&&!i&&"document"===t.type&&fh.test(n)?(e.closeUnmatchedBlocks(),e.addChild("frontMatter",e.nextNonspace).stringContent=n,e.advanceNextNonspace(),e.advanceOffset(n.length,!1),2):0},gh={continue:function(e,t){var n=e.currentLine,r=n.match(fh);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},vh=[/./,/<\/(?:script|pre|style)>/i,/-->/,/\?>/,/>/,/\]\]>/],yh=/^[#`~*+_=<>0-9-;$]/,bh=/\r\n|\n|\r/;function wh(){return Vp("document",[[1,1],[0,0]])}var kh={smart:!1,tagFilter:!1,extendedAutolinks:!1,disallowedHtmlBlockTags:[],referenceDefinition:!1,disallowDeepHeading:!1,customParser:null,frontMatter:!1},xh=function(){function e(e){this.options=Nu(Nu({},kh),e),this.doc=wh(),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&&(Yd.frontMatter=gh,hh.unshift(mh)),this.inlineParser=new Bd(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+=xp(" ",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(;!Yd[this.tip.type].canContain(e);)this.finalize(this.tip,this.lineNumber-1);var n=t+1,r=Vp(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],Yd[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(),Yd[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&&Yd[t.type].acceptsLines,o=hh.length;!i;){if(this.findNextNonspace(),"table"!==t.type&&"tableBody"!==t.type&&"paragraph"!==t.type&&!this.indented&&!yh.test(e.slice(this.nextNonspace))){this.advanceNextNonspace();break}for(var s=0;s<o;){var a=hh[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||_p(t)&&t.isFenced||"item"===l&&!t.firstChild&&t.sourcepos[0][0]===this.lineNumber),u=t;u;)u.lastLineBlank=c,u=u.parent;Yd[l].acceptsLines?(this.addLine(),"htmlBlock"===t.type&&t.htmlBlockType>=1&&t.htmlBlockType<=5&&vh[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=wh(),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(bh),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=wh(),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 Ch(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 Th(e,t){var n=e[0];return 1===Ch(e[1],t)?1:-1===Ch(n,t)?-1:0}function Eh(e,t){for(var n=0,r=t;n<r.length;n++){var i=r[n];e.insertBefore(i)}}function Mh(e,t){var n=e[0];return e[1][0]<t?1:n[0]>t?-1:0}function Nh(e,t){for(var n=e.firstChild;n;){var r=Mh(n.sourcepos,t);if(0===r)return n;if(-1===r)return n.prev||n;n=n.next}return e.lastChild}function Sh(e){return function(e){return Np[e]}(e)||null}function Dh(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 Lh=/\r\n|\n|\r/;function Ah(e){return{id:e.id,title:e.title,sourcepos:e.sourcepos,unlinked:!1,destination:e.dest}}var Oh=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 xh(t),this.parser.setRefMaps(this.refMap,this.refLinkCandidateMap,this.refDefCandidateMap),this.eventHandlerMap={change:[]},e=e||"",this.lineTexts=e.split(Lh),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(Lh),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,Su([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?(Eh(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]&&(Sp(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 Sp(e)})),e.unlink()):t?(Eh(t,n),Sp(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=Nh(this.root,e[0]),r=Nh(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&&($p(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 uh.test(n)||ph.test(n)}(this.lineTexts[n-1])||"table"===e.prev.type&&(!$d(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&&_p(l)&&l.open,u=l&&Wp(l)&&l.open,p=l&&$p(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&&Up(e)||t&&Up(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(!pd(this.refMap)){var r=function(e){if(Up(e)){var t=n.refMap[e.label];t&&e.id===t.id&&(t.unlinked=!0)}};e&&Dh(r,e.parent,t),t&&Dh(r,t)}},e.prototype.replaceWithNewRefDefState=function(e){var t=this;if(!pd(this.refMap)){var n=function(e){if(Up(e)){var n=e.label,r=t.refMap[n];r&&!r.unlinked||(t.refMap[n]=Ah(e))}};e.forEach((function(e){Dh(n,e)}))}},e.prototype.replaceWithRefDefCandidate=function(){var e=this;pd(this.refDefCandidateMap)||ud(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]=Ah(n))}))},e.prototype.getRangeWithRefDef=function(e,t,n,r,i){if(this.referenceDefinition&&!pd(this.refMap)){var o=Nh(this.root,e-1),s=Nh(this.root,t+1);o&&Up(o)&&o!==n&&o!==r&&(e=(n=o).sourcepos[0][0]),s&&Up(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 pd(this.refMap)||ud(this.refMap,(function(n,r){r.unlinked&&delete e.refMap[n],ud(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(){pd(this.refDefCandidateMap)||[this.refLinkCandidateMap,this.refDefCandidateMap].forEach((function(e){ud(e,(function(t){(function(e){var t=Sh(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=Nu({},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=Th(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=Mh(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 Sh(e)},e.prototype.removeAllNode=function(){Np={}},e}(),Ih=new RegExp("<(/?(?:"+["title","textarea","style","xmp","iframe","noembed","noframes","script","plaintext"].join("|")+")[^>]*>)","ig");function Rh(e){return Ih.test(e)?e.replace(Ih,(function(e,t){return"&lt;"+t})):e}var Ph={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?Rh(e.literal):e.literal}},htmlBlock:function(e,t){var n=t.options,r=n.tagFilter?Rh(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-"+kp(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:Nu({href:kp(i)},r&&{title:kp(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:Nu({src:kp(s),alt:n(e)},o&&{title:kp(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"}]}},Bh={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:Nu(Nu({},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?Nu({type:"openTag",tagName:i,outerNewLine:!0},s&&{attributes:s}):{type:"closeTag",tagName:i,outerNewLine:!0}}},Fh={softbreak:"\n",gfm:!1,tagFilter:!1,nodeId:!1};function Hh(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 qh=function(){function e(e){this.buffer=[],this.options=Nu(Nu({},Fh),e),this.convertors=this.createConvertors(),delete this.options.convertors}return e.prototype.createConvertors=function(){var e=Nu({},Ph);if(this.options.gfm&&(e=Nu(Nu({},e),Bh)),this.options.convertors){var t=this.options.convertors,n=Object.keys(t),r=Nu(Nu({},Ph),Bh);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:!Ep(e),options:o.options,getChildrenText:Hh,skipChildren:function(){a=!0}},c=Wp(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"!==ld(ld(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(kp(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 zh=Object.hasOwnProperty,jh=Object.setPrototypeOf,Vh=Object.isFrozen,_h=Object.getPrototypeOf,$h=Object.getOwnPropertyDescriptor,Uh=Object.freeze,Wh=Object.seal,Gh=Object.create,Jh="undefined"!==typeof Reflect&&Reflect,Kh=Jh.apply,Zh=Jh.construct;Kh||(Kh=function(e,t,n){return e.apply(t,n)}),Uh||(Uh=function(e){return e}),Wh||(Wh=function(e){return e}),Zh||(Zh=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 Xh,Qh=cf(Array.prototype.forEach),Yh=cf(Array.prototype.pop),ef=cf(Array.prototype.push),tf=cf(String.prototype.toLowerCase),nf=cf(String.prototype.match),rf=cf(String.prototype.replace),of=cf(String.prototype.indexOf),sf=cf(String.prototype.trim),af=cf(RegExp.prototype.test),lf=(Xh=TypeError,function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return Zh(Xh,t)});function cf(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 Kh(e,t,r)}}function uf(e,t){jh&&jh(e,null);for(var n=t.length;n--;){var r=t[n];if("string"===typeof r){var i=tf(r);i!==r&&(Vh(t)||(t[n]=i),r=i)}e[r]=!0}return e}function pf(e){var t=Gh(null),n=void 0;for(n in e)Kh(zh,e,[n])&&(t[n]=e[n]);return t}function df(e,t){for(;null!==e;){var n=$h(e,t);if(n){if(n.get)return cf(n.get);if("function"===typeof n.value)return cf(n.value)}e=_h(e)}return function(e){return console.warn("fallback value for",e),null}}var hf=Uh(["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"]),ff=Uh(["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"]),mf=Uh(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),gf=Uh(["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"]),vf=Uh(["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"]),yf=Uh(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),bf=Uh(["#text"]),wf=Uh(["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"]),kf=Uh(["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"]),xf=Uh(["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"]),Cf=Uh(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Tf=Wh(/\{\{[\s\S]*|[\s\S]*\}\}/gm),Ef=Wh(/<%[\s\S]*|[\s\S]*%>/gm),Mf=Wh(/^data-[\-\w.\u00B7-\uFFFF]/),Nf=Wh(/^aria-[\-\w]+$/),Sf=Wh(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Df=Wh(/^(?:\w+script|data):/i),Lf=Wh(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Af="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 Of(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 If=function(){return"undefined"===typeof window?null:window};var Rf=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:If(),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=df(g,"cloneNode"),y=df(g,"nextSibling"),b=df(g,"childNodes"),w=df(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":Af(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=pf(i).documentMode?i.documentMode:{}}catch(Fe){}var A={};n.isSupported="function"===typeof w&&E&&"undefined"!==typeof E.createHTMLDocument&&9!==L;var O=Tf,I=Ef,R=Mf,P=Nf,B=Df,F=Lf,H=Sf,q=null,z=uf({},[].concat(Of(hf),Of(ff),Of(mf),Of(vf),Of(bf))),j=null,V=uf({},[].concat(Of(wf),Of(kf),Of(xf),Of(Cf))),_=null,$=null,U=!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=uf({},["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=uf({},["audio","video","img","source","image","track"]),ue=null,pe=uf({},["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":Af(e))||(e={}),e=pf(e),q="ALLOWED_TAGS"in e?uf({},e.ALLOWED_TAGS):z,j="ALLOWED_ATTR"in e?uf({},e.ALLOWED_ATTR):V,ue="ADD_URI_SAFE_ATTR"in e?uf(pf(pe),e.ADD_URI_SAFE_ATTR):pe,le="ADD_DATA_URI_TAGS"in e?uf(pf(ce),e.ADD_DATA_URI_TAGS):ce,se="FORBID_CONTENTS"in e?uf({},e.FORBID_CONTENTS):ae,_="FORBID_TAGS"in e?uf({},e.FORBID_TAGS):{},$="FORBID_ATTR"in e?uf({},e.FORBID_ATTR):{},oe="USE_PROFILES"in e&&e.USE_PROFILES,U=!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}:tf,J&&(W=!1),Y&&(Q=!0),oe&&(q=uf({},[].concat(Of(bf))),j=[],!0===oe.html&&(uf(q,hf),uf(j,wf)),!0===oe.svg&&(uf(q,ff),uf(j,kf),uf(j,Cf)),!0===oe.svgFilters&&(uf(q,mf),uf(j,kf),uf(j,Cf)),!0===oe.mathMl&&(uf(q,vf),uf(j,xf),uf(j,Cf))),e.ADD_TAGS&&(q===z&&(q=pf(q)),uf(q,e.ADD_TAGS)),e.ADD_ATTR&&(j===V&&(j=pf(j)),uf(j,e.ADD_ATTR)),e.ADD_URI_SAFE_ATTR&&uf(ue,e.ADD_URI_SAFE_ATTR),e.FORBID_CONTENTS&&(se===ae&&(se=pf(se)),uf(se,e.FORBID_CONTENTS)),re&&(q["#text"]=!0),K&&uf(q,["html","head","body"]),q.table&&(uf(q,["tbody"]),delete _.tbody),Uh&&Uh(e),we=e)},Ce=uf({},["mi","mo","mn","ms","mtext"]),Te=uf({},["foreignobject","desc","title","annotation-xml"]),Ee=uf({},ff);uf(Ee,mf),uf(Ee,gf);var Me=uf({},vf);uf(Me,yf);var Ne=function(e){ef(n.removed,{element:e});try{e.parentNode.removeChild(e)}catch(Fe){try{e.outerHTML=C}catch(Fe){e.remove()}}},Se=function(e,t){try{ef(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(Fe){ef(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=nf(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":Af(a))?e instanceof a:e&&"object"===("undefined"===typeof e?"undefined":Af(e))&&"number"===typeof e.nodeType&&"string"===typeof e.nodeName},Oe=function(e,t,r){A[e]&&Qh(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(nf(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))&&af(/<[/\w]/g,e.innerHTML)&&af(/<[/\w]/g,e.textContent))return Ne(e),!0;if("select"===i&&af(/<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=tf(e.tagName),r=tf(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=uf({},["title","style","font","a","script"]);return!Me[n]&&(i[n]||!Ee[n])}return!1}(e)?(Ne(e),!0):"noscript"!==i&&"noembed"!==i||!af(/<\/no(script|embed)/i,e.innerHTML)?(J&&3===e.nodeType&&(r=e.textContent,r=rf(r,O," "),r=rf(r,I," "),e.textContent!==r&&(ef(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&&!$[t]&&af(R,t));else if(U&&af(P,t));else{if(!j[t]||$[t])return!1;if(ue[t]);else if(af(H,rf(n,F,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==of(n,"data:")||!le[e]){if(G&&!af(B,rf(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=sf(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(af(/\/>/i,r))Se(c,e);else{J&&(r=rf(r,O," "),r=rf(r,I," "));var p=be(e.nodeName);if(Re(p,i,r))try{u?e.setAttributeNS(u,c,r):e.setAttribute(c,r),Yh(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 lf("toString is not a function");if("string"!==typeof(e=e.toString()))throw lf("dirty is not a string, aborting")}if(!n.isSupported){if("object"===Af(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=rf(h,O," "),h=rf(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]||[],ef(A[e],t))},n.removeHook=function(e){A[e]&&Yh(A[e])},n.removeHooks=function(e){A[e]&&(A[e]=[])},n.removeAllHooks=function(){A={}},n}(),Pf=["iframe","embed"],Bf=[];function Ff(e){zs(Pf,e)&&Bf.push(e.toLowerCase())}function Hf(e,t){return Rf.sanitize(e,Vo({ADD_TAGS:Bf,ADD_ATTR:["rel","target","hreflang","type"],FORBID_TAGS:["input","script","textarea","form","button","select","meta","style","link","title","object","base"]},t))}function qf(e,t){return e.literal.replace(new RegExp("(<\\s*"+t+"[^>]*>)|(</"+t+"\\s*[>])","ig"),"").trim()}function zf(e){var t=(e=e.match(Za)[0]).match(new RegExp(Ga,"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 jf(e){return ia(e.attributes).reduce((function(e,t){return e[t.nodeName]=t.nodeValue,e}),{})}function Vf(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:jf(i)}}var _f={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:jf(e),childrenHTML:e.innerHTML}}}],toDOM:function(r){var i=Vf(r,e,t,n),o=i.dom,s=i.htmlAttrs;return s.class=s.class?s.class+" html-block":"html-block",_o([e,s],ia(o.childNodes))}}},htmlInline:function(e,t,n){return{attrs:{htmlAttrs:{default:{}},htmlInline:{default:!0}},parseDOM:[{tag:e,getAttrs:function(e){return{htmlAttrs:jf(e)}}}],toDOM:function(r){var i=Vf(r,e,t,n).htmlAttrs;return[e,i,0]}}}};var $f=/^\s*<\s*\//,Uf={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:Aa(o,Ba(e)).outerHTML},{type:"closeTag",tagName:"span"}]):n()}};function Wf(e,t){var n=Vo({},Uf);return e&&(n.link=function(t,n){var r=n.entering,i=(0,n.origin)();return r&&(i.attributes=Vo(Vo({},i.attributes),e)),i}),t&&Object.keys(t).forEach((function(e){var r=n[e],i=t[e];r&&Cl(i)?n[e]=function(e,t){var n=Vo({},t);return n.origin=function(){return r(e,t)},i(e,n)}:zs(["htmlBlock","htmlInline"],e)&&!Cl(i)?n[e]=function(e,t){var n=e.literal.match(Za);if(n){var r=n[0],o=n[1],s=n[3],a=(o||s).toLowerCase(),l=i[a],c=qf(e,a);if(l){var u=Vo({},e);return u.attrs=zf(r),u.childrenHTML=c,u.type=a,t.entering=!$f.test(e.literal),l(u,t)}}return t.origin()}:n[e]=i})),n}var Gf=["list","item","blockQuote"],Jf=["UL","OL","BLOCKQUOTE"];function Kf(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 Zf(e,t,n){var r=pa(t)-1,i=da(t)-1,o=n[r].getBoundingClientRect(),s=n[i].offsetTop-n[r].offsetTop+n[i].clientHeight;return{height:s<=0?n[r].clientHeight:s+Xf(e,n,Math.min(i+1,e.childCount-1)),rect:o}}function Xf(e,t,n){for(var r=e.childCount-1,i=0;n<=r&&Kf(e,n);)i+=t[n].clientHeight,n+=1;return i}function Qf(e,t){for(var n=0;e&&e!==t&&(zs(Jf,e.tagName)||(n+=e.offsetTop),e.offsetParent!==t.offsetParent);)e=e.parentElement;return n}function Yf(e,t,n){return e&&t>n+e.offsetTop?Yf(e.nextElementSibling,t,n)||e:null}function em(e,t){for(var n=e.querySelector('[data-nodeid="'+t.id+'"]');!n||ma(t);)t=t.parent,n=e.querySelector('[data-nodeid="'+t.id+'"]');return function(e){var t=e.mdNode,n=e.el;for(;(zs(Gf,t.type)||"table"===t.type)&&t.firstChild;)t=t.firstChild,n=n.firstElementChild;return{mdNode:t,el:n}}({mdNode:t,el:n})}var tm={};function nm(e){e&&(delete tm[Number(e.getAttribute("data-nodeid"))],ia(e.children).forEach((function(e){nm(e)})))}function rm(e,t,n){var r,i=tm[r=n]&&tm[r].height,o=function(e){return tm[e]&&tm[e].offsetTop}(n),s=i||e.clientHeight,a=o||Qf(e,t)||e.offsetTop;return i||function(e,t){tm[e]=tm[e]||{},tm[e].height=t}(n,s),o||function(e,t){tm[e]=tm[e]||{},tm[e].offsetTop=t}(n,a),{nodeHeight:s,offsetTop:a}}var im=nl("md-preview-highlight");var om=function(){function e(e,t){var n=document.createElement("div");this.el=n,this.eventEmitter=e,this.isViewer=!!t.isViewer,this.el.className=nl("md-preview");var r=t.linkAttributes,i=t.customHTMLRenderer,o=t.sanitizer,s=t.highlight,a=void 0!==s&&s;this.renderer=new qh({gfm:!0,nodeId:!0,convertors:Wf(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=al('<div class="'+nl("contents")+'"></div>'),this.isViewer||this.el.appendChild(this.previewContent)},e.prototype.toggleActive=function(e){sl(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()}))),Tu(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=Yf(i,e,Qf(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&&ks(e,im)}},e.prototype.updateCursorNode=function(e,t){e&&("tableRow"===(e=wa(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&&!(ha(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&&ks(r,im),i&&gs(i,im),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;ol(p),nm(p),p=d}(null===p||void 0===p?void 0:p.parentNode)&&(ol(p),nm(p))}}else i.insertAdjacentHTML("afterbegin",o)},e.prototype.getRenderer=function(){return this.renderer},e.prototype.destroy=function(){bu(this.el,"scroll"),this.el=null},e.prototype.getElement=function(){return this.el},e.prototype.getHTML=function(){return dl(this.previewContent.innerHTML)},e.prototype.setHTML=function(e){this.previewContent.innerHTML=e},e.prototype.setHeight=function(e){ns(this.el,{height:e+"px"})},e.prototype.setMinHeight=function(e){ns(this.el,{minHeight:e+"px"})},e}();function sm(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 am(e){return!!sm(e,(function(e){var t=e.type;return"listItem"===t.name||"bulletList"===t.name||"orderedList"===t.name}))}function lm(e){return!!sm(e,(function(e){var t=e.type;return"tableHeadCell"===t.name||"tableBodyCell"===t.name}))}function cm(e){return sm(e,(function(e){return"listItem"===e.type.name}))}function um(e){return{tag:e,getAttrs:function(e){var t=e.getAttribute("data-raw-html");return Vo({},t&&{rawHTML:t})}}}function pm(e){return Object.keys(e).reduce((function(t,n){return"rawHTML"!==n&&e[n]&&(t[n="className"===n?"class":n]=e[n]),t}),{})}function dm(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]=zs(["rawHTML","extended"],n)?i:Number(i)),t}),{})}}}function hm(e){var t=e.htmlAttrs,n=e.classNames;return Vo(Vo({},t),{class:n?n.join(" "):null})}function fm(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 mm(e,t){for(var n=e.resolve(t);"paragraph"!==n.node().type.name;)t-=2,n=e.resolve(t);return cm(n)}function gm(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=am(o)?function(e,t,n){var r=t.$from,i=t.$to,o=cm(r),s=cm(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=mm(e.doc,a)}return e}(i,a,e):fm(i,a,e);return n(l),!0}return!1}}function vm(){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=am(o)?function(e,t){var n=t.$from,r=t.$to,i=cm(n),o=cm(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=mm(e.doc,s)}return e}(r,a):fm(r,a,i.nodes.bulletList,{task:!0});return t(l),!0}return!1}}function ym(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 bm(){return function(){return function(e,t){var n=e.selection,r=e.schema,i=n.$from,o=n.$to;return!(!i.blockRange(o)||!am(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 wm(){return{indent:bm(),outdent:function(){return function(e,t){var n=e.selection,r=e.schema,i=n.$from,o=n.$to;return!(!i.blockRange(o)||!am(i))&&ym(r.nodes.listItem)(e,t)}}}}var km=new Map,xm=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=sm(t,(function(e){return"table"===e.type.name}));if(n){var r=n.node,i=n.depth,o=n.offset,s=km.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=Cm(c,l),d=Cm(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 km.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=na(s,c))[0],c=r[1],a=(i=na(a,u))[0],u=i[1],this.getSpannedOffsets({startRowIdx:s,startColIdx:a,endRowIdx:c,endColIdx:u})},e.prototype.getSpannedOffsets=function(e){return e},e}(),Cm=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 Tm(e,t){return ta(xm.prototype,e),Cm=t,xm}var Em=function(e){function t(t,n){void 0===n&&(n=t);var r=this,i=t.node(0),o=xm.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 jo(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=xm.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=xm.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 Mm(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 Nm(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 Sm(e,t){for(;e&&e!==t;){if("TD"===e.nodeName||"TH"===e.nodeName)return e;e=e.parentNode}return null}function Dm(e){return sm(e,(function(e){var t=e.type;return"tableHeadCell"===t.name||"tableBodyCell"===t.name}))}function Lm(e){if(e instanceof et){var t=e.$anchor,n=Dm(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 Am(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 Om(e){var t=e.startRowIdx,n=e.startColIdx;return{rowCount:e.endRowIdx-t+1,columnCount:e.endColIdx-n+1}}function Im(e,t){return Vo(Vo({},e.attrs),t)}var Rm=new yt("cellSelection"),Pm=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=Sm(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=Rm.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!==Rm.getState(this.view.state)&&this.view.dispatch(this.view.state.tr.setMeta(Rm,-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=Dm(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===Rm.getState(this.view.state),s=new Em(e,t);if(o||!r.eq(s)){var a=i.setSelection(s);o&&a.setMeta(Rm,t.pos),this.view.dispatch(a)}},e.prototype.destroy=function(){this.view.dom.removeEventListener("mousedown",this.handlers.mousedown)},e}(),Bm=nl("cell-selected");function Fm(e){var t=e.selection,n=e.doc;if(t instanceof Em){var r=[];return t.ranges.forEach((function(e){var t=e.$from,n=e.$to;r.push(Yr.node(t.pos-1,n.pos+1,{class:Bm}))})),ni.create(n,r)}return null}var Hm=function(){function e(){this.keys=[],this.values=[]}return e.prototype.getKeyIndex=function(e){return is(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}(),qm="en-US",zm=function(){function e(){this.code=qm,this.langs=new Hm}return e.prototype.setCode=function(e){this.code=e||qm},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,Wo(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(qm));var r=n[e];if(!r)throw new Error('There is no text key "'+e+'" in '+t);return r},e}(),jm=new zm,Vm=[[{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 _m(e,t){return Vm.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:jm.get(r),onClick:function(){e.emit("command",i,o)},disabled:t&&!!s,className:a}}))})).concat()}var $m=["image","link","customBlock","frontMatter"],Um=["strong","strike","emph","code"],Wm=["bulletList","orderedList","taskList"];function Gm(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);zs($m,s)||(zs(Wm,s)?(!function(e,t){t[e]={active:!0},Wm.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){Um.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 Jm(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:Gm(r,i,o)})}}}})}var Km=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 Ei(i.innerViewContainer,{state:ht.create({doc:i.node,plugins:[zi({"Mod-z":function(){return Ho(i.innerEditorView.state,i.innerEditorView.dispatch)},"Shift-Mod-z":function(){return qo(i.innerEditorView.state,i.innerEditorView.dispatch)},Tab:function(e,t){return t(e.tr.insertText("\t")),!0},Enter:Ki,Escape:function(){return i.cancelEditing(),!0},"Ctrl-Enter":function(){return i.saveAndFinishEditing(),!0}}),Fo()]}),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=nl("custom-block"),this.wrapper=document.createElement("div"),this.wrapper.className=nl("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=nl("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(aa(t.tr,e))),this.editorView.focus(),this.renderCustomBlock(),this.closeEditor()},e.prototype.cancelEditing=function(){var e=function(e){let t=Po.getState(e);return t?t.done.eventCount:0}(this.innerEditorView.state);for(this.canceled=!0;e--;)Ho(this.innerEditorView.state,this.innerEditorView.dispatch),Ho(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&&Cl(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}(),Zm="image-link",Xm=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&&Cl(o.getPos)&&za(t,Zm)){var i=getComputedStyle(t,":before");if(e.stopPropagation(),el(i,n,r)){var s=o.view.state.tr,a=o.getPos();s.setSelection(aa(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=Zm,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=hm(e.attrs);return t.src=r,i&&(t.alt=i),pl(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}(),Qm=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&&Cl(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=hm(this.node.attrs);return n&&t.setAttribute("data-language",n),pl(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;ns(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&&Cl(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,ol(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}(),Ym=/MsoListParagraph/,eg=/style=(.|\n)*mso-/,tg=/mso-list:(.*)/,ng=/O:P/,rg=/^(n|u|l)/,ig="p.MsoListParagraph";function og(e){for(var t=[],n=document.createTreeWalker(e,1,null,!1);n.nextNode();){var r=n.currentNode;if(il(r)){var i=r,o=i.outerHTML,s=i.textContent,a=eg.test(o),l=tg.test(o);a&&!l&&s?t.push([r,!0]):(ng.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);ol(e)}(t):ol(t)})),e.innerHTML.trim()}function sg(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(tg)[1].trim().split(" ")[1];return{id:t,level:parseInt(r.replace("level",""),10),prev:null,parent:null,children:[],unordered:rg.test(e.textContent||""),contents:og(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 ag(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(ag(t))})),n}function lg(e){return ag(sg(e).filter((function(e){return!e.parent})))}function cg(e){var t=document.createElement("div");t.innerHTML=e;var n=[],r=function(e,t){var n=ia(e.querySelectorAll(t));return n.length?n:[]}(t,ig);return r.forEach((function(e){var r,i,o=function(e){for(;e&&!il(e);)e=e.nextSibling;return!e||!Ym.test(e.className)}(e.nextSibling);if(n.push(e),o){var s=lg(n),a=e.nextSibling;a?(r=s,(i=a).parentNode&&i.parentNode.insertBefore(r,i)):function(e,t){(t=Jo(t)?ia(t):[t]).forEach((function(t){e.appendChild(t)}))}(t,s),n=[]}ol(e)})),""+(r.length?"<p></p>":"")+t.innerHTML}var ug="\x3c!--StartFragment--\x3e",pg="\x3c!--EndFragment--\x3e";function dg(e){return function(e){return eg.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(ug),n=e.lastIndexOf(pg);return t>-1&&n>-1&&(e=e.slice(t+ug.length,n)),e.replace(/<br[^>]*>/g,Ya)}(e)))&&(e=cg(e)),e}function hg(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 fg(e,t,n){var r=n.nodes,i=r.tableRow,o=hg(e,0,r.tableHeadCell);return i.create(null,o)}function mg(e,t,n){var r=n.nodes,i=r.tableRow,o=hg(e,0,r.tableBodyCell);return i.create(null,o)}function gg(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 _o(_o([],t),n)}function vg(e,t,n){var r=fg(e,0,n);return n.nodes.tableHead.create(null,r)}function yg(e,t,n){var r=e.map((function(e){return mg(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 bg(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=Am(new m(c.from(e),0,0));if(i){var o=gg(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,[yg(e,i,t)]);var o=e[0],s=e.slice(1),a=[vg(o,0,t)];return s.length&&a.push(yg(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 wg=4,kg=2;function xg(e){return e*wg}function Cg(e,t){var n=e.state,r=n.selection,i=n.schema,o=n.tr,s=Lm(r),a=s.anchor,l=s.head;if(a&&l){var c=Am(t);if(!c)return!1;var u=xm.create(a),p=u.getRectOffsets(a,l),d=function(e,t,n){var r=[],i=gg(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=fg(l,0,n).content;r.push(c)}}return a.forEach((function(e){if(!e.attrs.dummyRowForPasting){var t=mg(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=Om(n),i=r.rowCount,o=r.columnCount,s=Om(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=Nm(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+xg(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=Mm(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+xg(a)+1,m=d+xg(l+1)+1,g=d+xg(n.totalColumnCount+s)+kg;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=xm.create(o.resolve(n)),a=t[0],l=a.rowIdx,c=a.startColIdx,u=Zs(t),p=u.rowIdx,d=u.endColIdx,h=s.getCellInfo(l,c).offset,f=s.getCellInfo(p,d).offset;e.dispatch(i.setSelection(new Em(o.resolve(h),o.resolve(f))))}(e,f,u.getCellInfo(0,0).offset)),!0}return!1}var Tg=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return jo(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}(yl),Eg=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return jo(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:Vo({},{htmlAttrs:{default:null},classNames:{default:null}}),parseDOM:[{tag:"p"}],toDOM:function(e){return["p",hm(e.attrs),0]}}},enumerable:!1,configurable:!0}),t}(yl),Mg=/\s{1,4}$/,Ng=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return jo(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)||am(i)||lm(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)&&!am(i)&&!lm(i)){var a=i.nodeBefore;if(a&&a.isText){var l=a.text,c=l.replace(Mg,""),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}(yl),Sg=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return jo(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 Vo({level:e},n&&{rawHTML:n})}}}));return{attrs:Vo({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,hm(t),0]}}},enumerable:!1,configurable:!0}),t.prototype.commands=function(){return function(e){return function(t,n){return so(t.schema.nodes[e.level?"heading":"paragraph"],e)(t,n)}}},t}(yl),Dg=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return jo(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:Vo({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 Vo({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",Vo({"data-language":t.language},hm(t)),0]]}}},enumerable:!1,configurable:!0}),t.prototype.commands=function(){return function(){return function(e,t){return so(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-Zs(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=la(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}(yl),Lg=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return jo(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:Vo({rawHTML:{default:null}},{htmlAttrs:{default:null},classNames:{default:null}}),parseDOM:[um("ul")],toDOM:function(e){return["ul",hm(e.attrs),0]}}},enumerable:!1,configurable:!0}),t.prototype.changeList=function(){return function(e,t){return gm(e.schema.nodes.bulletList)(e,t)}},t.prototype.commands=function(){return{bulletList:this.changeList,taskList:vm}},t.prototype.keymaps=function(){var e=this.changeList(),t=wm(),n=t.indent,r=t.outdent;return{"Mod-u":e,"Mod-U":e,Tab:n(),"Shift-Tab":r()}},t}(yl),Ag=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return jo(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:Vo({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 Vo({order:e.hasAttribute("start")?Number(t):1},n&&{rawHTML:n})}}],toDOM:function(e){var t=e.attrs;return[t.rawHTML||"ol",Vo({start:1===t.order?null:t.order},hm(t)),0]}}},enumerable:!1,configurable:!0}),t.prototype.commands=function(){return function(){return function(e,t){return gm(e.schema.nodes.orderedList)(e,t)}}},t.prototype.keymaps=function(){var e=this.commands()(),t=wm(),n=t.indent,r=t.outdent;return{"Mod-o":e,"Mod-O":e,Tab:n(),"Shift-Tab":r()}},t}(yl),Og=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return jo(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 Vo({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",Vo({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}(yl),Ig=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return jo(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"blockQuote"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return{attrs:Vo({rawHTML:{default:null}},{htmlAttrs:{default:null},classNames:{default:null}}),content:"block+",group:"block",parseDOM:[um("blockquote")],toDOM:function(e){return["blockquote",hm(e.attrs),0]}}},enumerable:!1,configurable:!0}),t.prototype.commands=function(){return function(){return function(e,t){return oo(e.schema.nodes.blockQuote)(e,t)}}},t.prototype.keymaps=function(){var e=this.commands()();return{"Alt-q":e,"Alt-Q":e}},t}(yl),Rg={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 Pg(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 Bg(e,t,n,r){void 0===r&&(r=!1);var i=e.doc.resolve(t.tableEndOffset);return r||!i.nodeAfter?la(e,i,n):e.setSelection(Ze.near(i,1))}function Fg(e,t,n,r){var i=(0,Rg[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 Hg(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 qg=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return jo(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:Vo({rawHTML:{default:null}},{htmlAttrs:{default:null},classNames:{default:null}}),parseDOM:[um("table")],toDOM:function(e){return["table",hm(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&&!lm(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=Mm(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=xm.create(n.$anchor);if(i){var o=i.tableStartOffset,s=i.tableEndOffset,a=o-1,l=aa(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=Lm(r),a=s.anchor,l=s.head;if(a&&l){for(var c=xm.create(a),u=c.getRectOffsets(a,l),p="left"===e?u.startColIdx:u.endColIdx+1,d=Om(u).columnCount,h=c.totalRowCount,f=0;f<h;f+=1){var m=Nm(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=Lm(n),o=i.anchor,s=i.head;if(o&&s){var a=xm.create(o),l=a.getRectOffsets(o,s),c=a.totalColumnCount,u=a.totalRowCount;if(Om(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=Lm(r),a=s.anchor,l=s.head;if(a&&l){var c=xm.create(a),u=c.totalColumnCount,p=c.getRectOffsets(a,l),d=Om(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(Nm(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=Lm(n),o=i.anchor,s=i.head;if(o&&s){var a=xm.create(o),l=a.totalRowCount,c=a.totalColumnCount,u=a.getRectOffsets(o,s),p=Om(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=Hg(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=Lm(i),a=s.anchor,l=s.head;if(a&&l){for(var c=xm.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=Im(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=Lm(r),a=s.anchor,l=s.head;if(a&&l){var c=xm.create(a),u=c.getCellIndex(a),p=void 0;if(p=Pg(e,c,u)?Bg(i,c,o):Fg(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=sm(l,(function(e){var t=e.type;return"tableHeadCell"===t.name||"tableBodyCell"===t.name}));if(c){var u=sm(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=Lm(i).anchor,h=xm.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)?Pg(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)):la(e,r,n)}(o,h,a):"down"===e&&(m=Bg(o,h,a)):m=Fg(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=Lm(r),s=o.anchor,a=o.head;if(s&&a&&!(r instanceof et)){for(var l=xm.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=Nm(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(sm(o,(function(e){var t=e.type;return"tableHeadCell"===t.name||"tableBodyCell"===t.name}))&&sm(o,(function(e){return"paragraph"===e.type.name}))){var s=Lm(n).anchor;return t(Bg(r,xm.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}(yl),zg=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return jo(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:Vo({rawHTML:{default:null}},{htmlAttrs:{default:null},classNames:{default:null}}),parseDOM:[um("thead")],toDOM:function(e){return["thead",hm(e.attrs),0]}}},enumerable:!1,configurable:!0}),t}(yl),jg=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return jo(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:Vo({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&&Vo({},n&&{rawHTML:n})}}],toDOM:function(e){return["tbody",hm(e.attrs),0]}}},enumerable:!1,configurable:!0}),t}(yl),Vg=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return jo(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:Vo({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&&Vo({},n&&{rawHTML:n})}}],toDOM:function(e){return["tr",hm(e.attrs),0]}}},enumerable:!1,configurable:!0}),t}(yl),_g=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return jo(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:Vo({align:{default:null},className:{default:null},rawHTML:{default:null},colspan:{default:null},extended:{default:null}},{htmlAttrs:{default:null},classNames:{default:null}}),isolating:!0,parseDOM:[dm("th")],toDOM:function(e){var t=e.attrs,n=pm(t);return["th",Vo(Vo({},n),hm(t)),0]}}},enumerable:!1,configurable:!0}),t}(yl),$g=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return jo(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:[dm("td")],toDOM:function(e){return["td",pm(e.attrs),0]}}},enumerable:!1,configurable:!0}),t}(yl),Ug=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return jo(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:Vo({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=Hf(e,{RETURN_DOM_FRAGMENT:!0}).firstChild,n=t.getAttribute("src")||"",r=t.getAttribute("data-raw-html"),i=t.getAttribute("alt");return Vo({imageUrl:n,altText:i},r&&{rawHTML:r})}}],toDOM:function(e){var t=e.attrs;return[t.rawHTML||"img",Vo(Vo({src:qs(t.imageUrl)},t.altText&&{alt:t.altText}),hm(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(Vo({imageUrl:s},a&&{altText:a}));return n(i.replaceSelectionWith(l).scrollIntoView()),!0}}},t.prototype.commands=function(){return{addImage:this.addImage()}},t}(yl),Wg=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return jo(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"thematicBreak"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return{attrs:Vo({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",hm(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}(yl),Gg=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return jo(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 Vo({},t&&{rawHTML:t})}}}));return{attrs:Vo({rawHTML:{default:null}},{htmlAttrs:{default:null},classNames:{default:null}}),parseDOM:e,toDOM:function(e){var t=e.attrs;return[t.rawHTML||"strong",hm(t)]}}},enumerable:!1,configurable:!0}),t.prototype.bold=function(){return function(){return function(e,t){return ao(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}(oc),Jg=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return jo(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 Vo({},t&&{rawHTML:t})}}}));return{attrs:Vo({rawHTML:{default:null}},{htmlAttrs:{default:null},classNames:{default:null}}),parseDOM:e,toDOM:function(e){var t=e.attrs;return[t.rawHTML||"em",hm(t)]}}},enumerable:!1,configurable:!0}),t.prototype.italic=function(){return function(){return function(e,t){return ao(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}(oc),Kg=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return jo(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 Vo({},t&&{rawHTML:t})}}}));return{attrs:Vo({rawHTML:{default:null}},{htmlAttrs:{default:null},classNames:{default:null}}),parseDOM:e,toDOM:function(e){var t=e.attrs;return[t.rawHTML||"del",hm(t)]}}},enumerable:!1,configurable:!0}),t.prototype.commands=function(){return function(){return function(e,t){return ao(e.schema.marks.strike)(e,t)}}},t.prototype.keymaps=function(){var e=this.commands()();return{"Mod-s":e,"Mod-S":e}},t}(oc),Zg=function(e){function t(t){var n=e.call(this)||this;return n.linkAttributes=t,n}return jo(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:Vo({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=Hf(e,{RETURN_DOM_FRAGMENT:!0}).firstChild,n=t.getAttribute("href")||"",r=t.getAttribute("title")||"",i=t.getAttribute("data-raw-html");return Vo({linkUrl:n,title:r},i&&{rawHTML:i})}}],toDOM:function(t){var n=t.attrs;return[n.rawHTML||"a",Vo(Vo({href:qs(n.linkUrl)},e.linkAttributes),hm(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=sa(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 ao(t.schema.marks.link,e)(t,n)}}},t.prototype.commands=function(){return{addLink:this.addLink(),toggleLink:this.toggleLink()}},t}(oc),Xg=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return jo(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"code"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return{attrs:Vo({rawHTML:{default:null}},{htmlAttrs:{default:null},classNames:{default:null}}),parseDOM:[{tag:"code",getAttrs:function(e){var t=e.getAttribute("data-raw-html");return Vo({},t&&{rawHTML:t})}}],toDOM:function(e){var t=e.attrs;return[t.rawHTML||"code",hm(t)]}}},enumerable:!1,configurable:!0}),t.prototype.commands=function(){return function(){return function(e,t){return ao(e.schema.marks.code)(e,t)}}},t.prototype.keymaps=function(){var e=this.commands()();return{"Shift-Mod-c":e,"Shift-Mod-C":e}},t}(oc),Qg=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return jo(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)&&so(t.schema.nodes.customBlock,e)(t,n)}}},t}(yl),Yg=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return jo(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)&&Xi(e,t)}}},t.prototype.keymaps=function(){return{Enter:this.commands()()}},t}(yl),ev=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return jo(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)&&Xi(e,t)}}},t.prototype.keymaps=function(){return{Enter:this.commands()()}},t}(yl);var tv=nl("contents"),nv=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(Vo(Vo({},r.context),{view:r.view})),r.initEvent(),r}return jo(t,e),t.prototype.createSpecs=function(){return e=this.linkAttributes,new Ml([new Tg,new Eg,new Ng,new Sg,new Dg,new Lg,new Ag,new Og,new Ig,new qg,new zg,new jg,new Vg,new _g,new $g,new Ug,new Wg,new Gg,new Jg,new Kg,new Zg(e),new Xg,new Qg,new Yg,new kl,new ev]);var e},t.prototype.createContext=function(){return{schema:this.schema,eventEmitter:this.eventEmitter}},t.prototype.createSchema=function(e){return new X({nodes:Vo(Vo({},this.specs.nodes),e.nodes),marks:Vo(Vo({},this.specs.marks),e.marks)})},t.prototype.createPlugins=function(){return _o([new mt({key:Rm,state:{init:function(){return null},apply:function(e,t){var n=e.getMeta(Rm);if(n)return-1===n?null:n;if(Cs(t)||!e.docChanged)return t;var r=e.mapping.mapResult(t),i=r.deleted,o=r.pos;return i?null:o}},props:{decorations:Fm,createSelectionBetween:function(e){var t=e.state;return Cs(Rm.getState(t))?null:t.selection}},view:function(e){return new Pm(e)}}),(e=this.eventEmitter,new mt({props:{handleDOMEvents:{contextmenu:function(t,n){var r=Sm(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:_m(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=cm(c),p=t.target,d=getComputedStyle(p,":before"),h=t,f=h.offsetX,m=h.offsetY;if(!u||!el(d,f,m))return!1;t.preventDefault();var g=c.before(u.depth),v=u.node.attrs;return l.setNodeMarkup(g,null,Vo(Vo({},v),{checked:!v.checked})),e.dispatch(l),!0}return!1}}}}),Jm(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 Ei(this.el,{state:this.createState(),attributes:{class:tv},nodeViews:Vo({customBlock:function(e,n,r){return new Km(e,n,r,t)},image:function(e,t,r){return new Xm(e,t,r,n)},codeBlock:function(e,t,r){return new Qm(e,t,r,n)},widget:bl},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:dg,transformPasted:function(t){return bg(t,e.schema,lm(e.view.state.selection.$from))},handlePaste:function(e,t,n){return Cg(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=ia(i).some((function(e){return"string"===e.kind&&"text/rtf"===e.type}));if(!o){var s=gl(i);s&&(n.preventDefault(),ml(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,wm())},t.prototype.getHTML=function(){return dl(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 oa(i,Pa(e,i))})),a=new m(c.from(s),1,1),l=xs(t)&&xs(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=xs(e)&&xs(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 xs(e)&&xs(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=aa(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=Pa(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||zs(e,u)}(o)&&(l=(a+=t)+r)}))}return{range:[a,l],type:c}},t}(xl),rv=ss,iv=Cs;var ov=function(e){return!rv(e)&&!iv(e)};var sv=function(e){return ov(e)&&!1!==e};var av=function(e){return!sv(e)},lv=["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"],cv=function(){function e(){var e=this;this.events=new Hm,this.eventTypes=lv.reduce((function(e,t){return Vo(Vo({},e),{type:t})}),{}),this.hold=!1,lv.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);ss(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,_o([t],n));av(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!ss(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}(),uv=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 pv(e){return"\n"===e[e.length-1]?e.slice(0,e.length-1):e}function dv(e,t){var n=e.schema,r=t.literal.match(Za);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 hv(e){return zs(["text","strong","emph","strike","image","link","code"],e.type)}function fv(e){return"softbreak"===(null===e||void 0===e?void 0:e.type)}function mv(e){var t=e.type,n=e.literal,r="htmlInline"===t&&n.match(Za);if(r){var i=r[1],o=r[3],s=i||o;if(s)return zs(["ul","ol","li"],s.toLowerCase())}return!1}function gv(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=document.createElement("div");r.innerHTML=Hf(e);var i=r.firstChild;return t.map((function(e){return i.getAttribute(e)||""}))}var vv={"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=gv(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=gv(r,"src","alt"),o=i[0],s=i[1],a=e.schema.nodes.image;e.addNode(a,Vo({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)?(fv(i)&&e.openNode(n),fv(o)?e.closeNode():o&&(e.closeNode(),e.openNode(n))):"tableCell"===(null===r||void 0===r?void 0:r.type)&&(i&&(hv(i)||dv(e,i))&&e.closeNode(),o&&(hv(o)||dv(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(pv(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&&!mv(t.prev)&&e.closeNode(),e.openNode(a,{rawHTML:n})):(e.closeNode(),t.next&&!mv(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&&!mv(t.prev)&&e.closeNode(),e.openNode(o,Vo({rawHTML:n},a)),t.next&&!mv(t.next)&&e.openNode(s)}else t.prev&&!mv(t.prev)&&e.closeNode(),e.closeNode()}}},yv=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}(vv);function bv(e){return"htmlInline"===e.type&&Xa.test(e.literal)}function wv(e){ia(e.childNodes).forEach((function(e){if(il(e)){var t=e.nodeName.toLowerCase();e.setAttribute("data-raw-html",t),e.childNodes&&wv(e)}}))}var kv={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,Vo({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,Vo({language:o},n)),e.addText(pv(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,Vo({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=Vo(Vo(Vo({},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,Vo(Vo({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=Vo({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&&!bv(n)&&e.closeNode(),r&&!bv(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&&(hv(t)||dv(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=Vo({},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(pv(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(pv(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(Za),i=r[1],o=r[3],s=(i||o).toLowerCase(),a=e.schema.marks[s],l=Hf(n);if(null===a||void 0===a?void 0:a.spec.attrs.htmlInline)if(i){var c=zf(l);e.openMark(a.create({htmlAttrs:c}))}else e.closeMark(a);else{var u=yv[s];u&&u(e,t,i)}},htmlBlock:function(e,t){var n=t.literal,r=document.createElement("div");if(Qa.test(n))e.openNode(e.schema.nodes.htmlComment),e.addText(t.literal),e.closeNode();else{var i=n.match(Za),o=i[1],s=i[3],a=(o||s).toLowerCase(),l=e.schema.nodes[a],c=Hf(n);if(null===l||void 0===l?void 0:l.spec.attrs.htmlBlock){var u=zf(c),p=qf(t,a);e.addNode(l,{htmlAttrs:u,childrenHTML:p})}else r.innerHTML=c,wv(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=Ba(t);i(),e.addNode(l.nodes.widget,{info:s},[l.text(La(s,c))])}else{var u="$$";r&&(u+=a?s+" ":s),e.addText(u)}}};var xv=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 Zs(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=Zs(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:!Ta(e),getChildrenText:Ea,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 Cv={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(Us(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,$s(" ",4),(function(){return i+" "}))},orderedList:function(e,t){var n=t.node,r=n.attrs.order||1;e.convertList(n,$s(" ",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+$s("-",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 Tv(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 Ev(e){return e?["<"+e+">","</"+e+">"]:null}function Mv(e){return e?"<"+e+">":null}function Nv(e){return e?"</"+e+">":null}var Sv={heading:function(e){var t=e.node.attrs,n=t.level,r=$s("#",n);return"setext"===t.headingType&&(r=1===n?"===":"---"),{delim:r,rawHTML:Ev(t.rawHTML)}},codeBlock:function(e){var t=e.node,n=t.attrs,r=t.textContent;return{delim:["```"+(n.language||""),"```"],rawHTML:Ev(n.rawHTML),text:r}},blockQuote:function(e){return{delim:"> ",rawHTML:Ev(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:Ev(i)}},orderedList:function(e,t){var n=e.node,r=t.inTable,i=n.attrs.rawHTML;return r&&(i=i||"ol"),{rawHTML:Ev(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:Ev(e.node.attrs.rawHTML)}},tableHead:function(e){return{rawHTML:Ev(e.node.attrs.rawHTML)}},tableBody:function(e){return{rawHTML:Ev(e.node.attrs.rawHTML)}},tableRow:function(e){return{rawHTML:Ev(e.node.attrs.rawHTML)}},tableHeadCell:function(e){return{rawHTML:Ev(e.node.attrs.rawHTML)}},tableBodyCell:function(e){return{rawHTML:Ev(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="'+qs(r)+'"':"";return{rawHTML:n?"<"+n+' src="'+qs(i)+'"'+o+">":null,attrs:{altText:Us(r||""),imageUrl:i}}},thematicBreak:function(e){return{delim:"***",rawHTML:Mv(e.node.attrs.rawHTML)}},customBlock:function(e){var t=e.node,n=t.attrs,r=t.textContent;return{delim:["$$"+n.info,"$$"],text:r}},frontMatter:function(e){return{text:e.node.textContent}},widget:function(e){return{text:e.node.textContent}},strong:function(e,t){var n=e.node,r=t.entering,i=n.attrs.rawHTML;return{delim:"**",rawHTML:r?Mv(i):Nv(i)}},emph:function(e,t){var n=e.node,r=t.entering,i=n.attrs.rawHTML;return{delim:"*",rawHTML:r?Mv(i):Nv(i)}},strike:function(e,t){var n=e.node,r=t.entering,i=n.attrs.rawHTML;return{delim:"~~",rawHTML:r?Mv(i):Nv(i)}},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="'+qs(o)+'"':"";return r?{delim:"[",rawHTML:s?"<"+s+' href="'+qs(a)+'"'+l+">":null}:{delim:"]("+a+(o?" "+Gs(Us(o)):"")+")",rawHTML:Nv(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?Tv(r.child(o),-1):Tv(r.child(o-1),1),rawHTML:s?Mv(n.attrs.rawHTML):Nv(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}}},Dv={strong:{mixable:!0,removedEnclosingWhitespace:!0},emph:{mixable:!0,removedEnclosingWhitespace:!0},strike:{mixable:!0,removedEnclosingWhitespace:!0},code:{escape:!1},link:null,html:null};function Lv(e){var t={};return Object.keys(Cv).forEach((function(n){t[n]=function(t,r){if(Cv[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?is(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):is(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):Cv[e](n,r,i)}(n,{state:t,nodeInfo:r,params:o})}}})),t}function Av(e){Object.keys(e).forEach((function(t){var n=Sv[t],r=e[t];Sv[t]=n?function(e,t){return t.origin=function(){return n(e,t)},r(e,t)}:r,delete e[t]}));var t=Lv(Sv),n=function(e){var t={};return Object.keys(Dv).forEach((function(n){t[n]=function(t,r){var i=Dv[n],o=e[n],s=o&&t&&!ss(r)?o(t,{entering:r}):{};return Vo(Vo({},s),i)}})),t}(Sv);return{nodeTypeConvertors:t,markTypeConvertors:n}}var Ov=function(){function e(e){var t=e.nodeTypeConvertors,n=e.markTypeConvertors;this.nodeTypeConvertors=t,this.markTypeConvertors=n,this.delim="",this.result="",this.closed=!1,this.tightList=!1,this.stopNewline=!1,this.inTable=!1}return e.prototype.getMarkConvertor=function(e){var t=e.attrs.htmlInline?"html":e.type.name;return this.markTypeConvertors[t]},e.prototype.isInBlank=function(){return/(^|\n)$/.test(this.result)},e.prototype.markText=function(e,t,n,r){var i=this.getMarkConvertor(e);if(i){var o=i({node:e,parent:n,index:r},t),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?Ws(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&&Zs(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){zs(["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,Zs(s).length+1])}})),this.result},e}(),Iv=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=Vo({},kv),r=new qh({gfm:!0,nodeId:!0,convertors:e}).getConvertors();return t.forEach((function(t){var i=kv[t];i&&!zs(["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=Av(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 xv(this.schema,this.toWwConvertors).convertNode(e,this.getInfoForPosSync())},e.prototype.toMarkdownText=function(e){var t=new Ov(this.toMdConvertors).convertNode(e,this.getInfoForPosSync());return t=this.eventEmitter.emitReduce("beforeConvertWysiwygToMarkdown",t)},e}();function Rv(e){var t=e.plugins,n=e.eventEmitter,r=e.usageStatistics,i=e.instance;return n.listen("mixinTableOffsetMapPrototype",Tm),(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:Yr,DecorationSet:ni},pmModel:{Fragment:c},pmRules:{InputRule:mo,inputRules:vo,undoInputRule:bo},pmKeymap:{keymap:zi},i18n:jm};if(Jo(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=Qs(e.toHTMLRenderers,a)),l&&(e.toMarkdownRenderers=Qs(e.toMarkdownRenderers,l)),u&&(e.mdPlugins=e.mdPlugins.concat(u)),p&&(e.wwPlugins=e.wwPlugins.concat(p)),d&&(e.wwNodeViews=Vo(Vo({},e.wwNodeViews),d)),h&&(e.mdCommands=Vo(Vo({},e.mdCommands),h)),f&&(e.wwCommands=Vo(Vo({},e.wwCommands),f)),m&&(e.toolbarItems=e.toolbarItems.concat(m)),s&&(e.markdownParsers=Vo(Vo({},e.markdownParsers),s)),e}),{toHTMLRenderers:{},toMarkdownRenderers:{},mdPlugins:[],wwPlugins:[],wwNodeViews:{},mdCommands:{},wwCommands:{},toolbarItems:[],markdownParsers:{}})}var Pv=function(){function e(e){var t=this;this.options=Wo({linkAttributes:null,extendedAutolinks:!1,customHTMLRenderer:null,referenceDefinition:!1,customHTMLSanitizer:null,frontMatter:!1,usageStatistics:!0,theme:"light"},e),this.eventEmitter=new cv;var n,r=_s(this.options.linkAttributes),i=Rv({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:Vo(Vo({},o),l),extendedAutolinks:c,referenceDefinition:u,frontMatter:p,sanitizer:d||Hf};n=h.customHTMLRenderer,["htmlBlock","htmlInline"].forEach((function(e){n[e]&&Object.keys(n[e]).forEach((function(e){return Ff(e)}))})),this.options.events&&Uo(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(nl(v)),m.innerHTML="",this.toastMark=new Oh("",{disallowedHtmlBlockTags:["br","img"],extendedAutolinks:c,referenceDefinition:u,disallowDeepHeading:!0,frontMatter:p,customParser:s}),this.preview=new om(this.eventEmitter,Vo(Vo({},h),{isViewer:!0})),Tu(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")&&el(n,e.offsetX,e.offsetY)&&(sl(t,"checked"),this.eventEmitter.emit("change",{source:"viewer",date:e}))},e.prototype.setMarkdown=function(e){var t=this.toastMark.getLineTexts(),n=[t.length,Zs(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(){bu(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 Bv(e){return e instanceof I}function Fv(e){return zs(["document","blockQuote","bulletList","orderedList","listItem","paragraph","heading","emph","strong","strike","link","image","table","tableHead","tableBody","tableRow","tableHeadCell","tableBodyCell"],e)}var Hv={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=Vo(Vo({},a),o)),pl(a,s),t.push(s)},closeTag:function(e,t){if(t.length>1){var n=t.pop();Zs(t).appendChild(n)}},html:function(e,t){Zs(t).insertAdjacentHTML("beforeend",e.content)},text:function(e,t){var n=document.createTextNode(e.content);Zs(t).appendChild(n)}},qv=function(){function e(e,t){var n=Wf(e,t),r=Vo(Vo({},t.htmlBlock),t.htmlInline);this.customConvertorKeys=Object.keys(t).concat(Object.keys(r)),this.renderer=new qh({gfm:!0,convertors:Vo(Vo({},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:!Fv(n)&&Bv(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=Vo(Vo({},r),i),s=e.attrs,a=s.htmlAttrs,l=s.childrenHTML;return a?Vo(Vo({},o),{attrs:a,childrenHTML:l}):o}(e),n={entering:!0,leaf:!!Bv(e)&&e.isLeaf,options:this.renderer.getOptions(),getChildrenText:function(){return Bv(e)?e.textContent:""},skipChildren:function(){return!1}},r=this.convertors[e.type.name],i=r(t,n,this.convertors),o=Jo(i)?i:[i];return(Fv(e.type.name)||e.attrs.htmlInline)&&(n.entering=!1,o.push({type:"text",content:Bv(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 Hv[e.type](e,n)})),n[0]},e.prototype.getToDOMNode=function(e){return zs(this.customConvertorKeys,e)?this.toDOMNode.bind(this):null},e}(),zv=15,jv=null,Vv=null;function _v(e,t){var n=t.syncScrollTop,r=t.releaseEventBlock;Vv&&clearTimeout(Vv),n(e),Vv=setTimeout((function(){r()}),zv)}var $v=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=em(this.previewRoot,t).el,i=(Qf(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=em(this.previewRoot,u),k=w.el,x=Zf(c,w.mdNode,g),C=x.height,T=x.rect;y=(Qf(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=em(this.previewRoot,n.findNodeById(f)),g=m.mdNode,v=m.el;d=h[pa(g)-1].offsetTop;var y=Zf(a.doc,g,h).height,b=rm(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;jv&&clearTimeout(jv),a<1?(s=e+r*Math.cos((1-a)*Math.PI/2),_v(Math.ceil(s),n),jv=setTimeout(o,1)):(_v(t,n),jv=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}(),Uv={getPopupInitialValues:function(e,t){return"link"===t.popupName?{linkText:e.getSelectedText()}:{}}};var Wv=function(){function e(e){var t=this;this.initialHTML=e.el.innerHTML,e.el.innerHTML="",this.options=Wo({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=jm,this.i18n.setCode(this.options.language),this.eventEmitter=new cv,Ia(u);var d=_s(this.options.linkAttributes);this.pluginInfo=Rv({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:Qs(m,r),extendedAutolinks:i,referenceDefinition:o,frontMatter:s,sanitizer:p||Hf},T=new qv(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";Ff(e),r[o][e]=_f[i](e,t,n)}))})),r}(C.customHTMLRenderer,C.sanitizer,T);this.toastMark=new Oh("",{disallowedHtmlBlockTags:["br","img"],extendedAutolinks:i,referenceDefinition:o,disallowDeepHeading:!0,frontMatter:s,customParser:x}),this.mdEditor=new pu(this.eventEmitter,{toastMark:this.toastMark,useCommandShortcut:l,mdPlugins:v}),this.preview=new om(this.eventEmitter,Vo(Vo({},C),{isViewer:!1,highlight:this.options.previewHighlight})),this.wwEditor=new nv(this.eventEmitter,{toDOMAdaptor:T,useCommandShortcut:l,htmlSchemaMap:E,linkAttributes:d,wwPlugins:y,wwNodeViews:b}),this.convertor=new Iv(this.wwEditor.getSchema(),Vo(Vo({},g),a),Wf(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 uv(this.eventEmitter,this.mdEditor.commands,this.wwEditor.commands,(function(){return t.mode})),this.options.usageStatistics&&Ss("editor","UA-129966929-1"),this.scrollSync=new $v(this.mdEditor,this.preview,this.eventEmitter),this.addInitEvent(),this.addInitCommand(w,k),(h=this).eventEmitter.listen("query",(function(e,t){return Uv[e](h,t)})),this.options.hooks&&Uo(this.options.hooks,(function(e,n){return t.addHook(n,e)})),this.options.events&&Uo(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 Pv(t):new e(t)},e.setLanguage=function(e,t){jm.setLanguage(e,t)},e.prototype.changePreviewStyle=function(e){this.mdPreviewStyle!==e&&(this.mdPreviewStyle=e,this.eventEmitter.emit("changePreviewStyle",e))},e.prototype.exec=function(e,t){this.commandManager.exec(e,t)},e.prototype.addCommand=function(e,t,n){var r=this;this.commandManager.addCommand(e,t,(function(t){void 0===t&&(t={});var i=("markdown"===e?r.mdEditor:r.wwEditor).view;n(t,i.state,i.dispatch,i)}))},e.prototype.on=function(e,t){this.eventEmitter.listen(e,t)},e.prototype.off=function(e){this.eventEmitter.removeEventHandler(e)},e.prototype.addHook=function(e,t){this.eventEmitter.removeEventHandler(e),this.eventEmitter.listen(e,t)},e.prototype.removeHook=function(e){this.eventEmitter.removeEventHandler(e)},e.prototype.focus=function(){this.getCurrentModeEditor().focus()},e.prototype.blur=function(){this.getCurrentModeEditor().blur()},e.prototype.moveCursorToEnd=function(e){void 0===e&&(e=!0),this.getCurrentModeEditor().moveCursorToEnd(e)},e.prototype.moveCursorToStart=function(e){void 0===e&&(e=!0),this.getCurrentModeEditor().moveCursorToStart(e)},e.prototype.setMarkdown=function(e,t){if(void 0===e&&(e=""),void 0===t&&(t=!0),this.mdEditor.setMarkdown(e,t),this.isWysiwygMode()){var n=this.toastMark.getRootNode(),r=this.convertor.toWysiwygModel(n);this.wwEditor.setModel(r,t)}},e.prototype.setHTML=function(e,t){void 0===e&&(e=""),void 0===t&&(t=!0);var n=document.createElement("div");n.innerHTML=function(e){var t=e.replace(/<p><br\s*\/*><\/p>/gi,"<p></p>"),n=new RegExp(Ka,"ig"),r=t.match(n);return null===r||void 0===r||r.forEach((function(e,n){if(Xa.test(e)){var i=Ya;if(n){var o=r[n-1].match(Ja);if(o&&!/br/i.test(o[1])){var s=o[1];i="</"+s+"><"+s+">"}}t=t.replace(Xa,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=dl(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;Go(e)&&("auto"===e?gs(t,"auto-height"):ks(t,"auto-height"),this.setMinHeight(this.getMinHeight())),ns(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("."+nl("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()&&xs(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=Ol(o,e,t))[0],c=i[1]):(l=(r=Ll(o,e,t))[0],c=r[1]),[l,c]},e}();var Gv=function(e){return"boolean"===typeof e||e instanceof Boolean},Jv=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}(),Kv=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 Jv(this)},e.removalNodes=[],e}();function Zv(e,t){var n,r=e;Gv(e)||null==e?r=null:(Go(e)||xs(e))&&(n=String(e),r=new Kv("TEXT_NODE",{nodeValue:n},[])),r&&t.push(r)}var Xv=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]=ta(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){Zv(e,i)})):Zv(e,i)})),new Kv(e,t||{},i)}));var Qv=function(e){return e===Object(e)};function Yv(e){var t;return"TEXT_NODE"===e.type?t=document.createTextNode(e.props.nodeValue):ry(t=document.createElement(e.type),{},e.props),t}function ey(e,t){e.node?t.removeChild(e.node):ey(e.firstChild,t)}function ty(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)})),ry(e,t,n,(function(e){return!Ks(t[e],n[e])}))}var ny=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i;function ry(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&&Qv(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]=xs(r)&&!ny.test(t)?r+"px":r}))}(e,t[i],n[i]):"children"!==i&&(!1===n[i]?e.removeAttribute(i):e.setAttribute(i,n[i]))}))}function iy(e){if(Kv.removalNodes.forEach((function(e){return sy(e)})),e)for(var t=void 0,n=e.walker();t=n.walk();)if(e=t.vnode,t.entering)sy(e);else if(Cl(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 oy(e){for(var t=e.parent;!t.node;)t=t.parent;return t.node}function sy(e){if(e&&e.parent){if(e.node){var t=oy(e);"A"===e.effect?t.appendChild(e.node):"U"===e.effect&&ty(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(Cl(e.type)){var i=e.component;i.beforeDestroy&&i.beforeDestroy()}else{ey(e,t=oy(e))}e.ref&&(e.component?e.ref(e.component):e.node&&e.ref(e.node))}}function ay(e,t){var n=t.props,r=t.component;return r?(r.prevProps=r.props,r.props=t.props,r):new e(n)}function ly(e){for(var t=e;e&&!e.skip;){if(Cl(e.type)){var n=ay(e.type,e);n.vnode=e,e.component=n,e.props.children=e.children=[n.render()],cy(e)}else e.node||(e.node=Yv(e)),cy(e);if(e.firstChild)e=e.firstChild;else{for(;e&&e.parent&&!e.next&&(e=e.parent)!==t;);e=e.next}}}function cy(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&&(Kv.removalNodes.push(n),n.effect="D"),n&&(n=n.next),0===i?e.firstChild=t:t&&(r.next=t),r=t}));var i=Zs(t);if(!t.length)for(;n;)Kv.removalNodes.push(n),n.effect="D",n=n.next;for(;n&&i;)n&&i.old!==n&&(Kv.removalNodes.push(n),n.effect="D",n=n.next)}function uy(e,t){var n=new Kv(e.tagName.toLowerCase(),{},[t]);return n.node=e,Kv.removalNodes=[],ly(n),iy(n),function(){return function(e){e.effect="D",Kv.removalNodes=[e],iy(),Kv.removalNodes=[]}(n.firstChild)}}var py,dy=function(){function e(e){this.props=e,this.state={},this.refs={}}return e.prototype.setState=function(e){var t=Vo(Vo({},this.state),e);Ks(this.state,t)||(this.state=t,function(e){var t=e.vnode;t.effect="U",t.old=t,t.next&&(t.next.skip=!0),Kv.removalNodes=[],ly(t),iy(t),t.next&&(t.next.skip=!1)}(this))},e}(),hy=function(e){function t(t){var n=e.call(this,t)||this;return n.state={hide:!1},n}return jo(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 Xv(py||(py=$o(['\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 "])),nl("mode-switch"),this.state.hide?"none":"block","markdown"===t?" active":"",(function(){n.emit("needChangeMode","markdown")}),jm.get("Markdown"),"wysiwyg"===t?" active":"",(function(){n.emit("needChangeMode","wysiwyg")}),jm.get("WYSIWYG"))},t}(dy);var fy=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 my=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=fy(a,t=t||0),l.reset=function(){s=!0,n=null},l},gy=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}()}(),vy="undefined"!==typeof window&&"undefined"!==typeof document&&window.document===document,yy="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")(),by="function"===typeof requestAnimationFrame?requestAnimationFrame.bind(yy):function(e){return setTimeout((function(){return e(Date.now())}),1e3/60)};var wy=["top","right","bottom","left","width","height","size","weight"],ky="undefined"!==typeof MutationObserver,xy=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(){by(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(){vy&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),ky?(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(){vy&&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;wy.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}(),Cy=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},Ty=function(e){return e&&e.ownerDocument&&e.ownerDocument.defaultView||yy},Ey=Ay(0,0,0,0);function My(e){return parseFloat(e)||0}function Ny(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce((function(t,n){return t+My(e["border-"+n+"-width"])}),0)}function Sy(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return Ey;var r=Ty(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]=My(o)}return t}(r),o=i.left+i.right,s=i.top+i.bottom,a=My(r.width),l=My(r.height);if("border-box"===r.boxSizing&&(Math.round(a+o)!==t&&(a-=Ny(r,"left","right")+o),Math.round(l+s)!==n&&(l-=Ny(r,"top","bottom")+s)),!function(e){return e===Ty(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 Ay(i.left,i.top,a,l)}var Dy="undefined"!==typeof SVGGraphicsElement?function(e){return e instanceof Ty(e).SVGGraphicsElement}:function(e){return e instanceof Ty(e).SVGElement&&"function"===typeof e.getBBox};function Ly(e){return vy?Dy(e)?function(e){var t=e.getBBox();return Ay(0,0,t.width,t.height)}(e):Sy(e):Ey}function Ay(e,t,n,r){return{x:e,y:t,width:n,height:r}}var Oy=function(){function e(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Ay(0,0,0,0),this.target=e}return e.prototype.isActive=function(){var e=Ly(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}(),Iy=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 Cy(s,{x:t,y:n,width:r,height:i,top:n,right:t+r,bottom:i+n,left:t}),s}(t);Cy(this,{target:e,contentRect:n})},Ry=function(){function e(e,t,n){if(this.activeObservations_=[],this.observations_=new gy,"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 Ty(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new Oy(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 Ty(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 Iy(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}(),Py="undefined"!==typeof WeakMap?new WeakMap:new gy,By=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=xy.getInstance(),r=new Ry(t,n,this);Py.set(this,r)};["observe","unobserve","disconnect"].forEach((function(e){By.prototype[e]=function(){var t;return(t=Py.get(this))[e].apply(t,arguments)}}));var Fy,Hy,qy,zy,jy,Vy,_y,$y,Uy,Wy,Gy,Jy,Ky,Zy,Xy,Qy,Yy="undefined"!==typeof yy.ResizeObserver?yy.ResizeObserver:By,eb=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return jo(t,e),t.prototype.execCommand=function(e){var t=cl(e.target,"li");this.props.execCommand("heading",{level:Number(t.getAttribute("data-level"))})},t.prototype.render=function(){var e=this;return Xv(Hy||(Hy=$o(["\n <ul\n onClick=",'\n aria-role="menu"\n aria-label="','"\n >\n ','\n <li data-type="Paragraph" aria-role="menuitem">\n <div>',"</div>\n </li>\n </ul>\n "],["\n <ul\n onClick=",'\n aria-role="menu"\n aria-label="','"\n >\n ','\n <li data-type="Paragraph" aria-role="menuitem">\n <div>',"</div>\n </li>\n </ul>\n "])),(function(t){return e.execCommand(t)}),jm.get("Headings"),[1,2,3,4,5,6].map((function(e){return Xv(Fy||(Fy=$o(['\n <li data-level="','" data-type="Heading" aria-role="menuitem">\n <',">"," ","</$>\n </li>\n "],['\n <li data-level="','" data-type="Heading" aria-role="menuitem">\n <',">"," ","</$>\n </li>\n "])),e,"h"+e,jm.get("Heading"),e)})),jm.get("Paragraph"))},t}(dy),tb=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return jo(t,e),t.prototype.toggleTab=function(e,t){this.props.onClick(e,t)},t.prototype.render=function(){var e=this;return Xv(zy||(zy=$o(['\n <div class="','" aria-role="tabpanel">\n ',"\n </div>\n "],['\n <div class="','" aria-role="tabpanel">\n ',"\n </div>\n "])),nl("tabs"),this.props.tabs.map((function(t){var n=t.name,r=t.text,i=e.props.activeTab===n;return Xv(qy||(qy=$o(['\n <div\n class="tab-item','"\n onClick=','\n aria-role="tab"\n aria-label="','"\n aria-selected="','"\n tabindex="','"\n >\n ',"\n </div>\n "],['\n <div\n class="tab-item','"\n onClick=','\n aria-role="tab"\n aria-label="','"\n aria-selected="','"\n tabindex="','"\n >\n ',"\n </div>\n "])),i?" active":"",(function(t){return e.toggleTab(t,n)}),jm.get(r),i?"true":"false",i?"0":"-1",jm.get(r))})))},t}(dy),nb=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="",ks(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 jo(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";ks(e,"wrong"),n.length?n&&this.props.execCommand("addImage",{imageUrl:n,altText:r}):gs(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 Xv(jy||(jy=$o(['\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 "])),jm.get("Insert image"),tb,this.tabs,n,this.toggleTab,"url"===n?"block":"none",jm.get("Image URL"),(function(t){return e.refs.url=t}),"file"===n?"block":"none",jm.get("Select image file"),nl("file-name"),r?" has-file":i,this.showFileSelectBox,this.preventSelectStart,r?r.name:jm.get("No file"),nl("file-select-button"),this.showFileSelectBox,jm.get("Choose a file"),this.changeFile,(function(t){return e.refs.file=t}),jm.get("Description"),(function(t){return e.refs.altText=t}),nl("button-container"),nl("close-button"),this.props.hidePopup,jm.get("Cancel"),nl("ok-button"),this.execCommand,jm.get("OK"))},t}(dy),rb=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;(ks(e,"wrong"),ks(n,"wrong"),e.value.length<1)?gs(e,"wrong"):ss(t.props.initialValues.linkUrl)&&n.value.length<1?gs(n,"wrong"):t.props.execCommand("addLink",{linkUrl:e.value,linkText:n.value})},t}return jo(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;ks(r,"wrong"),ks(i,"wrong","disabled"),i.removeAttribute("disabled"),t&&(gs(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 Xv(Vy||(Vy=$o(['\n <div aria-label="','">\n <label for="toastuiLinkUrlInput">','</label>\n <input\n id="toastuiLinkUrlInput"\n type="text"\n ref=','\n />\n <label for="toastuiLinkTextInput">','</label>\n <input\n id="toastuiLinkTextInput"\n type="text"\n ref=','\n />\n <div class="','">\n <button type="button" class="','" onClick=',">\n ",'\n </button>\n <button type="button" class="','" onClick=',">\n ","\n </button>\n </div>\n </div>\n "],['\n <div aria-label="','">\n <label for="toastuiLinkUrlInput">','</label>\n <input\n id="toastuiLinkUrlInput"\n type="text"\n ref=','\n />\n <label for="toastuiLinkTextInput">','</label>\n <input\n id="toastuiLinkTextInput"\n type="text"\n ref=','\n />\n <div class="','">\n <button type="button" class="','" onClick=',">\n ",'\n </button>\n <button type="button" class="','" onClick=',">\n ","\n </button>\n </div>\n </div>\n "])),jm.get("Insert link"),jm.get("URL"),(function(t){return e.refs.url=t}),jm.get("Link text"),(function(t){return e.refs.text=t}),nl("button-container"),nl("close-button"),this.props.hidePopup,jm.get("Cancel"),nl("ok-button"),this.execCommand,jm.get("OK"))},t}(dy),ib=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(Vo({},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 jo(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=nl("table-cell")+(i>0?"":" header");o.push(Xv(_y||(_y=$o(['<div class="','"></div>'],['<div class="','"></div>'])),a))}r.push(Xv($y||($y=$o(['<div class="','">',"</div>"],['<div class="','">',"</div>"])),nl("table-row"),o))}return Xv(Uy||(Uy=$o(['<div class="','">',"</div>"],['<div class="','">',"</div>"])),nl("table"),r)},t.prototype.render=function(){var e=this,t=this.getTableRange(),n=this.getSelectionAreaBound();return Xv(Wy||(Wy=$o(['\n <div aria-label="','">\n <div\n class="','"\n ref=',"\n onMousemove=","\n onClick=","\n >\n ",'\n <div class="','" style=','></div>\n </div>\n <p class="','">',"</p>\n </div>\n "],['\n <div aria-label="','">\n <div\n class="','"\n ref=',"\n onMousemove=","\n onClick=","\n >\n ",'\n <div class="','" style=','></div>\n </div>\n <p class="','">',"</p>\n </div>\n "])),jm.get("Insert table"),nl("table-selection"),(function(t){return e.refs.tableEl=t}),this.extendSelectionRange,this.execCommand,this.createTableArea(t),nl("table-selection-layer"),n,nl("table-description"),this.getDescription())},t}(dy),ob=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return jo(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 Xv(Gy||(Gy=$o(["<div ref=","></div>"],["<div ref=","></div>"])),(function(t){return e.refs.el=t}))},t}(dy);function sb(e){return Go(e)?function(e){var t;switch(e){case"heading":t={name:"heading",className:"heading",tooltip:jm.get("Headings"),state:"heading"};break;case"bold":t={name:"bold",className:"bold",command:"bold",tooltip:jm.get("Bold"),state:"strong"};break;case"italic":t={name:"italic",className:"italic",command:"italic",tooltip:jm.get("Italic"),state:"emph"};break;case"strike":t={name:"strike",className:"strike",command:"strike",tooltip:jm.get("Strike"),state:"strike"};break;case"hr":t={name:"hr",className:"hrline",command:"hr",tooltip:jm.get("Line"),state:"thematicBreak"};break;case"quote":t={name:"quote",className:"quote",command:"blockQuote",tooltip:jm.get("Blockquote"),state:"blockQuote"};break;case"ul":t={name:"ul",className:"bullet-list",command:"bulletList",tooltip:jm.get("Unordered list"),state:"bulletList"};break;case"ol":t={name:"ol",className:"ordered-list",command:"orderedList",tooltip:jm.get("Ordered list"),state:"orderedList"};break;case"task":t={name:"task",className:"task-list",command:"taskList",tooltip:jm.get("Task"),state:"taskList"};break;case"table":t={name:"table",className:"table",tooltip:jm.get("Insert table"),state:"table"};break;case"image":t={name:"image",className:"image",tooltip:jm.get("Insert image")};break;case"link":t={name:"link",className:"link",tooltip:jm.get("Insert link")};break;case"code":t={name:"code",className:"code",command:"code",tooltip:jm.get("Code"),state:"code"};break;case"codeblock":t={name:"codeblock",className:"codeblock",command:"codeBlock",tooltip:jm.get("Insert CodeBlock"),state:"codeBlock"};break;case"indent":t={name:"indent",className:"indent",command:"indent",tooltip:jm.get("Indent"),state:"indent"};break;case"outdent":t={name:"outdent",className:"outdent",command:"outdent",tooltip:jm.get("Outdent"),state:"outdent"};break;case"scrollSync":t=function(){var e=document.createElement("label"),t=document.createElement("input"),n=document.createElement("span");e.className="scroll-sync active",t.type="checkbox",t.checked=!0,n.className="switch";var r=function(n){return t.addEventListener("change",(function(t){var r=t.target.checked;r?gs(e,"active"):ks(e,"active"),n("toggleScrollSync",{active:r})}))};return e.appendChild(t),e.appendChild(n),{name:"scrollSync",el:e,onMounted:r}}();break;case"more":t={name:"more",className:"more",tooltip:jm.get("More")}}"scrollSync"!==t.name&&(t.className+=" "+nl("toolbar-icons"));return t}(e):e}function ab(e,t){var n=t.el,r=t.pos,i=t.popup,o=t.initialValues;switch(e){case"heading":return{render:function(e){return Xv(Jy||(Jy=$o(["<"," ..."," />"],["<"," ..."," />"])),eb,e)},className:nl("popup-add-heading"),fromEl:n,pos:r};case"link":return{render:function(e){return Xv(Ky||(Ky=$o(["<"," ..."," />"],["<"," ..."," />"])),rb,e)},className:nl("popup-add-link"),fromEl:n,pos:r,initialValues:o};case"image":return{render:function(e){return Xv(Zy||(Zy=$o(["<"," ..."," />"],["<"," ..."," />"])),nb,e)},className:nl("popup-add-image"),fromEl:n,pos:r};case"table":return{render:function(e){return Xv(Xy||(Xy=$o(["<"," ..."," />"],["<"," ..."," />"])),ib,e)},className:nl("popup-add-table"),fromEl:n,pos:r};case"customPopupBody":return i?Vo({render:function(e){return Xv(Qy||(Qy=$o(["<"," ..."," body="," />"],["<"," ..."," body="," />"])),ob,e,i.body)},fromEl:n,pos:r},i):null;default:return null}}function lb(e){e.hidden=e.length===e.filter((function(e){return e.hidden})).length}function cb(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}(sb(e))})));var r=e[(e.length||1)-1];return r&&lb(r),e}),[])}var ub,pb,db=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.handleMousedown=function(e){cl(e.target,"."+nl("popup"))||cl(e.target,t.props.info.fromEl)||t.props.hidePopup()},t}return jo(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=Vo({},r.pos),o=this.refs.el.offsetWidth,s=cl(this.refs.el,"."+nl("toolbar")).offsetWidth;i.left+o>=s&&(i.left=s-o-20),Ks(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=Vo(Vo({display:r?"block":"none"},u),this.state.popupPos);return Xv(ub||(ub=$o(['\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 "])),nl("popup"),c,f,(function(t){return e.refs.el=t}),nl("popup-body"),p&&p({eventEmitter:o,show:r,hidePopup:i,execCommand:s,initialValues:h}))},t}(dy);function hb(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";ns(n.props.tooltipRef.current,{display:"block",left:i,top:o}),n.props.tooltipRef.current.querySelector(".text").textContent=t}},n.hideTooltip=function(){ns(n.props.tooltipRef.current,"display","none")},n.state={active:!1,disabled:e.disabled},n.addEvent(),n}return jo(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=ul(e,cl(e,"."+nl("toolbar"))),n=t.offsetLeft,r=t.offsetTop;return{left:n,top:e.offsetHeight+r}},n.prototype.render=function(){return Xv(pb||(pb=$o(["\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}(dy)}var fb,mb,gb,vb,yb,bb,wb,kb,xb,Cb,Tb,Eb,Mb,Nb,Sb=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=ab(u,{el:t.refs.el,pos:o(t.refs.el),popup:c,initialValues:p});d&&i(d)}},t}return jo(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,ll(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=Vo({display:i.hidden?"none":null},i.style),a=(i.className||"")+(o?" active":"");return Xv(fb||(fb=$o(["\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}(dy),Db=hb(Sb),Lb=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=ab("customPopupBody",{el:t.refs.el,pos:t.props.getBound(t.refs.el),popup:t.props.item.popup});e&&t.props.setPopupInfo(e)},t}return jo(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,ll(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 Xv(mb||(mb=$o(["\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,nl("toolbar-item-wrapper"),i(this.showPopup),i(this.showTooltip),i(this.props.hideTooltip))},t}(dy),Ab=hb(Lb),Ob=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return jo(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 Xv(vb||(vb=$o(['\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 "])),nl("toolbar-group"),i,n.map((function(t){var n=t.el?Ab:Db;return Xv(gb||(gb=$o(["<"," key="," ..."," item="," />"],["<"," key="," ..."," item="," />"])),n,t.name,e.props,t)})),nl("toolbar-divider"),o)},t}(dy),Ib=function(e){function t(t){var n=e.call(this,t)||this;return n.handleClickDocument=function(e){var t=e.target;cl(t,"."+nl("dropdown-toolbar"))||cl(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 jo(t,e),t.prototype.getBound=function(){var e=this.props.getBound(this.refs.el);return e.top+=4,Vo(Vo({},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 Xv(bb||(bb=$o(['\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 "])),nl("toolbar-group"),u,(function(t){return e.refs.el=t}),s.className,(function(){return e.setState({showDropdown:!0})}),this.showTooltip,l,o,nl("dropdown-toolbar"),Vo(Vo({},p),r),(function(t){return e.refs.dropdownEl=t}),c.length?c.map((function(t,n){var r;return Xv(yb||(yb=$o(["\n <","\n group=","\n hiddenDivider=","\n ...","\n />\n "],["\n <","\n group=","\n hiddenDivider=","\n ...","\n />\n "])),Ob,t,n===c.length-1||(null===(r=c[n+1])||void 0===r?void 0:r.hidden),e.props)})):null)},t}(dy),Rb=hb(Ib),Pb=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("."+nl("toolbar-group")+" ."+e);if(r){var i=ul(r,cl(r,"."+nl("toolbar"))),o=i.offsetLeft,s=i.offsetTop,a=ab(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=cb(t.toolbarItems||[],n.hiddenScrollSync()),n.state={items:n.initialItems,dropdownItems:[],showPopup:!1,popupInfo:{},activeTab:"write"},n.tooltipRef={current:null},n.resizeObserver=new Yy((function(){return n.handleResize()})),n.addEvent(),n}return jo(t,e),t.prototype.insertToolbarItem=function(e,t){var n=e.groupIndex,r=e.itemIndex,i=this.initialItems[n];t=sb(t),i?i.splice(r,0,t):this.initialItems.push([t]),this.setState(this.classifyToolbarItems())},t.prototype.removeToolbarItem=function(e){var t=this;Ko(this.initialItems,(function(n){var r=!1;return Ko(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=my((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="'+nl("tooltip")+'" style="display:none">\n <div class="arrow"></div>\n <span class="text"></span>\n </div>';this.tooltipRef.current=al(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=Zs(t);o&&i(o)}},t.prototype.classifyToolbarItems=function(){var e=this,t=0,n=this.refs.el.clientWidth,r=this.refs.el.querySelector("."+nl("toolbar-divider")),i=r?ll(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&&(lb(c),o.push(c)),u.length&&(lb(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})),lb(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(),ol(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 Xv(kb||(kb=$o(['\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 "])),nl("toolbar"),nl("md-tab-container"),"wysiwyg"===i||"vertical"===n?"none":"block",tb,this.tabs,l,this.toggleTab,nl("defaultUI-toolbar"),(function(t){return e.refs.el=t}),d,c.map((function(t,n){var r;return Xv(wb||(wb=$o(["\n <","\n group=","\n hiddenDivider=","\n setItemWidth=","\n ...","\n />\n "],["\n <","\n group=","\n hiddenDivider=","\n setItemWidth=","\n ...","\n />\n "])),Ob,t,n===c.length-1||(null===(r=c[n+1])||void 0===r?void 0:r.hidden),e.setItemWidth,p)})),Rb,sb("more"),u,p,db,s,a,r,this.hidePopup,this.execCommand)},t}(dy),Bb=function(e){function t(t){var n=e.call(this,t)||this;return n.handleClickDocument=function(e){cl(e.target,"."+nl("context-menu"))||n.setState({pos:null})},n.state={pos:null,menuGroups:[]},n.addEvent(),n}return jo(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(Xv(xb||(xb=$o(["\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(Xv(Cb||(Cb=$o(['<ul class="menu-group">\n ',"\n </ul>"],['<ul class="menu-group">\n ',"\n </ul>"])),r)),t}),[]):[]},t.prototype.render=function(){var e=Vo({display:this.state.pos?"block":"none"},this.state.pos);return Xv(Tb||(Tb=$o(['<div class="','" style=',' aria-role="menu">\n ',"\n </div>"],['<div class="','" style=',' aria-role="menu">\n ',"\n </div>"])),nl("context-menu"),e,this.getMenuGroupElements())},t}(dy),Fb=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 jo(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=nl("markdown"===c?"md-mode":"ww-mode"),d=nl("md")+"-"+l+"-style",h=nl(["light"!==o,o+" "]);return Xv(Mb||(Mb=$o(['\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,nl("defaultUI"),u,(function(t){return e.refs.el=t}),Pb,(function(t){return e.toolbar=t}),n,l,i,c,nl("main"),p,(function(t){return e.refs.editorSection=t}),nl("main-container"),nl("md-container"),d,(function(t){return e.refs.mdContainer=t}),nl("md-splitter"),nl("ww-container"),(function(t){return e.refs.wwContainer=t}),!r&&Xv(Eb||(Eb=$o(["<"," eventEmitter="," editorType="," />"],["<"," eventEmitter="," editorType="," />"])),hy,n,c),Bb,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}(dy),Hb=function(e){function t(t){var n,r,i=e.call(this,t)||this,o=uy(i.options.el,Xv(Nb||(Nb=$o(["\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 "])),Fb,(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 jo(t,e),t.factory=function(e){return e.viewer?new Pv(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}(Wv);Wv.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 qb=n(87878),zb=n.n(qb),jb=function(e,t){return jb=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])},jb(e,t)};function Vb(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}jb(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var _b=function(){return _b=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},_b.apply(this,arguments)},$b=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.rootEl=i.createRef(),t}return Vb(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 Hb(_b(_b({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),Ub=(function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.rootEl=i.createRef(),t}Vb(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(zb())(_b(_b({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"})),Wb=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)(Ub,{id:"markdown-wysiwyg",onKeyDown:r},(0,i.createElement)($b,{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")))}}}]);