diff --git a/ckeditor5/LICENSE.md b/ckeditor5/LICENSE.md
index 936aba7..9c171f4 100755
--- a/ckeditor5/LICENSE.md
+++ b/ckeditor5/LICENSE.md
@@ -5,7 +5,7 @@ Copyright (c) 2014-2020, CKSource - Frederico Knabben. All rights reserved.
Online builder code samples are licensed under the terms of the MIT License (see Appendix A):
- https://en.wikipedia.org/wiki/MIT_License
+ http://en.wikipedia.org/wiki/MIT_License
CKEditor 5 collaboration features are only available under a commercial license. [Contact us](https://ckeditor.com/contact/) for more details.
diff --git a/ckeditor5/build/ckeditor.js b/ckeditor5/build/ckeditor.js
index 7019a15..acba215 100755
--- a/ckeditor5/build/ckeditor.js
+++ b/ckeditor5/build/ckeditor.js
@@ -2,5 +2,5 @@
* @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md.
*/
-(function(t){t["de"]=Object.assign(t["de"]||{},{a:"Datei kann nicht hochgeladen werden:",b:"Bild Werkzeugleiste",c:"Tabelle Werkzeugleiste",d:"Blockzitat",e:"Bild oder Datei einfügen",f:"Überschrift auswählen",g:"Überschrift",h:"Einzug vergrößern",i:"Einzug verkleinern",j:"Link",k:"Nummerierte Liste",l:"Aufzählungsliste",m:"Medien-Widget",n:"Medium einfügen",o:"Die Url darf nicht leer sein",p:"Diese Medien-Url wird nicht unterstützt",q:"Tabelle einfügen",r:"Kopfspalte",s:"Spalte links einfügen",t:"Spalte rechts einfügen",u:"Spalte löschen",v:"Spalte",w:"Kopfzeile",x:"Zeile unten einfügen",y:"Zeile oben einfügen",z:"Zeile löschen",aa:"Zeile",ab:"Zelle verbinden",ac:"Zelle rechts verbinden",ad:"Zelle unten verbinden",ae:"Zelle links verbinden",af:"Zelle vertikal teilen",ag:"Zelle horizontal teilen",ah:"Zellen verbinden",ai:"Linksbündig",aj:"Rechtsbündig",ak:"Zentriert",al:"Blocksatz",am:"Textausrichtung",an:"Text-Ausrichtung Toolbar",ao:"Fett",ap:"Kursiv",aq:"Bild-Steuerelement",ar:"Bildunterschrift eingeben",as:"Bild in voller Größe",at:"Seitenbild",au:"linksbündiges Bild",av:"zentriertes Bild",aw:"rechtsbündiges Bild",ax:"Bild einfügen",ay:"Hochladen fehlgeschlagen",az:"Hintergrundfarbe",ba:"Schriftfarbe",bb:"Schriftgröße",bc:"Standard",bd:"Sehr klein",be:"Klein",bf:"Groß",bg:"Sehr groß",bh:"Schriftart",bi:"Upload läuft",bj:"Widget Werkzeugleiste",bk:"Table properties",bl:"Cell properties",bm:"Die URL des angepassten Bildes konnte nicht abgerufen werden.",bn:"Das angepasste Bild konnte nicht ausgewählt werden.",bo:"Das Bild konnte an der aktuellen Position nicht eingefügt werden.",bp:"Einfügen des Bildes fehlgeschlagen",bq:"Alternativ Text ändern",br:"Farbe entfernen",bs:"Dokumentfarben",bt:"Editor Werkzeugleiste",bu:"Mehr anzeigen",bv:"Rich Text Editor",bw:"Rich-Text-Editor, %0",bx:"Dropdown-Liste Werkzeugleiste",by:"Rückgängig",bz:"Wiederherstellen",ca:"None",cb:"Solid",cc:"Dotted",cd:"Dashed",ce:"Double",cf:"Groove",cg:"Ridge",ch:"Inset",ci:"Outset",cj:'The color is invalid. Try "#FF0000" or "rgb(255,0,0)" or "red".',ck:'The value is invalid. Try "10px" or "2em" or simply "2".',cl:"Border",cm:"Style",cn:"Width",co:"Color",cp:"Background",cq:"Dimensions",cr:"Height",cs:"Padding",ct:"Table cell text alignment",cu:"Horizontal text alignment toolbar",cv:"Vertical text alignment toolbar",cw:"Speichern",cx:"Abbrechen",cy:"Align cell text to the left",cz:"Align cell text to the center",da:"Align cell text to the right",db:"Justify cell text",dc:"Align cell text to the top",dd:"Align cell text to the middle",de:"Align cell text to the bottom",df:"Schwarz",dg:"Dunkelgrau",dh:"Grau",di:"Hellgrau",dj:"Weiß",dk:"Rot",dl:"Orange",dm:"Gelb",dn:"Hellgrün",do:"Grün",dp:"Aquamarinblau",dq:"Türkis",dr:"Hellblau",ds:"Blau",dt:"Violett",du:"%0 von %1",dv:"vorherige",dw:"Nächste",dx:"Textalternative",dy:"Alignment",dz:"Table alignment toolbar",ea:"Align table to the left",eb:"Center table",ec:"Align table to the right",ed:"Medien-URL in das Eingabefeld einfügen.",ee:"Tipp: Zum schnelleren Einbetten können Sie die Medien-URL in den Inhalt einfügen.",ef:"Medien-Url",eg:"In neuem Tab öffnen",eh:"Herunterladbar",ei:"Link entfernen",ej:"Link bearbeiten",ek:"Link im neuen Tab öffnen",el:"Dieser Link hat keine Adresse",em:"Link Adresse",en:"Absatz",eo:"Überschrift 1",ep:"Überschrift 2",eq:"Überschrift 3",er:"Überschrift 4",es:"Überschrift 5",et:"Überschrift 6"})})(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));(function t(e,n){if(typeof exports==="object"&&typeof module==="object")module.exports=n();else if(typeof define==="function"&&define.amd)define([],n);else if(typeof exports==="object")exports["ClassicEditor"]=n();else e["ClassicEditor"]=n()})(window,(function(){return function(t){var e={};function n(i){if(e[i]){return e[i].exports}var o=e[i]={i:i,l:false,exports:{}};t[i].call(o.exports,o,o.exports,n);o.l=true;return o.exports}n.m=t;n.c=e;n.d=function(t,e,i){if(!n.o(t,e)){Object.defineProperty(t,e,{enumerable:true,get:i})}};n.r=function(t){if(typeof Symbol!=="undefined"&&Symbol.toStringTag){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})}Object.defineProperty(t,"__esModule",{value:true})};n.t=function(t,e){if(e&1)t=n(t);if(e&8)return t;if(e&4&&typeof t==="object"&&t&&t.__esModule)return t;var i=Object.create(null);n.r(i);Object.defineProperty(i,"default",{enumerable:true,value:t});if(e&2&&typeof t!="string")for(var o in t)n.d(i,o,function(e){return t[e]}.bind(null,o));return i};n.n=function(t){var e=t&&t.__esModule?function e(){return t["default"]}:function e(){return t};n.d(e,"a",e);return e};n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};n.p="";return n(n.s=112)}([function(t,e,n){"use strict";n.d(e,"b",(function(){return o}));n.d(e,"a",(function(){return r}));const i="https://ckeditor.com/docs/ckeditor5/latest/framework/guides/support/error-codes.html";class o extends Error{constructor(t,e,n){t=r(t);if(n){t+=" "+JSON.stringify(n)}super(t);this.name="CKEditorError";this.context=e;this.data=n}is(t){return t==="CKEditorError"}static rethrowUnexpectedError(t,e){if(t.is&&t.is("CKEditorError")){throw t}const n=new o(t.message,e);n.stack=t.stack;throw n}}function r(t){const e=t.match(/^([^:]+):/);if(!e){return t}return t+` Read more: ${i}#error-${e[1]}\n`}},function(t,e,n){"use strict";var i=function t(){var e;return function t(){if(typeof e==="undefined"){e=Boolean(window&&document&&document.all&&!window.atob)}return e}}();var o=function t(){var e={};return function t(n){if(typeof e[n]==="undefined"){var i=document.querySelector(n);if(window.HTMLIFrameElement&&i instanceof window.HTMLIFrameElement){try{i=i.contentDocument.head}catch(t){i=null}}e[n]=i}return e[n]}}();var r=[];function s(t){var e=-1;for(var n=0;n
").replace(/^\s/," ").replace(/\s$/," ").replace(/\s\s/g," ");if(t.indexOf("
")>-1){t=`
${t}
`}return t}function Ix(t){return t.replace(/(\s+)<\/span>/g,(t,e)=>{if(e.length==1){return" "}return e})}const Nx=["figcaption","li"];function Ox(t){let e="";if(t.is("text")||t.is("textProxy")){e=t.data}else if(t.is("img")&&t.hasAttribute("alt")){e=t.getAttribute("alt")}else{let n=null;for(const i of t.getChildren()){const t=Ox(i);if(n&&(n.is("containerElement")||i.is("containerElement"))){if(Nx.includes(n.name)||Nx.includes(i.name)){e+="\n"}else{e+="\n\n"}}e+=t;n=i}}return e}class Rx extends Ow{static get pluginName(){return"Clipboard"}init(){const t=this.editor;const e=t.model.document;const n=t.editing.view;const i=n.document;this._htmlDataProcessor=new vp;n.addObserver(Sx);this.listenTo(i,"clipboardInput",e=>{if(t.isReadOnly){e.stop()}},{priority:"highest"});this.listenTo(i,"clipboardInput",(t,e)=>{const i=e.dataTransfer;let o="";if(i.getData("text/html")){o=Ix(i.getData("text/html"))}else if(i.getData("text/plain")){o=Ex(i.getData("text/plain"))}o=this._htmlDataProcessor.toView(o);this.fire("inputTransformation",{content:o,dataTransfer:i});n.scrollToTheSelection()},{priority:"low"});this.listenTo(this,"inputTransformation",(t,e)=>{if(!e.content.isEmpty){const t=this.editor.data;const n=this.editor.model;const i=t.toModel(e.content,"$clipboardHolder");if(i.childCount==0){return}n.insertContent(i)}},{priority:"low"});function o(n,o){const r=o.dataTransfer;o.preventDefault();const s=t.data.toView(t.model.getSelectedContent(e.selection));i.fire("clipboardOutput",{dataTransfer:r,content:s,method:n.name})}this.listenTo(i,"copy",o,{priority:"low"});this.listenTo(i,"cut",(e,n)=>{if(t.isReadOnly){n.preventDefault()}else{o(e,n)}},{priority:"low"});this.listenTo(i,"clipboardOutput",(n,i)=>{if(!i.content.isEmpty){i.dataTransfer.setData("text/html",this._htmlDataProcessor.toData(i.content));i.dataTransfer.setData("text/plain",Ox(i.content))}if(i.method=="cut"){t.model.deleteContent(e.selection)}},{priority:"low"})}}class Vx{createDocumentFragment(t){return new ql(t)}createElement(t,e,n){return new Lc(t,e,n)}createText(t){return new js(t)}clone(t,e=false){return t._clone(e)}appendChild(t,e){return e._appendChild(t)}insertChild(t,e,n){return n._insertChild(t,e)}removeChildren(t,e,n){return n._removeChildren(t,e)}remove(t){const e=t.parent;if(e){return this.removeChildren(e.getChildIndex(t),1,e)}return[]}replace(t,e){const n=t.parent;if(n){const i=n.getChildIndex(t);this.removeChildren(i,1,n);this.insertChild(i,e,n);return true}return false}unwrapElement(t){const e=t.parent;if(e){const n=e.getChildIndex(t);this.remove(t);this.insertChild(n,t.getChildren(),e)}}rename(t,e){const n=new Lc(t,e.getAttributes(),e.getChildren());return this.replace(e,n)?n:null}setAttribute(t,e,n){n._setAttribute(t,e)}removeAttribute(t,e){e._removeAttribute(t)}addClass(t,e){e._addClass(t)}removeClass(t,e){e._removeClass(t)}setStyle(t,e,n){if(R(t)&&n===undefined){n=e}n._setStyle(t,e)}removeStyle(t,e){e._removeStyle(t)}setCustomProperty(t,e,n){n._setCustomProperty(t,e)}removeCustomProperty(t,e){return e._removeCustomProperty(t)}createPositionAt(t,e){return ul._createAt(t,e)}createPositionAfter(t){return ul._createAfter(t)}createPositionBefore(t){return ul._createBefore(t)}createRange(t,e){return new hl(t,e)}createRangeOn(t){return hl._createOn(t)}createRangeIn(t){return hl._createIn(t)}createSelection(t,e,n){return new gl(t,e,n)}}class Dx extends Lw{refresh(){this.isEnabled=Ek(this.editor.model)}execute(t){const e=this.editor;const n=e.model;const i=e.plugins.get(sv);n.change(e=>{const o=Array.isArray(t.file)?t.file:[t.file];for(const t of o){Lx(e,n,i,t)}})}}function Lx(t,e,n,i){const o=n.createLoader(i);if(!o){return}Mk(t,e,{uploadId:o.id})}class jx extends Ow{static get requires(){return[sv,tv,Rx]}static get pluginName(){return"ImageUploadEditing"}constructor(t){super(t);t.config.define("image",{upload:{types:["jpeg","png","gif","bmp","webp","tiff"]}})}init(){const t=this.editor;const e=t.model.document;const n=t.model.schema;const i=t.conversion;const o=t.plugins.get(sv);const r=ix(t.config.get("image.upload.types"));n.extend("image",{allowAttributes:["uploadId","uploadStatus"]});t.commands.add("imageUpload",new Dx(t));i.for("upcast").attributeToAttribute({view:{name:"img",key:"uploadId"},model:"uploadId"});this.listenTo(t.editing.view.document,"clipboardInput",(e,n)=>{if(zx(n.dataTransfer)){return}const i=Array.from(n.dataTransfer.files).filter(t=>{if(!t){return false}return r.test(t.type)});const o=n.targetRanges.map(e=>t.editing.mapper.toModelRange(e));t.model.change(n=>{n.setSelection(o);if(i.length){e.stop();t.model.enqueueChange("default",()=>{t.execute("imageUpload",{file:i})})}})});this.listenTo(t.plugins.get(Rx),"inputTransformation",(e,n)=>{const i=Array.from(t.editing.view.createRangeIn(n.content)).filter(t=>rx(t.item)&&!t.item.getAttribute("uploadProcessed")).map(t=>({promise:ox(t.item),imageElement:t.item}));if(!i.length){return}const r=new Vx;for(const t of i){r.setAttribute("uploadProcessed",true,t.imageElement);const e=o.createLoader(t.promise);if(e){r.setAttribute("src","",t.imageElement);r.setAttribute("uploadId",e.id,t.imageElement)}}});t.editing.view.document.on("dragover",(t,e)=>{e.preventDefault()});e.on("change",()=>{const n=e.differ.getChanges({includeChangesInGraveyard:true});for(const e of n){if(e.type=="insert"&&e.name!="$text"){const n=e.position.nodeAfter;const i=e.position.root.rootName=="$graveyard";for(const e of Bx(t,n)){const t=e.getAttribute("uploadId");if(!t){continue}const n=o.loaders.get(t);if(!n){continue}if(i){n.abort()}else if(n.status=="idle"){this._readAndUpload(n,e)}}}}})}_readAndUpload(t,e){const n=this.editor;const i=n.model;const o=n.locale.t;const r=n.plugins.get(sv);const s=n.plugins.get(tv);i.enqueueChange("transparent",t=>{t.setAttribute("uploadStatus","reading",e)});return t.read().then(()=>{const o=t.upload();if(Tl.isSafari){const t=n.editing.mapper.toViewElement(e);const i=t.getChild(0);n.editing.view.once("render",()=>{if(!i.parent){return}const t=n.editing.view.domConverter.mapViewToDom(i.parent);if(!t){return}const e=t.style.display;t.style.display="none";t._ckHack=t.offsetHeight;t.style.display=e})}i.enqueueChange("transparent",t=>{t.setAttribute("uploadStatus","uploading",e)});return o}).then(t=>{i.enqueueChange("transparent",n=>{n.setAttributes({uploadStatus:"complete",src:t.default},e);this._parseAndSetSrcsetAttributeOnImage(t,e,n)});a()}).catch(n=>{if(t.status!=="error"&&t.status!=="aborted"){throw n}if(t.status=="error"&&n){s.showWarning(n,{title:o("ay"),namespace:"upload"})}a();i.enqueueChange("transparent",t=>{t.remove(e)})});function a(){i.enqueueChange("transparent",t=>{t.removeAttribute("uploadId",e);t.removeAttribute("uploadStatus",e)});r.destroyLoader(t)}}_parseAndSetSrcsetAttributeOnImage(t,e,n){let i=0;const o=Object.keys(t).filter(t=>{const e=parseInt(t,10);if(!isNaN(e)){i=Math.max(i,e);return true}}).map(e=>`${t[e]} ${e}w`).join(", ");if(o!=""){n.setAttribute("srcset",{data:o,width:i},e)}}}function zx(t){return Array.from(t.types).includes("text/html")&&t.getData("text/html")!==""}function Bx(t,e){return Array.from(t.model.createRangeOn(e)).filter(t=>t.item.is("image")).map(t=>t.item)}class Fx extends Ow{static get pluginName(){return"ImageUpload"}static get requires(){return[jx,cx,fx]}}class Hx extends Lw{constructor(t){super(t);this._childCommands=[]}refresh(){}execute(...t){const e=this._getFirstEnabledCommand();e.execute(t)}registerChildCommand(t){this._childCommands.push(t);t.on("change:isEnabled",()=>this._checkEnabled());this._checkEnabled()}_checkEnabled(){this.isEnabled=!!this._getFirstEnabledCommand()}_getFirstEnabledCommand(){return this._childCommands.find(t=>t.isEnabled)}}class Ux extends Ow{static get pluginName(){return"IndentEditing"}init(){const t=this.editor;t.commands.add("indent",new Hx(t));t.commands.add("outdent",new Hx(t))}}var Wx='';var qx='';class $x extends Ow{static get pluginName(){return"IndentUI"}init(){const t=this.editor;const e=t.locale;const n=t.t;const i=e.uiLanguageDirection=="ltr"?Wx:qx;const o=e.uiLanguageDirection=="ltr"?qx:Wx;this._defineButton("indent",n("h"),i);this._defineButton("outdent",n("i"),o)}_defineButton(t,e,n){const i=this.editor;i.ui.componentFactory.add(t,o=>{const r=i.commands.get(t);const s=new Xb(o);s.set({label:e,icon:n,tooltip:true});s.bind("isOn","isEnabled").to(r,"value","isEnabled");this.listenTo(s,"execute",()=>{i.execute(t);i.editing.view.focus()});return s})}}class Gx extends Ow{static get pluginName(){return"Indent"}static get requires(){return[Ux,$x]}}const Yx="italic";class Qx extends Ow{static get pluginName(){return"ItalicEditing"}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:Yx});t.model.schema.setAttributeProperties(Yx,{isFormatting:true,copyOnEnter:true});t.conversion.attributeToElement({model:Yx,view:"i",upcastAlso:["em",{styles:{"font-style":"italic"}}]});t.commands.add(Yx,new Qw(t,Yx));t.keystrokes.set("CTRL+I",Yx)}}var Kx='';const Jx="italic";class Zx extends Ow{init(){const t=this.editor;const e=t.t;t.ui.componentFactory.add(Jx,n=>{const i=t.commands.get(Jx);const o=new Xb(n);o.set({label:e("ap"),icon:Kx,keystroke:"CTRL+I",tooltip:true,isToggleable:true});o.bind("isOn","isEnabled").to(i,"value","isEnabled");this.listenTo(o,"execute",()=>{t.execute(Jx);t.editing.view.focus()});return o})}}class Xx extends Ow{static get requires(){return[Qx,Zx]}static get pluginName(){return"Italic"}}class tC extends Ku{constructor(t){super(t);this.domEventType="click"}onDomEvent(t){this.fire(t.type,t)}}var eC=n(76);class nC extends pb{constructor(t,e=[]){super(t);const n=t.t;this.focusTracker=new Cp;this.keystrokes=new up;this.urlInputView=this._createUrlInput();this.saveButtonView=this._createButton(n("cw"),Yv,"ck-button-save");this.saveButtonView.type="submit";this.cancelButtonView=this._createButton(n("cx"),Qv,"ck-button-cancel","cancel");this._manualDecoratorSwitches=this._createManualDecoratorSwitches(e);this.children=this._createFormChildren(e);this._focusables=new Bp;this._focusCycler=new Ob({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}});const i=["ck","ck-link-form"];if(e.length){i.push("ck-link-form_layout-vertical")}this.setTemplate({tag:"form",attributes:{class:i,tabindex:"-1"},children:this.children})}getDecoratorSwitchesState(){return Array.from(this._manualDecoratorSwitches).reduce((t,e)=>{t[e.name]=e.isOn;return t},{})}render(){super.render();Gv({view:this});const t=[this.urlInputView,...this._manualDecoratorSwitches,this.saveButtonView,this.cancelButtonView];t.forEach(t=>{this._focusables.add(t);this.focusTracker.add(t.element)});this.keystrokes.listenTo(this.element)}focus(){this._focusCycler.focusFirst()}_createUrlInput(){const t=this.locale.t;const e=new Wv(this.locale,$v);e.label=t("em");e.inputView.placeholder="https://example.com";return e}_createButton(t,e,n,i){const o=new Xb(this.locale);o.set({label:t,icon:e,tooltip:true});o.extendTemplate({attributes:{class:n}});if(i){o.delegate("execute").to(this,i)}return o}_createManualDecoratorSwitches(t){const e=this.createCollection();for(const n of t){const t=new aw(this.locale);t.set({name:n.id,label:n.label,withText:true});t.bind("isOn").to(n,"value");t.on("execute",()=>{n.set("value",!t.isOn)});e.add(t)}return e}_createFormChildren(t){const e=this.createCollection();e.add(this.urlInputView);if(t.length){const t=new pb;t.setTemplate({tag:"ul",children:this._manualDecoratorSwitches.map(t=>({tag:"li",children:[t],attributes:{class:["ck","ck-list__item"]}})),attributes:{class:["ck","ck-reset","ck-list"]}});e.add(t)}e.add(this.saveButtonView);e.add(this.cancelButtonView);return e}}var iC='';var oC='';var rC=n(78);class sC extends pb{constructor(t){super(t);const e=t.t;this.focusTracker=new Cp;this.keystrokes=new up;this.previewButtonView=this._createPreviewButton();this.unlinkButtonView=this._createButton(e("ei"),iC,"unlink");this.editButtonView=this._createButton(e("ej"),oC,"edit");this.set("href");this._focusables=new Bp;this._focusCycler=new Ob({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}});this.setTemplate({tag:"div",attributes:{class:["ck","ck-link-actions"],tabindex:"-1"},children:[this.previewButtonView,this.editButtonView,this.unlinkButtonView]})}render(){super.render();const t=[this.previewButtonView,this.editButtonView,this.unlinkButtonView];t.forEach(t=>{this._focusables.add(t);this.focusTracker.add(t.element)});this.keystrokes.listenTo(this.element)}focus(){this._focusCycler.focusFirst()}_createButton(t,e,n){const i=new Xb(this.locale);i.set({label:t,icon:e,tooltip:true});i.delegate("execute").to(this,n);return i}_createPreviewButton(){const t=new Xb(this.locale);const e=this.bindTemplate;const n=this.t;t.set({withText:true,tooltip:n("ek")});t.extendTemplate({attributes:{class:["ck","ck-link-actions__preview"],href:e.to("href",t=>t&&R_(t)),target:"_blank",rel:"noopener noreferrer"}});t.bind("label").to(this,"href",t=>t||n("el"));t.bind("isEnabled").to(this,"href",t=>!!t);t.template.tag="a";t.template.eventListeners={};return t}}var aC='';const cC="Ctrl+K";class lC extends Ow{static get requires(){return[dy]}static get pluginName(){return"LinkUI"}init(){const t=this.editor;t.editing.view.addObserver(tC);this.actionsView=this._createActionsView();this.formView=this._createFormView();this._balloon=t.plugins.get(dy);this._createToolbarLinkButton();this._enableUserBalloonInteractions()}destroy(){super.destroy();this.formView.destroy()}_createActionsView(){const t=this.editor;const e=new sC(t.locale);const n=t.commands.get("link");const i=t.commands.get("unlink");e.bind("href").to(n,"value");e.editButtonView.bind("isEnabled").to(n);e.unlinkButtonView.bind("isEnabled").to(i);this.listenTo(e,"edit",()=>{this._addFormView()});this.listenTo(e,"unlink",()=>{t.execute("unlink");this._hideUI()});e.keystrokes.set("Esc",(t,e)=>{this._hideUI();e()});e.keystrokes.set(cC,(t,e)=>{this._addFormView();e()});return e}_createFormView(){const t=this.editor;const e=t.commands.get("link");const n=new nC(t.locale,e.manualDecorators);n.urlInputView.bind("value").to(e,"value");n.urlInputView.bind("isReadOnly").to(e,"isEnabled",t=>!t);n.saveButtonView.bind("isEnabled").to(e);this.listenTo(n,"submit",()=>{t.execute("link",n.urlInputView.inputView.element.value,n.getDecoratorSwitchesState());this._closeFormView()});this.listenTo(n,"cancel",()=>{this._closeFormView()});n.keystrokes.set("Esc",(t,e)=>{this._closeFormView();e()});return n}_createToolbarLinkButton(){const t=this.editor;const e=t.commands.get("link");const n=t.t;t.keystrokes.set(cC,(t,e)=>{e();this._showUI(true)});t.ui.componentFactory.add("link",t=>{const i=new Xb(t);i.isEnabled=true;i.label=n("j");i.icon=aC;i.keystroke=cC;i.tooltip=true;i.isToggleable=true;i.bind("isEnabled").to(e,"isEnabled");i.bind("isOn").to(e,"value",t=>!!t);this.listenTo(i,"execute",()=>this._showUI(true));return i})}_enableUserBalloonInteractions(){const t=this.editor.editing.view.document;this.listenTo(t,"click",()=>{const t=this._getSelectedLinkElement();if(t){this._showUI()}});this.editor.keystrokes.set("Tab",(t,e)=>{if(this._areActionsVisible&&!this.actionsView.focusTracker.isFocused){this.actionsView.focus();e()}},{priority:"high"});this.editor.keystrokes.set("Esc",(t,e)=>{if(this._isUIVisible){this._hideUI();e()}});cw({emitter:this.formView,activator:()=>this._isUIInPanel,contextElements:[this._balloon.view.element],callback:()=>this._hideUI()})}_addActionsView(){if(this._areActionsInPanel){return}this._balloon.add({view:this.actionsView,position:this._getBalloonPositionData()})}_addFormView(){if(this._isFormInPanel){return}const t=this.editor;const e=t.commands.get("link");this._balloon.add({view:this.formView,position:this._getBalloonPositionData()});if(this._balloon.visibleView===this.formView){this.formView.urlInputView.select()}this.formView.urlInputView.inputView.element.value=e.value||""}_closeFormView(){const t=this.editor.commands.get("link");t.restoreManualDecoratorStates();if(t.value!==undefined){this._removeFormView()}else{this._hideUI()}}_removeFormView(){if(this._isFormInPanel){this.formView.saveButtonView.focus();this._balloon.remove(this.formView);this.editor.editing.view.focus()}}_showUI(t=false){if(!this._getSelectedLinkElement()){this._addActionsView();if(t){this._balloon.showStack("main")}this._addFormView()}else{if(this._areActionsVisible){this._addFormView()}else{this._addActionsView()}if(t){this._balloon.showStack("main")}}this._startUpdatingUI()}_hideUI(){if(!this._isUIInPanel){return}const t=this.editor;this.stopListening(t.ui,"update");this.stopListening(this._balloon,"change:visibleView");t.editing.view.focus();this._removeFormView();this._balloon.remove(this.actionsView)}_startUpdatingUI(){const t=this.editor;const e=t.editing.view.document;let n=this._getSelectedLinkElement();let i=r();const o=()=>{const t=this._getSelectedLinkElement();const e=r();if(n&&!t||!n&&e!==i){this._hideUI()}else if(this._isUIVisible){this._balloon.updatePosition(this._getBalloonPositionData())}n=t;i=e};function r(){return e.selection.focus.getAncestors().reverse().find(t=>t.is("element"))}this.listenTo(t.ui,"update",o);this.listenTo(this._balloon,"change:visibleView",o)}get _isFormInPanel(){return this._balloon.hasView(this.formView)}get _areActionsInPanel(){return this._balloon.hasView(this.actionsView)}get _areActionsVisible(){return this._balloon.visibleView===this.actionsView}get _isUIInPanel(){return this._isFormInPanel||this._areActionsInPanel}get _isUIVisible(){const t=this._balloon.visibleView;return t==this.formView||this._areActionsVisible}_getBalloonPositionData(){const t=this.editor.editing.view;const e=t.document;const n=this._getSelectedLinkElement();const i=n?t.domConverter.mapViewToDom(n):t.domConverter.viewRangeToDom(e.selection.getFirstRange());return{target:i}}_getSelectedLinkElement(){const t=this.editor.editing.view;const e=t.document.selection;if(e.isCollapsed){return dC(e.getFirstPosition())}else{const n=e.getFirstRange().getTrimmed();const i=dC(n.start);const o=dC(n.end);if(!i||i!=o){return null}if(t.createRangeIn(i).getTrimmed().isEqual(n)){return i}else{return null}}}}function dC(t){return t.getAncestors().find(t=>N_(t))}class uC extends Ow{static get requires(){return[Z_,lC]}static get pluginName(){return"Link"}}class hC extends Lw{constructor(t,e){super(t);this.type=e}refresh(){this.value=this._getValue();this.isEnabled=this._checkEnabled()}execute(){const t=this.editor.model;const e=t.document;const n=Array.from(e.selection.getSelectedBlocks()).filter(e=>mC(e,t.schema));const i=this.value===true;t.change(t=>{if(i){let e=n[n.length-1].nextSibling;let i=Number.POSITIVE_INFINITY;let o=[];while(e&&e.name=="listItem"&&e.getAttribute("listIndent")!==0){const t=e.getAttribute("listIndent");if(t=n){if(r>o.getAttribute("listIndent")){r=o.getAttribute("listIndent")}if(o.getAttribute("listIndent")==r){t[e?"unshift":"push"](o)}o=o[e?"previousSibling":"nextSibling"]}}}function mC(t,e){return e.checkChild(t.parent,"listItem")&&!e.isObject(t)}class gC extends Lw{constructor(t,e){super(t);this._indentBy=e=="forward"?1:-1}refresh(){this.isEnabled=this._checkEnabled()}execute(){const t=this.editor.model;const e=t.document;let n=Array.from(e.selection.getSelectedBlocks());t.change(t=>{const e=n[n.length-1];let i=e.nextSibling;while(i&&i.name=="listItem"&&i.getAttribute("listIndent")>e.getAttribute("listIndent")){n.push(i);i=i.nextSibling}if(this._indentBy<0){n=n.reverse()}for(const e of n){const n=e.getAttribute("listIndent")+this._indentBy;if(n<0){t.rename(e,"paragraph")}else{t.setAttribute("listIndent",n,e)}}})}_checkEnabled(){const t=zw(this.editor.model.document.selection.getSelectedBlocks());if(!t||!t.is("listItem")){return false}if(this._indentBy>0){const e=t.getAttribute("listIndent");const n=t.getAttribute("listType");let i=t.previousSibling;while(i&&i.is("listItem")&&i.getAttribute("listIndent")>=e){if(i.getAttribute("listIndent")==e){return i.getAttribute("listType")==n}i=i.previousSibling}return false}return true}}function pC(t){const e=t.createContainerElement("li");e.getFillerOffset=xC;return e}function bC(t,e){const n=e.mapper;const i=e.writer;const o=t.getAttribute("listType")=="numbered"?"ol":"ul";const r=pC(i);const s=i.createContainerElement(o,null);i.insert(i.createPositionAt(s,0),r);n.bindElements(t,r);return r}function wC(t,e,n,i){const o=e.parent;const r=n.mapper;const s=n.writer;let a=r.toViewPosition(i.createPositionBefore(t));const c=vC(t.previousSibling,{sameIndent:true,smallerIndent:true,listIndent:t.getAttribute("listIndent")});const l=t.previousSibling;if(c&&c.getAttribute("listIndent")==t.getAttribute("listIndent")){const t=r.toViewElement(c);a=s.breakContainer(s.createPositionAfter(t))}else{if(l&&l.name=="listItem"){a=r.toViewPosition(i.createPositionAt(l,"end"))}else{a=r.toViewPosition(i.createPositionBefore(t))}}a=_C(a);s.insert(a,o);if(l&&l.name=="listItem"){const t=r.toViewElement(l);const n=s.createRange(s.createPositionAt(t,0),a);const i=n.getWalker({ignoreElementEnd:true});for(const t of i){if(t.item.is("li")){const n=s.breakContainer(s.createPositionBefore(t.item));const o=t.item.parent;const r=s.createPositionAt(e,"end");kC(s,r.nodeBefore,r.nodeAfter);s.move(s.createRangeOn(o),r);i.position=n}}}else{const n=o.nextSibling;if(n&&(n.is("ul")||n.is("ol"))){let i=null;for(const e of n.getChildren()){const n=r.toModelElement(e);if(n&&n.getAttribute("listIndent")>t.getAttribute("listIndent")){i=e}else{break}}if(i){s.breakContainer(s.createPositionAfter(i));s.move(s.createRangeOn(i.parent),s.createPositionAt(e,"end"))}}}kC(s,o,o.nextSibling);kC(s,o.previousSibling,o)}function kC(t,e,n){if(!e||!n||e.name!="ul"&&e.name!="ol"){return null}if(e.name!=n.name||e.getAttribute("class")!==n.getAttribute("class")){return null}return t.mergeContainers(t.createPositionAfter(e))}function _C(t){return t.getLastMatchingPosition(t=>t.item.is("uiElement"))}function vC(t,e){const n=!!e.sameIndent;const i=!!e.smallerIndent;const o=e.listIndent;let r=t;while(r&&r.name=="listItem"){const t=r.getAttribute("listIndent");if(n&&o==t||i&&o>t){return r}r=r.previousSibling}return null}function yC(t,e,n,i){t.ui.componentFactory.add(e,o=>{const r=t.commands.get(e);const s=new Xb(o);s.set({label:n,icon:i,tooltip:true,isToggleable:true});s.bind("isOn","isEnabled").to(r,"value","isEnabled");s.on("execute",()=>{t.execute(e);t.editing.view.focus()});return s})}function xC(){const t=!this.isEmpty&&(this.getChild(0).name=="ul"||this.getChild(0).name=="ol");if(this.isEmpty||t){return 0}return Hc.call(this)}function CC(t){return(e,n,i)=>{const o=i.consumable;if(!o.test(n.item,"insert")||!o.test(n.item,"attribute:listType")||!o.test(n.item,"attribute:listIndent")){return}o.consume(n.item,"insert");o.consume(n.item,"attribute:listType");o.consume(n.item,"attribute:listIndent");const r=n.item;const s=bC(r,i);wC(r,s,i,t)}}function AC(t){return(e,n,i)=>{const o=i.mapper.toViewPosition(n.position).getLastMatchingPosition(t=>!t.item.is("li"));const r=o.nodeAfter;const s=i.writer;s.breakContainer(s.createPositionBefore(r));s.breakContainer(s.createPositionAfter(r));const a=r.parent;const c=a.previousSibling;const l=s.createRangeOn(a);const d=s.remove(l);if(c&&c.nextSibling){kC(s,c,c.nextSibling)}const u=i.mapper.toModelElement(r);BC(u.getAttribute("listIndent")+1,n.position,l.start,r,i,t);for(const t of s.createRangeIn(d).getItems()){i.mapper.unbindViewElement(t)}e.stop()}}function TC(t,e,n){if(!n.consumable.consume(e.item,"attribute:listType")){return}const i=n.mapper.toViewElement(e.item);const o=n.writer;o.breakContainer(o.createPositionBefore(i));o.breakContainer(o.createPositionAfter(i));const r=i.parent;const s=e.attributeNewValue=="numbered"?"ol":"ul";o.rename(s,r)}function PC(t,e,n){const i=n.mapper.toViewElement(e.item);const o=i.parent;const r=n.writer;kC(r,o,o.nextSibling);kC(r,o.previousSibling,o);for(const t of e.item.getChildren()){n.consumable.consume(t,"insert")}}function SC(t){return(e,n,i)=>{if(!i.consumable.consume(n.item,"attribute:listIndent")){return}const o=i.mapper.toViewElement(n.item);const r=i.writer;r.breakContainer(r.createPositionBefore(o));r.breakContainer(r.createPositionAfter(o));const s=o.parent;const a=s.previousSibling;const c=r.createRangeOn(s);r.remove(c);if(a&&a.nextSibling){kC(r,a,a.nextSibling)}BC(n.attributeOldValue+1,n.range.start,c.start,o,i,t);wC(n.item,o,i,t);for(const t of n.item.getChildren()){i.consumable.consume(t,"insert")}}}function MC(t,e,n){if(e.item.name!="listItem"){let t=n.mapper.toViewPosition(e.range.start);const i=n.writer;const o=[];while(t.parent.name=="ul"||t.parent.name=="ol"){t=i.breakContainer(t);if(t.parent.name!="li"){break}const e=t;const n=i.createPositionAt(t.parent,"end");if(!e.isEqual(n)){const t=i.remove(i.createRange(e,n));o.push(t)}t=i.createPositionAfter(t.parent)}if(o.length>0){for(let e=0;e