@progress/kendo-angular-editor 3.1.2-dev.202202251414 → 3.1.2

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.
@@ -17,4 +17,4 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
17
17
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
18
18
  PERFORMANCE OF THIS SOFTWARE.
19
19
  ***************************************************************************** */
20
- var r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function o(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var i=function(){return(i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function s(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}function a(t,e,n,r){var o,i=arguments.length,s=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,n,s):o(e,n))||s);return i>3&&s&&Object.defineProperty(e,n,s),s}function c(t,e){return function(n,r){e(n,r,t)}}function u(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function l(t,e,n,r){return new(n||(n=Promise))((function(o,i){function s(t){try{c(r.next(t))}catch(t){i(t)}}function a(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((r=r.apply(t,e||[])).next())}))}function d(t,e){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=e.call(t,s)}catch(t){i=[6,t],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(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}function f(t,e){for(var n in t)"default"===n||e.hasOwnProperty(n)||(e[n]=t[n])}function h(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function m(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return s}function v(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(m(arguments[e]));return t}function g(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),o=0;for(e=0;e<n;e++)for(var i=arguments[e],s=0,a=i.length;s<a;s++,o++)r[o]=i[s];return r}function y(t){return this instanceof y?(this.v=t,this):new y(t)}function b(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,o=n.apply(t,e||[]),i=[];return r={},s("next"),s("throw"),s("return"),r[Symbol.asyncIterator]=function(){return this},r;function s(t){o[t]&&(r[t]=function(e){return new Promise((function(n,r){i.push([t,e,n,r])>1||a(t,e)}))})}function a(t,e){try{(n=o[t](e)).value instanceof y?Promise.resolve(n.value.v).then(c,u):l(i[0][2],n)}catch(t){l(i[0][3],t)}var n}function c(t){a("next",t)}function u(t){a("throw",t)}function l(t,e){t(e),i.shift(),i.length&&a(i[0][0],i[0][1])}}function w(t){var e,n;return e={},r("next"),r("throw",(function(t){throw t})),r("return"),e[Symbol.iterator]=function(){return this},e;function r(r,o){e[r]=t[r]?function(e){return(n=!n)?{value:y(t[r](e)),done:"return"===r}:o?o(e):e}:o}}function _(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t=h(t),e={},r("next"),r("throw"),r("return"),e[Symbol.asyncIterator]=function(){return this},e);function r(n){e[n]=t[n]&&function(e){return new Promise((function(r,o){(function(t,e,n,r){Promise.resolve(r).then((function(e){t({value:e,done:n})}),e)})(r,o,(e=t[n](e)).done,e.value)}))}}}function x(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function k(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function C(t){return t&&t.__esModule?t:{default:t}}function S(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function T(t,e,n){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,n),n}},function(e,n){e.exports=t},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(11),s=function(t){function e(e,n,r){return t.call(this,e,n,r)||this}return r.__extends(e,t),e=r.__decorate([r.__param(0,o.Inject(i.L10N_PREFIX)),r.__param(1,o.Optional()),r.__param(2,o.Optional()),r.__param(2,o.Inject(i.RTL)),r.__metadata("design:paramtypes",[String,i.MessageService,Boolean])],e)}(i.LocalizationService);e.EditorLocalizationService=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(12),s=n(15),a=n(22),c=n(4),u=n(7),l=n(10),d=n(8),p=n(37),f=n(38),h=n(23),m=n(41),v=n(43),g=n(9),y=n(24),b=n(25),w=n(26),_=n(11),x=n(2),k=n(44),C=n(27),S=n(5),T=n(28),E={convertMsLists:!1,removeAttributes:[],removeHtmlComments:!1,removeInvalidHTML:!0,removeMsClasses:!1,removeMsStyles:!1,stripTags:[]},M=g.conditionallyExecute(d.removeComments),O=g.conditionallyExecute(d.sanitize),D=function(t){if("all"===t.removeAttributes)return{"*":d.removeAttribute};var e=g.removeEmptyEntries({style:t.removeMsStyles?d.sanitizeStyleAttr:void 0,class:t.removeMsClasses?d.sanitizeClassAttr:void 0});return t.removeAttributes.reduce((function(t,e){var n;return r.__assign({},t,((n={})[e]=d.removeAttribute,n))}),e)},I=function(){function t(t,e,n,i,a,c){var u=this;this.dialogService=t,this.localization=e,this.cdr=n,this.ngZone=i,this.element=a,this.toolsService=c,this.iframe=!0,this.applyToWord=!1,this.preserveWhitespace=!1,this.resizable=!1,this.valueChange=new o.EventEmitter,this.onFocus=new o.EventEmitter,this.paste=new o.EventEmitter,this.onBlur=new o.EventEmitter,this.hostClass=!0,this.stateChange=new s.BehaviorSubject(v.initialToolBarState),this.valueModified=new s.Subject,this._readonly=!1,this._placeholder="",this.inForm=!1,this.afterViewInit=new s.Subject,this.contentAreaLoaded=new s.Subject,this.dispatchTransaction=function(t){var e=t.docChanged;if(!(u.disabled||u.readonly&&e)){if(e){var n=t.doc,r=d.getHtml({doc:n});u.trOnChange=t,u.htmlOnChange=r,u.ngZone.run((function(){u.valueModified.next(r)}))}e&&!u.inForm||u.view.updateState(u.view.state.apply(t))}},this.transformPastedHTML=function(t){var e=r.__assign({},E,u.pasteCleanupSettings),n=g.pipe(O(e.removeInvalidHTML),M(e.removeHtmlComments))(t),o=d.pasteCleanup(n,{convertMsLists:e.convertMsLists,stripTags:e.stripTags.join("|"),attributes:D(e)});if(l.hasObservers(u.paste)){var i=new T.EditorPasteEvent(o,t,u._pasteEvent);return u.ngZone.run((function(){return u.paste.emit(i)})),i.isDefaultPrevented()?"":i.cleanedHtml}return o},this.changeValue=function(t){var e=u._value;if(u._value=t,u._view){if(u.htmlOnChange===t&&u.trOnChange)u.view.updateState(u.view.state.apply(u.trOnChange));else if((e||"")!==(t||"")){if(u.iframe&&!u.container.element.nativeElement.contentWindow)return;var n=u.view.state,r=d.parseContent(t||"",n.schema,{preserveWhitespace:u.preserveWhitespace}),o=n.tr.setSelection(new d.AllSelection(n.doc)).replaceSelectionWith(r);u.view.updateState(n.apply(o))}u.trOnChange=null,u.htmlOnChange=null}},this.onChangeCallback=function(t){u.changeValue(t)},this.onTouchedCallback=function(t){},this.onPaste=function(t,e){return u._pasteEvent=e,!1},p.validatePackage(f.packageMetadata),this.direction=e.rtl?"rtl":"ltr",this.subs=s.zip(this.afterViewInit.asObservable(),this.contentAreaLoaded.asObservable()).subscribe((function(){return u.initialize()}))}var e;return e=t,Object.defineProperty(t.prototype,"value",{get:function(){if(this.trOnChange)return this.htmlOnChange;var t=this._view?this.getSource():this._value;return"<p></p>"===t?this._value?"":this._value:t},set:function(t){this.changeValue(t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"disabled",{get:function(){return this._disabled},set:function(t){this._disabled=t||!1,this._view&&this._view.updateState(this._view.state),this._disabled&&(this.readonly=!1),this._disabled||this._readonly?this.stateChange.next(v.disabledToolBarState):this.stateChange.next(v.initialToolBarState)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"readonly",{get:function(){return this._readonly},set:function(t){if(this._readonly=t||!1,this._view){var e=void 0,n=(e=this.iframe?this.container.element.nativeElement.contentWindow:window).getSelection().focusNode;this._view.dom.contains(n)&&e.getSelection().removeAllRanges();var r=this._view.state.doc,o=this._view.state.tr.setSelection(d.TextSelection.create(r,1));this._view.dispatch(o)}this._readonly?(this.toolbar&&(this.toolbar.tabindex=-1),this.stateChange.next(v.disabledToolBarState)):(this.toolbar&&(this.toolbar.tabindex=0),this.stateChange.next(v.initialToolBarState))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return this._schema},set:function(t){if(o.isDevMode){if(!(t instanceof d.Schema))throw new Error(C.EditorErrorMessages.schemaType);if(this._view)throw new Error(C.EditorErrorMessages.setSchemaOnce)}this._schema=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"plugins",{get:function(){return this._plugins},set:function(t){if(o.isDevMode){if("function"!=typeof t)throw new Error(C.EditorErrorMessages.pluginsCallbackType(t));if(this._view)throw new Error(C.EditorErrorMessages.setPluginsOnce)}this._plugins=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"placeholder",{get:function(){return this._placeholder},set:function(t){if(o.isDevMode&&this._view)throw new Error(C.EditorErrorMessages.setPlaceHolderOnce);this._placeholder=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"resizableClass",{get:function(){return!!this.resizable},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isDisabled",{get:function(){return this.disabled},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isReadonly",{get:function(){return this.readonly},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isIE",{get:function(){return this.iframe&&g.detectIE()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dir",{get:function(){return this.direction},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ariaDisabled",{get:function(){return this.disabled},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"minWidth",{get:function(){var t=this.resizable;return t.minWidth?t.minWidth+"px":void 0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"maxWidth",{get:function(){var t=this.resizable;return t.maxWidth?t.maxWidth+"px":void 0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"minHeight",{get:function(){var t=this.resizable;return t.minHeight?t.minHeight+"px":void 0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"maxHeight",{get:function(){var t=this.resizable;return t.maxHeight?t.maxHeight+"px":void 0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"toolbar",{get:function(){return this.defaultToolbarComponent||this.userToolBarComponent},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"view",{get:function(){return this._view},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"selectionText",{get:function(){return this._view&&this._view.state?d.getSelectionText(this._view.state):""},enumerable:!0,configurable:!0}),t.prototype.ngOnInit=function(){var t=this;this.subs.add(this.localization.changes.subscribe((function(e){var n=e.rtl;t.direction=n?"rtl":"ltr"}))),this.subs.add(this.toolsService.needsCheck.subscribe((function(){return t.cdr.markForCheck()})))},t.prototype.ngAfterViewInit=function(){this.afterViewInit.next(),this.iframe||this.contentAreaLoaded.next(),this.resizable&&this.normalizeSize()},t.prototype.ngOnChanges=function(t){var e=this;t.value&&this.view&&this.changeValue(t.value.currentValue),t.iframe&&!t.iframe.isFirstChange()&&this.ngZone.onStable.pipe(a.take(1)).subscribe((function(){return e.initialize()})),t.resizable&&!t.resizable.isFirstChange()&&this.normalizeSize()},t.prototype.setDisabledState=function(t){this.disabled=t},t.prototype.iframeOnLoad=function(){this.contentAreaLoaded.next()},t.prototype.exec=function(t,e){"setHTML"===t&&"string"==typeof e?e={content:e,parseOptions:{preserveWhitespace:this.preserveWhitespace}}:["fontFamily","fontSize","foreColor","backColor","createLink"].some((function(e){return e===t}))&&(e={value:e,applyToWord:this.applyToWord}),m.editorCommands[t](e)(this._view.state,this._view.dispatch,this._view)},t.prototype.openDialog=function(t){var e={createLink:{content:w.FileLinkDialogComponent},insertFile:{content:w.FileLinkDialogComponent},insertImage:{content:b.ImageDialogComponent},viewSource:{content:y.SourceDialogComponent,height:400,width:500}},n=Object.assign({appendTo:this.dialogContainer},e[t]);this.toolbar.toggle(!1);var r=this.dialogService.open(n).content.instance;"createLink"!==t&&"insertFile"!==t||(r.command=t),r.editor=this,r.setData(this._view.state,{applyToWord:this.applyToWord})},t.prototype.focus=function(){this.focusChangedProgrammatically=!0,this._view.focus(),this.focusChangedProgrammatically=!1},t.prototype.blur=function(){this.focusChangedProgrammatically=!0,this._view.dom.blur(),this.focusChangedProgrammatically=!1},t.prototype.getSource=function(){return d.getHtml(this._view.state)},t.prototype.ngOnDestroy=function(){this.subs&&this.subs.unsubscribe(),this._styleObserver&&this._styleObserver.disconnect()},t.prototype.writeValue=function(t){this.inForm=!0,this.value=null===t?void 0:t},t.prototype.registerOnChange=function(t){this.onChangeCallback=t},t.prototype.registerOnTouched=function(t){this.onTouchedCallback=t},t.prototype.isEmpty=function(){return!1},t.prototype.initialize=function(){var t=this;if(l.isDocumentAvailable()){var e=this.schema||h.schema,n=this.container.element.nativeElement,r=d.parseContent((this.value||"").trim(),e,{preserveWhitespace:this.preserveWhitespace});if(this.iframe){var o=n.contentDocument,i=o.createElement("meta");i.setAttribute("charset","utf-8"),o.head.appendChild(i),[k.defaultStyle,k.tablesStyles,"rtl"===this.dir?k.rtlStyles:void 0].forEach((function(t){if(t){var e=o.createElement("style");e.appendChild(o.createTextNode(t)),o.head.appendChild(e)}})),(c=o.createElement("div")).classList.add("k-content"),o.body.appendChild(c)}else{var c=document.createElement("div");n.appendChild(c)}var u=[new d.Plugin({key:new d.PluginKey("editor-tabindex"),props:{attributes:function(){return{tabIndex:t.readonly?"0":""}}}}),new d.Plugin({key:new d.PluginKey("toolbar-tools-update"),view:function(){return{update:function(e){t.disabled||t.stateChange.next(t.readonly?v.disabledToolBarState:v.getToolbarState(e.state,{applyToWord:t.applyToWord}))}}}}),d.history(),d.keymap(d.buildListKeymap(e)),d.keymap(d.buildKeymap(e,{applyToWord:this.applyToWord})),d.keymap(d.baseKeymap),d.gapCursor(),d.imageResizing(),d.tableEditing(),d.caretColor()];this.placeholder&&u.push(d.placeholder(this.placeholder));var p=d.EditorState.create({schema:e,doc:r,plugins:g.isPresent(this.plugins)?this.plugins(u):u});if(this.iframe?this.viewMountElement=n.contentDocument.querySelector("div"):this.viewMountElement=n.querySelector("div"),this.ngZone.runOutsideAngular((function(){t._view=new d.EditorView({mount:t.viewMountElement},{state:p,editable:function(){return!t.readonly},dispatchTransaction:t.dispatchTransaction,transformPastedHTML:t.transformPastedHTML,handleDOMEvents:{paste:t.onPaste}})})),this._view){var f=void 0,m=this.element.nativeElement.querySelector(".k-editor-content").classList;f=this.iframe?this.container.element.nativeElement.contentDocument:this.container.element.nativeElement,this.subs.add(s.fromEvent(f,"focusin").subscribe((function(e){if(t.readonly&&m.add("k-focus"),!t.focusChangedProgrammatically||t.shouldEmitFocus){var n=e.relatedTarget;n&&n.classList.contains("k-colorpicker")&&!t.shouldEmitFocus||t.ngZone.run((function(){return t.onFocus.emit()})),t.shouldEmitFocus=!1}}))),this.subs.add(s.fromEvent(f,"focusout").subscribe((function(e){if(t.readonly&&m.remove("k-focus"),!t.focusChangedProgrammatically){var n=e.relatedTarget;n&&n.classList.contains("k-colorpicker")||t.ngZone.run((function(){return t.onBlur.emit()}))}})))}this.subs.add(this.stateChange.subscribe((function(){t.userToolBarComponent?t.userToolBarComponent.cdr.detectChanges():t.cdr.detectChanges()}))),this.subs.add(this.valueModified.subscribe((function(e){t.onChangeCallback(e),t.valueChange.emit(e),t.cdr.markForCheck()}))),this.subs.add(s.fromEvent(this.viewMountElement,"keyup").pipe(a.map((function(t){return t.keyCode})),a.filter((function(t){return 121===t})),a.map((function(){return t.userToolBarElement||t.defaultToolbar}))).subscribe((function(t){return t.nativeElement.focus()}))),this.subs.add(s.fromEvent(this.viewMountElement,"blur").pipe(a.filter((function(e){return!t.viewMountElement.contains(e.relatedTarget)}))).subscribe((function(){return t.onTouchedCallback()})))}},t.prototype.normalizeSize=function(){var t=this;if("object"==typeof this.resizable&&!this._styleObserver){var e=this.element.nativeElement;this._styleObserver=new MutationObserver((function(){t.ngZone.runOutsideAngular((function(){return t.normalizeProperties(e)}))})),this._styleObserver.observe(e,{attributeFilter:["style"]})}},t.prototype.normalizeProperties=function(t){var e=Object.keys(this.resizable),n=parseInt(t.style.width,10),r=parseInt(t.style.height,10),o=this.resizable;e.forEach((function(e){var i=e.startsWith("min"),s=!i,a=e.endsWith("Width"),c=!a;i&&a?n<o.minWidth&&(t.style.width=o.minWidth+"px"):i&&c?r<o.minHeight&&(t.style.height=o.minHeight+"px"):s&&a?n>o.maxWidth&&(t.style.width=o.maxWidth+"px"):r>o.maxHeight&&(t.style.height=o.maxHeight+"px")}))},r.__decorate([o.Input(),r.__metadata("design:type",String),r.__metadata("design:paramtypes",[String])],t.prototype,"value",null),r.__decorate([o.Input(),r.__metadata("design:type",Boolean),r.__metadata("design:paramtypes",[Boolean])],t.prototype,"disabled",null),r.__decorate([o.Input(),r.__metadata("design:type",Boolean),r.__metadata("design:paramtypes",[Boolean])],t.prototype,"readonly",null),r.__decorate([o.Input(),r.__metadata("design:type",Boolean)],t.prototype,"iframe",void 0),r.__decorate([o.Input(),r.__metadata("design:type",Object)],t.prototype,"applyToWord",void 0),r.__decorate([o.Input(),r.__metadata("design:type",d.Schema),r.__metadata("design:paramtypes",[d.Schema])],t.prototype,"schema",null),r.__decorate([o.Input(),r.__metadata("design:type",Function),r.__metadata("design:paramtypes",[Function])],t.prototype,"plugins",null),r.__decorate([o.Input(),r.__metadata("design:type",String),r.__metadata("design:paramtypes",[String])],t.prototype,"placeholder",null),r.__decorate([o.Input(),r.__metadata("design:type",Object)],t.prototype,"preserveWhitespace",void 0),r.__decorate([o.Input(),r.__metadata("design:type",Object)],t.prototype,"pasteCleanupSettings",void 0),r.__decorate([o.Input(),r.__metadata("design:type",Object)],t.prototype,"resizable",void 0),r.__decorate([o.Output(),r.__metadata("design:type",o.EventEmitter)],t.prototype,"valueChange",void 0),r.__decorate([o.Output("focus"),r.__metadata("design:type",o.EventEmitter)],t.prototype,"onFocus",void 0),r.__decorate([o.Output(),r.__metadata("design:type",o.EventEmitter)],t.prototype,"paste",void 0),r.__decorate([o.Output("blur"),r.__metadata("design:type",o.EventEmitter)],t.prototype,"onBlur",void 0),r.__decorate([o.HostBinding("class.k-editor"),r.__metadata("design:type",Boolean)],t.prototype,"hostClass",void 0),r.__decorate([o.HostBinding("class.k-editor-resizable"),r.__metadata("design:type",Boolean),r.__metadata("design:paramtypes",[])],t.prototype,"resizableClass",null),r.__decorate([o.HostBinding("class.k-disabled"),r.__metadata("design:type",Boolean),r.__metadata("design:paramtypes",[])],t.prototype,"isDisabled",null),r.__decorate([o.HostBinding("class.k-readonly"),r.__metadata("design:type",Boolean),r.__metadata("design:paramtypes",[])],t.prototype,"isReadonly",null),r.__decorate([o.HostBinding("class.k-ie"),r.__metadata("design:type",Boolean),r.__metadata("design:paramtypes",[])],t.prototype,"isIE",null),r.__decorate([o.HostBinding("attr.dir"),r.__metadata("design:type",String),r.__metadata("design:paramtypes",[])],t.prototype,"dir",null),r.__decorate([o.HostBinding("attr.ariaDisabled"),r.__metadata("design:type",Boolean),r.__metadata("design:paramtypes",[])],t.prototype,"ariaDisabled",null),r.__decorate([o.HostBinding("style.minWidth"),r.__metadata("design:type",String),r.__metadata("design:paramtypes",[])],t.prototype,"minWidth",null),r.__decorate([o.HostBinding("style.maxWidth"),r.__metadata("design:type",String),r.__metadata("design:paramtypes",[])],t.prototype,"maxWidth",null),r.__decorate([o.HostBinding("style.minHeight"),r.__metadata("design:type",String),r.__metadata("design:paramtypes",[])],t.prototype,"minHeight",null),r.__decorate([o.HostBinding("style.maxHeight"),r.__metadata("design:type",String),r.__metadata("design:paramtypes",[])],t.prototype,"maxHeight",null),r.__decorate([o.ContentChild(c.ToolBarComponent,{static:!1}),r.__metadata("design:type",c.ToolBarComponent)],t.prototype,"userToolBarComponent",void 0),r.__decorate([o.ContentChild(c.ToolBarComponent,{read:o.ElementRef,static:!1}),r.__metadata("design:type",o.ElementRef)],t.prototype,"userToolBarElement",void 0),r.__decorate([o.ViewChild("dialogsContainer",{read:o.ViewContainerRef,static:!0}),r.__metadata("design:type",o.ViewContainerRef)],t.prototype,"dialogContainer",void 0),r.__decorate([o.ViewChild("content",{read:o.ViewContainerRef,static:!1}),r.__metadata("design:type",o.ViewContainerRef)],t.prototype,"container",void 0),r.__decorate([o.ViewChild("defaultToolbar",{read:o.ElementRef,static:!1}),r.__metadata("design:type",o.ElementRef)],t.prototype,"defaultToolbar",void 0),r.__decorate([o.ViewChild("defaultToolbar",{read:c.ToolBarComponent,static:!1}),r.__metadata("design:type",c.ToolBarComponent)],t.prototype,"defaultToolbarComponent",void 0),t=e=r.__decorate([o.Component({selector:"kendo-editor",providers:[x.EditorLocalizationService,S.EditorToolsService,{provide:_.LocalizationService,useExisting:x.EditorLocalizationService},{provide:_.L10N_PREFIX,useValue:"kendo.editor"},{provide:i.NG_VALUE_ACCESSOR,useExisting:o.forwardRef((function(){return e})),multi:!0},{provide:l.KendoInput,useExisting:o.forwardRef((function(){return e}))}],template:'\n <ng-container\n kendoEditorLocalizedMessages\n i18n-alignCenter="kendo.editor.alignCenter|The title of the tool that aligns text in the center."\n alignCenter="Center text"\n i18n-alignJustify="kendo.editor.alignJustify|The title of the tool that justifies text both left and right."\n alignJustify="Justify"\n i18n-alignLeft="kendo.editor.alignLeft|The title of the tool that aligns text on the left."\n alignLeft="Align text left"\n i18n-alignRight="kendo.editor.alignRight|The title of the tool that aligns text on the right."\n alignRight="Align text right"\n i18n-backColor="kendo.editor.backColor|The title of the tool that changes the text background color."\n backColor="Background color"\n i18n-blockquote="kendo.editor.blockquote|The title of the tool that wraps an element in a blockquote"\n blockquote="Quotation"\n i18n-bold="kendo.editor.bold|The title of the tool that makes text bold."\n bold="Bold"\n i18n-cleanFormatting="kendo.editor.cleanFormatting|The title of the Clean Formatting tool."\n cleanFormatting="Clean formatting"\n i18n-createLink="kendo.editor.createLink|The title of the tool that creates hyperlinks."\n createLink="Insert link"\n i18n-dialogApply="kendo.editor.dialogApply|The label of the **Apply** button in all editor dialogs."\n dialogApply="Apply"\n i18n-dialogCancel="kendo.editor.dialogCancel|The label of the **Cancel** button in all editor dialogs."\n dialogCancel="Cancel"\n i18n-dialogInsert="kendo.editor.dialogInsert|The label of the **Insert** button in all editor dialogs."\n dialogInsert="Insert"\n i18n-dialogUpdate="kendo.editor.dialogUpdate|The label of the **Update** button in all editor dialogs."\n dialogUpdate="Update"\n i18n-fileText="kendo.editor.fileText|The caption for the file text in the insertFile dialog."\n fileText="Text"\n i18n-fileTitle="kendo.editor.fileTitle|The caption for the file Title in the insertFile dialog."\n fileTitle="Title"\n i18n-fileWebAddress="kendo.editor.fileWebAddress|The caption for the file URL in the insertFile dialog."\n fileWebAddress="Web address"\n i18n-fontFamily="kendo.editor.fontFamily|The title of the tool that changes the text font."\n fontFamily="Select font family"\n i18n-fontSize="kendo.editor.fontSize|The title of the tool that changes the text size."\n fontSize="Select font size"\n i18n-foreColor="kendo.editor.foreColor|The title of the tool that changes the text color."\n foreColor="Color"\n i18n-format="kendo.editor.format|The title of the tool that lets users choose block formats."\n format="Format"\n i18n-imageAltText="kendo.editor.imageAltText|The caption for the image alternate text in the insertImage dialog."\n imageAltText="Alternate text"\n i18n-imageHeight="kendo.editor.imageHeight|The caption for the image height in the insertImage dialog."\n imageHeight="Height (px)"\n i18n-imageWebAddress="kendo.editor.imageWebAddress|The caption for the image URL in the insertImage dialog."\n imageWebAddress="Web address"\n i18n-imageWidth="kendo.editor.imageWidth|The caption for the image width in the insertImage dialog."\n imageWidth="Width (px)"\n i18n-indent="kendo.editor.indent|The title of the tool that indents the content."\n indent="Indent"\n i18n-insertFile="kendo.editor.insertFile|The title of the tool that inserts links to files."\n insertFile="Insert file"\n i18n-insertImage="kendo.editor.insertImage|The title of the tool that inserts images."\n insertImage="Insert image"\n i18n-insertOrderedList="kendo.editor.insertOrderedList|The title of the tool that inserts an ordered list."\n insertOrderedList="Insert ordered list"\n i18n-insertUnorderedList="kendo.editor.insertUnorderedList|The title of the tool that inserts an unordered list."\n insertUnorderedList="Insert unordered list"\n i18n-italic="kendo.editor.italic|The title of the tool that makes text italicized."\n italic="Italic"\n i18n-linkOpenInNewWindow="kendo.editor.linkOpenInNewWindow|The caption for the checkbox for opening the link in a new window in the createLink dialog."\n linkOpenInNewWindow="Open link in new window"\n i18n-linkText="kendo.editor.linkText|The caption for the link text in the createLink dialog."\n linkText="Text"\n i18n-linkTitle="kendo.editor.linkTitle|The caption for the link title in the createLink dialog."\n linkTitle="Title"\n i18n-linkWebAddress="kendo.editor.linkWebAddress|The caption for the URL in the createLink dialog."\n linkWebAddress="Web address"\n i18n-outdent="kendo.editor.outdent|The title of the tool that outdents the content."\n outdent="Outdent"\n i18n-print="kendo.editor.print|The title of the print tool."\n print="Print"\n i18n-redo="kendo.editor.redo|The title of the tool that undos the last action."\n redo="Redo"\n i18n-selectAll="kendo.editor.selectAll|The title of the tool that selects all content."\n selectAll="Select All"\n i18n-strikethrough="kendo.editor.strikethrough|The title of the tool that strikes through text."\n strikethrough="Strikethrough"\n i18n-subscript="kendo.editor.subscript|The title of the tool that makes text subscript."\n subscript="Subscript"\n i18n-superscript="kendo.editor.superscript|The title of the tool that makes text superscript."\n superscript="Superscript"\n i18n-underline="kendo.editor.underline|The title of the tool that underlines text."\n underline="Underline"\n i18n-unlink="kendo.editor.unlink|The title of the tool that removes hyperlinks."\n unlink="Remove Link"\n i18n-undo="kendo.editor.undo|The title of the tool that undos the last action."\n undo="Undo"\n i18n-viewSource="kendo.editor.viewSource|The title of the tool that shows the editor value as HTML."\n viewSource="View source"\n i18n-insertTable="kendo.editor.insertTable|The title of the tool that inserts table."\n insertTable="Insert Table"\n i18n-addColumnBefore="kendo.editor.addColumnBefore|The title of the tool that adds new column before currently selected column."\n addColumnBefore="Add column before"\n i18n-addColumnAfter="kendo.editor.addColumnAfter|The title of the tool that adds new column after currently selected column."\n addColumnAfter="Add column after"\n i18n-addRowBefore="kendo.editor.addRowBefore|The title of the tool that adds new row before currently selected row."\n addRowBefore="Add row before"\n i18n-addRowAfter="kendo.editor.addRowAfter|The title of the tool that adds new row after currently selected row."\n addRowAfter="Add row after"\n i18n-deleteColumn="kendo.editor.deleteColumn|The title of the tool that deletes a table column."\n deleteColumn="Delete column"\n i18n-deleteRow="kendo.editor.deleteRow|The title of the tool that deletes a table row."\n deleteRow="Delete row"\n i18n-deleteTable="kendo.editor.deleteTable|The title of the tool that deletes a table."\n deleteTable="Delete table"\n >\n </ng-container>\n\n <ng-content select="kendo-toolbar"></ng-content>\n <kendo-toolbar [overflow]="true" [tabindex]="readonly ? -1 : 0" *ngIf="!userToolBarElement" #defaultToolbar>\n <kendo-toolbar-buttongroup>\n <kendo-toolbar-button kendoEditorBoldButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorItalicButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorUnderlineButton></kendo-toolbar-button>\n </kendo-toolbar-buttongroup>\n <kendo-toolbar-dropdownlist kendoEditorFormat></kendo-toolbar-dropdownlist>\n <kendo-toolbar-buttongroup>\n <kendo-toolbar-button kendoEditorAlignLeftButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorAlignCenterButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorAlignRightButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorAlignJustifyButton></kendo-toolbar-button>\n </kendo-toolbar-buttongroup>\n <kendo-toolbar-buttongroup>\n <kendo-toolbar-button kendoEditorInsertUnorderedListButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorInsertOrderedListButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorIndentButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorOutdentButton></kendo-toolbar-button>\n </kendo-toolbar-buttongroup>\n <kendo-toolbar-buttongroup>\n <kendo-toolbar-button kendoEditorCreateLinkButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorUnlinkButton></kendo-toolbar-button>\n </kendo-toolbar-buttongroup>\n <kendo-toolbar-button kendoEditorInsertImageButton></kendo-toolbar-button>\n </kendo-toolbar>\n\n <div *ngIf="!iframe" #content [attr.dir]="direction" class="k-editor-content"></div>\n\n <div class="k-editor-content" *ngIf="iframe">\n <iframe #content srcdoc="<!DOCTYPE html>" frameborder="0" class="k-iframe" (load)="iframeOnLoad()"></iframe>\n </div>\n\n <ng-container #dialogsContainer></ng-container>\n ',styles:["\n >>> .k-editor-content > .ProseMirror {\n height: 100%;\n width: 100%;\n box-sizing: border-box;\n outline: none;\n overflow: auto;\n }\n\n .k-iframe {\n width: 100%;\n height: 100%;\n display: block;\n }\n "]}),r.__metadata("design:paramtypes",[u.DialogService,_.LocalizationService,o.ChangeDetectorRef,o.NgZone,o.ElementRef,S.EditorToolsService])],t)}();e.EditorComponent=I},function(t,n){t.exports=e},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(15),s=function(){function t(){this.needsCheck=new i.Subject}return t=r.__decorate([o.Injectable()],t)}();e.EditorToolsService=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=function(t){function e(e,n,r,o,i){var s=t.call(this,e,n,r,o,i)||this;return s.command=e,s.button=n,s.editor=r,s.localization=o,s.toolsService=i,s}return r.__extends(e,t),e.prototype.clickHandler=function(){this.editor.exec(this.command,this.editor.applyToWord),this.editor.focus()},e.prototype.pointerdownHandler=function(t){t.preventDefault()},e.prototype.onStateChange=function(t){this.button.selected=t[this.command].selected,this.button.disabled=t[this.command].disabled},e}(n(34).EditorCommandBase);e.EditorCommandButton=o},function(t,e){t.exports=n},function(t,e,n){"use strict";function r(t){this.content=t}n.r(e),n.d(e,"getHtml",(function(){return Ae})),n.d(e,"setHtml",(function(){return Ne})),n.d(e,"parseContent",(function(){return Ie})),n.d(e,"trimWhitespace",(function(){return Ee})),n.d(e,"htmlToFragment",(function(){return Me})),n.d(e,"domToPmDoc",(function(){return De})),n.d(e,"pmDocToFragment",(function(){return Oe})),n.d(e,"applyInlineStyle",(function(){return ln})),n.d(e,"getInlineStyles",(function(){return an})),n.d(e,"toggleInlineFormat",(function(){return un})),n.d(e,"applyLink",(function(){return pn})),n.d(e,"removeLink",(function(){return dn})),n.d(e,"insertText",(function(){return fn})),n.d(e,"insertImage",(function(){return hn})),n.d(e,"alignBlocks",(function(){return Cn})),n.d(e,"isAligned",(function(){return Sn})),n.d(e,"cleanFormatting",(function(){return Tn})),n.d(e,"hasNode",(function(){return _n})),n.d(e,"activeNode",(function(){return kn})),n.d(e,"formatBlockElements",(function(){return gn})),n.d(e,"getBlockFormats",(function(){return bn})),n.d(e,"parentBlockFormat",(function(){return xn})),n.d(e,"changeTextBlock",(function(){return mn})),n.d(e,"blockNodes",(function(){return vn})),n.d(e,"cleanTextBlockFormatting",(function(){return yn})),n.d(e,"hasMark",(function(){return Qe})),n.d(e,"getMark",(function(){return nn})),n.d(e,"getActiveMarks",(function(){return rn})),n.d(e,"removeAllMarks",(function(){return Xe})),n.d(e,"cleanMarks",(function(){return Ze})),n.d(e,"selectionMarks",(function(){return en})),n.d(e,"indent",(function(){return Ar})),n.d(e,"canIndentAsListItem",(function(){return Or})),n.d(e,"outdent",(function(){return Nr})),n.d(e,"canOutdentAsListItem",(function(){return Dr})),n.d(e,"isIndented",(function(){return Mr})),n.d(e,"canBeIndented",(function(){return Ir})),n.d(e,"indentBlocks",(function(){return Er})),n.d(e,"toggleOrderedList",(function(){return $r})),n.d(e,"toggleUnorderedList",(function(){return jr})),n.d(e,"toggleList",(function(){return Vr})),n.d(e,"listStyle",(function(){return Lr})),n.d(e,"blockquote",(function(){return Sr})),n.d(e,"liftBlockquote",(function(){return Tr})),n.d(e,"hasSameMarkup",(function(){return Ve})),n.d(e,"getSelectionText",(function(){return je})),n.d(e,"getNodeFromSelection",(function(){return $e})),n.d(e,"selectedLineTextOnly",(function(){return We})),n.d(e,"expandSelection",(function(){return Je})),n.d(e,"expandToWordWrap",(function(){return Ke})),n.d(e,"canInsert",(function(){return Pe})),n.d(e,"insertNode",(function(){return Le})),n.d(e,"indentHtml",(function(){return He})),n.d(e,"alignLeftRules",(function(){return Hr})),n.d(e,"alignCenterRules",(function(){return Jr})),n.d(e,"alignRightRules",(function(){return qr})),n.d(e,"alignJustifyRules",(function(){return Kr})),n.d(e,"alignRemoveRules",(function(){return Ur})),n.d(e,"indentRules",(function(){return $n})),n.d(e,"outdentRules",(function(){return Wn})),n.d(e,"nodes",(function(){return Uc})),n.d(e,"marks",(function(){return $c})),n.d(e,"buildKeymap",(function(){return Fu})),n.d(e,"buildListKeymap",(function(){return Lu})),n.d(e,"bold",(function(){return Du})),n.d(e,"italic",(function(){return Iu})),n.d(e,"underline",(function(){return Au})),n.d(e,"strikethrough",(function(){return Nu})),n.d(e,"subscript",(function(){return Bu})),n.d(e,"superscript",(function(){return zu})),n.d(e,"link",(function(){return Pu})),n.d(e,"sanitize",(function(){return Gu})),n.d(e,"removeComments",(function(){return Yu})),n.d(e,"removeTag",(function(){return Xu})),n.d(e,"pasteCleanup",(function(){return rl})),n.d(e,"sanitizeClassAttr",(function(){return Qu})),n.d(e,"sanitizeStyleAttr",(function(){return nl})),n.d(e,"removeAttribute",(function(){return Zu})),n.d(e,"replaceImageSourcesFromRtf",(function(){return dl})),n.d(e,"convertMsLists",(function(){return Uu})),n.d(e,"find",(function(){return fl})),n.d(e,"findAt",(function(){return pl})),n.d(e,"findAll",(function(){return hl})),n.d(e,"replace",(function(){return ml})),n.d(e,"replaceAll",(function(){return vl})),n.d(e,"placeholder",(function(){return wl})),n.d(e,"spacesFix",(function(){return kl})),n.d(e,"textHighlight",(function(){return Sl})),n.d(e,"textHighlightKey",(function(){return Cl})),n.d(e,"imageResizing",(function(){return Bl})),n.d(e,"imageResizeKey",(function(){return Tl})),n.d(e,"caretColor",(function(){return Pl})),n.d(e,"caretColorKey",(function(){return zl})),n.d(e,"autoJoin",(function(){return gr})),n.d(e,"baseKeymap",(function(){return Cr})),n.d(e,"chainCommands",(function(){return yr})),n.d(e,"createParagraphNear",(function(){return or})),n.d(e,"deleteSelection",(function(){return Hn})),n.d(e,"exitCode",(function(){return rr})),n.d(e,"joinBackward",(function(){return qn})),n.d(e,"joinDown",(function(){return Qn})),n.d(e,"joinForward",(function(){return Gn})),n.d(e,"joinUp",(function(){return Zn})),n.d(e,"lift",(function(){return tr})),n.d(e,"liftEmptyBlock",(function(){return ir})),n.d(e,"macBaseKeymap",(function(){return xr})),n.d(e,"newlineInCode",(function(){return er})),n.d(e,"pcBaseKeymap",(function(){return _r})),n.d(e,"selectAll",(function(){return ur})),n.d(e,"selectNodeBackward",(function(){return Kn})),n.d(e,"selectNodeForward",(function(){return Yn})),n.d(e,"selectParentNode",(function(){return cr})),n.d(e,"selectTextblockEnd",(function(){return fr})),n.d(e,"selectTextblockStart",(function(){return pr})),n.d(e,"setBlockType",(function(){return mr})),n.d(e,"splitBlock",(function(){return sr})),n.d(e,"splitBlockKeepMarks",(function(){return ar})),n.d(e,"toggleMark",(function(){return vr})),n.d(e,"wrapIn",(function(){return hr})),n.d(e,"dropCursor",(function(){return Rl})),n.d(e,"GapCursor",(function(){return Ll})),n.d(e,"gapCursor",(function(){return jl})),n.d(e,"HistoryState",(function(){return eu})),n.d(e,"closeHistory",(function(){return uu})),n.d(e,"history",(function(){return pu})),n.d(e,"redo",(function(){return hu})),n.d(e,"redoDepth",(function(){return vu})),n.d(e,"undo",(function(){return fu})),n.d(e,"undoDepth",(function(){return mu})),n.d(e,"InputRule",(function(){return gu})),n.d(e,"closeDoubleQuote",(function(){return Cu})),n.d(e,"closeSingleQuote",(function(){return Tu})),n.d(e,"ellipsis",(function(){return xu})),n.d(e,"emDash",(function(){return _u})),n.d(e,"inputRules",(function(){return yu})),n.d(e,"openDoubleQuote",(function(){return ku})),n.d(e,"openSingleQuote",(function(){return Su})),n.d(e,"smartQuotes",(function(){return Eu})),n.d(e,"textblockTypeInputRule",(function(){return Ou})),n.d(e,"undoInputRule",(function(){return wu})),n.d(e,"wrappingInputRule",(function(){return Mu})),n.d(e,"keydownHandler",(function(){return uo})),n.d(e,"keymap",(function(){return co})),n.d(e,"ContentMatch",(function(){return N})),n.d(e,"DOMParser",(function(){return tt})),n.d(e,"DOMSerializer",(function(){return dt})),n.d(e,"Fragment",(function(){return i})),n.d(e,"Mark",(function(){return l})),n.d(e,"MarkType",(function(){return X})),n.d(e,"Node",(function(){return O})),n.d(e,"NodeRange",(function(){return T})),n.d(e,"NodeType",(function(){return K})),n.d(e,"ReplaceError",(function(){return d})),n.d(e,"ResolvedPos",(function(){return _})),n.d(e,"Schema",(function(){return Z})),n.d(e,"Slice",(function(){return p})),n.d(e,"addListNodes",(function(){return Bn})),n.d(e,"bulletList",(function(){return In})),n.d(e,"liftListItem",(function(){return Rn})),n.d(e,"listItem",(function(){return An})),n.d(e,"orderedList",(function(){return Dn})),n.d(e,"sinkListItem",(function(){return Fn})),n.d(e,"splitListItem",(function(){return Pn})),n.d(e,"wrapInList",(function(){return zn})),n.d(e,"AllSelection",(function(){return ae})),n.d(e,"EditorState",(function(){return ve})),n.d(e,"NodeSelection",(function(){return ie})),n.d(e,"Plugin",(function(){return be})),n.d(e,"PluginKey",(function(){return xe})),n.d(e,"Selection",(function(){return te})),n.d(e,"SelectionRange",(function(){return ne})),n.d(e,"TextSelection",(function(){return re})),n.d(e,"Transaction",(function(){return de})),n.d(e,"CellSelection",(function(){return Ma})),n.d(e,"TableMap",(function(){return ca})),n.d(e,"TableView",(function(){return wc})),n.d(e,"__clipCells",(function(){return Na})),n.d(e,"__insertCells",(function(){return Pa})),n.d(e,"__pastedCells",(function(){return Ia})),n.d(e,"addColSpan",(function(){return Ta})),n.d(e,"addColumn",(function(){return Xa})),n.d(e,"addColumnAfter",(function(){return Qa})),n.d(e,"addColumnBefore",(function(){return Za})),n.d(e,"addRow",(function(){return rc})),n.d(e,"cellAround",(function(){return ma})),n.d(e,"colCount",(function(){return xa})),n.d(e,"columnIsHeader",(function(){return Ea})),n.d(e,"columnResizing",(function(){return kc})),n.d(e,"columnResizingPluginKey",(function(){return xc})),n.d(e,"deleteColumn",(function(){return ec})),n.d(e,"deleteRow",(function(){return ac})),n.d(e,"deleteTable",(function(){return bc})),n.d(e,"findCell",(function(){return _a})),n.d(e,"fixTables",(function(){return Ga})),n.d(e,"fixTablesKey",(function(){return Ua})),n.d(e,"goToNextCell",(function(){return yc})),n.d(e,"handlePaste",(function(){return Wa})),n.d(e,"inSameTable",(function(){return wa})),n.d(e,"isInTable",(function(){return va})),n.d(e,"mergeCells",(function(){return uc})),n.d(e,"moveCellForward",(function(){return ba})),n.d(e,"nextCell",(function(){return ka})),n.d(e,"pointsAtCell",(function(){return ya})),n.d(e,"removeColSpan",(function(){return Sa})),n.d(e,"removeColumn",(function(){return tc})),n.d(e,"removeRow",(function(){return sc})),n.d(e,"rowIsHeader",(function(){return nc})),n.d(e,"selectedRect",(function(){return Ya})),n.d(e,"selectionCell",(function(){return ga})),n.d(e,"setAttr",(function(){return Ca})),n.d(e,"setCellAttr",(function(){return pc})),n.d(e,"splitCell",(function(){return lc})),n.d(e,"splitCellWithType",(function(){return dc})),n.d(e,"tableEditing",(function(){return Oc})),n.d(e,"tableEditingKey",(function(){return ha})),n.d(e,"tableNodeTypes",(function(){return fa})),n.d(e,"tableNodes",(function(){return pa})),n.d(e,"toggleHeader",(function(){return hc})),n.d(e,"toggleHeaderCell",(function(){return gc})),n.d(e,"toggleHeaderColumn",(function(){return vc})),n.d(e,"toggleHeaderRow",(function(){return mc})),n.d(e,"updateColumnsOnResize",(function(){return _c})),n.d(e,"AddMarkStep",(function(){return Vt})),n.d(e,"MapResult",(function(){return vt})),n.d(e,"Mapping",(function(){return yt})),n.d(e,"RemoveMarkStep",(function(){return jt})),n.d(e,"ReplaceAroundStep",(function(){return Et})),n.d(e,"ReplaceStep",(function(){return Tt})),n.d(e,"Step",(function(){return Ct})),n.d(e,"StepMap",(function(){return gt})),n.d(e,"StepResult",(function(){return St})),n.d(e,"Transform",(function(){return wt})),n.d(e,"TransformError",(function(){return bt})),n.d(e,"canJoin",(function(){return Bt})),n.d(e,"canSplit",(function(){return Nt})),n.d(e,"dropPoint",(function(){return Ft})),n.d(e,"findWrapping",(function(){return It})),n.d(e,"insertPoint",(function(){return Rt})),n.d(e,"joinPoint",(function(){return Pt})),n.d(e,"liftTarget",(function(){return Dt})),n.d(e,"replaceStep",(function(){return $t})),n.d(e,"Decoration",(function(){return Bs})),n.d(e,"DecorationSet",(function(){return Fs})),n.d(e,"EditorView",(function(){return Xs})),n.d(e,"__endComposition",(function(){return Cs})),n.d(e,"__parseFromClipboard",(function(){return Ji})),n.d(e,"__serializeForClipboard",(function(){return qi})),n.d(e,"createTable",(function(){return Jl})),n.d(e,"addRowAfter",(function(){return Gl})),n.d(e,"addRowBefore",(function(){return Ul})),n.d(e,"pmAddRowAfter",(function(){return ic})),n.d(e,"pmAddRowBefore",(function(){return oc})),r.prototype={constructor:r,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return-1==e?void 0:this.content[e+1]},update:function(t,e,n){var o=n&&n!=t?this.remove(n):this,i=o.find(t),s=o.content.slice();return-1==i?s.push(n||t,e):(s[i+1]=e,n&&(s[i]=n)),new r(s)},remove:function(t){var e=this.find(t);if(-1==e)return this;var n=this.content.slice();return n.splice(e,2),new r(n)},addToStart:function(t,e){return new r([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new r(n)},addBefore:function(t,e,n){var o=this.remove(e),i=o.content.slice(),s=o.find(t);return i.splice(-1==s?i.length:s,0,e,n),new r(i)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return(t=r.from(t)).size?new r(t.content.concat(this.subtract(t).content)):this},append:function(t){return(t=r.from(t)).size?new r(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=r.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},get size(){return this.content.length>>1}},r.from=function(t){if(t instanceof r)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new r(e)};var o=r;var i=function(t,e){if(this.content=t,this.size=e||0,null==e)for(var n=0;n<t.length;n++)this.size+=t[n].nodeSize},s={firstChild:{configurable:!0},lastChild:{configurable:!0},childCount:{configurable:!0}};i.prototype.nodesBetween=function(t,e,n,r,o){void 0===r&&(r=0);for(var i=0,s=0;s<e;i++){var a=this.content[i],c=s+a.nodeSize;if(c>t&&!1!==n(a,r+s,o,i)&&a.content.size){var u=s+1;a.nodesBetween(Math.max(0,t-u),Math.min(a.content.size,e-u),n,r+u)}s=c}},i.prototype.descendants=function(t){this.nodesBetween(0,this.size,t)},i.prototype.textBetween=function(t,e,n,r){var o="",i=!0;return this.nodesBetween(t,e,(function(s,a){s.isText?(o+=s.text.slice(Math.max(t,a)-a,e-a),i=!n):s.isLeaf&&r?(o+="function"==typeof r?r(s):r,i=!n):!i&&s.isBlock&&(o+=n,i=!0)}),0),o},i.prototype.append=function(t){if(!t.size)return this;if(!this.size)return t;var e=this.lastChild,n=t.firstChild,r=this.content.slice(),o=0;for(e.isText&&e.sameMarkup(n)&&(r[r.length-1]=e.withText(e.text+n.text),o=1);o<t.content.length;o++)r.push(t.content[o]);return new i(r,this.size+t.size)},i.prototype.cut=function(t,e){if(null==e&&(e=this.size),0==t&&e==this.size)return this;var n=[],r=0;if(e>t)for(var o=0,s=0;s<e;o++){var a=this.content[o],c=s+a.nodeSize;c>t&&((s<t||c>e)&&(a=a.isText?a.cut(Math.max(0,t-s),Math.min(a.text.length,e-s)):a.cut(Math.max(0,t-s-1),Math.min(a.content.size,e-s-1))),n.push(a),r+=a.nodeSize),s=c}return new i(n,r)},i.prototype.cutByIndex=function(t,e){return t==e?i.empty:0==t&&e==this.content.length?this:new i(this.content.slice(t,e))},i.prototype.replaceChild=function(t,e){var n=this.content[t];if(n==e)return this;var r=this.content.slice(),o=this.size+e.nodeSize-n.nodeSize;return r[t]=e,new i(r,o)},i.prototype.addToStart=function(t){return new i([t].concat(this.content),this.size+t.nodeSize)},i.prototype.addToEnd=function(t){return new i(this.content.concat(t),this.size+t.nodeSize)},i.prototype.eq=function(t){if(this.content.length!=t.content.length)return!1;for(var e=0;e<this.content.length;e++)if(!this.content[e].eq(t.content[e]))return!1;return!0},s.firstChild.get=function(){return this.content.length?this.content[0]:null},s.lastChild.get=function(){return this.content.length?this.content[this.content.length-1]:null},s.childCount.get=function(){return this.content.length},i.prototype.child=function(t){var e=this.content[t];if(!e)throw new RangeError("Index "+t+" out of range for "+this);return e},i.prototype.maybeChild=function(t){return this.content[t]},i.prototype.forEach=function(t){for(var e=0,n=0;e<this.content.length;e++){var r=this.content[e];t(r,n,e),n+=r.nodeSize}},i.prototype.findDiffStart=function(t,e){return void 0===e&&(e=0),function t(e,n,r){for(var o=0;;o++){if(o==e.childCount||o==n.childCount)return e.childCount==n.childCount?null:r;var i=e.child(o),s=n.child(o);if(i!=s){if(!i.sameMarkup(s))return r;if(i.isText&&i.text!=s.text){for(var a=0;i.text[a]==s.text[a];a++)r++;return r}if(i.content.size||s.content.size){var c=t(i.content,s.content,r+1);if(null!=c)return c}r+=i.nodeSize}else r+=i.nodeSize}}(this,t,e)},i.prototype.findDiffEnd=function(t,e,n){return void 0===e&&(e=this.size),void 0===n&&(n=t.size),function t(e,n,r,o){for(var i=e.childCount,s=n.childCount;;){if(0==i||0==s)return i==s?null:{a:r,b:o};var a=e.child(--i),c=n.child(--s),u=a.nodeSize;if(a!=c){if(!a.sameMarkup(c))return{a:r,b:o};if(a.isText&&a.text!=c.text){for(var l=0,d=Math.min(a.text.length,c.text.length);l<d&&a.text[a.text.length-l-1]==c.text[c.text.length-l-1];)l++,r--,o--;return{a:r,b:o}}if(a.content.size||c.content.size){var p=t(a.content,c.content,r-1,o-1);if(p)return p}r-=u,o-=u}else r-=u,o-=u}}(this,t,e,n)},i.prototype.findIndex=function(t,e){if(void 0===e&&(e=-1),0==t)return c(0,t);if(t==this.size)return c(this.content.length,t);if(t>this.size||t<0)throw new RangeError("Position "+t+" outside of fragment ("+this+")");for(var n=0,r=0;;n++){var o=r+this.child(n).nodeSize;if(o>=t)return o==t||e>0?c(n+1,o):c(n,r);r=o}},i.prototype.toString=function(){return"<"+this.toStringInner()+">"},i.prototype.toStringInner=function(){return this.content.join(", ")},i.prototype.toJSON=function(){return this.content.length?this.content.map((function(t){return t.toJSON()})):null},i.fromJSON=function(t,e){if(!e)return i.empty;if(!Array.isArray(e))throw new RangeError("Invalid input for Fragment.fromJSON");return new i(e.map(t.nodeFromJSON))},i.fromArray=function(t){if(!t.length)return i.empty;for(var e,n=0,r=0;r<t.length;r++){var o=t[r];n+=o.nodeSize,r&&o.isText&&t[r-1].sameMarkup(o)?(e||(e=t.slice(0,r)),e[e.length-1]=o.withText(e[e.length-1].text+o.text)):e&&e.push(o)}return new i(e||t,n)},i.from=function(t){if(!t)return i.empty;if(t instanceof i)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new i([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))},Object.defineProperties(i.prototype,s);var a={index:0,offset:0};function c(t,e){return a.index=t,a.offset=e,a}function u(t,e){if(t===e)return!0;if(!t||"object"!=typeof t||!e||"object"!=typeof e)return!1;var n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(var r=0;r<t.length;r++)if(!u(t[r],e[r]))return!1}else{for(var o in t)if(!(o in e)||!u(t[o],e[o]))return!1;for(var i in e)if(!(i in t))return!1}return!0}i.empty=new i([],0);var l=function(t,e){this.type=t,this.attrs=e};function d(t){var e=Error.call(this,t);return e.__proto__=d.prototype,e}l.prototype.addToSet=function(t){for(var e,n=!1,r=0;r<t.length;r++){var o=t[r];if(this.eq(o))return t;if(this.type.excludes(o.type))e||(e=t.slice(0,r));else{if(o.type.excludes(this.type))return t;!n&&o.type.rank>this.type.rank&&(e||(e=t.slice(0,r)),e.push(this),n=!0),e&&e.push(o)}}return e||(e=t.slice()),n||e.push(this),e},l.prototype.removeFromSet=function(t){for(var e=0;e<t.length;e++)if(this.eq(t[e]))return t.slice(0,e).concat(t.slice(e+1));return t},l.prototype.isInSet=function(t){for(var e=0;e<t.length;e++)if(this.eq(t[e]))return!0;return!1},l.prototype.eq=function(t){return this==t||this.type==t.type&&u(this.attrs,t.attrs)},l.prototype.toJSON=function(){var t={type:this.type.name};for(var e in this.attrs){t.attrs=this.attrs;break}return t},l.fromJSON=function(t,e){if(!e)throw new RangeError("Invalid input for Mark.fromJSON");var n=t.marks[e.type];if(!n)throw new RangeError("There is no mark type "+e.type+" in this schema");return n.create(e.attrs)},l.sameSet=function(t,e){if(t==e)return!0;if(t.length!=e.length)return!1;for(var n=0;n<t.length;n++)if(!t[n].eq(e[n]))return!1;return!0},l.setFrom=function(t){if(!t||0==t.length)return l.none;if(t instanceof l)return[t];var e=t.slice();return e.sort((function(t,e){return t.type.rank-e.type.rank})),e},l.none=[],d.prototype=Object.create(Error.prototype),d.prototype.constructor=d,d.prototype.name="ReplaceError";var p=function(t,e,n){this.content=t,this.openStart=e,this.openEnd=n},f={size:{configurable:!0}};function h(t,e,n){if(n.openStart>t.depth)throw new d("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new d("Inconsistent open depths");return function t(e,n,r,o){var s=e.index(o),a=e.node(o);if(s==n.index(o)&&o<e.depth-r.openStart){var c=t(e,n,r,o+1);return a.copy(a.content.replaceChild(s,c))}if(r.content.size){if(r.openStart||r.openEnd||e.depth!=o||n.depth!=o){var u=function(t,e){for(var n=e.depth-t.openStart,r=e.node(n).copy(t.content),o=n-1;o>=0;o--)r=e.node(o).copy(i.from(r));return{start:r.resolveNoCache(t.openStart+n),end:r.resolveNoCache(r.content.size-t.openEnd-n)}}(r,e),l=u.start,d=u.end;return b(a,function t(e,n,r,o,s){var a=e.depth>s&&v(e,n,s+1),c=o.depth>s&&v(r,o,s+1),u=[];y(null,e,s,u),a&&c&&n.index(s)==r.index(s)?(m(a,c),g(b(a,t(e,n,r,o,s+1)),u)):(a&&g(b(a,w(e,n,s+1)),u),y(n,r,s,u),c&&g(b(c,w(r,o,s+1)),u));return y(o,null,s,u),new i(u)}(e,l,d,n,o))}var p=e.parent,f=p.content;return b(p,f.cut(0,e.parentOffset).append(r.content).append(f.cut(n.parentOffset)))}return b(a,w(e,n,o))}(t,e,n,0)}function m(t,e){if(!e.type.compatibleContent(t.type))throw new d("Cannot join "+e.type.name+" onto "+t.type.name)}function v(t,e,n){var r=t.node(n);return m(r,e.node(n)),r}function g(t,e){var n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function y(t,e,n,r){var o=(e||t).node(n),i=0,s=e?e.index(n):o.childCount;t&&(i=t.index(n),t.depth>n?i++:t.textOffset&&(g(t.nodeAfter,r),i++));for(var a=i;a<s;a++)g(o.child(a),r);e&&e.depth==n&&e.textOffset&&g(e.nodeBefore,r)}function b(t,e){if(!t.type.validContent(e))throw new d("Invalid content for node "+t.type.name);return t.copy(e)}function w(t,e,n){var r=[];(y(null,t,n,r),t.depth>n)&&g(b(v(t,e,n+1),w(t,e,n+1)),r);return y(e,null,n,r),new i(r)}f.size.get=function(){return this.content.size-this.openStart-this.openEnd},p.prototype.insertAt=function(t,e){var n=function t(e,n,r,o){var i=e.findIndex(n),s=i.index,a=i.offset,c=e.maybeChild(s);if(a==n||c.isText)return o&&!o.canReplace(s,s,r)?null:e.cut(0,n).append(r).append(e.cut(n));var u=t(c.content,n-a-1,r);return u&&e.replaceChild(s,c.copy(u))}(this.content,t+this.openStart,e,null);return n&&new p(n,this.openStart,this.openEnd)},p.prototype.removeBetween=function(t,e){return new p(function t(e,n,r){var o=e.findIndex(n),i=o.index,s=o.offset,a=e.maybeChild(i),c=e.findIndex(r),u=c.index,l=c.offset;if(s==n||a.isText){if(l!=r&&!e.child(u).isText)throw new RangeError("Removing non-flat range");return e.cut(0,n).append(e.cut(r))}if(i!=u)throw new RangeError("Removing non-flat range");return e.replaceChild(i,a.copy(t(a.content,n-s-1,r-s-1)))}(this.content,t+this.openStart,e+this.openStart),this.openStart,this.openEnd)},p.prototype.eq=function(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd},p.prototype.toString=function(){return this.content+"("+this.openStart+","+this.openEnd+")"},p.prototype.toJSON=function(){if(!this.content.size)return null;var t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t},p.fromJSON=function(t,e){if(!e)return p.empty;var n=e.openStart||0,r=e.openEnd||0;if("number"!=typeof n||"number"!=typeof r)throw new RangeError("Invalid input for Slice.fromJSON");return new p(i.fromJSON(t,e.content),n,r)},p.maxOpen=function(t,e){void 0===e&&(e=!0);for(var n=0,r=0,o=t.firstChild;o&&!o.isLeaf&&(e||!o.type.spec.isolating);o=o.firstChild)n++;for(var i=t.lastChild;i&&!i.isLeaf&&(e||!i.type.spec.isolating);i=i.lastChild)r++;return new p(t,n,r)},Object.defineProperties(p.prototype,f),p.empty=new p(i.empty,0,0);var _=function(t,e,n){this.pos=t,this.path=e,this.depth=e.length/3-1,this.parentOffset=n},x={parent:{configurable:!0},doc:{configurable:!0},textOffset:{configurable:!0},nodeAfter:{configurable:!0},nodeBefore:{configurable:!0}};_.prototype.resolveDepth=function(t){return null==t?this.depth:t<0?this.depth+t:t},x.parent.get=function(){return this.node(this.depth)},x.doc.get=function(){return this.node(0)},_.prototype.node=function(t){return this.path[3*this.resolveDepth(t)]},_.prototype.index=function(t){return this.path[3*this.resolveDepth(t)+1]},_.prototype.indexAfter=function(t){return t=this.resolveDepth(t),this.index(t)+(t!=this.depth||this.textOffset?1:0)},_.prototype.start=function(t){return 0==(t=this.resolveDepth(t))?0:this.path[3*t-1]+1},_.prototype.end=function(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size},_.prototype.before=function(t){if(!(t=this.resolveDepth(t)))throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]},_.prototype.after=function(t){if(!(t=this.resolveDepth(t)))throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]+this.path[3*t].nodeSize},x.textOffset.get=function(){return this.pos-this.path[this.path.length-1]},x.nodeAfter.get=function(){var t=this.parent,e=this.index(this.depth);if(e==t.childCount)return null;var n=this.pos-this.path[this.path.length-1],r=t.child(e);return n?t.child(e).cut(n):r},x.nodeBefore.get=function(){var t=this.index(this.depth),e=this.pos-this.path[this.path.length-1];return e?this.parent.child(t).cut(0,e):0==t?null:this.parent.child(t-1)},_.prototype.posAtIndex=function(t,e){e=this.resolveDepth(e);for(var n=this.path[3*e],r=0==e?0:this.path[3*e-1]+1,o=0;o<t;o++)r+=n.child(o).nodeSize;return r},_.prototype.marks=function(){var t=this.parent,e=this.index();if(0==t.content.size)return l.none;if(this.textOffset)return t.child(e).marks;var n=t.maybeChild(e-1),r=t.maybeChild(e);if(!n){var o=n;n=r,r=o}for(var i=n.marks,s=0;s<i.length;s++)!1!==i[s].type.spec.inclusive||r&&i[s].isInSet(r.marks)||(i=i[s--].removeFromSet(i));return i},_.prototype.marksAcross=function(t){var e=this.parent.maybeChild(this.index());if(!e||!e.isInline)return null;for(var n=e.marks,r=t.parent.maybeChild(t.index()),o=0;o<n.length;o++)!1!==n[o].type.spec.inclusive||r&&n[o].isInSet(r.marks)||(n=n[o--].removeFromSet(n));return n},_.prototype.sharedDepth=function(t){for(var e=this.depth;e>0;e--)if(this.start(e)<=t&&this.end(e)>=t)return e;return 0},_.prototype.blockRange=function(t,e){if(void 0===t&&(t=this),t.pos<this.pos)return t.blockRange(this);for(var n=this.depth-(this.parent.inlineContent||this.pos==t.pos?1:0);n>=0;n--)if(t.pos<=this.end(n)&&(!e||e(this.node(n))))return new T(this,t,n)},_.prototype.sameParent=function(t){return this.pos-this.parentOffset==t.pos-t.parentOffset},_.prototype.max=function(t){return t.pos>this.pos?t:this},_.prototype.min=function(t){return t.pos<this.pos?t:this},_.prototype.toString=function(){for(var t="",e=1;e<=this.depth;e++)t+=(t?"/":"")+this.node(e).type.name+"_"+this.index(e-1);return t+":"+this.parentOffset},_.resolve=function(t,e){if(!(e>=0&&e<=t.content.size))throw new RangeError("Position "+e+" out of range");for(var n=[],r=0,o=e,i=t;;){var s=i.content.findIndex(o),a=s.index,c=s.offset,u=o-c;if(n.push(i,a,r+c),!u)break;if((i=i.child(a)).isText)break;o=u-1,r+=c+1}return new _(e,n,o)},_.resolveCached=function(t,e){for(var n=0;n<k.length;n++){var r=k[n];if(r.pos==e&&r.doc==t)return r}var o=k[C]=_.resolve(t,e);return C=(C+1)%S,o},Object.defineProperties(_.prototype,x);var k=[],C=0,S=12,T=function(t,e,n){this.$from=t,this.$to=e,this.depth=n},E={start:{configurable:!0},end:{configurable:!0},parent:{configurable:!0},startIndex:{configurable:!0},endIndex:{configurable:!0}};E.start.get=function(){return this.$from.before(this.depth+1)},E.end.get=function(){return this.$to.after(this.depth+1)},E.parent.get=function(){return this.$from.node(this.depth)},E.startIndex.get=function(){return this.$from.index(this.depth)},E.endIndex.get=function(){return this.$to.indexAfter(this.depth)},Object.defineProperties(T.prototype,E);var M=Object.create(null),O=function(t,e,n,r){this.type=t,this.attrs=e,this.content=n||i.empty,this.marks=r||l.none},D={nodeSize:{configurable:!0},childCount:{configurable:!0},textContent:{configurable:!0},firstChild:{configurable:!0},lastChild:{configurable:!0},isBlock:{configurable:!0},isTextblock:{configurable:!0},inlineContent:{configurable:!0},isInline:{configurable:!0},isText:{configurable:!0},isLeaf:{configurable:!0},isAtom:{configurable:!0}};D.nodeSize.get=function(){return this.isLeaf?1:2+this.content.size},D.childCount.get=function(){return this.content.childCount},O.prototype.child=function(t){return this.content.child(t)},O.prototype.maybeChild=function(t){return this.content.maybeChild(t)},O.prototype.forEach=function(t){this.content.forEach(t)},O.prototype.nodesBetween=function(t,e,n,r){void 0===r&&(r=0),this.content.nodesBetween(t,e,n,r,this)},O.prototype.descendants=function(t){this.nodesBetween(0,this.content.size,t)},D.textContent.get=function(){return this.textBetween(0,this.content.size,"")},O.prototype.textBetween=function(t,e,n,r){return this.content.textBetween(t,e,n,r)},D.firstChild.get=function(){return this.content.firstChild},D.lastChild.get=function(){return this.content.lastChild},O.prototype.eq=function(t){return this==t||this.sameMarkup(t)&&this.content.eq(t.content)},O.prototype.sameMarkup=function(t){return this.hasMarkup(t.type,t.attrs,t.marks)},O.prototype.hasMarkup=function(t,e,n){return this.type==t&&u(this.attrs,e||t.defaultAttrs||M)&&l.sameSet(this.marks,n||l.none)},O.prototype.copy=function(t){return void 0===t&&(t=null),t==this.content?this:new this.constructor(this.type,this.attrs,t,this.marks)},O.prototype.mark=function(t){return t==this.marks?this:new this.constructor(this.type,this.attrs,this.content,t)},O.prototype.cut=function(t,e){return 0==t&&e==this.content.size?this:this.copy(this.content.cut(t,e))},O.prototype.slice=function(t,e,n){if(void 0===e&&(e=this.content.size),void 0===n&&(n=!1),t==e)return p.empty;var r=this.resolve(t),o=this.resolve(e),i=n?0:r.sharedDepth(e),s=r.start(i),a=r.node(i).content.cut(r.pos-s,o.pos-s);return new p(a,r.depth-i,o.depth-i)},O.prototype.replace=function(t,e,n){return h(this.resolve(t),this.resolve(e),n)},O.prototype.nodeAt=function(t){for(var e=this;;){var n=e.content.findIndex(t),r=n.index,o=n.offset;if(!(e=e.maybeChild(r)))return null;if(o==t||e.isText)return e;t-=o+1}},O.prototype.childAfter=function(t){var e=this.content.findIndex(t),n=e.index,r=e.offset;return{node:this.content.maybeChild(n),index:n,offset:r}},O.prototype.childBefore=function(t){if(0==t)return{node:null,index:0,offset:0};var e=this.content.findIndex(t),n=e.index,r=e.offset;if(r<t)return{node:this.content.child(n),index:n,offset:r};var o=this.content.child(n-1);return{node:o,index:n-1,offset:r-o.nodeSize}},O.prototype.resolve=function(t){return _.resolveCached(this,t)},O.prototype.resolveNoCache=function(t){return _.resolve(this,t)},O.prototype.rangeHasMark=function(t,e,n){var r=!1;return e>t&&this.nodesBetween(t,e,(function(t){return n.isInSet(t.marks)&&(r=!0),!r})),r},D.isBlock.get=function(){return this.type.isBlock},D.isTextblock.get=function(){return this.type.isTextblock},D.inlineContent.get=function(){return this.type.inlineContent},D.isInline.get=function(){return this.type.isInline},D.isText.get=function(){return this.type.isText},D.isLeaf.get=function(){return this.type.isLeaf},D.isAtom.get=function(){return this.type.isAtom},O.prototype.toString=function(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);var t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),A(this.marks,t)},O.prototype.contentMatchAt=function(t){var e=this.type.contentMatch.matchFragment(this.content,0,t);if(!e)throw new Error("Called contentMatchAt on a node with invalid content");return e},O.prototype.canReplace=function(t,e,n,r,o){void 0===n&&(n=i.empty),void 0===r&&(r=0),void 0===o&&(o=n.childCount);var s=this.contentMatchAt(t).matchFragment(n,r,o),a=s&&s.matchFragment(this.content,e);if(!a||!a.validEnd)return!1;for(var c=r;c<o;c++)if(!this.type.allowsMarks(n.child(c).marks))return!1;return!0},O.prototype.canReplaceWith=function(t,e,n,r){if(r&&!this.type.allowsMarks(r))return!1;var o=this.contentMatchAt(t).matchType(n),i=o&&o.matchFragment(this.content,e);return!!i&&i.validEnd},O.prototype.canAppend=function(t){return t.content.size?this.canReplace(this.childCount,this.childCount,t.content):this.type.compatibleContent(t.type)},O.prototype.check=function(){if(!this.type.validContent(this.content))throw new RangeError("Invalid content for node "+this.type.name+": "+this.content.toString().slice(0,50));for(var t=l.none,e=0;e<this.marks.length;e++)t=this.marks[e].addToSet(t);if(!l.sameSet(t,this.marks))throw new RangeError("Invalid collection of marks for node "+this.type.name+": "+this.marks.map((function(t){return t.type.name})));this.content.forEach((function(t){return t.check()}))},O.prototype.toJSON=function(){var t={type:this.type.name};for(var e in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map((function(t){return t.toJSON()}))),t},O.fromJSON=function(t,e){if(!e)throw new RangeError("Invalid input for Node.fromJSON");var n=null;if(e.marks){if(!Array.isArray(e.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=e.marks.map(t.markFromJSON)}if("text"==e.type){if("string"!=typeof e.text)throw new RangeError("Invalid text node in JSON");return t.text(e.text,n)}var r=i.fromJSON(t,e.content);return t.nodeType(e.type).create(e.attrs,r,n)},Object.defineProperties(O.prototype,D);var I=function(t){function e(e,n,r,o){if(t.call(this,e,n,null,o),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={textContent:{configurable:!0},nodeSize:{configurable:!0}};return e.prototype.toString=function(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):A(this.marks,JSON.stringify(this.text))},n.textContent.get=function(){return this.text},e.prototype.textBetween=function(t,e){return this.text.slice(t,e)},n.nodeSize.get=function(){return this.text.length},e.prototype.mark=function(t){return t==this.marks?this:new e(this.type,this.attrs,this.text,t)},e.prototype.withText=function(t){return t==this.text?this:new e(this.type,this.attrs,t,this.marks)},e.prototype.cut=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.text.length),0==t&&e==this.text.length?this:this.withText(this.text.slice(t,e))},e.prototype.eq=function(t){return this.sameMarkup(t)&&this.text==t.text},e.prototype.toJSON=function(){var e=t.prototype.toJSON.call(this);return e.text=this.text,e},Object.defineProperties(e.prototype,n),e}(O);function A(t,e){for(var n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}var N=function(t){this.validEnd=t,this.next=[],this.wrapCache=[]},B={inlineContent:{configurable:!0},defaultType:{configurable:!0},edgeCount:{configurable:!0}};N.parse=function(t,e){var n=new z(t,e);if(null==n.next)return N.empty;var r=R(n);n.next&&n.err("Unexpected trailing text");var o=function(t){var e=Object.create(null);return function n(r){var o=[];r.forEach((function(e){t[e].forEach((function(e){var n=e.term,r=e.to;if(n){var i=o.indexOf(n),s=i>-1&&o[i+1];W(t,r).forEach((function(t){s||o.push(n,s=[]),-1==s.indexOf(t)&&s.push(t)}))}}))}));for(var i=e[r.join(",")]=new N(r.indexOf(t.length-1)>-1),s=0;s<o.length;s+=2){var a=o[s+1].sort($);i.next.push(o[s],e[a.join(",")]||n(a))}return i}(W(t,0))}(function(t){var e=[[]];return o(function t(e,i){if("choice"==e.type)return e.exprs.reduce((function(e,n){return e.concat(t(n,i))}),[]);if("seq"==e.type)for(var s=0;;s++){var a=t(e.exprs[s],i);if(s==e.exprs.length-1)return a;o(a,i=n())}else{if("star"==e.type){var c=n();return r(i,c),o(t(e.expr,c),c),[r(c)]}if("plus"==e.type){var u=n();return o(t(e.expr,i),u),o(t(e.expr,u),u),[r(u)]}if("opt"==e.type)return[r(i)].concat(t(e.expr,i));if("range"==e.type){for(var l=i,d=0;d<e.min;d++){var p=n();o(t(e.expr,l),p),l=p}if(-1==e.max)o(t(e.expr,l),l);else for(var f=e.min;f<e.max;f++){var h=n();r(l,h),o(t(e.expr,l),h),l=h}return[r(l)]}if("name"==e.type)return[r(i,null,e.value)]}}(t,0),n()),e;function n(){return e.push([])-1}function r(t,n,r){var o={term:r,to:n};return e[t].push(o),o}function o(t,e){t.forEach((function(t){return t.to=e}))}}(r));return function(t,e){for(var n=0,r=[t];n<r.length;n++){for(var o=r[n],i=!o.validEnd,s=[],a=0;a<o.next.length;a+=2){var c=o.next[a],u=o.next[a+1];s.push(c.name),!i||c.isText||c.hasRequiredAttrs()||(i=!1),-1==r.indexOf(u)&&r.push(u)}i&&e.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(o,n),o},N.prototype.matchType=function(t){for(var e=0;e<this.next.length;e+=2)if(this.next[e]==t)return this.next[e+1];return null},N.prototype.matchFragment=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=t.childCount);for(var r=this,o=e;r&&o<n;o++)r=r.matchType(t.child(o).type);return r},B.inlineContent.get=function(){var t=this.next[0];return!!t&&t.isInline},B.defaultType.get=function(){for(var t=0;t<this.next.length;t+=2){var e=this.next[t];if(!e.isText&&!e.hasRequiredAttrs())return e}},N.prototype.compatible=function(t){for(var e=0;e<this.next.length;e+=2)for(var n=0;n<t.next.length;n+=2)if(this.next[e]==t.next[n])return!0;return!1},N.prototype.fillBefore=function(t,e,n){void 0===e&&(e=!1),void 0===n&&(n=0);var r=[this];return function o(s,a){var c=s.matchFragment(t,n);if(c&&(!e||c.validEnd))return i.from(a.map((function(t){return t.createAndFill()})));for(var u=0;u<s.next.length;u+=2){var l=s.next[u],d=s.next[u+1];if(!l.isText&&!l.hasRequiredAttrs()&&-1==r.indexOf(d)){r.push(d);var p=o(d,a.concat(l));if(p)return p}}}(this,[])},N.prototype.findWrapping=function(t){for(var e=0;e<this.wrapCache.length;e+=2)if(this.wrapCache[e]==t)return this.wrapCache[e+1];var n=this.computeWrapping(t);return this.wrapCache.push(t,n),n},N.prototype.computeWrapping=function(t){for(var e=Object.create(null),n=[{match:this,type:null,via:null}];n.length;){var r=n.shift(),o=r.match;if(o.matchType(t)){for(var i=[],s=r;s.type;s=s.via)i.push(s.type);return i.reverse()}for(var a=0;a<o.next.length;a+=2){var c=o.next[a];c.isLeaf||c.hasRequiredAttrs()||c.name in e||r.type&&!o.next[a+1].validEnd||(n.push({match:c.contentMatch,type:c,via:r}),e[c.name]=!0)}}},B.edgeCount.get=function(){return this.next.length>>1},N.prototype.edge=function(t){var e=t<<1;if(e>=this.next.length)throw new RangeError("There's no "+t+"th edge in this content match");return{type:this.next[e],next:this.next[e+1]}},N.prototype.toString=function(){var t=[];return function e(n){t.push(n);for(var r=1;r<n.next.length;r+=2)-1==t.indexOf(n.next[r])&&e(n.next[r])}(this),t.map((function(e,n){for(var r=n+(e.validEnd?"*":" ")+" ",o=0;o<e.next.length;o+=2)r+=(o?", ":"")+e.next[o].name+"->"+t.indexOf(e.next[o+1]);return r})).join("\n")},Object.defineProperties(N.prototype,B),N.empty=new N(!0);var z=function(t,e){this.string=t,this.nodeTypes=e,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()},P={next:{configurable:!0}};function R(t){var e=[];do{e.push(F(t))}while(t.eat("|"));return 1==e.length?e[0]:{type:"choice",exprs:e}}function F(t){var e=[];do{e.push(L(t))}while(t.next&&")"!=t.next&&"|"!=t.next);return 1==e.length?e[0]:{type:"seq",exprs:e}}function L(t){for(var e=function(t){if(t.eat("(")){var e=R(t);return t.eat(")")||t.err("Missing closing paren"),e}if(!/\W/.test(t.next)){var n=function(t,e){var n=t.nodeTypes,r=n[e];if(r)return[r];var o=[];for(var i in n){var s=n[i];s.groups.indexOf(e)>-1&&o.push(s)}0==o.length&&t.err("No node type or group '"+e+"' found");return o}(t,t.next).map((function(e){return null==t.inline?t.inline=e.isInline:t.inline!=e.isInline&&t.err("Mixing inline and block content"),{type:"name",value:e}}));return t.pos++,1==n.length?n[0]:{type:"choice",exprs:n}}t.err("Unexpected token '"+t.next+"'")}(t);;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else{if(!t.eat("{"))break;e=j(t,e)}return e}function V(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");var e=Number(t.next);return t.pos++,e}function j(t,e){var n=V(t),r=n;return t.eat(",")&&(r="}"!=t.next?V(t):-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function $(t,e){return e-t}function W(t,e){var n=[];return function e(r){var o=t[r];if(1==o.length&&!o[0].term)return e(o[0].to);n.push(r);for(var i=0;i<o.length;i++){var s=o[i],a=s.term,c=s.to;a||-1!=n.indexOf(c)||e(c)}}(e),n.sort($)}function H(t){var e=Object.create(null);for(var n in t){var r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function q(t,e){var n=Object.create(null);for(var r in t){var o=e&&e[r];if(void 0===o){var i=t[r];if(!i.hasDefault)throw new RangeError("No value supplied for attribute "+r);o=i.default}n[r]=o}return n}function J(t){var e=Object.create(null);if(t)for(var n in t)e[n]=new G(t[n]);return e}P.next.get=function(){return this.tokens[this.pos]},z.prototype.eat=function(t){return this.next==t&&(this.pos++||!0)},z.prototype.err=function(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")},Object.defineProperties(z.prototype,P);var K=function(t,e,n){this.name=t,this.schema=e,this.spec=n,this.groups=n.group?n.group.split(" "):[],this.attrs=J(n.attrs),this.defaultAttrs=H(this.attrs),this.contentMatch=null,this.markSet=null,this.inlineContent=null,this.isBlock=!(n.inline||"text"==t),this.isText="text"==t},U={isInline:{configurable:!0},isTextblock:{configurable:!0},isLeaf:{configurable:!0},isAtom:{configurable:!0},whitespace:{configurable:!0}};U.isInline.get=function(){return!this.isBlock},U.isTextblock.get=function(){return this.isBlock&&this.inlineContent},U.isLeaf.get=function(){return this.contentMatch==N.empty},U.isAtom.get=function(){return this.isLeaf||this.spec.atom},U.whitespace.get=function(){return this.spec.whitespace||(this.spec.code?"pre":"normal")},K.prototype.hasRequiredAttrs=function(){for(var t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1},K.prototype.compatibleContent=function(t){return this==t||this.contentMatch.compatible(t.contentMatch)},K.prototype.computeAttrs=function(t){return!t&&this.defaultAttrs?this.defaultAttrs:q(this.attrs,t)},K.prototype.create=function(t,e,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new O(this,this.computeAttrs(t),i.from(e),l.setFrom(n))},K.prototype.createChecked=function(t,e,n){if(e=i.from(e),!this.validContent(e))throw new RangeError("Invalid content for node "+this.name);return new O(this,this.computeAttrs(t),e,l.setFrom(n))},K.prototype.createAndFill=function(t,e,n){if(t=this.computeAttrs(t),(e=i.from(e)).size){var r=this.contentMatch.fillBefore(e);if(!r)return null;e=r.append(e)}var o=this.contentMatch.matchFragment(e).fillBefore(i.empty,!0);return o?new O(this,t,e.append(o),l.setFrom(n)):null},K.prototype.validContent=function(t){var e=this.contentMatch.matchFragment(t);if(!e||!e.validEnd)return!1;for(var n=0;n<t.childCount;n++)if(!this.allowsMarks(t.child(n).marks))return!1;return!0},K.prototype.allowsMarkType=function(t){return null==this.markSet||this.markSet.indexOf(t)>-1},K.prototype.allowsMarks=function(t){if(null==this.markSet)return!0;for(var e=0;e<t.length;e++)if(!this.allowsMarkType(t[e].type))return!1;return!0},K.prototype.allowedMarks=function(t){if(null==this.markSet)return t;for(var e,n=0;n<t.length;n++)this.allowsMarkType(t[n].type)?e&&e.push(t[n]):e||(e=t.slice(0,n));return e?e.length?e:l.empty:t},K.compile=function(t,e){var n=Object.create(null);t.forEach((function(t,r){return n[t]=new K(t,e,r)}));var r=e.spec.topNode||"doc";if(!n[r])throw new RangeError("Schema is missing its top node type ('"+r+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(var o in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n},Object.defineProperties(K.prototype,U);var G=function(t){this.hasDefault=Object.prototype.hasOwnProperty.call(t,"default"),this.default=t.default},Y={isRequired:{configurable:!0}};Y.isRequired.get=function(){return!this.hasDefault},Object.defineProperties(G.prototype,Y);var X=function(t,e,n,r){this.name=t,this.schema=n,this.spec=r,this.attrs=J(r.attrs),this.rank=e,this.excluded=null;var o=H(this.attrs);this.instance=o&&new l(this,o)};X.prototype.create=function(t){return!t&&this.instance?this.instance:new l(this,q(this.attrs,t))},X.compile=function(t,e){var n=Object.create(null),r=0;return t.forEach((function(t,o){return n[t]=new X(t,r++,e,o)})),n},X.prototype.removeFromSet=function(t){for(var e=0;e<t.length;e++)t[e].type==this&&(t=t.slice(0,e).concat(t.slice(e+1)),e--);return t},X.prototype.isInSet=function(t){for(var e=0;e<t.length;e++)if(t[e].type==this)return t[e]},X.prototype.excludes=function(t){return this.excluded.indexOf(t)>-1};var Z=function(t){for(var e in this.spec={},t)this.spec[e]=t[e];this.spec.nodes=o.from(t.nodes),this.spec.marks=o.from(t.marks),this.nodes=K.compile(this.spec.nodes,this),this.marks=X.compile(this.spec.marks,this);var n=Object.create(null);for(var r in this.nodes){if(r in this.marks)throw new RangeError(r+" can not be both a node and a mark");var i=this.nodes[r],s=i.spec.content||"",a=i.spec.marks;i.contentMatch=n[s]||(n[s]=N.parse(s,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.markSet="_"==a?null:a?Q(this,a.split(" ")):""!=a&&i.inlineContent?null:[]}for(var c in this.marks){var u=this.marks[c],l=u.spec.excludes;u.excluded=null==l?[u]:""==l?[]:Q(this,l.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached=Object.create(null),this.cached.wrappings=Object.create(null)};function Q(t,e){for(var n=[],r=0;r<e.length;r++){var o=e[r],i=t.marks[o],s=i;if(i)n.push(i);else for(var a in t.marks){var c=t.marks[a];("_"==o||c.spec.group&&c.spec.group.split(" ").indexOf(o)>-1)&&n.push(s=c)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}Z.prototype.node=function(t,e,n,r){if("string"==typeof t)t=this.nodeType(t);else{if(!(t instanceof K))throw new RangeError("Invalid node type: "+t);if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}return t.createChecked(e,n,r)},Z.prototype.text=function(t,e){var n=this.nodes.text;return new I(n,n.defaultAttrs,t,l.setFrom(e))},Z.prototype.mark=function(t,e){return"string"==typeof t&&(t=this.marks[t]),t.create(e)},Z.prototype.nodeFromJSON=function(t){return O.fromJSON(this,t)},Z.prototype.markFromJSON=function(t){return l.fromJSON(this,t)},Z.prototype.nodeType=function(t){var e=this.nodes[t];if(!e)throw new RangeError("Unknown node type: "+t);return e};var tt=function(t,e){var n=this;this.schema=t,this.rules=e,this.tags=[],this.styles=[],e.forEach((function(t){t.tag?n.tags.push(t):t.style&&n.styles.push(t)})),this.normalizeLists=!this.tags.some((function(e){if(!/^(ul|ol)\b/.test(e.tag)||!e.node)return!1;var n=t.nodes[e.node];return n.contentMatch.matchType(n)}))};tt.prototype.parse=function(t,e){void 0===e&&(e={});var n=new st(this,e,!1);return n.addAll(t,null,e.from,e.to),n.finish()},tt.prototype.parseSlice=function(t,e){void 0===e&&(e={});var n=new st(this,e,!0);return n.addAll(t,null,e.from,e.to),p.maxOpen(n.finish())},tt.prototype.matchTag=function(t,e,n){for(var r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){var o=this.tags[r];if(ct(t,o.tag)&&(void 0===o.namespace||t.namespaceURI==o.namespace)&&(!o.context||e.matchesContext(o.context))){if(o.getAttrs){var i=o.getAttrs(t);if(!1===i)continue;o.attrs=i}return o}}},tt.prototype.matchStyle=function(t,e,n,r){for(var o=r?this.styles.indexOf(r)+1:0;o<this.styles.length;o++){var i=this.styles[o];if(!(0!=i.style.indexOf(t)||i.context&&!n.matchesContext(i.context)||i.style.length>t.length&&(61!=i.style.charCodeAt(t.length)||i.style.slice(t.length+1)!=e))){if(i.getAttrs){var s=i.getAttrs(e);if(!1===s)continue;i.attrs=s}return i}}},tt.schemaRules=function(t){var e=[];function n(t){for(var n=null==t.priority?50:t.priority,r=0;r<e.length;r++){var o=e[r];if((null==o.priority?50:o.priority)<n)break}e.splice(r,0,t)}var r=function(e){var r=t.marks[e].spec.parseDOM;r&&r.forEach((function(t){n(t=ut(t)),t.mark=e}))};for(var o in t.marks)r(o);var i;for(var s in t.nodes)i=void 0,(i=t.nodes[s].spec.parseDOM)&&i.forEach((function(t){n(t=ut(t)),t.node=s}));return e},tt.fromSchema=function(t){return t.cached.domParser||(t.cached.domParser=new tt(t,tt.schemaRules(t)))};var et={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},nt={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},rt={ol:!0,ul:!0};function ot(t,e,n){return null!=e?(e?1:0)|("full"===e?2:0):t&&"pre"==t.whitespace?3:-5&n}var it=function(t,e,n,r,o,i,s){this.type=t,this.attrs=e,this.solid=o,this.match=i||(4&s?null:t.contentMatch),this.options=s,this.content=[],this.marks=n,this.activeMarks=l.none,this.pendingMarks=r,this.stashMarks=[]};it.prototype.findWrapping=function(t){if(!this.match){if(!this.type)return[];var e=this.type.contentMatch.fillBefore(i.from(t));if(!e){var n,r=this.type.contentMatch;return(n=r.findWrapping(t.type))?(this.match=r,n):null}this.match=this.type.contentMatch.matchFragment(e)}return this.match.findWrapping(t.type)},it.prototype.finish=function(t){if(!(1&this.options)){var e,n=this.content[this.content.length-1];n&&n.isText&&(e=/[ \t\r\n\u000c]+$/.exec(n.text))&&(n.text.length==e[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-e[0].length)))}var r=i.from(this.content);return!t&&this.match&&(r=r.append(this.match.fillBefore(i.empty,!0))),this.type?this.type.create(this.attrs,r,this.marks):r},it.prototype.popFromStashMark=function(t){for(var e=this.stashMarks.length-1;e>=0;e--)if(t.eq(this.stashMarks[e]))return this.stashMarks.splice(e,1)[0]},it.prototype.applyPending=function(t){for(var e=0,n=this.pendingMarks;e<n.length;e++){var r=n[e];(this.type?this.type.allowsMarkType(r.type):lt(r.type,t))&&!r.isInSet(this.activeMarks)&&(this.activeMarks=r.addToSet(this.activeMarks),this.pendingMarks=r.removeFromSet(this.pendingMarks))}},it.prototype.inlineContext=function(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!et.hasOwnProperty(t.parentNode.nodeName.toLowerCase())};var st=function(t,e,n){this.parser=t,this.options=e,this.isOpen=n;var r,o=e.topNode,i=ot(null,e.preserveWhitespace,0)|(n?4:0);r=o?new it(o.type,o.attrs,l.none,l.none,!0,e.topMatch||o.type.contentMatch,i):new it(n?null:t.schema.topNodeType,null,l.none,l.none,!0,null,i),this.nodes=[r],this.open=0,this.find=e.findPositions,this.needsBlock=!1},at={top:{configurable:!0},currentPos:{configurable:!0}};function ct(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function ut(t){var e={};for(var n in t)e[n]=t[n];return e}function lt(t,e){var n=e.schema.nodes,r=function(r){var o=n[r];if(o.allowsMarkType(t)){var i=[],s=function(t){i.push(t);for(var n=0;n<t.edgeCount;n++){var r=t.edge(n),o=r.type,a=r.next;if(o==e)return!0;if(i.indexOf(a)<0&&s(a))return!0}};return s(o.contentMatch)?{v:!0}:void 0}};for(var o in n){var i=r(o);if(i)return i.v}}at.top.get=function(){return this.nodes[this.open]},st.prototype.addDOM=function(t){if(3==t.nodeType)this.addTextNode(t);else if(1==t.nodeType){var e=t.getAttribute("style"),n=e?this.readStyles(function(t){var e,n=/\s*([\w-]+)\s*:\s*([^;]+)/g,r=[];for(;e=n.exec(t);)r.push(e[1],e[2].trim());return r}(e)):null,r=this.top;if(null!=n)for(var o=0;o<n.length;o++)this.addPendingMark(n[o]);if(this.addElement(t),null!=n)for(var i=0;i<n.length;i++)this.removePendingMark(n[i],r)}},st.prototype.addTextNode=function(t){var e=t.nodeValue,n=this.top;if(2&n.options||n.inlineContext(t)||/[^ \t\r\n\u000c]/.test(e)){if(1&n.options)e=2&n.options?e.replace(/\r\n?/g,"\n"):e.replace(/\r?\n|\r/g," ");else if(e=e.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(e)&&this.open==this.nodes.length-1){var r=n.content[n.content.length-1],o=t.previousSibling;(!r||o&&"BR"==o.nodeName||r.isText&&/[ \t\r\n\u000c]$/.test(r.text))&&(e=e.slice(1))}e&&this.insertNode(this.parser.schema.text(e)),this.findInText(t)}else this.findInside(t)},st.prototype.addElement=function(t,e){var n,r=t.nodeName.toLowerCase();rt.hasOwnProperty(r)&&this.parser.normalizeLists&&function(t){for(var e=t.firstChild,n=null;e;e=e.nextSibling){var r=1==e.nodeType?e.nodeName.toLowerCase():null;r&&rt.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):"li"==r?n=e:r&&(n=null)}}(t);var o=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(n=this.parser.matchTag(t,this,e));if(o?o.ignore:nt.hasOwnProperty(r))this.findInside(t),this.ignoreFallback(t);else if(!o||o.skip||o.closeParent){o&&o.closeParent?this.open=Math.max(0,this.open-1):o&&o.skip.nodeType&&(t=o.skip);var i,s=this.top,a=this.needsBlock;if(et.hasOwnProperty(r))i=!0,s.type||(this.needsBlock=!0);else if(!t.firstChild)return void this.leafFallback(t);this.addAll(t),i&&this.sync(s),this.needsBlock=a}else this.addElementByRule(t,o,!1===o.consuming?n:null)},st.prototype.leafFallback=function(t){"BR"==t.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode("\n"))},st.prototype.ignoreFallback=function(t){"BR"!=t.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"))},st.prototype.readStyles=function(t){var e=l.none;t:for(var n=0;n<t.length;n+=2)for(var r=null;;){var o=this.parser.matchStyle(t[n],t[n+1],this,r);if(!o)continue t;if(o.ignore)return null;if(e=this.parser.schema.marks[o.mark].create(o.attrs).addToSet(e),!1!==o.consuming)break;r=o}return e},st.prototype.addElementByRule=function(t,e,n){var r,o,i,s=this;e.node?(o=this.parser.schema.nodes[e.node]).isLeaf?this.insertNode(o.create(e.attrs))||this.leafFallback(t):r=this.enter(o,e.attrs,e.preserveWhitespace):(i=this.parser.schema.marks[e.mark].create(e.attrs),this.addPendingMark(i));var a=this.top;if(o&&o.isLeaf)this.findInside(t);else if(n)this.addElement(t,n);else if(e.getContent)this.findInside(t),e.getContent(t,this.parser.schema).forEach((function(t){return s.insertNode(t)}));else{var c=e.contentElement;"string"==typeof c?c=t.querySelector(c):"function"==typeof c&&(c=c(t)),c||(c=t),this.findAround(t,c,!0),this.addAll(c,r)}r&&(this.sync(a),this.open--),i&&this.removePendingMark(i,a)},st.prototype.addAll=function(t,e,n,r){for(var o=n||0,i=n?t.childNodes[n]:t.firstChild,s=null==r?null:t.childNodes[r];i!=s;i=i.nextSibling,++o)this.findAtPoint(t,o),this.addDOM(i),e&&et.hasOwnProperty(i.nodeName.toLowerCase())&&this.sync(e);this.findAtPoint(t,o)},st.prototype.findPlace=function(t){for(var e,n,r=this.open;r>=0;r--){var o=this.nodes[r],i=o.findWrapping(t);if(i&&(!e||e.length>i.length)&&(e=i,n=o,!i.length))break;if(o.solid)break}if(!e)return!1;this.sync(n);for(var s=0;s<e.length;s++)this.enterInner(e[s],null,!1);return!0},st.prototype.insertNode=function(t){if(t.isInline&&this.needsBlock&&!this.top.type){var e=this.textblockFromContext();e&&this.enterInner(e)}if(this.findPlace(t)){this.closeExtra();var n=this.top;n.applyPending(t.type),n.match&&(n.match=n.match.matchType(t.type));for(var r=n.activeMarks,o=0;o<t.marks.length;o++)n.type&&!n.type.allowsMarkType(t.marks[o].type)||(r=t.marks[o].addToSet(r));return n.content.push(t.mark(r)),!0}return!1},st.prototype.enter=function(t,e,n){var r=this.findPlace(t.create(e));return r&&this.enterInner(t,e,!0,n),r},st.prototype.enterInner=function(t,e,n,r){this.closeExtra();var o=this.top;o.applyPending(t),o.match=o.match&&o.match.matchType(t,e);var i=ot(t,r,o.options);4&o.options&&0==o.content.length&&(i|=4),this.nodes.push(new it(t,e,o.activeMarks,o.pendingMarks,n,null,i)),this.open++},st.prototype.closeExtra=function(t){var e=this.nodes.length-1;if(e>this.open){for(;e>this.open;e--)this.nodes[e-1].content.push(this.nodes[e].finish(t));this.nodes.length=this.open+1}},st.prototype.finish=function(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)},st.prototype.sync=function(t){for(var e=this.open;e>=0;e--)if(this.nodes[e]==t)return void(this.open=e)},at.currentPos.get=function(){this.closeExtra();for(var t=0,e=this.open;e>=0;e--){for(var n=this.nodes[e].content,r=n.length-1;r>=0;r--)t+=n[r].nodeSize;e&&t++}return t},st.prototype.findAtPoint=function(t,e){if(this.find)for(var n=0;n<this.find.length;n++)this.find[n].node==t&&this.find[n].offset==e&&(this.find[n].pos=this.currentPos)},st.prototype.findInside=function(t){if(this.find)for(var e=0;e<this.find.length;e++)null==this.find[e].pos&&1==t.nodeType&&t.contains(this.find[e].node)&&(this.find[e].pos=this.currentPos)},st.prototype.findAround=function(t,e,n){if(t!=e&&this.find)for(var r=0;r<this.find.length;r++){if(null==this.find[r].pos&&1==t.nodeType&&t.contains(this.find[r].node))e.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}},st.prototype.findInText=function(t){if(this.find)for(var e=0;e<this.find.length;e++)this.find[e].node==t&&(this.find[e].pos=this.currentPos-(t.nodeValue.length-this.find[e].offset))},st.prototype.matchesContext=function(t){var e=this;if(t.indexOf("|")>-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);var n=t.split("/"),r=this.options.context,o=!(this.isOpen||r&&r.parent.type!=this.nodes[0].type),i=-(r?r.depth+1:0)+(o?0:1),s=function(t,a){for(;t>=0;t--){var c=n[t];if(""==c){if(t==n.length-1||0==t)continue;for(;a>=i;a--)if(s(t-1,a))return!0;return!1}var u=a>0||0==a&&o?e.nodes[a].type:r&&a>=i?r.node(a-i).type:null;if(!u||u.name!=c&&-1==u.groups.indexOf(c))return!1;a--}return!0};return s(n.length-1,this.open)},st.prototype.textblockFromContext=function(){var t=this.options.context;if(t)for(var e=t.depth;e>=0;e--){var n=t.node(e).contentMatchAt(t.indexAfter(e)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(var r in this.parser.schema.nodes){var o=this.parser.schema.nodes[r];if(o.isTextblock&&o.defaultAttrs)return o}},st.prototype.addPendingMark=function(t){var e=function(t,e){for(var n=0;n<e.length;n++)if(t.eq(e[n]))return e[n]}(t,this.top.pendingMarks);e&&this.top.stashMarks.push(e),this.top.pendingMarks=t.addToSet(this.top.pendingMarks)},st.prototype.removePendingMark=function(t,e){for(var n=this.open;n>=0;n--){var r=this.nodes[n];if(r.pendingMarks.lastIndexOf(t)>-1)r.pendingMarks=t.removeFromSet(r.pendingMarks);else{r.activeMarks=t.removeFromSet(r.activeMarks);var o=r.popFromStashMark(t);o&&r.type&&r.type.allowsMarkType(o.type)&&(r.activeMarks=o.addToSet(r.activeMarks))}if(r==e)break}},Object.defineProperties(st.prototype,at);var dt=function(t,e){this.nodes=t||{},this.marks=e||{}};function pt(t){var e={};for(var n in t){var r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function ft(t){return t.document||window.document}dt.prototype.serializeFragment=function(t,e,n){var r=this;void 0===e&&(e={}),n||(n=ft(e).createDocumentFragment());var o=n,i=null;return t.forEach((function(t){if(i||t.marks.length){i||(i=[]);for(var n=0,s=0;n<i.length&&s<t.marks.length;){var a=t.marks[s];if(r.marks[a.type.name]){if(!a.eq(i[n])||!1===a.type.spec.spanning)break;n+=2,s++}else s++}for(;n<i.length;)o=i.pop(),i.pop();for(;s<t.marks.length;){var c=t.marks[s++],u=r.serializeMark(c,t.isInline,e);u&&(i.push(c,o),o.appendChild(u.dom),o=u.contentDOM||u.dom)}}o.appendChild(r.serializeNodeInner(t,e))})),n},dt.prototype.serializeNodeInner=function(t,e){void 0===e&&(e={});var n=dt.renderSpec(ft(e),this.nodes[t.type.name](t)),r=n.dom,o=n.contentDOM;if(o){if(t.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");e.onContent?e.onContent(t,o,e):this.serializeFragment(t.content,e,o)}return r},dt.prototype.serializeNode=function(t,e){void 0===e&&(e={});for(var n=this.serializeNodeInner(t,e),r=t.marks.length-1;r>=0;r--){var o=this.serializeMark(t.marks[r],t.isInline,e);o&&((o.contentDOM||o.dom).appendChild(n),n=o.dom)}return n},dt.prototype.serializeMark=function(t,e,n){void 0===n&&(n={});var r=this.marks[t.type.name];return r&&dt.renderSpec(ft(n),r(t,e))},dt.renderSpec=function(t,e,n){if(void 0===n&&(n=null),"string"==typeof e)return{dom:t.createTextNode(e)};if(null!=e.nodeType)return{dom:e};if(e.dom&&null!=e.dom.nodeType)return e;var r=e[0],o=r.indexOf(" ");o>0&&(n=r.slice(0,o),r=r.slice(o+1));var i=null,s=n?t.createElementNS(n,r):t.createElement(r),a=e[1],c=1;if(a&&"object"==typeof a&&null==a.nodeType&&!Array.isArray(a))for(var u in c=2,a)if(null!=a[u]){var l=u.indexOf(" ");l>0?s.setAttributeNS(u.slice(0,l),u.slice(l+1),a[u]):s.setAttribute(u,a[u])}for(var d=c;d<e.length;d++){var p=e[d];if(0===p){if(d<e.length-1||d>c)throw new RangeError("Content hole must be the only child of its parent node");return{dom:s,contentDOM:s}}var f=dt.renderSpec(t,p,n),h=f.dom,m=f.contentDOM;if(s.appendChild(h),m){if(i)throw new RangeError("Multiple content holes");i=m}}return{dom:s,contentDOM:i}},dt.fromSchema=function(t){return t.cached.domSerializer||(t.cached.domSerializer=new dt(this.nodesFromSchema(t),this.marksFromSchema(t)))},dt.nodesFromSchema=function(t){var e=pt(t.nodes);return e.text||(e.text=function(t){return t.text}),e},dt.marksFromSchema=function(t){return pt(t.marks)};var ht=Math.pow(2,16);function mt(t){return 65535&t}var vt=function(t,e,n){void 0===e&&(e=!1),void 0===n&&(n=null),this.pos=t,this.deleted=e,this.recover=n},gt=function t(e,n){if(void 0===n&&(n=!1),!e.length&&t.empty)return t.empty;this.ranges=e,this.inverted=n};gt.prototype.recover=function(t){var e=0,n=mt(t);if(!this.inverted)for(var r=0;r<n;r++)e+=this.ranges[3*r+2]-this.ranges[3*r+1];return this.ranges[3*n]+e+function(t){return(t-(65535&t))/ht}(t)},gt.prototype.mapResult=function(t,e){return void 0===e&&(e=1),this._map(t,e,!1)},gt.prototype.map=function(t,e){return void 0===e&&(e=1),this._map(t,e,!0)},gt.prototype._map=function(t,e,n){for(var r=0,o=this.inverted?2:1,i=this.inverted?1:2,s=0;s<this.ranges.length;s+=3){var a=this.ranges[s]-(this.inverted?r:0);if(a>t)break;var c=this.ranges[s+o],u=this.ranges[s+i],l=a+c;if(t<=l){var d=a+r+((c?t==a?-1:t==l?1:e:e)<0?0:u);if(n)return d;var p=t==(e<0?a:l)?null:s/3+(t-a)*ht;return new vt(d,e<0?t!=a:t!=l,p)}r+=u-c}return n?t+r:new vt(t+r)},gt.prototype.touches=function(t,e){for(var n=0,r=mt(e),o=this.inverted?2:1,i=this.inverted?1:2,s=0;s<this.ranges.length;s+=3){var a=this.ranges[s]-(this.inverted?n:0);if(a>t)break;var c=this.ranges[s+o];if(t<=a+c&&s==3*r)return!0;n+=this.ranges[s+i]-c}return!1},gt.prototype.forEach=function(t){for(var e=this.inverted?2:1,n=this.inverted?1:2,r=0,o=0;r<this.ranges.length;r+=3){var i=this.ranges[r],s=i-(this.inverted?o:0),a=i+(this.inverted?0:o),c=this.ranges[r+e],u=this.ranges[r+n];t(s,s+c,a,a+u),o+=u-c}},gt.prototype.invert=function(){return new gt(this.ranges,!this.inverted)},gt.prototype.toString=function(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)},gt.offset=function(t){return 0==t?gt.empty:new gt(t<0?[0,-t,0]:[0,0,t])},gt.empty=new gt([]);var yt=function(t,e,n,r){this.maps=t||[],this.from=n||0,this.to=null==r?this.maps.length:r,this.mirror=e};function bt(t){var e=Error.call(this,t);return e.__proto__=bt.prototype,e}yt.prototype.slice=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.maps.length),new yt(this.maps,this.mirror,t,e)},yt.prototype.copy=function(){return new yt(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)},yt.prototype.appendMap=function(t,e){this.to=this.maps.push(t),null!=e&&this.setMirror(this.maps.length-1,e)},yt.prototype.appendMapping=function(t){for(var e=0,n=this.maps.length;e<t.maps.length;e++){var r=t.getMirror(e);this.appendMap(t.maps[e],null!=r&&r<e?n+r:null)}},yt.prototype.getMirror=function(t){if(this.mirror)for(var e=0;e<this.mirror.length;e++)if(this.mirror[e]==t)return this.mirror[e+(e%2?-1:1)]},yt.prototype.setMirror=function(t,e){this.mirror||(this.mirror=[]),this.mirror.push(t,e)},yt.prototype.appendMappingInverted=function(t){for(var e=t.maps.length-1,n=this.maps.length+t.maps.length;e>=0;e--){var r=t.getMirror(e);this.appendMap(t.maps[e].invert(),null!=r&&r>e?n-r-1:null)}},yt.prototype.invert=function(){var t=new yt;return t.appendMappingInverted(this),t},yt.prototype.map=function(t,e){if(void 0===e&&(e=1),this.mirror)return this._map(t,e,!0);for(var n=this.from;n<this.to;n++)t=this.maps[n].map(t,e);return t},yt.prototype.mapResult=function(t,e){return void 0===e&&(e=1),this._map(t,e,!1)},yt.prototype._map=function(t,e,n){for(var r=!1,o=this.from;o<this.to;o++){var i=this.maps[o].mapResult(t,e);if(null!=i.recover){var s=this.getMirror(o);if(null!=s&&s>o&&s<this.to){o=s,t=this.maps[s].recover(i.recover);continue}}i.deleted&&(r=!0),t=i.pos}return n?t:new vt(t,r)},bt.prototype=Object.create(Error.prototype),bt.prototype.constructor=bt,bt.prototype.name="TransformError";var wt=function(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new yt},_t={before:{configurable:!0},docChanged:{configurable:!0}};function xt(){throw new Error("Override me")}_t.before.get=function(){return this.docs.length?this.docs[0]:this.doc},wt.prototype.step=function(t){var e=this.maybeStep(t);if(e.failed)throw new bt(e.failed);return this},wt.prototype.maybeStep=function(t){var e=t.apply(this.doc);return e.failed||this.addStep(t,e.doc),e},_t.docChanged.get=function(){return this.steps.length>0},wt.prototype.addStep=function(t,e){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=e},Object.defineProperties(wt.prototype,_t);var kt=Object.create(null),Ct=function(){};Ct.prototype.apply=function(t){return xt()},Ct.prototype.getMap=function(){return gt.empty},Ct.prototype.invert=function(t){return xt()},Ct.prototype.map=function(t){return xt()},Ct.prototype.merge=function(t){return null},Ct.prototype.toJSON=function(){return xt()},Ct.fromJSON=function(t,e){if(!e||!e.stepType)throw new RangeError("Invalid input for Step.fromJSON");var n=kt[e.stepType];if(!n)throw new RangeError("No step type "+e.stepType+" defined");return n.fromJSON(t,e)},Ct.jsonID=function(t,e){if(t in kt)throw new RangeError("Duplicate use of step JSON ID "+t);return kt[t]=e,e.prototype.jsonID=t,e};var St=function(t,e){this.doc=t,this.failed=e};St.ok=function(t){return new St(t,null)},St.fail=function(t){return new St(null,t)},St.fromReplace=function(t,e,n,r){try{return St.ok(t.replace(e,n,r))}catch(t){if(t instanceof d)return St.fail(t.message);throw t}};var Tt=function(t){function e(e,n,r,o){t.call(this),this.from=e,this.to=n,this.slice=r,this.structure=!!o}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.apply=function(t){return this.structure&&Mt(t,this.from,this.to)?St.fail("Structure replace would overwrite content"):St.fromReplace(t,this.from,this.to,this.slice)},e.prototype.getMap=function(){return new gt([this.from,this.to-this.from,this.slice.size])},e.prototype.invert=function(t){return new e(this.from,this.from+this.slice.size,t.slice(this.from,this.to))},e.prototype.map=function(t){var n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted?null:new e(n.pos,Math.max(n.pos,r.pos),this.slice)},e.prototype.merge=function(t){if(!(t instanceof e)||t.structure||this.structure)return null;if(this.from+this.slice.size!=t.from||this.slice.openEnd||t.slice.openStart){if(t.to!=this.from||this.slice.openStart||t.slice.openEnd)return null;var n=this.slice.size+t.slice.size==0?p.empty:new p(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new e(t.from,this.to,n,this.structure)}var r=this.slice.size+t.slice.size==0?p.empty:new p(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new e(this.from,this.to+(t.to-t.from),r,this.structure)},e.prototype.toJSON=function(){var t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t},e.fromJSON=function(t,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new e(n.from,n.to,p.fromJSON(t,n.slice),!!n.structure)},e}(Ct);Ct.jsonID("replace",Tt);var Et=function(t){function e(e,n,r,o,i,s,a){t.call(this),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=o,this.slice=i,this.insert=s,this.structure=!!a}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.apply=function(t){if(this.structure&&(Mt(t,this.from,this.gapFrom)||Mt(t,this.gapTo,this.to)))return St.fail("Structure gap-replace would overwrite content");var e=t.slice(this.gapFrom,this.gapTo);if(e.openStart||e.openEnd)return St.fail("Gap is not a flat range");var n=this.slice.insertAt(this.insert,e.content);return n?St.fromReplace(t,this.from,this.to,n):St.fail("Content does not fit in gap")},e.prototype.getMap=function(){return new gt([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])},e.prototype.invert=function(t){var n=this.gapTo-this.gapFrom;return new e(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)},e.prototype.map=function(t){var n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),o=t.map(this.gapFrom,-1),i=t.map(this.gapTo,1);return n.deleted&&r.deleted||o<n.pos||i>r.pos?null:new e(n.pos,r.pos,o,i,this.slice,this.insert,this.structure)},e.prototype.toJSON=function(){var t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t},e.fromJSON=function(t,n){if("number"!=typeof n.from||"number"!=typeof n.to||"number"!=typeof n.gapFrom||"number"!=typeof n.gapTo||"number"!=typeof n.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new e(n.from,n.to,n.gapFrom,n.gapTo,p.fromJSON(t,n.slice),n.insert,!!n.structure)},e}(Ct);function Mt(t,e,n){for(var r=t.resolve(e),o=n-e,i=r.depth;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0)for(var s=r.node(i).maybeChild(r.indexAfter(i));o>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,o--}return!1}function Ot(t,e,n){return(0==e||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function Dt(t){for(var e=t.parent.content.cutByIndex(t.startIndex,t.endIndex),n=t.depth;;--n){var r=t.$from.node(n),o=t.$from.index(n),i=t.$to.indexAfter(n);if(n<t.depth&&r.canReplace(o,i,e))return n;if(0==n||r.type.spec.isolating||!Ot(r,o,i))break}}function It(t,e,n,r){void 0===r&&(r=t);var o=function(t,e){var n=t.parent,r=t.startIndex,o=t.endIndex,i=n.contentMatchAt(r).findWrapping(e);if(!i)return null;var s=i.length?i[0]:e;return n.canReplaceWith(r,o,s)?i:null}(t,e),i=o&&function(t,e){var n=t.parent,r=t.startIndex,o=t.endIndex,i=n.child(r),s=e.contentMatch.findWrapping(i.type);if(!s)return null;for(var a=(s.length?s[s.length-1]:e).contentMatch,c=r;a&&c<o;c++)a=a.matchType(n.child(c).type);if(!a||!a.validEnd)return null;return s}(r,e);return i?o.map(At).concat({type:e,attrs:n}).concat(i.map(At)):null}function At(t){return{type:t,attrs:null}}function Nt(t,e,n,r){void 0===n&&(n=1);var o=t.resolve(e),i=o.depth-n,s=r&&r[r.length-1]||o.parent;if(i<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!s.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(var a=o.depth-1,c=n-2;a>i;a--,c--){var u=o.node(a),l=o.index(a);if(u.type.spec.isolating)return!1;var d=u.content.cutByIndex(l,u.childCount),p=r&&r[c]||u;if(p!=u&&(d=d.replaceChild(0,p.type.create(p.attrs))),!u.canReplace(l+1,u.childCount)||!p.type.validContent(d))return!1}var f=o.indexAfter(i),h=r&&r[0];return o.node(i).canReplaceWith(f,f,h?h.type:o.node(i+1).type)}function Bt(t,e){var n=t.resolve(e),r=n.index();return zt(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function zt(t,e){return t&&e&&!t.isLeaf&&t.canAppend(e)}function Pt(t,e,n){void 0===n&&(n=-1);for(var r=t.resolve(e),o=r.depth;;o--){var i=void 0,s=void 0,a=r.index(o);if(o==r.depth?(i=r.nodeBefore,s=r.nodeAfter):n>0?(i=r.node(o+1),a++,s=r.node(o).maybeChild(a)):(i=r.node(o).maybeChild(a-1),s=r.node(o+1)),i&&!i.isTextblock&&zt(i,s)&&r.node(o).canReplace(a,a+1))return e;if(0==o)break;e=n<0?r.before(o):r.after(o)}}function Rt(t,e,n){var r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(0==r.parentOffset)for(var o=r.depth-1;o>=0;o--){var i=r.index(o);if(r.node(o).canReplaceWith(i,i,n))return r.before(o+1);if(i>0)return null}if(r.parentOffset==r.parent.content.size)for(var s=r.depth-1;s>=0;s--){var a=r.indexAfter(s);if(r.node(s).canReplaceWith(a,a,n))return r.after(s+1);if(a<r.node(s).childCount)return null}}function Ft(t,e,n){var r=t.resolve(e);if(!n.content.size)return e;for(var o=n.content,i=0;i<n.openStart;i++)o=o.firstChild.content;for(var s=1;s<=(0==n.openStart&&n.size?2:1);s++)for(var a=r.depth;a>=0;a--){var c=a==r.depth?0:r.pos<=(r.start(a+1)+r.end(a+1))/2?-1:1,u=r.index(a)+(c>0?1:0),l=r.node(a),d=!1;if(1==s)d=l.canReplace(u,u,o);else{var p=l.contentMatchAt(u).findWrapping(o.firstChild.type);d=p&&l.canReplaceWith(u,u,p[0])}if(d)return 0==c?r.pos:c<0?r.before(a+1):r.after(a+1)}return null}function Lt(t,e,n){for(var r=[],o=0;o<t.childCount;o++){var s=t.child(o);s.content.size&&(s=s.copy(Lt(s.content,e,s))),s.isInline&&(s=e(s,n,o)),r.push(s)}return i.fromArray(r)}Ct.jsonID("replaceAround",Et),wt.prototype.lift=function(t,e){for(var n=t.$from,r=t.$to,o=t.depth,s=n.before(o+1),a=r.after(o+1),c=s,u=a,l=i.empty,d=0,f=o,h=!1;f>e;f--)h||n.index(f)>0?(h=!0,l=i.from(n.node(f).copy(l)),d++):c--;for(var m=i.empty,v=0,g=o,y=!1;g>e;g--)y||r.after(g+1)<r.end(g)?(y=!0,m=i.from(r.node(g).copy(m)),v++):u++;return this.step(new Et(c,u,s,a,new p(l.append(m),d,v),l.size-d,!0))},wt.prototype.wrap=function(t,e){for(var n=i.empty,r=e.length-1;r>=0;r--){if(n.size){var o=e[r].type.contentMatch.matchFragment(n);if(!o||!o.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}n=i.from(e[r].type.create(e[r].attrs,n))}var s=t.start,a=t.end;return this.step(new Et(s,a,s,a,new p(n,0,0),e.length,!0))},wt.prototype.setBlockType=function(t,e,n,r){var o=this;if(void 0===e&&(e=t),!n.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");var s=this.steps.length;return this.doc.nodesBetween(t,e,(function(t,e){if(t.isTextblock&&!t.hasMarkup(n,r)&&function(t,e,n){var r=t.resolve(e),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}(o.doc,o.mapping.slice(s).map(e),n)){o.clearIncompatible(o.mapping.slice(s).map(e,1),n);var a=o.mapping.slice(s),c=a.map(e,1),u=a.map(e+t.nodeSize,1);return o.step(new Et(c,u,c+1,u-1,new p(i.from(n.create(r,null,t.marks)),0,0),1,!0)),!1}})),this},wt.prototype.setNodeMarkup=function(t,e,n,r){var o=this.doc.nodeAt(t);if(!o)throw new RangeError("No node at given position");e||(e=o.type);var s=e.create(n,null,r||o.marks);if(o.isLeaf)return this.replaceWith(t,t+o.nodeSize,s);if(!e.validContent(o.content))throw new RangeError("Invalid content for node type "+e.name);return this.step(new Et(t,t+o.nodeSize,t+1,t+o.nodeSize-1,new p(i.from(s),0,0),1,!0))},wt.prototype.split=function(t,e,n){void 0===e&&(e=1);for(var r=this.doc.resolve(t),o=i.empty,s=i.empty,a=r.depth,c=r.depth-e,u=e-1;a>c;a--,u--){o=i.from(r.node(a).copy(o));var l=n&&n[u];s=i.from(l?l.type.create(l.attrs,s):r.node(a).copy(s))}return this.step(new Tt(t,t,new p(o.append(s),e,e),!0))},wt.prototype.join=function(t,e){void 0===e&&(e=1);var n=new Tt(t-e,t+e,p.empty,!0);return this.step(n)};var Vt=function(t){function e(e,n,r){t.call(this),this.from=e,this.to=n,this.mark=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.apply=function(t){var e=this,n=t.slice(this.from,this.to),r=t.resolve(this.from),o=r.node(r.sharedDepth(this.to)),i=new p(Lt(n.content,(function(t,n){return t.isAtom&&n.type.allowsMarkType(e.mark.type)?t.mark(e.mark.addToSet(t.marks)):t}),o),n.openStart,n.openEnd);return St.fromReplace(t,this.from,this.to,i)},e.prototype.invert=function(){return new jt(this.from,this.to,this.mark)},e.prototype.map=function(t){var n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)},e.prototype.merge=function(t){if(t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from)return new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark)},e.prototype.toJSON=function(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}},e.fromJSON=function(t,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new e(n.from,n.to,t.markFromJSON(n.mark))},e}(Ct);Ct.jsonID("addMark",Vt);var jt=function(t){function e(e,n,r){t.call(this),this.from=e,this.to=n,this.mark=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.apply=function(t){var e=this,n=t.slice(this.from,this.to),r=new p(Lt(n.content,(function(t){return t.mark(e.mark.removeFromSet(t.marks))})),n.openStart,n.openEnd);return St.fromReplace(t,this.from,this.to,r)},e.prototype.invert=function(){return new Vt(this.from,this.to,this.mark)},e.prototype.map=function(t){var n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)},e.prototype.merge=function(t){if(t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from)return new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark)},e.prototype.toJSON=function(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}},e.fromJSON=function(t,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new e(n.from,n.to,t.markFromJSON(n.mark))},e}(Ct);function $t(t,e,n,r){if(void 0===n&&(n=e),void 0===r&&(r=p.empty),e==n&&!r.size)return null;var o=t.resolve(e),i=t.resolve(n);return Wt(o,i,r)?new Tt(e,n,r):new Ht(o,i,r).fit()}function Wt(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}Ct.jsonID("removeMark",jt),wt.prototype.addMark=function(t,e,n){var r=this,o=[],i=[],s=null,a=null;return this.doc.nodesBetween(t,e,(function(r,c,u){if(r.isInline){var l=r.marks;if(!n.isInSet(l)&&u.type.allowsMarkType(n.type)){for(var d=Math.max(c,t),p=Math.min(c+r.nodeSize,e),f=n.addToSet(l),h=0;h<l.length;h++)l[h].isInSet(f)||(s&&s.to==d&&s.mark.eq(l[h])?s.to=p:o.push(s=new jt(d,p,l[h])));a&&a.to==d?a.to=p:i.push(a=new Vt(d,p,n))}}})),o.forEach((function(t){return r.step(t)})),i.forEach((function(t){return r.step(t)})),this},wt.prototype.removeMark=function(t,e,n){var r=this;void 0===n&&(n=null);var o=[],i=0;return this.doc.nodesBetween(t,e,(function(r,s){if(r.isInline){i++;var a=null;if(n instanceof X)for(var c,u=r.marks;c=n.isInSet(u);)(a||(a=[])).push(c),u=c.removeFromSet(u);else n?n.isInSet(r.marks)&&(a=[n]):a=r.marks;if(a&&a.length)for(var l=Math.min(s+r.nodeSize,e),d=0;d<a.length;d++){for(var p=a[d],f=void 0,h=0;h<o.length;h++){var m=o[h];m.step==i-1&&p.eq(o[h].style)&&(f=m)}f?(f.to=l,f.step=i):o.push({style:p,from:Math.max(s,t),to:l,step:i})}}})),o.forEach((function(t){return r.step(new jt(t.from,t.to,t.style))})),this},wt.prototype.clearIncompatible=function(t,e,n){void 0===n&&(n=e.contentMatch);for(var r=this.doc.nodeAt(t),o=[],s=t+1,a=0;a<r.childCount;a++){var c=r.child(a),u=s+c.nodeSize,l=n.matchType(c.type,c.attrs);if(l){n=l;for(var d=0;d<c.marks.length;d++)e.allowsMarkType(c.marks[d].type)||this.step(new jt(s,u,c.marks[d]))}else o.push(new Tt(s,u,p.empty));s=u}if(!n.validEnd){var f=n.fillBefore(i.empty,!0);this.replace(s,s,new p(f,0,0))}for(var h=o.length-1;h>=0;h--)this.step(o[h]);return this},wt.prototype.replace=function(t,e,n){void 0===e&&(e=t),void 0===n&&(n=p.empty);var r=$t(this.doc,t,e,n);return r&&this.step(r),this},wt.prototype.replaceWith=function(t,e,n){return this.replace(t,e,new p(i.from(n),0,0))},wt.prototype.delete=function(t,e){return this.replace(t,e,p.empty)},wt.prototype.insert=function(t,e){return this.replaceWith(t,t,e)};var Ht=function(t,e,n){this.$to=e,this.$from=t,this.unplaced=n,this.frontier=[];for(var r=0;r<=t.depth;r++){var o=t.node(r);this.frontier.push({type:o.type,match:o.contentMatchAt(t.indexAfter(r))})}this.placed=i.empty;for(var s=t.depth;s>0;s--)this.placed=i.from(t.node(s).copy(this.placed))},qt={depth:{configurable:!0}};function Jt(t,e,n){return 0==e?t.cutByIndex(n):t.replaceChild(0,t.firstChild.copy(Jt(t.firstChild.content,e-1,n)))}function Kt(t,e,n){return 0==e?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(Kt(t.lastChild.content,e-1,n)))}function Ut(t,e){for(var n=0;n<e;n++)t=t.firstChild.content;return t}function Gt(t,e,n){if(e<=0)return t;var r=t.content;return e>1&&(r=r.replaceChild(0,Gt(r.firstChild,e-1,1==r.childCount?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(i.empty,!0)))),t.copy(r)}function Yt(t,e,n,r,o){var i=t.node(e),s=o?t.indexAfter(e):t.index(e);if(s==i.childCount&&!n.compatibleContent(i.type))return null;var a=r.fillBefore(i.content,!0,s);return a&&!function(t,e,n){for(var r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}(n,i.content,s)?a:null}function Xt(t,e,n,r,o){if(e<n){var s=t.firstChild;t=t.replaceChild(0,s.copy(Xt(s.content,e+1,n,r,s)))}if(e>r){var a=o.contentMatchAt(0),c=a.fillBefore(t).append(t);t=c.append(a.matchFragment(c).fillBefore(i.empty,!0))}return t}function Zt(t,e){for(var n=[],r=Math.min(t.depth,e.depth);r>=0;r--){var o=t.start(r);if(o<t.pos-(t.depth-r)||e.end(r)>e.pos+(e.depth-r)||t.node(r).type.spec.isolating||e.node(r).type.spec.isolating)break;(o==e.start(r)||r==t.depth&&r==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&r&&e.start(r-1)==o-1)&&n.push(r)}return n}qt.depth.get=function(){return this.frontier.length-1},Ht.prototype.fit=function(){for(;this.unplaced.size;){var t=this.findFittable();t?this.placeNodes(t):this.openMore()||this.dropNode()}var e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,o=this.close(e<0?this.$to:r.doc.resolve(e));if(!o)return null;for(var i=this.placed,s=r.depth,a=o.depth;s&&a&&1==i.childCount;)i=i.firstChild.content,s--,a--;var c=new p(i,s,a);return e>-1?new Et(r.pos,e,this.$to.pos,this.$to.end(),c,n):c.size||r.pos!=this.$to.pos?new Tt(r.pos,o.pos,c):void 0},Ht.prototype.findFittable=function(){for(var t=1;t<=2;t++)for(var e=this.unplaced.openStart;e>=0;e--)for(var n=void 0,r=(e?(n=Ut(this.unplaced.content,e-1).firstChild).content:this.unplaced.content).firstChild,o=this.depth;o>=0;o--){var s=this.frontier[o],a=s.type,c=s.match,u=void 0,l=void 0;if(1==t&&(r?c.matchType(r.type)||(l=c.fillBefore(i.from(r),!1)):a.compatibleContent(n.type)))return{sliceDepth:e,frontierDepth:o,parent:n,inject:l};if(2==t&&r&&(u=c.findWrapping(r.type)))return{sliceDepth:e,frontierDepth:o,parent:n,wrap:u};if(n&&c.matchType(n.type))break}},Ht.prototype.openMore=function(){var t=this.unplaced,e=t.content,n=t.openStart,r=t.openEnd,o=Ut(e,n);return!(!o.childCount||o.firstChild.isLeaf)&&(this.unplaced=new p(e,n+1,Math.max(r,o.size+n>=e.size-r?n+1:0)),!0)},Ht.prototype.dropNode=function(){var t=this.unplaced,e=t.content,n=t.openStart,r=t.openEnd,o=Ut(e,n);if(o.childCount<=1&&n>0){var i=e.size-n<=n+o.size;this.unplaced=new p(Jt(e,n-1,1),n-1,i?n-1:r)}else this.unplaced=new p(Jt(e,n,1),n,r)},Ht.prototype.placeNodes=function(t){for(var e=t.sliceDepth,n=t.frontierDepth,r=t.parent,o=t.inject,s=t.wrap;this.depth>n;)this.closeFrontierNode();if(s)for(var a=0;a<s.length;a++)this.openFrontierNode(s[a]);var c=this.unplaced,u=r?r.content:c.content,l=c.openStart-e,d=0,f=[],h=this.frontier[n],m=h.match,v=h.type;if(o){for(var g=0;g<o.childCount;g++)f.push(o.child(g));m=m.matchFragment(o)}for(var y=u.size+e-(c.content.size-c.openEnd);d<u.childCount;){var b=u.child(d),w=m.matchType(b.type);if(!w)break;(++d>1||0==l||b.content.size)&&(m=w,f.push(Gt(b.mark(v.allowedMarks(b.marks)),1==d?l:0,d==u.childCount?y:-1)))}var _=d==u.childCount;_||(y=-1),this.placed=Kt(this.placed,n,i.from(f)),this.frontier[n].match=m,_&&y<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(var x=0,k=u;x<y;x++){var C=k.lastChild;this.frontier.push({type:C.type,match:C.contentMatchAt(C.childCount)}),k=C.content}this.unplaced=_?0==e?p.empty:new p(Jt(c.content,e-1,1),e-1,y<0?c.openEnd:e-1):new p(Jt(c.content,e,d),c.openStart,c.openEnd)},Ht.prototype.mustMoveInline=function(){if(!this.$to.parent.isTextblock||this.$to.end()==this.$to.pos)return-1;var t,e=this.frontier[this.depth];if(!e.type.isTextblock||!Yt(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return-1;for(var n=this.$to.depth,r=this.$to.after(n);n>1&&r==this.$to.end(--n);)++r;return r},Ht.prototype.findCloseLevel=function(t){t:for(var e=Math.min(this.depth,t.depth);e>=0;e--){var n=this.frontier[e],r=n.match,o=n.type,i=e<t.depth&&t.end(e+1)==t.pos+(t.depth-(e+1)),s=Yt(t,e,o,r,i);if(s){for(var a=e-1;a>=0;a--){var c=this.frontier[a],u=c.match,l=Yt(t,a,c.type,u,!0);if(!l||l.childCount)continue t}return{depth:e,fit:s,move:i?t.doc.resolve(t.after(e+1)):t}}}},Ht.prototype.close=function(t){var e=this.findCloseLevel(t);if(!e)return null;for(;this.depth>e.depth;)this.closeFrontierNode();e.fit.childCount&&(this.placed=Kt(this.placed,e.depth,e.fit)),t=e.move;for(var n=e.depth+1;n<=t.depth;n++){var r=t.node(n),o=r.type.contentMatch.fillBefore(r.content,!0,t.index(n));this.openFrontierNode(r.type,r.attrs,o)}return t},Ht.prototype.openFrontierNode=function(t,e,n){var r=this.frontier[this.depth];r.match=r.match.matchType(t),this.placed=Kt(this.placed,this.depth,i.from(t.create(e,n))),this.frontier.push({type:t,match:t.contentMatch})},Ht.prototype.closeFrontierNode=function(){var t=this.frontier.pop().match.fillBefore(i.empty,!0);t.childCount&&(this.placed=Kt(this.placed,this.frontier.length,t))},Object.defineProperties(Ht.prototype,qt),wt.prototype.replaceRange=function(t,e,n){if(!n.size)return this.deleteRange(t,e);var r=this.doc.resolve(t),o=this.doc.resolve(e);if(Wt(r,o,n))return this.step(new Tt(t,e,n));var i=Zt(r,this.doc.resolve(e));0==i[i.length-1]&&i.pop();var s=-(r.depth+1);i.unshift(s);for(var a=r.depth,c=r.pos-1;a>0;a--,c--){var u=r.node(a).type.spec;if(u.defining||u.isolating)break;i.indexOf(a)>-1?s=a:r.before(a)==c&&i.splice(1,0,-a)}for(var l=i.indexOf(s),d=[],f=n.openStart,h=n.content,m=0;;m++){var v=h.firstChild;if(d.push(v),m==n.openStart)break;h=v.content}f>0&&d[f-1].type.spec.defining&&r.node(l).type!=d[f-1].type?f-=1:f>=2&&d[f-1].isTextblock&&d[f-2].type.spec.defining&&r.node(l).type!=d[f-2].type&&(f-=2);for(var g=n.openStart;g>=0;g--){var y=(g+f+1)%(n.openStart+1),b=d[y];if(b)for(var w=0;w<i.length;w++){var _=i[(w+l)%i.length],x=!0;_<0&&(x=!1,_=-_);var k=r.node(_-1),C=r.index(_-1);if(k.canReplaceWith(C,C,b.type,b.marks))return this.replace(r.before(_),x?o.after(_):e,new p(Xt(n.content,0,n.openStart,y),y,n.openEnd))}}for(var S=this.steps.length,T=i.length-1;T>=0&&(this.replace(t,e,n),!(this.steps.length>S));T--){var E=i[T];E<0||(t=r.before(E),e=o.after(E))}return this},wt.prototype.replaceRangeWith=function(t,e,n){if(!n.isInline&&t==e&&this.doc.resolve(t).parent.content.size){var r=Rt(this.doc,t,n.type);null!=r&&(t=e=r)}return this.replaceRange(t,e,new p(i.from(n),0,0))},wt.prototype.deleteRange=function(t,e){for(var n=this.doc.resolve(t),r=this.doc.resolve(e),o=Zt(n,r),i=0;i<o.length;i++){var s=o[i],a=i==o.length-1;if(a&&0==s||n.node(s).type.contentMatch.validEnd)return this.delete(n.start(s),r.end(s));if(s>0&&(a||n.node(s-1).canReplace(n.index(s-1),r.indexAfter(s-1))))return this.delete(n.before(s),r.after(s))}for(var c=1;c<=n.depth&&c<=r.depth;c++)if(t-n.start(c)==n.depth-c&&e>n.end(c)&&r.end(c)-e!=r.depth-c)return this.delete(n.before(c),e);return this.delete(t,e)};var Qt=Object.create(null),te=function(t,e,n){this.ranges=n||[new ne(t.min(e),t.max(e))],this.$anchor=t,this.$head=e},ee={anchor:{configurable:!0},head:{configurable:!0},from:{configurable:!0},to:{configurable:!0},$from:{configurable:!0},$to:{configurable:!0},empty:{configurable:!0}};ee.anchor.get=function(){return this.$anchor.pos},ee.head.get=function(){return this.$head.pos},ee.from.get=function(){return this.$from.pos},ee.to.get=function(){return this.$to.pos},ee.$from.get=function(){return this.ranges[0].$from},ee.$to.get=function(){return this.ranges[0].$to},ee.empty.get=function(){for(var t=this.ranges,e=0;e<t.length;e++)if(t[e].$from.pos!=t[e].$to.pos)return!1;return!0},te.prototype.content=function(){return this.$from.node(0).slice(this.from,this.to,!0)},te.prototype.replace=function(t,e){void 0===e&&(e=p.empty);for(var n=e.content.lastChild,r=null,o=0;o<e.openEnd;o++)r=n,n=n.lastChild;for(var i=t.steps.length,s=this.ranges,a=0;a<s.length;a++){var c=s[a],u=c.$from,l=c.$to,d=t.mapping.slice(i);t.replaceRange(d.map(u.pos),d.map(l.pos),a?p.empty:e),0==a&&le(t,i,(n?n.isInline:r&&r.isTextblock)?-1:1)}},te.prototype.replaceWith=function(t,e){for(var n=t.steps.length,r=this.ranges,o=0;o<r.length;o++){var i=r[o],s=i.$from,a=i.$to,c=t.mapping.slice(n),u=c.map(s.pos),l=c.map(a.pos);o?t.deleteRange(u,l):(t.replaceRangeWith(u,l,e),le(t,n,e.isInline?-1:1))}},te.findFrom=function(t,e,n){var r=t.parent.inlineContent?new re(t):ue(t.node(0),t.parent,t.pos,t.index(),e,n);if(r)return r;for(var o=t.depth-1;o>=0;o--){var i=e<0?ue(t.node(0),t.node(o),t.before(o+1),t.index(o),e,n):ue(t.node(0),t.node(o),t.after(o+1),t.index(o)+1,e,n);if(i)return i}},te.near=function(t,e){return void 0===e&&(e=1),this.findFrom(t,e)||this.findFrom(t,-e)||new ae(t.node(0))},te.atStart=function(t){return ue(t,t,0,0,1)||new ae(t)},te.atEnd=function(t){return ue(t,t,t.content.size,t.childCount,-1)||new ae(t)},te.fromJSON=function(t,e){if(!e||!e.type)throw new RangeError("Invalid input for Selection.fromJSON");var n=Qt[e.type];if(!n)throw new RangeError("No selection type "+e.type+" defined");return n.fromJSON(t,e)},te.jsonID=function(t,e){if(t in Qt)throw new RangeError("Duplicate use of selection JSON ID "+t);return Qt[t]=e,e.prototype.jsonID=t,e},te.prototype.getBookmark=function(){return re.between(this.$anchor,this.$head).getBookmark()},Object.defineProperties(te.prototype,ee),te.prototype.visible=!0;var ne=function(t,e){this.$from=t,this.$to=e},re=function(t){function e(e,n){void 0===n&&(n=e),t.call(this,e,n)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={$cursor:{configurable:!0}};return n.$cursor.get=function(){return this.$anchor.pos==this.$head.pos?this.$head:null},e.prototype.map=function(n,r){var o=n.resolve(r.map(this.head));if(!o.parent.inlineContent)return t.near(o);var i=n.resolve(r.map(this.anchor));return new e(i.parent.inlineContent?i:o,o)},e.prototype.replace=function(e,n){if(void 0===n&&(n=p.empty),t.prototype.replace.call(this,e,n),n==p.empty){var r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}},e.prototype.eq=function(t){return t instanceof e&&t.anchor==this.anchor&&t.head==this.head},e.prototype.getBookmark=function(){return new oe(this.anchor,this.head)},e.prototype.toJSON=function(){return{type:"text",anchor:this.anchor,head:this.head}},e.fromJSON=function(t,n){if("number"!=typeof n.anchor||"number"!=typeof n.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new e(t.resolve(n.anchor),t.resolve(n.head))},e.create=function(t,e,n){void 0===n&&(n=e);var r=t.resolve(e);return new this(r,n==e?r:t.resolve(n))},e.between=function(n,r,o){var i=n.pos-r.pos;if(o&&!i||(o=i>=0?1:-1),!r.parent.inlineContent){var s=t.findFrom(r,o,!0)||t.findFrom(r,-o,!0);if(!s)return t.near(r,o);r=s.$head}return n.parent.inlineContent||(0==i||(n=(t.findFrom(n,-o,!0)||t.findFrom(n,o,!0)).$anchor).pos<r.pos!=i<0)&&(n=r),new e(n,r)},Object.defineProperties(e.prototype,n),e}(te);te.jsonID("text",re);var oe=function(t,e){this.anchor=t,this.head=e};oe.prototype.map=function(t){return new oe(t.map(this.anchor),t.map(this.head))},oe.prototype.resolve=function(t){return re.between(t.resolve(this.anchor),t.resolve(this.head))};var ie=function(t){function e(e){var n=e.nodeAfter,r=e.node(0).resolve(e.pos+n.nodeSize);t.call(this,e,r),this.node=n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.map=function(n,r){var o=r.mapResult(this.anchor),i=o.deleted,s=o.pos,a=n.resolve(s);return i?t.near(a):new e(a)},e.prototype.content=function(){return new p(i.from(this.node),0,0)},e.prototype.eq=function(t){return t instanceof e&&t.anchor==this.anchor},e.prototype.toJSON=function(){return{type:"node",anchor:this.anchor}},e.prototype.getBookmark=function(){return new se(this.anchor)},e.fromJSON=function(t,n){if("number"!=typeof n.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new e(t.resolve(n.anchor))},e.create=function(t,e){return new this(t.resolve(e))},e.isSelectable=function(t){return!t.isText&&!1!==t.type.spec.selectable},e}(te);ie.prototype.visible=!1,te.jsonID("node",ie);var se=function(t){this.anchor=t};se.prototype.map=function(t){var e=t.mapResult(this.anchor),n=e.deleted,r=e.pos;return n?new oe(r,r):new se(r)},se.prototype.resolve=function(t){var e=t.resolve(this.anchor),n=e.nodeAfter;return n&&ie.isSelectable(n)?new ie(e):te.near(e)};var ae=function(t){function e(e){t.call(this,e.resolve(0),e.resolve(e.content.size))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.replace=function(e,n){if(void 0===n&&(n=p.empty),n==p.empty){e.delete(0,e.doc.content.size);var r=t.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else t.prototype.replace.call(this,e,n)},e.prototype.toJSON=function(){return{type:"all"}},e.fromJSON=function(t){return new e(t)},e.prototype.map=function(t){return new e(t)},e.prototype.eq=function(t){return t instanceof e},e.prototype.getBookmark=function(){return ce},e}(te);te.jsonID("all",ae);var ce={map:function(){return this},resolve:function(t){return new ae(t)}};function ue(t,e,n,r,o,i){if(e.inlineContent)return re.create(t,n);for(var s=r-(o>0?0:1);o>0?s<e.childCount:s>=0;s+=o){var a=e.child(s);if(a.isAtom){if(!i&&ie.isSelectable(a))return ie.create(t,n-(o<0?a.nodeSize:0))}else{var c=ue(t,a,n+o,o<0?a.childCount:0,o,i);if(c)return c}n+=a.nodeSize*o}}function le(t,e,n){var r=t.steps.length-1;if(!(r<e)){var o,i=t.steps[r];if(i instanceof Tt||i instanceof Et)t.mapping.maps[r].forEach((function(t,e,n,r){null==o&&(o=r)})),t.setSelection(te.near(t.doc.resolve(o),n))}}var de=function(t){function e(e){t.call(this,e.doc),this.time=Date.now(),this.curSelection=e.selection,this.curSelectionFor=0,this.storedMarks=e.storedMarks,this.updated=0,this.meta=Object.create(null)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={selection:{configurable:!0},selectionSet:{configurable:!0},storedMarksSet:{configurable:!0},isGeneric:{configurable:!0},scrolledIntoView:{configurable:!0}};return n.selection.get=function(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection},e.prototype.setSelection=function(t){if(t.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=t,this.curSelectionFor=this.steps.length,this.updated=-3&(1|this.updated),this.storedMarks=null,this},n.selectionSet.get=function(){return(1&this.updated)>0},e.prototype.setStoredMarks=function(t){return this.storedMarks=t,this.updated|=2,this},e.prototype.ensureMarks=function(t){return l.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this},e.prototype.addStoredMark=function(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))},e.prototype.removeStoredMark=function(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))},n.storedMarksSet.get=function(){return(2&this.updated)>0},e.prototype.addStep=function(e,n){t.prototype.addStep.call(this,e,n),this.updated=-3&this.updated,this.storedMarks=null},e.prototype.setTime=function(t){return this.time=t,this},e.prototype.replaceSelection=function(t){return this.selection.replace(this,t),this},e.prototype.replaceSelectionWith=function(t,e){var n=this.selection;return!1!==e&&(t=t.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||l.none))),n.replaceWith(this,t),this},e.prototype.deleteSelection=function(){return this.selection.replace(this),this},e.prototype.insertText=function(t,e,n){void 0===n&&(n=e);var r=this.doc.type.schema;if(null==e)return t?this.replaceSelectionWith(r.text(t),!0):this.deleteSelection();if(!t)return this.deleteRange(e,n);var o=this.storedMarks;if(!o){var i=this.doc.resolve(e);o=n==e?i.marks():i.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(e,n,r.text(t,o)),this.selection.empty||this.setSelection(te.near(this.selection.$to)),this},e.prototype.setMeta=function(t,e){return this.meta["string"==typeof t?t:t.key]=e,this},e.prototype.getMeta=function(t){return this.meta["string"==typeof t?t:t.key]},n.isGeneric.get=function(){for(var t in this.meta)return!1;return!0},e.prototype.scrollIntoView=function(){return this.updated|=4,this},n.scrolledIntoView.get=function(){return(4&this.updated)>0},Object.defineProperties(e.prototype,n),e}(wt);function pe(t,e){return e&&t?t.bind(e):t}var fe=function(t,e,n){this.name=t,this.init=pe(e.init,n),this.apply=pe(e.apply,n)},he=[new fe("doc",{init:function(t){return t.doc||t.schema.topNodeType.createAndFill()},apply:function(t){return t.doc}}),new fe("selection",{init:function(t,e){return t.selection||te.atStart(e.doc)},apply:function(t){return t.selection}}),new fe("storedMarks",{init:function(t){return t.storedMarks||null},apply:function(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new fe("scrollToSelection",{init:function(){return 0},apply:function(t,e){return t.scrolledIntoView?e+1:e}})],me=function(t,e){var n=this;this.schema=t,this.fields=he.concat(),this.plugins=[],this.pluginsByKey=Object.create(null),e&&e.forEach((function(t){if(n.pluginsByKey[t.key])throw new RangeError("Adding different instances of a keyed plugin ("+t.key+")");n.plugins.push(t),n.pluginsByKey[t.key]=t,t.spec.state&&n.fields.push(new fe(t.key,t.spec.state,t))}))},ve=function(t){this.config=t},ge={schema:{configurable:!0},plugins:{configurable:!0},tr:{configurable:!0}};ge.schema.get=function(){return this.config.schema},ge.plugins.get=function(){return this.config.plugins},ve.prototype.apply=function(t){return this.applyTransaction(t).state},ve.prototype.filterTransaction=function(t,e){void 0===e&&(e=-1);for(var n=0;n<this.config.plugins.length;n++)if(n!=e){var r=this.config.plugins[n];if(r.spec.filterTransaction&&!r.spec.filterTransaction.call(r,t,this))return!1}return!0},ve.prototype.applyTransaction=function(t){if(!this.filterTransaction(t))return{state:this,transactions:[]};for(var e=[t],n=this.applyInner(t),r=null;;){for(var o=!1,i=0;i<this.config.plugins.length;i++){var s=this.config.plugins[i];if(s.spec.appendTransaction){var a=r?r[i].n:0,c=r?r[i].state:this,u=a<e.length&&s.spec.appendTransaction.call(s,a?e.slice(a):e,c,n);if(u&&n.filterTransaction(u,i)){if(u.setMeta("appendedTransaction",t),!r){r=[];for(var l=0;l<this.config.plugins.length;l++)r.push(l<i?{state:n,n:e.length}:{state:this,n:0})}e.push(u),n=n.applyInner(u),o=!0}r&&(r[i]={state:n,n:e.length})}}if(!o)return{state:n,transactions:e}}},ve.prototype.applyInner=function(t){if(!t.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");for(var e=new ve(this.config),n=this.config.fields,r=0;r<n.length;r++){var o=n[r];e[o.name]=o.apply(t,this[o.name],this,e)}for(var i=0;i<ye.length;i++)ye[i](this,t,e);return e},ge.tr.get=function(){return new de(this)},ve.create=function(t){for(var e=new me(t.doc?t.doc.type.schema:t.schema,t.plugins),n=new ve(e),r=0;r<e.fields.length;r++)n[e.fields[r].name]=e.fields[r].init(t,n);return n},ve.prototype.reconfigure=function(t){for(var e=new me(this.schema,t.plugins),n=e.fields,r=new ve(e),o=0;o<n.length;o++){var i=n[o].name;r[i]=this.hasOwnProperty(i)?this[i]:n[o].init(t,r)}return r},ve.prototype.toJSON=function(t){var e={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(e.storedMarks=this.storedMarks.map((function(t){return t.toJSON()}))),t&&"object"==typeof t)for(var n in t){if("doc"==n||"selection"==n)throw new RangeError("The JSON fields `doc` and `selection` are reserved");var r=t[n],o=r.spec.state;o&&o.toJSON&&(e[n]=o.toJSON.call(r,this[r.key]))}return e},ve.fromJSON=function(t,e,n){if(!e)throw new RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw new RangeError("Required config field 'schema' missing");var r=new me(t.schema,t.plugins),o=new ve(r);return r.fields.forEach((function(r){if("doc"==r.name)o.doc=O.fromJSON(t.schema,e.doc);else if("selection"==r.name)o.selection=te.fromJSON(o.doc,e.selection);else if("storedMarks"==r.name)e.storedMarks&&(o.storedMarks=e.storedMarks.map(t.schema.markFromJSON));else{if(n)for(var i in n){var s=n[i],a=s.spec.state;if(s.key==r.name&&a&&a.fromJSON&&Object.prototype.hasOwnProperty.call(e,i))return void(o[r.name]=a.fromJSON.call(s,t,e[i],o))}o[r.name]=r.init(t,o)}})),o},ve.addApplyListener=function(t){ye.push(t)},ve.removeApplyListener=function(t){var e=ye.indexOf(t);e>-1&&ye.splice(e,1)},Object.defineProperties(ve.prototype,ge);var ye=[];var be=function(t){this.props={},t.props&&function t(e,n,r){for(var o in e){var i=e[o];i instanceof Function?i=i.bind(n):"handleDOMEvents"==o&&(i=t(i,n,{})),r[o]=i}return r}(t.props,this,this.props),this.spec=t,this.key=t.key?t.key.key:_e("plugin")};be.prototype.getState=function(t){return t[this.key]};var we=Object.create(null);function _e(t){return t in we?t+"$"+ ++we[t]:(we[t]=0,t+"$")}var xe=function(t){void 0===t&&(t="key"),this.key=_e(t)};xe.prototype.get=function(t){return t.config.pluginsByKey[this.key]},xe.prototype.getState=function(t){return t[this.key]};var ke="k-parent-node",Ce=["div","ol","ul","li","table","tbody","thead","tfoot","td","th","p","tr","col","colgroup","article","main","nav","header","footer","aside","section"],Se=function(t,e){var n=(t.ownerDocument||document).createElement(e);Array.from(t.rows).filter((function(t){return t.getAttribute(ke)===e})).forEach((function(t){t.removeAttribute(ke),n.appendChild(t)})),n.children.length&&t.appendChild(n)},Te=function(t,e){var n=e.toUpperCase();t.filter((function(t){return t.nodeName===n})).forEach((function(t){Array.from(t.children).forEach((function(n){n.setAttribute(ke,e),t.parentNode&&t.parentNode.insertBefore(n,t)})),t.remove()}))},Ee=function(t,e){void 0===e&&(e=Ce);var n=e.join("|");return t.replace(new RegExp("\\s*(<(?:"+n+")(?:\\s[^>]*?)?>)","g"),"$1").replace(new RegExp("(<\\/(?:"+n+")(?:\\s[^>]*?)?>)\\s*","g"),"$1")},Me=function(t){var e,n=document.createElement("template");if("content"in n)n.innerHTML=t,e=n.content;else{var r=(new DOMParser).parseFromString(t,"text/html");e=document.createDocumentFragment();for(var o=r.body;o&&o.firstChild;)e.appendChild(o.firstChild)}return e},Oe=function(t){var e=dt.fromSchema(t.type.schema).serializeFragment(t.content);return function(t){Array.from(t.querySelectorAll("table")).forEach((function(t){Se(t,"thead"),Se(t,"tbody"),Se(t,"tfoot");var e=Array.from(t.children).find((function(t){return 0===t.children.length}));e&&e.remove()}))}(e),e},De=function(t,e,n){return tt.fromSchema(e).parse(t,n)},Ie=function(t,e,n){var r,o=Me(t);return r=o,Array.from(r.querySelectorAll("table")).forEach((function(t){var e=Array.from(t.children);e.some((function(t){return"THEAD"===t.nodeName||"TFOOT"===t.nodeName}))&&(Te(e,"thead"),Te(e,"tbody"),Te(e,"tfoot"));var n=e.find((function(t){return"COLGROUP"===t.nodeName}));n&&(t.setAttribute("k-colgroup-data",n.outerHTML),n.remove())})),De(o,e,n)},Ae=function(t){var e=Oe(t.doc),n=document.createElement("div");return n.appendChild(e),n.innerHTML},Ne=function(t,e,n){return void 0===e&&(e="setHTML"),void 0===n&&(n={preserveWhitespace:"full"}),function(r,o){return o(r.tr.setSelection(new ae(r.doc)).replaceSelectionWith(Ie(t,r.schema,n)).setMeta("commandName",e))}},Be=n(0),ze=function(t,e){var n=e.style,r=e.value,o=e.newValue;if(!t)return{changed:!1,style:null};var i=t.split(/\s*;\s*/).filter((function(t){return Boolean(t)})),s=i.filter((function(t){var e=t.split(/\s*:\s*/);return!(e[0].toLowerCase()===n&&r.test(e[1]))}));return o&&s.push(n+": "+o),{style:s.join("; ")+(s.length?";":""),changed:Boolean(o)||s.length!==i.length}},Pe=function(t,e){for(var n=t.selection.$from,r=n.depth;r>=0;r--){var o=n.index(r);if(n.node(r).canReplaceWith(o,o,e))return!0}return!1},Re=function(t){return t instanceof O?t.type.name:t.name},Fe=function(t,e){return void 0===e&&(e=1),function(n){return function(t,e){return void 0===e&&(e=1),function(n){for(var r=n.$from,o=r.depth;o>0;o--){var i=r.node(o);if(t(i)&&0===(e-=1))return{depth:o,node:i}}}}((function(e){return Re(e)===Re(t)}),e)(n)}},Le=function(t,e){return function(n,r){var o=n.tr.replaceSelectionWith(t);e&&o.scrollIntoView(),r(o)}},Ve=function(t,e,n,r){var o=i.from(Ie(t,n,r)),s=i.from(Ie(e,n,r));return o.eq(s)},je=function(t){var e=t.selection;if(e instanceof re||e instanceof ae){var n=e.content().content;return n.textBetween(0,n.size)}return""},$e=function(t){if(t.selection instanceof ie)return t.selection.node},We=function(t){var e="",n=!1,r=t.selection,o=t.doc,i=r.$from,s=r.$to,a=r.from,c=r.to;return i.sameParent(s)&&(o.nodesBetween(a,c,(function(t){n=n||t.isLeaf&&!t.isText})),n||(e=je(t))),e},He=function(t){return t.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$/,"")},qe={before:/[^ !,?.\[\]{}()]+$/i,after:/^[^ !,?.\[\]{}()]+/i},Je=function(t,e,n){if(!n.applyToWord||!t.selection.empty)return{state:t,dispatch:e};var r=!0===n.applyToWord?qe:n.applyToWord,o=null,i=t.tr,s=t.selection,a=s.$head.nodeBefore,c=s.$head.nodeAfter;if(a&&"text"===a.type.name&&a.text&&c&&"text"===c.type.name&&c.text){var u=[];s.$head.parent.descendants((function(t,e){return u.push({node:t,pos:e}),!1}));for(var l=s.$head.parentOffset,d=u.findIndex((function(t){var e=t.node,n=t.pos;return n<=l&&n+e.nodeSize>=l})),p=u[d].node.text,f=!1,h=d-1;h>=0;h--){var m=u[h];!f&&m&&"text"===m.node.type.name?p=m.node.text+p:(f=!0,l-=m.node.nodeSize)}for(h=d+1;h<u.length;h++){if(!(m=u[h])||"text"!==m.node.type.name)break;p+=m.node.text}var v=p.substring(0,l),g=p.substring(l),y=r.before.exec(v),b=r.after.exec(g);if(y&&b){var w=y[0].length,_=b[0].length,x=o=s.from;i.setSelection(re.create(t.doc,x-w,x+_));return{state:{tr:i,selection:i.selection,doc:i.doc,storedMarks:null,schema:i.doc.type.schema},dispatch:function(t){t.setSelection(re.create(t.doc,o)),e(t)}}}}return{state:t,dispatch:e}},Ke=function(t,e){return function(n,r,o){var i=Je(n,r,e),s=i.state,a=i.dispatch;return t(e)(s,a)}},Ue=function(t,e,n){for(var r=function(r){var o=e[r],i=o.$from,s=o.$to,a=0===i.depth&&t.type.allowsMarkType(n);if(t.nodesBetween(i.pos,s.pos,(function(t){if(a)return!1;a=t.inlineContent&&t.type.allowsMarkType(n)})),a)return{v:!0}},o=0;o<e.length;o++){var i=r(o);if(i)return i.v}return!1},Ge=function(t,e,n){return function(r,o){var i=r.selection,s=i.empty,a=i.$cursor,c=i.ranges;if(s&&!a||!Ue(r.doc,c,t))return!1;if(o)if(a)t.isInSet(r.storedMarks||a.marks())?o(n.removeStoredMark(t)):o(n.addStoredMark(t.create(e)));else{for(var u=!1,l=0;!u&&l<c.length;l++){var d=c[l],p=d.$from,f=d.$to;u=r.doc.rangeHasMark(p.pos,f.pos,t)}for(l=0;l<c.length;l++){var h=c[l];p=h.$from,f=h.$to;u?n.removeMark(p.pos,f.pos,t):n.addMark(p.pos,f.pos,t.create(e))}o(n.scrollIntoView())}return!0}},Ye=function(t,e,n,r){void 0===r&&(r=null);var o=[],i=0;return t.doc.nodesBetween(e,n,(function(t,s){if(t.isInline){i++;var a=null;if(r instanceof X){var c=r.isInSet(t.marks);c&&(a=[c])}else r?r.isInSet(t.marks)&&(a=[r]):a=t.marks;if(a&&a.length)for(var u=Math.min(s+t.nodeSize,n),l=0;l<a.length;l++){for(var d=a[l],p=void 0,f=0;f<o.length;f++){var h=o[f];h.step===i-1&&d.eq(h.style)&&(p=h)}p?(p.to=u,p.step=i):o.push({style:d,from:Math.max(s,e),to:u,step:i})}}})),o.forEach((function(e){return t.step(new jt(e.from,e.to,e.style))})),t},Xe=function(t){var e=(void 0===t?{}:t).except,n=void 0===e?[]:e;return function(t,e){var r,o=t.tr;Ze(o,{except:(r=n,r instanceof Array?r:[r])}),o.docChanged&&e(o)}},Ze=function(t,e){var n=e.except,r=t.doc,o=t.selection,i=r.type.schema,s=o.empty,a=o.ranges,c=(n||[]).map((function(t){return t.name}));if(!s){var u=Object.keys(i.marks).map((function(t){return i.marks[t]})).filter((function(t){return-1===c.indexOf(t.name)}));a.forEach((function(e){var n=e.$from,r=e.$to;u.forEach((function(e){return t.removeMark(n.pos,r.pos,e)}))}))}},Qe=function(t,e){var n,r=t.schema.marks,o=(e.altMarks||[]).filter((function(t){return r[t]})),i=e.altStyle,s=t.selection,a=s.from,c=s.$from,u=s.to,l=s.empty,d=r[e.mark],p=t.doc,f=!1;return l?(n=t.storedMarks||c.marks(),f=d&&d.isInSet(n)||o.some((function(t){return r[t].isInSet(n)}))):f=d&&p.rangeHasMark(a,u,d)||o.some((function(t){return p.rangeHasMark(a,u,r[t])})),!f&&i&&r.style?en(t,r.style).some((function(t){return null!==tn(t,i)})):Boolean(f)},tn=function(t,e){for(var n=(t&&t.attrs.style||"").split(/\s*;\s*/).filter((function(t){return Boolean(t)})),r=0;r<n.length;r++){var o=n[r].split(/\s*:\s*/);if(o[0].toLowerCase()===e.name&&e.value.test(o[1]))return o[1]}return null},en=function(t,e){var n=t.selection,r=n.from,o=n.$from,i=n.to,s=n.empty,a=[];return s?a.push(e.isInSet(t.storedMarks||o.marks())):t.doc.nodesBetween(r,i,(function(t){t.isInline&&a.push(e.isInSet(t.marks))})),a},nn=function(t,e){var n=en(t,e),r=n.filter((function(t){return Boolean(t)}));return n.length===r.length?n[0]:void 0},rn=function(t,e){var n=en(t,e),r=n.filter((function(t){return Boolean(t)}));return{hasNodesWithoutMarks:n.length!==r.length,marks:r}},on=function(t,e){var n=t.find((function(t){return"style"===t.type.name})),r=n&&n.attrs.style;return ze(r,e)},sn=function(t,e,n,r,o){var i=o.create({style:r.style}),s=[],a=[],c=null,u=null;return t.doc.nodesBetween(e,n,(function(t,l,d){if(t.isInline){var p=t.marks;if(!i.isInSet(p)&&d.type.allowsMarkType(i.type)){var f=Math.max(l,e),h=Math.min(l+t.nodeSize,n),m=on(p,r);if(m.changed||r.newValue){for(var v=m.changed?{style:m.style||null}:{style:[r.style]+": "+r.newValue+";"},g=o.isInSet(p)?p.find((function(t){return"style"===t.type.name})):null,y=g?Be.__assign({},g.attrs,v):v,b=o.create(y),w=b.addToSet(p),_=0;_<p.length;_++)p[_].isInSet(w)||(c&&c.to===f&&c.mark.eq(p[_])?c.to=h:(c=new jt(f,h,p[_]),s.push(c)));var x=u&&u.to===f,k=x&&b.attrs.style===u.mark.attrs.style;x&&k?u.to=h:Object.keys(y).some((function(t){return null!==y[t]}))&&(u=new Vt(f,h,b),a.push(u))}}}})),s.forEach((function(e){return t.step(e)})),a.forEach((function(e){return t.step(e)})),s.length+a.length>0},an=function(t,e){var n=t.schema.marks.style;return(n?en(t,n):[]).map((function(t){return tn(t,e)})).filter((function(t){return null!==t}))},cn=function(t,e){return function(n,r,o){var i=n.selection,s=i.empty,a=i.$cursor,c=i.ranges;if(s&&!a||!Ue(n.doc,c,t))return!1;var u,l,d,p,f=!1;if(r){var h=o||n.tr;if(a){var m=n.storedMarks||a.marks();if(t.isInSet(m)){var v=on(m,e),g=m.find((function(t){return"style"===t.type.name})),y=Be.__assign({},g?g.attrs:{},{style:v.style||null});if(u=g.attrs,l=y,d=Object.keys(u),p=Object.keys(l),d.length===p.length&&d.every((function(t){return u[t]===l[t]})))return!1;r(h.removeStoredMark(t)),Object.keys(y).some((function(t){return null!==y[t]}))&&r(h.addStoredMark(t.create(y))),f=!0}}else{for(var b=0;b<c.length;b++){var w=c[b],_=w.$from,x=w.$to;f=sn(h,_.pos,x.pos,e,t)}f&&(h.scrollIntoView(),r(h))}}return f}},un=function(t,e,n){return function(r,o){var i=r.schema.marks,s=t.altStyle,a=t.altMarks,c=void 0===a?[]:a,u=t.mark,l=e||r.tr,d=!1,p=!1,f=function(){return p=!0};s&&i.style&&(d=cn(i.style,{style:s.name,value:s.value})(r,f,l));var h=[u].concat(c).filter((function(t){return i[t]})).map((function(t){return Qe(r,{mark:t})&&i[t]})).filter((function(t){return t}));return h.length?function(t,e,n,r){var o=e.selection,i=o.$cursor,s=o.ranges;if(r=r||e.tr,i)t.forEach((function(t){t.isInSet(e.storedMarks||i.marks())&&n(r.removeStoredMark(t))}));else{for(var a=function(e){var n=s[e],o=n.$from,i=n.$to;t.forEach((function(t){Ye(r,o.pos,i.pos,t)}))},c=0;c<s.length;c++)a(c);n(r.scrollIntoView())}}(h,r,f,l):d||Ge(i[u],n,l)(r,f),p&&o(l),p}},ln=function(t,e){return function(n,r){var o=n.schema.marks.style,i={style:t.style,value:/^.+$/,newValue:t.value},s=n.tr;e&&s.setMeta("commandName",e),s.setMeta("args",t);var a=n.selection,c=a.empty,u=a.$cursor,l=a.ranges;if(c&&!u||!o||!Ue(n.doc,l,o))return!1;if(u){var d=n.storedMarks||u.marks(),p=o.isInSet(d)?d.find((function(t){return"style"===t.type.name})):null,f={style:null};if(p&&p.attrs.style){var h=ze(p.attrs.style,i);h.changed&&h.style&&(f.style=h.style)}else i.newValue&&(f.style=[i.style]+": "+i.newValue+";");var m=p?Be.__assign({},p.attrs,f):f;return Object.keys(m).some((function(t){return null!==m[t]}))?r(s.addStoredMark(o.create(m))):r(s.removeStoredMark(o)),!0}return cn(o,i)(n,r,s)}},dn=function(t,e){return function(n,r){var o=n.selection.$cursor;if(o){var i=o.parent,s=o.index(),a=n.schema.marks[t.mark],c=i.child(s).marks.find((function(t){return t.type===a})),u=i.childCount,l=o.pos-o.textOffset,d=i.child(s).nodeSize,p=void 0,f=void 0;for(p=s-1;p>=0&&c.isInSet(i.child(p).marks);)d+=f=i.child(p).nodeSize,l-=f,p-=1;for(p=s+1;p<u&&c.isInSet(i.child(p).marks);)d+=i.child(p).nodeSize,p+=1;r(Ye(e||n.tr,l,l+d,c))}else un(t,e)(n,r)}},pn=function(t,e){var n=t.mark,r=t.attrs;return void 0===e&&(e="link"),function(t,o){var i=t.schema.marks,s=t.tr;e&&(s.setMeta("commandName",e),s.setMeta("args",r));var a=!1,c=function(){return a=!0};if(function(t,e){var n=en(t,e);return 1===n.length&&n[0]?n[0]:null}(t,i[n]))!function(t,e){return function(n,r){var o=n.selection,i=o.$cursor,s=o.from,a=o.to,c=n.schema.marks[t.mark];if(i){var u=i.parent,l=i.index(),d=u.child(l).marks.find((function(t){return t.type===c})),p=u.childCount,f=i.pos-i.textOffset,h=u.child(l).nodeSize,m=void 0,v=void 0;for(m=l-1;m>=0&&d.isInSet(u.child(m).marks);)h+=v=u.child(m).nodeSize,f-=v,m-=1;for(m=l+1;m<p&&d.isInSet(u.child(m).marks);)h+=u.child(m).nodeSize,m+=1;e.removeMark(f,f+h,c),e.addMark(f,f+h,c.create(t.attrs)),r(e)}else e.doc.nodesBetween(s,a,(function(n,o){n.isInline&&c.isInSet(n.marks)&&(e.removeMark(o,o+n.nodeSize,c),e.addMark(o,o+n.nodeSize,c.create(t.attrs)),r(e))}))}}({mark:n,attrs:r},s)(t,c);else{var u=t;Qe(t,{mark:n})&&(dn({mark:n,attrs:r},s)(t,c),u=ve.create({doc:s.doc,selection:s.selection})),a?Ge(i[n],r,s)(u,c):un({mark:n},s,r)(u,c)}return a&&o(s),a}},fn=function(t){return function(e,n){n(e.tr.insertText(t.text,t.from,t.to))}},hn=function(t){return function(e,n){var r=e.schema.nodes.image,o=r.createAndFill(t);Le(o)(e,(function(e){return n(e.setMeta("commandName","insertImage").setMeta("args",t))}))}},mn=function(t,e,n,r){if(!n.isTextblock)return!1;t.selection.ranges.forEach((function(o){var s=t.steps.length,a=o.$from.pos,c=o.$to.pos;t.doc.nodesBetween(a,c,(function(o,a){if(o.eq(e)&&o.isTextblock&&!o.hasMarkup(n,r)&&function(t,e,n){var r=t.resolve(e),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}(t.doc,t.mapping.slice(s).map(a),n)){t.clearIncompatible(t.mapping.slice(s).map(a,1),n);var c=t.mapping.slice(s),u=c.map(a,1),l=c.map(a+o.nodeSize,1),d=new p(i.from(n.create(r,null,o.marks)),0,0);return t.step(new Et(u,l,u+1,l-1,d,1,!0)),!1}}))}))},vn=function(t,e){void 0===e&&(e={blocksInSelection:!1});var n=t.doc,r=t.selection,o=r.$from,i=r.ranges,s=e.blocksInSelection,a=[],c=r instanceof ie?r.node:void 0;return c?c.isBlock?(a.push(c),c.nodesBetween(0,c.content.size,(function(t){t.isBlock&&a.push(t)}))):!s&&o.parent&&o.parent.isBlock&&a.push(o.parent):i.forEach((function(t){var e=t.$from.pos,r=t.$to.pos;n.nodesBetween(e,r,(function(t,n,o,i){t.isBlock&&(!s||n>=e&&n+t.content.size+2<=r)&&a.push(t)}))})),a},gn=function(t,e){return function(n,r){var o=vn(n),i=n.schema.nodes,s=n.tr;s.setMeta("commandName",e),s.setMeta("args",{value:t}),o.forEach((function(e){if(e.type.isTextblock)if("p"===t){var n=e.attrs,r=n.level,o=Be.__rest(n,["level"]);mn(s,e,i.paragraph,o)}else if(/^h[1-6]$/i.test(t)){r=parseInt(t.substr(1),10);mn(s,e,i.heading,Be.__assign({},e.attrs,{level:r}))}else if("blockquote"===t){var a=e.attrs;r=a.level,o=Be.__rest(a,["level"]);mn(s,e,i.blockquote,o)}}));var a=s.docChanged;return a&&r(s.scrollIntoView()),a}},yn=function(t,e){void 0===e&&(e={blocksInSelection:!0});var n=t.doc,r=t.selection,o=e.blocksInSelection,i=e.blockNodeType;vn({doc:n,selection:r},{blocksInSelection:o}).filter((function(t){return t.isTextblock})).forEach((function(e){var n=e.attrs||{},r=n.style,o=void 0===r?"":r,s=n.class,a=void 0===s?"":s,c=Be.__rest(n,["style","class"]),u=i||e.type;(o||a||u!==e.type)&&mn(t,e,u,c)}))},bn=function(t){var e=vn(t),n=t.schema.nodes,r=[];return e.forEach((function(t){t.type===n.paragraph?r.push("p"):t.type===n.heading?r.push("h"+t.attrs.level):t.type===n.blockquote&&n.blockquote.isTextblock&&r.push("blockquote")})),r},wn=function(t,e){var n,r,o=t.attrs.style;o&&e.forEach((function(t){r={style:t.name,value:/^.+$/,newValue:t.value},n=ze(o,r),o=n.changed?n.style:o}));return o=o||e.reduce((function(t,e){return(t&&e.value?t+" ":"")+e.value?e.name+": "+e.value+";":""}),""),Object.assign({},t.attrs,{style:o||null})},_n=function(t,e){var n=t.selection,r=n.from,o=n.to,i=!1;return t.doc.nodesBetween(r,o,(function(t){return!(i=i||t.type===e)})),i},xn=function(t){var e=bn(t);return 1===new Set(e).size?e[0]:null},kn=function(t){return{tag:xn(t)||""}},Cn=function(t,e){return function(n,r){var o=vn(n),i=n.tr;i.setMeta("commandName",e),o.forEach((function(e){if(e.type.isTextblock){var n={},r=t.find((function(t){return t.node===e.type.name}));r&&(n=wn(e,r.style)),mn(i,e,e.type,n)}}));var s=i.docChanged;return s&&r(i.scrollIntoView()),s}},Sn=function(t,e){var n=vn(t),r=!1;return n.forEach((function(t){if(!r&&t.type.isTextblock&&t.attrs.style){var n=e.find((function(e){return e.node===t.type.name}));n&&(r=n.style.every((function(e){return!!e.value&&new RegExp(e.name+":\\s?"+e.value,"i").test(t.attrs.style)})))}})),r},Tn=function(t){return void 0===t&&(t={blocksInSelection:!0}),function(e,n){var r=e.tr,o=t.blocksInSelection,i=t.blockNodeType,s=(t.exceptMarks||[e.schema.marks.link]).filter(Boolean);Ze(r,{except:s}),yn(r,{blocksInSelection:o,blockNodeType:i});var a=r.docChanged;return a&&n&&n(r),a}},En=["ol",0],Mn=["ul",0],On=["li",0],Dn={attrs:{order:{default:1}},parseDOM:[{tag:"ol",getAttrs:function(t){return{order:t.hasAttribute("start")?+t.getAttribute("start"):1}}}],toDOM:function(t){return 1==t.attrs.order?En:["ol",{start:t.attrs.order},0]}},In={parseDOM:[{tag:"ul"}],toDOM:function(){return Mn}},An={parseDOM:[{tag:"li"}],toDOM:function(){return On},defining:!0};function Nn(t,e){var n={};for(var r in t)n[r]=t[r];for(var o in e)n[o]=e[o];return n}function Bn(t,e,n){return t.append({ordered_list:Nn(Dn,{content:"list_item+",group:n}),bullet_list:Nn(In,{content:"list_item+",group:n}),list_item:Nn(An,{content:e})})}function zn(t,e){return function(n,r){var o=n.selection,s=o.$from,a=o.$to,c=s.blockRange(a),u=!1,l=c;if(!c)return!1;if(c.depth>=2&&s.node(c.depth-1).type.compatibleContent(t)&&0==c.startIndex){if(0==s.index(c.depth-1))return!1;var d=n.doc.resolve(c.start-2);l=new T(d,d,c.depth),c.endIndex<c.parent.childCount&&(c=new T(s,n.doc.resolve(a.end(c.depth)),c.depth)),u=!0}var f=It(l,t,e,c);return!!f&&(r&&r(function(t,e,n,r,o){for(var s=i.empty,a=n.length-1;a>=0;a--)s=i.from(n[a].type.create(n[a].attrs,s));t.step(new Et(e.start-(r?2:0),e.end,e.start,e.end,new p(s,0,0),n.length,!0));for(var c=0,u=0;u<n.length;u++)n[u].type==o&&(c=u+1);for(var l=n.length-c,d=e.start+n.length-(r?2:0),f=e.parent,h=e.startIndex,m=e.endIndex,v=!0;h<m;h++,v=!1)!v&&Nt(t.doc,d,l)&&(t.split(d,l),d+=2*l),d+=f.child(h).nodeSize;return t}(n.tr,c,f,u,t).scrollIntoView()),!0)}}function Pn(t){return function(e,n){var r=e.selection,o=r.$from,s=r.$to,a=r.node;if(a&&a.isBlock||o.depth<2||!o.sameParent(s))return!1;var c=o.node(-1);if(c.type!=t)return!1;if(0==o.parent.content.size&&o.node(-1).childCount==o.indexAfter(-1)){if(2==o.depth||o.node(-3).type!=t||o.index(-2)!=o.node(-2).childCount-1)return!1;if(n){for(var u=i.empty,l=o.index(-1)?1:o.index(-2)?2:3,d=o.depth-l;d>=o.depth-3;d--)u=i.from(o.node(d).copy(u));var f=o.indexAfter(-1)<o.node(-2).childCount?1:o.indexAfter(-2)<o.node(-3).childCount?2:3;u=u.append(i.from(t.createAndFill()));var h=o.before(o.depth-(l-1)),m=e.tr.replace(h,o.after(-f),new p(u,4-l,0)),v=-1;m.doc.nodesBetween(h,m.doc.content.size,(function(t,e){if(v>-1)return!1;t.isTextblock&&0==t.content.size&&(v=e+1)})),v>-1&&m.setSelection(e.selection.constructor.near(m.doc.resolve(v))),n(m.scrollIntoView())}return!0}var g=s.pos==o.end()?c.contentMatchAt(0).defaultType:null,y=e.tr.delete(o.pos,s.pos),b=g&&[null,{type:g}];return!!Nt(y.doc,o.pos,2,b)&&(n&&n(y.split(o.pos,2,b).scrollIntoView()),!0)}}function Rn(t){return function(e,n){var r=e.selection,o=r.$from,s=r.$to,a=o.blockRange(s,(function(e){return e.childCount&&e.firstChild.type==t}));return!!a&&(!n||(o.node(a.depth-1).type==t?function(t,e,n,r){var o=t.tr,s=r.end,a=r.$to.end(r.depth);s<a&&(o.step(new Et(s-1,a,s,a,new p(i.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new T(o.doc.resolve(r.$from.pos),o.doc.resolve(a),r.depth));return e(o.lift(r,Dt(r)).scrollIntoView()),!0}(e,n,t,a):function(t,e,n){for(var r=t.tr,o=n.parent,s=n.end,a=n.endIndex-1,c=n.startIndex;a>c;a--)s-=o.child(a).nodeSize,r.delete(s-1,s+1);var u=r.doc.resolve(n.start),l=u.nodeAfter;if(r.mapping.map(n.end)!=n.start+u.nodeAfter.nodeSize)return!1;var d=0==n.startIndex,f=n.endIndex==o.childCount,h=u.node(-1),m=u.index(-1);if(!h.canReplace(m+(d?0:1),m+1,l.content.append(f?i.empty:i.from(o))))return!1;var v=u.pos,g=v+l.nodeSize;return r.step(new Et(v-(d?1:0),g+(f?1:0),v+1,g-1,new p((d?i.empty:i.from(o.copy(i.empty))).append(f?i.empty:i.from(o.copy(i.empty))),d?0:1,f?0:1),d?0:1)),e(r.scrollIntoView()),!0}(e,n,a)))}}function Fn(t){return function(e,n){var r=e.selection,o=r.$from,s=r.$to,a=o.blockRange(s,(function(e){return e.childCount&&e.firstChild.type==t}));if(!a)return!1;var c=a.startIndex;if(0==c)return!1;var u=a.parent,l=u.child(c-1);if(l.type!=t)return!1;if(n){var d=l.lastChild&&l.lastChild.type==u.type,f=i.from(d?t.create():null),h=new p(i.from(t.create(null,i.from(u.type.create(null,f)))),d?3:1,0),m=a.start,v=a.end;n(e.tr.step(new Et(m-(d?3:1),v,m,v,h,1,!0)).scrollIntoView())}return!0}}var Ln={orderedList:"ordered_list",bulletList:"bullet_list",listItem:"list_item"},Vn={listType:Ln.orderedList,types:Be.__assign({},Ln)},jn={listType:Ln.bulletList,types:Be.__assign({},Ln)},$n={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:Be.__assign({},Ln)},Wn={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:Be.__assign({},Ln)};function Hn(t,e){return!t.selection.empty&&(e&&e(t.tr.deleteSelection().scrollIntoView()),!0)}function qn(t,e,n){var r=t.selection.$cursor;if(!r||(n?!n.endOfTextblock("backward",t):r.parentOffset>0))return!1;var o=Un(r);if(!o){var i=r.blockRange(),s=i&&Dt(i);return null!=s&&(e&&e(t.tr.lift(i,s).scrollIntoView()),!0)}var a=o.nodeBefore;if(!a.type.spec.isolating&&lr(t,o,e))return!0;if(0==r.parent.content.size&&(Jn(a,"end")||ie.isSelectable(a))){var c=$t(t.doc,r.before(),r.after(),p.empty);if(c.slice.size<c.to-c.from){if(e){var u=t.tr.step(c);u.setSelection(Jn(a,"end")?te.findFrom(u.doc.resolve(u.mapping.map(o.pos,-1)),-1):ie.create(u.doc,o.pos-a.nodeSize)),e(u.scrollIntoView())}return!0}}return!(!a.isAtom||o.depth!=r.depth-1)&&(e&&e(t.tr.delete(o.pos-a.nodeSize,o.pos).scrollIntoView()),!0)}function Jn(t,e,n){for(;t;t="start"==e?t.firstChild:t.lastChild){if(t.isTextblock)return!0;if(n&&1!=t.childCount)return!1}return!1}function Kn(t,e,n){var r=t.selection,o=r.$head,i=o;if(!r.empty)return!1;if(o.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):o.parentOffset>0)return!1;i=Un(o)}var s=i&&i.nodeBefore;return!(!s||!ie.isSelectable(s))&&(e&&e(t.tr.setSelection(ie.create(t.doc,i.pos-s.nodeSize)).scrollIntoView()),!0)}function Un(t){if(!t.parent.type.spec.isolating)for(var e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function Gn(t,e,n){var r=t.selection.$cursor;if(!r||(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size))return!1;var o=Xn(r);if(!o)return!1;var i=o.nodeAfter;if(lr(t,o,e))return!0;if(0==r.parent.content.size&&(Jn(i,"start")||ie.isSelectable(i))){var s=$t(t.doc,r.before(),r.after(),p.empty);if(s.slice.size<s.to-s.from){if(e){var a=t.tr.step(s);a.setSelection(Jn(i,"start")?te.findFrom(a.doc.resolve(a.mapping.map(o.pos)),1):ie.create(a.doc,a.mapping.map(o.pos))),e(a.scrollIntoView())}return!0}}return!(!i.isAtom||o.depth!=r.depth-1)&&(e&&e(t.tr.delete(o.pos,o.pos+i.nodeSize).scrollIntoView()),!0)}function Yn(t,e,n){var r=t.selection,o=r.$head,i=o;if(!r.empty)return!1;if(o.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):o.parentOffset<o.parent.content.size)return!1;i=Xn(o)}var s=i&&i.nodeAfter;return!(!s||!ie.isSelectable(s))&&(e&&e(t.tr.setSelection(ie.create(t.doc,i.pos)).scrollIntoView()),!0)}function Xn(t){if(!t.parent.type.spec.isolating)for(var e=t.depth-1;e>=0;e--){var n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}function Zn(t,e){var n,r=t.selection,o=r instanceof ie;if(o){if(r.node.isTextblock||!Bt(t.doc,r.from))return!1;n=r.from}else if(null==(n=Pt(t.doc,r.from,-1)))return!1;if(e){var i=t.tr.join(n);o&&i.setSelection(ie.create(i.doc,n-t.doc.resolve(n).nodeBefore.nodeSize)),e(i.scrollIntoView())}return!0}function Qn(t,e){var n,r=t.selection;if(r instanceof ie){if(r.node.isTextblock||!Bt(t.doc,r.to))return!1;n=r.to}else if(null==(n=Pt(t.doc,r.to,1)))return!1;return e&&e(t.tr.join(n).scrollIntoView()),!0}function tr(t,e){var n=t.selection,r=n.$from,o=n.$to,i=r.blockRange(o),s=i&&Dt(i);return null!=s&&(e&&e(t.tr.lift(i,s).scrollIntoView()),!0)}function er(t,e){var n=t.selection,r=n.$head,o=n.$anchor;return!(!r.parent.type.spec.code||!r.sameParent(o))&&(e&&e(t.tr.insertText("\n").scrollIntoView()),!0)}function nr(t){for(var e=0;e<t.edgeCount;e++){var n=t.edge(e).type;if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function rr(t,e){var n=t.selection,r=n.$head,o=n.$anchor;if(!r.parent.type.spec.code||!r.sameParent(o))return!1;var i=r.node(-1),s=r.indexAfter(-1),a=nr(i.contentMatchAt(s));if(!i.canReplaceWith(s,s,a))return!1;if(e){var c=r.after(),u=t.tr.replaceWith(c,c,a.createAndFill());u.setSelection(te.near(u.doc.resolve(c),1)),e(u.scrollIntoView())}return!0}function or(t,e){var n=t.selection,r=n.$from,o=n.$to;if(n instanceof ae||r.parent.inlineContent||o.parent.inlineContent)return!1;var i=nr(o.parent.contentMatchAt(o.indexAfter()));if(!i||!i.isTextblock)return!1;if(e){var s=(!r.parentOffset&&o.index()<o.parent.childCount?r:o).pos,a=t.tr.insert(s,i.createAndFill());a.setSelection(re.create(a.doc,s+1)),e(a.scrollIntoView())}return!0}function ir(t,e){var n=t.selection.$cursor;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){var r=n.before();if(Nt(t.doc,r))return e&&e(t.tr.split(r).scrollIntoView()),!0}var o=n.blockRange(),i=o&&Dt(o);return null!=i&&(e&&e(t.tr.lift(o,i).scrollIntoView()),!0)}function sr(t,e){var n=t.selection,r=n.$from,o=n.$to;if(t.selection instanceof ie&&t.selection.node.isBlock)return!(!r.parentOffset||!Nt(t.doc,r.pos))&&(e&&e(t.tr.split(r.pos).scrollIntoView()),!0);if(!r.parent.isBlock)return!1;if(e){var i=o.parentOffset==o.parent.content.size,s=t.tr;(t.selection instanceof re||t.selection instanceof ae)&&s.deleteSelection();var a=0==r.depth?null:nr(r.node(-1).contentMatchAt(r.indexAfter(-1))),c=i&&a?[{type:a}]:null,u=Nt(s.doc,s.mapping.map(r.pos),1,c);if(c||u||!Nt(s.doc,s.mapping.map(r.pos),1,a&&[{type:a}])||(c=[{type:a}],u=!0),u&&(s.split(s.mapping.map(r.pos),1,c),!i&&!r.parentOffset&&r.parent.type!=a)){var l=s.mapping.map(r.before()),d=s.doc.resolve(l);r.node(-1).canReplaceWith(d.index(),d.index()+1,a)&&s.setNodeMarkup(s.mapping.map(r.before()),a)}e(s.scrollIntoView())}return!0}function ar(t,e){return sr(t,e&&function(n){var r=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();r&&n.ensureMarks(r),e(n)})}function cr(t,e){var n,r=t.selection,o=r.$from,i=r.to,s=o.sharedDepth(i);return 0!=s&&(n=o.before(s),e&&e(t.tr.setSelection(ie.create(t.doc,n))),!0)}function ur(t,e){return e&&e(t.tr.setSelection(new ae(t.doc))),!0}function lr(t,e,n){var r,o,s=e.nodeBefore,a=e.nodeAfter;if(s.type.spec.isolating||a.type.spec.isolating)return!1;if(function(t,e,n){var r=e.nodeBefore,o=e.nodeAfter,i=e.index();return!!(r&&o&&r.type.compatibleContent(o.type))&&(!r.content.size&&e.parent.canReplace(i-1,i)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!(!e.parent.canReplace(i,i+1)||!o.isTextblock&&!Bt(t.doc,e.pos))&&(n&&n(t.tr.clearIncompatible(e.pos,r.type,r.contentMatchAt(r.childCount)).join(e.pos).scrollIntoView()),!0))}(t,e,n))return!0;var c=e.parent.canReplace(e.index(),e.index()+1);if(c&&(r=(o=s.contentMatchAt(s.childCount)).findWrapping(a.type))&&o.matchType(r[0]||a.type).validEnd){if(n){for(var u=e.pos+a.nodeSize,l=i.empty,d=r.length-1;d>=0;d--)l=i.from(r[d].create(null,l));l=i.from(s.copy(l));var f=t.tr.step(new Et(e.pos-1,u,e.pos,u,new p(l,1,0),r.length,!0)),h=u+2*r.length;Bt(f.doc,h)&&f.join(h),n(f.scrollIntoView())}return!0}var m=te.findFrom(e,1),v=m&&m.$from.blockRange(m.$to),g=v&&Dt(v);if(null!=g&&g>=e.depth)return n&&n(t.tr.lift(v,g).scrollIntoView()),!0;if(c&&Jn(a,"start",!0)&&Jn(s,"end")){for(var y=s,b=[];b.push(y),!y.isTextblock;)y=y.lastChild;for(var w=a,_=1;!w.isTextblock;w=w.firstChild)_++;if(y.canReplace(y.childCount,y.childCount,w.content)){if(n){for(var x=i.empty,k=b.length-1;k>=0;k--)x=i.from(b[k].copy(x));n(t.tr.step(new Et(e.pos-b.length,e.pos+a.nodeSize,e.pos+_,e.pos+a.nodeSize-_,new p(x,b.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function dr(t){return function(e,n){for(var r=e.selection,o=t<0?r.$from:r.$to,i=o.depth;o.node(i).isInline;){if(!i)return!1;i--}return!!o.node(i).isTextblock&&(n&&n(e.tr.setSelection(re.create(e.doc,t<0?o.start(i):o.end(i)))),!0)}}var pr=dr(-1),fr=dr(1);function hr(t,e){return function(n,r){var o=n.selection,i=o.$from,s=o.$to,a=i.blockRange(s),c=a&&It(a,t,e);return!!c&&(r&&r(n.tr.wrap(a,c).scrollIntoView()),!0)}}function mr(t,e){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(t,e))if(r.type==t)a=!0;else{var i=n.doc.resolve(o),s=i.index();a=i.parent.canReplaceWith(s,s+1,t)}})),!!a&&(r&&r(n.tr.setBlockType(i,s,t,e).scrollIntoView()),!0)}}function vr(t,e){return function(n,r){var o=n.selection,i=o.empty,s=o.$cursor,a=o.ranges;if(i&&!s||!function(t,e,n){for(var r=function(r){var o=e[r],i=o.$from,s=o.$to,a=0==i.depth&&t.type.allowsMarkType(n);if(t.nodesBetween(i.pos,s.pos,(function(t){if(a)return!1;a=t.inlineContent&&t.type.allowsMarkType(n)})),a)return{v:!0}},o=0;o<e.length;o++){var i=r(o);if(i)return i.v}return!1}(n.doc,a,t))return!1;if(r)if(s)t.isInSet(n.storedMarks||s.marks())?r(n.tr.removeStoredMark(t)):r(n.tr.addStoredMark(t.create(e)));else{for(var c=!1,u=n.tr,l=0;!c&&l<a.length;l++){var d=a[l],p=d.$from,f=d.$to;c=n.doc.rangeHasMark(p.pos,f.pos,t)}for(var h=0;h<a.length;h++){var m=a[h],v=m.$from,g=m.$to;if(c)u.removeMark(v.pos,g.pos,t);else{var y=v.pos,b=g.pos,w=v.nodeAfter,_=g.nodeBefore,x=w&&w.isText?/^\s*/.exec(w.text)[0].length:0,k=_&&_.isText?/\s*$/.exec(_.text)[0].length:0;y+x<b&&(y+=x,b-=k),u.addMark(y,b,t.create(e))}}r(u.scrollIntoView())}return!0}}function gr(t,e){if(Array.isArray(e)){var n=e;e=function(t){return n.indexOf(t.type.name)>-1}}return function(n,r,o){return t(n,r&&function(t,e){return function(n){if(!n.isGeneric)return t(n);for(var r=[],o=0;o<n.mapping.maps.length;o++){for(var i=n.mapping.maps[o],s=0;s<r.length;s++)r[s]=i.map(r[s]);i.forEach((function(t,e,n,o){return r.push(n,o)}))}for(var a=[],c=0;c<r.length;c+=2)for(var u=r[c],l=r[c+1],d=n.doc.resolve(u),p=d.sharedDepth(l),f=d.node(p),h=d.indexAfter(p),m=d.after(p+1);m<=l;++h){var v=f.maybeChild(h);if(!v)break;if(h&&-1==a.indexOf(m)){var g=f.child(h-1);g.type==v.type&&e(g,v)&&a.push(m)}m+=v.nodeSize}a.sort((function(t,e){return t-e}));for(var y=a.length-1;y>=0;y--)Bt(n.doc,a[y])&&n.join(a[y]);t(n)}}(r,e),o)}}function yr(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return function(e,n,r){for(var o=0;o<t.length;o++)if(t[o](e,n,r))return!0;return!1}}var br=yr(Hn,qn,Kn),wr=yr(Hn,Gn,Yn),_r={Enter:yr(er,or,ir,sr),"Mod-Enter":rr,Backspace:br,"Mod-Backspace":br,"Shift-Backspace":br,Delete:wr,"Mod-Delete":wr,"Mod-a":ur},xr={"Ctrl-h":_r.Backspace,"Alt-Backspace":_r["Mod-Backspace"],"Ctrl-d":_r.Delete,"Ctrl-Alt-Backspace":_r["Mod-Delete"],"Alt-Delete":_r["Mod-Delete"],"Alt-d":_r["Mod-Delete"],"Ctrl-a":pr,"Ctrl-e":fr};for(var kr in _r)xr[kr]=_r[kr];_r.Home=pr,_r.End=fr;var Cr=("undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):"undefined"!=typeof os&&"darwin"==os.platform())?xr:_r,Sr=function(t,e){return hr(t.schema.nodes.blockquote)(t,e)},Tr=function(t,e){var n=t.selection,r=n.$from,o=n.$to,i=t.schema.nodes.blockquote,s=t.doc,a=-1,c=r.blockRange(o);c&&s.nodesBetween(c.start,c.end,(function(t,e,n,r){t.type===i&&(a=e)}));var u=-1!==a;return e&&u&&e(t.tr.lift(c,s.resolve(a).depth)),u},Er=function(t,e,n){return function(r,o){var i=vn(r),s=r.tr;s.setMeta("commandName",e),i.forEach((function(e){if(e.type.isTextblock){var r=void 0,o=t.find((function(t){return t.node===e.type.name}));if(o){var i="rtl"===n?o.rtlStyle:o.style,a={name:i,value:o.step>0?""+o.step+o.unit:""};if(e.attrs.style){var c=new RegExp(i+":\\s?(\\d+)"+o.unit,"i"),u=e.attrs.style.match(c);if(u){var l=parseFloat(u[1])+o.step;l=l<=0?"":l,a.value=""+l+(l?o.unit:"")}}r=wn(e,[a])}r&&mn(s,e,e.type,r)}}));var a=s.docChanged;return a&&o(s.scrollIntoView()),a}},Mr=function(t,e,n){var r=vn(t),o=!1;return r.forEach((function(t){if(!o&&t.type.isTextblock&&t.attrs.style){var r=e.find((function(e){return e.node===t.type.name}));if(r){var i="rtl"===n?r.rtlStyle:r.style,s=new RegExp(i+":\\s?\\d+"+r.unit,"i");o=s.test(t.attrs.style)}}})),o},Or=function(t,e){return Fn(e)(t)},Dr=function(t,e){var n=t.schema.nodes[e.listsTypes.listItem],r=t.schema.nodes[e.listsTypes.orderedList],o=t.schema.nodes[e.listsTypes.bulletList],i=!!Fe(r,2)(t.selection),s=!!Fe(o,2)(t.selection);return(i||s)&&Rn(n)(t)},Ir=function(t,e){var n=t.schema.nodes,r=n[$n.listsTypes.listItem];return(Mr(t,e.nodes)||$n.nodes.some((function(e){return n[e.node]&&_n(t,n[e.node])})))&&!_n(t,r)},Ar=function(t,e){var n=t.schema.nodes[$n.listsTypes.listItem],r=Ir(t,$n);Or(t,n)?Fn(n)(t,e):r&&Er($n.nodes)(t,e)},Nr=function(t,e){var n=t.schema.nodes,r=n[Wn.listsTypes.listItem],o=Ir(t,Wn);_n(t,n.blockquote)?Tr(t,e):Dr(t,Wn)?Rn(r)(t,e):o&&Er(Wn.nodes)(t,e)},Br=function(t,e,n){for(var r=e.depth,o=t.nodes[n.bulletList],i=t.nodes[n.orderedList],s=t.nodes[n.listItem],a=e.depth;a>0;a--){var c=e.node(a);if(c.type!==o&&c.type!==i||(r=a),c.type!==o&&c.type!==i&&c.type!==s)break}return r-1};function zr(t){return function(e,n,r){if(!r)return!1;var o=(e=r.state).schema.nodes[t.listType],i=e.selection,s=i.$from,a=i.$to,c=s.node(-2),u=s.node(-3),l=function(t,e,n,r){return 0===function(t,e,n){var r=Array(),o=function(t,e){var n=["blockquote","bulletList","orderedList"];if(1===e.depth)return e;var r=e.node(e.depth),o=e;for(;e.depth>=1;)e=t.resolve(e.before(e.depth)),(r=e.node(e.depth))&&-1!==n.indexOf(r.type.name)&&(o=e);return o}(t,e).depth,i=t.resolve(e.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 c=t.resolve(i.after(s));if(c.start(s)>=t.nodeSize-2)break;c.depth!==i.depth&&(c=t.resolve(c.pos+2)),i=c.depth?t.resolve(c.start(c.depth)):t.resolve(c.end(c.depth))}return r}(t,e,n).filter((function(t){return t.type!==r})).length}(e.doc,s,a,o);return(c&&c.type===o||u&&u.type===o)&&l?Rr(t)(e,n):(l||(Rr(t)(e,n),e=r.state),function(t,e){void 0===e&&(e={});return gr(zn(t,e),(function(e,n){return e.type===n.type&&e.type===t}))}(o,t.listAttrs)(e,n))}}function Pr(t,e,n,r){var o=r||t.schema.nodes.listItem,s=e.$from,a=e.$to,c=s.blockRange(a,(function(t){return t.childCount&&t.firstChild.type===o}));if(!c||c.depth<2||s.node(c.depth-1).type!==o)return n;var u=c.end,l=a.end(c.depth);return u<l&&(n.step(new Et(u-1,l,u,l,new p(i.from(o.create(void 0,c.parent.copy())),1,0),1,!0)),c=new T(n.doc.resolve(s.pos),n.doc.resolve(l),c.depth)),n.lift(c,Dt(c)).scrollIntoView()}function Rr(t){return function(e,n){var r=e.tr,o=e.selection,i=o.$from,s=o.$to;return r.doc.nodesBetween(i.pos,s.pos,(function(n,o){if(n.isTextblock||"blockquote"===n.type.name||"div"===n.type.name){var i=new ie(r.doc.resolve(r.mapping.map(o))),s=i.$from.blockRange(i.$to);if(!s||i.$from.parent.type!==e.schema.nodes[t.listItem])return!1;var a=s&&Dt(s);if(null==a)return!1;r.lift(s,a)}})),n&&n(r),!0}}var Fr=/list\-style\-type:\s?([\w-]+)/,Lr=function(t){var e=t.style||"",n=Fr.exec(e);return n&&n[1]||""},Vr=function(t,e,n,r,o){var i=r.listType,s=r.listAttrs,a=void 0===s?{style:null}:s,c=t.selection,u=c.$from.node(c.$from.depth-2),l=c.$to.node(c.$to.depth-2);if(u&&u.type.name===i&&Lr(u.attrs)===Lr(a)&&l&&l.type.name===i&&Lr(l.attrs)===Lr(a)){var d=n.state.schema.nodes,p={bulletList:d[r.bulletList],orderedList:d[r.orderedList],listItem:d[r.listItem]},f=function(t,e){for(var n,r=e.bulletList,o=e.orderedList,i=e.listItem,s=t.depth-1;s>0;s--){var a=t.node(s);if(a.type!==r&&a.type!==o||(n=s),a.type!==r&&a.type!==o&&a.type!==i)break}return n}(c.$to,p),h=function(t,e,n,r,o,i){i||(i=t.schema.nodes.listItem);var s=!1;return o.doc.nodesBetween(e,n,(function(n,a){if(!s&&n.type===i&&a>e){s=!0;for(var c=r+3;c>r+2;){var u=o.doc.resolve(o.mapping.map(a));c=u.depth;var l=o.doc.resolve(o.mapping.map(a+n.textContent.length)),d=new re(u,l);o=Pr(t,d,o,i)}}})),o}(t,c.$to.pos,c.$to.end(f),f,n.state.tr,p.listItem);return(h=function(t,e,n){var r=t.selection,o=r.from,i=r.to,s=t.schema.nodes,a=s.paragraph,c=s.heading,u=[];e.doc.nodesBetween(o,i,(function(t,e){t.type!==a&&t.type!==c||u.push({node:t,pos:e})}));for(var l=u.length-1;l>=0;l--){var d=u[l],p=e.doc.resolve(e.mapping.map(d.pos));if(p.depth>0){var f=void 0;f=d.node.textContent&&d.node.textContent.length>0?e.doc.resolve(e.mapping.map(d.pos+d.node.textContent.length)):e.doc.resolve(e.mapping.map(d.pos+1));var h=p.blockRange(f);h&&e.lift(h,Br(t.schema,p,n))}}return e}(t,h,r)).setMeta("commandName",o),e(h),!0}return zr(r)(t,e,n)};function jr(t,e,n){return Vr(t,e,n,Be.__assign({listType:jn.listType},jn.types))}function $r(t,e,n){return Vr(t,e,n,Be.__assign({listType:Vn.listType},Vn.types))}for(var Wr=function(t,e){return{name:t,value:e}},Hr=[{node:"paragraph",style:[Wr("text-align","left")]},{node:"heading",style:[Wr("text-align","left")]}],qr=[{node:"paragraph",style:[Wr("text-align","right")]},{node:"heading",style:[Wr("text-align","right")]}],Jr=[{node:"paragraph",style:[Wr("text-align","center")]},{node:"heading",style:[Wr("text-align","center")]}],Kr=[{node:"paragraph",style:[Wr("text-align","justify")]},{node:"heading",style:[Wr("text-align","justify")]}],Ur=[{node:"paragraph",style:[Wr("text-align","")]},{node:"heading",style:[Wr("text-align","")]}],Gr={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"},Yr={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"},Xr="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent),Zr="undefined"!=typeof navigator&&/Apple Computer/.test(navigator.vendor),Qr="undefined"!=typeof navigator&&/Gecko\/\d+/.test(navigator.userAgent),to="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),eo="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),no=Xr&&(to||+Xr[1]<57)||Qr&&to,ro=0;ro<10;ro++)Gr[48+ro]=Gr[96+ro]=String(ro);for(ro=1;ro<=24;ro++)Gr[ro+111]="F"+ro;for(ro=65;ro<=90;ro++)Gr[ro]=String.fromCharCode(ro+32),Yr[ro]=String.fromCharCode(ro);for(var oo in Gr)Yr.hasOwnProperty(oo)||(Yr[oo]=Gr[oo]);var io="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function so(t){var e,n,r,o,i=t.split(/-(?!$)/),s=i[i.length-1];"Space"==s&&(s=" ");for(var a=0;a<i.length-1;a++){var c=i[a];if(/^(cmd|meta|m)$/i.test(c))o=!0;else if(/^a(lt)?$/i.test(c))e=!0;else if(/^(c|ctrl|control)$/i.test(c))n=!0;else if(/^s(hift)?$/i.test(c))r=!0;else{if(!/^mod$/i.test(c))throw new Error("Unrecognized modifier name: "+c);io?o=!0:n=!0}}return e&&(s="Alt-"+s),n&&(s="Ctrl-"+s),o&&(s="Meta-"+s),r&&(s="Shift-"+s),s}function ao(t,e,n){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),!1!==n&&e.shiftKey&&(t="Shift-"+t),t}function co(t){return new be({props:{handleKeyDown:uo(t)}})}function uo(t){var e=function(t){var e=Object.create(null);for(var n in t)e[so(n)]=t[n];return e}(t);return function(t,n){var r,o=function(t){var e=!(no&&(t.ctrlKey||t.altKey||t.metaKey)||(Zr||eo)&&t.shiftKey&&t.key&&1==t.key.length)&&t.key||(t.shiftKey?Yr:Gr)[t.keyCode]||t.key||"Unidentified";return"Esc"==e&&(e="Escape"),"Del"==e&&(e="Delete"),"Left"==e&&(e="ArrowLeft"),"Up"==e&&(e="ArrowUp"),"Right"==e&&(e="ArrowRight"),"Down"==e&&(e="ArrowDown"),e}(n),i=1==o.length&&" "!=o,s=e[ao(o,n,!i)];if(s&&s(t.state,t.dispatch,t))return!0;if(i&&(n.shiftKey||n.altKey||n.metaKey||o.charCodeAt(0)>127)&&(r=Gr[n.keyCode])&&r!=o){var a=e[ao(r,n,!0)];if(a&&a(t.state,t.dispatch,t))return!0}else if(i&&n.shiftKey){var c=e[ao(o,n,!0)];if(c&&c(t.state,t.dispatch,t))return!0}return!1}}var lo={};if("undefined"!=typeof navigator&&"undefined"!=typeof document){var po=/Edge\/(\d+)/.exec(navigator.userAgent),fo=/MSIE \d/.test(navigator.userAgent),ho=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),mo=lo.ie=!!(fo||ho||po);lo.ie_version=fo?document.documentMode||6:ho?+ho[1]:po?+po[1]:null,lo.gecko=!mo&&/gecko\/(\d+)/i.test(navigator.userAgent),lo.gecko_version=lo.gecko&&+(/Firefox\/(\d+)/.exec(navigator.userAgent)||[0,0])[1];var vo=!mo&&/Chrome\/(\d+)/.exec(navigator.userAgent);lo.chrome=!!vo,lo.chrome_version=vo&&+vo[1],lo.safari=!mo&&/Apple Computer/.test(navigator.vendor),lo.ios=lo.safari&&(/Mobile\/\w+/.test(navigator.userAgent)||navigator.maxTouchPoints>2),lo.mac=lo.ios||/Mac/.test(navigator.platform),lo.android=/Android \d/.test(navigator.userAgent),lo.webkit="webkitFontSmoothing"in document.documentElement.style,lo.webkit_version=lo.webkit&&+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]}var go=function(t){for(var e=0;;e++)if(!(t=t.previousSibling))return e},yo=function(t){var e=t.assignedSlot||t.parentNode;return e&&11==e.nodeType?e.host:e},bo=null,wo=function(t,e,n){var r=bo||(bo=document.createRange());return r.setEnd(t,null==n?t.nodeValue.length:n),r.setStart(t,e||0),r},_o=function(t,e,n,r){return n&&(ko(t,e,n,r,-1)||ko(t,e,n,r,1))},xo=/^(img|br|input|textarea|hr)$/i;function ko(t,e,n,r,o){for(;;){if(t==n&&e==r)return!0;if(e==(o<0?0:Co(t))){var i=t.parentNode;if(1!=i.nodeType||So(t)||xo.test(t.nodeName)||"false"==t.contentEditable)return!1;e=go(t)+(o<0?0:1),t=i}else{if(1!=t.nodeType)return!1;if("false"==(t=t.childNodes[e+(o<0?-1:0)]).contentEditable)return!1;e=o<0?Co(t):0}}}function Co(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function So(t){for(var e,n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}var To=function(t){var e=t.isCollapsed;return e&&lo.chrome&&t.rangeCount&&!t.getRangeAt(0).collapsed&&(e=!1),e};function Eo(t,e){var n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function Mo(t){return{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function Oo(t,e){return"number"==typeof t?t:t[e]}function Do(t){var e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function Io(t,e,n){for(var r=t.someProp("scrollThreshold")||0,o=t.someProp("scrollMargin")||5,i=t.dom.ownerDocument,s=n||t.dom;s;s=yo(s))if(1==s.nodeType){var a=s==i.body||1!=s.nodeType,c=a?Mo(i):Do(s),u=0,l=0;if(e.top<c.top+Oo(r,"top")?l=-(c.top-e.top+Oo(o,"top")):e.bottom>c.bottom-Oo(r,"bottom")&&(l=e.bottom-c.bottom+Oo(o,"bottom")),e.left<c.left+Oo(r,"left")?u=-(c.left-e.left+Oo(o,"left")):e.right>c.right-Oo(r,"right")&&(u=e.right-c.right+Oo(o,"right")),u||l)if(a)i.defaultView.scrollBy(u,l);else{var d=s.scrollLeft,p=s.scrollTop;l&&(s.scrollTop+=l),u&&(s.scrollLeft+=u);var f=s.scrollLeft-d,h=s.scrollTop-p;e={left:e.left-f,top:e.top-h,right:e.right-f,bottom:e.bottom-h}}if(a)break}}function Ao(t){for(var e=[],n=t.ownerDocument;t&&(e.push({dom:t,top:t.scrollTop,left:t.scrollLeft}),t!=n);t=yo(t));return e}function No(t,e){for(var n=0;n<t.length;n++){var r=t[n],o=r.dom,i=r.top,s=r.left;o.scrollTop!=i+e&&(o.scrollTop=i+e),o.scrollLeft!=s&&(o.scrollLeft=s)}}var Bo=null;function zo(t,e){for(var n,r,o=2e8,i=0,s=e.top,a=e.top,c=t.firstChild,u=0;c;c=c.nextSibling,u++){var l=void 0;if(1==c.nodeType)l=c.getClientRects();else{if(3!=c.nodeType)continue;l=wo(c).getClientRects()}for(var d=0;d<l.length;d++){var p=l[d];if(p.top<=s&&p.bottom>=a){s=Math.max(p.bottom,s),a=Math.min(p.top,a);var f=p.left>e.left?p.left-e.left:p.right<e.left?e.left-p.right:0;if(f<o){n=c,o=f,r=f&&3==n.nodeType?{left:p.right<e.left?p.right:p.left,top:e.top}:e,1==c.nodeType&&f&&(i=u+(e.left>=(p.left+p.right)/2?1:0));continue}}!n&&(e.left>=p.right&&e.top>=p.top||e.left>=p.left&&e.top>=p.bottom)&&(i=u+1)}}return n&&3==n.nodeType?function(t,e){for(var n=t.nodeValue.length,r=document.createRange(),o=0;o<n;o++){r.setEnd(t,o+1),r.setStart(t,o);var i=Fo(r,1);if(i.top!=i.bottom&&Po(e,i))return{node:t,offset:o+(e.left>=(i.left+i.right)/2?1:0)}}return{node:t,offset:0}}(n,r):!n||o&&1==n.nodeType?{node:t,offset:i}:zo(n,r)}function Po(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function Ro(t,e){var n,r,o,i,s=t.dom.ownerDocument;if(s.caretPositionFromPoint)try{var a=s.caretPositionFromPoint(e.left,e.top);a&&(o=(n=a).offsetNode,i=n.offset)}catch(t){}if(!o&&s.caretRangeFromPoint){var c=s.caretRangeFromPoint(e.left,e.top);c&&(o=(r=c).startContainer,i=r.startOffset)}var u,l=(t.root.elementFromPoint?t.root:s).elementFromPoint(e.left,e.top+1);if(!l||!t.dom.contains(1!=l.nodeType?l.parentNode:l)){var d=t.dom.getBoundingClientRect();if(!Po(e,d))return null;if(!(l=function t(e,n,r){var o=e.childNodes.length;if(o&&r.top<r.bottom)for(var i=Math.max(0,Math.min(o-1,Math.floor(o*(n.top-r.top)/(r.bottom-r.top))-2)),s=i;;){var a=e.childNodes[s];if(1==a.nodeType)for(var c=a.getClientRects(),u=0;u<c.length;u++){var l=c[u];if(Po(n,l))return t(a,n,l)}if((s=(s+1)%o)==i)break}return e}(t.dom,e,d)))return null}if(lo.safari)for(var p=l;o&&p;p=yo(p))p.draggable&&(o=i=null);if(l=function(t,e){var n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}(l,e),o){if(lo.gecko&&1==o.nodeType&&(i=Math.min(i,o.childNodes.length))<o.childNodes.length){var f,h=o.childNodes[i];"IMG"==h.nodeName&&(f=h.getBoundingClientRect()).right<=e.left&&f.bottom>e.top&&i++}o==t.dom&&i==o.childNodes.length-1&&1==o.lastChild.nodeType&&e.top>o.lastChild.getBoundingClientRect().bottom?u=t.state.doc.content.size:0!=i&&1==o.nodeType&&"BR"==o.childNodes[i-1].nodeName||(u=function(t,e,n,r){for(var o=-1,i=e;i!=t.dom;){var s=t.docView.nearestDesc(i,!0);if(!s)return null;if(s.node.isBlock&&s.parent){var a=s.dom.getBoundingClientRect();if(a.left>r.left||a.top>r.top)o=s.posBefore;else{if(!(a.right<r.left||a.bottom<r.top))break;o=s.posAfter}}i=s.dom.parentNode}return o>-1?o:t.docView.posFromDOM(e,n)}(t,o,i,e))}null==u&&(u=function(t,e,n){var r=zo(e,n),o=r.node,i=r.offset,s=-1;if(1==o.nodeType&&!o.firstChild){var a=o.getBoundingClientRect();s=a.left!=a.right&&n.left>(a.left+a.right)/2?1:-1}return t.docView.posFromDOM(o,i,s)}(t,l,e));var m=t.docView.nearestDesc(l,!0);return{pos:u,inside:m?m.posAtStart-m.border:-1}}function Fo(t,e){var n=t.getClientRects();return n.length?n[e<0?0:n.length-1]:t.getBoundingClientRect()}var Lo=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Vo(t,e,n){var r=t.docView.domFromPos(e,n<0?-1:1),o=r.node,i=r.offset,s=lo.webkit||lo.gecko;if(3==o.nodeType){if(!s||!Lo.test(o.nodeValue)&&(n<0?i:i!=o.nodeValue.length)){var a=i,c=i,u=n<0?1:-1;return n<0&&!i?(c++,u=-1):n>=0&&i==o.nodeValue.length?(a--,u=1):n<0?a--:c++,jo(Fo(wo(o,a,c),u),u<0)}var l=Fo(wo(o,i,i),n);if(lo.gecko&&i&&/\s/.test(o.nodeValue[i-1])&&i<o.nodeValue.length){var d=Fo(wo(o,i-1,i-1),-1);if(d.top==l.top){var p=Fo(wo(o,i,i+1),-1);if(p.top!=l.top)return jo(p,p.left<d.left)}}return l}if(!t.state.doc.resolve(e).parent.inlineContent){if(i&&(n<0||i==Co(o))){var f=o.childNodes[i-1];if(1==f.nodeType)return $o(f.getBoundingClientRect(),!1)}if(i<Co(o)){var h=o.childNodes[i];if(1==h.nodeType)return $o(h.getBoundingClientRect(),!0)}return $o(o.getBoundingClientRect(),n>=0)}if(i&&(n<0||i==Co(o))){var m=o.childNodes[i-1],v=3==m.nodeType?wo(m,Co(m)-(s?0:1)):1!=m.nodeType||"BR"==m.nodeName&&m.nextSibling?null:m;if(v)return jo(Fo(v,1),!1)}if(i<Co(o)){for(var g=o.childNodes[i];g.pmViewDesc&&g.pmViewDesc.ignoreForCoords;)g=g.nextSibling;var y=g?3==g.nodeType?wo(g,0,s?0:1):1==g.nodeType?g:null:null;if(y)return jo(Fo(y,-1),!0)}return jo(Fo(3==o.nodeType?wo(o):o,-n),n>=0)}function jo(t,e){if(0==t.width)return t;var n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function $o(t,e){if(0==t.height)return t;var n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function Wo(t,e,n){var r=t.state,o=t.root.activeElement;r!=e&&t.updateState(e),o!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),o!=t.dom&&o&&o.focus()}}var Ho=/[\u0590-\u08ac]/;var qo=null,Jo=null,Ko=!1;function Uo(t,e,n){return qo==e&&Jo==n?Ko:(qo=e,Jo=n,Ko="up"==n||"down"==n?function(t,e,n){var r=e.selection,o="up"==n?r.$from:r.$to;return Wo(t,e,(function(){for(var e=t.docView.domFromPos(o.pos,"up"==n?-1:1).node;;){var r=t.docView.nearestDesc(e,!0);if(!r)break;if(r.node.isBlock){e=r.dom;break}e=r.dom.parentNode}for(var i=Vo(t,o.pos,1),s=e.firstChild;s;s=s.nextSibling){var a=void 0;if(1==s.nodeType)a=s.getClientRects();else{if(3!=s.nodeType)continue;a=wo(s,0,s.nodeValue.length).getClientRects()}for(var c=0;c<a.length;c++){var u=a[c];if(u.bottom>u.top+1&&("up"==n?i.top-u.top>2*(u.bottom-i.top):u.bottom-i.bottom>2*(i.bottom-u.top)))return!1}}return!0}))}(t,e,n):function(t,e,n){var r=e.selection.$head;if(!r.parent.isTextblock)return!1;var o=r.parentOffset,i=!o,s=o==r.parent.content.size,a=t.root.getSelection();return Ho.test(r.parent.textContent)&&a.modify?Wo(t,e,(function(){var e=a.getRangeAt(0),o=a.focusNode,i=a.focusOffset,s=a.caretBidiLevel;a.modify("move",n,"character");var c=!(r.depth?t.docView.domAfterPos(r.before()):t.dom).contains(1==a.focusNode.nodeType?a.focusNode:a.focusNode.parentNode)||o==a.focusNode&&i==a.focusOffset;return a.removeAllRanges(),a.addRange(e),null!=s&&(a.caretBidiLevel=s),c})):"left"==n||"backward"==n?i:s}(t,e,n))}var Go=function(t,e,n,r){this.parent=t,this.children=e,this.dom=n,n.pmViewDesc=this,this.contentDOM=r,this.dirty=0},Yo={size:{configurable:!0},border:{configurable:!0},posBefore:{configurable:!0},posAtStart:{configurable:!0},posAfter:{configurable:!0},posAtEnd:{configurable:!0},contentLost:{configurable:!0},domAtom:{configurable:!0},ignoreForCoords:{configurable:!0}};Go.prototype.matchesWidget=function(){return!1},Go.prototype.matchesMark=function(){return!1},Go.prototype.matchesNode=function(){return!1},Go.prototype.matchesHack=function(t){return!1},Go.prototype.parseRule=function(){return null},Go.prototype.stopEvent=function(){return!1},Yo.size.get=function(){for(var t=0,e=0;e<this.children.length;e++)t+=this.children[e].size;return t},Yo.border.get=function(){return 0},Go.prototype.destroy=function(){this.parent=null,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=null);for(var t=0;t<this.children.length;t++)this.children[t].destroy()},Go.prototype.posBeforeChild=function(t){for(var e=0,n=this.posAtStart;e<this.children.length;e++){var r=this.children[e];if(r==t)return n;n+=r.size}},Yo.posBefore.get=function(){return this.parent.posBeforeChild(this)},Yo.posAtStart.get=function(){return this.parent?this.parent.posBeforeChild(this)+this.border:0},Yo.posAfter.get=function(){return this.posBefore+this.size},Yo.posAtEnd.get=function(){return this.posAtStart+this.size-2*this.border},Go.prototype.localPosFromDOM=function(t,e,n){if(this.contentDOM&&this.contentDOM.contains(1==t.nodeType?t:t.parentNode)){if(n<0){var r,o;if(t==this.contentDOM)r=t.childNodes[e-1];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;r=t.previousSibling}for(;r&&(!(o=r.pmViewDesc)||o.parent!=this);)r=r.previousSibling;return r?this.posBeforeChild(o)+o.size:this.posAtStart}var i,s;if(t==this.contentDOM)i=t.childNodes[e];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;i=t.nextSibling}for(;i&&(!(s=i.pmViewDesc)||s.parent!=this);)i=i.nextSibling;return i?this.posBeforeChild(s):this.posAtEnd}var a;if(t==this.dom&&this.contentDOM)a=e>go(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))a=2&t.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==e)for(var c=t;;c=c.parentNode){if(c==this.dom){a=!1;break}if(c.parentNode.firstChild!=c)break}if(null==a&&e==t.childNodes.length)for(var u=t;;u=u.parentNode){if(u==this.dom){a=!0;break}if(u.parentNode.lastChild!=u)break}}return(null==a?n>0:a)?this.posAtEnd:this.posAtStart},Go.prototype.nearestDesc=function(t,e){for(var n=!0,r=t;r;r=r.parentNode){var o=this.getDesc(r);if(o&&(!e||o.node)){if(!n||!o.nodeDOM||(1==o.nodeDOM.nodeType?o.nodeDOM.contains(1==t.nodeType?t:t.parentNode):o.nodeDOM==t))return o;n=!1}}},Go.prototype.getDesc=function(t){for(var e=t.pmViewDesc,n=e;n;n=n.parent)if(n==this)return e},Go.prototype.posFromDOM=function(t,e,n){for(var r=t;r;r=r.parentNode){var o=this.getDesc(r);if(o)return o.localPosFromDOM(t,e,n)}return-1},Go.prototype.descAt=function(t){for(var e=0,n=0;e<this.children.length;e++){var r=this.children[e],o=n+r.size;if(n==t&&o!=n){for(;!r.border&&r.children.length;)r=r.children[0];return r}if(t<o)return r.descAt(t-n-r.border);n=o}},Go.prototype.domFromPos=function(t,e){if(!this.contentDOM)return{node:this.dom,offset:0};for(var n=0,r=0,o=0;n<this.children.length;n++){var i=this.children[n],s=o+i.size;if(s>t||i instanceof oi){r=t-o;break}o=s}if(r)return this.children[n].domFromPos(r-this.children[n].border,e);for(var a=void 0;n&&!(a=this.children[n-1]).size&&a instanceof Zo&&a.widget.type.side>=0;n--);if(e<=0){for(var c,u=!0;(c=n?this.children[n-1]:null)&&c.dom.parentNode!=this.contentDOM;n--,u=!1);return c&&e&&u&&!c.border&&!c.domAtom?c.domFromPos(c.size,e):{node:this.contentDOM,offset:c?go(c.dom)+1:0}}for(var l,d=!0;(l=n<this.children.length?this.children[n]:null)&&l.dom.parentNode!=this.contentDOM;n++,d=!1);return l&&d&&!l.border&&!l.domAtom?l.domFromPos(0,e):{node:this.contentDOM,offset:l?go(l.dom):this.contentDOM.childNodes.length}},Go.prototype.parseRange=function(t,e,n){if(void 0===n&&(n=0),0==this.children.length)return{node:this.contentDOM,from:t,to:e,fromOffset:0,toOffset:this.contentDOM.childNodes.length};for(var r=-1,o=-1,i=n,s=0;;s++){var a=this.children[s],c=i+a.size;if(-1==r&&t<=c){var u=i+a.border;if(t>=u&&e<=c-a.border&&a.node&&a.contentDOM&&this.contentDOM.contains(a.contentDOM))return a.parseRange(t,e,u);t=i;for(var l=s;l>0;l--){var d=this.children[l-1];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(1)){r=go(d.dom)+1;break}t-=d.size}-1==r&&(r=0)}if(r>-1&&(c>e||s==this.children.length-1)){e=c;for(var p=s+1;p<this.children.length;p++){var f=this.children[p];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(-1)){o=go(f.dom);break}e+=f.size}-1==o&&(o=this.contentDOM.childNodes.length);break}i=c}return{node:this.contentDOM,from:t,to:e,fromOffset:r,toOffset:o}},Go.prototype.emptyChildAt=function(t){if(this.border||!this.contentDOM||!this.children.length)return!1;var e=this.children[t<0?0:this.children.length-1];return 0==e.size||e.emptyChildAt(t)},Go.prototype.domAfterPos=function(t){var e=this.domFromPos(t,0),n=e.node,r=e.offset;if(1!=n.nodeType||r==n.childNodes.length)throw new RangeError("No node after pos "+t);return n.childNodes[r]},Go.prototype.setSelection=function(t,e,n,r){for(var o=Math.min(t,e),i=Math.max(t,e),s=0,a=0;s<this.children.length;s++){var c=this.children[s],u=a+c.size;if(o>a&&i<u)return c.setSelection(t-a-c.border,e-a-c.border,n,r);a=u}var l=this.domFromPos(t,t?-1:1),d=e==t?l:this.domFromPos(e,e?-1:1),p=n.getSelection(),f=!1;if((lo.gecko||lo.safari)&&t==e){var h=l.node,m=l.offset;if(3==h.nodeType){if((f=m&&"\n"==h.nodeValue[m-1])&&m==h.nodeValue.length)for(var v=h,g=void 0;v;v=v.parentNode){if(g=v.nextSibling){"BR"==g.nodeName&&(l=d={node:g.parentNode,offset:go(g)+1});break}var y=v.pmViewDesc;if(y&&y.node&&y.node.isBlock)break}}else{var b=h.childNodes[m-1];f=b&&("BR"==b.nodeName||"false"==b.contentEditable)}}if(lo.gecko&&p.focusNode&&p.focusNode!=d.node&&1==p.focusNode.nodeType){var w=p.focusNode.childNodes[p.focusOffset];w&&"false"==w.contentEditable&&(r=!0)}if(r||f&&lo.safari||!_o(l.node,l.offset,p.anchorNode,p.anchorOffset)||!_o(d.node,d.offset,p.focusNode,p.focusOffset)){var _=!1;if((p.extend||t==e)&&!f){p.collapse(l.node,l.offset);try{t!=e&&p.extend(d.node,d.offset),_=!0}catch(t){if(!(t instanceof DOMException))throw t}}if(!_){if(t>e){var x=l;l=d,d=x}var k=document.createRange();k.setEnd(d.node,d.offset),k.setStart(l.node,l.offset),p.removeAllRanges(),p.addRange(k)}}},Go.prototype.ignoreMutation=function(t){return!this.contentDOM&&"selection"!=t.type},Yo.contentLost.get=function(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)},Go.prototype.markDirty=function(t,e){for(var n=0,r=0;r<this.children.length;r++){var o=this.children[r],i=n+o.size;if(n==i?t<=i&&e>=n:t<i&&e>n){var s=n+o.border,a=i-o.border;if(t>=s&&e<=a)return this.dirty=t==n||e==i?2:1,void(t!=s||e!=a||!o.contentLost&&o.dom.parentNode==this.contentDOM?o.markDirty(t-s,e-s):o.dirty=3);o.dirty=o.dom!=o.contentDOM||o.dom.parentNode!=this.contentDOM||o.children.length?3:2}n=i}this.dirty=2},Go.prototype.markParentsDirty=function(){for(var t=1,e=this.parent;e;e=e.parent,t++){var n=1==t?2:1;e.dirty<n&&(e.dirty=n)}},Yo.domAtom.get=function(){return!1},Yo.ignoreForCoords.get=function(){return!1},Object.defineProperties(Go.prototype,Yo);var Xo=[],Zo=function(t){function e(e,n,r,o){var i,s=n.type.toDOM;if("function"==typeof s&&(s=s(r,(function(){return i?i.parent?i.parent.posBeforeChild(i):void 0:o}))),!n.type.spec.raw){if(1!=s.nodeType){var a=document.createElement("span");a.appendChild(s),s=a}s.contentEditable=!1,s.classList.add("ProseMirror-widget")}t.call(this,e,Xo,s,null),this.widget=n,i=this}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={domAtom:{configurable:!0}};return e.prototype.matchesWidget=function(t){return 0==this.dirty&&t.type.eq(this.widget.type)},e.prototype.parseRule=function(){return{ignore:!0}},e.prototype.stopEvent=function(t){var e=this.widget.spec.stopEvent;return!!e&&e(t)},e.prototype.ignoreMutation=function(t){return"selection"!=t.type||this.widget.spec.ignoreSelection},e.prototype.destroy=function(){this.widget.type.destroy(this.dom),t.prototype.destroy.call(this)},n.domAtom.get=function(){return!0},Object.defineProperties(e.prototype,n),e}(Go),Qo=function(t){function e(e,n,r,o){t.call(this,e,Xo,n,null),this.textDOM=r,this.text=o}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={size:{configurable:!0}};return n.size.get=function(){return this.text.length},e.prototype.localPosFromDOM=function(t,e){return t!=this.textDOM?this.posAtStart+(e?this.size:0):this.posAtStart+e},e.prototype.domFromPos=function(t){return{node:this.textDOM,offset:t}},e.prototype.ignoreMutation=function(t){return"characterData"===t.type&&t.target.nodeValue==t.oldValue},Object.defineProperties(e.prototype,n),e}(Go),ti=function(t){function e(e,n,r,o){t.call(this,e,[],r,o),this.mark=n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.create=function(t,n,r,o){var i=o.nodeViews[n.type.name],s=i&&i(n,o,r);return s&&s.dom||(s=dt.renderSpec(document,n.type.spec.toDOM(n,r))),new e(t,n,s.dom,s.contentDOM||s.dom)},e.prototype.parseRule=function(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}},e.prototype.matchesMark=function(t){return 3!=this.dirty&&this.mark.eq(t)},e.prototype.markDirty=function(e,n){if(t.prototype.markDirty.call(this,e,n),0!=this.dirty){for(var r=this.parent;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=0}},e.prototype.slice=function(t,n,r){var o=e.create(this.parent,this.mark,!0,r),i=this.children,s=this.size;n<s&&(i=vi(i,n,s,r)),t>0&&(i=vi(i,0,t,r));for(var a=0;a<i.length;a++)i[a].parent=o;return o.children=i,o},e}(Go),ei=function(t){function e(e,n,r,o,i,s,a,c,u){t.call(this,e,n.isLeaf?Xo:[],i,s),this.nodeDOM=a,this.node=n,this.outerDeco=r,this.innerDeco=o,s&&this.updateChildren(c,u)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={size:{configurable:!0},border:{configurable:!0},domAtom:{configurable:!0}};return e.create=function(t,n,r,o,i,s){var a,c,u=i.nodeViews[n.type.name],l=u&&u(n,i,(function(){return c?c.parent?c.parent.posBeforeChild(c):void 0:s}),r,o),d=l&&l.dom,p=l&&l.contentDOM;if(n.isText)if(d){if(3!=d.nodeType)throw new RangeError("Text must be rendered as a DOM text node")}else d=document.createTextNode(n.text);else d||(d=(a=dt.renderSpec(document,n.type.spec.toDOM(n))).dom,p=a.contentDOM);p||n.isText||"BR"==d.nodeName||(d.hasAttribute("contenteditable")||(d.contentEditable=!1),n.type.spec.draggable&&(d.draggable=!0));var f=d;return d=di(d,r,n),l?c=new ii(t,n,r,o,d,p,f,l,i,s+1):n.isText?new ri(t,n,r,o,d,f,i):new e(t,n,r,o,d,p,f,i,s+1)},e.prototype.parseRule=function(){var t=this;if(this.node.type.spec.reparseInView)return null;var e={node:this.node.type.name,attrs:this.node.attrs};return"pre"==this.node.type.whitespace&&(e.preserveWhitespace="full"),this.contentDOM&&!this.contentLost?e.contentElement=this.contentDOM:e.getContent=function(){return t.contentDOM?i.empty:t.node.content},e},e.prototype.matchesNode=function(t,e,n){return 0==this.dirty&&t.eq(this.node)&&pi(e,this.outerDeco)&&n.eq(this.innerDeco)},n.size.get=function(){return this.node.nodeSize},n.border.get=function(){return this.node.isLeaf?0:1},e.prototype.updateChildren=function(t,e){var n=this,r=this.node.inlineContent,o=e,i=t.composing&&this.localCompositionInfo(t,e),s=i&&i.pos>-1?i:null,a=i&&i.pos<0,c=new hi(this,s&&s.node);!function(t,e,n,r){var o=e.locals(t),i=0;if(0==o.length){for(var s=0;s<t.childCount;s++){var a=t.child(s);r(a,o,e.forChild(i,a),s),i+=a.nodeSize}return}for(var c=0,u=[],l=null,d=0;;){if(c<o.length&&o[c].to==i){for(var p=o[c++],f=void 0;c<o.length&&o[c].to==i;)(f||(f=[p])).push(o[c++]);if(f){f.sort(mi);for(var h=0;h<f.length;h++)n(f[h],d,!!l)}else n(p,d,!!l)}var m=void 0,v=void 0;if(l)v=-1,m=l,l=null;else{if(!(d<t.childCount))break;v=d,m=t.child(d++)}for(var g=0;g<u.length;g++)u[g].to<=i&&u.splice(g--,1);for(;c<o.length&&o[c].from<=i&&o[c].to>i;)u.push(o[c++]);var y=i+m.nodeSize;if(m.isText){var b=y;c<o.length&&o[c].from<b&&(b=o[c].from);for(var w=0;w<u.length;w++)u[w].to<b&&(b=u[w].to);b<y&&(l=m.cut(b-i),m=m.cut(0,b-i),y=b,v=-1)}var _=u.length?m.isInline&&!m.isLeaf?u.filter((function(t){return!t.inline})):u.slice():Xo;r(m,_,e.forChild(i,m),v),i=y}}(this.node,this.innerDeco,(function(e,i,s){e.spec.marks?c.syncToMarks(e.spec.marks,r,t):e.type.side>=0&&!s&&c.syncToMarks(i==n.node.childCount?l.none:n.node.child(i).marks,r,t),c.placeWidget(e,t,o)}),(function(e,n,s,u){var l;c.syncToMarks(e.marks,r,t),c.findNodeMatch(e,n,s,u)||a&&t.state.selection.from>o&&t.state.selection.to<o+e.nodeSize&&(l=c.findIndexWithChild(i.node))>-1&&c.updateNodeAt(e,n,s,l,t)||c.updateNextNode(e,n,s,t,u)||c.addNode(e,n,s,t,o),o+=e.nodeSize})),c.syncToMarks(Xo,r,t),this.node.isTextblock&&c.addTextblockHacks(),c.destroyRest(),(c.changed||2==this.dirty)&&(s&&this.protectLocalComposition(t,s),function t(e,n,r){for(var o=e.firstChild,i=!1,s=0;s<n.length;s++){var a=n[s],c=a.dom;if(c.parentNode==e){for(;c!=o;)o=fi(o),i=!0;o=o.nextSibling}else i=!0,e.insertBefore(c,o);if(a instanceof ti){var u=o?o.previousSibling:e.lastChild;t(a.contentDOM,a.children,r),o=u?u.nextSibling:e.firstChild}}for(;o;)o=fi(o),i=!0;i&&r.trackWrites==e&&(r.trackWrites=null)}(this.contentDOM,this.children,t),lo.ios&&function(t){if("UL"==t.nodeName||"OL"==t.nodeName){var e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}(this.dom))},e.prototype.localCompositionInfo=function(t,e){var n=t.state.selection,r=n.from,o=n.to;if(!(!(t.state.selection instanceof re)||r<e||o>e+this.node.content.size)){var i=t.root.getSelection(),s=function(t,e){for(;;){if(3==t.nodeType)return t;if(1==t.nodeType&&e>0){if(t.childNodes.length>e&&3==t.childNodes[e].nodeType)return t.childNodes[e];t=t.childNodes[e-1],e=Co(t)}else{if(!(1==t.nodeType&&e<t.childNodes.length))return null;t=t.childNodes[e],e=0}}}(i.focusNode,i.focusOffset);if(s&&this.dom.contains(s.parentNode)){if(this.node.inlineContent){var a=s.nodeValue,c=function(t,e,n,r){for(var o=0,i=0;o<t.childCount&&i<=r;){var s=t.child(o++),a=i;if(i+=s.nodeSize,s.isText){for(var c=s.text;o<t.childCount;){var u=t.child(o++);if(i+=u.nodeSize,!u.isText)break;c+=u.text}if(i>=n&&a<r){var l=c.lastIndexOf(e,r-a-1);if(l>=0&&l+e.length+a>=n)return a+l}}}return-1}(this.node.content,a,r-e,o-e);return c<0?null:{node:s,pos:c,text:a}}return{node:s,pos:-1}}}},e.prototype.protectLocalComposition=function(t,e){var n=e.node,r=e.pos,o=e.text;if(!this.getDesc(n)){for(var i=n;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=null)}var s=new Qo(this,i,n,o);t.compositionNodes.push(s),this.children=vi(this.children,r,r+o.length,t,s)}},e.prototype.update=function(t,e,n,r){return!(3==this.dirty||!t.sameMarkup(this.node))&&(this.updateInner(t,e,n,r),!0)},e.prototype.updateInner=function(t,e,n,r){this.updateOuterDeco(e),this.node=t,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=0},e.prototype.updateOuterDeco=function(t){if(!pi(t,this.outerDeco)){var e=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=ui(this.dom,this.nodeDOM,ci(this.outerDeco,this.node,e),ci(t,this.node,e)),this.dom!=n&&(n.pmViewDesc=null,this.dom.pmViewDesc=this),this.outerDeco=t}},e.prototype.selectNode=function(){this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.dom.draggable=!0)},e.prototype.deselectNode=function(){this.nodeDOM.classList.remove("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||this.dom.removeAttribute("draggable")},n.domAtom.get=function(){return this.node.isAtom},Object.defineProperties(e.prototype,n),e}(Go);function ni(t,e,n,r,o){return di(r,e,t),new ei(null,t,e,n,r,r,r,o,0)}var ri=function(t){function e(e,n,r,o,i,s,a){t.call(this,e,n,r,o,i,null,s,a)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={domAtom:{configurable:!0}};return e.prototype.parseRule=function(){for(var t=this.nodeDOM.parentNode;t&&t!=this.dom&&!t.pmIsDeco;)t=t.parentNode;return{skip:t||!0}},e.prototype.update=function(t,e,n,r){return!(3==this.dirty||0!=this.dirty&&!this.inParent()||!t.sameMarkup(this.node))&&(this.updateOuterDeco(e),0==this.dirty&&t.text==this.node.text||t.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=t.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=t,this.dirty=0,!0)},e.prototype.inParent=function(){for(var t=this.parent.contentDOM,e=this.nodeDOM;e;e=e.parentNode)if(e==t)return!0;return!1},e.prototype.domFromPos=function(t){return{node:this.nodeDOM,offset:t}},e.prototype.localPosFromDOM=function(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):t.prototype.localPosFromDOM.call(this,e,n,r)},e.prototype.ignoreMutation=function(t){return"characterData"!=t.type&&"selection"!=t.type},e.prototype.slice=function(t,n,r){var o=this.node.cut(t,n),i=document.createTextNode(o.text);return new e(this.parent,o,this.outerDeco,this.innerDeco,i,i,r)},e.prototype.markDirty=function(e,n){t.prototype.markDirty.call(this,e,n),this.dom==this.nodeDOM||0!=e&&n!=this.nodeDOM.nodeValue.length||(this.dirty=3)},n.domAtom.get=function(){return!1},Object.defineProperties(e.prototype,n),e}(ei),oi=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={domAtom:{configurable:!0},ignoreForCoords:{configurable:!0}};return e.prototype.parseRule=function(){return{ignore:!0}},e.prototype.matchesHack=function(t){return 0==this.dirty&&this.dom.nodeName==t},n.domAtom.get=function(){return!0},n.ignoreForCoords.get=function(){return"IMG"==this.dom.nodeName},Object.defineProperties(e.prototype,n),e}(Go),ii=function(t){function e(e,n,r,o,i,s,a,c,u,l){t.call(this,e,n,r,o,i,s,a,u,l),this.spec=c}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.update=function(e,n,r,o){if(3==this.dirty)return!1;if(this.spec.update){var i=this.spec.update(e,n,r);return i&&this.updateInner(e,n,r,o),i}return!(!this.contentDOM&&!e.isLeaf)&&t.prototype.update.call(this,e,n,r,o)},e.prototype.selectNode=function(){this.spec.selectNode?this.spec.selectNode():t.prototype.selectNode.call(this)},e.prototype.deselectNode=function(){this.spec.deselectNode?this.spec.deselectNode():t.prototype.deselectNode.call(this)},e.prototype.setSelection=function(e,n,r,o){this.spec.setSelection?this.spec.setSelection(e,n,r):t.prototype.setSelection.call(this,e,n,r,o)},e.prototype.destroy=function(){this.spec.destroy&&this.spec.destroy(),t.prototype.destroy.call(this)},e.prototype.stopEvent=function(t){return!!this.spec.stopEvent&&this.spec.stopEvent(t)},e.prototype.ignoreMutation=function(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):t.prototype.ignoreMutation.call(this,e)},e}(ei);function si(t){t&&(this.nodeName=t)}si.prototype=Object.create(null);var ai=[new si];function ci(t,e,n){if(0==t.length)return ai;for(var r=n?ai[0]:new si,o=[r],i=0;i<t.length;i++){var s=t[i].type.attrs;if(s)for(var a in s.nodeName&&o.push(r=new si(s.nodeName)),s){var c=s[a];null!=c&&(n&&1==o.length&&o.push(r=new si(e.isInline?"span":"div")),"class"==a?r.class=(r.class?r.class+" ":"")+c:"style"==a?r.style=(r.style?r.style+";":"")+c:"nodeName"!=a&&(r[a]=c))}}return o}function ui(t,e,n,r){if(n==ai&&r==ai)return e;for(var o=e,i=0;i<r.length;i++){var s=r[i],a=n[i];if(i){var c=void 0;a&&a.nodeName==s.nodeName&&o!=t&&(c=o.parentNode)&&c.tagName.toLowerCase()==s.nodeName||((c=document.createElement(s.nodeName)).pmIsDeco=!0,c.appendChild(o),a=ai[0]),o=c}li(o,a||ai[0],s)}return o}function li(t,e,n){for(var r in e)"class"==r||"style"==r||"nodeName"==r||r in n||t.removeAttribute(r);for(var o in n)"class"!=o&&"style"!=o&&"nodeName"!=o&&n[o]!=e[o]&&t.setAttribute(o,n[o]);if(e.class!=n.class){for(var i=e.class?e.class.split(" ").filter(Boolean):Xo,s=n.class?n.class.split(" ").filter(Boolean):Xo,a=0;a<i.length;a++)-1==s.indexOf(i[a])&&t.classList.remove(i[a]);for(var c=0;c<s.length;c++)-1==i.indexOf(s[c])&&t.classList.add(s[c]);0==t.classList.length&&t.removeAttribute("class")}if(e.style!=n.style){if(e.style)for(var u,l=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g;u=l.exec(e.style);)t.style.removeProperty(u[1]);n.style&&(t.style.cssText+=n.style)}}function di(t,e,n){return ui(t,t,ai,ci(e,n,1!=t.nodeType))}function pi(t,e){if(t.length!=e.length)return!1;for(var n=0;n<t.length;n++)if(!t[n].type.eq(e[n].type))return!1;return!0}function fi(t){var e=t.nextSibling;return t.parentNode.removeChild(t),e}var hi=function(t,e){this.top=t,this.lock=e,this.index=0,this.stack=[],this.changed=!1,this.preMatch=function(t,e){var n=e,r=n.children.length,o=t.childCount,i=new Map,s=[];t:for(;o>0;){for(var a=void 0;;)if(r){var c=n.children[r-1];if(!(c instanceof ti)){a=c,r--;break}n=c,r=c.children.length}else{if(n==e)break t;r=n.parent.children.indexOf(n),n=n.parent}var u=a.node;if(u){if(u!=t.child(o-1))break;--o,i.set(a,o),s.push(a)}}return{index:o,matched:i,matches:s.reverse()}}(t.node.content,t)};function mi(t,e){return t.type.side-e.type.side}function vi(t,e,n,r,o){for(var i=[],s=0,a=0;s<t.length;s++){var c=t[s],u=a,l=a+=c.size;u>=n||l<=e?i.push(c):(u<e&&i.push(c.slice(0,e-u,r)),o&&(i.push(o),o=null),l>n&&i.push(c.slice(n-u,c.size,r)))}return i}function gi(t,e){var n=t.root.getSelection(),r=t.state.doc;if(!n.focusNode)return null;var o=t.docView.nearestDesc(n.focusNode),i=o&&0==o.size,s=t.docView.posFromDOM(n.focusNode,n.focusOffset);if(s<0)return null;var a,c,u=r.resolve(s);if(To(n)){for(a=u;o&&!o.node;)o=o.parent;if(o&&o.node.isAtom&&ie.isSelectable(o.node)&&o.parent&&(!o.node.isInline||!function(t,e,n){for(var r=0==e,o=e==Co(t);r||o;){if(t==n)return!0;var i=go(t);if(!(t=t.parentNode))return!1;r=r&&0==i,o=o&&i==Co(t)}}(n.focusNode,n.focusOffset,o.dom))){var l=o.posBefore;c=new ie(s==l?u:r.resolve(l))}}else{var d=t.docView.posFromDOM(n.anchorNode,n.anchorOffset);if(d<0)return null;a=r.resolve(d)}c||(c=Ti(t,a,u,"pointer"==e||t.state.selection.head<u.pos&&!i?1:-1));return c}function yi(t){return t.editable?t.hasFocus():Ei(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function bi(t,e){var n=t.state.selection;if(Ci(t,n),yi(t)){if(!e&&t.mouseDown&&t.mouseDown.allowDefault&&lo.chrome){var r=t.root.getSelection(),o=t.domObserver.currentSelection;if(r.anchorNode&&_o(r.anchorNode,r.anchorOffset,o.anchorNode,o.anchorOffset))return t.mouseDown.delayedSelectionSync=!0,void t.domObserver.setCurSelection()}if(t.domObserver.disconnectSelection(),t.cursorWrapper)!function(t){var e=t.root.getSelection(),n=document.createRange(),r=t.cursorWrapper.dom,o="IMG"==r.nodeName;o?n.setEnd(r.parentNode,go(r)+1):n.setEnd(r,0);n.collapse(!1),e.removeAllRanges(),e.addRange(n),!o&&!t.state.selection.visible&&lo.ie&&lo.ie_version<=11&&(r.disabled=!0,r.disabled=!1)}(t);else{var i,s,a=n.anchor,c=n.head;!wi||n instanceof re||(n.$from.parent.inlineContent||(i=_i(t,n.from)),n.empty||n.$from.parent.inlineContent||(s=_i(t,n.to))),t.docView.setSelection(a,c,t.root,e),wi&&(i&&ki(i),s&&ki(s)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&function(t){var e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.hideSelectionGuard);var n=t.root.getSelection(),r=n.anchorNode,o=n.anchorOffset;e.addEventListener("selectionchange",t.hideSelectionGuard=function(){n.anchorNode==r&&n.anchorOffset==o||(e.removeEventListener("selectionchange",t.hideSelectionGuard),setTimeout((function(){yi(t)&&!t.state.selection.visible||t.dom.classList.remove("ProseMirror-hideselection")}),20))})}(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}hi.prototype.destroyBetween=function(t,e){if(t!=e){for(var n=t;n<e;n++)this.top.children[n].destroy();this.top.children.splice(t,e-t),this.changed=!0}},hi.prototype.destroyRest=function(){this.destroyBetween(this.index,this.top.children.length)},hi.prototype.syncToMarks=function(t,e,n){for(var r=0,o=this.stack.length>>1,i=Math.min(o,t.length);r<i&&(r==o-1?this.top:this.stack[r+1<<1]).matchesMark(t[r])&&!1!==t[r].type.spec.spanning;)r++;for(;r<o;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<t.length;){this.stack.push(this.top,this.index+1);for(var s=-1,a=this.index;a<Math.min(this.index+3,this.top.children.length);a++)if(this.top.children[a].matchesMark(t[o])){s=a;break}if(s>-1)s>this.index&&(this.changed=!0,this.destroyBetween(this.index,s)),this.top=this.top.children[this.index];else{var c=ti.create(this.top,t[o],e,n);this.top.children.splice(this.index,0,c),this.top=c,this.changed=!0}this.index=0,o++}},hi.prototype.findNodeMatch=function(t,e,n,r){var o,i=-1;if(r>=this.preMatch.index&&(o=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&o.matchesNode(t,e,n))i=this.top.children.indexOf(o,this.index);else for(var s=this.index,a=Math.min(this.top.children.length,s+5);s<a;s++){var c=this.top.children[s];if(c.matchesNode(t,e,n)&&!this.preMatch.matched.has(c)){i=s;break}}return!(i<0)&&(this.destroyBetween(this.index,i),this.index++,!0)},hi.prototype.updateNodeAt=function(t,e,n,r,o){return!!this.top.children[r].update(t,e,n,o)&&(this.destroyBetween(this.index,r),this.index=r+1,!0)},hi.prototype.findIndexWithChild=function(t){for(;;){var e=t.parentNode;if(!e)return-1;if(e==this.top.contentDOM){var n=t.pmViewDesc;if(n)for(var r=this.index;r<this.top.children.length;r++)if(this.top.children[r]==n)return r;return-1}t=e}},hi.prototype.updateNextNode=function(t,e,n,r,o){for(var i=this.index;i<this.top.children.length;i++){var s=this.top.children[i];if(s instanceof ei){var a=this.preMatch.matched.get(s);if(null!=a&&a!=o)return!1;var c=s.dom;if(!(this.lock&&(c==this.lock||1==c.nodeType&&c.contains(this.lock.parentNode))&&!(t.isText&&s.node&&s.node.isText&&s.nodeDOM.nodeValue==t.text&&3!=s.dirty&&pi(e,s.outerDeco)))&&s.update(t,e,n,r))return this.destroyBetween(this.index,i),s.dom!=c&&(this.changed=!0),this.index++,!0;break}}return!1},hi.prototype.addNode=function(t,e,n,r,o){this.top.children.splice(this.index++,0,ei.create(this.top,t,e,n,r,o)),this.changed=!0},hi.prototype.placeWidget=function(t,e,n){var r=this.index<this.top.children.length?this.top.children[this.index]:null;if(!r||!r.matchesWidget(t)||t!=r.widget&&r.widget.type.toDOM.parentNode){var o=new Zo(this.top,t,e,n);this.top.children.splice(this.index++,0,o),this.changed=!0}else this.index++},hi.prototype.addTextblockHacks=function(){for(var t=this.top.children[this.index-1];t instanceof ti;)t=t.children[t.children.length-1];t&&t instanceof ri&&!/\n$/.test(t.node.text)||((lo.safari||lo.chrome)&&t&&"false"==t.dom.contentEditable&&this.addHackNode("IMG"),this.addHackNode("BR"))},hi.prototype.addHackNode=function(t){if(this.index<this.top.children.length&&this.top.children[this.index].matchesHack(t))this.index++;else{var e=document.createElement(t);"IMG"==t&&(e.className="ProseMirror-separator"),"BR"==t&&(e.className="ProseMirror-trailingBreak"),this.top.children.splice(this.index++,0,new oi(this.top,Xo,e,null)),this.changed=!0}};var wi=lo.safari||lo.chrome&&lo.chrome_version<63;function _i(t,e){var n=t.docView.domFromPos(e,0),r=n.node,o=n.offset,i=o<r.childNodes.length?r.childNodes[o]:null,s=o?r.childNodes[o-1]:null;if(lo.safari&&i&&"false"==i.contentEditable)return xi(i);if(!(i&&"false"!=i.contentEditable||s&&"false"!=s.contentEditable)){if(i)return xi(i);if(s)return xi(s)}}function xi(t){return t.contentEditable="true",lo.safari&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function ki(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function Ci(t,e){if(e instanceof ie){var n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(Si(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else Si(t)}function Si(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=null)}function Ti(t,e,n,r){return t.someProp("createSelectionBetween",(function(r){return r(t,e,n)}))||re.between(e,n,r)}function Ei(t){var e=t.root.getSelection();if(!e.anchorNode)return!1;try{return t.dom.contains(3==e.anchorNode.nodeType?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(3==e.focusNode.nodeType?e.focusNode.parentNode:e.focusNode))}catch(t){return!1}}function Mi(t,e){var n=t.selection,r=n.$anchor,o=n.$head,i=e>0?r.max(o):r.min(o),s=i.parent.inlineContent?i.depth?t.doc.resolve(e>0?i.after():i.before()):null:i;return s&&te.findFrom(s,e)}function Oi(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function Di(t,e,n){var r=t.state.selection;if(!(r instanceof re)){if(r instanceof ie&&r.node.isInline)return Oi(t,new re(e>0?r.$to:r.$from));var o=Mi(t.state,e);return!!o&&Oi(t,o)}if(!r.empty||n.indexOf("s")>-1)return!1;if(t.endOfTextblock(e>0?"right":"left")){var i=Mi(t.state,e);return!!(i&&i instanceof ie)&&Oi(t,i)}if(!(lo.mac&&n.indexOf("m")>-1)){var s,a=r.$head,c=a.textOffset?null:e<0?a.nodeBefore:a.nodeAfter;if(!c||c.isText)return!1;var u=e<0?a.pos-c.nodeSize:a.pos;return!!(c.isAtom||(s=t.docView.descAt(u))&&!s.contentDOM)&&(ie.isSelectable(c)?Oi(t,new ie(e<0?t.state.doc.resolve(a.pos-c.nodeSize):a)):!!lo.webkit&&Oi(t,new re(t.state.doc.resolve(e<0?u:u+c.nodeSize))))}}function Ii(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function Ai(t){var e=t.pmViewDesc;return e&&0==e.size&&(t.nextSibling||"BR"!=t.nodeName)}function Ni(t){var e=t.root.getSelection(),n=e.focusNode,r=e.focusOffset;if(n){var o,i,s=!1;for(lo.gecko&&1==n.nodeType&&r<Ii(n)&&Ai(n.childNodes[r])&&(s=!0);;)if(r>0){if(1!=n.nodeType)break;var a=n.childNodes[r-1];if(Ai(a))o=n,i=--r;else{if(3!=a.nodeType)break;r=(n=a).nodeValue.length}}else{if(zi(n))break;for(var c=n.previousSibling;c&&Ai(c);)o=n.parentNode,i=go(c),c=c.previousSibling;if(c)r=Ii(n=c);else{if((n=n.parentNode)==t.dom)break;r=0}}s?Pi(t,e,n,r):o&&Pi(t,e,o,i)}}function Bi(t){var e=t.root.getSelection(),n=e.focusNode,r=e.focusOffset;if(n){for(var o,i,s=Ii(n);;)if(r<s){if(1!=n.nodeType)break;if(!Ai(n.childNodes[r]))break;o=n,i=++r}else{if(zi(n))break;for(var a=n.nextSibling;a&&Ai(a);)o=a.parentNode,i=go(a)+1,a=a.nextSibling;if(a)r=0,s=Ii(n=a);else{if((n=n.parentNode)==t.dom)break;r=s=0}}o&&Pi(t,e,o,i)}}function zi(t){var e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function Pi(t,e,n,r){if(To(e)){var o=document.createRange();o.setEnd(n,r),o.setStart(n,r),e.removeAllRanges(),e.addRange(o)}else e.extend&&e.extend(n,r);t.domObserver.setCurSelection();var i=t.state;setTimeout((function(){t.state==i&&bi(t)}),50)}function Ri(t,e,n){var r=t.state.selection;if(r instanceof re&&!r.empty||n.indexOf("s")>-1)return!1;if(lo.mac&&n.indexOf("m")>-1)return!1;var o=r.$from,i=r.$to;if(!o.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){var s=Mi(t.state,e);if(s&&s instanceof ie)return Oi(t,s)}if(!o.parent.inlineContent){var a=e<0?o:i,c=r instanceof ae?te.near(a,e):te.findFrom(a,e);return!!c&&Oi(t,c)}return!1}function Fi(t,e){if(!(t.state.selection instanceof re))return!0;var n=t.state.selection,r=n.$head,o=n.$anchor,i=n.empty;if(!r.sameParent(o))return!0;if(!i)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;var s=!r.textOffset&&(e<0?r.nodeBefore:r.nodeAfter);if(s&&!s.isText){var a=t.state.tr;return e<0?a.delete(r.pos-s.nodeSize,r.pos):a.delete(r.pos,r.pos+s.nodeSize),t.dispatch(a),!0}return!1}function Li(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function Vi(t,e){var n=e.keyCode,r=function(t){var e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}(e);return 8==n||lo.mac&&72==n&&"c"==r?Fi(t,-1)||Ni(t):46==n||lo.mac&&68==n&&"c"==r?Fi(t,1)||Bi(t):13==n||27==n||(37==n?Di(t,-1,r)||Ni(t):39==n?Di(t,1,r)||Bi(t):38==n?Ri(t,-1,r)||Ni(t):40==n?function(t){if(lo.safari&&!(t.state.selection.$head.parentOffset>0)){var e=t.root.getSelection(),n=e.focusNode,r=e.focusOffset;if(n&&1==n.nodeType&&0==r&&n.firstChild&&"false"==n.firstChild.contentEditable){var o=n.firstChild;Li(t,o,!0),setTimeout((function(){return Li(t,o,!1)}),20)}}}(t)||Ri(t,1,r)||Bi(t):r==(lo.mac?"m":"c")&&(66==n||73==n||89==n||90==n))}function ji(t){var e=t.pmViewDesc;if(e)return e.parseRule();if("BR"==t.nodeName&&t.parentNode){if(lo.safari&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){var n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}if(t.parentNode.lastChild==t||lo.safari&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if("IMG"==t.nodeName&&t.getAttribute("mark-placeholder"))return{ignore:!0}}function $i(t,e,n,r,o){if(e<0){var s=t.lastSelectionTime>Date.now()-50?t.lastSelectionOrigin:null,a=gi(t,s);if(a&&!t.state.selection.eq(a)){var c=t.state.tr.setSelection(a);"pointer"==s?c.setMeta("pointer",!0):"key"==s&&c.scrollIntoView(),t.dispatch(c)}}else{var u=t.state.doc.resolve(e),l=u.sharedDepth(n);e=u.before(l+1),n=t.state.doc.resolve(n).after(l+1);var d=t.state.selection,p=function(t,e,n){var r=t.docView.parseRange(e,n),o=r.node,i=r.fromOffset,s=r.toOffset,a=r.from,c=r.to,u=t.root.getSelection(),l=null,d=u.anchorNode;if(d&&t.dom.contains(1==d.nodeType?d:d.parentNode)&&(l=[{node:d,offset:u.anchorOffset}],To(u)||l.push({node:u.focusNode,offset:u.focusOffset})),lo.chrome&&8===t.lastKeyCode)for(var p=s;p>i;p--){var f=o.childNodes[p-1],h=f.pmViewDesc;if("BR"==f.nodeName&&!h){s=p;break}if(!h||h.size)break}var m=t.state.doc,v=t.someProp("domParser")||tt.fromSchema(t.state.schema),g=m.resolve(a),y=null,b=v.parse(o,{topNode:g.parent,topMatch:g.parent.contentMatchAt(g.index()),topOpen:!0,from:i,to:s,preserveWhitespace:"pre"!=g.parent.type.whitespace||"full",editableContent:!0,findPositions:l,ruleFromNode:ji,context:g});if(l&&null!=l[0].pos){var w=l[0].pos,_=l[1]&&l[1].pos;null==_&&(_=w),y={anchor:w+a,head:_+a}}return{doc:b,sel:y,from:a,to:c}}(t,e,n);if(lo.chrome&&t.cursorWrapper&&p.sel&&p.sel.anchor==t.cursorWrapper.deco.from){var f=t.cursorWrapper.deco.type.toDOM.nextSibling,h=f&&f.nodeValue?f.nodeValue.length:1;p.sel={anchor:p.sel.anchor+h,head:p.sel.anchor+h}}var m,v,g=t.state.doc,y=g.slice(p.from,p.to);8===t.lastKeyCode&&Date.now()-100<t.lastKeyCodeTime?(m=t.state.selection.to,v="end"):(m=t.state.selection.from,v="start"),t.lastKeyCode=null;var b=function(t,e,n,r,o){var i=t.findDiffStart(e,n);if(null==i)return null;var s=t.findDiffEnd(e,n+t.size,n+e.size),a=s.a,c=s.b;if("end"==o){var u=Math.max(0,i-Math.min(a,c));r-=a+u-i}if(a<i&&t.size<e.size){c=(i-=r<=i&&r>=a?i-r:0)+(c-a),a=i}else if(c<i){a=(i-=r<=i&&r>=c?i-r:0)+(a-c),c=i}return{start:i,endA:a,endB:c}}(y.content,p.doc.content,p.from,m,v);if(!b){if(!(r&&d instanceof re&&!d.empty&&d.$head.sameParent(d.$anchor))||t.composing||p.sel&&p.sel.anchor!=p.sel.head){if((lo.ios&&t.lastIOSEnter>Date.now()-225||lo.android)&&o.some((function(t){return"DIV"==t.nodeName||"P"==t.nodeName}))&&t.someProp("handleKeyDown",(function(e){return e(t,Eo(13,"Enter"))})))return void(t.lastIOSEnter=0);if(p.sel){var w=Wi(t,t.state.doc,p.sel);w&&!w.eq(t.state.selection)&&t.dispatch(t.state.tr.setSelection(w))}return}b={start:d.from,endA:d.to,endB:d.to}}t.domChangeCount++,t.state.selection.from<t.state.selection.to&&b.start==b.endB&&t.state.selection instanceof re&&(b.start>t.state.selection.from&&b.start<=t.state.selection.from+2?b.start=t.state.selection.from:b.endA<t.state.selection.to&&b.endA>=t.state.selection.to-2&&(b.endB+=t.state.selection.to-b.endA,b.endA=t.state.selection.to)),lo.ie&&lo.ie_version<=11&&b.endB==b.start+1&&b.endA==b.start&&b.start>p.from&&"  "==p.doc.textBetween(b.start-p.from-1,b.start-p.from+1)&&(b.start--,b.endA--,b.endB--);var _,x=p.doc.resolveNoCache(b.start-p.from),k=p.doc.resolveNoCache(b.endB-p.from),C=x.sameParent(k)&&x.parent.inlineContent;if((lo.ios&&t.lastIOSEnter>Date.now()-225&&(!C||o.some((function(t){return"DIV"==t.nodeName||"P"==t.nodeName})))||!C&&x.pos<p.doc.content.size&&(_=te.findFrom(p.doc.resolve(x.pos+1),1,!0))&&_.head==k.pos)&&t.someProp("handleKeyDown",(function(e){return e(t,Eo(13,"Enter"))})))t.lastIOSEnter=0;else if(t.state.selection.anchor>b.start&&function(t,e,n,r,o){if(!r.parent.isTextblock||n-e<=o.pos-r.pos||Hi(r,!0,!1)<o.pos)return!1;var i=t.resolve(e);if(i.parentOffset<i.parent.content.size||!i.parent.isTextblock)return!1;var s=t.resolve(Hi(i,!0,!0));if(!s.parent.isTextblock||s.pos>n||Hi(s,!0,!1)<n)return!1;return r.parent.content.cut(r.parentOffset).eq(s.parent.content)}(g,b.start,b.endA,x,k)&&t.someProp("handleKeyDown",(function(e){return e(t,Eo(8,"Backspace"))})))lo.android&&lo.chrome&&t.domObserver.suppressSelectionUpdates();else{lo.chrome&&lo.android&&b.toB==b.from&&(t.lastAndroidDelete=Date.now()),lo.android&&!C&&x.start()!=k.start()&&0==k.parentOffset&&x.depth==k.depth&&p.sel&&p.sel.anchor==p.sel.head&&p.sel.head==b.endA&&(b.endB-=2,k=p.doc.resolveNoCache(b.endB-p.from),setTimeout((function(){t.someProp("handleKeyDown",(function(e){return e(t,Eo(13,"Enter"))}))}),20));var S,T,E,M,O=b.start,D=b.endA;if(C)if(x.pos==k.pos)lo.ie&&lo.ie_version<=11&&0==x.parentOffset&&(t.domObserver.suppressSelectionUpdates(),setTimeout((function(){return bi(t)}),20)),S=t.state.tr.delete(O,D),T=g.resolve(b.start).marksAcross(g.resolve(b.endA));else if(b.endA==b.endB&&(M=g.resolve(b.start))&&(E=function(t,e){for(var n,r,o,s=t.firstChild.marks,a=e.firstChild.marks,c=s,u=a,l=0;l<a.length;l++)c=a[l].removeFromSet(c);for(var d=0;d<s.length;d++)u=s[d].removeFromSet(u);if(1==c.length&&0==u.length)r=c[0],n="add",o=function(t){return t.mark(r.addToSet(t.marks))};else{if(0!=c.length||1!=u.length)return null;r=u[0],n="remove",o=function(t){return t.mark(r.removeFromSet(t.marks))}}for(var p=[],f=0;f<e.childCount;f++)p.push(o(e.child(f)));if(i.from(p).eq(t))return{mark:r,type:n}}(x.parent.content.cut(x.parentOffset,k.parentOffset),M.parent.content.cut(M.parentOffset,b.endA-M.start()))))S=t.state.tr,"add"==E.type?S.addMark(O,D,E.mark):S.removeMark(O,D,E.mark);else if(x.parent.child(x.index()).isText&&x.index()==k.index()-(k.textOffset?0:1)){var I=x.parent.textBetween(x.parentOffset,k.parentOffset);if(t.someProp("handleTextInput",(function(e){return e(t,O,D,I)})))return;S=t.state.tr.insertText(I,O,D)}if(S||(S=t.state.tr.replace(O,D,p.doc.slice(b.start-p.from,b.endB-p.from))),p.sel){var A=Wi(t,S.doc,p.sel);A&&!(lo.chrome&&lo.android&&t.composing&&A.empty&&(b.start!=b.endB||t.lastAndroidDelete<Date.now()-100)&&(A.head==O||A.head==S.mapping.map(D)-1)||lo.ie&&A.empty&&A.head==O)&&S.setSelection(A)}T&&S.ensureMarks(T),t.dispatch(S.scrollIntoView())}}}function Wi(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:Ti(t,e.resolve(n.anchor),e.resolve(n.head))}function Hi(t,e,n){for(var r=t.depth,o=e?t.end():t.pos;r>0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,o++,e=!1;if(n)for(var i=t.node(r).maybeChild(t.indexAfter(r));i&&!i.isLeaf;)i=i.firstChild,o++;return o}function qi(t,e){for(var n=[],r=e.content,o=e.openStart,i=e.openEnd;o>1&&i>1&&1==r.childCount&&1==r.firstChild.childCount;){o--,i--;var s=r.firstChild;n.push(s.type.name,s.attrs!=s.type.defaultAttrs?s.attrs:null),r=s.content}var a=t.someProp("clipboardSerializer")||dt.fromSchema(t.state.schema),c=Qi(),u=c.createElement("div");u.appendChild(a.serializeFragment(r,{document:c}));for(var l,d=u.firstChild;d&&1==d.nodeType&&(l=Xi[d.nodeName.toLowerCase()]);){for(var p=l.length-1;p>=0;p--){for(var f=c.createElement(l[p]);u.firstChild;)f.appendChild(u.firstChild);u.appendChild(f),"tbody"!=l[p]&&(o++,i++)}d=u.firstChild}return d&&1==d.nodeType&&d.setAttribute("data-pm-slice",o+" "+i+" "+JSON.stringify(n)),{dom:u,text:t.someProp("clipboardTextSerializer",(function(t){return t(e)}))||e.content.textBetween(0,e.content.size,"\n\n")}}function Ji(t,e,n,r,o){var s,a,c=o.parent.type.spec.code;if(!n&&!e)return null;var u=e&&(r||c||!n);if(u){if(t.someProp("transformPastedText",(function(t){e=t(e,c||r)})),c)return e?new p(i.from(t.state.schema.text(e.replace(/\r\n?/g,"\n"))),0,0):p.empty;var l=t.someProp("clipboardTextParser",(function(t){return t(e,o,r)}));if(l)a=l;else{var d=o.marks(),f=t.state.schema,h=dt.fromSchema(f);s=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach((function(t){var e=s.appendChild(document.createElement("p"));t&&e.appendChild(h.serializeNode(f.text(t,d)))}))}}else t.someProp("transformPastedHTML",(function(t){n=t(n)})),s=function(t){var e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));var n,r=Qi().createElement("div"),o=/<([a-z][^>\s]+)/i.exec(t);(n=o&&Xi[o[1].toLowerCase()])&&(t=n.map((function(t){return"<"+t+">"})).join("")+t+n.map((function(t){return"</"+t+">"})).reverse().join(""));if(r.innerHTML=t,n)for(var i=0;i<n.length;i++)r=r.querySelector(n[i])||r;return r}(n),lo.webkit&&function(t){for(var e=t.querySelectorAll(lo.chrome?"span:not([class]):not([style])":"span.Apple-converted-space"),n=0;n<e.length;n++){var r=e[n];1==r.childNodes.length&&" "==r.textContent&&r.parentNode&&r.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),r)}}(s);var m=s&&s.querySelector("[data-pm-slice]"),v=m&&/^(\d+) (\d+) (.*)/.exec(m.getAttribute("data-pm-slice"));if(!a){var g=t.someProp("clipboardParser")||t.someProp("domParser")||tt.fromSchema(t.state.schema);a=g.parseSlice(s,{preserveWhitespace:!(!u&&!v),context:o,ruleFromNode:function(t){if("BR"==t.nodeName&&!t.nextSibling&&t.parentNode&&!Ki.test(t.parentNode.nodeName))return{ignore:!0}}})}if(v)a=function(t,e){if(!t.size)return t;var n,r=t.content.firstChild.type.schema;try{n=JSON.parse(e)}catch(e){return t}for(var o=t.content,s=t.openStart,a=t.openEnd,c=n.length-2;c>=0;c-=2){var u=r.nodes[n[c]];if(!u||u.hasRequiredAttrs())break;o=i.from(u.create(n[c+1],o)),s++,a++}return new p(o,s,a)}(Yi(a,+v[1],+v[2]),v[3]);else if((a=p.maxOpen(function(t,e){if(t.childCount<2)return t;for(var n=function(n){var r=e.node(n).contentMatchAt(e.index(n)),o=void 0,s=[];if(t.forEach((function(t){if(s){var e,n=r.findWrapping(t.type);if(!n)return s=null;if(e=s.length&&o.length&&function t(e,n,r,o,s){if(s<e.length&&s<n.length&&e[s]==n[s]){var a=t(e,n,r,o.lastChild,s+1);if(a)return o.copy(o.content.replaceChild(o.childCount-1,a));if(o.contentMatchAt(o.childCount).matchType(s==e.length-1?r.type:e[s+1]))return o.copy(o.content.append(i.from(Ui(r,e,s+1))))}}(n,o,t,s[s.length-1],0))s[s.length-1]=e;else{s.length&&(s[s.length-1]=function t(e,n){if(0==n)return e;var r=e.content.replaceChild(e.childCount-1,t(e.lastChild,n-1)),o=e.contentMatchAt(e.childCount).fillBefore(i.empty,!0);return e.copy(r.append(o))}(s[s.length-1],o.length));var a=Ui(t,n);s.push(a),r=r.matchType(a.type,a.attrs),o=n}}})),s)return{v:i.from(s)}},r=e.depth;r>=0;r--){var o=n(r);if(o)return o.v}return t}(a.content,o),!0)).openStart||a.openEnd){for(var y=0,b=0,w=a.content.firstChild;y<a.openStart&&!w.type.spec.isolating;y++,w=w.firstChild);for(var _=a.content.lastChild;b<a.openEnd&&!_.type.spec.isolating;b++,_=_.lastChild);a=Yi(a,y,b)}return t.someProp("transformPasted",(function(t){a=t(a)})),a}var Ki=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function Ui(t,e,n){void 0===n&&(n=0);for(var r=e.length-1;r>=n;r--)t=e[r].create(null,i.from(t));return t}function Gi(t,e,n,r,o,s){var a=e<0?t.firstChild:t.lastChild,c=a.content;return o<r-1&&(c=Gi(c,e,n,r,o+1,s)),o>=n&&(c=e<0?a.contentMatchAt(0).fillBefore(c,t.childCount>1||s<=o).append(c):c.append(a.contentMatchAt(a.childCount).fillBefore(i.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,a.copy(c))}function Yi(t,e,n){return e<t.openStart&&(t=new p(Gi(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new p(Gi(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}var Xi={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]},Zi=null;function Qi(){return Zi||(Zi=document.implementation.createHTMLDocument("title"))}var ts={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},es=lo.ie&&lo.ie_version<=11,ns=function(){this.anchorNode=this.anchorOffset=this.focusNode=this.focusOffset=null};ns.prototype.set=function(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset},ns.prototype.eq=function(t){return t.anchorNode==this.anchorNode&&t.anchorOffset==this.anchorOffset&&t.focusNode==this.focusNode&&t.focusOffset==this.focusOffset};var rs=function(t,e){var n=this;this.view=t,this.handleDOMChange=e,this.queue=[],this.flushingSoon=-1,this.observer=window.MutationObserver&&new window.MutationObserver((function(t){for(var e=0;e<t.length;e++)n.queue.push(t[e]);lo.ie&&lo.ie_version<=11&&t.some((function(t){return"childList"==t.type&&t.removedNodes.length||"characterData"==t.type&&t.oldValue.length>t.target.nodeValue.length}))?n.flushSoon():n.flush()})),this.currentSelection=new ns,es&&(this.onCharData=function(t){n.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),n.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.suppressingSelectionUpdates=!1};rs.prototype.flushSoon=function(){var t=this;this.flushingSoon<0&&(this.flushingSoon=window.setTimeout((function(){t.flushingSoon=-1,t.flush()}),20))},rs.prototype.forceFlush=function(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())},rs.prototype.start=function(){this.observer&&this.observer.observe(this.view.dom,ts),es&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()},rs.prototype.stop=function(){var t=this;if(this.observer){var e=this.observer.takeRecords();if(e.length){for(var n=0;n<e.length;n++)this.queue.push(e[n]);window.setTimeout((function(){return t.flush()}),20)}this.observer.disconnect()}es&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()},rs.prototype.connectSelection=function(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)},rs.prototype.disconnectSelection=function(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)},rs.prototype.suppressSelectionUpdates=function(){var t=this;this.suppressingSelectionUpdates=!0,setTimeout((function(){return t.suppressingSelectionUpdates=!1}),50)},rs.prototype.onSelectionChange=function(){if((!(t=this.view).editable||t.root.activeElement==t.dom)&&Ei(t)){var t;if(this.suppressingSelectionUpdates)return bi(this.view);if(lo.ie&&lo.ie_version<=11&&!this.view.state.selection.empty){var e=this.view.root.getSelection();if(e.focusNode&&_o(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}},rs.prototype.setCurSelection=function(){this.currentSelection.set(this.view.root.getSelection())},rs.prototype.ignoreSelectionChange=function(t){if(0==t.rangeCount)return!0;var e=t.getRangeAt(0).commonAncestorContainer,n=this.view.docView.nearestDesc(e);return n&&n.ignoreMutation({type:"selection",target:3==e.nodeType?e.parentNode:e})?(this.setCurSelection(),!0):void 0},rs.prototype.flush=function(){if(this.view.docView&&!(this.flushingSoon>-1)){var t=this.observer?this.observer.takeRecords():[];this.queue.length&&(t=this.queue.concat(t),this.queue.length=0);var e=this.view.root.getSelection(),n=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(e)&&Ei(this.view)&&!this.ignoreSelectionChange(e),r=-1,o=-1,i=!1,s=[];if(this.view.editable)for(var a=0;a<t.length;a++){var c=this.registerMutation(t[a],s);c&&(r=r<0?c.from:Math.min(c.from,r),o=o<0?c.to:Math.max(c.to,o),c.typeOver&&(i=!0))}if(lo.gecko&&s.length>1){var u=s.filter((function(t){return"BR"==t.nodeName}));if(2==u.length){var l=u[0],d=u[1];l.parentNode&&l.parentNode.parentNode==d.parentNode?d.remove():l.remove()}}(r>-1||n)&&(r>-1&&(this.view.docView.markDirty(r,o),function(t){if(is)return;is=!0,"normal"==getComputedStyle(t.dom).whiteSpace&&console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package.")}(this.view)),this.handleDOMChange(r,o,i,s),this.view.docView.dirty?this.view.updateState(this.view.state):this.currentSelection.eq(e)||bi(this.view),this.currentSelection.set(e))}},rs.prototype.registerMutation=function(t,e){if(e.indexOf(t.target)>-1)return null;var n=this.view.docView.nearestDesc(t.target);if("attributes"==t.type&&(n==this.view.docView||"contenteditable"==t.attributeName||"style"==t.attributeName&&!t.oldValue&&!t.target.getAttribute("style")))return null;if(!n||n.ignoreMutation(t))return null;if("childList"==t.type){for(var r=0;r<t.addedNodes.length;r++)e.push(t.addedNodes[r]);if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(t.target))return{from:n.posBefore,to:n.posAfter};var o=t.previousSibling,i=t.nextSibling;if(lo.ie&&lo.ie_version<=11&&t.addedNodes.length)for(var s=0;s<t.addedNodes.length;s++){var a=t.addedNodes[s],c=a.previousSibling,u=a.nextSibling;(!c||Array.prototype.indexOf.call(t.addedNodes,c)<0)&&(o=c),(!u||Array.prototype.indexOf.call(t.addedNodes,u)<0)&&(i=u)}var l=o&&o.parentNode==t.target?go(o)+1:0,d=n.localPosFromDOM(t.target,l,-1),p=i&&i.parentNode==t.target?go(i):t.target.childNodes.length;return{from:d,to:n.localPosFromDOM(t.target,p,1)}}return"attributes"==t.type?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:{from:n.posAtStart,to:n.posAtEnd,typeOver:t.target.nodeValue==t.oldValue}};var is=!1;var ss={},as={};function cs(t,e){t.lastSelectionOrigin=e,t.lastSelectionTime=Date.now()}function us(t){t.someProp("handleDOMEvents",(function(e){for(var n in e)t.eventHandlers[n]||t.dom.addEventListener(n,t.eventHandlers[n]=function(e){return ls(t,e)})}))}function ls(t,e){return t.someProp("handleDOMEvents",(function(n){var r=n[e.type];return!!r&&(r(t,e)||e.defaultPrevented)}))}function ds(t){return{left:t.clientX,top:t.clientY}}function ps(t,e,n,r,o){if(-1==r)return!1;for(var i=t.state.doc.resolve(r),s=function(r){if(t.someProp(e,(function(e){return r>i.depth?e(t,n,i.nodeAfter,i.before(r),o,!0):e(t,n,i.node(r),i.before(r),o,!1)})))return{v:!0}},a=i.depth+1;a>0;a--){var c=s(a);if(c)return c.v}return!1}function fs(t,e,n){t.focused||t.focus();var r=t.state.tr.setSelection(e);"pointer"==n&&r.setMeta("pointer",!0),t.dispatch(r)}function hs(t,e,n,r,o){return ps(t,"handleClickOn",e,n,r)||t.someProp("handleClick",(function(n){return n(t,e,r)}))||(o?function(t,e){if(-1==e)return!1;var n,r,o=t.state.selection;o instanceof ie&&(n=o.node);for(var i=t.state.doc.resolve(e),s=i.depth+1;s>0;s--){var a=s>i.depth?i.nodeAfter:i.node(s);if(ie.isSelectable(a)){r=n&&o.$from.depth>0&&s>=o.$from.depth&&i.before(o.$from.depth+1)==o.$from.pos?i.before(o.$from.depth):i.before(s);break}}return null!=r&&(fs(t,ie.create(t.state.doc,r),"pointer"),!0)}(t,n):function(t,e){if(-1==e)return!1;var n=t.state.doc.resolve(e),r=n.nodeAfter;return!!(r&&r.isAtom&&ie.isSelectable(r))&&(fs(t,new ie(n),"pointer"),!0)}(t,n))}function ms(t,e,n,r){return ps(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",(function(n){return n(t,e,r)}))}function vs(t,e,n,r){return ps(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",(function(n){return n(t,e,r)}))||function(t,e,n){if(0!=n.button)return!1;var r=t.state.doc;if(-1==e)return!!r.inlineContent&&(fs(t,re.create(r,0,r.content.size),"pointer"),!0);for(var o=r.resolve(e),i=o.depth+1;i>0;i--){var s=i>o.depth?o.nodeAfter:o.node(i),a=o.before(i);if(s.inlineContent)fs(t,re.create(r,a+1,a+1+s.content.size),"pointer");else{if(!ie.isSelectable(s))continue;fs(t,ie.create(r,a),"pointer")}return!0}}(t,n,r)}function gs(t){return Cs(t)}as.keydown=function(t,e){if(t.shiftKey=16==e.keyCode||e.shiftKey,!ws(t,e)&&(t.lastKeyCode=e.keyCode,t.lastKeyCodeTime=Date.now(),!lo.android||!lo.chrome||13!=e.keyCode))if(229!=e.keyCode&&t.domObserver.forceFlush(),!lo.ios||13!=e.keyCode||e.ctrlKey||e.altKey||e.metaKey)t.someProp("handleKeyDown",(function(n){return n(t,e)}))||Vi(t,e)?e.preventDefault():cs(t,"key");else{var n=Date.now();t.lastIOSEnter=n,t.lastIOSEnterFallbackTimeout=setTimeout((function(){t.lastIOSEnter==n&&(t.someProp("handleKeyDown",(function(e){return e(t,Eo(13,"Enter"))})),t.lastIOSEnter=0)}),200)}},as.keyup=function(t,e){16==e.keyCode&&(t.shiftKey=!1)},as.keypress=function(t,e){if(!(ws(t,e)||!e.charCode||e.ctrlKey&&!e.altKey||lo.mac&&e.metaKey))if(t.someProp("handleKeyPress",(function(n){return n(t,e)})))e.preventDefault();else{var n=t.state.selection;if(!(n instanceof re&&n.$from.sameParent(n.$to))){var r=String.fromCharCode(e.charCode);t.someProp("handleTextInput",(function(e){return e(t,n.$from.pos,n.$to.pos,r)}))||t.dispatch(t.state.tr.insertText(r).scrollIntoView()),e.preventDefault()}}};var ys=lo.mac?"metaKey":"ctrlKey";ss.mousedown=function(t,e){t.shiftKey=e.shiftKey;var n=gs(t),r=Date.now(),o="singleClick";r-t.lastClick.time<500&&function(t,e){var n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}(e,t.lastClick)&&!e[ys]&&("singleClick"==t.lastClick.type?o="doubleClick":"doubleClick"==t.lastClick.type&&(o="tripleClick")),t.lastClick={time:r,x:e.clientX,y:e.clientY,type:o};var i=t.posAtCoords(ds(e));i&&("singleClick"==o?(t.mouseDown&&t.mouseDown.done(),t.mouseDown=new bs(t,i,e,n)):("doubleClick"==o?ms:vs)(t,i.pos,i.inside,e)?e.preventDefault():cs(t,"pointer"))};var bs=function(t,e,n,r){var o,i,s=this;if(this.view=t,this.startDoc=t.state.doc,this.pos=e,this.event=n,this.flushed=r,this.selectNode=n[ys],this.allowDefault=n.shiftKey,this.delayedSelectionSync=!1,e.inside>-1)o=t.state.doc.nodeAt(e.inside),i=e.inside;else{var a=t.state.doc.resolve(e.pos);o=a.parent,i=a.depth?a.before():0}this.mightDrag=null;var c=r?null:n.target,u=c?t.docView.nearestDesc(c,!0):null;this.target=u?u.dom:null;var l=t.state.selection;(0==n.button&&o.type.spec.draggable&&!1!==o.type.spec.selectable||l instanceof ie&&l.from<=i&&l.to>i)&&(this.mightDrag={node:o,pos:i,addAttr:this.target&&!this.target.draggable,setUneditable:this.target&&lo.gecko&&!this.target.hasAttribute("contentEditable")}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout((function(){s.view.mouseDown==s&&s.target.setAttribute("contentEditable","false")}),20),this.view.domObserver.start()),t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),cs(t,"pointer")};function ws(t,e){return!!t.composing||!!(lo.safari&&Math.abs(e.timeStamp-t.compositionEndedAt)<500)&&(t.compositionEndedAt=-2e8,!0)}bs.prototype.done=function(){var t=this;this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout((function(){return bi(t.view)})),this.view.mouseDown=null},bs.prototype.up=function(t){if(this.done(),this.view.dom.contains(3==t.target.nodeType?t.target.parentNode:t.target)){var e=this.pos;this.view.state.doc!=this.startDoc&&(e=this.view.posAtCoords(ds(t))),this.allowDefault||!e?cs(this.view,"pointer"):hs(this.view,e.pos,e.inside,t,this.selectNode)?t.preventDefault():0==t.button&&(this.flushed||lo.safari&&this.mightDrag&&!this.mightDrag.node.isAtom||lo.chrome&&!(this.view.state.selection instanceof re)&&Math.min(Math.abs(e.pos-this.view.state.selection.from),Math.abs(e.pos-this.view.state.selection.to))<=2)?(fs(this.view,te.near(this.view.state.doc.resolve(e.pos)),"pointer"),t.preventDefault()):cs(this.view,"pointer")}},bs.prototype.move=function(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0),cs(this.view,"pointer"),0==t.buttons&&this.done()},ss.touchdown=function(t){gs(t),cs(t,"pointer")},ss.contextmenu=function(t){return gs(t)};var _s=lo.android?5e3:-1;function xs(t,e){clearTimeout(t.composingTimeout),e>-1&&(t.composingTimeout=setTimeout((function(){return Cs(t)}),e))}function ks(t){var e;for(t.composing&&(t.composing=!1,t.compositionEndedAt=((e=document.createEvent("Event")).initEvent("event",!0,!0),e.timeStamp));t.compositionNodes.length>0;)t.compositionNodes.pop().markParentsDirty()}function Cs(t,e){if(!(lo.android&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),ks(t),e||t.docView.dirty){var n=gi(t);return n&&!n.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(n)):t.updateState(t.state),!0}return!1}}as.compositionstart=as.compositionupdate=function(t){if(!t.composing){t.domObserver.flush();var e=t.state,n=e.selection.$from;if(e.selection.empty&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some((function(t){return!1===t.type.spec.inclusive}))))t.markCursor=t.state.storedMarks||n.marks(),Cs(t,!0),t.markCursor=null;else if(Cs(t),lo.gecko&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length)for(var r=t.root.getSelection(),o=r.focusNode,i=r.focusOffset;o&&1==o.nodeType&&0!=i;){var s=i<0?o.lastChild:o.childNodes[i-1];if(!s)break;if(3==s.nodeType){r.collapse(s,s.nodeValue.length);break}o=s,i=-1}t.composing=!0}xs(t,_s)},as.compositionend=function(t,e){t.composing&&(t.composing=!1,t.compositionEndedAt=e.timeStamp,xs(t,20))};var Ss=lo.ie&&lo.ie_version<15||lo.ios&&lo.webkit_version<604;function Ts(t,e,n,r){var o=Ji(t,e,n,t.shiftKey,t.state.selection.$from);if(t.someProp("handlePaste",(function(e){return e(t,r,o||p.empty)})))return!0;if(!o)return!1;var i=function(t){return 0==t.openStart&&0==t.openEnd&&1==t.content.childCount?t.content.firstChild:null}(o),s=i?t.state.tr.replaceSelectionWith(i,t.shiftKey):t.state.tr.replaceSelection(o);return t.dispatch(s.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}ss.copy=as.cut=function(t,e){var n=t.state.selection,r="cut"==e.type;if(!n.empty){var o=Ss?null:e.clipboardData,i=qi(t,n.content()),s=i.dom,a=i.text;o?(e.preventDefault(),o.clearData(),o.setData("text/html",s.innerHTML),o.setData("text/plain",a)):function(t,e){if(t.dom.parentNode){var n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";var r=getSelection(),o=document.createRange();o.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout((function(){n.parentNode&&n.parentNode.removeChild(n),t.focus()}),50)}}(t,s),r&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))}},as.paste=function(t,e){if(!t.composing||lo.android){var n=Ss?null:e.clipboardData;n&&Ts(t,n.getData("text/plain"),n.getData("text/html"),e)?e.preventDefault():function(t,e){if(t.dom.parentNode){var n=t.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus(),setTimeout((function(){t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Ts(t,r.value,null,e):Ts(t,r.textContent,r.innerHTML,e)}),50)}}(t,e)}};var Es=function(t,e){this.slice=t,this.move=e},Ms=lo.mac?"altKey":"ctrlKey";for(var Os in ss.dragstart=function(t,e){var n=t.mouseDown;if(n&&n.done(),e.dataTransfer){var r=t.state.selection,o=r.empty?null:t.posAtCoords(ds(e));if(o&&o.pos>=r.from&&o.pos<=(r instanceof ie?r.to-1:r.to));else if(n&&n.mightDrag)t.dispatch(t.state.tr.setSelection(ie.create(t.state.doc,n.mightDrag.pos)));else if(e.target&&1==e.target.nodeType){var i=t.docView.nearestDesc(e.target,!0);i&&i.node.type.spec.draggable&&i!=t.docView&&t.dispatch(t.state.tr.setSelection(ie.create(t.state.doc,i.posBefore)))}var s=t.state.selection.content(),a=qi(t,s),c=a.dom,u=a.text;e.dataTransfer.clearData(),e.dataTransfer.setData(Ss?"Text":"text/html",c.innerHTML),e.dataTransfer.effectAllowed="copyMove",Ss||e.dataTransfer.setData("text/plain",u),t.dragging=new Es(s,!e[Ms])}},ss.dragend=function(t){var e=t.dragging;window.setTimeout((function(){t.dragging==e&&(t.dragging=null)}),50)},as.dragover=as.dragenter=function(t,e){return e.preventDefault()},as.drop=function(t,e){var n=t.dragging;if(t.dragging=null,e.dataTransfer){var r=t.posAtCoords(ds(e));if(r){var o=t.state.doc.resolve(r.pos);if(o){var i=n&&n.slice;i?t.someProp("transformPasted",(function(t){i=t(i)})):i=Ji(t,e.dataTransfer.getData(Ss?"Text":"text/plain"),Ss?null:e.dataTransfer.getData("text/html"),!1,o);var s=n&&!e[Ms];if(t.someProp("handleDrop",(function(n){return n(t,e,i||p.empty,s)})))e.preventDefault();else if(i){e.preventDefault();var a=i?Ft(t.state.doc,o.pos,i):o.pos;null==a&&(a=o.pos);var c=t.state.tr;s&&c.deleteSelection();var u=c.mapping.map(a),l=0==i.openStart&&0==i.openEnd&&1==i.content.childCount,d=c.doc;if(l?c.replaceRangeWith(u,u,i.content.firstChild):c.replaceRange(u,u,i),!c.doc.eq(d)){var f=c.doc.resolve(u);if(l&&ie.isSelectable(i.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(i.content.firstChild))c.setSelection(new ie(f));else{var h=c.mapping.map(a);c.mapping.maps[c.mapping.maps.length-1].forEach((function(t,e,n,r){return h=r})),c.setSelection(Ti(t,f,c.doc.resolve(h)))}t.focus(),t.dispatch(c.setMeta("uiEvent","drop"))}}}}}},ss.focus=function(t){t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout((function(){t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.root.getSelection())&&bi(t)}),20))},ss.blur=function(t,e){t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),e.relatedTarget&&t.dom.contains(e.relatedTarget)&&t.domObserver.currentSelection.set({}),t.focused=!1)},ss.beforeinput=function(t,e){if(lo.chrome&&lo.android&&"deleteContentBackward"==e.inputType){t.domObserver.flushSoon();var n=t.domChangeCount;setTimeout((function(){if(t.domChangeCount==n&&(t.dom.blur(),t.focus(),!t.someProp("handleKeyDown",(function(e){return e(t,Eo(8,"Backspace"))})))){var e=t.state.selection.$cursor;e&&e.pos>0&&t.dispatch(t.state.tr.delete(e.pos-1,e.pos).scrollIntoView())}}),50)}},as)ss[Os]=as[Os];function Ds(t,e){if(t==e)return!0;for(var n in t)if(t[n]!==e[n])return!1;for(var r in e)if(!(r in t))return!1;return!0}var Is=function(t,e){this.spec=e||Rs,this.side=this.spec.side||0,this.toDOM=t};Is.prototype.map=function(t,e,n,r){var o=t.mapResult(e.from+r,this.side<0?-1:1),i=o.pos;return o.deleted?null:new Bs(i-n,i-n,this)},Is.prototype.valid=function(){return!0},Is.prototype.eq=function(t){return this==t||t instanceof Is&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&Ds(this.spec,t.spec))},Is.prototype.destroy=function(t){this.spec.destroy&&this.spec.destroy(t)};var As=function(t,e){this.spec=e||Rs,this.attrs=t};As.prototype.map=function(t,e,n,r){var o=t.map(e.from+r,this.spec.inclusiveStart?-1:1)-n,i=t.map(e.to+r,this.spec.inclusiveEnd?1:-1)-n;return o>=i?null:new Bs(o,i,this)},As.prototype.valid=function(t,e){return e.from<e.to},As.prototype.eq=function(t){return this==t||t instanceof As&&Ds(this.attrs,t.attrs)&&Ds(this.spec,t.spec)},As.is=function(t){return t.type instanceof As};var Ns=function(t,e){this.spec=e||Rs,this.attrs=t};Ns.prototype.map=function(t,e,n,r){var o=t.mapResult(e.from+r,1);if(o.deleted)return null;var i=t.mapResult(e.to+r,-1);return i.deleted||i.pos<=o.pos?null:new Bs(o.pos-n,i.pos-n,this)},Ns.prototype.valid=function(t,e){var n,r=t.content.findIndex(e.from),o=r.index,i=r.offset;return i==e.from&&!(n=t.child(o)).isText&&i+n.nodeSize==e.to},Ns.prototype.eq=function(t){return this==t||t instanceof Ns&&Ds(this.attrs,t.attrs)&&Ds(this.spec,t.spec)};var Bs=function(t,e,n){this.from=t,this.to=e,this.type=n},zs={spec:{configurable:!0},inline:{configurable:!0}};Bs.prototype.copy=function(t,e){return new Bs(t,e,this.type)},Bs.prototype.eq=function(t,e){return void 0===e&&(e=0),this.type.eq(t.type)&&this.from+e==t.from&&this.to+e==t.to},Bs.prototype.map=function(t,e,n){return this.type.map(t,this,e,n)},Bs.widget=function(t,e,n){return new Bs(t,t,new Is(e,n))},Bs.inline=function(t,e,n,r){return new Bs(t,e,new As(n,r))},Bs.node=function(t,e,n,r){return new Bs(t,e,new Ns(n,r))},zs.spec.get=function(){return this.type.spec},zs.inline.get=function(){return this.type instanceof As},Object.defineProperties(Bs.prototype,zs);var Ps=[],Rs={},Fs=function(t,e){this.local=t&&t.length?t:Ps,this.children=e&&e.length?e:Ps};Fs.create=function(t,e){return e.length?Hs(e,t,0,Rs):Ls},Fs.prototype.find=function(t,e,n){var r=[];return this.findInner(null==t?0:t,null==e?1e9:e,r,0,n),r},Fs.prototype.findInner=function(t,e,n,r,o){for(var i=0;i<this.local.length;i++){var s=this.local[i];s.from<=e&&s.to>=t&&(!o||o(s.spec))&&n.push(s.copy(s.from+r,s.to+r))}for(var a=0;a<this.children.length;a+=3)if(this.children[a]<e&&this.children[a+1]>t){var c=this.children[a]+1;this.children[a+2].findInner(t-c,e-c,n,r+c,o)}},Fs.prototype.map=function(t,e,n){return this==Ls||0==t.maps.length?this:this.mapInner(t,e,0,0,n||Rs)},Fs.prototype.mapInner=function(t,e,n,r,o){for(var i,s=0;s<this.local.length;s++){var a=this.local[s].map(t,n,r);a&&a.type.valid(e,a)?(i||(i=[])).push(a):o.onRemove&&o.onRemove(this.local[s].spec)}return this.children.length?function(t,e,n,r,o,i,s){for(var a=t.slice(),c=function(t,e,n,r){for(var s=0;s<a.length;s+=3){var c=a[s+1],u=void 0;-1==c||t>c+i||(e>=a[s]+i?a[s+1]=-1:n>=o&&(u=r-n-(e-t))&&(a[s]+=u,a[s+1]+=u))}},u=0;u<n.maps.length;u++)n.maps[u].forEach(c);for(var l=!1,d=0;d<a.length;d+=3)if(-1==a[d+1]){var p=n.map(t[d]+i),f=p-o;if(f<0||f>=r.content.size){l=!0;continue}var h=n.map(t[d+1]+i,-1)-o,m=r.content.findIndex(f),v=m.index,g=m.offset,y=r.maybeChild(v);if(y&&g==f&&g+y.nodeSize==h){var b=a[d+2].mapInner(n,y,p+1,t[d]+i+1,s);b!=Ls?(a[d]=f,a[d+1]=h,a[d+2]=b):(a[d+1]=-2,l=!0)}else l=!0}if(l){var w=Hs(function(t,e,n,r,o,i,s){function a(t,e){for(var i=0;i<t.local.length;i++){var c=t.local[i].map(r,o,e);c?n.push(c):s.onRemove&&s.onRemove(t.local[i].spec)}for(var u=0;u<t.children.length;u+=3)a(t.children[u+2],t.children[u]+e+1)}for(var c=0;c<t.length;c+=3)-1==t[c+1]&&a(t[c+2],e[c]+i+1);return n}(a,t,e||[],n,o,i,s),r,0,s);e=w.local;for(var _=0;_<a.length;_+=3)a[_+1]<0&&(a.splice(_,3),_-=3);for(var x=0,k=0;x<w.children.length;x+=3){for(var C=w.children[x];k<a.length&&a[k]<C;)k+=3;a.splice(k,0,w.children[x],w.children[x+1],w.children[x+2])}}return new Fs(e&&e.sort(qs),a)}(this.children,i,t,e,n,r,o):i?new Fs(i.sort(qs)):Ls},Fs.prototype.add=function(t,e){return e.length?this==Ls?Fs.create(t,e):this.addInner(t,e,0):this},Fs.prototype.addInner=function(t,e,n){var r,o=this,i=0;t.forEach((function(t,s){var a,c=s+n;if(a=$s(e,t,c)){for(r||(r=o.children.slice());i<r.length&&r[i]<s;)i+=3;r[i]==s?r[i+2]=r[i+2].addInner(t,a,c+1):r.splice(i,0,s,s+t.nodeSize,Hs(a,t,c+1,Rs)),i+=3}}));for(var s=js(i?Ws(e):e,-n),a=0;a<s.length;a++)s[a].type.valid(t,s[a])||s.splice(a--,1);return new Fs(s.length?this.local.concat(s).sort(qs):this.local,r||this.children)},Fs.prototype.remove=function(t){return 0==t.length||this==Ls?this:this.removeInner(t,0)},Fs.prototype.removeInner=function(t,e){for(var n=this.children,r=this.local,o=0;o<n.length;o+=3){for(var i=void 0,s=n[o]+e,a=n[o+1]+e,c=0,u=void 0;c<t.length;c++)(u=t[c])&&u.from>s&&u.to<a&&(t[c]=null,(i||(i=[])).push(u));if(i){n==this.children&&(n=this.children.slice());var l=n[o+2].removeInner(i,s+1);l!=Ls?n[o+2]=l:(n.splice(o,3),o-=3)}}if(r.length)for(var d=0,p=void 0;d<t.length;d++)if(p=t[d])for(var f=0;f<r.length;f++)r[f].eq(p,e)&&(r==this.local&&(r=this.local.slice()),r.splice(f--,1));return n==this.children&&r==this.local?this:r.length||n.length?new Fs(r,n):Ls},Fs.prototype.forChild=function(t,e){if(this==Ls)return this;if(e.isLeaf)return Fs.empty;for(var n,r,o=0;o<this.children.length;o+=3)if(this.children[o]>=t){this.children[o]==t&&(n=this.children[o+2]);break}for(var i=t+1,s=i+e.content.size,a=0;a<this.local.length;a++){var c=this.local[a];if(c.from<s&&c.to>i&&c.type instanceof As){var u=Math.max(i,c.from)-i,l=Math.min(s,c.to)-i;u<l&&(r||(r=[])).push(c.copy(u,l))}}if(r){var d=new Fs(r.sort(qs));return n?new Vs([d,n]):d}return n||Ls},Fs.prototype.eq=function(t){if(this==t)return!0;if(!(t instanceof Fs)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(var e=0;e<this.local.length;e++)if(!this.local[e].eq(t.local[e]))return!1;for(var n=0;n<this.children.length;n+=3)if(this.children[n]!=t.children[n]||this.children[n+1]!=t.children[n+1]||!this.children[n+2].eq(t.children[n+2]))return!1;return!0},Fs.prototype.locals=function(t){return Js(this.localsInner(t))},Fs.prototype.localsInner=function(t){if(this==Ls)return Ps;if(t.inlineContent||!this.local.some(As.is))return this.local;for(var e=[],n=0;n<this.local.length;n++)this.local[n].type instanceof As||e.push(this.local[n]);return e};var Ls=new Fs;Fs.empty=Ls,Fs.removeOverlap=Js;var Vs=function(t){this.members=t};function js(t,e){if(!e||!t.length)return t;for(var n=[],r=0;r<t.length;r++){var o=t[r];n.push(new Bs(o.from+e,o.to+e,o.type))}return n}function $s(t,e,n){if(e.isLeaf)return null;for(var r=n+e.nodeSize,o=null,i=0,s=void 0;i<t.length;i++)(s=t[i])&&s.from>n&&s.to<r&&((o||(o=[])).push(s),t[i]=null);return o}function Ws(t){for(var e=[],n=0;n<t.length;n++)null!=t[n]&&e.push(t[n]);return e}function Hs(t,e,n,r){var o=[],i=!1;e.forEach((function(e,s){var a=$s(t,e,s+n);if(a){i=!0;var c=Hs(a,e,n+s+1,r);c!=Ls&&o.push(s,s+e.nodeSize,c)}}));for(var s=js(i?Ws(t):t,-n).sort(qs),a=0;a<s.length;a++)s[a].type.valid(e,s[a])||(r.onRemove&&r.onRemove(s[a].spec),s.splice(a--,1));return s.length||o.length?new Fs(s,o):Ls}function qs(t,e){return t.from-e.from||t.to-e.to}function Js(t){for(var e=t,n=0;n<e.length-1;n++){var r=e[n];if(r.from!=r.to)for(var o=n+1;o<e.length;o++){var i=e[o];if(i.from!=r.from){i.from<r.to&&(e==t&&(e=t.slice()),e[n]=r.copy(r.from,i.from),Ks(e,o,r.copy(i.from,r.to)));break}i.to!=r.to&&(e==t&&(e=t.slice()),e[o]=i.copy(i.from,r.to),Ks(e,o+1,i.copy(r.to,i.to)))}}return e}function Ks(t,e,n){for(;e<t.length&&qs(n,t[e])>0;)e++;t.splice(e,0,n)}function Us(t){var e=[];return t.someProp("decorations",(function(n){var r=n(t.state);r&&r!=Ls&&e.push(r)})),t.cursorWrapper&&e.push(Fs.create(t.state.doc,[t.cursorWrapper.deco])),Vs.from(e)}Vs.prototype.map=function(t,e){var n=this.members.map((function(n){return n.map(t,e,Rs)}));return Vs.from(n)},Vs.prototype.forChild=function(t,e){if(e.isLeaf)return Fs.empty;for(var n=[],r=0;r<this.members.length;r++){var o=this.members[r].forChild(t,e);o!=Ls&&(o instanceof Vs?n=n.concat(o.members):n.push(o))}return Vs.from(n)},Vs.prototype.eq=function(t){if(!(t instanceof Vs)||t.members.length!=this.members.length)return!1;for(var e=0;e<this.members.length;e++)if(!this.members[e].eq(t.members[e]))return!1;return!0},Vs.prototype.locals=function(t){for(var e,n=!0,r=0;r<this.members.length;r++){var o=this.members[r].localsInner(t);if(o.length)if(e){n&&(e=e.slice(),n=!1);for(var i=0;i<o.length;i++)e.push(o[i])}else e=o}return e?Js(n?e:e.sort(qs)):Ps},Vs.from=function(t){switch(t.length){case 0:return Ls;case 1:return t[0];default:return new Vs(t)}};var Gs,Ys,Xs=function(t,e){this._props=e,this.state=e.state,this.directPlugins=e.plugins||[],this.directPlugins.forEach(ra),this.dispatch=this.dispatch.bind(this),this._root=null,this.focused=!1,this.trackWrites=null,this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):t.apply?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=ea(this),this.markCursor=null,this.cursorWrapper=null,ta(this),this.nodeViews=na(this),this.docView=ni(this.state.doc,Qs(this),Us(this),this.dom,this),this.lastSelectedViewDesc=null,this.dragging=null,function(t){t.shiftKey=!1,t.mouseDown=null,t.lastKeyCode=null,t.lastKeyCodeTime=0,t.lastClick={time:0,x:0,y:0,type:""},t.lastSelectionOrigin=null,t.lastSelectionTime=0,t.lastIOSEnter=0,t.lastIOSEnterFallbackTimeout=null,t.lastAndroidDelete=0,t.composing=!1,t.composingTimeout=null,t.compositionNodes=[],t.compositionEndedAt=-2e8,t.domObserver=new rs(t,(function(e,n,r,o){return $i(t,e,n,r,o)})),t.domObserver.start(),t.domChangeCount=0,t.eventHandlers=Object.create(null);var e=function(e){var n=ss[e];t.dom.addEventListener(e,t.eventHandlers[e]=function(e){!function(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(var n=e.target;n!=t.dom;n=n.parentNode)if(!n||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}(t,e)||ls(t,e)||!t.editable&&e.type in as||n(t,e)})};for(var n in ss)e(n);lo.safari&&t.dom.addEventListener("input",(function(){return null})),us(t)}(this),this.prevDirectPlugins=[],this.pluginViews=[],this.updatePluginViews()},Zs={props:{configurable:!0},root:{configurable:!0},isDestroyed:{configurable:!0}};function Qs(t){var e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),e.translate="no",t.someProp("attributes",(function(n){if("function"==typeof n&&(n=n(t.state)),n)for(var r in n)"class"==r&&(e.class+=" "+n[r]),"style"==r?e.style=(e.style?e.style+";":"")+n[r]:e[r]||"contenteditable"==r||"nodeName"==r||(e[r]=String(n[r]))})),[Bs.node(0,t.state.doc.content.size,e)]}function ta(t){if(t.markCursor){var e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),t.cursorWrapper={dom:e,deco:Bs.widget(t.state.selection.head,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function ea(t){return!t.someProp("editable",(function(e){return!1===e(t.state)}))}function na(t){var e={};return t.someProp("nodeViews",(function(t){for(var n in t)Object.prototype.hasOwnProperty.call(e,n)||(e[n]=t[n])})),e}function ra(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}if(Zs.props.get=function(){if(this._props.state!=this.state){var t=this._props;for(var e in this._props={},t)this._props[e]=t[e];this._props.state=this.state}return this._props},Xs.prototype.update=function(t){t.handleDOMEvents!=this._props.handleDOMEvents&&us(this),this._props=t,t.plugins&&(t.plugins.forEach(ra),this.directPlugins=t.plugins),this.updateStateInner(t.state,!0)},Xs.prototype.setProps=function(t){var e={};for(var n in this._props)e[n]=this._props[n];for(var r in e.state=this.state,t)e[r]=t[r];this.update(e)},Xs.prototype.updateState=function(t){this.updateStateInner(t,this.state.plugins!=t.plugins)},Xs.prototype.updateStateInner=function(t,e){var n=this,r=this.state,o=!1,i=!1;if(t.storedMarks&&this.composing&&(ks(this),i=!0),this.state=t,e){var s=na(this);(function(t,e){var n=0,r=0;for(var o in t){if(t[o]!=e[o])return!0;n++}for(var i in e)r++;return n!=r})(s,this.nodeViews)&&(this.nodeViews=s,o=!0),us(this)}this.editable=ea(this),ta(this);var a=Us(this),c=Qs(this),u=e?"reset":t.scrollToSelection>r.scrollToSelection?"to selection":"preserve",l=o||!this.docView.matchesNode(t.doc,c,a);!l&&t.selection.eq(r.selection)||(i=!0);var d,p,f,h,m,v,g,y,b,w,_,x="preserve"==u&&i&&null==this.dom.style.overflowAnchor&&function(t){for(var e,n,r=t.dom.getBoundingClientRect(),o=Math.max(0,r.top),i=(r.left+r.right)/2,s=o+1;s<Math.min(innerHeight,r.bottom);s+=5){var a=t.root.elementFromPoint(i,s);if(a!=t.dom&&t.dom.contains(a)){var c=a.getBoundingClientRect();if(c.top>=o-20){e=a,n=c.top;break}}}return{refDOM:e,refTop:n,stack:Ao(t.dom)}}(this);if(i){this.domObserver.stop();var k=l&&(lo.ie||lo.chrome)&&!this.composing&&!r.selection.empty&&!t.selection.empty&&(h=r.selection,m=t.selection,v=Math.min(h.$anchor.sharedDepth(h.head),m.$anchor.sharedDepth(m.head)),h.$anchor.start(v)!=m.$anchor.start(v));if(l){var C=lo.chrome?this.trackWrites=this.root.getSelection().focusNode:null;!o&&this.docView.update(t.doc,c,a,this)||(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=ni(t.doc,c,a,this.dom,this)),C&&!this.trackWrites&&(k=!0)}k||!(this.mouseDown&&this.domObserver.currentSelection.eq(this.root.getSelection())&&(d=this,p=d.docView.domFromPos(d.state.selection.anchor,0),f=d.root.getSelection(),_o(p.node,p.offset,f.anchorNode,f.anchorOffset)))?bi(this,k):(Ci(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}if(this.updatePluginViews(r),"reset"==u)this.dom.scrollTop=0;else if("to selection"==u){var S=this.root.getSelection().focusNode;this.someProp("handleScrollToSelection",(function(t){return t(n)}))||(t.selection instanceof ie?Io(this,this.docView.domAfterPos(t.selection.from).getBoundingClientRect(),S):Io(this,this.coordsAtPos(t.selection.head,1),S))}else x&&(y=(g=x).refDOM,b=g.refTop,w=g.stack,_=y?y.getBoundingClientRect().top:0,No(w,0==_?0:_-b))},Xs.prototype.destroyPluginViews=function(){for(var t;t=this.pluginViews.pop();)t.destroy&&t.destroy()},Xs.prototype.updatePluginViews=function(t){if(t&&t.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(var e=0;e<this.pluginViews.length;e++){var n=this.pluginViews[e];n.update&&n.update(this,t)}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(var r=0;r<this.directPlugins.length;r++){var o=this.directPlugins[r];o.spec.view&&this.pluginViews.push(o.spec.view(this))}for(var i=0;i<this.state.plugins.length;i++){var s=this.state.plugins[i];s.spec.view&&this.pluginViews.push(s.spec.view(this))}}},Xs.prototype.someProp=function(t,e){var n,r=this._props&&this._props[t];if(null!=r&&(n=e?e(r):r))return n;for(var o=0;o<this.directPlugins.length;o++){var i=this.directPlugins[o].props[t];if(null!=i&&(n=e?e(i):i))return n}var s=this.state.plugins;if(s)for(var a=0;a<s.length;a++){var c=s[a].props[t];if(null!=c&&(n=e?e(c):c))return n}},Xs.prototype.hasFocus=function(){return this.root.activeElement==this.dom},Xs.prototype.focus=function(){this.domObserver.stop(),this.editable&&function(t){if(t.setActive)return t.setActive();if(Bo)return t.focus(Bo);var e=Ao(t);t.focus(null==Bo?{get preventScroll(){return Bo={preventScroll:!0},!0}}:void 0),Bo||(Bo=!1,No(e,0))}(this.dom),bi(this),this.domObserver.start()},Zs.root.get=function(){var t=this._root;if(null==t)for(var e=this.dom.parentNode;e;e=e.parentNode)if(9==e.nodeType||11==e.nodeType&&e.host)return e.getSelection||(Object.getPrototypeOf(e).getSelection=function(){return document.getSelection()}),this._root=e;return t||document},Xs.prototype.posAtCoords=function(t){return Ro(this,t)},Xs.prototype.coordsAtPos=function(t,e){return void 0===e&&(e=1),Vo(this,t,e)},Xs.prototype.domAtPos=function(t,e){return void 0===e&&(e=0),this.docView.domFromPos(t,e)},Xs.prototype.nodeDOM=function(t){var e=this.docView.descAt(t);return e?e.nodeDOM:null},Xs.prototype.posAtDOM=function(t,e,n){void 0===n&&(n=-1);var r=this.docView.posFromDOM(t,e,n);if(null==r)throw new RangeError("DOM position not inside the editor");return r},Xs.prototype.endOfTextblock=function(t,e){return Uo(this,e||this.state,t)},Xs.prototype.destroy=function(){this.docView&&(!function(t){for(var e in t.domObserver.stop(),t.eventHandlers)t.dom.removeEventListener(e,t.eventHandlers[e]);clearTimeout(t.composingTimeout),clearTimeout(t.lastIOSEnterFallbackTimeout)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Us(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)},Zs.isDestroyed.get=function(){return null==this.docView},Xs.prototype.dispatchEvent=function(t){return function(t,e){ls(t,e)||!ss[e.type]||!t.editable&&e.type in as||ss[e.type](t,e)}(this,t)},Xs.prototype.dispatch=function(t){var e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))},Object.defineProperties(Xs.prototype,Zs),"undefined"!=typeof WeakMap){var oa=new WeakMap;Gs=function(t){return oa.get(t)},Ys=function(t,e){return oa.set(t,e),e}}else{var ia=[],sa=0;Gs=function(t){for(var e=0;e<ia.length;e+=2)if(ia[e]==t)return ia[e+1]},Ys=function(t,e){return 10==sa&&(sa=0),ia[sa++]=t,ia[sa++]=e}}var aa=function(t,e,n,r){this.left=t,this.top=e,this.right=n,this.bottom=r},ca=function(t,e,n,r){this.width=t,this.height=e,this.map=n,this.problems=r};function ua(t){if(t.colwidth)return t.colwidth.slice();for(var e=[],n=0;n<t.colspan;n++)e.push(0);return e}function la(t,e){var n=t.getAttribute("data-colwidth"),r=n&&/^\d+(,\d+)*$/.test(n)?n.split(",").map((function(t){return Number(t)})):null,o=Number(t.getAttribute("colspan")||1),i={colspan:o,rowspan:Number(t.getAttribute("rowspan")||1),colwidth:r&&r.length==o?r:null};for(var s in e){var a=e[s].getFromDOM,c=a&&a(t);null!=c&&(i[s]=c)}return i}function da(t,e){var n={};for(var r in 1!=t.attrs.colspan&&(n.colspan=t.attrs.colspan),1!=t.attrs.rowspan&&(n.rowspan=t.attrs.rowspan),t.attrs.colwidth&&(n["data-colwidth"]=t.attrs.colwidth.join(",")),e){var o=e[r].setDOMAttr;o&&o(t.attrs[r],n)}return n}function pa(t){var e=t.cellAttributes||{},n={colspan:{default:1},rowspan:{default:1},colwidth:{default:null}};for(var r in e)n[r]={default:e[r].default};return{table:{content:"table_row+",tableRole:"table",isolating:!0,group:t.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:t.cellContent,attrs:n,tableRole:"cell",isolating:!0,parseDOM:[{tag:"td",getAttrs:function(t){return la(t,e)}}],toDOM:function(t){return["td",da(t,e),0]}},table_header:{content:t.cellContent,attrs:n,tableRole:"header_cell",isolating:!0,parseDOM:[{tag:"th",getAttrs:function(t){return la(t,e)}}],toDOM:function(t){return["th",da(t,e),0]}}}}function fa(t){var e=t.cached.tableNodeTypes;if(!e)for(var n in e=t.cached.tableNodeTypes={},t.nodes){var r=t.nodes[n],o=r.spec.tableRole;o&&(e[o]=r)}return e}ca.prototype.findCell=function(t){for(var e=0;e<this.map.length;e++){var n=this.map[e];if(n==t){for(var r=e%this.width,o=e/this.width|0,i=r+1,s=o+1,a=1;i<this.width&&this.map[e+a]==n;a++)i++;for(var c=1;s<this.height&&this.map[e+this.width*c]==n;c++)s++;return new aa(r,o,i,s)}}throw new RangeError("No cell with offset "+t+" found")},ca.prototype.colCount=function(t){for(var e=0;e<this.map.length;e++)if(this.map[e]==t)return e%this.width;throw new RangeError("No cell with offset "+t+" found")},ca.prototype.nextCell=function(t,e,n){var r=this.findCell(t),o=r.left,i=r.right,s=r.top,a=r.bottom;return"horiz"==e?(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)]},ca.prototype.rectBetween=function(t,e){var n=this.findCell(t),r=n.left,o=n.right,i=n.top,s=n.bottom,a=this.findCell(e),c=a.left,u=a.right,l=a.top,d=a.bottom;return new aa(Math.min(r,c),Math.min(i,l),Math.max(o,u),Math.max(s,d))},ca.prototype.cellsInRect=function(t){for(var e=[],n={},r=t.top;r<t.bottom;r++)for(var o=t.left;o<t.right;o++){var i=r*this.width+o,s=this.map[i];n[s]||(n[s]=!0,o==t.left&&o&&this.map[i-1]==s||r==t.top&&r&&this.map[i-this.width]==s||e.push(s))}return e},ca.prototype.positionAt=function(t,e,n){for(var r=0,o=0;;r++){var i=o+n.child(r).nodeSize;if(r==t){for(var s=e+t*this.width,a=(t+1)*this.width;s<a&&this.map[s]<o;)s++;return s==a?i-1:this.map[s]}o=i}},ca.get=function(t){return Gs(t)||Ys(t,function(t){if("table"!=t.type.spec.tableRole)throw new RangeError("Not a table node: "+t.type.name);for(var e=function(t){for(var e=-1,n=!1,r=0;r<t.childCount;r++){var o=t.child(r),i=0;if(n)for(var s=0;s<r;s++)for(var a=t.child(s),c=0;c<a.childCount;c++){var u=a.child(c);s+u.attrs.rowspan>r&&(i+=u.attrs.colspan)}for(var l=0;l<o.childCount;l++){var d=o.child(l);i+=d.attrs.colspan,d.attrs.rowspan>1&&(n=!0)}-1==e?e=i:e!=i&&(e=Math.max(e,i))}return e}(t),n=t.childCount,r=[],o=0,i=null,s=[],a=0,c=e*n;a<c;a++)r[a]=0;for(var u=0,l=0;u<n;u++){var d=t.child(u);l++;for(var p=0;;p++){for(;o<r.length&&0!=r[o];)o++;if(p==d.childCount)break;for(var f=d.child(p),h=f.attrs,m=h.colspan,v=h.rowspan,g=h.colwidth,y=0;y<v;y++){if(y+u>=n){(i||(i=[])).push({type:"overlong_rowspan",pos:l,n:v-y});break}for(var b=o+y*e,w=0;w<m;w++){0==r[b+w]?r[b+w]=l:(i||(i=[])).push({type:"collision",row:u,pos:l,n:m-w});var _=g&&g[w];if(_){var x=(b+w)%e*2,k=s[x];null==k||k!=_&&1==s[x+1]?(s[x]=_,s[x+1]=1):k==_&&s[x+1]++}}}o+=m,l+=f.nodeSize}for(var C=(u+1)*e,S=0;o<C;)0==r[o++]&&S++;S&&(i||(i=[])).push({type:"missing",row:u,n:S}),l++}for(var T=new ca(e,n,r,i),E=!1,M=0;!E&&M<s.length;M+=2)null!=s[M]&&s[M+1]<n&&(E=!0);E&&function(t,e,n){t.problems||(t.problems=[]);for(var r=0,o={};r<t.map.length;r++){var i=t.map[r];if(!o[i]){o[i]=!0;for(var s=n.nodeAt(i),a=null,c=0;c<s.attrs.colspan;c++){var u=(r+c)%t.width,l=e[2*u];null==l||s.attrs.colwidth&&s.attrs.colwidth[c]==l||((a||(a=ua(s.attrs)))[c]=l)}a&&t.problems.unshift({type:"colwidth mismatch",pos:i,colwidth:a})}}}(T,s,t);return T}(t))};var ha=new xe("selectingCells");function ma(t){for(var e=t.depth-1;e>0;e--)if("row"==t.node(e).type.spec.tableRole)return t.node(0).resolve(t.before(e+1));return null}function va(t){for(var e=t.selection.$head,n=e.depth;n>0;n--)if("row"==e.node(n).type.spec.tableRole)return!0;return!1}function ga(t){var e=t.selection;return e.$anchorCell?e.$anchorCell.pos>e.$headCell.pos?e.$anchorCell:e.$headCell:e.node&&"cell"==e.node.type.spec.tableRole?e.$anchor:ma(e.$head)||function(t){for(var e=t.nodeAfter,n=t.pos;e;e=e.firstChild,n++){var r=e.type.spec.tableRole;if("cell"==r||"header_cell"==r)return t.doc.resolve(n)}for(var o=t.nodeBefore,i=t.pos;o;o=o.lastChild,i--){var s=o.type.spec.tableRole;if("cell"==s||"header_cell"==s)return t.doc.resolve(i-o.nodeSize)}}(e.$head)}function ya(t){return"row"==t.parent.type.spec.tableRole&&t.nodeAfter}function ba(t){return t.node(0).resolve(t.pos+t.nodeAfter.nodeSize)}function wa(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}function _a(t){return ca.get(t.node(-1)).findCell(t.pos-t.start(-1))}function xa(t){return ca.get(t.node(-1)).colCount(t.pos-t.start(-1))}function ka(t,e,n){var r=t.start(-1),o=ca.get(t.node(-1)).nextCell(t.pos-r,e,n);return null==o?null:t.node(0).resolve(r+o)}function Ca(t,e,n){var r={};for(var o in t)r[o]=t[o];return r[e]=n,r}function Sa(t,e,n){void 0===n&&(n=1);var r=Ca(t,"colspan",t.colspan-n);return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(e,n),r.colwidth.some((function(t){return t>0}))||(r.colwidth=null)),r}function Ta(t,e,n){void 0===n&&(n=1);var r=Ca(t,"colspan",t.colspan+n);if(r.colwidth){r.colwidth=r.colwidth.slice();for(var o=0;o<n;o++)r.colwidth.splice(e,0,0)}return r}function Ea(t,e,n){for(var r=fa(e.type.schema).header_cell,o=0;o<t.height;o++)if(e.nodeAt(t.map[n+o*t.width]).type!=r)return!1;return!0}var Ma=function(t){function e(e,n){void 0===n&&(n=e);var r=e.node(-1),o=ca.get(r),i=e.start(-1),s=o.rectBetween(e.pos-i,n.pos-i),a=e.node(0),c=o.cellsInRect(s).filter((function(t){return t!=n.pos-i}));c.unshift(n.pos-i);var u=c.map((function(t){var e=r.nodeAt(t),n=t+i+1;return new ne(a.resolve(n),a.resolve(n+e.content.size))}));t.call(this,u[0].$from,u[0].$to,u),this.$anchorCell=e,this.$headCell=n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.map=function(t,n){var r=t.resolve(n.map(this.$anchorCell.pos)),o=t.resolve(n.map(this.$headCell.pos));if(ya(r)&&ya(o)&&wa(r,o)){var i=this.$anchorCell.node(-1)!=r.node(-1);return i&&this.isRowSelection()?e.rowSelection(r,o):i&&this.isColSelection()?e.colSelection(r,o):new e(r,o)}return re.between(r,o)},e.prototype.content=function(){for(var t=this.$anchorCell.node(-1),e=ca.get(t),n=this.$anchorCell.start(-1),r=e.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),o={},s=[],a=r.top;a<r.bottom;a++){for(var c=[],u=a*e.width+r.left,l=r.left;l<r.right;l++,u++){var d=e.map[u];if(!o[d]){o[d]=!0;var f=e.findCell(d),h=t.nodeAt(d),m=r.left-f.left,v=f.right-r.right;if(m>0||v>0){var g=h.attrs;m>0&&(g=Sa(g,0,m)),v>0&&(g=Sa(g,g.colspan-v,v)),h=f.left<r.left?h.type.createAndFill(g):h.type.create(g,h.content)}if(f.top<r.top||f.bottom>r.bottom){var y=Ca(h.attrs,"rowspan",Math.min(f.bottom,r.bottom)-Math.max(f.top,r.top));h=f.top<r.top?h.type.createAndFill(y):h.type.create(y,h.content)}c.push(h)}}s.push(t.child(a).copy(i.from(c)))}var b=this.isColSelection()&&this.isRowSelection()?t:s;return new p(i.from(b),1,1)},e.prototype.replace=function(e,n){void 0===n&&(n=p.empty);for(var r=e.steps.length,o=this.ranges,i=0;i<o.length;i++){var s=o[i],a=s.$from,c=s.$to,u=e.mapping.slice(r);e.replace(u.map(a.pos),u.map(c.pos),i?p.empty:n)}var l=t.findFrom(e.doc.resolve(e.mapping.slice(r).map(this.to)),-1);l&&e.setSelection(l)},e.prototype.replaceWith=function(t,e){this.replace(t,new p(i.from(e),0,0))},e.prototype.forEachCell=function(t){for(var e=this.$anchorCell.node(-1),n=ca.get(e),r=this.$anchorCell.start(-1),o=n.cellsInRect(n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r)),i=0;i<o.length;i++)t(e.nodeAt(o[i]),r+o[i])},e.prototype.isColSelection=function(){var t=this.$anchorCell.index(-1),e=this.$headCell.index(-1);if(Math.min(t,e)>0)return!1;var n=t+this.$anchorCell.nodeAfter.attrs.rowspan,r=e+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,r)==this.$headCell.node(-1).childCount},e.colSelection=function(t,n){void 0===n&&(n=t);var r=ca.get(t.node(-1)),o=t.start(-1),i=r.findCell(t.pos-o),s=r.findCell(n.pos-o),a=t.node(0);return i.top<=s.top?(i.top>0&&(t=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&&(t=a.resolve(o+r.map[r.width*(r.height-1)+i.right-1]))),new e(t,n)},e.prototype.isRowSelection=function(){var t=ca.get(this.$anchorCell.node(-1)),e=this.$anchorCell.start(-1),n=t.colCount(this.$anchorCell.pos-e),r=t.colCount(this.$headCell.pos-e);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)==t.width},e.prototype.eq=function(t){return t instanceof e&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos},e.rowSelection=function(t,n){void 0===n&&(n=t);var r=ca.get(t.node(-1)),o=t.start(-1),i=r.findCell(t.pos-o),s=r.findCell(n.pos-o),a=t.node(0);return i.left<=s.left?(i.left>0&&(t=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&&(t=a.resolve(o+r.map[r.width*(i.top+1)-1]))),new e(t,n)},e.prototype.toJSON=function(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}},e.fromJSON=function(t,n){return new e(t.resolve(n.anchor),t.resolve(n.head))},e.create=function(t,n,r){return void 0===r&&(r=n),new e(t.resolve(n),t.resolve(r))},e.prototype.getBookmark=function(){return new Oa(this.$anchorCell.pos,this.$headCell.pos)},e}(te);Ma.prototype.visible=!1,te.jsonID("cell",Ma);var Oa=function(t,e){this.anchor=t,this.head=e};function Da(t){if(!(t.selection instanceof Ma))return null;var e=[];return t.selection.forEachCell((function(t,n){e.push(Bs.node(n,n+t.nodeSize,{class:"selectedCell"}))})),Fs.create(t.doc,e)}function Ia(t){if(!t.size)return null;for(var e=t.content,n=t.openStart,r=t.openEnd;1==e.childCount&&(n>0&&r>0||"table"==e.firstChild.type.spec.tableRole);)n--,r--,e=e.firstChild.content;var o=e.firstChild,s=o.type.spec.tableRole,a=o.type.schema,c=[];if("row"==s)for(var u=0;u<e.childCount;u++){var l=e.child(u).content,d=u?0:Math.max(0,n-1),f=u<e.childCount-1?0:Math.max(0,r-1);(d||f)&&(l=Aa(fa(a).row,new p(l,d,f)).content),c.push(l)}else{if("cell"!=s&&"header_cell"!=s)return null;c.push(n||r?Aa(fa(a).row,new p(e,n,r)).content:e)}return function(t,e){for(var n=[],r=0;r<e.length;r++)for(var o=e[r],s=o.childCount-1;s>=0;s--)for(var a=o.child(s).attrs,c=a.rowspan,u=a.colspan,l=r;l<r+c;l++)n[l]=(n[l]||0)+u;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>=e.length&&e.push(i.empty),n[f]<d){for(var h=fa(t).cell.createAndFill(),m=[],v=n[f];v<d;v++)m.push(h);e[f]=e[f].append(i.from(m))}return{height:e.length,width:d,rows:e}}(a,c)}function Aa(t,e){var n=t.createAndFill();return new wt(n).replace(0,n.content.size,e).doc}function Na(t,e,n){var r=t.width,o=t.height,s=t.rows;if(r!=e){for(var a=[],c=[],u=0;u<s.length;u++){for(var l=s[u],d=[],p=a[u]||0,f=0;p<e;f++){var h=l.child(f%l.childCount);p+h.attrs.colspan>e&&(h=h.type.create(Sa(h.attrs,h.attrs.colspan,p+h.attrs.colspan-e),h.content)),d.push(h),p+=h.attrs.colspan;for(var m=1;m<h.attrs.rowspan;m++)a[u+m]=(a[u+m]||0)+h.attrs.colspan}c.push(i.from(d))}s=c,r=e}if(o!=n){for(var v=[],g=0,y=0;g<n;g++,y++){for(var b=[],w=s[y%o],_=0;_<w.childCount;_++){var x=w.child(_);g+x.attrs.rowspan>n&&(x=x.type.create(Ca(x.attrs,"rowspan",Math.max(1,n-x.attrs.rowspan)),x.content)),b.push(x)}v.push(i.from(b))}s=v,o=n}return{width:r,height:o,rows:s}}function Ba(t,e,n,r,o,i,s,a){if(0==s||s==e.height)return!1;for(var c=!1,u=o;u<i;u++){var l=s*e.width+u,d=e.map[l];if(e.map[l-e.width]==d){c=!0;var p=n.nodeAt(d),f=e.findCell(d),h=f.top,m=f.left;t.setNodeMarkup(t.mapping.slice(a).map(d+r),null,Ca(p.attrs,"rowspan",s-h)),t.insert(t.mapping.slice(a).map(e.positionAt(s,m,n)),p.type.createAndFill(Ca(p.attrs,"rowspan",h+p.attrs.rowspan-s))),u+=p.attrs.colspan-1}}return c}function za(t,e,n,r,o,i,s,a){if(0==s||s==e.width)return!1;for(var c=!1,u=o;u<i;u++){var l=u*e.width+s,d=e.map[l];if(e.map[l-1]==d){c=!0;var p=n.nodeAt(d),f=e.colCount(d),h=t.mapping.slice(a).map(d+r);t.setNodeMarkup(h,null,Sa(p.attrs,s-f,p.attrs.colspan-(s-f))),t.insert(h+p.nodeSize,p.type.createAndFill(Sa(p.attrs,0,s-f))),u+=p.attrs.rowspan-1}}return c}function Pa(t,e,n,r,o){var s=n?t.doc.nodeAt(n-1):t.doc,a=ca.get(s),c=r.top,u=r.left,l=u+o.width,d=c+o.height,f=t.tr,h=0;function m(){s=n?f.doc.nodeAt(n-1):f.doc,a=ca.get(s),h=f.mapping.maps.length}(function(t,e,n,r,o,s,a){var c,u,l=fa(t.doc.type.schema);if(o>e.width)for(var d=0,p=0;d<e.height;d++){var f=n.child(d);p+=f.nodeSize;var h=[],m=void 0;m=null==f.lastChild||f.lastChild.type==l.cell?c||(c=l.cell.createAndFill()):u||(u=l.header_cell.createAndFill());for(var v=e.width;v<o;v++)h.push(m);t.insert(t.mapping.slice(a).map(p-1+r),h)}if(s>e.height){for(var g=[],y=0,b=(e.height-1)*e.width;y<Math.max(e.width,o);y++){var w=!(y>=e.width)&&n.nodeAt(e.map[b+y]).type==l.header_cell;g.push(w?u||(u=l.header_cell.createAndFill()):c||(c=l.cell.createAndFill()))}for(var _=l.row.create(null,i.from(g)),x=[],k=e.height;k<s;k++)x.push(_);t.insert(t.mapping.slice(a).map(r+n.nodeSize-2),x)}return!(!c&&!u)})(f,a,s,n,l,d,h)&&m(),Ba(f,a,s,n,u,l,c,h)&&m(),Ba(f,a,s,n,u,l,d,h)&&m(),za(f,a,s,n,c,d,u,h)&&m(),za(f,a,s,n,c,d,l,h)&&m();for(var v=c;v<d;v++){var g=a.positionAt(v,u,s),y=a.positionAt(v,l,s);f.replace(f.mapping.slice(h).map(g+n),f.mapping.slice(h).map(y+n),new p(o.rows[v-c],0,0))}m(),f.setSelection(new Ma(f.doc.resolve(n+a.positionAt(c,u,s)),f.doc.resolve(n+a.positionAt(d-1,l-1,s)))),e(f)}Oa.prototype.map=function(t){return new Oa(t.map(this.anchor),t.map(this.head))},Oa.prototype.resolve=function(t){var e=t.resolve(this.anchor),n=t.resolve(this.head);return"row"==e.parent.type.spec.tableRole&&"row"==n.parent.type.spec.tableRole&&e.index()<e.parent.childCount&&n.index()<n.parent.childCount&&wa(e,n)?new Ma(e,n):te.near(n,1)};var Ra=uo({ArrowLeft:La("horiz",-1),ArrowRight:La("horiz",1),ArrowUp:La("vert",-1),ArrowDown:La("vert",1),"Shift-ArrowLeft":Va("horiz",-1),"Shift-ArrowRight":Va("horiz",1),"Shift-ArrowUp":Va("vert",-1),"Shift-ArrowDown":Va("vert",1),Backspace:ja,"Mod-Backspace":ja,Delete:ja,"Mod-Delete":ja});function Fa(t,e,n){return!n.eq(t.selection)&&(e&&e(t.tr.setSelection(n).scrollIntoView()),!0)}function La(t,e){return function(n,r,o){var i=n.selection;if(i instanceof Ma)return Fa(n,r,te.near(i.$headCell,e));if("horiz"!=t&&!i.empty)return!1;var s=qa(o,t,e);if(null==s)return!1;if("horiz"==t)return Fa(n,r,te.near(n.doc.resolve(i.head+e),e));var a,c=n.doc.resolve(s),u=ka(c,t,e);return a=u?te.near(u,1):e<0?te.near(n.doc.resolve(c.before(-1)),-1):te.near(n.doc.resolve(c.after(-1)),1),Fa(n,r,a)}}function Va(t,e){return function(n,r,o){var i=n.selection;if(!(i instanceof Ma)){var s=qa(o,t,e);if(null==s)return!1;i=new Ma(n.doc.resolve(s))}var a=ka(i.$headCell,t,e);return!!a&&Fa(n,r,new Ma(i.$anchorCell,a))}}function ja(t,e){var n=t.selection;if(!(n instanceof Ma))return!1;if(e){var r=t.tr,o=fa(t.schema).cell.createAndFill().content;n.forEachCell((function(t,e){t.content.eq(o)||r.replace(r.mapping.map(e+1),r.mapping.map(e+t.nodeSize-1),new p(o,0,0))})),r.docChanged&&e(r)}return!0}function $a(t,e){var n=ma(t.state.doc.resolve(e));return!!n&&(t.dispatch(t.state.tr.setSelection(new Ma(n))),!0)}function Wa(t,e,n){if(!va(t.state))return!1;var r=Ia(n),o=t.state.selection;if(o instanceof Ma){r||(r={width:1,height:1,rows:[i.from(Aa(fa(t.state.schema).cell,n))]});var s=o.$anchorCell.node(-1),a=o.$anchorCell.start(-1),c=ca.get(s).rectBetween(o.$anchorCell.pos-a,o.$headCell.pos-a);return r=Na(r,c.right-c.left,c.bottom-c.top),Pa(t.state,t.dispatch,a,c,r),!0}if(r){var u=ga(t.state),l=u.start(-1);return Pa(t.state,t.dispatch,l,ca.get(u.node(-1)).findCell(u.pos-l),r),!0}return!1}function Ha(t,e){if(!e.ctrlKey&&!e.metaKey){var n,r=Ja(t,e.target);if(e.shiftKey&&t.state.selection instanceof Ma)o(t.state.selection.$anchorCell,e),e.preventDefault();else if(e.shiftKey&&r&&null!=(n=ma(t.state.selection.$anchor))&&Ka(t,e).pos!=n.pos)o(n,e),e.preventDefault();else if(!r)return;t.root.addEventListener("mouseup",i),t.root.addEventListener("dragstart",i),t.root.addEventListener("mousemove",s)}function o(e,n){var r=Ka(t,n),o=null==ha.getState(t.state);if(!r||!wa(e,r)){if(!o)return;r=e}var i=new Ma(e,r);if(o||!t.state.selection.eq(i)){var s=t.state.tr.setSelection(i);o&&s.setMeta(ha,e.pos),t.dispatch(s)}}function i(){t.root.removeEventListener("mouseup",i),t.root.removeEventListener("dragstart",i),t.root.removeEventListener("mousemove",s),null!=ha.getState(t.state)&&t.dispatch(t.state.tr.setMeta(ha,-1))}function s(n){var s,a=ha.getState(t.state);if(null!=a)s=t.state.doc.resolve(a);else if(Ja(t,n.target)!=r&&!(s=Ka(t,e)))return i();s&&o(s,n)}}function qa(t,e,n){if(!(t.state.selection instanceof re))return null;for(var r=t.state.selection.$head,o=r.depth-1;o>=0;o--){var i=r.node(o);if((n<0?r.index(o):r.indexAfter(o))!=(n<0?0:i.childCount))return null;if("cell"==i.type.spec.tableRole||"header_cell"==i.type.spec.tableRole){var s=r.before(o),a="vert"==e?n>0?"down":"up":n>0?"right":"left";return t.endOfTextblock(a)?s:null}}return null}function Ja(t,e){for(;e&&e!=t.dom;e=e.parentNode)if("TD"==e.nodeName||"TH"==e.nodeName)return e}function Ka(t,e){var n=t.posAtCoords({left:e.clientX,top:e.clientY});return n&&n?ma(t.state.doc.resolve(n.pos)):null}var Ua=new xe("fix-tables");function Ga(t,e){var n,r=function(e,r){"table"==e.type.spec.tableRole&&(n=function(t,e,n,r){var o=ca.get(e);if(!o.problems)return r;r||(r=t.tr);for(var i,s,a=[],c=0;c<o.height;c++)a.push(0);for(var u=0;u<o.problems.length;u++){var l=o.problems[u];if("collision"==l.type){for(var d=e.nodeAt(l.pos),p=0;p<d.attrs.rowspan;p++)a[l.row+p]+=l.n;r.setNodeMarkup(r.mapping.map(n+1+l.pos),null,Sa(d.attrs,d.attrs.colspan-l.n,l.n))}else if("missing"==l.type)a[l.row]+=l.n;else if("overlong_rowspan"==l.type){var f=e.nodeAt(l.pos);r.setNodeMarkup(r.mapping.map(n+1+l.pos),null,Ca(f.attrs,"rowspan",f.attrs.rowspan-l.n))}else if("colwidth mismatch"==l.type){var h=e.nodeAt(l.pos);r.setNodeMarkup(r.mapping.map(n+1+l.pos),null,Ca(h.attrs,"colwidth",l.colwidth))}}for(var m=0;m<a.length;m++)a[m]&&(null==i&&(i=m),s=m);for(var v=0,g=n+1;v<o.height;v++){var y=e.child(v),b=g+y.nodeSize,w=a[v];if(w>0){var _="cell";y.firstChild&&(_=y.firstChild.type.spec.tableRole);for(var x=[],k=0;k<w;k++)x.push(fa(t.schema)[_].createAndFill());var C=0!=v&&i!=v-1||s!=v?b-1:g+1;r.insert(r.mapping.map(C),x)}g=b}return r.setMeta(Ua,{fixTables:!0})}(t,e,r,n))};return e?e.doc!=t.doc&&function t(e,n,r,o){var i=e.childCount,s=n.childCount;t:for(var a=0,c=0;a<s;a++){for(var u=n.child(a),l=c,d=Math.min(i,a+3);l<d;l++)if(e.child(l)==u){c=l+1,r+=u.nodeSize;continue t}o(u,r),c<i&&e.child(c).sameMarkup(u)?t(e.child(c),u,r+1,o):u.nodesBetween(0,u.content.size,o,r+1),r+=u.nodeSize}}(e.doc,t.doc,0,r):t.doc.descendants(r),n}function Ya(t){var e,n=t.selection,r=ga(t),o=r.node(-1),i=r.start(-1),s=ca.get(o);return(e=n instanceof Ma?s.rectBetween(n.$anchorCell.pos-i,n.$headCell.pos-i):s.findCell(r.pos-i)).tableStart=i,e.map=s,e.table=o,e}function Xa(t,e,n){var r=e.map,o=e.tableStart,i=e.table,s=n>0?-1:0;Ea(r,i,n+s)&&(s=0==n||n==r.width?null:0);for(var a=0;a<r.height;a++){var c=a*r.width+n;if(n>0&&n<r.width&&r.map[c-1]==r.map[c]){var u=r.map[c],l=i.nodeAt(u);t.setNodeMarkup(t.mapping.map(o+u),null,Ta(l.attrs,n-r.colCount(u))),a+=l.attrs.rowspan-1}else{var d=null==s?fa(i.type.schema).cell:i.nodeAt(r.map[c+s]).type,p=r.positionAt(a,n,i);t.insert(t.mapping.map(o+p),d.createAndFill())}}return t}function Za(t,e){if(!va(t))return!1;if(e){var n=Ya(t);e(Xa(t.tr,n,n.left))}return!0}function Qa(t,e){if(!va(t))return!1;if(e){var n=Ya(t);e(Xa(t.tr,n,n.right))}return!0}function tc(t,e,n){for(var r=e.map,o=e.table,i=e.tableStart,s=t.mapping.maps.length,a=0;a<r.height;){var c=a*r.width+n,u=r.map[c],l=o.nodeAt(u);if(n>0&&r.map[c-1]==u||n<r.width-1&&r.map[c+1]==u)t.setNodeMarkup(t.mapping.slice(s).map(i+u),null,Sa(l.attrs,n-r.colCount(u)));else{var d=t.mapping.slice(s).map(i+u);t.delete(d,d+l.nodeSize)}a+=l.attrs.rowspan}}function ec(t,e){if(!va(t))return!1;if(e){var n=Ya(t),r=t.tr;if(0==n.left&&n.right==n.map.width)return!1;for(var o=n.right-1;tc(r,n,o),o!=n.left;o--)n.table=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc,n.map=ca.get(n.table);e(r)}return!0}function nc(t,e,n){for(var r=fa(e.type.schema).header_cell,o=0;o<t.width;o++)if(e.nodeAt(t.map[o+n*t.width]).type!=r)return!1;return!0}function rc(t,e,n){for(var r=e.map,o=e.tableStart,i=e.table,s=o,a=0;a<n;a++)s+=i.child(a).nodeSize;var c=[],u=n>0?-1:0;nc(r,i,n+u)&&(u=0==n||n==r.height?null:0);for(var l=0,d=r.width*n;l<r.width;l++,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;t.setNodeMarkup(o+p,null,Ca(f,"rowspan",f.rowspan+1)),l+=f.colspan-1}else{var h=null==u?fa(i.type.schema).cell:i.nodeAt(r.map[d+u*r.width]).type;c.push(h.createAndFill())}return t.insert(s,fa(i.type.schema).row.create(null,c)),t}function oc(t,e){if(!va(t))return!1;if(e){var n=Ya(t);e(rc(t.tr,n,n.top))}return!0}function ic(t,e){if(!va(t))return!1;if(e){var n=Ya(t);e(rc(t.tr,n,n.bottom))}return!0}function sc(t,e,n){for(var r=e.map,o=e.table,i=e.tableStart,s=0,a=0;a<n;a++)s+=o.child(a).nodeSize;var c=s+o.child(n).nodeSize,u=t.mapping.maps.length;t.delete(s+i,c+i);for(var l=0,d=n*r.width;l<r.width;l++,d++){var p=r.map[d];if(n>0&&p==r.map[d-r.width]){var f=o.nodeAt(p).attrs;t.setNodeMarkup(t.mapping.slice(u).map(p+i),null,Ca(f,"rowspan",f.rowspan-1)),l+=f.colspan-1}else if(n<r.width&&p==r.map[d+r.width]){var h=o.nodeAt(p),m=h.type.create(Ca(h.attrs,"rowspan",h.attrs.rowspan-1),h.content),v=r.positionAt(n+1,l,o);t.insert(t.mapping.slice(u).map(i+v),m),l+=h.attrs.colspan-1}}}function ac(t,e){if(!va(t))return!1;if(e){var n=Ya(t),r=t.tr;if(0==n.top&&n.bottom==n.map.height)return!1;for(var o=n.bottom-1;sc(r,n,o),o!=n.top;o--)n.table=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc,n.map=ca.get(n.table);e(r)}return!0}function cc(t){var e=t.content;return 1==e.childCount&&e.firstChild.isTextblock&&0==e.firstChild.childCount}function uc(t,e){var n=t.selection;if(!(n instanceof Ma)||n.$anchorCell.pos==n.$headCell.pos)return!1;var r=Ya(t),o=r.map;if(function(t,e){for(var n=t.width,r=t.height,o=t.map,i=e.top*n+e.left,s=i,a=(e.bottom-1)*n+e.left,c=i+(e.right-e.left-1),u=e.top;u<e.bottom;u++){if(e.left>0&&o[s]==o[s-1]||e.right<n&&o[c]==o[c+1])return!0;s+=n,c+=n}for(var l=e.left;l<e.right;l++){if(e.top>0&&o[i]==o[i-n]||e.bottom<r&&o[a]==o[a+n])return!0;i++,a++}return!1}(o,r))return!1;if(e){for(var s,a,c=t.tr,u={},l=i.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(!u[f])if(u[f]=!0,null==s)s=f,a=h;else{cc(h)||(l=l.append(h.content));var m=c.mapping.map(f+r.tableStart);c.delete(m,m+h.nodeSize)}}if(c.setNodeMarkup(s+r.tableStart,null,Ca(Ta(a.attrs,a.attrs.colspan,r.right-r.left-a.attrs.colspan),"rowspan",r.bottom-r.top)),l.size){var v=s+1+a.content.size,g=cc(a)?s+1:v;c.replaceWith(g+r.tableStart,v+r.tableStart,l)}c.setSelection(new Ma(c.doc.resolve(s+r.tableStart))),e(c)}return!0}function lc(t,e){var n=fa(t.schema);return dc((function(t){var e=t.node;return n[e.type.spec.tableRole]}))(t,e)}function dc(t){return function(e,n){var r,o,i=e.selection;if(i instanceof Ma){if(i.$anchorCell.pos!=i.$headCell.pos)return!1;r=i.$anchorCell.nodeAfter,o=i.$anchorCell.pos}else{if(!(r=function(t){for(var e=t.depth;e>0;e--){var n=t.node(e).type.spec.tableRole;if("cell"===n||"header_cell"===n)return t.node(e)}return null}(i.$from)))return!1;o=ma(i.$from).pos}if(1==r.attrs.colspan&&1==r.attrs.rowspan)return!1;if(n){var s=r.attrs,a=[],c=s.colwidth;s.rowspan>1&&(s=Ca(s,"rowspan",1)),s.colspan>1&&(s=Ca(s,"colspan",1));for(var u,l=Ya(e),d=e.tr,p=0;p<l.right-l.left;p++)a.push(c?Ca(s,"colwidth",c&&c[p]?[c[p]]:null):s);for(var f=l.top;f<l.bottom;f++){var h=l.map.positionAt(f,l.left,l.table);f==l.top&&(h+=r.nodeSize);for(var m=l.left,v=0;m<l.right;m++,v++)m==l.left&&f==l.top||d.insert(u=d.mapping.map(h+l.tableStart,1),t({node:r,row:f,col:m}).createAndFill(a[v]))}d.setNodeMarkup(o,t({node:r,row:l.top,col:l.left}),a[0]),i instanceof Ma&&d.setSelection(new Ma(d.doc.resolve(i.$anchorCell.pos),u&&d.doc.resolve(u))),n(d)}return!0}}function pc(t,e){return function(n,r){if(!va(n))return!1;var o=ga(n);if(o.nodeAfter.attrs[t]===e)return!1;if(r){var i=n.tr;n.selection instanceof Ma?n.selection.forEachCell((function(n,r){n.attrs[t]!==e&&i.setNodeMarkup(r,null,Ca(n.attrs,t,e))})):i.setNodeMarkup(o.pos,null,Ca(o.nodeAfter.attrs,t,e)),r(i)}return!0}}function fc(t,e,n){for(var r=e.map.cellsInRect({left:0,top:0,right:"row"==t?e.map.width:1,bottom:"column"==t?e.map.height:1}),o=0;o<r.length;o++){var i=e.table.nodeAt(r[o]);if(i&&i.type!==n.header_cell)return!1}return!0}function hc(t,e){return(e=e||{useDeprecatedLogic:!1}).useDeprecatedLogic?function(t){return function(e,n){if(!va(e))return!1;if(n){for(var r=fa(e.schema),o=Ya(e),i=e.tr,s=o.map.cellsInRect("column"==t?new aa(o.left,0,o.right,o.map.height):"row"==t?new aa(0,o.top,o.map.width,o.bottom):o),a=s.map((function(t){return o.table.nodeAt(t)})),c=0;c<s.length;c++)a[c].type==r.header_cell&&i.setNodeMarkup(o.tableStart+s[c],r.cell,a[c].attrs);if(0==i.steps.length)for(var u=0;u<s.length;u++)i.setNodeMarkup(o.tableStart+s[u],r.header_cell,a[u].attrs);n(i)}return!0}}(t):function(e,n){if(!va(e))return!1;if(n){var r=fa(e.schema),o=Ya(e),i=e.tr,s=fc("row",o,r),a=fc("column",o,r),c=("column"===t?s:"row"===t&&a)?1:0,u="column"==t?new aa(0,c,1,o.map.height):"row"==t?new aa(c,0,o.map.width,1):o,l="column"==t?a?r.cell:r.header_cell:"row"==t?s?r.cell:r.header_cell:r.cell;o.map.cellsInRect(u).forEach((function(t){var e=t+o.tableStart,n=i.doc.nodeAt(e);n&&i.setNodeMarkup(e,l,n.attrs)})),n(i)}return!0}}var mc=hc("row",{useDeprecatedLogic:!0}),vc=hc("column",{useDeprecatedLogic:!0}),gc=hc("cell",{useDeprecatedLogic:!0});function yc(t){return function(e,n){if(!va(e))return!1;var r=function(t,e){if(e<0){var n=t.nodeBefore;if(n)return t.pos-n.nodeSize;for(var r=t.index(-1)-1,o=t.before();r>=0;r--){var i=t.node(-1).child(r);if(i.childCount)return o-1-i.lastChild.nodeSize;o-=i.nodeSize}}else{if(t.index()<t.parent.childCount-1)return t.pos+t.nodeAfter.nodeSize;for(var s=t.node(-1),a=t.indexAfter(-1),c=t.after();a<s.childCount;a++){var u=s.child(a);if(u.childCount)return c+1;c+=u.nodeSize}}}(ga(e),t);if(null!=r){if(n){var o=e.doc.resolve(r);n(e.tr.setSelection(re.between(o,ba(o))).scrollIntoView())}return!0}}}function bc(t,e){for(var n=t.selection.$anchor,r=n.depth;r>0;r--){if("table"==n.node(r).type.spec.tableRole)return e&&e(t.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0}return!1}var wc=function(t,e){this.node=t,this.cellMinWidth=e,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")),_c(t,this.colgroup,this.table,e),this.contentDOM=this.table.appendChild(document.createElement("tbody"))};function _c(t,e,n,r,o,i){for(var s=0,a=!0,c=e.firstChild,u=t.firstChild,l=0,d=0;l<u.childCount;l++)for(var p=u.child(l).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),c?(c.style.width!=g&&(c.style.width=g),c=c.nextSibling):e.appendChild(document.createElement("col")).style.width=g}for(;c;){var y=c.nextSibling;c.parentNode.removeChild(c),c=y}a?(n.style.width=s+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=s+"px")}wc.prototype.update=function(t){return t.type==this.node.type&&(this.node=t,_c(t,this.colgroup,this.table,this.cellMinWidth),!0)},wc.prototype.ignoreMutation=function(t){return"attributes"==t.type&&(t.target==this.table||this.colgroup.contains(t.target))};var xc=new xe("tableColumnResizing");function kc(t){void 0===t&&(t={});var e=t.handleWidth;void 0===e&&(e=5);var n=t.cellMinWidth;void 0===n&&(n=25);var r=t.View;void 0===r&&(r=wc);var o=t.lastColumnResizable;return void 0===o&&(o=!0),new be({key:xc,state:{init:function(t,e){return this.spec.props.nodeViews[fa(e.schema).table.name]=function(t,e){return new r(t,n,e)},new Cc(-1,!1)},apply:function(t,e){return e.apply(t)}},props:{attributes:function(t){return xc.getState(t).activeHandle>-1?{class:"resize-cursor"}:null},handleDOMEvents:{mousemove:function(t,n){!function(t,e,n,r,o){var i=xc.getState(t.state);if(!i.dragging){var s=function(t){for(;t&&"TD"!=t.nodeName&&"TH"!=t.nodeName;)t=t.classList.contains("ProseMirror")?null:t.parentNode;return t}(e.target),a=-1;if(s){var c=s.getBoundingClientRect(),u=c.left,l=c.right;e.clientX-u<=n?a=Sc(t,e,"left"):l-e.clientX<=n&&(a=Sc(t,e,"right"))}if(a!=i.activeHandle){if(!o&&-1!==a){var d=t.state.doc.resolve(a),p=d.node(-1),f=ca.get(p),h=d.start(-1);if(f.colCount(d.pos-h)+d.nodeAfter.attrs.colspan-1==f.width-1)return}Ec(t,a)}}}(t,n,e,0,o)},mouseleave:function(t){!function(t){var e=xc.getState(t.state);e.activeHandle>-1&&!e.dragging&&Ec(t,-1)}(t)},mousedown:function(t,e){!function(t,e,n){var r=xc.getState(t.state);if(-1==r.activeHandle||r.dragging)return!1;var o=t.state.doc.nodeAt(r.activeHandle),i=function(t,e,n){var r=n.colspan,o=n.colwidth,i=o&&o[o.length-1];if(i)return i;var s=t.domAtPos(e),a=s.node.childNodes[s.offset].offsetWidth,c=r;if(o)for(var u=0;u<r;u++)o[u]&&(a-=o[u],c--);return a/c}(t,r.activeHandle,o.attrs);function s(e){window.removeEventListener("mouseup",s),window.removeEventListener("mousemove",a);var r=xc.getState(t.state);r.dragging&&(!function(t,e,n){for(var r=t.state.doc.resolve(e),o=r.node(-1),i=ca.get(o),s=r.start(-1),a=i.colCount(r.pos-s)+r.nodeAfter.attrs.colspan-1,c=t.state.tr,u=0;u<i.height;u++){var l=u*i.width+a;if(!u||i.map[l]!=i.map[l-i.width]){var d=i.map[l],p=o.nodeAt(d).attrs,f=1==p.colspan?0:a-i.colCount(d);if(!p.colwidth||p.colwidth[f]!=n){var h=p.colwidth?p.colwidth.slice():Mc(p.colspan);h[f]=n,c.setNodeMarkup(s+d,null,Ca(p,"colwidth",h))}}}c.docChanged&&t.dispatch(c)}(t,r.activeHandle,Tc(r.dragging,e,n)),t.dispatch(t.state.tr.setMeta(xc,{setDragging:null})))}function a(e){if(!e.which)return s(e);var r=xc.getState(t.state),o=Tc(r.dragging,e,n);!function(t,e,n,r){var o=t.state.doc.resolve(e),i=o.node(-1),s=o.start(-1),a=ca.get(i).colCount(o.pos-s)+o.nodeAfter.attrs.colspan-1,c=t.domAtPos(o.start(-1)).node;for(;"TABLE"!=c.nodeName;)c=c.parentNode;_c(i,c.firstChild,c,r,a,n)}(t,r.activeHandle,o,n)}t.dispatch(t.state.tr.setMeta(xc,{setDragging:{startX:e.clientX,startWidth:i}})),window.addEventListener("mouseup",s),window.addEventListener("mousemove",a),e.preventDefault()}(t,e,n)}},decorations:function(t){var e=xc.getState(t);if(e.activeHandle>-1)return function(t,e){for(var n=[],r=t.doc.resolve(e),o=r.node(-1),i=ca.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 l=i.map[u],d=s+l+o.nodeAt(l).nodeSize-1,p=document.createElement("div");p.className="column-resize-handle",n.push(Bs.widget(d,p))}}return Fs.create(t.doc,n)}(t,e.activeHandle)},nodeViews:{}}})}var Cc=function(t,e){this.activeHandle=t,this.dragging=e};function Sc(t,e,n){var r=t.posAtCoords({left:e.clientX,top:e.clientY});if(!r)return-1;var o=r.pos,i=ma(t.state.doc.resolve(o));if(!i)return-1;if("right"==n)return i.pos;var s=ca.get(i.node(-1)),a=i.start(-1),c=s.map.indexOf(i.pos-a);return c%s.width==0?-1:a+s.map[c-1]}function Tc(t,e,n){var r=e.clientX-t.startX;return Math.max(n,t.startWidth+r)}function Ec(t,e){t.dispatch(t.state.tr.setMeta(xc,{setHandle:e}))}function Mc(t){for(var e=[],n=0;n<t;n++)e.push(0);return e}function Oc(t){void 0===t&&(t={});var e=t.allowTableNodeSelection;return void 0===e&&(e=!1),new be({key:ha,state:{init:function(){return null},apply:function(t,e){var n=t.getMeta(ha);if(null!=n)return-1==n?null:n;if(null==e||!t.docChanged)return e;var r=t.mapping.mapResult(e),o=r.deleted,i=r.pos;return o?null:i}},props:{decorations:Da,handleDOMEvents:{mousedown:Ha},createSelectionBetween:function(t){if(null!=ha.getState(t.state))return t.state.selection},handleTripleClick:$a,handleKeyDown:Ra,handlePaste:Wa},appendTransaction:function(t,n,r){return function(t,e,n){var r,o,i=(e||t).selection,s=(e||t).doc;if(i instanceof ie&&(o=i.node.type.spec.tableRole)){if("cell"==o||"header_cell"==o)r=Ma.create(s,i.from);else if("row"==o){var a=s.resolve(i.from+1);r=Ma.rowSelection(a,a)}else if(!n){var c=ca.get(i.node),u=i.from+1,l=u+c.map[c.width*c.height-1];r=Ma.create(s,u+1,l)}}else i instanceof re&&function(t){var e=t.$from,n=t.$to;if(e.pos==n.pos||e.pos<e.pos-6)return!1;for(var r=e.pos,o=n.pos,i=e.depth;i>=0&&!(e.after(i+1)<e.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(e.node(i).type.spec.tableRole)}(i)?r=re.create(s,i.from):i instanceof re&&function(t){for(var e,n,r=t.$from,o=t.$to,i=r.depth;i>0;i--){var s=r.node(i);if("cell"===s.type.spec.tableRole||"header_cell"===s.type.spec.tableRole){e=s;break}}for(var a=o.depth;a>0;a--){var c=o.node(a);if("cell"===c.type.spec.tableRole||"header_cell"===c.type.spec.tableRole){n=c;break}}return e!==n&&0===o.parentOffset}(i)&&(r=re.create(s,i.$from.start(),i.$from.end()));return r&&(e||(e=t.tr)).setSelection(r),e}(r,Ga(r,n),e)}})}Cc.prototype.apply=function(t){var e=this,n=t.getMeta(xc);if(n&&null!=n.setHandle)return new Cc(n.setHandle,null);if(n&&void 0!==n.setDragging)return new Cc(e.activeHandle,n.setDragging);if(e.activeHandle>-1&&t.docChanged){var r=t.mapping.map(e.activeHandle,-1);ya(t.doc.resolve(r))||(r=null),e=new Cc(r,e.dragging)}return e};var Dc=["blockquote",0],Ic=["hr"],Ac=["pre",["code",0]],Nc=["ol",0],Bc=["ul",0],zc=["li",0],Pc=function(t){for(var e,n={},r=t.attributes,o=0;o<r.length;o++)n[(e=r[o]).name]=e.value;return n},Rc=function(t){var e={};return t.forEach((function(t){e[t]={default:null}})),e},Fc=function(){return Rc(["style","class","id"])},Lc=function(t,e){for(var n in t)if(n&&null!==t[n]&&n!==e)return!0;return!1},Vc=function(t,e){var n={};for(var r in t)r&&null!==t[r]&&r!==e&&(n[r]=t[r]);return n},jc=function(t){var e;return(e={})[t]={name:t,inclusive:!0,parseDOM:[{tag:t}],toDOM:function(){return[t,0]}},e},$c=Be.__assign({link:{attrs:Be.__assign({},Fc(),{href:{default:null},target:{default:null},title:{default:null}}),inclusive:!1,parseDOM:[{tag:"a",getAttrs:Pc}],toDOM:function(t){return["a",Vc(t.attrs),0]}}},jc("strong"),jc("b"),jc("em"),jc("i"),jc("u"),jc("del"),jc("sub"),jc("sup"),jc("code"),{style:{attrs:Be.__assign({},Fc()),parseDOM:[{tag:"span",getAttrs:Pc}],toDOM:function(t){return Lc(t.attrs)?["span",Vc(t.attrs),0]:["span",0]}}}),Wc=function(t){var e;return(e={})[t]={default:null,getFromDOM:function(e){return e.getAttribute(t)},setDOMAttr:function(e,n){n[t]=e}},e},Hc=Be.__assign({},Wc("style"),Wc("class"),Wc("id"),Wc("headers")),qc={doc:{content:"colgroup*"},col:{attrs:Rc(["id","class","style","span"]),parseDOM:[{getAttrs:Pc,tag:"col"}],toDOM:function(t){return["col",t.attrs]}},colgroup:{attrs:Rc(["id","class","style","span"]),content:"col*",parseDOM:[{getAttrs:Pc,tag:"colgroup"}],toDOM:function(t){return["colgroup",t.attrs,0]}},text:{inline:!0,group:"inline"}},Jc=new Z({nodes:qc,marks:{}}),Kc=pa({tableGroup:"block",cellContent:"block+",cellAttributes:Hc});Kc.table_row.attrs=Be.__assign({},Kc.table_row.attrs,Rc([ke,"style","class","id"])),Kc.table_row.toDOM=function(t){return["tr",Vc(t.attrs),0]},Kc.table_row.parseDOM=[{tag:"tr",getAttrs:Pc}],Kc.table.attrs=Be.__assign({},Kc.table.attrs,Rc(["style","class","id","k-colgroup-data"])),Kc.table.toDOM=function(t){var e=Lc(t.attrs)?Vc(t.attrs,"k-colgroup-data"):{},n=null;if(t.attrs["k-colgroup-data"]&&!function(t){for(var e=!1,n=t.child(0),r=0;r<n.childCount;r++){if(n.child(r).attrs.colwidth){e=!0;break}}return e}(t)){var r=De(Me(t.attrs["k-colgroup-data"]),Jc,{preserveWhitespace:!1}),o=Oe(r).firstChild;if(o){var i=Array.from(o.children).map((function(t){return["col",Pc(t)]}));n=["colgroup",Pc(o)].concat(i)}}return n?["table",e,n,["tbody",0]]:["table",e,["tbody",0]]},Kc.table.parseDOM=[{tag:"table",getAttrs:function(t){var e=Pc(t),n=Array.from(t.childNodes).find((function(t){return"COLGROUP"===t.nodeName}));return n&&(e["k-colgroup-data"]=n.outerHTML),e}}];var Uc=Be.__assign({doc:{content:"block+"},paragraph:{content:"inline*",group:"block",attrs:Be.__assign({},Fc()),parseDOM:[{tag:"p",getAttrs:Pc}],toDOM:function(t){return Lc(t.attrs)?["p",Vc(t.attrs),0]:["p",0]}},div:{content:"block*",group:"block",attrs:Be.__assign({},Fc()),parseDOM:[{tag:"div",getAttrs:Pc}],toDOM:function(t){return Lc(t.attrs)?["div",Vc(t.attrs),0]:["div",0]}},blockquote:{attrs:Be.__assign({},Fc()),content:"block+",group:"block",defining:!0,parseDOM:[{tag:"blockquote",getAttrs:Pc}],toDOM:function(t){return Lc(t.attrs)?["blockquote",Vc(t.attrs),0]:Dc}},horizontal_rule:{group:"block",parseDOM:[{tag:"hr"}],toDOM:function(){return Ic}},heading:{attrs:Be.__assign({},Fc(),{level:{default:1}}),content:"inline*",group:"block",defining:!0,parseDOM:[{tag:"h1",getAttrs:function(t){return Be.__assign({},Pc(t),{level:1})}},{tag:"h2",getAttrs:function(t){return Be.__assign({},Pc(t),{level:2})}},{tag:"h3",getAttrs:function(t){return Be.__assign({},Pc(t),{level:3})}},{tag:"h4",getAttrs:function(t){return Be.__assign({},Pc(t),{level:4})}},{tag:"h5",getAttrs:function(t){return Be.__assign({},Pc(t),{level:5})}},{tag:"h6",getAttrs:function(t){return Be.__assign({},Pc(t),{level:6})}}],toDOM:function(t){return Lc(t.attrs,"level")?["h"+t.attrs.level,Vc(t.attrs,"level"),0]:["h"+t.attrs.level,0]}},code_block:{content:"text*",marks:"",group:"block",code:!0,defining:!0,parseDOM:[{tag:"pre",preserveWhitespace:"full"}],toDOM:function(){return Ac}},text:{inline:!0,group:"inline"},image:{inline:!0,attrs:Be.__assign({src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}},Fc()),group:"inline",draggable:!0,parseDOM:[{tag:"img",getAttrs:Pc}],toDOM:function(t){return Lc(t.attrs)?["img",Vc(t.attrs)]:["img"]}},hard_break:{inline:!0,attrs:Be.__assign({},Fc()),group:"inline",selectable:!1,parseDOM:[{tag:"br",getAttrs:Pc}],toDOM:function(t){return Lc(t.attrs)?["br",Vc(t.attrs)]:["br"]}},ordered_list:{content:"list_item+",group:"block",attrs:Be.__assign({},Fc(),{type:{default:null},order:{default:1}}),parseDOM:[{tag:"ol",getAttrs:function(t){return Be.__assign({},Pc(t),{order:t.hasAttribute("start")?parseInt(t.getAttribute("start")||"1",10):1})}}],toDOM:function(t){return 1===t.attrs.order?Lc(t.attrs,"order")?["ol",Vc(t.attrs,"order"),0]:Nc:["ol",Be.__assign({},Vc(t.attrs,"order"),{start:t.attrs.order}),0]}},bullet_list:{content:"list_item+",group:"block",attrs:Be.__assign({},Fc()),parseDOM:[{tag:"ul",getAttrs:Pc}],toDOM:function(t){return Lc(t.attrs)?["ul",Vc(t.attrs),0]:Bc}},list_item:{content:"(paragraph | heading) block*",attrs:Be.__assign({},Fc()),parseDOM:[{tag:"li",getAttrs:Pc}],toDOM:function(t){return Lc(t.attrs)?["li",Vc(t.attrs),0]:zc},defining:!0}},Kc),Gc=function(){};Gc.prototype.append=function(t){return t.length?(t=Gc.from(t),!this.length&&t||t.length<200&&this.leafAppend(t)||this.length<200&&t.leafPrepend(this)||this.appendInner(t)):this},Gc.prototype.prepend=function(t){return t.length?Gc.from(t).append(this):this},Gc.prototype.appendInner=function(t){return new Xc(this,t)},Gc.prototype.slice=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.length),t>=e?Gc.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,e))},Gc.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)},Gc.prototype.forEach=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=this.length),e<=n?this.forEachInner(t,e,n,0):this.forEachInvertedInner(t,e,n,0)},Gc.prototype.map=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=this.length);var r=[];return this.forEach((function(e,n){return r.push(t(e,n))}),e,n),r},Gc.from=function(t){return t instanceof Gc?t:t&&t.length?new Yc(t):Gc.empty};var Yc=function(t){function e(e){t.call(this),this.values=e}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(t,n){return 0==t&&n==this.length?this:new e(this.values.slice(t,n))},e.prototype.getInner=function(t){return this.values[t]},e.prototype.forEachInner=function(t,e,n,r){for(var o=e;o<n;o++)if(!1===t(this.values[o],r+o))return!1},e.prototype.forEachInvertedInner=function(t,e,n,r){for(var o=e-1;o>=n;o--)if(!1===t(this.values[o],r+o))return!1},e.prototype.leafAppend=function(t){if(this.length+t.length<=200)return new e(this.values.concat(t.flatten()))},e.prototype.leafPrepend=function(t){if(this.length+t.length<=200)return new e(t.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(Gc);Gc.empty=new Yc([]);var Xc=function(t){function e(e,n){t.call(this),this.left=e,this.right=n,this.length=e.length+n.length,this.depth=Math.max(e.depth,n.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(t){return t<this.left.length?this.left.get(t):this.right.get(t-this.left.length)},e.prototype.forEachInner=function(t,e,n,r){var o=this.left.length;return!(e<o&&!1===this.left.forEachInner(t,e,Math.min(n,o),r))&&(!(n>o&&!1===this.right.forEachInner(t,Math.max(e-o,0),Math.min(this.length,n)-o,r+o))&&void 0)},e.prototype.forEachInvertedInner=function(t,e,n,r){var o=this.left.length;return!(e>o&&!1===this.right.forEachInvertedInner(t,e-o,Math.max(n,o)-o,r+o))&&(!(n<o&&!1===this.left.forEachInvertedInner(t,Math.min(e,o),n,r))&&void 0)},e.prototype.sliceInner=function(t,e){if(0==t&&e==this.length)return this;var n=this.left.length;return e<=n?this.left.slice(t,e):t>=n?this.right.slice(t-n,e-n):this.left.slice(t,n).append(this.right.slice(0,e-n))},e.prototype.leafAppend=function(t){var n=this.right.leafAppend(t);if(n)return new e(this.left,n)},e.prototype.leafPrepend=function(t){var n=this.left.leafPrepend(t);if(n)return new e(n,this.right)},e.prototype.appendInner=function(t){return this.left.depth>=Math.max(this.right.depth,t.depth)+1?new e(this.left,new e(this.right,t)):new e(this,t)},e}(Gc),Zc=Gc,Qc=function(t,e){this.items=t,this.eventCount=e};Qc.prototype.popEvent=function(t,e){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}}e&&(r=this.remapping(i,this.items.length),o=r.maps.length);var s,a,c=t.tr,u=[],l=[];return this.items.forEach((function(t,e){if(!t.step)return r||(r=n.remapping(i,e+1),o=r.maps.length),o--,void l.push(t);if(r){l.push(new tu(t.map));var d,p=t.step.map(r.slice(o));p&&c.maybeStep(p).doc&&(d=c.mapping.maps[c.mapping.maps.length-1],u.push(new tu(d,null,null,u.length+l.length))),o--,d&&r.appendMap(d,o)}else c.maybeStep(t.step);return t.selection?(s=r?t.selection.map(r.slice(o)):t.selection,a=new Qc(n.items.slice(0,i).append(l.reverse().concat(u)),n.eventCount-1),!1):void 0}),this.items.length,0),{remaining:a,transform:c,selection:s}},Qc.prototype.addTransform=function(t,e,n,r){for(var o=[],i=this.eventCount,s=this.items,a=!r&&s.length?s.get(s.length-1):null,c=0;c<t.steps.length;c++){var u,l=t.steps[c].invert(t.docs[c]),d=new tu(t.mapping.maps[c],l,e);(u=a&&a.merge(d))&&(d=u,c?o.pop():s=s.slice(0,s.length-1)),o.push(d),e&&(i++,e=null),r||(a=d)}var p,f,h,m=i-n.depth;return m>nu&&(f=m,(p=s).forEach((function(t,e){if(t.selection&&0==f--)return h=e,!1})),s=p.slice(h),i-=m),new Qc(s.append(o),i)},Qc.prototype.remapping=function(t,e){var n=new yt;return this.items.forEach((function(e,r){var o=null!=e.mirrorOffset&&r-e.mirrorOffset>=t?n.maps.length-e.mirrorOffset:null;n.appendMap(e.map,o)}),t,e),n},Qc.prototype.addMaps=function(t){return 0==this.eventCount?this:new Qc(this.items.append(t.map((function(t){return new tu(t)}))),this.eventCount)},Qc.prototype.rebased=function(t,e){if(!this.eventCount)return this;var n=[],r=Math.max(0,this.items.length-e),o=t.mapping,i=t.steps.length,s=this.eventCount;this.items.forEach((function(t){t.selection&&s--}),r);var a=e;this.items.forEach((function(e){var r=o.getMirror(--a);if(null!=r){i=Math.min(i,r);var c=o.maps[r];if(e.step){var u=t.steps[r].invert(t.docs[r]),l=e.selection&&e.selection.map(o.slice(a+1,r));l&&s++,n.push(new tu(c,u,l))}else n.push(new tu(c))}}),r);for(var c=[],u=e;u<i;u++)c.push(new tu(o.maps[u]));var l=this.items.slice(0,r).append(c).append(n),d=new Qc(l,s);return d.emptyItemCount()>500&&(d=d.compress(this.items.length-n.length)),d},Qc.prototype.emptyItemCount=function(){var t=0;return this.items.forEach((function(e){e.step||t++})),t},Qc.prototype.compress=function(t){void 0===t&&(t=this.items.length);var e=this.remapping(0,t),n=e.maps.length,r=[],o=0;return this.items.forEach((function(i,s){if(s>=t)r.push(i),i.selection&&o++;else if(i.step){var a=i.step.map(e.slice(n)),c=a&&a.getMap();if(n--,c&&e.appendMap(c,n),a){var u=i.selection&&i.selection.map(e.slice(n));u&&o++;var l,d=new tu(c.invert(),a,u),p=r.length-1;(l=r.length&&r[p].merge(d))?r[p]=l:r.push(d)}}else i.map&&n--}),this.items.length,0),new Qc(Zc.from(r.reverse()),o)},Qc.empty=new Qc(Zc.empty,0);var tu=function(t,e,n,r){this.map=t,this.step=e,this.selection=n,this.mirrorOffset=r};tu.prototype.merge=function(t){if(this.step&&t.step&&!t.selection){var e=t.step.merge(this.step);if(e)return new tu(e.getMap().invert(),e,this.selection)}};var eu=function(t,e,n,r){this.done=t,this.undone=e,this.prevRanges=n,this.prevTime=r},nu=20;function ru(t){var e=[];return t.forEach((function(t,n,r,o){return e.push(r,o)})),e}function ou(t,e){if(!t)return null;for(var n=[],r=0;r<t.length;r+=2){var o=e.map(t[r],1),i=e.map(t[r+1],-1);o<=i&&n.push(o,i)}return n}function iu(t,e,n,r){var o=cu(e),i=lu.get(e).spec.config,s=(r?t.undone:t.done).popEvent(e,o);if(s){var a=s.selection.resolve(s.transform.doc),c=(r?t.done:t.undone).addTransform(s.transform,e.selection.getBookmark(),i,o),u=new eu(r?c:s.remaining,r?s.remaining:c,null,0);n(s.transform.setSelection(a).setMeta(lu,{redo:r,historyState:u}).scrollIntoView())}}var su=!1,au=null;function cu(t){var e=t.plugins;if(au!=e){su=!1,au=e;for(var n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){su=!0;break}}return su}function uu(t){return t.setMeta(du,!0)}var lu=new xe("history"),du=new xe("closeHistory");function pu(t){return t={depth:t&&t.depth||100,newGroupDelay:t&&t.newGroupDelay||500},new be({key:lu,state:{init:function(){return new eu(Qc.empty,Qc.empty,null,0)},apply:function(e,n,r){return function(t,e,n,r){var o,i=n.getMeta(lu);if(i)return i.historyState;n.getMeta(du)&&(t=new eu(t.done,t.undone,null,0));var s=n.getMeta("appendedTransaction");if(0==n.steps.length)return t;if(s&&s.getMeta(lu))return s.getMeta(lu).redo?new eu(t.done.addTransform(n,null,r,cu(e)),t.undone,ru(n.mapping.maps[n.steps.length-1]),t.prevTime):new eu(t.done,t.undone.addTransform(n,null,r,cu(e)),null,t.prevTime);if(!1===n.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))return(o=n.getMeta("rebased"))?new eu(t.done.rebased(n,o),t.undone.rebased(n,o),ou(t.prevRanges,n.mapping),t.prevTime):new eu(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),ou(t.prevRanges,n.mapping),t.prevTime);var a=0==t.prevTime||!s&&(t.prevTime<(n.time||0)-r.newGroupDelay||!function(t,e){if(!e)return!1;if(!t.docChanged)return!0;var n=!1;return t.mapping.maps[0].forEach((function(t,r){for(var o=0;o<e.length;o+=2)t<=e[o+1]&&r>=e[o]&&(n=!0)})),n}(n,t.prevRanges)),c=s?ou(t.prevRanges,n.mapping):ru(n.mapping.maps[n.steps.length-1]);return new eu(t.done.addTransform(n,a?e.selection.getBookmark():null,r,cu(e)),Qc.empty,c,n.time)}(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput:function(t,e){var n="historyUndo"==e.inputType?fu(t.state,t.dispatch):"historyRedo"==e.inputType&&hu(t.state,t.dispatch);return n&&e.preventDefault(),n}}}})}function fu(t,e){var n=lu.getState(t);return!(!n||0==n.done.eventCount)&&(e&&iu(n,t,e,!1),!0)}function hu(t,e){var n=lu.getState(t);return!(!n||0==n.undone.eventCount)&&(e&&iu(n,t,e,!0),!0)}function mu(t){var e=lu.getState(t);return e?e.done.eventCount:0}function vu(t){var e=lu.getState(t);return e?e.undone.eventCount:0}var gu=function(t,e){var n;this.match=t,this.handler="string"==typeof e?(n=e,function(t,e,r,o){var i=n;if(e[1]){var s=e[0].lastIndexOf(e[1]);i+=e[0].slice(s+e[1].length);var a=(r+=s)-o;a>0&&(i=e[0].slice(s-a,s)+i,r=o)}return t.tr.insertText(i,r,o)}):e};function yu(t){var e=t.rules,n=new be({state:{init:function(){return null},apply:function(t,e){var n=t.getMeta(this);return n||(t.selectionSet||t.docChanged?null:e)}},props:{handleTextInput:function(t,r,o,i){return bu(t,r,o,i,e,n)},handleDOMEvents:{compositionend:function(t){setTimeout((function(){var r=t.state.selection.$cursor;r&&bu(t,r.pos,r.pos,"",e,n)}))}}},isInputRules:!0});return n}function bu(t,e,n,r,o,i){if(t.composing)return!1;var s=t.state,a=s.doc.resolve(e);if(a.parent.type.spec.code)return!1;for(var c=a.parent.textBetween(Math.max(0,a.parentOffset-500),a.parentOffset,null,"")+r,u=0;u<o.length;u++){var l=o[u].match.exec(c),d=l&&o[u].handler(s,l,e-(l[0].length-r.length),n);if(d)return t.dispatch(d.setMeta(i,{transform:d,from:e,to:n,text:r})),!0}return!1}function wu(t,e){for(var n=t.plugins,r=0;r<n.length;r++){var o=n[r],i=void 0;if(o.spec.isInputRules&&(i=o.getState(t))){if(e){for(var s=t.tr,a=i.transform,c=a.steps.length-1;c>=0;c--)s.step(a.steps[c].invert(a.docs[c]));if(i.text){var u=s.doc.resolve(i.from).marks();s.replaceWith(i.from,i.to,t.schema.text(i.text,u))}else s.delete(i.from,i.to);e(s)}return!0}}return!1}var _u=new gu(/--$/,"—"),xu=new gu(/\.\.\.$/,"…"),ku=new gu(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,"“"),Cu=new gu(/"$/,"”"),Su=new gu(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,"‘"),Tu=new gu(/'$/,"’"),Eu=[ku,Cu,Su,Tu];function Mu(t,e,n,r){return new gu(t,(function(t,o,i,s){var a=n instanceof Function?n(o):n,c=t.tr.delete(i,s),u=c.doc.resolve(i).blockRange(),l=u&&It(u,e,a);if(!l)return null;c.wrap(u,l);var d=c.doc.resolve(i-1).nodeBefore;return d&&d.type==e&&Bt(c.doc,i-1)&&(!r||r(o,d))&&c.join(i-1),c}))}function Ou(t,e,n){return new gu(t,(function(t,r,o,i){var s=t.doc.resolve(o),a=n instanceof Function?n(r):n;return s.node(-1).canReplaceWith(s.index(-1),s.indexAfter(-1),e)?t.tr.delete(o,i).setBlockType(o,o,e,a):null}))}var Du={mark:"strong",altMarks:["b"],altStyle:{name:"font-weight",value:/^(bold(er)?|[5-9]\d{2,})$/}},Iu={mark:"em",altMarks:["i"],altStyle:{name:"font-style",value:/^italic$/i}},Au={mark:"u",altStyle:{name:"text-decoration",value:/^underline$/i}},Nu={mark:"del",altStyle:{name:"text-decoration",value:/^line-through$/i}},Bu={mark:"sub"},zu={mark:"sup"},Pu={mark:"link"},Ru="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),Fu=function(t,e){var n={},r=e&&e.applyToWord||!1;if(n["Mod-z"]=fu,n["Shift-Mod-z"]=hu,n.Backspace=yr(wu,Hn,qn,Kn),n.Enter=yr(er,or,ir,ar),Ru||(n["Mod-y"]=hu),t.marks.strong&&(n["Mod-b"]=Ke(un,Be.__assign({},Du,{applyToWord:r}))),t.marks.em&&(n["Mod-i"]=Ke(un,Be.__assign({},Iu,{applyToWord:r}))),t.marks.u&&(n["Mod-u"]=Ke(un,Be.__assign({},Au,{applyToWord:r}))),t.nodes.hard_break){var o=t.nodes.hard_break,i=yr(rr,(function(t,e){return e(t.tr.replaceSelectionWith(o.create()).scrollIntoView()),!0}));n["Shift-Enter"]=i}return n},Lu=function(t){var e,n={};return t.nodes.list_item&&(n.Enter=(e=t.nodes.list_item,function(t,n){return Pn(e)(t,(function(e){var r=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();r&&e.ensureMarks(r),n(e)}))})),n},Vu=/style=['"]?[^'"]*?mso-list:\s*[a-zA-Z]+(\d+)\s[a-zA-Z]+(\d+)\s(\w+)/gi,ju=function(t){return/^MsoListParagraph/.test(t.className)},$u=function(t){var e=t.innerHTML;return e=(e=e.replace(/<!--(.|\s)*?-->/gi,"")).replace(/<\/?[^>]+?\/?>/gm,"")},Wu=function(t,e){var n=document.createElement(t);return n.style.listStyleType=e,n},Hu=function(t){var e=null;return/^\d/.test(t)||(e=(/^[a-z]/.test(t)?"lower-":"upper-")+(/^[ivxlcdm]/i.test(t)?"roman":"alpha")),e},qu=function(t,e){var n=[];Array.from(t).forEach((function(t){if(t.nodeType===Node.ELEMENT_NODE){var r=t;r.getAttribute("datalist")?(n.push(t),e.add(n)):ju(r)&&n.length?n.push(t):(n=[],"DIV"===r.nodeName?qu(r.children,e):"TABLE"===r.nodeName&&Array.from(r.querySelectorAll("td,th")).forEach((function(t){qu(t.children,e)})))}}))},Ju=function(t){var e,n=t.innerHTML,r=function(t){return t.replace(/^(?:&nbsp;|[\u00a0\n\r\s])+/,"")};return n=n.replace(/<\/?\w+[^>]*>/g,"").replace(/&nbsp;/g," "),/^[\u2022\u00b7\u00a7\u00d8oØüvn][\u00a0 ]+/.test(n)?{tag:"ul",style:(e=r($u(t)),/^[\u2022\u00b7\u00FC\u00D8\u002dv-]/.test(e)?null:/^o/.test(e)?"circle":"square")}:/^\s*\w+[\.\)][\u00a0 ]{2,}/.test(n)?{tag:"ol",style:Hu(r($u(t)))}:void 0},Ku=function(t){var e,n=t.nodeName.toLowerCase();t.firstChild&&t.firstChild.nodeType===Node.COMMENT_NODE&&t.removeChild(t.firstChild),1===t.childNodes.length?e=t.firstChild.nodeType===Node.TEXT_NODE?$u(t):t.firstChild.innerHTML.replace(/^\w+[\.\)](&nbsp;)+ /,""):(t.removeChild(t.firstChild),3===t.firstChild.nodeType&&/^[ivxlcdm]+\.$/i.test(t.firstChild.nodeValue)&&t.removeChild(t.firstChild),/^(&nbsp;|\s)+$/i.test(t.firstChild.innerHTML)&&t.removeChild(t.firstChild),e="p"!==n?"<"+n+">"+t.innerHTML+"</"+n+">":t.innerHTML),t.parentNode.removeChild(t);var r=document.createElement("li");return r.innerHTML=e,r},Uu=function(t){var e=document.createElement("div");e.innerHTML=function(t){return t=t.replace(Vu,(function(t,e,n){return'datalist="'+e+'" datalevel="'+n+'" '+t}))}(t);var n=new Set;return qu(e.children,n),n.forEach((function(t){return function(t){var e,n,r,o,i,s,a,c,u,l,d,p,f,h=-1,m={};for(c=0;c<t.length;c++){var v=(f={datalist:(u=t[c]).getAttribute("datalist"),datalevel:u.getAttribute("datalevel")}).datalist,g=Ju(u);if(l=g&&g.tag){if(d=f.datalevel||parseFloat(u.style.marginLeft||0),f.datalevel||u.style.marginLeft){var y=l+v;m[d]||(m[d]={}),(!n||n<0)&&(n=d,r=v,o=(a=t.filter((function(t){return t.getAttribute("datalist")===String(r)})))[a.length-1],s=Wu(l,g&&g.style),u.parentNode.insertBefore(s,u),h=d,m[d][y]=s),i=o===u,p=m[d][y],(d>h||!p)&&(p=Wu(l,g&&g.style),m[d][y]=p,e.appendChild(p)),e=Ku(u),p.appendChild(e),i?n=h=-1:h=d}}else!e||i&&!ju(u)||(u.style.marginLeft&&(u.style.marginLeft=""),u.style.marginLeft&&(u.style.margin=""),e.appendChild(u))}}(t)})),e.innerHTML},Gu=function(t){return t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.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,"")},Yu=function(t){return t.replace(/<!--[\s\S]+?-->/g,"")},Xu=function(t,e){return t.replace(new RegExp("<\\/?("+e+")(?:\\s[^>]*?)?>","gi"),"")},Zu=function(t){t.ownerElement&&t.ownerElement.removeAttribute(t.name)},Qu=function(t){/^Mso/.test(t.value)&&Zu(t)},tl=/\s*;\s*/,el=/\s*:\s*/,nl=function(t){var e,n,r=t.value.split(tl).filter((function(t){return Boolean(t)})),o=t.ownerElement.style,i="";r.forEach((function(t){var r;r=t.split(el),e=r[0],n=r[1],void 0!==o[e]&&(i+=e+": "+n+"; ")})),(i=i.trim())?t.value=i:Zu(t)},rl=function(t,e){var n=t;if(e.convertMsLists&&(n=Uu(n)),e.stripTags&&(n=Xu(n,e.stripTags)),e.attributes){var r=document.createElement("div");r.innerHTML=n,Array.from(r.querySelectorAll("*")).forEach((function(t){return function(t,e){if(t.nodeType===Node.ELEMENT_NODE){for(var n=t.attributes.length-1;n>=0;n--){var r=t.attributes[n];e[r.name]?e[r.name](r):e["*"]&&e["*"](r)}"SPAN"===t.nodeName&&0===t.attributes.length&&function(t){var e=t.parentNode;if(e){for(;t.firstChild;)e.insertBefore(t.firstChild,t);e.removeChild(t)}}(t)}}(t,e.attributes)})),n=r.innerHTML}return n};function ol(t){for(var e=t.length,n=new Array(e/2),r=0;r<e;r+=2)n[r]=String.fromCharCode(parseInt(t.substring(r,r+2),16));return btoa(n.join(""))}var il=/<img\s[^>]*?src=(?:'|")file:\/[^'"]+(?:'|")[^>]*>/gi,sl=/{\\pict[\s\S]+?\\bliptag-?\d+(\\blipupi-?\d+)?({\\\*\\blipuid\s?[\da-fA-F]+)?[\s}]*?/,al=new RegExp("(?:("+sl.source+"))([\\da-fA-F\\s]+)\\}","g"),cl=/[^\da-fA-F]/g,ul=/file:\/[^'"]+\.(jpg|png|gif)/i,ll=/\\(png|jpeg)blip\\/,dl=function(t,e){var n=t.match(il);if(!n||-1===e.types.indexOf("text/rtf"))return t;var r=e.getData("text/rtf"),o=[],i=r.match(al);if(!r||!i)return t;for(var s=0,a=i;s<a.length;s++){var c=a[s],u=ll.exec(c);if(u){var l=c.replace(sl,"").replace(cl,"");o.push("data:image/"+u[1]+";base64,"+ol(l))}}return n.length!==o.length?t:t.replace(il,(function(t){var e=o.shift()||"";return t.replace(ul,e)}))},pl=function(t,e,n,r,o){var i,s,a,c,u,l,d=[],p=[],f=e.matchCase,h=e.matchWord,m=e.useRegExp,v=e.text;if(m&&(/^\\$/.test(v)||/[^\\]\\$/.test(v))&&(v=v.substring(0,v.length-1)),!v)return d;var g=f?"g":"gi",y=m?new RegExp(v,g):bl(v,g);return t.nodesBetween(n,r,(function(e,f,m){if(o(d))return!1;e.inlineContent&&f+e.content.size>=n&&(p.length=0,e.nodesBetween(0,e.content.size,(function(e,m,v,g){if(o(d))return!1;var b=1+f+m;if(e.isText&&b+e.nodeSize>=n){if(u=e.text||"",l=v.childCount-1>=g+1&&v.child(g+1),p.push(n<=b?{text:u,start:b}:{text:u.slice(n-b),start:n}),l&&l.isText)return;for(s=p.map((function(t){return t.text})).join(""),i=y.exec(s);null!==i&&(a=p[0].start+i.index,c=a+i[0].length,n<=a&&r>=c&&yl(i,h)&&d.push(re.create(t,a,c)),!o(d));)i=y.exec(s)}else p.length=0})))})),d},fl=function(t,e){var n=e.backward,r=e.matchCyclic,o=Be.__rest(e,["backward","matchCyclic"]),i=n?function(){return!1}:function(t){return t.length>0},s=t.doc,a=t.selection,c=[];return n?!(c=pl(s,o,0,a.from,i)).length&&r&&(c=pl(s,o,a.from,s.content.size,i)):!(c=pl(s,o,a.to,s.content.size,i)).length&&r&&(c=pl(s,o,0,a.to,i)),c.length?c[c.length-1]:null},hl=function(t,e){return pl(t,e,0,t.content.size,(function(){return!1}))},ml=function(t,e,n){var r=t.from,o=t.to;return n.insertText(e,r,o).setSelection(re.create(n.doc,r,r+e.length)),n},vl=function(t,e,n){var r=hl(t.doc,n);if(0===r.length)return null;for(var o=t.tr,i=r.length-1;i>=0;i--)o.insertText(e,r[i].from,r[i].to);return o},gl=/^[\s0-9~`!@#$%\^&*\(\)_\-=+\\|\[\]{};:'"\?/.,<>]?$/,yl=function(t,e){if(e){if(!0===e){var n=t.input,r=n.charAt(t.index-1),o=n.charAt(t.index+t[0].length);return gl.test(r)&&gl.test(o)}return e(t)}return!0},bl=function(t,e){var n=t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d").replace(/\s/g,"\\s");return new RegExp(n,e)};function wl(t){var e={class:"k-placeholder","data-placeholder":t};return new be({key:new xe("placeholder"),props:{decorations:function(t){var n=t.doc,r=n.content.firstChild;if(!(0===n.childCount||1===n.childCount&&r.inlineContent&&0===r.childCount))return Fs.empty;var o=[];return n.descendants((function(t,n){o.push(Bs.node(n,n+t.nodeSize,e))})),Fs.create(n,o)}}})}var _l=/\s+/g,xl=/text-align/,kl=function(){return new be({key:new xe("spaces-fix"),props:{decorations:function(t){var e,n,r,o,i=[],s=t.doc;return s.nodesBetween(0,s.content.size,(function(t,s,a){if(t.type.isText&&function(t){return xl.test(t&&t.attrs&&t.attrs.style||"")}(a))for(n=_l.exec(t.text||"");null!==n;){if(e=s+n.index,r=n[0].length,n.index+r<n.input.length)for(o=0;o<=r-1;o+=2)i.push(Bs.inline(e+o,e+o+1,{style:"white-space: normal"}));n=_l.exec(t.text||"")}})),Fs.create(s,i)}}})},Cl=new xe("highlight");function Sl(t){return void 0===t&&(t=Cl),new be({key:t,state:{init:function(){return null},apply:function(t){return t.getMeta(this.spec.key)}},props:{decorations:function(t){var e=(this.spec.key.getState(t)||[]).map((function(t){return Bs.inline(t.from,t.to,t.attrs)}));return Fs.create(t.doc,e)}}})}var Tl=new xe("image-resize"),El={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}},Ml=Object.keys(El),Ol=function(t,e,n){t.style[e]=n+"px"},Dl=/[^\-]width:|[^\-]height:/,Il=/^.+$/,Al=function(){function t(t,e,n,r){this.activeHandle=t,this.dragging=e,this.rect=n,this.nodePosition=r}return t.prototype.apply=function(e){var n=e.getMeta(Tl);return n?new t(n.activeHandle,n.setDragging,n.rect,n.nodePosition):this},t}(),Nl=function(t,e,n){var r=e.target.getAttribute("data-direction");if(!r)return!1;var o=Tl.getState(t.state);e.preventDefault();var i=t.state.tr;function s(e){!function(t,e,n){var r=Tl.getState(t.state),o=r.rect,i=r.dragging,s=r.nodePosition,a=r.activeHandle;if(i&&o){var c=t.nodeDOM(s),u=El[a],l=(e.clientX-i.startX)*u.x,d=(e.clientY-i.startY)*u.y,p=u.x?l+c.width:o.width,f=u.y?d+c.height:o.height;if(n.lockRatio&&u.x&&u.y){var h=Math.min(p/c.width,f/c.height),m=c.width*h,v=c.height*h;i.startX=e.clientX-(p-m)*u.x,i.startY=e.clientY-(f-v)*u.y,p=m,f=v}else i.startX=u.x?e.clientX:i.startX,i.startY=u.y?e.clientY:i.startY;Ol(c,"width",p),Ol(c,"height",f),o.top=c.offsetTop,o.left=c.offsetLeft,o.width=c.offsetWidth,o.height=c.offsetHeight;var g=c.nextElementSibling;g.style.width=o.width+"px",g.style.height=o.height+"px",g.style.top=o.top+"px",g.style.left=o.left+"px"}}(t,e,n)}return i.setMeta(Tl,{setDragging:{startX:e.clientX,startY:e.clientY},activeHandle:r,rect:o.rect,nodePosition:o.nodePosition}),i.setMeta("addToHistory",!1),t.dispatch(i),e.view.addEventListener("mouseup",(function e(n){n.view.removeEventListener("mouseup",e),n.view.removeEventListener("mousemove",s),function(t){var e=Tl.getState(t.state),n=e.rect,r=e.dragging,o=e.nodePosition;if(r&&n){var i=t.state.selection;if(i instanceof ie){var s=i.node.attrs,a=n.width,c=n.height,u=void 0;if(Dl.test(s.style||"")){var l=ze(s.style,{style:"width",value:Il,newValue:a+"px"}),d=ze(l.style||"",{style:"height",value:Il,newValue:c+"px"}).style;u=Be.__assign({},s,{style:d})}else u=Be.__assign({},s,{width:a,height:c});var p=i.node.type.createAndFill(u);if(p){var f=t.state.tr;f.replaceWith(o,o+1,p),f.setSelection(ie.create(f.doc,o)),f.setMeta("commandName","image-resize"),f.setMeta("args",u),f.setMeta(Tl,{setDragging:null,activeHandle:null,rect:n,nodePosition:o}),t.dispatch(f)}}}}(t)})),e.view.addEventListener("mousemove",s),!0},Bl=function(t){return void 0===t&&(t={node:"image",lockRatio:!0}),new be({key:Tl,view:function(e){return{resize:function(){Tl.getState(e.state).rect&&e.dispatch(e.state.tr.setMeta("resize",!0))},get window(){return e.dom.ownerDocument&&e.dom.ownerDocument.defaultView},attachResize:function(){var t=this.window;t&&(t.removeEventListener("resize",this.resize),t.addEventListener("resize",this.resize))},removeResize:function(){var t=this.window;t&&t.removeEventListener("resize",this.resize)},update:function(e,n){var r=e.state,o=r.selection,i=r.schema.nodes[t.node],s=Tl.getState(r),a=s.rect;if(o instanceof ie&&i===o.node.type){var c=e.nodeDOM(o.from),u={top:c.offsetTop,left:c.offsetLeft,width:c.offsetWidth,height:c.offsetHeight};if(!n.selection.eq(o)||a&&(a.width!==u.width||a.height!==u.height||a.top!==u.top||a.left!==u.left)){var l=r.tr;l.setMeta(Tl,{rect:u,nodePosition:o.from}),e.dispatch(l),this.attachResize()}}else a&&(s.rect=null,s.nodePosition=-1)},destroy:function(){this.removeResize()}}},state:{init:function(){return new Al("",null,null,-1)},apply:function(t,e){return e.apply(t)}},props:{handleDOMEvents:{mousedown:function(e,n){return Nl(e,n,t)}},decorations:function(e){var n=e.selection,r=e.schema.nodes[t.node],o=Tl.getState(e).rect;if(o&&n instanceof ie&&r===n.node.type){var i=document.createElement("div");i.className="k-editor-resize-handles-wrapper",i.style.width=o.width+"px",i.style.height=o.height+"px",i.style.top=o.top+"px",i.style.left=o.left+"px";for(var s=0;s<Ml.length;s++){var a=document.createElement("div");a.className="k-editor-resize-handle "+Ml[s],a.setAttribute("data-direction",Ml[s]),i.appendChild(a)}return Fs.create(e.doc,[Bs.widget(e.selection.from+1,i)])}return Fs.empty}}})},zl=new xe("caret-color");function Pl(){return new be({key:zl,props:{decorations:function(t){var e=t.doc,n=t.selection,r=t.storedMarks;if(!n.empty||!r)return Fs.empty;var o=tn((r||[]).find((function(t){return"style"===t.type.name})),{name:"color",value:/^.+$/});if(!o)return Fs.empty;var i=n.$anchor.parent,s=[];return e.descendants((function(t,e){t.eq(i)&&s.push(Bs.node(e,e+t.nodeSize,{style:"caret-color: "+o}))})),Fs.create(e,s)}}})}function Rl(t){return void 0===t&&(t={}),new be({view:function(e){return new Fl(e,t)}})}var Fl=function(t,e){var n=this;this.editorView=t,this.width=e.width||1,this.color=e.color||"black",this.class=e.class,this.cursorPos=null,this.element=null,this.timeout=null,this.handlers=["dragover","dragend","drop","dragleave"].map((function(e){var r=function(t){return n[e](t)};return t.dom.addEventListener(e,r),{name:e,handler:r}}))};Fl.prototype.destroy=function(){var t=this;this.handlers.forEach((function(e){var n=e.name,r=e.handler;return t.editorView.dom.removeEventListener(n,r)}))},Fl.prototype.update=function(t,e){null!=this.cursorPos&&e.doc!=t.state.doc&&(this.cursorPos>t.state.doc.content.size?this.setCursor(null):this.updateOverlay())},Fl.prototype.setCursor=function(t){t!=this.cursorPos&&(this.cursorPos=t,null==t?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())},Fl.prototype.updateOverlay=function(){var t,e=this.editorView.state.doc.resolve(this.cursorPos);if(!e.parent.inlineContent){var n=e.nodeBefore,r=e.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),t={left:o.left,right:o.right,top:i-this.width/2,bottom:i+this.width/2}}}if(!t){var s=this.editorView.coordsAtPos(this.cursorPos);t={left:s.left-this.width/2,right:s.left+this.width/2,top:s.top,bottom:s.bottom}}var a,c,u=this.editorView.dom.offsetParent;if(this.element||(this.element=u.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),!u||u==document.body&&"static"==getComputedStyle(u).position)a=-pageXOffset,c=-pageYOffset;else{var l=u.getBoundingClientRect();a=l.left-u.scrollLeft,c=l.top-u.scrollTop}this.element.style.left=t.left-a+"px",this.element.style.top=t.top-c+"px",this.element.style.width=t.right-t.left+"px",this.element.style.height=t.bottom-t.top+"px"},Fl.prototype.scheduleRemoval=function(t){var e=this;clearTimeout(this.timeout),this.timeout=setTimeout((function(){return e.setCursor(null)}),t)},Fl.prototype.dragover=function(t){if(this.editorView.editable){var e=this.editorView.posAtCoords({left:t.clientX,top:t.clientY}),n=e&&e.inside>=0&&this.editorView.state.doc.nodeAt(e.inside),r=n&&n.type.spec.disableDropCursor,o="function"==typeof r?r(this.editorView,e):r;if(e&&!o){var i=e.pos;if(this.editorView.dragging&&this.editorView.dragging.slice&&null==(i=Ft(this.editorView.state.doc,i,this.editorView.dragging.slice)))return this.setCursor(null);this.setCursor(i),this.scheduleRemoval(5e3)}}},Fl.prototype.dragend=function(){this.scheduleRemoval(20)},Fl.prototype.drop=function(){this.scheduleRemoval(20)},Fl.prototype.dragleave=function(t){t.target!=this.editorView.dom&&this.editorView.dom.contains(t.relatedTarget)||this.setCursor(null)};var Ll=function(t){function e(e){t.call(this,e,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.map=function(n,r){var o=n.resolve(r.map(this.head));return e.valid(o)?new e(o):t.near(o)},e.prototype.content=function(){return p.empty},e.prototype.eq=function(t){return t instanceof e&&t.head==this.head},e.prototype.toJSON=function(){return{type:"gapcursor",pos:this.head}},e.fromJSON=function(t,n){if("number"!=typeof n.pos)throw new RangeError("Invalid input for GapCursor.fromJSON");return new e(t.resolve(n.pos))},e.prototype.getBookmark=function(){return new Vl(this.anchor)},e.valid=function(t){var e=t.parent;if(e.isTextblock||!function(t){for(var e=t.depth;e>=0;e--){var n=t.index(e),r=t.node(e);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}(t)||!function(t){for(var e=t.depth;e>=0;e--){var n=t.indexAfter(e),r=t.node(e);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}(t))return!1;var n=e.type.spec.allowGapCursor;if(null!=n)return n;var r=e.contentMatchAt(t.index()).defaultType;return r&&r.isTextblock},e.findFrom=function(t,n,r){t:for(;;){if(!r&&e.valid(t))return t;for(var o=t.pos,i=null,s=t.depth;;s--){var a=t.node(s);if(n>0?t.indexAfter(s)<a.childCount:t.index(s)>0){i=a.child(n>0?t.indexAfter(s):t.index(s)-1);break}if(0==s)return null;o+=n;var c=t.doc.resolve(o);if(e.valid(c))return c}for(;;){var u=n>0?i.firstChild:i.lastChild;if(!u){if(i.isAtom&&!i.isText&&!ie.isSelectable(i)){t=t.doc.resolve(o+i.nodeSize*n),r=!1;continue t}break}i=u,o+=n;var l=t.doc.resolve(o);if(e.valid(l))return l}return null}},e}(te);Ll.prototype.visible=!1,te.jsonID("gapcursor",Ll);var Vl=function(t){this.pos=t};Vl.prototype.map=function(t){return new Vl(t.map(this.pos))},Vl.prototype.resolve=function(t){var e=t.resolve(this.pos);return Ll.valid(e)?new Ll(e):te.near(e)};var jl=function(){return new be({props:{decorations:ql,createSelectionBetween:function(t,e,n){if(e.pos==n.pos&&Ll.valid(n))return new Ll(n)},handleClick:Hl,handleKeyDown:$l}})},$l=uo({ArrowLeft:Wl("horiz",-1),ArrowRight:Wl("horiz",1),ArrowUp:Wl("vert",-1),ArrowDown:Wl("vert",1)});function Wl(t,e){var n="vert"==t?e>0?"down":"up":e>0?"right":"left";return function(t,r,o){var i=t.selection,s=e>0?i.$to:i.$from,a=i.empty;if(i instanceof re){if(!o.endOfTextblock(n)||0==s.depth)return!1;a=!1,s=t.doc.resolve(e>0?s.after():s.before())}var c=Ll.findFrom(s,e,a);return!!c&&(r&&r(t.tr.setSelection(new Ll(c))),!0)}}function Hl(t,e,n){if(!t.editable)return!1;var r=t.state.doc.resolve(e);if(!Ll.valid(r))return!1;var o=t.posAtCoords({left:n.clientX,top:n.clientY}).inside;return!(o>-1&&ie.isSelectable(t.state.doc.nodeAt(o)))&&(t.dispatch(t.state.tr.setSelection(new Ll(r))),!0)}function ql(t){if(!(t.selection instanceof Ll))return null;var e=document.createElement("div");return e.className="ProseMirror-gapcursor",Fs.create(t.doc,[Bs.widget(t.selection.head,e,{key:"gapcursor"})])}var Jl=function(t,e,n){for(var r,o=t.table,i=t.table_row,s=t.table_cell,a=[],c=0;c<e+1;c++){r=[];for(var u=0;u<n+1;u++)r.push(s.createAndFill());a.push(i.createAndFill(void 0,r))}return o.createAndFill(void 0,a)},Kl=function(t,e){for(var n=t.$head,r=n.depth;r>0;r--){var o=n.node(r);if(o.type.name===e)return{pos:n.before(r),node:o}}return null},Ul=function(t,e){return oc(t,e&&function(t){var n,r=Kl(t.selection,"table_row"),o=Kl(t.selection,"table");if(r&&o&&r.node.attrs[ke]){for(var i=0,s=0;s<o.node.nodeSize;s++)if(o.node.child(s).eq(r.node)){i=s;break}var a=o.node.child(i-1),c=r.pos-a.nodeSize;t.setNodeMarkup(c,void 0,((n={})[ke]=r.node.attrs[ke],n))}return e(t)})},Gl=function(t,e){return ic(t,e&&function(t){var n,r=Kl(t.selection,"table_row");if(r&&r.node.attrs[ke]){var o=r.pos+r.node.nodeSize;t.setNodeMarkup(o,void 0,((n={})[ke]=r.node.attrs[ke],n))}return e(t)})}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(10);e.outerWidth=function(t){var e=t.offsetWidth,n=getComputedStyle(t);return e+=parseFloat(n.marginLeft)||0+parseFloat(n.marginRight)||0},e.removeEntries=function(t,e){return Object.keys(t).filter((function(t){return e(t)})).reduce((function(e,n){var r;return Object.assign(e,((r={})[n]=t[n],r))}),{})},e.removeEmptyEntries=function(t){return e.removeEntries(t,(function(e){return null!==t[e]&&void 0!==t[e]&&""!==t[e]}))},e.isEmpty=function(t){return 0===Object.keys(t).length},e.isNullOrUndefined=function(t){return null==t},e.isPresent=function(t){return!e.isNullOrUndefined(t)},e.detectIE=function(){if(!r.isDocumentAvailable())return!1;var t=window.navigator.userAgent,e=t.indexOf("MSIE "),n=t.indexOf("Trident/");return e>0||n>0},e.safeString=function(t){return e.isNullOrUndefined(t)?"":t.toString()},e.first=function(t){return t[0]},e.last=function(t){return t[t.length-1]},e.unique=function(t){return Array.from(new Set(t))},e.split=function(t){return function(e){return e.split(t)}},e.trim=function(t){return t.trim()},e.filter=function(t){return function(e){return e.filter(t)}},e.toArray=function(t){return t instanceof Array?t:[t]},e.getUniqueStyleValues=function(t,n){if(t.hasNodesWithoutMarks)return"";var r=t.marks.filter((function(t){return"style"===t.type.name})).map((function(t){return t.attrs.style})).map(e.safeString).map(e.split(";")).map(e.filter((function(t){return t.includes(n)}))).map((function(t){return 0!==t.length?t:[n+": INVALID"]})).map(e.first).map(e.split(":")).map(e.last).map(e.trim).reduce((function(t,e){return t.indexOf(e)>-1?t:t.concat([e])}),[]);return r.indexOf("INVALID")>-1||1!==r.length?"":r[0]},e.conditionallyExecute=function(t){return function(e){return function(n){return e?t(n):n}}},e.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return t.reduce((function(t,e){return e(t)}),e)}}},function(t,e){t.exports=r},function(t,e){t.exports=o},function(t,e){t.exports=i},function(t,e){t.exports=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=function(t){function e(e,n,r,o,i){var s=t.call(this,e,n,r,o,i)||this;return s.dialog=e,s.button=n,s.editor=r,s.localization=o,s.toolsService=i,s}return r.__extends(e,t),e.prototype.clickHandler=function(){this.editor.openDialog(this.dialog)},e.prototype.onStateChange=function(t){this.button.selected=t[this.command].selected,this.button.disabled=t[this.command].disabled},e}(n(34).EditorCommandBase);e.EditorCommandDialog=o},function(t,e){t.exports=a},function(t,e){t.exports=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(13),s=function(){function t(){this.valueChange=new o.EventEmitter}return t.prototype.onValueChange=function(t){this.valueChange.emit(t)},t.prototype.focus=function(){this.dropDownList.focus()},r.__decorate([o.Input(),r.__metadata("design:type",Array)],t.prototype,"data",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],t.prototype,"value",void 0),r.__decorate([o.Input(),r.__metadata("design:type",Object)],t.prototype,"defaultItem",void 0),r.__decorate([o.Input(),r.__metadata("design:type",Function)],t.prototype,"itemDisabled",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],t.prototype,"title",void 0),r.__decorate([o.Input(),r.__metadata("design:type",Boolean)],t.prototype,"disabled",void 0),r.__decorate([o.Input(),r.__metadata("design:type",Number)],t.prototype,"tabindex",void 0),r.__decorate([o.Output(),r.__metadata("design:type",o.EventEmitter)],t.prototype,"valueChange",void 0),r.__decorate([o.ViewChild("element",{static:!0}),r.__metadata("design:type",o.ElementRef)],t.prototype,"element",void 0),r.__decorate([o.ViewChild("element",{read:i.DropDownListComponent,static:!0}),r.__metadata("design:type",i.DropDownListComponent)],t.prototype,"dropDownList",void 0),t=r.__decorate([o.Component({selector:"kendo-editor-format-dropdownlist",template:'\n <kendo-dropdownlist\n #element\n kendoEditorDropDownTool\n [defaultItem]="defaultItem"\n [textField]="\'text\'"\n [valueField]="\'tag\'"\n [data]="data"\n [(value)]="value"\n [valuePrimitive]="true"\n [itemDisabled]="itemDisabled"\n [attr.title]="title"\n [disabled]="disabled"\n [tabindex]="tabindex"\n (valueChange)="onValueChange($event)"\n >\n <ng-template kendoDropDownListItemTemplate let-dataItem>\n <ng-container [ngSwitch]="dataItem.tag">\n <span *ngSwitchCase="\'h1\'" style="display: block; font-size: 2em; margin-left: 0; font-weight: bold;">\n {{ dataItem.text }}\n </span>\n\n <span *ngSwitchCase="\'h2\'" style="display: block; font-size: 1.5em; margin-left: 0; font-weight: bold;">\n {{ dataItem.text }}\n </span>\n\n <span *ngSwitchCase="\'h3\'" style="display: block; font-size: 1.17em; margin-left: 0; font-weight: bold;">\n {{ dataItem.text }}\n </span>\n\n <span *ngSwitchCase="\'h4\'" style="display: block; font-size: 1em; margin-left: 0; font-weight: bold;">\n {{ dataItem.text }}\n </span>\n\n <span *ngSwitchCase="\'h5\'" style="display: block; font-size: .83em; margin-left: 0; font-weight: bold;">\n {{ dataItem.text }}\n </span>\n\n <span *ngSwitchCase="\'h6\'" style="display: block; font-size: .67em; margin-left: 0; font-weight: bold;">\n {{ dataItem.text }}\n </span>\n\n <span *ngSwitchCase="\'p\'" style="display: block; margin-left: 0;">\n {{ dataItem.text }}\n </span>\n\n <span *ngSwitchDefault>{{ dataItem.text }}</span>\n </ng-container>\n </ng-template>\n </kendo-dropdownlist>\n ',styles:["\n .k-dropdownlist {\n width: 13em;\n }\n "]})],t)}();e.FormatDropDownListComponent=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(13),s=function(){function t(){this.valueChange=new o.EventEmitter}return t.prototype.onValueChange=function(t){this.valueChange.emit(t)},t.prototype.focus=function(){this.dropDownList.focus()},r.__decorate([o.Input(),r.__metadata("design:type",Array)],t.prototype,"data",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],t.prototype,"value",void 0),r.__decorate([o.Input(),r.__metadata("design:type",Object)],t.prototype,"defaultItem",void 0),r.__decorate([o.Input(),r.__metadata("design:type",Function)],t.prototype,"itemDisabled",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],t.prototype,"title",void 0),r.__decorate([o.Input(),r.__metadata("design:type",Boolean)],t.prototype,"disabled",void 0),r.__decorate([o.Input(),r.__metadata("design:type",Number)],t.prototype,"tabindex",void 0),r.__decorate([o.Output(),r.__metadata("design:type",o.EventEmitter)],t.prototype,"valueChange",void 0),r.__decorate([o.ViewChild("element",{static:!0}),r.__metadata("design:type",o.ElementRef)],t.prototype,"element",void 0),r.__decorate([o.ViewChild("element",{read:i.DropDownListComponent,static:!0}),r.__metadata("design:type",i.DropDownListComponent)],t.prototype,"dropDownList",void 0),t=r.__decorate([o.Component({selector:"kendo-editor-fontfamily-dropdownlist",template:'\n <kendo-dropdownlist\n #element\n kendoEditorDropDownTool\n [defaultItem]="defaultItem"\n [textField]="\'text\'"\n [valueField]="\'fontName\'"\n [data]="data"\n [(value)]="value"\n [valuePrimitive]="true"\n [itemDisabled]="itemDisabled"\n [attr.title]="title"\n [disabled]="disabled"\n [tabindex]="tabindex"\n (valueChange)="onValueChange($event)"\n >\n <ng-template kendoDropDownListItemTemplate let-dataItem>\n <span [ngStyle]="{ \'font-family\': dataItem.fontName }">\n {{ dataItem.text }}\n </span>\n </ng-template>\n </kendo-dropdownlist>\n ',styles:["\n .k-dropdownlist {\n width: 13em;\n }\n "]})],t)}();e.FontFamilyDropDownListComponent=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(13),s=function(){function t(){this.valueChange=new o.EventEmitter}return t.prototype.onValueChange=function(t){this.valueChange.emit(t)},t.prototype.focus=function(){this.dropDownList.focus()},r.__decorate([o.Input(),r.__metadata("design:type",Array)],t.prototype,"data",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],t.prototype,"value",void 0),r.__decorate([o.Input(),r.__metadata("design:type",Object)],t.prototype,"defaultItem",void 0),r.__decorate([o.Input(),r.__metadata("design:type",Function)],t.prototype,"itemDisabled",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],t.prototype,"title",void 0),r.__decorate([o.Input(),r.__metadata("design:type",Boolean)],t.prototype,"disabled",void 0),r.__decorate([o.Input(),r.__metadata("design:type",Number)],t.prototype,"tabindex",void 0),r.__decorate([o.Output(),r.__metadata("design:type",o.EventEmitter)],t.prototype,"valueChange",void 0),r.__decorate([o.ViewChild("element",{static:!0}),r.__metadata("design:type",o.ElementRef)],t.prototype,"element",void 0),r.__decorate([o.ViewChild("element",{read:i.DropDownListComponent,static:!0}),r.__metadata("design:type",i.DropDownListComponent)],t.prototype,"dropDownList",void 0),t=r.__decorate([o.Component({selector:"kendo-editor-fontsize-dropdownlist",template:'\n <kendo-dropdownlist\n #element\n kendoEditorDropDownTool\n [defaultItem]="defaultItem"\n [textField]="\'text\'"\n [valueField]="\'size\'"\n [data]="data"\n [(value)]="value"\n [valuePrimitive]="true"\n [itemDisabled]="itemDisabled"\n [attr.title]="title"\n [disabled]="disabled"\n [tabindex]="tabindex"\n (valueChange)="onValueChange($event)"\n >\n </kendo-dropdownlist>\n ',styles:["\n .k-dropdownlist {\n width: 13em;\n }\n "]})],t)}();e.FontSizeDropDownListComponent=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(4),s=n(16),a=n(2),c=n(9),u=n(3),l=n(7),d=n(30),p=n(22),f=function(t){function e(e,n,r,o){var i=t.call(this)||this;return i.editor=e,i.localization=n,i.dialogService=r,i.ngZone=o,i.tabindex=-1,i.disabled=!1,i.views=["palette"],i}var n;return r.__extends(e,t),n=e,Object.defineProperty(e.prototype,"view",{get:function(){return this.views&&this.views.length>0?this.views[0]:null},set:function(t){this.views=[t]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"title",{get:function(){return this.localization.get(this.editorCommand)},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){var t=this;this.subs=this.editor.stateChange.subscribe((function(e){var n=e.style;t.disabled=n.disabled}))},e.prototype.ngOnDestroy=function(){this.subs&&this.subs.unsubscribe()},e.prototype.handleValueChange=function(t){this.editor.exec(this.editorCommand,t),this.editor.view.focus()},e.prototype.handleActiveColorClick=function(t){t.preventOpen(),this.handleValueChange(t.color)},e.prototype.onOpen=function(t){this.valueCache=t.value,t.reset()},e.prototype.onClose=function(t){var e=this;t.value||(t.value=this.valueCache),this.editor.shouldEmitFocus=!0,this.ngZone.onStable.pipe(p.take(1)).subscribe((function(){return e.editor.view.focus()}))},Object.defineProperty(e.prototype,"outerWidth",{get:function(){if(this.element)return c.outerWidth(this.element.nativeElement)},enumerable:!0,configurable:!0}),e.prototype.openDialog=function(){var t={appendTo:this.editor.dialogContainer,content:d.ColorPickerDialogComponent};this.editor.toolbar.toggle(!1),this.dialogService.open(t).content.instance.setData({editor:this.editor,value:this.value,title:this.title,editorCommand:this.editorCommand,paletteSettings:this.paletteSettings,icon:this.icon,views:this.views})},e.prototype.canFocus=function(){return!this.disabled},e.prototype.focus=function(){this.tabindex=0,this.overflows?this.colorPickerButton.nativeElement.focus():this.colorPicker.focus()},e.prototype.handleKey=function(){return this.tabindex=-1,!1},r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"value",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"icon",void 0),r.__decorate([o.Input(),r.__metadata("design:type",Object)],e.prototype,"paletteSettings",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"editorCommand",void 0),r.__decorate([o.Input(),r.__metadata("design:type",Boolean)],e.prototype,"disabled",void 0),r.__decorate([o.Input(),r.__metadata("design:type",Array)],e.prototype,"views",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String),r.__metadata("design:paramtypes",[String])],e.prototype,"view",null),r.__decorate([o.ViewChild("toolbarTemplate",{static:!0}),r.__metadata("design:type",o.TemplateRef)],e.prototype,"toolbarTemplate",void 0),r.__decorate([o.ViewChild("popupTemplate",{static:!0}),r.__metadata("design:type",o.TemplateRef)],e.prototype,"popupTemplate",void 0),r.__decorate([o.ViewChild("colorpicker",{read:o.ElementRef,static:!1}),r.__metadata("design:type",o.ElementRef)],e.prototype,"element",void 0),r.__decorate([o.ViewChild("colorpicker",{read:s.ColorPickerComponent,static:!1}),r.__metadata("design:type",s.ColorPickerComponent)],e.prototype,"colorPicker",void 0),r.__decorate([o.ViewChild("colorPickerButton",{read:o.ElementRef,static:!1}),r.__metadata("design:type",o.ElementRef)],e.prototype,"colorPickerButton",void 0),e=n=r.__decorate([o.Component({providers:[{provide:i.ToolBarToolComponent,useExisting:o.forwardRef((function(){return n}))}],selector:"kendo-toolbar-colorpicker",template:'\n <ng-template #toolbarTemplate>\n <kendo-colorpicker\n #colorpicker\n [attr.title]="title"\n [icon]="icon"\n [views]="views"\n [format]="\'hex\'"\n [value]="value"\n [paletteSettings]="paletteSettings"\n [disabled]="disabled"\n [tabindex]="tabindex"\n (valueChange)="handleValueChange($event)"\n (activeColorClick)="handleActiveColorClick($event)"\n (open)="onOpen(colorpicker)"\n (close)="onClose(colorpicker)"\n >\n </kendo-colorpicker>\n </ng-template>\n <ng-template #popupTemplate>\n <button\n tabindex="-1"\n type="button"\n kendoButton\n #colorPickerButton\n class="k-overflow-button"\n [icon]="icon"\n [attr.title]="title"\n [disabled]="disabled"\n [tabindex]="tabindex"\n (click)="openDialog()"\n >\n {{ title }}\n </button>\n </ng-template>\n '}),r.__param(0,o.Host()),r.__metadata("design:paramtypes",[u.EditorComponent,a.EditorLocalizationService,l.DialogService,o.NgZone])],e)}(i.ToolBarToolComponent);e.EditorColorPickerComponent=f},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.commandIcons={alignCenter:"align-center",alignJustify:"align-justify",alignLeft:"align-left",alignRight:"align-right",backColor:"background",blockquote:"blockquote",bold:"bold",cleanFormatting:"clear-css",createLink:"link-horizontal",foreColor:"foreground-color",indent:"indent-increase",insertFile:"file-add",insertImage:"image",insertOrderedList:"list-ordered",insertUnorderedList:"list-unordered",italic:"italic",outdent:"indent-decrease",print:"print",redo:"redo",selectAll:"select-all",strikethrough:"strikethrough",subscript:"sub-script",superscript:"sup-script",underline:"underline",undo:"undo",unlink:"unlink-horizontal",viewSource:"html",insertTable:"table-insert",addColumnBefore:"table-column-insert-left",addColumnAfter:"table-column-insert-right",addRowBefore:"table-row-insert-above",addRowAfter:"table-row-insert-below",deleteRow:"table-row-delete",deleteColumn:"table-column-delete",mergeCells:"cells-merge",splitCell:"cell-split-horizontally",deleteTable:"table-delete"}},function(t,e,n){"use strict";n.r(e),n.d(e,"audit",(function(){return P})),n.d(e,"auditTime",(function(){return J})),n.d(e,"buffer",(function(){return K})),n.d(e,"bufferCount",(function(){return Y})),n.d(e,"bufferTime",(function(){return tt})),n.d(e,"bufferToggle",(function(){return at})),n.d(e,"bufferWhen",(function(){return lt})),n.d(e,"catchError",(function(){return ft})),n.d(e,"combineAll",(function(){return wt})),n.d(e,"combineLatest",(function(){return xt})),n.d(e,"concat",(function(){return Rt})),n.d(e,"concatAll",(function(){return zt})),n.d(e,"concatMap",(function(){return Ft})),n.d(e,"concatMapTo",(function(){return Lt})),n.d(e,"count",(function(){return Vt})),n.d(e,"debounce",(function(){return Wt})),n.d(e,"debounceTime",(function(){return Jt})),n.d(e,"defaultIfEmpty",(function(){return Yt})),n.d(e,"delay",(function(){return oe})),n.d(e,"delayWhen",(function(){return ce})),n.d(e,"dematerialize",(function(){return fe})),n.d(e,"distinct",(function(){return ve})),n.d(e,"distinctUntilChanged",(function(){return be})),n.d(e,"distinctUntilKeyChanged",(function(){return xe})),n.d(e,"elementAt",(function(){return Fe})),n.d(e,"endWith",(function(){return Le})),n.d(e,"every",(function(){return Ve})),n.d(e,"exhaust",(function(){return We})),n.d(e,"exhaustMap",(function(){return Je})),n.d(e,"expand",(function(){return Ge})),n.d(e,"filter",(function(){return Se})),n.d(e,"finalize",(function(){return Ze})),n.d(e,"find",(function(){return en})),n.d(e,"findIndex",(function(){return on})),n.d(e,"first",(function(){return sn})),n.d(e,"groupBy",(function(){return fn})),n.d(e,"ignoreElements",(function(){return bn})),n.d(e,"isEmpty",(function(){return xn})),n.d(e,"last",(function(){return Mn})),n.d(e,"map",(function(){return Et})),n.d(e,"mapTo",(function(){return On})),n.d(e,"materialize",(function(){return An})),n.d(e,"max",(function(){return Ln})),n.d(e,"merge",(function(){return jn})),n.d(e,"mergeAll",(function(){return Bt})),n.d(e,"mergeMap",(function(){return Dt})),n.d(e,"flatMap",(function(){return Dt})),n.d(e,"mergeMapTo",(function(){return $n})),n.d(e,"mergeScan",(function(){return Wn})),n.d(e,"min",(function(){return Jn})),n.d(e,"multicast",(function(){return Qn})),n.d(e,"observeOn",(function(){return er})),n.d(e,"onErrorResumeNext",(function(){return ir})),n.d(e,"pairwise",(function(){return cr})),n.d(e,"partition",(function(){return pr})),n.d(e,"pluck",(function(){return fr})),n.d(e,"publish",(function(){return mr})),n.d(e,"publishBehavior",(function(){return gr})),n.d(e,"publishLast",(function(){return br})),n.d(e,"publishReplay",(function(){return Cr})),n.d(e,"race",(function(){return Mr})),n.d(e,"reduce",(function(){return Fn})),n.d(e,"repeat",(function(){return Or})),n.d(e,"repeatWhen",(function(){return Ar})),n.d(e,"retry",(function(){return zr})),n.d(e,"retryWhen",(function(){return Fr})),n.d(e,"refCount",(function(){return Kn})),n.d(e,"sample",(function(){return jr})),n.d(e,"sampleTime",(function(){return Hr})),n.d(e,"scan",(function(){return zn})),n.d(e,"sequenceEqual",(function(){return Ur})),n.d(e,"share",(function(){return Qr})),n.d(e,"shareReplay",(function(){return to})),n.d(e,"single",(function(){return eo})),n.d(e,"skip",(function(){return oo})),n.d(e,"skipLast",(function(){return ao})),n.d(e,"skipUntil",(function(){return lo})),n.d(e,"skipWhile",(function(){return ho})),n.d(e,"startWith",(function(){return go})),n.d(e,"subscribeOn",(function(){return So})),n.d(e,"switchAll",(function(){return Do})),n.d(e,"switchMap",(function(){return Eo})),n.d(e,"switchMapTo",(function(){return Io})),n.d(e,"take",(function(){return ze})),n.d(e,"takeLast",(function(){return Sn})),n.d(e,"takeUntil",(function(){return Ao})),n.d(e,"takeWhile",(function(){return zo})),n.d(e,"tap",(function(){return Me})),n.d(e,"throttle",(function(){return Lo})),n.d(e,"throttleTime",(function(){return $o})),n.d(e,"throwIfEmpty",(function(){return Ne})),n.d(e,"timeInterval",(function(){return Jo})),n.d(e,"timeout",(function(){return Qo})),n.d(e,"timeoutWith",(function(){return Yo})),n.d(e,"timestamp",(function(){return ti})),n.d(e,"toArray",(function(){return ri})),n.d(e,"window",(function(){return oi})),n.d(e,"windowCount",(function(){return ai})),n.d(e,"windowTime",(function(){return li})),n.d(e,"windowToggle",(function(){return gi})),n.d(e,"windowWhen",(function(){return wi})),n.d(e,"withLatestFrom",(function(){return ki})),n.d(e,"zip",(function(){return Ai})),n.d(e,"zipAll",(function(){return Ni}));var r=n(0);function o(t){return"function"==typeof t}var i=!1,s={Promise:void 0,set useDeprecatedSynchronousErrorHandling(t){t&&(new Error).stack;i=t},get useDeprecatedSynchronousErrorHandling(){return i}};function a(t){setTimeout((function(){throw t}))}var c={closed:!0,next:function(t){},error:function(t){if(s.useDeprecatedSynchronousErrorHandling)throw t;a(t)},complete:function(){}},u=Array.isArray||function(t){return t&&"number"==typeof t.length};function l(t){return null!==t&&"object"==typeof t}function d(t){return Error.call(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map((function(t,e){return e+1+") "+t.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=t,this}d.prototype=Object.create(Error.prototype);var p=d,f=function(){function t(t){this.closed=!1,this._parent=null,this._parents=null,this._subscriptions=null,t&&(this._unsubscribe=t)}return t.prototype.unsubscribe=function(){var t,e=!1;if(!this.closed){var n=this._parent,r=this._parents,i=this._unsubscribe,s=this._subscriptions;this.closed=!0,this._parent=null,this._parents=null,this._subscriptions=null;for(var a=-1,c=r?r.length:0;n;)n.remove(this),n=++a<c&&r[a]||null;if(o(i))try{i.call(this)}catch(n){e=!0,t=n instanceof p?h(n.errors):[n]}if(u(s))for(a=-1,c=s.length;++a<c;){var d=s[a];if(l(d))try{d.unsubscribe()}catch(n){e=!0,t=t||[],n instanceof p?t=t.concat(h(n.errors)):t.push(n)}}if(e)throw new p(t)}},t.prototype.add=function(e){var n=e;switch(typeof e){case"function":n=new t(e);case"object":if(n===this||n.closed||"function"!=typeof n.unsubscribe)return n;if(this.closed)return n.unsubscribe(),n;if(!(n instanceof t)){var r=n;(n=new t)._subscriptions=[r]}break;default:if(!e)return t.EMPTY;throw new Error("unrecognized teardown "+e+" added to Subscription.")}if(n._addParent(this)){var o=this._subscriptions;o?o.push(n):this._subscriptions=[n]}return n},t.prototype.remove=function(t){var e=this._subscriptions;if(e){var n=e.indexOf(t);-1!==n&&e.splice(n,1)}},t.prototype._addParent=function(t){var e=this._parent,n=this._parents;return e!==t&&(e?n?-1===n.indexOf(t)&&(n.push(t),!0):(this._parents=[t],!0):(this._parent=t,!0))},t.EMPTY=function(t){return t.closed=!0,t}(new t),t}();function h(t){return t.reduce((function(t,e){return t.concat(e instanceof p?e.errors:e)}),[])}var m="function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random(),v=function(t){function e(n,r,o){var i=t.call(this)||this;switch(i.syncErrorValue=null,i.syncErrorThrown=!1,i.syncErrorThrowable=!1,i.isStopped=!1,arguments.length){case 0:i.destination=c;break;case 1:if(!n){i.destination=c;break}if("object"==typeof n){n instanceof e?(i.syncErrorThrowable=n.syncErrorThrowable,i.destination=n,n.add(i)):(i.syncErrorThrowable=!0,i.destination=new g(i,n));break}default:i.syncErrorThrowable=!0,i.destination=new g(i,n,r,o)}return i}return r.__extends(e,t),e.prototype[m]=function(){return this},e.create=function(t,n,r){var o=new e(t,n,r);return o.syncErrorThrowable=!1,o},e.prototype.next=function(t){this.isStopped||this._next(t)},e.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this))},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){this.destination.error(t),this.unsubscribe()},e.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},e.prototype._unsubscribeAndRecycle=function(){var t=this._parent,e=this._parents;return this._parent=null,this._parents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parent=t,this._parents=e,this},e}(f),g=function(t){function e(e,n,r,i){var s,a=t.call(this)||this;a._parentSubscriber=e;var u=a;return o(n)?s=n:n&&(s=n.next,r=n.error,i=n.complete,n!==c&&(o((u=Object.create(n)).unsubscribe)&&a.add(u.unsubscribe.bind(u)),u.unsubscribe=a.unsubscribe.bind(a))),a._context=u,a._next=s,a._error=r,a._complete=i,a}return r.__extends(e,t),e.prototype.next=function(t){if(!this.isStopped&&this._next){var e=this._parentSubscriber;s.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?this.__tryOrSetError(e,this._next,t)&&this.unsubscribe():this.__tryOrUnsub(this._next,t)}},e.prototype.error=function(t){if(!this.isStopped){var e=this._parentSubscriber,n=s.useDeprecatedSynchronousErrorHandling;if(this._error)n&&e.syncErrorThrowable?(this.__tryOrSetError(e,this._error,t),this.unsubscribe()):(this.__tryOrUnsub(this._error,t),this.unsubscribe());else if(e.syncErrorThrowable)n?(e.syncErrorValue=t,e.syncErrorThrown=!0):a(t),this.unsubscribe();else{if(this.unsubscribe(),n)throw t;a(t)}}},e.prototype.complete=function(){var t=this;if(!this.isStopped){var e=this._parentSubscriber;if(this._complete){var n=function(){return t._complete.call(t._context)};s.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?(this.__tryOrSetError(e,n),this.unsubscribe()):(this.__tryOrUnsub(n),this.unsubscribe())}else this.unsubscribe()}},e.prototype.__tryOrUnsub=function(t,e){try{t.call(this._context,e)}catch(t){if(this.unsubscribe(),s.useDeprecatedSynchronousErrorHandling)throw t;a(t)}},e.prototype.__tryOrSetError=function(t,e,n){if(!s.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{e.call(this._context,n)}catch(e){return s.useDeprecatedSynchronousErrorHandling?(t.syncErrorValue=e,t.syncErrorThrown=!0,!0):(a(e),!0)}return!1},e.prototype._unsubscribe=function(){var t=this._parentSubscriber;this._context=null,this._parentSubscriber=null,t.unsubscribe()},e}(v),y=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e.prototype.notifyNext=function(t,e,n,r,o){this.destination.next(e)},e.prototype.notifyError=function(t,e){this.destination.error(t)},e.prototype.notifyComplete=function(t){this.destination.complete()},e}(v),b=function(t){function e(e,n,r){var o=t.call(this)||this;return o.parent=e,o.outerValue=n,o.outerIndex=r,o.index=0,o}return r.__extends(e,t),e.prototype._next=function(t){this.parent.notifyNext(this.outerValue,t,this.outerIndex,this.index++,this)},e.prototype._error=function(t){this.parent.notifyError(t,this),this.unsubscribe()},e.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},e}(v);var w="function"==typeof Symbol&&Symbol.observable||"@@observable";function _(){}function x(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return k(t)}function k(t){return t?1===t.length?t[0]:function(e){return t.reduce((function(t,e){return e(t)}),e)}:_}var C=function(){function t(t){this._isScalar=!1,t&&(this._subscribe=t)}return t.prototype.lift=function(e){var n=new t;return n.source=this,n.operator=e,n},t.prototype.subscribe=function(t,e,n){var r=this.operator,o=function(t,e,n){if(t){if(t instanceof v)return t;if(t[m])return t[m]()}return t||e||n?new v(t,e,n):new v(c)}(t,e,n);if(r?o.add(r.call(o,this.source)):o.add(this.source||s.useDeprecatedSynchronousErrorHandling&&!o.syncErrorThrowable?this._subscribe(o):this._trySubscribe(o)),s.useDeprecatedSynchronousErrorHandling&&o.syncErrorThrowable&&(o.syncErrorThrowable=!1,o.syncErrorThrown))throw o.syncErrorValue;return o},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){s.useDeprecatedSynchronousErrorHandling&&(t.syncErrorThrown=!0,t.syncErrorValue=e),!function(t){for(;t;){var e=t,n=e.closed,r=e.destination,o=e.isStopped;if(n||o)return!1;t=r&&r instanceof v?r:null}return!0}(t)?console.warn(e):t.error(e)}},t.prototype.forEach=function(t,e){var n=this;return new(e=S(e))((function(e,r){var o;o=n.subscribe((function(e){try{t(e)}catch(t){r(t),o&&o.unsubscribe()}}),r,e)}))},t.prototype._subscribe=function(t){var e=this.source;return e&&e.subscribe(t)},t.prototype[w]=function(){return this},t.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return 0===t.length?this:k(t)(this)},t.prototype.toPromise=function(t){var e=this;return new(t=S(t))((function(t,n){var r;e.subscribe((function(t){return r=t}),(function(t){return n(t)}),(function(){return t(r)}))}))},t.create=function(e){return new t(e)},t}();function S(t){if(t||(t=s.Promise||Promise),!t)throw new Error("no Promise impl found");return t}var T=function(t){return function(e){for(var n=0,r=t.length;n<r&&!e.closed;n++)e.next(t[n]);e.closed||e.complete()}},E=function(t){return function(e){return t.then((function(t){e.closed||(e.next(t),e.complete())}),(function(t){return e.error(t)})).then(null,a),e}};function M(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}var O=M(),D=function(t){return function(e){for(var n=t[O]();;){var r=n.next();if(r.done){e.complete();break}if(e.next(r.value),e.closed)break}return"function"==typeof n.return&&e.add((function(){n.return&&n.return()})),e}},I=function(t){return function(e){var n=t[w]();if("function"!=typeof n.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return n.subscribe(e)}},A=function(t){return t&&"number"==typeof t.length&&"function"!=typeof t};function N(t){return!!t&&"function"!=typeof t.subscribe&&"function"==typeof t.then}var B=function(t){if(t instanceof C)return function(e){return t._isScalar?(e.next(t.value),void e.complete()):t.subscribe(e)};if(t&&"function"==typeof t[w])return I(t);if(A(t))return T(t);if(N(t))return E(t);if(t&&"function"==typeof t[O])return D(t);var e=l(t)?"an invalid object":"'"+t+"'";throw new TypeError("You provided "+e+" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.")};function z(t,e,n,r,o){if(void 0===o&&(o=new b(t,n,r)),!o.closed)return B(e)(o)}function P(t){return function(e){return e.lift(new R(t))}}var R=function(){function t(t){this.durationSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new F(t,this.durationSelector))},t}(),F=function(t){function e(e,n){var r=t.call(this,e)||this;return r.durationSelector=n,r.hasValue=!1,r}return r.__extends(e,t),e.prototype._next=function(t){if(this.value=t,this.hasValue=!0,!this.throttled){var e=void 0;try{e=(0,this.durationSelector)(t)}catch(t){return this.destination.error(t)}var n=z(this,e);!n||n.closed?this.clearThrottle():this.add(this.throttled=n)}},e.prototype.clearThrottle=function(){var t=this.value,e=this.hasValue,n=this.throttled;n&&(this.remove(n),this.throttled=null,n.unsubscribe()),e&&(this.value=null,this.hasValue=!1,this.destination.next(t))},e.prototype.notifyNext=function(t,e,n,r){this.clearThrottle()},e.prototype.notifyComplete=function(){this.clearThrottle()},e}(y),L=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r.pending=!1,r}return r.__extends(e,t),e.prototype.schedule=function(t,e){if(void 0===e&&(e=0),this.closed)return this;this.state=t;var n=this.id,r=this.scheduler;return null!=n&&(this.id=this.recycleAsyncId(r,n,e)),this.pending=!0,this.delay=e,this.id=this.id||this.requestAsyncId(r,this.id,e),this},e.prototype.requestAsyncId=function(t,e,n){return void 0===n&&(n=0),setInterval(t.flush.bind(t,this),n)},e.prototype.recycleAsyncId=function(t,e,n){if(void 0===n&&(n=0),null!==n&&this.delay===n&&!1===this.pending)return e;clearInterval(e)},e.prototype.execute=function(t,e){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var n=this._execute(t,e);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(t,e){var n=!1,r=void 0;try{this.work(t)}catch(t){n=!0,r=!!t&&t||new Error(t)}if(n)return this.unsubscribe(),r},e.prototype._unsubscribe=function(){var t=this.id,e=this.scheduler,n=e.actions,r=n.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==r&&n.splice(r,1),null!=t&&(this.id=this.recycleAsyncId(e,t,null)),this.delay=null},e}(function(t){function e(e,n){return t.call(this)||this}return r.__extends(e,t),e.prototype.schedule=function(t,e){return void 0===e&&(e=0),this},e}(f)),V=function(){function t(e,n){void 0===n&&(n=t.now),this.SchedulerAction=e,this.now=n}return t.prototype.schedule=function(t,e,n){return void 0===e&&(e=0),new this.SchedulerAction(this,t).schedule(n,e)},t.now=function(){return Date.now()},t}(),j=function(t){function e(n,r){void 0===r&&(r=V.now);var o=t.call(this,n,(function(){return e.delegate&&e.delegate!==o?e.delegate.now():r()}))||this;return o.actions=[],o.active=!1,o.scheduled=void 0,o}return r.__extends(e,t),e.prototype.schedule=function(n,r,o){return void 0===r&&(r=0),e.delegate&&e.delegate!==this?e.delegate.schedule(n,r,o):t.prototype.schedule.call(this,n,r,o)},e.prototype.flush=function(t){var e=this.actions;if(this.active)e.push(t);else{var n;this.active=!0;do{if(n=t.execute(t.state,t.delay))break}while(t=e.shift());if(this.active=!1,n){for(;t=e.shift();)t.unsubscribe();throw n}}},e}(V),$=new j(L);function W(t){return!u(t)&&t-parseFloat(t)+1>=0}function H(t){return t&&"function"==typeof t.schedule}function q(t){var e=t.index,n=t.period,r=t.subscriber;if(r.next(e),!r.closed){if(-1===n)return r.complete();t.index=e+1,this.schedule(t,n)}}function J(t,e){return void 0===e&&(e=$),P((function(){return function(t,e,n){void 0===t&&(t=0);var r=-1;return W(e)?r=Number(e)<1?1:Number(e):H(e)&&(n=e),H(n)||(n=$),new C((function(e){var o=W(t)?t:+t-n.now();return n.schedule(q,o,{index:0,period:r,subscriber:e})}))}(t,e)}))}function K(t){return function(e){return e.lift(new U(t))}}var U=function(){function t(t){this.closingNotifier=t}return t.prototype.call=function(t,e){return e.subscribe(new G(t,this.closingNotifier))},t}(),G=function(t){function e(e,n){var r=t.call(this,e)||this;return r.buffer=[],r.add(z(r,n)),r}return r.__extends(e,t),e.prototype._next=function(t){this.buffer.push(t)},e.prototype.notifyNext=function(t,e,n,r,o){var i=this.buffer;this.buffer=[],this.destination.next(i)},e}(y);function Y(t,e){return void 0===e&&(e=null),function(n){return n.lift(new X(t,e))}}var X=function(){function t(t,e){this.bufferSize=t,this.startBufferEvery=e,this.subscriberClass=e&&t!==e?Q:Z}return t.prototype.call=function(t,e){return e.subscribe(new this.subscriberClass(t,this.bufferSize,this.startBufferEvery))},t}(),Z=function(t){function e(e,n){var r=t.call(this,e)||this;return r.bufferSize=n,r.buffer=[],r}return r.__extends(e,t),e.prototype._next=function(t){var e=this.buffer;e.push(t),e.length==this.bufferSize&&(this.destination.next(e),this.buffer=[])},e.prototype._complete=function(){var e=this.buffer;e.length>0&&this.destination.next(e),t.prototype._complete.call(this)},e}(v),Q=function(t){function e(e,n,r){var o=t.call(this,e)||this;return o.bufferSize=n,o.startBufferEvery=r,o.buffers=[],o.count=0,o}return r.__extends(e,t),e.prototype._next=function(t){var e=this.bufferSize,n=this.startBufferEvery,r=this.buffers,o=this.count;this.count++,o%n==0&&r.push([]);for(var i=r.length;i--;){var s=r[i];s.push(t),s.length===e&&(r.splice(i,1),this.destination.next(s))}},e.prototype._complete=function(){for(var e=this.buffers,n=this.destination;e.length>0;){var r=e.shift();r.length>0&&n.next(r)}t.prototype._complete.call(this)},e}(v);function tt(t){var e=arguments.length,n=$;H(arguments[arguments.length-1])&&(n=arguments[arguments.length-1],e--);var r=null;e>=2&&(r=arguments[1]);var o=Number.POSITIVE_INFINITY;return e>=3&&(o=arguments[2]),function(e){return e.lift(new et(t,r,o,n))}}var et=function(){function t(t,e,n,r){this.bufferTimeSpan=t,this.bufferCreationInterval=e,this.maxBufferSize=n,this.scheduler=r}return t.prototype.call=function(t,e){return e.subscribe(new rt(t,this.bufferTimeSpan,this.bufferCreationInterval,this.maxBufferSize,this.scheduler))},t}(),nt=function(){return function(){this.buffer=[]}}(),rt=function(t){function e(e,n,r,o,i){var s=t.call(this,e)||this;s.bufferTimeSpan=n,s.bufferCreationInterval=r,s.maxBufferSize=o,s.scheduler=i,s.contexts=[];var a=s.openContext();if(s.timespanOnly=null==r||r<0,s.timespanOnly){var c={subscriber:s,context:a,bufferTimeSpan:n};s.add(a.closeAction=i.schedule(ot,n,c))}else{var u={subscriber:s,context:a},l={bufferTimeSpan:n,bufferCreationInterval:r,subscriber:s,scheduler:i};s.add(a.closeAction=i.schedule(st,n,u)),s.add(i.schedule(it,r,l))}return s}return r.__extends(e,t),e.prototype._next=function(t){for(var e,n=this.contexts,r=n.length,o=0;o<r;o++){var i=n[o],s=i.buffer;s.push(t),s.length==this.maxBufferSize&&(e=i)}e&&this.onBufferFull(e)},e.prototype._error=function(e){this.contexts.length=0,t.prototype._error.call(this,e)},e.prototype._complete=function(){for(var e=this.contexts,n=this.destination;e.length>0;){var r=e.shift();n.next(r.buffer)}t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){this.contexts=null},e.prototype.onBufferFull=function(t){this.closeContext(t);var e=t.closeAction;if(e.unsubscribe(),this.remove(e),!this.closed&&this.timespanOnly){t=this.openContext();var n=this.bufferTimeSpan,r={subscriber:this,context:t,bufferTimeSpan:n};this.add(t.closeAction=this.scheduler.schedule(ot,n,r))}},e.prototype.openContext=function(){var t=new nt;return this.contexts.push(t),t},e.prototype.closeContext=function(t){this.destination.next(t.buffer);var e=this.contexts;(e?e.indexOf(t):-1)>=0&&e.splice(e.indexOf(t),1)},e}(v);function ot(t){var e=t.subscriber,n=t.context;n&&e.closeContext(n),e.closed||(t.context=e.openContext(),t.context.closeAction=this.schedule(t,t.bufferTimeSpan))}function it(t){var e=t.bufferCreationInterval,n=t.bufferTimeSpan,r=t.subscriber,o=t.scheduler,i=r.openContext();r.closed||(r.add(i.closeAction=o.schedule(st,n,{subscriber:r,context:i})),this.schedule(t,e))}function st(t){var e=t.subscriber,n=t.context;e.closeContext(n)}function at(t,e){return function(n){return n.lift(new ct(t,e))}}var ct=function(){function t(t,e){this.openings=t,this.closingSelector=e}return t.prototype.call=function(t,e){return e.subscribe(new ut(t,this.openings,this.closingSelector))},t}(),ut=function(t){function e(e,n,r){var o=t.call(this,e)||this;return o.openings=n,o.closingSelector=r,o.contexts=[],o.add(z(o,n)),o}return r.__extends(e,t),e.prototype._next=function(t){for(var e=this.contexts,n=e.length,r=0;r<n;r++)e[r].buffer.push(t)},e.prototype._error=function(e){for(var n=this.contexts;n.length>0;){var r=n.shift();r.subscription.unsubscribe(),r.buffer=null,r.subscription=null}this.contexts=null,t.prototype._error.call(this,e)},e.prototype._complete=function(){for(var e=this.contexts;e.length>0;){var n=e.shift();this.destination.next(n.buffer),n.subscription.unsubscribe(),n.buffer=null,n.subscription=null}this.contexts=null,t.prototype._complete.call(this)},e.prototype.notifyNext=function(t,e,n,r,o){t?this.closeBuffer(t):this.openBuffer(e)},e.prototype.notifyComplete=function(t){this.closeBuffer(t.context)},e.prototype.openBuffer=function(t){try{var e=this.closingSelector.call(this,t);e&&this.trySubscribe(e)}catch(t){this._error(t)}},e.prototype.closeBuffer=function(t){var e=this.contexts;if(e&&t){var n=t.buffer,r=t.subscription;this.destination.next(n),e.splice(e.indexOf(t),1),this.remove(r),r.unsubscribe()}},e.prototype.trySubscribe=function(t){var e=this.contexts,n=new f,r={buffer:[],subscription:n};e.push(r);var o=z(this,t,r);!o||o.closed?this.closeBuffer(r):(o.context=r,this.add(o),n.add(o))},e}(y);function lt(t){return function(e){return e.lift(new dt(t))}}var dt=function(){function t(t){this.closingSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new pt(t,this.closingSelector))},t}(),pt=function(t){function e(e,n){var r=t.call(this,e)||this;return r.closingSelector=n,r.subscribing=!1,r.openBuffer(),r}return r.__extends(e,t),e.prototype._next=function(t){this.buffer.push(t)},e.prototype._complete=function(){var e=this.buffer;e&&this.destination.next(e),t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){this.buffer=null,this.subscribing=!1},e.prototype.notifyNext=function(t,e,n,r,o){this.openBuffer()},e.prototype.notifyComplete=function(){this.subscribing?this.complete():this.openBuffer()},e.prototype.openBuffer=function(){var t=this.closingSubscription;t&&(this.remove(t),t.unsubscribe());var e,n=this.buffer;this.buffer&&this.destination.next(n),this.buffer=[];try{e=(0,this.closingSelector)()}catch(t){return this.error(t)}t=new f,this.closingSubscription=t,this.add(t),this.subscribing=!0,t.add(z(this,e)),this.subscribing=!1},e}(y);function ft(t){return function(e){var n=new ht(t),r=e.lift(n);return n.caught=r}}var ht=function(){function t(t){this.selector=t}return t.prototype.call=function(t,e){return e.subscribe(new mt(t,this.selector,this.caught))},t}(),mt=function(t){function e(e,n,r){var o=t.call(this,e)||this;return o.selector=n,o.caught=r,o}return r.__extends(e,t),e.prototype.error=function(e){if(!this.isStopped){var n=void 0;try{n=this.selector(e,this.caught)}catch(e){return void t.prototype.error.call(this,e)}this._unsubscribeAndRecycle();var r=new b(this,void 0,void 0);this.add(r),z(this,n,void 0,void 0,r)}},e}(y);function vt(t,e){return new C(e?function(n){var r=new f,o=0;return r.add(e.schedule((function(){o!==t.length?(n.next(t[o++]),n.closed||r.add(this.schedule())):n.complete()}))),r}:T(t))}var gt={};var yt=function(){function t(t){this.resultSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new bt(t,this.resultSelector))},t}(),bt=function(t){function e(e,n){var r=t.call(this,e)||this;return r.resultSelector=n,r.active=0,r.values=[],r.observables=[],r}return r.__extends(e,t),e.prototype._next=function(t){this.values.push(gt),this.observables.push(t)},e.prototype._complete=function(){var t=this.observables,e=t.length;if(0===e)this.destination.complete();else{this.active=e,this.toRespond=e;for(var n=0;n<e;n++){var r=t[n];this.add(z(this,r,r,n))}}},e.prototype.notifyComplete=function(t){0==(this.active-=1)&&this.destination.complete()},e.prototype.notifyNext=function(t,e,n,r,o){var i=this.values,s=i[n],a=this.toRespond?s===gt?--this.toRespond:this.toRespond:0;i[n]=e,0===a&&(this.resultSelector?this._tryResultSelector(i):this.destination.next(i.slice()))},e.prototype._tryResultSelector=function(t){var e;try{e=this.resultSelector.apply(this,t)}catch(t){return void this.destination.error(t)}this.destination.next(e)},e}(y);function wt(t){return function(e){return e.lift(new yt(t))}}function _t(t,e){if(!e)return t instanceof C?t:new C(B(t));if(null!=t){if(function(t){return t&&"function"==typeof t[w]}(t))return function(t,e){return new C(e?function(n){var r=new f;return r.add(e.schedule((function(){var o=t[w]();r.add(o.subscribe({next:function(t){r.add(e.schedule((function(){return n.next(t)})))},error:function(t){r.add(e.schedule((function(){return n.error(t)})))},complete:function(){r.add(e.schedule((function(){return n.complete()})))}}))}))),r}:I(t))}(t,e);if(N(t))return function(t,e){return new C(e?function(n){var r=new f;return r.add(e.schedule((function(){return t.then((function(t){r.add(e.schedule((function(){n.next(t),r.add(e.schedule((function(){return n.complete()})))})))}),(function(t){r.add(e.schedule((function(){return n.error(t)})))}))}))),r}:E(t))}(t,e);if(A(t))return vt(t,e);if(function(t){return t&&"function"==typeof t[O]}(t)||"string"==typeof t)return function(t,e){if(!t)throw new Error("Iterable cannot be null");return new C(e?function(n){var r,o=new f;return o.add((function(){r&&"function"==typeof r.return&&r.return()})),o.add(e.schedule((function(){r=t[O](),o.add(e.schedule((function(){if(!n.closed){var t,e;try{var o=r.next();t=o.value,e=o.done}catch(t){return void n.error(t)}e?n.complete():(n.next(t),this.schedule())}})))}))),o}:D(t))}(t,e)}throw new TypeError((null!==t&&typeof t||t)+" is not observable")}function xt(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=null;return"function"==typeof t[t.length-1]&&(n=t.pop()),1===t.length&&u(t[0])&&(t=t[0].slice()),function(e){return e.lift.call(_t([e].concat(t)),new yt(n))}}var kt=new C((function(t){return t.complete()}));function Ct(t){return t?function(t){return new C((function(e){return t.schedule((function(){return e.complete()}))}))}(t):kt}function St(t){var e=new C((function(e){e.next(t),e.complete()}));return e._isScalar=!0,e.value=t,e}function Tt(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t[t.length-1];switch(H(n)?t.pop():n=void 0,t.length){case 0:return Ct(n);case 1:return n?vt(t,n):St(t[0]);default:return vt(t,n)}}function Et(t,e){return function(n){if("function"!=typeof t)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return n.lift(new Mt(t,e))}}var Mt=function(){function t(t,e){this.project=t,this.thisArg=e}return t.prototype.call=function(t,e){return e.subscribe(new Ot(t,this.project,this.thisArg))},t}(),Ot=function(t){function e(e,n,r){var o=t.call(this,e)||this;return o.project=n,o.count=0,o.thisArg=r||o,o}return r.__extends(e,t),e.prototype._next=function(t){var e;try{e=this.project.call(this.thisArg,t,this.count++)}catch(t){return void this.destination.error(t)}this.destination.next(e)},e}(v);function Dt(t,e,n){return void 0===n&&(n=Number.POSITIVE_INFINITY),"function"==typeof e?function(r){return r.pipe(Dt((function(n,r){return _t(t(n,r)).pipe(Et((function(t,o){return e(n,t,r,o)})))}),n))}:("number"==typeof e&&(n=e),function(e){return e.lift(new It(t,n))})}var It=function(){function t(t,e){void 0===e&&(e=Number.POSITIVE_INFINITY),this.project=t,this.concurrent=e}return t.prototype.call=function(t,e){return e.subscribe(new At(t,this.project,this.concurrent))},t}(),At=function(t){function e(e,n,r){void 0===r&&(r=Number.POSITIVE_INFINITY);var o=t.call(this,e)||this;return o.project=n,o.concurrent=r,o.hasCompleted=!1,o.buffer=[],o.active=0,o.index=0,o}return r.__extends(e,t),e.prototype._next=function(t){this.active<this.concurrent?this._tryNext(t):this.buffer.push(t)},e.prototype._tryNext=function(t){var e,n=this.index++;try{e=this.project(t,n)}catch(t){return void this.destination.error(t)}this.active++,this._innerSub(e,t,n)},e.prototype._innerSub=function(t,e,n){var r=new b(this,void 0,void 0);this.destination.add(r),z(this,t,e,n,r)},e.prototype._complete=function(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&this.destination.complete(),this.unsubscribe()},e.prototype.notifyNext=function(t,e,n,r,o){this.destination.next(e)},e.prototype.notifyComplete=function(t){var e=this.buffer;this.remove(t),this.active--,e.length>0?this._next(e.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},e}(y);function Nt(t){return t}function Bt(t){return void 0===t&&(t=Number.POSITIVE_INFINITY),Dt(Nt,t)}function zt(){return Bt(1)}function Pt(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return zt()(Tt.apply(void 0,t))}function Rt(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return e.lift.call(Pt.apply(void 0,[e].concat(t)))}}function Ft(t,e){return Dt(t,e,1)}function Lt(t,e){return Ft((function(){return t}),e)}function Vt(t){return function(e){return e.lift(new jt(t,e))}}var jt=function(){function t(t,e){this.predicate=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new $t(t,this.predicate,this.source))},t}(),$t=function(t){function e(e,n,r){var o=t.call(this,e)||this;return o.predicate=n,o.source=r,o.count=0,o.index=0,o}return r.__extends(e,t),e.prototype._next=function(t){this.predicate?this._tryPredicate(t):this.count++},e.prototype._tryPredicate=function(t){var e;try{e=this.predicate(t,this.index++,this.source)}catch(t){return void this.destination.error(t)}e&&this.count++},e.prototype._complete=function(){this.destination.next(this.count),this.destination.complete()},e}(v);function Wt(t){return function(e){return e.lift(new Ht(t))}}var Ht=function(){function t(t){this.durationSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new qt(t,this.durationSelector))},t}(),qt=function(t){function e(e,n){var r=t.call(this,e)||this;return r.durationSelector=n,r.hasValue=!1,r.durationSubscription=null,r}return r.__extends(e,t),e.prototype._next=function(t){try{var e=this.durationSelector.call(this,t);e&&this._tryNext(t,e)}catch(t){this.destination.error(t)}},e.prototype._complete=function(){this.emitValue(),this.destination.complete()},e.prototype._tryNext=function(t,e){var n=this.durationSubscription;this.value=t,this.hasValue=!0,n&&(n.unsubscribe(),this.remove(n)),(n=z(this,e))&&!n.closed&&this.add(this.durationSubscription=n)},e.prototype.notifyNext=function(t,e,n,r,o){this.emitValue()},e.prototype.notifyComplete=function(){this.emitValue()},e.prototype.emitValue=function(){if(this.hasValue){var e=this.value,n=this.durationSubscription;n&&(this.durationSubscription=null,n.unsubscribe(),this.remove(n)),this.value=null,this.hasValue=!1,t.prototype._next.call(this,e)}},e}(y);function Jt(t,e){return void 0===e&&(e=$),function(n){return n.lift(new Kt(t,e))}}var Kt=function(){function t(t,e){this.dueTime=t,this.scheduler=e}return t.prototype.call=function(t,e){return e.subscribe(new Ut(t,this.dueTime,this.scheduler))},t}(),Ut=function(t){function e(e,n,r){var o=t.call(this,e)||this;return o.dueTime=n,o.scheduler=r,o.debouncedSubscription=null,o.lastValue=null,o.hasValue=!1,o}return r.__extends(e,t),e.prototype._next=function(t){this.clearDebounce(),this.lastValue=t,this.hasValue=!0,this.add(this.debouncedSubscription=this.scheduler.schedule(Gt,this.dueTime,this))},e.prototype._complete=function(){this.debouncedNext(),this.destination.complete()},e.prototype.debouncedNext=function(){if(this.clearDebounce(),this.hasValue){var t=this.lastValue;this.lastValue=null,this.hasValue=!1,this.destination.next(t)}},e.prototype.clearDebounce=function(){var t=this.debouncedSubscription;null!==t&&(this.remove(t),t.unsubscribe(),this.debouncedSubscription=null)},e}(v);function Gt(t){t.debouncedNext()}function Yt(t){return void 0===t&&(t=null),function(e){return e.lift(new Zt(t))}}var Xt,Zt=function(){function t(t){this.defaultValue=t}return t.prototype.call=function(t,e){return e.subscribe(new Qt(t,this.defaultValue))},t}(),Qt=function(t){function e(e,n){var r=t.call(this,e)||this;return r.defaultValue=n,r.isEmpty=!0,r}return r.__extends(e,t),e.prototype._next=function(t){this.isEmpty=!1,this.destination.next(t)},e.prototype._complete=function(){this.isEmpty&&this.destination.next(this.defaultValue),this.destination.complete()},e}(v);function te(t){return t instanceof Date&&!isNaN(+t)}function ee(t,e){return new C(e?function(n){return e.schedule(ne,0,{error:t,subscriber:n})}:function(e){return e.error(t)})}function ne(t){var e=t.error;t.subscriber.error(e)}Xt||(Xt={});var re=function(){function t(t,e,n){this.kind=t,this.value=e,this.error=n,this.hasValue="N"===t}return t.prototype.observe=function(t){switch(this.kind){case"N":return t.next&&t.next(this.value);case"E":return t.error&&t.error(this.error);case"C":return t.complete&&t.complete()}},t.prototype.do=function(t,e,n){switch(this.kind){case"N":return t&&t(this.value);case"E":return e&&e(this.error);case"C":return n&&n()}},t.prototype.accept=function(t,e,n){return t&&"function"==typeof t.next?this.observe(t):this.do(t,e,n)},t.prototype.toObservable=function(){switch(this.kind){case"N":return Tt(this.value);case"E":return ee(this.error);case"C":return Ct()}throw new Error("unexpected notification kind value")},t.createNext=function(e){return void 0!==e?new t("N",e):t.undefinedValueNotification},t.createError=function(e){return new t("E",void 0,e)},t.createComplete=function(){return t.completeNotification},t.completeNotification=new t("C"),t.undefinedValueNotification=new t("N",void 0),t}();function oe(t,e){void 0===e&&(e=$);var n=te(t)?+t-e.now():Math.abs(t);return function(t){return t.lift(new ie(n,e))}}var ie=function(){function t(t,e){this.delay=t,this.scheduler=e}return t.prototype.call=function(t,e){return e.subscribe(new se(t,this.delay,this.scheduler))},t}(),se=function(t){function e(e,n,r){var o=t.call(this,e)||this;return o.delay=n,o.scheduler=r,o.queue=[],o.active=!1,o.errored=!1,o}return r.__extends(e,t),e.dispatch=function(t){for(var e=t.source,n=e.queue,r=t.scheduler,o=t.destination;n.length>0&&n[0].time-r.now()<=0;)n.shift().notification.observe(o);if(n.length>0){var i=Math.max(0,n[0].time-r.now());this.schedule(t,i)}else this.unsubscribe(),e.active=!1},e.prototype._schedule=function(t){this.active=!0,this.destination.add(t.schedule(e.dispatch,this.delay,{source:this,destination:this.destination,scheduler:t}))},e.prototype.scheduleNotification=function(t){if(!0!==this.errored){var e=this.scheduler,n=new ae(e.now()+this.delay,t);this.queue.push(n),!1===this.active&&this._schedule(e)}},e.prototype._next=function(t){this.scheduleNotification(re.createNext(t))},e.prototype._error=function(t){this.errored=!0,this.queue=[],this.destination.error(t),this.unsubscribe()},e.prototype._complete=function(){this.scheduleNotification(re.createComplete()),this.unsubscribe()},e}(v),ae=function(){return function(t,e){this.time=t,this.notification=e}}();function ce(t,e){return e?function(n){return new de(n,e).lift(new ue(t))}:function(e){return e.lift(new ue(t))}}var ue=function(){function t(t){this.delayDurationSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new le(t,this.delayDurationSelector))},t}(),le=function(t){function e(e,n){var r=t.call(this,e)||this;return r.delayDurationSelector=n,r.completed=!1,r.delayNotifierSubscriptions=[],r.index=0,r}return r.__extends(e,t),e.prototype.notifyNext=function(t,e,n,r,o){this.destination.next(t),this.removeSubscription(o),this.tryComplete()},e.prototype.notifyError=function(t,e){this._error(t)},e.prototype.notifyComplete=function(t){var e=this.removeSubscription(t);e&&this.destination.next(e),this.tryComplete()},e.prototype._next=function(t){var e=this.index++;try{var n=this.delayDurationSelector(t,e);n&&this.tryDelay(n,t)}catch(t){this.destination.error(t)}},e.prototype._complete=function(){this.completed=!0,this.tryComplete(),this.unsubscribe()},e.prototype.removeSubscription=function(t){t.unsubscribe();var e=this.delayNotifierSubscriptions.indexOf(t);return-1!==e&&this.delayNotifierSubscriptions.splice(e,1),t.outerValue},e.prototype.tryDelay=function(t,e){var n=z(this,t,e);n&&!n.closed&&(this.destination.add(n),this.delayNotifierSubscriptions.push(n))},e.prototype.tryComplete=function(){this.completed&&0===this.delayNotifierSubscriptions.length&&this.destination.complete()},e}(y),de=function(t){function e(e,n){var r=t.call(this)||this;return r.source=e,r.subscriptionDelay=n,r}return r.__extends(e,t),e.prototype._subscribe=function(t){this.subscriptionDelay.subscribe(new pe(t,this.source))},e}(C),pe=function(t){function e(e,n){var r=t.call(this)||this;return r.parent=e,r.source=n,r.sourceSubscribed=!1,r}return r.__extends(e,t),e.prototype._next=function(t){this.subscribeToSource()},e.prototype._error=function(t){this.unsubscribe(),this.parent.error(t)},e.prototype._complete=function(){this.unsubscribe(),this.subscribeToSource()},e.prototype.subscribeToSource=function(){this.sourceSubscribed||(this.sourceSubscribed=!0,this.unsubscribe(),this.source.subscribe(this.parent))},e}(v);function fe(){return function(t){return t.lift(new he)}}var he=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new me(t))},t}(),me=function(t){function e(e){return t.call(this,e)||this}return r.__extends(e,t),e.prototype._next=function(t){t.observe(this.destination)},e}(v);function ve(t,e){return function(n){return n.lift(new ge(t,e))}}var ge=function(){function t(t,e){this.keySelector=t,this.flushes=e}return t.prototype.call=function(t,e){return e.subscribe(new ye(t,this.keySelector,this.flushes))},t}(),ye=function(t){function e(e,n,r){var o=t.call(this,e)||this;return o.keySelector=n,o.values=new Set,r&&o.add(z(o,r)),o}return r.__extends(e,t),e.prototype.notifyNext=function(t,e,n,r,o){this.values.clear()},e.prototype.notifyError=function(t,e){this._error(t)},e.prototype._next=function(t){this.keySelector?this._useKeySelector(t):this._finalizeNext(t,t)},e.prototype._useKeySelector=function(t){var e,n=this.destination;try{e=this.keySelector(t)}catch(t){return void n.error(t)}this._finalizeNext(e,t)},e.prototype._finalizeNext=function(t,e){var n=this.values;n.has(t)||(n.add(t),this.destination.next(e))},e}(y);function be(t,e){return function(n){return n.lift(new we(t,e))}}var we=function(){function t(t,e){this.compare=t,this.keySelector=e}return t.prototype.call=function(t,e){return e.subscribe(new _e(t,this.compare,this.keySelector))},t}(),_e=function(t){function e(e,n,r){var o=t.call(this,e)||this;return o.keySelector=r,o.hasKey=!1,"function"==typeof n&&(o.compare=n),o}return r.__extends(e,t),e.prototype.compare=function(t,e){return t===e},e.prototype._next=function(t){var e;try{var n=this.keySelector;e=n?n(t):t}catch(t){return this.destination.error(t)}var r=!1;if(this.hasKey)try{r=(0,this.compare)(this.key,e)}catch(t){return this.destination.error(t)}else this.hasKey=!0;r||(this.key=e,this.destination.next(t))},e}(v);function xe(t,e){return be((function(n,r){return e?e(n[t],r[t]):n[t]===r[t]}))}function ke(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}ke.prototype=Object.create(Error.prototype);var Ce=ke;function Se(t,e){return function(n){return n.lift(new Te(t,e))}}var Te=function(){function t(t,e){this.predicate=t,this.thisArg=e}return t.prototype.call=function(t,e){return e.subscribe(new Ee(t,this.predicate,this.thisArg))},t}(),Ee=function(t){function e(e,n,r){var o=t.call(this,e)||this;return o.predicate=n,o.thisArg=r,o.count=0,o}return r.__extends(e,t),e.prototype._next=function(t){var e;try{e=this.predicate.call(this.thisArg,t,this.count++)}catch(t){return void this.destination.error(t)}e&&this.destination.next(t)},e}(v);function Me(t,e,n){return function(r){return r.lift(new Oe(t,e,n))}}var Oe=function(){function t(t,e,n){this.nextOrObserver=t,this.error=e,this.complete=n}return t.prototype.call=function(t,e){return e.subscribe(new De(t,this.nextOrObserver,this.error,this.complete))},t}(),De=function(t){function e(e,n,r,i){var s=t.call(this,e)||this;return s._tapNext=_,s._tapError=_,s._tapComplete=_,s._tapError=r||_,s._tapComplete=i||_,o(n)?(s._context=s,s._tapNext=n):n&&(s._context=n,s._tapNext=n.next||_,s._tapError=n.error||_,s._tapComplete=n.complete||_),s}return r.__extends(e,t),e.prototype._next=function(t){try{this._tapNext.call(this._context,t)}catch(t){return void this.destination.error(t)}this.destination.next(t)},e.prototype._error=function(t){try{this._tapError.call(this._context,t)}catch(t){return void this.destination.error(t)}this.destination.error(t)},e.prototype._complete=function(){try{this._tapComplete.call(this._context)}catch(t){return void this.destination.error(t)}return this.destination.complete()},e}(v);function Ie(){return Error.call(this),this.message="no elements in sequence",this.name="EmptyError",this}Ie.prototype=Object.create(Error.prototype);var Ae=Ie,Ne=function(t){return void 0===t&&(t=Be),Me({hasValue:!1,next:function(){this.hasValue=!0},complete:function(){if(!this.hasValue)throw t()}})};function Be(){return new Ae}function ze(t){return function(e){return 0===t?Ct():e.lift(new Pe(t))}}var Pe=function(){function t(t){if(this.total=t,this.total<0)throw new Ce}return t.prototype.call=function(t,e){return e.subscribe(new Re(t,this.total))},t}(),Re=function(t){function e(e,n){var r=t.call(this,e)||this;return r.total=n,r.count=0,r}return r.__extends(e,t),e.prototype._next=function(t){var e=this.total,n=++this.count;n<=e&&(this.destination.next(t),n===e&&(this.destination.complete(),this.unsubscribe()))},e}(v);function Fe(t,e){if(t<0)throw new Ce;var n=arguments.length>=2;return function(r){return r.pipe(Se((function(e,n){return n===t})),ze(1),n?Yt(e):Ne((function(){return new Ce})))}}function Le(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){var n=t[t.length-1];H(n)?t.pop():n=null;var r=t.length;return Pt(e,1!==r||n?r>0?vt(t,n):Ct(n):St(t[0]))}}function Ve(t,e){return function(n){return n.lift(new je(t,e,n))}}var je=function(){function t(t,e,n){this.predicate=t,this.thisArg=e,this.source=n}return t.prototype.call=function(t,e){return e.subscribe(new $e(t,this.predicate,this.thisArg,this.source))},t}(),$e=function(t){function e(e,n,r,o){var i=t.call(this,e)||this;return i.predicate=n,i.thisArg=r,i.source=o,i.index=0,i.thisArg=r||i,i}return r.__extends(e,t),e.prototype.notifyComplete=function(t){this.destination.next(t),this.destination.complete()},e.prototype._next=function(t){var e=!1;try{e=this.predicate.call(this.thisArg,t,this.index++,this.source)}catch(t){return void this.destination.error(t)}e||this.notifyComplete(!1)},e.prototype._complete=function(){this.notifyComplete(!0)},e}(v);function We(){return function(t){return t.lift(new He)}}var He=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new qe(t))},t}(),qe=function(t){function e(e){var n=t.call(this,e)||this;return n.hasCompleted=!1,n.hasSubscription=!1,n}return r.__extends(e,t),e.prototype._next=function(t){this.hasSubscription||(this.hasSubscription=!0,this.add(z(this,t)))},e.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete()},e.prototype.notifyComplete=function(t){this.remove(t),this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},e}(y);function Je(t,e){return e?function(n){return n.pipe(Je((function(n,r){return _t(t(n,r)).pipe(Et((function(t,o){return e(n,t,r,o)})))})))}:function(e){return e.lift(new Ke(t))}}var Ke=function(){function t(t){this.project=t}return t.prototype.call=function(t,e){return e.subscribe(new Ue(t,this.project))},t}(),Ue=function(t){function e(e,n){var r=t.call(this,e)||this;return r.project=n,r.hasSubscription=!1,r.hasCompleted=!1,r.index=0,r}return r.__extends(e,t),e.prototype._next=function(t){this.hasSubscription||this.tryNext(t)},e.prototype.tryNext=function(t){var e,n=this.index++;try{e=this.project(t,n)}catch(t){return void this.destination.error(t)}this.hasSubscription=!0,this._innerSub(e,t,n)},e.prototype._innerSub=function(t,e,n){var r=new b(this,void 0,void 0);this.destination.add(r),z(this,t,e,n,r)},e.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete(),this.unsubscribe()},e.prototype.notifyNext=function(t,e,n,r,o){this.destination.next(e)},e.prototype.notifyError=function(t){this.destination.error(t)},e.prototype.notifyComplete=function(t){this.destination.remove(t),this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},e}(y);function Ge(t,e,n){return void 0===e&&(e=Number.POSITIVE_INFINITY),void 0===n&&(n=void 0),e=(e||0)<1?Number.POSITIVE_INFINITY:e,function(r){return r.lift(new Ye(t,e,n))}}var Ye=function(){function t(t,e,n){this.project=t,this.concurrent=e,this.scheduler=n}return t.prototype.call=function(t,e){return e.subscribe(new Xe(t,this.project,this.concurrent,this.scheduler))},t}(),Xe=function(t){function e(e,n,r,o){var i=t.call(this,e)||this;return i.project=n,i.concurrent=r,i.scheduler=o,i.index=0,i.active=0,i.hasCompleted=!1,r<Number.POSITIVE_INFINITY&&(i.buffer=[]),i}return r.__extends(e,t),e.dispatch=function(t){var e=t.subscriber,n=t.result,r=t.value,o=t.index;e.subscribeToProjection(n,r,o)},e.prototype._next=function(t){var n=this.destination;if(n.closed)this._complete();else{var r=this.index++;if(this.active<this.concurrent){n.next(t);try{var o=(0,this.project)(t,r);if(this.scheduler){var i={subscriber:this,result:o,value:t,index:r};this.destination.add(this.scheduler.schedule(e.dispatch,0,i))}else this.subscribeToProjection(o,t,r)}catch(t){n.error(t)}}else this.buffer.push(t)}},e.prototype.subscribeToProjection=function(t,e,n){this.active++,this.destination.add(z(this,t,e,n))},e.prototype._complete=function(){this.hasCompleted=!0,this.hasCompleted&&0===this.active&&this.destination.complete(),this.unsubscribe()},e.prototype.notifyNext=function(t,e,n,r,o){this._next(e)},e.prototype.notifyComplete=function(t){var e=this.buffer;this.destination.remove(t),this.active--,e&&e.length>0&&this._next(e.shift()),this.hasCompleted&&0===this.active&&this.destination.complete()},e}(y);function Ze(t){return function(e){return e.lift(new Qe(t))}}var Qe=function(){function t(t){this.callback=t}return t.prototype.call=function(t,e){return e.subscribe(new tn(t,this.callback))},t}(),tn=function(t){function e(e,n){var r=t.call(this,e)||this;return r.add(new f(n)),r}return r.__extends(e,t),e}(v);function en(t,e){if("function"!=typeof t)throw new TypeError("predicate is not a function");return function(n){return n.lift(new nn(t,n,!1,e))}}var nn=function(){function t(t,e,n,r){this.predicate=t,this.source=e,this.yieldIndex=n,this.thisArg=r}return t.prototype.call=function(t,e){return e.subscribe(new rn(t,this.predicate,this.source,this.yieldIndex,this.thisArg))},t}(),rn=function(t){function e(e,n,r,o,i){var s=t.call(this,e)||this;return s.predicate=n,s.source=r,s.yieldIndex=o,s.thisArg=i,s.index=0,s}return r.__extends(e,t),e.prototype.notifyComplete=function(t){var e=this.destination;e.next(t),e.complete(),this.unsubscribe()},e.prototype._next=function(t){var e=this.predicate,n=this.thisArg,r=this.index++;try{e.call(n||this,t,r,this.source)&&this.notifyComplete(this.yieldIndex?r:t)}catch(t){this.destination.error(t)}},e.prototype._complete=function(){this.notifyComplete(this.yieldIndex?-1:void 0)},e}(v);function on(t,e){return function(n){return n.lift(new nn(t,n,!0,e))}}function sn(t,e){var n=arguments.length>=2;return function(r){return r.pipe(t?Se((function(e,n){return t(e,n,r)})):Nt,ze(1),n?Yt(e):Ne((function(){return new Ae})))}}function an(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}an.prototype=Object.create(Error.prototype);var cn=an,un=function(t){function e(e,n){var r=t.call(this)||this;return r.subject=e,r.subscriber=n,r.closed=!1,r}return r.__extends(e,t),e.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var t=this.subject,e=t.observers;if(this.subject=null,e&&0!==e.length&&!t.isStopped&&!t.closed){var n=e.indexOf(this.subscriber);-1!==n&&e.splice(n,1)}}},e}(f),ln=function(t){function e(e){var n=t.call(this,e)||this;return n.destination=e,n}return r.__extends(e,t),e}(v),dn=function(t){function e(){var e=t.call(this)||this;return e.observers=[],e.closed=!1,e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return r.__extends(e,t),e.prototype[m]=function(){return new ln(this)},e.prototype.lift=function(t){var e=new pn(this,this);return e.operator=t,e},e.prototype.next=function(t){if(this.closed)throw new cn;if(!this.isStopped)for(var e=this.observers,n=e.length,r=e.slice(),o=0;o<n;o++)r[o].next(t)},e.prototype.error=function(t){if(this.closed)throw new cn;this.hasError=!0,this.thrownError=t,this.isStopped=!0;for(var e=this.observers,n=e.length,r=e.slice(),o=0;o<n;o++)r[o].error(t);this.observers.length=0},e.prototype.complete=function(){if(this.closed)throw new cn;this.isStopped=!0;for(var t=this.observers,e=t.length,n=t.slice(),r=0;r<e;r++)n[r].complete();this.observers.length=0},e.prototype.unsubscribe=function(){this.isStopped=!0,this.closed=!0,this.observers=null},e.prototype._trySubscribe=function(e){if(this.closed)throw new cn;return t.prototype._trySubscribe.call(this,e)},e.prototype._subscribe=function(t){if(this.closed)throw new cn;return this.hasError?(t.error(this.thrownError),f.EMPTY):this.isStopped?(t.complete(),f.EMPTY):(this.observers.push(t),new un(this,t))},e.prototype.asObservable=function(){var t=new C;return t.source=this,t},e.create=function(t,e){return new pn(t,e)},e}(C),pn=function(t){function e(e,n){var r=t.call(this)||this;return r.destination=e,r.source=n,r}return r.__extends(e,t),e.prototype.next=function(t){var e=this.destination;e&&e.next&&e.next(t)},e.prototype.error=function(t){var e=this.destination;e&&e.error&&this.destination.error(t)},e.prototype.complete=function(){var t=this.destination;t&&t.complete&&this.destination.complete()},e.prototype._subscribe=function(t){return this.source?this.source.subscribe(t):f.EMPTY},e}(dn);function fn(t,e,n,r){return function(o){return o.lift(new hn(t,e,n,r))}}var hn=function(){function t(t,e,n,r){this.keySelector=t,this.elementSelector=e,this.durationSelector=n,this.subjectSelector=r}return t.prototype.call=function(t,e){return e.subscribe(new mn(t,this.keySelector,this.elementSelector,this.durationSelector,this.subjectSelector))},t}(),mn=function(t){function e(e,n,r,o,i){var s=t.call(this,e)||this;return s.keySelector=n,s.elementSelector=r,s.durationSelector=o,s.subjectSelector=i,s.groups=null,s.attemptedToUnsubscribe=!1,s.count=0,s}return r.__extends(e,t),e.prototype._next=function(t){var e;try{e=this.keySelector(t)}catch(t){return void this.error(t)}this._group(t,e)},e.prototype._group=function(t,e){var n=this.groups;n||(n=this.groups=new Map);var r,o=n.get(e);if(this.elementSelector)try{r=this.elementSelector(t)}catch(t){this.error(t)}else r=t;if(!o){o=this.subjectSelector?this.subjectSelector():new dn,n.set(e,o);var i=new gn(e,o,this);if(this.destination.next(i),this.durationSelector){var s=void 0;try{s=this.durationSelector(new gn(e,o))}catch(t){return void this.error(t)}this.add(s.subscribe(new vn(e,o,this)))}}o.closed||o.next(r)},e.prototype._error=function(t){var e=this.groups;e&&(e.forEach((function(e,n){e.error(t)})),e.clear()),this.destination.error(t)},e.prototype._complete=function(){var t=this.groups;t&&(t.forEach((function(t,e){t.complete()})),t.clear()),this.destination.complete()},e.prototype.removeGroup=function(t){this.groups.delete(t)},e.prototype.unsubscribe=function(){this.closed||(this.attemptedToUnsubscribe=!0,0===this.count&&t.prototype.unsubscribe.call(this))},e}(v),vn=function(t){function e(e,n,r){var o=t.call(this,n)||this;return o.key=e,o.group=n,o.parent=r,o}return r.__extends(e,t),e.prototype._next=function(t){this.complete()},e.prototype._unsubscribe=function(){var t=this.parent,e=this.key;this.key=this.parent=null,t&&t.removeGroup(e)},e}(v),gn=function(t){function e(e,n,r){var o=t.call(this)||this;return o.key=e,o.groupSubject=n,o.refCountSubscription=r,o}return r.__extends(e,t),e.prototype._subscribe=function(t){var e=new f,n=this.refCountSubscription,r=this.groupSubject;return n&&!n.closed&&e.add(new yn(n)),e.add(r.subscribe(t)),e},e}(C),yn=function(t){function e(e){var n=t.call(this)||this;return n.parent=e,e.count++,n}return r.__extends(e,t),e.prototype.unsubscribe=function(){var e=this.parent;e.closed||this.closed||(t.prototype.unsubscribe.call(this),e.count-=1,0===e.count&&e.attemptedToUnsubscribe&&e.unsubscribe())},e}(f);function bn(){return function(t){return t.lift(new wn)}}var wn=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new _n(t))},t}(),_n=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e.prototype._next=function(t){},e}(v);function xn(){return function(t){return t.lift(new kn)}}var kn=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new Cn(t))},t}(),Cn=function(t){function e(e){return t.call(this,e)||this}return r.__extends(e,t),e.prototype.notifyComplete=function(t){var e=this.destination;e.next(t),e.complete()},e.prototype._next=function(t){this.notifyComplete(!1)},e.prototype._complete=function(){this.notifyComplete(!0)},e}(v);function Sn(t){return function(e){return 0===t?Ct():e.lift(new Tn(t))}}var Tn=function(){function t(t){if(this.total=t,this.total<0)throw new Ce}return t.prototype.call=function(t,e){return e.subscribe(new En(t,this.total))},t}(),En=function(t){function e(e,n){var r=t.call(this,e)||this;return r.total=n,r.ring=new Array,r.count=0,r}return r.__extends(e,t),e.prototype._next=function(t){var e=this.ring,n=this.total,r=this.count++;e.length<n?e.push(t):e[r%n]=t},e.prototype._complete=function(){var t=this.destination,e=this.count;if(e>0)for(var n=this.count>=this.total?this.total:this.count,r=this.ring,o=0;o<n;o++){var i=e++%n;t.next(r[i])}t.complete()},e}(v);function Mn(t,e){var n=arguments.length>=2;return function(r){return r.pipe(t?Se((function(e,n){return t(e,n,r)})):Nt,Sn(1),n?Yt(e):Ne((function(){return new Ae})))}}function On(t){return function(e){return e.lift(new Dn(t))}}var Dn=function(){function t(t){this.value=t}return t.prototype.call=function(t,e){return e.subscribe(new In(t,this.value))},t}(),In=function(t){function e(e,n){var r=t.call(this,e)||this;return r.value=n,r}return r.__extends(e,t),e.prototype._next=function(t){this.destination.next(this.value)},e}(v);function An(){return function(t){return t.lift(new Nn)}}var Nn=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new Bn(t))},t}(),Bn=function(t){function e(e){return t.call(this,e)||this}return r.__extends(e,t),e.prototype._next=function(t){this.destination.next(re.createNext(t))},e.prototype._error=function(t){var e=this.destination;e.next(re.createError(t)),e.complete()},e.prototype._complete=function(){var t=this.destination;t.next(re.createComplete()),t.complete()},e}(v);function zn(t,e){var n=!1;return arguments.length>=2&&(n=!0),function(r){return r.lift(new Pn(t,e,n))}}var Pn=function(){function t(t,e,n){void 0===n&&(n=!1),this.accumulator=t,this.seed=e,this.hasSeed=n}return t.prototype.call=function(t,e){return e.subscribe(new Rn(t,this.accumulator,this.seed,this.hasSeed))},t}(),Rn=function(t){function e(e,n,r,o){var i=t.call(this,e)||this;return i.accumulator=n,i._seed=r,i.hasSeed=o,i.index=0,i}return r.__extends(e,t),Object.defineProperty(e.prototype,"seed",{get:function(){return this._seed},set:function(t){this.hasSeed=!0,this._seed=t},enumerable:!0,configurable:!0}),e.prototype._next=function(t){if(this.hasSeed)return this._tryNext(t);this.seed=t,this.destination.next(t)},e.prototype._tryNext=function(t){var e,n=this.index++;try{e=this.accumulator(this.seed,t,n)}catch(t){this.destination.error(t)}this.seed=e,this.destination.next(e)},e}(v);function Fn(t,e){return arguments.length>=2?function(n){return x(zn(t,e),Sn(1),Yt(e))(n)}:function(e){return x(zn((function(e,n,r){return t(e,n,r+1)})),Sn(1))(e)}}function Ln(t){return Fn("function"==typeof t?function(e,n){return t(e,n)>0?e:n}:function(t,e){return t>e?t:e})}function Vn(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Number.POSITIVE_INFINITY,r=null,o=t[t.length-1];return H(o)?(r=t.pop(),t.length>1&&"number"==typeof t[t.length-1]&&(n=t.pop())):"number"==typeof o&&(n=t.pop()),null===r&&1===t.length&&t[0]instanceof C?t[0]:Bt(n)(vt(t,r))}function jn(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return e.lift.call(Vn.apply(void 0,[e].concat(t)))}}function $n(t,e,n){return void 0===n&&(n=Number.POSITIVE_INFINITY),"function"==typeof e?Dt((function(){return t}),e,n):("number"==typeof e&&(n=e),Dt((function(){return t}),n))}function Wn(t,e,n){return void 0===n&&(n=Number.POSITIVE_INFINITY),function(r){return r.lift(new Hn(t,e,n))}}var Hn=function(){function t(t,e,n){this.accumulator=t,this.seed=e,this.concurrent=n}return t.prototype.call=function(t,e){return e.subscribe(new qn(t,this.accumulator,this.seed,this.concurrent))},t}(),qn=function(t){function e(e,n,r,o){var i=t.call(this,e)||this;return i.accumulator=n,i.acc=r,i.concurrent=o,i.hasValue=!1,i.hasCompleted=!1,i.buffer=[],i.active=0,i.index=0,i}return r.__extends(e,t),e.prototype._next=function(t){if(this.active<this.concurrent){var e=this.index++,n=this.destination,r=void 0;try{r=(0,this.accumulator)(this.acc,t,e)}catch(t){return n.error(t)}this.active++,this._innerSub(r,t,e)}else this.buffer.push(t)},e.prototype._innerSub=function(t,e,n){var r=new b(this,void 0,void 0);this.destination.add(r),z(this,t,e,n,r)},e.prototype._complete=function(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&(!1===this.hasValue&&this.destination.next(this.acc),this.destination.complete()),this.unsubscribe()},e.prototype.notifyNext=function(t,e,n,r,o){var i=this.destination;this.acc=e,this.hasValue=!0,i.next(e)},e.prototype.notifyComplete=function(t){var e=this.buffer;this.destination.remove(t),this.active--,e.length>0?this._next(e.shift()):0===this.active&&this.hasCompleted&&(!1===this.hasValue&&this.destination.next(this.acc),this.destination.complete())},e}(y);function Jn(t){return Fn("function"==typeof t?function(e,n){return t(e,n)<0?e:n}:function(t,e){return t<e?t:e})}function Kn(){return function(t){return t.lift(new Un(t))}}var Un=function(){function t(t){this.connectable=t}return t.prototype.call=function(t,e){var n=this.connectable;n._refCount++;var r=new Gn(t,n),o=e.subscribe(r);return r.closed||(r.connection=n.connect()),o},t}(),Gn=function(t){function e(e,n){var r=t.call(this,e)||this;return r.connectable=n,r}return r.__extends(e,t),e.prototype._unsubscribe=function(){var t=this.connectable;if(t){this.connectable=null;var e=t._refCount;if(e<=0)this.connection=null;else if(t._refCount=e-1,e>1)this.connection=null;else{var n=this.connection,r=t._connection;this.connection=null,!r||n&&r!==n||r.unsubscribe()}}else this.connection=null},e}(v),Yn=function(t){function e(e,n){var r=t.call(this)||this;return r.source=e,r.subjectFactory=n,r._refCount=0,r._isComplete=!1,r}return r.__extends(e,t),e.prototype._subscribe=function(t){return this.getSubject().subscribe(t)},e.prototype.getSubject=function(){var t=this._subject;return t&&!t.isStopped||(this._subject=this.subjectFactory()),this._subject},e.prototype.connect=function(){var t=this._connection;return t||(this._isComplete=!1,(t=this._connection=new f).add(this.source.subscribe(new Zn(this.getSubject(),this))),t.closed?(this._connection=null,t=f.EMPTY):this._connection=t),t},e.prototype.refCount=function(){return Kn()(this)},e}(C).prototype,Xn={operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:Yn._subscribe},_isComplete:{value:Yn._isComplete,writable:!0},getSubject:{value:Yn.getSubject},connect:{value:Yn.connect},refCount:{value:Yn.refCount}},Zn=function(t){function e(e,n){var r=t.call(this,e)||this;return r.connectable=n,r}return r.__extends(e,t),e.prototype._error=function(e){this._unsubscribe(),t.prototype._error.call(this,e)},e.prototype._complete=function(){this.connectable._isComplete=!0,this._unsubscribe(),t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){var t=this.connectable;if(t){this.connectable=null;var e=t._connection;t._refCount=0,t._subject=null,t._connection=null,e&&e.unsubscribe()}},e}(ln);function Qn(t,e){return function(n){var r;if(r="function"==typeof t?t:function(){return t},"function"==typeof e)return n.lift(new tr(r,e));var o=Object.create(n,Xn);return o.source=n,o.subjectFactory=r,o}}var tr=function(){function t(t,e){this.subjectFactory=t,this.selector=e}return t.prototype.call=function(t,e){var n=this.selector,r=this.subjectFactory(),o=n(r).subscribe(t);return o.add(e.subscribe(r)),o},t}();function er(t,e){return void 0===e&&(e=0),function(n){return n.lift(new nr(t,e))}}var nr=function(){function t(t,e){void 0===e&&(e=0),this.scheduler=t,this.delay=e}return t.prototype.call=function(t,e){return e.subscribe(new rr(t,this.scheduler,this.delay))},t}(),rr=function(t){function e(e,n,r){void 0===r&&(r=0);var o=t.call(this,e)||this;return o.scheduler=n,o.delay=r,o}return r.__extends(e,t),e.dispatch=function(t){var e=t.notification,n=t.destination;e.observe(n),this.unsubscribe()},e.prototype.scheduleMessage=function(t){this.destination.add(this.scheduler.schedule(e.dispatch,this.delay,new or(t,this.destination)))},e.prototype._next=function(t){this.scheduleMessage(re.createNext(t))},e.prototype._error=function(t){this.scheduleMessage(re.createError(t)),this.unsubscribe()},e.prototype._complete=function(){this.scheduleMessage(re.createComplete()),this.unsubscribe()},e}(v),or=function(){return function(t,e){this.notification=t,this.destination=e}}();function ir(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return 1===t.length&&u(t[0])&&(t=t[0]),function(e){return e.lift(new sr(t))}}var sr=function(){function t(t){this.nextSources=t}return t.prototype.call=function(t,e){return e.subscribe(new ar(t,this.nextSources))},t}(),ar=function(t){function e(e,n){var r=t.call(this,e)||this;return r.destination=e,r.nextSources=n,r}return r.__extends(e,t),e.prototype.notifyError=function(t,e){this.subscribeToNextSource()},e.prototype.notifyComplete=function(t){this.subscribeToNextSource()},e.prototype._error=function(t){this.subscribeToNextSource(),this.unsubscribe()},e.prototype._complete=function(){this.subscribeToNextSource(),this.unsubscribe()},e.prototype.subscribeToNextSource=function(){var t=this.nextSources.shift();if(t){var e=new b(this,void 0,void 0);this.destination.add(e),z(this,t,void 0,void 0,e)}else this.destination.complete()},e}(y);function cr(){return function(t){return t.lift(new ur)}}var ur=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new lr(t))},t}(),lr=function(t){function e(e){var n=t.call(this,e)||this;return n.hasPrev=!1,n}return r.__extends(e,t),e.prototype._next=function(t){this.hasPrev?this.destination.next([this.prev,t]):this.hasPrev=!0,this.prev=t},e}(v);function dr(t,e){function n(){return!n.pred.apply(n.thisArg,arguments)}return n.pred=t,n.thisArg=e,n}function pr(t,e){return function(n){return[Se(t,e)(n),Se(dr(t,e))(n)]}}function fr(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t.length;if(0===n)throw new Error("list of properties cannot be empty.");return function(e){return Et(hr(t,n))(e)}}function hr(t,e){return function(n){for(var r=n,o=0;o<e;o++){var i=r[t[o]];if(void 0===i)return;r=i}return r}}function mr(t){return t?Qn((function(){return new dn}),t):Qn(new dn)}var vr=function(t){function e(e){var n=t.call(this)||this;return n._value=e,n}return r.__extends(e,t),Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0}),e.prototype._subscribe=function(e){var n=t.prototype._subscribe.call(this,e);return n&&!n.closed&&e.next(this._value),n},e.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(this.closed)throw new cn;return this._value},e.prototype.next=function(e){t.prototype.next.call(this,this._value=e)},e}(dn);function gr(t){return function(e){return Qn(new vr(t))(e)}}var yr=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.value=null,e.hasNext=!1,e.hasCompleted=!1,e}return r.__extends(e,t),e.prototype._subscribe=function(e){return this.hasError?(e.error(this.thrownError),f.EMPTY):this.hasCompleted&&this.hasNext?(e.next(this.value),e.complete(),f.EMPTY):t.prototype._subscribe.call(this,e)},e.prototype.next=function(t){this.hasCompleted||(this.value=t,this.hasNext=!0)},e.prototype.error=function(e){this.hasCompleted||t.prototype.error.call(this,e)},e.prototype.complete=function(){this.hasCompleted=!0,this.hasNext&&t.prototype.next.call(this,this.value),t.prototype.complete.call(this)},e}(dn);function br(){return function(t){return Qn(new yr)(t)}}var wr=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r}return r.__extends(e,t),e.prototype.schedule=function(e,n){return void 0===n&&(n=0),n>0?t.prototype.schedule.call(this,e,n):(this.delay=n,this.state=e,this.scheduler.flush(this),this)},e.prototype.execute=function(e,n){return n>0||this.closed?t.prototype.execute.call(this,e,n):this._execute(e,n)},e.prototype.requestAsyncId=function(e,n,r){return void 0===r&&(r=0),null!==r&&r>0||null===r&&this.delay>0?t.prototype.requestAsyncId.call(this,e,n,r):e.flush(this)},e}(L),_r=new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(j))(wr),xr=function(t){function e(e,n,r){void 0===e&&(e=Number.POSITIVE_INFINITY),void 0===n&&(n=Number.POSITIVE_INFINITY);var o=t.call(this)||this;return o.scheduler=r,o._events=[],o._infiniteTimeWindow=!1,o._bufferSize=e<1?1:e,o._windowTime=n<1?1:n,n===Number.POSITIVE_INFINITY?(o._infiniteTimeWindow=!0,o.next=o.nextInfiniteTimeWindow):o.next=o.nextTimeWindow,o}return r.__extends(e,t),e.prototype.nextInfiniteTimeWindow=function(e){var n=this._events;n.push(e),n.length>this._bufferSize&&n.shift(),t.prototype.next.call(this,e)},e.prototype.nextTimeWindow=function(e){this._events.push(new kr(this._getNow(),e)),this._trimBufferThenGetEvents(),t.prototype.next.call(this,e)},e.prototype._subscribe=function(t){var e,n=this._infiniteTimeWindow,r=n?this._events:this._trimBufferThenGetEvents(),o=this.scheduler,i=r.length;if(this.closed)throw new cn;if(this.isStopped||this.hasError?e=f.EMPTY:(this.observers.push(t),e=new un(this,t)),o&&t.add(t=new rr(t,o)),n)for(var s=0;s<i&&!t.closed;s++)t.next(r[s]);else for(s=0;s<i&&!t.closed;s++)t.next(r[s].value);return this.hasError?t.error(this.thrownError):this.isStopped&&t.complete(),e},e.prototype._getNow=function(){return(this.scheduler||_r).now()},e.prototype._trimBufferThenGetEvents=function(){for(var t=this._getNow(),e=this._bufferSize,n=this._windowTime,r=this._events,o=r.length,i=0;i<o&&!(t-r[i].time<n);)i++;return o>e&&(i=Math.max(i,o-e)),i>0&&r.splice(0,i),r},e}(dn),kr=function(){return function(t,e){this.time=t,this.value=e}}();function Cr(t,e,n,r){n&&"function"!=typeof n&&(r=n);var o="function"==typeof n?n:void 0,i=new xr(t,e,r);return function(t){return Qn((function(){return i}),o)(t)}}function Sr(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(1===t.length){if(!u(t[0]))return t[0];t=t[0]}return vt(t,void 0).lift(new Tr)}var Tr=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new Er(t))},t}(),Er=function(t){function e(e){var n=t.call(this,e)||this;return n.hasFirst=!1,n.observables=[],n.subscriptions=[],n}return r.__extends(e,t),e.prototype._next=function(t){this.observables.push(t)},e.prototype._complete=function(){var t=this.observables,e=t.length;if(0===e)this.destination.complete();else{for(var n=0;n<e&&!this.hasFirst;n++){var r=t[n],o=z(this,r,r,n);this.subscriptions&&this.subscriptions.push(o),this.add(o)}this.observables=null}},e.prototype.notifyNext=function(t,e,n,r,o){if(!this.hasFirst){this.hasFirst=!0;for(var i=0;i<this.subscriptions.length;i++)if(i!==n){var s=this.subscriptions[i];s.unsubscribe(),this.remove(s)}this.subscriptions=null}this.destination.next(e)},e}(y);function Mr(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return 1===t.length&&u(t[0])&&(t=t[0]),e.lift.call(Sr.apply(void 0,[e].concat(t)))}}function Or(t){return void 0===t&&(t=-1),function(e){return 0===t?Ct():t<0?e.lift(new Dr(-1,e)):e.lift(new Dr(t-1,e))}}var Dr=function(){function t(t,e){this.count=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new Ir(t,this.count,this.source))},t}(),Ir=function(t){function e(e,n,r){var o=t.call(this,e)||this;return o.count=n,o.source=r,o}return r.__extends(e,t),e.prototype.complete=function(){if(!this.isStopped){var e=this.source,n=this.count;if(0===n)return t.prototype.complete.call(this);n>-1&&(this.count=n-1),e.subscribe(this._unsubscribeAndRecycle())}},e}(v);function Ar(t){return function(e){return e.lift(new Nr(t))}}var Nr=function(){function t(t){this.notifier=t}return t.prototype.call=function(t,e){return e.subscribe(new Br(t,this.notifier,e))},t}(),Br=function(t){function e(e,n,r){var o=t.call(this,e)||this;return o.notifier=n,o.source=r,o.sourceIsBeingSubscribedTo=!0,o}return r.__extends(e,t),e.prototype.notifyNext=function(t,e,n,r,o){this.sourceIsBeingSubscribedTo=!0,this.source.subscribe(this)},e.prototype.notifyComplete=function(e){if(!1===this.sourceIsBeingSubscribedTo)return t.prototype.complete.call(this)},e.prototype.complete=function(){if(this.sourceIsBeingSubscribedTo=!1,!this.isStopped){if(this.retries||this.subscribeToRetries(),!this.retriesSubscription||this.retriesSubscription.closed)return t.prototype.complete.call(this);this._unsubscribeAndRecycle(),this.notifications.next()}},e.prototype._unsubscribe=function(){var t=this.notifications,e=this.retriesSubscription;t&&(t.unsubscribe(),this.notifications=null),e&&(e.unsubscribe(),this.retriesSubscription=null),this.retries=null},e.prototype._unsubscribeAndRecycle=function(){var e=this._unsubscribe;return this._unsubscribe=null,t.prototype._unsubscribeAndRecycle.call(this),this._unsubscribe=e,this},e.prototype.subscribeToRetries=function(){var e;this.notifications=new dn;try{e=(0,this.notifier)(this.notifications)}catch(e){return t.prototype.complete.call(this)}this.retries=e,this.retriesSubscription=z(this,e)},e}(y);function zr(t){return void 0===t&&(t=-1),function(e){return e.lift(new Pr(t,e))}}var Pr=function(){function t(t,e){this.count=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new Rr(t,this.count,this.source))},t}(),Rr=function(t){function e(e,n,r){var o=t.call(this,e)||this;return o.count=n,o.source=r,o}return r.__extends(e,t),e.prototype.error=function(e){if(!this.isStopped){var n=this.source,r=this.count;if(0===r)return t.prototype.error.call(this,e);r>-1&&(this.count=r-1),n.subscribe(this._unsubscribeAndRecycle())}},e}(v);function Fr(t){return function(e){return e.lift(new Lr(t,e))}}var Lr=function(){function t(t,e){this.notifier=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new Vr(t,this.notifier,this.source))},t}(),Vr=function(t){function e(e,n,r){var o=t.call(this,e)||this;return o.notifier=n,o.source=r,o}return r.__extends(e,t),e.prototype.error=function(e){if(!this.isStopped){var n=this.errors,r=this.retries,o=this.retriesSubscription;if(r)this.errors=null,this.retriesSubscription=null;else{n=new dn;try{r=(0,this.notifier)(n)}catch(e){return t.prototype.error.call(this,e)}o=z(this,r)}this._unsubscribeAndRecycle(),this.errors=n,this.retries=r,this.retriesSubscription=o,n.next(e)}},e.prototype._unsubscribe=function(){var t=this.errors,e=this.retriesSubscription;t&&(t.unsubscribe(),this.errors=null),e&&(e.unsubscribe(),this.retriesSubscription=null),this.retries=null},e.prototype.notifyNext=function(t,e,n,r,o){var i=this._unsubscribe;this._unsubscribe=null,this._unsubscribeAndRecycle(),this._unsubscribe=i,this.source.subscribe(this)},e}(y);function jr(t){return function(e){return e.lift(new $r(t))}}var $r=function(){function t(t){this.notifier=t}return t.prototype.call=function(t,e){var n=new Wr(t),r=e.subscribe(n);return r.add(z(n,this.notifier)),r},t}(),Wr=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.hasValue=!1,e}return r.__extends(e,t),e.prototype._next=function(t){this.value=t,this.hasValue=!0},e.prototype.notifyNext=function(t,e,n,r,o){this.emitValue()},e.prototype.notifyComplete=function(){this.emitValue()},e.prototype.emitValue=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.value))},e}(y);function Hr(t,e){return void 0===e&&(e=$),function(n){return n.lift(new qr(t,e))}}var qr=function(){function t(t,e){this.period=t,this.scheduler=e}return t.prototype.call=function(t,e){return e.subscribe(new Jr(t,this.period,this.scheduler))},t}(),Jr=function(t){function e(e,n,r){var o=t.call(this,e)||this;return o.period=n,o.scheduler=r,o.hasValue=!1,o.add(r.schedule(Kr,n,{subscriber:o,period:n})),o}return r.__extends(e,t),e.prototype._next=function(t){this.lastValue=t,this.hasValue=!0},e.prototype.notifyNext=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.lastValue))},e}(v);function Kr(t){var e=t.subscriber,n=t.period;e.notifyNext(),this.schedule(t,n)}function Ur(t,e){return function(n){return n.lift(new Gr(t,e))}}var Gr=function(){function t(t,e){this.compareTo=t,this.comparator=e}return t.prototype.call=function(t,e){return e.subscribe(new Yr(t,this.compareTo,this.comparator))},t}(),Yr=function(t){function e(e,n,r){var o=t.call(this,e)||this;return o.compareTo=n,o.comparator=r,o._a=[],o._b=[],o._oneComplete=!1,o.destination.add(n.subscribe(new Xr(e,o))),o}return r.__extends(e,t),e.prototype._next=function(t){this._oneComplete&&0===this._b.length?this.emit(!1):(this._a.push(t),this.checkValues())},e.prototype._complete=function(){this._oneComplete?this.emit(0===this._a.length&&0===this._b.length):this._oneComplete=!0,this.unsubscribe()},e.prototype.checkValues=function(){for(var t=this._a,e=this._b,n=this.comparator;t.length>0&&e.length>0;){var r=t.shift(),o=e.shift(),i=!1;try{i=n?n(r,o):r===o}catch(t){this.destination.error(t)}i||this.emit(!1)}},e.prototype.emit=function(t){var e=this.destination;e.next(t),e.complete()},e.prototype.nextB=function(t){this._oneComplete&&0===this._a.length?this.emit(!1):(this._b.push(t),this.checkValues())},e.prototype.completeB=function(){this._oneComplete?this.emit(0===this._a.length&&0===this._b.length):this._oneComplete=!0},e}(v),Xr=function(t){function e(e,n){var r=t.call(this,e)||this;return r.parent=n,r}return r.__extends(e,t),e.prototype._next=function(t){this.parent.nextB(t)},e.prototype._error=function(t){this.parent.error(t),this.unsubscribe()},e.prototype._complete=function(){this.parent.completeB(),this.unsubscribe()},e}(v);function Zr(){return new dn}function Qr(){return function(t){return Kn()(Qn(Zr)(t))}}function to(t,e,n){var r;return r=t&&"object"==typeof t?t:{bufferSize:t,windowTime:e,refCount:!1,scheduler:n},function(t){return t.lift(function(t){var e,n,r=t.bufferSize,o=void 0===r?Number.POSITIVE_INFINITY:r,i=t.windowTime,s=void 0===i?Number.POSITIVE_INFINITY:i,a=t.refCount,c=t.scheduler,u=0,l=!1,d=!1;return function(t){u++,e&&!l||(l=!1,e=new xr(o,s,c),n=t.subscribe({next:function(t){e.next(t)},error:function(t){l=!0,e.error(t)},complete:function(){d=!0,e.complete()}}));var r=e.subscribe(this);this.add((function(){u--,r.unsubscribe(),n&&!d&&a&&0===u&&(n.unsubscribe(),n=void 0,e=void 0)}))}}(r))}}function eo(t){return function(e){return e.lift(new no(t,e))}}var no=function(){function t(t,e){this.predicate=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new ro(t,this.predicate,this.source))},t}(),ro=function(t){function e(e,n,r){var o=t.call(this,e)||this;return o.predicate=n,o.source=r,o.seenValue=!1,o.index=0,o}return r.__extends(e,t),e.prototype.applySingleValue=function(t){this.seenValue?this.destination.error("Sequence contains more than one element"):(this.seenValue=!0,this.singleValue=t)},e.prototype._next=function(t){var e=this.index++;this.predicate?this.tryNext(t,e):this.applySingleValue(t)},e.prototype.tryNext=function(t,e){try{this.predicate(t,e,this.source)&&this.applySingleValue(t)}catch(t){this.destination.error(t)}},e.prototype._complete=function(){var t=this.destination;this.index>0?(t.next(this.seenValue?this.singleValue:void 0),t.complete()):t.error(new Ae)},e}(v);function oo(t){return function(e){return e.lift(new io(t))}}var io=function(){function t(t){this.total=t}return t.prototype.call=function(t,e){return e.subscribe(new so(t,this.total))},t}(),so=function(t){function e(e,n){var r=t.call(this,e)||this;return r.total=n,r.count=0,r}return r.__extends(e,t),e.prototype._next=function(t){++this.count>this.total&&this.destination.next(t)},e}(v);function ao(t){return function(e){return e.lift(new co(t))}}var co=function(){function t(t){if(this._skipCount=t,this._skipCount<0)throw new Ce}return t.prototype.call=function(t,e){return 0===this._skipCount?e.subscribe(new v(t)):e.subscribe(new uo(t,this._skipCount))},t}(),uo=function(t){function e(e,n){var r=t.call(this,e)||this;return r._skipCount=n,r._count=0,r._ring=new Array(n),r}return r.__extends(e,t),e.prototype._next=function(t){var e=this._skipCount,n=this._count++;if(n<e)this._ring[n]=t;else{var r=n%e,o=this._ring,i=o[r];o[r]=t,this.destination.next(i)}},e}(v);function lo(t){return function(e){return e.lift(new po(t))}}var po=function(){function t(t){this.notifier=t}return t.prototype.call=function(t,e){return e.subscribe(new fo(t,this.notifier))},t}(),fo=function(t){function e(e,n){var r=t.call(this,e)||this;r.hasValue=!1;var o=new b(r,void 0,void 0);return r.add(o),r.innerSubscription=o,z(r,n,void 0,void 0,o),r}return r.__extends(e,t),e.prototype._next=function(e){this.hasValue&&t.prototype._next.call(this,e)},e.prototype.notifyNext=function(t,e,n,r,o){this.hasValue=!0,this.innerSubscription&&this.innerSubscription.unsubscribe()},e.prototype.notifyComplete=function(){},e}(y);function ho(t){return function(e){return e.lift(new mo(t))}}var mo=function(){function t(t){this.predicate=t}return t.prototype.call=function(t,e){return e.subscribe(new vo(t,this.predicate))},t}(),vo=function(t){function e(e,n){var r=t.call(this,e)||this;return r.predicate=n,r.skipping=!0,r.index=0,r}return r.__extends(e,t),e.prototype._next=function(t){var e=this.destination;this.skipping&&this.tryCallPredicate(t),this.skipping||e.next(t)},e.prototype.tryCallPredicate=function(t){try{var e=this.predicate(t,this.index++);this.skipping=Boolean(e)}catch(t){this.destination.error(t)}},e}(v);function go(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){var n=t[t.length-1];H(n)?t.pop():n=null;var r=t.length;return Pt(1!==r||n?r>0?vt(t,n):Ct(n):St(t[0]),e)}}var yo=1,bo={};var wo=function(t){var e=yo++;return bo[e]=t,Promise.resolve().then((function(){return function(t){var e=bo[t];e&&e()}(e)})),e},_o=function(t){delete bo[t]},xo=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r}return r.__extends(e,t),e.prototype.requestAsyncId=function(e,n,r){return void 0===r&&(r=0),null!==r&&r>0?t.prototype.requestAsyncId.call(this,e,n,r):(e.actions.push(this),e.scheduled||(e.scheduled=wo(e.flush.bind(e,null))))},e.prototype.recycleAsyncId=function(e,n,r){if(void 0===r&&(r=0),null!==r&&r>0||null===r&&this.delay>0)return t.prototype.recycleAsyncId.call(this,e,n,r);0===e.actions.length&&(_o(n),e.scheduled=void 0)},e}(L),ko=new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e.prototype.flush=function(t){this.active=!0,this.scheduled=void 0;var e,n=this.actions,r=-1,o=n.length;t=t||n.shift();do{if(e=t.execute(t.state,t.delay))break}while(++r<o&&(t=n.shift()));if(this.active=!1,e){for(;++r<o&&(t=n.shift());)t.unsubscribe();throw e}},e}(j))(xo),Co=function(t){function e(e,n,r){void 0===n&&(n=0),void 0===r&&(r=ko);var o=t.call(this)||this;return o.source=e,o.delayTime=n,o.scheduler=r,(!W(n)||n<0)&&(o.delayTime=0),r&&"function"==typeof r.schedule||(o.scheduler=ko),o}return r.__extends(e,t),e.create=function(t,n,r){return void 0===n&&(n=0),void 0===r&&(r=ko),new e(t,n,r)},e.dispatch=function(t){var e=t.source,n=t.subscriber;return this.add(e.subscribe(n))},e.prototype._subscribe=function(t){var n=this.delayTime,r=this.source;return this.scheduler.schedule(e.dispatch,n,{source:r,subscriber:t})},e}(C);function So(t,e){return void 0===e&&(e=0),function(n){return n.lift(new To(t,e))}}var To=function(){function t(t,e){this.scheduler=t,this.delay=e}return t.prototype.call=function(t,e){return new Co(e,this.delay,this.scheduler).subscribe(t)},t}();function Eo(t,e){return"function"==typeof e?function(n){return n.pipe(Eo((function(n,r){return _t(t(n,r)).pipe(Et((function(t,o){return e(n,t,r,o)})))})))}:function(e){return e.lift(new Mo(t))}}var Mo=function(){function t(t){this.project=t}return t.prototype.call=function(t,e){return e.subscribe(new Oo(t,this.project))},t}(),Oo=function(t){function e(e,n){var r=t.call(this,e)||this;return r.project=n,r.index=0,r}return r.__extends(e,t),e.prototype._next=function(t){var e,n=this.index++;try{e=this.project(t,n)}catch(t){return void this.destination.error(t)}this._innerSub(e,t,n)},e.prototype._innerSub=function(t,e,n){var r=this.innerSubscription;r&&r.unsubscribe();var o=new b(this,void 0,void 0);this.destination.add(o),this.innerSubscription=z(this,t,e,n,o)},e.prototype._complete=function(){var e=this.innerSubscription;e&&!e.closed||t.prototype._complete.call(this),this.unsubscribe()},e.prototype._unsubscribe=function(){this.innerSubscription=null},e.prototype.notifyComplete=function(e){this.destination.remove(e),this.innerSubscription=null,this.isStopped&&t.prototype._complete.call(this)},e.prototype.notifyNext=function(t,e,n,r,o){this.destination.next(e)},e}(y);function Do(){return Eo(Nt)}function Io(t,e){return e?Eo((function(){return t}),e):Eo((function(){return t}))}function Ao(t){return function(e){return e.lift(new No(t))}}var No=function(){function t(t){this.notifier=t}return t.prototype.call=function(t,e){var n=new Bo(t),r=z(n,this.notifier);return r&&!n.seenValue?(n.add(r),e.subscribe(n)):n},t}(),Bo=function(t){function e(e){var n=t.call(this,e)||this;return n.seenValue=!1,n}return r.__extends(e,t),e.prototype.notifyNext=function(t,e,n,r,o){this.seenValue=!0,this.complete()},e.prototype.notifyComplete=function(){},e}(y);function zo(t,e){return void 0===e&&(e=!1),function(n){return n.lift(new Po(t,e))}}var Po=function(){function t(t,e){this.predicate=t,this.inclusive=e}return t.prototype.call=function(t,e){return e.subscribe(new Ro(t,this.predicate,this.inclusive))},t}(),Ro=function(t){function e(e,n,r){var o=t.call(this,e)||this;return o.predicate=n,o.inclusive=r,o.index=0,o}return r.__extends(e,t),e.prototype._next=function(t){var e,n=this.destination;try{e=this.predicate(t,this.index++)}catch(t){return void n.error(t)}this.nextOrComplete(t,e)},e.prototype.nextOrComplete=function(t,e){var n=this.destination;Boolean(e)?n.next(t):(this.inclusive&&n.next(t),n.complete())},e}(v),Fo={leading:!0,trailing:!1};function Lo(t,e){return void 0===e&&(e=Fo),function(n){return n.lift(new Vo(t,e.leading,e.trailing))}}var Vo=function(){function t(t,e,n){this.durationSelector=t,this.leading=e,this.trailing=n}return t.prototype.call=function(t,e){return e.subscribe(new jo(t,this.durationSelector,this.leading,this.trailing))},t}(),jo=function(t){function e(e,n,r,o){var i=t.call(this,e)||this;return i.destination=e,i.durationSelector=n,i._leading=r,i._trailing=o,i._hasValue=!1,i}return r.__extends(e,t),e.prototype._next=function(t){this._hasValue=!0,this._sendValue=t,this._throttled||(this._leading?this.send():this.throttle(t))},e.prototype.send=function(){var t=this._hasValue,e=this._sendValue;t&&(this.destination.next(e),this.throttle(e)),this._hasValue=!1,this._sendValue=null},e.prototype.throttle=function(t){var e=this.tryDurationSelector(t);e&&this.add(this._throttled=z(this,e))},e.prototype.tryDurationSelector=function(t){try{return this.durationSelector(t)}catch(t){return this.destination.error(t),null}},e.prototype.throttlingDone=function(){var t=this._throttled,e=this._trailing;t&&t.unsubscribe(),this._throttled=null,e&&this.send()},e.prototype.notifyNext=function(t,e,n,r,o){this.throttlingDone()},e.prototype.notifyComplete=function(){this.throttlingDone()},e}(y);function $o(t,e,n){return void 0===e&&(e=$),void 0===n&&(n=Fo),function(r){return r.lift(new Wo(t,e,n.leading,n.trailing))}}var Wo=function(){function t(t,e,n,r){this.duration=t,this.scheduler=e,this.leading=n,this.trailing=r}return t.prototype.call=function(t,e){return e.subscribe(new Ho(t,this.duration,this.scheduler,this.leading,this.trailing))},t}(),Ho=function(t){function e(e,n,r,o,i){var s=t.call(this,e)||this;return s.duration=n,s.scheduler=r,s.leading=o,s.trailing=i,s._hasTrailingValue=!1,s._trailingValue=null,s}return r.__extends(e,t),e.prototype._next=function(t){this.throttled?this.trailing&&(this._trailingValue=t,this._hasTrailingValue=!0):(this.add(this.throttled=this.scheduler.schedule(qo,this.duration,{subscriber:this})),this.leading&&this.destination.next(t))},e.prototype._complete=function(){this._hasTrailingValue?(this.destination.next(this._trailingValue),this.destination.complete()):this.destination.complete()},e.prototype.clearThrottle=function(){var t=this.throttled;t&&(this.trailing&&this._hasTrailingValue&&(this.destination.next(this._trailingValue),this._trailingValue=null,this._hasTrailingValue=!1),t.unsubscribe(),this.remove(t),this.throttled=null)},e}(v);function qo(t){t.subscriber.clearThrottle()}function Jo(t){return void 0===t&&(t=$),function(e){return n=function(){return e.pipe(zn((function(e,n){var r=e.current;return{value:n,current:t.now(),last:r}}),{current:t.now(),value:void 0,last:void 0}),Et((function(t){var e=t.current,n=t.last,r=t.value;return new Ko(r,e-n)})))},new C((function(t){var e;try{e=n()}catch(e){return void t.error(e)}return(e?_t(e):Ct()).subscribe(t)}));var n}}var Ko=function(){return function(t,e){this.value=t,this.interval=e}}();function Uo(){return Error.call(this),this.message="Timeout has occurred",this.name="TimeoutError",this}Uo.prototype=Object.create(Error.prototype);var Go=Uo;function Yo(t,e,n){return void 0===n&&(n=$),function(r){var o=te(t),i=o?+t-n.now():Math.abs(t);return r.lift(new Xo(i,o,e,n))}}var Xo=function(){function t(t,e,n,r){this.waitFor=t,this.absoluteTimeout=e,this.withObservable=n,this.scheduler=r}return t.prototype.call=function(t,e){return e.subscribe(new Zo(t,this.absoluteTimeout,this.waitFor,this.withObservable,this.scheduler))},t}(),Zo=function(t){function e(e,n,r,o,i){var s=t.call(this,e)||this;return s.absoluteTimeout=n,s.waitFor=r,s.withObservable=o,s.scheduler=i,s.action=null,s.scheduleTimeout(),s}return r.__extends(e,t),e.dispatchTimeout=function(t){var e=t.withObservable;t._unsubscribeAndRecycle(),t.add(z(t,e))},e.prototype.scheduleTimeout=function(){var t=this.action;t?this.action=t.schedule(this,this.waitFor):this.add(this.action=this.scheduler.schedule(e.dispatchTimeout,this.waitFor,this))},e.prototype._next=function(e){this.absoluteTimeout||this.scheduleTimeout(),t.prototype._next.call(this,e)},e.prototype._unsubscribe=function(){this.action=null,this.scheduler=null,this.withObservable=null},e}(y);function Qo(t,e){return void 0===e&&(e=$),Yo(t,ee(new Go),e)}function ti(t){return void 0===t&&(t=$),Et((function(e){return new ei(e,t.now())}))}var ei=function(){return function(t,e){this.value=t,this.timestamp=e}}();function ni(t,e,n){return 0===n?[e]:(t.push(e),t)}function ri(){return Fn(ni,[])}function oi(t){return function(e){return e.lift(new ii(t))}}var ii=function(){function t(t){this.windowBoundaries=t}return t.prototype.call=function(t,e){var n=new si(t),r=e.subscribe(n);return r.closed||n.add(z(n,this.windowBoundaries)),r},t}(),si=function(t){function e(e){var n=t.call(this,e)||this;return n.window=new dn,e.next(n.window),n}return r.__extends(e,t),e.prototype.notifyNext=function(t,e,n,r,o){this.openWindow()},e.prototype.notifyError=function(t,e){this._error(t)},e.prototype.notifyComplete=function(t){this._complete()},e.prototype._next=function(t){this.window.next(t)},e.prototype._error=function(t){this.window.error(t),this.destination.error(t)},e.prototype._complete=function(){this.window.complete(),this.destination.complete()},e.prototype._unsubscribe=function(){this.window=null},e.prototype.openWindow=function(){var t=this.window;t&&t.complete();var e=this.destination,n=this.window=new dn;e.next(n)},e}(y);function ai(t,e){return void 0===e&&(e=0),function(n){return n.lift(new ci(t,e))}}var ci=function(){function t(t,e){this.windowSize=t,this.startWindowEvery=e}return t.prototype.call=function(t,e){return e.subscribe(new ui(t,this.windowSize,this.startWindowEvery))},t}(),ui=function(t){function e(e,n,r){var o=t.call(this,e)||this;return o.destination=e,o.windowSize=n,o.startWindowEvery=r,o.windows=[new dn],o.count=0,e.next(o.windows[0]),o}return r.__extends(e,t),e.prototype._next=function(t){for(var e=this.startWindowEvery>0?this.startWindowEvery:this.windowSize,n=this.destination,r=this.windowSize,o=this.windows,i=o.length,s=0;s<i&&!this.closed;s++)o[s].next(t);var a=this.count-r+1;if(a>=0&&a%e==0&&!this.closed&&o.shift().complete(),++this.count%e==0&&!this.closed){var c=new dn;o.push(c),n.next(c)}},e.prototype._error=function(t){var e=this.windows;if(e)for(;e.length>0&&!this.closed;)e.shift().error(t);this.destination.error(t)},e.prototype._complete=function(){var t=this.windows;if(t)for(;t.length>0&&!this.closed;)t.shift().complete();this.destination.complete()},e.prototype._unsubscribe=function(){this.count=0,this.windows=null},e}(v);function li(t){var e=$,n=null,r=Number.POSITIVE_INFINITY;return H(arguments[3])&&(e=arguments[3]),H(arguments[2])?e=arguments[2]:W(arguments[2])&&(r=arguments[2]),H(arguments[1])?e=arguments[1]:W(arguments[1])&&(n=arguments[1]),function(o){return o.lift(new di(t,n,r,e))}}var di=function(){function t(t,e,n,r){this.windowTimeSpan=t,this.windowCreationInterval=e,this.maxWindowSize=n,this.scheduler=r}return t.prototype.call=function(t,e){return e.subscribe(new fi(t,this.windowTimeSpan,this.windowCreationInterval,this.maxWindowSize,this.scheduler))},t}(),pi=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._numberOfNextedValues=0,e}return r.__extends(e,t),e.prototype.next=function(e){this._numberOfNextedValues++,t.prototype.next.call(this,e)},Object.defineProperty(e.prototype,"numberOfNextedValues",{get:function(){return this._numberOfNextedValues},enumerable:!0,configurable:!0}),e}(dn),fi=function(t){function e(e,n,r,o,i){var s=t.call(this,e)||this;s.destination=e,s.windowTimeSpan=n,s.windowCreationInterval=r,s.maxWindowSize=o,s.scheduler=i,s.windows=[];var a=s.openWindow();if(null!==r&&r>=0){var c={subscriber:s,window:a,context:null},u={windowTimeSpan:n,windowCreationInterval:r,subscriber:s,scheduler:i};s.add(i.schedule(vi,n,c)),s.add(i.schedule(mi,r,u))}else{var l={subscriber:s,window:a,windowTimeSpan:n};s.add(i.schedule(hi,n,l))}return s}return r.__extends(e,t),e.prototype._next=function(t){for(var e=this.windows,n=e.length,r=0;r<n;r++){var o=e[r];o.closed||(o.next(t),o.numberOfNextedValues>=this.maxWindowSize&&this.closeWindow(o))}},e.prototype._error=function(t){for(var e=this.windows;e.length>0;)e.shift().error(t);this.destination.error(t)},e.prototype._complete=function(){for(var t=this.windows;t.length>0;){var e=t.shift();e.closed||e.complete()}this.destination.complete()},e.prototype.openWindow=function(){var t=new pi;return this.windows.push(t),this.destination.next(t),t},e.prototype.closeWindow=function(t){t.complete();var e=this.windows;e.splice(e.indexOf(t),1)},e}(v);function hi(t){var e=t.subscriber,n=t.windowTimeSpan,r=t.window;r&&e.closeWindow(r),t.window=e.openWindow(),this.schedule(t,n)}function mi(t){var e=t.windowTimeSpan,n=t.subscriber,r=t.scheduler,o=t.windowCreationInterval,i=n.openWindow(),s={action:this,subscription:null},a={subscriber:n,window:i,context:s};s.subscription=r.schedule(vi,e,a),this.add(s.subscription),this.schedule(t,o)}function vi(t){var e=t.subscriber,n=t.window,r=t.context;r&&r.action&&r.subscription&&r.action.remove(r.subscription),e.closeWindow(n)}function gi(t,e){return function(n){return n.lift(new yi(t,e))}}var yi=function(){function t(t,e){this.openings=t,this.closingSelector=e}return t.prototype.call=function(t,e){return e.subscribe(new bi(t,this.openings,this.closingSelector))},t}(),bi=function(t){function e(e,n,r){var o=t.call(this,e)||this;return o.openings=n,o.closingSelector=r,o.contexts=[],o.add(o.openSubscription=z(o,n,n)),o}return r.__extends(e,t),e.prototype._next=function(t){var e=this.contexts;if(e)for(var n=e.length,r=0;r<n;r++)e[r].window.next(t)},e.prototype._error=function(e){var n=this.contexts;if(this.contexts=null,n)for(var r=n.length,o=-1;++o<r;){var i=n[o];i.window.error(e),i.subscription.unsubscribe()}t.prototype._error.call(this,e)},e.prototype._complete=function(){var e=this.contexts;if(this.contexts=null,e)for(var n=e.length,r=-1;++r<n;){var o=e[r];o.window.complete(),o.subscription.unsubscribe()}t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){var t=this.contexts;if(this.contexts=null,t)for(var e=t.length,n=-1;++n<e;){var r=t[n];r.window.unsubscribe(),r.subscription.unsubscribe()}},e.prototype.notifyNext=function(t,e,n,r,o){if(t===this.openings){var i=void 0;try{i=(0,this.closingSelector)(e)}catch(t){return this.error(t)}var s=new dn,a=new f,c={window:s,subscription:a};this.contexts.push(c);var u=z(this,i,c);u.closed?this.closeWindow(this.contexts.length-1):(u.context=c,a.add(u)),this.destination.next(s)}else this.closeWindow(this.contexts.indexOf(t))},e.prototype.notifyError=function(t){this.error(t)},e.prototype.notifyComplete=function(t){t!==this.openSubscription&&this.closeWindow(this.contexts.indexOf(t.context))},e.prototype.closeWindow=function(t){if(-1!==t){var e=this.contexts,n=e[t],r=n.window,o=n.subscription;e.splice(t,1),r.complete(),o.unsubscribe()}},e}(y);function wi(t){return function(e){return e.lift(new _i(t))}}var _i=function(){function t(t){this.closingSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new xi(t,this.closingSelector))},t}(),xi=function(t){function e(e,n){var r=t.call(this,e)||this;return r.destination=e,r.closingSelector=n,r.openWindow(),r}return r.__extends(e,t),e.prototype.notifyNext=function(t,e,n,r,o){this.openWindow(o)},e.prototype.notifyError=function(t,e){this._error(t)},e.prototype.notifyComplete=function(t){this.openWindow(t)},e.prototype._next=function(t){this.window.next(t)},e.prototype._error=function(t){this.window.error(t),this.destination.error(t),this.unsubscribeClosingNotification()},e.prototype._complete=function(){this.window.complete(),this.destination.complete(),this.unsubscribeClosingNotification()},e.prototype.unsubscribeClosingNotification=function(){this.closingNotification&&this.closingNotification.unsubscribe()},e.prototype.openWindow=function(t){void 0===t&&(t=null),t&&(this.remove(t),t.unsubscribe());var e=this.window;e&&e.complete();var n,r=this.window=new dn;this.destination.next(r);try{n=(0,this.closingSelector)()}catch(t){return this.destination.error(t),void this.window.error(t)}this.add(this.closingNotification=z(this,n))},e}(y);function ki(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){var n;"function"==typeof t[t.length-1]&&(n=t.pop());var r=t;return e.lift(new Ci(r,n))}}var Ci=function(){function t(t,e){this.observables=t,this.project=e}return t.prototype.call=function(t,e){return e.subscribe(new Si(t,this.observables,this.project))},t}(),Si=function(t){function e(e,n,r){var o=t.call(this,e)||this;o.observables=n,o.project=r,o.toRespond=[];var i=n.length;o.values=new Array(i);for(var s=0;s<i;s++)o.toRespond.push(s);for(s=0;s<i;s++){var a=n[s];o.add(z(o,a,a,s))}return o}return r.__extends(e,t),e.prototype.notifyNext=function(t,e,n,r,o){this.values[n]=e;var i=this.toRespond;if(i.length>0){var s=i.indexOf(n);-1!==s&&i.splice(s,1)}},e.prototype.notifyComplete=function(){},e.prototype._next=function(t){if(0===this.toRespond.length){var e=[t].concat(this.values);this.project?this._tryProject(e):this.destination.next(e)}},e.prototype._tryProject=function(t){var e;try{e=this.project.apply(this,t)}catch(t){return void this.destination.error(t)}this.destination.next(e)},e}(y);function Ti(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t[t.length-1];return"function"==typeof n&&t.pop(),vt(t,void 0).lift(new Ei(n))}var Ei=function(){function t(t){this.resultSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new Mi(t,this.resultSelector))},t}(),Mi=function(t){function e(e,n,r){void 0===r&&(r=Object.create(null));var o=t.call(this,e)||this;return o.iterators=[],o.active=0,o.resultSelector="function"==typeof n?n:null,o.values=r,o}return r.__extends(e,t),e.prototype._next=function(t){var e=this.iterators;u(t)?e.push(new Di(t)):"function"==typeof t[O]?e.push(new Oi(t[O]())):e.push(new Ii(this.destination,this,t))},e.prototype._complete=function(){var t=this.iterators,e=t.length;if(this.unsubscribe(),0!==e){this.active=e;for(var n=0;n<e;n++){var r=t[n];if(r.stillUnsubscribed)this.destination.add(r.subscribe(r,n));else this.active--}}else this.destination.complete()},e.prototype.notifyInactive=function(){this.active--,0===this.active&&this.destination.complete()},e.prototype.checkIterators=function(){for(var t=this.iterators,e=t.length,n=this.destination,r=0;r<e;r++){if("function"==typeof(s=t[r]).hasValue&&!s.hasValue())return}var o=!1,i=[];for(r=0;r<e;r++){var s,a=(s=t[r]).next();if(s.hasCompleted()&&(o=!0),a.done)return void n.complete();i.push(a.value)}this.resultSelector?this._tryresultSelector(i):n.next(i),o&&n.complete()},e.prototype._tryresultSelector=function(t){var e;try{e=this.resultSelector.apply(this,t)}catch(t){return void this.destination.error(t)}this.destination.next(e)},e}(v),Oi=function(){function t(t){this.iterator=t,this.nextResult=t.next()}return t.prototype.hasValue=function(){return!0},t.prototype.next=function(){var t=this.nextResult;return this.nextResult=this.iterator.next(),t},t.prototype.hasCompleted=function(){var t=this.nextResult;return t&&t.done},t}(),Di=function(){function t(t){this.array=t,this.index=0,this.length=0,this.length=t.length}return t.prototype[O]=function(){return this},t.prototype.next=function(t){var e=this.index++,n=this.array;return e<this.length?{value:n[e],done:!1}:{value:null,done:!0}},t.prototype.hasValue=function(){return this.array.length>this.index},t.prototype.hasCompleted=function(){return this.array.length===this.index},t}(),Ii=function(t){function e(e,n,r){var o=t.call(this,e)||this;return o.parent=n,o.observable=r,o.stillUnsubscribed=!0,o.buffer=[],o.isComplete=!1,o}return r.__extends(e,t),e.prototype[O]=function(){return this},e.prototype.next=function(){var t=this.buffer;return 0===t.length&&this.isComplete?{value:null,done:!0}:{value:t.shift(),done:!1}},e.prototype.hasValue=function(){return this.buffer.length>0},e.prototype.hasCompleted=function(){return 0===this.buffer.length&&this.isComplete},e.prototype.notifyComplete=function(){this.buffer.length>0?(this.isComplete=!0,this.parent.notifyInactive()):this.destination.complete()},e.prototype.notifyNext=function(t,e,n,r,o){this.buffer.push(e),this.parent.checkIterators()},e.prototype.subscribe=function(t,e){return z(this,this.observable,this,e)},e}(y);function Ai(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return e.lift.call(Ti.apply(void 0,[e].concat(t)))}}function Ni(t){return function(e){return e.lift(new Ei(t))}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(39),o=n(8);e.Schema=o.Schema;var i=o.marks,s=Object.assign(o.nodes,r.semanticNodes);e.schema=new o.Schema({marks:i,nodes:s})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(7),s=n(2),a=function(t){function e(e,n){var r=t.call(this,e)||this;return r.dialog=e,r.localization=n,r.data="",r}return r.__extends(e,t),e.prototype.ngAfterViewInit=function(){var t=this;Promise.resolve(null).then((function(){t.textarea.nativeElement.focus()}))},e.prototype.onCancelAction=function(){this.dialog.close()},e.prototype.onConfirmAction=function(){this.editor.exec("setHTML",this.getData()),this.dialog.close(),this.editor.view.focus()},e.prototype.getData=function(){return this.textarea.nativeElement.value},e.prototype.setData=function(){this.data=this.indent(this.editor.getSource())},e.prototype.textFor=function(t){return this.localization.get(t)},e.prototype.indent=function(t){return t.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$/,"")},r.__decorate([o.Input(),r.__metadata("design:type",Object)],e.prototype,"editor",void 0),r.__decorate([o.ViewChild("textarea",{static:!0}),r.__metadata("design:type",o.ElementRef)],e.prototype,"textarea",void 0),e=r.__decorate([o.Component({styles:["\n >>> .k-editor-textarea {\n height: 100%;\n }\n "],template:'\n <kendo-dialog-titlebar (close)="onCancelAction()">\n {{ textFor(\'viewSource\') }}\n </kendo-dialog-titlebar>\n <textarea [value]="data" #textarea class="k-textarea k-editor-textarea"></textarea>\n <kendo-dialog-actions>\n <button kendoButton (click)="onCancelAction()">{{ textFor(\'dialogCancel\') }}</button>\n <button kendoButton (click)="onConfirmAction()" [primary]="true">{{ textFor(\'dialogUpdate\') }}</button>\n </kendo-dialog-actions>\n '}),r.__metadata("design:paramtypes",[i.DialogRef,s.EditorLocalizationService])],e)}(i.DialogContentBase);e.SourceDialogComponent=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(12),s=n(7),a=n(8),c=n(9),u=n(2),l=n(10),d=function(t){function e(e,n){var r=t.call(this,e)||this;return r.dialog=e,r.localization=n,r.src=new i.FormControl("",i.Validators.required),r.alt=new i.FormControl(""),r.width=new i.FormControl("",i.Validators.min(1)),r.height=new i.FormControl("",i.Validators.min(1)),r.data={alt:"",height:"",src:"",width:""},r.imageData=new i.FormGroup({alt:r.alt,height:r.height,src:r.src,width:r.width}),r}return r.__extends(e,t),e.prototype.ngOnInit=function(){this.srcInputId="k-"+l.guid(),this.altTextInputId="k-"+l.guid(),this.widthInputId="k-"+l.guid(),this.heightInputId="k-"+l.guid()},e.prototype.ngAfterViewInit=function(){var t=this;Promise.resolve(null).then((function(){t.srcInput.nativeElement.focus()}))},e.prototype.onCancelAction=function(){this.dialog.close()},e.prototype.onConfirmAction=function(){this.src.value&&(this.editor.exec("insertImage",this.getData()),this.dialog.close(),this.editor.view.focus())},e.prototype.setData=function(t){var e=a.getNodeFromSelection(t);e&&(this.src.patchValue(e.attrs.src),this.alt.patchValue(e.attrs.alt),this.width.patchValue(e.attrs.width),this.height.patchValue(e.attrs.height))},e.prototype.textFor=function(t){return this.localization.get(t)},e.prototype.getData=function(){return{alt:this.alt.value,height:this.normalizeDimension(this.height.value),src:this.src.value,width:this.normalizeDimension(this.width.value)}},e.prototype.normalizeDimension=function(t){return Number.isNaN(parseInt(t,10))||parseInt(t,10)<=0?"":c.safeString(parseInt(t,10))},r.__decorate([o.Input(),r.__metadata("design:type",Object)],e.prototype,"editor",void 0),r.__decorate([o.ViewChild("srcInput",{read:o.ElementRef,static:!0}),r.__metadata("design:type",o.ElementRef)],e.prototype,"srcInput",void 0),e=r.__decorate([o.Component({template:'\n <kendo-dialog-titlebar (close)="onCancelAction()">\n {{ textFor(\'insertImage\') }}\n </kendo-dialog-titlebar>\n <div class="k-editor-dialog">\n <div class="k-editor-dialog k-popup-edit-form k-window-content k-content">\n <div class="k-edit-form-container k-window-content">\n <div class="k-edit-label">\n <label [for]="srcInputId">{{ textFor(\'imageWebAddress\') }}</label>\n </div>\n <div class="k-edit-field">\n <input [id]="srcInputId" #srcInput [formControl]="src" type="text" class="k-textbox k-input k-rounded-md" />\n </div>\n <div class="k-edit-label">\n <label [for]="altTextInputId">{{ textFor(\'imageAltText\') }}</label>\n </div>\n <div class="k-edit-field">\n <input [id]="altTextInputId" [formControl]="alt" type="text" class="k-textbox k-input k-rounded-md" />\n </div>\n <div class="k-edit-label">\n <label [for]="widthInputId">{{ textFor(\'imageWidth\') }}</label>\n </div>\n <div class="k-edit-field">\n <input [id]="widthInputId" [formControl]="width" type="text" class="k-textbox k-input k-rounded-md" />\n </div>\n <div class="k-edit-label">\n <label [for]="heightInputId">{{ textFor(\'imageHeight\') }}</label>\n </div>\n <div class="k-edit-field">\n <input [id]="heightInputId" [formControl]="height" type="text" class="k-textbox k-input k-rounded-md" />\n </div>\n </div>\n </div>\n </div>\n <kendo-dialog-actions>\n <button kendoButton (click)="onCancelAction()">{{ textFor(\'dialogCancel\') }}</button>\n <button kendoButton [disabled]="imageData.invalid"\n (click)="onConfirmAction()" [primary]="true">{{ textFor(\'dialogInsert\') }}</button>\n </kendo-dialog-actions>\n '}),r.__metadata("design:paramtypes",[s.DialogRef,u.EditorLocalizationService])],e)}(s.DialogContentBase);e.ImageDialogComponent=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(12),s=n(7),a=n(8),c=n(9),u=n(2),l=function(t){function e(e,n){var r=t.call(this,e)||this;return r.dialog=e,r.localization=n,r.linkForm=new i.FormGroup({href:new i.FormControl("",i.Validators.required),text:new i.FormControl({value:"",disabled:!0},i.Validators.required),title:new i.FormControl("")}),r}return r.__extends(e,t),e.prototype.ngAfterViewInit=function(){var t=this;Promise.resolve(null).then((function(){t.hrefInput.nativeElement.focus()}))},e.prototype.onCancelAction=function(){this.dialog.close()},e.prototype.onConfirmAction=function(){var t=this.getData();this.editor.exec(this.command,t),this.dialog.close(),this.editor.view.focus()},Object.defineProperty(e.prototype,"titleText",{get:function(){return this.localization.get(this.command)},enumerable:!0,configurable:!0}),e.prototype.setData=function(t,e){"createLink"===this.command&&this.linkForm.addControl("target",new i.FormControl);var n=a.getMark(t,t.schema.marks.link);if(n)this.linkForm.reset({href:n.attrs.href,title:n.attrs.title,target:c.isPresent(n.attrs.target),text:this.setLinkText(t)});else if(t.selection.empty){var r=e.applyToWord?a.expandSelection(t,(function(){}),e).state:t;r.selection.empty||this.linkForm.patchValue({text:a.getSelectionText(r)})}else this.linkForm.patchValue({text:a.getSelectionText(t)})},e.prototype.textForWithPrefix=function(t){var e="createLink"===this.command?"link":"file";return this.textFor(e+t)},e.prototype.textFor=function(t){return this.localization.get(t)},e.prototype.setLinkText=function(t){var e=t.selection;if(e.empty&&e.$cursor){var n=e.$cursor,r=n.index();return n.parent.child(r).text}return a.getSelectionText(t)},e.prototype.getData=function(){var t=this.linkForm.value;return c.isPresent(this.linkForm.controls.target)&&(t.target=t.target?"_blank":null),t},r.__decorate([o.Input(),r.__metadata("design:type",Object)],e.prototype,"editor",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"command",void 0),r.__decorate([o.ViewChild("hrefInput",{read:o.ElementRef,static:!0}),r.__metadata("design:type",o.ElementRef)],e.prototype,"hrefInput",void 0),e=r.__decorate([o.Component({template:'\n <kendo-dialog-titlebar (close)="onCancelAction()">\n {{ titleText }}\n </kendo-dialog-titlebar>\n <div class="k-editor-dialog">\n <div class="k-editor-dialog k-popup-edit-form k-window-content k-content">\n <div class="k-edit-form-container k-window-content">\n <form novalidate [formGroup]="linkForm">\n <div class="k-edit-label">\n <label (click)="hrefInput.focus()">{{ textForWithPrefix(\'WebAddress\') }}</label>\n </div>\n <div class="k-edit-field">\n <input #hrefInput formControlName="href" type="text" class="k-textbox k-input k-rounded-md" />\n </div>\n\n <div class="k-edit-label">\n <label (click)="textInput.focus()">{{ textForWithPrefix(\'Text\') }}</label>\n </div>\n <div class="k-edit-field">\n <input #textInput formControlName="text" type="text" class="k-textbox k-input k-rounded-md" />\n </div>\n\n <div class="k-edit-label">\n <label (click)="titleInput.focus()">{{ textForWithPrefix(\'Title\') }}</label>\n </div>\n <div class="k-edit-field">\n <input #titleInput formControlName="title" type="text" class="k-textbox k-input k-rounded-md" />\n </div>\n <ng-container *ngIf="command === \'createLink\'">\n <div class="k-edit-label"></div>\n <div class="k-edit-field">\n <input type="checkbox" id="k-target-blank" kendoCheckBox formControlName="target" />\n <label class="k-checkbox-label" for="k-target-blank">{{ textForWithPrefix(\'OpenInNewWindow\') }}</label>\n </div>\n </ng-container>\n </form>\n </div>\n </div>\n </div>\n <kendo-dialog-actions>\n <button kendoButton (click)="onCancelAction()">{{ textFor(\'dialogCancel\') }}</button>\n <button kendoButton [disabled]="linkForm.invalid" (click)="onConfirmAction()" [primary]="true">\n {{ textFor(\'dialogInsert\') }}\n </button>\n </kendo-dialog-actions>\n '}),r.__metadata("design:paramtypes",[s.DialogRef,u.EditorLocalizationService])],e)}(s.DialogContentBase);e.FileLinkDialogComponent=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.EditorErrorMessages={schemaType:"Expected value of type Schema. See http://www.telerik.com/kendo-angular-ui/components/editor/schema/",setSchemaOnce:"The Schema cannot be changed dynamically. See http://www.telerik.com/kendo-angular-ui/components/editor/schema/",pluginsCallbackType:function(t){return"plugins must be a function, but received "+JSON.stringify(t)+"."},pastedContentCallbackType:function(t){return"pastedContent must be a function, but received "+JSON.stringify(t)+"."},setPluginsOnce:"The plugins cannot be changed dynamically. See http://www.telerik.com/kendo-angular-ui/components/editor/plugins/",setPlaceHolderOnce:"The placeholder cannot be changed dynamically. See https://www.telerik.com/kendo-angular-ui/components/editor/plugins/#toc-custom-plugins/",printTool:"The Print tool and functionality are supported only in iframe mode. See https://www.telerik.com/kendo-angular-ui-develop/components/editor/api/EditorPrintButtonDirective/"}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=function(t){function e(e,n,r){var o=t.call(this)||this;return o.cleanedHtml=e,o.originalHtml=n,o.originalEvent=r,o}return r.__extends(e,t),e}(n(10).PreventableEvent);e.EditorPasteEvent=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(7),s=n(2),a=n(3),c=n(17),u=function(t){function e(e,n){var r=t.call(this,e)||this;return r.dialog=e,r.localization=n,r.data=[],r}return r.__extends(e,t),e.prototype.ngAfterViewInit=function(){var t=this;Promise.resolve(null).then((function(){t.formatDropDownList.dropDownList.focus()}))},e.prototype.onCancelAction=function(){this.dialog.close()},e.prototype.onConfirmAction=function(){this.value&&this.editor.exec("format",{tag:this.value}),this.dialog.close()},e.prototype.setData=function(t){this.editor=t.editor,this.data=t.data,this.defaultItem=t.defaultItem,this.value=t.value,this.itemDisabled=t.itemDisabled},e.prototype.textFor=function(t){return this.localization.get(t)},r.__decorate([o.Input(),r.__metadata("design:type",a.EditorComponent)],e.prototype,"editor",void 0),r.__decorate([o.ViewChild("formatDropDownList",{read:c.FormatDropDownListComponent,static:!0}),r.__metadata("design:type",c.FormatDropDownListComponent)],e.prototype,"formatDropDownList",void 0),e=r.__decorate([o.Component({template:'\n <kendo-dialog-titlebar (close)="onCancelAction()">\n {{ textFor(\'format\') }}\n </kendo-dialog-titlebar>\n <div class="k-editor-dialog">\n <div class="k-editor-dialog k-popup-edit-form k-window-content k-content">\n <div class="k-edit-form-container k-window-content" style="text-align: center;">\n <kendo-editor-format-dropdownlist\n #formatDropDownList\n [defaultItem]="defaultItem"\n [data]="data"\n [(value)]="value"\n [itemDisabled]="itemDisabled"\n >\n </kendo-editor-format-dropdownlist>\n </div>\n </div>\n </div>\n <kendo-dialog-actions>\n <button kendoButton (click)="onCancelAction()">{{ textFor(\'dialogCancel\') }}</button>\n <button kendoButton\n (click)="onConfirmAction()" [primary]="true">{{ textFor(\'dialogApply\') }}</button>\n </kendo-dialog-actions>\n '}),r.__metadata("design:paramtypes",[i.DialogRef,s.EditorLocalizationService])],e)}(i.DialogContentBase);e.FormatDialogComponent=u},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(7),s=n(2),a=n(3),c=n(16),u=function(t){function e(e,n){var r=t.call(this,e)||this;return r.dialog=e,r.localization=n,r}return r.__extends(e,t),e.prototype.ngAfterViewInit=function(){var t=this;Promise.resolve(null).then((function(){t.colorPicker.focus()}))},e.prototype.handleActiveColorClick=function(t){t.preventOpen(),this.value=t.color},e.prototype.onCancelAction=function(){this.dialog.close()},e.prototype.onConfirmAction=function(){this.value&&this.editor.exec(this.editorCommand,this.value),this.dialog.close(),this.editor.view.focus()},e.prototype.setData=function(t){this.editor=t.editor,this.value=t.value,this.editorCommand=t.editorCommand,this.paletteSettings=t.paletteSettings,this.icon=t.icon,this.views=t.view?[t.view]:t.views},e.prototype.textFor=function(t){return this.localization.get(t)},r.__decorate([o.Input(),r.__metadata("design:type",a.EditorComponent)],e.prototype,"editor",void 0),r.__decorate([o.ViewChild("colorpicker",{read:c.ColorPickerComponent,static:!0}),r.__metadata("design:type",c.ColorPickerComponent)],e.prototype,"colorPicker",void 0),e=r.__decorate([o.Component({template:'\n <kendo-dialog-titlebar (close)="onCancelAction()">\n {{ textFor(editorCommand) }}\n </kendo-dialog-titlebar>\n <div class="k-editor-dialog">\n <div class="k-editor-dialog k-popup-edit-form k-window-content k-content">\n <div class="k-edit-form-container k-window-content" style="text-align: center;">\n <kendo-colorpicker\n #colorpicker\n [views]="views"\n [format]="\'hex\'"\n [attr.title]="title"\n [icon]="icon"\n [(value)]="value"\n [paletteSettings]="paletteSettings"\n (activeColorClick)="handleActiveColorClick($event)"\n >\n </kendo-colorpicker>\n </div>\n </div>\n </div>\n <kendo-dialog-actions>\n <button kendoButton (click)="onCancelAction()">{{ textFor(\'dialogCancel\') }}</button>\n <button kendoButton\n (click)="onConfirmAction()" [primary]="true">{{ textFor(\'dialogApply\') }}</button>\n </kendo-dialog-actions>\n '}),r.__metadata("design:paramtypes",[i.DialogRef,s.EditorLocalizationService])],e)}(i.DialogContentBase);e.ColorPickerDialogComponent=u},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(7),s=n(2),a=n(3),c=n(18),u=function(t){function e(e,n){var r=t.call(this,e)||this;return r.dialog=e,r.localization=n,r.data=[],r}return r.__extends(e,t),e.prototype.ngAfterViewInit=function(){var t=this;Promise.resolve(null).then((function(){t.fontFamilyDropDownList.dropDownList.focus()}))},e.prototype.onCancelAction=function(){this.dialog.close()},e.prototype.onConfirmAction=function(){this.value&&this.editor.exec("fontFamily",this.value),this.dialog.close()},e.prototype.setData=function(t){this.editor=t.editor,this.data=t.data,this.defaultItem=t.defaultItem,this.value=t.value,this.itemDisabled=t.itemDisabled},e.prototype.textFor=function(t){return this.localization.get(t)},r.__decorate([o.Input(),r.__metadata("design:type",a.EditorComponent)],e.prototype,"editor",void 0),r.__decorate([o.ViewChild("fontFamilyDropDownList",{read:c.FontFamilyDropDownListComponent,static:!0}),r.__metadata("design:type",c.FontFamilyDropDownListComponent)],e.prototype,"fontFamilyDropDownList",void 0),e=r.__decorate([o.Component({template:'\n <kendo-dialog-titlebar (close)="onCancelAction()">\n {{ textFor(\'fontFamily\') }}\n </kendo-dialog-titlebar>\n <div class="k-editor-dialog">\n <div class="k-editor-dialog k-popup-edit-form k-window-content k-content">\n <div class="k-edit-form-container k-window-content" style="text-align: center;">\n <kendo-editor-fontfamily-dropdownlist\n #fontFamilyDropDownList\n [defaultItem]="defaultItem"\n [data]="data"\n [(value)]="value"\n [itemDisabled]="itemDisabled"\n >\n </kendo-editor-fontfamily-dropdownlist>\n </div>\n </div>\n </div>\n <kendo-dialog-actions>\n <button kendoButton (click)="onCancelAction()">{{ textFor(\'dialogCancel\') }}</button>\n <button kendoButton\n (click)="onConfirmAction()" [primary]="true">{{ textFor(\'dialogApply\') }}</button>\n </kendo-dialog-actions>\n '}),r.__metadata("design:paramtypes",[i.DialogRef,s.EditorLocalizationService])],e)}(i.DialogContentBase);e.FontFamilyDialogComponent=u},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(7),s=n(2),a=n(3),c=function(t){function e(e,n){var r=t.call(this,e)||this;return r.dialog=e,r.localization=n,r}return r.__extends(e,t),e.prototype.onCancelAction=function(){this.dialog.close(),this.editor.view.focus()},e.prototype.onCellClick=function(t){this.dialog.close(),this.editor.exec("insertTable",t),this.editor.view.focus()},e.prototype.setData=function(t){this.editor=t.editor},e.prototype.textFor=function(t){return this.localization.get(t)},r.__decorate([o.Input(),r.__metadata("design:type",a.EditorComponent)],e.prototype,"editor",void 0),e=r.__decorate([o.Component({template:'\n <kendo-dialog-titlebar (close)="onCancelAction()">\n {{ textFor(\'insertTable\') }}\n </kendo-dialog-titlebar>\n <div class="k-editor-dialog">\n <div class="k-editor-dialog k-popup-edit-form k-window-content k-content">\n <div class="k-ct-popup k-window-content" style="text-align: center;">\n <kendo-popup-table-grid (cellClick)="onCellClick($event)"></kendo-popup-table-grid>\n </div>\n </div>\n </div>\n <kendo-dialog-actions>\n <button kendoButton (click)="onCancelAction()">{{ textFor(\'dialogCancel\') }}</button>\n </kendo-dialog-actions>\n '}),r.__metadata("design:paramtypes",[i.DialogRef,s.EditorLocalizationService])],e)}(i.DialogContentBase);e.InsertTableDialogComponent=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(7),s=n(2),a=n(3),c=n(19),u=function(t){function e(e,n){var r=t.call(this,e)||this;return r.dialog=e,r.localization=n,r.data=[],r}return r.__extends(e,t),e.prototype.ngAfterViewInit=function(){var t=this;Promise.resolve(null).then((function(){t.fontSizeDropDownList.dropDownList.focus()}))},e.prototype.onCancelAction=function(){this.dialog.close()},e.prototype.onConfirmAction=function(){this.value&&this.editor.exec("fontSize",this.value),this.dialog.close()},e.prototype.setData=function(t){this.editor=t.editor,this.data=t.data,this.defaultItem=t.defaultItem,this.value=t.value,this.itemDisabled=t.itemDisabled},e.prototype.textFor=function(t){return this.localization.get(t)},r.__decorate([o.Input(),r.__metadata("design:type",a.EditorComponent)],e.prototype,"editor",void 0),r.__decorate([o.ViewChild("fontSizeDropDownList",{read:c.FontSizeDropDownListComponent,static:!0}),r.__metadata("design:type",c.FontSizeDropDownListComponent)],e.prototype,"fontSizeDropDownList",void 0),e=r.__decorate([o.Component({template:'\n <kendo-dialog-titlebar (close)="onCancelAction()">\n {{ textFor(\'fontSize\') }}\n </kendo-dialog-titlebar>\n <div class="k-editor-dialog">\n <div class="k-editor-dialog k-popup-edit-form k-window-content k-content">\n <div class="k-edit-form-container k-window-content" style="text-align: center;">\n <kendo-editor-fontsize-dropdownlist\n #fontSizeDropDownList\n [defaultItem]="defaultItem"\n [data]="data"\n [(value)]="value"\n [itemDisabled]="itemDisabled"\n >\n </kendo-editor-fontsize-dropdownlist>\n </div>\n </div>\n </div>\n <kendo-dialog-actions>\n <button kendoButton (click)="onCancelAction()">{{ textFor(\'dialogCancel\') }}</button>\n <button kendoButton\n (click)="onConfirmAction()" [primary]="true">{{ textFor(\'dialogApply\') }}</button>\n </kendo-dialog-actions>\n '}),r.__metadata("design:paramtypes",[i.DialogRef,s.EditorLocalizationService])],e)}(i.DialogContentBase);e.FontSizeDialogComponent=u},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(21),o=function(){function t(t,e,n,o,i){var s=this;this.command=t,this.button=e,this.editor=n,this.localization=o,this.toolsService=i,setTimeout((function(){var t=s.localization.get(s.command);t&&(s.button.showText="overflow",s.button.showIcon="both",s.button.text=t),s.button.toolbarOptions.icon||(s.button.icon=r.commandIcons[s.command]),s.button.title=t,s.toolsService.needsCheck.next()}))}return t.prototype.ngOnInit=function(){this.subs=this.editor.stateChange.subscribe(this.onStateChange.bind(this)),this.subs.add(this.button.click.subscribe(this.clickHandler.bind(this))),this.subs.add(this.button.pointerdown.subscribe(this.pointerdownHandler.bind(this)))},t.prototype.ngOnDestroy=function(){this.subs&&this.subs.unsubscribe()},t.prototype.clickHandler=function(){},t.prototype.pointerdownHandler=function(t){},t.prototype.onStateChange=function(t){},t}();e.EditorCommandBase=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"alignCenter",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"alignJustify",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"alignLeft",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"alignRight",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"backColor",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"blockquote",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"bold",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"cleanFormatting",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"createLink",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"fontFamily",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"fontSize",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"foreColor",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"format",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"indent",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"insertFile",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"insertImage",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"insertOrderedList",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"insertUnorderedList",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"italic",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"outdent",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"print",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"redo",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"selectAll",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"strikethrough",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"subscript",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"superscript",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"underline",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"undo",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"unlink",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"viewSource",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"insertTable",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"addColumnBefore",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"addColumnAfter",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"addRowBefore",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"addRowAfter",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"deleteColumn",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"deleteRow",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"deleteTable",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"dialogApply",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"dialogCancel",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"dialogInsert",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"dialogUpdate",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"fileText",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"fileTitle",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"fileWebAddress",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"imageAltText",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"imageHeight",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"imageWebAddress",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"imageWidth",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"linkOpenInNewWindow",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"linkText",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"linkTitle",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"linkWebAddress",void 0),e}(n(11).ComponentMessages);e.Messages=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(3);e.EditorComponent=r.EditorComponent;var o=n(45);e.EditorModule=o.EditorModule;var i=n(23);e.schema=i.schema,e.Schema=i.Schema;var s=n(8);e.EditorState=s.EditorState,e.Plugin=s.Plugin,e.PluginKey=s.PluginKey,e.Transaction=s.Transaction,e.EditorView=s.EditorView,e.Decoration=s.Decoration,e.DecorationSet=s.DecorationSet,e.NodeType=s.NodeType,e.Node=s.Node,e.MarkType=s.MarkType,e.Mark=s.Mark,e.InputRule=s.InputRule,e.inputRules=s.inputRules,e.wrappingInputRule=s.wrappingInputRule,e.textblockTypeInputRule=s.textblockTypeInputRule,e.keymap=s.keymap,e.baseKeymap=s.baseKeymap,e.history=s.history,e.dropCursor=s.dropCursor,e.gapCursor=s.gapCursor,e.tableNodes=s.tableNodes,e.getSelectionText=s.getSelectionText;var a=n(28);e.EditorPasteEvent=a.EditorPasteEvent},function(t,e){t.exports=u},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.packageMetadata={name:"@progress/kendo-angular-editor",productName:"Kendo UI for Angular",productCodes:["KENDOUIANGULAR","KENDOUICOMPLETE"],publishDate:1645798286,version:"",licensingDocsUrl:"https://www.telerik.com/kendo-angular-ui/my-license/?utm_medium=product&utm_source=kendoangular&utm_campaign=kendo-ui-angular-purchase-license-keys-warning"}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(40);e.semanticTagNames=["article","main","nav","header","footer","aside","section"],e.semanticNodes=e.semanticTagNames.reduce((function(t,e){var n,i;return Object.assign(t,((n={})[e]=(i=e,{content:"block*",group:"block",attrs:r.__assign({},o.commonAttributes()),parseDOM:[{tag:i,getAttrs:o.getAttributes}],toDOM:function(t){return o.hasAttrs(t.attrs)?[i,o.getAttrs(t.attrs),o.hole]:[i,o.hole]}}),n))}),{})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0);e.hasAttrs=function(t,e){for(var n in t)if(n&&null!==t[n]&&n!==e)return!0;return!1},e.getAttrs=function(t,e){var n={};for(var r in t)r&&null!==t[r]&&r!==e&&(n[r]=t[r]);return n},e.getAttributes=function(t){for(var e,n={},r=t.attributes,o=0;o<r.length;o++)n[(e=r[o]).name]=e.value;return n},e.serializeDOMAttrs=function(t){return Array.from(t.attributes).reduce((function(t,e){var n;return Object.assign({},t,((n={})[e.name]=e.value,n))}),{})},e.commonAttributes=function(){return r.__assign({},e.createDefaultAttributes(["class","id","style"]))},e.createDefaultAttributes=function(t){return void 0===t&&(t=[]),r.__assign({},t.reduce((function(t,e){var n;return r.__assign({},t,((n={})[e]={default:null},n))}),{}))},e.hole=0,e.isSchemaNode=function(t){return function(e){return e.type.name===t}},e.isTable=e.isSchemaNode("table"),e.isTableBody=e.isSchemaNode("table_body"),e.isTableHead=e.isSchemaNode("table_head"),e.isTableFoot=e.isSchemaNode("table_foot"),e.isTableRow=e.isSchemaNode("table_row"),e.isTableCell=e.isSchemaNode("table_cell"),e.isTableHeaderCell=e.isSchemaNode("table_header")},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(8),i=n(42),s=function(t,e){return o.alignBlocks(o.alignRemoveRules)(t,e)},a={bold:function(t){return o.expandToWordWrap(o.toggleInlineFormat,r.__assign({},o.bold,{applyToWord:t}))},cleanFormatting:function(t){return o.cleanFormatting(t)},createLink:function(t){return o.expandToWordWrap(o.applyLink,{mark:"link",attrs:t.value,applyToWord:t.applyToWord})},fontFamily:function(t){return o.expandToWordWrap(o.applyInlineStyle,{style:"font-family",value:t.value,applyToWord:t.applyToWord})},fontSize:function(t){return o.expandToWordWrap(o.applyInlineStyle,{style:"font-size",value:t.value+"px",applyToWord:t.applyToWord})},insertFile:function(t){return o.expandToWordWrap(o.applyLink,{mark:"link",attrs:t,applyToWord:t.applyToWord})},insertText:function(t){return o.insertText(t)},italic:function(t){return o.expandToWordWrap(o.toggleInlineFormat,r.__assign({},o.italic,{applyToWord:t}))},strikethrough:function(t){return o.expandToWordWrap(o.toggleInlineFormat,r.__assign({},o.strikethrough,{applyToWord:t}))},subscript:function(t){return o.expandToWordWrap(o.toggleInlineFormat,r.__assign({},o.subscript,{applyToWord:t}))},superscript:function(t){return o.expandToWordWrap(o.toggleInlineFormat,r.__assign({},o.superscript,{applyToWord:t}))},underline:function(t){return o.expandToWordWrap(o.toggleInlineFormat,r.__assign({},o.underline,{applyToWord:t}))},unlink:function(){return o.removeLink(o.link)},foreColor:function(t){return o.expandToWordWrap(o.applyInlineStyle,{style:"color",value:t.value,applyToWord:t.applyToWord})},backColor:function(t){return o.expandToWordWrap(o.applyInlineStyle,{style:"background-color",value:t.value,applyToWord:t.applyToWord})},selectAll:function(){return function(t,e){return o.selectAll(t,e)}}},c={alignCenter:function(){return function(t,e){return o.isAligned(t,o.alignCenterRules)?s(t,e):o.alignBlocks(o.alignCenterRules)(t,e)}},alignJustify:function(){return function(t,e){return o.isAligned(t,o.alignJustifyRules)?s(t,e):o.alignBlocks(o.alignJustifyRules)(t,e)}},alignLeft:function(){return function(t,e){return o.isAligned(t,o.alignLeftRules)?s(t,e):o.alignBlocks(o.alignLeftRules)(t,e)}},alignRight:function(){return function(t,e){return o.isAligned(t,o.alignRightRules)?s(t,e):o.alignBlocks(o.alignRightRules)(t,e)}},format:function(t){return o.formatBlockElements(t.tag)},getHTML:function(){return o.getHtml},indent:function(){return o.indent},insertImage:function(t){return o.insertImage(t)},insertOrderedList:function(){return o.toggleOrderedList},insertUnorderedList:function(){return o.toggleUnorderedList},outdent:function(){return o.outdent},redo:function(){return o.redo},setHTML:function(t){var e=t.content,n=t.parseOptions;return o.setHtml(e,"setHTML",n)},undo:function(){return o.undo},blockquote:function(){return o.blockquote}},u={insertTable:function(t){return i.insertTable(t)},addColumnBefore:function(){return o.addColumnBefore},addColumnAfter:function(){return o.addColumnAfter},addRowBefore:function(){return o.addRowBefore},addRowAfter:function(){return o.addRowAfter},deleteRow:function(){return o.deleteRow},deleteColumn:function(){return o.deleteColumn},mergeCells:function(){return o.mergeCells},splitCell:function(){return o.splitCell},deleteTable:function(){return o.deleteTable}};e.editorCommands=Object.assign({},a,c,u)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(8);e.insertTable=function(t){return function(e,n){var o=r.createTable(e.schema.nodes,t.rows,t.cols);o&&r.insertNode(o,!0)(e,n)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(8),o=n(8);e.getToolbarState=function(t,e){return{alignCenter:{selected:o.isAligned(t,o.alignCenterRules),disabled:!1},alignJustify:{selected:o.isAligned(t,o.alignJustifyRules),disabled:!1},alignLeft:{selected:o.isAligned(t,o.alignLeftRules),disabled:!1},alignRight:{selected:o.isAligned(t,o.alignRightRules),disabled:!1},bold:{selected:o.hasMark(t,o.bold),disabled:!1},cleanFormatting:{selected:!1,disabled:!r.cleanFormatting()(t)},format:{selected:o.activeNode(t),disabled:!1},blockquote:{selected:!1,disabled:!r.blockquote(t)},indent:{selected:!1,disabled:!(o.canIndentAsListItem(t,t.schema.nodes.list_item)||o.canBeIndented(t,o.indentRules))},insertOrderedList:{selected:o.hasNode(t,t.schema.nodes.ordered_list),disabled:!1},insertUnorderedList:{selected:o.hasNode(t,t.schema.nodes.bullet_list),disabled:!1},italic:{selected:o.hasMark(t,o.italic),disabled:!1},unlink:{selected:!1,disabled:!o.hasMark(t,o.link)},outdent:{selected:!1,get disabled(){return!(o.hasNode(t,t.schema.nodes.blockquote)||o.canOutdentAsListItem(t,o.outdentRules)||r.isIndented(t,o.outdentRules.nodes))}},redo:{selected:!1,disabled:!o.redo(t)},selectAll:{selected:!1,disabled:!1},strikethrough:{selected:o.hasMark(t,o.strikethrough),disabled:!1},style:{selected:o.getActiveMarks(t,t.schema.marks.style),disabled:!1},subscript:{selected:o.hasMark(t,o.subscript),disabled:!1},superscript:{selected:o.hasMark(t,o.superscript),disabled:!1},underline:{selected:o.hasMark(t,o.underline),disabled:!1},undo:{selected:!1,disabled:!o.undo(t)},createLink:{selected:!1,get disabled(){var n=t.selection.empty;return e&&e.applyToWord&&n?o.expandSelection(t,(function(){}),e).state.selection.empty:n}},insertFile:{selected:!1,disabled:t.selection.empty},insertImage:{selected:!1,disabled:!1},viewSource:{selected:!1,disabled:!1},print:{selected:!1,disabled:!1},insertTable:{selected:!1,disabled:!1},addColumnBefore:{selected:!1,disabled:!o.addColumnBefore(t)},addColumnAfter:{selected:!1,disabled:!o.addColumnAfter(t)},addRowBefore:{selected:!1,disabled:!o.addRowBefore(t)},addRowAfter:{selected:!1,disabled:!o.addRowAfter(t)},deleteRow:{selected:!1,disabled:!o.deleteRow(t)},deleteColumn:{selected:!1,disabled:!o.deleteColumn(t)},mergeCells:{selected:!1,disabled:!o.mergeCells(t)},splitCell:{selected:!1,disabled:!o.splitCell(t)},deleteTable:{selected:!1,disabled:!o.deleteTable(t)}}},e.initialToolBarState={alignCenter:{selected:!1,disabled:!1},alignJustify:{selected:!1,disabled:!1},alignLeft:{selected:!1,disabled:!1},alignRight:{selected:!1,disabled:!1},bold:{selected:!1,disabled:!1},italic:{selected:!1,disabled:!1},underline:{selected:!1,disabled:!1},strikethrough:{selected:!1,disabled:!1},subscript:{selected:!1,disabled:!1},superscript:{selected:!1,disabled:!1},format:{selected:{text:"Format",tag:null},disabled:!1},style:{selected:{marks:[],hasNodesWithoutMarks:!1},disabled:!1},cleanFormatting:{selected:!1,disabled:!0},blockquote:{selected:!1,disabled:!1},indent:{selected:!1,disabled:!1},outdent:{selected:!1,disabled:!1},insertOrderedList:{selected:!1,disabled:!1},insertUnorderedList:{selected:!1,disabled:!1},unlink:{selected:!1,disabled:!0},redo:{selected:!1,disabled:!0},undo:{selected:!1,disabled:!0},print:{selected:!1,disabled:!1},createLink:{selected:!1,disabled:!0},insertFile:{selected:!1,disabled:!0},insertImage:{selected:!1,disabled:!1},viewSource:{selected:!1,disabled:!1},insertTable:{selected:!1,disabled:!1},addColumnBefore:{selected:!1,disabled:!0},addColumnAfter:{selected:!1,disabled:!0},addRowBefore:{selected:!1,disabled:!0},addRowAfter:{selected:!1,disabled:!0},deleteRow:{selected:!1,disabled:!0},deleteColumn:{selected:!1,disabled:!0},mergeCells:{selected:!1,disabled:!0},splitCell:{selected:!1,disabled:!0},deleteTable:{selected:!1,disabled:!0},selectAll:{selected:!1,disabled:!1}},e.disabledToolBarState={alignCenter:{selected:!1,disabled:!0},alignJustify:{selected:!1,disabled:!0},alignLeft:{selected:!1,disabled:!0},alignRight:{selected:!1,disabled:!0},bold:{selected:!1,disabled:!0},italic:{selected:!1,disabled:!0},underline:{selected:!1,disabled:!0},strikethrough:{selected:!1,disabled:!0},subscript:{selected:!1,disabled:!0},superscript:{selected:!1,disabled:!0},format:{selected:{text:"Format",tag:null},disabled:!0},style:{selected:{marks:[],hasNodesWithoutMarks:!1},disabled:!0},cleanFormatting:{selected:!1,disabled:!0},blockquote:{selected:!1,disabled:!0},indent:{selected:!1,disabled:!0},outdent:{selected:!1,disabled:!0},insertOrderedList:{selected:!1,disabled:!0},insertUnorderedList:{selected:!1,disabled:!0},unlink:{selected:!1,disabled:!0},redo:{selected:!1,disabled:!0},undo:{selected:!1,disabled:!0},print:{selected:!1,disabled:!0},createLink:{selected:!1,disabled:!0},insertFile:{selected:!1,disabled:!0},insertImage:{selected:!1,disabled:!0},viewSource:{selected:!1,disabled:!0},insertTable:{selected:!1,disabled:!0},addColumnBefore:{selected:!1,disabled:!0},addColumnAfter:{selected:!1,disabled:!0},addRowBefore:{selected:!1,disabled:!0},addRowAfter:{selected:!1,disabled:!0},deleteRow:{selected:!1,disabled:!0},deleteColumn:{selected:!1,disabled:!0},mergeCells:{selected:!1,disabled:!0},splitCell:{selected:!1,disabled:!0},deleteTable:{selected:!1,disabled:!0},selectAll:{selected:!1,disabled:!0}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.defaultStyle='\n html, body {\n margin: 0;\n height: 100%;\n padding: 0;\n }\n\n html {\n min-height: 100%;\n }\n\n body {\n box-sizing: border-box;\n position: relative;\n word-wrap: break-word;\n padding: 8px;\n }\n\n body > .k-content {\n outline: 0;\n height: 100%;\n white-space: pre-wrap;\n }\n\n div.ProseMirror {\n position: relative;\n word-wrap: break-word;\n white-space: pre-wrap;\n white-space: break-spaces;\n -webkit-font-variant-ligatures: none;\n font-variant-ligatures: none;\n font-feature-settings: "liga" 0; /* the above doesn\'t seem to work in Edge */\n }\n\n .ProseMirror pre {\n white-space: pre-wrap;\n }\n\n .k-content > p {\n margin: 0 0 1em;\n }\n\n .k-content table {\n white-space: pre-wrap;\n }\n\n .k-content .k-text-selected, .k-content::selection {\n color: HighlightText;\n background-color: Highlight;\n }\n\n .k-content .k-text-highlighted {\n background-color: #bbdefb;\n }\n\n .k-content .ProseMirror-selectednode {\n outline: 2px solid #8cf;\n }\n\n .ProseMirror-hideselection *::selection { background: transparent; }\n .ProseMirror-hideselection *::-moz-selection { background: transparent; }\n .ProseMirror-hideselection { caret-color: transparent; }\n\n .ProseMirror-gapcursor {\n display: none;\n pointer-events: none;\n position: absolute;\n }\n\n .ProseMirror-gapcursor:after {\n content: "";\n display: block;\n position: absolute;\n top: -2px;\n width: 20px;\n border-top: 1px solid black;\n animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;\n }\n\n @keyframes ProseMirror-cursor-blink {\n to {\n visibility: hidden;\n }\n }\n\n .ProseMirror-focused .ProseMirror-gapcursor {\n display: block;\n }\n\n .k-editor-resize-handles-wrapper {\n position: absolute;\n visibility: hidden;\n }\n\n .k-editor-resize-handle {\n position: absolute;\n visibility: visible;\n background-color: #fff;\n border: 1px solid #000;\n z-index: 100;\n width: 5px;\n height: 5px;\n }\n\n .k-editor-resize-handle.northwest {\n top: 0;\n left: 0;\n transform: translate(-50%, -50%);\n cursor: nw-resize;\n }\n\n .k-editor-resize-handle.north {\n top: 0;\n left: 50%;\n transform: translate(-50%, -50%);\n cursor: n-resize;\n }\n\n .k-editor-resize-handle.northeast {\n top: 0;\n right: 0;\n transform: translate(50%, -50%);\n cursor: ne-resize;\n }\n\n .k-editor-resize-handle.southwest {\n left: 0;\n bottom: 0;\n transform: translate(-50%, 50%);\n cursor: sw-resize;\n }\n\n .k-editor-resize-handle.south {\n bottom: 0;\n left: 50%;\n transform: translate(-50%, 50%);\n cursor: s-resize;\n }\n\n .k-editor-resize-handle.southeast {\n right: 0;\n bottom: 0;\n transform: translate(50%, 50%);\n cursor: se-resize;\n }\n\n .k-editor-resize-handle.west {\n top: 50%;\n left: 0;\n transform: translate(-50%, -50%);\n cursor: w-resize;\n }\n\n .k-editor-resize-handle.east {\n top: 50%;\n right: 0;\n transform: translate(50%, -50%);\n cursor: e-resize;\n }\n\n .ProseMirror .k-placeholder::before {\n content: attr(data-placeholder);\n height: 0;\n color: #8a8a8a;\n float: left;\n opacity: 1;\n cursor: text;\n -webkit-user-select: none;\n -ms-user-select: none;\n user-select: none;\n }\n\n .ProseMirror li {\n position: relative;\n }\n\n li.ProseMirror-selectednode {\n outline: none;\n }\n\n li.ProseMirror-selectednode:after {\n content: "";\n position: absolute;\n left: -32px;\n right: -2px;\n top: -2px;\n bottom: -2px;\n border: 2px solid #8cf;\n pointer-events: none;\n }\n',e.tablesStyles='\n.ProseMirror .tableWrapper {\n overflow-x: auto;\n margin: 1em 0;\n}\n\n.ProseMirror table {\n margin: 0;\n border-collapse: collapse;\n table-layout: fixed;\n width: 100%;\n overflow: hidden;\n}\n\n.ProseMirror td, .ProseMirror th {\n min-width: 1em;\n border: 1px solid #ddd;\n padding: 3px 5px;\n vertical-align: top;\n box-sizing: border-box;\n position: relative;\n}\n\n.ProseMirror th {\n font-weight: bold;\n text-align: left;\n}\n\n.ProseMirror .column-resize-handle {\n position: absolute;\n right: -2px; top: 0; bottom: 0;\n width: 4px;\n z-index: 20;\n background-color: #adf;\n pointer-events: none;\n}\n\n.ProseMirror.resize-cursor {\n cursor: ew-resize;\n cursor: col-resize;\n}\n\n/* Give selected cells a blue overlay */\n.ProseMirror .selectedCell:after {\n z-index: 2;\n position: absolute;\n content: "";\n left: 0; right: 0; top: 0; bottom: 0;\n background: rgba(200, 200, 255, 0.4);\n pointer-events: none;\n}\n',e.rtlStyles="body { direction: rtl }"},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(46),s=n(12),a=n(4),c=n(13),u=n(7),l=n(47),d=n(16),p=n(3),f=n(25),h=n(24),m=n(26),v=n(29),g=n(30),y=n(31),b=n(32),w=n(48),_=n(49),x=n(50),k=n(20),C=n(51),S=n(53),T=n(54),E=n(55),M=n(56),O=n(57),D=n(58),I=n(59),A=n(60),N=n(61),B=n(62),z=n(63),P=n(64),R=n(65),F=n(66),L=n(67),V=n(68),j=n(69),$=n(70),W=n(71),H=n(72),q=n(73),J=n(74),K=n(75),U=n(76),G=n(77),Y=n(78),X=n(79),Z=n(80),Q=n(81),tt=n(82),et=n(83),nt=n(84),rt=n(85),ot=n(86),it=n(87),st=n(88),at=n(89),ct=n(17),ut=n(18),lt=n(19),dt=n(33),pt=n(90),ft=n(91),ht=n(92),mt=[T.EditorAlignLeftButtonDirective,E.EditorAlignCenterButtonDirective,M.EditorAlignRightButtonDirective,O.EditorAlignJustifyButtonDirective,K.EditorInsertFileButtonDirective,I.EditorRedoButtonDirective,A.EditorUndoButtonDirective,N.EditorInsertImageButtonDirective,B.EditorIndentButtonDirective,z.EditorOutdentButtonDirective,P.EditorCreateLinkButtonDirective,R.EditorUnlinkButtonDirective,F.EditorInsertOrderedListButtonDirective,L.EditorInsertUnorderedListButtonDirective,V.EditorViewSourceButtonDirective,j.EditorBoldButtonDirective,$.EditorItalicButtonDirective,W.EditorUnderlineButtonDirective,H.EditorStrikethroughButtonDirective,q.EditorSubscriptButtonDirective,J.EditorSuperscriptButtonDirective,U.EditorForeColorDirective,G.EditorBackColorDirective,Y.EditorCleanFormattingButtonDirective,X.EditorAddColumnBeforeButtonDirective,Z.EditorAddColumnAfterButtonDirective,Q.EditorAddRowBeforeButtonDirective,tt.EditorAddRowAfterButtonDirective,et.EditorDeleteColumnButtonDirective,nt.EditorDeleteRowButtonDirective,rt.EditorDeleteTableButtonDirective,ot.EditorMergeCellsButtonDirective,it.EditorSplitCellButtonDirective,at.CustomMessagesComponent,st.LocalizedMessagesDirective,pt.DropDownToolDirective,ft.EditorPrintDirective,ht.EditorSelectAllButtonDirective,D.EditorBlockquoteDirective],vt=[_.EditorFontSizeComponent,x.EditorFontFamilyComponent,w.EditorFormatComponent,k.EditorColorPickerComponent,C.EditorInsertTableButtonComponent],gt=[m.FileLinkDialogComponent,f.ImageDialogComponent,h.SourceDialogComponent,v.FormatDialogComponent,g.ColorPickerDialogComponent,y.FontFamilyDialogComponent,dt.FontSizeDialogComponent,b.InsertTableDialogComponent],yt=[S.PopupTableGridComponent,ct.FormatDropDownListComponent,ut.FontFamilyDropDownListComponent,lt.FontSizeDropDownListComponent],bt=function(){function t(){}return t=r.__decorate([o.NgModule({declarations:[p.EditorComponent,mt,vt,gt,yt],entryComponents:[gt],exports:[p.EditorComponent,mt,vt,a.ToolBarModule,l.ButtonModule,s.FormsModule,s.ReactiveFormsModule,yt],imports:[i.CommonModule,s.FormsModule,s.ReactiveFormsModule,l.ButtonModule,d.ColorPickerModule,u.DialogModule,c.DropDownsModule,d.NumericTextBoxModule,d.CheckBoxModule,a.ToolBarModule,d.TextBoxModule]})],t)}();e.EditorModule=bt},function(t,e){t.exports=l},function(t,e){t.exports=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(4),s=n(7),a=n(9),c=n(3),u=n(2),l=n(29),d=n(17),p=n(5),f=function(t){function e(e,n,r,i){var s=t.call(this)||this;return s.editor=e,s.dialogService=n,s.localization=r,s.toolsService=i,s.disabled=!1,s.tabindex=-1,s.valueChange=new o.EventEmitter,s._data=[{text:"Paragraph",tag:"p"},{text:"Heading 1",tag:"h1"},{text:"Heading 2",tag:"h2"},{text:"Heading 3",tag:"h3"},{text:"Heading 4",tag:"h4"},{text:"Heading 5",tag:"h5"},{text:"Heading 6",tag:"h6"}],s}var n;return r.__extends(e,t),n=e,Object.defineProperty(e.prototype,"data",{get:function(){return this._data},set:function(t){this._data=t||this._data},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){var t=this;this.itemDisabled=function(e){return!(t.overflows||!t.formatDropDownList||t.formatDropDownList.dropDownList.isOpen)||null===e.dataItem.tag},setTimeout((function(){t.defaultItem={text:t.title,tag:null},t.toolsService.needsCheck.next()})),this.subs=this.editor.stateChange.subscribe((function(e){var n=e.format,r=t.data.findIndex((function(t){return t.tag===n.selected.tag}));t.value=-1!==r?n.selected.tag:null,t.disabled=n.disabled}))},e.prototype.onValueChange=function(t){a.isPresent(t)&&(this.editor.exec("format",{tag:t}),this.editor.view.focus(),this.valueChange.emit(this.data.find((function(e){return e.tag===t}))))},e.prototype.ngOnDestroy=function(){this.subs&&this.subs.unsubscribe()},Object.defineProperty(e.prototype,"outerWidth",{get:function(){var t=this.formatDropDownList.element;if(t)return a.outerWidth(t.nativeElement)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"title",{get:function(){return this.localization.get("format")},enumerable:!0,configurable:!0}),e.prototype.openDialog=function(){var t={appendTo:this.editor.dialogContainer,content:l.FormatDialogComponent};this.editor.toolbar.toggle(!1),this.dialogService.open(t).content.instance.setData({editor:this.editor,data:this.data,defaultItem:this.defaultItem,value:this.value,itemDisabled:this.itemDisabled})},e.prototype.canFocus=function(){return!this.disabled},e.prototype.focus=function(){this.tabindex=0,this.overflows?this.formatButton.nativeElement.focus():this.formatDropDownList.focus()},e.prototype.handleKey=function(){return this.tabindex=-1,!1},r.__decorate([o.Input(),r.__metadata("design:type",Array),r.__metadata("design:paramtypes",[Array])],e.prototype,"data",null),r.__decorate([o.Output(),r.__metadata("design:type",o.EventEmitter)],e.prototype,"valueChange",void 0),r.__decorate([o.ViewChild("toolbarTemplate",{static:!0}),r.__metadata("design:type",o.TemplateRef)],e.prototype,"toolbarTemplate",void 0),r.__decorate([o.ViewChild("popupTemplate",{static:!0}),r.__metadata("design:type",o.TemplateRef)],e.prototype,"popupTemplate",void 0),r.__decorate([o.ViewChild("formatDropDownList",{static:!1}),r.__metadata("design:type",d.FormatDropDownListComponent)],e.prototype,"formatDropDownList",void 0),r.__decorate([o.ViewChild("formatButton",{static:!1}),r.__metadata("design:type",o.ElementRef)],e.prototype,"formatButton",void 0),e=n=r.__decorate([o.Component({providers:[{provide:i.ToolBarToolComponent,useExisting:o.forwardRef((function(){return n}))}],selector:"kendo-toolbar-dropdownlist[kendoEditorFormat]",template:'\n <ng-template #toolbarTemplate>\n <kendo-editor-format-dropdownlist\n #formatDropDownList\n [defaultItem]="defaultItem"\n [data]="data"\n [(value)]="value"\n [itemDisabled]="itemDisabled"\n [title]="title"\n [disabled]="disabled"\n [tabindex]="tabindex"\n (valueChange)="onValueChange($event)"\n >\n </kendo-editor-format-dropdownlist>\n </ng-template>\n <ng-template #popupTemplate>\n <button\n #formatButton\n [tabindex]="tabindex"\n type="button"\n kendoButton\n class="k-overflow-button"\n [icon]="\'apply-format\'"\n [attr.title]="title"\n [disabled]="disabled"\n [tabindex]="tabindex"\n (click)="openDialog()"\n >\n {{ title }}\n </button>\n </ng-template>\n '}),r.__param(0,o.Host()),r.__metadata("design:paramtypes",[c.EditorComponent,s.DialogService,u.EditorLocalizationService,p.EditorToolsService])],e)}(i.ToolBarToolComponent);e.EditorFormatComponent=f},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(4),s=n(9),a=n(3),c=n(2),u=n(7),l=n(33),d=n(19),p=n(5),f=function(t){function e(e,n,r,i){var s=t.call(this)||this;return s.editor=e,s.dialogService=n,s.localization=r,s.toolsService=i,s.disabled=!1,s.tabindex=-1,s.valueChange=new o.EventEmitter,s._data=[{text:"8px",size:8},{text:"10px",size:10},{text:"12px",size:12},{text:"14px",size:14},{text:"18px",size:18},{text:"24px",size:24},{text:"36px",size:36}],s}var n;return r.__extends(e,t),n=e,Object.defineProperty(e.prototype,"data",{get:function(){return this._data},set:function(t){this._data=t||this._data},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){var t=this;this.itemDisabled=function(e){return!(t.overflows||!t.fontSizeDropDownList||t.fontSizeDropDownList.dropDownList.isOpen)||null===e.dataItem.size},setTimeout((function(){t.defaultItem={text:t.title,size:null},t.toolsService.needsCheck.next()})),this.subs=this.editor.stateChange.subscribe((function(e){var n=e.style;t.value=(s.getUniqueStyleValues(n.selected,"font-size").match(/\d+/g)||[null])[0],t.disabled=n.disabled}))},e.prototype.onValueChange=function(t){s.isPresent(t)&&(this.editor.exec("fontSize",t),this.editor.view.focus(),this.valueChange.emit(this.data.find((function(e){return e.size===parseInt(t,10)}))))},e.prototype.ngOnDestroy=function(){this.subs&&this.subs.unsubscribe()},Object.defineProperty(e.prototype,"outerWidth",{get:function(){if(this.element)return s.outerWidth(this.element.nativeElement)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"title",{get:function(){return this.localization.get("fontSize")},enumerable:!0,configurable:!0}),e.prototype.openDialog=function(){var t={appendTo:this.editor.dialogContainer,content:l.FontSizeDialogComponent};this.editor.toolbar.toggle(!1),this.dialogService.open(t).content.instance.setData({editor:this.editor,data:this.data,defaultItem:this.defaultItem,value:this.value,itemDisabled:this.itemDisabled})},e.prototype.canFocus=function(){return!this.disabled},e.prototype.focus=function(){this.tabindex=0,this.overflows?this.fontSizeButton.nativeElement.focus():this.fontSizeDropDownList.focus()},e.prototype.handleKey=function(){return this.tabindex=-1,!1},r.__decorate([o.Input(),r.__metadata("design:type",Array),r.__metadata("design:paramtypes",[Array])],e.prototype,"data",null),r.__decorate([o.Output(),r.__metadata("design:type",o.EventEmitter)],e.prototype,"valueChange",void 0),r.__decorate([o.ViewChild("toolbarTemplate",{static:!0}),r.__metadata("design:type",o.TemplateRef)],e.prototype,"toolbarTemplate",void 0),r.__decorate([o.ViewChild("popupTemplate",{static:!0}),r.__metadata("design:type",o.TemplateRef)],e.prototype,"popupTemplate",void 0),r.__decorate([o.ViewChild("element",{static:!1}),r.__metadata("design:type",o.ElementRef)],e.prototype,"element",void 0),r.__decorate([o.ViewChild("element",{read:d.FontSizeDropDownListComponent,static:!1}),r.__metadata("design:type",d.FontSizeDropDownListComponent)],e.prototype,"fontSizeDropDownList",void 0),r.__decorate([o.ViewChild("fontSizeButton",{static:!1}),r.__metadata("design:type",o.ElementRef)],e.prototype,"fontSizeButton",void 0),e=n=r.__decorate([o.Component({providers:[{provide:i.ToolBarToolComponent,useExisting:o.forwardRef((function(){return n}))}],selector:"kendo-toolbar-dropdownlist[kendoEditorFontSize]",template:'\n <ng-template #toolbarTemplate>\n <kendo-editor-fontsize-dropdownlist\n #element\n [defaultItem]="defaultItem"\n [data]="data"\n [(value)]="value"\n [itemDisabled]="itemDisabled"\n [title]="title"\n [disabled]="disabled"\n [tabindex]="tabindex"\n (valueChange)="onValueChange($event)"\n >\n </kendo-editor-fontsize-dropdownlist>\n </ng-template>\n <ng-template #popupTemplate>\n <button\n tabindex="-1"\n type="button"\n kendoButton\n #fontSizeButton\n class="k-overflow-button"\n [icon]="\'font-size\'"\n [attr.title]="title"\n [disabled]="disabled"\n [tabindex]="tabindex"\n (click)="openDialog()"\n >\n {{ title }}\n </button>\n </ng-template>\n '}),r.__param(0,o.Host()),r.__metadata("design:paramtypes",[a.EditorComponent,u.DialogService,c.EditorLocalizationService,p.EditorToolsService])],e)}(i.ToolBarToolComponent);e.EditorFontSizeComponent=f},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(4),s=n(9),a=n(3),c=n(2),u=n(7),l=n(31),d=n(18),p=n(5),f=function(t){function e(e,n,r,i){var s=t.call(this)||this;return s.editor=e,s.dialogService=n,s.localization=r,s.toolsService=i,s.disabled=!1,s.tabindex=-1,s.valueChange=new o.EventEmitter,s._data=[{text:"Arial",fontName:'Arial,"Helvetica Neue",Helvetica,sans-serif'},{text:"Courier New",fontName:'"Courier New",Courier,"Lucida Sans Typewriter","Lucida Typewriter",monospace'},{text:"Georgia",fontName:'Georgia,Times,"Times New Roman",serif'},{fontName:'Impact,Haettenschweiler,"Franklin Gothic Bold",Charcoal,"Helvetica Inserat","Bitstream Vera Sans Bold","Arial Black","sans serif"',text:"Impact"},{text:"Lucida Console",fontName:'"Lucida Console","Lucida Sans Typewriter",monaco,"Bitstream Vera Sans Mono",monospace'},{text:"Tahoma",fontName:"Tahoma,Verdana,Segoe,sans-serif"},{text:"Times New Roman",fontName:'TimesNewRoman,"Times New Roman",Times,Baskerville,Georgia,serif'},{text:"Trebuchet MS",fontName:'"Trebuchet MS","Lucida Grande","Lucida Sans Unicode","Lucida Sans",Tahoma,sans-serif'},{text:"Verdana",fontName:"Verdana,Geneva,sans-serif"}],s}var n;return r.__extends(e,t),n=e,Object.defineProperty(e.prototype,"data",{get:function(){return this._data},set:function(t){this._data=t||this._data},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){var t=this;this.itemDisabled=function(e){return!(t.overflows||!t.fontFamilyDropDownList||t.fontFamilyDropDownList.dropDownList.isOpen)||null===e.dataItem.fontName},setTimeout((function(){t.defaultItem={text:t.title,fontName:null},t.toolsService.needsCheck.next()})),this.subs=this.editor.stateChange.subscribe((function(e){var n=e.style;t.value=s.getUniqueStyleValues(n.selected,"font-family")||null,t.disabled=n.disabled}))},e.prototype.onValueChange=function(t){s.isPresent(t)&&(this.editor.exec("fontFamily",t),this.editor.view.focus(),this.valueChange.emit(this.data.find((function(e){return e.fontName===t}))))},e.prototype.ngOnDestroy=function(){this.subs&&this.subs.unsubscribe()},Object.defineProperty(e.prototype,"outerWidth",{get:function(){if(this.element)return s.outerWidth(this.element.nativeElement)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"title",{get:function(){return this.localization.get("fontFamily")},enumerable:!0,configurable:!0}),e.prototype.openDialog=function(){var t={appendTo:this.editor.dialogContainer,content:l.FontFamilyDialogComponent};this.editor.toolbar.toggle(!1),this.dialogService.open(t).content.instance.setData({editor:this.editor,data:this.data,defaultItem:this.defaultItem,value:this.value,itemDisabled:this.itemDisabled})},e.prototype.canFocus=function(){return!this.disabled},e.prototype.focus=function(){this.tabindex=0,this.overflows?this.fontFamilyButton.nativeElement.focus():this.fontFamilyDropDownList.focus()},e.prototype.handleKey=function(){return this.tabindex=-1,!1},r.__decorate([o.Input(),r.__metadata("design:type",Array),r.__metadata("design:paramtypes",[Array])],e.prototype,"data",null),r.__decorate([o.Output(),r.__metadata("design:type",o.EventEmitter)],e.prototype,"valueChange",void 0),r.__decorate([o.ViewChild("toolbarTemplate",{static:!0}),r.__metadata("design:type",o.TemplateRef)],e.prototype,"toolbarTemplate",void 0),r.__decorate([o.ViewChild("popupTemplate",{static:!0}),r.__metadata("design:type",o.TemplateRef)],e.prototype,"popupTemplate",void 0),r.__decorate([o.ViewChild("element",{static:!1}),r.__metadata("design:type",o.ElementRef)],e.prototype,"element",void 0),r.__decorate([o.ViewChild("element",{read:d.FontFamilyDropDownListComponent,static:!1}),r.__metadata("design:type",d.FontFamilyDropDownListComponent)],e.prototype,"fontFamilyDropDownList",void 0),r.__decorate([o.ViewChild("fontFamilyButton",{static:!1}),r.__metadata("design:type",o.ElementRef)],e.prototype,"fontFamilyButton",void 0),e=n=r.__decorate([o.Component({providers:[{provide:i.ToolBarToolComponent,useExisting:o.forwardRef((function(){return n}))}],selector:"kendo-toolbar-dropdownlist[kendoEditorFontFamily]",template:'\n <ng-template #toolbarTemplate>\n <kendo-editor-fontfamily-dropdownlist\n #element\n [defaultItem]="defaultItem"\n [data]="data"\n [(value)]="value"\n [itemDisabled]="itemDisabled"\n [title]="title"\n [disabled]="disabled"\n [tabindex]="tabindex"\n (valueChange)="onValueChange($event)"\n >\n </kendo-editor-fontfamily-dropdownlist>\n </ng-template>\n <ng-template #popupTemplate>\n <button\n tabindex="-1"\n type="button"\n kendoButton\n #fontFamilyButton\n class="k-overflow-button"\n [icon]="\'font-family\'"\n [attr.title]="title"\n [disabled]="disabled"\n [tabindex]="tabindex"\n (click)="openDialog()"\n >\n {{ title }}\n </button>\n </ng-template>\n '}),r.__param(0,o.Host()),r.__metadata("design:paramtypes",[a.EditorComponent,u.DialogService,c.EditorLocalizationService,p.EditorToolsService])],e)}(i.ToolBarToolComponent);e.EditorFontFamilyComponent=f},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(15),s=n(22),a=n(4),c=n(52),u=n(9),l=n(3),d=n(2),p=n(7),f=n(32),h=n(10),m=function(t){function e(e,n,r,a){var c=t.call(this)||this;return c.editor=e,c.localization=n,c.popupService=r,c.dialogService=a,c.open=!1,c.buttonBlurred=new o.EventEmitter,c.cellClicked=new o.EventEmitter,c.subs=c.editor.stateChange.subscribe((function(t){var e=t.insertTable;c.disabled=e.disabled})),c.subs.add(c.buttonBlurred.pipe(s.concatMap((function(){return i.interval(200).pipe(s.take(1),s.takeUntil(c.cellClicked))}))).subscribe((function(){c.toggle(!1)}))),c}var n;return r.__extends(e,t),n=e,e.prototype.ngOnDestroy=function(){this.destroyPopup(),this.subs&&this.subs.unsubscribe()},Object.defineProperty(e.prototype,"outerWidth",{get:function(){if(this.element)return u.outerWidth(this.element.nativeElement)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"title",{get:function(){return this.localization.get("insertTable")},enumerable:!0,configurable:!0}),e.prototype.toggle=function(t){this.open=void 0===t?!this.open:t,this.destroyPopup(),this.open&&this.createPopup()},e.prototype.openDialog=function(){var t={appendTo:this.editor.dialogContainer,content:f.InsertTableDialogComponent};this.editor.toolbar.toggle(!1),this.dialogService.open(t).content.instance.setData({editor:this.editor})},e.prototype.onBlur=function(){this.tabIndex=-1,this.buttonBlurred.emit()},e.prototype.onCellClick=function(t){this.cellClicked.emit(),this.toggle(!1),this.editor.exec("insertTable",t)},e.prototype.canFocus=function(){return!this.disabled},e.prototype.focus=function(){this.tabIndex=0,this.getButton().focus()},e.prototype.handleKey=function(t){return t.keyCode===h.Keys.Space||t.keyCode===h.Keys.Enter||(this.tabIndex=-1,!1)},e.prototype.onTableWizardClick=function(){},e.prototype.createPopup=function(){var t="rtl"===this.editor.direction?"right":"left",e={horizontal:t,vertical:"bottom"},n={horizontal:t,vertical:"top"};this.popupRef=this.popupService.open({anchor:this.element,anchorAlign:e,animate:!0,content:this.popupGridTemplate,popupAlign:n,popupClass:"k-ct-popup k-group k-reset k-state-border-up",positionMode:"absolute"});var r=this.popupRef.popupElement;r.style.width="190px",r.style.height="164px",r.setAttribute("dir",this.editor.direction)},e.prototype.destroyPopup=function(){this.popupRef&&(this.popupRef.close(),this.popupRef=null)},e.prototype.getButton=function(){return(this.overflows?this.overflowElement:this.element).nativeElement},r.__decorate([o.ViewChild("toolbarTemplate",{static:!0}),r.__metadata("design:type",o.TemplateRef)],e.prototype,"toolbarTemplate",void 0),r.__decorate([o.ViewChild("popupTemplate",{static:!1}),r.__metadata("design:type",o.TemplateRef)],e.prototype,"popupTemplate",void 0),r.__decorate([o.ViewChild("element",{static:!1}),r.__metadata("design:type",o.ElementRef)],e.prototype,"element",void 0),r.__decorate([o.ViewChild("overflowElement",{static:!1}),r.__metadata("design:type",o.ElementRef)],e.prototype,"overflowElement",void 0),r.__decorate([o.ViewChild("popupGridTemplate",{static:!0}),r.__metadata("design:type",o.TemplateRef)],e.prototype,"popupGridTemplate",void 0),e=n=r.__decorate([o.Component({providers:[{provide:a.ToolBarToolComponent,useExisting:o.forwardRef((function(){return n}))}],selector:"kendo-editor-insert-table-button",template:'\n <ng-template #toolbarTemplate>\n <button\n type="button"\n kendoButton\n #element\n [attr.title]="title"\n [attr.tabindex]="tabIndex"\n [icon]="\'table-insert\'"\n [disabled]="disabled"\n (click)="toggle()"\n (blur)="onBlur()"\n ></button>\n </ng-template>\n <ng-template #popupTemplate>\n <button\n kendoButton\n #overflowElement\n [attr.title]="title"\n [attr.tabindex]="tabIndex"\n [icon]="\'table-insert\'"\n [disabled]="disabled"\n (click)="openDialog()">\n {{ title }}\n </button>\n </ng-template>\n <ng-template #popupGridTemplate>\n <kendo-popup-table-grid (cellClick)="onCellClick($event)" (tableWizardClick)="onTableWizardClick()"></kendo-popup-table-grid>\n </ng-template>\n '}),r.__param(0,o.Host()),r.__metadata("design:paramtypes",[l.EditorComponent,d.EditorLocalizationService,c.PopupService,p.DialogService])],e)}(a.ToolBarToolComponent);e.EditorInsertTableButtonComponent=m},function(t,e){t.exports=p},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=function(){function t(){this.cellClick=new o.EventEmitter,this.tableWizardClick=new o.EventEmitter,this.state={rows:-1,cols:-1},this.rows=6,this.cols=8}return Object.defineProperty(t.prototype,"message",{get:function(){var t=this.state,e=t.rows,n=t.cols;return"Create a "+(e>-1?e+1:"")+" "+(n>-1?"x":"")+" "+(n>-1?n+1:"")+" table"},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"cells",{get:function(){return Array.from(Array(this.rows*this.cols).keys())},enumerable:!0,configurable:!0}),t.prototype.selected=function(t){var e=this.state,n=e.rows,r=e.cols,o=Math.floor(t/this.cols),i=t%this.cols;return o<=n&&i<=r},t.prototype.setState=function(t){var e=Math.floor(t/this.cols),n=t%this.cols;this.state={rows:e,cols:n}},t.prototype.resetState=function(){this.state={rows:-1,cols:-1}},t.prototype.insertTable=function(){this.cellClick.emit(this.state)},t.prototype.openTableWizard=function(){this.tableWizardClick.emit()},r.__decorate([o.Output(),r.__metadata("design:type",o.EventEmitter)],t.prototype,"cellClick",void 0),r.__decorate([o.Output(),r.__metadata("design:type",o.EventEmitter)],t.prototype,"tableWizardClick",void 0),t=r.__decorate([o.Component({selector:"kendo-popup-table-grid",template:'\n <div style="border-color: inherit;" (mouseleave)="resetState()" (click)="insertTable()">\n <span *ngFor="let i of cells"\n class="k-ct-cell"\n [class.k-state-selected]="selected(i)"\n [class.k-state-disabled]="!selected(i)"\n (mouseenter)="setState(i)">\n </span>\n </div>\n <div class="k-status" unselectable="on">{{ message }}</div>\n \x3c!-- uncomment when TableWizard is completed\n <div class="k-editor-toolbar" unselectable="on">\n <button type="button" kendoButton class="k-tool" [icon]="\'table-wizard\'" (click)="openTableWizard()" title="Table Wizard">Table Wizard</button>\n </div>\n --\x3e\n '})],t)}();e.PopupTableGridComponent=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(4),s=n(3),a=n(6),c=n(2),u=n(5),l=function(t){function e(e,n,r,o){return t.call(this,"alignLeft",e,n,r,o)||this}return r.__extends(e,t),e=r.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorAlignLeftButton]"}),r.__param(1,o.Host()),r.__metadata("design:paramtypes",[i.ToolBarButtonComponent,s.EditorComponent,c.EditorLocalizationService,u.EditorToolsService])],e)}(a.EditorCommandButton);e.EditorAlignLeftButtonDirective=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(4),s=n(3),a=n(6),c=n(2),u=n(5),l=function(t){function e(e,n,r,o){return t.call(this,"alignCenter",e,n,r,o)||this}return r.__extends(e,t),e=r.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorAlignCenterButton]"}),r.__param(1,o.Host()),r.__metadata("design:paramtypes",[i.ToolBarButtonComponent,s.EditorComponent,c.EditorLocalizationService,u.EditorToolsService])],e)}(a.EditorCommandButton);e.EditorAlignCenterButtonDirective=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(4),s=n(3),a=n(6),c=n(2),u=n(5),l=function(t){function e(e,n,r,o){return t.call(this,"alignRight",e,n,r,o)||this}return r.__extends(e,t),e=r.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorAlignRightButton]"}),r.__param(1,o.Host()),r.__metadata("design:paramtypes",[i.ToolBarButtonComponent,s.EditorComponent,c.EditorLocalizationService,u.EditorToolsService])],e)}(a.EditorCommandButton);e.EditorAlignRightButtonDirective=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(4),s=n(3),a=n(6),c=n(2),u=n(5),l=function(t){function e(e,n,r,o){return t.call(this,"alignJustify",e,n,r,o)||this}return r.__extends(e,t),e=r.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorAlignJustifyButton]"}),r.__param(1,o.Host()),r.__metadata("design:paramtypes",[i.ToolBarButtonComponent,s.EditorComponent,c.EditorLocalizationService,u.EditorToolsService])],e)}(a.EditorCommandButton);e.EditorAlignJustifyButtonDirective=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(4),s=n(3),a=n(6),c=n(2),u=n(5),l=function(t){function e(e,n,r,o){var i=t.call(this,"blockquote",e,n,r,o)||this;return i.editor=n,i}return r.__extends(e,t),e=r.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorBlockquoteButton]"}),r.__param(1,o.Host()),r.__metadata("design:paramtypes",[i.ToolBarButtonComponent,s.EditorComponent,c.EditorLocalizationService,u.EditorToolsService])],e)}(a.EditorCommandButton);e.EditorBlockquoteDirective=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(4),s=n(3),a=n(6),c=n(2),u=n(5),l=function(t){function e(e,n,r,o){return t.call(this,"redo",e,n,r,o)||this}return r.__extends(e,t),e=r.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorRedoButton]"}),r.__param(1,o.Host()),r.__metadata("design:paramtypes",[i.ToolBarButtonComponent,s.EditorComponent,c.EditorLocalizationService,u.EditorToolsService])],e)}(a.EditorCommandButton);e.EditorRedoButtonDirective=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(4),s=n(3),a=n(6),c=n(2),u=n(5),l=function(t){function e(e,n,r,o){return t.call(this,"undo",e,n,r,o)||this}return r.__extends(e,t),e=r.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorUndoButton]"}),r.__param(1,o.Host()),r.__metadata("design:paramtypes",[i.ToolBarButtonComponent,s.EditorComponent,c.EditorLocalizationService,u.EditorToolsService])],e)}(a.EditorCommandButton);e.EditorUndoButtonDirective=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(4),s=n(3),a=n(14),c=n(2),u=n(5),l=function(t){function e(e,n,r,o){return t.call(this,"insertImage",e,n,r,o)||this}return r.__extends(e,t),e=r.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorInsertImageButton]"}),r.__param(1,o.Host()),r.__metadata("design:paramtypes",[i.ToolBarButtonComponent,s.EditorComponent,c.EditorLocalizationService,u.EditorToolsService])],e)}(a.EditorCommandDialog);e.EditorInsertImageButtonDirective=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(4),s=n(3),a=n(6),c=n(2),u=n(5),l=function(t){function e(e,n,r,o){return t.call(this,"indent",e,n,r,o)||this}return r.__extends(e,t),e=r.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorIndentButton]"}),r.__param(1,o.Host()),r.__metadata("design:paramtypes",[i.ToolBarButtonComponent,s.EditorComponent,c.EditorLocalizationService,u.EditorToolsService])],e)}(a.EditorCommandButton);e.EditorIndentButtonDirective=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(4),s=n(3),a=n(6),c=n(2),u=n(5),l=function(t){function e(e,n,r,o){return t.call(this,"outdent",e,n,r,o)||this}return r.__extends(e,t),e=r.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorOutdentButton]"}),r.__param(1,o.Host()),r.__metadata("design:paramtypes",[i.ToolBarButtonComponent,s.EditorComponent,c.EditorLocalizationService,u.EditorToolsService])],e)}(a.EditorCommandButton);e.EditorOutdentButtonDirective=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(4),s=n(3),a=n(14),c=n(2),u=n(5),l=function(t){function e(e,n,r,o){return t.call(this,"createLink",e,n,r,o)||this}return r.__extends(e,t),e=r.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorCreateLinkButton]"}),r.__param(1,o.Host()),r.__metadata("design:paramtypes",[i.ToolBarButtonComponent,s.EditorComponent,c.EditorLocalizationService,u.EditorToolsService])],e)}(a.EditorCommandDialog);e.EditorCreateLinkButtonDirective=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(4),s=n(3),a=n(6),c=n(2),u=n(5),l=function(t){function e(e,n,r,o){return t.call(this,"unlink",e,n,r,o)||this}return r.__extends(e,t),e=r.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorUnlinkButton]"}),r.__param(1,o.Host()),r.__metadata("design:paramtypes",[i.ToolBarButtonComponent,s.EditorComponent,c.EditorLocalizationService,u.EditorToolsService])],e)}(a.EditorCommandButton);e.EditorUnlinkButtonDirective=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(4),s=n(3),a=n(6),c=n(2),u=n(5),l=function(t){function e(e,n,r,o){return t.call(this,"insertOrderedList",e,n,r,o)||this}return r.__extends(e,t),e=r.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorInsertOrderedListButton]"}),r.__param(1,o.Host()),r.__metadata("design:paramtypes",[i.ToolBarButtonComponent,s.EditorComponent,c.EditorLocalizationService,u.EditorToolsService])],e)}(a.EditorCommandButton);e.EditorInsertOrderedListButtonDirective=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(4),s=n(3),a=n(6),c=n(2),u=n(5),l=function(t){function e(e,n,r,o){return t.call(this,"insertUnorderedList",e,n,r,o)||this}return r.__extends(e,t),e=r.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorInsertUnorderedListButton]"}),r.__param(1,o.Host()),r.__metadata("design:paramtypes",[i.ToolBarButtonComponent,s.EditorComponent,c.EditorLocalizationService,u.EditorToolsService])],e)}(a.EditorCommandButton);e.EditorInsertUnorderedListButtonDirective=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(4),s=n(3),a=n(14),c=n(2),u=n(5),l=function(t){function e(e,n,r,o){return t.call(this,"viewSource",e,n,r,o)||this}return r.__extends(e,t),e=r.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorViewSourceButton]"}),r.__param(1,o.Host()),r.__metadata("design:paramtypes",[i.ToolBarButtonComponent,s.EditorComponent,c.EditorLocalizationService,u.EditorToolsService])],e)}(a.EditorCommandDialog);e.EditorViewSourceButtonDirective=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(4),s=n(3),a=n(6),c=n(2),u=n(5),l=function(t){function e(e,n,r,o){return t.call(this,"bold",e,n,r,o)||this}return r.__extends(e,t),e=r.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorBoldButton]"}),r.__param(1,o.Host()),r.__metadata("design:paramtypes",[i.ToolBarButtonComponent,s.EditorComponent,c.EditorLocalizationService,u.EditorToolsService])],e)}(a.EditorCommandButton);e.EditorBoldButtonDirective=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(4),s=n(3),a=n(6),c=n(2),u=n(5),l=function(t){function e(e,n,r,o){return t.call(this,"italic",e,n,r,o)||this}return r.__extends(e,t),e=r.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorItalicButton]"}),r.__param(1,o.Host()),r.__metadata("design:paramtypes",[i.ToolBarButtonComponent,s.EditorComponent,c.EditorLocalizationService,u.EditorToolsService])],e)}(a.EditorCommandButton);e.EditorItalicButtonDirective=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(4),s=n(3),a=n(6),c=n(2),u=n(5),l=function(t){function e(e,n,r,o){return t.call(this,"underline",e,n,r,o)||this}return r.__extends(e,t),e=r.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorUnderlineButton]"}),r.__param(1,o.Host()),r.__metadata("design:paramtypes",[i.ToolBarButtonComponent,s.EditorComponent,c.EditorLocalizationService,u.EditorToolsService])],e)}(a.EditorCommandButton);e.EditorUnderlineButtonDirective=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(4),s=n(3),a=n(6),c=n(2),u=n(5),l=function(t){function e(e,n,r,o){return t.call(this,"strikethrough",e,n,r,o)||this}return r.__extends(e,t),e=r.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorStrikethroughButton]"}),r.__param(1,o.Host()),r.__metadata("design:paramtypes",[i.ToolBarButtonComponent,s.EditorComponent,c.EditorLocalizationService,u.EditorToolsService])],e)}(a.EditorCommandButton);e.EditorStrikethroughButtonDirective=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(4),s=n(3),a=n(6),c=n(2),u=n(5),l=function(t){function e(e,n,r,o){return t.call(this,"subscript",e,n,r,o)||this}return r.__extends(e,t),e=r.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorSubscriptButton]"}),r.__param(1,o.Host()),r.__metadata("design:paramtypes",[i.ToolBarButtonComponent,s.EditorComponent,c.EditorLocalizationService,u.EditorToolsService])],e)}(a.EditorCommandButton);e.EditorSubscriptButtonDirective=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(4),s=n(3),a=n(6),c=n(2),u=n(5),l=function(t){function e(e,n,r,o){return t.call(this,"superscript",e,n,r,o)||this}return r.__extends(e,t),e=r.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorSuperscriptButton]"}),r.__param(1,o.Host()),r.__metadata("design:paramtypes",[i.ToolBarButtonComponent,s.EditorComponent,c.EditorLocalizationService,u.EditorToolsService])],e)}(a.EditorCommandButton);e.EditorSuperscriptButtonDirective=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(3),s=n(14),a=n(4),c=n(2),u=n(5),l=function(t){function e(e,n,r,o){return t.call(this,"insertFile",e,n,r,o)||this}return r.__extends(e,t),e=r.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorInsertFileButton]"}),r.__param(1,o.Host()),r.__metadata("design:paramtypes",[a.ToolBarButtonComponent,i.EditorComponent,c.EditorLocalizationService,u.EditorToolsService])],e)}(s.EditorCommandDialog);e.EditorInsertFileButtonDirective=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(20),s=n(21),a=function(){function t(t){this.colorPicker=t,this.colorPicker.icon=s.commandIcons.foreColor,this.colorPicker.editorCommand="foreColor"}return t=r.__decorate([o.Directive({selector:"[kendoEditorForeColor]"}),r.__metadata("design:paramtypes",[i.EditorColorPickerComponent])],t)}();e.EditorForeColorDirective=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(20),s=n(21),a=function(){function t(t){this.colorPicker=t,this.colorPicker.icon=s.commandIcons.backColor,this.colorPicker.editorCommand="backColor"}return t=r.__decorate([o.Directive({selector:"[kendoEditorBackColor]"}),r.__metadata("design:paramtypes",[i.EditorColorPickerComponent])],t)}();e.EditorBackColorDirective=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(4),s=n(3),a=n(6),c=n(2),u=n(5),l=function(t){function e(e,n,r,o){return t.call(this,"cleanFormatting",e,n,r,o)||this}return r.__extends(e,t),e=r.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorCleanFormattingButton]"}),r.__param(1,o.Host()),r.__metadata("design:paramtypes",[i.ToolBarButtonComponent,s.EditorComponent,c.EditorLocalizationService,u.EditorToolsService])],e)}(a.EditorCommandButton);e.EditorCleanFormattingButtonDirective=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(4),s=n(3),a=n(6),c=n(2),u=n(5),l=function(t){function e(e,n,r,o){return t.call(this,"addColumnBefore",e,n,r,o)||this}return r.__extends(e,t),e=r.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorAddColumnBeforeButton]"}),r.__param(1,o.Host()),r.__metadata("design:paramtypes",[i.ToolBarButtonComponent,s.EditorComponent,c.EditorLocalizationService,u.EditorToolsService])],e)}(a.EditorCommandButton);e.EditorAddColumnBeforeButtonDirective=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(4),s=n(3),a=n(6),c=n(2),u=n(5),l=function(t){function e(e,n,r,o){return t.call(this,"addColumnAfter",e,n,r,o)||this}return r.__extends(e,t),e=r.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorAddColumnAfterButton]"}),r.__param(1,o.Host()),r.__metadata("design:paramtypes",[i.ToolBarButtonComponent,s.EditorComponent,c.EditorLocalizationService,u.EditorToolsService])],e)}(a.EditorCommandButton);e.EditorAddColumnAfterButtonDirective=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(4),s=n(3),a=n(6),c=n(2),u=n(5),l=function(t){function e(e,n,r,o){return t.call(this,"addRowBefore",e,n,r,o)||this}return r.__extends(e,t),e=r.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorAddRowBeforeButton]"}),r.__param(1,o.Host()),r.__metadata("design:paramtypes",[i.ToolBarButtonComponent,s.EditorComponent,c.EditorLocalizationService,u.EditorToolsService])],e)}(a.EditorCommandButton);e.EditorAddRowBeforeButtonDirective=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(4),s=n(3),a=n(6),c=n(2),u=n(5),l=function(t){function e(e,n,r,o){return t.call(this,"addRowAfter",e,n,r,o)||this}return r.__extends(e,t),e=r.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorAddRowAfterButton]"}),r.__param(1,o.Host()),r.__metadata("design:paramtypes",[i.ToolBarButtonComponent,s.EditorComponent,c.EditorLocalizationService,u.EditorToolsService])],e)}(a.EditorCommandButton);e.EditorAddRowAfterButtonDirective=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(4),s=n(3),a=n(6),c=n(2),u=n(5),l=function(t){function e(e,n,r,o){return t.call(this,"deleteColumn",e,n,r,o)||this}return r.__extends(e,t),e=r.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorDeleteColumnButton]"}),r.__param(1,o.Host()),r.__metadata("design:paramtypes",[i.ToolBarButtonComponent,s.EditorComponent,c.EditorLocalizationService,u.EditorToolsService])],e)}(a.EditorCommandButton);e.EditorDeleteColumnButtonDirective=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(4),s=n(3),a=n(6),c=n(2),u=n(5),l=function(t){function e(e,n,r,o){return t.call(this,"deleteRow",e,n,r,o)||this}return r.__extends(e,t),e=r.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorDeleteRowButton]"}),r.__param(1,o.Host()),r.__metadata("design:paramtypes",[i.ToolBarButtonComponent,s.EditorComponent,c.EditorLocalizationService,u.EditorToolsService])],e)}(a.EditorCommandButton);e.EditorDeleteRowButtonDirective=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(4),s=n(3),a=n(6),c=n(2),u=n(5),l=function(t){function e(e,n,r,o){return t.call(this,"deleteTable",e,n,r,o)||this}return r.__extends(e,t),e=r.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorDeleteTableButton]"}),r.__param(1,o.Host()),r.__metadata("design:paramtypes",[i.ToolBarButtonComponent,s.EditorComponent,c.EditorLocalizationService,u.EditorToolsService])],e)}(a.EditorCommandButton);e.EditorDeleteTableButtonDirective=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(4),s=n(3),a=n(6),c=n(2),u=n(5),l=function(t){function e(e,n,r,o){return t.call(this,"mergeCells",e,n,r,o)||this}return r.__extends(e,t),e=r.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorMergeCellsButton]"}),r.__param(1,o.Host()),r.__metadata("design:paramtypes",[i.ToolBarButtonComponent,s.EditorComponent,c.EditorLocalizationService,u.EditorToolsService])],e)}(a.EditorCommandButton);e.EditorMergeCellsButtonDirective=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(4),s=n(3),a=n(6),c=n(2),u=n(5),l=function(t){function e(e,n,r,o){return t.call(this,"splitCell",e,n,r,o)||this}return r.__extends(e,t),e=r.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorSplitCellButton]"}),r.__param(1,o.Host()),r.__metadata("design:paramtypes",[i.ToolBarButtonComponent,s.EditorComponent,c.EditorLocalizationService,u.EditorToolsService])],e)}(a.EditorCommandButton);e.EditorSplitCellButtonDirective=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(11),s=n(35),a=function(t){function e(e){var n=t.call(this)||this;return n.service=e,n}var n;return r.__extends(e,t),n=e,e=n=r.__decorate([o.Directive({providers:[{provide:s.Messages,useExisting:o.forwardRef((function(){return n}))}],selector:"[kendoEditorLocalizedMessages]"}),r.__metadata("design:paramtypes",[i.LocalizationService])],e)}(s.Messages);e.LocalizedMessagesDirective=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(11),s=n(35),a=function(t){function e(e){var n=t.call(this)||this;return n.service=e,n}var n;return r.__extends(e,t),n=e,Object.defineProperty(e.prototype,"override",{get:function(){return!0},enumerable:!0,configurable:!0}),e=n=r.__decorate([o.Component({providers:[{provide:s.Messages,useExisting:o.forwardRef((function(){return n}))}],selector:"kendo-editor-messages",template:""}),r.__metadata("design:paramtypes",[i.LocalizationService])],e)}(s.Messages);e.CustomMessagesComponent=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=function(){function t(t,e){this.hostEl=t,this.zone=e,this.preventDefault=function(t){t.preventDefault()}}return Object.defineProperty(t.prototype,"hostElement",{get:function(){return this.hostEl.nativeElement},enumerable:!0,configurable:!0}),t.prototype.ngAfterViewInit=function(){var t=this;this.zone.runOutsideAngular((function(){t.hostElement.addEventListener("pointerdown",t.preventDefault)}))},t.prototype.ngOnDestroy=function(){this.hostElement.removeEventListener("pointerdown",this.preventDefault)},t=r.__decorate([o.Directive({selector:"[kendoEditorDropDownTool]"}),r.__metadata("design:paramtypes",[o.ElementRef,o.NgZone])],t)}();e.DropDownToolDirective=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(4),s=n(3),a=n(6),c=n(2),u=n(27),l=n(5),d=function(t){function e(e,n,r,o){var i=t.call(this,"print",e,n,r,o)||this;return i.editor=n,i}return r.__extends(e,t),e.prototype.ngAfterViewInit=function(){if(o.isDevMode&&!this.editor.iframe)throw new Error(u.EditorErrorMessages.printTool)},e.prototype.clickHandler=function(){if(this.editor.iframe){var t=this.editor.view,e=t&&t.dom,n=e&&e.ownerDocument,r=n&&n.defaultView;r&&r.print()}},e=r.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorPrintButton]"}),r.__param(1,o.Host()),r.__metadata("design:paramtypes",[i.ToolBarButtonComponent,s.EditorComponent,c.EditorLocalizationService,l.EditorToolsService])],e)}(a.EditorCommandButton);e.EditorPrintDirective=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(4),s=n(3),a=n(6),c=n(2),u=n(5),l=function(t){function e(e,n,r,o){return t.call(this,"selectAll",e,n,r,o)||this}return r.__extends(e,t),e.prototype.clickHandler=function(){this.editor.shouldEmitFocus=!0,t.prototype.clickHandler.call(this)},e=r.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorSelectAllButton]"}),r.__param(1,o.Host()),r.__metadata("design:paramtypes",[i.ToolBarButtonComponent,s.EditorComponent,c.EditorLocalizationService,u.EditorToolsService])],e)}(a.EditorCommandButton);e.EditorSelectAllButtonDirective=l}])}));
20
+ var r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function o(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var i=function(){return(i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function s(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}function a(t,e,n,r){var o,i=arguments.length,s=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,n,s):o(e,n))||s);return i>3&&s&&Object.defineProperty(e,n,s),s}function c(t,e){return function(n,r){e(n,r,t)}}function u(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function l(t,e,n,r){return new(n||(n=Promise))((function(o,i){function s(t){try{c(r.next(t))}catch(t){i(t)}}function a(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((r=r.apply(t,e||[])).next())}))}function d(t,e){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=e.call(t,s)}catch(t){i=[6,t],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(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}function f(t,e){for(var n in t)"default"===n||e.hasOwnProperty(n)||(e[n]=t[n])}function h(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function m(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return s}function v(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(m(arguments[e]));return t}function g(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),o=0;for(e=0;e<n;e++)for(var i=arguments[e],s=0,a=i.length;s<a;s++,o++)r[o]=i[s];return r}function y(t){return this instanceof y?(this.v=t,this):new y(t)}function b(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,o=n.apply(t,e||[]),i=[];return r={},s("next"),s("throw"),s("return"),r[Symbol.asyncIterator]=function(){return this},r;function s(t){o[t]&&(r[t]=function(e){return new Promise((function(n,r){i.push([t,e,n,r])>1||a(t,e)}))})}function a(t,e){try{(n=o[t](e)).value instanceof y?Promise.resolve(n.value.v).then(c,u):l(i[0][2],n)}catch(t){l(i[0][3],t)}var n}function c(t){a("next",t)}function u(t){a("throw",t)}function l(t,e){t(e),i.shift(),i.length&&a(i[0][0],i[0][1])}}function w(t){var e,n;return e={},r("next"),r("throw",(function(t){throw t})),r("return"),e[Symbol.iterator]=function(){return this},e;function r(r,o){e[r]=t[r]?function(e){return(n=!n)?{value:y(t[r](e)),done:"return"===r}:o?o(e):e}:o}}function _(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t=h(t),e={},r("next"),r("throw"),r("return"),e[Symbol.asyncIterator]=function(){return this},e);function r(n){e[n]=t[n]&&function(e){return new Promise((function(r,o){(function(t,e,n,r){Promise.resolve(r).then((function(e){t({value:e,done:n})}),e)})(r,o,(e=t[n](e)).done,e.value)}))}}}function x(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function k(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function C(t){return t&&t.__esModule?t:{default:t}}function S(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function T(t,e,n){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,n),n}},function(e,n){e.exports=t},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(11),s=function(t){function e(e,n,r){return t.call(this,e,n,r)||this}return r.__extends(e,t),e=r.__decorate([r.__param(0,o.Inject(i.L10N_PREFIX)),r.__param(1,o.Optional()),r.__param(2,o.Optional()),r.__param(2,o.Inject(i.RTL)),r.__metadata("design:paramtypes",[String,i.MessageService,Boolean])],e)}(i.LocalizationService);e.EditorLocalizationService=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(12),s=n(15),a=n(22),c=n(4),u=n(7),l=n(10),d=n(8),p=n(37),f=n(38),h=n(23),m=n(41),v=n(43),g=n(9),y=n(24),b=n(25),w=n(26),_=n(11),x=n(2),k=n(44),C=n(27),S=n(5),T=n(28),E={convertMsLists:!1,removeAttributes:[],removeHtmlComments:!1,removeInvalidHTML:!0,removeMsClasses:!1,removeMsStyles:!1,stripTags:[]},M=g.conditionallyExecute(d.removeComments),O=g.conditionallyExecute(d.sanitize),D=function(t){if("all"===t.removeAttributes)return{"*":d.removeAttribute};var e=g.removeEmptyEntries({style:t.removeMsStyles?d.sanitizeStyleAttr:void 0,class:t.removeMsClasses?d.sanitizeClassAttr:void 0});return t.removeAttributes.reduce((function(t,e){var n;return r.__assign({},t,((n={})[e]=d.removeAttribute,n))}),e)},I=function(){function t(t,e,n,i,a,c){var u=this;this.dialogService=t,this.localization=e,this.cdr=n,this.ngZone=i,this.element=a,this.toolsService=c,this.iframe=!0,this.applyToWord=!1,this.preserveWhitespace=!1,this.resizable=!1,this.valueChange=new o.EventEmitter,this.onFocus=new o.EventEmitter,this.paste=new o.EventEmitter,this.onBlur=new o.EventEmitter,this.hostClass=!0,this.stateChange=new s.BehaviorSubject(v.initialToolBarState),this.valueModified=new s.Subject,this._readonly=!1,this._placeholder="",this.inForm=!1,this.afterViewInit=new s.Subject,this.contentAreaLoaded=new s.Subject,this.dispatchTransaction=function(t){var e=t.docChanged;if(!(u.disabled||u.readonly&&e)){if(e){var n=t.doc,r=d.getHtml({doc:n});u.trOnChange=t,u.htmlOnChange=r,u.ngZone.run((function(){u.valueModified.next(r)}))}e&&!u.inForm||u.view.updateState(u.view.state.apply(t))}},this.transformPastedHTML=function(t){var e=r.__assign({},E,u.pasteCleanupSettings),n=g.pipe(O(e.removeInvalidHTML),M(e.removeHtmlComments))(t),o=d.pasteCleanup(n,{convertMsLists:e.convertMsLists,stripTags:e.stripTags.join("|"),attributes:D(e)});if(l.hasObservers(u.paste)){var i=new T.EditorPasteEvent(o,t,u._pasteEvent);return u.ngZone.run((function(){return u.paste.emit(i)})),i.isDefaultPrevented()?"":i.cleanedHtml}return o},this.changeValue=function(t){var e=u._value;if(u._value=t,u._view){if(u.htmlOnChange===t&&u.trOnChange)u.view.updateState(u.view.state.apply(u.trOnChange));else if((e||"")!==(t||"")){if(u.iframe&&!u.container.element.nativeElement.contentWindow)return;var n=u.view.state,r=d.parseContent(t||"",n.schema,{preserveWhitespace:u.preserveWhitespace}),o=n.tr.setSelection(new d.AllSelection(n.doc)).replaceSelectionWith(r);u.view.updateState(n.apply(o))}u.trOnChange=null,u.htmlOnChange=null}},this.onChangeCallback=function(t){u.changeValue(t)},this.onTouchedCallback=function(t){},this.onPaste=function(t,e){return u._pasteEvent=e,!1},p.validatePackage(f.packageMetadata),this.direction=e.rtl?"rtl":"ltr",this.subs=s.zip(this.afterViewInit.asObservable(),this.contentAreaLoaded.asObservable()).subscribe((function(){return u.initialize()}))}var e;return e=t,Object.defineProperty(t.prototype,"value",{get:function(){if(this.trOnChange)return this.htmlOnChange;var t=this._view?this.getSource():this._value;return"<p></p>"===t?this._value?"":this._value:t},set:function(t){this.changeValue(t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"disabled",{get:function(){return this._disabled},set:function(t){this._disabled=t||!1,this._view&&this._view.updateState(this._view.state),this._disabled&&(this.readonly=!1),this._disabled||this._readonly?this.stateChange.next(v.disabledToolBarState):this.stateChange.next(v.initialToolBarState)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"readonly",{get:function(){return this._readonly},set:function(t){if(this._readonly=t||!1,this._view){var e=void 0,n=(e=this.iframe?this.container.element.nativeElement.contentWindow:window).getSelection().focusNode;this._view.dom.contains(n)&&e.getSelection().removeAllRanges();var r=this._view.state.doc,o=this._view.state.tr.setSelection(d.TextSelection.create(r,1));this._view.dispatch(o)}this._readonly?(this.toolbar&&(this.toolbar.tabindex=-1),this.stateChange.next(v.disabledToolBarState)):(this.toolbar&&(this.toolbar.tabindex=0),this.stateChange.next(v.initialToolBarState))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return this._schema},set:function(t){if(o.isDevMode){if(!(t instanceof d.Schema))throw new Error(C.EditorErrorMessages.schemaType);if(this._view)throw new Error(C.EditorErrorMessages.setSchemaOnce)}this._schema=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"plugins",{get:function(){return this._plugins},set:function(t){if(o.isDevMode){if("function"!=typeof t)throw new Error(C.EditorErrorMessages.pluginsCallbackType(t));if(this._view)throw new Error(C.EditorErrorMessages.setPluginsOnce)}this._plugins=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"placeholder",{get:function(){return this._placeholder},set:function(t){if(o.isDevMode&&this._view)throw new Error(C.EditorErrorMessages.setPlaceHolderOnce);this._placeholder=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"resizableClass",{get:function(){return!!this.resizable},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isDisabled",{get:function(){return this.disabled},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isReadonly",{get:function(){return this.readonly},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isIE",{get:function(){return this.iframe&&g.detectIE()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dir",{get:function(){return this.direction},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ariaDisabled",{get:function(){return this.disabled},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"minWidth",{get:function(){var t=this.resizable;return t.minWidth?t.minWidth+"px":void 0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"maxWidth",{get:function(){var t=this.resizable;return t.maxWidth?t.maxWidth+"px":void 0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"minHeight",{get:function(){var t=this.resizable;return t.minHeight?t.minHeight+"px":void 0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"maxHeight",{get:function(){var t=this.resizable;return t.maxHeight?t.maxHeight+"px":void 0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"toolbar",{get:function(){return this.defaultToolbarComponent||this.userToolBarComponent},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"view",{get:function(){return this._view},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"selectionText",{get:function(){return this._view&&this._view.state?d.getSelectionText(this._view.state):""},enumerable:!0,configurable:!0}),t.prototype.ngOnInit=function(){var t=this;this.subs.add(this.localization.changes.subscribe((function(e){var n=e.rtl;t.direction=n?"rtl":"ltr"}))),this.subs.add(this.toolsService.needsCheck.subscribe((function(){return t.cdr.markForCheck()})))},t.prototype.ngAfterViewInit=function(){this.afterViewInit.next(),this.iframe||this.contentAreaLoaded.next(),this.resizable&&this.normalizeSize()},t.prototype.ngOnChanges=function(t){var e=this;t.value&&this.view&&this.changeValue(t.value.currentValue),t.iframe&&!t.iframe.isFirstChange()&&this.ngZone.onStable.pipe(a.take(1)).subscribe((function(){return e.initialize()})),t.resizable&&!t.resizable.isFirstChange()&&this.normalizeSize()},t.prototype.setDisabledState=function(t){this.disabled=t},t.prototype.iframeOnLoad=function(){this.contentAreaLoaded.next()},t.prototype.exec=function(t,e){"setHTML"===t&&"string"==typeof e?e={content:e,parseOptions:{preserveWhitespace:this.preserveWhitespace}}:["fontFamily","fontSize","foreColor","backColor","createLink"].some((function(e){return e===t}))&&(e={value:e,applyToWord:this.applyToWord}),m.editorCommands[t](e)(this._view.state,this._view.dispatch,this._view)},t.prototype.openDialog=function(t){var e={createLink:{content:w.FileLinkDialogComponent},insertFile:{content:w.FileLinkDialogComponent},insertImage:{content:b.ImageDialogComponent},viewSource:{content:y.SourceDialogComponent,height:400,width:500}},n=Object.assign({appendTo:this.dialogContainer},e[t]);this.toolbar.toggle(!1);var r=this.dialogService.open(n).content.instance;"createLink"!==t&&"insertFile"!==t||(r.command=t),r.editor=this,r.setData(this._view.state,{applyToWord:this.applyToWord})},t.prototype.focus=function(){this.focusChangedProgrammatically=!0,this._view.focus(),this.focusChangedProgrammatically=!1},t.prototype.blur=function(){this.focusChangedProgrammatically=!0,this._view.dom.blur(),this.focusChangedProgrammatically=!1},t.prototype.getSource=function(){return d.getHtml(this._view.state)},t.prototype.ngOnDestroy=function(){this.subs&&this.subs.unsubscribe(),this._styleObserver&&this._styleObserver.disconnect()},t.prototype.writeValue=function(t){this.inForm=!0,this.value=null===t?void 0:t},t.prototype.registerOnChange=function(t){this.onChangeCallback=t},t.prototype.registerOnTouched=function(t){this.onTouchedCallback=t},t.prototype.isEmpty=function(){return!1},t.prototype.initialize=function(){var t=this;if(l.isDocumentAvailable()){var e=this.schema||h.schema,n=this.container.element.nativeElement,r=d.parseContent((this.value||"").trim(),e,{preserveWhitespace:this.preserveWhitespace});if(this.iframe){var o=n.contentDocument,i=o.createElement("meta");i.setAttribute("charset","utf-8"),o.head.appendChild(i),[k.defaultStyle,k.tablesStyles,"rtl"===this.dir?k.rtlStyles:void 0].forEach((function(t){if(t){var e=o.createElement("style");e.appendChild(o.createTextNode(t)),o.head.appendChild(e)}})),(c=o.createElement("div")).classList.add("k-content"),o.body.appendChild(c)}else{var c=document.createElement("div");n.appendChild(c)}var u=[new d.Plugin({key:new d.PluginKey("editor-tabindex"),props:{attributes:function(){return{tabIndex:t.readonly?"0":""}}}}),new d.Plugin({key:new d.PluginKey("toolbar-tools-update"),view:function(){return{update:function(e){t.disabled||t.stateChange.next(t.readonly?v.disabledToolBarState:v.getToolbarState(e.state,{applyToWord:t.applyToWord}))}}}}),d.history(),d.keymap(d.buildListKeymap(e)),d.keymap(d.buildKeymap(e,{applyToWord:this.applyToWord})),d.keymap(d.baseKeymap),d.gapCursor(),d.imageResizing(),d.tableEditing(),d.caretColor()];this.placeholder&&u.push(d.placeholder(this.placeholder));var p=d.EditorState.create({schema:e,doc:r,plugins:g.isPresent(this.plugins)?this.plugins(u):u});if(this.iframe?this.viewMountElement=n.contentDocument.querySelector("div"):this.viewMountElement=n.querySelector("div"),this.ngZone.runOutsideAngular((function(){t._view=new d.EditorView({mount:t.viewMountElement},{state:p,editable:function(){return!t.readonly},dispatchTransaction:t.dispatchTransaction,transformPastedHTML:t.transformPastedHTML,handleDOMEvents:{paste:t.onPaste}})})),this._view){var f=void 0,m=this.element.nativeElement.querySelector(".k-editor-content").classList;f=this.iframe?this.container.element.nativeElement.contentDocument:this.container.element.nativeElement,this.subs.add(s.fromEvent(f,"focusin").subscribe((function(e){if(t.readonly&&m.add("k-focus"),!t.focusChangedProgrammatically||t.shouldEmitFocus){var n=e.relatedTarget;n&&n.classList.contains("k-colorpicker")&&!t.shouldEmitFocus||t.ngZone.run((function(){return t.onFocus.emit()})),t.shouldEmitFocus=!1}}))),this.subs.add(s.fromEvent(f,"focusout").subscribe((function(e){if(t.readonly&&m.remove("k-focus"),!t.focusChangedProgrammatically){var n=e.relatedTarget;n&&n.classList.contains("k-colorpicker")||t.ngZone.run((function(){return t.onBlur.emit()}))}})))}this.subs.add(this.stateChange.subscribe((function(){t.userToolBarComponent?t.userToolBarComponent.cdr.detectChanges():t.cdr.detectChanges()}))),this.subs.add(this.valueModified.subscribe((function(e){t.onChangeCallback(e),t.valueChange.emit(e),t.cdr.markForCheck()}))),this.subs.add(s.fromEvent(this.viewMountElement,"keyup").pipe(a.map((function(t){return t.keyCode})),a.filter((function(t){return 121===t})),a.map((function(){return t.userToolBarElement||t.defaultToolbar}))).subscribe((function(t){return t.nativeElement.focus()}))),this.subs.add(s.fromEvent(this.viewMountElement,"blur").pipe(a.filter((function(e){return!t.viewMountElement.contains(e.relatedTarget)}))).subscribe((function(){return t.onTouchedCallback()})))}},t.prototype.normalizeSize=function(){var t=this;if("object"==typeof this.resizable&&!this._styleObserver){var e=this.element.nativeElement;this._styleObserver=new MutationObserver((function(){t.ngZone.runOutsideAngular((function(){return t.normalizeProperties(e)}))})),this._styleObserver.observe(e,{attributeFilter:["style"]})}},t.prototype.normalizeProperties=function(t){var e=Object.keys(this.resizable),n=parseInt(t.style.width,10),r=parseInt(t.style.height,10),o=this.resizable;e.forEach((function(e){var i=e.startsWith("min"),s=!i,a=e.endsWith("Width"),c=!a;i&&a?n<o.minWidth&&(t.style.width=o.minWidth+"px"):i&&c?r<o.minHeight&&(t.style.height=o.minHeight+"px"):s&&a?n>o.maxWidth&&(t.style.width=o.maxWidth+"px"):r>o.maxHeight&&(t.style.height=o.maxHeight+"px")}))},r.__decorate([o.Input(),r.__metadata("design:type",String),r.__metadata("design:paramtypes",[String])],t.prototype,"value",null),r.__decorate([o.Input(),r.__metadata("design:type",Boolean),r.__metadata("design:paramtypes",[Boolean])],t.prototype,"disabled",null),r.__decorate([o.Input(),r.__metadata("design:type",Boolean),r.__metadata("design:paramtypes",[Boolean])],t.prototype,"readonly",null),r.__decorate([o.Input(),r.__metadata("design:type",Boolean)],t.prototype,"iframe",void 0),r.__decorate([o.Input(),r.__metadata("design:type",Object)],t.prototype,"applyToWord",void 0),r.__decorate([o.Input(),r.__metadata("design:type",d.Schema),r.__metadata("design:paramtypes",[d.Schema])],t.prototype,"schema",null),r.__decorate([o.Input(),r.__metadata("design:type",Function),r.__metadata("design:paramtypes",[Function])],t.prototype,"plugins",null),r.__decorate([o.Input(),r.__metadata("design:type",String),r.__metadata("design:paramtypes",[String])],t.prototype,"placeholder",null),r.__decorate([o.Input(),r.__metadata("design:type",Object)],t.prototype,"preserveWhitespace",void 0),r.__decorate([o.Input(),r.__metadata("design:type",Object)],t.prototype,"pasteCleanupSettings",void 0),r.__decorate([o.Input(),r.__metadata("design:type",Object)],t.prototype,"resizable",void 0),r.__decorate([o.Output(),r.__metadata("design:type",o.EventEmitter)],t.prototype,"valueChange",void 0),r.__decorate([o.Output("focus"),r.__metadata("design:type",o.EventEmitter)],t.prototype,"onFocus",void 0),r.__decorate([o.Output(),r.__metadata("design:type",o.EventEmitter)],t.prototype,"paste",void 0),r.__decorate([o.Output("blur"),r.__metadata("design:type",o.EventEmitter)],t.prototype,"onBlur",void 0),r.__decorate([o.HostBinding("class.k-editor"),r.__metadata("design:type",Boolean)],t.prototype,"hostClass",void 0),r.__decorate([o.HostBinding("class.k-editor-resizable"),r.__metadata("design:type",Boolean),r.__metadata("design:paramtypes",[])],t.prototype,"resizableClass",null),r.__decorate([o.HostBinding("class.k-disabled"),r.__metadata("design:type",Boolean),r.__metadata("design:paramtypes",[])],t.prototype,"isDisabled",null),r.__decorate([o.HostBinding("class.k-readonly"),r.__metadata("design:type",Boolean),r.__metadata("design:paramtypes",[])],t.prototype,"isReadonly",null),r.__decorate([o.HostBinding("class.k-ie"),r.__metadata("design:type",Boolean),r.__metadata("design:paramtypes",[])],t.prototype,"isIE",null),r.__decorate([o.HostBinding("attr.dir"),r.__metadata("design:type",String),r.__metadata("design:paramtypes",[])],t.prototype,"dir",null),r.__decorate([o.HostBinding("attr.ariaDisabled"),r.__metadata("design:type",Boolean),r.__metadata("design:paramtypes",[])],t.prototype,"ariaDisabled",null),r.__decorate([o.HostBinding("style.minWidth"),r.__metadata("design:type",String),r.__metadata("design:paramtypes",[])],t.prototype,"minWidth",null),r.__decorate([o.HostBinding("style.maxWidth"),r.__metadata("design:type",String),r.__metadata("design:paramtypes",[])],t.prototype,"maxWidth",null),r.__decorate([o.HostBinding("style.minHeight"),r.__metadata("design:type",String),r.__metadata("design:paramtypes",[])],t.prototype,"minHeight",null),r.__decorate([o.HostBinding("style.maxHeight"),r.__metadata("design:type",String),r.__metadata("design:paramtypes",[])],t.prototype,"maxHeight",null),r.__decorate([o.ContentChild(c.ToolBarComponent,{static:!1}),r.__metadata("design:type",c.ToolBarComponent)],t.prototype,"userToolBarComponent",void 0),r.__decorate([o.ContentChild(c.ToolBarComponent,{read:o.ElementRef,static:!1}),r.__metadata("design:type",o.ElementRef)],t.prototype,"userToolBarElement",void 0),r.__decorate([o.ViewChild("dialogsContainer",{read:o.ViewContainerRef,static:!0}),r.__metadata("design:type",o.ViewContainerRef)],t.prototype,"dialogContainer",void 0),r.__decorate([o.ViewChild("content",{read:o.ViewContainerRef,static:!1}),r.__metadata("design:type",o.ViewContainerRef)],t.prototype,"container",void 0),r.__decorate([o.ViewChild("defaultToolbar",{read:o.ElementRef,static:!1}),r.__metadata("design:type",o.ElementRef)],t.prototype,"defaultToolbar",void 0),r.__decorate([o.ViewChild("defaultToolbar",{read:c.ToolBarComponent,static:!1}),r.__metadata("design:type",c.ToolBarComponent)],t.prototype,"defaultToolbarComponent",void 0),t=e=r.__decorate([o.Component({selector:"kendo-editor",providers:[x.EditorLocalizationService,S.EditorToolsService,{provide:_.LocalizationService,useExisting:x.EditorLocalizationService},{provide:_.L10N_PREFIX,useValue:"kendo.editor"},{provide:i.NG_VALUE_ACCESSOR,useExisting:o.forwardRef((function(){return e})),multi:!0},{provide:l.KendoInput,useExisting:o.forwardRef((function(){return e}))}],template:'\n <ng-container\n kendoEditorLocalizedMessages\n i18n-alignCenter="kendo.editor.alignCenter|The title of the tool that aligns text in the center."\n alignCenter="Center text"\n i18n-alignJustify="kendo.editor.alignJustify|The title of the tool that justifies text both left and right."\n alignJustify="Justify"\n i18n-alignLeft="kendo.editor.alignLeft|The title of the tool that aligns text on the left."\n alignLeft="Align text left"\n i18n-alignRight="kendo.editor.alignRight|The title of the tool that aligns text on the right."\n alignRight="Align text right"\n i18n-backColor="kendo.editor.backColor|The title of the tool that changes the text background color."\n backColor="Background color"\n i18n-blockquote="kendo.editor.blockquote|The title of the tool that wraps an element in a blockquote"\n blockquote="Quotation"\n i18n-bold="kendo.editor.bold|The title of the tool that makes text bold."\n bold="Bold"\n i18n-cleanFormatting="kendo.editor.cleanFormatting|The title of the Clean Formatting tool."\n cleanFormatting="Clean formatting"\n i18n-createLink="kendo.editor.createLink|The title of the tool that creates hyperlinks."\n createLink="Insert link"\n i18n-dialogApply="kendo.editor.dialogApply|The label of the **Apply** button in all editor dialogs."\n dialogApply="Apply"\n i18n-dialogCancel="kendo.editor.dialogCancel|The label of the **Cancel** button in all editor dialogs."\n dialogCancel="Cancel"\n i18n-dialogInsert="kendo.editor.dialogInsert|The label of the **Insert** button in all editor dialogs."\n dialogInsert="Insert"\n i18n-dialogUpdate="kendo.editor.dialogUpdate|The label of the **Update** button in all editor dialogs."\n dialogUpdate="Update"\n i18n-fileText="kendo.editor.fileText|The caption for the file text in the insertFile dialog."\n fileText="Text"\n i18n-fileTitle="kendo.editor.fileTitle|The caption for the file Title in the insertFile dialog."\n fileTitle="Title"\n i18n-fileWebAddress="kendo.editor.fileWebAddress|The caption for the file URL in the insertFile dialog."\n fileWebAddress="Web address"\n i18n-fontFamily="kendo.editor.fontFamily|The title of the tool that changes the text font."\n fontFamily="Select font family"\n i18n-fontSize="kendo.editor.fontSize|The title of the tool that changes the text size."\n fontSize="Select font size"\n i18n-foreColor="kendo.editor.foreColor|The title of the tool that changes the text color."\n foreColor="Color"\n i18n-format="kendo.editor.format|The title of the tool that lets users choose block formats."\n format="Format"\n i18n-imageAltText="kendo.editor.imageAltText|The caption for the image alternate text in the insertImage dialog."\n imageAltText="Alternate text"\n i18n-imageHeight="kendo.editor.imageHeight|The caption for the image height in the insertImage dialog."\n imageHeight="Height (px)"\n i18n-imageWebAddress="kendo.editor.imageWebAddress|The caption for the image URL in the insertImage dialog."\n imageWebAddress="Web address"\n i18n-imageWidth="kendo.editor.imageWidth|The caption for the image width in the insertImage dialog."\n imageWidth="Width (px)"\n i18n-indent="kendo.editor.indent|The title of the tool that indents the content."\n indent="Indent"\n i18n-insertFile="kendo.editor.insertFile|The title of the tool that inserts links to files."\n insertFile="Insert file"\n i18n-insertImage="kendo.editor.insertImage|The title of the tool that inserts images."\n insertImage="Insert image"\n i18n-insertOrderedList="kendo.editor.insertOrderedList|The title of the tool that inserts an ordered list."\n insertOrderedList="Insert ordered list"\n i18n-insertUnorderedList="kendo.editor.insertUnorderedList|The title of the tool that inserts an unordered list."\n insertUnorderedList="Insert unordered list"\n i18n-italic="kendo.editor.italic|The title of the tool that makes text italicized."\n italic="Italic"\n i18n-linkOpenInNewWindow="kendo.editor.linkOpenInNewWindow|The caption for the checkbox for opening the link in a new window in the createLink dialog."\n linkOpenInNewWindow="Open link in new window"\n i18n-linkText="kendo.editor.linkText|The caption for the link text in the createLink dialog."\n linkText="Text"\n i18n-linkTitle="kendo.editor.linkTitle|The caption for the link title in the createLink dialog."\n linkTitle="Title"\n i18n-linkWebAddress="kendo.editor.linkWebAddress|The caption for the URL in the createLink dialog."\n linkWebAddress="Web address"\n i18n-outdent="kendo.editor.outdent|The title of the tool that outdents the content."\n outdent="Outdent"\n i18n-print="kendo.editor.print|The title of the print tool."\n print="Print"\n i18n-redo="kendo.editor.redo|The title of the tool that undos the last action."\n redo="Redo"\n i18n-selectAll="kendo.editor.selectAll|The title of the tool that selects all content."\n selectAll="Select All"\n i18n-strikethrough="kendo.editor.strikethrough|The title of the tool that strikes through text."\n strikethrough="Strikethrough"\n i18n-subscript="kendo.editor.subscript|The title of the tool that makes text subscript."\n subscript="Subscript"\n i18n-superscript="kendo.editor.superscript|The title of the tool that makes text superscript."\n superscript="Superscript"\n i18n-underline="kendo.editor.underline|The title of the tool that underlines text."\n underline="Underline"\n i18n-unlink="kendo.editor.unlink|The title of the tool that removes hyperlinks."\n unlink="Remove Link"\n i18n-undo="kendo.editor.undo|The title of the tool that undos the last action."\n undo="Undo"\n i18n-viewSource="kendo.editor.viewSource|The title of the tool that shows the editor value as HTML."\n viewSource="View source"\n i18n-insertTable="kendo.editor.insertTable|The title of the tool that inserts table."\n insertTable="Insert Table"\n i18n-addColumnBefore="kendo.editor.addColumnBefore|The title of the tool that adds new column before currently selected column."\n addColumnBefore="Add column before"\n i18n-addColumnAfter="kendo.editor.addColumnAfter|The title of the tool that adds new column after currently selected column."\n addColumnAfter="Add column after"\n i18n-addRowBefore="kendo.editor.addRowBefore|The title of the tool that adds new row before currently selected row."\n addRowBefore="Add row before"\n i18n-addRowAfter="kendo.editor.addRowAfter|The title of the tool that adds new row after currently selected row."\n addRowAfter="Add row after"\n i18n-deleteColumn="kendo.editor.deleteColumn|The title of the tool that deletes a table column."\n deleteColumn="Delete column"\n i18n-deleteRow="kendo.editor.deleteRow|The title of the tool that deletes a table row."\n deleteRow="Delete row"\n i18n-deleteTable="kendo.editor.deleteTable|The title of the tool that deletes a table."\n deleteTable="Delete table"\n >\n </ng-container>\n\n <ng-content select="kendo-toolbar"></ng-content>\n <kendo-toolbar [overflow]="true" [tabindex]="readonly ? -1 : 0" *ngIf="!userToolBarElement" #defaultToolbar>\n <kendo-toolbar-buttongroup>\n <kendo-toolbar-button kendoEditorBoldButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorItalicButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorUnderlineButton></kendo-toolbar-button>\n </kendo-toolbar-buttongroup>\n <kendo-toolbar-dropdownlist kendoEditorFormat></kendo-toolbar-dropdownlist>\n <kendo-toolbar-buttongroup>\n <kendo-toolbar-button kendoEditorAlignLeftButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorAlignCenterButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorAlignRightButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorAlignJustifyButton></kendo-toolbar-button>\n </kendo-toolbar-buttongroup>\n <kendo-toolbar-buttongroup>\n <kendo-toolbar-button kendoEditorInsertUnorderedListButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorInsertOrderedListButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorIndentButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorOutdentButton></kendo-toolbar-button>\n </kendo-toolbar-buttongroup>\n <kendo-toolbar-buttongroup>\n <kendo-toolbar-button kendoEditorCreateLinkButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorUnlinkButton></kendo-toolbar-button>\n </kendo-toolbar-buttongroup>\n <kendo-toolbar-button kendoEditorInsertImageButton></kendo-toolbar-button>\n </kendo-toolbar>\n\n <div *ngIf="!iframe" #content [attr.dir]="direction" class="k-editor-content"></div>\n\n <div class="k-editor-content" *ngIf="iframe">\n <iframe #content srcdoc="<!DOCTYPE html>" frameborder="0" class="k-iframe" (load)="iframeOnLoad()"></iframe>\n </div>\n\n <ng-container #dialogsContainer></ng-container>\n ',styles:["\n >>> .k-editor-content > .ProseMirror {\n height: 100%;\n width: 100%;\n box-sizing: border-box;\n outline: none;\n overflow: auto;\n }\n\n .k-iframe {\n width: 100%;\n height: 100%;\n display: block;\n }\n "]}),r.__metadata("design:paramtypes",[u.DialogService,_.LocalizationService,o.ChangeDetectorRef,o.NgZone,o.ElementRef,S.EditorToolsService])],t)}();e.EditorComponent=I},function(t,n){t.exports=e},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(15),s=function(){function t(){this.needsCheck=new i.Subject}return t=r.__decorate([o.Injectable()],t)}();e.EditorToolsService=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=function(t){function e(e,n,r,o,i){var s=t.call(this,e,n,r,o,i)||this;return s.command=e,s.button=n,s.editor=r,s.localization=o,s.toolsService=i,s}return r.__extends(e,t),e.prototype.clickHandler=function(){this.editor.exec(this.command,this.editor.applyToWord),this.editor.focus()},e.prototype.pointerdownHandler=function(t){t.preventDefault()},e.prototype.onStateChange=function(t){this.button.selected=t[this.command].selected,this.button.disabled=t[this.command].disabled},e}(n(34).EditorCommandBase);e.EditorCommandButton=o},function(t,e){t.exports=n},function(t,e,n){"use strict";function r(t){this.content=t}n.r(e),n.d(e,"getHtml",(function(){return Ae})),n.d(e,"setHtml",(function(){return Ne})),n.d(e,"parseContent",(function(){return Ie})),n.d(e,"trimWhitespace",(function(){return Ee})),n.d(e,"htmlToFragment",(function(){return Me})),n.d(e,"domToPmDoc",(function(){return De})),n.d(e,"pmDocToFragment",(function(){return Oe})),n.d(e,"applyInlineStyle",(function(){return ln})),n.d(e,"getInlineStyles",(function(){return an})),n.d(e,"toggleInlineFormat",(function(){return un})),n.d(e,"applyLink",(function(){return pn})),n.d(e,"removeLink",(function(){return dn})),n.d(e,"insertText",(function(){return fn})),n.d(e,"insertImage",(function(){return hn})),n.d(e,"alignBlocks",(function(){return Cn})),n.d(e,"isAligned",(function(){return Sn})),n.d(e,"cleanFormatting",(function(){return Tn})),n.d(e,"hasNode",(function(){return _n})),n.d(e,"activeNode",(function(){return kn})),n.d(e,"formatBlockElements",(function(){return gn})),n.d(e,"getBlockFormats",(function(){return bn})),n.d(e,"parentBlockFormat",(function(){return xn})),n.d(e,"changeTextBlock",(function(){return mn})),n.d(e,"blockNodes",(function(){return vn})),n.d(e,"cleanTextBlockFormatting",(function(){return yn})),n.d(e,"hasMark",(function(){return Qe})),n.d(e,"getMark",(function(){return nn})),n.d(e,"getActiveMarks",(function(){return rn})),n.d(e,"removeAllMarks",(function(){return Xe})),n.d(e,"cleanMarks",(function(){return Ze})),n.d(e,"selectionMarks",(function(){return en})),n.d(e,"indent",(function(){return Ar})),n.d(e,"canIndentAsListItem",(function(){return Or})),n.d(e,"outdent",(function(){return Nr})),n.d(e,"canOutdentAsListItem",(function(){return Dr})),n.d(e,"isIndented",(function(){return Mr})),n.d(e,"canBeIndented",(function(){return Ir})),n.d(e,"indentBlocks",(function(){return Er})),n.d(e,"toggleOrderedList",(function(){return $r})),n.d(e,"toggleUnorderedList",(function(){return jr})),n.d(e,"toggleList",(function(){return Vr})),n.d(e,"listStyle",(function(){return Lr})),n.d(e,"blockquote",(function(){return Sr})),n.d(e,"liftBlockquote",(function(){return Tr})),n.d(e,"hasSameMarkup",(function(){return Ve})),n.d(e,"getSelectionText",(function(){return je})),n.d(e,"getNodeFromSelection",(function(){return $e})),n.d(e,"selectedLineTextOnly",(function(){return We})),n.d(e,"expandSelection",(function(){return Je})),n.d(e,"expandToWordWrap",(function(){return Ke})),n.d(e,"canInsert",(function(){return Pe})),n.d(e,"insertNode",(function(){return Le})),n.d(e,"indentHtml",(function(){return He})),n.d(e,"alignLeftRules",(function(){return Hr})),n.d(e,"alignCenterRules",(function(){return Jr})),n.d(e,"alignRightRules",(function(){return qr})),n.d(e,"alignJustifyRules",(function(){return Kr})),n.d(e,"alignRemoveRules",(function(){return Ur})),n.d(e,"indentRules",(function(){return $n})),n.d(e,"outdentRules",(function(){return Wn})),n.d(e,"nodes",(function(){return Uc})),n.d(e,"marks",(function(){return $c})),n.d(e,"buildKeymap",(function(){return Fu})),n.d(e,"buildListKeymap",(function(){return Lu})),n.d(e,"bold",(function(){return Du})),n.d(e,"italic",(function(){return Iu})),n.d(e,"underline",(function(){return Au})),n.d(e,"strikethrough",(function(){return Nu})),n.d(e,"subscript",(function(){return Bu})),n.d(e,"superscript",(function(){return zu})),n.d(e,"link",(function(){return Pu})),n.d(e,"sanitize",(function(){return Gu})),n.d(e,"removeComments",(function(){return Yu})),n.d(e,"removeTag",(function(){return Xu})),n.d(e,"pasteCleanup",(function(){return rl})),n.d(e,"sanitizeClassAttr",(function(){return Qu})),n.d(e,"sanitizeStyleAttr",(function(){return nl})),n.d(e,"removeAttribute",(function(){return Zu})),n.d(e,"replaceImageSourcesFromRtf",(function(){return dl})),n.d(e,"convertMsLists",(function(){return Uu})),n.d(e,"find",(function(){return fl})),n.d(e,"findAt",(function(){return pl})),n.d(e,"findAll",(function(){return hl})),n.d(e,"replace",(function(){return ml})),n.d(e,"replaceAll",(function(){return vl})),n.d(e,"placeholder",(function(){return wl})),n.d(e,"spacesFix",(function(){return kl})),n.d(e,"textHighlight",(function(){return Sl})),n.d(e,"textHighlightKey",(function(){return Cl})),n.d(e,"imageResizing",(function(){return Bl})),n.d(e,"imageResizeKey",(function(){return Tl})),n.d(e,"caretColor",(function(){return Pl})),n.d(e,"caretColorKey",(function(){return zl})),n.d(e,"autoJoin",(function(){return gr})),n.d(e,"baseKeymap",(function(){return Cr})),n.d(e,"chainCommands",(function(){return yr})),n.d(e,"createParagraphNear",(function(){return or})),n.d(e,"deleteSelection",(function(){return Hn})),n.d(e,"exitCode",(function(){return rr})),n.d(e,"joinBackward",(function(){return qn})),n.d(e,"joinDown",(function(){return Qn})),n.d(e,"joinForward",(function(){return Gn})),n.d(e,"joinUp",(function(){return Zn})),n.d(e,"lift",(function(){return tr})),n.d(e,"liftEmptyBlock",(function(){return ir})),n.d(e,"macBaseKeymap",(function(){return xr})),n.d(e,"newlineInCode",(function(){return er})),n.d(e,"pcBaseKeymap",(function(){return _r})),n.d(e,"selectAll",(function(){return ur})),n.d(e,"selectNodeBackward",(function(){return Kn})),n.d(e,"selectNodeForward",(function(){return Yn})),n.d(e,"selectParentNode",(function(){return cr})),n.d(e,"selectTextblockEnd",(function(){return fr})),n.d(e,"selectTextblockStart",(function(){return pr})),n.d(e,"setBlockType",(function(){return mr})),n.d(e,"splitBlock",(function(){return sr})),n.d(e,"splitBlockKeepMarks",(function(){return ar})),n.d(e,"toggleMark",(function(){return vr})),n.d(e,"wrapIn",(function(){return hr})),n.d(e,"dropCursor",(function(){return Rl})),n.d(e,"GapCursor",(function(){return Ll})),n.d(e,"gapCursor",(function(){return jl})),n.d(e,"HistoryState",(function(){return eu})),n.d(e,"closeHistory",(function(){return uu})),n.d(e,"history",(function(){return pu})),n.d(e,"redo",(function(){return hu})),n.d(e,"redoDepth",(function(){return vu})),n.d(e,"undo",(function(){return fu})),n.d(e,"undoDepth",(function(){return mu})),n.d(e,"InputRule",(function(){return gu})),n.d(e,"closeDoubleQuote",(function(){return Cu})),n.d(e,"closeSingleQuote",(function(){return Tu})),n.d(e,"ellipsis",(function(){return xu})),n.d(e,"emDash",(function(){return _u})),n.d(e,"inputRules",(function(){return yu})),n.d(e,"openDoubleQuote",(function(){return ku})),n.d(e,"openSingleQuote",(function(){return Su})),n.d(e,"smartQuotes",(function(){return Eu})),n.d(e,"textblockTypeInputRule",(function(){return Ou})),n.d(e,"undoInputRule",(function(){return wu})),n.d(e,"wrappingInputRule",(function(){return Mu})),n.d(e,"keydownHandler",(function(){return uo})),n.d(e,"keymap",(function(){return co})),n.d(e,"ContentMatch",(function(){return N})),n.d(e,"DOMParser",(function(){return tt})),n.d(e,"DOMSerializer",(function(){return dt})),n.d(e,"Fragment",(function(){return i})),n.d(e,"Mark",(function(){return l})),n.d(e,"MarkType",(function(){return X})),n.d(e,"Node",(function(){return O})),n.d(e,"NodeRange",(function(){return T})),n.d(e,"NodeType",(function(){return K})),n.d(e,"ReplaceError",(function(){return d})),n.d(e,"ResolvedPos",(function(){return _})),n.d(e,"Schema",(function(){return Z})),n.d(e,"Slice",(function(){return p})),n.d(e,"addListNodes",(function(){return Bn})),n.d(e,"bulletList",(function(){return In})),n.d(e,"liftListItem",(function(){return Rn})),n.d(e,"listItem",(function(){return An})),n.d(e,"orderedList",(function(){return Dn})),n.d(e,"sinkListItem",(function(){return Fn})),n.d(e,"splitListItem",(function(){return Pn})),n.d(e,"wrapInList",(function(){return zn})),n.d(e,"AllSelection",(function(){return ae})),n.d(e,"EditorState",(function(){return ve})),n.d(e,"NodeSelection",(function(){return ie})),n.d(e,"Plugin",(function(){return be})),n.d(e,"PluginKey",(function(){return xe})),n.d(e,"Selection",(function(){return te})),n.d(e,"SelectionRange",(function(){return ne})),n.d(e,"TextSelection",(function(){return re})),n.d(e,"Transaction",(function(){return de})),n.d(e,"CellSelection",(function(){return Ma})),n.d(e,"TableMap",(function(){return ca})),n.d(e,"TableView",(function(){return wc})),n.d(e,"__clipCells",(function(){return Na})),n.d(e,"__insertCells",(function(){return Pa})),n.d(e,"__pastedCells",(function(){return Ia})),n.d(e,"addColSpan",(function(){return Ta})),n.d(e,"addColumn",(function(){return Xa})),n.d(e,"addColumnAfter",(function(){return Qa})),n.d(e,"addColumnBefore",(function(){return Za})),n.d(e,"addRow",(function(){return rc})),n.d(e,"cellAround",(function(){return ma})),n.d(e,"colCount",(function(){return xa})),n.d(e,"columnIsHeader",(function(){return Ea})),n.d(e,"columnResizing",(function(){return kc})),n.d(e,"columnResizingPluginKey",(function(){return xc})),n.d(e,"deleteColumn",(function(){return ec})),n.d(e,"deleteRow",(function(){return ac})),n.d(e,"deleteTable",(function(){return bc})),n.d(e,"findCell",(function(){return _a})),n.d(e,"fixTables",(function(){return Ga})),n.d(e,"fixTablesKey",(function(){return Ua})),n.d(e,"goToNextCell",(function(){return yc})),n.d(e,"handlePaste",(function(){return Wa})),n.d(e,"inSameTable",(function(){return wa})),n.d(e,"isInTable",(function(){return va})),n.d(e,"mergeCells",(function(){return uc})),n.d(e,"moveCellForward",(function(){return ba})),n.d(e,"nextCell",(function(){return ka})),n.d(e,"pointsAtCell",(function(){return ya})),n.d(e,"removeColSpan",(function(){return Sa})),n.d(e,"removeColumn",(function(){return tc})),n.d(e,"removeRow",(function(){return sc})),n.d(e,"rowIsHeader",(function(){return nc})),n.d(e,"selectedRect",(function(){return Ya})),n.d(e,"selectionCell",(function(){return ga})),n.d(e,"setAttr",(function(){return Ca})),n.d(e,"setCellAttr",(function(){return pc})),n.d(e,"splitCell",(function(){return lc})),n.d(e,"splitCellWithType",(function(){return dc})),n.d(e,"tableEditing",(function(){return Oc})),n.d(e,"tableEditingKey",(function(){return ha})),n.d(e,"tableNodeTypes",(function(){return fa})),n.d(e,"tableNodes",(function(){return pa})),n.d(e,"toggleHeader",(function(){return hc})),n.d(e,"toggleHeaderCell",(function(){return gc})),n.d(e,"toggleHeaderColumn",(function(){return vc})),n.d(e,"toggleHeaderRow",(function(){return mc})),n.d(e,"updateColumnsOnResize",(function(){return _c})),n.d(e,"AddMarkStep",(function(){return Vt})),n.d(e,"MapResult",(function(){return vt})),n.d(e,"Mapping",(function(){return yt})),n.d(e,"RemoveMarkStep",(function(){return jt})),n.d(e,"ReplaceAroundStep",(function(){return Et})),n.d(e,"ReplaceStep",(function(){return Tt})),n.d(e,"Step",(function(){return Ct})),n.d(e,"StepMap",(function(){return gt})),n.d(e,"StepResult",(function(){return St})),n.d(e,"Transform",(function(){return wt})),n.d(e,"TransformError",(function(){return bt})),n.d(e,"canJoin",(function(){return Bt})),n.d(e,"canSplit",(function(){return Nt})),n.d(e,"dropPoint",(function(){return Ft})),n.d(e,"findWrapping",(function(){return It})),n.d(e,"insertPoint",(function(){return Rt})),n.d(e,"joinPoint",(function(){return Pt})),n.d(e,"liftTarget",(function(){return Dt})),n.d(e,"replaceStep",(function(){return $t})),n.d(e,"Decoration",(function(){return Bs})),n.d(e,"DecorationSet",(function(){return Fs})),n.d(e,"EditorView",(function(){return Xs})),n.d(e,"__endComposition",(function(){return Cs})),n.d(e,"__parseFromClipboard",(function(){return Ji})),n.d(e,"__serializeForClipboard",(function(){return qi})),n.d(e,"createTable",(function(){return Jl})),n.d(e,"addRowAfter",(function(){return Gl})),n.d(e,"addRowBefore",(function(){return Ul})),n.d(e,"pmAddRowAfter",(function(){return ic})),n.d(e,"pmAddRowBefore",(function(){return oc})),r.prototype={constructor:r,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return-1==e?void 0:this.content[e+1]},update:function(t,e,n){var o=n&&n!=t?this.remove(n):this,i=o.find(t),s=o.content.slice();return-1==i?s.push(n||t,e):(s[i+1]=e,n&&(s[i]=n)),new r(s)},remove:function(t){var e=this.find(t);if(-1==e)return this;var n=this.content.slice();return n.splice(e,2),new r(n)},addToStart:function(t,e){return new r([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new r(n)},addBefore:function(t,e,n){var o=this.remove(e),i=o.content.slice(),s=o.find(t);return i.splice(-1==s?i.length:s,0,e,n),new r(i)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return(t=r.from(t)).size?new r(t.content.concat(this.subtract(t).content)):this},append:function(t){return(t=r.from(t)).size?new r(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=r.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},get size(){return this.content.length>>1}},r.from=function(t){if(t instanceof r)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new r(e)};var o=r;var i=function(t,e){if(this.content=t,this.size=e||0,null==e)for(var n=0;n<t.length;n++)this.size+=t[n].nodeSize},s={firstChild:{configurable:!0},lastChild:{configurable:!0},childCount:{configurable:!0}};i.prototype.nodesBetween=function(t,e,n,r,o){void 0===r&&(r=0);for(var i=0,s=0;s<e;i++){var a=this.content[i],c=s+a.nodeSize;if(c>t&&!1!==n(a,r+s,o,i)&&a.content.size){var u=s+1;a.nodesBetween(Math.max(0,t-u),Math.min(a.content.size,e-u),n,r+u)}s=c}},i.prototype.descendants=function(t){this.nodesBetween(0,this.size,t)},i.prototype.textBetween=function(t,e,n,r){var o="",i=!0;return this.nodesBetween(t,e,(function(s,a){s.isText?(o+=s.text.slice(Math.max(t,a)-a,e-a),i=!n):s.isLeaf&&r?(o+="function"==typeof r?r(s):r,i=!n):!i&&s.isBlock&&(o+=n,i=!0)}),0),o},i.prototype.append=function(t){if(!t.size)return this;if(!this.size)return t;var e=this.lastChild,n=t.firstChild,r=this.content.slice(),o=0;for(e.isText&&e.sameMarkup(n)&&(r[r.length-1]=e.withText(e.text+n.text),o=1);o<t.content.length;o++)r.push(t.content[o]);return new i(r,this.size+t.size)},i.prototype.cut=function(t,e){if(null==e&&(e=this.size),0==t&&e==this.size)return this;var n=[],r=0;if(e>t)for(var o=0,s=0;s<e;o++){var a=this.content[o],c=s+a.nodeSize;c>t&&((s<t||c>e)&&(a=a.isText?a.cut(Math.max(0,t-s),Math.min(a.text.length,e-s)):a.cut(Math.max(0,t-s-1),Math.min(a.content.size,e-s-1))),n.push(a),r+=a.nodeSize),s=c}return new i(n,r)},i.prototype.cutByIndex=function(t,e){return t==e?i.empty:0==t&&e==this.content.length?this:new i(this.content.slice(t,e))},i.prototype.replaceChild=function(t,e){var n=this.content[t];if(n==e)return this;var r=this.content.slice(),o=this.size+e.nodeSize-n.nodeSize;return r[t]=e,new i(r,o)},i.prototype.addToStart=function(t){return new i([t].concat(this.content),this.size+t.nodeSize)},i.prototype.addToEnd=function(t){return new i(this.content.concat(t),this.size+t.nodeSize)},i.prototype.eq=function(t){if(this.content.length!=t.content.length)return!1;for(var e=0;e<this.content.length;e++)if(!this.content[e].eq(t.content[e]))return!1;return!0},s.firstChild.get=function(){return this.content.length?this.content[0]:null},s.lastChild.get=function(){return this.content.length?this.content[this.content.length-1]:null},s.childCount.get=function(){return this.content.length},i.prototype.child=function(t){var e=this.content[t];if(!e)throw new RangeError("Index "+t+" out of range for "+this);return e},i.prototype.maybeChild=function(t){return this.content[t]},i.prototype.forEach=function(t){for(var e=0,n=0;e<this.content.length;e++){var r=this.content[e];t(r,n,e),n+=r.nodeSize}},i.prototype.findDiffStart=function(t,e){return void 0===e&&(e=0),function t(e,n,r){for(var o=0;;o++){if(o==e.childCount||o==n.childCount)return e.childCount==n.childCount?null:r;var i=e.child(o),s=n.child(o);if(i!=s){if(!i.sameMarkup(s))return r;if(i.isText&&i.text!=s.text){for(var a=0;i.text[a]==s.text[a];a++)r++;return r}if(i.content.size||s.content.size){var c=t(i.content,s.content,r+1);if(null!=c)return c}r+=i.nodeSize}else r+=i.nodeSize}}(this,t,e)},i.prototype.findDiffEnd=function(t,e,n){return void 0===e&&(e=this.size),void 0===n&&(n=t.size),function t(e,n,r,o){for(var i=e.childCount,s=n.childCount;;){if(0==i||0==s)return i==s?null:{a:r,b:o};var a=e.child(--i),c=n.child(--s),u=a.nodeSize;if(a!=c){if(!a.sameMarkup(c))return{a:r,b:o};if(a.isText&&a.text!=c.text){for(var l=0,d=Math.min(a.text.length,c.text.length);l<d&&a.text[a.text.length-l-1]==c.text[c.text.length-l-1];)l++,r--,o--;return{a:r,b:o}}if(a.content.size||c.content.size){var p=t(a.content,c.content,r-1,o-1);if(p)return p}r-=u,o-=u}else r-=u,o-=u}}(this,t,e,n)},i.prototype.findIndex=function(t,e){if(void 0===e&&(e=-1),0==t)return c(0,t);if(t==this.size)return c(this.content.length,t);if(t>this.size||t<0)throw new RangeError("Position "+t+" outside of fragment ("+this+")");for(var n=0,r=0;;n++){var o=r+this.child(n).nodeSize;if(o>=t)return o==t||e>0?c(n+1,o):c(n,r);r=o}},i.prototype.toString=function(){return"<"+this.toStringInner()+">"},i.prototype.toStringInner=function(){return this.content.join(", ")},i.prototype.toJSON=function(){return this.content.length?this.content.map((function(t){return t.toJSON()})):null},i.fromJSON=function(t,e){if(!e)return i.empty;if(!Array.isArray(e))throw new RangeError("Invalid input for Fragment.fromJSON");return new i(e.map(t.nodeFromJSON))},i.fromArray=function(t){if(!t.length)return i.empty;for(var e,n=0,r=0;r<t.length;r++){var o=t[r];n+=o.nodeSize,r&&o.isText&&t[r-1].sameMarkup(o)?(e||(e=t.slice(0,r)),e[e.length-1]=o.withText(e[e.length-1].text+o.text)):e&&e.push(o)}return new i(e||t,n)},i.from=function(t){if(!t)return i.empty;if(t instanceof i)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new i([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))},Object.defineProperties(i.prototype,s);var a={index:0,offset:0};function c(t,e){return a.index=t,a.offset=e,a}function u(t,e){if(t===e)return!0;if(!t||"object"!=typeof t||!e||"object"!=typeof e)return!1;var n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(var r=0;r<t.length;r++)if(!u(t[r],e[r]))return!1}else{for(var o in t)if(!(o in e)||!u(t[o],e[o]))return!1;for(var i in e)if(!(i in t))return!1}return!0}i.empty=new i([],0);var l=function(t,e){this.type=t,this.attrs=e};function d(t){var e=Error.call(this,t);return e.__proto__=d.prototype,e}l.prototype.addToSet=function(t){for(var e,n=!1,r=0;r<t.length;r++){var o=t[r];if(this.eq(o))return t;if(this.type.excludes(o.type))e||(e=t.slice(0,r));else{if(o.type.excludes(this.type))return t;!n&&o.type.rank>this.type.rank&&(e||(e=t.slice(0,r)),e.push(this),n=!0),e&&e.push(o)}}return e||(e=t.slice()),n||e.push(this),e},l.prototype.removeFromSet=function(t){for(var e=0;e<t.length;e++)if(this.eq(t[e]))return t.slice(0,e).concat(t.slice(e+1));return t},l.prototype.isInSet=function(t){for(var e=0;e<t.length;e++)if(this.eq(t[e]))return!0;return!1},l.prototype.eq=function(t){return this==t||this.type==t.type&&u(this.attrs,t.attrs)},l.prototype.toJSON=function(){var t={type:this.type.name};for(var e in this.attrs){t.attrs=this.attrs;break}return t},l.fromJSON=function(t,e){if(!e)throw new RangeError("Invalid input for Mark.fromJSON");var n=t.marks[e.type];if(!n)throw new RangeError("There is no mark type "+e.type+" in this schema");return n.create(e.attrs)},l.sameSet=function(t,e){if(t==e)return!0;if(t.length!=e.length)return!1;for(var n=0;n<t.length;n++)if(!t[n].eq(e[n]))return!1;return!0},l.setFrom=function(t){if(!t||0==t.length)return l.none;if(t instanceof l)return[t];var e=t.slice();return e.sort((function(t,e){return t.type.rank-e.type.rank})),e},l.none=[],d.prototype=Object.create(Error.prototype),d.prototype.constructor=d,d.prototype.name="ReplaceError";var p=function(t,e,n){this.content=t,this.openStart=e,this.openEnd=n},f={size:{configurable:!0}};function h(t,e,n){if(n.openStart>t.depth)throw new d("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new d("Inconsistent open depths");return function t(e,n,r,o){var s=e.index(o),a=e.node(o);if(s==n.index(o)&&o<e.depth-r.openStart){var c=t(e,n,r,o+1);return a.copy(a.content.replaceChild(s,c))}if(r.content.size){if(r.openStart||r.openEnd||e.depth!=o||n.depth!=o){var u=function(t,e){for(var n=e.depth-t.openStart,r=e.node(n).copy(t.content),o=n-1;o>=0;o--)r=e.node(o).copy(i.from(r));return{start:r.resolveNoCache(t.openStart+n),end:r.resolveNoCache(r.content.size-t.openEnd-n)}}(r,e),l=u.start,d=u.end;return b(a,function t(e,n,r,o,s){var a=e.depth>s&&v(e,n,s+1),c=o.depth>s&&v(r,o,s+1),u=[];y(null,e,s,u),a&&c&&n.index(s)==r.index(s)?(m(a,c),g(b(a,t(e,n,r,o,s+1)),u)):(a&&g(b(a,w(e,n,s+1)),u),y(n,r,s,u),c&&g(b(c,w(r,o,s+1)),u));return y(o,null,s,u),new i(u)}(e,l,d,n,o))}var p=e.parent,f=p.content;return b(p,f.cut(0,e.parentOffset).append(r.content).append(f.cut(n.parentOffset)))}return b(a,w(e,n,o))}(t,e,n,0)}function m(t,e){if(!e.type.compatibleContent(t.type))throw new d("Cannot join "+e.type.name+" onto "+t.type.name)}function v(t,e,n){var r=t.node(n);return m(r,e.node(n)),r}function g(t,e){var n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function y(t,e,n,r){var o=(e||t).node(n),i=0,s=e?e.index(n):o.childCount;t&&(i=t.index(n),t.depth>n?i++:t.textOffset&&(g(t.nodeAfter,r),i++));for(var a=i;a<s;a++)g(o.child(a),r);e&&e.depth==n&&e.textOffset&&g(e.nodeBefore,r)}function b(t,e){if(!t.type.validContent(e))throw new d("Invalid content for node "+t.type.name);return t.copy(e)}function w(t,e,n){var r=[];(y(null,t,n,r),t.depth>n)&&g(b(v(t,e,n+1),w(t,e,n+1)),r);return y(e,null,n,r),new i(r)}f.size.get=function(){return this.content.size-this.openStart-this.openEnd},p.prototype.insertAt=function(t,e){var n=function t(e,n,r,o){var i=e.findIndex(n),s=i.index,a=i.offset,c=e.maybeChild(s);if(a==n||c.isText)return o&&!o.canReplace(s,s,r)?null:e.cut(0,n).append(r).append(e.cut(n));var u=t(c.content,n-a-1,r);return u&&e.replaceChild(s,c.copy(u))}(this.content,t+this.openStart,e,null);return n&&new p(n,this.openStart,this.openEnd)},p.prototype.removeBetween=function(t,e){return new p(function t(e,n,r){var o=e.findIndex(n),i=o.index,s=o.offset,a=e.maybeChild(i),c=e.findIndex(r),u=c.index,l=c.offset;if(s==n||a.isText){if(l!=r&&!e.child(u).isText)throw new RangeError("Removing non-flat range");return e.cut(0,n).append(e.cut(r))}if(i!=u)throw new RangeError("Removing non-flat range");return e.replaceChild(i,a.copy(t(a.content,n-s-1,r-s-1)))}(this.content,t+this.openStart,e+this.openStart),this.openStart,this.openEnd)},p.prototype.eq=function(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd},p.prototype.toString=function(){return this.content+"("+this.openStart+","+this.openEnd+")"},p.prototype.toJSON=function(){if(!this.content.size)return null;var t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t},p.fromJSON=function(t,e){if(!e)return p.empty;var n=e.openStart||0,r=e.openEnd||0;if("number"!=typeof n||"number"!=typeof r)throw new RangeError("Invalid input for Slice.fromJSON");return new p(i.fromJSON(t,e.content),n,r)},p.maxOpen=function(t,e){void 0===e&&(e=!0);for(var n=0,r=0,o=t.firstChild;o&&!o.isLeaf&&(e||!o.type.spec.isolating);o=o.firstChild)n++;for(var i=t.lastChild;i&&!i.isLeaf&&(e||!i.type.spec.isolating);i=i.lastChild)r++;return new p(t,n,r)},Object.defineProperties(p.prototype,f),p.empty=new p(i.empty,0,0);var _=function(t,e,n){this.pos=t,this.path=e,this.depth=e.length/3-1,this.parentOffset=n},x={parent:{configurable:!0},doc:{configurable:!0},textOffset:{configurable:!0},nodeAfter:{configurable:!0},nodeBefore:{configurable:!0}};_.prototype.resolveDepth=function(t){return null==t?this.depth:t<0?this.depth+t:t},x.parent.get=function(){return this.node(this.depth)},x.doc.get=function(){return this.node(0)},_.prototype.node=function(t){return this.path[3*this.resolveDepth(t)]},_.prototype.index=function(t){return this.path[3*this.resolveDepth(t)+1]},_.prototype.indexAfter=function(t){return t=this.resolveDepth(t),this.index(t)+(t!=this.depth||this.textOffset?1:0)},_.prototype.start=function(t){return 0==(t=this.resolveDepth(t))?0:this.path[3*t-1]+1},_.prototype.end=function(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size},_.prototype.before=function(t){if(!(t=this.resolveDepth(t)))throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]},_.prototype.after=function(t){if(!(t=this.resolveDepth(t)))throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]+this.path[3*t].nodeSize},x.textOffset.get=function(){return this.pos-this.path[this.path.length-1]},x.nodeAfter.get=function(){var t=this.parent,e=this.index(this.depth);if(e==t.childCount)return null;var n=this.pos-this.path[this.path.length-1],r=t.child(e);return n?t.child(e).cut(n):r},x.nodeBefore.get=function(){var t=this.index(this.depth),e=this.pos-this.path[this.path.length-1];return e?this.parent.child(t).cut(0,e):0==t?null:this.parent.child(t-1)},_.prototype.posAtIndex=function(t,e){e=this.resolveDepth(e);for(var n=this.path[3*e],r=0==e?0:this.path[3*e-1]+1,o=0;o<t;o++)r+=n.child(o).nodeSize;return r},_.prototype.marks=function(){var t=this.parent,e=this.index();if(0==t.content.size)return l.none;if(this.textOffset)return t.child(e).marks;var n=t.maybeChild(e-1),r=t.maybeChild(e);if(!n){var o=n;n=r,r=o}for(var i=n.marks,s=0;s<i.length;s++)!1!==i[s].type.spec.inclusive||r&&i[s].isInSet(r.marks)||(i=i[s--].removeFromSet(i));return i},_.prototype.marksAcross=function(t){var e=this.parent.maybeChild(this.index());if(!e||!e.isInline)return null;for(var n=e.marks,r=t.parent.maybeChild(t.index()),o=0;o<n.length;o++)!1!==n[o].type.spec.inclusive||r&&n[o].isInSet(r.marks)||(n=n[o--].removeFromSet(n));return n},_.prototype.sharedDepth=function(t){for(var e=this.depth;e>0;e--)if(this.start(e)<=t&&this.end(e)>=t)return e;return 0},_.prototype.blockRange=function(t,e){if(void 0===t&&(t=this),t.pos<this.pos)return t.blockRange(this);for(var n=this.depth-(this.parent.inlineContent||this.pos==t.pos?1:0);n>=0;n--)if(t.pos<=this.end(n)&&(!e||e(this.node(n))))return new T(this,t,n)},_.prototype.sameParent=function(t){return this.pos-this.parentOffset==t.pos-t.parentOffset},_.prototype.max=function(t){return t.pos>this.pos?t:this},_.prototype.min=function(t){return t.pos<this.pos?t:this},_.prototype.toString=function(){for(var t="",e=1;e<=this.depth;e++)t+=(t?"/":"")+this.node(e).type.name+"_"+this.index(e-1);return t+":"+this.parentOffset},_.resolve=function(t,e){if(!(e>=0&&e<=t.content.size))throw new RangeError("Position "+e+" out of range");for(var n=[],r=0,o=e,i=t;;){var s=i.content.findIndex(o),a=s.index,c=s.offset,u=o-c;if(n.push(i,a,r+c),!u)break;if((i=i.child(a)).isText)break;o=u-1,r+=c+1}return new _(e,n,o)},_.resolveCached=function(t,e){for(var n=0;n<k.length;n++){var r=k[n];if(r.pos==e&&r.doc==t)return r}var o=k[C]=_.resolve(t,e);return C=(C+1)%S,o},Object.defineProperties(_.prototype,x);var k=[],C=0,S=12,T=function(t,e,n){this.$from=t,this.$to=e,this.depth=n},E={start:{configurable:!0},end:{configurable:!0},parent:{configurable:!0},startIndex:{configurable:!0},endIndex:{configurable:!0}};E.start.get=function(){return this.$from.before(this.depth+1)},E.end.get=function(){return this.$to.after(this.depth+1)},E.parent.get=function(){return this.$from.node(this.depth)},E.startIndex.get=function(){return this.$from.index(this.depth)},E.endIndex.get=function(){return this.$to.indexAfter(this.depth)},Object.defineProperties(T.prototype,E);var M=Object.create(null),O=function(t,e,n,r){this.type=t,this.attrs=e,this.content=n||i.empty,this.marks=r||l.none},D={nodeSize:{configurable:!0},childCount:{configurable:!0},textContent:{configurable:!0},firstChild:{configurable:!0},lastChild:{configurable:!0},isBlock:{configurable:!0},isTextblock:{configurable:!0},inlineContent:{configurable:!0},isInline:{configurable:!0},isText:{configurable:!0},isLeaf:{configurable:!0},isAtom:{configurable:!0}};D.nodeSize.get=function(){return this.isLeaf?1:2+this.content.size},D.childCount.get=function(){return this.content.childCount},O.prototype.child=function(t){return this.content.child(t)},O.prototype.maybeChild=function(t){return this.content.maybeChild(t)},O.prototype.forEach=function(t){this.content.forEach(t)},O.prototype.nodesBetween=function(t,e,n,r){void 0===r&&(r=0),this.content.nodesBetween(t,e,n,r,this)},O.prototype.descendants=function(t){this.nodesBetween(0,this.content.size,t)},D.textContent.get=function(){return this.textBetween(0,this.content.size,"")},O.prototype.textBetween=function(t,e,n,r){return this.content.textBetween(t,e,n,r)},D.firstChild.get=function(){return this.content.firstChild},D.lastChild.get=function(){return this.content.lastChild},O.prototype.eq=function(t){return this==t||this.sameMarkup(t)&&this.content.eq(t.content)},O.prototype.sameMarkup=function(t){return this.hasMarkup(t.type,t.attrs,t.marks)},O.prototype.hasMarkup=function(t,e,n){return this.type==t&&u(this.attrs,e||t.defaultAttrs||M)&&l.sameSet(this.marks,n||l.none)},O.prototype.copy=function(t){return void 0===t&&(t=null),t==this.content?this:new this.constructor(this.type,this.attrs,t,this.marks)},O.prototype.mark=function(t){return t==this.marks?this:new this.constructor(this.type,this.attrs,this.content,t)},O.prototype.cut=function(t,e){return 0==t&&e==this.content.size?this:this.copy(this.content.cut(t,e))},O.prototype.slice=function(t,e,n){if(void 0===e&&(e=this.content.size),void 0===n&&(n=!1),t==e)return p.empty;var r=this.resolve(t),o=this.resolve(e),i=n?0:r.sharedDepth(e),s=r.start(i),a=r.node(i).content.cut(r.pos-s,o.pos-s);return new p(a,r.depth-i,o.depth-i)},O.prototype.replace=function(t,e,n){return h(this.resolve(t),this.resolve(e),n)},O.prototype.nodeAt=function(t){for(var e=this;;){var n=e.content.findIndex(t),r=n.index,o=n.offset;if(!(e=e.maybeChild(r)))return null;if(o==t||e.isText)return e;t-=o+1}},O.prototype.childAfter=function(t){var e=this.content.findIndex(t),n=e.index,r=e.offset;return{node:this.content.maybeChild(n),index:n,offset:r}},O.prototype.childBefore=function(t){if(0==t)return{node:null,index:0,offset:0};var e=this.content.findIndex(t),n=e.index,r=e.offset;if(r<t)return{node:this.content.child(n),index:n,offset:r};var o=this.content.child(n-1);return{node:o,index:n-1,offset:r-o.nodeSize}},O.prototype.resolve=function(t){return _.resolveCached(this,t)},O.prototype.resolveNoCache=function(t){return _.resolve(this,t)},O.prototype.rangeHasMark=function(t,e,n){var r=!1;return e>t&&this.nodesBetween(t,e,(function(t){return n.isInSet(t.marks)&&(r=!0),!r})),r},D.isBlock.get=function(){return this.type.isBlock},D.isTextblock.get=function(){return this.type.isTextblock},D.inlineContent.get=function(){return this.type.inlineContent},D.isInline.get=function(){return this.type.isInline},D.isText.get=function(){return this.type.isText},D.isLeaf.get=function(){return this.type.isLeaf},D.isAtom.get=function(){return this.type.isAtom},O.prototype.toString=function(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);var t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),A(this.marks,t)},O.prototype.contentMatchAt=function(t){var e=this.type.contentMatch.matchFragment(this.content,0,t);if(!e)throw new Error("Called contentMatchAt on a node with invalid content");return e},O.prototype.canReplace=function(t,e,n,r,o){void 0===n&&(n=i.empty),void 0===r&&(r=0),void 0===o&&(o=n.childCount);var s=this.contentMatchAt(t).matchFragment(n,r,o),a=s&&s.matchFragment(this.content,e);if(!a||!a.validEnd)return!1;for(var c=r;c<o;c++)if(!this.type.allowsMarks(n.child(c).marks))return!1;return!0},O.prototype.canReplaceWith=function(t,e,n,r){if(r&&!this.type.allowsMarks(r))return!1;var o=this.contentMatchAt(t).matchType(n),i=o&&o.matchFragment(this.content,e);return!!i&&i.validEnd},O.prototype.canAppend=function(t){return t.content.size?this.canReplace(this.childCount,this.childCount,t.content):this.type.compatibleContent(t.type)},O.prototype.check=function(){if(!this.type.validContent(this.content))throw new RangeError("Invalid content for node "+this.type.name+": "+this.content.toString().slice(0,50));for(var t=l.none,e=0;e<this.marks.length;e++)t=this.marks[e].addToSet(t);if(!l.sameSet(t,this.marks))throw new RangeError("Invalid collection of marks for node "+this.type.name+": "+this.marks.map((function(t){return t.type.name})));this.content.forEach((function(t){return t.check()}))},O.prototype.toJSON=function(){var t={type:this.type.name};for(var e in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map((function(t){return t.toJSON()}))),t},O.fromJSON=function(t,e){if(!e)throw new RangeError("Invalid input for Node.fromJSON");var n=null;if(e.marks){if(!Array.isArray(e.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=e.marks.map(t.markFromJSON)}if("text"==e.type){if("string"!=typeof e.text)throw new RangeError("Invalid text node in JSON");return t.text(e.text,n)}var r=i.fromJSON(t,e.content);return t.nodeType(e.type).create(e.attrs,r,n)},Object.defineProperties(O.prototype,D);var I=function(t){function e(e,n,r,o){if(t.call(this,e,n,null,o),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={textContent:{configurable:!0},nodeSize:{configurable:!0}};return e.prototype.toString=function(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):A(this.marks,JSON.stringify(this.text))},n.textContent.get=function(){return this.text},e.prototype.textBetween=function(t,e){return this.text.slice(t,e)},n.nodeSize.get=function(){return this.text.length},e.prototype.mark=function(t){return t==this.marks?this:new e(this.type,this.attrs,this.text,t)},e.prototype.withText=function(t){return t==this.text?this:new e(this.type,this.attrs,t,this.marks)},e.prototype.cut=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.text.length),0==t&&e==this.text.length?this:this.withText(this.text.slice(t,e))},e.prototype.eq=function(t){return this.sameMarkup(t)&&this.text==t.text},e.prototype.toJSON=function(){var e=t.prototype.toJSON.call(this);return e.text=this.text,e},Object.defineProperties(e.prototype,n),e}(O);function A(t,e){for(var n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}var N=function(t){this.validEnd=t,this.next=[],this.wrapCache=[]},B={inlineContent:{configurable:!0},defaultType:{configurable:!0},edgeCount:{configurable:!0}};N.parse=function(t,e){var n=new z(t,e);if(null==n.next)return N.empty;var r=R(n);n.next&&n.err("Unexpected trailing text");var o=function(t){var e=Object.create(null);return function n(r){var o=[];r.forEach((function(e){t[e].forEach((function(e){var n=e.term,r=e.to;if(n){var i=o.indexOf(n),s=i>-1&&o[i+1];W(t,r).forEach((function(t){s||o.push(n,s=[]),-1==s.indexOf(t)&&s.push(t)}))}}))}));for(var i=e[r.join(",")]=new N(r.indexOf(t.length-1)>-1),s=0;s<o.length;s+=2){var a=o[s+1].sort($);i.next.push(o[s],e[a.join(",")]||n(a))}return i}(W(t,0))}(function(t){var e=[[]];return o(function t(e,i){if("choice"==e.type)return e.exprs.reduce((function(e,n){return e.concat(t(n,i))}),[]);if("seq"==e.type)for(var s=0;;s++){var a=t(e.exprs[s],i);if(s==e.exprs.length-1)return a;o(a,i=n())}else{if("star"==e.type){var c=n();return r(i,c),o(t(e.expr,c),c),[r(c)]}if("plus"==e.type){var u=n();return o(t(e.expr,i),u),o(t(e.expr,u),u),[r(u)]}if("opt"==e.type)return[r(i)].concat(t(e.expr,i));if("range"==e.type){for(var l=i,d=0;d<e.min;d++){var p=n();o(t(e.expr,l),p),l=p}if(-1==e.max)o(t(e.expr,l),l);else for(var f=e.min;f<e.max;f++){var h=n();r(l,h),o(t(e.expr,l),h),l=h}return[r(l)]}if("name"==e.type)return[r(i,null,e.value)]}}(t,0),n()),e;function n(){return e.push([])-1}function r(t,n,r){var o={term:r,to:n};return e[t].push(o),o}function o(t,e){t.forEach((function(t){return t.to=e}))}}(r));return function(t,e){for(var n=0,r=[t];n<r.length;n++){for(var o=r[n],i=!o.validEnd,s=[],a=0;a<o.next.length;a+=2){var c=o.next[a],u=o.next[a+1];s.push(c.name),!i||c.isText||c.hasRequiredAttrs()||(i=!1),-1==r.indexOf(u)&&r.push(u)}i&&e.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(o,n),o},N.prototype.matchType=function(t){for(var e=0;e<this.next.length;e+=2)if(this.next[e]==t)return this.next[e+1];return null},N.prototype.matchFragment=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=t.childCount);for(var r=this,o=e;r&&o<n;o++)r=r.matchType(t.child(o).type);return r},B.inlineContent.get=function(){var t=this.next[0];return!!t&&t.isInline},B.defaultType.get=function(){for(var t=0;t<this.next.length;t+=2){var e=this.next[t];if(!e.isText&&!e.hasRequiredAttrs())return e}},N.prototype.compatible=function(t){for(var e=0;e<this.next.length;e+=2)for(var n=0;n<t.next.length;n+=2)if(this.next[e]==t.next[n])return!0;return!1},N.prototype.fillBefore=function(t,e,n){void 0===e&&(e=!1),void 0===n&&(n=0);var r=[this];return function o(s,a){var c=s.matchFragment(t,n);if(c&&(!e||c.validEnd))return i.from(a.map((function(t){return t.createAndFill()})));for(var u=0;u<s.next.length;u+=2){var l=s.next[u],d=s.next[u+1];if(!l.isText&&!l.hasRequiredAttrs()&&-1==r.indexOf(d)){r.push(d);var p=o(d,a.concat(l));if(p)return p}}}(this,[])},N.prototype.findWrapping=function(t){for(var e=0;e<this.wrapCache.length;e+=2)if(this.wrapCache[e]==t)return this.wrapCache[e+1];var n=this.computeWrapping(t);return this.wrapCache.push(t,n),n},N.prototype.computeWrapping=function(t){for(var e=Object.create(null),n=[{match:this,type:null,via:null}];n.length;){var r=n.shift(),o=r.match;if(o.matchType(t)){for(var i=[],s=r;s.type;s=s.via)i.push(s.type);return i.reverse()}for(var a=0;a<o.next.length;a+=2){var c=o.next[a];c.isLeaf||c.hasRequiredAttrs()||c.name in e||r.type&&!o.next[a+1].validEnd||(n.push({match:c.contentMatch,type:c,via:r}),e[c.name]=!0)}}},B.edgeCount.get=function(){return this.next.length>>1},N.prototype.edge=function(t){var e=t<<1;if(e>=this.next.length)throw new RangeError("There's no "+t+"th edge in this content match");return{type:this.next[e],next:this.next[e+1]}},N.prototype.toString=function(){var t=[];return function e(n){t.push(n);for(var r=1;r<n.next.length;r+=2)-1==t.indexOf(n.next[r])&&e(n.next[r])}(this),t.map((function(e,n){for(var r=n+(e.validEnd?"*":" ")+" ",o=0;o<e.next.length;o+=2)r+=(o?", ":"")+e.next[o].name+"->"+t.indexOf(e.next[o+1]);return r})).join("\n")},Object.defineProperties(N.prototype,B),N.empty=new N(!0);var z=function(t,e){this.string=t,this.nodeTypes=e,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()},P={next:{configurable:!0}};function R(t){var e=[];do{e.push(F(t))}while(t.eat("|"));return 1==e.length?e[0]:{type:"choice",exprs:e}}function F(t){var e=[];do{e.push(L(t))}while(t.next&&")"!=t.next&&"|"!=t.next);return 1==e.length?e[0]:{type:"seq",exprs:e}}function L(t){for(var e=function(t){if(t.eat("(")){var e=R(t);return t.eat(")")||t.err("Missing closing paren"),e}if(!/\W/.test(t.next)){var n=function(t,e){var n=t.nodeTypes,r=n[e];if(r)return[r];var o=[];for(var i in n){var s=n[i];s.groups.indexOf(e)>-1&&o.push(s)}0==o.length&&t.err("No node type or group '"+e+"' found");return o}(t,t.next).map((function(e){return null==t.inline?t.inline=e.isInline:t.inline!=e.isInline&&t.err("Mixing inline and block content"),{type:"name",value:e}}));return t.pos++,1==n.length?n[0]:{type:"choice",exprs:n}}t.err("Unexpected token '"+t.next+"'")}(t);;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else{if(!t.eat("{"))break;e=j(t,e)}return e}function V(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");var e=Number(t.next);return t.pos++,e}function j(t,e){var n=V(t),r=n;return t.eat(",")&&(r="}"!=t.next?V(t):-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function $(t,e){return e-t}function W(t,e){var n=[];return function e(r){var o=t[r];if(1==o.length&&!o[0].term)return e(o[0].to);n.push(r);for(var i=0;i<o.length;i++){var s=o[i],a=s.term,c=s.to;a||-1!=n.indexOf(c)||e(c)}}(e),n.sort($)}function H(t){var e=Object.create(null);for(var n in t){var r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function q(t,e){var n=Object.create(null);for(var r in t){var o=e&&e[r];if(void 0===o){var i=t[r];if(!i.hasDefault)throw new RangeError("No value supplied for attribute "+r);o=i.default}n[r]=o}return n}function J(t){var e=Object.create(null);if(t)for(var n in t)e[n]=new G(t[n]);return e}P.next.get=function(){return this.tokens[this.pos]},z.prototype.eat=function(t){return this.next==t&&(this.pos++||!0)},z.prototype.err=function(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")},Object.defineProperties(z.prototype,P);var K=function(t,e,n){this.name=t,this.schema=e,this.spec=n,this.groups=n.group?n.group.split(" "):[],this.attrs=J(n.attrs),this.defaultAttrs=H(this.attrs),this.contentMatch=null,this.markSet=null,this.inlineContent=null,this.isBlock=!(n.inline||"text"==t),this.isText="text"==t},U={isInline:{configurable:!0},isTextblock:{configurable:!0},isLeaf:{configurable:!0},isAtom:{configurable:!0},whitespace:{configurable:!0}};U.isInline.get=function(){return!this.isBlock},U.isTextblock.get=function(){return this.isBlock&&this.inlineContent},U.isLeaf.get=function(){return this.contentMatch==N.empty},U.isAtom.get=function(){return this.isLeaf||this.spec.atom},U.whitespace.get=function(){return this.spec.whitespace||(this.spec.code?"pre":"normal")},K.prototype.hasRequiredAttrs=function(){for(var t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1},K.prototype.compatibleContent=function(t){return this==t||this.contentMatch.compatible(t.contentMatch)},K.prototype.computeAttrs=function(t){return!t&&this.defaultAttrs?this.defaultAttrs:q(this.attrs,t)},K.prototype.create=function(t,e,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new O(this,this.computeAttrs(t),i.from(e),l.setFrom(n))},K.prototype.createChecked=function(t,e,n){if(e=i.from(e),!this.validContent(e))throw new RangeError("Invalid content for node "+this.name);return new O(this,this.computeAttrs(t),e,l.setFrom(n))},K.prototype.createAndFill=function(t,e,n){if(t=this.computeAttrs(t),(e=i.from(e)).size){var r=this.contentMatch.fillBefore(e);if(!r)return null;e=r.append(e)}var o=this.contentMatch.matchFragment(e).fillBefore(i.empty,!0);return o?new O(this,t,e.append(o),l.setFrom(n)):null},K.prototype.validContent=function(t){var e=this.contentMatch.matchFragment(t);if(!e||!e.validEnd)return!1;for(var n=0;n<t.childCount;n++)if(!this.allowsMarks(t.child(n).marks))return!1;return!0},K.prototype.allowsMarkType=function(t){return null==this.markSet||this.markSet.indexOf(t)>-1},K.prototype.allowsMarks=function(t){if(null==this.markSet)return!0;for(var e=0;e<t.length;e++)if(!this.allowsMarkType(t[e].type))return!1;return!0},K.prototype.allowedMarks=function(t){if(null==this.markSet)return t;for(var e,n=0;n<t.length;n++)this.allowsMarkType(t[n].type)?e&&e.push(t[n]):e||(e=t.slice(0,n));return e?e.length?e:l.empty:t},K.compile=function(t,e){var n=Object.create(null);t.forEach((function(t,r){return n[t]=new K(t,e,r)}));var r=e.spec.topNode||"doc";if(!n[r])throw new RangeError("Schema is missing its top node type ('"+r+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(var o in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n},Object.defineProperties(K.prototype,U);var G=function(t){this.hasDefault=Object.prototype.hasOwnProperty.call(t,"default"),this.default=t.default},Y={isRequired:{configurable:!0}};Y.isRequired.get=function(){return!this.hasDefault},Object.defineProperties(G.prototype,Y);var X=function(t,e,n,r){this.name=t,this.schema=n,this.spec=r,this.attrs=J(r.attrs),this.rank=e,this.excluded=null;var o=H(this.attrs);this.instance=o&&new l(this,o)};X.prototype.create=function(t){return!t&&this.instance?this.instance:new l(this,q(this.attrs,t))},X.compile=function(t,e){var n=Object.create(null),r=0;return t.forEach((function(t,o){return n[t]=new X(t,r++,e,o)})),n},X.prototype.removeFromSet=function(t){for(var e=0;e<t.length;e++)t[e].type==this&&(t=t.slice(0,e).concat(t.slice(e+1)),e--);return t},X.prototype.isInSet=function(t){for(var e=0;e<t.length;e++)if(t[e].type==this)return t[e]},X.prototype.excludes=function(t){return this.excluded.indexOf(t)>-1};var Z=function(t){for(var e in this.spec={},t)this.spec[e]=t[e];this.spec.nodes=o.from(t.nodes),this.spec.marks=o.from(t.marks),this.nodes=K.compile(this.spec.nodes,this),this.marks=X.compile(this.spec.marks,this);var n=Object.create(null);for(var r in this.nodes){if(r in this.marks)throw new RangeError(r+" can not be both a node and a mark");var i=this.nodes[r],s=i.spec.content||"",a=i.spec.marks;i.contentMatch=n[s]||(n[s]=N.parse(s,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.markSet="_"==a?null:a?Q(this,a.split(" ")):""!=a&&i.inlineContent?null:[]}for(var c in this.marks){var u=this.marks[c],l=u.spec.excludes;u.excluded=null==l?[u]:""==l?[]:Q(this,l.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached=Object.create(null),this.cached.wrappings=Object.create(null)};function Q(t,e){for(var n=[],r=0;r<e.length;r++){var o=e[r],i=t.marks[o],s=i;if(i)n.push(i);else for(var a in t.marks){var c=t.marks[a];("_"==o||c.spec.group&&c.spec.group.split(" ").indexOf(o)>-1)&&n.push(s=c)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}Z.prototype.node=function(t,e,n,r){if("string"==typeof t)t=this.nodeType(t);else{if(!(t instanceof K))throw new RangeError("Invalid node type: "+t);if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}return t.createChecked(e,n,r)},Z.prototype.text=function(t,e){var n=this.nodes.text;return new I(n,n.defaultAttrs,t,l.setFrom(e))},Z.prototype.mark=function(t,e){return"string"==typeof t&&(t=this.marks[t]),t.create(e)},Z.prototype.nodeFromJSON=function(t){return O.fromJSON(this,t)},Z.prototype.markFromJSON=function(t){return l.fromJSON(this,t)},Z.prototype.nodeType=function(t){var e=this.nodes[t];if(!e)throw new RangeError("Unknown node type: "+t);return e};var tt=function(t,e){var n=this;this.schema=t,this.rules=e,this.tags=[],this.styles=[],e.forEach((function(t){t.tag?n.tags.push(t):t.style&&n.styles.push(t)})),this.normalizeLists=!this.tags.some((function(e){if(!/^(ul|ol)\b/.test(e.tag)||!e.node)return!1;var n=t.nodes[e.node];return n.contentMatch.matchType(n)}))};tt.prototype.parse=function(t,e){void 0===e&&(e={});var n=new st(this,e,!1);return n.addAll(t,null,e.from,e.to),n.finish()},tt.prototype.parseSlice=function(t,e){void 0===e&&(e={});var n=new st(this,e,!0);return n.addAll(t,null,e.from,e.to),p.maxOpen(n.finish())},tt.prototype.matchTag=function(t,e,n){for(var r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){var o=this.tags[r];if(ct(t,o.tag)&&(void 0===o.namespace||t.namespaceURI==o.namespace)&&(!o.context||e.matchesContext(o.context))){if(o.getAttrs){var i=o.getAttrs(t);if(!1===i)continue;o.attrs=i}return o}}},tt.prototype.matchStyle=function(t,e,n,r){for(var o=r?this.styles.indexOf(r)+1:0;o<this.styles.length;o++){var i=this.styles[o];if(!(0!=i.style.indexOf(t)||i.context&&!n.matchesContext(i.context)||i.style.length>t.length&&(61!=i.style.charCodeAt(t.length)||i.style.slice(t.length+1)!=e))){if(i.getAttrs){var s=i.getAttrs(e);if(!1===s)continue;i.attrs=s}return i}}},tt.schemaRules=function(t){var e=[];function n(t){for(var n=null==t.priority?50:t.priority,r=0;r<e.length;r++){var o=e[r];if((null==o.priority?50:o.priority)<n)break}e.splice(r,0,t)}var r=function(e){var r=t.marks[e].spec.parseDOM;r&&r.forEach((function(t){n(t=ut(t)),t.mark=e}))};for(var o in t.marks)r(o);var i;for(var s in t.nodes)i=void 0,(i=t.nodes[s].spec.parseDOM)&&i.forEach((function(t){n(t=ut(t)),t.node=s}));return e},tt.fromSchema=function(t){return t.cached.domParser||(t.cached.domParser=new tt(t,tt.schemaRules(t)))};var et={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},nt={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},rt={ol:!0,ul:!0};function ot(t,e,n){return null!=e?(e?1:0)|("full"===e?2:0):t&&"pre"==t.whitespace?3:-5&n}var it=function(t,e,n,r,o,i,s){this.type=t,this.attrs=e,this.solid=o,this.match=i||(4&s?null:t.contentMatch),this.options=s,this.content=[],this.marks=n,this.activeMarks=l.none,this.pendingMarks=r,this.stashMarks=[]};it.prototype.findWrapping=function(t){if(!this.match){if(!this.type)return[];var e=this.type.contentMatch.fillBefore(i.from(t));if(!e){var n,r=this.type.contentMatch;return(n=r.findWrapping(t.type))?(this.match=r,n):null}this.match=this.type.contentMatch.matchFragment(e)}return this.match.findWrapping(t.type)},it.prototype.finish=function(t){if(!(1&this.options)){var e,n=this.content[this.content.length-1];n&&n.isText&&(e=/[ \t\r\n\u000c]+$/.exec(n.text))&&(n.text.length==e[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-e[0].length)))}var r=i.from(this.content);return!t&&this.match&&(r=r.append(this.match.fillBefore(i.empty,!0))),this.type?this.type.create(this.attrs,r,this.marks):r},it.prototype.popFromStashMark=function(t){for(var e=this.stashMarks.length-1;e>=0;e--)if(t.eq(this.stashMarks[e]))return this.stashMarks.splice(e,1)[0]},it.prototype.applyPending=function(t){for(var e=0,n=this.pendingMarks;e<n.length;e++){var r=n[e];(this.type?this.type.allowsMarkType(r.type):lt(r.type,t))&&!r.isInSet(this.activeMarks)&&(this.activeMarks=r.addToSet(this.activeMarks),this.pendingMarks=r.removeFromSet(this.pendingMarks))}},it.prototype.inlineContext=function(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!et.hasOwnProperty(t.parentNode.nodeName.toLowerCase())};var st=function(t,e,n){this.parser=t,this.options=e,this.isOpen=n;var r,o=e.topNode,i=ot(null,e.preserveWhitespace,0)|(n?4:0);r=o?new it(o.type,o.attrs,l.none,l.none,!0,e.topMatch||o.type.contentMatch,i):new it(n?null:t.schema.topNodeType,null,l.none,l.none,!0,null,i),this.nodes=[r],this.open=0,this.find=e.findPositions,this.needsBlock=!1},at={top:{configurable:!0},currentPos:{configurable:!0}};function ct(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function ut(t){var e={};for(var n in t)e[n]=t[n];return e}function lt(t,e){var n=e.schema.nodes,r=function(r){var o=n[r];if(o.allowsMarkType(t)){var i=[],s=function(t){i.push(t);for(var n=0;n<t.edgeCount;n++){var r=t.edge(n),o=r.type,a=r.next;if(o==e)return!0;if(i.indexOf(a)<0&&s(a))return!0}};return s(o.contentMatch)?{v:!0}:void 0}};for(var o in n){var i=r(o);if(i)return i.v}}at.top.get=function(){return this.nodes[this.open]},st.prototype.addDOM=function(t){if(3==t.nodeType)this.addTextNode(t);else if(1==t.nodeType){var e=t.getAttribute("style"),n=e?this.readStyles(function(t){var e,n=/\s*([\w-]+)\s*:\s*([^;]+)/g,r=[];for(;e=n.exec(t);)r.push(e[1],e[2].trim());return r}(e)):null,r=this.top;if(null!=n)for(var o=0;o<n.length;o++)this.addPendingMark(n[o]);if(this.addElement(t),null!=n)for(var i=0;i<n.length;i++)this.removePendingMark(n[i],r)}},st.prototype.addTextNode=function(t){var e=t.nodeValue,n=this.top;if(2&n.options||n.inlineContext(t)||/[^ \t\r\n\u000c]/.test(e)){if(1&n.options)e=2&n.options?e.replace(/\r\n?/g,"\n"):e.replace(/\r?\n|\r/g," ");else if(e=e.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(e)&&this.open==this.nodes.length-1){var r=n.content[n.content.length-1],o=t.previousSibling;(!r||o&&"BR"==o.nodeName||r.isText&&/[ \t\r\n\u000c]$/.test(r.text))&&(e=e.slice(1))}e&&this.insertNode(this.parser.schema.text(e)),this.findInText(t)}else this.findInside(t)},st.prototype.addElement=function(t,e){var n,r=t.nodeName.toLowerCase();rt.hasOwnProperty(r)&&this.parser.normalizeLists&&function(t){for(var e=t.firstChild,n=null;e;e=e.nextSibling){var r=1==e.nodeType?e.nodeName.toLowerCase():null;r&&rt.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):"li"==r?n=e:r&&(n=null)}}(t);var o=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(n=this.parser.matchTag(t,this,e));if(o?o.ignore:nt.hasOwnProperty(r))this.findInside(t),this.ignoreFallback(t);else if(!o||o.skip||o.closeParent){o&&o.closeParent?this.open=Math.max(0,this.open-1):o&&o.skip.nodeType&&(t=o.skip);var i,s=this.top,a=this.needsBlock;if(et.hasOwnProperty(r))i=!0,s.type||(this.needsBlock=!0);else if(!t.firstChild)return void this.leafFallback(t);this.addAll(t),i&&this.sync(s),this.needsBlock=a}else this.addElementByRule(t,o,!1===o.consuming?n:null)},st.prototype.leafFallback=function(t){"BR"==t.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode("\n"))},st.prototype.ignoreFallback=function(t){"BR"!=t.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"))},st.prototype.readStyles=function(t){var e=l.none;t:for(var n=0;n<t.length;n+=2)for(var r=null;;){var o=this.parser.matchStyle(t[n],t[n+1],this,r);if(!o)continue t;if(o.ignore)return null;if(e=this.parser.schema.marks[o.mark].create(o.attrs).addToSet(e),!1!==o.consuming)break;r=o}return e},st.prototype.addElementByRule=function(t,e,n){var r,o,i,s=this;e.node?(o=this.parser.schema.nodes[e.node]).isLeaf?this.insertNode(o.create(e.attrs))||this.leafFallback(t):r=this.enter(o,e.attrs,e.preserveWhitespace):(i=this.parser.schema.marks[e.mark].create(e.attrs),this.addPendingMark(i));var a=this.top;if(o&&o.isLeaf)this.findInside(t);else if(n)this.addElement(t,n);else if(e.getContent)this.findInside(t),e.getContent(t,this.parser.schema).forEach((function(t){return s.insertNode(t)}));else{var c=e.contentElement;"string"==typeof c?c=t.querySelector(c):"function"==typeof c&&(c=c(t)),c||(c=t),this.findAround(t,c,!0),this.addAll(c,r)}r&&(this.sync(a),this.open--),i&&this.removePendingMark(i,a)},st.prototype.addAll=function(t,e,n,r){for(var o=n||0,i=n?t.childNodes[n]:t.firstChild,s=null==r?null:t.childNodes[r];i!=s;i=i.nextSibling,++o)this.findAtPoint(t,o),this.addDOM(i),e&&et.hasOwnProperty(i.nodeName.toLowerCase())&&this.sync(e);this.findAtPoint(t,o)},st.prototype.findPlace=function(t){for(var e,n,r=this.open;r>=0;r--){var o=this.nodes[r],i=o.findWrapping(t);if(i&&(!e||e.length>i.length)&&(e=i,n=o,!i.length))break;if(o.solid)break}if(!e)return!1;this.sync(n);for(var s=0;s<e.length;s++)this.enterInner(e[s],null,!1);return!0},st.prototype.insertNode=function(t){if(t.isInline&&this.needsBlock&&!this.top.type){var e=this.textblockFromContext();e&&this.enterInner(e)}if(this.findPlace(t)){this.closeExtra();var n=this.top;n.applyPending(t.type),n.match&&(n.match=n.match.matchType(t.type));for(var r=n.activeMarks,o=0;o<t.marks.length;o++)n.type&&!n.type.allowsMarkType(t.marks[o].type)||(r=t.marks[o].addToSet(r));return n.content.push(t.mark(r)),!0}return!1},st.prototype.enter=function(t,e,n){var r=this.findPlace(t.create(e));return r&&this.enterInner(t,e,!0,n),r},st.prototype.enterInner=function(t,e,n,r){this.closeExtra();var o=this.top;o.applyPending(t),o.match=o.match&&o.match.matchType(t,e);var i=ot(t,r,o.options);4&o.options&&0==o.content.length&&(i|=4),this.nodes.push(new it(t,e,o.activeMarks,o.pendingMarks,n,null,i)),this.open++},st.prototype.closeExtra=function(t){var e=this.nodes.length-1;if(e>this.open){for(;e>this.open;e--)this.nodes[e-1].content.push(this.nodes[e].finish(t));this.nodes.length=this.open+1}},st.prototype.finish=function(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)},st.prototype.sync=function(t){for(var e=this.open;e>=0;e--)if(this.nodes[e]==t)return void(this.open=e)},at.currentPos.get=function(){this.closeExtra();for(var t=0,e=this.open;e>=0;e--){for(var n=this.nodes[e].content,r=n.length-1;r>=0;r--)t+=n[r].nodeSize;e&&t++}return t},st.prototype.findAtPoint=function(t,e){if(this.find)for(var n=0;n<this.find.length;n++)this.find[n].node==t&&this.find[n].offset==e&&(this.find[n].pos=this.currentPos)},st.prototype.findInside=function(t){if(this.find)for(var e=0;e<this.find.length;e++)null==this.find[e].pos&&1==t.nodeType&&t.contains(this.find[e].node)&&(this.find[e].pos=this.currentPos)},st.prototype.findAround=function(t,e,n){if(t!=e&&this.find)for(var r=0;r<this.find.length;r++){if(null==this.find[r].pos&&1==t.nodeType&&t.contains(this.find[r].node))e.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}},st.prototype.findInText=function(t){if(this.find)for(var e=0;e<this.find.length;e++)this.find[e].node==t&&(this.find[e].pos=this.currentPos-(t.nodeValue.length-this.find[e].offset))},st.prototype.matchesContext=function(t){var e=this;if(t.indexOf("|")>-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);var n=t.split("/"),r=this.options.context,o=!(this.isOpen||r&&r.parent.type!=this.nodes[0].type),i=-(r?r.depth+1:0)+(o?0:1),s=function(t,a){for(;t>=0;t--){var c=n[t];if(""==c){if(t==n.length-1||0==t)continue;for(;a>=i;a--)if(s(t-1,a))return!0;return!1}var u=a>0||0==a&&o?e.nodes[a].type:r&&a>=i?r.node(a-i).type:null;if(!u||u.name!=c&&-1==u.groups.indexOf(c))return!1;a--}return!0};return s(n.length-1,this.open)},st.prototype.textblockFromContext=function(){var t=this.options.context;if(t)for(var e=t.depth;e>=0;e--){var n=t.node(e).contentMatchAt(t.indexAfter(e)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(var r in this.parser.schema.nodes){var o=this.parser.schema.nodes[r];if(o.isTextblock&&o.defaultAttrs)return o}},st.prototype.addPendingMark=function(t){var e=function(t,e){for(var n=0;n<e.length;n++)if(t.eq(e[n]))return e[n]}(t,this.top.pendingMarks);e&&this.top.stashMarks.push(e),this.top.pendingMarks=t.addToSet(this.top.pendingMarks)},st.prototype.removePendingMark=function(t,e){for(var n=this.open;n>=0;n--){var r=this.nodes[n];if(r.pendingMarks.lastIndexOf(t)>-1)r.pendingMarks=t.removeFromSet(r.pendingMarks);else{r.activeMarks=t.removeFromSet(r.activeMarks);var o=r.popFromStashMark(t);o&&r.type&&r.type.allowsMarkType(o.type)&&(r.activeMarks=o.addToSet(r.activeMarks))}if(r==e)break}},Object.defineProperties(st.prototype,at);var dt=function(t,e){this.nodes=t||{},this.marks=e||{}};function pt(t){var e={};for(var n in t){var r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function ft(t){return t.document||window.document}dt.prototype.serializeFragment=function(t,e,n){var r=this;void 0===e&&(e={}),n||(n=ft(e).createDocumentFragment());var o=n,i=null;return t.forEach((function(t){if(i||t.marks.length){i||(i=[]);for(var n=0,s=0;n<i.length&&s<t.marks.length;){var a=t.marks[s];if(r.marks[a.type.name]){if(!a.eq(i[n])||!1===a.type.spec.spanning)break;n+=2,s++}else s++}for(;n<i.length;)o=i.pop(),i.pop();for(;s<t.marks.length;){var c=t.marks[s++],u=r.serializeMark(c,t.isInline,e);u&&(i.push(c,o),o.appendChild(u.dom),o=u.contentDOM||u.dom)}}o.appendChild(r.serializeNodeInner(t,e))})),n},dt.prototype.serializeNodeInner=function(t,e){void 0===e&&(e={});var n=dt.renderSpec(ft(e),this.nodes[t.type.name](t)),r=n.dom,o=n.contentDOM;if(o){if(t.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");e.onContent?e.onContent(t,o,e):this.serializeFragment(t.content,e,o)}return r},dt.prototype.serializeNode=function(t,e){void 0===e&&(e={});for(var n=this.serializeNodeInner(t,e),r=t.marks.length-1;r>=0;r--){var o=this.serializeMark(t.marks[r],t.isInline,e);o&&((o.contentDOM||o.dom).appendChild(n),n=o.dom)}return n},dt.prototype.serializeMark=function(t,e,n){void 0===n&&(n={});var r=this.marks[t.type.name];return r&&dt.renderSpec(ft(n),r(t,e))},dt.renderSpec=function(t,e,n){if(void 0===n&&(n=null),"string"==typeof e)return{dom:t.createTextNode(e)};if(null!=e.nodeType)return{dom:e};if(e.dom&&null!=e.dom.nodeType)return e;var r=e[0],o=r.indexOf(" ");o>0&&(n=r.slice(0,o),r=r.slice(o+1));var i=null,s=n?t.createElementNS(n,r):t.createElement(r),a=e[1],c=1;if(a&&"object"==typeof a&&null==a.nodeType&&!Array.isArray(a))for(var u in c=2,a)if(null!=a[u]){var l=u.indexOf(" ");l>0?s.setAttributeNS(u.slice(0,l),u.slice(l+1),a[u]):s.setAttribute(u,a[u])}for(var d=c;d<e.length;d++){var p=e[d];if(0===p){if(d<e.length-1||d>c)throw new RangeError("Content hole must be the only child of its parent node");return{dom:s,contentDOM:s}}var f=dt.renderSpec(t,p,n),h=f.dom,m=f.contentDOM;if(s.appendChild(h),m){if(i)throw new RangeError("Multiple content holes");i=m}}return{dom:s,contentDOM:i}},dt.fromSchema=function(t){return t.cached.domSerializer||(t.cached.domSerializer=new dt(this.nodesFromSchema(t),this.marksFromSchema(t)))},dt.nodesFromSchema=function(t){var e=pt(t.nodes);return e.text||(e.text=function(t){return t.text}),e},dt.marksFromSchema=function(t){return pt(t.marks)};var ht=Math.pow(2,16);function mt(t){return 65535&t}var vt=function(t,e,n){void 0===e&&(e=!1),void 0===n&&(n=null),this.pos=t,this.deleted=e,this.recover=n},gt=function t(e,n){if(void 0===n&&(n=!1),!e.length&&t.empty)return t.empty;this.ranges=e,this.inverted=n};gt.prototype.recover=function(t){var e=0,n=mt(t);if(!this.inverted)for(var r=0;r<n;r++)e+=this.ranges[3*r+2]-this.ranges[3*r+1];return this.ranges[3*n]+e+function(t){return(t-(65535&t))/ht}(t)},gt.prototype.mapResult=function(t,e){return void 0===e&&(e=1),this._map(t,e,!1)},gt.prototype.map=function(t,e){return void 0===e&&(e=1),this._map(t,e,!0)},gt.prototype._map=function(t,e,n){for(var r=0,o=this.inverted?2:1,i=this.inverted?1:2,s=0;s<this.ranges.length;s+=3){var a=this.ranges[s]-(this.inverted?r:0);if(a>t)break;var c=this.ranges[s+o],u=this.ranges[s+i],l=a+c;if(t<=l){var d=a+r+((c?t==a?-1:t==l?1:e:e)<0?0:u);if(n)return d;var p=t==(e<0?a:l)?null:s/3+(t-a)*ht;return new vt(d,e<0?t!=a:t!=l,p)}r+=u-c}return n?t+r:new vt(t+r)},gt.prototype.touches=function(t,e){for(var n=0,r=mt(e),o=this.inverted?2:1,i=this.inverted?1:2,s=0;s<this.ranges.length;s+=3){var a=this.ranges[s]-(this.inverted?n:0);if(a>t)break;var c=this.ranges[s+o];if(t<=a+c&&s==3*r)return!0;n+=this.ranges[s+i]-c}return!1},gt.prototype.forEach=function(t){for(var e=this.inverted?2:1,n=this.inverted?1:2,r=0,o=0;r<this.ranges.length;r+=3){var i=this.ranges[r],s=i-(this.inverted?o:0),a=i+(this.inverted?0:o),c=this.ranges[r+e],u=this.ranges[r+n];t(s,s+c,a,a+u),o+=u-c}},gt.prototype.invert=function(){return new gt(this.ranges,!this.inverted)},gt.prototype.toString=function(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)},gt.offset=function(t){return 0==t?gt.empty:new gt(t<0?[0,-t,0]:[0,0,t])},gt.empty=new gt([]);var yt=function(t,e,n,r){this.maps=t||[],this.from=n||0,this.to=null==r?this.maps.length:r,this.mirror=e};function bt(t){var e=Error.call(this,t);return e.__proto__=bt.prototype,e}yt.prototype.slice=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.maps.length),new yt(this.maps,this.mirror,t,e)},yt.prototype.copy=function(){return new yt(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)},yt.prototype.appendMap=function(t,e){this.to=this.maps.push(t),null!=e&&this.setMirror(this.maps.length-1,e)},yt.prototype.appendMapping=function(t){for(var e=0,n=this.maps.length;e<t.maps.length;e++){var r=t.getMirror(e);this.appendMap(t.maps[e],null!=r&&r<e?n+r:null)}},yt.prototype.getMirror=function(t){if(this.mirror)for(var e=0;e<this.mirror.length;e++)if(this.mirror[e]==t)return this.mirror[e+(e%2?-1:1)]},yt.prototype.setMirror=function(t,e){this.mirror||(this.mirror=[]),this.mirror.push(t,e)},yt.prototype.appendMappingInverted=function(t){for(var e=t.maps.length-1,n=this.maps.length+t.maps.length;e>=0;e--){var r=t.getMirror(e);this.appendMap(t.maps[e].invert(),null!=r&&r>e?n-r-1:null)}},yt.prototype.invert=function(){var t=new yt;return t.appendMappingInverted(this),t},yt.prototype.map=function(t,e){if(void 0===e&&(e=1),this.mirror)return this._map(t,e,!0);for(var n=this.from;n<this.to;n++)t=this.maps[n].map(t,e);return t},yt.prototype.mapResult=function(t,e){return void 0===e&&(e=1),this._map(t,e,!1)},yt.prototype._map=function(t,e,n){for(var r=!1,o=this.from;o<this.to;o++){var i=this.maps[o].mapResult(t,e);if(null!=i.recover){var s=this.getMirror(o);if(null!=s&&s>o&&s<this.to){o=s,t=this.maps[s].recover(i.recover);continue}}i.deleted&&(r=!0),t=i.pos}return n?t:new vt(t,r)},bt.prototype=Object.create(Error.prototype),bt.prototype.constructor=bt,bt.prototype.name="TransformError";var wt=function(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new yt},_t={before:{configurable:!0},docChanged:{configurable:!0}};function xt(){throw new Error("Override me")}_t.before.get=function(){return this.docs.length?this.docs[0]:this.doc},wt.prototype.step=function(t){var e=this.maybeStep(t);if(e.failed)throw new bt(e.failed);return this},wt.prototype.maybeStep=function(t){var e=t.apply(this.doc);return e.failed||this.addStep(t,e.doc),e},_t.docChanged.get=function(){return this.steps.length>0},wt.prototype.addStep=function(t,e){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=e},Object.defineProperties(wt.prototype,_t);var kt=Object.create(null),Ct=function(){};Ct.prototype.apply=function(t){return xt()},Ct.prototype.getMap=function(){return gt.empty},Ct.prototype.invert=function(t){return xt()},Ct.prototype.map=function(t){return xt()},Ct.prototype.merge=function(t){return null},Ct.prototype.toJSON=function(){return xt()},Ct.fromJSON=function(t,e){if(!e||!e.stepType)throw new RangeError("Invalid input for Step.fromJSON");var n=kt[e.stepType];if(!n)throw new RangeError("No step type "+e.stepType+" defined");return n.fromJSON(t,e)},Ct.jsonID=function(t,e){if(t in kt)throw new RangeError("Duplicate use of step JSON ID "+t);return kt[t]=e,e.prototype.jsonID=t,e};var St=function(t,e){this.doc=t,this.failed=e};St.ok=function(t){return new St(t,null)},St.fail=function(t){return new St(null,t)},St.fromReplace=function(t,e,n,r){try{return St.ok(t.replace(e,n,r))}catch(t){if(t instanceof d)return St.fail(t.message);throw t}};var Tt=function(t){function e(e,n,r,o){t.call(this),this.from=e,this.to=n,this.slice=r,this.structure=!!o}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.apply=function(t){return this.structure&&Mt(t,this.from,this.to)?St.fail("Structure replace would overwrite content"):St.fromReplace(t,this.from,this.to,this.slice)},e.prototype.getMap=function(){return new gt([this.from,this.to-this.from,this.slice.size])},e.prototype.invert=function(t){return new e(this.from,this.from+this.slice.size,t.slice(this.from,this.to))},e.prototype.map=function(t){var n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted?null:new e(n.pos,Math.max(n.pos,r.pos),this.slice)},e.prototype.merge=function(t){if(!(t instanceof e)||t.structure||this.structure)return null;if(this.from+this.slice.size!=t.from||this.slice.openEnd||t.slice.openStart){if(t.to!=this.from||this.slice.openStart||t.slice.openEnd)return null;var n=this.slice.size+t.slice.size==0?p.empty:new p(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new e(t.from,this.to,n,this.structure)}var r=this.slice.size+t.slice.size==0?p.empty:new p(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new e(this.from,this.to+(t.to-t.from),r,this.structure)},e.prototype.toJSON=function(){var t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t},e.fromJSON=function(t,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new e(n.from,n.to,p.fromJSON(t,n.slice),!!n.structure)},e}(Ct);Ct.jsonID("replace",Tt);var Et=function(t){function e(e,n,r,o,i,s,a){t.call(this),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=o,this.slice=i,this.insert=s,this.structure=!!a}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.apply=function(t){if(this.structure&&(Mt(t,this.from,this.gapFrom)||Mt(t,this.gapTo,this.to)))return St.fail("Structure gap-replace would overwrite content");var e=t.slice(this.gapFrom,this.gapTo);if(e.openStart||e.openEnd)return St.fail("Gap is not a flat range");var n=this.slice.insertAt(this.insert,e.content);return n?St.fromReplace(t,this.from,this.to,n):St.fail("Content does not fit in gap")},e.prototype.getMap=function(){return new gt([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])},e.prototype.invert=function(t){var n=this.gapTo-this.gapFrom;return new e(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)},e.prototype.map=function(t){var n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),o=t.map(this.gapFrom,-1),i=t.map(this.gapTo,1);return n.deleted&&r.deleted||o<n.pos||i>r.pos?null:new e(n.pos,r.pos,o,i,this.slice,this.insert,this.structure)},e.prototype.toJSON=function(){var t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t},e.fromJSON=function(t,n){if("number"!=typeof n.from||"number"!=typeof n.to||"number"!=typeof n.gapFrom||"number"!=typeof n.gapTo||"number"!=typeof n.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new e(n.from,n.to,n.gapFrom,n.gapTo,p.fromJSON(t,n.slice),n.insert,!!n.structure)},e}(Ct);function Mt(t,e,n){for(var r=t.resolve(e),o=n-e,i=r.depth;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0)for(var s=r.node(i).maybeChild(r.indexAfter(i));o>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,o--}return!1}function Ot(t,e,n){return(0==e||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function Dt(t){for(var e=t.parent.content.cutByIndex(t.startIndex,t.endIndex),n=t.depth;;--n){var r=t.$from.node(n),o=t.$from.index(n),i=t.$to.indexAfter(n);if(n<t.depth&&r.canReplace(o,i,e))return n;if(0==n||r.type.spec.isolating||!Ot(r,o,i))break}}function It(t,e,n,r){void 0===r&&(r=t);var o=function(t,e){var n=t.parent,r=t.startIndex,o=t.endIndex,i=n.contentMatchAt(r).findWrapping(e);if(!i)return null;var s=i.length?i[0]:e;return n.canReplaceWith(r,o,s)?i:null}(t,e),i=o&&function(t,e){var n=t.parent,r=t.startIndex,o=t.endIndex,i=n.child(r),s=e.contentMatch.findWrapping(i.type);if(!s)return null;for(var a=(s.length?s[s.length-1]:e).contentMatch,c=r;a&&c<o;c++)a=a.matchType(n.child(c).type);if(!a||!a.validEnd)return null;return s}(r,e);return i?o.map(At).concat({type:e,attrs:n}).concat(i.map(At)):null}function At(t){return{type:t,attrs:null}}function Nt(t,e,n,r){void 0===n&&(n=1);var o=t.resolve(e),i=o.depth-n,s=r&&r[r.length-1]||o.parent;if(i<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!s.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(var a=o.depth-1,c=n-2;a>i;a--,c--){var u=o.node(a),l=o.index(a);if(u.type.spec.isolating)return!1;var d=u.content.cutByIndex(l,u.childCount),p=r&&r[c]||u;if(p!=u&&(d=d.replaceChild(0,p.type.create(p.attrs))),!u.canReplace(l+1,u.childCount)||!p.type.validContent(d))return!1}var f=o.indexAfter(i),h=r&&r[0];return o.node(i).canReplaceWith(f,f,h?h.type:o.node(i+1).type)}function Bt(t,e){var n=t.resolve(e),r=n.index();return zt(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function zt(t,e){return t&&e&&!t.isLeaf&&t.canAppend(e)}function Pt(t,e,n){void 0===n&&(n=-1);for(var r=t.resolve(e),o=r.depth;;o--){var i=void 0,s=void 0,a=r.index(o);if(o==r.depth?(i=r.nodeBefore,s=r.nodeAfter):n>0?(i=r.node(o+1),a++,s=r.node(o).maybeChild(a)):(i=r.node(o).maybeChild(a-1),s=r.node(o+1)),i&&!i.isTextblock&&zt(i,s)&&r.node(o).canReplace(a,a+1))return e;if(0==o)break;e=n<0?r.before(o):r.after(o)}}function Rt(t,e,n){var r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(0==r.parentOffset)for(var o=r.depth-1;o>=0;o--){var i=r.index(o);if(r.node(o).canReplaceWith(i,i,n))return r.before(o+1);if(i>0)return null}if(r.parentOffset==r.parent.content.size)for(var s=r.depth-1;s>=0;s--){var a=r.indexAfter(s);if(r.node(s).canReplaceWith(a,a,n))return r.after(s+1);if(a<r.node(s).childCount)return null}}function Ft(t,e,n){var r=t.resolve(e);if(!n.content.size)return e;for(var o=n.content,i=0;i<n.openStart;i++)o=o.firstChild.content;for(var s=1;s<=(0==n.openStart&&n.size?2:1);s++)for(var a=r.depth;a>=0;a--){var c=a==r.depth?0:r.pos<=(r.start(a+1)+r.end(a+1))/2?-1:1,u=r.index(a)+(c>0?1:0),l=r.node(a),d=!1;if(1==s)d=l.canReplace(u,u,o);else{var p=l.contentMatchAt(u).findWrapping(o.firstChild.type);d=p&&l.canReplaceWith(u,u,p[0])}if(d)return 0==c?r.pos:c<0?r.before(a+1):r.after(a+1)}return null}function Lt(t,e,n){for(var r=[],o=0;o<t.childCount;o++){var s=t.child(o);s.content.size&&(s=s.copy(Lt(s.content,e,s))),s.isInline&&(s=e(s,n,o)),r.push(s)}return i.fromArray(r)}Ct.jsonID("replaceAround",Et),wt.prototype.lift=function(t,e){for(var n=t.$from,r=t.$to,o=t.depth,s=n.before(o+1),a=r.after(o+1),c=s,u=a,l=i.empty,d=0,f=o,h=!1;f>e;f--)h||n.index(f)>0?(h=!0,l=i.from(n.node(f).copy(l)),d++):c--;for(var m=i.empty,v=0,g=o,y=!1;g>e;g--)y||r.after(g+1)<r.end(g)?(y=!0,m=i.from(r.node(g).copy(m)),v++):u++;return this.step(new Et(c,u,s,a,new p(l.append(m),d,v),l.size-d,!0))},wt.prototype.wrap=function(t,e){for(var n=i.empty,r=e.length-1;r>=0;r--){if(n.size){var o=e[r].type.contentMatch.matchFragment(n);if(!o||!o.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}n=i.from(e[r].type.create(e[r].attrs,n))}var s=t.start,a=t.end;return this.step(new Et(s,a,s,a,new p(n,0,0),e.length,!0))},wt.prototype.setBlockType=function(t,e,n,r){var o=this;if(void 0===e&&(e=t),!n.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");var s=this.steps.length;return this.doc.nodesBetween(t,e,(function(t,e){if(t.isTextblock&&!t.hasMarkup(n,r)&&function(t,e,n){var r=t.resolve(e),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}(o.doc,o.mapping.slice(s).map(e),n)){o.clearIncompatible(o.mapping.slice(s).map(e,1),n);var a=o.mapping.slice(s),c=a.map(e,1),u=a.map(e+t.nodeSize,1);return o.step(new Et(c,u,c+1,u-1,new p(i.from(n.create(r,null,t.marks)),0,0),1,!0)),!1}})),this},wt.prototype.setNodeMarkup=function(t,e,n,r){var o=this.doc.nodeAt(t);if(!o)throw new RangeError("No node at given position");e||(e=o.type);var s=e.create(n,null,r||o.marks);if(o.isLeaf)return this.replaceWith(t,t+o.nodeSize,s);if(!e.validContent(o.content))throw new RangeError("Invalid content for node type "+e.name);return this.step(new Et(t,t+o.nodeSize,t+1,t+o.nodeSize-1,new p(i.from(s),0,0),1,!0))},wt.prototype.split=function(t,e,n){void 0===e&&(e=1);for(var r=this.doc.resolve(t),o=i.empty,s=i.empty,a=r.depth,c=r.depth-e,u=e-1;a>c;a--,u--){o=i.from(r.node(a).copy(o));var l=n&&n[u];s=i.from(l?l.type.create(l.attrs,s):r.node(a).copy(s))}return this.step(new Tt(t,t,new p(o.append(s),e,e),!0))},wt.prototype.join=function(t,e){void 0===e&&(e=1);var n=new Tt(t-e,t+e,p.empty,!0);return this.step(n)};var Vt=function(t){function e(e,n,r){t.call(this),this.from=e,this.to=n,this.mark=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.apply=function(t){var e=this,n=t.slice(this.from,this.to),r=t.resolve(this.from),o=r.node(r.sharedDepth(this.to)),i=new p(Lt(n.content,(function(t,n){return t.isAtom&&n.type.allowsMarkType(e.mark.type)?t.mark(e.mark.addToSet(t.marks)):t}),o),n.openStart,n.openEnd);return St.fromReplace(t,this.from,this.to,i)},e.prototype.invert=function(){return new jt(this.from,this.to,this.mark)},e.prototype.map=function(t){var n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)},e.prototype.merge=function(t){if(t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from)return new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark)},e.prototype.toJSON=function(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}},e.fromJSON=function(t,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new e(n.from,n.to,t.markFromJSON(n.mark))},e}(Ct);Ct.jsonID("addMark",Vt);var jt=function(t){function e(e,n,r){t.call(this),this.from=e,this.to=n,this.mark=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.apply=function(t){var e=this,n=t.slice(this.from,this.to),r=new p(Lt(n.content,(function(t){return t.mark(e.mark.removeFromSet(t.marks))})),n.openStart,n.openEnd);return St.fromReplace(t,this.from,this.to,r)},e.prototype.invert=function(){return new Vt(this.from,this.to,this.mark)},e.prototype.map=function(t){var n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)},e.prototype.merge=function(t){if(t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from)return new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark)},e.prototype.toJSON=function(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}},e.fromJSON=function(t,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new e(n.from,n.to,t.markFromJSON(n.mark))},e}(Ct);function $t(t,e,n,r){if(void 0===n&&(n=e),void 0===r&&(r=p.empty),e==n&&!r.size)return null;var o=t.resolve(e),i=t.resolve(n);return Wt(o,i,r)?new Tt(e,n,r):new Ht(o,i,r).fit()}function Wt(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}Ct.jsonID("removeMark",jt),wt.prototype.addMark=function(t,e,n){var r=this,o=[],i=[],s=null,a=null;return this.doc.nodesBetween(t,e,(function(r,c,u){if(r.isInline){var l=r.marks;if(!n.isInSet(l)&&u.type.allowsMarkType(n.type)){for(var d=Math.max(c,t),p=Math.min(c+r.nodeSize,e),f=n.addToSet(l),h=0;h<l.length;h++)l[h].isInSet(f)||(s&&s.to==d&&s.mark.eq(l[h])?s.to=p:o.push(s=new jt(d,p,l[h])));a&&a.to==d?a.to=p:i.push(a=new Vt(d,p,n))}}})),o.forEach((function(t){return r.step(t)})),i.forEach((function(t){return r.step(t)})),this},wt.prototype.removeMark=function(t,e,n){var r=this;void 0===n&&(n=null);var o=[],i=0;return this.doc.nodesBetween(t,e,(function(r,s){if(r.isInline){i++;var a=null;if(n instanceof X)for(var c,u=r.marks;c=n.isInSet(u);)(a||(a=[])).push(c),u=c.removeFromSet(u);else n?n.isInSet(r.marks)&&(a=[n]):a=r.marks;if(a&&a.length)for(var l=Math.min(s+r.nodeSize,e),d=0;d<a.length;d++){for(var p=a[d],f=void 0,h=0;h<o.length;h++){var m=o[h];m.step==i-1&&p.eq(o[h].style)&&(f=m)}f?(f.to=l,f.step=i):o.push({style:p,from:Math.max(s,t),to:l,step:i})}}})),o.forEach((function(t){return r.step(new jt(t.from,t.to,t.style))})),this},wt.prototype.clearIncompatible=function(t,e,n){void 0===n&&(n=e.contentMatch);for(var r=this.doc.nodeAt(t),o=[],s=t+1,a=0;a<r.childCount;a++){var c=r.child(a),u=s+c.nodeSize,l=n.matchType(c.type,c.attrs);if(l){n=l;for(var d=0;d<c.marks.length;d++)e.allowsMarkType(c.marks[d].type)||this.step(new jt(s,u,c.marks[d]))}else o.push(new Tt(s,u,p.empty));s=u}if(!n.validEnd){var f=n.fillBefore(i.empty,!0);this.replace(s,s,new p(f,0,0))}for(var h=o.length-1;h>=0;h--)this.step(o[h]);return this},wt.prototype.replace=function(t,e,n){void 0===e&&(e=t),void 0===n&&(n=p.empty);var r=$t(this.doc,t,e,n);return r&&this.step(r),this},wt.prototype.replaceWith=function(t,e,n){return this.replace(t,e,new p(i.from(n),0,0))},wt.prototype.delete=function(t,e){return this.replace(t,e,p.empty)},wt.prototype.insert=function(t,e){return this.replaceWith(t,t,e)};var Ht=function(t,e,n){this.$to=e,this.$from=t,this.unplaced=n,this.frontier=[];for(var r=0;r<=t.depth;r++){var o=t.node(r);this.frontier.push({type:o.type,match:o.contentMatchAt(t.indexAfter(r))})}this.placed=i.empty;for(var s=t.depth;s>0;s--)this.placed=i.from(t.node(s).copy(this.placed))},qt={depth:{configurable:!0}};function Jt(t,e,n){return 0==e?t.cutByIndex(n):t.replaceChild(0,t.firstChild.copy(Jt(t.firstChild.content,e-1,n)))}function Kt(t,e,n){return 0==e?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(Kt(t.lastChild.content,e-1,n)))}function Ut(t,e){for(var n=0;n<e;n++)t=t.firstChild.content;return t}function Gt(t,e,n){if(e<=0)return t;var r=t.content;return e>1&&(r=r.replaceChild(0,Gt(r.firstChild,e-1,1==r.childCount?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(i.empty,!0)))),t.copy(r)}function Yt(t,e,n,r,o){var i=t.node(e),s=o?t.indexAfter(e):t.index(e);if(s==i.childCount&&!n.compatibleContent(i.type))return null;var a=r.fillBefore(i.content,!0,s);return a&&!function(t,e,n){for(var r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}(n,i.content,s)?a:null}function Xt(t,e,n,r,o){if(e<n){var s=t.firstChild;t=t.replaceChild(0,s.copy(Xt(s.content,e+1,n,r,s)))}if(e>r){var a=o.contentMatchAt(0),c=a.fillBefore(t).append(t);t=c.append(a.matchFragment(c).fillBefore(i.empty,!0))}return t}function Zt(t,e){for(var n=[],r=Math.min(t.depth,e.depth);r>=0;r--){var o=t.start(r);if(o<t.pos-(t.depth-r)||e.end(r)>e.pos+(e.depth-r)||t.node(r).type.spec.isolating||e.node(r).type.spec.isolating)break;(o==e.start(r)||r==t.depth&&r==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&r&&e.start(r-1)==o-1)&&n.push(r)}return n}qt.depth.get=function(){return this.frontier.length-1},Ht.prototype.fit=function(){for(;this.unplaced.size;){var t=this.findFittable();t?this.placeNodes(t):this.openMore()||this.dropNode()}var e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,o=this.close(e<0?this.$to:r.doc.resolve(e));if(!o)return null;for(var i=this.placed,s=r.depth,a=o.depth;s&&a&&1==i.childCount;)i=i.firstChild.content,s--,a--;var c=new p(i,s,a);return e>-1?new Et(r.pos,e,this.$to.pos,this.$to.end(),c,n):c.size||r.pos!=this.$to.pos?new Tt(r.pos,o.pos,c):void 0},Ht.prototype.findFittable=function(){for(var t=1;t<=2;t++)for(var e=this.unplaced.openStart;e>=0;e--)for(var n=void 0,r=(e?(n=Ut(this.unplaced.content,e-1).firstChild).content:this.unplaced.content).firstChild,o=this.depth;o>=0;o--){var s=this.frontier[o],a=s.type,c=s.match,u=void 0,l=void 0;if(1==t&&(r?c.matchType(r.type)||(l=c.fillBefore(i.from(r),!1)):a.compatibleContent(n.type)))return{sliceDepth:e,frontierDepth:o,parent:n,inject:l};if(2==t&&r&&(u=c.findWrapping(r.type)))return{sliceDepth:e,frontierDepth:o,parent:n,wrap:u};if(n&&c.matchType(n.type))break}},Ht.prototype.openMore=function(){var t=this.unplaced,e=t.content,n=t.openStart,r=t.openEnd,o=Ut(e,n);return!(!o.childCount||o.firstChild.isLeaf)&&(this.unplaced=new p(e,n+1,Math.max(r,o.size+n>=e.size-r?n+1:0)),!0)},Ht.prototype.dropNode=function(){var t=this.unplaced,e=t.content,n=t.openStart,r=t.openEnd,o=Ut(e,n);if(o.childCount<=1&&n>0){var i=e.size-n<=n+o.size;this.unplaced=new p(Jt(e,n-1,1),n-1,i?n-1:r)}else this.unplaced=new p(Jt(e,n,1),n,r)},Ht.prototype.placeNodes=function(t){for(var e=t.sliceDepth,n=t.frontierDepth,r=t.parent,o=t.inject,s=t.wrap;this.depth>n;)this.closeFrontierNode();if(s)for(var a=0;a<s.length;a++)this.openFrontierNode(s[a]);var c=this.unplaced,u=r?r.content:c.content,l=c.openStart-e,d=0,f=[],h=this.frontier[n],m=h.match,v=h.type;if(o){for(var g=0;g<o.childCount;g++)f.push(o.child(g));m=m.matchFragment(o)}for(var y=u.size+e-(c.content.size-c.openEnd);d<u.childCount;){var b=u.child(d),w=m.matchType(b.type);if(!w)break;(++d>1||0==l||b.content.size)&&(m=w,f.push(Gt(b.mark(v.allowedMarks(b.marks)),1==d?l:0,d==u.childCount?y:-1)))}var _=d==u.childCount;_||(y=-1),this.placed=Kt(this.placed,n,i.from(f)),this.frontier[n].match=m,_&&y<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(var x=0,k=u;x<y;x++){var C=k.lastChild;this.frontier.push({type:C.type,match:C.contentMatchAt(C.childCount)}),k=C.content}this.unplaced=_?0==e?p.empty:new p(Jt(c.content,e-1,1),e-1,y<0?c.openEnd:e-1):new p(Jt(c.content,e,d),c.openStart,c.openEnd)},Ht.prototype.mustMoveInline=function(){if(!this.$to.parent.isTextblock||this.$to.end()==this.$to.pos)return-1;var t,e=this.frontier[this.depth];if(!e.type.isTextblock||!Yt(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return-1;for(var n=this.$to.depth,r=this.$to.after(n);n>1&&r==this.$to.end(--n);)++r;return r},Ht.prototype.findCloseLevel=function(t){t:for(var e=Math.min(this.depth,t.depth);e>=0;e--){var n=this.frontier[e],r=n.match,o=n.type,i=e<t.depth&&t.end(e+1)==t.pos+(t.depth-(e+1)),s=Yt(t,e,o,r,i);if(s){for(var a=e-1;a>=0;a--){var c=this.frontier[a],u=c.match,l=Yt(t,a,c.type,u,!0);if(!l||l.childCount)continue t}return{depth:e,fit:s,move:i?t.doc.resolve(t.after(e+1)):t}}}},Ht.prototype.close=function(t){var e=this.findCloseLevel(t);if(!e)return null;for(;this.depth>e.depth;)this.closeFrontierNode();e.fit.childCount&&(this.placed=Kt(this.placed,e.depth,e.fit)),t=e.move;for(var n=e.depth+1;n<=t.depth;n++){var r=t.node(n),o=r.type.contentMatch.fillBefore(r.content,!0,t.index(n));this.openFrontierNode(r.type,r.attrs,o)}return t},Ht.prototype.openFrontierNode=function(t,e,n){var r=this.frontier[this.depth];r.match=r.match.matchType(t),this.placed=Kt(this.placed,this.depth,i.from(t.create(e,n))),this.frontier.push({type:t,match:t.contentMatch})},Ht.prototype.closeFrontierNode=function(){var t=this.frontier.pop().match.fillBefore(i.empty,!0);t.childCount&&(this.placed=Kt(this.placed,this.frontier.length,t))},Object.defineProperties(Ht.prototype,qt),wt.prototype.replaceRange=function(t,e,n){if(!n.size)return this.deleteRange(t,e);var r=this.doc.resolve(t),o=this.doc.resolve(e);if(Wt(r,o,n))return this.step(new Tt(t,e,n));var i=Zt(r,this.doc.resolve(e));0==i[i.length-1]&&i.pop();var s=-(r.depth+1);i.unshift(s);for(var a=r.depth,c=r.pos-1;a>0;a--,c--){var u=r.node(a).type.spec;if(u.defining||u.isolating)break;i.indexOf(a)>-1?s=a:r.before(a)==c&&i.splice(1,0,-a)}for(var l=i.indexOf(s),d=[],f=n.openStart,h=n.content,m=0;;m++){var v=h.firstChild;if(d.push(v),m==n.openStart)break;h=v.content}f>0&&d[f-1].type.spec.defining&&r.node(l).type!=d[f-1].type?f-=1:f>=2&&d[f-1].isTextblock&&d[f-2].type.spec.defining&&r.node(l).type!=d[f-2].type&&(f-=2);for(var g=n.openStart;g>=0;g--){var y=(g+f+1)%(n.openStart+1),b=d[y];if(b)for(var w=0;w<i.length;w++){var _=i[(w+l)%i.length],x=!0;_<0&&(x=!1,_=-_);var k=r.node(_-1),C=r.index(_-1);if(k.canReplaceWith(C,C,b.type,b.marks))return this.replace(r.before(_),x?o.after(_):e,new p(Xt(n.content,0,n.openStart,y),y,n.openEnd))}}for(var S=this.steps.length,T=i.length-1;T>=0&&(this.replace(t,e,n),!(this.steps.length>S));T--){var E=i[T];E<0||(t=r.before(E),e=o.after(E))}return this},wt.prototype.replaceRangeWith=function(t,e,n){if(!n.isInline&&t==e&&this.doc.resolve(t).parent.content.size){var r=Rt(this.doc,t,n.type);null!=r&&(t=e=r)}return this.replaceRange(t,e,new p(i.from(n),0,0))},wt.prototype.deleteRange=function(t,e){for(var n=this.doc.resolve(t),r=this.doc.resolve(e),o=Zt(n,r),i=0;i<o.length;i++){var s=o[i],a=i==o.length-1;if(a&&0==s||n.node(s).type.contentMatch.validEnd)return this.delete(n.start(s),r.end(s));if(s>0&&(a||n.node(s-1).canReplace(n.index(s-1),r.indexAfter(s-1))))return this.delete(n.before(s),r.after(s))}for(var c=1;c<=n.depth&&c<=r.depth;c++)if(t-n.start(c)==n.depth-c&&e>n.end(c)&&r.end(c)-e!=r.depth-c)return this.delete(n.before(c),e);return this.delete(t,e)};var Qt=Object.create(null),te=function(t,e,n){this.ranges=n||[new ne(t.min(e),t.max(e))],this.$anchor=t,this.$head=e},ee={anchor:{configurable:!0},head:{configurable:!0},from:{configurable:!0},to:{configurable:!0},$from:{configurable:!0},$to:{configurable:!0},empty:{configurable:!0}};ee.anchor.get=function(){return this.$anchor.pos},ee.head.get=function(){return this.$head.pos},ee.from.get=function(){return this.$from.pos},ee.to.get=function(){return this.$to.pos},ee.$from.get=function(){return this.ranges[0].$from},ee.$to.get=function(){return this.ranges[0].$to},ee.empty.get=function(){for(var t=this.ranges,e=0;e<t.length;e++)if(t[e].$from.pos!=t[e].$to.pos)return!1;return!0},te.prototype.content=function(){return this.$from.node(0).slice(this.from,this.to,!0)},te.prototype.replace=function(t,e){void 0===e&&(e=p.empty);for(var n=e.content.lastChild,r=null,o=0;o<e.openEnd;o++)r=n,n=n.lastChild;for(var i=t.steps.length,s=this.ranges,a=0;a<s.length;a++){var c=s[a],u=c.$from,l=c.$to,d=t.mapping.slice(i);t.replaceRange(d.map(u.pos),d.map(l.pos),a?p.empty:e),0==a&&le(t,i,(n?n.isInline:r&&r.isTextblock)?-1:1)}},te.prototype.replaceWith=function(t,e){for(var n=t.steps.length,r=this.ranges,o=0;o<r.length;o++){var i=r[o],s=i.$from,a=i.$to,c=t.mapping.slice(n),u=c.map(s.pos),l=c.map(a.pos);o?t.deleteRange(u,l):(t.replaceRangeWith(u,l,e),le(t,n,e.isInline?-1:1))}},te.findFrom=function(t,e,n){var r=t.parent.inlineContent?new re(t):ue(t.node(0),t.parent,t.pos,t.index(),e,n);if(r)return r;for(var o=t.depth-1;o>=0;o--){var i=e<0?ue(t.node(0),t.node(o),t.before(o+1),t.index(o),e,n):ue(t.node(0),t.node(o),t.after(o+1),t.index(o)+1,e,n);if(i)return i}},te.near=function(t,e){return void 0===e&&(e=1),this.findFrom(t,e)||this.findFrom(t,-e)||new ae(t.node(0))},te.atStart=function(t){return ue(t,t,0,0,1)||new ae(t)},te.atEnd=function(t){return ue(t,t,t.content.size,t.childCount,-1)||new ae(t)},te.fromJSON=function(t,e){if(!e||!e.type)throw new RangeError("Invalid input for Selection.fromJSON");var n=Qt[e.type];if(!n)throw new RangeError("No selection type "+e.type+" defined");return n.fromJSON(t,e)},te.jsonID=function(t,e){if(t in Qt)throw new RangeError("Duplicate use of selection JSON ID "+t);return Qt[t]=e,e.prototype.jsonID=t,e},te.prototype.getBookmark=function(){return re.between(this.$anchor,this.$head).getBookmark()},Object.defineProperties(te.prototype,ee),te.prototype.visible=!0;var ne=function(t,e){this.$from=t,this.$to=e},re=function(t){function e(e,n){void 0===n&&(n=e),t.call(this,e,n)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={$cursor:{configurable:!0}};return n.$cursor.get=function(){return this.$anchor.pos==this.$head.pos?this.$head:null},e.prototype.map=function(n,r){var o=n.resolve(r.map(this.head));if(!o.parent.inlineContent)return t.near(o);var i=n.resolve(r.map(this.anchor));return new e(i.parent.inlineContent?i:o,o)},e.prototype.replace=function(e,n){if(void 0===n&&(n=p.empty),t.prototype.replace.call(this,e,n),n==p.empty){var r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}},e.prototype.eq=function(t){return t instanceof e&&t.anchor==this.anchor&&t.head==this.head},e.prototype.getBookmark=function(){return new oe(this.anchor,this.head)},e.prototype.toJSON=function(){return{type:"text",anchor:this.anchor,head:this.head}},e.fromJSON=function(t,n){if("number"!=typeof n.anchor||"number"!=typeof n.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new e(t.resolve(n.anchor),t.resolve(n.head))},e.create=function(t,e,n){void 0===n&&(n=e);var r=t.resolve(e);return new this(r,n==e?r:t.resolve(n))},e.between=function(n,r,o){var i=n.pos-r.pos;if(o&&!i||(o=i>=0?1:-1),!r.parent.inlineContent){var s=t.findFrom(r,o,!0)||t.findFrom(r,-o,!0);if(!s)return t.near(r,o);r=s.$head}return n.parent.inlineContent||(0==i||(n=(t.findFrom(n,-o,!0)||t.findFrom(n,o,!0)).$anchor).pos<r.pos!=i<0)&&(n=r),new e(n,r)},Object.defineProperties(e.prototype,n),e}(te);te.jsonID("text",re);var oe=function(t,e){this.anchor=t,this.head=e};oe.prototype.map=function(t){return new oe(t.map(this.anchor),t.map(this.head))},oe.prototype.resolve=function(t){return re.between(t.resolve(this.anchor),t.resolve(this.head))};var ie=function(t){function e(e){var n=e.nodeAfter,r=e.node(0).resolve(e.pos+n.nodeSize);t.call(this,e,r),this.node=n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.map=function(n,r){var o=r.mapResult(this.anchor),i=o.deleted,s=o.pos,a=n.resolve(s);return i?t.near(a):new e(a)},e.prototype.content=function(){return new p(i.from(this.node),0,0)},e.prototype.eq=function(t){return t instanceof e&&t.anchor==this.anchor},e.prototype.toJSON=function(){return{type:"node",anchor:this.anchor}},e.prototype.getBookmark=function(){return new se(this.anchor)},e.fromJSON=function(t,n){if("number"!=typeof n.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new e(t.resolve(n.anchor))},e.create=function(t,e){return new this(t.resolve(e))},e.isSelectable=function(t){return!t.isText&&!1!==t.type.spec.selectable},e}(te);ie.prototype.visible=!1,te.jsonID("node",ie);var se=function(t){this.anchor=t};se.prototype.map=function(t){var e=t.mapResult(this.anchor),n=e.deleted,r=e.pos;return n?new oe(r,r):new se(r)},se.prototype.resolve=function(t){var e=t.resolve(this.anchor),n=e.nodeAfter;return n&&ie.isSelectable(n)?new ie(e):te.near(e)};var ae=function(t){function e(e){t.call(this,e.resolve(0),e.resolve(e.content.size))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.replace=function(e,n){if(void 0===n&&(n=p.empty),n==p.empty){e.delete(0,e.doc.content.size);var r=t.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else t.prototype.replace.call(this,e,n)},e.prototype.toJSON=function(){return{type:"all"}},e.fromJSON=function(t){return new e(t)},e.prototype.map=function(t){return new e(t)},e.prototype.eq=function(t){return t instanceof e},e.prototype.getBookmark=function(){return ce},e}(te);te.jsonID("all",ae);var ce={map:function(){return this},resolve:function(t){return new ae(t)}};function ue(t,e,n,r,o,i){if(e.inlineContent)return re.create(t,n);for(var s=r-(o>0?0:1);o>0?s<e.childCount:s>=0;s+=o){var a=e.child(s);if(a.isAtom){if(!i&&ie.isSelectable(a))return ie.create(t,n-(o<0?a.nodeSize:0))}else{var c=ue(t,a,n+o,o<0?a.childCount:0,o,i);if(c)return c}n+=a.nodeSize*o}}function le(t,e,n){var r=t.steps.length-1;if(!(r<e)){var o,i=t.steps[r];if(i instanceof Tt||i instanceof Et)t.mapping.maps[r].forEach((function(t,e,n,r){null==o&&(o=r)})),t.setSelection(te.near(t.doc.resolve(o),n))}}var de=function(t){function e(e){t.call(this,e.doc),this.time=Date.now(),this.curSelection=e.selection,this.curSelectionFor=0,this.storedMarks=e.storedMarks,this.updated=0,this.meta=Object.create(null)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={selection:{configurable:!0},selectionSet:{configurable:!0},storedMarksSet:{configurable:!0},isGeneric:{configurable:!0},scrolledIntoView:{configurable:!0}};return n.selection.get=function(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection},e.prototype.setSelection=function(t){if(t.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=t,this.curSelectionFor=this.steps.length,this.updated=-3&(1|this.updated),this.storedMarks=null,this},n.selectionSet.get=function(){return(1&this.updated)>0},e.prototype.setStoredMarks=function(t){return this.storedMarks=t,this.updated|=2,this},e.prototype.ensureMarks=function(t){return l.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this},e.prototype.addStoredMark=function(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))},e.prototype.removeStoredMark=function(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))},n.storedMarksSet.get=function(){return(2&this.updated)>0},e.prototype.addStep=function(e,n){t.prototype.addStep.call(this,e,n),this.updated=-3&this.updated,this.storedMarks=null},e.prototype.setTime=function(t){return this.time=t,this},e.prototype.replaceSelection=function(t){return this.selection.replace(this,t),this},e.prototype.replaceSelectionWith=function(t,e){var n=this.selection;return!1!==e&&(t=t.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||l.none))),n.replaceWith(this,t),this},e.prototype.deleteSelection=function(){return this.selection.replace(this),this},e.prototype.insertText=function(t,e,n){void 0===n&&(n=e);var r=this.doc.type.schema;if(null==e)return t?this.replaceSelectionWith(r.text(t),!0):this.deleteSelection();if(!t)return this.deleteRange(e,n);var o=this.storedMarks;if(!o){var i=this.doc.resolve(e);o=n==e?i.marks():i.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(e,n,r.text(t,o)),this.selection.empty||this.setSelection(te.near(this.selection.$to)),this},e.prototype.setMeta=function(t,e){return this.meta["string"==typeof t?t:t.key]=e,this},e.prototype.getMeta=function(t){return this.meta["string"==typeof t?t:t.key]},n.isGeneric.get=function(){for(var t in this.meta)return!1;return!0},e.prototype.scrollIntoView=function(){return this.updated|=4,this},n.scrolledIntoView.get=function(){return(4&this.updated)>0},Object.defineProperties(e.prototype,n),e}(wt);function pe(t,e){return e&&t?t.bind(e):t}var fe=function(t,e,n){this.name=t,this.init=pe(e.init,n),this.apply=pe(e.apply,n)},he=[new fe("doc",{init:function(t){return t.doc||t.schema.topNodeType.createAndFill()},apply:function(t){return t.doc}}),new fe("selection",{init:function(t,e){return t.selection||te.atStart(e.doc)},apply:function(t){return t.selection}}),new fe("storedMarks",{init:function(t){return t.storedMarks||null},apply:function(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new fe("scrollToSelection",{init:function(){return 0},apply:function(t,e){return t.scrolledIntoView?e+1:e}})],me=function(t,e){var n=this;this.schema=t,this.fields=he.concat(),this.plugins=[],this.pluginsByKey=Object.create(null),e&&e.forEach((function(t){if(n.pluginsByKey[t.key])throw new RangeError("Adding different instances of a keyed plugin ("+t.key+")");n.plugins.push(t),n.pluginsByKey[t.key]=t,t.spec.state&&n.fields.push(new fe(t.key,t.spec.state,t))}))},ve=function(t){this.config=t},ge={schema:{configurable:!0},plugins:{configurable:!0},tr:{configurable:!0}};ge.schema.get=function(){return this.config.schema},ge.plugins.get=function(){return this.config.plugins},ve.prototype.apply=function(t){return this.applyTransaction(t).state},ve.prototype.filterTransaction=function(t,e){void 0===e&&(e=-1);for(var n=0;n<this.config.plugins.length;n++)if(n!=e){var r=this.config.plugins[n];if(r.spec.filterTransaction&&!r.spec.filterTransaction.call(r,t,this))return!1}return!0},ve.prototype.applyTransaction=function(t){if(!this.filterTransaction(t))return{state:this,transactions:[]};for(var e=[t],n=this.applyInner(t),r=null;;){for(var o=!1,i=0;i<this.config.plugins.length;i++){var s=this.config.plugins[i];if(s.spec.appendTransaction){var a=r?r[i].n:0,c=r?r[i].state:this,u=a<e.length&&s.spec.appendTransaction.call(s,a?e.slice(a):e,c,n);if(u&&n.filterTransaction(u,i)){if(u.setMeta("appendedTransaction",t),!r){r=[];for(var l=0;l<this.config.plugins.length;l++)r.push(l<i?{state:n,n:e.length}:{state:this,n:0})}e.push(u),n=n.applyInner(u),o=!0}r&&(r[i]={state:n,n:e.length})}}if(!o)return{state:n,transactions:e}}},ve.prototype.applyInner=function(t){if(!t.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");for(var e=new ve(this.config),n=this.config.fields,r=0;r<n.length;r++){var o=n[r];e[o.name]=o.apply(t,this[o.name],this,e)}for(var i=0;i<ye.length;i++)ye[i](this,t,e);return e},ge.tr.get=function(){return new de(this)},ve.create=function(t){for(var e=new me(t.doc?t.doc.type.schema:t.schema,t.plugins),n=new ve(e),r=0;r<e.fields.length;r++)n[e.fields[r].name]=e.fields[r].init(t,n);return n},ve.prototype.reconfigure=function(t){for(var e=new me(this.schema,t.plugins),n=e.fields,r=new ve(e),o=0;o<n.length;o++){var i=n[o].name;r[i]=this.hasOwnProperty(i)?this[i]:n[o].init(t,r)}return r},ve.prototype.toJSON=function(t){var e={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(e.storedMarks=this.storedMarks.map((function(t){return t.toJSON()}))),t&&"object"==typeof t)for(var n in t){if("doc"==n||"selection"==n)throw new RangeError("The JSON fields `doc` and `selection` are reserved");var r=t[n],o=r.spec.state;o&&o.toJSON&&(e[n]=o.toJSON.call(r,this[r.key]))}return e},ve.fromJSON=function(t,e,n){if(!e)throw new RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw new RangeError("Required config field 'schema' missing");var r=new me(t.schema,t.plugins),o=new ve(r);return r.fields.forEach((function(r){if("doc"==r.name)o.doc=O.fromJSON(t.schema,e.doc);else if("selection"==r.name)o.selection=te.fromJSON(o.doc,e.selection);else if("storedMarks"==r.name)e.storedMarks&&(o.storedMarks=e.storedMarks.map(t.schema.markFromJSON));else{if(n)for(var i in n){var s=n[i],a=s.spec.state;if(s.key==r.name&&a&&a.fromJSON&&Object.prototype.hasOwnProperty.call(e,i))return void(o[r.name]=a.fromJSON.call(s,t,e[i],o))}o[r.name]=r.init(t,o)}})),o},ve.addApplyListener=function(t){ye.push(t)},ve.removeApplyListener=function(t){var e=ye.indexOf(t);e>-1&&ye.splice(e,1)},Object.defineProperties(ve.prototype,ge);var ye=[];var be=function(t){this.props={},t.props&&function t(e,n,r){for(var o in e){var i=e[o];i instanceof Function?i=i.bind(n):"handleDOMEvents"==o&&(i=t(i,n,{})),r[o]=i}return r}(t.props,this,this.props),this.spec=t,this.key=t.key?t.key.key:_e("plugin")};be.prototype.getState=function(t){return t[this.key]};var we=Object.create(null);function _e(t){return t in we?t+"$"+ ++we[t]:(we[t]=0,t+"$")}var xe=function(t){void 0===t&&(t="key"),this.key=_e(t)};xe.prototype.get=function(t){return t.config.pluginsByKey[this.key]},xe.prototype.getState=function(t){return t[this.key]};var ke="k-parent-node",Ce=["div","ol","ul","li","table","tbody","thead","tfoot","td","th","p","tr","col","colgroup","article","main","nav","header","footer","aside","section"],Se=function(t,e){var n=(t.ownerDocument||document).createElement(e);Array.from(t.rows).filter((function(t){return t.getAttribute(ke)===e})).forEach((function(t){t.removeAttribute(ke),n.appendChild(t)})),n.children.length&&t.appendChild(n)},Te=function(t,e){var n=e.toUpperCase();t.filter((function(t){return t.nodeName===n})).forEach((function(t){Array.from(t.children).forEach((function(n){n.setAttribute(ke,e),t.parentNode&&t.parentNode.insertBefore(n,t)})),t.remove()}))},Ee=function(t,e){void 0===e&&(e=Ce);var n=e.join("|");return t.replace(new RegExp("\\s*(<(?:"+n+")(?:\\s[^>]*?)?>)","g"),"$1").replace(new RegExp("(<\\/(?:"+n+")(?:\\s[^>]*?)?>)\\s*","g"),"$1")},Me=function(t){var e,n=document.createElement("template");if("content"in n)n.innerHTML=t,e=n.content;else{var r=(new DOMParser).parseFromString(t,"text/html");e=document.createDocumentFragment();for(var o=r.body;o&&o.firstChild;)e.appendChild(o.firstChild)}return e},Oe=function(t){var e=dt.fromSchema(t.type.schema).serializeFragment(t.content);return function(t){Array.from(t.querySelectorAll("table")).forEach((function(t){Se(t,"thead"),Se(t,"tbody"),Se(t,"tfoot");var e=Array.from(t.children).find((function(t){return 0===t.children.length}));e&&e.remove()}))}(e),e},De=function(t,e,n){return tt.fromSchema(e).parse(t,n)},Ie=function(t,e,n){var r,o=Me(t);return r=o,Array.from(r.querySelectorAll("table")).forEach((function(t){var e=Array.from(t.children);e.some((function(t){return"THEAD"===t.nodeName||"TFOOT"===t.nodeName}))&&(Te(e,"thead"),Te(e,"tbody"),Te(e,"tfoot"));var n=e.find((function(t){return"COLGROUP"===t.nodeName}));n&&(t.setAttribute("k-colgroup-data",n.outerHTML),n.remove())})),De(o,e,n)},Ae=function(t){var e=Oe(t.doc),n=document.createElement("div");return n.appendChild(e),n.innerHTML},Ne=function(t,e,n){return void 0===e&&(e="setHTML"),void 0===n&&(n={preserveWhitespace:"full"}),function(r,o){return o(r.tr.setSelection(new ae(r.doc)).replaceSelectionWith(Ie(t,r.schema,n)).setMeta("commandName",e))}},Be=n(0),ze=function(t,e){var n=e.style,r=e.value,o=e.newValue;if(!t)return{changed:!1,style:null};var i=t.split(/\s*;\s*/).filter((function(t){return Boolean(t)})),s=i.filter((function(t){var e=t.split(/\s*:\s*/);return!(e[0].toLowerCase()===n&&r.test(e[1]))}));return o&&s.push(n+": "+o),{style:s.join("; ")+(s.length?";":""),changed:Boolean(o)||s.length!==i.length}},Pe=function(t,e){for(var n=t.selection.$from,r=n.depth;r>=0;r--){var o=n.index(r);if(n.node(r).canReplaceWith(o,o,e))return!0}return!1},Re=function(t){return t instanceof O?t.type.name:t.name},Fe=function(t,e){return void 0===e&&(e=1),function(n){return function(t,e){return void 0===e&&(e=1),function(n){for(var r=n.$from,o=r.depth;o>0;o--){var i=r.node(o);if(t(i)&&0===(e-=1))return{depth:o,node:i}}}}((function(e){return Re(e)===Re(t)}),e)(n)}},Le=function(t,e){return function(n,r){var o=n.tr.replaceSelectionWith(t);e&&o.scrollIntoView(),r(o)}},Ve=function(t,e,n,r){var o=i.from(Ie(t,n,r)),s=i.from(Ie(e,n,r));return o.eq(s)},je=function(t){var e=t.selection;if(e instanceof re||e instanceof ae){var n=e.content().content;return n.textBetween(0,n.size)}return""},$e=function(t){if(t.selection instanceof ie)return t.selection.node},We=function(t){var e="",n=!1,r=t.selection,o=t.doc,i=r.$from,s=r.$to,a=r.from,c=r.to;return i.sameParent(s)&&(o.nodesBetween(a,c,(function(t){n=n||t.isLeaf&&!t.isText})),n||(e=je(t))),e},He=function(t){return t.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$/,"")},qe={before:/[^ !,?.\[\]{}()]+$/i,after:/^[^ !,?.\[\]{}()]+/i},Je=function(t,e,n){if(!n.applyToWord||!t.selection.empty)return{state:t,dispatch:e};var r=!0===n.applyToWord?qe:n.applyToWord,o=null,i=t.tr,s=t.selection,a=s.$head.nodeBefore,c=s.$head.nodeAfter;if(a&&"text"===a.type.name&&a.text&&c&&"text"===c.type.name&&c.text){var u=[];s.$head.parent.descendants((function(t,e){return u.push({node:t,pos:e}),!1}));for(var l=s.$head.parentOffset,d=u.findIndex((function(t){var e=t.node,n=t.pos;return n<=l&&n+e.nodeSize>=l})),p=u[d].node.text,f=!1,h=d-1;h>=0;h--){var m=u[h];!f&&m&&"text"===m.node.type.name?p=m.node.text+p:(f=!0,l-=m.node.nodeSize)}for(h=d+1;h<u.length;h++){if(!(m=u[h])||"text"!==m.node.type.name)break;p+=m.node.text}var v=p.substring(0,l),g=p.substring(l),y=r.before.exec(v),b=r.after.exec(g);if(y&&b){var w=y[0].length,_=b[0].length,x=o=s.from;i.setSelection(re.create(t.doc,x-w,x+_));return{state:{tr:i,selection:i.selection,doc:i.doc,storedMarks:null,schema:i.doc.type.schema},dispatch:function(t){t.setSelection(re.create(t.doc,o)),e(t)}}}}return{state:t,dispatch:e}},Ke=function(t,e){return function(n,r,o){var i=Je(n,r,e),s=i.state,a=i.dispatch;return t(e)(s,a)}},Ue=function(t,e,n){for(var r=function(r){var o=e[r],i=o.$from,s=o.$to,a=0===i.depth&&t.type.allowsMarkType(n);if(t.nodesBetween(i.pos,s.pos,(function(t){if(a)return!1;a=t.inlineContent&&t.type.allowsMarkType(n)})),a)return{v:!0}},o=0;o<e.length;o++){var i=r(o);if(i)return i.v}return!1},Ge=function(t,e,n){return function(r,o){var i=r.selection,s=i.empty,a=i.$cursor,c=i.ranges;if(s&&!a||!Ue(r.doc,c,t))return!1;if(o)if(a)t.isInSet(r.storedMarks||a.marks())?o(n.removeStoredMark(t)):o(n.addStoredMark(t.create(e)));else{for(var u=!1,l=0;!u&&l<c.length;l++){var d=c[l],p=d.$from,f=d.$to;u=r.doc.rangeHasMark(p.pos,f.pos,t)}for(l=0;l<c.length;l++){var h=c[l];p=h.$from,f=h.$to;u?n.removeMark(p.pos,f.pos,t):n.addMark(p.pos,f.pos,t.create(e))}o(n.scrollIntoView())}return!0}},Ye=function(t,e,n,r){void 0===r&&(r=null);var o=[],i=0;return t.doc.nodesBetween(e,n,(function(t,s){if(t.isInline){i++;var a=null;if(r instanceof X){var c=r.isInSet(t.marks);c&&(a=[c])}else r?r.isInSet(t.marks)&&(a=[r]):a=t.marks;if(a&&a.length)for(var u=Math.min(s+t.nodeSize,n),l=0;l<a.length;l++){for(var d=a[l],p=void 0,f=0;f<o.length;f++){var h=o[f];h.step===i-1&&d.eq(h.style)&&(p=h)}p?(p.to=u,p.step=i):o.push({style:d,from:Math.max(s,e),to:u,step:i})}}})),o.forEach((function(e){return t.step(new jt(e.from,e.to,e.style))})),t},Xe=function(t){var e=(void 0===t?{}:t).except,n=void 0===e?[]:e;return function(t,e){var r,o=t.tr;Ze(o,{except:(r=n,r instanceof Array?r:[r])}),o.docChanged&&e(o)}},Ze=function(t,e){var n=e.except,r=t.doc,o=t.selection,i=r.type.schema,s=o.empty,a=o.ranges,c=(n||[]).map((function(t){return t.name}));if(!s){var u=Object.keys(i.marks).map((function(t){return i.marks[t]})).filter((function(t){return-1===c.indexOf(t.name)}));a.forEach((function(e){var n=e.$from,r=e.$to;u.forEach((function(e){return t.removeMark(n.pos,r.pos,e)}))}))}},Qe=function(t,e){var n,r=t.schema.marks,o=(e.altMarks||[]).filter((function(t){return r[t]})),i=e.altStyle,s=t.selection,a=s.from,c=s.$from,u=s.to,l=s.empty,d=r[e.mark],p=t.doc,f=!1;return l?(n=t.storedMarks||c.marks(),f=d&&d.isInSet(n)||o.some((function(t){return r[t].isInSet(n)}))):f=d&&p.rangeHasMark(a,u,d)||o.some((function(t){return p.rangeHasMark(a,u,r[t])})),!f&&i&&r.style?en(t,r.style).some((function(t){return null!==tn(t,i)})):Boolean(f)},tn=function(t,e){for(var n=(t&&t.attrs.style||"").split(/\s*;\s*/).filter((function(t){return Boolean(t)})),r=0;r<n.length;r++){var o=n[r].split(/\s*:\s*/);if(o[0].toLowerCase()===e.name&&e.value.test(o[1]))return o[1]}return null},en=function(t,e){var n=t.selection,r=n.from,o=n.$from,i=n.to,s=n.empty,a=[];return s?a.push(e.isInSet(t.storedMarks||o.marks())):t.doc.nodesBetween(r,i,(function(t){t.isInline&&a.push(e.isInSet(t.marks))})),a},nn=function(t,e){var n=en(t,e),r=n.filter((function(t){return Boolean(t)}));return n.length===r.length?n[0]:void 0},rn=function(t,e){var n=en(t,e),r=n.filter((function(t){return Boolean(t)}));return{hasNodesWithoutMarks:n.length!==r.length,marks:r}},on=function(t,e){var n=t.find((function(t){return"style"===t.type.name})),r=n&&n.attrs.style;return ze(r,e)},sn=function(t,e,n,r,o){var i=o.create({style:r.style}),s=[],a=[],c=null,u=null;return t.doc.nodesBetween(e,n,(function(t,l,d){if(t.isInline){var p=t.marks;if(!i.isInSet(p)&&d.type.allowsMarkType(i.type)){var f=Math.max(l,e),h=Math.min(l+t.nodeSize,n),m=on(p,r);if(m.changed||r.newValue){for(var v=m.changed?{style:m.style||null}:{style:[r.style]+": "+r.newValue+";"},g=o.isInSet(p)?p.find((function(t){return"style"===t.type.name})):null,y=g?Be.__assign({},g.attrs,v):v,b=o.create(y),w=b.addToSet(p),_=0;_<p.length;_++)p[_].isInSet(w)||(c&&c.to===f&&c.mark.eq(p[_])?c.to=h:(c=new jt(f,h,p[_]),s.push(c)));var x=u&&u.to===f,k=x&&b.attrs.style===u.mark.attrs.style;x&&k?u.to=h:Object.keys(y).some((function(t){return null!==y[t]}))&&(u=new Vt(f,h,b),a.push(u))}}}})),s.forEach((function(e){return t.step(e)})),a.forEach((function(e){return t.step(e)})),s.length+a.length>0},an=function(t,e){var n=t.schema.marks.style;return(n?en(t,n):[]).map((function(t){return tn(t,e)})).filter((function(t){return null!==t}))},cn=function(t,e){return function(n,r,o){var i=n.selection,s=i.empty,a=i.$cursor,c=i.ranges;if(s&&!a||!Ue(n.doc,c,t))return!1;var u,l,d,p,f=!1;if(r){var h=o||n.tr;if(a){var m=n.storedMarks||a.marks();if(t.isInSet(m)){var v=on(m,e),g=m.find((function(t){return"style"===t.type.name})),y=Be.__assign({},g?g.attrs:{},{style:v.style||null});if(u=g.attrs,l=y,d=Object.keys(u),p=Object.keys(l),d.length===p.length&&d.every((function(t){return u[t]===l[t]})))return!1;r(h.removeStoredMark(t)),Object.keys(y).some((function(t){return null!==y[t]}))&&r(h.addStoredMark(t.create(y))),f=!0}}else{for(var b=0;b<c.length;b++){var w=c[b],_=w.$from,x=w.$to;f=sn(h,_.pos,x.pos,e,t)}f&&(h.scrollIntoView(),r(h))}}return f}},un=function(t,e,n){return function(r,o){var i=r.schema.marks,s=t.altStyle,a=t.altMarks,c=void 0===a?[]:a,u=t.mark,l=e||r.tr,d=!1,p=!1,f=function(){return p=!0};s&&i.style&&(d=cn(i.style,{style:s.name,value:s.value})(r,f,l));var h=[u].concat(c).filter((function(t){return i[t]})).map((function(t){return Qe(r,{mark:t})&&i[t]})).filter((function(t){return t}));return h.length?function(t,e,n,r){var o=e.selection,i=o.$cursor,s=o.ranges;if(r=r||e.tr,i)t.forEach((function(t){t.isInSet(e.storedMarks||i.marks())&&n(r.removeStoredMark(t))}));else{for(var a=function(e){var n=s[e],o=n.$from,i=n.$to;t.forEach((function(t){Ye(r,o.pos,i.pos,t)}))},c=0;c<s.length;c++)a(c);n(r.scrollIntoView())}}(h,r,f,l):d||Ge(i[u],n,l)(r,f),p&&o(l),p}},ln=function(t,e){return function(n,r){var o=n.schema.marks.style,i={style:t.style,value:/^.+$/,newValue:t.value},s=n.tr;e&&s.setMeta("commandName",e),s.setMeta("args",t);var a=n.selection,c=a.empty,u=a.$cursor,l=a.ranges;if(c&&!u||!o||!Ue(n.doc,l,o))return!1;if(u){var d=n.storedMarks||u.marks(),p=o.isInSet(d)?d.find((function(t){return"style"===t.type.name})):null,f={style:null};if(p&&p.attrs.style){var h=ze(p.attrs.style,i);h.changed&&h.style&&(f.style=h.style)}else i.newValue&&(f.style=[i.style]+": "+i.newValue+";");var m=p?Be.__assign({},p.attrs,f):f;return Object.keys(m).some((function(t){return null!==m[t]}))?r(s.addStoredMark(o.create(m))):r(s.removeStoredMark(o)),!0}return cn(o,i)(n,r,s)}},dn=function(t,e){return function(n,r){var o=n.selection.$cursor;if(o){var i=o.parent,s=o.index(),a=n.schema.marks[t.mark],c=i.child(s).marks.find((function(t){return t.type===a})),u=i.childCount,l=o.pos-o.textOffset,d=i.child(s).nodeSize,p=void 0,f=void 0;for(p=s-1;p>=0&&c.isInSet(i.child(p).marks);)d+=f=i.child(p).nodeSize,l-=f,p-=1;for(p=s+1;p<u&&c.isInSet(i.child(p).marks);)d+=i.child(p).nodeSize,p+=1;r(Ye(e||n.tr,l,l+d,c))}else un(t,e)(n,r)}},pn=function(t,e){var n=t.mark,r=t.attrs;return void 0===e&&(e="link"),function(t,o){var i=t.schema.marks,s=t.tr;e&&(s.setMeta("commandName",e),s.setMeta("args",r));var a=!1,c=function(){return a=!0};if(function(t,e){var n=en(t,e);return 1===n.length&&n[0]?n[0]:null}(t,i[n]))!function(t,e){return function(n,r){var o=n.selection,i=o.$cursor,s=o.from,a=o.to,c=n.schema.marks[t.mark];if(i){var u=i.parent,l=i.index(),d=u.child(l).marks.find((function(t){return t.type===c})),p=u.childCount,f=i.pos-i.textOffset,h=u.child(l).nodeSize,m=void 0,v=void 0;for(m=l-1;m>=0&&d.isInSet(u.child(m).marks);)h+=v=u.child(m).nodeSize,f-=v,m-=1;for(m=l+1;m<p&&d.isInSet(u.child(m).marks);)h+=u.child(m).nodeSize,m+=1;e.removeMark(f,f+h,c),e.addMark(f,f+h,c.create(t.attrs)),r(e)}else e.doc.nodesBetween(s,a,(function(n,o){n.isInline&&c.isInSet(n.marks)&&(e.removeMark(o,o+n.nodeSize,c),e.addMark(o,o+n.nodeSize,c.create(t.attrs)),r(e))}))}}({mark:n,attrs:r},s)(t,c);else{var u=t;Qe(t,{mark:n})&&(dn({mark:n,attrs:r},s)(t,c),u=ve.create({doc:s.doc,selection:s.selection})),a?Ge(i[n],r,s)(u,c):un({mark:n},s,r)(u,c)}return a&&o(s),a}},fn=function(t){return function(e,n){n(e.tr.insertText(t.text,t.from,t.to))}},hn=function(t){return function(e,n){var r=e.schema.nodes.image,o=r.createAndFill(t);Le(o)(e,(function(e){return n(e.setMeta("commandName","insertImage").setMeta("args",t))}))}},mn=function(t,e,n,r){if(!n.isTextblock)return!1;t.selection.ranges.forEach((function(o){var s=t.steps.length,a=o.$from.pos,c=o.$to.pos;t.doc.nodesBetween(a,c,(function(o,a){if(o.eq(e)&&o.isTextblock&&!o.hasMarkup(n,r)&&function(t,e,n){var r=t.resolve(e),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}(t.doc,t.mapping.slice(s).map(a),n)){t.clearIncompatible(t.mapping.slice(s).map(a,1),n);var c=t.mapping.slice(s),u=c.map(a,1),l=c.map(a+o.nodeSize,1),d=new p(i.from(n.create(r,null,o.marks)),0,0);return t.step(new Et(u,l,u+1,l-1,d,1,!0)),!1}}))}))},vn=function(t,e){void 0===e&&(e={blocksInSelection:!1});var n=t.doc,r=t.selection,o=r.$from,i=r.ranges,s=e.blocksInSelection,a=[],c=r instanceof ie?r.node:void 0;return c?c.isBlock?(a.push(c),c.nodesBetween(0,c.content.size,(function(t){t.isBlock&&a.push(t)}))):!s&&o.parent&&o.parent.isBlock&&a.push(o.parent):i.forEach((function(t){var e=t.$from.pos,r=t.$to.pos;n.nodesBetween(e,r,(function(t,n,o,i){t.isBlock&&(!s||n>=e&&n+t.content.size+2<=r)&&a.push(t)}))})),a},gn=function(t,e){return function(n,r){var o=vn(n),i=n.schema.nodes,s=n.tr;s.setMeta("commandName",e),s.setMeta("args",{value:t}),o.forEach((function(e){if(e.type.isTextblock)if("p"===t){var n=e.attrs,r=n.level,o=Be.__rest(n,["level"]);mn(s,e,i.paragraph,o)}else if(/^h[1-6]$/i.test(t)){r=parseInt(t.substr(1),10);mn(s,e,i.heading,Be.__assign({},e.attrs,{level:r}))}else if("blockquote"===t){var a=e.attrs;r=a.level,o=Be.__rest(a,["level"]);mn(s,e,i.blockquote,o)}}));var a=s.docChanged;return a&&r(s.scrollIntoView()),a}},yn=function(t,e){void 0===e&&(e={blocksInSelection:!0});var n=t.doc,r=t.selection,o=e.blocksInSelection,i=e.blockNodeType;vn({doc:n,selection:r},{blocksInSelection:o}).filter((function(t){return t.isTextblock})).forEach((function(e){var n=e.attrs||{},r=n.style,o=void 0===r?"":r,s=n.class,a=void 0===s?"":s,c=Be.__rest(n,["style","class"]),u=i||e.type;(o||a||u!==e.type)&&mn(t,e,u,c)}))},bn=function(t){var e=vn(t),n=t.schema.nodes,r=[];return e.forEach((function(t){t.type===n.paragraph?r.push("p"):t.type===n.heading?r.push("h"+t.attrs.level):t.type===n.blockquote&&n.blockquote.isTextblock&&r.push("blockquote")})),r},wn=function(t,e){var n,r,o=t.attrs.style;o&&e.forEach((function(t){r={style:t.name,value:/^.+$/,newValue:t.value},n=ze(o,r),o=n.changed?n.style:o}));return o=o||e.reduce((function(t,e){return(t&&e.value?t+" ":"")+e.value?e.name+": "+e.value+";":""}),""),Object.assign({},t.attrs,{style:o||null})},_n=function(t,e){var n=t.selection,r=n.from,o=n.to,i=!1;return t.doc.nodesBetween(r,o,(function(t){return!(i=i||t.type===e)})),i},xn=function(t){var e=bn(t);return 1===new Set(e).size?e[0]:null},kn=function(t){return{tag:xn(t)||""}},Cn=function(t,e){return function(n,r){var o=vn(n),i=n.tr;i.setMeta("commandName",e),o.forEach((function(e){if(e.type.isTextblock){var n={},r=t.find((function(t){return t.node===e.type.name}));r&&(n=wn(e,r.style)),mn(i,e,e.type,n)}}));var s=i.docChanged;return s&&r(i.scrollIntoView()),s}},Sn=function(t,e){var n=vn(t),r=!1;return n.forEach((function(t){if(!r&&t.type.isTextblock&&t.attrs.style){var n=e.find((function(e){return e.node===t.type.name}));n&&(r=n.style.every((function(e){return!!e.value&&new RegExp(e.name+":\\s?"+e.value,"i").test(t.attrs.style)})))}})),r},Tn=function(t){return void 0===t&&(t={blocksInSelection:!0}),function(e,n){var r=e.tr,o=t.blocksInSelection,i=t.blockNodeType,s=(t.exceptMarks||[e.schema.marks.link]).filter(Boolean);Ze(r,{except:s}),yn(r,{blocksInSelection:o,blockNodeType:i});var a=r.docChanged;return a&&n&&n(r),a}},En=["ol",0],Mn=["ul",0],On=["li",0],Dn={attrs:{order:{default:1}},parseDOM:[{tag:"ol",getAttrs:function(t){return{order:t.hasAttribute("start")?+t.getAttribute("start"):1}}}],toDOM:function(t){return 1==t.attrs.order?En:["ol",{start:t.attrs.order},0]}},In={parseDOM:[{tag:"ul"}],toDOM:function(){return Mn}},An={parseDOM:[{tag:"li"}],toDOM:function(){return On},defining:!0};function Nn(t,e){var n={};for(var r in t)n[r]=t[r];for(var o in e)n[o]=e[o];return n}function Bn(t,e,n){return t.append({ordered_list:Nn(Dn,{content:"list_item+",group:n}),bullet_list:Nn(In,{content:"list_item+",group:n}),list_item:Nn(An,{content:e})})}function zn(t,e){return function(n,r){var o=n.selection,s=o.$from,a=o.$to,c=s.blockRange(a),u=!1,l=c;if(!c)return!1;if(c.depth>=2&&s.node(c.depth-1).type.compatibleContent(t)&&0==c.startIndex){if(0==s.index(c.depth-1))return!1;var d=n.doc.resolve(c.start-2);l=new T(d,d,c.depth),c.endIndex<c.parent.childCount&&(c=new T(s,n.doc.resolve(a.end(c.depth)),c.depth)),u=!0}var f=It(l,t,e,c);return!!f&&(r&&r(function(t,e,n,r,o){for(var s=i.empty,a=n.length-1;a>=0;a--)s=i.from(n[a].type.create(n[a].attrs,s));t.step(new Et(e.start-(r?2:0),e.end,e.start,e.end,new p(s,0,0),n.length,!0));for(var c=0,u=0;u<n.length;u++)n[u].type==o&&(c=u+1);for(var l=n.length-c,d=e.start+n.length-(r?2:0),f=e.parent,h=e.startIndex,m=e.endIndex,v=!0;h<m;h++,v=!1)!v&&Nt(t.doc,d,l)&&(t.split(d,l),d+=2*l),d+=f.child(h).nodeSize;return t}(n.tr,c,f,u,t).scrollIntoView()),!0)}}function Pn(t){return function(e,n){var r=e.selection,o=r.$from,s=r.$to,a=r.node;if(a&&a.isBlock||o.depth<2||!o.sameParent(s))return!1;var c=o.node(-1);if(c.type!=t)return!1;if(0==o.parent.content.size&&o.node(-1).childCount==o.indexAfter(-1)){if(2==o.depth||o.node(-3).type!=t||o.index(-2)!=o.node(-2).childCount-1)return!1;if(n){for(var u=i.empty,l=o.index(-1)?1:o.index(-2)?2:3,d=o.depth-l;d>=o.depth-3;d--)u=i.from(o.node(d).copy(u));var f=o.indexAfter(-1)<o.node(-2).childCount?1:o.indexAfter(-2)<o.node(-3).childCount?2:3;u=u.append(i.from(t.createAndFill()));var h=o.before(o.depth-(l-1)),m=e.tr.replace(h,o.after(-f),new p(u,4-l,0)),v=-1;m.doc.nodesBetween(h,m.doc.content.size,(function(t,e){if(v>-1)return!1;t.isTextblock&&0==t.content.size&&(v=e+1)})),v>-1&&m.setSelection(e.selection.constructor.near(m.doc.resolve(v))),n(m.scrollIntoView())}return!0}var g=s.pos==o.end()?c.contentMatchAt(0).defaultType:null,y=e.tr.delete(o.pos,s.pos),b=g&&[null,{type:g}];return!!Nt(y.doc,o.pos,2,b)&&(n&&n(y.split(o.pos,2,b).scrollIntoView()),!0)}}function Rn(t){return function(e,n){var r=e.selection,o=r.$from,s=r.$to,a=o.blockRange(s,(function(e){return e.childCount&&e.firstChild.type==t}));return!!a&&(!n||(o.node(a.depth-1).type==t?function(t,e,n,r){var o=t.tr,s=r.end,a=r.$to.end(r.depth);s<a&&(o.step(new Et(s-1,a,s,a,new p(i.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new T(o.doc.resolve(r.$from.pos),o.doc.resolve(a),r.depth));return e(o.lift(r,Dt(r)).scrollIntoView()),!0}(e,n,t,a):function(t,e,n){for(var r=t.tr,o=n.parent,s=n.end,a=n.endIndex-1,c=n.startIndex;a>c;a--)s-=o.child(a).nodeSize,r.delete(s-1,s+1);var u=r.doc.resolve(n.start),l=u.nodeAfter;if(r.mapping.map(n.end)!=n.start+u.nodeAfter.nodeSize)return!1;var d=0==n.startIndex,f=n.endIndex==o.childCount,h=u.node(-1),m=u.index(-1);if(!h.canReplace(m+(d?0:1),m+1,l.content.append(f?i.empty:i.from(o))))return!1;var v=u.pos,g=v+l.nodeSize;return r.step(new Et(v-(d?1:0),g+(f?1:0),v+1,g-1,new p((d?i.empty:i.from(o.copy(i.empty))).append(f?i.empty:i.from(o.copy(i.empty))),d?0:1,f?0:1),d?0:1)),e(r.scrollIntoView()),!0}(e,n,a)))}}function Fn(t){return function(e,n){var r=e.selection,o=r.$from,s=r.$to,a=o.blockRange(s,(function(e){return e.childCount&&e.firstChild.type==t}));if(!a)return!1;var c=a.startIndex;if(0==c)return!1;var u=a.parent,l=u.child(c-1);if(l.type!=t)return!1;if(n){var d=l.lastChild&&l.lastChild.type==u.type,f=i.from(d?t.create():null),h=new p(i.from(t.create(null,i.from(u.type.create(null,f)))),d?3:1,0),m=a.start,v=a.end;n(e.tr.step(new Et(m-(d?3:1),v,m,v,h,1,!0)).scrollIntoView())}return!0}}var Ln={orderedList:"ordered_list",bulletList:"bullet_list",listItem:"list_item"},Vn={listType:Ln.orderedList,types:Be.__assign({},Ln)},jn={listType:Ln.bulletList,types:Be.__assign({},Ln)},$n={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:Be.__assign({},Ln)},Wn={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:Be.__assign({},Ln)};function Hn(t,e){return!t.selection.empty&&(e&&e(t.tr.deleteSelection().scrollIntoView()),!0)}function qn(t,e,n){var r=t.selection.$cursor;if(!r||(n?!n.endOfTextblock("backward",t):r.parentOffset>0))return!1;var o=Un(r);if(!o){var i=r.blockRange(),s=i&&Dt(i);return null!=s&&(e&&e(t.tr.lift(i,s).scrollIntoView()),!0)}var a=o.nodeBefore;if(!a.type.spec.isolating&&lr(t,o,e))return!0;if(0==r.parent.content.size&&(Jn(a,"end")||ie.isSelectable(a))){var c=$t(t.doc,r.before(),r.after(),p.empty);if(c.slice.size<c.to-c.from){if(e){var u=t.tr.step(c);u.setSelection(Jn(a,"end")?te.findFrom(u.doc.resolve(u.mapping.map(o.pos,-1)),-1):ie.create(u.doc,o.pos-a.nodeSize)),e(u.scrollIntoView())}return!0}}return!(!a.isAtom||o.depth!=r.depth-1)&&(e&&e(t.tr.delete(o.pos-a.nodeSize,o.pos).scrollIntoView()),!0)}function Jn(t,e,n){for(;t;t="start"==e?t.firstChild:t.lastChild){if(t.isTextblock)return!0;if(n&&1!=t.childCount)return!1}return!1}function Kn(t,e,n){var r=t.selection,o=r.$head,i=o;if(!r.empty)return!1;if(o.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):o.parentOffset>0)return!1;i=Un(o)}var s=i&&i.nodeBefore;return!(!s||!ie.isSelectable(s))&&(e&&e(t.tr.setSelection(ie.create(t.doc,i.pos-s.nodeSize)).scrollIntoView()),!0)}function Un(t){if(!t.parent.type.spec.isolating)for(var e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function Gn(t,e,n){var r=t.selection.$cursor;if(!r||(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size))return!1;var o=Xn(r);if(!o)return!1;var i=o.nodeAfter;if(lr(t,o,e))return!0;if(0==r.parent.content.size&&(Jn(i,"start")||ie.isSelectable(i))){var s=$t(t.doc,r.before(),r.after(),p.empty);if(s.slice.size<s.to-s.from){if(e){var a=t.tr.step(s);a.setSelection(Jn(i,"start")?te.findFrom(a.doc.resolve(a.mapping.map(o.pos)),1):ie.create(a.doc,a.mapping.map(o.pos))),e(a.scrollIntoView())}return!0}}return!(!i.isAtom||o.depth!=r.depth-1)&&(e&&e(t.tr.delete(o.pos,o.pos+i.nodeSize).scrollIntoView()),!0)}function Yn(t,e,n){var r=t.selection,o=r.$head,i=o;if(!r.empty)return!1;if(o.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):o.parentOffset<o.parent.content.size)return!1;i=Xn(o)}var s=i&&i.nodeAfter;return!(!s||!ie.isSelectable(s))&&(e&&e(t.tr.setSelection(ie.create(t.doc,i.pos)).scrollIntoView()),!0)}function Xn(t){if(!t.parent.type.spec.isolating)for(var e=t.depth-1;e>=0;e--){var n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}function Zn(t,e){var n,r=t.selection,o=r instanceof ie;if(o){if(r.node.isTextblock||!Bt(t.doc,r.from))return!1;n=r.from}else if(null==(n=Pt(t.doc,r.from,-1)))return!1;if(e){var i=t.tr.join(n);o&&i.setSelection(ie.create(i.doc,n-t.doc.resolve(n).nodeBefore.nodeSize)),e(i.scrollIntoView())}return!0}function Qn(t,e){var n,r=t.selection;if(r instanceof ie){if(r.node.isTextblock||!Bt(t.doc,r.to))return!1;n=r.to}else if(null==(n=Pt(t.doc,r.to,1)))return!1;return e&&e(t.tr.join(n).scrollIntoView()),!0}function tr(t,e){var n=t.selection,r=n.$from,o=n.$to,i=r.blockRange(o),s=i&&Dt(i);return null!=s&&(e&&e(t.tr.lift(i,s).scrollIntoView()),!0)}function er(t,e){var n=t.selection,r=n.$head,o=n.$anchor;return!(!r.parent.type.spec.code||!r.sameParent(o))&&(e&&e(t.tr.insertText("\n").scrollIntoView()),!0)}function nr(t){for(var e=0;e<t.edgeCount;e++){var n=t.edge(e).type;if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function rr(t,e){var n=t.selection,r=n.$head,o=n.$anchor;if(!r.parent.type.spec.code||!r.sameParent(o))return!1;var i=r.node(-1),s=r.indexAfter(-1),a=nr(i.contentMatchAt(s));if(!i.canReplaceWith(s,s,a))return!1;if(e){var c=r.after(),u=t.tr.replaceWith(c,c,a.createAndFill());u.setSelection(te.near(u.doc.resolve(c),1)),e(u.scrollIntoView())}return!0}function or(t,e){var n=t.selection,r=n.$from,o=n.$to;if(n instanceof ae||r.parent.inlineContent||o.parent.inlineContent)return!1;var i=nr(o.parent.contentMatchAt(o.indexAfter()));if(!i||!i.isTextblock)return!1;if(e){var s=(!r.parentOffset&&o.index()<o.parent.childCount?r:o).pos,a=t.tr.insert(s,i.createAndFill());a.setSelection(re.create(a.doc,s+1)),e(a.scrollIntoView())}return!0}function ir(t,e){var n=t.selection.$cursor;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){var r=n.before();if(Nt(t.doc,r))return e&&e(t.tr.split(r).scrollIntoView()),!0}var o=n.blockRange(),i=o&&Dt(o);return null!=i&&(e&&e(t.tr.lift(o,i).scrollIntoView()),!0)}function sr(t,e){var n=t.selection,r=n.$from,o=n.$to;if(t.selection instanceof ie&&t.selection.node.isBlock)return!(!r.parentOffset||!Nt(t.doc,r.pos))&&(e&&e(t.tr.split(r.pos).scrollIntoView()),!0);if(!r.parent.isBlock)return!1;if(e){var i=o.parentOffset==o.parent.content.size,s=t.tr;(t.selection instanceof re||t.selection instanceof ae)&&s.deleteSelection();var a=0==r.depth?null:nr(r.node(-1).contentMatchAt(r.indexAfter(-1))),c=i&&a?[{type:a}]:null,u=Nt(s.doc,s.mapping.map(r.pos),1,c);if(c||u||!Nt(s.doc,s.mapping.map(r.pos),1,a&&[{type:a}])||(c=[{type:a}],u=!0),u&&(s.split(s.mapping.map(r.pos),1,c),!i&&!r.parentOffset&&r.parent.type!=a)){var l=s.mapping.map(r.before()),d=s.doc.resolve(l);r.node(-1).canReplaceWith(d.index(),d.index()+1,a)&&s.setNodeMarkup(s.mapping.map(r.before()),a)}e(s.scrollIntoView())}return!0}function ar(t,e){return sr(t,e&&function(n){var r=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();r&&n.ensureMarks(r),e(n)})}function cr(t,e){var n,r=t.selection,o=r.$from,i=r.to,s=o.sharedDepth(i);return 0!=s&&(n=o.before(s),e&&e(t.tr.setSelection(ie.create(t.doc,n))),!0)}function ur(t,e){return e&&e(t.tr.setSelection(new ae(t.doc))),!0}function lr(t,e,n){var r,o,s=e.nodeBefore,a=e.nodeAfter;if(s.type.spec.isolating||a.type.spec.isolating)return!1;if(function(t,e,n){var r=e.nodeBefore,o=e.nodeAfter,i=e.index();return!!(r&&o&&r.type.compatibleContent(o.type))&&(!r.content.size&&e.parent.canReplace(i-1,i)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!(!e.parent.canReplace(i,i+1)||!o.isTextblock&&!Bt(t.doc,e.pos))&&(n&&n(t.tr.clearIncompatible(e.pos,r.type,r.contentMatchAt(r.childCount)).join(e.pos).scrollIntoView()),!0))}(t,e,n))return!0;var c=e.parent.canReplace(e.index(),e.index()+1);if(c&&(r=(o=s.contentMatchAt(s.childCount)).findWrapping(a.type))&&o.matchType(r[0]||a.type).validEnd){if(n){for(var u=e.pos+a.nodeSize,l=i.empty,d=r.length-1;d>=0;d--)l=i.from(r[d].create(null,l));l=i.from(s.copy(l));var f=t.tr.step(new Et(e.pos-1,u,e.pos,u,new p(l,1,0),r.length,!0)),h=u+2*r.length;Bt(f.doc,h)&&f.join(h),n(f.scrollIntoView())}return!0}var m=te.findFrom(e,1),v=m&&m.$from.blockRange(m.$to),g=v&&Dt(v);if(null!=g&&g>=e.depth)return n&&n(t.tr.lift(v,g).scrollIntoView()),!0;if(c&&Jn(a,"start",!0)&&Jn(s,"end")){for(var y=s,b=[];b.push(y),!y.isTextblock;)y=y.lastChild;for(var w=a,_=1;!w.isTextblock;w=w.firstChild)_++;if(y.canReplace(y.childCount,y.childCount,w.content)){if(n){for(var x=i.empty,k=b.length-1;k>=0;k--)x=i.from(b[k].copy(x));n(t.tr.step(new Et(e.pos-b.length,e.pos+a.nodeSize,e.pos+_,e.pos+a.nodeSize-_,new p(x,b.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function dr(t){return function(e,n){for(var r=e.selection,o=t<0?r.$from:r.$to,i=o.depth;o.node(i).isInline;){if(!i)return!1;i--}return!!o.node(i).isTextblock&&(n&&n(e.tr.setSelection(re.create(e.doc,t<0?o.start(i):o.end(i)))),!0)}}var pr=dr(-1),fr=dr(1);function hr(t,e){return function(n,r){var o=n.selection,i=o.$from,s=o.$to,a=i.blockRange(s),c=a&&It(a,t,e);return!!c&&(r&&r(n.tr.wrap(a,c).scrollIntoView()),!0)}}function mr(t,e){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(t,e))if(r.type==t)a=!0;else{var i=n.doc.resolve(o),s=i.index();a=i.parent.canReplaceWith(s,s+1,t)}})),!!a&&(r&&r(n.tr.setBlockType(i,s,t,e).scrollIntoView()),!0)}}function vr(t,e){return function(n,r){var o=n.selection,i=o.empty,s=o.$cursor,a=o.ranges;if(i&&!s||!function(t,e,n){for(var r=function(r){var o=e[r],i=o.$from,s=o.$to,a=0==i.depth&&t.type.allowsMarkType(n);if(t.nodesBetween(i.pos,s.pos,(function(t){if(a)return!1;a=t.inlineContent&&t.type.allowsMarkType(n)})),a)return{v:!0}},o=0;o<e.length;o++){var i=r(o);if(i)return i.v}return!1}(n.doc,a,t))return!1;if(r)if(s)t.isInSet(n.storedMarks||s.marks())?r(n.tr.removeStoredMark(t)):r(n.tr.addStoredMark(t.create(e)));else{for(var c=!1,u=n.tr,l=0;!c&&l<a.length;l++){var d=a[l],p=d.$from,f=d.$to;c=n.doc.rangeHasMark(p.pos,f.pos,t)}for(var h=0;h<a.length;h++){var m=a[h],v=m.$from,g=m.$to;if(c)u.removeMark(v.pos,g.pos,t);else{var y=v.pos,b=g.pos,w=v.nodeAfter,_=g.nodeBefore,x=w&&w.isText?/^\s*/.exec(w.text)[0].length:0,k=_&&_.isText?/\s*$/.exec(_.text)[0].length:0;y+x<b&&(y+=x,b-=k),u.addMark(y,b,t.create(e))}}r(u.scrollIntoView())}return!0}}function gr(t,e){if(Array.isArray(e)){var n=e;e=function(t){return n.indexOf(t.type.name)>-1}}return function(n,r,o){return t(n,r&&function(t,e){return function(n){if(!n.isGeneric)return t(n);for(var r=[],o=0;o<n.mapping.maps.length;o++){for(var i=n.mapping.maps[o],s=0;s<r.length;s++)r[s]=i.map(r[s]);i.forEach((function(t,e,n,o){return r.push(n,o)}))}for(var a=[],c=0;c<r.length;c+=2)for(var u=r[c],l=r[c+1],d=n.doc.resolve(u),p=d.sharedDepth(l),f=d.node(p),h=d.indexAfter(p),m=d.after(p+1);m<=l;++h){var v=f.maybeChild(h);if(!v)break;if(h&&-1==a.indexOf(m)){var g=f.child(h-1);g.type==v.type&&e(g,v)&&a.push(m)}m+=v.nodeSize}a.sort((function(t,e){return t-e}));for(var y=a.length-1;y>=0;y--)Bt(n.doc,a[y])&&n.join(a[y]);t(n)}}(r,e),o)}}function yr(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return function(e,n,r){for(var o=0;o<t.length;o++)if(t[o](e,n,r))return!0;return!1}}var br=yr(Hn,qn,Kn),wr=yr(Hn,Gn,Yn),_r={Enter:yr(er,or,ir,sr),"Mod-Enter":rr,Backspace:br,"Mod-Backspace":br,"Shift-Backspace":br,Delete:wr,"Mod-Delete":wr,"Mod-a":ur},xr={"Ctrl-h":_r.Backspace,"Alt-Backspace":_r["Mod-Backspace"],"Ctrl-d":_r.Delete,"Ctrl-Alt-Backspace":_r["Mod-Delete"],"Alt-Delete":_r["Mod-Delete"],"Alt-d":_r["Mod-Delete"],"Ctrl-a":pr,"Ctrl-e":fr};for(var kr in _r)xr[kr]=_r[kr];_r.Home=pr,_r.End=fr;var Cr=("undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):"undefined"!=typeof os&&"darwin"==os.platform())?xr:_r,Sr=function(t,e){return hr(t.schema.nodes.blockquote)(t,e)},Tr=function(t,e){var n=t.selection,r=n.$from,o=n.$to,i=t.schema.nodes.blockquote,s=t.doc,a=-1,c=r.blockRange(o);c&&s.nodesBetween(c.start,c.end,(function(t,e,n,r){t.type===i&&(a=e)}));var u=-1!==a;return e&&u&&e(t.tr.lift(c,s.resolve(a).depth)),u},Er=function(t,e,n){return function(r,o){var i=vn(r),s=r.tr;s.setMeta("commandName",e),i.forEach((function(e){if(e.type.isTextblock){var r=void 0,o=t.find((function(t){return t.node===e.type.name}));if(o){var i="rtl"===n?o.rtlStyle:o.style,a={name:i,value:o.step>0?""+o.step+o.unit:""};if(e.attrs.style){var c=new RegExp(i+":\\s?(\\d+)"+o.unit,"i"),u=e.attrs.style.match(c);if(u){var l=parseFloat(u[1])+o.step;l=l<=0?"":l,a.value=""+l+(l?o.unit:"")}}r=wn(e,[a])}r&&mn(s,e,e.type,r)}}));var a=s.docChanged;return a&&o(s.scrollIntoView()),a}},Mr=function(t,e,n){var r=vn(t),o=!1;return r.forEach((function(t){if(!o&&t.type.isTextblock&&t.attrs.style){var r=e.find((function(e){return e.node===t.type.name}));if(r){var i="rtl"===n?r.rtlStyle:r.style,s=new RegExp(i+":\\s?\\d+"+r.unit,"i");o=s.test(t.attrs.style)}}})),o},Or=function(t,e){return Fn(e)(t)},Dr=function(t,e){var n=t.schema.nodes[e.listsTypes.listItem],r=t.schema.nodes[e.listsTypes.orderedList],o=t.schema.nodes[e.listsTypes.bulletList],i=!!Fe(r,2)(t.selection),s=!!Fe(o,2)(t.selection);return(i||s)&&Rn(n)(t)},Ir=function(t,e){var n=t.schema.nodes,r=n[$n.listsTypes.listItem];return(Mr(t,e.nodes)||$n.nodes.some((function(e){return n[e.node]&&_n(t,n[e.node])})))&&!_n(t,r)},Ar=function(t,e){var n=t.schema.nodes[$n.listsTypes.listItem],r=Ir(t,$n);Or(t,n)?Fn(n)(t,e):r&&Er($n.nodes)(t,e)},Nr=function(t,e){var n=t.schema.nodes,r=n[Wn.listsTypes.listItem],o=Ir(t,Wn);_n(t,n.blockquote)?Tr(t,e):Dr(t,Wn)?Rn(r)(t,e):o&&Er(Wn.nodes)(t,e)},Br=function(t,e,n){for(var r=e.depth,o=t.nodes[n.bulletList],i=t.nodes[n.orderedList],s=t.nodes[n.listItem],a=e.depth;a>0;a--){var c=e.node(a);if(c.type!==o&&c.type!==i||(r=a),c.type!==o&&c.type!==i&&c.type!==s)break}return r-1};function zr(t){return function(e,n,r){if(!r)return!1;var o=(e=r.state).schema.nodes[t.listType],i=e.selection,s=i.$from,a=i.$to,c=s.node(-2),u=s.node(-3),l=function(t,e,n,r){return 0===function(t,e,n){var r=Array(),o=function(t,e){var n=["blockquote","bulletList","orderedList"];if(1===e.depth)return e;var r=e.node(e.depth),o=e;for(;e.depth>=1;)e=t.resolve(e.before(e.depth)),(r=e.node(e.depth))&&-1!==n.indexOf(r.type.name)&&(o=e);return o}(t,e).depth,i=t.resolve(e.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 c=t.resolve(i.after(s));if(c.start(s)>=t.nodeSize-2)break;c.depth!==i.depth&&(c=t.resolve(c.pos+2)),i=c.depth?t.resolve(c.start(c.depth)):t.resolve(c.end(c.depth))}return r}(t,e,n).filter((function(t){return t.type!==r})).length}(e.doc,s,a,o);return(c&&c.type===o||u&&u.type===o)&&l?Rr(t)(e,n):(l||(Rr(t)(e,n),e=r.state),function(t,e){void 0===e&&(e={});return gr(zn(t,e),(function(e,n){return e.type===n.type&&e.type===t}))}(o,t.listAttrs)(e,n))}}function Pr(t,e,n,r){var o=r||t.schema.nodes.listItem,s=e.$from,a=e.$to,c=s.blockRange(a,(function(t){return t.childCount&&t.firstChild.type===o}));if(!c||c.depth<2||s.node(c.depth-1).type!==o)return n;var u=c.end,l=a.end(c.depth);return u<l&&(n.step(new Et(u-1,l,u,l,new p(i.from(o.create(void 0,c.parent.copy())),1,0),1,!0)),c=new T(n.doc.resolve(s.pos),n.doc.resolve(l),c.depth)),n.lift(c,Dt(c)).scrollIntoView()}function Rr(t){return function(e,n){var r=e.tr,o=e.selection,i=o.$from,s=o.$to;return r.doc.nodesBetween(i.pos,s.pos,(function(n,o){if(n.isTextblock||"blockquote"===n.type.name||"div"===n.type.name){var i=new ie(r.doc.resolve(r.mapping.map(o))),s=i.$from.blockRange(i.$to);if(!s||i.$from.parent.type!==e.schema.nodes[t.listItem])return!1;var a=s&&Dt(s);if(null==a)return!1;r.lift(s,a)}})),n&&n(r),!0}}var Fr=/list\-style\-type:\s?([\w-]+)/,Lr=function(t){var e=t.style||"",n=Fr.exec(e);return n&&n[1]||""},Vr=function(t,e,n,r,o){var i=r.listType,s=r.listAttrs,a=void 0===s?{style:null}:s,c=t.selection,u=c.$from.node(c.$from.depth-2),l=c.$to.node(c.$to.depth-2);if(u&&u.type.name===i&&Lr(u.attrs)===Lr(a)&&l&&l.type.name===i&&Lr(l.attrs)===Lr(a)){var d=n.state.schema.nodes,p={bulletList:d[r.bulletList],orderedList:d[r.orderedList],listItem:d[r.listItem]},f=function(t,e){for(var n,r=e.bulletList,o=e.orderedList,i=e.listItem,s=t.depth-1;s>0;s--){var a=t.node(s);if(a.type!==r&&a.type!==o||(n=s),a.type!==r&&a.type!==o&&a.type!==i)break}return n}(c.$to,p),h=function(t,e,n,r,o,i){i||(i=t.schema.nodes.listItem);var s=!1;return o.doc.nodesBetween(e,n,(function(n,a){if(!s&&n.type===i&&a>e){s=!0;for(var c=r+3;c>r+2;){var u=o.doc.resolve(o.mapping.map(a));c=u.depth;var l=o.doc.resolve(o.mapping.map(a+n.textContent.length)),d=new re(u,l);o=Pr(t,d,o,i)}}})),o}(t,c.$to.pos,c.$to.end(f),f,n.state.tr,p.listItem);return(h=function(t,e,n){var r=t.selection,o=r.from,i=r.to,s=t.schema.nodes,a=s.paragraph,c=s.heading,u=[];e.doc.nodesBetween(o,i,(function(t,e){t.type!==a&&t.type!==c||u.push({node:t,pos:e})}));for(var l=u.length-1;l>=0;l--){var d=u[l],p=e.doc.resolve(e.mapping.map(d.pos));if(p.depth>0){var f=void 0;f=d.node.textContent&&d.node.textContent.length>0?e.doc.resolve(e.mapping.map(d.pos+d.node.textContent.length)):e.doc.resolve(e.mapping.map(d.pos+1));var h=p.blockRange(f);h&&e.lift(h,Br(t.schema,p,n))}}return e}(t,h,r)).setMeta("commandName",o),e(h),!0}return zr(r)(t,e,n)};function jr(t,e,n){return Vr(t,e,n,Be.__assign({listType:jn.listType},jn.types))}function $r(t,e,n){return Vr(t,e,n,Be.__assign({listType:Vn.listType},Vn.types))}for(var Wr=function(t,e){return{name:t,value:e}},Hr=[{node:"paragraph",style:[Wr("text-align","left")]},{node:"heading",style:[Wr("text-align","left")]}],qr=[{node:"paragraph",style:[Wr("text-align","right")]},{node:"heading",style:[Wr("text-align","right")]}],Jr=[{node:"paragraph",style:[Wr("text-align","center")]},{node:"heading",style:[Wr("text-align","center")]}],Kr=[{node:"paragraph",style:[Wr("text-align","justify")]},{node:"heading",style:[Wr("text-align","justify")]}],Ur=[{node:"paragraph",style:[Wr("text-align","")]},{node:"heading",style:[Wr("text-align","")]}],Gr={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"},Yr={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"},Xr="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent),Zr="undefined"!=typeof navigator&&/Apple Computer/.test(navigator.vendor),Qr="undefined"!=typeof navigator&&/Gecko\/\d+/.test(navigator.userAgent),to="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),eo="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),no=Xr&&(to||+Xr[1]<57)||Qr&&to,ro=0;ro<10;ro++)Gr[48+ro]=Gr[96+ro]=String(ro);for(ro=1;ro<=24;ro++)Gr[ro+111]="F"+ro;for(ro=65;ro<=90;ro++)Gr[ro]=String.fromCharCode(ro+32),Yr[ro]=String.fromCharCode(ro);for(var oo in Gr)Yr.hasOwnProperty(oo)||(Yr[oo]=Gr[oo]);var io="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function so(t){var e,n,r,o,i=t.split(/-(?!$)/),s=i[i.length-1];"Space"==s&&(s=" ");for(var a=0;a<i.length-1;a++){var c=i[a];if(/^(cmd|meta|m)$/i.test(c))o=!0;else if(/^a(lt)?$/i.test(c))e=!0;else if(/^(c|ctrl|control)$/i.test(c))n=!0;else if(/^s(hift)?$/i.test(c))r=!0;else{if(!/^mod$/i.test(c))throw new Error("Unrecognized modifier name: "+c);io?o=!0:n=!0}}return e&&(s="Alt-"+s),n&&(s="Ctrl-"+s),o&&(s="Meta-"+s),r&&(s="Shift-"+s),s}function ao(t,e,n){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),!1!==n&&e.shiftKey&&(t="Shift-"+t),t}function co(t){return new be({props:{handleKeyDown:uo(t)}})}function uo(t){var e=function(t){var e=Object.create(null);for(var n in t)e[so(n)]=t[n];return e}(t);return function(t,n){var r,o=function(t){var e=!(no&&(t.ctrlKey||t.altKey||t.metaKey)||(Zr||eo)&&t.shiftKey&&t.key&&1==t.key.length)&&t.key||(t.shiftKey?Yr:Gr)[t.keyCode]||t.key||"Unidentified";return"Esc"==e&&(e="Escape"),"Del"==e&&(e="Delete"),"Left"==e&&(e="ArrowLeft"),"Up"==e&&(e="ArrowUp"),"Right"==e&&(e="ArrowRight"),"Down"==e&&(e="ArrowDown"),e}(n),i=1==o.length&&" "!=o,s=e[ao(o,n,!i)];if(s&&s(t.state,t.dispatch,t))return!0;if(i&&(n.shiftKey||n.altKey||n.metaKey||o.charCodeAt(0)>127)&&(r=Gr[n.keyCode])&&r!=o){var a=e[ao(r,n,!0)];if(a&&a(t.state,t.dispatch,t))return!0}else if(i&&n.shiftKey){var c=e[ao(o,n,!0)];if(c&&c(t.state,t.dispatch,t))return!0}return!1}}var lo={};if("undefined"!=typeof navigator&&"undefined"!=typeof document){var po=/Edge\/(\d+)/.exec(navigator.userAgent),fo=/MSIE \d/.test(navigator.userAgent),ho=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),mo=lo.ie=!!(fo||ho||po);lo.ie_version=fo?document.documentMode||6:ho?+ho[1]:po?+po[1]:null,lo.gecko=!mo&&/gecko\/(\d+)/i.test(navigator.userAgent),lo.gecko_version=lo.gecko&&+(/Firefox\/(\d+)/.exec(navigator.userAgent)||[0,0])[1];var vo=!mo&&/Chrome\/(\d+)/.exec(navigator.userAgent);lo.chrome=!!vo,lo.chrome_version=vo&&+vo[1],lo.safari=!mo&&/Apple Computer/.test(navigator.vendor),lo.ios=lo.safari&&(/Mobile\/\w+/.test(navigator.userAgent)||navigator.maxTouchPoints>2),lo.mac=lo.ios||/Mac/.test(navigator.platform),lo.android=/Android \d/.test(navigator.userAgent),lo.webkit="webkitFontSmoothing"in document.documentElement.style,lo.webkit_version=lo.webkit&&+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]}var go=function(t){for(var e=0;;e++)if(!(t=t.previousSibling))return e},yo=function(t){var e=t.assignedSlot||t.parentNode;return e&&11==e.nodeType?e.host:e},bo=null,wo=function(t,e,n){var r=bo||(bo=document.createRange());return r.setEnd(t,null==n?t.nodeValue.length:n),r.setStart(t,e||0),r},_o=function(t,e,n,r){return n&&(ko(t,e,n,r,-1)||ko(t,e,n,r,1))},xo=/^(img|br|input|textarea|hr)$/i;function ko(t,e,n,r,o){for(;;){if(t==n&&e==r)return!0;if(e==(o<0?0:Co(t))){var i=t.parentNode;if(1!=i.nodeType||So(t)||xo.test(t.nodeName)||"false"==t.contentEditable)return!1;e=go(t)+(o<0?0:1),t=i}else{if(1!=t.nodeType)return!1;if("false"==(t=t.childNodes[e+(o<0?-1:0)]).contentEditable)return!1;e=o<0?Co(t):0}}}function Co(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function So(t){for(var e,n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}var To=function(t){var e=t.isCollapsed;return e&&lo.chrome&&t.rangeCount&&!t.getRangeAt(0).collapsed&&(e=!1),e};function Eo(t,e){var n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function Mo(t){return{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function Oo(t,e){return"number"==typeof t?t:t[e]}function Do(t){var e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function Io(t,e,n){for(var r=t.someProp("scrollThreshold")||0,o=t.someProp("scrollMargin")||5,i=t.dom.ownerDocument,s=n||t.dom;s;s=yo(s))if(1==s.nodeType){var a=s==i.body||1!=s.nodeType,c=a?Mo(i):Do(s),u=0,l=0;if(e.top<c.top+Oo(r,"top")?l=-(c.top-e.top+Oo(o,"top")):e.bottom>c.bottom-Oo(r,"bottom")&&(l=e.bottom-c.bottom+Oo(o,"bottom")),e.left<c.left+Oo(r,"left")?u=-(c.left-e.left+Oo(o,"left")):e.right>c.right-Oo(r,"right")&&(u=e.right-c.right+Oo(o,"right")),u||l)if(a)i.defaultView.scrollBy(u,l);else{var d=s.scrollLeft,p=s.scrollTop;l&&(s.scrollTop+=l),u&&(s.scrollLeft+=u);var f=s.scrollLeft-d,h=s.scrollTop-p;e={left:e.left-f,top:e.top-h,right:e.right-f,bottom:e.bottom-h}}if(a)break}}function Ao(t){for(var e=[],n=t.ownerDocument;t&&(e.push({dom:t,top:t.scrollTop,left:t.scrollLeft}),t!=n);t=yo(t));return e}function No(t,e){for(var n=0;n<t.length;n++){var r=t[n],o=r.dom,i=r.top,s=r.left;o.scrollTop!=i+e&&(o.scrollTop=i+e),o.scrollLeft!=s&&(o.scrollLeft=s)}}var Bo=null;function zo(t,e){for(var n,r,o=2e8,i=0,s=e.top,a=e.top,c=t.firstChild,u=0;c;c=c.nextSibling,u++){var l=void 0;if(1==c.nodeType)l=c.getClientRects();else{if(3!=c.nodeType)continue;l=wo(c).getClientRects()}for(var d=0;d<l.length;d++){var p=l[d];if(p.top<=s&&p.bottom>=a){s=Math.max(p.bottom,s),a=Math.min(p.top,a);var f=p.left>e.left?p.left-e.left:p.right<e.left?e.left-p.right:0;if(f<o){n=c,o=f,r=f&&3==n.nodeType?{left:p.right<e.left?p.right:p.left,top:e.top}:e,1==c.nodeType&&f&&(i=u+(e.left>=(p.left+p.right)/2?1:0));continue}}!n&&(e.left>=p.right&&e.top>=p.top||e.left>=p.left&&e.top>=p.bottom)&&(i=u+1)}}return n&&3==n.nodeType?function(t,e){for(var n=t.nodeValue.length,r=document.createRange(),o=0;o<n;o++){r.setEnd(t,o+1),r.setStart(t,o);var i=Fo(r,1);if(i.top!=i.bottom&&Po(e,i))return{node:t,offset:o+(e.left>=(i.left+i.right)/2?1:0)}}return{node:t,offset:0}}(n,r):!n||o&&1==n.nodeType?{node:t,offset:i}:zo(n,r)}function Po(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function Ro(t,e){var n,r,o,i,s=t.dom.ownerDocument;if(s.caretPositionFromPoint)try{var a=s.caretPositionFromPoint(e.left,e.top);a&&(o=(n=a).offsetNode,i=n.offset)}catch(t){}if(!o&&s.caretRangeFromPoint){var c=s.caretRangeFromPoint(e.left,e.top);c&&(o=(r=c).startContainer,i=r.startOffset)}var u,l=(t.root.elementFromPoint?t.root:s).elementFromPoint(e.left,e.top+1);if(!l||!t.dom.contains(1!=l.nodeType?l.parentNode:l)){var d=t.dom.getBoundingClientRect();if(!Po(e,d))return null;if(!(l=function t(e,n,r){var o=e.childNodes.length;if(o&&r.top<r.bottom)for(var i=Math.max(0,Math.min(o-1,Math.floor(o*(n.top-r.top)/(r.bottom-r.top))-2)),s=i;;){var a=e.childNodes[s];if(1==a.nodeType)for(var c=a.getClientRects(),u=0;u<c.length;u++){var l=c[u];if(Po(n,l))return t(a,n,l)}if((s=(s+1)%o)==i)break}return e}(t.dom,e,d)))return null}if(lo.safari)for(var p=l;o&&p;p=yo(p))p.draggable&&(o=i=null);if(l=function(t,e){var n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}(l,e),o){if(lo.gecko&&1==o.nodeType&&(i=Math.min(i,o.childNodes.length))<o.childNodes.length){var f,h=o.childNodes[i];"IMG"==h.nodeName&&(f=h.getBoundingClientRect()).right<=e.left&&f.bottom>e.top&&i++}o==t.dom&&i==o.childNodes.length-1&&1==o.lastChild.nodeType&&e.top>o.lastChild.getBoundingClientRect().bottom?u=t.state.doc.content.size:0!=i&&1==o.nodeType&&"BR"==o.childNodes[i-1].nodeName||(u=function(t,e,n,r){for(var o=-1,i=e;i!=t.dom;){var s=t.docView.nearestDesc(i,!0);if(!s)return null;if(s.node.isBlock&&s.parent){var a=s.dom.getBoundingClientRect();if(a.left>r.left||a.top>r.top)o=s.posBefore;else{if(!(a.right<r.left||a.bottom<r.top))break;o=s.posAfter}}i=s.dom.parentNode}return o>-1?o:t.docView.posFromDOM(e,n)}(t,o,i,e))}null==u&&(u=function(t,e,n){var r=zo(e,n),o=r.node,i=r.offset,s=-1;if(1==o.nodeType&&!o.firstChild){var a=o.getBoundingClientRect();s=a.left!=a.right&&n.left>(a.left+a.right)/2?1:-1}return t.docView.posFromDOM(o,i,s)}(t,l,e));var m=t.docView.nearestDesc(l,!0);return{pos:u,inside:m?m.posAtStart-m.border:-1}}function Fo(t,e){var n=t.getClientRects();return n.length?n[e<0?0:n.length-1]:t.getBoundingClientRect()}var Lo=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Vo(t,e,n){var r=t.docView.domFromPos(e,n<0?-1:1),o=r.node,i=r.offset,s=lo.webkit||lo.gecko;if(3==o.nodeType){if(!s||!Lo.test(o.nodeValue)&&(n<0?i:i!=o.nodeValue.length)){var a=i,c=i,u=n<0?1:-1;return n<0&&!i?(c++,u=-1):n>=0&&i==o.nodeValue.length?(a--,u=1):n<0?a--:c++,jo(Fo(wo(o,a,c),u),u<0)}var l=Fo(wo(o,i,i),n);if(lo.gecko&&i&&/\s/.test(o.nodeValue[i-1])&&i<o.nodeValue.length){var d=Fo(wo(o,i-1,i-1),-1);if(d.top==l.top){var p=Fo(wo(o,i,i+1),-1);if(p.top!=l.top)return jo(p,p.left<d.left)}}return l}if(!t.state.doc.resolve(e).parent.inlineContent){if(i&&(n<0||i==Co(o))){var f=o.childNodes[i-1];if(1==f.nodeType)return $o(f.getBoundingClientRect(),!1)}if(i<Co(o)){var h=o.childNodes[i];if(1==h.nodeType)return $o(h.getBoundingClientRect(),!0)}return $o(o.getBoundingClientRect(),n>=0)}if(i&&(n<0||i==Co(o))){var m=o.childNodes[i-1],v=3==m.nodeType?wo(m,Co(m)-(s?0:1)):1!=m.nodeType||"BR"==m.nodeName&&m.nextSibling?null:m;if(v)return jo(Fo(v,1),!1)}if(i<Co(o)){for(var g=o.childNodes[i];g.pmViewDesc&&g.pmViewDesc.ignoreForCoords;)g=g.nextSibling;var y=g?3==g.nodeType?wo(g,0,s?0:1):1==g.nodeType?g:null:null;if(y)return jo(Fo(y,-1),!0)}return jo(Fo(3==o.nodeType?wo(o):o,-n),n>=0)}function jo(t,e){if(0==t.width)return t;var n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function $o(t,e){if(0==t.height)return t;var n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function Wo(t,e,n){var r=t.state,o=t.root.activeElement;r!=e&&t.updateState(e),o!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),o!=t.dom&&o&&o.focus()}}var Ho=/[\u0590-\u08ac]/;var qo=null,Jo=null,Ko=!1;function Uo(t,e,n){return qo==e&&Jo==n?Ko:(qo=e,Jo=n,Ko="up"==n||"down"==n?function(t,e,n){var r=e.selection,o="up"==n?r.$from:r.$to;return Wo(t,e,(function(){for(var e=t.docView.domFromPos(o.pos,"up"==n?-1:1).node;;){var r=t.docView.nearestDesc(e,!0);if(!r)break;if(r.node.isBlock){e=r.dom;break}e=r.dom.parentNode}for(var i=Vo(t,o.pos,1),s=e.firstChild;s;s=s.nextSibling){var a=void 0;if(1==s.nodeType)a=s.getClientRects();else{if(3!=s.nodeType)continue;a=wo(s,0,s.nodeValue.length).getClientRects()}for(var c=0;c<a.length;c++){var u=a[c];if(u.bottom>u.top+1&&("up"==n?i.top-u.top>2*(u.bottom-i.top):u.bottom-i.bottom>2*(i.bottom-u.top)))return!1}}return!0}))}(t,e,n):function(t,e,n){var r=e.selection.$head;if(!r.parent.isTextblock)return!1;var o=r.parentOffset,i=!o,s=o==r.parent.content.size,a=t.root.getSelection();return Ho.test(r.parent.textContent)&&a.modify?Wo(t,e,(function(){var e=a.getRangeAt(0),o=a.focusNode,i=a.focusOffset,s=a.caretBidiLevel;a.modify("move",n,"character");var c=!(r.depth?t.docView.domAfterPos(r.before()):t.dom).contains(1==a.focusNode.nodeType?a.focusNode:a.focusNode.parentNode)||o==a.focusNode&&i==a.focusOffset;return a.removeAllRanges(),a.addRange(e),null!=s&&(a.caretBidiLevel=s),c})):"left"==n||"backward"==n?i:s}(t,e,n))}var Go=function(t,e,n,r){this.parent=t,this.children=e,this.dom=n,n.pmViewDesc=this,this.contentDOM=r,this.dirty=0},Yo={size:{configurable:!0},border:{configurable:!0},posBefore:{configurable:!0},posAtStart:{configurable:!0},posAfter:{configurable:!0},posAtEnd:{configurable:!0},contentLost:{configurable:!0},domAtom:{configurable:!0},ignoreForCoords:{configurable:!0}};Go.prototype.matchesWidget=function(){return!1},Go.prototype.matchesMark=function(){return!1},Go.prototype.matchesNode=function(){return!1},Go.prototype.matchesHack=function(t){return!1},Go.prototype.parseRule=function(){return null},Go.prototype.stopEvent=function(){return!1},Yo.size.get=function(){for(var t=0,e=0;e<this.children.length;e++)t+=this.children[e].size;return t},Yo.border.get=function(){return 0},Go.prototype.destroy=function(){this.parent=null,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=null);for(var t=0;t<this.children.length;t++)this.children[t].destroy()},Go.prototype.posBeforeChild=function(t){for(var e=0,n=this.posAtStart;e<this.children.length;e++){var r=this.children[e];if(r==t)return n;n+=r.size}},Yo.posBefore.get=function(){return this.parent.posBeforeChild(this)},Yo.posAtStart.get=function(){return this.parent?this.parent.posBeforeChild(this)+this.border:0},Yo.posAfter.get=function(){return this.posBefore+this.size},Yo.posAtEnd.get=function(){return this.posAtStart+this.size-2*this.border},Go.prototype.localPosFromDOM=function(t,e,n){if(this.contentDOM&&this.contentDOM.contains(1==t.nodeType?t:t.parentNode)){if(n<0){var r,o;if(t==this.contentDOM)r=t.childNodes[e-1];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;r=t.previousSibling}for(;r&&(!(o=r.pmViewDesc)||o.parent!=this);)r=r.previousSibling;return r?this.posBeforeChild(o)+o.size:this.posAtStart}var i,s;if(t==this.contentDOM)i=t.childNodes[e];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;i=t.nextSibling}for(;i&&(!(s=i.pmViewDesc)||s.parent!=this);)i=i.nextSibling;return i?this.posBeforeChild(s):this.posAtEnd}var a;if(t==this.dom&&this.contentDOM)a=e>go(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))a=2&t.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==e)for(var c=t;;c=c.parentNode){if(c==this.dom){a=!1;break}if(c.parentNode.firstChild!=c)break}if(null==a&&e==t.childNodes.length)for(var u=t;;u=u.parentNode){if(u==this.dom){a=!0;break}if(u.parentNode.lastChild!=u)break}}return(null==a?n>0:a)?this.posAtEnd:this.posAtStart},Go.prototype.nearestDesc=function(t,e){for(var n=!0,r=t;r;r=r.parentNode){var o=this.getDesc(r);if(o&&(!e||o.node)){if(!n||!o.nodeDOM||(1==o.nodeDOM.nodeType?o.nodeDOM.contains(1==t.nodeType?t:t.parentNode):o.nodeDOM==t))return o;n=!1}}},Go.prototype.getDesc=function(t){for(var e=t.pmViewDesc,n=e;n;n=n.parent)if(n==this)return e},Go.prototype.posFromDOM=function(t,e,n){for(var r=t;r;r=r.parentNode){var o=this.getDesc(r);if(o)return o.localPosFromDOM(t,e,n)}return-1},Go.prototype.descAt=function(t){for(var e=0,n=0;e<this.children.length;e++){var r=this.children[e],o=n+r.size;if(n==t&&o!=n){for(;!r.border&&r.children.length;)r=r.children[0];return r}if(t<o)return r.descAt(t-n-r.border);n=o}},Go.prototype.domFromPos=function(t,e){if(!this.contentDOM)return{node:this.dom,offset:0};for(var n=0,r=0,o=0;n<this.children.length;n++){var i=this.children[n],s=o+i.size;if(s>t||i instanceof oi){r=t-o;break}o=s}if(r)return this.children[n].domFromPos(r-this.children[n].border,e);for(var a=void 0;n&&!(a=this.children[n-1]).size&&a instanceof Zo&&a.widget.type.side>=0;n--);if(e<=0){for(var c,u=!0;(c=n?this.children[n-1]:null)&&c.dom.parentNode!=this.contentDOM;n--,u=!1);return c&&e&&u&&!c.border&&!c.domAtom?c.domFromPos(c.size,e):{node:this.contentDOM,offset:c?go(c.dom)+1:0}}for(var l,d=!0;(l=n<this.children.length?this.children[n]:null)&&l.dom.parentNode!=this.contentDOM;n++,d=!1);return l&&d&&!l.border&&!l.domAtom?l.domFromPos(0,e):{node:this.contentDOM,offset:l?go(l.dom):this.contentDOM.childNodes.length}},Go.prototype.parseRange=function(t,e,n){if(void 0===n&&(n=0),0==this.children.length)return{node:this.contentDOM,from:t,to:e,fromOffset:0,toOffset:this.contentDOM.childNodes.length};for(var r=-1,o=-1,i=n,s=0;;s++){var a=this.children[s],c=i+a.size;if(-1==r&&t<=c){var u=i+a.border;if(t>=u&&e<=c-a.border&&a.node&&a.contentDOM&&this.contentDOM.contains(a.contentDOM))return a.parseRange(t,e,u);t=i;for(var l=s;l>0;l--){var d=this.children[l-1];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(1)){r=go(d.dom)+1;break}t-=d.size}-1==r&&(r=0)}if(r>-1&&(c>e||s==this.children.length-1)){e=c;for(var p=s+1;p<this.children.length;p++){var f=this.children[p];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(-1)){o=go(f.dom);break}e+=f.size}-1==o&&(o=this.contentDOM.childNodes.length);break}i=c}return{node:this.contentDOM,from:t,to:e,fromOffset:r,toOffset:o}},Go.prototype.emptyChildAt=function(t){if(this.border||!this.contentDOM||!this.children.length)return!1;var e=this.children[t<0?0:this.children.length-1];return 0==e.size||e.emptyChildAt(t)},Go.prototype.domAfterPos=function(t){var e=this.domFromPos(t,0),n=e.node,r=e.offset;if(1!=n.nodeType||r==n.childNodes.length)throw new RangeError("No node after pos "+t);return n.childNodes[r]},Go.prototype.setSelection=function(t,e,n,r){for(var o=Math.min(t,e),i=Math.max(t,e),s=0,a=0;s<this.children.length;s++){var c=this.children[s],u=a+c.size;if(o>a&&i<u)return c.setSelection(t-a-c.border,e-a-c.border,n,r);a=u}var l=this.domFromPos(t,t?-1:1),d=e==t?l:this.domFromPos(e,e?-1:1),p=n.getSelection(),f=!1;if((lo.gecko||lo.safari)&&t==e){var h=l.node,m=l.offset;if(3==h.nodeType){if((f=m&&"\n"==h.nodeValue[m-1])&&m==h.nodeValue.length)for(var v=h,g=void 0;v;v=v.parentNode){if(g=v.nextSibling){"BR"==g.nodeName&&(l=d={node:g.parentNode,offset:go(g)+1});break}var y=v.pmViewDesc;if(y&&y.node&&y.node.isBlock)break}}else{var b=h.childNodes[m-1];f=b&&("BR"==b.nodeName||"false"==b.contentEditable)}}if(lo.gecko&&p.focusNode&&p.focusNode!=d.node&&1==p.focusNode.nodeType){var w=p.focusNode.childNodes[p.focusOffset];w&&"false"==w.contentEditable&&(r=!0)}if(r||f&&lo.safari||!_o(l.node,l.offset,p.anchorNode,p.anchorOffset)||!_o(d.node,d.offset,p.focusNode,p.focusOffset)){var _=!1;if((p.extend||t==e)&&!f){p.collapse(l.node,l.offset);try{t!=e&&p.extend(d.node,d.offset),_=!0}catch(t){if(!(t instanceof DOMException))throw t}}if(!_){if(t>e){var x=l;l=d,d=x}var k=document.createRange();k.setEnd(d.node,d.offset),k.setStart(l.node,l.offset),p.removeAllRanges(),p.addRange(k)}}},Go.prototype.ignoreMutation=function(t){return!this.contentDOM&&"selection"!=t.type},Yo.contentLost.get=function(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)},Go.prototype.markDirty=function(t,e){for(var n=0,r=0;r<this.children.length;r++){var o=this.children[r],i=n+o.size;if(n==i?t<=i&&e>=n:t<i&&e>n){var s=n+o.border,a=i-o.border;if(t>=s&&e<=a)return this.dirty=t==n||e==i?2:1,void(t!=s||e!=a||!o.contentLost&&o.dom.parentNode==this.contentDOM?o.markDirty(t-s,e-s):o.dirty=3);o.dirty=o.dom!=o.contentDOM||o.dom.parentNode!=this.contentDOM||o.children.length?3:2}n=i}this.dirty=2},Go.prototype.markParentsDirty=function(){for(var t=1,e=this.parent;e;e=e.parent,t++){var n=1==t?2:1;e.dirty<n&&(e.dirty=n)}},Yo.domAtom.get=function(){return!1},Yo.ignoreForCoords.get=function(){return!1},Object.defineProperties(Go.prototype,Yo);var Xo=[],Zo=function(t){function e(e,n,r,o){var i,s=n.type.toDOM;if("function"==typeof s&&(s=s(r,(function(){return i?i.parent?i.parent.posBeforeChild(i):void 0:o}))),!n.type.spec.raw){if(1!=s.nodeType){var a=document.createElement("span");a.appendChild(s),s=a}s.contentEditable=!1,s.classList.add("ProseMirror-widget")}t.call(this,e,Xo,s,null),this.widget=n,i=this}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={domAtom:{configurable:!0}};return e.prototype.matchesWidget=function(t){return 0==this.dirty&&t.type.eq(this.widget.type)},e.prototype.parseRule=function(){return{ignore:!0}},e.prototype.stopEvent=function(t){var e=this.widget.spec.stopEvent;return!!e&&e(t)},e.prototype.ignoreMutation=function(t){return"selection"!=t.type||this.widget.spec.ignoreSelection},e.prototype.destroy=function(){this.widget.type.destroy(this.dom),t.prototype.destroy.call(this)},n.domAtom.get=function(){return!0},Object.defineProperties(e.prototype,n),e}(Go),Qo=function(t){function e(e,n,r,o){t.call(this,e,Xo,n,null),this.textDOM=r,this.text=o}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={size:{configurable:!0}};return n.size.get=function(){return this.text.length},e.prototype.localPosFromDOM=function(t,e){return t!=this.textDOM?this.posAtStart+(e?this.size:0):this.posAtStart+e},e.prototype.domFromPos=function(t){return{node:this.textDOM,offset:t}},e.prototype.ignoreMutation=function(t){return"characterData"===t.type&&t.target.nodeValue==t.oldValue},Object.defineProperties(e.prototype,n),e}(Go),ti=function(t){function e(e,n,r,o){t.call(this,e,[],r,o),this.mark=n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.create=function(t,n,r,o){var i=o.nodeViews[n.type.name],s=i&&i(n,o,r);return s&&s.dom||(s=dt.renderSpec(document,n.type.spec.toDOM(n,r))),new e(t,n,s.dom,s.contentDOM||s.dom)},e.prototype.parseRule=function(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}},e.prototype.matchesMark=function(t){return 3!=this.dirty&&this.mark.eq(t)},e.prototype.markDirty=function(e,n){if(t.prototype.markDirty.call(this,e,n),0!=this.dirty){for(var r=this.parent;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=0}},e.prototype.slice=function(t,n,r){var o=e.create(this.parent,this.mark,!0,r),i=this.children,s=this.size;n<s&&(i=vi(i,n,s,r)),t>0&&(i=vi(i,0,t,r));for(var a=0;a<i.length;a++)i[a].parent=o;return o.children=i,o},e}(Go),ei=function(t){function e(e,n,r,o,i,s,a,c,u){t.call(this,e,n.isLeaf?Xo:[],i,s),this.nodeDOM=a,this.node=n,this.outerDeco=r,this.innerDeco=o,s&&this.updateChildren(c,u)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={size:{configurable:!0},border:{configurable:!0},domAtom:{configurable:!0}};return e.create=function(t,n,r,o,i,s){var a,c,u=i.nodeViews[n.type.name],l=u&&u(n,i,(function(){return c?c.parent?c.parent.posBeforeChild(c):void 0:s}),r,o),d=l&&l.dom,p=l&&l.contentDOM;if(n.isText)if(d){if(3!=d.nodeType)throw new RangeError("Text must be rendered as a DOM text node")}else d=document.createTextNode(n.text);else d||(d=(a=dt.renderSpec(document,n.type.spec.toDOM(n))).dom,p=a.contentDOM);p||n.isText||"BR"==d.nodeName||(d.hasAttribute("contenteditable")||(d.contentEditable=!1),n.type.spec.draggable&&(d.draggable=!0));var f=d;return d=di(d,r,n),l?c=new ii(t,n,r,o,d,p,f,l,i,s+1):n.isText?new ri(t,n,r,o,d,f,i):new e(t,n,r,o,d,p,f,i,s+1)},e.prototype.parseRule=function(){var t=this;if(this.node.type.spec.reparseInView)return null;var e={node:this.node.type.name,attrs:this.node.attrs};return"pre"==this.node.type.whitespace&&(e.preserveWhitespace="full"),this.contentDOM&&!this.contentLost?e.contentElement=this.contentDOM:e.getContent=function(){return t.contentDOM?i.empty:t.node.content},e},e.prototype.matchesNode=function(t,e,n){return 0==this.dirty&&t.eq(this.node)&&pi(e,this.outerDeco)&&n.eq(this.innerDeco)},n.size.get=function(){return this.node.nodeSize},n.border.get=function(){return this.node.isLeaf?0:1},e.prototype.updateChildren=function(t,e){var n=this,r=this.node.inlineContent,o=e,i=t.composing&&this.localCompositionInfo(t,e),s=i&&i.pos>-1?i:null,a=i&&i.pos<0,c=new hi(this,s&&s.node);!function(t,e,n,r){var o=e.locals(t),i=0;if(0==o.length){for(var s=0;s<t.childCount;s++){var a=t.child(s);r(a,o,e.forChild(i,a),s),i+=a.nodeSize}return}for(var c=0,u=[],l=null,d=0;;){if(c<o.length&&o[c].to==i){for(var p=o[c++],f=void 0;c<o.length&&o[c].to==i;)(f||(f=[p])).push(o[c++]);if(f){f.sort(mi);for(var h=0;h<f.length;h++)n(f[h],d,!!l)}else n(p,d,!!l)}var m=void 0,v=void 0;if(l)v=-1,m=l,l=null;else{if(!(d<t.childCount))break;v=d,m=t.child(d++)}for(var g=0;g<u.length;g++)u[g].to<=i&&u.splice(g--,1);for(;c<o.length&&o[c].from<=i&&o[c].to>i;)u.push(o[c++]);var y=i+m.nodeSize;if(m.isText){var b=y;c<o.length&&o[c].from<b&&(b=o[c].from);for(var w=0;w<u.length;w++)u[w].to<b&&(b=u[w].to);b<y&&(l=m.cut(b-i),m=m.cut(0,b-i),y=b,v=-1)}var _=u.length?m.isInline&&!m.isLeaf?u.filter((function(t){return!t.inline})):u.slice():Xo;r(m,_,e.forChild(i,m),v),i=y}}(this.node,this.innerDeco,(function(e,i,s){e.spec.marks?c.syncToMarks(e.spec.marks,r,t):e.type.side>=0&&!s&&c.syncToMarks(i==n.node.childCount?l.none:n.node.child(i).marks,r,t),c.placeWidget(e,t,o)}),(function(e,n,s,u){var l;c.syncToMarks(e.marks,r,t),c.findNodeMatch(e,n,s,u)||a&&t.state.selection.from>o&&t.state.selection.to<o+e.nodeSize&&(l=c.findIndexWithChild(i.node))>-1&&c.updateNodeAt(e,n,s,l,t)||c.updateNextNode(e,n,s,t,u)||c.addNode(e,n,s,t,o),o+=e.nodeSize})),c.syncToMarks(Xo,r,t),this.node.isTextblock&&c.addTextblockHacks(),c.destroyRest(),(c.changed||2==this.dirty)&&(s&&this.protectLocalComposition(t,s),function t(e,n,r){for(var o=e.firstChild,i=!1,s=0;s<n.length;s++){var a=n[s],c=a.dom;if(c.parentNode==e){for(;c!=o;)o=fi(o),i=!0;o=o.nextSibling}else i=!0,e.insertBefore(c,o);if(a instanceof ti){var u=o?o.previousSibling:e.lastChild;t(a.contentDOM,a.children,r),o=u?u.nextSibling:e.firstChild}}for(;o;)o=fi(o),i=!0;i&&r.trackWrites==e&&(r.trackWrites=null)}(this.contentDOM,this.children,t),lo.ios&&function(t){if("UL"==t.nodeName||"OL"==t.nodeName){var e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}(this.dom))},e.prototype.localCompositionInfo=function(t,e){var n=t.state.selection,r=n.from,o=n.to;if(!(!(t.state.selection instanceof re)||r<e||o>e+this.node.content.size)){var i=t.root.getSelection(),s=function(t,e){for(;;){if(3==t.nodeType)return t;if(1==t.nodeType&&e>0){if(t.childNodes.length>e&&3==t.childNodes[e].nodeType)return t.childNodes[e];t=t.childNodes[e-1],e=Co(t)}else{if(!(1==t.nodeType&&e<t.childNodes.length))return null;t=t.childNodes[e],e=0}}}(i.focusNode,i.focusOffset);if(s&&this.dom.contains(s.parentNode)){if(this.node.inlineContent){var a=s.nodeValue,c=function(t,e,n,r){for(var o=0,i=0;o<t.childCount&&i<=r;){var s=t.child(o++),a=i;if(i+=s.nodeSize,s.isText){for(var c=s.text;o<t.childCount;){var u=t.child(o++);if(i+=u.nodeSize,!u.isText)break;c+=u.text}if(i>=n&&a<r){var l=c.lastIndexOf(e,r-a-1);if(l>=0&&l+e.length+a>=n)return a+l}}}return-1}(this.node.content,a,r-e,o-e);return c<0?null:{node:s,pos:c,text:a}}return{node:s,pos:-1}}}},e.prototype.protectLocalComposition=function(t,e){var n=e.node,r=e.pos,o=e.text;if(!this.getDesc(n)){for(var i=n;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=null)}var s=new Qo(this,i,n,o);t.compositionNodes.push(s),this.children=vi(this.children,r,r+o.length,t,s)}},e.prototype.update=function(t,e,n,r){return!(3==this.dirty||!t.sameMarkup(this.node))&&(this.updateInner(t,e,n,r),!0)},e.prototype.updateInner=function(t,e,n,r){this.updateOuterDeco(e),this.node=t,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=0},e.prototype.updateOuterDeco=function(t){if(!pi(t,this.outerDeco)){var e=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=ui(this.dom,this.nodeDOM,ci(this.outerDeco,this.node,e),ci(t,this.node,e)),this.dom!=n&&(n.pmViewDesc=null,this.dom.pmViewDesc=this),this.outerDeco=t}},e.prototype.selectNode=function(){this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.dom.draggable=!0)},e.prototype.deselectNode=function(){this.nodeDOM.classList.remove("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||this.dom.removeAttribute("draggable")},n.domAtom.get=function(){return this.node.isAtom},Object.defineProperties(e.prototype,n),e}(Go);function ni(t,e,n,r,o){return di(r,e,t),new ei(null,t,e,n,r,r,r,o,0)}var ri=function(t){function e(e,n,r,o,i,s,a){t.call(this,e,n,r,o,i,null,s,a)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={domAtom:{configurable:!0}};return e.prototype.parseRule=function(){for(var t=this.nodeDOM.parentNode;t&&t!=this.dom&&!t.pmIsDeco;)t=t.parentNode;return{skip:t||!0}},e.prototype.update=function(t,e,n,r){return!(3==this.dirty||0!=this.dirty&&!this.inParent()||!t.sameMarkup(this.node))&&(this.updateOuterDeco(e),0==this.dirty&&t.text==this.node.text||t.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=t.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=t,this.dirty=0,!0)},e.prototype.inParent=function(){for(var t=this.parent.contentDOM,e=this.nodeDOM;e;e=e.parentNode)if(e==t)return!0;return!1},e.prototype.domFromPos=function(t){return{node:this.nodeDOM,offset:t}},e.prototype.localPosFromDOM=function(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):t.prototype.localPosFromDOM.call(this,e,n,r)},e.prototype.ignoreMutation=function(t){return"characterData"!=t.type&&"selection"!=t.type},e.prototype.slice=function(t,n,r){var o=this.node.cut(t,n),i=document.createTextNode(o.text);return new e(this.parent,o,this.outerDeco,this.innerDeco,i,i,r)},e.prototype.markDirty=function(e,n){t.prototype.markDirty.call(this,e,n),this.dom==this.nodeDOM||0!=e&&n!=this.nodeDOM.nodeValue.length||(this.dirty=3)},n.domAtom.get=function(){return!1},Object.defineProperties(e.prototype,n),e}(ei),oi=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={domAtom:{configurable:!0},ignoreForCoords:{configurable:!0}};return e.prototype.parseRule=function(){return{ignore:!0}},e.prototype.matchesHack=function(t){return 0==this.dirty&&this.dom.nodeName==t},n.domAtom.get=function(){return!0},n.ignoreForCoords.get=function(){return"IMG"==this.dom.nodeName},Object.defineProperties(e.prototype,n),e}(Go),ii=function(t){function e(e,n,r,o,i,s,a,c,u,l){t.call(this,e,n,r,o,i,s,a,u,l),this.spec=c}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.update=function(e,n,r,o){if(3==this.dirty)return!1;if(this.spec.update){var i=this.spec.update(e,n,r);return i&&this.updateInner(e,n,r,o),i}return!(!this.contentDOM&&!e.isLeaf)&&t.prototype.update.call(this,e,n,r,o)},e.prototype.selectNode=function(){this.spec.selectNode?this.spec.selectNode():t.prototype.selectNode.call(this)},e.prototype.deselectNode=function(){this.spec.deselectNode?this.spec.deselectNode():t.prototype.deselectNode.call(this)},e.prototype.setSelection=function(e,n,r,o){this.spec.setSelection?this.spec.setSelection(e,n,r):t.prototype.setSelection.call(this,e,n,r,o)},e.prototype.destroy=function(){this.spec.destroy&&this.spec.destroy(),t.prototype.destroy.call(this)},e.prototype.stopEvent=function(t){return!!this.spec.stopEvent&&this.spec.stopEvent(t)},e.prototype.ignoreMutation=function(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):t.prototype.ignoreMutation.call(this,e)},e}(ei);function si(t){t&&(this.nodeName=t)}si.prototype=Object.create(null);var ai=[new si];function ci(t,e,n){if(0==t.length)return ai;for(var r=n?ai[0]:new si,o=[r],i=0;i<t.length;i++){var s=t[i].type.attrs;if(s)for(var a in s.nodeName&&o.push(r=new si(s.nodeName)),s){var c=s[a];null!=c&&(n&&1==o.length&&o.push(r=new si(e.isInline?"span":"div")),"class"==a?r.class=(r.class?r.class+" ":"")+c:"style"==a?r.style=(r.style?r.style+";":"")+c:"nodeName"!=a&&(r[a]=c))}}return o}function ui(t,e,n,r){if(n==ai&&r==ai)return e;for(var o=e,i=0;i<r.length;i++){var s=r[i],a=n[i];if(i){var c=void 0;a&&a.nodeName==s.nodeName&&o!=t&&(c=o.parentNode)&&c.tagName.toLowerCase()==s.nodeName||((c=document.createElement(s.nodeName)).pmIsDeco=!0,c.appendChild(o),a=ai[0]),o=c}li(o,a||ai[0],s)}return o}function li(t,e,n){for(var r in e)"class"==r||"style"==r||"nodeName"==r||r in n||t.removeAttribute(r);for(var o in n)"class"!=o&&"style"!=o&&"nodeName"!=o&&n[o]!=e[o]&&t.setAttribute(o,n[o]);if(e.class!=n.class){for(var i=e.class?e.class.split(" ").filter(Boolean):Xo,s=n.class?n.class.split(" ").filter(Boolean):Xo,a=0;a<i.length;a++)-1==s.indexOf(i[a])&&t.classList.remove(i[a]);for(var c=0;c<s.length;c++)-1==i.indexOf(s[c])&&t.classList.add(s[c]);0==t.classList.length&&t.removeAttribute("class")}if(e.style!=n.style){if(e.style)for(var u,l=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g;u=l.exec(e.style);)t.style.removeProperty(u[1]);n.style&&(t.style.cssText+=n.style)}}function di(t,e,n){return ui(t,t,ai,ci(e,n,1!=t.nodeType))}function pi(t,e){if(t.length!=e.length)return!1;for(var n=0;n<t.length;n++)if(!t[n].type.eq(e[n].type))return!1;return!0}function fi(t){var e=t.nextSibling;return t.parentNode.removeChild(t),e}var hi=function(t,e){this.top=t,this.lock=e,this.index=0,this.stack=[],this.changed=!1,this.preMatch=function(t,e){var n=e,r=n.children.length,o=t.childCount,i=new Map,s=[];t:for(;o>0;){for(var a=void 0;;)if(r){var c=n.children[r-1];if(!(c instanceof ti)){a=c,r--;break}n=c,r=c.children.length}else{if(n==e)break t;r=n.parent.children.indexOf(n),n=n.parent}var u=a.node;if(u){if(u!=t.child(o-1))break;--o,i.set(a,o),s.push(a)}}return{index:o,matched:i,matches:s.reverse()}}(t.node.content,t)};function mi(t,e){return t.type.side-e.type.side}function vi(t,e,n,r,o){for(var i=[],s=0,a=0;s<t.length;s++){var c=t[s],u=a,l=a+=c.size;u>=n||l<=e?i.push(c):(u<e&&i.push(c.slice(0,e-u,r)),o&&(i.push(o),o=null),l>n&&i.push(c.slice(n-u,c.size,r)))}return i}function gi(t,e){var n=t.root.getSelection(),r=t.state.doc;if(!n.focusNode)return null;var o=t.docView.nearestDesc(n.focusNode),i=o&&0==o.size,s=t.docView.posFromDOM(n.focusNode,n.focusOffset);if(s<0)return null;var a,c,u=r.resolve(s);if(To(n)){for(a=u;o&&!o.node;)o=o.parent;if(o&&o.node.isAtom&&ie.isSelectable(o.node)&&o.parent&&(!o.node.isInline||!function(t,e,n){for(var r=0==e,o=e==Co(t);r||o;){if(t==n)return!0;var i=go(t);if(!(t=t.parentNode))return!1;r=r&&0==i,o=o&&i==Co(t)}}(n.focusNode,n.focusOffset,o.dom))){var l=o.posBefore;c=new ie(s==l?u:r.resolve(l))}}else{var d=t.docView.posFromDOM(n.anchorNode,n.anchorOffset);if(d<0)return null;a=r.resolve(d)}c||(c=Ti(t,a,u,"pointer"==e||t.state.selection.head<u.pos&&!i?1:-1));return c}function yi(t){return t.editable?t.hasFocus():Ei(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function bi(t,e){var n=t.state.selection;if(Ci(t,n),yi(t)){if(!e&&t.mouseDown&&t.mouseDown.allowDefault&&lo.chrome){var r=t.root.getSelection(),o=t.domObserver.currentSelection;if(r.anchorNode&&_o(r.anchorNode,r.anchorOffset,o.anchorNode,o.anchorOffset))return t.mouseDown.delayedSelectionSync=!0,void t.domObserver.setCurSelection()}if(t.domObserver.disconnectSelection(),t.cursorWrapper)!function(t){var e=t.root.getSelection(),n=document.createRange(),r=t.cursorWrapper.dom,o="IMG"==r.nodeName;o?n.setEnd(r.parentNode,go(r)+1):n.setEnd(r,0);n.collapse(!1),e.removeAllRanges(),e.addRange(n),!o&&!t.state.selection.visible&&lo.ie&&lo.ie_version<=11&&(r.disabled=!0,r.disabled=!1)}(t);else{var i,s,a=n.anchor,c=n.head;!wi||n instanceof re||(n.$from.parent.inlineContent||(i=_i(t,n.from)),n.empty||n.$from.parent.inlineContent||(s=_i(t,n.to))),t.docView.setSelection(a,c,t.root,e),wi&&(i&&ki(i),s&&ki(s)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&function(t){var e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.hideSelectionGuard);var n=t.root.getSelection(),r=n.anchorNode,o=n.anchorOffset;e.addEventListener("selectionchange",t.hideSelectionGuard=function(){n.anchorNode==r&&n.anchorOffset==o||(e.removeEventListener("selectionchange",t.hideSelectionGuard),setTimeout((function(){yi(t)&&!t.state.selection.visible||t.dom.classList.remove("ProseMirror-hideselection")}),20))})}(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}hi.prototype.destroyBetween=function(t,e){if(t!=e){for(var n=t;n<e;n++)this.top.children[n].destroy();this.top.children.splice(t,e-t),this.changed=!0}},hi.prototype.destroyRest=function(){this.destroyBetween(this.index,this.top.children.length)},hi.prototype.syncToMarks=function(t,e,n){for(var r=0,o=this.stack.length>>1,i=Math.min(o,t.length);r<i&&(r==o-1?this.top:this.stack[r+1<<1]).matchesMark(t[r])&&!1!==t[r].type.spec.spanning;)r++;for(;r<o;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<t.length;){this.stack.push(this.top,this.index+1);for(var s=-1,a=this.index;a<Math.min(this.index+3,this.top.children.length);a++)if(this.top.children[a].matchesMark(t[o])){s=a;break}if(s>-1)s>this.index&&(this.changed=!0,this.destroyBetween(this.index,s)),this.top=this.top.children[this.index];else{var c=ti.create(this.top,t[o],e,n);this.top.children.splice(this.index,0,c),this.top=c,this.changed=!0}this.index=0,o++}},hi.prototype.findNodeMatch=function(t,e,n,r){var o,i=-1;if(r>=this.preMatch.index&&(o=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&o.matchesNode(t,e,n))i=this.top.children.indexOf(o,this.index);else for(var s=this.index,a=Math.min(this.top.children.length,s+5);s<a;s++){var c=this.top.children[s];if(c.matchesNode(t,e,n)&&!this.preMatch.matched.has(c)){i=s;break}}return!(i<0)&&(this.destroyBetween(this.index,i),this.index++,!0)},hi.prototype.updateNodeAt=function(t,e,n,r,o){return!!this.top.children[r].update(t,e,n,o)&&(this.destroyBetween(this.index,r),this.index=r+1,!0)},hi.prototype.findIndexWithChild=function(t){for(;;){var e=t.parentNode;if(!e)return-1;if(e==this.top.contentDOM){var n=t.pmViewDesc;if(n)for(var r=this.index;r<this.top.children.length;r++)if(this.top.children[r]==n)return r;return-1}t=e}},hi.prototype.updateNextNode=function(t,e,n,r,o){for(var i=this.index;i<this.top.children.length;i++){var s=this.top.children[i];if(s instanceof ei){var a=this.preMatch.matched.get(s);if(null!=a&&a!=o)return!1;var c=s.dom;if(!(this.lock&&(c==this.lock||1==c.nodeType&&c.contains(this.lock.parentNode))&&!(t.isText&&s.node&&s.node.isText&&s.nodeDOM.nodeValue==t.text&&3!=s.dirty&&pi(e,s.outerDeco)))&&s.update(t,e,n,r))return this.destroyBetween(this.index,i),s.dom!=c&&(this.changed=!0),this.index++,!0;break}}return!1},hi.prototype.addNode=function(t,e,n,r,o){this.top.children.splice(this.index++,0,ei.create(this.top,t,e,n,r,o)),this.changed=!0},hi.prototype.placeWidget=function(t,e,n){var r=this.index<this.top.children.length?this.top.children[this.index]:null;if(!r||!r.matchesWidget(t)||t!=r.widget&&r.widget.type.toDOM.parentNode){var o=new Zo(this.top,t,e,n);this.top.children.splice(this.index++,0,o),this.changed=!0}else this.index++},hi.prototype.addTextblockHacks=function(){for(var t=this.top.children[this.index-1];t instanceof ti;)t=t.children[t.children.length-1];t&&t instanceof ri&&!/\n$/.test(t.node.text)||((lo.safari||lo.chrome)&&t&&"false"==t.dom.contentEditable&&this.addHackNode("IMG"),this.addHackNode("BR"))},hi.prototype.addHackNode=function(t){if(this.index<this.top.children.length&&this.top.children[this.index].matchesHack(t))this.index++;else{var e=document.createElement(t);"IMG"==t&&(e.className="ProseMirror-separator"),"BR"==t&&(e.className="ProseMirror-trailingBreak"),this.top.children.splice(this.index++,0,new oi(this.top,Xo,e,null)),this.changed=!0}};var wi=lo.safari||lo.chrome&&lo.chrome_version<63;function _i(t,e){var n=t.docView.domFromPos(e,0),r=n.node,o=n.offset,i=o<r.childNodes.length?r.childNodes[o]:null,s=o?r.childNodes[o-1]:null;if(lo.safari&&i&&"false"==i.contentEditable)return xi(i);if(!(i&&"false"!=i.contentEditable||s&&"false"!=s.contentEditable)){if(i)return xi(i);if(s)return xi(s)}}function xi(t){return t.contentEditable="true",lo.safari&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function ki(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function Ci(t,e){if(e instanceof ie){var n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(Si(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else Si(t)}function Si(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=null)}function Ti(t,e,n,r){return t.someProp("createSelectionBetween",(function(r){return r(t,e,n)}))||re.between(e,n,r)}function Ei(t){var e=t.root.getSelection();if(!e.anchorNode)return!1;try{return t.dom.contains(3==e.anchorNode.nodeType?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(3==e.focusNode.nodeType?e.focusNode.parentNode:e.focusNode))}catch(t){return!1}}function Mi(t,e){var n=t.selection,r=n.$anchor,o=n.$head,i=e>0?r.max(o):r.min(o),s=i.parent.inlineContent?i.depth?t.doc.resolve(e>0?i.after():i.before()):null:i;return s&&te.findFrom(s,e)}function Oi(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function Di(t,e,n){var r=t.state.selection;if(!(r instanceof re)){if(r instanceof ie&&r.node.isInline)return Oi(t,new re(e>0?r.$to:r.$from));var o=Mi(t.state,e);return!!o&&Oi(t,o)}if(!r.empty||n.indexOf("s")>-1)return!1;if(t.endOfTextblock(e>0?"right":"left")){var i=Mi(t.state,e);return!!(i&&i instanceof ie)&&Oi(t,i)}if(!(lo.mac&&n.indexOf("m")>-1)){var s,a=r.$head,c=a.textOffset?null:e<0?a.nodeBefore:a.nodeAfter;if(!c||c.isText)return!1;var u=e<0?a.pos-c.nodeSize:a.pos;return!!(c.isAtom||(s=t.docView.descAt(u))&&!s.contentDOM)&&(ie.isSelectable(c)?Oi(t,new ie(e<0?t.state.doc.resolve(a.pos-c.nodeSize):a)):!!lo.webkit&&Oi(t,new re(t.state.doc.resolve(e<0?u:u+c.nodeSize))))}}function Ii(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function Ai(t){var e=t.pmViewDesc;return e&&0==e.size&&(t.nextSibling||"BR"!=t.nodeName)}function Ni(t){var e=t.root.getSelection(),n=e.focusNode,r=e.focusOffset;if(n){var o,i,s=!1;for(lo.gecko&&1==n.nodeType&&r<Ii(n)&&Ai(n.childNodes[r])&&(s=!0);;)if(r>0){if(1!=n.nodeType)break;var a=n.childNodes[r-1];if(Ai(a))o=n,i=--r;else{if(3!=a.nodeType)break;r=(n=a).nodeValue.length}}else{if(zi(n))break;for(var c=n.previousSibling;c&&Ai(c);)o=n.parentNode,i=go(c),c=c.previousSibling;if(c)r=Ii(n=c);else{if((n=n.parentNode)==t.dom)break;r=0}}s?Pi(t,e,n,r):o&&Pi(t,e,o,i)}}function Bi(t){var e=t.root.getSelection(),n=e.focusNode,r=e.focusOffset;if(n){for(var o,i,s=Ii(n);;)if(r<s){if(1!=n.nodeType)break;if(!Ai(n.childNodes[r]))break;o=n,i=++r}else{if(zi(n))break;for(var a=n.nextSibling;a&&Ai(a);)o=a.parentNode,i=go(a)+1,a=a.nextSibling;if(a)r=0,s=Ii(n=a);else{if((n=n.parentNode)==t.dom)break;r=s=0}}o&&Pi(t,e,o,i)}}function zi(t){var e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function Pi(t,e,n,r){if(To(e)){var o=document.createRange();o.setEnd(n,r),o.setStart(n,r),e.removeAllRanges(),e.addRange(o)}else e.extend&&e.extend(n,r);t.domObserver.setCurSelection();var i=t.state;setTimeout((function(){t.state==i&&bi(t)}),50)}function Ri(t,e,n){var r=t.state.selection;if(r instanceof re&&!r.empty||n.indexOf("s")>-1)return!1;if(lo.mac&&n.indexOf("m")>-1)return!1;var o=r.$from,i=r.$to;if(!o.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){var s=Mi(t.state,e);if(s&&s instanceof ie)return Oi(t,s)}if(!o.parent.inlineContent){var a=e<0?o:i,c=r instanceof ae?te.near(a,e):te.findFrom(a,e);return!!c&&Oi(t,c)}return!1}function Fi(t,e){if(!(t.state.selection instanceof re))return!0;var n=t.state.selection,r=n.$head,o=n.$anchor,i=n.empty;if(!r.sameParent(o))return!0;if(!i)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;var s=!r.textOffset&&(e<0?r.nodeBefore:r.nodeAfter);if(s&&!s.isText){var a=t.state.tr;return e<0?a.delete(r.pos-s.nodeSize,r.pos):a.delete(r.pos,r.pos+s.nodeSize),t.dispatch(a),!0}return!1}function Li(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function Vi(t,e){var n=e.keyCode,r=function(t){var e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}(e);return 8==n||lo.mac&&72==n&&"c"==r?Fi(t,-1)||Ni(t):46==n||lo.mac&&68==n&&"c"==r?Fi(t,1)||Bi(t):13==n||27==n||(37==n?Di(t,-1,r)||Ni(t):39==n?Di(t,1,r)||Bi(t):38==n?Ri(t,-1,r)||Ni(t):40==n?function(t){if(lo.safari&&!(t.state.selection.$head.parentOffset>0)){var e=t.root.getSelection(),n=e.focusNode,r=e.focusOffset;if(n&&1==n.nodeType&&0==r&&n.firstChild&&"false"==n.firstChild.contentEditable){var o=n.firstChild;Li(t,o,!0),setTimeout((function(){return Li(t,o,!1)}),20)}}}(t)||Ri(t,1,r)||Bi(t):r==(lo.mac?"m":"c")&&(66==n||73==n||89==n||90==n))}function ji(t){var e=t.pmViewDesc;if(e)return e.parseRule();if("BR"==t.nodeName&&t.parentNode){if(lo.safari&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){var n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}if(t.parentNode.lastChild==t||lo.safari&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if("IMG"==t.nodeName&&t.getAttribute("mark-placeholder"))return{ignore:!0}}function $i(t,e,n,r,o){if(e<0){var s=t.lastSelectionTime>Date.now()-50?t.lastSelectionOrigin:null,a=gi(t,s);if(a&&!t.state.selection.eq(a)){var c=t.state.tr.setSelection(a);"pointer"==s?c.setMeta("pointer",!0):"key"==s&&c.scrollIntoView(),t.dispatch(c)}}else{var u=t.state.doc.resolve(e),l=u.sharedDepth(n);e=u.before(l+1),n=t.state.doc.resolve(n).after(l+1);var d=t.state.selection,p=function(t,e,n){var r=t.docView.parseRange(e,n),o=r.node,i=r.fromOffset,s=r.toOffset,a=r.from,c=r.to,u=t.root.getSelection(),l=null,d=u.anchorNode;if(d&&t.dom.contains(1==d.nodeType?d:d.parentNode)&&(l=[{node:d,offset:u.anchorOffset}],To(u)||l.push({node:u.focusNode,offset:u.focusOffset})),lo.chrome&&8===t.lastKeyCode)for(var p=s;p>i;p--){var f=o.childNodes[p-1],h=f.pmViewDesc;if("BR"==f.nodeName&&!h){s=p;break}if(!h||h.size)break}var m=t.state.doc,v=t.someProp("domParser")||tt.fromSchema(t.state.schema),g=m.resolve(a),y=null,b=v.parse(o,{topNode:g.parent,topMatch:g.parent.contentMatchAt(g.index()),topOpen:!0,from:i,to:s,preserveWhitespace:"pre"!=g.parent.type.whitespace||"full",editableContent:!0,findPositions:l,ruleFromNode:ji,context:g});if(l&&null!=l[0].pos){var w=l[0].pos,_=l[1]&&l[1].pos;null==_&&(_=w),y={anchor:w+a,head:_+a}}return{doc:b,sel:y,from:a,to:c}}(t,e,n);if(lo.chrome&&t.cursorWrapper&&p.sel&&p.sel.anchor==t.cursorWrapper.deco.from){var f=t.cursorWrapper.deco.type.toDOM.nextSibling,h=f&&f.nodeValue?f.nodeValue.length:1;p.sel={anchor:p.sel.anchor+h,head:p.sel.anchor+h}}var m,v,g=t.state.doc,y=g.slice(p.from,p.to);8===t.lastKeyCode&&Date.now()-100<t.lastKeyCodeTime?(m=t.state.selection.to,v="end"):(m=t.state.selection.from,v="start"),t.lastKeyCode=null;var b=function(t,e,n,r,o){var i=t.findDiffStart(e,n);if(null==i)return null;var s=t.findDiffEnd(e,n+t.size,n+e.size),a=s.a,c=s.b;if("end"==o){var u=Math.max(0,i-Math.min(a,c));r-=a+u-i}if(a<i&&t.size<e.size){c=(i-=r<=i&&r>=a?i-r:0)+(c-a),a=i}else if(c<i){a=(i-=r<=i&&r>=c?i-r:0)+(a-c),c=i}return{start:i,endA:a,endB:c}}(y.content,p.doc.content,p.from,m,v);if(!b){if(!(r&&d instanceof re&&!d.empty&&d.$head.sameParent(d.$anchor))||t.composing||p.sel&&p.sel.anchor!=p.sel.head){if((lo.ios&&t.lastIOSEnter>Date.now()-225||lo.android)&&o.some((function(t){return"DIV"==t.nodeName||"P"==t.nodeName}))&&t.someProp("handleKeyDown",(function(e){return e(t,Eo(13,"Enter"))})))return void(t.lastIOSEnter=0);if(p.sel){var w=Wi(t,t.state.doc,p.sel);w&&!w.eq(t.state.selection)&&t.dispatch(t.state.tr.setSelection(w))}return}b={start:d.from,endA:d.to,endB:d.to}}t.domChangeCount++,t.state.selection.from<t.state.selection.to&&b.start==b.endB&&t.state.selection instanceof re&&(b.start>t.state.selection.from&&b.start<=t.state.selection.from+2?b.start=t.state.selection.from:b.endA<t.state.selection.to&&b.endA>=t.state.selection.to-2&&(b.endB+=t.state.selection.to-b.endA,b.endA=t.state.selection.to)),lo.ie&&lo.ie_version<=11&&b.endB==b.start+1&&b.endA==b.start&&b.start>p.from&&"  "==p.doc.textBetween(b.start-p.from-1,b.start-p.from+1)&&(b.start--,b.endA--,b.endB--);var _,x=p.doc.resolveNoCache(b.start-p.from),k=p.doc.resolveNoCache(b.endB-p.from),C=x.sameParent(k)&&x.parent.inlineContent;if((lo.ios&&t.lastIOSEnter>Date.now()-225&&(!C||o.some((function(t){return"DIV"==t.nodeName||"P"==t.nodeName})))||!C&&x.pos<p.doc.content.size&&(_=te.findFrom(p.doc.resolve(x.pos+1),1,!0))&&_.head==k.pos)&&t.someProp("handleKeyDown",(function(e){return e(t,Eo(13,"Enter"))})))t.lastIOSEnter=0;else if(t.state.selection.anchor>b.start&&function(t,e,n,r,o){if(!r.parent.isTextblock||n-e<=o.pos-r.pos||Hi(r,!0,!1)<o.pos)return!1;var i=t.resolve(e);if(i.parentOffset<i.parent.content.size||!i.parent.isTextblock)return!1;var s=t.resolve(Hi(i,!0,!0));if(!s.parent.isTextblock||s.pos>n||Hi(s,!0,!1)<n)return!1;return r.parent.content.cut(r.parentOffset).eq(s.parent.content)}(g,b.start,b.endA,x,k)&&t.someProp("handleKeyDown",(function(e){return e(t,Eo(8,"Backspace"))})))lo.android&&lo.chrome&&t.domObserver.suppressSelectionUpdates();else{lo.chrome&&lo.android&&b.toB==b.from&&(t.lastAndroidDelete=Date.now()),lo.android&&!C&&x.start()!=k.start()&&0==k.parentOffset&&x.depth==k.depth&&p.sel&&p.sel.anchor==p.sel.head&&p.sel.head==b.endA&&(b.endB-=2,k=p.doc.resolveNoCache(b.endB-p.from),setTimeout((function(){t.someProp("handleKeyDown",(function(e){return e(t,Eo(13,"Enter"))}))}),20));var S,T,E,M,O=b.start,D=b.endA;if(C)if(x.pos==k.pos)lo.ie&&lo.ie_version<=11&&0==x.parentOffset&&(t.domObserver.suppressSelectionUpdates(),setTimeout((function(){return bi(t)}),20)),S=t.state.tr.delete(O,D),T=g.resolve(b.start).marksAcross(g.resolve(b.endA));else if(b.endA==b.endB&&(M=g.resolve(b.start))&&(E=function(t,e){for(var n,r,o,s=t.firstChild.marks,a=e.firstChild.marks,c=s,u=a,l=0;l<a.length;l++)c=a[l].removeFromSet(c);for(var d=0;d<s.length;d++)u=s[d].removeFromSet(u);if(1==c.length&&0==u.length)r=c[0],n="add",o=function(t){return t.mark(r.addToSet(t.marks))};else{if(0!=c.length||1!=u.length)return null;r=u[0],n="remove",o=function(t){return t.mark(r.removeFromSet(t.marks))}}for(var p=[],f=0;f<e.childCount;f++)p.push(o(e.child(f)));if(i.from(p).eq(t))return{mark:r,type:n}}(x.parent.content.cut(x.parentOffset,k.parentOffset),M.parent.content.cut(M.parentOffset,b.endA-M.start()))))S=t.state.tr,"add"==E.type?S.addMark(O,D,E.mark):S.removeMark(O,D,E.mark);else if(x.parent.child(x.index()).isText&&x.index()==k.index()-(k.textOffset?0:1)){var I=x.parent.textBetween(x.parentOffset,k.parentOffset);if(t.someProp("handleTextInput",(function(e){return e(t,O,D,I)})))return;S=t.state.tr.insertText(I,O,D)}if(S||(S=t.state.tr.replace(O,D,p.doc.slice(b.start-p.from,b.endB-p.from))),p.sel){var A=Wi(t,S.doc,p.sel);A&&!(lo.chrome&&lo.android&&t.composing&&A.empty&&(b.start!=b.endB||t.lastAndroidDelete<Date.now()-100)&&(A.head==O||A.head==S.mapping.map(D)-1)||lo.ie&&A.empty&&A.head==O)&&S.setSelection(A)}T&&S.ensureMarks(T),t.dispatch(S.scrollIntoView())}}}function Wi(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:Ti(t,e.resolve(n.anchor),e.resolve(n.head))}function Hi(t,e,n){for(var r=t.depth,o=e?t.end():t.pos;r>0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,o++,e=!1;if(n)for(var i=t.node(r).maybeChild(t.indexAfter(r));i&&!i.isLeaf;)i=i.firstChild,o++;return o}function qi(t,e){for(var n=[],r=e.content,o=e.openStart,i=e.openEnd;o>1&&i>1&&1==r.childCount&&1==r.firstChild.childCount;){o--,i--;var s=r.firstChild;n.push(s.type.name,s.attrs!=s.type.defaultAttrs?s.attrs:null),r=s.content}var a=t.someProp("clipboardSerializer")||dt.fromSchema(t.state.schema),c=Qi(),u=c.createElement("div");u.appendChild(a.serializeFragment(r,{document:c}));for(var l,d=u.firstChild;d&&1==d.nodeType&&(l=Xi[d.nodeName.toLowerCase()]);){for(var p=l.length-1;p>=0;p--){for(var f=c.createElement(l[p]);u.firstChild;)f.appendChild(u.firstChild);u.appendChild(f),"tbody"!=l[p]&&(o++,i++)}d=u.firstChild}return d&&1==d.nodeType&&d.setAttribute("data-pm-slice",o+" "+i+" "+JSON.stringify(n)),{dom:u,text:t.someProp("clipboardTextSerializer",(function(t){return t(e)}))||e.content.textBetween(0,e.content.size,"\n\n")}}function Ji(t,e,n,r,o){var s,a,c=o.parent.type.spec.code;if(!n&&!e)return null;var u=e&&(r||c||!n);if(u){if(t.someProp("transformPastedText",(function(t){e=t(e,c||r)})),c)return e?new p(i.from(t.state.schema.text(e.replace(/\r\n?/g,"\n"))),0,0):p.empty;var l=t.someProp("clipboardTextParser",(function(t){return t(e,o,r)}));if(l)a=l;else{var d=o.marks(),f=t.state.schema,h=dt.fromSchema(f);s=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach((function(t){var e=s.appendChild(document.createElement("p"));t&&e.appendChild(h.serializeNode(f.text(t,d)))}))}}else t.someProp("transformPastedHTML",(function(t){n=t(n)})),s=function(t){var e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));var n,r=Qi().createElement("div"),o=/<([a-z][^>\s]+)/i.exec(t);(n=o&&Xi[o[1].toLowerCase()])&&(t=n.map((function(t){return"<"+t+">"})).join("")+t+n.map((function(t){return"</"+t+">"})).reverse().join(""));if(r.innerHTML=t,n)for(var i=0;i<n.length;i++)r=r.querySelector(n[i])||r;return r}(n),lo.webkit&&function(t){for(var e=t.querySelectorAll(lo.chrome?"span:not([class]):not([style])":"span.Apple-converted-space"),n=0;n<e.length;n++){var r=e[n];1==r.childNodes.length&&" "==r.textContent&&r.parentNode&&r.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),r)}}(s);var m=s&&s.querySelector("[data-pm-slice]"),v=m&&/^(\d+) (\d+) (.*)/.exec(m.getAttribute("data-pm-slice"));if(!a){var g=t.someProp("clipboardParser")||t.someProp("domParser")||tt.fromSchema(t.state.schema);a=g.parseSlice(s,{preserveWhitespace:!(!u&&!v),context:o,ruleFromNode:function(t){if("BR"==t.nodeName&&!t.nextSibling&&t.parentNode&&!Ki.test(t.parentNode.nodeName))return{ignore:!0}}})}if(v)a=function(t,e){if(!t.size)return t;var n,r=t.content.firstChild.type.schema;try{n=JSON.parse(e)}catch(e){return t}for(var o=t.content,s=t.openStart,a=t.openEnd,c=n.length-2;c>=0;c-=2){var u=r.nodes[n[c]];if(!u||u.hasRequiredAttrs())break;o=i.from(u.create(n[c+1],o)),s++,a++}return new p(o,s,a)}(Yi(a,+v[1],+v[2]),v[3]);else if((a=p.maxOpen(function(t,e){if(t.childCount<2)return t;for(var n=function(n){var r=e.node(n).contentMatchAt(e.index(n)),o=void 0,s=[];if(t.forEach((function(t){if(s){var e,n=r.findWrapping(t.type);if(!n)return s=null;if(e=s.length&&o.length&&function t(e,n,r,o,s){if(s<e.length&&s<n.length&&e[s]==n[s]){var a=t(e,n,r,o.lastChild,s+1);if(a)return o.copy(o.content.replaceChild(o.childCount-1,a));if(o.contentMatchAt(o.childCount).matchType(s==e.length-1?r.type:e[s+1]))return o.copy(o.content.append(i.from(Ui(r,e,s+1))))}}(n,o,t,s[s.length-1],0))s[s.length-1]=e;else{s.length&&(s[s.length-1]=function t(e,n){if(0==n)return e;var r=e.content.replaceChild(e.childCount-1,t(e.lastChild,n-1)),o=e.contentMatchAt(e.childCount).fillBefore(i.empty,!0);return e.copy(r.append(o))}(s[s.length-1],o.length));var a=Ui(t,n);s.push(a),r=r.matchType(a.type,a.attrs),o=n}}})),s)return{v:i.from(s)}},r=e.depth;r>=0;r--){var o=n(r);if(o)return o.v}return t}(a.content,o),!0)).openStart||a.openEnd){for(var y=0,b=0,w=a.content.firstChild;y<a.openStart&&!w.type.spec.isolating;y++,w=w.firstChild);for(var _=a.content.lastChild;b<a.openEnd&&!_.type.spec.isolating;b++,_=_.lastChild);a=Yi(a,y,b)}return t.someProp("transformPasted",(function(t){a=t(a)})),a}var Ki=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function Ui(t,e,n){void 0===n&&(n=0);for(var r=e.length-1;r>=n;r--)t=e[r].create(null,i.from(t));return t}function Gi(t,e,n,r,o,s){var a=e<0?t.firstChild:t.lastChild,c=a.content;return o<r-1&&(c=Gi(c,e,n,r,o+1,s)),o>=n&&(c=e<0?a.contentMatchAt(0).fillBefore(c,t.childCount>1||s<=o).append(c):c.append(a.contentMatchAt(a.childCount).fillBefore(i.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,a.copy(c))}function Yi(t,e,n){return e<t.openStart&&(t=new p(Gi(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new p(Gi(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}var Xi={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]},Zi=null;function Qi(){return Zi||(Zi=document.implementation.createHTMLDocument("title"))}var ts={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},es=lo.ie&&lo.ie_version<=11,ns=function(){this.anchorNode=this.anchorOffset=this.focusNode=this.focusOffset=null};ns.prototype.set=function(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset},ns.prototype.eq=function(t){return t.anchorNode==this.anchorNode&&t.anchorOffset==this.anchorOffset&&t.focusNode==this.focusNode&&t.focusOffset==this.focusOffset};var rs=function(t,e){var n=this;this.view=t,this.handleDOMChange=e,this.queue=[],this.flushingSoon=-1,this.observer=window.MutationObserver&&new window.MutationObserver((function(t){for(var e=0;e<t.length;e++)n.queue.push(t[e]);lo.ie&&lo.ie_version<=11&&t.some((function(t){return"childList"==t.type&&t.removedNodes.length||"characterData"==t.type&&t.oldValue.length>t.target.nodeValue.length}))?n.flushSoon():n.flush()})),this.currentSelection=new ns,es&&(this.onCharData=function(t){n.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),n.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.suppressingSelectionUpdates=!1};rs.prototype.flushSoon=function(){var t=this;this.flushingSoon<0&&(this.flushingSoon=window.setTimeout((function(){t.flushingSoon=-1,t.flush()}),20))},rs.prototype.forceFlush=function(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())},rs.prototype.start=function(){this.observer&&this.observer.observe(this.view.dom,ts),es&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()},rs.prototype.stop=function(){var t=this;if(this.observer){var e=this.observer.takeRecords();if(e.length){for(var n=0;n<e.length;n++)this.queue.push(e[n]);window.setTimeout((function(){return t.flush()}),20)}this.observer.disconnect()}es&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()},rs.prototype.connectSelection=function(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)},rs.prototype.disconnectSelection=function(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)},rs.prototype.suppressSelectionUpdates=function(){var t=this;this.suppressingSelectionUpdates=!0,setTimeout((function(){return t.suppressingSelectionUpdates=!1}),50)},rs.prototype.onSelectionChange=function(){if((!(t=this.view).editable||t.root.activeElement==t.dom)&&Ei(t)){var t;if(this.suppressingSelectionUpdates)return bi(this.view);if(lo.ie&&lo.ie_version<=11&&!this.view.state.selection.empty){var e=this.view.root.getSelection();if(e.focusNode&&_o(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}},rs.prototype.setCurSelection=function(){this.currentSelection.set(this.view.root.getSelection())},rs.prototype.ignoreSelectionChange=function(t){if(0==t.rangeCount)return!0;var e=t.getRangeAt(0).commonAncestorContainer,n=this.view.docView.nearestDesc(e);return n&&n.ignoreMutation({type:"selection",target:3==e.nodeType?e.parentNode:e})?(this.setCurSelection(),!0):void 0},rs.prototype.flush=function(){if(this.view.docView&&!(this.flushingSoon>-1)){var t=this.observer?this.observer.takeRecords():[];this.queue.length&&(t=this.queue.concat(t),this.queue.length=0);var e=this.view.root.getSelection(),n=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(e)&&Ei(this.view)&&!this.ignoreSelectionChange(e),r=-1,o=-1,i=!1,s=[];if(this.view.editable)for(var a=0;a<t.length;a++){var c=this.registerMutation(t[a],s);c&&(r=r<0?c.from:Math.min(c.from,r),o=o<0?c.to:Math.max(c.to,o),c.typeOver&&(i=!0))}if(lo.gecko&&s.length>1){var u=s.filter((function(t){return"BR"==t.nodeName}));if(2==u.length){var l=u[0],d=u[1];l.parentNode&&l.parentNode.parentNode==d.parentNode?d.remove():l.remove()}}(r>-1||n)&&(r>-1&&(this.view.docView.markDirty(r,o),function(t){if(is)return;is=!0,"normal"==getComputedStyle(t.dom).whiteSpace&&console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package.")}(this.view)),this.handleDOMChange(r,o,i,s),this.view.docView.dirty?this.view.updateState(this.view.state):this.currentSelection.eq(e)||bi(this.view),this.currentSelection.set(e))}},rs.prototype.registerMutation=function(t,e){if(e.indexOf(t.target)>-1)return null;var n=this.view.docView.nearestDesc(t.target);if("attributes"==t.type&&(n==this.view.docView||"contenteditable"==t.attributeName||"style"==t.attributeName&&!t.oldValue&&!t.target.getAttribute("style")))return null;if(!n||n.ignoreMutation(t))return null;if("childList"==t.type){for(var r=0;r<t.addedNodes.length;r++)e.push(t.addedNodes[r]);if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(t.target))return{from:n.posBefore,to:n.posAfter};var o=t.previousSibling,i=t.nextSibling;if(lo.ie&&lo.ie_version<=11&&t.addedNodes.length)for(var s=0;s<t.addedNodes.length;s++){var a=t.addedNodes[s],c=a.previousSibling,u=a.nextSibling;(!c||Array.prototype.indexOf.call(t.addedNodes,c)<0)&&(o=c),(!u||Array.prototype.indexOf.call(t.addedNodes,u)<0)&&(i=u)}var l=o&&o.parentNode==t.target?go(o)+1:0,d=n.localPosFromDOM(t.target,l,-1),p=i&&i.parentNode==t.target?go(i):t.target.childNodes.length;return{from:d,to:n.localPosFromDOM(t.target,p,1)}}return"attributes"==t.type?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:{from:n.posAtStart,to:n.posAtEnd,typeOver:t.target.nodeValue==t.oldValue}};var is=!1;var ss={},as={};function cs(t,e){t.lastSelectionOrigin=e,t.lastSelectionTime=Date.now()}function us(t){t.someProp("handleDOMEvents",(function(e){for(var n in e)t.eventHandlers[n]||t.dom.addEventListener(n,t.eventHandlers[n]=function(e){return ls(t,e)})}))}function ls(t,e){return t.someProp("handleDOMEvents",(function(n){var r=n[e.type];return!!r&&(r(t,e)||e.defaultPrevented)}))}function ds(t){return{left:t.clientX,top:t.clientY}}function ps(t,e,n,r,o){if(-1==r)return!1;for(var i=t.state.doc.resolve(r),s=function(r){if(t.someProp(e,(function(e){return r>i.depth?e(t,n,i.nodeAfter,i.before(r),o,!0):e(t,n,i.node(r),i.before(r),o,!1)})))return{v:!0}},a=i.depth+1;a>0;a--){var c=s(a);if(c)return c.v}return!1}function fs(t,e,n){t.focused||t.focus();var r=t.state.tr.setSelection(e);"pointer"==n&&r.setMeta("pointer",!0),t.dispatch(r)}function hs(t,e,n,r,o){return ps(t,"handleClickOn",e,n,r)||t.someProp("handleClick",(function(n){return n(t,e,r)}))||(o?function(t,e){if(-1==e)return!1;var n,r,o=t.state.selection;o instanceof ie&&(n=o.node);for(var i=t.state.doc.resolve(e),s=i.depth+1;s>0;s--){var a=s>i.depth?i.nodeAfter:i.node(s);if(ie.isSelectable(a)){r=n&&o.$from.depth>0&&s>=o.$from.depth&&i.before(o.$from.depth+1)==o.$from.pos?i.before(o.$from.depth):i.before(s);break}}return null!=r&&(fs(t,ie.create(t.state.doc,r),"pointer"),!0)}(t,n):function(t,e){if(-1==e)return!1;var n=t.state.doc.resolve(e),r=n.nodeAfter;return!!(r&&r.isAtom&&ie.isSelectable(r))&&(fs(t,new ie(n),"pointer"),!0)}(t,n))}function ms(t,e,n,r){return ps(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",(function(n){return n(t,e,r)}))}function vs(t,e,n,r){return ps(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",(function(n){return n(t,e,r)}))||function(t,e,n){if(0!=n.button)return!1;var r=t.state.doc;if(-1==e)return!!r.inlineContent&&(fs(t,re.create(r,0,r.content.size),"pointer"),!0);for(var o=r.resolve(e),i=o.depth+1;i>0;i--){var s=i>o.depth?o.nodeAfter:o.node(i),a=o.before(i);if(s.inlineContent)fs(t,re.create(r,a+1,a+1+s.content.size),"pointer");else{if(!ie.isSelectable(s))continue;fs(t,ie.create(r,a),"pointer")}return!0}}(t,n,r)}function gs(t){return Cs(t)}as.keydown=function(t,e){if(t.shiftKey=16==e.keyCode||e.shiftKey,!ws(t,e)&&(t.lastKeyCode=e.keyCode,t.lastKeyCodeTime=Date.now(),!lo.android||!lo.chrome||13!=e.keyCode))if(229!=e.keyCode&&t.domObserver.forceFlush(),!lo.ios||13!=e.keyCode||e.ctrlKey||e.altKey||e.metaKey)t.someProp("handleKeyDown",(function(n){return n(t,e)}))||Vi(t,e)?e.preventDefault():cs(t,"key");else{var n=Date.now();t.lastIOSEnter=n,t.lastIOSEnterFallbackTimeout=setTimeout((function(){t.lastIOSEnter==n&&(t.someProp("handleKeyDown",(function(e){return e(t,Eo(13,"Enter"))})),t.lastIOSEnter=0)}),200)}},as.keyup=function(t,e){16==e.keyCode&&(t.shiftKey=!1)},as.keypress=function(t,e){if(!(ws(t,e)||!e.charCode||e.ctrlKey&&!e.altKey||lo.mac&&e.metaKey))if(t.someProp("handleKeyPress",(function(n){return n(t,e)})))e.preventDefault();else{var n=t.state.selection;if(!(n instanceof re&&n.$from.sameParent(n.$to))){var r=String.fromCharCode(e.charCode);t.someProp("handleTextInput",(function(e){return e(t,n.$from.pos,n.$to.pos,r)}))||t.dispatch(t.state.tr.insertText(r).scrollIntoView()),e.preventDefault()}}};var ys=lo.mac?"metaKey":"ctrlKey";ss.mousedown=function(t,e){t.shiftKey=e.shiftKey;var n=gs(t),r=Date.now(),o="singleClick";r-t.lastClick.time<500&&function(t,e){var n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}(e,t.lastClick)&&!e[ys]&&("singleClick"==t.lastClick.type?o="doubleClick":"doubleClick"==t.lastClick.type&&(o="tripleClick")),t.lastClick={time:r,x:e.clientX,y:e.clientY,type:o};var i=t.posAtCoords(ds(e));i&&("singleClick"==o?(t.mouseDown&&t.mouseDown.done(),t.mouseDown=new bs(t,i,e,n)):("doubleClick"==o?ms:vs)(t,i.pos,i.inside,e)?e.preventDefault():cs(t,"pointer"))};var bs=function(t,e,n,r){var o,i,s=this;if(this.view=t,this.startDoc=t.state.doc,this.pos=e,this.event=n,this.flushed=r,this.selectNode=n[ys],this.allowDefault=n.shiftKey,this.delayedSelectionSync=!1,e.inside>-1)o=t.state.doc.nodeAt(e.inside),i=e.inside;else{var a=t.state.doc.resolve(e.pos);o=a.parent,i=a.depth?a.before():0}this.mightDrag=null;var c=r?null:n.target,u=c?t.docView.nearestDesc(c,!0):null;this.target=u?u.dom:null;var l=t.state.selection;(0==n.button&&o.type.spec.draggable&&!1!==o.type.spec.selectable||l instanceof ie&&l.from<=i&&l.to>i)&&(this.mightDrag={node:o,pos:i,addAttr:this.target&&!this.target.draggable,setUneditable:this.target&&lo.gecko&&!this.target.hasAttribute("contentEditable")}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout((function(){s.view.mouseDown==s&&s.target.setAttribute("contentEditable","false")}),20),this.view.domObserver.start()),t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),cs(t,"pointer")};function ws(t,e){return!!t.composing||!!(lo.safari&&Math.abs(e.timeStamp-t.compositionEndedAt)<500)&&(t.compositionEndedAt=-2e8,!0)}bs.prototype.done=function(){var t=this;this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout((function(){return bi(t.view)})),this.view.mouseDown=null},bs.prototype.up=function(t){if(this.done(),this.view.dom.contains(3==t.target.nodeType?t.target.parentNode:t.target)){var e=this.pos;this.view.state.doc!=this.startDoc&&(e=this.view.posAtCoords(ds(t))),this.allowDefault||!e?cs(this.view,"pointer"):hs(this.view,e.pos,e.inside,t,this.selectNode)?t.preventDefault():0==t.button&&(this.flushed||lo.safari&&this.mightDrag&&!this.mightDrag.node.isAtom||lo.chrome&&!(this.view.state.selection instanceof re)&&Math.min(Math.abs(e.pos-this.view.state.selection.from),Math.abs(e.pos-this.view.state.selection.to))<=2)?(fs(this.view,te.near(this.view.state.doc.resolve(e.pos)),"pointer"),t.preventDefault()):cs(this.view,"pointer")}},bs.prototype.move=function(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0),cs(this.view,"pointer"),0==t.buttons&&this.done()},ss.touchdown=function(t){gs(t),cs(t,"pointer")},ss.contextmenu=function(t){return gs(t)};var _s=lo.android?5e3:-1;function xs(t,e){clearTimeout(t.composingTimeout),e>-1&&(t.composingTimeout=setTimeout((function(){return Cs(t)}),e))}function ks(t){var e;for(t.composing&&(t.composing=!1,t.compositionEndedAt=((e=document.createEvent("Event")).initEvent("event",!0,!0),e.timeStamp));t.compositionNodes.length>0;)t.compositionNodes.pop().markParentsDirty()}function Cs(t,e){if(!(lo.android&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),ks(t),e||t.docView.dirty){var n=gi(t);return n&&!n.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(n)):t.updateState(t.state),!0}return!1}}as.compositionstart=as.compositionupdate=function(t){if(!t.composing){t.domObserver.flush();var e=t.state,n=e.selection.$from;if(e.selection.empty&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some((function(t){return!1===t.type.spec.inclusive}))))t.markCursor=t.state.storedMarks||n.marks(),Cs(t,!0),t.markCursor=null;else if(Cs(t),lo.gecko&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length)for(var r=t.root.getSelection(),o=r.focusNode,i=r.focusOffset;o&&1==o.nodeType&&0!=i;){var s=i<0?o.lastChild:o.childNodes[i-1];if(!s)break;if(3==s.nodeType){r.collapse(s,s.nodeValue.length);break}o=s,i=-1}t.composing=!0}xs(t,_s)},as.compositionend=function(t,e){t.composing&&(t.composing=!1,t.compositionEndedAt=e.timeStamp,xs(t,20))};var Ss=lo.ie&&lo.ie_version<15||lo.ios&&lo.webkit_version<604;function Ts(t,e,n,r){var o=Ji(t,e,n,t.shiftKey,t.state.selection.$from);if(t.someProp("handlePaste",(function(e){return e(t,r,o||p.empty)})))return!0;if(!o)return!1;var i=function(t){return 0==t.openStart&&0==t.openEnd&&1==t.content.childCount?t.content.firstChild:null}(o),s=i?t.state.tr.replaceSelectionWith(i,t.shiftKey):t.state.tr.replaceSelection(o);return t.dispatch(s.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}ss.copy=as.cut=function(t,e){var n=t.state.selection,r="cut"==e.type;if(!n.empty){var o=Ss?null:e.clipboardData,i=qi(t,n.content()),s=i.dom,a=i.text;o?(e.preventDefault(),o.clearData(),o.setData("text/html",s.innerHTML),o.setData("text/plain",a)):function(t,e){if(t.dom.parentNode){var n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";var r=getSelection(),o=document.createRange();o.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout((function(){n.parentNode&&n.parentNode.removeChild(n),t.focus()}),50)}}(t,s),r&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))}},as.paste=function(t,e){if(!t.composing||lo.android){var n=Ss?null:e.clipboardData;n&&Ts(t,n.getData("text/plain"),n.getData("text/html"),e)?e.preventDefault():function(t,e){if(t.dom.parentNode){var n=t.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus(),setTimeout((function(){t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Ts(t,r.value,null,e):Ts(t,r.textContent,r.innerHTML,e)}),50)}}(t,e)}};var Es=function(t,e){this.slice=t,this.move=e},Ms=lo.mac?"altKey":"ctrlKey";for(var Os in ss.dragstart=function(t,e){var n=t.mouseDown;if(n&&n.done(),e.dataTransfer){var r=t.state.selection,o=r.empty?null:t.posAtCoords(ds(e));if(o&&o.pos>=r.from&&o.pos<=(r instanceof ie?r.to-1:r.to));else if(n&&n.mightDrag)t.dispatch(t.state.tr.setSelection(ie.create(t.state.doc,n.mightDrag.pos)));else if(e.target&&1==e.target.nodeType){var i=t.docView.nearestDesc(e.target,!0);i&&i.node.type.spec.draggable&&i!=t.docView&&t.dispatch(t.state.tr.setSelection(ie.create(t.state.doc,i.posBefore)))}var s=t.state.selection.content(),a=qi(t,s),c=a.dom,u=a.text;e.dataTransfer.clearData(),e.dataTransfer.setData(Ss?"Text":"text/html",c.innerHTML),e.dataTransfer.effectAllowed="copyMove",Ss||e.dataTransfer.setData("text/plain",u),t.dragging=new Es(s,!e[Ms])}},ss.dragend=function(t){var e=t.dragging;window.setTimeout((function(){t.dragging==e&&(t.dragging=null)}),50)},as.dragover=as.dragenter=function(t,e){return e.preventDefault()},as.drop=function(t,e){var n=t.dragging;if(t.dragging=null,e.dataTransfer){var r=t.posAtCoords(ds(e));if(r){var o=t.state.doc.resolve(r.pos);if(o){var i=n&&n.slice;i?t.someProp("transformPasted",(function(t){i=t(i)})):i=Ji(t,e.dataTransfer.getData(Ss?"Text":"text/plain"),Ss?null:e.dataTransfer.getData("text/html"),!1,o);var s=n&&!e[Ms];if(t.someProp("handleDrop",(function(n){return n(t,e,i||p.empty,s)})))e.preventDefault();else if(i){e.preventDefault();var a=i?Ft(t.state.doc,o.pos,i):o.pos;null==a&&(a=o.pos);var c=t.state.tr;s&&c.deleteSelection();var u=c.mapping.map(a),l=0==i.openStart&&0==i.openEnd&&1==i.content.childCount,d=c.doc;if(l?c.replaceRangeWith(u,u,i.content.firstChild):c.replaceRange(u,u,i),!c.doc.eq(d)){var f=c.doc.resolve(u);if(l&&ie.isSelectable(i.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(i.content.firstChild))c.setSelection(new ie(f));else{var h=c.mapping.map(a);c.mapping.maps[c.mapping.maps.length-1].forEach((function(t,e,n,r){return h=r})),c.setSelection(Ti(t,f,c.doc.resolve(h)))}t.focus(),t.dispatch(c.setMeta("uiEvent","drop"))}}}}}},ss.focus=function(t){t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout((function(){t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.root.getSelection())&&bi(t)}),20))},ss.blur=function(t,e){t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),e.relatedTarget&&t.dom.contains(e.relatedTarget)&&t.domObserver.currentSelection.set({}),t.focused=!1)},ss.beforeinput=function(t,e){if(lo.chrome&&lo.android&&"deleteContentBackward"==e.inputType){t.domObserver.flushSoon();var n=t.domChangeCount;setTimeout((function(){if(t.domChangeCount==n&&(t.dom.blur(),t.focus(),!t.someProp("handleKeyDown",(function(e){return e(t,Eo(8,"Backspace"))})))){var e=t.state.selection.$cursor;e&&e.pos>0&&t.dispatch(t.state.tr.delete(e.pos-1,e.pos).scrollIntoView())}}),50)}},as)ss[Os]=as[Os];function Ds(t,e){if(t==e)return!0;for(var n in t)if(t[n]!==e[n])return!1;for(var r in e)if(!(r in t))return!1;return!0}var Is=function(t,e){this.spec=e||Rs,this.side=this.spec.side||0,this.toDOM=t};Is.prototype.map=function(t,e,n,r){var o=t.mapResult(e.from+r,this.side<0?-1:1),i=o.pos;return o.deleted?null:new Bs(i-n,i-n,this)},Is.prototype.valid=function(){return!0},Is.prototype.eq=function(t){return this==t||t instanceof Is&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&Ds(this.spec,t.spec))},Is.prototype.destroy=function(t){this.spec.destroy&&this.spec.destroy(t)};var As=function(t,e){this.spec=e||Rs,this.attrs=t};As.prototype.map=function(t,e,n,r){var o=t.map(e.from+r,this.spec.inclusiveStart?-1:1)-n,i=t.map(e.to+r,this.spec.inclusiveEnd?1:-1)-n;return o>=i?null:new Bs(o,i,this)},As.prototype.valid=function(t,e){return e.from<e.to},As.prototype.eq=function(t){return this==t||t instanceof As&&Ds(this.attrs,t.attrs)&&Ds(this.spec,t.spec)},As.is=function(t){return t.type instanceof As};var Ns=function(t,e){this.spec=e||Rs,this.attrs=t};Ns.prototype.map=function(t,e,n,r){var o=t.mapResult(e.from+r,1);if(o.deleted)return null;var i=t.mapResult(e.to+r,-1);return i.deleted||i.pos<=o.pos?null:new Bs(o.pos-n,i.pos-n,this)},Ns.prototype.valid=function(t,e){var n,r=t.content.findIndex(e.from),o=r.index,i=r.offset;return i==e.from&&!(n=t.child(o)).isText&&i+n.nodeSize==e.to},Ns.prototype.eq=function(t){return this==t||t instanceof Ns&&Ds(this.attrs,t.attrs)&&Ds(this.spec,t.spec)};var Bs=function(t,e,n){this.from=t,this.to=e,this.type=n},zs={spec:{configurable:!0},inline:{configurable:!0}};Bs.prototype.copy=function(t,e){return new Bs(t,e,this.type)},Bs.prototype.eq=function(t,e){return void 0===e&&(e=0),this.type.eq(t.type)&&this.from+e==t.from&&this.to+e==t.to},Bs.prototype.map=function(t,e,n){return this.type.map(t,this,e,n)},Bs.widget=function(t,e,n){return new Bs(t,t,new Is(e,n))},Bs.inline=function(t,e,n,r){return new Bs(t,e,new As(n,r))},Bs.node=function(t,e,n,r){return new Bs(t,e,new Ns(n,r))},zs.spec.get=function(){return this.type.spec},zs.inline.get=function(){return this.type instanceof As},Object.defineProperties(Bs.prototype,zs);var Ps=[],Rs={},Fs=function(t,e){this.local=t&&t.length?t:Ps,this.children=e&&e.length?e:Ps};Fs.create=function(t,e){return e.length?Hs(e,t,0,Rs):Ls},Fs.prototype.find=function(t,e,n){var r=[];return this.findInner(null==t?0:t,null==e?1e9:e,r,0,n),r},Fs.prototype.findInner=function(t,e,n,r,o){for(var i=0;i<this.local.length;i++){var s=this.local[i];s.from<=e&&s.to>=t&&(!o||o(s.spec))&&n.push(s.copy(s.from+r,s.to+r))}for(var a=0;a<this.children.length;a+=3)if(this.children[a]<e&&this.children[a+1]>t){var c=this.children[a]+1;this.children[a+2].findInner(t-c,e-c,n,r+c,o)}},Fs.prototype.map=function(t,e,n){return this==Ls||0==t.maps.length?this:this.mapInner(t,e,0,0,n||Rs)},Fs.prototype.mapInner=function(t,e,n,r,o){for(var i,s=0;s<this.local.length;s++){var a=this.local[s].map(t,n,r);a&&a.type.valid(e,a)?(i||(i=[])).push(a):o.onRemove&&o.onRemove(this.local[s].spec)}return this.children.length?function(t,e,n,r,o,i,s){for(var a=t.slice(),c=function(t,e,n,r){for(var s=0;s<a.length;s+=3){var c=a[s+1],u=void 0;-1==c||t>c+i||(e>=a[s]+i?a[s+1]=-1:n>=o&&(u=r-n-(e-t))&&(a[s]+=u,a[s+1]+=u))}},u=0;u<n.maps.length;u++)n.maps[u].forEach(c);for(var l=!1,d=0;d<a.length;d+=3)if(-1==a[d+1]){var p=n.map(t[d]+i),f=p-o;if(f<0||f>=r.content.size){l=!0;continue}var h=n.map(t[d+1]+i,-1)-o,m=r.content.findIndex(f),v=m.index,g=m.offset,y=r.maybeChild(v);if(y&&g==f&&g+y.nodeSize==h){var b=a[d+2].mapInner(n,y,p+1,t[d]+i+1,s);b!=Ls?(a[d]=f,a[d+1]=h,a[d+2]=b):(a[d+1]=-2,l=!0)}else l=!0}if(l){var w=Hs(function(t,e,n,r,o,i,s){function a(t,e){for(var i=0;i<t.local.length;i++){var c=t.local[i].map(r,o,e);c?n.push(c):s.onRemove&&s.onRemove(t.local[i].spec)}for(var u=0;u<t.children.length;u+=3)a(t.children[u+2],t.children[u]+e+1)}for(var c=0;c<t.length;c+=3)-1==t[c+1]&&a(t[c+2],e[c]+i+1);return n}(a,t,e||[],n,o,i,s),r,0,s);e=w.local;for(var _=0;_<a.length;_+=3)a[_+1]<0&&(a.splice(_,3),_-=3);for(var x=0,k=0;x<w.children.length;x+=3){for(var C=w.children[x];k<a.length&&a[k]<C;)k+=3;a.splice(k,0,w.children[x],w.children[x+1],w.children[x+2])}}return new Fs(e&&e.sort(qs),a)}(this.children,i,t,e,n,r,o):i?new Fs(i.sort(qs)):Ls},Fs.prototype.add=function(t,e){return e.length?this==Ls?Fs.create(t,e):this.addInner(t,e,0):this},Fs.prototype.addInner=function(t,e,n){var r,o=this,i=0;t.forEach((function(t,s){var a,c=s+n;if(a=$s(e,t,c)){for(r||(r=o.children.slice());i<r.length&&r[i]<s;)i+=3;r[i]==s?r[i+2]=r[i+2].addInner(t,a,c+1):r.splice(i,0,s,s+t.nodeSize,Hs(a,t,c+1,Rs)),i+=3}}));for(var s=js(i?Ws(e):e,-n),a=0;a<s.length;a++)s[a].type.valid(t,s[a])||s.splice(a--,1);return new Fs(s.length?this.local.concat(s).sort(qs):this.local,r||this.children)},Fs.prototype.remove=function(t){return 0==t.length||this==Ls?this:this.removeInner(t,0)},Fs.prototype.removeInner=function(t,e){for(var n=this.children,r=this.local,o=0;o<n.length;o+=3){for(var i=void 0,s=n[o]+e,a=n[o+1]+e,c=0,u=void 0;c<t.length;c++)(u=t[c])&&u.from>s&&u.to<a&&(t[c]=null,(i||(i=[])).push(u));if(i){n==this.children&&(n=this.children.slice());var l=n[o+2].removeInner(i,s+1);l!=Ls?n[o+2]=l:(n.splice(o,3),o-=3)}}if(r.length)for(var d=0,p=void 0;d<t.length;d++)if(p=t[d])for(var f=0;f<r.length;f++)r[f].eq(p,e)&&(r==this.local&&(r=this.local.slice()),r.splice(f--,1));return n==this.children&&r==this.local?this:r.length||n.length?new Fs(r,n):Ls},Fs.prototype.forChild=function(t,e){if(this==Ls)return this;if(e.isLeaf)return Fs.empty;for(var n,r,o=0;o<this.children.length;o+=3)if(this.children[o]>=t){this.children[o]==t&&(n=this.children[o+2]);break}for(var i=t+1,s=i+e.content.size,a=0;a<this.local.length;a++){var c=this.local[a];if(c.from<s&&c.to>i&&c.type instanceof As){var u=Math.max(i,c.from)-i,l=Math.min(s,c.to)-i;u<l&&(r||(r=[])).push(c.copy(u,l))}}if(r){var d=new Fs(r.sort(qs));return n?new Vs([d,n]):d}return n||Ls},Fs.prototype.eq=function(t){if(this==t)return!0;if(!(t instanceof Fs)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(var e=0;e<this.local.length;e++)if(!this.local[e].eq(t.local[e]))return!1;for(var n=0;n<this.children.length;n+=3)if(this.children[n]!=t.children[n]||this.children[n+1]!=t.children[n+1]||!this.children[n+2].eq(t.children[n+2]))return!1;return!0},Fs.prototype.locals=function(t){return Js(this.localsInner(t))},Fs.prototype.localsInner=function(t){if(this==Ls)return Ps;if(t.inlineContent||!this.local.some(As.is))return this.local;for(var e=[],n=0;n<this.local.length;n++)this.local[n].type instanceof As||e.push(this.local[n]);return e};var Ls=new Fs;Fs.empty=Ls,Fs.removeOverlap=Js;var Vs=function(t){this.members=t};function js(t,e){if(!e||!t.length)return t;for(var n=[],r=0;r<t.length;r++){var o=t[r];n.push(new Bs(o.from+e,o.to+e,o.type))}return n}function $s(t,e,n){if(e.isLeaf)return null;for(var r=n+e.nodeSize,o=null,i=0,s=void 0;i<t.length;i++)(s=t[i])&&s.from>n&&s.to<r&&((o||(o=[])).push(s),t[i]=null);return o}function Ws(t){for(var e=[],n=0;n<t.length;n++)null!=t[n]&&e.push(t[n]);return e}function Hs(t,e,n,r){var o=[],i=!1;e.forEach((function(e,s){var a=$s(t,e,s+n);if(a){i=!0;var c=Hs(a,e,n+s+1,r);c!=Ls&&o.push(s,s+e.nodeSize,c)}}));for(var s=js(i?Ws(t):t,-n).sort(qs),a=0;a<s.length;a++)s[a].type.valid(e,s[a])||(r.onRemove&&r.onRemove(s[a].spec),s.splice(a--,1));return s.length||o.length?new Fs(s,o):Ls}function qs(t,e){return t.from-e.from||t.to-e.to}function Js(t){for(var e=t,n=0;n<e.length-1;n++){var r=e[n];if(r.from!=r.to)for(var o=n+1;o<e.length;o++){var i=e[o];if(i.from!=r.from){i.from<r.to&&(e==t&&(e=t.slice()),e[n]=r.copy(r.from,i.from),Ks(e,o,r.copy(i.from,r.to)));break}i.to!=r.to&&(e==t&&(e=t.slice()),e[o]=i.copy(i.from,r.to),Ks(e,o+1,i.copy(r.to,i.to)))}}return e}function Ks(t,e,n){for(;e<t.length&&qs(n,t[e])>0;)e++;t.splice(e,0,n)}function Us(t){var e=[];return t.someProp("decorations",(function(n){var r=n(t.state);r&&r!=Ls&&e.push(r)})),t.cursorWrapper&&e.push(Fs.create(t.state.doc,[t.cursorWrapper.deco])),Vs.from(e)}Vs.prototype.map=function(t,e){var n=this.members.map((function(n){return n.map(t,e,Rs)}));return Vs.from(n)},Vs.prototype.forChild=function(t,e){if(e.isLeaf)return Fs.empty;for(var n=[],r=0;r<this.members.length;r++){var o=this.members[r].forChild(t,e);o!=Ls&&(o instanceof Vs?n=n.concat(o.members):n.push(o))}return Vs.from(n)},Vs.prototype.eq=function(t){if(!(t instanceof Vs)||t.members.length!=this.members.length)return!1;for(var e=0;e<this.members.length;e++)if(!this.members[e].eq(t.members[e]))return!1;return!0},Vs.prototype.locals=function(t){for(var e,n=!0,r=0;r<this.members.length;r++){var o=this.members[r].localsInner(t);if(o.length)if(e){n&&(e=e.slice(),n=!1);for(var i=0;i<o.length;i++)e.push(o[i])}else e=o}return e?Js(n?e:e.sort(qs)):Ps},Vs.from=function(t){switch(t.length){case 0:return Ls;case 1:return t[0];default:return new Vs(t)}};var Gs,Ys,Xs=function(t,e){this._props=e,this.state=e.state,this.directPlugins=e.plugins||[],this.directPlugins.forEach(ra),this.dispatch=this.dispatch.bind(this),this._root=null,this.focused=!1,this.trackWrites=null,this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):t.apply?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=ea(this),this.markCursor=null,this.cursorWrapper=null,ta(this),this.nodeViews=na(this),this.docView=ni(this.state.doc,Qs(this),Us(this),this.dom,this),this.lastSelectedViewDesc=null,this.dragging=null,function(t){t.shiftKey=!1,t.mouseDown=null,t.lastKeyCode=null,t.lastKeyCodeTime=0,t.lastClick={time:0,x:0,y:0,type:""},t.lastSelectionOrigin=null,t.lastSelectionTime=0,t.lastIOSEnter=0,t.lastIOSEnterFallbackTimeout=null,t.lastAndroidDelete=0,t.composing=!1,t.composingTimeout=null,t.compositionNodes=[],t.compositionEndedAt=-2e8,t.domObserver=new rs(t,(function(e,n,r,o){return $i(t,e,n,r,o)})),t.domObserver.start(),t.domChangeCount=0,t.eventHandlers=Object.create(null);var e=function(e){var n=ss[e];t.dom.addEventListener(e,t.eventHandlers[e]=function(e){!function(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(var n=e.target;n!=t.dom;n=n.parentNode)if(!n||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}(t,e)||ls(t,e)||!t.editable&&e.type in as||n(t,e)})};for(var n in ss)e(n);lo.safari&&t.dom.addEventListener("input",(function(){return null})),us(t)}(this),this.prevDirectPlugins=[],this.pluginViews=[],this.updatePluginViews()},Zs={props:{configurable:!0},root:{configurable:!0},isDestroyed:{configurable:!0}};function Qs(t){var e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),e.translate="no",t.someProp("attributes",(function(n){if("function"==typeof n&&(n=n(t.state)),n)for(var r in n)"class"==r&&(e.class+=" "+n[r]),"style"==r?e.style=(e.style?e.style+";":"")+n[r]:e[r]||"contenteditable"==r||"nodeName"==r||(e[r]=String(n[r]))})),[Bs.node(0,t.state.doc.content.size,e)]}function ta(t){if(t.markCursor){var e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),t.cursorWrapper={dom:e,deco:Bs.widget(t.state.selection.head,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function ea(t){return!t.someProp("editable",(function(e){return!1===e(t.state)}))}function na(t){var e={};return t.someProp("nodeViews",(function(t){for(var n in t)Object.prototype.hasOwnProperty.call(e,n)||(e[n]=t[n])})),e}function ra(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}if(Zs.props.get=function(){if(this._props.state!=this.state){var t=this._props;for(var e in this._props={},t)this._props[e]=t[e];this._props.state=this.state}return this._props},Xs.prototype.update=function(t){t.handleDOMEvents!=this._props.handleDOMEvents&&us(this),this._props=t,t.plugins&&(t.plugins.forEach(ra),this.directPlugins=t.plugins),this.updateStateInner(t.state,!0)},Xs.prototype.setProps=function(t){var e={};for(var n in this._props)e[n]=this._props[n];for(var r in e.state=this.state,t)e[r]=t[r];this.update(e)},Xs.prototype.updateState=function(t){this.updateStateInner(t,this.state.plugins!=t.plugins)},Xs.prototype.updateStateInner=function(t,e){var n=this,r=this.state,o=!1,i=!1;if(t.storedMarks&&this.composing&&(ks(this),i=!0),this.state=t,e){var s=na(this);(function(t,e){var n=0,r=0;for(var o in t){if(t[o]!=e[o])return!0;n++}for(var i in e)r++;return n!=r})(s,this.nodeViews)&&(this.nodeViews=s,o=!0),us(this)}this.editable=ea(this),ta(this);var a=Us(this),c=Qs(this),u=e?"reset":t.scrollToSelection>r.scrollToSelection?"to selection":"preserve",l=o||!this.docView.matchesNode(t.doc,c,a);!l&&t.selection.eq(r.selection)||(i=!0);var d,p,f,h,m,v,g,y,b,w,_,x="preserve"==u&&i&&null==this.dom.style.overflowAnchor&&function(t){for(var e,n,r=t.dom.getBoundingClientRect(),o=Math.max(0,r.top),i=(r.left+r.right)/2,s=o+1;s<Math.min(innerHeight,r.bottom);s+=5){var a=t.root.elementFromPoint(i,s);if(a!=t.dom&&t.dom.contains(a)){var c=a.getBoundingClientRect();if(c.top>=o-20){e=a,n=c.top;break}}}return{refDOM:e,refTop:n,stack:Ao(t.dom)}}(this);if(i){this.domObserver.stop();var k=l&&(lo.ie||lo.chrome)&&!this.composing&&!r.selection.empty&&!t.selection.empty&&(h=r.selection,m=t.selection,v=Math.min(h.$anchor.sharedDepth(h.head),m.$anchor.sharedDepth(m.head)),h.$anchor.start(v)!=m.$anchor.start(v));if(l){var C=lo.chrome?this.trackWrites=this.root.getSelection().focusNode:null;!o&&this.docView.update(t.doc,c,a,this)||(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=ni(t.doc,c,a,this.dom,this)),C&&!this.trackWrites&&(k=!0)}k||!(this.mouseDown&&this.domObserver.currentSelection.eq(this.root.getSelection())&&(d=this,p=d.docView.domFromPos(d.state.selection.anchor,0),f=d.root.getSelection(),_o(p.node,p.offset,f.anchorNode,f.anchorOffset)))?bi(this,k):(Ci(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}if(this.updatePluginViews(r),"reset"==u)this.dom.scrollTop=0;else if("to selection"==u){var S=this.root.getSelection().focusNode;this.someProp("handleScrollToSelection",(function(t){return t(n)}))||(t.selection instanceof ie?Io(this,this.docView.domAfterPos(t.selection.from).getBoundingClientRect(),S):Io(this,this.coordsAtPos(t.selection.head,1),S))}else x&&(y=(g=x).refDOM,b=g.refTop,w=g.stack,_=y?y.getBoundingClientRect().top:0,No(w,0==_?0:_-b))},Xs.prototype.destroyPluginViews=function(){for(var t;t=this.pluginViews.pop();)t.destroy&&t.destroy()},Xs.prototype.updatePluginViews=function(t){if(t&&t.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(var e=0;e<this.pluginViews.length;e++){var n=this.pluginViews[e];n.update&&n.update(this,t)}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(var r=0;r<this.directPlugins.length;r++){var o=this.directPlugins[r];o.spec.view&&this.pluginViews.push(o.spec.view(this))}for(var i=0;i<this.state.plugins.length;i++){var s=this.state.plugins[i];s.spec.view&&this.pluginViews.push(s.spec.view(this))}}},Xs.prototype.someProp=function(t,e){var n,r=this._props&&this._props[t];if(null!=r&&(n=e?e(r):r))return n;for(var o=0;o<this.directPlugins.length;o++){var i=this.directPlugins[o].props[t];if(null!=i&&(n=e?e(i):i))return n}var s=this.state.plugins;if(s)for(var a=0;a<s.length;a++){var c=s[a].props[t];if(null!=c&&(n=e?e(c):c))return n}},Xs.prototype.hasFocus=function(){return this.root.activeElement==this.dom},Xs.prototype.focus=function(){this.domObserver.stop(),this.editable&&function(t){if(t.setActive)return t.setActive();if(Bo)return t.focus(Bo);var e=Ao(t);t.focus(null==Bo?{get preventScroll(){return Bo={preventScroll:!0},!0}}:void 0),Bo||(Bo=!1,No(e,0))}(this.dom),bi(this),this.domObserver.start()},Zs.root.get=function(){var t=this._root;if(null==t)for(var e=this.dom.parentNode;e;e=e.parentNode)if(9==e.nodeType||11==e.nodeType&&e.host)return e.getSelection||(Object.getPrototypeOf(e).getSelection=function(){return document.getSelection()}),this._root=e;return t||document},Xs.prototype.posAtCoords=function(t){return Ro(this,t)},Xs.prototype.coordsAtPos=function(t,e){return void 0===e&&(e=1),Vo(this,t,e)},Xs.prototype.domAtPos=function(t,e){return void 0===e&&(e=0),this.docView.domFromPos(t,e)},Xs.prototype.nodeDOM=function(t){var e=this.docView.descAt(t);return e?e.nodeDOM:null},Xs.prototype.posAtDOM=function(t,e,n){void 0===n&&(n=-1);var r=this.docView.posFromDOM(t,e,n);if(null==r)throw new RangeError("DOM position not inside the editor");return r},Xs.prototype.endOfTextblock=function(t,e){return Uo(this,e||this.state,t)},Xs.prototype.destroy=function(){this.docView&&(!function(t){for(var e in t.domObserver.stop(),t.eventHandlers)t.dom.removeEventListener(e,t.eventHandlers[e]);clearTimeout(t.composingTimeout),clearTimeout(t.lastIOSEnterFallbackTimeout)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Us(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)},Zs.isDestroyed.get=function(){return null==this.docView},Xs.prototype.dispatchEvent=function(t){return function(t,e){ls(t,e)||!ss[e.type]||!t.editable&&e.type in as||ss[e.type](t,e)}(this,t)},Xs.prototype.dispatch=function(t){var e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))},Object.defineProperties(Xs.prototype,Zs),"undefined"!=typeof WeakMap){var oa=new WeakMap;Gs=function(t){return oa.get(t)},Ys=function(t,e){return oa.set(t,e),e}}else{var ia=[],sa=0;Gs=function(t){for(var e=0;e<ia.length;e+=2)if(ia[e]==t)return ia[e+1]},Ys=function(t,e){return 10==sa&&(sa=0),ia[sa++]=t,ia[sa++]=e}}var aa=function(t,e,n,r){this.left=t,this.top=e,this.right=n,this.bottom=r},ca=function(t,e,n,r){this.width=t,this.height=e,this.map=n,this.problems=r};function ua(t){if(t.colwidth)return t.colwidth.slice();for(var e=[],n=0;n<t.colspan;n++)e.push(0);return e}function la(t,e){var n=t.getAttribute("data-colwidth"),r=n&&/^\d+(,\d+)*$/.test(n)?n.split(",").map((function(t){return Number(t)})):null,o=Number(t.getAttribute("colspan")||1),i={colspan:o,rowspan:Number(t.getAttribute("rowspan")||1),colwidth:r&&r.length==o?r:null};for(var s in e){var a=e[s].getFromDOM,c=a&&a(t);null!=c&&(i[s]=c)}return i}function da(t,e){var n={};for(var r in 1!=t.attrs.colspan&&(n.colspan=t.attrs.colspan),1!=t.attrs.rowspan&&(n.rowspan=t.attrs.rowspan),t.attrs.colwidth&&(n["data-colwidth"]=t.attrs.colwidth.join(",")),e){var o=e[r].setDOMAttr;o&&o(t.attrs[r],n)}return n}function pa(t){var e=t.cellAttributes||{},n={colspan:{default:1},rowspan:{default:1},colwidth:{default:null}};for(var r in e)n[r]={default:e[r].default};return{table:{content:"table_row+",tableRole:"table",isolating:!0,group:t.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:t.cellContent,attrs:n,tableRole:"cell",isolating:!0,parseDOM:[{tag:"td",getAttrs:function(t){return la(t,e)}}],toDOM:function(t){return["td",da(t,e),0]}},table_header:{content:t.cellContent,attrs:n,tableRole:"header_cell",isolating:!0,parseDOM:[{tag:"th",getAttrs:function(t){return la(t,e)}}],toDOM:function(t){return["th",da(t,e),0]}}}}function fa(t){var e=t.cached.tableNodeTypes;if(!e)for(var n in e=t.cached.tableNodeTypes={},t.nodes){var r=t.nodes[n],o=r.spec.tableRole;o&&(e[o]=r)}return e}ca.prototype.findCell=function(t){for(var e=0;e<this.map.length;e++){var n=this.map[e];if(n==t){for(var r=e%this.width,o=e/this.width|0,i=r+1,s=o+1,a=1;i<this.width&&this.map[e+a]==n;a++)i++;for(var c=1;s<this.height&&this.map[e+this.width*c]==n;c++)s++;return new aa(r,o,i,s)}}throw new RangeError("No cell with offset "+t+" found")},ca.prototype.colCount=function(t){for(var e=0;e<this.map.length;e++)if(this.map[e]==t)return e%this.width;throw new RangeError("No cell with offset "+t+" found")},ca.prototype.nextCell=function(t,e,n){var r=this.findCell(t),o=r.left,i=r.right,s=r.top,a=r.bottom;return"horiz"==e?(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)]},ca.prototype.rectBetween=function(t,e){var n=this.findCell(t),r=n.left,o=n.right,i=n.top,s=n.bottom,a=this.findCell(e),c=a.left,u=a.right,l=a.top,d=a.bottom;return new aa(Math.min(r,c),Math.min(i,l),Math.max(o,u),Math.max(s,d))},ca.prototype.cellsInRect=function(t){for(var e=[],n={},r=t.top;r<t.bottom;r++)for(var o=t.left;o<t.right;o++){var i=r*this.width+o,s=this.map[i];n[s]||(n[s]=!0,o==t.left&&o&&this.map[i-1]==s||r==t.top&&r&&this.map[i-this.width]==s||e.push(s))}return e},ca.prototype.positionAt=function(t,e,n){for(var r=0,o=0;;r++){var i=o+n.child(r).nodeSize;if(r==t){for(var s=e+t*this.width,a=(t+1)*this.width;s<a&&this.map[s]<o;)s++;return s==a?i-1:this.map[s]}o=i}},ca.get=function(t){return Gs(t)||Ys(t,function(t){if("table"!=t.type.spec.tableRole)throw new RangeError("Not a table node: "+t.type.name);for(var e=function(t){for(var e=-1,n=!1,r=0;r<t.childCount;r++){var o=t.child(r),i=0;if(n)for(var s=0;s<r;s++)for(var a=t.child(s),c=0;c<a.childCount;c++){var u=a.child(c);s+u.attrs.rowspan>r&&(i+=u.attrs.colspan)}for(var l=0;l<o.childCount;l++){var d=o.child(l);i+=d.attrs.colspan,d.attrs.rowspan>1&&(n=!0)}-1==e?e=i:e!=i&&(e=Math.max(e,i))}return e}(t),n=t.childCount,r=[],o=0,i=null,s=[],a=0,c=e*n;a<c;a++)r[a]=0;for(var u=0,l=0;u<n;u++){var d=t.child(u);l++;for(var p=0;;p++){for(;o<r.length&&0!=r[o];)o++;if(p==d.childCount)break;for(var f=d.child(p),h=f.attrs,m=h.colspan,v=h.rowspan,g=h.colwidth,y=0;y<v;y++){if(y+u>=n){(i||(i=[])).push({type:"overlong_rowspan",pos:l,n:v-y});break}for(var b=o+y*e,w=0;w<m;w++){0==r[b+w]?r[b+w]=l:(i||(i=[])).push({type:"collision",row:u,pos:l,n:m-w});var _=g&&g[w];if(_){var x=(b+w)%e*2,k=s[x];null==k||k!=_&&1==s[x+1]?(s[x]=_,s[x+1]=1):k==_&&s[x+1]++}}}o+=m,l+=f.nodeSize}for(var C=(u+1)*e,S=0;o<C;)0==r[o++]&&S++;S&&(i||(i=[])).push({type:"missing",row:u,n:S}),l++}for(var T=new ca(e,n,r,i),E=!1,M=0;!E&&M<s.length;M+=2)null!=s[M]&&s[M+1]<n&&(E=!0);E&&function(t,e,n){t.problems||(t.problems=[]);for(var r=0,o={};r<t.map.length;r++){var i=t.map[r];if(!o[i]){o[i]=!0;for(var s=n.nodeAt(i),a=null,c=0;c<s.attrs.colspan;c++){var u=(r+c)%t.width,l=e[2*u];null==l||s.attrs.colwidth&&s.attrs.colwidth[c]==l||((a||(a=ua(s.attrs)))[c]=l)}a&&t.problems.unshift({type:"colwidth mismatch",pos:i,colwidth:a})}}}(T,s,t);return T}(t))};var ha=new xe("selectingCells");function ma(t){for(var e=t.depth-1;e>0;e--)if("row"==t.node(e).type.spec.tableRole)return t.node(0).resolve(t.before(e+1));return null}function va(t){for(var e=t.selection.$head,n=e.depth;n>0;n--)if("row"==e.node(n).type.spec.tableRole)return!0;return!1}function ga(t){var e=t.selection;return e.$anchorCell?e.$anchorCell.pos>e.$headCell.pos?e.$anchorCell:e.$headCell:e.node&&"cell"==e.node.type.spec.tableRole?e.$anchor:ma(e.$head)||function(t){for(var e=t.nodeAfter,n=t.pos;e;e=e.firstChild,n++){var r=e.type.spec.tableRole;if("cell"==r||"header_cell"==r)return t.doc.resolve(n)}for(var o=t.nodeBefore,i=t.pos;o;o=o.lastChild,i--){var s=o.type.spec.tableRole;if("cell"==s||"header_cell"==s)return t.doc.resolve(i-o.nodeSize)}}(e.$head)}function ya(t){return"row"==t.parent.type.spec.tableRole&&t.nodeAfter}function ba(t){return t.node(0).resolve(t.pos+t.nodeAfter.nodeSize)}function wa(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}function _a(t){return ca.get(t.node(-1)).findCell(t.pos-t.start(-1))}function xa(t){return ca.get(t.node(-1)).colCount(t.pos-t.start(-1))}function ka(t,e,n){var r=t.start(-1),o=ca.get(t.node(-1)).nextCell(t.pos-r,e,n);return null==o?null:t.node(0).resolve(r+o)}function Ca(t,e,n){var r={};for(var o in t)r[o]=t[o];return r[e]=n,r}function Sa(t,e,n){void 0===n&&(n=1);var r=Ca(t,"colspan",t.colspan-n);return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(e,n),r.colwidth.some((function(t){return t>0}))||(r.colwidth=null)),r}function Ta(t,e,n){void 0===n&&(n=1);var r=Ca(t,"colspan",t.colspan+n);if(r.colwidth){r.colwidth=r.colwidth.slice();for(var o=0;o<n;o++)r.colwidth.splice(e,0,0)}return r}function Ea(t,e,n){for(var r=fa(e.type.schema).header_cell,o=0;o<t.height;o++)if(e.nodeAt(t.map[n+o*t.width]).type!=r)return!1;return!0}var Ma=function(t){function e(e,n){void 0===n&&(n=e);var r=e.node(-1),o=ca.get(r),i=e.start(-1),s=o.rectBetween(e.pos-i,n.pos-i),a=e.node(0),c=o.cellsInRect(s).filter((function(t){return t!=n.pos-i}));c.unshift(n.pos-i);var u=c.map((function(t){var e=r.nodeAt(t),n=t+i+1;return new ne(a.resolve(n),a.resolve(n+e.content.size))}));t.call(this,u[0].$from,u[0].$to,u),this.$anchorCell=e,this.$headCell=n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.map=function(t,n){var r=t.resolve(n.map(this.$anchorCell.pos)),o=t.resolve(n.map(this.$headCell.pos));if(ya(r)&&ya(o)&&wa(r,o)){var i=this.$anchorCell.node(-1)!=r.node(-1);return i&&this.isRowSelection()?e.rowSelection(r,o):i&&this.isColSelection()?e.colSelection(r,o):new e(r,o)}return re.between(r,o)},e.prototype.content=function(){for(var t=this.$anchorCell.node(-1),e=ca.get(t),n=this.$anchorCell.start(-1),r=e.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),o={},s=[],a=r.top;a<r.bottom;a++){for(var c=[],u=a*e.width+r.left,l=r.left;l<r.right;l++,u++){var d=e.map[u];if(!o[d]){o[d]=!0;var f=e.findCell(d),h=t.nodeAt(d),m=r.left-f.left,v=f.right-r.right;if(m>0||v>0){var g=h.attrs;m>0&&(g=Sa(g,0,m)),v>0&&(g=Sa(g,g.colspan-v,v)),h=f.left<r.left?h.type.createAndFill(g):h.type.create(g,h.content)}if(f.top<r.top||f.bottom>r.bottom){var y=Ca(h.attrs,"rowspan",Math.min(f.bottom,r.bottom)-Math.max(f.top,r.top));h=f.top<r.top?h.type.createAndFill(y):h.type.create(y,h.content)}c.push(h)}}s.push(t.child(a).copy(i.from(c)))}var b=this.isColSelection()&&this.isRowSelection()?t:s;return new p(i.from(b),1,1)},e.prototype.replace=function(e,n){void 0===n&&(n=p.empty);for(var r=e.steps.length,o=this.ranges,i=0;i<o.length;i++){var s=o[i],a=s.$from,c=s.$to,u=e.mapping.slice(r);e.replace(u.map(a.pos),u.map(c.pos),i?p.empty:n)}var l=t.findFrom(e.doc.resolve(e.mapping.slice(r).map(this.to)),-1);l&&e.setSelection(l)},e.prototype.replaceWith=function(t,e){this.replace(t,new p(i.from(e),0,0))},e.prototype.forEachCell=function(t){for(var e=this.$anchorCell.node(-1),n=ca.get(e),r=this.$anchorCell.start(-1),o=n.cellsInRect(n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r)),i=0;i<o.length;i++)t(e.nodeAt(o[i]),r+o[i])},e.prototype.isColSelection=function(){var t=this.$anchorCell.index(-1),e=this.$headCell.index(-1);if(Math.min(t,e)>0)return!1;var n=t+this.$anchorCell.nodeAfter.attrs.rowspan,r=e+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,r)==this.$headCell.node(-1).childCount},e.colSelection=function(t,n){void 0===n&&(n=t);var r=ca.get(t.node(-1)),o=t.start(-1),i=r.findCell(t.pos-o),s=r.findCell(n.pos-o),a=t.node(0);return i.top<=s.top?(i.top>0&&(t=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&&(t=a.resolve(o+r.map[r.width*(r.height-1)+i.right-1]))),new e(t,n)},e.prototype.isRowSelection=function(){var t=ca.get(this.$anchorCell.node(-1)),e=this.$anchorCell.start(-1),n=t.colCount(this.$anchorCell.pos-e),r=t.colCount(this.$headCell.pos-e);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)==t.width},e.prototype.eq=function(t){return t instanceof e&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos},e.rowSelection=function(t,n){void 0===n&&(n=t);var r=ca.get(t.node(-1)),o=t.start(-1),i=r.findCell(t.pos-o),s=r.findCell(n.pos-o),a=t.node(0);return i.left<=s.left?(i.left>0&&(t=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&&(t=a.resolve(o+r.map[r.width*(i.top+1)-1]))),new e(t,n)},e.prototype.toJSON=function(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}},e.fromJSON=function(t,n){return new e(t.resolve(n.anchor),t.resolve(n.head))},e.create=function(t,n,r){return void 0===r&&(r=n),new e(t.resolve(n),t.resolve(r))},e.prototype.getBookmark=function(){return new Oa(this.$anchorCell.pos,this.$headCell.pos)},e}(te);Ma.prototype.visible=!1,te.jsonID("cell",Ma);var Oa=function(t,e){this.anchor=t,this.head=e};function Da(t){if(!(t.selection instanceof Ma))return null;var e=[];return t.selection.forEachCell((function(t,n){e.push(Bs.node(n,n+t.nodeSize,{class:"selectedCell"}))})),Fs.create(t.doc,e)}function Ia(t){if(!t.size)return null;for(var e=t.content,n=t.openStart,r=t.openEnd;1==e.childCount&&(n>0&&r>0||"table"==e.firstChild.type.spec.tableRole);)n--,r--,e=e.firstChild.content;var o=e.firstChild,s=o.type.spec.tableRole,a=o.type.schema,c=[];if("row"==s)for(var u=0;u<e.childCount;u++){var l=e.child(u).content,d=u?0:Math.max(0,n-1),f=u<e.childCount-1?0:Math.max(0,r-1);(d||f)&&(l=Aa(fa(a).row,new p(l,d,f)).content),c.push(l)}else{if("cell"!=s&&"header_cell"!=s)return null;c.push(n||r?Aa(fa(a).row,new p(e,n,r)).content:e)}return function(t,e){for(var n=[],r=0;r<e.length;r++)for(var o=e[r],s=o.childCount-1;s>=0;s--)for(var a=o.child(s).attrs,c=a.rowspan,u=a.colspan,l=r;l<r+c;l++)n[l]=(n[l]||0)+u;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>=e.length&&e.push(i.empty),n[f]<d){for(var h=fa(t).cell.createAndFill(),m=[],v=n[f];v<d;v++)m.push(h);e[f]=e[f].append(i.from(m))}return{height:e.length,width:d,rows:e}}(a,c)}function Aa(t,e){var n=t.createAndFill();return new wt(n).replace(0,n.content.size,e).doc}function Na(t,e,n){var r=t.width,o=t.height,s=t.rows;if(r!=e){for(var a=[],c=[],u=0;u<s.length;u++){for(var l=s[u],d=[],p=a[u]||0,f=0;p<e;f++){var h=l.child(f%l.childCount);p+h.attrs.colspan>e&&(h=h.type.create(Sa(h.attrs,h.attrs.colspan,p+h.attrs.colspan-e),h.content)),d.push(h),p+=h.attrs.colspan;for(var m=1;m<h.attrs.rowspan;m++)a[u+m]=(a[u+m]||0)+h.attrs.colspan}c.push(i.from(d))}s=c,r=e}if(o!=n){for(var v=[],g=0,y=0;g<n;g++,y++){for(var b=[],w=s[y%o],_=0;_<w.childCount;_++){var x=w.child(_);g+x.attrs.rowspan>n&&(x=x.type.create(Ca(x.attrs,"rowspan",Math.max(1,n-x.attrs.rowspan)),x.content)),b.push(x)}v.push(i.from(b))}s=v,o=n}return{width:r,height:o,rows:s}}function Ba(t,e,n,r,o,i,s,a){if(0==s||s==e.height)return!1;for(var c=!1,u=o;u<i;u++){var l=s*e.width+u,d=e.map[l];if(e.map[l-e.width]==d){c=!0;var p=n.nodeAt(d),f=e.findCell(d),h=f.top,m=f.left;t.setNodeMarkup(t.mapping.slice(a).map(d+r),null,Ca(p.attrs,"rowspan",s-h)),t.insert(t.mapping.slice(a).map(e.positionAt(s,m,n)),p.type.createAndFill(Ca(p.attrs,"rowspan",h+p.attrs.rowspan-s))),u+=p.attrs.colspan-1}}return c}function za(t,e,n,r,o,i,s,a){if(0==s||s==e.width)return!1;for(var c=!1,u=o;u<i;u++){var l=u*e.width+s,d=e.map[l];if(e.map[l-1]==d){c=!0;var p=n.nodeAt(d),f=e.colCount(d),h=t.mapping.slice(a).map(d+r);t.setNodeMarkup(h,null,Sa(p.attrs,s-f,p.attrs.colspan-(s-f))),t.insert(h+p.nodeSize,p.type.createAndFill(Sa(p.attrs,0,s-f))),u+=p.attrs.rowspan-1}}return c}function Pa(t,e,n,r,o){var s=n?t.doc.nodeAt(n-1):t.doc,a=ca.get(s),c=r.top,u=r.left,l=u+o.width,d=c+o.height,f=t.tr,h=0;function m(){s=n?f.doc.nodeAt(n-1):f.doc,a=ca.get(s),h=f.mapping.maps.length}(function(t,e,n,r,o,s,a){var c,u,l=fa(t.doc.type.schema);if(o>e.width)for(var d=0,p=0;d<e.height;d++){var f=n.child(d);p+=f.nodeSize;var h=[],m=void 0;m=null==f.lastChild||f.lastChild.type==l.cell?c||(c=l.cell.createAndFill()):u||(u=l.header_cell.createAndFill());for(var v=e.width;v<o;v++)h.push(m);t.insert(t.mapping.slice(a).map(p-1+r),h)}if(s>e.height){for(var g=[],y=0,b=(e.height-1)*e.width;y<Math.max(e.width,o);y++){var w=!(y>=e.width)&&n.nodeAt(e.map[b+y]).type==l.header_cell;g.push(w?u||(u=l.header_cell.createAndFill()):c||(c=l.cell.createAndFill()))}for(var _=l.row.create(null,i.from(g)),x=[],k=e.height;k<s;k++)x.push(_);t.insert(t.mapping.slice(a).map(r+n.nodeSize-2),x)}return!(!c&&!u)})(f,a,s,n,l,d,h)&&m(),Ba(f,a,s,n,u,l,c,h)&&m(),Ba(f,a,s,n,u,l,d,h)&&m(),za(f,a,s,n,c,d,u,h)&&m(),za(f,a,s,n,c,d,l,h)&&m();for(var v=c;v<d;v++){var g=a.positionAt(v,u,s),y=a.positionAt(v,l,s);f.replace(f.mapping.slice(h).map(g+n),f.mapping.slice(h).map(y+n),new p(o.rows[v-c],0,0))}m(),f.setSelection(new Ma(f.doc.resolve(n+a.positionAt(c,u,s)),f.doc.resolve(n+a.positionAt(d-1,l-1,s)))),e(f)}Oa.prototype.map=function(t){return new Oa(t.map(this.anchor),t.map(this.head))},Oa.prototype.resolve=function(t){var e=t.resolve(this.anchor),n=t.resolve(this.head);return"row"==e.parent.type.spec.tableRole&&"row"==n.parent.type.spec.tableRole&&e.index()<e.parent.childCount&&n.index()<n.parent.childCount&&wa(e,n)?new Ma(e,n):te.near(n,1)};var Ra=uo({ArrowLeft:La("horiz",-1),ArrowRight:La("horiz",1),ArrowUp:La("vert",-1),ArrowDown:La("vert",1),"Shift-ArrowLeft":Va("horiz",-1),"Shift-ArrowRight":Va("horiz",1),"Shift-ArrowUp":Va("vert",-1),"Shift-ArrowDown":Va("vert",1),Backspace:ja,"Mod-Backspace":ja,Delete:ja,"Mod-Delete":ja});function Fa(t,e,n){return!n.eq(t.selection)&&(e&&e(t.tr.setSelection(n).scrollIntoView()),!0)}function La(t,e){return function(n,r,o){var i=n.selection;if(i instanceof Ma)return Fa(n,r,te.near(i.$headCell,e));if("horiz"!=t&&!i.empty)return!1;var s=qa(o,t,e);if(null==s)return!1;if("horiz"==t)return Fa(n,r,te.near(n.doc.resolve(i.head+e),e));var a,c=n.doc.resolve(s),u=ka(c,t,e);return a=u?te.near(u,1):e<0?te.near(n.doc.resolve(c.before(-1)),-1):te.near(n.doc.resolve(c.after(-1)),1),Fa(n,r,a)}}function Va(t,e){return function(n,r,o){var i=n.selection;if(!(i instanceof Ma)){var s=qa(o,t,e);if(null==s)return!1;i=new Ma(n.doc.resolve(s))}var a=ka(i.$headCell,t,e);return!!a&&Fa(n,r,new Ma(i.$anchorCell,a))}}function ja(t,e){var n=t.selection;if(!(n instanceof Ma))return!1;if(e){var r=t.tr,o=fa(t.schema).cell.createAndFill().content;n.forEachCell((function(t,e){t.content.eq(o)||r.replace(r.mapping.map(e+1),r.mapping.map(e+t.nodeSize-1),new p(o,0,0))})),r.docChanged&&e(r)}return!0}function $a(t,e){var n=ma(t.state.doc.resolve(e));return!!n&&(t.dispatch(t.state.tr.setSelection(new Ma(n))),!0)}function Wa(t,e,n){if(!va(t.state))return!1;var r=Ia(n),o=t.state.selection;if(o instanceof Ma){r||(r={width:1,height:1,rows:[i.from(Aa(fa(t.state.schema).cell,n))]});var s=o.$anchorCell.node(-1),a=o.$anchorCell.start(-1),c=ca.get(s).rectBetween(o.$anchorCell.pos-a,o.$headCell.pos-a);return r=Na(r,c.right-c.left,c.bottom-c.top),Pa(t.state,t.dispatch,a,c,r),!0}if(r){var u=ga(t.state),l=u.start(-1);return Pa(t.state,t.dispatch,l,ca.get(u.node(-1)).findCell(u.pos-l),r),!0}return!1}function Ha(t,e){if(!e.ctrlKey&&!e.metaKey){var n,r=Ja(t,e.target);if(e.shiftKey&&t.state.selection instanceof Ma)o(t.state.selection.$anchorCell,e),e.preventDefault();else if(e.shiftKey&&r&&null!=(n=ma(t.state.selection.$anchor))&&Ka(t,e).pos!=n.pos)o(n,e),e.preventDefault();else if(!r)return;t.root.addEventListener("mouseup",i),t.root.addEventListener("dragstart",i),t.root.addEventListener("mousemove",s)}function o(e,n){var r=Ka(t,n),o=null==ha.getState(t.state);if(!r||!wa(e,r)){if(!o)return;r=e}var i=new Ma(e,r);if(o||!t.state.selection.eq(i)){var s=t.state.tr.setSelection(i);o&&s.setMeta(ha,e.pos),t.dispatch(s)}}function i(){t.root.removeEventListener("mouseup",i),t.root.removeEventListener("dragstart",i),t.root.removeEventListener("mousemove",s),null!=ha.getState(t.state)&&t.dispatch(t.state.tr.setMeta(ha,-1))}function s(n){var s,a=ha.getState(t.state);if(null!=a)s=t.state.doc.resolve(a);else if(Ja(t,n.target)!=r&&!(s=Ka(t,e)))return i();s&&o(s,n)}}function qa(t,e,n){if(!(t.state.selection instanceof re))return null;for(var r=t.state.selection.$head,o=r.depth-1;o>=0;o--){var i=r.node(o);if((n<0?r.index(o):r.indexAfter(o))!=(n<0?0:i.childCount))return null;if("cell"==i.type.spec.tableRole||"header_cell"==i.type.spec.tableRole){var s=r.before(o),a="vert"==e?n>0?"down":"up":n>0?"right":"left";return t.endOfTextblock(a)?s:null}}return null}function Ja(t,e){for(;e&&e!=t.dom;e=e.parentNode)if("TD"==e.nodeName||"TH"==e.nodeName)return e}function Ka(t,e){var n=t.posAtCoords({left:e.clientX,top:e.clientY});return n&&n?ma(t.state.doc.resolve(n.pos)):null}var Ua=new xe("fix-tables");function Ga(t,e){var n,r=function(e,r){"table"==e.type.spec.tableRole&&(n=function(t,e,n,r){var o=ca.get(e);if(!o.problems)return r;r||(r=t.tr);for(var i,s,a=[],c=0;c<o.height;c++)a.push(0);for(var u=0;u<o.problems.length;u++){var l=o.problems[u];if("collision"==l.type){for(var d=e.nodeAt(l.pos),p=0;p<d.attrs.rowspan;p++)a[l.row+p]+=l.n;r.setNodeMarkup(r.mapping.map(n+1+l.pos),null,Sa(d.attrs,d.attrs.colspan-l.n,l.n))}else if("missing"==l.type)a[l.row]+=l.n;else if("overlong_rowspan"==l.type){var f=e.nodeAt(l.pos);r.setNodeMarkup(r.mapping.map(n+1+l.pos),null,Ca(f.attrs,"rowspan",f.attrs.rowspan-l.n))}else if("colwidth mismatch"==l.type){var h=e.nodeAt(l.pos);r.setNodeMarkup(r.mapping.map(n+1+l.pos),null,Ca(h.attrs,"colwidth",l.colwidth))}}for(var m=0;m<a.length;m++)a[m]&&(null==i&&(i=m),s=m);for(var v=0,g=n+1;v<o.height;v++){var y=e.child(v),b=g+y.nodeSize,w=a[v];if(w>0){var _="cell";y.firstChild&&(_=y.firstChild.type.spec.tableRole);for(var x=[],k=0;k<w;k++)x.push(fa(t.schema)[_].createAndFill());var C=0!=v&&i!=v-1||s!=v?b-1:g+1;r.insert(r.mapping.map(C),x)}g=b}return r.setMeta(Ua,{fixTables:!0})}(t,e,r,n))};return e?e.doc!=t.doc&&function t(e,n,r,o){var i=e.childCount,s=n.childCount;t:for(var a=0,c=0;a<s;a++){for(var u=n.child(a),l=c,d=Math.min(i,a+3);l<d;l++)if(e.child(l)==u){c=l+1,r+=u.nodeSize;continue t}o(u,r),c<i&&e.child(c).sameMarkup(u)?t(e.child(c),u,r+1,o):u.nodesBetween(0,u.content.size,o,r+1),r+=u.nodeSize}}(e.doc,t.doc,0,r):t.doc.descendants(r),n}function Ya(t){var e,n=t.selection,r=ga(t),o=r.node(-1),i=r.start(-1),s=ca.get(o);return(e=n instanceof Ma?s.rectBetween(n.$anchorCell.pos-i,n.$headCell.pos-i):s.findCell(r.pos-i)).tableStart=i,e.map=s,e.table=o,e}function Xa(t,e,n){var r=e.map,o=e.tableStart,i=e.table,s=n>0?-1:0;Ea(r,i,n+s)&&(s=0==n||n==r.width?null:0);for(var a=0;a<r.height;a++){var c=a*r.width+n;if(n>0&&n<r.width&&r.map[c-1]==r.map[c]){var u=r.map[c],l=i.nodeAt(u);t.setNodeMarkup(t.mapping.map(o+u),null,Ta(l.attrs,n-r.colCount(u))),a+=l.attrs.rowspan-1}else{var d=null==s?fa(i.type.schema).cell:i.nodeAt(r.map[c+s]).type,p=r.positionAt(a,n,i);t.insert(t.mapping.map(o+p),d.createAndFill())}}return t}function Za(t,e){if(!va(t))return!1;if(e){var n=Ya(t);e(Xa(t.tr,n,n.left))}return!0}function Qa(t,e){if(!va(t))return!1;if(e){var n=Ya(t);e(Xa(t.tr,n,n.right))}return!0}function tc(t,e,n){for(var r=e.map,o=e.table,i=e.tableStart,s=t.mapping.maps.length,a=0;a<r.height;){var c=a*r.width+n,u=r.map[c],l=o.nodeAt(u);if(n>0&&r.map[c-1]==u||n<r.width-1&&r.map[c+1]==u)t.setNodeMarkup(t.mapping.slice(s).map(i+u),null,Sa(l.attrs,n-r.colCount(u)));else{var d=t.mapping.slice(s).map(i+u);t.delete(d,d+l.nodeSize)}a+=l.attrs.rowspan}}function ec(t,e){if(!va(t))return!1;if(e){var n=Ya(t),r=t.tr;if(0==n.left&&n.right==n.map.width)return!1;for(var o=n.right-1;tc(r,n,o),o!=n.left;o--)n.table=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc,n.map=ca.get(n.table);e(r)}return!0}function nc(t,e,n){for(var r=fa(e.type.schema).header_cell,o=0;o<t.width;o++)if(e.nodeAt(t.map[o+n*t.width]).type!=r)return!1;return!0}function rc(t,e,n){for(var r=e.map,o=e.tableStart,i=e.table,s=o,a=0;a<n;a++)s+=i.child(a).nodeSize;var c=[],u=n>0?-1:0;nc(r,i,n+u)&&(u=0==n||n==r.height?null:0);for(var l=0,d=r.width*n;l<r.width;l++,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;t.setNodeMarkup(o+p,null,Ca(f,"rowspan",f.rowspan+1)),l+=f.colspan-1}else{var h=null==u?fa(i.type.schema).cell:i.nodeAt(r.map[d+u*r.width]).type;c.push(h.createAndFill())}return t.insert(s,fa(i.type.schema).row.create(null,c)),t}function oc(t,e){if(!va(t))return!1;if(e){var n=Ya(t);e(rc(t.tr,n,n.top))}return!0}function ic(t,e){if(!va(t))return!1;if(e){var n=Ya(t);e(rc(t.tr,n,n.bottom))}return!0}function sc(t,e,n){for(var r=e.map,o=e.table,i=e.tableStart,s=0,a=0;a<n;a++)s+=o.child(a).nodeSize;var c=s+o.child(n).nodeSize,u=t.mapping.maps.length;t.delete(s+i,c+i);for(var l=0,d=n*r.width;l<r.width;l++,d++){var p=r.map[d];if(n>0&&p==r.map[d-r.width]){var f=o.nodeAt(p).attrs;t.setNodeMarkup(t.mapping.slice(u).map(p+i),null,Ca(f,"rowspan",f.rowspan-1)),l+=f.colspan-1}else if(n<r.width&&p==r.map[d+r.width]){var h=o.nodeAt(p),m=h.type.create(Ca(h.attrs,"rowspan",h.attrs.rowspan-1),h.content),v=r.positionAt(n+1,l,o);t.insert(t.mapping.slice(u).map(i+v),m),l+=h.attrs.colspan-1}}}function ac(t,e){if(!va(t))return!1;if(e){var n=Ya(t),r=t.tr;if(0==n.top&&n.bottom==n.map.height)return!1;for(var o=n.bottom-1;sc(r,n,o),o!=n.top;o--)n.table=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc,n.map=ca.get(n.table);e(r)}return!0}function cc(t){var e=t.content;return 1==e.childCount&&e.firstChild.isTextblock&&0==e.firstChild.childCount}function uc(t,e){var n=t.selection;if(!(n instanceof Ma)||n.$anchorCell.pos==n.$headCell.pos)return!1;var r=Ya(t),o=r.map;if(function(t,e){for(var n=t.width,r=t.height,o=t.map,i=e.top*n+e.left,s=i,a=(e.bottom-1)*n+e.left,c=i+(e.right-e.left-1),u=e.top;u<e.bottom;u++){if(e.left>0&&o[s]==o[s-1]||e.right<n&&o[c]==o[c+1])return!0;s+=n,c+=n}for(var l=e.left;l<e.right;l++){if(e.top>0&&o[i]==o[i-n]||e.bottom<r&&o[a]==o[a+n])return!0;i++,a++}return!1}(o,r))return!1;if(e){for(var s,a,c=t.tr,u={},l=i.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(!u[f])if(u[f]=!0,null==s)s=f,a=h;else{cc(h)||(l=l.append(h.content));var m=c.mapping.map(f+r.tableStart);c.delete(m,m+h.nodeSize)}}if(c.setNodeMarkup(s+r.tableStart,null,Ca(Ta(a.attrs,a.attrs.colspan,r.right-r.left-a.attrs.colspan),"rowspan",r.bottom-r.top)),l.size){var v=s+1+a.content.size,g=cc(a)?s+1:v;c.replaceWith(g+r.tableStart,v+r.tableStart,l)}c.setSelection(new Ma(c.doc.resolve(s+r.tableStart))),e(c)}return!0}function lc(t,e){var n=fa(t.schema);return dc((function(t){var e=t.node;return n[e.type.spec.tableRole]}))(t,e)}function dc(t){return function(e,n){var r,o,i=e.selection;if(i instanceof Ma){if(i.$anchorCell.pos!=i.$headCell.pos)return!1;r=i.$anchorCell.nodeAfter,o=i.$anchorCell.pos}else{if(!(r=function(t){for(var e=t.depth;e>0;e--){var n=t.node(e).type.spec.tableRole;if("cell"===n||"header_cell"===n)return t.node(e)}return null}(i.$from)))return!1;o=ma(i.$from).pos}if(1==r.attrs.colspan&&1==r.attrs.rowspan)return!1;if(n){var s=r.attrs,a=[],c=s.colwidth;s.rowspan>1&&(s=Ca(s,"rowspan",1)),s.colspan>1&&(s=Ca(s,"colspan",1));for(var u,l=Ya(e),d=e.tr,p=0;p<l.right-l.left;p++)a.push(c?Ca(s,"colwidth",c&&c[p]?[c[p]]:null):s);for(var f=l.top;f<l.bottom;f++){var h=l.map.positionAt(f,l.left,l.table);f==l.top&&(h+=r.nodeSize);for(var m=l.left,v=0;m<l.right;m++,v++)m==l.left&&f==l.top||d.insert(u=d.mapping.map(h+l.tableStart,1),t({node:r,row:f,col:m}).createAndFill(a[v]))}d.setNodeMarkup(o,t({node:r,row:l.top,col:l.left}),a[0]),i instanceof Ma&&d.setSelection(new Ma(d.doc.resolve(i.$anchorCell.pos),u&&d.doc.resolve(u))),n(d)}return!0}}function pc(t,e){return function(n,r){if(!va(n))return!1;var o=ga(n);if(o.nodeAfter.attrs[t]===e)return!1;if(r){var i=n.tr;n.selection instanceof Ma?n.selection.forEachCell((function(n,r){n.attrs[t]!==e&&i.setNodeMarkup(r,null,Ca(n.attrs,t,e))})):i.setNodeMarkup(o.pos,null,Ca(o.nodeAfter.attrs,t,e)),r(i)}return!0}}function fc(t,e,n){for(var r=e.map.cellsInRect({left:0,top:0,right:"row"==t?e.map.width:1,bottom:"column"==t?e.map.height:1}),o=0;o<r.length;o++){var i=e.table.nodeAt(r[o]);if(i&&i.type!==n.header_cell)return!1}return!0}function hc(t,e){return(e=e||{useDeprecatedLogic:!1}).useDeprecatedLogic?function(t){return function(e,n){if(!va(e))return!1;if(n){for(var r=fa(e.schema),o=Ya(e),i=e.tr,s=o.map.cellsInRect("column"==t?new aa(o.left,0,o.right,o.map.height):"row"==t?new aa(0,o.top,o.map.width,o.bottom):o),a=s.map((function(t){return o.table.nodeAt(t)})),c=0;c<s.length;c++)a[c].type==r.header_cell&&i.setNodeMarkup(o.tableStart+s[c],r.cell,a[c].attrs);if(0==i.steps.length)for(var u=0;u<s.length;u++)i.setNodeMarkup(o.tableStart+s[u],r.header_cell,a[u].attrs);n(i)}return!0}}(t):function(e,n){if(!va(e))return!1;if(n){var r=fa(e.schema),o=Ya(e),i=e.tr,s=fc("row",o,r),a=fc("column",o,r),c=("column"===t?s:"row"===t&&a)?1:0,u="column"==t?new aa(0,c,1,o.map.height):"row"==t?new aa(c,0,o.map.width,1):o,l="column"==t?a?r.cell:r.header_cell:"row"==t?s?r.cell:r.header_cell:r.cell;o.map.cellsInRect(u).forEach((function(t){var e=t+o.tableStart,n=i.doc.nodeAt(e);n&&i.setNodeMarkup(e,l,n.attrs)})),n(i)}return!0}}var mc=hc("row",{useDeprecatedLogic:!0}),vc=hc("column",{useDeprecatedLogic:!0}),gc=hc("cell",{useDeprecatedLogic:!0});function yc(t){return function(e,n){if(!va(e))return!1;var r=function(t,e){if(e<0){var n=t.nodeBefore;if(n)return t.pos-n.nodeSize;for(var r=t.index(-1)-1,o=t.before();r>=0;r--){var i=t.node(-1).child(r);if(i.childCount)return o-1-i.lastChild.nodeSize;o-=i.nodeSize}}else{if(t.index()<t.parent.childCount-1)return t.pos+t.nodeAfter.nodeSize;for(var s=t.node(-1),a=t.indexAfter(-1),c=t.after();a<s.childCount;a++){var u=s.child(a);if(u.childCount)return c+1;c+=u.nodeSize}}}(ga(e),t);if(null!=r){if(n){var o=e.doc.resolve(r);n(e.tr.setSelection(re.between(o,ba(o))).scrollIntoView())}return!0}}}function bc(t,e){for(var n=t.selection.$anchor,r=n.depth;r>0;r--){if("table"==n.node(r).type.spec.tableRole)return e&&e(t.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0}return!1}var wc=function(t,e){this.node=t,this.cellMinWidth=e,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")),_c(t,this.colgroup,this.table,e),this.contentDOM=this.table.appendChild(document.createElement("tbody"))};function _c(t,e,n,r,o,i){for(var s=0,a=!0,c=e.firstChild,u=t.firstChild,l=0,d=0;l<u.childCount;l++)for(var p=u.child(l).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),c?(c.style.width!=g&&(c.style.width=g),c=c.nextSibling):e.appendChild(document.createElement("col")).style.width=g}for(;c;){var y=c.nextSibling;c.parentNode.removeChild(c),c=y}a?(n.style.width=s+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=s+"px")}wc.prototype.update=function(t){return t.type==this.node.type&&(this.node=t,_c(t,this.colgroup,this.table,this.cellMinWidth),!0)},wc.prototype.ignoreMutation=function(t){return"attributes"==t.type&&(t.target==this.table||this.colgroup.contains(t.target))};var xc=new xe("tableColumnResizing");function kc(t){void 0===t&&(t={});var e=t.handleWidth;void 0===e&&(e=5);var n=t.cellMinWidth;void 0===n&&(n=25);var r=t.View;void 0===r&&(r=wc);var o=t.lastColumnResizable;return void 0===o&&(o=!0),new be({key:xc,state:{init:function(t,e){return this.spec.props.nodeViews[fa(e.schema).table.name]=function(t,e){return new r(t,n,e)},new Cc(-1,!1)},apply:function(t,e){return e.apply(t)}},props:{attributes:function(t){return xc.getState(t).activeHandle>-1?{class:"resize-cursor"}:null},handleDOMEvents:{mousemove:function(t,n){!function(t,e,n,r,o){var i=xc.getState(t.state);if(!i.dragging){var s=function(t){for(;t&&"TD"!=t.nodeName&&"TH"!=t.nodeName;)t=t.classList.contains("ProseMirror")?null:t.parentNode;return t}(e.target),a=-1;if(s){var c=s.getBoundingClientRect(),u=c.left,l=c.right;e.clientX-u<=n?a=Sc(t,e,"left"):l-e.clientX<=n&&(a=Sc(t,e,"right"))}if(a!=i.activeHandle){if(!o&&-1!==a){var d=t.state.doc.resolve(a),p=d.node(-1),f=ca.get(p),h=d.start(-1);if(f.colCount(d.pos-h)+d.nodeAfter.attrs.colspan-1==f.width-1)return}Ec(t,a)}}}(t,n,e,0,o)},mouseleave:function(t){!function(t){var e=xc.getState(t.state);e.activeHandle>-1&&!e.dragging&&Ec(t,-1)}(t)},mousedown:function(t,e){!function(t,e,n){var r=xc.getState(t.state);if(-1==r.activeHandle||r.dragging)return!1;var o=t.state.doc.nodeAt(r.activeHandle),i=function(t,e,n){var r=n.colspan,o=n.colwidth,i=o&&o[o.length-1];if(i)return i;var s=t.domAtPos(e),a=s.node.childNodes[s.offset].offsetWidth,c=r;if(o)for(var u=0;u<r;u++)o[u]&&(a-=o[u],c--);return a/c}(t,r.activeHandle,o.attrs);function s(e){window.removeEventListener("mouseup",s),window.removeEventListener("mousemove",a);var r=xc.getState(t.state);r.dragging&&(!function(t,e,n){for(var r=t.state.doc.resolve(e),o=r.node(-1),i=ca.get(o),s=r.start(-1),a=i.colCount(r.pos-s)+r.nodeAfter.attrs.colspan-1,c=t.state.tr,u=0;u<i.height;u++){var l=u*i.width+a;if(!u||i.map[l]!=i.map[l-i.width]){var d=i.map[l],p=o.nodeAt(d).attrs,f=1==p.colspan?0:a-i.colCount(d);if(!p.colwidth||p.colwidth[f]!=n){var h=p.colwidth?p.colwidth.slice():Mc(p.colspan);h[f]=n,c.setNodeMarkup(s+d,null,Ca(p,"colwidth",h))}}}c.docChanged&&t.dispatch(c)}(t,r.activeHandle,Tc(r.dragging,e,n)),t.dispatch(t.state.tr.setMeta(xc,{setDragging:null})))}function a(e){if(!e.which)return s(e);var r=xc.getState(t.state),o=Tc(r.dragging,e,n);!function(t,e,n,r){var o=t.state.doc.resolve(e),i=o.node(-1),s=o.start(-1),a=ca.get(i).colCount(o.pos-s)+o.nodeAfter.attrs.colspan-1,c=t.domAtPos(o.start(-1)).node;for(;"TABLE"!=c.nodeName;)c=c.parentNode;_c(i,c.firstChild,c,r,a,n)}(t,r.activeHandle,o,n)}t.dispatch(t.state.tr.setMeta(xc,{setDragging:{startX:e.clientX,startWidth:i}})),window.addEventListener("mouseup",s),window.addEventListener("mousemove",a),e.preventDefault()}(t,e,n)}},decorations:function(t){var e=xc.getState(t);if(e.activeHandle>-1)return function(t,e){for(var n=[],r=t.doc.resolve(e),o=r.node(-1),i=ca.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 l=i.map[u],d=s+l+o.nodeAt(l).nodeSize-1,p=document.createElement("div");p.className="column-resize-handle",n.push(Bs.widget(d,p))}}return Fs.create(t.doc,n)}(t,e.activeHandle)},nodeViews:{}}})}var Cc=function(t,e){this.activeHandle=t,this.dragging=e};function Sc(t,e,n){var r=t.posAtCoords({left:e.clientX,top:e.clientY});if(!r)return-1;var o=r.pos,i=ma(t.state.doc.resolve(o));if(!i)return-1;if("right"==n)return i.pos;var s=ca.get(i.node(-1)),a=i.start(-1),c=s.map.indexOf(i.pos-a);return c%s.width==0?-1:a+s.map[c-1]}function Tc(t,e,n){var r=e.clientX-t.startX;return Math.max(n,t.startWidth+r)}function Ec(t,e){t.dispatch(t.state.tr.setMeta(xc,{setHandle:e}))}function Mc(t){for(var e=[],n=0;n<t;n++)e.push(0);return e}function Oc(t){void 0===t&&(t={});var e=t.allowTableNodeSelection;return void 0===e&&(e=!1),new be({key:ha,state:{init:function(){return null},apply:function(t,e){var n=t.getMeta(ha);if(null!=n)return-1==n?null:n;if(null==e||!t.docChanged)return e;var r=t.mapping.mapResult(e),o=r.deleted,i=r.pos;return o?null:i}},props:{decorations:Da,handleDOMEvents:{mousedown:Ha},createSelectionBetween:function(t){if(null!=ha.getState(t.state))return t.state.selection},handleTripleClick:$a,handleKeyDown:Ra,handlePaste:Wa},appendTransaction:function(t,n,r){return function(t,e,n){var r,o,i=(e||t).selection,s=(e||t).doc;if(i instanceof ie&&(o=i.node.type.spec.tableRole)){if("cell"==o||"header_cell"==o)r=Ma.create(s,i.from);else if("row"==o){var a=s.resolve(i.from+1);r=Ma.rowSelection(a,a)}else if(!n){var c=ca.get(i.node),u=i.from+1,l=u+c.map[c.width*c.height-1];r=Ma.create(s,u+1,l)}}else i instanceof re&&function(t){var e=t.$from,n=t.$to;if(e.pos==n.pos||e.pos<e.pos-6)return!1;for(var r=e.pos,o=n.pos,i=e.depth;i>=0&&!(e.after(i+1)<e.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(e.node(i).type.spec.tableRole)}(i)?r=re.create(s,i.from):i instanceof re&&function(t){for(var e,n,r=t.$from,o=t.$to,i=r.depth;i>0;i--){var s=r.node(i);if("cell"===s.type.spec.tableRole||"header_cell"===s.type.spec.tableRole){e=s;break}}for(var a=o.depth;a>0;a--){var c=o.node(a);if("cell"===c.type.spec.tableRole||"header_cell"===c.type.spec.tableRole){n=c;break}}return e!==n&&0===o.parentOffset}(i)&&(r=re.create(s,i.$from.start(),i.$from.end()));return r&&(e||(e=t.tr)).setSelection(r),e}(r,Ga(r,n),e)}})}Cc.prototype.apply=function(t){var e=this,n=t.getMeta(xc);if(n&&null!=n.setHandle)return new Cc(n.setHandle,null);if(n&&void 0!==n.setDragging)return new Cc(e.activeHandle,n.setDragging);if(e.activeHandle>-1&&t.docChanged){var r=t.mapping.map(e.activeHandle,-1);ya(t.doc.resolve(r))||(r=null),e=new Cc(r,e.dragging)}return e};var Dc=["blockquote",0],Ic=["hr"],Ac=["pre",["code",0]],Nc=["ol",0],Bc=["ul",0],zc=["li",0],Pc=function(t){for(var e,n={},r=t.attributes,o=0;o<r.length;o++)n[(e=r[o]).name]=e.value;return n},Rc=function(t){var e={};return t.forEach((function(t){e[t]={default:null}})),e},Fc=function(){return Rc(["style","class","id"])},Lc=function(t,e){for(var n in t)if(n&&null!==t[n]&&n!==e)return!0;return!1},Vc=function(t,e){var n={};for(var r in t)r&&null!==t[r]&&r!==e&&(n[r]=t[r]);return n},jc=function(t){var e;return(e={})[t]={name:t,inclusive:!0,parseDOM:[{tag:t}],toDOM:function(){return[t,0]}},e},$c=Be.__assign({link:{attrs:Be.__assign({},Fc(),{href:{default:null},target:{default:null},title:{default:null}}),inclusive:!1,parseDOM:[{tag:"a",getAttrs:Pc}],toDOM:function(t){return["a",Vc(t.attrs),0]}}},jc("strong"),jc("b"),jc("em"),jc("i"),jc("u"),jc("del"),jc("sub"),jc("sup"),jc("code"),{style:{attrs:Be.__assign({},Fc()),parseDOM:[{tag:"span",getAttrs:Pc}],toDOM:function(t){return Lc(t.attrs)?["span",Vc(t.attrs),0]:["span",0]}}}),Wc=function(t){var e;return(e={})[t]={default:null,getFromDOM:function(e){return e.getAttribute(t)},setDOMAttr:function(e,n){n[t]=e}},e},Hc=Be.__assign({},Wc("style"),Wc("class"),Wc("id"),Wc("headers")),qc={doc:{content:"colgroup*"},col:{attrs:Rc(["id","class","style","span"]),parseDOM:[{getAttrs:Pc,tag:"col"}],toDOM:function(t){return["col",t.attrs]}},colgroup:{attrs:Rc(["id","class","style","span"]),content:"col*",parseDOM:[{getAttrs:Pc,tag:"colgroup"}],toDOM:function(t){return["colgroup",t.attrs,0]}},text:{inline:!0,group:"inline"}},Jc=new Z({nodes:qc,marks:{}}),Kc=pa({tableGroup:"block",cellContent:"block+",cellAttributes:Hc});Kc.table_row.attrs=Be.__assign({},Kc.table_row.attrs,Rc([ke,"style","class","id"])),Kc.table_row.toDOM=function(t){return["tr",Vc(t.attrs),0]},Kc.table_row.parseDOM=[{tag:"tr",getAttrs:Pc}],Kc.table.attrs=Be.__assign({},Kc.table.attrs,Rc(["style","class","id","k-colgroup-data"])),Kc.table.toDOM=function(t){var e=Lc(t.attrs)?Vc(t.attrs,"k-colgroup-data"):{},n=null;if(t.attrs["k-colgroup-data"]&&!function(t){for(var e=!1,n=t.child(0),r=0;r<n.childCount;r++){if(n.child(r).attrs.colwidth){e=!0;break}}return e}(t)){var r=De(Me(t.attrs["k-colgroup-data"]),Jc,{preserveWhitespace:!1}),o=Oe(r).firstChild;if(o){var i=Array.from(o.children).map((function(t){return["col",Pc(t)]}));n=["colgroup",Pc(o)].concat(i)}}return n?["table",e,n,["tbody",0]]:["table",e,["tbody",0]]},Kc.table.parseDOM=[{tag:"table",getAttrs:function(t){var e=Pc(t),n=Array.from(t.childNodes).find((function(t){return"COLGROUP"===t.nodeName}));return n&&(e["k-colgroup-data"]=n.outerHTML),e}}];var Uc=Be.__assign({doc:{content:"block+"},paragraph:{content:"inline*",group:"block",attrs:Be.__assign({},Fc()),parseDOM:[{tag:"p",getAttrs:Pc}],toDOM:function(t){return Lc(t.attrs)?["p",Vc(t.attrs),0]:["p",0]}},div:{content:"block*",group:"block",attrs:Be.__assign({},Fc()),parseDOM:[{tag:"div",getAttrs:Pc}],toDOM:function(t){return Lc(t.attrs)?["div",Vc(t.attrs),0]:["div",0]}},blockquote:{attrs:Be.__assign({},Fc()),content:"block+",group:"block",defining:!0,parseDOM:[{tag:"blockquote",getAttrs:Pc}],toDOM:function(t){return Lc(t.attrs)?["blockquote",Vc(t.attrs),0]:Dc}},horizontal_rule:{group:"block",parseDOM:[{tag:"hr"}],toDOM:function(){return Ic}},heading:{attrs:Be.__assign({},Fc(),{level:{default:1}}),content:"inline*",group:"block",defining:!0,parseDOM:[{tag:"h1",getAttrs:function(t){return Be.__assign({},Pc(t),{level:1})}},{tag:"h2",getAttrs:function(t){return Be.__assign({},Pc(t),{level:2})}},{tag:"h3",getAttrs:function(t){return Be.__assign({},Pc(t),{level:3})}},{tag:"h4",getAttrs:function(t){return Be.__assign({},Pc(t),{level:4})}},{tag:"h5",getAttrs:function(t){return Be.__assign({},Pc(t),{level:5})}},{tag:"h6",getAttrs:function(t){return Be.__assign({},Pc(t),{level:6})}}],toDOM:function(t){return Lc(t.attrs,"level")?["h"+t.attrs.level,Vc(t.attrs,"level"),0]:["h"+t.attrs.level,0]}},code_block:{content:"text*",marks:"",group:"block",code:!0,defining:!0,parseDOM:[{tag:"pre",preserveWhitespace:"full"}],toDOM:function(){return Ac}},text:{inline:!0,group:"inline"},image:{inline:!0,attrs:Be.__assign({src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}},Fc()),group:"inline",draggable:!0,parseDOM:[{tag:"img",getAttrs:Pc}],toDOM:function(t){return Lc(t.attrs)?["img",Vc(t.attrs)]:["img"]}},hard_break:{inline:!0,attrs:Be.__assign({},Fc()),group:"inline",selectable:!1,parseDOM:[{tag:"br",getAttrs:Pc}],toDOM:function(t){return Lc(t.attrs)?["br",Vc(t.attrs)]:["br"]}},ordered_list:{content:"list_item+",group:"block",attrs:Be.__assign({},Fc(),{type:{default:null},order:{default:1}}),parseDOM:[{tag:"ol",getAttrs:function(t){return Be.__assign({},Pc(t),{order:t.hasAttribute("start")?parseInt(t.getAttribute("start")||"1",10):1})}}],toDOM:function(t){return 1===t.attrs.order?Lc(t.attrs,"order")?["ol",Vc(t.attrs,"order"),0]:Nc:["ol",Be.__assign({},Vc(t.attrs,"order"),{start:t.attrs.order}),0]}},bullet_list:{content:"list_item+",group:"block",attrs:Be.__assign({},Fc()),parseDOM:[{tag:"ul",getAttrs:Pc}],toDOM:function(t){return Lc(t.attrs)?["ul",Vc(t.attrs),0]:Bc}},list_item:{content:"(paragraph | heading) block*",attrs:Be.__assign({},Fc()),parseDOM:[{tag:"li",getAttrs:Pc}],toDOM:function(t){return Lc(t.attrs)?["li",Vc(t.attrs),0]:zc},defining:!0}},Kc),Gc=function(){};Gc.prototype.append=function(t){return t.length?(t=Gc.from(t),!this.length&&t||t.length<200&&this.leafAppend(t)||this.length<200&&t.leafPrepend(this)||this.appendInner(t)):this},Gc.prototype.prepend=function(t){return t.length?Gc.from(t).append(this):this},Gc.prototype.appendInner=function(t){return new Xc(this,t)},Gc.prototype.slice=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.length),t>=e?Gc.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,e))},Gc.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)},Gc.prototype.forEach=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=this.length),e<=n?this.forEachInner(t,e,n,0):this.forEachInvertedInner(t,e,n,0)},Gc.prototype.map=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=this.length);var r=[];return this.forEach((function(e,n){return r.push(t(e,n))}),e,n),r},Gc.from=function(t){return t instanceof Gc?t:t&&t.length?new Yc(t):Gc.empty};var Yc=function(t){function e(e){t.call(this),this.values=e}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(t,n){return 0==t&&n==this.length?this:new e(this.values.slice(t,n))},e.prototype.getInner=function(t){return this.values[t]},e.prototype.forEachInner=function(t,e,n,r){for(var o=e;o<n;o++)if(!1===t(this.values[o],r+o))return!1},e.prototype.forEachInvertedInner=function(t,e,n,r){for(var o=e-1;o>=n;o--)if(!1===t(this.values[o],r+o))return!1},e.prototype.leafAppend=function(t){if(this.length+t.length<=200)return new e(this.values.concat(t.flatten()))},e.prototype.leafPrepend=function(t){if(this.length+t.length<=200)return new e(t.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(Gc);Gc.empty=new Yc([]);var Xc=function(t){function e(e,n){t.call(this),this.left=e,this.right=n,this.length=e.length+n.length,this.depth=Math.max(e.depth,n.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(t){return t<this.left.length?this.left.get(t):this.right.get(t-this.left.length)},e.prototype.forEachInner=function(t,e,n,r){var o=this.left.length;return!(e<o&&!1===this.left.forEachInner(t,e,Math.min(n,o),r))&&(!(n>o&&!1===this.right.forEachInner(t,Math.max(e-o,0),Math.min(this.length,n)-o,r+o))&&void 0)},e.prototype.forEachInvertedInner=function(t,e,n,r){var o=this.left.length;return!(e>o&&!1===this.right.forEachInvertedInner(t,e-o,Math.max(n,o)-o,r+o))&&(!(n<o&&!1===this.left.forEachInvertedInner(t,Math.min(e,o),n,r))&&void 0)},e.prototype.sliceInner=function(t,e){if(0==t&&e==this.length)return this;var n=this.left.length;return e<=n?this.left.slice(t,e):t>=n?this.right.slice(t-n,e-n):this.left.slice(t,n).append(this.right.slice(0,e-n))},e.prototype.leafAppend=function(t){var n=this.right.leafAppend(t);if(n)return new e(this.left,n)},e.prototype.leafPrepend=function(t){var n=this.left.leafPrepend(t);if(n)return new e(n,this.right)},e.prototype.appendInner=function(t){return this.left.depth>=Math.max(this.right.depth,t.depth)+1?new e(this.left,new e(this.right,t)):new e(this,t)},e}(Gc),Zc=Gc,Qc=function(t,e){this.items=t,this.eventCount=e};Qc.prototype.popEvent=function(t,e){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}}e&&(r=this.remapping(i,this.items.length),o=r.maps.length);var s,a,c=t.tr,u=[],l=[];return this.items.forEach((function(t,e){if(!t.step)return r||(r=n.remapping(i,e+1),o=r.maps.length),o--,void l.push(t);if(r){l.push(new tu(t.map));var d,p=t.step.map(r.slice(o));p&&c.maybeStep(p).doc&&(d=c.mapping.maps[c.mapping.maps.length-1],u.push(new tu(d,null,null,u.length+l.length))),o--,d&&r.appendMap(d,o)}else c.maybeStep(t.step);return t.selection?(s=r?t.selection.map(r.slice(o)):t.selection,a=new Qc(n.items.slice(0,i).append(l.reverse().concat(u)),n.eventCount-1),!1):void 0}),this.items.length,0),{remaining:a,transform:c,selection:s}},Qc.prototype.addTransform=function(t,e,n,r){for(var o=[],i=this.eventCount,s=this.items,a=!r&&s.length?s.get(s.length-1):null,c=0;c<t.steps.length;c++){var u,l=t.steps[c].invert(t.docs[c]),d=new tu(t.mapping.maps[c],l,e);(u=a&&a.merge(d))&&(d=u,c?o.pop():s=s.slice(0,s.length-1)),o.push(d),e&&(i++,e=null),r||(a=d)}var p,f,h,m=i-n.depth;return m>nu&&(f=m,(p=s).forEach((function(t,e){if(t.selection&&0==f--)return h=e,!1})),s=p.slice(h),i-=m),new Qc(s.append(o),i)},Qc.prototype.remapping=function(t,e){var n=new yt;return this.items.forEach((function(e,r){var o=null!=e.mirrorOffset&&r-e.mirrorOffset>=t?n.maps.length-e.mirrorOffset:null;n.appendMap(e.map,o)}),t,e),n},Qc.prototype.addMaps=function(t){return 0==this.eventCount?this:new Qc(this.items.append(t.map((function(t){return new tu(t)}))),this.eventCount)},Qc.prototype.rebased=function(t,e){if(!this.eventCount)return this;var n=[],r=Math.max(0,this.items.length-e),o=t.mapping,i=t.steps.length,s=this.eventCount;this.items.forEach((function(t){t.selection&&s--}),r);var a=e;this.items.forEach((function(e){var r=o.getMirror(--a);if(null!=r){i=Math.min(i,r);var c=o.maps[r];if(e.step){var u=t.steps[r].invert(t.docs[r]),l=e.selection&&e.selection.map(o.slice(a+1,r));l&&s++,n.push(new tu(c,u,l))}else n.push(new tu(c))}}),r);for(var c=[],u=e;u<i;u++)c.push(new tu(o.maps[u]));var l=this.items.slice(0,r).append(c).append(n),d=new Qc(l,s);return d.emptyItemCount()>500&&(d=d.compress(this.items.length-n.length)),d},Qc.prototype.emptyItemCount=function(){var t=0;return this.items.forEach((function(e){e.step||t++})),t},Qc.prototype.compress=function(t){void 0===t&&(t=this.items.length);var e=this.remapping(0,t),n=e.maps.length,r=[],o=0;return this.items.forEach((function(i,s){if(s>=t)r.push(i),i.selection&&o++;else if(i.step){var a=i.step.map(e.slice(n)),c=a&&a.getMap();if(n--,c&&e.appendMap(c,n),a){var u=i.selection&&i.selection.map(e.slice(n));u&&o++;var l,d=new tu(c.invert(),a,u),p=r.length-1;(l=r.length&&r[p].merge(d))?r[p]=l:r.push(d)}}else i.map&&n--}),this.items.length,0),new Qc(Zc.from(r.reverse()),o)},Qc.empty=new Qc(Zc.empty,0);var tu=function(t,e,n,r){this.map=t,this.step=e,this.selection=n,this.mirrorOffset=r};tu.prototype.merge=function(t){if(this.step&&t.step&&!t.selection){var e=t.step.merge(this.step);if(e)return new tu(e.getMap().invert(),e,this.selection)}};var eu=function(t,e,n,r){this.done=t,this.undone=e,this.prevRanges=n,this.prevTime=r},nu=20;function ru(t){var e=[];return t.forEach((function(t,n,r,o){return e.push(r,o)})),e}function ou(t,e){if(!t)return null;for(var n=[],r=0;r<t.length;r+=2){var o=e.map(t[r],1),i=e.map(t[r+1],-1);o<=i&&n.push(o,i)}return n}function iu(t,e,n,r){var o=cu(e),i=lu.get(e).spec.config,s=(r?t.undone:t.done).popEvent(e,o);if(s){var a=s.selection.resolve(s.transform.doc),c=(r?t.done:t.undone).addTransform(s.transform,e.selection.getBookmark(),i,o),u=new eu(r?c:s.remaining,r?s.remaining:c,null,0);n(s.transform.setSelection(a).setMeta(lu,{redo:r,historyState:u}).scrollIntoView())}}var su=!1,au=null;function cu(t){var e=t.plugins;if(au!=e){su=!1,au=e;for(var n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){su=!0;break}}return su}function uu(t){return t.setMeta(du,!0)}var lu=new xe("history"),du=new xe("closeHistory");function pu(t){return t={depth:t&&t.depth||100,newGroupDelay:t&&t.newGroupDelay||500},new be({key:lu,state:{init:function(){return new eu(Qc.empty,Qc.empty,null,0)},apply:function(e,n,r){return function(t,e,n,r){var o,i=n.getMeta(lu);if(i)return i.historyState;n.getMeta(du)&&(t=new eu(t.done,t.undone,null,0));var s=n.getMeta("appendedTransaction");if(0==n.steps.length)return t;if(s&&s.getMeta(lu))return s.getMeta(lu).redo?new eu(t.done.addTransform(n,null,r,cu(e)),t.undone,ru(n.mapping.maps[n.steps.length-1]),t.prevTime):new eu(t.done,t.undone.addTransform(n,null,r,cu(e)),null,t.prevTime);if(!1===n.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))return(o=n.getMeta("rebased"))?new eu(t.done.rebased(n,o),t.undone.rebased(n,o),ou(t.prevRanges,n.mapping),t.prevTime):new eu(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),ou(t.prevRanges,n.mapping),t.prevTime);var a=0==t.prevTime||!s&&(t.prevTime<(n.time||0)-r.newGroupDelay||!function(t,e){if(!e)return!1;if(!t.docChanged)return!0;var n=!1;return t.mapping.maps[0].forEach((function(t,r){for(var o=0;o<e.length;o+=2)t<=e[o+1]&&r>=e[o]&&(n=!0)})),n}(n,t.prevRanges)),c=s?ou(t.prevRanges,n.mapping):ru(n.mapping.maps[n.steps.length-1]);return new eu(t.done.addTransform(n,a?e.selection.getBookmark():null,r,cu(e)),Qc.empty,c,n.time)}(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput:function(t,e){var n="historyUndo"==e.inputType?fu(t.state,t.dispatch):"historyRedo"==e.inputType&&hu(t.state,t.dispatch);return n&&e.preventDefault(),n}}}})}function fu(t,e){var n=lu.getState(t);return!(!n||0==n.done.eventCount)&&(e&&iu(n,t,e,!1),!0)}function hu(t,e){var n=lu.getState(t);return!(!n||0==n.undone.eventCount)&&(e&&iu(n,t,e,!0),!0)}function mu(t){var e=lu.getState(t);return e?e.done.eventCount:0}function vu(t){var e=lu.getState(t);return e?e.undone.eventCount:0}var gu=function(t,e){var n;this.match=t,this.handler="string"==typeof e?(n=e,function(t,e,r,o){var i=n;if(e[1]){var s=e[0].lastIndexOf(e[1]);i+=e[0].slice(s+e[1].length);var a=(r+=s)-o;a>0&&(i=e[0].slice(s-a,s)+i,r=o)}return t.tr.insertText(i,r,o)}):e};function yu(t){var e=t.rules,n=new be({state:{init:function(){return null},apply:function(t,e){var n=t.getMeta(this);return n||(t.selectionSet||t.docChanged?null:e)}},props:{handleTextInput:function(t,r,o,i){return bu(t,r,o,i,e,n)},handleDOMEvents:{compositionend:function(t){setTimeout((function(){var r=t.state.selection.$cursor;r&&bu(t,r.pos,r.pos,"",e,n)}))}}},isInputRules:!0});return n}function bu(t,e,n,r,o,i){if(t.composing)return!1;var s=t.state,a=s.doc.resolve(e);if(a.parent.type.spec.code)return!1;for(var c=a.parent.textBetween(Math.max(0,a.parentOffset-500),a.parentOffset,null,"")+r,u=0;u<o.length;u++){var l=o[u].match.exec(c),d=l&&o[u].handler(s,l,e-(l[0].length-r.length),n);if(d)return t.dispatch(d.setMeta(i,{transform:d,from:e,to:n,text:r})),!0}return!1}function wu(t,e){for(var n=t.plugins,r=0;r<n.length;r++){var o=n[r],i=void 0;if(o.spec.isInputRules&&(i=o.getState(t))){if(e){for(var s=t.tr,a=i.transform,c=a.steps.length-1;c>=0;c--)s.step(a.steps[c].invert(a.docs[c]));if(i.text){var u=s.doc.resolve(i.from).marks();s.replaceWith(i.from,i.to,t.schema.text(i.text,u))}else s.delete(i.from,i.to);e(s)}return!0}}return!1}var _u=new gu(/--$/,"—"),xu=new gu(/\.\.\.$/,"…"),ku=new gu(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,"“"),Cu=new gu(/"$/,"”"),Su=new gu(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,"‘"),Tu=new gu(/'$/,"’"),Eu=[ku,Cu,Su,Tu];function Mu(t,e,n,r){return new gu(t,(function(t,o,i,s){var a=n instanceof Function?n(o):n,c=t.tr.delete(i,s),u=c.doc.resolve(i).blockRange(),l=u&&It(u,e,a);if(!l)return null;c.wrap(u,l);var d=c.doc.resolve(i-1).nodeBefore;return d&&d.type==e&&Bt(c.doc,i-1)&&(!r||r(o,d))&&c.join(i-1),c}))}function Ou(t,e,n){return new gu(t,(function(t,r,o,i){var s=t.doc.resolve(o),a=n instanceof Function?n(r):n;return s.node(-1).canReplaceWith(s.index(-1),s.indexAfter(-1),e)?t.tr.delete(o,i).setBlockType(o,o,e,a):null}))}var Du={mark:"strong",altMarks:["b"],altStyle:{name:"font-weight",value:/^(bold(er)?|[5-9]\d{2,})$/}},Iu={mark:"em",altMarks:["i"],altStyle:{name:"font-style",value:/^italic$/i}},Au={mark:"u",altStyle:{name:"text-decoration",value:/^underline$/i}},Nu={mark:"del",altStyle:{name:"text-decoration",value:/^line-through$/i}},Bu={mark:"sub"},zu={mark:"sup"},Pu={mark:"link"},Ru="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),Fu=function(t,e){var n={},r=e&&e.applyToWord||!1;if(n["Mod-z"]=fu,n["Shift-Mod-z"]=hu,n.Backspace=yr(wu,Hn,qn,Kn),n.Enter=yr(er,or,ir,ar),Ru||(n["Mod-y"]=hu),t.marks.strong&&(n["Mod-b"]=Ke(un,Be.__assign({},Du,{applyToWord:r}))),t.marks.em&&(n["Mod-i"]=Ke(un,Be.__assign({},Iu,{applyToWord:r}))),t.marks.u&&(n["Mod-u"]=Ke(un,Be.__assign({},Au,{applyToWord:r}))),t.nodes.hard_break){var o=t.nodes.hard_break,i=yr(rr,(function(t,e){return e(t.tr.replaceSelectionWith(o.create()).scrollIntoView()),!0}));n["Shift-Enter"]=i}return n},Lu=function(t){var e,n={};return t.nodes.list_item&&(n.Enter=(e=t.nodes.list_item,function(t,n){return Pn(e)(t,(function(e){var r=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();r&&e.ensureMarks(r),n(e)}))})),n},Vu=/style=['"]?[^'"]*?mso-list:\s*[a-zA-Z]+(\d+)\s[a-zA-Z]+(\d+)\s(\w+)/gi,ju=function(t){return/^MsoListParagraph/.test(t.className)},$u=function(t){var e=t.innerHTML;return e=(e=e.replace(/<!--(.|\s)*?-->/gi,"")).replace(/<\/?[^>]+?\/?>/gm,"")},Wu=function(t,e){var n=document.createElement(t);return n.style.listStyleType=e,n},Hu=function(t){var e=null;return/^\d/.test(t)||(e=(/^[a-z]/.test(t)?"lower-":"upper-")+(/^[ivxlcdm]/i.test(t)?"roman":"alpha")),e},qu=function(t,e){var n=[];Array.from(t).forEach((function(t){if(t.nodeType===Node.ELEMENT_NODE){var r=t;r.getAttribute("datalist")?(n.push(t),e.add(n)):ju(r)&&n.length?n.push(t):(n=[],"DIV"===r.nodeName?qu(r.children,e):"TABLE"===r.nodeName&&Array.from(r.querySelectorAll("td,th")).forEach((function(t){qu(t.children,e)})))}}))},Ju=function(t){var e,n=t.innerHTML,r=function(t){return t.replace(/^(?:&nbsp;|[\u00a0\n\r\s])+/,"")};return n=n.replace(/<\/?\w+[^>]*>/g,"").replace(/&nbsp;/g," "),/^[\u2022\u00b7\u00a7\u00d8oØüvn][\u00a0 ]+/.test(n)?{tag:"ul",style:(e=r($u(t)),/^[\u2022\u00b7\u00FC\u00D8\u002dv-]/.test(e)?null:/^o/.test(e)?"circle":"square")}:/^\s*\w+[\.\)][\u00a0 ]{2,}/.test(n)?{tag:"ol",style:Hu(r($u(t)))}:void 0},Ku=function(t){var e,n=t.nodeName.toLowerCase();t.firstChild&&t.firstChild.nodeType===Node.COMMENT_NODE&&t.removeChild(t.firstChild),1===t.childNodes.length?e=t.firstChild.nodeType===Node.TEXT_NODE?$u(t):t.firstChild.innerHTML.replace(/^\w+[\.\)](&nbsp;)+ /,""):(t.removeChild(t.firstChild),3===t.firstChild.nodeType&&/^[ivxlcdm]+\.$/i.test(t.firstChild.nodeValue)&&t.removeChild(t.firstChild),/^(&nbsp;|\s)+$/i.test(t.firstChild.innerHTML)&&t.removeChild(t.firstChild),e="p"!==n?"<"+n+">"+t.innerHTML+"</"+n+">":t.innerHTML),t.parentNode.removeChild(t);var r=document.createElement("li");return r.innerHTML=e,r},Uu=function(t){var e=document.createElement("div");e.innerHTML=function(t){return t=t.replace(Vu,(function(t,e,n){return'datalist="'+e+'" datalevel="'+n+'" '+t}))}(t);var n=new Set;return qu(e.children,n),n.forEach((function(t){return function(t){var e,n,r,o,i,s,a,c,u,l,d,p,f,h=-1,m={};for(c=0;c<t.length;c++){var v=(f={datalist:(u=t[c]).getAttribute("datalist"),datalevel:u.getAttribute("datalevel")}).datalist,g=Ju(u);if(l=g&&g.tag){if(d=f.datalevel||parseFloat(u.style.marginLeft||0),f.datalevel||u.style.marginLeft){var y=l+v;m[d]||(m[d]={}),(!n||n<0)&&(n=d,r=v,o=(a=t.filter((function(t){return t.getAttribute("datalist")===String(r)})))[a.length-1],s=Wu(l,g&&g.style),u.parentNode.insertBefore(s,u),h=d,m[d][y]=s),i=o===u,p=m[d][y],(d>h||!p)&&(p=Wu(l,g&&g.style),m[d][y]=p,e.appendChild(p)),e=Ku(u),p.appendChild(e),i?n=h=-1:h=d}}else!e||i&&!ju(u)||(u.style.marginLeft&&(u.style.marginLeft=""),u.style.marginLeft&&(u.style.margin=""),e.appendChild(u))}}(t)})),e.innerHTML},Gu=function(t){return t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.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,"")},Yu=function(t){return t.replace(/<!--[\s\S]+?-->/g,"")},Xu=function(t,e){return t.replace(new RegExp("<\\/?("+e+")(?:\\s[^>]*?)?>","gi"),"")},Zu=function(t){t.ownerElement&&t.ownerElement.removeAttribute(t.name)},Qu=function(t){/^Mso/.test(t.value)&&Zu(t)},tl=/\s*;\s*/,el=/\s*:\s*/,nl=function(t){var e,n,r=t.value.split(tl).filter((function(t){return Boolean(t)})),o=t.ownerElement.style,i="";r.forEach((function(t){var r;r=t.split(el),e=r[0],n=r[1],void 0!==o[e]&&(i+=e+": "+n+"; ")})),(i=i.trim())?t.value=i:Zu(t)},rl=function(t,e){var n=t;if(e.convertMsLists&&(n=Uu(n)),e.stripTags&&(n=Xu(n,e.stripTags)),e.attributes){var r=document.createElement("div");r.innerHTML=n,Array.from(r.querySelectorAll("*")).forEach((function(t){return function(t,e){if(t.nodeType===Node.ELEMENT_NODE){for(var n=t.attributes.length-1;n>=0;n--){var r=t.attributes[n];e[r.name]?e[r.name](r):e["*"]&&e["*"](r)}"SPAN"===t.nodeName&&0===t.attributes.length&&function(t){var e=t.parentNode;if(e){for(;t.firstChild;)e.insertBefore(t.firstChild,t);e.removeChild(t)}}(t)}}(t,e.attributes)})),n=r.innerHTML}return n};function ol(t){for(var e=t.length,n=new Array(e/2),r=0;r<e;r+=2)n[r]=String.fromCharCode(parseInt(t.substring(r,r+2),16));return btoa(n.join(""))}var il=/<img\s[^>]*?src=(?:'|")file:\/[^'"]+(?:'|")[^>]*>/gi,sl=/{\\pict[\s\S]+?\\bliptag-?\d+(\\blipupi-?\d+)?({\\\*\\blipuid\s?[\da-fA-F]+)?[\s}]*?/,al=new RegExp("(?:("+sl.source+"))([\\da-fA-F\\s]+)\\}","g"),cl=/[^\da-fA-F]/g,ul=/file:\/[^'"]+\.(jpg|png|gif)/i,ll=/\\(png|jpeg)blip\\/,dl=function(t,e){var n=t.match(il);if(!n||-1===e.types.indexOf("text/rtf"))return t;var r=e.getData("text/rtf"),o=[],i=r.match(al);if(!r||!i)return t;for(var s=0,a=i;s<a.length;s++){var c=a[s],u=ll.exec(c);if(u){var l=c.replace(sl,"").replace(cl,"");o.push("data:image/"+u[1]+";base64,"+ol(l))}}return n.length!==o.length?t:t.replace(il,(function(t){var e=o.shift()||"";return t.replace(ul,e)}))},pl=function(t,e,n,r,o){var i,s,a,c,u,l,d=[],p=[],f=e.matchCase,h=e.matchWord,m=e.useRegExp,v=e.text;if(m&&(/^\\$/.test(v)||/[^\\]\\$/.test(v))&&(v=v.substring(0,v.length-1)),!v)return d;var g=f?"g":"gi",y=m?new RegExp(v,g):bl(v,g);return t.nodesBetween(n,r,(function(e,f,m){if(o(d))return!1;e.inlineContent&&f+e.content.size>=n&&(p.length=0,e.nodesBetween(0,e.content.size,(function(e,m,v,g){if(o(d))return!1;var b=1+f+m;if(e.isText&&b+e.nodeSize>=n){if(u=e.text||"",l=v.childCount-1>=g+1&&v.child(g+1),p.push(n<=b?{text:u,start:b}:{text:u.slice(n-b),start:n}),l&&l.isText)return;for(s=p.map((function(t){return t.text})).join(""),i=y.exec(s);null!==i&&(a=p[0].start+i.index,c=a+i[0].length,n<=a&&r>=c&&yl(i,h)&&d.push(re.create(t,a,c)),!o(d));)i=y.exec(s)}else p.length=0})))})),d},fl=function(t,e){var n=e.backward,r=e.matchCyclic,o=Be.__rest(e,["backward","matchCyclic"]),i=n?function(){return!1}:function(t){return t.length>0},s=t.doc,a=t.selection,c=[];return n?!(c=pl(s,o,0,a.from,i)).length&&r&&(c=pl(s,o,a.from,s.content.size,i)):!(c=pl(s,o,a.to,s.content.size,i)).length&&r&&(c=pl(s,o,0,a.to,i)),c.length?c[c.length-1]:null},hl=function(t,e){return pl(t,e,0,t.content.size,(function(){return!1}))},ml=function(t,e,n){var r=t.from,o=t.to;return n.insertText(e,r,o).setSelection(re.create(n.doc,r,r+e.length)),n},vl=function(t,e,n){var r=hl(t.doc,n);if(0===r.length)return null;for(var o=t.tr,i=r.length-1;i>=0;i--)o.insertText(e,r[i].from,r[i].to);return o},gl=/^[\s0-9~`!@#$%\^&*\(\)_\-=+\\|\[\]{};:'"\?/.,<>]?$/,yl=function(t,e){if(e){if(!0===e){var n=t.input,r=n.charAt(t.index-1),o=n.charAt(t.index+t[0].length);return gl.test(r)&&gl.test(o)}return e(t)}return!0},bl=function(t,e){var n=t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d").replace(/\s/g,"\\s");return new RegExp(n,e)};function wl(t){var e={class:"k-placeholder","data-placeholder":t};return new be({key:new xe("placeholder"),props:{decorations:function(t){var n=t.doc,r=n.content.firstChild;if(!(0===n.childCount||1===n.childCount&&r.inlineContent&&0===r.childCount))return Fs.empty;var o=[];return n.descendants((function(t,n){o.push(Bs.node(n,n+t.nodeSize,e))})),Fs.create(n,o)}}})}var _l=/\s+/g,xl=/text-align/,kl=function(){return new be({key:new xe("spaces-fix"),props:{decorations:function(t){var e,n,r,o,i=[],s=t.doc;return s.nodesBetween(0,s.content.size,(function(t,s,a){if(t.type.isText&&function(t){return xl.test(t&&t.attrs&&t.attrs.style||"")}(a))for(n=_l.exec(t.text||"");null!==n;){if(e=s+n.index,r=n[0].length,n.index+r<n.input.length)for(o=0;o<=r-1;o+=2)i.push(Bs.inline(e+o,e+o+1,{style:"white-space: normal"}));n=_l.exec(t.text||"")}})),Fs.create(s,i)}}})},Cl=new xe("highlight");function Sl(t){return void 0===t&&(t=Cl),new be({key:t,state:{init:function(){return null},apply:function(t){return t.getMeta(this.spec.key)}},props:{decorations:function(t){var e=(this.spec.key.getState(t)||[]).map((function(t){return Bs.inline(t.from,t.to,t.attrs)}));return Fs.create(t.doc,e)}}})}var Tl=new xe("image-resize"),El={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}},Ml=Object.keys(El),Ol=function(t,e,n){t.style[e]=n+"px"},Dl=/[^\-]width:|[^\-]height:/,Il=/^.+$/,Al=function(){function t(t,e,n,r){this.activeHandle=t,this.dragging=e,this.rect=n,this.nodePosition=r}return t.prototype.apply=function(e){var n=e.getMeta(Tl);return n?new t(n.activeHandle,n.setDragging,n.rect,n.nodePosition):this},t}(),Nl=function(t,e,n){var r=e.target.getAttribute("data-direction");if(!r)return!1;var o=Tl.getState(t.state);e.preventDefault();var i=t.state.tr;function s(e){!function(t,e,n){var r=Tl.getState(t.state),o=r.rect,i=r.dragging,s=r.nodePosition,a=r.activeHandle;if(i&&o){var c=t.nodeDOM(s),u=El[a],l=(e.clientX-i.startX)*u.x,d=(e.clientY-i.startY)*u.y,p=u.x?l+c.width:o.width,f=u.y?d+c.height:o.height;if(n.lockRatio&&u.x&&u.y){var h=Math.min(p/c.width,f/c.height),m=c.width*h,v=c.height*h;i.startX=e.clientX-(p-m)*u.x,i.startY=e.clientY-(f-v)*u.y,p=m,f=v}else i.startX=u.x?e.clientX:i.startX,i.startY=u.y?e.clientY:i.startY;Ol(c,"width",p),Ol(c,"height",f),o.top=c.offsetTop,o.left=c.offsetLeft,o.width=c.offsetWidth,o.height=c.offsetHeight;var g=c.nextElementSibling;g.style.width=o.width+"px",g.style.height=o.height+"px",g.style.top=o.top+"px",g.style.left=o.left+"px"}}(t,e,n)}return i.setMeta(Tl,{setDragging:{startX:e.clientX,startY:e.clientY},activeHandle:r,rect:o.rect,nodePosition:o.nodePosition}),i.setMeta("addToHistory",!1),t.dispatch(i),e.view.addEventListener("mouseup",(function e(n){n.view.removeEventListener("mouseup",e),n.view.removeEventListener("mousemove",s),function(t){var e=Tl.getState(t.state),n=e.rect,r=e.dragging,o=e.nodePosition;if(r&&n){var i=t.state.selection;if(i instanceof ie){var s=i.node.attrs,a=n.width,c=n.height,u=void 0;if(Dl.test(s.style||"")){var l=ze(s.style,{style:"width",value:Il,newValue:a+"px"}),d=ze(l.style||"",{style:"height",value:Il,newValue:c+"px"}).style;u=Be.__assign({},s,{style:d})}else u=Be.__assign({},s,{width:a,height:c});var p=i.node.type.createAndFill(u);if(p){var f=t.state.tr;f.replaceWith(o,o+1,p),f.setSelection(ie.create(f.doc,o)),f.setMeta("commandName","image-resize"),f.setMeta("args",u),f.setMeta(Tl,{setDragging:null,activeHandle:null,rect:n,nodePosition:o}),t.dispatch(f)}}}}(t)})),e.view.addEventListener("mousemove",s),!0},Bl=function(t){return void 0===t&&(t={node:"image",lockRatio:!0}),new be({key:Tl,view:function(e){return{resize:function(){Tl.getState(e.state).rect&&e.dispatch(e.state.tr.setMeta("resize",!0))},get window(){return e.dom.ownerDocument&&e.dom.ownerDocument.defaultView},attachResize:function(){var t=this.window;t&&(t.removeEventListener("resize",this.resize),t.addEventListener("resize",this.resize))},removeResize:function(){var t=this.window;t&&t.removeEventListener("resize",this.resize)},update:function(e,n){var r=e.state,o=r.selection,i=r.schema.nodes[t.node],s=Tl.getState(r),a=s.rect;if(o instanceof ie&&i===o.node.type){var c=e.nodeDOM(o.from),u={top:c.offsetTop,left:c.offsetLeft,width:c.offsetWidth,height:c.offsetHeight};if(!n.selection.eq(o)||a&&(a.width!==u.width||a.height!==u.height||a.top!==u.top||a.left!==u.left)){var l=r.tr;l.setMeta(Tl,{rect:u,nodePosition:o.from}),e.dispatch(l),this.attachResize()}}else a&&(s.rect=null,s.nodePosition=-1)},destroy:function(){this.removeResize()}}},state:{init:function(){return new Al("",null,null,-1)},apply:function(t,e){return e.apply(t)}},props:{handleDOMEvents:{mousedown:function(e,n){return Nl(e,n,t)}},decorations:function(e){var n=e.selection,r=e.schema.nodes[t.node],o=Tl.getState(e).rect;if(o&&n instanceof ie&&r===n.node.type){var i=document.createElement("div");i.className="k-editor-resize-handles-wrapper",i.style.width=o.width+"px",i.style.height=o.height+"px",i.style.top=o.top+"px",i.style.left=o.left+"px";for(var s=0;s<Ml.length;s++){var a=document.createElement("div");a.className="k-editor-resize-handle "+Ml[s],a.setAttribute("data-direction",Ml[s]),i.appendChild(a)}return Fs.create(e.doc,[Bs.widget(e.selection.from+1,i)])}return Fs.empty}}})},zl=new xe("caret-color");function Pl(){return new be({key:zl,props:{decorations:function(t){var e=t.doc,n=t.selection,r=t.storedMarks;if(!n.empty||!r)return Fs.empty;var o=tn((r||[]).find((function(t){return"style"===t.type.name})),{name:"color",value:/^.+$/});if(!o)return Fs.empty;var i=n.$anchor.parent,s=[];return e.descendants((function(t,e){t.eq(i)&&s.push(Bs.node(e,e+t.nodeSize,{style:"caret-color: "+o}))})),Fs.create(e,s)}}})}function Rl(t){return void 0===t&&(t={}),new be({view:function(e){return new Fl(e,t)}})}var Fl=function(t,e){var n=this;this.editorView=t,this.width=e.width||1,this.color=e.color||"black",this.class=e.class,this.cursorPos=null,this.element=null,this.timeout=null,this.handlers=["dragover","dragend","drop","dragleave"].map((function(e){var r=function(t){return n[e](t)};return t.dom.addEventListener(e,r),{name:e,handler:r}}))};Fl.prototype.destroy=function(){var t=this;this.handlers.forEach((function(e){var n=e.name,r=e.handler;return t.editorView.dom.removeEventListener(n,r)}))},Fl.prototype.update=function(t,e){null!=this.cursorPos&&e.doc!=t.state.doc&&(this.cursorPos>t.state.doc.content.size?this.setCursor(null):this.updateOverlay())},Fl.prototype.setCursor=function(t){t!=this.cursorPos&&(this.cursorPos=t,null==t?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())},Fl.prototype.updateOverlay=function(){var t,e=this.editorView.state.doc.resolve(this.cursorPos);if(!e.parent.inlineContent){var n=e.nodeBefore,r=e.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),t={left:o.left,right:o.right,top:i-this.width/2,bottom:i+this.width/2}}}if(!t){var s=this.editorView.coordsAtPos(this.cursorPos);t={left:s.left-this.width/2,right:s.left+this.width/2,top:s.top,bottom:s.bottom}}var a,c,u=this.editorView.dom.offsetParent;if(this.element||(this.element=u.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),!u||u==document.body&&"static"==getComputedStyle(u).position)a=-pageXOffset,c=-pageYOffset;else{var l=u.getBoundingClientRect();a=l.left-u.scrollLeft,c=l.top-u.scrollTop}this.element.style.left=t.left-a+"px",this.element.style.top=t.top-c+"px",this.element.style.width=t.right-t.left+"px",this.element.style.height=t.bottom-t.top+"px"},Fl.prototype.scheduleRemoval=function(t){var e=this;clearTimeout(this.timeout),this.timeout=setTimeout((function(){return e.setCursor(null)}),t)},Fl.prototype.dragover=function(t){if(this.editorView.editable){var e=this.editorView.posAtCoords({left:t.clientX,top:t.clientY}),n=e&&e.inside>=0&&this.editorView.state.doc.nodeAt(e.inside),r=n&&n.type.spec.disableDropCursor,o="function"==typeof r?r(this.editorView,e):r;if(e&&!o){var i=e.pos;if(this.editorView.dragging&&this.editorView.dragging.slice&&null==(i=Ft(this.editorView.state.doc,i,this.editorView.dragging.slice)))return this.setCursor(null);this.setCursor(i),this.scheduleRemoval(5e3)}}},Fl.prototype.dragend=function(){this.scheduleRemoval(20)},Fl.prototype.drop=function(){this.scheduleRemoval(20)},Fl.prototype.dragleave=function(t){t.target!=this.editorView.dom&&this.editorView.dom.contains(t.relatedTarget)||this.setCursor(null)};var Ll=function(t){function e(e){t.call(this,e,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.map=function(n,r){var o=n.resolve(r.map(this.head));return e.valid(o)?new e(o):t.near(o)},e.prototype.content=function(){return p.empty},e.prototype.eq=function(t){return t instanceof e&&t.head==this.head},e.prototype.toJSON=function(){return{type:"gapcursor",pos:this.head}},e.fromJSON=function(t,n){if("number"!=typeof n.pos)throw new RangeError("Invalid input for GapCursor.fromJSON");return new e(t.resolve(n.pos))},e.prototype.getBookmark=function(){return new Vl(this.anchor)},e.valid=function(t){var e=t.parent;if(e.isTextblock||!function(t){for(var e=t.depth;e>=0;e--){var n=t.index(e),r=t.node(e);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}(t)||!function(t){for(var e=t.depth;e>=0;e--){var n=t.indexAfter(e),r=t.node(e);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}(t))return!1;var n=e.type.spec.allowGapCursor;if(null!=n)return n;var r=e.contentMatchAt(t.index()).defaultType;return r&&r.isTextblock},e.findFrom=function(t,n,r){t:for(;;){if(!r&&e.valid(t))return t;for(var o=t.pos,i=null,s=t.depth;;s--){var a=t.node(s);if(n>0?t.indexAfter(s)<a.childCount:t.index(s)>0){i=a.child(n>0?t.indexAfter(s):t.index(s)-1);break}if(0==s)return null;o+=n;var c=t.doc.resolve(o);if(e.valid(c))return c}for(;;){var u=n>0?i.firstChild:i.lastChild;if(!u){if(i.isAtom&&!i.isText&&!ie.isSelectable(i)){t=t.doc.resolve(o+i.nodeSize*n),r=!1;continue t}break}i=u,o+=n;var l=t.doc.resolve(o);if(e.valid(l))return l}return null}},e}(te);Ll.prototype.visible=!1,te.jsonID("gapcursor",Ll);var Vl=function(t){this.pos=t};Vl.prototype.map=function(t){return new Vl(t.map(this.pos))},Vl.prototype.resolve=function(t){var e=t.resolve(this.pos);return Ll.valid(e)?new Ll(e):te.near(e)};var jl=function(){return new be({props:{decorations:ql,createSelectionBetween:function(t,e,n){if(e.pos==n.pos&&Ll.valid(n))return new Ll(n)},handleClick:Hl,handleKeyDown:$l}})},$l=uo({ArrowLeft:Wl("horiz",-1),ArrowRight:Wl("horiz",1),ArrowUp:Wl("vert",-1),ArrowDown:Wl("vert",1)});function Wl(t,e){var n="vert"==t?e>0?"down":"up":e>0?"right":"left";return function(t,r,o){var i=t.selection,s=e>0?i.$to:i.$from,a=i.empty;if(i instanceof re){if(!o.endOfTextblock(n)||0==s.depth)return!1;a=!1,s=t.doc.resolve(e>0?s.after():s.before())}var c=Ll.findFrom(s,e,a);return!!c&&(r&&r(t.tr.setSelection(new Ll(c))),!0)}}function Hl(t,e,n){if(!t.editable)return!1;var r=t.state.doc.resolve(e);if(!Ll.valid(r))return!1;var o=t.posAtCoords({left:n.clientX,top:n.clientY}).inside;return!(o>-1&&ie.isSelectable(t.state.doc.nodeAt(o)))&&(t.dispatch(t.state.tr.setSelection(new Ll(r))),!0)}function ql(t){if(!(t.selection instanceof Ll))return null;var e=document.createElement("div");return e.className="ProseMirror-gapcursor",Fs.create(t.doc,[Bs.widget(t.selection.head,e,{key:"gapcursor"})])}var Jl=function(t,e,n){for(var r,o=t.table,i=t.table_row,s=t.table_cell,a=[],c=0;c<e+1;c++){r=[];for(var u=0;u<n+1;u++)r.push(s.createAndFill());a.push(i.createAndFill(void 0,r))}return o.createAndFill(void 0,a)},Kl=function(t,e){for(var n=t.$head,r=n.depth;r>0;r--){var o=n.node(r);if(o.type.name===e)return{pos:n.before(r),node:o}}return null},Ul=function(t,e){return oc(t,e&&function(t){var n,r=Kl(t.selection,"table_row"),o=Kl(t.selection,"table");if(r&&o&&r.node.attrs[ke]){for(var i=0,s=0;s<o.node.nodeSize;s++)if(o.node.child(s).eq(r.node)){i=s;break}var a=o.node.child(i-1),c=r.pos-a.nodeSize;t.setNodeMarkup(c,void 0,((n={})[ke]=r.node.attrs[ke],n))}return e(t)})},Gl=function(t,e){return ic(t,e&&function(t){var n,r=Kl(t.selection,"table_row");if(r&&r.node.attrs[ke]){var o=r.pos+r.node.nodeSize;t.setNodeMarkup(o,void 0,((n={})[ke]=r.node.attrs[ke],n))}return e(t)})}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(10);e.outerWidth=function(t){var e=t.offsetWidth,n=getComputedStyle(t);return e+=parseFloat(n.marginLeft)||0+parseFloat(n.marginRight)||0},e.removeEntries=function(t,e){return Object.keys(t).filter((function(t){return e(t)})).reduce((function(e,n){var r;return Object.assign(e,((r={})[n]=t[n],r))}),{})},e.removeEmptyEntries=function(t){return e.removeEntries(t,(function(e){return null!==t[e]&&void 0!==t[e]&&""!==t[e]}))},e.isEmpty=function(t){return 0===Object.keys(t).length},e.isNullOrUndefined=function(t){return null==t},e.isPresent=function(t){return!e.isNullOrUndefined(t)},e.detectIE=function(){if(!r.isDocumentAvailable())return!1;var t=window.navigator.userAgent,e=t.indexOf("MSIE "),n=t.indexOf("Trident/");return e>0||n>0},e.safeString=function(t){return e.isNullOrUndefined(t)?"":t.toString()},e.first=function(t){return t[0]},e.last=function(t){return t[t.length-1]},e.unique=function(t){return Array.from(new Set(t))},e.split=function(t){return function(e){return e.split(t)}},e.trim=function(t){return t.trim()},e.filter=function(t){return function(e){return e.filter(t)}},e.toArray=function(t){return t instanceof Array?t:[t]},e.getUniqueStyleValues=function(t,n){if(t.hasNodesWithoutMarks)return"";var r=t.marks.filter((function(t){return"style"===t.type.name})).map((function(t){return t.attrs.style})).map(e.safeString).map(e.split(";")).map(e.filter((function(t){return t.includes(n)}))).map((function(t){return 0!==t.length?t:[n+": INVALID"]})).map(e.first).map(e.split(":")).map(e.last).map(e.trim).reduce((function(t,e){return t.indexOf(e)>-1?t:t.concat([e])}),[]);return r.indexOf("INVALID")>-1||1!==r.length?"":r[0]},e.conditionallyExecute=function(t){return function(e){return function(n){return e?t(n):n}}},e.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return t.reduce((function(t,e){return e(t)}),e)}}},function(t,e){t.exports=r},function(t,e){t.exports=o},function(t,e){t.exports=i},function(t,e){t.exports=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=function(t){function e(e,n,r,o,i){var s=t.call(this,e,n,r,o,i)||this;return s.dialog=e,s.button=n,s.editor=r,s.localization=o,s.toolsService=i,s}return r.__extends(e,t),e.prototype.clickHandler=function(){this.editor.openDialog(this.dialog)},e.prototype.onStateChange=function(t){this.button.selected=t[this.command].selected,this.button.disabled=t[this.command].disabled},e}(n(34).EditorCommandBase);e.EditorCommandDialog=o},function(t,e){t.exports=a},function(t,e){t.exports=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(13),s=function(){function t(){this.valueChange=new o.EventEmitter}return t.prototype.onValueChange=function(t){this.valueChange.emit(t)},t.prototype.focus=function(){this.dropDownList.focus()},r.__decorate([o.Input(),r.__metadata("design:type",Array)],t.prototype,"data",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],t.prototype,"value",void 0),r.__decorate([o.Input(),r.__metadata("design:type",Object)],t.prototype,"defaultItem",void 0),r.__decorate([o.Input(),r.__metadata("design:type",Function)],t.prototype,"itemDisabled",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],t.prototype,"title",void 0),r.__decorate([o.Input(),r.__metadata("design:type",Boolean)],t.prototype,"disabled",void 0),r.__decorate([o.Input(),r.__metadata("design:type",Number)],t.prototype,"tabindex",void 0),r.__decorate([o.Output(),r.__metadata("design:type",o.EventEmitter)],t.prototype,"valueChange",void 0),r.__decorate([o.ViewChild("element",{static:!0}),r.__metadata("design:type",o.ElementRef)],t.prototype,"element",void 0),r.__decorate([o.ViewChild("element",{read:i.DropDownListComponent,static:!0}),r.__metadata("design:type",i.DropDownListComponent)],t.prototype,"dropDownList",void 0),t=r.__decorate([o.Component({selector:"kendo-editor-format-dropdownlist",template:'\n <kendo-dropdownlist\n #element\n kendoEditorDropDownTool\n [defaultItem]="defaultItem"\n [textField]="\'text\'"\n [valueField]="\'tag\'"\n [data]="data"\n [(value)]="value"\n [valuePrimitive]="true"\n [itemDisabled]="itemDisabled"\n [attr.title]="title"\n [disabled]="disabled"\n [tabindex]="tabindex"\n (valueChange)="onValueChange($event)"\n >\n <ng-template kendoDropDownListItemTemplate let-dataItem>\n <ng-container [ngSwitch]="dataItem.tag">\n <span *ngSwitchCase="\'h1\'" style="display: block; font-size: 2em; margin-left: 0; font-weight: bold;">\n {{ dataItem.text }}\n </span>\n\n <span *ngSwitchCase="\'h2\'" style="display: block; font-size: 1.5em; margin-left: 0; font-weight: bold;">\n {{ dataItem.text }}\n </span>\n\n <span *ngSwitchCase="\'h3\'" style="display: block; font-size: 1.17em; margin-left: 0; font-weight: bold;">\n {{ dataItem.text }}\n </span>\n\n <span *ngSwitchCase="\'h4\'" style="display: block; font-size: 1em; margin-left: 0; font-weight: bold;">\n {{ dataItem.text }}\n </span>\n\n <span *ngSwitchCase="\'h5\'" style="display: block; font-size: .83em; margin-left: 0; font-weight: bold;">\n {{ dataItem.text }}\n </span>\n\n <span *ngSwitchCase="\'h6\'" style="display: block; font-size: .67em; margin-left: 0; font-weight: bold;">\n {{ dataItem.text }}\n </span>\n\n <span *ngSwitchCase="\'p\'" style="display: block; margin-left: 0;">\n {{ dataItem.text }}\n </span>\n\n <span *ngSwitchDefault>{{ dataItem.text }}</span>\n </ng-container>\n </ng-template>\n </kendo-dropdownlist>\n ',styles:["\n .k-dropdownlist {\n width: 13em;\n }\n "]})],t)}();e.FormatDropDownListComponent=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(13),s=function(){function t(){this.valueChange=new o.EventEmitter}return t.prototype.onValueChange=function(t){this.valueChange.emit(t)},t.prototype.focus=function(){this.dropDownList.focus()},r.__decorate([o.Input(),r.__metadata("design:type",Array)],t.prototype,"data",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],t.prototype,"value",void 0),r.__decorate([o.Input(),r.__metadata("design:type",Object)],t.prototype,"defaultItem",void 0),r.__decorate([o.Input(),r.__metadata("design:type",Function)],t.prototype,"itemDisabled",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],t.prototype,"title",void 0),r.__decorate([o.Input(),r.__metadata("design:type",Boolean)],t.prototype,"disabled",void 0),r.__decorate([o.Input(),r.__metadata("design:type",Number)],t.prototype,"tabindex",void 0),r.__decorate([o.Output(),r.__metadata("design:type",o.EventEmitter)],t.prototype,"valueChange",void 0),r.__decorate([o.ViewChild("element",{static:!0}),r.__metadata("design:type",o.ElementRef)],t.prototype,"element",void 0),r.__decorate([o.ViewChild("element",{read:i.DropDownListComponent,static:!0}),r.__metadata("design:type",i.DropDownListComponent)],t.prototype,"dropDownList",void 0),t=r.__decorate([o.Component({selector:"kendo-editor-fontfamily-dropdownlist",template:'\n <kendo-dropdownlist\n #element\n kendoEditorDropDownTool\n [defaultItem]="defaultItem"\n [textField]="\'text\'"\n [valueField]="\'fontName\'"\n [data]="data"\n [(value)]="value"\n [valuePrimitive]="true"\n [itemDisabled]="itemDisabled"\n [attr.title]="title"\n [disabled]="disabled"\n [tabindex]="tabindex"\n (valueChange)="onValueChange($event)"\n >\n <ng-template kendoDropDownListItemTemplate let-dataItem>\n <span [ngStyle]="{ \'font-family\': dataItem.fontName }">\n {{ dataItem.text }}\n </span>\n </ng-template>\n </kendo-dropdownlist>\n ',styles:["\n .k-dropdownlist {\n width: 13em;\n }\n "]})],t)}();e.FontFamilyDropDownListComponent=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(13),s=function(){function t(){this.valueChange=new o.EventEmitter}return t.prototype.onValueChange=function(t){this.valueChange.emit(t)},t.prototype.focus=function(){this.dropDownList.focus()},r.__decorate([o.Input(),r.__metadata("design:type",Array)],t.prototype,"data",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],t.prototype,"value",void 0),r.__decorate([o.Input(),r.__metadata("design:type",Object)],t.prototype,"defaultItem",void 0),r.__decorate([o.Input(),r.__metadata("design:type",Function)],t.prototype,"itemDisabled",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],t.prototype,"title",void 0),r.__decorate([o.Input(),r.__metadata("design:type",Boolean)],t.prototype,"disabled",void 0),r.__decorate([o.Input(),r.__metadata("design:type",Number)],t.prototype,"tabindex",void 0),r.__decorate([o.Output(),r.__metadata("design:type",o.EventEmitter)],t.prototype,"valueChange",void 0),r.__decorate([o.ViewChild("element",{static:!0}),r.__metadata("design:type",o.ElementRef)],t.prototype,"element",void 0),r.__decorate([o.ViewChild("element",{read:i.DropDownListComponent,static:!0}),r.__metadata("design:type",i.DropDownListComponent)],t.prototype,"dropDownList",void 0),t=r.__decorate([o.Component({selector:"kendo-editor-fontsize-dropdownlist",template:'\n <kendo-dropdownlist\n #element\n kendoEditorDropDownTool\n [defaultItem]="defaultItem"\n [textField]="\'text\'"\n [valueField]="\'size\'"\n [data]="data"\n [(value)]="value"\n [valuePrimitive]="true"\n [itemDisabled]="itemDisabled"\n [attr.title]="title"\n [disabled]="disabled"\n [tabindex]="tabindex"\n (valueChange)="onValueChange($event)"\n >\n </kendo-dropdownlist>\n ',styles:["\n .k-dropdownlist {\n width: 13em;\n }\n "]})],t)}();e.FontSizeDropDownListComponent=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(4),s=n(16),a=n(2),c=n(9),u=n(3),l=n(7),d=n(30),p=n(22),f=function(t){function e(e,n,r,o){var i=t.call(this)||this;return i.editor=e,i.localization=n,i.dialogService=r,i.ngZone=o,i.tabindex=-1,i.disabled=!1,i.views=["palette"],i}var n;return r.__extends(e,t),n=e,Object.defineProperty(e.prototype,"view",{get:function(){return this.views&&this.views.length>0?this.views[0]:null},set:function(t){this.views=[t]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"title",{get:function(){return this.localization.get(this.editorCommand)},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){var t=this;this.subs=this.editor.stateChange.subscribe((function(e){var n=e.style;t.disabled=n.disabled}))},e.prototype.ngOnDestroy=function(){this.subs&&this.subs.unsubscribe()},e.prototype.handleValueChange=function(t){this.editor.exec(this.editorCommand,t),this.editor.view.focus()},e.prototype.handleActiveColorClick=function(t){t.preventOpen(),this.handleValueChange(t.color)},e.prototype.onOpen=function(t){this.valueCache=t.value,t.reset()},e.prototype.onClose=function(t){var e=this;t.value||(t.value=this.valueCache),this.editor.shouldEmitFocus=!0,this.ngZone.onStable.pipe(p.take(1)).subscribe((function(){return e.editor.view.focus()}))},Object.defineProperty(e.prototype,"outerWidth",{get:function(){if(this.element)return c.outerWidth(this.element.nativeElement)},enumerable:!0,configurable:!0}),e.prototype.openDialog=function(){var t={appendTo:this.editor.dialogContainer,content:d.ColorPickerDialogComponent};this.editor.toolbar.toggle(!1),this.dialogService.open(t).content.instance.setData({editor:this.editor,value:this.value,title:this.title,editorCommand:this.editorCommand,paletteSettings:this.paletteSettings,icon:this.icon,views:this.views})},e.prototype.canFocus=function(){return!this.disabled},e.prototype.focus=function(){this.tabindex=0,this.overflows?this.colorPickerButton.nativeElement.focus():this.colorPicker.focus()},e.prototype.handleKey=function(){return this.tabindex=-1,!1},r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"value",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"icon",void 0),r.__decorate([o.Input(),r.__metadata("design:type",Object)],e.prototype,"paletteSettings",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"editorCommand",void 0),r.__decorate([o.Input(),r.__metadata("design:type",Boolean)],e.prototype,"disabled",void 0),r.__decorate([o.Input(),r.__metadata("design:type",Array)],e.prototype,"views",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String),r.__metadata("design:paramtypes",[String])],e.prototype,"view",null),r.__decorate([o.ViewChild("toolbarTemplate",{static:!0}),r.__metadata("design:type",o.TemplateRef)],e.prototype,"toolbarTemplate",void 0),r.__decorate([o.ViewChild("popupTemplate",{static:!0}),r.__metadata("design:type",o.TemplateRef)],e.prototype,"popupTemplate",void 0),r.__decorate([o.ViewChild("colorpicker",{read:o.ElementRef,static:!1}),r.__metadata("design:type",o.ElementRef)],e.prototype,"element",void 0),r.__decorate([o.ViewChild("colorpicker",{read:s.ColorPickerComponent,static:!1}),r.__metadata("design:type",s.ColorPickerComponent)],e.prototype,"colorPicker",void 0),r.__decorate([o.ViewChild("colorPickerButton",{read:o.ElementRef,static:!1}),r.__metadata("design:type",o.ElementRef)],e.prototype,"colorPickerButton",void 0),e=n=r.__decorate([o.Component({providers:[{provide:i.ToolBarToolComponent,useExisting:o.forwardRef((function(){return n}))}],selector:"kendo-toolbar-colorpicker",template:'\n <ng-template #toolbarTemplate>\n <kendo-colorpicker\n #colorpicker\n [attr.title]="title"\n [icon]="icon"\n [views]="views"\n [format]="\'hex\'"\n [value]="value"\n [paletteSettings]="paletteSettings"\n [disabled]="disabled"\n [tabindex]="tabindex"\n (valueChange)="handleValueChange($event)"\n (activeColorClick)="handleActiveColorClick($event)"\n (open)="onOpen(colorpicker)"\n (close)="onClose(colorpicker)"\n >\n </kendo-colorpicker>\n </ng-template>\n <ng-template #popupTemplate>\n <button\n tabindex="-1"\n type="button"\n kendoButton\n #colorPickerButton\n class="k-overflow-button"\n [icon]="icon"\n [attr.title]="title"\n [disabled]="disabled"\n [tabindex]="tabindex"\n (click)="openDialog()"\n >\n {{ title }}\n </button>\n </ng-template>\n '}),r.__param(0,o.Host()),r.__metadata("design:paramtypes",[u.EditorComponent,a.EditorLocalizationService,l.DialogService,o.NgZone])],e)}(i.ToolBarToolComponent);e.EditorColorPickerComponent=f},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.commandIcons={alignCenter:"align-center",alignJustify:"align-justify",alignLeft:"align-left",alignRight:"align-right",backColor:"background",blockquote:"blockquote",bold:"bold",cleanFormatting:"clear-css",createLink:"link-horizontal",foreColor:"foreground-color",indent:"indent-increase",insertFile:"file-add",insertImage:"image",insertOrderedList:"list-ordered",insertUnorderedList:"list-unordered",italic:"italic",outdent:"indent-decrease",print:"print",redo:"redo",selectAll:"select-all",strikethrough:"strikethrough",subscript:"sub-script",superscript:"sup-script",underline:"underline",undo:"undo",unlink:"unlink-horizontal",viewSource:"html",insertTable:"table-insert",addColumnBefore:"table-column-insert-left",addColumnAfter:"table-column-insert-right",addRowBefore:"table-row-insert-above",addRowAfter:"table-row-insert-below",deleteRow:"table-row-delete",deleteColumn:"table-column-delete",mergeCells:"cells-merge",splitCell:"cell-split-horizontally",deleteTable:"table-delete"}},function(t,e,n){"use strict";n.r(e),n.d(e,"audit",(function(){return P})),n.d(e,"auditTime",(function(){return J})),n.d(e,"buffer",(function(){return K})),n.d(e,"bufferCount",(function(){return Y})),n.d(e,"bufferTime",(function(){return tt})),n.d(e,"bufferToggle",(function(){return at})),n.d(e,"bufferWhen",(function(){return lt})),n.d(e,"catchError",(function(){return ft})),n.d(e,"combineAll",(function(){return wt})),n.d(e,"combineLatest",(function(){return xt})),n.d(e,"concat",(function(){return Rt})),n.d(e,"concatAll",(function(){return zt})),n.d(e,"concatMap",(function(){return Ft})),n.d(e,"concatMapTo",(function(){return Lt})),n.d(e,"count",(function(){return Vt})),n.d(e,"debounce",(function(){return Wt})),n.d(e,"debounceTime",(function(){return Jt})),n.d(e,"defaultIfEmpty",(function(){return Yt})),n.d(e,"delay",(function(){return oe})),n.d(e,"delayWhen",(function(){return ce})),n.d(e,"dematerialize",(function(){return fe})),n.d(e,"distinct",(function(){return ve})),n.d(e,"distinctUntilChanged",(function(){return be})),n.d(e,"distinctUntilKeyChanged",(function(){return xe})),n.d(e,"elementAt",(function(){return Fe})),n.d(e,"endWith",(function(){return Le})),n.d(e,"every",(function(){return Ve})),n.d(e,"exhaust",(function(){return We})),n.d(e,"exhaustMap",(function(){return Je})),n.d(e,"expand",(function(){return Ge})),n.d(e,"filter",(function(){return Se})),n.d(e,"finalize",(function(){return Ze})),n.d(e,"find",(function(){return en})),n.d(e,"findIndex",(function(){return on})),n.d(e,"first",(function(){return sn})),n.d(e,"groupBy",(function(){return fn})),n.d(e,"ignoreElements",(function(){return bn})),n.d(e,"isEmpty",(function(){return xn})),n.d(e,"last",(function(){return Mn})),n.d(e,"map",(function(){return Et})),n.d(e,"mapTo",(function(){return On})),n.d(e,"materialize",(function(){return An})),n.d(e,"max",(function(){return Ln})),n.d(e,"merge",(function(){return jn})),n.d(e,"mergeAll",(function(){return Bt})),n.d(e,"mergeMap",(function(){return Dt})),n.d(e,"flatMap",(function(){return Dt})),n.d(e,"mergeMapTo",(function(){return $n})),n.d(e,"mergeScan",(function(){return Wn})),n.d(e,"min",(function(){return Jn})),n.d(e,"multicast",(function(){return Qn})),n.d(e,"observeOn",(function(){return er})),n.d(e,"onErrorResumeNext",(function(){return ir})),n.d(e,"pairwise",(function(){return cr})),n.d(e,"partition",(function(){return pr})),n.d(e,"pluck",(function(){return fr})),n.d(e,"publish",(function(){return mr})),n.d(e,"publishBehavior",(function(){return gr})),n.d(e,"publishLast",(function(){return br})),n.d(e,"publishReplay",(function(){return Cr})),n.d(e,"race",(function(){return Mr})),n.d(e,"reduce",(function(){return Fn})),n.d(e,"repeat",(function(){return Or})),n.d(e,"repeatWhen",(function(){return Ar})),n.d(e,"retry",(function(){return zr})),n.d(e,"retryWhen",(function(){return Fr})),n.d(e,"refCount",(function(){return Kn})),n.d(e,"sample",(function(){return jr})),n.d(e,"sampleTime",(function(){return Hr})),n.d(e,"scan",(function(){return zn})),n.d(e,"sequenceEqual",(function(){return Ur})),n.d(e,"share",(function(){return Qr})),n.d(e,"shareReplay",(function(){return to})),n.d(e,"single",(function(){return eo})),n.d(e,"skip",(function(){return oo})),n.d(e,"skipLast",(function(){return ao})),n.d(e,"skipUntil",(function(){return lo})),n.d(e,"skipWhile",(function(){return ho})),n.d(e,"startWith",(function(){return go})),n.d(e,"subscribeOn",(function(){return So})),n.d(e,"switchAll",(function(){return Do})),n.d(e,"switchMap",(function(){return Eo})),n.d(e,"switchMapTo",(function(){return Io})),n.d(e,"take",(function(){return ze})),n.d(e,"takeLast",(function(){return Sn})),n.d(e,"takeUntil",(function(){return Ao})),n.d(e,"takeWhile",(function(){return zo})),n.d(e,"tap",(function(){return Me})),n.d(e,"throttle",(function(){return Lo})),n.d(e,"throttleTime",(function(){return $o})),n.d(e,"throwIfEmpty",(function(){return Ne})),n.d(e,"timeInterval",(function(){return Jo})),n.d(e,"timeout",(function(){return Qo})),n.d(e,"timeoutWith",(function(){return Yo})),n.d(e,"timestamp",(function(){return ti})),n.d(e,"toArray",(function(){return ri})),n.d(e,"window",(function(){return oi})),n.d(e,"windowCount",(function(){return ai})),n.d(e,"windowTime",(function(){return li})),n.d(e,"windowToggle",(function(){return gi})),n.d(e,"windowWhen",(function(){return wi})),n.d(e,"withLatestFrom",(function(){return ki})),n.d(e,"zip",(function(){return Ai})),n.d(e,"zipAll",(function(){return Ni}));var r=n(0);function o(t){return"function"==typeof t}var i=!1,s={Promise:void 0,set useDeprecatedSynchronousErrorHandling(t){t&&(new Error).stack;i=t},get useDeprecatedSynchronousErrorHandling(){return i}};function a(t){setTimeout((function(){throw t}))}var c={closed:!0,next:function(t){},error:function(t){if(s.useDeprecatedSynchronousErrorHandling)throw t;a(t)},complete:function(){}},u=Array.isArray||function(t){return t&&"number"==typeof t.length};function l(t){return null!==t&&"object"==typeof t}function d(t){return Error.call(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map((function(t,e){return e+1+") "+t.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=t,this}d.prototype=Object.create(Error.prototype);var p=d,f=function(){function t(t){this.closed=!1,this._parent=null,this._parents=null,this._subscriptions=null,t&&(this._unsubscribe=t)}return t.prototype.unsubscribe=function(){var t,e=!1;if(!this.closed){var n=this._parent,r=this._parents,i=this._unsubscribe,s=this._subscriptions;this.closed=!0,this._parent=null,this._parents=null,this._subscriptions=null;for(var a=-1,c=r?r.length:0;n;)n.remove(this),n=++a<c&&r[a]||null;if(o(i))try{i.call(this)}catch(n){e=!0,t=n instanceof p?h(n.errors):[n]}if(u(s))for(a=-1,c=s.length;++a<c;){var d=s[a];if(l(d))try{d.unsubscribe()}catch(n){e=!0,t=t||[],n instanceof p?t=t.concat(h(n.errors)):t.push(n)}}if(e)throw new p(t)}},t.prototype.add=function(e){var n=e;switch(typeof e){case"function":n=new t(e);case"object":if(n===this||n.closed||"function"!=typeof n.unsubscribe)return n;if(this.closed)return n.unsubscribe(),n;if(!(n instanceof t)){var r=n;(n=new t)._subscriptions=[r]}break;default:if(!e)return t.EMPTY;throw new Error("unrecognized teardown "+e+" added to Subscription.")}if(n._addParent(this)){var o=this._subscriptions;o?o.push(n):this._subscriptions=[n]}return n},t.prototype.remove=function(t){var e=this._subscriptions;if(e){var n=e.indexOf(t);-1!==n&&e.splice(n,1)}},t.prototype._addParent=function(t){var e=this._parent,n=this._parents;return e!==t&&(e?n?-1===n.indexOf(t)&&(n.push(t),!0):(this._parents=[t],!0):(this._parent=t,!0))},t.EMPTY=function(t){return t.closed=!0,t}(new t),t}();function h(t){return t.reduce((function(t,e){return t.concat(e instanceof p?e.errors:e)}),[])}var m="function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random(),v=function(t){function e(n,r,o){var i=t.call(this)||this;switch(i.syncErrorValue=null,i.syncErrorThrown=!1,i.syncErrorThrowable=!1,i.isStopped=!1,arguments.length){case 0:i.destination=c;break;case 1:if(!n){i.destination=c;break}if("object"==typeof n){n instanceof e?(i.syncErrorThrowable=n.syncErrorThrowable,i.destination=n,n.add(i)):(i.syncErrorThrowable=!0,i.destination=new g(i,n));break}default:i.syncErrorThrowable=!0,i.destination=new g(i,n,r,o)}return i}return r.__extends(e,t),e.prototype[m]=function(){return this},e.create=function(t,n,r){var o=new e(t,n,r);return o.syncErrorThrowable=!1,o},e.prototype.next=function(t){this.isStopped||this._next(t)},e.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this))},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){this.destination.error(t),this.unsubscribe()},e.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},e.prototype._unsubscribeAndRecycle=function(){var t=this._parent,e=this._parents;return this._parent=null,this._parents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parent=t,this._parents=e,this},e}(f),g=function(t){function e(e,n,r,i){var s,a=t.call(this)||this;a._parentSubscriber=e;var u=a;return o(n)?s=n:n&&(s=n.next,r=n.error,i=n.complete,n!==c&&(o((u=Object.create(n)).unsubscribe)&&a.add(u.unsubscribe.bind(u)),u.unsubscribe=a.unsubscribe.bind(a))),a._context=u,a._next=s,a._error=r,a._complete=i,a}return r.__extends(e,t),e.prototype.next=function(t){if(!this.isStopped&&this._next){var e=this._parentSubscriber;s.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?this.__tryOrSetError(e,this._next,t)&&this.unsubscribe():this.__tryOrUnsub(this._next,t)}},e.prototype.error=function(t){if(!this.isStopped){var e=this._parentSubscriber,n=s.useDeprecatedSynchronousErrorHandling;if(this._error)n&&e.syncErrorThrowable?(this.__tryOrSetError(e,this._error,t),this.unsubscribe()):(this.__tryOrUnsub(this._error,t),this.unsubscribe());else if(e.syncErrorThrowable)n?(e.syncErrorValue=t,e.syncErrorThrown=!0):a(t),this.unsubscribe();else{if(this.unsubscribe(),n)throw t;a(t)}}},e.prototype.complete=function(){var t=this;if(!this.isStopped){var e=this._parentSubscriber;if(this._complete){var n=function(){return t._complete.call(t._context)};s.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?(this.__tryOrSetError(e,n),this.unsubscribe()):(this.__tryOrUnsub(n),this.unsubscribe())}else this.unsubscribe()}},e.prototype.__tryOrUnsub=function(t,e){try{t.call(this._context,e)}catch(t){if(this.unsubscribe(),s.useDeprecatedSynchronousErrorHandling)throw t;a(t)}},e.prototype.__tryOrSetError=function(t,e,n){if(!s.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{e.call(this._context,n)}catch(e){return s.useDeprecatedSynchronousErrorHandling?(t.syncErrorValue=e,t.syncErrorThrown=!0,!0):(a(e),!0)}return!1},e.prototype._unsubscribe=function(){var t=this._parentSubscriber;this._context=null,this._parentSubscriber=null,t.unsubscribe()},e}(v),y=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e.prototype.notifyNext=function(t,e,n,r,o){this.destination.next(e)},e.prototype.notifyError=function(t,e){this.destination.error(t)},e.prototype.notifyComplete=function(t){this.destination.complete()},e}(v),b=function(t){function e(e,n,r){var o=t.call(this)||this;return o.parent=e,o.outerValue=n,o.outerIndex=r,o.index=0,o}return r.__extends(e,t),e.prototype._next=function(t){this.parent.notifyNext(this.outerValue,t,this.outerIndex,this.index++,this)},e.prototype._error=function(t){this.parent.notifyError(t,this),this.unsubscribe()},e.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},e}(v);var w="function"==typeof Symbol&&Symbol.observable||"@@observable";function _(){}function x(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return k(t)}function k(t){return t?1===t.length?t[0]:function(e){return t.reduce((function(t,e){return e(t)}),e)}:_}var C=function(){function t(t){this._isScalar=!1,t&&(this._subscribe=t)}return t.prototype.lift=function(e){var n=new t;return n.source=this,n.operator=e,n},t.prototype.subscribe=function(t,e,n){var r=this.operator,o=function(t,e,n){if(t){if(t instanceof v)return t;if(t[m])return t[m]()}return t||e||n?new v(t,e,n):new v(c)}(t,e,n);if(r?o.add(r.call(o,this.source)):o.add(this.source||s.useDeprecatedSynchronousErrorHandling&&!o.syncErrorThrowable?this._subscribe(o):this._trySubscribe(o)),s.useDeprecatedSynchronousErrorHandling&&o.syncErrorThrowable&&(o.syncErrorThrowable=!1,o.syncErrorThrown))throw o.syncErrorValue;return o},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){s.useDeprecatedSynchronousErrorHandling&&(t.syncErrorThrown=!0,t.syncErrorValue=e),!function(t){for(;t;){var e=t,n=e.closed,r=e.destination,o=e.isStopped;if(n||o)return!1;t=r&&r instanceof v?r:null}return!0}(t)?console.warn(e):t.error(e)}},t.prototype.forEach=function(t,e){var n=this;return new(e=S(e))((function(e,r){var o;o=n.subscribe((function(e){try{t(e)}catch(t){r(t),o&&o.unsubscribe()}}),r,e)}))},t.prototype._subscribe=function(t){var e=this.source;return e&&e.subscribe(t)},t.prototype[w]=function(){return this},t.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return 0===t.length?this:k(t)(this)},t.prototype.toPromise=function(t){var e=this;return new(t=S(t))((function(t,n){var r;e.subscribe((function(t){return r=t}),(function(t){return n(t)}),(function(){return t(r)}))}))},t.create=function(e){return new t(e)},t}();function S(t){if(t||(t=s.Promise||Promise),!t)throw new Error("no Promise impl found");return t}var T=function(t){return function(e){for(var n=0,r=t.length;n<r&&!e.closed;n++)e.next(t[n]);e.closed||e.complete()}},E=function(t){return function(e){return t.then((function(t){e.closed||(e.next(t),e.complete())}),(function(t){return e.error(t)})).then(null,a),e}};function M(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}var O=M(),D=function(t){return function(e){for(var n=t[O]();;){var r=n.next();if(r.done){e.complete();break}if(e.next(r.value),e.closed)break}return"function"==typeof n.return&&e.add((function(){n.return&&n.return()})),e}},I=function(t){return function(e){var n=t[w]();if("function"!=typeof n.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return n.subscribe(e)}},A=function(t){return t&&"number"==typeof t.length&&"function"!=typeof t};function N(t){return!!t&&"function"!=typeof t.subscribe&&"function"==typeof t.then}var B=function(t){if(t instanceof C)return function(e){return t._isScalar?(e.next(t.value),void e.complete()):t.subscribe(e)};if(t&&"function"==typeof t[w])return I(t);if(A(t))return T(t);if(N(t))return E(t);if(t&&"function"==typeof t[O])return D(t);var e=l(t)?"an invalid object":"'"+t+"'";throw new TypeError("You provided "+e+" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.")};function z(t,e,n,r,o){if(void 0===o&&(o=new b(t,n,r)),!o.closed)return B(e)(o)}function P(t){return function(e){return e.lift(new R(t))}}var R=function(){function t(t){this.durationSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new F(t,this.durationSelector))},t}(),F=function(t){function e(e,n){var r=t.call(this,e)||this;return r.durationSelector=n,r.hasValue=!1,r}return r.__extends(e,t),e.prototype._next=function(t){if(this.value=t,this.hasValue=!0,!this.throttled){var e=void 0;try{e=(0,this.durationSelector)(t)}catch(t){return this.destination.error(t)}var n=z(this,e);!n||n.closed?this.clearThrottle():this.add(this.throttled=n)}},e.prototype.clearThrottle=function(){var t=this.value,e=this.hasValue,n=this.throttled;n&&(this.remove(n),this.throttled=null,n.unsubscribe()),e&&(this.value=null,this.hasValue=!1,this.destination.next(t))},e.prototype.notifyNext=function(t,e,n,r){this.clearThrottle()},e.prototype.notifyComplete=function(){this.clearThrottle()},e}(y),L=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r.pending=!1,r}return r.__extends(e,t),e.prototype.schedule=function(t,e){if(void 0===e&&(e=0),this.closed)return this;this.state=t;var n=this.id,r=this.scheduler;return null!=n&&(this.id=this.recycleAsyncId(r,n,e)),this.pending=!0,this.delay=e,this.id=this.id||this.requestAsyncId(r,this.id,e),this},e.prototype.requestAsyncId=function(t,e,n){return void 0===n&&(n=0),setInterval(t.flush.bind(t,this),n)},e.prototype.recycleAsyncId=function(t,e,n){if(void 0===n&&(n=0),null!==n&&this.delay===n&&!1===this.pending)return e;clearInterval(e)},e.prototype.execute=function(t,e){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var n=this._execute(t,e);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(t,e){var n=!1,r=void 0;try{this.work(t)}catch(t){n=!0,r=!!t&&t||new Error(t)}if(n)return this.unsubscribe(),r},e.prototype._unsubscribe=function(){var t=this.id,e=this.scheduler,n=e.actions,r=n.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==r&&n.splice(r,1),null!=t&&(this.id=this.recycleAsyncId(e,t,null)),this.delay=null},e}(function(t){function e(e,n){return t.call(this)||this}return r.__extends(e,t),e.prototype.schedule=function(t,e){return void 0===e&&(e=0),this},e}(f)),V=function(){function t(e,n){void 0===n&&(n=t.now),this.SchedulerAction=e,this.now=n}return t.prototype.schedule=function(t,e,n){return void 0===e&&(e=0),new this.SchedulerAction(this,t).schedule(n,e)},t.now=function(){return Date.now()},t}(),j=function(t){function e(n,r){void 0===r&&(r=V.now);var o=t.call(this,n,(function(){return e.delegate&&e.delegate!==o?e.delegate.now():r()}))||this;return o.actions=[],o.active=!1,o.scheduled=void 0,o}return r.__extends(e,t),e.prototype.schedule=function(n,r,o){return void 0===r&&(r=0),e.delegate&&e.delegate!==this?e.delegate.schedule(n,r,o):t.prototype.schedule.call(this,n,r,o)},e.prototype.flush=function(t){var e=this.actions;if(this.active)e.push(t);else{var n;this.active=!0;do{if(n=t.execute(t.state,t.delay))break}while(t=e.shift());if(this.active=!1,n){for(;t=e.shift();)t.unsubscribe();throw n}}},e}(V),$=new j(L);function W(t){return!u(t)&&t-parseFloat(t)+1>=0}function H(t){return t&&"function"==typeof t.schedule}function q(t){var e=t.index,n=t.period,r=t.subscriber;if(r.next(e),!r.closed){if(-1===n)return r.complete();t.index=e+1,this.schedule(t,n)}}function J(t,e){return void 0===e&&(e=$),P((function(){return function(t,e,n){void 0===t&&(t=0);var r=-1;return W(e)?r=Number(e)<1?1:Number(e):H(e)&&(n=e),H(n)||(n=$),new C((function(e){var o=W(t)?t:+t-n.now();return n.schedule(q,o,{index:0,period:r,subscriber:e})}))}(t,e)}))}function K(t){return function(e){return e.lift(new U(t))}}var U=function(){function t(t){this.closingNotifier=t}return t.prototype.call=function(t,e){return e.subscribe(new G(t,this.closingNotifier))},t}(),G=function(t){function e(e,n){var r=t.call(this,e)||this;return r.buffer=[],r.add(z(r,n)),r}return r.__extends(e,t),e.prototype._next=function(t){this.buffer.push(t)},e.prototype.notifyNext=function(t,e,n,r,o){var i=this.buffer;this.buffer=[],this.destination.next(i)},e}(y);function Y(t,e){return void 0===e&&(e=null),function(n){return n.lift(new X(t,e))}}var X=function(){function t(t,e){this.bufferSize=t,this.startBufferEvery=e,this.subscriberClass=e&&t!==e?Q:Z}return t.prototype.call=function(t,e){return e.subscribe(new this.subscriberClass(t,this.bufferSize,this.startBufferEvery))},t}(),Z=function(t){function e(e,n){var r=t.call(this,e)||this;return r.bufferSize=n,r.buffer=[],r}return r.__extends(e,t),e.prototype._next=function(t){var e=this.buffer;e.push(t),e.length==this.bufferSize&&(this.destination.next(e),this.buffer=[])},e.prototype._complete=function(){var e=this.buffer;e.length>0&&this.destination.next(e),t.prototype._complete.call(this)},e}(v),Q=function(t){function e(e,n,r){var o=t.call(this,e)||this;return o.bufferSize=n,o.startBufferEvery=r,o.buffers=[],o.count=0,o}return r.__extends(e,t),e.prototype._next=function(t){var e=this.bufferSize,n=this.startBufferEvery,r=this.buffers,o=this.count;this.count++,o%n==0&&r.push([]);for(var i=r.length;i--;){var s=r[i];s.push(t),s.length===e&&(r.splice(i,1),this.destination.next(s))}},e.prototype._complete=function(){for(var e=this.buffers,n=this.destination;e.length>0;){var r=e.shift();r.length>0&&n.next(r)}t.prototype._complete.call(this)},e}(v);function tt(t){var e=arguments.length,n=$;H(arguments[arguments.length-1])&&(n=arguments[arguments.length-1],e--);var r=null;e>=2&&(r=arguments[1]);var o=Number.POSITIVE_INFINITY;return e>=3&&(o=arguments[2]),function(e){return e.lift(new et(t,r,o,n))}}var et=function(){function t(t,e,n,r){this.bufferTimeSpan=t,this.bufferCreationInterval=e,this.maxBufferSize=n,this.scheduler=r}return t.prototype.call=function(t,e){return e.subscribe(new rt(t,this.bufferTimeSpan,this.bufferCreationInterval,this.maxBufferSize,this.scheduler))},t}(),nt=function(){return function(){this.buffer=[]}}(),rt=function(t){function e(e,n,r,o,i){var s=t.call(this,e)||this;s.bufferTimeSpan=n,s.bufferCreationInterval=r,s.maxBufferSize=o,s.scheduler=i,s.contexts=[];var a=s.openContext();if(s.timespanOnly=null==r||r<0,s.timespanOnly){var c={subscriber:s,context:a,bufferTimeSpan:n};s.add(a.closeAction=i.schedule(ot,n,c))}else{var u={subscriber:s,context:a},l={bufferTimeSpan:n,bufferCreationInterval:r,subscriber:s,scheduler:i};s.add(a.closeAction=i.schedule(st,n,u)),s.add(i.schedule(it,r,l))}return s}return r.__extends(e,t),e.prototype._next=function(t){for(var e,n=this.contexts,r=n.length,o=0;o<r;o++){var i=n[o],s=i.buffer;s.push(t),s.length==this.maxBufferSize&&(e=i)}e&&this.onBufferFull(e)},e.prototype._error=function(e){this.contexts.length=0,t.prototype._error.call(this,e)},e.prototype._complete=function(){for(var e=this.contexts,n=this.destination;e.length>0;){var r=e.shift();n.next(r.buffer)}t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){this.contexts=null},e.prototype.onBufferFull=function(t){this.closeContext(t);var e=t.closeAction;if(e.unsubscribe(),this.remove(e),!this.closed&&this.timespanOnly){t=this.openContext();var n=this.bufferTimeSpan,r={subscriber:this,context:t,bufferTimeSpan:n};this.add(t.closeAction=this.scheduler.schedule(ot,n,r))}},e.prototype.openContext=function(){var t=new nt;return this.contexts.push(t),t},e.prototype.closeContext=function(t){this.destination.next(t.buffer);var e=this.contexts;(e?e.indexOf(t):-1)>=0&&e.splice(e.indexOf(t),1)},e}(v);function ot(t){var e=t.subscriber,n=t.context;n&&e.closeContext(n),e.closed||(t.context=e.openContext(),t.context.closeAction=this.schedule(t,t.bufferTimeSpan))}function it(t){var e=t.bufferCreationInterval,n=t.bufferTimeSpan,r=t.subscriber,o=t.scheduler,i=r.openContext();r.closed||(r.add(i.closeAction=o.schedule(st,n,{subscriber:r,context:i})),this.schedule(t,e))}function st(t){var e=t.subscriber,n=t.context;e.closeContext(n)}function at(t,e){return function(n){return n.lift(new ct(t,e))}}var ct=function(){function t(t,e){this.openings=t,this.closingSelector=e}return t.prototype.call=function(t,e){return e.subscribe(new ut(t,this.openings,this.closingSelector))},t}(),ut=function(t){function e(e,n,r){var o=t.call(this,e)||this;return o.openings=n,o.closingSelector=r,o.contexts=[],o.add(z(o,n)),o}return r.__extends(e,t),e.prototype._next=function(t){for(var e=this.contexts,n=e.length,r=0;r<n;r++)e[r].buffer.push(t)},e.prototype._error=function(e){for(var n=this.contexts;n.length>0;){var r=n.shift();r.subscription.unsubscribe(),r.buffer=null,r.subscription=null}this.contexts=null,t.prototype._error.call(this,e)},e.prototype._complete=function(){for(var e=this.contexts;e.length>0;){var n=e.shift();this.destination.next(n.buffer),n.subscription.unsubscribe(),n.buffer=null,n.subscription=null}this.contexts=null,t.prototype._complete.call(this)},e.prototype.notifyNext=function(t,e,n,r,o){t?this.closeBuffer(t):this.openBuffer(e)},e.prototype.notifyComplete=function(t){this.closeBuffer(t.context)},e.prototype.openBuffer=function(t){try{var e=this.closingSelector.call(this,t);e&&this.trySubscribe(e)}catch(t){this._error(t)}},e.prototype.closeBuffer=function(t){var e=this.contexts;if(e&&t){var n=t.buffer,r=t.subscription;this.destination.next(n),e.splice(e.indexOf(t),1),this.remove(r),r.unsubscribe()}},e.prototype.trySubscribe=function(t){var e=this.contexts,n=new f,r={buffer:[],subscription:n};e.push(r);var o=z(this,t,r);!o||o.closed?this.closeBuffer(r):(o.context=r,this.add(o),n.add(o))},e}(y);function lt(t){return function(e){return e.lift(new dt(t))}}var dt=function(){function t(t){this.closingSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new pt(t,this.closingSelector))},t}(),pt=function(t){function e(e,n){var r=t.call(this,e)||this;return r.closingSelector=n,r.subscribing=!1,r.openBuffer(),r}return r.__extends(e,t),e.prototype._next=function(t){this.buffer.push(t)},e.prototype._complete=function(){var e=this.buffer;e&&this.destination.next(e),t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){this.buffer=null,this.subscribing=!1},e.prototype.notifyNext=function(t,e,n,r,o){this.openBuffer()},e.prototype.notifyComplete=function(){this.subscribing?this.complete():this.openBuffer()},e.prototype.openBuffer=function(){var t=this.closingSubscription;t&&(this.remove(t),t.unsubscribe());var e,n=this.buffer;this.buffer&&this.destination.next(n),this.buffer=[];try{e=(0,this.closingSelector)()}catch(t){return this.error(t)}t=new f,this.closingSubscription=t,this.add(t),this.subscribing=!0,t.add(z(this,e)),this.subscribing=!1},e}(y);function ft(t){return function(e){var n=new ht(t),r=e.lift(n);return n.caught=r}}var ht=function(){function t(t){this.selector=t}return t.prototype.call=function(t,e){return e.subscribe(new mt(t,this.selector,this.caught))},t}(),mt=function(t){function e(e,n,r){var o=t.call(this,e)||this;return o.selector=n,o.caught=r,o}return r.__extends(e,t),e.prototype.error=function(e){if(!this.isStopped){var n=void 0;try{n=this.selector(e,this.caught)}catch(e){return void t.prototype.error.call(this,e)}this._unsubscribeAndRecycle();var r=new b(this,void 0,void 0);this.add(r),z(this,n,void 0,void 0,r)}},e}(y);function vt(t,e){return new C(e?function(n){var r=new f,o=0;return r.add(e.schedule((function(){o!==t.length?(n.next(t[o++]),n.closed||r.add(this.schedule())):n.complete()}))),r}:T(t))}var gt={};var yt=function(){function t(t){this.resultSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new bt(t,this.resultSelector))},t}(),bt=function(t){function e(e,n){var r=t.call(this,e)||this;return r.resultSelector=n,r.active=0,r.values=[],r.observables=[],r}return r.__extends(e,t),e.prototype._next=function(t){this.values.push(gt),this.observables.push(t)},e.prototype._complete=function(){var t=this.observables,e=t.length;if(0===e)this.destination.complete();else{this.active=e,this.toRespond=e;for(var n=0;n<e;n++){var r=t[n];this.add(z(this,r,r,n))}}},e.prototype.notifyComplete=function(t){0==(this.active-=1)&&this.destination.complete()},e.prototype.notifyNext=function(t,e,n,r,o){var i=this.values,s=i[n],a=this.toRespond?s===gt?--this.toRespond:this.toRespond:0;i[n]=e,0===a&&(this.resultSelector?this._tryResultSelector(i):this.destination.next(i.slice()))},e.prototype._tryResultSelector=function(t){var e;try{e=this.resultSelector.apply(this,t)}catch(t){return void this.destination.error(t)}this.destination.next(e)},e}(y);function wt(t){return function(e){return e.lift(new yt(t))}}function _t(t,e){if(!e)return t instanceof C?t:new C(B(t));if(null!=t){if(function(t){return t&&"function"==typeof t[w]}(t))return function(t,e){return new C(e?function(n){var r=new f;return r.add(e.schedule((function(){var o=t[w]();r.add(o.subscribe({next:function(t){r.add(e.schedule((function(){return n.next(t)})))},error:function(t){r.add(e.schedule((function(){return n.error(t)})))},complete:function(){r.add(e.schedule((function(){return n.complete()})))}}))}))),r}:I(t))}(t,e);if(N(t))return function(t,e){return new C(e?function(n){var r=new f;return r.add(e.schedule((function(){return t.then((function(t){r.add(e.schedule((function(){n.next(t),r.add(e.schedule((function(){return n.complete()})))})))}),(function(t){r.add(e.schedule((function(){return n.error(t)})))}))}))),r}:E(t))}(t,e);if(A(t))return vt(t,e);if(function(t){return t&&"function"==typeof t[O]}(t)||"string"==typeof t)return function(t,e){if(!t)throw new Error("Iterable cannot be null");return new C(e?function(n){var r,o=new f;return o.add((function(){r&&"function"==typeof r.return&&r.return()})),o.add(e.schedule((function(){r=t[O](),o.add(e.schedule((function(){if(!n.closed){var t,e;try{var o=r.next();t=o.value,e=o.done}catch(t){return void n.error(t)}e?n.complete():(n.next(t),this.schedule())}})))}))),o}:D(t))}(t,e)}throw new TypeError((null!==t&&typeof t||t)+" is not observable")}function xt(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=null;return"function"==typeof t[t.length-1]&&(n=t.pop()),1===t.length&&u(t[0])&&(t=t[0].slice()),function(e){return e.lift.call(_t([e].concat(t)),new yt(n))}}var kt=new C((function(t){return t.complete()}));function Ct(t){return t?function(t){return new C((function(e){return t.schedule((function(){return e.complete()}))}))}(t):kt}function St(t){var e=new C((function(e){e.next(t),e.complete()}));return e._isScalar=!0,e.value=t,e}function Tt(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t[t.length-1];switch(H(n)?t.pop():n=void 0,t.length){case 0:return Ct(n);case 1:return n?vt(t,n):St(t[0]);default:return vt(t,n)}}function Et(t,e){return function(n){if("function"!=typeof t)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return n.lift(new Mt(t,e))}}var Mt=function(){function t(t,e){this.project=t,this.thisArg=e}return t.prototype.call=function(t,e){return e.subscribe(new Ot(t,this.project,this.thisArg))},t}(),Ot=function(t){function e(e,n,r){var o=t.call(this,e)||this;return o.project=n,o.count=0,o.thisArg=r||o,o}return r.__extends(e,t),e.prototype._next=function(t){var e;try{e=this.project.call(this.thisArg,t,this.count++)}catch(t){return void this.destination.error(t)}this.destination.next(e)},e}(v);function Dt(t,e,n){return void 0===n&&(n=Number.POSITIVE_INFINITY),"function"==typeof e?function(r){return r.pipe(Dt((function(n,r){return _t(t(n,r)).pipe(Et((function(t,o){return e(n,t,r,o)})))}),n))}:("number"==typeof e&&(n=e),function(e){return e.lift(new It(t,n))})}var It=function(){function t(t,e){void 0===e&&(e=Number.POSITIVE_INFINITY),this.project=t,this.concurrent=e}return t.prototype.call=function(t,e){return e.subscribe(new At(t,this.project,this.concurrent))},t}(),At=function(t){function e(e,n,r){void 0===r&&(r=Number.POSITIVE_INFINITY);var o=t.call(this,e)||this;return o.project=n,o.concurrent=r,o.hasCompleted=!1,o.buffer=[],o.active=0,o.index=0,o}return r.__extends(e,t),e.prototype._next=function(t){this.active<this.concurrent?this._tryNext(t):this.buffer.push(t)},e.prototype._tryNext=function(t){var e,n=this.index++;try{e=this.project(t,n)}catch(t){return void this.destination.error(t)}this.active++,this._innerSub(e,t,n)},e.prototype._innerSub=function(t,e,n){var r=new b(this,void 0,void 0);this.destination.add(r),z(this,t,e,n,r)},e.prototype._complete=function(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&this.destination.complete(),this.unsubscribe()},e.prototype.notifyNext=function(t,e,n,r,o){this.destination.next(e)},e.prototype.notifyComplete=function(t){var e=this.buffer;this.remove(t),this.active--,e.length>0?this._next(e.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},e}(y);function Nt(t){return t}function Bt(t){return void 0===t&&(t=Number.POSITIVE_INFINITY),Dt(Nt,t)}function zt(){return Bt(1)}function Pt(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return zt()(Tt.apply(void 0,t))}function Rt(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return e.lift.call(Pt.apply(void 0,[e].concat(t)))}}function Ft(t,e){return Dt(t,e,1)}function Lt(t,e){return Ft((function(){return t}),e)}function Vt(t){return function(e){return e.lift(new jt(t,e))}}var jt=function(){function t(t,e){this.predicate=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new $t(t,this.predicate,this.source))},t}(),$t=function(t){function e(e,n,r){var o=t.call(this,e)||this;return o.predicate=n,o.source=r,o.count=0,o.index=0,o}return r.__extends(e,t),e.prototype._next=function(t){this.predicate?this._tryPredicate(t):this.count++},e.prototype._tryPredicate=function(t){var e;try{e=this.predicate(t,this.index++,this.source)}catch(t){return void this.destination.error(t)}e&&this.count++},e.prototype._complete=function(){this.destination.next(this.count),this.destination.complete()},e}(v);function Wt(t){return function(e){return e.lift(new Ht(t))}}var Ht=function(){function t(t){this.durationSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new qt(t,this.durationSelector))},t}(),qt=function(t){function e(e,n){var r=t.call(this,e)||this;return r.durationSelector=n,r.hasValue=!1,r.durationSubscription=null,r}return r.__extends(e,t),e.prototype._next=function(t){try{var e=this.durationSelector.call(this,t);e&&this._tryNext(t,e)}catch(t){this.destination.error(t)}},e.prototype._complete=function(){this.emitValue(),this.destination.complete()},e.prototype._tryNext=function(t,e){var n=this.durationSubscription;this.value=t,this.hasValue=!0,n&&(n.unsubscribe(),this.remove(n)),(n=z(this,e))&&!n.closed&&this.add(this.durationSubscription=n)},e.prototype.notifyNext=function(t,e,n,r,o){this.emitValue()},e.prototype.notifyComplete=function(){this.emitValue()},e.prototype.emitValue=function(){if(this.hasValue){var e=this.value,n=this.durationSubscription;n&&(this.durationSubscription=null,n.unsubscribe(),this.remove(n)),this.value=null,this.hasValue=!1,t.prototype._next.call(this,e)}},e}(y);function Jt(t,e){return void 0===e&&(e=$),function(n){return n.lift(new Kt(t,e))}}var Kt=function(){function t(t,e){this.dueTime=t,this.scheduler=e}return t.prototype.call=function(t,e){return e.subscribe(new Ut(t,this.dueTime,this.scheduler))},t}(),Ut=function(t){function e(e,n,r){var o=t.call(this,e)||this;return o.dueTime=n,o.scheduler=r,o.debouncedSubscription=null,o.lastValue=null,o.hasValue=!1,o}return r.__extends(e,t),e.prototype._next=function(t){this.clearDebounce(),this.lastValue=t,this.hasValue=!0,this.add(this.debouncedSubscription=this.scheduler.schedule(Gt,this.dueTime,this))},e.prototype._complete=function(){this.debouncedNext(),this.destination.complete()},e.prototype.debouncedNext=function(){if(this.clearDebounce(),this.hasValue){var t=this.lastValue;this.lastValue=null,this.hasValue=!1,this.destination.next(t)}},e.prototype.clearDebounce=function(){var t=this.debouncedSubscription;null!==t&&(this.remove(t),t.unsubscribe(),this.debouncedSubscription=null)},e}(v);function Gt(t){t.debouncedNext()}function Yt(t){return void 0===t&&(t=null),function(e){return e.lift(new Zt(t))}}var Xt,Zt=function(){function t(t){this.defaultValue=t}return t.prototype.call=function(t,e){return e.subscribe(new Qt(t,this.defaultValue))},t}(),Qt=function(t){function e(e,n){var r=t.call(this,e)||this;return r.defaultValue=n,r.isEmpty=!0,r}return r.__extends(e,t),e.prototype._next=function(t){this.isEmpty=!1,this.destination.next(t)},e.prototype._complete=function(){this.isEmpty&&this.destination.next(this.defaultValue),this.destination.complete()},e}(v);function te(t){return t instanceof Date&&!isNaN(+t)}function ee(t,e){return new C(e?function(n){return e.schedule(ne,0,{error:t,subscriber:n})}:function(e){return e.error(t)})}function ne(t){var e=t.error;t.subscriber.error(e)}Xt||(Xt={});var re=function(){function t(t,e,n){this.kind=t,this.value=e,this.error=n,this.hasValue="N"===t}return t.prototype.observe=function(t){switch(this.kind){case"N":return t.next&&t.next(this.value);case"E":return t.error&&t.error(this.error);case"C":return t.complete&&t.complete()}},t.prototype.do=function(t,e,n){switch(this.kind){case"N":return t&&t(this.value);case"E":return e&&e(this.error);case"C":return n&&n()}},t.prototype.accept=function(t,e,n){return t&&"function"==typeof t.next?this.observe(t):this.do(t,e,n)},t.prototype.toObservable=function(){switch(this.kind){case"N":return Tt(this.value);case"E":return ee(this.error);case"C":return Ct()}throw new Error("unexpected notification kind value")},t.createNext=function(e){return void 0!==e?new t("N",e):t.undefinedValueNotification},t.createError=function(e){return new t("E",void 0,e)},t.createComplete=function(){return t.completeNotification},t.completeNotification=new t("C"),t.undefinedValueNotification=new t("N",void 0),t}();function oe(t,e){void 0===e&&(e=$);var n=te(t)?+t-e.now():Math.abs(t);return function(t){return t.lift(new ie(n,e))}}var ie=function(){function t(t,e){this.delay=t,this.scheduler=e}return t.prototype.call=function(t,e){return e.subscribe(new se(t,this.delay,this.scheduler))},t}(),se=function(t){function e(e,n,r){var o=t.call(this,e)||this;return o.delay=n,o.scheduler=r,o.queue=[],o.active=!1,o.errored=!1,o}return r.__extends(e,t),e.dispatch=function(t){for(var e=t.source,n=e.queue,r=t.scheduler,o=t.destination;n.length>0&&n[0].time-r.now()<=0;)n.shift().notification.observe(o);if(n.length>0){var i=Math.max(0,n[0].time-r.now());this.schedule(t,i)}else this.unsubscribe(),e.active=!1},e.prototype._schedule=function(t){this.active=!0,this.destination.add(t.schedule(e.dispatch,this.delay,{source:this,destination:this.destination,scheduler:t}))},e.prototype.scheduleNotification=function(t){if(!0!==this.errored){var e=this.scheduler,n=new ae(e.now()+this.delay,t);this.queue.push(n),!1===this.active&&this._schedule(e)}},e.prototype._next=function(t){this.scheduleNotification(re.createNext(t))},e.prototype._error=function(t){this.errored=!0,this.queue=[],this.destination.error(t),this.unsubscribe()},e.prototype._complete=function(){this.scheduleNotification(re.createComplete()),this.unsubscribe()},e}(v),ae=function(){return function(t,e){this.time=t,this.notification=e}}();function ce(t,e){return e?function(n){return new de(n,e).lift(new ue(t))}:function(e){return e.lift(new ue(t))}}var ue=function(){function t(t){this.delayDurationSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new le(t,this.delayDurationSelector))},t}(),le=function(t){function e(e,n){var r=t.call(this,e)||this;return r.delayDurationSelector=n,r.completed=!1,r.delayNotifierSubscriptions=[],r.index=0,r}return r.__extends(e,t),e.prototype.notifyNext=function(t,e,n,r,o){this.destination.next(t),this.removeSubscription(o),this.tryComplete()},e.prototype.notifyError=function(t,e){this._error(t)},e.prototype.notifyComplete=function(t){var e=this.removeSubscription(t);e&&this.destination.next(e),this.tryComplete()},e.prototype._next=function(t){var e=this.index++;try{var n=this.delayDurationSelector(t,e);n&&this.tryDelay(n,t)}catch(t){this.destination.error(t)}},e.prototype._complete=function(){this.completed=!0,this.tryComplete(),this.unsubscribe()},e.prototype.removeSubscription=function(t){t.unsubscribe();var e=this.delayNotifierSubscriptions.indexOf(t);return-1!==e&&this.delayNotifierSubscriptions.splice(e,1),t.outerValue},e.prototype.tryDelay=function(t,e){var n=z(this,t,e);n&&!n.closed&&(this.destination.add(n),this.delayNotifierSubscriptions.push(n))},e.prototype.tryComplete=function(){this.completed&&0===this.delayNotifierSubscriptions.length&&this.destination.complete()},e}(y),de=function(t){function e(e,n){var r=t.call(this)||this;return r.source=e,r.subscriptionDelay=n,r}return r.__extends(e,t),e.prototype._subscribe=function(t){this.subscriptionDelay.subscribe(new pe(t,this.source))},e}(C),pe=function(t){function e(e,n){var r=t.call(this)||this;return r.parent=e,r.source=n,r.sourceSubscribed=!1,r}return r.__extends(e,t),e.prototype._next=function(t){this.subscribeToSource()},e.prototype._error=function(t){this.unsubscribe(),this.parent.error(t)},e.prototype._complete=function(){this.unsubscribe(),this.subscribeToSource()},e.prototype.subscribeToSource=function(){this.sourceSubscribed||(this.sourceSubscribed=!0,this.unsubscribe(),this.source.subscribe(this.parent))},e}(v);function fe(){return function(t){return t.lift(new he)}}var he=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new me(t))},t}(),me=function(t){function e(e){return t.call(this,e)||this}return r.__extends(e,t),e.prototype._next=function(t){t.observe(this.destination)},e}(v);function ve(t,e){return function(n){return n.lift(new ge(t,e))}}var ge=function(){function t(t,e){this.keySelector=t,this.flushes=e}return t.prototype.call=function(t,e){return e.subscribe(new ye(t,this.keySelector,this.flushes))},t}(),ye=function(t){function e(e,n,r){var o=t.call(this,e)||this;return o.keySelector=n,o.values=new Set,r&&o.add(z(o,r)),o}return r.__extends(e,t),e.prototype.notifyNext=function(t,e,n,r,o){this.values.clear()},e.prototype.notifyError=function(t,e){this._error(t)},e.prototype._next=function(t){this.keySelector?this._useKeySelector(t):this._finalizeNext(t,t)},e.prototype._useKeySelector=function(t){var e,n=this.destination;try{e=this.keySelector(t)}catch(t){return void n.error(t)}this._finalizeNext(e,t)},e.prototype._finalizeNext=function(t,e){var n=this.values;n.has(t)||(n.add(t),this.destination.next(e))},e}(y);function be(t,e){return function(n){return n.lift(new we(t,e))}}var we=function(){function t(t,e){this.compare=t,this.keySelector=e}return t.prototype.call=function(t,e){return e.subscribe(new _e(t,this.compare,this.keySelector))},t}(),_e=function(t){function e(e,n,r){var o=t.call(this,e)||this;return o.keySelector=r,o.hasKey=!1,"function"==typeof n&&(o.compare=n),o}return r.__extends(e,t),e.prototype.compare=function(t,e){return t===e},e.prototype._next=function(t){var e;try{var n=this.keySelector;e=n?n(t):t}catch(t){return this.destination.error(t)}var r=!1;if(this.hasKey)try{r=(0,this.compare)(this.key,e)}catch(t){return this.destination.error(t)}else this.hasKey=!0;r||(this.key=e,this.destination.next(t))},e}(v);function xe(t,e){return be((function(n,r){return e?e(n[t],r[t]):n[t]===r[t]}))}function ke(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}ke.prototype=Object.create(Error.prototype);var Ce=ke;function Se(t,e){return function(n){return n.lift(new Te(t,e))}}var Te=function(){function t(t,e){this.predicate=t,this.thisArg=e}return t.prototype.call=function(t,e){return e.subscribe(new Ee(t,this.predicate,this.thisArg))},t}(),Ee=function(t){function e(e,n,r){var o=t.call(this,e)||this;return o.predicate=n,o.thisArg=r,o.count=0,o}return r.__extends(e,t),e.prototype._next=function(t){var e;try{e=this.predicate.call(this.thisArg,t,this.count++)}catch(t){return void this.destination.error(t)}e&&this.destination.next(t)},e}(v);function Me(t,e,n){return function(r){return r.lift(new Oe(t,e,n))}}var Oe=function(){function t(t,e,n){this.nextOrObserver=t,this.error=e,this.complete=n}return t.prototype.call=function(t,e){return e.subscribe(new De(t,this.nextOrObserver,this.error,this.complete))},t}(),De=function(t){function e(e,n,r,i){var s=t.call(this,e)||this;return s._tapNext=_,s._tapError=_,s._tapComplete=_,s._tapError=r||_,s._tapComplete=i||_,o(n)?(s._context=s,s._tapNext=n):n&&(s._context=n,s._tapNext=n.next||_,s._tapError=n.error||_,s._tapComplete=n.complete||_),s}return r.__extends(e,t),e.prototype._next=function(t){try{this._tapNext.call(this._context,t)}catch(t){return void this.destination.error(t)}this.destination.next(t)},e.prototype._error=function(t){try{this._tapError.call(this._context,t)}catch(t){return void this.destination.error(t)}this.destination.error(t)},e.prototype._complete=function(){try{this._tapComplete.call(this._context)}catch(t){return void this.destination.error(t)}return this.destination.complete()},e}(v);function Ie(){return Error.call(this),this.message="no elements in sequence",this.name="EmptyError",this}Ie.prototype=Object.create(Error.prototype);var Ae=Ie,Ne=function(t){return void 0===t&&(t=Be),Me({hasValue:!1,next:function(){this.hasValue=!0},complete:function(){if(!this.hasValue)throw t()}})};function Be(){return new Ae}function ze(t){return function(e){return 0===t?Ct():e.lift(new Pe(t))}}var Pe=function(){function t(t){if(this.total=t,this.total<0)throw new Ce}return t.prototype.call=function(t,e){return e.subscribe(new Re(t,this.total))},t}(),Re=function(t){function e(e,n){var r=t.call(this,e)||this;return r.total=n,r.count=0,r}return r.__extends(e,t),e.prototype._next=function(t){var e=this.total,n=++this.count;n<=e&&(this.destination.next(t),n===e&&(this.destination.complete(),this.unsubscribe()))},e}(v);function Fe(t,e){if(t<0)throw new Ce;var n=arguments.length>=2;return function(r){return r.pipe(Se((function(e,n){return n===t})),ze(1),n?Yt(e):Ne((function(){return new Ce})))}}function Le(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){var n=t[t.length-1];H(n)?t.pop():n=null;var r=t.length;return Pt(e,1!==r||n?r>0?vt(t,n):Ct(n):St(t[0]))}}function Ve(t,e){return function(n){return n.lift(new je(t,e,n))}}var je=function(){function t(t,e,n){this.predicate=t,this.thisArg=e,this.source=n}return t.prototype.call=function(t,e){return e.subscribe(new $e(t,this.predicate,this.thisArg,this.source))},t}(),$e=function(t){function e(e,n,r,o){var i=t.call(this,e)||this;return i.predicate=n,i.thisArg=r,i.source=o,i.index=0,i.thisArg=r||i,i}return r.__extends(e,t),e.prototype.notifyComplete=function(t){this.destination.next(t),this.destination.complete()},e.prototype._next=function(t){var e=!1;try{e=this.predicate.call(this.thisArg,t,this.index++,this.source)}catch(t){return void this.destination.error(t)}e||this.notifyComplete(!1)},e.prototype._complete=function(){this.notifyComplete(!0)},e}(v);function We(){return function(t){return t.lift(new He)}}var He=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new qe(t))},t}(),qe=function(t){function e(e){var n=t.call(this,e)||this;return n.hasCompleted=!1,n.hasSubscription=!1,n}return r.__extends(e,t),e.prototype._next=function(t){this.hasSubscription||(this.hasSubscription=!0,this.add(z(this,t)))},e.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete()},e.prototype.notifyComplete=function(t){this.remove(t),this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},e}(y);function Je(t,e){return e?function(n){return n.pipe(Je((function(n,r){return _t(t(n,r)).pipe(Et((function(t,o){return e(n,t,r,o)})))})))}:function(e){return e.lift(new Ke(t))}}var Ke=function(){function t(t){this.project=t}return t.prototype.call=function(t,e){return e.subscribe(new Ue(t,this.project))},t}(),Ue=function(t){function e(e,n){var r=t.call(this,e)||this;return r.project=n,r.hasSubscription=!1,r.hasCompleted=!1,r.index=0,r}return r.__extends(e,t),e.prototype._next=function(t){this.hasSubscription||this.tryNext(t)},e.prototype.tryNext=function(t){var e,n=this.index++;try{e=this.project(t,n)}catch(t){return void this.destination.error(t)}this.hasSubscription=!0,this._innerSub(e,t,n)},e.prototype._innerSub=function(t,e,n){var r=new b(this,void 0,void 0);this.destination.add(r),z(this,t,e,n,r)},e.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete(),this.unsubscribe()},e.prototype.notifyNext=function(t,e,n,r,o){this.destination.next(e)},e.prototype.notifyError=function(t){this.destination.error(t)},e.prototype.notifyComplete=function(t){this.destination.remove(t),this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},e}(y);function Ge(t,e,n){return void 0===e&&(e=Number.POSITIVE_INFINITY),void 0===n&&(n=void 0),e=(e||0)<1?Number.POSITIVE_INFINITY:e,function(r){return r.lift(new Ye(t,e,n))}}var Ye=function(){function t(t,e,n){this.project=t,this.concurrent=e,this.scheduler=n}return t.prototype.call=function(t,e){return e.subscribe(new Xe(t,this.project,this.concurrent,this.scheduler))},t}(),Xe=function(t){function e(e,n,r,o){var i=t.call(this,e)||this;return i.project=n,i.concurrent=r,i.scheduler=o,i.index=0,i.active=0,i.hasCompleted=!1,r<Number.POSITIVE_INFINITY&&(i.buffer=[]),i}return r.__extends(e,t),e.dispatch=function(t){var e=t.subscriber,n=t.result,r=t.value,o=t.index;e.subscribeToProjection(n,r,o)},e.prototype._next=function(t){var n=this.destination;if(n.closed)this._complete();else{var r=this.index++;if(this.active<this.concurrent){n.next(t);try{var o=(0,this.project)(t,r);if(this.scheduler){var i={subscriber:this,result:o,value:t,index:r};this.destination.add(this.scheduler.schedule(e.dispatch,0,i))}else this.subscribeToProjection(o,t,r)}catch(t){n.error(t)}}else this.buffer.push(t)}},e.prototype.subscribeToProjection=function(t,e,n){this.active++,this.destination.add(z(this,t,e,n))},e.prototype._complete=function(){this.hasCompleted=!0,this.hasCompleted&&0===this.active&&this.destination.complete(),this.unsubscribe()},e.prototype.notifyNext=function(t,e,n,r,o){this._next(e)},e.prototype.notifyComplete=function(t){var e=this.buffer;this.destination.remove(t),this.active--,e&&e.length>0&&this._next(e.shift()),this.hasCompleted&&0===this.active&&this.destination.complete()},e}(y);function Ze(t){return function(e){return e.lift(new Qe(t))}}var Qe=function(){function t(t){this.callback=t}return t.prototype.call=function(t,e){return e.subscribe(new tn(t,this.callback))},t}(),tn=function(t){function e(e,n){var r=t.call(this,e)||this;return r.add(new f(n)),r}return r.__extends(e,t),e}(v);function en(t,e){if("function"!=typeof t)throw new TypeError("predicate is not a function");return function(n){return n.lift(new nn(t,n,!1,e))}}var nn=function(){function t(t,e,n,r){this.predicate=t,this.source=e,this.yieldIndex=n,this.thisArg=r}return t.prototype.call=function(t,e){return e.subscribe(new rn(t,this.predicate,this.source,this.yieldIndex,this.thisArg))},t}(),rn=function(t){function e(e,n,r,o,i){var s=t.call(this,e)||this;return s.predicate=n,s.source=r,s.yieldIndex=o,s.thisArg=i,s.index=0,s}return r.__extends(e,t),e.prototype.notifyComplete=function(t){var e=this.destination;e.next(t),e.complete(),this.unsubscribe()},e.prototype._next=function(t){var e=this.predicate,n=this.thisArg,r=this.index++;try{e.call(n||this,t,r,this.source)&&this.notifyComplete(this.yieldIndex?r:t)}catch(t){this.destination.error(t)}},e.prototype._complete=function(){this.notifyComplete(this.yieldIndex?-1:void 0)},e}(v);function on(t,e){return function(n){return n.lift(new nn(t,n,!0,e))}}function sn(t,e){var n=arguments.length>=2;return function(r){return r.pipe(t?Se((function(e,n){return t(e,n,r)})):Nt,ze(1),n?Yt(e):Ne((function(){return new Ae})))}}function an(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}an.prototype=Object.create(Error.prototype);var cn=an,un=function(t){function e(e,n){var r=t.call(this)||this;return r.subject=e,r.subscriber=n,r.closed=!1,r}return r.__extends(e,t),e.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var t=this.subject,e=t.observers;if(this.subject=null,e&&0!==e.length&&!t.isStopped&&!t.closed){var n=e.indexOf(this.subscriber);-1!==n&&e.splice(n,1)}}},e}(f),ln=function(t){function e(e){var n=t.call(this,e)||this;return n.destination=e,n}return r.__extends(e,t),e}(v),dn=function(t){function e(){var e=t.call(this)||this;return e.observers=[],e.closed=!1,e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return r.__extends(e,t),e.prototype[m]=function(){return new ln(this)},e.prototype.lift=function(t){var e=new pn(this,this);return e.operator=t,e},e.prototype.next=function(t){if(this.closed)throw new cn;if(!this.isStopped)for(var e=this.observers,n=e.length,r=e.slice(),o=0;o<n;o++)r[o].next(t)},e.prototype.error=function(t){if(this.closed)throw new cn;this.hasError=!0,this.thrownError=t,this.isStopped=!0;for(var e=this.observers,n=e.length,r=e.slice(),o=0;o<n;o++)r[o].error(t);this.observers.length=0},e.prototype.complete=function(){if(this.closed)throw new cn;this.isStopped=!0;for(var t=this.observers,e=t.length,n=t.slice(),r=0;r<e;r++)n[r].complete();this.observers.length=0},e.prototype.unsubscribe=function(){this.isStopped=!0,this.closed=!0,this.observers=null},e.prototype._trySubscribe=function(e){if(this.closed)throw new cn;return t.prototype._trySubscribe.call(this,e)},e.prototype._subscribe=function(t){if(this.closed)throw new cn;return this.hasError?(t.error(this.thrownError),f.EMPTY):this.isStopped?(t.complete(),f.EMPTY):(this.observers.push(t),new un(this,t))},e.prototype.asObservable=function(){var t=new C;return t.source=this,t},e.create=function(t,e){return new pn(t,e)},e}(C),pn=function(t){function e(e,n){var r=t.call(this)||this;return r.destination=e,r.source=n,r}return r.__extends(e,t),e.prototype.next=function(t){var e=this.destination;e&&e.next&&e.next(t)},e.prototype.error=function(t){var e=this.destination;e&&e.error&&this.destination.error(t)},e.prototype.complete=function(){var t=this.destination;t&&t.complete&&this.destination.complete()},e.prototype._subscribe=function(t){return this.source?this.source.subscribe(t):f.EMPTY},e}(dn);function fn(t,e,n,r){return function(o){return o.lift(new hn(t,e,n,r))}}var hn=function(){function t(t,e,n,r){this.keySelector=t,this.elementSelector=e,this.durationSelector=n,this.subjectSelector=r}return t.prototype.call=function(t,e){return e.subscribe(new mn(t,this.keySelector,this.elementSelector,this.durationSelector,this.subjectSelector))},t}(),mn=function(t){function e(e,n,r,o,i){var s=t.call(this,e)||this;return s.keySelector=n,s.elementSelector=r,s.durationSelector=o,s.subjectSelector=i,s.groups=null,s.attemptedToUnsubscribe=!1,s.count=0,s}return r.__extends(e,t),e.prototype._next=function(t){var e;try{e=this.keySelector(t)}catch(t){return void this.error(t)}this._group(t,e)},e.prototype._group=function(t,e){var n=this.groups;n||(n=this.groups=new Map);var r,o=n.get(e);if(this.elementSelector)try{r=this.elementSelector(t)}catch(t){this.error(t)}else r=t;if(!o){o=this.subjectSelector?this.subjectSelector():new dn,n.set(e,o);var i=new gn(e,o,this);if(this.destination.next(i),this.durationSelector){var s=void 0;try{s=this.durationSelector(new gn(e,o))}catch(t){return void this.error(t)}this.add(s.subscribe(new vn(e,o,this)))}}o.closed||o.next(r)},e.prototype._error=function(t){var e=this.groups;e&&(e.forEach((function(e,n){e.error(t)})),e.clear()),this.destination.error(t)},e.prototype._complete=function(){var t=this.groups;t&&(t.forEach((function(t,e){t.complete()})),t.clear()),this.destination.complete()},e.prototype.removeGroup=function(t){this.groups.delete(t)},e.prototype.unsubscribe=function(){this.closed||(this.attemptedToUnsubscribe=!0,0===this.count&&t.prototype.unsubscribe.call(this))},e}(v),vn=function(t){function e(e,n,r){var o=t.call(this,n)||this;return o.key=e,o.group=n,o.parent=r,o}return r.__extends(e,t),e.prototype._next=function(t){this.complete()},e.prototype._unsubscribe=function(){var t=this.parent,e=this.key;this.key=this.parent=null,t&&t.removeGroup(e)},e}(v),gn=function(t){function e(e,n,r){var o=t.call(this)||this;return o.key=e,o.groupSubject=n,o.refCountSubscription=r,o}return r.__extends(e,t),e.prototype._subscribe=function(t){var e=new f,n=this.refCountSubscription,r=this.groupSubject;return n&&!n.closed&&e.add(new yn(n)),e.add(r.subscribe(t)),e},e}(C),yn=function(t){function e(e){var n=t.call(this)||this;return n.parent=e,e.count++,n}return r.__extends(e,t),e.prototype.unsubscribe=function(){var e=this.parent;e.closed||this.closed||(t.prototype.unsubscribe.call(this),e.count-=1,0===e.count&&e.attemptedToUnsubscribe&&e.unsubscribe())},e}(f);function bn(){return function(t){return t.lift(new wn)}}var wn=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new _n(t))},t}(),_n=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e.prototype._next=function(t){},e}(v);function xn(){return function(t){return t.lift(new kn)}}var kn=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new Cn(t))},t}(),Cn=function(t){function e(e){return t.call(this,e)||this}return r.__extends(e,t),e.prototype.notifyComplete=function(t){var e=this.destination;e.next(t),e.complete()},e.prototype._next=function(t){this.notifyComplete(!1)},e.prototype._complete=function(){this.notifyComplete(!0)},e}(v);function Sn(t){return function(e){return 0===t?Ct():e.lift(new Tn(t))}}var Tn=function(){function t(t){if(this.total=t,this.total<0)throw new Ce}return t.prototype.call=function(t,e){return e.subscribe(new En(t,this.total))},t}(),En=function(t){function e(e,n){var r=t.call(this,e)||this;return r.total=n,r.ring=new Array,r.count=0,r}return r.__extends(e,t),e.prototype._next=function(t){var e=this.ring,n=this.total,r=this.count++;e.length<n?e.push(t):e[r%n]=t},e.prototype._complete=function(){var t=this.destination,e=this.count;if(e>0)for(var n=this.count>=this.total?this.total:this.count,r=this.ring,o=0;o<n;o++){var i=e++%n;t.next(r[i])}t.complete()},e}(v);function Mn(t,e){var n=arguments.length>=2;return function(r){return r.pipe(t?Se((function(e,n){return t(e,n,r)})):Nt,Sn(1),n?Yt(e):Ne((function(){return new Ae})))}}function On(t){return function(e){return e.lift(new Dn(t))}}var Dn=function(){function t(t){this.value=t}return t.prototype.call=function(t,e){return e.subscribe(new In(t,this.value))},t}(),In=function(t){function e(e,n){var r=t.call(this,e)||this;return r.value=n,r}return r.__extends(e,t),e.prototype._next=function(t){this.destination.next(this.value)},e}(v);function An(){return function(t){return t.lift(new Nn)}}var Nn=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new Bn(t))},t}(),Bn=function(t){function e(e){return t.call(this,e)||this}return r.__extends(e,t),e.prototype._next=function(t){this.destination.next(re.createNext(t))},e.prototype._error=function(t){var e=this.destination;e.next(re.createError(t)),e.complete()},e.prototype._complete=function(){var t=this.destination;t.next(re.createComplete()),t.complete()},e}(v);function zn(t,e){var n=!1;return arguments.length>=2&&(n=!0),function(r){return r.lift(new Pn(t,e,n))}}var Pn=function(){function t(t,e,n){void 0===n&&(n=!1),this.accumulator=t,this.seed=e,this.hasSeed=n}return t.prototype.call=function(t,e){return e.subscribe(new Rn(t,this.accumulator,this.seed,this.hasSeed))},t}(),Rn=function(t){function e(e,n,r,o){var i=t.call(this,e)||this;return i.accumulator=n,i._seed=r,i.hasSeed=o,i.index=0,i}return r.__extends(e,t),Object.defineProperty(e.prototype,"seed",{get:function(){return this._seed},set:function(t){this.hasSeed=!0,this._seed=t},enumerable:!0,configurable:!0}),e.prototype._next=function(t){if(this.hasSeed)return this._tryNext(t);this.seed=t,this.destination.next(t)},e.prototype._tryNext=function(t){var e,n=this.index++;try{e=this.accumulator(this.seed,t,n)}catch(t){this.destination.error(t)}this.seed=e,this.destination.next(e)},e}(v);function Fn(t,e){return arguments.length>=2?function(n){return x(zn(t,e),Sn(1),Yt(e))(n)}:function(e){return x(zn((function(e,n,r){return t(e,n,r+1)})),Sn(1))(e)}}function Ln(t){return Fn("function"==typeof t?function(e,n){return t(e,n)>0?e:n}:function(t,e){return t>e?t:e})}function Vn(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Number.POSITIVE_INFINITY,r=null,o=t[t.length-1];return H(o)?(r=t.pop(),t.length>1&&"number"==typeof t[t.length-1]&&(n=t.pop())):"number"==typeof o&&(n=t.pop()),null===r&&1===t.length&&t[0]instanceof C?t[0]:Bt(n)(vt(t,r))}function jn(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return e.lift.call(Vn.apply(void 0,[e].concat(t)))}}function $n(t,e,n){return void 0===n&&(n=Number.POSITIVE_INFINITY),"function"==typeof e?Dt((function(){return t}),e,n):("number"==typeof e&&(n=e),Dt((function(){return t}),n))}function Wn(t,e,n){return void 0===n&&(n=Number.POSITIVE_INFINITY),function(r){return r.lift(new Hn(t,e,n))}}var Hn=function(){function t(t,e,n){this.accumulator=t,this.seed=e,this.concurrent=n}return t.prototype.call=function(t,e){return e.subscribe(new qn(t,this.accumulator,this.seed,this.concurrent))},t}(),qn=function(t){function e(e,n,r,o){var i=t.call(this,e)||this;return i.accumulator=n,i.acc=r,i.concurrent=o,i.hasValue=!1,i.hasCompleted=!1,i.buffer=[],i.active=0,i.index=0,i}return r.__extends(e,t),e.prototype._next=function(t){if(this.active<this.concurrent){var e=this.index++,n=this.destination,r=void 0;try{r=(0,this.accumulator)(this.acc,t,e)}catch(t){return n.error(t)}this.active++,this._innerSub(r,t,e)}else this.buffer.push(t)},e.prototype._innerSub=function(t,e,n){var r=new b(this,void 0,void 0);this.destination.add(r),z(this,t,e,n,r)},e.prototype._complete=function(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&(!1===this.hasValue&&this.destination.next(this.acc),this.destination.complete()),this.unsubscribe()},e.prototype.notifyNext=function(t,e,n,r,o){var i=this.destination;this.acc=e,this.hasValue=!0,i.next(e)},e.prototype.notifyComplete=function(t){var e=this.buffer;this.destination.remove(t),this.active--,e.length>0?this._next(e.shift()):0===this.active&&this.hasCompleted&&(!1===this.hasValue&&this.destination.next(this.acc),this.destination.complete())},e}(y);function Jn(t){return Fn("function"==typeof t?function(e,n){return t(e,n)<0?e:n}:function(t,e){return t<e?t:e})}function Kn(){return function(t){return t.lift(new Un(t))}}var Un=function(){function t(t){this.connectable=t}return t.prototype.call=function(t,e){var n=this.connectable;n._refCount++;var r=new Gn(t,n),o=e.subscribe(r);return r.closed||(r.connection=n.connect()),o},t}(),Gn=function(t){function e(e,n){var r=t.call(this,e)||this;return r.connectable=n,r}return r.__extends(e,t),e.prototype._unsubscribe=function(){var t=this.connectable;if(t){this.connectable=null;var e=t._refCount;if(e<=0)this.connection=null;else if(t._refCount=e-1,e>1)this.connection=null;else{var n=this.connection,r=t._connection;this.connection=null,!r||n&&r!==n||r.unsubscribe()}}else this.connection=null},e}(v),Yn=function(t){function e(e,n){var r=t.call(this)||this;return r.source=e,r.subjectFactory=n,r._refCount=0,r._isComplete=!1,r}return r.__extends(e,t),e.prototype._subscribe=function(t){return this.getSubject().subscribe(t)},e.prototype.getSubject=function(){var t=this._subject;return t&&!t.isStopped||(this._subject=this.subjectFactory()),this._subject},e.prototype.connect=function(){var t=this._connection;return t||(this._isComplete=!1,(t=this._connection=new f).add(this.source.subscribe(new Zn(this.getSubject(),this))),t.closed?(this._connection=null,t=f.EMPTY):this._connection=t),t},e.prototype.refCount=function(){return Kn()(this)},e}(C).prototype,Xn={operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:Yn._subscribe},_isComplete:{value:Yn._isComplete,writable:!0},getSubject:{value:Yn.getSubject},connect:{value:Yn.connect},refCount:{value:Yn.refCount}},Zn=function(t){function e(e,n){var r=t.call(this,e)||this;return r.connectable=n,r}return r.__extends(e,t),e.prototype._error=function(e){this._unsubscribe(),t.prototype._error.call(this,e)},e.prototype._complete=function(){this.connectable._isComplete=!0,this._unsubscribe(),t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){var t=this.connectable;if(t){this.connectable=null;var e=t._connection;t._refCount=0,t._subject=null,t._connection=null,e&&e.unsubscribe()}},e}(ln);function Qn(t,e){return function(n){var r;if(r="function"==typeof t?t:function(){return t},"function"==typeof e)return n.lift(new tr(r,e));var o=Object.create(n,Xn);return o.source=n,o.subjectFactory=r,o}}var tr=function(){function t(t,e){this.subjectFactory=t,this.selector=e}return t.prototype.call=function(t,e){var n=this.selector,r=this.subjectFactory(),o=n(r).subscribe(t);return o.add(e.subscribe(r)),o},t}();function er(t,e){return void 0===e&&(e=0),function(n){return n.lift(new nr(t,e))}}var nr=function(){function t(t,e){void 0===e&&(e=0),this.scheduler=t,this.delay=e}return t.prototype.call=function(t,e){return e.subscribe(new rr(t,this.scheduler,this.delay))},t}(),rr=function(t){function e(e,n,r){void 0===r&&(r=0);var o=t.call(this,e)||this;return o.scheduler=n,o.delay=r,o}return r.__extends(e,t),e.dispatch=function(t){var e=t.notification,n=t.destination;e.observe(n),this.unsubscribe()},e.prototype.scheduleMessage=function(t){this.destination.add(this.scheduler.schedule(e.dispatch,this.delay,new or(t,this.destination)))},e.prototype._next=function(t){this.scheduleMessage(re.createNext(t))},e.prototype._error=function(t){this.scheduleMessage(re.createError(t)),this.unsubscribe()},e.prototype._complete=function(){this.scheduleMessage(re.createComplete()),this.unsubscribe()},e}(v),or=function(){return function(t,e){this.notification=t,this.destination=e}}();function ir(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return 1===t.length&&u(t[0])&&(t=t[0]),function(e){return e.lift(new sr(t))}}var sr=function(){function t(t){this.nextSources=t}return t.prototype.call=function(t,e){return e.subscribe(new ar(t,this.nextSources))},t}(),ar=function(t){function e(e,n){var r=t.call(this,e)||this;return r.destination=e,r.nextSources=n,r}return r.__extends(e,t),e.prototype.notifyError=function(t,e){this.subscribeToNextSource()},e.prototype.notifyComplete=function(t){this.subscribeToNextSource()},e.prototype._error=function(t){this.subscribeToNextSource(),this.unsubscribe()},e.prototype._complete=function(){this.subscribeToNextSource(),this.unsubscribe()},e.prototype.subscribeToNextSource=function(){var t=this.nextSources.shift();if(t){var e=new b(this,void 0,void 0);this.destination.add(e),z(this,t,void 0,void 0,e)}else this.destination.complete()},e}(y);function cr(){return function(t){return t.lift(new ur)}}var ur=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new lr(t))},t}(),lr=function(t){function e(e){var n=t.call(this,e)||this;return n.hasPrev=!1,n}return r.__extends(e,t),e.prototype._next=function(t){this.hasPrev?this.destination.next([this.prev,t]):this.hasPrev=!0,this.prev=t},e}(v);function dr(t,e){function n(){return!n.pred.apply(n.thisArg,arguments)}return n.pred=t,n.thisArg=e,n}function pr(t,e){return function(n){return[Se(t,e)(n),Se(dr(t,e))(n)]}}function fr(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t.length;if(0===n)throw new Error("list of properties cannot be empty.");return function(e){return Et(hr(t,n))(e)}}function hr(t,e){return function(n){for(var r=n,o=0;o<e;o++){var i=r[t[o]];if(void 0===i)return;r=i}return r}}function mr(t){return t?Qn((function(){return new dn}),t):Qn(new dn)}var vr=function(t){function e(e){var n=t.call(this)||this;return n._value=e,n}return r.__extends(e,t),Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0}),e.prototype._subscribe=function(e){var n=t.prototype._subscribe.call(this,e);return n&&!n.closed&&e.next(this._value),n},e.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(this.closed)throw new cn;return this._value},e.prototype.next=function(e){t.prototype.next.call(this,this._value=e)},e}(dn);function gr(t){return function(e){return Qn(new vr(t))(e)}}var yr=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.value=null,e.hasNext=!1,e.hasCompleted=!1,e}return r.__extends(e,t),e.prototype._subscribe=function(e){return this.hasError?(e.error(this.thrownError),f.EMPTY):this.hasCompleted&&this.hasNext?(e.next(this.value),e.complete(),f.EMPTY):t.prototype._subscribe.call(this,e)},e.prototype.next=function(t){this.hasCompleted||(this.value=t,this.hasNext=!0)},e.prototype.error=function(e){this.hasCompleted||t.prototype.error.call(this,e)},e.prototype.complete=function(){this.hasCompleted=!0,this.hasNext&&t.prototype.next.call(this,this.value),t.prototype.complete.call(this)},e}(dn);function br(){return function(t){return Qn(new yr)(t)}}var wr=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r}return r.__extends(e,t),e.prototype.schedule=function(e,n){return void 0===n&&(n=0),n>0?t.prototype.schedule.call(this,e,n):(this.delay=n,this.state=e,this.scheduler.flush(this),this)},e.prototype.execute=function(e,n){return n>0||this.closed?t.prototype.execute.call(this,e,n):this._execute(e,n)},e.prototype.requestAsyncId=function(e,n,r){return void 0===r&&(r=0),null!==r&&r>0||null===r&&this.delay>0?t.prototype.requestAsyncId.call(this,e,n,r):e.flush(this)},e}(L),_r=new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(j))(wr),xr=function(t){function e(e,n,r){void 0===e&&(e=Number.POSITIVE_INFINITY),void 0===n&&(n=Number.POSITIVE_INFINITY);var o=t.call(this)||this;return o.scheduler=r,o._events=[],o._infiniteTimeWindow=!1,o._bufferSize=e<1?1:e,o._windowTime=n<1?1:n,n===Number.POSITIVE_INFINITY?(o._infiniteTimeWindow=!0,o.next=o.nextInfiniteTimeWindow):o.next=o.nextTimeWindow,o}return r.__extends(e,t),e.prototype.nextInfiniteTimeWindow=function(e){var n=this._events;n.push(e),n.length>this._bufferSize&&n.shift(),t.prototype.next.call(this,e)},e.prototype.nextTimeWindow=function(e){this._events.push(new kr(this._getNow(),e)),this._trimBufferThenGetEvents(),t.prototype.next.call(this,e)},e.prototype._subscribe=function(t){var e,n=this._infiniteTimeWindow,r=n?this._events:this._trimBufferThenGetEvents(),o=this.scheduler,i=r.length;if(this.closed)throw new cn;if(this.isStopped||this.hasError?e=f.EMPTY:(this.observers.push(t),e=new un(this,t)),o&&t.add(t=new rr(t,o)),n)for(var s=0;s<i&&!t.closed;s++)t.next(r[s]);else for(s=0;s<i&&!t.closed;s++)t.next(r[s].value);return this.hasError?t.error(this.thrownError):this.isStopped&&t.complete(),e},e.prototype._getNow=function(){return(this.scheduler||_r).now()},e.prototype._trimBufferThenGetEvents=function(){for(var t=this._getNow(),e=this._bufferSize,n=this._windowTime,r=this._events,o=r.length,i=0;i<o&&!(t-r[i].time<n);)i++;return o>e&&(i=Math.max(i,o-e)),i>0&&r.splice(0,i),r},e}(dn),kr=function(){return function(t,e){this.time=t,this.value=e}}();function Cr(t,e,n,r){n&&"function"!=typeof n&&(r=n);var o="function"==typeof n?n:void 0,i=new xr(t,e,r);return function(t){return Qn((function(){return i}),o)(t)}}function Sr(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(1===t.length){if(!u(t[0]))return t[0];t=t[0]}return vt(t,void 0).lift(new Tr)}var Tr=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new Er(t))},t}(),Er=function(t){function e(e){var n=t.call(this,e)||this;return n.hasFirst=!1,n.observables=[],n.subscriptions=[],n}return r.__extends(e,t),e.prototype._next=function(t){this.observables.push(t)},e.prototype._complete=function(){var t=this.observables,e=t.length;if(0===e)this.destination.complete();else{for(var n=0;n<e&&!this.hasFirst;n++){var r=t[n],o=z(this,r,r,n);this.subscriptions&&this.subscriptions.push(o),this.add(o)}this.observables=null}},e.prototype.notifyNext=function(t,e,n,r,o){if(!this.hasFirst){this.hasFirst=!0;for(var i=0;i<this.subscriptions.length;i++)if(i!==n){var s=this.subscriptions[i];s.unsubscribe(),this.remove(s)}this.subscriptions=null}this.destination.next(e)},e}(y);function Mr(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return 1===t.length&&u(t[0])&&(t=t[0]),e.lift.call(Sr.apply(void 0,[e].concat(t)))}}function Or(t){return void 0===t&&(t=-1),function(e){return 0===t?Ct():t<0?e.lift(new Dr(-1,e)):e.lift(new Dr(t-1,e))}}var Dr=function(){function t(t,e){this.count=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new Ir(t,this.count,this.source))},t}(),Ir=function(t){function e(e,n,r){var o=t.call(this,e)||this;return o.count=n,o.source=r,o}return r.__extends(e,t),e.prototype.complete=function(){if(!this.isStopped){var e=this.source,n=this.count;if(0===n)return t.prototype.complete.call(this);n>-1&&(this.count=n-1),e.subscribe(this._unsubscribeAndRecycle())}},e}(v);function Ar(t){return function(e){return e.lift(new Nr(t))}}var Nr=function(){function t(t){this.notifier=t}return t.prototype.call=function(t,e){return e.subscribe(new Br(t,this.notifier,e))},t}(),Br=function(t){function e(e,n,r){var o=t.call(this,e)||this;return o.notifier=n,o.source=r,o.sourceIsBeingSubscribedTo=!0,o}return r.__extends(e,t),e.prototype.notifyNext=function(t,e,n,r,o){this.sourceIsBeingSubscribedTo=!0,this.source.subscribe(this)},e.prototype.notifyComplete=function(e){if(!1===this.sourceIsBeingSubscribedTo)return t.prototype.complete.call(this)},e.prototype.complete=function(){if(this.sourceIsBeingSubscribedTo=!1,!this.isStopped){if(this.retries||this.subscribeToRetries(),!this.retriesSubscription||this.retriesSubscription.closed)return t.prototype.complete.call(this);this._unsubscribeAndRecycle(),this.notifications.next()}},e.prototype._unsubscribe=function(){var t=this.notifications,e=this.retriesSubscription;t&&(t.unsubscribe(),this.notifications=null),e&&(e.unsubscribe(),this.retriesSubscription=null),this.retries=null},e.prototype._unsubscribeAndRecycle=function(){var e=this._unsubscribe;return this._unsubscribe=null,t.prototype._unsubscribeAndRecycle.call(this),this._unsubscribe=e,this},e.prototype.subscribeToRetries=function(){var e;this.notifications=new dn;try{e=(0,this.notifier)(this.notifications)}catch(e){return t.prototype.complete.call(this)}this.retries=e,this.retriesSubscription=z(this,e)},e}(y);function zr(t){return void 0===t&&(t=-1),function(e){return e.lift(new Pr(t,e))}}var Pr=function(){function t(t,e){this.count=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new Rr(t,this.count,this.source))},t}(),Rr=function(t){function e(e,n,r){var o=t.call(this,e)||this;return o.count=n,o.source=r,o}return r.__extends(e,t),e.prototype.error=function(e){if(!this.isStopped){var n=this.source,r=this.count;if(0===r)return t.prototype.error.call(this,e);r>-1&&(this.count=r-1),n.subscribe(this._unsubscribeAndRecycle())}},e}(v);function Fr(t){return function(e){return e.lift(new Lr(t,e))}}var Lr=function(){function t(t,e){this.notifier=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new Vr(t,this.notifier,this.source))},t}(),Vr=function(t){function e(e,n,r){var o=t.call(this,e)||this;return o.notifier=n,o.source=r,o}return r.__extends(e,t),e.prototype.error=function(e){if(!this.isStopped){var n=this.errors,r=this.retries,o=this.retriesSubscription;if(r)this.errors=null,this.retriesSubscription=null;else{n=new dn;try{r=(0,this.notifier)(n)}catch(e){return t.prototype.error.call(this,e)}o=z(this,r)}this._unsubscribeAndRecycle(),this.errors=n,this.retries=r,this.retriesSubscription=o,n.next(e)}},e.prototype._unsubscribe=function(){var t=this.errors,e=this.retriesSubscription;t&&(t.unsubscribe(),this.errors=null),e&&(e.unsubscribe(),this.retriesSubscription=null),this.retries=null},e.prototype.notifyNext=function(t,e,n,r,o){var i=this._unsubscribe;this._unsubscribe=null,this._unsubscribeAndRecycle(),this._unsubscribe=i,this.source.subscribe(this)},e}(y);function jr(t){return function(e){return e.lift(new $r(t))}}var $r=function(){function t(t){this.notifier=t}return t.prototype.call=function(t,e){var n=new Wr(t),r=e.subscribe(n);return r.add(z(n,this.notifier)),r},t}(),Wr=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.hasValue=!1,e}return r.__extends(e,t),e.prototype._next=function(t){this.value=t,this.hasValue=!0},e.prototype.notifyNext=function(t,e,n,r,o){this.emitValue()},e.prototype.notifyComplete=function(){this.emitValue()},e.prototype.emitValue=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.value))},e}(y);function Hr(t,e){return void 0===e&&(e=$),function(n){return n.lift(new qr(t,e))}}var qr=function(){function t(t,e){this.period=t,this.scheduler=e}return t.prototype.call=function(t,e){return e.subscribe(new Jr(t,this.period,this.scheduler))},t}(),Jr=function(t){function e(e,n,r){var o=t.call(this,e)||this;return o.period=n,o.scheduler=r,o.hasValue=!1,o.add(r.schedule(Kr,n,{subscriber:o,period:n})),o}return r.__extends(e,t),e.prototype._next=function(t){this.lastValue=t,this.hasValue=!0},e.prototype.notifyNext=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.lastValue))},e}(v);function Kr(t){var e=t.subscriber,n=t.period;e.notifyNext(),this.schedule(t,n)}function Ur(t,e){return function(n){return n.lift(new Gr(t,e))}}var Gr=function(){function t(t,e){this.compareTo=t,this.comparator=e}return t.prototype.call=function(t,e){return e.subscribe(new Yr(t,this.compareTo,this.comparator))},t}(),Yr=function(t){function e(e,n,r){var o=t.call(this,e)||this;return o.compareTo=n,o.comparator=r,o._a=[],o._b=[],o._oneComplete=!1,o.destination.add(n.subscribe(new Xr(e,o))),o}return r.__extends(e,t),e.prototype._next=function(t){this._oneComplete&&0===this._b.length?this.emit(!1):(this._a.push(t),this.checkValues())},e.prototype._complete=function(){this._oneComplete?this.emit(0===this._a.length&&0===this._b.length):this._oneComplete=!0,this.unsubscribe()},e.prototype.checkValues=function(){for(var t=this._a,e=this._b,n=this.comparator;t.length>0&&e.length>0;){var r=t.shift(),o=e.shift(),i=!1;try{i=n?n(r,o):r===o}catch(t){this.destination.error(t)}i||this.emit(!1)}},e.prototype.emit=function(t){var e=this.destination;e.next(t),e.complete()},e.prototype.nextB=function(t){this._oneComplete&&0===this._a.length?this.emit(!1):(this._b.push(t),this.checkValues())},e.prototype.completeB=function(){this._oneComplete?this.emit(0===this._a.length&&0===this._b.length):this._oneComplete=!0},e}(v),Xr=function(t){function e(e,n){var r=t.call(this,e)||this;return r.parent=n,r}return r.__extends(e,t),e.prototype._next=function(t){this.parent.nextB(t)},e.prototype._error=function(t){this.parent.error(t),this.unsubscribe()},e.prototype._complete=function(){this.parent.completeB(),this.unsubscribe()},e}(v);function Zr(){return new dn}function Qr(){return function(t){return Kn()(Qn(Zr)(t))}}function to(t,e,n){var r;return r=t&&"object"==typeof t?t:{bufferSize:t,windowTime:e,refCount:!1,scheduler:n},function(t){return t.lift(function(t){var e,n,r=t.bufferSize,o=void 0===r?Number.POSITIVE_INFINITY:r,i=t.windowTime,s=void 0===i?Number.POSITIVE_INFINITY:i,a=t.refCount,c=t.scheduler,u=0,l=!1,d=!1;return function(t){u++,e&&!l||(l=!1,e=new xr(o,s,c),n=t.subscribe({next:function(t){e.next(t)},error:function(t){l=!0,e.error(t)},complete:function(){d=!0,e.complete()}}));var r=e.subscribe(this);this.add((function(){u--,r.unsubscribe(),n&&!d&&a&&0===u&&(n.unsubscribe(),n=void 0,e=void 0)}))}}(r))}}function eo(t){return function(e){return e.lift(new no(t,e))}}var no=function(){function t(t,e){this.predicate=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new ro(t,this.predicate,this.source))},t}(),ro=function(t){function e(e,n,r){var o=t.call(this,e)||this;return o.predicate=n,o.source=r,o.seenValue=!1,o.index=0,o}return r.__extends(e,t),e.prototype.applySingleValue=function(t){this.seenValue?this.destination.error("Sequence contains more than one element"):(this.seenValue=!0,this.singleValue=t)},e.prototype._next=function(t){var e=this.index++;this.predicate?this.tryNext(t,e):this.applySingleValue(t)},e.prototype.tryNext=function(t,e){try{this.predicate(t,e,this.source)&&this.applySingleValue(t)}catch(t){this.destination.error(t)}},e.prototype._complete=function(){var t=this.destination;this.index>0?(t.next(this.seenValue?this.singleValue:void 0),t.complete()):t.error(new Ae)},e}(v);function oo(t){return function(e){return e.lift(new io(t))}}var io=function(){function t(t){this.total=t}return t.prototype.call=function(t,e){return e.subscribe(new so(t,this.total))},t}(),so=function(t){function e(e,n){var r=t.call(this,e)||this;return r.total=n,r.count=0,r}return r.__extends(e,t),e.prototype._next=function(t){++this.count>this.total&&this.destination.next(t)},e}(v);function ao(t){return function(e){return e.lift(new co(t))}}var co=function(){function t(t){if(this._skipCount=t,this._skipCount<0)throw new Ce}return t.prototype.call=function(t,e){return 0===this._skipCount?e.subscribe(new v(t)):e.subscribe(new uo(t,this._skipCount))},t}(),uo=function(t){function e(e,n){var r=t.call(this,e)||this;return r._skipCount=n,r._count=0,r._ring=new Array(n),r}return r.__extends(e,t),e.prototype._next=function(t){var e=this._skipCount,n=this._count++;if(n<e)this._ring[n]=t;else{var r=n%e,o=this._ring,i=o[r];o[r]=t,this.destination.next(i)}},e}(v);function lo(t){return function(e){return e.lift(new po(t))}}var po=function(){function t(t){this.notifier=t}return t.prototype.call=function(t,e){return e.subscribe(new fo(t,this.notifier))},t}(),fo=function(t){function e(e,n){var r=t.call(this,e)||this;r.hasValue=!1;var o=new b(r,void 0,void 0);return r.add(o),r.innerSubscription=o,z(r,n,void 0,void 0,o),r}return r.__extends(e,t),e.prototype._next=function(e){this.hasValue&&t.prototype._next.call(this,e)},e.prototype.notifyNext=function(t,e,n,r,o){this.hasValue=!0,this.innerSubscription&&this.innerSubscription.unsubscribe()},e.prototype.notifyComplete=function(){},e}(y);function ho(t){return function(e){return e.lift(new mo(t))}}var mo=function(){function t(t){this.predicate=t}return t.prototype.call=function(t,e){return e.subscribe(new vo(t,this.predicate))},t}(),vo=function(t){function e(e,n){var r=t.call(this,e)||this;return r.predicate=n,r.skipping=!0,r.index=0,r}return r.__extends(e,t),e.prototype._next=function(t){var e=this.destination;this.skipping&&this.tryCallPredicate(t),this.skipping||e.next(t)},e.prototype.tryCallPredicate=function(t){try{var e=this.predicate(t,this.index++);this.skipping=Boolean(e)}catch(t){this.destination.error(t)}},e}(v);function go(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){var n=t[t.length-1];H(n)?t.pop():n=null;var r=t.length;return Pt(1!==r||n?r>0?vt(t,n):Ct(n):St(t[0]),e)}}var yo=1,bo={};var wo=function(t){var e=yo++;return bo[e]=t,Promise.resolve().then((function(){return function(t){var e=bo[t];e&&e()}(e)})),e},_o=function(t){delete bo[t]},xo=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r}return r.__extends(e,t),e.prototype.requestAsyncId=function(e,n,r){return void 0===r&&(r=0),null!==r&&r>0?t.prototype.requestAsyncId.call(this,e,n,r):(e.actions.push(this),e.scheduled||(e.scheduled=wo(e.flush.bind(e,null))))},e.prototype.recycleAsyncId=function(e,n,r){if(void 0===r&&(r=0),null!==r&&r>0||null===r&&this.delay>0)return t.prototype.recycleAsyncId.call(this,e,n,r);0===e.actions.length&&(_o(n),e.scheduled=void 0)},e}(L),ko=new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e.prototype.flush=function(t){this.active=!0,this.scheduled=void 0;var e,n=this.actions,r=-1,o=n.length;t=t||n.shift();do{if(e=t.execute(t.state,t.delay))break}while(++r<o&&(t=n.shift()));if(this.active=!1,e){for(;++r<o&&(t=n.shift());)t.unsubscribe();throw e}},e}(j))(xo),Co=function(t){function e(e,n,r){void 0===n&&(n=0),void 0===r&&(r=ko);var o=t.call(this)||this;return o.source=e,o.delayTime=n,o.scheduler=r,(!W(n)||n<0)&&(o.delayTime=0),r&&"function"==typeof r.schedule||(o.scheduler=ko),o}return r.__extends(e,t),e.create=function(t,n,r){return void 0===n&&(n=0),void 0===r&&(r=ko),new e(t,n,r)},e.dispatch=function(t){var e=t.source,n=t.subscriber;return this.add(e.subscribe(n))},e.prototype._subscribe=function(t){var n=this.delayTime,r=this.source;return this.scheduler.schedule(e.dispatch,n,{source:r,subscriber:t})},e}(C);function So(t,e){return void 0===e&&(e=0),function(n){return n.lift(new To(t,e))}}var To=function(){function t(t,e){this.scheduler=t,this.delay=e}return t.prototype.call=function(t,e){return new Co(e,this.delay,this.scheduler).subscribe(t)},t}();function Eo(t,e){return"function"==typeof e?function(n){return n.pipe(Eo((function(n,r){return _t(t(n,r)).pipe(Et((function(t,o){return e(n,t,r,o)})))})))}:function(e){return e.lift(new Mo(t))}}var Mo=function(){function t(t){this.project=t}return t.prototype.call=function(t,e){return e.subscribe(new Oo(t,this.project))},t}(),Oo=function(t){function e(e,n){var r=t.call(this,e)||this;return r.project=n,r.index=0,r}return r.__extends(e,t),e.prototype._next=function(t){var e,n=this.index++;try{e=this.project(t,n)}catch(t){return void this.destination.error(t)}this._innerSub(e,t,n)},e.prototype._innerSub=function(t,e,n){var r=this.innerSubscription;r&&r.unsubscribe();var o=new b(this,void 0,void 0);this.destination.add(o),this.innerSubscription=z(this,t,e,n,o)},e.prototype._complete=function(){var e=this.innerSubscription;e&&!e.closed||t.prototype._complete.call(this),this.unsubscribe()},e.prototype._unsubscribe=function(){this.innerSubscription=null},e.prototype.notifyComplete=function(e){this.destination.remove(e),this.innerSubscription=null,this.isStopped&&t.prototype._complete.call(this)},e.prototype.notifyNext=function(t,e,n,r,o){this.destination.next(e)},e}(y);function Do(){return Eo(Nt)}function Io(t,e){return e?Eo((function(){return t}),e):Eo((function(){return t}))}function Ao(t){return function(e){return e.lift(new No(t))}}var No=function(){function t(t){this.notifier=t}return t.prototype.call=function(t,e){var n=new Bo(t),r=z(n,this.notifier);return r&&!n.seenValue?(n.add(r),e.subscribe(n)):n},t}(),Bo=function(t){function e(e){var n=t.call(this,e)||this;return n.seenValue=!1,n}return r.__extends(e,t),e.prototype.notifyNext=function(t,e,n,r,o){this.seenValue=!0,this.complete()},e.prototype.notifyComplete=function(){},e}(y);function zo(t,e){return void 0===e&&(e=!1),function(n){return n.lift(new Po(t,e))}}var Po=function(){function t(t,e){this.predicate=t,this.inclusive=e}return t.prototype.call=function(t,e){return e.subscribe(new Ro(t,this.predicate,this.inclusive))},t}(),Ro=function(t){function e(e,n,r){var o=t.call(this,e)||this;return o.predicate=n,o.inclusive=r,o.index=0,o}return r.__extends(e,t),e.prototype._next=function(t){var e,n=this.destination;try{e=this.predicate(t,this.index++)}catch(t){return void n.error(t)}this.nextOrComplete(t,e)},e.prototype.nextOrComplete=function(t,e){var n=this.destination;Boolean(e)?n.next(t):(this.inclusive&&n.next(t),n.complete())},e}(v),Fo={leading:!0,trailing:!1};function Lo(t,e){return void 0===e&&(e=Fo),function(n){return n.lift(new Vo(t,e.leading,e.trailing))}}var Vo=function(){function t(t,e,n){this.durationSelector=t,this.leading=e,this.trailing=n}return t.prototype.call=function(t,e){return e.subscribe(new jo(t,this.durationSelector,this.leading,this.trailing))},t}(),jo=function(t){function e(e,n,r,o){var i=t.call(this,e)||this;return i.destination=e,i.durationSelector=n,i._leading=r,i._trailing=o,i._hasValue=!1,i}return r.__extends(e,t),e.prototype._next=function(t){this._hasValue=!0,this._sendValue=t,this._throttled||(this._leading?this.send():this.throttle(t))},e.prototype.send=function(){var t=this._hasValue,e=this._sendValue;t&&(this.destination.next(e),this.throttle(e)),this._hasValue=!1,this._sendValue=null},e.prototype.throttle=function(t){var e=this.tryDurationSelector(t);e&&this.add(this._throttled=z(this,e))},e.prototype.tryDurationSelector=function(t){try{return this.durationSelector(t)}catch(t){return this.destination.error(t),null}},e.prototype.throttlingDone=function(){var t=this._throttled,e=this._trailing;t&&t.unsubscribe(),this._throttled=null,e&&this.send()},e.prototype.notifyNext=function(t,e,n,r,o){this.throttlingDone()},e.prototype.notifyComplete=function(){this.throttlingDone()},e}(y);function $o(t,e,n){return void 0===e&&(e=$),void 0===n&&(n=Fo),function(r){return r.lift(new Wo(t,e,n.leading,n.trailing))}}var Wo=function(){function t(t,e,n,r){this.duration=t,this.scheduler=e,this.leading=n,this.trailing=r}return t.prototype.call=function(t,e){return e.subscribe(new Ho(t,this.duration,this.scheduler,this.leading,this.trailing))},t}(),Ho=function(t){function e(e,n,r,o,i){var s=t.call(this,e)||this;return s.duration=n,s.scheduler=r,s.leading=o,s.trailing=i,s._hasTrailingValue=!1,s._trailingValue=null,s}return r.__extends(e,t),e.prototype._next=function(t){this.throttled?this.trailing&&(this._trailingValue=t,this._hasTrailingValue=!0):(this.add(this.throttled=this.scheduler.schedule(qo,this.duration,{subscriber:this})),this.leading&&this.destination.next(t))},e.prototype._complete=function(){this._hasTrailingValue?(this.destination.next(this._trailingValue),this.destination.complete()):this.destination.complete()},e.prototype.clearThrottle=function(){var t=this.throttled;t&&(this.trailing&&this._hasTrailingValue&&(this.destination.next(this._trailingValue),this._trailingValue=null,this._hasTrailingValue=!1),t.unsubscribe(),this.remove(t),this.throttled=null)},e}(v);function qo(t){t.subscriber.clearThrottle()}function Jo(t){return void 0===t&&(t=$),function(e){return n=function(){return e.pipe(zn((function(e,n){var r=e.current;return{value:n,current:t.now(),last:r}}),{current:t.now(),value:void 0,last:void 0}),Et((function(t){var e=t.current,n=t.last,r=t.value;return new Ko(r,e-n)})))},new C((function(t){var e;try{e=n()}catch(e){return void t.error(e)}return(e?_t(e):Ct()).subscribe(t)}));var n}}var Ko=function(){return function(t,e){this.value=t,this.interval=e}}();function Uo(){return Error.call(this),this.message="Timeout has occurred",this.name="TimeoutError",this}Uo.prototype=Object.create(Error.prototype);var Go=Uo;function Yo(t,e,n){return void 0===n&&(n=$),function(r){var o=te(t),i=o?+t-n.now():Math.abs(t);return r.lift(new Xo(i,o,e,n))}}var Xo=function(){function t(t,e,n,r){this.waitFor=t,this.absoluteTimeout=e,this.withObservable=n,this.scheduler=r}return t.prototype.call=function(t,e){return e.subscribe(new Zo(t,this.absoluteTimeout,this.waitFor,this.withObservable,this.scheduler))},t}(),Zo=function(t){function e(e,n,r,o,i){var s=t.call(this,e)||this;return s.absoluteTimeout=n,s.waitFor=r,s.withObservable=o,s.scheduler=i,s.action=null,s.scheduleTimeout(),s}return r.__extends(e,t),e.dispatchTimeout=function(t){var e=t.withObservable;t._unsubscribeAndRecycle(),t.add(z(t,e))},e.prototype.scheduleTimeout=function(){var t=this.action;t?this.action=t.schedule(this,this.waitFor):this.add(this.action=this.scheduler.schedule(e.dispatchTimeout,this.waitFor,this))},e.prototype._next=function(e){this.absoluteTimeout||this.scheduleTimeout(),t.prototype._next.call(this,e)},e.prototype._unsubscribe=function(){this.action=null,this.scheduler=null,this.withObservable=null},e}(y);function Qo(t,e){return void 0===e&&(e=$),Yo(t,ee(new Go),e)}function ti(t){return void 0===t&&(t=$),Et((function(e){return new ei(e,t.now())}))}var ei=function(){return function(t,e){this.value=t,this.timestamp=e}}();function ni(t,e,n){return 0===n?[e]:(t.push(e),t)}function ri(){return Fn(ni,[])}function oi(t){return function(e){return e.lift(new ii(t))}}var ii=function(){function t(t){this.windowBoundaries=t}return t.prototype.call=function(t,e){var n=new si(t),r=e.subscribe(n);return r.closed||n.add(z(n,this.windowBoundaries)),r},t}(),si=function(t){function e(e){var n=t.call(this,e)||this;return n.window=new dn,e.next(n.window),n}return r.__extends(e,t),e.prototype.notifyNext=function(t,e,n,r,o){this.openWindow()},e.prototype.notifyError=function(t,e){this._error(t)},e.prototype.notifyComplete=function(t){this._complete()},e.prototype._next=function(t){this.window.next(t)},e.prototype._error=function(t){this.window.error(t),this.destination.error(t)},e.prototype._complete=function(){this.window.complete(),this.destination.complete()},e.prototype._unsubscribe=function(){this.window=null},e.prototype.openWindow=function(){var t=this.window;t&&t.complete();var e=this.destination,n=this.window=new dn;e.next(n)},e}(y);function ai(t,e){return void 0===e&&(e=0),function(n){return n.lift(new ci(t,e))}}var ci=function(){function t(t,e){this.windowSize=t,this.startWindowEvery=e}return t.prototype.call=function(t,e){return e.subscribe(new ui(t,this.windowSize,this.startWindowEvery))},t}(),ui=function(t){function e(e,n,r){var o=t.call(this,e)||this;return o.destination=e,o.windowSize=n,o.startWindowEvery=r,o.windows=[new dn],o.count=0,e.next(o.windows[0]),o}return r.__extends(e,t),e.prototype._next=function(t){for(var e=this.startWindowEvery>0?this.startWindowEvery:this.windowSize,n=this.destination,r=this.windowSize,o=this.windows,i=o.length,s=0;s<i&&!this.closed;s++)o[s].next(t);var a=this.count-r+1;if(a>=0&&a%e==0&&!this.closed&&o.shift().complete(),++this.count%e==0&&!this.closed){var c=new dn;o.push(c),n.next(c)}},e.prototype._error=function(t){var e=this.windows;if(e)for(;e.length>0&&!this.closed;)e.shift().error(t);this.destination.error(t)},e.prototype._complete=function(){var t=this.windows;if(t)for(;t.length>0&&!this.closed;)t.shift().complete();this.destination.complete()},e.prototype._unsubscribe=function(){this.count=0,this.windows=null},e}(v);function li(t){var e=$,n=null,r=Number.POSITIVE_INFINITY;return H(arguments[3])&&(e=arguments[3]),H(arguments[2])?e=arguments[2]:W(arguments[2])&&(r=arguments[2]),H(arguments[1])?e=arguments[1]:W(arguments[1])&&(n=arguments[1]),function(o){return o.lift(new di(t,n,r,e))}}var di=function(){function t(t,e,n,r){this.windowTimeSpan=t,this.windowCreationInterval=e,this.maxWindowSize=n,this.scheduler=r}return t.prototype.call=function(t,e){return e.subscribe(new fi(t,this.windowTimeSpan,this.windowCreationInterval,this.maxWindowSize,this.scheduler))},t}(),pi=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._numberOfNextedValues=0,e}return r.__extends(e,t),e.prototype.next=function(e){this._numberOfNextedValues++,t.prototype.next.call(this,e)},Object.defineProperty(e.prototype,"numberOfNextedValues",{get:function(){return this._numberOfNextedValues},enumerable:!0,configurable:!0}),e}(dn),fi=function(t){function e(e,n,r,o,i){var s=t.call(this,e)||this;s.destination=e,s.windowTimeSpan=n,s.windowCreationInterval=r,s.maxWindowSize=o,s.scheduler=i,s.windows=[];var a=s.openWindow();if(null!==r&&r>=0){var c={subscriber:s,window:a,context:null},u={windowTimeSpan:n,windowCreationInterval:r,subscriber:s,scheduler:i};s.add(i.schedule(vi,n,c)),s.add(i.schedule(mi,r,u))}else{var l={subscriber:s,window:a,windowTimeSpan:n};s.add(i.schedule(hi,n,l))}return s}return r.__extends(e,t),e.prototype._next=function(t){for(var e=this.windows,n=e.length,r=0;r<n;r++){var o=e[r];o.closed||(o.next(t),o.numberOfNextedValues>=this.maxWindowSize&&this.closeWindow(o))}},e.prototype._error=function(t){for(var e=this.windows;e.length>0;)e.shift().error(t);this.destination.error(t)},e.prototype._complete=function(){for(var t=this.windows;t.length>0;){var e=t.shift();e.closed||e.complete()}this.destination.complete()},e.prototype.openWindow=function(){var t=new pi;return this.windows.push(t),this.destination.next(t),t},e.prototype.closeWindow=function(t){t.complete();var e=this.windows;e.splice(e.indexOf(t),1)},e}(v);function hi(t){var e=t.subscriber,n=t.windowTimeSpan,r=t.window;r&&e.closeWindow(r),t.window=e.openWindow(),this.schedule(t,n)}function mi(t){var e=t.windowTimeSpan,n=t.subscriber,r=t.scheduler,o=t.windowCreationInterval,i=n.openWindow(),s={action:this,subscription:null},a={subscriber:n,window:i,context:s};s.subscription=r.schedule(vi,e,a),this.add(s.subscription),this.schedule(t,o)}function vi(t){var e=t.subscriber,n=t.window,r=t.context;r&&r.action&&r.subscription&&r.action.remove(r.subscription),e.closeWindow(n)}function gi(t,e){return function(n){return n.lift(new yi(t,e))}}var yi=function(){function t(t,e){this.openings=t,this.closingSelector=e}return t.prototype.call=function(t,e){return e.subscribe(new bi(t,this.openings,this.closingSelector))},t}(),bi=function(t){function e(e,n,r){var o=t.call(this,e)||this;return o.openings=n,o.closingSelector=r,o.contexts=[],o.add(o.openSubscription=z(o,n,n)),o}return r.__extends(e,t),e.prototype._next=function(t){var e=this.contexts;if(e)for(var n=e.length,r=0;r<n;r++)e[r].window.next(t)},e.prototype._error=function(e){var n=this.contexts;if(this.contexts=null,n)for(var r=n.length,o=-1;++o<r;){var i=n[o];i.window.error(e),i.subscription.unsubscribe()}t.prototype._error.call(this,e)},e.prototype._complete=function(){var e=this.contexts;if(this.contexts=null,e)for(var n=e.length,r=-1;++r<n;){var o=e[r];o.window.complete(),o.subscription.unsubscribe()}t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){var t=this.contexts;if(this.contexts=null,t)for(var e=t.length,n=-1;++n<e;){var r=t[n];r.window.unsubscribe(),r.subscription.unsubscribe()}},e.prototype.notifyNext=function(t,e,n,r,o){if(t===this.openings){var i=void 0;try{i=(0,this.closingSelector)(e)}catch(t){return this.error(t)}var s=new dn,a=new f,c={window:s,subscription:a};this.contexts.push(c);var u=z(this,i,c);u.closed?this.closeWindow(this.contexts.length-1):(u.context=c,a.add(u)),this.destination.next(s)}else this.closeWindow(this.contexts.indexOf(t))},e.prototype.notifyError=function(t){this.error(t)},e.prototype.notifyComplete=function(t){t!==this.openSubscription&&this.closeWindow(this.contexts.indexOf(t.context))},e.prototype.closeWindow=function(t){if(-1!==t){var e=this.contexts,n=e[t],r=n.window,o=n.subscription;e.splice(t,1),r.complete(),o.unsubscribe()}},e}(y);function wi(t){return function(e){return e.lift(new _i(t))}}var _i=function(){function t(t){this.closingSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new xi(t,this.closingSelector))},t}(),xi=function(t){function e(e,n){var r=t.call(this,e)||this;return r.destination=e,r.closingSelector=n,r.openWindow(),r}return r.__extends(e,t),e.prototype.notifyNext=function(t,e,n,r,o){this.openWindow(o)},e.prototype.notifyError=function(t,e){this._error(t)},e.prototype.notifyComplete=function(t){this.openWindow(t)},e.prototype._next=function(t){this.window.next(t)},e.prototype._error=function(t){this.window.error(t),this.destination.error(t),this.unsubscribeClosingNotification()},e.prototype._complete=function(){this.window.complete(),this.destination.complete(),this.unsubscribeClosingNotification()},e.prototype.unsubscribeClosingNotification=function(){this.closingNotification&&this.closingNotification.unsubscribe()},e.prototype.openWindow=function(t){void 0===t&&(t=null),t&&(this.remove(t),t.unsubscribe());var e=this.window;e&&e.complete();var n,r=this.window=new dn;this.destination.next(r);try{n=(0,this.closingSelector)()}catch(t){return this.destination.error(t),void this.window.error(t)}this.add(this.closingNotification=z(this,n))},e}(y);function ki(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){var n;"function"==typeof t[t.length-1]&&(n=t.pop());var r=t;return e.lift(new Ci(r,n))}}var Ci=function(){function t(t,e){this.observables=t,this.project=e}return t.prototype.call=function(t,e){return e.subscribe(new Si(t,this.observables,this.project))},t}(),Si=function(t){function e(e,n,r){var o=t.call(this,e)||this;o.observables=n,o.project=r,o.toRespond=[];var i=n.length;o.values=new Array(i);for(var s=0;s<i;s++)o.toRespond.push(s);for(s=0;s<i;s++){var a=n[s];o.add(z(o,a,a,s))}return o}return r.__extends(e,t),e.prototype.notifyNext=function(t,e,n,r,o){this.values[n]=e;var i=this.toRespond;if(i.length>0){var s=i.indexOf(n);-1!==s&&i.splice(s,1)}},e.prototype.notifyComplete=function(){},e.prototype._next=function(t){if(0===this.toRespond.length){var e=[t].concat(this.values);this.project?this._tryProject(e):this.destination.next(e)}},e.prototype._tryProject=function(t){var e;try{e=this.project.apply(this,t)}catch(t){return void this.destination.error(t)}this.destination.next(e)},e}(y);function Ti(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t[t.length-1];return"function"==typeof n&&t.pop(),vt(t,void 0).lift(new Ei(n))}var Ei=function(){function t(t){this.resultSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new Mi(t,this.resultSelector))},t}(),Mi=function(t){function e(e,n,r){void 0===r&&(r=Object.create(null));var o=t.call(this,e)||this;return o.iterators=[],o.active=0,o.resultSelector="function"==typeof n?n:null,o.values=r,o}return r.__extends(e,t),e.prototype._next=function(t){var e=this.iterators;u(t)?e.push(new Di(t)):"function"==typeof t[O]?e.push(new Oi(t[O]())):e.push(new Ii(this.destination,this,t))},e.prototype._complete=function(){var t=this.iterators,e=t.length;if(this.unsubscribe(),0!==e){this.active=e;for(var n=0;n<e;n++){var r=t[n];if(r.stillUnsubscribed)this.destination.add(r.subscribe(r,n));else this.active--}}else this.destination.complete()},e.prototype.notifyInactive=function(){this.active--,0===this.active&&this.destination.complete()},e.prototype.checkIterators=function(){for(var t=this.iterators,e=t.length,n=this.destination,r=0;r<e;r++){if("function"==typeof(s=t[r]).hasValue&&!s.hasValue())return}var o=!1,i=[];for(r=0;r<e;r++){var s,a=(s=t[r]).next();if(s.hasCompleted()&&(o=!0),a.done)return void n.complete();i.push(a.value)}this.resultSelector?this._tryresultSelector(i):n.next(i),o&&n.complete()},e.prototype._tryresultSelector=function(t){var e;try{e=this.resultSelector.apply(this,t)}catch(t){return void this.destination.error(t)}this.destination.next(e)},e}(v),Oi=function(){function t(t){this.iterator=t,this.nextResult=t.next()}return t.prototype.hasValue=function(){return!0},t.prototype.next=function(){var t=this.nextResult;return this.nextResult=this.iterator.next(),t},t.prototype.hasCompleted=function(){var t=this.nextResult;return t&&t.done},t}(),Di=function(){function t(t){this.array=t,this.index=0,this.length=0,this.length=t.length}return t.prototype[O]=function(){return this},t.prototype.next=function(t){var e=this.index++,n=this.array;return e<this.length?{value:n[e],done:!1}:{value:null,done:!0}},t.prototype.hasValue=function(){return this.array.length>this.index},t.prototype.hasCompleted=function(){return this.array.length===this.index},t}(),Ii=function(t){function e(e,n,r){var o=t.call(this,e)||this;return o.parent=n,o.observable=r,o.stillUnsubscribed=!0,o.buffer=[],o.isComplete=!1,o}return r.__extends(e,t),e.prototype[O]=function(){return this},e.prototype.next=function(){var t=this.buffer;return 0===t.length&&this.isComplete?{value:null,done:!0}:{value:t.shift(),done:!1}},e.prototype.hasValue=function(){return this.buffer.length>0},e.prototype.hasCompleted=function(){return 0===this.buffer.length&&this.isComplete},e.prototype.notifyComplete=function(){this.buffer.length>0?(this.isComplete=!0,this.parent.notifyInactive()):this.destination.complete()},e.prototype.notifyNext=function(t,e,n,r,o){this.buffer.push(e),this.parent.checkIterators()},e.prototype.subscribe=function(t,e){return z(this,this.observable,this,e)},e}(y);function Ai(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return e.lift.call(Ti.apply(void 0,[e].concat(t)))}}function Ni(t){return function(e){return e.lift(new Ei(t))}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(39),o=n(8);e.Schema=o.Schema;var i=o.marks,s=Object.assign(o.nodes,r.semanticNodes);e.schema=new o.Schema({marks:i,nodes:s})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(7),s=n(2),a=function(t){function e(e,n){var r=t.call(this,e)||this;return r.dialog=e,r.localization=n,r.data="",r}return r.__extends(e,t),e.prototype.ngAfterViewInit=function(){var t=this;Promise.resolve(null).then((function(){t.textarea.nativeElement.focus()}))},e.prototype.onCancelAction=function(){this.dialog.close()},e.prototype.onConfirmAction=function(){this.editor.exec("setHTML",this.getData()),this.dialog.close(),this.editor.view.focus()},e.prototype.getData=function(){return this.textarea.nativeElement.value},e.prototype.setData=function(){this.data=this.indent(this.editor.getSource())},e.prototype.textFor=function(t){return this.localization.get(t)},e.prototype.indent=function(t){return t.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$/,"")},r.__decorate([o.Input(),r.__metadata("design:type",Object)],e.prototype,"editor",void 0),r.__decorate([o.ViewChild("textarea",{static:!0}),r.__metadata("design:type",o.ElementRef)],e.prototype,"textarea",void 0),e=r.__decorate([o.Component({styles:["\n >>> .k-editor-textarea {\n height: 100%;\n }\n "],template:'\n <kendo-dialog-titlebar (close)="onCancelAction()">\n {{ textFor(\'viewSource\') }}\n </kendo-dialog-titlebar>\n <textarea [value]="data" #textarea class="k-textarea k-editor-textarea"></textarea>\n <kendo-dialog-actions>\n <button kendoButton (click)="onCancelAction()">{{ textFor(\'dialogCancel\') }}</button>\n <button kendoButton (click)="onConfirmAction()" [primary]="true">{{ textFor(\'dialogUpdate\') }}</button>\n </kendo-dialog-actions>\n '}),r.__metadata("design:paramtypes",[i.DialogRef,s.EditorLocalizationService])],e)}(i.DialogContentBase);e.SourceDialogComponent=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(12),s=n(7),a=n(8),c=n(9),u=n(2),l=n(10),d=function(t){function e(e,n){var r=t.call(this,e)||this;return r.dialog=e,r.localization=n,r.src=new i.FormControl("",i.Validators.required),r.alt=new i.FormControl(""),r.width=new i.FormControl("",i.Validators.min(1)),r.height=new i.FormControl("",i.Validators.min(1)),r.data={alt:"",height:"",src:"",width:""},r.imageData=new i.FormGroup({alt:r.alt,height:r.height,src:r.src,width:r.width}),r}return r.__extends(e,t),e.prototype.ngOnInit=function(){this.srcInputId="k-"+l.guid(),this.altTextInputId="k-"+l.guid(),this.widthInputId="k-"+l.guid(),this.heightInputId="k-"+l.guid()},e.prototype.ngAfterViewInit=function(){var t=this;Promise.resolve(null).then((function(){t.srcInput.nativeElement.focus()}))},e.prototype.onCancelAction=function(){this.dialog.close()},e.prototype.onConfirmAction=function(){this.src.value&&(this.editor.exec("insertImage",this.getData()),this.dialog.close(),this.editor.view.focus())},e.prototype.setData=function(t){var e=a.getNodeFromSelection(t);e&&(this.src.patchValue(e.attrs.src),this.alt.patchValue(e.attrs.alt),this.width.patchValue(e.attrs.width),this.height.patchValue(e.attrs.height))},e.prototype.textFor=function(t){return this.localization.get(t)},e.prototype.getData=function(){return{alt:this.alt.value,height:this.normalizeDimension(this.height.value),src:this.src.value,width:this.normalizeDimension(this.width.value)}},e.prototype.normalizeDimension=function(t){return Number.isNaN(parseInt(t,10))||parseInt(t,10)<=0?"":c.safeString(parseInt(t,10))},r.__decorate([o.Input(),r.__metadata("design:type",Object)],e.prototype,"editor",void 0),r.__decorate([o.ViewChild("srcInput",{read:o.ElementRef,static:!0}),r.__metadata("design:type",o.ElementRef)],e.prototype,"srcInput",void 0),e=r.__decorate([o.Component({template:'\n <kendo-dialog-titlebar (close)="onCancelAction()">\n {{ textFor(\'insertImage\') }}\n </kendo-dialog-titlebar>\n <div class="k-editor-dialog">\n <div class="k-editor-dialog k-popup-edit-form k-window-content k-content">\n <div class="k-edit-form-container k-window-content">\n <div class="k-edit-label">\n <label [for]="srcInputId">{{ textFor(\'imageWebAddress\') }}</label>\n </div>\n <div class="k-edit-field">\n <input [id]="srcInputId" #srcInput [formControl]="src" type="text" class="k-textbox k-input k-rounded-md" />\n </div>\n <div class="k-edit-label">\n <label [for]="altTextInputId">{{ textFor(\'imageAltText\') }}</label>\n </div>\n <div class="k-edit-field">\n <input [id]="altTextInputId" [formControl]="alt" type="text" class="k-textbox k-input k-rounded-md" />\n </div>\n <div class="k-edit-label">\n <label [for]="widthInputId">{{ textFor(\'imageWidth\') }}</label>\n </div>\n <div class="k-edit-field">\n <input [id]="widthInputId" [formControl]="width" type="text" class="k-textbox k-input k-rounded-md" />\n </div>\n <div class="k-edit-label">\n <label [for]="heightInputId">{{ textFor(\'imageHeight\') }}</label>\n </div>\n <div class="k-edit-field">\n <input [id]="heightInputId" [formControl]="height" type="text" class="k-textbox k-input k-rounded-md" />\n </div>\n </div>\n </div>\n </div>\n <kendo-dialog-actions>\n <button kendoButton (click)="onCancelAction()">{{ textFor(\'dialogCancel\') }}</button>\n <button kendoButton [disabled]="imageData.invalid"\n (click)="onConfirmAction()" [primary]="true">{{ textFor(\'dialogInsert\') }}</button>\n </kendo-dialog-actions>\n '}),r.__metadata("design:paramtypes",[s.DialogRef,u.EditorLocalizationService])],e)}(s.DialogContentBase);e.ImageDialogComponent=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(12),s=n(7),a=n(8),c=n(9),u=n(2),l=function(t){function e(e,n){var r=t.call(this,e)||this;return r.dialog=e,r.localization=n,r.linkForm=new i.FormGroup({href:new i.FormControl("",i.Validators.required),text:new i.FormControl({value:"",disabled:!0},i.Validators.required),title:new i.FormControl("")}),r}return r.__extends(e,t),e.prototype.ngAfterViewInit=function(){var t=this;Promise.resolve(null).then((function(){t.hrefInput.nativeElement.focus()}))},e.prototype.onCancelAction=function(){this.dialog.close()},e.prototype.onConfirmAction=function(){var t=this.getData();this.editor.exec(this.command,t),this.dialog.close(),this.editor.view.focus()},Object.defineProperty(e.prototype,"titleText",{get:function(){return this.localization.get(this.command)},enumerable:!0,configurable:!0}),e.prototype.setData=function(t,e){"createLink"===this.command&&this.linkForm.addControl("target",new i.FormControl);var n=a.getMark(t,t.schema.marks.link);if(n)this.linkForm.reset({href:n.attrs.href,title:n.attrs.title,target:c.isPresent(n.attrs.target),text:this.setLinkText(t)});else if(t.selection.empty){var r=e.applyToWord?a.expandSelection(t,(function(){}),e).state:t;r.selection.empty||this.linkForm.patchValue({text:a.getSelectionText(r)})}else this.linkForm.patchValue({text:a.getSelectionText(t)})},e.prototype.textForWithPrefix=function(t){var e="createLink"===this.command?"link":"file";return this.textFor(e+t)},e.prototype.textFor=function(t){return this.localization.get(t)},e.prototype.setLinkText=function(t){var e=t.selection;if(e.empty&&e.$cursor){var n=e.$cursor,r=n.index();return n.parent.child(r).text}return a.getSelectionText(t)},e.prototype.getData=function(){var t=this.linkForm.value;return c.isPresent(this.linkForm.controls.target)&&(t.target=t.target?"_blank":null),t},r.__decorate([o.Input(),r.__metadata("design:type",Object)],e.prototype,"editor",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"command",void 0),r.__decorate([o.ViewChild("hrefInput",{read:o.ElementRef,static:!0}),r.__metadata("design:type",o.ElementRef)],e.prototype,"hrefInput",void 0),e=r.__decorate([o.Component({template:'\n <kendo-dialog-titlebar (close)="onCancelAction()">\n {{ titleText }}\n </kendo-dialog-titlebar>\n <div class="k-editor-dialog">\n <div class="k-editor-dialog k-popup-edit-form k-window-content k-content">\n <div class="k-edit-form-container k-window-content">\n <form novalidate [formGroup]="linkForm">\n <div class="k-edit-label">\n <label (click)="hrefInput.focus()">{{ textForWithPrefix(\'WebAddress\') }}</label>\n </div>\n <div class="k-edit-field">\n <input #hrefInput formControlName="href" type="text" class="k-textbox k-input k-rounded-md" />\n </div>\n\n <div class="k-edit-label">\n <label (click)="textInput.focus()">{{ textForWithPrefix(\'Text\') }}</label>\n </div>\n <div class="k-edit-field">\n <input #textInput formControlName="text" type="text" class="k-textbox k-input k-rounded-md" />\n </div>\n\n <div class="k-edit-label">\n <label (click)="titleInput.focus()">{{ textForWithPrefix(\'Title\') }}</label>\n </div>\n <div class="k-edit-field">\n <input #titleInput formControlName="title" type="text" class="k-textbox k-input k-rounded-md" />\n </div>\n <ng-container *ngIf="command === \'createLink\'">\n <div class="k-edit-label"></div>\n <div class="k-edit-field">\n <input type="checkbox" id="k-target-blank" kendoCheckBox formControlName="target" />\n <label class="k-checkbox-label" for="k-target-blank">{{ textForWithPrefix(\'OpenInNewWindow\') }}</label>\n </div>\n </ng-container>\n </form>\n </div>\n </div>\n </div>\n <kendo-dialog-actions>\n <button kendoButton (click)="onCancelAction()">{{ textFor(\'dialogCancel\') }}</button>\n <button kendoButton [disabled]="linkForm.invalid" (click)="onConfirmAction()" [primary]="true">\n {{ textFor(\'dialogInsert\') }}\n </button>\n </kendo-dialog-actions>\n '}),r.__metadata("design:paramtypes",[s.DialogRef,u.EditorLocalizationService])],e)}(s.DialogContentBase);e.FileLinkDialogComponent=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.EditorErrorMessages={schemaType:"Expected value of type Schema. See http://www.telerik.com/kendo-angular-ui/components/editor/schema/",setSchemaOnce:"The Schema cannot be changed dynamically. See http://www.telerik.com/kendo-angular-ui/components/editor/schema/",pluginsCallbackType:function(t){return"plugins must be a function, but received "+JSON.stringify(t)+"."},pastedContentCallbackType:function(t){return"pastedContent must be a function, but received "+JSON.stringify(t)+"."},setPluginsOnce:"The plugins cannot be changed dynamically. See http://www.telerik.com/kendo-angular-ui/components/editor/plugins/",setPlaceHolderOnce:"The placeholder cannot be changed dynamically. See https://www.telerik.com/kendo-angular-ui/components/editor/plugins/#toc-custom-plugins/",printTool:"The Print tool and functionality are supported only in iframe mode. See https://www.telerik.com/kendo-angular-ui-develop/components/editor/api/EditorPrintButtonDirective/"}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=function(t){function e(e,n,r){var o=t.call(this)||this;return o.cleanedHtml=e,o.originalHtml=n,o.originalEvent=r,o}return r.__extends(e,t),e}(n(10).PreventableEvent);e.EditorPasteEvent=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(7),s=n(2),a=n(3),c=n(17),u=function(t){function e(e,n){var r=t.call(this,e)||this;return r.dialog=e,r.localization=n,r.data=[],r}return r.__extends(e,t),e.prototype.ngAfterViewInit=function(){var t=this;Promise.resolve(null).then((function(){t.formatDropDownList.dropDownList.focus()}))},e.prototype.onCancelAction=function(){this.dialog.close()},e.prototype.onConfirmAction=function(){this.value&&this.editor.exec("format",{tag:this.value}),this.dialog.close()},e.prototype.setData=function(t){this.editor=t.editor,this.data=t.data,this.defaultItem=t.defaultItem,this.value=t.value,this.itemDisabled=t.itemDisabled},e.prototype.textFor=function(t){return this.localization.get(t)},r.__decorate([o.Input(),r.__metadata("design:type",a.EditorComponent)],e.prototype,"editor",void 0),r.__decorate([o.ViewChild("formatDropDownList",{read:c.FormatDropDownListComponent,static:!0}),r.__metadata("design:type",c.FormatDropDownListComponent)],e.prototype,"formatDropDownList",void 0),e=r.__decorate([o.Component({template:'\n <kendo-dialog-titlebar (close)="onCancelAction()">\n {{ textFor(\'format\') }}\n </kendo-dialog-titlebar>\n <div class="k-editor-dialog">\n <div class="k-editor-dialog k-popup-edit-form k-window-content k-content">\n <div class="k-edit-form-container k-window-content" style="text-align: center;">\n <kendo-editor-format-dropdownlist\n #formatDropDownList\n [defaultItem]="defaultItem"\n [data]="data"\n [(value)]="value"\n [itemDisabled]="itemDisabled"\n >\n </kendo-editor-format-dropdownlist>\n </div>\n </div>\n </div>\n <kendo-dialog-actions>\n <button kendoButton (click)="onCancelAction()">{{ textFor(\'dialogCancel\') }}</button>\n <button kendoButton\n (click)="onConfirmAction()" [primary]="true">{{ textFor(\'dialogApply\') }}</button>\n </kendo-dialog-actions>\n '}),r.__metadata("design:paramtypes",[i.DialogRef,s.EditorLocalizationService])],e)}(i.DialogContentBase);e.FormatDialogComponent=u},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(7),s=n(2),a=n(3),c=n(16),u=function(t){function e(e,n){var r=t.call(this,e)||this;return r.dialog=e,r.localization=n,r}return r.__extends(e,t),e.prototype.ngAfterViewInit=function(){var t=this;Promise.resolve(null).then((function(){t.colorPicker.focus()}))},e.prototype.handleActiveColorClick=function(t){t.preventOpen(),this.value=t.color},e.prototype.onCancelAction=function(){this.dialog.close()},e.prototype.onConfirmAction=function(){this.value&&this.editor.exec(this.editorCommand,this.value),this.dialog.close(),this.editor.view.focus()},e.prototype.setData=function(t){this.editor=t.editor,this.value=t.value,this.editorCommand=t.editorCommand,this.paletteSettings=t.paletteSettings,this.icon=t.icon,this.views=t.view?[t.view]:t.views},e.prototype.textFor=function(t){return this.localization.get(t)},r.__decorate([o.Input(),r.__metadata("design:type",a.EditorComponent)],e.prototype,"editor",void 0),r.__decorate([o.ViewChild("colorpicker",{read:c.ColorPickerComponent,static:!0}),r.__metadata("design:type",c.ColorPickerComponent)],e.prototype,"colorPicker",void 0),e=r.__decorate([o.Component({template:'\n <kendo-dialog-titlebar (close)="onCancelAction()">\n {{ textFor(editorCommand) }}\n </kendo-dialog-titlebar>\n <div class="k-editor-dialog">\n <div class="k-editor-dialog k-popup-edit-form k-window-content k-content">\n <div class="k-edit-form-container k-window-content" style="text-align: center;">\n <kendo-colorpicker\n #colorpicker\n [views]="views"\n [format]="\'hex\'"\n [attr.title]="title"\n [icon]="icon"\n [(value)]="value"\n [paletteSettings]="paletteSettings"\n (activeColorClick)="handleActiveColorClick($event)"\n >\n </kendo-colorpicker>\n </div>\n </div>\n </div>\n <kendo-dialog-actions>\n <button kendoButton (click)="onCancelAction()">{{ textFor(\'dialogCancel\') }}</button>\n <button kendoButton\n (click)="onConfirmAction()" [primary]="true">{{ textFor(\'dialogApply\') }}</button>\n </kendo-dialog-actions>\n '}),r.__metadata("design:paramtypes",[i.DialogRef,s.EditorLocalizationService])],e)}(i.DialogContentBase);e.ColorPickerDialogComponent=u},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(7),s=n(2),a=n(3),c=n(18),u=function(t){function e(e,n){var r=t.call(this,e)||this;return r.dialog=e,r.localization=n,r.data=[],r}return r.__extends(e,t),e.prototype.ngAfterViewInit=function(){var t=this;Promise.resolve(null).then((function(){t.fontFamilyDropDownList.dropDownList.focus()}))},e.prototype.onCancelAction=function(){this.dialog.close()},e.prototype.onConfirmAction=function(){this.value&&this.editor.exec("fontFamily",this.value),this.dialog.close()},e.prototype.setData=function(t){this.editor=t.editor,this.data=t.data,this.defaultItem=t.defaultItem,this.value=t.value,this.itemDisabled=t.itemDisabled},e.prototype.textFor=function(t){return this.localization.get(t)},r.__decorate([o.Input(),r.__metadata("design:type",a.EditorComponent)],e.prototype,"editor",void 0),r.__decorate([o.ViewChild("fontFamilyDropDownList",{read:c.FontFamilyDropDownListComponent,static:!0}),r.__metadata("design:type",c.FontFamilyDropDownListComponent)],e.prototype,"fontFamilyDropDownList",void 0),e=r.__decorate([o.Component({template:'\n <kendo-dialog-titlebar (close)="onCancelAction()">\n {{ textFor(\'fontFamily\') }}\n </kendo-dialog-titlebar>\n <div class="k-editor-dialog">\n <div class="k-editor-dialog k-popup-edit-form k-window-content k-content">\n <div class="k-edit-form-container k-window-content" style="text-align: center;">\n <kendo-editor-fontfamily-dropdownlist\n #fontFamilyDropDownList\n [defaultItem]="defaultItem"\n [data]="data"\n [(value)]="value"\n [itemDisabled]="itemDisabled"\n >\n </kendo-editor-fontfamily-dropdownlist>\n </div>\n </div>\n </div>\n <kendo-dialog-actions>\n <button kendoButton (click)="onCancelAction()">{{ textFor(\'dialogCancel\') }}</button>\n <button kendoButton\n (click)="onConfirmAction()" [primary]="true">{{ textFor(\'dialogApply\') }}</button>\n </kendo-dialog-actions>\n '}),r.__metadata("design:paramtypes",[i.DialogRef,s.EditorLocalizationService])],e)}(i.DialogContentBase);e.FontFamilyDialogComponent=u},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(7),s=n(2),a=n(3),c=function(t){function e(e,n){var r=t.call(this,e)||this;return r.dialog=e,r.localization=n,r}return r.__extends(e,t),e.prototype.onCancelAction=function(){this.dialog.close(),this.editor.view.focus()},e.prototype.onCellClick=function(t){this.dialog.close(),this.editor.exec("insertTable",t),this.editor.view.focus()},e.prototype.setData=function(t){this.editor=t.editor},e.prototype.textFor=function(t){return this.localization.get(t)},r.__decorate([o.Input(),r.__metadata("design:type",a.EditorComponent)],e.prototype,"editor",void 0),e=r.__decorate([o.Component({template:'\n <kendo-dialog-titlebar (close)="onCancelAction()">\n {{ textFor(\'insertTable\') }}\n </kendo-dialog-titlebar>\n <div class="k-editor-dialog">\n <div class="k-editor-dialog k-popup-edit-form k-window-content k-content">\n <div class="k-ct-popup k-window-content" style="text-align: center;">\n <kendo-popup-table-grid (cellClick)="onCellClick($event)"></kendo-popup-table-grid>\n </div>\n </div>\n </div>\n <kendo-dialog-actions>\n <button kendoButton (click)="onCancelAction()">{{ textFor(\'dialogCancel\') }}</button>\n </kendo-dialog-actions>\n '}),r.__metadata("design:paramtypes",[i.DialogRef,s.EditorLocalizationService])],e)}(i.DialogContentBase);e.InsertTableDialogComponent=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(7),s=n(2),a=n(3),c=n(19),u=function(t){function e(e,n){var r=t.call(this,e)||this;return r.dialog=e,r.localization=n,r.data=[],r}return r.__extends(e,t),e.prototype.ngAfterViewInit=function(){var t=this;Promise.resolve(null).then((function(){t.fontSizeDropDownList.dropDownList.focus()}))},e.prototype.onCancelAction=function(){this.dialog.close()},e.prototype.onConfirmAction=function(){this.value&&this.editor.exec("fontSize",this.value),this.dialog.close()},e.prototype.setData=function(t){this.editor=t.editor,this.data=t.data,this.defaultItem=t.defaultItem,this.value=t.value,this.itemDisabled=t.itemDisabled},e.prototype.textFor=function(t){return this.localization.get(t)},r.__decorate([o.Input(),r.__metadata("design:type",a.EditorComponent)],e.prototype,"editor",void 0),r.__decorate([o.ViewChild("fontSizeDropDownList",{read:c.FontSizeDropDownListComponent,static:!0}),r.__metadata("design:type",c.FontSizeDropDownListComponent)],e.prototype,"fontSizeDropDownList",void 0),e=r.__decorate([o.Component({template:'\n <kendo-dialog-titlebar (close)="onCancelAction()">\n {{ textFor(\'fontSize\') }}\n </kendo-dialog-titlebar>\n <div class="k-editor-dialog">\n <div class="k-editor-dialog k-popup-edit-form k-window-content k-content">\n <div class="k-edit-form-container k-window-content" style="text-align: center;">\n <kendo-editor-fontsize-dropdownlist\n #fontSizeDropDownList\n [defaultItem]="defaultItem"\n [data]="data"\n [(value)]="value"\n [itemDisabled]="itemDisabled"\n >\n </kendo-editor-fontsize-dropdownlist>\n </div>\n </div>\n </div>\n <kendo-dialog-actions>\n <button kendoButton (click)="onCancelAction()">{{ textFor(\'dialogCancel\') }}</button>\n <button kendoButton\n (click)="onConfirmAction()" [primary]="true">{{ textFor(\'dialogApply\') }}</button>\n </kendo-dialog-actions>\n '}),r.__metadata("design:paramtypes",[i.DialogRef,s.EditorLocalizationService])],e)}(i.DialogContentBase);e.FontSizeDialogComponent=u},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(21),o=function(){function t(t,e,n,o,i){var s=this;this.command=t,this.button=e,this.editor=n,this.localization=o,this.toolsService=i,setTimeout((function(){var t=s.localization.get(s.command);t&&(s.button.showText="overflow",s.button.showIcon="both",s.button.text=t),s.button.toolbarOptions.icon||(s.button.icon=r.commandIcons[s.command]),s.button.title=t,s.toolsService.needsCheck.next()}))}return t.prototype.ngOnInit=function(){this.subs=this.editor.stateChange.subscribe(this.onStateChange.bind(this)),this.subs.add(this.button.click.subscribe(this.clickHandler.bind(this))),this.subs.add(this.button.pointerdown.subscribe(this.pointerdownHandler.bind(this)))},t.prototype.ngOnDestroy=function(){this.subs&&this.subs.unsubscribe()},t.prototype.clickHandler=function(){},t.prototype.pointerdownHandler=function(t){},t.prototype.onStateChange=function(t){},t}();e.EditorCommandBase=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"alignCenter",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"alignJustify",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"alignLeft",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"alignRight",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"backColor",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"blockquote",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"bold",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"cleanFormatting",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"createLink",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"fontFamily",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"fontSize",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"foreColor",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"format",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"indent",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"insertFile",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"insertImage",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"insertOrderedList",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"insertUnorderedList",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"italic",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"outdent",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"print",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"redo",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"selectAll",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"strikethrough",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"subscript",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"superscript",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"underline",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"undo",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"unlink",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"viewSource",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"insertTable",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"addColumnBefore",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"addColumnAfter",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"addRowBefore",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"addRowAfter",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"deleteColumn",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"deleteRow",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"deleteTable",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"dialogApply",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"dialogCancel",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"dialogInsert",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"dialogUpdate",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"fileText",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"fileTitle",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"fileWebAddress",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"imageAltText",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"imageHeight",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"imageWebAddress",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"imageWidth",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"linkOpenInNewWindow",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"linkText",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"linkTitle",void 0),r.__decorate([o.Input(),r.__metadata("design:type",String)],e.prototype,"linkWebAddress",void 0),e}(n(11).ComponentMessages);e.Messages=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(3);e.EditorComponent=r.EditorComponent;var o=n(45);e.EditorModule=o.EditorModule;var i=n(23);e.schema=i.schema,e.Schema=i.Schema;var s=n(8);e.EditorState=s.EditorState,e.Plugin=s.Plugin,e.PluginKey=s.PluginKey,e.Transaction=s.Transaction,e.EditorView=s.EditorView,e.Decoration=s.Decoration,e.DecorationSet=s.DecorationSet,e.NodeType=s.NodeType,e.Node=s.Node,e.MarkType=s.MarkType,e.Mark=s.Mark,e.InputRule=s.InputRule,e.inputRules=s.inputRules,e.wrappingInputRule=s.wrappingInputRule,e.textblockTypeInputRule=s.textblockTypeInputRule,e.keymap=s.keymap,e.baseKeymap=s.baseKeymap,e.history=s.history,e.dropCursor=s.dropCursor,e.gapCursor=s.gapCursor,e.tableNodes=s.tableNodes,e.getSelectionText=s.getSelectionText;var a=n(28);e.EditorPasteEvent=a.EditorPasteEvent},function(t,e){t.exports=u},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.packageMetadata={name:"@progress/kendo-angular-editor",productName:"Kendo UI for Angular",productCodes:["KENDOUIANGULAR","KENDOUICOMPLETE"],publishDate:1646218976,version:"",licensingDocsUrl:"https://www.telerik.com/kendo-angular-ui/my-license/?utm_medium=product&utm_source=kendoangular&utm_campaign=kendo-ui-angular-purchase-license-keys-warning"}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(40);e.semanticTagNames=["article","main","nav","header","footer","aside","section"],e.semanticNodes=e.semanticTagNames.reduce((function(t,e){var n,i;return Object.assign(t,((n={})[e]=(i=e,{content:"block*",group:"block",attrs:r.__assign({},o.commonAttributes()),parseDOM:[{tag:i,getAttrs:o.getAttributes}],toDOM:function(t){return o.hasAttrs(t.attrs)?[i,o.getAttrs(t.attrs),o.hole]:[i,o.hole]}}),n))}),{})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0);e.hasAttrs=function(t,e){for(var n in t)if(n&&null!==t[n]&&n!==e)return!0;return!1},e.getAttrs=function(t,e){var n={};for(var r in t)r&&null!==t[r]&&r!==e&&(n[r]=t[r]);return n},e.getAttributes=function(t){for(var e,n={},r=t.attributes,o=0;o<r.length;o++)n[(e=r[o]).name]=e.value;return n},e.serializeDOMAttrs=function(t){return Array.from(t.attributes).reduce((function(t,e){var n;return Object.assign({},t,((n={})[e.name]=e.value,n))}),{})},e.commonAttributes=function(){return r.__assign({},e.createDefaultAttributes(["class","id","style"]))},e.createDefaultAttributes=function(t){return void 0===t&&(t=[]),r.__assign({},t.reduce((function(t,e){var n;return r.__assign({},t,((n={})[e]={default:null},n))}),{}))},e.hole=0,e.isSchemaNode=function(t){return function(e){return e.type.name===t}},e.isTable=e.isSchemaNode("table"),e.isTableBody=e.isSchemaNode("table_body"),e.isTableHead=e.isSchemaNode("table_head"),e.isTableFoot=e.isSchemaNode("table_foot"),e.isTableRow=e.isSchemaNode("table_row"),e.isTableCell=e.isSchemaNode("table_cell"),e.isTableHeaderCell=e.isSchemaNode("table_header")},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(8),i=n(42),s=function(t,e){return o.alignBlocks(o.alignRemoveRules)(t,e)},a={bold:function(t){return o.expandToWordWrap(o.toggleInlineFormat,r.__assign({},o.bold,{applyToWord:t}))},cleanFormatting:function(t){return o.cleanFormatting(t)},createLink:function(t){return o.expandToWordWrap(o.applyLink,{mark:"link",attrs:t.value,applyToWord:t.applyToWord})},fontFamily:function(t){return o.expandToWordWrap(o.applyInlineStyle,{style:"font-family",value:t.value,applyToWord:t.applyToWord})},fontSize:function(t){return o.expandToWordWrap(o.applyInlineStyle,{style:"font-size",value:t.value+"px",applyToWord:t.applyToWord})},insertFile:function(t){return o.expandToWordWrap(o.applyLink,{mark:"link",attrs:t,applyToWord:t.applyToWord})},insertText:function(t){return o.insertText(t)},italic:function(t){return o.expandToWordWrap(o.toggleInlineFormat,r.__assign({},o.italic,{applyToWord:t}))},strikethrough:function(t){return o.expandToWordWrap(o.toggleInlineFormat,r.__assign({},o.strikethrough,{applyToWord:t}))},subscript:function(t){return o.expandToWordWrap(o.toggleInlineFormat,r.__assign({},o.subscript,{applyToWord:t}))},superscript:function(t){return o.expandToWordWrap(o.toggleInlineFormat,r.__assign({},o.superscript,{applyToWord:t}))},underline:function(t){return o.expandToWordWrap(o.toggleInlineFormat,r.__assign({},o.underline,{applyToWord:t}))},unlink:function(){return o.removeLink(o.link)},foreColor:function(t){return o.expandToWordWrap(o.applyInlineStyle,{style:"color",value:t.value,applyToWord:t.applyToWord})},backColor:function(t){return o.expandToWordWrap(o.applyInlineStyle,{style:"background-color",value:t.value,applyToWord:t.applyToWord})},selectAll:function(){return function(t,e){return o.selectAll(t,e)}}},c={alignCenter:function(){return function(t,e){return o.isAligned(t,o.alignCenterRules)?s(t,e):o.alignBlocks(o.alignCenterRules)(t,e)}},alignJustify:function(){return function(t,e){return o.isAligned(t,o.alignJustifyRules)?s(t,e):o.alignBlocks(o.alignJustifyRules)(t,e)}},alignLeft:function(){return function(t,e){return o.isAligned(t,o.alignLeftRules)?s(t,e):o.alignBlocks(o.alignLeftRules)(t,e)}},alignRight:function(){return function(t,e){return o.isAligned(t,o.alignRightRules)?s(t,e):o.alignBlocks(o.alignRightRules)(t,e)}},format:function(t){return o.formatBlockElements(t.tag)},getHTML:function(){return o.getHtml},indent:function(){return o.indent},insertImage:function(t){return o.insertImage(t)},insertOrderedList:function(){return o.toggleOrderedList},insertUnorderedList:function(){return o.toggleUnorderedList},outdent:function(){return o.outdent},redo:function(){return o.redo},setHTML:function(t){var e=t.content,n=t.parseOptions;return o.setHtml(e,"setHTML",n)},undo:function(){return o.undo},blockquote:function(){return o.blockquote}},u={insertTable:function(t){return i.insertTable(t)},addColumnBefore:function(){return o.addColumnBefore},addColumnAfter:function(){return o.addColumnAfter},addRowBefore:function(){return o.addRowBefore},addRowAfter:function(){return o.addRowAfter},deleteRow:function(){return o.deleteRow},deleteColumn:function(){return o.deleteColumn},mergeCells:function(){return o.mergeCells},splitCell:function(){return o.splitCell},deleteTable:function(){return o.deleteTable}};e.editorCommands=Object.assign({},a,c,u)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(8);e.insertTable=function(t){return function(e,n){var o=r.createTable(e.schema.nodes,t.rows,t.cols);o&&r.insertNode(o,!0)(e,n)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(8),o=n(8);e.getToolbarState=function(t,e){return{alignCenter:{selected:o.isAligned(t,o.alignCenterRules),disabled:!1},alignJustify:{selected:o.isAligned(t,o.alignJustifyRules),disabled:!1},alignLeft:{selected:o.isAligned(t,o.alignLeftRules),disabled:!1},alignRight:{selected:o.isAligned(t,o.alignRightRules),disabled:!1},bold:{selected:o.hasMark(t,o.bold),disabled:!1},cleanFormatting:{selected:!1,disabled:!r.cleanFormatting()(t)},format:{selected:o.activeNode(t),disabled:!1},blockquote:{selected:!1,disabled:!r.blockquote(t)},indent:{selected:!1,disabled:!(o.canIndentAsListItem(t,t.schema.nodes.list_item)||o.canBeIndented(t,o.indentRules))},insertOrderedList:{selected:o.hasNode(t,t.schema.nodes.ordered_list),disabled:!1},insertUnorderedList:{selected:o.hasNode(t,t.schema.nodes.bullet_list),disabled:!1},italic:{selected:o.hasMark(t,o.italic),disabled:!1},unlink:{selected:!1,disabled:!o.hasMark(t,o.link)},outdent:{selected:!1,get disabled(){return!(o.hasNode(t,t.schema.nodes.blockquote)||o.canOutdentAsListItem(t,o.outdentRules)||r.isIndented(t,o.outdentRules.nodes))}},redo:{selected:!1,disabled:!o.redo(t)},selectAll:{selected:!1,disabled:!1},strikethrough:{selected:o.hasMark(t,o.strikethrough),disabled:!1},style:{selected:o.getActiveMarks(t,t.schema.marks.style),disabled:!1},subscript:{selected:o.hasMark(t,o.subscript),disabled:!1},superscript:{selected:o.hasMark(t,o.superscript),disabled:!1},underline:{selected:o.hasMark(t,o.underline),disabled:!1},undo:{selected:!1,disabled:!o.undo(t)},createLink:{selected:!1,get disabled(){var n=t.selection.empty;return e&&e.applyToWord&&n?o.expandSelection(t,(function(){}),e).state.selection.empty:n}},insertFile:{selected:!1,disabled:t.selection.empty},insertImage:{selected:!1,disabled:!1},viewSource:{selected:!1,disabled:!1},print:{selected:!1,disabled:!1},insertTable:{selected:!1,disabled:!1},addColumnBefore:{selected:!1,disabled:!o.addColumnBefore(t)},addColumnAfter:{selected:!1,disabled:!o.addColumnAfter(t)},addRowBefore:{selected:!1,disabled:!o.addRowBefore(t)},addRowAfter:{selected:!1,disabled:!o.addRowAfter(t)},deleteRow:{selected:!1,disabled:!o.deleteRow(t)},deleteColumn:{selected:!1,disabled:!o.deleteColumn(t)},mergeCells:{selected:!1,disabled:!o.mergeCells(t)},splitCell:{selected:!1,disabled:!o.splitCell(t)},deleteTable:{selected:!1,disabled:!o.deleteTable(t)}}},e.initialToolBarState={alignCenter:{selected:!1,disabled:!1},alignJustify:{selected:!1,disabled:!1},alignLeft:{selected:!1,disabled:!1},alignRight:{selected:!1,disabled:!1},bold:{selected:!1,disabled:!1},italic:{selected:!1,disabled:!1},underline:{selected:!1,disabled:!1},strikethrough:{selected:!1,disabled:!1},subscript:{selected:!1,disabled:!1},superscript:{selected:!1,disabled:!1},format:{selected:{text:"Format",tag:null},disabled:!1},style:{selected:{marks:[],hasNodesWithoutMarks:!1},disabled:!1},cleanFormatting:{selected:!1,disabled:!0},blockquote:{selected:!1,disabled:!1},indent:{selected:!1,disabled:!1},outdent:{selected:!1,disabled:!1},insertOrderedList:{selected:!1,disabled:!1},insertUnorderedList:{selected:!1,disabled:!1},unlink:{selected:!1,disabled:!0},redo:{selected:!1,disabled:!0},undo:{selected:!1,disabled:!0},print:{selected:!1,disabled:!1},createLink:{selected:!1,disabled:!0},insertFile:{selected:!1,disabled:!0},insertImage:{selected:!1,disabled:!1},viewSource:{selected:!1,disabled:!1},insertTable:{selected:!1,disabled:!1},addColumnBefore:{selected:!1,disabled:!0},addColumnAfter:{selected:!1,disabled:!0},addRowBefore:{selected:!1,disabled:!0},addRowAfter:{selected:!1,disabled:!0},deleteRow:{selected:!1,disabled:!0},deleteColumn:{selected:!1,disabled:!0},mergeCells:{selected:!1,disabled:!0},splitCell:{selected:!1,disabled:!0},deleteTable:{selected:!1,disabled:!0},selectAll:{selected:!1,disabled:!1}},e.disabledToolBarState={alignCenter:{selected:!1,disabled:!0},alignJustify:{selected:!1,disabled:!0},alignLeft:{selected:!1,disabled:!0},alignRight:{selected:!1,disabled:!0},bold:{selected:!1,disabled:!0},italic:{selected:!1,disabled:!0},underline:{selected:!1,disabled:!0},strikethrough:{selected:!1,disabled:!0},subscript:{selected:!1,disabled:!0},superscript:{selected:!1,disabled:!0},format:{selected:{text:"Format",tag:null},disabled:!0},style:{selected:{marks:[],hasNodesWithoutMarks:!1},disabled:!0},cleanFormatting:{selected:!1,disabled:!0},blockquote:{selected:!1,disabled:!0},indent:{selected:!1,disabled:!0},outdent:{selected:!1,disabled:!0},insertOrderedList:{selected:!1,disabled:!0},insertUnorderedList:{selected:!1,disabled:!0},unlink:{selected:!1,disabled:!0},redo:{selected:!1,disabled:!0},undo:{selected:!1,disabled:!0},print:{selected:!1,disabled:!0},createLink:{selected:!1,disabled:!0},insertFile:{selected:!1,disabled:!0},insertImage:{selected:!1,disabled:!0},viewSource:{selected:!1,disabled:!0},insertTable:{selected:!1,disabled:!0},addColumnBefore:{selected:!1,disabled:!0},addColumnAfter:{selected:!1,disabled:!0},addRowBefore:{selected:!1,disabled:!0},addRowAfter:{selected:!1,disabled:!0},deleteRow:{selected:!1,disabled:!0},deleteColumn:{selected:!1,disabled:!0},mergeCells:{selected:!1,disabled:!0},splitCell:{selected:!1,disabled:!0},deleteTable:{selected:!1,disabled:!0},selectAll:{selected:!1,disabled:!0}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.defaultStyle='\n html, body {\n margin: 0;\n height: 100%;\n padding: 0;\n }\n\n html {\n min-height: 100%;\n }\n\n body {\n box-sizing: border-box;\n position: relative;\n word-wrap: break-word;\n padding: 8px;\n }\n\n body > .k-content {\n outline: 0;\n height: 100%;\n white-space: pre-wrap;\n }\n\n div.ProseMirror {\n position: relative;\n word-wrap: break-word;\n white-space: pre-wrap;\n white-space: break-spaces;\n -webkit-font-variant-ligatures: none;\n font-variant-ligatures: none;\n font-feature-settings: "liga" 0; /* the above doesn\'t seem to work in Edge */\n }\n\n .ProseMirror pre {\n white-space: pre-wrap;\n }\n\n .k-content > p {\n margin: 0 0 1em;\n }\n\n .k-content table {\n white-space: pre-wrap;\n }\n\n .k-content .k-text-selected, .k-content::selection {\n color: HighlightText;\n background-color: Highlight;\n }\n\n .k-content .k-text-highlighted {\n background-color: #bbdefb;\n }\n\n .k-content .ProseMirror-selectednode {\n outline: 2px solid #8cf;\n }\n\n .ProseMirror-hideselection *::selection { background: transparent; }\n .ProseMirror-hideselection *::-moz-selection { background: transparent; }\n .ProseMirror-hideselection { caret-color: transparent; }\n\n .ProseMirror-gapcursor {\n display: none;\n pointer-events: none;\n position: absolute;\n }\n\n .ProseMirror-gapcursor:after {\n content: "";\n display: block;\n position: absolute;\n top: -2px;\n width: 20px;\n border-top: 1px solid black;\n animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;\n }\n\n @keyframes ProseMirror-cursor-blink {\n to {\n visibility: hidden;\n }\n }\n\n .ProseMirror-focused .ProseMirror-gapcursor {\n display: block;\n }\n\n .k-editor-resize-handles-wrapper {\n position: absolute;\n visibility: hidden;\n }\n\n .k-editor-resize-handle {\n position: absolute;\n visibility: visible;\n background-color: #fff;\n border: 1px solid #000;\n z-index: 100;\n width: 5px;\n height: 5px;\n }\n\n .k-editor-resize-handle.northwest {\n top: 0;\n left: 0;\n transform: translate(-50%, -50%);\n cursor: nw-resize;\n }\n\n .k-editor-resize-handle.north {\n top: 0;\n left: 50%;\n transform: translate(-50%, -50%);\n cursor: n-resize;\n }\n\n .k-editor-resize-handle.northeast {\n top: 0;\n right: 0;\n transform: translate(50%, -50%);\n cursor: ne-resize;\n }\n\n .k-editor-resize-handle.southwest {\n left: 0;\n bottom: 0;\n transform: translate(-50%, 50%);\n cursor: sw-resize;\n }\n\n .k-editor-resize-handle.south {\n bottom: 0;\n left: 50%;\n transform: translate(-50%, 50%);\n cursor: s-resize;\n }\n\n .k-editor-resize-handle.southeast {\n right: 0;\n bottom: 0;\n transform: translate(50%, 50%);\n cursor: se-resize;\n }\n\n .k-editor-resize-handle.west {\n top: 50%;\n left: 0;\n transform: translate(-50%, -50%);\n cursor: w-resize;\n }\n\n .k-editor-resize-handle.east {\n top: 50%;\n right: 0;\n transform: translate(50%, -50%);\n cursor: e-resize;\n }\n\n .ProseMirror .k-placeholder::before {\n content: attr(data-placeholder);\n height: 0;\n color: #8a8a8a;\n float: left;\n opacity: 1;\n cursor: text;\n -webkit-user-select: none;\n -ms-user-select: none;\n user-select: none;\n }\n\n .ProseMirror li {\n position: relative;\n }\n\n li.ProseMirror-selectednode {\n outline: none;\n }\n\n li.ProseMirror-selectednode:after {\n content: "";\n position: absolute;\n left: -32px;\n right: -2px;\n top: -2px;\n bottom: -2px;\n border: 2px solid #8cf;\n pointer-events: none;\n }\n',e.tablesStyles='\n.ProseMirror .tableWrapper {\n overflow-x: auto;\n margin: 1em 0;\n}\n\n.ProseMirror table {\n margin: 0;\n border-collapse: collapse;\n table-layout: fixed;\n width: 100%;\n overflow: hidden;\n}\n\n.ProseMirror td, .ProseMirror th {\n min-width: 1em;\n border: 1px solid #ddd;\n padding: 3px 5px;\n vertical-align: top;\n box-sizing: border-box;\n position: relative;\n}\n\n.ProseMirror th {\n font-weight: bold;\n text-align: left;\n}\n\n.ProseMirror .column-resize-handle {\n position: absolute;\n right: -2px; top: 0; bottom: 0;\n width: 4px;\n z-index: 20;\n background-color: #adf;\n pointer-events: none;\n}\n\n.ProseMirror.resize-cursor {\n cursor: ew-resize;\n cursor: col-resize;\n}\n\n/* Give selected cells a blue overlay */\n.ProseMirror .selectedCell:after {\n z-index: 2;\n position: absolute;\n content: "";\n left: 0; right: 0; top: 0; bottom: 0;\n background: rgba(200, 200, 255, 0.4);\n pointer-events: none;\n}\n',e.rtlStyles="body { direction: rtl }"},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(46),s=n(12),a=n(4),c=n(13),u=n(7),l=n(47),d=n(16),p=n(3),f=n(25),h=n(24),m=n(26),v=n(29),g=n(30),y=n(31),b=n(32),w=n(48),_=n(49),x=n(50),k=n(20),C=n(51),S=n(53),T=n(54),E=n(55),M=n(56),O=n(57),D=n(58),I=n(59),A=n(60),N=n(61),B=n(62),z=n(63),P=n(64),R=n(65),F=n(66),L=n(67),V=n(68),j=n(69),$=n(70),W=n(71),H=n(72),q=n(73),J=n(74),K=n(75),U=n(76),G=n(77),Y=n(78),X=n(79),Z=n(80),Q=n(81),tt=n(82),et=n(83),nt=n(84),rt=n(85),ot=n(86),it=n(87),st=n(88),at=n(89),ct=n(17),ut=n(18),lt=n(19),dt=n(33),pt=n(90),ft=n(91),ht=n(92),mt=[T.EditorAlignLeftButtonDirective,E.EditorAlignCenterButtonDirective,M.EditorAlignRightButtonDirective,O.EditorAlignJustifyButtonDirective,K.EditorInsertFileButtonDirective,I.EditorRedoButtonDirective,A.EditorUndoButtonDirective,N.EditorInsertImageButtonDirective,B.EditorIndentButtonDirective,z.EditorOutdentButtonDirective,P.EditorCreateLinkButtonDirective,R.EditorUnlinkButtonDirective,F.EditorInsertOrderedListButtonDirective,L.EditorInsertUnorderedListButtonDirective,V.EditorViewSourceButtonDirective,j.EditorBoldButtonDirective,$.EditorItalicButtonDirective,W.EditorUnderlineButtonDirective,H.EditorStrikethroughButtonDirective,q.EditorSubscriptButtonDirective,J.EditorSuperscriptButtonDirective,U.EditorForeColorDirective,G.EditorBackColorDirective,Y.EditorCleanFormattingButtonDirective,X.EditorAddColumnBeforeButtonDirective,Z.EditorAddColumnAfterButtonDirective,Q.EditorAddRowBeforeButtonDirective,tt.EditorAddRowAfterButtonDirective,et.EditorDeleteColumnButtonDirective,nt.EditorDeleteRowButtonDirective,rt.EditorDeleteTableButtonDirective,ot.EditorMergeCellsButtonDirective,it.EditorSplitCellButtonDirective,at.CustomMessagesComponent,st.LocalizedMessagesDirective,pt.DropDownToolDirective,ft.EditorPrintDirective,ht.EditorSelectAllButtonDirective,D.EditorBlockquoteDirective],vt=[_.EditorFontSizeComponent,x.EditorFontFamilyComponent,w.EditorFormatComponent,k.EditorColorPickerComponent,C.EditorInsertTableButtonComponent],gt=[m.FileLinkDialogComponent,f.ImageDialogComponent,h.SourceDialogComponent,v.FormatDialogComponent,g.ColorPickerDialogComponent,y.FontFamilyDialogComponent,dt.FontSizeDialogComponent,b.InsertTableDialogComponent],yt=[S.PopupTableGridComponent,ct.FormatDropDownListComponent,ut.FontFamilyDropDownListComponent,lt.FontSizeDropDownListComponent],bt=function(){function t(){}return t=r.__decorate([o.NgModule({declarations:[p.EditorComponent,mt,vt,gt,yt],entryComponents:[gt],exports:[p.EditorComponent,mt,vt,a.ToolBarModule,l.ButtonModule,s.FormsModule,s.ReactiveFormsModule,yt],imports:[i.CommonModule,s.FormsModule,s.ReactiveFormsModule,l.ButtonModule,d.ColorPickerModule,u.DialogModule,c.DropDownsModule,d.NumericTextBoxModule,d.CheckBoxModule,a.ToolBarModule,d.TextBoxModule]})],t)}();e.EditorModule=bt},function(t,e){t.exports=l},function(t,e){t.exports=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(4),s=n(7),a=n(9),c=n(3),u=n(2),l=n(29),d=n(17),p=n(5),f=function(t){function e(e,n,r,i){var s=t.call(this)||this;return s.editor=e,s.dialogService=n,s.localization=r,s.toolsService=i,s.disabled=!1,s.tabindex=-1,s.valueChange=new o.EventEmitter,s._data=[{text:"Paragraph",tag:"p"},{text:"Heading 1",tag:"h1"},{text:"Heading 2",tag:"h2"},{text:"Heading 3",tag:"h3"},{text:"Heading 4",tag:"h4"},{text:"Heading 5",tag:"h5"},{text:"Heading 6",tag:"h6"}],s}var n;return r.__extends(e,t),n=e,Object.defineProperty(e.prototype,"data",{get:function(){return this._data},set:function(t){this._data=t||this._data},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){var t=this;this.itemDisabled=function(e){return!(t.overflows||!t.formatDropDownList||t.formatDropDownList.dropDownList.isOpen)||null===e.dataItem.tag},setTimeout((function(){t.defaultItem={text:t.title,tag:null},t.toolsService.needsCheck.next()})),this.subs=this.editor.stateChange.subscribe((function(e){var n=e.format,r=t.data.findIndex((function(t){return t.tag===n.selected.tag}));t.value=-1!==r?n.selected.tag:null,t.disabled=n.disabled}))},e.prototype.onValueChange=function(t){a.isPresent(t)&&(this.editor.exec("format",{tag:t}),this.editor.view.focus(),this.valueChange.emit(this.data.find((function(e){return e.tag===t}))))},e.prototype.ngOnDestroy=function(){this.subs&&this.subs.unsubscribe()},Object.defineProperty(e.prototype,"outerWidth",{get:function(){var t=this.formatDropDownList.element;if(t)return a.outerWidth(t.nativeElement)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"title",{get:function(){return this.localization.get("format")},enumerable:!0,configurable:!0}),e.prototype.openDialog=function(){var t={appendTo:this.editor.dialogContainer,content:l.FormatDialogComponent};this.editor.toolbar.toggle(!1),this.dialogService.open(t).content.instance.setData({editor:this.editor,data:this.data,defaultItem:this.defaultItem,value:this.value,itemDisabled:this.itemDisabled})},e.prototype.canFocus=function(){return!this.disabled},e.prototype.focus=function(){this.tabindex=0,this.overflows?this.formatButton.nativeElement.focus():this.formatDropDownList.focus()},e.prototype.handleKey=function(){return this.tabindex=-1,!1},r.__decorate([o.Input(),r.__metadata("design:type",Array),r.__metadata("design:paramtypes",[Array])],e.prototype,"data",null),r.__decorate([o.Output(),r.__metadata("design:type",o.EventEmitter)],e.prototype,"valueChange",void 0),r.__decorate([o.ViewChild("toolbarTemplate",{static:!0}),r.__metadata("design:type",o.TemplateRef)],e.prototype,"toolbarTemplate",void 0),r.__decorate([o.ViewChild("popupTemplate",{static:!0}),r.__metadata("design:type",o.TemplateRef)],e.prototype,"popupTemplate",void 0),r.__decorate([o.ViewChild("formatDropDownList",{static:!1}),r.__metadata("design:type",d.FormatDropDownListComponent)],e.prototype,"formatDropDownList",void 0),r.__decorate([o.ViewChild("formatButton",{static:!1}),r.__metadata("design:type",o.ElementRef)],e.prototype,"formatButton",void 0),e=n=r.__decorate([o.Component({providers:[{provide:i.ToolBarToolComponent,useExisting:o.forwardRef((function(){return n}))}],selector:"kendo-toolbar-dropdownlist[kendoEditorFormat]",template:'\n <ng-template #toolbarTemplate>\n <kendo-editor-format-dropdownlist\n #formatDropDownList\n [defaultItem]="defaultItem"\n [data]="data"\n [(value)]="value"\n [itemDisabled]="itemDisabled"\n [title]="title"\n [disabled]="disabled"\n [tabindex]="tabindex"\n (valueChange)="onValueChange($event)"\n >\n </kendo-editor-format-dropdownlist>\n </ng-template>\n <ng-template #popupTemplate>\n <button\n #formatButton\n [tabindex]="tabindex"\n type="button"\n kendoButton\n class="k-overflow-button"\n [icon]="\'apply-format\'"\n [attr.title]="title"\n [disabled]="disabled"\n [tabindex]="tabindex"\n (click)="openDialog()"\n >\n {{ title }}\n </button>\n </ng-template>\n '}),r.__param(0,o.Host()),r.__metadata("design:paramtypes",[c.EditorComponent,s.DialogService,u.EditorLocalizationService,p.EditorToolsService])],e)}(i.ToolBarToolComponent);e.EditorFormatComponent=f},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(4),s=n(9),a=n(3),c=n(2),u=n(7),l=n(33),d=n(19),p=n(5),f=function(t){function e(e,n,r,i){var s=t.call(this)||this;return s.editor=e,s.dialogService=n,s.localization=r,s.toolsService=i,s.disabled=!1,s.tabindex=-1,s.valueChange=new o.EventEmitter,s._data=[{text:"8px",size:8},{text:"10px",size:10},{text:"12px",size:12},{text:"14px",size:14},{text:"18px",size:18},{text:"24px",size:24},{text:"36px",size:36}],s}var n;return r.__extends(e,t),n=e,Object.defineProperty(e.prototype,"data",{get:function(){return this._data},set:function(t){this._data=t||this._data},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){var t=this;this.itemDisabled=function(e){return!(t.overflows||!t.fontSizeDropDownList||t.fontSizeDropDownList.dropDownList.isOpen)||null===e.dataItem.size},setTimeout((function(){t.defaultItem={text:t.title,size:null},t.toolsService.needsCheck.next()})),this.subs=this.editor.stateChange.subscribe((function(e){var n=e.style;t.value=(s.getUniqueStyleValues(n.selected,"font-size").match(/\d+/g)||[null])[0],t.disabled=n.disabled}))},e.prototype.onValueChange=function(t){s.isPresent(t)&&(this.editor.exec("fontSize",t),this.editor.view.focus(),this.valueChange.emit(this.data.find((function(e){return e.size===parseInt(t,10)}))))},e.prototype.ngOnDestroy=function(){this.subs&&this.subs.unsubscribe()},Object.defineProperty(e.prototype,"outerWidth",{get:function(){if(this.element)return s.outerWidth(this.element.nativeElement)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"title",{get:function(){return this.localization.get("fontSize")},enumerable:!0,configurable:!0}),e.prototype.openDialog=function(){var t={appendTo:this.editor.dialogContainer,content:l.FontSizeDialogComponent};this.editor.toolbar.toggle(!1),this.dialogService.open(t).content.instance.setData({editor:this.editor,data:this.data,defaultItem:this.defaultItem,value:this.value,itemDisabled:this.itemDisabled})},e.prototype.canFocus=function(){return!this.disabled},e.prototype.focus=function(){this.tabindex=0,this.overflows?this.fontSizeButton.nativeElement.focus():this.fontSizeDropDownList.focus()},e.prototype.handleKey=function(){return this.tabindex=-1,!1},r.__decorate([o.Input(),r.__metadata("design:type",Array),r.__metadata("design:paramtypes",[Array])],e.prototype,"data",null),r.__decorate([o.Output(),r.__metadata("design:type",o.EventEmitter)],e.prototype,"valueChange",void 0),r.__decorate([o.ViewChild("toolbarTemplate",{static:!0}),r.__metadata("design:type",o.TemplateRef)],e.prototype,"toolbarTemplate",void 0),r.__decorate([o.ViewChild("popupTemplate",{static:!0}),r.__metadata("design:type",o.TemplateRef)],e.prototype,"popupTemplate",void 0),r.__decorate([o.ViewChild("element",{static:!1}),r.__metadata("design:type",o.ElementRef)],e.prototype,"element",void 0),r.__decorate([o.ViewChild("element",{read:d.FontSizeDropDownListComponent,static:!1}),r.__metadata("design:type",d.FontSizeDropDownListComponent)],e.prototype,"fontSizeDropDownList",void 0),r.__decorate([o.ViewChild("fontSizeButton",{static:!1}),r.__metadata("design:type",o.ElementRef)],e.prototype,"fontSizeButton",void 0),e=n=r.__decorate([o.Component({providers:[{provide:i.ToolBarToolComponent,useExisting:o.forwardRef((function(){return n}))}],selector:"kendo-toolbar-dropdownlist[kendoEditorFontSize]",template:'\n <ng-template #toolbarTemplate>\n <kendo-editor-fontsize-dropdownlist\n #element\n [defaultItem]="defaultItem"\n [data]="data"\n [(value)]="value"\n [itemDisabled]="itemDisabled"\n [title]="title"\n [disabled]="disabled"\n [tabindex]="tabindex"\n (valueChange)="onValueChange($event)"\n >\n </kendo-editor-fontsize-dropdownlist>\n </ng-template>\n <ng-template #popupTemplate>\n <button\n tabindex="-1"\n type="button"\n kendoButton\n #fontSizeButton\n class="k-overflow-button"\n [icon]="\'font-size\'"\n [attr.title]="title"\n [disabled]="disabled"\n [tabindex]="tabindex"\n (click)="openDialog()"\n >\n {{ title }}\n </button>\n </ng-template>\n '}),r.__param(0,o.Host()),r.__metadata("design:paramtypes",[a.EditorComponent,u.DialogService,c.EditorLocalizationService,p.EditorToolsService])],e)}(i.ToolBarToolComponent);e.EditorFontSizeComponent=f},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(4),s=n(9),a=n(3),c=n(2),u=n(7),l=n(31),d=n(18),p=n(5),f=function(t){function e(e,n,r,i){var s=t.call(this)||this;return s.editor=e,s.dialogService=n,s.localization=r,s.toolsService=i,s.disabled=!1,s.tabindex=-1,s.valueChange=new o.EventEmitter,s._data=[{text:"Arial",fontName:'Arial,"Helvetica Neue",Helvetica,sans-serif'},{text:"Courier New",fontName:'"Courier New",Courier,"Lucida Sans Typewriter","Lucida Typewriter",monospace'},{text:"Georgia",fontName:'Georgia,Times,"Times New Roman",serif'},{fontName:'Impact,Haettenschweiler,"Franklin Gothic Bold",Charcoal,"Helvetica Inserat","Bitstream Vera Sans Bold","Arial Black","sans serif"',text:"Impact"},{text:"Lucida Console",fontName:'"Lucida Console","Lucida Sans Typewriter",monaco,"Bitstream Vera Sans Mono",monospace'},{text:"Tahoma",fontName:"Tahoma,Verdana,Segoe,sans-serif"},{text:"Times New Roman",fontName:'TimesNewRoman,"Times New Roman",Times,Baskerville,Georgia,serif'},{text:"Trebuchet MS",fontName:'"Trebuchet MS","Lucida Grande","Lucida Sans Unicode","Lucida Sans",Tahoma,sans-serif'},{text:"Verdana",fontName:"Verdana,Geneva,sans-serif"}],s}var n;return r.__extends(e,t),n=e,Object.defineProperty(e.prototype,"data",{get:function(){return this._data},set:function(t){this._data=t||this._data},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){var t=this;this.itemDisabled=function(e){return!(t.overflows||!t.fontFamilyDropDownList||t.fontFamilyDropDownList.dropDownList.isOpen)||null===e.dataItem.fontName},setTimeout((function(){t.defaultItem={text:t.title,fontName:null},t.toolsService.needsCheck.next()})),this.subs=this.editor.stateChange.subscribe((function(e){var n=e.style;t.value=s.getUniqueStyleValues(n.selected,"font-family")||null,t.disabled=n.disabled}))},e.prototype.onValueChange=function(t){s.isPresent(t)&&(this.editor.exec("fontFamily",t),this.editor.view.focus(),this.valueChange.emit(this.data.find((function(e){return e.fontName===t}))))},e.prototype.ngOnDestroy=function(){this.subs&&this.subs.unsubscribe()},Object.defineProperty(e.prototype,"outerWidth",{get:function(){if(this.element)return s.outerWidth(this.element.nativeElement)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"title",{get:function(){return this.localization.get("fontFamily")},enumerable:!0,configurable:!0}),e.prototype.openDialog=function(){var t={appendTo:this.editor.dialogContainer,content:l.FontFamilyDialogComponent};this.editor.toolbar.toggle(!1),this.dialogService.open(t).content.instance.setData({editor:this.editor,data:this.data,defaultItem:this.defaultItem,value:this.value,itemDisabled:this.itemDisabled})},e.prototype.canFocus=function(){return!this.disabled},e.prototype.focus=function(){this.tabindex=0,this.overflows?this.fontFamilyButton.nativeElement.focus():this.fontFamilyDropDownList.focus()},e.prototype.handleKey=function(){return this.tabindex=-1,!1},r.__decorate([o.Input(),r.__metadata("design:type",Array),r.__metadata("design:paramtypes",[Array])],e.prototype,"data",null),r.__decorate([o.Output(),r.__metadata("design:type",o.EventEmitter)],e.prototype,"valueChange",void 0),r.__decorate([o.ViewChild("toolbarTemplate",{static:!0}),r.__metadata("design:type",o.TemplateRef)],e.prototype,"toolbarTemplate",void 0),r.__decorate([o.ViewChild("popupTemplate",{static:!0}),r.__metadata("design:type",o.TemplateRef)],e.prototype,"popupTemplate",void 0),r.__decorate([o.ViewChild("element",{static:!1}),r.__metadata("design:type",o.ElementRef)],e.prototype,"element",void 0),r.__decorate([o.ViewChild("element",{read:d.FontFamilyDropDownListComponent,static:!1}),r.__metadata("design:type",d.FontFamilyDropDownListComponent)],e.prototype,"fontFamilyDropDownList",void 0),r.__decorate([o.ViewChild("fontFamilyButton",{static:!1}),r.__metadata("design:type",o.ElementRef)],e.prototype,"fontFamilyButton",void 0),e=n=r.__decorate([o.Component({providers:[{provide:i.ToolBarToolComponent,useExisting:o.forwardRef((function(){return n}))}],selector:"kendo-toolbar-dropdownlist[kendoEditorFontFamily]",template:'\n <ng-template #toolbarTemplate>\n <kendo-editor-fontfamily-dropdownlist\n #element\n [defaultItem]="defaultItem"\n [data]="data"\n [(value)]="value"\n [itemDisabled]="itemDisabled"\n [title]="title"\n [disabled]="disabled"\n [tabindex]="tabindex"\n (valueChange)="onValueChange($event)"\n >\n </kendo-editor-fontfamily-dropdownlist>\n </ng-template>\n <ng-template #popupTemplate>\n <button\n tabindex="-1"\n type="button"\n kendoButton\n #fontFamilyButton\n class="k-overflow-button"\n [icon]="\'font-family\'"\n [attr.title]="title"\n [disabled]="disabled"\n [tabindex]="tabindex"\n (click)="openDialog()"\n >\n {{ title }}\n </button>\n </ng-template>\n '}),r.__param(0,o.Host()),r.__metadata("design:paramtypes",[a.EditorComponent,u.DialogService,c.EditorLocalizationService,p.EditorToolsService])],e)}(i.ToolBarToolComponent);e.EditorFontFamilyComponent=f},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(15),s=n(22),a=n(4),c=n(52),u=n(9),l=n(3),d=n(2),p=n(7),f=n(32),h=n(10),m=function(t){function e(e,n,r,a){var c=t.call(this)||this;return c.editor=e,c.localization=n,c.popupService=r,c.dialogService=a,c.open=!1,c.buttonBlurred=new o.EventEmitter,c.cellClicked=new o.EventEmitter,c.subs=c.editor.stateChange.subscribe((function(t){var e=t.insertTable;c.disabled=e.disabled})),c.subs.add(c.buttonBlurred.pipe(s.concatMap((function(){return i.interval(200).pipe(s.take(1),s.takeUntil(c.cellClicked))}))).subscribe((function(){c.toggle(!1)}))),c}var n;return r.__extends(e,t),n=e,e.prototype.ngOnDestroy=function(){this.destroyPopup(),this.subs&&this.subs.unsubscribe()},Object.defineProperty(e.prototype,"outerWidth",{get:function(){if(this.element)return u.outerWidth(this.element.nativeElement)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"title",{get:function(){return this.localization.get("insertTable")},enumerable:!0,configurable:!0}),e.prototype.toggle=function(t){this.open=void 0===t?!this.open:t,this.destroyPopup(),this.open&&this.createPopup()},e.prototype.openDialog=function(){var t={appendTo:this.editor.dialogContainer,content:f.InsertTableDialogComponent};this.editor.toolbar.toggle(!1),this.dialogService.open(t).content.instance.setData({editor:this.editor})},e.prototype.onBlur=function(){this.tabIndex=-1,this.buttonBlurred.emit()},e.prototype.onCellClick=function(t){this.cellClicked.emit(),this.toggle(!1),this.editor.exec("insertTable",t)},e.prototype.canFocus=function(){return!this.disabled},e.prototype.focus=function(){this.tabIndex=0,this.getButton().focus()},e.prototype.handleKey=function(t){return t.keyCode===h.Keys.Space||t.keyCode===h.Keys.Enter||(this.tabIndex=-1,!1)},e.prototype.onTableWizardClick=function(){},e.prototype.createPopup=function(){var t="rtl"===this.editor.direction?"right":"left",e={horizontal:t,vertical:"bottom"},n={horizontal:t,vertical:"top"};this.popupRef=this.popupService.open({anchor:this.element,anchorAlign:e,animate:!0,content:this.popupGridTemplate,popupAlign:n,popupClass:"k-ct-popup k-group k-reset k-state-border-up",positionMode:"absolute"});var r=this.popupRef.popupElement;r.style.width="190px",r.style.height="164px",r.setAttribute("dir",this.editor.direction)},e.prototype.destroyPopup=function(){this.popupRef&&(this.popupRef.close(),this.popupRef=null)},e.prototype.getButton=function(){return(this.overflows?this.overflowElement:this.element).nativeElement},r.__decorate([o.ViewChild("toolbarTemplate",{static:!0}),r.__metadata("design:type",o.TemplateRef)],e.prototype,"toolbarTemplate",void 0),r.__decorate([o.ViewChild("popupTemplate",{static:!1}),r.__metadata("design:type",o.TemplateRef)],e.prototype,"popupTemplate",void 0),r.__decorate([o.ViewChild("element",{static:!1}),r.__metadata("design:type",o.ElementRef)],e.prototype,"element",void 0),r.__decorate([o.ViewChild("overflowElement",{static:!1}),r.__metadata("design:type",o.ElementRef)],e.prototype,"overflowElement",void 0),r.__decorate([o.ViewChild("popupGridTemplate",{static:!0}),r.__metadata("design:type",o.TemplateRef)],e.prototype,"popupGridTemplate",void 0),e=n=r.__decorate([o.Component({providers:[{provide:a.ToolBarToolComponent,useExisting:o.forwardRef((function(){return n}))}],selector:"kendo-editor-insert-table-button",template:'\n <ng-template #toolbarTemplate>\n <button\n type="button"\n kendoButton\n #element\n [attr.title]="title"\n [attr.tabindex]="tabIndex"\n [icon]="\'table-insert\'"\n [disabled]="disabled"\n (click)="toggle()"\n (blur)="onBlur()"\n ></button>\n </ng-template>\n <ng-template #popupTemplate>\n <button\n kendoButton\n #overflowElement\n [attr.title]="title"\n [attr.tabindex]="tabIndex"\n [icon]="\'table-insert\'"\n [disabled]="disabled"\n (click)="openDialog()">\n {{ title }}\n </button>\n </ng-template>\n <ng-template #popupGridTemplate>\n <kendo-popup-table-grid (cellClick)="onCellClick($event)" (tableWizardClick)="onTableWizardClick()"></kendo-popup-table-grid>\n </ng-template>\n '}),r.__param(0,o.Host()),r.__metadata("design:paramtypes",[l.EditorComponent,d.EditorLocalizationService,c.PopupService,p.DialogService])],e)}(a.ToolBarToolComponent);e.EditorInsertTableButtonComponent=m},function(t,e){t.exports=p},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=function(){function t(){this.cellClick=new o.EventEmitter,this.tableWizardClick=new o.EventEmitter,this.state={rows:-1,cols:-1},this.rows=6,this.cols=8}return Object.defineProperty(t.prototype,"message",{get:function(){var t=this.state,e=t.rows,n=t.cols;return"Create a "+(e>-1?e+1:"")+" "+(n>-1?"x":"")+" "+(n>-1?n+1:"")+" table"},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"cells",{get:function(){return Array.from(Array(this.rows*this.cols).keys())},enumerable:!0,configurable:!0}),t.prototype.selected=function(t){var e=this.state,n=e.rows,r=e.cols,o=Math.floor(t/this.cols),i=t%this.cols;return o<=n&&i<=r},t.prototype.setState=function(t){var e=Math.floor(t/this.cols),n=t%this.cols;this.state={rows:e,cols:n}},t.prototype.resetState=function(){this.state={rows:-1,cols:-1}},t.prototype.insertTable=function(){this.cellClick.emit(this.state)},t.prototype.openTableWizard=function(){this.tableWizardClick.emit()},r.__decorate([o.Output(),r.__metadata("design:type",o.EventEmitter)],t.prototype,"cellClick",void 0),r.__decorate([o.Output(),r.__metadata("design:type",o.EventEmitter)],t.prototype,"tableWizardClick",void 0),t=r.__decorate([o.Component({selector:"kendo-popup-table-grid",template:'\n <div style="border-color: inherit;" (mouseleave)="resetState()" (click)="insertTable()">\n <span *ngFor="let i of cells"\n class="k-ct-cell"\n [class.k-state-selected]="selected(i)"\n [class.k-state-disabled]="!selected(i)"\n (mouseenter)="setState(i)">\n </span>\n </div>\n <div class="k-status" unselectable="on">{{ message }}</div>\n \x3c!-- uncomment when TableWizard is completed\n <div class="k-editor-toolbar" unselectable="on">\n <button type="button" kendoButton class="k-tool" [icon]="\'table-wizard\'" (click)="openTableWizard()" title="Table Wizard">Table Wizard</button>\n </div>\n --\x3e\n '})],t)}();e.PopupTableGridComponent=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(4),s=n(3),a=n(6),c=n(2),u=n(5),l=function(t){function e(e,n,r,o){return t.call(this,"alignLeft",e,n,r,o)||this}return r.__extends(e,t),e=r.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorAlignLeftButton]"}),r.__param(1,o.Host()),r.__metadata("design:paramtypes",[i.ToolBarButtonComponent,s.EditorComponent,c.EditorLocalizationService,u.EditorToolsService])],e)}(a.EditorCommandButton);e.EditorAlignLeftButtonDirective=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(4),s=n(3),a=n(6),c=n(2),u=n(5),l=function(t){function e(e,n,r,o){return t.call(this,"alignCenter",e,n,r,o)||this}return r.__extends(e,t),e=r.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorAlignCenterButton]"}),r.__param(1,o.Host()),r.__metadata("design:paramtypes",[i.ToolBarButtonComponent,s.EditorComponent,c.EditorLocalizationService,u.EditorToolsService])],e)}(a.EditorCommandButton);e.EditorAlignCenterButtonDirective=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(4),s=n(3),a=n(6),c=n(2),u=n(5),l=function(t){function e(e,n,r,o){return t.call(this,"alignRight",e,n,r,o)||this}return r.__extends(e,t),e=r.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorAlignRightButton]"}),r.__param(1,o.Host()),r.__metadata("design:paramtypes",[i.ToolBarButtonComponent,s.EditorComponent,c.EditorLocalizationService,u.EditorToolsService])],e)}(a.EditorCommandButton);e.EditorAlignRightButtonDirective=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(4),s=n(3),a=n(6),c=n(2),u=n(5),l=function(t){function e(e,n,r,o){return t.call(this,"alignJustify",e,n,r,o)||this}return r.__extends(e,t),e=r.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorAlignJustifyButton]"}),r.__param(1,o.Host()),r.__metadata("design:paramtypes",[i.ToolBarButtonComponent,s.EditorComponent,c.EditorLocalizationService,u.EditorToolsService])],e)}(a.EditorCommandButton);e.EditorAlignJustifyButtonDirective=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(4),s=n(3),a=n(6),c=n(2),u=n(5),l=function(t){function e(e,n,r,o){var i=t.call(this,"blockquote",e,n,r,o)||this;return i.editor=n,i}return r.__extends(e,t),e=r.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorBlockquoteButton]"}),r.__param(1,o.Host()),r.__metadata("design:paramtypes",[i.ToolBarButtonComponent,s.EditorComponent,c.EditorLocalizationService,u.EditorToolsService])],e)}(a.EditorCommandButton);e.EditorBlockquoteDirective=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(4),s=n(3),a=n(6),c=n(2),u=n(5),l=function(t){function e(e,n,r,o){return t.call(this,"redo",e,n,r,o)||this}return r.__extends(e,t),e=r.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorRedoButton]"}),r.__param(1,o.Host()),r.__metadata("design:paramtypes",[i.ToolBarButtonComponent,s.EditorComponent,c.EditorLocalizationService,u.EditorToolsService])],e)}(a.EditorCommandButton);e.EditorRedoButtonDirective=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(4),s=n(3),a=n(6),c=n(2),u=n(5),l=function(t){function e(e,n,r,o){return t.call(this,"undo",e,n,r,o)||this}return r.__extends(e,t),e=r.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorUndoButton]"}),r.__param(1,o.Host()),r.__metadata("design:paramtypes",[i.ToolBarButtonComponent,s.EditorComponent,c.EditorLocalizationService,u.EditorToolsService])],e)}(a.EditorCommandButton);e.EditorUndoButtonDirective=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(4),s=n(3),a=n(14),c=n(2),u=n(5),l=function(t){function e(e,n,r,o){return t.call(this,"insertImage",e,n,r,o)||this}return r.__extends(e,t),e=r.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorInsertImageButton]"}),r.__param(1,o.Host()),r.__metadata("design:paramtypes",[i.ToolBarButtonComponent,s.EditorComponent,c.EditorLocalizationService,u.EditorToolsService])],e)}(a.EditorCommandDialog);e.EditorInsertImageButtonDirective=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(4),s=n(3),a=n(6),c=n(2),u=n(5),l=function(t){function e(e,n,r,o){return t.call(this,"indent",e,n,r,o)||this}return r.__extends(e,t),e=r.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorIndentButton]"}),r.__param(1,o.Host()),r.__metadata("design:paramtypes",[i.ToolBarButtonComponent,s.EditorComponent,c.EditorLocalizationService,u.EditorToolsService])],e)}(a.EditorCommandButton);e.EditorIndentButtonDirective=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(4),s=n(3),a=n(6),c=n(2),u=n(5),l=function(t){function e(e,n,r,o){return t.call(this,"outdent",e,n,r,o)||this}return r.__extends(e,t),e=r.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorOutdentButton]"}),r.__param(1,o.Host()),r.__metadata("design:paramtypes",[i.ToolBarButtonComponent,s.EditorComponent,c.EditorLocalizationService,u.EditorToolsService])],e)}(a.EditorCommandButton);e.EditorOutdentButtonDirective=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(4),s=n(3),a=n(14),c=n(2),u=n(5),l=function(t){function e(e,n,r,o){return t.call(this,"createLink",e,n,r,o)||this}return r.__extends(e,t),e=r.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorCreateLinkButton]"}),r.__param(1,o.Host()),r.__metadata("design:paramtypes",[i.ToolBarButtonComponent,s.EditorComponent,c.EditorLocalizationService,u.EditorToolsService])],e)}(a.EditorCommandDialog);e.EditorCreateLinkButtonDirective=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(4),s=n(3),a=n(6),c=n(2),u=n(5),l=function(t){function e(e,n,r,o){return t.call(this,"unlink",e,n,r,o)||this}return r.__extends(e,t),e=r.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorUnlinkButton]"}),r.__param(1,o.Host()),r.__metadata("design:paramtypes",[i.ToolBarButtonComponent,s.EditorComponent,c.EditorLocalizationService,u.EditorToolsService])],e)}(a.EditorCommandButton);e.EditorUnlinkButtonDirective=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(4),s=n(3),a=n(6),c=n(2),u=n(5),l=function(t){function e(e,n,r,o){return t.call(this,"insertOrderedList",e,n,r,o)||this}return r.__extends(e,t),e=r.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorInsertOrderedListButton]"}),r.__param(1,o.Host()),r.__metadata("design:paramtypes",[i.ToolBarButtonComponent,s.EditorComponent,c.EditorLocalizationService,u.EditorToolsService])],e)}(a.EditorCommandButton);e.EditorInsertOrderedListButtonDirective=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(4),s=n(3),a=n(6),c=n(2),u=n(5),l=function(t){function e(e,n,r,o){return t.call(this,"insertUnorderedList",e,n,r,o)||this}return r.__extends(e,t),e=r.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorInsertUnorderedListButton]"}),r.__param(1,o.Host()),r.__metadata("design:paramtypes",[i.ToolBarButtonComponent,s.EditorComponent,c.EditorLocalizationService,u.EditorToolsService])],e)}(a.EditorCommandButton);e.EditorInsertUnorderedListButtonDirective=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(4),s=n(3),a=n(14),c=n(2),u=n(5),l=function(t){function e(e,n,r,o){return t.call(this,"viewSource",e,n,r,o)||this}return r.__extends(e,t),e=r.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorViewSourceButton]"}),r.__param(1,o.Host()),r.__metadata("design:paramtypes",[i.ToolBarButtonComponent,s.EditorComponent,c.EditorLocalizationService,u.EditorToolsService])],e)}(a.EditorCommandDialog);e.EditorViewSourceButtonDirective=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(4),s=n(3),a=n(6),c=n(2),u=n(5),l=function(t){function e(e,n,r,o){return t.call(this,"bold",e,n,r,o)||this}return r.__extends(e,t),e=r.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorBoldButton]"}),r.__param(1,o.Host()),r.__metadata("design:paramtypes",[i.ToolBarButtonComponent,s.EditorComponent,c.EditorLocalizationService,u.EditorToolsService])],e)}(a.EditorCommandButton);e.EditorBoldButtonDirective=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(4),s=n(3),a=n(6),c=n(2),u=n(5),l=function(t){function e(e,n,r,o){return t.call(this,"italic",e,n,r,o)||this}return r.__extends(e,t),e=r.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorItalicButton]"}),r.__param(1,o.Host()),r.__metadata("design:paramtypes",[i.ToolBarButtonComponent,s.EditorComponent,c.EditorLocalizationService,u.EditorToolsService])],e)}(a.EditorCommandButton);e.EditorItalicButtonDirective=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(4),s=n(3),a=n(6),c=n(2),u=n(5),l=function(t){function e(e,n,r,o){return t.call(this,"underline",e,n,r,o)||this}return r.__extends(e,t),e=r.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorUnderlineButton]"}),r.__param(1,o.Host()),r.__metadata("design:paramtypes",[i.ToolBarButtonComponent,s.EditorComponent,c.EditorLocalizationService,u.EditorToolsService])],e)}(a.EditorCommandButton);e.EditorUnderlineButtonDirective=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(4),s=n(3),a=n(6),c=n(2),u=n(5),l=function(t){function e(e,n,r,o){return t.call(this,"strikethrough",e,n,r,o)||this}return r.__extends(e,t),e=r.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorStrikethroughButton]"}),r.__param(1,o.Host()),r.__metadata("design:paramtypes",[i.ToolBarButtonComponent,s.EditorComponent,c.EditorLocalizationService,u.EditorToolsService])],e)}(a.EditorCommandButton);e.EditorStrikethroughButtonDirective=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(4),s=n(3),a=n(6),c=n(2),u=n(5),l=function(t){function e(e,n,r,o){return t.call(this,"subscript",e,n,r,o)||this}return r.__extends(e,t),e=r.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorSubscriptButton]"}),r.__param(1,o.Host()),r.__metadata("design:paramtypes",[i.ToolBarButtonComponent,s.EditorComponent,c.EditorLocalizationService,u.EditorToolsService])],e)}(a.EditorCommandButton);e.EditorSubscriptButtonDirective=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(4),s=n(3),a=n(6),c=n(2),u=n(5),l=function(t){function e(e,n,r,o){return t.call(this,"superscript",e,n,r,o)||this}return r.__extends(e,t),e=r.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorSuperscriptButton]"}),r.__param(1,o.Host()),r.__metadata("design:paramtypes",[i.ToolBarButtonComponent,s.EditorComponent,c.EditorLocalizationService,u.EditorToolsService])],e)}(a.EditorCommandButton);e.EditorSuperscriptButtonDirective=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(3),s=n(14),a=n(4),c=n(2),u=n(5),l=function(t){function e(e,n,r,o){return t.call(this,"insertFile",e,n,r,o)||this}return r.__extends(e,t),e=r.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorInsertFileButton]"}),r.__param(1,o.Host()),r.__metadata("design:paramtypes",[a.ToolBarButtonComponent,i.EditorComponent,c.EditorLocalizationService,u.EditorToolsService])],e)}(s.EditorCommandDialog);e.EditorInsertFileButtonDirective=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(20),s=n(21),a=function(){function t(t){this.colorPicker=t,this.colorPicker.icon=s.commandIcons.foreColor,this.colorPicker.editorCommand="foreColor"}return t=r.__decorate([o.Directive({selector:"[kendoEditorForeColor]"}),r.__metadata("design:paramtypes",[i.EditorColorPickerComponent])],t)}();e.EditorForeColorDirective=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(20),s=n(21),a=function(){function t(t){this.colorPicker=t,this.colorPicker.icon=s.commandIcons.backColor,this.colorPicker.editorCommand="backColor"}return t=r.__decorate([o.Directive({selector:"[kendoEditorBackColor]"}),r.__metadata("design:paramtypes",[i.EditorColorPickerComponent])],t)}();e.EditorBackColorDirective=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(4),s=n(3),a=n(6),c=n(2),u=n(5),l=function(t){function e(e,n,r,o){return t.call(this,"cleanFormatting",e,n,r,o)||this}return r.__extends(e,t),e=r.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorCleanFormattingButton]"}),r.__param(1,o.Host()),r.__metadata("design:paramtypes",[i.ToolBarButtonComponent,s.EditorComponent,c.EditorLocalizationService,u.EditorToolsService])],e)}(a.EditorCommandButton);e.EditorCleanFormattingButtonDirective=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(4),s=n(3),a=n(6),c=n(2),u=n(5),l=function(t){function e(e,n,r,o){return t.call(this,"addColumnBefore",e,n,r,o)||this}return r.__extends(e,t),e=r.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorAddColumnBeforeButton]"}),r.__param(1,o.Host()),r.__metadata("design:paramtypes",[i.ToolBarButtonComponent,s.EditorComponent,c.EditorLocalizationService,u.EditorToolsService])],e)}(a.EditorCommandButton);e.EditorAddColumnBeforeButtonDirective=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(4),s=n(3),a=n(6),c=n(2),u=n(5),l=function(t){function e(e,n,r,o){return t.call(this,"addColumnAfter",e,n,r,o)||this}return r.__extends(e,t),e=r.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorAddColumnAfterButton]"}),r.__param(1,o.Host()),r.__metadata("design:paramtypes",[i.ToolBarButtonComponent,s.EditorComponent,c.EditorLocalizationService,u.EditorToolsService])],e)}(a.EditorCommandButton);e.EditorAddColumnAfterButtonDirective=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(4),s=n(3),a=n(6),c=n(2),u=n(5),l=function(t){function e(e,n,r,o){return t.call(this,"addRowBefore",e,n,r,o)||this}return r.__extends(e,t),e=r.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorAddRowBeforeButton]"}),r.__param(1,o.Host()),r.__metadata("design:paramtypes",[i.ToolBarButtonComponent,s.EditorComponent,c.EditorLocalizationService,u.EditorToolsService])],e)}(a.EditorCommandButton);e.EditorAddRowBeforeButtonDirective=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(4),s=n(3),a=n(6),c=n(2),u=n(5),l=function(t){function e(e,n,r,o){return t.call(this,"addRowAfter",e,n,r,o)||this}return r.__extends(e,t),e=r.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorAddRowAfterButton]"}),r.__param(1,o.Host()),r.__metadata("design:paramtypes",[i.ToolBarButtonComponent,s.EditorComponent,c.EditorLocalizationService,u.EditorToolsService])],e)}(a.EditorCommandButton);e.EditorAddRowAfterButtonDirective=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(4),s=n(3),a=n(6),c=n(2),u=n(5),l=function(t){function e(e,n,r,o){return t.call(this,"deleteColumn",e,n,r,o)||this}return r.__extends(e,t),e=r.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorDeleteColumnButton]"}),r.__param(1,o.Host()),r.__metadata("design:paramtypes",[i.ToolBarButtonComponent,s.EditorComponent,c.EditorLocalizationService,u.EditorToolsService])],e)}(a.EditorCommandButton);e.EditorDeleteColumnButtonDirective=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(4),s=n(3),a=n(6),c=n(2),u=n(5),l=function(t){function e(e,n,r,o){return t.call(this,"deleteRow",e,n,r,o)||this}return r.__extends(e,t),e=r.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorDeleteRowButton]"}),r.__param(1,o.Host()),r.__metadata("design:paramtypes",[i.ToolBarButtonComponent,s.EditorComponent,c.EditorLocalizationService,u.EditorToolsService])],e)}(a.EditorCommandButton);e.EditorDeleteRowButtonDirective=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(4),s=n(3),a=n(6),c=n(2),u=n(5),l=function(t){function e(e,n,r,o){return t.call(this,"deleteTable",e,n,r,o)||this}return r.__extends(e,t),e=r.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorDeleteTableButton]"}),r.__param(1,o.Host()),r.__metadata("design:paramtypes",[i.ToolBarButtonComponent,s.EditorComponent,c.EditorLocalizationService,u.EditorToolsService])],e)}(a.EditorCommandButton);e.EditorDeleteTableButtonDirective=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(4),s=n(3),a=n(6),c=n(2),u=n(5),l=function(t){function e(e,n,r,o){return t.call(this,"mergeCells",e,n,r,o)||this}return r.__extends(e,t),e=r.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorMergeCellsButton]"}),r.__param(1,o.Host()),r.__metadata("design:paramtypes",[i.ToolBarButtonComponent,s.EditorComponent,c.EditorLocalizationService,u.EditorToolsService])],e)}(a.EditorCommandButton);e.EditorMergeCellsButtonDirective=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(4),s=n(3),a=n(6),c=n(2),u=n(5),l=function(t){function e(e,n,r,o){return t.call(this,"splitCell",e,n,r,o)||this}return r.__extends(e,t),e=r.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorSplitCellButton]"}),r.__param(1,o.Host()),r.__metadata("design:paramtypes",[i.ToolBarButtonComponent,s.EditorComponent,c.EditorLocalizationService,u.EditorToolsService])],e)}(a.EditorCommandButton);e.EditorSplitCellButtonDirective=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(11),s=n(35),a=function(t){function e(e){var n=t.call(this)||this;return n.service=e,n}var n;return r.__extends(e,t),n=e,e=n=r.__decorate([o.Directive({providers:[{provide:s.Messages,useExisting:o.forwardRef((function(){return n}))}],selector:"[kendoEditorLocalizedMessages]"}),r.__metadata("design:paramtypes",[i.LocalizationService])],e)}(s.Messages);e.LocalizedMessagesDirective=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(11),s=n(35),a=function(t){function e(e){var n=t.call(this)||this;return n.service=e,n}var n;return r.__extends(e,t),n=e,Object.defineProperty(e.prototype,"override",{get:function(){return!0},enumerable:!0,configurable:!0}),e=n=r.__decorate([o.Component({providers:[{provide:s.Messages,useExisting:o.forwardRef((function(){return n}))}],selector:"kendo-editor-messages",template:""}),r.__metadata("design:paramtypes",[i.LocalizationService])],e)}(s.Messages);e.CustomMessagesComponent=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=function(){function t(t,e){this.hostEl=t,this.zone=e,this.preventDefault=function(t){t.preventDefault()}}return Object.defineProperty(t.prototype,"hostElement",{get:function(){return this.hostEl.nativeElement},enumerable:!0,configurable:!0}),t.prototype.ngAfterViewInit=function(){var t=this;this.zone.runOutsideAngular((function(){t.hostElement.addEventListener("pointerdown",t.preventDefault)}))},t.prototype.ngOnDestroy=function(){this.hostElement.removeEventListener("pointerdown",this.preventDefault)},t=r.__decorate([o.Directive({selector:"[kendoEditorDropDownTool]"}),r.__metadata("design:paramtypes",[o.ElementRef,o.NgZone])],t)}();e.DropDownToolDirective=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(4),s=n(3),a=n(6),c=n(2),u=n(27),l=n(5),d=function(t){function e(e,n,r,o){var i=t.call(this,"print",e,n,r,o)||this;return i.editor=n,i}return r.__extends(e,t),e.prototype.ngAfterViewInit=function(){if(o.isDevMode&&!this.editor.iframe)throw new Error(u.EditorErrorMessages.printTool)},e.prototype.clickHandler=function(){if(this.editor.iframe){var t=this.editor.view,e=t&&t.dom,n=e&&e.ownerDocument,r=n&&n.defaultView;r&&r.print()}},e=r.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorPrintButton]"}),r.__param(1,o.Host()),r.__metadata("design:paramtypes",[i.ToolBarButtonComponent,s.EditorComponent,c.EditorLocalizationService,l.EditorToolsService])],e)}(a.EditorCommandButton);e.EditorPrintDirective=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(1),i=n(4),s=n(3),a=n(6),c=n(2),u=n(5),l=function(t){function e(e,n,r,o){return t.call(this,"selectAll",e,n,r,o)||this}return r.__extends(e,t),e.prototype.clickHandler=function(){this.editor.shouldEmitFocus=!0,t.prototype.clickHandler.call(this)},e=r.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorSelectAllButton]"}),r.__param(1,o.Host()),r.__metadata("design:paramtypes",[i.ToolBarButtonComponent,s.EditorComponent,c.EditorLocalizationService,u.EditorToolsService])],e)}(a.EditorCommandButton);e.EditorSelectAllButtonDirective=l}])}));