"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5004],{32806:(e,t,n)=>{n.d(t,{Lz:()=>t$,NZ:()=>tg,zF:()=>tw});var o=n(51876),i=n(92322),s=n(62463);let r=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},l=function(e){let t=e.assignedSlot||e.parentNode;return t&&11==t.nodeType?t.host:t},d=null,a=function(e,t,n){let o=d||(d=document.createRange());return o.setEnd(e,null==n?e.nodeValue.length:n),o.setStart(e,t||0),o},c=function(){d=null},h=function(e,t,n,o){return n&&(f(e,t,n,o,-1)||f(e,t,n,o,1))},u=/^(img|br|input|textarea|hr)$/i;function f(e,t,n,o,i){for(var s;;){if(e==n&&t==o)return!0;if(t==(i<0?0:p(e))){let n=e.parentNode;if(!n||1!=n.nodeType||m(e)||u.test(e.nodeName)||"false"==e.contentEditable)return!1;t=r(e)+(i<0?0:1),e=n}else{if(1!=e.nodeType)return!1;let n=e.childNodes[t+(i<0?-1:0)];if(1==n.nodeType&&"false"==n.contentEditable)if(null==(s=n.pmViewDesc)||!s.ignoreForSelection)return!1;else t+=i;else e=n,t=i<0?p(e):0}}}function p(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function m(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}let g=function(e){return e.focusNode&&h(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function y(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}let b="undefined"!=typeof navigator?navigator:null,w="undefined"!=typeof document?document:null,v=b&&b.userAgent||"",D=/Edge\/(\d+)/.exec(v),N=/MSIE \d/.exec(v),C=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(v),S=!!(N||C||D),O=N?document.documentMode:C?+C[1]:D?+D[1]:0,M=!S&&/gecko\/(\d+)/i.test(v);M&&(/Firefox\/(\d+)/.exec(v)||[0,0])[1];let x=!S&&/Chrome\/(\d+)/.exec(v),T=!!x,k=x?+x[1]:0,E=!S&&!!b&&/Apple Computer/.test(b.vendor),P=E&&(/Mobile\/\w+/.test(v)||!!b&&b.maxTouchPoints>2),V=P||!!b&&/Mac/.test(b.platform),A=!!b&&/Win/.test(b.platform),R=/Android \d/.test(v),B=!!w&&"webkitFontSmoothing"in w.documentElement.style,F=B?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function z(e,t){return"number"==typeof e?e:e[t]}function L(e,t,n){let o=e.someProp("scrollThreshold")||0,i=e.someProp("scrollMargin")||5,s=e.dom.ownerDocument;for(let r=n||e.dom;r;){if(1!=r.nodeType){r=l(r);continue}let e=r,n=e==s.body,d=n?function(e){let t=e.defaultView&&e.defaultView.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}(s):function(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,o=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*o}}(e),a=0,c=0;if(t.topd.bottom-z(o,"bottom")&&(c=t.bottom-t.top>d.bottom-d.top?t.top+z(i,"top")-d.top:t.bottom-d.bottom+z(i,"bottom")),t.leftd.right-z(o,"right")&&(a=t.right-d.right+z(i,"right")),a||c)if(n)s.defaultView.scrollBy(a,c);else{let n=e.scrollLeft,o=e.scrollTop;c&&(e.scrollTop+=c),a&&(e.scrollLeft+=a);let i=e.scrollLeft-n,s=e.scrollTop-o;t={left:t.left-i,top:t.top-s,right:t.right-i,bottom:t.bottom-s}}let h=n?"fixed":getComputedStyle(r).position;if(/^(fixed|sticky)$/.test(h))break;r="absolute"==h?r.offsetParent:l(r)}}function I(e){let t=[],n=e.ownerDocument;for(let o=e;o&&(t.push({dom:o,top:o.scrollTop,left:o.scrollLeft}),e!=n);o=l(o));return t}function K(e,t){for(let n=0;n=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function W(e){return e.top=0&&i==o.nodeValue.length?(e--,s=1):n<0?e--:t++,G(H(a(o,e,t),s),s<0)}if(!e.state.doc.resolve(t-(s||0)).parent.inlineContent){if(null==s&&i&&(n<0||i==p(o))){let e=o.childNodes[i-1];if(1==e.nodeType)return J(e.getBoundingClientRect(),!1)}if(null==s&&i=0)}if(null==s&&i&&(n<0||i==p(o))){let e=o.childNodes[i-1],t=3==e.nodeType?a(e,p(e)-!r):1!=e.nodeType||"BR"==e.nodeName&&e.nextSibling?null:e;if(t)return G(H(t,1),!1)}if(null==s&&i=0)}function G(e,t){if(0==e.width)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function J(e,t){if(0==e.height)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function j(e,t,n){let o=e.state,i=e.root.activeElement;o!=t&&e.updateState(t),i!=e.dom&&e.focus();try{return n()}finally{o!=t&&e.updateState(o),i!=e.dom&&i&&i.focus()}}let Y=/[\u0590-\u08ac]/,Z=null,X=null,Q=!1;class ee{constructor(e,t,n,o){this.parent=e,this.children=t,this.dom=n,this.contentDOM=o,this.dirty=0,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,n){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;tr(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))o=2&e.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==t)for(let t=e;;t=t.parentNode){if(t==this.dom){o=!1;break}if(t.previousSibling)break}if(null==o&&t==e.childNodes.length)for(let t=e;;t=t.parentNode){if(t==this.dom){o=!0;break}if(t.nextSibling)break}}return(null==o?n>0:o)?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,o=e;o;o=o.parentNode){let i=this.getDesc(o),s;if(i&&(!t||i.node))if(!n||!(s=i.nodeDOM)||(1==s.nodeType?s.contains(1==e.nodeType?e:e.parentNode):s==e))return i;else n=!1}}getDesc(e){let t=e.pmViewDesc;for(let e=t;e;e=e.parent)if(e==this)return t}posFromDOM(e,t,n){for(let o=e;o;o=o.parentNode){let i=this.getDesc(o);if(i)return i.localPosFromDOM(e,t,n)}return -1}descAt(e){for(let t=0,n=0;te||i instanceof el){o=e-t;break}t=s}if(o)return this.children[n].domFromPos(o-this.children[n].border,t);for(let e;n&&!(e=this.children[n-1]).size&&e instanceof et&&e.side>=0;n--);if(t<=0){let e,o=!0;for(;(e=n?this.children[n-1]:null)&&e.dom.parentNode!=this.contentDOM;n--,o=!1);return e&&t&&o&&!e.border&&!e.domAtom?e.domFromPos(e.size,t):{node:this.contentDOM,offset:e?r(e.dom)+1:0}}{let e,o=!0;for(;(e=n=i&&t<=d-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(e,t,i);e=s;for(let t=l;t>0;t--){let n=this.children[t-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){o=r(n.dom)+1;break}e-=n.size}-1==o&&(o=0)}if(o>-1&&(d>t||l==this.children.length-1)){t=d;for(let e=l+1;el&&st){let e=l;l=d,d=e}let n=document.createRange();n.setEnd(d.node,d.offset),n.setStart(l.node,l.offset),a.removeAllRanges(),a.addRange(n)}}ignoreMutation(e){return!this.contentDOM&&"selection"!=e.type}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let n=0,o=0;o=n:en){let o=n+i.border,r=s-i.border;if(e>=o&&t<=r){this.dirty=e==n||t==s?2:1,e==o&&t==r&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=3:i.markDirty(e-o,t-o);return}i.dirty=i.dom!=i.contentDOM||i.dom.parentNode!=this.contentDOM||i.children.length?3:2}n=s}this.dirty=2}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=1==e?2:1;t.dirtyi?i.parent?i.parent.posBeforeChild(i):void 0:o)),!t.type.spec.raw){if(1!=s.nodeType){let e=document.createElement("span");e.appendChild(s),s=e}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(e,[],s,null),this.widget=t,this.widget=t,i=this}matchesWidget(e){return 0==this.dirty&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return!!t&&t(e)}ignoreMutation(e){return"selection"!=e.type||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class en extends ee{constructor(e,t,n,o){super(e,[],t,null),this.textDOM=n,this.text=o}get size(){return this.text.length}localPosFromDOM(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return"characterData"===e.type&&e.target.nodeValue==e.oldValue}}class eo extends ee{constructor(e,t,n,o,i){super(e,[],n,o),this.mark=t,this.spec=i}static create(e,t,n,o){let s=o.nodeViews[t.type.name],r=s&&s(t,o,n);return r&&r.dom||(r=i.ZF.renderSpec(document,t.type.spec.toDOM(t,n),null,t.attrs)),new eo(e,t,r.dom,r.contentDOM||r.dom,r)}parseRule(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return 3!=this.dirty&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),0!=this.dirty){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty0&&(i=eb(i,0,e,n));for(let e=0;ed?d.parent?d.parent.posBeforeChild(d):void 0:r,n,o),c=a&&a.dom,h=a&&a.contentDOM;if(t.isText)if(c){if(3!=c.nodeType)throw RangeError("Text must be rendered as a DOM text node")}else c=document.createTextNode(t.text);else if(!c){let e=i.ZF.renderSpec(document,t.type.spec.toDOM(t),null,t.attrs);({dom:c,contentDOM:h}=e)}h||t.isText||"BR"==c.nodeName||(c.hasAttribute("contenteditable")||(c.contentEditable="false"),t.type.spec.draggable&&(c.draggable=!0));let u=c;return(c=ef(c,n,t),a)?d=new ed(e,t,n,o,c,h||null,u,a,s,r+1):t.isText?new er(e,t,n,o,c,u,s):new ei(e,t,n,o,c,h||null,u,s,r+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(e.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){for(let t=this.children.length-1;t>=0;t--){let n=this.children[t];if(this.dom.contains(n.dom.parentNode)){e.contentElement=n.dom.parentNode;break}}e.contentElement||(e.getContent=()=>i.FK.empty)}else e.contentElement=this.contentDOM;else e.getContent=()=>this.node.content;return e}matchesNode(e,t,n){return 0==this.dirty&&e.eq(this.node)&&ep(t,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return+!this.node.isLeaf}updateChildren(e,t){let n=this.node.inlineContent,o=t,s=e.composing?this.localCompositionInfo(e,t):null,r=s&&s.pos>-1?s:null,l=s&&s.pos<0,d=new eg(this,r&&r.node,e);(function(e,t,n,o){let i=t.locals(e),s=0;if(0==i.length){for(let n=0;ns;)l.push(i[r++]);let p=s+u.nodeSize;if(u.isText){let e=p;r!e.inline):l.slice();o(u,m,t.forChild(s,u),f),s=p}})(this.node,this.innerDeco,(t,s,r)=>{t.spec.marks?d.syncToMarks(t.spec.marks,n,e,s):t.type.side>=0&&!r&&d.syncToMarks(s==this.node.childCount?i.CU.none:this.node.child(s).marks,n,e,s),d.placeWidget(t,e,o)},(t,i,r,a)=>{let c;d.syncToMarks(t.marks,n,e,a),d.findNodeMatch(t,i,r,a)||l&&e.state.selection.from>o&&e.state.selection.to-1&&d.updateNodeAt(t,i,r,c,e)||d.updateNextNode(t,i,r,e,a,o)||d.addNode(t,i,r,e,o),o+=t.nodeSize}),d.syncToMarks([],n,e,0),this.node.isTextblock&&d.addTextblockHacks(),d.destroyRest(),(d.changed||2==this.dirty)&&(r&&this.protectLocalComposition(e,r),function e(t,n,o){let i=t.firstChild,s=!1;for(let r=0;rt+this.node.content.size)return null;let s=e.input.compositionNode;if(!s||!this.dom.contains(s.parentNode))return null;if(!this.node.inlineContent)return{node:s,pos:-1,text:""};{let e=s.nodeValue,o=function(e,t,n,o){for(let i=0,s=0;i=n){if(s>=o&&d.slice(o-t.length-l,o-l)==t)return o-t.length;let e=l=0&&e+t.length+l>=n)return l+e;if(n==o&&d.length>=o+t.length-l&&d.slice(o-l,o-l+t.length)==t)return o}}return -1}(this.node.content,e,n-t,i-t);return o<0?null:{node:s,pos:o,text:e}}}protectLocalComposition(e,{node:t,pos:n,text:o}){if(this.getDesc(t))return;let i=t;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let s=new en(this,i,t,o);e.input.compositionNodes.push(s),this.children=eb(this.children,n,n+o.length,e,s)}update(e,t,n,o){return 3!=this.dirty&&!!e.sameMarkup(this.node)&&(this.updateInner(e,t,n,o),!0)}updateInner(e,t,n,o){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(o,this.posAtStart),this.dirty=0}updateOuterDeco(e){if(ep(e,this.outerDeco))return;let t=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=eu(this.dom,this.nodeDOM,eh(this.outerDeco,this.node,t),eh(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){1==this.nodeDOM.nodeType&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){1==this.nodeDOM.nodeType&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function es(e,t,n,o,i){ef(o,t,e);let s=new ei(void 0,e,t,n,o,o,o,i,0);return s.contentDOM&&s.updateChildren(i,0),s}class er extends ei{constructor(e,t,n,o,i,s,r){super(e,t,n,o,i,null,s,r,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,n,o){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,o.trackWrites==this.nodeDOM&&(o.trackWrites=null)),this.node=e,this.dirty=0,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,n){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,n)}ignoreMutation(e){return"characterData"!=e.type&&"selection"!=e.type}slice(e,t,n){let o=this.node.cut(e,t),i=document.createTextNode(o.text);return new er(this.parent,o,this.outerDeco,this.innerDeco,i,i,n)}markDirty(e,t){super.markDirty(e,t),this.dom!=this.nodeDOM&&(0==e||t==this.nodeDOM.nodeValue.length)&&(this.dirty=3)}get domAtom(){return!1}isText(e){return this.node.text==e}}class el extends ee{parseRule(){return{ignore:!0}}matchesHack(e){return 0==this.dirty&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return"IMG"==this.dom.nodeName}}class ed extends ei{constructor(e,t,n,o,i,s,r,l,d,a){super(e,t,n,o,i,s,r,d,a),this.spec=l}update(e,t,n,o){if(3==this.dirty)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let i=this.spec.update(e,t,n);return i&&this.updateInner(e,t,n,o),i}return(!!this.contentDOM||!!e.isLeaf)&&super.update(e,t,n,o)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,n,o){this.spec.setSelection?this.spec.setSelection(e,t,n.root):super.setSelection(e,t,n,o)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return!!this.spec.stopEvent&&this.spec.stopEvent(e)}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}let ea=function(e){e&&(this.nodeName=e)};ea.prototype=Object.create(null);let ec=[new ea];function eh(e,t,n){if(0==e.length)return ec;let o=n?ec[0]:new ea,i=[o];for(let s=0;s0;){let l;for(;;)if(o){let e=n.children[o-1];if(e instanceof eo)n=e,o=e.children.length;else{l=e,o--;break}}else if(n==t)break e;else o=n.parent.children.indexOf(n),n=n.parent;let d=l.node;if(d){if(d!=e.child(i-1))break;--i,s.set(l,i),r.push(l)}}return{index:i,matched:s,matches:r.reverse()}}(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let n=e;n>1,r=Math.min(s,e.length);for(;i-1)i>this.index&&(this.changed=!0,this.destroyBetween(this.index,i)),this.top=this.top.children[this.index];else{let o=eo.create(this.top,e[s],t,n);this.top.children.splice(this.index,0,o),this.top=o,this.changed=!0}this.index=0,s++}}findNodeMatch(e,t,n,o){let i=-1,s;if(o>=this.preMatch.index&&(s=this.preMatch.matches[o-this.preMatch.index]).parent==this.top&&s.matchesNode(e,t,n))i=this.top.children.indexOf(s,this.index);else for(let o=this.index,s=Math.min(this.top.children.length,o+5);o=n||c<=t?s.push(d):(an&&s.push(d.slice(n-a,d.size,o)))}return s}function ew(e,t=null){let n=e.domSelectionRange(),i=e.state.doc;if(!n.focusNode)return null;let s=e.docView.nearestDesc(n.focusNode),l=s&&0==s.size,d=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(d<0)return null;let a=i.resolve(d),c,h;if(g(n)){for(c=d;s&&!s.node;)s=s.parent;let e=s.node;if(s&&e.isAtom&&o.nh.isSelectable(e)&&s.parent&&!(e.isInline&&function(e,t,n){for(let o=0==t,i=t==p(e);o||i;){if(e==n)return!0;let t=r(e);if(!(e=e.parentNode))return!1;o=o&&0==t,i=i&&t==p(e)}}(n.focusNode,n.focusOffset,s.dom))){let e=s.posBefore;h=new o.nh(d==e?a:i.resolve(e))}}else{if(n instanceof e.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let t=d,o=d;for(let i=0;i{(r.anchorNode!=l||r.anchorOffset!=d)&&(s.removeEventListener("selectionchange",i.input.hideSelectionGuard),setTimeout(()=>{(!ev(i)||i.state.selection.visible)&&i.dom.classList.remove("ProseMirror-hideselection")},20))})))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}let eN=E||T&&k<63;function eC(e,t){let{node:n,offset:o}=e.docView.domFromPos(t,0),i=oo(e,t,n))||o.U3.between(t,n,i)}function ek(e){return(!e.editable||!!e.hasFocus())&&eE(e)}function eE(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(3==t.anchorNode.nodeType?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(3==t.focusNode.nodeType?t.focusNode.parentNode:t.focusNode))}catch(e){return!1}}function eP(e,t){let{$anchor:n,$head:i}=e.selection,s=t>0?n.max(i):n.min(i),r=s.parent.inlineContent?s.depth?e.doc.resolve(t>0?s.after():s.before()):null:s;return r&&o.LN.findFrom(r,t)}function eV(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function eA(e,t,n){let i=e.state.selection;if(i instanceof o.U3){if(n.indexOf("s")>-1){let{$head:n}=i,s=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter;if(!s||s.isText||!s.isLeaf)return!1;let r=e.state.doc.resolve(n.pos+s.nodeSize*(t<0?-1:1));return eV(e,new o.U3(i.$anchor,r))}else if(!i.empty)return!1;else if(e.endOfTextblock(t>0?"forward":"backward")){let n=eP(e.state,t);return!!n&&n instanceof o.nh&&eV(e,n)}else if(!(V&&n.indexOf("m")>-1)){let n=i.$head,s=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter,r;if(!s||s.isText)return!1;let l=t<0?n.pos-s.nodeSize:n.pos;return!!(s.isAtom||(r=e.docView.descAt(l))&&!r.contentDOM)&&(o.nh.isSelectable(s)?eV(e,new o.nh(t<0?e.state.doc.resolve(n.pos-s.nodeSize):n)):!!B&&eV(e,new o.U3(e.state.doc.resolve(t<0?l:l+s.nodeSize))))}}else{if(i instanceof o.nh&&i.node.isInline)return eV(e,new o.U3(t>0?i.$to:i.$from));let n=eP(e.state,t);return!!n&&eV(e,n)}}function eR(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function eB(e,t){let n=e.pmViewDesc;return n&&0==n.size&&(t<0||e.nextSibling||"BR"!=e.nodeName)}function eF(e,t){return t<0?function(e){let t=e.domSelectionRange(),n=t.focusNode,o=t.focusOffset;if(!n)return;let i,s,l=!1;for(M&&1==n.nodeType&&o0)if(1!=n.nodeType)break;else{let e=n.childNodes[o-1];if(eB(e,-1))i=n,s=--o;else if(3==e.nodeType)o=(n=e).nodeValue.length;else break}else if(ez(n))break;else{let t=n.previousSibling;for(;t&&eB(t,-1);)i=n.parentNode,s=r(t),t=t.previousSibling;if(t)o=eR(n=t);else{if((n=n.parentNode)==e.dom)break;o=0}}l?eL(e,n,o):i&&eL(e,i,s)}(e):function(e){let t,n,o=e.domSelectionRange(),i=o.focusNode,s=o.focusOffset;if(!i)return;let l=eR(i);for(;;)if(s{e.state==i&&eD(e)},50)}function eI(e,t){let n=e.state.doc.resolve(t);if(!(T||A)&&n.parent.inlineContent){let o=e.coordsAtPos(t);if(t>n.start()){let n=e.coordsAtPos(t-1),i=(n.top+n.bottom)/2;if(i>o.top&&i1)return n.lefto.top&&i1)return n.left>o.left?"ltr":"rtl"}}return"rtl"==getComputedStyle(e.dom).direction?"rtl":"ltr"}function eK(e,t,n){let i=e.state.selection;if(i instanceof o.U3&&!i.empty||n.indexOf("s")>-1||V&&n.indexOf("m")>-1)return!1;let{$from:s,$to:r}=i;if(!s.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let n=eP(e.state,t);if(n&&n instanceof o.nh)return eV(e,n)}if(!s.parent.inlineContent){let n=t<0?s:r,l=i instanceof o.i5?o.LN.near(n,t):o.LN.findFrom(n,t);return!!l&&eV(e,l)}return!1}function eq(e,t){if(!(e.state.selection instanceof o.U3))return!0;let{$head:n,$anchor:i,empty:s}=e.state.selection;if(!n.sameParent(i))return!0;if(!s)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let r=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(r&&!r.isText){let o=e.state.tr;return t<0?o.delete(n.pos-r.nodeSize,n.pos):o.delete(n.pos,n.pos+r.nodeSize),e.dispatch(o),!0}return!1}function e$(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function eW(e,t){e.someProp("transformCopied",n=>{t=n(t,e)});let n=[],{content:o,openStart:s,openEnd:r}=t;for(;s>1&&r>1&&1==o.childCount&&1==o.firstChild.childCount;){s--,r--;let e=o.firstChild;n.push(e.type.name,e.attrs!=e.type.defaultAttrs?e.attrs:null),o=e.content}let l=e.someProp("clipboardSerializer")||i.ZF.fromSchema(e.state.schema),d=eZ(),a=d.createElement("div");a.appendChild(l.serializeFragment(o,{document:d}));let c=a.firstChild,h,u=0;for(;c&&1==c.nodeType&&(h=ej[c.nodeName.toLowerCase()]);){for(let e=h.length-1;e>=0;e--){let t=d.createElement(h[e]);for(;a.firstChild;)t.appendChild(a.firstChild);a.appendChild(t),u++}c=a.firstChild}return c&&1==c.nodeType&&c.setAttribute("data-pm-slice",`${s} ${r}${u?` -${u}`:""} ${JSON.stringify(n)}`),{dom:a,text:e.someProp("clipboardTextSerializer",n=>n(t,e))||t.content.textBetween(0,t.content.size,"\n\n"),slice:t}}function eH(e,t,n,o,s){let r,l,d=s.parent.type.spec.code;if(!n&&!t)return null;let a=!!t&&(o||d||!n);if(a){if(e.someProp("transformPastedText",n=>{t=n(t,d||o,e)}),d)return l=new i.Ji(i.FK.from(e.state.schema.text(t.replace(/\r\n?/g,"\n"))),0,0),e.someProp("transformPasted",t=>{l=t(l,e,!0)}),l;let n=e.someProp("clipboardTextParser",n=>n(t,s,o,e));if(n)l=n;else{let n=s.marks(),{schema:o}=e.state,l=i.ZF.fromSchema(o);r=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(e=>{let t=r.appendChild(document.createElement("p"));e&&t.appendChild(l.serializeNode(o.text(e,n)))})}}else e.someProp("transformPastedHTML",t=>{n=t(n,e)}),r=function(e){var t;let n,o=/^(\s*]*>)*/.exec(e);o&&(e=e.slice(o[0].length));let i=eZ().createElement("div"),s=/<([a-z][^>\s]+)/i.exec(e),r;if((r=s&&ej[s[1].toLowerCase()])&&(e=r.map(e=>"<"+e+">").join("")+e+r.map(e=>"").reverse().join("")),i.innerHTML=(t=e,(n=window.trustedTypes)?(eX||(eX=n.defaultPolicy||n.createPolicy("ProseMirrorClipboard",{createHTML:e=>e})),eX.createHTML(t)):t),r)for(let e=0;e0;e--){let e=r.firstChild;for(;e&&1!=e.nodeType;)e=e.nextSibling;if(!e)break;r=e}if(l||(l=(e.someProp("clipboardParser")||e.someProp("domParser")||i.S4.fromSchema(e.state.schema)).parseSlice(r,{preserveWhitespace:!!(a||h),context:s,ruleFromNode:e=>"BR"!=e.nodeName||e.nextSibling||!e.parentNode||e_.test(e.parentNode.nodeName)?null:{ignore:!0}})),h)l=function(e,t){if(!e.size)return e;let n=e.content.firstChild.type.schema,o;try{o=JSON.parse(t)}catch(t){return e}let{content:s,openStart:r,openEnd:l}=e;for(let e=o.length-2;e>=0;e-=2){let t=n.nodes[o[e]];if(!t||t.hasRequiredAttrs())break;s=i.FK.from(t.create(o[e+1],s)),r++,l++}return new i.Ji(s,r,l)}(eJ(l,+h[1],+h[2]),h[4]);else if((l=i.Ji.maxOpen(function(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let o=t.node(n).contentMatchAt(t.index(n)),s,r=[];if(e.forEach(e=>{if(!r)return;let t=o.findWrapping(e.type),n;if(!t)return r=null;if(n=r.length&&s.length&&function e(t,n,o,s,r){if(r{l=t(l,e,a)}),l}let e_=/^(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 eU(e,t,n=0){for(let o=t.length-1;o>=n;o--)e=t[o].create(null,i.FK.from(e));return e}function eG(e,t,n,o,s,r){let l=t<0?e.firstChild:e.lastChild,d=l.content;return e.childCount>1&&(r=0),s=n&&(d=t<0?l.contentMatchAt(0).fillBefore(d,r<=s).append(d):d.append(l.contentMatchAt(l.childCount).fillBefore(i.FK.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,l.copy(d))}function eJ(e,t,n){return t{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>e6(e,t))})}function e6(e,t){return e.someProp("handleDOMEvents",n=>{let o=n[t.type];return!!o&&(o(e,t)||t.defaultPrevented)})}function e8(e){return{left:e.clientX,top:e.clientY}}function e4(e,t,n,o,i){if(-1==o)return!1;let s=e.state.doc.resolve(o);for(let o=s.depth+1;o>0;o--)if(e.someProp(t,t=>o>s.depth?t(e,n,s.nodeAfter,s.before(o),i,!0):t(e,n,s.node(o),s.before(o),i,!1)))return!0;return!1}function e9(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let o=e.state.tr.setSelection(t);"pointer"==n&&o.setMeta("pointer",!0),e.dispatch(o)}e0.keydown=(e,t)=>{if((e.input.shiftKey=16==t.keyCode||t.shiftKey,!tt(e,t))&&(e.input.lastKeyCode=t.keyCode,e.input.lastKeyCodeTime=Date.now(),!R||!T||13!=t.keyCode))if(229!=t.keyCode&&e.domObserver.forceFlush(),!P||13!=t.keyCode||t.ctrlKey||t.altKey||t.metaKey)e.someProp("handleKeyDown",n=>n(e,t))||function(e,t){let n,o=t.keyCode,i=(n="",t.ctrlKey&&(n+="c"),t.metaKey&&(n+="m"),t.altKey&&(n+="a"),t.shiftKey&&(n+="s"),n);if(8==o||V&&72==o&&"c"==i)return eq(e,-1)||eF(e,-1);if(46==o&&!t.shiftKey||V&&68==o&&"c"==i)return eq(e,1)||eF(e,1);if(13==o||27==o)return!0;if(37==o||V&&66==o&&"c"==i){let t=37==o?"ltr"==eI(e,e.state.selection.from)?-1:1:-1;return eA(e,t,i)||eF(e,t)}if(39==o||V&&70==o&&"c"==i){let t=39==o?"ltr"==eI(e,e.state.selection.from)?1:-1:1;return eA(e,t,i)||eF(e,t)}else if(38==o||V&&80==o&&"c"==i)return eK(e,-1,i)||eF(e,-1);else if(40==o||V&&78==o&&"c"==i)return function(e){if(!E||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&1==t.nodeType&&0==n&&t.firstChild&&"false"==t.firstChild.contentEditable){let n=t.firstChild;e$(e,n,"true"),setTimeout(()=>e$(e,n,"false"),20)}return!1}(e)||eK(e,1,i)||eF(e,1);else if(i==(V?"m":"c")&&(66==o||73==o||89==o||90==o))return!0;return!1}(e,t)?t.preventDefault():e2(e,"key");else{let t=Date.now();e.input.lastIOSEnter=t,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==t&&(e.someProp("handleKeyDown",t=>t(e,y(13,"Enter"))),e.input.lastIOSEnter=0)},200)}},e0.keyup=(e,t)=>{16==t.keyCode&&(e.input.shiftKey=!1)},e0.keypress=(e,t)=>{if(tt(e,t)||!t.charCode||t.ctrlKey&&!t.altKey||V&&t.metaKey)return;if(e.someProp("handleKeyPress",n=>n(e,t)))return void t.preventDefault();let n=e.state.selection;if(!(n instanceof o.U3)||!n.$from.sameParent(n.$to)){let o=String.fromCharCode(t.charCode),i=()=>e.state.tr.insertText(o).scrollIntoView();/[\r\n]/.test(o)||e.someProp("handleTextInput",t=>t(e,n.$from.pos,n.$to.pos,o,i))||e.dispatch(i()),t.preventDefault()}};let e7=V?"metaKey":"ctrlKey";eQ.mousedown=(e,t)=>{e.input.shiftKey=t.shiftKey;let n=ts(e),i=Date.now(),s="singleClick";i-e.input.lastClick.time<500&&function(e,t){let n=t.x-e.clientX,o=t.y-e.clientY;return n*n+o*o<100}(t,e.input.lastClick)&&!t[e7]&&e.input.lastClick.button==t.button&&("singleClick"==e.input.lastClick.type?s="doubleClick":"doubleClick"==e.input.lastClick.type&&(s="tripleClick")),e.input.lastClick={time:i,x:t.clientX,y:t.clientY,type:s,button:t.button};let r=e.posAtCoords(e8(t));r&&("singleClick"==s?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new te(e,r,t,!!n)):("doubleClick"==s?function(e,t,n,o){return e4(e,"handleDoubleClickOn",t,n,o)||e.someProp("handleDoubleClick",n=>n(e,t,o))}:function(e,t,n,i){return e4(e,"handleTripleClickOn",t,n,i)||e.someProp("handleTripleClick",n=>n(e,t,i))||function(e,t,n){if(0!=n.button)return!1;let i=e.state.doc;if(-1==t)return!!i.inlineContent&&(e9(e,o.U3.create(i,0,i.content.size),"pointer"),!0);let s=i.resolve(t);for(let t=s.depth+1;t>0;t--){let n=t>s.depth?s.nodeAfter:s.node(t),r=s.before(t);if(n.inlineContent)e9(e,o.U3.create(i,r+1,r+1+n.content.size),"pointer");else{if(!o.nh.isSelectable(n))continue;e9(e,o.nh.create(i,r),"pointer")}return!0}}(e,n,i)})(e,r.pos,r.inside,t)?t.preventDefault():e2(e,"pointer"))};class te{constructor(e,t,n,i){let s,r;if(this.view=e,this.pos=t,this.event=n,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!n[e7],this.allowDefault=n.shiftKey,t.inside>-1)s=e.state.doc.nodeAt(t.inside),r=t.inside;else{let n=e.state.doc.resolve(t.pos);s=n.parent,r=n.depth?n.before():0}let l=i?null:n.target,d=l?e.docView.nearestDesc(l,!0):null;this.target=d&&1==d.nodeDOM.nodeType?d.nodeDOM:null;let{selection:a}=e.state;0==n.button&&(s.type.spec.draggable&&!1!==s.type.spec.selectable||a instanceof o.nh&&a.from<=r&&a.to>r)&&(this.mightDrag={node:s,pos:r,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&M&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),e2(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>eD(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;if(this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(e8(e))),this.updateAllowDefault(e),this.allowDefault||!t)e2(this.view,"pointer");else{var n,i,s,r;(n=this.view,i=t.pos,s=t.inside,r=this.selectNode,e4(n,"handleClickOn",i,s,e)||n.someProp("handleClick",t=>t(n,i,e))||(r?function(e,t){if(-1==t)return!1;let n=e.state.selection,i,s;n instanceof o.nh&&(i=n.node);let r=e.state.doc.resolve(t);for(let e=r.depth+1;e>0;e--){let t=e>r.depth?r.nodeAfter:r.node(e);if(o.nh.isSelectable(t)){s=i&&n.$from.depth>0&&e>=n.$from.depth&&r.before(n.$from.depth+1)==n.$from.pos?r.before(n.$from.depth):r.before(e);break}}return null!=s&&(e9(e,o.nh.create(e.state.doc,s),"pointer"),!0)}(n,s):function(e,t){if(-1==t)return!1;let n=e.state.doc.resolve(t),i=n.nodeAfter;return!!(i&&i.isAtom&&o.nh.isSelectable(i))&&(e9(e,new o.nh(n),"pointer"),!0)}(n,s)))?e.preventDefault():0==e.button&&(this.flushed||E&&this.mightDrag&&!this.mightDrag.node.isAtom||T&&!this.view.state.selection.visible&&2>=Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to)))?(e9(this.view,o.LN.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):e2(this.view,"pointer")}}move(e){this.updateAllowDefault(e),e2(this.view,"pointer"),0==e.buttons&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}function tt(e,t){return!!e.composing||!!(E&&500>Math.abs(t.timeStamp-