/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or http://ckeditor.com/license
*/ (function(){var t=!1;CKEDITOR.plugins.add(“balloonpanel”,{init:function(){t||(CKEDITOR.document.appendStyleSheet(this.path+“skins/”CKEDITOR.skinName
“/balloonpanel.css”),t=!0)}});CKEDITOR.ui.balloonPanel=function(a,b){this.editor=a;CKEDITOR.tools.extend(this,{width:360,height:“auto”,triangleWidth:20,triangleHeight:20,triangleMinDistance:40},b,!0);this.templates={};for(var c in this.templateDefinitions)this.templates=new CKEDITOR.template(this.templateDefinitions);this.parts={};this.focusables= {};this.showListeners={};this.activeShowListeners={};this.rect={visible:!1};this.build();a.on(“destroy”,function(){this.destroy()},this)};CKEDITOR.ui.balloonPanel.prototype={templateDefinitions:{panel:'x3cdiv classx3d“cke {id} cke_reset_all cke_chrome cke_balloon cke_editor_{name} cke_{langDir} 'CKEDITOR.env.cssClass
'” dirx3d“{langDir}” titlex3d“'+(CKEDITOR.env.gecko?” “:”“)+'” langx3d“{langCode}” rolex3d“dialog” stylex3d“{style}” tabindexx3d“-1” aria-labelledbyx3d“cke_{name}_arialbl”x3ex3c/divx3e', content:'x3cdiv classx3d“cke_balloon_content”x3e{content}x3c/divx3e',title:'x3cdiv classx3d“cke_balloon_title” rolex3d“presentation”x3e{title}x3c/divx3e',close:'x3ca classx3d“cke_balloon_close_button” hrefx3d“javascript:void(0)” titlex3d“Close” rolex3d“button” tabindexx3d“-1”x3ex3cspan classx3d“cke_label”x3eXx3c/spanx3ex3c/ax3e',triangleOuter:'x3cspan classx3d“cke_balloon_triangle cke_balloon_triangle_outer”x3ex3c/spanx3e',triangleInner:'x3cspan classx3d“cke_balloon_triangle cke_balloon_triangle_inner”x3ex26#8203;x3c/spanx3e'}, build:function(){var a=this.editor;this.parts={title:CKEDITOR.dom.element.createFromHtml(this.templates.title.output({title:this.title})),close:CKEDITOR.dom.element.createFromHtml(this.templates.close.output()),panel:CKEDITOR.dom.element.createFromHtml(this.templates.panel.output({id:a.id,langDir:a.lang.dir,langCode:a.langCode,name:a.name,style:“display:none;”,voiceLabel:a.lang.editorPanel+“, ”+a.name})),content:CKEDITOR.dom.element.createFromHtml(this.templates.content.output({content:this.content|| “”})),triangleOuter:CKEDITOR.dom.element.createFromHtml(this.templates.triangleOuter.output()),triangleInner:CKEDITOR.dom.element.createFromHtml(this.templates.triangleInner.output())};this.parts.panel.append(this.parts.title,1);this.parts.panel.append(this.parts.close,1);this.parts.panel.append(this.parts.triangleOuter);this.parts.panel.append(this.parts.content);this.parts.triangleOuter.append(this.parts.triangleInner);this.registerFocusable(this.parts.panel);this.registerFocusable(this.parts.close); this.parts.title.unselectable();this.parts.close.unselectable();CKEDITOR.document.getBody().append(this.parts.panel);this.resize(this.width,this.height);this.on(“show”,this.activateShowListeners,this);this.on(“hide”,this.deactivateShowListeners,this);this.parts.close.on(“click”,function(a){this.hide();a.data.preventDefault()},this)},show:function(){this.rect.visible||(this.rect.visible=!0,this.parts.panel.show(),this.fire(“show”))},hide:function(){this.rect.visible&&(this.rect.visible=!1,this.parts.panel.hide(), this.blur(),this.fire(“hide”))},blur:function(){this.editor.focus()},move:function(a,b){this.rect.left=b;this.rect.top=a;this.parts.panel.setStyles({left:CKEDITOR.tools.cssLength(b),top:CKEDITOR.tools.cssLength(a)})},attach:function(){function a(a){var d=a.getClientRect(),k=b.getScrollPosition();r||a.equals©?(d.top+=k.y,d.left+=k.x):(a=c.getClientRect(),d.top=a.top+d.top+k.y,d.left=a.left+d.left+k.x);d.right=d.left+d.width;d.bottom=d.top+d.height;return d}var b,c,p,r,t={right:“left”,top:“bottom”, topLeft:“bottomLeft”,topRight:“bottomRight”,bottom:“top”,bottomLeft:“topLeft”,bottomRight:“topRight”,left:“right”};return function(w,d){this.show();this.fire(“attach”);b=CKEDITOR.document.getWindow();c=this.editor.window.getFrame();p=this.editor.editable();r=p.isInline();var k=this.getWidth(),v=this.getHeight(),g=a(w),m=a(r?p:c),h=b.getViewPaneSize(),e=b.getScrollPosition(),h={top:Math.max(m.top,e.y),left:Math.max(m.left,e.x),right:Math.min(m.right,h.width+e.x),bottom:Math.min(m.bottom,h.height+e.y)}; r&&(h=this._getViewPaneRect(b),h.right+=this.triangleWidth,h.bottom+=this.triangleHeight);this._adjustElementRect(g,r?h:m);var m=k*v,g=this._getAlignments(g,k,v),f,l,n;for(n in g){e=v;l={top:g.top,left:g.left};l.right=l.left+k;l.bottom=l.top+e;var e=g,q=l,u=h;l=Math.max(0,Math.min(q.right,u.right)-Math.max(q.left,u.left));q=Math.max(0,Math.min(q.bottom,u.bottom)-Math.max(q.top,u.top));e=e.areaDifference=m-l*q;if(0===e){f=n;break}f||(f=n);e