summaryrefslogtreecommitdiff
path: root/priv/static/adminfe/static/js/chunk-68ea.6d56674a.js
diff options
context:
space:
mode:
Diffstat (limited to 'priv/static/adminfe/static/js/chunk-68ea.6d56674a.js')
-rw-r--r--priv/static/adminfe/static/js/chunk-68ea.6d56674a.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/priv/static/adminfe/static/js/chunk-68ea.6d56674a.js b/priv/static/adminfe/static/js/chunk-68ea.6d56674a.js
new file mode 100644
index 000000000..1f43a39db
--- /dev/null
+++ b/priv/static/adminfe/static/js/chunk-68ea.6d56674a.js
@@ -0,0 +1,26 @@
+(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-68ea"],{"+/fp":function(e,t){e.exports=class{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,n){return""+n}image(e,t,n){return""+n}br(){return""}}},"+V57":function(e,t,n){"use strict";n.d(t,"a",function(){return i}),n.d(t,"b",function(){return a}),n.d(t,"c",function(){return p}),n.d(t,"d",function(){return l}),n.d(t,"e",function(){return u});var r=n("UxO+"),o=n("CsC6"),i=function(e,t){this.match=e,this.handler="string"==typeof t?function(e){return function(t,n,r,o){var i=e;if(n[1]){var s=n[0].lastIndexOf(n[1]);i+=n[0].slice(s+n[1].length);var a=(r+=s)-o;a>0&&(i=n[0].slice(s-a,s)+i,r=o)}return t.tr.insertText(i,r,o)}}(t):t};var s=500;function a(e){var t=e.rules,n=new r.Plugin({state:{init:function(){return null},apply:function(e,t){var n=e.getMeta(this);return n||(e.selectionSet||e.docChanged?null:t)}},props:{handleTextInput:function(e,r,o,i){return c(e,r,o,i,t,n)},handleDOMEvents:{compositionend:function(e){setTimeout(function(){var r=e.state.selection.$cursor;r&&c(e,r.pos,r.pos,"",t,n)})}}},isInputRules:!0});return n}function c(e,t,n,r,o,i){if(e.composing)return!1;var a=e.state,c=a.doc.resolve(t);if(c.parent.type.spec.code)return!1;for(var l=c.parent.textBetween(Math.max(0,c.parentOffset-s),c.parentOffset,null,"")+r,u=0;u<o.length;u++){var p=o[u].match.exec(l),h=p&&o[u].handler(a,p,t-(p[0].length-r.length),n);if(h)return e.dispatch(h.setMeta(i,{transform:h,from:t,to:n,text:r})),!0}return!1}function l(e,t){for(var n=e.plugins,r=0;r<n.length;r++){var o=n[r],i=void 0;if(o.spec.isInputRules&&(i=o.getState(e))){if(t){for(var s=e.tr,a=i.transform,c=a.steps.length-1;c>=0;c--)s.step(a.steps[c].invert(a.docs[c]));var l=s.doc.resolve(i.from).marks();t(s.replaceWith(i.from,i.to,e.schema.text(i.text,l)))}return!0}}return!1}new i(/--$/,"—"),new i(/\.\.\.$/,"…"),new i(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,"“"),new i(/"$/,"”"),new i(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,"‘"),new i(/'$/,"’");function u(e,t,n,r){return new i(e,function(e,i,s,a){var c=n instanceof Function?n(i):n,l=e.tr.delete(s,a),u=l.doc.resolve(s).blockRange(),p=u&&Object(o.i)(u,t,c);if(!p)return null;l.wrap(u,p);var h=l.doc.resolve(s-1).nodeBefore;return h&&h.type==t&&Object(o.f)(l.doc,s-1)&&(!r||r(i,h))&&l.join(s-1),l})}function p(e,t,n){return new i(e,function(e,r,o,i){var s=e.doc.resolve(o),a=n instanceof Function?n(r):n;return s.node(-1).canReplaceWith(s.index(-1),s.indexAfter(-1),t)?e.tr.delete(o,i).setBlockType(o,o,t,a):null})}},"4MG8":function(e,t,n){const r=n("T9Ld"),o=n("66f7"),i=n("SbYC"),s=n("+/fp"),a=n("hyX7"),c=n("J7Ao"),{merge:l,checkSanitizeDeprecation:u,escape:p}=n("rUJ1"),{getDefaults:h,changeDefaults:d,defaults:f}=n("vbtb");function m(e,t,n){if(void 0===e||null===e)throw new Error("marked(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");if(n||"function"==typeof t){n||(n=t,t=null),t=l({},m.defaults,t||{}),u(t);const i=t.highlight;let s,a,c=0;try{s=r.lex(e,t)}catch(e){return n(e)}a=s.length;const p=function(e){if(e)return t.highlight=i,n(e);let r;try{r=o.parse(s,t)}catch(t){e=t}return t.highlight=i,e?n(e):n(null,r)};if(!i||i.length<3)return p();if(delete t.highlight,!a)return p();for(;c<s.length;c++)!function(e){"code"!==e.type?--a||p():i(e.text,e.lang,function(t,n){return t?p(t):null==n||n===e.text?--a||p():(e.text=n,e.escaped=!0,void(--a||p()))})}(s[c])}else try{return t=l({},m.defaults,t||{}),u(t),o.parse(r.lex(e,t),t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",(t||m.defaults).silent)return"<p>An error occurred:</p><pre>"+p(e.message+"",!0)+"</pre>";throw e}}m.options=m.setOptions=function(e){return l(m.defaults,e),d(m.defaults),m},m.getDefaults=h,m.defaults=f,m.Parser=o,m.parser=o.parse,m.Renderer=i,m.TextRenderer=s,m.Lexer=r,m.lexer=r.lex,m.InlineLexer=a,m.inlineLexer=a.output,m.Slugger=c,m.parse=m,e.exports=m},"4r5K":function(e,t){function n(e){Object.freeze(e);var t="function"==typeof e;return Object.getOwnPropertyNames(e).forEach(function(r){!Object.hasOwnProperty.call(e,r)||null===e[r]||"object"!=typeof e[r]&&"function"!=typeof e[r]||t&&("caller"===r||"callee"===r||"arguments"===r)||Object.isFrozen(e[r])||n(e[r])}),e}class r{constructor(e){void 0===e.data&&(e.data={}),this.data=e.data}ignoreMatch(){this.ignore=!0}}function o(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function i(e,...t){var n={};for(const r in e)n[r]=e[r];return t.forEach(function(e){for(const t in e)n[t]=e[t]}),n}function s(e){return e.nodeName.toLowerCase()}var a=Object.freeze({__proto__:null,escapeHTML:o,inherit:i,nodeStream:function(e){var t=[];return function e(n,r){for(var o=n.firstChild;o;o=o.nextSibling)3===o.nodeType?r+=o.nodeValue.length:1===o.nodeType&&(t.push({event:"start",offset:r,node:o}),r=e(o,r),s(o).match(/br|hr|img|input/)||t.push({event:"stop",offset:r,node:o}));return r}(e,0),t},mergeStreams:function(e,t,n){var r=0,i="",a=[];function c(){return e.length&&t.length?e[0].offset!==t[0].offset?e[0].offset<t[0].offset?e:t:"start"===t[0].event?e:t:e.length?e:t}function l(e){i+="<"+s(e)+[].map.call(e.attributes,function(e){return" "+e.nodeName+'="'+o(e.value)+'"'}).join("")+">"}function u(e){i+="</"+s(e)+">"}function p(e){("start"===e.event?l:u)(e.node)}for(;e.length||t.length;){var h=c();if(i+=o(n.substring(r,h[0].offset)),r=h[0].offset,h===e){a.reverse().forEach(u);do{p(h.splice(0,1)[0]),h=c()}while(h===e&&h.length&&h[0].offset===r);a.reverse().forEach(l)}else"start"===h[0].event?a.push(h[0].node):a.pop(),p(h.splice(0,1)[0])}return i+o(n.substr(r))}});const c="</span>",l=e=>!!e.kind;class u{constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=o(e)}openNode(e){if(!l(e))return;let t=e.kind;e.sublanguage||(t=`${this.classPrefix}${t}`),this.span(t)}closeNode(e){l(e)&&(this.buffer+=c)}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}}class p{constructor(){this.rootNode={children:[]},this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){const t={kind:e,children:[]};this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return"string"==typeof t?e.addText(t):t.children&&(e.openNode(t),t.children.forEach(t=>this._walk(e,t)),e.closeNode(t)),e}static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every(e=>"string"==typeof e)?e.children=[e.children.join("")]:e.children.forEach(e=>{p._collapse(e)}))}}class h extends p{constructor(e){super(),this.options=e}addKeyword(e,t){""!==e&&(this.openNode(t),this.addText(e),this.closeNode())}addText(e){""!==e&&this.add(e)}addSublanguage(e,t){const n=e.root;n.kind=t,n.sublanguage=!0,this.add(n)}toHTML(){return new u(this,this.options).value()}finalize(){return!0}}function d(e){return e?"string"==typeof e?e:e.source:null}const f="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",m={begin:"\\\\[\\s\\S]",relevance:0},v={className:"string",begin:"'",end:"'",illegal:"\\n",contains:[m]},g={className:"string",begin:'"',end:'"',illegal:"\\n",contains:[m]},y={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},b=function(e,t,n={}){var r=i({className:"comment",begin:e,end:t,contains:[]},n);return r.contains.push(y),r.contains.push({className:"doctag",begin:"(?:TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):",relevance:0}),r},w=b("//","$"),S=b("/\\*","\\*/"),x=b("#","$"),k={className:"number",begin:"\\b\\d+(\\.\\d+)?",relevance:0},C={className:"number",begin:f,relevance:0},O={className:"number",begin:"\\b(0b[01]+)",relevance:0},M={className:"number",begin:"\\b\\d+(\\.\\d+)?(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},N={begin:/(?=\/[^/\n]*\/)/,contains:[{className:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[m,{begin:/\[/,end:/\]/,relevance:0,contains:[m]}]}]},T={className:"title",begin:"[a-zA-Z]\\w*",relevance:0},D={className:"title",begin:"[a-zA-Z_]\\w*",relevance:0},A={begin:"\\.\\s*[a-zA-Z_]\\w*",relevance:0};var E=Object.freeze({__proto__:null,IDENT_RE:"[a-zA-Z]\\w*",UNDERSCORE_IDENT_RE:"[a-zA-Z_]\\w*",NUMBER_RE:"\\b\\d+(\\.\\d+)?",C_NUMBER_RE:f,BINARY_NUMBER_RE:"\\b(0b[01]+)",RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",SHEBANG:(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=function(...e){return e.map(e=>d(e)).join("")}(t,/.*\b/,e.binary,/\b.*/)),i({className:"meta",begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{0!==e.index&&t.ignoreMatch()}},e)},BACKSLASH_ESCAPE:m,APOS_STRING_MODE:v,QUOTE_STRING_MODE:g,PHRASAL_WORDS_MODE:y,COMMENT:b,C_LINE_COMMENT_MODE:w,C_BLOCK_COMMENT_MODE:S,HASH_COMMENT_MODE:x,NUMBER_MODE:k,C_NUMBER_MODE:C,BINARY_NUMBER_MODE:O,CSS_NUMBER_MODE:M,REGEXP_MODE:N,TITLE_MODE:T,UNDERSCORE_TITLE_MODE:D,METHOD_GUARD:A,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})}}),R="of and for in not or if then".split(" ");function _(e){function t(t,n){return new RegExp(d(t),"m"+(e.case_insensitive?"i":"")+(n?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,t){t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),this.matchAt+=function(e){return new RegExp(e.toString()+"|").exec("").length-1}(e)+1}compile(){0===this.regexes.length&&(this.exec=(()=>null));const e=this.regexes.map(e=>e[1]);this.matcherRe=t(function(e,t="|"){for(var n=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./,r=0,o="",i=0;i<e.length;i++){var s=r+=1,a=d(e[i]);for(i>0&&(o+=t),o+="(";a.length>0;){var c=n.exec(a);if(null==c){o+=a;break}o+=a.substring(0,c.index),a=a.substring(c.index+c[0].length),"\\"===c[0][0]&&c[1]?o+="\\"+String(Number(c[1])+s):(o+=c[0],"("===c[0]&&r++)}o+=")"}return o}(e),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;const t=this.matcherRe.exec(e);if(!t)return null;const n=t.findIndex((e,t)=>t>0&&void 0!==e),r=this.matchIndexes[n];return t.splice(0,n),Object.assign(t,r)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];const t=new n;return this.rules.slice(e).forEach(([e,n])=>t.addRule(e,n)),t.compile(),this.multiRegexes[e]=t,t}considerAll(){this.regexIndex=0}addRule(e,t){this.rules.push([e,t]),"begin"===t.type&&this.count++}exec(e){const t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex;const n=t.exec(e);return n&&(this.regexIndex+=n.position+1,this.regexIndex===this.count&&(this.regexIndex=0)),n}}function o(e,t){const n=e.input[e.index-1],r=e.input[e.index+e[0].length];"."!==n&&"."!==r||t.ignoreMatch()}if(e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return function n(s,a){const c=s;if(s.compiled)return c;s.compiled=!0,s.__beforeBegin=null,s.keywords=s.keywords||s.beginKeywords;let l=null;if("object"==typeof s.keywords&&(l=s.keywords.$pattern,delete s.keywords.$pattern),s.keywords&&(s.keywords=function(e,t){var n={};return"string"==typeof e?r("keyword",e):Object.keys(e).forEach(function(t){r(t,e[t])}),n;function r(e,r){t&&(r=r.toLowerCase()),r.split(" ").forEach(function(t){var r=t.split("|");n[r[0]]=[e,function(e,t){return t?Number(t):function(e){return R.includes(e.toLowerCase())}(e)?0:1}(r[0],r[1])]})}}(s.keywords,e.case_insensitive)),s.lexemes&&l)throw new Error("ERR: Prefer `keywords.$pattern` to `mode.lexemes`, BOTH are not allowed. (see mode reference) ");return c.keywordPatternRe=t(s.lexemes||l||/\w+/,!0),a&&(s.beginKeywords&&(s.begin="\\b("+s.beginKeywords.split(" ").join("|")+")(?=\\b|\\s)",s.__beforeBegin=o),s.begin||(s.begin=/\B|\b/),c.beginRe=t(s.begin),s.endSameAsBegin&&(s.end=s.begin),s.end||s.endsWithParent||(s.end=/\B|\b/),s.end&&(c.endRe=t(s.end)),c.terminator_end=d(s.end)||"",s.endsWithParent&&a.terminator_end&&(c.terminator_end+=(s.end?"|":"")+a.terminator_end)),s.illegal&&(c.illegalRe=t(s.illegal)),void 0===s.relevance&&(s.relevance=1),s.contains||(s.contains=[]),s.contains=[].concat(...s.contains.map(function(e){return function(e){return e.variants&&!e.cached_variants&&(e.cached_variants=e.variants.map(function(t){return i(e,{variants:null},t)})),e.cached_variants?e.cached_variants:function e(t){return!!t&&(t.endsWithParent||e(t.starts))}(e)?i(e,{starts:e.starts?i(e.starts):null}):Object.isFrozen(e)?i(e):e}("self"===e?s:e)})),s.contains.forEach(function(e){n(e,c)}),s.starts&&n(s.starts,a),c.matcher=function(e){const t=new r;return e.contains.forEach(e=>t.addRule(e.begin,{rule:e,type:"begin"})),e.terminator_end&&t.addRule(e.terminator_end,{type:"end"}),e.illegal&&t.addRule(e.illegal,{type:"illegal"}),t}(c),c}(e)}const P=o,$=i,{nodeStream:I,mergeStreams:z}=a,B=Symbol("nomatch");var F=function(e){var t=[],o=Object.create(null),i=Object.create(null),s=[],a=!0,c=/(^(<[^>]+>|\t|)+|\n)/gm,l="Could not find the language '{}', did you forget to load/include a language module?";const u={disableAutodetect:!0,name:"Plain text",contains:[]};var p={noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",tabReplace:null,useBR:!1,languages:null,__emitter:h};function d(e){return p.noHighlightRe.test(e)}function f(e,t,n,r){var o={code:t,language:e};k("before:highlight",o);var i=o.result?o.result:m(o.language,o.code,n,r);return i.code=o.code,k("after:highlight",i),i}function m(e,t,n,i){var s=t;function c(e,t){var n=S.case_insensitive?t[0].toLowerCase():t[0];return Object.prototype.hasOwnProperty.call(e.keywords,n)&&e.keywords[n]}function u(){null!=C.subLanguage?function(){if(""!==N){var e=null;if("string"==typeof C.subLanguage){if(!o[C.subLanguage])return void M.addText(N);e=m(C.subLanguage,N,!0,O[C.subLanguage]),O[C.subLanguage]=e.top}else e=v(N,C.subLanguage.length?C.subLanguage:null);C.relevance>0&&(T+=e.relevance),M.addSublanguage(e.emitter,e.language)}}():function(){if(!C.keywords)return void M.addText(N);let e=0;C.keywordPatternRe.lastIndex=0;let t=C.keywordPatternRe.exec(N),n="";for(;t;){n+=N.substring(e,t.index);const r=c(C,t);if(r){const[e,o]=r;M.addText(n),n="",T+=o,M.addKeyword(t[0],e)}else n+=t[0];e=C.keywordPatternRe.lastIndex,t=C.keywordPatternRe.exec(N)}n+=N.substr(e),M.addText(n)}(),N=""}function h(e){return e.className&&M.openNode(e.className),C=Object.create(e,{parent:{value:C}})}function d(e){return 0===C.matcher.regexIndex?(N+=e[0],1):(E=!0,0)}function f(e){var t=e[0],n=e.rule;const o=new r(n),i=[n.__beforeBegin,n["on:begin"]];for(const r of i)if(r&&(r(e,o),o.ignore))return d(t);return n&&n.endSameAsBegin&&(n.endRe=function(e){return new RegExp(e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"m")}(t)),n.skip?N+=t:(n.excludeBegin&&(N+=t),u(),n.returnBegin||n.excludeBegin||(N=t)),h(n),n.returnBegin?0:t.length}function g(e){var t=e[0],n=s.substr(e.index),o=function e(t,n,o){let i=function(e,t){var n=e&&e.exec(t);return n&&0===n.index}(t.endRe,o);if(i){if(t["on:end"]){const e=new r(t);t["on:end"](n,e),e.ignore&&(i=!1)}if(i){for(;t.endsParent&&t.parent;)t=t.parent;return t}}if(t.endsWithParent)return e(t.parent,n,o)}(C,e,n);if(!o)return B;var i=C;i.skip?N+=t:(i.returnEnd||i.excludeEnd||(N+=t),u(),i.excludeEnd&&(N=t));do{C.className&&M.closeNode(),C.skip||C.subLanguage||(T+=C.relevance),C=C.parent}while(C!==o.parent);return o.starts&&(o.endSameAsBegin&&(o.starts.endRe=o.endRe),h(o.starts)),i.returnEnd?0:t.length}var y={};function b(t,r){var o=r&&r[0];if(N+=t,null==o)return u(),0;if("begin"===y.type&&"end"===r.type&&y.index===r.index&&""===o){if(N+=s.slice(r.index,r.index+1),!a){const t=new Error("0 width match regex");throw t.languageName=e,t.badRule=y.rule,t}return 1}if(y=r,"begin"===r.type)return f(r);if("illegal"===r.type&&!n){const e=new Error('Illegal lexeme "'+o+'" for mode "'+(C.className||"<unnamed>")+'"');throw e.mode=C,e}if("end"===r.type){var i=g(r);if(i!==B)return i}if("illegal"===r.type&&""===o)return 1;if(A>1e5&&A>3*r.index)throw new Error("potential infinite loop, way more iterations than matches");return N+=o,o.length}var S=w(e);if(!S)throw console.error(l.replace("{}",e)),new Error('Unknown language: "'+e+'"');var x=_(S),k="",C=i||x,O={},M=new p.__emitter(p);!function(){for(var e=[],t=C;t!==S;t=t.parent)t.className&&e.unshift(t.className);e.forEach(e=>M.openNode(e))}();var N="",T=0,D=0,A=0,E=!1;try{for(C.matcher.considerAll();;){A++,E?E=!1:(C.matcher.lastIndex=D,C.matcher.considerAll());const e=C.matcher.exec(s);if(!e)break;const t=b(s.substring(D,e.index),e);D=e.index+t}return b(s.substr(D)),M.closeAllNodes(),M.finalize(),k=M.toHTML(),{relevance:T,value:k,language:e,illegal:!1,emitter:M,top:C}}catch(t){if(t.message&&t.message.includes("Illegal"))return{illegal:!0,illegalBy:{msg:t.message,context:s.slice(D-100,D+100),mode:t.mode},sofar:k,relevance:0,value:P(s),emitter:M};if(a)return{illegal:!1,relevance:0,value:P(s),emitter:M,language:e,top:C,errorRaised:t};throw t}}function v(e,t){t=t||p.languages||Object.keys(o);var n=function(e){const t={relevance:0,emitter:new p.__emitter(p),value:P(e),illegal:!1,top:u};return t.emitter.addText(e),t}(e),r=n;return t.filter(w).filter(x).forEach(function(t){var o=m(t,e,!1);o.language=t,o.relevance>r.relevance&&(r=o),o.relevance>n.relevance&&(r=n,n=o)}),r.language&&(n.second_best=r),n}function g(e){return p.tabReplace||p.useBR?e.replace(c,e=>"\n"===e?p.useBR?"<br>":e:p.tabReplace?e.replace(/\t/g,p.tabReplace):e):e}function y(e){let t=null;const n=function(e){var t=e.className+" ";t+=e.parentNode?e.parentNode.className:"";const n=p.languageDetectRe.exec(t);if(n){var r=w(n[1]);return r||(console.warn(l.replace("{}",n[1])),console.warn("Falling back to no-highlight mode for this block.",e)),r?n[1]:"no-highlight"}return t.split(/\s+/).find(e=>d(e)||w(e))}(e);if(d(n))return;k("before:highlightBlock",{block:e,language:n}),p.useBR?(t=document.createElement("div")).innerHTML=e.innerHTML.replace(/\n/g,"").replace(/<br[ /]*>/g,"\n"):t=e;const r=t.textContent,o=n?f(n,r,!0):v(r),s=I(t);if(s.length){const e=document.createElement("div");e.innerHTML=o.value,o.value=z(s,I(e),r)}o.value=g(o.value),k("after:highlightBlock",{block:e,result:o}),e.innerHTML=o.value,e.className=function(e,t,n){var r=t?i[t]:n,o=[e.trim()];return e.match(/\bhljs\b/)||o.push("hljs"),e.includes(r)||o.push(r),o.join(" ").trim()}(e.className,n,o.language),e.result={language:o.language,re:o.relevance,relavance:o.relevance},o.second_best&&(e.second_best={language:o.second_best.language,re:o.second_best.relevance,relavance:o.second_best.relevance})}const b=()=>{if(!b.called){b.called=!0;var e=document.querySelectorAll("pre code");t.forEach.call(e,y)}};function w(e){return e=(e||"").toLowerCase(),o[e]||o[i[e]]}function S(e,{languageName:t}){"string"==typeof e&&(e=[e]),e.forEach(e=>{i[e]=t})}function x(e){var t=w(e);return t&&!t.disableAutodetect}function k(e,t){var n=e;s.forEach(function(e){e[n]&&e[n](t)})}Object.assign(e,{highlight:f,highlightAuto:v,fixMarkup:g,highlightBlock:y,configure:function(e){p=$(p,e)},initHighlighting:b,initHighlightingOnLoad:function(){window.addEventListener("DOMContentLoaded",b,!1)},registerLanguage:function(t,n){var r=null;try{r=n(e)}catch(e){if(console.error("Language definition for '{}' could not be registered.".replace("{}",t)),!a)throw e;console.error(e),r=u}r.name||(r.name=t),o[t]=r,r.rawDefinition=n.bind(null,e),r.aliases&&S(r.aliases,{languageName:t})},listLanguages:function(){return Object.keys(o)},getLanguage:w,registerAliases:S,requireLanguage:function(e){var t=w(e);if(t)return t;throw new Error("The '{}' language is required, but not loaded.".replace("{}",e))},autoDetection:x,inherit:$,addPlugin:function(e){s.push(e)}}),e.debugMode=function(){a=!1},e.safeMode=function(){a=!0},e.versionString="10.1.2";for(const r in E)"object"==typeof E[r]&&n(E[r]);return Object.assign(e,E),e}({});e.exports=F},"66f7":function(e,t,n){const r=n("SbYC"),o=n("J7Ao"),i=n("hyX7"),s=n("+/fp"),{defaults:a}=n("vbtb"),{merge:c,unescape:l}=n("rUJ1");e.exports=class e{constructor(e){this.tokens=[],this.token=null,this.options=e||a,this.options.renderer=this.options.renderer||new r,this.renderer=this.options.renderer,this.renderer.options=this.options,this.slugger=new o}static parse(t,n){return new e(n).parse(t)}parse(e){this.inline=new i(e.links,this.options),this.inlineText=new i(e.links,c({},this.options,{renderer:new s})),this.tokens=e.reverse();let t="";for(;this.next();)t+=this.tok();return t}next(){return this.token=this.tokens.pop(),this.token}peek(){return this.tokens[this.tokens.length-1]||0}parseText(){let e=this.token.text;for(;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)}tok(){let e="";switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,l(this.inlineText.output(this.token.text)),this.slugger);case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":{let t,n,r,o,i="";for(r="",t=0;t<this.token.header.length;t++)r+=this.renderer.tablecell(this.inline.output(this.token.header[t]),{header:!0,align:this.token.align[t]});for(i+=this.renderer.tablerow(r),t=0;t<this.token.cells.length;t++){for(n=this.token.cells[t],r="",o=0;o<n.length;o++)r+=this.renderer.tablecell(this.inline.output(n[o]),{header:!1,align:this.token.align[o]});e+=this.renderer.tablerow(r)}return this.renderer.table(i,e)}case"blockquote_start":for(e="";"blockquote_end"!==this.next().type;)e+=this.tok();return this.renderer.blockquote(e);case"list_start":{e="";const t=this.token.ordered,n=this.token.start;for(;"list_end"!==this.next().type;)e+=this.tok();return this.renderer.list(e,t,n)}case"list_item_start":{e="";const t=this.token.loose,n=this.token.checked,r=this.token.task;if(this.token.task)if(t)if("text"===this.peek().type){const e=this.peek();e.text=this.renderer.checkbox(n)+" "+e.text}else this.tokens.push({type:"text",text:this.renderer.checkbox(n)});else e+=this.renderer.checkbox(n);for(;"list_item_end"!==this.next().type;)e+=t||"text"!==this.token.type?this.tok():this.parseText();return this.renderer.listitem(e,r,n)}case"html":return this.renderer.html(this.token.text);case"paragraph":return this.renderer.paragraph(this.inline.output(this.token.text));case"text":return this.renderer.paragraph(this.parseText());default:{const e='Token with "'+this.token.type+'" type was not found.';if(!this.options.silent)throw new Error(e);console.log(e)}}}}},"8j27":function(e,t,n){"use strict";n.d(t,"a",function(){return T}),n.d(t,"b",function(){return $}),n.d(t,"c",function(){return D}),n.d(t,"d",function(){return A}),n.d(t,"e",function(){return E}),n.d(t,"f",function(){return F}),n.d(t,"g",function(){return R}),n.d(t,"h",function(){return I}),n.d(t,"i",function(){return z}),n.d(t,"j",function(){return _}),n.d(t,"k",function(){return P}),n.d(t,"l",function(){return B});var r=n("zUJn"),o=n("qd4/"),i=(n("POQ2"),n("V2qZ"),n("mG1W"),n("UxO+")),s=n("Vb5C"),a=n("oV9I"),c=n("CsC6");new i.PluginKey("collab");var l=function(){};l.prototype.append=function(e){return e.length?(e=l.from(e),!this.length&&e||e.length<200&&this.leafAppend(e)||this.length<200&&e.leafPrepend(this)||this.appendInner(e)):this},l.prototype.prepend=function(e){return e.length?l.from(e).append(this):this},l.prototype.appendInner=function(e){return new p(this,e)},l.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t?l.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},l.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},l.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)},l.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},l.from=function(e){return e instanceof l?e:e&&e.length?new u(e):l.empty};var u=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 o=t;o<n;o++)if(!1===e(this.values[o],r+o))return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var o=t-1;o>=n;o--)if(!1===e(this.values[o],r+o))return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=200)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=200)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}(l);l.empty=new u([]);var p=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 o=this.left.length;return!(t<o&&!1===this.left.forEachInner(e,t,Math.min(n,o),r))&&(!(n>o&&!1===this.right.forEachInner(e,Math.max(t-o,0),Math.min(this.length,n)-o,r+o))&&void 0)},t.prototype.forEachInvertedInner=function(e,t,n,r){var o=this.left.length;return!(t>o&&!1===this.right.forEachInvertedInner(e,t-o,Math.max(n,o)-o,r+o))&&(!(n<o&&!1===this.left.forEachInvertedInner(e,Math.min(t,o),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}(l),h=l,d=function(e,t){this.items=e,this.eventCount=t};d.prototype.popEvent=function(e,t){var n=this;if(0==this.eventCount)return null;for(var r,o,i=this.items.length;;i--){if(this.items.get(i-1).selection){--i;break}}t&&(r=this.remapping(i,this.items.length),o=r.maps.length);var s,a,c=e.tr,l=[],u=[];return this.items.forEach(function(e,t){if(!e.step)return r||(r=n.remapping(i,t+1),o=r.maps.length),o--,void u.push(e);if(r){u.push(new f(e.map));var p,h=e.step.map(r.slice(o));h&&c.maybeStep(h).doc&&(p=c.mapping.maps[c.mapping.maps.length-1],l.push(new f(p,null,null,l.length+u.length))),o--,p&&r.appendMap(p,o)}else c.maybeStep(e.step);return e.selection?(s=r?e.selection.map(r.slice(o)):e.selection,a=new d(n.items.slice(0,i).append(u.reverse().concat(l)),n.eventCount-1),!1):void 0},this.items.length,0),{remaining:a,transform:c,selection:s}},d.prototype.addTransform=function(e,t,n,r){for(var o=[],i=this.eventCount,s=this.items,a=!r&&s.length?s.get(s.length-1):null,c=0;c<e.steps.length;c++){var l,u=e.steps[c].invert(e.docs[c]),p=new f(e.mapping.maps[c],u,t);(l=a&&a.merge(p))&&(p=l,c?o.pop():s=s.slice(0,s.length-1)),o.push(p),t&&(i++,t=null),r||(a=p)}var h=i-n.depth;return h>v&&(s=function(e,t){var n;return e.forEach(function(e,r){if(e.selection&&0==t--)return n=r,!1}),e.slice(n)}(s,h),i-=h),new d(s.append(o),i)},d.prototype.remapping=function(e,t){var n=new c.a;return this.items.forEach(function(t,r){var o=null!=t.mirrorOffset&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:null;n.appendMap(t.map,o)},e,t),n},d.prototype.addMaps=function(e){return 0==this.eventCount?this:new d(this.items.append(e.map(function(e){return new f(e)})),this.eventCount)},d.prototype.rebased=function(e,t){if(!this.eventCount)return this;var n=[],r=Math.max(0,this.items.length-t),o=e.mapping,i=e.steps.length,s=this.eventCount;this.items.forEach(function(e){e.selection&&s--},r);var a=t;this.items.forEach(function(t){var r=o.getMirror(--a);if(null!=r){i=Math.min(i,r);var c=o.maps[r];if(t.step){var l=e.steps[r].invert(e.docs[r]),u=t.selection&&t.selection.map(o.slice(a+1,r));u&&s++,n.push(new f(c,l,u))}else n.push(new f(c))}},r);for(var c=[],l=t;l<i;l++)c.push(new f(o.maps[l]));var u=this.items.slice(0,r).append(c).append(n),p=new d(u,s);return p.emptyItemCount()>500&&(p=p.compress(this.items.length-n.length)),p},d.prototype.emptyItemCount=function(){var e=0;return this.items.forEach(function(t){t.step||e++}),e},d.prototype.compress=function(e){void 0===e&&(e=this.items.length);var t=this.remapping(0,e),n=t.maps.length,r=[],o=0;return this.items.forEach(function(i,s){if(s>=e)r.push(i),i.selection&&o++;else if(i.step){var a=i.step.map(t.slice(n)),c=a&&a.getMap();if(n--,c&&t.appendMap(c,n),a){var l=i.selection&&i.selection.map(t.slice(n));l&&o++;var u,p=new f(c.invert(),a,l),h=r.length-1;(u=r.length&&r[h].merge(p))?r[h]=u:r.push(p)}}else i.map&&n--},this.items.length,0),new d(h.from(r.reverse()),o)},d.empty=new d(h.empty,0);var f=function(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r};f.prototype.merge=function(e){if(this.step&&e.step&&!e.selection){var t=e.step.merge(this.step);if(t)return new f(t.getMap().invert(),t,this.selection)}};var m=function(e,t,n,r){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r},v=20;function g(e){var t=[];return e.forEach(function(e,n,r,o){return t.push(r,o)}),t}function y(e,t){if(!e)return null;for(var n=[],r=0;r<e.length;r+=2){var o=t.map(e[r],1),i=t.map(e[r+1],-1);o<=i&&n.push(o,i)}return n}function b(e,t,n,r){var o=x(t),i=k.get(t).spec.config,s=(r?e.undone:e.done).popEvent(t,o);if(s){var a=s.selection.resolve(s.transform.doc),c=(r?e.done:e.undone).addTransform(s.transform,t.selection.getBookmark(),i,o),l=new m(r?c:s.remaining,r?s.remaining:c,null,0);n(s.transform.setSelection(a).setMeta(k,{redo:r,historyState:l}).scrollIntoView())}}var w=!1,S=null;function x(e){var t=e.plugins;if(S!=t){w=!1,S=t;for(var n=0;n<t.length;n++)if(t[n].spec.historyPreserveItems){w=!0;break}}return w}var k=new i.PluginKey("history"),C=new i.PluginKey("closeHistory");function O(e){return e={depth:e&&e.depth||100,newGroupDelay:e&&e.newGroupDelay||500},new i.Plugin({key:k,state:{init:function(){return new m(d.empty,d.empty,null,0)},apply:function(t,n,r){return function(e,t,n,r){var o,i=n.getMeta(k);if(i)return i.historyState;n.getMeta(C)&&(e=new m(e.done,e.undone,null,0));var s=n.getMeta("appendedTransaction");if(0==n.steps.length)return e;if(s&&s.getMeta(k))return s.getMeta(k).redo?new m(e.done.addTransform(n,null,r,x(t)),e.undone,g(n.mapping.maps[n.steps.length-1]),e.prevTime):new m(e.done,e.undone.addTransform(n,null,r,x(t)),null,e.prevTime);if(!1===n.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))return(o=n.getMeta("rebased"))?new m(e.done.rebased(n,o),e.undone.rebased(n,o),y(e.prevRanges,n.mapping),e.prevTime):new m(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),y(e.prevRanges,n.mapping),e.prevTime);var a=0==e.prevTime||!s&&(e.prevTime<(n.time||0)-r.newGroupDelay||!function(e,t){if(!t)return!1;if(!e.docChanged)return!0;var n=!1;return e.mapping.maps[0].forEach(function(e,r){for(var o=0;o<t.length;o+=2)e<=t[o+1]&&r>=t[o]&&(n=!0)}),n}(n,e.prevRanges)),c=s?y(e.prevRanges,n.mapping):g(n.mapping.maps[n.steps.length-1]);return new m(e.done.addTransform(n,a?t.selection.getBookmark():null,r,x(t)),d.empty,c,n.time)}(n,r,t,e)}},config:e})}function M(e,t){var n=k.getState(e);return!(!n||0==n.done.eventCount)&&(t&&b(n,e,t,!1),!0)}function N(e,t){var n=k.getState(e);return!(!n||0==n.undone.eventCount)&&(t&&b(n,e,t,!0),!0)}
+/*!
+ * tiptap-extensions v1.32.6
+ * (c) 2020 überdosis GbR (limited liability)
+ * @license MIT
+ */
+class T extends r.f{get name(){return"blockquote"}get schema(){return{content:"block*",group:"block",defining:!0,draggable:!1,parseDOM:[{tag:"blockquote"}],toDOM:()=>["blockquote",0]}}commands({type:e,schema:t}){return()=>Object(o.s)(e,t.nodes.paragraph)}keys({type:e}){return{"Ctrl->":Object(o.s)(e)}}inputRules({type:e}){return[Object(o.u)(/^\s*>\s$/,e)]}}class D extends r.f{get name(){return"bullet_list"}get schema(){return{content:"list_item+",group:"block",parseDOM:[{tag:"ul"}],toDOM:()=>["ul",0]}}commands({type:e,schema:t}){return()=>Object(o.q)(e,t.nodes.list_item)}keys({type:e,schema:t}){return{"Shift-Ctrl-8":Object(o.q)(e,t.nodes.list_item)}}inputRules({type:e}){return[Object(o.u)(/^\s*([-+*])\s$/,e)]}}class A extends r.f{get name(){return"code_block"}get schema(){return{content:"text*",marks:"",group:"block",code:!0,defining:!0,draggable:!1,parseDOM:[{tag:"pre",preserveWhitespace:"full"}],toDOM:()=>["pre",["code",0]]}}commands({type:e,schema:t}){return()=>Object(o.p)(e,t.nodes.paragraph)}keys({type:e}){return{"Shift-Ctrl-\\":Object(o.k)(e)}}inputRules({type:e}){return[Object(o.o)(/^```$/,e)]}}class E extends r.f{get name(){return"heading"}get defaultOptions(){return{levels:[1,2,3,4,5,6]}}get schema(){return{attrs:{level:{default:1}},content:"inline*",group:"block",defining:!0,draggable:!1,parseDOM:this.options.levels.map(e=>({tag:"h".concat(e),attrs:{level:e}})),toDOM:e=>["h".concat(e.attrs.level),0]}}commands({type:e,schema:t}){return n=>Object(o.p)(e,t.nodes.paragraph,n)}keys({type:e}){return this.options.levels.reduce((t,n)=>({...t,...{["Shift-Ctrl-".concat(n)]:Object(o.k)(e,{level:n})}}),{})}inputRules({type:e}){return this.options.levels.map(t=>Object(o.o)(new RegExp("^(#{1,".concat(t,"})\\s$")),e,()=>({level:t})))}}class R extends r.f{get name(){return"horizontal_rule"}get schema(){return{group:"block",parseDOM:[{tag:"hr"}],toDOM:()=>["hr"]}}commands({type:e}){return()=>(t,n)=>n(t.tr.replaceSelectionWith(e.create()))}inputRules({type:e}){return[Object(o.g)(/^(?:---|___\s|\*\*\*\s)$/,e)]}}class _ extends r.f{get name(){return"list_item"}get schema(){return{content:"paragraph block*",defining:!0,draggable:!1,parseDOM:[{tag:"li"}],toDOM:()=>["li",0]}}keys({type:e}){return{Enter:Object(o.m)(e),Tab:Object(o.l)(e),"Shift-Tab":Object(o.d)(e)}}}class P extends r.f{get name(){return"ordered_list"}get schema(){return{attrs:{order:{default:1}},content:"list_item+",group:"block",parseDOM:[{tag:"ol",getAttrs:e=>({order:e.hasAttribute("start")?+e.getAttribute("start"):1})}],toDOM:e=>1===e.attrs.order?["ol",0]:["ol",{start:e.attrs.order},0]}}commands({type:e,schema:t}){return()=>Object(o.q)(e,t.nodes.list_item)}keys({type:e,schema:t}){return{"Shift-Ctrl-9":Object(o.q)(e,t.nodes.list_item)}}inputRules({type:e}){return[Object(o.u)(/^(\d+)\.\s$/,e,e=>({order:+e[1]}),(e,t)=>t.childCount+t.attrs.order===+e[1])]}}Object(s.tableNodes)({tableGroup:"block",cellContent:"block+",cellAttributes:{background:{default:null,getFromDOM:e=>e.style.backgroundColor||null,setDOMAttr(e,t){if(e){const n={style:"".concat(t.style||"","background-color: ").concat(e,";")};Object.assign(t,n)}}}}});class $ extends r.e{get name(){return"bold"}get schema(){return{parseDOM:[{tag:"strong"},{tag:"b",getAttrs:e=>"normal"!==e.style.fontWeight&&null},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}],toDOM:()=>["strong",0]}}keys({type:e}){return{"Mod-b":Object(o.r)(e)}}commands({type:e}){return()=>Object(o.r)(e)}inputRules({type:e}){return[Object(o.e)(/(?:\*\*|__)([^*_]+)(?:\*\*|__)$/,e)]}pasteRules({type:e}){return[Object(o.f)(/(?:\*\*|__)([^*_]+)(?:\*\*|__)/g,e)]}}class I extends r.e{get name(){return"italic"}get schema(){return{parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style=italic"}],toDOM:()=>["em",0]}}keys({type:e}){return{"Mod-i":Object(o.r)(e)}}commands({type:e}){return()=>Object(o.r)(e)}inputRules({type:e}){return[Object(o.e)(/(?:^|[^_])(_([^_]+)_)$/,e),Object(o.e)(/(?:^|[^*])(\*([^*]+)\*)$/,e)]}pasteRules({type:e}){return[Object(o.f)(/_([^_]+)_/g,e),Object(o.f)(/\*([^*]+)\*/g,e)]}}class z extends r.e{get name(){return"link"}get defaultOptions(){return{openOnClick:!0,target:null}}get schema(){return{attrs:{href:{default:null},target:{default:null}},inclusive:!1,parseDOM:[{tag:"a[href]",getAttrs:e=>({href:e.getAttribute("href"),target:e.getAttribute("target")})}],toDOM:e=>["a",{...e.attrs,rel:"noopener noreferrer nofollow",target:this.options.target},0]}}commands({type:e}){return t=>t.href?Object(o.t)(e,t):Object(o.i)(e)}pasteRules({type:e}){return[Object(o.h)(/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z]{2,}\b([-a-zA-Z0-9@:%_+.~#?&//=,]*)/gi,e,e=>({href:e}))]}get plugins(){return this.options.openOnClick?[new r.g({props:{handleClick:(e,t,n)=>{const{schema:r}=e.state,o=Object(a.a)(e.state,r.marks.link);o.href&&n.target instanceof HTMLAnchorElement&&(n.stopPropagation(),window.open(o.href,o.target))}}})]:[]}}class B extends r.e{get name(){return"underline"}get schema(){return{parseDOM:[{tag:"u"},{style:"text-decoration",getAttrs:e=>"underline"===e}],toDOM:()=>["u",0]}}keys({type:e}){return{"Mod-u":Object(o.r)(e)}}commands({type:e}){return()=>Object(o.r)(e)}}class F extends r.d{get name(){return"history"}get defaultOptions(){return{depth:"",newGroupDelay:""}}keys(){return{"Mod-z":M,"Mod-y":N,"Shift-Mod-z":N,"Mod-я":M,"Shift-Mod-я":N}}get plugins(){return[O({depth:this.options.depth,newGroupDelay:this.options.newGroupDelay})]}commands(){return{undo:()=>M,redo:()=>N,undoDepth:()=>(function(e){var t=k.getState(e);return t?t.done.eventCount:0}),redoDepth:()=>(function(e){var t=k.getState(e);return t?t.undone.eventCount:0})}}}},ABBN:function(e,t,n){"use strict";n.d(t,"a",function(){return C}),n.d(t,"b",function(){return y}),n.d(t,"c",function(){return h}),n.d(t,"d",function(){return u}),n.d(t,"e",function(){return v}),n.d(t,"f",function(){return g}),n.d(t,"g",function(){return m});var r=n("CsC6"),o=n("MEpN"),i=n("UxO+");function s(e,t){return!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0)}function a(e,t){for(;e;e="start"==t?e.firstChild:e.lastChild)if(e.isTextblock)return!0;return!1}function c(e){if(!e.parent.type.spec.isolating)for(var t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function l(e){if(!e.parent.type.spec.isolating)for(var t=e.depth-1;t>=0;t--){var n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}function u(e,t){var n=e.selection,o=n.$from,i=n.$to,s=o.blockRange(i),a=s&&Object(r.k)(s);return null!=a&&(t&&t(e.tr.lift(s,a).scrollIntoView()),!0)}function p(e){for(var t=0;t<e.edgeCount;t++){var n=e.edge(t).type;if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function h(e,t){var n=e.selection,r=n.$head,o=n.$anchor;if(!r.parent.type.spec.code||!r.sameParent(o))return!1;var s=r.node(-1),a=r.indexAfter(-1),c=p(s.contentMatchAt(a));if(!s.canReplaceWith(a,a,c))return!1;if(t){var l=r.after(),u=e.tr.replaceWith(l,l,c.createAndFill());u.setSelection(i.Selection.near(u.doc.resolve(l),1)),t(u.scrollIntoView())}return!0}function d(e,t){var n=e.selection,s=n.$from,a=n.$to;if(e.selection instanceof i.NodeSelection&&e.selection.node.isBlock)return!(!s.parentOffset||!Object(r.g)(e.doc,s.pos))&&(t&&t(e.tr.split(s.pos).scrollIntoView()),!0);if(!s.parent.isBlock)return!1;if(t){var c=a.parentOffset==a.parent.content.size,l=e.tr;e.selection instanceof i.TextSelection&&l.deleteSelection();var u=0==s.depth?null:p(s.node(-1).contentMatchAt(s.indexAfter(-1))),h=c&&u?[{type:u}]:null,d=Object(r.g)(l.doc,l.mapping.map(s.pos),1,h);h||d||!Object(r.g)(l.doc,l.mapping.map(s.pos),1,u&&[{type:u}])||(h=[{type:u}],d=!0),d&&(l.split(l.mapping.map(s.pos),1,h),c||s.parentOffset||s.parent.type==u||!s.node(-1).canReplace(s.index(-1),s.indexAfter(-1),o.Fragment.from(u.create(),s.parent))||l.setNodeMarkup(l.mapping.map(s.before()),u)),t(l.scrollIntoView())}return!0}function f(e,t,n){var s,a,c=t.nodeBefore,l=t.nodeAfter;if(c.type.spec.isolating||l.type.spec.isolating)return!1;if(function(e,t,n){var o=t.nodeBefore,i=t.nodeAfter,s=t.index();return!(!(o&&i&&o.type.compatibleContent(i.type))||(!o.content.size&&t.parent.canReplace(s-1,s)?(n&&n(e.tr.delete(t.pos-o.nodeSize,t.pos).scrollIntoView()),0):!t.parent.canReplace(s,s+1)||!i.isTextblock&&!Object(r.f)(e.doc,t.pos)||(n&&n(e.tr.clearIncompatible(t.pos,o.type,o.contentMatchAt(o.childCount)).join(t.pos).scrollIntoView()),0)))}(e,t,n))return!0;if(t.parent.canReplace(t.index(),t.index()+1)&&(s=(a=c.contentMatchAt(c.childCount)).findWrapping(l.type))&&a.matchType(s[0]||l.type).validEnd){if(n){for(var u=t.pos+l.nodeSize,p=o.Fragment.empty,h=s.length-1;h>=0;h--)p=o.Fragment.from(s[h].create(null,p));p=o.Fragment.from(c.copy(p));var d=e.tr.step(new r.b(t.pos-1,u,t.pos,u,new o.Slice(p,1,0),s.length,!0)),f=u+2*s.length;Object(r.f)(d.doc,f)&&d.join(f),n(d.scrollIntoView())}return!0}var m=i.Selection.findFrom(t,1),v=m&&m.$from.blockRange(m.$to),g=v&&Object(r.k)(v);return null!=g&&g>=t.depth&&(n&&n(e.tr.lift(v,g).scrollIntoView()),!0)}function m(e,t){return function(n,o){var i=n.selection,s=i.$from,a=i.$to,c=s.blockRange(a),l=c&&Object(r.i)(c,e,t);return!!l&&(o&&o(n.tr.wrap(c,l).scrollIntoView()),!0)}}function v(e,t){return function(n,r){var o=n.selection,i=o.from,s=o.to,a=!1;return n.doc.nodesBetween(i,s,function(r,o){if(a)return!1;if(r.isTextblock&&!r.hasMarkup(e,t))if(r.type==e)a=!0;else{var i=n.doc.resolve(o),s=i.index();a=i.parent.canReplaceWith(s,s+1,e)}}),!!a&&(r&&r(n.tr.setBlockType(i,s,e,t).scrollIntoView()),!0)}}function g(e,t){return function(n,r){var o=n.selection,i=o.empty,s=o.$cursor,a=o.ranges;if(i&&!s||!function(e,t,n){for(var r=function(r){var o=t[r],i=o.$from,s=o.$to,a=0==i.depth&&e.type.allowsMarkType(n);if(e.nodesBetween(i.pos,s.pos,function(e){if(a)return!1;a=e.inlineContent&&e.type.allowsMarkType(n)}),a)return{v:!0}},o=0;o<t.length;o++){var i=r(o);if(i)return i.v}return!1}(n.doc,a,e))return!1;if(r)if(s)e.isInSet(n.storedMarks||s.marks())?r(n.tr.removeStoredMark(e)):r(n.tr.addStoredMark(e.create(t)));else{for(var c=!1,l=n.tr,u=0;!c&&u<a.length;u++){var p=a[u],h=p.$from,d=p.$to;c=n.doc.rangeHasMark(h.pos,d.pos,e)}for(var f=0;f<a.length;f++){var m=a[f],v=m.$from,g=m.$to;c?l.removeMark(v.pos,g.pos,e):l.addMark(v.pos,g.pos,e.create(t))}r(l.scrollIntoView())}return!0}}function y(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return function(t,n,r){for(var o=0;o<e.length;o++)if(e[o](t,n,r))return!0;return!1}}var b=y(s,function(e,t,n){var o=e.selection.$cursor;if(!o||(n?!n.endOfTextblock("backward",e):o.parentOffset>0))return!1;var s=c(o);if(!s){var l=o.blockRange(),u=l&&Object(r.k)(l);return null!=u&&(t&&t(e.tr.lift(l,u).scrollIntoView()),!0)}var p=s.nodeBefore;if(!p.type.spec.isolating&&f(e,s,t))return!0;if(0==o.parent.content.size&&(a(p,"end")||i.NodeSelection.isSelectable(p))){if(t){var h=e.tr.deleteRange(o.before(),o.after());h.setSelection(a(p,"end")?i.Selection.findFrom(h.doc.resolve(h.mapping.map(s.pos,-1)),-1):i.NodeSelection.create(h.doc,s.pos-p.nodeSize)),t(h.scrollIntoView())}return!0}return!(!p.isAtom||s.depth!=o.depth-1||(t&&t(e.tr.delete(s.pos-p.nodeSize,s.pos).scrollIntoView()),0))},function(e,t,n){var r=e.selection,o=r.$head,s=o;if(!r.empty)return!1;if(o.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):o.parentOffset>0)return!1;s=c(o)}var a=s&&s.nodeBefore;return!(!a||!i.NodeSelection.isSelectable(a)||(t&&t(e.tr.setSelection(i.NodeSelection.create(e.doc,s.pos-a.nodeSize)).scrollIntoView()),0))}),w=y(s,function(e,t,n){var r=e.selection.$cursor;if(!r||(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size))return!1;var o=l(r);if(!o)return!1;var s=o.nodeAfter;if(f(e,o,t))return!0;if(0==r.parent.content.size&&(a(s,"start")||i.NodeSelection.isSelectable(s))){if(t){var c=e.tr.deleteRange(r.before(),r.after());c.setSelection(a(s,"start")?i.Selection.findFrom(c.doc.resolve(c.mapping.map(o.pos)),1):i.NodeSelection.create(c.doc,c.mapping.map(o.pos))),t(c.scrollIntoView())}return!0}return!(!s.isAtom||o.depth!=r.depth-1||(t&&t(e.tr.delete(o.pos,o.pos+s.nodeSize).scrollIntoView()),0))},function(e,t,n){var r=e.selection,o=r.$head,s=o;if(!r.empty)return!1;if(o.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):o.parentOffset<o.parent.content.size)return!1;s=l(o)}var a=s&&s.nodeAfter;return!(!a||!i.NodeSelection.isSelectable(a)||(t&&t(e.tr.setSelection(i.NodeSelection.create(e.doc,s.pos)).scrollIntoView()),0))}),S={Enter:y(function(e,t){var n=e.selection,r=n.$head,o=n.$anchor;return!(!r.parent.type.spec.code||!r.sameParent(o)||(t&&t(e.tr.insertText("\n").scrollIntoView()),0))},function(e,t){var n=e.selection,r=n.$from,o=n.$to;if(r.parent.inlineContent||o.parent.inlineContent)return!1;var s=p(r.parent.contentMatchAt(o.indexAfter()));if(!s||!s.isTextblock)return!1;if(t){var a=(!r.parentOffset&&o.index()<o.parent.childCount?r:o).pos,c=e.tr.insert(a,s.createAndFill());c.setSelection(i.TextSelection.create(c.doc,a+1)),t(c.scrollIntoView())}return!0},function(e,t){var n=e.selection.$cursor;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){var o=n.before();if(Object(r.g)(e.doc,o))return t&&t(e.tr.split(o).scrollIntoView()),!0}var i=n.blockRange(),s=i&&Object(r.k)(i);return null!=s&&(t&&t(e.tr.lift(i,s).scrollIntoView()),!0)},d),"Mod-Enter":h,Backspace:b,"Mod-Backspace":b,Delete:w,"Mod-Delete":w,"Mod-a":function(e,t){return t&&t(e.tr.setSelection(new i.AllSelection(e.doc))),!0}},x={"Ctrl-h":S.Backspace,"Alt-Backspace":S["Mod-Backspace"],"Ctrl-d":S.Delete,"Ctrl-Alt-Backspace":S["Mod-Delete"],"Alt-Delete":S["Mod-Delete"],"Alt-d":S["Mod-Delete"]};for(var k in S)x[k]=S[k];var C=("undefined"!=typeof navigator?/Mac/.test(navigator.platform):"undefined"!=typeof os&&"darwin"==os.platform())?x:S},Bz7v:function(e,t,n){"use strict";var r=n("Xb7u"),o=i(Error);function i(e){return t.displayName=e.displayName||e.name,t;function t(t){return t&&(t=r.apply(null,arguments)),new e(t)}}e.exports=o,o.eval=i(EvalError),o.range=i(RangeError),o.reference=i(ReferenceError),o.syntax=i(SyntaxError),o.type=i(TypeError),o.uri=i(URIError),o.create=i},CsC6:function(e,t,n){"use strict";n.d(t,"a",function(){return u}),n.d(t,"b",function(){return b}),n.d(t,"c",function(){return y}),n.d(t,"d",function(){return v}),n.d(t,"e",function(){return h}),n.d(t,"f",function(){return M}),n.d(t,"g",function(){return O}),n.d(t,"h",function(){return D}),n.d(t,"i",function(){return k}),n.d(t,"j",function(){return T}),n.d(t,"k",function(){return x});var r=n("MEpN"),o=65535,i=Math.pow(2,16);function s(e,t){return e+t*i}function a(e){return e&o}var c=function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=null),this.pos=e,this.deleted=t,this.recover=n},l=function(e,t){void 0===t&&(t=!1),this.ranges=e,this.inverted=t};l.prototype.recover=function(e){var t=0,n=a(e);if(!this.inverted)for(var r=0;r<n;r++)t+=this.ranges[3*r+2]-this.ranges[3*r+1];return this.ranges[3*n]+t+function(e){return(e-(e&o))/i}(e)},l.prototype.mapResult=function(e,t){return void 0===t&&(t=1),this._map(e,t,!1)},l.prototype.map=function(e,t){return void 0===t&&(t=1),this._map(e,t,!0)},l.prototype._map=function(e,t,n){for(var r=0,o=this.inverted?2:1,i=this.inverted?1:2,a=0;a<this.ranges.length;a+=3){var l=this.ranges[a]-(this.inverted?r:0);if(l>e)break;var u=this.ranges[a+o],p=this.ranges[a+i],h=l+u;if(e<=h){var d=l+r+((u?e==l?-1:e==h?1:t:t)<0?0:p);if(n)return d;var f=e==(t<0?l:h)?null:s(a/3,e-l);return new c(d,t<0?e!=l:e!=h,f)}r+=p-u}return n?e+r:new c(e+r)},l.prototype.touches=function(e,t){for(var n=0,r=a(t),o=this.inverted?2:1,i=this.inverted?1:2,s=0;s<this.ranges.length;s+=3){var c=this.ranges[s]-(this.inverted?n:0);if(c>e)break;var l=this.ranges[s+o];if(e<=c+l&&s==3*r)return!0;n+=this.ranges[s+i]-l}return!1},l.prototype.forEach=function(e){for(var t=this.inverted?2:1,n=this.inverted?1:2,r=0,o=0;r<this.ranges.length;r+=3){var i=this.ranges[r],s=i-(this.inverted?o:0),a=i+(this.inverted?0:o),c=this.ranges[r+t],l=this.ranges[r+n];e(s,s+c,a,a+l),o+=l-c}},l.prototype.invert=function(){return new l(this.ranges,!this.inverted)},l.prototype.toString=function(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)},l.offset=function(e){return 0==e?l.empty:new l(e<0?[0,-e,0]:[0,0,e])},l.empty=new l([]);var u=function(e,t,n,r){this.maps=e||[],this.from=n||0,this.to=null==r?this.maps.length:r,this.mirror=t};function p(e){var t=Error.call(this,e);return t.__proto__=p.prototype,t}u.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.maps.length),new u(this.maps,this.mirror,e,t)},u.prototype.copy=function(){return new u(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)},u.prototype.appendMap=function(e,t){this.to=this.maps.push(e),null!=t&&this.setMirror(this.maps.length-1,t)},u.prototype.appendMapping=function(e){for(var t=0,n=this.maps.length;t<e.maps.length;t++){var r=e.getMirror(t);this.appendMap(e.maps[t],null!=r&&r<t?n+r:null)}},u.prototype.getMirror=function(e){if(this.mirror)for(var t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]},u.prototype.setMirror=function(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)},u.prototype.appendMappingInverted=function(e){for(var t=e.maps.length-1,n=this.maps.length+e.maps.length;t>=0;t--){var r=e.getMirror(t);this.appendMap(e.maps[t].invert(),null!=r&&r>t?n-r-1:null)}},u.prototype.invert=function(){var e=new u;return e.appendMappingInverted(this),e},u.prototype.map=function(e,t){if(void 0===t&&(t=1),this.mirror)return this._map(e,t,!0);for(var n=this.from;n<this.to;n++)e=this.maps[n].map(e,t);return e},u.prototype.mapResult=function(e,t){return void 0===t&&(t=1),this._map(e,t,!1)},u.prototype._map=function(e,t,n){for(var r=!1,o=this.from;o<this.to;o++){var i=this.maps[o].mapResult(e,t);if(null!=i.recover){var s=this.getMirror(o);if(null!=s&&s>o&&s<this.to){o=s,e=this.maps[s].recover(i.recover);continue}}i.deleted&&(r=!0),e=i.pos}return n?e:new c(e,r)},p.prototype=Object.create(Error.prototype),p.prototype.constructor=p,p.prototype.name="TransformError";var h=function(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new u},d={before:{configurable:!0},docChanged:{configurable:!0}};function f(){throw new Error("Override me")}d.before.get=function(){return this.docs.length?this.docs[0]:this.doc},h.prototype.step=function(e){var t=this.maybeStep(e);if(t.failed)throw new p(t.failed);return this},h.prototype.maybeStep=function(e){var t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t},d.docChanged.get=function(){return this.steps.length>0},h.prototype.addStep=function(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t},Object.defineProperties(h.prototype,d);var m=Object.create(null),v=function(){};v.prototype.apply=function(e){return f()},v.prototype.getMap=function(){return l.empty},v.prototype.invert=function(e){return f()},v.prototype.map=function(e){return f()},v.prototype.merge=function(e){return null},v.prototype.toJSON=function(){return f()},v.fromJSON=function(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");var n=m[t.stepType];if(!n)throw new RangeError("No step type "+t.stepType+" defined");return n.fromJSON(e,t)},v.jsonID=function(e,t){if(e in m)throw new RangeError("Duplicate use of step JSON ID "+e);return m[e]=t,t.prototype.jsonID=e,t};var g=function(e,t){this.doc=e,this.failed=t};g.ok=function(e){return new g(e,null)},g.fail=function(e){return new g(null,e)},g.fromReplace=function(e,t,n,o){try{return g.ok(e.replace(t,n,o))}catch(e){if(e instanceof r.ReplaceError)return g.fail(e.message);throw e}};var y=function(e){function t(t,n,r,o){e.call(this),this.from=t,this.to=n,this.slice=r,this.structure=!!o}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(e){return this.structure&&w(e,this.from,this.to)?g.fail("Structure replace would overwrite content"):g.fromReplace(e,this.from,this.to,this.slice)},t.prototype.getMap=function(){return new l([this.from,this.to-this.from,this.slice.size])},t.prototype.invert=function(e){return new t(this.from,this.from+this.slice.size,e.slice(this.from,this.to))},t.prototype.map=function(e){var n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted?null:new t(n.pos,Math.max(n.pos,r.pos),this.slice)},t.prototype.merge=function(e){if(!(e instanceof t)||e.structure!=this.structure)return null;if(this.from+this.slice.size!=e.from||this.slice.openEnd||e.slice.openStart){if(e.to!=this.from||this.slice.openStart||e.slice.openEnd)return null;var n=this.slice.size+e.slice.size==0?r.Slice.empty:new r.Slice(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new t(e.from,this.to,n,this.structure)}var o=this.slice.size+e.slice.size==0?r.Slice.empty:new r.Slice(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new t(this.from,this.to+(e.to-e.from),o,this.structure)},t.prototype.toJSON=function(){var e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e},t.fromJSON=function(e,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new t(n.from,n.to,r.Slice.fromJSON(e,n.slice),!!n.structure)},t}(v);v.jsonID("replace",y);var b=function(e){function t(t,n,r,o,i,s,a){e.call(this),this.from=t,this.to=n,this.gapFrom=r,this.gapTo=o,this.slice=i,this.insert=s,this.structure=!!a}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(e){if(this.structure&&(w(e,this.from,this.gapFrom)||w(e,this.gapTo,this.to)))return g.fail("Structure gap-replace would overwrite content");var t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return g.fail("Gap is not a flat range");var n=this.slice.insertAt(this.insert,t.content);return n?g.fromReplace(e,this.from,this.to,n):g.fail("Content does not fit in gap")},t.prototype.getMap=function(){return new l([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])},t.prototype.invert=function(e){var n=this.gapTo-this.gapFrom;return new t(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)},t.prototype.map=function(e){var n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),o=e.map(this.gapFrom,-1),i=e.map(this.gapTo,1);return n.deleted&&r.deleted||o<n.pos||i>r.pos?null:new t(n.pos,r.pos,o,i,this.slice,this.insert,this.structure)},t.prototype.toJSON=function(){var e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e},t.fromJSON=function(e,n){if("number"!=typeof n.from||"number"!=typeof n.to||"number"!=typeof n.gapFrom||"number"!=typeof n.gapTo||"number"!=typeof n.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new t(n.from,n.to,n.gapFrom,n.gapTo,r.Slice.fromJSON(e,n.slice),n.insert,!!n.structure)},t}(v);function w(e,t,n){for(var r=e.resolve(t),o=n-t,i=r.depth;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0)for(var s=r.node(i).maybeChild(r.indexAfter(i));o>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,o--}return!1}function S(e,t,n){return(0==t||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function x(e){for(var t=e.parent.content.cutByIndex(e.startIndex,e.endIndex),n=e.depth;;--n){var r=e.$from.node(n),o=e.$from.index(n),i=e.$to.indexAfter(n);if(n<e.depth&&r.canReplace(o,i,t))return n;if(0==n||r.type.spec.isolating||!S(r,o,i))break}}function k(e,t,n,r){void 0===r&&(r=e);var o=function(e,t){var n=e.parent,r=e.startIndex,o=e.endIndex,i=n.contentMatchAt(r).findWrapping(t);if(!i)return null;var s=i.length?i[0]:t;return n.canReplaceWith(r,o,s)?i:null}(e,t),i=o&&function(e,t){var n=e.parent,r=e.startIndex,o=e.endIndex,i=n.child(r),s=t.contentMatch.findWrapping(i.type);if(!s)return null;for(var a=(s.length?s[s.length-1]:t).contentMatch,c=r;a&&c<o;c++)a=a.matchType(n.child(c).type);if(!a||!a.validEnd)return null;return s}(r,t);return i?o.map(C).concat({type:t,attrs:n}).concat(i.map(C)):null}function C(e){return{type:e,attrs:null}}function O(e,t,n,r){void 0===n&&(n=1);var o=e.resolve(t),i=o.depth-n,s=r&&r[r.length-1]||o.parent;if(i<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!s.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(var a=o.depth-1,c=n-2;a>i;a--,c--){var l=o.node(a),u=o.index(a);if(l.type.spec.isolating)return!1;var p=l.content.cutByIndex(u,l.childCount),h=r&&r[c]||l;if(h!=l&&(p=p.replaceChild(0,h.type.create(h.attrs))),!l.canReplace(u+1,l.childCount)||!h.type.validContent(p))return!1}var d=o.indexAfter(i),f=r&&r[0];return o.node(i).canReplaceWith(d,d,f?f.type:o.node(i+1).type)}function M(e,t){var n=e.resolve(t),r=n.index();return N(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function N(e,t){return e&&t&&!e.isLeaf&&e.canAppend(t)}function T(e,t,n){void 0===n&&(n=-1);for(var r=e.resolve(t),o=r.depth;;o--){var i=void 0,s=void 0,a=r.index(o);if(o==r.depth?(i=r.nodeBefore,s=r.nodeAfter):n>0?(i=r.node(o+1),a++,s=r.node(o).maybeChild(a)):(i=r.node(o).maybeChild(a-1),s=r.node(o+1)),i&&!i.isTextblock&&N(i,s)&&r.node(o).canReplace(a,a+1))return t;if(0==o)break;t=n<0?r.before(o):r.after(o)}}function D(e,t,n){var r=e.resolve(t);if(!n.content.size)return t;for(var o=n.content,i=0;i<n.openStart;i++)o=o.firstChild.content;for(var s=1;s<=(0==n.openStart&&n.size?2:1);s++)for(var a=r.depth;a>=0;a--){var c=a==r.depth?0:r.pos<=(r.start(a+1)+r.end(a+1))/2?-1:1,l=r.index(a)+(c>0?1:0);if(1==s?r.node(a).canReplace(l,l,o):r.node(a).contentMatchAt(l).findWrapping(o.firstChild.type))return 0==c?r.pos:c<0?r.before(a+1):r.after(a+1)}return null}function A(e,t,n){for(var o=[],i=0;i<e.childCount;i++){var s=e.child(i);s.content.size&&(s=s.copy(A(s.content,t,s))),s.isInline&&(s=t(s,n,i)),o.push(s)}return r.Fragment.fromArray(o)}v.jsonID("replaceAround",b),h.prototype.lift=function(e,t){for(var n=e.$from,o=e.$to,i=e.depth,s=n.before(i+1),a=o.after(i+1),c=s,l=a,u=r.Fragment.empty,p=0,h=i,d=!1;h>t;h--)d||n.index(h)>0?(d=!0,u=r.Fragment.from(n.node(h).copy(u)),p++):c--;for(var f=r.Fragment.empty,m=0,v=i,g=!1;v>t;v--)g||o.after(v+1)<o.end(v)?(g=!0,f=r.Fragment.from(o.node(v).copy(f)),m++):l++;return this.step(new b(c,l,s,a,new r.Slice(u.append(f),p,m),u.size-p,!0))},h.prototype.wrap=function(e,t){for(var n=r.Fragment.empty,o=t.length-1;o>=0;o--)n=r.Fragment.from(t[o].type.create(t[o].attrs,n));var i=e.start,s=e.end;return this.step(new b(i,s,i,s,new r.Slice(n,0,0),t.length,!0))},h.prototype.setBlockType=function(e,t,n,o){var i=this;if(void 0===t&&(t=e),!n.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");var s=this.steps.length;return this.doc.nodesBetween(e,t,function(e,t){if(e.isTextblock&&!e.hasMarkup(n,o)&&function(e,t,n){var r=e.resolve(t),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}(i.doc,i.mapping.slice(s).map(t),n)){i.clearIncompatible(i.mapping.slice(s).map(t,1),n);var a=i.mapping.slice(s),c=a.map(t,1),l=a.map(t+e.nodeSize,1);return i.step(new b(c,l,c+1,l-1,new r.Slice(r.Fragment.from(n.create(o,null,e.marks)),0,0),1,!0)),!1}}),this},h.prototype.setNodeMarkup=function(e,t,n,o){var i=this.doc.nodeAt(e);if(!i)throw new RangeError("No node at given position");t||(t=i.type);var s=t.create(n,null,o||i.marks);if(i.isLeaf)return this.replaceWith(e,e+i.nodeSize,s);if(!t.validContent(i.content))throw new RangeError("Invalid content for node type "+t.name);return this.step(new b(e,e+i.nodeSize,e+1,e+i.nodeSize-1,new r.Slice(r.Fragment.from(s),0,0),1,!0))},h.prototype.split=function(e,t,n){void 0===t&&(t=1);for(var o=this.doc.resolve(e),i=r.Fragment.empty,s=r.Fragment.empty,a=o.depth,c=o.depth-t,l=t-1;a>c;a--,l--){i=r.Fragment.from(o.node(a).copy(i));var u=n&&n[l];s=r.Fragment.from(u?u.type.create(u.attrs,s):o.node(a).copy(s))}return this.step(new y(e,e,new r.Slice(i.append(s),t,t),!0))},h.prototype.join=function(e,t){void 0===t&&(t=1);var n=new y(e-t,e+t,r.Slice.empty,!0);return this.step(n)};var E=function(e){function t(t,n,r){e.call(this),this.from=t,this.to=n,this.mark=r}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(e){var t=this,n=e.slice(this.from,this.to),o=e.resolve(this.from),i=o.node(o.sharedDepth(this.to)),s=new r.Slice(A(n.content,function(e,n){return n.type.allowsMarkType(t.mark.type)?e.mark(t.mark.addToSet(e.marks)):e},i),n.openStart,n.openEnd);return g.fromReplace(e,this.from,this.to,s)},t.prototype.invert=function(){return new R(this.from,this.to,this.mark)},t.prototype.map=function(e){var n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new t(n.pos,r.pos,this.mark)},t.prototype.merge=function(e){if(e instanceof t&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from)return new t(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark)},t.prototype.toJSON=function(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}},t.fromJSON=function(e,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new t(n.from,n.to,e.markFromJSON(n.mark))},t}(v);v.jsonID("addMark",E);var R=function(e){function t(t,n,r){e.call(this),this.from=t,this.to=n,this.mark=r}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(e){var t=this,n=e.slice(this.from,this.to),o=new r.Slice(A(n.content,function(e){return e.mark(t.mark.removeFromSet(e.marks))}),n.openStart,n.openEnd);return g.fromReplace(e,this.from,this.to,o)},t.prototype.invert=function(){return new E(this.from,this.to,this.mark)},t.prototype.map=function(e){var n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new t(n.pos,r.pos,this.mark)},t.prototype.merge=function(e){if(e instanceof t&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from)return new t(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark)},t.prototype.toJSON=function(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}},t.fromJSON=function(e,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new t(n.from,n.to,e.markFromJSON(n.mark))},t}(v);function _(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}v.jsonID("removeMark",R),h.prototype.addMark=function(e,t,n){var r=this,o=[],i=[],s=null,a=null;return this.doc.nodesBetween(e,t,function(r,c,l){if(r.isInline){var u=r.marks;if(!n.isInSet(u)&&l.type.allowsMarkType(n.type)){for(var p=Math.max(c,e),h=Math.min(c+r.nodeSize,t),d=n.addToSet(u),f=0;f<u.length;f++)u[f].isInSet(d)||(s&&s.to==p&&s.mark.eq(u[f])?s.to=h:o.push(s=new R(p,h,u[f])));a&&a.to==p?a.to=h:i.push(a=new E(p,h,n))}}}),o.forEach(function(e){return r.step(e)}),i.forEach(function(e){return r.step(e)}),this},h.prototype.removeMark=function(e,t,n){var o=this;void 0===n&&(n=null);var i=[],s=0;return this.doc.nodesBetween(e,t,function(o,a){if(o.isInline){s++;var c=null;if(n instanceof r.MarkType){var l=n.isInSet(o.marks);l&&(c=[l])}else n?n.isInSet(o.marks)&&(c=[n]):c=o.marks;if(c&&c.length)for(var u=Math.min(a+o.nodeSize,t),p=0;p<c.length;p++){for(var h=c[p],d=void 0,f=0;f<i.length;f++){var m=i[f];m.step==s-1&&h.eq(i[f].style)&&(d=m)}d?(d.to=u,d.step=s):i.push({style:h,from:Math.max(a,e),to:u,step:s})}}}),i.forEach(function(e){return o.step(new R(e.from,e.to,e.style))}),this},h.prototype.clearIncompatible=function(e,t,n){void 0===n&&(n=t.contentMatch);for(var o=this.doc.nodeAt(e),i=[],s=e+1,a=0;a<o.childCount;a++){var c=o.child(a),l=s+c.nodeSize,u=n.matchType(c.type,c.attrs);if(u){n=u;for(var p=0;p<c.marks.length;p++)t.allowsMarkType(c.marks[p].type)||this.step(new R(s,l,c.marks[p]))}else i.push(new y(s,l,r.Slice.empty));s=l}if(!n.validEnd){var h=n.fillBefore(r.Fragment.empty,!0);this.replace(s,s,new r.Slice(h,0,0))}for(var d=i.length-1;d>=0;d--)this.step(i[d]);return this},h.prototype.replace=function(e,t,n){void 0===t&&(t=e),void 0===n&&(n=r.Slice.empty);var o=function(e,t,n,o){if(void 0===n&&(n=t),void 0===o&&(o=r.Slice.empty),t==n&&!o.size)return null;var i=e.resolve(t),s=e.resolve(n);return _(i,s,o)?new y(t,n,o):new P(i,s,o).fit()}(this.doc,e,t,n);return o&&this.step(o),this},h.prototype.replaceWith=function(e,t,n){return this.replace(e,t,new r.Slice(r.Fragment.from(n),0,0))},h.prototype.delete=function(e,t){return this.replace(e,t,r.Slice.empty)},h.prototype.insert=function(e,t){return this.replaceWith(e,e,t)};var P=function(e,t,n){this.$to=t,this.$from=e,this.unplaced=n,this.frontier=[];for(var o=0;o<=e.depth;o++){var i=e.node(o);this.frontier.push({type:i.type,match:i.contentMatchAt(e.indexAfter(o))})}this.placed=r.Fragment.empty;for(var s=e.depth;s>0;s--)this.placed=r.Fragment.from(e.node(s).copy(this.placed))},$={depth:{configurable:!0}};function I(e,t,n){return 0==t?e.cutByIndex(n):e.replaceChild(0,e.firstChild.copy(I(e.firstChild.content,t-1,n)))}function z(e,t,n){return 0==t?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(z(e.lastChild.content,t-1,n)))}function B(e,t){for(var n=0;n<t;n++)e=e.firstChild.content;return e}function F(e,t,n){if(t<=0)return e;var o=e.content;return t>1&&(o=o.replaceChild(0,F(o.firstChild,t-1,1==o.childCount?n-1:0))),t>0&&(o=e.type.contentMatch.fillBefore(o).append(o),n<=0&&(o=o.append(e.type.contentMatch.matchFragment(o).fillBefore(r.Fragment.empty,!0)))),e.copy(o)}function V(e,t,n,r,o){var i=e.node(t),s=o?e.indexAfter(t):e.index(t);if(s==i.childCount&&!n.compatibleContent(i.type))return null;var a=r.fillBefore(i.content,!0,s);return a&&!function(e,t,n){for(var r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}(n,i.content,s)?a:null}function j(e,t,n,o,i){if(t<n){var s=e.firstChild;e=e.replaceChild(0,s.copy(j(s.content,t+1,n,o,s)))}if(t>o){var a=i.contentMatchAt(0),c=a.fillBefore(e).append(e);e=c.append(a.matchFragment(c).fillBefore(r.Fragment.empty,!0))}return e}function L(e,t){for(var n=[],r=Math.min(e.depth,t.depth);r>=0;r--){var o=e.start(r);if(o<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;o==t.start(r)&&n.push(r)}return n}$.depth.get=function(){return this.frontier.length-1},P.prototype.fit=function(){for(;this.unplaced.size;){var e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}var t=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,o=this.$from,i=this.close(t<0?this.$to:o.doc.resolve(t));if(!i)return null;for(var s=this.placed,a=o.depth,c=i.depth;a&&c&&1==s.childCount;)s=s.firstChild.content,a--,c--;var l=new r.Slice(s,a,c);return t>-1?new b(o.pos,t,this.$to.pos,this.$to.end(),l,n):l.size||o.pos!=this.$to.pos?new y(o.pos,i.pos,l):void 0},P.prototype.findFittable=function(){for(var e=1;e<=2;e++)for(var t=this.unplaced.openStart;t>=0;t--)for(var n=void 0,o=(t?(n=B(this.unplaced.content,t-1).firstChild).content:this.unplaced.content).firstChild,i=this.depth;i>=0;i--){var s=this.frontier[i],a=s.type,c=s.match,l=void 0,u=void 0;if(1==e&&(o?c.matchType(o.type)||(u=c.fillBefore(r.Fragment.from(o),!1)):a.compatibleContent(n.type)))return{sliceDepth:t,frontierDepth:i,parent:n,inject:u};if(2==e&&o&&(l=c.findWrapping(o.type)))return{sliceDepth:t,frontierDepth:i,parent:n,wrap:l};if(n&&c.matchType(n.type))break}},P.prototype.openMore=function(){var e=this.unplaced,t=e.content,n=e.openStart,o=e.openEnd,i=B(t,n);return!(!i.childCount||i.firstChild.isLeaf)&&(this.unplaced=new r.Slice(t,n+1,Math.max(o,i.size+n>=t.size-o?n+1:0)),!0)},P.prototype.dropNode=function(){var e=this.unplaced,t=e.content,n=e.openStart,o=e.openEnd,i=B(t,n);if(i.childCount<=1&&n>0){var s=t.size-n<=n+i.size;this.unplaced=new r.Slice(I(t,n-1,1),n-1,s?n-1:o)}else this.unplaced=new r.Slice(I(t,n,1),n,o)},P.prototype.placeNodes=function(e){for(var t=e.sliceDepth,n=e.frontierDepth,o=e.parent,i=e.inject,s=e.wrap;this.depth>n;)this.closeFrontierNode();if(s)for(var a=0;a<s.length;a++)this.openFrontierNode(s[a]);var c=this.unplaced,l=o?o.content:c.content,u=c.openStart-t,p=0,h=[],d=this.frontier[n],f=d.match,m=d.type;if(i){for(var v=0;v<i.childCount;v++)h.push(i.child(v));f=f.matchFragment(i)}for(var g=l.size+t-(c.content.size-c.openEnd);p<l.childCount;){var y=l.child(p),b=f.matchType(y.type);if(!b)break;(++p>1||0==u||y.content.size)&&(f=b,h.push(F(y.mark(m.allowedMarks(y.marks)),1==p?u:0,p==l.childCount?g:-1)))}var w=p==l.childCount;w||(g=-1),this.placed=z(this.placed,n,r.Fragment.from(h)),this.frontier[n].match=f,w&&g<0&&o&&o.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(var S=0,x=l;S<g;S++){var k=x.lastChild;this.frontier.push({type:k.type,match:k.contentMatchAt(k.childCount)}),x=k.content}this.unplaced=w?0==t?r.Slice.empty:new r.Slice(I(c.content,t-1,1),t-1,g<0?c.openEnd:t-1):new r.Slice(I(c.content,t,p),c.openStart,c.openEnd)},P.prototype.mustMoveInline=function(){if(!this.$to.parent.isTextblock||this.$to.end()==this.$to.pos)return-1;var e,t=this.frontier[this.depth];if(!t.type.isTextblock||!V(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(e=this.findCloseLevel(this.$to))&&e.depth==this.depth)return-1;for(var n=this.$to.depth,r=this.$to.after(n);n>1&&r==this.$to.end(--n);)++r;return r},P.prototype.findCloseLevel=function(e){e:for(var t=Math.min(this.depth,e.depth);t>=0;t--){var n=this.frontier[t],r=n.match,o=n.type,i=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),s=V(e,t,o,r,i);if(s){for(var a=t-1;a>=0;a--){var c=this.frontier[a],l=c.match,u=V(e,a,c.type,l,!0);if(!u||u.childCount)continue e}return{depth:t,fit:s,move:i?e.doc.resolve(e.after(t+1)):e}}}},P.prototype.close=function(e){var t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=z(this.placed,t.depth,t.fit)),e=t.move;for(var n=t.depth+1;n<=e.depth;n++){var r=e.node(n),o=r.type.contentMatch.fillBefore(r.content,!0,e.index(n));this.openFrontierNode(r.type,r.attrs,o)}return e},P.prototype.openFrontierNode=function(e,t,n){var o=this.frontier[this.depth];o.match=o.match.matchType(e),this.placed=z(this.placed,this.depth,r.Fragment.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})},P.prototype.closeFrontierNode=function(){var e=this.frontier.pop().match.fillBefore(r.Fragment.empty,!0);e.childCount&&(this.placed=z(this.placed,this.frontier.length,e))},Object.defineProperties(P.prototype,$),h.prototype.replaceRange=function(e,t,n){if(!n.size)return this.deleteRange(e,t);var o=this.doc.resolve(e),i=this.doc.resolve(t);if(_(o,i,n))return this.step(new y(e,t,n));var s=L(o,this.doc.resolve(t));0==s[s.length-1]&&s.pop();var a=-(o.depth+1);s.unshift(a);for(var c=o.depth,l=o.pos-1;c>0;c--,l--){var u=o.node(c).type.spec;if(u.defining||u.isolating)break;s.indexOf(c)>-1?a=c:o.before(c)==l&&s.splice(1,0,-c)}for(var p=s.indexOf(a),h=[],d=n.openStart,f=n.content,m=0;;m++){var v=f.firstChild;if(h.push(v),m==n.openStart)break;f=v.content}d>0&&h[d-1].type.spec.defining&&o.node(p).type!=h[d-1].type?d-=1:d>=2&&h[d-1].isTextblock&&h[d-2].type.spec.defining&&o.node(p).type!=h[d-2].type&&(d-=2);for(var g=n.openStart;g>=0;g--){var b=(g+d+1)%(n.openStart+1),w=h[b];if(w)for(var S=0;S<s.length;S++){var x=s[(S+p)%s.length],k=!0;x<0&&(k=!1,x=-x);var C=o.node(x-1),O=o.index(x-1);if(C.canReplaceWith(O,O,w.type,w.marks))return this.replace(o.before(x),k?i.after(x):t,new r.Slice(j(n.content,0,n.openStart,b),b,n.openEnd))}}for(var M=this.steps.length,N=s.length-1;N>=0&&(this.replace(e,t,n),!(this.steps.length>M));N--){var T=s[N];N<0||(e=o.before(T),t=i.after(T))}return this},h.prototype.replaceRangeWith=function(e,t,n){if(!n.isInline&&e==t&&this.doc.resolve(e).parent.content.size){var o=function(e,t,n){var r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(0==r.parentOffset)for(var o=r.depth-1;o>=0;o--){var i=r.index(o);if(r.node(o).canReplaceWith(i,i,n))return r.before(o+1);if(i>0)return null}if(r.parentOffset==r.parent.content.size)for(var s=r.depth-1;s>=0;s--){var a=r.indexAfter(s);if(r.node(s).canReplaceWith(a,a,n))return r.after(s+1);if(a<r.node(s).childCount)return null}}(this.doc,e,n.type);null!=o&&(e=t=o)}return this.replaceRange(e,t,new r.Slice(r.Fragment.from(n),0,0))},h.prototype.deleteRange=function(e,t){for(var n=this.doc.resolve(e),r=this.doc.resolve(t),o=L(n,r),i=0;i<o.length;i++){var s=o[i],a=i==o.length-1;if(a&&0==s||n.node(s).type.contentMatch.validEnd)return this.delete(n.start(s),r.end(s));if(s>0&&(a||n.node(s-1).canReplace(n.index(s-1),r.indexAfter(s-1))))return this.delete(n.before(s),r.after(s))}for(var c=1;c<=n.depth&&c<=r.depth;c++)if(e-n.start(c)==n.depth-c&&t>n.end(c)&&r.end(c)-t!=r.depth-c)return this.delete(n.before(c),t);return this.delete(e,t)}},J7Ao:function(e,t){e.exports=class{constructor(){this.seen={}}slug(e){let t=e.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(t)){const e=t;do{this.seen[e]++,t=e+"-"+this.seen[e]}while(this.seen.hasOwnProperty(t))}return this.seen[t]=0,t}}},MEpN:function(e,t,n){"use strict";function r(e){this.content=e}n.r(t),n.d(t,"ContentMatch",function(){return _}),n.d(t,"DOMParser",function(){return ee}),n.d(t,"DOMSerializer",function(){return de}),n.d(t,"Fragment",function(){return i}),n.d(t,"Mark",function(){return u}),n.d(t,"MarkType",function(){return Z}),n.d(t,"Node",function(){return D}),n.d(t,"NodeRange",function(){return M}),n.d(t,"NodeType",function(){return H}),n.d(t,"ReplaceError",function(){return p}),n.d(t,"ResolvedPos",function(){return S}),n.d(t,"Schema",function(){return Y}),n.d(t,"Slice",function(){return h}),r.prototype={constructor:r,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 o=n&&n!=e?this.remove(n):this,i=o.find(e),s=o.content.slice();return-1==i?s.push(n||e,t):(s[i+1]=t,n&&(s[i]=n)),new r(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 r(n)},addToStart:function(e,t){return new r([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new r(n)},addBefore:function(e,t,n){var o=this.remove(t),i=o.content.slice(),s=o.find(e);return i.splice(-1==s?i.length:s,0,t,n),new r(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=r.from(e)).size?new r(e.content.concat(this.subtract(e).content)):this},append:function(e){return(e=r.from(e)).size?new r(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=r.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},get size(){return this.content.length>>1}},r.from=function(e){if(e instanceof r)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new r(t)};var o=r;var i=function(e,t){if(this.content=e,this.size=t||0,null==t)for(var n=0;n<e.length;n++)this.size+=e[n].nodeSize},s={firstChild:{configurable:!0},lastChild:{configurable:!0},childCount:{configurable:!0}};i.prototype.nodesBetween=function(e,t,n,r,o){void 0===r&&(r=0);for(var i=0,s=0;s<t;i++){var a=this.content[i],c=s+a.nodeSize;if(c>e&&!1!==n(a,r+s,o,i)&&a.content.size){var l=s+1;a.nodesBetween(Math.max(0,e-l),Math.min(a.content.size,t-l),n,r+l)}s=c}},i.prototype.descendants=function(e){this.nodesBetween(0,this.size,e)},i.prototype.textBetween=function(e,t,n,r){var o="",i=!0;return this.nodesBetween(e,t,function(s,a){s.isText?(o+=s.text.slice(Math.max(e,a)-a,t-a),i=!n):s.isLeaf&&r?(o+=r,i=!n):!i&&s.isBlock&&(o+=n,i=!0)},0),o},i.prototype.append=function(e){if(!e.size)return this;if(!this.size)return e;var t=this.lastChild,n=e.firstChild,r=this.content.slice(),o=0;for(t.isText&&t.sameMarkup(n)&&(r[r.length-1]=t.withText(t.text+n.text),o=1);o<e.content.length;o++)r.push(e.content[o]);return new i(r,this.size+e.size)},i.prototype.cut=function(e,t){if(null==t&&(t=this.size),0==e&&t==this.size)return this;var n=[],r=0;if(t>e)for(var o=0,s=0;s<t;o++){var a=this.content[o],c=s+a.nodeSize;c>e&&((s<e||c>t)&&(a=a.isText?a.cut(Math.max(0,e-s),Math.min(a.text.length,t-s)):a.cut(Math.max(0,e-s-1),Math.min(a.content.size,t-s-1))),n.push(a),r+=a.nodeSize),s=c}return new i(n,r)},i.prototype.cutByIndex=function(e,t){return e==t?i.empty:0==e&&t==this.content.length?this:new i(this.content.slice(e,t))},i.prototype.replaceChild=function(e,t){var n=this.content[e];if(n==t)return this;var r=this.content.slice(),o=this.size+t.nodeSize-n.nodeSize;return r[e]=t,new i(r,o)},i.prototype.addToStart=function(e){return new i([e].concat(this.content),this.size+e.nodeSize)},i.prototype.addToEnd=function(e){return new i(this.content.concat(e),this.size+e.nodeSize)},i.prototype.eq=function(e){if(this.content.length!=e.content.length)return!1;for(var t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0},s.firstChild.get=function(){return this.content.length?this.content[0]:null},s.lastChild.get=function(){return this.content.length?this.content[this.content.length-1]:null},s.childCount.get=function(){return this.content.length},i.prototype.child=function(e){var t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t},i.prototype.maybeChild=function(e){return this.content[e]},i.prototype.forEach=function(e){for(var t=0,n=0;t<this.content.length;t++){var r=this.content[t];e(r,n,t),n+=r.nodeSize}},i.prototype.findDiffStart=function(e,t){return void 0===t&&(t=0),function e(t,n,r){for(var o=0;;o++){if(o==t.childCount||o==n.childCount)return t.childCount==n.childCount?null:r;var i=t.child(o),s=n.child(o);if(i!=s){if(!i.sameMarkup(s))return r;if(i.isText&&i.text!=s.text){for(var a=0;i.text[a]==s.text[a];a++)r++;return r}if(i.content.size||s.content.size){var c=e(i.content,s.content,r+1);if(null!=c)return c}r+=i.nodeSize}else r+=i.nodeSize}}(this,e,t)},i.prototype.findDiffEnd=function(e,t,n){return void 0===t&&(t=this.size),void 0===n&&(n=e.size),function e(t,n,r,o){for(var i=t.childCount,s=n.childCount;;){if(0==i||0==s)return i==s?null:{a:r,b:o};var a=t.child(--i),c=n.child(--s),l=a.nodeSize;if(a!=c){if(!a.sameMarkup(c))return{a:r,b:o};if(a.isText&&a.text!=c.text){for(var u=0,p=Math.min(a.text.length,c.text.length);u<p&&a.text[a.text.length-u-1]==c.text[c.text.length-u-1];)u++,r--,o--;return{a:r,b:o}}if(a.content.size||c.content.size){var h=e(a.content,c.content,r-1,o-1);if(h)return h}r-=l,o-=l}else r-=l,o-=l}}(this,e,t,n)},i.prototype.findIndex=function(e,t){if(void 0===t&&(t=-1),0==e)return c(0,e);if(e==this.size)return c(this.content.length,e);if(e>this.size||e<0)throw new RangeError("Position "+e+" outside of fragment ("+this+")");for(var n=0,r=0;;n++){var o=r+this.child(n).nodeSize;if(o>=e)return o==e||t>0?c(n+1,o):c(n,r);r=o}},i.prototype.toString=function(){return"<"+this.toStringInner()+">"},i.prototype.toStringInner=function(){return this.content.join(", ")},i.prototype.toJSON=function(){return this.content.length?this.content.map(function(e){return e.toJSON()}):null},i.fromJSON=function(e,t){if(!t)return i.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new i(t.map(e.nodeFromJSON))},i.fromArray=function(e){if(!e.length)return i.empty;for(var t,n=0,r=0;r<e.length;r++){var o=e[r];n+=o.nodeSize,r&&o.isText&&e[r-1].sameMarkup(o)?(t||(t=e.slice(0,r)),t[t.length-1]=o.withText(t[t.length-1].text+o.text)):t&&t.push(o)}return new i(t||e,n)},i.from=function(e){if(!e)return i.empty;if(e instanceof i)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new i([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))},Object.defineProperties(i.prototype,s);var a={index:0,offset:0};function c(e,t){return a.index=e,a.offset=t,a}function l(e,t){if(e===t)return!0;if(!e||"object"!=typeof e||!t||"object"!=typeof t)return!1;var n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(var r=0;r<e.length;r++)if(!l(e[r],t[r]))return!1}else{for(var o in e)if(!(o in t&&l(e[o],t[o])))return!1;for(var i in t)if(!(i in e))return!1}return!0}i.empty=new i([],0);var u=function(e,t){this.type=e,this.attrs=t};function p(e){var t=Error.call(this,e);return t.__proto__=p.prototype,t}u.prototype.addToSet=function(e){for(var t,n=!1,r=0;r<e.length;r++){var o=e[r];if(this.eq(o))return e;if(this.type.excludes(o.type))t||(t=e.slice(0,r));else{if(o.type.excludes(this.type))return e;!n&&o.type.rank>this.type.rank&&(t||(t=e.slice(0,r)),t.push(this),n=!0),t&&t.push(o)}}return t||(t=e.slice()),n||t.push(this),t},u.prototype.removeFromSet=function(e){for(var t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e},u.prototype.isInSet=function(e){for(var t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1},u.prototype.eq=function(e){return this==e||this.type==e.type&&l(this.attrs,e.attrs)},u.prototype.toJSON=function(){var e={type:this.type.name};for(var t in this.attrs){e.attrs=this.attrs;break}return e},u.fromJSON=function(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");var n=e.marks[t.type];if(!n)throw new RangeError("There is no mark type "+t.type+" in this schema");return n.create(t.attrs)},u.sameSet=function(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(var n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0},u.setFrom=function(e){if(!e||0==e.length)return u.none;if(e instanceof u)return[e];var t=e.slice();return t.sort(function(e,t){return e.type.rank-t.type.rank}),t},u.none=[],p.prototype=Object.create(Error.prototype),p.prototype.constructor=p,p.prototype.name="ReplaceError";var h=function(e,t,n){this.content=e,this.openStart=t,this.openEnd=n},d={size:{configurable:!0}};function f(e,t,n){if(n.openStart>e.depth)throw new p("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new p("Inconsistent open depths");return function e(t,n,r,o){var s=t.index(o),a=t.node(o);if(s==n.index(o)&&o<t.depth-r.openStart){var c=e(t,n,r,o+1);return a.copy(a.content.replaceChild(s,c))}if(r.content.size){if(r.openStart||r.openEnd||t.depth!=o||n.depth!=o){var l=function(e,t){for(var n=t.depth-e.openStart,r=t.node(n).copy(e.content),o=n-1;o>=0;o--)r=t.node(o).copy(i.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}(r,t),u=l.start,p=l.end;return b(a,function e(t,n,r,o,s){var a=t.depth>s&&v(t,n,s+1);var c=o.depth>s&&v(r,o,s+1);var l=[];y(null,t,s,l);a&&c&&n.index(s)==r.index(s)?(m(a,c),g(b(a,e(t,n,r,o,s+1)),l)):(a&&g(b(a,w(t,n,s+1)),l),y(n,r,s,l),c&&g(b(c,w(r,o,s+1)),l));y(o,null,s,l);return new i(l)}(t,u,p,n,o))}var h=t.parent,d=h.content;return b(h,d.cut(0,t.parentOffset).append(r.content).append(d.cut(n.parentOffset)))}return b(a,w(t,n,o))}(e,t,n,0)}function m(e,t){if(!t.type.compatibleContent(e.type))throw new p("Cannot join "+t.type.name+" onto "+e.type.name)}function v(e,t,n){var r=e.node(n);return m(r,t.node(n)),r}function g(e,t){var n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function y(e,t,n,r){var o=(t||e).node(n),i=0,s=t?t.index(n):o.childCount;e&&(i=e.index(n),e.depth>n?i++:e.textOffset&&(g(e.nodeAfter,r),i++));for(var a=i;a<s;a++)g(o.child(a),r);t&&t.depth==n&&t.textOffset&&g(t.nodeBefore,r)}function b(e,t){if(!e.type.validContent(t))throw new p("Invalid content for node "+e.type.name);return e.copy(t)}function w(e,t,n){var r=[];(y(null,e,n,r),e.depth>n)&&g(b(v(e,t,n+1),w(e,t,n+1)),r);return y(t,null,n,r),new i(r)}d.size.get=function(){return this.content.size-this.openStart-this.openEnd},h.prototype.insertAt=function(e,t){var n=function e(t,n,r,o){var i=t.findIndex(n);var s=i.index;var a=i.offset;var c=t.maybeChild(s);if(a==n||c.isText)return o&&!o.canReplace(s,s,r)?null:t.cut(0,n).append(r).append(t.cut(n));var l=e(c.content,n-a-1,r);return l&&t.replaceChild(s,c.copy(l))}(this.content,e+this.openStart,t,null);return n&&new h(n,this.openStart,this.openEnd)},h.prototype.removeBetween=function(e,t){return new h(function e(t,n,r){var o=t.findIndex(n);var i=o.index;var s=o.offset;var a=t.maybeChild(i);var c=t.findIndex(r);var l=c.index;var u=c.offset;if(s==n||a.isText){if(u!=r&&!t.child(l).isText)throw new RangeError("Removing non-flat range");return t.cut(0,n).append(t.cut(r))}if(i!=l)throw new RangeError("Removing non-flat range");return t.replaceChild(i,a.copy(e(a.content,n-s-1,r-s-1)))}(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)},h.prototype.eq=function(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd},h.prototype.toString=function(){return this.content+"("+this.openStart+","+this.openEnd+")"},h.prototype.toJSON=function(){if(!this.content.size)return null;var e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e},h.fromJSON=function(e,t){if(!t)return h.empty;var 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 h(i.fromJSON(e,t.content),t.openStart||0,t.openEnd||0)},h.maxOpen=function(e,t){void 0===t&&(t=!0);for(var n=0,r=0,o=e.firstChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.firstChild)n++;for(var i=e.lastChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.lastChild)r++;return new h(e,n,r)},Object.defineProperties(h.prototype,d),h.empty=new h(i.empty,0,0);var S=function(e,t,n){this.pos=e,this.path=t,this.depth=t.length/3-1,this.parentOffset=n},x={parent:{configurable:!0},doc:{configurable:!0},textOffset:{configurable:!0},nodeAfter:{configurable:!0},nodeBefore:{configurable:!0}};S.prototype.resolveDepth=function(e){return null==e?this.depth:e<0?this.depth+e:e},x.parent.get=function(){return this.node(this.depth)},x.doc.get=function(){return this.node(0)},S.prototype.node=function(e){return this.path[3*this.resolveDepth(e)]},S.prototype.index=function(e){return this.path[3*this.resolveDepth(e)+1]},S.prototype.indexAfter=function(e){return e=this.resolveDepth(e),this.index(e)+(e!=this.depth||this.textOffset?1:0)},S.prototype.start=function(e){return 0==(e=this.resolveDepth(e))?0:this.path[3*e-1]+1},S.prototype.end=function(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size},S.prototype.before=function(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]},S.prototype.after=function(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]+this.path[3*e].nodeSize},x.textOffset.get=function(){return this.pos-this.path[this.path.length-1]},x.nodeAfter.get=function(){var e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;var n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r},x.nodeBefore.get=function(){var e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):0==e?null:this.parent.child(e-1)},S.prototype.marks=function(){var e=this.parent,t=this.index();if(0==e.content.size)return u.none;if(this.textOffset)return e.child(t).marks;var n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){var o=n;n=r,r=o}for(var i=n.marks,s=0;s<i.length;s++)!1!==i[s].type.spec.inclusive||r&&i[s].isInSet(r.marks)||(i=i[s--].removeFromSet(i));return i},S.prototype.marksAcross=function(e){var t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;for(var n=t.marks,r=e.parent.maybeChild(e.index()),o=0;o<n.length;o++)!1!==n[o].type.spec.inclusive||r&&n[o].isInSet(r.marks)||(n=n[o--].removeFromSet(n));return n},S.prototype.sharedDepth=function(e){for(var t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0},S.prototype.blockRange=function(e,t){if(void 0===e&&(e=this),e.pos<this.pos)return e.blockRange(this);for(var n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new M(this,e,n)},S.prototype.sameParent=function(e){return this.pos-this.parentOffset==e.pos-e.parentOffset},S.prototype.max=function(e){return e.pos>this.pos?e:this},S.prototype.min=function(e){return e.pos<this.pos?e:this},S.prototype.toString=function(){for(var e="",t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset},S.resolve=function(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");for(var n=[],r=0,o=t,i=e;;){var s=i.content.findIndex(o),a=s.index,c=s.offset,l=o-c;if(n.push(i,a,r+c),!l)break;if((i=i.child(a)).isText)break;o=l-1,r+=c+1}return new S(t,n,o)},S.resolveCached=function(e,t){for(var n=0;n<k.length;n++){var r=k[n];if(r.pos==t&&r.doc==e)return r}var o=k[C]=S.resolve(e,t);return C=(C+1)%O,o},Object.defineProperties(S.prototype,x);var k=[],C=0,O=12,M=function(e,t,n){this.$from=e,this.$to=t,this.depth=n},N={start:{configurable:!0},end:{configurable:!0},parent:{configurable:!0},startIndex:{configurable:!0},endIndex:{configurable:!0}};N.start.get=function(){return this.$from.before(this.depth+1)},N.end.get=function(){return this.$to.after(this.depth+1)},N.parent.get=function(){return this.$from.node(this.depth)},N.startIndex.get=function(){return this.$from.index(this.depth)},N.endIndex.get=function(){return this.$to.indexAfter(this.depth)},Object.defineProperties(M.prototype,N);var T=Object.create(null),D=function(e,t,n,r){this.type=e,this.attrs=t,this.content=n||i.empty,this.marks=r||u.none},A={nodeSize:{configurable:!0},childCount:{configurable:!0},textContent:{configurable:!0},firstChild:{configurable:!0},lastChild:{configurable:!0},isBlock:{configurable:!0},isTextblock:{configurable:!0},inlineContent:{configurable:!0},isInline:{configurable:!0},isText:{configurable:!0},isLeaf:{configurable:!0},isAtom:{configurable:!0}};A.nodeSize.get=function(){return this.isLeaf?1:2+this.content.size},A.childCount.get=function(){return this.content.childCount},D.prototype.child=function(e){return this.content.child(e)},D.prototype.maybeChild=function(e){return this.content.maybeChild(e)},D.prototype.forEach=function(e){this.content.forEach(e)},D.prototype.nodesBetween=function(e,t,n,r){void 0===r&&(r=0),this.content.nodesBetween(e,t,n,r,this)},D.prototype.descendants=function(e){this.nodesBetween(0,this.content.size,e)},A.textContent.get=function(){return this.textBetween(0,this.content.size,"")},D.prototype.textBetween=function(e,t,n,r){return this.content.textBetween(e,t,n,r)},A.firstChild.get=function(){return this.content.firstChild},A.lastChild.get=function(){return this.content.lastChild},D.prototype.eq=function(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)},D.prototype.sameMarkup=function(e){return this.hasMarkup(e.type,e.attrs,e.marks)},D.prototype.hasMarkup=function(e,t,n){return this.type==e&&l(this.attrs,t||e.defaultAttrs||T)&&u.sameSet(this.marks,n||u.none)},D.prototype.copy=function(e){return void 0===e&&(e=null),e==this.content?this:new this.constructor(this.type,this.attrs,e,this.marks)},D.prototype.mark=function(e){return e==this.marks?this:new this.constructor(this.type,this.attrs,this.content,e)},D.prototype.cut=function(e,t){return 0==e&&t==this.content.size?this:this.copy(this.content.cut(e,t))},D.prototype.slice=function(e,t,n){if(void 0===t&&(t=this.content.size),void 0===n&&(n=!1),e==t)return h.empty;var r=this.resolve(e),o=this.resolve(t),i=n?0:r.sharedDepth(t),s=r.start(i),a=r.node(i).content.cut(r.pos-s,o.pos-s);return new h(a,r.depth-i,o.depth-i)},D.prototype.replace=function(e,t,n){return f(this.resolve(e),this.resolve(t),n)},D.prototype.nodeAt=function(e){for(var t=this;;){var n=t.content.findIndex(e),r=n.index,o=n.offset;if(!(t=t.maybeChild(r)))return null;if(o==e||t.isText)return t;e-=o+1}},D.prototype.childAfter=function(e){var t=this.content.findIndex(e),n=t.index,r=t.offset;return{node:this.content.maybeChild(n),index:n,offset:r}},D.prototype.childBefore=function(e){if(0==e)return{node:null,index:0,offset:0};var t=this.content.findIndex(e),n=t.index,r=t.offset;if(r<e)return{node:this.content.child(n),index:n,offset:r};var o=this.content.child(n-1);return{node:o,index:n-1,offset:r-o.nodeSize}},D.prototype.resolve=function(e){return S.resolveCached(this,e)},D.prototype.resolveNoCache=function(e){return S.resolve(this,e)},D.prototype.rangeHasMark=function(e,t,n){var r=!1;return t>e&&this.nodesBetween(e,t,function(e){return n.isInSet(e.marks)&&(r=!0),!r}),r},A.isBlock.get=function(){return this.type.isBlock},A.isTextblock.get=function(){return this.type.isTextblock},A.inlineContent.get=function(){return this.type.inlineContent},A.isInline.get=function(){return this.type.isInline},A.isText.get=function(){return this.type.isText},A.isLeaf.get=function(){return this.type.isLeaf},A.isAtom.get=function(){return this.type.isAtom},D.prototype.toString=function(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);var e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),R(this.marks,e)},D.prototype.contentMatchAt=function(e){var t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t},D.prototype.canReplace=function(e,t,n,r,o){void 0===n&&(n=i.empty),void 0===r&&(r=0),void 0===o&&(o=n.childCount);var s=this.contentMatchAt(e).matchFragment(n,r,o),a=s&&s.matchFragment(this.content,t);if(!a||!a.validEnd)return!1;for(var c=r;c<o;c++)if(!this.type.allowsMarks(n.child(c).marks))return!1;return!0},D.prototype.canReplaceWith=function(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;var o=this.contentMatchAt(e).matchType(n),i=o&&o.matchFragment(this.content,t);return!!i&&i.validEnd},D.prototype.canAppend=function(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)},D.prototype.check=function(){if(!this.type.validContent(this.content))throw new RangeError("Invalid content for node "+this.type.name+": "+this.content.toString().slice(0,50));this.content.forEach(function(e){return e.check()})},D.prototype.toJSON=function(){var e={type:this.type.name};for(var t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(function(e){return e.toJSON()})),e},D.fromJSON=function(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");var n=null;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=t.marks.map(e.markFromJSON)}if("text"==t.type){if("string"!=typeof t.text)throw new RangeError("Invalid text node in JSON");return e.text(t.text,n)}var r=i.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,r,n)},Object.defineProperties(D.prototype,A);var E=function(e){function t(t,n,r,o){if(e.call(this,t,n,null,o),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={textContent:{configurable:!0},nodeSize:{configurable:!0}};return t.prototype.toString=function(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):R(this.marks,JSON.stringify(this.text))},n.textContent.get=function(){return this.text},t.prototype.textBetween=function(e,t){return this.text.slice(e,t)},n.nodeSize.get=function(){return this.text.length},t.prototype.mark=function(e){return e==this.marks?this:new t(this.type,this.attrs,this.text,e)},t.prototype.withText=function(e){return e==this.text?this:new t(this.type,this.attrs,e,this.marks)},t.prototype.cut=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.text.length),0==e&&t==this.text.length?this:this.withText(this.text.slice(e,t))},t.prototype.eq=function(e){return this.sameMarkup(e)&&this.text==e.text},t.prototype.toJSON=function(){var t=e.prototype.toJSON.call(this);return t.text=this.text,t},Object.defineProperties(t.prototype,n),t}(D);function R(e,t){for(var n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}var _=function(e){this.validEnd=e,this.next=[],this.wrapCache=[]},P={inlineContent:{configurable:!0},defaultType:{configurable:!0},edgeCount:{configurable:!0}};_.parse=function(e,t){var n=new $(e,t);if(null==n.next)return _.empty;var r=z(n);n.next&&n.err("Unexpected trailing text");var o=function(e){var t=Object.create(null);return function n(r){var o=[];r.forEach(function(t){e[t].forEach(function(t){var n=t.term,r=t.to;if(n){var i=o.indexOf(n),s=i>-1&&o[i+1];q(e,r).forEach(function(e){s||o.push(n,s=[]),-1==s.indexOf(e)&&s.push(e)})}})});var i=t[r.join(",")]=new _(r.indexOf(e.length-1)>-1);for(var s=0;s<o.length;s+=2){var a=o[s+1].sort(L);i.next.push(o[s],t[a.join(",")]||n(a))}return i}(q(e,0))}(function(e){var t=[[]];return o(function e(t,i){if("choice"==t.type)return t.exprs.reduce(function(t,n){return t.concat(e(n,i))},[]);if("seq"==t.type)for(var s=0;;s++){var a=e(t.exprs[s],i);if(s==t.exprs.length-1)return a;o(a,i=n())}else{if("star"==t.type){var c=n();return r(i,c),o(e(t.expr,c),c),[r(c)]}if("plus"==t.type){var l=n();return o(e(t.expr,i),l),o(e(t.expr,l),l),[r(l)]}if("opt"==t.type)return[r(i)].concat(e(t.expr,i));if("range"==t.type){for(var u=i,p=0;p<t.min;p++){var h=n();o(e(t.expr,u),h),u=h}if(-1==t.max)o(e(t.expr,u),u);else for(var d=t.min;d<t.max;d++){var f=n();r(u,f),o(e(t.expr,u),f),u=f}return[r(u)]}if("name"==t.type)return[r(i,null,t.value)]}}(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){var o={term:r,to:n};return t[e].push(o),o}function o(e,t){e.forEach(function(e){return e.to=t})}}(r));return function(e,t){for(var n=0,r=[e];n<r.length;n++){for(var o=r[n],i=!o.validEnd,s=[],a=0;a<o.next.length;a+=2){var c=o.next[a],l=o.next[a+1];s.push(c.name),!i||c.isText||c.hasRequiredAttrs()||(i=!1),-1==r.indexOf(l)&&r.push(l)}i&&t.err("Only non-generatable nodes ("+s.join(", ")+") in a required position")}}(o,n),o},_.prototype.matchType=function(e){for(var t=0;t<this.next.length;t+=2)if(this.next[t]==e)return this.next[t+1];return null},_.prototype.matchFragment=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=e.childCount);for(var r=this,o=t;r&&o<n;o++)r=r.matchType(e.child(o).type);return r},P.inlineContent.get=function(){var e=this.next[0];return!!e&&e.isInline},P.defaultType.get=function(){for(var e=0;e<this.next.length;e+=2){var t=this.next[e];if(!t.isText&&!t.hasRequiredAttrs())return t}},_.prototype.compatible=function(e){for(var t=0;t<this.next.length;t+=2)for(var n=0;n<e.next.length;n+=2)if(this.next[t]==e.next[n])return!0;return!1},_.prototype.fillBefore=function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=0);var r=[this];return function o(s,a){var c=s.matchFragment(e,n);if(c&&(!t||c.validEnd))return i.from(a.map(function(e){return e.createAndFill()}));for(var l=0;l<s.next.length;l+=2){var u=s.next[l],p=s.next[l+1];if(!u.isText&&!u.hasRequiredAttrs()&&-1==r.indexOf(p)){r.push(p);var h=o(p,a.concat(u));if(h)return h}}}(this,[])},_.prototype.findWrapping=function(e){for(var t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];var n=this.computeWrapping(e);return this.wrapCache.push(e,n),n},_.prototype.computeWrapping=function(e){for(var t=Object.create(null),n=[{match:this,type:null,via:null}];n.length;){var r=n.shift(),o=r.match;if(o.matchType(e)){for(var i=[],s=r;s.type;s=s.via)i.push(s.type);return i.reverse()}for(var a=0;a<o.next.length;a+=2){var c=o.next[a];c.isLeaf||c.hasRequiredAttrs()||c.name in t||r.type&&!o.next[a+1].validEnd||(n.push({match:c.contentMatch,type:c,via:r}),t[c.name]=!0)}}},P.edgeCount.get=function(){return this.next.length>>1},_.prototype.edge=function(e){var t=e<<1;if(t>=this.next.length)throw new RangeError("There's no "+e+"th edge in this content match");return{type:this.next[t],next:this.next[t+1]}},_.prototype.toString=function(){var e=[];return function t(n){e.push(n);for(var r=1;r<n.next.length;r+=2)-1==e.indexOf(n.next[r])&&t(n.next[r])}(this),e.map(function(t,n){for(var r=n+(t.validEnd?"*":" ")+" ",o=0;o<t.next.length;o+=2)r+=(o?", ":"")+t.next[o].name+"->"+e.indexOf(t.next[o+1]);return r}).join("\n")},Object.defineProperties(_.prototype,P),_.empty=new _(!0);var $=function(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.unshift()},I={next:{configurable:!0}};function z(e){var t=[];do{t.push(B(e))}while(e.eat("|"));return 1==t.length?t[0]:{type:"choice",exprs:t}}function B(e){var t=[];do{t.push(F(e))}while(e.next&&")"!=e.next&&"|"!=e.next);return 1==t.length?t[0]:{type:"seq",exprs:t}}function F(e){for(var t=function(e){if(e.eat("(")){var t=z(e);return e.eat(")")||e.err("Missing closing paren"),t}if(!/\W/.test(e.next)){var n=function(e,t){var n=e.nodeTypes,r=n[t];if(r)return[r];var o=[];for(var i in n){var s=n[i];s.groups.indexOf(t)>-1&&o.push(s)}0==o.length&&e.err("No node type or group '"+t+"' found");return o}(e,e.next).map(function(t){return null==e.inline?e.inline=t.isInline:e.inline!=t.isInline&&e.err("Mixing inline and block content"),{type:"name",value:t}});return e.pos++,1==n.length?n[0]:{type:"choice",exprs:n}}e.err("Unexpected token '"+e.next+"'")}(e);;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else{if(!e.eat("{"))break;t=j(e,t)}return t}function V(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");var t=Number(e.next);return e.pos++,t}function j(e,t){var n=V(e),r=n;return e.eat(",")&&(r="}"!=e.next?V(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function L(e,t){return t-e}function q(e,t){var n=[];return function t(r){var o=e[r];if(1==o.length&&!o[0].term)return t(o[0].to);n.push(r);for(var i=0;i<o.length;i++){var s=o[i],a=s.term,c=s.to;a||-1!=n.indexOf(c)||t(c)}}(t),n.sort(L)}function W(e){var t=Object.create(null);for(var n in e){var r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function K(e,t){var n=Object.create(null);for(var r in e){var o=t&&t[r];if(void 0===o){var i=e[r];if(!i.hasDefault)throw new RangeError("No value supplied for attribute "+r);o=i.default}n[r]=o}return n}function J(e){var t=Object.create(null);if(e)for(var n in e)t[n]=new G(e[n]);return t}I.next.get=function(){return this.tokens[this.pos]},$.prototype.eat=function(e){return this.next==e&&(this.pos++||!0)},$.prototype.err=function(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")},Object.defineProperties($.prototype,I);var H=function(e,t,n){this.name=e,this.schema=t,this.spec=n,this.groups=n.group?n.group.split(" "):[],this.attrs=J(n.attrs),this.defaultAttrs=W(this.attrs),this.contentMatch=null,this.markSet=null,this.inlineContent=null,this.isBlock=!(n.inline||"text"==e),this.isText="text"==e},U={isInline:{configurable:!0},isTextblock:{configurable:!0},isLeaf:{configurable:!0},isAtom:{configurable:!0}};U.isInline.get=function(){return!this.isBlock},U.isTextblock.get=function(){return this.isBlock&&this.inlineContent},U.isLeaf.get=function(){return this.contentMatch==_.empty},U.isAtom.get=function(){return this.isLeaf||this.spec.atom},H.prototype.hasRequiredAttrs=function(){for(var e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1},H.prototype.compatibleContent=function(e){return this==e||this.contentMatch.compatible(e.contentMatch)},H.prototype.computeAttrs=function(e){return!e&&this.defaultAttrs?this.defaultAttrs:K(this.attrs,e)},H.prototype.create=function(e,t,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new D(this,this.computeAttrs(e),i.from(t),u.setFrom(n))},H.prototype.createChecked=function(e,t,n){if(t=i.from(t),!this.validContent(t))throw new RangeError("Invalid content for node "+this.name);return new D(this,this.computeAttrs(e),t,u.setFrom(n))},H.prototype.createAndFill=function(e,t,n){if(e=this.computeAttrs(e),(t=i.from(t)).size){var r=this.contentMatch.fillBefore(t);if(!r)return null;t=r.append(t)}var o=this.contentMatch.matchFragment(t).fillBefore(i.empty,!0);return o?new D(this,e,t.append(o),u.setFrom(n)):null},H.prototype.validContent=function(e){var t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(var n=0;n<e.childCount;n++)if(!this.allowsMarks(e.child(n).marks))return!1;return!0},H.prototype.allowsMarkType=function(e){return null==this.markSet||this.markSet.indexOf(e)>-1},H.prototype.allowsMarks=function(e){if(null==this.markSet)return!0;for(var t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0},H.prototype.allowedMarks=function(e){if(null==this.markSet)return e;for(var t,n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||(t=e.slice(0,n));return t?t.length?t:u.empty:e},H.compile=function(e,t){var n=Object.create(null);e.forEach(function(e,r){return n[e]=new H(e,t,r)});var 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(var o in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n},Object.defineProperties(H.prototype,U);var G=function(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default},X={isRequired:{configurable:!0}};X.isRequired.get=function(){return!this.hasDefault},Object.defineProperties(G.prototype,X);var Z=function(e,t,n,r){this.name=e,this.schema=n,this.spec=r,this.attrs=J(r.attrs),this.rank=t,this.excluded=null;var o=W(this.attrs);this.instance=o&&new u(this,o)};Z.prototype.create=function(e){return!e&&this.instance?this.instance:new u(this,K(this.attrs,e))},Z.compile=function(e,t){var n=Object.create(null),r=0;return e.forEach(function(e,o){return n[e]=new Z(e,r++,t,o)}),n},Z.prototype.removeFromSet=function(e){for(var t=0;t<e.length;t++)if(e[t].type==this)return e.slice(0,t).concat(e.slice(t+1));return e},Z.prototype.isInSet=function(e){for(var t=0;t<e.length;t++)if(e[t].type==this)return e[t]},Z.prototype.excludes=function(e){return this.excluded.indexOf(e)>-1};var Y=function(e){for(var t in this.spec={},e)this.spec[t]=e[t];this.spec.nodes=o.from(e.nodes),this.spec.marks=o.from(e.marks),this.nodes=H.compile(this.spec.nodes,this),this.marks=Z.compile(this.spec.marks,this);var n=Object.create(null);for(var r in this.nodes){if(r in this.marks)throw new RangeError(r+" can not be both a node and a mark");var i=this.nodes[r],s=i.spec.content||"",a=i.spec.marks;i.contentMatch=n[s]||(n[s]=_.parse(s,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.markSet="_"==a?null:a?Q(this,a.split(" ")):""!=a&&i.inlineContent?null:[]}for(var c in this.marks){var l=this.marks[c],u=l.spec.excludes;l.excluded=null==u?[l]:""==u?[]:Q(this,u.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached=Object.create(null),this.cached.wrappings=Object.create(null)};function Q(e,t){for(var n=[],r=0;r<t.length;r++){var o=t[r],i=e.marks[o],s=i;if(i)n.push(i);else for(var a in e.marks){var c=e.marks[a];("_"==o||c.spec.group&&c.spec.group.split(" ").indexOf(o)>-1)&&n.push(s=c)}if(!s)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}Y.prototype.node=function(e,t,n,r){if("string"==typeof e)e=this.nodeType(e);else{if(!(e instanceof H))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)},Y.prototype.text=function(e,t){var n=this.nodes.text;return new E(n,n.defaultAttrs,e,u.setFrom(t))},Y.prototype.mark=function(e,t){return"string"==typeof e&&(e=this.marks[e]),e.create(t)},Y.prototype.nodeFromJSON=function(e){return D.fromJSON(this,e)},Y.prototype.markFromJSON=function(e){return u.fromJSON(this,e)},Y.prototype.nodeType=function(e){var t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t};var ee=function(e,t){var n=this;this.schema=e,this.rules=t,this.tags=[],this.styles=[],t.forEach(function(e){e.tag?n.tags.push(e):e.style&&n.styles.push(e)})};ee.prototype.parse=function(e,t){void 0===t&&(t={});var n=new ce(this,t,!1);return n.addAll(e,null,t.from,t.to),n.finish()},ee.prototype.parseSlice=function(e,t){void 0===t&&(t={});var n=new ce(this,t,!0);return n.addAll(e,null,t.from,t.to),h.maxOpen(n.finish())},ee.prototype.matchTag=function(e,t){for(var n=0;n<this.tags.length;n++){var r=this.tags[n];if(ue(e,r.tag)&&(void 0===r.namespace||e.namespaceURI==r.namespace)&&(!r.context||t.matchesContext(r.context))){if(r.getAttrs){var o=r.getAttrs(e);if(!1===o)continue;r.attrs=o}return r}}},ee.prototype.matchStyle=function(e,t,n){for(var r=0;r<this.styles.length;r++){var o=this.styles[r];if(!(0!=o.style.indexOf(e)||o.context&&!n.matchesContext(o.context)||o.style.length>e.length&&(61!=o.style.charCodeAt(e.length)||o.style.slice(e.length+1)!=t))){if(o.getAttrs){var i=o.getAttrs(t);if(!1===i)continue;o.attrs=i}return o}}},ee.schemaRules=function(e){var t=[];function n(e){for(var n=null==e.priority?50:e.priority,r=0;r<t.length;r++){var o=t[r];if((null==o.priority?50:o.priority)<n)break}t.splice(r,0,e)}var r=function(t){var r=e.marks[t].spec.parseDOM;r&&r.forEach(function(e){n(e=pe(e)),e.mark=t})};for(var o in e.marks)r(o);var i=function(t){var r=e.nodes[s].spec.parseDOM;r&&r.forEach(function(e){n(e=pe(e)),e.node=s})};for(var s in e.nodes)i();return t},ee.fromSchema=function(e){return e.cached.domParser||(e.cached.domParser=new ee(e,ee.schemaRules(e)))};var te={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},ne={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},re={ol:!0,ul:!0},oe=1,ie=2;function se(e){return(e?oe:0)|("full"===e?ie:0)}var ae=function(e,t,n,r,o,i,s){this.type=e,this.attrs=t,this.solid=o,this.match=i||(4&s?null:e.contentMatch),this.options=s,this.content=[],this.marks=n,this.activeMarks=u.none,this.pendingMarks=r};ae.prototype.findWrapping=function(e){if(!this.match){if(!this.type)return[];var t=this.type.contentMatch.fillBefore(i.from(e));if(!t){var n,r=this.type.contentMatch;return(n=r.findWrapping(e.type))?(this.match=r,n):null}this.match=this.type.contentMatch.matchFragment(t)}return this.match.findWrapping(e.type)},ae.prototype.finish=function(e){if(!(this.options&oe)){var t,n=this.content[this.content.length-1];n&&n.isText&&(t=/[ \t\r\n\u000c]+$/.exec(n.text))&&(n.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-t[0].length)))}var r=i.from(this.content);return!e&&this.match&&(r=r.append(this.match.fillBefore(i.empty,!0))),this.type?this.type.create(this.attrs,r,this.marks):r},ae.prototype.applyPending=function(e){for(var t=0,n=this.pendingMarks;t<n.length;t++){var r=n[t];(this.type?this.type.allowsMarkType(r.type):he(r.type,e))&&!r.isInSet(this.activeMarks)&&(this.activeMarks=r.addToSet(this.activeMarks),this.pendingMarks=r.removeFromSet(this.pendingMarks))}};var ce=function(e,t,n){this.parser=e,this.options=t,this.isOpen=n;var r,o=t.topNode,i=se(t.preserveWhitespace)|(n?4:0);r=o?new ae(o.type,o.attrs,u.none,u.none,!0,t.topMatch||o.type.contentMatch,i):new ae(n?null:e.schema.topNodeType,null,u.none,u.none,!0,null,i),this.nodes=[r],this.open=0,this.find=t.findPositions,this.needsBlock=!1},le={top:{configurable:!0},currentPos:{configurable:!0}};function ue(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function pe(e){var t={};for(var n in e)t[n]=e[n];return t}function he(e,t){var n=t.schema.nodes,r=function(r){var o=n[r];if(o.allowsMarkType(e)){var i=[],s=function(e){i.push(e);for(var n=0;n<e.edgeCount;n++){var r=e.edge(n),o=r.type,a=r.next;if(o==t)return!0;if(i.indexOf(a)<0&&s(a))return!0}};return s(o.contentMatch)?{v:!0}:void 0}};for(var o in n){var i=r(o);if(i)return i.v}}le.top.get=function(){return this.nodes[this.open]},ce.prototype.addDOM=function(e){if(3==e.nodeType)this.addTextNode(e);else if(1==e.nodeType){var t=e.getAttribute("style"),n=t?this.readStyles(function(e){var t,n=/\s*([\w-]+)\s*:\s*([^;]+)/g,r=[];for(;t=n.exec(e);)r.push(t[1],t[2].trim());return r}(t)):null,r=this.top;if(null!=n)for(var o=0;o<n.length;o++)this.addPendingMark(n[o]);if(this.addElement(e),null!=n)for(var i=0;i<n.length;i++)this.removePendingMark(n[i],r)}},ce.prototype.addTextNode=function(e){var t=e.nodeValue,n=this.top;if((n.type?n.type.inlineContent:n.content.length&&n.content[0].isInline)||/[^ \t\r\n\u000c]/.test(t)){if(n.options&oe)n.options&ie||(t=t.replace(/\r?\n|\r/g," "));else if(t=t.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(t)&&this.open==this.nodes.length-1){var r=n.content[n.content.length-1],o=e.previousSibling;(!r||o&&"BR"==o.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)},ce.prototype.addElement=function(e){var t=e.nodeName.toLowerCase();re.hasOwnProperty(t)&&function(e){for(var t=e.firstChild,n=null;t;t=t.nextSibling){var r=1==t.nodeType?t.nodeName.toLowerCase():null;r&&re.hasOwnProperty(r)&&n?(n.appendChild(t),t=n):"li"==r?n=t:r&&(n=null)}}(e);var n=this.options.ruleFromNode&&this.options.ruleFromNode(e)||this.parser.matchTag(e,this);if(n?n.ignore:ne.hasOwnProperty(t))this.findInside(e);else if(!n||n.skip){n&&n.skip.nodeType&&(e=n.skip);var r,o=this.top,i=this.needsBlock;if(te.hasOwnProperty(t))r=!0,o.type||(this.needsBlock=!0);else if(!e.firstChild)return void this.leafFallback(e);this.addAll(e),r&&this.sync(o),this.needsBlock=i}else this.addElementByRule(e,n)},ce.prototype.leafFallback=function(e){"BR"==e.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode("\n"))},ce.prototype.readStyles=function(e){for(var t=u.none,n=0;n<e.length;n+=2){var r=this.parser.matchStyle(e[n],e[n+1],this);if(r){if(r.ignore)return null;t=this.parser.schema.marks[r.mark].create(r.attrs).addToSet(t)}}return t},ce.prototype.addElementByRule=function(e,t){var n,r,o,i=this;t.node?(r=this.parser.schema.nodes[t.node]).isLeaf?this.insertNode(r.create(t.attrs))||this.leafFallback(e):n=this.enter(r,t.attrs,t.preserveWhitespace):(o=this.parser.schema.marks[t.mark].create(t.attrs),this.addPendingMark(o));var s=this.top;if(r&&r.isLeaf)this.findInside(e);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(function(e){return i.insertNode(e)});else{var a=t.contentElement;"string"==typeof a?a=e.querySelector(a):"function"==typeof a&&(a=a(e)),a||(a=e),this.findAround(e,a,!0),this.addAll(a,n)}n&&(this.sync(s),this.open--),o&&this.removePendingMark(o,s)},ce.prototype.addAll=function(e,t,n,r){for(var o=n||0,i=n?e.childNodes[n]:e.firstChild,s=null==r?null:e.childNodes[r];i!=s;i=i.nextSibling,++o)this.findAtPoint(e,o),this.addDOM(i),t&&te.hasOwnProperty(i.nodeName.toLowerCase())&&this.sync(t);this.findAtPoint(e,o)},ce.prototype.findPlace=function(e){for(var t,n,r=this.open;r>=0;r--){var o=this.nodes[r],i=o.findWrapping(e);if(i&&(!t||t.length>i.length)&&(t=i,n=o,!i.length))break;if(o.solid)break}if(!t)return!1;this.sync(n);for(var s=0;s<t.length;s++)this.enterInner(t[s],null,!1);return!0},ce.prototype.insertNode=function(e){if(e.isInline&&this.needsBlock&&!this.top.type){var t=this.textblockFromContext();t&&this.enterInner(t)}if(this.findPlace(e)){this.closeExtra();var n=this.top;n.applyPending(e.type),n.match&&(n.match=n.match.matchType(e.type));for(var r=n.activeMarks,o=0;o<e.marks.length;o++)n.type&&!n.type.allowsMarkType(e.marks[o].type)||(r=e.marks[o].addToSet(r));return n.content.push(e.mark(r)),!0}return!1},ce.prototype.enter=function(e,t,n){var r=this.findPlace(e.create(t));return r&&this.enterInner(e,t,!0,n),r},ce.prototype.enterInner=function(e,t,n,r){this.closeExtra();var o=this.top;o.applyPending(e),o.match=o.match&&o.match.matchType(e,t);var i=null==r?-5&o.options:se(r);4&o.options&&0==o.content.length&&(i|=4),this.nodes.push(new ae(e,t,o.activeMarks,o.pendingMarks,n,null,i)),this.open++},ce.prototype.closeExtra=function(e){var 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}},ce.prototype.finish=function(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)},ce.prototype.sync=function(e){for(var t=this.open;t>=0;t--)if(this.nodes[t]==e)return void(this.open=t)},le.currentPos.get=function(){this.closeExtra();for(var e=0,t=this.open;t>=0;t--){for(var n=this.nodes[t].content,r=n.length-1;r>=0;r--)e+=n[r].nodeSize;t&&e++}return e},ce.prototype.findAtPoint=function(e,t){if(this.find)for(var n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)},ce.prototype.findInside=function(e){if(this.find)for(var t=0;t<this.find.length;t++)null==this.find[t].pos&&1==e.nodeType&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)},ce.prototype.findAround=function(e,t,n){if(e!=t&&this.find)for(var r=0;r<this.find.length;r++){if(null==this.find[r].pos&&1==e.nodeType&&e.contains(this.find[r].node))t.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}},ce.prototype.findInText=function(e){if(this.find)for(var t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))},ce.prototype.matchesContext=function(e){var t=this;if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);var n=e.split("/"),r=this.options.context,o=!(this.isOpen||r&&r.parent.type!=this.nodes[0].type),i=-(r?r.depth+1:0)+(o?0:1),s=function(e,a){for(;e>=0;e--){var c=n[e];if(""==c){if(e==n.length-1||0==e)continue;for(;a>=i;a--)if(s(e-1,a))return!0;return!1}var l=a>0||0==a&&o?t.nodes[a].type:r&&a>=i?r.node(a-i).type:null;if(!l||l.name!=c&&-1==l.groups.indexOf(c))return!1;a--}return!0};return s(n.length-1,this.open)},ce.prototype.textblockFromContext=function(){var e=this.options.context;if(e)for(var t=e.depth;t>=0;t--){var n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(var r in this.parser.schema.nodes){var o=this.parser.schema.nodes[r];if(o.isTextblock&&o.defaultAttrs)return o}},ce.prototype.addPendingMark=function(e){this.top.pendingMarks=e.addToSet(this.top.pendingMarks)},ce.prototype.removePendingMark=function(e,t){for(var n=this.open;n>=0;n--){var r=this.nodes[n];if(r.pendingMarks.lastIndexOf(e)>-1?r.pendingMarks=e.removeFromSet(r.pendingMarks):r.activeMarks=e.removeFromSet(r.activeMarks),r==t)break}},Object.defineProperties(ce.prototype,le);var de=function(e,t){this.nodes=e||{},this.marks=t||{}};function fe(e){var t={};for(var n in e){var r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function me(e){return e.document||window.document}de.prototype.serializeFragment=function(e,t,n){var r=this;void 0===t&&(t={}),n||(n=me(t).createDocumentFragment());var o=n,i=null;return e.forEach(function(e){if(i||e.marks.length){i||(i=[]);for(var n=0,s=0;n<i.length&&s<e.marks.length;){var a=e.marks[s];if(r.marks[a.type.name]){if(!a.eq(i[n])||!1===a.type.spec.spanning)break;n+=2,s++}else s++}for(;n<i.length;)o=i.pop(),i.pop();for(;s<e.marks.length;){var c=e.marks[s++],l=r.serializeMark(c,e.isInline,t);l&&(i.push(c,o),o.appendChild(l.dom),o=l.contentDOM||l.dom)}}o.appendChild(r.serializeNode(e,t))}),n},de.prototype.serializeNode=function(e,t){void 0===t&&(t={});var n=de.renderSpec(me(t),this.nodes[e.type.name](e)),r=n.dom,o=n.contentDOM;if(o){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");t.onContent?t.onContent(e,o,t):this.serializeFragment(e.content,t,o)}return r},de.prototype.serializeNodeAndMarks=function(e,t){void 0===t&&(t={});for(var n=this.serializeNode(e,t),r=e.marks.length-1;r>=0;r--){var o=this.serializeMark(e.marks[r],e.isInline,t);o&&((o.contentDOM||o.dom).appendChild(n),n=o.dom)}return n},de.prototype.serializeMark=function(e,t,n){void 0===n&&(n={});var r=this.marks[e.type.name];return r&&de.renderSpec(me(n),r(e,t))},de.renderSpec=function(e,t,n){if(void 0===n&&(n=null),"string"==typeof t)return{dom:e.createTextNode(t)};if(null!=t.nodeType)return{dom:t};var r=t[0],o=r.indexOf(" ");o>0&&(n=r.slice(0,o),r=r.slice(o+1));var i=null,s=n?e.createElementNS(n,r):e.createElement(r),a=t[1],c=1;if(a&&"object"==typeof a&&null==a.nodeType&&!Array.isArray(a))for(var l in c=2,a)if(null!=a[l]){var u=l.indexOf(" ");u>0?s.setAttributeNS(l.slice(0,u),l.slice(u+1),a[l]):s.setAttribute(l,a[l])}for(var p=c;p<t.length;p++){var h=t[p];if(0===h){if(p<t.length-1||p>c)throw new RangeError("Content hole must be the only child of its parent node");return{dom:s,contentDOM:s}}var d=de.renderSpec(e,h,n),f=d.dom,m=d.contentDOM;if(s.appendChild(f),m){if(i)throw new RangeError("Multiple content holes");i=m}}return{dom:s,contentDOM:i}},de.fromSchema=function(e){return e.cached.domSerializer||(e.cached.domSerializer=new de(this.nodesFromSchema(e),this.marksFromSchema(e)))},de.nodesFromSchema=function(e){var t=fe(e.nodes);return t.text||(t.text=function(e){return e.text}),t},de.marksFromSchema=function(e){return fe(e.marks)}},POQ2:function(e,t,n){"use strict";var r=n("4r5K"),o=n("Bz7v");t.highlight=s,t.highlightAuto=function(e,t){var n,a,c,l,u=t||{},p=u.subset||r.listLanguages(),h=u.prefix,d=p.length,f=-1;null!==h&&void 0!==h||(h=i);if("string"!=typeof e)throw o("Expected `string` for value, got `%s`",e);a={relevance:0,language:null,value:[]},n={relevance:0,language:null,value:[]};for(;++f<d;)l=p[f],r.getLanguage(l)&&((c=s(l,e,t)).language=l,c.relevance>a.relevance&&(a=c),c.relevance>n.relevance&&(a=n,n=c));a.language&&(n.secondBest=a);return n},t.registerLanguage=function(e,t){r.registerLanguage(e,t)},t.listLanguages=function(){return r.listLanguages()},t.registerAlias=function(e,t){var n,o=e;t&&((o={})[e]=t);for(n in o)r.registerAliases(o[n],{languageName:n})},a.prototype.addText=function(e){var t,n,r=this.stack;if(""===e)return;t=r[r.length-1],(n=t.children[t.children.length-1])&&"text"===n.type?n.value+=e:t.children.push({type:"text",value:e})},a.prototype.addKeyword=function(e,t){this.openNode(t),this.addText(e),this.closeNode()},a.prototype.addSublanguage=function(e,t){var n=this.stack,r=n[n.length-1],o=e.rootNode.children,i=t?{type:"element",tagName:"span",properties:{className:[t]},children:o}:o;r.children=r.children.concat(i)},a.prototype.openNode=function(e){var t=this.stack,n=this.options.classPrefix+e,r=t[t.length-1],o={type:"element",tagName:"span",properties:{className:[n]},children:[]};r.children.push(o),t.push(o)},a.prototype.closeNode=function(){this.stack.pop()},a.prototype.closeAllNodes=c,a.prototype.finalize=c,a.prototype.toHTML=function(){return""};var i="hljs-";function s(e,t,n){var s,c=r.configure({}),l=(n||{}).prefix;if("string"!=typeof e)throw o("Expected `string` for name, got `%s`",e);if(!r.getLanguage(e))throw o("Unknown language: `%s` is not registered",e);if("string"!=typeof t)throw o("Expected `string` for value, got `%s`",t);if(null!==l&&void 0!==l||(l=i),r.configure({__emitter:a,classPrefix:l}),s=r.highlight(e,t,!0),r.configure(c),s.errorRaised)throw s.errorRaised;return{relevance:s.relevance,language:s.language,value:s.emitter.rootNode.children}}function a(e){this.options=e,this.rootNode={children:[]},this.stack=[this.rootNode]}function c(){}},SbYC:function(e,t,n){const{defaults:r}=n("vbtb"),{cleanUrl:o,escape:i}=n("rUJ1");e.exports=class{constructor(e){this.options=e||r}code(e,t,n){const r=(t||"").match(/\S*/)[0];if(this.options.highlight){const t=this.options.highlight(e,r);null!=t&&t!==e&&(n=!0,e=t)}return r?'<pre><code class="'+this.options.langPrefix+i(r,!0)+'">'+(n?e:i(e,!0))+"</code></pre>\n":"<pre><code>"+(n?e:i(e,!0))+"</code></pre>"}blockquote(e){return"<blockquote>\n"+e+"</blockquote>\n"}html(e){return e}heading(e,t,n,r){return this.options.headerIds?"<h"+t+' id="'+this.options.headerPrefix+r.slug(n)+'">'+e+"</h"+t+">\n":"<h"+t+">"+e+"</h"+t+">\n"}hr(){return this.options.xhtml?"<hr/>\n":"<hr>\n"}list(e,t,n){const r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"</"+r+">\n"}listitem(e){return"<li>"+e+"</li>\n"}checkbox(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "}paragraph(e){return"<p>"+e+"</p>\n"}table(e,t){return t&&(t="<tbody>"+t+"</tbody>"),"<table>\n<thead>\n"+e+"</thead>\n"+t+"</table>\n"}tablerow(e){return"<tr>\n"+e+"</tr>\n"}tablecell(e,t){const n=t.header?"th":"td";return(t.align?"<"+n+' align="'+t.align+'">':"<"+n+">")+e+"</"+n+">\n"}strong(e){return"<strong>"+e+"</strong>"}em(e){return"<em>"+e+"</em>"}codespan(e){return"<code>"+e+"</code>"}br(){return this.options.xhtml?"<br/>":"<br>"}del(e){return"<del>"+e+"</del>"}link(e,t,n){if(null===(e=o(this.options.sanitize,this.options.baseUrl,e)))return n;let r='<a href="'+i(e)+'"';return t&&(r+=' title="'+t+'"'),r+=">"+n+"</a>"}image(e,t,n){if(null===(e=o(this.options.sanitize,this.options.baseUrl,e)))return n;let r='<img src="'+e+'" alt="'+n+'"';return t&&(r+=' title="'+t+'"'),r+=this.options.xhtml?"/>":">"}text(e){return e}}},T9Ld:function(e,t,n){const{defaults:r}=n("vbtb"),{block:o}=n("e56X"),{rtrim:i,splitCells:s,escape:a}=n("rUJ1");e.exports=class e{constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||r,this.rules=o.normal,this.options.pedantic?this.rules=o.pedantic:this.options.gfm&&(this.rules=o.gfm)}static get rules(){return o}static lex(t,n){return new e(n).lex(t)}lex(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," "),this.token(e,!0)}token(e,t){let n,r,c,l,u,p,h,d,f,m,v,g,y,b,w,S;for(e=e.replace(/^ +$/gm,"");e;)if((c=this.rules.newline.exec(e))&&(e=e.substring(c[0].length),c[0].length>1&&this.tokens.push({type:"space"})),c=this.rules.code.exec(e)){const t=this.tokens[this.tokens.length-1];e=e.substring(c[0].length),t&&"paragraph"===t.type?t.text+="\n"+c[0].trimRight():(c=c[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",codeBlockStyle:"indented",text:this.options.pedantic?c:i(c,"\n")}))}else if(c=this.rules.fences.exec(e))e=e.substring(c[0].length),this.tokens.push({type:"code",lang:c[2]?c[2].trim():c[2],text:c[3]||""});else if(c=this.rules.heading.exec(e))e=e.substring(c[0].length),this.tokens.push({type:"heading",depth:c[1].length,text:c[2]});else if((c=this.rules.nptable.exec(e))&&(p={type:"table",header:s(c[1].replace(/^ *| *\| *$/g,"")),align:c[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:c[3]?c[3].replace(/\n$/,"").split("\n"):[]}).header.length===p.align.length){for(e=e.substring(c[0].length),v=0;v<p.align.length;v++)/^ *-+: *$/.test(p.align[v])?p.align[v]="right":/^ *:-+: *$/.test(p.align[v])?p.align[v]="center":/^ *:-+ *$/.test(p.align[v])?p.align[v]="left":p.align[v]=null;for(v=0;v<p.cells.length;v++)p.cells[v]=s(p.cells[v],p.header.length);this.tokens.push(p)}else if(c=this.rules.hr.exec(e))e=e.substring(c[0].length),this.tokens.push({type:"hr"});else if(c=this.rules.blockquote.exec(e))e=e.substring(c[0].length),this.tokens.push({type:"blockquote_start"}),c=c[0].replace(/^ *> ?/gm,""),this.token(c,t),this.tokens.push({type:"blockquote_end"});else if(c=this.rules.list.exec(e)){for(e=e.substring(c[0].length),h={type:"list_start",ordered:b=(l=c[2]).length>1,start:b?+l:"",loose:!1},this.tokens.push(h),d=[],n=!1,y=(c=c[0].match(this.rules.item)).length,v=0;v<y;v++)m=(p=c[v]).length,~(p=p.replace(/^ *([*+-]|\d+\.) */,"")).indexOf("\n ")&&(m-=p.length,p=this.options.pedantic?p.replace(/^ {1,4}/gm,""):p.replace(new RegExp("^ {1,"+m+"}","gm"),"")),v!==y-1&&(u=o.bullet.exec(c[v+1])[0],(l.length>1?1===u.length:u.length>1||this.options.smartLists&&u!==l)&&(e=c.slice(v+1).join("\n")+e,v=y-1)),r=n||/\n\n(?!\s*$)/.test(p),v!==y-1&&(n="\n"===p.charAt(p.length-1),r||(r=n)),r&&(h.loose=!0),S=void 0,(w=/^\[[ xX]\] /.test(p))&&(S=" "!==p[1],p=p.replace(/^\[[ xX]\] +/,"")),f={type:"list_item_start",task:w,checked:S,loose:r},d.push(f),this.tokens.push(f),this.token(p,!1),this.tokens.push({type:"list_item_end"});if(h.loose)for(y=d.length,v=0;v<y;v++)d[v].loose=!0;this.tokens.push({type:"list_end"})}else if(c=this.rules.html.exec(e))e=e.substring(c[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&("pre"===c[1]||"script"===c[1]||"style"===c[1]),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(c[0]):a(c[0]):c[0]});else if(t&&(c=this.rules.def.exec(e)))e=e.substring(c[0].length),c[3]&&(c[3]=c[3].substring(1,c[3].length-1)),g=c[1].toLowerCase().replace(/\s+/g," "),this.tokens.links[g]||(this.tokens.links[g]={href:c[2],title:c[3]});else if((c=this.rules.table.exec(e))&&(p={type:"table",header:s(c[1].replace(/^ *| *\| *$/g,"")),align:c[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:c[3]?c[3].replace(/\n$/,"").split("\n"):[]}).header.length===p.align.length){for(e=e.substring(c[0].length),v=0;v<p.align.length;v++)/^ *-+: *$/.test(p.align[v])?p.align[v]="right":/^ *:-+: *$/.test(p.align[v])?p.align[v]="center":/^ *:-+ *$/.test(p.align[v])?p.align[v]="left":p.align[v]=null;for(v=0;v<p.cells.length;v++)p.cells[v]=s(p.cells[v].replace(/^ *\| *| *\| *$/g,""),p.header.length);this.tokens.push(p)}else if(c=this.rules.lheading.exec(e))e=e.substring(c[0].length),this.tokens.push({type:"heading",depth:"="===c[2].charAt(0)?1:2,text:c[1]});else if(t&&(c=this.rules.paragraph.exec(e)))e=e.substring(c[0].length),this.tokens.push({type:"paragraph",text:"\n"===c[1].charAt(c[1].length-1)?c[1].slice(0,-1):c[1]});else if(c=this.rules.text.exec(e))e=e.substring(c[0].length),this.tokens.push({type:"text",text:c[0]});else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0));return this.tokens}}},"UxO+":function(e,t,n){"use strict";n.r(t),n.d(t,"AllSelection",function(){return d}),n.d(t,"EditorState",function(){return x}),n.d(t,"NodeSelection",function(){return p}),n.d(t,"Plugin",function(){return O}),n.d(t,"PluginKey",function(){return T}),n.d(t,"Selection",function(){return s}),n.d(t,"SelectionRange",function(){return c}),n.d(t,"TextSelection",function(){return l}),n.d(t,"Transaction",function(){return g});var r=n("MEpN"),o=n("CsC6"),i=Object.create(null),s=function(e,t,n){this.ranges=n||[new c(e.min(t),e.max(t))],this.$anchor=e,this.$head=t},a={anchor:{configurable:!0},head:{configurable:!0},from:{configurable:!0},to:{configurable:!0},$from:{configurable:!0},$to:{configurable:!0},empty:{configurable:!0}};a.anchor.get=function(){return this.$anchor.pos},a.head.get=function(){return this.$head.pos},a.from.get=function(){return this.$from.pos},a.to.get=function(){return this.$to.pos},a.$from.get=function(){return this.ranges[0].$from},a.$to.get=function(){return this.ranges[0].$to},a.empty.get=function(){for(var e=this.ranges,t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0},s.prototype.content=function(){return this.$from.node(0).slice(this.from,this.to,!0)},s.prototype.replace=function(e,t){void 0===t&&(t=r.Slice.empty);for(var n=t.content.lastChild,o=null,i=0;i<t.openEnd;i++)o=n,n=n.lastChild;for(var s=e.steps.length,a=this.ranges,c=0;c<a.length;c++){var l=a[c],u=l.$from,p=l.$to,h=e.mapping.slice(s);e.replaceRange(h.map(u.pos),h.map(p.pos),c?r.Slice.empty:t),0==c&&v(e,s,(n?n.isInline:o&&o.isTextblock)?-1:1)}},s.prototype.replaceWith=function(e,t){for(var n=e.steps.length,r=this.ranges,o=0;o<r.length;o++){var i=r[o],s=i.$from,a=i.$to,c=e.mapping.slice(n),l=c.map(s.pos),u=c.map(a.pos);o?e.deleteRange(l,u):(e.replaceRangeWith(l,u,t),v(e,n,t.isInline?-1:1))}},s.findFrom=function(e,t,n){var r=e.parent.inlineContent?new l(e):m(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(var o=e.depth-1;o>=0;o--){var i=t<0?m(e.node(0),e.node(o),e.before(o+1),e.index(o),t,n):m(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,t,n);if(i)return i}},s.near=function(e,t){return void 0===t&&(t=1),this.findFrom(e,t)||this.findFrom(e,-t)||new d(e.node(0))},s.atStart=function(e){return m(e,e,0,0,1)||new d(e)},s.atEnd=function(e){return m(e,e,e.content.size,e.childCount,-1)||new d(e)},s.fromJSON=function(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");var n=i[t.type];if(!n)throw new RangeError("No selection type "+t.type+" defined");return n.fromJSON(e,t)},s.jsonID=function(e,t){if(e in i)throw new RangeError("Duplicate use of selection JSON ID "+e);return i[e]=t,t.prototype.jsonID=e,t},s.prototype.getBookmark=function(){return l.between(this.$anchor,this.$head).getBookmark()},Object.defineProperties(s.prototype,a),s.prototype.visible=!0;var c=function(e,t){this.$from=e,this.$to=t},l=function(e){function t(t,n){void 0===n&&(n=t),e.call(this,t,n)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={$cursor:{configurable:!0}};return n.$cursor.get=function(){return this.$anchor.pos==this.$head.pos?this.$head:null},t.prototype.map=function(n,r){var o=n.resolve(r.map(this.head));if(!o.parent.inlineContent)return e.near(o);var i=n.resolve(r.map(this.anchor));return new t(i.parent.inlineContent?i:o,o)},t.prototype.replace=function(t,n){if(void 0===n&&(n=r.Slice.empty),e.prototype.replace.call(this,t,n),n==r.Slice.empty){var o=this.$from.marksAcross(this.$to);o&&t.ensureMarks(o)}},t.prototype.eq=function(e){return e instanceof t&&e.anchor==this.anchor&&e.head==this.head},t.prototype.getBookmark=function(){return new u(this.anchor,this.head)},t.prototype.toJSON=function(){return{type:"text",anchor:this.anchor,head:this.head}},t.fromJSON=function(e,n){if("number"!=typeof n.anchor||"number"!=typeof n.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new t(e.resolve(n.anchor),e.resolve(n.head))},t.create=function(e,t,n){void 0===n&&(n=t);var r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))},t.between=function(n,r,o){var i=n.pos-r.pos;if(o&&!i||(o=i>=0?1:-1),!r.parent.inlineContent){var s=e.findFrom(r,o,!0)||e.findFrom(r,-o,!0);if(!s)return e.near(r,o);r=s.$head}return n.parent.inlineContent||(0==i?n=r:(n=(e.findFrom(n,-o,!0)||e.findFrom(n,o,!0)).$anchor).pos<r.pos!=i<0&&(n=r)),new t(n,r)},Object.defineProperties(t.prototype,n),t}(s);s.jsonID("text",l);var u=function(e,t){this.anchor=e,this.head=t};u.prototype.map=function(e){return new u(e.map(this.anchor),e.map(this.head))},u.prototype.resolve=function(e){return l.between(e.resolve(this.anchor),e.resolve(this.head))};var p=function(e){function t(t){var n=t.nodeAfter,r=t.node(0).resolve(t.pos+n.nodeSize);e.call(this,t,r),this.node=n}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.map=function(n,r){var o=r.mapResult(this.anchor),i=o.deleted,s=o.pos,a=n.resolve(s);return i?e.near(a):new t(a)},t.prototype.content=function(){return new r.Slice(r.Fragment.from(this.node),0,0)},t.prototype.eq=function(e){return e instanceof t&&e.anchor==this.anchor},t.prototype.toJSON=function(){return{type:"node",anchor:this.anchor}},t.prototype.getBookmark=function(){return new h(this.anchor)},t.fromJSON=function(e,n){if("number"!=typeof n.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new t(e.resolve(n.anchor))},t.create=function(e,t){return new this(e.resolve(t))},t.isSelectable=function(e){return!e.isText&&!1!==e.type.spec.selectable},t}(s);p.prototype.visible=!1,s.jsonID("node",p);var h=function(e){this.anchor=e};h.prototype.map=function(e){var t=e.mapResult(this.anchor),n=t.deleted,r=t.pos;return n?new u(r,r):new h(r)},h.prototype.resolve=function(e){var t=e.resolve(this.anchor),n=t.nodeAfter;return n&&p.isSelectable(n)?new p(t):s.near(t)};var d=function(e){function t(t){e.call(this,t.resolve(0),t.resolve(t.content.size))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.replace=function(t,n){if(void 0===n&&(n=r.Slice.empty),n==r.Slice.empty){t.delete(0,t.doc.content.size);var o=e.atStart(t.doc);o.eq(t.selection)||t.setSelection(o)}else e.prototype.replace.call(this,t,n)},t.prototype.toJSON=function(){return{type:"all"}},t.fromJSON=function(e){return new t(e)},t.prototype.map=function(e){return new t(e)},t.prototype.eq=function(e){return e instanceof t},t.prototype.getBookmark=function(){return f},t}(s);s.jsonID("all",d);var f={map:function(){return this},resolve:function(e){return new d(e)}};function m(e,t,n,r,o,i){if(t.inlineContent)return l.create(e,n);for(var s=r-(o>0?0:1);o>0?s<t.childCount:s>=0;s+=o){var a=t.child(s);if(a.isAtom){if(!i&&p.isSelectable(a))return p.create(e,n-(o<0?a.nodeSize:0))}else{var c=m(e,a,n+o,o<0?a.childCount:0,o,i);if(c)return c}n+=a.nodeSize*o}}function v(e,t,n){var r=e.steps.length-1;if(!(r<t)){var i,a=e.steps[r];if(a instanceof o.c||a instanceof o.b)e.mapping.maps[r].forEach(function(e,t,n,r){null==i&&(i=r)}),e.setSelection(s.near(e.doc.resolve(i),n))}}var g=function(e){function t(t){e.call(this,t.doc),this.time=Date.now(),this.curSelection=t.selection,this.curSelectionFor=0,this.storedMarks=t.storedMarks,this.updated=0,this.meta=Object.create(null)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={selection:{configurable:!0},selectionSet:{configurable:!0},storedMarksSet:{configurable:!0},isGeneric:{configurable:!0},scrolledIntoView:{configurable:!0}};return n.selection.get=function(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection},t.prototype.setSelection=function(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=-3&(1|this.updated),this.storedMarks=null,this},n.selectionSet.get=function(){return(1&this.updated)>0},t.prototype.setStoredMarks=function(e){return this.storedMarks=e,this.updated|=2,this},t.prototype.ensureMarks=function(e){return r.Mark.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this},t.prototype.addStoredMark=function(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))},t.prototype.removeStoredMark=function(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))},n.storedMarksSet.get=function(){return(2&this.updated)>0},t.prototype.addStep=function(t,n){e.prototype.addStep.call(this,t,n),this.updated=-3&this.updated,this.storedMarks=null},t.prototype.setTime=function(e){return this.time=e,this},t.prototype.replaceSelection=function(e){return this.selection.replace(this,e),this},t.prototype.replaceSelectionWith=function(e,t){var n=this.selection;return!1!==t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||r.Mark.none))),n.replaceWith(this,e),this},t.prototype.deleteSelection=function(){return this.selection.replace(this),this},t.prototype.insertText=function(e,t,n){void 0===n&&(n=t);var r=this.doc.type.schema;if(null==t)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();if(!e)return this.deleteRange(t,n);var o=this.storedMarks;if(!o){var i=this.doc.resolve(t);o=n==t?i.marks():i.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,o)),this.selection.empty||this.setSelection(s.near(this.selection.$to)),this},t.prototype.setMeta=function(e,t){return this.meta["string"==typeof e?e:e.key]=t,this},t.prototype.getMeta=function(e){return this.meta["string"==typeof e?e:e.key]},n.isGeneric.get=function(){for(var e in this.meta)return!1;return!0},t.prototype.scrollIntoView=function(){return this.updated|=4,this},n.scrolledIntoView.get=function(){return(4&this.updated)>0},Object.defineProperties(t.prototype,n),t}(o.e);function y(e,t){return t&&e?e.bind(t):e}var b=function(e,t,n){this.name=e,this.init=y(t.init,n),this.apply=y(t.apply,n)},w=[new b("doc",{init:function(e){return e.doc||e.schema.topNodeType.createAndFill()},apply:function(e){return e.doc}}),new b("selection",{init:function(e,t){return e.selection||s.atStart(t.doc)},apply:function(e){return e.selection}}),new b("storedMarks",{init:function(e){return e.storedMarks||null},apply:function(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new b("scrollToSelection",{init:function(){return 0},apply:function(e,t){return e.scrolledIntoView?t+1:t}})],S=function(e,t){var n=this;this.schema=e,this.fields=w.concat(),this.plugins=[],this.pluginsByKey=Object.create(null),t&&t.forEach(function(e){if(n.pluginsByKey[e.key])throw new RangeError("Adding different instances of a keyed plugin ("+e.key+")");n.plugins.push(e),n.pluginsByKey[e.key]=e,e.spec.state&&n.fields.push(new b(e.key,e.spec.state,e))})},x=function(e){this.config=e},k={schema:{configurable:!0},plugins:{configurable:!0},tr:{configurable:!0}};k.schema.get=function(){return this.config.schema},k.plugins.get=function(){return this.config.plugins},x.prototype.apply=function(e){return this.applyTransaction(e).state},x.prototype.filterTransaction=function(e,t){void 0===t&&(t=-1);for(var n=0;n<this.config.plugins.length;n++)if(n!=t){var r=this.config.plugins[n];if(r.spec.filterTransaction&&!r.spec.filterTransaction.call(r,e,this))return!1}return!0},x.prototype.applyTransaction=function(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};for(var t=[e],n=this.applyInner(e),r=null;;){for(var o=!1,i=0;i<this.config.plugins.length;i++){var s=this.config.plugins[i];if(s.spec.appendTransaction){var a=r?r[i].n:0,c=r?r[i].state:this,l=a<t.length&&s.spec.appendTransaction.call(s,a?t.slice(a):t,c,n);if(l&&n.filterTransaction(l,i)){if(l.setMeta("appendedTransaction",e),!r){r=[];for(var u=0;u<this.config.plugins.length;u++)r.push(u<i?{state:n,n:t.length}:{state:this,n:0})}t.push(l),n=n.applyInner(l),o=!0}r&&(r[i]={state:n,n:t.length})}}if(!o)return{state:n,transactions:t}}},x.prototype.applyInner=function(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");for(var t=new x(this.config),n=this.config.fields,r=0;r<n.length;r++){var o=n[r];t[o.name]=o.apply(e,this[o.name],this,t)}for(var i=0;i<C.length;i++)C[i](this,e,t);return t},k.tr.get=function(){return new g(this)},x.create=function(e){for(var t=new S(e.schema||e.doc.type.schema,e.plugins),n=new x(t),r=0;r<t.fields.length;r++)n[t.fields[r].name]=t.fields[r].init(e,n);return n},x.prototype.reconfigure=function(e){for(var t=new S(e.schema||this.schema,e.plugins),n=t.fields,r=new x(t),o=0;o<n.length;o++){var i=n[o].name;r[i]=this.hasOwnProperty(i)?this[i]:n[o].init(e,r)}return r},x.prototype.toJSON=function(e){var t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map(function(e){return e.toJSON()})),e&&"object"==typeof e)for(var n in e){if("doc"==n||"selection"==n)throw new RangeError("The JSON fields `doc` and `selection` are reserved");var r=e[n],o=r.spec.state;o&&o.toJSON&&(t[n]=o.toJSON.call(r,this[r.key]))}return t},x.fromJSON=function(e,t,n){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");var o=new S(e.schema,e.plugins),i=new x(o);return o.fields.forEach(function(o){if("doc"==o.name)i.doc=r.Node.fromJSON(e.schema,t.doc);else if("selection"==o.name)i.selection=s.fromJSON(i.doc,t.selection);else if("storedMarks"==o.name)t.storedMarks&&(i.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(n)for(var a in n){var c=n[a],l=c.spec.state;if(c.key==o.name&&l&&l.fromJSON&&Object.prototype.hasOwnProperty.call(t,a))return void(i[o.name]=l.fromJSON.call(c,e,t[a],i))}i[o.name]=o.init(e,i)}}),i},x.addApplyListener=function(e){C.push(e)},x.removeApplyListener=function(e){var t=C.indexOf(e);t>-1&&C.splice(t,1)},Object.defineProperties(x.prototype,k);var C=[];var O=function(e){this.props={},e.props&&function e(t,n,r){for(var o in t){var i=t[o];i instanceof Function?i=i.bind(n):"handleDOMEvents"==o&&(i=e(i,n,{})),r[o]=i}return r}(e.props,this,this.props),this.spec=e,this.key=e.key?e.key.key:N("plugin")};O.prototype.getState=function(e){return e[this.key]};var M=Object.create(null);function N(e){return e in M?e+"$"+ ++M[e]:(M[e]=0,e+"$")}var T=function(e){void 0===e&&(e="key"),this.key=N(e)};T.prototype.get=function(e){return e.config.pluginsByKey[this.key]},T.prototype.getState=function(e){return e[this.key]}},V2qZ:function(e,t,n){"use strict";n.d(t,"a",function(){return wt}),n.d(t,"b",function(){return Ct});var r=n("UxO+"),o=n("MEpN"),i=n("CsC6"),s={};if("undefined"!=typeof navigator&&"undefined"!=typeof document){var a=/Edge\/(\d+)/.exec(navigator.userAgent),c=/MSIE \d/.test(navigator.userAgent),l=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);s.mac=/Mac/.test(navigator.platform);var u=s.ie=!!(c||l||a);s.ie_version=c?document.documentMode||6:l?+l[1]:a?+a[1]:null,s.gecko=!u&&/gecko\/(\d+)/i.test(navigator.userAgent),s.gecko_version=s.gecko&&+(/Firefox\/(\d+)/.exec(navigator.userAgent)||[0,0])[1];var p=!u&&/Chrome\/(\d+)/.exec(navigator.userAgent);s.chrome=!!p,s.chrome_version=p&&+p[1],s.ios=!u&&/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent),s.android=/Android \d/.test(navigator.userAgent),s.webkit="webkitFontSmoothing"in document.documentElement.style,s.safari=/Apple Computer/.test(navigator.vendor),s.webkit_version=s.webkit&&+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]}var h=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},d=function(e){var t=e.parentNode;return t&&11==t.nodeType?t.host:t},f=function(e,t,n){var r=document.createRange();return r.setEnd(e,null==n?e.nodeValue.length:n),r.setStart(e,t||0),r},m=function(e,t,n,r){return n&&(g(e,t,n,r,-1)||g(e,t,n,r,1))},v=/^(img|br|input|textarea|hr)$/i;function g(e,t,n,r,o){for(;;){if(e==n&&t==r)return!0;if(t==(o<0?0:y(e))){var i=e.parentNode;if(1!=i.nodeType||b(e)||v.test(e.nodeName)||"false"==e.contentEditable)return!1;t=h(e)+(o<0?0:1),e=i}else{if(1!=e.nodeType)return!1;if("false"==(e=e.childNodes[t+(o<0?-1:0)]).contentEditable)return!1;t=o<0?y(e):0}}}function y(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function b(e){for(var t,n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}var w=function(e){var t=e.isCollapsed;return t&&s.chrome&&e.rangeCount&&!e.getRangeAt(0).collapsed&&(t=!1),t};function S(e,t){var n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}function x(e){return{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function k(e,t){return"number"==typeof e?e:e[t]}function C(e){var t=e.getBoundingClientRect();return{left:t.left,right:t.left+e.clientWidth,top:t.top,bottom:t.top+e.clientHeight}}function O(e,t,n){for(var r=e.someProp("scrollThreshold")||0,o=e.someProp("scrollMargin")||5,i=e.dom.ownerDocument,s=n||e.dom;s;s=d(s))if(1==s.nodeType){var a=s==i.body||1!=s.nodeType,c=a?x(i):C(s),l=0,u=0;if(t.top<c.top+k(r,"top")?u=-(c.top-t.top+k(o,"top")):t.bottom>c.bottom-k(r,"bottom")&&(u=t.bottom-c.bottom+k(o,"bottom")),t.left<c.left+k(r,"left")?l=-(c.left-t.left+k(o,"left")):t.right>c.right-k(r,"right")&&(l=t.right-c.right+k(o,"right")),l||u)if(a)i.defaultView.scrollBy(l,u);else{var p=s.scrollLeft,h=s.scrollTop;u&&(s.scrollTop+=u),l&&(s.scrollLeft+=l);var f=s.scrollLeft-p,m=s.scrollTop-h;t={left:t.left-f,top:t.top-m,right:t.right-f,bottom:t.bottom-m}}if(a)break}}function M(e){for(var t=[],n=e.ownerDocument;e&&(t.push({dom:e,top:e.scrollTop,left:e.scrollLeft}),e!=n);e=d(e));return t}function N(e,t){for(var n=0;n<e.length;n++){var r=e[n],o=r.dom,i=r.top,s=r.left;o.scrollTop!=i+t&&(o.scrollTop=i+t),o.scrollLeft!=s&&(o.scrollLeft=s)}}var T=null;function D(e,t){for(var n,r,o=2e8,i=0,s=t.top,a=t.top,c=e.firstChild,l=0;c;c=c.nextSibling,l++){var u=void 0;if(1==c.nodeType)u=c.getClientRects();else{if(3!=c.nodeType)continue;u=f(c).getClientRects()}for(var p=0;p<u.length;p++){var h=u[p];if(h.top<=s&&h.bottom>=a){s=Math.max(h.bottom,s),a=Math.min(h.top,a);var d=h.left>t.left?h.left-t.left:h.right<t.left?t.left-h.right:0;if(d<o){n=c,o=d,r=d&&3==n.nodeType?{left:h.right<t.left?h.right:h.left,top:t.top}:t,1==c.nodeType&&d&&(i=l+(t.left>=(h.left+h.right)/2?1:0));continue}}!n&&(t.left>=h.right&&t.top>=h.top||t.left>=h.left&&t.top>=h.bottom)&&(i=l+1)}}return n&&3==n.nodeType?function(e,t){for(var n=e.nodeValue.length,r=document.createRange(),o=0;o<n;o++){r.setEnd(e,o+1),r.setStart(e,o);var i=R(r,1);if(i.top!=i.bottom&&A(t,i))return{node:e,offset:o+(t.left>=(i.left+i.right)/2?1:0)}}return{node:e,offset:0}}(n,r):!n||o&&1==n.nodeType?{node:e,offset:i}:D(n,r)}function A(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function E(e,t){var n,r,o,i,a=e.root;if(a.caretPositionFromPoint)try{var c=a.caretPositionFromPoint(t.left,t.top);c&&(o=(n=c).offsetNode,i=n.offset)}catch(e){}if(!o&&a.caretRangeFromPoint){var l=a.caretRangeFromPoint(t.left,t.top);l&&(o=(r=l).startContainer,i=r.startOffset)}var u,p=a.elementFromPoint(t.left,t.top+1);if(!p||!e.dom.contains(1!=p.nodeType?p.parentNode:p)){var h=e.dom.getBoundingClientRect();if(!A(t,h))return null;if(!(p=function e(t,n,r){var o=t.childNodes.length;if(o&&r.top<r.bottom)for(var i=Math.max(0,Math.min(o-1,Math.floor(o*(n.top-r.top)/(r.bottom-r.top))-2)),s=i;;){var a=t.childNodes[s];if(1==a.nodeType)for(var c=a.getClientRects(),l=0;l<c.length;l++){var u=c[l];if(A(n,u))return e(a,n,u)}if((s=(s+1)%o)==i)break}return t}(e.dom,t,h)))return null}if(s.safari&&p.draggable&&(o=i=null),p=function(e,t){var n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}(p,t),o){if(s.gecko&&1==o.nodeType&&(i=Math.min(i,o.childNodes.length))<o.childNodes.length){var d,f=o.childNodes[i];"IMG"==f.nodeName&&(d=f.getBoundingClientRect()).right<=t.left&&d.bottom>t.top&&i++}o==e.dom&&i==o.childNodes.length-1&&1==o.lastChild.nodeType&&t.top>o.lastChild.getBoundingClientRect().bottom?u=e.state.doc.content.size:0!=i&&1==o.nodeType&&"BR"==o.childNodes[i-1].nodeName||(u=function(e,t,n,r){for(var o=-1,i=t;i!=e.dom;){var s=e.docView.nearestDesc(i,!0);if(!s)return null;if(s.node.isBlock&&s.parent){var a=s.dom.getBoundingClientRect();if(a.left>r.left||a.top>r.top)o=s.posBefore;else{if(!(a.right<r.left||a.bottom<r.top))break;o=s.posAfter}}i=s.dom.parentNode}return o>-1?o:e.docView.posFromDOM(t,n)}(e,o,i,t))}null==u&&(u=function(e,t,n){var r=D(t,n),o=r.node,i=r.offset,s=-1;if(1==o.nodeType&&!o.firstChild){var a=o.getBoundingClientRect();s=a.left!=a.right&&n.left>(a.left+a.right)/2?1:-1}return e.docView.posFromDOM(o,i,s)}(e,p,t));var m=e.docView.nearestDesc(p,!0);return{pos:u,inside:m?m.posAtStart-m.border:-1}}function R(e,t){var n=e.getClientRects();return n.length?n[t<0?0:n.length-1]:e.getBoundingClientRect()}function _(e,t){var n=e.docView.domFromPos(t),r=n.node,o=n.offset;if(3==r.nodeType&&(s.webkit||s.gecko)){var i=R(f(r,o,o),0);if(s.gecko&&o&&/\s/.test(r.nodeValue[o-1])&&o<r.nodeValue.length){var a=R(f(r,o-1,o-1),-1);if(a.top==i.top){var c=R(f(r,o,o+1),-1);if(c.top!=i.top)return P(c,c.left<a.left)}}return i}if(1==r.nodeType&&!e.state.doc.resolve(t).parent.inlineContent){var l,u=!0;if(o<r.childNodes.length){var p=r.childNodes[o];1==p.nodeType&&(l=p.getBoundingClientRect())}if(!l&&o){var h=r.childNodes[o-1];1==h.nodeType&&(l=h.getBoundingClientRect(),u=!1)}return function(e,t){if(0==e.height)return e;var n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}(l||r.getBoundingClientRect(),u)}for(var d=-1;d<2;d+=2)if(d<0&&o){var m=void 0,v=3==r.nodeType?f(r,o-1,o):3==(m=r.childNodes[o-1]).nodeType?f(m):1==m.nodeType&&"BR"!=m.nodeName?m:null;if(v){var g=R(v,1);if(g.top<g.bottom)return P(g,!1)}}else if(d>0&&o<y(r)){var b=void 0,w=3==r.nodeType?f(r,o,o+1):3==(b=r.childNodes[o]).nodeType?f(b):1==b.nodeType?b:null;if(w){var S=R(w,-1);if(S.top<S.bottom)return P(S,!0)}}return P(R(3==r.nodeType?f(r):r,0),!1)}function P(e,t){if(0==e.width)return e;var n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function $(e,t,n){var r=e.state,o=e.root.activeElement;r!=t&&e.updateState(t),o!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),o!=e.dom&&o&&o.focus()}}var I=/[\u0590-\u08ac]/;var z=null,B=null,F=!1;function V(e,t,n){return z==t&&B==n?F:(z=t,B=n,F="up"==n||"down"==n?function(e,t,n){var r=t.selection,o="up"==n?r.$anchor.min(r.$head):r.$anchor.max(r.$head);return $(e,t,function(){for(var t=e.docView.domFromPos(o.pos).node;;){var r=e.docView.nearestDesc(t,!0);if(!r)break;if(r.node.isBlock){t=r.dom;break}t=r.dom.parentNode}for(var i=_(e,o.pos),s=t.firstChild;s;s=s.nextSibling){var a=void 0;if(1==s.nodeType)a=s.getClientRects();else{if(3!=s.nodeType)continue;a=f(s,0,s.nodeValue.length).getClientRects()}for(var c=0;c<a.length;c++){var l=a[c];if(l.bottom>l.top&&("up"==n?l.bottom<i.top+1:l.top>i.bottom-1))return!1}}return!0})}(e,t,n):function(e,t,n){var r=t.selection.$head;if(!r.parent.isTextblock)return!1;var o=r.parentOffset,i=!o,s=o==r.parent.content.size,a=getSelection();return I.test(r.parent.textContent)&&a.modify?$(e,t,function(){var t=a.getRangeAt(0),o=a.focusNode,i=a.focusOffset,s=a.caretBidiLevel;a.modify("move",n,"character");var c=!(r.depth?e.docView.domAfterPos(r.before()):e.dom).contains(1==a.focusNode.nodeType?a.focusNode:a.focusNode.parentNode)||o==a.focusNode&&i==a.focusOffset;return a.removeAllRanges(),a.addRange(t),null!=s&&(a.caretBidiLevel=s),c}):"left"==n||"backward"==n?i:s}(e,t,n))}var j=function(e,t,n,r){this.parent=e,this.children=t,this.dom=n,n.pmViewDesc=this,this.contentDOM=r,this.dirty=0},L={beforePosition:{configurable:!0},size:{configurable:!0},border:{configurable:!0},posBefore:{configurable:!0},posAtStart:{configurable:!0},posAfter:{configurable:!0},posAtEnd:{configurable:!0},contentLost:{configurable:!0}};j.prototype.matchesWidget=function(){return!1},j.prototype.matchesMark=function(){return!1},j.prototype.matchesNode=function(){return!1},j.prototype.matchesHack=function(){return!1},L.beforePosition.get=function(){return!1},j.prototype.parseRule=function(){return null},j.prototype.stopEvent=function(){return!1},L.size.get=function(){for(var e=0,t=0;t<this.children.length;t++)e+=this.children[t].size;return e},L.border.get=function(){return 0},j.prototype.destroy=function(){this.parent=null,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=null);for(var e=0;e<this.children.length;e++)this.children[e].destroy()},j.prototype.posBeforeChild=function(e){for(var t=0,n=this.posAtStart;t<this.children.length;t++){var r=this.children[t];if(r==e)return n;n+=r.size}},L.posBefore.get=function(){return this.parent.posBeforeChild(this)},L.posAtStart.get=function(){return this.parent?this.parent.posBeforeChild(this)+this.border:0},L.posAfter.get=function(){return this.posBefore+this.size},L.posAtEnd.get=function(){return this.posAtStart+this.size-2*this.border},j.prototype.localPosFromDOM=function(e,t,n){if(this.contentDOM&&this.contentDOM.contains(1==e.nodeType?e:e.parentNode)){if(n<0){var r,o;if(e==this.contentDOM)r=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;r=e.previousSibling}for(;r&&(!(o=r.pmViewDesc)||o.parent!=this);)r=r.previousSibling;return r?this.posBeforeChild(o)+o.size:this.posAtStart}var i,s;if(e==this.contentDOM)i=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;i=e.nextSibling}for(;i&&(!(s=i.pmViewDesc)||s.parent!=this);)i=i.nextSibling;return i?this.posBeforeChild(s):this.posAtEnd}var a;if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))a=2&e.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==t)for(var c=e;;c=c.parentNode){if(c==this.dom){a=!1;break}if(c.parentNode.firstChild!=c)break}if(null==a&&t==e.childNodes.length)for(var l=e;;l=l.parentNode){if(l==this.dom){a=!0;break}if(l.parentNode.lastChild!=l)break}}return(null==a?n>0:a)?this.posAtEnd:this.posAtStart},j.prototype.nearestDesc=function(e,t){for(var n=!0,r=e;r;r=r.parentNode){var o=this.getDesc(r);if(o&&(!t||o.node)){if(!n||!o.nodeDOM||(1==o.nodeDOM.nodeType?o.nodeDOM.contains(1==e.nodeType?e:e.parentNode):o.nodeDOM==e))return o;n=!1}}},j.prototype.getDesc=function(e){for(var t=e.pmViewDesc,n=t;n;n=n.parent)if(n==this)return t},j.prototype.posFromDOM=function(e,t,n){for(var r=e;r;r=r.parentNode){var o=this.getDesc(r);if(o)return o.localPosFromDOM(e,t,n)}return-1},j.prototype.descAt=function(e){for(var t=0,n=0;t<this.children.length;t++){var r=this.children[t],o=n+r.size;if(n==e&&o!=n){for(;!r.border&&r.children.length;)r=r.children[0];return r}if(e<o)return r.descAt(e-n-r.border);n=o}},j.prototype.domFromPos=function(e){if(!this.contentDOM)return{node:this.dom,offset:0};for(var t=0,n=0;;n++){if(t==e){for(;n<this.children.length&&(this.children[n].beforePosition||this.children[n].dom.parentNode!=this.contentDOM);)n++;return{node:this.contentDOM,offset:n==this.children.length?this.contentDOM.childNodes.length:h(this.children[n].dom)}}if(n==this.children.length)throw new Error("Invalid position "+e);var r=this.children[n],o=t+r.size;if(e<o)return r.domFromPos(e-t-r.border);t=o}},j.prototype.parseRange=function(e,t,n){if(void 0===n&&(n=0),0==this.children.length)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};for(var r=-1,o=-1,i=n,s=0;;s++){var a=this.children[s],c=i+a.size;if(-1==r&&e<=c){var l=i+a.border;if(e>=l&&t<=c-a.border&&a.node&&a.contentDOM&&this.contentDOM.contains(a.contentDOM))return a.parseRange(e,t,l);e=i;for(var u=s;u>0;u--){var p=this.children[u-1];if(p.size&&p.dom.parentNode==this.contentDOM&&!p.emptyChildAt(1)){r=h(p.dom)+1;break}e-=p.size}-1==r&&(r=0)}if(r>-1&&(c>t||s==this.children.length-1)){t=c;for(var d=s+1;d<this.children.length;d++){var f=this.children[d];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(-1)){o=h(f.dom);break}t+=f.size}-1==o&&(o=this.contentDOM.childNodes.length);break}i=c}return{node:this.contentDOM,from:e,to:t,fromOffset:r,toOffset:o}},j.prototype.emptyChildAt=function(e){if(this.border||!this.contentDOM||!this.children.length)return!1;var t=this.children[e<0?0:this.children.length-1];return 0==t.size||t.emptyChildAt(e)},j.prototype.domAfterPos=function(e){var t=this.domFromPos(e),n=t.node,r=t.offset;if(1!=n.nodeType||r==n.childNodes.length)throw new RangeError("No node after pos "+e);return n.childNodes[r]},j.prototype.setSelection=function(e,t,n,r){for(var o=Math.min(e,t),i=Math.max(e,t),a=0,c=0;a<this.children.length;a++){var l=this.children[a],u=c+l.size;if(o>c&&i<u)return l.setSelection(e-c-l.border,t-c-l.border,n,r);c=u}var p=this.domFromPos(e),h=this.domFromPos(t),d=n.getSelection(),f=!1;if((s.gecko||s.safari)&&e==t){var v=p.node.childNodes[p.offset-1];f=v&&("BR"==v.nodeName||"false"==v.contentEditable)}if(r||f&&s.safari||!m(p.node,p.offset,d.anchorNode,d.anchorOffset)||!m(h.node,h.offset,d.focusNode,d.focusOffset)){var g=!1;if((d.extend||e==t)&&!f){d.collapse(p.node,p.offset);try{e!=t&&d.extend(h.node,h.offset),g=!0}catch(e){if(!(e instanceof DOMException))throw e}}if(!g){if(e>t){var y=p;p=h,h=y}var b=document.createRange();b.setEnd(h.node,h.offset),b.setStart(p.node,p.offset),d.removeAllRanges(),d.addRange(b)}}},j.prototype.ignoreMutation=function(e){return!this.contentDOM&&"selection"!=e.type},L.contentLost.get=function(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)},j.prototype.markDirty=function(e,t){for(var n=0,r=0;r<this.children.length;r++){var o=this.children[r],i=n+o.size;if(n==i?e<=i&&t>=n:e<i&&t>n){var s=n+o.border,a=i-o.border;if(e>=s&&t<=a)return this.dirty=e==n||t==i?2:1,void(e!=s||t!=a||!o.contentLost&&o.dom.parentNode==this.contentDOM?o.markDirty(e-s,t-s):o.dirty=3);o.dirty=3}n=i}this.dirty=2},j.prototype.markParentsDirty=function(){for(var e=1,t=this.parent;t;t=t.parent,e++){var n=1==e?2:1;t.dirty<n&&(t.dirty=n)}},Object.defineProperties(j.prototype,L);var q=[],W=function(e){function t(t,n,r,o){var i,s=n.type.toDOM;if("function"==typeof s&&(s=s(r,function(){return i?i.parent?i.parent.posBeforeChild(i):void 0:o})),!n.type.spec.raw){if(1!=s.nodeType){var a=document.createElement("span");a.appendChild(s),s=a}s.contentEditable=!1,s.classList.add("ProseMirror-widget")}e.call(this,t,q,s,null),this.widget=n,i=this}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={beforePosition:{configurable:!0}};return n.beforePosition.get=function(){return this.widget.type.side<0},t.prototype.matchesWidget=function(e){return 0==this.dirty&&e.type.eq(this.widget.type)},t.prototype.parseRule=function(){return{ignore:!0}},t.prototype.stopEvent=function(e){var t=this.widget.spec.stopEvent;return!!t&&t(e)},t.prototype.ignoreMutation=function(e){return"selection"!=e.type||this.widget.spec.ignoreSelection},Object.defineProperties(t.prototype,n),t}(j),K=function(e){function t(t,n,r,o){e.call(this,t,q,n,null),this.textDOM=r,this.text=o}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={size:{configurable:!0}};return n.size.get=function(){return this.text.length},t.prototype.localPosFromDOM=function(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t},t.prototype.domFromPos=function(e){return{node:this.textDOM,offset:e}},t.prototype.ignoreMutation=function(e){return"characterData"===e.type&&e.target.nodeValue==e.oldValue},Object.defineProperties(t.prototype,n),t}(j),J=function(e){function t(t,n,r,o){e.call(this,t,[],r,o),this.mark=n}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.create=function(e,n,r,i){var s=i.nodeViews[n.type.name],a=s&&s(n,i,r);return a&&a.dom||(a=o.DOMSerializer.renderSpec(document,n.type.spec.toDOM(n,r))),new t(e,n,a.dom,a.contentDOM||a.dom)},t.prototype.parseRule=function(){return{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}},t.prototype.matchesMark=function(e){return 3!=this.dirty&&this.mark.eq(e)},t.prototype.markDirty=function(t,n){if(e.prototype.markDirty.call(this,t,n),0!=this.dirty){for(var r=this.parent;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=0}},t.prototype.slice=function(e,n,r){var o=t.create(this.parent,this.mark,!0,r),i=this.children,s=this.size;n<s&&(i=ce(i,n,s,r)),e>0&&(i=ce(i,0,e,r));for(var a=0;a<i.length;a++)i[a].parent=o;return o.children=i,o},t}(j),H=function(e){function t(t,n,r,o,i,s,a,c,l){e.call(this,t,n.isLeaf?q:[],i,s),this.nodeDOM=a,this.node=n,this.outerDeco=r,this.innerDeco=o,s&&this.updateChildren(c,l)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={size:{configurable:!0},border:{configurable:!0}};return t.create=function(e,n,r,i,s,a){var c,l,u=s.nodeViews[n.type.name],p=u&&u(n,s,function(){return l?l.parent?l.parent.posBeforeChild(l):void 0:a},r),h=p&&p.dom,d=p&&p.contentDOM;if(n.isText)if(h){if(3!=h.nodeType)throw new RangeError("Text must be rendered as a DOM text node")}else h=document.createTextNode(n.text);else h||(h=(c=o.DOMSerializer.renderSpec(document,n.type.spec.toDOM(n))).dom,d=c.contentDOM);d||n.isText||"BR"==h.nodeName||(h.hasAttribute("contenteditable")||(h.contentEditable=!1),n.type.spec.draggable&&(h.draggable=!0));var f=h;return h=re(h,r,n),p?l=new Z(e,n,r,i,h,d,f,p,s,a+1):n.isText?new G(e,n,r,i,h,f,s):new t(e,n,r,i,h,d,f,s,a+1)},t.prototype.parseRule=function(){var e=this;if(this.node.type.spec.reparseInView)return null;var t={node:this.node.type.name,attrs:this.node.attrs};return this.node.type.spec.code&&(t.preserveWhitespace="full"),this.contentDOM&&!this.contentLost?t.contentElement=this.contentDOM:t.getContent=function(){return e.contentDOM?o.Fragment.empty:e.node.content},t},t.prototype.matchesNode=function(e,t,n){return 0==this.dirty&&e.eq(this.node)&&oe(t,this.outerDeco)&&n.eq(this.innerDeco)},n.size.get=function(){return this.node.nodeSize},n.border.get=function(){return this.node.isLeaf?0:1},t.prototype.updateChildren=function(e,t){var n=this,r=this.node.inlineContent,i=t,a=r&&e.composing&&this.localCompositionNode(e,t),c=new se(this,a&&a.node);!function(e,t,n,r){var o=t.locals(e),i=0;if(0==o.length){for(var s=0;s<e.childCount;s++){var a=e.child(s);r(a,o,t.forChild(i,a),s),i+=a.nodeSize}return}for(var c=0,l=[],u=null,p=0;;){if(c<o.length&&o[c].to==i){for(var h=o[c++],d=void 0;c<o.length&&o[c].to==i;)(d||(d=[h])).push(o[c++]);if(d){d.sort(ae);for(var f=0;f<d.length;f++)n(d[f],p,!!u)}else n(h,p,!!u)}var m=void 0,v=void 0;if(u)v=-1,m=u,u=null;else{if(!(p<e.childCount))break;v=p,m=e.child(p++)}for(var g=0;g<l.length;g++)l[g].to<=i&&l.splice(g--,1);for(;c<o.length&&o[c].from<=i&&o[c].to>i;)l.push(o[c++]);var y=i+m.nodeSize;if(m.isText){var b=y;c<o.length&&o[c].from<b&&(b=o[c].from);for(var w=0;w<l.length;w++)l[w].to<b&&(b=l[w].to);b<y&&(u=m.cut(b-i),m=m.cut(0,b-i),y=b,v=-1)}var S=l.length?m.isInline&&!m.isLeaf?l.filter(function(e){return!e.inline}):l.slice():q;r(m,S,t.forChild(i,m),v),i=y}}(this.node,this.innerDeco,function(t,s,a){t.spec.marks?c.syncToMarks(t.spec.marks,r,e):t.type.side>=0&&!a&&c.syncToMarks(s==n.node.childCount?o.Mark.none:n.node.child(s).marks,r,e),c.placeWidget(t,e,i)},function(t,n,o,s){c.syncToMarks(t.marks,r,e),c.findNodeMatch(t,n,o,s)||c.updateNextNode(t,n,o,e,s)||c.addNode(t,n,o,e,i),i+=t.nodeSize}),c.syncToMarks(q,r,e),this.node.isTextblock&&c.addTextblockHacks(),c.destroyRest(),(c.changed||2==this.dirty)&&(a&&this.protectLocalComposition(e,a),function e(t,n,r){var o=t.firstChild,i=!1;for(var s=0;s<n.length;s++){var a=n[s],c=a.dom;if(c.parentNode==t){for(;c!=o;)o=ie(o),i=!0;o=o.nextSibling}else i=!0,t.insertBefore(c,o);if(a instanceof J){var l=o?o.previousSibling:t.lastChild;e(a.contentDOM,a.children,r),o=l?l.nextSibling:t.firstChild}}for(;o;)o=ie(o),i=!0;i&&r.trackWrites==t&&(r.trackWrites=null)}(this.contentDOM,this.children,e),s.ios&&function(e){if("UL"==e.nodeName||"OL"==e.nodeName){var t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}(this.dom))},t.prototype.localCompositionNode=function(e,t){var n=e.state.selection,o=n.from,i=n.to;if(!(!(e.state.selection instanceof r.TextSelection)||o<t||i>t+this.node.content.size)){var s=e.root.getSelection(),a=function(e,t){for(;;){if(3==e.nodeType)return e;if(1==e.nodeType&&t>0){if(e.childNodes.length>t&&3==e.childNodes[t].nodeType)return e.childNodes[t];e=e.childNodes[t-1],t=y(e)}else{if(!(1==e.nodeType&&t<e.childNodes.length))return null;e=e.childNodes[t],t=0}}}(s.focusNode,s.focusOffset);if(a&&this.dom.contains(a.parentNode)){var c=a.nodeValue,l=function(e,t,n,r){for(var o=0,i=0;o<e.childCount&&i<=r;){var s=e.child(o++),a=i;if(i+=s.nodeSize,s.isText){for(var c=s.text;o<e.childCount;){var l=e.child(o++);if(i+=l.nodeSize,!l.isText)break;c+=l.text}if(i>=n){var u=c.lastIndexOf(t,r-a);if(u>=0&&u+t.length+a>=n)return a+u}}}return-1}(this.node.content,c,o-t,i-t);return l<0?null:{node:a,pos:l,text:c}}}},t.prototype.protectLocalComposition=function(e,t){var n=t.node,r=t.pos,o=t.text;if(!this.getDesc(n)){for(var i=n;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=null)}var s=new K(this,i,n,o);e.compositionNodes.push(s),this.children=ce(this.children,r,r+o.length,e,s)}},t.prototype.update=function(e,t,n,r){return!(3==this.dirty||!e.sameMarkup(this.node))&&(this.updateInner(e,t,n,r),!0)},t.prototype.updateInner=function(e,t,n,r){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=0},t.prototype.updateOuterDeco=function(e){if(!oe(e,this.outerDeco)){var t=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=te(this.dom,this.nodeDOM,ee(this.outerDeco,this.node,t),ee(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=null,this.dom.pmViewDesc=this),this.outerDeco=e}},t.prototype.selectNode=function(){this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.dom.draggable=!0)},t.prototype.deselectNode=function(){this.nodeDOM.classList.remove("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||this.dom.removeAttribute("draggable")},Object.defineProperties(t.prototype,n),t}(j);function U(e,t,n,r,o){return re(r,t,e),new H(null,e,t,n,r,r,r,o,0)}var G=function(e){function t(t,n,r,o,i,s,a){e.call(this,t,n,r,o,i,null,s,a)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.parseRule=function(){for(var e=this.nodeDOM.parentNode;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}},t.prototype.update=function(e,t,n,r){return!(3==this.dirty||0!=this.dirty&&!this.inParent()||!e.sameMarkup(this.node))&&(this.updateOuterDeco(t),0==this.dirty&&e.text==this.node.text||e.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=e.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=e,this.dirty=0,!0)},t.prototype.inParent=function(){for(var e=this.parent.contentDOM,t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1},t.prototype.domFromPos=function(e){return{node:this.nodeDOM,offset:e}},t.prototype.localPosFromDOM=function(t,n,r){return t==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):e.prototype.localPosFromDOM.call(this,t,n,r)},t.prototype.ignoreMutation=function(e){return"characterData"!=e.type&&"selection"!=e.type},t.prototype.slice=function(e,n,r){var o=this.node.cut(e,n),i=document.createTextNode(o.text);return new t(this.parent,o,this.outerDeco,this.innerDeco,i,i,r)},t}(H),X=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.parseRule=function(){return{ignore:!0}},t.prototype.matchesHack=function(){return 0==this.dirty},t}(j),Z=function(e){function t(t,n,r,o,i,s,a,c,l,u){e.call(this,t,n,r,o,i,s,a,l,u),this.spec=c}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.update=function(t,n,r,o){if(3==this.dirty)return!1;if(this.spec.update){var i=this.spec.update(t,n);return i&&this.updateInner(t,n,r,o),i}return!(!this.contentDOM&&!t.isLeaf)&&e.prototype.update.call(this,t,n,r,o)},t.prototype.selectNode=function(){this.spec.selectNode?this.spec.selectNode():e.prototype.selectNode.call(this)},t.prototype.deselectNode=function(){this.spec.deselectNode?this.spec.deselectNode():e.prototype.deselectNode.call(this)},t.prototype.setSelection=function(t,n,r,o){this.spec.setSelection?this.spec.setSelection(t,n,r):e.prototype.setSelection.call(this,t,n,r,o)},t.prototype.destroy=function(){this.spec.destroy&&this.spec.destroy(),e.prototype.destroy.call(this)},t.prototype.stopEvent=function(e){return!!this.spec.stopEvent&&this.spec.stopEvent(e)},t.prototype.ignoreMutation=function(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):e.prototype.ignoreMutation.call(this,t)},t}(H);function Y(e){e&&(this.nodeName=e)}Y.prototype=Object.create(null);var Q=[new Y];function ee(e,t,n){if(0==e.length)return Q;for(var r=n?Q[0]:new Y,o=[r],i=0;i<e.length;i++){var s=e[i].type.attrs,a=r;if(s)for(var c in s.nodeName&&o.push(a=new Y(s.nodeName)),s){var l=s[c];null!=l&&(n&&1==o.length&&o.push(a=r=new Y(t.isInline?"span":"div")),"class"==c?a.class=(a.class?a.class+" ":"")+l:"style"==c?a.style=(a.style?a.style+";":"")+l:"nodeName"!=c&&(a[c]=l))}}return o}function te(e,t,n,r){if(n==Q&&r==Q)return t;for(var o=t,i=0;i<r.length;i++){var s=r[i],a=n[i];if(i){var c=void 0;a&&a.nodeName==s.nodeName&&o!=e&&(c=o.parentNode)&&c.tagName.toLowerCase()==s.nodeName?o=c:((c=document.createElement(s.nodeName)).pmIsDeco=!0,c.appendChild(o),a=Q[0],o=c)}ne(o,a||Q[0],s)}return o}function ne(e,t,n){for(var r in t)"class"==r||"style"==r||"nodeName"==r||r in n||e.removeAttribute(r);for(var o in n)"class"!=o&&"style"!=o&&"nodeName"!=o&&n[o]!=t[o]&&e.setAttribute(o,n[o]);if(t.class!=n.class){for(var i=t.class?t.class.split(" "):q,s=n.class?n.class.split(" "):q,a=0;a<i.length;a++)-1==s.indexOf(i[a])&&e.classList.remove(i[a]);for(var c=0;c<s.length;c++)-1==i.indexOf(s[c])&&e.classList.add(s[c])}if(t.style!=n.style){if(t.style)for(var l,u=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g;l=u.exec(t.style);)e.style.removeProperty(l[1]);n.style&&(e.style.cssText+=n.style)}}function re(e,t,n){return te(e,e,Q,ee(t,n,1!=e.nodeType))}function oe(e,t){if(e.length!=t.length)return!1;for(var n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function ie(e){var t=e.nextSibling;return e.parentNode.removeChild(e),t}var se=function(e,t){this.top=e,this.lock=t,this.index=0,this.stack=[],this.changed=!1;var n=function(e,t){for(var n=[],r=e.childCount,o=t.length-1;r>0&&o>=0;o--){var i=t[o],s=i.node;if(s){if(s!=e.child(r-1))break;n.push(i),--r}}return{nodes:n.reverse(),offset:r}}(e.node.content,e.children);this.preMatched=n.nodes,this.preMatchOffset=n.offset};function ae(e,t){return e.type.side-t.type.side}function ce(e,t,n,r,o){for(var i=[],s=0,a=0;s<e.length;s++){var c=e[s],l=a,u=a+=c.size;l>=n||u<=t?i.push(c):(l<t&&i.push(c.slice(0,t-l,r)),o&&(i.push(o),o=null),u>n&&i.push(c.slice(n-l,c.size,r)))}return i}function le(e,t){var n=e.root.getSelection(),o=e.state.doc;if(!n.focusNode)return null;var i=e.docView.nearestDesc(n.focusNode),s=i&&0==i.size,a=e.docView.posFromDOM(n.focusNode,n.focusOffset);if(a<0)return null;var c,l,u=o.resolve(a);if(w(n)){for(c=u;i&&!i.node;)i=i.parent;if(i&&i.node.isAtom&&r.NodeSelection.isSelectable(i.node)&&i.parent&&(!i.node.isInline||!function(e,t,n){for(var r=0==t,o=t==y(e);r||o;){if(e==n)return!0;var i=h(e);if(!(e=e.parentNode))return!1;r=r&&0==i,o=o&&i==y(e)}}(n.focusNode,n.focusOffset,i.dom))){var p=i.posBefore;l=new r.NodeSelection(a==p?u:o.resolve(p))}}else{var d=e.docView.posFromDOM(n.anchorNode,n.anchorOffset);if(d<0)return null;c=o.resolve(d)}l||(l=ge(e,c,u,"pointer"==t||e.state.selection.head<u.pos&&!s?1:-1));return l}function ue(e,t){var n=e.state.selection;if(me(e,n),e.editable?e.hasFocus():ye(e)&&document.activeElement&&document.activeElement.contains(e.dom)){if(e.domObserver.disconnectSelection(),e.cursorWrapper)!function(e){var t=e.root.getSelection(),n=document.createRange(),r=e.cursorWrapper.dom,o="IMG"==r.nodeName;o?n.setEnd(r.parentNode,h(r)+1):n.setEnd(r,0);n.collapse(!1),t.removeAllRanges(),t.addRange(n),!o&&!e.state.selection.visible&&s.ie&&s.ie_version<=11&&(r.disabled=!0,r.disabled=!1)}(e);else{var o,i,a=n.anchor,c=n.head;!pe||n instanceof r.TextSelection||(n.$from.parent.inlineContent||(o=he(e,n.from)),n.empty||n.$from.parent.inlineContent||(i=he(e,n.to))),e.docView.setSelection(a,c,e.root,t),pe&&(o&&fe(o),i&&fe(i)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&function(e){var t=e.dom.ownerDocument;t.removeEventListener("selectionchange",e.hideSelectionGuard);var n=e.root.getSelection(),r=n.anchorNode,o=n.anchorOffset;t.addEventListener("selectionchange",e.hideSelectionGuard=function(){n.anchorNode==r&&n.anchorOffset==o||(t.removeEventListener("selectionchange",e.hideSelectionGuard),e.dom.classList.remove("ProseMirror-hideselection"))})}(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}se.prototype.getPreMatch=function(e){return e>=this.preMatchOffset?this.preMatched[e-this.preMatchOffset]:null},se.prototype.destroyBetween=function(e,t){if(e!=t){for(var n=e;n<t;n++)this.top.children[n].destroy();this.top.children.splice(e,t-e),this.changed=!0}},se.prototype.destroyRest=function(){this.destroyBetween(this.index,this.top.children.length)},se.prototype.syncToMarks=function(e,t,n){for(var r=0,o=this.stack.length>>1,i=Math.min(o,e.length);r<i&&(r==o-1?this.top:this.stack[r+1<<1]).matchesMark(e[r])&&!1!==e[r].type.spec.spanning;)r++;for(;r<o;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<e.length;){this.stack.push(this.top,this.index+1);for(var s=-1,a=this.index;a<Math.min(this.index+3,this.top.children.length);a++)if(this.top.children[a].matchesMark(e[o])){s=a;break}if(s>-1)s>this.index&&(this.changed=!0,this.destroyBetween(this.index,s)),this.top=this.top.children[this.index];else{var c=J.create(this.top,e[o],t,n);this.top.children.splice(this.index,0,c),this.top=c,this.changed=!0}this.index=0,o++}},se.prototype.findNodeMatch=function(e,t,n,r){var o=-1,i=r<0?void 0:this.getPreMatch(r),s=this.top.children;if(i&&i.matchesNode(e,t,n))o=s.indexOf(i);else for(var a=this.index,c=Math.min(s.length,a+5);a<c;a++){var l=s[a];if(l.matchesNode(e,t,n)&&this.preMatched.indexOf(l)<0){o=a;break}}return!(o<0)&&(this.destroyBetween(this.index,o),this.index++,!0)},se.prototype.updateNextNode=function(e,t,n,r,o){for(var i=this.index;i<this.top.children.length;i++){var s=this.top.children[i];if(s instanceof H){var a=this.preMatched.indexOf(s);if(a>-1&&a+this.preMatchOffset!=o)return!1;var c=s.dom;if(!(this.lock&&(c==this.lock||1==c.nodeType&&c.contains(this.lock.parentNode))&&!(e.isText&&s.node&&s.node.isText&&s.nodeDOM.nodeValue==e.text&&3!=s.dirty&&oe(t,s.outerDeco)))&&s.update(e,t,n,r))return this.destroyBetween(this.index,i),s.dom!=c&&(this.changed=!0),this.index++,!0;break}}return!1},se.prototype.addNode=function(e,t,n,r,o){this.top.children.splice(this.index++,0,H.create(this.top,e,t,n,r,o)),this.changed=!0},se.prototype.placeWidget=function(e,t,n){var r=this.index<this.top.children.length?this.top.children[this.index]:null;if(!r||!r.matchesWidget(e)||e!=r.widget&&r.widget.type.toDOM.parentNode){var o=new W(this.top,e,t,n);this.top.children.splice(this.index++,0,o),this.changed=!0}else this.index++},se.prototype.addTextblockHacks=function(){for(var e=this.top.children[this.index-1];e instanceof J;)e=e.children[e.children.length-1];if(!e||!(e instanceof G)||/\n$/.test(e.node.text))if(this.index<this.top.children.length&&this.top.children[this.index].matchesHack())this.index++;else{var t=document.createElement("br");this.top.children.splice(this.index++,0,new X(this.top,q,t,null)),this.changed=!0}};var pe=s.safari||s.chrome&&s.chrome_version<63;function he(e,t){var n=e.docView.domFromPos(t),r=n.node,o=n.offset,i=o<r.childNodes.length?r.childNodes[o]:null,a=o?r.childNodes[o-1]:null;if(s.safari&&i&&"false"==i.contentEditable)return de(i);if(!(i&&"false"!=i.contentEditable||a&&"false"!=a.contentEditable)){if(i)return de(i);if(a)return de(a)}}function de(e){return e.contentEditable="true",s.safari&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function fe(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function me(e,t){if(t instanceof r.NodeSelection){var n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(ve(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else ve(e)}function ve(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=null)}function ge(e,t,n,o){return e.someProp("createSelectionBetween",function(r){return r(e,t,n)})||r.TextSelection.between(t,n,o)}function ye(e){var t=e.root.getSelection();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(e){return!1}}function be(e,t){var n=e.selection,o=n.$anchor,i=n.$head,s=t>0?o.max(i):o.min(i),a=s.parent.inlineContent?s.depth?e.doc.resolve(t>0?s.after():s.before()):null:s;return a&&r.Selection.findFrom(a,t)}function we(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function Se(e,t,n){var o=e.state.selection;if(!(o instanceof r.TextSelection)){if(o instanceof r.NodeSelection&&o.node.isInline)return we(e,new r.TextSelection(t>0?o.$to:o.$from));var i=be(e.state,t);return!!i&&we(e,i)}if(!o.empty||n.indexOf("s")>-1)return!1;if(e.endOfTextblock(t>0?"right":"left")){var a=be(e.state,t);return!!(a&&a instanceof r.NodeSelection)&&we(e,a)}if(!(s.mac&&n.indexOf("m")>-1)){var c,l=o.$head,u=l.textOffset?null:t<0?l.nodeBefore:l.nodeAfter;if(!u||u.isText)return!1;var p=t<0?l.pos-u.nodeSize:l.pos;return!!(u.isAtom||(c=e.docView.descAt(p))&&!c.contentDOM)&&(r.NodeSelection.isSelectable(u)?we(e,new r.NodeSelection(t<0?e.state.doc.resolve(l.pos-u.nodeSize):l)):!!s.webkit&&we(e,new r.TextSelection(e.state.doc.resolve(t<0?p:p+u.nodeSize))))}}function xe(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function ke(e){var t=e.pmViewDesc;return t&&0==t.size&&(e.nextSibling||"BR"!=e.nodeName)}function Ce(e){var t=e.root.getSelection(),n=t.focusNode,r=t.focusOffset;if(n){var o,i,a=!1;for(s.gecko&&1==n.nodeType&&r<xe(n)&&ke(n.childNodes[r])&&(a=!0);;)if(r>0){if(1!=n.nodeType)break;var c=n.childNodes[r-1];if(ke(c))o=n,i=--r;else{if(3!=c.nodeType)break;r=(n=c).nodeValue.length}}else{if(Me(n))break;for(var l=n.previousSibling;l&&ke(l);)o=n.parentNode,i=h(l),l=l.previousSibling;if(l)r=xe(n=l);else{if((n=n.parentNode)==e.dom)break;r=0}}a?Ne(e,t,n,r):o&&Ne(e,t,o,i)}}function Oe(e){var t=e.root.getSelection(),n=t.focusNode,r=t.focusOffset;if(n){for(var o,i,s=xe(n);;)if(r<s){if(1!=n.nodeType)break;if(!ke(n.childNodes[r]))break;o=n,i=++r}else{if(Me(n))break;for(var a=n.nextSibling;a&&ke(a);)o=a.parentNode,i=h(a)+1,a=a.nextSibling;if(a)r=0,s=xe(n=a);else{if((n=n.parentNode)==e.dom)break;r=s=0}}o&&Ne(e,t,o,i)}}function Me(e){var t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function Ne(e,t,n,r){if(w(t)){var o=document.createRange();o.setEnd(n,r),o.setStart(n,r),t.removeAllRanges(),t.addRange(o)}else t.extend&&t.extend(n,r);e.domObserver.setCurSelection();var i=e.state;setTimeout(function(){e.state==i&&ue(e)},50)}function Te(e,t,n){var o=e.state.selection;if(o instanceof r.TextSelection&&!o.empty||n.indexOf("s")>-1)return!1;if(s.mac&&n.indexOf("m")>-1)return!1;var i=o.$from,a=o.$to;if(!i.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){var c=be(e.state,t);if(c&&c instanceof r.NodeSelection)return we(e,c)}if(!i.parent.inlineContent){var l=r.Selection.findFrom(t<0?i:a,t);return!l||we(e,l)}return!1}function De(e,t){if(!(e.state.selection instanceof r.TextSelection))return!0;var n=e.state.selection,o=n.$head,i=n.$anchor,s=n.empty;if(!o.sameParent(i))return!0;if(!s)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;var a=!o.textOffset&&(t<0?o.nodeBefore:o.nodeAfter);if(a&&!a.isText){var c=e.state.tr;return t<0?c.delete(o.pos-a.nodeSize,o.pos):c.delete(o.pos,o.pos+a.nodeSize),e.dispatch(c),!0}return!1}function Ae(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function Ee(e,t){var n=t.keyCode,r=function(e){var t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}(t);return 8==n||s.mac&&72==n&&"c"==r?De(e,-1)||Ce(e):46==n||s.mac&&68==n&&"c"==r?De(e,1)||Oe(e):13==n||27==n||(37==n?Se(e,-1,r)||Ce(e):39==n?Se(e,1,r)||Oe(e):38==n?Te(e,-1,r)||Ce(e):40==n?function(e){if(s.safari&&!(e.state.selection.$head.parentOffset>0)){var t=e.root.getSelection(),n=t.focusNode,r=t.focusOffset;if(n&&1==n.nodeType&&0==r&&n.firstChild&&"false"==n.firstChild.contentEditable){var o=n.firstChild;Ae(e,o,!0),setTimeout(function(){return Ae(e,o,!1)},20)}}}(e)||Te(e,1,r)||Oe(e):r==(s.mac?"m":"c")&&(66==n||73==n||89==n||90==n))}function Re(e){var t=e.pmViewDesc;if(t)return t.parseRule();if("BR"==e.nodeName&&e.parentNode){if(s.safari&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){var n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}if(e.parentNode.lastChild==e||s.safari&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if("IMG"==e.nodeName&&e.getAttribute("mark-placeholder"))return{ignore:!0}}function _e(e,t,n,i,a){if(t<0){var c=e.lastSelectionTime>Date.now()-50?e.lastSelectionOrigin:null,l=le(e,c);if(l&&!e.state.selection.eq(l)){var u=e.state.tr.setSelection(l);"pointer"==c?u.setMeta("pointer",!0):"key"==c&&u.scrollIntoView(),e.dispatch(u)}}else{var p=e.state.doc.resolve(t),h=p.sharedDepth(n);t=p.before(h+1),n=e.state.doc.resolve(n).after(h+1);var d,f,m=e.state.selection,v=function(e,t,n){var r=e.docView.parseRange(t,n),i=r.node,a=r.fromOffset,c=r.toOffset,l=r.from,u=r.to,p=e.root.getSelection(),h=null,d=p.anchorNode;if(d&&e.dom.contains(1==d.nodeType?d:d.parentNode)&&(h=[{node:d,offset:p.anchorOffset}],w(p)||h.push({node:p.focusNode,offset:p.focusOffset})),s.chrome&&8===e.lastKeyCode)for(var f=c;f>a;f--){var m=i.childNodes[f-1],v=m.pmViewDesc;if("BR"==m.nodeType&&!v){c=f;break}if(!v||v.size)break}var g=e.state.doc,y=e.someProp("domParser")||o.DOMParser.fromSchema(e.state.schema),b=g.resolve(l),S=null,x=y.parse(i,{topNode:b.parent,topMatch:b.parent.contentMatchAt(b.index()),topOpen:!0,from:a,to:c,preserveWhitespace:!b.parent.type.spec.code||"full",editableContent:!0,findPositions:h,ruleFromNode:Re,context:b});if(h&&null!=h[0].pos){var k=h[0].pos,C=h[1]&&h[1].pos;null==C&&(C=k),S={anchor:k+l,head:C+l}}return{doc:x,sel:S,from:l,to:u}}(e,t,n),g=e.state.doc,y=g.slice(v.from,v.to);8===e.lastKeyCode&&Date.now()-100<e.lastKeyCodeTime?(d=e.state.selection.to,f="end"):(d=e.state.selection.from,f="start"),e.lastKeyCode=null;var b=function(e,t,n,r,o){var i=e.findDiffStart(t,n);if(null==i)return null;var s=e.findDiffEnd(t,n+e.size,n+t.size),a=s.a,c=s.b;if("end"==o){var l=Math.max(0,i-Math.min(a,c));r-=a+l-i}if(a<i&&e.size<t.size){var u=r<=i&&r>=a?i-r:0;c=(i-=u)+(c-a),a=i}else if(c<i){var p=r<=i&&r>=c?i-r:0;a=(i-=p)+(a-c),c=i}return{start:i,endA:a,endB:c}}(y.content,v.doc.content,v.from,d,f);if(!b){if(!(i&&m instanceof r.TextSelection&&!m.empty&&m.$head.sameParent(m.$anchor))||e.composing||v.sel&&v.sel.anchor!=v.sel.head){if(v.sel){var x=Pe(e,e.state.doc,v.sel);x&&!x.eq(e.state.selection)&&e.dispatch(e.state.tr.setSelection(x))}return}b={start:m.from,endA:m.to,endB:m.to}}e.domChangeCount++,e.state.selection.from<e.state.selection.to&&b.start==b.endB&&e.state.selection instanceof r.TextSelection&&(b.start>e.state.selection.from&&b.start<=e.state.selection.from+2?b.start=e.state.selection.from:b.endA<e.state.selection.to&&b.endA>=e.state.selection.to-2&&(b.endB+=e.state.selection.to-b.endA,b.endA=e.state.selection.to)),s.ie&&s.ie_version<=11&&b.endB==b.start+1&&b.endA==b.start&&b.start>v.from&&"  "==v.doc.textBetween(b.start-v.from-1,b.start-v.from+1)&&(b.start--,b.endA--,b.endB--);var k,C=v.doc.resolveNoCache(b.start-v.from),O=v.doc.resolveNoCache(b.endB-v.from),M=C.sameParent(O)&&C.parent.inlineContent;if((s.ios&&e.lastIOSEnter>Date.now()-225&&(!M||a.some(function(e){return"DIV"==e.nodeName||"P"==e.nodeName}))||!M&&C.pos<v.doc.content.size&&(k=r.Selection.findFrom(v.doc.resolve(C.pos+1),1,!0))&&k.head==O.pos)&&e.someProp("handleKeyDown",function(t){return t(e,S(13,"Enter"))}))e.lastIOSEnter=0;else if(e.state.selection.anchor>b.start&&function(e,t,n,r,o){if(!r.parent.isTextblock||n-t<=o.pos-r.pos||$e(r,!0,!1)<o.pos)return!1;var i=e.resolve(t);if(i.parentOffset<i.parent.content.size||!i.parent.isTextblock)return!1;var s=e.resolve($e(i,!0,!0));if(!s.parent.isTextblock||s.pos>n||$e(s,!0,!1)<n)return!1;return r.parent.content.cut(r.parentOffset).eq(s.parent.content)}(g,b.start,b.endA,C,O)&&e.someProp("handleKeyDown",function(t){return t(e,S(8,"Backspace"))}))s.android&&s.chrome&&e.domObserver.suppressSelectionUpdates();else{s.android&&!M&&C.start()!=O.start()&&0==O.parentOffset&&C.depth==O.depth&&v.sel&&v.sel.anchor==v.sel.head&&v.sel.head==b.endA&&(b.endB-=2,O=v.doc.resolveNoCache(b.endB-v.from),setTimeout(function(){e.someProp("handleKeyDown",function(t){return t(e,S(13,"Enter"))})},20));var N,T,D,A,E=b.start,R=b.endA;if(M)if(C.pos==O.pos)s.ie&&s.ie_version<=11&&0==C.parentOffset&&(e.domObserver.suppressSelectionUpdates(),setTimeout(function(){return ue(e)},20)),N=e.state.tr.delete(E,R),T=g.resolve(b.start).marksAcross(g.resolve(b.endA));else if(b.endA==b.endB&&(A=g.resolve(b.start))&&(D=function(e,t){for(var n,r,i,s=e.firstChild.marks,a=t.firstChild.marks,c=s,l=a,u=0;u<a.length;u++)c=a[u].removeFromSet(c);for(var p=0;p<s.length;p++)l=s[p].removeFromSet(l);if(1==c.length&&0==l.length)r=c[0],n="add",i=function(e){return e.mark(r.addToSet(e.marks))};else{if(0!=c.length||1!=l.length)return null;r=l[0],n="remove",i=function(e){return e.mark(r.removeFromSet(e.marks))}}for(var h=[],d=0;d<t.childCount;d++)h.push(i(t.child(d)));if(o.Fragment.from(h).eq(e))return{mark:r,type:n}}(C.parent.content.cut(C.parentOffset,O.parentOffset),A.parent.content.cut(A.parentOffset,b.endA-A.start()))))N=e.state.tr,"add"==D.type?N.addMark(E,R,D.mark):N.removeMark(E,R,D.mark);else if(C.parent.child(C.index()).isText&&C.index()==O.index()-(O.textOffset?0:1)){var _=C.parent.textBetween(C.parentOffset,O.parentOffset);if(e.someProp("handleTextInput",function(t){return t(e,E,R,_)}))return;N=e.state.tr.insertText(_,E,R)}if(N||(N=e.state.tr.replace(E,R,v.doc.slice(b.start-v.from,b.endB-v.from))),v.sel){var P=Pe(e,N.doc,v.sel);P&&!(s.chrome&&s.android&&e.composing&&P.empty&&(P.head==E||P.head==N.mapping.map(R)-1)||s.ie&&P.empty&&P.head==E)&&N.setSelection(P)}T&&N.ensureMarks(T),e.dispatch(N.scrollIntoView())}}}function Pe(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:ge(e,t.resolve(n.anchor),t.resolve(n.head))}function $e(e,t,n){for(var r=e.depth,o=t?e.end():e.pos;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,o++,t=!1;if(n)for(var i=e.node(r).maybeChild(e.indexAfter(r));i&&!i.isLeaf;)i=i.firstChild,o++;return o}function Ie(e,t){for(var n=[],r=t.content,i=t.openStart,s=t.openEnd;i>1&&s>1&&1==r.childCount&&1==r.firstChild.childCount;){i--,s--;var a=r.firstChild;n.push(a.type.name,a.type.hasRequiredAttrs()?a.attrs:null),r=a.content}var c=e.someProp("clipboardSerializer")||o.DOMSerializer.fromSchema(e.state.schema),l=Le(),u=l.createElement("div");u.appendChild(c.serializeFragment(r,{document:l}));for(var p,h=u.firstChild;h&&1==h.nodeType&&(p=Ve[h.nodeName.toLowerCase()]);){for(var d=p.length-1;d>=0;d--){for(var f=l.createElement(p[d]);u.firstChild;)f.appendChild(u.firstChild);u.appendChild(f)}h=u.firstChild}return h&&1==h.nodeType&&h.setAttribute("data-pm-slice",i+" "+s+" "+JSON.stringify(n)),{dom:u,text:e.someProp("clipboardTextSerializer",function(e){return e(t)})||t.content.textBetween(0,t.content.size,"\n\n")}}function ze(e,t,n,r,i){var s,a,c=i.parent.type.spec.code;if(!n&&!t)return null;var l=t&&(r||c||!n);if(l){if(e.someProp("transformPastedText",function(e){t=e(t,c||r)}),c)return new o.Slice(o.Fragment.from(e.state.schema.text(t)),0,0);var u=e.someProp("clipboardTextParser",function(e){return e(t,i,r)});u?a=u:(s=document.createElement("div"),t.trim().split(/(?:\r\n?|\n)+/).forEach(function(e){s.appendChild(document.createElement("p")).textContent=e}))}else e.someProp("transformPastedHTML",function(e){n=e(n)}),s=function(e){var t=/(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));var n,r=Le().createElement("div"),o=/(?:<meta [^>]*>)*<([a-z][^>\s]+)/i.exec(e),i=0;(n=o&&Ve[o[1].toLowerCase()])&&(e=n.map(function(e){return"<"+e+">"}).join("")+e+n.map(function(e){return"</"+e+">"}).reverse().join(""),i=n.length);r.innerHTML=e;for(var s=0;s<i;s++)r=r.firstChild;return r}(n);var p=s&&s.querySelector("[data-pm-slice]"),h=p&&/^(\d+) (\d+) (.*)/.exec(p.getAttribute("data-pm-slice"));if(!a){var d=e.someProp("clipboardParser")||e.someProp("domParser")||o.DOMParser.fromSchema(e.state.schema);a=d.parseSlice(s,{preserveWhitespace:!(!l&&!h),context:i})}return a=h?function(e,t){if(!e.size)return e;var n,r=e.content.firstChild.type.schema;try{n=JSON.parse(t)}catch(t){return e}for(var i=e.content,s=e.openStart,a=e.openEnd,c=n.length-2;c>=0;c-=2){var l=r.nodes[n[c]];if(!l||l.hasRequiredAttrs())break;i=o.Fragment.from(l.create(n[c+1],i)),s++,a++}return new o.Slice(i,s,a)}(function(e,t,n){t<e.openStart&&(e=new o.Slice(Fe(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd));n<e.openEnd&&(e=new o.Slice(Fe(e.content,1,n,e.openEnd,0,0),e.openStart,n));return e}(a,+h[1],+h[2]),h[3]):o.Slice.maxOpen(function(e,t){if(e.childCount<2)return e;for(var n=function(n){var r=t.node(n),i=r.contentMatchAt(t.index(n)),s=void 0,a=[];if(e.forEach(function(e){if(a){var t,n=i.findWrapping(e.type);if(!n)return a=null;if(t=a.length&&s.length&&function e(t,n,r,i,s){if(s<t.length&&s<n.length&&t[s]==n[s]){var a=e(t,n,r,i.lastChild,s+1);if(a)return i.copy(i.content.replaceChild(i.childCount-1,a));var c=i.contentMatchAt(i.childCount);if(c.matchType(s==t.length-1?r.type:t[s+1]))return i.copy(i.content.append(o.Fragment.from(Be(r,t,s+1))))}}(n,s,e,a[a.length-1],0))a[a.length-1]=t;else{a.length&&(a[a.length-1]=function e(t,n){if(0==n)return t;var r=t.content.replaceChild(t.childCount-1,e(t.lastChild,n-1));var i=t.contentMatchAt(t.childCount).fillBefore(o.Fragment.empty,!0);return t.copy(r.append(i))}(a[a.length-1],s.length));var r=Be(e,n);a.push(r),i=i.matchType(r.type,r.attrs),s=n}}}),a)return{v:o.Fragment.from(a)}},r=t.depth;r>=0;r--){var i=n(r);if(i)return i.v}return e}(a.content,i),!1),e.someProp("transformPasted",function(e){a=e(a)}),a}function Be(e,t,n){void 0===n&&(n=0);for(var r=t.length-1;r>=n;r--)e=t[r].create(null,o.Fragment.from(e));return e}function Fe(e,t,n,r,i,s){var a=t<0?e.firstChild:e.lastChild,c=a.content;return i<r-1&&(c=Fe(c,t,n,r,i+1,s)),i>=n&&(c=t<0?a.contentMatchAt(0).fillBefore(c,e.childCount>1||s<=i).append(c):c.append(a.contentMatchAt(a.childCount).fillBefore(o.Fragment.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,a.copy(c))}var Ve={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]},je=null;function Le(){return je||(je=document.implementation.createHTMLDocument("title"))}var qe={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},We=s.ie&&s.ie_version<=11,Ke=function(){this.anchorNode=this.anchorOffset=this.focusNode=this.focusOffset=null};Ke.prototype.set=function(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset},Ke.prototype.eq=function(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset};var Je=function(e,t){var n=this;this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=window.MutationObserver&&new window.MutationObserver(function(e){for(var t=0;t<e.length;t++)n.queue.push(e[t]);s.ie&&s.ie_version<=11&&e.some(function(e){return"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length})?n.flushSoon():n.flush()}),this.currentSelection=new Ke,We&&(this.onCharData=function(e){n.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),n.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.suppressingSelectionUpdates=!1};Je.prototype.flushSoon=function(){var e=this;this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(function(){e.flushingSoon=-1,e.flush()},20))},Je.prototype.forceFlush=function(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())},Je.prototype.start=function(){this.observer&&this.observer.observe(this.view.dom,qe),We&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()},Je.prototype.stop=function(){var e=this;if(this.observer){var t=this.observer.takeRecords();if(t.length){for(var n=0;n<t.length;n++)this.queue.push(t[n]);window.setTimeout(function(){return e.flush()},20)}this.observer.disconnect()}We&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()},Je.prototype.connectSelection=function(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)},Je.prototype.disconnectSelection=function(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)},Je.prototype.suppressSelectionUpdates=function(){var e=this;this.suppressingSelectionUpdates=!0,setTimeout(function(){return e.suppressingSelectionUpdates=!1},50)},Je.prototype.onSelectionChange=function(){if(function(e){return(!e.editable||e.root.activeElement==e.dom)&&ye(e)}(this.view)){if(this.suppressingSelectionUpdates)return ue(this.view);if(s.ie&&s.ie_version<=11&&!this.view.state.selection.empty){var e=this.view.root.getSelection();if(e.focusNode&&m(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}},Je.prototype.setCurSelection=function(){this.currentSelection.set(this.view.root.getSelection())},Je.prototype.ignoreSelectionChange=function(e){if(0==e.rangeCount)return!0;var t=e.getRangeAt(0).commonAncestorContainer,n=this.view.docView.nearestDesc(t);return n&&n.ignoreMutation({type:"selection",target:3==t.nodeType?t.parentNode:t})?(this.setCurSelection(),!0):void 0},Je.prototype.flush=function(){if(this.view.docView&&!(this.flushingSoon>-1)){var e=this.observer?this.observer.takeRecords():[];this.queue.length&&(e=this.queue.concat(e),this.queue.length=0);var t=this.view.root.getSelection(),n=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(t)&&ye(this.view)&&!this.ignoreSelectionChange(t),r=-1,o=-1,i=!1,a=[];if(this.view.editable)for(var c=0;c<e.length;c++){var l=this.registerMutation(e[c],a);l&&(r=r<0?l.from:Math.min(l.from,r),o=o<0?l.to:Math.max(l.to,o),l.typeOver&&(i=!0))}if(s.gecko&&a.length>1){var u=a.filter(function(e){return"BR"==e.nodeName});if(2==u.length){var p=u[0],h=u[1];p.parentNode&&p.parentNode.parentNode==h.parentNode?h.remove():p.remove()}}(r>-1||n)&&(r>-1&&(this.view.docView.markDirty(r,o),function(e){if(He)return;He=!0,"normal"==getComputedStyle(e.dom).whiteSpace&&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.")}(this.view)),this.handleDOMChange(r,o,i,a),this.view.docView.dirty?this.view.updateState(this.view.state):this.currentSelection.eq(t)||ue(this.view))}},Je.prototype.registerMutation=function(e,t){if(t.indexOf(e.target)>-1)return null;var n=this.view.docView.nearestDesc(e.target);if("attributes"==e.type&&(n==this.view.docView||"contenteditable"==e.attributeName||"style"==e.attributeName&&!e.oldValue&&!e.target.getAttribute("style")))return null;if(!n||n.ignoreMutation(e))return null;if("childList"==e.type){var r=e.previousSibling,o=e.nextSibling;if(s.ie&&s.ie_version<=11&&e.addedNodes.length)for(var i=0;i<e.addedNodes.length;i++){var a=e.addedNodes[i],c=a.previousSibling,l=a.nextSibling;(!c||Array.prototype.indexOf.call(e.addedNodes,c)<0)&&(r=c),(!l||Array.prototype.indexOf.call(e.addedNodes,l)<0)&&(o=l)}for(var u=r&&r.parentNode==e.target?h(r)+1:0,p=n.localPosFromDOM(e.target,u,-1),d=o&&o.parentNode==e.target?h(o):e.target.childNodes.length,f=0;f<e.addedNodes.length;f++)t.push(e.addedNodes[f]);return{from:p,to:n.localPosFromDOM(e.target,d,1)}}return"attributes"==e.type?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}};var He=!1;var Ue={},Ge={};function Xe(e,t){e.lastSelectionOrigin=t,e.lastSelectionTime=Date.now()}function Ze(e){e.someProp("handleDOMEvents",function(t){for(var n in t)e.eventHandlers[n]||e.dom.addEventListener(n,e.eventHandlers[n]=function(t){return Ye(e,t)})})}function Ye(e,t){return e.someProp("handleDOMEvents",function(n){var r=n[t.type];return!!r&&(r(e,t)||t.defaultPrevented)})}function Qe(e){return{left:e.clientX,top:e.clientY}}function et(e,t,n,r,o){if(-1==r)return!1;for(var i=e.state.doc.resolve(r),s=function(r){if(e.someProp(t,function(t){return r>i.depth?t(e,n,i.nodeAfter,i.before(r),o,!0):t(e,n,i.node(r),i.before(r),o,!1)}))return{v:!0}},a=i.depth+1;a>0;a--){var c=s(a);if(c)return c.v}return!1}function tt(e,t,n){e.focused||e.focus();var r=e.state.tr.setSelection(t);"pointer"==n&&r.setMeta("pointer",!0),e.dispatch(r)}function nt(e,t,n,o,i){return et(e,"handleClickOn",t,n,o)||e.someProp("handleClick",function(n){return n(e,t,o)})||(i?function(e,t){if(-1==t)return!1;var n,o,i=e.state.selection;i instanceof r.NodeSelection&&(n=i.node);for(var s=e.state.doc.resolve(t),a=s.depth+1;a>0;a--){var c=a>s.depth?s.nodeAfter:s.node(a);if(r.NodeSelection.isSelectable(c)){o=n&&i.$from.depth>0&&a>=i.$from.depth&&s.before(i.$from.depth+1)==i.$from.pos?s.before(i.$from.depth):s.before(a);break}}return null!=o&&(tt(e,r.NodeSelection.create(e.state.doc,o),"pointer"),!0)}(e,n):function(e,t){if(-1==t)return!1;var n=e.state.doc.resolve(t),o=n.nodeAfter;return!!(o&&o.isAtom&&r.NodeSelection.isSelectable(o))&&(tt(e,new r.NodeSelection(n),"pointer"),!0)}(e,n))}function rt(e,t,n,o){return et(e,"handleTripleClickOn",t,n,o)||e.someProp("handleTripleClick",function(n){return n(e,t,o)})||function(e,t){var n=e.state.doc;if(-1==t)return!!n.inlineContent&&(tt(e,r.TextSelection.create(n,0,n.content.size),"pointer"),!0);for(var o=n.resolve(t),i=o.depth+1;i>0;i--){var s=i>o.depth?o.nodeAfter:o.node(i),a=o.before(i);if(s.inlineContent)tt(e,r.TextSelection.create(n,a+1,a+1+s.content.size),"pointer");else{if(!r.NodeSelection.isSelectable(s))continue;tt(e,r.NodeSelection.create(n,a),"pointer")}return!0}}(e,n)}function ot(e){return pt(e)}Ge.keydown=function(e,t){if(e.shiftKey=16==t.keyCode||t.shiftKey,!at(e,t))if(e.domObserver.forceFlush(),e.lastKeyCode=t.keyCode,e.lastKeyCodeTime=Date.now(),!s.ios||13!=t.keyCode||t.ctrlKey||t.altKey||t.metaKey)e.someProp("handleKeyDown",function(n){return n(e,t)})||Ee(e,t)?t.preventDefault():Xe(e,"key");else{var n=Date.now();e.lastIOSEnter=n,e.lastIOSEnterFallbackTimeout=setTimeout(function(){e.lastIOSEnter==n&&(e.someProp("handleKeyDown",function(t){return t(e,S(13,"Enter"))}),e.lastIOSEnter=0)},200)}},Ge.keyup=function(e,t){16==t.keyCode&&(e.shiftKey=!1)},Ge.keypress=function(e,t){if(!(at(e,t)||!t.charCode||t.ctrlKey&&!t.altKey||s.mac&&t.metaKey))if(e.someProp("handleKeyPress",function(n){return n(e,t)}))t.preventDefault();else{var n=e.state.selection;if(!(n instanceof r.TextSelection&&n.$from.sameParent(n.$to))){var o=String.fromCharCode(t.charCode);e.someProp("handleTextInput",function(t){return t(e,n.$from.pos,n.$to.pos,o)})||e.dispatch(e.state.tr.insertText(o).scrollIntoView()),t.preventDefault()}}};var it=s.mac?"metaKey":"ctrlKey";Ue.mousedown=function(e,t){e.shiftKey=t.shiftKey;var n=ot(e),r=Date.now(),o="singleClick";r-e.lastClick.time<500&&function(e,t){var n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}(t,e.lastClick)&&!t[it]&&("singleClick"==e.lastClick.type?o="doubleClick":"doubleClick"==e.lastClick.type&&(o="tripleClick")),e.lastClick={time:r,x:t.clientX,y:t.clientY,type:o};var i=e.posAtCoords(Qe(t));i&&("singleClick"==o?e.mouseDown=new st(e,i,t,n):("doubleClick"==o?function(e,t,n,r){return et(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",function(n){return n(e,t,r)})}:rt)(e,i.pos,i.inside,t)?t.preventDefault():Xe(e,"pointer"))};var st=function(e,t,n,o){var i,a,c=this;if(this.view=e,this.startDoc=e.state.doc,this.pos=t,this.event=n,this.flushed=o,this.selectNode=n[it],this.allowDefault=n.shiftKey,t.inside>-1)i=e.state.doc.nodeAt(t.inside),a=t.inside;else{var l=e.state.doc.resolve(t.pos);i=l.parent,a=l.depth?l.before():0}this.mightDrag=null;var u=o?null:n.target,p=u?e.docView.nearestDesc(u,!0):null;this.target=p?p.dom:null,(i.type.spec.draggable&&!1!==i.type.spec.selectable||e.state.selection instanceof r.NodeSelection&&a==e.state.selection.from)&&(this.mightDrag={node:i,pos:a,addAttr:this.target&&!this.target.draggable,setUneditable:this.target&&s.gecko&&!this.target.hasAttribute("contentEditable")}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(function(){return c.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)),Xe(e,"pointer")};function at(e,t){return!!e.composing||!!(s.safari&&Math.abs(t.timeStamp-e.compositionEndedAt)<500)&&(e.compositionEndedAt=-2e8,!0)}st.prototype.done=function(){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.view.mouseDown=null},st.prototype.up=function(e){if(this.done(),this.view.dom.contains(3==e.target.nodeType?e.target.parentNode:e.target)){var t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(Qe(e))),this.allowDefault||!t?Xe(this.view,"pointer"):nt(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():this.flushed||s.safari&&this.mightDrag&&!this.mightDrag.node.isAtom||s.chrome&&!(this.view.state.selection instanceof r.TextSelection)&&(t.pos==this.view.state.selection.from||t.pos==this.view.state.selection.to)?(tt(this.view,r.Selection.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):Xe(this.view,"pointer")}},st.prototype.move=function(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0),Xe(this.view,"pointer")},Ue.touchdown=function(e){ot(e),Xe(e,"pointer")},Ue.contextmenu=function(e){return ot(e)};var ct=s.android?5e3:-1;function lt(e,t){clearTimeout(e.composingTimeout),t>-1&&(e.composingTimeout=setTimeout(function(){return pt(e)},t))}function ut(e){for(e.composing=!1;e.compositionNodes.length>0;)e.compositionNodes.pop().markParentsDirty()}function pt(e,t){if(e.domObserver.forceFlush(),ut(e),t||e.docView.dirty){var n=le(e);return n&&!n.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(n)):e.updateState(e.state),!0}return!1}Ge.compositionstart=Ge.compositionupdate=function(e){if(!e.composing){e.domObserver.flush();var t=e.state,n=t.selection.$from;if(t.selection.empty&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(function(e){return!1===e.type.spec.inclusive})))e.markCursor=e.state.storedMarks||n.marks(),pt(e,!0),e.markCursor=null;else if(pt(e),s.gecko&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length)for(var r=e.root.getSelection(),o=r.focusNode,i=r.focusOffset;o&&1==o.nodeType&&0!=i;){var a=i<0?o.lastChild:o.childNodes[i-1];if(!a)break;if(3==a.nodeType){r.collapse(a,a.nodeValue.length);break}o=a,i=-1}e.composing=!0}lt(e,ct)},Ge.compositionend=function(e,t){e.composing&&(e.composing=!1,e.compositionEndedAt=t.timeStamp,lt(e,20))};var ht=s.ie&&s.ie_version<15||s.ios&&s.webkit_version<604;function dt(e,t,n,r){var i=ze(e,t,n,e.shiftKey,e.state.selection.$from);if(!e.someProp("handlePaste",function(t){return t(e,r,i||o.Slice.empty)})&&i){var s=function(e){return 0==e.openStart&&0==e.openEnd&&1==e.content.childCount?e.content.firstChild:null}(i),a=s?e.state.tr.replaceSelectionWith(s,e.shiftKey):e.state.tr.replaceSelection(i);e.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste"))}}Ue.copy=Ge.cut=function(e,t){var n=e.state.selection,r="cut"==t.type;if(!n.empty){var o=ht?null:t.clipboardData,i=Ie(e,n.content()),s=i.dom,a=i.text;o?(t.preventDefault(),o.clearData(),o.setData("text/html",s.innerHTML),o.setData("text/plain",a)):function(e,t){if(e.dom.parentNode){var n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";var r=getSelection(),o=document.createRange();o.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout(function(){n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}}(e,s),r&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))}},Ge.paste=function(e,t){var n=ht?null:t.clipboardData,r=n&&n.getData("text/html"),o=n&&n.getData("text/plain");n&&(r||o||n.files.length)?(dt(e,o,r,t),t.preventDefault()):function(e,t){if(e.dom.parentNode){var n=e.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus(),setTimeout(function(){e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?dt(e,r.value,null,t):dt(e,r.textContent,r.innerHTML,t)},50)}}(e,t)};var ft=s.mac?"altKey":"ctrlKey";for(var mt in Ue.dragstart=function(e,t){var n=e.mouseDown;if(n&&n.done(),t.dataTransfer){var o=e.state.selection,i=o.empty?null:e.posAtCoords(Qe(t));if(i&&i.pos>=o.from&&i.pos<=(o instanceof r.NodeSelection?o.to-1:o.to));else if(n&&n.mightDrag)e.dispatch(e.state.tr.setSelection(r.NodeSelection.create(e.state.doc,n.mightDrag.pos)));else if(t.target&&1==t.target.nodeType){var s=e.docView.nearestDesc(t.target,!0);if(!s||!s.node.type.spec.draggable||s==e.docView)return;e.dispatch(e.state.tr.setSelection(r.NodeSelection.create(e.state.doc,s.posBefore)))}var a=e.state.selection.content(),c=Ie(e,a),l=c.dom,u=c.text;t.dataTransfer.clearData(),t.dataTransfer.setData(ht?"Text":"text/html",l.innerHTML),ht||t.dataTransfer.setData("text/plain",u),e.dragging=new function(e,t){this.slice=e,this.move=t}(a,!t[ft])}},Ue.dragend=function(e){window.setTimeout(function(){return e.dragging=null},50)},Ge.dragover=Ge.dragenter=function(e,t){return t.preventDefault()},Ge.drop=function(e,t){var n=e.dragging;if(e.dragging=null,t.dataTransfer){var s=e.posAtCoords(Qe(t));if(s){var a=e.state.doc.resolve(s.pos);if(a){var c=n&&n.slice||ze(e,t.dataTransfer.getData(ht?"Text":"text/plain"),ht?null:t.dataTransfer.getData("text/html"),!1,a),l=n&&!t[ft];if(e.someProp("handleDrop",function(n){return n(e,t,c||o.Slice.empty,l)}))t.preventDefault();else if(c){t.preventDefault();var u=c?Object(i.h)(e.state.doc,a.pos,c):a.pos;null==u&&(u=a.pos);var p=e.state.tr;l&&p.deleteSelection();var h=p.mapping.map(u),d=0==c.openStart&&0==c.openEnd&&1==c.content.childCount,f=p.doc;if(d?p.replaceRangeWith(h,h,c.content.firstChild):p.replaceRange(h,h,c),!p.doc.eq(f)){var m=p.doc.resolve(h);if(d&&r.NodeSelection.isSelectable(c.content.firstChild)&&m.nodeAfter&&m.nodeAfter.sameMarkup(c.content.firstChild))p.setSelection(new r.NodeSelection(m));else{var v=p.mapping.map(u);p.mapping.maps[p.mapping.maps.length-1].forEach(function(e,t,n,r){return v=r}),p.setSelection(ge(e,m,p.doc.resolve(v)))}e.focus(),e.dispatch(p.setMeta("uiEvent","drop"))}}}}}},Ue.focus=function(e){e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout(function(){e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.root.getSelection())&&ue(e)},20))},Ue.blur=function(e){e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),e.domObserver.currentSelection.set({}),e.focused=!1)},Ue.beforeinput=function(e,t){if(s.chrome&&s.android&&"deleteContentBackward"==t.inputType){var n=e.domChangeCount;setTimeout(function(){if(e.domChangeCount==n&&(e.dom.blur(),e.focus(),!e.someProp("handleKeyDown",function(t){return t(e,S(8,"Backspace"))}))){var t=e.state.selection.$cursor;t&&t.pos>0&&e.dispatch(e.state.tr.delete(t.pos-1,t.pos).scrollIntoView())}},50)}},Ge)Ue[mt]=Ge[mt];function vt(e,t){if(e==t)return!0;for(var n in e)if(e[n]!==t[n])return!1;for(var r in t)if(!(r in e))return!1;return!0}var gt=function(e,t){this.spec=t||kt,this.side=this.spec.side||0,this.toDOM=e};gt.prototype.map=function(e,t,n,r){var o=e.mapResult(t.from+r,this.side<0?-1:1),i=o.pos;return o.deleted?null:new wt(i-n,i-n,this)},gt.prototype.valid=function(){return!0},gt.prototype.eq=function(e){return this==e||e instanceof gt&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&vt(this.spec,e.spec))};var yt=function(e,t){this.spec=t||kt,this.attrs=e};yt.prototype.map=function(e,t,n,r){var o=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,i=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return o>=i?null:new wt(o,i,this)},yt.prototype.valid=function(e,t){return t.from<t.to},yt.prototype.eq=function(e){return this==e||e instanceof yt&&vt(this.attrs,e.attrs)&&vt(this.spec,e.spec)},yt.is=function(e){return e.type instanceof yt};var bt=function(e,t){this.spec=t||kt,this.attrs=e};bt.prototype.map=function(e,t,n,r){var o=e.mapResult(t.from+r,1);if(o.deleted)return null;var i=e.mapResult(t.to+r,-1);return i.deleted||i.pos<=o.pos?null:new wt(o.pos-n,i.pos-n,this)},bt.prototype.valid=function(e,t){var n=e.content.findIndex(t.from),r=n.index,o=n.offset;return o==t.from&&o+e.child(r).nodeSize==t.to},bt.prototype.eq=function(e){return this==e||e instanceof bt&&vt(this.attrs,e.attrs)&&vt(this.spec,e.spec)};var wt=function(e,t,n){this.from=e,this.to=t,this.type=n},St={spec:{configurable:!0},inline:{configurable:!0}};wt.prototype.copy=function(e,t){return new wt(e,t,this.type)},wt.prototype.eq=function(e,t){return void 0===t&&(t=0),this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to},wt.prototype.map=function(e,t,n){return this.type.map(e,this,t,n)},wt.widget=function(e,t,n){return new wt(e,e,new gt(t,n))},wt.inline=function(e,t,n,r){return new wt(e,t,new yt(n,r))},wt.node=function(e,t,n,r){return new wt(e,t,new bt(n,r))},St.spec.get=function(){return this.type.spec},St.inline.get=function(){return this.type instanceof yt},Object.defineProperties(wt.prototype,St);var xt=[],kt={},Ct=function(e,t){this.local=e&&e.length?e:xt,this.children=t&&t.length?t:xt};Ct.create=function(e,t){return t.length?At(t,e,0,kt):Ot},Ct.prototype.find=function(e,t,n){var r=[];return this.findInner(null==e?0:e,null==t?1e9:t,r,0,n),r},Ct.prototype.findInner=function(e,t,n,r,o){for(var i=0;i<this.local.length;i++){var s=this.local[i];s.from<=t&&s.to>=e&&(!o||o(s.spec))&&n.push(s.copy(s.from+r,s.to+r))}for(var a=0;a<this.children.length;a+=3)if(this.children[a]<t&&this.children[a+1]>e){var c=this.children[a]+1;this.children[a+2].findInner(e-c,t-c,n,r+c,o)}},Ct.prototype.map=function(e,t,n){return this==Ot||0==e.maps.length?this:this.mapInner(e,t,0,0,n||kt)},Ct.prototype.mapInner=function(e,t,n,r,o){for(var i,s=0;s<this.local.length;s++){var a=this.local[s].map(e,n,r);a&&a.type.valid(t,a)?(i||(i=[])).push(a):o.onRemove&&o.onRemove(this.local[s].spec)}return this.children.length?function(e,t,n,r,o,i,s){for(var a=e.slice(),c=function(e,t,n,r){for(var s=0;s<a.length;s+=3){var c=a[s+1],l=void 0;-1==c||e>c+i||(t>=a[s]+i?a[s+1]=-1:n>=o&&(l=r-n-(t-e))&&(a[s]+=l,a[s+1]+=l))}},l=0;l<n.maps.length;l++)n.maps[l].forEach(c);for(var u=!1,p=0;p<a.length;p+=3)if(-1==a[p+1]){var h=n.map(e[p]+i),d=h-o;if(d<0||d>=r.content.size){u=!0;continue}var f=n.map(e[p+1]+i,-1),m=f-o,v=r.content.findIndex(d),g=v.index,y=v.offset,b=r.maybeChild(g);if(b&&y==d&&y+b.nodeSize==m){var w=a[p+2].mapInner(n,b,h+1,e[p]+i+1,s);w!=Ot?(a[p]=d,a[p+1]=m,a[p+2]=w):(a[p+1]=-2,u=!0)}else u=!0}if(u){var S=function(e,t,n,r,o,i,s){function a(e,t){for(var i=0;i<e.local.length;i++){var c=e.local[i].map(r,o,t);c?n.push(c):s.onRemove&&s.onRemove(e.local[i].spec)}for(var l=0;l<e.children.length;l+=3)a(e.children[l+2],e.children[l]+t+1)}for(var c=0;c<e.length;c+=3)-1==e[c+1]&&a(e[c+2],t[c]+i+1);return n}(a,e,t||[],n,o,i,s),x=At(S,r,0,s);t=x.local;for(var k=0;k<a.length;k+=3)a[k+1]<0&&(a.splice(k,3),k-=3);for(var C=0,O=0;C<x.children.length;C+=3){for(var M=x.children[C];O<a.length&&a[O]<M;)O+=3;a.splice(O,0,x.children[C],x.children[C+1],x.children[C+2])}}return new Ct(t&&t.sort(Et),a)}(this.children,i,e,t,n,r,o):i?new Ct(i.sort(Et)):Ot},Ct.prototype.add=function(e,t){return t.length?this==Ot?Ct.create(e,t):this.addInner(e,t,0):this},Ct.prototype.addInner=function(e,t,n){var r,o=this,i=0;e.forEach(function(e,s){var a,c=s+n;if(a=Tt(t,e,c)){for(r||(r=o.children.slice());i<r.length&&r[i]<s;)i+=3;r[i]==s?r[i+2]=r[i+2].addInner(e,a,c+1):r.splice(i,0,s,s+e.nodeSize,At(a,e,c+1,kt)),i+=3}});var s=Nt(i?Dt(t):t,-n);return new Ct(s.length?this.local.concat(s).sort(Et):this.local,r||this.children)},Ct.prototype.remove=function(e){return 0==e.length||this==Ot?this:this.removeInner(e,0)},Ct.prototype.removeInner=function(e,t){for(var n=this.children,r=this.local,o=0;o<n.length;o+=3){for(var i=void 0,s=n[o]+t,a=n[o+1]+t,c=0,l=void 0;c<e.length;c++)(l=e[c])&&l.from>s&&l.to<a&&(e[c]=null,(i||(i=[])).push(l));if(i){n==this.children&&(n=this.children.slice());var u=n[o+2].removeInner(i,s+1);u!=Ot?n[o+2]=u:(n.splice(o,3),o-=3)}}if(r.length)for(var p=0,h=void 0;p<e.length;p++)if(h=e[p])for(var d=0;d<r.length;d++)r[d].eq(h,t)&&(r==this.local&&(r=this.local.slice()),r.splice(d--,1));return n==this.children&&r==this.local?this:r.length||n.length?new Ct(r,n):Ot},Ct.prototype.forChild=function(e,t){if(this==Ot)return this;if(t.isLeaf)return Ct.empty;for(var n,r,o=0;o<this.children.length;o+=3)if(this.children[o]>=e){this.children[o]==e&&(n=this.children[o+2]);break}for(var i=e+1,s=i+t.content.size,a=0;a<this.local.length;a++){var c=this.local[a];if(c.from<s&&c.to>i&&c.type instanceof yt){var l=Math.max(i,c.from)-i,u=Math.min(s,c.to)-i;l<u&&(r||(r=[])).push(c.copy(l,u))}}if(r){var p=new Ct(r.sort(Et));return n?new Mt([p,n]):p}return n||Ot},Ct.prototype.eq=function(e){if(this==e)return!0;if(!(e instanceof Ct)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(var t=0;t<this.local.length;t++)if(!this.local[t].eq(e.local[t]))return!1;for(var n=0;n<this.children.length;n+=3)if(this.children[n]!=e.children[n]||this.children[n+1]!=e.children[n+1]||!this.children[n+2].eq(e.children[n+2]))return!1;return!0},Ct.prototype.locals=function(e){return Rt(this.localsInner(e))},Ct.prototype.localsInner=function(e){if(this==Ot)return xt;if(e.inlineContent||!this.local.some(yt.is))return this.local;for(var t=[],n=0;n<this.local.length;n++)this.local[n].type instanceof yt||t.push(this.local[n]);return t};var Ot=new Ct;Ct.empty=Ot,Ct.removeOverlap=Rt;var Mt=function(e){this.members=e};function Nt(e,t){if(!t||!e.length)return e;for(var n=[],r=0;r<e.length;r++){var o=e[r];n.push(new wt(o.from+t,o.to+t,o.type))}return n}function Tt(e,t,n){if(t.isLeaf)return null;for(var r=n+t.nodeSize,o=null,i=0,s=void 0;i<e.length;i++)(s=e[i])&&s.from>n&&s.to<r&&((o||(o=[])).push(s),e[i]=null);return o}function Dt(e){for(var t=[],n=0;n<e.length;n++)null!=e[n]&&t.push(e[n]);return t}function At(e,t,n,r){var o=[],i=!1;t.forEach(function(t,s){var a=Tt(e,t,s+n);if(a){i=!0;var c=At(a,t,n+s+1,r);c!=Ot&&o.push(s,s+t.nodeSize,c)}});for(var s=Nt(i?Dt(e):e,-n).sort(Et),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||o.length?new Ct(s,o):Ot}function Et(e,t){return e.from-t.from||e.to-t.to}function Rt(e){for(var t=e,n=0;n<t.length-1;n++){var r=t[n];if(r.from!=r.to)for(var o=n+1;o<t.length;o++){var i=t[o];if(i.from!=r.from){i.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,i.from),_t(t,o,r.copy(i.from,r.to)));break}i.to!=r.to&&(t==e&&(t=e.slice()),t[o]=i.copy(i.from,r.to),_t(t,o+1,i.copy(r.to,i.to)))}}return t}function _t(e,t,n){for(;t<e.length&&Et(n,e[t])>0;)t++;e.splice(t,0,n)}function Pt(e){var t=[];return e.someProp("decorations",function(n){var r=n(e.state);r&&r!=Ot&&t.push(r)}),e.cursorWrapper&&t.push(Ct.create(e.state.doc,[e.cursorWrapper.deco])),Mt.from(t)}Mt.prototype.forChild=function(e,t){if(t.isLeaf)return Ct.empty;for(var n=[],r=0;r<this.members.length;r++){var o=this.members[r].forChild(e,t);o!=Ot&&(o instanceof Mt?n=n.concat(o.members):n.push(o))}return Mt.from(n)},Mt.prototype.eq=function(e){if(!(e instanceof Mt)||e.members.length!=this.members.length)return!1;for(var t=0;t<this.members.length;t++)if(!this.members[t].eq(e.members[t]))return!1;return!0},Mt.prototype.locals=function(e){for(var t,n=!0,r=0;r<this.members.length;r++){var o=this.members[r].localsInner(e);if(o.length)if(t){n&&(t=t.slice(),n=!1);for(var i=0;i<o.length;i++)t.push(o[i])}else t=o}return t?Rt(n?t:t.sort(Et)):xt},Mt.from=function(e){switch(e.length){case 0:return Ot;case 1:return e[0];default:return new Mt(e)}};var $t=function(e,t){this._props=t,this.state=t.state,this.dispatch=this.dispatch.bind(this),this._root=null,this.focused=!1,this.trackWrites=null,this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):e.apply?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=Ft(this),this.markCursor=null,this.cursorWrapper=null,Bt(this),this.nodeViews=Vt(this),this.docView=U(this.state.doc,zt(this),Pt(this),this.dom,this),this.lastSelectedViewDesc=null,this.dragging=null,function(e){e.shiftKey=!1,e.mouseDown=null,e.lastKeyCode=null,e.lastKeyCodeTime=0,e.lastClick={time:0,x:0,y:0,type:""},e.lastSelectionOrigin=null,e.lastSelectionTime=0,e.lastIOSEnter=0,e.lastIOSEnterFallbackTimeout=null,e.composing=!1,e.composingTimeout=null,e.compositionNodes=[],e.compositionEndedAt=-2e8,e.domObserver=new Je(e,function(t,n,r,o){return _e(e,t,n,r,o)}),e.domObserver.start(),e.domChangeCount=0,e.eventHandlers=Object.create(null);var t=function(t){var n=Ue[t];e.dom.addEventListener(t,e.eventHandlers[t]=function(t){!function(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(var n=t.target;n!=e.dom;n=n.parentNode)if(!n||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}(e,t)||Ye(e,t)||!e.editable&&t.type in Ge||n(e,t)})};for(var n in Ue)t(n);s.safari&&e.dom.addEventListener("input",function(){return null}),Ze(e)}(this),this.pluginViews=[],this.updatePluginViews()},It={props:{configurable:!0},root:{configurable:!0}};function zt(e){var t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),e.someProp("attributes",function(n){if("function"==typeof n&&(n=n(e.state)),n)for(var r in n)"class"==r?t.class+=" "+n[r]:t[r]||"contenteditable"==r||"nodeName"==r||(t[r]=String(n[r]))}),[wt.node(0,e.state.doc.content.size,t)]}function Bt(e){if(e.markCursor){var t=document.createElement("img");t.setAttribute("mark-placeholder","true"),e.cursorWrapper={dom:t,deco:wt.widget(e.state.selection.head,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function Ft(e){return!e.someProp("editable",function(t){return!1===t(e.state)})}function Vt(e){var t={};return e.someProp("nodeViews",function(e){for(var n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n])}),t}It.props.get=function(){if(this._props.state!=this.state){var e=this._props;for(var t in this._props={},e)this._props[t]=e[t];this._props.state=this.state}return this._props},$t.prototype.update=function(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Ze(this),this._props=e,this.updateStateInner(e.state,!0)},$t.prototype.setProps=function(e){var t={};for(var n in this._props)t[n]=this._props[n];for(var r in t.state=this.state,e)t[r]=e[r];this.update(t)},$t.prototype.updateState=function(e){this.updateStateInner(e,this.state.plugins!=e.plugins)},$t.prototype.updateStateInner=function(e,t){var n=this,o=this.state,i=!1,a=!1;if(e.storedMarks&&this.composing&&(ut(this),a=!0),this.state=e,t){var c=Vt(this);(function(e,t){var n=0,r=0;for(var o in e){if(e[o]!=t[o])return!0;n++}for(var i in t)r++;return n!=r})(c,this.nodeViews)&&(this.nodeViews=c,i=!0),Ze(this)}this.editable=Ft(this),Bt(this);var l=Pt(this),u=zt(this),p=t?"reset":e.scrollToSelection>o.scrollToSelection?"to selection":"preserve",h=i||!this.docView.matchesNode(e.doc,u,l);!h&&e.selection.eq(o.selection)||(a=!0);var d="preserve"==p&&a&&null==this.dom.style.overflowAnchor&&function(e){for(var t,n,r=e.dom.getBoundingClientRect(),o=Math.max(0,r.top),i=(r.left+r.right)/2,s=o+1;s<Math.min(innerHeight,r.bottom);s+=5){var a=e.root.elementFromPoint(i,s);if(a!=e.dom&&e.dom.contains(a)){var c=a.getBoundingClientRect();if(c.top>=o-20){t=a,n=c.top;break}}}return{refDOM:t,refTop:n,stack:M(e.dom)}}(this);if(a){this.domObserver.stop();var f=h&&(s.ie||s.chrome)&&!this.composing&&!o.selection.empty&&!e.selection.empty&&function(e,t){var n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}(o.selection,e.selection);if(h){var v=s.chrome?this.trackWrites=this.root.getSelection().focusNode:null;!i&&this.docView.update(e.doc,u,l,this)||(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=U(e.doc,u,l,this.dom,this)),v&&!this.trackWrites&&(f=!0)}f||!(this.mouseDown&&this.domObserver.currentSelection.eq(this.root.getSelection())&&function(e){var t=e.docView.domFromPos(e.state.selection.anchor),n=e.root.getSelection();return m(t.node,t.offset,n.anchorNode,n.anchorOffset)}(this))?ue(this,f):(me(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}if(this.updatePluginViews(o),"reset"==p)this.dom.scrollTop=0;else if("to selection"==p){var g=this.root.getSelection().focusNode;this.someProp("handleScrollToSelection",function(e){return e(n)})||(e.selection instanceof r.NodeSelection?O(this,this.docView.domAfterPos(e.selection.from).getBoundingClientRect(),g):O(this,this.coordsAtPos(e.selection.head),g))}else d&&function(e){var t=e.refDOM,n=e.refTop,r=e.stack,o=t?t.getBoundingClientRect().top:0;N(r,0==o?0:o-n)}(d)},$t.prototype.destroyPluginViews=function(){for(var e;e=this.pluginViews.pop();)e.destroy&&e.destroy()},$t.prototype.updatePluginViews=function(e){if(e&&e.plugins==this.state.plugins)for(var t=0;t<this.pluginViews.length;t++){var n=this.pluginViews[t];n.update&&n.update(this,e)}else{this.destroyPluginViews();for(var r=0;r<this.state.plugins.length;r++){var o=this.state.plugins[r];o.spec.view&&this.pluginViews.push(o.spec.view(this))}}},$t.prototype.someProp=function(e,t){var n,r=this._props&&this._props[e];if(null!=r&&(n=t?t(r):r))return n;var o=this.state.plugins;if(o)for(var i=0;i<o.length;i++){var s=o[i].props[e];if(null!=s&&(n=t?t(s):s))return n}},$t.prototype.hasFocus=function(){return this.root.activeElement==this.dom},$t.prototype.focus=function(){this.domObserver.stop(),this.editable&&function(e){if(e.setActive)return e.setActive();if(T)return e.focus(T);var t=M(e);e.focus(null==T?{get preventScroll(){return T={preventScroll:!0},!0}}:void 0),T||(T=!1,N(t,0))}(this.dom),ue(this),this.domObserver.start()},It.root.get=function(){var e=this._root;if(null==e)for(var t=this.dom.parentNode;t;t=t.parentNode)if(9==t.nodeType||11==t.nodeType&&t.host)return t.getSelection||(Object.getPrototypeOf(t).getSelection=function(){return document.getSelection()}),this._root=t;return e||document},$t.prototype.posAtCoords=function(e){return E(this,e)},$t.prototype.coordsAtPos=function(e){return _(this,e)},$t.prototype.domAtPos=function(e){return this.docView.domFromPos(e)},$t.prototype.nodeDOM=function(e){var t=this.docView.descAt(e);return t?t.nodeDOM:null},$t.prototype.posAtDOM=function(e,t,n){void 0===n&&(n=-1);var r=this.docView.posFromDOM(e,t,n);if(null==r)throw new RangeError("DOM position not inside the editor");return r},$t.prototype.endOfTextblock=function(e,t){return V(this,t||this.state,e)},$t.prototype.destroy=function(){this.docView&&(!function(e){for(var t in e.domObserver.stop(),e.eventHandlers)e.dom.removeEventListener(t,e.eventHandlers[t]);clearTimeout(e.composingTimeout),clearTimeout(e.lastIOSEnterFallbackTimeout)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Pt(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)},$t.prototype.dispatchEvent=function(e){return function(e,t){Ye(e,t)||!Ue[t.type]||!e.editable&&t.type in Ge||Ue[t.type](e,t)}(this,e)},$t.prototype.dispatch=function(e){var t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))},Object.defineProperties($t.prototype,It)},Vb5C:function(e,t,n){"use strict";n.r(t),n.d(t,"CellSelection",function(){return P}),n.d(t,"TableMap",function(){return f}),n.d(t,"TableView",function(){return Me}),n.d(t,"__clipCells",function(){return F}),n.d(t,"__insertCells",function(){return L}),n.d(t,"__pastedCells",function(){return z}),n.d(t,"addColSpan",function(){return R}),n.d(t,"addColumn",function(){return re}),n.d(t,"addColumnAfter",function(){return ie}),n.d(t,"addColumnBefore",function(){return oe}),n.d(t,"addRow",function(){return le}),n.d(t,"addRowAfter",function(){return pe}),n.d(t,"addRowBefore",function(){return ue}),n.d(t,"cellAround",function(){return S}),n.d(t,"colCount",function(){return T}),n.d(t,"columnIsHeader",function(){return _}),n.d(t,"columnResizing",function(){return De}),n.d(t,"columnResizingPluginKey",function(){return Te}),n.d(t,"deleteColumn",function(){return ae}),n.d(t,"deleteRow",function(){return de}),n.d(t,"deleteTable",function(){return Oe}),n.d(t,"findCell",function(){return N}),n.d(t,"fixTables",function(){return te}),n.d(t,"fixTablesKey",function(){return ee}),n.d(t,"goToNextCell",function(){return Ce}),n.d(t,"handlePaste",function(){return G}),n.d(t,"inSameTable",function(){return M}),n.d(t,"isInTable",function(){return x}),n.d(t,"mergeCells",function(){return me}),n.d(t,"moveCellForward",function(){return O}),n.d(t,"nextCell",function(){return D}),n.d(t,"pointsAtCell",function(){return C}),n.d(t,"removeColSpan",function(){return E}),n.d(t,"removeColumn",function(){return se}),n.d(t,"removeRow",function(){return he}),n.d(t,"rowIsHeader",function(){return ce}),n.d(t,"selectedRect",function(){return ne}),n.d(t,"selectionCell",function(){return k}),n.d(t,"setAttr",function(){return A}),n.d(t,"setCellAttr",function(){return ye}),n.d(t,"splitCell",function(){return ve}),n.d(t,"splitCellWithType",function(){return ge}),n.d(t,"tableEditing",function(){return $e}),n.d(t,"tableEditingKey",function(){return w}),n.d(t,"tableNodeTypes",function(){return b}),n.d(t,"tableNodes",function(){return y}),n.d(t,"toggleHeader",function(){return we}),n.d(t,"toggleHeaderCell",function(){return ke}),n.d(t,"toggleHeaderColumn",function(){return xe}),n.d(t,"toggleHeaderRow",function(){return Se}),n.d(t,"updateColumnsOnResize",function(){return Ne});var r,o,i=n("UxO+"),s=n("MEpN"),a=n("fwbU"),c=n("V2qZ"),l=n("CsC6");if("undefined"!=typeof WeakMap){var u=new WeakMap;r=function(e){return u.get(e)},o=function(e,t){return u.set(e,t),t}}else{var p=[],h=0;r=function(e){for(var t=0;t<p.length;t+=2)if(p[t]==e)return p[t+1]},o=function(e,t){return 10==h&&(h=0),p[h++]=e,p[h++]=t}}var d=function(e,t,n,r){this.left=e,this.top=t,this.right=n,this.bottom=r},f=function(e,t,n,r){this.width=e,this.height=t,this.map=n,this.problems=r};function m(e){if(e.colwidth)return e.colwidth.slice();for(var t=[],n=0;n<e.colspan;n++)t.push(0);return t}function v(e,t){var n=e.getAttribute("data-colwidth"),r=n&&/^\d+(,\d+)*$/.test(n)?n.split(",").map(function(e){return Number(e)}):null,o=Number(e.getAttribute("colspan")||1),i={colspan:o,rowspan:Number(e.getAttribute("rowspan")||1),colwidth:r&&r.length==o?r:null};for(var s in t){var a=t[s].getFromDOM,c=a&&a(e);null!=c&&(i[s]=c)}return i}function g(e,t){var n={};for(var r in 1!=e.attrs.colspan&&(n.colspan=e.attrs.colspan),1!=e.attrs.rowspan&&(n.rowspan=e.attrs.rowspan),e.attrs.colwidth&&(n["data-colwidth"]=e.attrs.colwidth.join(",")),t){var o=t[r].setDOMAttr;o&&o(e.attrs[r],n)}return n}function y(e){var t=e.cellAttributes||{},n={colspan:{default:1},rowspan:{default:1},colwidth:{default:null}};for(var r in t)n[r]={default:t[r].default};return{table:{content:"table_row+",tableRole:"table",isolating:!0,group:e.tableGroup,parseDOM:[{tag:"table"}],toDOM:function(){return["table",["tbody",0]]}},table_row:{content:"(table_cell | table_header)*",tableRole:"row",parseDOM:[{tag:"tr"}],toDOM:function(){return["tr",0]}},table_cell:{content:e.cellContent,attrs:n,tableRole:"cell",isolating:!0,parseDOM:[{tag:"td",getAttrs:function(e){return v(e,t)}}],toDOM:function(e){return["td",g(e,t),0]}},table_header:{content:e.cellContent,attrs:n,tableRole:"header_cell",isolating:!0,parseDOM:[{tag:"th",getAttrs:function(e){return v(e,t)}}],toDOM:function(e){return["th",g(e,t),0]}}}}function b(e){var t=e.cached.tableNodeTypes;if(!t)for(var n in t=e.cached.tableNodeTypes={},e.nodes){var r=e.nodes[n],o=r.spec.tableRole;o&&(t[o]=r)}return t}f.prototype.findCell=function(e){for(var t=0;t<this.map.length;t++){var n=this.map[t];if(n==e){for(var r=t%this.width,o=t/this.width|0,i=r+1,s=o+1,a=1;i<this.width&&this.map[t+a]==n;a++)i++;for(var c=1;s<this.height&&this.map[t+this.width*c]==n;c++)s++;return new d(r,o,i,s)}}throw new RangeError("No cell with offset "+e+" found")},f.prototype.colCount=function(e){for(var t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw new RangeError("No cell with offset "+e+" found")},f.prototype.nextCell=function(e,t,n){var r=this.findCell(e),o=r.left,i=r.right,s=r.top,a=r.bottom;return"horiz"==t?(n<0?0==o:i==this.width)?null:this.map[s*this.width+(n<0?o-1:i)]:(n<0?0==s:a==this.height)?null:this.map[o+this.width*(n<0?s-1:a)]},f.prototype.rectBetween=function(e,t){var n=this.findCell(e),r=n.left,o=n.right,i=n.top,s=n.bottom,a=this.findCell(t),c=a.left,l=a.right,u=a.top,p=a.bottom;return new d(Math.min(r,c),Math.min(i,u),Math.max(o,l),Math.max(s,p))},f.prototype.cellsInRect=function(e){for(var t=[],n={},r=e.top;r<e.bottom;r++)for(var o=e.left;o<e.right;o++){var i=r*this.width+o,s=this.map[i];n[s]||(n[s]=!0,o==e.left&&o&&this.map[i-1]==s||r==e.top&&r&&this.map[i-this.width]==s||t.push(s))}return t},f.prototype.positionAt=function(e,t,n){for(var r=0,o=0;;r++){var i=o+n.child(r).nodeSize;if(r==e){for(var s=t+e*this.width,a=(e+1)*this.width;s<a&&this.map[s]<o;)s++;return s==a?i-1:this.map[s]}o=i}},f.get=function(e){return r(e)||o(e,function(e){if("table"!=e.type.spec.tableRole)throw new RangeError("Not a table node: "+e.type.name);for(var t=function(e){for(var t=-1,n=!1,r=0;r<e.childCount;r++){var o=e.child(r),i=0;if(n)for(var s=0;s<r;s++)for(var a=e.child(s),c=0;c<a.childCount;c++){var l=a.child(c);s+l.attrs.rowspan>r&&(i+=l.attrs.colspan)}for(var u=0;u<o.childCount;u++){var p=o.child(u);i+=p.attrs.colspan,p.attrs.rowspan>1&&(n=!0)}-1==t?t=i:t!=i&&(t=Math.max(t,i))}return t}(e),n=e.childCount,r=[],o=0,i=null,s=[],a=0,c=t*n;a<c;a++)r[a]=0;for(var l=0,u=0;l<n;l++){var p=e.child(l);u++;for(var h=0;;h++){for(;o<r.length&&0!=r[o];)o++;if(h==p.childCount)break;for(var d=p.child(h),v=d.attrs,g=v.colspan,y=v.rowspan,b=v.colwidth,w=0;w<y;w++){if(w+l>=n){(i||(i=[])).push({type:"overlong_rowspan",pos:u,n:y-w});break}for(var S=o+w*t,x=0;x<g;x++){0==r[S+x]?r[S+x]=u:(i||(i=[])).push({type:"collision",row:l,pos:u,n:g-x});var k=b&&b[x];if(k){var C=(S+x)%t*2,O=s[C];null==O||O!=k&&1==s[C+1]?(s[C]=k,s[C+1]=1):O==k&&s[C+1]++}}}o+=g,u+=d.nodeSize}for(var M=(l+1)*t,N=0;o<M;)0==r[o++]&&N++;N&&(i||(i=[])).push({type:"missing",row:l,n:N}),u++}for(var T=new f(t,n,r,i),D=!1,A=0;!D&&A<s.length;A+=2)null!=s[A]&&s[A+1]<n&&(D=!0);D&&function(e,t,n){e.problems||(e.problems=[]);for(var r=0,o={};r<e.map.length;r++){var i=e.map[r];if(!o[i]){o[i]=!0;for(var s=n.nodeAt(i),a=null,c=0;c<s.attrs.colspan;c++){var l=(r+c)%e.width,u=t[2*l];null==u||s.attrs.colwidth&&s.attrs.colwidth[c]==u||((a||(a=m(s.attrs)))[c]=u)}a&&e.problems.unshift({type:"colwidth mismatch",pos:i,colwidth:a})}}}(T,s,e);return T}(e))};var w=new i.PluginKey("selectingCells");function S(e){for(var t=e.depth-1;t>0;t--)if("row"==e.node(t).type.spec.tableRole)return e.node(0).resolve(e.before(t+1));return null}function x(e){for(var t=e.selection.$head,n=t.depth;n>0;n--)if("row"==t.node(n).type.spec.tableRole)return!0;return!1}function k(e){var t=e.selection;return t.$anchorCell?t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell:t.node&&"cell"==t.node.type.spec.tableRole?t.$anchor:S(t.$head)||function(e){for(var t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){var r=t.type.spec.tableRole;if("cell"==r||"header_cell"==r)return e.doc.resolve(n)}for(var o=e.nodeBefore,i=e.pos;o;o=o.lastChild,i--){var s=o.type.spec.tableRole;if("cell"==s||"header_cell"==s)return e.doc.resolve(i-o.nodeSize)}}(t.$head)}function C(e){return"row"==e.parent.type.spec.tableRole&&e.nodeAfter}function O(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function M(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function N(e){return f.get(e.node(-1)).findCell(e.pos-e.start(-1))}function T(e){return f.get(e.node(-1)).colCount(e.pos-e.start(-1))}function D(e,t,n){var r=e.start(-1),o=f.get(e.node(-1)).nextCell(e.pos-r,t,n);return null==o?null:e.node(0).resolve(r+o)}function A(e,t,n){var r={};for(var o in e)r[o]=e[o];return r[t]=n,r}function E(e,t,n){void 0===n&&(n=1);var r=A(e,"colspan",e.colspan-n);return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(t,n),r.colwidth.some(function(e){return e>0})||(r.colwidth=null)),r}function R(e,t,n){void 0===n&&(n=1);var r=A(e,"colspan",e.colspan+n);if(r.colwidth){r.colwidth=r.colwidth.slice();for(var o=0;o<n;o++)r.colwidth.splice(t,0,0)}return r}function _(e,t,n){for(var r=b(t.type.schema).header_cell,o=0;o<e.height;o++)if(t.nodeAt(e.map[n+o*e.width]).type!=r)return!1;return!0}var P=function(e){function t(t,n){void 0===n&&(n=t);var r=t.node(-1),o=f.get(r),s=t.start(-1),a=o.rectBetween(t.pos-s,n.pos-s),c=t.node(0),l=o.cellsInRect(a).filter(function(e){return e!=n.pos-s});l.unshift(n.pos-s);var u=l.map(function(e){var t=r.nodeAt(e),n=e+s+1;return new i.SelectionRange(c.resolve(n),c.resolve(n+t.content.size))});e.call(this,u[0].$from,u[0].$to,u),this.$anchorCell=t,this.$headCell=n}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.map=function(e,n){var r=e.resolve(n.map(this.$anchorCell.pos)),o=e.resolve(n.map(this.$headCell.pos));if(C(r)&&C(o)&&M(r,o)){var s=this.$anchorCell.node(-1)!=r.node(-1);return s&&this.isRowSelection()?t.rowSelection(r,o):s&&this.isColSelection()?t.colSelection(r,o):new t(r,o)}return i.TextSelection.between(r,o)},t.prototype.content=function(){for(var e=this.$anchorCell.node(-1),t=f.get(e),n=this.$anchorCell.start(-1),r=t.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),o={},i=[],a=r.top;a<r.bottom;a++){for(var c=[],l=a*t.width+r.left,u=r.left;u<r.right;u++,l++){var p=t.map[l];if(!o[p]){o[p]=!0;var h=t.findCell(p),d=e.nodeAt(p),m=r.left-h.left,v=h.right-r.right;if(m>0||v>0){var g=d.attrs;m>0&&(g=E(g,0,m)),v>0&&(g=E(g,g.colspan-v,v)),d=h.left<r.left?d.type.createAndFill(g):d.type.create(g,d.content)}if(h.top<r.top||h.bottom>r.bottom){var y=A(d.attrs,"rowspan",Math.min(h.bottom,r.bottom)-Math.max(h.top,r.top));d=h.top<r.top?d.type.createAndFill(y):d.type.create(y,d.content)}c.push(d)}}i.push(e.child(a).copy(s.Fragment.from(c)))}var b=this.isColSelection()&&this.isRowSelection()?e:i;return new s.Slice(s.Fragment.from(b),1,1)},t.prototype.replace=function(t,n){void 0===n&&(n=s.Slice.empty);for(var r=t.steps.length,o=this.ranges,i=0;i<o.length;i++){var a=o[i],c=a.$from,l=a.$to,u=t.mapping.slice(r);t.replace(u.map(c.pos),u.map(l.pos),i?s.Slice.empty:n)}var p=e.findFrom(t.doc.resolve(t.mapping.slice(r).map(this.to)),-1);p&&t.setSelection(p)},t.prototype.replaceWith=function(e,t){this.replace(e,new s.Slice(s.Fragment.from(t),0,0))},t.prototype.forEachCell=function(e){for(var t=this.$anchorCell.node(-1),n=f.get(t),r=this.$anchorCell.start(-1),o=n.cellsInRect(n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r)),i=0;i<o.length;i++)e(t.nodeAt(o[i]),r+o[i])},t.prototype.isColSelection=function(){var e=this.$anchorCell.index(-1),t=this.$headCell.index(-1);if(Math.min(e,t)>0)return!1;var n=e+this.$anchorCell.nodeAfter.attrs.rowspan,r=t+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,r)==this.$headCell.node(-1).childCount},t.colSelection=function(e,n){void 0===n&&(n=e);var r=f.get(e.node(-1)),o=e.start(-1),i=r.findCell(e.pos-o),s=r.findCell(n.pos-o),a=e.node(0);return i.top<=s.top?(i.top>0&&(e=a.resolve(o+r.map[i.left])),s.bottom<r.height&&(n=a.resolve(o+r.map[r.width*(r.height-1)+s.right-1]))):(s.top>0&&(n=a.resolve(o+r.map[s.left])),i.bottom<r.height&&(e=a.resolve(o+r.map[r.width*(r.height-1)+i.right-1]))),new t(e,n)},t.prototype.isRowSelection=function(){var e=f.get(this.$anchorCell.node(-1)),t=this.$anchorCell.start(-1),n=e.colCount(this.$anchorCell.pos-t),r=e.colCount(this.$headCell.pos-t);if(Math.min(n,r)>0)return!1;var o=n+this.$anchorCell.nodeAfter.attrs.colspan,i=r+this.$headCell.nodeAfter.attrs.colspan;return Math.max(o,i)==e.width},t.prototype.eq=function(e){return e instanceof t&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos},t.rowSelection=function(e,n){void 0===n&&(n=e);var r=f.get(e.node(-1)),o=e.start(-1),i=r.findCell(e.pos-o),s=r.findCell(n.pos-o),a=e.node(0);return i.left<=s.left?(i.left>0&&(e=a.resolve(o+r.map[i.top*r.width])),s.right<r.width&&(n=a.resolve(o+r.map[r.width*(s.top+1)-1]))):(s.left>0&&(n=a.resolve(o+r.map[s.top*r.width])),i.right<r.width&&(e=a.resolve(o+r.map[r.width*(i.top+1)-1]))),new t(e,n)},t.prototype.toJSON=function(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}},t.fromJSON=function(e,n){return new t(e.resolve(n.anchor),e.resolve(n.head))},t.create=function(e,n,r){return void 0===r&&(r=n),new t(e.resolve(n),e.resolve(r))},t.prototype.getBookmark=function(){return new $(this.$anchorCell.pos,this.$headCell.pos)},t}(i.Selection);P.prototype.visible=!1,i.Selection.jsonID("cell",P);var $=function(e,t){this.anchor=e,this.head=t};function I(e){if(!(e.selection instanceof P))return null;var t=[];return e.selection.forEachCell(function(e,n){t.push(c.a.node(n,n+e.nodeSize,{class:"selectedCell"}))}),c.b.create(e.doc,t)}function z(e){if(!e.size)return null;for(var t=e.content,n=e.openStart,r=e.openEnd;1==t.childCount&&(n>0&&r>0||"table"==t.firstChild.type.spec.tableRole);)n--,r--,t=t.firstChild.content;var o=t.firstChild,i=o.type.spec.tableRole,a=o.type.schema,c=[];if("row"==i)for(var l=0;l<t.childCount;l++){var u=t.child(l).content,p=l?0:Math.max(0,n-1),h=l<t.childCount-1?0:Math.max(0,r-1);(p||h)&&(u=B(b(a).row,new s.Slice(u,p,h)).content),c.push(u)}else{if("cell"!=i&&"header_cell"!=i)return null;c.push(n||r?B(b(a).row,new s.Slice(t,n,r)).content:t)}return function(e,t){for(var n=[],r=0;r<t.length;r++)for(var o=t[r],i=o.childCount-1;i>=0;i--)for(var a=o.child(i).attrs,c=a.rowspan,l=a.colspan,u=r;u<r+c;u++)n[u]=(n[u]||0)+l;for(var p=0,h=0;h<n.length;h++)p=Math.max(p,n[h]);for(var d=0;d<n.length;d++)if(d>=t.length&&t.push(s.Fragment.empty),n[d]<p){for(var f=b(e).cell.createAndFill(),m=[],v=n[d];v<p;v++)m.push(f);t[d]=t[d].append(s.Fragment.from(m))}return{height:t.length,width:p,rows:t}}(a,c)}function B(e,t){var n=e.createAndFill();return new l.e(n).replace(0,n.content.size,t).doc}function F(e,t,n){var r=e.width,o=e.height,i=e.rows;if(r!=t){for(var a=[],c=[],l=0;l<i.length;l++){for(var u=i[l],p=[],h=a[l]||0,d=0;h<t;d++){var f=u.child(d%u.childCount);h+f.attrs.colspan>t&&(f=f.type.create(E(f.attrs,f.attrs.colspan,h+f.attrs.colspan-t),f.content)),p.push(f),h+=f.attrs.colspan;for(var m=1;m<f.attrs.rowspan;m++)a[l+m]=(a[l+m]||0)+f.attrs.colspan}c.push(s.Fragment.from(p))}i=c,r=t}if(o!=n){for(var v=[],g=0,y=0;g<n;g++,y++){for(var b=[],w=i[y%o],S=0;S<w.childCount;S++){var x=w.child(S);g+x.attrs.rowspan>n&&(x=x.type.create(A(x.attrs,"rowspan",Math.max(1,n-x.attrs.rowspan)),x.content)),b.push(x)}v.push(s.Fragment.from(b))}i=v,o=n}return{width:r,height:o,rows:i}}function V(e,t,n,r,o,i,s,a){if(0==s||s==t.height)return!1;for(var c=!1,l=o;l<i;l++){var u=s*t.width+l,p=t.map[u];if(t.map[u-t.width]==p){c=!0;var h=n.nodeAt(p),d=t.findCell(p),f=d.top,m=d.left;e.setNodeMarkup(e.mapping.slice(a).map(p+r),null,A(h.attrs,"rowspan",s-f)),e.insert(e.mapping.slice(a).map(t.positionAt(s,m,n)),h.type.createAndFill(A(h.attrs,"rowspan",f+h.attrs.rowspan-s))),l+=h.attrs.colspan-1}}return c}function j(e,t,n,r,o,i,s,a){if(0==s||s==t.width)return!1;for(var c=!1,l=o;l<i;l++){var u=l*t.width+s,p=t.map[u];if(t.map[u-1]==p){c=!0;var h=n.nodeAt(p),d=t.colCount(p),f=e.mapping.slice(a).map(p+r);e.setNodeMarkup(f,null,E(h.attrs,s-d,h.attrs.colspan-(s-d))),e.insert(f+h.nodeSize,h.type.createAndFill(E(h.attrs,0,s-d))),l+=h.attrs.rowspan-1}}return c}function L(e,t,n,r,o){var i=n?e.doc.nodeAt(n-1):e.doc,a=f.get(i),c=r.top,l=r.left,u=l+o.width,p=c+o.height,h=e.tr,d=0;function m(){i=n?h.doc.nodeAt(n-1):h.doc,a=f.get(i),d=h.mapping.maps.length}(function(e,t,n,r,o,i,a){var c,l,u=b(e.doc.type.schema);if(o>t.width)for(var p=0,h=0;p<t.height;p++){var d=n.child(p);h+=d.nodeSize;var f=[],m=void 0;m=null==d.lastChild||d.lastChild.type==u.cell?c||(c=u.cell.createAndFill()):l||(l=u.header_cell.createAndFill());for(var v=t.width;v<o;v++)f.push(m);e.insert(e.mapping.slice(a).map(h-1+r),f)}if(i>t.height){for(var g=[],y=0,w=(t.height-1)*t.width;y<Math.max(t.width,o);y++){var S=!(y>=t.width)&&n.nodeAt(t.map[w+y]).type==u.header_cell;g.push(S?l||(l=u.header_cell.createAndFill()):c||(c=u.cell.createAndFill()))}for(var x=u.row.create(null,s.Fragment.from(g)),k=[],C=t.height;C<i;C++)k.push(x);e.insert(e.mapping.slice(a).map(r+n.nodeSize-2),k)}return!(!c&&!l)})(h,a,i,n,u,p,d)&&m(),V(h,a,i,n,l,u,c,d)&&m(),V(h,a,i,n,l,u,p,d)&&m(),j(h,a,i,n,c,p,l,d)&&m(),j(h,a,i,n,c,p,u,d)&&m();for(var v=c;v<p;v++){var g=a.positionAt(v,l,i),y=a.positionAt(v,u,i);h.replace(h.mapping.slice(d).map(g+n),h.mapping.slice(d).map(y+n),new s.Slice(o.rows[v-c],0,0))}m(),h.setSelection(new P(h.doc.resolve(n+a.positionAt(c,l,i)),h.doc.resolve(n+a.positionAt(p-1,u-1,i)))),t(h)}$.prototype.map=function(e){return new $(e.map(this.anchor),e.map(this.head))},$.prototype.resolve=function(e){var t=e.resolve(this.anchor),n=e.resolve(this.head);return"row"==t.parent.type.spec.tableRole&&"row"==n.parent.type.spec.tableRole&&t.index()<t.parent.childCount&&n.index()<n.parent.childCount&&M(t,n)?new P(t,n):i.Selection.near(n,1)};var q=Object(a.a)({ArrowLeft:K("horiz",-1),ArrowRight:K("horiz",1),ArrowUp:K("vert",-1),ArrowDown:K("vert",1),"Shift-ArrowLeft":J("horiz",-1),"Shift-ArrowRight":J("horiz",1),"Shift-ArrowUp":J("vert",-1),"Shift-ArrowDown":J("vert",1),Backspace:H,"Mod-Backspace":H,Delete:H,"Mod-Delete":H});function W(e,t,n){return!n.eq(e.selection)&&(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function K(e,t){return function(n,r,o){var s=n.selection;if(s instanceof P)return W(n,r,i.Selection.near(s.$headCell,t));if("horiz"!=e&&!s.empty)return!1;var a=Z(o,e,t);if(null==a)return!1;if("horiz"==e)return W(n,r,i.Selection.near(n.doc.resolve(s.head+t),t));var c=n.doc.resolve(a),l=D(c,e,t);return W(n,r,l?i.Selection.near(l,1):t<0?i.Selection.near(n.doc.resolve(c.before(-1)),-1):i.Selection.near(n.doc.resolve(c.after(-1)),1))}}function J(e,t){return function(n,r,o){var i=n.selection;if(!(i instanceof P)){var s=Z(o,e,t);if(null==s)return!1;i=new P(n.doc.resolve(s))}var a=D(i.$headCell,e,t);return!!a&&W(n,r,new P(i.$anchorCell,a))}}function H(e,t){var n=e.selection;if(!(n instanceof P))return!1;if(t){var r=e.tr,o=b(e.schema).cell.createAndFill().content;n.forEachCell(function(e,t){e.content.eq(o)||r.replace(r.mapping.map(t+1),r.mapping.map(t+e.nodeSize-1),new s.Slice(o,0,0))}),r.docChanged&&t(r)}return!0}function U(e,t){var n=S(e.state.doc.resolve(t));return!!n&&(e.dispatch(e.state.tr.setSelection(new P(n))),!0)}function G(e,t,n){if(!x(e.state))return!1;var r=z(n),o=e.state.selection;if(o instanceof P){r||(r={width:1,height:1,rows:[s.Fragment.from(B(b(e.state.schema).cell,n))]});var i=o.$anchorCell.node(-1),a=o.$anchorCell.start(-1),c=f.get(i).rectBetween(o.$anchorCell.pos-a,o.$headCell.pos-a);return r=F(r,c.right-c.left,c.bottom-c.top),L(e.state,e.dispatch,a,c,r),!0}if(r){var l=k(e.state),u=l.start(-1);return L(e.state,e.dispatch,u,f.get(l.node(-1)).findCell(l.pos-u),r),!0}return!1}function X(e,t){if(!t.ctrlKey&&!t.metaKey){var n,r=Y(e,t.target);if(t.shiftKey&&e.state.selection instanceof P)o(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&r&&null!=(n=S(e.state.selection.$anchor))&&Q(e,t).pos!=n.pos)o(n,t),t.preventDefault();else if(!r)return;e.root.addEventListener("mouseup",i),e.root.addEventListener("dragstart",i),e.root.addEventListener("mousemove",s)}function o(t,n){var r=Q(e,n),o=null==w.getState(e.state);if(!r||!M(t,r)){if(!o)return;r=t}var i=new P(t,r);if(o||!e.state.selection.eq(i)){var s=e.state.tr.setSelection(i);o&&s.setMeta(w,t.pos),e.dispatch(s)}}function i(){e.root.removeEventListener("mouseup",i),e.root.removeEventListener("dragstart",i),e.root.removeEventListener("mousemove",s),null!=w.getState(e.state)&&e.dispatch(e.state.tr.setMeta(w,-1))}function s(n){var s,a=w.getState(e.state);if(null!=a)s=e.state.doc.resolve(a);else if(Y(e,n.target)!=r&&!(s=Q(e,t)))return i();s&&o(s,n)}}function Z(e,t,n){if(!(e.state.selection instanceof i.TextSelection))return null;for(var r=e.state.selection.$head,o=r.depth-1;o>=0;o--){var s=r.node(o);if((n<0?r.index(o):r.indexAfter(o))!=(n<0?0:s.childCount))return null;if("cell"==s.type.spec.tableRole||"header_cell"==s.type.spec.tableRole){var a=r.before(o),c="vert"==t?n>0?"down":"up":n>0?"right":"left";return e.endOfTextblock(c)?a:null}}return null}function Y(e,t){for(;t&&t!=e.dom;t=t.parentNode)if("TD"==t.nodeName||"TH"==t.nodeName)return t}function Q(e,t){var n=e.posAtCoords({left:t.clientX,top:t.clientY});return n&&n?S(e.state.doc.resolve(n.pos)):null}var ee=new i.PluginKey("fix-tables");function te(e,t){var n,r=function(t,r){"table"==t.type.spec.tableRole&&(n=function(e,t,n,r){var o=f.get(t);if(!o.problems)return r;r||(r=e.tr);for(var i,s,a=[],c=0;c<o.height;c++)a.push(0);for(var l=0;l<o.problems.length;l++){var u=o.problems[l];if("collision"==u.type){for(var p=t.nodeAt(u.pos),h=0;h<p.attrs.rowspan;h++)a[u.row+h]+=u.n;r.setNodeMarkup(r.mapping.map(n+1+u.pos),null,E(p.attrs,p.attrs.colspan-u.n,u.n))}else if("missing"==u.type)a[u.row]+=u.n;else if("overlong_rowspan"==u.type){var d=t.nodeAt(u.pos);r.setNodeMarkup(r.mapping.map(n+1+u.pos),null,A(d.attrs,"rowspan",d.attrs.rowspan-u.n))}else if("colwidth mismatch"==u.type){var m=t.nodeAt(u.pos);r.setNodeMarkup(r.mapping.map(n+1+u.pos),null,A(m.attrs,"colwidth",u.colwidth))}}for(var v=0;v<a.length;v++)a[v]&&(null==i&&(i=v),s=v);for(var g=0,y=n+1;g<o.height;g++){var w=t.child(g),S=y+w.nodeSize,x=a[g];if(x>0){var k="cell";w.firstChild&&(k=w.firstChild.type.spec.tableRole);for(var C=[],O=0;O<x;O++)C.push(b(e.schema)[k].createAndFill());var M=0!=g&&i!=g-1||s!=g?S-1:y+1;r.insert(r.mapping.map(M),C)}y=S}return r.setMeta(ee,{fixTables:!0})}(e,t,r,n))};return t?t.doc!=e.doc&&function e(t,n,r,o){var i=t.childCount,s=n.childCount;e:for(var a=0,c=0;a<s;a++){for(var l=n.child(a),u=c,p=Math.min(i,a+3);u<p;u++)if(t.child(u)==l){c=u+1,r+=l.nodeSize;continue e}o(l,r),c<i&&t.child(c).sameMarkup(l)?e(t.child(c),l,r+1,o):l.nodesBetween(0,l.content.size,o,r+1),r+=l.nodeSize}}(t.doc,e.doc,0,r):e.doc.descendants(r),n}function ne(e){var t,n=e.selection,r=k(e),o=r.node(-1),i=r.start(-1),s=f.get(o);return(t=n instanceof P?s.rectBetween(n.$anchorCell.pos-i,n.$headCell.pos-i):s.findCell(r.pos-i)).tableStart=i,t.map=s,t.table=o,t}function re(e,t,n){var r=t.map,o=t.tableStart,i=t.table,s=n>0?-1:0;_(r,i,n+s)&&(s=0==n||n==r.width?null:0);for(var a=0;a<r.height;a++){var c=a*r.width+n;if(n>0&&n<r.width&&r.map[c-1]==r.map[c]){var l=r.map[c],u=i.nodeAt(l);e.setNodeMarkup(e.mapping.map(o+l),null,R(u.attrs,n-r.colCount(l))),a+=u.attrs.rowspan-1}else{var p=null==s?b(i.type.schema).cell:i.nodeAt(r.map[c+s]).type,h=r.positionAt(a,n,i);e.insert(e.mapping.map(o+h),p.createAndFill())}}return e}function oe(e,t){if(!x(e))return!1;if(t){var n=ne(e);t(re(e.tr,n,n.left))}return!0}function ie(e,t){if(!x(e))return!1;if(t){var n=ne(e);t(re(e.tr,n,n.right))}return!0}function se(e,t,n){for(var r=t.map,o=t.table,i=t.tableStart,s=e.mapping.maps.length,a=0;a<r.height;){var c=a*r.width+n,l=r.map[c],u=o.nodeAt(l);if(n>0&&r.map[c-1]==l||n<r.width-1&&r.map[c+1]==l)e.setNodeMarkup(e.mapping.slice(s).map(i+l),null,E(u.attrs,n-r.colCount(l)));else{var p=e.mapping.slice(s).map(i+l);e.delete(p,p+u.nodeSize)}a+=u.attrs.rowspan}}function ae(e,t){if(!x(e))return!1;if(t){var n=ne(e),r=e.tr;if(0==n.left&&n.right==n.map.width)return!1;for(var o=n.right-1;se(r,n,o),o!=n.left;o--)n.table=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc,n.map=f.get(n.table);t(r)}return!0}function ce(e,t,n){for(var r=b(t.type.schema).header_cell,o=0;o<e.width;o++)if(t.nodeAt(e.map[o+n*e.width]).type!=r)return!1;return!0}function le(e,t,n){for(var r=t.map,o=t.tableStart,i=t.table,s=o,a=0;a<n;a++)s+=i.child(a).nodeSize;var c=[],l=n>0?-1:0;ce(r,i,n+l)&&(l=0==n||n==r.height?null:0);for(var u=0,p=r.width*n;u<r.width;u++,p++)if(n>0&&n<r.height&&r.map[p]==r.map[p-r.width]){var h=r.map[p],d=i.nodeAt(h).attrs;e.setNodeMarkup(o+h,null,A(d,"rowspan",d.rowspan+1)),u+=d.colspan-1}else{var f=null==l?b(i.type.schema).cell:i.nodeAt(r.map[p+l*r.width]).type;c.push(f.createAndFill())}return e.insert(s,b(i.type.schema).row.create(null,c)),e}function ue(e,t){if(!x(e))return!1;if(t){var n=ne(e);t(le(e.tr,n,n.top))}return!0}function pe(e,t){if(!x(e))return!1;if(t){var n=ne(e);t(le(e.tr,n,n.bottom))}return!0}function he(e,t,n){for(var r=t.map,o=t.table,i=t.tableStart,s=0,a=0;a<n;a++)s+=o.child(a).nodeSize;var c=s+o.child(n).nodeSize,l=e.mapping.maps.length;e.delete(s+i,c+i);for(var u=0,p=n*r.width;u<r.width;u++,p++){var h=r.map[p];if(n>0&&h==r.map[p-r.width]){var d=o.nodeAt(h).attrs;e.setNodeMarkup(e.mapping.slice(l).map(h+i),null,A(d,"rowspan",d.rowspan-1)),u+=d.colspan-1}else if(n<r.width&&h==r.map[p+r.width]){var f=o.nodeAt(h),m=f.type.create(A(f.attrs,"rowspan",f.attrs.rowspan-1),f.content),v=r.positionAt(n+1,u,o);e.insert(e.mapping.slice(l).map(i+v),m),u+=f.attrs.colspan-1}}}function de(e,t){if(!x(e))return!1;if(t){var n=ne(e),r=e.tr;if(0==n.top&&n.bottom==n.map.height)return!1;for(var o=n.bottom-1;he(r,n,o),o!=n.top;o--)n.table=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc,n.map=f.get(n.table);t(r)}return!0}function fe(e){var t=e.content;return 1==t.childCount&&t.firstChild.isTextblock&&0==t.firstChild.childCount}function me(e,t){var n=e.selection;if(!(n instanceof P)||n.$anchorCell.pos==n.$headCell.pos)return!1;var r=ne(e),o=r.map;if(function(e,t){for(var n=e.width,r=e.height,o=e.map,i=t.top*n+t.left,s=i,a=(t.bottom-1)*n+t.left,c=i+(t.right-t.left-1),l=t.top;l<t.bottom;l++){if(t.left>0&&o[s]==o[s-1]||t.right<n&&o[c]==o[c+1])return!0;s+=n,c+=n}for(var u=t.left;u<t.right;u++){if(t.top>0&&o[i]==o[i-n]||t.bottom<r&&o[a]==o[a+n])return!0;i++,a++}return!1}(o,r))return!1;if(t){for(var i,a,c=e.tr,l={},u=s.Fragment.empty,p=r.top;p<r.bottom;p++)for(var h=r.left;h<r.right;h++){var d=o.map[p*o.width+h],f=r.table.nodeAt(d);if(!l[d])if(l[d]=!0,null==i)i=d,a=f;else{fe(f)||(u=u.append(f.content));var m=c.mapping.map(d+r.tableStart);c.delete(m,m+f.nodeSize)}}if(c.setNodeMarkup(i+r.tableStart,null,A(R(a.attrs,a.attrs.colspan,r.right-r.left-a.attrs.colspan),"rowspan",r.bottom-r.top)),u.size){var v=i+1+a.content.size,g=fe(a)?i+1:v;c.replaceWith(g+r.tableStart,v+r.tableStart,u)}c.setSelection(new P(c.doc.resolve(i+r.tableStart))),t(c)}return!0}function ve(e,t){var n=b(e.schema);return ge(function(e){var t=e.node;return n[t.type.spec.tableRole]})(e,t)}function ge(e){return function(t,n){var r,o,i=t.selection;if(i instanceof P){if(i.$anchorCell.pos!=i.$headCell.pos)return!1;r=i.$anchorCell.nodeAfter,o=i.$anchorCell.pos}else{if(!(r=function(e){for(var t=e.depth;t>0;t--){var n=e.node(t).type.spec.tableRole;if("cell"===n||"header_cell"===n)return e.node(t)}return null}(i.$from)))return!1;o=S(i.$from).pos}if(1==r.attrs.colspan&&1==r.attrs.rowspan)return!1;if(n){var s=r.attrs,a=[],c=s.colwidth;s.rowspan>1&&(s=A(s,"rowspan",1)),s.colspan>1&&(s=A(s,"colspan",1));for(var l,u=ne(t),p=t.tr,h=0;h<u.right-u.left;h++)a.push(c?A(s,"colwidth",c&&c[h]?[c[h]]:null):s);for(var d=u.top;d<u.bottom;d++){var f=u.map.positionAt(d,u.left,u.table);d==u.top&&(f+=r.nodeSize);for(var m=u.left,v=0;m<u.right;m++,v++)m==u.left&&d==u.top||p.insert(l=p.mapping.map(f+u.tableStart,1),e({node:r,row:d,col:m}).createAndFill(a[v]))}p.setNodeMarkup(o,e({node:r,row:u.top,col:u.left}),a[0]),i instanceof P&&p.setSelection(new P(p.doc.resolve(i.$anchorCell.pos),l&&p.doc.resolve(l))),n(p)}return!0}}function ye(e,t){return function(n,r){if(!x(n))return!1;var o=k(n);if(o.nodeAfter.attrs[e]===t)return!1;if(r){var i=n.tr;n.selection instanceof P?n.selection.forEachCell(function(n,r){n.attrs[e]!==t&&i.setNodeMarkup(r,null,A(n.attrs,e,t))}):i.setNodeMarkup(o.pos,null,A(o.nodeAfter.attrs,e,t)),r(i)}return!0}}function be(e,t,n){for(var r=t.map.cellsInRect({left:0,top:0,right:"row"==e?t.map.width:1,bottom:"column"==e?t.map.height:1}),o=0;o<r.length;o++){var i=t.table.nodeAt(r[o]);if(i&&i.type!==n.header_cell)return!1}return!0}function we(e,t){return(t=t||{useDeprecatedLogic:!1}).useDeprecatedLogic?function(e){return function(t,n){if(!x(t))return!1;if(n){for(var r=b(t.schema),o=ne(t),i=t.tr,s=o.map.cellsInRect("column"==e?new d(o.left,0,o.right,o.map.height):"row"==e?new d(0,o.top,o.map.width,o.bottom):o),a=s.map(function(e){return o.table.nodeAt(e)}),c=0;c<s.length;c++)a[c].type==r.header_cell&&i.setNodeMarkup(o.tableStart+s[c],r.cell,a[c].attrs);if(0==i.steps.length)for(var l=0;l<s.length;l++)i.setNodeMarkup(o.tableStart+s[l],r.header_cell,a[l].attrs);n(i)}return!0}}(e):function(t,n){if(!x(t))return!1;if(n){var r=b(t.schema),o=ne(t),i=t.tr,s=be("row",o,r),a=be("column",o,r),c=("column"===e?s:"row"===e&&a)?1:0,l="column"==e?new d(0,c,1,o.map.height):"row"==e?new d(c,0,o.map.width,1):o,u="column"==e?a?r.cell:r.header_cell:"row"==e?s?r.cell:r.header_cell:r.cell;o.map.cellsInRect(l).forEach(function(e){var t=e+o.tableStart,n=i.doc.nodeAt(t);n&&i.setNodeMarkup(t,u,n.attrs)}),n(i)}return!0}}var Se=we("row",{useDeprecatedLogic:!0}),xe=we("column",{useDeprecatedLogic:!0}),ke=we("cell",{useDeprecatedLogic:!0});function Ce(e){return function(t,n){if(!x(t))return!1;var r=function(e,t){if(t<0){var n=e.nodeBefore;if(n)return e.pos-n.nodeSize;for(var r=e.index(-1)-1,o=e.before();r>=0;r--){var i=e.node(-1).child(r);if(i.childCount)return o-1-i.lastChild.nodeSize;o-=i.nodeSize}}else{if(e.index()<e.parent.childCount-1)return e.pos+e.nodeAfter.nodeSize;for(var s=e.node(-1),a=e.indexAfter(-1),c=e.after();a<s.childCount;a++){var l=s.child(a);if(l.childCount)return c+1;c+=l.nodeSize}}}(k(t),e);if(null!=r){if(n){var o=t.doc.resolve(r);n(t.tr.setSelection(i.TextSelection.between(o,O(o))).scrollIntoView())}return!0}}}function Oe(e,t){for(var n=e.selection.$anchor,r=n.depth;r>0;r--){if("table"==n.node(r).type.spec.tableRole)return t&&t(e.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0}return!1}var Me=function(e,t){this.node=e,this.cellMinWidth=t,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.colgroup=this.table.appendChild(document.createElement("colgroup")),Ne(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement("tbody"))};function Ne(e,t,n,r,o,i){for(var s=0,a=!0,c=t.firstChild,l=e.firstChild,u=0,p=0;u<l.childCount;u++)for(var h=l.child(u).attrs,d=h.colspan,f=h.colwidth,m=0;m<d;m++,p++){var v=o==p?i:f&&f[m],g=v?v+"px":"";s+=v||r,v||(a=!1),c?(c.style.width!=g&&(c.style.width=g),c=c.nextSibling):t.appendChild(document.createElement("col")).style.width=g}for(;c;){var y=c.nextSibling;c.parentNode.removeChild(c),c=y}a?(n.style.width=s+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=s+"px")}Me.prototype.update=function(e){return e.type==this.node.type&&(this.node=e,Ne(e,this.colgroup,this.table,this.cellMinWidth),!0)},Me.prototype.ignoreMutation=function(e){return"attributes"==e.type&&(e.target==this.table||this.colgroup.contains(e.target))};var Te=new i.PluginKey("tableColumnResizing");function De(e){void 0===e&&(e={});var t=e.handleWidth;void 0===t&&(t=5);var n=e.cellMinWidth;void 0===n&&(n=25);var r=e.View;void 0===r&&(r=Me);var o=e.lastColumnResizable;return void 0===o&&(o=!0),new i.Plugin({key:Te,state:{init:function(e,t){return this.spec.props.nodeViews[b(t.schema).table.name]=function(e,t){return new r(e,n,t)},new Ae(-1,!1)},apply:function(e,t){return t.apply(e)}},props:{attributes:function(e){return Te.getState(e).activeHandle>-1?{class:"resize-cursor"}:null},handleDOMEvents:{mousemove:function(e,n){!function(e,t,n,r,o){var i=Te.getState(e.state);if(!i.dragging){var s=function(e){for(;e&&"TD"!=e.nodeName&&"TH"!=e.nodeName;)e=e.classList.contains("ProseMirror")?null:e.parentNode;return e}(t.target),a=-1;if(s){var c=s.getBoundingClientRect(),l=c.left,u=c.right;t.clientX-l<=n?a=Ee(e,t,"left"):u-t.clientX<=n&&(a=Ee(e,t,"right"))}if(a!=i.activeHandle){if(!o&&-1!==a){var p=e.state.doc.resolve(a),h=p.node(-1),d=f.get(h),m=p.start(-1),v=d.colCount(p.pos-m)+p.nodeAfter.attrs.colspan-1;if(v==d.width-1)return}_e(e,a)}}}(e,n,t,0,o)},mouseleave:function(e){!function(e){var t=Te.getState(e.state);t.activeHandle>-1&&!t.dragging&&_e(e,-1)}(e)},mousedown:function(e,t){!function(e,t,n){var r=Te.getState(e.state);if(-1==r.activeHandle||r.dragging)return!1;var o=e.state.doc.nodeAt(r.activeHandle),i=function(e,t,n){var r=n.colspan,o=n.colwidth,i=o&&o[o.length-1];if(i)return i;var s=e.domAtPos(t),a=s.node.childNodes[s.offset].offsetWidth,c=r;if(o)for(var l=0;l<r;l++)o[l]&&(a-=o[l],c--);return a/c}(e,r.activeHandle,o.attrs);function s(t){window.removeEventListener("mouseup",s),window.removeEventListener("mousemove",a);var r=Te.getState(e.state);r.dragging&&(!function(e,t,n){for(var r=e.state.doc.resolve(t),o=r.node(-1),i=f.get(o),s=r.start(-1),a=i.colCount(r.pos-s)+r.nodeAfter.attrs.colspan-1,c=e.state.tr,l=0;l<i.height;l++){var u=l*i.width+a;if(!l||i.map[u]!=i.map[u-i.width]){var p=i.map[u],h=o.nodeAt(p),d=h.attrs,m=1==d.colspan?0:a-i.colCount(p);if(!d.colwidth||d.colwidth[m]!=n){var v=d.colwidth?d.colwidth.slice():Pe(d.colspan);v[m]=n,c.setNodeMarkup(s+p,null,A(d,"colwidth",v))}}}c.docChanged&&e.dispatch(c)}(e,r.activeHandle,Re(r.dragging,t,n)),e.dispatch(e.state.tr.setMeta(Te,{setDragging:null})))}function a(t){if(!t.which)return s(t);var r=Te.getState(e.state),o=Re(r.dragging,t,n);!function(e,t,n,r){var o=e.state.doc.resolve(t),i=o.node(-1),s=o.start(-1),a=f.get(i).colCount(o.pos-s)+o.nodeAfter.attrs.colspan-1,c=e.domAtPos(o.start(-1)).node;for(;"TABLE"!=c.nodeName;)c=c.parentNode;Ne(i,c.firstChild,c,r,a,n)}(e,r.activeHandle,o,n)}e.dispatch(e.state.tr.setMeta(Te,{setDragging:{startX:t.clientX,startWidth:i}})),window.addEventListener("mouseup",s),window.addEventListener("mousemove",a),t.preventDefault()}(e,t,n)}},decorations:function(e){var t=Te.getState(e);if(t.activeHandle>-1)return function(e,t){for(var n=[],r=e.doc.resolve(t),o=r.node(-1),i=f.get(o),s=r.start(-1),a=i.colCount(r.pos-s)+r.nodeAfter.attrs.colspan,l=0;l<i.height;l++){var u=a+l*i.width-1;if(!(a!=i.width&&i.map[u]==i.map[u+1]||0!=l&&i.map[u-1]==i.map[u-1-i.width])){var p=i.map[u],h=s+p+o.nodeAt(p).nodeSize-1,d=document.createElement("div");d.className="column-resize-handle",n.push(c.a.widget(h,d))}}return c.b.create(e.doc,n)}(e,t.activeHandle)},nodeViews:{}}})}var Ae=function(e,t){this.activeHandle=e,this.dragging=t};function Ee(e,t,n){var r=e.posAtCoords({left:t.clientX,top:t.clientY});if(!r)return-1;var o=r.pos,i=S(e.state.doc.resolve(o));if(!i)return-1;if("right"==n)return i.pos;var s=f.get(i.node(-1)),a=i.start(-1),c=s.map.indexOf(i.pos-a);return c%s.width==0?-1:a+s.map[c-1]}function Re(e,t,n){var r=t.clientX-e.startX;return Math.max(n,e.startWidth+r)}function _e(e,t){e.dispatch(e.state.tr.setMeta(Te,{setHandle:t}))}function Pe(e){for(var t=[],n=0;n<e;n++)t.push(0);return t}function $e(e){void 0===e&&(e={});var t=e.allowTableNodeSelection;return void 0===t&&(t=!1),new i.Plugin({key:w,state:{init:function(){return null},apply:function(e,t){var n=e.getMeta(w);if(null!=n)return-1==n?null:n;if(null==t||!e.docChanged)return t;var r=e.mapping.mapResult(t),o=r.deleted,i=r.pos;return o?null:i}},props:{decorations:I,handleDOMEvents:{mousedown:X},createSelectionBetween:function(e){if(null!=w.getState(e.state))return e.state.selection},handleTripleClick:U,handleKeyDown:q,handlePaste:G},appendTransaction:function(e,n,r){return function(e,t,n){var r,o,s=(t||e).selection,a=(t||e).doc;if(s instanceof i.NodeSelection&&(o=s.node.type.spec.tableRole)){if("cell"==o||"header_cell"==o)r=P.create(a,s.from);else if("row"==o){var c=a.resolve(s.from+1);r=P.rowSelection(c,c)}else if(!n){var l=f.get(s.node),u=s.from+1,p=u+l.map[l.width*l.height-1];r=P.create(a,u+1,p)}}else s instanceof i.TextSelection&&function(e){var t=e.$from,n=e.$to;if(t.pos==n.pos||t.pos<t.pos-6)return!1;for(var r=t.pos,o=n.pos,i=t.depth;i>=0&&!(t.after(i+1)<t.end(i));i--,r++);for(var s=n.depth;s>=0&&!(n.before(s+1)>n.start(s));s--,o--);return r==o&&/row|table/.test(t.node(i).type.spec.tableRole)}(s)?r=i.TextSelection.create(a,s.from):s instanceof i.TextSelection&&function(e){for(var t,n,r=e.$from,o=e.$to,i=r.depth;i>0;i--){var s=r.node(i);if("cell"===s.type.spec.tableRole||"header_cell"===s.type.spec.tableRole){t=s;break}}for(var a=o.depth;a>0;a--){var c=o.node(a);if("cell"===c.type.spec.tableRole||"header_cell"===c.type.spec.tableRole){n=c;break}}return t!==n&&0===o.parentOffset}(s)&&(r=i.TextSelection.create(a,s.$from.start(),s.$from.end()));return r&&(t||(t=e.tr)).setSelection(r),t}(r,te(r,n),t)}})}Ae.prototype.apply=function(e){var t=this,n=e.getMeta(Te);if(n&&null!=n.setHandle)return new Ae(n.setHandle,null);if(n&&void 0!==n.setDragging)return new Ae(t.activeHandle,n.setDragging);if(t.activeHandle>-1&&e.docChanged){var r=e.mapping.map(t.activeHandle,-1);C(e.doc.resolve(r))||(r=null),t=new Ae(r,t.dragging)}return t}},Xb7u:function(e,t,n){!function(){var t;function n(e){for(var t,n,r,o,i=1,s=[].slice.call(arguments),a=0,c=e.length,l="",u=!1,p=!1,h=function(){return s[i++]},d=function(){for(var n="";/\d/.test(e[a]);)n+=e[a++],t=e[a];return n.length>0?parseInt(n):null};a<c;++a)if(t=e[a],u)switch(u=!1,"."==t?(p=!1,t=e[++a]):"0"==t&&"."==e[a+1]?(p=!0,t=e[a+=2]):p=!0,o=d(),t){case"b":l+=parseInt(h(),10).toString(2);break;case"c":"string"==typeof(n=h())||n instanceof String?l+=n:l+=String.fromCharCode(parseInt(n,10));break;case"d":l+=parseInt(h(),10);break;case"f":r=String(parseFloat(h()).toFixed(o||6)),l+=p?r:r.replace(/^0/,"");break;case"j":l+=JSON.stringify(h());break;case"o":l+="0"+parseInt(h(),10).toString(8);break;case"s":l+=h();break;case"x":l+="0x"+parseInt(h(),10).toString(16);break;case"X":l+="0x"+parseInt(h(),10).toString(16).toUpperCase();break;default:l+=t}else"%"===t?u=!0:l+=t;return l}(t=e.exports=n).format=n,t.vsprintf=function(e,t){return n.apply(null,[e].concat(t))},"undefined"!=typeof console&&"function"==typeof console.log&&(t.printf=function(){console.log(n.apply(null,arguments))})}()},e56X:function(e,t,n){const{noopTest:r,edit:o,merge:i}=n("rUJ1"),s={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|<![A-Z][\\s\\S]*?>\\n*|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>\\n*|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:r,table:r,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};s.def=o(s.def).replace("label",s._label).replace("title",s._title).getRegex(),s.bullet=/(?:[*+-]|\d{1,9}\.)/,s.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,s.item=o(s.item,"gm").replace(/bull/g,s.bullet).getRegex(),s.list=o(s.list).replace(/bull/g,s.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+s.def.source+")").getRegex(),s._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",s._comment=/<!--(?!-?>)[\s\S]*?-->/,s.html=o(s.html,"i").replace("comment",s._comment).replace("tag",s._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),s.paragraph=o(s._paragraph).replace("hr",s.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",s._tag).getRegex(),s.blockquote=o(s.blockquote).replace("paragraph",s.paragraph).getRegex(),s.normal=i({},s),s.gfm=i({},s.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n *([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n *\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),s.gfm.nptable=o(s.gfm.nptable).replace("hr",s.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",s._tag).getRegex(),s.gfm.table=o(s.gfm.table).replace("hr",s.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",s._tag).getRegex(),s.pedantic=i({},s.normal,{html:o("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",s._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:r,paragraph:o(s.normal._paragraph).replace("hr",s.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",s.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});const a={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:r,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,strong:/^__([^\s_])__(?!_)|^\*\*([^\s*])\*\*(?!\*)|^__([^\s][\s\S]*?[^\s])__(?!_)|^\*\*([^\s][\s\S]*?[^\s])\*\*(?!\*)/,em:/^_([^\s_])_(?!_)|^\*([^\s*<\[])\*(?!\*)|^_([^\s<][\s\S]*?[^\s_])_(?!_|[^\spunctuation])|^_([^\s_<][\s\S]*?[^\s])_(?!_|[^\spunctuation])|^\*([^\s<"][\s\S]*?[^\s\*])\*(?!\*|[^\spunctuation])|^\*([^\s*"<\[][\s\S]*?[^\s])\*(?!\*)/,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:r,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,_punctuation:"!\"#$%&'()*+,\\-./:;<=>?@\\[^_{|}~"};a.em=o(a.em).replace(/punctuation/g,a._punctuation).getRegex(),a._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,a._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,a._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,a.autolink=o(a.autolink).replace("scheme",a._scheme).replace("email",a._email).getRegex(),a._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,a.tag=o(a.tag).replace("comment",s._comment).replace("attribute",a._attribute).getRegex(),a._label=/(?:\[[^\[\]]*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,a._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,a._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,a.link=o(a.link).replace("label",a._label).replace("href",a._href).replace("title",a._title).getRegex(),a.reflink=o(a.reflink).replace("label",a._label).getRegex(),a.normal=i({},a),a.pedantic=i({},a.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/,link:o(/^!?\[(label)\]\((.*?)\)/).replace("label",a._label).getRegex(),reflink:o(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",a._label).getRegex()}),a.gfm=i({},a.normal,{escape:o(a.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*~]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))|(?= {2,}\n|[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))/}),a.gfm.url=o(a.gfm.url,"i").replace("email",a.gfm._extended_email).getRegex(),a.breaks=i({},a.gfm,{br:o(a.br).replace("{2,}","*").getRegex(),text:o(a.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()}),e.exports={block:s,inline:a}},fwbU:function(e,t,n){"use strict";n.d(t,"a",function(){return y}),n.d(t,"b",function(){return g});for(var r={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:"'",229:"q"},o={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"',229:"Q"},i="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent),s="undefined"!=typeof navigator&&/Apple Computer/.test(navigator.vendor),a="undefined"!=typeof navigator&&/Gecko\/\d+/.test(navigator.userAgent),c="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),l="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),u=i&&(c||+i[1]<57)||a&&c,p=0;p<10;p++)r[48+p]=r[96+p]=String(p);for(p=1;p<=24;p++)r[p+111]="F"+p;for(p=65;p<=90;p++)r[p]=String.fromCharCode(p+32),o[p]=String.fromCharCode(p);for(var h in r)o.hasOwnProperty(h)||(o[h]=r[h]);var d=n("UxO+"),f="undefined"!=typeof navigator&&/Mac/.test(navigator.platform);function m(e){var t,n,r,o,i=e.split(/-(?!$)/),s=i[i.length-1];"Space"==s&&(s=" ");for(var a=0;a<i.length-1;a++){var c=i[a];if(/^(cmd|meta|m)$/i.test(c))o=!0;else if(/^a(lt)?$/i.test(c))t=!0;else if(/^(c|ctrl|control)$/i.test(c))n=!0;else if(/^s(hift)?$/i.test(c))r=!0;else{if(!/^mod$/i.test(c))throw new Error("Unrecognized modifier name: "+c);f?o=!0:n=!0}}return t&&(s="Alt-"+s),n&&(s="Ctrl-"+s),o&&(s="Meta-"+s),r&&(s="Shift-"+s),s}function v(e,t,n){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),!1!==n&&t.shiftKey&&(e="Shift-"+e),e}function g(e){return new d.Plugin({props:{handleKeyDown:y(e)}})}function y(e){var t=function(e){var t=Object.create(null);for(var n in e)t[m(n)]=e[n];return t}(e);return function(e,n){var i,a=function(e){var t=!(u&&(e.ctrlKey||e.altKey||e.metaKey)||(s||l)&&e.shiftKey&&e.key&&1==e.key.length)&&e.key||(e.shiftKey?o:r)[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),c=1==a.length&&" "!=a,p=t[v(a,n,!c)];if(p&&p(e.state,e.dispatch,e))return!0;if(c&&(n.shiftKey||n.altKey||n.metaKey||a.charCodeAt(0)>127)&&(i=r[n.keyCode])&&i!=a){var h=t[v(i,n,!0)];if(h&&h(e.state,e.dispatch,e))return!0}else if(c&&n.shiftKey){var d=t[v(a,n,!0)];if(d&&d(e.state,e.dispatch,e))return!0}return!1}}},hyX7:function(e,t,n){const r=n("SbYC"),{defaults:o}=n("vbtb"),{inline:i}=n("e56X"),{findClosingBracket:s,escape:a}=n("rUJ1");e.exports=class e{constructor(e,t){if(this.options=t||o,this.links=e,this.rules=i.normal,this.options.renderer=this.options.renderer||new r,this.renderer=this.options.renderer,this.renderer.options=this.options,!this.links)throw new Error("Tokens array requires a `links` property.");this.options.pedantic?this.rules=i.pedantic:this.options.gfm&&(this.options.breaks?this.rules=i.breaks:this.rules=i.gfm)}static get rules(){return i}static output(t,n,r){return new e(n,r).output(t)}output(t){let n,r,o,i,c,l,u="";for(;t;)if(c=this.rules.escape.exec(t))t=t.substring(c[0].length),u+=a(c[1]);else if(c=this.rules.tag.exec(t))!this.inLink&&/^<a /i.test(c[0])?this.inLink=!0:this.inLink&&/^<\/a>/i.test(c[0])&&(this.inLink=!1),!this.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(c[0])?this.inRawBlock=!0:this.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(c[0])&&(this.inRawBlock=!1),t=t.substring(c[0].length),u+=this.renderer.html(this.options.sanitize?this.options.sanitizer?this.options.sanitizer(c[0]):a(c[0]):c[0]);else if(c=this.rules.link.exec(t)){const r=s(c[2],"()");if(r>-1){const e=(0===c[0].indexOf("!")?5:4)+c[1].length+r;c[2]=c[2].substring(0,r),c[0]=c[0].substring(0,e).trim(),c[3]=""}t=t.substring(c[0].length),this.inLink=!0,o=c[2],this.options.pedantic?(n=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(o))?(o=n[1],i=n[3]):i="":i=c[3]?c[3].slice(1,-1):"",o=o.trim().replace(/^<([\s\S]*)>$/,"$1"),u+=this.outputLink(c,{href:e.escapes(o),title:e.escapes(i)}),this.inLink=!1}else if((c=this.rules.reflink.exec(t))||(c=this.rules.nolink.exec(t))){if(t=t.substring(c[0].length),n=(c[2]||c[1]).replace(/\s+/g," "),!(n=this.links[n.toLowerCase()])||!n.href){u+=c[0].charAt(0),t=c[0].substring(1)+t;continue}this.inLink=!0,u+=this.outputLink(c,n),this.inLink=!1}else if(c=this.rules.strong.exec(t))t=t.substring(c[0].length),u+=this.renderer.strong(this.output(c[4]||c[3]||c[2]||c[1]));else if(c=this.rules.em.exec(t))t=t.substring(c[0].length),u+=this.renderer.em(this.output(c[6]||c[5]||c[4]||c[3]||c[2]||c[1]));else if(c=this.rules.code.exec(t))t=t.substring(c[0].length),u+=this.renderer.codespan(a(c[2].trim(),!0));else if(c=this.rules.br.exec(t))t=t.substring(c[0].length),u+=this.renderer.br();else if(c=this.rules.del.exec(t))t=t.substring(c[0].length),u+=this.renderer.del(this.output(c[1]));else if(c=this.rules.autolink.exec(t))t=t.substring(c[0].length),o="@"===c[2]?"mailto:"+(r=a(this.mangle(c[1]))):r=a(c[1]),u+=this.renderer.link(o,null,r);else if(this.inLink||!(c=this.rules.url.exec(t))){if(c=this.rules.text.exec(t))t=t.substring(c[0].length),this.inRawBlock?u+=this.renderer.text(this.options.sanitize?this.options.sanitizer?this.options.sanitizer(c[0]):a(c[0]):c[0]):u+=this.renderer.text(a(this.smartypants(c[0])));else if(t)throw new Error("Infinite loop on byte: "+t.charCodeAt(0))}else{if("@"===c[2])o="mailto:"+(r=a(c[0]));else{do{l=c[0],c[0]=this.rules._backpedal.exec(c[0])[0]}while(l!==c[0]);r=a(c[0]),o="www."===c[1]?"http://"+r:r}t=t.substring(c[0].length),u+=this.renderer.link(o,null,r)}return u}static escapes(t){return t?t.replace(e.rules._escapes,"$1"):t}outputLink(e,t){const n=t.href,r=t.title?a(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,r,this.output(e[1])):this.renderer.image(n,r,a(e[1]))}smartypants(e){return this.options.smartypants?e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):e}mangle(e){if(!this.options.mangle)return e;const t=e.length;let n,r="",o=0;for(;o<t;o++)n=e.charCodeAt(o),Math.random()>.5&&(n="x"+n.toString(16)),r+="&#"+n+";";return r}}},mG1W:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n("UxO+"),o=n("MEpN"),i=n("Vb5C"),s=function(e,t){return function(n){Array.isArray(e)||(e=[e]);for(var r=0,o=e.length;r<o;r++){var i=R(e[r])(n.selection);if(i){var s=m(i.pos,t)(n);if(s!==n)return s}}return n}},a=function(e){return function(t){if(h(t.selection)){var n=t.selection,i=n.$from,s=n.$to;if(e instanceof o.Fragment&&i.parent.canReplace(i.index(),i.indexAfter(),e)||i.parent.canReplaceWith(i.index(),i.indexAfter(),e.type))return f(t.replaceWith(i.pos,s.pos,e).setSelection(new r.NodeSelection(t.doc.resolve(i.pos))))}return t}},c=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return function(n){var o=r.Selection.findFrom(n.doc.resolve(e),t,!0);return o?n.setSelection(o):n}},l=function(e){return e.type&&e.type.spec.selectable},u=function(e,t,n){return function(e){return l(e)&&e.type.isLeaf}(e)?n.setSelection(new r.NodeSelection(n.doc.resolve(t))):c(t)(n)},p=function(e,t,n){return function(r){var o="number"==typeof t,i=r.selection.$from,c=o?r.doc.resolve(t):h(r.selection)?r.doc.resolve(i.pos+1):i,p=c.parent;if(h(r.selection)&&n&&r!==(r=a(e)(r)))return r;if(w(p)&&r!==(r=s(p.type,e)(r))){var d=l(e)?c.before(c.depth):c.pos;return u(e,d,r)}if(b(c,e)){r.insert(c.pos,e);var m=o?c.pos:l(e)?r.selection.$anchor.pos-1:r.selection.$anchor.pos;return f(u(e,m,r))}for(var v=c.depth;v>0;v--){var g=c.after(v),y=r.doc.resolve(g);if(b(y,e))return r.insert(g,e),f(u(e,g,r))}return r}},h=function(e){return e instanceof r.NodeSelection},d=function(e,t){return Array.isArray(e)&&e.indexOf(t.type)>-1||t.type===e},f=function(e){return Object.assign(Object.create(e),e).setTime(Date.now())},m=function(e,t){return function(n){var r=n.doc.nodeAt(e),o=n.doc.resolve(e);if(v(o,t)){var i=(n=n.replaceWith(e,e+r.nodeSize,t)).selection.$from.pos-1;return n=c(Math.max(i,0),-1)(n),n=c(n.selection.$from.start())(n),f(n)}return n}},v=function(e,t){var n=e.node(e.depth);return n&&n.type.validContent(t instanceof o.Fragment?t:o.Fragment.from(t))},g=function(e){return function(t){var n=t.doc.nodeAt(e);return f(t.delete(e,e+n.nodeSize))}},y=function(e){if(e.cached.tableNodeTypes)return e.cached.tableNodeTypes;var t={};return Object.keys(e.nodes).forEach(function(n){var r=e.nodes[n];r.spec.tableRole&&(t[r.spec.tableRole]=r)}),e.cached.tableNodeTypes=t,t},b=function(e,t){var n=e.index();return t instanceof o.Fragment?e.parent.canReplace(n,n,t):t instanceof o.Node&&e.parent.canReplaceWith(n,n,t.type)},w=function(e){return!e||"paragraph"===e.type.name&&2===e.nodeSize},S=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return t?e.createChecked(null,t):e.createAndFill()},x=function(e){return function(t){for(var n=i.TableMap.get(t.$anchorCell.node(-1)),r=t.$anchorCell.start(-1),o=n.cellsInRect(e),s=n.cellsInRect(n.rectBetween(t.$anchorCell.pos-r,t.$headCell.pos-r)),a=0,c=o.length;a<c;a++)if(-1===s.indexOf(o[a]))return!1;return!0}},k=function(e){return e[0].map(function(t,n){return e.map(function(e){return e[n]})})},C=function(e){for(var t=i.TableMap.get(e),n=[],r=0;r<t.height;r++){for(var o=[],s={},a=0;a<t.width;a++){var c=t.map[r*t.width+a],l=e.nodeAt(c),u=t.findCell(c);s[c]||u.top!==r?o.push(null):(s[c]=!0,o.push(l))}n.push(o)}return n},O=function(e,t){for(var n=[],r=i.TableMap.get(e),o=0;o<r.height;o++){for(var s=e.child(o),a=[],c=0;c<r.width;c++)if(t[o][c]){var l=r.map[o*r.width+c],u=t[o][c],p=e.nodeAt(l).type.createChecked(Object.assign({},u.attrs),u.content,u.marks);a.push(p)}n.push(s.type.createChecked(s.attrs,a,s.marks))}return e.type.createChecked(e.attrs,n,e.marks)},M=function(e,t,n,r){var o=t[0]>n[0]?-1:1,i=e.splice(t[0],t.length),s=i.length%2==0?1:0,a=void 0;return a=-1===r&&1===o?n[0]-1:1===r&&-1===o?n[n.length-1]-s+1:-1===o?n[0]:n[n.length-1]-s,e.splice.apply(e,[a,0].concat(i)),e},N=function(e,t,n,r){var o="Target position is invalid, you can't move the "+r+" "+e+" to "+t+", the target can't be split. You could use tryToFit option.";if(1===(e>t?-1:1)){if(-1!==n.slice(0,n.length-1).indexOf(t))throw new Error(o)}else if(-1!==n.slice(1).indexOf(t))throw new Error(o);return!0},T=function(e){return function(t){var n=t.$from;return D(n,e)}},D=function(e,t){for(var n=e.depth;n>0;n--){var r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}},A=function(e,t){return function(n){var r=T(e)(n);if(r)return P(r.pos,t)}},E=function(e){return function(t){return!!T(e)(t)}},R=function(e){return function(t){return T(function(t){return d(e,t)})(t)}},_=function(e){var t=e.$from.nodeBefore,n=r.Selection.findFrom(e.$from,-1);if(n&&t){var o=R(t.type)(n);return o?o.pos:n.$from.pos}},P=function(e,t){var n=t(e),r=n.node.childNodes[n.offset];return n.node.nodeType===Node.TEXT_NODE?n.node.parentNode:r&&r.nodeType!==Node.TEXT_NODE?r:n.node},$=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!e)throw new Error('Invalid "node" parameter');var n=[];return e.descendants(function(e,r){if(n.push({node:e,pos:r}),!t)return!1}),n},I=function(e,t,n){if(!e)throw new Error('Invalid "node" parameter');if(!t)throw new Error('Invalid "predicate" parameter');return $(e,n).filter(function(e){return t(e.node)})},z=function(e,t,n){return I(e,function(e){return e.type===t},n)};var B=function(e){return T(function(e){return e.type.spec.tableRole&&"table"===e.type.spec.tableRole})(e)},F=function(e){return e instanceof i.CellSelection},V=function(e){if(F(e)){var t=i.TableMap.get(e.$anchorCell.node(-1));return x({left:0,right:t.width,top:0,bottom:t.height})(e)}return!1},j=function(e){return function(t){var n=B(t);if(n){var r=i.TableMap.get(n.node);return(Array.isArray(e)?e:Array.from([e])).reduce(function(e,t){if(t>=0&&t<=r.width-1){var o=r.cellsInRect({left:t,right:t+1,top:0,bottom:r.height});return e.concat(o.map(function(e){var t=n.node.nodeAt(e),r=e+n.start;return{pos:r,start:r+1,node:t}}))}},[])}}},L=function(e){return function(t){var n=B(t);if(n){var r=i.TableMap.get(n.node);return(Array.isArray(e)?e:Array.from([e])).reduce(function(e,t){if(t>=0&&t<=r.height-1){var o=r.cellsInRect({left:0,right:r.width,top:t,bottom:t+1});return e.concat(o.map(function(e){var t=n.node.nodeAt(e),r=e+n.start;return{pos:r,start:r+1,node:t}}))}},[])}}},q=function(e){return function(t,n){return function(r){var o=B(r.selection),s="row"===e;if(o){var a=i.TableMap.get(o.node);if(t>=0&&t<(s?a.height:a.width)){var c=s?0:t,l=s?t:0,u=s?a.width:t+1,p=s?t+1:a.height;if(n){var h=Z(r.selection.$from);if(!h)return r;var d=a.findCell(h.pos-o.start);s?(l=Math.min(l,d.top),p=Math.max(p,d.bottom)):(c=Math.min(c,d.left),u=Math.max(u,d.right))}var m=a.cellsInRect({left:c,top:l,right:s?u:c+1,bottom:s?l+1:p}),v=p-l==1?m:a.cellsInRect({left:s?c:u-1,top:s?p-1:l,right:u,bottom:p}),g=o.start+m[0],y=o.start+v[v.length-1],b=r.doc.resolve(g),w=r.doc.resolve(y);return f(r.setSelection(new i.CellSelection(w,b)))}}return r}}},W=q("column"),K=q("row"),J=function(e){return function(t){var n=B(t.selection);if(n){var r=i.TableMap.get(n.node);if(e>=0&&e<=r.height){for(var o=n.node,s=y(o.type.schema),a=n.start,c=0;c<e+1;c++)a+=o.child(c).nodeSize;var l=o.child(e),u=[],h=0;if(l.forEach(function(e){1===e.attrs.rowspan&&(h+=e.attrs.colspan,u.push(s[e.type.spec.tableRole].createAndFill(e.attrs,e.marks)))}),h<r.width){for(var d=[],f=function(n){var r=Q(n,function(t,r){var o=t.node.attrs.rowspan;return o>1&&n+o>e})(t);d.push.apply(d,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)}(r))},m=e;m>=0;m--)f(m);d.length&&d.forEach(function(e){t=X(e,{rowspan:e.node.attrs.rowspan+1})(t)})}return p(s.row.create(l.attrs,u),a)(t)}}return t}},H=function(e){return function(t){var n=B(t.selection);if(n){var r=i.TableMap.get(n.node);if(0===e&&1===r.width)return G(t);if(e>=0&&e<=r.width)return i.removeColumn(t,{map:r,tableStart:n.start,table:n.node},e),f(t)}return t}},U=function(e){return function(t){var n=B(t.selection);if(n){var r=i.TableMap.get(n.node);if(0===e&&1===r.height)return G(t);if(e>=0&&e<=r.height)return i.removeRow(t,{map:r,tableStart:n.start,table:n.node},e),f(t)}return t}},G=function(e){for(var t=e.selection.$from,n=t.depth;n>0;n--){if("table"===t.node(n).type.spec.tableRole)return f(e.delete(t.before(n),t.after(n)))}return e},X=function(e,t){return function(n){return e?(n.setNodeMarkup(e.pos,null,Object.assign({},e.node.attrs,t)),f(n)):n}},Z=function(e){return D(e,function(e){return e.type.spec.tableRole&&/cell/i.test(e.type.spec.tableRole)})},Y=function(e){var t=Z(e);if(t){var n=function(e){return D(e,function(e){return e.type.spec.tableRole&&/table/i.test(e.type.spec.tableRole)})}(e),r=i.TableMap.get(n.node),o=t.pos-n.start;return r.rectBetween(o,o)}},Q=function(e,t){return function(n){var r=[],o=L(e)(n.selection);if(o)for(var i=o.length-1;i>=0;i--)t(o[i],n)&&r.push(o[i]);return r}},ee=function(e){return function(t){for(var n=e,r=e,o=function(e){var o=j(e)(t.selection);o&&o.forEach(function(t){var o=t.node.attrs.colspan+e-1;o>=n&&(n=e),o>r&&(r=o)})},i=e;i>=0;i--)o(i);var s=function(e){var n=j(e)(t.selection);n&&n.forEach(function(t){var n=t.node.attrs.colspan+e-1;t.node.attrs.colspan>1&&n>r&&(r=n)})};for(i=e;i<=r;i++)s(i);var a=[];for(i=n;i<=r;i++){var c=j(i)(t.selection);c&&c.length&&a.push(i)}n=a[0],r=a[a.length-1];for(var l=j(n)(t.selection),u=L(0)(t.selection),p=t.doc.resolve(l[l.length-1].pos),h=void 0,d=r;d>=n;d--){var f=j(d)(t.selection);if(f&&f.length){for(var m=u.length-1;m>=0;m--)if(u[m].pos===f[0].pos){h=f[0];break}if(h)break}}return{$anchor:p,$head:t.doc.resolve(h.pos),indexes:a}}},te=function(e){return function(t){for(var n=e,r=e,o=function(e){L(e)(t.selection).forEach(function(t){var o=t.node.attrs.rowspan+e-1;o>=n&&(n=e),o>r&&(r=o)})},i=e;i>=0;i--)o(i);var s=function(e){L(e)(t.selection).forEach(function(t){var n=t.node.attrs.rowspan+e-1;t.node.attrs.rowspan>1&&n>r&&(r=n)})};for(i=e;i<=r;i++)s(i);var a=[];for(i=n;i<=r;i++){var c=L(i)(t.selection);c&&c.length&&a.push(i)}n=a[0],r=a[a.length-1];for(var l=L(n)(t.selection),u=j(0)(t.selection),p=t.doc.resolve(l[l.length-1].pos),h=void 0,d=r;d>=n;d--){var f=L(d)(t.selection);if(f&&f.length){for(var m=u.length-1;m>=0;m--)if(u[m].pos===f[0].pos){h=f[0];break}if(h)break}}return{$anchor:p,$head:t.doc.resolve(h.pos),indexes:a}}};t.isNodeSelection=h,t.canInsert=b,t.convertTableNodeToArrayOfRows=C,t.convertArrayOfRowsToTableNode=O,t.findParentNode=T,t.findParentNodeClosestToPos=D,t.findParentDomRef=A,t.hasParentNode=E,t.findParentNodeOfType=R,t.findParentNodeOfTypeClosestToPos=function(e,t){return D(e,function(e){return d(t,e)})},t.hasParentNodeOfType=function(e){return function(t){return E(function(t){return d(e,t)})(t)}},t.findParentDomRefOfType=function(e,t){return function(n){return A(function(t){return d(e,t)},t)(n)}},t.findSelectedNodeOfType=function(e){return function(t){if(h(t)){var n=t.node,r=t.$from;if(d(e,n))return{node:n,pos:r.pos,depth:r.depth}}}},t.findPositionOfNodeBefore=_,t.findDomRefAtPos=P,t.flatten=$,t.findChildren=I,t.findTextNodes=function(e,t){return I(e,function(e){return e.isText},t)},t.findInlineNodes=function(e,t){return I(e,function(e){return e.isInline},t)},t.findBlockNodes=function(e,t){return I(e,function(e){return e.isBlock},t)},t.findChildrenByAttr=function(e,t,n){return I(e,function(e){return!!t(e.attrs)},n)},t.findChildrenByType=z,t.findChildrenByMark=function(e,t,n){return I(e,function(e){return t.isInSet(e.marks)},n)},t.contains=function(e,t){return!!z(e,t).length},t.findTable=B,t.isCellSelection=F,t.getSelectionRect=function(e){if(F(e)){var t=e.$anchorCell.start(-1);return i.TableMap.get(e.$anchorCell.node(-1)).rectBetween(e.$anchorCell.pos-t,e.$headCell.pos-t)}},t.isColumnSelected=function(e){return function(t){if(F(t)){var n=i.TableMap.get(t.$anchorCell.node(-1));return x({left:e,right:e+1,top:0,bottom:n.height})(t)}return!1}},t.isRowSelected=function(e){return function(t){if(F(t)){var n=i.TableMap.get(t.$anchorCell.node(-1));return x({left:0,right:n.width,top:e,bottom:e+1})(t)}return!1}},t.isTableSelected=V,t.getCellsInColumn=j,t.getCellsInRow=L,t.getCellsInTable=function(e){var t=B(e);if(t){var n=i.TableMap.get(t.node);return n.cellsInRect({left:0,right:n.width,top:0,bottom:n.height}).map(function(e){var n=t.node.nodeAt(e),r=e+t.start;return{pos:r,start:r+1,node:n}})}},t.selectColumn=W,t.selectRow=K,t.selectTable=function(e){var t=B(e.selection);if(t){var n=i.TableMap.get(t.node).map;if(n&&n.length){var r=t.start+n[0],o=t.start+n[n.length-1],s=e.doc.resolve(r),a=e.doc.resolve(o);return f(e.setSelection(new i.CellSelection(a,s)))}}return e},t.emptyCell=function(e,t){return function(n){if(e){var r=y(t).cell.createAndFill().content;if(!e.node.content.eq(r))return n.replaceWith(e.pos+1,e.pos+e.node.nodeSize,r),f(n)}return n}},t.addColumnAt=function(e){return function(t){var n=B(t.selection);if(n){var r=i.TableMap.get(n.node);if(e>=0&&e<=r.width)return f(i.addColumn(t,{map:r,tableStart:n.start,table:n.node},e))}return t}},t.moveRow=function(e,t,n){return function(r){var o=Object.assign({tryToFit:!1,direction:0},n),i=B(r.selection);if(!i)return r;var s=te(e)(r).indexes,a=te(t)(r).indexes;if(s.indexOf(t)>-1)return r;!o.tryToFit&&a.length>1&&N(e,t,a,"row");var c=function(e,t,n,r){var o=C(e.node);return o=M(o,t,n,r),O(e.node,o)}(i,s,a,o.direction);return f(r).replaceWith(i.pos,i.pos+i.node.nodeSize,c)}},t.moveColumn=function(e,t,n){return function(r){var o=Object.assign({tryToFit:!1,direction:0},n),i=B(r.selection);if(!i)return r;var s=ee(e)(r).indexes,a=ee(t)(r).indexes;if(s.indexOf(t)>-1)return r;!o.tryToFit&&a.length>1&&N(e,t,a,"column");var c=function(e,t,n,r){var o=k(C(e.node));return o=M(o,t,n,r),o=k(o),O(e.node,o)}(i,s,a,o.direction);return f(r).replaceWith(i.pos,i.pos+i.node.nodeSize,c)}},t.addRowAt=function(e,t){return function(n){var r=B(n.selection);if(r){var o=i.TableMap.get(r.node),s=e-1;if(t&&s>=0)return f(J(s)(n));if(e>=0&&e<=o.height)return f(i.addRow(n,{map:o,tableStart:r.start,table:r.node},e))}return n}},t.cloneRowAt=J,t.removeColumnAt=H,t.removeRowAt=U,t.removeTable=G,t.removeSelectedColumns=function(e){var t=e.selection;if(V(t))return G(e);if(F(t)){var n=B(t);if(n){var r=i.TableMap.get(n.node),o=r.rectBetween(t.$anchorCell.pos-n.start,t.$headCell.pos-n.start);if(0==o.left&&o.right==r.width)return!1;for(var s=Object.assign({},o,{map:r,table:n.node,tableStart:n.start}),a=s.right-1;i.removeColumn(e,s,a),a!==s.left;a--)s.table=s.tableStart?e.doc.nodeAt(s.tableStart-1):e.doc,s.map=i.TableMap.get(s.table);return f(e)}}return e},t.removeSelectedRows=function(e){var t=e.selection;if(V(t))return G(e);if(F(t)){var n=B(t);if(n){var r=i.TableMap.get(n.node),o=r.rectBetween(t.$anchorCell.pos-n.start,t.$headCell.pos-n.start);if(0==o.top&&o.bottom==r.height)return!1;for(var s=Object.assign({},o,{map:r,table:n.node,tableStart:n.start}),a=s.bottom-1;i.removeRow(e,s,a),a!==s.top;a--)s.table=s.tableStart?e.doc.nodeAt(s.tableStart-1):e.doc,s.map=i.TableMap.get(s.table);return f(e)}}return e},t.removeColumnClosestToPos=function(e){return function(t){var n=Y(e);return n?H(n.left)(c(e.pos)(t)):t}},t.removeRowClosestToPos=function(e){return function(t){var n=Y(e);return n?U(n.top)(c(e.pos)(t)):t}},t.forEachCellInColumn=function(e,t,n){return function(o){var i=j(e)(o.selection);if(i){for(var s=i.length-1;s>=0;s--)o=t(i[s],o);if(n){var a=o.doc.resolve(o.mapping.map(i[i.length-1].pos));o.setSelection(r.Selection.near(a))}return f(o)}return o}},t.forEachCellInRow=function(e,t,n){return function(o){var i=L(e)(o.selection);if(i){for(var s=i.length-1;s>=0;s--)o=t(i[s],o);if(n){var a=o.doc.resolve(o.mapping.map(i[i.length-1].pos));o.setSelection(r.Selection.near(a))}}return o}},t.setCellAttrs=X,t.createTable=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3,r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,i=y(e),s=i.cell,a=i.header_cell,c=i.row,l=i.table,u=[],p=[],h=0;h<n;h++)u.push(S(s,o)),r&&p.push(S(a,o));for(var d=[],f=0;f<t;f++)d.push(c.createChecked(null,r&&0===f?p:u));return l.createChecked(null,d)},t.findCellClosestToPos=Z,t.findCellRectClosestToPos=Y,t.getSelectionRangeInColumn=ee,t.getSelectionRangeInRow=te,t.removeParentNodeOfType=function(e){return function(t){var n=R(e)(t.selection);return n?g(n.pos)(t):t}},t.replaceParentNodeOfType=s,t.removeSelectedNode=function(e){if(h(e.selection)){var t=e.selection.$from.pos,n=e.selection.$to.pos;return f(e.delete(t,n))}return e},t.replaceSelectedNode=a,t.setTextSelection=c,t.safeInsert=p,t.setParentNodeMarkup=function(e,t,n,r){return function(o){var i=R(e)(o.selection);return i?f(o.setNodeMarkup(i.pos,t,Object.assign({},i.node.attrs,n),r)):o}},t.selectParentNodeOfType=function(e){return function(t){if(!h(t.selection)){var n=R(e)(t.selection);if(n)return f(t.setSelection(r.NodeSelection.create(t.doc,n.pos)))}return t}},t.removeNodeBefore=function(e){var t=_(e.selection);return"number"==typeof t?g(t)(e):e}},oV9I:function(e,t,n){"use strict";n.d(t,"a",function(){return l}),n.d(t,"b",function(){return p}),n.d(t,"c",function(){return u}),n.d(t,"d",function(){return h}),n.d(t,"e",function(){return d}),n.d(t,"f",function(){return f});var r=n("mG1W");
+/*!
+ * tiptap-utils v1.10.0
+ * (c) 2020 Scrumpy UG (limited liability)
+ * @license MIT
+ */
+function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach(function(t){o(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function a(e){return function(e){if(Array.isArray(e))return c(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return c(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function l(e,t){var n=e.selection,r=n.from,o=n.to,i=[];e.doc.nodesBetween(r,o,function(e){i=[].concat(a(i),a(e.marks))});var s=i.find(function(e){return e.type.name===t.name});return s?s.attrs:{}}function u(e,t){var n=e.selection,r=n.from,o=n.to,i=[];e.doc.nodesBetween(r,o,function(e){i=[].concat(a(i),[e])});var s=i.reverse().find(function(e){return e.type.name===t.name});return s?s.attrs:{}}function p(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!e||!t)return!1;var n=e.parent.childAfter(e.parentOffset);if(!n.node)return!1;var r=n.node.marks.find(function(e){return e.type===t});if(!r)return!1;for(var o=e.index(),i=e.start()+n.offset,s=o+1,a=i+n.node.nodeSize;o>0&&r.isInSet(e.parent.child(o-1).marks);)o-=1,i-=e.parent.child(o).nodeSize;for(;s<e.parent.childCount&&r.isInSet(e.parent.child(s).marks);)a+=e.parent.child(s).nodeSize,s+=1;return{from:i,to:a}}function h(e,t){var n=e.selection,r=n.from,o=n.$from,i=n.to;return n.empty?!!t.isInSet(e.storedMarks||o.marks()):!!e.doc.rangeHasMark(r,i,t)}function d(e){var t=e.types,n=e.node;return Array.isArray(t)&&t.includes(n.type)||n.type===t}function f(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=Object(r.findSelectedNodeOfType)(t)(e.selection)||Object(r.findParentNode)(function(e){return e.type===t})(e.selection);return Object.keys(n).length&&o?o.node.hasMarkup(t,s(s({},o.node.attrs),n)):!!o}},"qd4/":function(e,t,n){"use strict";n.d(t,"a",function(){return r.b}),n.d(t,"b",function(){return r.c}),n.d(t,"k",function(){return r.e}),n.d(t,"r",function(){return r.f}),n.d(t,"d",function(){return c}),n.d(t,"l",function(){return l}),n.d(t,"m",function(){return a}),n.d(t,"o",function(){return u.c}),n.d(t,"u",function(){return u.e}),n.d(t,"c",function(){return f}),n.d(t,"e",function(){return m}),n.d(t,"f",function(){return y}),n.d(t,"g",function(){return v}),n.d(t,"h",function(){return g}),n.d(t,"i",function(){return b}),n.d(t,"j",function(){return w}),n.d(t,"n",function(){return S}),n.d(t,"p",function(){return x}),n.d(t,"q",function(){return C}),n.d(t,"s",function(){return O}),n.d(t,"t",function(){return M});var r=n("ABBN"),o=n("CsC6"),i=n("MEpN");function s(e,t){return function(n,r){var s=n.selection,a=s.$from,c=s.$to,l=a.blockRange(c),u=!1,p=l;if(!l)return!1;if(l.depth>=2&&a.node(l.depth-1).type.compatibleContent(e)&&0==l.startIndex){if(0==a.index(l.depth-1))return!1;var h=n.doc.resolve(l.start-2);p=new i.NodeRange(h,h,l.depth),l.endIndex<l.parent.childCount&&(l=new i.NodeRange(a,n.doc.resolve(c.end(l.depth)),l.depth)),u=!0}var d=Object(o.i)(p,e,t,l);return!!d&&(r&&r(function(e,t,n,r,s){for(var a=i.Fragment.empty,c=n.length-1;c>=0;c--)a=i.Fragment.from(n[c].type.create(n[c].attrs,a));e.step(new o.b(t.start-(r?2:0),t.end,t.start,t.end,new i.Slice(a,0,0),n.length,!0));for(var l=0,u=0;u<n.length;u++)n[u].type==s&&(l=u+1);for(var p=n.length-l,h=t.start+n.length-(r?2:0),d=t.parent,f=t.startIndex,m=t.endIndex,v=!0;f<m;f++,v=!1)!v&&Object(o.g)(e.doc,h,p)&&(e.split(h,p),h+=2*p),h+=d.child(f).nodeSize;return e}(n.tr,l,d,u,e).scrollIntoView()),!0)}}function a(e){return function(t,n){var r=t.selection,s=r.$from,a=r.$to,c=r.node;if(c&&c.isBlock||s.depth<2||!s.sameParent(a))return!1;var l=s.node(-1);if(l.type!=e)return!1;if(0==s.parent.content.size&&s.node(-1).childCount==s.indexAfter(-1)){if(2==s.depth||s.node(-3).type!=e||s.index(-2)!=s.node(-2).childCount-1)return!1;if(n){for(var u=i.Fragment.empty,p=s.index(-1)>0,h=s.depth-(p?1:2);h>=s.depth-3;h--)u=i.Fragment.from(s.node(h).copy(u));u=u.append(i.Fragment.from(e.createAndFill()));var d=t.tr.replace(s.before(p?null:-1),s.after(-3),new i.Slice(u,p?3:2,2));d.setSelection(t.selection.constructor.near(d.doc.resolve(s.pos+(p?3:2)))),n(d.scrollIntoView())}return!0}var f=a.pos==s.end()?l.contentMatchAt(0).defaultType:null,m=t.tr.delete(s.pos,a.pos),v=f&&[null,{type:f}];return!!Object(o.g)(m.doc,s.pos,2,v)&&(n&&n(m.split(s.pos,2,v).scrollIntoView()),!0)}}function c(e){return function(t,n){var r=t.selection,s=r.$from,a=r.$to,c=s.blockRange(a,function(t){return t.childCount&&t.firstChild.type==e});return!!c&&(!n||(s.node(c.depth-1).type==e?function(e,t,n,r){var s=e.tr,a=r.end,c=r.$to.end(r.depth);a<c&&(s.step(new o.b(a-1,c,a,c,new i.Slice(i.Fragment.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new i.NodeRange(s.doc.resolve(r.$from.pos),s.doc.resolve(c),r.depth));return t(s.lift(r,Object(o.k)(r)).scrollIntoView()),!0}(t,n,e,c):function(e,t,n){for(var r=e.tr,s=n.parent,a=n.end,c=n.endIndex-1,l=n.startIndex;c>l;c--)a-=s.child(c).nodeSize,r.delete(a-1,a+1);var u=r.doc.resolve(n.start),p=u.nodeAfter,h=0==n.startIndex,d=n.endIndex==s.childCount,f=u.node(-1),m=u.index(-1);if(!f.canReplace(m+(h?0:1),m+1,p.content.append(d?i.Fragment.empty:i.Fragment.from(s))))return!1;var v=u.pos,g=v+p.nodeSize;return r.step(new o.b(v-(h?1:0),g+(d?1:0),v+1,g-1,new i.Slice((h?i.Fragment.empty:i.Fragment.from(s.copy(i.Fragment.empty))).append(d?i.Fragment.empty:i.Fragment.from(s.copy(i.Fragment.empty))),h?0:1,d?0:1),h?0:1)),t(r.scrollIntoView()),!0}(t,n,c)))}}function l(e){return function(t,n){var r=t.selection,s=r.$from,a=r.$to,c=s.blockRange(a,function(t){return t.childCount&&t.firstChild.type==e});if(!c)return!1;var l=c.startIndex;if(0==l)return!1;var u=c.parent,p=u.child(l-1);if(p.type!=e)return!1;if(n){var h=p.lastChild&&p.lastChild.type==u.type,d=i.Fragment.from(h?e.create():null),f=new i.Slice(i.Fragment.from(e.create(null,i.Fragment.from(u.type.create(null,d)))),h?3:1,0),m=c.start,v=c.end;n(t.tr.step(new o.b(m-(h?3:1),v,m,v,f,1,!0)).scrollIntoView())}return!0}}var u=n("+V57"),p=n("UxO+"),h=n("oV9I"),d=n("mG1W");
+/*!
+ * tiptap-commands v1.14.5
+ * (c) 2020 überdosis GbR (limited liability)
+ * @license MIT
+ */
+function f(e=""){return(t,n)=>{const{$from:r}=t.selection,{pos:o}=r.pos;return n(t.tr.insertText(e,o)),!0}}function m(e,t,n){return new u.a(e,(e,r,o,i)=>{const s=n instanceof Function?n(r):n,{tr:a}=e,c=r.length-1;let l=i,u=o;if(r[c]){const n=o+r[0].indexOf(r[c-1]),s=n+r[c-1].length-1,p=n+r[c-1].lastIndexOf(r[c]),h=p+r[c].length;if(function(e,t,n){let r=[];return n.doc.nodesBetween(e,t,(e,t)=>{r=[...r,...e.marks.map(n=>({start:t,end:t+e.nodeSize,mark:n}))]}),r}(o,i,e).filter(e=>{const{excluded:n}=e.mark.type;return n.find(e=>e.name===t.name)}).filter(e=>e.end>n).length)return!1;h<s&&a.delete(h,s),p>n&&a.delete(n,p),l=(u=n)+r[c].length}return a.addMark(u,l,t.create(s)),a.removeStoredMark(t),a})}function v(e,t,n){return new u.a(e,(e,r,o,i)=>{const s=n instanceof Function?n(r):n,{tr:a}=e;return r[0]&&a.replaceWith(o-1,i,t.create(s)),a})}function g(e,t,n){const r=o=>{const s=[];return o.forEach(o=>{if(o.isText){const{text:r}=o;let i,a=0;do{if(i=e.exec(r)){const e=i.index,r=e+i[0].length,c=n instanceof Function?n(i[0]):n;e>0&&s.push(o.cut(a,e)),s.push(o.cut(e,r).mark(t.create(c).addToSet(o.marks))),a=r}}while(i);a<r.length&&s.push(o.cut(a))}else s.push(o.copy(r(o.content)))}),i.Fragment.fromArray(s)};return new p.Plugin({props:{transformPasted:e=>new i.Slice(r(e.content),e.openStart,e.openEnd)}})}function y(e,t,n){const r=(o,s)=>{const a=[];return o.forEach(o=>{if(o.isText){const{text:r,marks:i}=o;let c,l=0;const u=!!i.filter(e=>"link"===e.type.name)[0];for(;!u&&null!==(c=e.exec(r));)if(s&&s.type.allowsMarkType(t)&&c[1]){const e=c.index,r=e+c[0].length,i=e+c[0].indexOf(c[1]),s=i+c[1].length,u=n instanceof Function?n(c):n;e>0&&a.push(o.cut(l,e)),a.push(o.cut(i,s).mark(t.create(u).addToSet(o.marks))),l=r}l<r.length&&a.push(o.cut(l))}else a.push(o.copy(r(o.content,o)))}),i.Fragment.fromArray(a)};return new p.Plugin({props:{transformPasted:e=>new i.Slice(r(e.content),e.openStart,e.openEnd)}})}function b(e){return(t,n)=>{const{tr:r,selection:o}=t;let{from:i,to:s}=o;const{$from:a,empty:c}=o;if(c){const t=Object(h.b)(a,e);i=t.from,s=t.to}return r.removeMark(i,s,e),n(r)}}function w(e=null,t,n={}){return(r,o)=>{const{$from:i,$to:s}=r.selection,a=i.index(),c=e?e.from:i.pos,l=e?e.to:s.pos;return!!i.parent.canReplaceWith(a,a,t)&&(o&&o(r.tr.replaceWith(c,l,t.create(n))),!0)}}function S(e){return function(t,n){const{$from:r,$to:o,node:s}=t.selection;if(s&&s.isBlock||r.depth<2||!r.sameParent(o))return!1;const a=r.node(-1);if(a.type!=e)return!1;if(0==r.parent.content.size){if(2==r.depth||r.node(-3).type!=e||r.index(-2)!=r.node(-2).childCount-1)return!1;if(n){let o=i.Fragment.empty;const s=r.index(-1)>0;for(let e=r.depth-(s?1:2);e>=r.depth-3;e--)o=i.Fragment.from(r.node(e).copy(o));o=o.append(i.Fragment.from(e.createAndFill()));const a=t.tr.replace(r.before(s?null:-1),r.after(-3),new i.Slice(o,s?3:2,2));a.setSelection(t.selection.constructor.near(a.doc.resolve(r.pos+(s?3:2)))),n(a.scrollIntoView())}return!0}const c=o.pos==r.end()?a.contentMatchAt(r.indexAfter(-1)).defaultType:null,l=t.tr.delete(r.pos,o.pos);let u=c&&[{type:e},{type:c}];return u||(u=[{type:e},null]),!!function(e,t,n=1,r){const o=e.resolve(t),i=o.depth-n,s=r&&r[r.length-1]||o.parent;if(i<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!s.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let l=o.depth-1,u=n-2;l>i;l--,u--){const e=o.node(l),t=o.index(l);if(e.type.spec.isolating)return!1;let n=e.content.cutByIndex(t,e.childCount);const i=r&&r[u]||e;if(i!=e&&(n=n.replaceChild(0,i.type.create(i.attrs))),!e.canReplace(t+1,e.childCount))return!1}const a=o.indexAfter(i),c=r&&r[0];return o.node(i).canReplaceWith(a,a,c?c.type:o.node(i+1).type)}(l.doc,r.pos,2,u)&&(n&&n(l.split(r.pos,2,u).scrollIntoView()),!0)}}function x(e,t,n={}){return(o,i,s)=>{return Object(h.f)(o,e,n)?Object(r.e)(t)(o,i,s):Object(r.e)(e,n)(o,i,s)}}function k(e,t){return e.type===t.nodes.bullet_list||e.type===t.nodes.ordered_list||e.type===t.nodes.todo_list}function C(e,t){return(n,r,o)=>{const{schema:i,selection:a}=n,{$from:l,$to:u}=a,p=l.blockRange(u);if(!p)return!1;const h=Object(d.findParentNode)(e=>k(e,i))(a);if(p.depth>=1&&h&&p.depth-h.depth<=1){if(h.node.type===e)return c(t)(n,r,o);if(k(h.node,i)&&e.validContent(h.node.content)){const{tr:t}=n;return t.setNodeMarkup(h.pos,e),r&&r(t),!1}}return s(e)(n,r,o)}}function O(e,t={}){return(n,o,i)=>{return Object(h.f)(n,e,t)?Object(r.d)(n,o):Object(r.g)(e,t)(n,o,i)}}function M(e,t){return(n,r)=>{const{tr:o,selection:i,doc:s}=n;let{from:a,to:c}=i;const{$from:l,empty:u}=i;if(u){const t=Object(h.b)(l,e);a=t.from,c=t.to}return s.rangeHasMark(a,c,e)&&o.removeMark(a,c,e),o.addMark(a,c,e.create(t)),r(o)}}},rUJ1:function(e,t){const n=/[&<>"']/,r=/[&<>"']/g,o=/[<>"']|&(?!#?\w+;)/,i=/[<>"']|&(?!#?\w+;)/g,s={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},a=e=>s[e];const c=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function l(e){return e.replace(c,(e,t)=>"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):"")}const u=/(^|[^\[])\^/g;const p=/[^\w:]/g,h=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;const d={},f=/^[^:]+:\/*[^/]*$/,m=/^([^:]+:)[\s\S]*$/,v=/^([^:]+:\/*[^/]*)[\s\S]*$/;function g(e,t){d[" "+e]||(f.test(e)?d[" "+e]=e+"/":d[" "+e]=y(e,"/",!0));const n=-1===(e=d[" "+e]).indexOf(":");return"//"===t.substring(0,2)?n?t:e.replace(m,"$1")+t:"/"===t.charAt(0)?n?t:e.replace(v,"$1")+t:e+t}function y(e,t,n){const r=e.length;if(0===r)return"";let o=0;for(;o<r;){const i=e.charAt(r-o-1);if(i!==t||n){if(i===t||!n)break;o++}else o++}return e.substr(0,r-o)}e.exports={escape:function(e,t){if(t){if(n.test(e))return e.replace(r,a)}else if(o.test(e))return e.replace(i,a);return e},unescape:l,edit:function(e,t){e=e.source||e,t=t||"";const n={replace:(t,r)=>(r=(r=r.source||r).replace(u,"$1"),e=e.replace(t,r),n),getRegex:()=>new RegExp(e,t)};return n},cleanUrl:function(e,t,n){if(e){let e;try{e=decodeURIComponent(l(n)).replace(p,"").toLowerCase()}catch(e){return null}if(0===e.indexOf("javascript:")||0===e.indexOf("vbscript:")||0===e.indexOf("data:"))return null}t&&!h.test(n)&&(n=g(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch(e){return null}return n},resolveUrl:g,noopTest:{exec:function(){}},merge:function(e){let t,n,r=1;for(;r<arguments.length;r++)for(n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},splitCells:function(e,t){const n=e.replace(/\|/g,(e,t,n)=>{let r=!1,o=t;for(;--o>=0&&"\\"===n[o];)r=!r;return r?"|":" |"}).split(/ \|/);let r=0;if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;r<n.length;r++)n[r]=n[r].trim().replace(/\\\|/g,"|");return n},rtrim:y,findClosingBracket:function(e,t){if(-1===e.indexOf(t[1]))return-1;const n=e.length;let r=0,o=0;for(;o<n;o++)if("\\"===e[o])o++;else if(e[o]===t[0])r++;else if(e[o]===t[1]&&--r<0)return o;return-1},checkSanitizeDeprecation:function(e){e&&e.sanitize&&!e.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}}},vbtb:function(e,t){function n(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,xhtml:!1}}e.exports={defaults:{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,xhtml:!1},getDefaults:n,changeDefaults:function(t){e.exports.defaults=t}}},zUJn:function(e,t,n){"use strict";n.d(t,"g",function(){return r.Plugin}),n.d(t,"h",function(){return r.PluginKey}),n.d(t,"a",function(){return fn}),n.d(t,"b",function(){return mn}),n.d(t,"c",function(){return gn}),n.d(t,"d",function(){return on}),n.d(t,"e",function(){return an}),n.d(t,"f",function(){return ln});var r=n("UxO+"),o=n("MEpN"),i=n("CsC6"),s={};if("undefined"!=typeof navigator&&"undefined"!=typeof document){var a=/Edge\/(\d+)/.exec(navigator.userAgent),c=/MSIE \d/.test(navigator.userAgent),l=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);s.mac=/Mac/.test(navigator.platform);var u=s.ie=!!(c||l||a);s.ie_version=c?document.documentMode||6:l?+l[1]:a?+a[1]:null,s.gecko=!u&&/gecko\/(\d+)/i.test(navigator.userAgent),s.gecko_version=s.gecko&&+(/Firefox\/(\d+)/.exec(navigator.userAgent)||[0,0])[1];var p=!u&&/Chrome\/(\d+)/.exec(navigator.userAgent);s.chrome=!!p,s.chrome_version=p&&+p[1],s.ios=!u&&/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent),s.android=/Android \d/.test(navigator.userAgent),s.webkit="webkitFontSmoothing"in document.documentElement.style,s.safari=/Apple Computer/.test(navigator.vendor),s.webkit_version=s.webkit&&+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]}var h=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},d=function(e){var t=e.parentNode;return t&&11==t.nodeType?t.host:t},f=function(e,t,n){var r=document.createRange();return r.setEnd(e,null==n?e.nodeValue.length:n),r.setStart(e,t||0),r},m=function(e,t,n,r){return n&&(g(e,t,n,r,-1)||g(e,t,n,r,1))},v=/^(img|br|input|textarea|hr)$/i;function g(e,t,n,r,o){for(;;){if(e==n&&t==r)return!0;if(t==(o<0?0:y(e))){var i=e.parentNode;if(1!=i.nodeType||b(e)||v.test(e.nodeName)||"false"==e.contentEditable)return!1;t=h(e)+(o<0?0:1),e=i}else{if(1!=e.nodeType)return!1;if("false"==(e=e.childNodes[t+(o<0?-1:0)]).contentEditable)return!1;t=o<0?y(e):0}}}function y(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function b(e){for(var t,n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}var w=function(e){var t=e.isCollapsed;return t&&s.chrome&&e.rangeCount&&!e.getRangeAt(0).collapsed&&(t=!1),t};function S(e,t){var n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}function x(e){return{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function k(e,t){return"number"==typeof e?e:e[t]}function C(e){var t=e.getBoundingClientRect();return{left:t.left,right:t.left+e.clientWidth,top:t.top,bottom:t.top+e.clientHeight}}function O(e,t,n){for(var r=e.someProp("scrollThreshold")||0,o=e.someProp("scrollMargin")||5,i=e.dom.ownerDocument,s=n||e.dom;s;s=d(s))if(1==s.nodeType){var a=s==i.body||1!=s.nodeType,c=a?x(i):C(s),l=0,u=0;if(t.top<c.top+k(r,"top")?u=-(c.top-t.top+k(o,"top")):t.bottom>c.bottom-k(r,"bottom")&&(u=t.bottom-c.bottom+k(o,"bottom")),t.left<c.left+k(r,"left")?l=-(c.left-t.left+k(o,"left")):t.right>c.right-k(r,"right")&&(l=t.right-c.right+k(o,"right")),l||u)if(a)i.defaultView.scrollBy(l,u);else{var p=s.scrollLeft,h=s.scrollTop;u&&(s.scrollTop+=u),l&&(s.scrollLeft+=l);var f=s.scrollLeft-p,m=s.scrollTop-h;t={left:t.left-f,top:t.top-m,right:t.right-f,bottom:t.bottom-m}}if(a)break}}function M(e){for(var t=[],n=e.ownerDocument;e&&(t.push({dom:e,top:e.scrollTop,left:e.scrollLeft}),e!=n);e=d(e));return t}function N(e,t){for(var n=0;n<e.length;n++){var r=e[n],o=r.dom,i=r.top,s=r.left;o.scrollTop!=i+t&&(o.scrollTop=i+t),o.scrollLeft!=s&&(o.scrollLeft=s)}}var T=null;function D(e,t){for(var n,r,o=2e8,i=0,s=t.top,a=t.top,c=e.firstChild,l=0;c;c=c.nextSibling,l++){var u=void 0;if(1==c.nodeType)u=c.getClientRects();else{if(3!=c.nodeType)continue;u=f(c).getClientRects()}for(var p=0;p<u.length;p++){var h=u[p];if(h.top<=s&&h.bottom>=a){s=Math.max(h.bottom,s),a=Math.min(h.top,a);var d=h.left>t.left?h.left-t.left:h.right<t.left?t.left-h.right:0;if(d<o){n=c,o=d,r=d&&3==n.nodeType?{left:h.right<t.left?h.right:h.left,top:t.top}:t,1==c.nodeType&&d&&(i=l+(t.left>=(h.left+h.right)/2?1:0));continue}}!n&&(t.left>=h.right&&t.top>=h.top||t.left>=h.left&&t.top>=h.bottom)&&(i=l+1)}}return n&&3==n.nodeType?function(e,t){for(var n=e.nodeValue.length,r=document.createRange(),o=0;o<n;o++){r.setEnd(e,o+1),r.setStart(e,o);var i=R(r,1);if(i.top!=i.bottom&&A(t,i))return{node:e,offset:o+(t.left>=(i.left+i.right)/2?1:0)}}return{node:e,offset:0}}(n,r):!n||o&&1==n.nodeType?{node:e,offset:i}:D(n,r)}function A(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function E(e,t){var n,r,o,i,a=e.root;if(a.caretPositionFromPoint)try{var c=a.caretPositionFromPoint(t.left,t.top);c&&(o=(n=c).offsetNode,i=n.offset)}catch(e){}if(!o&&a.caretRangeFromPoint){var l=a.caretRangeFromPoint(t.left,t.top);l&&(o=(r=l).startContainer,i=r.startOffset)}var u,p=a.elementFromPoint(t.left,t.top+1);if(!p||!e.dom.contains(1!=p.nodeType?p.parentNode:p)){var h=e.dom.getBoundingClientRect();if(!A(t,h))return null;if(!(p=function e(t,n,r){var o=t.childNodes.length;if(o&&r.top<r.bottom)for(var i=Math.max(0,Math.min(o-1,Math.floor(o*(n.top-r.top)/(r.bottom-r.top))-2)),s=i;;){var a=t.childNodes[s];if(1==a.nodeType)for(var c=a.getClientRects(),l=0;l<c.length;l++){var u=c[l];if(A(n,u))return e(a,n,u)}if((s=(s+1)%o)==i)break}return t}(e.dom,t,h)))return null}if(s.safari&&p.draggable&&(o=i=null),p=function(e,t){var n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}(p,t),o){if(s.gecko&&1==o.nodeType&&(i=Math.min(i,o.childNodes.length))<o.childNodes.length){var d,f=o.childNodes[i];"IMG"==f.nodeName&&(d=f.getBoundingClientRect()).right<=t.left&&d.bottom>t.top&&i++}o==e.dom&&i==o.childNodes.length-1&&1==o.lastChild.nodeType&&t.top>o.lastChild.getBoundingClientRect().bottom?u=e.state.doc.content.size:0!=i&&1==o.nodeType&&"BR"==o.childNodes[i-1].nodeName||(u=function(e,t,n,r){for(var o=-1,i=t;i!=e.dom;){var s=e.docView.nearestDesc(i,!0);if(!s)return null;if(s.node.isBlock&&s.parent){var a=s.dom.getBoundingClientRect();if(a.left>r.left||a.top>r.top)o=s.posBefore;else{if(!(a.right<r.left||a.bottom<r.top))break;o=s.posAfter}}i=s.dom.parentNode}return o>-1?o:e.docView.posFromDOM(t,n)}(e,o,i,t))}null==u&&(u=function(e,t,n){var r=D(t,n),o=r.node,i=r.offset,s=-1;if(1==o.nodeType&&!o.firstChild){var a=o.getBoundingClientRect();s=a.left!=a.right&&n.left>(a.left+a.right)/2?1:-1}return e.docView.posFromDOM(o,i,s)}(e,p,t));var m=e.docView.nearestDesc(p,!0);return{pos:u,inside:m?m.posAtStart-m.border:-1}}function R(e,t){var n=e.getClientRects();return n.length?n[t<0?0:n.length-1]:e.getBoundingClientRect()}function _(e,t){var n=e.docView.domFromPos(t),r=n.node,o=n.offset;if(3==r.nodeType&&(s.webkit||s.gecko)){var i=R(f(r,o,o),0);if(s.gecko&&o&&/\s/.test(r.nodeValue[o-1])&&o<r.nodeValue.length){var a=R(f(r,o-1,o-1),-1);if(a.top==i.top){var c=R(f(r,o,o+1),-1);if(c.top!=i.top)return P(c,c.left<a.left)}}return i}if(1==r.nodeType&&!e.state.doc.resolve(t).parent.inlineContent){var l,u=!0;if(o<r.childNodes.length){var p=r.childNodes[o];1==p.nodeType&&(l=p.getBoundingClientRect())}if(!l&&o){var h=r.childNodes[o-1];1==h.nodeType&&(l=h.getBoundingClientRect(),u=!1)}return function(e,t){if(0==e.height)return e;var n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}(l||r.getBoundingClientRect(),u)}for(var d=-1;d<2;d+=2)if(d<0&&o){var m=void 0,v=3==r.nodeType?f(r,o-1,o):3==(m=r.childNodes[o-1]).nodeType?f(m):1==m.nodeType&&"BR"!=m.nodeName?m:null;if(v){var g=R(v,1);if(g.top<g.bottom)return P(g,!1)}}else if(d>0&&o<y(r)){var b=void 0,w=3==r.nodeType?f(r,o,o+1):3==(b=r.childNodes[o]).nodeType?f(b):1==b.nodeType?b:null;if(w){var S=R(w,-1);if(S.top<S.bottom)return P(S,!0)}}return P(R(3==r.nodeType?f(r):r,0),!1)}function P(e,t){if(0==e.width)return e;var n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function $(e,t,n){var r=e.state,o=e.root.activeElement;r!=t&&e.updateState(t),o!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),o!=e.dom&&o&&o.focus()}}var I=/[\u0590-\u08ac]/;var z=null,B=null,F=!1;function V(e,t,n){return z==t&&B==n?F:(z=t,B=n,F="up"==n||"down"==n?function(e,t,n){var r=t.selection,o="up"==n?r.$anchor.min(r.$head):r.$anchor.max(r.$head);return $(e,t,function(){for(var t=e.docView.domFromPos(o.pos).node;;){var r=e.docView.nearestDesc(t,!0);if(!r)break;if(r.node.isBlock){t=r.dom;break}t=r.dom.parentNode}for(var i=_(e,o.pos),s=t.firstChild;s;s=s.nextSibling){var a=void 0;if(1==s.nodeType)a=s.getClientRects();else{if(3!=s.nodeType)continue;a=f(s,0,s.nodeValue.length).getClientRects()}for(var c=0;c<a.length;c++){var l=a[c];if(l.bottom>l.top&&("up"==n?l.bottom<i.top+1:l.top>i.bottom-1))return!1}}return!0})}(e,t,n):function(e,t,n){var r=t.selection.$head;if(!r.parent.isTextblock)return!1;var o=r.parentOffset,i=!o,s=o==r.parent.content.size,a=getSelection();return I.test(r.parent.textContent)&&a.modify?$(e,t,function(){var t=a.getRangeAt(0),o=a.focusNode,i=a.focusOffset,s=a.caretBidiLevel;a.modify("move",n,"character");var c=!(r.depth?e.docView.domAfterPos(r.before()):e.dom).contains(1==a.focusNode.nodeType?a.focusNode:a.focusNode.parentNode)||o==a.focusNode&&i==a.focusOffset;return a.removeAllRanges(),a.addRange(t),null!=s&&(a.caretBidiLevel=s),c}):"left"==n||"backward"==n?i:s}(e,t,n))}var j=function(e,t,n,r){this.parent=e,this.children=t,this.dom=n,n.pmViewDesc=this,this.contentDOM=r,this.dirty=0},L={beforePosition:{configurable:!0},size:{configurable:!0},border:{configurable:!0},posBefore:{configurable:!0},posAtStart:{configurable:!0},posAfter:{configurable:!0},posAtEnd:{configurable:!0},contentLost:{configurable:!0}};j.prototype.matchesWidget=function(){return!1},j.prototype.matchesMark=function(){return!1},j.prototype.matchesNode=function(){return!1},j.prototype.matchesHack=function(){return!1},L.beforePosition.get=function(){return!1},j.prototype.parseRule=function(){return null},j.prototype.stopEvent=function(){return!1},L.size.get=function(){for(var e=0,t=0;t<this.children.length;t++)e+=this.children[t].size;return e},L.border.get=function(){return 0},j.prototype.destroy=function(){this.parent=null,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=null);for(var e=0;e<this.children.length;e++)this.children[e].destroy()},j.prototype.posBeforeChild=function(e){for(var t=0,n=this.posAtStart;t<this.children.length;t++){var r=this.children[t];if(r==e)return n;n+=r.size}},L.posBefore.get=function(){return this.parent.posBeforeChild(this)},L.posAtStart.get=function(){return this.parent?this.parent.posBeforeChild(this)+this.border:0},L.posAfter.get=function(){return this.posBefore+this.size},L.posAtEnd.get=function(){return this.posAtStart+this.size-2*this.border},j.prototype.localPosFromDOM=function(e,t,n){if(this.contentDOM&&this.contentDOM.contains(1==e.nodeType?e:e.parentNode)){if(n<0){var r,o;if(e==this.contentDOM)r=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;r=e.previousSibling}for(;r&&(!(o=r.pmViewDesc)||o.parent!=this);)r=r.previousSibling;return r?this.posBeforeChild(o)+o.size:this.posAtStart}var i,s;if(e==this.contentDOM)i=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;i=e.nextSibling}for(;i&&(!(s=i.pmViewDesc)||s.parent!=this);)i=i.nextSibling;return i?this.posBeforeChild(s):this.posAtEnd}var a;if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))a=2&e.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==t)for(var c=e;;c=c.parentNode){if(c==this.dom){a=!1;break}if(c.parentNode.firstChild!=c)break}if(null==a&&t==e.childNodes.length)for(var l=e;;l=l.parentNode){if(l==this.dom){a=!0;break}if(l.parentNode.lastChild!=l)break}}return(null==a?n>0:a)?this.posAtEnd:this.posAtStart},j.prototype.nearestDesc=function(e,t){for(var n=!0,r=e;r;r=r.parentNode){var o=this.getDesc(r);if(o&&(!t||o.node)){if(!n||!o.nodeDOM||(1==o.nodeDOM.nodeType?o.nodeDOM.contains(1==e.nodeType?e:e.parentNode):o.nodeDOM==e))return o;n=!1}}},j.prototype.getDesc=function(e){for(var t=e.pmViewDesc,n=t;n;n=n.parent)if(n==this)return t},j.prototype.posFromDOM=function(e,t,n){for(var r=e;r;r=r.parentNode){var o=this.getDesc(r);if(o)return o.localPosFromDOM(e,t,n)}return-1},j.prototype.descAt=function(e){for(var t=0,n=0;t<this.children.length;t++){var r=this.children[t],o=n+r.size;if(n==e&&o!=n){for(;!r.border&&r.children.length;)r=r.children[0];return r}if(e<o)return r.descAt(e-n-r.border);n=o}},j.prototype.domFromPos=function(e){if(!this.contentDOM)return{node:this.dom,offset:0};for(var t=0,n=0;;n++){if(t==e){for(;n<this.children.length&&(this.children[n].beforePosition||this.children[n].dom.parentNode!=this.contentDOM);)n++;return{node:this.contentDOM,offset:n==this.children.length?this.contentDOM.childNodes.length:h(this.children[n].dom)}}if(n==this.children.length)throw new Error("Invalid position "+e);var r=this.children[n],o=t+r.size;if(e<o)return r.domFromPos(e-t-r.border);t=o}},j.prototype.parseRange=function(e,t,n){if(void 0===n&&(n=0),0==this.children.length)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};for(var r=-1,o=-1,i=n,s=0;;s++){var a=this.children[s],c=i+a.size;if(-1==r&&e<=c){var l=i+a.border;if(e>=l&&t<=c-a.border&&a.node&&a.contentDOM&&this.contentDOM.contains(a.contentDOM))return a.parseRange(e,t,l);e=i;for(var u=s;u>0;u--){var p=this.children[u-1];if(p.size&&p.dom.parentNode==this.contentDOM&&!p.emptyChildAt(1)){r=h(p.dom)+1;break}e-=p.size}-1==r&&(r=0)}if(r>-1&&(c>t||s==this.children.length-1)){t=c;for(var d=s+1;d<this.children.length;d++){var f=this.children[d];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(-1)){o=h(f.dom);break}t+=f.size}-1==o&&(o=this.contentDOM.childNodes.length);break}i=c}return{node:this.contentDOM,from:e,to:t,fromOffset:r,toOffset:o}},j.prototype.emptyChildAt=function(e){if(this.border||!this.contentDOM||!this.children.length)return!1;var t=this.children[e<0?0:this.children.length-1];return 0==t.size||t.emptyChildAt(e)},j.prototype.domAfterPos=function(e){var t=this.domFromPos(e),n=t.node,r=t.offset;if(1!=n.nodeType||r==n.childNodes.length)throw new RangeError("No node after pos "+e);return n.childNodes[r]},j.prototype.setSelection=function(e,t,n,r){for(var o=Math.min(e,t),i=Math.max(e,t),a=0,c=0;a<this.children.length;a++){var l=this.children[a],u=c+l.size;if(o>c&&i<u)return l.setSelection(e-c-l.border,t-c-l.border,n,r);c=u}var p=this.domFromPos(e),h=this.domFromPos(t),d=n.getSelection();if(r||!m(p.node,p.offset,d.anchorNode,d.anchorOffset)||!m(h.node,h.offset,d.focusNode,d.focusOffset)){var f=!1;if(s.gecko&&e==t){var v=p.node.childNodes[p.offset-1];v&&"BR"==v.nodeName&&(f=!0)}var g=!1;if((d.extend||e==t)&&!f){d.collapse(p.node,p.offset);try{e!=t&&d.extend(h.node,h.offset),g=!0}catch(e){if(!(e instanceof DOMException))throw e}}if(!g){if(e>t){var y=p;p=h,h=y}var b=document.createRange();b.setEnd(h.node,h.offset),b.setStart(p.node,p.offset),d.removeAllRanges(),d.addRange(b)}}},j.prototype.ignoreMutation=function(e){return!this.contentDOM&&"selection"!=e.type},L.contentLost.get=function(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)},j.prototype.markDirty=function(e,t){for(var n=0,r=0;r<this.children.length;r++){var o=this.children[r],i=n+o.size;if(n==i?e<=i&&t>=n:e<i&&t>n){var s=n+o.border,a=i-o.border;if(e>=s&&t<=a)return this.dirty=e==n||t==i?2:1,void(e!=s||t!=a||!o.contentLost&&o.dom.parentNode==this.contentDOM?o.markDirty(e-s,t-s):o.dirty=3);o.dirty=3}n=i}this.dirty=2},j.prototype.markParentsDirty=function(){for(var e=1,t=this.parent;t;t=t.parent,e++){var n=1==e?2:1;t.dirty<n&&(t.dirty=n)}},Object.defineProperties(j.prototype,L);var q=[],W=function(e){function t(t,n,r,o){var i,s=n.type.toDOM;if("function"==typeof s&&(s=s(r,function(){return i?i.parent?i.parent.posBeforeChild(i):void 0:o})),!n.type.spec.raw){if(1!=s.nodeType){var a=document.createElement("span");a.appendChild(s),s=a}s.contentEditable=!1,s.classList.add("ProseMirror-widget")}e.call(this,t,q,s,null),this.widget=n,i=this}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={beforePosition:{configurable:!0}};return n.beforePosition.get=function(){return this.widget.type.side<0},t.prototype.matchesWidget=function(e){return 0==this.dirty&&e.type.eq(this.widget.type)},t.prototype.parseRule=function(){return{ignore:!0}},t.prototype.stopEvent=function(e){var t=this.widget.spec.stopEvent;return!!t&&t(e)},t.prototype.ignoreMutation=function(e){return"selection"!=e.type||this.widget.spec.ignoreSelection},Object.defineProperties(t.prototype,n),t}(j),K=function(e){function t(t,n,r,o){e.call(this,t,q,n,null),this.textDOM=r,this.text=o}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={size:{configurable:!0}};return n.size.get=function(){return this.text.length},t.prototype.localPosFromDOM=function(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t},t.prototype.domFromPos=function(e){return{node:this.textDOM,offset:e}},t.prototype.ignoreMutation=function(e){return"characterData"===e.type&&e.target.nodeValue==e.oldValue},Object.defineProperties(t.prototype,n),t}(j),J=function(e){function t(t,n,r,o){e.call(this,t,[],r,o),this.mark=n}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.create=function(e,n,r,i){var s=i.nodeViews[n.type.name],a=s&&s(n,i,r);return a&&a.dom||(a=o.DOMSerializer.renderSpec(document,n.type.spec.toDOM(n,r))),new t(e,n,a.dom,a.contentDOM||a.dom)},t.prototype.parseRule=function(){return{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}},t.prototype.matchesMark=function(e){return 3!=this.dirty&&this.mark.eq(e)},t.prototype.markDirty=function(t,n){if(e.prototype.markDirty.call(this,t,n),0!=this.dirty){for(var r=this.parent;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=0}},t.prototype.slice=function(e,n,r){var o=t.create(this.parent,this.mark,!0,r),i=this.children,s=this.size;n<s&&(i=ce(i,n,s,r)),e>0&&(i=ce(i,0,e,r));for(var a=0;a<i.length;a++)i[a].parent=o;return o.children=i,o},t}(j),H=function(e){function t(t,n,r,o,i,s,a,c,l){e.call(this,t,n.isLeaf?q:[],i,s),this.nodeDOM=a,this.node=n,this.outerDeco=r,this.innerDeco=o,s&&this.updateChildren(c,l)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={size:{configurable:!0},border:{configurable:!0}};return t.create=function(e,n,r,i,s,a){var c,l,u=s.nodeViews[n.type.name],p=u&&u(n,s,function(){return l?l.parent?l.parent.posBeforeChild(l):void 0:a},r),h=p&&p.dom,d=p&&p.contentDOM;if(n.isText)if(h){if(3!=h.nodeType)throw new RangeError("Text must be rendered as a DOM text node")}else h=document.createTextNode(n.text);else h||(h=(c=o.DOMSerializer.renderSpec(document,n.type.spec.toDOM(n))).dom,d=c.contentDOM);d||n.isText||"BR"==h.nodeName||(h.hasAttribute("contenteditable")||(h.contentEditable=!1),n.type.spec.draggable&&(h.draggable=!0));var f=h;return h=re(h,r,n),p?l=new Z(e,n,r,i,h,d,f,p,s,a+1):n.isText?new G(e,n,r,i,h,f,s):new t(e,n,r,i,h,d,f,s,a+1)},t.prototype.parseRule=function(){var e=this;if(this.node.type.spec.reparseInView)return null;var t={node:this.node.type.name,attrs:this.node.attrs};return this.node.type.spec.code&&(t.preserveWhitespace="full"),this.contentDOM&&!this.contentLost?t.contentElement=this.contentDOM:t.getContent=function(){return e.contentDOM?o.Fragment.empty:e.node.content},t},t.prototype.matchesNode=function(e,t,n){return 0==this.dirty&&e.eq(this.node)&&oe(t,this.outerDeco)&&n.eq(this.innerDeco)},n.size.get=function(){return this.node.nodeSize},n.border.get=function(){return this.node.isLeaf?0:1},t.prototype.updateChildren=function(e,t){var n=this,r=this.node.inlineContent,i=t,a=r&&e.composing&&this.localCompositionNode(e,t),c=new se(this,a&&a.node);!function(e,t,n,r){var o=t.locals(e),i=0;if(0==o.length){for(var s=0;s<e.childCount;s++){var a=e.child(s);r(a,o,t.forChild(i,a),s),i+=a.nodeSize}return}for(var c=0,l=[],u=null,p=0;;){if(c<o.length&&o[c].to==i){for(var h=o[c++],d=void 0;c<o.length&&o[c].to==i;)(d||(d=[h])).push(o[c++]);if(d){d.sort(ae);for(var f=0;f<d.length;f++)n(d[f],p,!!u)}else n(h,p,!!u)}var m=void 0,v=void 0;if(u)v=-1,m=u,u=null;else{if(!(p<e.childCount))break;v=p,m=e.child(p++)}for(var g=0;g<l.length;g++)l[g].to<=i&&l.splice(g--,1);for(;c<o.length&&o[c].from<=i&&o[c].to>i;)l.push(o[c++]);var y=i+m.nodeSize;if(m.isText){var b=y;c<o.length&&o[c].from<b&&(b=o[c].from);for(var w=0;w<l.length;w++)l[w].to<b&&(b=l[w].to);b<y&&(u=m.cut(b-i),m=m.cut(0,b-i),y=b,v=-1)}var S=l.length?m.isInline&&!m.isLeaf?l.filter(function(e){return!e.inline}):l.slice():q;r(m,S,t.forChild(i,m),v),i=y}}(this.node,this.innerDeco,function(t,s,a){t.spec.marks?c.syncToMarks(t.spec.marks,r,e):t.type.side>=0&&!a&&c.syncToMarks(s==n.node.childCount?o.Mark.none:n.node.child(s).marks,r,e),c.placeWidget(t,e,i)},function(t,n,o,s){c.syncToMarks(t.marks,r,e),c.findNodeMatch(t,n,o,s)||c.updateNextNode(t,n,o,e,s)||c.addNode(t,n,o,e,i),i+=t.nodeSize}),c.syncToMarks(q,r,e),this.node.isTextblock&&c.addTextblockHacks(),c.destroyRest(),(c.changed||2==this.dirty)&&(a&&this.protectLocalComposition(e,a),function e(t,n,r){var o=t.firstChild,i=!1;for(var s=0;s<n.length;s++){var a=n[s],c=a.dom;if(c.parentNode==t){for(;c!=o;)o=ie(o),i=!0;o=o.nextSibling}else i=!0,t.insertBefore(c,o);if(a instanceof J){var l=o?o.previousSibling:t.lastChild;e(a.contentDOM,a.children,r),o=l?l.nextSibling:t.firstChild}}for(;o;)o=ie(o),i=!0;i&&r.trackWrites==t&&(r.trackWrites=null)}(this.contentDOM,this.children,e),s.ios&&function(e){if("UL"==e.nodeName||"OL"==e.nodeName){var t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}(this.dom))},t.prototype.localCompositionNode=function(e,t){var n=e.state.selection,o=n.from,i=n.to;if(!(!(e.state.selection instanceof r.TextSelection)||o<t||i>t+this.node.content.size)){var s=e.root.getSelection(),a=function(e,t){for(;;){if(3==e.nodeType)return e;if(1==e.nodeType&&t>0){if(e.childNodes.length>t&&3==e.childNodes[t].nodeType)return e.childNodes[t];e=e.childNodes[t-1],t=y(e)}else{if(!(1==e.nodeType&&t<e.childNodes.length))return null;e=e.childNodes[t],t=0}}}(s.focusNode,s.focusOffset);if(a&&this.dom.contains(a.parentNode)){var c=a.nodeValue,l=function(e,t,n,r){for(var o=0,i=0;o<e.childCount&&i<=r;){var s=e.child(o++),a=i;if(i+=s.nodeSize,s.isText){for(var c=s.text;o<e.childCount;){var l=e.child(o++);if(i+=l.nodeSize,!l.isText)break;c+=l.text}if(i>=n){var u=c.lastIndexOf(t,r-a);if(u>=0&&u+t.length+a>=n)return a+u}}}return-1}(this.node.content,c,o-t,i-t);return l<0?null:{node:a,pos:l,text:c}}}},t.prototype.protectLocalComposition=function(e,t){var n=t.node,r=t.pos,o=t.text;if(!this.getDesc(n)){for(var i=n;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=null)}var s=new K(this,i,n,o);e.compositionNodes.push(s),this.children=ce(this.children,r,r+o.length,e,s)}},t.prototype.update=function(e,t,n,r){return!(3==this.dirty||!e.sameMarkup(this.node))&&(this.updateInner(e,t,n,r),!0)},t.prototype.updateInner=function(e,t,n,r){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=0},t.prototype.updateOuterDeco=function(e){if(!oe(e,this.outerDeco)){var t=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=te(this.dom,this.nodeDOM,ee(this.outerDeco,this.node,t),ee(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=null,this.dom.pmViewDesc=this),this.outerDeco=e}},t.prototype.selectNode=function(){this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.dom.draggable=!0)},t.prototype.deselectNode=function(){this.nodeDOM.classList.remove("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||this.dom.removeAttribute("draggable")},Object.defineProperties(t.prototype,n),t}(j);function U(e,t,n,r,o){return re(r,t,e),new H(null,e,t,n,r,r,r,o,0)}var G=function(e){function t(t,n,r,o,i,s,a){e.call(this,t,n,r,o,i,null,s,a)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.parseRule=function(){for(var e=this.nodeDOM.parentNode;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}},t.prototype.update=function(e,t,n,r){return!(3==this.dirty||0!=this.dirty&&!this.inParent()||!e.sameMarkup(this.node))&&(this.updateOuterDeco(t),0==this.dirty&&e.text==this.node.text||e.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=e.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=e,this.dirty=0,!0)},t.prototype.inParent=function(){for(var e=this.parent.contentDOM,t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1},t.prototype.domFromPos=function(e){return{node:this.nodeDOM,offset:e}},t.prototype.localPosFromDOM=function(t,n,r){return t==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):e.prototype.localPosFromDOM.call(this,t,n,r)},t.prototype.ignoreMutation=function(e){return"characterData"!=e.type&&"selection"!=e.type},t.prototype.slice=function(e,n,r){var o=this.node.cut(e,n),i=document.createTextNode(o.text);return new t(this.parent,o,this.outerDeco,this.innerDeco,i,i,r)},t}(H),X=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.parseRule=function(){return{ignore:!0}},t.prototype.matchesHack=function(){return 0==this.dirty},t}(j),Z=function(e){function t(t,n,r,o,i,s,a,c,l,u){e.call(this,t,n,r,o,i,s,a,l,u),this.spec=c}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.update=function(t,n,r,o){if(3==this.dirty)return!1;if(this.spec.update){var i=this.spec.update(t,n);return i&&this.updateInner(t,n,r,o),i}return!(!this.contentDOM&&!t.isLeaf)&&e.prototype.update.call(this,t,n,r,o)},t.prototype.selectNode=function(){this.spec.selectNode?this.spec.selectNode():e.prototype.selectNode.call(this)},t.prototype.deselectNode=function(){this.spec.deselectNode?this.spec.deselectNode():e.prototype.deselectNode.call(this)},t.prototype.setSelection=function(t,n,r,o){this.spec.setSelection?this.spec.setSelection(t,n,r):e.prototype.setSelection.call(this,t,n,r,o)},t.prototype.destroy=function(){this.spec.destroy&&this.spec.destroy(),e.prototype.destroy.call(this)},t.prototype.stopEvent=function(e){return!!this.spec.stopEvent&&this.spec.stopEvent(e)},t.prototype.ignoreMutation=function(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):e.prototype.ignoreMutation.call(this,t)},t}(H);function Y(e){e&&(this.nodeName=e)}Y.prototype=Object.create(null);var Q=[new Y];function ee(e,t,n){if(0==e.length)return Q;for(var r=n?Q[0]:new Y,o=[r],i=0;i<e.length;i++){var s=e[i].type.attrs,a=r;if(s)for(var c in s.nodeName&&o.push(a=new Y(s.nodeName)),s){var l=s[c];null!=l&&(n&&1==o.length&&o.push(a=r=new Y(t.isInline?"span":"div")),"class"==c?a.class=(a.class?a.class+" ":"")+l:"style"==c?a.style=(a.style?a.style+";":"")+l:"nodeName"!=c&&(a[c]=l))}}return o}function te(e,t,n,r){if(n==Q&&r==Q)return t;for(var o=t,i=0;i<r.length;i++){var s=r[i],a=n[i];if(i){var c=void 0;a&&a.nodeName==s.nodeName&&o!=e&&(c=o.parentNode)&&c.tagName.toLowerCase()==s.nodeName?o=c:((c=document.createElement(s.nodeName)).pmIsDeco=!0,c.appendChild(o),a=Q[0],o=c)}ne(o,a||Q[0],s)}return o}function ne(e,t,n){for(var r in t)"class"==r||"style"==r||"nodeName"==r||r in n||e.removeAttribute(r);for(var o in n)"class"!=o&&"style"!=o&&"nodeName"!=o&&n[o]!=t[o]&&e.setAttribute(o,n[o]);if(t.class!=n.class){for(var i=t.class?t.class.split(" "):q,s=n.class?n.class.split(" "):q,a=0;a<i.length;a++)-1==s.indexOf(i[a])&&e.classList.remove(i[a]);for(var c=0;c<s.length;c++)-1==i.indexOf(s[c])&&e.classList.add(s[c])}if(t.style!=n.style){if(t.style)for(var l,u=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g;l=u.exec(t.style);)e.style.removeProperty(l[1]);n.style&&(e.style.cssText+=n.style)}}function re(e,t,n){return te(e,e,Q,ee(t,n,1!=e.nodeType))}function oe(e,t){if(e.length!=t.length)return!1;for(var n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function ie(e){var t=e.nextSibling;return e.parentNode.removeChild(e),t}var se=function(e,t){this.top=e,this.lock=t,this.index=0,this.stack=[],this.changed=!1;var n=function(e,t){for(var n=[],r=e.childCount,o=t.length-1;r>0&&o>=0;o--){var i=t[o],s=i.node;if(s){if(s!=e.child(r-1))break;n.push(i),--r}}return{nodes:n.reverse(),offset:r}}(e.node.content,e.children);this.preMatched=n.nodes,this.preMatchOffset=n.offset};function ae(e,t){return e.type.side-t.type.side}function ce(e,t,n,r,o){for(var i=[],s=0,a=0;s<e.length;s++){var c=e[s],l=a,u=a+=c.size;l>=n||u<=t?i.push(c):(l<t&&i.push(c.slice(0,t-l,r)),o&&(i.push(o),o=null),u>n&&i.push(c.slice(n-l,c.size,r)))}return i}function le(e,t){var n=e.selection,o=n.$anchor,i=n.$head,s=t>0?o.max(i):o.min(i),a=s.parent.inlineContent?s.depth?e.doc.resolve(t>0?s.after():s.before()):null:s;return a&&r.Selection.findFrom(a,t)}function ue(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function pe(e,t,n){var o=e.state.selection;if(!(o instanceof r.TextSelection)){if(o instanceof r.NodeSelection&&o.node.isInline)return ue(e,new r.TextSelection(t>0?o.$to:o.$from));var i=le(e.state,t);return!!i&&ue(e,i)}if(!o.empty||n.indexOf("s")>-1)return!1;if(e.endOfTextblock(t>0?"right":"left")){var a=le(e.state,t);return!!(a&&a instanceof r.NodeSelection)&&ue(e,a)}if(!(s.mac&&n.indexOf("m")>-1)){var c,l=o.$head,u=l.textOffset?null:t<0?l.nodeBefore:l.nodeAfter;if(!u||u.isText)return!1;var p=t<0?l.pos-u.nodeSize:l.pos;return!!(u.isAtom||(c=e.docView.descAt(p))&&!c.contentDOM)&&(r.NodeSelection.isSelectable(u)?ue(e,new r.NodeSelection(t<0?e.state.doc.resolve(l.pos-u.nodeSize):l)):!!s.webkit&&ue(e,new r.TextSelection(e.state.doc.resolve(t<0?p:p+u.nodeSize))))}}function he(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function de(e){var t=e.pmViewDesc;return t&&0==t.size&&(e.nextSibling||"BR"!=e.nodeName)}function fe(e){var t=e.root.getSelection(),n=t.focusNode,r=t.focusOffset;if(n){var o,i,a=!1;for(s.gecko&&1==n.nodeType&&r<he(n)&&de(n.childNodes[r])&&(a=!0);;)if(r>0){if(1!=n.nodeType)break;var c=n.childNodes[r-1];if(de(c))o=n,i=--r;else{if(3!=c.nodeType)break;r=(n=c).nodeValue.length}}else{if(ve(n))break;for(var l=n.previousSibling;l&&de(l);)o=n.parentNode,i=h(l),l=l.previousSibling;if(l)r=he(n=l);else{if((n=n.parentNode)==e.dom)break;r=0}}a?ge(e,t,n,r):o&&ge(e,t,o,i)}}function me(e){var t=e.root.getSelection(),n=t.focusNode,r=t.focusOffset;if(n){for(var o,i,s=he(n);;)if(r<s){if(1!=n.nodeType)break;if(!de(n.childNodes[r]))break;o=n,i=++r}else{if(ve(n))break;for(var a=n.nextSibling;a&&de(a);)o=a.parentNode,i=h(a)+1,a=a.nextSibling;if(a)r=0,s=he(n=a);else{if((n=n.parentNode)==e.dom)break;r=s=0}}o&&ge(e,t,o,i)}}function ve(e){var t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function ge(e,t,n,r){if(w(t)){var o=document.createRange();o.setEnd(n,r),o.setStart(n,r),t.removeAllRanges(),t.addRange(o)}else t.extend&&t.extend(n,r);e.domObserver.setCurSelection()}function ye(e,t,n){var o=e.state.selection;if(o instanceof r.TextSelection&&!o.empty||n.indexOf("s")>-1)return!1;if(s.mac&&n.indexOf("m")>-1)return!1;var i=o.$from,a=o.$to;if(!i.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){var c=le(e.state,t);if(c&&c instanceof r.NodeSelection)return ue(e,c)}if(!i.parent.inlineContent){var l=r.Selection.findFrom(t<0?i:a,t);return!l||ue(e,l)}return!1}function be(e,t){if(!(e.state.selection instanceof r.TextSelection))return!0;var n=e.state.selection,o=n.$head,i=n.$anchor,s=n.empty;if(!o.sameParent(i))return!0;if(!s)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;var a=!o.textOffset&&(t<0?o.nodeBefore:o.nodeAfter);if(a&&!a.isText){var c=e.state.tr;return t<0?c.delete(o.pos-a.nodeSize,o.pos):c.delete(o.pos,o.pos+a.nodeSize),e.dispatch(c),!0}return!1}function we(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function Se(e,t){var n=t.keyCode,r=function(e){var t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}(t);return 8==n||s.mac&&72==n&&"c"==r?be(e,-1)||fe(e):46==n||s.mac&&68==n&&"c"==r?be(e,1)||me(e):13==n||27==n||(37==n?pe(e,-1,r)||fe(e):39==n?pe(e,1,r)||me(e):38==n?ye(e,-1,r)||fe(e):40==n?function(e){if(s.chrome&&!(e.state.selection.$head.parentOffset>0)){var t=e.root.getSelection(),n=t.focusNode,r=t.focusOffset;if(n&&1==n.nodeType&&0==r&&n.firstChild&&"false"==n.firstChild.contentEditable){var o=n.firstChild;we(e,o,!0),setTimeout(function(){return we(e,o,!1)},20)}}}(e)||ye(e,1,r)||me(e):r==(s.mac?"m":"c")&&(66==n||73==n||89==n||90==n))}function xe(e,t){var n=e.root.getSelection(),o=e.state.doc;if(!n.focusNode)return null;var i=e.docView.nearestDesc(n.focusNode),s=i&&0==i.size,a=e.docView.posFromDOM(n.focusNode,n.focusOffset);if(a<0)return null;var c,l,u=o.resolve(a);if(w(n)){for(c=u;i&&!i.node;)i=i.parent;if(i&&i.node.isAtom&&r.NodeSelection.isSelectable(i.node)&&i.parent&&(!i.node.isInline||!function(e,t,n){for(var r=0==t,o=t==y(e);r||o;){if(e==n)return!0;var i=h(e);if(!(e=e.parentNode))return!1;r=r&&0==i,o=o&&i==y(e)}}(n.focusNode,n.focusOffset,i.dom))){var p=i.posBefore;l=new r.NodeSelection(a==p?u:o.resolve(p))}}else{var d=e.docView.posFromDOM(n.anchorNode,n.anchorOffset);if(d<0)return null;c=o.resolve(d)}l||(l=Ae(e,c,u,"pointer"==t||e.state.selection.head<u.pos&&!s?1:-1));return l}function ke(e,t){var n=e.state.selection;if(Te(e,n),e.editable?e.hasFocus():Ee(e)&&document.activeElement&&document.activeElement.contains(e.dom)){if(e.domObserver.disconnectSelection(),e.cursorWrapper)!function(e){var t=e.root.getSelection(),n=document.createRange(),r=e.cursorWrapper.dom,o="IMG"==r.nodeName;o?n.setEnd(r.parentNode,h(r)+1):n.setEnd(r,0);n.collapse(!1),t.removeAllRanges(),t.addRange(n),!o&&!e.state.selection.visible&&s.ie&&s.ie_version<=11&&(r.disabled=!0,r.disabled=!1)}(e);else{var o,i,a=n.anchor,c=n.head;!Ce||n instanceof r.TextSelection||(n.$from.parent.inlineContent||(o=Oe(e,n.from)),n.empty||n.$from.parent.inlineContent||(i=Oe(e,n.to))),e.docView.setSelection(a,c,e.root,t),Ce&&(o&&Ne(o),i&&Ne(i)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&function(e){var t=e.dom.ownerDocument;t.removeEventListener("selectionchange",e.hideSelectionGuard);var n=e.root.getSelection(),r=n.anchorNode,o=n.anchorOffset;t.addEventListener("selectionchange",e.hideSelectionGuard=function(){n.anchorNode==r&&n.anchorOffset==o||(t.removeEventListener("selectionchange",e.hideSelectionGuard),e.dom.classList.remove("ProseMirror-hideselection"))})}(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}se.prototype.getPreMatch=function(e){return e>=this.preMatchOffset?this.preMatched[e-this.preMatchOffset]:null},se.prototype.destroyBetween=function(e,t){if(e!=t){for(var n=e;n<t;n++)this.top.children[n].destroy();this.top.children.splice(e,t-e),this.changed=!0}},se.prototype.destroyRest=function(){this.destroyBetween(this.index,this.top.children.length)},se.prototype.syncToMarks=function(e,t,n){for(var r=0,o=this.stack.length>>1,i=Math.min(o,e.length);r<i&&(r==o-1?this.top:this.stack[r+1<<1]).matchesMark(e[r])&&!1!==e[r].type.spec.spanning;)r++;for(;r<o;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<e.length;){this.stack.push(this.top,this.index+1);for(var s=-1,a=this.index;a<Math.min(this.index+3,this.top.children.length);a++)if(this.top.children[a].matchesMark(e[o])){s=a;break}if(s>-1)s>this.index&&(this.changed=!0,this.destroyBetween(this.index,s)),this.top=this.top.children[this.index];else{var c=J.create(this.top,e[o],t,n);this.top.children.splice(this.index,0,c),this.top=c,this.changed=!0}this.index=0,o++}},se.prototype.findNodeMatch=function(e,t,n,r){var o=-1,i=r<0?void 0:this.getPreMatch(r),s=this.top.children;if(i&&i.matchesNode(e,t,n))o=s.indexOf(i);else for(var a=this.index,c=Math.min(s.length,a+5);a<c;a++){var l=s[a];if(l.matchesNode(e,t,n)&&this.preMatched.indexOf(l)<0){o=a;break}}return!(o<0)&&(this.destroyBetween(this.index,o),this.index++,!0)},se.prototype.updateNextNode=function(e,t,n,r,o){for(var i=this.index;i<this.top.children.length;i++){var s=this.top.children[i];if(s instanceof H){var a=this.preMatched.indexOf(s);if(a>-1&&a+this.preMatchOffset!=o)return!1;var c=s.dom;if(!(this.lock&&(c==this.lock||1==c.nodeType&&c.contains(this.lock.parentNode))&&!(e.isText&&s.node&&s.node.isText&&s.nodeDOM.nodeValue==e.text&&3!=s.dirty&&oe(t,s.outerDeco)))&&s.update(e,t,n,r))return this.destroyBetween(this.index,i),s.dom!=c&&(this.changed=!0),this.index++,!0;break}}return!1},se.prototype.addNode=function(e,t,n,r,o){this.top.children.splice(this.index++,0,H.create(this.top,e,t,n,r,o)),this.changed=!0},se.prototype.placeWidget=function(e,t,n){var r=this.index<this.top.children.length?this.top.children[this.index]:null;if(!r||!r.matchesWidget(e)||e!=r.widget&&r.widget.type.toDOM.parentNode){var o=new W(this.top,e,t,n);this.top.children.splice(this.index++,0,o),this.changed=!0}else this.index++},se.prototype.addTextblockHacks=function(){for(var e=this.top.children[this.index-1];e instanceof J;)e=e.children[e.children.length-1];if(!e||!(e instanceof G)||/\n$/.test(e.node.text))if(this.index<this.top.children.length&&this.top.children[this.index].matchesHack())this.index++;else{var t=document.createElement("br");this.top.children.splice(this.index++,0,new X(this.top,q,t,null)),this.changed=!0}};var Ce=s.safari||s.chrome&&s.chrome_version<63;function Oe(e,t){var n=e.docView.domFromPos(t),r=n.node,o=n.offset,i=o<r.childNodes.length?r.childNodes[o]:null,a=o?r.childNodes[o-1]:null;if(s.safari&&i&&"false"==i.contentEditable)return Me(i);if(!(i&&"false"!=i.contentEditable||a&&"false"!=a.contentEditable)){if(i)return Me(i);if(a)return Me(a)}}function Me(e){return e.contentEditable="true",s.safari&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function Ne(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function Te(e,t){if(t instanceof r.NodeSelection){var n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(De(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else De(e)}function De(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=null)}function Ae(e,t,n,o){return e.someProp("createSelectionBetween",function(r){return r(e,t,n)})||r.TextSelection.between(t,n,o)}function Ee(e){var t=e.root.getSelection();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(e){return!1}}function Re(e){var t=e.pmViewDesc;if(t)return t.parseRule();if("BR"==e.nodeName&&e.parentNode){if(s.safari&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){var n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}if(e.parentNode.lastChild==e||s.safari&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if("IMG"==e.nodeName&&e.getAttribute("mark-placeholder"))return{ignore:!0}}function _e(e,t,n,i,a){if(t<0){var c=e.lastSelectionTime>Date.now()-50?e.lastSelectionOrigin:null,l=xe(e,c);if(l&&!e.state.selection.eq(l)){var u=e.state.tr.setSelection(l);"pointer"==c?u.setMeta("pointer",!0):"key"==c&&u.scrollIntoView(),e.dispatch(u)}}else{var p=e.state.doc.resolve(t),h=p.sharedDepth(n);t=p.before(h+1),n=e.state.doc.resolve(n).after(h+1);var d,f,m=e.state.selection,v=function(e,t,n){var r=e.docView.parseRange(t,n),i=r.node,a=r.fromOffset,c=r.toOffset,l=r.from,u=r.to,p=e.root.getSelection(),h=null,d=p.anchorNode;if(d&&e.dom.contains(1==d.nodeType?d:d.parentNode)&&(h=[{node:d,offset:p.anchorOffset}],w(p)||h.push({node:p.focusNode,offset:p.focusOffset})),s.chrome&&8===e.lastKeyCode)for(var f=c;f>a;f--){var m=i.childNodes[f-1],v=m.pmViewDesc;if("BR"==m.nodeType&&!v){c=f;break}if(!v||v.size)break}var g=e.state.doc,y=e.someProp("domParser")||o.DOMParser.fromSchema(e.state.schema),b=g.resolve(l),S=null,x=y.parse(i,{topNode:b.parent,topMatch:b.parent.contentMatchAt(b.index()),topOpen:!0,from:a,to:c,preserveWhitespace:!b.parent.type.spec.code||"full",editableContent:!0,findPositions:h,ruleFromNode:Re,context:b});if(h&&null!=h[0].pos){var k=h[0].pos,C=h[1]&&h[1].pos;null==C&&(C=k),S={anchor:k+l,head:C+l}}return{doc:x,sel:S,from:l,to:u}}(e,t,n),g=e.state.doc,y=g.slice(v.from,v.to);8===e.lastKeyCode&&Date.now()-100<e.lastKeyCodeTime?(d=e.state.selection.to,f="end"):(d=e.state.selection.from,f="start"),e.lastKeyCode=null;var b=function(e,t,n,r,o){var i=e.findDiffStart(t,n);if(null==i)return null;var s=e.findDiffEnd(t,n+e.size,n+t.size),a=s.a,c=s.b;if("end"==o){var l=Math.max(0,i-Math.min(a,c));r-=a+l-i}if(a<i&&e.size<t.size){var u=r<=i&&r>=a?i-r:0;c=(i-=u)+(c-a),a=i}else if(c<i){var p=r<=i&&r>=c?i-r:0;a=(i-=p)+(a-c),c=i}return{start:i,endA:a,endB:c}}(y.content,v.doc.content,v.from,d,f);if(!b){if(!(i&&m instanceof r.TextSelection&&!m.empty&&m.$head.sameParent(m.$anchor))||e.composing||v.sel&&v.sel.anchor!=v.sel.head){if(v.sel){var x=Pe(e,e.state.doc,v.sel);x&&!x.eq(e.state.selection)&&e.dispatch(e.state.tr.setSelection(x))}return}b={start:m.from,endA:m.to,endB:m.to}}e.domChangeCount++,e.state.selection.from<e.state.selection.to&&b.start==b.endB&&e.state.selection instanceof r.TextSelection&&(b.start>e.state.selection.from&&b.start<=e.state.selection.from+2?b.start=e.state.selection.from:b.endA<e.state.selection.to&&b.endA>=e.state.selection.to-2&&(b.endB+=e.state.selection.to-b.endA,b.endA=e.state.selection.to)),s.ie&&s.ie_version<=11&&b.endB==b.start+1&&b.endA==b.start&&b.start>v.from&&"  "==v.doc.textBetween(b.start-v.from-1,b.start-v.from+1)&&(b.start--,b.endA--,b.endB--);var k,C=v.doc.resolveNoCache(b.start-v.from),O=v.doc.resolveNoCache(b.endB-v.from),M=C.sameParent(O)&&C.parent.inlineContent;if((s.ios&&e.lastIOSEnter>Date.now()-225&&(!M||a.some(function(e){return"DIV"==e.nodeName||"P"==e.nodeName}))||!M&&C.pos<v.doc.content.size&&(k=r.Selection.findFrom(v.doc.resolve(C.pos+1),1,!0))&&k.head==O.pos)&&e.someProp("handleKeyDown",function(t){return t(e,S(13,"Enter"))}))e.lastIOSEnter=0;else if(e.state.selection.anchor>b.start&&function(e,t,n,r,o){if(!r.parent.isTextblock||n-t<=o.pos-r.pos||$e(r,!0,!1)<o.pos)return!1;var i=e.resolve(t);if(i.parentOffset<i.parent.content.size||!i.parent.isTextblock)return!1;var s=e.resolve($e(i,!0,!0));if(!s.parent.isTextblock||s.pos>n||$e(s,!0,!1)<n)return!1;return r.parent.content.cut(r.parentOffset).eq(s.parent.content)}(g,b.start,b.endA,C,O)&&e.someProp("handleKeyDown",function(t){return t(e,S(8,"Backspace"))}))s.android&&s.chrome&&e.domObserver.suppressSelectionUpdates();else{s.android&&!M&&C.start()!=O.start()&&0==O.parentOffset&&C.depth==O.depth&&v.sel&&v.sel.anchor==v.sel.head&&v.sel.head==b.endA&&(b.endB-=2,O=v.doc.resolveNoCache(b.endB-v.from),setTimeout(function(){e.someProp("handleKeyDown",function(t){return t(e,S(13,"Enter"))})},20));var N,T,D,A,E=b.start,R=b.endA;if(M)if(C.pos==O.pos)s.ie&&s.ie_version<=11&&0==C.parentOffset&&(e.domObserver.suppressSelectionUpdates(),setTimeout(function(){return ke(e)},20)),N=e.state.tr.delete(E,R),T=g.resolve(b.start).marksAcross(g.resolve(b.endA));else if(b.endA==b.endB&&(A=g.resolve(b.start))&&(D=function(e,t){for(var n,r,i,s=e.firstChild.marks,a=t.firstChild.marks,c=s,l=a,u=0;u<a.length;u++)c=a[u].removeFromSet(c);for(var p=0;p<s.length;p++)l=s[p].removeFromSet(l);if(1==c.length&&0==l.length)r=c[0],n="add",i=function(e){return e.mark(r.addToSet(e.marks))};else{if(0!=c.length||1!=l.length)return null;r=l[0],n="remove",i=function(e){return e.mark(r.removeFromSet(e.marks))}}for(var h=[],d=0;d<t.childCount;d++)h.push(i(t.child(d)));if(o.Fragment.from(h).eq(e))return{mark:r,type:n}}(C.parent.content.cut(C.parentOffset,O.parentOffset),A.parent.content.cut(A.parentOffset,b.endA-A.start()))))N=e.state.tr,"add"==D.type?N.addMark(E,R,D.mark):N.removeMark(E,R,D.mark);else if(C.parent.child(C.index()).isText&&C.index()==O.index()-(O.textOffset?0:1)){var _=C.parent.textBetween(C.parentOffset,O.parentOffset);if(e.someProp("handleTextInput",function(t){return t(e,E,R,_)}))return;N=e.state.tr.insertText(_,E,R)}if(N||(N=e.state.tr.replace(E,R,v.doc.slice(b.start-v.from,b.endB-v.from))),v.sel){var P=Pe(e,N.doc,v.sel);P&&!(s.chrome&&s.android&&e.composing&&P.empty&&(P.head==E||P.head==N.mapping.map(R)-1)||s.ie&&P.empty&&P.head==E)&&N.setSelection(P)}T&&N.ensureMarks(T),e.dispatch(N.scrollIntoView())}}}function Pe(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:Ae(e,t.resolve(n.anchor),t.resolve(n.head))}function $e(e,t,n){for(var r=e.depth,o=t?e.end():e.pos;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,o++,t=!1;if(n)for(var i=e.node(r).maybeChild(e.indexAfter(r));i&&!i.isLeaf;)i=i.firstChild,o++;return o}function Ie(e,t){for(var n=[],r=t.content,i=t.openStart,s=t.openEnd;i>1&&s>1&&1==r.childCount&&1==r.firstChild.childCount;){i--,s--;var a=r.firstChild;n.push(a.type.name,a.type.hasRequiredAttrs()?a.attrs:null),r=a.content}var c=e.someProp("clipboardSerializer")||o.DOMSerializer.fromSchema(e.state.schema),l=Le(),u=l.createElement("div");u.appendChild(c.serializeFragment(r,{document:l}));for(var p,h=u.firstChild;h&&1==h.nodeType&&(p=Ve[h.nodeName.toLowerCase()]);){for(var d=p.length-1;d>=0;d--){for(var f=l.createElement(p[d]);u.firstChild;)f.appendChild(u.firstChild);u.appendChild(f)}h=u.firstChild}return h&&1==h.nodeType&&h.setAttribute("data-pm-slice",i+" "+s+" "+JSON.stringify(n)),{dom:u,text:e.someProp("clipboardTextSerializer",function(e){return e(t)})||t.content.textBetween(0,t.content.size,"\n\n")}}function ze(e,t,n,r,i){var s,a,c=i.parent.type.spec.code;if(!n&&!t)return null;var l=t&&(r||c||!n);if(l){if(e.someProp("transformPastedText",function(e){t=e(t,c||r)}),c)return new o.Slice(o.Fragment.from(e.state.schema.text(t)),0,0);var u=e.someProp("clipboardTextParser",function(e){return e(t,i,r)});u?a=u:(s=document.createElement("div"),t.trim().split(/(?:\r\n?|\n)+/).forEach(function(e){s.appendChild(document.createElement("p")).textContent=e}))}else e.someProp("transformPastedHTML",function(e){n=e(n)}),s=function(e){var t=/(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));var n,r=Le().createElement("div"),o=/(?:<meta [^>]*>)*<([a-z][^>\s]+)/i.exec(e),i=0;(n=o&&Ve[o[1].toLowerCase()])&&(e=n.map(function(e){return"<"+e+">"}).join("")+e+n.map(function(e){return"</"+e+">"}).reverse().join(""),i=n.length);r.innerHTML=e;for(var s=0;s<i;s++)r=r.firstChild;return r}(n);var p=s&&s.querySelector("[data-pm-slice]"),h=p&&/^(\d+) (\d+) (.*)/.exec(p.getAttribute("data-pm-slice"));if(!a){var d=e.someProp("clipboardParser")||e.someProp("domParser")||o.DOMParser.fromSchema(e.state.schema);a=d.parseSlice(s,{preserveWhitespace:!(!l&&!h),context:i})}return a=h?function(e,t){if(!e.size)return e;var n,r=e.content.firstChild.type.schema;try{n=JSON.parse(t)}catch(t){return e}for(var i=e.content,s=e.openStart,a=e.openEnd,c=n.length-2;c>=0;c-=2){var l=r.nodes[n[c]];if(!l||l.hasRequiredAttrs())break;i=o.Fragment.from(l.create(n[c+1],i)),s++,a++}return new o.Slice(i,s,a)}(function(e,t,n){t<e.openStart&&(e=new o.Slice(Fe(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd));n<e.openEnd&&(e=new o.Slice(Fe(e.content,1,n,e.openEnd,0,0),e.openStart,n));return e}(a,+h[1],+h[2]),h[3]):o.Slice.maxOpen(function(e,t){if(e.childCount<2)return e;for(var n=function(n){var r=t.node(n),i=r.contentMatchAt(t.index(n)),s=void 0,a=[];if(e.forEach(function(e){if(a){var t,n=i.findWrapping(e.type);if(!n)return a=null;if(t=a.length&&s.length&&function e(t,n,r,i,s){if(s<t.length&&s<n.length&&t[s]==n[s]){var a=e(t,n,r,i.lastChild,s+1);if(a)return i.copy(i.content.replaceChild(i.childCount-1,a));var c=i.contentMatchAt(i.childCount);if(c.matchType(s==t.length-1?r.type:t[s+1]))return i.copy(i.content.append(o.Fragment.from(Be(r,t,s+1))))}}(n,s,e,a[a.length-1],0))a[a.length-1]=t;else{a.length&&(a[a.length-1]=function e(t,n){if(0==n)return t;var r=t.content.replaceChild(t.childCount-1,e(t.lastChild,n-1));var i=t.contentMatchAt(t.childCount).fillBefore(o.Fragment.empty,!0);return t.copy(r.append(i))}(a[a.length-1],s.length));var r=Be(e,n);a.push(r),i=i.matchType(r.type,r.attrs),s=n}}}),a)return{v:o.Fragment.from(a)}},r=t.depth;r>=0;r--){var i=n(r);if(i)return i.v}return e}(a.content,i),!1),e.someProp("transformPasted",function(e){a=e(a)}),a}function Be(e,t,n){void 0===n&&(n=0);for(var r=t.length-1;r>=n;r--)e=t[r].create(null,o.Fragment.from(e));return e}function Fe(e,t,n,r,i,s){var a=t<0?e.firstChild:e.lastChild,c=a.content;return i<r-1&&(c=Fe(c,t,n,r,i+1,s)),i>=n&&(c=t<0?a.contentMatchAt(0).fillBefore(c,e.childCount>1||s<=i).append(c):c.append(a.contentMatchAt(a.childCount).fillBefore(o.Fragment.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,a.copy(c))}var Ve={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]},je=null;function Le(){return je||(je=document.implementation.createHTMLDocument("title"))}var qe={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},We=s.ie&&s.ie_version<=11,Ke=function(){this.anchorNode=this.anchorOffset=this.focusNode=this.focusOffset=null};Ke.prototype.set=function(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset},Ke.prototype.eq=function(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset};var Je=function(e,t){var n=this;this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=window.MutationObserver&&new window.MutationObserver(function(e){for(var t=0;t<e.length;t++)n.queue.push(e[t]);s.ie&&s.ie_version<=11&&e.some(function(e){return"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length})?n.flushSoon():n.flush()}),this.currentSelection=new Ke,We&&(this.onCharData=function(e){n.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),n.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.suppressingSelectionUpdates=!1};Je.prototype.flushSoon=function(){var e=this;this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(function(){e.flushingSoon=-1,e.flush()},20))},Je.prototype.forceFlush=function(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())},Je.prototype.start=function(){this.observer&&this.observer.observe(this.view.dom,qe),We&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()},Je.prototype.stop=function(){var e=this;if(this.observer){var t=this.observer.takeRecords();if(t.length){for(var n=0;n<t.length;n++)this.queue.push(t[n]);window.setTimeout(function(){return e.flush()},20)}this.observer.disconnect()}We&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()},Je.prototype.connectSelection=function(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)},Je.prototype.disconnectSelection=function(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)},Je.prototype.suppressSelectionUpdates=function(){var e=this;this.suppressingSelectionUpdates=!0,setTimeout(function(){return e.suppressingSelectionUpdates=!1},50)},Je.prototype.onSelectionChange=function(){if(function(e){return(!e.editable||e.root.activeElement==e.dom)&&Ee(e)}(this.view)){if(this.suppressingSelectionUpdates)return ke(this.view);if(s.ie&&s.ie_version<=11&&!this.view.state.selection.empty){var e=this.view.root.getSelection();if(e.focusNode&&m(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}},Je.prototype.setCurSelection=function(){this.currentSelection.set(this.view.root.getSelection())},Je.prototype.ignoreSelectionChange=function(e){if(0==e.rangeCount)return!0;var t=e.getRangeAt(0).commonAncestorContainer,n=this.view.docView.nearestDesc(t);return n&&n.ignoreMutation({type:"selection",target:3==t.nodeType?t.parentNode:t})?(this.setCurSelection(),!0):void 0},Je.prototype.flush=function(){if(this.view.docView&&!(this.flushingSoon>-1)){var e=this.observer?this.observer.takeRecords():[];this.queue.length&&(e=this.queue.concat(e),this.queue.length=0);var t=this.view.root.getSelection(),n=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(t)&&Ee(this.view)&&!this.ignoreSelectionChange(t),r=-1,o=-1,i=!1,a=[];if(this.view.editable)for(var c=0;c<e.length;c++){var l=this.registerMutation(e[c],a);l&&(r=r<0?l.from:Math.min(l.from,r),o=o<0?l.to:Math.max(l.to,o),l.typeOver&&(i=!0))}if(s.gecko&&a.length>1){var u=a.filter(function(e){return"BR"==e.nodeName});if(2==u.length){var p=u[0],h=u[1];p.parentNode&&p.parentNode.parentNode==h.parentNode?h.remove():p.remove()}}(r>-1||n)&&(r>-1&&(this.view.docView.markDirty(r,o),function(e){if(He)return;He=!0,"normal"==getComputedStyle(e.dom).whiteSpace&&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.")}(this.view)),this.handleDOMChange(r,o,i,a),this.view.docView.dirty?this.view.updateState(this.view.state):this.currentSelection.eq(t)||ke(this.view))}},Je.prototype.registerMutation=function(e,t){if(t.indexOf(e.target)>-1)return null;var n=this.view.docView.nearestDesc(e.target);if("attributes"==e.type&&(n==this.view.docView||"contenteditable"==e.attributeName||"style"==e.attributeName&&!e.oldValue&&!e.target.getAttribute("style")))return null;if(!n||n.ignoreMutation(e))return null;if("childList"==e.type){var r=e.previousSibling,o=e.nextSibling;if(s.ie&&s.ie_version<=11&&e.addedNodes.length)for(var i=0;i<e.addedNodes.length;i++){var a=e.addedNodes[i],c=a.previousSibling,l=a.nextSibling;(!c||Array.prototype.indexOf.call(e.addedNodes,c)<0)&&(r=c),(!l||Array.prototype.indexOf.call(e.addedNodes,l)<0)&&(o=l)}for(var u=r&&r.parentNode==e.target?h(r)+1:0,p=n.localPosFromDOM(e.target,u,-1),d=o&&o.parentNode==e.target?h(o):e.target.childNodes.length,f=0;f<e.addedNodes.length;f++)t.push(e.addedNodes[f]);return{from:p,to:n.localPosFromDOM(e.target,d,1)}}return"attributes"==e.type?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}};var He=!1;var Ue={},Ge={};function Xe(e,t){e.lastSelectionOrigin=t,e.lastSelectionTime=Date.now()}function Ze(e){e.someProp("handleDOMEvents",function(t){for(var n in t)e.eventHandlers[n]||e.dom.addEventListener(n,e.eventHandlers[n]=function(t){return Ye(e,t)})})}function Ye(e,t){return e.someProp("handleDOMEvents",function(n){var r=n[t.type];return!!r&&(r(e,t)||t.defaultPrevented)})}function Qe(e){return{left:e.clientX,top:e.clientY}}function et(e,t,n,r,o){if(-1==r)return!1;for(var i=e.state.doc.resolve(r),s=function(r){if(e.someProp(t,function(t){return r>i.depth?t(e,n,i.nodeAfter,i.before(r),o,!0):t(e,n,i.node(r),i.before(r),o,!1)}))return{v:!0}},a=i.depth+1;a>0;a--){var c=s(a);if(c)return c.v}return!1}function tt(e,t,n){e.focused||e.focus();var r=e.state.tr.setSelection(t);"pointer"==n&&r.setMeta("pointer",!0),e.dispatch(r)}function nt(e,t,n,o,i){return et(e,"handleClickOn",t,n,o)||e.someProp("handleClick",function(n){return n(e,t,o)})||(i?function(e,t){if(-1==t)return!1;var n,o,i=e.state.selection;i instanceof r.NodeSelection&&(n=i.node);for(var s=e.state.doc.resolve(t),a=s.depth+1;a>0;a--){var c=a>s.depth?s.nodeAfter:s.node(a);if(r.NodeSelection.isSelectable(c)){o=n&&i.$from.depth>0&&a>=i.$from.depth&&s.before(i.$from.depth+1)==i.$from.pos?s.before(i.$from.depth):s.before(a);break}}return null!=o&&(tt(e,r.NodeSelection.create(e.state.doc,o),"pointer"),!0)}(e,n):function(e,t){if(-1==t)return!1;var n=e.state.doc.resolve(t),o=n.nodeAfter;return!!(o&&o.isAtom&&r.NodeSelection.isSelectable(o))&&(tt(e,new r.NodeSelection(n),"pointer"),!0)}(e,n))}function rt(e,t,n,o){return et(e,"handleTripleClickOn",t,n,o)||e.someProp("handleTripleClick",function(n){return n(e,t,o)})||function(e,t){var n=e.state.doc;if(-1==t)return!!n.inlineContent&&(tt(e,r.TextSelection.create(n,0,n.content.size),"pointer"),!0);for(var o=n.resolve(t),i=o.depth+1;i>0;i--){var s=i>o.depth?o.nodeAfter:o.node(i),a=o.before(i);if(s.inlineContent)tt(e,r.TextSelection.create(n,a+1,a+1+s.content.size),"pointer");else{if(!r.NodeSelection.isSelectable(s))continue;tt(e,r.NodeSelection.create(n,a),"pointer")}return!0}}(e,n)}function ot(e){return pt(e)}Ge.keydown=function(e,t){if(e.shiftKey=16==t.keyCode||t.shiftKey,!at(e,t))if(e.domObserver.forceFlush(),e.lastKeyCode=t.keyCode,e.lastKeyCodeTime=Date.now(),!s.ios||13!=t.keyCode||t.ctrlKey||t.altKey||t.metaKey)e.someProp("handleKeyDown",function(n){return n(e,t)})||Se(e,t)?t.preventDefault():Xe(e,"key");else{var n=Date.now();e.lastIOSEnter=n,e.lastIOSEnterFallbackTimeout=setTimeout(function(){e.lastIOSEnter==n&&(e.someProp("handleKeyDown",function(t){return t(e,S(13,"Enter"))}),e.lastIOSEnter=0)},200)}},Ge.keyup=function(e,t){16==t.keyCode&&(e.shiftKey=!1)},Ge.keypress=function(e,t){if(!(at(e,t)||!t.charCode||t.ctrlKey&&!t.altKey||s.mac&&t.metaKey))if(e.someProp("handleKeyPress",function(n){return n(e,t)}))t.preventDefault();else{var n=e.state.selection;if(!(n instanceof r.TextSelection&&n.$from.sameParent(n.$to))){var o=String.fromCharCode(t.charCode);e.someProp("handleTextInput",function(t){return t(e,n.$from.pos,n.$to.pos,o)})||e.dispatch(e.state.tr.insertText(o).scrollIntoView()),t.preventDefault()}}};var it=s.mac?"metaKey":"ctrlKey";Ue.mousedown=function(e,t){e.shiftKey=t.shiftKey;var n=ot(e),r=Date.now(),o="singleClick";r-e.lastClick.time<500&&function(e,t){var n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}(t,e.lastClick)&&!t[it]&&("singleClick"==e.lastClick.type?o="doubleClick":"doubleClick"==e.lastClick.type&&(o="tripleClick")),e.lastClick={time:r,x:t.clientX,y:t.clientY,type:o};var i=e.posAtCoords(Qe(t));i&&("singleClick"==o?e.mouseDown=new st(e,i,t,n):("doubleClick"==o?function(e,t,n,r){return et(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",function(n){return n(e,t,r)})}:rt)(e,i.pos,i.inside,t)?t.preventDefault():Xe(e,"pointer"))};var st=function(e,t,n,o){var i,a,c=this;if(this.view=e,this.startDoc=e.state.doc,this.pos=t,this.event=n,this.flushed=o,this.selectNode=n[it],this.allowDefault=n.shiftKey,t.inside>-1)i=e.state.doc.nodeAt(t.inside),a=t.inside;else{var l=e.state.doc.resolve(t.pos);i=l.parent,a=l.depth?l.before():0}this.mightDrag=null;var u=o?null:n.target,p=u?e.docView.nearestDesc(u,!0):null;this.target=p?p.dom:null,(i.type.spec.draggable&&!1!==i.type.spec.selectable||e.state.selection instanceof r.NodeSelection&&a==e.state.selection.from)&&(this.mightDrag={node:i,pos:a,addAttr:this.target&&!this.target.draggable,setUneditable:this.target&&s.gecko&&!this.target.hasAttribute("contentEditable")}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(function(){return c.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)),Xe(e,"pointer")};function at(e,t){return!!e.composing||!!(s.safari&&Math.abs(t.timeStamp-e.compositionEndedAt)<500)&&(e.compositionEndedAt=-2e8,!0)}st.prototype.done=function(){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.view.mouseDown=null},st.prototype.up=function(e){if(this.done(),this.view.dom.contains(3==e.target.nodeType?e.target.parentNode:e.target)){var t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(Qe(e))),this.allowDefault||!t?Xe(this.view,"pointer"):nt(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():this.flushed||s.safari&&this.mightDrag&&!this.mightDrag.node.isAtom||s.chrome&&!(this.view.state.selection instanceof r.TextSelection)&&(t.pos==this.view.state.selection.from||t.pos==this.view.state.selection.to)?(tt(this.view,r.Selection.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):Xe(this.view,"pointer")}},st.prototype.move=function(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0),Xe(this.view,"pointer")},Ue.touchdown=function(e){ot(e),Xe(e,"pointer")},Ue.contextmenu=function(e){return ot(e)};var ct=s.android?5e3:-1;function lt(e,t){clearTimeout(e.composingTimeout),t>-1&&(e.composingTimeout=setTimeout(function(){return pt(e)},t))}function ut(e){for(e.composing=!1;e.compositionNodes.length>0;)e.compositionNodes.pop().markParentsDirty()}function pt(e,t){if(e.domObserver.forceFlush(),ut(e),t||e.docView.dirty){var n=xe(e);return n&&!n.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(n)):e.updateState(e.state),!0}return!1}Ge.compositionstart=Ge.compositionupdate=function(e){if(!e.composing){e.domObserver.flush();var t=e.state,n=t.selection.$from;if(t.selection.empty&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(function(e){return!1===e.type.spec.inclusive})))e.markCursor=e.state.storedMarks||n.marks(),pt(e,!0),e.markCursor=null;else if(pt(e),s.gecko&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length)for(var r=e.root.getSelection(),o=r.focusNode,i=r.focusOffset;o&&1==o.nodeType&&0!=i;){var a=i<0?o.lastChild:o.childNodes[i-1];if(!a)break;if(3==a.nodeType){r.collapse(a,a.nodeValue.length);break}o=a,i=-1}e.composing=!0}lt(e,ct)},Ge.compositionend=function(e,t){e.composing&&(e.composing=!1,e.compositionEndedAt=t.timeStamp,lt(e,20))};var ht=s.ie&&s.ie_version<15||s.ios&&s.webkit_version<604;function dt(e,t,n,r){var i=ze(e,t,n,e.shiftKey,e.state.selection.$from);if(!e.someProp("handlePaste",function(t){return t(e,r,i||o.Slice.empty)})&&i){var s=function(e){return 0==e.openStart&&0==e.openEnd&&1==e.content.childCount?e.content.firstChild:null}(i),a=s?e.state.tr.replaceSelectionWith(s,e.shiftKey):e.state.tr.replaceSelection(i);e.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste"))}}Ue.copy=Ge.cut=function(e,t){var n=e.state.selection,r="cut"==t.type;if(!n.empty){var o=ht?null:t.clipboardData,i=Ie(e,n.content()),s=i.dom,a=i.text;o?(t.preventDefault(),o.clearData(),o.setData("text/html",s.innerHTML),o.setData("text/plain",a)):function(e,t){if(e.dom.parentNode){var n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";var r=getSelection(),o=document.createRange();o.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout(function(){n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}}(e,s),r&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))}},Ge.paste=function(e,t){var n=ht?null:t.clipboardData,r=n&&n.getData("text/html"),o=n&&n.getData("text/plain");n&&(r||o||n.files.length)?(dt(e,o,r,t),t.preventDefault()):function(e,t){if(e.dom.parentNode){var n=e.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus(),setTimeout(function(){e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?dt(e,r.value,null,t):dt(e,r.textContent,r.innerHTML,t)},50)}}(e,t)};var ft=s.mac?"altKey":"ctrlKey";for(var mt in Ue.dragstart=function(e,t){var n=e.mouseDown;if(n&&n.done(),t.dataTransfer){var o=e.state.selection,i=o.empty?null:e.posAtCoords(Qe(t));if(i&&i.pos>=o.from&&i.pos<=(o instanceof r.NodeSelection?o.to-1:o.to));else if(n&&n.mightDrag)e.dispatch(e.state.tr.setSelection(r.NodeSelection.create(e.state.doc,n.mightDrag.pos)));else if(t.target&&1==t.target.nodeType){var s=e.docView.nearestDesc(t.target,!0);if(!s||!s.node.type.spec.draggable||s==e.docView)return;e.dispatch(e.state.tr.setSelection(r.NodeSelection.create(e.state.doc,s.posBefore)))}var a=e.state.selection.content(),c=Ie(e,a),l=c.dom,u=c.text;t.dataTransfer.clearData(),t.dataTransfer.setData(ht?"Text":"text/html",l.innerHTML),ht||t.dataTransfer.setData("text/plain",u),e.dragging=new function(e,t){this.slice=e,this.move=t}(a,!t[ft])}},Ue.dragend=function(e){window.setTimeout(function(){return e.dragging=null},50)},Ge.dragover=Ge.dragenter=function(e,t){return t.preventDefault()},Ge.drop=function(e,t){var n=e.dragging;if(e.dragging=null,t.dataTransfer){var s=e.posAtCoords(Qe(t));if(s){var a=e.state.doc.resolve(s.pos);if(a){var c=n&&n.slice||ze(e,t.dataTransfer.getData(ht?"Text":"text/plain"),ht?null:t.dataTransfer.getData("text/html"),!1,a);if(e.someProp("handleDrop",function(r){return r(e,t,c||o.Slice.empty,n&&n.move)}))t.preventDefault();else if(c){t.preventDefault();var l=c?Object(i.h)(e.state.doc,a.pos,c):a.pos;null==l&&(l=a.pos);var u=e.state.tr;n&&n.move&&u.deleteSelection();var p=u.mapping.map(l),h=0==c.openStart&&0==c.openEnd&&1==c.content.childCount,d=u.doc;if(h?u.replaceRangeWith(p,p,c.content.firstChild):u.replaceRange(p,p,c),!u.doc.eq(d)){var f=u.doc.resolve(p);h&&r.NodeSelection.isSelectable(c.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(c.content.firstChild)?u.setSelection(new r.NodeSelection(f)):u.setSelection(Ae(e,f,u.doc.resolve(u.mapping.map(l)))),e.focus(),e.dispatch(u.setMeta("uiEvent","drop"))}}}}}},Ue.focus=function(e){e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout(function(){e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.root.getSelection())&&ke(e)},20))},Ue.blur=function(e){e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),e.domObserver.currentSelection.set({}),e.focused=!1)},Ue.beforeinput=function(e,t){if(s.chrome&&s.android&&"deleteContentBackward"==t.inputType){var n=e.domChangeCount;setTimeout(function(){if(e.domChangeCount==n&&(e.dom.blur(),e.focus(),!e.someProp("handleKeyDown",function(t){return t(e,S(8,"Backspace"))}))){var t=e.state.selection.$cursor;t&&t.pos>0&&e.dispatch(e.state.tr.delete(t.pos-1,t.pos).scrollIntoView())}},50)}},Ge)Ue[mt]=Ge[mt];function vt(e,t){if(e==t)return!0;for(var n in e)if(e[n]!==t[n])return!1;for(var r in t)if(!(r in e))return!1;return!0}var gt=function(e,t){this.spec=t||kt,this.side=this.spec.side||0,this.toDOM=e};gt.prototype.map=function(e,t,n,r){var o=e.mapResult(t.from+r,this.side<0?-1:1),i=o.pos;return o.deleted?null:new wt(i-n,i-n,this)},gt.prototype.valid=function(){return!0},gt.prototype.eq=function(e){return this==e||e instanceof gt&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&vt(this.spec,e.spec))};var yt=function(e,t){this.spec=t||kt,this.attrs=e};yt.prototype.map=function(e,t,n,r){var o=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,i=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return o>=i?null:new wt(o,i,this)},yt.prototype.valid=function(e,t){return t.from<t.to},yt.prototype.eq=function(e){return this==e||e instanceof yt&&vt(this.attrs,e.attrs)&&vt(this.spec,e.spec)},yt.is=function(e){return e.type instanceof yt};var bt=function(e,t){this.spec=t||kt,this.attrs=e};bt.prototype.map=function(e,t,n,r){var o=e.mapResult(t.from+r,1);if(o.deleted)return null;var i=e.mapResult(t.to+r,-1);return i.deleted||i.pos<=o.pos?null:new wt(o.pos-n,i.pos-n,this)},bt.prototype.valid=function(e,t){var n=e.content.findIndex(t.from),r=n.index,o=n.offset;return o==t.from&&o+e.child(r).nodeSize==t.to},bt.prototype.eq=function(e){return this==e||e instanceof bt&&vt(this.attrs,e.attrs)&&vt(this.spec,e.spec)};var wt=function(e,t,n){this.from=e,this.to=t,this.type=n},St={spec:{configurable:!0},inline:{configurable:!0}};wt.prototype.copy=function(e,t){return new wt(e,t,this.type)},wt.prototype.eq=function(e,t){return void 0===t&&(t=0),this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to},wt.prototype.map=function(e,t,n){return this.type.map(e,this,t,n)},wt.widget=function(e,t,n){return new wt(e,e,new gt(t,n))},wt.inline=function(e,t,n,r){return new wt(e,t,new yt(n,r))},wt.node=function(e,t,n,r){return new wt(e,t,new bt(n,r))},St.spec.get=function(){return this.type.spec},St.inline.get=function(){return this.type instanceof yt},Object.defineProperties(wt.prototype,St);var xt=[],kt={},Ct=function(e,t){this.local=e&&e.length?e:xt,this.children=t&&t.length?t:xt};Ct.create=function(e,t){return t.length?At(t,e,0,kt):Ot},Ct.prototype.find=function(e,t,n){var r=[];return this.findInner(null==e?0:e,null==t?1e9:t,r,0,n),r},Ct.prototype.findInner=function(e,t,n,r,o){for(var i=0;i<this.local.length;i++){var s=this.local[i];s.from<=t&&s.to>=e&&(!o||o(s.spec))&&n.push(s.copy(s.from+r,s.to+r))}for(var a=0;a<this.children.length;a+=3)if(this.children[a]<t&&this.children[a+1]>e){var c=this.children[a]+1;this.children[a+2].findInner(e-c,t-c,n,r+c,o)}},Ct.prototype.map=function(e,t,n){return this==Ot||0==e.maps.length?this:this.mapInner(e,t,0,0,n||kt)},Ct.prototype.mapInner=function(e,t,n,r,o){for(var i,s=0;s<this.local.length;s++){var a=this.local[s].map(e,n,r);a&&a.type.valid(t,a)?(i||(i=[])).push(a):o.onRemove&&o.onRemove(this.local[s].spec)}return this.children.length?function(e,t,n,r,o,i,s){for(var a=e.slice(),c=function(e,t,n,r){for(var s=0;s<a.length;s+=3){var c=a[s+1],l=void 0;-1==c||e>c+i||(t>=a[s]+i?a[s+1]=-1:n>=o&&(l=r-n-(t-e))&&(a[s]+=l,a[s+1]+=l))}},l=0;l<n.maps.length;l++)n.maps[l].forEach(c);for(var u=!1,p=0;p<a.length;p+=3)if(-1==a[p+1]){var h=n.map(a[p]+i),d=h-o;if(d<0||d>=r.content.size){u=!0;continue}var f=n.map(e[p+1]+i,-1),m=f-o,v=r.content.findIndex(d),g=v.index,y=v.offset,b=r.maybeChild(g);if(b&&y==d&&y+b.nodeSize==m){var w=a[p+2].mapInner(n,b,h+1,a[p]+i+1,s);w!=Ot?(a[p]=d,a[p+1]=m,a[p+2]=w):(a[p+1]=-2,u=!0)}else u=!0}if(u){var S=function(e,t,n,r,o,i,s){function a(e,t){for(var i=0;i<e.local.length;i++){var c=e.local[i].map(r,o,t);c?n.push(c):s.onRemove&&s.onRemove(e.local[i].spec)}for(var l=0;l<e.children.length;l+=3)a(e.children[l+2],e.children[l]+t+1)}for(var c=0;c<e.length;c+=3)-1==e[c+1]&&a(e[c+2],t[c]+i+1);return n}(a,e,t||[],n,o,i,s),x=At(S,r,0,s);t=x.local;for(var k=0;k<a.length;k+=3)a[k+1]<0&&(a.splice(k,3),k-=3);for(var C=0,O=0;C<x.children.length;C+=3){for(var M=x.children[C];O<a.length&&a[O]<M;)O+=3;a.splice(O,0,x.children[C],x.children[C+1],x.children[C+2])}}return new Ct(t&&t.sort(Et),a)}(this.children,i,e,t,n,r,o):i?new Ct(i.sort(Et)):Ot},Ct.prototype.add=function(e,t){return t.length?this==Ot?Ct.create(e,t):this.addInner(e,t,0):this},Ct.prototype.addInner=function(e,t,n){var r,o=this,i=0;e.forEach(function(e,s){var a,c=s+n;if(a=Tt(t,e,c)){for(r||(r=o.children.slice());i<r.length&&r[i]<s;)i+=3;r[i]==s?r[i+2]=r[i+2].addInner(e,a,c+1):r.splice(i,0,s,s+e.nodeSize,At(a,e,c+1,kt)),i+=3}});var s=Nt(i?Dt(t):t,-n);return new Ct(s.length?this.local.concat(s).sort(Et):this.local,r||this.children)},Ct.prototype.remove=function(e){return 0==e.length||this==Ot?this:this.removeInner(e,0)},Ct.prototype.removeInner=function(e,t){for(var n=this.children,r=this.local,o=0;o<n.length;o+=3){for(var i=void 0,s=n[o]+t,a=n[o+1]+t,c=0,l=void 0;c<e.length;c++)(l=e[c])&&l.from>s&&l.to<a&&(e[c]=null,(i||(i=[])).push(l));if(i){n==this.children&&(n=this.children.slice());var u=n[o+2].removeInner(i,s+1);u!=Ot?n[o+2]=u:(n.splice(o,3),o-=3)}}if(r.length)for(var p=0,h=void 0;p<e.length;p++)if(h=e[p])for(var d=0;d<r.length;d++)r[d].eq(h,t)&&(r==this.local&&(r=this.local.slice()),r.splice(d--,1));return n==this.children&&r==this.local?this:r.length||n.length?new Ct(r,n):Ot},Ct.prototype.forChild=function(e,t){if(this==Ot)return this;if(t.isLeaf)return Ct.empty;for(var n,r,o=0;o<this.children.length;o+=3)if(this.children[o]>=e){this.children[o]==e&&(n=this.children[o+2]);break}for(var i=e+1,s=i+t.content.size,a=0;a<this.local.length;a++){var c=this.local[a];if(c.from<s&&c.to>i&&c.type instanceof yt){var l=Math.max(i,c.from)-i,u=Math.min(s,c.to)-i;l<u&&(r||(r=[])).push(c.copy(l,u))}}if(r){var p=new Ct(r.sort(Et));return n?new Mt([p,n]):p}return n||Ot},Ct.prototype.eq=function(e){if(this==e)return!0;if(!(e instanceof Ct)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(var t=0;t<this.local.length;t++)if(!this.local[t].eq(e.local[t]))return!1;for(var n=0;n<this.children.length;n+=3)if(this.children[n]!=e.children[n]||this.children[n+1]!=e.children[n+1]||!this.children[n+2].eq(e.children[n+2]))return!1;return!0},Ct.prototype.locals=function(e){return Rt(this.localsInner(e))},Ct.prototype.localsInner=function(e){if(this==Ot)return xt;if(e.inlineContent||!this.local.some(yt.is))return this.local;for(var t=[],n=0;n<this.local.length;n++)this.local[n].type instanceof yt||t.push(this.local[n]);return t};var Ot=new Ct;Ct.empty=Ot,Ct.removeOverlap=Rt;var Mt=function(e){this.members=e};function Nt(e,t){if(!t||!e.length)return e;for(var n=[],r=0;r<e.length;r++){var o=e[r];n.push(new wt(o.from+t,o.to+t,o.type))}return n}function Tt(e,t,n){if(t.isLeaf)return null;for(var r=n+t.nodeSize,o=null,i=0,s=void 0;i<e.length;i++)(s=e[i])&&s.from>n&&s.to<r&&((o||(o=[])).push(s),e[i]=null);return o}function Dt(e){for(var t=[],n=0;n<e.length;n++)null!=e[n]&&t.push(e[n]);return t}function At(e,t,n,r){var o=[],i=!1;t.forEach(function(t,s){var a=Tt(e,t,s+n);if(a){i=!0;var c=At(a,t,n+s+1,r);c!=Ot&&o.push(s,s+t.nodeSize,c)}});for(var s=Nt(i?Dt(e):e,-n).sort(Et),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||o.length?new Ct(s,o):Ot}function Et(e,t){return e.from-t.from||e.to-t.to}function Rt(e){for(var t=e,n=0;n<t.length-1;n++){var r=t[n];if(r.from!=r.to)for(var o=n+1;o<t.length;o++){var i=t[o];if(i.from!=r.from){i.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,i.from),_t(t,o,r.copy(i.from,r.to)));break}i.to!=r.to&&(t==e&&(t=e.slice()),t[o]=i.copy(i.from,r.to),_t(t,o+1,i.copy(r.to,i.to)))}}return t}function _t(e,t,n){for(;t<e.length&&Et(n,e[t])>0;)t++;e.splice(t,0,n)}function Pt(e){var t=[];return e.someProp("decorations",function(n){var r=n(e.state);r&&r!=Ot&&t.push(r)}),e.cursorWrapper&&t.push(Ct.create(e.state.doc,[e.cursorWrapper.deco])),Mt.from(t)}Mt.prototype.forChild=function(e,t){if(t.isLeaf)return Ct.empty;for(var n=[],r=0;r<this.members.length;r++){var o=this.members[r].forChild(e,t);o!=Ot&&(o instanceof Mt?n=n.concat(o.members):n.push(o))}return Mt.from(n)},Mt.prototype.eq=function(e){if(!(e instanceof Mt)||e.members.length!=this.members.length)return!1;for(var t=0;t<this.members.length;t++)if(!this.members[t].eq(e.members[t]))return!1;return!0},Mt.prototype.locals=function(e){for(var t,n=!0,r=0;r<this.members.length;r++){var o=this.members[r].localsInner(e);if(o.length)if(t){n&&(t=t.slice(),n=!1);for(var i=0;i<o.length;i++)t.push(o[i])}else t=o}return t?Rt(n?t:t.sort(Et)):xt},Mt.from=function(e){switch(e.length){case 0:return Ot;case 1:return e[0];default:return new Mt(e)}};var $t=function(e,t){this._props=t,this.state=t.state,this.dispatch=this.dispatch.bind(this),this._root=null,this.focused=!1,this.trackWrites=null,this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):e.apply?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=Ft(this),this.markCursor=null,this.cursorWrapper=null,Bt(this),this.nodeViews=Vt(this),this.docView=U(this.state.doc,zt(this),Pt(this),this.dom,this),this.lastSelectedViewDesc=null,this.dragging=null,function(e){e.shiftKey=!1,e.mouseDown=null,e.lastKeyCode=null,e.lastKeyCodeTime=0,e.lastClick={time:0,x:0,y:0,type:""},e.lastSelectionOrigin=null,e.lastSelectionTime=0,e.lastIOSEnter=0,e.lastIOSEnterFallbackTimeout=null,e.composing=!1,e.composingTimeout=null,e.compositionNodes=[],e.compositionEndedAt=-2e8,e.domObserver=new Je(e,function(t,n,r,o){return _e(e,t,n,r,o)}),e.domObserver.start(),e.domChangeCount=0,e.eventHandlers=Object.create(null);var t=function(t){var n=Ue[t];e.dom.addEventListener(t,e.eventHandlers[t]=function(t){!function(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(var n=t.target;n!=e.dom;n=n.parentNode)if(!n||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}(e,t)||Ye(e,t)||!e.editable&&t.type in Ge||n(e,t)})};for(var n in Ue)t(n);s.safari&&e.dom.addEventListener("input",function(){return null}),Ze(e)}(this),this.pluginViews=[],this.updatePluginViews()},It={props:{configurable:!0},root:{configurable:!0}};function zt(e){var t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),e.someProp("attributes",function(n){if("function"==typeof n&&(n=n(e.state)),n)for(var r in n)"class"==r?t.class+=" "+n[r]:t[r]||"contenteditable"==r||"nodeName"==r||(t[r]=String(n[r]))}),[wt.node(0,e.state.doc.content.size,t)]}function Bt(e){if(e.markCursor){var t=document.createElement("img");t.setAttribute("mark-placeholder","true"),e.cursorWrapper={dom:t,deco:wt.widget(e.state.selection.head,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function Ft(e){return!e.someProp("editable",function(t){return!1===t(e.state)})}function Vt(e){var t={};return e.someProp("nodeViews",function(e){for(var n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n])}),t}It.props.get=function(){if(this._props.state!=this.state){var e=this._props;for(var t in this._props={},e)this._props[t]=e[t];this._props.state=this.state}return this._props},$t.prototype.update=function(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Ze(this),this._props=e,this.updateStateInner(e.state,!0)},$t.prototype.setProps=function(e){var t={};for(var n in this._props)t[n]=this._props[n];for(var r in t.state=this.state,e)t[r]=e[r];this.update(t)},$t.prototype.updateState=function(e){this.updateStateInner(e,this.state.plugins!=e.plugins)},$t.prototype.updateStateInner=function(e,t){var n=this,o=this.state,i=!1,a=!1;if(e.storedMarks&&this.composing&&(ut(this),a=!0),this.state=e,t){var c=Vt(this);(function(e,t){var n=0,r=0;for(var o in e){if(e[o]!=t[o])return!0;n++}for(var i in t)r++;return n!=r})(c,this.nodeViews)&&(this.nodeViews=c,i=!0),Ze(this)}this.editable=Ft(this),Bt(this);var l=Pt(this),u=zt(this),p=t?"reset":e.scrollToSelection>o.scrollToSelection?"to selection":"preserve",h=i||!this.docView.matchesNode(e.doc,u,l);!h&&e.selection.eq(o.selection)||(a=!0);var d="preserve"==p&&a&&null==this.dom.style.overflowAnchor&&function(e){for(var t,n,r=e.dom.getBoundingClientRect(),o=Math.max(0,r.top),i=(r.left+r.right)/2,s=o+1;s<Math.min(innerHeight,r.bottom);s+=5){var a=e.root.elementFromPoint(i,s);if(a!=e.dom&&e.dom.contains(a)){var c=a.getBoundingClientRect();if(c.top>=o-20){t=a,n=c.top;break}}}return{refDOM:t,refTop:n,stack:M(e.dom)}}(this);if(a){this.domObserver.stop();var f=h&&(s.ie||s.chrome)&&!this.composing&&!o.selection.empty&&!e.selection.empty&&function(e,t){var n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}(o.selection,e.selection);if(h){var v=s.chrome?this.trackWrites=this.root.getSelection().focusNode:null;!i&&this.docView.update(e.doc,u,l,this)||(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=U(e.doc,u,l,this.dom,this)),v&&!this.trackWrites&&(f=!0)}f||!(this.mouseDown&&this.domObserver.currentSelection.eq(this.root.getSelection())&&function(e){var t=e.docView.domFromPos(e.state.selection.anchor),n=e.root.getSelection();return m(t.node,t.offset,n.anchorNode,n.anchorOffset)}(this))?ke(this,f):(Te(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}if(this.updatePluginViews(o),"reset"==p)this.dom.scrollTop=0;else if("to selection"==p){var g=this.root.getSelection().focusNode;this.someProp("handleScrollToSelection",function(e){return e(n)})||(e.selection instanceof r.NodeSelection?O(this,this.docView.domAfterPos(e.selection.from).getBoundingClientRect(),g):O(this,this.coordsAtPos(e.selection.head),g))}else d&&function(e){var t=e.refDOM,n=e.refTop,r=e.stack,o=t?t.getBoundingClientRect().top:0;N(r,0==o?0:o-n)}(d)},$t.prototype.destroyPluginViews=function(){for(var e;e=this.pluginViews.pop();)e.destroy&&e.destroy()},$t.prototype.updatePluginViews=function(e){if(e&&e.plugins==this.state.plugins)for(var t=0;t<this.pluginViews.length;t++){var n=this.pluginViews[t];n.update&&n.update(this,e)}else{this.destroyPluginViews();for(var r=0;r<this.state.plugins.length;r++){var o=this.state.plugins[r];o.spec.view&&this.pluginViews.push(o.spec.view(this))}}},$t.prototype.someProp=function(e,t){var n,r=this._props&&this._props[e];if(null!=r&&(n=t?t(r):r))return n;var o=this.state.plugins;if(o)for(var i=0;i<o.length;i++){var s=o[i].props[e];if(null!=s&&(n=t?t(s):s))return n}},$t.prototype.hasFocus=function(){return this.root.activeElement==this.dom},$t.prototype.focus=function(){this.domObserver.stop(),this.editable&&function(e){if(e.setActive)return e.setActive();if(T)return e.focus(T);var t=M(e);e.focus(null==T?{get preventScroll(){return T={preventScroll:!0},!0}}:void 0),T||(T=!1,N(t,0))}(this.dom),ke(this),this.domObserver.start()},It.root.get=function(){var e=this._root;if(null==e)for(var t=this.dom.parentNode;t;t=t.parentNode)if(9==t.nodeType||11==t.nodeType&&t.host)return t.getSelection||(Object.getPrototypeOf(t).getSelection=function(){return document.getSelection()}),this._root=t;return e||document},$t.prototype.posAtCoords=function(e){return E(this,e)},$t.prototype.coordsAtPos=function(e){return _(this,e)},$t.prototype.domAtPos=function(e){return this.docView.domFromPos(e)},$t.prototype.nodeDOM=function(e){var t=this.docView.descAt(e);return t?t.nodeDOM:null},$t.prototype.posAtDOM=function(e,t,n){void 0===n&&(n=-1);var r=this.docView.posFromDOM(e,t,n);if(null==r)throw new RangeError("DOM position not inside the editor");return r},$t.prototype.endOfTextblock=function(e,t){return V(this,t||this.state,e)},$t.prototype.destroy=function(){this.docView&&(!function(e){for(var t in e.domObserver.stop(),e.eventHandlers)e.dom.removeEventListener(t,e.eventHandlers[t]);clearTimeout(e.composingTimeout),clearTimeout(e.lastIOSEnterFallbackTimeout)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Pt(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)},$t.prototype.dispatchEvent=function(e){return function(e,t){Ye(e,t)||!Ue[t.type]||!e.editable&&t.type in Ge||Ue[t.type](e,t)}(this,e)},$t.prototype.dispatch=function(e){var t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))},Object.defineProperties($t.prototype,It);var jt=function(e,t){var n=this;this.editorView=e,this.width=t.width||1,this.color=t.color||"black",this.class=t.class,this.cursorPos=null,this.element=null,this.timeout=null,this.handlers=["dragover","dragend","drop","dragleave"].map(function(t){var r=function(e){return n[t](e)};return e.dom.addEventListener(t,r),{name:t,handler:r}})};jt.prototype.destroy=function(){var e=this;this.handlers.forEach(function(t){var n=t.name,r=t.handler;return e.editorView.dom.removeEventListener(n,r)})},jt.prototype.update=function(e,t){null!=this.cursorPos&&t.doc!=e.state.doc&&this.updateOverlay()},jt.prototype.setCursor=function(e){e!=this.cursorPos&&(this.cursorPos=e,null==e?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())},jt.prototype.updateOverlay=function(){var e,t=this.editorView.state.doc.resolve(this.cursorPos);if(!t.parent.inlineContent){var n=t.nodeBefore,r=t.nodeAfter;if(n||r){var o=this.editorView.nodeDOM(this.cursorPos-(n?n.nodeSize:0)).getBoundingClientRect(),i=n?o.bottom:o.top;n&&r&&(i=(i+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),e={left:o.left,right:o.right,top:i-this.width/2,bottom:i+this.width/2}}}if(!e){var s=this.editorView.coordsAtPos(this.cursorPos);e={left:s.left-this.width/2,right:s.left+this.width/2,top:s.top,bottom:s.bottom}}var a=this.editorView.dom.offsetParent;this.element||(this.element=a.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none; background-color: "+this.color);var c=!a||a==document.body&&"static"==getComputedStyle(a).position?{left:-pageXOffset,top:-pageYOffset}:a.getBoundingClientRect();this.element.style.left=e.left-c.left+"px",this.element.style.top=e.top-c.top+"px",this.element.style.width=e.right-e.left+"px",this.element.style.height=e.bottom-e.top+"px"},jt.prototype.scheduleRemoval=function(e){var t=this;clearTimeout(this.timeout),this.timeout=setTimeout(function(){return t.setCursor(null)},e)},jt.prototype.dragover=function(e){if(this.editorView.editable){var t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY});if(t){var n=t.pos;this.editorView.dragging&&this.editorView.dragging.slice&&null==(n=Object(i.h)(this.editorView.state.doc,n,this.editorView.dragging.slice))&&(n=t.pos),this.setCursor(n),this.scheduleRemoval(5e3)}}},jt.prototype.dragend=function(){this.scheduleRemoval(20)},jt.prototype.drop=function(){this.scheduleRemoval(20)},jt.prototype.dragleave=function(e){e.target!=this.editorView.dom&&this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)};var Lt=n("fwbU"),qt=n("V2qZ"),Wt=function(e){function t(t){e.call(this,t,t)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.map=function(n,r){var o=n.resolve(r.map(this.head));return t.valid(o)?new t(o):e.near(o)},t.prototype.content=function(){return o.Slice.empty},t.prototype.eq=function(e){return e instanceof t&&e.head==this.head},t.prototype.toJSON=function(){return{type:"gapcursor",pos:this.head}},t.fromJSON=function(e,n){if("number"!=typeof n.pos)throw new RangeError("Invalid input for GapCursor.fromJSON");return new t(e.resolve(n.pos))},t.prototype.getBookmark=function(){return new Kt(this.anchor)},t.valid=function(e){var t=e.parent;if(t.isTextblock||!function(e){for(var t=e.depth;t>=0;t--){var n=e.index(t);if(0!=n)for(var r=e.node(t).child(n-1);;r=r.lastChild){if(0==r.childCount&&!r.inlineContent||r.isAtom||r.type.spec.isolating)return!0;if(r.inlineContent)return!1}}return!0}(e)||!function(e){for(var t=e.depth;t>=0;t--){var n=e.indexAfter(t),r=e.node(t);if(n!=r.childCount)for(var o=r.child(n);;o=o.firstChild){if(0==o.childCount&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}}return!0}(e))return!1;var n=t.type.spec.allowGapCursor;if(null!=n)return n;var r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock},t.findFrom=function(e,n,o){e:for(;;){if(!o&&t.valid(e))return e;for(var i=e.pos,s=null,a=e.depth;;a--){var c=e.node(a);if(n>0?e.indexAfter(a)<c.childCount:e.index(a)>0){s=c.child(n>0?e.indexAfter(a):e.index(a)-1);break}if(0==a)return null;i+=n;var l=e.doc.resolve(i);if(t.valid(l))return l}for(;;){var u=n>0?s.firstChild:s.lastChild;if(!u){if(s.isAtom&&!s.isText&&!r.NodeSelection.isSelectable(s)){e=e.doc.resolve(i+s.nodeSize*n),o=!1;continue e}break}s=u,i+=n;var p=e.doc.resolve(i);if(t.valid(p))return p}return null}},t}(r.Selection);Wt.prototype.visible=!1,r.Selection.jsonID("gapcursor",Wt);var Kt=function(e){this.pos=e};Kt.prototype.map=function(e){return new Kt(e.map(this.pos))},Kt.prototype.resolve=function(e){var t=e.resolve(this.pos);return Wt.valid(t)?new Wt(t):r.Selection.near(t)};var Jt=function(){return new r.Plugin({props:{decorations:Xt,createSelectionBetween:function(e,t,n){if(t.pos==n.pos&&Wt.valid(n))return new Wt(n)},handleClick:Gt,handleKeyDown:Ht}})},Ht=Object(Lt.a)({ArrowLeft:Ut("horiz",-1),ArrowRight:Ut("horiz",1),ArrowUp:Ut("vert",-1),ArrowDown:Ut("vert",1)});function Ut(e,t){var n="vert"==e?t>0?"down":"up":t>0?"right":"left";return function(e,o,i){var s=e.selection,a=t>0?s.$to:s.$from,c=s.empty;if(s instanceof r.TextSelection){if(!i.endOfTextblock(n)||0==a.depth)return!1;c=!1,a=e.doc.resolve(t>0?a.after():a.before())}var l=Wt.findFrom(a,t,c);return!!l&&(o&&o(e.tr.setSelection(new Wt(l))),!0)}}function Gt(e,t,n){if(!e.editable)return!1;var o=e.state.doc.resolve(t);if(!Wt.valid(o))return!1;var i=e.posAtCoords({left:n.clientX,top:n.clientY}).inside;return!(i>-1&&r.NodeSelection.isSelectable(e.state.doc.nodeAt(i)))&&(e.dispatch(e.state.tr.setSelection(new Wt(o))),!0)}function Xt(e){if(!(e.selection instanceof Wt))return null;var t=document.createElement("div");return t.className="ProseMirror-gapcursor",qt.b.create(e.doc,[qt.a.widget(e.selection.head,t,{key:"gapcursor"})])}var Zt=n("ABBN"),Yt=n("+V57"),Qt=n("oV9I"),en=n("Kw5r"),tn=n("qd4/");class nn{constructor(e,{editor:t,extension:n,parent:r,node:o,view:i,decorations:s,getPos:a}){this.component=e,this.editor=t,this.extension=n,this.parent=r,this.node=o,this.view=i,this.decorations=s,this.isNode=!!this.node.marks,this.isMark=!this.isNode,this.getPos=this.isMark?this.getMarkPos:a,this.captureEvents=!0,this.dom=this.createDOM(),this.contentDOM=this.vm.$refs.content}createDOM(){const e=en.default.extend(this.component),t={editor:this.editor,node:this.node,view:this.view,getPos:()=>this.getPos(),decorations:this.decorations,selected:!1,options:this.extension.options,updateAttrs:e=>this.updateAttrs(e)};return"function"==typeof this.extension.setSelection&&(this.setSelection=this.extension.setSelection),"function"==typeof this.extension.update&&(this.update=this.extension.update),this.vm=new e({parent:this.parent,propsData:t}).$mount(),this.vm.$el}update(e,t){return e.type===this.node.type&&(e===this.node&&this.decorations===t||(this.node=e,this.decorations=t,this.updateComponentProps({node:e,decorations:t}),!0))}updateComponentProps(e){if(!this.vm._props)return;const t=en.default.config.silent;en.default.config.silent=!0,Object.entries(e).forEach(([e,t])=>{this.vm._props[e]=t}),en.default.config.silent=t}updateAttrs(e){if(!this.view.editable)return;const{state:t}=this.view,{type:n}=this.node,r=this.getPos(),o={...this.node.attrs,...e},i=this.isMark?t.tr.removeMark(r.from,r.to,n).addMark(r.from,r.to,n.create(o)):t.tr.setNodeMarkup(r,null,o);this.view.dispatch(i)}ignoreMutation(e){return"selection"!==e.type&&(!this.contentDOM||!this.contentDOM.contains(e.target))}stopEvent(e){if("function"==typeof this.extension.stopEvent)return this.extension.stopEvent(e);const t=!!this.extension.schema.draggable;if(t&&"mousedown"===e.type){const t=e.target.closest&&e.target.closest("[data-drag-handle]");t&&(this.dom===t||this.dom.contains(t))&&(this.captureEvents=!1,document.addEventListener("dragend",()=>{this.captureEvents=!0},{once:!0}))}const n="copy"===e.type,r="paste"===e.type,o="cut"===e.type,i=e.type.startsWith("drag")||"drop"===e.type;return!(t&&i||n||r||o)&&this.captureEvents}selectNode(){this.updateComponentProps({selected:!0})}deselectNode(){this.updateComponentProps({selected:!1})}getMarkPos(){const e=this.view.posAtDOM(this.dom),t=this.view.state.doc.resolve(e);return Object(Qt.b)(t,this.node.type)}destroy(){this.vm.$destroy()}}class rn{on(e,t){return this._callbacks=this._callbacks||{},this._callbacks[e]||(this._callbacks[e]=[]),this._callbacks[e].push(t),this}emit(e,...t){this._callbacks=this._callbacks||{};const n=this._callbacks[e];return n&&n.forEach(e=>e.apply(this,t)),this}off(e,t){if(arguments.length){const n=this._callbacks?this._callbacks[e]:null;n&&(t?this._callbacks[e]=n.filter(e=>e!==t):delete this._callbacks[e])}else this._callbacks={};return this}}class on{constructor(e={}){this.options={...this.defaultOptions,...e}}init(){return null}bindEditor(e=null){this.editor=e}get name(){return null}get type(){return"extension"}get defaultOptions(){return{}}get plugins(){return[]}inputRules(){return[]}pasteRules(){return[]}keys(){return{}}}class sn{constructor(e=[],t){e.forEach(e=>{e.bindEditor(t),e.init()}),this.extensions=e}get nodes(){return this.extensions.filter(e=>"node"===e.type).reduce((e,{name:t,schema:n})=>({...e,[t]:n}),{})}get options(){const{view:e}=this;return this.extensions.reduce((t,n)=>({...t,[n.name]:new Proxy(n.options,{set(t,n,r){const o=t[n]!==r;return Object.assign(t,{[n]:r}),o&&e.updateState(e.state),!0}})}),{})}get marks(){return this.extensions.filter(e=>"mark"===e.type).reduce((e,{name:t,schema:n})=>({...e,[t]:n}),{})}get plugins(){return this.extensions.filter(e=>e.plugins).reduce((e,{plugins:t})=>[...e,...t],[])}keymaps({schema:e}){const t=this.extensions.filter(e=>["extension"].includes(e.type)).filter(e=>e.keys).map(t=>t.keys({schema:e})),n=this.extensions.filter(e=>["node","mark"].includes(e.type)).filter(e=>e.keys).map(t=>t.keys({type:e["".concat(t.type,"s")][t.name],schema:e}));return[...t,...n].map(e=>Object(Lt.b)(e))}inputRules({schema:e,excludedExtensions:t}){if(!(t instanceof Array)&&t)return[];const n=t instanceof Array?this.extensions.filter(e=>!t.includes(e.name)):this.extensions,r=n.filter(e=>["extension"].includes(e.type)).filter(e=>e.inputRules).map(t=>t.inputRules({schema:e})),o=n.filter(e=>["node","mark"].includes(e.type)).filter(e=>e.inputRules).map(t=>t.inputRules({type:e["".concat(t.type,"s")][t.name],schema:e}));return[...r,...o].reduce((e,t)=>[...e,...t],[])}pasteRules({schema:e,excludedExtensions:t}){if(!(t instanceof Array)&&t)return[];const n=t instanceof Array?this.extensions.filter(e=>!t.includes(e.name)):this.extensions,r=n.filter(e=>["extension"].includes(e.type)).filter(e=>e.pasteRules).map(t=>t.pasteRules({schema:e})),o=n.filter(e=>["node","mark"].includes(e.type)).filter(e=>e.pasteRules).map(t=>t.pasteRules({type:e["".concat(t.type,"s")][t.name],schema:e}));return[...r,...o].reduce((e,t)=>[...e,...t],[])}commands({schema:e,view:t}){return this.extensions.filter(e=>e.commands).reduce((n,r)=>{const{name:o,type:i}=r,s={},a=r.commands({schema:e,...["node","mark"].includes(i)?{type:e["".concat(i,"s")][o]}:{}}),c=(e,n)=>!!t.editable&&(t.focus(),e(n)(t.state,t.dispatch,t)),l=(e,t)=>{Array.isArray(t)?s[e]=(e=>t.forEach(t=>c(t,e))):"function"==typeof t&&(s[e]=(e=>c(t,e)))};return"object"==typeof a?Object.entries(a).forEach(([e,t])=>{l(e,t)}):l(o,a),{...n,...s}},{})}}class an extends on{constructor(e={}){super(e)}get type(){return"mark"}get view(){return null}get schema(){return null}command(){return()=>{}}}function cn(e=0,t=0,n=0){return Math.min(Math.max(parseInt(e,10),t),n)}class ln extends on{constructor(e={}){super(e)}get type(){return"node"}get view(){return null}get schema(){return null}command(){return()=>{}}}class un extends ln{get name(){return"doc"}get schema(){return{content:"block+"}}}class pn extends ln{get name(){return"paragraph"}get schema(){return{content:"inline*",group:"block",draggable:!1,parseDOM:[{tag:"p"}],toDOM:()=>["p",0]}}commands({type:e}){return()=>Object(tn.k)(e)}}class hn extends ln{get name(){return"text"}get schema(){return{group:"inline"}}}var dn='.ProseMirror {\n position: relative;\n}\n\n.ProseMirror {\n word-wrap: break-word;\n white-space: pre-wrap;\n -webkit-font-variant-ligatures: none;\n font-variant-ligatures: none;\n}\n\n.ProseMirror pre {\n white-space: pre-wrap;\n}\n\n.ProseMirror-gapcursor {\n display: none;\n pointer-events: none;\n position: absolute;\n}\n\n.ProseMirror-gapcursor:after {\n content: "";\n display: block;\n position: absolute;\n top: -2px;\n width: 20px;\n border-top: 1px solid black;\n animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;\n}\n\n@keyframes ProseMirror-cursor-blink {\n to {\n visibility: hidden;\n }\n}\n\n.ProseMirror-hideselection *::selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection *::-moz-selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection * {\n caret-color: transparent;\n}\n\n.ProseMirror-focused .ProseMirror-gapcursor {\n display: block;\n}\n';class fn extends rn{constructor(e={}){super(),this.defaultOptions={editorProps:{},editable:!0,autoFocus:null,extensions:[],content:"",topNode:"doc",emptyDocument:{type:"doc",content:[{type:"paragraph"}]},useBuiltInExtensions:!0,disableInputRules:!1,disablePasteRules:!1,dropCursor:{},enableDropCursor:!0,enableGapCursor:!0,parseOptions:{},injectCSS:!0,onInit:()=>{},onTransaction:()=>{},onUpdate:()=>{},onFocus:()=>{},onBlur:()=>{},onPaste:()=>{},onDrop:()=>{}},this.events=["init","transaction","update","focus","blur","paste","drop"],this.init(e)}init(e={}){this.setOptions({...this.defaultOptions,...e}),this.focused=!1,this.selection={from:0,to:0},this.element=document.createElement("div"),this.extensions=this.createExtensions(),this.nodes=this.createNodes(),this.marks=this.createMarks(),this.schema=this.createSchema(),this.plugins=this.createPlugins(),this.keymaps=this.createKeymaps(),this.inputRules=this.createInputRules(),this.pasteRules=this.createPasteRules(),this.view=this.createView(),this.commands=this.createCommands(),this.setActiveNodesAndMarks(),this.options.injectCSS&&function(e){{const t=document.createElement("style");t.type="text/css",t.textContent=e;const{head:n}=document,{firstChild:r}=n;r?n.insertBefore(t,r):n.appendChild(t)}}(dn),null!==this.options.autoFocus&&this.focus(this.options.autoFocus),this.events.forEach(e=>{this.on(e,this.options[
+/*!
+ * tiptap v1.29.5
+ * (c) 2020 überdosis GbR (limited liability)
+ * @license MIT
+ */
+function(e){return e.replace(/(?:^\w|[A-Z]|\b\w)/g,(e,t)=>0===t?e.toLowerCase():e.toUpperCase()).replace(/\s+/g,"")}("on ".concat(e))]||(()=>{}))}),this.emit("init",{view:this.view,state:this.state}),this.extensions.view=this.view}setOptions(e){this.options={...this.options,...e},this.view&&this.state&&this.view.updateState(this.state)}get builtInExtensions(){return this.options.useBuiltInExtensions?[new un,new hn,new pn]:[]}get state(){return this.view?this.view.state:null}createExtensions(){return new sn([...this.builtInExtensions,...this.options.extensions],this)}createPlugins(){return this.extensions.plugins}createKeymaps(){return this.extensions.keymaps({schema:this.schema})}createInputRules(){return this.extensions.inputRules({schema:this.schema,excludedExtensions:this.options.disableInputRules})}createPasteRules(){return this.extensions.pasteRules({schema:this.schema,excludedExtensions:this.options.disablePasteRules})}createCommands(){return this.extensions.commands({schema:this.schema,view:this.view})}createNodes(){return this.extensions.nodes}createMarks(){return this.extensions.marks}createSchema(){return new o.Schema({topNode:this.options.topNode,nodes:this.nodes,marks:this.marks})}createState(){return r.EditorState.create({schema:this.schema,doc:this.createDocument(this.options.content),plugins:[...this.plugins,Object(Yt.b)({rules:this.inputRules}),...this.pasteRules,...this.keymaps,Object(Lt.b)({Backspace:Yt.d}),Object(Lt.b)(Zt.a),...this.options.enableDropCursor?[function(e){return void 0===e&&(e={}),new r.Plugin({view:function(t){return new jt(t,e)}})}(this.options.dropCursor)]:[],...this.options.enableGapCursor?[Jt()]:[],new r.Plugin({key:new r.PluginKey("editable"),props:{editable:()=>this.options.editable}}),new r.Plugin({props:{attributes:{tabindex:0},handleDOMEvents:{focus:(e,t)=>{this.focused=!0,this.emit("focus",{event:t,state:e.state,view:e});const n=this.state.tr.setMeta("focused",!0);this.view.dispatch(n)},blur:(e,t)=>{this.focused=!1,this.emit("blur",{event:t,state:e.state,view:e});const n=this.state.tr.setMeta("focused",!1);this.view.dispatch(n)}}}}),new r.Plugin({props:this.options.editorProps})]})}createDocument(e,t=this.options.parseOptions){if(null===e)return this.schema.nodeFromJSON(this.options.emptyDocument);if("object"==typeof e)try{return this.schema.nodeFromJSON(e)}catch(t){return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",t),this.schema.nodeFromJSON(this.options.emptyDocument)}if("string"==typeof e){const n="<div>".concat(e,"</div>"),r=(new window.DOMParser).parseFromString(n,"text/html").body.firstElementChild;return o.DOMParser.fromSchema(this.schema).parse(r,t)}return!1}createView(){return new $t(this.element,{state:this.createState(),handlePaste:(...e)=>{this.emit("paste",...e)},handleDrop:(...e)=>{this.emit("drop",...e)},dispatchTransaction:this.dispatchTransaction.bind(this)})}setParentComponent(e=null){e&&this.view.setProps({nodeViews:this.initNodeViews({parent:e,extensions:[...this.builtInExtensions,...this.options.extensions]})})}initNodeViews({parent:e,extensions:t}){return t.filter(e=>["node","mark"].includes(e.type)).filter(e=>e.view).reduce((t,n)=>{return{...t,[n.name]:(t,r,o,i)=>{const s=n.view;return new nn(s,{editor:this,extension:n,parent:e,node:t,view:r,getPos:o,decorations:i})}}},{})}dispatchTransaction(e){const t=this.state.apply(e);this.view.updateState(t),this.selection={from:this.state.selection.from,to:this.state.selection.to},this.setActiveNodesAndMarks(),this.emit("transaction",{getHTML:this.getHTML.bind(this),getJSON:this.getJSON.bind(this),state:this.state,transaction:e}),e.docChanged&&!e.getMeta("preventUpdate")&&this.emitUpdate(e)}emitUpdate(e){this.emit("update",{getHTML:this.getHTML.bind(this),getJSON:this.getJSON.bind(this),state:this.state,transaction:e})}resolveSelection(e=null){if(this.selection&&null===e)return this.selection;if("start"===e||!0===e)return{from:0,to:0};if("end"===e){const{doc:e}=this.state;return{from:e.content.size,to:e.content.size}}return{from:e,to:e}}focus(e=null){if(this.view.focused&&null===e||!1===e)return;const{from:t,to:n}=this.resolveSelection(e);this.setSelection(t,n),setTimeout(()=>this.view.focus(),10)}setSelection(e=0,t=0){const{doc:n,tr:o}=this.state,i=cn(e,0,n.content.size),s=cn(t,0,n.content.size),a=r.TextSelection.create(n,i,s),c=o.setSelection(a);this.view.dispatch(c)}blur(){this.view.dom.blur()}getSchemaJSON(){return JSON.parse(JSON.stringify({nodes:this.extensions.nodes,marks:this.extensions.marks}))}getHTML(){const e=document.createElement("div"),t=o.DOMSerializer.fromSchema(this.schema).serializeFragment(this.state.doc.content);return e.appendChild(t),e.innerHTML}getJSON(){return this.state.doc.toJSON()}setContent(e={},t=!1,n){const{doc:o,tr:i}=this.state,s=this.createDocument(e,n),a=r.TextSelection.create(o,0,o.content.size),c=i.setSelection(a).replaceSelectionWith(s,!1).setMeta("preventUpdate",!t);this.view.dispatch(c)}clearContent(e=!1){this.setContent(this.options.emptyDocument,e)}setActiveNodesAndMarks(){this.activeMarks=Object.entries(this.schema.marks).reduce((e,[t,n])=>({...e,[t]:(e={})=>Object(Qt.d)(this.state,n,e)}),{}),this.activeMarkAttrs=Object.entries(this.schema.marks).reduce((e,[t,n])=>({...e,[t]:Object(Qt.a)(this.state,n)}),{}),this.activeNodes=Object.entries(this.schema.nodes).reduce((e,[t,n])=>({...e,[t]:(e={})=>Object(Qt.f)(this.state,n,e)}),{})}getMarkAttrs(e=null){return this.activeMarkAttrs[e]}getNodeAttrs(e=null){return{...Object(Qt.c)(this.state,this.schema.nodes[e])}}get isActive(){return Object.entries({...this.activeMarks,...this.activeNodes}).reduce((e,[t,n])=>({...e,[t]:(e={})=>n(e)}),{})}registerPlugin(e=null,t){const n="function"==typeof t?t(e,this.state.plugins):[e,...this.state.plugins],r=this.state.reconfigure({plugins:n});this.view.updateState(r)}unregisterPlugin(e=null){if(!e||!this.view.docView)return;const t=this.state.reconfigure({plugins:this.state.plugins.filter(t=>!t.key.startsWith("".concat(e,"$")))});this.view.updateState(t)}destroy(){this.view&&this.view.destroy()}}var mn={props:{editor:{default:null,type:Object}},watch:{editor:{immediate:!0,handler(e){e&&e.element&&this.$nextTick(()=>{this.$el.appendChild(e.element.firstChild),e.setParentComponent(this)})}}},render:e=>e("div"),beforeDestroy(){this.editor.element=this.$el}};class vn{constructor({options:e}){this.options=e,this.preventHide=!1,this.mousedownHandler=this.handleClick.bind(this),this.options.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.blurHandler=(()=>{this.preventHide?this.preventHide=!1:this.options.editor.emit("menubar:focusUpdate",!1)}),this.options.editor.on("blur",this.blurHandler)}handleClick(){this.preventHide=!0}destroy(){this.options.element.removeEventListener("mousedown",this.mousedownHandler),this.options.editor.off("blur",this.blurHandler)}}var gn={props:{editor:{default:null,type:Object}},data:()=>({focused:!1}),watch:{editor:{immediate:!0,handler(e){e&&this.$nextTick(()=>{e.registerPlugin(function(e){return new r.Plugin({key:new r.PluginKey("menu_bar"),view:t=>new vn({editorView:t,options:e})})}({editor:e,element:this.$el})),this.focused=e.focused,e.on("focus",()=>{this.focused=!0}),e.on("menubar:focusUpdate",e=>{this.focused=e})})}}},render(){return this.editor?this.$scopedSlots.default({focused:this.focused,focus:this.editor.focus,commands:this.editor.commands,isActive:this.editor.isActive,getMarkAttrs:this.editor.getMarkAttrs.bind(this.editor),getNodeAttrs:this.editor.getNodeAttrs.bind(this.editor)}):null}};Object,Boolean;Object}}]);
+//# sourceMappingURL=chunk-68ea.6d56674a.js.map \ No newline at end of file