!function(){var t=/"/g;CKEDITOR.plugins.add("autolink",{requires:"clipboard,textmatch",init:function(e){function a(a){if(a=(a={text:a,link:a.replace(t,"%22")}).link.match(CKEDITOR.config.autolink_urlRegex)?r.output(a):o.output(a),e.plugins.link){a=CKEDITOR.dom.element.createFromHtml(a);var n=CKEDITOR.plugins.link.parseLinkAttributes(e,a);n=CKEDITOR.plugins.link.getLinkAttributes(e,n);CKEDITOR.tools.isEmpty(n.set)||a.setAttributes(n.set),n.removed.length&&a.removeAttributes(n.removed),a.removeAttribute("data-cke-saved-href"),a=a.getOuterHtml()}return a}function n(t,e){var a=t.slice(0,e).split(/\s+/);return(a=a[a.length-1])&&i(a)?{start:t.lastIndexOf(a),end:e}:null}function i(t){return t.match(CKEDITOR.config.autolink_urlRegex)||t.match(CKEDITOR.config.autolink_emailRegex)}var r=new CKEDITOR.template('<a href="{link}">{text}</a>'),o=new CKEDITOR.template('<a href="mailto:{link}">{text}</a>');if(e.on("paste",(function(t){if(t.data.dataTransfer.getTransferType(e)!=CKEDITOR.DATA_TRANSFER_INTERNAL){var n=t.data.dataValue;-1<n.indexOf("<")||!i(n)||(t.data.dataValue=a(n),t.data.type="html")}})),!CKEDITOR.env.ie||CKEDITOR.env.edge){var l=e.config.autolink_commitKeystrokes||CKEDITOR.config.autolink_commitKeystrokes;e.on("key",(function(t){if("wysiwyg"===e.mode&&-1!=CKEDITOR.tools.indexOf(l,t.data.keyCode)&&((i=CKEDITOR.plugins.textMatch.match(e.getSelection().getRanges()[0],n))&&(!(t=e.getSelection()).getRanges()[0].startContainer.getAscendant("a",!0)&&(t.selectRanges([i.range]),e.insertHtml(a(i.text),"text"),!CKEDITOR.env.webkit)))){var i=t.getRanges()[0],r=e.createRange();r.setStartAfter(i.startContainer),t.selectRanges([r])}}))}}}),CKEDITOR.config.autolink_commitKeystrokes=[13,32],CKEDITOR.config.autolink_urlRegex=/^(https?|ftp):\/\/(-\.)?([^\s\/?\.#]+\.?)+(\/[^\s]*)?[^\s\.,]$/i,CKEDITOR.config.autolink_emailRegex=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/}();