1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[453],{98780:function(e,t,o){o.d(t,{EH:function(){return td},p:function(){return ts},tk:function(){return tD}});var n=o(76922),r=o(32230),i=o(21081),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),d=s.ie=!!(c||l||a);s.ie_version=c?document.documentMode||6:l?+l[1]:a?+a[1]:null,s.gecko=!d&&/gecko\/(\d+)/i.test(navigator.userAgent),s.gecko_version=s.gecko&&+(/Firefox\/(\d+)/.exec(navigator.userAgent)||[0,0])[1];var f=!d&&/Chrome\/(\d+)/.exec(navigator.userAgent);s.chrome=!!f,s.chrome_version=f&&+f[1],s.safari=!d&&/Apple Computer/.test(navigator.vendor),s.ios=s.safari&&(/Mobile\/\w+/.test(navigator.userAgent)||navigator.maxTouchPoints>2),s.mac=s.ios||/Mac/.test(navigator.platform),s.android=/Android \d/.test(navigator.userAgent),s.webkit="webkitFontSmoothing"in document.documentElement.style,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},p=function(e){var t=e.assignedSlot||e.parentNode;return t&&11==t.nodeType?t.host:t},u=null,m=function(e,t,o){var n=u||(u=document.createRange());return n.setEnd(e,null==o?e.nodeValue.length:o),n.setStart(e,t||0),n},v=function(e,t,o,n){return o&&(y(e,t,o,n,-1)||y(e,t,o,n,1))},g=/^(img|br|input|textarea|hr)$/i;function y(e,t,o,n,r){for(;;){if(e==o&&t==n)return!0;if(t==(r<0?0:b(e))){var i=e.parentNode;if(!i||1!=i.nodeType||function(e){for(var t,o=e;o&&!(t=o.pmViewDesc);o=o.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}(e)||g.test(e.nodeName)||"false"==e.contentEditable)return!1;t=h(e)+(r<0?0:1),e=i}else{if(1!=e.nodeType||"false"==(e=e.childNodes[t+(r<0?-1:0)]).contentEditable)return!1;t=r<0?b(e):0}}}function b(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}var w=function(e){var t=e.isCollapsed;return t&&s.chrome&&e.rangeCount&&!e.getRangeAt(0).collapsed&&(t=!1),t};function D(e,t){var o=document.createEvent("Event");
1return o.initEvent("keydown",!0,!0),o.keyCode=e,o.key=o.code=t,o}function N(e,t){return"number"==typeof e?e:e[t]}function O(e,t,o){for(var n=e.someProp("scrollThreshold")||0,r=e.someProp("scrollMargin")||5,i=e.dom.ownerDocument,s=o||e.dom;s;s=p(s))if(1==s.nodeType){var a=s==i.body||1!=s.nodeType,c=a?{left:0,right:i.documentElement.clientWidth,top:0,bottom:i.documentElement.clientHeight}:function(e){var t=e.getBoundingClientRect(),o=t.width/e.offsetWidth||1,n=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*o,top:t.top,bottom:t.top+e.clientHeight*n}}(s),l=0,d=0;if(t.top<c.top+N(n,"top")?d=-(c.top-t.top+N(r,"top")):t.bottom>c.bottom-N(n,"bottom")&&(d=t.bottom-c.bottom+N(r,"bottom")),t.left<c.left+N(n,"left")?l=-(c.left-t.left+N(r,"left")):t.right>c.right-N(n,"right")&&(l=t.right-c.right+N(r,"right")),l||d){if(a)i.defaultView.scrollBy(l,d);else{var f=s.scrollLeft,h=s.scrollTop;d&&(s.scrollTop+=d),l&&(s.scrollLeft+=l);var u=s.scrollLeft-f,m=s.scrollTop-h;t={left:t.left-u,top:t.top-m,right:t.right-u,bottom:t.bottom-m}}}if(a)break}}function S(e){for(var t=[],o=e.ownerDocument;e&&(t.push({dom:e,top:e.scrollTop,left:e.scrollLeft}),e!=o);e=p(e));return t}function C(e,t){for(var o=0;o<e.length;o++){var n=e[o],r=n.dom,i=n.top,s=n.left;r.scrollTop!=i+t&&(r.scrollTop=i+t),r.scrollLeft!=s&&(r.scrollLeft=s)}}var M=null;function k(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function x(e,t){var o=e.getClientRects();return o.length?o[t<0?0:o.length-1]:e.getBoundingClientRect()}var T=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function A(e,t,o){var n=e.docView.domFromPos(t,o<0?-1:1),r=n.node,i=n.offset,a=s.webkit||s.gecko;if(3==r.nodeType){if(a&&(T.test(r.nodeValue)||(o<0?!i:i==r.nodeValue.length))){var c=x(m(r,i,i),o);if(s.gecko&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){var l=x(m(r,i-1,i-1),-1);if(l.top==c.top){var d=x(m(r,i,i+1),-1);if(d.top!=c.top)return P(d,d.left<l.left)}}return c}var f=i,h=i,p=o<0?1:-1;return o<0&&!i?(h++,p=-1):o>=0&&i==r.nodeValue.length?(f--,p=1):o<0?f--:h++,P(x(m(r,f,h),p),p<0)}if(!e.state.doc.resolve(t).parent.inlineContent){if(i&&(o<0||i==b(r))){var u=r.childNodes[i-1];if(1==u.nodeType)return E(u.getBoundingClientRect(),!1)}if(i<b(r)){var v=r.childNodes[i];if(1==v.nodeType)return E(v.getBoundingClientRect(),!0)}return E(r.getBoundingClientRect(),o>=0)}if(i&&(o<0||i==b(r))){var g=r.childNodes[i-1],y=3==g.nodeType?m(g,b(g)-(a?0:1)):1!=g.nodeType||"BR"==g.nodeName&&g.nextSibling?null:g;if(y)return P(x(y,1),!1)}if(i<b(r)){for(var w=r.childNodes[i];w.pmViewDesc&&w.pmViewDesc.ignoreForCoords;)w=w.nextSibling;var D=w?3==w.nodeType?m(w,0,a?0:1):1==w.nodeType?w:null:null;if(D)return P(x(D,-1),!0)}return P(x(3==r.nodeType?m(r):r,-o),o>=0)}function P(e,t){if(0==e.width)return e;var o=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:o,right:o}}function E(e,t){if(0==e.height)return e;var o=t?e.top:e.bottom;return{top:o,bottom:o,left:e.left,right:e.right}}function V(e,t,o){var n=e.state,r=e.root.activeElement;n!=t&&e.updateState(t),r!=e.dom&&e.focus();try{return o()}finally{n!=t&&e.updateState(n),r!=e.dom&&r&&r.focus()}}var B=/[\u0590-\u08ac]/,R=null,z=null,I=!1,q=function(e,t,o,n){this.parent=e,this.children=t,this.dom=o,o.pmViewDesc=this,this.contentDOM=n,this.dirty=0},_={size:{configurable:!0},border:{configurable:!0},posBefore:{configurable:!0},posAtStart:{configurable:!0},posAfter:{configurable:!0},posAtEnd:{configurable:!0},contentLost:{configurable:!0},domAtom:{configurable:!0},ignoreForCoords:{configurable:!0}};q.prototype.matchesWidget=function(){return!1},q.prototype.matchesMark=function(){return!1},q.prototype.matchesNode=function(){return!1},q.prototype.matchesHack=function(e){return!1},q.prototype.parseRule=function(){return null},q.prototype.stopEvent=function(){return!1},_.size.get=function(){for(var e=0,t=0;t<this.children.length;t++)e+=this.children[t].size;return e},_.border.get=function(){return 0},q.prototype.destroy=function(){this.parent=null,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=null);for(var e=0;e<this.children.length;e++)this.children[e].destroy()},q.prototype.posBeforeChild=function(e){for(var t=0,o=this.posAtStart;t<this.children.length;t++){var n=this.children[t];if(n==e)return o;o+=n.size}},_.posBefore.get=function(){return this.parent.posBeforeChild(this)},_.posAtStart.get=function(){return this.parent?this.parent.posBeforeChild(this)+this.border:0},_.posAfter.get=function(){return this.posBefore+this.size},_.posAtEnd.get=function(){return this.posAtStart+this.size-2*this.border},q.prototype.localPosFromDOM=function(e,t,o){if(this.contentDOM&&this.contentDOM.contains(1==e.nodeType?e:e.parentNode)){if(o<0){if(e==this.contentDOM)n=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.previousSibling}for(;n&&!((r=n.pmViewDesc)&&r.parent==this);)n=n.previousSibling;return n?this.posBeforeChild(r)+r.size:this.posAtStart}if(e==this.contentDOM)i=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;i=e.nextSibling}for(;i&&!((s=i.pmViewDesc)&&s.parent==this);)i=i.nextSibling;return i?this.posBeforeChild(s):this.posAtEnd}if(e==this.dom&&this.contentDOM)a=t>h(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))a=2&e.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==t)for(var n,r,i,s,a,c=e;;c=c.parentNode){if(c==this.dom){a=!1;break}if(c.parentNode.firstChild!=c)break}if(null==a&&t==e.childNodes.length)for(var l=e;;l=l.parentNode){if(l==this.dom){a=!0;break}if(l.parentNode.lastChild!=l)break}}return(null==a?o>0:a)?this.posAtEnd:this.posAtStart},q.prototype.nearestDesc=function(e,t){for(var o=!0,n=e;n;n=n.parentNode){var r=this.getDesc(n);if(r&&(!t||r.node)){if(!o||!r.nodeDOM||(1==r.nodeDOM.nodeType?r.nodeDOM.contains(1==e.nodeType?e:e.parentNode):r.nodeDOM==e))return r;o=!1}}},q.prototype.getDesc=function(e){for(var t=e.pmViewDesc,o=t;o;o=o.parent)if(o==this)return t},q.prototype.posFromDOM=function(e,t,o){for(var n=e;n;n=n.parentNode){var r=this.getDesc(n);if(r)return r.localPosFromDOM(e,t,o)}return -1},q.prototype.descAt=function(e){for(var t=0,o=0;t<this.children.length;t++){var n=this.children[t],r=o+n.size;if(o==e&&r!=o){for(;!n.border&&n.children.length;)n=n.children[0];return n}if(e<r)return n.descAt(e-o-n.border);o=r}},q.prototype.domFromPos=function(e,t){if(!this.contentDOM)return{node:this.dom,offset:0};for(var o=0,n=0,r=0;o<this.children.length;o++){var i=this.children[o],s=r+i.size;if(s>e||i instanceof Y){n=e-r;break}r=s}if(n)return this.children[o].domFromPos(n-this.children[o].border,t);for(var a=void 0;o&&!(a=this.children[o-1]).size&&a instanceof F&&a.widget.type.side>=0;o--);if(t<=0){for(var c,l=!0;(c=o?this.children[o-1]:null)&&c.dom.parentNode!=this.contentDOM;o--,l=!1);return c&&t&&l&&!c.border&&!c.domAtom?c.domFromPos(c.size,t):{node:this.contentDOM,offset:c?h(c.dom)+1:0}}for(var d,f=!0;(d=o<this.children.length?this.children[o]:null)&&d.dom.parentNode!=this.contentDOM;o++,f=!1);return d&&f&&!d.border&&!d.domAtom?d.domFromPos(0,t):{node:this.contentDOM,offset:d?h(d.dom):this.contentDOM.childNodes.length}},q.prototype.parseRange=function(e,t,o){if(void 0===o&&(o=0),0==this.children.length)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};for(var n=-1,r=-1,i=o,s=0;;s++){var a=this.children[s],c=i+a.size;if(-1==n&&e<=c){var l=i+a.border;if(e>=l&&t<=c-a.border&&a.node&&a.contentDOM&&this.contentDOM.contains(a.contentDOM))return a.parseRange(e,t,l);e=i;for(var d=s;d>0;d--){var f=this.children[d-1];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(1)){n=h(f.dom)+1;break}e-=f.size}-1==n&&(n=0)}if(n>-1&&(c>t||s==this.children.length-1)){t=c;for(var p=s+1;p<this.children.length;p++){var u=this.children[p];if(u.size&&u.dom.parentNode==this.contentDOM&&!u.emptyChildAt(-1)){r=h(u.dom);break}t+=u.size}-1==r&&(r=this.contentDOM.childNodes.length);break}i=c}return{node:this.contentDOM,from:e,to:t,fromOffset:n,toOffset:r}},q.prototype.emptyChildAt=function(e){if(this.border||!this.contentDOM||!this.children.length)return!1;var t=this.children[e<0?0:this.children.length-1];return 0==t.size||t.emptyChildAt(e)},q.prototype.domAfterPos=function(e){var t=this.domFromPos(e,0),o=t.node,n=t.offset;if(1!=o.nodeType||n==o.childNodes.length)throw RangeError("No node after pos "+e);return o.childNodes[n]},q.prototype.setSelection=function(e,t,o,n){for(var r=Math.min(e,t),i=Math.max(e,t),a=0,
1c=0;a<this.children.length;a++){var l=this.children[a],d=c+l.size;if(r>c&&i<d)return l.setSelection(e-c-l.border,t-c-l.border,o,n);c=d}var f=this.domFromPos(e,e?-1:1),p=t==e?f:this.domFromPos(t,t?-1:1),u=o.getSelection(),m=!1;if((s.gecko||s.safari)&&e==t){var g=f.node,y=f.offset;if(3==g.nodeType){if((m=y&&"\n"==g.nodeValue[y-1])&&y==g.nodeValue.length)for(var b=g,w=void 0;b;b=b.parentNode){if(w=b.nextSibling){"BR"==w.nodeName&&(f=p={node:w.parentNode,offset:h(w)+1});break}var D=b.pmViewDesc;if(D&&D.node&&D.node.isBlock)break}}else{var N=g.childNodes[y-1];m=N&&("BR"==N.nodeName||"false"==N.contentEditable)}}if(s.gecko&&u.focusNode&&u.focusNode!=p.node&&1==u.focusNode.nodeType){var O=u.focusNode.childNodes[u.focusOffset];O&&"false"==O.contentEditable&&(n=!0)}if(!(!(n||m&&s.safari)&&v(f.node,f.offset,u.anchorNode,u.anchorOffset)&&v(p.node,p.offset,u.focusNode,u.focusOffset))){var S=!1;if((u.extend||e==t)&&!m){u.collapse(f.node,f.offset);try{e!=t&&u.extend(p.node,p.offset),S=!0}catch(e){if(!(e instanceof DOMException))throw e}}if(!S){if(e>t){var C=f;f=p,p=C}var M=document.createRange();M.setEnd(p.node,p.offset),M.setStart(f.node,f.offset),u.removeAllRanges(),u.addRange(M)}}},q.prototype.ignoreMutation=function(e){return!this.contentDOM&&"selection"!=e.type},_.contentLost.get=function(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)},q.prototype.markDirty=function(e,t){for(var o=0,n=0;n<this.children.length;n++){var r=this.children[n],i=o+r.size;if(o==i?e<=i&&t>=o:e<i&&t>o){var s=o+r.border,a=i-r.border;if(e>=s&&t<=a){this.dirty=e==o||t==i?2:1,e==s&&t==a&&(r.contentLost||r.dom.parentNode!=this.contentDOM)?r.dirty=3:r.markDirty(e-s,t-s);return}r.dirty=r.dom!=r.contentDOM||r.dom.parentNode!=this.contentDOM||r.children.length?3:2}o=i}this.dirty=2},q.prototype.markParentsDirty=function(){for(var e=1,t=this.parent;t;t=t.parent,e++){var o=1==e?2:1;t.dirty<o&&(t.dirty=o)}},_.domAtom.get=function(){return!1},_.ignoreForCoords.get=function(){return!1},Object.defineProperties(q.prototype,_);var L=[],F=function(e){function t(t,o,n,r){var i,s=o.type.toDOM;if("function"==typeof s&&(s=s(n,function(){return i?i.parent?i.parent.posBeforeChild(i):void 0:r})),!o.type.spec.raw){if(1!=s.nodeType){var a=document.createElement("span");a.appendChild(s),s=a}s.contentEditable=!1,s.classList.add("ProseMirror-widget")}e.call(this,t,L,s,null),this.widget=o,i=this}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var o={domAtom:{configurable:!0}};return t.prototype.matchesWidget=function(e){return 0==this.dirty&&e.type.eq(this.widget.type)},t.prototype.parseRule=function(){return{ignore:!0}},t.prototype.stopEvent=function(e){var t=this.widget.spec.stopEvent;return!!t&&t(e)},t.prototype.ignoreMutation=function(e){return"selection"!=e.type||this.widget.spec.ignoreSelection},t.prototype.destroy=function(){this.widget.type.destroy(this.dom),e.prototype.destroy.call(this)},o.domAtom.get=function(){return!0},Object.defineProperties(t.prototype,o),t}(q),K=function(e){function t(t,o,n,r){e.call(this,t,L,o,null),this.textDOM=n,this.text=r}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var o={size:{configurable:!0}};return o.size.get=function(){return this.text.length},t.prototype.localPosFromDOM=function(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t},t.prototype.domFromPos=function(e){return{node:this.textDOM,offset:e}},t.prototype.ignoreMutation=function(e){return"characterData"===e.type&&e.target.nodeValue==e.oldValue},Object.defineProperties(t.prototype,o),t}(q),$=function(e){function t(t,o,n,r){e.call(this,t,[],n,r),this.mark=o}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.create=function(e,o,n,i){var s=i.nodeViews[o.type.name],a=s&&s(o,i,n);
1return a&&a.dom||(a=r.PW.renderSpec(document,o.type.spec.toDOM(o,n))),new t(e,o,a.dom,a.contentDOM||a.dom)},t.prototype.parseRule=function(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}},t.prototype.matchesMark=function(e){return 3!=this.dirty&&this.mark.eq(e)},t.prototype.markDirty=function(t,o){if(e.prototype.markDirty.call(this,t,o),0!=this.dirty){for(var n=this.parent;!n.node;)n=n.parent;n.dirty<this.dirty&&(n.dirty=this.dirty),this.dirty=0}},t.prototype.slice=function(e,o,n){var r=t.create(this.parent,this.mark,!0,n),i=this.children,s=this.size;o<s&&(i=er(i,o,s,n)),e>0&&(i=er(i,0,e,n));for(var a=0;a<i.length;a++)i[a].parent=r;return r.children=i,r},t}(q),W=function(e){function t(t,o,n,r,i,s,a,c,l){e.call(this,t,o.isLeaf?L:[],i,s),this.nodeDOM=a,this.node=o,this.outerDeco=n,this.innerDeco=r,s&&this.updateChildren(c,l)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var o={size:{configurable:!0},border:{configurable:!0},domAtom:{configurable:!0}};return t.create=function(e,o,n,i,s,a){var c,l,d=s.nodeViews[o.type.name],f=d&&d(o,s,function(){return l?l.parent?l.parent.posBeforeChild(l):void 0:a},n,i),h=f&&f.dom,p=f&&f.contentDOM;if(o.isText){if(h){if(3!=h.nodeType)throw RangeError("Text must be rendered as a DOM text node")}else h=document.createTextNode(o.text)}
1else h||(h=(c=r.PW.renderSpec(document,o.type.spec.toDOM(o))).dom,p=c.contentDOM);p||o.isText||"BR"==h.nodeName||(h.hasAttribute("contenteditable")||(h.contentEditable=!1),o.type.spec.draggable&&(h.draggable=!0));var u=h;return(h=Z(h,n,o),f)?l=new U(e,o,n,i,h,p,u,f,s,a+1):o.isText?new j(e,o,n,i,h,u,s):new t(e,o,n,i,h,p,u,s,a+1)},t.prototype.parseRule=function(){var e=this;if(this.node.type.spec.reparseInView)return null;var t={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(t.preserveWhitespace="full"),this.contentDOM){if(this.contentLost){for(var o=this.children.length-1;o>=0;o--){var n=this.children[o];if(this.dom.contains(n.dom.parentNode)){t.contentElement=n.dom.parentNode;break}}t.contentElement||(t.getContent=function(){return r.HY.empty})}else t.contentElement=this.contentDOM}else t.getContent=function(){return e.node.content};return t},t.prototype.matchesNode=function(e,t,o){return 0==this.dirty&&e.eq(this.node)&&ee(t,this.outerDeco)&&o.eq(this.innerDeco)},o.size.get=function(){return this.node.nodeSize},o.border.get=function(){return this.node.isLeaf?0:1},t.prototype.updateChildren=function(e,t){var o=this,n=this.node.inlineContent,i=t,a=e.composing&&this.localCompositionInfo(e,t),c=a&&a.pos>-1?a:null,l=a&&a.pos<0,d=new eo(this,c&&c.node);(function(e,t,o,n){var r=t.locals(e),i=0;if(0==r.length){for(var s=0;s<e.childCount;s++){var a=e.child(s);n(a,r,t.forChild(i,a),s),i+=a.nodeSize}return}for(var c=0,l=[],d=null,f=0;;){if(c<r.length&&r[c].to==i){for(var h=r[c++],p=void 0;c<r.length&&r[c].to==i;)(p||(p=[h])).push(r[c++]);if(p){p.sort(en);for(var u=0;u<p.length;u++)o(p[u],f,!!d)}else o(h,f,!!d)}var m=void 0,v=void 0;if(d)v=-1,m=d,d=null;else if(f<e.childCount)v=f,m=e.child(f++);else break;for(var g=0;g<l.length;g++)l[g].to<=i&&l.splice(g--,1);for(;c<r.length&&r[c].from<=i&&r[c].to>i;)l.push(r[c++]);var y=i+m.nodeSize;if(m.isText){var b=y;c<r.length&&r[c].from<b&&(b=r[c].from);for(var w=0;w<l.length;w++)l[w].to<b&&(b=l[w].to);b<y&&(d=m.cut(b-i),m=m.cut(0,b-i),y=b,v=-1)}var D=l.length?m.isInline&&!m.isLeaf?l.filter(function(e){return!e.inline}):l.slice():L;n(m,D,t.forChild(i,m),v),i=y}})(this.node,this.innerDeco,function(t,s,a){t.spec.marks?d.syncToMarks(t.spec.marks,n,e):t.type.side>=0&&!a&&d.syncToMarks(s==o.node.childCount?r.vc.none:o.node.child(s).marks,n,e),d.placeWidget(t,e,i)},function(t,o,r,s){var c;d.syncToMarks(t.marks,n,e),d.findNodeMatch(t,o,r,s)||l&&e.state.selection.from>i&&e.state.selection.to<i+t.nodeSize&&(c=d.findIndexWithChild(a.node))>-1&&d.updateNodeAt(t,o,r,c,e)||d.updateNextNode(t,o,r,e,s)||d.addNode(t,o,r,e,i),i+=t.nodeSize}),d.syncToMarks(L,n,e),this.node.isTextblock&&d.addTextblockHacks(),d.destroyRest(),(d.changed||2==this.dirty)&&(c&&this.protectLocalComposition(e,c),function e(t,o,n){for(var r=t.firstChild,i=!1,s=0;s<o.length;s++){var a=o[s],c=a.dom;if(c.parentNode==t){for(;c!=r;)r=et(r),i=!0;r=r.nextSibling}else i=!0,t.insertBefore(c,r);if(a instanceof $){var l=r?r.previousSibling:t.lastChild;e(a.contentDOM,a.children,n),r=l?l.nextSibling:t.firstChild}}for(;r;)r=et(r),i=!0;i&&n.trackWrites==t&&(n.trackWrites=null)}(this.contentDOM,this.children,e),s.ios&&function(e){if("UL"==e.nodeName||"OL"==e.nodeName){var t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}(this.dom))},t.prototype.localCompositionInfo=function(e,t){var o=e.state.selection,r=o.from,i=o.to;if(e.state.selection instanceof n.Bs&&!(r<t)&&!(i>t+this.node.content.size)){var s=e.root.getSelection(),a=function(e,t){for(;;){if(3==e.nodeType)return e;if(1==e.nodeType&&t>0){if(e.childNodes.length>t&&3==e.childNodes[t].nodeType)return e.childNodes[t];t=b(e=e.childNodes[t-1])}else{if(1!=e.nodeType||!(t<e.childNodes.length))return null;e=e.childNodes[t],t=0}}}(s.focusNode,s.focusOffset);if(a&&this.dom.contains(a.parentNode)){if(!this.node.inlineContent)return{node:a,pos:-1};var c=a.nodeValue,l=function(e,t,o,n){for(var r=0,i=0;r<e.childCount&&i<=n;){var s=e.child(r++),a=i;if(i+=s.nodeSize,s.isText){for(var c=s.text;r<e.childCount;){var l=e.child(r++);if(i+=l.nodeSize,!l.isText)break;c+=l.text}if(i>=o){var d=a<n?c.lastIndexOf(t,n-a-1):-1;if(d>=0&&d+t.length+a>=o)return a+d;if(o==n&&c.length>=n+t.length-a&&c.slice(n-a,n-a+t.length)==t)return n}}}return -1}(this.node.content,c,r-t,i-t);
1return l<0?null:{node:a,pos:l,text:c}}}},t.prototype.protectLocalComposition=function(e,t){var o=t.node,n=t.pos,r=t.text;if(!this.getDesc(o)){for(var i=o;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,o,r);e.compositionNodes.push(s),this.children=er(this.children,n,n+r.length,e,s)}},t.prototype.update=function(e,t,o,n){return!!(3!=this.dirty&&e.sameMarkup(this.node))&&(this.updateInner(e,t,o,n),!0)},t.prototype.updateInner=function(e,t,o,n){this.updateOuterDeco(t),this.node=e,this.innerDeco=o,this.contentDOM&&this.updateChildren(n,this.posAtStart),this.dirty=0},t.prototype.updateOuterDeco=function(e){if(!ee(e,this.outerDeco)){var t=1!=this.nodeDOM.nodeType,o=this.dom;this.dom=Q(this.dom,this.nodeDOM,J(this.outerDeco,this.node,t),J(e,this.node,t)),this.dom!=o&&(o.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")},o.domAtom.get=function(){return this.node.isAtom},Object.defineProperties(t.prototype,o),t}(q);function H(e,t,o,n,r){return Z(n,t,e),new W(null,e,t,o,n,n,n,r,0)}var j=function(e){function t(t,o,n,r,i,s,a){e.call(this,t,o,n,r,i,null,s,a)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var o={domAtom:{configurable:!0}};return 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,o,n){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,n.trackWrites==this.nodeDOM&&(n.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,o,n){return t==this.nodeDOM?this.posAtStart+Math.min(o,this.node.text.length):e.prototype.localPosFromDOM.call(this,t,o,n)},t.prototype.ignoreMutation=function(e){return"characterData"!=e.type&&"selection"!=e.type},t.prototype.slice=function(e,o,n){var r=this.node.cut(e,o),i=document.createTextNode(r.text);return new t(this.parent,r,this.outerDeco,this.innerDeco,i,i,n)},t.prototype.markDirty=function(t,o){e.prototype.markDirty.call(this,t,o),this.dom!=this.nodeDOM&&(0==t||o==this.nodeDOM.nodeValue.length)&&(this.dirty=3)},o.domAtom.get=function(){return!1},Object.defineProperties(t.prototype,o),t}(W),Y=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var o={domAtom:{configurable:!0},ignoreForCoords:{configurable:!0}};return t.prototype.parseRule=function(){return{ignore:!0}},t.prototype.matchesHack=function(e){return 0==this.dirty&&this.dom.nodeName==e},o.domAtom.get=function(){return!0},o.ignoreForCoords.get=function(){return"IMG"==this.dom.nodeName},Object.defineProperties(t.prototype,o),t}(q),U=function(e){function t(t,o,n,r,i,s,a,c,l,d){e.call(this,t,o,n,r,i,s,a,l,d),this.spec=c}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.update=function(t,o,n,r){if(3==this.dirty)return!1;if(this.spec.update){var i=this.spec.update(t,o,n);return i&&this.updateInner(t,o,n,r),i}return(!!this.contentDOM||!!t.isLeaf)&&e.prototype.update.call(this,t,o,n,r)},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,o,n,r){this.spec.setSelection?this.spec.setSelection(t,o,n):e.prototype.setSelection.call(this,t,o,n,r)},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}(W);function G(e){e&&(this.nodeName=e)}G.prototype=Object.create(null);var X=[new G];function J(e,t,o){if(0==e.length)return X;for(var n=o?X[0]:new G,r=[n],i=0;i<e.length;i++){var s=e[i].type.attrs;if(s)for(var a in s.nodeName&&r.push(n=new G(s.nodeName)),s){var c=s[a];null!=c&&(o&&1==r.length&&r.push(n=new G(t.isInline?"span":"div")),"class"==a?n.class=(n.class?n.class+" ":"")+c:"style"==a?n.style=(n.style?n.style+";":"")+c:"nodeName"!=a&&(n[a]=c))}}return r}function Q(e,t,o,n){if(o==X&&n==X)return t;for(var r=t,i=0;i<n.length;i++){var s=n[i],a=o[i];if(i){var c=void 0;a&&a.nodeName==s.nodeName&&r!=e&&(c=r.parentNode)&&c.tagName.toLowerCase()==s.nodeName||((c=document.createElement(s.nodeName)).pmIsDeco=!0,c.appendChild(r),a=X[0]),r=c}!function(e,t,o){for(var n in t)"class"==n||"style"==n||"nodeName"==n||n in o||e.removeAttribute(n);for(var r in o)"class"!=r&&"style"!=r&&"nodeName"!=r&&o[r]!=t[r]&&e.setAttribute(r,o[r]);if(t.class!=o.class){for(var i=t.class?t.class.split(" ").filter(
1Boolean):L,s=o.class?o.class.split(" ").filter(Boolean):L,a=0;a<i.length;a++)-1==s.indexOf(i[a])&&e.classList.remove(i[a]);for(var c=0;c<s.length;c++)-1==i.indexOf(s[c])&&e.classList.add(s[c]);0==e.classList.length&&e.removeAttribute("class")}if(t.style!=o.style){if(t.style)for(var l,d=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g;l=d.exec(t.style);)e.style.removeProperty(l[1]);o.style&&(e.style.cssText+=o.style)}}(r,a||X[0],s)}return r}function Z(e,t,o){return Q(e,e,X,J(t,o,1!=e.nodeType))}function ee(e,t){if(e.length!=t.length)return!1;for(var o=0;o<e.length;o++)if(!e[o].type.eq(t[o].type))return!1;return!0}function et(e){var t=e.nextSibling;return e.parentNode.removeChild(e),t}var eo=function(e,t){this.top=e,this.lock=t,this.index=0,this.stack=[],this.changed=!1,this.preMatch=function(e,t){var o=t,n=o.children.length,r=e.childCount,i=new Map,s=[];e:for(;r>0;){for(var a=void 0;;)if(n){var c=o.children[n-1];if(c instanceof $)o=c,n=c.children.length;else{a=c,n--;break}}else if(o==t)break e;else n=o.parent.children.indexOf(o),o=o.parent;var l=a.node;if(l){if(l!=e.child(r-1))break;--r,i.set(a,r),s.push(a)}}return{index:r,matched:i,matches:s.reverse()}}(e.node.content,e)};function en(e,t){return e.type.side-t.type.side}function er(e,t,o,n,r){for(var i=[],s=0,a=0;s<e.length;s++){var c=e[s],l=a,d=a+=c.size;l>=o||d<=t?i.push(c):(l<t&&i.push(c.slice(0,t-l,n)),r&&(i.push(r),r=null),d>o&&i.push(c.slice(o-l,c.size,n)))}return i}function ei(e,t){var o=e.root.getSelection(),r=e.state.doc;if(!o.focusNode)return null;var i=e.docView.nearestDesc(o.focusNode),s=i&&0==i.size,a=e.docView.posFromDOM(o.focusNode,o.focusOffset);if(a<0)return null;var c,l,d=r.resolve(a);if(w(o)){for(c=d;i&&!i.node;)i=i.parent;if(i&&i.node.isAtom&&n.qv.isSelectable(i.node)&&i.parent&&!(i.node.isInline&&function(e,t,o){for(var n=0==t,r=t==b(e);n||r;){if(e==o)return!0;var i=h(e);if(!(e=e.parentNode))return!1;n=n&&0==i,r=r&&i==b(e)}}(o.focusNode,o.focusOffset,i.dom))){var f=i.posBefore;l=new n.qv(a==f?d:r.resolve(f))}}else{var p=e.docView.posFromDOM(o.anchorNode,o.anchorOffset);if(p<0)return null;c=r.resolve(p)}if(!l){var u="pointer"==t||e.state.selection.head<d.pos&&!s?1:-1;l=eu(e,c,d,u)}return l}function es(e){return e.editable?e.hasFocus():ev(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function ea(e,t){var o=e.state.selection;if(eh(e,o),es(e)){if(!t&&e.mouseDown&&e.mouseDown.allowDefault&&s.chrome){var r=e.root.getSelection(),i=e.domObserver.currentSelection;if(r.anchorNode&&v(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)){e.mouseDown.delayedSelectionSync=!0,e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)a=e.root.getSelection(),c=document.createRange(),(d="IMG"==(l=e.cursorWrapper.dom).nodeName)?c.setEnd(l.parentNode,h(l)+1):c.setEnd(l,0),c.collapse(!1),a.removeAllRanges(),a.addRange(c),!d&&!e.state.selection.visible&&s.ie&&s.ie_version<=11&&(l.disabled=!0,l.disabled=!1);else{var a,c,l,d,f,p,u,m,g,y,b=o.anchor,w=o.head;!ec||o instanceof n.Bs||(o.$from.parent.inlineContent||(g=el(e,o.from)),o.empty||o.$from.parent.inlineContent||(y=el(e,o.to))),e.docView.setSelection(b,w,e.root,t),ec&&(g&&ef(g),y&&ef(y)),o.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&((f=e.dom.ownerDocument).removeEventListener("selectionchange",e.hideSelectionGuard),u=(p=e.root.getSelection()).anchorNode,m=p.anchorOffset,f.addEventListener("selectionchange",e.hideSelectionGuard=function(){(p.anchorNode!=u||p.anchorOffset!=m)&&(f.removeEventListener("selectionchange",e.hideSelectionGuard),setTimeout(function(){(!es(e)||e.state.selection.visible)&&e.dom.classList.remove("ProseMirror-hideselection")},20))})))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}eo.prototype.destroyBetween=function(e,t){if(e!=t){for(var o=e;o<t;o++)this.top.children[o].destroy();this.top.children.splice(e,t-e),this.changed=!0}},eo.prototype.destroyRest=function(){this.destroyBetween(this.index,this.top.children.length)},eo.prototype.syncToMarks=function(e,t,o){for(var n=0,r=this.stack.length>>1,i=Math.min(r,e.length);n<i&&(n==r-1?this.top:this.stack[n+1<<1]).matchesMark(e[n])&&!1!==e[n].type.spec.spanning;)n++;for(;n<r;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),r--;for(;r<e.length;){this.stack.push(this.top,this.index+1);for(var s=-1,a=this.index;a<Math.min(this.index+3,this.top.children.length);a++)if(this.top.children[a].matchesMark(e[r])){s=a;break}if(s>-1)s>this.index&&(this.changed=!0,this.destroyBetween(this.index,s)),this.top=this.top.children[this.index];else{var c=$.create(this.top,e[r],t,o);this.top.children.splice(this.index,0,c),this.top=c,this.changed=!0}this.index=0,r++}},eo.prototype.findNodeMatch=function(e,t,o,n){var r,i=-1;if(n>=this.preMatch.index&&(r=this.preMatch.matches[n-this.preMatch.index]).parent==this.top&&r.matchesNode(e,t,o))i=this.top.children.indexOf(r,this.index);else for(var s=this.index,a=Math.min(this.top.children.length,s+5
1);s<a;s++){var c=this.top.children[s];if(c.matchesNode(e,t,o)&&!this.preMatch.matched.has(c)){i=s;break}}return!(i<0)&&(this.destroyBetween(this.index,i),this.index++,!0)},eo.prototype.updateNodeAt=function(e,t,o,n,r){return!!this.top.children[n].update(e,t,o,r)&&(this.destroyBetween(this.index,n),this.index=n+1,!0)},eo.prototype.findIndexWithChild=function(e){for(;;){var t=e.parentNode;if(!t)return -1;if(t==this.top.contentDOM){var o=e.pmViewDesc;if(o){for(var n=this.index;n<this.top.children.length;n++)if(this.top.children[n]==o)return n}return -1}e=t}},eo.prototype.updateNextNode=function(e,t,o,n,r){for(var i=this.index;i<this.top.children.length;i++){var s=this.top.children[i];if(s instanceof W){var a=this.preMatch.matched.get(s);if(null!=a&&a!=r)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&&ee(t,s.outerDeco)))&&s.update(e,t,o,n))return this.destroyBetween(this.index,i),s.dom!=c&&(this.changed=!0),this.index++,!0;break}}return!1},eo.prototype.addNode=function(e,t,o,n,r){this.top.children.splice(this.index++,0,W.create(this.top,e,t,o,n,r)),this.changed=!0},eo.prototype.placeWidget=function(e,t,o){var n=this.index<this.top.children.length?this.top.children[this.index]:null;if(n&&n.matchesWidget(e)&&(e==n.widget||!n.widget.type.toDOM.parentNode))this.index++;else{var r=new F(this.top,e,t,o);this.top.children.splice(this.index++,0,r),this.changed=!0}},eo.prototype.addTextblockHacks=function(){for(var e=this.top.children[this.index-1],t=this.top;e instanceof $;)e=(t=e).children[t.children.length-1];(!e||!(e instanceof j)||/\n$/.test(e.node.text))&&((s.safari||s.chrome)&&e&&"false"==e.dom.contentEditable&&this.addHackNode("IMG",t),this.addHackNode("BR",this.top))},eo.prototype.addHackNode=function(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{var o=document.createElement(e);"IMG"==e&&(o.className="ProseMirror-separator",o.alt=""),"BR"==e&&(o.className="ProseMirror-trailingBreak");var n=new Y(this.top,L,o,null);t!=this.top?t.children.push(n):t.children.splice(this.index++,0,n),this.changed=!0}};var ec=s.safari||s.chrome&&s.chrome_version<63;function el(e,t){var o=e.docView.domFromPos(t,0),n=o.node,r=o.offset,i=r<n.childNodes.length?n.childNodes[r]:null,a=r?n.childNodes[r-1]:null;if(s.safari&&i&&"false"==i.contentEditable)return ed(i);if((!i||"false"==i.contentEditable)&&(!a||"false"==a.contentEditable)){if(i)return ed(i);if(a)return ed(a)}}function ed(e){return e.contentEditable="true",s.safari&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function ef(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function eh(e,t){if(t instanceof n.qv){var o=e.docView.descAt(t.from);o!=e.lastSelectedViewDesc&&(ep(e),o&&o.selectNode(),e.lastSelectedViewDesc=o)}else ep(e)}function ep(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=null)}function eu(e,t,o,r){return e.someProp("createSelectionBetween",function(n){return n(e,t,o)})||n.Bs.between(t,o,r)}function em(e){return(!e.editable||e.root.activeElement==e.dom)&&ev(e)}function ev(e){var t=e.root.getSelection();if(!t.anchorNode)return!1;try{return e.dom.contains(3==t.anchorNode.nodeType?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(3==t.focusNode.nodeType?t.focusNode.parentNode:t.focusNode))}catch(e){return!1}}function eg(e,t){var o=e.selection,r=o.$anchor,i=o.$head,s=t>0?r.max(i):r.min(i),a=s.parent.inlineContent?s.depth?e.doc.resolve(t>0?s.after():s.before()):null:s;return a&&n.Y1.findFrom(a,t)}function ey(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function eb(e,t,o){var r=e.state.selection;if(r instanceof n.Bs){if(!r.empty||o.indexOf("s")>-1)return!1;if(e.endOfTextblock(t>0?"right":"left")){var i=eg(e.state,t);return!!i&&i instanceof n.qv&&ey(e,i)}if(!(s.mac&&o.indexOf("m")>-1)){var a,c=r.$head,l=c.textOffset?null:t<0?c.nodeBefore:c.nodeAfter;if(!l||l.isText)return!1;var d=t<0?c.pos-l.nodeSize:c.pos;return!!(l.isAtom||(a=e.docView.descAt(d))&&!a.contentDOM)&&(n.qv.isSelectable(l)?ey(e,new n.qv(t<0?e.state.doc.resolve(c.pos-l.nodeSize):c)):!!s.webkit&&ey(e,new n.Bs(e.state.doc.resolve(t<0?d:d+l.nodeSize))))}}else{if(r instanceof n.qv&&r.node.isInline)return ey(e,new n.Bs(t>0?r.$to:r.$from));var f=eg(e.state,t);return!!f&&ey(e,f)}}function ew(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function eD(e){var t=e.pmViewDesc;return t&&0==t.size&&(e.nextSibling||"BR"!=e.nodeName)}function eN(e){var t=e.root.getSelection(),o=t.focusNode,n=t.focusOffset;if(o){var r,i,a=!1;for(s.gecko&&1==o.nodeType&&n<ew(o)&&eD(o.childNodes[n])&&(a=!0);;)if(n>0){if(1!=o.nodeType)break;var c=o.childNodes[n-1];if(eD(c))r=o,i=--n;else if(3==c.nodeType)n=(o=c).nodeValue.length;else break}else if(eS(o))break;else{for(var l=o.previousSibling;l&&eD(l);)r=o.parentNode,i=h(l),l=l.previousSibling;if(l)n=ew(o=l);else{if((o=o.parentNode)==e.dom)break;n=0}}a?eC(e,t,o,n):r&&eC(e,t,r,i)}}function eO(e){var t,o,n=e.root.getSelection(),r=n.focusNode,i=n.focusOffset;if(r){for(var s=ew(r);;)if(i<s){if(1!=r.nodeType)break;
1if(eD(r.childNodes[i]))t=r,o=++i;else break}else if(eS(r))break;else{for(var a=r.nextSibling;a&&eD(a);)t=a.parentNode,o=h(a)+1,a=a.nextSibling;if(a)i=0,s=ew(r=a);else{if((r=r.parentNode)==e.dom)break;i=s=0}}t&&eC(e,n,t,o)}}function eS(e){var t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function eC(e,t,o,n){if(w(t)){var r=document.createRange();r.setEnd(o,n),r.setStart(o,n),t.removeAllRanges(),t.addRange(r)}else t.extend&&t.extend(o,n);e.domObserver.setCurSelection();var i=e.state;setTimeout(function(){e.state==i&&ea(e)},50)}function eM(e,t,o){var r=e.state.selection;if(r instanceof n.Bs&&!r.empty||o.indexOf("s")>-1||s.mac&&o.indexOf("m")>-1)return!1;var i=r.$from,a=r.$to;if(!i.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){var c=eg(e.state,t);if(c&&c instanceof n.qv)return ey(e,c)}if(!i.parent.inlineContent){var l=t<0?i:a,d=r instanceof n.C1?n.Y1.near(l,t):n.Y1.findFrom(l,t);return!!d&&ey(e,d)}return!1}function ek(e,t){if(!(e.state.selection instanceof n.Bs))return!0;var o=e.state.selection,r=o.$head,i=o.$anchor,s=o.empty;if(!r.sameParent(i))return!0;if(!s)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;var a=!r.textOffset&&(t<0?r.nodeBefore:r.nodeAfter);if(a&&!a.isText){var c=e.state.tr;return t<0?c.delete(r.pos-a.nodeSize,r.pos):c.delete(r.pos,r.pos+a.nodeSize),e.dispatch(c),!0}return!1}function ex(e,t,o){e.domObserver.stop(),t.contentEditable=o,e.domObserver.start()}function eT(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 o=document.createElement("div");return o.appendChild(document.createElement("li")),{skip:o}}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 eA(e,t,o){return Math.max(o.anchor,o.head)>t.content.size?null:eu(e,t.resolve(o.anchor),t.resolve(o.head))}function eP(e,t,o){for(var n=e.depth,r=t?e.end():e.pos;n>0&&(t||e.indexAfter(n)==e.node(n).childCount);)n--,r++,t=!1;if(o)for(var i=e.node(n).maybeChild(e.indexAfter(n));i&&!i.isLeaf;)i=i.firstChild,r++;return r}function eE(e,t){for(var o=[],n=t.content,i=t.openStart,s=t.openEnd;i>1&&s>1&&1==n.childCount&&1==n.firstChild.childCount;){i--,s--;var a=n.firstChild;o.push(a.type.name,a.attrs!=a.type.defaultAttrs?a.attrs:null),n=a.content}var c=e.someProp("clipboardSerializer")||r.PW.fromSchema(e.state.schema),l=eL(),d=l.createElement("div");d.appendChild(c.serializeFragment(n,{document:l}));for(var f,h=d.firstChild;h&&1==h.nodeType&&(f=eq[h.nodeName.toLowerCase()]);){for(var p=f.length-1;p>=0;p--){for(var u=l.createElement(f[p]);d.firstChild;)u.appendChild(d.firstChild);d.appendChild(u),"tbody"!=f[p]&&(i++,s++)}h=d.firstChild}return h&&1==h.nodeType&&h.setAttribute("data-pm-slice",i+" "+s+" "+JSON.stringify(o)),{dom:d,text:e.someProp("clipboardTextSerializer",function(e){return e(t)})||t.content.textBetween(0,t.content.size,"\n\n")}}function eV(e,t,o,n,i){var a,c,l=i.parent.type.spec.code;if(!o&&!t)return null;var d=t&&(n||l||!o);if(d){if(e.someProp("transformPastedText",function(e){t=e(t,l||n)}),l)return t?new r.p2(r.HY.from(e.state.schema.text(t.replace(/\r\n?/g,"\n"))),0,0):r.p2.empty;var f=e.someProp("clipboardTextParser",function(e){return e(t,i,n)});if(f)c=f;else{var h=i.marks(),p=e.state.schema,u=r.PW.fromSchema(p);a=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(function(e){var t=a.appendChild(document.createElement("p"));e&&t.appendChild(u.serializeNode(p.text(e,h)))})}}else e.someProp("transformPastedHTML",function(e){o=e(o)}),a=function(e){var t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));var o,n=eL().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(e);if((o=r&&eq[r[1].toLowerCase()])&&(e=o.map(function(e){return"<"+e+">"}).join("")+e+o.map(function(e){return"</"+e+">"}).reverse().join("")),n.innerHTML=e,o)for(var i=0;i<o.length;i++)n=n.querySelector(o[i])||n;return n}(o),s.webkit&&function(e){for(var t=e.querySelectorAll(s.chrome?"span:not([class]):not([style])":"span.Apple-converted-s
1pace"),o=0;o<t.length;o++){var n=t[o];1==n.childNodes.length&&"\xa0"==n.textContent&&n.parentNode&&n.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),n)}}(a);var m=a&&a.querySelector("[data-pm-slice]"),v=m&&/^(\d+) (\d+) (.*)/.exec(m.getAttribute("data-pm-slice"));if(c||(c=(e.someProp("clipboardParser")||e.someProp("domParser")||r.aw.fromSchema(e.state.schema)).parseSlice(a,{preserveWhitespace:!!(d||v),context:i,ruleFromNode:function(e){if("BR"==e.nodeName&&!e.nextSibling&&e.parentNode&&!eB.test(e.parentNode.nodeName))return{ignore:!0}}})),v)c=function(e,t){if(!e.size)return e;var o,n=e.content.firstChild.type.schema;try{o=JSON.parse(t)}catch(t){return e}for(var i=e.content,s=e.openStart,a=e.openEnd,c=o.length-2;c>=0;c-=2){var l=n.nodes[o[c]];if(!l||l.hasRequiredAttrs())break;i=r.HY.from(l.create(o[c+1],i)),s++,a++}return new r.p2(i,s,a)}(eI(c,+v[1],+v[2]),v[3]);else if((c=r.p2.maxOpen(function(e,t){if(e.childCount<2)return e;for(var o=t.depth;o>=0;o--){var n=function(o){var n=t.node(o).contentMatchAt(t.index(o)),i=void 0,s=[];if(e.forEach(function(e){if(s){var t,o=n.findWrapping(e.type);if(!o)return s=null;if(t=s.length&&i.length&&function e(t,o,n,i,s){if(s<t.length&&s<o.length&&t[s]==o[s]){var a=e(t,o,n,i.lastChild,s+1);if(a)return i.copy(i.content.replaceChild(i.childCount-1,a));if(i.contentMatchAt(i.childCount).matchType(s==t.length-1?n.type:t[s+1]))return i.copy(i.content.append(r.HY.from(eR(n,t,s+1))))}}(o,i,e,s[s.length-1],0))s[s.length-1]=t;else{s.length&&(s[s.length-1]=function e(t,o){if(0==o)return t;var n=t.content.replaceChild(t.childCount-1,e(t.lastChild,o-1)),i=t.contentMatchAt(t.childCount).fillBefore(r.HY.empty,!0);return t.copy(n.append(i))}(s[s.length-1],i.length));var a=eR(e,o);s.push(a),n=n.matchType(a.type,a.attrs),i=o}}}),s)return{v:r.HY.from(s)}}(o);if(n)return n.v}return e}(c.content,i),!0)).openStart||c.openEnd){for(var g=0,y=0,b=c.content.firstChild;g<c.openStart&&!b.type.spec.isolating;g++,b=b.firstChild);for(var w=c.content.lastChild;y<c.openEnd&&!w.type.spec.isolating;y++,w=w.lastChild);c=eI(c,g,y)}return e.someProp("transformPasted",function(e){c=e(c)}),c}var eB=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function eR(e,t,o){void 0===o&&(o=0);for(var n=t.length-1;n>=o;n--)e=t[n].create(null,r.HY.from(e));return e}function ez(e,t,o,n,i,s){var a=t<0?e.firstChild:e.lastChild,c=a.content;return i<n-1&&(c=ez(c,t,o,n,i+1,s)),i>=o&&(c=t<0?a.contentMatchAt(0).fillBefore(c,e.childCount>1||s<=i).append(c):c.append(a.contentMatchAt(a.childCount).fillBefore(r.HY.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,a.copy(c))}function eI(e,t,o){return t<e.openStart&&(e=new r.p2(ez(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),o<e.openEnd&&(e=new r.p2(ez(e.content,1,o,e.openEnd,0,0),e.openStart,o)),e}var eq={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]},e_=null;function eL(){return e_||(e_=document.implementation.createHTMLDocument("title"))}var eF={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},eK=s.ie&&s.ie_version<=11,e$=function(){this.anchorNode=this.anchorOffset=this.focusNode=this.focusOffset=null};e$.prototype.set=function(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset},e$.prototype.eq=function(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset};var eW=function(e,t){var o=this;this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=window.MutationObserver&&new window.MutationObserver(function(e){for(var t=0;t<e.length;t++)o.queue.push(e[t]);s.ie&&s.ie_version<=11&&e.some(function(e){return"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length})?o.flushSoon():o.flush()}),this.currentSelection=new e$,eK&&(this.onCharData=function(e){o.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),o.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.suppressingSelectionUpdates=!1};eW.prototype.flushSoon=function(){var e=this;this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(function(){e.flushingSoon=-1,e.flush()},20))},eW.prototype.forceFlush=function(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())},eW.prototype.start=function(){this.observer&&this.observer.observe(this.view.dom,eF),eK&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()},eW.prototype.stop=function(){var e=this;if(this.observer){var t=this.observer.takeRecords();if(t.length){for(var o=0;o<t.length;o++)this.queue.push(t[o]);window.setTimeout(function(){return e.flush()},20)}this.observer.disconnect()}eK&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()},eW.prototype.connectSelection=function(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)},eW.prototype.disconnectSelection=function(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)},eW.prototype.suppressSelectionUpdates=function(){var e=this;this.suppressingSelectionUpdates=!0,setTimeout(function(){return e.suppressingSelectionUpdates=!1},50)},eW.prototype.onSelectionChange=function(){if(em(this.view)){if(this.suppressingSelectionUpdates)return ea(this.view);if(s.ie&&s.ie_version<=11&&!this.view.state.selection.empty){var e=this.view.root.getSelection();if(e.focusNode&&v(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}},eW.prototype.setCurSelection=function(){this.currentSelection.set(this.view.root.getSelection())},eW.prototype.ignoreSelectionChange=function(e){if(0==e.rangeCount)return!0;var t=e.getRangeAt(0).commonAncestorContainer,o=this.view.docView.nearestDesc(t);if(o&&o.ignoreMutation({type:"selection",target:3==t.nodeType?t.parentNode:t}))return this.setCurSelection(),!0},eW.prototype.flush=function(){if(this.view.docView&&!(this.flushingSoon>-1)){var e,t=this.observer?this.observer.takeRecords():[];this.queue.length&&(t=this.queue.concat(t),this.queue.length=0);var o=this.view.root.getSelection(),n=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(o)&&em(this.view)&&!this.ignoreSelectionChange(o),r=-1,i=-1,a=!1,c=[];if(this.view.editable)for(var l=0;l<t.length;l++){var d=this.registerMutation(t[l],c);d&&(r=r<0?d.from:Math.min(d.from,r),i=i<0?d.to:Math.max(d.to,i),d.typeOver&&(a=!0))}if(s.gecko&&c.length>1){var f=c.filter(function(e){return"BR"==e.nodeName});if(2==f.length){var h=f[0],p=f[1];h.parentNode&&h.parentNode.parentNode==p.parentNode?p.remove():h.remove()}}(r>-1||n)&&(r>-1&&(this.view.docView.markDirty(r,i),e=this.view,eH||(eH=!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.handleDOMChange(r,i,a,c),this.view.docView&&this.view.docView.dirty?this.view.updateState(this.view.state):this.currentSelection.eq(o)||ea(this.view),this.currentSelection.set(o))}},eW.prototype.registerMutation=function(e,t){if(t.indexOf(e.target)>-1)return null;var o=this.view.docView.nearestDesc(e.target);if("attributes"==e.type&&(o==this.view.docView||"contenteditable"==e.attributeName||"style"==e.attributeName&&!e.oldValue&&!e.target.getAttribute("style"))||
1!o||o.ignoreMutation(e))return null;if("childList"==e.type){for(var n=0;n<e.addedNodes.length;n++)t.push(e.addedNodes[n]);if(o.contentDOM&&o.contentDOM!=o.dom&&!o.contentDOM.contains(e.target))return{from:o.posBefore,to:o.posAfter};var r=e.previousSibling,i=e.nextSibling;if(s.ie&&s.ie_version<=11&&e.addedNodes.length)for(var a=0;a<e.addedNodes.length;a++){var c=e.addedNodes[a],l=c.previousSibling,d=c.nextSibling;(!l||0>Array.prototype.indexOf.call(e.addedNodes,l))&&(r=l),(!d||0>Array.prototype.indexOf.call(e.addedNodes,d))&&(i=d)}var f=r&&r.parentNode==e.target?h(r)+1:0,p=o.localPosFromDOM(e.target,f,-1),u=i&&i.parentNode==e.target?h(i):e.target.childNodes.length;return{from:p,to:o.localPosFromDOM(e.target,u,1)}}return"attributes"==e.type?{from:o.posAtStart-o.border,to:o.posAtEnd+o.border}:{from:o.posAtStart,to:o.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}};var eH=!1,ej={},eY={};function eU(e,t){e.lastSelectionOrigin=t,e.lastSelectionTime=Date.now()}function eG(e){e.someProp("handleDOMEvents",function(t){for(var o in t)e.eventHandlers[o]||e.dom.addEventListener(o,e.eventHandlers[o]=function(t){return eX(e,t)})})}function eX(e,t){return e.someProp("handleDOMEvents",function(o){var n=o[t.type];return!!n&&(n(e,t)||t.defaultPrevented)})}function eJ(e){return{left:e.clientX,top:e.clientY}}function eQ(e,t,o,n,r){if(-1==n)return!1;for(var i=e.state.doc.resolve(n),s=function(n){if(e.someProp(t,function(t){return n>i.depth?t(e,o,i.nodeAfter,i.before(n),r,!0):t(e,o,i.node(n),i.before(n),r,!1)}))return{v:!0}},a=i.depth+1;a>0;a--){var c=s(a);if(c)return c.v}return!1}function eZ(e,t,o){e.focused||e.focus();var n=e.state.tr.setSelection(t);"pointer"==o&&n.setMeta("pointer",!0),e.dispatch(n)}eY.keydown=function(e,t){if(e.shiftKey=16==t.keyCode||t.shiftKey,!e2(e,t)&&(e.lastKeyCode=t.keyCode,e.lastKeyCodeTime=Date.now(),!s.android||!s.chrome||13!=t.keyCode)){if(229!=t.keyCode&&e.domObserver.forceFlush(),!s.ios||13!=t.keyCode||t.ctrlKey||t.altKey||t.metaKey)e.someProp("handleKeyDown",function(o){return o(e,t)})||function(e,t){var o,n=t.keyCode,r=(o="",t.ctrlKey&&(o+="c"),t.metaKey&&(o+="m"),t.altKey&&(o+="a"),t.shiftKey&&(o+="s"),o);if(8==n||s.mac&&72==n&&"c"==r)return ek(e,-1)||eN(e);if(46==n||s.mac&&68==n&&"c"==r)return ek(e,1)||eO(e);if(13==n||27==n)return!0;if(37==n)return eb(e,-1,r)||eN(e);if(39==n)return eb(e,1,r)||eO(e);if(38==n)return eM(e,-1,r)||eN(e);if(40==n)return function(e){if(s.safari&&!(e.state.selection.$head.parentOffset>0)){var t=e.root.getSelection(),o=t.focusNode,n=t.focusOffset;if(o&&1==o.nodeType&&0==n&&o.firstChild&&"false"==o.firstChild.contentEditable){var r=o.firstChild;ex(e,r,!0),setTimeout(function(){return ex(e,r,!1)},20)}}}(e)||eM(e,1,r)||eO(e);else if(r==(s.mac?"m":"c")&&(66==n||73==n||89==n||90==n))return!0;return!1}(e,t)?t.preventDefault():eU(e,"key");else{var o=Date.now();e.lastIOSEnter=o,e.lastIOSEnterFallbackTimeout=setTimeout(function(){e.lastIOSEnter==o&&(e.someProp("handleKeyDown",function(t){return t(e,D(13,"Enter"))}),e.lastIOSEnter=0)},200)}}},eY.keyup=function(e,t){16==t.keyCode&&(e.shiftKey=!1)},eY.keypress=function(e,t){if(!e2(e,t)&&t.charCode&&(!t.ctrlKey||t.altKey)&&(!s.mac||!t.metaKey)){if(e.someProp("handleKeyPress",function(o){return o(e,t)})){t.preventDefault();return}var o=e.state.selection;if(!(o instanceof n.Bs)||!o.$from.sameParent(o.$to)){var r=String.fromCharCode(t.charCode);e.someProp("handleTextInput",function(t){return t(e,o.$from.pos,o.$to.pos,r)})||e.dispatch(e.state.tr.insertText(r).scrollIntoView()),t.preventDefault()}}};var e0=s.mac?"metaKey":"ctrlKey";ej.mousedown=function(e,t){e.shiftKey=t.shiftKey;var o,r,i,s=e6(e),a=Date.now(),c="singleClick";a-e.lastClick.time<500&&(r=(o=e.lastClick).x-t.clientX)*r+(i=o.y-t.clientY)*i<100&&!t[e0]&&("singleClick"==e.lastClick.type?c="doubleClick":"doubleClick"==e.lastClick.type&&(c="tripleClick")),e.lastClick={time:a,x:t.clientX,y:t.clientY,type:c};var l=e.posAtCoords(eJ(t));l&&("singleClick"==c?(e.mouseDown&&e.mouseDown.done(),e.mouseDown=new e1(e,l,t,s)):("doubleClick"==c?function(e,t,o,n){return eQ(e,"handleDoubleClickOn",t,o,n)||e.someProp("handleDoubleClick",function(o){return o(e,t,n)})}:function(e,t,o,r){return eQ(e,"handleTripleClickOn",t,o,r)||e.someProp("handleTripleClick",function(o){return o(e,t,r)})||function(e,t,o){if(0!=o.button)return!1;var r=e.state.doc;
1if(-1==t)return!!r.inlineContent&&(eZ(e,n.Bs.create(r,0,r.content.size),"pointer"),!0);for(var i=r.resolve(t),s=i.depth+1;s>0;s--){var a=s>i.depth?i.nodeAfter:i.node(s),c=i.before(s);if(a.inlineContent)eZ(e,n.Bs.create(r,c+1,c+1+a.content.size),"pointer");else{if(!n.qv.isSelectable(a))continue;eZ(e,n.qv.create(r,c),"pointer")}return!0}}(e,o,r)})(e,l.pos,l.inside,t)?t.preventDefault():eU(e,"pointer"))};var e1=function(e,t,o,r){var i,a,c=this;if(this.view=e,this.startDoc=e.state.doc,this.pos=t,this.event=o,this.flushed=r,this.selectNode=o[e0],this.allowDefault=o.shiftKey,this.delayedSelectionSync=!1,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 d=r?null:o.target,f=d?e.docView.nearestDesc(d,!0):null;this.target=f?f.dom:null;var h=e.state.selection;(0==o.button&&i.type.spec.draggable&&!1!==i.type.spec.selectable||h instanceof n.qv&&h.from<=a&&h.to>a)&&(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(){c.view.mouseDown==c&&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)),eU(e,"pointer")};function e2(e,t){return!!e.composing||!!(s.safari&&500>Math.abs(t.timeStamp-e.compositionEndedAt))&&(e.compositionEndedAt=-2e8,!0)}e1.prototype.done=function(){var e=this;this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(function(){return ea(e.view)}),this.view.mouseDown=null},e1.prototype.up=function(e){if(this.done(),this.view.dom.contains(3==e.target.nodeType?e.target.parentNode:e.target)){var t,o,r,i,a=this.pos;(this.view.state.doc!=this.startDoc&&(a=this.view.posAtCoords(eJ(e))),this.allowDefault||!a)?eU(this.view,"pointer"):(t=this.view,o=a.pos,r=a.inside,i=this.selectNode,eQ(t,"handleClickOn",o,r,e)||t.someProp("handleClick",function(n){return n(t,o,e)})||(i?function(e,t){if(-1==t)return!1;var o,r,i=e.state.selection;i instanceof n.qv&&(o=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(n.qv.isSelectable(c)){r=o&&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!=r&&(eZ(e,n.qv.create(e.state.doc,r),"pointer"),!0)}(t,r):function(e,t){if(-1==t)return!1;var o=e.state.doc.resolve(t),r=o.nodeAfter;return!!(r&&r.isAtom&&n.qv.isSelectable(r))&&(eZ(e,new n.qv(o),"pointer"),!0)}(t,r)))?e.preventDefault():0==e.button&&(this.flushed||s.safari&&this.mightDrag&&!this.mightDrag.node.isAtom||s.chrome&&!(this.view.state.selection instanceof n.Bs)&&2>=Math.min(Math.abs(a.pos-this.view.state.selection.from),Math.abs(a.pos-this.view.state.selection.to)))?(eZ(this.view,n.Y1.near(this.view.state.doc.resolve(a.pos)),"pointer"),e.preventDefault()):eU(this.view,"pointer")}},e1.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),eU(this.view,"pointer"),0==e.buttons&&this.done()},ej.touchdown=function(e){e6(e),eU(e,"pointer")},ej.contextmenu=function(e){return e6(e)};var e3=s.android?5e3:-1;function e5(e,t){clearTimeout(e.composingTimeout),t>-1&&(e.composingTimeout=setTimeout(function(){return e6(e)},t))}function e8(e){var t;for(e.composing&&(e.composing=!1,e.compositionEndedAt=((t=document.createEvent("Event")).initEvent("event",!0,!0),t.timeStamp));e.compositionNodes.length>0;)e.compositionNodes.pop().markParentsDirty()}function e6(e,t){if(!s.android||!(e.domObserver.flushingSoon>
1=0)){if(e.domObserver.forceFlush(),e8(e),t||e.docView&&e.docView.dirty){var o=ei(e);return o&&!o.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(o)):e.updateState(e.state),!0}return!1}}eY.compositionstart=eY.compositionupdate=function(e){if(!e.composing){e.domObserver.flush();var t=e.state,o=t.selection.$from;if(t.selection.empty&&(t.storedMarks||!o.textOffset&&o.parentOffset&&o.nodeBefore.marks.some(function(e){return!1===e.type.spec.inclusive})))e.markCursor=e.state.storedMarks||o.marks(),e6(e,!0),e.markCursor=null;else if(e6(e),s.gecko&&t.selection.empty&&o.parentOffset&&!o.textOffset&&o.nodeBefore.marks.length)for(var n=e.root.getSelection(),r=n.focusNode,i=n.focusOffset;r&&1==r.nodeType&&0!=i;){var a=i<0?r.lastChild:r.childNodes[i-1];if(!a)break;if(3==a.nodeType){n.collapse(a,a.nodeValue.length);break}r=a,i=-1}e.composing=!0}e5(e,e3)},eY.compositionend=function(e,t){e.composing&&(e.composing=!1,e.compositionEndedAt=t.timeStamp,e5(e,20))};var e9=s.ie&&s.ie_version<15||s.ios&&s.webkit_version<604;function e7(e,t,o,n){var i=eV(e,t,o,e.shiftKey,e.state.selection.$from);if(e.someProp("handlePaste",function(t){return t(e,n,i||r.p2.empty)}))return!0;if(!i)return!1;var s=0==i.openStart&&0==i.openEnd&&1==i.content.childCount?i.content.firstChild:null,a=s?e.state.tr.replaceSelectionWith(s,e.shiftKey):e.state.tr.replaceSelection(i);return e.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}ej.copy=eY.cut=function(e,t){var o=e.state.selection,n="cut"==t.type;if(!o.empty){var r=e9?null:t.clipboardData,i=eE(e,o.content()),s=i.dom,a=i.text;r?(t.preventDefault(),r.clearData(),r.setData("text/html",s.innerHTML),r.setData("text/plain",a)):function(e,t){if(e.dom.parentNode){var o=e.dom.parentNode.appendChild(document.createElement("div"));o.appendChild(t),o.style.cssText="position: fixed; left: -10000px; top: 10px";var n=getSelection(),r=document.createRange();r.selectNodeContents(t),e.dom.blur(),n.removeAllRanges(),n.addRange(r),setTimeout(function(){o.parentNode&&o.parentNode.removeChild(o),e.focus()},50)}}(e,s),n&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))}},eY.paste=function(e,t){if(!e.composing||s.android){var o=e9?null:t.clipboardData;o&&e7(e,o.getData("text/plain"),o.getData("text/html"),t)?t.preventDefault():function(e,t){if(e.dom.parentNode){var o=e.shiftKey||e.state.selection.$from.parent.type.spec.code,n=e.dom.parentNode.appendChild(document.createElement(o?"textarea":"div"));o||(n.contentEditable="true"),n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout(function(){e.focus(),n.parentNode&&n.parentNode.removeChild(n),o?e7(e,n.value,null,t):e7(e,n.textContent,n.innerHTML,t)},50)}}(e,t)}};var e4=function(e,t){this.slice=e,this.move=t},te=s.mac?"altKey":"ctrlKey";for(var tt in ej.dragstart=function(e,t){var o=e.mouseDown;if(o&&o.done(),t.dataTransfer){var r=e.state.selection,i=r.empty?null:e.posAtCoords(eJ(t));if(i&&i.pos>=r.from&&i.pos<=(r instanceof n.qv?r.to-1:r.to));else if(o&&o.mightDrag)e.dispatch(e.state.tr.setSelection(n.qv.create(e.state.doc,o.mightDrag.pos)));else if(t.target&&1==t.target.nodeType){var s=e.docView.nearestDesc(t.target,!0);s&&s.node.type.spec.draggable&&s!=e.docView&&e.dispatch(e.state.tr.setSelection(n.qv.create(e.state.doc,s.posBefore)))}var a=e.state.selection.content(),c=eE(e,a),l=c.dom,d=c.text;t.dataTransfer.clearData(),t.dataTransfer.setData(e9?"Text":"text/html",l.innerHTML),t.dataTransfer.effectAllowed="copyMove",e9||t.dataTransfer.setData("text/plain",d),e.dragging=new e4(a,!t[te])}},ej.dragend=function(e){var t=e.dragging;window.setTimeout(function(){e.dragging==t&&(e.dragging=null)},50)},eY.dragover=eY.dragenter=function(e,t){return t.preventDefault()},eY.drop=function(e,t){var o=e.dragging;if(e.dragging=null,!!t.dataTransfer){var s=e.posAtCoords(eJ(t));if(s){var a=e.state.doc.resolve(s.pos);if(a){var c=o&&o.slice;c?e.someProp("transformPasted",function(e){c=e(c)}):c=eV(e,t.dataTransfer.getData(e9?"Text":"text/plain"),e9?null:t.dataTransfer.getData("text/html"),!1,a);var l=o&&!t[te];if(e.someProp("handleDrop",function(o){return o(e,t,c||r.p2.empty,l)})){t.preventDefault();return}if(c){t.preventDefault();var d=c?(0,i.nj)(e.state.doc,a.pos,c):a.pos;null==d&&(d=a.pos);var f=e.state.tr;l&&f.deleteSelection();var h=f.mapping.map(d),p=0==c.openStart&&0==c.openEnd&&1==c.content.childCount,u=f.doc;if(p?f.replaceRangeWith(h,h,c.content.firstChild):f.replaceRange(h,h,c),!f.doc.eq(u)){var m=f.doc.resolve(h);if(p&&n.qv.isSelectable(c.content.firstChild)&&m.nodeAfter&&m.nodeAfter.sameMarkup(c.content.firstChild))f.setSelection(new n.qv(m));else{var v=f.mapping.map(d);
1f.mapping.maps[f.mapping.maps.length-1].forEach(function(e,t,o,n){return v=n}),f.setSelection(eu(e,m,f.doc.resolve(v)))}e.focus(),e.dispatch(f.setMeta("uiEvent","drop"))}}}}}},ej.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())&&ea(e)},20))},ej.blur=function(e,t){e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),t.relatedTarget&&e.dom.contains(t.relatedTarget)&&e.domObserver.currentSelection.set({}),e.focused=!1)},ej.beforeinput=function(e,t){if(s.chrome&&s.android&&"deleteContentBackward"==t.inputType){e.domObserver.flushSoon();var o=e.domChangeCount;setTimeout(function(){if(e.domChangeCount==o&&(e.dom.blur(),e.focus(),!e.someProp("handleKeyDown",function(t){return t(e,D(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)}},eY)ej[tt]=eY[tt];function to(e,t){if(e==t)return!0;for(var o in e)if(e[o]!==t[o])return!1;for(var n in t)if(!(n in e))return!1;return!0}var tn=function(e,t){this.spec=t||tl,this.side=this.spec.side||0,this.toDOM=e};tn.prototype.map=function(e,t,o,n){var r=e.mapResult(t.from+n,this.side<0?-1:1),i=r.pos;return r.deleted?null:new ts(i-o,i-o,this)},tn.prototype.valid=function(){return!0},tn.prototype.eq=function(e){return this==e||e instanceof tn&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&to(this.spec,e.spec))},tn.prototype.destroy=function(e){this.spec.destroy&&this.spec.destroy(e)};var tr=function(e,t){this.spec=t||tl,this.attrs=e};tr.prototype.map=function(e,t,o,n){var r=e.map(t.from+n,this.spec.inclusiveStart?-1:1)-o,i=e.map(t.to+n,this.spec.inclusiveEnd?1:-1)-o;return r>=i?null:new ts(r,i,this)},tr.prototype.valid=function(e,t){return t.from<t.to},tr.prototype.eq=function(e){return this==e||e instanceof tr&&to(this.attrs,e.attrs)&&to(this.spec,e.spec)},tr.is=function(e){return e.type instanceof tr};var ti=function(e,t){this.spec=t||tl,this.attrs=e};ti.prototype.map=function(e,t,o,n){var r=e.mapResult(t.from+n,1);if(r.deleted)return null;var i=e.mapResult(t.to+n,-1);return i.deleted||i.pos<=r.pos?null:new ts(r.pos-o,i.pos-o,this)},ti.prototype.valid=function(e,t){var o,n=e.content.findIndex(t.from),r=n.index,i=n.offset;return i==t.from&&!(o=e.child(r)).isText&&i+o.nodeSize==t.to},ti.prototype.eq=function(e){return this==e||e instanceof ti&&to(this.attrs,e.attrs)&&to(this.spec,e.spec)};var ts=function(e,t,o){this.from=e,this.to=t,this.type=o},ta={spec:{configurable:!0},inline:{configurable:!0}};ts.prototype.copy=function(e,t){return new ts(e,t,this.type)},ts.prototype.eq=function(e,t){return void 0===t&&(t=0),this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to},ts.prototype.map=function(e,t,o){return this.type.map(e,this,t,o)},ts.widget=function(e,t,o){return new ts(e,e,new tn(t,o))},ts.inline=function(e,t,o,n){return new ts(e,t,new tr(o,n))},ts.node=function(e,t,o,n){return new ts(e,t,new ti(o,n))},ta.spec.get=function(){return this.type.spec},ta.inline.get=function(){return this.type instanceof tr},Object.defineProperties(ts.prototype,ta);var tc=[],tl={},td=function(e,t){this.local=e&&e.length?e:tc,this.children=t&&t.length?t:tc};td.create=function(e,t){return t.length?tv(t,e,0,tl):tf},td.prototype.find=function(e,t,o){var n=[];return this.findInner(null==e?0:e,null==t?1e9:t,n,0,o),n},td.prototype.findInner=function(e,t,o,n,r){for(var i=0;i<this.local.length;i++){var s=this.local[i];s.from<=t&&s.to>=e&&(!r||r(s.spec))&&o.push(s.copy(s.from+n,s.to+n))}for(var a=0;a<this.children.length;a+=3)if(this.children[a]<t&&this.children[a+1]>e){var c=this.children[a]+1;this.children[a+2].findInner(e-c,t-c,o,n+c,r)}},td.prototype.map=function(e,t,o){return this==tf||0==e.maps.length?this:this.mapInner(e,t,0,0,o||tl)},td.prototype.mapInner=function(e,t,o,n,r){for(var i,s=0;s<this.local.length;s++){var a=this.local[s].map(e,o,n);a&&a.type.valid(t,a)?(i||(i=[])).push(a):r.onRemove&&r.onRemove(this.local[s].spec)}return this.children.length?function(e,t,o,n,r,i,s){for(var a=e.slice(),c=function(e,t,o,n){for(var s=0;s<a.length;s+=3){var c=a[s+1],l=void 0;if(!(c<0)&&!(e>c+i)){var d=a[s]+i;t>=d?a[s+1]=e<=d?-2:-1:o>=r&&(l=n-o-(t-e))&&(a[s]+=l,a[s+1]+=l)}}},l=0;l<o.maps.length;l++)o.maps[l].forEach(c);for(var d=!1,f=0;f<a.length;f+=3)if(a[f+1]<0){if(-2==a[f+1]){d=!0,a[f+1]=-1;continue}var h=o.map(e[f]+i),p=h-r;if(p<0||p>
1=n.content.size){d=!0;continue}var u=o.map(e[f+1]+i,-1)-r,m=n.content.findIndex(p),v=m.index,g=m.offset,y=n.maybeChild(v);if(y&&g==p&&g+y.nodeSize==u){var b=a[f+2].mapInner(o,y,h+1,e[f]+i+1,s);b!=tf?(a[f]=p,a[f+1]=u,a[f+2]=b):(a[f+1]=-2,d=!0)}else d=!0}if(d){var w=tv(function(e,t,o,n,r,i,s){for(var a=0;a<e.length;a+=3)-1==e[a+1]&&function e(t,i){for(var a=0;a<t.local.length;a++){var c=t.local[a].map(n,r,i);c?o.push(c):s.onRemove&&s.onRemove(t.local[a].spec)}for(var l=0;l<t.children.length;l+=3)e(t.children[l+2],t.children[l]+i+1)}(e[a+2],t[a]+i+1);return o}(a,e,t||[],o,r,i,s),n,0,s);t=w.local;for(var D=0;D<a.length;D+=3)a[D+1]<0&&(a.splice(D,3),D-=3);for(var N=0,O=0;N<w.children.length;N+=3){for(var S=w.children[N];O<a.length&&a[O]<S;)O+=3;a.splice(O,0,w.children[N],w.children[N+1],w.children[N+2])}}return new td(t&&t.sort(tg),a)}(this.children,i,e,t,o,n,r):i?new td(i.sort(tg)):tf},td.prototype.add=function(e,t){return t.length?this==tf?td.create(e,t):this.addInner(e,t,0):this},td.prototype.addInner=function(e,t,o){var n,r=this,i=0;e.forEach(function(e,s){var a,c=s+o;if(a=tu(t,e,c)){for(n||(n=r.children.slice());i<n.length&&n[i]<s;)i+=3;n[i]==s?n[i+2]=n[i+2].addInner(e,a,c+1):n.splice(i,0,s,s+e.nodeSize,tv(a,e,c+1,tl)),i+=3}});for(var s=tp(i?tm(t):t,-o),a=0;a<s.length;a++)s[a].type.valid(e,s[a])||s.splice(a--,1);return new td(s.length?this.local.concat(s).sort(tg):this.local,n||this.children)},td.prototype.remove=function(e){return 0==e.length||this==tf?this:this.removeInner(e,0)},td.prototype.removeInner=function(e,t){for(var o=this.children,n=this.local,r=0;r<o.length;r+=3){for(var i=void 0,s=o[r]+t,a=o[r+1]+t,c=0,l=void 0;c<e.length;c++)(l=e[c])&&l.from>s&&l.to<a&&(e[c]=null,(i||(i=[])).push(l));if(i){o==this.children&&(o=this.children.slice());var d=o[r+2].removeInner(i,s+1);d!=tf?o[r+2]=d:(o.splice(r,3),r-=3)}}if(n.length){for(var f=0,h=void 0;f<e.length;f++)if(h=e[f])for(var p=0;p<n.length;p++)n[p].eq(h,t)&&(n==this.local&&(n=this.local.slice()),n.splice(p--,1))}return o==this.children&&n==this.local?this:n.length||o.length?new td(n,o):tf},td.prototype.forChild=function(e,t){if(this==tf)return this;if(t.isLeaf)return td.empty;for(var o,n,r=0;r<this.children.length;r+=3)if(this.children[r]>=e){this.children[r]==e&&(o=this.children[r+2]);break}for(var i=e+1,s=i+t.content.size,a=0;a<this.local.length;a++){var c=this.local[a];if(c.from<s&&c.to>i&&c.type instanceof tr){var l=Math.max(i,c.from)-i,d=Math.min(s,c.to)-i;l<d&&(n||(n=[])).push(c.copy(l,d))}}if(n){var f=new td(n.sort(tg));return o?new th([f,o]):f}return o||tf},td.prototype.eq=function(e){if(this==e)return!0;if(!(e instanceof td)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(var t=0;t<this.local.length;t++)if(!this.local[t].eq(e.local[t]))return!1;for(var o=0;o<this.children.length;o+=3)if(this.children[o]!=e.children[o]||this.children[o+1]!=e.children[o+1]||!this.children[o+2].eq(e.children[o+2]))return!1;return!0},td.prototype.locals=function(e){return ty(this.localsInner(e))},td.prototype.localsInner=function(e){if(this==tf)return tc;if(e.inlineContent||!this.local.some(tr.is))return this.local;for(var t=[],o=0;o<this.local.length;o++)this.local[o].type instanceof tr||t.push(this.local[o]);return t};var tf=new td;td.empty=tf,td.removeOverlap=ty;var th=function(e){this.members=e};function tp(e,t){if(!t||!e.length)return e;for(var o=[],n=0;n<e.length;n++){var r=e[n];o.push(new ts(r.from+t,r.to+t,r.type))}return o}function tu(e,t,o){if(t.isLeaf)return null;for(var n=o+t.nodeSize,r=null,i=0,s=void 0;i<e.length;i++)(s=e[i])&&s.from>o&&s.to<n&&((r||(r=[])).push(s),e[i]=null);return r}function tm(e){for(var t=[],o=0;o<e.length;o++)null!=e[o]&&t.push(e[o]);return t}function tv(e,t,o,n){var r=[],i=!1;t.forEach(function(t,s){var a=tu(e,t,s+o);if(a){i=!0;var c=tv(a,t,o+s+1,n);c!=tf&&r.push(s,s+t.nodeSize,c)}});for(var s=tp(i?tm(e):e,-o).sort(tg),a=0;a<s.length;a++)s[a].type.valid(t,s[a])||(n.onRemove&&n.onRemove(s[a].spec),s.splice(a--,1));return s.length||r.length?new td(s,r):tf}function tg(e,t){return e.from-t.from||e.to-t.to}function ty(e){for(var t=e,o=0;o<t.length-1;o++){var n=t[o];if(n.from!=n.to)for(var r=o+1;r<t.length;r++){var i=t[r];
1if(i.from==n.from){i.to!=n.to&&(t==e&&(t=e.slice()),t[r]=i.copy(i.from,n.to),tb(t,r+1,i.copy(n.to,i.to)));continue}i.from<n.to&&(t==e&&(t=e.slice()),t[o]=n.copy(n.from,i.from),tb(t,r,n.copy(i.from,n.to)));break}}return t}function tb(e,t,o){for(;t<e.length&&tg(o,e[t])>0;)t++;e.splice(t,0,o)}function tw(e){var t=[];return e.someProp("decorations",function(o){var n=o(e.state);n&&n!=tf&&t.push(n)}),e.cursorWrapper&&t.push(td.create(e.state.doc,[e.cursorWrapper.deco])),th.from(t)}th.prototype.map=function(e,t){var o=this.members.map(function(o){return o.map(e,t,tl)});return th.from(o)},th.prototype.forChild=function(e,t){if(t.isLeaf)return td.empty;for(var o=[],n=0;n<this.members.length;n++){var r=this.members[n].forChild(e,t);r!=tf&&(r instanceof th?o=o.concat(r.members):o.push(r))}return th.from(o)},th.prototype.eq=function(e){if(!(e instanceof th)||e.members.length!=this.members.length)return!1;for(var t=0;t<this.members.length;t++)if(!this.members[t].eq(e.members[t]))return!1;return!0},th.prototype.locals=function(e){for(var t,o=!0,n=0;n<this.members.length;n++){var r=this.members[n].localsInner(e);if(r.length){if(t){o&&(t=t.slice(),o=!1);for(var i=0;i<r.length;i++)t.push(r[i])}else t=r}}return t?ty(o?t:t.sort(tg)):tc},th.from=function(e){switch(e.length){case 0:return tf;case 1:return e[0];default:return new th(e)}};var tD=function(e,t){this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(tk),this.dispatch=this.dispatch.bind(this),this._root=null,this.focused=!1,this.trackWrites=null,this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):e.apply?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=tC(this),this.markCursor=null,this.cursorWrapper=null,tS(this),this.nodeViews=tM(this),this.docView=H(this.state.doc,tO(this),tw(this),this.dom,this),this.lastSelectedViewDesc=null,this.dragging=null,function(e){for(var t in e.shiftKey=!1,e.mouseDown=null,e.lastKeyCode=null,e.lastKeyCodeTime=0,e.lastClick={time:0,x:0,y:0,type:""},e.lastSelectionOrigin=null,e.lastSelectionTime=0,e.lastIOSEnter=0,e.lastIOSEnterFallbackTimeout=null,e.lastAndroidDelete=0,e.composing=!1,e.composingTimeout=null,e.compositionNodes=[],e.compositionEndedAt=-2e8,e.domObserver=new eW(e,function(t,o,i,a){return function(e,t,o,i,a){if(t<0){var c,l,d,f,h,p,u,m=e.lastSelectionTime>Date.now()-50?e.lastSelectionOrigin:null,v=ei(e,m);if(v&&!e.state.selection.eq(v)){var g=e.state.tr.setSelection(v);"pointer"==m?g.setMeta("pointer",!0):"key"==m&&g.scrollIntoView(),e.dispatch(g)}return}var y=e.state.doc.resolve(t),b=y.sharedDepth(o);t=y.before(b+1),o=e.state.doc.resolve(o).after(b+1);var N=e.state.selection,O=function(e,t,o){var n=e.docView.parseRange(t,o),i=n.node,a=n.fromOffset,c=n.toOffset,l=n.from,d=n.to,f=e.root.getSelection(),h=null,p=f.anchorNode;if(p&&e.dom.contains(1==p.nodeType?p:p.parentNode)&&(h=[{node:p,offset:f.anchorOffset}],w(f)||h.push({node:f.focusNode,offset:f.focusOffset})),s.chrome&&8===e.lastKeyCode)for(var u=c;u>a;u--){var m=i.childNodes[u-1],v=m.pmViewDesc;if("BR"==m.nodeName&&!v){c=u;break}if(!v||v.size)break}var g=e.state.doc,y=e.someProp("domParser")||r.aw.fromSchema(e.state.schema),b=g.resolve(l),D=null,N=y.parse(i,{topNode:b.parent,topMatch:b.parent.contentMatchAt(b.index()),topOpen:!0,from:a,to:c,preserveWhitespace:"pre"!=b.parent.type.whitespace||"full",editableContent:!0,findPositions:h,ruleFromNode:eT,context:b});if(h&&null!=h[0].pos){var O=h[0].pos,S=h[1]&&h[1].pos;null==S&&(S=O),D={anchor:O+l,head:S+l}}return{doc:N,sel:D,from:l,to:d}}(e,t,o);if(s.chrome&&e.cursorWrapper&&O.sel&&O.sel.anchor==e.cursorWrapper.deco.from){var S=e.cursorWrapper.deco.type.toDOM.nextSibling,C=S&&S.nodeValue?S.nodeValue.length:1;O.sel={anchor:O.sel.anchor+C,head:O.sel.anchor+C}}var M=e.state.doc,k=M.slice(O.from,O.to);8===e.lastKeyCode&&Date.now()-100<e.lastKeyCodeTime?(c=e.state.selection.to,l="end"):(c=e.state.selection.from,l="start"),e.lastKeyCode=null;var x=function(e,t,o,n,r){var i=e.findDiffStart(t,o);if(null==i)return null;var s=e.findDiffEnd(t,o+e.size,o+t.size),a=s.a,c=s.b;
1if("end"==r){var l=Math.max(0,i-Math.min(a,c));n-=a+l-i}if(a<i&&e.size<t.size){var d=n<=i&&n>=a?i-n:0;i-=d,c=i+(c-a),a=i}else if(c<i){var f=n<=i&&n>=c?i-n:0;i-=f,a=i+(a-c),c=i}return{start:i,endA:a,endB:c}}(k.content,O.doc.content,O.from,c,l);if((s.ios&&e.lastIOSEnter>Date.now()-225||s.android)&&a.some(function(e){return"DIV"==e.nodeName||"P"==e.nodeName})&&(!x||x.endA>=x.endB)&&e.someProp("handleKeyDown",function(t){return t(e,D(13,"Enter"))})){e.lastIOSEnter=0;return}if(!x){if(i&&N instanceof n.Bs&&!N.empty&&N.$head.sameParent(N.$anchor)&&!e.composing&&!(O.sel&&O.sel.anchor!=O.sel.head))x={start:N.from,endA:N.to,endB:N.to};else{if(O.sel){var T=eA(e,e.state.doc,O.sel);T&&!T.eq(e.state.selection)&&e.dispatch(e.state.tr.setSelection(T))}return}}e.domChangeCount++,e.state.selection.from<e.state.selection.to&&x.start==x.endB&&e.state.selection instanceof n.Bs&&(x.start>e.state.selection.from&&x.start<=e.state.selection.from+2&&e.state.selection.from>=O.from?x.start=e.state.selection.from:x.endA<e.state.selection.to&&x.endA>=e.state.selection.to-2&&e.state.selection.to<=O.to&&(x.endB+=e.state.selection.to-x.endA,x.endA=e.state.selection.to)),s.ie&&s.ie_version<=11&&x.endB==x.start+1&&x.endA==x.start&&x.start>O.from&&" \xa0"==O.doc.textBetween(x.start-O.from-1,x.start-O.from+1)&&(x.start--,x.endA--,x.endB--);var A=O.doc.resolveNoCache(x.start-O.from),P=O.doc.resolveNoCache(x.endB-O.from),E=A.sameParent(P)&&A.parent.inlineContent;if((s.ios&&e.lastIOSEnter>Date.now()-225&&(!E||a.some(function(e){return"DIV"==e.nodeName||"P"==e.nodeName}))||!E&&A.pos<O.doc.content.size&&(d=n.Y1.findFrom(O.doc.resolve(A.pos+1),1,!0))&&d.head==P.pos)&&e.someProp("handleKeyDown",function(t){return t(e,D(13,"Enter"))})){e.lastIOSEnter=0;return}if(e.state.selection.anchor>x.start&&function(e,t,o,n,r){if(!n.parent.isTextblock||o-t<=r.pos-n.pos||eP(n,!0,!1)<r.pos)return!1;var i=e.resolve(t);if(i.parentOffset<i.parent.content.size||!i.parent.isTextblock)return!1;var s=e.resolve(eP(i,!0,!0));return!(!s.parent.isTextblock||s.pos>o||eP(s,!0,!1)<o)&&n.parent.content.cut(n.parentOffset).eq(s.parent.content)}(M,x.start,x.endA,A,P)&&e.someProp("handleKeyDown",function(t){return t(e,D(8,"Backspace"))})){s.android&&s.chrome&&e.domObserver.suppressSelectionUpdates();return}s.chrome&&s.android&&x.toB==x.from&&(e.lastAndroidDelete=Date.now()),s.android&&!E&&A.start()!=P.start()&&0==P.parentOffset&&A.depth==P.depth&&O.sel&&O.sel.anchor==O.sel.head&&O.sel.head==x.endA&&(x.endB-=2,P=O.doc.resolveNoCache(x.endB-O.from),setTimeout(function(){e.someProp("handleKeyDown",function(t){return t(e,D(13,"Enter"))})},20));var V=x.start,B=x.endA;if(E){if(A.pos==P.pos)s.ie&&s.ie_version<=11&&0==A.parentOffset&&(e.domObserver.suppressSelectionUpdates(),setTimeout(function(){return ea(e)},20)),f=e.state.tr.delete(V,B),h=M.resolve(x.start).marksAcross(M.resolve(x.endA));else if(x.endA==x.endB&&(u=M.resolve(x.start))&&(p=function(e,t){for(var o,n,i,s=e.firstChild.marks,a=t.firstChild.marks,c=s,l=a,d=0;d<a.length;d++)c=a[d].removeFromSet(c);for(var f=0;f<s.length;f++)l=s[f].removeFromSet(l);if(1==c.length&&0==l.length)n=c[0],o="add",i=function(e){return e.mark(n.addToSet(e.marks))};else{if(0!=c.length||1!=l.length)return null;n=l[0],o="remove",i=function(e){return e.mark(n.removeFromSet(e.marks))}}for(var h=[],p=0;p<t.childCount;p++)h.push(i(t.child(p)));if(r.HY.from(h).eq(e))return{mark:n,type:o}}(A.parent.content.cut(A.parentOffset,P.parentOffset),u.parent.content.cut(u.parentOffset,x.endA-u.start()))))f=e.state.tr,"add"==p.type?f.addMark(V,B,p.mark):f.removeMark(V,B,p.mark);else if(A.parent.child(A.index()).isText&&A.index()==P.index()-(P.textOffset?0:1)){var R=A.parent.textBetween(A.parentOffset,P.parentOffset);if(e.someProp("handleTextInput",function(t){return t(e,V,B,R)}))return;f=e.state.tr.insertText(R,V,B)}}if(f||(f=e.state.tr.replace(V,B,O.doc.slice(x.start-O.from,x.endB-O.from))),O.sel){var z=eA(e,f.doc,O.sel);z&&!(s.chrome&&s.android&&e.composing&&z.empty&&(x.start!=x.endB||e.lastAndroidDelete<Date.now()-100)&&(z.head==V||z.head==f.mapping.map(B)-1)||s.ie&&z.empty&&z.head==V)&&f.setSelection(z)}h&&f.ensureMarks(h),e.dispatch(f.scrollIntoView())}(e,t,o,i,a)}),e.domObserver.start(),e.domChangeCount=0,e.eventHandlers=Object.create(null),ej)!function(t){var o=ej[t];e.dom.addEventListener(t,e.eventHandlers[t]=function(t){!function(e,t){if(!t.bubbles)return!0;
1if(t.defaultPrevented)return!1;for(var o=t.target;o!=e.dom;o=o.parentNode)if(!o||11==o.nodeType||o.pmViewDesc&&o.pmViewDesc.stopEvent(t))return!1;return!0}(e,t)||eX(e,t)||!e.editable&&t.type in eY||o(e,t)})}(t);s.safari&&e.dom.addEventListener("input",function(){return null}),eG(e)}(this),this.prevDirectPlugins=[],this.pluginViews=[],this.updatePluginViews()},tN={props:{configurable:!0},root:{configurable:!0},isDestroyed:{configurable:!0}};function tO(e){var t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),t.translate="no",e.someProp("attributes",function(o){if("function"==typeof o&&(o=o(e.state)),o)for(var n in o)"class"==n&&(t.class+=" "+o[n]),"style"==n?t.style=(t.style?t.style+";":"")+o[n]:t[n]||"contenteditable"==n||"nodeName"==n||(t[n]=String(o[n]))}),[ts.node(0,e.state.doc.content.size,t)]}function tS(e){if(e.markCursor){var t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:ts.widget(e.state.selection.head,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function tC(e){return!e.someProp("editable",function(t){return!1===t(e.state)})}function tM(e){var t={};return e.someProp("nodeViews",function(e){for(var o in e)Object.prototype.hasOwnProperty.call(t,o)||(t[o]=e[o])}),t}function tk(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw RangeError("Plugins passed directly to the view must not have a state component")}tN.props.get=function(){if(this._props.state!=this.state){var e=this._props;for(var t in this._props={},e)this._props[t]=e[t];this._props.state=this.state}return this._props},tD.prototype.update=function(e){e.handleDOMEvents!=this._props.handleDOMEvents&&eG(this),this._props=e,e.plugins&&(e.plugins.forEach(tk),this.directPlugins=e.plugins),this.updateStateInner(e.state,!0)},tD.prototype.setProps=function(e){var t={};for(var o in this._props)t[o]=this._props[o];for(var n in t.state=this.state,e)t[n]=e[n];this.update(t)},tD.prototype.updateState=function(e){this.updateStateInner(e,this.state.plugins!=e.plugins)},tD.prototype.updateStateInner=function(e,t){var o,r,i,a=this,c=this.state,l=!1,d=!1;if(e.storedMarks&&this.composing&&(e8(this),d=!0),this.state=e,t){var f=tM(this);(function(e,t){var o=0,n=0;for(var r in e){if(e[r]!=t[r])return!0;o++}for(var i in t)n++;return o!=n})(f,this.nodeViews)&&(this.nodeViews=f,l=!0),eG(this)}this.editable=tC(this),tS(this);var h=tw(this),p=tO(this),u=t?"reset":e.scrollToSelection>c.scrollToSelection?"to selection":"preserve",m=l||!this.docView.matchesNode(e.doc,p,h);(m||!e.selection.eq(c.selection))&&(d=!0);var g="preserve"==u&&d&&null==this.dom.style.overflowAnchor&&function(e){for(var t,o,n=e.dom.getBoundingClientRect(),r=Math.max(0,n.top),i=(n.left+n.right)/2,s=r+1;s<Math.min(innerHeight,n.bottom);s+=5){var a=e.root.elementFromPoint(i,s);if(a!=e.dom&&e.dom.contains(a)){var c=a.getBoundingClientRect();if(c.top>=r-20){t=a,o=c.top;break}}}return{refDOM:t,refTop:o,stack:S(e.dom)}}(this);if(d){this.domObserver.stop();var y,b,w,D,N,M=m&&(s.ie||s.chrome)&&!this.composing&&!c.selection.empty&&!e.selection.empty&&(y=c.selection,b=e.selection,w=Math.min(y.$anchor.sharedDepth(y.head),b.$anchor.sharedDepth(b.head)),y.$anchor.start(w)!=b.$anchor.start(w));if(m){var k=s.chrome?this.trackWrites=this.root.getSelection().focusNode:null;(l||!this.docView.update(e.doc,p,h,this))&&(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=H(e.doc,p,h,this.dom,this)),k&&!this.trackWrites&&(M=!0)}M||!(this.mouseDown&&this.domObserver.currentSelection.eq(this.root.getSelection())&&(D=this.docView.domFromPos(this.state.selection.anchor,0),N=this.root.getSelection(),v(D.node,D.offset,N.anchorNode,N.anchorOffset)))?ea(this,M):(eh(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}if(this.updatePluginViews(c),"reset"==u)this.dom.scrollTop=0;else if("to selection"==u){var x=this.root.getSelection().focusNode;this.someProp("handleScrollToSelection",function(e){return e(a)})||(e.selection instanceof n.qv?O(this,this.docView.domAfterPos(e.selection.from).getBoundingClientRect(),x):O(this,this.coordsAtPos(e.selection.head,1),x))}else g&&(o=g.refDOM,r=g.refTop,C(g.stack,0==(i=o?o.getBoundingClientRect().top:0)?0:i-r))},tD.prototype.destroyPluginViews=function(){for(var e;e=this.pluginViews.pop();)e.destroy&&e.destroy()},tD.prototype.updatePluginViews=function(e){if(e&&e.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(var t=0;t<this.pluginViews.length;t++){var o=this.pluginViews[t];o.update&&o.update(this,e)}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(var n=0;n<this.directPlugins.length;n++){var r=this.directPlugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(var i=0;i<this.state.plugins.length;i++){var s=this.state.plugins[i];s.spec.view&&this.pluginViews.push(s.spec.view(this))}}},tD.prototype.someProp=function(e,t){var o,n=this._props&&this._props[e];if(null!=n&&(o=t?t(n):n))return o;for(var r=0;r<this.directPlugins.length;r++){var i=this.directPlugins[r].props[e];if(null!=i&&(o=t?t(i):i))return o}var s=this.state.plugins;if(s)for(var a=0;a<s.length;a++){var c=s[a].props[e];if(null!=c&&(o=t?t(c):c))return o}},tD.prototype.hasFocus=function(){return this.root.activeElement==this.dom}
1,tD.prototype.focus=function(){this.domObserver.stop(),this.editable&&function(e){if(e.setActive)return e.setActive();if(M)return e.focus(M);var t=S(e);e.focus(null==M?{get preventScroll(){return M={preventScroll:!0},!0}}:void 0),M||(M=!1,C(t,0))}(this.dom),ea(this),this.domObserver.start()},tN.root.get=function(){var e=this._root;if(null==e){for(var t=this.dom.parentNode;t;t=t.parentNode)if(9==t.nodeType||11==t.nodeType&&t.host)return t.getSelection||(Object.getPrototypeOf(t).getSelection=function(){return document.getSelection()}),this._root=t}return e||document},tD.prototype.posAtCoords=function(e){return function(e,t){var o,n,r=e.dom.ownerDocument;if(r.caretPositionFromPoint)try{var i=r.caretPositionFromPoint(t.left,t.top);i&&(o=i.offsetNode,n=i.offset)}catch(e){}if(!o&&r.caretRangeFromPoint){var a=r.caretRangeFromPoint(t.left,t.top);a&&(o=a.startContainer,n=a.startOffset)}var c,l=(e.root.elementFromPoint?e.root:r).elementFromPoint(t.left,t.top+1);if(!l||!e.dom.contains(1!=l.nodeType?l.parentNode:l)){var d=e.dom.getBoundingClientRect();if(!k(t,d)||!(l=function e(t,o,n){var r=t.childNodes.length;if(r&&n.top<n.bottom)for(var i=Math.max(0,Math.min(r-1,Math.floor(r*(o.top-n.top)/(n.bottom-n.top))-2)),s=i;;){var a=t.childNodes[s];if(1==a.nodeType)for(var c=a.getClientRects(),l=0;l<c.length;l++){var d=c[l];if(k(o,d))return e(a,o,d)}if((s=(s+1)%r)==i)break}return t}(e.dom,t,d)))return null}if(s.safari)for(var f=l;o&&f;f=p(f))f.draggable&&(o=n=null);if(l=(u=(h=l).parentNode)&&/^li$/i.test(u.nodeName)&&t.left<h.getBoundingClientRect().left?u:h,o){if(s.gecko&&1==o.nodeType&&(n=Math.min(n,o.childNodes.length))<o.childNodes.length){var h,u,v,g=o.childNodes[n];"IMG"==g.nodeName&&(v=g.getBoundingClientRect()).right<=t.left&&v.bottom>t.top&&n++}o==e.dom&&n==o.childNodes.length-1&&1==o.lastChild.nodeType&&t.top>o.lastChild.getBoundingClientRect().bottom?c=e.state.doc.content.size:(0==n||1!=o.nodeType||"BR"!=o.childNodes[n-1].nodeName)&&(c=function(e,t,o,n){for(var r=-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>n.left||a.top>n.top)r=s.posBefore;else if(a.right<n.left||a.bottom<n.top)r=s.posAfter;else break}i=s.dom.parentNode}return r>-1?r:e.docView.posFromDOM(t,o)}(e,o,n,t))}null==c&&(c=function(e,t,o){var n=function e(t,o){for(var n,r,i=2e8,s=0,a=o.top,c=o.top,l=t.firstChild,d=0;l;l=l.nextSibling,d++){var f=void 0;if(1==l.nodeType)f=l.getClientRects();else{if(3!=l.nodeType)continue;f=m(l).getClientRects()}for(var h=0;h<f.length;h++){var p=f[h];if(p.top<=a&&p.bottom>=c){a=Math.max(p.bottom,a),c=Math.min(p.top,c);var u=p.left>o.left?p.left-o.left:p.right<o.left?o.left-p.right:0;if(u<i){n=l,i=u,r=u&&3==n.nodeType?{left:p.right<o.left?p.right:p.left,top:o.top}:o,1==l.nodeType&&u&&(s=d+(o.left>=(p.left+p.right)/2?1:0));continue}}!n&&(o.left>=p.right&&o.top>=p.top||o.left>=p.left&&o.top>=p.bottom)&&(s=d+1)}}return n&&3==n.nodeType?function(e,t){for(var o=e.nodeValue.length,n=document.createRange(),r=0;r<o;r++){n.setEnd(e,r+1),n.setStart(e,r);var i=x(n,1);if(i.top!=i.bottom&&k(t,i))return{node:e,offset:r+(t.left>=(i.left+i.right)/2?1:0)}}return{node:e,offset:0}}(n,r):!n||i&&1==n.nodeType?{node:t,offset:s}:e(n,r)}(t,o),r=n.node,i=n.offset,s=-1;if(1==r.nodeType&&!r.firstChild){var a=r.getBoundingClientRect();s=a.left!=a.right&&o.left>(a.left+a.right)/2?1:-1}return e.docView.posFromDOM(r,i,s)}(e,l,t));var y=e.docView.nearestDesc(l,!0);return{pos:c,inside:y?y.posAtStart-y.border:-1}}(this,e)},tD.prototype.coordsAtPos=function(e,t){return void 0===t&&(t=1),A(this,e,t)},tD.prototype.domAtPos=function(e,t){return void 0===t&&(t=0),this.docView.domFromPos(e,t)},tD.prototype.nodeDOM=function(e){var t=this.docView.descAt(e);return t?t.nodeDOM:null},tD.prototype.posAtDOM=function(e,t,o){void 0===o&&(o=-1);var n=this.docView.posFromDOM(e,t,o);if(null==n)throw RangeError("DOM position not inside the editor");return n},tD.prototype.endOfTextblock=function(e,t){var o,n,r,i,s;return o=this,n=t||this.state,r=e,R==n&&z==r?I:(R=n,z=r,I="up"==r||"down"==r?(i=n.selection,s="up"==r?i.$from:i.$to,V(o,n,function(){for(var e=o.docView.domFromPos(s.pos,"up"==r?-1:1).node;;){var t=o.docView.nearestDesc(e,!0);if(!t)break;
1if(t.node.isBlock){e=t.dom;break}e=t.dom.parentNode}for(var n=A(o,s.pos,1),i=e.firstChild;i;i=i.nextSibling){var a=void 0;if(1==i.nodeType)a=i.getClientRects();else{if(3!=i.nodeType)continue;a=m(i,0,i.nodeValue.length).getClientRects()}for(var c=0;c<a.length;c++){var l=a[c];if(l.bottom>l.top+1&&("up"==r?n.top-l.top>(l.bottom-n.top)*2:l.bottom-n.bottom>(n.bottom-l.top)*2))return!1}}return!0})):function(e,t,o){var n=t.selection.$head;if(!n.parent.isTextblock)return!1;var r=n.parentOffset,i=r==n.parent.content.size,s=e.root.getSelection();return B.test(n.parent.textContent)&&s.modify?V(e,t,function(){var t=s.getRangeAt(0),r=s.focusNode,i=s.focusOffset,a=s.caretBidiLevel;s.modify("move",o,"character");var c=!(n.depth?e.docView.domAfterPos(n.before()):e.dom).contains(1==s.focusNode.nodeType?s.focusNode:s.focusNode.parentNode)||r==s.focusNode&&i==s.focusOffset;return s.removeAllRanges(),s.addRange(t),null!=a&&(s.caretBidiLevel=a),c}):"left"==o||"backward"==o?!r:i}(o,n,r))},tD.prototype.destroy=function(){this.docView&&(function(e){for(var t in e.domObserver.stop(),e.eventHandlers)e.dom.removeEventListener(t,e.eventHandlers[t]);clearTimeout(e.composingTimeout),clearTimeout(e.lastIOSEnterFallbackTimeout)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],tw(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)},tN.isDestroyed.get=function(){return null==this.docView},tD.prototype.dispatchEvent=function(e){eX(this,e)||!ej[e.type]||!this.editable&&e.type in eY||ej[e.type](this,e)},tD.prototype.dispatch=function(e){var t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))},Object.defineProperties(tD.prototype,tN)}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.