/* Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ (function(){function p(c){var a=c.widgets,b=c.focusManager.currentActive;if(c.focusManager.hasFocus){if(a.focused)return a.focused;if(b instanceof CKEDITOR.plugins.widget.nestedEditable)return a.getByElement(b)}}function l(c,a){return c.features&&-1!==CKEDITOR.tools.array.indexOf(c.features,a)}function t(c,a){return CKEDITOR.tools.array.reduce(CKEDITOR.tools.objectKeys(c),function(b,d){var f=c[d];l(f,a)&&b.push(f);return b},[])}function u(c,a){a=CKEDITOR.tools.object.merge({pathName:c.lang.imagebase.pathName, defaults:{imageClass:c.config.easyimage_class||"",alt:"",src:"",caption:""},template:'\x3cfigure class\x3d"{imageClass}"\x3e\x3cimg alt\x3d"{alt}" src\x3d"{src}" /\x3e\x3cfigcaption\x3e{caption}\x3c/figcaption\x3e\x3c/figure\x3e',allowedContent:{img:{attributes:"!src,alt,width,height"},figure:!0,figcaption:!0},requiredContent:"figure; img[!src]",features:[],editables:{caption:{selector:"figcaption",pathName:c.lang.imagebase.pathNameCaption,allowedContent:"br em strong sub sup u s; a[!href,target]"}}, parts:{image:"img",caption:"figcaption"},upcasts:{figure:function(b){if(1===b.find("img",!0).length)return b}}},a);a.upcast=CKEDITOR.tools.objectKeys(a.upcasts).join(",");return a}function m(c){this.wrapper=CKEDITOR.dom.element.createFromHtml(c||'\x3cdiv class\x3d"cke_loader"\x3e\x3c/div\x3e')}function n(){m.call(this,'\x3cdiv class\x3d"cke_loader"\x3e\x3cdiv class\x3d"cke_bar" styles\x3d"transition: width '+q/1E3+'s"\x3e\x3c/div\x3e\x3c/div\x3e');this.bar=this.wrapper.getFirst()}var r=!1,v={caption:function(){function c(b){b.parts.caption.data("cke-caption-placeholder", !1)}function a(b,a){b.data("cke-caption-active",a);b.data("cke-caption-hidden",!a)}return{setUp:function(b){function a(d){var e=(d="blur"===d.name?b.elementPath():d.data.path)?d.lastElement:null;d=t(b.widgets.instances,"caption");if(!b.filter.check("figcaption"))return CKEDITOR.tools.array.forEach(c,function(a){a.removeListener()});CKEDITOR.tools.array.forEach(d,function(a){a._refreshCaption(e)})}var c=[];c.push(b.on("selectionChange",a,null,null,9));c.push(b.on("blur",a))},init:function(){if(this.editor.filter.check("figcaption")){if(!this.parts.caption){var a= this.parts,d=this.element,c=d.getDocument().createElement("figcaption");d.append(c);this.initEditable("caption",this.definition.editables.caption);a.caption=c}this.editables.caption.getData()||this.parts.caption.data("cke-caption-placeholder")||this._refreshCaption()}},_refreshCaption:function(b){var d=p(this.editor)===this,f=this.parts.caption,g=this.editables.caption;if(d)g.getData()||b.equals(f)?(!b||b.equals(f)&&b.data("cke-caption-placeholder"))&&c(this):this.parts.caption.data("cke-caption-placeholder", this.editor.lang.imagebase.captionPlaceholder),a(f,!0);else if(!this.editables.caption.getData()||this.parts.caption.data("cke-caption-placeholder"))c(this),a(f,!1)}}}(),upload:function(){var c={progressReporterType:n,setUp:function(a,b){a.on("paste",function(d){var f=d.data.method,g=d.data.dataTransfer,e=g&&g.getFilesCount();if(!a.readOnly&&("drop"===f||"paste"===f&&e)){var h=[];b=a.widgets.registered[b.name];for(var k=0;k