text: !function(e,t){"use strict";function n(e,t){for(var n,i=[],r=0;r<e.length;++r){if(n=o[e[r]]||a(e[r]),!n)throw"module definition dependecy not found: "+e[r];i.push(n)}t.apply(null,i)}function i(e,i,a){if("string"!=typeof e)throw"invalid module definition, module id must be defined and be a string";if(i===t)throw"invalid module definition, dependencies must be specified";if(a===t)throw"invalid module definition, definition function must be specified";n(i,function(){o[e]=a.apply(null,arguments)})}function a(t){for(var n=e,i=t.split(/[.\/]/),a=0;a<i.length;++a){if(!n[i[a]])return;n=n[i[a]]}return n}function r(n){for(var i=0;i<n.length;i++){for(var a=e,r=n[i],s=r.split(/[.\/]/),l=0;l<s.length-1;++l)a[s[l]]===t&&(a[s[l]]={}),a=a[s[l]];a[s[s.length-1]]=o[r]}}var o={};i("tinymce/pasteplugin/Utils",["tinymce/util/Tools","tinymce/html/DomParser","tinymce/html/Schema"],function(e,t,n){function i(t,n){return e.each(n,function(e){t=e.constructor==RegExp?t.replace(e,""):t.replace(e[0],e[1])}),t}function a(i){function a(e){var t=e.name,n=e;if("br"===t)return s+="\n",void 0;if(l[t]&&(s+=" "),c[t])return s+=" ",void 0;if(3==e.type&&(s+=e.value),!e.shortEnded&&(e=e.firstChild))do a(e);while(e=e.next);p[t]&&n.next&&(s+="\n","p"==t&&(s+="\n"))}var r=new n,o=new t({},r),s="",l=r.getShortEndedElements(),c=e.makeMap("script noscript style textarea video audio iframe object"," "),p=r.getBlockElements();return a(o.parse(i)),s}return{filter:i,innerText:a}}),i("tinymce/pasteplugin/Clipboard",["tinymce/Env","tinymce/util/VK","tinymce/pasteplugin/Utils"],function(e,t,n){return function(i){function a(e){var t,n=i.dom;if(t=i.fire("BeforePastePreProcess",{content:e}),t=i.fire("PastePreProcess",t),e=t.content,!t.isDefaultPrevented()){if(i.hasEventListeners("PastePostProcess")&&!t.isDefaultPrevented()){var a=n.add(i.getBody(),"div",{style:"display:none"},e);t=i.fire("PastePostProcess",{node:a}),n.remove(a),e=t.node.innerHTML}t.isDefaultPrevented()||i.insertContent(e)}}function r(e){e=i.dom.encode(e).replace(/\r\n/g,"\n");var t,r=i.dom.getParent(i.selection.getStart(),i.dom.isBlock),o=i.settings.forced_root_block;o&&(t=i.dom.createHTML(o,i.settings.forced_root_block_attrs),t=t.substr(0,t.length-3)+">"),r&&/^(PRE|DIV)$/.test(r.nodeName)||!o?e=n.filter(e,[[/\n/g,"<br>"]]):(e=n.filter(e,[[/\n\n/g,"</p>"+t],[/^(.*<\/p>)(<p>)$/,t+"$1"],[/\n/g,"<br />"]]),-1!=e.indexOf("<p>")&&(e=t+e)),a(e)}function o(){var t,n=i.dom,a=i.getBody(),r=i.dom.getViewPort(i.getWin()),o=r.y,s=20;if(g=i.selection.getRng(),i.inline&&(t=i.selection.getScrollContainer(),t&&(o=t.scrollTop)),g.getClientRects){var l=g.getClientRects();if(l.length)s=o+(l[0].top-n.getPos(a).y);else{s=o;var c=g.startContainer;c&&(3==c.nodeType&&c.parentNode!=a&&(c=c.parentNode),1==c.nodeType&&(s=n.getPos(c,t||a).y))}}m=n.add(i.getBody(),"div",{id:"mcepastebin",contentEditable:!0,"data-mce-bogus":"1",style:"position: absolute; top: "+s+"px;width: 10px; height: 10px; overflow: hidden; opacity: 0"},b),(e.ie||e.gecko)&&n.setStyle(m,"left","rtl"==n.getStyle(a,"direction",!0)?65535:-65535),n.bind(m,"beforedeactivate focusin focusout",function(e){e.stopPropagation()}),m.focus(),i.selection.select(m,!0)}function s(){if(m){for(var e;e=i.dom.get("mcepastebin");)i.dom.remove(e),i.dom.unbind(e);g&&i.selection.setRng(g)}v=!1,m=g=null}function l(){var e,t,n=b;for(e=i.dom.select("div[id=mcepastebin]"),t=e.length;t--;){var a=e[t].innerHTML;n==b&&(n=""),a.length>n.length&&(n=a)}return n}function c(e){var t={};if(e&&e.types){var n=e.getData("Text");n&&n.length>0&&(t["text/plain"]=n);for(var i=0;i<e.types.length;i++){var a=e.types[i];t[a]=e.getData(a)}}return t}function p(e){return c(e.clipboardData||i.getDoc().dataTransfer)}function d(e,t){function n(e){if("image/png"==r[o].type){var t=new FileReader;return t.onload=function(){a('<img src="'+t.result+'">')},t.readAsDataURL(e.getAsFile()),!0}}if(!(!i.settings.paste_data_images||"text/html"in t||"text/plain"in t)&&e.clipboardData){var r=e.clipboardData.items;if(r)for(var o=0;o<r.length;o++)if(n(r[o]))return!0}}function u(e){var t,n=i.getDoc();if(n.caretPositionFromPoint){var a=n.caretPositionFromPoint(e.clientX,e.clientY);t=n.createRange(),t.setStart(a.offsetNode,a.offset),t.collapse(!0)}else n.caretRangeFromPoint&&(t=n.caretRangeFromPoint(e.clientX,e.clientY));return t}function f(){i.on("keydown",function(n){if(!n.isDefaultPrevented()&&(t.metaKeyPressed(n)&&86==n.keyCode||n.shiftKey&&45==n.keyCode)){if(v=n.shiftKey&&86==n.keyCode,n.stopImmediatePropagation(),y=(new Date).getTime(),e.ie&&v)return n.preventDefault(),i.fire("paste",{ieFake:!0}),void 0;s(),o()}}),i.on("paste",function(t){var c=p(t),u=(new Date).getTime()-y<1e3,f="text"==h.pasteFormat||v;return t.isDefaultPrevented()?(s(),void 0):d(t,c)?(s(),void 0):(u||t.preventDefault(),!e.ie||u&&!t.ieFake||(o(),i.dom.bind(m,"paste",function(e){e.stopPropagation()}),i.getDoc().execCommand("Paste",!1,null),c["text/html"]=l()),setTimeout(function(){var e=l();return m&&m.firstChild&&"mcepastebin"===m.firstChild.id&&(f=!0),s(),e!=b&&u||(e=c["text/html"]||c["text/plain"]||b,e!=b)?(f?r(c["text/plain"]||n.innerText(e)):a(e),void 0):(u||i.windowManager.alert("Please use Ctrl+V/Cmd+V keyboard shortcuts to paste contents."),void 0)},0),void 0)}),i.on("dragstart",function(e){if(e.dataTransfer.types)try{e.dataTransfer.setData("mce-internal",i.selection.getContent())}catch(t){}}),i.on("drop",function(e){var t=u(e);if(t&&!e.isDefaultPrevented()){var n=c(e.dataTransfer),o=n["mce-internal"]||n["text/html"]||n["text/plain"];o&&(e.preventDefault(),i.undoManager.transact(function(){n["mce-internal"]&&i.execCommand("Delete"),i.selection.setRng(t),n["text/html"]?a(o):r(o)}))}})}var m,g,v,h=this,y=0,b="%MCEPASTEBIN%";h.pasteHtml=a,h.pasteText=r,i.on("preInit",function(){f(),i.parser.addNodeFilter("img",function(t){if(!i.settings.paste_data_images)for(var n=t.length;n--;){var a=t[n].attributes.map.src;a&&0===a.indexOf("data:image")&&(t[n].attr("data-mce-object")||a===e.transparentSrc||t[n].remove())}})}),i.on("PreProcess",function(){i.dom.remove(i.dom.get("mcepastebin"))})}}),i("tinymce/pasteplugin/WordFilter",["tinymce/util/Tools","tinymce/html/DomParser","tinymce/html/Schema","tinymce/html/Serializer","tinymce/html/Node","tinymce/pasteplugin/Utils"],function(e,t,n,i,a,r){function o(e){return/<font face="Times New Roman"|class="?Mso|style="[^"]*\bmso-|style='[^'']*\bmso-|w:WordDocument/i.test(e)}function s(s){var l=s.settings;s.on("BeforePastePreProcess",function(c){function p(e){function t(e,t,o,s){var l=e._listLevel||r;l!=r&&(r>l?n&&(n=n.parent.parent):(i=n,n=null)),n&&n.name==o?n.append(e):(i=i||n,n=new a(o,1),s>1&&n.attr("start",""+s),e.wrap(n)),e.name="li",t.value="";var c=t.next;c&&3==c.type&&(c.value=c.value.replace(/^\u00a0+/,"")),l>r&&i&&i.lastChild.append(n),r=l}for(var n,i,r=1,o=e.getAll("p"),s=0;s<o.length;s++)if(e=o[s],"p"==e.name&&e.firstChild){for(var l="",c=e.firstChild;c&&!(l=c.value);)c=c.firstChild;if(/^\s*[\u2022\u00b7\u00a7\u00d8\u25CF]\s*$/.test(l)){t(e,c,"ul");continue}if(/^\s*\w+\.$/.test(l)){var p=/([0-9])\./.exec(l),d=1;p&&(d=parseInt(p[1],10)),t(e,c,"ol",d);continue}n=null}}function d(t,n){if("p"===t.name){var i=/mso-list:\w+ \w+([0-9]+)/.exec(n);i&&(t._listLevel=parseInt(i[1],10))}if(s.getParam("paste_retain_style_properties","none")){var a="";if(e.each(s.dom.parseStyle(n),function(e,t){switch(t){case"horiz-align":return t="text-align",void 0;case"vert-align":return t="vertical-align",void 0;case"font-color":case"mso-foreground":return t="color",void 0;case"mso-background":case"mso-highlight":t="background"}("all"==u||f&&f[t])&&(a+=t+":"+e+";")}),a)return a}return null}var u,f,m=c.content;if(u=l.paste_retain_style_properties,u&&(f=e.makeMap(u)),l.paste_enable_default_filters!==!1&&o(c.content)){c.wordContent=!0,m=r.filter(m,[/<!--[\s\S]+?-->/gi,/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,[/<(\/?)s>/gi,"<$1strike>"],[/&nbsp;/gi," "],[/<span\s+style\s*=\s*"\s*mso-spacerun\s*:\s*yes\s*;?\s*"\s*>([\s\u00a0]*)<\/span>/gi,function(e,t){return t.length>0?t.replace(/./," ").slice(Math.floor(t.length/2)).split("").join(" "):""}]]);var g=l.paste_word_valid_elements;g||(g="@[style],-strong/b,-em/i,-span,-p,-ol,-ul,-li,-h1,-h2,-h3,-h4,-h5,-h6,-table[width],-tr,-td[colspan|rowspan|width],-th,-thead,-tfoot,-tbody,-a[href|name],sub,sup,strike,br");var v=new n({valid_elements:g}),h=new t({},v);h.addAttributeFilter("style",function(e){for(var t,n=e.length;n--;)t=e[n],t.attr("style",d(t,t.attr("style"))),"span"!=t.name||t.attributes.length||t.unwrap()}),h.addNodeFilter("a",function(e){for(var t,n,i,a=e.length;a--;)t=e[a],n=t.attr("href"),i=t.attr("name"),n&&0===n.indexOf("file://")&&(n=n.split("#")[1],n&&(n="#"+n)),n||i?t.attr({href:n,name:i}):t.unwrap()});var y=h.parse(m);p(y),c.content=new i({},v).serialize(y)}})}return s.isWordContent=o,s}),i("tinymce/pasteplugin/Quirks",["tinymce/Env","tinymce/util/Tools","tinymce/pasteplugin/WordFilter","tinymce/pasteplugin/Utils"],function(e,t,n,i){return function(a){function r(e){a.on("BeforePastePreProcess",function(t){t.content=e(t.content)})}function o(e){return e=i.filter(e,[/^[\s\S]*<!--StartFragment-->|<!--EndFragment-->[\s\S]*$/g,[/<span class="Apple-converted-space">\u00a0<\/span>/g," "],/<br>$/])}function s(e){if(!n.isWordContent(e))return e;var r=[];t.each(a.schema.getBlockElements(),function(e,t){r.push(t)});var o=new RegExp("(?:<br>&nbsp;[\\s\\r\\n]+|<br>)*(<\\/?("+r.join("|")+")[^>]*>)(?:<br>&nbsp;[\\s\\r\\n]+|<br>)*","g");return e=i.filter(e,[[o,"$1"]]),e=i.filter(e,[[/<br><br>/g,"<BR><BR>"],[/<br>/g," "],[/<BR><BR>/g,"<br>"]])}function l(e){return(a.settings.paste_remove_styles||a.settings.paste_remove_styles_if_webkit!==!1)&&(e=e.replace(/ style=\"[^\"]+\"/g,"")),e}e.webkit&&(r(l),r(o)),e.ie&&r(s)}}),i("tinymce/pasteplugin/Plugin",["tinymce/PluginManager","tinymce/pasteplugin/Clipboard","tinymce/pasteplugin/WordFilter","tinymce/pasteplugin/Quirks"],function(e,t,n,i){var a;e.add("paste",function(e){function r(){"text"==o.pasteFormat?(this.active(!1),o.pasteFormat="html"):(o.pasteFormat="text",this.active(!0),a||(e.windowManager.alert("Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off."),a=!0))}var o,s=this,l=e.settings;s.clipboard=o=new t(e),s.quirks=new i(e),s.wordFilter=new n(e),e.settings.paste_as_text&&(s.clipboard.pasteFormat="text"),l.paste_preprocess&&e.on("PastePreProcess",function(e){l.paste_preprocess.call(s,s,e)}),l.paste_postprocess&&e.on("PastePostProcess",function(e){l.paste_postprocess.call(s,s,e)}),e.addCommand("mceInsertClipboardContent",function(e,t){t.content&&s.clipboard.pasteHtml(t.content),t.text&&s.clipboard.pasteText(t.text)}),e.paste_block_drop&&e.on("dragend dragover draggesture dragdrop drop drag",function(e){e.preventDefault(),e.stopPropagation()}),e.settings.paste_data_images||e.on("drop",function(e){var t=e.dataTransfer;t&&t.files&&t.files.length>0&&e.preventDefault()}),e.addButton("pastetext",{icon:"pastetext",tooltip:"Paste as text",onclick:r,active:"text"==s.clipboard.pasteFormat}),e.addMenuItem("pastetext",{text:"Paste as text",selectable:!0,active:o.pasteFormat,onclick:r})})}),r(["tinymce/pasteplugin/Utils","tinymce/pasteplugin/Clipboard","tinymce/pasteplugin/WordFilter","tinymce/pasteplugin/Quirks","tinymce/pasteplugin/Plugin"])}(this);