PageSourceSearch

https://www.hivplusmag.com/static/dist/social-ux/6955.61dab77c3251e1cad8f6.bundle.js

js hivplusmag.com collected 2026-09-24 18:46:44 UTC 252,674 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunksocialUX=self.webpackChunksocialUX||[]).push([[6955],{4388:function(e,t,n){n.d(t,{G2:function(){return c},I$:function(){return d},RV:function(){return C},hy:function(){return p},st:function(){return w},wh:function(){return k},yY:function(){return h}});var r=n(9364),i=n(8488),o=n(4543),s=function(e,t){return!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0)};function a(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=e;r;r="start"==t?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&1!=r.childCount)return!1}return!1}function l(e){if(!e.parent.type.spec.isolating)for(var t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function u(e){if(!e.parent.type.spec.isolating)for(var t=e.depth-1;t>=0;t--){var n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}var c=function(e,t){var n,i=e.selection,s=i instanceof o.nh;if(s){if(i.node.isTextblock||!(0,r.n9)(e.doc,i.from))return!1;n=i.from}else if(null==(n=(0,r.N0)(e.doc,i.from,-1)))return!1;if(t){var a=e.tr.join(n);s&&a.setSelection(o.nh.create(a.doc,n-e.doc.resolve(n).nodeBefore.nodeSize)),t(a.scrollIntoView())}return!0},h=function(e,t){var n=e.selection,i=n.$from,o=n.$to,s=i.blockRange(o),a=s&&(0,r.jP)(s);return null!=a&&(t&&t(e.tr.lift(s,a).scrollIntoView()),!0)};function f(e){for(var t=0;t<e.edgeCount;t++){var n=e.edge(t).type;if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}var d=function(e,t){var n=e.selection,r=n.$head,i=n.$anchor;if(!r.parent.type.spec.code||!r.sameParent(i))return!1;var s=r.node(-1),a=r.indexAfter(-1),l=f(s.contentMatchAt(a));if(!l||!s.canReplaceWith(a,a,l))return!1;if(t){var u=r.after(),c=e.tr.replaceWith(u,u,l.createAndFill());c.setSelection(o.LN.near(c.doc.resolve(u),1)),t(c.scrollIntoView())}return!0},p=function(e,t){var n,r=e.selection,i=r.$from,s=r.to,a=i.sharedDepth(s);return 0!=a&&(n=i.before(a),t&&t(e.tr.setSelection(o.nh.create(e.doc,n))),!0)};function v(e,t,n){var s,l,u=t.nodeBefore,c=t.nodeAfter;if(u.type.spec.isolating||c.type.spec.isolating)return!1;if(function(e,t,n){var i=t.nodeBefore,o=t.nodeAfter,s=t.index();return!(!(i&&o&&i.type.compatibleContent(o.type))||(!i.content.size&&t.parent.canReplace(s-1,s)?(n&&n(e.tr.delete(t.pos-i.nodeSize,t.pos).scrollIntoView()),0):!t.parent.canReplace(s,s+1)||!o.isTextblock&&!(0,r.n9)(e.doc,t.pos)||(n&&n(e.tr.clearIncompatible(t.pos,i.type,i.contentMatchAt(i.childCount)).join(t.pos).scrollIntoView()),0)))}(e,t,n))return!0;var h=t.parent.canReplace(t.index(),t.index()+1);if(h&&(s=(l=u.contentMatchAt(u.childCount)).findWrapping(c.type))&&l.matchType(s[0]||c.type).validEnd){if(n){for(var f=t.pos+c.nodeSize,d=i.FK.empty,p=s.length-1;p>=0;p--)d=i.FK.from(s[p].create(null,d));d=i.FK.from(u.copy(d));var v=e.tr.step(new r.Wg(t.pos-1,f,t.pos,f,new i.Ji(d,1,0),s.length,!0)),m=f+2*s.length;(0,r.n9)(v.doc,m)&&v.join(m),n(v.scrollIntoView())}return!0}var y=o.LN.findFrom(t,1),g=y&&y.$from.blockRange(y.$to),k=g&&(0,r.jP)(g);if(null!=k&&k>=t.depth)return n&&n(e.tr.lift(g,k).scrollIntoView()),!0;if(h&&a(c,"start",!0)&&a(u,"end")){for(var w=u,b=[];b.push(w),!w.isTextblock;)w=w.lastChild;for(var S=c,x=1;!S.isTextblock;S=S.firstChild)x++;if(w.canReplace(w.childCount,w.childCount,S.content)){if(n){for(var M=i.FK.empty,O=b.length-1;O>=0;O--)M=i.FK.from(b[O].copy(M));n(e.tr.step(new r.Wg(t.pos-b.length,t.pos+c.nodeSize,t.pos+x,t.pos+c.nodeSize-x,new i.Ji(M,b.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function m(e){return function(t,n){for(var r=t.selection,i=e<0?r.$from:r.$to,s=i.depth;i.node(s).isInline;){if(!s)return!1;s--}return!!i.node(s).isTextblock&&(n&&n(t.tr.setSelection(o.U3.create(t.doc,e<0?i.start(s):i.end(s)))),!0)}}var y=m(-1),g=m(1);function k(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return function(n,r){var i=n.selection,o=i.empty,s=i.$cursor,a=i.ranges;if(o&&!s||!function(e,t,n){for(var r,i=function(){var r=t[o],i=r.$from,s=r.$to,a=0==i.depth&&e.inlineContent&&e.type.allowsMarkType(n);if(e.nodesBetween(i.pos,s.pos,(function(e){if(a)return!1;a=e.inlineContent&&e.type.allowsMarkType(n)})),a)return{v:!0}},o=0;o<t.length;o++)if(r=i())return r.v;return!1}(n.doc,a,e))return!1;if(r)if(s)e.isInSet(n.storedMarks||s.marks())?r(n.tr.removeStoredMark(e)):r(n.tr.addStoredMark(e.create(t)));else{for(var l=!1,u=n.tr,c=0;!l&&c<a.length;c++){var h=a[c],f=h.$from,d=h.$to;l=n.doc.rangeHasMark(f.pos,d.pos,e)}for(var p=0;p<a.length;p++){var v=a[p],m=v.$from,y=v.$to;if(l)u.removeMark(m.pos,y.pos,e);else{var g=m.pos,k=y.pos,w=m.nodeAfter,b=y.nodeBefore,S=w&&w.isText?/^\s*/.exec(w.text)[0].length:0,x=b&&b.isText?/\s*$/.exec(b.text)[0].length:0;g+S<k&&(g+=S,k-=x),u.addMark(g,k,e.create(t))}}r(u.scrollIntoView())}return!0}}function w(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e,n,r){for(var i=0;i<t.length;i++)if(t[i](e,n,r))return!0;return!1}}var b=w(s,(function(e,t,n){var s=function(e,t){var n=e.selection.$cursor;return!n||(t?!t.endOfTextblock("backward",e):n.parentOffset>0)?null:n}(e,n);if(!s)return!1;var u=l(s);if(!u){var c=s.blockRange(),h=c&&(0,r.jP)(c);return null!=h&&(t&&t(e.tr.lift(c,h).scrollIntoView()),!0)}var f=u.nodeBefore;if(!f.type.spec.isolating&&v(e,u,t))return!0;
1if(0==s.parent.content.size&&(a(f,"end")||o.nh.isSelectable(f))){var d=(0,r.$L)(e.doc,s.before(),s.after(),i.Ji.empty);if(d&&d.slice.size<d.to-d.from){if(t){var p=e.tr.step(d);p.setSelection(a(f,"end")?o.LN.findFrom(p.doc.resolve(p.mapping.map(u.pos,-1)),-1):o.nh.create(p.doc,u.pos-f.nodeSize)),t(p.scrollIntoView())}return!0}}return!(!f.isAtom||u.depth!=s.depth-1||(t&&t(e.tr.delete(u.pos-f.nodeSize,u.pos).scrollIntoView()),0))}),(function(e,t,n){var r=e.selection,i=r.$head,s=i;if(!r.empty)return!1;if(i.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):i.parentOffset>0)return!1;s=l(i)}var a=s&&s.nodeBefore;return!(!a||!o.nh.isSelectable(a)||(t&&t(e.tr.setSelection(o.nh.create(e.doc,s.pos-a.nodeSize)).scrollIntoView()),0))})),S=w(s,(function(e,t,n){var s=function(e,t){var n=e.selection.$cursor;return!n||(t?!t.endOfTextblock("forward",e):n.parentOffset<n.parent.content.size)?null:n}(e,n);if(!s)return!1;var l=u(s);if(!l)return!1;var c=l.nodeAfter;if(v(e,l,t))return!0;if(0==s.parent.content.size&&(a(c,"start")||o.nh.isSelectable(c))){var h=(0,r.$L)(e.doc,s.before(),s.after(),i.Ji.empty);if(h&&h.slice.size<h.to-h.from){if(t){var f=e.tr.step(h);f.setSelection(a(c,"start")?o.LN.findFrom(f.doc.resolve(f.mapping.map(l.pos)),1):o.nh.create(f.doc,f.mapping.map(l.pos))),t(f.scrollIntoView())}return!0}}return!(!c.isAtom||l.depth!=s.depth-1||(t&&t(e.tr.delete(l.pos,l.pos+c.nodeSize).scrollIntoView()),0))}),(function(e,t,n){var r=e.selection,i=r.$head,s=i;if(!r.empty)return!1;if(i.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):i.parentOffset<i.parent.content.size)return!1;s=u(i)}var a=s&&s.nodeAfter;return!(!a||!o.nh.isSelectable(a)||(t&&t(e.tr.setSelection(o.nh.create(e.doc,s.pos)).scrollIntoView()),0))})),x={Enter:w((function(e,t){var n=e.selection,r=n.$head,i=n.$anchor;return!(!r.parent.type.spec.code||!r.sameParent(i)||(t&&t(e.tr.insertText("\n").scrollIntoView()),0))}),(function(e,t){var n=e.selection,r=n.$from,i=n.$to;if(n instanceof o.i5||r.parent.inlineContent||i.parent.inlineContent)return!1;var s=f(i.parent.contentMatchAt(i.indexAfter()));if(!s||!s.isTextblock)return!1;if(t){var a=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,l=e.tr.insert(a,s.createAndFill());l.setSelection(o.U3.create(l.doc,a+1)),t(l.scrollIntoView())}return!0}),(function(e,t){var n=e.selection.$cursor;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){var i=n.before();if((0,r.zy)(e.doc,i))return t&&t(e.tr.split(i).scrollIntoView()),!0}var o=n.blockRange(),s=o&&(0,r.jP)(o);return null!=s&&(t&&t(e.tr.lift(o,s).scrollIntoView()),!0)}),(function(e,t){var n=e.selection,i=n.$from,s=n.$to;if(e.selection instanceof o.nh&&e.selection.node.isBlock)return!(!i.parentOffset||!(0,r.zy)(e.doc,i.pos)||(t&&t(e.tr.split(i.pos).scrollIntoView()),0));if(!i.parent.isBlock)return!1;if(t){var a=s.parentOffset==s.parent.content.size,l=e.tr;(e.selection instanceof o.U3||e.selection instanceof o.i5)&&l.deleteSelection();var u=0==i.depth?null:f(i.node(-1).contentMatchAt(i.indexAfter(-1))),c=a&&u?[{type:u}]:void 0,h=(0,r.zy)(l.doc,l.mapping.map(i.pos),1,c);if(c||h||!(0,r.zy)(l.doc,l.mapping.map(i.pos),1,u?[{type:u}]:void 0)||(u&&(c=[{type:u}]),h=!0),h&&(l.split(l.mapping.map(i.pos),1,c),!a&&!i.parentOffset&&i.parent.type!=u)){var d=l.mapping.map(i.before()),p=l.doc.resolve(d);u&&i.node(-1).canReplaceWith(p.index(),p.index()+1,u)&&l.setNodeMarkup(l.mapping.map(i.before()),u)}t(l.scrollIntoView())}return!0})),"Mod-Enter":d,Backspace:b,"Mod-Backspace":b,"Shift-Backspace":b,Delete:S,"Mod-Delete":S,"Mod-a":function(e,t){return t&&t(e.tr.setSelection(new o.i5(e.doc))),!0}},M={"Ctrl-h":x.Backspace,"Alt-Backspace":x["Mod-Backspace"],"Ctrl-d":x.Delete,"Ctrl-Alt-Backspace":x["Mod-Delete"],"Alt-Delete":x["Mod-Delete"],"Alt-d":x["Mod-Delete"],"Ctrl-a":y,"Ctrl-e":g};for(var O in x)M[O]=x[O];var C=("undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):"undefined"!=typeof os&&os.platform&&"darwin"==os.platform())?M:x},3920:function(e,t,n){n.d(t,{b6:function(){return C},ZS:function(){return T},tN:function(){return D}});var r=200,i=function(){};i.prototype.append=function(e){return e.length?(e=i.from(e),!this.length&&e||e.length<r&&this.leafAppend(e)||this.length<r&&e.leafPrepend(this)||this.appendInner(e)):this}
1,i.prototype.prepend=function(e){return e.length?i.from(e).append(this):this},i.prototype.appendInner=function(e){return new s(this,e)},i.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t?i.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},i.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},i.prototype.forEach=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},i.prototype.map=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length);var r=[];return this.forEach((function(t,n){return r.push(e(t,n))}),t,n),r},i.from=function(e){return e instanceof i?e:e&&e.length?new o(e):i.empty};var o=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return 0==e&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var i=t;i<n;i++)if(!1===e(this.values[i],r+i))return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var i=t-1;i>=n;i--)if(!1===e(this.values[i],r+i))return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=r)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=r)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(i);i.empty=new o([]);var s=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,n,r){var i=this.left.length;return!(t<i&&!1===this.left.forEachInner(e,t,Math.min(n,i),r))&&!(n>i&&!1===this.right.forEachInner(e,Math.max(t-i,0),Math.min(this.length,n)-i,r+i))&&void 0},t.prototype.forEachInvertedInner=function(e,t,n,r){var i=this.left.length;return!(t>i&&!1===this.right.forEachInvertedInner(e,t-i,Math.max(n,i)-i,r+i))&&!(n<i&&!1===this.left.forEachInvertedInner(e,Math.min(t,i),n,r))&&void 0},t.prototype.sliceInner=function(e,t){if(0==e&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(i),a=i,l=n(9364),u=n(4543);function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function h(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,p(r.key),r)}}function d(e,t,n){return t&&f(e.prototype,t),n&&f(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function p(e){var t=function(e,t){if("object"!=c(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=c(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==c(t)?t:t+""}var v=function(){function e(t,n){h(this,e),this.items=t,this.eventCount=n}return d(e,[{key:"popEvent",value:function(t,n){var r=this;if(0==this.eventCount)return null;for(var i,o,s=this.items.length;;s--)if(this.items.get(s-1).selection){--s;break}n&&(i=this.remapping(s,this.items.length),o=i.maps.length);var a,l,u=t.tr,c=[],h=[];
1return this.items.forEach((function(t,n){if(!t.step)return i||(i=r.remapping(s,n+1),o=i.maps.length),o--,void h.push(t);if(i){h.push(new m(t.map));var f,d=t.step.map(i.slice(o));d&&u.maybeStep(d).doc&&(f=u.mapping.maps[u.mapping.maps.length-1],c.push(new m(f,void 0,void 0,c.length+h.length))),o--,f&&i.appendMap(f,o)}else u.maybeStep(t.step);return t.selection?(a=i?t.selection.map(i.slice(o)):t.selection,l=new e(r.items.slice(0,s).append(h.reverse().concat(c)),r.eventCount-1),!1):void 0}),this.items.length,0),{remaining:l,transform:u,selection:a}}},{key:"addTransform",value:function(t,n,r,i){for(var o=[],s=this.eventCount,a=this.items,l=!i&&a.length?a.get(a.length-1):null,u=0;u<t.steps.length;u++){var c,h=t.steps[u].invert(t.docs[u]),f=new m(t.mapping.maps[u],h,n);(c=l&&l.merge(f))&&(f=c,u?o.pop():a=a.slice(0,a.length-1)),o.push(f),n&&(s++,n=void 0),i||(l=f)}var d,p,v,y=s-r.depth;return y>g&&(p=y,(d=a).forEach((function(e,t){if(e.selection&&0==p--)return v=t,!1})),a=d.slice(v),s-=y),new e(a.append(o),s)}},{key:"remapping",value:function(e,t){var n=new l.X9;return this.items.forEach((function(t,r){var i=null!=t.mirrorOffset&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,i)}),e,t),n}},{key:"addMaps",value:function(t){return 0==this.eventCount?this:new e(this.items.append(t.map((function(e){return new m(e)}))),this.eventCount)}},{key:"rebased",value:function(t,n){if(!this.eventCount)return this;var r=[],i=Math.max(0,this.items.length-n),o=t.mapping,s=t.steps.length,a=this.eventCount;this.items.forEach((function(e){e.selection&&a--}),i);var l=n;this.items.forEach((function(e){var n=o.getMirror(--l);if(null!=n){s=Math.min(s,n);var i=o.maps[n];if(e.step){var u=t.steps[n].invert(t.docs[n]),c=e.selection&&e.selection.map(o.slice(l+1,n));c&&a++,r.push(new m(i,u,c))}else r.push(new m(i))}}),i);for(var u=[],c=n;c<s;c++)u.push(new m(o.maps[c]));var h=new e(this.items.slice(0,i).append(u).append(r),a);return h.emptyItemCount()>500&&(h=h.compress(this.items.length-r.length)),h}},{key:"emptyItemCount",value:function(){var e=0;return this.items.forEach((function(t){t.step||e++})),e}},{key:"compress",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.items.length,n=this.remapping(0,t),r=n.maps.length,i=[],o=0;return this.items.forEach((function(e,s){if(s>=t)i.push(e),e.selection&&o++;else if(e.step){var a=e.step.map(n.slice(r)),l=a&&a.getMap();if(r--,l&&n.appendMap(l,r),a){var u=e.selection&&e.selection.map(n.slice(r));u&&o++;var c,h=new m(l.invert(),a,u),f=i.length-1;(c=i.length&&i[f].merge(h))?i[f]=c:i.push(h)}}else e.map&&r--}),this.items.length,0),new e(a.from(i.reverse()),o)}}])}();v.empty=new v(a.empty,0);var m=function(){function e(t,n,r,i){h(this,e),this.map=t,this.step=n,this.selection=r,this.mirrorOffset=i}return d(e,[{key:"merge",value:function(t){if(this.step&&t.step&&!t.selection){var n=t.step.merge(this.step);if(n)return new e(n.getMap().invert(),n,this.selection)}}}])}(),y=d((function e(t,n,r,i,o){h(this,e),this.done=t,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=o})),g=20;function k(e){var t=[];return e.forEach((function(e,n,r,i){return t.push(r,i)})),t}function w(e,t){if(!e)return null;for(var n=[],r=0;r<e.length;r+=2){var i=t.map(e[r],1),o=t.map(e[r+1],-1);i<=o&&n.push(i,o)}return n}var b=!1,S=null;function x(e){var t=e.plugins;if(S!=t){b=!1,S=t;for(var n=0;n<t.length;n++)if(t[n].spec.historyPreserveItems){b=!0;break}}return b}var M=new u.hs("history"),O=new u.hs("closeHistory");function C(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new u.k_({key:M,state:{init:function(){return new y(v.empty,v.empty,null,0,-1)},apply:function(t,n,r){return function(e,t,n,r){var i,o=n.getMeta(M);if(o)return o.historyState;n.getMeta(O)&&(e=new y(e.done,e.undone,null,0,-1));var s=n.getMeta("appendedTransaction");if(0==n.steps.length)return e;if(s&&s.getMeta(M))return s.getMeta(M).redo?new y(e.done.addTransform(n,void 0,r,x(t)),e.undone,k(n.mapping.maps[n.steps.length-1]),e.prevTime,e.prevComposition):new y(e.done,e.undone.addTransform(n,void 0,r,x(t)),null,e.prevTime,e.prevComposition);if(!1===n.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))return(i=n.getMeta("rebased"))?new y(e.done.rebased(n,i),e.undone.rebased(n,i),w(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new y(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),w(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);var a=n.getMeta("composition"),l=0==e.prevTime||!s&&e.prevComposition!=a&&(e.prevTime<(n.time||0)-r.newGroupDelay||!function(e,t){if(!t)return!1;if(!e.docChanged)return!0;var n=!1;
1return e.mapping.maps[0].forEach((function(e,r){for(var i=0;i<t.length;i+=2)e<=t[i+1]&&r>=t[i]&&(n=!0)})),n}(n,e.prevRanges)),u=s?w(e.prevRanges,n.mapping):k(n.mapping.maps[n.steps.length-1]);return new y(e.done.addTransform(n,l?t.selection.getBookmark():void 0,r,x(t)),v.empty,u,n.time,null==a?e.prevComposition:a)}(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput:function(e,t){var n=t.inputType,r="historyUndo"==n?D:"historyRedo"==n?T:null;return!!r&&(t.preventDefault(),r(e.state,e.dispatch))}}}})}function N(e,t){return function(n,r){var i=M.getState(n);if(!i||0==(e?i.undone:i.done).eventCount)return!1;if(r){var o=function(e,t,n){var r=x(t),i=M.get(t).spec.config,o=(n?e.undone:e.done).popEvent(t,r);if(!o)return null;var s=o.selection.resolve(o.transform.doc),a=(n?e.done:e.undone).addTransform(o.transform,t.selection.getBookmark(),i,r),l=new y(n?a:o.remaining,n?o.remaining:a,null,0,-1);return o.transform.setSelection(s).setMeta(M,{redo:n,historyState:l})}(i,n,e);o&&r(t?o.scrollIntoView():o)}return!0}}var D=N(!1,!0),T=N(!0,!0);N(!1,!1),N(!0,!1)},7312:function(e,t,n){n.d(t,{w:function(){return d}});for(var r={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},i={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},o="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),s="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),a=0;a<10;a++)r[48+a]=r[96+a]=String(a);for(a=1;a<=24;a++)r[a+111]="F"+a;for(a=65;a<=90;a++)r[a]=String.fromCharCode(a+32),i[a]=String.fromCharCode(a);for(var l in r)i.hasOwnProperty(l)||(i[l]=r[l]);var u=n(4543),c="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function h(e){var t,n,r,i,o=e.split(/-(?!$)/),s=o[o.length-1];"Space"==s&&(s=" ");for(var a=0;a<o.length-1;a++){var l=o[a];if(/^(cmd|meta|m)$/i.test(l))i=!0;else if(/^a(lt)?$/i.test(l))t=!0;else if(/^(c|ctrl|control)$/i.test(l))n=!0;else if(/^s(hift)?$/i.test(l))r=!0;else{if(!/^mod$/i.test(l))throw new Error("Unrecognized modifier name: "+l);c?i=!0:n=!0}}return t&&(s="Alt-"+s),n&&(s="Ctrl-"+s),i&&(s="Meta-"+s),r&&(s="Shift-"+s),s}function f(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),n&&t.shiftKey&&(e="Shift-"+e),e}function d(e){return new u.k_({props:{handleKeyDown:p(e)}})}function p(e){var t=function(e){var t=Object.create(null);for(var n in e)t[h(n)]=e[n];return t}(e);return function(e,n){var a,l=function(e){var t=!(o&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||s&&e.shiftKey&&e.key&&1==e.key.length||"Unidentified"==e.key)&&e.key||(e.shiftKey?i:r)[e.keyCode]||e.key||"Unidentified";return"Esc"==t&&(t="Escape"),"Del"==t&&(t="Delete"),"Left"==t&&(t="ArrowLeft"),"Up"==t&&(t="ArrowUp"),"Right"==t&&(t="ArrowRight"),"Down"==t&&(t="ArrowDown"),t}(n),u=t[f(l,n)];if(u&&u(e.state,e.dispatch,e))return!0;if(1==l.length&&" "!=l){if(n.shiftKey){var c=t[f(l,n,!1)];if(c&&c(e.state,e.dispatch,e))return!0}if((n.shiftKey||n.altKey||n.metaKey||l.charCodeAt(0)>127)&&(a=r[n.keyCode])&&a!=l){var h=t[f(a,n)];if(h&&h(e.state,e.dispatch,e))return!0}}return!1}}},7138:function(e,t,n){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function i(){var e=arguments[0];"string"==typeof e&&(e=document.createElement(e));var t=1,n=arguments[1];if(n&&"object"==r(n)&&null==n.nodeType&&!Array.isArray(n)){for(var i in n)if(Object.prototype.hasOwnProperty.call(n,i)){var s=n[i];"string"==typeof s?e.setAttribute(i,s):null!=s&&(e[i]=s)}t++}for(;t<arguments.length;t++)o(e,arguments[t]);return e}function o(e,t){if("string"==typeof t)e.appendChild(document.createTextNode(t));else if(null==t);else if(null!=t.nodeType)e.appendChild(t);else{if(!Array.isArray(t))throw new RangeError("Unsupported child node: "+t);for(var n=0;n<t.length;n++)o(e,t[n])}}n.d(t,{Dr:function(){return k},Pt:function(){return S},Hy:function(){return O}});var s=n(4388),a=n(3920),l=n(4543);function u(e){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u(e)}function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function h(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,d(r.key),r)}}function f(e,t,n){return t&&h(e.prototype,t),n&&h(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function d(e){var t=function(e,t){if("object"!=u(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=u(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==u(t)?t:t+""}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var v="http://www.w3.org/2000/svg",m="ProseMirror-icon";function y(e,t){var n=(9==e.nodeType?e:e.ownerDocument)||document,r=n.createElement("div");if(r.className=m,t.path){var i=t.path,o=t.width,s=t.height,a="pm-icon-"+function(e){for(var t=0,n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0;return t}(i).toString(16);n.getElementById(a)||function(e,t,n){var r,i,o=9==e.nodeType?[e,e.body]:[e.ownerDocument||document,e],s=(i=2,function(e){if(Array.isArray(e))return e}(r=o)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,s,a=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(e){u=!0,i=e}
1finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return a}}(r,i)||function(e,t){if(e){if("string"==typeof e)return p(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?p(e,t):void 0}}(r,i)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),a=s[0],l=s[1],u=a.getElementById(m+"-collection");u||((u=a.createElementNS(v,"svg")).id=m+"-collection",u.style.display="none",l.insertBefore(u,l.firstChild));var c=a.createElementNS(v,"symbol");c.id=t,c.setAttribute("viewBox","0 0 "+n.width+" "+n.height),c.appendChild(a.createElementNS(v,"path")).setAttribute("d",n.path),u.appendChild(c)}(e,a,t);var l=r.appendChild(n.createElementNS(v,"svg"));l.style.width=o/s+"em",l.appendChild(n.createElementNS(v,"use")).setAttributeNS("http://www.w3.org/1999/xlink","href",/([^#]*)/.exec(n.location.toString())[1]+"#"+a)}else if(t.dom)r.appendChild(t.dom.cloneNode(!0));else{var u=t.text,c=t.css;r.appendChild(n.createElement("span")).textContent=u||"",c&&(r.firstChild.style.cssText=c)}return r}var g="ProseMirror-menu",k=function(){return f((function e(t){c(this,e),this.spec=t}),[{key:"render",value:function(e){var t=this.spec,n=t.render?t.render(e):t.icon?y(e.root,t.icon):t.label?i("div",null,w(e,t.label)):null;if(!n)throw new RangeError("MenuItem without icon or label property");if(t.title){var r="function"==typeof t.title?t.title(e.state):t.title;n.setAttribute("title",w(e,r))}return t.class&&n.classList.add(t.class),t.css&&(n.style.cssText+=t.css),n.addEventListener("mousedown",(function(r){r.preventDefault(),n.classList.contains(g+"-disabled")||t.run(e.state,e.dispatch,e,r)})),{dom:n,update:function(e){if(t.select){var r=t.select(e);if(n.style.display=r?"":"none",!r)return!1}var i=!0;if(t.enable&&(i=t.enable(e)||!1,x(n,g+"-disabled",!i)),t.active){var o=i&&t.active(e)||!1;x(n,g+"-active",o)}return!0}}}}])}();function w(e,t){return e._props.translate?e._props.translate(t):t}function b(e,t){return function(n){for(var r=!1,i=0;i<e.length;i++){var o=e[i](n);t[i].style.display=o?"":"none",o&&(r=!0)}return r}}var S={join:{width:800,height:900,path:"M0 75h800v125h-800z M0 825h800v-125h-800z M250 400h100v-100h100v100h100v100h-100v100h-100v-100h-100z"},lift:{width:1024,height:1024,path:"M219 310v329q0 7-5 12t-12 5q-8 0-13-5l-164-164q-5-5-5-13t5-13l164-164q5-5 13-5 7 0 12 5t5 12zM1024 749v109q0 7-5 12t-12 5h-987q-7 0-12-5t-5-12v-109q0-7 5-12t12-5h987q7 0 12 5t5 12zM1024 530v109q0 7-5 12t-12 5h-621q-7 0-12-5t-5-12v-109q0-7 5-12t12-5h621q7 0 12 5t5 12zM1024 310v109q0 7-5 12t-12 5h-621q-7 0-12-5t-5-12v-109q0-7 5-12t12-5h621q7 0 12 5t5 12zM1024 91v109q0 7-5 12t-12 5h-987q-7 0-12-5t-5-12v-109q0-7 5-12t12-5h987q7 0 12 5t5 12z"},selectParentNode:{text:"⬚",css:"font-weight: bold"},undo:{width:1024,height:1024,path:"M761 1024c113-206 132-520-313-509v253l-384-384 384-384v248c534-13 594 472 313 775z"},redo:{width:1024,height:1024,path:"M576 248v-248l384 384-384 384v-253c-446-10-427 303-313 509-280-303-221-789 313-775z"},strong:{width:805,height:1024,path:"M317 869q42 18 80 18 214 0 214-191 0-65-23-102-15-25-35-42t-38-26-46-14-48-6-54-1q-41 0-57 5 0 30-0 90t-0 90q0 4-0 38t-0 55 2 47 6 38zM309 442q24 4 62 4 46 0 81-7t62-25 42-51 14-81q0-40-16-70t-45-46-61-24-70-8q-28 0-74 7 0 28 2 86t2 86q0 15-0 45t-0 45q0 26 0 39zM0 950l1-53q8-2 48-9t60-15q4-6 7-15t4-19 3-18 1-21 0-19v-37q0-561-12-585-2-4-12-8t-25-6-28-4-27-2-17-1l-2-47q56-1 194-6t213-5q13 0 39 0t38 0q40 0 78 7t73 24 61 40 42 59 16 78q0 29-9 54t-22 41-36 32-41 25-48 22q88 20 146 76t58 141q0 57-20 102t-53 74-78 48-93 27-100 8q-25 0-75-1t-75-1q-60 0-175 6t-132 6z"},em:{width:585,height:1024,path:"M0 949l9-48q3-1 46-12t63-21q16-20 23-57 0-4 35-165t65-310 29-169v-14q-13-7-31-10t-39-4-33-3l10-58q18 1 68 3t85 4 68 1q27 0 56-1t69-4 56-3q-2 22-10 50-17 5-58 16t-62 19q-4 10-8 24t-5 22-4 26-3 24q-15 84-50 239t-44 203q-1 5-7 33t-11 51-9 47-3 32l0 10q9 2 105 17-1 25-9 56-6 0-18 0t-18 0q-16 0-49-5t-49-5q-78-1-117-1-29 0-81 5t-69 6z"}
1,code:{width:896,height:1024,path:"M608 192l-96 96 224 224-224 224 96 96 288-320-288-320zM288 192l-288 320 288 320 96-96-224-224 224-224-96-96z"},link:{width:951,height:1024,path:"M832 694q0-22-16-38l-118-118q-16-16-38-16-24 0-41 18 1 1 10 10t12 12 8 10 7 14 2 15q0 22-16 38t-38 16q-8 0-15-2t-14-7-10-8-12-12-10-10q-18 17-18 41 0 22 16 38l117 118q15 15 38 15 22 0 38-14l84-83q16-16 16-38zM430 292q0-22-16-38l-117-118q-16-16-38-16-22 0-38 15l-84 83q-16 16-16 38 0 22 16 38l118 118q15 15 38 15 24 0 41-17-1-1-10-10t-12-12-8-10-7-14-2-15q0-22 16-38t38-16q8 0 15 2t14 7 10 8 12 12 10 10q18-17 18-41zM941 694q0 68-48 116l-84 83q-47 47-116 47-69 0-116-48l-117-118q-47-47-47-116 0-70 50-119l-50-50q-49 50-118 50-68 0-116-48l-118-118q-48-48-48-116t48-116l84-83q47-47 116-47 69 0 116 48l117 118q47 47 47 116 0 70-50 119l50 50q49-50 118-50 68 0 116 48l118 118q48 48 48 116z"},bulletList:{width:768,height:896,path:"M0 512h128v-128h-128v128zM0 256h128v-128h-128v128zM0 768h128v-128h-128v128zM256 512h512v-128h-512v128zM256 256h512v-128h-512v128zM256 768h512v-128h-512v128z"},orderedList:{width:768,height:896,path:"M320 512h448v-128h-448v128zM320 768h448v-128h-448v128zM320 128v128h448v-128h-448zM79 384h78v-256h-36l-85 23v50l43-2v185zM189 590c0-36-12-78-96-78-33 0-64 6-83 16l1 66c21-10 42-15 67-15s32 11 32 28c0 26-30 58-110 112v50h192v-67l-91 2c49-30 87-66 87-113l1-1z"},blockquote:{width:640,height:896,path:"M0 448v256h256v-256h-128c0 0 0-128 128-128v-128c0 0-256 0-256 256zM640 320v-128c0 0-256 0-256 256v256h256v-256h-128c0 0 0-128 128-128z"}};function x(e,t,n){n?e.classList.add(t):e.classList.remove(t)}new k({title:"Join with above block",run:s.G2,select:function(e){return(0,s.G2)(e)},icon:S.join}),new k({title:"Lift out of enclosing block",run:s.yY,select:function(e){return(0,s.yY)(e)},icon:S.lift}),new k({title:"Select parent node",run:s.hy,select:function(e){return(0,s.hy)(e)},icon:S.selectParentNode}),new k({title:"Undo last change",run:a.tN,enable:function(e){return(0,a.tN)(e)},icon:S.undo}),new k({title:"Redo last undone change",run:a.ZS,enable:function(e){return(0,a.ZS)(e)},icon:S.redo});var M="ProseMirror-menubar";function O(e){return new l.k_({view:function(t){return new C(t,e)}})}var C=function(){return f((function e(t,n){var r=this;c(this,e),this.editorView=t,this.options=n,this.spacer=null,this.maxHeight=0,this.widthForMaxHeight=0,this.floating=!1,this.scrollHandler=null,this.wrapper=i("div",{class:M+"-wrapper"}),this.menu=this.wrapper.appendChild(i("div",{class:M})),this.menu.className=M,t.dom.parentNode&&t.dom.parentNode.replaceChild(this.wrapper,t.dom),this.wrapper.appendChild(t.dom);var o=function(e,t){for(var n=document.createDocumentFragment(),r=[],o=[],s=0;s<t.length;s++){for(var a=t[s],l=[],u=[],c=0;c<a.length;c++){var h=a[c].render(e),f=h.dom,d=h.update,p=i("span",{class:g+"item"},f);n.appendChild(p),u.push(p),l.push(d)}l.length&&(r.push(b(l,u)),s<t.length-1&&o.push(n.appendChild(i("span",{class:g+"separator"}))))}return{dom:n,update:function(e){for(var t=!1,n=!1,i=0;i<r.length;i++){var s=r[i](e);i&&(o[i-1].style.display=n&&s?"":"none"),n=s,s&&(t=!0)}return t}}}(this.editorView,this.options.content),s=o.dom,a=o.update;if(this.contentUpdate=a,this.menu.appendChild(s),this.update(),n.floating&&!function(){if("undefined"==typeof navigator)return!1;var e=navigator.userAgent;return!/Edge\/\d/.test(e)&&/AppleWebKit/.test(e)&&/Mobile\/\w+/.test(e)}()){this.updateFloat();var l=function(e){for(var t=[e.ownerDocument.defaultView||window],n=e.parentNode;n;n=n.parentNode)t.push(n);return t}(this.wrapper);this.scrollHandler=function(e){var t=r.editorView.root;(t.body||t).contains(r.wrapper)?r.updateFloat(e.target.getBoundingClientRect?e.target:void 0):l.forEach((function(e){return e.removeEventListener("scroll",r.scrollHandler)}))},l.forEach((function(e){return e.addEventListener("scroll",r.scrollHandler)}))}}),[{key:"update",value:function(){this.contentUpdate(this.editorView.state),this.floating?this.updateScrollCursor():(this.menu.offsetWidth!=this.widthForMaxHeight&&(this.widthForMaxHeight=this.menu.offsetWidth,this.maxHeight=0),this.menu.offsetHeight>this.maxHeight&&(this.maxHeight=this.menu.offsetHeight,this.menu.style.minHeight=this.maxHeight+"px"))}},{key:"updateScrollCursor",value:function(){var e=this.editorView.root.getSelection();if(e.focusNode){var t=e.getRangeAt(0).getClientRects(),n=t[function(e){return e.anchorNode==e.focusNode?e.anchorOffset>e.focusOffset:e.anchorNode.compareDocumentPosition(e.focusNode)==Node.DOCUMENT_POSITION_FOLLOWING}(e)?0:t.length-1];if(n){var r=this.menu.getBoundingClientRect();if(n.top<r.bottom&&n.bottom>r.top){var i=function(e){for(var t=e.parentNode;t;t=t.parentNode)if(t.scrollHeight>t.clientHeight)return t}(this.wrapper);i&&(i.scrollTop-=r.bottom-n.top)}}}}},{key:"updateFloat",value:function(e){var t=this.wrapper,n=t.getBoundingClientRect(),r=e?Math.max(0,e.getBoundingClientRect().top):0;if(this.floating)if(n.top>=r||n.bottom<this.menu.offsetHeight+10)this.floating=!1,this.menu.style.position=this.menu.style.left=this.menu.style.top=this.menu.style.width="",this.menu.style.display="",this.spacer.parentNode.removeChild(this.spacer),this.spacer=null;else{var o=(t.offsetWidth-t.clientWidth)/2;this.menu.style.left=n.left+o+"px",this.menu.style.display=n.top>(this.editorView.dom.ownerDocument.defaultView||window).innerHeight?"none":"",e&&(this.menu.style.top=r+"px")}else if(n.top<r&&n.bottom>=this.menu.offsetHeight+10){this.floating=!0;var s=this.menu.getBoundingClientRect();this.menu.style.left=s.left+"px",this.menu.style.width=s.width+"px",e&&(this.menu.style.top=r+"px"),this.menu.style.position="fixed",this.spacer=i("div",{class:M+"-spacer",style:"height: ".concat(s.height,"px")}),t.insertBefore(this.spacer,this.menu)}}},{key:"destroy",value:function(){this.wrapper.parentNode&&this.wrapper.parentNode.replaceChild(this.editorView.dom,this.wrapper)}}])}()},8488:function(e,t,n){function r(e){this.content=e}n.d(t,{S4:function(){return he},ZF:function(){return be},FK:function(){return w},CU:function(){return M},sX:function(){return le},bP:function(){return K},vI:function(){return O},Sj:function(){return ue},Ji:function(){return C}}),r.prototype={constructor:r,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return-1==t?void 0:this.content[t+1]},update:function(e,t,n){var i=n&&n!=e?this.remove(n):this,o=i.find(e),s=i.content.slice();return-1==o?s.push(n||e,t):(s[o+1]=t,n&&(s[o]=n)),new r(s)},remove:function(e){var t=this.find(e);if(-1==t)return this;var n=this.content.slice();return n.splice(t,2),new r(n)},addToStart:function(e,t){return new r([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new r(n)},addBefore:function(e,t,n){var i=this.remove(t),o=i.content.slice(),s=i.find(e);return o.splice(-1==s?o.length:s,0,t,n),new r(o)}
1,forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return(e=r.from(e)).size?new r(e.content.concat(this.subtract(e).content)):this},append:function(e){return(e=r.from(e)).size?new r(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=r.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach((function(t,n){e[t]=n})),e},get size(){return this.content.length>>1}},r.from=function(e){if(e instanceof r)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new r(t)};var i=r;function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function s(){return s="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=f(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},s.apply(null,arguments)}function a(e,t,n){return t=f(t),function(e,t){if(t&&("object"==d(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,c()?Reflect.construct(t,n||[],f(e).constructor):t.apply(e,n))}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&h(e,t)}function u(e){var t="function"==typeof Map?new Map:void 0;return u=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return function(e,t,n){if(c())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var i=new(e.bind.apply(e,r));return n&&h(i,n.prototype),i}(e,arguments,f(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),h(n,e)},u(e)}function c(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(c=function(){return!!e})()}function h(e,t){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},h(e,t)}function f(e){return f=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},f(e)}function d(e){return d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},d(e)}function p(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function v(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,y(r.key),r)}}function m(e,t,n){return t&&v(e.prototype,t),n&&v(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function y(e){var t=function(e,t){if("object"!=d(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=d(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==d(t)?t:t+""}function g(e,t,n){for(var r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;var i=e.child(r),o=t.child(r);if(i!=o){if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){for(var s=0;i.text[s]==o.text[s];s++)n++;return n}if(i.content.size||o.content.size){var a=g(i.content,o.content,n+1);if(null!=a)return a}n+=i.nodeSize}else n+=i.nodeSize}}function k(e,t,n,r){for(var i=e.childCount,o=t.childCount;;){if(0==i||0==o)return i==o?null:{a:n,b:r};var s=e.child(--i),a=t.child(--o),l=s.nodeSize;if(s!=a){if(!s.sameMarkup(a))return{a:n,b:r};if(s.isText&&s.text!=a.text){for(var u=0,c=Math.min(s.text.length,a.text.length);u<c&&s.text[s.text.length-u-1]==a.text[a.text.length-u-1];)u++,n--,r--;return{a:n,b:r}}if(s.content.size||a.content.size){var h=k(s.content,a.content,n-1,r-1);if(h)return h}n-=l,r-=l}else n-=l,r-=l}}var w=function(){function e(t,n){if(p(this,e),this.content=t,this.size=n||0,null==n)for(var r=0;r<t.length;r++)this.size+=t[r].nodeSize}return m(e,[{key:"nodesBetween",value:function(e,t,n){for(var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4?arguments[4]:void 0,o=0,s=0;s<t;o++){var a=this.content[o],l=s+a.nodeSize;if(l>e&&!1!==n(a,r+s,i||null,o)&&a.content.size){var u=s+1;a.nodesBetween(Math.max(0,e-u),Math.min(a.content.size,t-u),n,r+u)}s=l}}},{key:"descendants",value:function(e){this.nodesBetween(0,this.size,e)}},{key:"textBetween",value:function(e,t,n,r){var i="",o=!0;return this.nodesBetween(e,t,(function(s,a){var l=s.isText?s.text.slice(Math.max(e,a)-a,t-a):s.isLeaf?r?"function"==typeof r?r(s):r:s.type.spec.leafText?s.type.spec.leafText(s):"":"";s.isBlock&&(s.isLeaf&&l||s.isTextblock)&&n&&(o?o=!1:i+=n),i+=l}),0),i}},{key:"append",value:function(t){if(!t.size)return this;if(!this.size)return t;var n=this.lastChild,r=t.firstChild,i=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),o=1);o<t.content.length;o++)i.push(t.content[o]);return new e(i,this.size+t.size)}},{key:"cut",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.size;if(0==t&&n==this.size)return this;var r=[],i=0;if(n>t)for(var o=0,s=0;s<n;o++){var a=this.content[o],l=s+a.nodeSize;l>t&&((s<t||l>n)&&(a=a.isText?a.cut(Math.max(0,t-s),Math.min(a.text.length,n-s)):a.cut(Math.max(0,t-s-1),Math.min(a.content.size,n-s-1))),r.push(a),i+=a.nodeSize),s=l}return new e(r,i)}},{key:"cutByIndex",value:function(t,n){return t==n?e.empty:0==t&&n==this.content.length?this:new e(this.content.slice(t,n))}},{key:"replaceChild",value:function(t,n){var r=this.content[t];if(r==n)return this;var i=this.content.slice(),o=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new e(i,o)}},{key:"addToStart",value:function(t){return new e([t].concat(this.content),this.size+t.no
1deSize)}},{key:"addToEnd",value:function(t){return new e(this.content.concat(t),this.size+t.nodeSize)}},{key:"eq",value:function(e){if(this.content.length!=e.content.length)return!1;for(var t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}},{key:"firstChild",get:function(){return this.content.length?this.content[0]:null}},{key:"lastChild",get:function(){return this.content.length?this.content[this.content.length-1]:null}},{key:"childCount",get:function(){return this.content.length}},{key:"child",value:function(e){var t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}},{key:"maybeChild",value:function(e){return this.content[e]||null}},{key:"forEach",value:function(e){for(var t=0,n=0;t<this.content.length;t++){var r=this.content[t];e(r,n,t),n+=r.nodeSize}}},{key:"findDiffStart",value:function(e){return g(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0)}},{key:"findDiffEnd",value:function(e){return k(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.size,arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.size)}},{key:"findIndex",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;if(0==e)return S(0,e);if(e==this.size)return S(this.content.length,e);if(e>this.size||e<0)throw new RangeError("Position ".concat(e," outside of fragment (").concat(this,")"));for(var n=0,r=0;;n++){var i=r+this.child(n).nodeSize;if(i>=e)return i==e||t>0?S(n+1,i):S(n,r);r=i}}},{key:"toString",value:function(){return"<"+this.toStringInner()+">"}},{key:"toStringInner",value:function(){return this.content.join(", ")}},{key:"toJSON",value:function(){return this.content.length?this.content.map((function(e){return e.toJSON()})):null}}],[{key:"fromJSON",value:function(t,n){if(!n)return e.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new e(n.map(t.nodeFromJSON))}},{key:"fromArray",value:function(t){if(!t.length)return e.empty;for(var n,r=0,i=0;i<t.length;i++){var o=t[i];r+=o.nodeSize,i&&o.isText&&t[i-1].sameMarkup(o)?(n||(n=t.slice(0,i)),n[n.length-1]=o.withText(n[n.length-1].text+o.text)):n&&n.push(o)}return new e(n||t,r)}},{key:"from",value:function(t){if(!t)return e.empty;if(t instanceof e)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new e([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}])}();w.empty=new w([],0);var b={index:0,offset:0};function S(e,t){return b.index=e,b.offset=t,b}function x(e,t){if(e===t)return!0;if(!e||"object"!=d(e)||!t||"object"!=d(t))return!1;var n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(var r=0;r<e.length;r++)if(!x(e[r],t[r]))return!1}else{for(var i in e)if(!(i in t)||!x(e[i],t[i]))return!1;for(var o in t)if(!(o in e))return!1}return!0}var M=function(){function e(t,n){p(this,e),this.type=t,this.attrs=n}return m(e,[{key:"addToSet",value:function(e){for(var t,n=!1,r=0;r<e.length;r++){var i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||(t=e.slice(0,r));else{if(i.type.excludes(this.type))return e;!n&&i.type.rank>this.type.rank&&(t||(t=e.slice(0,r)),t.push(this),n=!0),t&&t.push(i)}}return t||(t=e.slice()),n||t.push(this),t}},{key:"removeFromSet",value:function(e){for(var t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}},{key:"isInSet",value:function(e){for(var t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}},{key:"eq",value:function(e){return this==e||this.type==e.type&&x(this.attrs,e.attrs)}},{key:"toJSON",value:function(){var e={type:this.type.name};for(var t in this.attrs){e.attrs=this.attrs;break}return e}}],[{key:"fromJSON",value:function(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");var n=e.marks[t.type];if(!n)throw new RangeError("There is no mark type ".concat(t.type," in this schema"));return n.create(t.attrs)}},{key:"sameSet",value:function(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(var n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}},{key:"setFrom",value:function(t){if(!t||Array.isArray(t)&&0==t.length)return e.none;if(t instanceof e)return[t];var n=t.slice();return n.sort((function(e,t){return e.type.rank-t.type.rank})),n}}])}();M.none=[];var O=function(e){function t(){return p(this,t),a(this,t,arguments)}return l(t,e),m(t)}
1(u(Error)),C=function(){function e(t,n,r){p(this,e),this.content=t,this.openStart=n,this.openEnd=r}return m(e,[{key:"size",get:function(){return this.content.size-this.openStart-this.openEnd}},{key:"insertAt",value:function(t,n){var r=D(this.content,t+this.openStart,n);return r&&new e(r,this.openStart,this.openEnd)}},{key:"removeBetween",value:function(t,n){return new e(N(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}},{key:"eq",value:function(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}},{key:"toString",value:function(){return this.content+"("+this.openStart+","+this.openEnd+")"}},{key:"toJSON",value:function(){if(!this.content.size)return null;var e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}}],[{key:"fromJSON",value:function(t,n){if(!n)return e.empty;var r=n.openStart||0,i=n.openEnd||0;if("number"!=typeof r||"number"!=typeof i)throw new RangeError("Invalid input for Slice.fromJSON");return new e(w.fromJSON(t,n.content),r,i)}},{key:"maxOpen",value:function(t){for(var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=0,i=0,o=t.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)r++;for(var s=t.lastChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.lastChild)i++;return new e(t,r,i)}}])}();function N(e,t,n){var r=e.findIndex(t),i=r.index,o=r.offset,s=e.maybeChild(i),a=e.findIndex(n),l=a.index,u=a.offset;if(o==t||s.isText){if(u!=n&&!e.child(l).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(i!=l)throw new RangeError("Removing non-flat range");return e.replaceChild(i,s.copy(N(s.content,t-o-1,n-o-1)))}function D(e,t,n,r){var i=e.findIndex(t),o=i.index,s=i.offset,a=e.maybeChild(o);if(s==t||a.isText)return r&&!r.canReplace(o,o,n)?null:e.cut(0,t).append(n).append(e.cut(t));var l=D(a.content,t-s-1,n);return l&&e.replaceChild(o,a.copy(l))}function T(e,t,n){if(n.openStart>e.depth)throw new O("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new O("Inconsistent open depths");return E(e,t,n,0)}function E(e,t,n,r){var i=e.index(r),o=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){var s=E(e,t,n,r+1);return o.copy(o.content.replaceChild(i,s))}if(n.content.size){if(n.openStart||n.openEnd||e.depth!=r||t.depth!=r){var a=function(e,t){for(var n=t.depth-e.openStart,r=t.node(n).copy(e.content),i=n-1;i>=0;i--)r=t.node(i).copy(w.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}(n,e);return z(o,F(e,a.start,a.end,t,r))}var l=e.parent,u=l.content;return z(l,u.cut(0,e.parentOffset).append(n.content).append(u.cut(t.parentOffset)))}return z(o,B(e,t,r))}function A(e,t){if(!t.type.compatibleContent(e.type))throw new O("Cannot join "+t.type.name+" onto "+e.type.name)}function R(e,t,n){var r=e.node(n);return A(r,t.node(n)),r}function I(e,t){var n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function P(e,t,n,r){var i=(t||e).node(n),o=0,s=t?t.index(n):i.childCount;e&&(o=e.index(n),e.depth>n?o++:e.textOffset&&(I(e.nodeAfter,r),o++));for(var a=o;a<s;a++)I(i.child(a),r);t&&t.depth==n&&t.textOffset&&I(t.nodeBefore,r)}function z(e,t){return e.type.checkContent(t),e.copy(t)}function F(e,t,n,r,i){var o=e.depth>i&&R(e,t,i+1),s=r.depth>i&&R(n,r,i+1),a=[];return P(null,e,i,a),o&&s&&t.index(i)==n.index(i)?(A(o,s),I(z(o,F(e,t,n,r,i+1)),a)):(o&&I(z(o,B(e,t,i+1)),a),P(t,n,i,a),s&&I(z(s,B(n,r,i+1)),a)),P(r,null,i,a),new w(a)}function B(e,t,n){var r=[];return P(null,e,n,r),e.depth>n&&I(z(R(e,t,n+1),B(e,t,n+1)),r),P(t,null,n,r),new w(r)}C.empty=new C(w.empty,0,0);var V=function(){function e(t,n,r){p(this,e),this.pos=t,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}return m(e,[{key:"resolveDepth",value:function(e){return null==e?this.depth:e<0?this.depth+e:e}},{key:"parent",get:function(){return this.node(this.depth)}},{key:"doc",get:function(){return this.node(0)}},{key:"node",value:function(e){return this.path[3*this.resolveDepth(e)]}},{key:"index",value:function(e){return this.path[3*this.resolveDepth(e)+1]}},{key:"indexAfter",value:function(e){return e=this.resolveDepth(e),this.index(e)+(e!=this.depth||this.textOffset?1:0)}},{key:"start",value:function(e){return 0==(e=this.resolveDepth(e))?0:this.path[3*e-1]+1}},{key:"end",value:function(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}},{key:"before",value:function(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]}},{key:"after",value:function(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]+this.path[3*e].nodeSize}},{key:"textOffset",get:function(){return this.pos-this.path[this.path.length-1]}},{key:"nodeAfter",get:function(){var e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;var n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}},{key:"nodeBefore",get:function(){var e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):0==e?null:this.parent.child(e-1)}},{key:"posAtIndex",value:function(e,t){t=this.resolveDepth(t);for(var n=this.path[3*t],r=0==t?0:this.path[3*t-1]+1,i=0;i<e;i++)r+=n.child(i).nodeSize;return r}},{key:"marks",value:function(){var e=this.parent,t=this.index();if(0==e.content.size)return M.none;if(this.textOffset)return e.child(t).marks;var n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){var i=n;n=r,r=i}
1for(var o=n.marks,s=0;s<o.length;s++)!1!==o[s].type.spec.inclusive||r&&o[s].isInSet(r.marks)||(o=o[s--].removeFromSet(o));return o}},{key:"marksAcross",value:function(e){var t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;for(var n=t.marks,r=e.parent.maybeChild(e.index()),i=0;i<n.length;i++)!1!==n[i].type.spec.inclusive||r&&n[i].isInSet(r.marks)||(n=n[i--].removeFromSet(n));return n}},{key:"sharedDepth",value:function(e){for(var t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}},{key:"blockRange",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this,t=arguments.length>1?arguments[1]:void 0;if(e.pos<this.pos)return e.blockRange(this);for(var n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new j(this,e,n);return null}},{key:"sameParent",value:function(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}},{key:"max",value:function(e){return e.pos>this.pos?e:this}},{key:"min",value:function(e){return e.pos<this.pos?e:this}},{key:"toString",value:function(){for(var e="",t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}}],[{key:"resolve",value:function(t,n){if(!(n>=0&&n<=t.content.size))throw new RangeError("Position "+n+" out of range");for(var r=[],i=0,o=n,s=t;;){var a=s.content.findIndex(o),l=a.index,u=a.offset,c=o-u;if(r.push(s,l,i+u),!c)break;if((s=s.child(l)).isText)break;o=c-1,i+=u+1}return new e(n,r,o)}},{key:"resolveCached",value:function(t,n){for(var r=0;r<q.length;r++){var i=q[r];if(i.pos==n&&i.doc==t)return i}var o=q[$]=e.resolve(t,n);return $=($+1)%J,o}}])}(),q=[],$=0,J=12,j=function(){return m((function e(t,n,r){p(this,e),this.$from=t,this.$to=n,this.depth=r}),[{key:"start",get:function(){return this.$from.before(this.depth+1)}},{key:"end",get:function(){return this.$to.after(this.depth+1)}},{key:"parent",get:function(){return this.$from.node(this.depth)}},{key:"startIndex",get:function(){return this.$from.index(this.depth)}},{key:"endIndex",get:function(){return this.$to.indexAfter(this.depth)}}])}(),L=Object.create(null),K=function(){function e(t,n,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:M.none;p(this,e),this.type=t,this.attrs=n,this.marks=i,this.content=r||w.empty}return m(e,[{key:"nodeSize",get:function(){return this.isLeaf?1:2+this.content.size}},{key:"childCount",get:function(){return this.content.childCount}},{key:"child",value:function(e){return this.content.child(e)}},{key:"maybeChild",value:function(e){return this.content.maybeChild(e)}},{key:"forEach",value:function(e){this.content.forEach(e)}},{key:"nodesBetween",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;this.content.nodesBetween(e,t,n,r,this)}},{key:"descendants",value:function(e){this.nodesBetween(0,this.content.size,e)}},{key:"textContent",get:function(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}},{key:"textBetween",value:function(e,t,n,r){return this.content.textBetween(e,t,n,r)}},{key:"firstChild",get:function(){return this.content.firstChild}},{key:"lastChild",get:function(){return this.content.lastChild}},{key:"eq",value:function(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}},{key:"sameMarkup",value:function(e){return this.hasMarkup(e.type,e.attrs,e.marks)}},{key:"hasMarkup",value:function(e,t,n){return this.type==e&&x(this.attrs,t||e.defaultAttrs||L)&&M.sameSet(this.marks,n||M.none)}},{key:"copy",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return t==this.content?this:new e(this.type,this.attrs,t,this.marks)}},{key:"mark",value:function(t){return t==this.marks?this:new e(this.type,this.attrs,this.content,t)}},{key:"cut",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.content.size;return 0==e&&t==this.content.size?this:this.copy(this.content.cut(e,t))}},{key:"slice",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.content.size,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(e==t)return C.empty;var r=this.resolve(e),i=this.resolve(t),o=n?0:r.sharedDepth(t),s=r.start(o),a=r.
1node(o).content.cut(r.pos-s,i.pos-s);return new C(a,r.depth-o,i.depth-o)}},{key:"replace",value:function(e,t,n){return T(this.resolve(e),this.resolve(t),n)}},{key:"nodeAt",value:function(e){for(var t=this;;){var n=t.content.findIndex(e),r=n.index,i=n.offset;if(!(t=t.maybeChild(r)))return null;if(i==e||t.isText)return t;e-=i+1}}},{key:"childAfter",value:function(e){var t=this.content.findIndex(e),n=t.index,r=t.offset;return{node:this.content.maybeChild(n),index:n,offset:r}}},{key:"childBefore",value:function(e){if(0==e)return{node:null,index:0,offset:0};var t=this.content.findIndex(e),n=t.index,r=t.offset;if(r<e)return{node:this.content.child(n),index:n,offset:r};var i=this.content.child(n-1);return{node:i,index:n-1,offset:r-i.nodeSize}}},{key:"resolve",value:function(e){return V.resolveCached(this,e)}},{key:"resolveNoCache",value:function(e){return V.resolve(this,e)}},{key:"rangeHasMark",value:function(e,t,n){var r=!1;return t>e&&this.nodesBetween(e,t,(function(e){return n.isInSet(e.marks)&&(r=!0),!r})),r}},{key:"isBlock",get:function(){return this.type.isBlock}},{key:"isTextblock",get:function(){return this.type.isTextblock}},{key:"inlineContent",get:function(){return this.type.inlineContent}},{key:"isInline",get:function(){return this.type.isInline}},{key:"isText",get:function(){return this.type.isText}},{key:"isLeaf",get:function(){return this.type.isLeaf}},{key:"isAtom",get:function(){return this.type.isAtom}},{key:"toString",value:function(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);var e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),W(this.marks,e)}},{key:"contentMatchAt",value:function(e){var t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}},{key:"canReplace",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:w.empty,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:n.childCount,o=this.contentMatchAt(e).matchFragment(n,r,i),s=o&&o.matchFragment(this.content,t);if(!s||!s.validEnd)return!1;for(var a=r;a<i;a++)if(!this.type.allowsMarks(n.child(a).marks))return!1;return!0}},{key:"canReplaceWith",value:function(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;var i=this.contentMatchAt(e).matchType(n),o=i&&i.matchFragment(this.content,t);return!!o&&o.validEnd}},{key:"canAppend",value:function(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}},{key:"check",value:function(){this.type.checkContent(this.content);for(var e=M.none,t=0;t<this.marks.length;t++)e=this.marks[t].addToSet(e);if(!M.sameSet(e,this.marks))throw new RangeError("Invalid collection of marks for node ".concat(this.type.name,": ").concat(this.marks.map((function(e){return e.type.name}))));this.content.forEach((function(e){return e.check()}))}},{key:"toJSON",value:function(){var e={type:this.type.name};for(var t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map((function(e){return e.toJSON()}))),e}}],[{key:"fromJSON",value:function(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");var n=null;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=t.marks.map(e.markFromJSON)}if("text"==t.type){if("string"!=typeof t.text)throw new RangeError("Invalid text node in JSON");return e.text(t.text,n)}var r=w.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,r,n)}}])}();K.prototype.text=void 0;var _=function(e){function t(e,n,r,i){var o;if(p(this,t),o=a(this,t,[e,n,null,i]),!r)throw new RangeError("Empty text nodes are not allowed");return o.text=r,o}return l(t,e),m(t,[{key:"toString",value:function(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):W(this.marks,JSON.stringify(this.text))}},{key:"textContent",get:function(){return this.text}},{key:"textBetween",value:function(e,t){return this.text.slice(e,t)}},{key:"nodeSize",get:function(){return this.text.length}},{key:"mark",value:function(e){return e==this.marks?this:new t(this.type,this.attrs,this.text,e)}},{key:"withText",value:function(e){return e==this.text?this:new t(this.type,this.attrs,e,this.marks)}},{key:"cut",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.text.length;return 0==e&&t==this.text.length?this:this.withText(this.text.slice(e,t))}},{key:"eq",value:function(e){return this.sameMarkup(e)&&this.text==e.text}},{key:"toJSON",value:function(){var e=s(f(t.prototype),"toJSON",this).call(this);return e.text=this.text,e}}])}(K);function W(e,t){for(var n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}var U=function(){function e(t){p(this,e),this.validEnd=t,this.next=[],this.wrapCache=[]}return m(e,[{key:"matchType",value:function(e){for(var t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}},{key:"matchFragment",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.childCount,r=this,i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}},{key:"inlineContent",get:function(){return 0!=this.next.length&&this.next[0].type.isInline}},{key:"defaultType",get:function(){for(var e=0;e<this.next.length;e++){var t=this.next[e].type;if(!t.isText&&!t.hasRequiredAttrs())return t}return null}},{key:"compatible",value:function(e){for(var t=0;t<this.next.length;t++)for(var n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}},{key:"fillBefore",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=[this];return function i(o,s){var a=o.matchFragment(e,n);if(a&&(!t||a.validEnd))return w.from(s.map((function(e){return e.createAndFill()})));for(var l=0;l<o.next.length;l++){var u=o.next[l],c=u.type,h=u.next;if(!c.isText&&!c.hasRequiredAttrs()&&-1==r.indexOf(h)){r.push(h);var f=i(h,s.concat(c));if(f)return f}}return null}(this,[])}},{key:"findWrapping",value:function(e){for(var t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];var n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}},{key:"computeWrapping",value:function(e){for(var t=Object.create(null),n=[{match:this,type:null,via:null}];n.length;){var r=n.shift(),i=r.match;if(i.matchType(e)){for(var o=[],s=r;s.type;s=s.via)o.push(s.type);return o.reverse()}for(var a=0;a<i.next.length;a++){var l=i.next[a],u=l.type,c=l.next;u.isLeaf||u.hasRequiredAttrs()||u.name in t||r.type&&!c.validEnd||(n.push({match:u.contentMatch,type:u,via:r}),t[u.name]=!0)}}return null}},{key:"edgeCount",get:function(){return this.next.length}},{key:"edge",value:function(e){if(e>=this.next.length)throw new RangeError("There's no ".concat(e,"th edge in this content match"));return this.next[e]}},{key:"toString",value:function(){var e=[];return function t(n){e.push(n);for(var r=0;r<n.next.length;r++)-1==e.indexOf(n.next[r].next)&&t(n.next[r].next)}(this),e.map((function(t,n){for(var r=n+(t.validEnd?"*":" ")+" ",i=0;i<t.next.length;i++)r+=(i?", ":"")+t.next[i].type.name+"->"+e.indexOf(t.next[i].next);return r})).join("\n")}}],[{key:"parse",value:function(t,n){var r=new H(t,n);if(null==r.next)return e.empty;var i=G(r);r.next&&r.err("Unexpected trailing text");var o=ne(function(e){var t=[[]];return i(function e(t,o){if("choice"==t.type)return t.exprs.reduce((function(t,n){return t.concat(e(n,o))}),[]);if("seq"!=t.type){if("star"==t.type){var s=n();return r(o,s),i(e(t.expr,s),s),[r(s)]}if("plus"==t.type){var a=n();return i(e(t.expr,o),a),i(e(t.expr,a),a),[r(a)]}if("opt"==t.type)return[r(o)].concat(e(t.expr,o));if("range"==t.type){for(var l=o,u=0;u<t.min;u++){var c=n();i(e(t.expr,l),c),l=c}if(-1==t.max)i(e(t.expr,l),l);else for(var h=t.min;h<t.max;h++){var f=n();r(l,f),i(e(t.expr,l),f),l=f}return[r(l)]}if("name"==t.type)return[r(o,void 0,t.value)];throw new Error("Unknown expr type")}for(var d=0;;d++){var p=e(t.exprs[d],o);if(d==t.exprs.length-1)return p;i(p,o=n())}}(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){var i={term:r,to:n};return t[e].push(i),i}function i(e,t){e.forEach((function(e){return e.to=t}))}}(i));return function(e,t){for(var n=0,r=[e];n<r.length;n++){for(var i=r[n],o=!i.validEnd,s=[],a=0;a<i.next.length;a++){var l=i.next[a],u=l.type,c=l.next;s.push(u.name),!o||u.isText||u.hasRequiredAttrs()||(o=!1),-1==r.indexOf(c)&&r.push(c)}o&&t.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(o,r),o}}])}();U.empty=new U(!0);var H=function(){return m((function e(t,n){p(this,e),this.string=t,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?
1=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()}),[{key:"next",get:function(){return this.tokens[this.pos]}},{key:"eat",value:function(e){return this.next==e&&(this.pos++||!0)}},{key:"err",value:function(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}])}();function G(e){var t=[];do{t.push(X(e))}while(e.eat("|"));return 1==t.length?t[0]:{type:"choice",exprs:t}}function X(e){var t=[];do{t.push(Z(e))}while(e.next&&")"!=e.next&&"|"!=e.next);return 1==t.length?t[0]:{type:"seq",exprs:t}}function Z(e){for(var t=function(e){if(e.eat("(")){var t=G(e);return e.eat(")")||e.err("Missing closing paren"),t}if(!/\W/.test(e.next)){var n=function(e,t){var n=e.nodeTypes,r=n[t];if(r)return[r];var i=[];for(var o in n){var s=n[o];s.groups.indexOf(t)>-1&&i.push(s)}return 0==i.length&&e.err("No node type or group '"+t+"' found"),i}(e,e.next).map((function(t){return null==e.inline?e.inline=t.isInline:e.inline!=t.isInline&&e.err("Mixing inline and block content"),{type:"name",value:t}}));return e.pos++,1==n.length?n[0]:{type:"choice",exprs:n}}e.err("Unexpected token '"+e.next+"'")}(e);;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else{if(!e.eat("{"))break;t=Q(e,t)}return t}function Y(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");var t=Number(e.next);return e.pos++,t}function Q(e,t){var n=Y(e),r=n;return e.eat(",")&&(r="}"!=e.next?Y(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function ee(e,t){return t-e}function te(e,t){var n=[];return function t(r){var i=e[r];if(1==i.length&&!i[0].term)return t(i[0].to);n.push(r);for(var o=0;o<i.length;o++){var s=i[o],a=s.term,l=s.to;a||-1!=n.indexOf(l)||t(l)}}(t),n.sort(ee)}function ne(e){var t=Object.create(null);return function n(r){var i=[];r.forEach((function(t){e[t].forEach((function(t){var n=t.term,r=t.to;if(n){for(var o,s=0;s<i.length;s++)i[s][0]==n&&(o=i[s][1]);te(e,r).forEach((function(e){o||i.push([n,o=[]]),-1==o.indexOf(e)&&o.push(e)}))}}))}));for(var o=t[r.join(",")]=new U(r.indexOf(e.length-1)>-1),s=0;s<i.length;s++){var a=i[s][1].sort(ee);o.next.push({type:i[s][0],next:t[a.join(",")]||n(a)})}return o}(te(e,0))}function re(e){var t=Object.create(null);for(var n in e){var r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function ie(e,t){var n=Object.create(null);for(var r in e){var i=t&&t[r];if(void 0===i){var o=e[r];if(!o.hasDefault)throw new RangeError("No value supplied for attribute "+r);i=o.default}n[r]=i}return n}function oe(e){var t=Object.create(null);if(e)for(var n in e)t[n]=new ae(e[n]);return t}var se=function(){function e(t,n,r){p(this,e),this.name=t,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=oe(r.attrs),this.defaultAttrs=re(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||"text"==t),this.isText="text"==t}return m(e,[{key:"isInline",get:function(){return!this.isBlock}},{key:"isTextblock",get:function(){return this.isBlock&&this.inlineContent}},{key:"isLeaf",get:function(){return this.contentMatch==U.empty}},{key:"isAtom",get:function(){return this.isLeaf||!!this.spec.atom}},{key:"whitespace",get:function(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}},{key:"hasRequiredAttrs",value:function(){for(var e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}},{key:"compatibleContent",value:function(e){return this==e||this.contentMatch.compatible(e.contentMatch)}},{key:"computeAttrs",value:function(e){return!e&&this.defaultAttrs?this.defaultAttrs:ie(this.attrs,e)}},{key:"create",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new K(this,this.computeAttrs(e),w.from(t),M.setFrom(n))}},{key:"createChecked",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;
1return t=w.from(t),this.checkContent(t),new K(this,this.computeAttrs(e),t,M.setFrom(n))}},{key:"createAndFill",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;if(e=this.computeAttrs(e),(t=w.from(t)).size){var r=this.contentMatch.fillBefore(t);if(!r)return null;t=r.append(t)}var i=this.contentMatch.matchFragment(t),o=i&&i.fillBefore(w.empty,!0);return o?new K(this,e,t.append(o),M.setFrom(n)):null}},{key:"validContent",value:function(e){var t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(var n=0;n<e.childCount;n++)if(!this.allowsMarks(e.child(n).marks))return!1;return!0}},{key:"checkContent",value:function(e){if(!this.validContent(e))throw new RangeError("Invalid content for node ".concat(this.name,": ").concat(e.toString().slice(0,50)))}},{key:"allowsMarkType",value:function(e){return null==this.markSet||this.markSet.indexOf(e)>-1}},{key:"allowsMarks",value:function(e){if(null==this.markSet)return!0;for(var t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}},{key:"allowedMarks",value:function(e){if(null==this.markSet)return e;for(var t,n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||(t=e.slice(0,n));return t?t.length?t:M.none:e}}],[{key:"compile",value:function(t,n){var r=Object.create(null);t.forEach((function(t,i){return r[t]=new e(t,n,i)}));var i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(var o in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}}])}(),ae=function(){return m((function e(t){p(this,e),this.hasDefault=Object.prototype.hasOwnProperty.call(t,"default"),this.default=t.default}),[{key:"isRequired",get:function(){return!this.hasDefault}}])}(),le=function(){function e(t,n,r,i){p(this,e),this.name=t,this.rank=n,this.schema=r,this.spec=i,this.attrs=oe(i.attrs),this.excluded=null;var o=re(this.attrs);this.instance=o?new M(this,o):null}return m(e,[{key:"create",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return!e&&this.instance?this.instance:new M(this,ie(this.attrs,e))}},{key:"removeFromSet",value:function(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}},{key:"isInSet",value:function(e){for(var t=0;t<e.length;t++)if(e[t].type==this)return e[t]}},{key:"excludes",value:function(e){return this.excluded.indexOf(e)>-1}}],[{key:"compile",value:function(t,n){var r=Object.create(null),i=0;return t.forEach((function(t,o){return r[t]=new e(t,i++,n,o)})),r}}])}(),ue=function(){return m((function e(t){p(this,e),this.linebreakReplacement=null,this.cached=Object.create(null);var n=this.spec={};for(var r in t)n[r]=t[r];n.nodes=i.from(t.nodes),n.marks=i.from(t.marks||{}),this.nodes=se.compile(this.spec.nodes,this),this.marks=le.compile(this.spec.marks,this);var o=Object.create(null);for(var s in this.nodes){if(s in this.marks)throw new RangeError(s+" can not be both a node and a mark");var a=this.nodes[s],l=a.spec.content||"",u=a.spec.marks;if(a.contentMatch=o[l]||(o[l]=U.parse(l,this.nodes)),a.inlineContent=a.contentMatch.inlineContent,a.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!a.isInline||!a.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=a}a.markSet="_"==u?null:u?ce(this,u.split(" ")):""!=u&&a.inlineContent?null:[]}for(var c in this.marks){var h=this.marks[c],f=h.spec.excludes;h.excluded=null==f?[h]:""==f?[]:ce(this,f.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}),[{key:"node",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;if("string"==typeof e)e=this.nodeType(e);else{if(!(e instanceof se))throw new RangeError("Invalid node type: "+e);if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}return e.createChecked(t,n,r)}},{key:"text",value:function(e,t){var n=this.nodes.text;return new _(n,n.defaultAttrs,e,M.setFrom(t))}},{key:"mark",value:function(e,t){return"string"==typeof e&&(e=this.marks[e]),e.create(t)}},{key:"nodeFromJSON",value:function(e){return K.fromJSON(this,e)}},{key:"markFromJSON",value:function(e){return M.fromJSON(this,e)}},{key:"nodeType",value:function(e){var t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}])}();function ce(e,t){for(var n=[],r=0;r<t.length;r++){var i=t[r],o=e.marks[i],s=o;if(o)n.push(o);else for(var a in e.marks){var l=e.marks[a];("_"==i||l.spec.group&&l.spec.group.split(" ").indexOf(i)>-1)&&n.push(s=l)}if(!s)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}var he=function(){function e(t,n){var r=this;p(this,e),this.schema=t,this.rules=n,this.tags=[],this.styles=[],n.forEac
1h((function(e){!function(e){return null!=e.tag}(e)?function(e){return null!=e.style}(e)&&r.styles.push(e):r.tags.push(e)})),this.normalizeLists=!this.tags.some((function(e){if(!/^(ul|ol)\b/.test(e.tag)||!e.node)return!1;var n=t.nodes[e.node];return n.contentMatch.matchType(n)}))}return m(e,[{key:"parse",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=new ye(this,t,!1);return n.addAll(e,t.from,t.to),n.finish()}},{key:"parseSlice",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=new ye(this,t,!0);return n.addAll(e,t.from,t.to),C.maxOpen(n.finish())}},{key:"matchTag",value:function(e,t,n){for(var r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){var i=this.tags[r];if(ge(e,i.tag)&&(void 0===i.namespace||e.namespaceURI==i.namespace)&&(!i.context||t.matchesContext(i.context))){if(i.getAttrs){var o=i.getAttrs(e);if(!1===o)continue;i.attrs=o||void 0}return i}}}},{key:"matchStyle",value:function(e,t,n,r){for(var i=r?this.styles.indexOf(r)+1:0;i<this.styles.length;i++){var o=this.styles[i],s=o.style;if(!(0!=s.indexOf(e)||o.context&&!n.matchesContext(o.context)||s.length>e.length&&(61!=s.charCodeAt(e.length)||s.slice(e.length+1)!=t))){if(o.getAttrs){var a=o.getAttrs(t);if(!1===a)continue;o.attrs=a||void 0}return o}}}}],[{key:"schemaRules",value:function(e){var t=[];function n(e){for(var n=null==e.priority?50:e.priority,r=0;r<t.length;r++){var i=t[r];if((null==i.priority?50:i.priority)<n)break}t.splice(r,0,e)}var r=function(t){var r=e.marks[t].spec.parseDOM;r&&r.forEach((function(e){n(e=ke(e)),e.mark||e.ignore||e.clearMark||(e.mark=t)}))};for(var i in e.marks)r(i);var o=function(t){var r=e.nodes[t].spec.parseDOM;r&&r.forEach((function(e){n(e=ke(e)),e.node||e.ignore||e.mark||(e.node=t)}))};for(var s in e.nodes)o(s);return t}},{key:"fromSchema",value:function(t){return t.cached.domParser||(t.cached.domParser=new e(t,e.schemaRules(t)))}}])}(),fe={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},de={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},pe={ol:!0,ul:!0};function ve(e,t,n){return null!=t?(t?1:0)|("full"===t?2:0):e&&"pre"==e.whitespace?3:-5&n}var me=function(){return m((function e(t,n,r,i,o,s,a){p(this,e),this.type=t,this.attrs=n,this.marks=r,this.pendingMarks=i,this.solid=o,this.options=a,this.content=[],this.activeMarks=M.none,this.stashMarks=[],this.match=s||(4&a?null:t.contentMatch)}),[{key:"findWrapping",value:function(e){if(!this.match){if(!this.type)return[];var t=this.type.contentMatch.fillBefore(w.from(e));if(!t){var n,r=this.type.contentMatch;return(n=r.findWrapping(e.type))?(this.match=r,n):null}this.match=this.type.contentMatch.matchFragment(t)}return this.match.findWrapping(e.type)}},{key:"finish",value:function(e){if(!(1&this.options)){var t,n=this.content[this.content.length-1];if(n&&n.isText&&(t=/[ \t\r\n\u000c]+$/.exec(n.text))){var r=n;n.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=r.withText(r.text.slice(0,r.text.length-t[0].length))}}var i=w.from(this.content);return!e&&this.match&&(i=i.append(this.match.fillBefore(w.empty,!0))),this.type?this.type.create(this.attrs,i,this.marks):i}},{key:"popFromStashMark",value:function(e){for(var t=this.stashMarks.length-1;t>=0;t--)if(e.eq(this.stashMarks[t]))return this.stashMarks.splice(t,1)[0]}},{key:"applyPending",value:function(e){for(var t=0,n=this.pendingMarks;t<n.length;t++){var r=n[t];(this.type?this.type.allowsMarkType(r.type):we(r.type,e))&&!r.isInSet(this.activeMarks)&&(this.activeMarks=r.addToSet(this.activeMarks),this.pendingMarks=r.removeFromSet(this.pendingMarks))}}},{key:"inlineContext",value:function(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!fe.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}])}(),ye=function(){return m((function e(t,n,r){p(this,e),this.parser=t,this.options=n,this.isOpen=r,this.open=0;var i,o=n.topNode,s=ve(null,n.preserveWhitespace,0)|(r?4:0);i=o?new me(o.type,o.attrs,M.none,M.none,!0,n.topMatch||o.type.contentMatch,s):new me(r?null:t.schema.topNodeType,null,M.none,M.none,!0,null,s),this.nodes=[i],this.find=n.findPositions,this.needsBlock=!1}),[{key:"top",get:function(){return this.nodes[this.open]}},{key:"addDOM",value:function(e){3==e.nodeType?this.addTextNode(e):1==e.nodeType&&this.addElement(e)}},{key:"withStyleRules",value:function(e,t){var n=e.style;if(!n||!n.length)return t();var r,i,s=this.readStyles(e.style);if(s){for(var a=(i=2,function(e){if(Array.isArray(e))return e}(r=s)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,s,a=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(e){u=!0,i=e}
1finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return a}}(r,i)||function(e,t){if(e){if("string"==typeof e)return o(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(e,t):void 0}}(r,i)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),l=a[0],u=a[1],c=this.top,h=0;h<u.length;h++)this.removePendingMark(u[h],c);for(var f=0;f<l.length;f++)this.addPendingMark(l[f]);t();for(var d=0;d<l.length;d++)this.removePendingMark(l[d],c);for(var p=0;p<u.length;p++)this.addPendingMark(u[p])}}},{key:"addTextNode",value:function(e){var t=e.nodeValue,n=this.top;if(2&n.options||n.inlineContext(e)||/[^ \t\r\n\u000c]/.test(t)){if(1&n.options)t=2&n.options?t.replace(/\r\n?/g,"\n"):t.replace(/\r?\n|\r/g," ");else if(t=t.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(t)&&this.open==this.nodes.length-1){var r=n.content[n.content.length-1],i=e.previousSibling;(!r||i&&"BR"==i.nodeName||r.isText&&/[ \t\r\n\u000c]$/.test(r.text))&&(t=t.slice(1))}t&&this.insertNode(this.parser.schema.text(t)),this.findInText(e)}else this.findInside(e)}},{key:"addElement",value:function(e,t){var n,r=this,i=e.nodeName.toLowerCase();pe.hasOwnProperty(i)&&this.parser.normalizeLists&&function(e){for(var t=e.firstChild,n=null;t;t=t.nextSibling){var r=1==t.nodeType?t.nodeName.toLowerCase():null;r&&pe.hasOwnProperty(r)&&n?(n.appendChild(t),t=n):"li"==r?n=t:r&&(n=null)}}(e);var o=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(n=this.parser.matchTag(e,this,t));if(o?o.ignore:de.hasOwnProperty(i))this.findInside(e),this.ignoreFallback(e);else if(!o||o.skip||o.closeParent){o&&o.closeParent?this.open=Math.max(0,this.open-1):o&&o.skip.nodeType&&(e=o.skip);var s,a=this.top,l=this.needsBlock;if(fe.hasOwnProperty(i))a.content.length&&a.content[0].isInline&&this.open&&(this.open--,a=this.top),s=!0,a.type||(this.needsBlock=!0);else if(!e.firstChild)return void this.leafFallback(e);o&&o.skip?this.addAll(e):this.withStyleRules(e,(function(){return r.addAll(e)})),s&&this.sync(a),this.needsBlock=l}else this.withStyleRules(e,(function(){r.addElementByRule(e,o,!1===o.consuming?n:void 0)}))}},{key:"leafFallback",value:function(e){"BR"==e.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode("\n"))}},{key:"ignoreFallback",value:function(e){"BR"!=e.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"))}},{key:"readStyles",value:function(e){for(var t=this,n=M.none,r=M.none,i=0,o=e.length;i<o;i++)for(var s,a=e.item(i),l=function(i){var o=t.parser.matchStyle(a,e.getPropertyValue(a),t,i);return o?o.ignore?{v:null}:(o.clearMark?t.top.pendingMarks.concat(t.top.activeMarks).forEach((function(e){o.clearMark(e)&&(r=e.addToSet(r))})):n=t.parser.schema.marks[o.mark].create(o.attrs).addToSet(n),!1!==o.consuming?(u=i,0):void(u=i=o)):(u=i,0)},u=void 0;0!==(s=l(u));)if(s)return s.v;return[n,r]}},{key:"addElementByRule",value:function(e,t,n){var r,i,o,s=this;t.node?(i=this.parser.schema.nodes[t.node]).isLeaf?this.insertNode(i.create(t.attrs))||this.leafFallback(e):r=this.enter(i,t.attrs||null,t.preserveWhitespace):(o=this.parser.schema.marks[t.mark].create(t.attrs),this.addPendingMark(o));var a=this.top;if(i&&i.isLeaf)this.findInside(e);else if(n)this.addElement(e,n);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach((function(e){return s.insertNode(e)}));else{var l=e;"string"==typeof t.contentElement?l=e.querySelector(t.contentElement):"function"==typeof t.contentElement?l=t.contentElement(e):t.contentElement&&(l=t.contentElement),this.findAround(e,l,!0),this.addAll(l)}r&&this.sync(a)&&this.open--,o&&this.removePendingMark(o,a)}},{key:"addAll",value:function(e,t,n){for(var r=t||0,i=t?e.childNodes[t]:e.firstChild,o=null==n?null:e.childNodes[n];i!=o;i=i.nextSibling,++r)this.findAtPoint(e,r),this.addDOM(i);this.findAtPoint(e,r)}},{key:"findPlace",value:function(e){for(var t,n,r=this.open;r>=0;r--){var i=this.nodes[r],o=i.findWrapping(e);if(o&&(!t||t.length>
1o.length)&&(t=o,n=i,!o.length))break;if(i.solid)break}if(!t)return!1;this.sync(n);for(var s=0;s<t.length;s++)this.enterInner(t[s],null,!1);return!0}},{key:"insertNode",value:function(e){if(e.isInline&&this.needsBlock&&!this.top.type){var t=this.textblockFromContext();t&&this.enterInner(t)}if(this.findPlace(e)){this.closeExtra();var n=this.top;n.applyPending(e.type),n.match&&(n.match=n.match.matchType(e.type));for(var r=n.activeMarks,i=0;i<e.marks.length;i++)n.type&&!n.type.allowsMarkType(e.marks[i].type)||(r=e.marks[i].addToSet(r));return n.content.push(e.mark(r)),!0}return!1}},{key:"enter",value:function(e,t,n){var r=this.findPlace(e.create(t));return r&&this.enterInner(e,t,!0,n),r}},{key:"enterInner",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3?arguments[3]:void 0;this.closeExtra();var i=this.top;i.applyPending(e),i.match=i.match&&i.match.matchType(e);var o=ve(e,r,i.options);4&i.options&&0==i.content.length&&(o|=4),this.nodes.push(new me(e,t,i.activeMarks,i.pendingMarks,n,null,o)),this.open++}},{key:"closeExtra",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}},{key:"finish",value:function(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}},{key:"sync",value:function(e){for(var t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;return!1}},{key:"currentPos",get:function(){this.closeExtra();for(var e=0,t=this.open;t>=0;t--){for(var n=this.nodes[t].content,r=n.length-1;r>=0;r--)e+=n[r].nodeSize;t&&e++}return e}},{key:"findAtPoint",value:function(e,t){if(this.find)for(var n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}},{key:"findInside",value:function(e){if(this.find)for(var t=0;t<this.find.length;t++)null==this.find[t].pos&&1==e.nodeType&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}},{key:"findAround",value:function(e,t,n){if(e!=t&&this.find)for(var r=0;r<this.find.length;r++)null==this.find[r].pos&&1==e.nodeType&&e.contains(this.find[r].node)&&t.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}},{key:"findInText",value:function(e){if(this.find)for(var t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}},{key:"matchesContext",value:function(e){var t=this;if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);var n=e.split("/"),r=this.options.context,i=!(this.isOpen||r&&r.parent.type!=this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1);return function e(s,a){for(;s>=0;s--){var l=n[s];if(""==l){if(s==n.length-1||0==s)continue;for(;a>=o;a--)if(e(s-1,a))return!0;return!1}var u=a>0||0==a&&i?t.nodes[a].type:r&&a>=o?r.node(a-o).type:null;if(!u||u.name!=l&&-1==u.groups.indexOf(l))return!1;a--}return!0}(n.length-1,this.open)}},{key:"textblockFromContext",value:function(){var e=this.options.context;if(e)for(var t=e.depth;t>=0;t--){var n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(var r in this.parser.schema.nodes){var i=this.parser.schema.nodes[r];if(i.isTextblock&&i.defaultAttrs)return i}}},{key:"addPendingMark",value:function(e){var t=function(e,t){for(var n=0;n<t.length;n++)if(e.eq(t[n]))return t[n]}(e,this.top.pendingMarks);t&&this.top.stashMarks.push(t),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)}},{key:"removePendingMark",value:function(e,t){for(var n=this.open;n>=0;n--){var r=this.nodes[n];if(r.pendingMarks.lastIndexOf(e)>-1)r.pendingMarks=e.removeFromSet(r.pendingMarks);else{r.activeMarks=e.removeFromSet(r.activeMarks);var i=r.popFromStashMark(e);i&&r.type&&r.type.allowsMarkType(i.type)&&(r.activeMarks=i.addToSet(r.activeMarks))}if(r==t)break}}}])}();function ge(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function ke(e){var t={};for(var n in e)t[n]=e[n];return t}function we(e,t){var n,r=t.schema.nodes,i=function(){var n=r[o];if(!n.allowsMarkType(e))return 0;var i=[];return function e(n){i.push(n);for(var r=0;r<n.edgeCount;r++){var o=n.edge(r),s=o.type,a=o.next;if(s==t)return!0;
1if(i.indexOf(a)<0&&e(a))return!0}}(n.contentMatch)?{v:!0}:void 0};for(var o in r)if(0!==(n=i())&&n)return n.v}var be=function(){function e(t,n){p(this,e),this.nodes=t,this.marks=n}return m(e,[{key:"serializeFragment",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;r||(r=xe(n).createDocumentFragment());var i=r,o=[];return e.forEach((function(e){if(o.length||e.marks.length){for(var r=0,s=0;r<o.length&&s<e.marks.length;){var a=e.marks[s];if(t.marks[a.type.name]){if(!a.eq(o[r][0])||!1===a.type.spec.spanning)break;r++,s++}else s++}for(;r<o.length;)i=o.pop()[1];for(;s<e.marks.length;){var l=e.marks[s++],u=t.serializeMark(l,e.isInline,n);u&&(o.push([l,i]),i.appendChild(u.dom),i=u.contentDOM||u.dom)}}i.appendChild(t.serializeNodeInner(e,n))})),r}},{key:"serializeNodeInner",value:function(t,n){var r=e.renderSpec(xe(n),this.nodes[t.type.name](t)),i=r.dom,o=r.contentDOM;if(o){if(t.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(t.content,n,o)}return i}},{key:"serializeNode",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.serializeNodeInner(e,t),r=e.marks.length-1;r>=0;r--){var i=this.serializeMark(e.marks[r],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}},{key:"serializeMark",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=this.marks[t.type.name];return i&&e.renderSpec(xe(r),i(t,n))}}],[{key:"renderSpec",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if("string"==typeof n)return{dom:t.createTextNode(n)};if(null!=n.nodeType)return{dom:n};if(n.dom&&null!=n.dom.nodeType)return n;var i,o=n[0],s=o.indexOf(" ");s>0&&(r=o.slice(0,s),o=o.slice(s+1));var a=r?t.createElementNS(r,o):t.createElement(o),l=n[1],u=1;if(l&&"object"==d(l)&&null==l.nodeType&&!Array.isArray(l))for(var c in u=2,l)if(null!=l[c]){var h=c.indexOf(" ");h>0?a.setAttributeNS(c.slice(0,h),c.slice(h+1),l[c]):a.setAttribute(c,l[c])}for(var f=u;f<n.length;f++){var p=n[f];if(0===p){if(f<n.length-1||f>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}var v=e.renderSpec(t,p,r),m=v.dom,y=v.contentDOM;if(a.appendChild(m),y){if(i)throw new RangeError("Multiple content holes");i=y}}return{dom:a,contentDOM:i}}},{key:"fromSchema",value:function(t){return t.cached.domSerializer||(t.cached.domSerializer=new e(this.nodesFromSchema(t),this.marksFromSchema(t)))}},{key:"nodesFromSchema",value:function(e){var t=Se(e.nodes);return t.text||(t.text=function(e){return e.text}),t}},{key:"marksFromSchema",value:function(e){return Se(e.marks)}}])}();function Se(e){var t={};for(var n in e){var r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function xe(e){return e.document||window.document}},6434:function(e,t,n){n.d(t,{wQ:function(){return p}});var r=n(8488),i=["p",0],o=["blockquote",0],s=["hr"],a=["pre",["code",0]],l=["br"],u={doc:{content:"block+"},paragraph:{content:"inline*",group:"block",parseDOM:[{tag:"p"}],toDOM:function(){return i}},blockquote:{content:"block+",group:"block",defining:!0,parseDOM:[{tag:"blockquote"}],toDOM:function(){return o}},horizontal_rule:{group:"block",parseDOM:[{tag:"hr"}],toDOM:function(){return s}},heading:{attrs:{level:{default:1}},content:"inline*",group:"block",defining:!0,parseDOM:[{tag:"h1",attrs:{level:1}},{tag:"h2",attrs:{level:2}},{tag:"h3",attrs:{level:3}},{tag:"h4",attrs:{level:4}},{tag:"h5",attrs:{level:5}},{tag:"h6",attrs:{level:6}}],toDOM:function(e){return["h"+e.attrs.level,0]}},code_block:{content:"text*",marks:"",group:"block",code:!0,defining:!0,parseDOM:[{tag:"pre",preserveWhitespace:"full"}],toDOM:function(){return a}},text:{group:"inline"},image:{inline:!0,attrs:{src:{},alt:{default:null},title:{default:null}},group:"inline",draggable:!0,parseDOM:[{tag:"img[src]",getAttrs:function(e){return{src:e.getAttribute("src"),title:e.getAttribute("title"),alt:e.getAttribute("alt")}}}],toDOM:function(e){var t=e.attrs;return["img",{src:t.src,alt:t.alt,title:t.title}]}},hard_break:{inline:!0,group:"inline",selectable:!1,parseDOM:[{tag:"br"}],toDOM:function(){return l}}},c=["em",0],h=["strong",0],f=["code",0],d={link:{attrs:{href:{},title:{default:null}},inclusive:!1,parseDOM:[{tag:"a[href]",getAttrs:function(e){return{href:e.getAttribute("href"),title:e.getAttribute("title")}}}],toDOM:function(e){var t=e.attrs;return["a",{href:t.href,title:t.title},0]}},em:{parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style=italic"},{style:"font-style=normal",clearMark:function(e){return"em"==e.type.n
1ame}}],toDOM:function(){return c}},strong:{parseDOM:[{tag:"strong"},{tag:"b",getAttrs:function(e){return"normal"!=e.style.fontWeight&&null}},{style:"font-weight=400",clearMark:function(e){return"strong"==e.type.name}},{style:"font-weight",getAttrs:function(e){return/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}}],toDOM:function(){return h}},code:{parseDOM:[{tag:"code"}],toDOM:function(){return f}}},p=new r.Sj({nodes:u,marks:d})},2030:function(e,t,n){n.d(t,{ZW:function(){return c}});var r=["ol",0],i=["ul",0],o=["li",0],s={attrs:{order:{default:1}},parseDOM:[{tag:"ol",getAttrs:function(e){return{order:e.hasAttribute("start")?+e.getAttribute("start"):1}}}],toDOM:function(e){return 1==e.attrs.order?r:["ol",{start:e.attrs.order},0]}},a={parseDOM:[{tag:"ul"}],toDOM:function(){return i}},l={parseDOM:[{tag:"li"}],toDOM:function(){return o},defining:!0};function u(e,t){var n={};for(var r in e)n[r]=e[r];for(var i in t)n[i]=t[i];return n}function c(e,t,n){return e.append({ordered_list:u(s,{content:"list_item+",group:n}),bullet_list:u(a,{content:"list_item+",group:n}),list_item:u(l,{content:t})})}},4543:function(e,t,n){n.d(t,{$t:function(){return P},LN:function(){return y},U3:function(){return b},hs:function(){return q},i5:function(){return O},k_:function(){return F},nh:function(){return x}});var r=n(8488),i=n(9364);function o(e,t,n){return t=l(t),function(e,t){if(t&&("object"==h(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,s()?Reflect.construct(t,n||[],l(e).constructor):t.apply(e,n))}function s(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(s=function(){return!!e})()}function a(){return a="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=l(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},a.apply(null,arguments)}function l(e){return l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},l(e)}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&c(e,t)}function c(e,t){return c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},c(e,t)}function h(e){return h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},h(e)}function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,v(r.key),r)}}function p(e,t,n){return t&&d(e.prototype,t),n&&d(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function v(e){var t=function(e,t){if("object"!=h(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=h(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==h(t)?t:t+""}var m=Object.create(null),y=function(){return p((function e(t,n,r){f(this,e),this.$anchor=t,this.$head=n,this.ranges=r||[new g(t.min(n),t.max(n))]}),[{key:"anchor",get:function(){return this.$anchor.pos}},{key:"head",get:function(){return this.$head.pos}},{key:"from",get:function(){return this.$from.pos}},{key:"to",get:function(){return this.$to.pos}},{key:"$from",get:function(){return this.ranges[0].$from}},{key:"$to",get:function(){return this.ranges[0].$to}},{key:"empty",get:function(){for(var e=this.ranges,t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}},{key:"content",value:function(){return this.$from.doc.slice(this.from,this.to,!0)}},{key:"replace",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r.Ji.empty,n=t.content.lastChild,i=null,o=0;o<t.openEnd;o++)i=n,n=n.lastChild;for(var s=e.steps.length,a=this.ranges,l=0;l<a.length;l++){var u=a[l],c=u.$from,h=u.$to,f=e.mapping.slice(s);e.replaceRange(f.map(c.pos),f.map(h.pos),l?r.Ji.empty:t),0==l&&D(e,s,(n?n.isInline:i&&i.isTextblock)?-1:1)}}},{key:"replaceWith",value:function(e,t){for(var n=e.steps.length,r=this.ranges,i=0;i<r.length;i++){var o=r[i],s=o.$from,a=o.$to,l=e.mapping.slice(n),u=l.map(s.pos),c=l.map(a.pos);i?e.deleteRange(u,c):(e.replaceRangeWith(u,c,t),D(e,n,t.isInline?-1:1))}}},{key:"getBookmark",value:function(){return b.between(this.$anchor,this.$head).getBookmark()}}],[{key:"findFrom",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=e.parent.inlineContent?new b(e):N(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(var i=e.depth-1;i>=0;i--){var o=t<0?N(e.node(0),e.node(i),e.before(i+1),e.index(i),t,n):N(e.node(0),e.node(i),e.after(i+1),e.index(i)+1,t,n);if(o)return o}return null}},{key:"near",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this.findFrom(e,t)||this.findFrom(e,-t)||new O(e.node(0))}},{key:"atStart",value:function(e){return N(e,e,0,0,1)||new O(e)}},{key:"atEnd",value:function(e){return N(e,e,e.content.size,e.childCount,-1)||new O(e)}},{key:"fromJSON",value:function(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");var n=m[t.type];if(!n)throw new RangeError("No selection type ".concat(t.type," defined"));return n.fromJSON(e,t)}},{key:"jsonID",value:function(e,t){if(e in m)throw new RangeError("Duplicate use of selection JSON ID "+e);return m[e]=t,t.prototype.jsonID=e,t}}])}();y.prototype.visible=!0;var g=p((function e(t,n){f(this,e),this.$from=t,this.$to=n})),k=!1;function w(e){k||e.parent.inlineContent||(k=!0,console.warn("TextSelection endpoint not pointing into a 
1node with inline content ("+e.parent.type.name+")"))}var b=function(e){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;return f(this,t),w(e),w(n),o(this,t,[e,n])}return u(t,e),p(t,[{key:"$cursor",get:function(){return this.$anchor.pos==this.$head.pos?this.$head:null}},{key:"map",value:function(e,n){var r=e.resolve(n.map(this.head));if(!r.parent.inlineContent)return y.near(r);var i=e.resolve(n.map(this.anchor));return new t(i.parent.inlineContent?i:r,r)}},{key:"replace",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r.Ji.empty;if(a(l(t.prototype),"replace",this).call(this,e,n),n==r.Ji.empty){var i=this.$from.marksAcross(this.$to);i&&e.ensureMarks(i)}}},{key:"eq",value:function(e){return e instanceof t&&e.anchor==this.anchor&&e.head==this.head}},{key:"getBookmark",value:function(){return new S(this.anchor,this.head)}},{key:"toJSON",value:function(){return{type:"text",anchor:this.anchor,head:this.head}}}],[{key:"fromJSON",value:function(e,n){if("number"!=typeof n.anchor||"number"!=typeof n.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new t(e.resolve(n.anchor),e.resolve(n.head))}},{key:"create",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t,r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))}},{key:"between",value:function(e,n,r){var i=e.pos-n.pos;if(r&&!i||(r=i>=0?1:-1),!n.parent.inlineContent){var o=y.findFrom(n,r,!0)||y.findFrom(n,-r,!0);if(!o)return y.near(n,r);n=o.$head}return e.parent.inlineContent||(0==i||(e=(y.findFrom(e,-r,!0)||y.findFrom(e,r,!0)).$anchor).pos<n.pos!=i<0)&&(e=n),new t(e,n)}}])}(y);y.jsonID("text",b);var S=function(){function e(t,n){f(this,e),this.anchor=t,this.head=n}return p(e,[{key:"map",value:function(t){return new e(t.map(this.anchor),t.map(this.head))}},{key:"resolve",value:function(e){return b.between(e.resolve(this.anchor),e.resolve(this.head))}}])}(),x=function(e){function t(e){var n;f(this,t);var r=e.nodeAfter,i=e.node(0).resolve(e.pos+r.nodeSize);return(n=o(this,t,[e,i])).node=r,n}return u(t,e),p(t,[{key:"map",value:function(e,n){var r=n.mapResult(this.anchor),i=r.deleted,o=r.pos,s=e.resolve(o);return i?y.near(s):new t(s)}},{key:"content",value:function(){return new r.Ji(r.FK.from(this.node),0,0)}},{key:"eq",value:function(e){return e instanceof t&&e.anchor==this.anchor}},{key:"toJSON",value:function(){return{type:"node",anchor:this.anchor}}},{key:"getBookmark",value:function(){return new M(this.anchor)}}],[{key:"fromJSON",value:function(e,n){if("number"!=typeof n.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new t(e.resolve(n.anchor))}},{key:"create",value:function(e,n){return new t(e.resolve(n))}},{key:"isSelectable",value:function(e){return!e.isText&&!1!==e.type.spec.selectable}}])}(y);x.prototype.visible=!1,y.jsonID("node",x);var M=function(){function e(t){f(this,e),this.anchor=t}return p(e,[{key:"map",value:function(t){var n=t.mapResult(this.anchor),r=n.deleted,i=n.pos;return r?new S(i,i):new e(i)}},{key:"resolve",value:function(e){var t=e.resolve(this.anchor),n=t.nodeAfter;return n&&x.isSelectable(n)?new x(t):y.near(t)}}])}(),O=function(e){function t(e){return f(this,t),o(this,t,[e.resolve(0),e.resolve(e.content.size)])}return u(t,e),p(t,[{key:"replace",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r.Ji.empty;if(n==r.Ji.empty){e.delete(0,e.doc.content.size);var i=y.atStart(e.doc);i.eq(e.selection)||e.setSelection(i)}else a(l(t.prototype),"replace",this).call(this,e,n)}},{key:"toJSON",value:function(){return{type:"all"}}},{key:"map",value:function(e){return new t(e)}},{key:"eq",value:function(e){return e instanceof t}},{key:"getBookmark",value:function(){return C}}],[{key:"fromJSON",value:function(e){return new t(e)}}])}(y);y.jsonID("all",O);var C={map:function(){return this},resolve:function(e){return new O(e)}};function N(e,t,n,r,i){var o=arguments.length>5&&void 0!==arguments[5]&&arguments[5];if(t.inlineContent)return b.create(e,n);for(var s=r-(i>0?0:1);i>0?s<t.childCount:s>=0;s+=i){var a=t.child(s);if(a.isAtom){if(!o&&x.isSelectable(a))return x.create(e,n-(i<0?a.nodeSize:0))}else{var l=N(e,a,n+i,i<0?a.childCount:0,i,o);if(l)return l}n+=a.nodeSize*i}return null}function D(e,t,n){var r=e.steps.length-1;if(!(r<t)){var o,s=e.steps[r];(s instanceof i.Ln||s instanceof i.Wg)&&(e.mapping.maps[r].forEach((function(e,t,n,r){null==o&&(o=r)})),e.setSelection(y.near(e.doc.resolve(o),n)))}}var T=function(e){function t(e){var n;return f(this,t),(n=o(this,t,[e.doc])).curSelectionFor=0,n.updated=0,n.meta=Object.create(null),n.time=Date.now(),n.curSelection=e.selection,n.storedMarks=e.storedMarks,n}return u(t,e),p(t,[{key:"selection",get:function(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}},{key:"setSelection",value:function(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=-3&this.updated|1,this.storedMarks=null,this}},{key:"selectionSet",get:function(){return(1&this.updated)>0}},{key:"setStoredMarks",value:function(e){return this.storedMarks=e,this.updated|=2,this}},{key:"ensureMarks",value:function(e){return r.CU.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}},{key:"addStoredMark",value:function(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}},{key:"removeStoredMark",value:function(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}},{key:"storedMarksSet",get:function(){return(2&this.updated)>0}},{key:"addStep",value:function(e,n){a(l(t.prototype),"addStep",this).call(this,e,n),this.updated=-3&this.updated,this.storedMarks=null}},{key:"setTime",value:function(e){return this.time=e,this}},{key:"replaceSelection",value:function(e){return this.selection.replace(this,e),this}},{key:"replaceSelectionWith",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||r.CU.none))),n.replaceWith(this,e),this}},{key:"deleteSelection",value:function(){return this.selection.replace(this),this}},{key:"insertText",value:function(e,t,n){var r=this.doc.type.schema;if(null==t)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();if(null==n&&(n=t),n=null==n?t:n,!e)return this.deleteRange(t,n);var i=this.storedMarks;if(!i){var o=this.doc.resolve(t);i=n==t?o.marks():o.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,i)),this.selection.empty||this.setSelection(y.near(this.selection.$to)),this}},{key:"setMeta",value:function(e,t){return this.meta["string"==typeof e?e:e.key]=t,this}},{key:"getMeta",value:function(e){return this.meta["string"==typeof e?e:e.key]}},{key:"isGeneric",get:function(){for(var e in this.meta)return!1;return!0}},{key:"scrollIntoView",value:function(){return this.updated|=4,this}},{key:"scrolledIntoView",get:function(){return(4&this.updated)>0}}])}(i.dL);function E(e,t){return t&&e?e.bind(t):e}var A=p((function e(t,n,r){f(this,e),this.name=t,this.init=E(n.init,r),this.apply=E(n.apply,r)})),R=[new A("doc",{init:function(e){return e.doc||e.schema.topNodeType.createAndFill()},apply:function(e){return e.doc}}),new A("selection",{init:function(e,t){return e.selection||y.atStart(t.doc)},apply:function(e){return e.selection}}),new A("storedMarks",{init:function(e){return e.storedMarks||null},apply:function(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new A("scrollToSelection",{init:function(){return 0},apply:function(e,t){return e.scrolledIntoView?t+1:t}})],I=p((function e(t,n){var r=this;f(this,e),this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=R.slice(),n&&n.forEac
1h((function(e){if(r.pluginsByKey[e.key])throw new RangeError("Adding different instances of a keyed plugin ("+e.key+")");r.plugins.push(e),r.pluginsByKey[e.key]=e,e.spec.state&&r.fields.push(new A(e.key,e.spec.state,e))}))})),P=function(){function e(t){f(this,e),this.config=t}return p(e,[{key:"schema",get:function(){return this.config.schema}},{key:"plugins",get:function(){return this.config.plugins}},{key:"apply",value:function(e){return this.applyTransaction(e).state}},{key:"filterTransaction",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,n=0;n<this.config.plugins.length;n++)if(n!=t){var r=this.config.plugins[n];if(r.spec.filterTransaction&&!r.spec.filterTransaction.call(r,e,this))return!1}return!0}},{key:"applyTransaction",value:function(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};for(var t=[e],n=this.applyInner(e),r=null;;){for(var i=!1,o=0;o<this.config.plugins.length;o++){var s=this.config.plugins[o];if(s.spec.appendTransaction){var a=r?r[o].n:0,l=r?r[o].state:this,u=a<t.length&&s.spec.appendTransaction.call(s,a?t.slice(a):t,l,n);if(u&&n.filterTransaction(u,o)){if(u.setMeta("appendedTransaction",e),!r){r=[];for(var c=0;c<this.config.plugins.length;c++)r.push(c<o?{state:n,n:t.length}:{state:this,n:0})}t.push(u),n=n.applyInner(u),i=!0}r&&(r[o]={state:n,n:t.length})}}if(!i)return{state:n,transactions:t}}}},{key:"applyInner",value:function(t){if(!t.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");for(var n=new e(this.config),r=this.config.fields,i=0;i<r.length;i++){var o=r[i];n[o.name]=o.apply(t,this[o.name],this,n)}return n}},{key:"tr",get:function(){return new T(this)}},{key:"reconfigure",value:function(t){for(var n=new I(this.schema,t.plugins),r=n.fields,i=new e(n),o=0;o<r.length;o++){var s=r[o].name;i[s]=this.hasOwnProperty(s)?this[s]:r[o].init(t,i)}return i}},{key:"toJSON",value:function(e){var t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map((function(e){return e.toJSON()}))),e&&"object"==h(e))for(var n in e){if("doc"==n||"selection"==n)throw new RangeError("The JSON fields `doc` and `selection` are reserved");var r=e[n],i=r.spec.state;i&&i.toJSON&&(t[n]=i.toJSON.call(r,this[r.key]))}return t}}],[{key:"create",value:function(t){for(var n=new I(t.doc?t.doc.type.schema:t.schema,t.plugins),r=new e(n),i=0;i<n.fields.length;i++)r[n.fields[i].name]=n.fields[i].init(t,r);return r}},{key:"fromJSON",value:function(t,n,i){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw new RangeError("Required config field 'schema' missing");var o=new I(t.schema,t.plugins),s=new e(o);return o.fields.forEach((function(e){if("doc"==e.name)s.doc=r.bP.fromJSON(t.schema,n.doc);else if("selection"==e.name)s.selection=y.fromJSON(s.doc,n.selection);else if("storedMarks"==e.name)n.storedMarks&&(s.storedMarks=n.storedMarks.map(t.schema.markFromJSON));else{if(i)for(var o in i){var a=i[o],l=a.spec.state;if(a.key==e.name&&l&&l.fromJSON&&Object.prototype.hasOwnProperty.call(n,o))return void(s[e.name]=l.fromJSON.call(a,t,n[o],s))}s[e.name]=e.init(t,s)}})),s}}])}();function z(e,t,n){for(var r in e){var i=e[r];i instanceof Function?i=i.bind(t):"handleDOMEvents"==r&&(i=z(i,t,{})),n[r]=i}return n}var F=function(){return p((function e(t){f(this,e),this.spec=t,this.props={},t.props&&z(t.props,this,this.props),this.key=t.key?t.key.key:V("plugin")}),[{key:"getState",value:function(e){return e[this.key]}}])}(),B=Object.create(null);function V(e){return e in B?e+"$"+ ++B[e]:(B[e]=0,e+"$")}var q=function(){return p((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"key";f(this,e),this.key=V(t)}),[{key:"get",value:function(e){return e.config.pluginsByKey[this.key]}},{key:"getState",value:function(e){return e[this.key]}}])}()},9364:function(e,t,n){n.d(t,{$L:function(){return V},Ln:function(){return N},N0:function(){return F},Um:function(){return B},Wg:function(){return D},X9:function(){return g},dL:function(){return Z},jP:function(){return R},n9:function(){return P},zy:function(){return I}});var r=n(8488);function i(e,t,n){return t=s(t),function(e,t){if(t&&("object"==u(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,o()?Reflect.construct(t,n||[],s(e).constructor):t.apply(e,n))}function o(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(o=function(){return!!e})()}
1function s(e){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},s(e)}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&l(e,t)}function l(e,t){return l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},l(e,t)}function u(e){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u(e)}function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function h(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,d(r.key),r)}}function f(e,t,n){return t&&h(e.prototype,t),n&&h(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function d(e){var t=function(e,t){if("object"!=u(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=u(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==u(t)?t:t+""}var p=Math.pow(2,16);function v(e){return 65535&e}var m=function(){return f((function e(t,n,r){c(this,e),this.pos=t,this.delInfo=n,this.recover=r}),[{key:"deleted",get:function(){return(8&this.delInfo)>0}},{key:"deletedBefore",get:function(){return(5&this.delInfo)>0}},{key:"deletedAfter",get:function(){return(6&this.delInfo)>0}},{key:"deletedAcross",get:function(){return(4&this.delInfo)>0}}])}(),y=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(c(this,e),this.ranges=t,this.inverted=n,!t.length&&e.empty)return e.empty}return f(e,[{key:"recover",value:function(e){var t=0,n=v(e);if(!this.inverted)for(var r=0;r<n;r++)t+=this.ranges[3*r+2]-this.ranges[3*r+1];return this.ranges[3*n]+t+function(e){return(e-(65535&e))/p}(e)}},{key:"mapResult",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this._map(e,t,!1)}},{key:"map",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this._map(e,t,!0)}},{key:"_map",value:function(e,t,n){for(var r=0,i=this.inverted?2:1,o=this.inverted?1:2,s=0;s<this.ranges.length;s+=3){var a=this.ranges[s]-(this.inverted?r:0);if(a>e)break;var l=this.ranges[s+i],u=this.ranges[s+o],c=a+l;if(e<=c){var h=a+r+((l?e==a?-1:e==c?1:t:t)<0?0:u);if(n)return h;var f=e==a?2:e==c?1:4;return(t<0?e!=a:e!=c)&&(f|=8),new m(h,f,e==(t<0?a:c)?null:s/3+(e-a)*p)}r+=u-l}return n?e+r:new m(e+r,0,null)}},{key:"touches",value:function(e,t){for(var n=0,r=v(t),i=this.inverted?2:1,o=this.inverted?1:2,s=0;s<this.ranges.length;s+=3){var a=this.ranges[s]-(this.inverted?n:0);if(a>e)break;var l=this.ranges[s+i];if(e<=a+l&&s==3*r)return!0;n+=this.ranges[s+o]-l}return!1}},{key:"forEach",value:function(e){for(var t=this.inverted?2:1,n=this.inverted?1:2,r=0,i=0;r<this.ranges.length;r+=3){var o=this.ranges[r],s=o-(this.inverted?i:0),a=o+(this.inverted?0:i),l=this.ranges[r+t],u=this.ranges[r+n];e(s,s+l,a,a+u),i+=u-l}}},{key:"invert",value:function(){return new e(this.ranges,!this.inverted)}},{key:"toString",value:function(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}}],[{key:"offset",value:function(t){return 0==t?e.empty:new e(t<0?[0,-t,0]:[0,0,t])}}])}();y.empty=new y([]);var g=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t.length;c(this,e),this.maps=t,this.mirror=n,this.from=r,this.to=i}return f(e,[{key:"slice",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.maps.length;return new e(this.maps,this.mirror,t,n)}},{key:"copy",value:function(){return new e(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}},{key:"appendMap",value:function(e,t){this.to=this.maps.push(e),null!=t&&this.setMirror(this.maps.length-1,t)}},{key:"appendMapping",value:function(e){for(var t=0,n=this.maps.length;t<e.maps.length;t++){var r=e.getMirror(t);this.appendMap(e.maps[t],null!=r&&r<t?n+r:void 0)}}},{key:"getMirror",value:function(e){if(this.mirror)for(var t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}},{key:"setMirror",value:function(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}},{key:"appendMappingInverted",value:function(e){for(var t=e.maps.length-1,n=this.maps.length+e.maps.length;t>=0;t--){var r=e.getMirror(t);this.appendMap(e.maps[t].invert(),null!=r&&r>t?n-r-1:void 0)}}},{key:"invert",value:function(){var t=new e;return t.appendMappingInverted(this),t}},{key:"map",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(this.mirror)return this._map(e,t,!0);for(var n=this.from;n<this.to;n++)e=this.maps[n].map(e,t);return e}},{key:"mapResult",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this._map(e,t,!1)}},{key:"_map",value:function(e,t,n){for(var r=0,i=this.from;i<this.to;i++){var o=this.maps[i].mapResult(e,t);if(null!=o.recover){var s=this.getMirror(i);if(null!=s&&s>i&&s<this.to){i=s,e=this.maps[s].recover(o.recover);continue}}r|=o.delInfo,e=o.pos}return n?e:new m(e,r,null)}}])}(),k=Object.create(null),w=function(){return f((function e(){c(this,e)}),[{key:"getMap",value:function(){return y.empty}},{key:"merge",value:function(e){return null}}],[{key:"fromJSON",value:function(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");var n=k[t.stepType];if(!n)throw new RangeError("No step type ".concat(t.stepType," defined"));return n.fromJSON(e,t)}},{key:"jsonID",value:function(e,t){if(e in k)throw new RangeError("Duplicate use of step JSON ID "+e);return k[e]=t,t.prototype.jsonID=e,t}}])}(),b=function(){function e(t,n){c(this,e),this.doc=t,this.failed=n}return f(e,null,[{key:"ok",value:function(t){return new e(t,null)}},{key:"fail",value:function(t){return new e(null,t)}},{key:"fromReplace",value:function(t,n,i,o){try{return e.ok(t.replace(n,i,o))}catch(t){if(t instanceof r.vI)return e.fail(t.message);throw t}}}])}();function S(e,t,n){for(var i=[],o=0;o<e.childCount;o++){var s=e.child(o);s.content.size&&(s=s.copy(S(s.content,t,s))),s.isInline&&(s=t(s,n,o)),i.push(s)}return r.FK.fromArray(i)}var x=function(e){function t(e,n,r){var o;return c(this,t),(o=i(this,t)).from=e,o.to=n,o.mark=r,o}return a(t,e),f(t,[{key:"apply",value:function(e){var t=this,n=e.slice(this.from,this.to),i=e.resolve(this.from),o=i.node(i.sharedDepth(this.to)),s=new r.Ji(S(n.content,(function(e,n){return e.isAtom&&n.type.allowsMarkType(t.mark.type)?e.mark(t.mark.addToSet(e.marks)):e}),o),n.openStart,n.openEnd);return b.fromReplace(e,this.from,this.to,s)}},{key:"invert",value:function(){return new M(this.from,this.to,this.mark)}},{key:"map",value:function(e){var n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new t(n.pos,r.pos,this.mark)}},{key:"merge",value:function(e){return e instanceof t&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new t(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}},{key:"toJSON",value:function(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}}],[{key:"fromJSON",value:function(e,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new t(n.from,n.to,e.markFromJSON(n.mark))}}])}(w);w.jsonID("addMark",x);var M=function(e){function t(e,n,r){var o;return c(this,t),(o=i(this,t)).from=e,o.to=n,o.mark=r,o}return a(t,e),f(t,[{key:"apply",value:function(e){var t=this,n=e.slice(this.from,this.to),i=new r.Ji(S(n.content,(function(e){return e.mark(t.mark.removeFromSet(e.marks))}),e),n.openStart,n.openEnd);return b.fromReplace(e,this.from,this.to,i)}},{key:"invert",value:function(){return new x(this.from,this.to,this.mark)}},{key:"map",value:function(e){var n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new t(n.pos,r.pos,this.mark)}},{key:"merge",value:function(e){return e instanceof t&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new t(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}},{key:"toJSON",value:function(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}}],[{key:"fromJSON",value:function(e,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new t(n.from,n.to,e.markFromJSON(n.mark))}}])}(w);w.jsonID("removeMark",M);var O=function(e){function t(e,n){var r;return c(this,t),(r=i(this,t)).pos=e,r.mark=n,r}return a(t,e),f(t,[{key:"apply",value:function(e){var t=e.nodeAt(this.pos);if(!t)return b.fail("No node at mark step's position");var n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return b.fromReplace(e,this.pos,this.pos+1,new r.Ji(r.FK.from(n),0,t.isLeaf?0:1))}},{key:"invert",value:function(e){var n=e.nodeAt(this.pos);if(n){var r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(var i=0;i<n.marks.length;i++)if(!n.marks[i].isInSet(r))return new t(this.pos,n.marks[i]);return new t(this.pos,this.mark)}}return new C(this.pos,this.mark)}},{key:"map",value:function(e){var n=e.mapResult(this.pos,1);return n.deletedAfter?null:new t(n.pos,this.mark)}},{key:"toJSON",value:function(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}}],[{key:"fromJSON",value:function(e,n){if("number"!=typeof n.pos)throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new t(n.pos,e.markFromJSON(n.mark))}}])}(w);w.jsonID("addNodeMark",O);var C=function(e){function t(e,n){var r;return c(this,t),(r=i(this,t)).pos=e,r.mark=n,r}return a(t,e),f(t,[{key:"apply",value:function(e){var t=e.nodeAt(this.pos);if(!t)return b.fail("No node at mark step's position");var n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return b.fromReplace(e,this.pos,this.pos+1,new r.Ji(r.FK.from(n),0,t.isLeaf?0:1))}},{key:"invert",value:function(e){var t=e.nodeAt(this.pos);return t&&this.mark.isInSet(t.marks)?new O(this.pos,this.mark):this}},{key:"map",value:function(e){var n=e.mapResult(this.pos,1);return n.deletedAfter?null:new t(n.pos,this.mark)}}
1,{key:"toJSON",value:function(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}}],[{key:"fromJSON",value:function(e,n){if("number"!=typeof n.pos)throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new t(n.pos,e.markFromJSON(n.mark))}}])}(w);w.jsonID("removeNodeMark",C);var N=function(e){function t(e,n,r){var o,s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return c(this,t),(o=i(this,t)).from=e,o.to=n,o.slice=r,o.structure=s,o}return a(t,e),f(t,[{key:"apply",value:function(e){return this.structure&&T(e,this.from,this.to)?b.fail("Structure replace would overwrite content"):b.fromReplace(e,this.from,this.to,this.slice)}},{key:"getMap",value:function(){return new y([this.from,this.to-this.from,this.slice.size])}},{key:"invert",value:function(e){return new t(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}},{key:"map",value:function(e){var n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new t(n.pos,Math.max(n.pos,r.pos),this.slice)}},{key:"merge",value:function(e){if(!(e instanceof t)||e.structure||this.structure)return null;if(this.from+this.slice.size!=e.from||this.slice.openEnd||e.slice.openStart){if(e.to!=this.from||this.slice.openStart||e.slice.openEnd)return null;var n=this.slice.size+e.slice.size==0?r.Ji.empty:new r.Ji(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new t(e.from,this.to,n,this.structure)}var i=this.slice.size+e.slice.size==0?r.Ji.empty:new r.Ji(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new t(this.from,this.to+(e.to-e.from),i,this.structure)}},{key:"toJSON",value:function(){var e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}}],[{key:"fromJSON",value:function(e,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new t(n.from,n.to,r.Ji.fromJSON(e,n.slice),!!n.structure)}}])}(w);w.jsonID("replace",N);var D=function(e){function t(e,n,r,o,s,a){var l,u=arguments.length>6&&void 0!==arguments[6]&&arguments[6];return c(this,t),(l=i(this,t)).from=e,l.to=n,l.gapFrom=r,l.gapTo=o,l.slice=s,l.insert=a,l.structure=u,l}return a(t,e),f(t,[{key:"apply",value:function(e){if(this.structure&&(T(e,this.from,this.gapFrom)||T(e,this.gapTo,this.to)))return b.fail("Structure gap-replace would overwrite content");var t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return b.fail("Gap is not a flat range");var n=this.slice.insertAt(this.insert,t.content);return n?b.fromReplace(e,this.from,this.to,n):b.fail("Content does not fit in gap")}},{key:"getMap",value:function(){return new y([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}},{key:"invert",value:function(e){var n=this.gapTo-this.gapFrom;return new t(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}},{key:"map",value:function(e){var n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:e.map(this.gapFrom,-1),o=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||o>r.pos?null:new t(n.pos,r.pos,i,o,this.slice,this.insert,this.structure)}},{key:"toJSON",value:function(){var e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}}],[{key:"fromJSON",value:function(e,n){if("number"!=typeof n.from||"number"!=typeof n.to||"number"!=typeof n.gapFrom||"number"!=typeof n.gapTo||"number"!=typeof n.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new t(n.from,n.to,n.gapFrom,n.gapTo,r.Ji.fromJSON(e,n.slice),n.insert,!!n.structure)}}])}(w);function T(e,t,n){for(var r=e.resolve(t),i=n-t,o=r.depth;i>0&&o>
10&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0)for(var s=r.node(o).maybeChild(r.indexAfter(o));i>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,i--}return!1}function E(e,t,n){for(var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:n.contentMatch,o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],s=e.doc.nodeAt(t),a=[],l=t+1,u=0;u<s.childCount;u++){var c=s.child(u),h=l+c.nodeSize,f=i.matchType(c.type);if(f){i=f;for(var d=0;d<c.marks.length;d++)n.allowsMarkType(c.marks[d].type)||e.step(new M(l,h,c.marks[d]));if(o&&c.isText&&"pre"!=n.whitespace)for(var p=void 0,v=/\r?\n|\r/g,m=void 0;p=v.exec(c.text);)m||(m=new r.Ji(r.FK.from(n.schema.text(" ",n.allowedMarks(c.marks))),0,0)),a.push(new N(l+p.index,l+p.index+p[0].length,m))}else a.push(new N(l,h,r.Ji.empty));l=h}if(!i.validEnd){var y=i.fillBefore(r.FK.empty,!0);e.replace(l,l,new r.Ji(y,0,0))}for(var g=a.length-1;g>=0;g--)e.step(a[g])}function A(e,t,n){return(0==t||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function R(e){for(var t=e.parent.content.cutByIndex(e.startIndex,e.endIndex),n=e.depth;;--n){var r=e.$from.node(n),i=e.$from.index(n),o=e.$to.indexAfter(n);if(n<e.depth&&r.canReplace(i,o,t))return n;if(0==n||r.type.spec.isolating||!A(r,i,o))break}return null}function I(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3?arguments[3]:void 0,i=e.resolve(t),o=i.depth-n,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(var a=i.depth-1,l=n-2;a>o;a--,l--){var u=i.node(a),c=i.index(a);if(u.type.spec.isolating)return!1;var h=u.content.cutByIndex(c,u.childCount),f=r&&r[l+1];f&&(h=h.replaceChild(0,f.type.create(f.attrs)));var d=r&&r[l]||u;if(!u.canReplace(c+1,u.childCount)||!d.type.validContent(h))return!1}var p=i.indexAfter(o),v=r&&r[0];return i.node(o).canReplaceWith(p,p,v?v.type:i.node(o+1).type)}function P(e,t){var n=e.resolve(t),r=n.index();return z(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function z(e,t){return!(!e||!t||e.isLeaf||!e.canAppend(t))}function F(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,r=e.resolve(t),i=r.depth;;i--){var o=void 0,s=void 0,a=r.index(i);if(i==r.depth?(o=r.nodeBefore,s=r.nodeAfter):n>0?(o=r.node(i+1),a++,s=r.node(i).maybeChild(a)):(o=r.node(i).maybeChild(a-1),s=r.node(i+1)),o&&!o.isTextblock&&z(o,s)&&r.node(i).canReplace(a,a+1))return t;if(0==i)break;t=n<0?r.before(i):r.after(i)}}function B(e,t,n){var r=e.resolve(t);if(!n.content.size)return t;for(var i=n.content,o=0;o<n.openStart;o++)i=i.firstChild.content;for(var s=1;s<=(0==n.openStart&&n.size?2:1);s++)for(var a=r.depth;a>=0;a--){var l=a==r.depth?0:r.pos<=(r.start(a+1)+r.end(a+1))/2?-1:1,u=r.index(a)+(l>0?1:0),c=r.node(a),h=!1;if(1==s)h=c.canReplace(u,u,i);else{var f=c.contentMatchAt(u).findWrapping(i.firstChild.type);h=f&&c.canReplaceWith(u,u,f[0])}if(h)return 0==l?r.pos:l<0?r.before(a+1):r.after(a+1)}return null}function V(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:r.Ji.empty;if(t==n&&!i.size)return null;var o=e.resolve(t),s=e.resolve(n);return q(o,s,i)?new N(t,n,i):new $(o,s,i).fit()}function q(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}w.jsonID("replaceAround",D);var $=function(){return f((function e(t,n,i){c(this,e),this.$from=t,this.$to=n,this.unplaced=i,this.frontier=[],this.placed=r.FK.empty;for(var o=0;o<=t.depth;o++){var s=t.node(o);this.frontier.push({type:s.type,match:s.contentMatchAt(t.indexAfter(o))})}for(var a=t.depth;a>0;a--)this.placed=r.FK.from(t.node(a).copy(this.placed))}),[{key:"depth",get:function(){return this.frontier.length-1}},{key:"fit",value:function(){for(;this.unplaced.size;){var e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}var t=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,i=this.$from,o=this.close(t<0?this.$to:i.doc.resolve(t));if(!o)return null;for(var s=this.placed,a=i.depth,l=o.depth;a&&l&&1==s.childCount;)s=s.firstChild.content,a--,l--;var u=new r.Ji(s,a,l);return t>-1?new D(i.pos,t,this.$to.pos,this.$to.end(),u,n):u.size||i.pos!=this.$to.pos?new N(i.pos,o.pos,u):null}},{key:"findFittable",value:function(){for(var e=this.unplaced.openStart,t=this.unplaced.content,n=0,i=this.unplaced.openEnd;n<e;n++){var o=t.firstChild;if(t.childCount>1&&(i=0),o.type.spec.isolating&&i<=n){e=n;break}t=o.content}for(var s=1;s<=2;s++)for(var a=1==s?e:this.unplaced.openStart;a>=0;a--)for(var l=null,u=(a?(l=L(this.unplaced.content,a-1).firstChild).content:this.unplaced.content).firstChild,c=this.depth;c>=0;c--){var h=this.frontier[c],f=h.type,d=h.match,p=void 0,v=null;if(1==s&&(u?d.matchType(u.type)||(v=d.fillBefore(r.FK.from(u),!1)):l&&f.compatibleContent(l.type)))return{sliceDepth:a,frontierDepth:c,parent:l,inject:v};if(2==s&&u&&(p=d.findWrapping(u.type)))return{sliceDepth:a,frontierDepth:c,parent:l,wrap:p};if(l&&d.matchType(l.type))break}}},{key:"openMore",value:function(){var e=this.unplaced,t=e.content,n=e.openStart,i=e.openEnd,o=L(t,n);return!(!o.childCount||o.firstChild.isLeaf||(this.unplaced=new r.Ji(t,n+1,Math.max(i,o.size+n>=t.size-i?n+1:0)),0))}},{key:"dropNode",value:function(){var e=this.unplaced,t=e.content,n=e.openStart,i=e.openEnd,o=L(t,n);if(o.childCount<=1&&n>0){var s=t.size-n<=n+o.size;this.unplaced=new r.Ji(J(t,n-1,1),n-1,s?n-1:i)}else this.unplaced=new r.Ji(J(t,n,1),n,i)}},{key:"placeNodes",value:function(e){for(var t=e.sliceDepth,n=e.frontierDepth,i=e.parent,o=e.inject,s=e.wrap;this.depth>n;)this.closeFrontierNode();if(s)for(var a=0;a<s.length;a++)this.openFrontierNode(s[a]);var l=this.unplaced,u=i?i.content:l.content,c=l.openStart-t,h=0,f=[],d=this.frontier[n],p=d.match,v=d.type;if(o){for(var m=0;m<o.childCount;m++)f.push(o.child(m));p=p.matchFragment(o)}for(var y=u.size+t-(l.content.size-l.openEnd);h<u.childCount;){var g=u.child(h),k=p.matchType(g.type);if(!k)break;(++h>1||0==c||g.content.size)&&(p=k,f.push(K(g.mark(v.allowedMarks(g.marks)),1==h?c:0,h==u.childCount?y:-1)))}var w=h==u.childCount;w||(y=-1),this.placed=j(this.placed,n,r.FK.from(f)),this.frontier[n].match=p,w&&y<0&&i&&i.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(var b=0,S=u;b<y;b++){var x=S.lastChild;this.frontier.push({type:x.type,match:x.contentMatchAt(x.childCount)}),S=x.content}this.unplaced=w?0==t?r.Ji.empty:new r.Ji(J(l.content,t-1,1),t-1,y<0?l.openEnd:t-1):new r.Ji(J(l.content,t,h),l.openStart,l.openEnd)}},{key:"mustMoveInline",value:function(){if(!this.$to.parent.isTextblock)return-1;var e,t=this.frontier[this.depth];if(!t.type.isTextblock||!_(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(e=this.findCloseLevel(this.$to))&&e.depth==this.depth)return-1;for(var n=this.$to.depth,r=this.$to.after(n);n>1&&r==this.$to.end(--n);)++r;return r}},{key:"findCloseLevel",value:function(e){e:for(var t=Math.min(this.depth,e.depth);t>=0;t--){var n=this.frontier[t],r=n.match,i=n.type,o=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),s=_(e,t,i,r,o);if(s){for(var a=t-1;a>=0;a--){var l=this.frontier[a],u=l.match,c=_(e,a,l.type,u,!0);if(!c||c.childCount)continue e}return{depth:t,fit:s,move:o?e.doc.resolve(e.after(t+1)):e}}}}},{key:"close",value:function(e){var t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=j(this.placed,t.depth,t.fit)),e=t.move;for(var n=t.depth+1;n<=e.depth;n++){var r=e.node(n),i=r.type.contentMatch.fillBefore(r.content,!0,e.index(n));this.openFrontierNode(r.type,r.attrs,i)}return e}},{key:"openFrontierNode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2?arguments[2]:void 0,i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=j(this.placed,this.depth,r.FK.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}},{key:"closeFrontierNode",value:function(){var e=this.frontier.pop().match.fillBefore(r.FK.empty,!0);e.childCount&&(this.placed=j(this.placed,this.frontier.length,e))}}])}();function J(e,t,n){return 0==t?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(J(e.firstChild.content,t-1,n)))}function j(e,t,n){return 0==t?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(j(e.lastChild.content,t-1,n)))}function L(e,t){for(var n=0;n<t;n++)e=e.firstChild.content;return e}function K(e,t,n){if(t<=0)return e;var i=e.content;return t>1&&(i=i.replaceChild(0,K(i.firstChild,t-1,1==i.childCount?n-1:0))),t>0&&(i=e.type.contentMatch.fillBefore(i).append(i),n<=0&&(i=i.append(e.type.contentMatch.matchFragment(i).fillBefore(r.FK.empty,!0)))),e.copy(i)}
1function _(e,t,n,r,i){var o=e.node(t),s=i?e.indexAfter(t):e.index(t);if(s==o.childCount&&!n.compatibleContent(o.type))return null;var a=r.fillBefore(o.content,!0,s);return a&&!function(e,t,n){for(var r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}(n,o.content,s)?a:null}function W(e,t,n,i,o){if(t<n){var s=e.firstChild;e=e.replaceChild(0,s.copy(W(s.content,t+1,n,i,s)))}if(t>i){var a=o.contentMatchAt(0),l=a.fillBefore(e).append(e);e=l.append(a.matchFragment(l).fillBefore(r.FK.empty,!0))}return e}function U(e,t){for(var n=[],r=Math.min(e.depth,t.depth);r>=0;r--){var i=e.start(r);if(i<e.pos-(e.depth-r)||t.end(r)>t.pos+(t.depth-r)||e.node(r).type.spec.isolating||t.node(r).type.spec.isolating)break;(i==t.start(r)||r==e.depth&&r==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&r&&t.start(r-1)==i-1)&&n.push(r)}return n}var H=function(e){function t(e,n,r){var o;return c(this,t),(o=i(this,t)).pos=e,o.attr=n,o.value=r,o}return a(t,e),f(t,[{key:"apply",value:function(e){var t=e.nodeAt(this.pos);if(!t)return b.fail("No node at attribute step's position");var n=Object.create(null);for(var i in t.attrs)n[i]=t.attrs[i];n[this.attr]=this.value;var o=t.type.create(n,null,t.marks);return b.fromReplace(e,this.pos,this.pos+1,new r.Ji(r.FK.from(o),0,t.isLeaf?0:1))}},{key:"getMap",value:function(){return y.empty}},{key:"invert",value:function(e){return new t(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}},{key:"map",value:function(e){var n=e.mapResult(this.pos,1);return n.deletedAfter?null:new t(n.pos,this.attr,this.value)}},{key:"toJSON",value:function(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}}],[{key:"fromJSON",value:function(e,n){if("number"!=typeof n.pos||"string"!=typeof n.attr)throw new RangeError("Invalid input for AttrStep.fromJSON");return new t(n.pos,n.attr,n.value)}}])}(w);w.jsonID("attr",H);var G=function(e){function t(e,n){var r;return c(this,t),(r=i(this,t)).attr=e,r.value=n,r}return a(t,e),f(t,[{key:"apply",value:function(e){var t=Object.create(null);for(var n in e.attrs)t[n]=e.attrs[n];t[this.attr]=this.value;var r=e.type.create(t,e.content,e.marks);return b.ok(r)}},{key:"getMap",value:function(){return y.empty}},{key:"invert",value:function(e){return new t(this.attr,e.attrs[this.attr])}},{key:"map",value:function(e){return this}},{key:"toJSON",value:function(){return{stepType:"docAttr",attr:this.attr,value:this.value}}}],[{key:"fromJSON",value:function(e,n){if("string"!=typeof n.attr)throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new t(n.attr,n.value)}}])}(w);w.jsonID("docAttr",G);var X=Error;((X=function e(t){var n=Error.call(this,t);return n.__proto__=e.prototype,n}).prototype=Object.create(Error.prototype)).constructor=X,X.prototype.name="TransformError";var Z=function(){return f((function e(t){c(this,e),this.doc=t,this.steps=[],this.docs=[],this.mapping=new g}),[{key:"before",get:function(){return this.docs.length?this.docs[0]:this.doc}},{key:"step",value:function(e){var t=this.maybeStep(e);if(t.failed)throw new X(t.failed);return this}},{key:"maybeStep",value:function(e){var t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}},{key:"docChanged",get:function(){return this.steps.length>0}},{key:"addStep",value:function(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}},{key:"replace",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:r.Ji.empty,i=V(this.doc,e,t,n);return i&&this.step(i),this}},{key:"replaceWith",value:function(e,t,n){return this.replace(e,t,new r.Ji(r.FK.from(n),0,0))}},{key:"delete",value:function(e,t){return this.replace(e,t,r.Ji.empty)}},{key:"insert",value:function(e,t){return this.replaceWith(e,e,t)}},{key:"replaceRange",value:function(e,t,n){return function(e,t,n,i){if(!i.size)return e.deleteRange(t,n);var o=e.doc.resolve(t),s=e.doc.resolve(n);if(q(o,s,i))return e.step(new N(t,n,i));var a=U(o,e.doc.resolve(n));0==a[a.length-1]&&a.pop();var l=-(o.depth+1);a.unshift(l);for(var u=o.depth,c=o.pos-1;u>0;u--,c--){var h=o.node(u).type.spec;if(h.defining||h.definingAsContext||h.isolating)break;a.indexOf(u)>-1?l=u:o.before(u)==c&&a.splice(1,0,-u)}for(var f,d=a.indexOf(l),p=[],v=i.openStart,m=i.content,y=0;;y++){var g=m.firstChild;if(p.push(g),y==i.openStart)break;m=g.content}for(var k=v-1;k>=0;k--){var w=p[k],b=(f=w.type).spec.defining||f.spec.definingForContent;if(b&&!w.sameMarkup(o.node(Math.abs(l)-1)))v=k;else if(b||!w.type.isTextblock)break}for(var S=i.openStart;S>=0;S--){var x=(S+v+1)%(i.openStart+1),M=p[x];if(M)for(var O=0;O<a.length;
1O++){var C=a[(O+d)%a.length],D=!0;C<0&&(D=!1,C=-C);var T=o.node(C-1),E=o.index(C-1);if(T.canReplaceWith(E,E,M.type,M.marks))return e.replace(o.before(C),D?s.after(C):n,new r.Ji(W(i.content,0,i.openStart,x),x,i.openEnd))}}for(var A=e.steps.length,R=a.length-1;R>=0&&(e.replace(t,n,i),!(e.steps.length>A));R--){var I=a[R];I<0||(t=o.before(I),n=s.after(I))}}(this,e,t,n),this}},{key:"replaceRangeWith",value:function(e,t,n){return function(e,t,n,i){if(!i.isInline&&t==n&&e.doc.resolve(t).parent.content.size){var o=function(e,t,n){var r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(0==r.parentOffset)for(var i=r.depth-1;i>=0;i--){var o=r.index(i);if(r.node(i).canReplaceWith(o,o,n))return r.before(i+1);if(o>0)return null}if(r.parentOffset==r.parent.content.size)for(var s=r.depth-1;s>=0;s--){var a=r.indexAfter(s);if(r.node(s).canReplaceWith(a,a,n))return r.after(s+1);if(a<r.node(s).childCount)return null}return null}(e.doc,t,i.type);null!=o&&(t=n=o)}e.replaceRange(t,n,new r.Ji(r.FK.from(i),0,0))}(this,e,t,n),this}},{key:"deleteRange",value:function(e,t){return function(e,t,n){for(var r=e.doc.resolve(t),i=e.doc.resolve(n),o=U(r,i),s=0;s<o.length;s++){var a=o[s],l=s==o.length-1;if(l&&0==a||r.node(a).type.contentMatch.validEnd)return e.delete(r.start(a),i.end(a));if(a>0&&(l||r.node(a-1).canReplace(r.index(a-1),i.indexAfter(a-1))))return e.delete(r.before(a),i.after(a))}for(var u=1;u<=r.depth&&u<=i.depth;u++)if(t-r.start(u)==r.depth-u&&n>r.end(u)&&i.end(u)-n!=i.depth-u)return e.delete(r.before(u),n);e.delete(t,n)}(this,e,t),this}},{key:"lift",value:function(e,t){return function(e,t,n){for(var i=t.$from,o=t.$to,s=t.depth,a=i.before(s+1),l=o.after(s+1),u=a,c=l,h=r.FK.empty,f=0,d=s,p=!1;d>n;d--)p||i.index(d)>0?(p=!0,h=r.FK.from(i.node(d).copy(h)),f++):u--;for(var v=r.FK.empty,m=0,y=s,g=!1;y>n;y--)g||o.after(y+1)<o.end(y)?(g=!0,v=r.FK.from(o.node(y).copy(v)),m++):c++;e.step(new D(u,c,a,l,new r.Ji(h.append(v),f,m),h.size-f,!0))}(this,e,t),this}},{key:"join",value:function(e){return function(e,t,n){var i=new N(t-n,t+n,r.Ji.empty,!0);e.step(i)}(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:1),this}},{key:"wrap",value:function(e,t){return function(e,t,n){for(var i=r.FK.empty,o=n.length-1;o>=0;o--){if(i.size){var s=n[o].type.contentMatch.matchFragment(i);if(!s||!s.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}i=r.FK.from(n[o].type.create(n[o].attrs,i))}var a=t.start,l=t.end;e.step(new D(a,l,a,l,new r.Ji(i,0,0),n.length,!0))}(this,e,t),this}},{key:"setBlockType",value:function(e){return function(e,t,n,i,o){if(!i.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");var s=e.steps.length;e.doc.nodesBetween(t,n,(function(t,n){if(t.isTextblock&&!t.hasMarkup(i,o)&&function(e,t,n){var r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}(e.doc,e.mapping.slice(s).map(n),i)){var a=null;if(i.schema.linebreakReplacement){var l="pre"==i.whitespace,u=!!i.contentMatch.matchType(i.schema.linebreakReplacement);l&&!u?a=!1:!l&&u&&(a=!0)}!1===a&&function(e,t,n,r){t.forEach((function(i,o){if(i.type==i.type.schema.linebreakReplacement){var s=e.mapping.slice(r).map(n+1+o);e.replaceWith(s,s+1,t.type.schema.text("\n"))}}))}(e,t,n,s),E(e,e.mapping.slice(s).map(n,1),i,void 0,null===a);var c=e.mapping.slice(s),h=c.map(n,1),f=c.map(n+t.nodeSize,1);return e.step(new D(h,f,h+1,f-1,new r.Ji(r.FK.from(i.create(o,null,t.marks)),0,0),1,!0)),!0===a&&function(e,t,n,r){t.forEach((function(i,o){if(i.isText)for(var s,a=/\r?\n|\r/g;s=a.exec(i.text);){var l=e.mapping.slice(r).map(n+1+o+s.index);e.replaceWith(l,l+1,t.type.schema.linebreakReplacement.create())}}))}(e,t,n,s),!1}}))}(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,arguments.length>2?arguments[2]:void 0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:null),this}},{key:"setNodeMarkup",value:function(e,t){return function(e,t,n,i,o){var s=e.doc.nodeAt(t);if(!s)throw new RangeError("No node at given position");n||(n=s.type);var a=n.create(i,null,o||s.marks);if(s.isLeaf)return e.replaceWith(t,t+s.nodeSize,a);if(!n.validContent(s.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new D(t,t+s.nodeSize,t+1,t+s.nodeSize-1,new r.Ji(r.FK.from(a),0,0),1,!0))}(this,e,t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,arguments.length>3?arguments[3]:void 0),this}},{key:"setNodeAttribute",value:function(e,t,n){return this.step(new H(e,t,n)),this}},{key:"setDocAttribute",value:function(e,t){return this.step(new G(e,t)),this}},{key:"addNodeMark",value:function(e,t){return this.step(new O(e,t)),this}}
1,{key:"removeNodeMark",value:function(e,t){if(!(t instanceof r.CU)){var n=this.doc.nodeAt(e);if(!n)throw new RangeError("No node at position "+e);if(!(t=t.isInSet(n.marks)))return this}return this.step(new C(e,t)),this}},{key:"split",value:function(e){return function(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3?arguments[3]:void 0,o=e.doc.resolve(t),s=r.FK.empty,a=r.FK.empty,l=o.depth,u=o.depth-n,c=n-1;l>u;l--,c--){s=r.FK.from(o.node(l).copy(s));var h=i&&i[c];a=r.FK.from(h?h.type.create(h.attrs,a):o.node(l).copy(a))}e.step(new N(t,t,new r.Ji(s.append(a),n,n),!0))}(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,arguments.length>2?arguments[2]:void 0),this}},{key:"addMark",value:function(e,t,n){return function(e,t,n,r){var i,o,s=[],a=[];e.doc.nodesBetween(t,n,(function(e,l,u){if(e.isInline){var c=e.marks;if(!r.isInSet(c)&&u.type.allowsMarkType(r.type)){for(var h=Math.max(l,t),f=Math.min(l+e.nodeSize,n),d=r.addToSet(c),p=0;p<c.length;p++)c[p].isInSet(d)||(i&&i.to==h&&i.mark.eq(c[p])?i.to=f:s.push(i=new M(h,f,c[p])));o&&o.to==h?o.to=f:a.push(o=new x(h,f,r))}}})),s.forEach((function(t){return e.step(t)})),a.forEach((function(t){return e.step(t)}))}(this,e,t,n),this}},{key:"removeMark",value:function(e,t,n){return function(e,t,n,i){var o=[],s=0;e.doc.nodesBetween(t,n,(function(e,a){if(e.isInline){s++;var l=null;if(i instanceof r.sX)for(var u,c=e.marks;u=i.isInSet(c);)(l||(l=[])).push(u),c=u.removeFromSet(c);else i?i.isInSet(e.marks)&&(l=[i]):l=e.marks;if(l&&l.length)for(var h=Math.min(a+e.nodeSize,n),f=0;f<l.length;f++){for(var d=l[f],p=void 0,v=0;v<o.length;v++){var m=o[v];m.step==s-1&&d.eq(o[v].style)&&(p=m)}p?(p.to=h,p.step=s):o.push({style:d,from:Math.max(a,t),to:h,step:s})}}})),o.forEach((function(t){return e.step(new M(t.from,t.to,t.style))}))}(this,e,t,n),this}},{key:"clearIncompatible",value:function(e,t,n){return E(this,e,t,n),this}}])}()},6129:function(e,t,n){n.d(t,{Lz:function(){return On}});var r=n(4543),i=n(8488),o=n(9364);function s(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=a(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){l=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(l)throw o}}}}function a(e,t){if(e){if("string"==typeof e)return l(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(e,t):void 0}}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function u(e,t,n){return t=f(t),function(e,t){if(t&&("object"==v(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,c()?Reflect.construct(t,n||[],f(e).constructor):t.apply(e,n))}function c(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(c=function(){return!!e})()}function h(){return h="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=f(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},h.apply(null,arguments)}function f(e){return f=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},f(e)}function d(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&p(e,t)}
1function p(e,t){return p=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},p(e,t)}function v(e){return v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},v(e)}function m(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function y(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,k(r.key),r)}}function g(e,t,n){return t&&y(e.prototype,t),n&&y(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function k(e){var t=function(e,t){if("object"!=v(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=v(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==v(t)?t:t+""}var w=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},b=function(e){var t=e.assignedSlot||e.parentNode;return t&&11==t.nodeType?t.host:t},S=null,x=function(e,t,n){var r=S||(S=document.createRange());return r.setEnd(e,null==n?e.nodeValue.length:n),r.setStart(e,t||0),r},M=function(e,t,n,r){return n&&(C(e,t,n,r,-1)||C(e,t,n,r,1))},O=/^(img|br|input|textarea|hr)$/i;function C(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:N(e))){var o=e.parentNode;if(!o||1!=o.nodeType||D(e)||O.test(e.nodeName)||"false"==e.contentEditable)return!1;t=w(e)+(i<0?0:1),e=o}else{if(1!=e.nodeType)return!1;if("false"==(e=e.childNodes[t+(i<0?-1:0)]).contentEditable)return!1;t=i<0?N(e):0}}}function N(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function D(e){for(var t,n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}var T=function(e){return e.focusNode&&M(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function E(e,t){var n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}var A="undefined"!=typeof navigator?navigator:null,R="undefined"!=typeof document?document:null,I=A&&A.userAgent||"",P=
1/Edge\/(\d+)/.exec(I),z=/MSIE \d/.exec(I),F=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(I),B=!!(z||F||P),V=z?document.documentMode:F?+F[1]:P?+P[1]:0,q=!B&&/gecko\/(\d+)/i.test(I);q&&(/Firefox\/(\d+)/.exec(I)||[0,0])[1];var $=!B&&/Chrome\/(\d+)/.exec(I),J=!!$,j=$?+$[1]:0,L=!B&&!!A&&/Apple Computer/.test(A.vendor),K=L&&(/Mobile\/\w+/.test(I)||!!A&&A.maxTouchPoints>2),_=K||!!A&&/Mac/.test(A.platform),W=!!A&&/Win/.test(A.platform),U=/Android \d/.test(I),H=!!R&&"webkitFontSmoothing"in R.documentElement.style,G=H?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function X(e){var 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}}function Z(e,t){return"number"==typeof e?e:e[t]}function Y(e){var t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function Q(e,t,n){for(var r=e.someProp("scrollThreshold")||0,i=e.someProp("scrollMargin")||5,o=e.dom.ownerDocument,s=n||e.dom;s;s=b(s))if(1==s.nodeType){var a=s,l=a==o.body,u=l?X(o):Y(a),c=0,h=0;if(t.top<u.top+Z(r,"top")?h=-(u.top-t.top+Z(i,"top")):t.bottom>u.bottom-Z(r,"bottom")&&(h=t.bottom-t.top>u.bottom-u.top?t.top+Z(i,"top")-u.top:t.bottom-u.bottom+Z(i,"bottom")),t.left<u.left+Z(r,"left")?c=-(u.left-t.left+Z(i,"left")):t.right>u.right-Z(r,"right")&&(c=t.right-u.right+Z(i,"right")),c||h)if(l)o.defaultView.scrollBy(c,h);else{var f=a.scrollLeft,d=a.scrollTop;h&&(a.scrollTop+=h),c&&(a.scrollLeft+=c);var p=a.scrollLeft-f,v=a.scrollTop-d;t={left:t.left-p,top:t.top-v,right:t.right-p,bottom:t.bottom-v}}if(l||/^(fixed|sticky)$/.test(getComputedStyle(s).position))break}}function ee(e){for(var t=[],n=e.ownerDocument,r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=b(r));return t}function te(e,t){for(var n=0;n<e.length;n++){var r=e[n],i=r.dom,o=r.top,s=r.left;i.scrollTop!=o+t&&(i.scrollTop=o+t),i.scrollLeft!=s&&(i.scrollLeft=s)}}var ne=null;function re(e,t){for(var n,r,i,o,s=2e8,a=0,l=t.top,u=t.top,c=e.firstChild,h=0;c;c=c.nextSibling,h++){var f=void 0;if(1==c.nodeType)f=c.getClientRects();else{if(3!=c.nodeType)continue;f=x(c).getClientRects()}for(var d=0;d<f.length;d++){var p=f[d];if(p.top<=l&&p.bottom>=u){l=Math.max(p.bottom,l),u=Math.min(p.top,u);var v=p.left>t.left?p.left-t.left:p.right<t.left?t.left-p.right:0;if(v<s){n=c,s=v,r=v&&3==n.nodeType?{left:p.right<t.left?p.right:p.left,top:t.top}:t,1==c.nodeType&&v&&(a=h+(t.left>=(p.left+p.right)/2?1:0));continue}}else p.top>t.top&&!i&&p.left<=t.left&&p.right>=t.left&&(i=c,o={left:Math.max(p.left,Math.min(p.right,t.left)),top:p.top});!n&&(t.left>=p.right&&t.top>=p.top||t.left>=p.left&&t.top>=p.bottom)&&(a=h+1)}}return!n&&i&&(n=i,r=o,s=0),n&&3==n.nodeType?function(e,t){for(var n=e.nodeValue.length,r=document.createRange(),i=0;i<n;i++){r.setEnd(e,i+1),r.setStart(e,i);var o=le(r,1);if(o.top!=o.bottom&&ie(t,o))return{node:e,offset:i+(t.left>=(o.left+o.right)/2?1:0)}}return{node:e,offset:0}}(n,r):!n||s&&1==n.nodeType?{node:e,offset:a}:re(n,r)}function ie(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function oe(e,t,n){var r=e.childNodes.length;if(r&&n.top<n.bottom)for(var i=Math.max(0,Math.min(r-1,Math.floor(r*(t.top-n.top)/(n.bottom-n.top))-2)),o=i;;){var s=e.childNodes[o];if(1==s.nodeType)for(var a=s.getClientRects(),l=0;l<a.length;l++){var u=a[l];if(ie(t,u))return oe(s,t,u)}if((o=(o+1)%r)==i)break}return e}function se(e,t){var n,r=e.dom.ownerDocument,i=0,o=function(e,t,n){if(e.caretPositionFromPoint)try{var r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:r.offset}}catch(e){}if(e.caretRangeFromPoint){var i=e.caretRangeFromPoint(t,n);if(i)return{node:i.startContainer,offset:i.startOffset}}}(r,t.left,t.top);o&&(n=o.node,i=o.offset);var s,a=(e.root.elementFromPoint?e.root:r).elementFromPoint(t.left,t.top);if(!a||!e.dom.contains(1!=a.nodeType?a.parentNode:a)){var l=e.dom.getBoundingClientRect();if(!ie(t,l))return null;if(!(a=oe(e.dom,t,l)))return null}if(L)for(var u=a;n&&u;u=b(u))u.draggable&&(n=void 0);if(a=function(e,t){var n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}(a,t),n){if(q&&1==n.nodeType&&(i=Math.min(i,n.childNodes.length))<n.childNodes.length){var c,h=n.childNodes[i];"IMG"==h.nodeName&&(c=h.getBoundingClientRect()).right<=t.left&&c.bottom>t.top&&i++}var f;H&&i&&1==n.nodeType&&1==(f=n.childNodes[i-1]).nodeType&&"false"==f.contentEditable&&f.getBoundingClientRect().top>=t.top&&i--,n==e.dom&&i==n.childNodes.length-1&&1==n.lastChild.nodeType&&t.top>
1n.lastChild.getBoundingClientRect().bottom?s=e.state.doc.content.size:0!=i&&1==n.nodeType&&"BR"==n.childNodes[i-1].nodeName||(s=function(e,t,n,r){for(var i=-1,o=t,s=!1;o!=e.dom;){var a=e.docView.nearestDesc(o,!0);if(!a)return null;if(1==a.dom.nodeType&&(a.node.isBlock&&a.parent||!a.contentDOM)){var l=a.dom.getBoundingClientRect();if(a.node.isBlock&&a.parent&&(!s&&l.left>r.left||l.top>r.top?i=a.posBefore:(!s&&l.right<r.left||l.bottom<r.top)&&(i=a.posAfter),s=!0),!a.contentDOM&&i<0&&!a.node.isText)return(a.node.isBlock?r.top<(l.top+l.bottom)/2:r.left<(l.left+l.right)/2)?a.posBefore:a.posAfter}o=a.dom.parentNode}return i>-1?i:e.docView.posFromDOM(t,n,-1)}(e,n,i,t))}null==s&&(s=function(e,t,n){var r=re(t,n),i=r.node,o=r.offset,s=-1;if(1==i.nodeType&&!i.firstChild){var a=i.getBoundingClientRect();s=a.left!=a.right&&n.left>(a.left+a.right)/2?1:-1}return e.docView.posFromDOM(i,o,s)}(e,a,t));var d=e.docView.nearestDesc(a,!0);return{pos:s,inside:d?d.posAtStart-d.border:-1}}function ae(e){return e.top<e.bottom||e.left<e.right}function le(e,t){var n=e.getClientRects();if(n.length){var r=n[t<0?0:n.length-1];if(ae(r))return r}return Array.prototype.find.call(n,ae)||e.getBoundingClientRect()}var ue=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function ce(e,t,n){var r=e.docView.domFromPos(t,n<0?-1:1),i=r.node,o=r.offset,s=r.atom,a=H||q;if(3==i.nodeType){if(!a||!ue.test(i.nodeValue)&&(n<0?o:o!=i.nodeValue.length)){var l=o,u=o,c=n<0?1:-1;return n<0&&!o?(u++,c=-1):n>=0&&o==i.nodeValue.length?(l--,c=1):n<0?l--:u++,he(le(x(i,l,u),c),c<0)}var h=le(x(i,o,o),n);if(q&&o&&/\s/.test(i.nodeValue[o-1])&&o<i.nodeValue.length){var f=le(x(i,o-1,o-1),-1);if(f.top==h.top){var d=le(x(i,o,o+1),-1);if(d.top!=h.top)return he(d,d.left<f.left)}}return h}if(!e.state.doc.resolve(t-(s||0)).parent.inlineContent){if(null==s&&o&&(n<0||o==N(i))){var p=i.childNodes[o-1];if(1==p.nodeType)return fe(p.getBoundingClientRect(),!1)}if(null==s&&o<N(i)){var v=i.childNodes[o];if(1==v.nodeType)return fe(v.getBoundingClientRect(),!0)}return fe(i.getBoundingClientRect(),n>=0)}if(null==s&&o&&(n<0||o==N(i))){var m=i.childNodes[o-1],y=3==m.nodeType?x(m,N(m)-(a?0:1)):1!=m.nodeType||"BR"==m.nodeName&&m.nextSibling?null:m;if(y)return he(le(y,1),!1)}if(null==s&&o<N(i)){for(var g=i.childNodes[o];g.pmViewDesc&&g.pmViewDesc.ignoreForCoords;)g=g.nextSibling;var k=g?3==g.nodeType?x(g,0,a?0:1):1==g.nodeType?g:null:null;if(k)return he(le(k,-1),!0)}return he(le(3==i.nodeType?x(i):i,-n),n>=0)}function he(e,t){if(0==e.width)return e;var n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function fe(e,t){if(0==e.height)return e;var n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function de(e,t,n){var r=e.state,i=e.root.activeElement;r!=t&&e.updateState(t),i!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),i!=e.dom&&i&&i.focus()}}var pe=/[\u0590-\u08ac]/,ve=null,me=null,ye=!1;var ge=function(){return g((function e(t,n,r,i){m(this,e),this.parent=t,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=0,r.pmViewDesc=this}),[{key:"matchesWidget",value:function(e){return!1}},{key:"matchesMark",value:function(e){return!1}},{key:"matchesNode",value:function(e,t,n){return!1}},{key:"matchesHack",value:function(e){return!1}},{key:"parseRule",value:function(){return null}},{key:"stopEvent",value:function(e){return!1}},{key:"size",get:function(){for(var e=0,t=0;t<this.children.length;t++)e+=this.children[t].size;return e}},{key:"border",get:function(){return 0}},{key:"destroy",value:function(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(var e=0;e<this.children.length;e++)this.children[e].destroy()}},{key:"posBeforeChild",value:function(e){for(var t=0,n=this.posAtStart;;t++){var r=this.children[t];if(r==e)return n;n+=r.size}}},{key:"posBefore",get:function(){return this.parent.posBeforeChild(this)}},{key:"posAtStart",get:function(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}},{key:"posAfter",get:function(){return this.posBefore+this.size}},{key:"posAtEnd",get:function(){return this.posAtStart+this.size-2*this.border}},{key:"localPosFromDOM",value:function(e,t,n){if(this.contentDOM&&this.contentDOM.contains(1==e.nodeType?e:e.parentNode)){if(n<0){var r,i;if(e==this.contentDOM)r=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;r=e.previousSibling}for(;r&&(!(i=r.pmViewDesc)||i.parent!=this);)r=r.previousSibling;return r?this.posBeforeChild(i)+i.size:this.posAtStart}var o,s;if(e==this.contentDOM)o=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;o=e.nextSibling}for(;o&&(!(s=o.pmViewDesc)||s.parent!=this);)o=o.nextSibling;return o?this.posBeforeChild(s):this.posAtEnd}var a;if(e==this.dom&&this.contentDOM)a=t>w(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 l=e;;l=l.parentNode){if(l==this.dom){a=!1;break}if(l.previousSibling)break}if(null==a&&t==e.childNodes.length)for(var u=e;;u=u.parentNode){if(u==this.dom){a=!0;break}if(u.nextSibling)break}}return(null==a?n>0:a)?this.posAtEnd:this.posAtStart}},{key:"nearestDesc",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=!0,r=e;r;r=r.parentNode){var i=this.getDesc(r),o=void 0;if(i&&(!t||i.node)){if(!n||!(o=i.nodeDOM)||(1==o.nodeType?o.contains(1==e.nodeType?e:e.parentNode):o==e))return i;n=!1}}}},{key:"getDesc",value:function(e){for(var t=e.pmViewDesc,n=t;n;n=n.parent)if(n==this)return t}},{key:"posFromDOM",value:function(e,t,n){for(var r=e;r;r=r.parentNode){var i=this.getDesc(r);if(i)return i.localPosFromDOM(e,t,n)}return-1}},{key:"descAt",value:function(e){for(var t=0,n=0;t<this.children.length;t++){var r=this.children[t],i=n+r.size;if(n==e&&i!=n){for(;!r.border&&r.children.length;)r=r.children[0];return r}if(e<i)return r.descAt(e-n-r.border);n=i}}},{key:"domFromPos",value:function(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};for(var n,r=0,i=0,o=0;r<this.children.length;r++){var s=this.children[r],a=o+s.size;if(a>e||s instanceof Oe){i=e-o;break}o=a}if(i)return this.children[r].domFromPos(i-this.children[r].border,t);for(;r&&!(n=this.children[r-1]).size&&n instanceof ke&&n.side>=0;r--);if(t<=0){for(var l,u=!0;(l=r?this.children[r-1]:null)&&l.dom.parentNode!=this.contentDOM;r--,u=!1);return l&&t&&u&&!l.border&&!l.domAtom?l.domFromPos(l.size,t):{node:this.contentDOM,offset:l?w(l.dom)+1:0}}for(var c,h=!0;(c=r<this.children.length?this.children[r]:null)&&c.dom.parentNode!=this.contentDOM;r++,h=!1);return c&&h&&!c.border&&!c.domAtom?c.domFromPos(0,t):{node:this.contentDOM,offset:c?w(c.dom):this.contentDOM.childNodes.length}}},{key:"parseRange",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(0==this.children.length)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};for(var r=-1,i=-1,o=n,s=0;;s++){var a=this.children[s],l=o+a.size;if(-1==r&&e<=l){var u=o+a.border;if(e>=u&&t<=l-a.border&&a.node&&a.contentDOM&&this.contentDOM.contains(a.contentDOM))return a.parseRange(e,t,u);e=o;for(var c=s;c>0;c--){var h=this.children[c-1];if(h.size&&h.dom.parentNode==this.contentDOM&&!h.emptyChildAt(1)){r=w(h.dom)+1;break}e-=h.size}-1==r&&(r=0)}if(r>-1&&(l>t||s==this.children.length-1)){t=l;for(var f=s+1;f<this.children.length;f++){var d=this.children[f];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(-1)){i=w(d.dom);break}t+=d.size}-1==i&&(i=this.contentDOM.childNodes.length);break}o=l}return{node:this.contentDOM,from:e,to:t,fromOffset:r,toOffset:i}}},{key:"emptyChildAt",value: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)}},{key:"domAfterPos",value:function(e){var t=this.domFromPos(e,0),n=t.node,r=t.offset;if(1!=n.nodeType||r==n.childNodes.length)throw new RangeError("No node after pos "+e);return n.childNodes[r]}},{key:"setSelection",value:function(e,t,n){for(var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=Math.min(e,t),o=Math.max(e,t),s=0,a=0;s<this.children.length;s++){var l=this.children[s],u=a+l.size;if(i>a&&o<u)return l.setSelection(e-a-l.border,t-a-l.border,n,r);a=u}var c=this.domFromPos(e,e?-1:1),h=t==e?c:this.domFromPos(t,t?-1:1),f=n.getSelection(),d=!1;if((q||L)&&e==t){var p=c,v=p.node,m=p.offset;if(3==v.nodeType){if((d=!(!m||"\n"!=v.nodeValue[m-1]))&&m==v.nodeValue.length)for(var y,g=v;g;g=g.parentNode){if(y=g.nextSibling){"BR"==y.nodeName&&(c=h={node:y.parentNode,offset:w(y)+1});break}
1var k=g.pmViewDesc;if(k&&k.node&&k.node.isBlock)break}}else{var b=v.childNodes[m-1];d=b&&("BR"==b.nodeName||"false"==b.contentEditable)}}if(q&&f.focusNode&&f.focusNode!=h.node&&1==f.focusNode.nodeType){var S=f.focusNode.childNodes[f.focusOffset];S&&"false"==S.contentEditable&&(r=!0)}if(r||d&&L||!M(c.node,c.offset,f.anchorNode,f.anchorOffset)||!M(h.node,h.offset,f.focusNode,f.focusOffset)){var x=!1;if((f.extend||e==t)&&!d){f.collapse(c.node,c.offset);try{e!=t&&f.extend(h.node,h.offset),x=!0}catch(e){}}if(!x){if(e>t){var O=c;c=h,h=O}var C=document.createRange();C.setEnd(h.node,h.offset),C.setStart(c.node,c.offset),f.removeAllRanges(),f.addRange(C)}}}},{key:"ignoreMutation",value:function(e){return!this.contentDOM&&"selection"!=e.type}},{key:"contentLost",get:function(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}},{key:"markDirty",value:function(e,t){for(var n=0,r=0;r<this.children.length;r++){var i=this.children[r],o=n+i.size;if(n==o?e<=o&&t>=n:e<o&&t>n){var s=n+i.border,a=o-i.border;if(e>=s&&t<=a)return this.dirty=e==n||t==o?2:1,void(e!=s||t!=a||!i.contentLost&&i.dom.parentNode==this.contentDOM?i.markDirty(e-s,t-s):i.dirty=3);i.dirty=i.dom!=i.contentDOM||i.dom.parentNode!=this.contentDOM||i.children.length?3:2}n=o}this.dirty=2}},{key:"markParentsDirty",value:function(){for(var e=1,t=this.parent;t;t=t.parent,e++){var n=1==e?2:1;t.dirty<n&&(t.dirty=n)}}},{key:"domAtom",get:function(){return!1}},{key:"ignoreForCoords",get:function(){return!1}},{key:"isText",value:function(e){return!1}}])}(),ke=function(e){function t(e,n,r,i){var o;m(this,t);var s,a=n.type.toDOM;if("function"==typeof a&&(a=a(r,(function(){return s?s.parent?s.parent.posBeforeChild(s):void 0:i}))),!n.type.spec.raw){if(1!=a.nodeType){var l=document.createElement("span");l.appendChild(a),a=l}a.contentEditable="false",a.classList.add("ProseMirror-widget")}return(o=u(this,t,[e,[],a,null])).widget=n,o.widget=n,s=o,o}return d(t,e),g(t,[{key:"matchesWidget",value:function(e){return 0==this.dirty&&e.type.eq(this.widget.type)}},{key:"parseRule",value:function(){return{ignore:!0}}},{key:"stopEvent",value:function(e){var t=this.widget.spec.stopEvent;return!!t&&t(e)}},{key:"ignoreMutation",value:function(e){return"selection"!=e.type||this.widget.spec.ignoreSelection}},{key:"destroy",value:function(){this.widget.type.destroy(this.dom),h(f(t.prototype),"destroy",this).call(this)}},{key:"domAtom",get:function(){return!0}},{key:"side",get:function(){return this.widget.type.side}}])}(ge),we=function(e){function t(e,n,r,i){var o;return m(this,t),(o=u(this,t,[e,[],n,null])).textDOM=r,o.text=i,o}return d(t,e),g(t,[{key:"size",get:function(){return this.text.length}},{key:"localPosFromDOM",value:function(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t}},{key:"domFromPos",value:function(e){return{node:this.textDOM,offset:e}}},{key:"ignoreMutation",value:function(e){return"characterData"===e.type&&e.target.nodeValue==e.oldValue}}])}(ge),be=function(e){function t(e,n,r,i){var o;return m(this,t),(o=u(this,t,[e,[],r,i])).mark=n,o}return d(t,e),g(t,[{key:"parseRule",value:function(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}},{key:"matchesMark",value:function(e){return 3!=this.dirty&&this.mark.eq(e)}},{key:"markDirty",value:function(e,n){if(h(f(t.prototype),"markDirty",this).call(this,e,n),0!=this.dirty){for(var r=this.parent;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=0}}},{key:"slice",value:function(e,n,r){var i=t.create(this.parent,this.mark,!0,r),o=this.children,s=this.size;n<s&&(o=Ve(o,n,s,r)),e>0&&(o=Ve(o,0,e,r));for(var a=0;a<o.length;a++)o[a].parent=i;return i.children=o,i}}],[{key:"create",value:function(e,n,r,o){var s=o.nodeViews[n.type.name],a=s&&s(n,o,r);return a&&a.dom||(a=i.ZF.renderSpec(document,n.type.spec.toDOM(n,r))),new t(e,n,a.dom,a.contentDOM||a.dom)}}])}(ge),Se=function(e){function t(e,n,r,i,o,s,a,l,c){var h;return m(this,t),(h=u(this,t,[e,[],o,s])).node=n,h.outerDeco=r,h.innerDeco=i,h.nodeDOM=a,h}return d(t,e),g(t,[{key:"parseRule",value:function(){var e=this;if(this.node.type.spec.reparseInView)return null;
1var 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 n=this.children.length-1;n>=0;n--){var r=this.children[n];if(this.dom.contains(r.dom.parentNode)){t.contentElement=r.dom.parentNode;break}}t.contentElement||(t.getContent=function(){return i.FK.empty})}else t.contentElement=this.contentDOM;else t.getContent=function(){return e.node.content};return t}},{key:"matchesNode",value:function(e,t,n){return 0==this.dirty&&e.eq(this.node)&&Pe(t,this.outerDeco)&&n.eq(this.innerDeco)}},{key:"size",get:function(){return this.node.nodeSize}},{key:"border",get:function(){return this.node.isLeaf?0:1}},{key:"updateChildren",value:function(e,t){var n=this,r=this.node.inlineContent,o=t,s=e.composing?this.localCompositionInfo(e,t):null,a=s&&s.pos>-1?s:null,l=s&&s.pos<0,u=new Fe(this,a&&a.node,e);!function(e,t,n,r){var i=t.locals(e),o=0;if(0!=i.length)for(var s=0,a=[],l=null,u=0;;){for(var c=void 0,h=void 0;s<i.length&&i[s].to==o;){var f=i[s++];f.widget&&(c?(h||(h=[c])).push(f):c=f)}if(c)if(h){h.sort(Be);for(var d=0;d<h.length;d++)n(h[d],u,!!l)}else n(c,u,!!l);var p=void 0,v=void 0;if(l)v=-1,p=l,l=null;else{if(!(u<e.childCount))break;v=u,p=e.child(u++)}for(var m=0;m<a.length;m++)a[m].to<=o&&a.splice(m--,1);for(;s<i.length&&i[s].from<=o&&i[s].to>o;)a.push(i[s++]);var y=o+p.nodeSize;if(p.isText){var g=y;s<i.length&&i[s].from<g&&(g=i[s].from);for(var k=0;k<a.length;k++)a[k].to<g&&(g=a[k].to);g<y&&(l=p.cut(g-o),p=p.cut(0,g-o),y=g,v=-1)}else for(;s<i.length&&i[s].to<y;)s++;r(p,p.isInline&&!p.isLeaf?a.filter((function(e){return!e.inline})):a.slice(),t.forChild(o,p),v),o=y}else for(var w=0;w<e.childCount;w++){var b=e.child(w);r(b,i,t.forChild(o,b),w),o+=b.nodeSize}}(this.node,this.innerDeco,(function(t,s,a){t.spec.marks?u.syncToMarks(t.spec.marks,r,e):t.type.side>=0&&!a&&u.syncToMarks(s==n.node.childCount?i.CU.none:n.node.child(s).marks,r,e),u.placeWidget(t,e,o)}),(function(t,n,i,a){var c;u.syncToMarks(t.marks,r,e),u.findNodeMatch(t,n,i,a)||l&&e.state.selection.from>o&&e.state.selection.to<o+t.nodeSize&&(c=u.findIndexWithChild(s.node))>-1&&u.updateNodeAt(t,n,i,c,e)||u.updateNextNode(t,n,i,e,a,o)||u.addNode(t,n,i,e,o),o+=t.nodeSize})),u.syncToMarks([],r,e),this.node.isTextblock&&u.addTextblockHacks(),u.destroyRest(),(u.changed||2==this.dirty)&&(a&&this.protectLocalComposition(e,a),Ne(this.contentDOM,this.children,e),K&&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))}},{key:"localCompositionInfo",value:function(e,t){var n=e.state.selection,i=n.from,o=n.to;if(!(e.state.selection instanceof r.U3)||i<t||o>t+this.node.content.size)return null;var s=e.input.compositionNode;if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){var a=s.nodeValue,l=function(e,t,n,r){for(var i=0,o=0;i<e.childCount&&o<=r;){var s=e.child(i++),a=o;if(o+=s.nodeSize,s.isText){for(var l=s.text;i<e.childCount;){var u=e.child(i++);if(o+=u.nodeSize,!u.isText)break;l+=u.text}if(o>=n){if(o>=r&&l.slice(r-t.length-a,r-a)==t)return r-t.length;var c=a<r?l.lastIndexOf(t,r-a-1):-1;if(c>=0&&c+t.length+a>=n)return a+c;if(n==r&&l.length>=r+t.length-a&&l.slice(r-a,r-a+t.length)==t)return r}}}return-1}(this.node.content,a,i-t,o-t);return l<0?null:{node:s,pos:l,text:a}}return{node:s,pos:-1,text:""}}},{key:"protectLocalComposition",value:function(e,t){var n=t.node,r=t.pos,i=t.text;if(!this.getDesc(n)){for(var o=n;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}var s=new we(this,o,n,i);e.input.compositionNodes.push(s),this.children=Ve(this.children,r,r+i.length,e,s)}}},{key:"update",value:function(e,t,n,r){return!(3==this.dirty||!e.sameMarkup(this.node)||(this.updateInner(e,t,n,r),0))}},{key:"updateInner",value:function(e,t,n,r){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=0}},{key:"updateOuterDeco",value:function(e){if(!Pe(e,this.outerDeco)){var t=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=Ae(this.dom,this.nodeDOM,Ee(this.outerDeco,this.node,t),Ee(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}}},{key:"selectNode",value:function(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.dom.draggable=!0)}},{key:"deselectNode",value:function(){1==this.nodeDOM.nodeType&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||this.dom.removeAttribute("draggable"))}},{key:"domAtom",get:function(){return this.node.isAtom}}],[{key:"create",value:function(e,n,r,o,s,a){var l,u=s.nodeViews[n.type.name],c=u&&u(n,s,(function(){return l?l.parent?l.parent.posBeforeChild(l):void 0:a}),r,o),h=c&&c.dom,f=c&&c.contentDOM;
1if(n.isText)if(h){if(3!=h.nodeType)throw new RangeError("Text must be rendered as a DOM text node")}else h=document.createTextNode(n.text);else if(!h){var d=i.ZF.renderSpec(document,n.type.spec.toDOM(n));h=d.dom,f=d.contentDOM}f||n.isText||"BR"==h.nodeName||(h.hasAttribute("contenteditable")||(h.contentEditable="false"),n.type.spec.draggable&&(h.draggable=!0));var p=h;return h=Ie(h,r,n),c?l=new Ce(e,n,r,o,h,f||null,p,c,s,a+1):n.isText?new Me(e,n,r,o,h,p,s):new t(e,n,r,o,h,f||null,p,s,a+1)}}])}(ge);function xe(e,t,n,r,i){Ie(r,t,e);var o=new Se(void 0,e,t,n,r,r,r,i,0);return o.contentDOM&&o.updateChildren(i,0),o}var Me=function(e){function t(e,n,r,i,o,s,a){return m(this,t),u(this,t,[e,n,r,i,o,null,s,a,0])}return d(t,e),g(t,[{key:"parseRule",value:function(){for(var e=this.nodeDOM.parentNode;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}},{key:"update",value:function(e,t,n,r){return!(3==this.dirty||0!=this.dirty&&!this.inParent()||!e.sameMarkup(this.node)||(this.updateOuterDeco(t),0==this.dirty&&e.text==this.node.text||e.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=e.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=e,this.dirty=0,0))}},{key:"inParent",value:function(){for(var e=this.parent.contentDOM,t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}},{key:"domFromPos",value:function(e){return{node:this.nodeDOM,offset:e}}},{key:"localPosFromDOM",value:function(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):h(f(t.prototype),"localPosFromDOM",this).call(this,e,n,r)}},{key:"ignoreMutation",value:function(e){return"characterData"!=e.type&&"selection"!=e.type}},{key:"slice",value:function(e,n,r){var i=this.node.cut(e,n),o=document.createTextNode(i.text);return new t(this.parent,i,this.outerDeco,this.innerDeco,o,o,r)}},{key:"markDirty",value:function(e,n){h(f(t.prototype),"markDirty",this).call(this,e,n),this.dom==this.nodeDOM||0!=e&&n!=this.nodeDOM.nodeValue.length||(this.dirty=3)}},{key:"domAtom",get:function(){return!1}},{key:"isText",value:function(e){return this.node.text==e}}])}(Se),Oe=function(e){function t(){return m(this,t),u(this,t,arguments)}return d(t,e),g(t,[{key:"parseRule",value:function(){return{ignore:!0}}},{key:"matchesHack",value:function(e){return 0==this.dirty&&this.dom.nodeName==e}},{key:"domAtom",get:function(){return!0}},{key:"ignoreForCoords",get:function(){return"IMG"==this.dom.nodeName}}])}(ge),Ce=function(e){function t(e,n,r,i,o,s,a,l,c,h){var f;return m(this,t),(f=u(this,t,[e,n,r,i,o,s,a,c,h])).spec=l,f}return d(t,e),g(t,[{key:"update",value:function(e,n,r,i){if(3==this.dirty)return!1;if(this.spec.update){var o=this.spec.update(e,n,r);return o&&this.updateInner(e,n,r,i),o}return!(!this.contentDOM&&!e.isLeaf)&&h(f(t.prototype),"update",this).call(this,e,n,r,i)}},{key:"selectNode",value:function(){this.spec.selectNode?this.spec.selectNode():h(f(t.prototype),"selectNode",this).call(this)}},{key:"deselectNode",value:function(){this.spec.deselectNode?this.spec.deselectNode():h(f(t.prototype),"deselectNode",this).call(this)}},{key:"setSelection",value:function(e,n,r,i){this.spec.setSelection?this.spec.setSelection(e,n,r):h(f(t.prototype),"setSelection",this).call(this,e,n,r,i)}},{key:"destroy",value:function(){this.spec.destroy&&this.spec.destroy(),h(f(t.prototype),"destroy",this).call(this)}},{key:"stopEvent",value:function(e){return!!this.spec.stopEvent&&this.spec.stopEvent(e)}},{key:"ignoreMutation",value:function(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):h(f(t.prototype),"ignoreMutation",this).call(this,e)}}])}(Se);function Ne(e,t,n){for(var r=e.firstChild,i=!1,o=0;o<t.length;o++){var s=t[o],a=s.dom;if(a.parentNode==e){for(;a!=r;)r=ze(r),i=!0;r=r.nextSibling}else i=!0,e.insertBefore(a,r);if(s instanceof be){var l=r?r.previousSibling:e.lastChild;Ne(s.contentDOM,s.children,n),r=l?l.nextSibling:e.firstChild}}for(;r;)r=ze(r),i=!0;i&&n.trackWrites==e&&(n.trackWrites=null)}var De=function(e){e&&(this.nodeName=e)};De.prototype=Object.create(null);var Te=[new De];function Ee(e,t,n){if(0==e.length)return Te;for(var r=n?Te[0]:new De,i=[r],o=0;o<e.length;o++){var s=e[o].type.attrs;if(s)for(var a in s.nodeName&&i.push(r=new De(s.nodeName)),s){var l=s[a];null!=l&&(n&&1==i.length&&i.push(r=new De(t.isInline?"span":"div")),"class"==a?r.class=(r.class?r.class+" ":"")+l:"style"==a?r.style=(r.style?r.style+";":"")+l:"nodeName"!=a&&(r[a]=l))}}return i}function Ae(e,t,n,r){if(n==Te&&r==Te)return t;for(var i=t,o=0;o<r.length;o++){var s=r[o],a=n[o];if(o){var l=void 0;a&&a.nodeName==s.nodeName&&i!=e&&(l=i.parentNode)&&l.nodeName.toLowerCase()==s.nodeName||((l=document.createElement(s.nodeName)).pmIsDeco=!0,l.appendChild(i),a=Te[0]),i=l}Re(i,a||Te[0],s)}return i}function Re(e,t,n){for(var r in t)"class"==r||"style"==r||"nodeName"==r||r in n||e.removeAttribute(r);for(var i in n)"class"!=i&&"style"!=i&&"nodeName"!=i&&n[i]!=t[i]&&e.setAttribute(i,n[i]);if(t.class!=n.class){for(var o=t.class?t.class.split(" ").filter(
1Boolean):[],s=n.class?n.class.split(" ").filter(Boolean):[],a=0;a<o.length;a++)-1==s.indexOf(o[a])&&e.classList.remove(o[a]);for(var l=0;l<s.length;l++)-1==o.indexOf(s[l])&&e.classList.add(s[l]);0==e.classList.length&&e.removeAttribute("class")}if(t.style!=n.style){if(t.style)for(var u,c=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g;u=c.exec(t.style);)e.style.removeProperty(u[1]);n.style&&(e.style.cssText+=n.style)}}function Ie(e,t,n){return Ae(e,e,Te,Ee(t,n,1!=e.nodeType))}function Pe(e,t){if(e.length!=t.length)return!1;for(var n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function ze(e){var t=e.nextSibling;return e.parentNode.removeChild(e),t}var Fe=function(){return g((function e(t,n,r){m(this,e),this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=t,this.preMatch=function(e,t){var n=t,r=n.children.length,i=e.childCount,o=new Map,s=[];e:for(;i>0;){for(var a=void 0;;)if(r){var l=n.children[r-1];if(!(l instanceof be)){a=l,r--;break}n=l,r=l.children.length}else{if(n==t)break e;r=n.parent.children.indexOf(n),n=n.parent}var u=a.node;if(u){if(u!=e.child(i-1))break;--i,o.set(a,i),s.push(a)}}return{index:i,matched:o,matches:s.reverse()}}(t.node.content,t)}),[{key:"destroyBetween",value:function(e,t){if(e!=t){for(var n=e;n<t;n++)this.top.children[n].destroy();this.top.children.splice(e,t-e),this.changed=!0}}},{key:"destroyRest",value:function(){this.destroyBetween(this.index,this.top.children.length)}},{key:"syncToMarks",value:function(e,t,n){for(var r=0,i=this.stack.length>>1,o=Math.min(i,e.length);r<o&&(r==i-1?this.top:this.stack[r+1<<1]).matchesMark(e[r])&&!1!==e[r].type.spec.spanning;)r++;for(;r<i;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),i--;for(;i<e.length;){this.stack.push(this.top,this.index+1);for(var s=-1,a=this.index;a<Math.min(this.index+3,this.top.children.length);a++){var l=this.top.children[a];if(l.matchesMark(e[i])&&!this.isLocked(l.dom)){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 u=be.create(this.top,e[i],t,n);this.top.children.splice(this.index,0,u),this.top=u,this.changed=!0}this.index=0,i++}}},{key:"findNodeMatch",value:function(e,t,n,r){var i,o=-1;if(r>=this.preMatch.index&&(i=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&i.matchesNode(e,t,n))o=this.top.children.indexOf(i,this.index);else for(var s=this.index,a=Math.min(this.top.children.length,s+5);s<a;s++){var l=this.top.children[s];if(l.matchesNode(e,t,n)&&!this.preMatch.matched.has(l)){o=s;break}}return!(o<0||(this.destroyBetween(this.index,o),this.index++,0))}},{key:"updateNodeAt",value:function(e,t,n,r,i){var o=this.top.children[r];return 3==o.dirty&&o.dom==o.contentDOM&&(o.dirty=2),!!o.update(e,t,n,i)&&(this.destroyBetween(this.index,r),this.index++,!0)}},{key:"findIndexWithChild",value:function(e){for(;;){var t=e.parentNode;if(!t)return-1;if(t==this.top.contentDOM){var n=e.pmViewDesc;if(n)for(var r=this.index;r<this.top.children.length;r++)if(this.top.children[r]==n)return r;return-1}e=t}}},{key:"updateNextNode",value:function(e,t,n,r,i,o){for(var s=this.index;s<this.top.children.length;s++){var a=this.top.children[s];if(a instanceof Se){var l=this.preMatch.matched.get(a);if(null!=l&&l!=i)return!1;var u=a.dom,c=void 0,h=this.isLocked(u)&&!(e.isText&&a.node&&a.node.isText&&a.nodeDOM.nodeValue==e.text&&3!=a.dirty&&Pe(t,a.outerDeco));if(!h&&a.update(e,t,n,r))return this.destroyBetween(this.index,s),a.dom!=u&&(this.changed=!0),this.index++,!0;if(!h&&(c=this.recreateWrapper(a,e,t,n,r,o)))return this.top.children[this.index]=c,c.contentDOM&&(c.dirty=2,c.updateChildren(r,o+1),c.dirty=0),this.changed=!0,this.index++,!0;break}}return!1}},{key:"recreateWrapper",value:function(e,t,n,r,i,o){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content))return null;var a=Se.create(this.top,t,n,r,i,o);if(a.contentDOM){a.children=e.children,e.children=[];var l,u=s(a.children);try{for(u.s();!(l=u.n()).done;)l.value.parent=a}catch(e){u.e(e)}finally{u.f()}}return e.destroy(),a}},{key:"addNode",value:function(e,t,n,r,i){var o=Se.create(this.top,e,t,n,r,i);o.contentDOM&&o.updateChildren(r,i+1),this.top.children.splice(this.index++,0,o),this.changed=!0}},{key:"placeWidget",value:function(e,t,n){var r=this.index<this.top.children.length?this.top.children[this.index]:null;if(!r||!r.matchesWidget(e)||e!=r.widget&&r.widget.type.toDOM.parentNode){var i=new ke(this.top,e,t,n);this.top.children.splice(this.index++,0,i),this.changed=!0}else this.index++}},{key:"addTextblockHacks",value:function(){for(var e=this.top.children[this.index-1],t=this.top;e instanceof be;)e=(t=e).children[t.children.length-1];(!e||!(e instanceof Me)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((L||J)&&e&&"false"==e.dom.contentEditable&&this.addHackNode("IMG",t),this.addHackNode("BR",this.top))}},{key:"addHackNode",value:function(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{var n=document.createElement(e);"IMG"==e&&(n.className="ProseMirror-separator",n.alt=""),"BR"==e&&(n.className="ProseMirror-trailingBreak");var r=new Oe(this.top,[],n,null);t!=this.top?t.children.push(r):t.children.splice(this.index++,0,r),this.changed=!0}}},{key:"isLocked",value:function(e){return this.lock&&(e==this.lock||
11==e.nodeType&&e.contains(this.lock.parentNode))}}])}();function Be(e,t){return e.type.side-t.type.side}function Ve(e,t,n,r,i){for(var o=[],s=0,a=0;s<e.length;s++){var l=e[s],u=a,c=a+=l.size;u>=n||c<=t?o.push(l):(u<t&&o.push(l.slice(0,t-u,r)),i&&(o.push(i),i=void 0),c>n&&o.push(l.slice(n-u,l.size,r)))}return o}function qe(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=e.domSelectionRange(),i=e.state.doc;if(!n.focusNode)return null;var o=e.docView.nearestDesc(n.focusNode),s=o&&0==o.size,a=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(a<0)return null;var l,u,c=i.resolve(a);if(T(n)){for(l=c;o&&!o.node;)o=o.parent;var h=o.node;if(o&&h.isAtom&&r.nh.isSelectable(h)&&o.parent&&(!h.isInline||!function(e,t,n){for(var r=0==t,i=t==N(e);r||i;){if(e==n)return!0;var o=w(e);if(!(e=e.parentNode))return!1;r=r&&0==o,i=i&&o==N(e)}}(n.focusNode,n.focusOffset,o.dom))){var f=o.posBefore;u=new r.nh(a==f?c:i.resolve(f))}}else{var d=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(d<0)return null;l=i.resolve(d)}return u||(u=He(e,l,c,"pointer"==t||e.state.selection.head<c.pos&&!s?1:-1)),u}function $e(e){return e.editable?e.hasFocus():Xe(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function Je(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.state.selection;if(We(e,n),$e(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&J){var i=e.domSelectionRange(),o=e.domObserver.currentSelection;if(i.anchorNode&&o.anchorNode&&M(i.anchorNode,i.anchorOffset,o.anchorNode,o.anchorOffset))return e.input.mouseDown.delayedSelectionSync=!0,void e.domObserver.setCurSelection()}if(e.domObserver.disconnectSelection(),e.cursorWrapper)!function(e){var t=e.domSelection(),n=document.createRange(),r=e.cursorWrapper.dom,i="IMG"==r.nodeName;i?n.setEnd(r.parentNode,w(r)+1):n.setEnd(r,0),n.collapse(!1),t.removeAllRanges(),t.addRange(n),!i&&!e.state.selection.visible&&B&&V<=11&&(r.disabled=!0,r.disabled=!1)}(e);else{var s,a,l=n.anchor,u=n.head;!je||n instanceof r.U3||(n.$from.parent.inlineContent||(s=Le(e,n.from)),n.empty||n.$from.parent.inlineContent||(a=Le(e,n.to))),e.docView.setSelection(l,u,e.root,t),je&&(s&&_e(s),a&&_e(a)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&function(e){var t=e.dom.ownerDocument;t.removeEventListener("selectionchange",e.input.hideSelectionGuard);var n=e.domSelectionRange(),r=n.anchorNode,i=n.anchorOffset;t.addEventListener("selectionchange",e.input.hideSelectionGuard=function(){n.anchorNode==r&&n.anchorOffset==i||(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout((function(){$e(e)&&!e.state.selection.visible||e.dom.classList.remove("ProseMirror-hideselection")}),20))})}(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}var je=L||J&&j<63;function Le(e,t){var n=e.docView.domFromPos(t,0),r=n.node,i=n.offset,o=i<r.childNodes.length?r.childNodes[i]:null,s=i?r.childNodes[i-1]:null;if(L&&o&&"false"==o.contentEditable)return Ke(o);if(!(o&&"false"!=o.contentEditable||s&&"false"!=s.contentEditable)){if(o)return Ke(o);if(s)return Ke(s)}}function Ke(e){return e.contentEditable="true",L&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function _e(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function We(e,t){if(t instanceof r.nh){var n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(Ue(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else Ue(e)}function Ue(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function He(e,t,n,i){return e.someProp("createSelectionBetween",(function(r){return r(e,t,n)}))||r.U3.between(t,n,i)}function Ge(e){return!(e.editable&&!e.hasFocus())&&Xe(e)}function Xe(e){var 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 Ze(e,t){var n=e.selection,i=n.$anchor,o=n.$head,s=t>0?i.max(o):i.min(o),a=s.parent.inlineContent?s.depth?e.doc.resolve(t>0?s.after():s.before()):null:s;return a&&r.LN.findFrom(a,t)}function Ye(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function Qe(e,t,n){var i=e.state.selection;if(!(i instanceof r.U3)){if(i instanceof r.nh&&i.node.isInline)return Ye(e,new r.U3(t>0?i.$to:i.$from));var o=Ze(e.state,t);return!!o&&Ye(e,o)}if(n.indexOf("s")>-1){var s=i.$head,a=s.textOffset?null:t<0?s.nodeBefore:s.nodeAfter;if(!a||a.isText||!a.isLeaf)return!1;var l=e.state.doc.resolve(s.pos+a.nodeSize*(t<0?-1:1));return Ye(e,new r.U3(i.$anchor,l))}if(!i.empty)return!1;if(e.endOfTextblock(t>0?"forward":"backward")){var u=Ze(e.state,t);return!!(u&&u instanceof r.nh)&&Ye(e,u)}if(!(_&&n.indexOf("m")>-1)){var c,h=i.$head,f=h.textOffset?null:t<0?h.nodeBefore:h.nodeAfter;if(!f||f.isText)return!1;var d=t<0?h.pos-f.nodeSize:h.pos;return!!(f.isAtom||(c=e.docView.descAt(d))&&!c.contentDOM)&&(r.nh.isSelectable(f)?Ye(e,new r.nh(t<0?e.state.doc.resolve(h.pos-f.nodeSize):h)):!!H&&Ye(e,new r.U3(e.state.doc.resolve(t<0?d:d+f.nodeSize))))}}function et(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function tt(e,t){var n=e.pmViewDesc;return n&&0==n.size&&(t<0||e.nextSibling||"BR"!=e.nodeName)}function nt(e,t){return t<0?function(e){var t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(n){var i,o,s=!1;for(q&&1==n.nodeType&&r<et(n)&&tt(n.childNodes[r],-1)&&(s=!0);;)if(r>0){if(1!=n.nodeType)break;var a=n.childNodes[r-1];if(tt(a,-1))i=n,o=--r;else{if(3!=a.nodeType)break;r=(n=a).nodeValue.length}}else{if(rt(n))break;for(var l=n.previousSibling;l&&tt(l,-1);)i=n.parentNode,o=w(l),l=l.previousSibling;if(l)r=et(n=l);else{if((n=n.parentNode)==e.dom)break;r=0}}s?it(e,n,r):i&&it(e,i,o)}}(e):function(e){var t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(n){for(var i,o,s=et(n);;)if(r<s){if(1!=n.nodeType)break;if(!tt(n.childNodes[r],1))break;i=n,o=++r}else{if(rt(n))break;for(var a=n.nextSibling;a&&tt(a,1);)i=a.parentNode,o=w(a)+1,a=a.nextSibling;if(a)r=0,s=et(n=a);else{if((n=n.parentNode)==e.dom)break;r=s=0}}i&&it(e,i,o)}}(e)}function rt(e){var t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function it(e,t,n){var r,i;3!=t.nodeType&&((i=function(e,t){for(;e&&t==e.childNodes.length&&!D(e);)t=w(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){var n=e.childNodes[t];
1if(3==n.nodeType)return n;if(1==n.nodeType&&"false"==n.contentEditable)break;e=n,t=0}}(t,n))?(t=i,n=0):(r=function(e,t){for(;e&&!t&&!D(e);)t=w(e),e=e.parentNode;for(;e&&t;){var n=e.childNodes[t-1];if(3==n.nodeType)return n;if(1==n.nodeType&&"false"==n.contentEditable)break;t=(e=n).childNodes.length}}(t,n))&&(t=r,n=r.nodeValue.length));var o=e.domSelection();if(T(o)){var s=document.createRange();s.setEnd(t,n),s.setStart(t,n),o.removeAllRanges(),o.addRange(s)}else o.extend&&o.extend(t,n);e.domObserver.setCurSelection();var a=e.state;setTimeout((function(){e.state==a&&Je(e)}),50)}function ot(e,t){var n=e.state.doc.resolve(t);if(!J&&!W&&n.parent.inlineContent){var r=e.coordsAtPos(t);if(t>n.start()){var i=e.coordsAtPos(t-1),o=(i.top+i.bottom)/2;if(o>r.top&&o<r.bottom&&Math.abs(i.left-r.left)>1)return i.left<r.left?"ltr":"rtl"}if(t<n.end()){var s=e.coordsAtPos(t+1),a=(s.top+s.bottom)/2;if(a>r.top&&a<r.bottom&&Math.abs(s.left-r.left)>1)return s.left>r.left?"ltr":"rtl"}}return"rtl"==getComputedStyle(e.dom).direction?"rtl":"ltr"}function st(e,t,n){var i=e.state.selection;if(i instanceof r.U3&&!i.empty||n.indexOf("s")>-1)return!1;if(_&&n.indexOf("m")>-1)return!1;var o=i.$from,s=i.$to;if(!o.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){var a=Ze(e.state,t);if(a&&a instanceof r.nh)return Ye(e,a)}if(!o.parent.inlineContent){var l=t<0?o:s,u=i instanceof r.i5?r.LN.near(l,t):r.LN.findFrom(l,t);return!!u&&Ye(e,u)}return!1}function at(e,t){if(!(e.state.selection instanceof r.U3))return!0;var n=e.state.selection,i=n.$head,o=n.$anchor,s=n.empty;if(!i.sameParent(o))return!0;if(!s)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;var a=!i.textOffset&&(t<0?i.nodeBefore:i.nodeAfter);if(a&&!a.isText){var l=e.state.tr;return t<0?l.delete(i.pos-a.nodeSize,i.pos):l.delete(i.pos,i.pos+a.nodeSize),e.dispatch(l),!0}return!1}function lt(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function ut(e,t){e.someProp("transformCopied",(function(n){t=n(t,e)}));for(var n=[],r=t,o=r.content,s=r.openStart,a=r.openEnd;s>1&&a>1&&1==o.childCount&&1==o.firstChild.childCount;){s--,a--;var l=o.firstChild;n.push(l.type.name,l.attrs!=l.type.defaultAttrs?l.attrs:null),o=l.content}var u=e.someProp("clipboardSerializer")||i.ZF.fromSchema(e.state.schema),c=kt(),h=c.createElement("div");h.appendChild(u.serializeFragment(o,{document:c}));for(var f,d=h.firstChild,p=0;d&&1==d.nodeType&&(f=yt[d.nodeName.toLowerCase()]);){for(var v=f.length-1;v>=0;v--){for(var m=c.createElement(f[v]);h.firstChild;)m.appendChild(h.firstChild);h.appendChild(m),p++}d=h.firstChild}return d&&1==d.nodeType&&d.setAttribute("data-pm-slice","".concat(s," ").concat(a).concat(p?" -".concat(p):""," ").concat(JSON.stringify(n))),{dom:h,text:e.someProp("clipboardTextSerializer",(function(n){return n(t,e)}))||t.content.textBetween(0,t.content.size,"\n\n"),slice:t}}function ct(e,t,n,r,o){var s,a,l=o.parent.type.spec.code;if(!n&&!t)return null;var u=t&&(r||l||!n);if(u){if(e.someProp("transformPastedText",(function(n){t=n(t,l||r,e)})),l)return t?new i.Ji(i.FK.from(e.state.schema.text(t.replace(/\r\n?/g,"\n"))),0,0):i.Ji.empty;var c=e.someProp("clipboardTextParser",(function(n){return n(t,o,r,e)}));if(c)a=c;else{var h=o.marks(),f=e.state.schema,d=i.ZF.fromSchema(f);s=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach((function(e){var t=s.appendChild(document.createElement("p"));e&&t.appendChild(d.serializeNode(f.text(e,h)))}))}}else e.someProp("transformPastedHTML",(function(t){n=t(n,e)})),s=function(e){var t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));var n,r=kt().createElement("div"),i=/<([a-z][^>\s]+)/i.exec(e);if((n=i&&yt[i[1].toLowerCase()])&&(e=n.map((function(e){return"<"+e+">"})).join("")+e+n.map((function(e){return"</"+e+">"})).reverse().join("")),r.innerHTML=e,n)for(var o=0;o<n.length;o++)r=r.querySelector(n[o])||r;return r}(n),H&&function(e){for(var t=e.querySelectorAll(J?"span:not([class]):not([style])":"span.Apple-converted-space"),n=0;n<t.length;n++){var r=t[n];1==r.childNodes.length&&" "==r.textContent&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),r)}}(s);var p=s&&s.querySelector("[data-pm-slice]"),v=p&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(p.getAttribute("data-pm-slice")||"");if(v&&v[3])for(var m=+v[3];m>0;m--){for(var y=s.firstChild;y&&1!=y.nodeType;)y=y.nextSibling;if(!y)break;s=y}if(!a){var g=e.someProp("clipboardParser")||e.someProp("domParser")||i.S4.fromSchema(e.state.schema);a=g.parseSlice(s,{preserveWhitespace:!(!u&&!v),context:o,ruleFromNode:function(e){return"BR"!=e.nodeName||e.nextSibling||!e.parentNode||ht.test(e.parentNode.nodeName)?null:{ignore:!0}}})}if(v)a=function(e,t){if(!e.size)return e;var n,r=e.content.firstChild.type.schema;try{n=JSON.parse(t)}catch(t){return e}for(var o=e.content,s=e.openStart,a=e.openEnd,l=n.length-2;l>=0;l-=2){var u=r.nodes[n[l]];if(!u||u.hasRequiredAttrs())break;o=i.FK.from(u.create(n[l+1],o)),s++,a++}return new i.Ji(o,s,a)}(mt(a,+v[1],+v[2]),v[4]);else if(a=i.Ji.maxOpen(function(e,t){if(e.childCount<2)return e;
1for(var n,r=function(){var n,r=t.node(o).contentMatchAt(t.index(o)),s=[];if(e.forEach((function(e){if(s){var t,i=r.findWrapping(e.type);if(!i)return s=null;if(t=s.length&&n.length&&dt(i,n,e,s[s.length-1],0))s[s.length-1]=t;else{s.length&&(s[s.length-1]=pt(s[s.length-1],n.length));var o=ft(e,i);s.push(o),r=r.matchType(o.type),n=i}}})),s)return{v:i.FK.from(s)}},o=t.depth;o>=0;o--)if(n=r())return n.v;return e}(a.content,o),!0),a.openStart||a.openEnd){for(var k=0,w=0,b=a.content.firstChild;k<a.openStart&&!b.type.spec.isolating;k++,b=b.firstChild);for(var S=a.content.lastChild;w<a.openEnd&&!S.type.spec.isolating;w++,S=S.lastChild);a=mt(a,k,w)}return e.someProp("transformPasted",(function(t){a=t(a,e)})),a}var ht=/^(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 ft(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=t.length-1;r>=n;r--)e=t[r].create(null,i.FK.from(e));return e}function dt(e,t,n,r,o){if(o<e.length&&o<t.length&&e[o]==t[o]){var s=dt(e,t,n,r.lastChild,o+1);if(s)return r.copy(r.content.replaceChild(r.childCount-1,s));if(r.contentMatchAt(r.childCount).matchType(o==e.length-1?n.type:e[o+1]))return r.copy(r.content.append(i.FK.from(ft(n,e,o+1))))}}function pt(e,t){if(0==t)return e;var n=e.content.replaceChild(e.childCount-1,pt(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(i.FK.empty,!0);return e.copy(n.append(r))}function vt(e,t,n,r,o,s){var a=t<0?e.firstChild:e.lastChild,l=a.content;return e.childCount>1&&(s=0),o<r-1&&(l=vt(l,t,n,r,o+1,s)),o>=n&&(l=t<0?a.contentMatchAt(0).fillBefore(l,s<=o).append(l):l.append(a.contentMatchAt(a.childCount).fillBefore(i.FK.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,a.copy(l))}function mt(e,t,n){return t<e.openStart&&(e=new i.Ji(vt(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new i.Ji(vt(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}var yt={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]},gt=null;function kt(){return gt||(gt=document.implementation.createHTMLDocument("title"))}var wt={},bt={},St={touchstart:!0,touchmove:!0},xt=g((function e(){m(this,e),this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastAndroidDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}));function Mt(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function Ot(e){e.someProp("handleDOMEvents",(function(t){for(var n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=function(t){return Ct(e,t)})}))}function Ct(e,t){return e.someProp("handleDOMEvents",(function(n){var r=n[t.type];return!!r&&(r(e,t)||t.defaultPrevented)}))}function Nt(e){return{left:e.clientX,top:e.clientY}}function Dt(e,t,n,r,i){if(-1==r)return!1;for(var o,s=e.state.doc.resolve(r),a=function(r){if(e.someProp(t,(function(t){return r>s.depth?t(e,n,s.nodeAfter,s.before(r),i,!0):t(e,n,s.node(r),s.before(r),i,!1)})))return{v:!0}},l=s.depth+1;l>0;l--)if(o=a(l))return o.v;return!1}function Tt(e,t,n){e.focused||e.focus();var r=e.state.tr.setSelection(t);"pointer"==n&&r.setMeta("pointer",!0),e.dispatch(r)}function Et(e,t,n,r){return Dt(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",(function(n){return n(e,t,r)}))}function At(e,t,n,i){return Dt(e,"handleTripleClickOn",t,n,i)||e.someProp("handleTripleClick",(function(n){return n(e,t,i)}))||function(e,t,n){if(0!=n.button)return!1;var i=e.state.doc;if(-1==t)return!!i.inlineContent&&(Tt(e,r.U3.create(i,0,i.content.size),"pointer"),!0);for(var o=i.resolve(t),s=o.depth+1;s>0;s--){var a=s>o.depth?o.nodeAfter:o.node(s),l=o.before(s);if(a.inlineContent)Tt(e,r.U3.create(i,l+1,l+1+a.content.size),"pointer");else{if(!r.nh.isSelectable(a))continue;Tt(e,r.nh.create(i,l),"pointer")}return!0}}(e,n,i)}function Rt(e){return qt(e)}bt.keydown=function(e,t){var n=t;if(e.input.shiftKey=16==n.keyCode||n.shiftKey,!zt(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!U||!J||13!=n.keyCode))if(229!=n.keyCode&&e.domObserver.forceFlush(),!K||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)e.someProp("handleKeyDown",(function(t){return t(e,n)}))||function(e,t){var n=t.keyCode,r=function(e){var t="";
1return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}(t);if(8==n||_&&72==n&&"c"==r)return at(e,-1)||nt(e,-1);if(46==n&&!t.shiftKey||_&&68==n&&"c"==r)return at(e,1)||nt(e,1);if(13==n||27==n)return!0;if(37==n||_&&66==n&&"c"==r){var i=37==n?"ltr"==ot(e,e.state.selection.from)?-1:1:-1;return Qe(e,i,r)||nt(e,i)}if(39==n||_&&70==n&&"c"==r){var o=39==n?"ltr"==ot(e,e.state.selection.from)?1:-1:1;return Qe(e,o,r)||nt(e,o)}return 38==n||_&&80==n&&"c"==r?st(e,-1,r)||nt(e,-1):40==n||_&&78==n&&"c"==r?function(e){if(!L||e.state.selection.$head.parentOffset>0)return!1;var t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(n&&1==n.nodeType&&0==r&&n.firstChild&&"false"==n.firstChild.contentEditable){var i=n.firstChild;lt(e,i,"true"),setTimeout((function(){return lt(e,i,"false")}),20)}return!1}(e)||st(e,1,r)||nt(e,1):r==(_?"m":"c")&&(66==n||73==n||89==n||90==n)}(e,n)?n.preventDefault():Mt(e,"key");else{var r=Date.now();e.input.lastIOSEnter=r,e.input.lastIOSEnterFallbackTimeout=setTimeout((function(){e.input.lastIOSEnter==r&&(e.someProp("handleKeyDown",(function(t){return t(e,E(13,"Enter"))})),e.input.lastIOSEnter=0)}),200)}}
1,bt.keyup=function(e,t){16==t.keyCode&&(e.input.shiftKey=!1)},bt.keypress=function(e,t){var n=t;if(!(zt(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||_&&n.metaKey))if(e.someProp("handleKeyPress",(function(t){return t(e,n)})))n.preventDefault();else{var i=e.state.selection;if(!(i instanceof r.U3&&i.$from.sameParent(i.$to))){var o=String.fromCharCode(n.charCode);/[\r\n]/.test(o)||e.someProp("handleTextInput",(function(t){return t(e,i.$from.pos,i.$to.pos,o)}))||e.dispatch(e.state.tr.insertText(o).scrollIntoView()),n.preventDefault()}}};var It=_?"metaKey":"ctrlKey";wt.mousedown=function(e,t){var n=t;e.input.shiftKey=n.shiftKey;var r=Rt(e),i=Date.now(),o="singleClick";i-e.input.lastClick.time<500&&function(e,t){var n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}(n,e.input.lastClick)&&!n[It]&&("singleClick"==e.input.lastClick.type?o="doubleClick":"doubleClick"==e.input.lastClick.type&&(o="tripleClick")),e.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:o};var s=e.posAtCoords(Nt(n));s&&("singleClick"==o?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new Pt(e,s,n,!!r)):("doubleClick"==o?Et:At)(e,s.pos,s.inside,n)?n.preventDefault():Mt(e,"pointer"))};var Pt=function(){return g((function e(t,n,i,o){var s,a,l=this;if(m(this,e),this.view=t,this.pos=n,this.event=i,this.flushed=o,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=t.state.doc,this.selectNode=!!i[It],this.allowDefault=i.shiftKey,n.inside>-1)s=t.state.doc.nodeAt(n.inside),a=n.inside;else{var u=t.state.doc.resolve(n.pos);s=u.parent,a=u.depth?u.before():0}var c=o?null:i.target,h=c?t.docView.nearestDesc(c,!0):null;this.target=h&&1==h.dom.nodeType?h.dom:null;var f=t.state.selection;(0==i.button&&s.type.spec.draggable&&!1!==s.type.spec.selectable||f instanceof r.nh&&f.from<=a&&f.to>a)&&(this.mightDrag={node:s,pos:a,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!q||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(){l.view.input.mouseDown==l&&l.target.setAttribute("contentEditable","false")}),20),this.view.domObserver.start()),t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),Mt(t,"pointer")}),[{key:"done",value: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 Je(e.view)})),this.view.input.mouseDown=null}},{key:"up",value:function(e){if(this.done(),this.view.dom.contains(e.target)){var t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(Nt(e))),this.updateAllowDefault(e),this.allowDefault||!t?Mt(this.view,"pointer"):function(e,t,n,i,o){return Dt(e,"handleClickOn",t,n,i)||e.someProp("handleClick",(function(n){return n(e,t,i)}))||(o?function(e,t){if(-1==t)return!1;var n,i,o=e.state.selection;o instanceof r.nh&&(n=o.node);for(var s=e.state.doc.resolve(t),a=s.depth+1;a>0;a--){var l=a>s.depth?s.nodeAfter:s.node(a);if(r.nh.isSelectable(l)){i=n&&o.$from.depth>0&&a>=o.$from.depth&&s.before(o.$from.depth+1)==o.$from.pos?s.before(o.$from.depth):s.before(a);break}}return null!=i&&(Tt(e,r.nh.create(e.state.doc,i),"pointer"),!0)}(e,n):function(e,t){if(-1==t)return!1;var n=e.state.doc.resolve(t),i=n.nodeAfter;return!!(i&&i.isAtom&&r.nh.isSelectable(i))&&(Tt(e,new r.nh(n),"pointer"),!0)}(e,n))}(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():0==e.button&&(this.flushed||L&&this.mightDrag&&!this.mightDrag.node.isAtom||J&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(Tt(this.view,r.LN.near
1(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):Mt(this.view,"pointer")}}},{key:"move",value:function(e){this.updateAllowDefault(e),Mt(this.view,"pointer"),0==e.buttons&&this.done()}},{key:"updateAllowDefault",value:function(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}])}();function zt(e,t){return!!e.composing||!!(L&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500)&&(e.input.compositionEndedAt=-2e8,!0)}wt.touchstart=function(e){e.input.lastTouch=Date.now(),Rt(e),Mt(e,"pointer")},wt.touchmove=function(e){e.input.lastTouch=Date.now(),Mt(e,"pointer")},wt.contextmenu=function(e){return Rt(e)};var Ft=U?5e3:-1;function Bt(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout((function(){return qt(e)}),t))}function Vt(e){var t;for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=((t=document.createEvent("Event")).initEvent("event",!0,!0),t.timeStamp));e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function qt(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!(U&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),Vt(e),t||e.docView&&e.docView.dirty){var n=qe(e);return n&&!n.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(n)):e.updateState(e.state),!0}return!1}}bt.compositionstart=bt.compositionupdate=function(e){if(!e.composing){e.domObserver.flush();var t=e.state,n=t.selection.$from;if(t.selection.empty&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some((function(e){return!1===e.type.spec.inclusive}))))e.markCursor=e.state.storedMarks||n.marks(),qt(e,!0),e.markCursor=null;else if(qt(e),q&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length)for(var r=e.domSelectionRange(),i=r.focusNode,o=r.focusOffset;i&&1==i.nodeType&&0!=o;){var s=o<0?i.lastChild:i.childNodes[o-1];if(!s)break;if(3==s.nodeType){e.domSelection().collapse(s,s.nodeValue.length);break}i=s,o=-1}e.input.composing=!0}Bt(e,Ft)},bt.compositionend=function(e,t){e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.compositionPendingChanges&&Promise.resolve().then((function(){return e.domObserver.flush()})),e.input.compositionID++,Bt(e,20))};var $t=B&&V<15||K&&G<604;function Jt(e,t,n,r,o){var s=ct(e,t,n,r,e.state.selection.$from);if(e.someProp("handlePaste",(function(t){return t(e,o,s||i.Ji.empty)})))return!0;if(!s)return!1;var a=function(e){return 0==e.openStart&&0==e.openEnd&&1==e.content.childCount?e.content.firstChild:null}(s),l=a?e.state.tr.replaceSelectionWith(a,r):e.state.tr.replaceSelection(s);return e.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function jt(e){var t=e.getData("text/plain")||e.getData("Text");if(t)return t;var n=e.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}wt.copy=bt.cut=function(e,t){var n=t,r=e.state.selection,i="cut"==n.type;if(!r.empty){var o=$t?null:n.clipboardData,s=ut(e,r.content()),a=s.dom,l=s.text;o?(n.preventDefault(),o.clearData(),o.setData("text/html",a.innerHTML),o.setData("text/plain",l)):function(e,t){if(e.dom.parentNode){var n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";var r=getSelection(),i=document.createRange();i.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout((function(){n.parentNode&&n.parentNode.removeChild(n),e.focus()}),50)}}(e,a),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))}},bt.paste=function(e,t){var n=t;if(!e.composing||U){var r=$t?null:n.clipboardData,i=e.input.shiftKey&&45!=e.input.lastKeyCode;r&&Jt(e,jt(r),r.getData("text/html"),i,n)?n.preventDefault():function(e,t){if(e.dom.parentNode){var n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();var i=e.input.shiftKey&&45!=e.input.lastKeyCode;setTimeout((function(){e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Jt(e,r.value,null,i,t):Jt(e,r.textContent,r.innerHTML,i,t)}),50)}}(e,n)}};var Lt=g((function e(t,n,r){m(this,e),this.slice=t,this.move=n,this.node=r})),Kt=_?"altKey":"ctrlKey";for(var _t in wt.dragstart=function(e,t){var n=t,i=e.input.mouseDown;if(i&&i.done(),n.dataTransfer){var o,s=e.state.selection,a=s.empty?null:e.posAtCoords(Nt(n));if(a&&a.pos>=s.from&&a.pos<=(s instanceof r.nh?s.to-1:s.to));else if(i&&i.mightDrag)o=r.nh.create(e.state.doc,i.mightDrag.pos);else if(n.target&&1==n.target.nodeType){var l=e.docView.nearestDesc(n.target,!0);l&&l.node.type.spec.draggable&&l!=e.docView&&(o=r.nh.create(e.state.doc,l.posBefore))}var u=ut(e,(o||e.state.selection).content()),c=u.dom,h=u.text,f=u.slice;n.dataTransfer.clearData(),n.dataTransfer.setData($t?"Text":"text/html",c.innerHTML),n.dataTransfer.effectAllowed="copyMove",$t||n.dataTransfer.setData("text/plain",h),e.dragging=new Lt(f,!n[Kt],o)}},wt.dragend=function(e){var t=e.dragging;window.setTimeout((function(){e.dragging==t&&(e.dragging=null)}),50)},bt.dragover=bt.dragenter=function(e,t){return t.preventDefault()},bt.drop=function(e,t){var n=t,s=e.dragging;if(e.dragging=null,n.dataTransfer){var a=e.posAtCoords(Nt(n));if(a){var l=e.state.doc.resolve(a.pos),u=s&&s.slice;u?e.someProp("transformPasted",(function(t){u=t(u,e)})):u=ct(e,jt(n.dataTransfer),$t?null:n.dataTransfer.getData("text/html"),!1,l);var c=!(!s||n[Kt]);if(e.someProp("handleDrop",(function(t){return t(e,n,u||i.Ji.empty,c)})))n.preventDefault();else if(u){n.preventDefault();var h=u?(0,o.Um)(e.state.doc,l.pos,u):l.pos;null==h&&(h=l.pos);var f=e.state.tr;if(c){var d=s.node;d?d.replace(f):f.deleteSelection()}var p=f.mapping.map(h),v=0==u.openStart&&0==u.openEnd&&1==u.content.childCount,m=f.doc;if(v?f.replaceRangeWith(p,p,u.content.firstChild):f.replaceRange(p,p,u),!f.doc.eq(m)){var y=f.doc.resolve(p);if(v&&r.nh.isSelectable(u.content.firstChild)&&y.nodeAfter&&y.nodeAfter.sameMarkup(u.content.firstChild))f.setSelection(new r.nh(y));else{var g=f.mapping.map(h);
1f.mapping.maps[f.mapping.maps.length-1].forEach((function(e,t,n,r){return g=r})),f.setSelection(He(e,y,f.doc.resolve(g)))}e.focus(),e.dispatch(f.setMeta("uiEvent","drop"))}}}}},wt.focus=function(e){e.input.lastFocus=Date.now(),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.domSelectionRange())&&Je(e)}),20))},wt.blur=function(e,t){var n=t;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)},wt.beforeinput=function(e,t){if(J&&U&&"deleteContentBackward"==t.inputType){e.domObserver.flushSoon();var n=e.input.domChangeCount;setTimeout((function(){if(e.input.domChangeCount==n&&(e.dom.blur(),e.focus(),!e.someProp("handleKeyDown",(function(t){return t(e,E(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)}},bt)wt[_t]=bt[_t];function Wt(e,t){if(e==t)return!0;for(var n in e)if(e[n]!==t[n])return!1;for(var r in t)if(!(r in e))return!1;return!0}var Ut=function(){function e(t,n){m(this,e),this.toDOM=t,this.spec=n||Yt,this.side=this.spec.side||0}return g(e,[{key:"map",value:function(e,t,n,r){var i=e.mapResult(t.from+r,this.side<0?-1:1),o=i.pos;return i.deleted?null:new Xt(o-n,o-n,this)}},{key:"valid",value:function(){return!0}},{key:"eq",value:function(t){return this==t||t instanceof e&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&Wt(this.spec,t.spec))}},{key:"destroy",value:function(e){this.spec.destroy&&this.spec.destroy(e)}}])}(),Ht=function(){function e(t,n){m(this,e),this.attrs=t,this.spec=n||Yt}return g(e,[{key:"map",value:function(e,t,n,r){var i=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,o=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return i>=o?null:new Xt(i,o,this)}},{key:"valid",value:function(e,t){return t.from<t.to}},{key:"eq",value:function(t){return this==t||t instanceof e&&Wt(this.attrs,t.attrs)&&Wt(this.spec,t.spec)}},{key:"destroy",value:function(){}}],[{key:"is",value:function(t){return t.type instanceof e}}])}(),Gt=function(){function e(t,n){m(this,e),this.attrs=t,this.spec=n||Yt}return g(e,[{key:"map",value:function(e,t,n,r){var i=e.mapResult(t.from+r,1);if(i.deleted)return null;var o=e.mapResult(t.to+r,-1);return o.deleted||o.pos<=i.pos?null:new Xt(i.pos-n,o.pos-n,this)}},{key:"valid",value:function(e,t){var n,r=e.content.findIndex(t.from),i=r.index,o=r.offset;return o==t.from&&!(n=e.child(i)).isText&&o+n.nodeSize==t.to}},{key:"eq",value:function(t){return this==t||t instanceof e&&Wt(this.attrs,t.attrs)&&Wt(this.spec,t.spec)}},{key:"destroy",value:function(){}}])}(),Xt=function(){function e(t,n,r){m(this,e),this.from=t,this.to=n,this.type=r}return g(e,[{key:"copy",value:function(t,n){return new e(t,n,this.type)}},{key:"eq",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}},{key:"map",value:function(e,t,n){return this.type.map(e,this,t,n)}},{key:"spec",get:function(){return this.type.spec}},{key:"inline",get:function(){return this.type instanceof Ht}},{key:"widget",get:function(){return this.type instanceof Ut}}],[{key:"widget",value:function(t,n,r){return new e(t,t,new Ut(n,r))}},{key:"inline",value:function(t,n,r,i){return new e(t,n,new Ht(r,i))}},{key:"node",value:function(t,n,r,i){return new e(t,n,new Gt(r,i))}}])}(),Zt=[],Yt={},Qt=function(){function e(t,n){m(this,e),this.local=t.length?t:Zt,this.children=n.length?n:Zt}return g(e,[{key:"find",value:function(e,t,n){var r=[];return this.findInner(null==e?0:e,null==t?1e9:t,r,0,n),r}},{key:"findInner",value:function(e,t,n,r,i){for(var o=0;o<this.local.length;o++){var s=this.local[o];s.from<=t&&s.to>=e&&(!i||i(s.spec))&&n.push(s.copy(s.from+r,s.to+r))}for(var a=0;a<this.children.length;a+=3)if(this.children[a]<t&&this.children[a+1]>e){var l=this.children[a]+1;this.children[a+2].findInner(e-l,t-l,n,r+l,i)}}},{key:"map",value:function(e,t,n){return this==en||0==e.maps.length?this:this.mapInner(e,t,0,0,n||Yt)}},{key:"mapInner",value:function(t,n,r,i,o){for(var s,a=0;a<this.local.length;a++){var l=this.local[a].map(t,r,i);l&&l.type.valid(n,l)?(s||(s=[])).push(l):o.onRemove&&o.onRemove(this.local[a].spec)}return this.children.length?nn(this.children,s||[],t,n,r,i,o):s?new e(s.sort(ln),Zt):en}},{key:"add",value:function(t,n){return n.length?this==en?e.create(t,n):this.addInner(t,n,0):this}},{key:"addInner",value:function(t,n,r){var i,o=this,s=0;t.forEach((function(e,t){var a,l=t+r;if(a=on(n,e,l)){for(i||(i=o.children.slice());s<i.length&&i[s]<t;)s+=3;i[s]==t?i[s+2]=i[s+2].addInner(e,a,l+1):i.splice(s,0,t,t+e.nodeSize,an(a,e,l+1,Yt)),s+=3}}));for(var a=rn(s?sn(n):n,-r),l=0;l<a.length;
1l++)a[l].type.valid(t,a[l])||a.splice(l--,1);return new e(a.length?this.local.concat(a).sort(ln):this.local,i||this.children)}},{key:"remove",value:function(e){return 0==e.length||this==en?this:this.removeInner(e,0)}},{key:"removeInner",value:function(t,n){for(var r=this.children,i=this.local,o=0;o<r.length;o+=3){for(var s,a=void 0,l=r[o]+n,u=r[o+1]+n,c=0;c<t.length;c++)(s=t[c])&&s.from>l&&s.to<u&&(t[c]=null,(a||(a=[])).push(s));if(a){r==this.children&&(r=this.children.slice());var h=r[o+2].removeInner(a,l+1);h!=en?r[o+2]=h:(r.splice(o,3),o-=3)}}if(i.length)for(var f,d=0;d<t.length;d++)if(f=t[d])for(var p=0;p<i.length;p++)i[p].eq(f,n)&&(i==this.local&&(i=this.local.slice()),i.splice(p--,1));return r==this.children&&i==this.local?this:i.length||r.length?new e(i,r):en}},{key:"forChild",value:function(t,n){if(this==en)return this;if(n.isLeaf)return e.empty;for(var r,i,o=0;o<this.children.length;o+=3)if(this.children[o]>=t){this.children[o]==t&&(r=this.children[o+2]);break}for(var s=t+1,a=s+n.content.size,l=0;l<this.local.length;l++){var u=this.local[l];if(u.from<a&&u.to>s&&u.type instanceof Ht){var c=Math.max(s,u.from)-s,h=Math.min(a,u.to)-s;c<h&&(i||(i=[])).push(u.copy(c,h))}}if(i){var f=new e(i.sort(ln),Zt);return r?new tn([f,r]):f}return r||en}},{key:"eq",value:function(t){if(this==t)return!0;if(!(t instanceof e)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(var n=0;n<this.local.length;n++)if(!this.local[n].eq(t.local[n]))return!1;for(var r=0;r<this.children.length;r+=3)if(this.children[r]!=t.children[r]||this.children[r+1]!=t.children[r+1]||!this.children[r+2].eq(t.children[r+2]))return!1;return!0}},{key:"locals",value:function(e){return un(this.localsInner(e))}},{key:"localsInner",value:function(e){if(this==en)return Zt;if(e.inlineContent||!this.local.some(Ht.is))return this.local;for(var t=[],n=0;n<this.local.length;n++)this.local[n].type instanceof Ht||t.push(this.local[n]);return t}}],[{key:"create",value:function(e,t){return t.length?an(t,e,0,Yt):en}}])}();Qt.empty=new Qt([],[]),Qt.removeOverlap=un;var en=Qt.empty,tn=function(){function e(t){m(this,e),this.members=t}return g(e,[{key:"map",value:function(t,n){var r=this.members.map((function(e){return e.map(t,n,Yt)}));return e.from(r)}},{key:"forChild",value:function(t,n){if(n.isLeaf)return Qt.empty;for(var r=[],i=0;i<this.members.length;i++){var o=this.members[i].forChild(t,n);o!=en&&(o instanceof e?r=r.concat(o.members):r.push(o))}return e.from(r)}},{key:"eq",value:function(t){if(!(t instanceof e)||t.members.length!=this.members.length)return!1;for(var n=0;n<this.members.length;n++)if(!this.members[n].eq(t.members[n]))return!1;return!0}},{key:"locals",value:function(e){for(var t,n=!0,r=0;r<this.members.length;r++){var i=this.members[r].localsInner(e);if(i.length)if(t){n&&(t=t.slice(),n=!1);for(var o=0;o<i.length;o++)t.push(i[o])}else t=i}return t?un(n?t:t.sort(ln)):Zt}}],[{key:"from",value:function(t){switch(t.length){case 0:return en;case 1:return t[0];default:return new e(t.every((function(e){return e instanceof Qt}))?t:t.reduce((function(e,t){return e.concat(t instanceof Qt?t:t.members)}),[]))}}}])}();function nn(e,t,n,r,i,o,s){for(var a=e.slice(),l=function(e){var t=0;n.maps[u].forEach((function(n,r,i,o){for(var s=o-i-(r-n),l=0;l<a.length;l+=3){var u=a[l+1];if(!(u<0||n>u+e-t)){var c=a[l]+e-t;r>=c?a[l+1]=n<=c?-2:-1:n>=e&&s&&(a[l]+=s,a[l+1]+=s)}}t+=s})),e=n.maps[u].map(e,-1),c=e},u=0,c=o;u<n.maps.length;u++)l(c);for(var h=!1,f=0;f<a.length;f+=3)if(a[f+1]<0){if(-2==a[f+1]){h=!0,a[f+1]=-1;continue}var d=n.map(e[f]+o),p=d-i;if(p<0||p>=r.content.size){h=!0;continue}var v=n.map(e[f+1]+o,-1)-i,m=r.content.findIndex(p),y=m.index,g=m.offset,k=r.maybeChild(y);if(k&&g==p&&g+k.nodeSize==v){var w=a[f+2].mapInner(n,k,d+1,e[f]+o+1,s);w!=en?(a[f]=p,a[f+1]=v,a[f+2]=w):(a[f+1]=-2,h=!0)}else h=!0}if(h){var b=function(e,t,n,r,i,o,s){function a(e,t){for(var o=0;o<e.local.length;o++){var l=e.local[o].map(r,i,t);l?n.push(l):s.onRemove&&s.onRemove(e.local[o].spec)}for(var u=0;u<e.children.length;u+=3)a(e.children[u+2],e.children[u]+t+1)}for(var l=0;l<e.length;l+=3)-1==e[l+1]&&a(e[l+2],t[l]+o+1);return n}(a,e,t,n,i,o,s),S=an(b,r,0,s);t=S.local;for(var x=0;x<a.length;
1x+=3)a[x+1]<0&&(a.splice(x,3),x-=3);for(var M=0,O=0;M<S.children.length;M+=3){for(var C=S.children[M];O<a.length&&a[O]<C;)O+=3;a.splice(O,0,S.children[M],S.children[M+1],S.children[M+2])}}return new Qt(t.sort(ln),a)}function rn(e,t){if(!t||!e.length)return e;for(var n=[],r=0;r<e.length;r++){var i=e[r];n.push(new Xt(i.from+t,i.to+t,i.type))}return n}function on(e,t,n){if(t.isLeaf)return null;for(var r,i=n+t.nodeSize,o=null,s=0;s<e.length;s++)(r=e[s])&&r.from>n&&r.to<i&&((o||(o=[])).push(r),e[s]=null);return o}function sn(e){for(var t=[],n=0;n<e.length;n++)null!=e[n]&&t.push(e[n]);return t}function an(e,t,n,r){var i=[],o=!1;t.forEach((function(t,s){var a=on(e,t,s+n);if(a){o=!0;var l=an(a,t,n+s+1,r);l!=en&&i.push(s,s+t.nodeSize,l)}}));for(var s=rn(o?sn(e):e,-n).sort(ln),a=0;a<s.length;a++)s[a].type.valid(t,s[a])||(r.onRemove&&r.onRemove(s[a].spec),s.splice(a--,1));return s.length||i.length?new Qt(s,i):en}function ln(e,t){return e.from-t.from||e.to-t.to}function un(e){for(var t=e,n=0;n<t.length-1;n++){var r=t[n];if(r.from!=r.to)for(var i=n+1;i<t.length;i++){var o=t[i];if(o.from!=r.from){o.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,o.from),cn(t,i,r.copy(o.from,r.to)));break}o.to!=r.to&&(t==e&&(t=e.slice()),t[i]=o.copy(o.from,r.to),cn(t,i+1,o.copy(r.to,o.to)))}}return t}function cn(e,t,n){for(;t<e.length&&ln(n,e[t])>0;)t++;e.splice(t,0,n)}function hn(e){var t=[];return e.someProp("decorations",(function(n){var r=n(e.state);r&&r!=en&&t.push(r)})),e.cursorWrapper&&t.push(Qt.create(e.state.doc,[e.cursorWrapper.deco])),tn.from(t)}var fn={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},dn=B&&V<=11,pn=function(){return g((function e(){m(this,e),this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}),[{key:"set",value:function(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}},{key:"clear",value:function(){this.anchorNode=this.focusNode=null}},{key:"eq",value:function(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}])}(),vn=function(){return g((function e(t,n){var r=this;m(this,e),this.view=t,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new pn,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver((function(e){for(var t=0;t<e.length;t++)r.queue.push(e[t]);B&&V<=11&&e.some((function(e){return"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length}))?r.flushSoon():r.flush()})),dn&&(this.onCharData=function(e){r.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),r.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}),[{key:"flushSoon",value:function(){var e=this;this.flushingSoon<0&&(this.flushingSoon=window.setTimeout((function(){e.flushingSoon=-1,e.flush()}),20))}},{key:"forceFlush",value:function(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}},{key:"start",value:function(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,fn)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}},{key:"stop",value:function(){var e=this;if(this.observer){var t=this.observer.takeRecords();if(t.length){for(var n=0;n<t.length;n++)this.queue.push(t[n]);window.setTimeout((function(){return e.flush()}),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}},{key:"connectSelection",value:function(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}},{key:"disconnectSelection",value:function(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}},{key:"suppressSelectionUpdates",value:function(){var e=this;this.suppressingSelectionUpdates=!0,setTimeout((function(){return e.suppressingSelectionUpdates=!1}),50)}},{key:"onSelectionChange",value:function(){if(Ge(this.view)){if(this.suppressingSelectionUpdates)return Je(this.view);if(B&&V<=11&&!this.view.state.selection.empty){var e=this.view.domSelectionRange();if(e.focusNode&&M(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}},{key:"setCurSelection",value:function(){this.currentSelection.set(this.view.domSelectionRange())}},{key:"ignoreSelectionChange",value:function(e){if(!e.focusNode)return!0;for(var t,n=new Set,r=e.focusNode;r;r=b(r))n.add(r);for(var i=e.anchorNode;i;i=b(i))if(n.has(i)){t=i;break}var o=t&&this.view.docView.nearestDesc(t);return o&&o.ignoreMutation({type:"selection",target:3==t.nodeType?t.parentNode:t})?(this.setCurSelection(),!0):void 0}},{key:"pendingRecords",value:function(){if(this.observer){var e,t=s(this.observer.takeRecords());try{for(t.s();!(e=t.n()).done;){var n=e.value;this.queue.push(n)}}catch(e){t.e(e)}finally{t.f()}}return this.queue}},{key:"flush",value:function(){var e,t,n=this.view;if(n.docView&&!(this.flushingSoon>-1)){var i=this.pendingRecords();i.length&&(this.queue=[]);var o=n.domSelectionRange(),l=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(o)&&Ge(n)&&
1!this.ignoreSelectionChange(o),u=-1,c=-1,h=!1,f=[];if(n.editable)for(var d=0;d<i.length;d++){var p=this.registerMutation(i[d],f);p&&(u=u<0?p.from:Math.min(p.from,u),c=c<0?p.to:Math.max(p.to,c),p.typeOver&&(h=!0))}if(q&&f.length){var v=f.filter((function(e){return"BR"==e.nodeName}));if(2==v.length){var m=(t=2,function(e){if(Array.isArray(e))return e}(e=v)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,s,a=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return a}}(e,t)||a(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),y=m[0],g=m[1];y.parentNode&&y.parentNode.parentNode==g.parentNode?g.remove():y.remove()}else{var k,w=this.currentSelection.focusNode,b=s(v);try{for(b.s();!(k=b.n()).done;){var S=k.value,x=S.parentNode;!x||"LI"!=x.nodeName||w&&kn(n,w)==x||S.remove()}}catch(e){b.e(e)}finally{b.f()}}}var M=null;u<0&&l&&n.input.lastFocus>Date.now()-200&&Math.max(n.input.lastTouch,n.input.lastClick.time)<Date.now()-300&&T(o)&&(M=qe(n))&&M.eq(r.LN.near(n.state.doc.resolve(0),1))?(n.input.lastFocus=0,Je(n),this.currentSelection.set(o),n.scrollToSelection()):(u>-1||l)&&(u>-1&&(n.docView.markDirty(u,c),function(e){if(!mn.has(e)&&(mn.set(e,null),-1!==["normal","nowrap","pre-line"].indexOf(getComputedStyle(e.dom).whiteSpace))){if(e.requiresGeckoHackNode=q,yn)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),yn=!0}}(n)),this.handleDOMChange(u,c,h,f),n.docView&&n.docView.dirty?n.updateState(n.state):this.currentSelection.eq(o)||Je(n),this.currentSelection.set(o))}}},{key:"registerMutation",value:function(e,t){if(t.indexOf(e.target)>-1)return null;var n=this.view.docView.nearestDesc(e.target);if("attributes"==e.type&&(n==this.view.docView||"contenteditable"==e.attributeName||"style"==e.attributeName&&!e.oldValue&&!e.target.getAttribute("style")))return null;if(!n||n.ignoreMutation(e))return null;if("childList"==e.type){for(var r=0;r<e.addedNodes.length;r++){var i=e.addedNodes[r];t.push(i),3==i.nodeType&&(this.lastChangedTextNode=i)}if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};var o=e.previousSibling,s=e.nextSibling;if(B&&V<=11&&e.addedNodes.length)for(var a=0;a<e.addedNodes.length;a++){var l=e.addedNodes[a],u=l.previousSibling,c=l.nextSibling;(!u||Array.prototype.indexOf.call(e.addedNodes,u)<0)&&(o=u),(!c||Array.prototype.indexOf.call(e.addedNodes,c)<0)&&(s=c)}var h=o&&o.parentNode==e.target?w(o)+1:0,f=n.localPosFromDOM(e.target,h,-1),d=s&&s.parentNode==e.target?w(s):e.target.childNodes.length;return{from:f,to:n.localPosFromDOM(e.target,d,1)}}return"attributes"==e.type?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:(this.lastChangedTextNode=e.target,{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}])}(),mn=new WeakMap,yn=!1;function gn(e,t){var n=t.startContainer,r=t.startOffset,i=t.endContainer,o=t.endOffset,s=e.domAtPos(e.state.selection.anchor);if(M(s.node,s.offset,i,o)){var a=[i,o,n,r];n=a[0],r=a[1],i=a[2],o=a[3]}return{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}}function kn(e,t){for(var n=t.parentNode;n&&n!=e.dom;n=n.parentNode){var r=e.docView.nearestDesc(n,!0);if(r&&r.node.isBlock)return n}return null}function wn(e){var t=e.pmViewDesc;if(t)return t.parseRule();if("BR"==e.nodeName&&e.parentNode){if(L&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){var n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}if(e.parentNode.lastChild==e||L&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if("IMG"==e.nodeName&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}var bn=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;
1function Sn(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:He(e,t.resolve(n.anchor),t.resolve(n.head))}function xn(e,t,n){for(var r=e.depth,i=t?e.end():e.pos;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,i++,t=!1;if(n)for(var o=e.node(r).maybeChild(e.indexAfter(r));o&&!o.isLeaf;)o=o.firstChild,i++;return i}function Mn(e){if(2!=e.length)return!1;var t=e.charCodeAt(0),n=e.charCodeAt(1);return t>=56320&&t<=57343&&n>=55296&&n<=56319}var On=function(){return g((function e(t,n){var o=this;m(this,e),this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new xt,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(En),this.dispatch=this.dispatch.bind(this),this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):"function"==typeof t?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=Dn(this),Nn(this),this.nodeViews=Tn(this),this.docView=xe(this.state.doc,Cn(this),hn(this),this.dom,this),this.domObserver=new vn(this,(function(e,t,n,s){return function(e,t,n,o,s){var a=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){var l=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,u=qe(e,l);if(u&&!e.state.selection.eq(u)){if(J&&U&&13===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp("handleKeyDown",(function(t){return t(e,E(13,"Enter"))})))return;var c=e.state.tr.setSelection(u);"pointer"==l?c.setMeta("pointer",!0):"key"==l&&c.scrollIntoView(),a&&c.setMeta("composition",a),e.dispatch(c)}}else{var h=e.state.doc.resolve(t),f=h.sharedDepth(n);t=h.before(f+1),n=e.state.doc.resolve(n).after(f+1);var d,p,v=e.state.selection,m=function(e,t,n){var r,o=e.docView.parseRange(t,n),s=o.node,a=o.fromOffset,l=o.toOffset,u=o.from,c=o.to,h=e.domSelectionRange(),f=h.anchorNode;if(f&&e.dom.contains(1==f.nodeType?f:f.parentNode)&&(r=[{node:f,offset:h.anchorOffset}],T(h)||r.push({node:h.focusNode,offset:h.focusOffset})),J&&8===e.input.lastKeyCode)for(var d=l;d>a;d--){var p=s.childNodes[d-1],v=p.pmViewDesc;if("BR"==p.nodeName&&!v){l=d;break}if(!v||v.size)break}var m=e.state.doc,y=e.someProp("domParser")||i.S4.fromSchema(e.state.schema),g=m.resolve(u),k=null,w=y.parse(s,{topNode:g.parent,topMatch:g.parent.contentMatchAt(g.index()),topOpen:!0,from:a,to:l,preserveWhitespace:"pre"!=g.parent.type.whitespace||"full",findPositions:r,ruleFromNode:wn,context:g});if(r&&null!=r[0].pos){var b=r[0].pos,S=r[1]&&r[1].pos;null==S&&(S=b),k={anchor:b+u,head:S+u}}return{doc:w,sel:k,from:u,to:c}}(e,t,n),y=e.state.doc,g=y.slice(m.from,m.to);8===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime?(d=e.state.selection.to,p="end"):(d=e.state.selection.from,p="start"),e.input.lastKeyCode=null;var k=function(e,t,n,r,i){var o=e.findDiffStart(t,n);if(null==o)return null;var s=e.findDiffEnd(t,n+e.size,n+t.size),a=s.a,l=s.b;if("end"==i&&(r-=a+Math.max(0,o-Math.min(a,l))-o),a<o&&e.size<t.size){var u=r<=o&&r>=a?o-r:0;(o-=u)&&o<t.size&&Mn(t.textBetween(o-1,o+1))&&(o+=u?1:-1),l=o+(l-a),a=o}else if(l<o){var c=r<=o&&r>=l?o-r:0;(o-=c)&&o<e.size&&Mn(e.textBetween(o-1,o+1))&&(o+=c?1:-1),a=o+(a-l),l=o}return{start:o,endA:a,endB:l}}(g.content,m.doc.content,m.from,d,p);if((K&&e.input.lastIOSEnter>Date.now()-225||U)&&s.some((function(e){return 1==e.nodeType&&!bn.test(e.nodeName)}))&&(!k||k.endA>=k.endB)&&e.someProp("handleKeyDown",(function(t){return t(e,E(13,"Enter"))})))e.input.lastIOSEnter=0;else{if(!k){if(!(o&&v instanceof r.U3&&!v.empty&&v.$head.sameParent(v.$anchor))||e.composing||m.sel&&m.sel.anchor!=m.sel.head){if(m.sel){var w=Sn(e,e.state.doc,m.sel);if(w&&!w.eq(e.state.selection)){var b=e.state.tr.setSelection(w);a&&b.setMeta("composition",a),e.dispatch(b)}}return}k={start:v.from,endA:v.to,endB:v.to}}e.input.domChangeCount++,e.state.selection.from<e.state.selection.to&&k.start==k.endB&&e.state.selection instanceof r.U3&&(k.start>e.state.selection.from&&k.start<=e.state.selection.from+2&&e.state.selection.from>=m.from?k.start=e.state.selection.from:k.endA<e.state.selection.to&&k.endA>=e.state.selection.to-2&&e.state.selection.to<=m.to&&(k.endB+=e.state.selection.to-k.endA,k.endA=e.state.selection.to)),B&&V<=11&&k.endB==k.start+1&&k.endA==k.start&&k.start>m.from&&"  "==m.doc.textBetween(k.start-m.from-1,k.start-m.from+1)&&(k.start--,k.endA--,k.endB--);var S,x=m.doc.resolveNoCache(k.start-m.from),M=m.doc.resolveNoCache(k.endB-m.from),O=y.resolve(k.start),C=x.sameParent(M)&&x.parent.inlineContent&&O.end()>=k.endA;if((K&&e.input.lastIOSEnter>Date.now()-225&&(!C||s.some((function(e){return"DIV"==e.nodeName||"P"==e.nodeName})))||!C&&x.pos<m.doc.content.size&&!x.sameParent(M)&&(S=r.LN.findFrom(m.doc.resolve(x.pos+1),1,!0))&&S.head==M.pos)&&e.someProp("handleKeyDown",(function(t){return t(e,E(13,"Enter"))})))e.input.lastIOSEnter=0;else if(e.state.selection.anchor>k.start&&function(e,t,n,r,i){if(n-t<=i.pos-r.pos||xn(r,!0,!1)<i.pos)return!1;var o=e.resolve(t);if(!r.parent.isTextblock){var s=o.nodeAfter;return null!=s&&n==t+s.nodeSize}if(o.parentOffset<o.parent.content.size||!o.parent.isTextblock)return!1;var a=e.resolve(xn(o,!0,!0));return!(!a.parent.isTextblock||a.pos>n||xn(a,!0,!1)<n)&&r.parent.content.cut(r.parentOffset).eq(a.parent.content)}(y,k.start,k.endA,x,M)&&e.someProp("handleKeyDown",(function(t){return t(e,E(8,"Backspace"))})))U&&J&&e.domObserver.suppressSelectionUpdates();else{J&&U&&k.endB==k.start&&(e.input.lastAndroidDelete=Date.now()),U&&!C&&x.start()!=M.start()&&0==M.parentOffset&&x.depth==M.depth&&m.sel&&m.sel.anchor==m.sel.head&&m.sel.head==k.endA&&(k.endB-=2,M=m.doc.resolveNoCache(k.endB-m.from),setTimeout((function(){e.someProp("handleKeyDown",(function(t){return t(e,E(13,"Enter"))}))}),20));var N,D,A,R=k.start,I=k.endA;if(C)if(x.pos==M.pos)B&&V<=11&&0==x.parentOffset&&(e.domObserver.suppressSelectionUpdates(),setTimeout((function(){return Je(e)}),20)),N=e.state.tr.delete(R,I),D=y.resolve(k.start).marksAcross(y.resolve(k.endA));else if(k.endA==k.endB&&(A=function(e,t){for(var n,r,o,s=e.firstChild.marks,a=t.firstChild.marks,l=s,u=a,c=0;c<a.length;c++)l=a[c].removeFromSet(l);for(var h=0;h<s.length;h++)u=s[h].removeFromSet(u);
1if(1==l.length&&0==u.length)r=l[0],n="add",o=function(e){return e.mark(r.addToSet(e.marks))};else{if(0!=l.length||1!=u.length)return null;r=u[0],n="remove",o=function(e){return e.mark(r.removeFromSet(e.marks))}}for(var f=[],d=0;d<t.childCount;d++)f.push(o(t.child(d)));if(i.FK.from(f).eq(e))return{mark:r,type:n}}(x.parent.content.cut(x.parentOffset,M.parentOffset),O.parent.content.cut(O.parentOffset,k.endA-O.start()))))N=e.state.tr,"add"==A.type?N.addMark(R,I,A.mark):N.removeMark(R,I,A.mark);else if(x.parent.child(x.index()).isText&&x.index()==M.index()-(M.textOffset?0:1)){var P=x.parent.textBetween(x.parentOffset,M.parentOffset);if(e.someProp("handleTextInput",(function(t){return t(e,R,I,P)})))return;N=e.state.tr.insertText(P,R,I)}if(N||(N=e.state.tr.replace(R,I,m.doc.slice(k.start-m.from,k.endB-m.from))),m.sel){var z=Sn(e,N.doc,m.sel);z&&!(J&&U&&e.composing&&z.empty&&(k.start!=k.endB||e.input.lastAndroidDelete<Date.now()-100)&&(z.head==R||z.head==N.mapping.map(I)-1)||B&&z.empty&&z.head==R)&&N.setSelection(z)}D&&N.ensureMarks(D),a&&N.setMeta("composition",a),e.dispatch(N.scrollIntoView())}}}}(o,e,t,n,s)})),this.domObserver.start(),function(e){var t=function(){var t=wt[n];e.dom.addEventListener(n,e.input.eventHandlers[n]=function(n){!function(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(var n=t.target;n!=e.dom;n=n.parentNode)if(!n||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}(e,n)||Ct(e,n)||!e.editable&&n.type in bt||t(e,n)},St[n]?{passive:!0}:void 0)};for(var n in wt)t();L&&e.dom.addEventListener("input",(function(){return null})),Ot(e)}(this),this.updatePluginViews()}),[{key:"composing",get:function(){return this.input.composing}},{key:"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}},{key:"update",value:function(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Ot(this);var t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(En),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}},{key:"setProps",value:function(e){var t={};for(var n in this._props)t[n]=this._props[n];for(var r in t.state=this.state,e)t[r]=e[r];this.update(t)}},{key:"updateState",value:function(e){this.updateStateInner(e,this._props)}},{key:"updateStateInner",value:function(e,t){var n,r=this.state,i=!1,o=!1;e.storedMarks&&this.composing&&(Vt(this),o=!0),this.state=e;var s=r.plugins!=e.plugins||this._props.plugins!=t.plugins;if(s||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){var a=Tn(this);(function(e,t){var n=0,r=0;for(var i in e){if(e[i]!=t[i])return!0;n++}for(var o in t)r++;return n!=r})(a,this.nodeViews)&&(this.nodeViews=a,i=!0)}(s||t.handleDOMEvents!=this._props.handleDOMEvents)&&Ot(this),this.editable=Dn(this),Nn(this);var l=hn(this),u=Cn(this),c=r.plugins==e.plugins||r.doc.eq(e.doc)?e.scrollToSelection>r.scrollToSelection?"to selection":"preserve":"reset",h=i||!this.docView.matchesNode(e.doc,u,l);!h&&e.selection.eq(r.selection)||(o=!0);var f,d,p,v,m,y,g,k,b,S,x="preserve"==c&&o&&null==this.dom.style.overflowAnchor&&function(e){for(var t,n,r=e.dom.getBoundingClientRect(),i=Math.max(0,r.top),o=(r.left+r.right)/2,s=i+1;s<Math.min(innerHeight,r.bottom);s+=5){var a=e.root.elementFromPoint(o,s);if(a&&a!=e.dom&&e.dom.contains(a)){var l=a.getBoundingClientRect();if(l.top>=i-20){t=a,n=l.top;break}}}return{refDOM:t,refTop:n,stack:ee(e.dom)}}(this);if(o){this.domObserver.stop();var O=h&&(B||J)&&!this.composing&&!r.selection.empty&&!e.selection.empty&&(v=r.selection,m=e.selection,y=Math.min(v.$anchor.sharedDepth(v.head),m.$anchor.sharedDepth(m.head)),v.$anchor.start(y)!=m.$anchor.start(y));if(h){var C=J?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=function(e){var t=e.domSelectionRange();if(!t.focusNode)return null;var n=function(e,t){for(;;){if(3==e.nodeType&&t)return e;if(1==e.nodeType&&t>0){if("false"==e.contentEditable)return null;t=N(e=e.childNodes[t-1])}else{if(!e.parentNode||D(e))return null;t=w(e),e=e.parentNode}}}(t.focusNode,t.focusOffset),r=function(e,t){for(;;){if(3==e.nodeType&&t<e.nodeValue.length)return e;if(1==e.nodeType&&t<e.childNodes.length){if("false"==e.contentEditable)return null;e=e.childNodes[t],t=0}else{if(!e.parentNode||D(e))return null;t=w(e)+1,e=e.parentNode}}}(t.focusNode,t.focusOffset);
1if(n&&r&&n!=r){var i=r.pmViewDesc,o=e.domObserver.lastChangedTextNode;if(n==o||r==o)return o;if(!i||!i.isText(r.nodeValue))return r;if(e.input.compositionNode==r){var s=n.pmViewDesc;if(s&&s.isText(n.nodeValue))return r}}return n||r}(this)),!i&&this.docView.update(e.doc,u,l,this)||(this.docView.updateOuterDeco(u),this.docView.destroy(),this.docView=xe(e.doc,u,l,this.dom,this)),C&&!this.trackWrites&&(O=!0)}O||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&(f=this,d=f.docView.domFromPos(f.state.selection.anchor,0),p=f.domSelectionRange(),M(d.node,d.offset,p.anchorNode,p.anchorOffset)))?Je(this,O):(We(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(r),(null===(n=this.dragging)||void 0===n?void 0:n.node)&&!r.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,r),"reset"==c?this.dom.scrollTop=0:"to selection"==c?this.scrollToSelection():x&&(k=(g=x).refDOM,b=g.refTop,te(g.stack,0==(S=k?k.getBoundingClientRect().top:0)?0:S-b))}},{key:"scrollToSelection",value:function(){var e=this,t=this.domSelectionRange().focusNode;if(this.someProp("handleScrollToSelection",(function(t){return t(e)})));else if(this.state.selection instanceof r.nh){var n=this.docView.domAfterPos(this.state.selection.from);1==n.nodeType&&Q(this,n.getBoundingClientRect(),t)}else Q(this,this.coordsAtPos(this.state.selection.head,1),t)}},{key:"destroyPluginViews",value:function(){for(var e;e=this.pluginViews.pop();)e.destroy&&e.destroy()}},{key:"updatePluginViews",value:function(e){if(e&&e.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(var t=0;t<this.pluginViews.length;t++){var n=this.pluginViews[t];n.update&&n.update(this,e)}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(var r=0;r<this.directPlugins.length;r++){var i=this.directPlugins[r];i.spec.view&&this.pluginViews.push(i.spec.view(this))}for(var o=0;o<this.state.plugins.length;o++){var s=this.state.plugins[o];s.spec.view&&this.pluginViews.push(s.spec.view(this))}}}},{key:"updateDraggedNode",value:function(e,t){var n=e.node,i=-1;if(this.state.doc.nodeAt(n.from)==n.node)i=n.from;else{var o=n.from+(this.state.doc.content.size-t.doc.content.size);(o>0&&this.state.doc.nodeAt(o))==n.node&&(i=o)}this.dragging=new Lt(e.slice,e.move,i<0?void 0:r.nh.create(this.state.doc,i))}},{key:"someProp",value:function(e,t){var n,r=this._props&&this._props[e];if(null!=r&&(n=t?t(r):r))return n;for(var i=0;i<this.directPlugins.length;i++){var o=this.directPlugins[i].props[e];if(null!=o&&(n=t?t(o):o))return n}var s=this.state.plugins;if(s)for(var a=0;a<s.length;a++){var l=s[a].props[e];if(null!=l&&(n=t?t(l):l))return n}}},{key:"hasFocus",value:function(){if(B){var e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if("false"==e.contentEditable)return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}},{key:"focus",value:function(){this.domObserver.stop(),this.editable&&function(e){if(e.setActive)return e.setActive();if(ne)return e.focus(ne);var t=ee(e);e.focus(null==ne?{get preventScroll(){return ne={preventScroll:!0},!0}}:void 0),ne||(ne=!1,te(t,0))}(this.dom),Je(this),this.domObserver.start()}},{key:"root",get:function(){var e=this,t=this._root;if(null==t)for(var n,r=function(t){if(9==t.nodeType||11==t.nodeType&&t.host)return t.getSelection||(Object.getPrototypeOf(t).getSelection=function(){return t.ownerDocument.getSelection()}),{v:e._root=t}},i=this.dom.parentNode;i;i=i.parentNode)if(n=r(i))return n.v;return t||document}},{key:"updateRoot",value:function(){this._root=null}},{key:"posAtCoords",value:function(e){return se(this,e)}},{key:"coordsAtPos",value:function(e){return ce(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:1)}},{key:"domAtPos",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.docView.domFromPos(e,t)}},{key:"nodeDOM",value:function(e){var t=this.docView.descAt(e);return t?t.nodeDOM:null}},{key:"posAtDOM",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,r=this.docView.posFromDOM(e,t,n);if(null==r)throw new RangeError("DOM position not inside the editor");return r}},{key:"endOfTextblock",value:function(e,t){return function(e,t,n){return ve==t&&me==n?ye:(ve=t,me=n,ye="up"==n||"down"==n?function(e,t,n){var r=t.selection,i="up"==n?r.$from:r.$to;return de(e,t,(function(){for(var t=e.docView.domFromPos(i.pos,"up"==n?-1:1).node;;){var r=e.docView.nearestDesc(t,!0);if(!r)break;
1if(r.node.isBlock){t=r.contentDOM||r.dom;break}t=r.dom.parentNode}for(var o=ce(e,i.pos,1),s=t.firstChild;s;s=s.nextSibling){var a=void 0;if(1==s.nodeType)a=s.getClientRects();else{if(3!=s.nodeType)continue;a=x(s,0,s.nodeValue.length).getClientRects()}for(var l=0;l<a.length;l++){var u=a[l];if(u.bottom>u.top+1&&("up"==n?o.top-u.top>2*(u.bottom-o.top):u.bottom-o.bottom>2*(o.bottom-u.top)))return!1}}return!0}))}(e,t,n):function(e,t,n){var r=t.selection.$head;if(!r.parent.isTextblock)return!1;var i=r.parentOffset,o=!i,s=i==r.parent.content.size,a=e.domSelection();return pe.test(r.parent.textContent)&&a.modify?de(e,t,(function(){var t=e.domSelectionRange(),i=t.focusNode,o=t.focusOffset,s=t.anchorNode,l=t.anchorOffset,u=a.caretBidiLevel;a.modify("move",n,"character");var c=r.depth?e.docView.domAfterPos(r.before()):e.dom,h=e.domSelectionRange(),f=h.focusNode,d=h.focusOffset,p=f&&!c.contains(1==f.nodeType?f:f.parentNode)||i==f&&o==d;try{a.collapse(s,l),i&&(i!=s||o!=l)&&a.extend&&a.extend(i,o)}catch(e){}return null!=u&&(a.caretBidiLevel=u),p})):"left"==n||"backward"==n?o:s}(e,t,n))}(this,t||this.state,e)}},{key:"pasteHTML",value:function(e,t){return Jt(this,"",e,!1,t||new ClipboardEvent("paste"))}},{key:"pasteText",value:function(e,t){return Jt(this,e,null,!0,t||new ClipboardEvent("paste"))}},{key:"destroy",value:function(){this.docView&&(function(e){for(var t in e.domObserver.stop(),e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],hn(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,S=null)}},{key:"isDestroyed",get:function(){return null==this.docView}},{key:"dispatchEvent",value:function(e){return function(e,t){Ct(e,t)||!wt[t.type]||!e.editable&&t.type in bt||wt[t.type](e,t)}(this,e)}},{key:"dispatch",value:function(e){var t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))}},{key:"domSelectionRange",value:function(){var e=this.domSelection();return L&&11===this.root.nodeType&&function(e){for(var t=e.activeElement;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}(this.dom.ownerDocument)==this.dom&&function(e,t){if(t.getComposedRanges){var n=t.getComposedRanges(e.root)[0];if(n)return gn(e,n)}var r;function i(e){e.preventDefault(),e.stopImmediatePropagation(),r=e.getTargetRanges()[0]}return e.dom.addEventListener("beforeinput",i,!0),document.execCommand("indent"),e.dom.removeEventListener("beforeinput",i,!0),r?gn(e,r):null}(this,e)||e}},{key:"domSelection",value:function(){return this.root.getSelection()}}])}();function Cn(e){var t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),e.someProp("attributes",(function(n){if("function"==typeof n&&(n=n(e.state)),n)for(var r in n)"class"==r?t.class+=" "+n[r]:"style"==r?t.style=(t.style?t.style+";":"")+n[r]:t[r]||"contenteditable"==r||"nodeName"==r||(t[r]=String(n[r]))})),t.translate||(t.translate="no"),[Xt.node(0,e.state.doc.content.size,t)]}function Nn(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:Xt.widget(e.state.selection.head,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function Dn(e){return!e.someProp("editable",(function(t){return!1===t(e.state)}))}function Tn(e){var t=Object.create(null);function n(e){for(var n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n])}return e.someProp("nodeViews",n),e.someProp("markViews",n),t}function En(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}}}]);

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.