1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5744],{39557:function(t,e,n){"use strict";/** 2 * @toast-ui/editor : i18n 3 * @version 3.2.2 | Fri Feb 17 2023 4 * @author NHN Cloud FE Development Lab <[email protected]> 5 * @license MIT 6 */n(34586).ZP.setLanguage(["ko","ko-KR"],{Markdown:"ë§í¬ë¤ì´",WYSIWYG:"ìì§ì ",Write:"í¸ì§í기",Preview:"미리보기",Headings:"ì 목í¬ê¸°",Paragraph:"본문",Bold:"êµµê²",Italic:"기ì¸ìê¼´",Strike:"ì·¨ìì ",Code:"ì¸ë¼ì¸ ì½ë",Line:"문ë¨ëë",Blockquote:"ì¸ì©êµ¬","Unordered list":"ê¸ë¨¸ë¦¬ 기í¸","Ordered list":"ë²í¸ 매기기",Task:"ì²´í¬ë°ì¤",Indent:"ë¤ì¬ì°ê¸°",Outdent:"ë´ì´ì°ê¸°","Insert link":"ë§í¬ ì½ì ","Insert CodeBlock":"ì½ëë¸ë ì½ì ","Insert table":"í ì½ì ","Insert image":"ì´ë¯¸ì§ ì½ì ",Heading:"ì 목","Image URL":"ì´ë¯¸ì§ 주ì","Select image file":"ì´ë¯¸ì§ íì¼ì ì ííì¸ì.","Choose a file":"íì¼ ì í","No file":"ì íë íì¼ ìì",Description:"ì¤ëª ",OK:"íì¸",More:"ë 보기",Cancel:"ì·¨ì",File:"íì¼",URL:"주ì","Link text":"ë§í¬ í ì¤í¸","Add row to up":"ìì í ì¶ê°","Add row to down":"ìëì í ì¶ê°","Add column to left":"ì¼ìª½ì ì´ ì¶ê°","Add column to right":"ì¤ë¥¸ìª½ì ì´ ì¶ê°","Remove row":"í ìì ","Remove column":"ì´ ìì ","Align column to left":"ì´ ì¼ìª½ ì ë ¬","Align column to center":"ì´ ê°ì´ë° ì ë ¬","Align column to right":"ì´ ì¤ë¥¸ìª½ ì ë ¬","Remove table":"í ìì ","Would you like to paste as table?":"íííë¡ ë¶ì¬ ë£ê² ìµëê¹?","Text color":"ê¸ì ìì","Auto scroll enabled":"ìë ì¤í¬ë¡¤ ì¼ì§","Auto scroll disabled":"ìë ì¤í¬ë¡¤ 꺼ì§","Choose language":"ì¸ì´ ì í"})},59803:function(t,e,n){"use strict";n.d(e,{M:function(){return c}});var r=n(2265),i=n(34586),o=n(55893),s=n.n(o),a=function(t,e){return(a=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)};function l(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}a(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var h=function(){return(h=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)},c=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.rootEl=r.createRef(),e}return l(e,t),e.prototype.getRootElement=function(){return this.rootEl.current},e.prototype.getInstance=function(){return this.editorInst},e.prototype.getBindingEventNames=function(){var t=this;return Object.keys(this.props).filter(function(t){return/^on[A-Z][a-zA-Z]+/.test(t)}).filter(function(e){return t.props[e]})},e.prototype.bindEventHandlers=function(t){var e=this;this.getBindingEventNames().forEach(function(n){var r=n[2].toLowerCase()+n.slice(3);e.editorInst.off(r),e.editorInst.on(r,t[n])})},e.prototype.getInitEvents=function(){var t=this;return this.getBindingEventNames().reduce(function(e,n){return e[n[2].toLowerCase()+n.slice(3)]=t.props[n],e},{})},e.prototype.componentDidMount=function(){this.editorInst=new i.ZP(h(h({el:this.rootEl.current},this.props),{events:this.getInitEvents()}))},e.prototype.shouldComponentUpdate=function(t){var e=this.getInstance(),n=t.height,r=t.previewStyle;return n&&this.props.height!==n&&e.setHeight(n),r&&this.props.previewStyle!==r&&e.changePreviewStyle(r),this.bindEventHandlers(t),!1},e.prototype.render=function(){return r.createElement("div",{ref:this.rootEl})},e}(r.Component);!function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.rootEl=r.createRef(),e}l(e,t),e.prototype.getRootElement=function(){return this.rootEl.current},e.prototype.getInstance=function(){return this.viewerInst},e.prototype.getBindingEventNames=function(){var t=this;return Object.keys(this.props).filter(function(t){return/^on[A-Z][a-zA-Z]+/.test(t)}).filter(function(e){return t.props[e]})},e.prototype.bindEventHandlers=function(t){var e=this;
6this.getBindingEventNames().forEach(function(n){var r=n[2].toLowerCase()+n.slice(3);e.viewerInst.off(r),e.viewerInst.on(r,t[n])})},e.prototype.getInitEvents=function(){var t=this;return this.getBindingEventNames().reduce(function(e,n){return e[n[2].toLowerCase()+n.slice(3)]=t.props[n],e},{})},e.prototype.componentDidMount=function(){this.viewerInst=new(s())(h(h({el:this.rootEl.current},this.props),{events:this.getInitEvents()}))},e.prototype.shouldComponentUpdate=function(t){return this.bindEventHandlers(t),!1},e.prototype.render=function(){return r.createElement("div",{ref:this.rootEl})}}(r.Component)},26254:function(){},17486:function(t){"use strict";function e(t){this.content=t}e.prototype={constructor:e,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return -1},get:function(t){var e=this.find(t);return -1==e?void 0:this.content[e+1]},update:function(t,n,r){var i=r&&r!=t?this.remove(r):this,o=i.find(t),s=i.content.slice();return -1==o?s.push(r||t,n):(s[o+1]=n,r&&(s[o]=r)),new e(s)},remove:function(t){var n=this.find(t);if(-1==n)return this;var r=this.content.slice();return r.splice(n,2),new e(r)},addToStart:function(t,n){return new e([t,n].concat(this.remove(t).content))},addToEnd:function(t,n){var r=this.remove(t).content.slice();return r.push(t,n),new e(r)},addBefore:function(t,n,r){var i=this.remove(n),o=i.content.slice(),s=i.find(t);return o.splice(-1==s?o.length:s,0,n,r),new e(o)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return(t=e.from(t)).size?new e(t.content.concat(this.subtract(t).content)):this},append:function(t){return(t=e.from(t)).size?new e(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var n=this;t=e.from(t);for(var r=0;r<t.content.length;r+=2)n=n.remove(t.content[r]);return n},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}},e.from=function(t){if(t instanceof e)return t;var n=[];if(t)for(var r in t)n.push(r,t[r]);return new e(n)},t.exports=e},18256:function(t,e,n){"use strict";var r,i=n(57435),o=n(24023),s=(Object.defineProperty(r=function t(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};(function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")})(this,t),this.match=e,this.match=e,this.handler="string"==typeof n?function(t,e,r,i){var o=n;if(e[1]){var s=e[0].lastIndexOf(e[1]);o+=e[0].slice(s+e[1].length);var a=(r+=s)-i;a>0&&(o=e[0].slice(s-a,s)+o,r=i)}return t.tr.insertText(o,r,i)}:n,this.undoable=!1!==r.undoable,this.inCode=r.inCode||!1},"prototype",{writable:!1}),r);function a(t,e,n,r,i,o){if(t.composing)return!1;for(var s=t.state,a=s.doc.resolve(e),l=a.parent.textBetween(Math.max(0,a.parentOffset-500),a.parentOffset,null,"")+r,h=0;h<i.length;h++){var c=i[h];if(a.parent.type.spec.code){if(!c.inCode)continue}else if("only"===c.inCode)continue;var u=c.match.exec(l),p=u&&c.handler(s,u,e-(u[0].length-r.length),n);if(p)return c.undoable&&p.setMeta(o,{transform:p,from:e,to:n,text:r}),t.dispatch(p),!0}return!1}var l=new s(/--$/,"â"),h=new s(/\.\.\.$/,"â¦"),c=new s(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,"â"),u=new s(/"$/,"â"),p=new s(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,"â"),f=new s(/'$/,"â"),d=[c,u,p,f];e.InputRule=s,e.closeDoubleQuote=u,e.closeSingleQuote=f,e.ellipsis=h,e.emDash=l,e.inputRules=function(t){var e=t.rules,n=new i.Plugin({state:{init:function(){return null},apply:function(t,e){return t.getMeta(this)||(t.selectionSet||t.docChanged?null:e)}},props:{handleTextInput:function(t,r,i,o){return a(t,r,i,o,e,n)},handleDOMEvents:{compositionend:function(t){setTimeout(function(){var r=t.state.selection.$cursor;r&&a(t,r.pos,r.pos,"",e,n)})}}},isInputRules:!0});return n},e.openDoubleQuote=c,e.openSingleQuote=p,e.smartQuotes=d,e.textblockTypeInputRule=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return new s(t,function(t,r,i,o){var s=t.doc.resolve(i),a=n instanceof Function?n(r):n;return s.node(-1).canReplaceWith(s.index(-1),s.indexAfter(-1),e)?t.tr.delete(i,o).setBlockType(i,i,e,a):null})},e.undoInputRule=function(t,e){for(var n=t.plugins,r=0;r<n.length;r++){var i=n[r],o=void 0;
6if(i.spec.isInputRules&&(o=i.getState(t))){if(e){for(var s=t.tr,a=o.transform,l=a.steps.length-1;l>=0;l--)s.step(a.steps[l].invert(a.docs[l]));if(o.text){var h=s.doc.resolve(o.from).marks();s.replaceWith(o.from,o.to,t.schema.text(o.text,h))}else s.delete(o.from,o.to);e(s)}return!0}}return!1},e.wrappingInputRule=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3?arguments[3]:void 0;return new s(t,function(t,i,s,a){var l=n instanceof Function?n(i):n,h=t.tr.delete(s,a),c=h.doc.resolve(s).blockRange(),u=c&&o.findWrapping(c,e,l);if(!u)return null;h.wrap(c,u);var p=h.doc.resolve(s-1).nodeBefore;return p&&p.type==e&&o.canJoin(h.doc,s-1)&&(!r||r(i,p))&&h.join(s-1),h})}},50610:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(82933),i=n(57435),o="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function s(t,e){var n=!(arguments.length>2)||void 0===arguments[2]||arguments[2];return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n&&e.shiftKey&&(t="Shift-"+t),t}function a(t){var e=function(t){var e=Object.create(null);for(var n in t)e[function(t){var e,n,r,i,s=t.split(/-(?!$)/),a=s[s.length-1];"Space"==a&&(a=" ");for(var l=0;l<s.length-1;l++){var h=s[l];if(/^(cmd|meta|m)$/i.test(h))i=!0;else if(/^a(lt)?$/i.test(h))e=!0;else if(/^(c|ctrl|control)$/i.test(h))n=!0;else if(/^s(hift)?$/i.test(h))r=!0;else if(/^mod$/i.test(h))o?i=!0:n=!0;else throw Error("Unrecognized modifier name: "+h)}return e&&(a="Alt-"+a),n&&(a="Ctrl-"+a),i&&(a="Meta-"+a),r&&(a="Shift-"+a),a}(n)]=t[n];return e}(t);return function(t,n){var i,o=r.keyName(n),a=e[s(o,n)];if(a&&a(t.state,t.dispatch,t))return!0;if(1==o.length&&" "!=o){if(n.shiftKey){var l=e[s(o,n,!1)];if(l&&l(t.state,t.dispatch,t))return!0}if((n.shiftKey||n.altKey||n.metaKey||o.charCodeAt(0)>127)&&(i=r.base[n.keyCode])&&i!=o){var h=e[s(i,n)];if(h&&h(t.state,t.dispatch,t))return!0}}return!1}}e.keydownHandler=a,e.keymap=function(t){return new i.Plugin({props:{handleKeyDown:a(t)}})}},50401:function(t,e,n){"use strict";function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function i(){return(i="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=u(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}}).apply(this,arguments)}function o(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&c(t,e)}function s(t){var e=h();return function(){var n,r=u(t);return n=e?Reflect.construct(r,arguments,u(this).constructor):r.apply(this,arguments),function(t,e){if(e&&("object"===p(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,n)}}function a(t){var e="function"==typeof Map?new Map:void 0;return(a=function(t){if(null===t||!function(t){try{return -1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return l(t,arguments,u(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),c(n,t)})(t)}function l(t,e,n){return(l=h()?Reflect.construct.bind():function(t,e,n){var r=[null];r.push.apply(r,e);var i=new(Function.bind.apply(t,r));return n&&c(i,n.prototype),i}).apply(null,arguments)}function h(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}
6function c(t,e){return(c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function u(t){return(u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function p(t){return(p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function f(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}function d(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,function(t){var e=function(t,e){if("object"!==p(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!==p(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===p(e)?e:String(e)}(r.key),r)}}function m(t,e,n){return e&&d(t.prototype,e),n&&d(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}var v=n(17486),y=function(){function t(e,n){if(f(this,t),this.content=e,this.size=n||0,null==n)for(var r=0;r<e.length;r++)this.size+=e[r].nodeSize}return m(t,[{key:"nodesBetween",value:function(t,e,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<e;o++){var a=this.content[o],l=s+a.nodeSize;if(l>t&&!1!==n(a,r+s,i||null,o)&&a.content.size){var h=s+1;a.nodesBetween(Math.max(0,t-h),Math.min(a.content.size,e-h),n,r+h)}s=l}}},{key:"descendants",value:function(t){this.nodesBetween(0,this.size,t)}},{key:"textBetween",value:function(t,e,n,r){var i="",o=!0;return this.nodesBetween(t,e,function(s,a){var l=s.isText?s.text.slice(Math.max(t,a)-a,e-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(e){if(!e.size)return this;if(!this.size)return e;var n=this.lastChild,r=e.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<e.content.length;o++)i.push(e.content[o]);return new t(i,this.size+e.size)}},{key:"cut",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.size;if(0==e&&n==this.size)return this;var r=[],i=0;if(n>e)for(var o=0,s=0;s<n;o++){var a=this.content[o],l=s+a.nodeSize;l>e&&((s<e||l>n)&&(a=a.isText?a.cut(Math.max(0,e-s),Math.min(a.text.length,n-s)):a.cut(Math.max(0,e-s-1),Math.min(a.content.size,n-s-1))),r.push(a),i+=a.nodeSize),s=l}return new t(r,i)}},{key:"cutByIndex",value:function(e,n){return e==n?t.empty:0==e&&n==this.content.length?this:new t(this.content.slice(e,n))}},{key:"replaceChild",value:function(e,n){var r=this.content[e];if(r==n)return this;var i=this.content.slice(),o=this.size+n.nodeSize-r.nodeSize;return i[e]=n,new t(i,o)}},{key:"addToStart",value:function(e){return new t([e].concat(this.content),this.size+e.nodeSize)}},{key:"addToEnd",value:function(e){return new t(this.content.concat(e),this.size+e.nodeSize)}},{key:"eq",value:function(t){if(this.content.length!=t.content.length)return!1;for(var e=0;e<this.content.length;e++)if(!this.content[e].eq(t.content[e]))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(t){var e=this.content[t];if(!e)throw RangeError("Index "+t+" out of range for "+this);return e}},{key:"maybeChild",value:function(t){return this.content[t]||null}},{key:"forEach",value:function(t){for(var e=0,n=0;e<this.content.length;e++){var r=this.content[e];t(r,n,e),n+=r.nodeSize}}},{key:"findDiffStart",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return function t(e,n,r){for(var i=0;;i++){if(i==e.childCount||i==n.childCount)return e.childCount==n.childCount?null:r;var o=e.child(i),s=n.child(i);if(o==s){r+=o.nodeSize;continue}if(!o.sameMarkup(s))return r;if(o.isText&&o.text!=s.text){for(var a=0;o.text[a]==s.text[a];a++)r++;return r}
6if(o.content.size||s.content.size){var l=t(o.content,s.content,r+1);if(null!=l)return l}r+=o.nodeSize}}(this,t,e)}},{key:"findDiffEnd",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.size,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.size;return function t(e,n,r,i){for(var o=e.childCount,s=n.childCount;;){if(0==o||0==s)return o==s?null:{a:r,b:i};var a=e.child(--o),l=n.child(--s),h=a.nodeSize;if(a==l){r-=h,i-=h;continue}if(!a.sameMarkup(l))return{a:r,b:i};if(a.isText&&a.text!=l.text){for(var c=0,u=Math.min(a.text.length,l.text.length);c<u&&a.text[a.text.length-c-1]==l.text[l.text.length-c-1];)c++,r--,i--;return{a:r,b:i}}if(a.content.size||l.content.size){var p=t(a.content,l.content,r-1,i-1);if(p)return p}r-=h,i-=h}}(this,t,e,n)}},{key:"findIndex",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;if(0==t)return k(0,t);if(t==this.size)return k(this.content.length,t);if(t>this.size||t<0)throw RangeError("Position ".concat(t," outside of fragment (").concat(this,")"));for(var n=0,r=0;;n++){var i=r+this.child(n).nodeSize;if(i>=t){if(i==t||e>0)return k(n+1,i);return k(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(t){return t.toJSON()}):null}}],[{key:"fromJSON",value:function(e,n){if(!n)return t.empty;if(!Array.isArray(n))throw RangeError("Invalid input for Fragment.fromJSON");return new t(n.map(e.nodeFromJSON))}},{key:"fromArray",value:function(e){if(!e.length)return t.empty;for(var n,r=0,i=0;i<e.length;i++){var o=e[i];r+=o.nodeSize,i&&o.isText&&e[i-1].sameMarkup(o)?(n||(n=e.slice(0,i)),n[n.length-1]=o.withText(n[n.length-1].text+o.text)):n&&n.push(o)}return new t(n||e,r)}},{key:"from",value:function(e){if(!e)return t.empty;if(e instanceof t)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new t([e],e.nodeSize);throw RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}]),t}();y.empty=new y([],0);var g={index:0,offset:0};function k(t,e){return g.index=t,g.offset=e,g}function w(t,e){if(t===e)return!0;if(!(t&&"object"==p(t))||!(e&&"object"==p(e)))return!1;var n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(var r=0;r<t.length;r++)if(!w(t[r],e[r]))return!1}else{for(var i in t)if(!(i in e)||!w(t[i],e[i]))return!1;for(var o in e)if(!(o in t))return!1}return!0}var x=function(){function t(e,n){f(this,t),this.type=e,this.attrs=n}return m(t,[{key:"addToSet",value:function(t){for(var e,n=!1,r=0;r<t.length;r++){var i=t[r];if(this.eq(i))return t;if(this.type.excludes(i.type))e||(e=t.slice(0,r));else{if(i.type.excludes(this.type))return t;!n&&i.type.rank>this.type.rank&&(e||(e=t.slice(0,r)),e.push(this),n=!0),e&&e.push(i)}}return e||(e=t.slice()),n||e.push(this),e}},{key:"removeFromSet",value:function(t){for(var e=0;e<t.length;e++)if(this.eq(t[e]))return t.slice(0,e).concat(t.slice(e+1));return t}},{key:"isInSet",value:function(t){for(var e=0;e<t.length;e++)if(this.eq(t[e]))return!0;return!1}},{key:"eq",value:function(t){return this==t||this.type==t.type&&w(this.attrs,t.attrs)}},{key:"toJSON",value:function(){var t={type:this.type.name};for(var e in this.attrs){t.attrs=this.attrs;break}return t}}],[{key:"fromJSON",value:function(t,e){if(!e)throw RangeError("Invalid input for Mark.fromJSON");var n=t.marks[e.type];if(!n)throw RangeError("There is no mark type ".concat(e.type," in this schema"));var r=n.create(e.attrs);return n.checkAttrs(r.attrs),r}},{key:"sameSet",value:function(t,e){if(t==e)return!0;if(t.length!=e.length)return!1;for(var n=0;n<t.length;n++)if(!t[n].eq(e[n]))return!1;return!0}},{key:"setFrom",value:function(e){if(!e||Array.isArray(e)&&0==e.length)return t.none;if(e instanceof t)return[e];var n=e.slice();return n.sort(function(t,e){return t.type.rank-e.type.rank}),n}}]),t}();x.none=[];var S=function(t){o(n,t);var e=s(n);function n(){return f(this,n),e.apply(this,arguments)}return m(n)}(a(Error)),b=function(){function t(e,n,r){f(this,t),this.content=e,this.openStart=n,this.openEnd=r}return m(t,[{key:"size",get:function(){return this.content.size-this.openStart-this.openEnd}},{key:"insertAt",value:function(e,n){var r=function t(e,n,r,i){var o=e.findIndex(n),s=o.index,a=o.offset,l=e.maybeChild(s);if(a==n||l.isText)return i&&!i.canReplace(s,s,r)?null:e.cut(0,n).append(r).append(e.cut(n));var h=t(l.content,n-a-1,r);return h&&e.replaceChild(s,l.copy(h))}(this.content,e+this.openStart,n);return r&&new t(r,this.openStart,this.openEnd)}},{key:"removeBetween",value:function(e,n){return new t(function t(e,n,r){var i=e.findIndex(n),o=i.index,s=i.offset,a=e.maybeChild(o),l=e.findIndex(r),h=l.index,c=l.offset;if(s==n||a.isText){if(c!=r&&!e.child(h).isText)throw RangeError("Removing non-flat range");return e.cut(0,n).append(e.cut(r))}if(o!=h)throw RangeError("Removing non-flat range");return e.replaceChild(o,a.copy(t(a.content,n-s-1,r-s-1)))}(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}},{key:"eq",value:function(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}},{key:"toString",value:function(){return this.content+"("+this.openStart+","+this.openEnd+")"}},{key:"toJSON",value:function(){if(!this.content.size)return null;var t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}}],[{key:"fromJSON",value:function(e,n){if(!n)return t.empty;var r=n.openStart||0,i=n.openEnd||0;if("number"!=typeof r||"number"!=typeof i)throw RangeError("Invalid input for Slice.fromJSON");return new t(y.fromJSON(e,n.content),r,i)}},{key:"maxOpen",value:function(e){for(var n=!(arguments.length>1)||void 0===arguments[1]||arguments[1],r=0,i=0,o=e.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)r++;for(var s=e.lastChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.lastChild)i++;return new t(e,r,i)}}]),t}();function M(t,e){if(!e.type.compatibleContent(t.type))throw new S("Cannot join "+e.type.n
6ame+" onto "+t.type.name)}function O(t,e,n){var r=t.node(n);return M(r,e.node(n)),r}function C(t,e){var n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function E(t,e,n,r){var i=(e||t).node(n),o=0,s=e?e.index(n):i.childCount;t&&(o=t.index(n),t.depth>n?o++:t.textOffset&&(C(t.nodeAfter,r),o++));for(var a=o;a<s;a++)C(i.child(a),r);e&&e.depth==n&&e.textOffset&&C(e.nodeBefore,r)}function T(t,e){return t.type.checkContent(e),t.copy(e)}function R(t,e,n){var r=[];return E(null,t,n,r),t.depth>n&&C(T(O(t,e,n+1),R(t,e,n+1)),r),E(e,null,n,r),new y(r)}b.empty=new b(y.empty,0,0);var N=function(){function t(e,n,r){f(this,t),this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}return m(t,[{key:"resolveDepth",value:function(t){return null==t?this.depth:t<0?this.depth+t:t}},{key:"parent",get:function(){return this.node(this.depth)}},{key:"doc",get:function(){return this.node(0)}},{key:"node",value:function(t){return this.path[3*this.resolveDepth(t)]}},{key:"index",value:function(t){return this.path[3*this.resolveDepth(t)+1]}},{key:"indexAfter",value:function(t){return t=this.resolveDepth(t),this.index(t)+(t!=this.depth||this.textOffset?1:0)}},{key:"start",value:function(t){return 0==(t=this.resolveDepth(t))?0:this.path[3*t-1]+1}},{key:"end",value:function(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}},{key:"before",value:function(t){if(!(t=this.resolveDepth(t)))throw RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]}},{key:"after",value:function(t){if(!(t=this.resolveDepth(t)))throw RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]+this.path[3*t].nodeSize}},{key:"textOffset",get:function(){return this.pos-this.path[this.path.length-1]}},{key:"nodeAfter",get:function(){var t=this.parent,e=this.index(this.depth);if(e==t.childCount)return null;var n=this.pos-this.path[this.path.length-1],r=t.child(e);return n?t.child(e).cut(n):r}},{key:"nodeBefore",get:function(){var t=this.index(this.depth),e=this.pos-this.path[this.path.length-1];return e?this.parent.child(t).cut(0,e):0==t?null:this.parent.child(t-1)}},{key:"posAtIndex",value:function(t,e){e=this.resolveDepth(e);for(var n=this.path[3*e],r=0==e?0:this.path[3*e-1]+1,i=0;i<t;i++)r+=n.child(i).nodeSize;return r}},{key:"marks",value:function(){var t=this.parent,e=this.index();if(0==t.content.size)return x.none;if(this.textOffset)return t.child(e).marks;var n=t.maybeChild(e-1),r=t.maybeChild(e);if(!n){var i=n;n=r,r=i}for(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(t){var e=this.parent.maybeChild(this.index());if(!e||!e.isInline)return null;for(var n=e.marks,r=t.parent.maybeChild(t.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(t){for(var e=this.depth;e>0;e--)if(this.start(e)<=t&&this.end(e)>=t)return e;return 0}},{key:"blockRange",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this,e=arguments.length>1?arguments[1]:void 0;if(t.pos<this.pos)return t.blockRange(this);for(var n=this.depth-(this.parent.inlineContent||this.pos==t.pos?1:0);n>=0;n--)if(t.pos<=this.end(n)&&(!e||e(this.node(n))))return new F(this,t,n);return null}},{key:"sameParent",value:function(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}},{key:"max",value:function(t){return t.pos>this.pos?t:this}},{key:"min",value:function(t){return t.pos<this.pos?t:this}},{key:"toString",value:function(){for(var t="",e=1;e<=this.depth;e++)t+=(t?"/":"")+this.node(e).type.name+"_"+this.index(e-1);return t+":"+this.parentOffset}}],[{key:"resolve",value:function(e,n){if(!(n>=0&&n<=e.content.size))throw RangeError("Position "+n+" out of range");for(var r=[],i=0,o=n,s=e;;){var a=s.content.findIndex(o),l=a.index,h=a.offset,c=o-h;if(r.push(s,l,i+h),!c||(s=s.child(l)).isText)break;o=c-1,i+=h+1}return new t(n,r,o)}},{key:"resolveCached",value:function(e,n){var r=z.get(e);if(r)for(var i=0;i<r.elts.length;i++){var o=r.elts[i];if(o.pos==n)return o}else z.set(e,r=new A);var s=r.elts[r.i]=t.resolve(e,n);return r.i=(r.i+1)%I,s}}]),t}(),A=m(function t(){f(this,t),this.elts=[],this.i=0}),I=12,z=new WeakMap,F=function(){function t(e,n,r){f(this,t),this.$from=e,this.$to=n,this.depth=r}return m(t,[{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)}}]),t}(),J=Object.create(null),$=function(){function t(e,n,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:x.none;f(this,t),this.type=e,this.attrs=n,this.marks=i,this.content=r||y.empty}return m(t,[{key:"nodeSize",get:function(){return this.isLeaf?1:2+this.content.size}},{key:"childCount",get:function(){return this.content.childCount}},{key:"child",value:function(t){return this.content.child(t)}},{key:"maybeChild",value:function(t){return this.content.maybeChild(t)}}
6,{key:"forEach",value:function(t){this.content.forEach(t)}},{key:"nodesBetween",value:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;this.content.nodesBetween(t,e,n,r,this)}},{key:"descendants",value:function(t){this.nodesBetween(0,this.content.size,t)}},{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(t,e,n,r){return this.content.textBetween(t,e,n,r)}},{key:"firstChild",get:function(){return this.content.firstChild}},{key:"lastChild",get:function(){return this.content.lastChild}},{key:"eq",value:function(t){return this==t||this.sameMarkup(t)&&this.content.eq(t.content)}},{key:"sameMarkup",value:function(t){return this.hasMarkup(t.type,t.attrs,t.marks)}},{key:"hasMarkup",value:function(t,e,n){return this.type==t&&w(this.attrs,e||t.defaultAttrs||J)&&x.sameSet(this.marks,n||x.none)}},{key:"copy",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return e==this.content?this:new t(this.type,this.attrs,e,this.marks)}},{key:"mark",value:function(e){return e==this.marks?this:new t(this.type,this.attrs,this.content,e)}},{key:"cut",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.content.size;return 0==t&&e==this.content.size?this:this.copy(this.content.cut(t,e))}},{key:"slice",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.content.size,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(t==e)return b.empty;var r=this.resolve(t),i=this.resolve(e),o=n?0:r.sharedDepth(e),s=r.start(o);return new b(r.node(o).content.cut(r.pos-s,i.pos-s),r.depth-o,i.depth-o)}},{key:"replace",value:function(t,e,n){return function(t,e,n){if(n.openStart>t.depth)throw new S("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new S("Inconsistent open depths");return function t(e,n,r,i){var o=e.index(i),s=e.node(i);if(o==n.index(i)&&i<e.depth-r.openStart){var a=t(e,n,r,i+1);return s.copy(s.content.replaceChild(o,a))}if(!r.content.size)return T(s,R(e,n,i));if(r.openStart||r.openEnd||e.depth!=i||n.depth!=i){var l=function(t,e){for(var n=e.depth-t.openStart,r=e.node(n).copy(t.content),i=n-1;i>=0;i--)r=e.node(i).copy(y.from(r));return{start:r.resolveNoCache(t.openStart+n),end:r.resolveNoCache(r.content.size-t.openEnd-n)}}(r,e);return T(s,function t(e,n,r,i,o){var s=e.depth>o&&O(e,n,o+1),a=i.depth>o&&O(r,i,o+1),l=[];return E(null,e,o,l),s&&a&&n.index(o)==r.index(o)?(M(s,a),C(T(s,t(e,n,r,i,o+1)),l)):(s&&C(T(s,R(e,n,o+1)),l),E(n,r,o,l),a&&C(T(a,R(r,i,o+1)),l)),E(i,null,o,l),new y(l)}(e,l.start,l.end,n,i))}var h=e.parent,c=h.content;return T(h,c.cut(0,e.parentOffset).append(r.content).append(c.cut(n.parentOffset)))}(t,e,n,0)}(this.resolve(t),this.resolve(e),n)}},{key:"nodeAt",value:function(t){for(var e=this;;){var n=e.content.findIndex(t),r=n.index,i=n.offset;if(!(e=e.maybeChild(r)))return null;if(i==t||e.isText)return e;t-=i+1}}},{key:"childAfter",value:function(t){var e=this.content.findIndex(t),n=e.index,r=e.offset;return{node:this.content.maybeChild(n),index:n,offset:r}}},{key:"childBefore",value:function(t){if(0==t)return{node:null,index:0,offset:0};var e=this.content.findIndex(t),n=e.index,r=e.offset;if(r<t)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(t){return N.resolveCached(this,t)}},{key:"resolveNoCache",value:function(t){return N.resolve(this,t)}},{key:"rangeHasMark",value:function(t,e,n){var r=!1;return e>t&&this.nodesBetween(t,e,function(t){return n.isInSet(t.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}}
6,{key:"toString",value:function(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);var t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),j(this.marks,t)}},{key:"contentMatchAt",value:function(t){var e=this.type.contentMatch.matchFragment(this.content,0,t);if(!e)throw Error("Called contentMatchAt on a node with invalid content");return e}},{key:"canReplace",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:y.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(t).matchFragment(n,r,i),s=o&&o.matchFragment(this.content,e);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(t,e,n,r){if(r&&!this.type.allowsMarks(r))return!1;var i=this.contentMatchAt(t).matchType(n),o=i&&i.matchFragment(this.content,e);return!!o&&o.validEnd}},{key:"canAppend",value:function(t){return t.content.size?this.canReplace(this.childCount,this.childCount,t.content):this.type.compatibleContent(t.type)}},{key:"check",value:function(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);for(var t=x.none,e=0;e<this.marks.length;e++){var n=this.marks[e];n.type.checkAttrs(n.attrs),t=n.addToSet(t)}if(!x.sameSet(t,this.marks))throw RangeError("Invalid collection of marks for node ".concat(this.type.name,": ").concat(this.marks.map(function(t){return t.type.name})));this.content.forEach(function(t){return t.check()})}},{key:"toJSON",value:function(){var t={type:this.type.name};for(var e in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map(function(t){return t.toJSON()})),t}}],[{key:"fromJSON",value:function(t,e){if(!e)throw RangeError("Invalid input for Node.fromJSON");var n=void 0;if(e.marks){if(!Array.isArray(e.marks))throw RangeError("Invalid mark data for Node.fromJSON");n=e.marks.map(t.markFromJSON)}if("text"==e.type){if("string"!=typeof e.text)throw RangeError("Invalid text node in JSON");return t.text(e.text,n)}var r=y.fromJSON(t,e.content),i=t.nodeType(e.type).create(e.attrs,r,n);return i.type.checkAttrs(i.attrs),i}}]),t}();$.prototype.text=void 0;var B=function(t){o(n,t);var e=s(n);function n(t,r,i,o){var s;if(f(this,n),s=e.call(this,t,r,null,o),!i)throw RangeError("Empty text nodes are not allowed");return s.text=i,s}return m(n,[{key:"toString",value:function(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):j(this.marks,JSON.stringify(this.text))}},{key:"textContent",get:function(){return this.text}},{key:"textBetween",value:function(t,e){return this.text.slice(t,e)}},{key:"nodeSize",get:function(){return this.text.length}},{key:"mark",value:function(t){return t==this.marks?this:new n(this.type,this.attrs,this.text,t)}},{key:"withText",value:function(t){return t==this.text?this:new n(this.type,this.attrs,t,this.marks)}},{key:"cut",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.text.length;return 0==t&&e==this.text.length?this:this.withText(this.text.slice(t,e))}},{key:"eq",value:function(t){return this.sameMarkup(t)&&this.text==t.text}},{key:"toJSON",value:function(){var t=i(u(n.prototype),"toJSON",this).call(this);return t.text=this.text,t}}]),n}($);function j(t,e){for(var n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}var D=function(){function t(e){f(this,t),this.validEnd=e,this.next=[],this.wrapCache=[]}return m(t,[{key:"matchType",value:function(t){for(var e=0;e<this.next.length;e++)if(this.next[e].type==t)return this.next[e].next;return null}},{key:"matchFragment",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.childCount,r=this,i=e;r&&i<n;i++)r=r.matchType(t.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 t=0;t<this.next.length;t++){var e=this.next[t].type;if(!(e.isText||e.hasRequiredAttrs()))return e}return null}},{key:"compatible",value:function(t){for(var e=0;e<this.next.length;e++)for(var n=0;n<t.next.length;n++)if(this.next[e].type==t.next[n].type)return!0;return!1}},{key:"fillBefore",value:function(t){var e=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(t,n);if(a&&(!e||a.validEnd))return y.from(s.map(function(t){return t.createAndFill()}));for(var l=0;l<o.next.length;l++){var h=o.next[l],c=h.type,u=h.next;if(!(c.isText||c.hasRequiredAttrs())&&-1==r.indexOf(u)){r.push(u);var p=i(u,s.concat(c));if(p)return p}}return null}(this,[])}},{key:"findWrapping",value:function(t){for(var e=0;e<this.wrapCache.length;e+=2)if(this.wrapCache[e]==t)return this.wrapCache[e+1];var n=this.computeWrapping(t);return this.wrapCache.push(t,n),n}},{key:"computeWrapping",value:function(t){for(var e=Object.create(null),n=[{match:this,type:null,via:null}];n.length;){var r=n.shift(),i=r.match;if(i.matchType(t)){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],h=l.type,c=l.next;h.isLeaf||h.hasRequiredAttrs()||h.name in e||r.type&&!c.validEnd||(n.push({match:h.contentMatch,type:h,via:r}),e[h.name]=!0)}}return null}},{key:"edgeCount",get:function(){return this.next.length}},{key:"edge",value:function(t){if(t>=this.next.length)throw RangeError("There's no ".concat(t,"th edge in this content match"));return this.next[t]}},{key:"toString",value:function(){var t=[];return function e(n){t.push(n);for(var r=0;r<n.next.length;r++)-1==t.indexOf(n.next[r].next)&&e(n.next[r].next)}(this),t.map(function(e,n){for(var r=n+(e.validEnd?"*":" ")+" ",i=0;i<e.next.length;i++)r+=(i?", ":"")+e.next[i].type.name+"->"+t.indexOf(e.next[i].next);return r}).join("\n")}}],[{key:"parse",value:function(e,n){var r,i,o=new P(e,n);if(null==o.next)return t.empty;var s=function t(e){var n=[];do n.push(function(e){var n=[];do n.push(function(e){for(var n=function(e){if(e.eat("(")){var n=t(e);return e.eat(")")||e.err("Missing closing paren"),n}if(/\W/.test(e.next))e.err("Unexpected token '"+e.next+"'");else{var r=(function(t,e){var n=t.nodeTypes,r=n[e];if(r)return[r];var i=[];for(var o in n){var s=n[o];s.groups.indexOf(e)>-1&&i.push(s)}return 0==i.length&&t.err("No node type or group '"+e+"' 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==r.length?r[0]:{type:"choice",exprs:r}}}(e);;)if(e.eat("+"))n={type:"plus",expr:n};else if(e.eat("*"))n={type:"star",expr:n};else if(e.eat("?"))n={type:"opt",expr:n};else if(e.eat("{"))n=function(t,e){var n=W(t),r=n;return t.eat(",")&&(r="}"!=t.next?W(t):-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}(e,n);else break;return n}(e));while(e.next&&")"!=e.next&&"|"!=e.next);return 1==n.length?n[0]:{type:"seq",exprs:n}}(e));while(e.eat("|"));return 1==n.length?n[0]:{type:"choice",exprs:n}}(o);o.next&&o.err("Unexpected trailing text");var a=(r=function(t){var e=[[]];return i(function t(e,o){if("choice"==e.type)return e.exprs.reduce(function(e,n){return e.concat(t(n,o))},[]);if("seq"==e.type)for(var s=0;;s++){var a=t(e.exprs[s],o);if(s==e.exprs.length-1)return a;i(a,o=n())}else if("star"==e.type){var l=n();return r(o,l),i(t(e.expr,l),l),[r(l)]}else if("plus"==e.type){var h=n();return i(t(e.expr,o),h),i(t(e.expr,h),h),[r(h)]}else if("opt"==e.type)return[r(o)].concat(t(e.expr,o));else if("range"==e.type){for(var c=o,u=0;u<e.min;u++){var p=n();i(t(e.expr,c),p),c=p}if(-1==e.max)i(t(e.expr,c),c);else for(var f=e.min;f<e.max;f++){var d=n();r(c,d),i(t(e.expr,c),d),c=d}return[r(c)]}else if("name"==e.type)return[r(o,void 0,e.value)];else throw Error("Unknown expr type")}(t,0),n()),e;function n(){return e.push([])-1}function r(t,n,r){var i={term:r,to:n};return e[t].push(i),i}function i(t,e){t.forEach(function(t){return t.to=e})}}(s),i=Object.create(null),function t(e){var n=[];e.forEach(function(t){r[t].forEach(function(t){var e,i=t.term,o=t.to;if(i){for(var s=0;s<n.length;s++)n[s][0]==i&&(e=n[s][1]);
6q(r,o).forEach(function(t){e||n.push([i,e=[]]),-1==e.indexOf(t)&&e.push(t)})}})});for(var o=i[e.join(",")]=new D(e.indexOf(r.length-1)>-1),s=0;s<n.length;s++){var a=n[s][1].sort(L);o.next.push({type:n[s][0],next:i[a.join(",")]||t(a)})}return o}(q(r,0)));return function(t,e){for(var n=0,r=[t];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],h=l.type,c=l.next;s.push(h.name),o&&!(h.isText||h.hasRequiredAttrs())&&(o=!1),-1==r.indexOf(c)&&r.push(c)}o&&e.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(a,o),a}}]),t}();D.empty=new D(!0);var P=function(){function t(e,n){f(this,t),this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()}return m(t,[{key:"next",get:function(){return this.tokens[this.pos]}},{key:"eat",value:function(t){return this.next==t&&(this.pos++||!0)}},{key:"err",value:function(t){throw SyntaxError(t+" (in content expression '"+this.string+"')")}}]),t}();function W(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");var e=Number(t.next);return t.pos++,e}function L(t,e){return e-t}function q(t,e){var n=[];return function e(r){var i=t[r];if(1==i.length&&!i[0].term)return e(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)||e(l)}}(e),n.sort(L)}function _(t){var e=Object.create(null);for(var n in t){var r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function H(t,e){var n=Object.create(null);for(var r in t){var i=e&&e[r];if(void 0===i){var o=t[r];if(o.hasDefault)i=o.default;else throw RangeError("No value supplied for attribute "+r)}n[r]=i}return n}function K(t,e,n,r){for(var i in e)if(!(i in t))throw RangeError("Unsupported attribute ".concat(i," for ").concat(n," of type ").concat(i));for(var o in t){var s=t[o];s.validate&&s.validate(e[o])}}function Y(t,e){var n=Object.create(null);if(e)for(var r in e)n[r]=new V(t,r,e[r]);return n}var U=function(){function t(e,n,r){f(this,t),this.name=e,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=Y(e,r.attrs),this.defaultAttrs=_(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||"text"==e),this.isText="text"==e}return m(t,[{key:"isInline",get:function(){return!this.isBlock}},{key:"isTextblock",get:function(){return this.isBlock&&this.inlineContent}},{key:"isLeaf",get:function(){return this.contentMatch==D.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 t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1}},{key:"compatibleContent",value:function(t){return this==t||this.contentMatch.compatible(t.contentMatch)}},{key:"computeAttrs",value:function(t){return!t&&this.defaultAttrs?this.defaultAttrs:H(this.attrs,t)}},{key:"create",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;if(this.isText)throw Error("NodeType.create can't construct text nodes");return new $(this,this.computeAttrs(t),y.from(e),x.setFrom(n))}},{key:"createChecked",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;return e=y.from(e),this.checkContent(e),new $(this,this.computeAttrs(t),e,x.setFrom(n))}},{key:"createAndFill",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;if(t=this.computeAttrs(t),(e=y.from(e)).size){var r=this.contentMatch.fillBefore(e);if(!r)return null;e=r.append(e)}var i=this.contentMatch.matchFragment(e),o=i&&i.fillBefore(y.empty,!0);return o?new $(this,t,e.append(o),x.setFrom(n)):null}},{key:"validContent",value:function(t){var e=this.contentMatch.matchFragment(t);if(!e||!e.validEnd)return!1;for(var n=0;n<t.childCount;n++)if(!this.allowsMarks(t.child(n).marks))return!1;return!0}},{key:"checkContent",value:function(t){if(!this.validContent(t))throw RangeError("Invalid content for node ".concat(this.name,": ").concat(t.toString().slice(0,50)))}},{key:"checkAttrs",value:function(t){K(this.attrs,t,"node",this.name)}},{key:"allowsMarkType",value:function(t){return null==this.markSet||this.markSet.indexOf(t)>-1}},{key:"allowsMarks",value:function(t){if(null==this.markSet)return!0;for(var e=0;e<t.length;e++)if(!this.allowsMarkType(t[e].type))return!1;return!0}},{key:"allowedMarks",value:function(t){if(null==this.markSet)return t;for(var e,n=0;n<t.length;n++)this.allowsMarkType(t[n].type)?e&&e.push(t[n]):e||(e=t.slice(0,n));return e?e.length?e:x.none:t}}
6],[{key:"compile",value:function(e,n){var r=Object.create(null);e.forEach(function(e,i){return r[e]=new t(e,n,i)});var i=n.spec.topNode||"doc";if(!r[i])throw RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw RangeError("Every schema needs a 'text' type");for(var o in r.text.attrs)throw RangeError("The text node type should not have attributes");return r}}]),t}(),V=function(){function t(e,n,r){var i;f(this,t),this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate="string"==typeof r.validate?(i=r.validate.split("|"),function(t){var r=null===t?"null":p(t);if(0>i.indexOf(r))throw RangeError("Expected value of type ".concat(i," for attribute ").concat(n," on type ").concat(e,", got ").concat(r))}):r.validate}return m(t,[{key:"isRequired",get:function(){return!this.hasDefault}}]),t}(),G=function(){function t(e,n,r,i){f(this,t),this.name=e,this.rank=n,this.schema=r,this.spec=i,this.attrs=Y(e,i.attrs),this.excluded=null;var o=_(this.attrs);this.instance=o?new x(this,o):null}return m(t,[{key:"create",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return!t&&this.instance?this.instance:new x(this,H(this.attrs,t))}},{key:"removeFromSet",value:function(t){for(var e=0;e<t.length;e++)t[e].type==this&&(t=t.slice(0,e).concat(t.slice(e+1)),e--);return t}},{key:"isInSet",value:function(t){for(var e=0;e<t.length;e++)if(t[e].type==this)return t[e]}},{key:"checkAttrs",value:function(t){K(this.attrs,t,"mark",this.name)}},{key:"excludes",value:function(t){return this.excluded.indexOf(t)>-1}}],[{key:"compile",value:function(e,n){var r=Object.create(null),i=0;return e.forEach(function(e,o){return r[e]=new t(e,i++,n,o)}),r}}]),t}(),Z=function(){function t(e){f(this,t),this.linebreakReplacement=null,this.cached=Object.create(null);var n=this.spec={};for(var r in e)n[r]=e[r];n.nodes=v.from(e.nodes),n.marks=v.from(e.marks||{}),this.nodes=U.compile(this.spec.nodes,this),this.marks=G.compile(this.spec.marks,this);var i=Object.create(null);for(var o in this.nodes){if(o in this.marks)throw RangeError(o+" can not be both a node and a mark");var s=this.nodes[o],a=s.spec.content||"",l=s.spec.marks;if(s.contentMatch=i[a]||(i[a]=D.parse(a,this.nodes)),s.inlineContent=s.contentMatch.inlineContent,s.spec.linebreakReplacement){if(this.linebreakReplacement)throw RangeError("Multiple linebreak nodes defined");if(!s.isInline||!s.isLeaf)throw RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=s}s.markSet="_"==l?null:l?Q(this,l.split(" ")):""!=l&&s.inlineContent?null:[]}for(var h in this.marks){var c=this.marks[h],u=c.spec.excludes;c.excluded=null==u?[c]:""==u?[]:Q(this,u.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}return m(t,[{key:"node",value:function(t){var e=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 t)t=this.nodeType(t);else if(t instanceof U){if(t.schema!=this)throw RangeError("Node type from different schema used ("+t.name+")")}else throw RangeError("Invalid node type: "+t);return t.createChecked(e,n,r)}},{key:"text",value:function(t,e){var n=this.nodes.text;return new B(n,n.defaultAttrs,t,x.setFrom(e))}},{key:"mark",value:function(t,e){return"string"==typeof t&&(t=this.marks[t]),t.create(e)}},{key:"nodeFromJSON",value:function(t){return $.fromJSON(this,t)}},{key:"markFromJSON",value:function(t){return x.fromJSON(this,t)}},{key:"nodeType",value:function(t){var e=this.nodes[t];if(!e)throw RangeError("Unknown node type: "+t);return e}}]),t}();function Q(t,e){for(var n=[],r=0;r<e.length;r++){var i=e[r],o=t.marks[i],s=o;if(o)n.push(o);else for(var a in t.marks){var l=t.marks[a];("_"==i||l.spec.group&&l.spec.group.split(" ").indexOf(i)>-1)&&n.push(s=l)}if(!s)throw SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}var X=function(){function t(e,n){var r=this;f(this,t),this.schema=e,this.rules=n,this.tags=[],this.styles=[];var i=this.matchedStyles=[];
6n.forEach(function(t){if(null!=t.tag)r.tags.push(t);else if(null!=t.style){var e=/[^=]*/.exec(t.style)[0];0>i.indexOf(e)&&i.push(e),r.styles.push(t)}}),this.normalizeLists=!this.tags.some(function(t){if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;var n=e.nodes[t.node];return n.contentMatch.matchType(n)})}return m(t,[{key:"parse",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=new to(this,e,!1);return n.addAll(t,x.none,e.from,e.to),n.finish()}},{key:"parseSlice",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=new to(this,e,!0);return n.addAll(t,x.none,e.from,e.to),b.maxOpen(n.finish())}},{key:"matchTag",value:function(t,e,n){for(var r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){var i,o=this.tags[r];if(i=o.tag,(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,i)&&(void 0===o.namespace||t.namespaceURI==o.namespace)&&(!o.context||e.matchesContext(o.context))){if(o.getAttrs){var s=o.getAttrs(t);if(!1===s)continue;o.attrs=s||void 0}return o}}}},{key:"matchStyle",value:function(t,e,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(t)&&(!o.context||n.matchesContext(o.context))&&(!(s.length>t.length)||61==s.charCodeAt(t.length)&&s.slice(t.length+1)==e)){if(o.getAttrs){var a=o.getAttrs(e);if(!1===a)continue;o.attrs=a||void 0}return o}}}}],[{key:"schemaRules",value:function(t){var e=[];function n(t){for(var n=null==t.priority?50:t.priority,r=0;r<e.length;r++){var i=e[r];if((null==i.priority?50:i.priority)<n)break}e.splice(r,0,t)}var r=function(e){var r=t.marks[e].spec.parseDOM;r&&r.forEach(function(t){n(t=ts(t)),t.mark||t.ignore||t.clearMark||(t.mark=e)})};for(var i in t.marks)r(i);var o=function(e){var r=t.nodes[e].spec.parseDOM;r&&r.forEach(function(t){n(t=ts(t)),t.node||t.ignore||t.mark||(t.node=e)})};for(var s in t.nodes)o(s);return e}},{key:"fromSchema",value:function(e){return e.cached.domParser||(e.cached.domParser=new t(e,t.schemaRules(e)))}}]),t}(),tt={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},te={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},tn={ol:!0,ul:!0};function tr(t,e,n){return null!=e?(e?1:0)|("full"===e?2:0):t&&"pre"==t.whitespace?3:-5&n}var ti=function(){function t(e,n,r,i,o,s){f(this,t),this.type=e,this.attrs=n,this.marks=r,this.solid=i,this.options=s,this.content=[],this.activeMarks=x.none,this.match=o||(4&s?null:e.contentMatch)}return m(t,[{key:"findWrapping",value:function(t){if(!this.match){if(!this.type)return[];var e=this.type.contentMatch.fillBefore(y.from(t));if(e)this.match=this.type.contentMatch.matchFragment(e);else{var n,r=this.type.contentMatch;return(n=r.findWrapping(t.type))?(this.match=r,n):null}}return this.match.findWrapping(t.type)}},{key:"finish",value:function(t){if(!(1&this.options)){var e,n=this.content[this.content.length-1];n&&n.isText&&(e=/[ \t\r\n\u000c]+$/.exec(n.text))&&(n.text.length==e[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-e[0].length)))}var r=y.from(this.content);return!t&&this.match&&(r=r.append(this.match.fillBefore(y.empty,!0))),this.type?this.type.create(this.attrs,r,this.marks):r}},{key:"inlineContext",value:function(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!tt.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}]),t}(),to=function(){function t(e,n,r){f(this,t),this.parser=e,this.options=n,this.isOpen=r,this.open=0;var i,o=n.topNode,s=tr(null,n.preserveWhitespace,0)|(r?4:0);i=o?new ti(o.type,o.attrs,x.none,!0,n.topMatch||o.type.contentMatch,s):r?new ti(null,null,x.none,!0,null,s):new ti(e.schema.topNodeType,null,x.none,!0,null,s),this.nodes=[i],this.find=n.findPositions,this.needsBlock=!1}return m(t,[{key:"top",get:function(){return this.nodes[this.open]}},{key:"addDOM",value:function(t,e){3==t.nodeType?this.addTextNode(t,e):1==t.nodeType&&this.addElement(t,e)}},{key:"addTextNode",value:function(t,e){var n=t.nodeValue,r=this.top;if(2&r.options||r.inlineContext(t)||/[^ \t\r\n\u000c]/.test(n)){if
6(1&r.options)n=2&r.options?n.replace(/\r\n?/g,"\n"):n.replace(/\r?\n|\r/g," ");else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){var i=r.content[r.content.length-1],o=t.previousSibling;(!i||o&&"BR"==o.nodeName||i.isText&&/[ \t\r\n\u000c]$/.test(i.text))&&(n=n.slice(1))}n&&this.insertNode(this.parser.schema.text(n),e),this.findInText(t)}else this.findInside(t)}},{key:"addElement",value:function(t,e,n){var r,i=t.nodeName.toLowerCase();tn.hasOwnProperty(i)&&this.parser.normalizeLists&&function(t){for(var e=t.firstChild,n=null;e;e=e.nextSibling){var r=1==e.nodeType?e.nodeName.toLowerCase():null;r&&tn.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):"li"==r?n=e:r&&(n=null)}}(t);var o=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(r=this.parser.matchTag(t,this,n));if(o?o.ignore:te.hasOwnProperty(i))this.findInside(t),this.ignoreFallback(t,e);else if(!o||o.skip||o.closeParent){o&&o.closeParent?this.open=Math.max(0,this.open-1):o&&o.skip.nodeType&&(t=o.skip);var s,a=this.top,l=this.needsBlock;if(tt.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(!t.firstChild){this.leafFallback(t,e);return}var h=o&&o.skip?e:this.readStyles(t,e);h&&this.addAll(t,h),s&&this.sync(a),this.needsBlock=l}else{var c=this.readStyles(t,e);c&&this.addElementByRule(t,o,c,!1===o.consuming?r:void 0)}}},{key:"leafFallback",value:function(t,e){"BR"==t.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode("\n"),e)}},{key:"ignoreFallback",value:function(t,e){"BR"!=t.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"),e)}},{key:"readStyles",value:function(t,e){var n=this,r=t.style;if(r&&r.length)for(var i=0;i<this.parser.matchedStyles.length;i++){var o=this.parser.matchedStyles[i],s=r.getPropertyValue(o);if(s){for(var a,l=void 0;0!==(a=function(t){var r=n.parser.matchStyle(o,s,n,t);return r?r.ignore?{v:null}:(e=r.clearMark?e.filter(function(t){return!r.clearMark(t)}):e.concat(n.parser.schema.marks[r.mark].create(r.attrs)),!1!==r.consuming)?(l=t,0):void(l=t=r):(l=t,0)}(l));)if(a)return a.v}}return e}},{key:"addElementByRule",value:function(t,e,n,r){var i,o,s=this;if(e.node){if((o=this.parser.schema.nodes[e.node]).isLeaf)this.insertNode(o.create(e.attrs),n)||this.leafFallback(t,n);else{var a=this.enter(o,e.attrs||null,n,e.preserveWhitespace);a&&(i=!0,n=a)}}else{var l=this.parser.schema.marks[e.mark];n=n.concat(l.create(e.attrs))}var h=this.top;if(o&&o.isLeaf)this.findInside(t);else if(r)this.addElement(t,n,r);else if(e.getContent)this.findInside(t),e.getContent(t,this.parser.schema).forEach(function(t){return s.insertNode(t,n)});else{var c=t;"string"==typeof e.contentElement?c=t.querySelector(e.contentElement):"function"==typeof e.contentElement?c=e.contentElement(t):e.contentElement&&(c=e.contentElement),this.findAround(t,c,!0),this.addAll(c,n)}i&&this.sync(h)&&this.open--}},{key:"addAll",value:function(t,e,n,r){for(var i=n||0,o=n?t.childNodes[n]:t.firstChild,s=null==r?null:t.childNodes[r];o!=s;o=o.nextSibling,++i)this.findAtPoint(t,i),this.addDOM(o,e);this.findAtPoint(t,i)}},{key:"findPlace",value:function(t,e){for(var n,r,i=this.open;i>=0;i--){var o=this.nodes[i],s=o.findWrapping(t);if(s&&(!n||n.length>s.length)&&(n=s,r=o,!s.length)||o.solid)break}if(!n)return null;this.sync(r);for(var a=0;a<n.length;a++)e=this.enterInner(n[a],null,e,!1);return e}},{key:"insertNode",value:function(t,e){if(t.isInline&&this.needsBlock&&!this.top.type){var n=this.textblockFromContext();n&&(e=this.enterInner(n,null,e))}var i=this.findPlace(t,e);if(i){this.closeExtra();var o=this.top;o.match&&(o.match=o.match.matchType(t.type));var s,a=x.none,l=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return r(t,void 0);var n=Object.prototype.toString.call(t).slice(8,-1);if("Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r(t,void 0)}}(t))){n&&(t=n);var i=0,o=function(){};return{s:o,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:o}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,l=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){l=!0,s=t},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw s}}}}(i.concat(t.marks));try{for(l.s();!(s=l.n()).done;){var h=s.value;(o.type?o.type.allowsMarkType(h.type):ta(h.type,t.type))&&(a=h.addToSet(a))}}catch(t){l.e(t)}finally{l.f()}return o.content.push(t.mark(a)),!0}return!1}},{key:"enter",value:function(t,e,n,r){var i=this.findPlace(t.create(e),n);return i&&(i=this.enterInner(t,e,n,!0,r)),i}},{key:"enterInner",value:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4?arguments[4]:void 0;this.closeExtra();var o=this.top;o.match=o.match&&o.match.matchType(t);var s=tr(t,i,o.options);4&o.options&&0==o.content.length&&(s|=4);var a=x.none;return n=n.filter(function(e){return(o.type?!o.type.allowsMarkType(e.type):!ta(e.type,t))||(a=e.addToSet(a),!1)}),this.nodes.push(new ti(t,e,a,r,null,s)),this.open++,n}},{key:"closeExtra",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.nodes.length-1;if(e>this.open){for(;e>this.open;e--)this.nodes[e-1].content.push(this.nodes[e].finish(t));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(t){for(var e=this.open;e>=0;e--)if(this.nodes[e]==t)return this.open=e,!0;return!1}},{key:"currentPos",get:function(){this.closeExtra();for(var t=0,e=this.open;e>=0;e--){for(var n=this.nodes[e].content,r=n.length-1;r>=0;r--)t+=n[r].nodeSize;e&&t++}return t}},{key:"findAtPoint",value:function(t,e){if(this.find)for(var n=0;n<this.find.length;n++)this.find[n].node==t&&this.find[n].offset==e&&(this.find[n].pos=this.currentPos)}},{key:"findInside",value:function(t){if(this.find)for(var e=0;e<this.find.length;e++)null==this.find[e].pos&&1==t.nodeType&&t.contains(this.find[e].node)&&(this.find[e].pos=this.currentPos)}},{key:"findAround",value:function(t,e,n){if(t!=e&&this.find)for(var r=0;r<this.find.length;r++)null==this.find[r].pos&&1==t.nodeType&&t.contains(this.find[r].node)&&e.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}},{key:"findInText",value:function(t){if(this.find)for(var e=0;e<this.find.length;e++)this.find[e].node==t&&(this.find[e].pos=this.currentPos-(t.nodeValue.length-this.find[e].offset))}},{key:"matchesContext",value:function(t){var e=this;if(t.indexOf("|")>-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);var n=t.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 t(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(t(s-1,a))return!0;return!1}var h=a>0||0==a&&i?e.nodes[a].type:r&&a>=o?r.node(a-o).type:null;if(!h||h.name!=l&&-1==h.groups.indexOf(l))return!1;a--}return!0}(n.length-1,this.open)}},{key:"textblockFromContext",value:function(){var t=this.options.context;if(t)for(var e=t.depth;e>=0;e--){var n=t.node(e).contentMatchAt(t.indexAfter(e)).defaultType;
6if(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}}}]),t}();function ts(t){var e={};for(var n in t)e[n]=t[n];return e}function ta(t,e){var n,r=e.schema.nodes;for(var i in r)if(0!==(n=function(){var n=r[i];if(!n.allowsMarkType(t))return 0;var o=[];if(function t(n){o.push(n);for(var r=0;r<n.edgeCount;r++){var i=n.edge(r),s=i.type,a=i.next;if(s==e||0>o.indexOf(a)&&t(a))return!0}}(n.contentMatch))return{v:!0}}())&&n)return n.v}var tl=function(){function t(e,n){f(this,t),this.nodes=e,this.marks=n}return m(t,[{key:"serializeFragment",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;r||(r=tc(n).createDocumentFragment());var i=r,o=[];return t.forEach(function(t){if(o.length||t.marks.length){for(var r=0,s=0;r<o.length&&s<t.marks.length;){var a=t.marks[s];if(!e.marks[a.type.name]){s++;continue}if(!a.eq(o[r][0])||!1===a.type.spec.spanning)break;r++,s++}for(;r<o.length;)i=o.pop()[1];for(;s<t.marks.length;){var l=t.marks[s++],h=e.serializeMark(l,t.isInline,n);h&&(o.push([l,i]),i.appendChild(h.dom),i=h.contentDOM||h.dom)}}i.appendChild(e.serializeNodeInner(t,n))}),r}},{key:"serializeNodeInner",value:function(t,e){var n=tp(tc(e),this.nodes[t.type.name](t),null,t.attrs),r=n.dom,i=n.contentDOM;if(i){if(t.isLeaf)throw RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(t.content,e,i)}return r}},{key:"serializeNode",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.serializeNodeInner(t,e),r=t.marks.length-1;r>=0;r--){var i=this.serializeMark(t.marks[r],t.isInline,e);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}},{key:"serializeMark",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.marks[t.type.name];return r&&tp(tc(n),r(t,e),null,t.attrs)}}],[{key:"renderSpec",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3?arguments[3]:void 0;return tp(t,e,n,r)}},{key:"fromSchema",value:function(e){return e.cached.domSerializer||(e.cached.domSerializer=new t(this.nodesFromSchema(e),this.marksFromSchema(e)))}},{key:"nodesFromSchema",value:function(t){var e=th(t.nodes);return e.text||(e.text=function(t){return t.text}),e}},{key:"marksFromSchema",value:function(t){return th(t.marks)}}]),t}();function th(t){var e={};for(var n in t){var r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function tc(t){return t.document||window.document}var tu=new WeakMap;function tp(t,e,n,r){if("string"==typeof e)return{dom:t.createTextNode(e)};if(null!=e.nodeType)return{dom:e};if(e.dom&&null!=e.dom.nodeType)return e;var i,o,s,a,l=e[0];if("string"!=typeof l)throw RangeError("Invalid array passed to renderSpec");if(r&&(void 0===(o=tu.get(r))&&tu.set(r,(i=null,function t(e){if(e&&"object"==p(e)){if(Array.isArray(e)){if("string"==typeof e[0])i||(i=[]),i.push(e);else for(var n=0;n<e.length;n++)t(e[n])}else for(var r in e)t(e[r])}}(r),o=i)),a=o)&&a.indexOf(e)>-1)throw RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");var h=l.indexOf(" ");h>0&&(n=l.slice(0,h),l=l.slice(h+1));var c=n?t.createElementNS(n,l):t.createElement(l),u=e[1],f=1;if(u&&"object"==p(u)&&null==u.nodeType&&!Array.isArray(u)){for(var d in f=2,u)if(null!=u[d]){var m=d.indexOf(" ");m>0?c.setAttributeNS(d.slice(0,m),d.slice(m+1),u[d]):c.setAttribute(d,u[d])}}for(var v=f;v<e.length;v++){var y=e[v];if(0===y){if(v<e.length-1||v>f)throw RangeError("Content hole must be the only child of its parent node");return{dom:c,contentDOM:c}}var g=tp(t,y,n,r),k=g.dom,w=g.contentDOM;if(c.appendChild(k),w){if(s)throw RangeError("Multiple content holes");s=w}}return{dom:c,contentDOM:s}}e.ContentMatch=D,e.DOMParser=X,e.DOMSerializer=tl,e.Fragment=y,e.Mark=x,e.MarkType=G,e.Node=$,e.NodeRange=F,e.NodeType=U,e.ReplaceError=S,e.ResolvedPos=N,e.Schema=Z,e.Slice=b},57435:function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(){return(i="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=l(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}}).apply(this,arguments)}function o(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&s(t,e)}
6function s(t,e){return(s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function a(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var n,i=l(t);return n=e?Reflect.construct(i,arguments,l(this).constructor):i.apply(this,arguments),function(t,e){if(e&&("object"===r(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,n)}}function l(t){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function h(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}function c(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function u(t,e,n){return e&&c(t.prototype,e),n&&c(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}Object.defineProperty(e,"__esModule",{value:!0});var p=n(50401),f=n(24023),d=Object.create(null),m=function(){function t(e,n,r){h(this,t),this.$anchor=e,this.$head=n,this.ranges=r||[new v(e.min(n),e.max(n))]}return u(t,[{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 t=this.ranges,e=0;e<t.length;e++)if(t[e].$from.pos!=t[e].$to.pos)return!1;return!0}},{key:"content",value:function(){return this.$from.doc.slice(this.from,this.to,!0)}},{key:"replace",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:p.Slice.empty,n=e.content.lastChild,r=null,i=0;i<e.openEnd;i++)r=n,n=n.lastChild;for(var o=t.steps.length,s=this.ranges,a=0;a<s.length;a++){var l=s[a],h=l.$from,c=l.$to,u=t.mapping.slice(o);t.replaceRange(u.map(h.pos),u.map(c.pos),a?p.Slice.empty:e),0==a&&C(t,o,(n?n.isInline:r&&r.isTextblock)?-1:1)}}},{key:"replaceWith",value:function(t,e){for(var n=t.steps.length,r=this.ranges,i=0;i<r.length;i++){var o=r[i],s=o.$from,a=o.$to,l=t.mapping.slice(n),h=l.map(s.pos),c=l.map(a.pos);i?t.deleteRange(h,c):(t.replaceRangeWith(h,c,e),C(t,n,e.isInline?-1:1))}}},{key:"getBookmark",value:function(){return k.between(this.$anchor,this.$head).getBookmark()}}],[{key:"findFrom",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=t.parent.inlineContent?new k(t):O(t.node(0),t.parent,t.pos,t.index(),e,n);if(r)return r;for(var i=t.depth-1;i>=0;i--){var o=e<0?O(t.node(0),t.node(i),t.before(i+1),t.index(i),e,n):O(t.node(0),t.node(i),t.after(i+1),t.index(i)+1,e,n);if(o)return o}return null}},{key:"near",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this.findFrom(t,e)||this.findFrom(t,-e)||new b(t.node(0))}},{key:"atStart",value:function(t){return O(t,t,0,0,1)||new b(t)}},{key:"atEnd",value:function(t){return O(t,t,t.content.size,t.childCount,-1)||new b(t)}},{key:"fromJSON",value:function(t,e){if(!e||!e.type)throw RangeError("Invalid input for Selection.fromJSON");var n=d[e.type];if(!n)throw RangeError("No selection type ".concat(e.type," defined"));return n.fromJSON(t,e)}},{key:"jsonID",value:function(t,e){if(t in d)throw RangeError("Duplicate use of selection JSON ID "+t);return d[t]=e,e.prototype.jsonID=t,e}}]),t}();m.prototype.visible=!0;var v=u(function t(e,n){h(this,t),this.$from=e,this.$to=n}),y=!1;function g(t){y||t.parent.inlineContent||(y=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}var k=function(t){o(n,t);var e=a(n);function n(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;return h(this,n),g(t),g(r),e.call(this,t,r)}return u(n,[{key:"$cursor",get:function(){return this.$anchor.pos==this.$head.pos?this.$head:null}},{key:"map",value:function(t,e){var r=t.resolve(e.map(this.head));if(!r.parent.inlineContent)return m.near(r);var i=t.resolve(e.map(this.anchor));return new n(i.parent.inlineContent?i:r,r)}},{key:"replace",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:p.Slice.empty;if(i(l(n.prototype),"replace",this).call(this,t,e),e==p.Slice.empty){var r=this.$from.marksAcross(this.$to);r&&t.ensureMarks(r)}}},{key:"eq",value:function(t){return t instanceof n&&t.anchor==this.anchor&&t.head==this.head}},{key:"getBookmark",value:function(){return new w(this.anchor,this.head)}},{key:"toJSON",value:function(){return{type:"text",anchor:this.anchor,head:this.head}}}],[{key:"fromJSON",value:function(t,e){if("number"!=typeof e.anchor||"number"!=typeof e.head)throw RangeError("Invalid input for TextSelection.fromJSON");return new n(t.resolve(e.anchor),t.resolve(e.head))}},{key:"create",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e,r=t.resolve(e);return new this(r,n==e?r:t.resolve(n))}},{key:"between",value:function(t,e,r){var i=t.pos-e.pos;if((!r||i)&&(r=i>=0?1:-1),!e.parent.inlineContent){var o=m.findFrom(e,r,!0)||m.findFrom(e,-r,!0);if(!o)return m.near(e,r);e=o.$head}return t.parent.inlineContent||(0==i?t=e:(t=(m.findFrom(t,-r,!0)||m.findFrom(t,r,!0)).$anchor).pos<e.pos==i<0||(t=e)),new n(t,e)}}]),n}(m);m.jsonID("text",k);var w=function(){function t(e,n){h(this,t),this.anchor=e,this.head=n}return u(t,[{key:"map",value:function(e){return new t(e.map(this.anchor),e.map(this.head))}},{key:"resolve",value:function(t){return k.between(t.resolve(this.anchor),t.resolve(this.head))}}]),t}(),x=function(t){o(n,t);var e=a(n);function n(t){h(this,n);var r,i=t.nodeAfter,o=t.node(0).resolve(t.pos+i.nodeSize);return(r=e.call(this,t,o)).node=i,r}return u(n,[{key:"map",value:function(t,e){var r=e.mapResult(this.anchor),i=r.deleted,o=r.pos,s=t.resolve(o);return i?m.near(s):new n(s)}},{key:"content",value:function(){return new p.Slice(p.Fragment.from(this.node),0,0)}},{key:"eq",value:function(t){return t instanceof n&&t.anchor==this.anchor}},{key:"toJSON",value:function(){return{type:"node",anchor:this.anchor}}},{key:"getBookmark",value:function(){return new S(this.anchor)}}],[{key:"fromJSON",value:function(t,e){if("number"!=typeof e.anchor)throw RangeError("Invalid input for NodeSelection.fromJSON");return new n(t.resolve(e.anchor))}},{key:"create",value:function(t,e){return new n(t.resolve(e))}},{key:"isSelectable",value:function(t){return!t.isText&&!1!==t.type.spec.selectable}}]),n}(m);x.prototype.visible=!1,m.jsonID("node",x);var S=function(){function t(e){h(this,t),this.anchor=e}return u(t,[{key:"map",value:function(e){var n=e.mapResult(this.anchor),r=n.deleted,i=n.pos;return r?new w(i,i):new t(i)}},{key:"resolve",value:function(t){var e=t.resolve(this.anchor),n=e.nodeAfter;return n&&x.isSelectable(n)?new x(e):m.near(e)}}]),t}(),b=function(t){o(n,t);var e=a(n);function n(t){return h(this,n),e.call(this,t.resolve(0),t.resolve(t.content.size))}return u(n,[{key:"replace",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:p.Slice.empty;if(e==p.Slice.empty){t.delete(0,t.doc.content.size);var r=m.atStart(t.doc);r.eq(t.selection)||t.setSelection(r)}else i(l(n.prototype),"replace",this).call(this,t,e)}},{key:"toJSON",value:function(){return{type:"all"}}},{key:"map",value:function(t){return new n(t)}},{key:"eq",value:function(t){return t instanceof n}},{key:"getBookmark",value:function(){return M}}],[{key:"fromJSON",value:function(t){return new n(t)}}]),n}(m);m.jsonID("all",b);var M={map:function(){return this},resolve:function(t){return new b(t)}};function O(t,e,n,r,i){var o=arguments.length>5&&void 0!==arguments[5]&&arguments[5];if(e.inlineContent)return k.create(t,n);for(var s=r-(i>0?0:1);i>0?s<e.childCount:s>=0;s+=i){var a=e.child(s);if(a.isAtom){if(!o&&x.isSelectable(a))return x.create(t,n-(i<0?a.nodeSize:0))}else{var l=O(t,a,n+i,i<0?a.childCount:0,i,o);if(l)return l}n+=a.nodeSize*i}return null}function C(t,e,n){var r,i=t.steps.length-1;if(!(i<e)){var o=t.steps[i];(o instanceof f.ReplaceStep||o instanceof f.ReplaceAroundStep)&&(t.mapping.maps[i].forEac
6h(function(t,e,n,i){null==r&&(r=i)}),t.setSelection(m.near(t.doc.resolve(r),n)))}}var E=function(t){o(n,t);var e=a(n);function n(t){var r;return h(this,n),(r=e.call(this,t.doc)).curSelectionFor=0,r.updated=0,r.meta=Object.create(null),r.time=Date.now(),r.curSelection=t.selection,r.storedMarks=t.storedMarks,r}return u(n,[{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(t){if(t.$from.doc!=this.doc)throw RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=t,this.curSelectionFor=this.steps.length,this.updated=(1|this.updated)&-3,this.storedMarks=null,this}},{key:"selectionSet",get:function(){return(1&this.updated)>0}},{key:"setStoredMarks",value:function(t){return this.storedMarks=t,this.updated|=2,this}},{key:"ensureMarks",value:function(t){return p.Mark.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this}},{key:"addStoredMark",value:function(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))}},{key:"removeStoredMark",value:function(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))}},{key:"storedMarksSet",get:function(){return(2&this.updated)>0}},{key:"addStep",value:function(t,e){i(l(n.prototype),"addStep",this).call(this,t,e),this.updated=-3&this.updated,this.storedMarks=null}},{key:"setTime",value:function(t){return this.time=t,this}},{key:"replaceSelection",value:function(t){return this.selection.replace(this,t),this}},{key:"replaceSelectionWith",value:function(t){var e=!(arguments.length>1)||void 0===arguments[1]||arguments[1],n=this.selection;return e&&(t=t.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||p.Mark.none))),n.replaceWith(this,t),this}},{key:"deleteSelection",value:function(){return this.selection.replace(this),this}},{key:"insertText",value:function(t,e,n){var r=this.doc.type.schema;if(null==e)return t?this.replaceSelectionWith(r.text(t),!0):this.deleteSelection();if(null==n&&(n=e),n=null==n?e:n,!t)return this.deleteRange(e,n);var i=this.storedMarks;if(!i){var o=this.doc.resolve(e);i=n==e?o.marks():o.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(e,n,r.text(t,i)),this.selection.empty||this.setSelection(m.near(this.selection.$to)),this}},{key:"setMeta",value:function(t,e){return this.meta["string"==typeof t?t:t.key]=e,this}},{key:"getMeta",value:function(t){return this.meta["string"==typeof t?t:t.key]}},{key:"isGeneric",get:function(){for(var t 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}}]),n}(f.Transform);function T(t,e){return e&&t?t.bind(e):t}var R=u(function t(e,n,r){h(this,t),this.name=e,this.init=T(n.init,r),this.apply=T(n.apply,r)}),N=[new R("doc",{init:function(t){return t.doc||t.schema.topNodeType.createAndFill()},apply:function(t){return t.doc}}),new R("selection",{init:function(t,e){return t.selection||m.atStart(e.doc)},apply:function(t){return t.selection}}),new R("storedMarks",{init:function(t){return t.storedMarks||null},apply:function(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new R("scrollToSelection",{init:function(){return 0},apply:function(t,e){return t.scrolledIntoView?e+1:e}})],A=u(function t(e,n){var r=this;h(this,t),this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=N.slice(),n&&n.forEach(function(t){if(r.pluginsByKey[t.key])throw RangeError("Adding different instances of a keyed plugin ("+t.key+")");r.plugins.push(t),r.pluginsByKey[t.key]=t,t.spec.state&&r.fields.push(new R(t.key,t.spec.state,t))})}),I=function(){function t(e){h(this,t),this.config=e}return u(t,[{key:"schema",get:function(){return this.config.schema}},{key:"plugins",get:function(){return this.config.plugins}},{key:"apply",value:function(t){return this.applyTransaction(t).state}},{key:"filterTransaction",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,n=0;n<this.config.plugins.length;n++)if(n!=e){var r=this.config.plugins[n];if(r.spec.filterTransaction&&!r.spec.filterTransaction.call(r,t,this))return!1}return!0}},{key:"applyTransaction",value:function(t){if(!this.filterTransaction(t))return{state:this,transactions:[]};for(var e=[t],n=this.applyInner(t),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,h=a<e.length&&s.spec.appendTransaction.call(s,a?e.slice(a):e,l,n);if(h&&n.filterTransaction(h,o)){if(h.setMeta("appendedTransaction",t),!r){r=[];for(var c=0;c<this.config.plugins.length;c++)r.push(c<o?{state:n,n:e.length}:{state:this,n:0})}e.push(h),n=n.applyInner(h),i=!0}r&&(r[o]={state:n,n:e.length})}}if(!i)return{state:n,transactions:e}}}},{key:"applyInner",value:function(e){if(!e.before.eq(this.doc))throw RangeError("Applying a mismatched transaction");for(var n=new t(this.config),r=this.config.fields,i=0;i<r.length;i++){var o=r[i];n[o.name]=o.apply(e,this[o.name],this,n)}return n}},{key:"tr",get:function(){return new E(this)}},{key:"reconfigure",value:function(e){for(var n=new A(this.schema,e.plugins),r=n.fields,i=new t(n),o=0;o<r.length;o++){var s=r[o].name;i[s]=this.hasOwnProperty(s)?this[s]:r[o].init(e,i)}return i}},{key:"toJSON",value:function(t){var e={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(e.storedMarks=this.storedMarks.map(function(t){return t.toJSON()})),t&&"object"==r(t))for(var n in t){if("doc"==n||"selection"==n)throw RangeError("The JSON fields `doc` and `selection` are reserved");var i=t[n],o=i.spec.state;o&&o.toJSON&&(e[n]=o.toJSON.call(i,this[i.key]))}return e}}],[{key:"create",value:function(e){for(var n=new A(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new t(n),i=0;i<n.fields.length;i++)r[n.fields[i].name]=n.fields[i].init(e,r);return r}},{key:"fromJSON",value:function(e,n,r){if(!n)throw RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw RangeError("Required config field 'schema' missing");var i=new A(e.schema,e.plugins),o=new t(i);return i.fields.forEach(function(t){if("doc"==t.name)o.doc=p.Node.fromJSON(e.schema,n.doc);else if("selection"==t.name)o.selection=m.fromJSON(o.doc,n.selection);else if("storedMarks"==t.name)n.storedMarks&&(o.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(var i in r){var s=r[i],a=s.spec.state;if(s.key==t.name&&a&&a.fromJSON&&Object.prototype.hasOwnProperty.call(n,i)){o[t.name]=a.fromJSON.call(s,e,n[i],o);return}}o[t.name]=t.init(e,o)}}),o}}]),t}(),z=function(){function t(e){h(this,t),this.spec=e,this.props={},e.props&&function t(e,n,r){for(var i in e){var o=e[i];o instanceof Function?o=o.bind(n):"handleDOMEvents"==i&&(o=t(o,n,{})),r[i]=o}return r}(e.props,this,this.props),this.key=e.key?e.key.key:J("plugin")}return u(t,[{key:"getState",value:function(t){return t[this.key]}}]),t}(),F=Object.create(null);function J(t){return t in F?t+"$"+ ++F[t]:(F[t]=0,t+"$")}var $=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"key";h(this,t),this.key=J(e)}return u(t,[{key:"get",value:function(t){return t.config.pluginsByKey[this.key]}},{key:"getState",value:function(t){return t[this.key]}}]),t}();e.AllSelection=b,e.EditorState=I,e.NodeSelection=x,e.Plugin=z,e.PluginKey=$,e.Selection=m,e.SelectionRange=v,e.TextSelection=k,e.Transaction=E},24023:function(t,e,n){"use strict";function r(t){var e="function"==typeof Map?new Map:void 0;return(r=function(t){if(null===t||!function(t){try{return -1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return i(t,arguments,h(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),s(n,t)})(t)}function i(t,e,n){return(i=l()?Reflect.construct.bind():function(t,e,n){var r=[null];r.push.apply(r,e);var i=new(Function.bind.apply(t,r));return n&&s(i,n.prototype),i}).apply(null,arguments)}function o(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&s(t,e)}
6function s(t,e){return(s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function a(t){var e=l();return function(){var n,r=h(t);return n=e?Reflect.construct(r,arguments,h(this).constructor):r.apply(this,arguments),function(t,e){if(e&&("object"===c(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,n)}}function l(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}function h(t){return(h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function c(t){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function u(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}function p(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,function(t){var e=function(t,e){if("object"!==c(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!==c(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===c(e)?e:String(e)}(r.key),r)}}function f(t,e,n){return e&&p(t.prototype,e),n&&p(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}var d=n(50401),m=function(){function t(e,n,r){u(this,t),this.pos=e,this.delInfo=n,this.recover=r}return f(t,[{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}}]),t}(),v=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(u(this,t),this.ranges=e,this.inverted=n,!e.length&&t.empty)return t.empty}return f(t,[{key:"recover",value:function(t){var e=0,n=65535&t;if(!this.inverted)for(var r=0;r<n;r++)e+=this.ranges[3*r+2]-this.ranges[3*r+1];return this.ranges[3*n]+e+(t-(65535&t))/65536}},{key:"mapResult",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this._map(t,e,!1)}},{key:"map",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this._map(t,e,!0)}},{key:"_map",value:function(t,e,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>t)break;var l=this.ranges[s+i],h=this.ranges[s+o],c=a+l;if(t<=c){var u=l?t==a?-1:t==c?1:e:e,p=a+r+(u<0?0:h);if(n)return p;var f=t==(e<0?a:c)?null:s/3+(t-a)*65536,d=t==a?2:t==c?1:4;return(e<0?t!=a:t!=c)&&(d|=8),new m(p,d,f)}r+=h-l}return n?t+r:new m(t+r,0,null)}},{key:"touches",value:function(t,e){for(var n=0,r=65535&e,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>t)break;var l=this.ranges[s+i];if(t<=a+l&&s==3*r)return!0;n+=this.ranges[s+o]-l}return!1}},{key:"forEach",value:function(t){for(var e=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+e],h=this.ranges[r+n];t(s,s+l,a,a+h),i+=h-l}}},{key:"invert",value:function(){return new t(this.ranges,!this.inverted)}},{key:"toString",value:function(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}}],[{key:"offset",value:function(e){return 0==e?t.empty:new t(e<0?[0,-e,0]:[0,0,e])}}]),t}();v.empty=new v([]);var y=function(){function t(){var e=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]:e.length;u(this,t),this.maps=e,this.mirror=n,this.from=r,this.to=i}return f(t,[{key:"slice",value:function(){var e=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 t(this.maps,this.mirror,e,n)}},{key:"copy",value:function(){return new t(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}},{key:"appendMap",value:function(t,e){this.to=this.maps.push(t),null!=e&&this.setMirror(this.maps.length-1,e)}},{key:"appendMapping",value:function(t){for(var e=0,n=this.maps.length;e<t.maps.length;e++){var r=t.getMirror(e);this.appendMap(t.maps[e],null!=r&&r<e?n+r:void 0)}}},{key:"getMirror",value:function(t){if(this.mirror){for(var e=0;e<this.mirror.length;e++)if(this.mirror[e]==t)return this.mirror[e+(e%2?-1:1)]}}},{key:"setMirror",value:function(t,e){this.mirror||(this.mirror=[]),this.mirror.push(t,e)}},{key:"appendMappingInverted",value:function(t){for(var e=t.maps.length-1,n=this.maps.length+t.maps.length;e>=0;e--){var r=t.getMirror(e);this.appendMap(t.maps[e].invert(),null!=r&&r>e?n-r-1:void 0)}}},{key:"invert",value:function(){var e=new t;return e.appendMappingInverted(this),e}},{key:"map",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(this.mirror)return this._map(t,e,!0);for(var n=this.from;n<this.to;n++)t=this.maps[n].map(t,e);return t}},{key:"mapResult",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this._map(t,e,!1)}},{key:"_map",value:function(t,e,n){for(var r=0,i=this.from;i<this.to;i++){var o=this.maps[i].mapResult(t,e);if(null!=o.recover){var s=this.getMirror(i);if(null!=s&&s>i&&s<this.to){i=s,t=this.maps[s].recover(o.recover);continue}}
6r|=o.delInfo,t=o.pos}return n?t:new m(t,r,null)}}]),t}(),g=Object.create(null),k=function(){function t(){u(this,t)}return f(t,[{key:"getMap",value:function(){return v.empty}},{key:"merge",value:function(t){return null}}],[{key:"fromJSON",value:function(t,e){if(!e||!e.stepType)throw RangeError("Invalid input for Step.fromJSON");var n=g[e.stepType];if(!n)throw RangeError("No step type ".concat(e.stepType," defined"));return n.fromJSON(t,e)}},{key:"jsonID",value:function(t,e){if(t in g)throw RangeError("Duplicate use of step JSON ID "+t);return g[t]=e,e.prototype.jsonID=t,e}}]),t}(),w=function(){function t(e,n){u(this,t),this.doc=e,this.failed=n}return f(t,null,[{key:"ok",value:function(e){return new t(e,null)}},{key:"fail",value:function(e){return new t(null,e)}},{key:"fromReplace",value:function(e,n,r,i){try{return t.ok(e.replace(n,r,i))}catch(e){if(e instanceof d.ReplaceError)return t.fail(e.message);throw e}}}]),t}();function x(t,e,n){for(var r=[],i=0;i<t.childCount;i++){var o=t.child(i);o.content.size&&(o=o.copy(x(o.content,e,o))),o.isInline&&(o=e(o,n,i)),r.push(o)}return d.Fragment.fromArray(r)}var S=function(t){o(n,t);var e=a(n);function n(t,r,i){var o;return u(this,n),(o=e.call(this)).from=t,o.to=r,o.mark=i,o}return f(n,[{key:"apply",value:function(t){var e=this,n=t.slice(this.from,this.to),r=t.resolve(this.from),i=r.no
6de(r.sharedDepth(this.to)),o=new d.Slice(x(n.content,function(t,n){return t.isAtom&&n.type.allowsMarkType(e.mark.type)?t.mark(e.mark.addToSet(t.marks)):t},i),n.openStart,n.openEnd);return w.fromReplace(t,this.from,this.to,o)}},{key:"invert",value:function(){return new b(this.from,this.to,this.mark)}},{key:"map",value:function(t){var e=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return e.deleted&&r.deleted||e.pos>=r.pos?null:new n(e.pos,r.pos,this.mark)}},{key:"merge",value:function(t){return t instanceof n&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new n(Math.min(this.from,t.from),Math.max(this.to,t.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(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw RangeError("Invalid input for AddMarkStep.fromJSON");return new n(e.from,e.to,t.markFromJSON(e.mark))}}]),n}(k);k.jsonID("addMark",S);var b=function(t){o(n,t);var e=a(n);function n(t,r,i){var o;return u(this,n),(o=e.call(this)).from=t,o.to=r,o.mark=i,o}return f(n,[{key:"apply",value:function(t){var e=this,n=t.slice(this.from,this.to),r=new d.Slice(x(n.content,function(t){return t.mark(e.mark.removeFromSet(t.marks))},t),n.openStart,n.openEnd);return w.fromReplace(t,this.from,this.to,r)}},{key:"invert",value:function(){return new S(this.from,this.to,this.mark)}},{key:"map",value:function(t){var e=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return e.deleted&&r.deleted||e.pos>=r.pos?null:new n(e.pos,r.pos,this.mark)}},{key:"merge",value:function(t){return t instanceof n&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new n(Math.min(this.from,t.from),Math.max(this.to,t.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(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw RangeError("Invalid input for RemoveMarkStep.fromJSON");return new n(e.from,e.to,t.markFromJSON(e.mark))}}]),n}(k);k.jsonID("removeMark",b);var M=function(t){o(n,t);var e=a(n);function n(t,r){var i;return u(this,n),(i=e.call(this)).pos=t,i.mark=r,i}return f(n,[{key:"apply",value:function(t){var e=t.nodeAt(this.pos);if(!e)return w.fail("No node at mark step's position");var n=e.type.create(e.attrs,null,this.mark.addToSet(e.marks));return w.fromReplace(t,this.pos,this.pos+1,new d.Slice(d.Fragment.from(n),0,e.isLeaf?0:1))}},{key:"invert",value:function(t){var e=t.nodeAt(this.pos);if(e){var r=this.mark.addToSet(e.marks);if(r.length==e.marks.length){for(var i=0;i<e.marks.length;i++)if(!e.marks[i].isInSet(r))return new n(this.pos,e.marks[i]);return new n(this.pos,this.mark)}}return new O(this.pos,this.mark)}},{key:"map",value:function(t){var e=t.mapResult(this.pos,1);return e.deletedAfter?null:new n(e.pos,this.mark)}},{key:"toJSON",value:function(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}}],[{key:"fromJSON",value:function(t,e){if("number"!=typeof e.pos)throw RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new n(e.pos,t.markFromJSON(e.mark))}}]),n}(k);k.jsonID("addNodeMark",M);var O=function(t){o(n,t);var e=a(n);function n(t,r){var i;return u(this,n),(i=e.call(this)).pos=t,i.mark=r,i}return f(n,[{key:"apply",value:function(t){var e=t.nodeAt(this.pos);if(!e)return w.fail("No node at mark step's position");var n=e.type.create(e.attrs,null,this.mark.removeFromSet(e.marks));return w.fromReplace(t,this.pos,this.pos+1,new d.Slice(d.Fragment.from(n),0,e.isLeaf?0:1))}},{key:"invert",value:function(t){var e=t.nodeAt(this.pos);return e&&this.mark.isInSet(e.marks)?new M(this.pos,this.mark):this}},{key:"map",value:function(t){var e=t.mapResult(this.pos,1);return e.deletedAfter?null:new n(e.pos,this.mark)}},{key:"toJSON",value:function(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}}],[{key:"fromJSON",value:function(t,e){if("number"!=typeof e.pos)throw RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new n(e.pos,t.markFromJSON(e.mark))}}]),n}(k);
6k.jsonID("removeNodeMark",O);var C=function(t){o(n,t);var e=a(n);function n(t,r,i){var o,s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return u(this,n),(o=e.call(this)).from=t,o.to=r,o.slice=i,o.structure=s,o}return f(n,[{key:"apply",value:function(t){return this.structure&&T(t,this.from,this.to)?w.fail("Structure replace would overwrite content"):w.fromReplace(t,this.from,this.to,this.slice)}},{key:"getMap",value:function(){return new v([this.from,this.to-this.from,this.slice.size])}},{key:"invert",value:function(t){return new n(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}},{key:"map",value:function(t){var e=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return e.deletedAcross&&r.deletedAcross?null:new n(e.pos,Math.max(e.pos,r.pos),this.slice)}},{key:"merge",value:function(t){if(!(t instanceof n)||t.structure||this.structure)return null;if(this.from+this.slice.size!=t.from||this.slice.openEnd||t.slice.openStart){if(t.to!=this.from||this.slice.openStart||t.slice.openEnd)return null;var e=this.slice.size+t.slice.size==0?d.Slice.empty:new d.Slice(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new n(t.from,this.to,e,this.structure)}var r=this.slice.size+t.slice.size==0?d.Slice.empty:new d.Slice(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new n(this.from,this.to+(t.to-t.from),r,this.structure)}},{key:"toJSON",value:function(){var t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}}],[{key:"fromJSON",value:function(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw RangeError("Invalid input for ReplaceStep.fromJSON");return new n(e.from,e.to,d.Slice.fromJSON(t,e.slice),!!e.structure)}}]),n}(k);k.jsonID("replace",C);var E=function(t){o(n,t);var e=a(n);function n(t,r,i,o,s,a){var l,h=arguments.length>6&&void 0!==arguments[6]&&arguments[6];return u(this,n),(l=e.call(this)).from=t,l.to=r,l.gapFrom=i,l.gapTo=o,l.slice=s,l.insert=a,l.structure=h,l}return f(n,[{key:"apply",value:function(t){if(this.structure&&(T(t,this.from,this.gapFrom)||T(t,this.gapTo,this.to)))return w.fail("Structure gap-replace would overwrite content");var e=t.slice(this.gapFrom,this.gapTo);if(e.openStart||e.openEnd)return w.fail("Gap is not a flat range");var n=this.slice.insertAt(this.insert,e.content);return n?w.fromReplace(t,this.from,this.to,n):w.fail("Content does not fit in gap")}},{key:"getMap",value:function(){return new v([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}},{key:"invert",value:function(t){var e=this.gapTo-this.gapFrom;return new n(this.from,this.from+this.slice.size+e,this.from+this.insert,this.from+this.insert+e,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}},{key:"map",value:function(t){var e=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),i=this.from==this.gapFrom?e.pos:t.map(this.gapFrom,-1),o=this.to==this.gapTo?r.pos:t.map(this.gapTo,1);return e.deletedAcross&&r.deletedAcross||i<e.pos||o>r.pos?null:new n(e.pos,r.pos,i,o,this.slice,this.insert,this.structure)}},{key:"toJSON",value:function(){var t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}}],[{key:"fromJSON",value:function(t,e){if("number"!=typeof e.from||"number"!=typeof e.to||"number"!=typeof e.gapFrom||"number"!=typeof e.gapTo||"number"!=typeof e.insert)throw RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new n(e.from,e.to,e.gapFrom,e.gapTo,d.Slice.fromJSON(t,e.slice),e.insert,!!e.structure)}}]),n}(k);function T(t,e,n){for(var r=t.resolve(e),i=n-e,o=r.depth;i>0&&o>0&&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 R(t,e,n){for(var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:n.contentMatch,i=!(arguments.length>4)||void 0===arguments[4]||arguments[4],o=t.doc.nodeAt(e),s=[],a=e+1,l=0;l<o.childCount;l++){var h=o.child(l),c=a+h.nodeSize,u=r.matchType(h.type);if(u){r=u;for(var p=0;p<h.marks.length;p++)n.allowsMarkType(h.marks[p].type)||t.step(new b(a,c,h.marks[p]));if(i&&h.isText&&"pre"!=n.whitespace)for(var f=void 0,m=/\r?\n|\r/g,v=void 0;f=m.exec(h.text);)v||(v=new d.Slice(d.Fragment.from(n.schema.text(" ",n.allowedMarks(h.marks))),0,0)),s.push(new C(a+f.index,a+f.index+f[0].length,v))}else s.push(new C(a,c,d.Slice.empty));a=c}if(!r.validEnd){var y=r.fillBefore(d.Fragment.empty,!0);t.replace(a,a,new d.Slice(y,0,0))}for(var g=s.length-1;g>=0;g--)t.step(s[g])}function N(t){return{type:t,attrs:null}}function A(t,e){return!!(t&&e&&!t.isLeaf&&t.canAppend(e))}function I(t,e,n){var r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;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)break}return null}function z(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:d.Slice.empty;if(e==n&&!r.size)return null;var i=t.resolve(e),o=t.resolve(n);return F(i,o,r)?new C(e,n,r):new J(i,o,r).fit()}function F(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}k.jsonID("replaceAround",E);var J=function(){function t(e,n,r){u(this,t),this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=d.Fragment.empty;for(var i=0;i<=e.depth;
6i++){var o=e.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(e.indexAfter(i))})}for(var s=e.depth;s>0;s--)this.placed=d.Fragment.from(e.node(s).copy(this.placed))}return f(t,[{key:"depth",get:function(){return this.frontier.length-1}},{key:"fit",value:function(){for(;this.unplaced.size;){var t=this.findFittable();t?this.placeNodes(t):this.openMore()||this.dropNode()}var e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;for(var o=this.placed,s=r.depth,a=i.depth;s&&a&&1==o.childCount;)o=o.firstChild.content,s--,a--;var l=new d.Slice(o,s,a);return e>-1?new E(r.pos,e,this.$to.pos,this.$to.end(),l,n):l.size||r.pos!=this.$to.pos?new C(r.pos,i.pos,l):null}},{key:"findFittable",value:function(){for(var t=this.unplaced.openStart,e=this.unplaced.content,n=0,r=this.unplaced.openEnd;n<t;n++){var i=e.firstChild;if(e.childCount>1&&(r=0),i.type.spec.isolating&&r<=n){t=n;break}e=i.content}for(var o=1;o<=2;o++)for(var s=1==o?t:this.unplaced.openStart;s>=0;s--)for(var a=null,l=(s?(a=j(this.unplaced.content,s-1).firstChild).content:this.unplaced.content).firstChild,h=this.depth;h>=0;h--){var c=this.frontier[h],u=c.type,p=c.match,f=void 0,m=null;if(1==o&&(l?p.matchType(l.type)||(m=p.fillBefore(d.Fragment.from(l),!1)):a&&u.compatibleContent(a.type)))return{sliceDepth:s,frontierDepth:h,parent:a,inject:m};if(2==o&&l&&(f=p.findWrapping(l.type)))return{sliceDepth:s,frontierDepth:h,parent:a,wrap:f};if(a&&p.matchType(a.type))break}}},{key:"openMore",value:function(){var t=this.unplaced,e=t.content,n=t.openStart,r=t.openEnd,i=j(e,n);return!!i.childCount&&!i.firstChild.isLeaf&&(this.unplaced=new d.Slice(e,n+1,Math.max(r,i.size+n>=e.size-r?n+1:0)),!0)}},{key:"dropNode",value:function(){var t=this.unplaced,e=t.content,n=t.openStart,r=t.openEnd,i=j(e,n);if(i.childCount<=1&&n>0){var o=e.size-n<=n+i.size;this.unplaced=new d.Slice($(e,n-1,1),n-1,o?n-1:r)}else this.unplaced=new d.Slice($(e,n,1),n,r)}},{key:"placeNodes",value:function(t){for(var e=t.sliceDepth,n=t.frontierDepth,r=t.parent,i=t.inject,o=t.wrap;this.depth>n;)this.closeFrontierNode();if(o)for(var s=0;s<o.length;s++)this.openFrontierNode(o[s]);var a=this.unplaced,l=r?r.content:a.content,h=a.openStart-e,c=0,u=[],p=this.frontier[n],f=p.match,m=p.type;if(i){for(var v=0;v<i.childCount;v++)u.push(i.child(v));f=f.matchFragment(i)}for(var y=l.size+e-(a.content.size-a.openEnd);c<l.childCount;){var g=l.child(c),k=f.matchType(g.type);if(!k)break;(++c>1||0==h||g.content.size)&&(f=k,u.push(function t(e,n,r){if(n<=0)return e;var i=e.content;return n>1&&(i=i.replaceChild(0,t(i.firstChild,n-1,1==i.childCount?r-1:0))),n>0&&(i=e.type.contentMatch.fillBefore(i).append(i),r<=0&&(i=i.append(e.type.contentMatch.matchFragment(i).fillBefore(d.Fragment.empty,!0)))),e.copy(i)}(g.mark(m.allowedMarks(g.marks)),1==c?h:0,c==l.childCount?y:-1)))}var w=c==l.childCount;w||(y=-1),this.placed=B(this.placed,n,d.Fragment.from(u)),this.frontier[n].match=f,w&&y<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(var x=0,S=l;x<y;x++){var b=S.lastChild;this.frontier.push({type:b.type,match:b.contentMatchAt(b.childCount)}),S=b.content}this.unplaced=w?0==e?d.Slice.empty:new d.Slice($(a.content,e-1,1),e-1,y<0?a.openEnd:e-1):new d.Slice($(a.content,e,c),a.openStart,a.openEnd)}},{key:"mustMoveInline",value:function(){if(!this.$to.parent.isTextblock)return -1;var t,e=this.frontier[this.depth];if(!e.type.isTextblock||!D(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.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(t){t:for(var e=Math.min(this.depth,t.depth);e>=0;e--){var n=this.frontier[e],r=n.match,i=n.type,o=e<t.depth&&t.end(e+1)==t.pos+(t.depth-(e+1)),s=D(t,e,i,r,o);if(s){for(var a=e-1;a>=0;a--){var l=this.frontier[a],h=l.match,c=D(t,a,l.type,h,!0);if(!c||c.childCount)continue t}return{depth:e,fit:s,move:o?t.doc.resolve(t.after(e+1)):t}}}}},{key:"close",value:function(t){var e=this.findCloseLevel(t);if(!e)return null;for(;this.depth>e.depth;)this.closeFrontierNode();e.fit.childCount&&(this.placed=B(this.placed,e.depth,e.fit)),t=e.move;for(var n=e.depth+1;n<=t.depth;
6n++){var r=t.node(n),i=r.type.contentMatch.fillBefore(r.content,!0,t.index(n));this.openFrontierNode(r.type,r.attrs,i)}return t}},{key:"openFrontierNode",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2?arguments[2]:void 0,r=this.frontier[this.depth];r.match=r.match.matchType(t),this.placed=B(this.placed,this.depth,d.Fragment.from(t.create(e,n))),this.frontier.push({type:t,match:t.contentMatch})}},{key:"closeFrontierNode",value:function(){var t=this.frontier.pop().match.fillBefore(d.Fragment.empty,!0);t.childCount&&(this.placed=B(this.placed,this.frontier.length,t))}}]),t}();function $(t,e,n){return 0==e?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy($(t.firstChild.content,e-1,n)))}function B(t,e,n){return 0==e?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(B(t.lastChild.content,e-1,n)))}function j(t,e){for(var n=0;n<e;n++)t=t.firstChild.content;return t}function D(t,e,n,r,i){var o=t.node(e),s=i?t.indexAfter(e):t.index(e);if(s==o.childCount&&!n.compatibleContent(o.type))return null;var a=r.fillBefore(o.content,!0,s);return a&&!function(t,e,n){for(var r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}(n,o.content,s)?a:null}function P(t,e){for(var n=[],r=Math.min(t.depth,e.depth),i=r;i>=0;i--){var o=t.start(i);if(o<t.pos-(t.depth-i)||e.end(i)>e.pos+(e.depth-i)||t.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(o==e.start(i)||i==t.depth&&i==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==o-1)&&n.push(i)}return n}var W=function(t){o(n,t);var e=a(n);function n(t,r,i){var o;return u(this,n),(o=e.call(this)).pos=t,o.attr=r,o.value=i,o}return f(n,[{key:"apply",value:function(t){var e=t.nodeAt(this.pos);if(!e)return w.fail("No node at attribute step's position");var n=Object.create(null);for(var r in e.attrs)n[r]=e.attrs[r];n[this.attr]=this.value;var i=e.type.create(n,null,e.marks);return w.fromReplace(t,this.pos,this.pos+1,new d.Slice(d.Fragment.from(i),0,e.isLeaf?0:1))}},{key:"getMap",value:function(){return v.empty}},{key:"invert",value:function(t){return new n(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}},{key:"map",value:function(t){var e=t.mapResult(this.pos,1);return e.deletedAfter?null:new n(e.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(t,e){if("number"!=typeof e.pos||"string"!=typeof e.attr)throw RangeError("Invalid input for AttrStep.fromJSON");return new n(e.pos,e.attr,e.value)}}]),n}(k);k.jsonID("attr",W);var L=function(t){o(n,t);var e=a(n);function n(t,r){var i;return u(this,n),(i=e.call(this)).attr=t,i.value=r,i}return f(n,[{key:"apply",value:function(t){var e=Object.create(null);for(var n in t.attrs)e[n]=t.attrs[n];e[this.attr]=this.value;var r=t.type.create(e,t.content,t.marks);return w.ok(r)}},{key:"getMap",value:function(){return v.empty}},{key:"invert",value:function(t){return new n(this.attr,t.attrs[this.attr])}},{key:"map",value:function(t){return this}},{key:"toJSON",value:function(){return{stepType:"docAttr",attr:this.attr,value:this.value}}}],[{key:"fromJSON",value:function(t,e){if("string"!=typeof e.attr)throw RangeError("Invalid input for DocAttrStep.fromJSON");return new n(e.attr,e.value)}}]),n}(k);k.jsonID("docAttr",L),e.TransformError=function(t){o(n,t);var e=a(n);function n(){return u(this,n),e.apply(this,arguments)}return f(n)}(r(Error)),e.TransformError=function t(e){var n=Error.call(this,e);return n.__proto__=t.prototype,n},e.TransformError.prototype=Object.create(Error.prototype),e.TransformError.prototype.constructor=e.TransformError,e.TransformError.prototype.name="TransformError";var q=function(){function t(e){u(this,t),this.doc=e,this.steps=[],this.docs=[],this.mapping=new y}return f(t,[{key:"before",get:function(){return this.docs.length?this.docs[0]:this.doc}},{key:"step",value:function(t){var n=this.maybeStep(t);if(n.failed)throw new e.TransformError(n.failed);return this}},{key:"maybeStep",value:function(t){var e=t.apply(this.doc);return e.failed||this.addStep(t,e.doc),e}},{key:"docChanged",get:function(){return this.steps.length>0}},{key:"addStep",value:function(t,e){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=e}},{key:"replace",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:d.Slice.empty,r=z(this.doc,t,e,n);return r&&this.step(r),this}},{key:"replaceWith",value:function(t,e,n){return this.replace(t,e,new d.Slice(d.Fragment.from(n),0,0))}},{key:"delete",value:function(t,e){return this.replace(t,e,d.Slice.empty)}},{key:"insert",value:function(t,e){return this.replaceWith(t,t,e)}},{key:"replaceRange",value:function(t,e,n){return function(t,e,n,r){if(!r.size)return t.deleteRange(e,n);var i=t.doc.resolve(e),o=t.doc.resolve(n);if(F(i,o,r))return t.step(new C(e,n,r));var s=P(i,t.doc.resolve(n));0==s[s.length-1]&&s.pop();var a=-(i.depth+1);s.unshift(a);for(var l=i.depth,h=i.pos-1;l>0;l--,h--){var c=i.node(l).type.spec;if(c.defining||c.definingAsContext||c.isolating)break;s.indexOf(l)>-1?a=l:i.before(l)==h&&s.splice(1,0,-l)}for(var u=s.indexOf(a),p=[],f=r.openStart,m=r.content,v=0;;v++){var y=m.firstChild;if(p.push(y),v==r.openStart)break;m=y.content}for(var g=f-1;g>=0;g--){var k,w=p[g],x=(k=w.type).spec.defining||k.spec.definingForContent;if(x&&!w.sameMarkup(i.node(Math.abs(a)-1)))f=g;else if(x||!w.type.isTextblock)break}for(var S=r.openStart;S>=0;S--){var b=(S+f+1)%(r.openStart+1),M=p[b];
6if(M)for(var O=0;O<s.length;O++){var E=s[(O+u)%s.length],T=!0;E<0&&(T=!1,E=-E);var R=i.node(E-1),N=i.index(E-1);if(R.canReplaceWith(N,N,M.type,M.marks))return t.replace(i.before(E),T?o.after(E):n,new d.Slice(function t(e,n,r,i,o){if(n<r){var s=e.firstChild;e=e.replaceChild(0,s.copy(t(s.content,n+1,r,i,s)))}if(n>i){var a=o.contentMatchAt(0),l=a.fillBefore(e).append(e);e=l.append(a.matchFragment(l).fillBefore(d.Fragment.empty,!0))}return e}(r.content,0,r.openStart,b),b,r.openEnd))}}for(var A=t.steps.length,I=s.length-1;I>=0&&(t.replace(e,n,r),!(t.steps.length>A));I--){var z=s[I];z<0||(e=i.before(z),n=o.after(z))}}(this,t,e,n),this}},{key:"replaceRangeWith",value:function(t,e,n){return function(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){var i=I(t.doc,e,r.type);null!=i&&(e=n=i)}t.replaceRange(e,n,new d.Slice(d.Fragment.from(r),0,0))}(this,t,e,n),this}},{key:"deleteRange",value:function(t,e){return function(t,e,n){for(var r=t.doc.resolve(e),i=t.doc.resolve(n),o=P(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 t.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 t.delete(r.before(a),i.after(a))}for(var h=1;h<=r.depth&&h<=i.depth;h++)if(e-r.start(h)==r.depth-h&&n>r.end(h)&&i.end(h)-n!=i.depth-h)return t.delete(r.before(h),n);t.delete(e,n)}(this,t,e),this}},{key:"lift",value:function(t,e){return function(t,e,n){for(var r=e.$from,i=e.$to,o=e.depth,s=r.before(o+1),a=i.after(o+1),l=s,h=a,c=d.Fragment.empty,u=0,p=o,f=!1;p>n;p--)f||r.index(p)>0?(f=!0,c=d.Fragment.from(r.node(p).copy(c)),u++):l--;for(var m=d.Fragment.empty,v=0,y=o,g=!1;y>n;y--)g||i.after(y+1)<i.end(y)?(g=!0,m=d.Fragment.from(i.node(y).copy(m)),v++):h++;t.step(new E(l,h,s,a,new d.Slice(c.append(m),u,v),c.size-u,!0))}(this,t,e),this}},{key:"join",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return function(t,e,n){var r=new C(e-n,e+n,d.Slice.empty,!0);t.step(r)}(this,t,e),this}},{key:"wrap",value:function(t,e){return function(t,e,n){for(var r=d.Fragment.empty,i=n.length-1;i>=0;i--){if(r.size){var o=n[i].type.contentMatch.matchFragment(r);if(!o||!o.validEnd)throw RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=d.Fragment.from(n[i].type.create(n[i].attrs,r))}var s=e.start,a=e.end;t.step(new E(s,a,s,a,new d.Slice(r,0,0),n.length,!0))}(this,t,e),this}},{key:"setBlockType",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return function(t,e,n,r,i){if(!r.isTextblock)throw RangeError("Type given to setBlockType should be a textblock");var o=t.steps.length;t.doc.nodesBetween(e,n,function(e,n){var s,a,l,h,c="function"==typeof i?i(e):i;if(e.isTextblock&&!e.hasMarkup(r,c)&&(s=t.doc,a=t.mapping.slice(o).map(n),h=(l=s.resolve(a)).index(),l.parent.canReplaceWith(h,h+1,r))){var u=null;if(r.schema.linebreakReplacement){var p="pre"==r.whitespace,f=!!r.contentMatch.matchType(r.schema.linebreakReplacement);p&&!f?u=!1:!p&&f&&(u=!0)}!1===u&&function(t,e,n,r){e.forEach(function(i,o){if(i.type==i.type.schema.linebreakReplacement){var s=t.mapping.slice(r).map(n+1+o);t.replaceWith(s,s+1,e.type.schema.text("\n"))}})}(t,e,n,o),R(t,t.mapping.slice(o).map(n,1),r,void 0,null===u);var m=t.mapping.slice(o),v=m.map(n,1),y=m.map(n+e.nodeSize,1);return t.step(new E(v,y,v+1,y-1,new d.Slice(d.Fragment.from(r.create(c,null,e.marks)),0,0),1,!0)),!0===u&&function(t,e,n,r){e.forEach(function(i,o){if(i.isText)for(var s,a=/\r?\n|\r/g;s=a.exec(i.text);){var l=t.mapping.slice(r).map(n+1+o+s.index);t.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}})}(t,e,n,o),!1}})}(this,t,e,n,r),this}},{key:"setNodeMarkup",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3?arguments[3]:void 0;return function(t,e,n,r,i){var o=t.doc.nodeAt(e);if(!o)throw RangeError("No node at given position");n||(n=o.type);var s=n.create(r,null,i||o.marks);if(o.isLeaf)return t.replaceWith(e,e+o.nodeSize,s);if(!n.validContent(o.content))throw RangeError("Invalid content for node type "+n.name);t.step(new E(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new d.Slice(d.Fragment.from(s),0,0),1,!0))}(this,t,e,n,r),this}},{key:"setNodeAttribute",value:function(t,e,n){return this.step(new W(t,e,n)),this}},{key:"setDocAttribute",value:function(t,e){return this.step(new L(t,e)),this}},{key:"addNodeMark",value:function(t,e){return this.step(new M(t,e)),this}}
6,{key:"removeNodeMark",value:function(t,e){if(!(e instanceof d.Mark)){var n=this.doc.nodeAt(t);if(!n)throw RangeError("No node at position "+t);if(!(e=e.isInSet(n.marks)))return this}return this.step(new O(t,e)),this}},{key:"split",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2?arguments[2]:void 0;return function(t,e){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3?arguments[3]:void 0,i=t.doc.resolve(e),o=d.Fragment.empty,s=d.Fragment.empty,a=i.depth,l=i.depth-n,h=n-1;a>l;a--,h--){o=d.Fragment.from(i.node(a).copy(o));var c=r&&r[h];s=d.Fragment.from(c?c.type.create(c.attrs,s):i.node(a).copy(s))}t.step(new C(e,e,new d.Slice(o.append(s),n,n),!0))}(this,t,e,n),this}},{key:"addMark",value:function(t,e,n){var r,i,o,s,a;return r=this,s=[],a=[],r.doc.nodesBetween(t,e,function(r,l,h){if(r.isInline){var c=r.marks;if(!n.isInSet(c)&&h.type.allowsMarkType(n.type)){for(var u=Math.max(l,t),p=Math.min(l+r.nodeSize,e),f=n.addToSet(c),d=0;d<c.length;d++)c[d].isInSet(f)||(i&&i.to==u&&i.mark.eq(c[d])?i.to=p:s.push(i=new b(u,p,c[d])));o&&o.to==u?o.to=p:a.push(o=new S(u,p,n))}}}),s.forEach(function(t){return r.step(t)}),a.forEach(function(t){return r.step(t)}),this}},{key:"removeMark",value:function(t,e,n){var r,i,o;return r=this,i=[],o=0,r.doc.nodesBetween(t,e,function(r,s){if(r.isInline){o++;var a=null;if(n instanceof d.MarkType)for(var l,h=r.marks;l=n.isInSet(h);)(a||(a=[])).push(l),h=l.removeFromSet(h);else n?n.isInSet(r.marks)&&(a=[n]):a=r.marks;if(a&&a.length)for(var c=Math.min(s+r.nodeSize,e),u=0;u<a.length;u++){for(var p=a[u],f=void 0,m=0;m<i.length;m++){var v=i[m];v.step==o-1&&p.eq(i[m].style)&&(f=v)}f?(f.to=c,f.step=o):i.push({style:p,from:Math.max(s,t),to:c,step:o})}}}
6),i.forEach(function(t){return r.step(new b(t.from,t.to,t.style))}),this}},{key:"clearIncompatible",value:function(t,e,n){return R(this,t,e,n),this}}]),t}();e.AddMarkStep=S,e.AddNodeMarkStep=M,e.AttrStep=W,e.DocAttrStep=L,e.MapResult=m,e.Mapping=y,e.RemoveMarkStep=b,e.RemoveNodeMarkStep=O,e.ReplaceAroundStep=E,e.ReplaceStep=C,e.Step=k,e.StepMap=v,e.StepResult=w,e.Transform=q,e.canJoin=function(t,e){var n=t.resolve(e),r=n.index();return A(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)},e.canSplit=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3?arguments[3]:void 0,i=t.resolve(e),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 h=i.node(a),c=i.index(a);if(h.type.spec.isolating)return!1;var u=h.content.cutByIndex(c,h.childCount),p=r&&r[l+1];p&&(u=u.replaceChild(0,p.type.create(p.attrs)));var f=r&&r[l]||h;if(!h.canReplace(c+1,h.childCount)||!f.type.validContent(u))return!1}var d=i.indexAfter(o),m=r&&r[0];return i.node(o).canReplaceWith(d,d,m?m.type:i.node(o+1).type)},e.dropPoint=function(t,e,n){var r=t.resolve(e);if(!n.content.size)return e;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,h=r.index(a)+(l>0?1:0),c=r.node(a),u=!1;if(1==s)u=c.canReplace(h,h,i);else{var p=c.contentMatchAt(h).findWrapping(i.firstChild.type);u=p&&c.canReplaceWith(h,h,p[0])}if(u)return 0==l?r.pos:l<0?r.before(a+1):r.after(a+1)}return null},e.findWrapping=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t,i=function(t,e){var n=t.parent,r=t.startIndex,i=t.endIndex,o=n.contentMatchAt(r).findWrapping(e);if(!o)return null;var s=o.length?o[0]:e;return n.canReplaceWith(r,i,s)?o:null}(t,e),o=i&&function(t,e){var n=t.parent,r=t.startIndex,i=t.endIndex,o=n.child(r),s=e.contentMatch.findWrapping(o.type);if(!s)return null;for(var a=(s.length?s[s.length-1]:e).contentMatch,l=r;a&&l<i;l++)a=a.matchType(n.child(l).type);return a&&a.validEnd?s:null}(r,e);return o?i.map(N).concat({type:e,attrs:n}).concat(o.map(N)):null},e.insertPoint=I,e.joinPoint=function(t,e){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,r=t.resolve(e),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&&A(o,s)&&r.node(i).canReplace(a,a+1))return e;if(0==i)break;e=n<0?r.before(i):r.after(i)}},e.liftTarget=function(t){for(var e=t.parent.content.cutByIndex(t.startIndex,t.endIndex),n=t.depth;;--n){var r=t.$from.node(n),i=t.$from.index(n),o=t.$to.indexAfter(n);if(n<t.depth&&r.canReplace(i,o,e))return n;if(0==n||r.type.spec.isolating||!((0==i||r.canReplace(i,r.childCount))&&(o==r.childCount||r.canReplace(0,o))))break}return null},e.replaceStep=z},82933:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});for(var n={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:"'"},r={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},i="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),o="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),s=0;s<10;s++)n[48+s]=n[96+s]=String(s);for(var s=1;s<=24;s++)n[s+111]="F"+s;for(var s=65;s<=90;s++)n[s]=String.fromCharCode(s+32),r[s]=String.fromCharCode(s);for(var a in n)r.hasOwnProperty(a)||(r[a]=n[a]);e.base=n,e.keyName=function(t){var e=!(i&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||o&&t.shiftKey&&t.key&&1==t.key.length||"Unidentified"==t.key)&&t.key||(t.shiftKey?r:n)[t.keyCode]||t.key||"Unidentified";return"Esc"==e&&(e="Escape"),"Del"==e&&(e="Delete"),"Left"==e&&(e="ArrowLeft"),"Up"==e&&(e="ArrowUp"),"Right"==e&&(e="ArrowRight"),"Down"==e&&(e="ArrowDown"),e},e.shift=r},68612:function(t,e,n){"use strict";n.d(e,{NE:function(){return s},QF:function(){return S},QK:function(){return u},YR:function(){return E},Y_:function(){return h},td:function(){return d},uJ:function(){return w},uo:function(){return f},w9:function(){return x},ym:function(){return k}});var r=n(42639),i=n(57870),o=n(82804);let s=(t,e)=>!t.selection.empty&&(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function a(t,e,n=!1){for(let r=t;r;r="start"==e?r.firstChild:r.lastChild){if(r.isTextblock)return!0;
6if(n&&1!=r.childCount)break}return!1}function l(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}let h=(t,e,n)=>{let s=function(t,e){let{$cursor:n}=t.selection;return n&&(e?e.endOfTextblock("forward",t):!(n.parentOffset<n.parent.content.size))?n:null}(t,n);if(!s)return!1;let l=c(s);if(!l)return!1;let h=l.nodeAfter;if(m(t,l,e,1))return!0;if(0==s.parent.content.size&&(a(h,"start")||o.qv.isSelectable(h))){let n=(0,r.dR)(t.doc,s.before(),s.after(),i.p2.empty);if(n&&n.slice.size<n.to-n.from){if(e){let r=t.tr.step(n);r.setSelection(a(h,"start")?o.Y1.findFrom(r.doc.resolve(r.mapping.map(l.pos)),1):o.qv.create(r.doc,r.mapping.map(l.pos))),e(r.scrollIntoView())}return!0}}return!!h.isAtom&&l.depth==s.depth-1&&(e&&e(t.tr.delete(l.pos,l.pos+h.nodeSize).scrollIntoView()),!0)};function c(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}let u=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!!(n.parent.type.spec.code&&n.sameParent(r))&&(e&&e(t.tr.insertText("\n").scrollIntoView()),!0)};function p(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}let f=(t,e)=>{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),s=n.indexAfter(-1),a=p(i.contentMatchAt(s));if(!a||!i.canReplaceWith(s,s,a))return!1;if(e){let r=n.after(),i=t.tr.replaceWith(r,r,a.createAndFill());i.setSelection(o.Y1.near(i.doc.resolve(r),1)),e(i.scrollIntoView())}return!0},d=(t,e)=>(e&&e(t.tr.setSelection(new o.C1(t.doc))),!0);function m(t,e,n,s){let l,h,c,u=e.nodeBefore,p=e.nodeAfter,f,d,m=u.type.spec.isolating||p.type.spec.isolating;if(!m&&(l=e.nodeBefore,h=e.nodeAfter,c=e.index(),l&&h&&l.type.compatibleContent(h.type)&&(!l.content.size&&e.parent.canReplace(c-1,c)?(n&&n(t.tr.delete(e.pos-l.nodeSize,e.pos).scrollIntoView()),!0):!!(e.parent.canReplace(c,c+1)&&(h.isTextblock||(0,r.Mn)(t.doc,e.pos)))&&(n&&n(t.tr.clearIncompatible(e.pos,l.type,l.contentMatchAt(l.childCount)).join(e.pos).scrollIntoView()),!0))))return!0;let v=!m&&e.parent.canReplace(e.index(),e.index()+1);if(v&&(f=(d=u.contentMatchAt(u.childCount)).findWrapping(p.type))&&d.matchType(f[0]||p.type).validEnd){if(n){let o=e.pos+p.nodeSize,s=i.HY.empty;for(let t=f.length-1;t>=0;t--)s=i.HY.from(f[t].create(null,s));s=i.HY.from(u.copy(s));let a=t.tr.step(new r.FC(e.pos-1,o,e.pos,o,new i.p2(s,1,0),f.length,!0)),l=o+2*f.length;(0,r.Mn)(a.doc,l)&&a.join(l),n(a.scrollIntoView())}return!0}let y=p.type.spec.isolating||s>0&&m?null:o.Y1.findFrom(e,1),g=y&&y.$from.blockRange(y.$to),k=g&&(0,r.k9)(g);if(null!=k&&k>=e.depth)return n&&n(t.tr.lift(g,k).scrollIntoView()),!0;if(v&&a(p,"start",!0)&&a(u,"end")){let o=u,s=[];for(;s.push(o),!o.isTextblock;)o=o.lastChild;let a=p,l=1;for(;!a.isTextblock;a=a.firstChild)l++;if(o.canReplace(o.childCount,o.childCount,a.content)){if(n){let o=i.HY.empty;for(let t=s.length-1;t>=0;t--)o=i.HY.from(s[t].copy(o));n(t.tr.step(new r.FC(e.pos-s.length,e.pos+p.nodeSize,e.pos+l,e.pos+p.nodeSize-l,new i.p2(o,s.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function v(t){return function(e,n){let r=e.selection,i=t<0?r.$from:r.$to,s=i.depth;for(;i.node(s).isInline;){if(!s)return!1;s--}return!!i.node(s).isTextblock&&(n&&n(e.tr.setSelection(o.Bs.create(e.doc,t<0?i.start(s):i.end(s)))),!0)}}let y=v(-1),g=v(1);function k(t,e=null){return function(n,i){let{$from:o,$to:s}=n.selection,a=o.blockRange(s),l=a&&(0,r.nd)(a,t,e);return!!l&&(i&&i(n.tr.wrap(a,l).scrollIntoView()),!0)}}function w(t,e=null){return function(n,r){let i=!1;for(let r=0;r<n.selection.ranges.length&&!i;r++){let{$from:{pos:o},$to:{pos:s}}=n.selection.ranges[r];n.doc.nodesBetween(o,s,(r,o)=>{if(i)return!1;if(!(!r.isTextblock||r.hasMarkup(t,e))){if(r.type==t)i=!0;else{let e=n.doc.resolve(o),r=e.index();i=e.parent.canReplaceWith(r,r+1,t)}}})}if(!i)return!1;if(r){let i=n.tr;for(let r=0;r<n.selection.ranges.length;r++){let{$from:{pos:o},$to:{pos:s}}=n.selection.ranges[r];i.setBlockType(o,s,t,e)}r(i.scrollIntoView())}return!0}}function x(t,e=null,n){let r=!1!==(n&&n.removeWhenPresent),i=!1!==(n&&n.enterInlineAtoms);return function(n,s){let{empty:a,$cursor:l,ranges:h}=n.selection;if(a&&!l||!function(t,e,n,r){for(let i=0;i<e.length;i++){let{$from:o,$to:s}=e[i],a=0==o.depth&&t.inlineContent&&t.type.allowsMarkType(n);
6if(t.nodesBetween(o.pos,s.pos,(t,e)=>{if(a||!r&&t.isAtom&&t.isInline&&e>=o.pos&&e+t.nodeSize<=s.pos)return!1;a=t.inlineContent&&t.type.allowsMarkType(n)}),a)return!0}return!1}(n.doc,h,t,i))return!1;if(s){if(l)s(t.isInSet(n.storedMarks||l.marks())?n.tr.removeStoredMark(t):n.tr.addStoredMark(t.create(e)));else{let a,l=n.tr;i||(h=function(t){let e=[];for(let n=0;n<t.length;n++){let{$from:r,$to:i}=t[n];r.doc.nodesBetween(r.pos,i.pos,(t,n)=>{if(t.isAtom&&t.content.size&&t.isInline&&n>=r.pos&&n+t.nodeSize<=i.pos)return n+1>r.pos&&e.push(new o.xm(r,r.doc.resolve(n+1))),r=r.doc.resolve(n+1+t.content.size),!1}),r.pos<i.pos&&e.push(new o.xm(r,i))}return e}(h)),a=r?!h.some(e=>n.doc.rangeHasMark(e.$from.pos,e.$to.pos,t)):!h.every(e=>{let n=!1;return l.doc.nodesBetween(e.$from.pos,e.$to.pos,(r,i,o)=>{if(n)return!1;n=!t.isInSet(r.marks)&&!!o&&o.type.allowsMarkType(t)&&!(r.isText&&/^\s*$/.test(r.textBetween(Math.max(0,e.$from.pos-i),Math.min(r.nodeSize,e.$to.pos-i))))}),!n});for(let n=0;n<h.length;n++){let{$from:r,$to:i}=h[n];if(a){let n=r.pos,o=i.pos,s=r.nodeAfter,a=i.nodeBefore,h=s&&s.isText?/^\s*/.exec(s.text)[0].length:0,c=a&&a.isText?/\s*$/.exec(a.text)[0].length:0;n+h<o&&(n+=h,o-=c),l.addMark(n,o,t.create(e))}else l.removeMark(r.pos,i.pos,t)}s(l.scrollIntoView())}}return!0}}function S(...t){return function(e,n,r){for(let i=0;i<t.length;i++)if(t[i](e,n,r))return!0;return!1}}let b=S(s,(t,e,n)=>{let s=function(t,e){let{$cursor:n}=t.selection;return n&&(e?e.endOfTextblock("backward",t):!(n.parentOffset>0))?n:null}(t,n);if(!s)return!1;let h=l(s);if(!h){let n=s.blockRange(),i=n&&(0,r.k9)(n);return null!=i&&(e&&e(t.tr.lift(n,i).scrollIntoView()),!0)}let c=h.nodeBefore;if(m(t,h,e,-1))return!0;if(0==s.parent.content.size&&(a(c,"end")||o.qv.isSelectable(c)))for(let n=s.depth;;n--){let l=(0,r.dR)(t.doc,s.before(n),s.after(n),i.p2.empty);if(l&&l.slice.size<l.to-l.from){if(e){let n=t.tr.step(l);n.setSelection(a(c,"end")?o.Y1.findFrom(n.doc.resolve(n.mapping.map(h.pos,-1)),-1):o.qv.create(n.doc,h.pos-c.nodeSize)),e(n.scrollIntoView())}return!0}if(1==n||s.node(n-1).childCount>1)break}return!!c.isAtom&&h.depth==s.depth-1&&(e&&e(t.tr.delete(h.pos-c.nodeSize,h.pos).scrollIntoView()),!0)},(t,e,n)=>{let{$head:r,empty:i}=t.selection,s=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;s=l(r)}let a=s&&s.nodeBefore;return!!(a&&o.qv.isSelectable(a))&&(e&&e(t.tr.setSelection(o.qv.create(t.doc,s.pos-a.nodeSize)).scrollIntoView()),!0)}),M=S(s,h,(t,e,n)=>{let{$head:r,empty:i}=t.selection,s=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)return!1;s=c(r)}let a=s&&s.nodeAfter;return!!(a&&o.qv.isSelectable(a))&&(e&&e(t.tr.setSelection(o.qv.create(t.doc,s.pos)).scrollIntoView()),!0)}),O={Enter:S(u,(t,e)=>{let n=t.selection,{$from:r,$to:i}=n;if(n instanceof o.C1||r.parent.inlineContent||i.parent.inlineContent)return!1;let s=p(i.parent.contentMatchAt(i.indexAfter()));if(!s||!s.isTextblock)return!1;if(e){let n=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,a=t.tr.insert(n,s.createAndFill());a.setSelection(o.Bs.create(a.doc,n+1)),e(a.scrollIntoView())}return!0},(t,e)=>{let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let i=n.before();if((0,r.Ax)(t.doc,i))return e&&e(t.tr.split(i).scrollIntoView()),!0}let i=n.blockRange(),o=i&&(0,r.k9)(i);return null!=o&&(e&&e(t.tr.lift(i,o).scrollIntoView()),!0)},(t,e)=>{let{$from:n,$to:i}=t.selection;if(t.selection instanceof o.qv&&t.selection.node.isBlock)return!!(n.parentOffset&&(0,r.Ax)(t.doc,n.pos))&&(e&&e(t.tr.split(n.pos).scrollIntoView()),!0);if(!n.parent.isBlock)return!1;if(e){let s=i.parentOffset==i.parent.content.size,a=t.tr;(t.selection instanceof o.Bs||t.selection instanceof o.C1)&&a.deleteSelection();let l=0==n.depth?null:p(n.node(-1).contentMatchAt(n.indexAfter(-1))),h,c=h?[h]:s&&l?[{type:l}]:void 0,u=(0,r.Ax)(a.doc,a.mapping.map(n.pos),1,c);if(!c&&!u&&(0,r.Ax)(a.doc,a.mapping.map(n.pos),1,l?[{type:l}]:void 0)&&(l&&(c=[{type:l}]),u=!0),u&&(a.split(a.mapping.map(n.pos),1,c),!s&&!n.parentOffset&&n.parent.type!=l)){let t=a.mapping.map(n.before()),e=a.doc.resolve(t);l&&n.node(-1).canReplaceWith(e.index(),e.index()+1,l)&&a.setNodeMarkup(a.mapping.map(n.before()),l)}e(a.scrollIntoView())}return!0}),"Mod-Enter":f,Backspace:b,"Mod-Backspace":b,"Shift-Backspace":b,Delete:M,"Mod-Delete":M,"Mod-a":d},C={"Ctrl-h":O.Backspace,"Alt-Backspace":O["Mod-Backspace"],"Ctrl-d":O.Delete,"Ctrl-Alt-Backspace":O["Mod-Delete"],"Alt-Delete":O["Mod-Delete"],"Alt-d":O["Mod-Delete"],"Ctrl-a":y,"Ctrl-e":g};for(let t in O)C[t]=O[t];let E=("undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):"undefined"!=typeof os&&!!os.platform&&"darwin"==os.platform())?C:O},87925:function(t,e,n){"use strict";n.d(e,{m8:function(){return k},KX:function(){return S},Yw:function(){return x},of:function(){return b}});var r=function(){};r.prototype.append=function(t){return t.length?(t=r.from(t),!this.length&&t||t.length<200&&this.leafAppend(t)||this.length<200&&t.leafPrepend(this)||this.appendInner(t)):this},r.prototype.prepend=function(t){return t.length?r.from(t).append(this):this},r.prototype.appendInner=function(t){return new o(this,t)},r.prototype.slice=function(t,e){return(void 0===t&&(t=0),void 0===e&&(e=this.length),t>=e)?r.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,e))},r.prototype.get=function(t){if(!(t<0)&&!(t>=this.length))return this.getInner(t)},r.prototype.forEach=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=this.length),e<=n?this.forEachInner(t,e,n,0):this.forEachInvertedInner(t,e,n,0)},r.prototype.map=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=this.length);var r=[];return this.forEach(function(e,n){return r.push(t(e,n))},e,n),r},r.from=function(t){return t instanceof r?t:t&&t.length?new i(t):r.empty};var i=function(t){function e(e){t.call(this),this.values=e}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(t,n){return 0==t&&n==this.length?this:new e(this.values.slice(t,n))},e.prototype.getInner=function(t){return this.values[t]},e.prototype.forEachInner=function(t,e,n,r){for(var i=e;i<n;i++)if(!1===t(this.values[i],r+i))return!1},e.prototype.forEachInvertedInner=function(t,e,n,r){for(var i=e-1;i>=n;i--)if(!1===t(this.values[i],r+i))return!1},e.prototype.leafAppend=function(t){if(this.length+t.length<=200)return new e(this.values.concat(t.flatten()))},e.prototype.leafPrepend=function(t){if(this.length+t.length<=200)return new e(t.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(r);r.empty=new i([]);var o=function(t){function e(e,n){t.call(this),this.left=e,this.right=n,this.length=e.length+n.length,this.depth=Math.max(e.depth,n.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(t){return t<this.left.length?this.left.get(t):this.right.get(t-this.left.length)},e.prototype.forEachInner=function(t,e,n,r){var i=this.left.length;if(e<i&&!1===this.left.forEachInner(t,e,Math.min(n,i),r)||n>i&&!1===this.right.forEachInner(t,Math.max(e-i,0),Math.min(this.length,n)-i,r+i))return!1},e.prototype.forEachInvertedInner=function(t,e,n,r){var i=this.left.length;if(e>i&&!1===this.right.forEachInvertedInner(t,e-i,Math.max(n,i)-i,r+i)||n<i&&!1===this.left.forEachInvertedInner(t,Math.min(e,i),n,r))return!1},e.prototype.sliceInner=function(t,e){if(0==t&&e==this.length)return this;var n=this.left.length;return e<=n?this.left.slice(t,e):t>=n?this.right.slice(t-n,e-n):this.left.slice(t,n).append(this.right.slice(0,e-n))},e.prototype.leafAppend=function(t){var n=this.right.leafAppend(t);if(n)return new e(this.left,n)},e.prototype.leafPrepend=function(t){var n=this.left.leafPrepend(t);if(n)return new e(n,this.right)},e.prototype.appendInner=function(t){return this.left.depth>=Math.max(this.right.depth,t.depth)+1?new e(this.left,new e(this.right,t)):new e(this,t)},e}(r),s=n(42639),a=n(82804);class l{constructor(t,e){this.items=t,this.eventCount=e}popEvent(t,e){let n,r,i,o;if(0==this.eventCount)return null;let s=this.items.length;for(;;s--)if(this.items.get(s-1).selection){--s;break}e&&(r=(n=this.remapping(s,this.items.length)).maps.length);let a=t.tr,c=[],u=[];
6return this.items.forEach((t,e)=>{if(!t.step){n||(r=(n=this.remapping(s,e+1)).maps.length),r--,u.push(t);return}if(n){u.push(new h(t.map));let e=t.step.map(n.slice(r)),i;e&&a.maybeStep(e).doc&&(i=a.mapping.maps[a.mapping.maps.length-1],c.push(new h(i,void 0,void 0,c.length+u.length))),r--,i&&n.appendMap(i,r)}else a.maybeStep(t.step);if(t.selection)return i=n?t.selection.map(n.slice(r)):t.selection,o=new l(this.items.slice(0,s).append(u.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:o,transform:a,selection:i}}addTransform(t,e,n,r){var i,o;let s,a=[],c=this.eventCount,p=this.items,f=!r&&p.length?p.get(p.length-1):null;for(let n=0;n<t.steps.length;n++){let i=t.steps[n].invert(t.docs[n]),o=new h(t.mapping.maps[n],i,e),s;(s=f&&f.merge(o))&&(o=s,n?a.pop():p=p.slice(0,p.length-1)),a.push(o),e&&(c++,e=void 0),r||(f=o)}let d=c-n.depth;return d>u&&(i=p,o=d,i.forEach((t,e)=>{if(t.selection&&0==o--)return s=e,!1}),p=i.slice(s),c-=d),new l(p.append(a),c)}remapping(t,e){let n=new s.vs;return this.items.forEach((e,r)=>{let i=null!=e.mirrorOffset&&r-e.mirrorOffset>=t?n.maps.length-e.mirrorOffset:void 0;n.appendMap(e.map,i)},t,e),n}addMaps(t){return 0==this.eventCount?this:new l(this.items.append(t.map(t=>new h(t))),this.eventCount)}rebased(t,e){if(!this.eventCount)return this;let n=[],r=Math.max(0,this.items.length-e),i=t.mapping,o=t.steps.length,s=this.eventCount;this.items.forEach(t=>{t.selection&&s--},r);let a=e;this.items.forEach(e=>{let r=i.getMirror(--a);if(null==r)return;o=Math.min(o,r);let l=i.maps[r];if(e.step){let o=t.steps[r].invert(t.docs[r]),c=e.selection&&e.selection.map(i.slice(a+1,r));c&&s++,n.push(new h(l,o,c))}else n.push(new h(l))},r);let c=[];for(let t=e;t<o;t++)c.push(new h(i.maps[t]));let u=new l(this.items.slice(0,r).append(c).append(n),s);return u.emptyItemCount()>500&&(u=u.compress(this.items.length-n.length)),u}emptyItemCount(){let t=0;return this.items.forEach(e=>{!e.step&&t++}),t}compress(t=this.items.length){let e=this.remapping(0,t),n=e.maps.length,i=[],o=0;return this.items.forEach((r,s)=>{if(s>=t)i.push(r),r.selection&&o++;else if(r.step){let t=r.step.map(e.slice(n)),s=t&&t.getMap();if(n--,s&&e.appendMap(s,n),t){let a=r.selection&&r.selection.map(e.slice(n));a&&o++;let l=new h(s.invert(),t,a),c,u=i.length-1;(c=i.length&&i[u].merge(l))?i[u]=c:i.push(l)}}else r.map&&n--},this.items.length,0),new l(r.from(i.reverse()),o)}}l.empty=new l(r.empty,0);class h{constructor(t,e,n,r){this.map=t,this.step=e,this.selection=n,this.mirrorOffset=r}merge(t){if(this.step&&t.step&&!t.selection){let e=t.step.merge(this.step);if(e)return new h(e.getMap().invert(),e,this.selection)}}}class c{constructor(t,e,n,r,i){this.done=t,this.undone=e,this.prevRanges=n,this.prevTime=r,this.prevComposition=i}}let u=20;function p(t){let e=[];for(let n=t.length-1;n>=0&&0==e.length;n--)t[n].forEach((t,n,r,i)=>e.push(r,i));return e}function f(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let i=e.map(t[r],1),o=e.map(t[r+1],-1);i<=o&&n.push(i,o)}return n}let d=!1,m=null;function v(t){let e=t.plugins;if(m!=e){d=!1,m=e;for(let t=0;t<e.length;t++)if(e[t].spec.historyPreserveItems){d=!0;break}}return d}let y=new a.H$("history"),g=new a.H$("closeHistory");function k(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new a.Sy({key:y,state:{init:()=>new c(l.empty,l.empty,null,0,-1),apply:(e,n,r)=>(function(t,e,n,r){let i=n.getMeta(y),o;if(i)return i.historyState;n.getMeta(g)&&(t=new c(t.done,t.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(0==n.steps.length)return t;if(s&&s.getMeta(y))return s.getMeta(y).redo?new c(t.done.addTransform(n,void 0,r,v(e)),t.undone,p(n.mapping.maps),t.prevTime,t.prevComposition):new c(t.done,t.undone.addTransform(n,void 0,r,v(e)),null,t.prevTime,t.prevComposition);if(!1===n.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))return(o=n.getMeta("rebased"))?new c(t.done.rebased(n,o),t.undone.rebased(n,o),f(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new c(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),f(t.prevRanges,n.mapping),t.prevTime,t.prevComposition);{let i=n.getMeta("composition"),o=0==t.prevTime||!s&&t.prevComposition!=i&&(t.prevTime<(n.time||0)-r.newGroupDelay||!function(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;
6return t.mapping.maps[0].forEach((t,r)=>{for(let i=0;i<e.length;i+=2)t<=e[i+1]&&r>=e[i]&&(n=!0)}),n}(n,t.prevRanges)),a=s?f(t.prevRanges,n.mapping):p(n.mapping.maps);return new c(t.done.addTransform(n,o?e.selection.getBookmark():void 0,r,v(e)),l.empty,a,n.time,null==i?t.prevComposition:i)}})(n,r,e,t)},config:t,props:{handleDOMEvents:{beforeinput(t,e){let n=e.inputType,r="historyUndo"==n?x:"historyRedo"==n?S:null;return!!r&&(e.preventDefault(),r(t.state,t.dispatch))}}}})}function w(t,e){return(n,r)=>{let i=y.getState(n);if(!i||0==(t?i.undone:i.done).eventCount)return!1;if(r){let o=function(t,e,n){let r=v(e),i=y.get(e).spec.config,o=(n?t.undone:t.done).popEvent(e,r);if(!o)return null;let s=o.selection.resolve(o.transform.doc),a=(n?t.done:t.undone).addTransform(o.transform,e.selection.getBookmark(),i,r),l=new c(n?a:o.remaining,n?o.remaining:a,null,0,-1);return o.transform.setSelection(s).setMeta(y,{redo:n,historyState:l})}(i,n,t);o&&r(e?o.scrollIntoView():o)}return!0}}let x=w(!1,!0),S=w(!0,!0);function b(t){let e=y.getState(t);return e?e.done.eventCount:0}w(!1,!1),w(!0,!1)},33205:function(t,e,n){"use strict";n.d(e,{Hw:function(){return o},VK:function(){return i},dU:function(){return a}});var r=n(82804);class i{constructor(t,e,n={}){this.match=t,this.match=t,this.handler="string"==typeof e?function(t,n,r,i){let o=e;if(n[1]){let t=n[0].lastIndexOf(n[1]);o+=n[0].slice(t+n[1].length);let e=(r+=t)-i;e>0&&(o=n[0].slice(t-e,t)+o,r=i)}return t.tr.insertText(o,r,i)}:e,this.undoable=!1!==n.undoable,this.inCode=n.inCode||!1}}function o({rules:t}){let e=new r.Sy({state:{init:()=>null,apply(t,e){return t.getMeta(this)||(t.selectionSet||t.docChanged?null:e)}},props:{handleTextInput:(n,r,i,o)=>s(n,r,i,o,t,e),handleDOMEvents:{compositionend:n=>{setTimeout(()=>{let{$cursor:r}=n.state.selection;r&&s(n,r.pos,r.pos,"",t,e)})}}},isInputRules:!0});return e}function s(t,e,n,r,i,o){if(t.composing)return!1;let s=t.state,a=s.doc.resolve(e),l=a.parent.textBetween(Math.max(0,a.parentOffset-500),a.parentOffset,null,"")+r;for(let h=0;h<i.length;h++){let c=i[h];if(a.parent.type.spec.code){if(!c.inCode)continue}else if("only"===c.inCode)continue;let u=c.match.exec(l),p=u&&c.handler(s,u,e-(u[0].length-r.length),n);if(p)return c.undoable&&p.setMeta(o,{transform:p,from:e,to:n,text:r}),t.dispatch(p),!0}return!1}let a=(t,e)=>{let n=t.plugins;for(let r=0;r<n.length;r++){let i=n[r],o;if(i.spec.isInputRules&&(o=i.getState(t))){if(e){let n=t.tr,r=o.transform;for(let t=r.steps.length-1;t>=0;t--)n.step(r.steps[t].invert(r.docs[t]));if(o.text){let e=n.doc.resolve(o.from).marks();n.replaceWith(o.from,o.to,t.schema.text(o.text,e))}else n.delete(o.from,o.to);e(n)}return!0}}return!1};new i(/--$/,"â"),new i(/\.\.\.$/,"â¦"),new i(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,"â"),new i(/"$/,"â"),new i(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,"â"),new i(/'$/,"â")},3078:function(t,e,n){"use strict";n.d(e,{h:function(){return p}});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(var a=1;a<=24;a++)r[a+111]="F"+a;for(var 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 h=n(82804);let c="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);
vendor: 4,648 bytes, line 6
6function u(t,e,n=!0){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n&&e.shiftKey&&(t="Shift-"+t),t}function p(t){let e;return new h.Sy({props:{handleKeyDown:(e=function(t){let e=Object.create(null);for(let n in t)e[function(t){let e,n,r,i,o=t.split(/-(?!$)/),s=o[o.length-1];"Space"==s&&(s=" ");for(let t=0;t<o.length-1;t++){let s=o[t];if(/^(cmd|meta|m)$/i.test(s))i=!0;else if(/^a(lt)?$/i.test(s))e=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else if(/^s(hift)?$/i.test(s))r=!0;else if(/^mod$/i.test(s))c?i=!0:n=!0;else throw Error("Unrecognized modifier name: "+s)}return e&&(s="Alt-"+s),n&&(s="Ctrl-"+s),i&&(s="Meta-"+s),r&&(s="Shift-"+s),s}(n)]=t[n];return e}(t),function(t,n){var a;let l=("Esc"==(a=!(o&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||s&&n.shiftKey&&n.key&&1==n.key.length||"Unidentified"==n.key)&&n.key||(n.shiftKey?i:r)[n.keyCode]||n.key||"Unidentified")&&(a="Escape"),"Del"==a&&(a="Delete"),"Left"==a&&(a="ArrowLeft"),"Up"==a&&(a="ArrowUp"),"Right"==a&&(a="ArrowRight"),"Down"==a&&(a="ArrowDown"),a),h,c=e[u(l,n)];if(c&&c(t.state,t.dispatch,t))return!0;if(1==l.length&&" "!=l){if(n.shiftKey){let r=e[u(l,n,!1)];if(r&&r(t.state,t.dispatch,t))return!0}if((n.shiftKey||n.altKey||n.metaKey||l.charCodeAt(0)>127)&&(h=r[n.keyCode])&&h!=l){let r=e[u(h,n)];if(r&&r(t.state,t.dispatch,t))return!0}}return!1})}})}},57870:function(t,e,n){"use strict";function r(t){this.content=t}n.d(e,{aw:function(){return P},PW:function(){return V},HY:function(){return i},vc:function(){return l},ZU:function(){return B},NB:function(){return b},Ts:function(){return x},e4:function(){return h},V_:function(){return j},p2:function(){return c}}),r.prototype={constructor:r,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return -1},get:function(t){var e=this.find(t);return -1==e?void 0:this.content[e+1]},update:function(t,e,n){var i=n&&n!=t?this.remove(n):this,o=i.find(t),s=i.content.slice();return -1==o?s.push(n||t,e):(s[o+1]=e,n&&(s[o]=n)),new r(s)},remove:function(t){var e=this.find(t);if(-1==e)return this;var n=this.content.slice();return n.splice(e,2),new r(n)},addToStart:function(t,e){return new r([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new r(n)},addBefore:function(t,e,n){var i=this.remove(e),o=i.content.slice(),s=i.find(t);return o.splice(-1==s?o.length:s,0,e,n),new r(o)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return(t=r.from(t)).size?new r(t.content.concat(this.subtract(t).content)):this},append:function(t){return(t=r.from(t)).size?new r(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=r.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}},r.from=function(t){if(t instanceof r)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new r(e)};class i{constructor(t,e){if(this.content=t,this.size=e||0,null==e)for(let e=0;e<t.length;e++)this.size+=t[e].nodeSize}nodesBetween(t,e,n,r=0,i){for(let o=0,s=0;s<e;o++){let a=this.content[o],l=s+a.nodeSize;if(l>t&&!1!==n(a,r+s,i||null,o)&&a.content.size){let i=s+1;a.nodesBetween(Math.max(0,t-i),Math.min(a.content.size,e-i),n,r+i)}s=l}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,e,n,r){let i="",o=!0;return this.nodesBetween(t,e,(s,a)=>{let l=s.isText?s.text.slice(Math.max(t,a)-a,e-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}append(t){if(!t.size)return this;if(!this.size)return t;let e=this.lastChild,n=t.firstChild,r=this.content.slice(),o=0;for(e.isText&&e.sameMarkup(n)&&(r[r.length-1]=e.withText(e.text+n.text),o=1);o<t.content.length;o++)r.push(t.content[o]);return new i(r,this.size+t.size)}cut(t,e=this.size){if(0==t&&e==this.size)return this;let n=[],r=0;if(e>t)for(let i=0,o=0;o<e;i++){let s=this.content[i],a=o+s.nodeSize;a>t&&((o<t||a>e)&&(s=s.isText?s.cut(Math.max(0,t-o),Math.min(s.text.length,e-o)):s.cut(Math.max(0,t-o-1),Math.min(s.content.size,e-o-1))),n.push(s),r+=s.nodeSize),o=a}return new i(n,r)}cutByIndex(t,e){return t==e?i.empty:0==t&&e==this.content.length?this:new i(this.content.slice(t,e))}replaceChild(t,e){let n=this.content[t];if(n==e)return this;let r=this.content.slice(),o=this.size+e.nodeSize-n.nodeSize;return r[t]=e,new i(r,o)}addToStart(t){return new i([t].concat(this.content),this.size+t.no
6deSize)}addToEnd(t){return new i(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let e=0;e<this.content.length;e++)if(!this.content[e].eq(t.content[e]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(t){let e=this.content[t];if(!e)throw RangeError("Index "+t+" out of range for "+this);return e}maybeChild(t){return this.content[t]||null}forEach(t){for(let e=0,n=0;e<this.content.length;e++){let r=this.content[e];t(r,n,e),n+=r.nodeSize}}findDiffStart(t,e=0){return function t(e,n,r){for(let i=0;;i++){if(i==e.childCount||i==n.childCount)return e.childCount==n.childCount?null:r;let o=e.child(i),s=n.child(i);if(o==s){r+=o.nodeSize;continue}if(!o.sameMarkup(s))return r;if(o.isText&&o.text!=s.text){for(let t=0;o.text[t]==s.text[t];t++)r++;return r}if(o.content.size||s.content.size){let e=t(o.content,s.content,r+1);if(null!=e)return e}r+=o.nodeSize}}(this,t,e)}findDiffEnd(t,e=this.size,n=t.size){return function t(e,n,r,i){for(let o=e.childCount,s=n.childCount;;){if(0==o||0==s)return o==s?null:{a:r,b:i};let a=e.child(--o),l=n.child(--s),h=a.nodeSize;if(a==l){r-=h,i-=h;continue}if(!a.sameMarkup(l))return{a:r,b:i};if(a.isText&&a.text!=l.text){let t=0,e=Math.min(a.text.length,l.text.length);for(;t<e&&a.text[a.text.length-t-1]==l.text[l.text.length-t-1];)t++,r--,i--;return{a:r,b:i}}if(a.content.size||l.content.size){let e=t(a.content,l.content,r-1,i-1);if(e)return e}r-=h,i-=h}}(this,t,e,n)}findIndex(t,e=-1){if(0==t)return s(0,t);if(t==this.size)return s(this.content.length,t);if(t>this.size||t<0)throw RangeError(`Position ${t} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=r+this.child(n).nodeSize;if(i>=t){if(i==t||e>0)return s(n+1,i);return s(n,r)}r=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,e){if(!e)return i.empty;if(!Array.isArray(e))throw RangeError("Invalid input for Fragment.fromJSON");return new i(e.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return i.empty;let e,n=0;for(let r=0;r<t.length;r++){let i=t[r];n+=i.nodeSize,r&&i.isText&&t[r-1].sameMarkup(i)?(e||(e=t.slice(0,r)),e[e.length-1]=i.withText(e[e.length-1].text+i.text)):e&&e.push(i)}return new i(e||t,n)}static from(t){if(!t)return i.empty;if(t instanceof i)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new i([t],t.nodeSize);throw RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}i.empty=new i([],0);let o={index:0,offset:0};function s(t,e){return o.index=t,o.offset=e,o}function a(t,e){if(t===e)return!0;if(!(t&&"object"==typeof t)||!(e&&"object"==typeof e))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!a(t[n],e[n]))return!1}else{for(let n in t)if(!(n in e)||!a(t[n],e[n]))return!1;for(let n in e)if(!(n in t))return!1}return!0}class l{constructor(t,e){this.type=t,this.attrs=e}addToSet(t){let e,n=!1;for(let r=0;r<t.length;r++){let i=t[r];if(this.eq(i))return t;if(this.type.excludes(i.type))e||(e=t.slice(0,r));else{if(i.type.excludes(this.type))return t;!n&&i.type.rank>this.type.rank&&(e||(e=t.slice(0,r)),e.push(this),n=!0),e&&e.push(i)}}return e||(e=t.slice()),n||e.push(this),e}removeFromSet(t){for(let e=0;e<t.length;e++)if(this.eq(t[e]))return t.slice(0,e).concat(t.slice(e+1));return t}isInSet(t){for(let e=0;e<t.length;e++)if(this.eq(t[e]))return!0;return!1}eq(t){return this==t||this.type==t.type&&a(this.attrs,t.attrs)}toJSON(){let t={type:this.type.name};for(let e in this.attrs){t.attrs=this.attrs;break}return t}static fromJSON(t,e){if(!e)throw RangeError("Invalid input for Mark.fromJSON");let n=t.marks[e.type];if(!n)throw RangeError(`There is no mark type ${e.type} in this schema`);let r=n.create(e.attrs);return n.checkAttrs(r.attrs),r}static sameSet(t,e){if(t==e)return!0;
vendor: 5,543 bytes, line 6
6if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].eq(e[n]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&0==t.length)return l.none;if(t instanceof l)return[t];let e=t.slice();return e.sort((t,e)=>t.type.rank-e.type.rank),e}}l.none=[];class h extends Error{}class c{constructor(t,e,n){this.content=t,this.openStart=e,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,e){let n=function t(e,n,r,i){let{index:o,offset:s}=e.findIndex(n),a=e.maybeChild(o);if(s==n||a.isText)return i&&!i.canReplace(o,o,r)?null:e.cut(0,n).append(r).append(e.cut(n));let l=t(a.content,n-s-1,r);return l&&e.replaceChild(o,a.copy(l))}(this.content,t+this.openStart,e);return n&&new c(n,this.openStart,this.openEnd)}removeBetween(t,e){return new c(function t(e,n,r){let{index:i,offset:o}=e.findIndex(n),s=e.maybeChild(i),{index:a,offset:l}=e.findIndex(r);if(o==n||s.isText){if(l!=r&&!e.child(a).isText)throw RangeError("Removing non-flat range");return e.cut(0,n).append(e.cut(r))}if(i!=a)throw RangeError("Removing non-flat range");return e.replaceChild(i,s.copy(t(s.content,n-o-1,r-o-1)))}(this.content,t+this.openStart,e+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,e){if(!e)return c.empty;let n=e.openStart||0,r=e.openEnd||0;if("number"!=typeof n||"number"!=typeof r)throw RangeError("Invalid input for Slice.fromJSON");return new c(i.fromJSON(t,e.content),n,r)}static maxOpen(t,e=!0){let n=0,r=0;for(let r=t.firstChild;r&&!r.isLeaf&&(e||!r.type.spec.isolating);r=r.firstChild)n++;for(let n=t.lastChild;n&&!n.isLeaf&&(e||!n.type.spec.isolating);n=n.lastChild)r++;return new c(t,n,r)}}function u(t,e){if(!e.type.compatibleContent(t.type))throw new h("Cannot join "+e.type.name+" onto "+t.type.name)}function p(t,e,n){let r=t.node(n);return u(r,e.node(n)),r}function f(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function d(t,e,n,r){let i=(e||t).node(n),o=0,s=e?e.index(n):i.childCount;t&&(o=t.index(n),t.depth>n?o++:t.textOffset&&(f(t.nodeAfter,r),o++));for(let t=o;t<s;t++)f(i.child(t),r);e&&e.depth==n&&e.textOffset&&f(e.nodeBefore,r)}function m(t,e){return t.type.checkContent(e),t.copy(e)}function v(t,e,n){let r=[];return d(null,t,n,r),t.depth>n&&f(m(p(t,e,n+1),v(t,e,n+1)),r),d(e,null,n,r),new i(r)}c.empty=new c(i.empty,0,0);class y{constructor(t,e,n){this.pos=t,this.path=e,this.parentOffset=n,this.depth=e.length/3-1}resolveDepth(t){return null==t?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[3*this.resolveDepth(t)]}index(t){return this.path[3*this.resolveDepth(t)+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t!=this.depth||this.textOffset?1:0)}start(t){return 0==(t=this.resolveDepth(t))?0:this.path[3*t-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(!(t=this.resolveDepth(t)))throw RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]}after(t){if(!(t=this.resolveDepth(t)))throw RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]+this.path[3*t].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,e=this.index(this.depth);if(e==t.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=t.child(e);return n?t.child(e).cut(n):r}get nodeBefore(){let t=this.index(this.depth),e=this.pos-this.path[this.path.length-1];return e?this.parent.child(t).cut(0,e):0==t?null:this.parent.child(t-1)}posAtIndex(t,e){e=this.resolveDepth(e);let n=this.path[3*e],r=0==e?0:this.path[3*e-1]+1;for(let e=0;e<t;e++)r+=n.child(e).nodeSize;return r}marks(){let t=this.parent,e=this.index();if(0==t.content.size)return l.none;if(this.textOffset)return t.child(e).marks;let n=t.maybeChild(e-1),r=t.maybeChild(e);if(!n){let t=n;n=r,r=t}let i=n.marks;for(var o=0;o<i.length;o++)!1!==i[o].type.spec.inclusive||r&&i[o].isInSet(r.marks)||(i=i[o--].removeFromSet(i));return i}marksAcross(t){let e=this.parent.maybeChild(this.index());if(!e||!e.isInline)return null;let n=e.marks,r=t.parent.maybeChild(t.index());for(var 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}sharedDepth(t){for(let e=this.depth;e>0;e--)if(this.start(e)<=t&&this.end(e)>=t)return e;return 0}blockRange(t=this,e){if(t.pos<this.pos)return t.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==t.pos?1:0);n>=0;n--)if(t.pos<=this.end(n)&&(!e||e(this.node(n))))return new x(this,t,n);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos<this.pos?t:this}toString(){let t="";for(let e=1;e<=this.depth;e++)t+=(t?"/":"")+this.node(e).type.name+"_"+this.index(e-1);return t+":"+this.parentOffset}static resolve(t,e){if(!(e>=0&&e<=t.content.size))throw RangeError("Position "+e+" out of range");let n=[],r=0,i=e;for(let e=t;;){let{index:t,offset:o}=e.content.findIndex(i),s=i-o;if(n.push(e,t,r+o),!s||(e=e.child(t)).isText)break;
6i=s-1,r+=o+1}return new y(e,n,i)}static resolveCached(t,e){let n=w.get(t);if(n)for(let t=0;t<n.elts.length;t++){let r=n.elts[t];if(r.pos==e)return r}else w.set(t,n=new g);let r=n.elts[n.i]=y.resolve(t,e);return n.i=(n.i+1)%k,r}}class g{constructor(){this.elts=[],this.i=0}}let k=12,w=new WeakMap;class x{constructor(t,e,n){this.$from=t,this.$to=e,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}let S=Object.create(null);class b{constructor(t,e,n,r=l.none){this.type=t,this.attrs=e,this.marks=r,this.content=n||i.empty}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(t){return this.content.child(t)}maybeChild(t){return this.content.maybeChild(t)}forEach(t){this.content.forEach(t)}nodesBetween(t,e,n,r=0){this.content.nodesBetween(t,e,n,r,this)}descendants(t){this.nodesBetween(0,this.content.size,t)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(t,e,n,r){return this.content.textBetween(t,e,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(t){return this==t||this.sameMarkup(t)&&this.content.eq(t.content)}sameMarkup(t){return this.hasMarkup(t.type,t.attrs,t.marks)}hasMarkup(t,e,n){return this.type==t&&a(this.attrs,e||t.defaultAttrs||S)&&l.sameSet(this.marks,n||l.none)}copy(t=null){return t==this.content?this:new b(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new b(this.type,this.attrs,this.content,t)}cut(t,e=this.content.size){return 0==t&&e==this.content.size?this:this.copy(this.content.cut(t,e))}slice(t,e=this.content.size,n=!1){if(t==e)return c.empty;let r=this.resolve(t),i=this.resolve(e),o=n?0:r.sharedDepth(e),s=r.start(o);return new c(r.node(o).content.cut(r.pos-s,i.pos-s),r.depth-o,i.depth-o)}replace(t,e,n){return function(t,e,n){if(n.openStart>t.depth)throw new h("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new h("Inconsistent open depths");return function t(e,n,r,o){let s=e.index(o),a=e.node(o);if(s==n.index(o)&&o<e.depth-r.openStart){let i=t(e,n,r,o+1);return a.copy(a.content.replaceChild(s,i))}if(!r.content.size)return m(a,v(e,n,o));if(r.openStart||r.openEnd||e.depth!=o||n.depth!=o){let{start:t,end:s}=function(t,e){let n=e.depth-t.openStart,r=e.node(n).copy(t.content);for(let t=n-1;t>=0;t--)r=e.node(t).copy(i.from(r));return{start:r.resolveNoCache(t.openStart+n),end:r.resolveNoCache(r.content.size-t.openEnd-n)}}(r,e);return m(a,function t(e,n,r,o,s){let a=e.depth>s&&p(e,n,s+1),l=o.depth>s&&p(r,o,s+1),h=[];return d(null,e,s,h),a&&l&&n.index(s)==r.index(s)?(u(a,l),f(m(a,t(e,n,r,o,s+1)),h)):(a&&f(m(a,v(e,n,s+1)),h),d(n,r,s,h),l&&f(m(l,v(r,o,s+1)),h)),d(o,null,s,h),new i(h)}(e,t,s,n,o))}{let t=e.parent,i=t.content;return m(t,i.cut(0,e.parentOffset).append(r.content).append(i.cut(n.parentOffset)))}}(t,e,n,0)}(this.resolve(t),this.resolve(e),n)}nodeAt(t){for(let e=this;;){let{index:n,offset:r}=e.content.findIndex(t);if(!(e=e.maybeChild(n)))return null;if(r==t||e.isText)return e;t-=r+1}}childAfter(t){let{index:e,offset:n}=this.content.findIndex(t);return{node:this.content.maybeChild(e),index:e,offset:n}}childBefore(t){if(0==t)return{node:null,index:0,offset:0};let{index:e,offset:n}=this.content.findIndex(t);if(n<t)return{node:this.content.child(e),index:e,offset:n};let r=this.content.child(e-1);return{node:r,index:e-1,offset:n-r.nodeSize}}resolve(t){return y.resolveCached(this,t)}resolveNoCache(t){return y.resolve(this,t)}rangeHasMark(t,e,n){let r=!1;return e>t&&this.nodesBetween(t,e,t=>(n.isInSet(t.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}
6toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),O(this.marks,t)}contentMatchAt(t){let e=this.type.contentMatch.matchFragment(this.content,0,t);if(!e)throw Error("Called contentMatchAt on a node with invalid content");return e}canReplace(t,e,n=i.empty,r=0,o=n.childCount){let s=this.contentMatchAt(t).matchFragment(n,r,o),a=s&&s.matchFragment(this.content,e);if(!a||!a.validEnd)return!1;for(let t=r;t<o;t++)if(!this.type.allowsMarks(n.child(t).marks))return!1;return!0}canReplaceWith(t,e,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(t).matchType(n),o=i&&i.matchFragment(this.content,e);return!!o&&o.validEnd}canAppend(t){return t.content.size?this.canReplace(this.childCount,this.childCount,t.content):this.type.compatibleContent(t.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let t=l.none;for(let e=0;e<this.marks.length;e++){let n=this.marks[e];n.type.checkAttrs(n.attrs),t=n.addToSet(t)}if(!l.sameSet(t,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let t={type:this.type.name};for(let e in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map(t=>t.toJSON())),t}static fromJSON(t,e){let n;if(!e)throw RangeError("Invalid input for Node.fromJSON");if(e.marks){if(!Array.isArray(e.marks))throw RangeError("Invalid mark data for Node.fromJSON");n=e.marks.map(t.markFromJSON)}if("text"==e.type){if("string"!=typeof e.text)throw RangeError("Invalid text node in JSON");return t.text(e.text,n)}let r=i.fromJSON(t,e.content),o=t.nodeType(e.type).create(e.attrs,r,n);return o.type.checkAttrs(o.attrs),o}}b.prototype.text=void 0;class M extends b{constructor(t,e,n,r){if(super(t,e,null,r),!n)throw RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):O(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,e){return this.text.slice(t,e)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new M(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new M(this.type,this.attrs,t,this.marks)}cut(t=0,e=this.text.length){return 0==t&&e==this.text.length?this:this.withText(this.text.slice(t,e))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function O(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class C{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,e){var n;let r,i=new E(t,e);if(null==i.next)return C.empty;let o=function t(e){let n=[];do n.push(function(e){let n=[];do n.push(function(e){let n=function(e){if(e.eat("(")){let n=t(e);return e.eat(")")||e.err("Missing closing paren"),n}if(/\W/.test(e.next))e.err("Unexpected token '"+e.next+"'");else{let t=(function(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let i=[];for(let t in n){let r=n[t];r.groups.indexOf(e)>-1&&i.push(r)}return 0==i.length&&t.err("No node type or group '"+e+"' found"),i})(e,e.next).map(t=>(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==t.length?t[0]:{type:"choice",exprs:t}}}(e);for(;;)if(e.eat("+"))n={type:"plus",expr:n};else if(e.eat("*"))n={type:"star",expr:n};else if(e.eat("?"))n={type:"opt",expr:n};else if(e.eat("{"))n=function(t,e){let n=T(t),r=n;return t.eat(",")&&(r="}"!=t.next?T(t):-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}(e,n);else break;return n}(e));while(e.next&&")"!=e.next&&"|"!=e.next);return 1==n.length?n[0]:{type:"seq",exprs:n}}(e));while(e.eat("|"));return 1==n.length?n[0]:{type:"choice",exprs:n}}(i);i.next&&i.err("Unexpected trailing text");let s=(n=function(t){let e=[[]];return i(function t(e,o){if("choice"==e.type)return e.exprs.reduce((e,n)=>e.concat(t(n,o)),[]);if("seq"==e.type)for(let r=0;;r++){let s=t(e.exprs[r],o);if(r==e.exprs.length-1)return s;i(s,o=n())}else if("star"==e.type){let s=n();return r(o,s),i(t(e.expr,s),s),[r(s)]}else if("plus"==e.type){let s=n();return i(t(e.expr,o),s),i(t(e.expr,s),s),[r(s)]}else if("opt"==e.type)return[r(o)].concat(t(e.expr,o));else if("range"==e.type){let s=o;for(let r=0;r<e.min;r++){let r=n();i(t(e.expr,s),r),s=r}if(-1==e.max)i(t(e.expr,s),s);else for(let o=e.min;o<e.max;o++){let o=n();r(s,o),i(t(e.expr,s),o),s=o}return[r(s)]}else if("name"==e.type)return[r(o,void 0,e.value)];else throw Error("Unknown expr type")}(t,0),n()),e;function n(){return e.push([])-1}function r(t,n,r){let i={term:r,to:n};return e[t].push(i),i}function i(t,e){t.forEach(t=>t.to=e)}}(o),r=Object.create(null),function t(e){let i=[];e.forEach(t=>{n[t].forEach(({term:t,to:e})=>{let r;if(t){for(let e=0;e<i.length;e++)i[e][0]==t&&(r=i[e][1]);
vendor: 6,156 bytes, line 6
6N(n,e).forEach(e=>{r||i.push([t,r=[]]),-1==r.indexOf(e)&&r.push(e)})}})});let o=r[e.join(",")]=new C(e.indexOf(n.length-1)>-1);for(let e=0;e<i.length;e++){let n=i[e][1].sort(R);o.next.push({type:i[e][0],next:r[n.join(",")]||t(n)})}return o}(N(n,0)));return function(t,e){for(let n=0,r=[t];n<r.length;n++){let t=r[n],i=!t.validEnd,o=[];for(let e=0;e<t.next.length;e++){let{type:n,next:s}=t.next[e];o.push(n.name),i&&!(n.isText||n.hasRequiredAttrs())&&(i=!1),-1==r.indexOf(s)&&r.push(s)}i&&e.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(s,i),s}matchType(t){for(let e=0;e<this.next.length;e++)if(this.next[e].type==t)return this.next[e].next;return null}matchFragment(t,e=0,n=t.childCount){let r=this;for(let i=e;r&&i<n;i++)r=r.matchType(t.child(i).type);return r}get inlineContent(){return 0!=this.next.length&&this.next[0].type.isInline}get defaultType(){for(let t=0;t<this.next.length;t++){let{type:e}=this.next[t];if(!(e.isText||e.hasRequiredAttrs()))return e}return null}compatible(t){for(let e=0;e<this.next.length;e++)for(let n=0;n<t.next.length;n++)if(this.next[e].type==t.next[n].type)return!0;return!1}fillBefore(t,e=!1,n=0){let r=[this];return function o(s,a){let l=s.matchFragment(t,n);if(l&&(!e||l.validEnd))return i.from(a.map(t=>t.createAndFill()));for(let t=0;t<s.next.length;t++){let{type:e,next:n}=s.next[t];if(!(e.isText||e.hasRequiredAttrs())&&-1==r.indexOf(n)){r.push(n);let t=o(n,a.concat(e));if(t)return t}}return null}(this,[])}findWrapping(t){for(let e=0;e<this.wrapCache.length;e+=2)if(this.wrapCache[e]==t)return this.wrapCache[e+1];let e=this.computeWrapping(t);return this.wrapCache.push(t,e),e}computeWrapping(t){let e=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(t)){let t=[];for(let e=r;e.type;e=e.via)t.push(e.type);return t.reverse()}for(let t=0;t<i.next.length;t++){let{type:o,next:s}=i.next[t];o.isLeaf||o.hasRequiredAttrs()||o.name in e||r.type&&!s.validEnd||(n.push({match:o.contentMatch,type:o,via:r}),e[o.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(t){if(t>=this.next.length)throw RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];return!function e(n){t.push(n);for(let r=0;r<n.next.length;r++)-1==t.indexOf(n.next[r].next)&&e(n.next[r].next)}(this),t.map((e,n)=>{let r=n+(e.validEnd?"*":" ")+" ";for(let n=0;n<e.next.length;n++)r+=(n?", ":"")+e.next[n].type.name+"->"+t.indexOf(e.next[n].next);return r}).join("\n")}}C.empty=new C(!0);class E{constructor(t,e){this.string=t,this.nodeTypes=e,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(t){return this.next==t&&(this.pos++||!0)}err(t){throw SyntaxError(t+" (in content expression '"+this.string+"')")}}function T(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function R(t,e){return e-t}function N(t,e){let n=[];return function e(r){let i=t[r];if(1==i.length&&!i[0].term)return e(i[0].to);n.push(r);for(let t=0;t<i.length;t++){let{term:r,to:o}=i[t];r||-1!=n.indexOf(o)||e(o)}}(e),n.sort(R)}function A(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function I(t,e){let n=Object.create(null);for(let r in t){let i=e&&e[r];if(void 0===i){let e=t[r];if(e.hasDefault)i=e.default;else throw RangeError("No value supplied for attribute "+r)}n[r]=i}return n}function z(t,e,n,r){for(let r in e)if(!(r in t))throw RangeError(`Unsupported attribute ${r} for ${n} of type ${r}`);for(let n in t){let r=t[n];r.validate&&r.validate(e[n])}}function F(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new $(t,r,e[r]);return n}class J{constructor(t,e,n){this.name=t,this.schema=e,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=F(t,n.attrs),this.defaultAttrs=A(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||"text"==t),this.isText="text"==t}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==C.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1}compatibleContent(t){return this==t||this.contentMatch.compatible(t.contentMatch)}computeAttrs(t){return!t&&this.defaultAttrs?this.defaultAttrs:I(this.attrs,t)}create(t=null,e,n){if(this.isText)throw Error("NodeType.create can't construct text nodes");return new b(this,this.computeAttrs(t),i.from(e),l.setFrom(n))}createChecked(t=null,e,n){return e=i.from(e),this.checkContent(e),new b(this,this.computeAttrs(t),e,l.setFrom(n))}createAndFill(t=null,e,n){if(t=this.computeAttrs(t),(e=i.from(e)).size){let t=this.contentMatch.fillBefore(e);if(!t)return null;e=t.append(e)}let r=this.contentMatch.matchFragment(e),o=r&&r.fillBefore(i.empty,!0);return o?new b(this,t,e.append(o),l.setFrom(n)):null}validContent(t){let e=this.contentMatch.matchFragment(t);if(!e||!e.validEnd)return!1;for(let e=0;e<t.childCount;e++)if(!this.allowsMarks(t.child(e).marks))return!1;return!0}checkContent(t){if(!this.validContent(t))throw RangeError(`Invalid content for node ${this.name}: ${t.toString().slice(0,50)}`)}checkAttrs(t){z(this.attrs,t,"node",this.name)}allowsMarkType(t){return null==this.markSet||this.markSet.indexOf(t)>-1}allowsMarks(t){if(null==this.markSet)return!0;for(let e=0;e<t.length;e++)if(!this.allowsMarkType(t[e].type))return!1;return!0}allowedMarks(t){let e;if(null==this.markSet)return t;for(let n=0;n<t.length;n++)this.allowsMarkType(t[n].type)?e&&e.push(t[n]):e||(e=t.slice(0,n));return e?e.length?e:l.none:t}static compile(t,e){let n=Object.create(null);t.forEach((t,r)=>n[t]=new J(t,e,r));let r=e.spec.topNode||"doc";if(!n[r])throw RangeError("Schema is missing its top node type ('"+r+"')");
6if(!n.text)throw RangeError("Every schema needs a 'text' type");for(let t in n.text.attrs)throw RangeError("The text node type should not have attributes");return n}}class ${constructor(t,e,n){let r;this.hasDefault=Object.prototype.hasOwnProperty.call(n,"default"),this.default=n.default,this.validate="string"==typeof n.validate?(r=n.validate.split("|"),n=>{let i=null===n?"null":typeof n;if(0>r.indexOf(i))throw RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${i}`)}):n.validate}get isRequired(){return!this.hasDefault}}class B{constructor(t,e,n,r){this.name=t,this.rank=e,this.schema=n,this.spec=r,this.attrs=F(t,r.attrs),this.excluded=null;let i=A(this.attrs);this.instance=i?new l(this,i):null}create(t=null){return!t&&this.instance?this.instance:new l(this,I(this.attrs,t))}static compile(t,e){let n=Object.create(null),r=0;return t.forEach((t,i)=>n[t]=new B(t,r++,e,i)),n}removeFromSet(t){for(var e=0;e<t.length;e++)t[e].type==this&&(t=t.slice(0,e).concat(t.slice(e+1)),e--);return t}isInSet(t){for(let e=0;e<t.length;e++)if(t[e].type==this)return t[e]}checkAttrs(t){z(this.attrs,t,"mark",this.name)}excludes(t){return this.excluded.indexOf(t)>-1}}class j{constructor(t){this.linebreakReplacement=null,this.cached=Object.create(null);let e=this.spec={};for(let n in t)e[n]=t[n];e.nodes=r.from(t.nodes),e.marks=r.from(t.marks||{}),this.nodes=J.compile(this.spec.nodes,this),this.marks=B.compile(this.spec.marks,this);let n=Object.create(null);for(let t in this.nodes){if(t in this.marks)throw RangeError(t+" can not be both a node and a mark");let e=this.nodes[t],r=e.spec.content||"",i=e.spec.marks;if(e.contentMatch=n[r]||(n[r]=C.parse(r,this.nodes)),e.inlineContent=e.contentMatch.inlineContent,e.spec.linebreakReplacement){if(this.linebreakReplacement)throw RangeError("Multiple linebreak nodes defined");if(!e.isInline||!e.isLeaf)throw RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=e}e.markSet="_"==i?null:i?D(this,i.split(" ")):""!=i&&e.inlineContent?null:[]}for(let t in this.marks){let e=this.marks[t],n=e.spec.excludes;e.excluded=null==n?[e]:""==n?[]:D(this,n.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)}node(t,e=null,n,r){if("string"==typeof t)t=this.nodeType(t);else if(t instanceof J){if(t.schema!=this)throw RangeError("Node type from different schema used ("+t.name+")")}else throw RangeError("Invalid node type: "+t);return t.createChecked(e,n,r)}text(t,e){let n=this.nodes.text;return new M(n,n.defaultAttrs,t,l.setFrom(e))}mark(t,e){return"string"==typeof t&&(t=this.marks[t]),t.create(e)}nodeFromJSON(t){return b.fromJSON(this,t)}markFromJSON(t){return l.fromJSON(this,t)}nodeType(t){let e=this.nodes[t];if(!e)throw RangeError("Unknown node type: "+t);return e}}function D(t,e){let n=[];for(let r=0;r<e.length;r++){let i=e[r],o=t.marks[i],s=o;if(o)n.push(o);else for(let e in t.marks){let r=t.marks[e];("_"==i||r.spec.group&&r.spec.group.split(" ").indexOf(i)>-1)&&n.push(s=r)}if(!s)throw SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}class P{constructor(t,e){this.schema=t,this.rules=e,this.tags=[],this.styles=[];let n=this.matchedStyles=[];e.forEach(t=>{if(null!=t.tag)this.tags.push(t);else if(null!=t.style){let e=/[^=]*/.exec(t.style)[0];0>n.indexOf(e)&&n.push(e),this.styles.push(t)}}),this.normalizeLists=!this.tags.some(e=>{if(!/^(ul|ol)\b/.test(e.tag)||!e.node)return!1;let n=t.nodes[e.node];return n.contentMatch.matchType(n)})}parse(t,e={}){let n=new K(this,e,!1);return n.addAll(t,l.none,e.from,e.to),n.finish()}parseSlice(t,e={}){let n=new K(this,e,!0);return n.addAll(t,l.none,e.from,e.to),c.maxOpen(n.finish())}matchTag(t,e,n){for(let i=n?this.tags.indexOf(n)+1:0;i<this.tags.length;i++){var r;let n=this.tags[i];if(r=n.tag,(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,r)&&(void 0===n.namespace||t.namespaceURI==n.namespace)&&(!n.context||e.matchesContext(n.context))){if(n.getAttrs
6){let e=n.getAttrs(t);if(!1===e)continue;n.attrs=e||void 0}return n}}}matchStyle(t,e,n,r){for(let i=r?this.styles.indexOf(r)+1:0;i<this.styles.length;i++){let r=this.styles[i],o=r.style;if(0==o.indexOf(t)&&(!r.context||n.matchesContext(r.context))&&(!(o.length>t.length)||61==o.charCodeAt(t.length)&&o.slice(t.length+1)==e)){if(r.getAttrs){let t=r.getAttrs(e);if(!1===t)continue;r.attrs=t||void 0}return r}}}static schemaRules(t){let e=[];function n(t){let n=null==t.priority?50:t.priority,r=0;for(;r<e.length;r++){let t=e[r];if((null==t.priority?50:t.priority)<n)break}e.splice(r,0,t)}for(let e in t.marks){let r=t.marks[e].spec.parseDOM;r&&r.forEach(t=>{n(t=Y(t)),t.mark||t.ignore||t.clearMark||(t.mark=e)})}for(let e in t.nodes){let r=t.nodes[e].spec.parseDOM;r&&r.forEach(t=>{n(t=Y(t)),t.node||t.ignore||t.mark||(t.node=e)})}return e}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new P(t,P.schemaRules(t)))}}let W={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},L={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},q={ol:!0,ul:!0};function _(t,e,n){return null!=e?(e?1:0)|("full"===e?2:0):t&&"pre"==t.whitespace?3:-5&n}class H{constructor(t,e,n,r,i,o){this.type=t,this.attrs=e,this.marks=n,this.solid=r,this.options=o,this.content=[],this.activeMarks=l.none,this.match=i||(4&o?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let e=this.type.contentMatch.fillBefore(i.from(t));if(e)this.match=this.type.contentMatch.matchFragment(e);else{let e=this.type.contentMatch,n;
6return(n=e.findWrapping(t.type))?(this.match=e,n):null}}return this.match.findWrapping(t.type)}finish(t){if(!(1&this.options)){let t=this.content[this.content.length-1],e;t&&t.isText&&(e=/[ \t\r\n\u000c]+$/.exec(t.text))&&(t.text.length==e[0].length?this.content.pop():this.content[this.content.length-1]=t.withText(t.text.slice(0,t.text.length-e[0].length)))}let e=i.from(this.content);return!t&&this.match&&(e=e.append(this.match.fillBefore(i.empty,!0))),this.type?this.type.create(this.attrs,e,this.marks):e}inlineContext(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!W.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class K{constructor(t,e,n){this.parser=t,this.options=e,this.isOpen=n,this.open=0;let r=e.topNode,i,o=_(null,e.preserveWhitespace,0)|(n?4:0);i=r?new H(r.type,r.attrs,l.none,!0,e.topMatch||r.type.contentMatch,o):n?new H(null,null,l.none,!0,null,o):new H(t.schema.topNodeType,null,l.none,!0,null,o),this.nodes=[i],this.find=e.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t,e){3==t.nodeType?this.addTextNode(t,e):1==t.nodeType&&this.addElement(t,e)}addTextNode(t,e){let n=t.nodeValue,r=this.top;if(2&r.options||r.inlineContext(t)||/[^ \t\r\n\u000c]/.test(n)){if(1&r.options)n=2&r.options?n.replace(/\r\n?/g,"\n"):n.replace(/\r?\n|\r/g," ");else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let e=r.content[r.content.length-1],i=t.previousSibling;
6(!e||i&&"BR"==i.nodeName||e.isText&&/[ \t\r\n\u000c]$/.test(e.text))&&(n=n.slice(1))}n&&this.insertNode(this.parser.schema.text(n),e),this.findInText(t)}else this.findInside(t)}addElement(t,e,n){let r=t.nodeName.toLowerCase(),i;q.hasOwnProperty(r)&&this.parser.normalizeLists&&function(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let t=1==e.nodeType?e.nodeName.toLowerCase():null;t&&q.hasOwnProperty(t)&&n?(n.appendChild(e),e=n):"li"==t?n=e:t&&(n=null)}}(t);let o=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(i=this.parser.matchTag(t,this,n));if(o?o.ignore:L.hasOwnProperty(r))this.findInside(t),this.ignoreFallback(t,e);else if(!o||o.skip||o.closeParent){o&&o.closeParent?this.open=Math.max(0,this.open-1):o&&o.skip.nodeType&&(t=o.skip);let n,i=this.top,s=this.needsBlock;if(W.hasOwnProperty(r))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),n=!0,i.type||(this.needsBlock=!0);else if(!t.firstChild){this.leafFallback(t,e);return}let a=o&&o.skip?e:this.readStyles(t,e);a&&this.addAll(t,a),n&&this.sync(i),this.needsBlock=s}else{let n=this.readStyles(t,e);n&&this.addElementByRule(t,o,n,!1===o.consuming?i:void 0)}}leafFallback(t,e){"BR"==t.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode("\n"),e)}ignoreFallback(t,e){"BR"!=t.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"),e)}readStyles(t,e){let n=t.style;if(n&&n.length)for(let t=0;t<this.parser.matchedStyles.length;t++){let r=this.parser.matchedStyles[t],i=n.getPropertyValue(r);if(i)for(let t;;){let n=this.parser.matchStyle(r,i,this,t);if(!n)break;if(n.ignore)return null;if(e=n.clearMark?e.filter(t=>!n.clearMark(t)):e.concat(this.parser.schema.marks[n.mark].create(n.attrs)),!1===n.consuming)t=n;else break}}return e}addElementByRule(t,e,n,r){let i,o;if(e.node){if((o=this.parser.schema.nodes[e.node]).isLeaf)this.insertNode(o.create(e.attrs),n)||this.leafFallback(t,n);else{let t=this.enter(o,e.attrs||null,n,e.preserveWhitespace);t&&(i=!0,n=t)}}else{let t=this.parser.schema.marks[e.mark];n=n.concat(t.create(e.attrs))}let s=this.top;if(o&&o.isLeaf)this.findInside(t);else if(r)this.addElement(t,n,r);else if(e.getContent)this.findInside(t),e.getContent(t,this.parser.schema).forEach(t=>this.insertNode(t,n));else{let r=t;"string"==typeof e.contentElement?r=t.querySelector(e.contentElement):"function"==typeof e.contentElement?r=e.contentElement(t):e.contentElement&&(r=e.contentElement),this.findAround(t,r,!0),this.addAll(r,n)}i&&this.sync(s)&&this.open--}addAll(t,e,n,r){let i=n||0;for(let o=n?t.childNodes[n]:t.firstChild,s=null==r?null:t.childNodes[r];o!=s;o=o.nextSibling,++i)this.findAtPoint(t,i),this.addDOM(o,e);this.findAtPoint(t,i)}findPlace(t,e){let n,r;for(let e=this.open;e>=0;e--){let i=this.nodes[e],o=i.findWrapping(t);if(o&&(!n||n.length>o.length)&&(n=o,r=i,!o.length)||i.solid)break}if(!n)return null;this.sync(r);for(let t=0;t<n.length;t++)e=this.enterInner(n[t],null,e,!1);return e}insertNode(t,e){if(t.isInline&&this.needsBlock&&!this.top.type){let t=this.textblockFromContext();t&&(e=this.enterInner(t,null,e))}let n=this.findPlace(t,e);if(n){this.closeExtra();let e=this.top;e.match&&(e.match=e.match.matchType(t.type));let r=l.none;for(let i of n.concat(t.marks))(e.type?e.type.allowsMarkType(i.type):U(i.type,t.type))&&(r=i.addToSet(r));return e.content.push(t.mark(r)),!0}return!1}enter(t,e,n,r){let i=this.findPlace(t.create(e),n);return i&&(i=this.enterInner(t,e,n,!0,r)),i}enterInner(t,e,n,r=!1,i){this.closeExtra();let o=this.top;o.match=o.match&&o.match.matchType(t);let s=_(t,i,o.options);4&o.options&&0==o.content.length&&(s|=4);let a=l.none;return n=n.filter(e=>(o.type?!o.type.allowsMarkType(e.type):!U(e.type,t))||(a=e.addToSet(a),!1)),this.nodes.push(new H(t,e,a,r,null,s)),this.open++,n}closeExtra(t=!1){let e=this.nodes.length-1;if(e>this.open){for(;e>this.open;e--)this.nodes[e-1].content.push(this.nodes[e].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(t){for(let e=this.open;e>=0;e--)if(this.nodes[e]==t)return this.open=e,!0;return!1}get currentPos(){this.closeExtra();let t=0;for(let e=this.open;e>=0;e--){let n=this.nodes[e].content;for(let e=n.length-1;e>=0;e--)t+=n[e].nodeSize;e&&t++}return t}findAtPoint(t,e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==t&&this.find[n].offset==e&&(this.find[n].pos=this.currentPos)}findInside(t){if(this.find)for(let e=0;e<this.find.length;e++)null==this.find[e].pos&&1==t.nodeType&&t.contains(this.find[e].node)&&(this.find[e].pos=this.currentPos)}findAround(t,e,n){if(t!=e&&this.find)for(let r=0;r<this.find.length;r++)null==this.find[r].pos&&1==t.nodeType&&t.contains(this.find[r].node)&&e.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}findInText(t){if(this.find)for(let e=0;e<this.find.length;e++)this.find[e].node==t&&(this.find[e].pos=this.currentPos-(t.nodeValue.length-this.find[e].offset))}matchesContext(t){if(t.indexOf("|")>-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let e=t.split("/"),n=this.options.context,r=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),i=-(n?n.depth+1:0)+(r?0:1),o=(t,s)=>{for(;t>=0;t--){let a=e[t];
6if(""==a){if(t==e.length-1||0==t)continue;for(;s>=i;s--)if(o(t-1,s))return!0;return!1}{let t=s>0||0==s&&r?this.nodes[s].type:n&&s>=i?n.node(s-i).type:null;if(!t||t.name!=a&&-1==t.groups.indexOf(a))return!1;s--}}return!0};return o(e.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let e=t.depth;e>=0;e--){let n=t.node(e).contentMatchAt(t.indexAfter(e)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let t in this.parser.schema.nodes){let e=this.parser.schema.nodes[t];if(e.isTextblock&&e.defaultAttrs)return e}}}function Y(t){let e={};for(let n in t)e[n]=t[n];return e}function U(t,e){let n=e.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(t))continue;let o=[],s=t=>{o.push(t);for(let n=0;n<t.edgeCount;n++){let{type:r,next:i}=t.edge(n);if(r==e||0>o.indexOf(i)&&s(i))return!0}};if(s(i.contentMatch))return!0}}class V{constructor(t,e){this.nodes=t,this.marks=e}serializeFragment(t,e={},n){n||(n=Z(e).createDocumentFragment());let r=n,i=[];return t.forEach(t=>{if(i.length||t.marks.length){let n=0,o=0;for(;n<i.length&&o<t.marks.length;){let e=t.marks[o];if(!this.marks[e.type.name]){o++;continue}if(!e.eq(i[n][0])||!1===e.type.spec.spanning)break;n++,o++}for(;n<i.length;)r=i.pop()[1];for(;o<t.marks.length;){let n=t.marks[o++],s=this.serializeMark(n,t.isInline,e);s&&(i.push([n,r]),r.appendChild(s.dom),r=s.contentDOM||s.dom)}}r.appendChild(this.serializeNodeInner(t,e))}),n}serializeNodeInner(t,e){let{dom:n,contentDOM:r}=X(Z(e),this.nodes[t.type.name](t),null,t.attrs);if(r){if(t.isLeaf)throw RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(t.content,e,r)}return n}serializeNode(t,e={}){let n=this.serializeNodeInner(t,e);for(let r=t.marks.length-1;r>=0;r--){let i=this.serializeMark(t.marks[r],t.isInline,e);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(t,e,n={}){let r=this.marks[t.type.name];return r&&X(Z(n),r(t,e),null,t.attrs)}static renderSpec(t,e,n=null,r){return X(t,e,n,r)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new V(this.nodesFromSchema(t),this.marksFromSchema(t)))}
6static nodesFromSchema(t){let e=G(t.nodes);return e.text||(e.text=t=>t.text),e}static marksFromSchema(t){return G(t.marks)}}function G(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function Z(t){return t.document||window.document}let Q=new WeakMap;function X(t,e,n,r){let i,o,s;if("string"==typeof e)return{dom:t.createTextNode(e)};if(null!=e.nodeType)return{dom:e};if(e.dom&&null!=e.dom.nodeType)return e;let a=e[0],l;if("string"!=typeof a)throw RangeError("Invalid array passed to renderSpec");if(r&&(void 0===(o=Q.get(r))&&Q.set(r,(s=null,function t(e){if(e&&"object"==typeof e){if(Array.isArray(e)){if("string"==typeof e[0])s||(s=[]),s.push(e);else for(let n=0;n<e.length;n++)t(e[n])}else for(let n in e)t(e[n])}}(r),o=s)),l=o)&&l.indexOf(e)>-1)throw RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let h=a.indexOf(" ");h>0&&(n=a.slice(0,h),a=a.slice(h+1));let c=n?t.createElementNS(n,a):t.createElement(a),u=e[1],p=1;if(u&&"object"==typeof u&&null==u.nodeType&&!Array.isArray(u)){for(let t in p=2,u)if(null!=u[t]){let e=t.indexOf(" ");e>0?c.setAttributeNS(t.slice(0,e),t.slice(e+1),u[t]):c.setAttribute(t,u[t])}}for(let o=p;o<e.length;o++){let s=e[o];if(0===s){if(o<e.length-1||o>p)throw RangeError("Content hole must be the only child of its parent node");return{dom:c,contentDOM:c}}{let{dom:e,contentDOM:o}=X(t,s,n,r);if(c.appendChild(e),o){if(i)throw RangeError("Multiple content holes");i=o}}}return{dom:c,contentDOM:i}}},82804:function(t,e,n){"use strict";n.d(e,{Bs:function(){return c},C1:function(){return d},H$:function(){return E},Sy:function(){return M},Y1:function(){return s},qv:function(){return p},xm:function(){return a},yy:function(){return b}});var r=n(57870),i=n(42639);let o=Object.create(null);class s{constructor(t,e,n){this.$anchor=t,this.$head=e,this.ranges=n||[new a(t.min(e),t.max(e))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let t=this.ranges;for(let e=0;e<t.length;e++)if(t[e].$from.pos!=t[e].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(t,e=r.p2.empty){let n=e.content.lastChild,i=null;for(let t=0;t<e.openEnd;t++)i=n,n=n.lastChild;let o=t.steps.length,s=this.ranges;for(let a=0;a<s.length;a++){let{$from:l,$to:h}=s[a],c=t.mapping.slice(o);t.replaceRange(c.map(l.pos),c.map(h.pos),a?r.p2.empty:e),0==a&&y(t,o,(n?n.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(t,e){let n=t.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:o,$to:s}=r[i],a=t.mapping.slice(n),l=a.map(o.pos),h=a.map(s.pos);i?t.deleteRange(l,h):(t.replaceRangeWith(l,h,e),y(t,n,e.isInline?-1:1))}}static findFrom(t,e,n=!1){let r=t.parent.inlineContent?new c(t):v(t.node(0),t.parent,t.pos,t.index(),e,n);if(r)return r;for(let r=t.depth-1;r>=0;
6r--){let i=e<0?v(t.node(0),t.node(r),t.before(r+1),t.index(r),e,n):v(t.node(0),t.node(r),t.after(r+1),t.index(r)+1,e,n);if(i)return i}return null}static near(t,e=1){return this.findFrom(t,e)||this.findFrom(t,-e)||new d(t.node(0))}static atStart(t){return v(t,t,0,0,1)||new d(t)}static atEnd(t){return v(t,t,t.content.size,t.childCount,-1)||new d(t)}static fromJSON(t,e){if(!e||!e.type)throw RangeError("Invalid input for Selection.fromJSON");let n=o[e.type];if(!n)throw RangeError(`No selection type ${e.type} defined`);return n.fromJSON(t,e)}static jsonID(t,e){if(t in o)throw RangeError("Duplicate use of selection JSON ID "+t);return o[t]=e,e.prototype.jsonID=t,e}getBookmark(){return c.between(this.$anchor,this.$head).getBookmark()}}s.prototype.visible=!0;class a{constructor(t,e){this.$from=t,this.$to=e}}let l=!1;function h(t){l||t.parent.inlineContent||(l=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class c extends s{constructor(t,e=t){h(t),h(e),super(t,e)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,e){let n=t.resolve(e.map(this.head));if(!n.parent.inlineContent)return s.near(n);let r=t.resolve(e.map(this.anchor));return new c(r.parent.inlineContent?r:n,n)}replace(t,e=r.p2.empty){if(super.replace(t,e),e==r.p2.empty){let e=this.$from.marksAcross(this.$to);e&&t.ensureMarks(e)}}eq(t){return t instanceof c&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new u(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,e){if("number"!=typeof e.anchor||"number"!=typeof e.head)throw RangeError("Invalid input for TextSelection.fromJSON");return new c(t.resolve(e.anchor),t.resolve(e.head))}static create(t,e,n=e){let r=t.resolve(e);return new this(r,n==e?r:t.resolve(n))}static between(t,e,n){let r=t.pos-e.pos;if((!n||r)&&(n=r>=0?1:-1),!e.parent.inlineContent){let t=s.findFrom(e,n,!0)||s.findFrom(e,-n,!0);if(!t)return s.near(e,n);e=t.$head}return t.parent.inlineContent||(0==r?t=e:(t=(s.findFrom(t,-n,!0)||s.findFrom(t,n,!0)).$anchor).pos<e.pos==r<0||(t=e)),new c(t,e)}}s.jsonID("text",c);class u{constructor(t,e){this.anchor=t,this.head=e}map(t){return new u(t.map(this.anchor),t.map(this.head))}resolve(t){return c.between(t.resolve(this.anchor),t.resolve(this.head))}}class p extends s{constructor(t){let e=t.nodeAfter;super(t,t.node(0).resolve(t.pos+e.nodeSize)),this.node=e}map(t,e){let{deleted:n,pos:r}=e.mapResult(this.anchor),i=t.resolve(r);return n?s.near(i):new p(i)}content(){return new r.p2(r.HY.from(this.node),0,0)}eq(t){return t instanceof p&&t.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new f(this.anchor)}static fromJSON(t,e){if("number"!=typeof e.anchor)throw RangeError("Invalid input for NodeSelection.fromJSON");return new p(t.resolve(e.anchor))}static create(t,e){return new p(t.resolve(e))}static isSelectable(t){return!t.isText&&!1!==t.type.spec.selectable}}p.prototype.visible=!1,s.jsonID("node",p);class f{constructor(t){this.anchor=t}map(t){let{deleted:e,pos:n}=t.mapResult(this.anchor);return e?new u(n,n):new f(n)}resolve(t){let e=t.resolve(this.anchor),n=e.nodeAfter;return n&&p.isSelectable(n)?new p(e):s.near(e)}}class d extends s{constructor(t){super(t.resolve(0),t.resolve(t.content.size))}replace(t,e=r.p2.empty){if(e==r.p2.empty){t.delete(0,t.doc.content.size);let e=s.atStart(t.doc);e.eq(t.selection)||t.setSelection(e)}else super.replace(t,e)}toJSON(){return{type:"all"}}static fromJSON(t){return new d(t)}map(t){return new d(t)}eq(t){return t instanceof d}getBookmark(){return m}}s.jsonID("all",d);let m={map(){return this},resolve:t=>new d(t)};function v(t,e,n,r,i,o=!1){if(e.inlineContent)return c.create(t,n);for(let s=r-(i>0?0:1);i>0?s<e.childCount:s>=0;s+=i){let r=e.child(s);if(r.isAtom){if(!o&&p.isSelectable(r))return p.create(t,n-(i<0?r.nodeSize:0))}else{let e=v(t,r,n+i,i<0?r.childCount:0,i,o);if(e)return e}n+=r.nodeSize*i}return null}function y(t,e,n){let r,o=t.steps.length-1;if(o<e)return;let a=t.steps[o];(a instanceof i.Pu||a instanceof i.FC)&&(t.mapping.maps[o].forEac
vendor: 5,353 bytes, line 6
6h((t,e,n,i)=>{null==r&&(r=i)}),t.setSelection(s.near(t.doc.resolve(r),n)))}class g extends i.wx{constructor(t){super(t.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=t.selection,this.storedMarks=t.storedMarks}get selection(){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}setSelection(t){if(t.$from.doc!=this.doc)throw RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=t,this.curSelectionFor=this.steps.length,this.updated=(1|this.updated)&-3,this.storedMarks=null,this}get selectionSet(){return(1&this.updated)>0}setStoredMarks(t){return this.storedMarks=t,this.updated|=2,this}ensureMarks(t){return r.vc.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this}addStoredMark(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(2&this.updated)>0}addStep(t,e){super.addStep(t,e),this.updated=-3&this.updated,this.storedMarks=null}setTime(t){return this.time=t,this}replaceSelection(t){return this.selection.replace(this,t),this}replaceSelectionWith(t,e=!0){let n=this.selection;return e&&(t=t.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||r.vc.none))),n.replaceWith(this,t),this}deleteSelection(){return this.selection.replace(this),this}insertText(t,e,n){let r=this.doc.type.schema;if(null==e)return t?this.replaceSelectionWith(r.text(t),!0):this.deleteSelection();{if(null==n&&(n=e),n=null==n?e:n,!t)return this.deleteRange(e,n);let i=this.storedMarks;if(!i){let t=this.doc.resolve(e);i=n==e?t.marks():t.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(e,n,r.text(t,i)),this.selection.empty||this.setSelection(s.near(this.selection.$to)),this}}setMeta(t,e){return this.meta["string"==typeof t?t:t.key]=e,this}getMeta(t){return this.meta["string"==typeof t?t:t.key]}get isGeneric(){for(let t in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=4,this}get scrolledIntoView(){return(4&this.updated)>0}}function k(t,e){return e&&t?t.bind(e):t}class w{constructor(t,e,n){this.name=t,this.init=k(e.init,n),this.apply=k(e.apply,n)}}let x=[new w("doc",{init:t=>t.doc||t.schema.topNodeType.createAndFill(),apply:t=>t.doc}),new w("selection",{init:(t,e)=>t.selection||s.atStart(e.doc),apply:t=>t.selection}),new w("storedMarks",{init:t=>t.storedMarks||null,apply:(t,e,n,r)=>r.selection.$cursor?t.storedMarks:null}),new w("scrollToSelection",{init:()=>0,apply:(t,e)=>t.scrolledIntoView?e+1:e})];class S{constructor(t,e){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=x.slice(),e&&e.forEach(t=>{if(this.pluginsByKey[t.key])throw RangeError("Adding different instances of a keyed plugin ("+t.key+")");this.plugins.push(t),this.pluginsByKey[t.key]=t,t.spec.state&&this.fields.push(new w(t.key,t.spec.state,t))})}}class b{constructor(t){this.config=t}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(t){return this.applyTransaction(t).state}filterTransaction(t,e=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=e){let e=this.config.plugins[n];if(e.spec.filterTransaction&&!e.spec.filterTransaction.call(e,t,this))return!1}return!0}applyTransaction(t){if(!this.filterTransaction(t))return{state:this,transactions:[]};let e=[t],n=this.applyInner(t),r=null;for(;;){let i=!1;for(let o=0;o<this.config.plugins.length;o++){let s=this.config.plugins[o];if(s.spec.appendTransaction){let a=r?r[o].n:0,l=r?r[o].state:this,h=a<e.length&&s.spec.appendTransaction.call(s,a?e.slice(a):e,l,n);if(h&&n.filterTransaction(h,o)){if(h.setMeta("appendedTransaction",t),!r){r=[];for(let t=0;t<this.config.plugins.length;t++)r.push(t<o?{state:n,n:e.length}:{state:this,n:0})}e.push(h),n=n.applyInner(h),i=!0}r&&(r[o]={state:n,n:e.length})}}if(!i)return{state:n,transactions:e}}}applyInner(t){if(!t.before.eq(this.doc))throw RangeError("Applying a mismatched transaction");let e=new b(this.config),n=this.config.fields;for(let r=0;r<n.length;r++){let i=n[r];e[i.name]=i.apply(t,this[i.name],this,e)}return e}get tr(){return new g(this)}static create(t){let e=new S(t.doc?t.doc.type.schema:t.schema,t.plugins),n=new b(e);for(let r=0;r<e.fields.length;r++)n[e.fields[r].name]=e.fields[r].init(t,n);return n}reconfigure(t){let e=new S(this.schema,t.plugins),n=e.fields,r=new b(e);for(let e=0;e<n.length;e++){let i=n[e].name;r[i]=this.hasOwnProperty(i)?this[i]:n[e].init(t,r)}return r}toJSON(t){let e={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(e.storedMarks=this.storedMarks.map(t=>t.toJSON())),t&&"object"==typeof t)for(let n in t){if("doc"==n||"selection"==n)throw RangeError("The JSON fields `doc` and `selection` are reserved");let r=t[n],i=r.spec.state;i&&i.toJSON&&(e[n]=i.toJSON.call(r,this[r.key]))}return e}static fromJSON(t,e,n){if(!e)throw RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw RangeError("Required config field 'schema' missing");let i=new S(t.schema,t.plugins),o=new b(i);return i.fields.forEach(i=>
6{if("doc"==i.name)o.doc=r.NB.fromJSON(t.schema,e.doc);else if("selection"==i.name)o.selection=s.fromJSON(o.doc,e.selection);else if("storedMarks"==i.name)e.storedMarks&&(o.storedMarks=e.storedMarks.map(t.schema.markFromJSON));else{if(n)for(let r in n){let s=n[r],a=s.spec.state;if(s.key==i.name&&a&&a.fromJSON&&Object.prototype.hasOwnProperty.call(e,r)){o[i.name]=a.fromJSON.call(s,t,e[r],o);return}}o[i.name]=i.init(t,o)}}),o}}class M{constructor(t){this.spec=t,this.props={},t.props&&function t(e,n,r){for(let i in e){let o=e[i];o instanceof Function?o=o.bind(n):"handleDOMEvents"==i&&(o=t(o,n,{})),r[i]=o}return r}(t.props,this,this.props),this.key=t.key?t.key.key:C("plugin")}getState(t){return t[this.key]}}let O=Object.create(null);function C(t){return t in O?t+"$"+ ++O[t]:(O[t]=0,t+"$")}class E{constructor(t="key"){this.key=C(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}},42639:function(t,e,n){"use strict";n.d(e,{Ax:function(){return S},FC:function(){return v},KS:function(){return o},Mn:function(){return b},Pu:function(){return m},dR:function(){return O},k9:function(){return k},nd:function(){return w},nj:function(){return M},vs:function(){return s},wx:function(){return $}});var r=n(57870);class i{constructor(t,e,n){this.pos=t,this.delInfo=e,this.recover=n}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}}class o{constructor(t,e=!1){if(this.ranges=t,this.inverted=e,!t.length&&o.empty)return o.empty}recover(t){let e=0,n=65535&t;if(!this.inverted)for(let t=0;t<n;t++)e+=this.ranges[3*t+2]-this.ranges[3*t+1];return this.ranges[3*n]+e+(t-(65535&t))/65536}mapResult(t,e=1){return this._map(t,e,!1)}map(t,e=1){return this._map(t,e,!0)}_map(t,e,n){let r=0,o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?r:0);if(l>t)break;let h=this.ranges[a+o],c=this.ranges[a+s],u=l+h;if(t<=u){let o=h?t==l?-1:t==u?1:e:e,s=l+r+(o<0?0:c);if(n)return s;let p=t==(e<0?l:u)?null:a/3+(t-l)*65536,f=t==l?2:t==u?1:4;return(e<0?t!=l:t!=u)&&(f|=8),new i(s,f,p)}r+=c-h}return n?t+r:new i(t+r,0,null)}touches(t,e){let n=0,r=65535&e,i=this.inverted?2:1,o=this.inverted?1:2;for(let e=0;e<this.ranges.length;e+=3){let s=this.ranges[e]-(this.inverted?n:0);if(s>t)break;let a=this.ranges[e+i];if(t<=s+a&&e==3*r)return!0;n+=this.ranges[e+o]-a}return!1}forEach(t){let e=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r<this.ranges.length;r+=3){let o=this.ranges[r],s=o-(this.inverted?i:0),a=o+(this.inverted?0:i),l=this.ranges[r+e],h=this.ranges[r+n];t(s,s+l,a,a+h),i+=h-l}}invert(){return new o(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return 0==t?o.empty:new o(t<0?[0,-t,0]:[0,0,t])}}o.empty=new o([]);class s{constructor(t=[],e,n=0,r=t.length){this.maps=t,this.mirror=e,this.from=n,this.to=r}slice(t=0,e=this.maps.length){return new s(this.maps,this.mirror,t,e)}copy(){return new s(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(t,e){this.to=this.maps.push(t),null!=e&&this.setMirror(this.maps.length-1,e)}appendMapping(t){for(let e=0,n=this.maps.length;e<t.maps.length;e++){let r=t.getMirror(e);this.appendMap(t.maps[e],null!=r&&r<e?n+r:void 0)}}getMirror(t){if(this.mirror){for(let e=0;e<this.mirror.length;e++)if(this.mirror[e]==t)return this.mirror[e+(e%2?-1:1)]}}setMirror(t,e){this.mirror||(this.mirror=[]),this.mirror.push(t,e)}appendMappingInverted(t){for(let e=t.maps.length-1,n=this.maps.length+t.maps.length;e>=0;e--){let r=t.getMirror(e);this.appendMap(t.maps[e].invert(),null!=r&&r>e?n-r-1:void 0)}}invert(){let t=new s;return t.appendMappingInverted(this),t}map(t,e=1){if(this.mirror)return this._map(t,e,!0);for(let n=this.from;n<this.to;n++)t=this.maps[n].map(t,e);return t}mapResult(t,e=1){return this._map(t,e,!1)}_map(t,e,n){let r=0;for(let n=this.from;n<this.to;n++){let i=this.maps[n].mapResult(t,e);if(null!=i.recover){let e=this.getMirror(n);if(null!=e&&e>n&&e<this.to){n=e,t=this.maps[e].recover(i.recover);continue}}r|=i.delInfo,t=i.pos}return n?t:new i(t,r,null)}}let a=Object.create(null);class l{getMap(){return o.empty}merge(t){return null}static fromJSON(t,e){if(!e||!e.stepType)throw RangeError("Invalid input for Step.fromJSON");let n=a[e.stepType];if(!n)throw RangeError(`No step type ${e.stepType} defined`);return n.fromJSON(t,e)}static jsonID(t,e){if(t in a)throw RangeError("Duplicate use of step JSON ID "+t);return a[t]=e,e.prototype.jsonID=t,e}}class h{constructor(t,e){this.doc=t,this.failed=e}static ok(t){return new h(t,null)}static fail(t){return new h(null,t)}
vendor: 7,230 bytes, line 6
6static fromReplace(t,e,n,i){try{return h.ok(t.replace(e,n,i))}catch(t){if(t instanceof r.e4)return h.fail(t.message);throw t}}}function c(t,e,n){let i=[];for(let r=0;r<t.childCount;r++){let o=t.child(r);o.content.size&&(o=o.copy(c(o.content,e,o))),o.isInline&&(o=e(o,n,r)),i.push(o)}return r.HY.fromArray(i)}class u extends l{constructor(t,e,n){super(),this.from=t,this.to=e,this.mark=n}apply(t){let e=t.slice(this.from,this.to),n=t.resolve(this.from),i=n.node(n.sharedDepth(this.to)),o=new r.p2(c(e.content,(t,e)=>t.isAtom&&e.type.allowsMarkType(this.mark.type)?t.mark(this.mark.addToSet(t.marks)):t,i),e.openStart,e.openEnd);return h.fromReplace(t,this.from,this.to,o)}invert(){return new p(this.from,this.to,this.mark)}map(t){let e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return e.deleted&&n.deleted||e.pos>=n.pos?null:new u(e.pos,n.pos,this.mark)}merge(t){return t instanceof u&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new u(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw RangeError("Invalid input for AddMarkStep.fromJSON");return new u(e.from,e.to,t.markFromJSON(e.mark))}}l.jsonID("addMark",u);class p extends l{constructor(t,e,n){super(),this.from=t,this.to=e,this.mark=n}apply(t){let e=t.slice(this.from,this.to),n=new r.p2(c(e.content,t=>t.mark(this.mark.removeFromSet(t.marks)),t),e.openStart,e.openEnd);return h.fromReplace(t,this.from,this.to,n)}invert(){return new u(this.from,this.to,this.mark)}map(t){let e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return e.deleted&&n.deleted||e.pos>=n.pos?null:new p(e.pos,n.pos,this.mark)}merge(t){return t instanceof p&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new p(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw RangeError("Invalid input for RemoveMarkStep.fromJSON");return new p(e.from,e.to,t.markFromJSON(e.mark))}}l.jsonID("removeMark",p);class f extends l{constructor(t,e){super(),this.pos=t,this.mark=e}apply(t){let e=t.nodeAt(this.pos);if(!e)return h.fail("No node at mark step's position");let n=e.type.create(e.attrs,null,this.mark.addToSet(e.marks));return h.fromReplace(t,this.pos,this.pos+1,new r.p2(r.HY.from(n),0,e.isLeaf?0:1))}invert(t){let e=t.nodeAt(this.pos);if(e){let t=this.mark.addToSet(e.marks);if(t.length==e.marks.length){for(let n=0;n<e.marks.length;n++)if(!e.marks[n].isInSet(t))return new f(this.pos,e.marks[n]);return new f(this.pos,this.mark)}}return new d(this.pos,this.mark)}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new f(e.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,e){if("number"!=typeof e.pos)throw RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new f(e.pos,t.markFromJSON(e.mark))}}l.jsonID("addNodeMark",f);class d extends l{constructor(t,e){super(),this.pos=t,this.mark=e}apply(t){let e=t.nodeAt(this.pos);if(!e)return h.fail("No node at mark step's position");let n=e.type.create(e.attrs,null,this.mark.removeFromSet(e.marks));return h.fromReplace(t,this.pos,this.pos+1,new r.p2(r.HY.from(n),0,e.isLeaf?0:1))}invert(t){let e=t.nodeAt(this.pos);return e&&this.mark.isInSet(e.marks)?new f(this.pos,this.mark):this}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new d(e.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,e){if("number"!=typeof e.pos)throw RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new d(e.pos,t.markFromJSON(e.mark))}}l.jsonID("removeNodeMark",d);class m extends l{constructor(t,e,n,r=!1){super(),this.from=t,this.to=e,this.slice=n,this.structure=r}apply(t){return this.structure&&y(t,this.from,this.to)?h.fail("Structure replace would overwrite content"):h.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new o([this.from,this.to-this.from,this.slice.size])}invert(t){return new m(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return e.deletedAcross&&n.deletedAcross?null:new m(e.pos,Math.max(e.pos,n.pos),this.slice)}merge(t){if(!(t instanceof m)||t.structure||this.structure)return null;if(this.from+this.slice.size!=t.from||this.slice.openEnd||t.slice.openStart){if(t.to!=this.from||this.slice.openStart||t.slice.openEnd)return null;{let e=this.slice.size+t.slice.size==0?r.p2.empty:new r.p2(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new m(t.from,this.to,e,this.structure)}}{let e=this.slice.size+t.slice.size==0?r.p2.empty:new r.p2(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new m(this.from,this.to+(t.to-t.from),e,this.structure)}}toJSON(){let t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw RangeError("Invalid input for ReplaceStep.fromJSON");return new m(e.from,e.to,r.p2.fromJSON(t,e.slice),!!e.structure)}}l.jsonID("replace",m);class v extends l{constructor(t,e,n,r,i,o,s=!1){super(),this.from=t,this.to=e,this.gapFrom=n,this.gapTo=r,this.slice=i,this.insert=o,this.structure=s}apply(t){if(this.structure&&(y(t,this.from,this.gapFrom)||y(t,this.gapTo,this.to)))return h.fail("Structure gap-replace would overwrite content");let e=t.slice(this.gapFrom,this.gapTo);if(e.openStart||e.openEnd)return h.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,e.content);return n?h.fromReplace(t,this.from,this.to,n):h.fail("Content does not fit in gap")}getMap(){return new o([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let e=this.gapTo-this.gapFrom;return new v(this.from,this.from+this.slice.size+e,this.from+this.insert,this.from+this.insert+e,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1),r=this.from==this.gapFrom?e.pos:t.map(this.gapFrom,-1),i=this.to==this.gapTo?n.pos:t.map(this.gapTo,1);return e.deletedAcross&&n.deletedAcross||r<e.pos||i>n.pos?null:new v(e.pos,n.pos,r,i,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to||"number"!=typeof e.gapFrom||"number"!=typeof e.gapTo||"number"!=typeof e.insert)throw RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new v(e.from,e.to,e.gapFrom,e.gapTo,r.p2.fromJSON(t,e.slice),e.insert,!!e.structure)}}function y(t,e,n){let r=t.resolve(e),i=n-e,o=r.depth;for(;i>0&&o>
60&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let t=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!t||t.isLeaf)return!0;t=t.firstChild,i--}}return!1}function g(t,e,n,i=n.contentMatch,o=!0){let s=t.doc.nodeAt(e),a=[],l=e+1;for(let e=0;e<s.childCount;e++){let h=s.child(e),c=l+h.nodeSize,u=i.matchType(h.type);if(u){i=u;for(let e=0;e<h.marks.length;e++)n.allowsMarkType(h.marks[e].type)||t.step(new p(l,c,h.marks[e]));if(o&&h.isText&&"pre"!=n.whitespace){let t,e=/\r?\n|\r/g,i;for(;t=e.exec(h.text);)i||(i=new r.p2(r.HY.from(n.schema.text(" ",n.allowedMarks(h.marks))),0,0)),a.push(new m(l+t.index,l+t.index+t[0].length,i))}}else a.push(new m(l,c,r.p2.empty));l=c}if(!i.validEnd){let e=i.fillBefore(r.HY.empty,!0);t.replace(l,l,new r.p2(e,0,0))}for(let e=a.length-1;e>=0;e--)t.step(a[e])}function k(t){let e=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let n=t.depth;;--n){let r=t.$from.node(n),i=t.$from.index(n),o=t.$to.indexAfter(n);if(n<t.depth&&r.canReplace(i,o,e))return n;if(0==n||r.type.spec.isolating||!((0==i||r.canReplace(i,r.childCount))&&(o==r.childCount||r.canReplace(0,o))))break}return null}function w(t,e,n=null,r=t){let i=function(t,e){let{parent:n,startIndex:r,endIndex:i}=t,o=n.contentMatchAt(r).findWrapping(e);if(!o)return null;let s=o.length?o[0]:e;return n.canReplaceWith(r,i,s)?o:null}(t,e),o=i&&function(t,e){let{parent:n,startIndex:r,endIndex:i}=t,o=n.child(r),s=e.contentMatch.findWrapping(o.type);if(!s)return null;let a=(s.length?s[s.length-1]:e).contentMatch;for(let t=r;a&&t<i;t++)a=a.matchType(n.child(t).type);return a&&a.validEnd?s:null}(r,e);return o?i.map(x).concat({type:e,attrs:n}).concat(o.map(x)):null}function x(t){return{type:t,attrs:null}}function S(t,e,n=1,r){let i=t.resolve(e),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(let t=i.depth-1,e=n-2;t>o;t--,e--){let n=i.node(t),o=i.index(t);if(n.type.spec.isolating)return!1;let s=n.content.cutByIndex(o,n.childCount),a=r&&r[e+1];a&&(s=s.replaceChild(0,a.type.create(a.attrs)));let l=r&&r[e]||n;if(!n.canReplace(o+1,n.childCount)||!l.type.validContent(s))return!1}let a=i.indexAfter(o),l=r&&r[0];return i.node(o).canReplaceWith(a,a,l?l.type:i.node(o+1).type)}function b(t,e){var n,r;let i=t.resolve(e),o=i.index();return n=i.nodeBefore,r=i.nodeAfter,!!(n&&r&&!n.isLeaf&&n.canAppend(r))&&i.parent.canReplace(o,o+1)}function M(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let i=n.content;for(let t=0;t<n.openStart;t++)i=i.firstChild.content;for(let t=1;t<=(0==n.openStart&&n.size?2:1);t++)for(let e=r.depth;e>=0;e--){let n=e==r.depth?0:r.pos<=(r.start(e+1)+r.end(e+1))/2?-1:1,o=r.index(e)+(n>0?1:0),s=r.node(e),a=!1;if(1==t)a=s.canReplace(o,o,i);else{let t=s.contentMatchAt(o).findWrapping(i.firstChild.type);a=t&&s.canReplaceWith(o,o,t[0])}if(a)return 0==n?r.pos:n<0?r.before(e+1):r.after(e+1)}return null}function O(t,e,n=e,i=r.p2.empty){if(e==n&&!i.size)return null;let o=t.resolve(e),s=t.resolve(n);return C(o,s,i)?new m(e,n,i):new E(o,s,i).fit()}function C(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}l.jsonID("replaceAround",v);class E{constructor(t,e,n){this.$from=t,this.$to=e,this.unplaced=n,this.frontier=[],this.placed=r.HY.empty;for(let e=0;e<=t.depth;e++){let n=t.node(e);this.frontier.push({type:n.type,match:n.contentMatchAt(t.indexAfter(e))})}for(let e=t.depth;e>0;e--)this.placed=r.HY.from(t.node(e).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let t=this.findFittable();t?this.placeNodes(t):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),e=this.placed.size-this.depth-this.$from.depth,n=this.$from,i=this.close(t<0?this.$to:n.doc.resolve(t));if(!i)return null;let o=this.placed,s=n.depth,a=i.depth;for(;s&&a&&1==o.childCount;)o=o.firstChild.content,s--,a--;let l=new r.p2(o,s,a);return t>-1?new v(n.pos,t,this.$to.pos,this.$to.end(),l,e):l.size||n.pos!=this.$to.pos?new m(n.pos,i.pos,l):null}findFittable(){let t=this.unplaced.openStart;for(let e=this.unplaced.content,n=0,r=this.unplaced.openEnd;n<t;n++){let i=e.firstChild;if(e.childCount>1&&(r=0),i.type.spec.isolating&&r<=n){t=n;break}e=i.content}for(let e=1;e<=2;e++)for(let n=1==e?t:this.unplaced.openStart;n>=0;n--){let t=null,i=(n?(t=N(this.unplaced.content,n-1).firstChild).content:this.unplaced.content).firstChild;for(let o=this.depth;o>=0;o--){let{type:s,match:a}=this.frontier[o],l,h=null;if(1==e&&(i?a.matchType(i.type)||(h=a.fillBefore(r.HY.from(i),!1)):t&&s.compatibleContent(t.type)))return{sliceDepth:n,frontierDepth:o,parent:t,inject:h};if(2==e&&i&&(l=a.findWrapping(i.type)))return{sliceDepth:n,frontierDepth:o,parent:t,wrap:l};
6if(t&&a.matchType(t.type))break}}}openMore(){let{content:t,openStart:e,openEnd:n}=this.unplaced,i=N(t,e);return!!i.childCount&&!i.firstChild.isLeaf&&(this.unplaced=new r.p2(t,e+1,Math.max(n,i.size+e>=t.size-n?e+1:0)),!0)}dropNode(){let{content:t,openStart:e,openEnd:n}=this.unplaced,i=N(t,e);if(i.childCount<=1&&e>0){let o=t.size-e<=e+i.size;this.unplaced=new r.p2(T(t,e-1,1),e-1,o?e-1:n)}else this.unplaced=new r.p2(T(t,e,1),e,n)}placeNodes({sliceDepth:t,frontierDepth:e,parent:n,inject:i,wrap:o}){for(;this.depth>e;)this.closeFrontierNode();if(o)for(let t=0;t<o.length;t++)this.openFrontierNode(o[t]);let s=this.unplaced,a=n?n.content:s.content,l=s.openStart-t,h=0,c=[],{match:u,type:p}=this.frontier[e];if(i){for(let t=0;t<i.childCount;t++)c.push(i.child(t));u=u.matchFragment(i)}let f=a.size+t-(s.content.size-s.openEnd);for(;h<a.childCount;){let t=a.child(h),e=u.matchType(t.type);if(!e)break;(++h>1||0==l||t.content.size)&&(u=e,c.push(function t(e,n,i){if(n<=0)return e;let o=e.content;return n>1&&(o=o.replaceChild(0,t(o.firstChild,n-1,1==o.childCount?i-1:0))),n>0&&(o=e.type.contentMatch.fillBefore(o).append(o),i<=0&&(o=o.append(e.type.contentMatch.matchFragment(o).fillBefore(r.HY.empty,!0)))),e.copy(o)}(t.mark(p.allowedMarks(t.marks)),1==h?l:0,h==a.childCount?f:-1)))}let d=h==a.childCount;d||(f=-1),this.placed=R(this.placed,e,r.HY.from(c)),this.frontier[e].match=u,d&&f<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let t=0,e=a;t<f;t++){let t=e.lastChild;this.frontier.push({type:t.type,match:t.contentMatchAt(t.childCount)}),e=t.content}this.unplaced=d?0==t?r.p2.empty:new r.p2(T(s.content,t-1,1),t-1,f<0?s.openEnd:t-1):new r.p2(T(s.content,t,h),s.openStart,s.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return -1;let t=this.frontier[this.depth],e;if(!t.type.isTextblock||!A(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;let{depth:n}=this.$to,r=this.$to.after(n);for(;n>1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(t){t:for(let e=Math.min(this.depth,t.depth);e>=0;e--){let{match:n,type:r}=this.frontier[e],i=e<t.depth&&t.end(e+1)==t.pos+(t.depth-(e+1)),o=A(t,e,r,n,i);if(o){for(let n=e-1;n>=0;n--){let{match:e,type:r}=this.frontier[n],i=A(t,n,r,e,!0);if(!i||i.childCount)continue t}return{depth:e,fit:o,move:i?t.doc.resolve(t.after(e+1)):t}}}}close(t){let e=this.findCloseLevel(t);if(!e)return null;for(;this.depth>e.depth;)this.closeFrontierNode();e.fit.childCount&&(this.placed=R(this.placed,e.depth,e.fit)),t=e.move;for(let n=e.depth+1;n<=t.depth;n++){let e=t.node(n),r=e.type.contentMatch.fillBefore(e.content,!0,t.index(n));this.openFrontierNode(e.type,e.attrs,r)}return t}openFrontierNode(t,e=null,n){let i=this.frontier[this.depth];i.match=i.match.matchType(t),this.placed=R(this.placed,this.depth,r.HY.from(t.create(e,n))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(r.HY.empty,!0);t.childCount&&(this.placed=R(this.placed,this.frontier.length,t))}}function T(t,e,n){return 0==e?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(T(t.firstChild.content,e-1,n)))}function R(t,e,n){return 0==e?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(R(t.lastChild.content,e-1,n)))}function N(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function A(t,e,n,r,i){let o=t.node(e),s=i?t.indexAfter(e):t.index(e);if(s==o.childCount&&!n.compatibleContent(o.type))return null;let a=r.fillBefore(o.content,!0,s);return a&&!function(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}(n,o.content,s)?a:null}function I(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let i=r;i>=0;i--){let r=t.start(i);if(r<t.pos-(t.depth-i)||e.end(i)>e.pos+(e.depth-i)||t.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(r==e.start(i)||i==t.depth&&i==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==r-1)&&n.push(i)}return n}class z extends l{constructor(t,e,n){super(),this.pos=t,this.attr=e,this.value=n}apply(t){let e=t.nodeAt(this.pos);if(!e)return h.fail("No node at attribute step's position");let n=Object.create(null);for(let t in e.attrs)n[t]=e.attrs[t];n[this.attr]=this.value;let i=e.type.create(n,null,e.marks);return h.fromReplace(t,this.pos,this.pos+1,new r.p2(r.HY.from(i),0,e.isLeaf?0:1))}getMap(){return o.empty}invert(t){return new z(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new z(e.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,e){if("number"!=typeof e.pos||"string"!=typeof e.attr)throw RangeError("Invalid input for AttrStep.fromJSON");return new z(e.pos,e.attr,e.value)}}l.jsonID("attr",z);class F extends l{constructor(t,e){super(),this.attr=t,this.value=e}apply(t){let e=Object.create(null);for(let n in t.attrs)e[n]=t.attrs[n];e[this.attr]=this.value;let n=t.type.create(e,t.content,t.marks);return h.ok(n)}getMap(){return o.empty}invert(t){return new F(this.attr,t.attrs[this.attr])}map(t){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,e){if("string"!=typeof e.attr)throw RangeError("Invalid input for DocAttrStep.fromJSON");return new F(e.attr,e.value)}}l.jsonID("docAttr",F);
6let J=class extends Error{};(J=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n}).prototype=Object.create(Error.prototype),J.prototype.constructor=J,J.prototype.name="TransformError";class ${constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new s}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let e=this.maybeStep(t);if(e.failed)throw new J(e.failed);return this}maybeStep(t){let e=t.apply(this.doc);return e.failed||this.addStep(t,e.doc),e}get docChanged(){return this.steps.length>0}addStep(t,e){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=e}replace(t,e=t,n=r.p2.empty){let i=O(this.doc,t,e,n);return i&&this.step(i),this}replaceWith(t,e,n){return this.replace(t,e,new r.p2(r.HY.from(n),0,0))}delete(t,e){return this.replace(t,e,r.p2.empty)}insert(t,e){return this.replaceWith(t,t,e)}replaceRange(t,e,n){return!function(t,e,n,i){if(!i.size)return t.deleteRange(e,n);let o=t.doc.resolve(e),s=t.doc.resolve(n);if(C(o,s,i))return t.step(new m(e,n,i));let a=I(o,t.doc.resolve(n));0==a[a.length-1]&&a.pop();let l=-(o.depth+1);a.unshift(l);for(let t=o.depth,e=o.pos-1;t>0;t--,e--){let n=o.node(t).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;a.indexOf(t)>-1?l=t:o.before(t)==e&&a.splice(1,0,-t)}let h=a.indexOf(l),c=[],u=i.openStart;for(let t=i.content,e=0;;e++){let n=t.firstChild;if(c.push(n),e==i.openStart)break;t=n.content}for(let t=u-1;t>=0;t--){var p;let e=c[t],n=(p=e.type).spec.defining||p.spec.definingForContent;if(n&&!e.sameMarkup(o.node(Math.abs(l)-1)))u=t;else if(n||!e.type.isTextblock)break}for(let e=i.openStart;e>=0;e--){let l=(e+u+1)%(i.openStart+1),p=c[l];if(p)for(let e=0;e<a.length;e++){let c=a[(e+h)%a.length],u=!0;c<0&&(u=!1,c=-c);let f=o.node(c-1),d=o.index(c-1);if(f.canReplaceWith(d,d,p.type,p.marks))return t.replace(o.before(c),u?s.after(c):n,new r.p2(function t(e,n,i,o,s){if(n<i){let r=e.firstChild;e=e.replaceChild(0,r.copy(t(r.content,n+1,i,o,r)))}if(n>o){let t=s.contentMatchAt(0),n=t.fillBefore(e).append(e);e=n.append(t.matchFragment(n).fillBefore(r.HY.empty,!0))}return e}(i.content,0,i.openStart,l),l,i.openEnd))}}let f=t.steps.length;for(let r=a.length-1;r>=0&&(t.replace(e,n,i),!(t.steps.length>f));r--){let t=a[r];t<0||(e=o.before(t),n=s.after(t))}}(this,t,e,n),this}replaceRangeWith(t,e,n){return!function(t,e,n,i){if(!i.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let r=function(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(0==r.parentOffset)for(let t=r.depth-1;t>=0;t--){let e=r.index(t);if(r.node(t).canReplaceWith(e,e,n))return r.before(t+1);if(e>0)return null}if(r.parentOffset==r.parent.content.size)for(let t=r.depth-1;t>=0;t--){let e=r.indexAfter(t);if(r.node(t).canReplaceWith(e,e,n))return r.after(t+1);if(e<r.node(t).childCount)break}return null}(t.doc,e,i.type);null!=r&&(e=n=r)}t.replaceRange(e,n,new r.p2(r.HY.from(i),0,0))}(this,t,e,n),this}deleteRange(t,e){return!function(t,e,n){let r=t.doc.resolve(e),i=t.doc.resolve(n),o=I(r,i);for(let e=0;e<o.length;e++){let n=o[e],s=e==o.length-1;if(s&&0==n||r.node(n).type.contentMatch.validEnd)return t.delete(r.start(n),i.end(n));if(n>0&&(s||r.node(n-1).canReplace(r.index(n-1),i.indexAfter(n-1))))return t.delete(r.before(n),i.after(n))}for(let o=1;o<=r.depth&&o<=i.depth;o++)if(e-r.start(o)==r.depth-o&&n>r.end(o)&&i.end(o)-n!=i.depth-o)return t.delete(r.before(o),n);t.delete(e,n)}(this,t,e),this}lift(t,e){return!function(t,e,n){let{$from:i,$to:o,depth:s}=e,a=i.before(s+1),l=o.after(s+1),h=a,c=l,u=r.HY.empty,p=0;for(let t=s,e=!1;t>n;t--)e||i.index(t)>0?(e=!0,u=r.HY.from(i.node(t).copy(u)),p++):h--;let f=r.HY.empty,d=0;for(let t=s,e=!1;t>n;t--)e||o.after(t+1)<o.end(t)?(e=!0,f=r.HY.from(o.node(t).copy(f)),d++):c++;t.step(new v(h,c,a,l,new r.p2(u.append(f),p,d),u.size-p,!0))}(this,t,e),this}join(t,e=1){return!function(t,e,n){let i=new m(e-n,e+n,r.p2.empty,!0);t.step(i)}(this,t,e),this}wrap(t,e){return!function(t,e,n){let i=r.HY.empty;for(let t=n.length-1;t>=0;t--){if(i.size){let e=n[t].type.contentMatch.matchFragment(i);if(!e||!e.validEnd)throw RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}i=r.HY.from(n[t].type.create(n[t].attrs,i))}let o=e.start,s=e.end;t.step(new v(o,s,o,s,new r.p2(i,0,0),n.length,!0))}(this,t,e),this}setBlockType(t,e=t,n,i=null){return!function(t,e,n,i,o){if(!i.isTextblock)throw RangeError("Type given to setBlockType should be a textblock");let s=t.steps.length;t.doc.nodesBetween(e,n,(e,n)=>{var a,l;let h,c,u="function"==typeof o?o(e):o;if(e.isTextblock&&!e.hasMarkup(i,u)&&(a=t.doc,l=t.mapping.slice(s).map(n),c=(h=a.resolve(l)).index(),h.parent.canReplaceWith(c,c+1,i))){let o=null;if(i.schema.linebreakReplacement){let t="pre"==i.whitespace,e=!!i.contentMatch.matchType(i.schema.linebreakReplacement);t&&!e?o=!1:!t&&e&&(o=!0)}!1===o&&function(t,e,n,r){e.forEach((i,o)=>
6{if(i.type==i.type.schema.linebreakReplacement){let i=t.mapping.slice(r).map(n+1+o);t.replaceWith(i,i+1,e.type.schema.text("\n"))}})}(t,e,n,s),g(t,t.mapping.slice(s).map(n,1),i,void 0,null===o);let a=t.mapping.slice(s),l=a.map(n,1),h=a.map(n+e.nodeSize,1);return t.step(new v(l,h,l+1,h-1,new r.p2(r.HY.from(i.create(u,null,e.marks)),0,0),1,!0)),!0===o&&function(t,e,n,r){e.forEach((i,o)=>{if(i.isText){let s,a=/\r?\n|\r/g;for(;s=a.exec(i.text);){let i=t.mapping.slice(r).map(n+1+o+s.index);t.replaceWith(i,i+1,e.type.schema.linebreakReplacement.create())}}})}(t,e,n,s),!1}})}(this,t,e,n,i),this}setNodeMarkup(t,e,n=null,i){return!function(t,e,n,i,o){let s=t.doc.nodeAt(e);if(!s)throw RangeError("No node at given position");n||(n=s.type);let a=n.create(i,null,o||s.marks);if(s.isLeaf)return t.replaceWith(e,e+s.nodeSize,a);if(!n.validContent(s.content))throw RangeError("Invalid content for node type "+n.name);t.step(new v(e,e+s.nodeSize,e+1,e+s.nodeSize-1,new r.p2(r.HY.from(a),0,0),1,!0))}(this,t,e,n,i),this}setNodeAttribute(t,e,n){return this.step(new z(t,e,n)),this}setDocAttribute(t,e){return this.step(new F(t,e)),this}addNodeMark(t,e){return this.step(new f(t,e)),this}removeNodeMark(t,e){if(!(e instanceof r.vc)){let n=this.doc.nodeAt(t);if(!n)throw RangeError("No node at position "+t);if(!(e=e.isInSet(n.marks)))return this}return this.step(new d(t,e)),this}split(t,e=1,n){return!function(t,e,n=1,i){let o=t.doc.resolve(e),s=r.HY.empty,a=r.HY.empty;for(let t=o.depth,e=o.depth-n,l=n-1;t>e;t--,l--){s=r.HY.from(o.node(t).copy(s));let e=i&&i[l];a=r.HY.from(e?e.type.create(e.attrs,a):o.node(t).copy(a))}t.step(new m(e,e,new r.p2(s.append(a),n,n),!0))}(this,t,e,n),this}addMark(t,e,n){var r;let i,o,s,a;return r=this,s=[],a=[],r.doc.nodesBetween(t,e,(r,l,h)=>{if(!r.isInline)return;let c=r.marks;if(!n.isInSet(c)&&h.type.allowsMarkType(n.type)){let h=Math.max(l,t),f=Math.min(l+r.nodeSize,e),d=n.addToSet(c);for(let t=0;t<c.length;t++)c[t].isInSet(d)||(i&&i.to==h&&i.mark.eq(c[t])?i.to=f:s.push(i=new p(h,f,c[t])));o&&o.to==h?o.to=f:a.push(o=new u(h,f,n))}}),s.forEach(t=>r.step(t)),a.forEach(t=>r.step(t)),this}removeMark(t,e,n){var i;let o,s;return i=this,o=[],s=0,i.doc.nodesBetween(t,e,(i,a)=>{if(!i.isInline)return;s++;let l=null;if(n instanceof r.ZU){let t=i.marks,e;for(;e=n.isInSet(t);)(l||(l=[])).push(e),t=e.removeFromSet(t)}else n?n.isInSet(i.marks)&&(l=[n]):l=i.marks;if(l&&l.length){let n=Math.min(a+i.nodeSize,e);for(let e=0;e<l.length;e++){let r=l[e],i;for(let t=0;t<o.length;t++){let e=o[t];e.step==s-1&&r.eq(o[t].style)&&(i=e)}i?(i.to=n,i.step=s):o.push({style:r,from:Math.max(a,t),to:n,step:s})}}}),o.forEach(t=>i.step(new p(t.from,t.to,t.style))),this}clearIncompatible(t,e,n){return g(this,t,e,n),this}}}}]);
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.