(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=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(;cAn error occurred:

"+p(e.message+"",!0)+"
";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,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}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"}function u(e){i+=""}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="",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+=``}}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;i0&&(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||"")+'"');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?"
":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(//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=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.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 eo&&!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=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;cv&&(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;l500&&(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=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=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;o0))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.parentOffset1&&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;re)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;se)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=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;no&&s0},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||or.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(ni;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=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;it;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)=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=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;n1&&(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;ro){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(ot.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;a1||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;S1&&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=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=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(a0&&(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>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;ne&&!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);oe)for(var o=0,s=0;se&&((st)&&(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;tthis.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;rthis.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;te.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=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;an)&&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;s0;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=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=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;ne&&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=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>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"+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-1},H.prototype.allowsMarks=function(e){if(null==this.markSet)return!0;for(var t=0;t-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-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;ne.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=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;sthis.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-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=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;pc)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(;++fa.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?'
'+(n?e:i(e,!0))+"
\n":"
"+(n?e:i(e,!0))+"
"}blockquote(e){return"
\n"+e+"
\n"}html(e){return e}heading(e,t,n,r){return this.options.headerIds?"'+e+"\n":""+e+"\n"}hr(){return this.options.xhtml?"
\n":"
\n"}list(e,t,n){const r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"\n"}listitem(e){return"
  • "+e+"
  • \n"}checkbox(e){return" "}paragraph(e){return"

    "+e+"

    \n"}table(e,t){return t&&(t=""+t+""),"\n\n"+e+"\n"+t+"
    \n"}tablerow(e){return"\n"+e+"\n"}tablecell(e,t){const n=t.header?"th":"td";return(t.align?"<"+n+' align="'+t.align+'">':"<"+n+">")+e+"\n"}strong(e){return""+e+""}em(e){return""+e+""}codespan(e){return""+e+""}br(){return this.options.xhtml?"
    ":"
    "}del(e){return""+e+""}link(e,t,n){if(null===(e=o(this.options.sanitize,this.options.baseUrl,e)))return n;let r='"}image(e,t,n){if(null===(e=o(this.options.sanitize,this.options.baseUrl,e)))return n;let r=''+n+'":">"}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 ?/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;v1?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=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).pos0?0:1);o>0?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(!(r0},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-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.topc.bottom-k(r,"bottom")&&(u=t.bottom-c.bottom+k(o,"bottom")),t.leftc.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=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=(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=(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.topt.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-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])&&o0&&ol.top&&("up"==n?l.bottomi.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;t0: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=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;dc&&it){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=n:en){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.dirty0&&(i=ce(i,0,e,r));for(var a=0;ai;)l.push(o[c++]);var y=i+m.nodeSize;if(m.isText){var b=y;c=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;st+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=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;i0&&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=n||u<=t?i.push(c):(ln&&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=this.preMatchOffset?this.preMatched[e-this.preMatchOffset]:null},se.prototype.destroyBetween=function(e,t){if(e!=t){for(var n=e;n>1,i=Math.min(o,e.length);r-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-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.index0?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&&r0){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-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=a?i-r:0;c=(i-=u)+(c-a),a=i}else if(c=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.frome.state.selection.from&&b.start<=e.state.selection.from+2?b.start=e.state.selection.from: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.posb.start&&function(e,t,n,r,o){if(!r.parent.isTextblock||n-t<=o.pos-r.pos||$e(r,!0,!1)n||$e(s,!0,!1)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*]*>)*/.exec(e);t&&(e=e.slice(t[0].length));var n,r=Le().createElement("div"),o=/(?:]*>)*<([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""}).reverse().join(""),i=n.length);r.innerHTML=e;for(var s=0;s=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=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=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;te.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-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;c1){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;ii.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=e&&(!o||o(s.spec))&&n.push(s.copy(s.from+r,s.to+r))}for(var a=0;ae){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;sc+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=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;is&&l.to=e){this.children[o]==e&&(n=this.children[o+2]);break}for(var i=e+1,s=i+t.content.size,a=0;ai&&c.type instanceof yt){var l=Math.max(i,c.from)-i,u=Math.min(s,c.to)-i;ln&&s.to0;)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;ro.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=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;tr&&(i+=l.attrs.colspan)}for(var u=0;u1&&(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=n){(i||(i=[])).push({type:"overlong_rowspan",pos:u,n:y-w});break}for(var S=o+w*t,x=0;x0;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;o0||v>0){var g=d.attrs;m>0&&(g=E(g,0,m)),v>0&&(g=E(g,g.colspan-v,v)),d=h.leftr.bottom){var y=A(d.attrs,"rowspan",Math.min(h.bottom,r.bottom)-Math.max(h.top,r.top));d=h.top0)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.bottom0&&(n=a.resolve(o+r.map[s.left])),i.bottom0)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.right0&&(n=a.resolve(o+r.map[s.top*r.width])),i.right0&&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=0;i--)for(var a=o.child(i).attrs,c=a.rowspan,l=a.colspan,u=r;u=t.length&&t.push(s.Fragment.empty),n[d]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;mn&&(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;lt.width)for(var p=0,h=0;pt.height){for(var g=[],y=0,w=(t.height-1)*t.width;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=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;c0){var k="cell";w.firstChild&&(k=w.firstChild.type.spec.tableRole);for(var C=[],O=0;O0?-1:0;_(r,i,n+s)&&(s=0==n||n==r.width?null:0);for(var a=0;a0&&n0&&r.map[c-1]==l||n0?-1:0;ce(r,i,n+l)&&(l=0==n||n==r.height?null:0);for(var u=0,p=r.width*n;u0&&n0&&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(n0&&o[s]==o[s-1]||t.right0&&o[i]==o[i-n]||t.bottom0;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=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()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-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-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=0&&!(t.after(i+1)=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 ?(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]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|\\n*|\\n*|)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\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.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",")|<(?: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",")|<(?: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",")|<(?:script|pre|style|!--)").replace("tag",s._tag).getRegex(),s.pedantic=i({},s.normal,{html:o("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\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:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\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-]*(?:attribute)*?\\s*/?>|^<\\?[\\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]*?(?:(?=[\\?@\\[^_{|}~"};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]*?(?:(?=[\\",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;a127)&&(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&&/^/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.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;r1&&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;an[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;c1&&n+o>e})(t);d.push.apply(d,function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t=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;he.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&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(;s2&&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=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;u0,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);al;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;hn&&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);anew 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}lnew 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={"&":"&","<":"<",">":">",'"':""","'":"'"},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=(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{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.lengthc.bottom-k(r,"bottom")&&(u=t.bottom-c.bottom+k(o,"bottom")),t.leftc.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=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=(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=(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.topt.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-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])&&o0&&ol.top&&("up"==n?l.bottomi.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;t0: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=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;dc&&it){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=n:en){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.dirty0&&(i=ce(i,0,e,r));for(var a=0;ai;)l.push(o[c++]);var y=i+m.nodeSize;if(m.isText){var b=y;c=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;st+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=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;i0&&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=n||u<=t?i.push(c):(ln&&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&&r0){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-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=this.preMatchOffset?this.preMatched[e-this.preMatchOffset]:null},se.prototype.destroyBetween=function(e,t){if(e!=t){for(var n=e;n>1,i=Math.min(o,e.length);r-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-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.indexDate.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=a?i-r:0;c=(i-=u)+(c-a),a=i}else if(c=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.frome.state.selection.from&&b.start<=e.state.selection.from+2?b.start=e.state.selection.from: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.posb.start&&function(e,t,n,r,o){if(!r.parent.isTextblock||n-t<=o.pos-r.pos||$e(r,!0,!1)n||$e(s,!0,!1)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*]*>)*/.exec(e);t&&(e=e.slice(t[0].length));var n,r=Le().createElement("div"),o=/(?:]*>)*<([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""}).reverse().join(""),i=n.length);r.innerHTML=e;for(var s=0;s=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=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=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;te.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-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;c1){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;ii.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=e&&(!o||o(s.spec))&&n.push(s.copy(s.from+r,s.to+r))}for(var a=0;ae){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;sc+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=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;is&&l.to=e){this.children[o]==e&&(n=this.children[o+2]);break}for(var i=e+1,s=i+t.content.size,a=0;ai&&c.type instanceof yt){var l=Math.max(i,c.from)-i,u=Math.min(s,c.to)-i;ln&&s.to0;)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;ro.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=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=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)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="
    ".concat(e,"
    "),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