@progress/kendo-editor-common 1.9.0-dev.202204181536 → 1.9.0-dev.202204190918
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/js/kendo-editor-common.js +1 -1
- package/dist/cdn/main.js +1 -1
- package/dist/es/plugins/table-resize/column-resize.js +8 -8
- package/dist/es/plugins/table-resize/row-resize.js +4 -1
- package/dist/es/plugins/table-resize/table-resize.js +1 -0
- package/dist/es2015/plugins/table-resize/column-resize.js +8 -8
- package/dist/es2015/plugins/table-resize/row-resize.js +4 -1
- package/dist/es2015/plugins/table-resize/table-resize.js +2 -1
- package/dist/npm/plugins/table-resize/column-resize.js +8 -8
- package/dist/npm/plugins/table-resize/row-resize.js +4 -1
- package/dist/npm/plugins/table-resize/table-resize.js +1 -0
- package/dist/systemjs/kendo-editor-common.js +1 -1
- package/package.json +1 -1
|
@@ -13,4 +13,4 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
13
13
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
14
|
PERFORMANCE OF THIS SOFTWARE.
|
|
15
15
|
***************************************************************************** */
|
|
16
|
-
var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function o(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var i=function(){return(i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function s(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function a(e,t,n,r){var o,i=arguments.length,s=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(i<3?o(s):i>3?o(t,n,s):o(t,n))||s);return i>3&&s&&Object.defineProperty(t,n,s),s}function l(e,t){return function(n,r){t(n,r,e)}}function c(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function u(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{l(r.next(e))}catch(e){i(e)}}function a(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))}function d(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}function p(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}function f(e,t){for(var n in e)"default"===n||t.hasOwnProperty(n)||(t[n]=e[n])}function h(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function m(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return s}function v(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(m(arguments[t]));return e}function g(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),o=0;for(t=0;t<n;t++)for(var i=arguments[t],s=0,a=i.length;s<a;s++,o++)r[o]=i[s];return r}function y(e){return this instanceof y?(this.v=e,this):new y(e)}function w(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,o=n.apply(e,t||[]),i=[];return r={},s("next"),s("throw"),s("return"),r[Symbol.asyncIterator]=function(){return this},r;function s(e){o[e]&&(r[e]=function(t){return new Promise((function(n,r){i.push([e,t,n,r])>1||a(e,t)}))})}function a(e,t){try{(n=o[e](t)).value instanceof y?Promise.resolve(n.value.v).then(l,c):u(i[0][2],n)}catch(e){u(i[0][3],e)}var n}function l(e){a("next",e)}function c(e){a("throw",e)}function u(e,t){e(t),i.shift(),i.length&&a(i[0][0],i[0][1])}}function b(e){var t,n;return t={},r("next"),r("throw",(function(e){throw e})),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,o){t[r]=e[r]?function(t){return(n=!n)?{value:y(e[r](t)),done:"return"===r}:o?o(t):t}:o}}function S(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=h(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,o){(function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,o,(t=e[n](t)).done,t.value)}))}}}function k(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function x(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function C(e){return e&&e.__esModule?e:{default:e}}function M(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}function O(e,t,n){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,n),n}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(13);t.changeStylesString=function(e,t){var n=t.style,r=t.value,o=t.newValue;if(!e)return{changed:!1,style:null};var i=e.split(/\s*;\s*/).filter((function(e){return Boolean(e)})),s=i.filter((function(e){var t=e.split(/\s*:\s*/);return!(t[0].toLowerCase()===n&&r.test(t[1]))}));return o&&s.push(n+": "+o),{style:s.join("; ")+(s.length?";":""),changed:Boolean(o)||s.length!==i.length}},t.canInsert=function(e,t){for(var n=e.selection.$from,r=n.depth;r>=0;r--){var o=n.index(r);if(n.node(r).canReplaceWith(o,o,t))return!0}return!1};var s=function(e){return e instanceof r.Node?e.type.name:e.name};t.findNthParentNodeOfType=function(e,t){return void 0===t&&(t=1),function(n){return function(e,t){return void 0===t&&(t=1),function(n){for(var r=n.$from,o=r.depth;o>0;o--){var i=r.node(o);if(e(i)&&0===(t-=1))return{depth:o,node:i}}}}((function(t){return s(t)===s(e)}),t)(n)}},t.insertNode=function(e,t){return function(n,r){var o=n.tr.replaceSelectionWith(e);t&&o.scrollIntoView(),r(o)}},t.hasSameMarkup=function(e,t,n,o){var s=r.Fragment.from(i.parseContent(e,n,o)),a=r.Fragment.from(i.parseContent(t,n,o));return s.eq(a)},t.getSelectionText=function(e){var t=e.selection;if(t instanceof o.TextSelection||t instanceof o.AllSelection){var n=t.content().content;return n.textBetween(0,n.size)}return""},t.getNodeFromSelection=function(e){if(e.selection instanceof o.NodeSelection)return e.selection.node},t.selectedLineTextOnly=function(e){var n="",r=!1,o=e.selection,i=e.doc,s=o.$from,a=o.$to,l=o.from,c=o.to;return s.sameParent(a)&&(i.nodesBetween(l,c,(function(e){r=r||e.isLeaf&&!e.isText})),r||(n=t.getSelectionText(e))),n},t.indentHtml=function(e){return e.replace(/<\/(p|li|ul|ol|h[1-6]|table|tr|td|th)>/gi,"</$1>\n").replace(/<(ul|ol)([^>]*)><li/gi,"<$1$2>\n<li").replace(/<br \/>/gi,"<br />\n").replace(/\n$/,"")},t.shallowEqual=function(e,t){var n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every((function(n){return e[n]===t[n]}))};var a={before:/[^ !,?.\[\]{}()]+$/i,after:/^[^ !,?.\[\]{}()]+/i};t.expandSelection=function(e,t,n){if(!n.applyToWord||!e.selection.empty)return{state:e,dispatch:t};var r=!0===n.applyToWord?a:n.applyToWord,i=null,s=e.tr,l=e.selection,c=l.$head.nodeBefore,u=l.$head.nodeAfter;if(c&&"text"===c.type.name&&c.text&&u&&"text"===u.type.name&&u.text){var d=[];l.$head.parent.descendants((function(e,t){return d.push({node:e,pos:t}),!1}));for(var p=l.$head.parentOffset,f=d.findIndex((function(e){var t=e.node,n=e.pos;return n<=p&&n+t.nodeSize>=p})),h=d[f].node.text,m=!1,v=f-1;v>=0;v--){var g=d[v];!m&&g&&"text"===g.node.type.name?h=g.node.text+h:(m=!0,p-=g.node.nodeSize)}for(v=f+1;v<d.length;v++){if(!(g=d[v])||"text"!==g.node.type.name)break;h+=g.node.text}var y=h.substring(0,p),w=h.substring(p),b=r.before.exec(y),S=r.after.exec(w);if(b&&S){var k=b[0].length,x=S[0].length,C=i=l.from;s.setSelection(o.TextSelection.create(e.doc,C-k,C+x));return{state:{tr:s,selection:s.selection,doc:s.doc,storedMarks:null,schema:s.doc.type.schema},dispatch:function(e){e.setSelection(o.TextSelection.create(e.doc,i)),t(e)}}}}return{state:e,dispatch:t}},t.expandToWordWrap=function(e,n){return function(r,o,i){var s=t.expandSelection(r,o,n),a=s.state,l=s.dispatch;return e(n)(a,l)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.rowTypeAttr="k-parent-node",t.colgroupAttr="k-colgroup-data",t.resizableAttr="k-resizable-node",t.resizableWrap="k-editor-resize-wrap-element",t.resizeHandle="k-editor-resize-handle",t.dataResizeDirTable="data-dir-table-resize",t.dataResizeDirImage="data-dir-image-resize"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2),o=n(0);t.markApplies=function(e,t,n){for(var r=function(r){var o=t[r],i=o.$from,s=o.$to,a=0===i.depth&&e.type.allowsMarkType(n);if(e.nodesBetween(i.pos,s.pos,(function(e){if(a)return!1;a=e.inlineContent&&e.type.allowsMarkType(n)})),a)return{v:!0}},o=0;o<t.length;o++){var i=r(o);if(i)return i.v}return!1},t.toggleMark=function(e,n,r){return function(o,i){var s=o.selection,a=s.empty,l=s.$cursor,c=s.ranges;if(a&&!l||!t.markApplies(o.doc,c,e))return!1;if(i)if(l)e.isInSet(o.storedMarks||l.marks())?i(r.removeStoredMark(e)):i(r.addStoredMark(e.create(n)));else{for(var u=!1,d=0;!u&&d<c.length;d++){var p=c[d],f=p.$from,h=p.$to;u=o.doc.rangeHasMark(f.pos,h.pos,e)}for(d=0;d<c.length;d++){var m=c[d];f=m.$from,h=m.$to;u?r.removeMark(f.pos,h.pos,e):r.addMark(f.pos,h.pos,e.create(n))}i(r.scrollIntoView())}return!0}},t.removeMark=function(e,t,n,i){void 0===i&&(i=null);var s=[],a=0;return e.doc.nodesBetween(t,n,(function(e,r){if(e.isInline){a++;var l=null;if(i instanceof o.MarkType){var c=i.isInSet(e.marks);c&&(l=[c])}else i?i.isInSet(e.marks)&&(l=[i]):l=e.marks;if(l&&l.length)for(var u=Math.min(r+e.nodeSize,n),d=0;d<l.length;d++){for(var p=l[d],f=void 0,h=0;h<s.length;h++){var m=s[h];m.step===a-1&&p.eq(m.style)&&(f=m)}f?(f.to=u,f.step=a):s.push({style:p,from:Math.max(r,t),to:u,step:a})}}})),s.forEach((function(t){return e.step(new r.RemoveMarkStep(t.from,t.to,t.style))})),e},t.removeMarks=function(e,n,r,o){var i=n.selection,s=i.$cursor,a=i.ranges;if(o=o||n.tr,s)e.forEach((function(e){e.isInSet(n.storedMarks||s.marks())&&r(o.removeStoredMark(e))}));else{for(var l=function(n){var r=a[n],i=r.$from,s=r.$to;e.forEach((function(e){t.removeMark(o,i.pos,s.pos,e)}))},c=0;c<a.length;c++)l(c);r(o.scrollIntoView())}return!0};t.removeAllMarks=function(e){var n=(void 0===e?{}:e).except,r=void 0===n?[]:n;return function(e,n){var o,i=e.tr;t.cleanMarks(i,{except:(o=r,o instanceof Array?o:[o])}),i.docChanged&&n(i)}},t.cleanMarks=function(e,t){var n=t.except,r=e.doc,o=e.selection,i=r.type.schema,s=o.empty,a=o.ranges,l=(n||[]).map((function(e){return e.name}));if(!s){var c=Object.keys(i.marks).map((function(e){return i.marks[e]})).filter((function(e){return-1===l.indexOf(e.name)}));a.forEach((function(t){var n=t.$from,r=t.$to;c.forEach((function(t){return e.removeMark(n.pos,r.pos,t)}))}))}},t.hasMark=function(e,n){var r,o=e.schema.marks,i=(n.altMarks||[]).filter((function(e){return o[e]})),s=n.altStyle,a=e.selection,l=a.from,c=a.$from,u=a.to,d=a.empty,p=o[n.mark],f=e.doc,h=!1;return d?(r=e.storedMarks||c.marks(),h=p&&p.isInSet(r)||i.some((function(e){return o[e].isInSet(r)}))):h=p&&f.rangeHasMark(l,u,p)||i.some((function(e){return f.rangeHasMark(l,u,o[e])})),!h&&s&&o.style?t.selectionMarks(e,o.style).some((function(e){return null!==t.styleValue(e,s)})):Boolean(h)},t.styleValue=function(e,t){for(var n=(e&&e.attrs.style||"").split(/\s*;\s*/).filter((function(e){return Boolean(e)})),r=0;r<n.length;r++){var o=n[r].split(/\s*:\s*/);if(o[0].toLowerCase()===t.name&&t.value.test(o[1]))return o[1]}return null},t.selectionMarks=function(e,t){var n=e.selection,r=n.from,o=n.$from,i=n.to,s=n.empty,a=[];return s?a.push(t.isInSet(e.storedMarks||o.marks())):e.doc.nodesBetween(r,i,(function(e){e.isInline&&a.push(t.isInSet(e.marks))})),a},t.getMark=function(e,n){var r=t.selectionMarks(e,n),o=r.filter((function(e){return Boolean(e)}));return r.length===o.length?r[0]:void 0},t.getActiveMarks=function(e,n){var r=t.selectionMarks(e,n),o=r.filter((function(e){return Boolean(e)}));return{hasNodesWithoutMarks:r.length!==o.length,marks:o}}},function(e,t,n){"use strict";n.r(t),n.d(t,"CellSelection",(function(){return _})),n.d(t,"TableMap",(function(){return h})),n.d(t,"TableView",(function(){return Oe})),n.d(t,"__clipCells",(function(){return B})),n.d(t,"__insertCells",(function(){return j})),n.d(t,"__pastedCells",(function(){return $})),n.d(t,"addColSpan",(function(){return E})),n.d(t,"addColumn",(function(){return re})),n.d(t,"addColumnAfter",(function(){return ie})),n.d(t,"addColumnBefore",(function(){return oe})),n.d(t,"addRow",(function(){return ce})),n.d(t,"addRowAfter",(function(){return de})),n.d(t,"addRowBefore",(function(){return ue})),n.d(t,"cellAround",(function(){return S})),n.d(t,"colCount",(function(){return A})),n.d(t,"columnIsHeader",(function(){return z})),n.d(t,"columnResizing",(function(){return Ne})),n.d(t,"columnResizingPluginKey",(function(){return Ae})),n.d(t,"deleteColumn",(function(){return ae})),n.d(t,"deleteRow",(function(){return fe})),n.d(t,"deleteTable",(function(){return Me})),n.d(t,"findCell",(function(){return T})),n.d(t,"fixTables",(function(){return te})),n.d(t,"fixTablesKey",(function(){return ee})),n.d(t,"goToNextCell",(function(){return Ce})),n.d(t,"handlePaste",(function(){return U})),n.d(t,"inSameTable",(function(){return O})),n.d(t,"isInTable",(function(){return k})),n.d(t,"mergeCells",(function(){return me})),n.d(t,"moveCellForward",(function(){return M})),n.d(t,"nextCell",(function(){return N})),n.d(t,"pointsAtCell",(function(){return C})),n.d(t,"removeColSpan",(function(){return D})),n.d(t,"removeColumn",(function(){return se})),n.d(t,"removeRow",(function(){return pe})),n.d(t,"rowIsHeader",(function(){return le})),n.d(t,"selectedRect",(function(){return ne})),n.d(t,"selectionCell",(function(){return x})),n.d(t,"setAttr",(function(){return R})),n.d(t,"setCellAttr",(function(){return ye})),n.d(t,"splitCell",(function(){return ve})),n.d(t,"splitCellWithType",(function(){return ge})),n.d(t,"tableEditing",(function(){return Ie})),n.d(t,"tableEditingKey",(function(){return b})),n.d(t,"tableNodeTypes",(function(){return w})),n.d(t,"tableNodes",(function(){return y})),n.d(t,"toggleHeader",(function(){return be})),n.d(t,"toggleHeaderCell",(function(){return xe})),n.d(t,"toggleHeaderColumn",(function(){return ke})),n.d(t,"toggleHeaderRow",(function(){return Se})),n.d(t,"updateColumnsOnResize",(function(){return Te}));var r,o,i=n(1),s=n(0),a=n(9),l=n(3),c=n(2);if("undefined"!=typeof WeakMap){var u=new WeakMap;r=function(e){return u.get(e)},o=function(e,t){return u.set(e,t),t}}else{var d=[],p=0;r=function(e){for(var t=0;t<d.length;t+=2)if(d[t]==e)return d[t+1]},o=function(e,t){return 10==p&&(p=0),d[p++]=e,d[p++]=t}}var f=function(e,t,n,r){this.left=e,this.top=t,this.right=n,this.bottom=r},h=function(e,t,n,r){this.width=e,this.height=t,this.map=n,this.problems=r};function m(e){if(e.colwidth)return e.colwidth.slice();for(var t=[],n=0;n<e.colspan;n++)t.push(0);return t}function v(e,t){var n=e.getAttribute("data-colwidth"),r=n&&/^\d+(,\d+)*$/.test(n)?n.split(",").map((function(e){return Number(e)})):null,o=Number(e.getAttribute("colspan")||1),i={colspan:o,rowspan:Number(e.getAttribute("rowspan")||1),colwidth:r&&r.length==o?r:null};for(var s in t){var a=t[s].getFromDOM,l=a&&a(e);null!=l&&(i[s]=l)}return i}function g(e,t){var n={};for(var r in 1!=e.attrs.colspan&&(n.colspan=e.attrs.colspan),1!=e.attrs.rowspan&&(n.rowspan=e.attrs.rowspan),e.attrs.colwidth&&(n["data-colwidth"]=e.attrs.colwidth.join(",")),t){var o=t[r].setDOMAttr;o&&o(e.attrs[r],n)}return n}function y(e){var t=e.cellAttributes||{},n={colspan:{default:1},rowspan:{default:1},colwidth:{default:null}};for(var r in t)n[r]={default:t[r].default};return{table:{content:"table_row+",tableRole:"table",isolating:!0,group:e.tableGroup,parseDOM:[{tag:"table"}],toDOM:function(){return["table",["tbody",0]]}},table_row:{content:"(table_cell | table_header)*",tableRole:"row",parseDOM:[{tag:"tr"}],toDOM:function(){return["tr",0]}},table_cell:{content:e.cellContent,attrs:n,tableRole:"cell",isolating:!0,parseDOM:[{tag:"td",getAttrs:function(e){return v(e,t)}}],toDOM:function(e){return["td",g(e,t),0]}},table_header:{content:e.cellContent,attrs:n,tableRole:"header_cell",isolating:!0,parseDOM:[{tag:"th",getAttrs:function(e){return v(e,t)}}],toDOM:function(e){return["th",g(e,t),0]}}}}function w(e){var t=e.cached.tableNodeTypes;if(!t)for(var n in t=e.cached.tableNodeTypes={},e.nodes){var r=e.nodes[n],o=r.spec.tableRole;o&&(t[o]=r)}return t}h.prototype.findCell=function(e){for(var t=0;t<this.map.length;t++){var n=this.map[t];if(n==e){for(var r=t%this.width,o=t/this.width|0,i=r+1,s=o+1,a=1;i<this.width&&this.map[t+a]==n;a++)i++;for(var l=1;s<this.height&&this.map[t+this.width*l]==n;l++)s++;return new f(r,o,i,s)}}throw new RangeError("No cell with offset "+e+" found")},h.prototype.colCount=function(e){for(var t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw new RangeError("No cell with offset "+e+" found")},h.prototype.nextCell=function(e,t,n){var r=this.findCell(e),o=r.left,i=r.right,s=r.top,a=r.bottom;return"horiz"==t?(n<0?0==o:i==this.width)?null:this.map[s*this.width+(n<0?o-1:i)]:(n<0?0==s:a==this.height)?null:this.map[o+this.width*(n<0?s-1:a)]},h.prototype.rectBetween=function(e,t){var n=this.findCell(e),r=n.left,o=n.right,i=n.top,s=n.bottom,a=this.findCell(t),l=a.left,c=a.right,u=a.top,d=a.bottom;return new f(Math.min(r,l),Math.min(i,u),Math.max(o,c),Math.max(s,d))},h.prototype.cellsInRect=function(e){for(var t=[],n={},r=e.top;r<e.bottom;r++)for(var o=e.left;o<e.right;o++){var i=r*this.width+o,s=this.map[i];n[s]||(n[s]=!0,o==e.left&&o&&this.map[i-1]==s||r==e.top&&r&&this.map[i-this.width]==s||t.push(s))}return t},h.prototype.positionAt=function(e,t,n){for(var r=0,o=0;;r++){var i=o+n.child(r).nodeSize;if(r==e){for(var s=t+e*this.width,a=(e+1)*this.width;s<a&&this.map[s]<o;)s++;return s==a?i-1:this.map[s]}o=i}},h.get=function(e){return r(e)||o(e,function(e){if("table"!=e.type.spec.tableRole)throw new RangeError("Not a table node: "+e.type.name);for(var t=function(e){for(var t=-1,n=!1,r=0;r<e.childCount;r++){var o=e.child(r),i=0;if(n)for(var s=0;s<r;s++)for(var a=e.child(s),l=0;l<a.childCount;l++){var c=a.child(l);s+c.attrs.rowspan>r&&(i+=c.attrs.colspan)}for(var u=0;u<o.childCount;u++){var d=o.child(u);i+=d.attrs.colspan,d.attrs.rowspan>1&&(n=!0)}-1==t?t=i:t!=i&&(t=Math.max(t,i))}return t}(e),n=e.childCount,r=[],o=0,i=null,s=[],a=0,l=t*n;a<l;a++)r[a]=0;for(var c=0,u=0;c<n;c++){var d=e.child(c);u++;for(var p=0;;p++){for(;o<r.length&&0!=r[o];)o++;if(p==d.childCount)break;for(var f=d.child(p),v=f.attrs,g=v.colspan,y=v.rowspan,w=v.colwidth,b=0;b<y;b++){if(b+c>=n){(i||(i=[])).push({type:"overlong_rowspan",pos:u,n:y-b});break}for(var S=o+b*t,k=0;k<g;k++){0==r[S+k]?r[S+k]=u:(i||(i=[])).push({type:"collision",row:c,pos:u,n:g-k});var x=w&&w[k];if(x){var C=(S+k)%t*2,M=s[C];null==M||M!=x&&1==s[C+1]?(s[C]=x,s[C+1]=1):M==x&&s[C+1]++}}}o+=g,u+=f.nodeSize}for(var O=(c+1)*t,T=0;o<O;)0==r[o++]&&T++;T&&(i||(i=[])).push({type:"missing",row:c,n:T}),u++}for(var A=new h(t,n,r,i),N=!1,R=0;!N&&R<s.length;R+=2)null!=s[R]&&s[R+1]<n&&(N=!0);N&&function(e,t,n){e.problems||(e.problems=[]);for(var r=0,o={};r<e.map.length;r++){var i=e.map[r];if(!o[i]){o[i]=!0;for(var s=n.nodeAt(i),a=null,l=0;l<s.attrs.colspan;l++){var c=(r+l)%e.width,u=t[2*c];null==u||s.attrs.colwidth&&s.attrs.colwidth[l]==u||((a||(a=m(s.attrs)))[l]=u)}a&&e.problems.unshift({type:"colwidth mismatch",pos:i,colwidth:a})}}}(A,s,e);return A}(e))};var b=new i.PluginKey("selectingCells");function S(e){for(var t=e.depth-1;t>0;t--)if("row"==e.node(t).type.spec.tableRole)return e.node(0).resolve(e.before(t+1));return null}function k(e){for(var t=e.selection.$head,n=t.depth;n>0;n--)if("row"==t.node(n).type.spec.tableRole)return!0;return!1}function x(e){var t=e.selection;return t.$anchorCell?t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell:t.node&&"cell"==t.node.type.spec.tableRole?t.$anchor:S(t.$head)||function(e){for(var t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){var r=t.type.spec.tableRole;if("cell"==r||"header_cell"==r)return e.doc.resolve(n)}for(var o=e.nodeBefore,i=e.pos;o;o=o.lastChild,i--){var s=o.type.spec.tableRole;if("cell"==s||"header_cell"==s)return e.doc.resolve(i-o.nodeSize)}}(t.$head)}function C(e){return"row"==e.parent.type.spec.tableRole&&e.nodeAfter}function M(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function O(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function T(e){return h.get(e.node(-1)).findCell(e.pos-e.start(-1))}function A(e){return h.get(e.node(-1)).colCount(e.pos-e.start(-1))}function N(e,t,n){var r=e.start(-1),o=h.get(e.node(-1)).nextCell(e.pos-r,t,n);return null==o?null:e.node(0).resolve(r+o)}function R(e,t,n){var r={};for(var o in e)r[o]=e[o];return r[t]=n,r}function D(e,t,n){void 0===n&&(n=1);var r=R(e,"colspan",e.colspan-n);return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(t,n),r.colwidth.some((function(e){return e>0}))||(r.colwidth=null)),r}function E(e,t,n){void 0===n&&(n=1);var r=R(e,"colspan",e.colspan+n);if(r.colwidth){r.colwidth=r.colwidth.slice();for(var o=0;o<n;o++)r.colwidth.splice(t,0,0)}return r}function z(e,t,n){for(var r=w(t.type.schema).header_cell,o=0;o<e.height;o++)if(t.nodeAt(e.map[n+o*e.width]).type!=r)return!1;return!0}var _=function(e){function t(t,n){void 0===n&&(n=t);var r=t.node(-1),o=h.get(r),s=t.start(-1),a=o.rectBetween(t.pos-s,n.pos-s),l=t.node(0),c=o.cellsInRect(a).filter((function(e){return e!=n.pos-s}));c.unshift(n.pos-s);var u=c.map((function(e){var t=r.nodeAt(e),n=e+s+1;return new i.SelectionRange(l.resolve(n),l.resolve(n+t.content.size))}));e.call(this,u[0].$from,u[0].$to,u),this.$anchorCell=t,this.$headCell=n}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.map=function(e,n){var r=e.resolve(n.map(this.$anchorCell.pos)),o=e.resolve(n.map(this.$headCell.pos));if(C(r)&&C(o)&&O(r,o)){var s=this.$anchorCell.node(-1)!=r.node(-1);return s&&this.isRowSelection()?t.rowSelection(r,o):s&&this.isColSelection()?t.colSelection(r,o):new t(r,o)}return i.TextSelection.between(r,o)},t.prototype.content=function(){for(var e=this.$anchorCell.node(-1),t=h.get(e),n=this.$anchorCell.start(-1),r=t.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),o={},i=[],a=r.top;a<r.bottom;a++){for(var l=[],c=a*t.width+r.left,u=r.left;u<r.right;u++,c++){var d=t.map[c];if(!o[d]){o[d]=!0;var p=t.findCell(d),f=e.nodeAt(d),m=r.left-p.left,v=p.right-r.right;if(m>0||v>0){var g=f.attrs;m>0&&(g=D(g,0,m)),v>0&&(g=D(g,g.colspan-v,v)),f=p.left<r.left?f.type.createAndFill(g):f.type.create(g,f.content)}if(p.top<r.top||p.bottom>r.bottom){var y=R(f.attrs,"rowspan",Math.min(p.bottom,r.bottom)-Math.max(p.top,r.top));f=p.top<r.top?f.type.createAndFill(y):f.type.create(y,f.content)}l.push(f)}}i.push(e.child(a).copy(s.Fragment.from(l)))}var w=this.isColSelection()&&this.isRowSelection()?e:i;return new s.Slice(s.Fragment.from(w),1,1)},t.prototype.replace=function(t,n){void 0===n&&(n=s.Slice.empty);for(var r=t.steps.length,o=this.ranges,i=0;i<o.length;i++){var a=o[i],l=a.$from,c=a.$to,u=t.mapping.slice(r);t.replace(u.map(l.pos),u.map(c.pos),i?s.Slice.empty:n)}var d=e.findFrom(t.doc.resolve(t.mapping.slice(r).map(this.to)),-1);d&&t.setSelection(d)},t.prototype.replaceWith=function(e,t){this.replace(e,new s.Slice(s.Fragment.from(t),0,0))},t.prototype.forEachCell=function(e){for(var t=this.$anchorCell.node(-1),n=h.get(t),r=this.$anchorCell.start(-1),o=n.cellsInRect(n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r)),i=0;i<o.length;i++)e(t.nodeAt(o[i]),r+o[i])},t.prototype.isColSelection=function(){var e=this.$anchorCell.index(-1),t=this.$headCell.index(-1);if(Math.min(e,t)>0)return!1;var n=e+this.$anchorCell.nodeAfter.attrs.rowspan,r=t+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,r)==this.$headCell.node(-1).childCount},t.colSelection=function(e,n){void 0===n&&(n=e);var r=h.get(e.node(-1)),o=e.start(-1),i=r.findCell(e.pos-o),s=r.findCell(n.pos-o),a=e.node(0);return i.top<=s.top?(i.top>0&&(e=a.resolve(o+r.map[i.left])),s.bottom<r.height&&(n=a.resolve(o+r.map[r.width*(r.height-1)+s.right-1]))):(s.top>0&&(n=a.resolve(o+r.map[s.left])),i.bottom<r.height&&(e=a.resolve(o+r.map[r.width*(r.height-1)+i.right-1]))),new t(e,n)},t.prototype.isRowSelection=function(){var e=h.get(this.$anchorCell.node(-1)),t=this.$anchorCell.start(-1),n=e.colCount(this.$anchorCell.pos-t),r=e.colCount(this.$headCell.pos-t);if(Math.min(n,r)>0)return!1;var o=n+this.$anchorCell.nodeAfter.attrs.colspan,i=r+this.$headCell.nodeAfter.attrs.colspan;return Math.max(o,i)==e.width},t.prototype.eq=function(e){return e instanceof t&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos},t.rowSelection=function(e,n){void 0===n&&(n=e);var r=h.get(e.node(-1)),o=e.start(-1),i=r.findCell(e.pos-o),s=r.findCell(n.pos-o),a=e.node(0);return i.left<=s.left?(i.left>0&&(e=a.resolve(o+r.map[i.top*r.width])),s.right<r.width&&(n=a.resolve(o+r.map[r.width*(s.top+1)-1]))):(s.left>0&&(n=a.resolve(o+r.map[s.top*r.width])),i.right<r.width&&(e=a.resolve(o+r.map[r.width*(i.top+1)-1]))),new t(e,n)},t.prototype.toJSON=function(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}},t.fromJSON=function(e,n){return new t(e.resolve(n.anchor),e.resolve(n.head))},t.create=function(e,n,r){return void 0===r&&(r=n),new t(e.resolve(n),e.resolve(r))},t.prototype.getBookmark=function(){return new I(this.$anchorCell.pos,this.$headCell.pos)},t}(i.Selection);_.prototype.visible=!1,i.Selection.jsonID("cell",_);var I=function(e,t){this.anchor=e,this.head=t};function P(e){if(!(e.selection instanceof _))return null;var t=[];return e.selection.forEachCell((function(e,n){t.push(l.Decoration.node(n,n+e.nodeSize,{class:"selectedCell"}))})),l.DecorationSet.create(e.doc,t)}function $(e){if(!e.size)return null;for(var t=e.content,n=e.openStart,r=e.openEnd;1==t.childCount&&(n>0&&r>0||"table"==t.firstChild.type.spec.tableRole);)n--,r--,t=t.firstChild.content;var o=t.firstChild,i=o.type.spec.tableRole,a=o.type.schema,l=[];if("row"==i)for(var c=0;c<t.childCount;c++){var u=t.child(c).content,d=c?0:Math.max(0,n-1),p=c<t.childCount-1?0:Math.max(0,r-1);(d||p)&&(u=F(w(a).row,new s.Slice(u,d,p)).content),l.push(u)}else{if("cell"!=i&&"header_cell"!=i)return null;l.push(n||r?F(w(a).row,new s.Slice(t,n,r)).content:t)}return function(e,t){for(var n=[],r=0;r<t.length;r++)for(var o=t[r],i=o.childCount-1;i>=0;i--)for(var a=o.child(i).attrs,l=a.rowspan,c=a.colspan,u=r;u<r+l;u++)n[u]=(n[u]||0)+c;for(var d=0,p=0;p<n.length;p++)d=Math.max(d,n[p]);for(var f=0;f<n.length;f++)if(f>=t.length&&t.push(s.Fragment.empty),n[f]<d){for(var h=w(e).cell.createAndFill(),m=[],v=n[f];v<d;v++)m.push(h);t[f]=t[f].append(s.Fragment.from(m))}return{height:t.length,width:d,rows:t}}(a,l)}function F(e,t){var n=e.createAndFill();return new c.Transform(n).replace(0,n.content.size,t).doc}function B(e,t,n){var r=e.width,o=e.height,i=e.rows;if(r!=t){for(var a=[],l=[],c=0;c<i.length;c++){for(var u=i[c],d=[],p=a[c]||0,f=0;p<t;f++){var h=u.child(f%u.childCount);p+h.attrs.colspan>t&&(h=h.type.create(D(h.attrs,h.attrs.colspan,p+h.attrs.colspan-t),h.content)),d.push(h),p+=h.attrs.colspan;for(var m=1;m<h.attrs.rowspan;m++)a[c+m]=(a[c+m]||0)+h.attrs.colspan}l.push(s.Fragment.from(d))}i=l,r=t}if(o!=n){for(var v=[],g=0,y=0;g<n;g++,y++){for(var w=[],b=i[y%o],S=0;S<b.childCount;S++){var k=b.child(S);g+k.attrs.rowspan>n&&(k=k.type.create(R(k.attrs,"rowspan",Math.max(1,n-k.attrs.rowspan)),k.content)),w.push(k)}v.push(s.Fragment.from(w))}i=v,o=n}return{width:r,height:o,rows:i}}function L(e,t,n,r,o,i,s,a){if(0==s||s==t.height)return!1;for(var l=!1,c=o;c<i;c++){var u=s*t.width+c,d=t.map[u];if(t.map[u-t.width]==d){l=!0;var p=n.nodeAt(d),f=t.findCell(d),h=f.top,m=f.left;e.setNodeMarkup(e.mapping.slice(a).map(d+r),null,R(p.attrs,"rowspan",s-h)),e.insert(e.mapping.slice(a).map(t.positionAt(s,m,n)),p.type.createAndFill(R(p.attrs,"rowspan",h+p.attrs.rowspan-s))),c+=p.attrs.colspan-1}}return l}function V(e,t,n,r,o,i,s,a){if(0==s||s==t.width)return!1;for(var l=!1,c=o;c<i;c++){var u=c*t.width+s,d=t.map[u];if(t.map[u-1]==d){l=!0;var p=n.nodeAt(d),f=t.colCount(d),h=e.mapping.slice(a).map(d+r);e.setNodeMarkup(h,null,D(p.attrs,s-f,p.attrs.colspan-(s-f))),e.insert(h+p.nodeSize,p.type.createAndFill(D(p.attrs,0,s-f))),c+=p.attrs.rowspan-1}}return l}function j(e,t,n,r,o){var i=n?e.doc.nodeAt(n-1):e.doc,a=h.get(i),l=r.top,c=r.left,u=c+o.width,d=l+o.height,p=e.tr,f=0;function m(){i=n?p.doc.nodeAt(n-1):p.doc,a=h.get(i),f=p.mapping.maps.length}(function(e,t,n,r,o,i,a){var l,c,u=w(e.doc.type.schema);if(o>t.width)for(var d=0,p=0;d<t.height;d++){var f=n.child(d);p+=f.nodeSize;var h=[],m=void 0;m=null==f.lastChild||f.lastChild.type==u.cell?l||(l=u.cell.createAndFill()):c||(c=u.header_cell.createAndFill());for(var v=t.width;v<o;v++)h.push(m);e.insert(e.mapping.slice(a).map(p-1+r),h)}if(i>t.height){for(var g=[],y=0,b=(t.height-1)*t.width;y<Math.max(t.width,o);y++){var S=!(y>=t.width)&&n.nodeAt(t.map[b+y]).type==u.header_cell;g.push(S?c||(c=u.header_cell.createAndFill()):l||(l=u.cell.createAndFill()))}for(var k=u.row.create(null,s.Fragment.from(g)),x=[],C=t.height;C<i;C++)x.push(k);e.insert(e.mapping.slice(a).map(r+n.nodeSize-2),x)}return!(!l&&!c)})(p,a,i,n,u,d,f)&&m(),L(p,a,i,n,c,u,l,f)&&m(),L(p,a,i,n,c,u,d,f)&&m(),V(p,a,i,n,l,d,c,f)&&m(),V(p,a,i,n,l,d,u,f)&&m();for(var v=l;v<d;v++){var g=a.positionAt(v,c,i),y=a.positionAt(v,u,i);p.replace(p.mapping.slice(f).map(g+n),p.mapping.slice(f).map(y+n),new s.Slice(o.rows[v-l],0,0))}m(),p.setSelection(new _(p.doc.resolve(n+a.positionAt(l,c,i)),p.doc.resolve(n+a.positionAt(d-1,u-1,i)))),t(p)}I.prototype.map=function(e){return new I(e.map(this.anchor),e.map(this.head))},I.prototype.resolve=function(e){var t=e.resolve(this.anchor),n=e.resolve(this.head);return"row"==t.parent.type.spec.tableRole&&"row"==n.parent.type.spec.tableRole&&t.index()<t.parent.childCount&&n.index()<n.parent.childCount&&O(t,n)?new _(t,n):i.Selection.near(n,1)};var K=Object(a.keydownHandler)({ArrowLeft:W("horiz",-1),ArrowRight:W("horiz",1),ArrowUp:W("vert",-1),ArrowDown:W("vert",1),"Shift-ArrowLeft":q("horiz",-1),"Shift-ArrowRight":q("horiz",1),"Shift-ArrowUp":q("vert",-1),"Shift-ArrowDown":q("vert",1),Backspace:J,"Mod-Backspace":J,Delete:J,"Mod-Delete":J});function H(e,t,n){return!n.eq(e.selection)&&(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function W(e,t){return function(n,r,o){var s=n.selection;if(s instanceof _)return H(n,r,i.Selection.near(s.$headCell,t));if("horiz"!=e&&!s.empty)return!1;var a=G(o,e,t);if(null==a)return!1;if("horiz"==e)return H(n,r,i.Selection.near(n.doc.resolve(s.head+t),t));var l,c=n.doc.resolve(a),u=N(c,e,t);return l=u?i.Selection.near(u,1):t<0?i.Selection.near(n.doc.resolve(c.before(-1)),-1):i.Selection.near(n.doc.resolve(c.after(-1)),1),H(n,r,l)}}function q(e,t){return function(n,r,o){var i=n.selection;if(!(i instanceof _)){var s=G(o,e,t);if(null==s)return!1;i=new _(n.doc.resolve(s))}var a=N(i.$headCell,e,t);return!!a&&H(n,r,new _(i.$anchorCell,a))}}function J(e,t){var n=e.selection;if(!(n instanceof _))return!1;if(t){var r=e.tr,o=w(e.schema).cell.createAndFill().content;n.forEachCell((function(e,t){e.content.eq(o)||r.replace(r.mapping.map(t+1),r.mapping.map(t+e.nodeSize-1),new s.Slice(o,0,0))})),r.docChanged&&t(r)}return!0}function X(e,t){var n=S(e.state.doc.resolve(t));return!!n&&(e.dispatch(e.state.tr.setSelection(new _(n))),!0)}function U(e,t,n){if(!k(e.state))return!1;var r=$(n),o=e.state.selection;if(o instanceof _){r||(r={width:1,height:1,rows:[s.Fragment.from(F(w(e.state.schema).cell,n))]});var i=o.$anchorCell.node(-1),a=o.$anchorCell.start(-1),l=h.get(i).rectBetween(o.$anchorCell.pos-a,o.$headCell.pos-a);return r=B(r,l.right-l.left,l.bottom-l.top),j(e.state,e.dispatch,a,l,r),!0}if(r){var c=x(e.state),u=c.start(-1);return j(e.state,e.dispatch,u,h.get(c.node(-1)).findCell(c.pos-u),r),!0}return!1}function Y(e,t){if(!t.ctrlKey&&!t.metaKey){var n,r=Q(e,t.target);if(t.shiftKey&&e.state.selection instanceof _)o(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&r&&null!=(n=S(e.state.selection.$anchor))&&Z(e,t).pos!=n.pos)o(n,t),t.preventDefault();else if(!r)return;e.root.addEventListener("mouseup",i),e.root.addEventListener("dragstart",i),e.root.addEventListener("mousemove",s)}function o(t,n){var r=Z(e,n),o=null==b.getState(e.state);if(!r||!O(t,r)){if(!o)return;r=t}var i=new _(t,r);if(o||!e.state.selection.eq(i)){var s=e.state.tr.setSelection(i);o&&s.setMeta(b,t.pos),e.dispatch(s)}}function i(){e.root.removeEventListener("mouseup",i),e.root.removeEventListener("dragstart",i),e.root.removeEventListener("mousemove",s),null!=b.getState(e.state)&&e.dispatch(e.state.tr.setMeta(b,-1))}function s(n){var s,a=b.getState(e.state);if(null!=a)s=e.state.doc.resolve(a);else if(Q(e,n.target)!=r&&!(s=Z(e,t)))return i();s&&o(s,n)}}function G(e,t,n){if(!(e.state.selection instanceof i.TextSelection))return null;for(var r=e.state.selection.$head,o=r.depth-1;o>=0;o--){var s=r.node(o);if((n<0?r.index(o):r.indexAfter(o))!=(n<0?0:s.childCount))return null;if("cell"==s.type.spec.tableRole||"header_cell"==s.type.spec.tableRole){var a=r.before(o),l="vert"==t?n>0?"down":"up":n>0?"right":"left";return e.endOfTextblock(l)?a:null}}return null}function Q(e,t){for(;t&&t!=e.dom;t=t.parentNode)if("TD"==t.nodeName||"TH"==t.nodeName)return t}function Z(e,t){var n=e.posAtCoords({left:t.clientX,top:t.clientY});return n&&n?S(e.state.doc.resolve(n.pos)):null}var ee=new i.PluginKey("fix-tables");function te(e,t){var n,r=function(t,r){"table"==t.type.spec.tableRole&&(n=function(e,t,n,r){var o=h.get(t);if(!o.problems)return r;r||(r=e.tr);for(var i,s,a=[],l=0;l<o.height;l++)a.push(0);for(var c=0;c<o.problems.length;c++){var u=o.problems[c];if("collision"==u.type){for(var d=t.nodeAt(u.pos),p=0;p<d.attrs.rowspan;p++)a[u.row+p]+=u.n;r.setNodeMarkup(r.mapping.map(n+1+u.pos),null,D(d.attrs,d.attrs.colspan-u.n,u.n))}else if("missing"==u.type)a[u.row]+=u.n;else if("overlong_rowspan"==u.type){var f=t.nodeAt(u.pos);r.setNodeMarkup(r.mapping.map(n+1+u.pos),null,R(f.attrs,"rowspan",f.attrs.rowspan-u.n))}else if("colwidth mismatch"==u.type){var m=t.nodeAt(u.pos);r.setNodeMarkup(r.mapping.map(n+1+u.pos),null,R(m.attrs,"colwidth",u.colwidth))}}for(var v=0;v<a.length;v++)a[v]&&(null==i&&(i=v),s=v);for(var g=0,y=n+1;g<o.height;g++){var b=t.child(g),S=y+b.nodeSize,k=a[g];if(k>0){var x="cell";b.firstChild&&(x=b.firstChild.type.spec.tableRole);for(var C=[],M=0;M<k;M++)C.push(w(e.schema)[x].createAndFill());var O=0!=g&&i!=g-1||s!=g?S-1:y+1;r.insert(r.mapping.map(O),C)}y=S}return r.setMeta(ee,{fixTables:!0})}(e,t,r,n))};return t?t.doc!=e.doc&&function e(t,n,r,o){var i=t.childCount,s=n.childCount;e:for(var a=0,l=0;a<s;a++){for(var c=n.child(a),u=l,d=Math.min(i,a+3);u<d;u++)if(t.child(u)==c){l=u+1,r+=c.nodeSize;continue e}o(c,r),l<i&&t.child(l).sameMarkup(c)?e(t.child(l),c,r+1,o):c.nodesBetween(0,c.content.size,o,r+1),r+=c.nodeSize}}(t.doc,e.doc,0,r):e.doc.descendants(r),n}function ne(e){var t,n=e.selection,r=x(e),o=r.node(-1),i=r.start(-1),s=h.get(o);return(t=n instanceof _?s.rectBetween(n.$anchorCell.pos-i,n.$headCell.pos-i):s.findCell(r.pos-i)).tableStart=i,t.map=s,t.table=o,t}function re(e,t,n){var r=t.map,o=t.tableStart,i=t.table,s=n>0?-1:0;z(r,i,n+s)&&(s=0==n||n==r.width?null:0);for(var a=0;a<r.height;a++){var l=a*r.width+n;if(n>0&&n<r.width&&r.map[l-1]==r.map[l]){var c=r.map[l],u=i.nodeAt(c);e.setNodeMarkup(e.mapping.map(o+c),null,E(u.attrs,n-r.colCount(c))),a+=u.attrs.rowspan-1}else{var d=null==s?w(i.type.schema).cell:i.nodeAt(r.map[l+s]).type,p=r.positionAt(a,n,i);e.insert(e.mapping.map(o+p),d.createAndFill())}}return e}function oe(e,t){if(!k(e))return!1;if(t){var n=ne(e);t(re(e.tr,n,n.left))}return!0}function ie(e,t){if(!k(e))return!1;if(t){var n=ne(e);t(re(e.tr,n,n.right))}return!0}function se(e,t,n){for(var r=t.map,o=t.table,i=t.tableStart,s=e.mapping.maps.length,a=0;a<r.height;){var l=a*r.width+n,c=r.map[l],u=o.nodeAt(c);if(n>0&&r.map[l-1]==c||n<r.width-1&&r.map[l+1]==c)e.setNodeMarkup(e.mapping.slice(s).map(i+c),null,D(u.attrs,n-r.colCount(c)));else{var d=e.mapping.slice(s).map(i+c);e.delete(d,d+u.nodeSize)}a+=u.attrs.rowspan}}function ae(e,t){if(!k(e))return!1;if(t){var n=ne(e),r=e.tr;if(0==n.left&&n.right==n.map.width)return!1;for(var o=n.right-1;se(r,n,o),o!=n.left;o--)n.table=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc,n.map=h.get(n.table);t(r)}return!0}function le(e,t,n){for(var r=w(t.type.schema).header_cell,o=0;o<e.width;o++)if(t.nodeAt(e.map[o+n*e.width]).type!=r)return!1;return!0}function ce(e,t,n){for(var r=t.map,o=t.tableStart,i=t.table,s=o,a=0;a<n;a++)s+=i.child(a).nodeSize;var l=[],c=n>0?-1:0;le(r,i,n+c)&&(c=0==n||n==r.height?null:0);for(var u=0,d=r.width*n;u<r.width;u++,d++)if(n>0&&n<r.height&&r.map[d]==r.map[d-r.width]){var p=r.map[d],f=i.nodeAt(p).attrs;e.setNodeMarkup(o+p,null,R(f,"rowspan",f.rowspan+1)),u+=f.colspan-1}else{var h=null==c?w(i.type.schema).cell:i.nodeAt(r.map[d+c*r.width]).type;l.push(h.createAndFill())}return e.insert(s,w(i.type.schema).row.create(null,l)),e}function ue(e,t){if(!k(e))return!1;if(t){var n=ne(e);t(ce(e.tr,n,n.top))}return!0}function de(e,t){if(!k(e))return!1;if(t){var n=ne(e);t(ce(e.tr,n,n.bottom))}return!0}function pe(e,t,n){for(var r=t.map,o=t.table,i=t.tableStart,s=0,a=0;a<n;a++)s+=o.child(a).nodeSize;var l=s+o.child(n).nodeSize,c=e.mapping.maps.length;e.delete(s+i,l+i);for(var u=0,d=n*r.width;u<r.width;u++,d++){var p=r.map[d];if(n>0&&p==r.map[d-r.width]){var f=o.nodeAt(p).attrs;e.setNodeMarkup(e.mapping.slice(c).map(p+i),null,R(f,"rowspan",f.rowspan-1)),u+=f.colspan-1}else if(n<r.width&&p==r.map[d+r.width]){var h=o.nodeAt(p),m=h.type.create(R(h.attrs,"rowspan",h.attrs.rowspan-1),h.content),v=r.positionAt(n+1,u,o);e.insert(e.mapping.slice(c).map(i+v),m),u+=h.attrs.colspan-1}}}function fe(e,t){if(!k(e))return!1;if(t){var n=ne(e),r=e.tr;if(0==n.top&&n.bottom==n.map.height)return!1;for(var o=n.bottom-1;pe(r,n,o),o!=n.top;o--)n.table=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc,n.map=h.get(n.table);t(r)}return!0}function he(e){var t=e.content;return 1==t.childCount&&t.firstChild.isTextblock&&0==t.firstChild.childCount}function me(e,t){var n=e.selection;if(!(n instanceof _)||n.$anchorCell.pos==n.$headCell.pos)return!1;var r=ne(e),o=r.map;if(function(e,t){for(var n=e.width,r=e.height,o=e.map,i=t.top*n+t.left,s=i,a=(t.bottom-1)*n+t.left,l=i+(t.right-t.left-1),c=t.top;c<t.bottom;c++){if(t.left>0&&o[s]==o[s-1]||t.right<n&&o[l]==o[l+1])return!0;s+=n,l+=n}for(var u=t.left;u<t.right;u++){if(t.top>0&&o[i]==o[i-n]||t.bottom<r&&o[a]==o[a+n])return!0;i++,a++}return!1}(o,r))return!1;if(t){for(var i,a,l=e.tr,c={},u=s.Fragment.empty,d=r.top;d<r.bottom;d++)for(var p=r.left;p<r.right;p++){var f=o.map[d*o.width+p],h=r.table.nodeAt(f);if(!c[f])if(c[f]=!0,null==i)i=f,a=h;else{he(h)||(u=u.append(h.content));var m=l.mapping.map(f+r.tableStart);l.delete(m,m+h.nodeSize)}}if(l.setNodeMarkup(i+r.tableStart,null,R(E(a.attrs,a.attrs.colspan,r.right-r.left-a.attrs.colspan),"rowspan",r.bottom-r.top)),u.size){var v=i+1+a.content.size,g=he(a)?i+1:v;l.replaceWith(g+r.tableStart,v+r.tableStart,u)}l.setSelection(new _(l.doc.resolve(i+r.tableStart))),t(l)}return!0}function ve(e,t){var n=w(e.schema);return ge((function(e){var t=e.node;return n[t.type.spec.tableRole]}))(e,t)}function ge(e){return function(t,n){var r,o,i=t.selection;if(i instanceof _){if(i.$anchorCell.pos!=i.$headCell.pos)return!1;r=i.$anchorCell.nodeAfter,o=i.$anchorCell.pos}else{if(!(r=function(e){for(var t=e.depth;t>0;t--){var n=e.node(t).type.spec.tableRole;if("cell"===n||"header_cell"===n)return e.node(t)}return null}(i.$from)))return!1;o=S(i.$from).pos}if(1==r.attrs.colspan&&1==r.attrs.rowspan)return!1;if(n){var s=r.attrs,a=[],l=s.colwidth;s.rowspan>1&&(s=R(s,"rowspan",1)),s.colspan>1&&(s=R(s,"colspan",1));for(var c,u=ne(t),d=t.tr,p=0;p<u.right-u.left;p++)a.push(l?R(s,"colwidth",l&&l[p]?[l[p]]:null):s);for(var f=u.top;f<u.bottom;f++){var h=u.map.positionAt(f,u.left,u.table);f==u.top&&(h+=r.nodeSize);for(var m=u.left,v=0;m<u.right;m++,v++)m==u.left&&f==u.top||d.insert(c=d.mapping.map(h+u.tableStart,1),e({node:r,row:f,col:m}).createAndFill(a[v]))}d.setNodeMarkup(o,e({node:r,row:u.top,col:u.left}),a[0]),i instanceof _&&d.setSelection(new _(d.doc.resolve(i.$anchorCell.pos),c&&d.doc.resolve(c))),n(d)}return!0}}function ye(e,t){return function(n,r){if(!k(n))return!1;var o=x(n);if(o.nodeAfter.attrs[e]===t)return!1;if(r){var i=n.tr;n.selection instanceof _?n.selection.forEachCell((function(n,r){n.attrs[e]!==t&&i.setNodeMarkup(r,null,R(n.attrs,e,t))})):i.setNodeMarkup(o.pos,null,R(o.nodeAfter.attrs,e,t)),r(i)}return!0}}function we(e,t,n){for(var r=t.map.cellsInRect({left:0,top:0,right:"row"==e?t.map.width:1,bottom:"column"==e?t.map.height:1}),o=0;o<r.length;o++){var i=t.table.nodeAt(r[o]);if(i&&i.type!==n.header_cell)return!1}return!0}function be(e,t){return(t=t||{useDeprecatedLogic:!1}).useDeprecatedLogic?function(e){return function(t,n){if(!k(t))return!1;if(n){for(var r=w(t.schema),o=ne(t),i=t.tr,s=o.map.cellsInRect("column"==e?new f(o.left,0,o.right,o.map.height):"row"==e?new f(0,o.top,o.map.width,o.bottom):o),a=s.map((function(e){return o.table.nodeAt(e)})),l=0;l<s.length;l++)a[l].type==r.header_cell&&i.setNodeMarkup(o.tableStart+s[l],r.cell,a[l].attrs);if(0==i.steps.length)for(var c=0;c<s.length;c++)i.setNodeMarkup(o.tableStart+s[c],r.header_cell,a[c].attrs);n(i)}return!0}}(e):function(t,n){if(!k(t))return!1;if(n){var r=w(t.schema),o=ne(t),i=t.tr,s=we("row",o,r),a=we("column",o,r),l=("column"===e?s:"row"===e&&a)?1:0,c="column"==e?new f(0,l,1,o.map.height):"row"==e?new f(l,0,o.map.width,1):o,u="column"==e?a?r.cell:r.header_cell:"row"==e?s?r.cell:r.header_cell:r.cell;o.map.cellsInRect(c).forEach((function(e){var t=e+o.tableStart,n=i.doc.nodeAt(t);n&&i.setNodeMarkup(t,u,n.attrs)})),n(i)}return!0}}var Se=be("row",{useDeprecatedLogic:!0}),ke=be("column",{useDeprecatedLogic:!0}),xe=be("cell",{useDeprecatedLogic:!0});function Ce(e){return function(t,n){if(!k(t))return!1;var r=function(e,t){if(t<0){var n=e.nodeBefore;if(n)return e.pos-n.nodeSize;for(var r=e.index(-1)-1,o=e.before();r>=0;r--){var i=e.node(-1).child(r);if(i.childCount)return o-1-i.lastChild.nodeSize;o-=i.nodeSize}}else{if(e.index()<e.parent.childCount-1)return e.pos+e.nodeAfter.nodeSize;for(var s=e.node(-1),a=e.indexAfter(-1),l=e.after();a<s.childCount;a++){var c=s.child(a);if(c.childCount)return l+1;l+=c.nodeSize}}}(x(t),e);if(null!=r){if(n){var o=t.doc.resolve(r);n(t.tr.setSelection(i.TextSelection.between(o,M(o))).scrollIntoView())}return!0}}}function Me(e,t){for(var n=e.selection.$anchor,r=n.depth;r>0;r--){if("table"==n.node(r).type.spec.tableRole)return t&&t(e.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0}return!1}var Oe=function(e,t){this.node=e,this.cellMinWidth=t,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.colgroup=this.table.appendChild(document.createElement("colgroup")),Te(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement("tbody"))};function Te(e,t,n,r,o,i){for(var s=0,a=!0,l=t.firstChild,c=e.firstChild,u=0,d=0;u<c.childCount;u++)for(var p=c.child(u).attrs,f=p.colspan,h=p.colwidth,m=0;m<f;m++,d++){var v=o==d?i:h&&h[m],g=v?v+"px":"";s+=v||r,v||(a=!1),l?(l.style.width!=g&&(l.style.width=g),l=l.nextSibling):t.appendChild(document.createElement("col")).style.width=g}for(;l;){var y=l.nextSibling;l.parentNode.removeChild(l),l=y}a?(n.style.width=s+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=s+"px")}Oe.prototype.update=function(e){return e.type==this.node.type&&(this.node=e,Te(e,this.colgroup,this.table,this.cellMinWidth),!0)},Oe.prototype.ignoreMutation=function(e){return"attributes"==e.type&&(e.target==this.table||this.colgroup.contains(e.target))};var Ae=new i.PluginKey("tableColumnResizing");function Ne(e){void 0===e&&(e={});var t=e.handleWidth;void 0===t&&(t=5);var n=e.cellMinWidth;void 0===n&&(n=25);var r=e.View;void 0===r&&(r=Oe);var o=e.lastColumnResizable;return void 0===o&&(o=!0),new i.Plugin({key:Ae,state:{init:function(e,t){return this.spec.props.nodeViews[w(t.schema).table.name]=function(e,t){return new r(e,n,t)},new Re(-1,!1)},apply:function(e,t){return t.apply(e)}},props:{attributes:function(e){return Ae.getState(e).activeHandle>-1?{class:"resize-cursor"}:null},handleDOMEvents:{mousemove:function(e,n){!function(e,t,n,r,o){var i=Ae.getState(e.state);if(!i.dragging){var s=function(e){for(;e&&"TD"!=e.nodeName&&"TH"!=e.nodeName;)e=e.classList.contains("ProseMirror")?null:e.parentNode;return e}(t.target),a=-1;if(s){var l=s.getBoundingClientRect(),c=l.left,u=l.right;t.clientX-c<=n?a=De(e,t,"left"):u-t.clientX<=n&&(a=De(e,t,"right"))}if(a!=i.activeHandle){if(!o&&-1!==a){var d=e.state.doc.resolve(a),p=d.node(-1),f=h.get(p),m=d.start(-1);if(f.colCount(d.pos-m)+d.nodeAfter.attrs.colspan-1==f.width-1)return}ze(e,a)}}}(e,n,t,0,o)},mouseleave:function(e){!function(e){var t=Ae.getState(e.state);t.activeHandle>-1&&!t.dragging&&ze(e,-1)}(e)},mousedown:function(e,t){!function(e,t,n){var r=Ae.getState(e.state);if(-1==r.activeHandle||r.dragging)return!1;var o=e.state.doc.nodeAt(r.activeHandle),i=function(e,t,n){var r=n.colspan,o=n.colwidth,i=o&&o[o.length-1];if(i)return i;var s=e.domAtPos(t),a=s.node.childNodes[s.offset].offsetWidth,l=r;if(o)for(var c=0;c<r;c++)o[c]&&(a-=o[c],l--);return a/l}(e,r.activeHandle,o.attrs);function s(t){window.removeEventListener("mouseup",s),window.removeEventListener("mousemove",a);var r=Ae.getState(e.state);r.dragging&&(!function(e,t,n){for(var r=e.state.doc.resolve(t),o=r.node(-1),i=h.get(o),s=r.start(-1),a=i.colCount(r.pos-s)+r.nodeAfter.attrs.colspan-1,l=e.state.tr,c=0;c<i.height;c++){var u=c*i.width+a;if(!c||i.map[u]!=i.map[u-i.width]){var d=i.map[u],p=o.nodeAt(d).attrs,f=1==p.colspan?0:a-i.colCount(d);if(!p.colwidth||p.colwidth[f]!=n){var m=p.colwidth?p.colwidth.slice():_e(p.colspan);m[f]=n,l.setNodeMarkup(s+d,null,R(p,"colwidth",m))}}}l.docChanged&&e.dispatch(l)}(e,r.activeHandle,Ee(r.dragging,t,n)),e.dispatch(e.state.tr.setMeta(Ae,{setDragging:null})))}function a(t){if(!t.which)return s(t);var r=Ae.getState(e.state),o=Ee(r.dragging,t,n);!function(e,t,n,r){var o=e.state.doc.resolve(t),i=o.node(-1),s=o.start(-1),a=h.get(i).colCount(o.pos-s)+o.nodeAfter.attrs.colspan-1,l=e.domAtPos(o.start(-1)).node;for(;"TABLE"!=l.nodeName;)l=l.parentNode;Te(i,l.firstChild,l,r,a,n)}(e,r.activeHandle,o,n)}e.dispatch(e.state.tr.setMeta(Ae,{setDragging:{startX:t.clientX,startWidth:i}})),window.addEventListener("mouseup",s),window.addEventListener("mousemove",a),t.preventDefault()}(e,t,n)}},decorations:function(e){var t=Ae.getState(e);if(t.activeHandle>-1)return function(e,t){for(var n=[],r=e.doc.resolve(t),o=r.node(-1),i=h.get(o),s=r.start(-1),a=i.colCount(r.pos-s)+r.nodeAfter.attrs.colspan,c=0;c<i.height;c++){var u=a+c*i.width-1;if(!(a!=i.width&&i.map[u]==i.map[u+1]||0!=c&&i.map[u-1]==i.map[u-1-i.width])){var d=i.map[u],p=s+d+o.nodeAt(d).nodeSize-1,f=document.createElement("div");f.className="column-resize-handle",n.push(l.Decoration.widget(p,f))}}return l.DecorationSet.create(e.doc,n)}(e,t.activeHandle)},nodeViews:{}}})}var Re=function(e,t){this.activeHandle=e,this.dragging=t};function De(e,t,n){var r=e.posAtCoords({left:t.clientX,top:t.clientY});if(!r)return-1;var o=r.pos,i=S(e.state.doc.resolve(o));if(!i)return-1;if("right"==n)return i.pos;var s=h.get(i.node(-1)),a=i.start(-1),l=s.map.indexOf(i.pos-a);return l%s.width==0?-1:a+s.map[l-1]}function Ee(e,t,n){var r=t.clientX-e.startX;return Math.max(n,e.startWidth+r)}function ze(e,t){e.dispatch(e.state.tr.setMeta(Ae,{setHandle:t}))}function _e(e){for(var t=[],n=0;n<e;n++)t.push(0);return t}function Ie(e){void 0===e&&(e={});var t=e.allowTableNodeSelection;return void 0===t&&(t=!1),new i.Plugin({key:b,state:{init:function(){return null},apply:function(e,t){var n=e.getMeta(b);if(null!=n)return-1==n?null:n;if(null==t||!e.docChanged)return t;var r=e.mapping.mapResult(t),o=r.deleted,i=r.pos;return o?null:i}},props:{decorations:P,handleDOMEvents:{mousedown:Y},createSelectionBetween:function(e){if(null!=b.getState(e.state))return e.state.selection},handleTripleClick:X,handleKeyDown:K,handlePaste:U},appendTransaction:function(e,n,r){return function(e,t,n){var r,o,s=(t||e).selection,a=(t||e).doc;if(s instanceof i.NodeSelection&&(o=s.node.type.spec.tableRole)){if("cell"==o||"header_cell"==o)r=_.create(a,s.from);else if("row"==o){var l=a.resolve(s.from+1);r=_.rowSelection(l,l)}else if(!n){var c=h.get(s.node),u=s.from+1,d=u+c.map[c.width*c.height-1];r=_.create(a,u+1,d)}}else s instanceof i.TextSelection&&function(e){var t=e.$from,n=e.$to;if(t.pos==n.pos||t.pos<t.pos-6)return!1;for(var r=t.pos,o=n.pos,i=t.depth;i>=0&&!(t.after(i+1)<t.end(i));i--,r++);for(var s=n.depth;s>=0&&!(n.before(s+1)>n.start(s));s--,o--);return r==o&&/row|table/.test(t.node(i).type.spec.tableRole)}(s)?r=i.TextSelection.create(a,s.from):s instanceof i.TextSelection&&function(e){for(var t,n,r=e.$from,o=e.$to,i=r.depth;i>0;i--){var s=r.node(i);if("cell"===s.type.spec.tableRole||"header_cell"===s.type.spec.tableRole){t=s;break}}for(var a=o.depth;a>0;a--){var l=o.node(a);if("cell"===l.type.spec.tableRole||"header_cell"===l.type.spec.tableRole){n=l;break}}return t!==n&&0===o.parentOffset}(s)&&(r=i.TextSelection.create(a,s.$from.start(),s.$from.end()));return r&&(t||(t=e.tr)).setSelection(r),t}(r,te(r,n),t)}})}Re.prototype.apply=function(e){var t=this,n=e.getMeta(Ae);if(n&&null!=n.setHandle)return new Re(n.setHandle,null);if(n&&void 0!==n.setDragging)return new Re(t.activeHandle,n.setDragging);if(t.activeHandle>-1&&e.docChanged){var r=e.mapping.map(t.activeHandle,-1);C(e.doc.resolve(r))||(r=null),t=new Re(r,t.dragging)}return t}},function(e,t,n){"use strict";n.r(t),n.d(t,"keydownHandler",(function(){return y})),n.d(t,"keymap",(function(){return g}));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:"'",229:"q"},o={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"',229:"Q"},i="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent),s="undefined"!=typeof navigator&&/Apple Computer/.test(navigator.vendor),a="undefined"!=typeof navigator&&/Gecko\/\d+/.test(navigator.userAgent),l="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),c="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),u=i&&(l||+i[1]<57)||a&&l,d=0;d<10;d++)r[48+d]=r[96+d]=String(d);for(d=1;d<=24;d++)r[d+111]="F"+d;for(d=65;d<=90;d++)r[d]=String.fromCharCode(d+32),o[d]=String.fromCharCode(d);for(var p in r)o.hasOwnProperty(p)||(o[p]=r[p]);var f=n(1),h="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function m(e){var t,n,r,o,i=e.split(/-(?!$)/),s=i[i.length-1];"Space"==s&&(s=" ");for(var a=0;a<i.length-1;a++){var l=i[a];if(/^(cmd|meta|m)$/i.test(l))o=!0;else if(/^a(lt)?$/i.test(l))t=!0;else if(/^(c|ctrl|control)$/i.test(l))n=!0;else if(/^s(hift)?$/i.test(l))r=!0;else{if(!/^mod$/i.test(l))throw new Error("Unrecognized modifier name: "+l);h?o=!0:n=!0}}return t&&(s="Alt-"+s),n&&(s="Ctrl-"+s),o&&(s="Meta-"+s),r&&(s="Shift-"+s),s}function v(e,t,n){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),!1!==n&&t.shiftKey&&(e="Shift-"+e),e}function g(e){return new f.Plugin({props:{handleKeyDown:y(e)}})}function y(e){var t=function(e){var t=Object.create(null);for(var n in e)t[m(n)]=e[n];return t}(e);return function(e,n){var i,a=function(e){var t=!(u&&(e.ctrlKey||e.altKey||e.metaKey)||(s||c)&&e.shiftKey&&e.key&&1==e.key.length)&&e.key||(e.shiftKey?o:r)[e.keyCode]||e.key||"Unidentified";return"Esc"==t&&(t="Escape"),"Del"==t&&(t="Delete"),"Left"==t&&(t="ArrowLeft"),"Up"==t&&(t="ArrowUp"),"Right"==t&&(t="ArrowRight"),"Down"==t&&(t="ArrowDown"),t}(n),l=1==a.length&&" "!=a,d=t[v(a,n,!l)];if(d&&d(e.state,e.dispatch,e))return!0;if(l&&(n.shiftKey||n.altKey||n.metaKey||a.charCodeAt(0)>127)&&(i=r[n.keyCode])&&i!=a){var p=t[v(i,n,!0)];if(p&&p(e.state,e.dispatch,e))return!0}else if(l&&n.shiftKey){var f=t[v(a,n,!0)];if(f&&f(e.state,e.dispatch,e))return!0}return!1}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4),o=n(5),i=n(2),s=n(0),a=n(1);t.changeTextBlock=function(e,t,n,r){if(!n.isTextblock)return!1;e.selection.ranges.forEach((function(o){var a=e.steps.length,l=o.$from.pos,c=o.$to.pos;e.doc.nodesBetween(l,c,(function(o,l){if(o.eq(t)&&o.isTextblock&&!o.hasMarkup(n,r)&&function(e,t,n){var r=e.resolve(t),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}(e.doc,e.mapping.slice(a).map(l),n)){e.clearIncompatible(e.mapping.slice(a).map(l,1),n);var c=e.mapping.slice(a),u=c.map(l,1),d=c.map(l+o.nodeSize,1),p=new s.Slice(s.Fragment.from(n.create(r,null,o.marks)),0,0);return e.step(new i.ReplaceAroundStep(u,d,u+1,d-1,p,1,!0)),!1}}))}))},t.blockNodes=function(e,t){void 0===t&&(t={blocksInSelection:!1});var n=e.doc,r=e.selection,o=r.$from,i=r.ranges,s=t.blocksInSelection,l=[],c=r instanceof a.NodeSelection?r.node:void 0;return c?c.isBlock?(l.push(c),c.nodesBetween(0,c.content.size,(function(e){e.isBlock&&l.push(e)}))):!s&&o.parent&&o.parent.isBlock&&l.push(o.parent):i.forEach((function(e){var t=e.$from.pos,r=e.$to.pos;n.nodesBetween(t,r,(function(e,n,o,i){e.isBlock&&(!s||n>=t&&n+e.content.size+2<=r)&&l.push(e)}))})),l},t.formatBlockElements=function(e,n){return function(o,i){var s=t.blockNodes(o),a=o.schema.nodes,l=o.tr;l.setMeta("commandName",n),l.setMeta("args",{value:e}),s.forEach((function(n){if(n.type.isTextblock)if("p"===e){var o=n.attrs,i=o.level,s=r.__rest(o,["level"]);t.changeTextBlock(l,n,a.paragraph,s)}else if(/^h[1-6]$/i.test(e)){i=parseInt(e.substr(1),10);t.changeTextBlock(l,n,a.heading,r.__assign({},n.attrs,{level:i}))}else if("blockquote"===e){var c=n.attrs;i=c.level,s=r.__rest(c,["level"]);t.changeTextBlock(l,n,a.blockquote,s)}}));var c=l.docChanged;return c&&i(l.scrollIntoView()),c}},t.cleanTextBlockFormatting=function(e,n){void 0===n&&(n={blocksInSelection:!0});var o=e.doc,i=e.selection,s=n.blocksInSelection,a=n.blockNodeType;t.blockNodes({doc:o,selection:i},{blocksInSelection:s}).filter((function(e){return e.isTextblock})).forEach((function(n){var o=n.attrs||{},i=o.style,s=void 0===i?"":i,l=o.class,c=void 0===l?"":l,u=r.__rest(o,["style","class"]),d=a||n.type;(s||c||d!==n.type)&&t.changeTextBlock(e,n,d,u)}))},t.getBlockFormats=function(e){var n=t.blockNodes(e),r=e.schema.nodes,o=[];return n.forEach((function(e){e.type===r.paragraph?o.push("p"):e.type===r.heading?o.push("h"+e.attrs.level):e.type===r.blockquote&&r.blockquote.isTextblock&&o.push("blockquote")})),o},t.addStyles=function(e,t){var n,r,i=e.attrs.style;i&&t.forEach((function(e){r={style:e.name,value:/^.+$/,newValue:e.value},n=o.changeStylesString(i,r),i=n.changed?n.style:i}));return i=i||t.reduce((function(e,t){return(e&&t.value?e+" ":"")+t.value?t.name+": "+t.value+";":""}),""),Object.assign({},e.attrs,{style:i||null})},t.hasNode=function(e,t){var n=e.selection,r=n.from,o=n.to,i=!1;return e.doc.nodesBetween(r,o,(function(e){return!(i=i||e.type===t)})),i},t.parentBlockFormat=function(e){var n=t.getBlockFormats(e);return 1===new Set(n).size?n[0]:null},t.activeNode=function(e){return{tag:t.parentBlockFormat(e)||""}}},function(e,t,n){"use strict";n.r(t),n.d(t,"autoJoin",(function(){return z})),n.d(t,"baseKeymap",(function(){return L})),n.d(t,"chainCommands",(function(){return _})),n.d(t,"createParagraphNear",(function(){return b})),n.d(t,"deleteSelection",(function(){return s})),n.d(t,"exitCode",(function(){return w})),n.d(t,"joinBackward",(function(){return a})),n.d(t,"joinDown",(function(){return m})),n.d(t,"joinForward",(function(){return d})),n.d(t,"joinUp",(function(){return h})),n.d(t,"lift",(function(){return v})),n.d(t,"liftEmptyBlock",(function(){return S})),n.d(t,"macBaseKeymap",(function(){return F})),n.d(t,"newlineInCode",(function(){return g})),n.d(t,"pcBaseKeymap",(function(){return $})),n.d(t,"selectAll",(function(){return M})),n.d(t,"selectNodeBackward",(function(){return c})),n.d(t,"selectNodeForward",(function(){return p})),n.d(t,"selectParentNode",(function(){return C})),n.d(t,"selectTextblockEnd",(function(){return N})),n.d(t,"selectTextblockStart",(function(){return A})),n.d(t,"setBlockType",(function(){return D})),n.d(t,"splitBlock",(function(){return k})),n.d(t,"splitBlockKeepMarks",(function(){return x})),n.d(t,"toggleMark",(function(){return E})),n.d(t,"wrapIn",(function(){return R}));var r=n(2),o=n(0),i=n(1);function s(e,t){return!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0)}function a(e,t,n){var s=e.selection.$cursor;if(!s||(n?!n.endOfTextblock("backward",e):s.parentOffset>0))return!1;var a=u(s);if(!a){var c=s.blockRange(),d=c&&Object(r.liftTarget)(c);return null!=d&&(t&&t(e.tr.lift(c,d).scrollIntoView()),!0)}var p=a.nodeBefore;if(!p.type.spec.isolating&&O(e,a,t))return!0;if(0==s.parent.content.size&&(l(p,"end")||i.NodeSelection.isSelectable(p))){var f=Object(r.replaceStep)(e.doc,s.before(),s.after(),o.Slice.empty);if(f.slice.size<f.to-f.from){if(t){var h=e.tr.step(f);h.setSelection(l(p,"end")?i.Selection.findFrom(h.doc.resolve(h.mapping.map(a.pos,-1)),-1):i.NodeSelection.create(h.doc,a.pos-p.nodeSize)),t(h.scrollIntoView())}return!0}}return!(!p.isAtom||a.depth!=s.depth-1)&&(t&&t(e.tr.delete(a.pos-p.nodeSize,a.pos).scrollIntoView()),!0)}function l(e,t,n){for(;e;e="start"==t?e.firstChild:e.lastChild){if(e.isTextblock)return!0;if(n&&1!=e.childCount)return!1}return!1}function c(e,t,n){var r=e.selection,o=r.$head,s=o;if(!r.empty)return!1;if(o.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):o.parentOffset>0)return!1;s=u(o)}var a=s&&s.nodeBefore;return!(!a||!i.NodeSelection.isSelectable(a))&&(t&&t(e.tr.setSelection(i.NodeSelection.create(e.doc,s.pos-a.nodeSize)).scrollIntoView()),!0)}function u(e){if(!e.parent.type.spec.isolating)for(var t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function d(e,t,n){var s=e.selection.$cursor;if(!s||(n?!n.endOfTextblock("forward",e):s.parentOffset<s.parent.content.size))return!1;var a=f(s);if(!a)return!1;var c=a.nodeAfter;if(O(e,a,t))return!0;if(0==s.parent.content.size&&(l(c,"start")||i.NodeSelection.isSelectable(c))){var u=Object(r.replaceStep)(e.doc,s.before(),s.after(),o.Slice.empty);if(u.slice.size<u.to-u.from){if(t){var d=e.tr.step(u);d.setSelection(l(c,"start")?i.Selection.findFrom(d.doc.resolve(d.mapping.map(a.pos)),1):i.NodeSelection.create(d.doc,d.mapping.map(a.pos))),t(d.scrollIntoView())}return!0}}return!(!c.isAtom||a.depth!=s.depth-1)&&(t&&t(e.tr.delete(a.pos,a.pos+c.nodeSize).scrollIntoView()),!0)}function p(e,t,n){var r=e.selection,o=r.$head,s=o;if(!r.empty)return!1;if(o.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):o.parentOffset<o.parent.content.size)return!1;s=f(o)}var a=s&&s.nodeAfter;return!(!a||!i.NodeSelection.isSelectable(a))&&(t&&t(e.tr.setSelection(i.NodeSelection.create(e.doc,s.pos)).scrollIntoView()),!0)}function f(e){if(!e.parent.type.spec.isolating)for(var t=e.depth-1;t>=0;t--){var n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}function h(e,t){var n,o=e.selection,s=o instanceof i.NodeSelection;if(s){if(o.node.isTextblock||!Object(r.canJoin)(e.doc,o.from))return!1;n=o.from}else if(null==(n=Object(r.joinPoint)(e.doc,o.from,-1)))return!1;if(t){var a=e.tr.join(n);s&&a.setSelection(i.NodeSelection.create(a.doc,n-e.doc.resolve(n).nodeBefore.nodeSize)),t(a.scrollIntoView())}return!0}function m(e,t){var n,o=e.selection;if(o instanceof i.NodeSelection){if(o.node.isTextblock||!Object(r.canJoin)(e.doc,o.to))return!1;n=o.to}else if(null==(n=Object(r.joinPoint)(e.doc,o.to,1)))return!1;return t&&t(e.tr.join(n).scrollIntoView()),!0}function v(e,t){var n=e.selection,o=n.$from,i=n.$to,s=o.blockRange(i),a=s&&Object(r.liftTarget)(s);return null!=a&&(t&&t(e.tr.lift(s,a).scrollIntoView()),!0)}function g(e,t){var n=e.selection,r=n.$head,o=n.$anchor;return!(!r.parent.type.spec.code||!r.sameParent(o))&&(t&&t(e.tr.insertText("\n").scrollIntoView()),!0)}function y(e){for(var t=0;t<e.edgeCount;t++){var n=e.edge(t).type;if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function w(e,t){var n=e.selection,r=n.$head,o=n.$anchor;if(!r.parent.type.spec.code||!r.sameParent(o))return!1;var s=r.node(-1),a=r.indexAfter(-1),l=y(s.contentMatchAt(a));if(!s.canReplaceWith(a,a,l))return!1;if(t){var c=r.after(),u=e.tr.replaceWith(c,c,l.createAndFill());u.setSelection(i.Selection.near(u.doc.resolve(c),1)),t(u.scrollIntoView())}return!0}function b(e,t){var n=e.selection,r=n.$from,o=n.$to;if(n instanceof i.AllSelection||r.parent.inlineContent||o.parent.inlineContent)return!1;var s=y(o.parent.contentMatchAt(o.indexAfter()));if(!s||!s.isTextblock)return!1;if(t){var a=(!r.parentOffset&&o.index()<o.parent.childCount?r:o).pos,l=e.tr.insert(a,s.createAndFill());l.setSelection(i.TextSelection.create(l.doc,a+1)),t(l.scrollIntoView())}return!0}function S(e,t){var n=e.selection.$cursor;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){var o=n.before();if(Object(r.canSplit)(e.doc,o))return t&&t(e.tr.split(o).scrollIntoView()),!0}var i=n.blockRange(),s=i&&Object(r.liftTarget)(i);return null!=s&&(t&&t(e.tr.lift(i,s).scrollIntoView()),!0)}function k(e,t){var n=e.selection,o=n.$from,s=n.$to;if(e.selection instanceof i.NodeSelection&&e.selection.node.isBlock)return!(!o.parentOffset||!Object(r.canSplit)(e.doc,o.pos))&&(t&&t(e.tr.split(o.pos).scrollIntoView()),!0);if(!o.parent.isBlock)return!1;if(t){var a=s.parentOffset==s.parent.content.size,l=e.tr;(e.selection instanceof i.TextSelection||e.selection instanceof i.AllSelection)&&l.deleteSelection();var c=0==o.depth?null:y(o.node(-1).contentMatchAt(o.indexAfter(-1))),u=a&&c?[{type:c}]:null,d=Object(r.canSplit)(l.doc,l.mapping.map(o.pos),1,u);if(u||d||!Object(r.canSplit)(l.doc,l.mapping.map(o.pos),1,c&&[{type:c}])||(u=[{type:c}],d=!0),d&&(l.split(l.mapping.map(o.pos),1,u),!a&&!o.parentOffset&&o.parent.type!=c)){var p=l.mapping.map(o.before()),f=l.doc.resolve(p);o.node(-1).canReplaceWith(f.index(),f.index()+1,c)&&l.setNodeMarkup(l.mapping.map(o.before()),c)}t(l.scrollIntoView())}return!0}function x(e,t){return k(e,t&&function(n){var r=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();r&&n.ensureMarks(r),t(n)})}function C(e,t){var n,r=e.selection,o=r.$from,s=r.to,a=o.sharedDepth(s);return 0!=a&&(n=o.before(a),t&&t(e.tr.setSelection(i.NodeSelection.create(e.doc,n))),!0)}function M(e,t){return t&&t(e.tr.setSelection(new i.AllSelection(e.doc))),!0}function O(e,t,n){var s,a,c=t.nodeBefore,u=t.nodeAfter;if(c.type.spec.isolating||u.type.spec.isolating)return!1;if(function(e,t,n){var o=t.nodeBefore,i=t.nodeAfter,s=t.index();return!!(o&&i&&o.type.compatibleContent(i.type))&&(!o.content.size&&t.parent.canReplace(s-1,s)?(n&&n(e.tr.delete(t.pos-o.nodeSize,t.pos).scrollIntoView()),!0):!(!t.parent.canReplace(s,s+1)||!i.isTextblock&&!Object(r.canJoin)(e.doc,t.pos))&&(n&&n(e.tr.clearIncompatible(t.pos,o.type,o.contentMatchAt(o.childCount)).join(t.pos).scrollIntoView()),!0))}(e,t,n))return!0;var d=t.parent.canReplace(t.index(),t.index()+1);if(d&&(s=(a=c.contentMatchAt(c.childCount)).findWrapping(u.type))&&a.matchType(s[0]||u.type).validEnd){if(n){for(var p=t.pos+u.nodeSize,f=o.Fragment.empty,h=s.length-1;h>=0;h--)f=o.Fragment.from(s[h].create(null,f));f=o.Fragment.from(c.copy(f));var m=e.tr.step(new r.ReplaceAroundStep(t.pos-1,p,t.pos,p,new o.Slice(f,1,0),s.length,!0)),v=p+2*s.length;Object(r.canJoin)(m.doc,v)&&m.join(v),n(m.scrollIntoView())}return!0}var g=i.Selection.findFrom(t,1),y=g&&g.$from.blockRange(g.$to),w=y&&Object(r.liftTarget)(y);if(null!=w&&w>=t.depth)return n&&n(e.tr.lift(y,w).scrollIntoView()),!0;if(d&&l(u,"start",!0)&&l(c,"end")){for(var b=c,S=[];S.push(b),!b.isTextblock;)b=b.lastChild;for(var k=u,x=1;!k.isTextblock;k=k.firstChild)x++;if(b.canReplace(b.childCount,b.childCount,k.content)){if(n){for(var C=o.Fragment.empty,M=S.length-1;M>=0;M--)C=o.Fragment.from(S[M].copy(C));n(e.tr.step(new r.ReplaceAroundStep(t.pos-S.length,t.pos+u.nodeSize,t.pos+x,t.pos+u.nodeSize-x,new o.Slice(C,S.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function T(e){return function(t,n){for(var r=t.selection,o=e<0?r.$from:r.$to,s=o.depth;o.node(s).isInline;){if(!s)return!1;s--}return!!o.node(s).isTextblock&&(n&&n(t.tr.setSelection(i.TextSelection.create(t.doc,e<0?o.start(s):o.end(s)))),!0)}}var A=T(-1),N=T(1);function R(e,t){return function(n,o){var i=n.selection,s=i.$from,a=i.$to,l=s.blockRange(a),c=l&&Object(r.findWrapping)(l,e,t);return!!c&&(o&&o(n.tr.wrap(l,c).scrollIntoView()),!0)}}function D(e,t){return function(n,r){var o=n.selection,i=o.from,s=o.to,a=!1;return n.doc.nodesBetween(i,s,(function(r,o){if(a)return!1;if(r.isTextblock&&!r.hasMarkup(e,t))if(r.type==e)a=!0;else{var i=n.doc.resolve(o),s=i.index();a=i.parent.canReplaceWith(s,s+1,e)}})),!!a&&(r&&r(n.tr.setBlockType(i,s,e,t).scrollIntoView()),!0)}}function E(e,t){return function(n,r){var o=n.selection,i=o.empty,s=o.$cursor,a=o.ranges;if(i&&!s||!function(e,t,n){for(var r=function(r){var o=t[r],i=o.$from,s=o.$to,a=0==i.depth&&e.type.allowsMarkType(n);if(e.nodesBetween(i.pos,s.pos,(function(e){if(a)return!1;a=e.inlineContent&&e.type.allowsMarkType(n)})),a)return{v:!0}},o=0;o<t.length;o++){var i=r(o);if(i)return i.v}return!1}(n.doc,a,e))return!1;if(r)if(s)e.isInSet(n.storedMarks||s.marks())?r(n.tr.removeStoredMark(e)):r(n.tr.addStoredMark(e.create(t)));else{for(var l=!1,c=n.tr,u=0;!l&&u<a.length;u++){var d=a[u],p=d.$from,f=d.$to;l=n.doc.rangeHasMark(p.pos,f.pos,e)}for(var h=0;h<a.length;h++){var m=a[h],v=m.$from,g=m.$to;if(l)c.removeMark(v.pos,g.pos,e);else{var y=v.pos,w=g.pos,b=v.nodeAfter,S=g.nodeBefore,k=b&&b.isText?/^\s*/.exec(b.text)[0].length:0,x=S&&S.isText?/\s*$/.exec(S.text)[0].length:0;y+k<w&&(y+=k,w-=x),c.addMark(y,w,e.create(t))}}r(c.scrollIntoView())}return!0}}function z(e,t){if(Array.isArray(t)){var n=t;t=function(e){return n.indexOf(e.type.name)>-1}}return function(n,o,i){return e(n,o&&function(e,t){return function(n){if(!n.isGeneric)return e(n);for(var o=[],i=0;i<n.mapping.maps.length;i++){for(var s=n.mapping.maps[i],a=0;a<o.length;a++)o[a]=s.map(o[a]);s.forEach((function(e,t,n,r){return o.push(n,r)}))}for(var l=[],c=0;c<o.length;c+=2)for(var u=o[c],d=o[c+1],p=n.doc.resolve(u),f=p.sharedDepth(d),h=p.node(f),m=p.indexAfter(f),v=p.after(f+1);v<=d;++m){var g=h.maybeChild(m);if(!g)break;if(m&&-1==l.indexOf(v)){var y=h.child(m-1);y.type==g.type&&t(y,g)&&l.push(v)}v+=g.nodeSize}l.sort((function(e,t){return e-t}));for(var w=l.length-1;w>=0;w--)Object(r.canJoin)(n.doc,l[w])&&n.join(l[w]);e(n)}}(o,t),i)}}function _(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return function(t,n,r){for(var o=0;o<e.length;o++)if(e[o](t,n,r))return!0;return!1}}var I=_(s,a,c),P=_(s,d,p),$={Enter:_(g,b,S,k),"Mod-Enter":w,Backspace:I,"Mod-Backspace":I,"Shift-Backspace":I,Delete:P,"Mod-Delete":P,"Mod-a":M},F={"Ctrl-h":$.Backspace,"Alt-Backspace":$["Mod-Backspace"],"Ctrl-d":$.Delete,"Ctrl-Alt-Backspace":$["Mod-Delete"],"Alt-Delete":$["Mod-Delete"],"Alt-d":$["Mod-Delete"],"Ctrl-a":A,"Ctrl-e":N};for(var B in $)F[B]=$[B];var L=("undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):"undefined"!=typeof os&&"darwin"==os.platform())?F:$},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4),o=n(1),i=n(5);t.reAnyValue=/^.+$/,t.parseStyle=function(e){return(e||"").split(/\s*;\s*/).filter(Boolean).map((function(e){var t,n=e.split(/\s*:\s*/);return(t={})[n[0]]=n[1],t})).reduce((function(e,t){return r.__assign({},e,t)}),{})},t.setNodeStyle=function(e,n,o){var s;if(new RegExp("[^-]?"+n+":").test(e.style||"")){var a=i.changeStylesString(e.style||"",{style:n,value:t.reAnyValue,newValue:o}).style;s=r.__assign({},e,{style:a})}else s=e.style?r.__assign({},e,{style:e.style.replace(/;$/,"")+"; "+n+": "+o+";"}):r.__assign({},e,{style:n+": "+o+";"});return s},t.tableResizeKey=new o.PluginKey("table-resize"),t.tableColumnResizeKey=new o.PluginKey("table-column-resizing"),t.tableRowResizeKey=new o.PluginKey("table-row-resizing"),t.otherResizing=function(e,n){var r=!1;return r=(r=(r=r||e!==t.tableResizeKey&&Boolean(t.tableResizeKey.get(n))&&t.tableResizeKey.getState(n).dragging)||e!==t.tableColumnResizeKey&&Boolean(t.tableColumnResizeKey.get(n))&&t.tableColumnResizeKey.getState(n).dragging)||e!==t.tableRowResizeKey&&Boolean(t.tableRowResizeKey.get(n))&&t.tableRowResizeKey.getState(n).dragging},t.otherResizeHandle=function(e,n){var r=!1;return r=(r=r||e!==t.tableColumnResizeKey&&Boolean(t.tableColumnResizeKey.get(n))&&t.tableColumnResizeKey.getState(n).activeHandle>-1)||e!==t.tableRowResizeKey&&Boolean(t.tableRowResizeKey.get(n))&&t.tableRowResizeKey.getState(n).activeHandle>-1},t.getTable=function(e){return e&&e.firstChild&&"TABLE"===e.firstChild.nodeName?e.firstChild:e},t.domCellAround=function(e){for(;e&&"TD"!==e.nodeName&&"TH"!==e.nodeName;)e=e.classList.contains("ProseMirror")?null:e.parentNode;return e},t.cellIndexes=function(e){var t=e.parentNode;return{cellIndex:e.cellIndex,rowIndex:t.rowIndex}},t.parentNode=function(e,t){for(var n=e.depth;n>0;n--){var r=e.node(n);if(t(r))return{node:r,depth:n}}return null}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(6),s=["div","ol","ul","li","table","tbody","thead","tfoot","td","th","p","tr","col","colgroup","article","main","nav","header","footer","aside","section"],a=function(e,t){var n=(e.ownerDocument||document).createElement(t);Array.from(e.rows).filter((function(e){return e.getAttribute(i.rowTypeAttr)===t})).forEach((function(e){e.removeAttribute(i.rowTypeAttr),n.appendChild(e)})),n.children.length&&e.appendChild(n)},l=function(e,t){var n=t.toUpperCase();e.filter((function(e){return e.nodeName===n})).forEach((function(e){Array.from(e.children).forEach((function(n){n.setAttribute(i.rowTypeAttr,t),e.parentNode&&e.parentNode.insertBefore(n,e)})),e.remove()}))};t.trimWhitespace=function(e,t){void 0===t&&(t=s);var n=t.join("|");return e.replace(new RegExp("\\s*(<(?:"+n+")(?:\\s[^>]*?)?>)","g"),"$1").replace(new RegExp("(<\\/(?:"+n+")(?:\\s[^>]*?)?>)\\s*","g"),"$1")},t.htmlToFragment=function(e){var t,n=document.createElement("template");if("content"in n)n.innerHTML=e,t=n.content;else{var r=(new DOMParser).parseFromString(e,"text/html");t=document.createDocumentFragment();for(var o=r.body;o&&o.firstChild;)t.appendChild(o.firstChild)}return t},t.pmDocToFragment=function(e){var t=r.DOMSerializer.fromSchema(e.type.schema).serializeFragment(e.content);return function(e){Array.from(e.querySelectorAll("table")).forEach((function(e){a(e,"thead"),a(e,"tbody"),a(e,"tfoot");var t=Array.from(e.children).find((function(e){return 0===e.children.length}));t&&t.remove()}))}(t),t},t.domToPmDoc=function(e,t,n){return r.DOMParser.fromSchema(t).parse(e,n)},t.parseContent=function(e,n,r){var o,s=t.htmlToFragment(e);return o=s,Array.from(o.querySelectorAll("table")).forEach((function(e){var t=Array.from(e.children);t.some((function(e){return"THEAD"===e.nodeName||"TFOOT"===e.nodeName}))&&(l(t,"thead"),l(t,"tbody"),l(t,"tfoot"));var n=t.find((function(e){return"COLGROUP"===e.nodeName}));n&&(e.setAttribute(i.colgroupAttr,n.outerHTML),n.remove())})),t.domToPmDoc(s,n,r)},t.getHtml=function(e){var n=t.pmDocToFragment(e.doc),r=document.createElement("div");return r.appendChild(n),r.innerHTML},t.setHtml=function(e,n,r){return void 0===n&&(n="setHTML"),void 0===r&&(r={preserveWhitespace:"full"}),function(i,s){return s(i.tr.setSelection(new o.AllSelection(i.doc)).replaceSelectionWith(t.parseContent(e,i.schema,r)).setMeta("commandName",n))}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4),o=n(2),i=n(5),s=n(7),a=function(e,t){var n=e.find((function(e){return"style"===e.type.name})),r=n&&n.attrs.style;return i.changeStylesString(r,t)},l=function(e,t,n,i,s){var l=s.create({style:i.style}),c=[],u=[],d=null,p=null;return e.doc.nodesBetween(t,n,(function(e,f,h){if(e.isInline){var m=e.marks;if(!l.isInSet(m)&&h.type.allowsMarkType(l.type)){var v=Math.max(f,t),g=Math.min(f+e.nodeSize,n),y=a(m,i);if(y.changed||i.newValue){for(var w=y.changed?{style:y.style||null}:{style:[i.style]+": "+i.newValue+";"},b=s.isInSet(m)?m.find((function(e){return"style"===e.type.name})):null,S=b?r.__assign({},b.attrs,w):w,k=s.create(S),x=k.addToSet(m),C=0;C<m.length;C++)m[C].isInSet(x)||(d&&d.to===v&&d.mark.eq(m[C])?d.to=g:(d=new o.RemoveMarkStep(v,g,m[C]),c.push(d)));var M=p&&p.to===v,O=M&&k.attrs.style===p.mark.attrs.style;M&&O?p.to=g:Object.keys(S).some((function(e){return null!==S[e]}))&&(p=new o.AddMarkStep(v,g,k),u.push(p))}}}})),c.forEach((function(t){return e.step(t)})),u.forEach((function(t){return e.step(t)})),c.length+u.length>0};t.getInlineStyles=function(e,t){var n=e.schema.marks.style;return(n?s.selectionMarks(e,n):[]).map((function(e){return s.styleValue(e,t)})).filter((function(e){return null!==e}))};var c=function(e,t){return function(n,o,c){var u=n.selection,d=u.empty,p=u.$cursor,f=u.ranges;if(d&&!p||!s.markApplies(n.doc,f,e))return!1;var h=!1;if(o){var m=c||n.tr;if(p){var v=n.storedMarks||p.marks();if(e.isInSet(v)){var g=a(v,t),y=v.find((function(e){return"style"===e.type.name})),w=r.__assign({},y?y.attrs:{},{style:g.style||null});if(i.shallowEqual(y.attrs,w))return!1;o(m.removeStoredMark(e)),Object.keys(w).some((function(e){return null!==w[e]}))&&o(m.addStoredMark(e.create(w))),h=!0}}else{for(var b=0;b<f.length;b++){var S=f[b],k=S.$from,x=S.$to;h=l(m,k.pos,x.pos,t,e)}h&&(m.scrollIntoView(),o(m))}}return h}};t.toggleInlineFormat=function(e,t,n){return function(r,o){var i=r.schema.marks,a=e.altStyle,l=e.altMarks,u=void 0===l?[]:l,d=e.mark,p=t||r.tr,f=!1,h=!1,m=function(){return h=!0};a&&i.style&&(f=c(i.style,{style:a.name,value:a.value})(r,m,p));var v=[d].concat(u).filter((function(e){return i[e]})).map((function(e){return s.hasMark(r,{mark:e})&&i[e]})).filter((function(e){return e}));return v.length?s.removeMarks(v,r,m,p):f||s.toggleMark(i[d],n,p)(r,m),h&&o(p),h}},t.applyInlineStyle=function(e,t){return function(n,o){var a=n.schema.marks.style,l={style:e.style,value:/^.+$/,newValue:e.value},u=n.tr;t&&u.setMeta("commandName",t),u.setMeta("args",e);var d=n.selection,p=d.empty,f=d.$cursor,h=d.ranges;if(p&&!f||!a||!s.markApplies(n.doc,h,a))return!1;if(f){var m=n.storedMarks||f.marks(),v=a.isInSet(m)?m.find((function(e){return"style"===e.type.name})):null,g={style:null};if(v&&v.attrs.style){var y=i.changeStylesString(v.attrs.style,l);y.changed&&y.style&&(g.style=y.style)}else l.newValue&&(g.style=[l.style]+": "+l.newValue+";");var w=v?r.__assign({},v.attrs,g):g;return Object.keys(w).some((function(e){return null!==w[e]}))?o(u.addStoredMark(a.create(w))):o(u.removeStoredMark(a)),!0}return c(a,l)(n,o,u)}}},function(e,t,n){"use strict";n.r(t),n.d(t,"addListNodes",(function(){return p})),n.d(t,"bulletList",(function(){return c})),n.d(t,"liftListItem",(function(){return m})),n.d(t,"listItem",(function(){return u})),n.d(t,"orderedList",(function(){return l})),n.d(t,"sinkListItem",(function(){return v})),n.d(t,"splitListItem",(function(){return h})),n.d(t,"wrapInList",(function(){return f}));var r=n(2),o=n(0),i=["ol",0],s=["ul",0],a=["li",0],l={attrs:{order:{default:1}},parseDOM:[{tag:"ol",getAttrs:function(e){return{order:e.hasAttribute("start")?+e.getAttribute("start"):1}}}],toDOM:function(e){return 1==e.attrs.order?i:["ol",{start:e.attrs.order},0]}},c={parseDOM:[{tag:"ul"}],toDOM:function(){return s}},u={parseDOM:[{tag:"li"}],toDOM:function(){return a},defining:!0};function d(e,t){var n={};for(var r in e)n[r]=e[r];for(var o in t)n[o]=t[o];return n}function p(e,t,n){return e.append({ordered_list:d(l,{content:"list_item+",group:n}),bullet_list:d(c,{content:"list_item+",group:n}),list_item:d(u,{content:t})})}function f(e,t){return function(n,i){var s=n.selection,a=s.$from,l=s.$to,c=a.blockRange(l),u=!1,d=c;if(!c)return!1;if(c.depth>=2&&a.node(c.depth-1).type.compatibleContent(e)&&0==c.startIndex){if(0==a.index(c.depth-1))return!1;var p=n.doc.resolve(c.start-2);d=new o.NodeRange(p,p,c.depth),c.endIndex<c.parent.childCount&&(c=new o.NodeRange(a,n.doc.resolve(l.end(c.depth)),c.depth)),u=!0}var f=Object(r.findWrapping)(d,e,t,c);return!!f&&(i&&i(function(e,t,n,i,s){for(var a=o.Fragment.empty,l=n.length-1;l>=0;l--)a=o.Fragment.from(n[l].type.create(n[l].attrs,a));e.step(new r.ReplaceAroundStep(t.start-(i?2:0),t.end,t.start,t.end,new o.Slice(a,0,0),n.length,!0));for(var c=0,u=0;u<n.length;u++)n[u].type==s&&(c=u+1);for(var d=n.length-c,p=t.start+n.length-(i?2:0),f=t.parent,h=t.startIndex,m=t.endIndex,v=!0;h<m;h++,v=!1)!v&&Object(r.canSplit)(e.doc,p,d)&&(e.split(p,d),p+=2*d),p+=f.child(h).nodeSize;return e}(n.tr,c,f,u,e).scrollIntoView()),!0)}}function h(e){return function(t,n){var i=t.selection,s=i.$from,a=i.$to,l=i.node;if(l&&l.isBlock||s.depth<2||!s.sameParent(a))return!1;var c=s.node(-1);if(c.type!=e)return!1;if(0==s.parent.content.size&&s.node(-1).childCount==s.indexAfter(-1)){if(2==s.depth||s.node(-3).type!=e||s.index(-2)!=s.node(-2).childCount-1)return!1;if(n){for(var u=o.Fragment.empty,d=s.index(-1)?1:s.index(-2)?2:3,p=s.depth-d;p>=s.depth-3;p--)u=o.Fragment.from(s.node(p).copy(u));var f=s.indexAfter(-1)<s.node(-2).childCount?1:s.indexAfter(-2)<s.node(-3).childCount?2:3;u=u.append(o.Fragment.from(e.createAndFill()));var h=s.before(s.depth-(d-1)),m=t.tr.replace(h,s.after(-f),new o.Slice(u,4-d,0)),v=-1;m.doc.nodesBetween(h,m.doc.content.size,(function(e,t){if(v>-1)return!1;e.isTextblock&&0==e.content.size&&(v=t+1)})),v>-1&&m.setSelection(t.selection.constructor.near(m.doc.resolve(v))),n(m.scrollIntoView())}return!0}var g=a.pos==s.end()?c.contentMatchAt(0).defaultType:null,y=t.tr.delete(s.pos,a.pos),w=g&&[null,{type:g}];return!!Object(r.canSplit)(y.doc,s.pos,2,w)&&(n&&n(y.split(s.pos,2,w).scrollIntoView()),!0)}}function m(e){return function(t,n){var i=t.selection,s=i.$from,a=i.$to,l=s.blockRange(a,(function(t){return t.childCount&&t.firstChild.type==e}));return!!l&&(!n||(s.node(l.depth-1).type==e?function(e,t,n,i){var s=e.tr,a=i.end,l=i.$to.end(i.depth);a<l&&(s.step(new r.ReplaceAroundStep(a-1,l,a,l,new o.Slice(o.Fragment.from(n.create(null,i.parent.copy())),1,0),1,!0)),i=new o.NodeRange(s.doc.resolve(i.$from.pos),s.doc.resolve(l),i.depth));return t(s.lift(i,Object(r.liftTarget)(i)).scrollIntoView()),!0}(t,n,e,l):function(e,t,n){for(var i=e.tr,s=n.parent,a=n.end,l=n.endIndex-1,c=n.startIndex;l>c;l--)a-=s.child(l).nodeSize,i.delete(a-1,a+1);var u=i.doc.resolve(n.start),d=u.nodeAfter;if(i.mapping.map(n.end)!=n.start+u.nodeAfter.nodeSize)return!1;var p=0==n.startIndex,f=n.endIndex==s.childCount,h=u.node(-1),m=u.index(-1);if(!h.canReplace(m+(p?0:1),m+1,d.content.append(f?o.Fragment.empty:o.Fragment.from(s))))return!1;var v=u.pos,g=v+d.nodeSize;return i.step(new r.ReplaceAroundStep(v-(p?1:0),g+(f?1:0),v+1,g-1,new o.Slice((p?o.Fragment.empty:o.Fragment.from(s.copy(o.Fragment.empty))).append(f?o.Fragment.empty:o.Fragment.from(s.copy(o.Fragment.empty))),p?0:1,f?0:1),p?0:1)),t(i.scrollIntoView()),!0}(t,n,l)))}}function v(e){return function(t,n){var i=t.selection,s=i.$from,a=i.$to,l=s.blockRange(a,(function(t){return t.childCount&&t.firstChild.type==e}));if(!l)return!1;var c=l.startIndex;if(0==c)return!1;var u=l.parent,d=u.child(c-1);if(d.type!=e)return!1;if(n){var p=d.lastChild&&d.lastChild.type==u.type,f=o.Fragment.from(p?e.create():null),h=new o.Slice(o.Fragment.from(e.create(null,o.Fragment.from(u.type.create(null,f)))),p?3:1,0),m=l.start,v=l.end;n(t.tr.step(new r.ReplaceAroundStep(m-(p?3:1),v,m,v,h,1,!0)).scrollIntoView())}return!0}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.directions={southeast:{x:1,y:1},east:{x:1,y:0},south:{x:0,y:1},north:{x:0,y:-1},west:{x:-1,y:0},southwest:{x:-1,y:1},northwest:{x:-1,y:-1},northeast:{x:1,y:-1}},t.handles=Object.keys(t.directions)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4),o=n(18);t.indentRules={nodes:[{node:"paragraph",style:"margin-left",rtlStyle:"margin-right",step:30,unit:"px"},{node:"heading",style:"margin-left",rtlStyle:"margin-right",step:30,unit:"px"}],listsTypes:r.__assign({},o.listsTypes)},t.outdentRules={nodes:[{node:"paragraph",style:"margin-left",rtlStyle:"margin-right",step:-30,unit:"px"},{node:"heading",style:"margin-left",rtlStyle:"margin-right",step:-30,unit:"px"}],listsTypes:r.__assign({},o.listsTypes)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4);t.listsTypes={orderedList:"ordered_list",bulletList:"bullet_list",listItem:"list_item"},t.orderedList={listType:t.listsTypes.orderedList,types:r.__assign({},t.listsTypes)},t.bulletList={listType:t.listsTypes.bulletList,types:r.__assign({},t.listsTypes)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(11);t.blockquote=function(e,t){return r.wrapIn(e.schema.nodes.blockquote)(e,t)},t.liftBlockquote=function(e,t){var n=e.selection,r=n.$from,o=n.$to,i=e.schema.nodes.blockquote,s=e.doc,a=-1,l=r.blockRange(o);l&&s.nodesBetween(l.start,l.end,(function(e,t,n,r){e.type===i&&(a=t)}));var c=-1!==a;return t&&c&&t(e.tr.lift(l,s.resolve(a).depth)),c}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4),o=n(0),i=n(1),s=n(2),a=n(11),l=n(15),c=n(18),u=function(e,t,n){for(var r=t.depth,o=e.nodes[n.bulletList],i=e.nodes[n.orderedList],s=e.nodes[n.listItem],a=t.depth;a>0;a--){var l=t.node(a);if(l.type!==o&&l.type!==i||(r=a),l.type!==o&&l.type!==i&&l.type!==s)break}return r-1};function d(e){return function(t,n,r){if(!r)return!1;var o=(t=r.state).schema.nodes[e.listType],i=t.selection,s=i.$from,c=i.$to,u=s.node(-2),d=s.node(-3),p=function(e,t,n,r){return 0===function(e,t,n){var r=Array(),o=function(e,t){var n=["blockquote","bulletList","orderedList"];if(1===t.depth)return t;var r=t.node(t.depth),o=t;for(;t.depth>=1;)t=e.resolve(t.before(t.depth)),(r=t.node(t.depth))&&-1!==n.indexOf(r.type.name)&&(o=t);return o}(e,t).depth,i=e.resolve(t.start(o));for(;i.pos<=n.start(n.depth);){var s=Math.min(i.depth,o),a=i.node(s);if(a&&r.push(a),0===s)break;var l=e.resolve(i.after(s));if(l.start(s)>=e.nodeSize-2)break;l.depth!==i.depth&&(l=e.resolve(l.pos+2)),i=l.depth?e.resolve(l.start(l.depth)):e.resolve(l.end(l.depth))}return r}(e,t,n).filter((function(e){return e.type!==r})).length}(t.doc,s,c,o);return(u&&u.type===o||d&&d.type===o)&&p?f(e)(t,n):(p||(f(e)(t,n),t=r.state),function(e,t){void 0===t&&(t={});return a.autoJoin(l.wrapInList(e,t),(function(t,n){return t.type===n.type&&t.type===e}))}(o,e.listAttrs)(t,n))}}function p(e,t,n,r){var i=r||e.schema.nodes.listItem,a=t.$from,l=t.$to,c=a.blockRange(l,(function(e){return e.childCount&&e.firstChild.type===i}));if(!c||c.depth<2||a.node(c.depth-1).type!==i)return n;var u=c.end,d=l.end(c.depth);return u<d&&(n.step(new s.ReplaceAroundStep(u-1,d,u,d,new o.Slice(o.Fragment.from(i.create(void 0,c.parent.copy())),1,0),1,!0)),c=new o.NodeRange(n.doc.resolve(a.pos),n.doc.resolve(d),c.depth)),n.lift(c,s.liftTarget(c)).scrollIntoView()}function f(e){return function(t,n){var r=t.tr,o=t.selection,a=o.$from,l=o.$to;return r.doc.nodesBetween(a.pos,l.pos,(function(n,o){if(n.isTextblock||"blockquote"===n.type.name||"div"===n.type.name){var a=new i.NodeSelection(r.doc.resolve(r.mapping.map(o))),l=a.$from.blockRange(a.$to);if(!l||a.$from.parent.type!==t.schema.nodes[e.listItem])return!1;var c=l&&s.liftTarget(l);if(null==c)return!1;r.lift(l,c)}})),n&&n(r),!0}}var h=/list\-style\-type:\s?([\w-]+)/;t.listStyle=function(e){var t=e.style||"",n=h.exec(t);return n&&n[1]||""},t.toggleList=function(e,n,r,o,s){var a=o.listType,l=o.listAttrs,c=void 0===l?{style:null}:l,f=e.selection,h=f.$from.node(f.$from.depth-2),m=f.$to.node(f.$to.depth-2);if(h&&h.type.name===a&&t.listStyle(h.attrs)===t.listStyle(c)&&m&&m.type.name===a&&t.listStyle(m.attrs)===t.listStyle(c)){var v=r.state.schema.nodes,g={bulletList:v[o.bulletList],orderedList:v[o.orderedList],listItem:v[o.listItem]},y=function(e,t){for(var n,r=t.bulletList,o=t.orderedList,i=t.listItem,s=e.depth-1;s>0;s--){var a=e.node(s);if(a.type!==r&&a.type!==o||(n=s),a.type!==r&&a.type!==o&&a.type!==i)break}return n}(f.$to,g),w=function(e,t,n,r,o,s){s||(s=e.schema.nodes.listItem);var a=!1;return o.doc.nodesBetween(t,n,(function(n,l){if(!a&&n.type===s&&l>t){a=!0;for(var c=r+3;c>r+2;){var u=o.doc.resolve(o.mapping.map(l));c=u.depth;var d=o.doc.resolve(o.mapping.map(l+n.textContent.length)),f=new i.TextSelection(u,d);o=p(e,f,o,s)}}})),o}(e,f.$to.pos,f.$to.end(y),y,r.state.tr,g.listItem);return(w=function(e,t,n){var r=e.selection,o=r.from,i=r.to,s=e.schema.nodes,a=s.paragraph,l=s.heading,c=[];t.doc.nodesBetween(o,i,(function(e,t){e.type!==a&&e.type!==l||c.push({node:e,pos:t})}));for(var d=c.length-1;d>=0;d--){var p=c[d],f=t.doc.resolve(t.mapping.map(p.pos));if(f.depth>0){var h=void 0;h=p.node.textContent&&p.node.textContent.length>0?t.doc.resolve(t.mapping.map(p.pos+p.node.textContent.length)):t.doc.resolve(t.mapping.map(p.pos+1));var m=f.blockRange(h);m&&t.lift(m,u(e.schema,f,n))}}return t}(e,w,o)).setMeta("commandName",s),n(w),!0}return d(o)(e,n,r)},t.toggleUnorderedList=function(e,n,o){return t.toggleList(e,n,o,r.__assign({listType:c.bulletList.listType},c.bulletList.types))},t.toggleOrderedList=function(e,n,o){return t.toggleList(e,n,o,r.__assign({listType:c.orderedList.listType},c.orderedList.types))},t.splitListItemKeepMarks=function(e){return function(t,n){return l.splitListItem(e)(t,(function(e){var r=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();r&&e.ensureMarks(r),n(e)}))}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4),o=n(0),i=n(8),s=n(13),a=n(6),l=["blockquote",0],c=["hr"],u=["pre",["code",0]],d=["ol",0],p=["ul",0],f=["li",0],h=function(e){for(var t,n={},r=e.attributes,o=0;o<r.length;o++)n[(t=r[o]).name]=t.value;return n},m=function(e){var t={};return e.forEach((function(e){t[e]={default:null}})),t},v=function(){return m(["style","class","id"])},g=function(e,t){for(var n in e)if(n&&null!==e[n]&&n!==t)return!0;return!1},y=function(e,t){void 0===t&&(t=[]);var n={},r=function(r){r&&null!==e[r]&&!t.find((function(e){return e===r}))&&(n[r]=e[r])};for(var o in e)r(o);return n},w=function(e){var t;return(t={})[e]={name:e,inclusive:!0,parseDOM:[{tag:e}],toDOM:function(){return[e,0]}},t},b=r.__assign({link:{attrs:r.__assign({},v(),{href:{default:null},target:{default:null},title:{default:null}}),inclusive:!1,parseDOM:[{tag:"a",getAttrs:h}],toDOM:function(e){return["a",y(e.attrs),0]}}},w("strong"),w("b"),w("em"),w("i"),w("u"),w("del"),w("sub"),w("sup"),w("code"),{style:{attrs:r.__assign({},v()),parseDOM:[{tag:"span",getAttrs:h}],toDOM:function(e){return g(e.attrs)?["span",y(e.attrs),0]:["span",0]}}});t.marks=b;var S=function(e){var t;return(t={})[e]={default:null,getFromDOM:function(t){return t.getAttribute(e)},setDOMAttr:function(t,n){n[e]=t}},t},k=r.__assign({},S("style"),S("class"),S("id"),S("headers")),x={doc:{content:"colgroup*"},col:{attrs:m(["id","class","style","span"]),parseDOM:[{getAttrs:h,tag:"col"}],toDOM:function(e){return["col",e.attrs]}},colgroup:{attrs:m(["id","class","style","span"]),content:"col*",parseDOM:[{getAttrs:h,tag:"colgroup"}],toDOM:function(e){return["colgroup",e.attrs,0]}},text:{inline:!0,group:"inline"}},C=new o.Schema({nodes:x,marks:{}});t.parseStrColgroup=function(e){var t=s.domToPmDoc(s.htmlToFragment(e),C,{preserveWhitespace:!1});return s.pmDocToFragment(t).firstChild};var M=i.tableNodes({tableGroup:"block",cellContent:"block+",cellAttributes:k});M.table_row.attrs=r.__assign({},M.table_row.attrs,m([a.rowTypeAttr,"style","class","id"])),M.table_row.toDOM=function(e){return["tr",y(e.attrs),0]},M.table_row.parseDOM=[{tag:"tr",getAttrs:h}],M.table.attrs=r.__assign({},M.table.attrs,m(["style","class","id",a.colgroupAttr,a.resizableAttr])),M.table.toDOM=function(e){var n=g(e.attrs)?y(e.attrs,[a.colgroupAttr,a.resizableAttr]):{},r=null;if(e.attrs[a.colgroupAttr]&&!function(e){for(var t=!1,n=e.child(0),r=0;r<n.childCount;r++){if(n.child(r).attrs.colwidth){t=!0;break}}return t}(e)){var o=t.parseStrColgroup(e.attrs[a.colgroupAttr]);if(o){var i=Array.from(o.children).map((function(e){return["col",h(e)]}));r=["colgroup",h(o)].concat(i)}}return r?["table",n,r,["tbody",0]]:["table",n,["tbody",0]]},M.table.parseDOM=[{tag:"table",getAttrs:function(e){var t=h(e),n=Array.from(e.childNodes).find((function(e){return"COLGROUP"===e.nodeName}));return n&&(t[a.colgroupAttr]=n.outerHTML),t}}];var O=r.__assign({doc:{content:"block+"},paragraph:{content:"inline*",group:"block",attrs:r.__assign({},v()),parseDOM:[{tag:"p",getAttrs:h}],toDOM:function(e){return g(e.attrs)?["p",y(e.attrs),0]:["p",0]}},div:{content:"block*",group:"block",attrs:r.__assign({},v()),parseDOM:[{tag:"div",getAttrs:h}],toDOM:function(e){return g(e.attrs)?["div",y(e.attrs),0]:["div",0]}},blockquote:{attrs:r.__assign({},v()),content:"block+",group:"block",defining:!0,parseDOM:[{tag:"blockquote",getAttrs:h}],toDOM:function(e){return g(e.attrs)?["blockquote",y(e.attrs),0]:l}},horizontal_rule:{group:"block",parseDOM:[{tag:"hr"}],toDOM:function(){return c}},heading:{attrs:r.__assign({},v(),{level:{default:1}}),content:"inline*",group:"block",defining:!0,parseDOM:[{tag:"h1",getAttrs:function(e){return r.__assign({},h(e),{level:1})}},{tag:"h2",getAttrs:function(e){return r.__assign({},h(e),{level:2})}},{tag:"h3",getAttrs:function(e){return r.__assign({},h(e),{level:3})}},{tag:"h4",getAttrs:function(e){return r.__assign({},h(e),{level:4})}},{tag:"h5",getAttrs:function(e){return r.__assign({},h(e),{level:5})}},{tag:"h6",getAttrs:function(e){return r.__assign({},h(e),{level:6})}}],toDOM:function(e){return g(e.attrs,"level")?["h"+e.attrs.level,y(e.attrs,["level"]),0]:["h"+e.attrs.level,0]}},code_block:{content:"text*",marks:"",group:"block",code:!0,defining:!0,parseDOM:[{tag:"pre",preserveWhitespace:"full"}],toDOM:function(){return u}},text:{inline:!0,group:"inline"},image:{inline:!0,attrs:r.__assign({src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}},v()),group:"inline",draggable:!0,parseDOM:[{tag:"img",getAttrs:h}],toDOM:function(e){return g(e.attrs)?["img",y(e.attrs)]:["img"]}},hard_break:{inline:!0,attrs:r.__assign({},v()),group:"inline",selectable:!1,parseDOM:[{tag:"br",getAttrs:h}],toDOM:function(e){return g(e.attrs)?["br",y(e.attrs)]:["br"]}},ordered_list:{content:"list_item+",group:"block",attrs:r.__assign({},v(),{type:{default:null},order:{default:1}}),parseDOM:[{tag:"ol",getAttrs:function(e){return r.__assign({},h(e),{order:e.hasAttribute("start")?parseInt(e.getAttribute("start")||"1",10):1})}}],toDOM:function(e){return 1===e.attrs.order?g(e.attrs,"order")?["ol",y(e.attrs,["order"]),0]:d:["ol",r.__assign({},y(e.attrs,["order"]),{start:e.attrs.order}),0]}},bullet_list:{content:"list_item+",group:"block",attrs:r.__assign({},v()),parseDOM:[{tag:"ul",getAttrs:h}],toDOM:function(e){return g(e.attrs)?["ul",y(e.attrs),0]:p}},list_item:{content:"(paragraph | heading) block*",attrs:r.__assign({},v()),parseDOM:[{tag:"li",getAttrs:h}],toDOM:function(e){return g(e.attrs)?["li",y(e.attrs),0]:f},defining:!0}},M);t.nodes=O},function(e,t,n){"use strict";n.r(t),n.d(t,"InputRule",(function(){return i})),n.d(t,"closeDoubleQuote",(function(){return p})),n.d(t,"closeSingleQuote",(function(){return h})),n.d(t,"ellipsis",(function(){return u})),n.d(t,"emDash",(function(){return c})),n.d(t,"inputRules",(function(){return s})),n.d(t,"openDoubleQuote",(function(){return d})),n.d(t,"openSingleQuote",(function(){return f})),n.d(t,"smartQuotes",(function(){return m})),n.d(t,"textblockTypeInputRule",(function(){return g})),n.d(t,"undoInputRule",(function(){return l})),n.d(t,"wrappingInputRule",(function(){return v}));var r=n(1),o=n(2),i=function(e,t){var n;this.match=e,this.handler="string"==typeof t?(n=t,function(e,t,r,o){var i=n;if(t[1]){var s=t[0].lastIndexOf(t[1]);i+=t[0].slice(s+t[1].length);var a=(r+=s)-o;a>0&&(i=t[0].slice(s-a,s)+i,r=o)}return e.tr.insertText(i,r,o)}):t};function s(e){var t=e.rules,n=new r.Plugin({state:{init:function(){return null},apply:function(e,t){var n=e.getMeta(this);return n||(e.selectionSet||e.docChanged?null:t)}},props:{handleTextInput:function(e,r,o,i){return a(e,r,o,i,t,n)},handleDOMEvents:{compositionend:function(e){setTimeout((function(){var r=e.state.selection.$cursor;r&&a(e,r.pos,r.pos,"",t,n)}))}}},isInputRules:!0});return n}function a(e,t,n,r,o,i){if(e.composing)return!1;var s=e.state,a=s.doc.resolve(t);if(a.parent.type.spec.code)return!1;for(var l=a.parent.textBetween(Math.max(0,a.parentOffset-500),a.parentOffset,null,"")+r,c=0;c<o.length;c++){var u=o[c].match.exec(l),d=u&&o[c].handler(s,u,t-(u[0].length-r.length),n);if(d)return e.dispatch(d.setMeta(i,{transform:d,from:t,to:n,text:r})),!0}return!1}function l(e,t){for(var n=e.plugins,r=0;r<n.length;r++){var o=n[r],i=void 0;if(o.spec.isInputRules&&(i=o.getState(e))){if(t){for(var s=e.tr,a=i.transform,l=a.steps.length-1;l>=0;l--)s.step(a.steps[l].invert(a.docs[l]));if(i.text){var c=s.doc.resolve(i.from).marks();s.replaceWith(i.from,i.to,e.schema.text(i.text,c))}else s.delete(i.from,i.to);t(s)}return!0}}return!1}var c=new i(/--$/,"—"),u=new i(/\.\.\.$/,"…"),d=new i(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,"“"),p=new i(/"$/,"”"),f=new i(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,"‘"),h=new i(/'$/,"’"),m=[d,p,f,h];function v(e,t,n,r){return new i(e,(function(e,i,s,a){var l=n instanceof Function?n(i):n,c=e.tr.delete(s,a),u=c.doc.resolve(s).blockRange(),d=u&&Object(o.findWrapping)(u,t,l);if(!d)return null;c.wrap(u,d);var p=c.doc.resolve(s-1).nodeBefore;return p&&p.type==t&&Object(o.canJoin)(c.doc,s-1)&&(!r||r(i,p))&&c.join(s-1),c}))}function g(e,t,n){return new i(e,(function(e,r,o,i){var s=e.doc.resolve(o),a=n instanceof Function?n(r):n;return s.node(-1).canReplaceWith(s.index(-1),s.indexAfter(-1),t)?e.tr.delete(o,i).setBlockType(o,o,t,a):null}))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bold={mark:"strong",altMarks:["b"],altStyle:{name:"font-weight",value:/^(bold(er)?|[5-9]\d{2,})$/}},t.italic={mark:"em",altMarks:["i"],altStyle:{name:"font-style",value:/^italic$/i}},t.underline={mark:"u",altStyle:{name:"text-decoration",value:/^underline$/i}},t.strikethrough={mark:"del",altStyle:{name:"text-decoration",value:/^line-through$/i}},t.subscript={mark:"sub"},t.superscript={mark:"sup"},t.link={mark:"link"},t.unlink={mark:"link"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=/style=['"]?[^'"]*?mso-list:\s*[a-zA-Z]+(\d+)\s[a-zA-Z]+(\d+)\s(\w+)/gi,o=function(e){return/^MsoListParagraph/.test(e.className)},i=function(e){var t=e.innerHTML;return t=(t=t.replace(/<!--(.|\s)*?-->/gi,"")).replace(/<\/?[^>]+?\/?>/gm,"")},s=function(e,t){var n=document.createElement(e);return n.style.listStyleType=t,n},a=function(e){var t=null;return/^\d/.test(e)||(t=(/^[a-z]/.test(e)?"lower-":"upper-")+(/^[ivxlcdm]/i.test(e)?"roman":"alpha")),t},l=function(e,t){var n=[];Array.from(e).forEach((function(e){if(e.nodeType===Node.ELEMENT_NODE){var r=e;r.getAttribute("datalist")?(n.push(e),t.add(n)):o(r)&&n.length?n.push(e):(n=[],"DIV"===r.nodeName?l(r.children,t):"TABLE"===r.nodeName&&Array.from(r.querySelectorAll("td,th")).forEach((function(e){l(e.children,t)})))}}))},c=function(e){var t,n=e.innerHTML,r=function(e){return e.replace(/^(?: |[\u00a0\n\r\s])+/,"")};return n=n.replace(/<\/?\w+[^>]*>/g,"").replace(/ /g," "),/^[\u2022\u00b7\u00a7\u00d8oØüvn][\u00a0 ]+/.test(n)?{tag:"ul",style:(t=r(i(e)),/^[\u2022\u00b7\u00FC\u00D8\u002dv-]/.test(t)?null:/^o/.test(t)?"circle":"square")}:/^\s*\w+[\.\)][\u00a0 ]{2,}/.test(n)?{tag:"ol",style:a(r(i(e)))}:void 0},u=function(e){var t,n=e.nodeName.toLowerCase();e.firstChild&&e.firstChild.nodeType===Node.COMMENT_NODE&&e.removeChild(e.firstChild),1===e.childNodes.length?t=e.firstChild.nodeType===Node.TEXT_NODE?i(e):e.firstChild.innerHTML.replace(/^\w+[\.\)]( )+ /,""):(e.removeChild(e.firstChild),3===e.firstChild.nodeType&&/^[ivxlcdm]+\.$/i.test(e.firstChild.nodeValue)&&e.removeChild(e.firstChild),/^( |\s)+$/i.test(e.firstChild.innerHTML)&&e.removeChild(e.firstChild),t="p"!==n?"<"+n+">"+e.innerHTML+"</"+n+">":e.innerHTML),e.parentNode.removeChild(e);var r=document.createElement("li");return r.innerHTML=t,r};t.convertMsLists=function(e){var t=document.createElement("div");t.innerHTML=function(e){return e=e.replace(r,(function(e,t,n){return'datalist="'+t+'" datalevel="'+n+'" '+e}))}(e);var n=new Set;return l(t.children,n),n.forEach((function(e){return function(e){var t,n,r,i,a,l,d,p,f,h,m,v,g,y=-1,w={};for(p=0;p<e.length;p++){var b=(g={datalist:(f=e[p]).getAttribute("datalist"),datalevel:f.getAttribute("datalevel")}).datalist,S=c(f);if(h=S&&S.tag){if(m=g.datalevel||parseFloat(f.style.marginLeft||0),g.datalevel||f.style.marginLeft){var k=h+b;w[m]||(w[m]={}),(!n||n<0)&&(n=m,r=b,i=(d=e.filter((function(e){return e.getAttribute("datalist")===String(r)})))[d.length-1],l=s(h,S&&S.style),f.parentNode.insertBefore(l,f),y=m,w[m][k]=l),a=i===f,v=w[m][k],(m>y||!v)&&(v=s(h,S&&S.style),w[m][k]=v,t.appendChild(v)),t=u(f),v.appendChild(t),a?n=y=-1:y=m}}else!t||a&&!o(f)||(f.style.marginLeft&&(f.style.marginLeft=""),f.style.marginLeft&&(f.style.margin=""),t.appendChild(f))}}(e)})),t.innerHTML}},function(e,t,n){"use strict";n.r(t),n.d(t,"HistoryState",(function(){return d})),n.d(t,"closeHistory",(function(){return w})),n.d(t,"history",(function(){return k})),n.d(t,"redo",(function(){return C})),n.d(t,"redoDepth",(function(){return O})),n.d(t,"undo",(function(){return x})),n.d(t,"undoDepth",(function(){return M}));var r=function(){};r.prototype.append=function(e){return e.length?(e=r.from(e),!this.length&&e||e.length<200&&this.leafAppend(e)||this.length<200&&e.leafPrepend(this)||this.appendInner(e)):this},r.prototype.prepend=function(e){return e.length?r.from(e).append(this):this},r.prototype.appendInner=function(e){return new i(this,e)},r.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t?r.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},r.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},r.prototype.forEach=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},r.prototype.map=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length);var r=[];return this.forEach((function(t,n){return r.push(e(t,n))}),t,n),r},r.from=function(e){return e instanceof r?e:e&&e.length?new o(e):r.empty};var o=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return 0==e&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var o=t;o<n;o++)if(!1===e(this.values[o],r+o))return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var o=t-1;o>=n;o--)if(!1===e(this.values[o],r+o))return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=200)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=200)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(r);r.empty=new o([]);var i=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,n,r){var o=this.left.length;return!(t<o&&!1===this.left.forEachInner(e,t,Math.min(n,o),r))&&(!(n>o&&!1===this.right.forEachInner(e,Math.max(t-o,0),Math.min(this.length,n)-o,r+o))&&void 0)},t.prototype.forEachInvertedInner=function(e,t,n,r){var o=this.left.length;return!(t>o&&!1===this.right.forEachInvertedInner(e,t-o,Math.max(n,o)-o,r+o))&&(!(n<o&&!1===this.left.forEachInvertedInner(e,Math.min(t,o),n,r))&&void 0)},t.prototype.sliceInner=function(e,t){if(0==e&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(r),s=r,a=n(2),l=n(1),c=function(e,t){this.items=e,this.eventCount=t};c.prototype.popEvent=function(e,t){var n=this;if(0==this.eventCount)return null;for(var r,o,i=this.items.length;;i--){if(this.items.get(i-1).selection){--i;break}}t&&(r=this.remapping(i,this.items.length),o=r.maps.length);var s,a,l=e.tr,d=[],p=[];return this.items.forEach((function(e,t){if(!e.step)return r||(r=n.remapping(i,t+1),o=r.maps.length),o--,void p.push(e);if(r){p.push(new u(e.map));var f,h=e.step.map(r.slice(o));h&&l.maybeStep(h).doc&&(f=l.mapping.maps[l.mapping.maps.length-1],d.push(new u(f,null,null,d.length+p.length))),o--,f&&r.appendMap(f,o)}else l.maybeStep(e.step);return e.selection?(s=r?e.selection.map(r.slice(o)):e.selection,a=new c(n.items.slice(0,i).append(p.reverse().concat(d)),n.eventCount-1),!1):void 0}),this.items.length,0),{remaining:a,transform:l,selection:s}},c.prototype.addTransform=function(e,t,n,r){for(var o=[],i=this.eventCount,s=this.items,a=!r&&s.length?s.get(s.length-1):null,l=0;l<e.steps.length;l++){var d,f=e.steps[l].invert(e.docs[l]),h=new u(e.mapping.maps[l],f,t);(d=a&&a.merge(h))&&(h=d,l?o.pop():s=s.slice(0,s.length-1)),o.push(h),t&&(i++,t=null),r||(a=h)}var m,v,g,y=i-n.depth;return y>p&&(v=y,(m=s).forEach((function(e,t){if(e.selection&&0==v--)return g=t,!1})),s=m.slice(g),i-=y),new c(s.append(o),i)},c.prototype.remapping=function(e,t){var n=new a.Mapping;return this.items.forEach((function(t,r){var o=null!=t.mirrorOffset&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:null;n.appendMap(t.map,o)}),e,t),n},c.prototype.addMaps=function(e){return 0==this.eventCount?this:new c(this.items.append(e.map((function(e){return new u(e)}))),this.eventCount)},c.prototype.rebased=function(e,t){if(!this.eventCount)return this;var n=[],r=Math.max(0,this.items.length-t),o=e.mapping,i=e.steps.length,s=this.eventCount;this.items.forEach((function(e){e.selection&&s--}),r);var a=t;this.items.forEach((function(t){var r=o.getMirror(--a);if(null!=r){i=Math.min(i,r);var l=o.maps[r];if(t.step){var c=e.steps[r].invert(e.docs[r]),d=t.selection&&t.selection.map(o.slice(a+1,r));d&&s++,n.push(new u(l,c,d))}else n.push(new u(l))}}),r);for(var l=[],d=t;d<i;d++)l.push(new u(o.maps[d]));var p=this.items.slice(0,r).append(l).append(n),f=new c(p,s);return f.emptyItemCount()>500&&(f=f.compress(this.items.length-n.length)),f},c.prototype.emptyItemCount=function(){var e=0;return this.items.forEach((function(t){t.step||e++})),e},c.prototype.compress=function(e){void 0===e&&(e=this.items.length);var t=this.remapping(0,e),n=t.maps.length,r=[],o=0;return this.items.forEach((function(i,s){if(s>=e)r.push(i),i.selection&&o++;else if(i.step){var a=i.step.map(t.slice(n)),l=a&&a.getMap();if(n--,l&&t.appendMap(l,n),a){var c=i.selection&&i.selection.map(t.slice(n));c&&o++;var d,p=new u(l.invert(),a,c),f=r.length-1;(d=r.length&&r[f].merge(p))?r[f]=d:r.push(p)}}else i.map&&n--}),this.items.length,0),new c(s.from(r.reverse()),o)},c.empty=new c(s.empty,0);var u=function(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r};u.prototype.merge=function(e){if(this.step&&e.step&&!e.selection){var t=e.step.merge(this.step);if(t)return new u(t.getMap().invert(),t,this.selection)}};var d=function(e,t,n,r){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r},p=20;function f(e){var t=[];return e.forEach((function(e,n,r,o){return t.push(r,o)})),t}function h(e,t){if(!e)return null;for(var n=[],r=0;r<e.length;r+=2){var o=t.map(e[r],1),i=t.map(e[r+1],-1);o<=i&&n.push(o,i)}return n}function m(e,t,n,r){var o=y(t),i=b.get(t).spec.config,s=(r?e.undone:e.done).popEvent(t,o);if(s){var a=s.selection.resolve(s.transform.doc),l=(r?e.done:e.undone).addTransform(s.transform,t.selection.getBookmark(),i,o),c=new d(r?l:s.remaining,r?s.remaining:l,null,0);n(s.transform.setSelection(a).setMeta(b,{redo:r,historyState:c}).scrollIntoView())}}var v=!1,g=null;function y(e){var t=e.plugins;if(g!=t){v=!1,g=t;for(var n=0;n<t.length;n++)if(t[n].spec.historyPreserveItems){v=!0;break}}return v}function w(e){return e.setMeta(S,!0)}var b=new l.PluginKey("history"),S=new l.PluginKey("closeHistory");function k(e){return e={depth:e&&e.depth||100,newGroupDelay:e&&e.newGroupDelay||500},new l.Plugin({key:b,state:{init:function(){return new d(c.empty,c.empty,null,0)},apply:function(t,n,r){return function(e,t,n,r){var o,i=n.getMeta(b);if(i)return i.historyState;n.getMeta(S)&&(e=new d(e.done,e.undone,null,0));var s=n.getMeta("appendedTransaction");if(0==n.steps.length)return e;if(s&&s.getMeta(b))return s.getMeta(b).redo?new d(e.done.addTransform(n,null,r,y(t)),e.undone,f(n.mapping.maps[n.steps.length-1]),e.prevTime):new d(e.done,e.undone.addTransform(n,null,r,y(t)),null,e.prevTime);if(!1===n.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))return(o=n.getMeta("rebased"))?new d(e.done.rebased(n,o),e.undone.rebased(n,o),h(e.prevRanges,n.mapping),e.prevTime):new d(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),h(e.prevRanges,n.mapping),e.prevTime);var a=0==e.prevTime||!s&&(e.prevTime<(n.time||0)-r.newGroupDelay||!function(e,t){if(!t)return!1;if(!e.docChanged)return!0;var n=!1;return e.mapping.maps[0].forEach((function(e,r){for(var o=0;o<t.length;o+=2)e<=t[o+1]&&r>=t[o]&&(n=!0)})),n}(n,e.prevRanges)),l=s?h(e.prevRanges,n.mapping):f(n.mapping.maps[n.steps.length-1]);return new d(e.done.addTransform(n,a?t.selection.getBookmark():null,r,y(t)),c.empty,l,n.time)}(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput:function(e,t){var n="historyUndo"==t.inputType?x(e.state,e.dispatch):"historyRedo"==t.inputType&&C(e.state,e.dispatch);return n&&t.preventDefault(),n}}}})}function x(e,t){var n=b.getState(e);return!(!n||0==n.done.eventCount)&&(t&&m(n,e,t,!1),!0)}function C(e,t){var n=b.getState(e);return!(!n||0==n.undone.eventCount)&&(t&&m(n,e,t,!0),!0)}function M(e){var t=b.getState(e);return t?t.done.eventCount:0}function O(e){var t=b.getState(e);return t?t.undone.eventCount:0}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4),o=n(13);t.getHtml=o.getHtml,t.setHtml=o.setHtml,t.parseContent=o.parseContent,t.trimWhitespace=o.trimWhitespace,t.htmlToFragment=o.htmlToFragment,t.domToPmDoc=o.domToPmDoc,t.pmDocToFragment=o.pmDocToFragment;var i=n(14);t.applyInlineStyle=i.applyInlineStyle,t.getInlineStyles=i.getInlineStyles,t.toggleInlineFormat=i.toggleInlineFormat;var s=n(27);t.applyLink=s.applyLink,t.removeLink=s.removeLink;var a=n(28);t.insertText=a.insertText;var l=n(29);t.insertImage=l.insertImage;var c=n(30);t.alignBlocks=c.alignBlocks,t.isAligned=c.isAligned;var u=n(31);t.cleanFormatting=u.cleanFormatting;var d=n(10);t.hasNode=d.hasNode,t.activeNode=d.activeNode,t.formatBlockElements=d.formatBlockElements,t.getBlockFormats=d.getBlockFormats,t.parentBlockFormat=d.parentBlockFormat,t.changeTextBlock=d.changeTextBlock,t.blockNodes=d.blockNodes,t.cleanTextBlockFormatting=d.cleanTextBlockFormatting;var p=n(7);t.hasMark=p.hasMark,t.getMark=p.getMark,t.getActiveMarks=p.getActiveMarks,t.removeAllMarks=p.removeAllMarks,t.cleanMarks=p.cleanMarks,t.selectionMarks=p.selectionMarks;var f=n(32);t.indent=f.indent,t.canIndentAsListItem=f.canIndentAsListItem,t.outdent=f.outdent,t.canOutdentAsListItem=f.canOutdentAsListItem,t.isIndented=f.isIndented,t.canBeIndented=f.canBeIndented,t.indentBlocks=f.indentBlocks;var h=n(20);t.toggleOrderedList=h.toggleOrderedList,t.toggleUnorderedList=h.toggleUnorderedList,t.toggleList=h.toggleList,t.listStyle=h.listStyle;var m=n(19);t.blockquote=m.blockquote,t.liftBlockquote=m.liftBlockquote;var v=n(5);t.hasSameMarkup=v.hasSameMarkup,t.getSelectionText=v.getSelectionText,t.getNodeFromSelection=v.getNodeFromSelection,t.selectedLineTextOnly=v.selectedLineTextOnly,t.expandSelection=v.expandSelection,t.expandToWordWrap=v.expandToWordWrap,t.canInsert=v.canInsert,t.insertNode=v.insertNode,t.indentHtml=v.indentHtml;var g=n(33);t.alignLeftRules=g.alignLeftRules,t.alignCenterRules=g.alignCenterRules,t.alignRightRules=g.alignRightRules,t.alignJustifyRules=g.alignJustifyRules,t.alignRemoveRules=g.alignRemoveRules;var y=n(17);t.indentRules=y.indentRules,t.outdentRules=y.outdentRules;var w=n(21);t.nodes=w.nodes,t.marks=w.marks;var b=n(34);t.buildKeymap=b.buildKeymap,t.buildListKeymap=b.buildListKeymap;var S=n(23);t.bold=S.bold,t.italic=S.italic,t.underline=S.underline,t.strikethrough=S.strikethrough,t.subscript=S.subscript,t.superscript=S.superscript,t.link=S.link;var k=n(35);t.sanitize=k.sanitize,t.removeComments=k.removeComments,t.removeTag=k.removeTag,t.pasteCleanup=k.pasteCleanup,t.sanitizeClassAttr=k.sanitizeClassAttr,t.sanitizeStyleAttr=k.sanitizeStyleAttr,t.removeAttribute=k.removeAttribute,t.replaceImageSourcesFromRtf=k.replaceImageSourcesFromRtf;var x=n(24);t.convertMsLists=x.convertMsLists;var C=n(36);t.find=C.find,t.findAt=C.findAt,t.findAll=C.findAll,t.replace=C.replace,t.replaceAll=C.replaceAll;var M=n(37);t.placeholder=M.placeholder;var O=n(38);t.spacesFix=O.spacesFix;var T=n(39);t.textHighlight=T.textHighlight,t.textHighlightKey=T.textHighlightKey;var A=n(40);t.imageResizing=A.imageResizing,t.imageResizeKey=A.imageResizeKey;var N=n(41);t.caretColor=N.caretColor,t.caretColorKey=N.caretColorKey;var R=n(42);t.tableResizing=R.tableResizing,t.tableResizeKey=R.tableResizeKey,t.tableColumnResizeKey=R.tableColumnResizeKey,t.tableRowResizeKey=R.tableRowResizeKey,r.__exportStar(n(11),t),r.__exportStar(n(47),t),r.__exportStar(n(48),t),r.__exportStar(n(25),t),r.__exportStar(n(22),t),r.__exportStar(n(9),t),r.__exportStar(n(0),t),r.__exportStar(n(15),t),r.__exportStar(n(1),t);var D=n(8);t.TableMap=D.TableMap,t.tableEditing=D.tableEditing,t.tableEditingKey=D.tableEditingKey,t.tableNodeTypes=D.tableNodeTypes,t.tableNodes=D.tableNodes,t.fixTables=D.fixTables,t.fixTablesKey=D.fixTablesKey,t.isInTable=D.isInTable,t.deleteTable=D.deleteTable,t.inSameTable=D.inSameTable,t.CellSelection=D.CellSelection,t.selectedRect=D.selectedRect,t.selectionCell=D.selectionCell,t.setCellAttr=D.setCellAttr,t.goToNextCell=D.goToNextCell,t.toggleHeader=D.toggleHeader,t.toggleHeaderCell=D.toggleHeaderCell,t.toggleHeaderColumn=D.toggleHeaderColumn,t.toggleHeaderRow=D.toggleHeaderRow,t.splitCell=D.splitCell,t.splitCellWithType=D.splitCellWithType,t.mergeCells=D.mergeCells,t.deleteColumn=D.deleteColumn,t.deleteRow=D.deleteRow,t.rowIsHeader=D.rowIsHeader,t.addRow=D.addRow,t.addColSpan=D.addColSpan,t.addColumn=D.addColumn,t.addColumnAfter=D.addColumnAfter,t.addColumnBefore=D.addColumnBefore,t.colCount=D.colCount,t.columnIsHeader=D.columnIsHeader,t.columnResizing=D.columnResizing,t.columnResizingPluginKey=D.columnResizingPluginKey,t.updateColumnsOnResize=D.updateColumnsOnResize,t.cellAround=D.cellAround,t.findCell=D.findCell,t.removeColSpan=D.removeColSpan,t.moveCellForward=D.moveCellForward,t.nextCell=D.nextCell,r.__exportStar(n(2),t),r.__exportStar(n(3),t);var E=n(49);t.createTable=E.createTable,t.addRowAfter=E.addRowAfter,t.addRowBefore=E.addRowBefore,t.pmAddRowAfter=E.pmAddRowAfter,t.pmAddRowBefore=E.pmAddRowBefore},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(14),o=n(7),i=n(1);t.removeLink=function(e,t){return function(n,i){var s=n.selection.$cursor;if(s){var a=s.parent,l=s.index(),c=n.schema.marks[e.mark],u=a.child(l).marks.find((function(e){return e.type===c})),d=a.childCount,p=s.pos-s.textOffset,f=a.child(l).nodeSize,h=void 0,m=void 0;for(h=l-1;h>=0&&u.isInSet(a.child(h).marks);)f+=m=a.child(h).nodeSize,p-=m,h-=1;for(h=l+1;h<d&&u.isInSet(a.child(h).marks);)f+=a.child(h).nodeSize,h+=1;i(o.removeMark(t||n.tr,p,p+f,u))}else r.toggleInlineFormat(e,t)(n,i)}};t.applyLink=function(e,n){var s=e.mark,a=e.attrs;return void 0===n&&(n="link"),function(e,l){var c=e.schema.marks,u=e.tr;n&&(u.setMeta("commandName",n),u.setMeta("args",a));var d=!1,p=function(){return d=!0};if(function(e,t){var n=o.selectionMarks(e,t);return 1===n.length&&n[0]?n[0]:null}(e,c[s]))!function(e,t){return function(n,r){var o=n.selection,i=o.$cursor,s=o.from,a=o.to,l=n.schema.marks[e.mark];if(i){var c=i.parent,u=i.index(),d=c.child(u).marks.find((function(e){return e.type===l})),p=c.childCount,f=i.pos-i.textOffset,h=c.child(u).nodeSize,m=void 0,v=void 0;for(m=u-1;m>=0&&d.isInSet(c.child(m).marks);)h+=v=c.child(m).nodeSize,f-=v,m-=1;for(m=u+1;m<p&&d.isInSet(c.child(m).marks);)h+=c.child(m).nodeSize,m+=1;t.removeMark(f,f+h,l),t.addMark(f,f+h,l.create(e.attrs)),r(t)}else t.doc.nodesBetween(s,a,(function(n,o){n.isInline&&l.isInSet(n.marks)&&(t.removeMark(o,o+n.nodeSize,l),t.addMark(o,o+n.nodeSize,l.create(e.attrs)),r(t))}))}}({mark:s,attrs:a},u)(e,p);else{var f=e;o.hasMark(e,{mark:s})&&(t.removeLink({mark:s,attrs:a},u)(e,p),f=i.EditorState.create({doc:u.doc,selection:u.selection})),d?o.toggleMark(c[s],a,u)(f,p):r.toggleInlineFormat({mark:s},u,a)(f,p)}return d&&l(u),d}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.insertText=function(e){return function(t,n){n(t.tr.insertText(e.text,e.from,e.to))}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5);t.insertImage=function(e){return function(t,n){var o=t.schema.nodes.image,i=o.createAndFill(e);r.insertNode(i)(t,(function(t){return n(t.setMeta("commandName","insertImage").setMeta("args",e))}))}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(10);t.alignBlocks=function(e,t){return function(n,o){var i=r.blockNodes(n),s=n.tr;s.setMeta("commandName",t),i.forEach((function(t){if(t.type.isTextblock){var n={},o=e.find((function(e){return e.node===t.type.name}));o&&(n=r.addStyles(t,o.style)),r.changeTextBlock(s,t,t.type,n)}}));var a=s.docChanged;return a&&o(s.scrollIntoView()),a}},t.isAligned=function(e,t){var n=r.blockNodes(e),o=!1;return n.forEach((function(e){if(!o&&e.type.isTextblock&&e.attrs.style){var n=t.find((function(t){return t.node===e.type.name}));n&&(o=n.style.every((function(t){return!!t.value&&new RegExp(t.name+":\\s?"+t.value,"i").test(e.attrs.style)})))}})),o}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(10),o=n(7);t.cleanFormatting=function(e){return void 0===e&&(e={blocksInSelection:!0}),function(t,n){var i=t.tr,s=e.blocksInSelection,a=e.blockNodeType,l=(e.exceptMarks||[t.schema.marks.link]).filter(Boolean);o.cleanMarks(i,{except:l}),r.cleanTextBlockFormatting(i,{blocksInSelection:s,blockNodeType:a});var c=i.docChanged;return c&&n&&n(i),c}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(15),o=n(17),i=n(10),s=n(5),a=n(19);t.indentBlocks=function(e,t,n){return function(r,o){var s=i.blockNodes(r),a=r.tr;a.setMeta("commandName",t),s.forEach((function(t){if(t.type.isTextblock){var r=void 0,o=e.find((function(e){return e.node===t.type.name}));if(o){var s="rtl"===n?o.rtlStyle:o.style,l={name:s,value:o.step>0?""+o.step+o.unit:""};if(t.attrs.style){var c=new RegExp(s+":\\s?(\\d+)"+o.unit,"i"),u=t.attrs.style.match(c);if(u){var d=parseFloat(u[1])+o.step;d=d<=0?"":d,l.value=""+d+(d?o.unit:"")}}r=i.addStyles(t,[l])}r&&i.changeTextBlock(a,t,t.type,r)}}));var l=a.docChanged;return l&&o(a.scrollIntoView()),l}},t.isIndented=function(e,t,n){var r=i.blockNodes(e),o=!1;return r.forEach((function(e){if(!o&&e.type.isTextblock&&e.attrs.style){var r=t.find((function(t){return t.node===e.type.name}));if(r){var i="rtl"===n?r.rtlStyle:r.style,s=new RegExp(i+":\\s?\\d+"+r.unit,"i");o=s.test(e.attrs.style)}}})),o},t.canIndentAsListItem=function(e,t){return r.sinkListItem(t)(e)},t.canOutdentAsListItem=function(e,t){var n=e.schema.nodes[t.listsTypes.listItem],o=e.schema.nodes[t.listsTypes.orderedList],i=e.schema.nodes[t.listsTypes.bulletList],a=!!s.findNthParentNodeOfType(o,2)(e.selection),l=!!s.findNthParentNodeOfType(i,2)(e.selection);return(a||l)&&r.liftListItem(n)(e)},t.canBeIndented=function(e,n){var r=e.schema.nodes,s=r[o.indentRules.listsTypes.listItem];return(t.isIndented(e,n.nodes)||o.indentRules.nodes.some((function(t){return r[t.node]&&i.hasNode(e,r[t.node])})))&&!i.hasNode(e,s)},t.indent=function(e,n){var i=e.schema.nodes[o.indentRules.listsTypes.listItem],s=t.canBeIndented(e,o.indentRules);t.canIndentAsListItem(e,i)?r.sinkListItem(i)(e,n):s&&t.indentBlocks(o.indentRules.nodes)(e,n)},t.outdent=function(e,n){var s=e.schema.nodes,l=s[o.outdentRules.listsTypes.listItem],c=t.canBeIndented(e,o.outdentRules);i.hasNode(e,s.blockquote)?a.liftBlockquote(e,n):t.canOutdentAsListItem(e,o.outdentRules)?r.liftListItem(l)(e,n):c&&t.indentBlocks(o.outdentRules.nodes)(e,n)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(e,t){return{name:e,value:t}};t.alignLeftRules=[{node:"paragraph",style:[r("text-align","left")]},{node:"heading",style:[r("text-align","left")]}],t.alignRightRules=[{node:"paragraph",style:[r("text-align","right")]},{node:"heading",style:[r("text-align","right")]}],t.alignCenterRules=[{node:"paragraph",style:[r("text-align","center")]},{node:"heading",style:[r("text-align","center")]}],t.alignJustifyRules=[{node:"paragraph",style:[r("text-align","justify")]},{node:"heading",style:[r("text-align","justify")]}],t.alignRemoveRules=[{node:"paragraph",style:[r("text-align","")]},{node:"heading",style:[r("text-align","")]}]},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4),o=n(11),i=n(25),s=n(22),a=n(20),l=n(23),c=n(14),u=n(5),d="undefined"!=typeof navigator&&/Mac/.test(navigator.platform);t.buildKeymap=function(e,t){var n={},a=t&&t.applyToWord||!1;if(n["Mod-z"]=i.undo,n["Shift-Mod-z"]=i.redo,n.Backspace=o.chainCommands(s.undoInputRule,o.deleteSelection,o.joinBackward,o.selectNodeBackward),n.Enter=o.chainCommands(o.newlineInCode,o.createParagraphNear,o.liftEmptyBlock,o.splitBlockKeepMarks),d||(n["Mod-y"]=i.redo),e.marks.strong&&(n["Mod-b"]=u.expandToWordWrap(c.toggleInlineFormat,r.__assign({},l.bold,{applyToWord:a}))),e.marks.em&&(n["Mod-i"]=u.expandToWordWrap(c.toggleInlineFormat,r.__assign({},l.italic,{applyToWord:a}))),e.marks.u&&(n["Mod-u"]=u.expandToWordWrap(c.toggleInlineFormat,r.__assign({},l.underline,{applyToWord:a}))),e.nodes.hard_break){var p=e.nodes.hard_break,f=o.chainCommands(o.exitCode,(function(e,t){return t(e.tr.replaceSelectionWith(p.create()).scrollIntoView()),!0}));n["Shift-Enter"]=f}return n},t.buildListKeymap=function(e){var t={};return e.nodes.list_item&&(t.Enter=a.splitListItemKeepMarks(e.nodes.list_item)),t}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(24);t.sanitize=function(e){return e=(e=(e=(e=(e=(e=(e=(e=(e=(e=e.replace(/^[\s\S]+?<!--StartFragment-->\s*([\s\S]*?)\s*<!--EndFragment-->[\s\S]+$/,"$1")).replace(/<\/?[ovw]:[^>]*?>/gi,"")).replace(/<\\?\??xml[^>]*>/gi,"")).replace(/<(?:link|meta) [^>]+?>/gi,"")).replace(/<style[^>]*?>\s*<\/style>/gi,"")).replace(/<\/?st1:.*?>/gi,"")).replace(/<a name="[a-zA-Z0-9_]+">/gim,"")).replace(/v:shapes?="[^"]+"/gi,"")).replace(/<!\[if !supportLists\]>/gi,"")).replace(/<!\[endif\]>/gi,"")},t.removeComments=function(e){return e.replace(/<!--[\s\S]+?-->/g,"")},t.removeTag=function(e,t){return e.replace(new RegExp("<\\/?("+t+")(?:\\s[^>]*?)?>","gi"),"")},t.removeAttribute=function(e){e.ownerElement&&e.ownerElement.removeAttribute(e.name)},t.sanitizeClassAttr=function(e){/^Mso/.test(e.value)&&t.removeAttribute(e)};var o=/\s*;\s*/,i=/\s*:\s*/;t.sanitizeStyleAttr=function(e){var n,r,s=e.value.split(o).filter((function(e){return Boolean(e)})),a=e.ownerElement.style,l="";s.forEach((function(e){var t;t=e.split(i),n=t[0],r=t[1],void 0!==a[n]&&(l+=n+": "+r+"; ")})),(l=l.trim())?e.value=l:t.removeAttribute(e)};function s(e){for(var t=e.length,n=new Array(t/2),r=0;r<t;r+=2)n[r]=String.fromCharCode(parseInt(e.substring(r,r+2),16));return btoa(n.join(""))}t.pasteCleanup=function(e,n){var o=e;if(n.convertMsLists&&(o=r.convertMsLists(o)),n.stripTags&&(o=t.removeTag(o,n.stripTags)),n.attributes){var i=document.createElement("div");i.innerHTML=o,Array.from(i.querySelectorAll("*")).forEach((function(e){return function(e,t){if(e.nodeType===Node.ELEMENT_NODE){for(var n=e.attributes.length-1;n>=0;n--){var r=e.attributes[n];t[r.name]?t[r.name](r):t["*"]&&t["*"](r)}"SPAN"===e.nodeName&&0===e.attributes.length&&function(e){var t=e.parentNode;if(t){for(;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}}(e)}}(e,n.attributes)})),o=i.innerHTML}return o};var a=/<img\s[^>]*?src=(?:'|")file:\/[^'"]+(?:'|")[^>]*>/gi,l=/{\\pict[\s\S]+?\\bliptag-?\d+(\\blipupi-?\d+)?({\\\*\\blipuid\s?[\da-fA-F]+)?[\s}]*?/,c=new RegExp("(?:("+l.source+"))([\\da-fA-F\\s]+)\\}","g"),u=/[^\da-fA-F]/g,d=/file:\/[^'"]+\.(jpg|png|gif)/i,p=/\\(png|jpeg)blip\\/;t.replaceImageSourcesFromRtf=function(e,t){var n=e.match(a);if(!n||-1===t.types.indexOf("text/rtf"))return e;var r=t.getData("text/rtf"),o=[],i=r.match(c);if(!r||!i)return e;for(var f=0,h=i;f<h.length;f++){var m=h[f],v=p.exec(m);if(v){var g=m.replace(l,"").replace(u,"");o.push("data:image/"+v[1]+";base64,"+s(g))}}return n.length!==o.length?e:e.replace(a,(function(e){var t=o.shift()||"";return e.replace(d,t)}))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4),o=n(1);t.findAt=function(e,t,n,r,i){var l,c,u,d,p,f,h=[],m=[],v=t.matchCase,g=t.matchWord,y=t.useRegExp,w=t.text;if(y&&(/^\\$/.test(w)||/[^\\]\\$/.test(w))&&(w=w.substring(0,w.length-1)),!w)return h;var b=v?"g":"gi",S=y?new RegExp(w,b):a(w,b);return e.nodesBetween(n,r,(function(t,a,v){if(i(h))return!1;t.inlineContent&&a+t.content.size>=n&&(m.length=0,t.nodesBetween(0,t.content.size,(function(t,v,y,w){if(i(h))return!1;var b=1+a+v;if(t.isText&&b+t.nodeSize>=n){if(p=t.text||"",f=y.childCount-1>=w+1&&y.child(w+1),m.push(n<=b?{text:p,start:b}:{text:p.slice(n-b),start:n}),f&&f.isText)return;for(c=m.map((function(e){return e.text})).join(""),l=S.exec(c);null!==l&&(u=m[0].start+l.index,d=u+l[0].length,n<=u&&r>=d&&s(l,g)&&h.push(o.TextSelection.create(e,u,d)),!i(h));)l=S.exec(c)}else m.length=0})))})),h},t.find=function(e,n){var o=n.backward,i=n.matchCyclic,s=r.__rest(n,["backward","matchCyclic"]),a=o?function(){return!1}:function(e){return e.length>0},l=e.doc,c=e.selection,u=[];return o?!(u=t.findAt(l,s,0,c.from,a)).length&&i&&(u=t.findAt(l,s,c.from,l.content.size,a)):!(u=t.findAt(l,s,c.to,l.content.size,a)).length&&i&&(u=t.findAt(l,s,0,c.to,a)),u.length?u[u.length-1]:null},t.findAll=function(e,n){return t.findAt(e,n,0,e.content.size,(function(){return!1}))},t.replace=function(e,t,n){var r=e.from,i=e.to;return n.insertText(t,r,i).setSelection(o.TextSelection.create(n.doc,r,r+t.length)),n},t.replaceAll=function(e,n,r){var o=t.findAll(e.doc,r);if(0===o.length)return null;for(var i=e.tr,s=o.length-1;s>=0;s--)i.insertText(n,o[s].from,o[s].to);return i};var i=/^[\s0-9~`!@#$%\^&*\(\)_\-=+\\|\[\]{};:'"\?/.,<>]?$/,s=function(e,t){if(t){if(!0===t){var n=e.input,r=n.charAt(e.index-1),o=n.charAt(e.index+e[0].length);return i.test(r)&&i.test(o)}return t(e)}return!0},a=function(e,t){var n=e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d").replace(/\s/g,"\\s");return new RegExp(n,t)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),o=n(3);t.placeholder=function(e){var t={class:"k-placeholder","data-placeholder":e};return new r.Plugin({key:new r.PluginKey("placeholder"),props:{decorations:function(e){var n=e.doc,r=n.content.firstChild;if(!(0===n.childCount||1===n.childCount&&r.inlineContent&&0===r.childCount))return o.DecorationSet.empty;var i=[];return n.descendants((function(e,n){i.push(o.Decoration.node(n,n+e.nodeSize,t))})),o.DecorationSet.create(n,i)}}})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),o=n(3),i=/\s+/g,s=/text-align/;t.spacesFix=function(){return new r.Plugin({key:new r.PluginKey("spaces-fix"),props:{decorations:function(e){var t,n,r,a,l=[],c=e.doc;return c.nodesBetween(0,c.content.size,(function(e,c,u){if(e.type.isText&&function(e){return s.test(e&&e.attrs&&e.attrs.style||"")}(u))for(n=i.exec(e.text||"");null!==n;){if(t=c+n.index,r=n[0].length,n.index+r<n.input.length)for(a=0;a<=r-1;a+=2)l.push(o.Decoration.inline(t+a,t+a+1,{style:"white-space: normal"}));n=i.exec(e.text||"")}})),o.DecorationSet.create(c,l)}}})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),o=n(3);t.textHighlightKey=new r.PluginKey("highlight"),t.textHighlight=function(e){return void 0===e&&(e=t.textHighlightKey),new r.Plugin({key:e,state:{init:function(){return null},apply:function(e){return e.getMeta(this.spec.key)}},props:{decorations:function(e){var t=(this.spec.key.getState(e)||[]).map((function(e){return o.Decoration.inline(e.from,e.to,e.attrs)}));return o.DecorationSet.create(e.doc,t)}}})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4),o=n(1),i=n(3),s=n(6),a=n(5),l=n(16);t.imageResizeKey=new o.PluginKey("image-resize");var c=function(e,t,n){e.style[t]=n+"px"},u=/[^\-]width:|[^\-]height:/,d=/^.+$/,p=function(){function e(e,t,n,r){this.activeHandle=e,this.dragging=t,this.rect=n,this.nodePosition=r}return e.prototype.apply=function(n){var r=n.getMeta(t.imageResizeKey);return r?new e(r.activeHandle,r.setDragging,r.rect,r.nodePosition):this},e}(),f=function(e,n,i){var p=n.target.getAttribute(s.dataResizeDirImage);if(!p)return!1;var f=t.imageResizeKey.getState(e.state);n.preventDefault();var h=e.state.tr;function m(n){!function(e,n,r){var o=t.imageResizeKey.getState(e.state),i=o.rect,s=o.dragging,a=o.nodePosition,u=o.activeHandle;if(s&&i){var d=e.nodeDOM(a),p=l.directions[u],f=(n.clientX-s.startX)*p.x,h=(n.clientY-s.startY)*p.y,m=p.x?f+d.width:i.width,v=p.y?h+d.height:i.height;if(r.lockRatio&&p.x&&p.y){var g=Math.min(m/d.width,v/d.height),y=d.width*g,w=d.height*g;s.startX=n.clientX-(m-y)*p.x,s.startY=n.clientY-(v-w)*p.y,m=y,v=w}else s.startX=p.x?n.clientX:s.startX,s.startY=p.y?n.clientY:s.startY;c(d,"width",m),c(d,"height",v),i.top=d.offsetTop,i.left=d.offsetLeft,i.width=d.offsetWidth,i.height=d.offsetHeight;var b=d.nextElementSibling;b.style.width=i.width+"px",b.style.height=i.height+"px",b.style.top=i.top+"px",b.style.left=i.left+"px"}}(e,n,i)}return h.setMeta(t.imageResizeKey,{setDragging:{startX:n.clientX,startY:n.clientY},activeHandle:p,rect:f.rect,nodePosition:f.nodePosition}),h.setMeta("addToHistory",!1),e.dispatch(h),n.view.addEventListener("mouseup",(function n(i){i.view.removeEventListener("mouseup",n),i.view.removeEventListener("mousemove",m),function(e){var n=t.imageResizeKey.getState(e.state),i=n.rect,s=n.dragging,l=n.nodePosition;if(s&&i){var c=e.state.selection;if(c instanceof o.NodeSelection){var p=c.node.attrs,f=i.width,h=i.height,m=void 0;if(u.test(p.style||"")){var v=a.changeStylesString(p.style,{style:"width",value:d,newValue:f+"px"}),g=a.changeStylesString(v.style||"",{style:"height",value:d,newValue:h+"px"}).style;m=r.__assign({},p,{style:g})}else m=r.__assign({},p,{width:f,height:h});var y=c.node.type.createAndFill(m);if(y){var w=e.state.tr;w.replaceWith(l,l+1,y),w.setSelection(o.NodeSelection.create(w.doc,l)),w.setMeta("commandName","image-resize"),w.setMeta("args",m),w.setMeta(t.imageResizeKey,{setDragging:null,activeHandle:null,rect:i,nodePosition:l}),e.dispatch(w)}}}}(e)})),n.view.addEventListener("mousemove",m),!0};t.imageResizing=function(e){return void 0===e&&(e={node:"image",lockRatio:!0}),new o.Plugin({key:t.imageResizeKey,view:function(n){return{resize:function(){t.imageResizeKey.getState(n.state).rect&&n.dispatch(n.state.tr.setMeta("resize",!0))},get window(){return n.dom.ownerDocument&&n.dom.ownerDocument.defaultView},attachResize:function(){var e=this.window;e&&(e.removeEventListener("resize",this.resize),e.addEventListener("resize",this.resize))},removeResize:function(){var e=this.window;e&&e.removeEventListener("resize",this.resize)},update:function(n,r){var i=n.state,s=i.selection,a=i.schema.nodes[e.node],l=t.imageResizeKey.getState(i),c=l.rect;if(s instanceof o.NodeSelection&&a===s.node.type){var u=n.nodeDOM(s.from),d={top:u.offsetTop,left:u.offsetLeft,width:u.offsetWidth,height:u.offsetHeight};if(!r.selection.eq(s)||c&&(c.width!==d.width||c.height!==d.height||c.top!==d.top||c.left!==d.left)){var p=i.tr;p.setMeta(t.imageResizeKey,{rect:d,nodePosition:s.from}),n.dispatch(p),this.attachResize()}}else c&&(l.rect=null,l.nodePosition=-1)},destroy:function(){this.removeResize()}}},state:{init:function(){return new p("",null,null,-1)},apply:function(e,t){return t.apply(e)}},props:{handleDOMEvents:{mousedown:function(t,n){return f(t,n,e)}},decorations:function(n){var r=n.selection,a=n.schema.nodes[e.node],c=t.imageResizeKey.getState(n).rect;if(c&&r instanceof o.NodeSelection&&a===r.node.type){var u=document.createElement("div");u.className="k-editor-resize-handles-wrapper",u.style.width=c.width+"px",u.style.height=c.height+"px",u.style.top=c.top+"px",u.style.left=c.left+"px";for(var d=0;d<l.handles.length;d++){var p=document.createElement("div");p.className=s.resizeHandle+" "+l.handles[d],p.setAttribute(s.dataResizeDirImage,l.handles[d]),u.appendChild(p)}return i.DecorationSet.create(n.doc,[i.Decoration.widget(n.selection.from+1,u)])}return i.DecorationSet.empty}}})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),o=n(3),i=n(7);t.caretColorKey=new r.PluginKey("caret-color"),t.caretColor=function(){return new r.Plugin({key:t.caretColorKey,props:{decorations:function(e){var t=e.doc,n=e.selection,r=e.storedMarks;if(!n.empty||!r)return o.DecorationSet.empty;var s=i.styleValue((r||[]).find((function(e){return"style"===e.type.name})),{name:"color",value:/^.+$/});if(!s)return o.DecorationSet.empty;var a=n.$anchor.parent,l=[];return t.descendants((function(e,t){e.eq(a)&&l.push(o.Decoration.node(t,t+e.nodeSize,{style:"caret-color: "+s}))})),o.DecorationSet.create(t,l)}}})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(43),o=n(45),i=n(46);t.tableResizing=function(){return[o.tableResizing(),r.columnResizing(),i.rowResizing()]};var s=n(12);t.tableResizeKey=s.tableResizeKey,t.tableColumnResizeKey=s.tableColumnResizeKey,t.tableRowResizeKey=s.tableRowResizeKey},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4),o=n(1),i=n(8),s=n(3),a=n(6),l=n(44),c=n(12);t.columnResizing=function(){var e=l.TableView;return new o.Plugin({key:c.tableColumnResizeKey,state:{init:function(t,n){return this.spec.props.nodeViews[i.tableNodeTypes(n.schema).table.name]=function(t,n){return new e(t,n)},new u(-1,null)},apply:function(e,t){return t.apply(e)}},props:{attributes:function(e){return c.otherResizeHandle(c.tableColumnResizeKey,e)?null:c.tableColumnResizeKey.getState(e).activeHandle>-1?{class:"resize-cursor"}:null},handleDOMEvents:{mousemove:function(e,t){return c.otherResizing(c.tableColumnResizeKey,e.state)||function(e,t,n){var r=c.tableColumnResizeKey.getState(e.state);if(!r.dragging){var o=c.domCellAround(t.target),i=-1;if(o){var s=c.cellIndexes(o),a=o.getBoundingClientRect(),l=a.left,u=a.right;Math.abs(t.clientX-l)<=n&&s.cellIndex>0?(s.cellIndex--,i=d(e,t,s)):u-t.clientX>0&&u-t.clientX<=n&&(i=d(e,t,s))}i!==r.activeHandle&&f(e,i)}}(e,t,5),!1},mouseleave:function(e){return function(e){var t=c.tableColumnResizeKey.getState(e.state);t.activeHandle>-1&&!t.dragging&&f(e,-1)}(e),!1},mousedown:function(e,t){return function(e,t,n){var o,s=c.tableColumnResizeKey.getState(e.state);if(-1===s.activeHandle||s.dragging)return!1;for(var l=e.state.doc.resolve(s.activeHandle),u=l.parent,d=l.index(),f=0,h=0;h<=d;h++)f+=u.child(h).attrs.colspan;var m,v,g=l.node(l.depth-1),y=e.domAtPos(s.activeHandle),w=y.node.childNodes[y.offset].closest("table");if(g.attrs[a.colgroupAttr]){var b=w.firstChild;(m=b.children[f-1]).style.width||(m.style.width=m.offsetWidth+"px")}else{var S=0;for(h=0;h<u.childCount;h++)S+=u.child(h).attrs.colspan;b=document.createElement("colgroup");var k=new Array(S);for(h=0;h<S;h++)k[h]=document.createElement("col"),b.appendChild(k[h]);w.insertBefore(b,w.firstChild),(m=k[d]).style.width=m.offsetWidth+"px",v=r.__assign({},g.attrs,((o={})[a.colgroupAttr]="<colgroup>"+k.reduce((function(e,t){return e+t.outerHTML}),"")+"</colgroup>",o))}var x=parseFloat(m.style.width),C=e.state.tr.setMeta(c.tableColumnResizeKey,{setDragging:{startX:t.clientX,startWidth:x}});if(!w.style.width){var M=Array.from(m.parentNode.children).map((function(e){return e.style.width}));if(M.every(Boolean)){var O=M.reduce((function(e,t){return e+parseFloat(t)}),0);v=c.setNodeStyle(v||g.attrs,"width",O+"px")}}if(v){var T=l.posAtIndex(0,l.depth-1)-1;C.setNodeMarkup(T,null,v)}function A(t){t.view.removeEventListener("mouseup",A),t.view.removeEventListener("mousemove",N);var o=c.tableColumnResizeKey.getState(e.state);o.dragging&&(!function(e,t,n){var o,i=e.state.doc.resolve(t),s=i.node(-1),l=i.start(-1),u=e.state.tr,d=i.posAtIndex(0,i.depth-1)-1,p=e.nodeDOM(l).closest("table"),f=s.attrs;if(s&&f[a.colgroupAttr]){var h=p.firstChild;f=r.__assign({},f,((o={})[a.colgroupAttr]=h.outerHTML,o))}var m=p.style.width;p&&m&&c.parseStyle(f.style).width!==m&&(f=c.setNodeStyle(f,"width",m),u.setNodeMarkup(d,null,f));u.docChanged&&e.dispatch(u)}(e,o.activeHandle,p(o.dragging,t,n)),e.dispatch(e.state.tr.setMeta(c.tableColumnResizeKey,{setDragging:null})))}function N(t){if(!t.which)return A(t);var r=c.tableColumnResizeKey.getState(e.state),o=p(r.dragging,t,n);!function(e,t,n,r){var o=e.state.doc.resolve(t),s=o.node(-1),a=o.start(-1),l=i.TableMap.get(s).colCount(o.pos-a)+o.nodeAfter.attrs.colspan-1,c=e.domAtPos(o.start(-1)).node;"TABLE"!==c.nodeName&&(c=c.closest("table"));var u=c,d=u.firstChild,p=Array.from(d.children);if(p[l].style.width=n+"px",u.style.width){var f=p.map((function(e){return e.style.width}));if(f.every(Boolean)){var h=f.reduce((function(e,t){return e+parseFloat(t)}),0);u.style.width=h+"px"}}}(e,r.activeHandle,o)}return e.dispatch(C),t.view.addEventListener("mouseup",A),t.view.addEventListener("mousemove",N),t.preventDefault(),!0}(e,t,25)}},decorations:function(e){if(!c.otherResizing(c.tableColumnResizeKey,e)){var t=c.tableColumnResizeKey.getState(e);if(t.activeHandle>-1)return function(e,t){for(var n=[],r=e.doc.resolve(t),o=r.node(-1),a=i.TableMap.get(o),l=r.start(-1),c=a.colCount(r.pos-l)+r.nodeAfter.attrs.colspan,u=0;u<a.height;u++){var d=c+u*a.width-1;if(!(c!==a.width&&a.map[d]===a.map[d+1]||0!==u&&a.map[d-1]===a.map[d-1-a.width])){var p=a.map[d],f=l+p+o.nodeAt(p).nodeSize-1,h=document.createElement("div");h.className="column-resize-handle",n.push(s.Decoration.widget(f,h))}}return s.DecorationSet.create(e.doc,n)}(e,t.activeHandle)}return s.DecorationSet.empty},nodeViews:{}}})};var u=function(){function e(e,t){this.activeHandle=e,this.dragging=t}return e.prototype.apply=function(t){var n,r=this,o=t.getMeta(c.tableColumnResizeKey);if(o&&null!=o.setHandle)return new e(o.setHandle,null);if(o&&void 0!==o.setDragging)return new e(r.activeHandle,o.setDragging);if(r.activeHandle>-1&&t.docChanged){var i=t.mapping.map(r.activeHandle,-1);n=t.doc.resolve(i),Boolean("row"===n.parent.type.spec.tableRole&&n.nodeAfter)||(i=-1),r=new e(i,r.dragging)}return r},e}();function d(e,t,n){var r=e.posAtCoords({left:t.clientX,top:t.clientY});if(!r)return-1;var o=e.state.doc.resolve(r.pos),s=c.parentNode(o,(function(e){return"table"===e.type.spec.tableRole}));if(null===s)return-1;var a=o.start(s.depth),l=s.node,u=i.TableMap.get(l);return a+u.map[u.width*n.rowIndex+n.cellIndex]}function p(e,t,n){var r=t.clientX-e.startX;return Math.max(n,e.startWidth+r)}function f(e,t){e.dispatch(e.state.tr.setMeta(c.tableColumnResizeKey,{setHandle:t}))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6),o=n(21),i=n(16),s=function(){function e(e,t){this.node=e,this.view=t,this.dom=document.createElement("div"),this.dom.className=r.resizableWrap,this.table=this.dom.appendChild(document.createElement("table")),e.attrs[r.colgroupAttr]&&this.renderColgroup(e.attrs[r.colgroupAttr]);var n=this.table.appendChild(document.createElement("tbody"));this.setAttributes(this.table,e.attrs),this.resizeHandles=i.handles.map((function(e){var t=document.createElement("span");return t.className=r.resizeHandle+" "+e,t.setAttribute(r.dataResizeDirTable,e),t})),this.contentDOM=n}return e.prototype.update=function(e){var t=this;if(e.type!==this.node.type)return!1;var n=this.node;return this.node=e,e.attrs[r.resizableAttr]?this.resizeHandles.forEach((function(e){t.dom.appendChild(e)})):Array.from(this.dom.children).filter((function(e){return e.classList.contains(r.resizeHandle)})).forEach((function(e){return e.remove()})),this.setAttributes(this.table,e.attrs),n.attrs[r.colgroupAttr]!==e.attrs[r.colgroupAttr]&&this.renderColgroup(e.attrs[r.colgroupAttr]),!0},e.prototype.ignoreMutation=function(e){return"attributes"===e.type&&(e.target===this.table||e.target.firstChild===this.table||this.colgroup&&this.colgroup.contains(e.target))},e.prototype.destroy=function(){this.node=void 0,this.view=void 0,this.table=void 0,this.colgroup=void 0,this.resizeHandles=void 0},e.prototype.renderColgroup=function(e){this.table&&this.table.firstChild&&"COLGROUP"===this.table.firstChild.nodeName&&this.table.removeChild(this.table.firstChild),e&&(this.colgroup=o.parseStrColgroup(e),this.table.insertBefore(this.colgroup,this.table.firstChild))},e.prototype.setAttributes=function(e,t){var n=[r.colgroupAttr,r.resizableAttr];for(var o in t)if(o&&-1===n.indexOf(o)){var i=e.getAttribute(o),s=t[o];s&&s!==i?e.setAttribute(o,s):s||e.removeAttribute(o)}},e}();t.TableView=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4),o=n(1),i=n(6),s=n(12),a=n(16),l={southeast:!0,southwest:!0,northwest:!0,northeast:!0},c=r.__assign({east:!0,west:!0},l),u=r.__assign({south:!0,north:!0},l),d=function(){function e(e,t,n){this.activeHandle=e,this.dragging=t,this.nodePosition=n}return e.prototype.apply=function(t){var n=t.getMeta(s.tableResizeKey);return n?new e(n.activeHandle,n.setDragging,n.nodePosition):this},e}(),p=function(e){var t=Array.from(e.firstChild.children).map((function(e){return e.offsetWidth})),n=Array.from(e.rows).map((function(e){return e.offsetHeight})),r=t.reduce((function(e,t){return e+t}),0),o=n.reduce((function(e,t){return e+t}),0),i=e.offsetHeight;return{width:r,height:o,colsWidth:t,rowsHeight:n,offsetWidth:e.offsetWidth,offsetHeight:i}},f=function(e){var t=s.tableResizeKey.getState(e.state),n=t.dragging,o=t.nodePosition,a=t.activeHandle;if(n){var l=e.state.doc.nodeAt(o),d=s.getTable(e.nodeDOM(o)),f=p(d);if(l){var h=f.offsetWidth+"px",m=f.offsetHeight+"px",v=e.state.tr,g=l.attrs,y=s.parseStyle(g.style);c[a]&&d.style.width&&y.width!==h&&(g=s.setNodeStyle(g,"width",h)),u[a]&&d.style.height&&y.height!==m&&(g=s.setNodeStyle(g,"height",m)),g=function(e,t,n,o){var a=e.state.doc.nodeAt(n),l=s.getTable(e.nodeDOM(n)),c=(l.ownerDocument&&l.ownerDocument.defaultView||window).getComputedStyle,u=Array.from(l.rows);a.forEach((function(e,r,o){var i=s.parseStyle(e.attrs.style).height;i&&!/px$/.test(i)&&t.setNodeMarkup(n+r+1,null,s.setNodeStyle(e.attrs,"height",c(u[o]).height))}));var d=l.firstChild,p=Array.from(d&&d.children||[]),f=!1;p.forEach((function(e,t){e.style.width&&!/px$/.test(e.style.width)&&(e.style.width=c(p[t]).width,f=!0)}));var h=r.__assign({},o);return f&&(h[i.colgroupAttr]=d.outerHTML),h}(e,v,o,g),v.setNodeMarkup(o,null,g),v.setMeta("commandName","node-resize"),v.setMeta("args",g),v.setMeta(s.tableResizeKey,{setDragging:null,activeHandle:null,nodePosition:o}),e.dispatch(v)}}},h=function(e,t){var n=t.target.getAttribute(i.dataResizeDirTable);if(!n)return!1;var r=s.tableResizeKey.getState(e.state);t.preventDefault();var o=e.state.tr;o.setMeta(s.tableResizeKey,{setDragging:{startX:t.clientX,startY:t.clientY},activeHandle:n,nodePosition:r.nodePosition}),o.setMeta("addToHistory",!1),function(e,t,n){var r=e.state.doc.nodeAt(n),o=s.getTable(e.nodeDOM(n)),a=p(o),l=a.width,c=a.height,u=a.colsWidth,d=a.rowsHeight,f=a.offsetWidth,h=a.offsetHeight,m=o.firstChild,v=Array.from(m&&m.children||[]),g=!1;v.forEach((function(e,t){e.style.width&&!/%$/.test(e.style.width)&&(e.style.width=100*u[t]/l+"%",g=!0)}));var y=!1;r.forEach((function(e,r,o){var i=s.parseStyle(e.attrs.style).height;i&&!/%$/.test(i)&&(t.setNodeMarkup(n+r+1,null,s.setNodeStyle(e.attrs,"height",100*d[o]/c+"%")),y=!0)}));var w=r.attrs;s.parseStyle(w.style).width!==f+"px"&&(w=s.setNodeStyle(w,"width",f+"px")),g&&(w[i.colgroupAttr]=m.outerHTML),y&&(w=s.setNodeStyle(w,"height",h+"px")),(g||y)&&t.setNodeMarkup(n,null,w)}(e,o,r.nodePosition),e.dispatch(o);var l=t.view||window;function d(t){!function(e,t){var n=s.tableResizeKey.getState(e.state),r=n.dragging,o=n.nodePosition,i=n.activeHandle;if(!(o<0)&&r){var l=s.getTable(e.nodeDOM(o)),d=l.getBoundingClientRect(),p=a.directions[i],f=(t.clientX-r.startX)*p.x,h=(t.clientY-r.startY)*p.y,m=(l.ownerDocument&&l.ownerDocument.defaultView||window).getComputedStyle(l),v=/px/.test(m.width)?parseFloat(m.width):l.offsetWidth,g=/px/.test(m.height)?parseFloat(m.height):l.offsetHeight,y=p.x?f+v:d.width,w=p.y?h+g:d.height;r.startX=p.x?t.clientX:r.startX,r.startY=p.y?t.clientY:r.startY,c[i]&&(l.style.width=y+"px"),u[i]&&(l.style.height=w+"px")}}(e,t)}return l.addEventListener("mouseup",(function t(n){l.removeEventListener("mouseup",t),l.removeEventListener("mousemove",d),f(e)})),l.addEventListener("mousemove",d),!0};t.tableResizing=function(e){return void 0===e&&(e={node:"table"}),new o.Plugin({key:s.tableResizeKey,view:function(t){return{selectedNode:function(e,t){var n=e.selection;if(n instanceof o.NodeSelection&&t===n.node.type&&n instanceof o.NodeSelection)return{node:n.node,pos:n.from};var r=s.parentNode(n.$from,(function(e){return e.type===t})),i=r&&r.node;if(i){var a=new Array(n.$from.depth+1).fill(0).findIndex((function(e,t){return"table"===n.$from.node(t).type.spec.tableRole}));return{node:i,pos:n.$from.start(a)-1}}return null},update:function(t,n){var o,a,l,c,u,d=t.state,p=d.schema.nodes[e.node],f=this.selectedNode(d,p),h=this.selectedNode(n,p);if((f||!h||n.doc.eq(t.state.doc))&&(f||h)){var m=d.tr;f&&h&&f.pos!==h.pos?(m.setMeta(s.tableResizeKey,{nodePosition:f.pos}),m.setNodeMarkup(h.pos,p,r.__assign({},h.node.attrs,((o={})[i.resizableAttr]=!1,o))),m.setNodeMarkup(f.pos,p,r.__assign({},f.node.attrs,((a={})[i.resizableAttr]=!0,a))),t.dispatch(m)):f&&h&&f.pos===h.pos&&!f.node.attrs[i.resizableAttr]&&!d.selection.eq(n.selection)?(m.setMeta(s.tableResizeKey,{nodePosition:f.pos}),t.dispatch(m.setNodeMarkup(f.pos,p,r.__assign({},f.node.attrs,((l={})[i.resizableAttr]=!0,l))))):f&&!h?(m.setMeta(s.tableResizeKey,{nodePosition:f.pos}),t.dispatch(m.setNodeMarkup(f.pos,p,r.__assign({},f.node.attrs,((c={})[i.resizableAttr]=!0,c))))):!f&&h&&(m.setMeta(s.tableResizeKey,{nodePosition:-1}),t.dispatch(m.setNodeMarkup(h.pos,p,r.__assign({},h.node.attrs,((u={})[i.resizableAttr]=!1,u)))))}}}},state:{init:function(){return new d("",null,-1)},apply:function(e,t){return t.apply(e)}},props:{handleDOMEvents:{mousedown:function(e,t){return h(e,t)}}}})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),o=n(8),i=n(3),s=n(12),a=function(){function e(){}return e.prototype.ignoreMutation=function(e){return"attributes"===e.type&&"style"===e.attributeName&&"TR"===e.target.nodeName},e}();t.rowResizing=function(){return new r.Plugin({key:s.tableRowResizeKey,state:{init:function(e,t){return this.spec.props.nodeViews[o.tableNodeTypes(t.schema).row.name]=function(e,t){return new a},new l(-1,null)},apply:function(e,t){return t.apply(e)}},props:{attributes:function(e){return s.otherResizeHandle(s.tableRowResizeKey,e)?null:s.tableRowResizeKey.getState(e).activeHandle>-1?{class:"resize-cursor-vertical"}:null},handleDOMEvents:{mousemove:function(e,t){return s.otherResizing(s.tableRowResizeKey,e.state)||function(e,t,n){var r=s.tableRowResizeKey.getState(e.state);if(!r.dragging){var o=s.domCellAround(t.target),i=-1;if(o){var a=o.parentNode,l=a.getBoundingClientRect();Math.abs(t.clientY-l.top)<=n&&a.rowIndex>0?i=c(e,t,a.rowIndex-1):l.bottom-t.clientY>0&&l.bottom-t.clientY<=n&&(i=c(e,t,a.rowIndex))}i!==r.activeHandle&&u(e,i)}}(e,t,5),!1},mouseleave:function(e){return function(e){var t=s.tableRowResizeKey.getState(e.state);t.activeHandle>-1&&!t.dragging&&u(e,-1)}(e),!1},mousedown:function(e,t){return function(e,t){var n=s.tableRowResizeKey.getState(e.state);if(-1===n.activeHandle||n.dragging)return!1;var r=e.state.doc,o=r.resolve(n.activeHandle),i=r.nodeAt(n.activeHandle),a=o.parent,l=s.parseStyle(i.attrs.style).height,c=s.parseStyle(a.attrs.style).height,u=l?parseFloat(l):0;if(!l){var d=e.nodeDOM(n.activeHandle);u=d.offsetHeight}function p(t){t.view.removeEventListener("mouseup",p),t.view.removeEventListener("mousemove",f);var n=s.tableRowResizeKey.getState(e.state);if(n.dragging){var r=e.state.tr.setMeta(s.tableRowResizeKey,{setDragging:null});!function(e,t,n){var r=e.state.doc,o=r.nodeAt(n),i=e.nodeDOM(n),a=i.ownerDocument&&i.ownerDocument.defaultView||window;i.style.height=a.getComputedStyle(i).height,t.setNodeMarkup(n,null,s.setNodeStyle(o.attrs,"height",i.style.height));var l=i&&i.closest("table"),c=l&&l.style.height;if(c){var u=r.resolve(n),d=u.start(u.depth)-1;t.setNodeMarkup(d,null,s.setNodeStyle(u.parent.attrs,"height",c))}}(e,r,n.activeHandle),e.dispatch(r)}}function f(t){if(!t.which)return p(t);var n=s.tableRowResizeKey.getState(e.state),r=function(e,t){var n=t.clientY-e.startY;return e.startHeight.rowHeight+n}(n.dragging,t),o=t.clientY-n.dragging.startY;!function(e,t,n,r,o){var i=e.nodeDOM(t);if(i){i.style.height=n+"px";var s=i.ownerDocument&&i.ownerDocument.defaultView||window;i.style.height=s.getComputedStyle(i).height;var a=i.closest("table"),l=parseFloat(o)+r+"px",c=a&&a.style.height;c&&c!==l&&(a.style.height=parseFloat(o)+r+"px",a.style.height=s.getComputedStyle(a).height)}}(e,n.activeHandle,r,o,c)}return e.dispatch(e.state.tr.setMeta(s.tableRowResizeKey,{setDragging:{startY:t.clientY,startHeight:{rowHeight:u,tableHeight:c}}})),t.view.addEventListener("mouseup",p),t.view.addEventListener("mousemove",f),t.preventDefault(),!0}(e,t)}},decorations:function(e){if(s.otherResizing(s.tableRowResizeKey,e))return i.DecorationSet.empty;var t=s.tableRowResizeKey.getState(e);return t.activeHandle>-1?function(e,t){var n=[];if("number"!=typeof t)return i.DecorationSet.empty;for(var r=e.doc.resolve(t),s=r.parent,a=o.TableMap.get(s),l=r.index(r.depth),c=r.start(r.depth),u=0;u<a.width;u++){var d=u+l*a.width,p=a.map[d],f=s.nodeAt(p),h=c+p+(f?f.nodeSize:0)-1,m=document.createElement("div");m.className="row-resize-handle",n.push(i.Decoration.widget(h,m))}return i.DecorationSet.create(e.doc,n)}(e,t.activeHandle):void 0},nodeViews:{}}})};var l=function(){function e(e,t){this.activeHandle=e,this.dragging=t}return e.prototype.apply=function(t){var n,r=this,o=t.getMeta(s.tableRowResizeKey);if(o&&null!=o.setHandle)return new e(o.setHandle,null);if(o&&void 0!==o.setDragging)return new e(r.activeHandle,o.setDragging);if(r.activeHandle>-1){var i=t.mapping.map(r.activeHandle,-1);"row"===(n=t.doc.resolve(i)).parent.type.spec.tableRole&&n.nodeAfter||(i=null),r=new e(i,r.dragging)}return r},e}();function c(e,t,n){var r=e.posAtCoords({left:t.clientX,top:t.clientY});if(!r)return-1;var i=e.state.doc.resolve(r.pos),a=s.parentNode(i,(function(e){return"table"===e.type.spec.tableRole}));if(null===a)return-1;var l=i.start(a.depth),c=a.node,u=o.TableMap.get(c);return l+u.map[u.width*n]-1}function u(e,t){e.dispatch(e.state.tr.setMeta(s.tableRowResizeKey,{setHandle:t}))}},function(e,t,n){"use strict";n.r(t),n.d(t,"dropCursor",(function(){return i}));var r=n(1),o=n(2);function i(e){return void 0===e&&(e={}),new r.Plugin({view:function(t){return new s(t,e)}})}var s=function(e,t){var n=this;this.editorView=e,this.width=t.width||1,this.color=t.color||"black",this.class=t.class,this.cursorPos=null,this.element=null,this.timeout=null,this.handlers=["dragover","dragend","drop","dragleave"].map((function(t){var r=function(e){return n[t](e)};return e.dom.addEventListener(t,r),{name:t,handler:r}}))};s.prototype.destroy=function(){var e=this;this.handlers.forEach((function(t){var n=t.name,r=t.handler;return e.editorView.dom.removeEventListener(n,r)}))},s.prototype.update=function(e,t){null!=this.cursorPos&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())},s.prototype.setCursor=function(e){e!=this.cursorPos&&(this.cursorPos=e,null==e?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())},s.prototype.updateOverlay=function(){var e,t=this.editorView.state.doc.resolve(this.cursorPos);if(!t.parent.inlineContent){var n=t.nodeBefore,r=t.nodeAfter;if(n||r){var o=this.editorView.nodeDOM(this.cursorPos-(n?n.nodeSize:0)).getBoundingClientRect(),i=n?o.bottom:o.top;n&&r&&(i=(i+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),e={left:o.left,right:o.right,top:i-this.width/2,bottom:i+this.width/2}}}if(!e){var s=this.editorView.coordsAtPos(this.cursorPos);e={left:s.left-this.width/2,right:s.left+this.width/2,top:s.top,bottom:s.bottom}}var a,l,c=this.editorView.dom.offsetParent;if(this.element||(this.element=c.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none; background-color: "+this.color),!c||c==document.body&&"static"==getComputedStyle(c).position)a=-pageXOffset,l=-pageYOffset;else{var u=c.getBoundingClientRect();a=u.left-c.scrollLeft,l=u.top-c.scrollTop}this.element.style.left=e.left-a+"px",this.element.style.top=e.top-l+"px",this.element.style.width=e.right-e.left+"px",this.element.style.height=e.bottom-e.top+"px"},s.prototype.scheduleRemoval=function(e){var t=this;clearTimeout(this.timeout),this.timeout=setTimeout((function(){return t.setCursor(null)}),e)},s.prototype.dragover=function(e){if(this.editorView.editable){var t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),r=n&&n.type.spec.disableDropCursor,i="function"==typeof r?r(this.editorView,t):r;if(t&&!i){var s=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice&&null==(s=Object(o.dropPoint)(this.editorView.state.doc,s,this.editorView.dragging.slice)))return this.setCursor(null);this.setCursor(s),this.scheduleRemoval(5e3)}}},s.prototype.dragend=function(){this.scheduleRemoval(20)},s.prototype.drop=function(){this.scheduleRemoval(20)},s.prototype.dragleave=function(e){e.target!=this.editorView.dom&&this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}},function(e,t,n){"use strict";n.r(t),n.d(t,"GapCursor",(function(){return a})),n.d(t,"gapCursor",(function(){return c}));var r=n(9),o=n(1),i=n(0),s=n(3),a=function(e){function t(t){e.call(this,t,t)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.map=function(n,r){var o=n.resolve(r.map(this.head));return t.valid(o)?new t(o):e.near(o)},t.prototype.content=function(){return i.Slice.empty},t.prototype.eq=function(e){return e instanceof t&&e.head==this.head},t.prototype.toJSON=function(){return{type:"gapcursor",pos:this.head}},t.fromJSON=function(e,n){if("number"!=typeof n.pos)throw new RangeError("Invalid input for GapCursor.fromJSON");return new t(e.resolve(n.pos))},t.prototype.getBookmark=function(){return new l(this.anchor)},t.valid=function(e){var t=e.parent;if(t.isTextblock||!function(e){for(var t=e.depth;t>=0;t--){var n=e.index(t),r=e.node(t);if(0!=n)for(var o=r.child(n-1);;o=o.lastChild){if(0==o.childCount&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}else if(r.type.spec.isolating)return!0}return!0}(e)||!function(e){for(var t=e.depth;t>=0;t--){var n=e.indexAfter(t),r=e.node(t);if(n!=r.childCount)for(var o=r.child(n);;o=o.firstChild){if(0==o.childCount&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}else if(r.type.spec.isolating)return!0}return!0}(e))return!1;var n=t.type.spec.allowGapCursor;if(null!=n)return n;var r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock},t.findFrom=function(e,n,r){e:for(;;){if(!r&&t.valid(e))return e;for(var i=e.pos,s=null,a=e.depth;;a--){var l=e.node(a);if(n>0?e.indexAfter(a)<l.childCount:e.index(a)>0){s=l.child(n>0?e.indexAfter(a):e.index(a)-1);break}if(0==a)return null;i+=n;var c=e.doc.resolve(i);if(t.valid(c))return c}for(;;){var u=n>0?s.firstChild:s.lastChild;if(!u){if(s.isAtom&&!s.isText&&!o.NodeSelection.isSelectable(s)){e=e.doc.resolve(i+s.nodeSize*n),r=!1;continue e}break}s=u,i+=n;var d=e.doc.resolve(i);if(t.valid(d))return d}return null}},t}(o.Selection);a.prototype.visible=!1,o.Selection.jsonID("gapcursor",a);var l=function(e){this.pos=e};l.prototype.map=function(e){return new l(e.map(this.pos))},l.prototype.resolve=function(e){var t=e.resolve(this.pos);return a.valid(t)?new a(t):o.Selection.near(t)};var c=function(){return new o.Plugin({props:{decorations:h,createSelectionBetween:function(e,t,n){if(t.pos==n.pos&&a.valid(n))return new a(n)},handleClick:p,handleKeyDown:u,handleDOMEvents:{beforeinput:f}}})},u=Object(r.keydownHandler)({ArrowLeft:d("horiz",-1),ArrowRight:d("horiz",1),ArrowUp:d("vert",-1),ArrowDown:d("vert",1)});function d(e,t){var n="vert"==e?t>0?"down":"up":t>0?"right":"left";return function(e,r,i){var s=e.selection,l=t>0?s.$to:s.$from,c=s.empty;if(s instanceof o.TextSelection){if(!i.endOfTextblock(n)||0==l.depth)return!1;c=!1,l=e.doc.resolve(t>0?l.after():l.before())}var u=a.findFrom(l,t,c);return!!u&&(r&&r(e.tr.setSelection(new a(u))),!0)}}function p(e,t,n){if(!e.editable)return!1;var r=e.state.doc.resolve(t);if(!a.valid(r))return!1;var i=e.posAtCoords({left:n.clientX,top:n.clientY}).inside;return!(i>-1&&o.NodeSelection.isSelectable(e.state.doc.nodeAt(i)))&&(e.dispatch(e.state.tr.setSelection(new a(r))),!0)}function f(e,t){if("insertCompositionText"!=t.inputType||!(e.state.selection instanceof a))return!1;var n=e.state.selection.$from,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;for(var s=i.Fragment.empty,l=r.length-1;l>=0;l--)s=i.Fragment.from(r[l].createAndFill(null,s));var c=e.state.tr.replace(n.pos,n.pos,new i.Slice(s,0,0));return c.setSelection(o.TextSelection.near(c.doc.resolve(n.pos+1))),e.dispatch(c),!1}function h(e){if(!(e.selection instanceof a))return null;var t=document.createElement("div");return t.className="ProseMirror-gapcursor",s.DecorationSet.create(e.doc,[s.Decoration.widget(e.selection.head,t,{key:"gapcursor"})])}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(8);t.pmAddRowAfter=r.addRowAfter,t.pmAddRowBefore=r.addRowBefore;var o=n(6);t.createTable=function(e,t,n){for(var r,o=e.table,i=e.table_row,s=e.table_cell,a=[],l=0;l<t+1;l++){r=[];for(var c=0;c<n+1;c++)r.push(s.createAndFill());a.push(i.createAndFill(void 0,r))}return o.createAndFill(void 0,a)};var i=function(e,t){for(var n=e.$head,r=n.depth;r>0;r--){var o=n.node(r);if(o.type.name===t)return{pos:n.before(r),node:o}}return null};t.addRowBefore=function(e,t){var n=t&&function(e){var n,r=i(e.selection,"table_row"),s=i(e.selection,"table");if(r&&s&&r.node.attrs[o.rowTypeAttr]){for(var a=0,l=0;l<s.node.nodeSize;l++)if(s.node.child(l).eq(r.node)){a=l;break}var c=s.node.child(a-1),u=r.pos-c.nodeSize;e.setNodeMarkup(u,void 0,((n={})[o.rowTypeAttr]=r.node.attrs[o.rowTypeAttr],n))}return t(e)};return r.addRowBefore(e,n)},t.addRowAfter=function(e,t){var n=t&&function(e){var n,r=i(e.selection,"table_row");if(r&&r.node.attrs[o.rowTypeAttr]){var s=r.pos+r.node.nodeSize;e.setNodeMarkup(s,void 0,((n={})[o.rowTypeAttr]=r.node.attrs[o.rowTypeAttr],n))}return t(e)};return r.addRowAfter(e,n)}}])}));
|
|
16
|
+
var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function o(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var i=function(){return(i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function s(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function a(e,t,n,r){var o,i=arguments.length,s=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(i<3?o(s):i>3?o(t,n,s):o(t,n))||s);return i>3&&s&&Object.defineProperty(t,n,s),s}function l(e,t){return function(n,r){t(n,r,e)}}function c(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function u(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{l(r.next(e))}catch(e){i(e)}}function a(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))}function d(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}function p(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}function f(e,t){for(var n in e)"default"===n||t.hasOwnProperty(n)||(t[n]=e[n])}function h(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function m(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return s}function v(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(m(arguments[t]));return e}function g(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),o=0;for(t=0;t<n;t++)for(var i=arguments[t],s=0,a=i.length;s<a;s++,o++)r[o]=i[s];return r}function y(e){return this instanceof y?(this.v=e,this):new y(e)}function w(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,o=n.apply(e,t||[]),i=[];return r={},s("next"),s("throw"),s("return"),r[Symbol.asyncIterator]=function(){return this},r;function s(e){o[e]&&(r[e]=function(t){return new Promise((function(n,r){i.push([e,t,n,r])>1||a(e,t)}))})}function a(e,t){try{(n=o[e](t)).value instanceof y?Promise.resolve(n.value.v).then(l,c):u(i[0][2],n)}catch(e){u(i[0][3],e)}var n}function l(e){a("next",e)}function c(e){a("throw",e)}function u(e,t){e(t),i.shift(),i.length&&a(i[0][0],i[0][1])}}function b(e){var t,n;return t={},r("next"),r("throw",(function(e){throw e})),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,o){t[r]=e[r]?function(t){return(n=!n)?{value:y(e[r](t)),done:"return"===r}:o?o(t):t}:o}}function S(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=h(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,o){(function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,o,(t=e[n](t)).done,t.value)}))}}}function k(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function x(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function C(e){return e&&e.__esModule?e:{default:e}}function M(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}function O(e,t,n){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,n),n}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(13);t.changeStylesString=function(e,t){var n=t.style,r=t.value,o=t.newValue;if(!e)return{changed:!1,style:null};var i=e.split(/\s*;\s*/).filter((function(e){return Boolean(e)})),s=i.filter((function(e){var t=e.split(/\s*:\s*/);return!(t[0].toLowerCase()===n&&r.test(t[1]))}));return o&&s.push(n+": "+o),{style:s.join("; ")+(s.length?";":""),changed:Boolean(o)||s.length!==i.length}},t.canInsert=function(e,t){for(var n=e.selection.$from,r=n.depth;r>=0;r--){var o=n.index(r);if(n.node(r).canReplaceWith(o,o,t))return!0}return!1};var s=function(e){return e instanceof r.Node?e.type.name:e.name};t.findNthParentNodeOfType=function(e,t){return void 0===t&&(t=1),function(n){return function(e,t){return void 0===t&&(t=1),function(n){for(var r=n.$from,o=r.depth;o>0;o--){var i=r.node(o);if(e(i)&&0===(t-=1))return{depth:o,node:i}}}}((function(t){return s(t)===s(e)}),t)(n)}},t.insertNode=function(e,t){return function(n,r){var o=n.tr.replaceSelectionWith(e);t&&o.scrollIntoView(),r(o)}},t.hasSameMarkup=function(e,t,n,o){var s=r.Fragment.from(i.parseContent(e,n,o)),a=r.Fragment.from(i.parseContent(t,n,o));return s.eq(a)},t.getSelectionText=function(e){var t=e.selection;if(t instanceof o.TextSelection||t instanceof o.AllSelection){var n=t.content().content;return n.textBetween(0,n.size)}return""},t.getNodeFromSelection=function(e){if(e.selection instanceof o.NodeSelection)return e.selection.node},t.selectedLineTextOnly=function(e){var n="",r=!1,o=e.selection,i=e.doc,s=o.$from,a=o.$to,l=o.from,c=o.to;return s.sameParent(a)&&(i.nodesBetween(l,c,(function(e){r=r||e.isLeaf&&!e.isText})),r||(n=t.getSelectionText(e))),n},t.indentHtml=function(e){return e.replace(/<\/(p|li|ul|ol|h[1-6]|table|tr|td|th)>/gi,"</$1>\n").replace(/<(ul|ol)([^>]*)><li/gi,"<$1$2>\n<li").replace(/<br \/>/gi,"<br />\n").replace(/\n$/,"")},t.shallowEqual=function(e,t){var n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every((function(n){return e[n]===t[n]}))};var a={before:/[^ !,?.\[\]{}()]+$/i,after:/^[^ !,?.\[\]{}()]+/i};t.expandSelection=function(e,t,n){if(!n.applyToWord||!e.selection.empty)return{state:e,dispatch:t};var r=!0===n.applyToWord?a:n.applyToWord,i=null,s=e.tr,l=e.selection,c=l.$head.nodeBefore,u=l.$head.nodeAfter;if(c&&"text"===c.type.name&&c.text&&u&&"text"===u.type.name&&u.text){var d=[];l.$head.parent.descendants((function(e,t){return d.push({node:e,pos:t}),!1}));for(var p=l.$head.parentOffset,f=d.findIndex((function(e){var t=e.node,n=e.pos;return n<=p&&n+t.nodeSize>=p})),h=d[f].node.text,m=!1,v=f-1;v>=0;v--){var g=d[v];!m&&g&&"text"===g.node.type.name?h=g.node.text+h:(m=!0,p-=g.node.nodeSize)}for(v=f+1;v<d.length;v++){if(!(g=d[v])||"text"!==g.node.type.name)break;h+=g.node.text}var y=h.substring(0,p),w=h.substring(p),b=r.before.exec(y),S=r.after.exec(w);if(b&&S){var k=b[0].length,x=S[0].length,C=i=l.from;s.setSelection(o.TextSelection.create(e.doc,C-k,C+x));return{state:{tr:s,selection:s.selection,doc:s.doc,storedMarks:null,schema:s.doc.type.schema},dispatch:function(e){e.setSelection(o.TextSelection.create(e.doc,i)),t(e)}}}}return{state:e,dispatch:t}},t.expandToWordWrap=function(e,n){return function(r,o,i){var s=t.expandSelection(r,o,n),a=s.state,l=s.dispatch;return e(n)(a,l)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.rowTypeAttr="k-parent-node",t.colgroupAttr="k-colgroup-data",t.resizableAttr="k-resizable-node",t.resizableWrap="k-editor-resize-wrap-element",t.resizeHandle="k-editor-resize-handle",t.dataResizeDirTable="data-dir-table-resize",t.dataResizeDirImage="data-dir-image-resize"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2),o=n(0);t.markApplies=function(e,t,n){for(var r=function(r){var o=t[r],i=o.$from,s=o.$to,a=0===i.depth&&e.type.allowsMarkType(n);if(e.nodesBetween(i.pos,s.pos,(function(e){if(a)return!1;a=e.inlineContent&&e.type.allowsMarkType(n)})),a)return{v:!0}},o=0;o<t.length;o++){var i=r(o);if(i)return i.v}return!1},t.toggleMark=function(e,n,r){return function(o,i){var s=o.selection,a=s.empty,l=s.$cursor,c=s.ranges;if(a&&!l||!t.markApplies(o.doc,c,e))return!1;if(i)if(l)e.isInSet(o.storedMarks||l.marks())?i(r.removeStoredMark(e)):i(r.addStoredMark(e.create(n)));else{for(var u=!1,d=0;!u&&d<c.length;d++){var p=c[d],f=p.$from,h=p.$to;u=o.doc.rangeHasMark(f.pos,h.pos,e)}for(d=0;d<c.length;d++){var m=c[d];f=m.$from,h=m.$to;u?r.removeMark(f.pos,h.pos,e):r.addMark(f.pos,h.pos,e.create(n))}i(r.scrollIntoView())}return!0}},t.removeMark=function(e,t,n,i){void 0===i&&(i=null);var s=[],a=0;return e.doc.nodesBetween(t,n,(function(e,r){if(e.isInline){a++;var l=null;if(i instanceof o.MarkType){var c=i.isInSet(e.marks);c&&(l=[c])}else i?i.isInSet(e.marks)&&(l=[i]):l=e.marks;if(l&&l.length)for(var u=Math.min(r+e.nodeSize,n),d=0;d<l.length;d++){for(var p=l[d],f=void 0,h=0;h<s.length;h++){var m=s[h];m.step===a-1&&p.eq(m.style)&&(f=m)}f?(f.to=u,f.step=a):s.push({style:p,from:Math.max(r,t),to:u,step:a})}}})),s.forEach((function(t){return e.step(new r.RemoveMarkStep(t.from,t.to,t.style))})),e},t.removeMarks=function(e,n,r,o){var i=n.selection,s=i.$cursor,a=i.ranges;if(o=o||n.tr,s)e.forEach((function(e){e.isInSet(n.storedMarks||s.marks())&&r(o.removeStoredMark(e))}));else{for(var l=function(n){var r=a[n],i=r.$from,s=r.$to;e.forEach((function(e){t.removeMark(o,i.pos,s.pos,e)}))},c=0;c<a.length;c++)l(c);r(o.scrollIntoView())}return!0};t.removeAllMarks=function(e){var n=(void 0===e?{}:e).except,r=void 0===n?[]:n;return function(e,n){var o,i=e.tr;t.cleanMarks(i,{except:(o=r,o instanceof Array?o:[o])}),i.docChanged&&n(i)}},t.cleanMarks=function(e,t){var n=t.except,r=e.doc,o=e.selection,i=r.type.schema,s=o.empty,a=o.ranges,l=(n||[]).map((function(e){return e.name}));if(!s){var c=Object.keys(i.marks).map((function(e){return i.marks[e]})).filter((function(e){return-1===l.indexOf(e.name)}));a.forEach((function(t){var n=t.$from,r=t.$to;c.forEach((function(t){return e.removeMark(n.pos,r.pos,t)}))}))}},t.hasMark=function(e,n){var r,o=e.schema.marks,i=(n.altMarks||[]).filter((function(e){return o[e]})),s=n.altStyle,a=e.selection,l=a.from,c=a.$from,u=a.to,d=a.empty,p=o[n.mark],f=e.doc,h=!1;return d?(r=e.storedMarks||c.marks(),h=p&&p.isInSet(r)||i.some((function(e){return o[e].isInSet(r)}))):h=p&&f.rangeHasMark(l,u,p)||i.some((function(e){return f.rangeHasMark(l,u,o[e])})),!h&&s&&o.style?t.selectionMarks(e,o.style).some((function(e){return null!==t.styleValue(e,s)})):Boolean(h)},t.styleValue=function(e,t){for(var n=(e&&e.attrs.style||"").split(/\s*;\s*/).filter((function(e){return Boolean(e)})),r=0;r<n.length;r++){var o=n[r].split(/\s*:\s*/);if(o[0].toLowerCase()===t.name&&t.value.test(o[1]))return o[1]}return null},t.selectionMarks=function(e,t){var n=e.selection,r=n.from,o=n.$from,i=n.to,s=n.empty,a=[];return s?a.push(t.isInSet(e.storedMarks||o.marks())):e.doc.nodesBetween(r,i,(function(e){e.isInline&&a.push(t.isInSet(e.marks))})),a},t.getMark=function(e,n){var r=t.selectionMarks(e,n),o=r.filter((function(e){return Boolean(e)}));return r.length===o.length?r[0]:void 0},t.getActiveMarks=function(e,n){var r=t.selectionMarks(e,n),o=r.filter((function(e){return Boolean(e)}));return{hasNodesWithoutMarks:r.length!==o.length,marks:o}}},function(e,t,n){"use strict";n.r(t),n.d(t,"CellSelection",(function(){return _})),n.d(t,"TableMap",(function(){return h})),n.d(t,"TableView",(function(){return Oe})),n.d(t,"__clipCells",(function(){return B})),n.d(t,"__insertCells",(function(){return j})),n.d(t,"__pastedCells",(function(){return $})),n.d(t,"addColSpan",(function(){return E})),n.d(t,"addColumn",(function(){return re})),n.d(t,"addColumnAfter",(function(){return ie})),n.d(t,"addColumnBefore",(function(){return oe})),n.d(t,"addRow",(function(){return ce})),n.d(t,"addRowAfter",(function(){return de})),n.d(t,"addRowBefore",(function(){return ue})),n.d(t,"cellAround",(function(){return S})),n.d(t,"colCount",(function(){return A})),n.d(t,"columnIsHeader",(function(){return z})),n.d(t,"columnResizing",(function(){return Ne})),n.d(t,"columnResizingPluginKey",(function(){return Ae})),n.d(t,"deleteColumn",(function(){return ae})),n.d(t,"deleteRow",(function(){return fe})),n.d(t,"deleteTable",(function(){return Me})),n.d(t,"findCell",(function(){return T})),n.d(t,"fixTables",(function(){return te})),n.d(t,"fixTablesKey",(function(){return ee})),n.d(t,"goToNextCell",(function(){return Ce})),n.d(t,"handlePaste",(function(){return U})),n.d(t,"inSameTable",(function(){return O})),n.d(t,"isInTable",(function(){return k})),n.d(t,"mergeCells",(function(){return me})),n.d(t,"moveCellForward",(function(){return M})),n.d(t,"nextCell",(function(){return N})),n.d(t,"pointsAtCell",(function(){return C})),n.d(t,"removeColSpan",(function(){return D})),n.d(t,"removeColumn",(function(){return se})),n.d(t,"removeRow",(function(){return pe})),n.d(t,"rowIsHeader",(function(){return le})),n.d(t,"selectedRect",(function(){return ne})),n.d(t,"selectionCell",(function(){return x})),n.d(t,"setAttr",(function(){return R})),n.d(t,"setCellAttr",(function(){return ye})),n.d(t,"splitCell",(function(){return ve})),n.d(t,"splitCellWithType",(function(){return ge})),n.d(t,"tableEditing",(function(){return Ie})),n.d(t,"tableEditingKey",(function(){return b})),n.d(t,"tableNodeTypes",(function(){return w})),n.d(t,"tableNodes",(function(){return y})),n.d(t,"toggleHeader",(function(){return be})),n.d(t,"toggleHeaderCell",(function(){return xe})),n.d(t,"toggleHeaderColumn",(function(){return ke})),n.d(t,"toggleHeaderRow",(function(){return Se})),n.d(t,"updateColumnsOnResize",(function(){return Te}));var r,o,i=n(1),s=n(0),a=n(9),l=n(3),c=n(2);if("undefined"!=typeof WeakMap){var u=new WeakMap;r=function(e){return u.get(e)},o=function(e,t){return u.set(e,t),t}}else{var d=[],p=0;r=function(e){for(var t=0;t<d.length;t+=2)if(d[t]==e)return d[t+1]},o=function(e,t){return 10==p&&(p=0),d[p++]=e,d[p++]=t}}var f=function(e,t,n,r){this.left=e,this.top=t,this.right=n,this.bottom=r},h=function(e,t,n,r){this.width=e,this.height=t,this.map=n,this.problems=r};function m(e){if(e.colwidth)return e.colwidth.slice();for(var t=[],n=0;n<e.colspan;n++)t.push(0);return t}function v(e,t){var n=e.getAttribute("data-colwidth"),r=n&&/^\d+(,\d+)*$/.test(n)?n.split(",").map((function(e){return Number(e)})):null,o=Number(e.getAttribute("colspan")||1),i={colspan:o,rowspan:Number(e.getAttribute("rowspan")||1),colwidth:r&&r.length==o?r:null};for(var s in t){var a=t[s].getFromDOM,l=a&&a(e);null!=l&&(i[s]=l)}return i}function g(e,t){var n={};for(var r in 1!=e.attrs.colspan&&(n.colspan=e.attrs.colspan),1!=e.attrs.rowspan&&(n.rowspan=e.attrs.rowspan),e.attrs.colwidth&&(n["data-colwidth"]=e.attrs.colwidth.join(",")),t){var o=t[r].setDOMAttr;o&&o(e.attrs[r],n)}return n}function y(e){var t=e.cellAttributes||{},n={colspan:{default:1},rowspan:{default:1},colwidth:{default:null}};for(var r in t)n[r]={default:t[r].default};return{table:{content:"table_row+",tableRole:"table",isolating:!0,group:e.tableGroup,parseDOM:[{tag:"table"}],toDOM:function(){return["table",["tbody",0]]}},table_row:{content:"(table_cell | table_header)*",tableRole:"row",parseDOM:[{tag:"tr"}],toDOM:function(){return["tr",0]}},table_cell:{content:e.cellContent,attrs:n,tableRole:"cell",isolating:!0,parseDOM:[{tag:"td",getAttrs:function(e){return v(e,t)}}],toDOM:function(e){return["td",g(e,t),0]}},table_header:{content:e.cellContent,attrs:n,tableRole:"header_cell",isolating:!0,parseDOM:[{tag:"th",getAttrs:function(e){return v(e,t)}}],toDOM:function(e){return["th",g(e,t),0]}}}}function w(e){var t=e.cached.tableNodeTypes;if(!t)for(var n in t=e.cached.tableNodeTypes={},e.nodes){var r=e.nodes[n],o=r.spec.tableRole;o&&(t[o]=r)}return t}h.prototype.findCell=function(e){for(var t=0;t<this.map.length;t++){var n=this.map[t];if(n==e){for(var r=t%this.width,o=t/this.width|0,i=r+1,s=o+1,a=1;i<this.width&&this.map[t+a]==n;a++)i++;for(var l=1;s<this.height&&this.map[t+this.width*l]==n;l++)s++;return new f(r,o,i,s)}}throw new RangeError("No cell with offset "+e+" found")},h.prototype.colCount=function(e){for(var t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw new RangeError("No cell with offset "+e+" found")},h.prototype.nextCell=function(e,t,n){var r=this.findCell(e),o=r.left,i=r.right,s=r.top,a=r.bottom;return"horiz"==t?(n<0?0==o:i==this.width)?null:this.map[s*this.width+(n<0?o-1:i)]:(n<0?0==s:a==this.height)?null:this.map[o+this.width*(n<0?s-1:a)]},h.prototype.rectBetween=function(e,t){var n=this.findCell(e),r=n.left,o=n.right,i=n.top,s=n.bottom,a=this.findCell(t),l=a.left,c=a.right,u=a.top,d=a.bottom;return new f(Math.min(r,l),Math.min(i,u),Math.max(o,c),Math.max(s,d))},h.prototype.cellsInRect=function(e){for(var t=[],n={},r=e.top;r<e.bottom;r++)for(var o=e.left;o<e.right;o++){var i=r*this.width+o,s=this.map[i];n[s]||(n[s]=!0,o==e.left&&o&&this.map[i-1]==s||r==e.top&&r&&this.map[i-this.width]==s||t.push(s))}return t},h.prototype.positionAt=function(e,t,n){for(var r=0,o=0;;r++){var i=o+n.child(r).nodeSize;if(r==e){for(var s=t+e*this.width,a=(e+1)*this.width;s<a&&this.map[s]<o;)s++;return s==a?i-1:this.map[s]}o=i}},h.get=function(e){return r(e)||o(e,function(e){if("table"!=e.type.spec.tableRole)throw new RangeError("Not a table node: "+e.type.name);for(var t=function(e){for(var t=-1,n=!1,r=0;r<e.childCount;r++){var o=e.child(r),i=0;if(n)for(var s=0;s<r;s++)for(var a=e.child(s),l=0;l<a.childCount;l++){var c=a.child(l);s+c.attrs.rowspan>r&&(i+=c.attrs.colspan)}for(var u=0;u<o.childCount;u++){var d=o.child(u);i+=d.attrs.colspan,d.attrs.rowspan>1&&(n=!0)}-1==t?t=i:t!=i&&(t=Math.max(t,i))}return t}(e),n=e.childCount,r=[],o=0,i=null,s=[],a=0,l=t*n;a<l;a++)r[a]=0;for(var c=0,u=0;c<n;c++){var d=e.child(c);u++;for(var p=0;;p++){for(;o<r.length&&0!=r[o];)o++;if(p==d.childCount)break;for(var f=d.child(p),v=f.attrs,g=v.colspan,y=v.rowspan,w=v.colwidth,b=0;b<y;b++){if(b+c>=n){(i||(i=[])).push({type:"overlong_rowspan",pos:u,n:y-b});break}for(var S=o+b*t,k=0;k<g;k++){0==r[S+k]?r[S+k]=u:(i||(i=[])).push({type:"collision",row:c,pos:u,n:g-k});var x=w&&w[k];if(x){var C=(S+k)%t*2,M=s[C];null==M||M!=x&&1==s[C+1]?(s[C]=x,s[C+1]=1):M==x&&s[C+1]++}}}o+=g,u+=f.nodeSize}for(var O=(c+1)*t,T=0;o<O;)0==r[o++]&&T++;T&&(i||(i=[])).push({type:"missing",row:c,n:T}),u++}for(var A=new h(t,n,r,i),N=!1,R=0;!N&&R<s.length;R+=2)null!=s[R]&&s[R+1]<n&&(N=!0);N&&function(e,t,n){e.problems||(e.problems=[]);for(var r=0,o={};r<e.map.length;r++){var i=e.map[r];if(!o[i]){o[i]=!0;for(var s=n.nodeAt(i),a=null,l=0;l<s.attrs.colspan;l++){var c=(r+l)%e.width,u=t[2*c];null==u||s.attrs.colwidth&&s.attrs.colwidth[l]==u||((a||(a=m(s.attrs)))[l]=u)}a&&e.problems.unshift({type:"colwidth mismatch",pos:i,colwidth:a})}}}(A,s,e);return A}(e))};var b=new i.PluginKey("selectingCells");function S(e){for(var t=e.depth-1;t>0;t--)if("row"==e.node(t).type.spec.tableRole)return e.node(0).resolve(e.before(t+1));return null}function k(e){for(var t=e.selection.$head,n=t.depth;n>0;n--)if("row"==t.node(n).type.spec.tableRole)return!0;return!1}function x(e){var t=e.selection;return t.$anchorCell?t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell:t.node&&"cell"==t.node.type.spec.tableRole?t.$anchor:S(t.$head)||function(e){for(var t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){var r=t.type.spec.tableRole;if("cell"==r||"header_cell"==r)return e.doc.resolve(n)}for(var o=e.nodeBefore,i=e.pos;o;o=o.lastChild,i--){var s=o.type.spec.tableRole;if("cell"==s||"header_cell"==s)return e.doc.resolve(i-o.nodeSize)}}(t.$head)}function C(e){return"row"==e.parent.type.spec.tableRole&&e.nodeAfter}function M(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function O(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function T(e){return h.get(e.node(-1)).findCell(e.pos-e.start(-1))}function A(e){return h.get(e.node(-1)).colCount(e.pos-e.start(-1))}function N(e,t,n){var r=e.start(-1),o=h.get(e.node(-1)).nextCell(e.pos-r,t,n);return null==o?null:e.node(0).resolve(r+o)}function R(e,t,n){var r={};for(var o in e)r[o]=e[o];return r[t]=n,r}function D(e,t,n){void 0===n&&(n=1);var r=R(e,"colspan",e.colspan-n);return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(t,n),r.colwidth.some((function(e){return e>0}))||(r.colwidth=null)),r}function E(e,t,n){void 0===n&&(n=1);var r=R(e,"colspan",e.colspan+n);if(r.colwidth){r.colwidth=r.colwidth.slice();for(var o=0;o<n;o++)r.colwidth.splice(t,0,0)}return r}function z(e,t,n){for(var r=w(t.type.schema).header_cell,o=0;o<e.height;o++)if(t.nodeAt(e.map[n+o*e.width]).type!=r)return!1;return!0}var _=function(e){function t(t,n){void 0===n&&(n=t);var r=t.node(-1),o=h.get(r),s=t.start(-1),a=o.rectBetween(t.pos-s,n.pos-s),l=t.node(0),c=o.cellsInRect(a).filter((function(e){return e!=n.pos-s}));c.unshift(n.pos-s);var u=c.map((function(e){var t=r.nodeAt(e),n=e+s+1;return new i.SelectionRange(l.resolve(n),l.resolve(n+t.content.size))}));e.call(this,u[0].$from,u[0].$to,u),this.$anchorCell=t,this.$headCell=n}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.map=function(e,n){var r=e.resolve(n.map(this.$anchorCell.pos)),o=e.resolve(n.map(this.$headCell.pos));if(C(r)&&C(o)&&O(r,o)){var s=this.$anchorCell.node(-1)!=r.node(-1);return s&&this.isRowSelection()?t.rowSelection(r,o):s&&this.isColSelection()?t.colSelection(r,o):new t(r,o)}return i.TextSelection.between(r,o)},t.prototype.content=function(){for(var e=this.$anchorCell.node(-1),t=h.get(e),n=this.$anchorCell.start(-1),r=t.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),o={},i=[],a=r.top;a<r.bottom;a++){for(var l=[],c=a*t.width+r.left,u=r.left;u<r.right;u++,c++){var d=t.map[c];if(!o[d]){o[d]=!0;var p=t.findCell(d),f=e.nodeAt(d),m=r.left-p.left,v=p.right-r.right;if(m>0||v>0){var g=f.attrs;m>0&&(g=D(g,0,m)),v>0&&(g=D(g,g.colspan-v,v)),f=p.left<r.left?f.type.createAndFill(g):f.type.create(g,f.content)}if(p.top<r.top||p.bottom>r.bottom){var y=R(f.attrs,"rowspan",Math.min(p.bottom,r.bottom)-Math.max(p.top,r.top));f=p.top<r.top?f.type.createAndFill(y):f.type.create(y,f.content)}l.push(f)}}i.push(e.child(a).copy(s.Fragment.from(l)))}var w=this.isColSelection()&&this.isRowSelection()?e:i;return new s.Slice(s.Fragment.from(w),1,1)},t.prototype.replace=function(t,n){void 0===n&&(n=s.Slice.empty);for(var r=t.steps.length,o=this.ranges,i=0;i<o.length;i++){var a=o[i],l=a.$from,c=a.$to,u=t.mapping.slice(r);t.replace(u.map(l.pos),u.map(c.pos),i?s.Slice.empty:n)}var d=e.findFrom(t.doc.resolve(t.mapping.slice(r).map(this.to)),-1);d&&t.setSelection(d)},t.prototype.replaceWith=function(e,t){this.replace(e,new s.Slice(s.Fragment.from(t),0,0))},t.prototype.forEachCell=function(e){for(var t=this.$anchorCell.node(-1),n=h.get(t),r=this.$anchorCell.start(-1),o=n.cellsInRect(n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r)),i=0;i<o.length;i++)e(t.nodeAt(o[i]),r+o[i])},t.prototype.isColSelection=function(){var e=this.$anchorCell.index(-1),t=this.$headCell.index(-1);if(Math.min(e,t)>0)return!1;var n=e+this.$anchorCell.nodeAfter.attrs.rowspan,r=t+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,r)==this.$headCell.node(-1).childCount},t.colSelection=function(e,n){void 0===n&&(n=e);var r=h.get(e.node(-1)),o=e.start(-1),i=r.findCell(e.pos-o),s=r.findCell(n.pos-o),a=e.node(0);return i.top<=s.top?(i.top>0&&(e=a.resolve(o+r.map[i.left])),s.bottom<r.height&&(n=a.resolve(o+r.map[r.width*(r.height-1)+s.right-1]))):(s.top>0&&(n=a.resolve(o+r.map[s.left])),i.bottom<r.height&&(e=a.resolve(o+r.map[r.width*(r.height-1)+i.right-1]))),new t(e,n)},t.prototype.isRowSelection=function(){var e=h.get(this.$anchorCell.node(-1)),t=this.$anchorCell.start(-1),n=e.colCount(this.$anchorCell.pos-t),r=e.colCount(this.$headCell.pos-t);if(Math.min(n,r)>0)return!1;var o=n+this.$anchorCell.nodeAfter.attrs.colspan,i=r+this.$headCell.nodeAfter.attrs.colspan;return Math.max(o,i)==e.width},t.prototype.eq=function(e){return e instanceof t&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos},t.rowSelection=function(e,n){void 0===n&&(n=e);var r=h.get(e.node(-1)),o=e.start(-1),i=r.findCell(e.pos-o),s=r.findCell(n.pos-o),a=e.node(0);return i.left<=s.left?(i.left>0&&(e=a.resolve(o+r.map[i.top*r.width])),s.right<r.width&&(n=a.resolve(o+r.map[r.width*(s.top+1)-1]))):(s.left>0&&(n=a.resolve(o+r.map[s.top*r.width])),i.right<r.width&&(e=a.resolve(o+r.map[r.width*(i.top+1)-1]))),new t(e,n)},t.prototype.toJSON=function(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}},t.fromJSON=function(e,n){return new t(e.resolve(n.anchor),e.resolve(n.head))},t.create=function(e,n,r){return void 0===r&&(r=n),new t(e.resolve(n),e.resolve(r))},t.prototype.getBookmark=function(){return new I(this.$anchorCell.pos,this.$headCell.pos)},t}(i.Selection);_.prototype.visible=!1,i.Selection.jsonID("cell",_);var I=function(e,t){this.anchor=e,this.head=t};function P(e){if(!(e.selection instanceof _))return null;var t=[];return e.selection.forEachCell((function(e,n){t.push(l.Decoration.node(n,n+e.nodeSize,{class:"selectedCell"}))})),l.DecorationSet.create(e.doc,t)}function $(e){if(!e.size)return null;for(var t=e.content,n=e.openStart,r=e.openEnd;1==t.childCount&&(n>0&&r>0||"table"==t.firstChild.type.spec.tableRole);)n--,r--,t=t.firstChild.content;var o=t.firstChild,i=o.type.spec.tableRole,a=o.type.schema,l=[];if("row"==i)for(var c=0;c<t.childCount;c++){var u=t.child(c).content,d=c?0:Math.max(0,n-1),p=c<t.childCount-1?0:Math.max(0,r-1);(d||p)&&(u=F(w(a).row,new s.Slice(u,d,p)).content),l.push(u)}else{if("cell"!=i&&"header_cell"!=i)return null;l.push(n||r?F(w(a).row,new s.Slice(t,n,r)).content:t)}return function(e,t){for(var n=[],r=0;r<t.length;r++)for(var o=t[r],i=o.childCount-1;i>=0;i--)for(var a=o.child(i).attrs,l=a.rowspan,c=a.colspan,u=r;u<r+l;u++)n[u]=(n[u]||0)+c;for(var d=0,p=0;p<n.length;p++)d=Math.max(d,n[p]);for(var f=0;f<n.length;f++)if(f>=t.length&&t.push(s.Fragment.empty),n[f]<d){for(var h=w(e).cell.createAndFill(),m=[],v=n[f];v<d;v++)m.push(h);t[f]=t[f].append(s.Fragment.from(m))}return{height:t.length,width:d,rows:t}}(a,l)}function F(e,t){var n=e.createAndFill();return new c.Transform(n).replace(0,n.content.size,t).doc}function B(e,t,n){var r=e.width,o=e.height,i=e.rows;if(r!=t){for(var a=[],l=[],c=0;c<i.length;c++){for(var u=i[c],d=[],p=a[c]||0,f=0;p<t;f++){var h=u.child(f%u.childCount);p+h.attrs.colspan>t&&(h=h.type.create(D(h.attrs,h.attrs.colspan,p+h.attrs.colspan-t),h.content)),d.push(h),p+=h.attrs.colspan;for(var m=1;m<h.attrs.rowspan;m++)a[c+m]=(a[c+m]||0)+h.attrs.colspan}l.push(s.Fragment.from(d))}i=l,r=t}if(o!=n){for(var v=[],g=0,y=0;g<n;g++,y++){for(var w=[],b=i[y%o],S=0;S<b.childCount;S++){var k=b.child(S);g+k.attrs.rowspan>n&&(k=k.type.create(R(k.attrs,"rowspan",Math.max(1,n-k.attrs.rowspan)),k.content)),w.push(k)}v.push(s.Fragment.from(w))}i=v,o=n}return{width:r,height:o,rows:i}}function L(e,t,n,r,o,i,s,a){if(0==s||s==t.height)return!1;for(var l=!1,c=o;c<i;c++){var u=s*t.width+c,d=t.map[u];if(t.map[u-t.width]==d){l=!0;var p=n.nodeAt(d),f=t.findCell(d),h=f.top,m=f.left;e.setNodeMarkup(e.mapping.slice(a).map(d+r),null,R(p.attrs,"rowspan",s-h)),e.insert(e.mapping.slice(a).map(t.positionAt(s,m,n)),p.type.createAndFill(R(p.attrs,"rowspan",h+p.attrs.rowspan-s))),c+=p.attrs.colspan-1}}return l}function V(e,t,n,r,o,i,s,a){if(0==s||s==t.width)return!1;for(var l=!1,c=o;c<i;c++){var u=c*t.width+s,d=t.map[u];if(t.map[u-1]==d){l=!0;var p=n.nodeAt(d),f=t.colCount(d),h=e.mapping.slice(a).map(d+r);e.setNodeMarkup(h,null,D(p.attrs,s-f,p.attrs.colspan-(s-f))),e.insert(h+p.nodeSize,p.type.createAndFill(D(p.attrs,0,s-f))),c+=p.attrs.rowspan-1}}return l}function j(e,t,n,r,o){var i=n?e.doc.nodeAt(n-1):e.doc,a=h.get(i),l=r.top,c=r.left,u=c+o.width,d=l+o.height,p=e.tr,f=0;function m(){i=n?p.doc.nodeAt(n-1):p.doc,a=h.get(i),f=p.mapping.maps.length}(function(e,t,n,r,o,i,a){var l,c,u=w(e.doc.type.schema);if(o>t.width)for(var d=0,p=0;d<t.height;d++){var f=n.child(d);p+=f.nodeSize;var h=[],m=void 0;m=null==f.lastChild||f.lastChild.type==u.cell?l||(l=u.cell.createAndFill()):c||(c=u.header_cell.createAndFill());for(var v=t.width;v<o;v++)h.push(m);e.insert(e.mapping.slice(a).map(p-1+r),h)}if(i>t.height){for(var g=[],y=0,b=(t.height-1)*t.width;y<Math.max(t.width,o);y++){var S=!(y>=t.width)&&n.nodeAt(t.map[b+y]).type==u.header_cell;g.push(S?c||(c=u.header_cell.createAndFill()):l||(l=u.cell.createAndFill()))}for(var k=u.row.create(null,s.Fragment.from(g)),x=[],C=t.height;C<i;C++)x.push(k);e.insert(e.mapping.slice(a).map(r+n.nodeSize-2),x)}return!(!l&&!c)})(p,a,i,n,u,d,f)&&m(),L(p,a,i,n,c,u,l,f)&&m(),L(p,a,i,n,c,u,d,f)&&m(),V(p,a,i,n,l,d,c,f)&&m(),V(p,a,i,n,l,d,u,f)&&m();for(var v=l;v<d;v++){var g=a.positionAt(v,c,i),y=a.positionAt(v,u,i);p.replace(p.mapping.slice(f).map(g+n),p.mapping.slice(f).map(y+n),new s.Slice(o.rows[v-l],0,0))}m(),p.setSelection(new _(p.doc.resolve(n+a.positionAt(l,c,i)),p.doc.resolve(n+a.positionAt(d-1,u-1,i)))),t(p)}I.prototype.map=function(e){return new I(e.map(this.anchor),e.map(this.head))},I.prototype.resolve=function(e){var t=e.resolve(this.anchor),n=e.resolve(this.head);return"row"==t.parent.type.spec.tableRole&&"row"==n.parent.type.spec.tableRole&&t.index()<t.parent.childCount&&n.index()<n.parent.childCount&&O(t,n)?new _(t,n):i.Selection.near(n,1)};var K=Object(a.keydownHandler)({ArrowLeft:W("horiz",-1),ArrowRight:W("horiz",1),ArrowUp:W("vert",-1),ArrowDown:W("vert",1),"Shift-ArrowLeft":q("horiz",-1),"Shift-ArrowRight":q("horiz",1),"Shift-ArrowUp":q("vert",-1),"Shift-ArrowDown":q("vert",1),Backspace:J,"Mod-Backspace":J,Delete:J,"Mod-Delete":J});function H(e,t,n){return!n.eq(e.selection)&&(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function W(e,t){return function(n,r,o){var s=n.selection;if(s instanceof _)return H(n,r,i.Selection.near(s.$headCell,t));if("horiz"!=e&&!s.empty)return!1;var a=G(o,e,t);if(null==a)return!1;if("horiz"==e)return H(n,r,i.Selection.near(n.doc.resolve(s.head+t),t));var l,c=n.doc.resolve(a),u=N(c,e,t);return l=u?i.Selection.near(u,1):t<0?i.Selection.near(n.doc.resolve(c.before(-1)),-1):i.Selection.near(n.doc.resolve(c.after(-1)),1),H(n,r,l)}}function q(e,t){return function(n,r,o){var i=n.selection;if(!(i instanceof _)){var s=G(o,e,t);if(null==s)return!1;i=new _(n.doc.resolve(s))}var a=N(i.$headCell,e,t);return!!a&&H(n,r,new _(i.$anchorCell,a))}}function J(e,t){var n=e.selection;if(!(n instanceof _))return!1;if(t){var r=e.tr,o=w(e.schema).cell.createAndFill().content;n.forEachCell((function(e,t){e.content.eq(o)||r.replace(r.mapping.map(t+1),r.mapping.map(t+e.nodeSize-1),new s.Slice(o,0,0))})),r.docChanged&&t(r)}return!0}function X(e,t){var n=S(e.state.doc.resolve(t));return!!n&&(e.dispatch(e.state.tr.setSelection(new _(n))),!0)}function U(e,t,n){if(!k(e.state))return!1;var r=$(n),o=e.state.selection;if(o instanceof _){r||(r={width:1,height:1,rows:[s.Fragment.from(F(w(e.state.schema).cell,n))]});var i=o.$anchorCell.node(-1),a=o.$anchorCell.start(-1),l=h.get(i).rectBetween(o.$anchorCell.pos-a,o.$headCell.pos-a);return r=B(r,l.right-l.left,l.bottom-l.top),j(e.state,e.dispatch,a,l,r),!0}if(r){var c=x(e.state),u=c.start(-1);return j(e.state,e.dispatch,u,h.get(c.node(-1)).findCell(c.pos-u),r),!0}return!1}function Y(e,t){if(!t.ctrlKey&&!t.metaKey){var n,r=Q(e,t.target);if(t.shiftKey&&e.state.selection instanceof _)o(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&r&&null!=(n=S(e.state.selection.$anchor))&&Z(e,t).pos!=n.pos)o(n,t),t.preventDefault();else if(!r)return;e.root.addEventListener("mouseup",i),e.root.addEventListener("dragstart",i),e.root.addEventListener("mousemove",s)}function o(t,n){var r=Z(e,n),o=null==b.getState(e.state);if(!r||!O(t,r)){if(!o)return;r=t}var i=new _(t,r);if(o||!e.state.selection.eq(i)){var s=e.state.tr.setSelection(i);o&&s.setMeta(b,t.pos),e.dispatch(s)}}function i(){e.root.removeEventListener("mouseup",i),e.root.removeEventListener("dragstart",i),e.root.removeEventListener("mousemove",s),null!=b.getState(e.state)&&e.dispatch(e.state.tr.setMeta(b,-1))}function s(n){var s,a=b.getState(e.state);if(null!=a)s=e.state.doc.resolve(a);else if(Q(e,n.target)!=r&&!(s=Z(e,t)))return i();s&&o(s,n)}}function G(e,t,n){if(!(e.state.selection instanceof i.TextSelection))return null;for(var r=e.state.selection.$head,o=r.depth-1;o>=0;o--){var s=r.node(o);if((n<0?r.index(o):r.indexAfter(o))!=(n<0?0:s.childCount))return null;if("cell"==s.type.spec.tableRole||"header_cell"==s.type.spec.tableRole){var a=r.before(o),l="vert"==t?n>0?"down":"up":n>0?"right":"left";return e.endOfTextblock(l)?a:null}}return null}function Q(e,t){for(;t&&t!=e.dom;t=t.parentNode)if("TD"==t.nodeName||"TH"==t.nodeName)return t}function Z(e,t){var n=e.posAtCoords({left:t.clientX,top:t.clientY});return n&&n?S(e.state.doc.resolve(n.pos)):null}var ee=new i.PluginKey("fix-tables");function te(e,t){var n,r=function(t,r){"table"==t.type.spec.tableRole&&(n=function(e,t,n,r){var o=h.get(t);if(!o.problems)return r;r||(r=e.tr);for(var i,s,a=[],l=0;l<o.height;l++)a.push(0);for(var c=0;c<o.problems.length;c++){var u=o.problems[c];if("collision"==u.type){for(var d=t.nodeAt(u.pos),p=0;p<d.attrs.rowspan;p++)a[u.row+p]+=u.n;r.setNodeMarkup(r.mapping.map(n+1+u.pos),null,D(d.attrs,d.attrs.colspan-u.n,u.n))}else if("missing"==u.type)a[u.row]+=u.n;else if("overlong_rowspan"==u.type){var f=t.nodeAt(u.pos);r.setNodeMarkup(r.mapping.map(n+1+u.pos),null,R(f.attrs,"rowspan",f.attrs.rowspan-u.n))}else if("colwidth mismatch"==u.type){var m=t.nodeAt(u.pos);r.setNodeMarkup(r.mapping.map(n+1+u.pos),null,R(m.attrs,"colwidth",u.colwidth))}}for(var v=0;v<a.length;v++)a[v]&&(null==i&&(i=v),s=v);for(var g=0,y=n+1;g<o.height;g++){var b=t.child(g),S=y+b.nodeSize,k=a[g];if(k>0){var x="cell";b.firstChild&&(x=b.firstChild.type.spec.tableRole);for(var C=[],M=0;M<k;M++)C.push(w(e.schema)[x].createAndFill());var O=0!=g&&i!=g-1||s!=g?S-1:y+1;r.insert(r.mapping.map(O),C)}y=S}return r.setMeta(ee,{fixTables:!0})}(e,t,r,n))};return t?t.doc!=e.doc&&function e(t,n,r,o){var i=t.childCount,s=n.childCount;e:for(var a=0,l=0;a<s;a++){for(var c=n.child(a),u=l,d=Math.min(i,a+3);u<d;u++)if(t.child(u)==c){l=u+1,r+=c.nodeSize;continue e}o(c,r),l<i&&t.child(l).sameMarkup(c)?e(t.child(l),c,r+1,o):c.nodesBetween(0,c.content.size,o,r+1),r+=c.nodeSize}}(t.doc,e.doc,0,r):e.doc.descendants(r),n}function ne(e){var t,n=e.selection,r=x(e),o=r.node(-1),i=r.start(-1),s=h.get(o);return(t=n instanceof _?s.rectBetween(n.$anchorCell.pos-i,n.$headCell.pos-i):s.findCell(r.pos-i)).tableStart=i,t.map=s,t.table=o,t}function re(e,t,n){var r=t.map,o=t.tableStart,i=t.table,s=n>0?-1:0;z(r,i,n+s)&&(s=0==n||n==r.width?null:0);for(var a=0;a<r.height;a++){var l=a*r.width+n;if(n>0&&n<r.width&&r.map[l-1]==r.map[l]){var c=r.map[l],u=i.nodeAt(c);e.setNodeMarkup(e.mapping.map(o+c),null,E(u.attrs,n-r.colCount(c))),a+=u.attrs.rowspan-1}else{var d=null==s?w(i.type.schema).cell:i.nodeAt(r.map[l+s]).type,p=r.positionAt(a,n,i);e.insert(e.mapping.map(o+p),d.createAndFill())}}return e}function oe(e,t){if(!k(e))return!1;if(t){var n=ne(e);t(re(e.tr,n,n.left))}return!0}function ie(e,t){if(!k(e))return!1;if(t){var n=ne(e);t(re(e.tr,n,n.right))}return!0}function se(e,t,n){for(var r=t.map,o=t.table,i=t.tableStart,s=e.mapping.maps.length,a=0;a<r.height;){var l=a*r.width+n,c=r.map[l],u=o.nodeAt(c);if(n>0&&r.map[l-1]==c||n<r.width-1&&r.map[l+1]==c)e.setNodeMarkup(e.mapping.slice(s).map(i+c),null,D(u.attrs,n-r.colCount(c)));else{var d=e.mapping.slice(s).map(i+c);e.delete(d,d+u.nodeSize)}a+=u.attrs.rowspan}}function ae(e,t){if(!k(e))return!1;if(t){var n=ne(e),r=e.tr;if(0==n.left&&n.right==n.map.width)return!1;for(var o=n.right-1;se(r,n,o),o!=n.left;o--)n.table=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc,n.map=h.get(n.table);t(r)}return!0}function le(e,t,n){for(var r=w(t.type.schema).header_cell,o=0;o<e.width;o++)if(t.nodeAt(e.map[o+n*e.width]).type!=r)return!1;return!0}function ce(e,t,n){for(var r=t.map,o=t.tableStart,i=t.table,s=o,a=0;a<n;a++)s+=i.child(a).nodeSize;var l=[],c=n>0?-1:0;le(r,i,n+c)&&(c=0==n||n==r.height?null:0);for(var u=0,d=r.width*n;u<r.width;u++,d++)if(n>0&&n<r.height&&r.map[d]==r.map[d-r.width]){var p=r.map[d],f=i.nodeAt(p).attrs;e.setNodeMarkup(o+p,null,R(f,"rowspan",f.rowspan+1)),u+=f.colspan-1}else{var h=null==c?w(i.type.schema).cell:i.nodeAt(r.map[d+c*r.width]).type;l.push(h.createAndFill())}return e.insert(s,w(i.type.schema).row.create(null,l)),e}function ue(e,t){if(!k(e))return!1;if(t){var n=ne(e);t(ce(e.tr,n,n.top))}return!0}function de(e,t){if(!k(e))return!1;if(t){var n=ne(e);t(ce(e.tr,n,n.bottom))}return!0}function pe(e,t,n){for(var r=t.map,o=t.table,i=t.tableStart,s=0,a=0;a<n;a++)s+=o.child(a).nodeSize;var l=s+o.child(n).nodeSize,c=e.mapping.maps.length;e.delete(s+i,l+i);for(var u=0,d=n*r.width;u<r.width;u++,d++){var p=r.map[d];if(n>0&&p==r.map[d-r.width]){var f=o.nodeAt(p).attrs;e.setNodeMarkup(e.mapping.slice(c).map(p+i),null,R(f,"rowspan",f.rowspan-1)),u+=f.colspan-1}else if(n<r.width&&p==r.map[d+r.width]){var h=o.nodeAt(p),m=h.type.create(R(h.attrs,"rowspan",h.attrs.rowspan-1),h.content),v=r.positionAt(n+1,u,o);e.insert(e.mapping.slice(c).map(i+v),m),u+=h.attrs.colspan-1}}}function fe(e,t){if(!k(e))return!1;if(t){var n=ne(e),r=e.tr;if(0==n.top&&n.bottom==n.map.height)return!1;for(var o=n.bottom-1;pe(r,n,o),o!=n.top;o--)n.table=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc,n.map=h.get(n.table);t(r)}return!0}function he(e){var t=e.content;return 1==t.childCount&&t.firstChild.isTextblock&&0==t.firstChild.childCount}function me(e,t){var n=e.selection;if(!(n instanceof _)||n.$anchorCell.pos==n.$headCell.pos)return!1;var r=ne(e),o=r.map;if(function(e,t){for(var n=e.width,r=e.height,o=e.map,i=t.top*n+t.left,s=i,a=(t.bottom-1)*n+t.left,l=i+(t.right-t.left-1),c=t.top;c<t.bottom;c++){if(t.left>0&&o[s]==o[s-1]||t.right<n&&o[l]==o[l+1])return!0;s+=n,l+=n}for(var u=t.left;u<t.right;u++){if(t.top>0&&o[i]==o[i-n]||t.bottom<r&&o[a]==o[a+n])return!0;i++,a++}return!1}(o,r))return!1;if(t){for(var i,a,l=e.tr,c={},u=s.Fragment.empty,d=r.top;d<r.bottom;d++)for(var p=r.left;p<r.right;p++){var f=o.map[d*o.width+p],h=r.table.nodeAt(f);if(!c[f])if(c[f]=!0,null==i)i=f,a=h;else{he(h)||(u=u.append(h.content));var m=l.mapping.map(f+r.tableStart);l.delete(m,m+h.nodeSize)}}if(l.setNodeMarkup(i+r.tableStart,null,R(E(a.attrs,a.attrs.colspan,r.right-r.left-a.attrs.colspan),"rowspan",r.bottom-r.top)),u.size){var v=i+1+a.content.size,g=he(a)?i+1:v;l.replaceWith(g+r.tableStart,v+r.tableStart,u)}l.setSelection(new _(l.doc.resolve(i+r.tableStart))),t(l)}return!0}function ve(e,t){var n=w(e.schema);return ge((function(e){var t=e.node;return n[t.type.spec.tableRole]}))(e,t)}function ge(e){return function(t,n){var r,o,i=t.selection;if(i instanceof _){if(i.$anchorCell.pos!=i.$headCell.pos)return!1;r=i.$anchorCell.nodeAfter,o=i.$anchorCell.pos}else{if(!(r=function(e){for(var t=e.depth;t>0;t--){var n=e.node(t).type.spec.tableRole;if("cell"===n||"header_cell"===n)return e.node(t)}return null}(i.$from)))return!1;o=S(i.$from).pos}if(1==r.attrs.colspan&&1==r.attrs.rowspan)return!1;if(n){var s=r.attrs,a=[],l=s.colwidth;s.rowspan>1&&(s=R(s,"rowspan",1)),s.colspan>1&&(s=R(s,"colspan",1));for(var c,u=ne(t),d=t.tr,p=0;p<u.right-u.left;p++)a.push(l?R(s,"colwidth",l&&l[p]?[l[p]]:null):s);for(var f=u.top;f<u.bottom;f++){var h=u.map.positionAt(f,u.left,u.table);f==u.top&&(h+=r.nodeSize);for(var m=u.left,v=0;m<u.right;m++,v++)m==u.left&&f==u.top||d.insert(c=d.mapping.map(h+u.tableStart,1),e({node:r,row:f,col:m}).createAndFill(a[v]))}d.setNodeMarkup(o,e({node:r,row:u.top,col:u.left}),a[0]),i instanceof _&&d.setSelection(new _(d.doc.resolve(i.$anchorCell.pos),c&&d.doc.resolve(c))),n(d)}return!0}}function ye(e,t){return function(n,r){if(!k(n))return!1;var o=x(n);if(o.nodeAfter.attrs[e]===t)return!1;if(r){var i=n.tr;n.selection instanceof _?n.selection.forEachCell((function(n,r){n.attrs[e]!==t&&i.setNodeMarkup(r,null,R(n.attrs,e,t))})):i.setNodeMarkup(o.pos,null,R(o.nodeAfter.attrs,e,t)),r(i)}return!0}}function we(e,t,n){for(var r=t.map.cellsInRect({left:0,top:0,right:"row"==e?t.map.width:1,bottom:"column"==e?t.map.height:1}),o=0;o<r.length;o++){var i=t.table.nodeAt(r[o]);if(i&&i.type!==n.header_cell)return!1}return!0}function be(e,t){return(t=t||{useDeprecatedLogic:!1}).useDeprecatedLogic?function(e){return function(t,n){if(!k(t))return!1;if(n){for(var r=w(t.schema),o=ne(t),i=t.tr,s=o.map.cellsInRect("column"==e?new f(o.left,0,o.right,o.map.height):"row"==e?new f(0,o.top,o.map.width,o.bottom):o),a=s.map((function(e){return o.table.nodeAt(e)})),l=0;l<s.length;l++)a[l].type==r.header_cell&&i.setNodeMarkup(o.tableStart+s[l],r.cell,a[l].attrs);if(0==i.steps.length)for(var c=0;c<s.length;c++)i.setNodeMarkup(o.tableStart+s[c],r.header_cell,a[c].attrs);n(i)}return!0}}(e):function(t,n){if(!k(t))return!1;if(n){var r=w(t.schema),o=ne(t),i=t.tr,s=we("row",o,r),a=we("column",o,r),l=("column"===e?s:"row"===e&&a)?1:0,c="column"==e?new f(0,l,1,o.map.height):"row"==e?new f(l,0,o.map.width,1):o,u="column"==e?a?r.cell:r.header_cell:"row"==e?s?r.cell:r.header_cell:r.cell;o.map.cellsInRect(c).forEach((function(e){var t=e+o.tableStart,n=i.doc.nodeAt(t);n&&i.setNodeMarkup(t,u,n.attrs)})),n(i)}return!0}}var Se=be("row",{useDeprecatedLogic:!0}),ke=be("column",{useDeprecatedLogic:!0}),xe=be("cell",{useDeprecatedLogic:!0});function Ce(e){return function(t,n){if(!k(t))return!1;var r=function(e,t){if(t<0){var n=e.nodeBefore;if(n)return e.pos-n.nodeSize;for(var r=e.index(-1)-1,o=e.before();r>=0;r--){var i=e.node(-1).child(r);if(i.childCount)return o-1-i.lastChild.nodeSize;o-=i.nodeSize}}else{if(e.index()<e.parent.childCount-1)return e.pos+e.nodeAfter.nodeSize;for(var s=e.node(-1),a=e.indexAfter(-1),l=e.after();a<s.childCount;a++){var c=s.child(a);if(c.childCount)return l+1;l+=c.nodeSize}}}(x(t),e);if(null!=r){if(n){var o=t.doc.resolve(r);n(t.tr.setSelection(i.TextSelection.between(o,M(o))).scrollIntoView())}return!0}}}function Me(e,t){for(var n=e.selection.$anchor,r=n.depth;r>0;r--){if("table"==n.node(r).type.spec.tableRole)return t&&t(e.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0}return!1}var Oe=function(e,t){this.node=e,this.cellMinWidth=t,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.colgroup=this.table.appendChild(document.createElement("colgroup")),Te(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement("tbody"))};function Te(e,t,n,r,o,i){for(var s=0,a=!0,l=t.firstChild,c=e.firstChild,u=0,d=0;u<c.childCount;u++)for(var p=c.child(u).attrs,f=p.colspan,h=p.colwidth,m=0;m<f;m++,d++){var v=o==d?i:h&&h[m],g=v?v+"px":"";s+=v||r,v||(a=!1),l?(l.style.width!=g&&(l.style.width=g),l=l.nextSibling):t.appendChild(document.createElement("col")).style.width=g}for(;l;){var y=l.nextSibling;l.parentNode.removeChild(l),l=y}a?(n.style.width=s+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=s+"px")}Oe.prototype.update=function(e){return e.type==this.node.type&&(this.node=e,Te(e,this.colgroup,this.table,this.cellMinWidth),!0)},Oe.prototype.ignoreMutation=function(e){return"attributes"==e.type&&(e.target==this.table||this.colgroup.contains(e.target))};var Ae=new i.PluginKey("tableColumnResizing");function Ne(e){void 0===e&&(e={});var t=e.handleWidth;void 0===t&&(t=5);var n=e.cellMinWidth;void 0===n&&(n=25);var r=e.View;void 0===r&&(r=Oe);var o=e.lastColumnResizable;return void 0===o&&(o=!0),new i.Plugin({key:Ae,state:{init:function(e,t){return this.spec.props.nodeViews[w(t.schema).table.name]=function(e,t){return new r(e,n,t)},new Re(-1,!1)},apply:function(e,t){return t.apply(e)}},props:{attributes:function(e){return Ae.getState(e).activeHandle>-1?{class:"resize-cursor"}:null},handleDOMEvents:{mousemove:function(e,n){!function(e,t,n,r,o){var i=Ae.getState(e.state);if(!i.dragging){var s=function(e){for(;e&&"TD"!=e.nodeName&&"TH"!=e.nodeName;)e=e.classList.contains("ProseMirror")?null:e.parentNode;return e}(t.target),a=-1;if(s){var l=s.getBoundingClientRect(),c=l.left,u=l.right;t.clientX-c<=n?a=De(e,t,"left"):u-t.clientX<=n&&(a=De(e,t,"right"))}if(a!=i.activeHandle){if(!o&&-1!==a){var d=e.state.doc.resolve(a),p=d.node(-1),f=h.get(p),m=d.start(-1);if(f.colCount(d.pos-m)+d.nodeAfter.attrs.colspan-1==f.width-1)return}ze(e,a)}}}(e,n,t,0,o)},mouseleave:function(e){!function(e){var t=Ae.getState(e.state);t.activeHandle>-1&&!t.dragging&&ze(e,-1)}(e)},mousedown:function(e,t){!function(e,t,n){var r=Ae.getState(e.state);if(-1==r.activeHandle||r.dragging)return!1;var o=e.state.doc.nodeAt(r.activeHandle),i=function(e,t,n){var r=n.colspan,o=n.colwidth,i=o&&o[o.length-1];if(i)return i;var s=e.domAtPos(t),a=s.node.childNodes[s.offset].offsetWidth,l=r;if(o)for(var c=0;c<r;c++)o[c]&&(a-=o[c],l--);return a/l}(e,r.activeHandle,o.attrs);function s(t){window.removeEventListener("mouseup",s),window.removeEventListener("mousemove",a);var r=Ae.getState(e.state);r.dragging&&(!function(e,t,n){for(var r=e.state.doc.resolve(t),o=r.node(-1),i=h.get(o),s=r.start(-1),a=i.colCount(r.pos-s)+r.nodeAfter.attrs.colspan-1,l=e.state.tr,c=0;c<i.height;c++){var u=c*i.width+a;if(!c||i.map[u]!=i.map[u-i.width]){var d=i.map[u],p=o.nodeAt(d).attrs,f=1==p.colspan?0:a-i.colCount(d);if(!p.colwidth||p.colwidth[f]!=n){var m=p.colwidth?p.colwidth.slice():_e(p.colspan);m[f]=n,l.setNodeMarkup(s+d,null,R(p,"colwidth",m))}}}l.docChanged&&e.dispatch(l)}(e,r.activeHandle,Ee(r.dragging,t,n)),e.dispatch(e.state.tr.setMeta(Ae,{setDragging:null})))}function a(t){if(!t.which)return s(t);var r=Ae.getState(e.state),o=Ee(r.dragging,t,n);!function(e,t,n,r){var o=e.state.doc.resolve(t),i=o.node(-1),s=o.start(-1),a=h.get(i).colCount(o.pos-s)+o.nodeAfter.attrs.colspan-1,l=e.domAtPos(o.start(-1)).node;for(;"TABLE"!=l.nodeName;)l=l.parentNode;Te(i,l.firstChild,l,r,a,n)}(e,r.activeHandle,o,n)}e.dispatch(e.state.tr.setMeta(Ae,{setDragging:{startX:t.clientX,startWidth:i}})),window.addEventListener("mouseup",s),window.addEventListener("mousemove",a),t.preventDefault()}(e,t,n)}},decorations:function(e){var t=Ae.getState(e);if(t.activeHandle>-1)return function(e,t){for(var n=[],r=e.doc.resolve(t),o=r.node(-1),i=h.get(o),s=r.start(-1),a=i.colCount(r.pos-s)+r.nodeAfter.attrs.colspan,c=0;c<i.height;c++){var u=a+c*i.width-1;if(!(a!=i.width&&i.map[u]==i.map[u+1]||0!=c&&i.map[u-1]==i.map[u-1-i.width])){var d=i.map[u],p=s+d+o.nodeAt(d).nodeSize-1,f=document.createElement("div");f.className="column-resize-handle",n.push(l.Decoration.widget(p,f))}}return l.DecorationSet.create(e.doc,n)}(e,t.activeHandle)},nodeViews:{}}})}var Re=function(e,t){this.activeHandle=e,this.dragging=t};function De(e,t,n){var r=e.posAtCoords({left:t.clientX,top:t.clientY});if(!r)return-1;var o=r.pos,i=S(e.state.doc.resolve(o));if(!i)return-1;if("right"==n)return i.pos;var s=h.get(i.node(-1)),a=i.start(-1),l=s.map.indexOf(i.pos-a);return l%s.width==0?-1:a+s.map[l-1]}function Ee(e,t,n){var r=t.clientX-e.startX;return Math.max(n,e.startWidth+r)}function ze(e,t){e.dispatch(e.state.tr.setMeta(Ae,{setHandle:t}))}function _e(e){for(var t=[],n=0;n<e;n++)t.push(0);return t}function Ie(e){void 0===e&&(e={});var t=e.allowTableNodeSelection;return void 0===t&&(t=!1),new i.Plugin({key:b,state:{init:function(){return null},apply:function(e,t){var n=e.getMeta(b);if(null!=n)return-1==n?null:n;if(null==t||!e.docChanged)return t;var r=e.mapping.mapResult(t),o=r.deleted,i=r.pos;return o?null:i}},props:{decorations:P,handleDOMEvents:{mousedown:Y},createSelectionBetween:function(e){if(null!=b.getState(e.state))return e.state.selection},handleTripleClick:X,handleKeyDown:K,handlePaste:U},appendTransaction:function(e,n,r){return function(e,t,n){var r,o,s=(t||e).selection,a=(t||e).doc;if(s instanceof i.NodeSelection&&(o=s.node.type.spec.tableRole)){if("cell"==o||"header_cell"==o)r=_.create(a,s.from);else if("row"==o){var l=a.resolve(s.from+1);r=_.rowSelection(l,l)}else if(!n){var c=h.get(s.node),u=s.from+1,d=u+c.map[c.width*c.height-1];r=_.create(a,u+1,d)}}else s instanceof i.TextSelection&&function(e){var t=e.$from,n=e.$to;if(t.pos==n.pos||t.pos<t.pos-6)return!1;for(var r=t.pos,o=n.pos,i=t.depth;i>=0&&!(t.after(i+1)<t.end(i));i--,r++);for(var s=n.depth;s>=0&&!(n.before(s+1)>n.start(s));s--,o--);return r==o&&/row|table/.test(t.node(i).type.spec.tableRole)}(s)?r=i.TextSelection.create(a,s.from):s instanceof i.TextSelection&&function(e){for(var t,n,r=e.$from,o=e.$to,i=r.depth;i>0;i--){var s=r.node(i);if("cell"===s.type.spec.tableRole||"header_cell"===s.type.spec.tableRole){t=s;break}}for(var a=o.depth;a>0;a--){var l=o.node(a);if("cell"===l.type.spec.tableRole||"header_cell"===l.type.spec.tableRole){n=l;break}}return t!==n&&0===o.parentOffset}(s)&&(r=i.TextSelection.create(a,s.$from.start(),s.$from.end()));return r&&(t||(t=e.tr)).setSelection(r),t}(r,te(r,n),t)}})}Re.prototype.apply=function(e){var t=this,n=e.getMeta(Ae);if(n&&null!=n.setHandle)return new Re(n.setHandle,null);if(n&&void 0!==n.setDragging)return new Re(t.activeHandle,n.setDragging);if(t.activeHandle>-1&&e.docChanged){var r=e.mapping.map(t.activeHandle,-1);C(e.doc.resolve(r))||(r=null),t=new Re(r,t.dragging)}return t}},function(e,t,n){"use strict";n.r(t),n.d(t,"keydownHandler",(function(){return y})),n.d(t,"keymap",(function(){return g}));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:"'",229:"q"},o={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"',229:"Q"},i="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent),s="undefined"!=typeof navigator&&/Apple Computer/.test(navigator.vendor),a="undefined"!=typeof navigator&&/Gecko\/\d+/.test(navigator.userAgent),l="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),c="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),u=i&&(l||+i[1]<57)||a&&l,d=0;d<10;d++)r[48+d]=r[96+d]=String(d);for(d=1;d<=24;d++)r[d+111]="F"+d;for(d=65;d<=90;d++)r[d]=String.fromCharCode(d+32),o[d]=String.fromCharCode(d);for(var p in r)o.hasOwnProperty(p)||(o[p]=r[p]);var f=n(1),h="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function m(e){var t,n,r,o,i=e.split(/-(?!$)/),s=i[i.length-1];"Space"==s&&(s=" ");for(var a=0;a<i.length-1;a++){var l=i[a];if(/^(cmd|meta|m)$/i.test(l))o=!0;else if(/^a(lt)?$/i.test(l))t=!0;else if(/^(c|ctrl|control)$/i.test(l))n=!0;else if(/^s(hift)?$/i.test(l))r=!0;else{if(!/^mod$/i.test(l))throw new Error("Unrecognized modifier name: "+l);h?o=!0:n=!0}}return t&&(s="Alt-"+s),n&&(s="Ctrl-"+s),o&&(s="Meta-"+s),r&&(s="Shift-"+s),s}function v(e,t,n){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),!1!==n&&t.shiftKey&&(e="Shift-"+e),e}function g(e){return new f.Plugin({props:{handleKeyDown:y(e)}})}function y(e){var t=function(e){var t=Object.create(null);for(var n in e)t[m(n)]=e[n];return t}(e);return function(e,n){var i,a=function(e){var t=!(u&&(e.ctrlKey||e.altKey||e.metaKey)||(s||c)&&e.shiftKey&&e.key&&1==e.key.length)&&e.key||(e.shiftKey?o:r)[e.keyCode]||e.key||"Unidentified";return"Esc"==t&&(t="Escape"),"Del"==t&&(t="Delete"),"Left"==t&&(t="ArrowLeft"),"Up"==t&&(t="ArrowUp"),"Right"==t&&(t="ArrowRight"),"Down"==t&&(t="ArrowDown"),t}(n),l=1==a.length&&" "!=a,d=t[v(a,n,!l)];if(d&&d(e.state,e.dispatch,e))return!0;if(l&&(n.shiftKey||n.altKey||n.metaKey||a.charCodeAt(0)>127)&&(i=r[n.keyCode])&&i!=a){var p=t[v(i,n,!0)];if(p&&p(e.state,e.dispatch,e))return!0}else if(l&&n.shiftKey){var f=t[v(a,n,!0)];if(f&&f(e.state,e.dispatch,e))return!0}return!1}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4),o=n(5),i=n(2),s=n(0),a=n(1);t.changeTextBlock=function(e,t,n,r){if(!n.isTextblock)return!1;e.selection.ranges.forEach((function(o){var a=e.steps.length,l=o.$from.pos,c=o.$to.pos;e.doc.nodesBetween(l,c,(function(o,l){if(o.eq(t)&&o.isTextblock&&!o.hasMarkup(n,r)&&function(e,t,n){var r=e.resolve(t),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}(e.doc,e.mapping.slice(a).map(l),n)){e.clearIncompatible(e.mapping.slice(a).map(l,1),n);var c=e.mapping.slice(a),u=c.map(l,1),d=c.map(l+o.nodeSize,1),p=new s.Slice(s.Fragment.from(n.create(r,null,o.marks)),0,0);return e.step(new i.ReplaceAroundStep(u,d,u+1,d-1,p,1,!0)),!1}}))}))},t.blockNodes=function(e,t){void 0===t&&(t={blocksInSelection:!1});var n=e.doc,r=e.selection,o=r.$from,i=r.ranges,s=t.blocksInSelection,l=[],c=r instanceof a.NodeSelection?r.node:void 0;return c?c.isBlock?(l.push(c),c.nodesBetween(0,c.content.size,(function(e){e.isBlock&&l.push(e)}))):!s&&o.parent&&o.parent.isBlock&&l.push(o.parent):i.forEach((function(e){var t=e.$from.pos,r=e.$to.pos;n.nodesBetween(t,r,(function(e,n,o,i){e.isBlock&&(!s||n>=t&&n+e.content.size+2<=r)&&l.push(e)}))})),l},t.formatBlockElements=function(e,n){return function(o,i){var s=t.blockNodes(o),a=o.schema.nodes,l=o.tr;l.setMeta("commandName",n),l.setMeta("args",{value:e}),s.forEach((function(n){if(n.type.isTextblock)if("p"===e){var o=n.attrs,i=o.level,s=r.__rest(o,["level"]);t.changeTextBlock(l,n,a.paragraph,s)}else if(/^h[1-6]$/i.test(e)){i=parseInt(e.substr(1),10);t.changeTextBlock(l,n,a.heading,r.__assign({},n.attrs,{level:i}))}else if("blockquote"===e){var c=n.attrs;i=c.level,s=r.__rest(c,["level"]);t.changeTextBlock(l,n,a.blockquote,s)}}));var c=l.docChanged;return c&&i(l.scrollIntoView()),c}},t.cleanTextBlockFormatting=function(e,n){void 0===n&&(n={blocksInSelection:!0});var o=e.doc,i=e.selection,s=n.blocksInSelection,a=n.blockNodeType;t.blockNodes({doc:o,selection:i},{blocksInSelection:s}).filter((function(e){return e.isTextblock})).forEach((function(n){var o=n.attrs||{},i=o.style,s=void 0===i?"":i,l=o.class,c=void 0===l?"":l,u=r.__rest(o,["style","class"]),d=a||n.type;(s||c||d!==n.type)&&t.changeTextBlock(e,n,d,u)}))},t.getBlockFormats=function(e){var n=t.blockNodes(e),r=e.schema.nodes,o=[];return n.forEach((function(e){e.type===r.paragraph?o.push("p"):e.type===r.heading?o.push("h"+e.attrs.level):e.type===r.blockquote&&r.blockquote.isTextblock&&o.push("blockquote")})),o},t.addStyles=function(e,t){var n,r,i=e.attrs.style;i&&t.forEach((function(e){r={style:e.name,value:/^.+$/,newValue:e.value},n=o.changeStylesString(i,r),i=n.changed?n.style:i}));return i=i||t.reduce((function(e,t){return(e&&t.value?e+" ":"")+t.value?t.name+": "+t.value+";":""}),""),Object.assign({},e.attrs,{style:i||null})},t.hasNode=function(e,t){var n=e.selection,r=n.from,o=n.to,i=!1;return e.doc.nodesBetween(r,o,(function(e){return!(i=i||e.type===t)})),i},t.parentBlockFormat=function(e){var n=t.getBlockFormats(e);return 1===new Set(n).size?n[0]:null},t.activeNode=function(e){return{tag:t.parentBlockFormat(e)||""}}},function(e,t,n){"use strict";n.r(t),n.d(t,"autoJoin",(function(){return z})),n.d(t,"baseKeymap",(function(){return L})),n.d(t,"chainCommands",(function(){return _})),n.d(t,"createParagraphNear",(function(){return b})),n.d(t,"deleteSelection",(function(){return s})),n.d(t,"exitCode",(function(){return w})),n.d(t,"joinBackward",(function(){return a})),n.d(t,"joinDown",(function(){return m})),n.d(t,"joinForward",(function(){return d})),n.d(t,"joinUp",(function(){return h})),n.d(t,"lift",(function(){return v})),n.d(t,"liftEmptyBlock",(function(){return S})),n.d(t,"macBaseKeymap",(function(){return F})),n.d(t,"newlineInCode",(function(){return g})),n.d(t,"pcBaseKeymap",(function(){return $})),n.d(t,"selectAll",(function(){return M})),n.d(t,"selectNodeBackward",(function(){return c})),n.d(t,"selectNodeForward",(function(){return p})),n.d(t,"selectParentNode",(function(){return C})),n.d(t,"selectTextblockEnd",(function(){return N})),n.d(t,"selectTextblockStart",(function(){return A})),n.d(t,"setBlockType",(function(){return D})),n.d(t,"splitBlock",(function(){return k})),n.d(t,"splitBlockKeepMarks",(function(){return x})),n.d(t,"toggleMark",(function(){return E})),n.d(t,"wrapIn",(function(){return R}));var r=n(2),o=n(0),i=n(1);function s(e,t){return!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0)}function a(e,t,n){var s=e.selection.$cursor;if(!s||(n?!n.endOfTextblock("backward",e):s.parentOffset>0))return!1;var a=u(s);if(!a){var c=s.blockRange(),d=c&&Object(r.liftTarget)(c);return null!=d&&(t&&t(e.tr.lift(c,d).scrollIntoView()),!0)}var p=a.nodeBefore;if(!p.type.spec.isolating&&O(e,a,t))return!0;if(0==s.parent.content.size&&(l(p,"end")||i.NodeSelection.isSelectable(p))){var f=Object(r.replaceStep)(e.doc,s.before(),s.after(),o.Slice.empty);if(f.slice.size<f.to-f.from){if(t){var h=e.tr.step(f);h.setSelection(l(p,"end")?i.Selection.findFrom(h.doc.resolve(h.mapping.map(a.pos,-1)),-1):i.NodeSelection.create(h.doc,a.pos-p.nodeSize)),t(h.scrollIntoView())}return!0}}return!(!p.isAtom||a.depth!=s.depth-1)&&(t&&t(e.tr.delete(a.pos-p.nodeSize,a.pos).scrollIntoView()),!0)}function l(e,t,n){for(;e;e="start"==t?e.firstChild:e.lastChild){if(e.isTextblock)return!0;if(n&&1!=e.childCount)return!1}return!1}function c(e,t,n){var r=e.selection,o=r.$head,s=o;if(!r.empty)return!1;if(o.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):o.parentOffset>0)return!1;s=u(o)}var a=s&&s.nodeBefore;return!(!a||!i.NodeSelection.isSelectable(a))&&(t&&t(e.tr.setSelection(i.NodeSelection.create(e.doc,s.pos-a.nodeSize)).scrollIntoView()),!0)}function u(e){if(!e.parent.type.spec.isolating)for(var t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function d(e,t,n){var s=e.selection.$cursor;if(!s||(n?!n.endOfTextblock("forward",e):s.parentOffset<s.parent.content.size))return!1;var a=f(s);if(!a)return!1;var c=a.nodeAfter;if(O(e,a,t))return!0;if(0==s.parent.content.size&&(l(c,"start")||i.NodeSelection.isSelectable(c))){var u=Object(r.replaceStep)(e.doc,s.before(),s.after(),o.Slice.empty);if(u.slice.size<u.to-u.from){if(t){var d=e.tr.step(u);d.setSelection(l(c,"start")?i.Selection.findFrom(d.doc.resolve(d.mapping.map(a.pos)),1):i.NodeSelection.create(d.doc,d.mapping.map(a.pos))),t(d.scrollIntoView())}return!0}}return!(!c.isAtom||a.depth!=s.depth-1)&&(t&&t(e.tr.delete(a.pos,a.pos+c.nodeSize).scrollIntoView()),!0)}function p(e,t,n){var r=e.selection,o=r.$head,s=o;if(!r.empty)return!1;if(o.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):o.parentOffset<o.parent.content.size)return!1;s=f(o)}var a=s&&s.nodeAfter;return!(!a||!i.NodeSelection.isSelectable(a))&&(t&&t(e.tr.setSelection(i.NodeSelection.create(e.doc,s.pos)).scrollIntoView()),!0)}function f(e){if(!e.parent.type.spec.isolating)for(var t=e.depth-1;t>=0;t--){var n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}function h(e,t){var n,o=e.selection,s=o instanceof i.NodeSelection;if(s){if(o.node.isTextblock||!Object(r.canJoin)(e.doc,o.from))return!1;n=o.from}else if(null==(n=Object(r.joinPoint)(e.doc,o.from,-1)))return!1;if(t){var a=e.tr.join(n);s&&a.setSelection(i.NodeSelection.create(a.doc,n-e.doc.resolve(n).nodeBefore.nodeSize)),t(a.scrollIntoView())}return!0}function m(e,t){var n,o=e.selection;if(o instanceof i.NodeSelection){if(o.node.isTextblock||!Object(r.canJoin)(e.doc,o.to))return!1;n=o.to}else if(null==(n=Object(r.joinPoint)(e.doc,o.to,1)))return!1;return t&&t(e.tr.join(n).scrollIntoView()),!0}function v(e,t){var n=e.selection,o=n.$from,i=n.$to,s=o.blockRange(i),a=s&&Object(r.liftTarget)(s);return null!=a&&(t&&t(e.tr.lift(s,a).scrollIntoView()),!0)}function g(e,t){var n=e.selection,r=n.$head,o=n.$anchor;return!(!r.parent.type.spec.code||!r.sameParent(o))&&(t&&t(e.tr.insertText("\n").scrollIntoView()),!0)}function y(e){for(var t=0;t<e.edgeCount;t++){var n=e.edge(t).type;if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function w(e,t){var n=e.selection,r=n.$head,o=n.$anchor;if(!r.parent.type.spec.code||!r.sameParent(o))return!1;var s=r.node(-1),a=r.indexAfter(-1),l=y(s.contentMatchAt(a));if(!s.canReplaceWith(a,a,l))return!1;if(t){var c=r.after(),u=e.tr.replaceWith(c,c,l.createAndFill());u.setSelection(i.Selection.near(u.doc.resolve(c),1)),t(u.scrollIntoView())}return!0}function b(e,t){var n=e.selection,r=n.$from,o=n.$to;if(n instanceof i.AllSelection||r.parent.inlineContent||o.parent.inlineContent)return!1;var s=y(o.parent.contentMatchAt(o.indexAfter()));if(!s||!s.isTextblock)return!1;if(t){var a=(!r.parentOffset&&o.index()<o.parent.childCount?r:o).pos,l=e.tr.insert(a,s.createAndFill());l.setSelection(i.TextSelection.create(l.doc,a+1)),t(l.scrollIntoView())}return!0}function S(e,t){var n=e.selection.$cursor;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){var o=n.before();if(Object(r.canSplit)(e.doc,o))return t&&t(e.tr.split(o).scrollIntoView()),!0}var i=n.blockRange(),s=i&&Object(r.liftTarget)(i);return null!=s&&(t&&t(e.tr.lift(i,s).scrollIntoView()),!0)}function k(e,t){var n=e.selection,o=n.$from,s=n.$to;if(e.selection instanceof i.NodeSelection&&e.selection.node.isBlock)return!(!o.parentOffset||!Object(r.canSplit)(e.doc,o.pos))&&(t&&t(e.tr.split(o.pos).scrollIntoView()),!0);if(!o.parent.isBlock)return!1;if(t){var a=s.parentOffset==s.parent.content.size,l=e.tr;(e.selection instanceof i.TextSelection||e.selection instanceof i.AllSelection)&&l.deleteSelection();var c=0==o.depth?null:y(o.node(-1).contentMatchAt(o.indexAfter(-1))),u=a&&c?[{type:c}]:null,d=Object(r.canSplit)(l.doc,l.mapping.map(o.pos),1,u);if(u||d||!Object(r.canSplit)(l.doc,l.mapping.map(o.pos),1,c&&[{type:c}])||(u=[{type:c}],d=!0),d&&(l.split(l.mapping.map(o.pos),1,u),!a&&!o.parentOffset&&o.parent.type!=c)){var p=l.mapping.map(o.before()),f=l.doc.resolve(p);o.node(-1).canReplaceWith(f.index(),f.index()+1,c)&&l.setNodeMarkup(l.mapping.map(o.before()),c)}t(l.scrollIntoView())}return!0}function x(e,t){return k(e,t&&function(n){var r=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();r&&n.ensureMarks(r),t(n)})}function C(e,t){var n,r=e.selection,o=r.$from,s=r.to,a=o.sharedDepth(s);return 0!=a&&(n=o.before(a),t&&t(e.tr.setSelection(i.NodeSelection.create(e.doc,n))),!0)}function M(e,t){return t&&t(e.tr.setSelection(new i.AllSelection(e.doc))),!0}function O(e,t,n){var s,a,c=t.nodeBefore,u=t.nodeAfter;if(c.type.spec.isolating||u.type.spec.isolating)return!1;if(function(e,t,n){var o=t.nodeBefore,i=t.nodeAfter,s=t.index();return!!(o&&i&&o.type.compatibleContent(i.type))&&(!o.content.size&&t.parent.canReplace(s-1,s)?(n&&n(e.tr.delete(t.pos-o.nodeSize,t.pos).scrollIntoView()),!0):!(!t.parent.canReplace(s,s+1)||!i.isTextblock&&!Object(r.canJoin)(e.doc,t.pos))&&(n&&n(e.tr.clearIncompatible(t.pos,o.type,o.contentMatchAt(o.childCount)).join(t.pos).scrollIntoView()),!0))}(e,t,n))return!0;var d=t.parent.canReplace(t.index(),t.index()+1);if(d&&(s=(a=c.contentMatchAt(c.childCount)).findWrapping(u.type))&&a.matchType(s[0]||u.type).validEnd){if(n){for(var p=t.pos+u.nodeSize,f=o.Fragment.empty,h=s.length-1;h>=0;h--)f=o.Fragment.from(s[h].create(null,f));f=o.Fragment.from(c.copy(f));var m=e.tr.step(new r.ReplaceAroundStep(t.pos-1,p,t.pos,p,new o.Slice(f,1,0),s.length,!0)),v=p+2*s.length;Object(r.canJoin)(m.doc,v)&&m.join(v),n(m.scrollIntoView())}return!0}var g=i.Selection.findFrom(t,1),y=g&&g.$from.blockRange(g.$to),w=y&&Object(r.liftTarget)(y);if(null!=w&&w>=t.depth)return n&&n(e.tr.lift(y,w).scrollIntoView()),!0;if(d&&l(u,"start",!0)&&l(c,"end")){for(var b=c,S=[];S.push(b),!b.isTextblock;)b=b.lastChild;for(var k=u,x=1;!k.isTextblock;k=k.firstChild)x++;if(b.canReplace(b.childCount,b.childCount,k.content)){if(n){for(var C=o.Fragment.empty,M=S.length-1;M>=0;M--)C=o.Fragment.from(S[M].copy(C));n(e.tr.step(new r.ReplaceAroundStep(t.pos-S.length,t.pos+u.nodeSize,t.pos+x,t.pos+u.nodeSize-x,new o.Slice(C,S.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function T(e){return function(t,n){for(var r=t.selection,o=e<0?r.$from:r.$to,s=o.depth;o.node(s).isInline;){if(!s)return!1;s--}return!!o.node(s).isTextblock&&(n&&n(t.tr.setSelection(i.TextSelection.create(t.doc,e<0?o.start(s):o.end(s)))),!0)}}var A=T(-1),N=T(1);function R(e,t){return function(n,o){var i=n.selection,s=i.$from,a=i.$to,l=s.blockRange(a),c=l&&Object(r.findWrapping)(l,e,t);return!!c&&(o&&o(n.tr.wrap(l,c).scrollIntoView()),!0)}}function D(e,t){return function(n,r){var o=n.selection,i=o.from,s=o.to,a=!1;return n.doc.nodesBetween(i,s,(function(r,o){if(a)return!1;if(r.isTextblock&&!r.hasMarkup(e,t))if(r.type==e)a=!0;else{var i=n.doc.resolve(o),s=i.index();a=i.parent.canReplaceWith(s,s+1,e)}})),!!a&&(r&&r(n.tr.setBlockType(i,s,e,t).scrollIntoView()),!0)}}function E(e,t){return function(n,r){var o=n.selection,i=o.empty,s=o.$cursor,a=o.ranges;if(i&&!s||!function(e,t,n){for(var r=function(r){var o=t[r],i=o.$from,s=o.$to,a=0==i.depth&&e.type.allowsMarkType(n);if(e.nodesBetween(i.pos,s.pos,(function(e){if(a)return!1;a=e.inlineContent&&e.type.allowsMarkType(n)})),a)return{v:!0}},o=0;o<t.length;o++){var i=r(o);if(i)return i.v}return!1}(n.doc,a,e))return!1;if(r)if(s)e.isInSet(n.storedMarks||s.marks())?r(n.tr.removeStoredMark(e)):r(n.tr.addStoredMark(e.create(t)));else{for(var l=!1,c=n.tr,u=0;!l&&u<a.length;u++){var d=a[u],p=d.$from,f=d.$to;l=n.doc.rangeHasMark(p.pos,f.pos,e)}for(var h=0;h<a.length;h++){var m=a[h],v=m.$from,g=m.$to;if(l)c.removeMark(v.pos,g.pos,e);else{var y=v.pos,w=g.pos,b=v.nodeAfter,S=g.nodeBefore,k=b&&b.isText?/^\s*/.exec(b.text)[0].length:0,x=S&&S.isText?/\s*$/.exec(S.text)[0].length:0;y+k<w&&(y+=k,w-=x),c.addMark(y,w,e.create(t))}}r(c.scrollIntoView())}return!0}}function z(e,t){if(Array.isArray(t)){var n=t;t=function(e){return n.indexOf(e.type.name)>-1}}return function(n,o,i){return e(n,o&&function(e,t){return function(n){if(!n.isGeneric)return e(n);for(var o=[],i=0;i<n.mapping.maps.length;i++){for(var s=n.mapping.maps[i],a=0;a<o.length;a++)o[a]=s.map(o[a]);s.forEach((function(e,t,n,r){return o.push(n,r)}))}for(var l=[],c=0;c<o.length;c+=2)for(var u=o[c],d=o[c+1],p=n.doc.resolve(u),f=p.sharedDepth(d),h=p.node(f),m=p.indexAfter(f),v=p.after(f+1);v<=d;++m){var g=h.maybeChild(m);if(!g)break;if(m&&-1==l.indexOf(v)){var y=h.child(m-1);y.type==g.type&&t(y,g)&&l.push(v)}v+=g.nodeSize}l.sort((function(e,t){return e-t}));for(var w=l.length-1;w>=0;w--)Object(r.canJoin)(n.doc,l[w])&&n.join(l[w]);e(n)}}(o,t),i)}}function _(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return function(t,n,r){for(var o=0;o<e.length;o++)if(e[o](t,n,r))return!0;return!1}}var I=_(s,a,c),P=_(s,d,p),$={Enter:_(g,b,S,k),"Mod-Enter":w,Backspace:I,"Mod-Backspace":I,"Shift-Backspace":I,Delete:P,"Mod-Delete":P,"Mod-a":M},F={"Ctrl-h":$.Backspace,"Alt-Backspace":$["Mod-Backspace"],"Ctrl-d":$.Delete,"Ctrl-Alt-Backspace":$["Mod-Delete"],"Alt-Delete":$["Mod-Delete"],"Alt-d":$["Mod-Delete"],"Ctrl-a":A,"Ctrl-e":N};for(var B in $)F[B]=$[B];var L=("undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):"undefined"!=typeof os&&"darwin"==os.platform())?F:$},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4),o=n(1),i=n(5);t.reAnyValue=/^.+$/,t.parseStyle=function(e){return(e||"").split(/\s*;\s*/).filter(Boolean).map((function(e){var t,n=e.split(/\s*:\s*/);return(t={})[n[0]]=n[1],t})).reduce((function(e,t){return r.__assign({},e,t)}),{})},t.setNodeStyle=function(e,n,o){var s;if(new RegExp("[^-]?"+n+":").test(e.style||"")){var a=i.changeStylesString(e.style||"",{style:n,value:t.reAnyValue,newValue:o}).style;s=r.__assign({},e,{style:a})}else s=e.style?r.__assign({},e,{style:e.style.replace(/;$/,"")+"; "+n+": "+o+";"}):r.__assign({},e,{style:n+": "+o+";"});return s},t.tableResizeKey=new o.PluginKey("table-resize"),t.tableColumnResizeKey=new o.PluginKey("table-column-resizing"),t.tableRowResizeKey=new o.PluginKey("table-row-resizing"),t.otherResizing=function(e,n){var r=!1;return r=(r=(r=r||e!==t.tableResizeKey&&Boolean(t.tableResizeKey.get(n))&&t.tableResizeKey.getState(n).dragging)||e!==t.tableColumnResizeKey&&Boolean(t.tableColumnResizeKey.get(n))&&t.tableColumnResizeKey.getState(n).dragging)||e!==t.tableRowResizeKey&&Boolean(t.tableRowResizeKey.get(n))&&t.tableRowResizeKey.getState(n).dragging},t.otherResizeHandle=function(e,n){var r=!1;return r=(r=r||e!==t.tableColumnResizeKey&&Boolean(t.tableColumnResizeKey.get(n))&&t.tableColumnResizeKey.getState(n).activeHandle>-1)||e!==t.tableRowResizeKey&&Boolean(t.tableRowResizeKey.get(n))&&t.tableRowResizeKey.getState(n).activeHandle>-1},t.getTable=function(e){return e&&e.firstChild&&"TABLE"===e.firstChild.nodeName?e.firstChild:e},t.domCellAround=function(e){for(;e&&"TD"!==e.nodeName&&"TH"!==e.nodeName;)e=e.classList.contains("ProseMirror")?null:e.parentNode;return e},t.cellIndexes=function(e){var t=e.parentNode;return{cellIndex:e.cellIndex,rowIndex:t.rowIndex}},t.parentNode=function(e,t){for(var n=e.depth;n>0;n--){var r=e.node(n);if(t(r))return{node:r,depth:n}}return null}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(6),s=["div","ol","ul","li","table","tbody","thead","tfoot","td","th","p","tr","col","colgroup","article","main","nav","header","footer","aside","section"],a=function(e,t){var n=(e.ownerDocument||document).createElement(t);Array.from(e.rows).filter((function(e){return e.getAttribute(i.rowTypeAttr)===t})).forEach((function(e){e.removeAttribute(i.rowTypeAttr),n.appendChild(e)})),n.children.length&&e.appendChild(n)},l=function(e,t){var n=t.toUpperCase();e.filter((function(e){return e.nodeName===n})).forEach((function(e){Array.from(e.children).forEach((function(n){n.setAttribute(i.rowTypeAttr,t),e.parentNode&&e.parentNode.insertBefore(n,e)})),e.remove()}))};t.trimWhitespace=function(e,t){void 0===t&&(t=s);var n=t.join("|");return e.replace(new RegExp("\\s*(<(?:"+n+")(?:\\s[^>]*?)?>)","g"),"$1").replace(new RegExp("(<\\/(?:"+n+")(?:\\s[^>]*?)?>)\\s*","g"),"$1")},t.htmlToFragment=function(e){var t,n=document.createElement("template");if("content"in n)n.innerHTML=e,t=n.content;else{var r=(new DOMParser).parseFromString(e,"text/html");t=document.createDocumentFragment();for(var o=r.body;o&&o.firstChild;)t.appendChild(o.firstChild)}return t},t.pmDocToFragment=function(e){var t=r.DOMSerializer.fromSchema(e.type.schema).serializeFragment(e.content);return function(e){Array.from(e.querySelectorAll("table")).forEach((function(e){a(e,"thead"),a(e,"tbody"),a(e,"tfoot");var t=Array.from(e.children).find((function(e){return 0===e.children.length}));t&&t.remove()}))}(t),t},t.domToPmDoc=function(e,t,n){return r.DOMParser.fromSchema(t).parse(e,n)},t.parseContent=function(e,n,r){var o,s=t.htmlToFragment(e);return o=s,Array.from(o.querySelectorAll("table")).forEach((function(e){var t=Array.from(e.children);t.some((function(e){return"THEAD"===e.nodeName||"TFOOT"===e.nodeName}))&&(l(t,"thead"),l(t,"tbody"),l(t,"tfoot"));var n=t.find((function(e){return"COLGROUP"===e.nodeName}));n&&(e.setAttribute(i.colgroupAttr,n.outerHTML),n.remove())})),t.domToPmDoc(s,n,r)},t.getHtml=function(e){var n=t.pmDocToFragment(e.doc),r=document.createElement("div");return r.appendChild(n),r.innerHTML},t.setHtml=function(e,n,r){return void 0===n&&(n="setHTML"),void 0===r&&(r={preserveWhitespace:"full"}),function(i,s){return s(i.tr.setSelection(new o.AllSelection(i.doc)).replaceSelectionWith(t.parseContent(e,i.schema,r)).setMeta("commandName",n))}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4),o=n(2),i=n(5),s=n(7),a=function(e,t){var n=e.find((function(e){return"style"===e.type.name})),r=n&&n.attrs.style;return i.changeStylesString(r,t)},l=function(e,t,n,i,s){var l=s.create({style:i.style}),c=[],u=[],d=null,p=null;return e.doc.nodesBetween(t,n,(function(e,f,h){if(e.isInline){var m=e.marks;if(!l.isInSet(m)&&h.type.allowsMarkType(l.type)){var v=Math.max(f,t),g=Math.min(f+e.nodeSize,n),y=a(m,i);if(y.changed||i.newValue){for(var w=y.changed?{style:y.style||null}:{style:[i.style]+": "+i.newValue+";"},b=s.isInSet(m)?m.find((function(e){return"style"===e.type.name})):null,S=b?r.__assign({},b.attrs,w):w,k=s.create(S),x=k.addToSet(m),C=0;C<m.length;C++)m[C].isInSet(x)||(d&&d.to===v&&d.mark.eq(m[C])?d.to=g:(d=new o.RemoveMarkStep(v,g,m[C]),c.push(d)));var M=p&&p.to===v,O=M&&k.attrs.style===p.mark.attrs.style;M&&O?p.to=g:Object.keys(S).some((function(e){return null!==S[e]}))&&(p=new o.AddMarkStep(v,g,k),u.push(p))}}}})),c.forEach((function(t){return e.step(t)})),u.forEach((function(t){return e.step(t)})),c.length+u.length>0};t.getInlineStyles=function(e,t){var n=e.schema.marks.style;return(n?s.selectionMarks(e,n):[]).map((function(e){return s.styleValue(e,t)})).filter((function(e){return null!==e}))};var c=function(e,t){return function(n,o,c){var u=n.selection,d=u.empty,p=u.$cursor,f=u.ranges;if(d&&!p||!s.markApplies(n.doc,f,e))return!1;var h=!1;if(o){var m=c||n.tr;if(p){var v=n.storedMarks||p.marks();if(e.isInSet(v)){var g=a(v,t),y=v.find((function(e){return"style"===e.type.name})),w=r.__assign({},y?y.attrs:{},{style:g.style||null});if(i.shallowEqual(y.attrs,w))return!1;o(m.removeStoredMark(e)),Object.keys(w).some((function(e){return null!==w[e]}))&&o(m.addStoredMark(e.create(w))),h=!0}}else{for(var b=0;b<f.length;b++){var S=f[b],k=S.$from,x=S.$to;h=l(m,k.pos,x.pos,t,e)}h&&(m.scrollIntoView(),o(m))}}return h}};t.toggleInlineFormat=function(e,t,n){return function(r,o){var i=r.schema.marks,a=e.altStyle,l=e.altMarks,u=void 0===l?[]:l,d=e.mark,p=t||r.tr,f=!1,h=!1,m=function(){return h=!0};a&&i.style&&(f=c(i.style,{style:a.name,value:a.value})(r,m,p));var v=[d].concat(u).filter((function(e){return i[e]})).map((function(e){return s.hasMark(r,{mark:e})&&i[e]})).filter((function(e){return e}));return v.length?s.removeMarks(v,r,m,p):f||s.toggleMark(i[d],n,p)(r,m),h&&o(p),h}},t.applyInlineStyle=function(e,t){return function(n,o){var a=n.schema.marks.style,l={style:e.style,value:/^.+$/,newValue:e.value},u=n.tr;t&&u.setMeta("commandName",t),u.setMeta("args",e);var d=n.selection,p=d.empty,f=d.$cursor,h=d.ranges;if(p&&!f||!a||!s.markApplies(n.doc,h,a))return!1;if(f){var m=n.storedMarks||f.marks(),v=a.isInSet(m)?m.find((function(e){return"style"===e.type.name})):null,g={style:null};if(v&&v.attrs.style){var y=i.changeStylesString(v.attrs.style,l);y.changed&&y.style&&(g.style=y.style)}else l.newValue&&(g.style=[l.style]+": "+l.newValue+";");var w=v?r.__assign({},v.attrs,g):g;return Object.keys(w).some((function(e){return null!==w[e]}))?o(u.addStoredMark(a.create(w))):o(u.removeStoredMark(a)),!0}return c(a,l)(n,o,u)}}},function(e,t,n){"use strict";n.r(t),n.d(t,"addListNodes",(function(){return p})),n.d(t,"bulletList",(function(){return c})),n.d(t,"liftListItem",(function(){return m})),n.d(t,"listItem",(function(){return u})),n.d(t,"orderedList",(function(){return l})),n.d(t,"sinkListItem",(function(){return v})),n.d(t,"splitListItem",(function(){return h})),n.d(t,"wrapInList",(function(){return f}));var r=n(2),o=n(0),i=["ol",0],s=["ul",0],a=["li",0],l={attrs:{order:{default:1}},parseDOM:[{tag:"ol",getAttrs:function(e){return{order:e.hasAttribute("start")?+e.getAttribute("start"):1}}}],toDOM:function(e){return 1==e.attrs.order?i:["ol",{start:e.attrs.order},0]}},c={parseDOM:[{tag:"ul"}],toDOM:function(){return s}},u={parseDOM:[{tag:"li"}],toDOM:function(){return a},defining:!0};function d(e,t){var n={};for(var r in e)n[r]=e[r];for(var o in t)n[o]=t[o];return n}function p(e,t,n){return e.append({ordered_list:d(l,{content:"list_item+",group:n}),bullet_list:d(c,{content:"list_item+",group:n}),list_item:d(u,{content:t})})}function f(e,t){return function(n,i){var s=n.selection,a=s.$from,l=s.$to,c=a.blockRange(l),u=!1,d=c;if(!c)return!1;if(c.depth>=2&&a.node(c.depth-1).type.compatibleContent(e)&&0==c.startIndex){if(0==a.index(c.depth-1))return!1;var p=n.doc.resolve(c.start-2);d=new o.NodeRange(p,p,c.depth),c.endIndex<c.parent.childCount&&(c=new o.NodeRange(a,n.doc.resolve(l.end(c.depth)),c.depth)),u=!0}var f=Object(r.findWrapping)(d,e,t,c);return!!f&&(i&&i(function(e,t,n,i,s){for(var a=o.Fragment.empty,l=n.length-1;l>=0;l--)a=o.Fragment.from(n[l].type.create(n[l].attrs,a));e.step(new r.ReplaceAroundStep(t.start-(i?2:0),t.end,t.start,t.end,new o.Slice(a,0,0),n.length,!0));for(var c=0,u=0;u<n.length;u++)n[u].type==s&&(c=u+1);for(var d=n.length-c,p=t.start+n.length-(i?2:0),f=t.parent,h=t.startIndex,m=t.endIndex,v=!0;h<m;h++,v=!1)!v&&Object(r.canSplit)(e.doc,p,d)&&(e.split(p,d),p+=2*d),p+=f.child(h).nodeSize;return e}(n.tr,c,f,u,e).scrollIntoView()),!0)}}function h(e){return function(t,n){var i=t.selection,s=i.$from,a=i.$to,l=i.node;if(l&&l.isBlock||s.depth<2||!s.sameParent(a))return!1;var c=s.node(-1);if(c.type!=e)return!1;if(0==s.parent.content.size&&s.node(-1).childCount==s.indexAfter(-1)){if(2==s.depth||s.node(-3).type!=e||s.index(-2)!=s.node(-2).childCount-1)return!1;if(n){for(var u=o.Fragment.empty,d=s.index(-1)?1:s.index(-2)?2:3,p=s.depth-d;p>=s.depth-3;p--)u=o.Fragment.from(s.node(p).copy(u));var f=s.indexAfter(-1)<s.node(-2).childCount?1:s.indexAfter(-2)<s.node(-3).childCount?2:3;u=u.append(o.Fragment.from(e.createAndFill()));var h=s.before(s.depth-(d-1)),m=t.tr.replace(h,s.after(-f),new o.Slice(u,4-d,0)),v=-1;m.doc.nodesBetween(h,m.doc.content.size,(function(e,t){if(v>-1)return!1;e.isTextblock&&0==e.content.size&&(v=t+1)})),v>-1&&m.setSelection(t.selection.constructor.near(m.doc.resolve(v))),n(m.scrollIntoView())}return!0}var g=a.pos==s.end()?c.contentMatchAt(0).defaultType:null,y=t.tr.delete(s.pos,a.pos),w=g&&[null,{type:g}];return!!Object(r.canSplit)(y.doc,s.pos,2,w)&&(n&&n(y.split(s.pos,2,w).scrollIntoView()),!0)}}function m(e){return function(t,n){var i=t.selection,s=i.$from,a=i.$to,l=s.blockRange(a,(function(t){return t.childCount&&t.firstChild.type==e}));return!!l&&(!n||(s.node(l.depth-1).type==e?function(e,t,n,i){var s=e.tr,a=i.end,l=i.$to.end(i.depth);a<l&&(s.step(new r.ReplaceAroundStep(a-1,l,a,l,new o.Slice(o.Fragment.from(n.create(null,i.parent.copy())),1,0),1,!0)),i=new o.NodeRange(s.doc.resolve(i.$from.pos),s.doc.resolve(l),i.depth));return t(s.lift(i,Object(r.liftTarget)(i)).scrollIntoView()),!0}(t,n,e,l):function(e,t,n){for(var i=e.tr,s=n.parent,a=n.end,l=n.endIndex-1,c=n.startIndex;l>c;l--)a-=s.child(l).nodeSize,i.delete(a-1,a+1);var u=i.doc.resolve(n.start),d=u.nodeAfter;if(i.mapping.map(n.end)!=n.start+u.nodeAfter.nodeSize)return!1;var p=0==n.startIndex,f=n.endIndex==s.childCount,h=u.node(-1),m=u.index(-1);if(!h.canReplace(m+(p?0:1),m+1,d.content.append(f?o.Fragment.empty:o.Fragment.from(s))))return!1;var v=u.pos,g=v+d.nodeSize;return i.step(new r.ReplaceAroundStep(v-(p?1:0),g+(f?1:0),v+1,g-1,new o.Slice((p?o.Fragment.empty:o.Fragment.from(s.copy(o.Fragment.empty))).append(f?o.Fragment.empty:o.Fragment.from(s.copy(o.Fragment.empty))),p?0:1,f?0:1),p?0:1)),t(i.scrollIntoView()),!0}(t,n,l)))}}function v(e){return function(t,n){var i=t.selection,s=i.$from,a=i.$to,l=s.blockRange(a,(function(t){return t.childCount&&t.firstChild.type==e}));if(!l)return!1;var c=l.startIndex;if(0==c)return!1;var u=l.parent,d=u.child(c-1);if(d.type!=e)return!1;if(n){var p=d.lastChild&&d.lastChild.type==u.type,f=o.Fragment.from(p?e.create():null),h=new o.Slice(o.Fragment.from(e.create(null,o.Fragment.from(u.type.create(null,f)))),p?3:1,0),m=l.start,v=l.end;n(t.tr.step(new r.ReplaceAroundStep(m-(p?3:1),v,m,v,h,1,!0)).scrollIntoView())}return!0}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.directions={southeast:{x:1,y:1},east:{x:1,y:0},south:{x:0,y:1},north:{x:0,y:-1},west:{x:-1,y:0},southwest:{x:-1,y:1},northwest:{x:-1,y:-1},northeast:{x:1,y:-1}},t.handles=Object.keys(t.directions)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4),o=n(18);t.indentRules={nodes:[{node:"paragraph",style:"margin-left",rtlStyle:"margin-right",step:30,unit:"px"},{node:"heading",style:"margin-left",rtlStyle:"margin-right",step:30,unit:"px"}],listsTypes:r.__assign({},o.listsTypes)},t.outdentRules={nodes:[{node:"paragraph",style:"margin-left",rtlStyle:"margin-right",step:-30,unit:"px"},{node:"heading",style:"margin-left",rtlStyle:"margin-right",step:-30,unit:"px"}],listsTypes:r.__assign({},o.listsTypes)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4);t.listsTypes={orderedList:"ordered_list",bulletList:"bullet_list",listItem:"list_item"},t.orderedList={listType:t.listsTypes.orderedList,types:r.__assign({},t.listsTypes)},t.bulletList={listType:t.listsTypes.bulletList,types:r.__assign({},t.listsTypes)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(11);t.blockquote=function(e,t){return r.wrapIn(e.schema.nodes.blockquote)(e,t)},t.liftBlockquote=function(e,t){var n=e.selection,r=n.$from,o=n.$to,i=e.schema.nodes.blockquote,s=e.doc,a=-1,l=r.blockRange(o);l&&s.nodesBetween(l.start,l.end,(function(e,t,n,r){e.type===i&&(a=t)}));var c=-1!==a;return t&&c&&t(e.tr.lift(l,s.resolve(a).depth)),c}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4),o=n(0),i=n(1),s=n(2),a=n(11),l=n(15),c=n(18),u=function(e,t,n){for(var r=t.depth,o=e.nodes[n.bulletList],i=e.nodes[n.orderedList],s=e.nodes[n.listItem],a=t.depth;a>0;a--){var l=t.node(a);if(l.type!==o&&l.type!==i||(r=a),l.type!==o&&l.type!==i&&l.type!==s)break}return r-1};function d(e){return function(t,n,r){if(!r)return!1;var o=(t=r.state).schema.nodes[e.listType],i=t.selection,s=i.$from,c=i.$to,u=s.node(-2),d=s.node(-3),p=function(e,t,n,r){return 0===function(e,t,n){var r=Array(),o=function(e,t){var n=["blockquote","bulletList","orderedList"];if(1===t.depth)return t;var r=t.node(t.depth),o=t;for(;t.depth>=1;)t=e.resolve(t.before(t.depth)),(r=t.node(t.depth))&&-1!==n.indexOf(r.type.name)&&(o=t);return o}(e,t).depth,i=e.resolve(t.start(o));for(;i.pos<=n.start(n.depth);){var s=Math.min(i.depth,o),a=i.node(s);if(a&&r.push(a),0===s)break;var l=e.resolve(i.after(s));if(l.start(s)>=e.nodeSize-2)break;l.depth!==i.depth&&(l=e.resolve(l.pos+2)),i=l.depth?e.resolve(l.start(l.depth)):e.resolve(l.end(l.depth))}return r}(e,t,n).filter((function(e){return e.type!==r})).length}(t.doc,s,c,o);return(u&&u.type===o||d&&d.type===o)&&p?f(e)(t,n):(p||(f(e)(t,n),t=r.state),function(e,t){void 0===t&&(t={});return a.autoJoin(l.wrapInList(e,t),(function(t,n){return t.type===n.type&&t.type===e}))}(o,e.listAttrs)(t,n))}}function p(e,t,n,r){var i=r||e.schema.nodes.listItem,a=t.$from,l=t.$to,c=a.blockRange(l,(function(e){return e.childCount&&e.firstChild.type===i}));if(!c||c.depth<2||a.node(c.depth-1).type!==i)return n;var u=c.end,d=l.end(c.depth);return u<d&&(n.step(new s.ReplaceAroundStep(u-1,d,u,d,new o.Slice(o.Fragment.from(i.create(void 0,c.parent.copy())),1,0),1,!0)),c=new o.NodeRange(n.doc.resolve(a.pos),n.doc.resolve(d),c.depth)),n.lift(c,s.liftTarget(c)).scrollIntoView()}function f(e){return function(t,n){var r=t.tr,o=t.selection,a=o.$from,l=o.$to;return r.doc.nodesBetween(a.pos,l.pos,(function(n,o){if(n.isTextblock||"blockquote"===n.type.name||"div"===n.type.name){var a=new i.NodeSelection(r.doc.resolve(r.mapping.map(o))),l=a.$from.blockRange(a.$to);if(!l||a.$from.parent.type!==t.schema.nodes[e.listItem])return!1;var c=l&&s.liftTarget(l);if(null==c)return!1;r.lift(l,c)}})),n&&n(r),!0}}var h=/list\-style\-type:\s?([\w-]+)/;t.listStyle=function(e){var t=e.style||"",n=h.exec(t);return n&&n[1]||""},t.toggleList=function(e,n,r,o,s){var a=o.listType,l=o.listAttrs,c=void 0===l?{style:null}:l,f=e.selection,h=f.$from.node(f.$from.depth-2),m=f.$to.node(f.$to.depth-2);if(h&&h.type.name===a&&t.listStyle(h.attrs)===t.listStyle(c)&&m&&m.type.name===a&&t.listStyle(m.attrs)===t.listStyle(c)){var v=r.state.schema.nodes,g={bulletList:v[o.bulletList],orderedList:v[o.orderedList],listItem:v[o.listItem]},y=function(e,t){for(var n,r=t.bulletList,o=t.orderedList,i=t.listItem,s=e.depth-1;s>0;s--){var a=e.node(s);if(a.type!==r&&a.type!==o||(n=s),a.type!==r&&a.type!==o&&a.type!==i)break}return n}(f.$to,g),w=function(e,t,n,r,o,s){s||(s=e.schema.nodes.listItem);var a=!1;return o.doc.nodesBetween(t,n,(function(n,l){if(!a&&n.type===s&&l>t){a=!0;for(var c=r+3;c>r+2;){var u=o.doc.resolve(o.mapping.map(l));c=u.depth;var d=o.doc.resolve(o.mapping.map(l+n.textContent.length)),f=new i.TextSelection(u,d);o=p(e,f,o,s)}}})),o}(e,f.$to.pos,f.$to.end(y),y,r.state.tr,g.listItem);return(w=function(e,t,n){var r=e.selection,o=r.from,i=r.to,s=e.schema.nodes,a=s.paragraph,l=s.heading,c=[];t.doc.nodesBetween(o,i,(function(e,t){e.type!==a&&e.type!==l||c.push({node:e,pos:t})}));for(var d=c.length-1;d>=0;d--){var p=c[d],f=t.doc.resolve(t.mapping.map(p.pos));if(f.depth>0){var h=void 0;h=p.node.textContent&&p.node.textContent.length>0?t.doc.resolve(t.mapping.map(p.pos+p.node.textContent.length)):t.doc.resolve(t.mapping.map(p.pos+1));var m=f.blockRange(h);m&&t.lift(m,u(e.schema,f,n))}}return t}(e,w,o)).setMeta("commandName",s),n(w),!0}return d(o)(e,n,r)},t.toggleUnorderedList=function(e,n,o){return t.toggleList(e,n,o,r.__assign({listType:c.bulletList.listType},c.bulletList.types))},t.toggleOrderedList=function(e,n,o){return t.toggleList(e,n,o,r.__assign({listType:c.orderedList.listType},c.orderedList.types))},t.splitListItemKeepMarks=function(e){return function(t,n){return l.splitListItem(e)(t,(function(e){var r=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();r&&e.ensureMarks(r),n(e)}))}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4),o=n(0),i=n(8),s=n(13),a=n(6),l=["blockquote",0],c=["hr"],u=["pre",["code",0]],d=["ol",0],p=["ul",0],f=["li",0],h=function(e){for(var t,n={},r=e.attributes,o=0;o<r.length;o++)n[(t=r[o]).name]=t.value;return n},m=function(e){var t={};return e.forEach((function(e){t[e]={default:null}})),t},v=function(){return m(["style","class","id"])},g=function(e,t){for(var n in e)if(n&&null!==e[n]&&n!==t)return!0;return!1},y=function(e,t){void 0===t&&(t=[]);var n={},r=function(r){r&&null!==e[r]&&!t.find((function(e){return e===r}))&&(n[r]=e[r])};for(var o in e)r(o);return n},w=function(e){var t;return(t={})[e]={name:e,inclusive:!0,parseDOM:[{tag:e}],toDOM:function(){return[e,0]}},t},b=r.__assign({link:{attrs:r.__assign({},v(),{href:{default:null},target:{default:null},title:{default:null}}),inclusive:!1,parseDOM:[{tag:"a",getAttrs:h}],toDOM:function(e){return["a",y(e.attrs),0]}}},w("strong"),w("b"),w("em"),w("i"),w("u"),w("del"),w("sub"),w("sup"),w("code"),{style:{attrs:r.__assign({},v()),parseDOM:[{tag:"span",getAttrs:h}],toDOM:function(e){return g(e.attrs)?["span",y(e.attrs),0]:["span",0]}}});t.marks=b;var S=function(e){var t;return(t={})[e]={default:null,getFromDOM:function(t){return t.getAttribute(e)},setDOMAttr:function(t,n){n[e]=t}},t},k=r.__assign({},S("style"),S("class"),S("id"),S("headers")),x={doc:{content:"colgroup*"},col:{attrs:m(["id","class","style","span"]),parseDOM:[{getAttrs:h,tag:"col"}],toDOM:function(e){return["col",e.attrs]}},colgroup:{attrs:m(["id","class","style","span"]),content:"col*",parseDOM:[{getAttrs:h,tag:"colgroup"}],toDOM:function(e){return["colgroup",e.attrs,0]}},text:{inline:!0,group:"inline"}},C=new o.Schema({nodes:x,marks:{}});t.parseStrColgroup=function(e){var t=s.domToPmDoc(s.htmlToFragment(e),C,{preserveWhitespace:!1});return s.pmDocToFragment(t).firstChild};var M=i.tableNodes({tableGroup:"block",cellContent:"block+",cellAttributes:k});M.table_row.attrs=r.__assign({},M.table_row.attrs,m([a.rowTypeAttr,"style","class","id"])),M.table_row.toDOM=function(e){return["tr",y(e.attrs),0]},M.table_row.parseDOM=[{tag:"tr",getAttrs:h}],M.table.attrs=r.__assign({},M.table.attrs,m(["style","class","id",a.colgroupAttr,a.resizableAttr])),M.table.toDOM=function(e){var n=g(e.attrs)?y(e.attrs,[a.colgroupAttr,a.resizableAttr]):{},r=null;if(e.attrs[a.colgroupAttr]&&!function(e){for(var t=!1,n=e.child(0),r=0;r<n.childCount;r++){if(n.child(r).attrs.colwidth){t=!0;break}}return t}(e)){var o=t.parseStrColgroup(e.attrs[a.colgroupAttr]);if(o){var i=Array.from(o.children).map((function(e){return["col",h(e)]}));r=["colgroup",h(o)].concat(i)}}return r?["table",n,r,["tbody",0]]:["table",n,["tbody",0]]},M.table.parseDOM=[{tag:"table",getAttrs:function(e){var t=h(e),n=Array.from(e.childNodes).find((function(e){return"COLGROUP"===e.nodeName}));return n&&(t[a.colgroupAttr]=n.outerHTML),t}}];var O=r.__assign({doc:{content:"block+"},paragraph:{content:"inline*",group:"block",attrs:r.__assign({},v()),parseDOM:[{tag:"p",getAttrs:h}],toDOM:function(e){return g(e.attrs)?["p",y(e.attrs),0]:["p",0]}},div:{content:"block*",group:"block",attrs:r.__assign({},v()),parseDOM:[{tag:"div",getAttrs:h}],toDOM:function(e){return g(e.attrs)?["div",y(e.attrs),0]:["div",0]}},blockquote:{attrs:r.__assign({},v()),content:"block+",group:"block",defining:!0,parseDOM:[{tag:"blockquote",getAttrs:h}],toDOM:function(e){return g(e.attrs)?["blockquote",y(e.attrs),0]:l}},horizontal_rule:{group:"block",parseDOM:[{tag:"hr"}],toDOM:function(){return c}},heading:{attrs:r.__assign({},v(),{level:{default:1}}),content:"inline*",group:"block",defining:!0,parseDOM:[{tag:"h1",getAttrs:function(e){return r.__assign({},h(e),{level:1})}},{tag:"h2",getAttrs:function(e){return r.__assign({},h(e),{level:2})}},{tag:"h3",getAttrs:function(e){return r.__assign({},h(e),{level:3})}},{tag:"h4",getAttrs:function(e){return r.__assign({},h(e),{level:4})}},{tag:"h5",getAttrs:function(e){return r.__assign({},h(e),{level:5})}},{tag:"h6",getAttrs:function(e){return r.__assign({},h(e),{level:6})}}],toDOM:function(e){return g(e.attrs,"level")?["h"+e.attrs.level,y(e.attrs,["level"]),0]:["h"+e.attrs.level,0]}},code_block:{content:"text*",marks:"",group:"block",code:!0,defining:!0,parseDOM:[{tag:"pre",preserveWhitespace:"full"}],toDOM:function(){return u}},text:{inline:!0,group:"inline"},image:{inline:!0,attrs:r.__assign({src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}},v()),group:"inline",draggable:!0,parseDOM:[{tag:"img",getAttrs:h}],toDOM:function(e){return g(e.attrs)?["img",y(e.attrs)]:["img"]}},hard_break:{inline:!0,attrs:r.__assign({},v()),group:"inline",selectable:!1,parseDOM:[{tag:"br",getAttrs:h}],toDOM:function(e){return g(e.attrs)?["br",y(e.attrs)]:["br"]}},ordered_list:{content:"list_item+",group:"block",attrs:r.__assign({},v(),{type:{default:null},order:{default:1}}),parseDOM:[{tag:"ol",getAttrs:function(e){return r.__assign({},h(e),{order:e.hasAttribute("start")?parseInt(e.getAttribute("start")||"1",10):1})}}],toDOM:function(e){return 1===e.attrs.order?g(e.attrs,"order")?["ol",y(e.attrs,["order"]),0]:d:["ol",r.__assign({},y(e.attrs,["order"]),{start:e.attrs.order}),0]}},bullet_list:{content:"list_item+",group:"block",attrs:r.__assign({},v()),parseDOM:[{tag:"ul",getAttrs:h}],toDOM:function(e){return g(e.attrs)?["ul",y(e.attrs),0]:p}},list_item:{content:"(paragraph | heading) block*",attrs:r.__assign({},v()),parseDOM:[{tag:"li",getAttrs:h}],toDOM:function(e){return g(e.attrs)?["li",y(e.attrs),0]:f},defining:!0}},M);t.nodes=O},function(e,t,n){"use strict";n.r(t),n.d(t,"InputRule",(function(){return i})),n.d(t,"closeDoubleQuote",(function(){return p})),n.d(t,"closeSingleQuote",(function(){return h})),n.d(t,"ellipsis",(function(){return u})),n.d(t,"emDash",(function(){return c})),n.d(t,"inputRules",(function(){return s})),n.d(t,"openDoubleQuote",(function(){return d})),n.d(t,"openSingleQuote",(function(){return f})),n.d(t,"smartQuotes",(function(){return m})),n.d(t,"textblockTypeInputRule",(function(){return g})),n.d(t,"undoInputRule",(function(){return l})),n.d(t,"wrappingInputRule",(function(){return v}));var r=n(1),o=n(2),i=function(e,t){var n;this.match=e,this.handler="string"==typeof t?(n=t,function(e,t,r,o){var i=n;if(t[1]){var s=t[0].lastIndexOf(t[1]);i+=t[0].slice(s+t[1].length);var a=(r+=s)-o;a>0&&(i=t[0].slice(s-a,s)+i,r=o)}return e.tr.insertText(i,r,o)}):t};function s(e){var t=e.rules,n=new r.Plugin({state:{init:function(){return null},apply:function(e,t){var n=e.getMeta(this);return n||(e.selectionSet||e.docChanged?null:t)}},props:{handleTextInput:function(e,r,o,i){return a(e,r,o,i,t,n)},handleDOMEvents:{compositionend:function(e){setTimeout((function(){var r=e.state.selection.$cursor;r&&a(e,r.pos,r.pos,"",t,n)}))}}},isInputRules:!0});return n}function a(e,t,n,r,o,i){if(e.composing)return!1;var s=e.state,a=s.doc.resolve(t);if(a.parent.type.spec.code)return!1;for(var l=a.parent.textBetween(Math.max(0,a.parentOffset-500),a.parentOffset,null,"")+r,c=0;c<o.length;c++){var u=o[c].match.exec(l),d=u&&o[c].handler(s,u,t-(u[0].length-r.length),n);if(d)return e.dispatch(d.setMeta(i,{transform:d,from:t,to:n,text:r})),!0}return!1}function l(e,t){for(var n=e.plugins,r=0;r<n.length;r++){var o=n[r],i=void 0;if(o.spec.isInputRules&&(i=o.getState(e))){if(t){for(var s=e.tr,a=i.transform,l=a.steps.length-1;l>=0;l--)s.step(a.steps[l].invert(a.docs[l]));if(i.text){var c=s.doc.resolve(i.from).marks();s.replaceWith(i.from,i.to,e.schema.text(i.text,c))}else s.delete(i.from,i.to);t(s)}return!0}}return!1}var c=new i(/--$/,"—"),u=new i(/\.\.\.$/,"…"),d=new i(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,"“"),p=new i(/"$/,"”"),f=new i(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,"‘"),h=new i(/'$/,"’"),m=[d,p,f,h];function v(e,t,n,r){return new i(e,(function(e,i,s,a){var l=n instanceof Function?n(i):n,c=e.tr.delete(s,a),u=c.doc.resolve(s).blockRange(),d=u&&Object(o.findWrapping)(u,t,l);if(!d)return null;c.wrap(u,d);var p=c.doc.resolve(s-1).nodeBefore;return p&&p.type==t&&Object(o.canJoin)(c.doc,s-1)&&(!r||r(i,p))&&c.join(s-1),c}))}function g(e,t,n){return new i(e,(function(e,r,o,i){var s=e.doc.resolve(o),a=n instanceof Function?n(r):n;return s.node(-1).canReplaceWith(s.index(-1),s.indexAfter(-1),t)?e.tr.delete(o,i).setBlockType(o,o,t,a):null}))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bold={mark:"strong",altMarks:["b"],altStyle:{name:"font-weight",value:/^(bold(er)?|[5-9]\d{2,})$/}},t.italic={mark:"em",altMarks:["i"],altStyle:{name:"font-style",value:/^italic$/i}},t.underline={mark:"u",altStyle:{name:"text-decoration",value:/^underline$/i}},t.strikethrough={mark:"del",altStyle:{name:"text-decoration",value:/^line-through$/i}},t.subscript={mark:"sub"},t.superscript={mark:"sup"},t.link={mark:"link"},t.unlink={mark:"link"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=/style=['"]?[^'"]*?mso-list:\s*[a-zA-Z]+(\d+)\s[a-zA-Z]+(\d+)\s(\w+)/gi,o=function(e){return/^MsoListParagraph/.test(e.className)},i=function(e){var t=e.innerHTML;return t=(t=t.replace(/<!--(.|\s)*?-->/gi,"")).replace(/<\/?[^>]+?\/?>/gm,"")},s=function(e,t){var n=document.createElement(e);return n.style.listStyleType=t,n},a=function(e){var t=null;return/^\d/.test(e)||(t=(/^[a-z]/.test(e)?"lower-":"upper-")+(/^[ivxlcdm]/i.test(e)?"roman":"alpha")),t},l=function(e,t){var n=[];Array.from(e).forEach((function(e){if(e.nodeType===Node.ELEMENT_NODE){var r=e;r.getAttribute("datalist")?(n.push(e),t.add(n)):o(r)&&n.length?n.push(e):(n=[],"DIV"===r.nodeName?l(r.children,t):"TABLE"===r.nodeName&&Array.from(r.querySelectorAll("td,th")).forEach((function(e){l(e.children,t)})))}}))},c=function(e){var t,n=e.innerHTML,r=function(e){return e.replace(/^(?: |[\u00a0\n\r\s])+/,"")};return n=n.replace(/<\/?\w+[^>]*>/g,"").replace(/ /g," "),/^[\u2022\u00b7\u00a7\u00d8oØüvn][\u00a0 ]+/.test(n)?{tag:"ul",style:(t=r(i(e)),/^[\u2022\u00b7\u00FC\u00D8\u002dv-]/.test(t)?null:/^o/.test(t)?"circle":"square")}:/^\s*\w+[\.\)][\u00a0 ]{2,}/.test(n)?{tag:"ol",style:a(r(i(e)))}:void 0},u=function(e){var t,n=e.nodeName.toLowerCase();e.firstChild&&e.firstChild.nodeType===Node.COMMENT_NODE&&e.removeChild(e.firstChild),1===e.childNodes.length?t=e.firstChild.nodeType===Node.TEXT_NODE?i(e):e.firstChild.innerHTML.replace(/^\w+[\.\)]( )+ /,""):(e.removeChild(e.firstChild),3===e.firstChild.nodeType&&/^[ivxlcdm]+\.$/i.test(e.firstChild.nodeValue)&&e.removeChild(e.firstChild),/^( |\s)+$/i.test(e.firstChild.innerHTML)&&e.removeChild(e.firstChild),t="p"!==n?"<"+n+">"+e.innerHTML+"</"+n+">":e.innerHTML),e.parentNode.removeChild(e);var r=document.createElement("li");return r.innerHTML=t,r};t.convertMsLists=function(e){var t=document.createElement("div");t.innerHTML=function(e){return e=e.replace(r,(function(e,t,n){return'datalist="'+t+'" datalevel="'+n+'" '+e}))}(e);var n=new Set;return l(t.children,n),n.forEach((function(e){return function(e){var t,n,r,i,a,l,d,p,f,h,m,v,g,y=-1,w={};for(p=0;p<e.length;p++){var b=(g={datalist:(f=e[p]).getAttribute("datalist"),datalevel:f.getAttribute("datalevel")}).datalist,S=c(f);if(h=S&&S.tag){if(m=g.datalevel||parseFloat(f.style.marginLeft||0),g.datalevel||f.style.marginLeft){var k=h+b;w[m]||(w[m]={}),(!n||n<0)&&(n=m,r=b,i=(d=e.filter((function(e){return e.getAttribute("datalist")===String(r)})))[d.length-1],l=s(h,S&&S.style),f.parentNode.insertBefore(l,f),y=m,w[m][k]=l),a=i===f,v=w[m][k],(m>y||!v)&&(v=s(h,S&&S.style),w[m][k]=v,t.appendChild(v)),t=u(f),v.appendChild(t),a?n=y=-1:y=m}}else!t||a&&!o(f)||(f.style.marginLeft&&(f.style.marginLeft=""),f.style.marginLeft&&(f.style.margin=""),t.appendChild(f))}}(e)})),t.innerHTML}},function(e,t,n){"use strict";n.r(t),n.d(t,"HistoryState",(function(){return d})),n.d(t,"closeHistory",(function(){return w})),n.d(t,"history",(function(){return k})),n.d(t,"redo",(function(){return C})),n.d(t,"redoDepth",(function(){return O})),n.d(t,"undo",(function(){return x})),n.d(t,"undoDepth",(function(){return M}));var r=function(){};r.prototype.append=function(e){return e.length?(e=r.from(e),!this.length&&e||e.length<200&&this.leafAppend(e)||this.length<200&&e.leafPrepend(this)||this.appendInner(e)):this},r.prototype.prepend=function(e){return e.length?r.from(e).append(this):this},r.prototype.appendInner=function(e){return new i(this,e)},r.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t?r.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},r.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},r.prototype.forEach=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},r.prototype.map=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length);var r=[];return this.forEach((function(t,n){return r.push(e(t,n))}),t,n),r},r.from=function(e){return e instanceof r?e:e&&e.length?new o(e):r.empty};var o=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return 0==e&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var o=t;o<n;o++)if(!1===e(this.values[o],r+o))return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var o=t-1;o>=n;o--)if(!1===e(this.values[o],r+o))return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=200)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=200)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(r);r.empty=new o([]);var i=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,n,r){var o=this.left.length;return!(t<o&&!1===this.left.forEachInner(e,t,Math.min(n,o),r))&&(!(n>o&&!1===this.right.forEachInner(e,Math.max(t-o,0),Math.min(this.length,n)-o,r+o))&&void 0)},t.prototype.forEachInvertedInner=function(e,t,n,r){var o=this.left.length;return!(t>o&&!1===this.right.forEachInvertedInner(e,t-o,Math.max(n,o)-o,r+o))&&(!(n<o&&!1===this.left.forEachInvertedInner(e,Math.min(t,o),n,r))&&void 0)},t.prototype.sliceInner=function(e,t){if(0==e&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(r),s=r,a=n(2),l=n(1),c=function(e,t){this.items=e,this.eventCount=t};c.prototype.popEvent=function(e,t){var n=this;if(0==this.eventCount)return null;for(var r,o,i=this.items.length;;i--){if(this.items.get(i-1).selection){--i;break}}t&&(r=this.remapping(i,this.items.length),o=r.maps.length);var s,a,l=e.tr,d=[],p=[];return this.items.forEach((function(e,t){if(!e.step)return r||(r=n.remapping(i,t+1),o=r.maps.length),o--,void p.push(e);if(r){p.push(new u(e.map));var f,h=e.step.map(r.slice(o));h&&l.maybeStep(h).doc&&(f=l.mapping.maps[l.mapping.maps.length-1],d.push(new u(f,null,null,d.length+p.length))),o--,f&&r.appendMap(f,o)}else l.maybeStep(e.step);return e.selection?(s=r?e.selection.map(r.slice(o)):e.selection,a=new c(n.items.slice(0,i).append(p.reverse().concat(d)),n.eventCount-1),!1):void 0}),this.items.length,0),{remaining:a,transform:l,selection:s}},c.prototype.addTransform=function(e,t,n,r){for(var o=[],i=this.eventCount,s=this.items,a=!r&&s.length?s.get(s.length-1):null,l=0;l<e.steps.length;l++){var d,f=e.steps[l].invert(e.docs[l]),h=new u(e.mapping.maps[l],f,t);(d=a&&a.merge(h))&&(h=d,l?o.pop():s=s.slice(0,s.length-1)),o.push(h),t&&(i++,t=null),r||(a=h)}var m,v,g,y=i-n.depth;return y>p&&(v=y,(m=s).forEach((function(e,t){if(e.selection&&0==v--)return g=t,!1})),s=m.slice(g),i-=y),new c(s.append(o),i)},c.prototype.remapping=function(e,t){var n=new a.Mapping;return this.items.forEach((function(t,r){var o=null!=t.mirrorOffset&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:null;n.appendMap(t.map,o)}),e,t),n},c.prototype.addMaps=function(e){return 0==this.eventCount?this:new c(this.items.append(e.map((function(e){return new u(e)}))),this.eventCount)},c.prototype.rebased=function(e,t){if(!this.eventCount)return this;var n=[],r=Math.max(0,this.items.length-t),o=e.mapping,i=e.steps.length,s=this.eventCount;this.items.forEach((function(e){e.selection&&s--}),r);var a=t;this.items.forEach((function(t){var r=o.getMirror(--a);if(null!=r){i=Math.min(i,r);var l=o.maps[r];if(t.step){var c=e.steps[r].invert(e.docs[r]),d=t.selection&&t.selection.map(o.slice(a+1,r));d&&s++,n.push(new u(l,c,d))}else n.push(new u(l))}}),r);for(var l=[],d=t;d<i;d++)l.push(new u(o.maps[d]));var p=this.items.slice(0,r).append(l).append(n),f=new c(p,s);return f.emptyItemCount()>500&&(f=f.compress(this.items.length-n.length)),f},c.prototype.emptyItemCount=function(){var e=0;return this.items.forEach((function(t){t.step||e++})),e},c.prototype.compress=function(e){void 0===e&&(e=this.items.length);var t=this.remapping(0,e),n=t.maps.length,r=[],o=0;return this.items.forEach((function(i,s){if(s>=e)r.push(i),i.selection&&o++;else if(i.step){var a=i.step.map(t.slice(n)),l=a&&a.getMap();if(n--,l&&t.appendMap(l,n),a){var c=i.selection&&i.selection.map(t.slice(n));c&&o++;var d,p=new u(l.invert(),a,c),f=r.length-1;(d=r.length&&r[f].merge(p))?r[f]=d:r.push(p)}}else i.map&&n--}),this.items.length,0),new c(s.from(r.reverse()),o)},c.empty=new c(s.empty,0);var u=function(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r};u.prototype.merge=function(e){if(this.step&&e.step&&!e.selection){var t=e.step.merge(this.step);if(t)return new u(t.getMap().invert(),t,this.selection)}};var d=function(e,t,n,r){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r},p=20;function f(e){var t=[];return e.forEach((function(e,n,r,o){return t.push(r,o)})),t}function h(e,t){if(!e)return null;for(var n=[],r=0;r<e.length;r+=2){var o=t.map(e[r],1),i=t.map(e[r+1],-1);o<=i&&n.push(o,i)}return n}function m(e,t,n,r){var o=y(t),i=b.get(t).spec.config,s=(r?e.undone:e.done).popEvent(t,o);if(s){var a=s.selection.resolve(s.transform.doc),l=(r?e.done:e.undone).addTransform(s.transform,t.selection.getBookmark(),i,o),c=new d(r?l:s.remaining,r?s.remaining:l,null,0);n(s.transform.setSelection(a).setMeta(b,{redo:r,historyState:c}).scrollIntoView())}}var v=!1,g=null;function y(e){var t=e.plugins;if(g!=t){v=!1,g=t;for(var n=0;n<t.length;n++)if(t[n].spec.historyPreserveItems){v=!0;break}}return v}function w(e){return e.setMeta(S,!0)}var b=new l.PluginKey("history"),S=new l.PluginKey("closeHistory");function k(e){return e={depth:e&&e.depth||100,newGroupDelay:e&&e.newGroupDelay||500},new l.Plugin({key:b,state:{init:function(){return new d(c.empty,c.empty,null,0)},apply:function(t,n,r){return function(e,t,n,r){var o,i=n.getMeta(b);if(i)return i.historyState;n.getMeta(S)&&(e=new d(e.done,e.undone,null,0));var s=n.getMeta("appendedTransaction");if(0==n.steps.length)return e;if(s&&s.getMeta(b))return s.getMeta(b).redo?new d(e.done.addTransform(n,null,r,y(t)),e.undone,f(n.mapping.maps[n.steps.length-1]),e.prevTime):new d(e.done,e.undone.addTransform(n,null,r,y(t)),null,e.prevTime);if(!1===n.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))return(o=n.getMeta("rebased"))?new d(e.done.rebased(n,o),e.undone.rebased(n,o),h(e.prevRanges,n.mapping),e.prevTime):new d(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),h(e.prevRanges,n.mapping),e.prevTime);var a=0==e.prevTime||!s&&(e.prevTime<(n.time||0)-r.newGroupDelay||!function(e,t){if(!t)return!1;if(!e.docChanged)return!0;var n=!1;return e.mapping.maps[0].forEach((function(e,r){for(var o=0;o<t.length;o+=2)e<=t[o+1]&&r>=t[o]&&(n=!0)})),n}(n,e.prevRanges)),l=s?h(e.prevRanges,n.mapping):f(n.mapping.maps[n.steps.length-1]);return new d(e.done.addTransform(n,a?t.selection.getBookmark():null,r,y(t)),c.empty,l,n.time)}(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput:function(e,t){var n="historyUndo"==t.inputType?x(e.state,e.dispatch):"historyRedo"==t.inputType&&C(e.state,e.dispatch);return n&&t.preventDefault(),n}}}})}function x(e,t){var n=b.getState(e);return!(!n||0==n.done.eventCount)&&(t&&m(n,e,t,!1),!0)}function C(e,t){var n=b.getState(e);return!(!n||0==n.undone.eventCount)&&(t&&m(n,e,t,!0),!0)}function M(e){var t=b.getState(e);return t?t.done.eventCount:0}function O(e){var t=b.getState(e);return t?t.undone.eventCount:0}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4),o=n(13);t.getHtml=o.getHtml,t.setHtml=o.setHtml,t.parseContent=o.parseContent,t.trimWhitespace=o.trimWhitespace,t.htmlToFragment=o.htmlToFragment,t.domToPmDoc=o.domToPmDoc,t.pmDocToFragment=o.pmDocToFragment;var i=n(14);t.applyInlineStyle=i.applyInlineStyle,t.getInlineStyles=i.getInlineStyles,t.toggleInlineFormat=i.toggleInlineFormat;var s=n(27);t.applyLink=s.applyLink,t.removeLink=s.removeLink;var a=n(28);t.insertText=a.insertText;var l=n(29);t.insertImage=l.insertImage;var c=n(30);t.alignBlocks=c.alignBlocks,t.isAligned=c.isAligned;var u=n(31);t.cleanFormatting=u.cleanFormatting;var d=n(10);t.hasNode=d.hasNode,t.activeNode=d.activeNode,t.formatBlockElements=d.formatBlockElements,t.getBlockFormats=d.getBlockFormats,t.parentBlockFormat=d.parentBlockFormat,t.changeTextBlock=d.changeTextBlock,t.blockNodes=d.blockNodes,t.cleanTextBlockFormatting=d.cleanTextBlockFormatting;var p=n(7);t.hasMark=p.hasMark,t.getMark=p.getMark,t.getActiveMarks=p.getActiveMarks,t.removeAllMarks=p.removeAllMarks,t.cleanMarks=p.cleanMarks,t.selectionMarks=p.selectionMarks;var f=n(32);t.indent=f.indent,t.canIndentAsListItem=f.canIndentAsListItem,t.outdent=f.outdent,t.canOutdentAsListItem=f.canOutdentAsListItem,t.isIndented=f.isIndented,t.canBeIndented=f.canBeIndented,t.indentBlocks=f.indentBlocks;var h=n(20);t.toggleOrderedList=h.toggleOrderedList,t.toggleUnorderedList=h.toggleUnorderedList,t.toggleList=h.toggleList,t.listStyle=h.listStyle;var m=n(19);t.blockquote=m.blockquote,t.liftBlockquote=m.liftBlockquote;var v=n(5);t.hasSameMarkup=v.hasSameMarkup,t.getSelectionText=v.getSelectionText,t.getNodeFromSelection=v.getNodeFromSelection,t.selectedLineTextOnly=v.selectedLineTextOnly,t.expandSelection=v.expandSelection,t.expandToWordWrap=v.expandToWordWrap,t.canInsert=v.canInsert,t.insertNode=v.insertNode,t.indentHtml=v.indentHtml;var g=n(33);t.alignLeftRules=g.alignLeftRules,t.alignCenterRules=g.alignCenterRules,t.alignRightRules=g.alignRightRules,t.alignJustifyRules=g.alignJustifyRules,t.alignRemoveRules=g.alignRemoveRules;var y=n(17);t.indentRules=y.indentRules,t.outdentRules=y.outdentRules;var w=n(21);t.nodes=w.nodes,t.marks=w.marks;var b=n(34);t.buildKeymap=b.buildKeymap,t.buildListKeymap=b.buildListKeymap;var S=n(23);t.bold=S.bold,t.italic=S.italic,t.underline=S.underline,t.strikethrough=S.strikethrough,t.subscript=S.subscript,t.superscript=S.superscript,t.link=S.link;var k=n(35);t.sanitize=k.sanitize,t.removeComments=k.removeComments,t.removeTag=k.removeTag,t.pasteCleanup=k.pasteCleanup,t.sanitizeClassAttr=k.sanitizeClassAttr,t.sanitizeStyleAttr=k.sanitizeStyleAttr,t.removeAttribute=k.removeAttribute,t.replaceImageSourcesFromRtf=k.replaceImageSourcesFromRtf;var x=n(24);t.convertMsLists=x.convertMsLists;var C=n(36);t.find=C.find,t.findAt=C.findAt,t.findAll=C.findAll,t.replace=C.replace,t.replaceAll=C.replaceAll;var M=n(37);t.placeholder=M.placeholder;var O=n(38);t.spacesFix=O.spacesFix;var T=n(39);t.textHighlight=T.textHighlight,t.textHighlightKey=T.textHighlightKey;var A=n(40);t.imageResizing=A.imageResizing,t.imageResizeKey=A.imageResizeKey;var N=n(41);t.caretColor=N.caretColor,t.caretColorKey=N.caretColorKey;var R=n(42);t.tableResizing=R.tableResizing,t.tableResizeKey=R.tableResizeKey,t.tableColumnResizeKey=R.tableColumnResizeKey,t.tableRowResizeKey=R.tableRowResizeKey,r.__exportStar(n(11),t),r.__exportStar(n(47),t),r.__exportStar(n(48),t),r.__exportStar(n(25),t),r.__exportStar(n(22),t),r.__exportStar(n(9),t),r.__exportStar(n(0),t),r.__exportStar(n(15),t),r.__exportStar(n(1),t);var D=n(8);t.TableMap=D.TableMap,t.tableEditing=D.tableEditing,t.tableEditingKey=D.tableEditingKey,t.tableNodeTypes=D.tableNodeTypes,t.tableNodes=D.tableNodes,t.fixTables=D.fixTables,t.fixTablesKey=D.fixTablesKey,t.isInTable=D.isInTable,t.deleteTable=D.deleteTable,t.inSameTable=D.inSameTable,t.CellSelection=D.CellSelection,t.selectedRect=D.selectedRect,t.selectionCell=D.selectionCell,t.setCellAttr=D.setCellAttr,t.goToNextCell=D.goToNextCell,t.toggleHeader=D.toggleHeader,t.toggleHeaderCell=D.toggleHeaderCell,t.toggleHeaderColumn=D.toggleHeaderColumn,t.toggleHeaderRow=D.toggleHeaderRow,t.splitCell=D.splitCell,t.splitCellWithType=D.splitCellWithType,t.mergeCells=D.mergeCells,t.deleteColumn=D.deleteColumn,t.deleteRow=D.deleteRow,t.rowIsHeader=D.rowIsHeader,t.addRow=D.addRow,t.addColSpan=D.addColSpan,t.addColumn=D.addColumn,t.addColumnAfter=D.addColumnAfter,t.addColumnBefore=D.addColumnBefore,t.colCount=D.colCount,t.columnIsHeader=D.columnIsHeader,t.columnResizing=D.columnResizing,t.columnResizingPluginKey=D.columnResizingPluginKey,t.updateColumnsOnResize=D.updateColumnsOnResize,t.cellAround=D.cellAround,t.findCell=D.findCell,t.removeColSpan=D.removeColSpan,t.moveCellForward=D.moveCellForward,t.nextCell=D.nextCell,r.__exportStar(n(2),t),r.__exportStar(n(3),t);var E=n(49);t.createTable=E.createTable,t.addRowAfter=E.addRowAfter,t.addRowBefore=E.addRowBefore,t.pmAddRowAfter=E.pmAddRowAfter,t.pmAddRowBefore=E.pmAddRowBefore},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(14),o=n(7),i=n(1);t.removeLink=function(e,t){return function(n,i){var s=n.selection.$cursor;if(s){var a=s.parent,l=s.index(),c=n.schema.marks[e.mark],u=a.child(l).marks.find((function(e){return e.type===c})),d=a.childCount,p=s.pos-s.textOffset,f=a.child(l).nodeSize,h=void 0,m=void 0;for(h=l-1;h>=0&&u.isInSet(a.child(h).marks);)f+=m=a.child(h).nodeSize,p-=m,h-=1;for(h=l+1;h<d&&u.isInSet(a.child(h).marks);)f+=a.child(h).nodeSize,h+=1;i(o.removeMark(t||n.tr,p,p+f,u))}else r.toggleInlineFormat(e,t)(n,i)}};t.applyLink=function(e,n){var s=e.mark,a=e.attrs;return void 0===n&&(n="link"),function(e,l){var c=e.schema.marks,u=e.tr;n&&(u.setMeta("commandName",n),u.setMeta("args",a));var d=!1,p=function(){return d=!0};if(function(e,t){var n=o.selectionMarks(e,t);return 1===n.length&&n[0]?n[0]:null}(e,c[s]))!function(e,t){return function(n,r){var o=n.selection,i=o.$cursor,s=o.from,a=o.to,l=n.schema.marks[e.mark];if(i){var c=i.parent,u=i.index(),d=c.child(u).marks.find((function(e){return e.type===l})),p=c.childCount,f=i.pos-i.textOffset,h=c.child(u).nodeSize,m=void 0,v=void 0;for(m=u-1;m>=0&&d.isInSet(c.child(m).marks);)h+=v=c.child(m).nodeSize,f-=v,m-=1;for(m=u+1;m<p&&d.isInSet(c.child(m).marks);)h+=c.child(m).nodeSize,m+=1;t.removeMark(f,f+h,l),t.addMark(f,f+h,l.create(e.attrs)),r(t)}else t.doc.nodesBetween(s,a,(function(n,o){n.isInline&&l.isInSet(n.marks)&&(t.removeMark(o,o+n.nodeSize,l),t.addMark(o,o+n.nodeSize,l.create(e.attrs)),r(t))}))}}({mark:s,attrs:a},u)(e,p);else{var f=e;o.hasMark(e,{mark:s})&&(t.removeLink({mark:s,attrs:a},u)(e,p),f=i.EditorState.create({doc:u.doc,selection:u.selection})),d?o.toggleMark(c[s],a,u)(f,p):r.toggleInlineFormat({mark:s},u,a)(f,p)}return d&&l(u),d}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.insertText=function(e){return function(t,n){n(t.tr.insertText(e.text,e.from,e.to))}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5);t.insertImage=function(e){return function(t,n){var o=t.schema.nodes.image,i=o.createAndFill(e);r.insertNode(i)(t,(function(t){return n(t.setMeta("commandName","insertImage").setMeta("args",e))}))}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(10);t.alignBlocks=function(e,t){return function(n,o){var i=r.blockNodes(n),s=n.tr;s.setMeta("commandName",t),i.forEach((function(t){if(t.type.isTextblock){var n={},o=e.find((function(e){return e.node===t.type.name}));o&&(n=r.addStyles(t,o.style)),r.changeTextBlock(s,t,t.type,n)}}));var a=s.docChanged;return a&&o(s.scrollIntoView()),a}},t.isAligned=function(e,t){var n=r.blockNodes(e),o=!1;return n.forEach((function(e){if(!o&&e.type.isTextblock&&e.attrs.style){var n=t.find((function(t){return t.node===e.type.name}));n&&(o=n.style.every((function(t){return!!t.value&&new RegExp(t.name+":\\s?"+t.value,"i").test(e.attrs.style)})))}})),o}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(10),o=n(7);t.cleanFormatting=function(e){return void 0===e&&(e={blocksInSelection:!0}),function(t,n){var i=t.tr,s=e.blocksInSelection,a=e.blockNodeType,l=(e.exceptMarks||[t.schema.marks.link]).filter(Boolean);o.cleanMarks(i,{except:l}),r.cleanTextBlockFormatting(i,{blocksInSelection:s,blockNodeType:a});var c=i.docChanged;return c&&n&&n(i),c}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(15),o=n(17),i=n(10),s=n(5),a=n(19);t.indentBlocks=function(e,t,n){return function(r,o){var s=i.blockNodes(r),a=r.tr;a.setMeta("commandName",t),s.forEach((function(t){if(t.type.isTextblock){var r=void 0,o=e.find((function(e){return e.node===t.type.name}));if(o){var s="rtl"===n?o.rtlStyle:o.style,l={name:s,value:o.step>0?""+o.step+o.unit:""};if(t.attrs.style){var c=new RegExp(s+":\\s?(\\d+)"+o.unit,"i"),u=t.attrs.style.match(c);if(u){var d=parseFloat(u[1])+o.step;d=d<=0?"":d,l.value=""+d+(d?o.unit:"")}}r=i.addStyles(t,[l])}r&&i.changeTextBlock(a,t,t.type,r)}}));var l=a.docChanged;return l&&o(a.scrollIntoView()),l}},t.isIndented=function(e,t,n){var r=i.blockNodes(e),o=!1;return r.forEach((function(e){if(!o&&e.type.isTextblock&&e.attrs.style){var r=t.find((function(t){return t.node===e.type.name}));if(r){var i="rtl"===n?r.rtlStyle:r.style,s=new RegExp(i+":\\s?\\d+"+r.unit,"i");o=s.test(e.attrs.style)}}})),o},t.canIndentAsListItem=function(e,t){return r.sinkListItem(t)(e)},t.canOutdentAsListItem=function(e,t){var n=e.schema.nodes[t.listsTypes.listItem],o=e.schema.nodes[t.listsTypes.orderedList],i=e.schema.nodes[t.listsTypes.bulletList],a=!!s.findNthParentNodeOfType(o,2)(e.selection),l=!!s.findNthParentNodeOfType(i,2)(e.selection);return(a||l)&&r.liftListItem(n)(e)},t.canBeIndented=function(e,n){var r=e.schema.nodes,s=r[o.indentRules.listsTypes.listItem];return(t.isIndented(e,n.nodes)||o.indentRules.nodes.some((function(t){return r[t.node]&&i.hasNode(e,r[t.node])})))&&!i.hasNode(e,s)},t.indent=function(e,n){var i=e.schema.nodes[o.indentRules.listsTypes.listItem],s=t.canBeIndented(e,o.indentRules);t.canIndentAsListItem(e,i)?r.sinkListItem(i)(e,n):s&&t.indentBlocks(o.indentRules.nodes)(e,n)},t.outdent=function(e,n){var s=e.schema.nodes,l=s[o.outdentRules.listsTypes.listItem],c=t.canBeIndented(e,o.outdentRules);i.hasNode(e,s.blockquote)?a.liftBlockquote(e,n):t.canOutdentAsListItem(e,o.outdentRules)?r.liftListItem(l)(e,n):c&&t.indentBlocks(o.outdentRules.nodes)(e,n)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(e,t){return{name:e,value:t}};t.alignLeftRules=[{node:"paragraph",style:[r("text-align","left")]},{node:"heading",style:[r("text-align","left")]}],t.alignRightRules=[{node:"paragraph",style:[r("text-align","right")]},{node:"heading",style:[r("text-align","right")]}],t.alignCenterRules=[{node:"paragraph",style:[r("text-align","center")]},{node:"heading",style:[r("text-align","center")]}],t.alignJustifyRules=[{node:"paragraph",style:[r("text-align","justify")]},{node:"heading",style:[r("text-align","justify")]}],t.alignRemoveRules=[{node:"paragraph",style:[r("text-align","")]},{node:"heading",style:[r("text-align","")]}]},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4),o=n(11),i=n(25),s=n(22),a=n(20),l=n(23),c=n(14),u=n(5),d="undefined"!=typeof navigator&&/Mac/.test(navigator.platform);t.buildKeymap=function(e,t){var n={},a=t&&t.applyToWord||!1;if(n["Mod-z"]=i.undo,n["Shift-Mod-z"]=i.redo,n.Backspace=o.chainCommands(s.undoInputRule,o.deleteSelection,o.joinBackward,o.selectNodeBackward),n.Enter=o.chainCommands(o.newlineInCode,o.createParagraphNear,o.liftEmptyBlock,o.splitBlockKeepMarks),d||(n["Mod-y"]=i.redo),e.marks.strong&&(n["Mod-b"]=u.expandToWordWrap(c.toggleInlineFormat,r.__assign({},l.bold,{applyToWord:a}))),e.marks.em&&(n["Mod-i"]=u.expandToWordWrap(c.toggleInlineFormat,r.__assign({},l.italic,{applyToWord:a}))),e.marks.u&&(n["Mod-u"]=u.expandToWordWrap(c.toggleInlineFormat,r.__assign({},l.underline,{applyToWord:a}))),e.nodes.hard_break){var p=e.nodes.hard_break,f=o.chainCommands(o.exitCode,(function(e,t){return t(e.tr.replaceSelectionWith(p.create()).scrollIntoView()),!0}));n["Shift-Enter"]=f}return n},t.buildListKeymap=function(e){var t={};return e.nodes.list_item&&(t.Enter=a.splitListItemKeepMarks(e.nodes.list_item)),t}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(24);t.sanitize=function(e){return e=(e=(e=(e=(e=(e=(e=(e=(e=(e=e.replace(/^[\s\S]+?<!--StartFragment-->\s*([\s\S]*?)\s*<!--EndFragment-->[\s\S]+$/,"$1")).replace(/<\/?[ovw]:[^>]*?>/gi,"")).replace(/<\\?\??xml[^>]*>/gi,"")).replace(/<(?:link|meta) [^>]+?>/gi,"")).replace(/<style[^>]*?>\s*<\/style>/gi,"")).replace(/<\/?st1:.*?>/gi,"")).replace(/<a name="[a-zA-Z0-9_]+">/gim,"")).replace(/v:shapes?="[^"]+"/gi,"")).replace(/<!\[if !supportLists\]>/gi,"")).replace(/<!\[endif\]>/gi,"")},t.removeComments=function(e){return e.replace(/<!--[\s\S]+?-->/g,"")},t.removeTag=function(e,t){return e.replace(new RegExp("<\\/?("+t+")(?:\\s[^>]*?)?>","gi"),"")},t.removeAttribute=function(e){e.ownerElement&&e.ownerElement.removeAttribute(e.name)},t.sanitizeClassAttr=function(e){/^Mso/.test(e.value)&&t.removeAttribute(e)};var o=/\s*;\s*/,i=/\s*:\s*/;t.sanitizeStyleAttr=function(e){var n,r,s=e.value.split(o).filter((function(e){return Boolean(e)})),a=e.ownerElement.style,l="";s.forEach((function(e){var t;t=e.split(i),n=t[0],r=t[1],void 0!==a[n]&&(l+=n+": "+r+"; ")})),(l=l.trim())?e.value=l:t.removeAttribute(e)};function s(e){for(var t=e.length,n=new Array(t/2),r=0;r<t;r+=2)n[r]=String.fromCharCode(parseInt(e.substring(r,r+2),16));return btoa(n.join(""))}t.pasteCleanup=function(e,n){var o=e;if(n.convertMsLists&&(o=r.convertMsLists(o)),n.stripTags&&(o=t.removeTag(o,n.stripTags)),n.attributes){var i=document.createElement("div");i.innerHTML=o,Array.from(i.querySelectorAll("*")).forEach((function(e){return function(e,t){if(e.nodeType===Node.ELEMENT_NODE){for(var n=e.attributes.length-1;n>=0;n--){var r=e.attributes[n];t[r.name]?t[r.name](r):t["*"]&&t["*"](r)}"SPAN"===e.nodeName&&0===e.attributes.length&&function(e){var t=e.parentNode;if(t){for(;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}}(e)}}(e,n.attributes)})),o=i.innerHTML}return o};var a=/<img\s[^>]*?src=(?:'|")file:\/[^'"]+(?:'|")[^>]*>/gi,l=/{\\pict[\s\S]+?\\bliptag-?\d+(\\blipupi-?\d+)?({\\\*\\blipuid\s?[\da-fA-F]+)?[\s}]*?/,c=new RegExp("(?:("+l.source+"))([\\da-fA-F\\s]+)\\}","g"),u=/[^\da-fA-F]/g,d=/file:\/[^'"]+\.(jpg|png|gif)/i,p=/\\(png|jpeg)blip\\/;t.replaceImageSourcesFromRtf=function(e,t){var n=e.match(a);if(!n||-1===t.types.indexOf("text/rtf"))return e;var r=t.getData("text/rtf"),o=[],i=r.match(c);if(!r||!i)return e;for(var f=0,h=i;f<h.length;f++){var m=h[f],v=p.exec(m);if(v){var g=m.replace(l,"").replace(u,"");o.push("data:image/"+v[1]+";base64,"+s(g))}}return n.length!==o.length?e:e.replace(a,(function(e){var t=o.shift()||"";return e.replace(d,t)}))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4),o=n(1);t.findAt=function(e,t,n,r,i){var l,c,u,d,p,f,h=[],m=[],v=t.matchCase,g=t.matchWord,y=t.useRegExp,w=t.text;if(y&&(/^\\$/.test(w)||/[^\\]\\$/.test(w))&&(w=w.substring(0,w.length-1)),!w)return h;var b=v?"g":"gi",S=y?new RegExp(w,b):a(w,b);return e.nodesBetween(n,r,(function(t,a,v){if(i(h))return!1;t.inlineContent&&a+t.content.size>=n&&(m.length=0,t.nodesBetween(0,t.content.size,(function(t,v,y,w){if(i(h))return!1;var b=1+a+v;if(t.isText&&b+t.nodeSize>=n){if(p=t.text||"",f=y.childCount-1>=w+1&&y.child(w+1),m.push(n<=b?{text:p,start:b}:{text:p.slice(n-b),start:n}),f&&f.isText)return;for(c=m.map((function(e){return e.text})).join(""),l=S.exec(c);null!==l&&(u=m[0].start+l.index,d=u+l[0].length,n<=u&&r>=d&&s(l,g)&&h.push(o.TextSelection.create(e,u,d)),!i(h));)l=S.exec(c)}else m.length=0})))})),h},t.find=function(e,n){var o=n.backward,i=n.matchCyclic,s=r.__rest(n,["backward","matchCyclic"]),a=o?function(){return!1}:function(e){return e.length>0},l=e.doc,c=e.selection,u=[];return o?!(u=t.findAt(l,s,0,c.from,a)).length&&i&&(u=t.findAt(l,s,c.from,l.content.size,a)):!(u=t.findAt(l,s,c.to,l.content.size,a)).length&&i&&(u=t.findAt(l,s,0,c.to,a)),u.length?u[u.length-1]:null},t.findAll=function(e,n){return t.findAt(e,n,0,e.content.size,(function(){return!1}))},t.replace=function(e,t,n){var r=e.from,i=e.to;return n.insertText(t,r,i).setSelection(o.TextSelection.create(n.doc,r,r+t.length)),n},t.replaceAll=function(e,n,r){var o=t.findAll(e.doc,r);if(0===o.length)return null;for(var i=e.tr,s=o.length-1;s>=0;s--)i.insertText(n,o[s].from,o[s].to);return i};var i=/^[\s0-9~`!@#$%\^&*\(\)_\-=+\\|\[\]{};:'"\?/.,<>]?$/,s=function(e,t){if(t){if(!0===t){var n=e.input,r=n.charAt(e.index-1),o=n.charAt(e.index+e[0].length);return i.test(r)&&i.test(o)}return t(e)}return!0},a=function(e,t){var n=e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d").replace(/\s/g,"\\s");return new RegExp(n,t)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),o=n(3);t.placeholder=function(e){var t={class:"k-placeholder","data-placeholder":e};return new r.Plugin({key:new r.PluginKey("placeholder"),props:{decorations:function(e){var n=e.doc,r=n.content.firstChild;if(!(0===n.childCount||1===n.childCount&&r.inlineContent&&0===r.childCount))return o.DecorationSet.empty;var i=[];return n.descendants((function(e,n){i.push(o.Decoration.node(n,n+e.nodeSize,t))})),o.DecorationSet.create(n,i)}}})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),o=n(3),i=/\s+/g,s=/text-align/;t.spacesFix=function(){return new r.Plugin({key:new r.PluginKey("spaces-fix"),props:{decorations:function(e){var t,n,r,a,l=[],c=e.doc;return c.nodesBetween(0,c.content.size,(function(e,c,u){if(e.type.isText&&function(e){return s.test(e&&e.attrs&&e.attrs.style||"")}(u))for(n=i.exec(e.text||"");null!==n;){if(t=c+n.index,r=n[0].length,n.index+r<n.input.length)for(a=0;a<=r-1;a+=2)l.push(o.Decoration.inline(t+a,t+a+1,{style:"white-space: normal"}));n=i.exec(e.text||"")}})),o.DecorationSet.create(c,l)}}})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),o=n(3);t.textHighlightKey=new r.PluginKey("highlight"),t.textHighlight=function(e){return void 0===e&&(e=t.textHighlightKey),new r.Plugin({key:e,state:{init:function(){return null},apply:function(e){return e.getMeta(this.spec.key)}},props:{decorations:function(e){var t=(this.spec.key.getState(e)||[]).map((function(e){return o.Decoration.inline(e.from,e.to,e.attrs)}));return o.DecorationSet.create(e.doc,t)}}})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4),o=n(1),i=n(3),s=n(6),a=n(5),l=n(16);t.imageResizeKey=new o.PluginKey("image-resize");var c=function(e,t,n){e.style[t]=n+"px"},u=/[^\-]width:|[^\-]height:/,d=/^.+$/,p=function(){function e(e,t,n,r){this.activeHandle=e,this.dragging=t,this.rect=n,this.nodePosition=r}return e.prototype.apply=function(n){var r=n.getMeta(t.imageResizeKey);return r?new e(r.activeHandle,r.setDragging,r.rect,r.nodePosition):this},e}(),f=function(e,n,i){var p=n.target.getAttribute(s.dataResizeDirImage);if(!p)return!1;var f=t.imageResizeKey.getState(e.state);n.preventDefault();var h=e.state.tr;function m(n){!function(e,n,r){var o=t.imageResizeKey.getState(e.state),i=o.rect,s=o.dragging,a=o.nodePosition,u=o.activeHandle;if(s&&i){var d=e.nodeDOM(a),p=l.directions[u],f=(n.clientX-s.startX)*p.x,h=(n.clientY-s.startY)*p.y,m=p.x?f+d.width:i.width,v=p.y?h+d.height:i.height;if(r.lockRatio&&p.x&&p.y){var g=Math.min(m/d.width,v/d.height),y=d.width*g,w=d.height*g;s.startX=n.clientX-(m-y)*p.x,s.startY=n.clientY-(v-w)*p.y,m=y,v=w}else s.startX=p.x?n.clientX:s.startX,s.startY=p.y?n.clientY:s.startY;c(d,"width",m),c(d,"height",v),i.top=d.offsetTop,i.left=d.offsetLeft,i.width=d.offsetWidth,i.height=d.offsetHeight;var b=d.nextElementSibling;b.style.width=i.width+"px",b.style.height=i.height+"px",b.style.top=i.top+"px",b.style.left=i.left+"px"}}(e,n,i)}return h.setMeta(t.imageResizeKey,{setDragging:{startX:n.clientX,startY:n.clientY},activeHandle:p,rect:f.rect,nodePosition:f.nodePosition}),h.setMeta("addToHistory",!1),e.dispatch(h),n.view.addEventListener("mouseup",(function n(i){i.view.removeEventListener("mouseup",n),i.view.removeEventListener("mousemove",m),function(e){var n=t.imageResizeKey.getState(e.state),i=n.rect,s=n.dragging,l=n.nodePosition;if(s&&i){var c=e.state.selection;if(c instanceof o.NodeSelection){var p=c.node.attrs,f=i.width,h=i.height,m=void 0;if(u.test(p.style||"")){var v=a.changeStylesString(p.style,{style:"width",value:d,newValue:f+"px"}),g=a.changeStylesString(v.style||"",{style:"height",value:d,newValue:h+"px"}).style;m=r.__assign({},p,{style:g})}else m=r.__assign({},p,{width:f,height:h});var y=c.node.type.createAndFill(m);if(y){var w=e.state.tr;w.replaceWith(l,l+1,y),w.setSelection(o.NodeSelection.create(w.doc,l)),w.setMeta("commandName","image-resize"),w.setMeta("args",m),w.setMeta(t.imageResizeKey,{setDragging:null,activeHandle:null,rect:i,nodePosition:l}),e.dispatch(w)}}}}(e)})),n.view.addEventListener("mousemove",m),!0};t.imageResizing=function(e){return void 0===e&&(e={node:"image",lockRatio:!0}),new o.Plugin({key:t.imageResizeKey,view:function(n){return{resize:function(){t.imageResizeKey.getState(n.state).rect&&n.dispatch(n.state.tr.setMeta("resize",!0))},get window(){return n.dom.ownerDocument&&n.dom.ownerDocument.defaultView},attachResize:function(){var e=this.window;e&&(e.removeEventListener("resize",this.resize),e.addEventListener("resize",this.resize))},removeResize:function(){var e=this.window;e&&e.removeEventListener("resize",this.resize)},update:function(n,r){var i=n.state,s=i.selection,a=i.schema.nodes[e.node],l=t.imageResizeKey.getState(i),c=l.rect;if(s instanceof o.NodeSelection&&a===s.node.type){var u=n.nodeDOM(s.from),d={top:u.offsetTop,left:u.offsetLeft,width:u.offsetWidth,height:u.offsetHeight};if(!r.selection.eq(s)||c&&(c.width!==d.width||c.height!==d.height||c.top!==d.top||c.left!==d.left)){var p=i.tr;p.setMeta(t.imageResizeKey,{rect:d,nodePosition:s.from}),n.dispatch(p),this.attachResize()}}else c&&(l.rect=null,l.nodePosition=-1)},destroy:function(){this.removeResize()}}},state:{init:function(){return new p("",null,null,-1)},apply:function(e,t){return t.apply(e)}},props:{handleDOMEvents:{mousedown:function(t,n){return f(t,n,e)}},decorations:function(n){var r=n.selection,a=n.schema.nodes[e.node],c=t.imageResizeKey.getState(n).rect;if(c&&r instanceof o.NodeSelection&&a===r.node.type){var u=document.createElement("div");u.className="k-editor-resize-handles-wrapper",u.style.width=c.width+"px",u.style.height=c.height+"px",u.style.top=c.top+"px",u.style.left=c.left+"px";for(var d=0;d<l.handles.length;d++){var p=document.createElement("div");p.className=s.resizeHandle+" "+l.handles[d],p.setAttribute(s.dataResizeDirImage,l.handles[d]),u.appendChild(p)}return i.DecorationSet.create(n.doc,[i.Decoration.widget(n.selection.from+1,u)])}return i.DecorationSet.empty}}})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),o=n(3),i=n(7);t.caretColorKey=new r.PluginKey("caret-color"),t.caretColor=function(){return new r.Plugin({key:t.caretColorKey,props:{decorations:function(e){var t=e.doc,n=e.selection,r=e.storedMarks;if(!n.empty||!r)return o.DecorationSet.empty;var s=i.styleValue((r||[]).find((function(e){return"style"===e.type.name})),{name:"color",value:/^.+$/});if(!s)return o.DecorationSet.empty;var a=n.$anchor.parent,l=[];return t.descendants((function(e,t){e.eq(a)&&l.push(o.Decoration.node(t,t+e.nodeSize,{style:"caret-color: "+s}))})),o.DecorationSet.create(t,l)}}})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(43),o=n(45),i=n(46);t.tableResizing=function(){return[o.tableResizing(),r.columnResizing(),i.rowResizing()]};var s=n(12);t.tableResizeKey=s.tableResizeKey,t.tableColumnResizeKey=s.tableColumnResizeKey,t.tableRowResizeKey=s.tableRowResizeKey},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4),o=n(1),i=n(8),s=n(3),a=n(6),l=n(44),c=n(12);t.columnResizing=function(){var e=l.TableView;return new o.Plugin({key:c.tableColumnResizeKey,state:{init:function(t,n){return this.spec.props.nodeViews[i.tableNodeTypes(n.schema).table.name]=function(t,n){return new e(t,n)},new u(-1,null)},apply:function(e,t){return t.apply(e)}},props:{attributes:function(e){return c.otherResizeHandle(c.tableColumnResizeKey,e)?null:c.tableColumnResizeKey.getState(e).activeHandle>-1?{class:"resize-cursor"}:null},handleDOMEvents:{mousemove:function(e,t){return c.otherResizing(c.tableColumnResizeKey,e.state)||function(e,t,n){var r=c.tableColumnResizeKey.getState(e.state);if(!r.dragging){var o=c.domCellAround(t.target),i=-1;if(o){var s=c.cellIndexes(o),a=o.getBoundingClientRect(),l=a.left,u=a.right;Math.abs(t.clientX-l)<=n&&s.cellIndex>0?(s.cellIndex--,i=d(e,t,s)):u-t.clientX>0&&u-t.clientX<=n&&(i=d(e,t,s))}i!==r.activeHandle&&f(e,i)}}(e,t,5),!1},mouseleave:function(e){return function(e){var t=c.tableColumnResizeKey.getState(e.state);t.activeHandle>-1&&!t.dragging&&f(e,-1)}(e),!1},mousedown:function(e,t){return function(e,t,n){var o,s=c.tableColumnResizeKey.getState(e.state);if(-1===s.activeHandle||s.dragging)return!1;for(var l=e.state.doc.resolve(s.activeHandle),u=l.parent,d=l.index(),f=0,h=0;h<=d;h++)f+=u.child(h).attrs.colspan;var m,v,g=l.node(l.depth-1),y=e.domAtPos(s.activeHandle),w=y.node.childNodes[y.offset].closest("table");if(g.attrs[a.colgroupAttr]){var b=w.firstChild;(m=b.children[f-1]).style.width||(m.style.width=m.offsetWidth+"px")}else{var S=0;for(h=0;h<u.childCount;h++)S+=u.child(h).attrs.colspan;b=document.createElement("colgroup");var k=new Array(S);for(h=0;h<S;h++)k[h]=document.createElement("col"),b.appendChild(k[h]);w.insertBefore(b,w.firstChild),(m=k[d]).style.width=m.offsetWidth+"px",v=r.__assign({},g.attrs,((o={})[a.colgroupAttr]="<colgroup>"+k.reduce((function(e,t){return e+t.outerHTML}),"")+"</colgroup>",o))}var x=parseFloat(m.style.width),C=e.state.tr.setMeta(c.tableColumnResizeKey,{setDragging:{startX:t.clientX,startWidth:x}});if(!w.style.width){var M=Array.from(m.parentNode.children).map((function(e){return e.style.width}));if(M.every(Boolean)){var O=M.reduce((function(e,t){return e+parseFloat(t)}),0);v=c.setNodeStyle(v||g.attrs,"width",O+"px")}}if(v){var T=l.posAtIndex(0,l.depth-1)-1;C.setNodeMarkup(T,null,v)}function A(t){t.view.removeEventListener("mouseup",A),t.view.removeEventListener("mousemove",N);var o=c.tableColumnResizeKey.getState(e.state);if(o.dragging){var i=e.state.tr;!function(e,t,n,o){var i,s=e.state.doc.resolve(n),l=s.node(-1),u=s.start(-1),d=s.posAtIndex(0,s.depth-1)-1,p=e.nodeDOM(u).closest("table"),f=l.attrs;if(l&&f[a.colgroupAttr]){var h=p.firstChild;f=r.__assign({},f,((i={})[a.colgroupAttr]=h.outerHTML,i))}var m=p.style.width;p&&m&&c.parseStyle(f.style).width!==m&&(f=c.setNodeStyle(f,"width",m),t.setNodeMarkup(d,null,f))}(e,i,o.activeHandle,p(o.dragging,t,n)),e.dispatch(i.setMeta(c.tableColumnResizeKey,{setDragging:null}))}}function N(t){if(!t.which)return A(t);var r=c.tableColumnResizeKey.getState(e.state),o=p(r.dragging,t,n);!function(e,t,n,r){var o=e.state.doc.resolve(t),s=o.node(-1),a=o.start(-1),l=i.TableMap.get(s).colCount(o.pos-a)+o.nodeAfter.attrs.colspan-1,c=e.domAtPos(o.start(-1)).node;"TABLE"!==c.nodeName&&(c=c.closest("table"));var u=c,d=u.firstChild,p=Array.from(d.children);if(p[l].style.width=n+"px",u.style.width){var f=p.map((function(e){return e.style.width}));if(f.every(Boolean)){var h=f.reduce((function(e,t){return e+parseFloat(t)}),0);u.style.width=h+"px"}}}(e,r.activeHandle,o)}return e.dispatch(C),t.view.addEventListener("mouseup",A),t.view.addEventListener("mousemove",N),t.preventDefault(),!0}(e,t,25)}},decorations:function(e){if(!c.otherResizing(c.tableColumnResizeKey,e)){var t=c.tableColumnResizeKey.getState(e);if(t.activeHandle>-1)return function(e,t){for(var n=[],r=e.doc.resolve(t),o=r.node(-1),a=i.TableMap.get(o),l=r.start(-1),c=a.colCount(r.pos-l)+r.nodeAfter.attrs.colspan,u=0;u<a.height;u++){var d=c+u*a.width-1;if(!(c!==a.width&&a.map[d]===a.map[d+1]||0!==u&&a.map[d-1]===a.map[d-1-a.width])){var p=a.map[d],f=l+p+o.nodeAt(p).nodeSize-1,h=document.createElement("div");h.className="column-resize-handle",n.push(s.Decoration.widget(f,h))}}return s.DecorationSet.create(e.doc,n)}(e,t.activeHandle)}return s.DecorationSet.empty},nodeViews:{}}})};var u=function(){function e(e,t){this.activeHandle=e,this.dragging=t}return e.prototype.apply=function(t){var n,r=this,o=t.getMeta(c.tableColumnResizeKey);if(o&&null!=o.setHandle)return new e(o.setHandle,null);if(o&&void 0!==o.setDragging)return new e(r.activeHandle,o.setDragging);if(r.activeHandle>-1&&t.docChanged){var i=t.mapping.map(r.activeHandle,-1);n=t.doc.resolve(i),Boolean("row"===n.parent.type.spec.tableRole&&n.nodeAfter)||(i=-1),r=new e(i,r.dragging)}return r},e}();function d(e,t,n){var r=e.posAtCoords({left:t.clientX,top:t.clientY});if(!r)return-1;var o=e.state.doc.resolve(r.pos),s=c.parentNode(o,(function(e){return"table"===e.type.spec.tableRole}));if(null===s)return-1;var a=o.start(s.depth),l=s.node,u=i.TableMap.get(l);return a+u.map[u.width*n.rowIndex+n.cellIndex]}function p(e,t,n){var r=t.clientX-e.startX;return Math.max(n,e.startWidth+r)}function f(e,t){var n=e.state.tr;n.setMeta("addToHistory",!1),n.setMeta(c.tableColumnResizeKey,{setHandle:t}),e.dispatch(n)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6),o=n(21),i=n(16),s=function(){function e(e,t){this.node=e,this.view=t,this.dom=document.createElement("div"),this.dom.className=r.resizableWrap,this.table=this.dom.appendChild(document.createElement("table")),e.attrs[r.colgroupAttr]&&this.renderColgroup(e.attrs[r.colgroupAttr]);var n=this.table.appendChild(document.createElement("tbody"));this.setAttributes(this.table,e.attrs),this.resizeHandles=i.handles.map((function(e){var t=document.createElement("span");return t.className=r.resizeHandle+" "+e,t.setAttribute(r.dataResizeDirTable,e),t})),this.contentDOM=n}return e.prototype.update=function(e){var t=this;if(e.type!==this.node.type)return!1;var n=this.node;return this.node=e,e.attrs[r.resizableAttr]?this.resizeHandles.forEach((function(e){t.dom.appendChild(e)})):Array.from(this.dom.children).filter((function(e){return e.classList.contains(r.resizeHandle)})).forEach((function(e){return e.remove()})),this.setAttributes(this.table,e.attrs),n.attrs[r.colgroupAttr]!==e.attrs[r.colgroupAttr]&&this.renderColgroup(e.attrs[r.colgroupAttr]),!0},e.prototype.ignoreMutation=function(e){return"attributes"===e.type&&(e.target===this.table||e.target.firstChild===this.table||this.colgroup&&this.colgroup.contains(e.target))},e.prototype.destroy=function(){this.node=void 0,this.view=void 0,this.table=void 0,this.colgroup=void 0,this.resizeHandles=void 0},e.prototype.renderColgroup=function(e){this.table&&this.table.firstChild&&"COLGROUP"===this.table.firstChild.nodeName&&this.table.removeChild(this.table.firstChild),e&&(this.colgroup=o.parseStrColgroup(e),this.table.insertBefore(this.colgroup,this.table.firstChild))},e.prototype.setAttributes=function(e,t){var n=[r.colgroupAttr,r.resizableAttr];for(var o in t)if(o&&-1===n.indexOf(o)){var i=e.getAttribute(o),s=t[o];s&&s!==i?e.setAttribute(o,s):s||e.removeAttribute(o)}},e}();t.TableView=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4),o=n(1),i=n(6),s=n(12),a=n(16),l={southeast:!0,southwest:!0,northwest:!0,northeast:!0},c=r.__assign({east:!0,west:!0},l),u=r.__assign({south:!0,north:!0},l),d=function(){function e(e,t,n){this.activeHandle=e,this.dragging=t,this.nodePosition=n}return e.prototype.apply=function(t){var n=t.getMeta(s.tableResizeKey);return n?new e(n.activeHandle,n.setDragging,n.nodePosition):this},e}(),p=function(e){var t=Array.from(e.firstChild.children).map((function(e){return e.offsetWidth})),n=Array.from(e.rows).map((function(e){return e.offsetHeight})),r=t.reduce((function(e,t){return e+t}),0),o=n.reduce((function(e,t){return e+t}),0),i=e.offsetHeight;return{width:r,height:o,colsWidth:t,rowsHeight:n,offsetWidth:e.offsetWidth,offsetHeight:i}},f=function(e){var t=s.tableResizeKey.getState(e.state),n=t.dragging,o=t.nodePosition,a=t.activeHandle;if(n){var l=e.state.doc.nodeAt(o),d=s.getTable(e.nodeDOM(o)),f=p(d);if(l){var h=f.offsetWidth+"px",m=f.offsetHeight+"px",v=e.state.tr,g=l.attrs,y=s.parseStyle(g.style);c[a]&&d.style.width&&y.width!==h&&(g=s.setNodeStyle(g,"width",h)),u[a]&&d.style.height&&y.height!==m&&(g=s.setNodeStyle(g,"height",m)),g=function(e,t,n,o){var a=e.state.doc.nodeAt(n),l=s.getTable(e.nodeDOM(n)),c=(l.ownerDocument&&l.ownerDocument.defaultView||window).getComputedStyle,u=Array.from(l.rows);a.forEach((function(e,r,o){var i=s.parseStyle(e.attrs.style).height;i&&!/px$/.test(i)&&t.setNodeMarkup(n+r+1,null,s.setNodeStyle(e.attrs,"height",c(u[o]).height))}));var d=l.firstChild,p=Array.from(d&&d.children||[]),f=!1;p.forEach((function(e,t){e.style.width&&!/px$/.test(e.style.width)&&(e.style.width=c(p[t]).width,f=!0)}));var h=r.__assign({},o);return f&&(h[i.colgroupAttr]=d.outerHTML),h}(e,v,o,g),v.setNodeMarkup(o,null,g),v.setMeta("commandName","node-resize"),v.setMeta("args",g),v.setMeta(s.tableResizeKey,{setDragging:null,activeHandle:null,nodePosition:o}),e.dispatch(v)}}},h=function(e,t){var n=t.target.getAttribute(i.dataResizeDirTable);if(!n)return!1;var r=s.tableResizeKey.getState(e.state);t.preventDefault();var o=e.state.tr;o.setMeta(s.tableResizeKey,{setDragging:{startX:t.clientX,startY:t.clientY},activeHandle:n,nodePosition:r.nodePosition}),o.setMeta("addToHistory",!1),function(e,t,n){var r=e.state.doc.nodeAt(n),o=s.getTable(e.nodeDOM(n)),a=p(o),l=a.width,c=a.height,u=a.colsWidth,d=a.rowsHeight,f=a.offsetWidth,h=a.offsetHeight,m=o.firstChild,v=Array.from(m&&m.children||[]),g=!1;v.forEach((function(e,t){e.style.width&&!/%$/.test(e.style.width)&&(e.style.width=100*u[t]/l+"%",g=!0)}));var y=!1;r.forEach((function(e,r,o){var i=s.parseStyle(e.attrs.style).height;i&&!/%$/.test(i)&&(t.setNodeMarkup(n+r+1,null,s.setNodeStyle(e.attrs,"height",100*d[o]/c+"%")),y=!0)}));var w=r.attrs;s.parseStyle(w.style).width!==f+"px"&&(w=s.setNodeStyle(w,"width",f+"px")),g&&(w[i.colgroupAttr]=m.outerHTML),y&&(w=s.setNodeStyle(w,"height",h+"px")),(g||y)&&t.setNodeMarkup(n,null,w)}(e,o,r.nodePosition),e.dispatch(o);var l=t.view||window;function d(t){!function(e,t){var n=s.tableResizeKey.getState(e.state),r=n.dragging,o=n.nodePosition,i=n.activeHandle;if(!(o<0)&&r){var l=s.getTable(e.nodeDOM(o)),d=l.getBoundingClientRect(),p=a.directions[i],f=(t.clientX-r.startX)*p.x,h=(t.clientY-r.startY)*p.y,m=(l.ownerDocument&&l.ownerDocument.defaultView||window).getComputedStyle(l),v=/px/.test(m.width)?parseFloat(m.width):l.offsetWidth,g=/px/.test(m.height)?parseFloat(m.height):l.offsetHeight,y=p.x?f+v:d.width,w=p.y?h+g:d.height;r.startX=p.x?t.clientX:r.startX,r.startY=p.y?t.clientY:r.startY,c[i]&&(l.style.width=y+"px"),u[i]&&(l.style.height=w+"px")}}(e,t)}return l.addEventListener("mouseup",(function t(n){l.removeEventListener("mouseup",t),l.removeEventListener("mousemove",d),f(e)})),l.addEventListener("mousemove",d),!0};t.tableResizing=function(e){return void 0===e&&(e={node:"table"}),new o.Plugin({key:s.tableResizeKey,view:function(t){return{selectedNode:function(e,t){var n=e.selection;if(n instanceof o.NodeSelection&&t===n.node.type&&n instanceof o.NodeSelection)return{node:n.node,pos:n.from};var r=s.parentNode(n.$from,(function(e){return e.type===t})),i=r&&r.node;if(i){var a=new Array(n.$from.depth+1).fill(0).findIndex((function(e,t){return"table"===n.$from.node(t).type.spec.tableRole}));return{node:i,pos:n.$from.start(a)-1}}return null},update:function(t,n){var o,a,l,c,u,d=t.state,p=d.schema.nodes[e.node],f=this.selectedNode(d,p),h=this.selectedNode(n,p);if((f||!h||n.doc.eq(t.state.doc))&&(f||h)){var m=d.tr;m.setMeta("addToHistory",!1),f&&h&&f.pos!==h.pos?(m.setMeta(s.tableResizeKey,{nodePosition:f.pos}),m.setNodeMarkup(h.pos,p,r.__assign({},h.node.attrs,((o={})[i.resizableAttr]=!1,o))),m.setNodeMarkup(f.pos,p,r.__assign({},f.node.attrs,((a={})[i.resizableAttr]=!0,a))),t.dispatch(m)):f&&h&&f.pos===h.pos&&!f.node.attrs[i.resizableAttr]&&!d.selection.eq(n.selection)?(m.setMeta(s.tableResizeKey,{nodePosition:f.pos}),t.dispatch(m.setNodeMarkup(f.pos,p,r.__assign({},f.node.attrs,((l={})[i.resizableAttr]=!0,l))))):f&&!h?(m.setMeta(s.tableResizeKey,{nodePosition:f.pos}),t.dispatch(m.setNodeMarkup(f.pos,p,r.__assign({},f.node.attrs,((c={})[i.resizableAttr]=!0,c))))):!f&&h&&(m.setMeta(s.tableResizeKey,{nodePosition:-1}),t.dispatch(m.setNodeMarkup(h.pos,p,r.__assign({},h.node.attrs,((u={})[i.resizableAttr]=!1,u)))))}}}},state:{init:function(){return new d("",null,-1)},apply:function(e,t){return t.apply(e)}},props:{handleDOMEvents:{mousedown:function(e,t){return h(e,t)}}}})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),o=n(8),i=n(3),s=n(12),a=function(){function e(){}return e.prototype.ignoreMutation=function(e){return"attributes"===e.type&&"style"===e.attributeName&&"TR"===e.target.nodeName},e}();t.rowResizing=function(){return new r.Plugin({key:s.tableRowResizeKey,state:{init:function(e,t){return this.spec.props.nodeViews[o.tableNodeTypes(t.schema).row.name]=function(e,t){return new a},new l(-1,null)},apply:function(e,t){return t.apply(e)}},props:{attributes:function(e){return s.otherResizeHandle(s.tableRowResizeKey,e)?null:s.tableRowResizeKey.getState(e).activeHandle>-1?{class:"resize-cursor-vertical"}:null},handleDOMEvents:{mousemove:function(e,t){return s.otherResizing(s.tableRowResizeKey,e.state)||function(e,t,n){var r=s.tableRowResizeKey.getState(e.state);if(!r.dragging){var o=s.domCellAround(t.target),i=-1;if(o){var a=o.parentNode,l=a.getBoundingClientRect();Math.abs(t.clientY-l.top)<=n&&a.rowIndex>0?i=c(e,t,a.rowIndex-1):l.bottom-t.clientY>0&&l.bottom-t.clientY<=n&&(i=c(e,t,a.rowIndex))}i!==r.activeHandle&&u(e,i)}}(e,t,5),!1},mouseleave:function(e){return function(e){var t=s.tableRowResizeKey.getState(e.state);t.activeHandle>-1&&!t.dragging&&u(e,-1)}(e),!1},mousedown:function(e,t){return function(e,t){var n=s.tableRowResizeKey.getState(e.state);if(-1===n.activeHandle||n.dragging)return!1;var r=e.state.doc,o=r.resolve(n.activeHandle),i=r.nodeAt(n.activeHandle),a=o.parent,l=s.parseStyle(i.attrs.style).height,c=s.parseStyle(a.attrs.style).height,u=l?parseFloat(l):0;if(!l){var d=e.nodeDOM(n.activeHandle);u=d.offsetHeight}function p(t){t.view.removeEventListener("mouseup",p),t.view.removeEventListener("mousemove",f);var n=s.tableRowResizeKey.getState(e.state);if(n.dragging){var r=e.state.tr.setMeta(s.tableRowResizeKey,{setDragging:null});!function(e,t,n){var r=e.state.doc,o=r.nodeAt(n),i=e.nodeDOM(n),a=i.ownerDocument&&i.ownerDocument.defaultView||window;i.style.height=a.getComputedStyle(i).height,t.setNodeMarkup(n,null,s.setNodeStyle(o.attrs,"height",i.style.height));var l=i&&i.closest("table"),c=l&&l.style.height;if(c){var u=r.resolve(n),d=u.start(u.depth)-1;t.setNodeMarkup(d,null,s.setNodeStyle(u.parent.attrs,"height",c))}}(e,r,n.activeHandle),e.dispatch(r)}}function f(t){if(!t.which)return p(t);var n=s.tableRowResizeKey.getState(e.state),r=function(e,t){var n=t.clientY-e.startY;return e.startHeight.rowHeight+n}(n.dragging,t),o=t.clientY-n.dragging.startY;!function(e,t,n,r,o){var i=e.nodeDOM(t);if(i){i.style.height=n+"px";var s=i.ownerDocument&&i.ownerDocument.defaultView||window;i.style.height=s.getComputedStyle(i).height;var a=i.closest("table"),l=parseFloat(o)+r+"px",c=a&&a.style.height;c&&c!==l&&(a.style.height=parseFloat(o)+r+"px",a.style.height=s.getComputedStyle(a).height)}}(e,n.activeHandle,r,o,c)}return e.dispatch(e.state.tr.setMeta(s.tableRowResizeKey,{setDragging:{startY:t.clientY,startHeight:{rowHeight:u,tableHeight:c}}})),t.view.addEventListener("mouseup",p),t.view.addEventListener("mousemove",f),t.preventDefault(),!0}(e,t)}},decorations:function(e){if(s.otherResizing(s.tableRowResizeKey,e))return i.DecorationSet.empty;var t=s.tableRowResizeKey.getState(e);return t.activeHandle>-1?function(e,t){var n=[];if("number"!=typeof t)return i.DecorationSet.empty;for(var r=e.doc.resolve(t),s=r.parent,a=o.TableMap.get(s),l=r.index(r.depth),c=r.start(r.depth),u=0;u<a.width;u++){var d=u+l*a.width,p=a.map[d],f=s.nodeAt(p),h=c+p+(f?f.nodeSize:0)-1,m=document.createElement("div");m.className="row-resize-handle",n.push(i.Decoration.widget(h,m))}return i.DecorationSet.create(e.doc,n)}(e,t.activeHandle):void 0},nodeViews:{}}})};var l=function(){function e(e,t){this.activeHandle=e,this.dragging=t}return e.prototype.apply=function(t){var n,r=this,o=t.getMeta(s.tableRowResizeKey);if(o&&null!=o.setHandle)return new e(o.setHandle,null);if(o&&void 0!==o.setDragging)return new e(r.activeHandle,o.setDragging);if(r.activeHandle>-1){var i=t.mapping.map(r.activeHandle,-1);"row"===(n=t.doc.resolve(i)).parent.type.spec.tableRole&&n.nodeAfter||(i=null),r=new e(i,r.dragging)}return r},e}();function c(e,t,n){var r=e.posAtCoords({left:t.clientX,top:t.clientY});if(!r)return-1;var i=e.state.doc.resolve(r.pos),a=s.parentNode(i,(function(e){return"table"===e.type.spec.tableRole}));if(null===a)return-1;var l=i.start(a.depth),c=a.node,u=o.TableMap.get(c);return l+u.map[u.width*n]-1}function u(e,t){var n=e.state.tr;n.setMeta("addToHistory",!1),n.setMeta(s.tableRowResizeKey,{setHandle:t}),e.dispatch(n)}},function(e,t,n){"use strict";n.r(t),n.d(t,"dropCursor",(function(){return i}));var r=n(1),o=n(2);function i(e){return void 0===e&&(e={}),new r.Plugin({view:function(t){return new s(t,e)}})}var s=function(e,t){var n=this;this.editorView=e,this.width=t.width||1,this.color=t.color||"black",this.class=t.class,this.cursorPos=null,this.element=null,this.timeout=null,this.handlers=["dragover","dragend","drop","dragleave"].map((function(t){var r=function(e){return n[t](e)};return e.dom.addEventListener(t,r),{name:t,handler:r}}))};s.prototype.destroy=function(){var e=this;this.handlers.forEach((function(t){var n=t.name,r=t.handler;return e.editorView.dom.removeEventListener(n,r)}))},s.prototype.update=function(e,t){null!=this.cursorPos&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())},s.prototype.setCursor=function(e){e!=this.cursorPos&&(this.cursorPos=e,null==e?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())},s.prototype.updateOverlay=function(){var e,t=this.editorView.state.doc.resolve(this.cursorPos);if(!t.parent.inlineContent){var n=t.nodeBefore,r=t.nodeAfter;if(n||r){var o=this.editorView.nodeDOM(this.cursorPos-(n?n.nodeSize:0)).getBoundingClientRect(),i=n?o.bottom:o.top;n&&r&&(i=(i+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),e={left:o.left,right:o.right,top:i-this.width/2,bottom:i+this.width/2}}}if(!e){var s=this.editorView.coordsAtPos(this.cursorPos);e={left:s.left-this.width/2,right:s.left+this.width/2,top:s.top,bottom:s.bottom}}var a,l,c=this.editorView.dom.offsetParent;if(this.element||(this.element=c.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none; background-color: "+this.color),!c||c==document.body&&"static"==getComputedStyle(c).position)a=-pageXOffset,l=-pageYOffset;else{var u=c.getBoundingClientRect();a=u.left-c.scrollLeft,l=u.top-c.scrollTop}this.element.style.left=e.left-a+"px",this.element.style.top=e.top-l+"px",this.element.style.width=e.right-e.left+"px",this.element.style.height=e.bottom-e.top+"px"},s.prototype.scheduleRemoval=function(e){var t=this;clearTimeout(this.timeout),this.timeout=setTimeout((function(){return t.setCursor(null)}),e)},s.prototype.dragover=function(e){if(this.editorView.editable){var t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),r=n&&n.type.spec.disableDropCursor,i="function"==typeof r?r(this.editorView,t):r;if(t&&!i){var s=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice&&null==(s=Object(o.dropPoint)(this.editorView.state.doc,s,this.editorView.dragging.slice)))return this.setCursor(null);this.setCursor(s),this.scheduleRemoval(5e3)}}},s.prototype.dragend=function(){this.scheduleRemoval(20)},s.prototype.drop=function(){this.scheduleRemoval(20)},s.prototype.dragleave=function(e){e.target!=this.editorView.dom&&this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}},function(e,t,n){"use strict";n.r(t),n.d(t,"GapCursor",(function(){return a})),n.d(t,"gapCursor",(function(){return c}));var r=n(9),o=n(1),i=n(0),s=n(3),a=function(e){function t(t){e.call(this,t,t)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.map=function(n,r){var o=n.resolve(r.map(this.head));return t.valid(o)?new t(o):e.near(o)},t.prototype.content=function(){return i.Slice.empty},t.prototype.eq=function(e){return e instanceof t&&e.head==this.head},t.prototype.toJSON=function(){return{type:"gapcursor",pos:this.head}},t.fromJSON=function(e,n){if("number"!=typeof n.pos)throw new RangeError("Invalid input for GapCursor.fromJSON");return new t(e.resolve(n.pos))},t.prototype.getBookmark=function(){return new l(this.anchor)},t.valid=function(e){var t=e.parent;if(t.isTextblock||!function(e){for(var t=e.depth;t>=0;t--){var n=e.index(t),r=e.node(t);if(0!=n)for(var o=r.child(n-1);;o=o.lastChild){if(0==o.childCount&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}else if(r.type.spec.isolating)return!0}return!0}(e)||!function(e){for(var t=e.depth;t>=0;t--){var n=e.indexAfter(t),r=e.node(t);if(n!=r.childCount)for(var o=r.child(n);;o=o.firstChild){if(0==o.childCount&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}else if(r.type.spec.isolating)return!0}return!0}(e))return!1;var n=t.type.spec.allowGapCursor;if(null!=n)return n;var r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock},t.findFrom=function(e,n,r){e:for(;;){if(!r&&t.valid(e))return e;for(var i=e.pos,s=null,a=e.depth;;a--){var l=e.node(a);if(n>0?e.indexAfter(a)<l.childCount:e.index(a)>0){s=l.child(n>0?e.indexAfter(a):e.index(a)-1);break}if(0==a)return null;i+=n;var c=e.doc.resolve(i);if(t.valid(c))return c}for(;;){var u=n>0?s.firstChild:s.lastChild;if(!u){if(s.isAtom&&!s.isText&&!o.NodeSelection.isSelectable(s)){e=e.doc.resolve(i+s.nodeSize*n),r=!1;continue e}break}s=u,i+=n;var d=e.doc.resolve(i);if(t.valid(d))return d}return null}},t}(o.Selection);a.prototype.visible=!1,o.Selection.jsonID("gapcursor",a);var l=function(e){this.pos=e};l.prototype.map=function(e){return new l(e.map(this.pos))},l.prototype.resolve=function(e){var t=e.resolve(this.pos);return a.valid(t)?new a(t):o.Selection.near(t)};var c=function(){return new o.Plugin({props:{decorations:h,createSelectionBetween:function(e,t,n){if(t.pos==n.pos&&a.valid(n))return new a(n)},handleClick:p,handleKeyDown:u,handleDOMEvents:{beforeinput:f}}})},u=Object(r.keydownHandler)({ArrowLeft:d("horiz",-1),ArrowRight:d("horiz",1),ArrowUp:d("vert",-1),ArrowDown:d("vert",1)});function d(e,t){var n="vert"==e?t>0?"down":"up":t>0?"right":"left";return function(e,r,i){var s=e.selection,l=t>0?s.$to:s.$from,c=s.empty;if(s instanceof o.TextSelection){if(!i.endOfTextblock(n)||0==l.depth)return!1;c=!1,l=e.doc.resolve(t>0?l.after():l.before())}var u=a.findFrom(l,t,c);return!!u&&(r&&r(e.tr.setSelection(new a(u))),!0)}}function p(e,t,n){if(!e.editable)return!1;var r=e.state.doc.resolve(t);if(!a.valid(r))return!1;var i=e.posAtCoords({left:n.clientX,top:n.clientY}).inside;return!(i>-1&&o.NodeSelection.isSelectable(e.state.doc.nodeAt(i)))&&(e.dispatch(e.state.tr.setSelection(new a(r))),!0)}function f(e,t){if("insertCompositionText"!=t.inputType||!(e.state.selection instanceof a))return!1;var n=e.state.selection.$from,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;for(var s=i.Fragment.empty,l=r.length-1;l>=0;l--)s=i.Fragment.from(r[l].createAndFill(null,s));var c=e.state.tr.replace(n.pos,n.pos,new i.Slice(s,0,0));return c.setSelection(o.TextSelection.near(c.doc.resolve(n.pos+1))),e.dispatch(c),!1}function h(e){if(!(e.selection instanceof a))return null;var t=document.createElement("div");return t.className="ProseMirror-gapcursor",s.DecorationSet.create(e.doc,[s.Decoration.widget(e.selection.head,t,{key:"gapcursor"})])}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(8);t.pmAddRowAfter=r.addRowAfter,t.pmAddRowBefore=r.addRowBefore;var o=n(6);t.createTable=function(e,t,n){for(var r,o=e.table,i=e.table_row,s=e.table_cell,a=[],l=0;l<t+1;l++){r=[];for(var c=0;c<n+1;c++)r.push(s.createAndFill());a.push(i.createAndFill(void 0,r))}return o.createAndFill(void 0,a)};var i=function(e,t){for(var n=e.$head,r=n.depth;r>0;r--){var o=n.node(r);if(o.type.name===t)return{pos:n.before(r),node:o}}return null};t.addRowBefore=function(e,t){var n=t&&function(e){var n,r=i(e.selection,"table_row"),s=i(e.selection,"table");if(r&&s&&r.node.attrs[o.rowTypeAttr]){for(var a=0,l=0;l<s.node.nodeSize;l++)if(s.node.child(l).eq(r.node)){a=l;break}var c=s.node.child(a-1),u=r.pos-c.nodeSize;e.setNodeMarkup(u,void 0,((n={})[o.rowTypeAttr]=r.node.attrs[o.rowTypeAttr],n))}return t(e)};return r.addRowBefore(e,n)},t.addRowAfter=function(e,t){var n=t&&function(e){var n,r=i(e.selection,"table_row");if(r&&r.node.attrs[o.rowTypeAttr]){var s=r.pos+r.node.nodeSize;e.setNodeMarkup(s,void 0,((n={})[o.rowTypeAttr]=r.node.attrs[o.rowTypeAttr],n))}return t(e)};return r.addRowAfter(e,n)}}])}));
|