(function(){CKEDITOR.plugins.add('pastefromword',{init:function(a){var b=0,c=function(){setTimeout(function(){b=0;},0);};a.addCommand('pastefromword',{canUndo:false,exec:function(){b=1;if(a.execCommand('paste')===false)a.on('dialogHide',function(d){d.removeListener();c();});else c();}});a.ui.addButton('PasteFromWord',{label:a.lang.pastefromword.toolbar,command:'pastefromword'});a.on('paste',function(d){var e=d.data,f;if((f=e.html)&&(b||/(class=\"?Mso|style=\"[^\"]*\bmso\-|w:WordDocument)/.test(f))){var g=this.loadFilterRules(function(){if(g)a.fire('paste',e);else if(!a.config.pasteFromWordPromptCleanup||b||confirm(a.lang.pastefromword.confirmCleanup))e.html=CKEDITOR.cleanWord(f,a);});g&&d.cancel();}},this);},loadFilterRules:function(a){var b=CKEDITOR.cleanWord;if(b)a();else{var c=CKEDITOR.getUrl(CKEDITOR.config.pasteFromWordCleanupFile||this.path+'filter/default.js');CKEDITOR.scriptLoader.load(c,a,null,false,true);}return!b;}});})();
