// tinymce 4.0.16 modified (function(e,t){"use strict";function r(e,t){var r,i=[];for(var s=0;sr.cacheLength){delete e[t.shift()]}e[n]=i;return i};return e}function ot(e){e[y]=true;return e}function ut(e){var t=c.createElement("div");try{return!!e(t)}catch(n){return false}finally{t=null}}function at(e,t,n,r){var i,s,o,u,a,f,h,v,m,E;if((t?t.ownerDocument||t:b)!==c){l(t)}t=t||c;n=n||[];if(!e||typeof e!=="string"){return n}if((u=t.nodeType)!==1&&u!==9){return[]}if(p&&!r){if(i=Q.exec(e)){if(o=i[1]){if(u===9){s=t.getElementById(o);if(s&&s.parentNode){if(s.id===o){n.push(s);return n}}else{return n}}else{if(t.ownerDocument&&(s=t.ownerDocument.getElementById(o))&&g(t,s)&&s.id===o){n.push(s);return n}}}else if(i[2]){D.apply(n,t.getElementsByTagName(e));return n}else if((o=i[3])&&w.getElementsByClassName&&t.getElementsByClassName){D.apply(n,t.getElementsByClassName(o));return n}}if(w.qsa&&!d.test(e)){h=true;v=y;m=t;E=u===9&&e;if(u===1&&t.nodeName.toLowerCase()!=="object"){f=pt(e);if(h=t.getAttribute("id")){v=h.replace(Z,"\\$&")}else{t.setAttribute("id",v)}v="[id='"+v+"'] ";a=f.length;while(a--){f[a]=v+dt(f[a])}m=J.test(e)&&t.parentNode||t;E=f.join(",")}if(E){try{D.apply(n,m.querySelectorAll(E));return n}catch(S){}finally{if(!h){t.removeAttribute("id")}}}}}return St(e.replace(U,"$1"),t,n,r)}function ft(e,t){var n=t&&e,r=n&&(~t.sourceIndex||A)-(~e.sourceIndex||A);if(r){return r}if(n){while(n=n.nextSibling){if(n===t){return-1}}}return e?1:-1}function lt(e){return function(t){var n=t.nodeName.toLowerCase();return n==="input"&&t.type===e}}function ct(e){return function(t){var n=t.nodeName.toLowerCase();return(n==="input"||n==="button")&&t.type===e}}function ht(e){return ot(function(t){t=+t;return ot(function(n,r){var i,s=e([],n.length,t),o=s.length;while(o--){if(n[i=s[o]]){n[i]=!(r[i]=n[i])}}})})}function pt(e,t){var n,i,s,o,u,a,f,l=T[e+" "];if(l){return t?0:l.slice(0)}u=e;a=[];f=r.preFilter;while(u){if(!n||(i=z.exec(u))){if(i){u=u.slice(i[0].length)||u}a.push(s=[])}n=false;if(i=W.exec(u)){n=i.shift();s.push({value:n,type:i[0].replace(U," ")});u=u.slice(n.length)}for(o in r.filter){if((i=$[o].exec(u))&&(!f[o]||(i=f[o](i)))){n=i.shift();s.push({value:n,type:o,matches:i});u=u.slice(n.length)}}if(!n){break}}return t?u.length:u?at.error(e):T(e,a).slice(0)}function dt(e){var t=0,n=e.length,r="";for(;t1?function(t,n,r){var i=e.length;while(i--){if(!e[i](t,n,r)){return false}}return true}:e[0]}function gt(e,t,n,r,i){var s,o=[],u=0,a=e.length,f=t!=null;for(;u-1){s[f]=!(o[f]=c)}}}}else{g=gt(g===o?g.splice(d,g.length):g);if(i){i(null,o,g,a)}else{D.apply(o,g)}}})}function bt(e){var t,n,i,s=e.length,o=r.relative[e[0].type],a=o||r.relative[" "],f=o?1:0,l=vt(function(e){return e===t},a,true),c=vt(function(e){return H.call(t,e)>-1},a,true),h=[function(e,n,r){return!o&&(r||n!==u)||((t=n).nodeType?l(e,n,r):c(e,n,r))}];for(;f1&&mt(h),f>1&&dt(e.slice(0,f-1)).replace(U,"$1"),n,f0,o=e.length>0,a=function(a,f,l,h,p){var d,v,m,g=[],y=0,b="0",w=a&&[],S=p!=null,x=u,T=a||o&&r.find["TAG"]("*",p&&f.parentNode||f),N=E+=x==null?1:Math.random()||.1;if(S){u=f!==c&&f;n=i}for(;(d=T[b])!=null;b++){if(o&&d){v=0;while(m=e[v++]){if(m(d,f,l)){h.push(d);break}}if(S){E=N;n=++i}}if(s){if(d=!m&&d){y--}if(a){w.push(d)}}}y+=b;if(s&&b!==y){v=0;while(m=t[v++]){m(w,g,f,l)}if(a){if(y>0){while(b--){if(!(w[b]||g[b])){g[b]=M.call(h)}}}g=gt(g)}D.apply(h,g);if(S&&!a&&g.length>0&&y+t.length>1){at.uniqueSort(h)}}if(S){E=N;u=x}return w};return s?ot(a):a}function Et(e,t,n){var r=0,i=t.length;for(;r2&&(a=u[0]).type==="ID"&&t.nodeType===9&&p&&r.relative[u[1].type]){t=(r.find["ID"](a.matches[0].replace(tt,nt),t)||[])[0];if(!t){return n}e=e.slice(u.shift().value.length)}s=$["needsContext"].test(e)?0:u.length;while(s--){a=u[s];if(r.relative[f=a.type]){break}if(l=r.find[f]){if(i=l(a.matches[0].replace(tt,nt),J.test(u[0].type)&&t.parentNode||t)){u.splice(s,1);e=i.length&&dt(u);if(!e){D.apply(n,i);return n}break}}}}}o(e,c)(i,t,!p,n,J.test(e));return n}function xt(){}var e,n,r,i,s,o,u,a,f,l,c,h,p,d,v,m,g,y="sizzle"+ -(new Date),b=window.document,w={},E=0,S=0,x=st(),T=st(),N=st(),C=false,k=function(){return 0},L=typeof t,A=1<<31,O=[],M=O.pop,_=O.push,D=O.push,P=O.slice,H=O.indexOf||function(e){var t=0,n=this.length;for(;t+~])"+B+"*"),X=new RegExp(R),V=new RegExp("^"+F+"$"),$={ID:new RegExp("^#("+j+")"),CLASS:new RegExp("^\\.("+j+")"),NAME:new RegExp("^\\[name=['\"]?("+j+")['\"]?\\]"),TAG:new RegExp("^("+j.replace("w","w*")+")"),ATTR:new RegExp("^"+q),PSEUDO:new RegExp("^"+R),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+B+"*(even|odd|(([+-]|)(\\d*)n|)"+B+"*(?:([+-]|)"+B+"*(\\d+)|))"+B+"*\\)|)","i"),needsContext:new RegExp("^"+B+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+B+"*((?:-\\d)?\\d*)"+B+"*\\)|)(?=[^-]|$)","i")},J=/[\x20\t\r\n\f]*[+~]/,K=/^[^{]+\{\s*\[native code/,Q=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,G=/^(?:input|select|textarea|button)$/i,Y=/^h\d$/i,Z=/'|\\/g,et=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,tt=/\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,nt=function(e,t){var n="0x"+t-65536;return n!==n?t:n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,n&1023|56320)};try{D.apply(O=P.call(b.childNodes),b.childNodes);O[b.childNodes.length].nodeType}catch(rt){D={apply:O.length?function(e,t){_.apply(e,P.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]){}e.length=n-1}}}s=at.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?t.nodeName!=="HTML":false};l=at.setDocument=function(e){var n=e?e.ownerDocument||e:b;if(n===c||n.nodeType!==9||!n.documentElement){return c}c=n;h=n.documentElement;p=!s(n);w.getElementsByTagName=ut(function(e){e.appendChild(n.createComment(""));return!e.getElementsByTagName("*").length});w.attributes=ut(function(e){e.innerHTML="";var t=typeof e.lastChild.getAttribute("multiple");return t!=="boolean"&&t!=="string"});w.getElementsByClassName=ut(function(e){e.innerHTML="";if(!e.getElementsByClassName||!e.getElementsByClassName("e").length){return false}e.lastChild.className="e";return e.getElementsByClassName("e").length===2});w.getByName=ut(function(e){e.id=y+0;e.appendChild(c.createElement("a")).setAttribute("name",y);e.appendChild(c.createElement("i")).setAttribute("name",y);h.appendChild(e);var t=n.getElementsByName&&n.getElementsByName(y).length===2+n.getElementsByName(y+0).length;h.removeChild(e);return t});w.sortDetached=ut(function(e){return e.compareDocumentPosition&&e.compareDocumentPosition(c.createElement("div"))&1});r.attrHandle=ut(function(e){e.innerHTML="";return e.firstChild&&typeof e.firstChild.getAttribute!==L&&e.firstChild.getAttribute("href")==="#"})?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}};if(w.getByName){r.find["ID"]=function(e,t){if(typeof t.getElementById!==L&&p){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}};r.filter["ID"]=function(e){var t=e.replace(tt,nt);return function(e){return e.getAttribute("id")===t}}}else{r.find["ID"]=function(e,n){if(typeof n.getElementById!==L&&p){var r=n.getElementById(e);return r?r.id===e||typeof r.getAttributeNode!==L&&r.getAttributeNode("id").value===e?[r]:t:[]}};r.filter["ID"]=function(e){var t=e.replace(tt,nt);return function(e){var n=typeof e.getAttributeNode!==L&&e.getAttributeNode("id");return n&&n.value===t}}}r.find["TAG"]=w.getElementsByTagName?function(e,t){if(typeof t.getElementsByTagName!==L){return t.getElementsByTagName(e)}}:function(e,t){var n,r=[],i=0,s=t.getElementsByTagName(e);if(e==="*"){while(n=s[i++]){if(n.nodeType===1){r.push(n)}}return r}return s};r.find["NAME"]=w.getByName&&function(e,t){if(typeof t.getElementsByName!==L){return t.getElementsByName(name)}};r.find["CLASS"]=w.getElementsByClassName&&function(e,t){if(typeof t.getElementsByClassName!==L&&p){return t.getElementsByClassName(e)}};v=[];d=[":focus"];if(w.qsa=it(n.querySelectorAll)){ut(function(e){e.innerHTML="";if(!e.querySelectorAll("[selected]").length){d.push("\\["+B+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)")}if(!e.querySelectorAll(":checked").length){d.push(":checked")}});ut(function(e){e.innerHTML="";if(e.querySelectorAll("[i^='']").length){d.push("[*^$]="+B+"*(?:\"\"|'')")}if(!e.querySelectorAll(":enabled").length){d.push(":enabled",":disabled")}e.querySelectorAll("*,:x");d.push(",.*:")})}if(w.matchesSelector=it(m=h.matchesSelector||h.mozMatchesSelector||h.webkitMatchesSelector||h.oMatchesSelector||h.msMatchesSelector)){ut(function(e){w.disconnectedMatch=m.call(e,"div");m.call(e,"[s!='']:x");v.push("!=",R)})}d=new RegExp(d.join("|"));v=v.length&&new RegExp(v.join("|"));g=it(h.contains)||h.compareDocumentPosition?function(e,t){var n=e.nodeType===9?e.documentElement:e,r=t&&t.parentNode;return e===r||!!(r&&r.nodeType===1&&(n.contains?n.contains(r):e.compareDocumentPosition&&e.compareDocumentPosition(r)&16))}:function(e,t){if(t){while(t=t.parentNode){if(t===e){return true}}}return false};k=h.compareDocumentPosition?function(e,t){if(e===t){C=true;return 0}var r=t.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(t);if(r){if(r&1||a&&t.compareDocumentPosition(e)===r){if(e===n||g(b,e)){return-1}if(t===n||g(b,t)){return 1}return f?H.call(f,e)-H.call(f,t):0}return r&4?-1:1}return e.compareDocumentPosition?-1:1}:function(e,t){var r,i=0,s=e.parentNode,o=t.parentNode,u=[e],a=[t];if(e===t){C=true;return 0}else if(!s||!o){return e===n?-1:t===n?1:s?-1:o?1:0}else if(s===o){return ft(e,t)}r=e;while(r=r.parentNode){u.unshift(r)}r=t;while(r=r.parentNode){a.unshift(r)}while(u[i]===a[i]){i++}return i?ft(u[i],a[i]):u[i]===b?-1:a[i]===b?1:0};return c};at.matches=function(e,t){return at(e,null,null,t)};at.matchesSelector=function(e,t){if((e.ownerDocument||e)!==c){l(e)}t=t.replace(et,"='$1']");if(w.matchesSelector&&p&&(!v||!v.test(t))&&!d.test(t)){try{var n=m.call(e,t);if(n||w.disconnectedMatch||e.document&&e.document.nodeType!==11){return n}}catch(r){}}return at(t,c,null,[e]).length>0};at.contains=function(e,t){if((e.ownerDocument||e)!==c){l(e)}return g(e,t)};at.attr=function(e,t){var n;if((e.ownerDocument||e)!==c){l(e)}if(p){t=t.toLowerCase()}if(n=r.attrHandle[t]){return n(e)}if(!p||w.attributes){return e.getAttribute(t)}return((n=e.getAttributeNode(t))||e.getAttribute(t))&&e[t]===true?t:n&&n.specified?n.value:null};at.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)};at.uniqueSort=function(e){var t,n=[],r=0,i=0;C=!w.detectDuplicates;a=!w.sortDetached;f=!w.sortStable&&e.slice(0);e.sort(k);if(C){while(t=e[i++]){if(t===e[i]){r=n.push(i)}}while(r--){e.splice(n[r],1)}}return e};i=at.getText=function(e){var t,n="",r=0,s=e.nodeType;if(!s){for(;t=e[r];r++){n+=i(t)}}else if(s===1||s===9||s===11){if(typeof e.textContent==="string"){return e.textContent}else{for(e=e.firstChild;e;e=e.nextSibling){n+=i(e)}}}else if(s===3||s===4){return e.nodeValue}return n};r=at.selectors={cacheLength:50,createPseudo:ot,match:$,find:{},relative:{">":{dir:"parentNode",first:true}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:true},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){e[1]=e[1].replace(tt,nt);e[3]=(e[4]||e[5]||"").replace(tt,nt);if(e[2]==="~="){e[3]=" "+e[3]+" "}return e.slice(0,4)},CHILD:function(e){e[1]=e[1].toLowerCase();if(e[1].slice(0,3)==="nth"){if(!e[3]){at.error(e[0])}e[4]=+(e[4]?e[5]+(e[6]||1):2*(e[3]==="even"||e[3]==="odd"));e[5]=+(e[7]+e[8]||e[3]==="odd")}else if(e[3]){at.error(e[0])}return e},PSEUDO:function(e){var t,n=!e[5]&&e[2];if($["CHILD"].test(e[0])){return null}if(e[4]){e[2]=e[4]}else if(n&&X.test(n)&&(t=pt(n,true))&&(t=n.indexOf(")",n.length-t)-n.length)){e[0]=e[0].slice(0,t);e[2]=n.slice(0,t)}return e.slice(0,3)}},filter:{TAG:function(e){if(e==="*"){return function(){return true}}e=e.replace(tt,nt).toLowerCase();return function(t){return t.nodeName&&t.nodeName.toLowerCase()===e}},CLASS:function(e){var t=x[e+" "];return t||(t=new RegExp("(^|"+B+")"+e+"("+B+"|$)"))&&x(e,function(e){return t.test(e.className||typeof e.getAttribute!==L&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=at.attr(r,e);if(i==null){return t==="!="}if(!t){return true}i+="";return t==="="?i===n:t==="!="?i!==n:t==="^="?n&&i.indexOf(n)===0:t==="*="?n&&i.indexOf(n)>-1:t==="$="?n&&i.slice(-n.length)===n:t==="~="?(" "+i+" ").indexOf(n)>-1:t==="|="?i===n||i.slice(0,n.length+1)===n+"-":false}},CHILD:function(e,t,n,r,i){var s=e.slice(0,3)!=="nth",o=e.slice(-4)!=="last",u=t==="of-type";return r===1&&i===0?function(e){return!!e.parentNode}:function(t,n,a){var f,l,c,h,p,d,v=s!==o?"nextSibling":"previousSibling",m=t.parentNode,g=u&&t.nodeName.toLowerCase(),b=!a&&!u;if(m){if(s){while(v){c=t;while(c=c[v]){if(u?c.nodeName.toLowerCase()===g:c.nodeType===1){return false}}d=v=e==="only"&&!d&&"nextSibling"}return true}d=[o?m.firstChild:m.lastChild];if(o&&b){l=m[y]||(m[y]={});f=l[e]||[];p=f[0]===E&&f[1];h=f[0]===E&&f[2];c=p&&m.childNodes[p];while(c=++p&&c&&c[v]||(h=p=0)||d.pop()){if(c.nodeType===1&&++h&&c===t){l[e]=[E,p,h];break}}}else if(b&&(f=(t[y]||(t[y]={}))[e])&&f[0]===E){h=f[1]}else{while(c=++p&&c&&c[v]||(h=p=0)||d.pop()){if((u?c.nodeName.toLowerCase()===g:c.nodeType===1)&&++h){if(b){(c[y]||(c[y]={}))[e]=[E,h]}if(c===t){break}}}}h-=i;return h===r||h%r===0&&h/r>=0}}},PSEUDO:function(e,t){var n,i=r.pseudos[e]||r.setFilters[e.toLowerCase()]||at.error("unsupported pseudo: "+e);if(i[y]){return i(t)}if(i.length>1){n=[e,e,"",t];return r.setFilters.hasOwnProperty(e.toLowerCase())?ot(function(e,n){var r,s=i(e,t),o=s.length;while(o--){r=H.call(e,s[o]);e[r]=!(n[r]=s[o])}}):function(e){return i(e,0,n)}}return i}},pseudos:{not:ot(function(e){var t=[],n=[],r=o(e.replace(U,"$1"));return r[y]?ot(function(e,t,n,i){var s,o=r(e,null,i,[]),u=e.length;while(u--){if(s=o[u]){e[u]=!(t[u]=s)}}}):function(e,i,s){t[0]=e;r(t,null,s,n);return!n.pop()}}),has:ot(function(e){return function(t){return at(e,t).length>0}}),contains:ot(function(e){return function(t){return(t.textContent||t.innerText||i(t)).indexOf(e)>-1}}),lang:ot(function(e){if(!V.test(e||"")){at.error("unsupported lang: "+e)}e=e.replace(tt,nt).toLowerCase();return function(t){var n;do{if(n=p?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang")){n=n.toLowerCase();return n===e||n.indexOf(e+"-")===0}}while((t=t.parentNode)&&t.nodeType===1);return false}}),target:function(e){var t=window.location&&window.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===h},focus:function(e){return e===c.activeElement&&(!c.hasFocus||c.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===false},disabled:function(e){return e.disabled===true},checked:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&!!e.checked||t==="option"&&!!e.selected},selected:function(e){if(e.parentNode){e.parentNode.selectedIndex}return e.selected===true},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling){if(e.nodeName>"@"||e.nodeType===3||e.nodeType===4){return false}}return true},parent:function(e){return!r.pseudos["empty"](e)},header:function(e){return Y.test(e.nodeName)},input:function(e){return G.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&e.type==="button"||t==="button"},text:function(e){var t;return e.nodeName.toLowerCase()==="input"&&e.type==="text"&&((t=e.getAttribute("type"))==null||t.toLowerCase()===e.type)},first:ht(function(){return[0]}),last:ht(function(e,t){return[t-1]}),eq:ht(function(e,t,n){return[n<0?n+t:n]}),even:ht(function(e,t){var n=0;for(;n=0;){e.push(r)}return e}),gt:ht(function(e,t,n){var r=n<0?n+t:n;for(;++r)[^>]*$|#([\w\-]*)$)/;var u=e.Event;var d=p("fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom");var b=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"};var w=/^\s*|\s*$/g;var E=function(e){return e===null||e===t?"":(""+e).replace(w,"")};v.fn=v.prototype={constructor:v,selector:"",length:0,init:function(e,t){var n=this,i,s;if(!e){return n}if(e.nodeType){n.context=n[0]=e;n.length=1;return n}if(f(e)){if(e.charAt(0)==="<"&&e.charAt(e.length-1)===">"&&e.length>=3){i=[null,e,null]}else{i=o.exec(e)}if(i){if(i[1]){s=l(e).firstChild;while(s){this.add(s);s=s.nextSibling}}else{s=r.getElementById(i[2]);if(s.id!==i[2]){return n.find(e)}n.length=1;n[0]=s}}else{return v(t||document).find(e)}}else{this.add(e)}return n},toArray:function(){return g(this)},add:function(e){var t=this;if(!b(e)){if(e instanceof v){t.add(e.toArray())}else{i.call(t,e)}}else{i.apply(t,e)}return t},attr:function(e,n){var r=this;if(typeof e==="object"){S(e,function(e,t){r.attr(t,e)})}else if(a(n)){this.each(function(){if(this.nodeType===1){this.setAttribute(e,n)}})}else{return r[0]&&r[0].nodeType===1?r[0].getAttribute(e):t}return r},css:function(e,n){var r=this;if(typeof e==="object"){S(e,function(e,t){r.css(t,e)})}else{e=e.replace(/-(\D)/g,function(e,t){return t.toUpperCase()});if(a(n)){if(typeof n==="number"&&!d[e]){n+="px"}r.each(function(){var t=this.style;if(e==="opacity"&&this.runtimeStyle&&typeof this.runtimeStyle.opacity==="undefined"){t.filter=n===""?"":"alpha(opacity="+n*100+")"}try{t[e]=n}catch(r){}})}else{return r[0]?r[0].style[e]:t}}return r},remove:function(){var e=this,t,n=this.length;while(n--){t=e[n];u.clean(t);if(t.parentNode){t.parentNode.removeChild(t)}}return this},empty:function(){var e=this,t,n=this.length;while(n--){t=e[n];while(t.firstChild){t.removeChild(t.firstChild)}}return this},html:function(e){var t=this,n;if(a(e)){n=t.length;while(n--){t[n].innerHTML=e}return t}return t[0]?t[0].innerHTML:""},text:function(e){var t=this,n;if(a(e)){n=t.length;while(n--){t[n].innerText=t[0].textContent=e}return t}return t[0]?t[0].innerText||t[0].textContent:""},append:function(){return c(this,arguments,function(e){if(this.nodeType===1){this.appendChild(e)}})},prepend:function(){return c(this,arguments,function(e){if(this.nodeType===1){this.insertBefore(e,this.firstChild)}})},before:function(){var e=this;if(e[0]&&e[0].parentNode){return c(e,arguments,function(e){this.parentNode.insertBefore(e,this.nextSibling)})}return e},after:function(){var e=this;if(e[0]&&e[0].parentNode){return c(e,arguments,function(e){this.parentNode.insertBefore(e,this)})}return e},appendTo:function(e){v(e).append(this);return this},addClass:function(e){return this.toggleClass(e,true)},removeClass:function(e){return this.toggleClass(e,false)},toggleClass:function(e,t){var n=this;if(e.indexOf(" ")!==-1){S(e.split(" "),function(){n.toggleClass(this,t)})}else{n.each(function(){var n=this,r;if(h(n,e)!==t){r=n.className;if(t){n.className+=r?" "+e:e}else{n.className=E((" "+r+" ").replace(" "+e+" "," "))}}})}return n},hasClass:function(e){return h(this[0],e)},each:function(e){return S(this,e)},on:function(e,t){return this.each(function(){u.bind(this,e,t)})},off:function(e,t){return this.each(function(){u.unbind(this,e,t)})},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},slice:function(){return new v(s.apply(this,arguments))},eq:function(e){return e===-1?this.slice(e):this.slice(e,+e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},replaceWith:function(e){var t=this;if(t[0]){t[0].parentNode.replaceChild(v(e)[0],t[0])}return t},wrap:function(e){e=v(e)[0];return this.each(function(){var t=this,n=e.cloneNode(false);t.parentNode.insertBefore(n,t);n.appendChild(t)})},unwrap:function(){return this.each(function(){var e=this,t=e.firstChild,n;while(t){n=t;t=t.nextSibling;e.parentNode.insertBefore(n,e)}})},clone:function(){var e=[];this.each(function(){e.push(this.cloneNode(true))});return v(e)},find:function(e){var t,n,r=[];for(t=0,n=this.length;t1){throw new Error("DomQuery only supports traverse functions on a single node.")}if(r[0]){i=t(r[0],n)}i=v(i);if(n&&e!=="parentsUntil"){return i.filter(n)}return i}});v.fn.filter=function(e){return v.filter(e)};v.fn.is=function(e){return!!e&&this.filter(e).length>0};v.fn.init.prototype=v.fn;return v});i("tinymce/html/Styles",[],function(){return function(e,t){function c(e,t,n,r){function i(e){e=parseInt(e,10).toString(16);return e.length>1?e:"0"+e}return"#"+i(t)+i(n)+i(r)}var n=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,r=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,i=/\s*([^:]+):\s*([^;]+);?/g,s=/\s+$/,o,u,a={},f,l="";e=e||{};f=("\\\" \\' \\; \\: ; : "+l).split(" ");for(u=0;u-1&&n){return}o[e+t]=u==-1?f[0]:f.join(" ");delete o[e+"-top"+t];delete o[e+"-right"+t];delete o[e+"-bottom"+t];delete o[e+"-left"+t]}function g(e){var t=o[e],n;if(!t){return}t=t.split(" ");n=t.length;while(n--){if(t[n]!==t[0]){return false}}o[e]=t[0];return true}function y(e,t,n,r){if(!g(t)){return}if(!g(n)){return}if(!g(r)){return}o[e]=o[t]+" "+o[n]+" "+o[r];delete o[t];delete o[n];delete o[r]}function b(e){p=true;return a[e]}function w(e,t){if(p){e=e.replace(/\uFEFF[0-9]/g,function(e){return a[e]})}if(!t){e=e.replace(/\\([\'\";:])/g,"$1")}return e}function E(t,n,r,i,s,o){s=s||o;if(s){s=w(s);return"'"+s.replace(/\'/g,"\\'")+"'"}n=w(n||r||i);if(!e.allow_script_urls&&/(java|vb)script:/i.test(n.replace(/[\s\r\n]+/,""))){return""}if(d){n=d.call(v,n,"style")}return"url('"+n.replace(/\'/g,"\\'")+"')"}var o={},f,l,h,p,d=e.url_converter;var v=e.url_converter_scope||this;if(t){t=t.replace(/[\u0000-\u001F]/g,"");t=t.replace(/\\[\"\';:\uFEFF]/g,b).replace(/\"[^\"]+\"|\'[^\']+\'/g,function(e){return e.replace(/[;:]/g,b)});while(f=i.exec(t)){l=f[1].replace(s,"").toLowerCase();h=f[2].replace(s,"");if(l&&h.length>0){if(!e.allow_script_urls&&(l=="behavior"||/expression\s*\(/.test(h))){continue}if(l==="font-weight"&&h==="700"){h="bold"}else if(l==="color"||l==="background-color"){h=h.toLowerCase()}h=h.replace(n,c);h=h.replace(r,E);o[l]=p?w(h,true):h}i.lastIndex=f.index+f[0].length}m("border","",true);m("border","-width");m("border","-color");m("border","-style");m("padding","");m("margin","");y("border","border-width","border-style","border-color");if(o.border==="medium none"){delete o.border}if(o["border-image"]==="none"){delete o["border-image"]}}return o},serialize:function(e,n){function u(n){var i,s,u,a;i=t.styles[n];if(i){for(s=0,u=i.length;s0){r+=(r.length>0?" ":"")+n+": "+a+";"}}}}var r="",i,s;if(n&&t&&t.styles){u("*");u(n)}else{for(i in e){s=e[i];if(s!==o&&s.length>0){r+=(r.length>0?" ":"")+i+": "+s+";"}}}return r}}}});i("tinymce/dom/TreeWalker",[],function(){return function(e,t){function r(e,n,r,i){var s,o;if(e){if(!i&&e[n]){return e[n]}if(e!=t){s=e[r];if(s){return s}for(o=e.parentNode;o&&o!=t;o=o.parentNode){s=o[r];if(s){return s}}}}}var n=e;this.current=function(){return n};this.next=function(e){n=r(n,"firstChild","nextSibling",e);return n};this.prev=function(e){n=r(n,"lastChild","previousSibling",e);return n}}});i("tinymce/util/Tools",[],function(){function i(e,n){if(!n){return e!==t}if(n=="array"&&r(e)){return true}return typeof e==n}function s(e){var t=[],n,r;for(n=0,r=e.length;n=t.nodeValue.length){n.insertAfter(e,t)}else{i=t.splitText(r);t.parentNode.insertBefore(e,i)}}else{if(t.childNodes.length>0){s=t.childNodes[r]}if(s){t.insertBefore(e,s)}else{if(t.nodeType==3){n.insertAfter(e,t)}else{t.appendChild(e)}}}}function M(e){var t=r.extractContents();r.insertNode(e);e.appendChild(t);r.selectNode(e)}function _(){return d(new t(n),{startContainer:r[c],startOffset:r[l],endContainer:r[h],endOffset:r[p],collapsed:r.collapsed,commonAncestorContainer:r.commonAncestorContainer})}function D(e,t){var n;if(e.nodeType==3){return e}if(t<0){return e}n=e.firstChild;while(n&&t>0){--t;n=n.nextSibling}if(n){return n}return e}function P(){return r[c]==r[h]&&r[l]==r[p]}function H(e,t,r,i){var s,o,u,a,f,l;if(e==r){if(t==i){return 0}if(t0){r.collapse(e)}}else{r.collapse(e)}r.collapsed=P();r.commonAncestorContainer=n.findCommonAncestor(r[c],r[h])}function j(e){var t,n=0,i=0,s,o,u,a,f,l;if(r[c]==r[h]){return F(e)}for(t=r[h],s=t.parentNode;s;t=s,s=s.parentNode){if(s==r[c]){return I(t,e)}++n}for(t=r[c],s=t.parentNode;s;t=s,s=s.parentNode){if(s==r[h]){return q(t,e)}++i}o=i-n;u=r[c];while(o>0){u=u.parentNode;o--}a=r[h];while(o<0){a=a.parentNode;o++}for(f=u.parentNode,l=a.parentNode;f!=l;f=f.parentNode,l=l.parentNode){u=f;a=l}return R(u,a,e)}function F(e){var t,n,s,f,h,d,v,g,y;if(e!=u){t=m()}if(r[l]==r[p]){return t}if(r[c].nodeType==3){n=r[c].nodeValue;s=n.substring(r[l],r[p]);if(e!=o){f=r[c];g=r[l];y=r[p]-r[l];if(g===0&&y>=f.nodeValue.length-1){f.parentNode.removeChild(f)}else{f.deleteData(g,y)}r.collapse(a)}if(e==u){return}if(s.length>0){t.appendChild(i.createTextNode(s))}return t}f=D(r[c],r[l]);h=r[p]-r[l];while(f&&h>0){d=f.nextSibling;v=X(f,e);if(t){t.appendChild(v)}--h;f=d}if(e!=o){r.collapse(a)}return t}function I(e,t){var n,i,s,a,c,h;if(t!=u){n=m()}i=U(e,t);if(n){n.appendChild(i)}s=v(e);a=s-r[l];if(a<=0){if(t!=o){r.setEndBefore(e);r.collapse(f)}return n}i=e.previousSibling;while(a>0){c=i.previousSibling;h=X(i,t);if(n){n.insertBefore(h,n.firstChild)}--a;i=c}if(t!=o){r.setEndBefore(e);r.collapse(f)}return n}function q(e,t){var n,i,s,f,l,c;if(t!=u){n=m()}s=z(e,t);if(n){n.appendChild(s)}i=v(e);++i;f=r[p]-i;s=e.nextSibling;while(s&&f>0){l=s.nextSibling;c=X(s,t);if(n){n.appendChild(c)}--f;s=l}if(t!=o){r.setStartAfter(e);r.collapse(a)}return n}function R(e,t,n){var i,s,f,l,c,h,p,d;if(n!=u){s=m()}i=z(e,n);if(s){s.appendChild(i)}f=e.parentNode;l=v(e);c=v(t);++l;h=c-l;p=e.nextSibling;while(h>0){d=p.nextSibling;i=X(p,n);if(s){s.appendChild(i)}p=d;--h}i=U(t,n);if(s){s.appendChild(i)}if(n!=o){r.setStartAfter(e);r.collapse(a)}return s}function U(e,t){var n=D(r[h],r[p]-1),i,s;var o,l,c,d=n!=r[h];if(n==e){return W(n,d,f,t)}i=n.parentNode;s=W(i,f,f,t);while(i){while(n){o=n.previousSibling;l=W(n,d,f,t);if(t!=u){s.insertBefore(l,s.firstChild)}d=a;n=o}if(i==e){return s}n=i.previousSibling;i=i.parentNode;c=W(i,f,f,t);if(t!=u){c.appendChild(s)}s=c}}function z(e,t){var n=D(r[c],r[l]),i=n!=r[c];var s,o,h,p,d;if(n==e){return W(n,i,a,t)}s=n.parentNode;o=W(s,f,a,t);while(s){while(n){h=n.nextSibling;p=W(n,i,a,t);if(t!=u){o.appendChild(p)}i=a;n=h}if(s==e){return o}n=s.nextSibling;s=s.parentNode;d=W(s,f,a,t);if(t!=u){d.appendChild(o)}o=d}}function W(e,t,i,s){var a,c,h,d,v;if(t){return X(e,s)}if(e.nodeType==3){a=e.nodeValue;if(i){d=r[l];c=a.substring(d);h=a.substring(0,d)}else{d=r[p];c=a.substring(0,d);h=a.substring(d)}if(s!=o){e.nodeValue=h}if(s==u){return}v=n.clone(e,f);v.nodeValue=c;return v}if(s==u){return}return n.clone(e,f)}function X(e,t){if(t!=u){return t==o?n.clone(e,a):e}e.parentNode.removeChild(e)}function V(){return n.create("body",null,A()).outerText}var r=this,i=n.doc,s=0,o=1,u=2,a=true,f=false,l="startOffset",c="startContainer",h="endContainer",p="endOffset",d=e.extend,v=n.nodeIndex;d(r,{startContainer:i,startOffset:0,endContainer:i,endOffset:0,collapsed:a,commonAncestorContainer:i,START_TO_START:0,START_TO_END:1,END_TO_END:2,END_TO_START:3,setStart:g,setEnd:y,setStartBefore:b,setStartAfter:w,setEndBefore:E,setEndAfter:S,collapse:x,selectNode:T,selectNodeContents:N,compareBoundaryPoints:C,deleteContents:k,extractContents:L,cloneContents:A,insertNode:O,surroundContents:M,cloneRange:_,toStringIE:V});return r}t.prototype.toString=function(){return this.toStringIE()};return t});i("tinymce/html/Entities",["tinymce/util/Tools"],function(e){function l(e){var t;t=document.createElement("div");t.innerHTML=e;return t.textContent||t.innerText||e}function c(e,t){var n,i,s,o={};if(e){e=e.split(",");t=t||10;for(n=0;n\"\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,o=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,u=/[<>&\"\']/g,a=/&(#x|#)?([\w]+);/g,f={128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"};r={'"':""","'":"'","<":"<",">":">","&":"&"};i={"<":"<",">":">","&":"&",""":'"',"'":"'"};n=c("50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,"+"5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,"+"5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,"+"5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,"+"68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,"+"6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,"+"6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,"+"75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,"+"7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,"+"7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,"+"sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,"+"st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,"+"t9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,"+"tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,"+"u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,"+"81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,"+"8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,"+"8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,"+"8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,"+"8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,"+"nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,"+"rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,"+"Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,"+"80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,"+"811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro",32);var h={encodeRaw:function(e,t){return e.replace(t?s:o,function(e){return r[e]||e})},encodeAllRaw:function(e){return(""+e).replace(u,function(e){return r[e]||e})},encodeNumeric:function(e,t){return e.replace(t?s:o,function(e){if(e.length>1){return"&#"+((e.charCodeAt(0)-55296)*1024+(e.charCodeAt(1)-56320)+65536)+";"}return r[e]||"&#"+e.charCodeAt(0)+";"})},encodeNamed:function(e,t,i){i=i||n;return e.replace(t?s:o,function(e){return r[e]||i[e]||e})},getEncodeFunc:function(e,i){function u(e,t){return e.replace(t?s:o,function(e){return r[e]||i[e]||"&#"+e.charCodeAt(0)+";"||e})}function a(e,t){return h.encodeNamed(e,t,i)}i=c(i)||n;e=t(e.replace(/\+/g,","));if(e.named&&e.numeric){return u}if(e.named){if(i){return a}return h.encodeNamed}if(e.numeric){return h.encodeNumeric}return h.encodeRaw},decode:function(e){return e.replace(a,function(e,t,r){if(t){r=parseInt(r,t.length===2?16:10);if(r>65535){r-=65536;return String.fromCharCode(55296+(r>>10),56320+(r&1023))}else{return f[r]||String.fromCharCode(r)}}return i[e]||n[e]||l(e)})}};return h});i("tinymce/Env",[],function(){var e=navigator,t=e.userAgent;var n,r,i,s,o,u,a;n=window.opera&&window.opera.buildNumber;r=/WebKit/.test(t);i=!r&&!n&&/MSIE/gi.test(t)&&/Explorer/gi.test(e.appName);i=i&&/MSIE (\w+)\./.exec(t)[1];s=t.indexOf("Trident/")!=-1&&(t.indexOf("rv:")!=-1||e.appName.indexOf("Netscape")!=-1)?11:false;i=i||s;o=!r&&!s&&/Gecko/.test(t);u=t.indexOf("Mac")!=-1;a=/(iPad|iPhone)/.test(t);var f=!a||t.match(/AppleWebKit\/(\d*)/)[1]>=534;return{opera:n,webkit:r,ie:i,gecko:o,mac:u,iOS:a,contentEditable:f,transparentSrc:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",caretAfter:i!=8,range:window.getSelection&&"Range"in window,documentMode:i?document.documentMode||7:10}});i("tinymce/dom/StyleSheetLoader",[],function(){"use strict";return function(e,t){function s(t){e.getElementsByTagName("head")[0].appendChild(t)}function o(t,o,u){function h(){var e=c.passed,t=e.length;while(t--){e[t]()}c.status=2;c.passed=[];c.failed=[]}function p(){var e=c.failed,t=e.length;while(t--){e[t]()}c.status=3;c.passed=[];c.failed=[]}function d(){var e=navigator.userAgent.match(/WebKit\/(\d*)/);return!!(e&&e[1]<536)}function v(e,t){if(!e()){if((new Date).getTime()-l0){f=e.createElement("style");f.textContent='@import "'+t+'"';g();s(f);return}else{m()}}s(a);a.href=t}var n=0,r={},i;t=t||{};i=t.maxLoadTime||5e3;this.load=o}});i("tinymce/dom/DOMUtils",["tinymce/dom/Sizzle","tinymce/html/Styles","tinymce/dom/EventUtils","tinymce/dom/TreeWalker","tinymce/dom/Range","tinymce/html/Entities","tinymce/Env","tinymce/util/Tools","tinymce/dom/StyleSheetLoader"],function(e,n,r,i,s,o,u,a,f){function w(e,t){var i=this,s;i.doc=e;i.win=window;i.files={};i.counter=0;i.stdMode=!m||e.documentMode>=8;i.boxModel=!m||e.compatMode=="CSS1Compat"||i.stdMode;i.hasOuterHTML="outerHTML"in e.createElement("a");i.styleSheetLoader=new f(e);this.boundEvents=[];i.settings=t=d({keep_values:false,hex_colors:1},t);i.schema=t.schema;i.styles=new n({url_converter:t.url_converter,url_converter_scope:t.url_converter_scope},t.schema);i.fixDoc(e);i.events=t.ownEvents?new r(t.proxy):r.Event;s=t.schema?t.schema.getBlockElements():{};i.isBlock=function(e){if(!e){return false}var t=e.nodeType;if(t){return!!(t===1&&s[e.nodeName])}return!!s[e]}}var l=a.each,c=a.is,h=a.grep,p=a.trim,d=a.extend;var v=u.webkit,m=u.ie;var g=/^([a-z0-9],?)+$/i;var y=/^[ \t\r\n]*$/;var b=a.makeMap("fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom"," ");w.prototype={root:null,props:{"for":"htmlFor","class":"className",className:"className",checked:"checked",disabled:"disabled",maxlength:"maxLength",readonly:"readOnly",selected:"selected",value:"value",id:"id",name:"name",type:"type"},fixDoc:function(e){var t=this.settings,n;if(m&&t.schema){("abbr article aside audio canvas "+"details figcaption figure footer "+"header hgroup mark menu meter nav "+"output progress section summary "+"time video").replace(/\w+/g,function(t){e.createElement(t)});for(n in t.schema.getCustomElements()){e.createElement(n)}}},clone:function(e,t){var n=this,r,i;if(!m||e.nodeType!==1||t){return e.cloneNode(t)}i=n.doc;if(!t){r=i.createElement(e.nodeName);l(n.getAttribs(e),function(t){n.setAttrib(r,t.nodeName,n.getAttrib(e,t.nodeName))});return r}return r.firstChild},getRoot:function(){var e=this;return e.get(e.settings.root_element)||e.doc.body},getViewPort:function(e){var t,n;e=!e?this.win:e;t=e.document;n=this.boxModel?t.documentElement:t.body;return{x:e.pageXOffset||n.scrollLeft,y:e.pageYOffset||n.scrollTop,w:e.innerWidth||n.clientWidth,h:e.innerHeight||n.clientHeight}},getRect:function(e){var t=this,n,r;e=t.get(e);n=t.getPos(e);r=t.getSize(e);return{x:n.x,y:n.y,w:r.w,h:r.h}},getSize:function(e){var t=this,n,r;e=t.get(e);n=t.getStyle(e,"width");r=t.getStyle(e,"height");if(n.indexOf("px")===-1){n=0}if(r.indexOf("px")===-1){r=0}return{w:parseInt(n,10)||e.offsetWidth||e.clientWidth,h:parseInt(r,10)||e.offsetHeight||e.clientHeight}},getParent:function(e,t,n){return this.getParents(e,t,n,false)},getParents:function(e,n,r,i){var s=this,o,u=[];e=s.get(e);i=i===t;r=r||(s.getRoot().nodeName!="BODY"?s.getRoot().parentNode:null);if(c(n,"string")){o=n;if(n==="*"){n=function(e){return e.nodeType==1}}else{n=function(e){return s.is(e,o)}}}while(e){if(e==r||!e.nodeType||e.nodeType===9){break}if(!n||n(e)){if(i){u.push(e)}else{return e}}e=e.parentNode}return i?u:null},get:function(e){var t;if(e&&this.doc&&typeof e=="string"){t=e;e=this.doc.getElementById(e);if(e&&e.id!==t){return this.doc.getElementsByName(t)[1]}}return e},getNext:function(e,t){return this._findSib(e,t,"nextSibling")},getPrev:function(e,t){return this._findSib(e,t,"previousSibling")},select:function(t,n){var r=this;return e(t,r.get(n)||r.get(r.settings.root_element)||r.doc,[])},is:function(n,r){var i;if(n.length===t){if(r==="*"){return n.nodeType==1}if(g.test(r)){r=r.toLowerCase().split(/,/);n=n.nodeName.toLowerCase();for(i=r.length-1;i>=0;i--){if(r[i]==n){return true}}return false}}if(n.nodeType&&n.nodeType!=1){return false}return e.matches(r,n.nodeType?[n]:n).length>0},add:function(e,t,n,r,i){var s=this;return this.run(e,function(e){var o;o=c(t,"string")?s.doc.createElement(t):t;s.setAttribs(o,n);if(r){if(r.nodeType){o.appendChild(r)}else{s.setHTML(o,r)}}return!i?e.appendChild(o):o})},create:function(e,t,n){return this.add(this.doc.createElement(e),e,t,n,1)},createHTML:function(e,t,n){var r="",i;r+="<"+e;for(i in t){if(t.hasOwnProperty(i)&&t[i]!==null){r+=" "+i+'="'+this.encode(t[i])+'"'}}if(typeof n!="undefined"){return r+">"+n+""}return r+" />"},createFragment:function(e){var t,n,r=this.doc,i;i=r.createElement("div");t=r.createDocumentFragment();if(e){i.innerHTML=e}while(n=i.firstChild){t.appendChild(n)}return t},remove:function(e,t){return this.run(e,function(e){var n,r=e.parentNode;if(!r){return null}if(t){while(n=e.firstChild){if(!m||n.nodeType!==3||n.nodeValue){r.insertBefore(n,e)}else{e.removeChild(n)}}}return r.removeChild(e)})},setStyle:function(e,t,n){return this.run(e,function(e){var r=this,i,s;if(t){if(typeof t==="string"){i=e.style;t=t.replace(/-(\D)/g,function(e,t){return t.toUpperCase()});if(typeof n==="number"&&!b[t]){n+="px"}if(t==="opacity"&&e.runtimeStyle&&typeof e.runtimeStyle.opacity==="undefined"){i.filter=n===""?"":"alpha(opacity="+n*100+")"}if(t=="float"){t="cssFloat"in e.style?"cssFloat":"styleFloat"}try{i[t]=n}catch(o){}if(r.settings.update_styles){e.removeAttribute("data-mce-style")}}else{for(s in t){r.setStyle(e,s,t[s])}}}})},getStyle:function(e,n,r){e=this.get(e);if(!e){return}if(this.doc.defaultView&&r){n=n.replace(/[A-Z]/g,function(e){return"-"+e});try{return this.doc.defaultView.getComputedStyle(e,null).getPropertyValue(n)}catch(i){return null}}n=n.replace(/-(\D)/g,function(e,t){return t.toUpperCase()});if(n=="float"){n=m?"styleFloat":"cssFloat"}if(e.currentStyle&&r){return e.currentStyle[n]}return e.style?e.style[n]:t},setStyles:function(e,t){this.setStyle(e,t)},css:function(e,t,n){this.setStyle(e,t,n)},removeAllAttribs:function(e){return this.run(e,function(e){var t,n=e.attributes;for(t=n.length-1;t>=0;t--){e.removeAttributeNode(n.item(t))}})},setAttrib:function(e,t,n){var r=this;if(!e||!t){return}return this.run(e,function(e){var i=r.settings;var s=e.getAttribute(t);if(n!==null){switch(t){case"style":if(!c(n,"string")){l(n,function(t,n){r.setStyle(e,n,t)});return}if(i.keep_values){if(n){e.setAttribute("data-mce-style",n,2)}else{e.removeAttribute("data-mce-style",2)}}e.style.cssText=n;break;case"class":e.className=n||"";break;case"src":case"href":if(i.keep_values){if(i.url_converter){n=i.url_converter.call(i.url_converter_scope||r,n,t,e)}r.setAttrib(e,"data-mce-"+t,n,2)}break;case"shape":e.setAttribute("data-mce-style",n);break}}if(c(n)&&n!==null&&n.length!==0){e.setAttribute(t,""+n,2)}else{e.removeAttribute(t,2)}if(s!=n&&i.onSetAttrib){i.onSetAttrib({attrElm:e,attrName:t,attrValue:n})}})},setAttribs:function(e,t){var n=this;return this.run(e,function(e){l(t,function(t,r){n.setAttrib(e,r,t)})})},getAttrib:function(e,t,n){var r,i=this,s;e=i.get(e);if(!e||e.nodeType!==1){return n===s?false:n}if(!c(n)){n=""}if(/^(src|href|style|coords|shape)$/.test(t)){r=e.getAttribute("data-mce-"+t);if(r){return r}}if(m&&i.props[t]){r=e[i.props[t]];r=r&&r.nodeValue?r.nodeValue:r}if(!r){r=e.getAttribute(t,2)}if(/^(checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)$/.test(t)){if(e[i.props[t]]===true&&r===""){return t}return r?t:""}if(e.nodeName==="FORM"&&e.getAttributeNode(t)){return e.getAttributeNode(t).nodeValue}if(t==="style"){r=r||e.style.cssText;if(r){r=i.serializeStyle(i.parseStyle(r),e.nodeName);if(i.settings.keep_values){e.setAttribute("data-mce-style",r)}}}if(v&&t==="class"&&r){r=r.replace(/(apple|webkit)\-[a-z\-]+/gi,"")}if(m){switch(t){case"rowspan":case"colspan":if(r===1){r=""}break;case"size":if(r==="+0"||r===20||r===0){r=""}break;case"width":case"height":case"vspace":case"checked":case"disabled":case"readonly":if(r===0){r=""}break;case"hspace":if(r===-1){r=""}break;case"maxlength":case"tabindex":if(r===32768||r===2147483647||r==="32768"){r=""}break;case"multiple":case"compact":case"noshade":case"nowrap":if(r===65535){return t}return n;case"shape":r=r.toLowerCase();break;default:if(t.indexOf("on")===0&&r){r=(""+r).replace(/^function\s+\w+\(\)\s+\{\s+(.*)\s+\}$/,"$1")}}}return r!==s&&r!==null&&r!==""?""+r:n},getPos:function(e,t){var n=this,r=0,i=0,s,o=n.doc,u;e=n.get(e);t=t||o.body;if(e){if(t===o.body&&e.getBoundingClientRect){u=e.getBoundingClientRect();t=n.boxModel?o.documentElement:o.body;r=u.left+(o.documentElement.scrollLeft||o.body.scrollLeft)-t.clientLeft;i=u.top+(o.documentElement.scrollTop||o.body.scrollTop)-t.clientTop;return{x:r,y:i}}s=e;while(s&&s!=t&&s.nodeType){r+=s.offsetLeft||0;i+=s.offsetTop||0;s=s.offsetParent}s=e.parentNode;while(s&&s!=t&&s.nodeType){r-=s.scrollLeft||0;i-=s.scrollTop||0;s=s.parentNode}}return{x:r,y:i}},parseStyle:function(e){return this.styles.parse(e)},serializeStyle:function(e,t){return this.styles.serialize(e,t)},addStyle:function(e){var t=this,n=t.doc,r,i;if(t!==w.DOM&&n===document){var s=w.DOM.addedStyles;s=s||[];if(s[e]){return}s[e]=true;w.DOM.addedStyles=s}i=n.getElementById("mceDefaultStyles");if(!i){i=n.createElement("style");i.id="mceDefaultStyles";i.type="text/css";r=n.getElementsByTagName("head")[0];if(r.firstChild){r.insertBefore(i,r.firstChild)}else{r.appendChild(i)}}if(i.styleSheet){i.styleSheet.cssText+=e}else{i.appendChild(n.createTextNode(e))}},loadCSS:function(e){var t=this,n=t.doc,r;if(t!==w.DOM&&n===document){w.DOM.loadCSS(e);return}if(!e){e=""}r=n.getElementsByTagName("head")[0];l(e.split(","),function(e){var i;if(t.files[e]){return}t.files[e]=true;i=t.create("link",{rel:"stylesheet",href:e});if(m&&n.documentMode&&n.recalc){i.onload=function(){if(n.recalc){n.recalc()}i.onload=null}}r.appendChild(i)})},addClass:function(e,t){return this.run(e,function(e){var n;if(!t){return 0}if(this.hasClass(e,t)){return e.className}n=this.removeClass(e,t);e.className=n=(n!==""?n+" ":"")+t;return n})},removeClass:function(e,t){var n=this,r;return n.run(e,function(e){var i;if(n.hasClass(e,t)){if(!r){r=new RegExp("(^|\\s+)"+t+"(\\s+|$)","g")}i=e.className.replace(r," ");i=p(i!=" "?i:"");e.className=i;if(!i){e.removeAttribute("class");e.removeAttribute("className")}return i}return e.className})},hasClass:function(e,t){e=this.get(e);if(!e||!t){return false}return(" "+e.className+" ").indexOf(" "+t+" ")!==-1},toggleClass:function(e,n,r){r=r===t?!this.hasClass(e,n):r;if(this.hasClass(e,n)!==r){if(r){this.addClass(e,n)}else{this.removeClass(e,n)}}},show:function(e){return this.setStyle(e,"display","block")},hide:function(e){return this.setStyle(e,"display","none")},isHidden:function(e){e=this.get(e);return!e||e.style.display=="none"||this.getStyle(e,"display")=="none"},uniqueId:function(e){return(!e?"mce_":e)+this.counter++},setHTML:function(e,t){var n=this;return n.run(e,function(e){if(m){while(e.firstChild){e.removeChild(e.firstChild)}try{e.innerHTML="
"+t;e.removeChild(e.firstChild)}catch(r){var i=n.create("div");i.innerHTML="
"+t;l(h(i.childNodes),function(t,n){if(n&&e.canHaveHTML){e.appendChild(t)}})}}else{e.innerHTML=t}return t})},getOuterHTML:function(e){var t,n=this;e=n.get(e);if(!e){return null}if(e.nodeType===1&&n.hasOuterHTML){return e.outerHTML}t=(e.ownerDocument||n.doc).createElement("body");t.appendChild(e.cloneNode(true));return t.innerHTML},setOuterHTML:function(e,t,n){var r=this;return r.run(e,function(e){function i(){var i,s;s=n.createElement("body");s.innerHTML=t;i=s.lastChild;while(i){r.insertAfter(i.cloneNode(true),e);i=i.previousSibling}r.remove(e)}if(e.nodeType==1){n=n||e.ownerDocument||r.doc;if(m){try{if(e.nodeType==1&&r.hasOuterHTML){e.outerHTML=t}else{i()}}catch(s){i()}}else{i()}}})},decode:o.decode,encode:o.encodeAllRaw,insertAfter:function(e,t){t=this.get(t);return this.run(e,function(e){var n,r;n=t.parentNode;r=t.nextSibling;if(r){n.insertBefore(e,r)}else{n.appendChild(e)}return e})},replace:function(e,t,n){var r=this;return r.run(t,function(t){if(c(t,"array")){e=e.cloneNode(true)}if(n){l(h(t.childNodes),function(t){e.appendChild(t)})}return t.parentNode.replaceChild(e,t)})},rename:function(e,t){var n=this,r;if(e.nodeName!=t.toUpperCase()){r=n.create(t);l(n.getAttribs(e),function(t){n.setAttrib(r,t.nodeName,n.getAttrib(e,t.nodeName))});n.replace(r,e,1)}return r||e},findCommonAncestor:function(e,t){var n=e,r;while(n){r=t;while(r&&n!=r){r=r.parentNode}if(n==r){break}n=n.parentNode}if(!n&&e.ownerDocument){return e.ownerDocument.documentElement}return n},toHex:function(e){return this.styles.toHex(a.trim(e))},run:function(e,t,n){var r=this,i;if(typeof e==="string"){e=r.get(e)}if(!e){return false}n=n||this;if(!e.nodeType&&(e.length||e.length===0)){i=[];l(e,function(e,s){if(e){if(typeof e=="string"){e=r.get(e)}i.push(t.call(n,e,s))}});return i}return t.call(n,e)},getAttribs:function(e){var t;e=this.get(e);if(!e){return[]}if(m){t=[];if(e.nodeName=="OBJECT"){return e.attributes}if(e.nodeName==="OPTION"&&this.getAttrib(e,"selected")){t.push({specified:1,nodeName:"selected"})}var n=/<\/?[\w:\-]+ ?|=[\"][^\"]+\"|=\'[^\']+\'|=[\w\-]+|>/gi;e.cloneNode(false).outerHTML.replace(n,"").replace(/[\w:\-]+/gi,function(e){t.push({specified:1,nodeName:e})});return t}return e.attributes},isEmpty:function(e,t){var n=this,r,s,o,u,a,f=0;e=e.firstChild;if(e){u=new i(e,e.parentNode);t=t||n.schema?n.schema.getNonEmptyElements():null;do{o=e.nodeType;if(o===1){if(e.getAttribute("data-mce-bogus")){continue}a=e.nodeName.toLowerCase();if(t&&t[a]){if(a==="br"){f++;continue}return false}s=n.getAttribs(e);r=e.attributes.length;while(r--){a=e.attributes[r].nodeName;if(a==="name"||a==="data-mce-bookmark"){return false}}}if(o==8){return false}if(o===3&&!y.test(e.nodeValue)){return false}}while(e=u.next())}return f<=1},createRng:function(){var e=this.doc;return e.createRange?e.createRange():new s(this)},nodeIndex:function(e,t){var n=0,r,i,s;if(e){for(r=e.nodeType,e=e.previousSibling,i=e;e;e=e.previousSibling){s=e.nodeType;if(t&&s==3){if(s==r||!e.nodeValue.length){continue}}n++;r=s}}return n},split:function(e,t,n){function a(e){function s(e){var t=e.previousSibling&&e.previousSibling.nodeName=="SPAN";var n=e.nextSibling&&e.nextSibling.nodeName=="SPAN";return t&&n}var t,n=e.childNodes,i=e.nodeType;if(i==1&&e.getAttribute("data-mce-type")=="bookmark"){return}for(t=n.length-1;t>=0;t--){a(n[t])}if(i!=9){if(i==3&&e.nodeValue.length>0){var o=p(e.nodeValue).length;if(!r.isBlock(e.parentNode)||o>0||o===0&&s(e)){return}}else if(i==1){n=e.childNodes;if(n.length==1&&n[0]&&n[0].nodeType==1&&n[0].getAttribute("data-mce-type")=="bookmark"){e.parentNode.insertBefore(n[0],e)}if(n.length||/^(br|hr|input|img)$/i.test(e.nodeName)){return}}r.remove(e)}return e}var r=this,i=r.createRng(),s,o,u;if(e&&t){i.setStart(e.parentNode,r.nodeIndex(e));i.setEnd(t.parentNode,r.nodeIndex(t));s=i.extractContents();i=r.createRng();i.setStart(t.parentNode,r.nodeIndex(t)+1);i.setEnd(e.parentNode,r.nodeIndex(e)+1);o=i.extractContents();u=e.parentNode;u.insertBefore(a(s),e);if(n){u.replaceChild(n,t)}else{u.insertBefore(t,e)}u.insertBefore(a(o),e);r.remove(e);return n||t}},bind:function(e,t,n,r){var i=this;if(a.isArray(e)){var s=e.length;while(s--){e[s]=i.bind(e[s],t,n,r)}return e}if(i.settings.collect&&(e===i.doc||e===i.win)){i.boundEvents.push([e,t,n,r])}return i.events.bind(e,t,n,r||i)},unbind:function(e,t,n){var r=this,i;if(a.isArray(e)){i=e.length;while(i--){e[i]=r.unbind(e[i],t,n)}return e}if(r.boundEvents&&(e===r.doc||e===r.win)){i=r.boundEvents.length;while(i--){var s=r.boundEvents[i];if(e==s[0]&&(!t||t==s[1])&&(!n||n==s[2])){this.events.unbind(s[0],s[1],s[2])}}}return this.events.unbind(e,t,n)},fire:function(e,t,n){return this.events.fire(e,t,n)},getContentEditable:function(e){var t;if(e.nodeType!=1){return null}t=e.getAttribute("data-mce-contenteditable");if(t&&t!=="inherit"){return t}return e.contentEditable!=="inherit"?e.contentEditable:null},destroy:function(){var t=this;if(t.boundEvents){var n=t.boundEvents.length;while(n--){var r=t.boundEvents[n];this.events.unbind(r[0],r[1],r[2])}t.boundEvents=null}if(e.setDocument){e.setDocument()}t.win=t.doc=t.root=t.events=t.frag=null},dumpRng:function(e){return"startContainer: "+e.startContainer.nodeName+", startOffset: "+e.startOffset+", endContainer: "+e.endContainer.nodeName+", endOffset: "+e.endOffset},_findSib:function(e,t,n){var r=this,i=t;if(e){if(typeof i=="string"){i=function(e){return r.is(e,t)}}for(e=e[n];e;e=e[n]){if(i(e)){return e}}}return null}};w.DOM=new w(document);return w});i("tinymce/dom/ScriptLoader",["tinymce/dom/DOMUtils","tinymce/util/Tools"],function(e,t){function s(){function h(e,t){function o(){r.remove(s);if(i){i.onreadystatechange=i.onload=i=null}t()}function u(){if(typeof console!=="undefined"&&console.log){console.log("Failed to load: "+e)}}var r=n,i,s;s=r.uniqueId();i=document.createElement("script");i.id=s;i.type="text/javascript";i.src=e;if("onreadystatechange"in i){i.onreadystatechange=function(){if(/loaded|complete/.test(i.readyState)){o()}}}else{i.onload=o}i.onerror=u;(document.getElementsByTagName("head")[0]||document.body).appendChild(i)}var e=0,t=1,s=2,o={},u=[],a={},f=[],l=0,c;this.isDone=function(e){return o[e]==s};this.markDone=function(e){o[e]=s};this.add=this.load=function(t,n,r){var i=o[t];if(i==c){u.push(t);o[t]=e}if(n){if(!a[t]){a[t]=[]}a[t].push({func:n,scope:r||this})}};this.loadQueue=function(e,t){this.loadScripts(u,e,t)};this.loadScripts=function(e,n,u){function d(e){r(a[e],function(e){e.func.call(e.scope)});a[e]=c}var p;f.push({func:n,scope:u||this});p=function(){var n=i(e);e.length=0;r(n,function(e){if(o[e]==s){d(e);return}if(o[e]!=t){o[e]=t;l++;h(e,function(){o[e]=s;l--;d(e);p()})}});if(!l){r(f,function(e){e.func.call(e.scope)});f.length=0}};p()}}var n=e.DOM;var r=t.each,i=t.grep;s.ScriptLoader=new s;return s});i("tinymce/AddOnManager",["tinymce/dom/ScriptLoader","tinymce/util/Tools"],function(e,n){function i(){var e=this;e.items=[];e.urls={};e.lookup={}}var r=n.each;i.prototype={get:function(e){if(this.lookup[e]){return this.lookup[e].instance}else{return t}},dependencies:function(e){var t;if(this.lookup[e]){t=this.lookup[e].dependencies}return t||[]},requireLangPack:function(t,n){if(i.language&&i.languageLoad!==false){if(n&&(new RegExp("([, ]|\\b)"+i.language+"([, ]|\\b)")).test(n)===false){return}e.ScriptLoader.add(this.urls[t]+"/langs/"+i.language+".js")}},add:function(e,t,n){this.items.push(t);this.lookup[e]={instance:t,dependencies:n};return t},createUrl:function(e,t){if(typeof t==="object"){return t}else{return{prefix:e.prefix,resource:t,suffix:e.suffix}}},addComponents:function(t,n){var i=this.urls[t];r(n,function(t){e.ScriptLoader.add(i+"/"+t)})},load:function(n,s,o,u){function l(){var i=a.dependencies(n);r(i,function(e){var n=a.createUrl(s,e);a.load(n.resource,n,t,t)});if(o){if(u){o.call(u)}else{o.call(e)}}}var a=this,f=s;if(a.urls[n]){return}if(typeof s==="object"){f=s.prefix+s.resource+s.suffix}if(f.indexOf("/")!==0&&f.indexOf("://")==-1){f=i.baseURL+"/"+f}a.urls[n]=f.substring(0,f.lastIndexOf("/"));if(a.lookup[n]){l()}else{e.ScriptLoader.add(f,l,u)}}};i.PluginManager=new i;i.ThemeManager=new i;return i});i("tinymce/html/Node",[],function(){function n(e,t,n){var r,i,s=n?"lastChild":"firstChild",o=n?"prev":"next";if(e[s]){return e[s]}if(e!==t){r=e[o];if(r){return r}for(i=e.parent;i&&i!==t;i=i.parent){r=i[o];if(r){return r}}}}function r(e,t){this.name=e;this.type=t;if(t===1){this.attributes=[];this.attributes.map={}}}var e=/^[ \t\r\n]*$/,t={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11};r.prototype={replace:function(e){var t=this;if(e.parent){e.remove()}t.insert(e,t);t.remove();return t},attr:function(e,t){var n=this,r,i,s;if(typeof e!=="string"){for(i in e){n.attr(i,e[i])}return n}if(r=n.attributes){if(t!==s){if(t===null){if(e in r.map){delete r.map[e];i=r.length;while(i--){if(r[i].name===e){r=r.splice(i,1);return n}}}return n}if(e in r.map){i=r.length;while(i--){if(r[i].name===e){r[i].value=t;break}}}else{r.push({name:e,value:t})}r.map[e]=t;return n}else{return r.map[e]}}},clone:function(){var e=this,t=new r(e.name,e.type),n,i,s,o,u;if(s=e.attributes){u=[];u.map={};for(n=0,i=s.length;n]*>","gi")});if(!e.valid_elements){r(d,function(e,t){l[t]={attributes:e.attributes,attributesOrder:e.attributesOrder};c[t]=e.children});if(e.schema!="html5"){r(u("strong/b em/i"),function(e){e=u(e,"/");l[e[1]].outputName=e[0]})}l.img.attributesDefault=[{name:"alt",value:""}];r(u("ol ul sub sup blockquote span font a table tbody tr strong em b i"),function(e){if(l[e]){l[e].removeEmpty=true}});r(u("p h1 h2 h3 h4 h5 h6 th td pre div address caption"),function(e){l[e].paddEmpty=true});r(u("span"),function(e){l[e].removeEmptyAttrs=true})}else{k(e.valid_elements)}L(e.custom_elements);A(e.valid_children);C(e.extended_valid_elements);A("+ol[ul|ol],+ul[ul|ol]");if(e.invalid_elements){r(s(e.invalid_elements),function(e){if(l[e]){delete l[e]}})}if(!O("span")){C("span[!data-mce-type|*]")}f.children=c;f.styles=p;f.getBoolAttrs=function(){return y};f.getBlockElements=function(){return b};f.getTextBlockElements=function(){return E};f.getShortEndedElements=function(){return g};f.getSelfClosingElements=function(){return m};f.getNonEmptyElements=function(){return w};f.getWhiteSpaceElements=function(){return v};f.getSpecialElements=function(){return x};f.isValidChild=function(e,t){var n=c[e];return!!(n&&n[t])};f.isValid=function(e,t){var n,r,i=O(e);if(i){if(t){if(i.attributes[t]){return true}n=i.attributePatterns;if(n){r=n.length;while(r--){if(n[r].pattern.test(e)){return true}}}}else{return true}}return false};f.getElementRule=O;f.getCustomElements=function(){return S};f.addValidElements=C;f.setValidElements=k;f.addCustomElements=L;f.addValidChildren=A;f.elements=l}});i("tinymce/html/SaxParser",["tinymce/html/Schema","tinymce/html/Entities","tinymce/util/Tools"],function(e,t,n){var r=n.each;return function(i,s){var o=this,u=function(){};i=i||{};o.schema=s=s||new e;if(i.fix_self_closing!==false){i.fix_self_closing=true}r("comment cdata text start end pi doctype".split(" "),function(e){if(e){o[e]=i[e]||u}});o.parse=function(e){function R(e){var t,n;t=l.length;while(t--){if(l[t].name===e){break}}if(t>=0){for(n=l.length-1;n>=t;n--){e=l[n];if(e.valid){r.end(e.name)}}l.length=t}}function U(e,t,n,r,s){var o,u,a=/[\s\u0000-\u001F]+/g;t=t.toLowerCase();n=t in y?t:j(n||r||s||"");if(w&&!v&&t.indexOf("data-")!==0){o=N[t];if(!o&&C){u=C.length;while(u--){o=C[u];if(o.pattern.test(t)){break}}if(u===-1){o=null}}if(!o){return}if(o.validValues&&!(n in o.validValues)){return}}if(I[t]&&!i.allow_script_urls){var f=n.replace(a,"");try{f=decodeURIComponent(f);if(q.test(f)){return}}catch(l){f=unescape(f);if(q.test(f)){return}}}c.map[t]=n;c.push({name:t,value:n})}var r=this,o,u=0,a,f,l=[],c,h,p,d;var v,m,g,y,b;var w,E,S,x,T,N,C;var k,L,A;var O,M,_,D,P,H,B=0;var j=t.decode,F,I=n.makeMap("src,href");var q=/(java|vb)script:/i;_=new RegExp("<(?:"+"(?:!--([\\w\\W]*?)-->)|"+"(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|"+"(?:!DOCTYPE([\\w\\W]*?)>)|"+"(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|"+"(?:\\/([^>]+)>)|"+"(?:([A-Za-z0-9\\-\\:\\.]+)((?:\\s+[^\"'>]+(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>]*))*|\\/|\\s+)>)"+")","g");D=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g;g=s.getShortEndedElements();M=i.self_closing_elements||s.getSelfClosingElements();y=s.getBoolAttrs();w=i.validate;m=i.remove_internals;F=i.fix_self_closing;P=s.getSpecialElements();while(o=_.exec(e)){if(u0&&l[l.length-1].name===a){R(a)}if(!w||(E=s.getElementRule(a))){S=true;if(w){N=E.attributes;C=E.attributePatterns}if(T=o[8]){v=T.indexOf("data-mce-type")!==-1;if(v&&m){S=false}c=[];c.map={};T.replace(D,U)}else{c=[];c.map={}}if(w&&!v){k=E.attributesRequired;L=E.attributesDefault;A=E.attributesForced;O=E.removeEmptyAttrs;if(O&&!c.length){S=false}if(A){h=A.length;while(h--){x=A[h];d=x.name;H=x.value;if(H==="{$uid}"){H="mce_"+B++}c.map[d]=H;c.push({name:d,value:H})}}if(L){h=L.length;while(h--){x=L[h];d=x.name;if(!(d in c.map)){H=x.value;if(H==="{$uid}"){H="mce_"+B++}c.map[d]=H;c.push({name:d,value:H})}}}if(k){h=k.length;while(h--){if(k[h]in c.map){break}}if(h===-1){S=false}}if(c.map["data-mce-bogus"]){S=false}}if(S){r.start(a,c,b)}}else{S=false}if(f=P[a]){f.lastIndex=u=o.index+o[0].length;if(o=f.exec(e)){if(S){p=e.substr(u,o.index-u)}u=o.index+o[0].length}else{p=e.substr(u);u=e.length}if(S){if(p.length>0){r.text(p,true)}r.end(a)}_.lastIndex=u;continue}if(!b){if(!T||T.indexOf("/")!=T.length-1){l.push({name:a,valid:S})}else if(S){r.end(a)}}}else if(a=o[1]){if(a.charAt(0)===">"){a=" "+a}if(!i.allow_conditional_comments&&a.substr(0,3)==="[if"){a=" "+a}r.comment(a)}else if(a=o[2]){r.cdata(a)}else if(a=o[3]){r.doctype(a)}else if(a=o[4]){r.pi(a,o[5])}u=o.index+o[0].length}if(u=0;h--){a=l[h];if(a.valid){r.end(a.name)}}}}});i("tinymce/html/DomParser",["tinymce/html/Node","tinymce/html/Schema","tinymce/html/SaxParser","tinymce/util/Tools"],function(e,t,n,r){var i=r.makeMap,s=r.each,o=r.explode,u=r.extend;return function(r,a){function d(t){var n,r,s,o,u,l,c,h,p;var d,v,m,g,y;v=i("tr,td,th,tbody,thead,tfoot,table");d=a.getNonEmptyElements();m=a.getTextBlockElements();for(n=0;n1){o.reverse();u=l=f.filterNode(o[0].clone());for(p=0;p0){t.value=n;t=t.prev}else{r=t.prev;t.remove();t=r}}}function F(e){var t,n={};for(t in e){if(t!=="li"&&t!="p"){n[t]=e[t]}}return n}var o,f,v,m,g,y,b,w,E,S,x;var T,N,C=[],k;var L,A,O,M;var _,D,P;s=s||{};h={};p={};T=u(i("script,style,head,html,body,title,meta,param"),a.getBlockElements());D=a.getNonEmptyElements();_=a.children;x=r.validate;P="forced_root_block"in s?s.forced_root_block:r.forced_root_block;M=a.getWhiteSpaceElements();N=/^[ \t\r\n]+/;L=/[ \t\r\n]+$/;A=/[ \t\r\n]+/g;O=/^[ \t\r\n]+$/;o=new n({validate:x,allow_script_urls:r.allow_script_urls,allow_conditional_comments:r.allow_conditional_comments,self_closing_elements:F(a.getSelfClosingElements()),cdata:function(e){v.append(B("#cdata",4)).value=e},text:function(e,t){var n;if(!k){e=e.replace(A," ");if(v.lastChild&&T[v.lastChild.name]){e=e.replace(N,"")}}if(e.length!==0){n=B("#text",3);n.raw=!!t;v.append(n).value=e}},comment:function(e){v.append(B("#comment",8)).value=e},pi:function(e,t){v.append(B(e,7)).value=t;j(v)},doctype:function(e){var t;t=v.append(B("#doctype",10));t.value=e;j(v)},start:function(e,t,n){var r,i,s,o,u;s=x?a.getElementRule(e):{};if(s){r=B(s.outputName||e,1);r.attributes=t;r.shortEnded=n;v.append(r);u=_[v.name];if(u&&_[r.name]&&!u[r.name]){C.push(r)}i=c.length;while(i--){o=c[i].name;if(o in t.map){E=p[o];if(E){E.push(r)}else{p[o]=[r]}}}if(T[e]){j(r)}if(!n){v=r}if(!k&&M[e]){k=true}}},end:function(t){var n,r,i,s,o;r=x?a.getElementRule(t):{};if(r){if(T[t]){if(!k){n=v.firstChild;if(n&&n.type===3){i=n.value.replace(N,"");if(i.length>0){n.value=i;n=n.next}else{s=n.next;n.remove();n=s;while(n&&n.type===3){i=n.value;s=n.next;if(i.length===0||O.test(i)){n.remove();n=s}n=s}}}n=v.lastChild;if(n&&n.type===3){i=n.value.replace(L,"");if(i.length>0){n.value=i;n=n.prev}else{s=n.prev;n.remove();n=s;while(n&&n.type===3){i=n.value;s=n.prev;if(i.length===0||O.test(i)){n.remove();n=s}n=s}}}}}if(k&&M[t]){k=false}if(r.removeEmpty||r.paddEmpty){if(v.isEmpty(D)){if(r.paddEmpty){v.empty().append(new e("#text","3")).value=" "}else{if(!v.attributes.map.name&&!v.attributes.map.id){o=v.parent;v.empty().remove();v=o;return}}}}v=v.parent}}},a);f=v=new e(s.context||r.root_name,11);o.parse(t);if(x&&C.length){if(!s.context){d(C)}else{s.invalid=true}}if(P&&(f.name=="body"||s.isRootContent)){H()}if(!s.invalid){for(S in h){E=l[S];m=h[S];b=m.length;while(b--){if(!m[b].parent){m.splice(b,1)}}for(g=0,y=E.length;g0){h=r[r.length-1];if(h.length>0&&h!=="\n"){r.push("\n")}}r.push("<",e);if(t){for(f=0,l=t.length;f0){h=r[r.length-1];if(h.length>0&&h!=="\n"){r.push("\n")}}},end:function(e){var t;r.push("");if(i&&o[e]&&r.length>0){t=r[r.length-1];if(t.length>0&&t!=="\n"){r.push("\n")}}},text:function(e,t){if(e.length>0){r[r.length]=t?e:u(e)}},cdata:function(e){r.push("")},comment:function(e){r.push("")},pi:function(e,t){if(t){r.push("")}else{r.push("")}if(i){r.push("\n")}},doctype:function(e){r.push("",i?"\n":"")},reset:function(){r.length=0},getContent:function(){return r.join("").replace(/\n$/,"")}}}});i("tinymce/html/Serializer",["tinymce/html/Writer","tinymce/html/Schema"],function(e,t){return function(n,r){var i=this,s=new e(n);n=n||{};n.validate="validate"in n?n.validate:true;i.schema=r=r||new t;i.writer=s;i.serialize=function(e){function o(e){var n=t[e.type],u,a,f,l,c,h,p,d,v;if(!n){u=e.name;a=e.shortEnded;f=e.attributes;if(i&&f&&f.length>1){h=[];h.map={};v=r.getElementRule(e.name);for(p=0,d=v.attributesOrder.length;p0?s:null);i.attr(o,null)}else{s=i.attributes.map[n];if(n==="style"){s=u.serializeStyle(u.parseStyle(s),i.name)}else if(a){s=a.call(f,s,n,i.name)}i.attr(n,s.length>0?s:null)}}});h.addAttributeFilter("class",function(e){var t=e.length,n,r;while(t--){n=e[t];r=n.attr("class").replace(/(?:^|\s)mce-item-\w+(?!\S)/g,"");n.attr("class",r.length>0?r:null)}});h.addAttributeFilter("data-mce-type",function(e,t,n){var r=e.length,i;while(r--){i=e[r];if(i.attributes.map["data-mce-type"]==="bookmark"&&!n.cleanup){i.remove()}}});h.addAttributeFilter("data-mce-expando",function(e,t){var n=e.length;while(n--){e[n].attr(t,null)}});h.addNodeFilter("noscript",function(e){var t=e.length,r;while(t--){r=e[t].firstChild;if(r){r.value=n.decode(r.value)}}});h.addNodeFilter("script,style",function(e,t){function s(e){return e.replace(/()/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*(()?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g,"")}var n=e.length,r,i;while(n--){r=e[n];i=r.firstChild?r.firstChild.value:"";if(t==="script"){var o=(r.attr("type")||"text/javascript").replace(/^mce\-/,"");r.attr("type",o==="text/javascript"?null:o);if(i.length>0){r.firstChild.value="// "}}else{if(i.length>0){r.firstChild.value=""}}}});h.addNodeFilter("#comment",function(e){var t=e.length,n;while(t--){n=e[t];if(n.value.indexOf("[CDATA[")===0){n.name="#cdata";n.type=4;n.value=n.value.replace(/^\[CDATA\[|\]\]$/g,"")}else if(n.value.indexOf("mce:protected ")===0){n.name="#text";n.type=3;n.raw=true;n.value=unescape(n.value).substr(14)}}});h.addNodeFilter("xml:namespace,input",function(e,t){var n=e.length,r;while(n--){r=e[n];if(r.type===7){r.remove()}else if(r.type===1){if(t==="input"&&!("type"in r.attributes.map)){r.attr("type","text")}}}});if(e.fix_list_elements){h.addNodeFilter("ul,ol",function(e){var t=e.length,n,r;while(t--){n=e[t];r=n.parent;if(r.name==="ul"||r.name==="ol"){if(n.prev&&n.prev.name==="li"){n.prev.append(n)}}}})}h.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style,data-mce-selected",function(e,t){var n=e.length;while(n--){e[n].attr(t,null)}});return{schema:c,addNodeFilter:h.addNodeFilter,addAttributeFilter:h.addAttributeFilter,serialize:function(t,n){var i=this,s,l,p,d,v;if(o.ie&&u.select("script,style,select,map").length>0){v=t.innerHTML;t=t.cloneNode(false);u.setHTML(t,v)}else{t=t.cloneNode(true)}s=t.ownerDocument.implementation;if(s.createHTMLDocument){l=s.createHTMLDocument("");a(t.nodeName=="BODY"?t.childNodes:[t],function(e){l.body.appendChild(l.importNode(e,true))});if(t.nodeName!="BODY"){t=l.body.firstChild}else{t=l.body}p=u.doc;u.doc=l}n=n||{};n.format=n.format||"html";if(n.selection){n.forced_root_block=""}if(!n.no_events){n.node=t;i.onPreProcess(n)}d=new r(e,c);n.content=d.serialize(h.parse(f(n.getInner?t.innerHTML:u.getOuterHTML(t)),n));if(!n.cleanup){n.content=n.content.replace(/\uFEFF/g,"")}if(!n.no_events){i.onPostProcess(n)}if(p){u.doc=p}n.node=null;return n.content},addRules:function(e){c.addValidElements(e)},setRules:function(e){c.setValidElements(e)},onPreProcess:function(e){if(i){i.fire("PreProcess",e)}},onPostProcess:function(e){if(i){i.fire("PostProcess",e)}}}}});i("tinymce/dom/TridentSelection",[],function(){function e(e){function i(t,n){var r,i=0,s,o,u,a,f,l,c=-1,h;r=t.duplicate();r.collapse(n);h=r.parentElement();if(h.ownerDocument!==e.dom.doc){return}while(h.contentEditable==="false"){h=h.parentNode}if(!h.hasChildNodes()){return{node:h,inside:1}}u=h.children;s=u.length-1;while(i<=s){l=Math.floor((i+s)/2);a=u[l];r.moveToElementText(a);c=r.compareEndPoints(n?"StartToStart":"EndToEnd",t);if(c>0){s=l-1}else if(c<0){i=l+1}else{return{node:a}}}if(c<0){if(!a){r.moveToElementText(h);r.collapse(true);a=h;o=true}else{r.collapse(false)}f=0;while(r.compareEndPoints(n?"StartToStart":"StartToEnd",t)!==0){if(r.move("character",1)===0||h!=r.parentElement()){break}f++}}else{r.collapse(true);f=0;while(r.compareEndPoints(n?"StartToStart":"StartToEnd",t)!==0){if(r.move("character",-1)===0||h!=r.parentElement()){break}f++}}return{node:a,position:c,offset:f,inside:o}}function s(){function c(e){var t=i(r,e),n,o,u=0,a,f,l;n=t.node;o=t.offset;if(t.inside&&!n.hasChildNodes()){s[e?"setStart":"setEnd"](n,0);return}if(o===f){s[e?"setStartBefore":"setEndAfter"](n);return}if(t.position<0){a=t.inside?n.firstChild:n.nextSibling;if(!a){s[e?"setStartAfter":"setEndAfter"](n);return}if(!o){if(a.nodeType==3){s[e?"setStart":"setEnd"](a,0)}else{s[e?"setStartBefore":"setEndBefore"](a)}return}while(a){l=a.nodeValue;u+=l.length;if(u>=o){n=a;u-=o;u=l.length-u;break}a=a.nextSibling}}else{a=n.previousSibling;if(!a){return s[e?"setStartBefore":"setEndBefore"](n)}if(!o){if(n.nodeType==3){s[e?"setStart":"setEnd"](a,n.nodeValue.length)}else{s[e?"setStartAfter":"setEndAfter"](a)}return}while(a){u+=a.nodeValue.length;if(u>=o){n=a;u-=o;break}a=a.previousSibling}}s[e?"setStart":"setEnd"](n,u)}var r=e.getRng(),s=n.createRng(),o,u,a,f,l;o=r.item?r.item(0):r.parentElement();if(o.ownerDocument!=n.doc){return s}u=e.isCollapsed();if(r.item){s.setStart(o.parentNode,n.nodeIndex(o));s.setEnd(s.startContainer,s.startOffset+1);return s}try{c(true);if(!u){c()}}catch(h){if(h.number==-2147024809){l=t.getBookmark(2);a=r.duplicate();a.collapse(true);o=a.parentElement();if(!u){a=r.duplicate();a.collapse(false);f=a.parentElement();f.innerHTML=f.innerHTML}o.innerHTML=o.innerHTML;t.moveToBookmark(l);r=e.getRng();c(true);if(!u){c()}}else{throw h}}return s}var t=this,n=e.dom,r=false;this.getBookmark=function(t){function o(e){var t,r,i,s,o=[];t=e.parentNode;r=n.getRoot().parentNode;while(t!=r&&t.nodeType!==9){i=t.children;s=i.length;while(s--){if(e===i[s]){o.push(s);break}}e=t;t=t.parentNode}return o}function u(e){var t;t=i(r,e);if(t){return{position:t.position,offset:t.offset,indexes:o(t.node),inside:t.inside}}}var r=e.getRng(),s={};if(t===2){if(!r.item){s.start=u(true);if(!e.isCollapsed()){s.end=u()}}else{s.start={ctrl:true,indexes:o(r.item(0))}}}return s};this.moveToBookmark=function(e){function i(e){var t,r,i,s;t=n.getRoot();for(r=e.length-1;r>=0;r--){s=t.children;i=e[r];if(i<=s.length-1){t=s[i]}}return t}function s(n){var s=e[n?"start":"end"],o,u,a,f;if(s){o=s.position>0;u=r.createTextRange();u.moveToElementText(i(s.indexes));f=s.offset;if(f!==a){u.collapse(s.inside||o);u.moveStart("character",o?-f:f)}else{u.collapse(n)}t.setEndPoint(n?"StartToStart":"EndToStart",u);if(n){t.collapse(true)}}}var t,r=n.doc.body;if(e.start){if(e.start.ctrl){t=r.createControlRange();t.addElement(i(e.start.indexes));t.select()}else{t=r.createTextRange();s(true);s();t.select()}}};this.addRange=function(t){function v(e){var t,s,l,p,d;l=n.create("a");t=e?o:a;s=e?u:f;p=i.duplicate();if(t==c||t==c.documentElement){t=h;s=0}if(t.nodeType==3){t.parentNode.insertBefore(l,t);p.moveToElementText(l);p.moveStart("character",s);n.remove(l);i.setEndPoint(e?"StartToStart":"EndToEnd",p)}else{d=t.childNodes;if(d.length){if(s>=d.length){n.insertAfter(l,d[d.length-1])}else{t.insertBefore(l,d[s])}p.moveToElementText(l)}else if(t.canHaveHTML){t.innerHTML="";l=t.firstChild;p.moveToElementText(l);p.collapse(r)}i.setEndPoint(e?"StartToStart":"EndToEnd",p);n.remove(l)}}var i,s,o,u,a,f,l,c=e.dom.doc,h=c.body,p,d;o=t.startContainer;u=t.startOffset;a=t.endContainer;f=t.endOffset;i=h.createTextRange();if(o==a&&o.nodeType==1){if(u==f&&!o.hasChildNodes()){if(o.canHaveHTML){l=o.previousSibling;if(l&&!l.hasChildNodes()&&n.isBlock(l)){l.innerHTML=""}else{l=null}o.innerHTML="";i.moveToElementText(o.lastChild);i.select();n.doc.selection.clear();o.innerHTML="";if(l){l.innerHTML=""}return}else{u=n.nodeIndex(o);o=o.parentNode}}if(u==f-1){try{d=o.childNodes[u];s=h.createControlRange();s.addElement(d);s.select();p=e.getRng();if(p.item&&d===p.item(0)){return}}catch(m){}}}v(true);v();i.select()};this.getRangeAt=s}return e});i("tinymce/util/VK",["tinymce/Env"],function(e){return{BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,modifierPressed:function(e){return e.shiftKey||e.ctrlKey||e.altKey},metaKeyPressed:function(t){return(e.mac?t.metaKey:t.ctrlKey)&&!t.altKey}}});i("tinymce/dom/ControlSelection",["tinymce/util/VK","tinymce/util/Tools","tinymce/Env"],function(e,t,n){return function(r,i){function C(e){if(i.settings.object_resizing===false){return false}if(!/TABLE|IMG|DIV/.test(e.nodeName)){return false}if(e.getAttribute("data-mce-resize")==="false"){return false}return true}function k(t){var n,r;n=t.screenX-h;r=t.screenY-p;w=n*l[2]+m;E=r*l[3]+g;w=w<5?5:w;E=E<5?5:E;if(e.modifierPressed(t)||u.nodeName=="IMG"&&l[2]*l[3]!==0){w=Math.round(E/y);E=Math.round(w*y)}s.setStyles(a,{width:w,height:E});if(l[2]<0&&a.clientWidth<=w){s.setStyle(a,"left",d+(m-w))}if(l[3]<0&&a.clientHeight<=E){s.setStyle(a,"top",v+(g-E))}if(!b){i.fire("ObjectResizeStart",{target:u,width:m,height:g});b=true}}function L(){function e(e,t){if(t){if(u.style[e]||!i.schema.isValid(u.nodeName.toLowerCase(),e)){s.setStyle(u,e,t)}else{s.setAttrib(u,e,t)}}}b=false;e("width",w);e("height",E);s.unbind(S,"mousemove",k);s.unbind(S,"mouseup",L);if(x!=S){s.unbind(x,"mousemove",k);s.unbind(x,"mouseup",L)}s.remove(a);if(!T||u.nodeName=="TABLE"){A(u)}i.fire("ObjectResized",{target:u,width:w,height:E});i.nodeChanged()}function A(e,t,n){var r,c,T,N,A,M=i.getBody();r=s.getPos(e,M);d=r.x;v=r.y;A=e.getBoundingClientRect();c=A.width||A.right-A.left;T=A.height||A.bottom-A.top;if(u!=e){B();u=e;w=E=0}N=i.fire("ObjectSelected",{target:e});if(C(e)&&!N.isDefaultPrevented()){o(f,function(e,r){function w(t){b=true;h=t.screenX;p=t.screenY;m=u.clientWidth;g=u.clientHeight;y=g/m;l=e;a=u.cloneNode(true);s.addClass(a,"mce-clonedresizable");a.contentEditable=false;a.unSelectabe=true;s.setStyles(a,{left:d,top:v,margin:0});a.removeAttribute("data-mce-selected");i.getBody().appendChild(a);s.bind(S,"mousemove",k);s.bind(S,"mouseup",L);if(x!=S){s.bind(x,"mousemove",k);s.bind(x,"mouseup",L)}}var o,f;if(t){if(r==t){w(n)}return}o=s.get("mceResizeHandle"+r);if(!o){f=i.getBody();o=s.add(f,"div",{id:"mceResizeHandle"+r,"data-mce-bogus":true,"class":"mce-resizehandle",contentEditable:false,unSelectabe:true,style:"cursor:"+r+"-resize; margin:0; padding:0"});s.bind(o,"mousedown",function(e){e.preventDefault();w(e)})}else{s.show(o)}s.setStyles(o,{left:c*e[0]+d-o.offsetWidth/2,top:T*e[1]+v-o.offsetHeight/2})})}else{O()}u.setAttribute("data-mce-selected","1")}function O(){var e,t;if(u){u.removeAttribute("data-mce-selected")}for(e in f){t=s.get("mceResizeHandle"+e);if(t){s.unbind(t);s.remove(t)}}}function M(e){function n(e,t){if(e){do{if(e===t){return true}}while(e=e.parentNode)}}var t;o(s.select("img[data-mce-selected],hr[data-mce-selected]"),function(e){e.removeAttribute("data-mce-selected")});t=e.type=="mousedown"?e.target:r.getNode();t=s.getParent(t,T?"table":"table,img,hr");if(n(t,i.getBody())){j();if(n(r.getStart(),t)&&n(r.getEnd(),t)){if(!T||t!=r.getStart()&&r.getStart().nodeName!=="IMG"){A(t);return}}}O()}function _(e,t,n){if(e&&e.attachEvent){e.attachEvent("on"+t,n)}}function D(e,t,n){if(e&&e.detachEvent){e.detachEvent("on"+t,n)}}function P(e){var t=e.srcElement,n,r,s,o,u,a,h;n=t.getBoundingClientRect();a=c.clientX-n.left;h=c.clientY-n.top;for(r in f){s=f[r];o=t.offsetWidth*s[0];u=t.offsetHeight*s[1];if(Math.abs(o-a)<8&&Math.abs(u-h)<8){l=s;break}}b=true;i.getDoc().selection.empty();A(t,r,c)}function H(e){var t=e.srcElement;if(t!=u){B();if(t.id.indexOf("mceResizeHandle")===0){e.returnValue=false;return}if(t.nodeName=="IMG"||t.nodeName=="TABLE"){O();u=t;_(t,"resizestart",P)}}}function B(){D(u,"resizestart",P)}function j(){try{i.getDoc().execCommand("enableObjectResizing",false,false)}catch(e){}}function F(e){var t;if(!T){return}t=S.body.createControlRange();try{t.addElement(e);t.select();return true}catch(n){}}function I(){u=a=null;if(T){B();D(i.getBody(),"controlselect",H)}}var s=i.dom,o=t.each;var u,a,f,l,c;var h,p,d,v,m,g,y,b;var w,E,S=i.getDoc(),x=document,T=n.ie&&n.ie<11;f={n:[.5,0,0,-1],e:[1,.5,1,0],s:[.5,1,0,1],w:[0,.5,-1,0],nw:[0,0,-1,-1],ne:[1,0,1,-1],se:[1,1,1,1],sw:[0,1,-1,1]};var N=".mce-content-body";i.contentStyles.push(N+" div.mce-resizehandle {"+"position: absolute;"+"border: 1px solid black;"+"background: #FFF;"+"width: 5px;"+"height: 5px;"+"z-index: 10000"+"}"+N+" .mce-resizehandle:hover {"+"background: #000"+"}"+N+" img[data-mce-selected], hr[data-mce-selected] {"+"outline: 1px solid black;"+"resize: none"+"}"+N+" .mce-clonedresizable {"+"position: absolute;"+(n.gecko?"":"outline: 1px dashed black;")+"opacity: .5;"+"filter: alpha(opacity=50);"+"z-index: 10000"+"}");i.on("init",function(){if(T){i.on("ObjectResized",function(e){if(e.target.nodeName!="TABLE"){O();F(e.target)}});_(i.getBody(),"controlselect",H);i.on("mousedown",function(e){c=e})}else{j();if(n.ie>=11){i.on("mouseup",function(e){var t=e.target.nodeName;if(/^(TABLE|IMG|HR)$/.test(t)){i.selection.select(e.target,t=="TABLE");i.nodeChanged()}});i.dom.bind(i.getBody(),"mscontrolselect",function(e){if(/^(TABLE|IMG|HR)$/.test(e.target.nodeName)){e.preventDefault()}})}}i.on("nodechange mousedown mouseup ResizeEditor",M);i.on("keydown keyup",function(e){if(u&&u.nodeName=="TABLE"){M(e)}})});return{isResizable:C,showResizeRect:A,hideResizeRect:O,updateResizeRect:M,controlSelect:F,destroy:I}}});i("tinymce/dom/Selection",["tinymce/dom/TreeWalker","tinymce/dom/TridentSelection","tinymce/dom/ControlSelection","tinymce/Env","tinymce/util/Tools"],function(e,n,r,i,s){function c(e,t,i,s){var o=this;o.dom=e;o.win=t;o.serializer=i;o.editor=s;o.controlSelection=new r(o,s);if(!o.win.getSelection){o.tridentSel=new n(o)}}var o=s.each,u=s.grep,a=s.trim;var f=i.ie,l=i.opera;c.prototype={setCursorLocation:function(e,t){var n=this,r=n.dom.createRng();if(!e){n._moveEndPoint(r,n.editor.getBody(),true);n.setRng(r)}else{r.setStart(e,t);r.setEnd(e,t);n.setRng(r);n.collapse(false)}},getContent:function(e){var n=this,r=n.getRng(),i=n.dom.create("body");var s=n.getSel(),o,u,a;e=e||{};o=u="";e.get=true;e.format=e.format||"html";e.selection=true;n.editor.fire("BeforeGetContent",e);if(e.format=="text"){return n.isCollapsed()?"":r.text||(s.toString?s.toString():"")}if(r.cloneContents){a=r.cloneContents();if(a){i.appendChild(a)}}else if(r.item!==t||r.htmlText!==t){i.innerHTML="
"+(r.item?r.item(0).outerHTML:r.htmlText);i.removeChild(i.firstChild)}else{i.innerHTML=r.toString()}if(/^\s/.test(i.innerHTML)){o=" "}if(/\s+$/.test(i.innerHTML)){u=" "}e.getInner=true;e.content=n.isCollapsed()?"":o+n.serializer.serialize(i,e)+u;n.editor.fire("GetContent",e);return e.content},setContent:function(e,t){var n=this,r=n.getRng(),i,s=n.win.document,o,u;t=t||{format:"html"};t.set=true;t.selection=true;e=t.content=e;if(!t.no_events){n.editor.fire("BeforeSetContent",t)}e=t.content;if(r.insertNode){e+='_';if(r.startContainer==s&&r.endContainer==s){s.body.innerHTML=e}else{r.deleteContents();if(s.body.childNodes.length===0){s.body.innerHTML=e}else{if(r.createContextualFragment){r.insertNode(r.createContextualFragment(e))}else{o=s.createDocumentFragment();u=s.createElement("div");o.appendChild(u);u.outerHTML=e;r.insertNode(o)}}}i=n.dom.get("__caret");r=s.createRange();r.setStartBefore(i);r.setEndBefore(i);n.setRng(r);n.dom.remove("__caret");try{n.setRng(r)}catch(a){}}else{if(r.item){s.execCommand("Delete",false,null);r=n.getRng()}if(/^\s+/.test(e)){r.pasteHTML('_'+e);n.dom.remove("__mce_tmp")}else{r.pasteHTML(e)}}if(!t.no_events){n.editor.fire("SetContent",t)}},getStart:function(){var e=this,t=e.getRng(),n,r,i,s;if(t.duplicate||t.item){if(t.item){return t.item(0)}i=t.duplicate();i.collapse(1);n=i.parentElement();if(n.ownerDocument!==e.dom.doc){n=e.dom.getRoot()}r=s=t.parentElement();while(s=s.parentNode){if(s==n){n=r;break}}return n}else{n=t.startContainer;if(n.nodeType==1&&n.hasChildNodes()){n=n.childNodes[Math.min(n.childNodes.length-1,t.startOffset)]}if(n&&n.nodeType==3){return n.parentNode}return n}},getEnd:function(){var e=this,t=e.getRng(),n,r;if(t.duplicate||t.item){if(t.item){return t.item(0)}t=t.duplicate();t.collapse(0);n=t.parentElement();if(n.ownerDocument!==e.dom.doc){n=e.dom.getRoot()}if(n&&n.nodeName=="BODY"){return n.lastChild||n}return n}else{n=t.endContainer;r=t.endOffset;if(n.nodeType==1&&n.hasChildNodes()){n=n.childNodes[r>0?r-1:r]}if(n&&n.nodeType==3){return n.parentNode}return n}},getBookmark:function(e,t){function p(e,t){var n=0;o(r.select(e),function(e,r){if(e==t){n=r}});return n}function d(e){function t(t){var n,r,i,s=t?"start":"end";n=e[s+"Container"];r=e[s+"Offset"];if(n.nodeType==1&&n.nodeName=="TR"){i=n.childNodes;n=i[Math.min(t?r:r-1,i.length-1)];if(n){r=t?0:n.childNodes.length;e["set"+(t?"Start":"End")](n,r)}}}t(true);t();return e}function v(){function o(e,r){var s=e[r?"startContainer":"endContainer"],o=e[r?"startOffset":"endOffset"],u=[],a,f,l=0;if(s.nodeType==3){if(t){for(a=s.previousSibling;a&&a.nodeType==3;a=a.previousSibling){o+=a.nodeValue.length}}u.push(o)}else{f=s.childNodes;if(o>=f.length&&f.length){l=1;o=Math.max(0,f.length-1)}u.push(n.dom.nodeIndex(f[o],t)+l)}for(;s&&s!=i;s=s.parentNode){u.push(n.dom.nodeIndex(s,t))}return u}var e=n.getRng(true),i=r.getRoot(),s={};s.start=o(e,true);if(!n.isCollapsed()){s.end=o(e)}return s}var n=this,r=n.dom,i,s,u,a,f,l,c="",h;if(e==2){l=n.getNode();f=l?l.nodeName:null;if(f=="IMG"){return{name:f,index:p(f,l)}}if(n.tridentSel){return n.tridentSel.getBookmark(e)}return v()}if(e){return{rng:n.getRng()}}i=n.getRng();u=r.uniqueId();a=n.isCollapsed();h="overflow:hidden;line-height:0px";if(i.duplicate||i.item){if(!i.item){s=i.duplicate();try{i.collapse();i.pasteHTML(''+c+"");if(!a){s.collapse(false);i.moveToElementText(s.parentElement());if(i.compareEndPoints("StartToEnd",s)===0){s.move("character",-1)}s.pasteHTML(''+c+"")}}catch(m){return null}}else{l=i.item(0);f=l.nodeName;return{name:f,index:p(f,l)}}}else{l=n.getNode();f=l.nodeName;if(f=="IMG"){return{name:f,index:p(f,l)}}s=d(i.cloneRange());if(!a){s.collapse(false);s.insertNode(r.create("span",{"data-mce-type":"bookmark",id:u+"_end",style:h},c))}i=d(i);i.collapse(true);i.insertNode(r.create("span",{"data-mce-type":"bookmark",id:u+"_start",style:h},c))}n.moveToBookmark({id:u,keep:1});return{id:u}},moveToBookmark:function(e){function p(t){var n=e[t?"start":"end"],s,o,u,a;if(n){u=n[0];for(o=i,s=n.length-1;s>=1;s--){a=o.childNodes;if(n[s]>a.length-1){return}o=a[n[s]]}if(o.nodeType===3){u=Math.min(n[0],o.nodeValue.length)}if(o.nodeType===1){u=Math.min(n[0],o.childNodes.length)}if(t){r.setStart(o,u)}else{r.setEnd(o,u)}}return true}function d(t){var r=n.get(e.id+"_"+t),i,f,p,d,v=e.keep;if(r){i=r.parentNode;if(t=="start"){if(!v){f=n.nodeIndex(r)}else{i=r.firstChild;f=1}s=a=i;c=h=f}else{if(!v){f=n.nodeIndex(r)}else{i=r.firstChild;f=1}a=i;h=f}if(!v){d=r.previousSibling;p=r.nextSibling;o(u(r.childNodes),function(e){if(e.nodeType==3){e.nodeValue=e.nodeValue.replace(/\uFEFF/g,"")}});while(r=n.get(e.id+"_"+t)){n.remove(r,1)}if(d&&p&&d.nodeType==p.nodeType&&d.nodeType==3&&!l){f=d.nodeValue.length;d.appendData(p.nodeValue);n.remove(p);if(t=="start"){s=a=d;c=h=f}else{a=d;h=f}}}}}function v(e){if(n.isBlock(e)&&!e.innerHTML&&!f){e.innerHTML='
'}return e}var t=this,n=t.dom,r,i,s,a,c,h;if(e){if(e.start){r=n.createRng();i=n.getRoot();if(t.tridentSel){return t.tridentSel.moveToBookmark(e)}if(p(true)&&p()){t.setRng(r)}}else if(e.id){d("start");d("end");if(s){r=n.createRng();r.setStart(v(s),c);r.setEnd(v(a),h);t.setRng(r)}}else if(e.name){t.select(n.select(e.name)[e.index])}else if(e.rng){t.setRng(e.rng)}}},select:function(e,t){var n=this,r=n.dom,i=r.createRng(),s;n.lastFocusBookmark=null;if(e){if(!t&&n.controlSelection.controlSelect(e)){return}s=r.nodeIndex(e);i.setStart(e.parentNode,s);i.setEnd(e.parentNode,s+1);if(t){n._moveEndPoint(i,e,true);n._moveEndPoint(i,e)}n.setRng(i)}return e},isCollapsed:function(){var e=this,t=e.getRng(),n=e.getSel();if(!t||t.item){return false}if(t.compareEndPoints){return t.compareEndPoints("StartToEnd",t)===0}return!n||t.collapsed},collapse:function(e){var t=this,n=t.getRng(),r;if(n.item){r=n.item(0);n=t.win.document.body.createTextRange();n.moveToElementText(r)}n.collapse(!!e);t.setRng(n)},getSel:function(){var e=this.win;return e.getSelection?e.getSelection():e.document.selection},getRng:function(e){var t=this,n,r,i,s=t.win.document,o;if(!e&&t.lastFocusBookmark){var u=t.lastFocusBookmark;if(u.startContainer){r=s.createRange();r.setStart(u.startContainer,u.startOffset);r.setEnd(u.endContainer,u.endOffset)}else{r=u}return r}if(e&&t.tridentSel){return t.tridentSel.getRangeAt(0)}try{if(n=t.getSel()){if(n.rangeCount>0){r=n.getRangeAt(0)}else{r=n.createRange?n.createRange():s.createRange()}}}catch(a){}if(f&&r&&r.setStart&&s.selection){try{o=s.selection.createRange()}catch(a){}if(o&&o.item){i=o.item(0);r=s.createRange();r.setStartBefore(i);r.setEndAfter(i)}}if(!r){r=s.createRange?s.createRange():s.body.createTextRange()}if(r.setStart&&r.startContainer.nodeType===9&&r.collapsed){i=t.dom.getRoot();r.setStart(i,0);r.setEnd(i,0)}if(t.selectedRange&&t.explicitRange){if(r.compareBoundaryPoints(r.START_TO_START,t.selectedRange)===0&&r.compareBoundaryPoints(r.END_TO_END,t.selectedRange)===0){r=t.explicitRange}else{t.selectedRange=null;t.explicitRange=null}}return r},setRng:function(e,t){var n=this,r;if(e.select){try{e.select()}catch(i){}return}if(!n.tridentSel){r=n.getSel();if(r){n.explicitRange=e;try{r.removeAllRanges();r.addRange(e)}catch(i){}if(t===false&&r.extend){r.collapse(e.endContainer,e.endOffset);r.extend(e.startContainer,e.startOffset)}n.selectedRange=r.rangeCount>0?r.getRangeAt(0):null}}else{if(e.cloneRange){try{n.tridentSel.addRange(e);return}catch(i){}}}},setNode:function(e){var t=this;t.setContent(t.dom.getOuterHTML(e));return e},getNode:function(){function a(e,t){var n=e;while(e&&e.nodeType===3&&e.length===0){e=t?e.nextSibling:e.previousSibling}return e||n}var e=this,t=e.getRng(),n;var r=t.startContainer,i=t.endContainer;var s=t.startOffset,o=t.endOffset,u=e.dom.getRoot();if(!t){return u}if(t.setStart){n=t.commonAncestorContainer;if(!t.collapsed){if(r==i){if(o-s<2){if(r.hasChildNodes()){n=r.childNodes[s]}}}if(r.nodeType===3&&i.nodeType===3){if(r.length===s){r=a(r.nextSibling,true)}else{r=r.parentNode}if(o===0){i=a(i.previousSibling,false)}else{i=i.parentNode}if(r&&r===i){return r}}}if(n&&n.nodeType==3){return n.parentNode}return n}n=t.item?t.item(0):t.parentElement();if(n.ownerDocument!==e.win.document){n=u}return n},getSelectedBlocks:function(t,n){var r=this,i=r.dom,s,o,u=[];o=i.getRoot();t=i.getParent(t||r.getStart(),i.isBlock);n=i.getParent(n||r.getEnd(),i.isBlock);if(t&&t!=o){u.push(t)}if(t&&n&&t!=n){s=t;var a=new e(t,o);while((s=a.next())&&s!=n){if(i.isBlock(s)){u.push(s)}}}if(n&&t!=n&&n!=o){u.push(n)}return u},isForward:function(){var e=this.dom,t=this.getSel(),n,r;if(!t||!t.anchorNode||!t.focusNode){return true}n=e.createRng();n.setStart(t.anchorNode,t.anchorOffset);n.collapse(true);r=e.createRng();r.setStart(t.focusNode,t.focusOffset);r.collapse(true);return n.compareBoundaryPoints(n.START_TO_START,r)<=0},normalize:function(){function s(s){function v(t,n){var r=new e(t,f.getParent(t.parentNode,f.isBlock)||l);while(t=r[n?"prev":"next"]()){if(t.nodeName==="BR"){return true}}}function m(e,t){return e.previousSibling&&e.previousSibling.nodeName==t}function g(t,n){var s,a;n=n||o;s=new e(n,f.getParent(n.parentNode,f.isBlock)||l);while(c=s[t?"prev":"next"]()){if(c.nodeType===3&&c.nodeValue.length>0){o=c;u=t?c.nodeValue.length:0;r=true;return}if(f.isBlock(c)||h[c.nodeName.toLowerCase()]){return}a=c}if(i&&a){o=a;r=true;u=0}}var o,u,a,f=t.dom,l=f.getRoot(),c,h,p;var d;o=n[(s?"start":"end")+"Container"];u=n[(s?"start":"end")+"Offset"];h=f.schema.getNonEmptyElements();d=s;if(o.nodeType==1&&u>o.childNodes.length-1){d=false}if(o.nodeType===9){o=f.getRoot();u=0}if(o===l){if(d){c=o.childNodes[u>0?u-1:0];if(c){p=c.nodeName.toLowerCase();if(h[c.nodeName]||c.nodeName=="TABLE"){return}}}if(o.hasChildNodes()){u=Math.min(!d&&u>0?u-1:u,o.childNodes.length-1);o=o.childNodes[u];u=0;if(o.hasChildNodes()&&!/TABLE/.test(o.nodeName)){c=o;a=new e(o,l);do{if(c.nodeType===3&&c.nodeValue.length>0){u=d?0:c.nodeValue.length;o=c;r=true;break}if(h[c.nodeName.toLowerCase()]){u=f.nodeIndex(c);o=c.parentNode;if(c.nodeName=="IMG"&&!d){u++}r=true;break}}while(c=d?a.next():a.prev())}}}if(i){if(o.nodeType===3&&u===0){g(true)}if(o.nodeType===1){c=o.childNodes[u];if(c&&c.nodeName==="BR"&&!m(c,"A")&&!v(c)&&!v(c,true)){g(true,o.childNodes[u])}}}if(d&&!i&&o.nodeType===3&&u===o.nodeValue.length){g(false)}if(r){n["set"+(s?"Start":"End")](o,u)}}var t=this,n,r,i;if(f){return}n=t.getRng();i=n.collapsed;s(true);if(!i){s()}if(r){if(i){n.collapse(true)}t.setRng(n,t.isForward())}},selectorChanged:function(e,t){var n=this,r;if(!n.selectorChangedData){n.selectorChangedData={};r={};n.editor.on("NodeChange",function(e){var t=e.element,i=n.dom,s=i.getParents(t,null,i.getRoot()),u={};o(n.selectorChangedData,function(e,t){o(s,function(n){if(i.is(n,t)){if(!r[t]){o(e,function(e){e(true,{node:n,selector:t,parents:s})});r[t]=e}u[t]=e;return false}})});o(r,function(e,n){if(!u[n]){delete r[n];o(e,function(e){e(false,{node:t,selector:n,parents:s})})}})})}if(!n.selectorChangedData[e]){n.selectorChangedData[e]=[]}n.selectorChangedData[e].push(t);return n},getScrollContainer:function(){var e,t=this.dom.getRoot();while(t&&t.nodeName!="BODY"){if(t.scrollHeight>t.clientHeight){e=t;break}t=t.parentNode}return e},scrollIntoView:function(e){function a(e){var t=0,n=0;var r=e;while(r&&r.nodeType){t+=r.offsetLeft||0;n+=r.offsetTop||0;r=r.offsetParent}return{x:t,y:n}}var t,n,r=this,i=r.dom,s=i.getRoot(),o,u;if(s.nodeName!="BODY"){var f=r.getScrollContainer();if(f){t=a(e).y-a(f).y;u=f.clientHeight;o=f.scrollTop;if(to+u){f.scrollTop=to+u){r.editor.getWin().scrollTo(0,t=t.nodeValue.length){e.splice(0,1)}t=e[e.length-1];if(u===0&&e.length>0&&t===o&&t.nodeType===3){e.splice(e.length-1,1)}return e}function m(e,t,n){var r=[];for(;e&&e!=n;e=e[t]){r.push(e)}return r}function g(e,t){do{if(e.parentNode==t){return e}e=e.parentNode}while(e)}function y(e,t,n){var i=n?"nextSibling":"previousSibling";for(c=e,h=c.parentNode;c&&c!=t;c=h){h=c.parentNode;p=m(c==e?c:c[i],i);if(p.length){if(!n){p.reverse()}r(v(p))}}}var i=n.startContainer,s=n.startOffset,o=n.endContainer,u=n.endOffset,a,f,l,c,h,p,d;d=e.select("td.mce-item-selected,th.mce-item-selected");if(d.length>0){t(d,function(e){r([e])});return}if(i.nodeType==1&&i.hasChildNodes()){i=i.childNodes[s]}if(o.nodeType==1&&o.hasChildNodes()){o=o.childNodes[Math.min(u-1,o.childNodes.length-1)]}if(i==o){return r(v([i]))}a=e.findCommonAncestor(i,o);for(c=i;c;c=c.parentNode){if(c===o){return y(i,a,true)}if(c===a){break}}for(c=o;c;c=c.parentNode){if(c===i){return y(o,a)}if(c===a){break}}f=g(i,a)||i;l=g(o,a)||o;y(i,f,true);p=m(f==i?f:f.nextSibling,"nextSibling",l==o?l.nextSibling:l);if(p.length){r(v(p))}y(o,l)};this.split=function(e){function s(e,t){return e.splitText(t)}var t=e.startContainer,n=e.startOffset,r=e.endContainer,i=e.endOffset;if(t==r&&t.nodeType==3){if(n>0&&nn){i=i-n;t=r=s(r,i).previousSibling;i=r.nodeValue.length;n=0}else{i=0}}}else{if(t.nodeType==3&&n>0&&n0&&i1||i==t||i.tagName=="BR"){return i}}}var n=r.selection.getRng();var s=n.startContainer;var o=n.endContainer;if(s!=o&&n.endOffset===0){var u=t(s,o);var a=u.nodeType==3?u.length:u.childNodes.length;n.setEnd(u,a)}return n}function T(e,t,n,r,i){var o=[],u=-1,a,f=-1,l=-1,c;E(e.childNodes,function(e,t){if(e.nodeName==="UL"||e.nodeName==="OL"){u=t;a=e;return false}});E(e.childNodes,function(e,n){if(e.nodeName==="SPAN"&&s.getAttrib(e,"data-mce-type")=="bookmark"){if(e.id==t.id+"_start"){f=n}else if(e.id==t.id+"_end"){l=n}}});if(u<=0||fu){E(S(e.childNodes),i);return 0}else{c=s.clone(n,d);E(S(e.childNodes),function(e,t){if(fu&&t>u){o.push(e);e.parentNode.removeChild(e)}});if(fu){e.insertBefore(c,a.nextSibling)}r.push(c);E(o,function(e){c.appendChild(e)});return c}}function C(e,r,i){var o=[],l,p,m=true;l=h.inline||h.block;p=s.create(l);b(p);u.walk(e,function(e){function v(e){var w,x,C,L,A;A=m;w=e.nodeName.toLowerCase();x=e.parentNode.nodeName.toLowerCase();if(e.nodeType===1&&y(e)){A=m;m=y(e)==="true";L=true}if(z(w,"br")){u=0;if(h.block){s.remove(e)}return}if(h.wrapper&&j(e,t,n)){u=0;return}if(m&&!L&&h.block&&!h.wrapper&&N(w)&&a(x,l)){e=s.rename(e,l);b(e);o.push(e);u=0;return}if(h.selector){E(c,function(t){if("collapsed"in t&&t.collapsed!==g){return}if(s.is(e,t.selector)&&!k(e)){b(e,t);C=true}});if(!h.inline||C){u=0;return}}if(m&&!L&&a(l,w)&&a(x,l)&&!(!i&&e.nodeType===3&&e.nodeValue.length===1&&e.nodeValue.charCodeAt(0)===65279)&&!k(e)&&(!h.inline||!f(e))){if(!u){u=s.clone(p,d);e.parentNode.insertBefore(u,e);o.push(u)}u.appendChild(e)}else if(w=="li"&&r){u=T(e,r,p,o,v)}else{u=0;E(S(e.childNodes),v);if(L){m=A}u=0}}var u;E(e,v)});if(h.wrap_links===false){E(o,function(e){function t(e){var n,r,i;if(e.nodeName==="A"){r=s.clone(p,d);o.push(r);i=S(e.childNodes);for(n=0;n1||!f(e))&&r===0){s.remove(e,1);return}if(h.inline||h.wrapper){if(!h.exact&&r===1){e=u(e)}E(c,function(t){E(s.select(t.inline,e),function(e){var r;if(t.wrap_links===false){r=e.parentNode;do{if(r.nodeName==="A"){return}}while(r=r.parentNode)}Q(t,n,e,t.exact?e:null)})});if(j(e.parentNode,t,n)){s.remove(e,1);e=0;return v}if(h.merge_with_parents){s.getParent(e.parentNode,function(r){if(j(r,t,n)){s.remove(e,1);e=0;return v}})}if(e&&h.merge_siblings!==false){e=et(Y(e),e);e=et(e,Y(e,v))}}})}var c=O(t),h=c[0],p,m,g=!i&&o.isCollapsed();if(h){if(i){if(i.nodeType){m=s.createRng();m.setStartBefore(i);m.setEndAfter(i);C(K(m,c),null,true)}else{C(i,null,true)}}else{if(!g||!h.inline||s.select("td.mce-item-selected,th.mce-item-selected").length){var L=r.selection.getNode();if(!l&&c[0].defaultBlock&&!s.getParent(L,s.isBlock)){P(c[0].defaultBlock)}r.selection.setRng(w());p=o.getBookmark();C(K(o.getRng(v),c),p);if(h.styles&&(h.styles.color||h.styles.textDecoration)){x(L,D,"childNodes");D(L)}o.moveToBookmark(p);rt(o.getRng(v));r.nodeChanged()}else{nt("apply",t,n)}}}}function H(e,t,n){function m(e){var n,r,s,o,u;if(e.nodeType===1&&y(e)){o=p;p=y(e)==="true";u=true}n=S(e.childNodes);if(p&&!u){for(r=0,s=i.length;r=0;u--){a=t[u].selector;if(!a||t[u].defaultBlock){return v}for(i=r.length-1;i>=0;i--){if(s.is(r[i],a)){return v}}}}return d}function R(e,t,n){var i;if(!m){m={};i={};r.on("NodeChange",function(e){var t=C(e.element),n={};E(m,function(e,r){E(t,function(s){if(j(s,r,{},e.similar)){if(!i[r]){E(e,function(e){e(true,{node:s,format:r,parents:t})});i[r]=e}n[r]=e;return false}})});E(i,function(r,s){if(!n[s]){delete i[s];E(r,function(n){n(false,{node:e.element,format:s,parents:t})})}})})}E(e.split(","),function(e){if(!m[e]){m[e]=[];m[e].similar=n}m[e].push(t)});return this}function U(e,t){if(z(e,t.inline)){return v}if(z(e,t.block)){return v}if(t.selector){return e.nodeType==1&&s.is(e,t.selector)}}function z(e,t){e=e||"";t=t||"";e=""+(e.nodeName||e);t=""+(t.nodeName||t);return e.toLowerCase()==t.toLowerCase()}function W(e,t){return X(s.getStyle(e,t),t)}function X(e,t){if(t=="color"||t=="backgroundColor"){e=s.toHex(e)}if(t=="fontWeight"&&e==700){e="bold"}if(t=="fontFamily"){e=e.replace(/[\'\"]/g,"").replace(/,\s+/g,",")}return""+e}function V(e,t){if(typeof e!="string"){e=e(t)}else if(t){e=e.replace(/%(\w+)/g,function(e,n){return t[n]||e})}return e}function $(e){return e&&e.nodeType===3&&/^([\t \r\n]+|)$/.test(e.nodeValue)}function J(e,t,n){var r=s.create(t,n);e.parentNode.insertBefore(r,e);r.appendChild(e);return r}function K(t,n,i){function m(e){function a(e){return e.nodeName=="BR"&&e.getAttribute("data-mce-bogus")&&!e.nextSibling}var t,r,i,o,u;t=r=e?l:p;o=e?"previousSibling":"nextSibling";u=s.getRoot();if(t.nodeType==3&&!$(t)){if(e?h>0:vr?n:r;if(n!==-1&&!i){n++}}else{n=s.indexOf(" ",t);r=s.indexOf(" ",t);n=n!==-1&&(r===-1||no?o:h];if(l.nodeType==3){h=0}}if(p.nodeType==1&&p.hasChildNodes()){o=p.childNodes.length-1;p=p.childNodes[v>o?o:v-1];if(p.nodeType==3){v=p.nodeValue.length}}l=w(l);p=w(p);if(Z(l.parentNode)||Z(l)){l=Z(l)?l:l.parentNode;l=l.nextSibling||l;if(l.nodeType==3){h=0}}if(Z(p.parentNode)||Z(p)){p=Z(p)?p:p.parentNode;p=p.previousSibling||p;if(p.nodeType==3){v=p.length}}if(n[0].inline){if(t.collapsed){a=E(l,h,true);if(a){l=a.container;h=a.offset}a=E(p,v);if(a){p=a.container;v=a.offset}}u=b(p,v);if(u.node){while(u.node&&u.offset===0&&u.node.previousSibling){u=b(u.node.previousSibling)}if(u.node&&u.offset>0&&u.node.nodeType===3&&u.node.nodeValue.charAt(u.offset-1)===" "){if(u.offset>1){p=u.node;p.splitText(u.offset-1)}}}}if(n[0].inline||n[0].block_expand){if(!n[0].inline||l.nodeType!=3||h===0){l=m(true)}if(!n[0].inline||p.nodeType!=3||v===p.nodeValue.length){p=m()}}if(n[0].selector&&n[0].expand!==d&&!n[0].inline){l=S(l,"previousSibling");p=S(p,"nextSibling")}if(n[0].block||n[0].selector){l=x(l,"previousSibling");p=x(p,"nextSibling");if(n[0].block){if(!f(l)){l=m(true)}if(!f(p)){p=m()}}}if(l.nodeType==1){h=c(l);l=l.parentNode}if(p.nodeType==1){v=c(p)+1;p=p.parentNode}return{startContainer:l,startOffset:h,endContainer:p,endOffset:v}}function Q(e,t,n,r){var i,o,u;if(!U(n,e)){return d}if(e.remove!="all"){E(e.styles,function(e,i){e=X(V(e,t),i);if(typeof i==="number"){i=e;r=0}if(!r||z(W(r,i),e)){s.setStyle(n,i,"")}u=1});if(u&&s.getAttrib(n,"style")===""){n.removeAttribute("style");n.removeAttribute("data-mce-style")}E(e.attributes,function(e,i){var o;e=V(e,t);if(typeof i==="number"){i=e;r=0}if(!r||z(s.getAttrib(r,i),e)){if(i=="class"){e=s.getAttrib(n,i);if(e){o="";E(e.split(/\s+/),function(e){if(/mce\w+/.test(e)){o+=(o?" ":"")+e}});if(o){s.setAttrib(n,i,o);return}}}if(i=="class"){n.removeAttribute("className")}if(p.test(i)){n.removeAttribute("data-mce-"+i)}n.removeAttribute(i)}});E(e.classes,function(e){e=V(e,t);if(!r||s.hasClass(r,e)){s.removeClass(n,e)}});o=s.getAttribs(n);for(i=0;io?o:s]}if(i.nodeType===3&&n&&s>=i.nodeValue.length){i=(new e(i,r.getBody())).next()||i}if(i.nodeType===3&&!n&&s===0){i=(new e(i,r.getBody())).prev()||i}return i}function nt(t,n,i){function l(e){var t=s.create("span",{id:a,"data-mce-bogus":true,style:f?"color:red":""});if(e){t.appendChild(r.getDoc().createTextNode(h))}return t}function c(e,t){while(e){if(e.nodeType===3&&e.nodeValue!==h||e.childNodes.length>1){return false}if(t&&e.nodeType===1){t.push(e)}e=e.firstChild}return true}function p(e){while(e){if(e.id===a){return e}e=e.parentNode}}function d(t){var n;if(t){n=new e(t,t);for(t=n.current();t;t=n.next()){if(t.nodeType===3){return t}}}}function v(e,t){var n,r;if(!e){e=p(o.getStart());if(!e){while(e=s.get(a)){v(e,false)}}}else{r=o.getRng(true);if(c(e)){if(t!==false){r.setStartBefore(e);r.setEndBefore(e)}s.remove(e)}else{n=d(e);if(n.nodeValue.charAt(0)===h){n=n.deleteData(0,1)}s.remove(e,1)}o.setRng(r)}}function m(){var e,t,r,s,a,f,c;e=o.getRng(true);s=e.startOffset;f=e.startContainer;c=f.nodeValue;t=p(o.getStart());if(t){r=d(t)}if(c&&s>0&&s=0;v--){c.appendChild(s.clone(d[v],false));c=c.firstChild}c.appendChild(s.doc.createTextNode(h));c=c.firstChild;var g=s.getParent(p,N);if(g&&s.isEmpty(g)){p.parentNode.replaceChild(m,p)}else{s.insertAfter(m,p)}o.setCursorLocation(c,1);if(s.isEmpty(p)){s.remove(p)}}}function y(){var e;e=p(o.getStart());if(e&&!s.isEmpty(e)){x(e,function(e){if(e.nodeType==1&&e.id!==a&&!s.isEmpty(e)){s.setAttrib(e,"data-mce-bogus",null)}},"childNodes")}}var a="_mce_caret",f=r.settings.caret_debug;if(!r._hasCaretEvents){w=function(){var e=[],t;if(c(p(o.getStart()),e)){t=e.length;while(t--){s.setAttrib(e[t],"data-mce-bogus","1")}}};b=function(e){var t=e.keyCode;v();if(t==8||t==37||t==39){v(p(o.getStart()))}y()};r.on("SetContent",function(e){if(e.selection){y()}});r._hasCaretEvents=true}if(t=="apply"){m()}else{g()}}function rt(t){var n=t.startContainer,r=t.startOffset,i,u,a,f,l;if(n.nodeType==3&&r>=n.nodeValue.length){r=c(n);n=n.parentNode;i=true}if(n.nodeType==1){f=n.childNodes;n=f[Math.min(r,f.length-1)];u=new e(n,s.getParent(n,s.isBlock));if(r>f.length-1||i){u.next()}for(a=u.current();a;a=u.next()){if(a.nodeType==3&&!$(a)){l=s.create("a",null,h);a.parentNode.insertBefore(l,a);t.setStart(a,0);o.setRng(t);s.remove(l);return}}}}var i={},s=r.dom,o=r.selection,u=new t(s),a=r.schema.isValidChild,f=s.isBlock,l=r.settings.forced_root_block,c=s.nodeIndex,h="",p=/^(src|href|style)$/,d=false,v=true,m,g,y=s.getContentEditable,b,w;var E=n.each,S=n.grep,x=n.walk,T=n.extend;T(this,{get:O,register:M,apply:P,remove:H,toggle:B,match:F,matchAll:I,matchNode:j,canApply:q,formatChanged:R});L();A();r.on("BeforeGetContent",function(){if(w){w()}});r.on("mouseup keydown",function(e){if(b){b(e)}})}});i("tinymce/UndoManager",["tinymce/Env","tinymce/util/Tools"],function(e,t){var n=t.trim,r;r=new RegExp(["]+data-mce-bogus[^>]+>[​]+<\\/span>","]+data-mce-bogus[^>]+><\\/div>",'\\s?data-mce-selected="[^"]+"'].join("|"),"gi");return function(t){function l(){return n(t.getContent({format:"raw",no_events:1}).replace(r,""))}function c(){i.typing=false;i.add()}var i,s=0,o=[],u,a,f;t.on("init",function(){i.add()});t.on("BeforeExecCommand",function(e){var t=e.command;if(t!="Undo"&&t!="Redo"&&t!="mceRepaint"){i.beforeChange()}});t.on("ExecCommand",function(e){var t=e.command;if(t!="Undo"&&t!="Redo"&&t!="mceRepaint"){i.add()}});t.on("ObjectResizeStart",function(){i.beforeChange()});t.on("SaveContent ObjectResized",c);t.dom.bind(t.dom.getRoot(),"dragend",c);t.dom.bind(t.getBody(),"focusout",function(){if(!t.removed&&i.typing){c()}});t.on("KeyUp",function(n){var r=n.keyCode;if(r>=33&&r<=36||r>=37&&r<=40||r==45||r==13||n.ctrlKey){c();t.nodeChanged()}if(r==46||r==8||e.mac&&(r==91||r==93)){t.nodeChanged()}if(a&&i.typing){if(!t.isDirty()){t.isNotDirty=!o[0]||l()==o[0].content;if(!t.isNotDirty){t.fire("change",{level:o[0],lastLevel:null})}}t.fire("TypingUndo");a=false;t.nodeChanged()}});t.on("KeyDown",function(e){var t=e.keyCode;if(t>=33&&t<=36||t>=37&&t<=40||t==45){if(i.typing){c()}return}if((t<16||t>20)&&t!=224&&t!=91&&!i.typing){i.beforeChange();i.typing=true;i.add();a=true}});t.on("MouseDown",function(){if(i.typing){c()}});t.addShortcut("ctrl+z","","Undo");t.addShortcut("ctrl+y,ctrl+shift+z","","Redo");t.on("AddUndo Undo Redo ClearUndos MouseUp",function(e){if(!e.isDefaultPrevented()){t.nodeChanged()}});i={data:o,typing:false,beforeChange:function(){if(!f){u=t.selection.getBookmark(2,true)}},add:function(e){var n,r=t.settings,i;e=e||{};e.content=l();if(f||t.fire("BeforeAddUndo",{level:e}).isDefaultPrevented()){return null}i=o[s];if(i&&i.content==e.content){return null}if(o[s]){o[s].beforeBookmark=u}if(r.custom_undo_redo_levels){if(o.length>r.custom_undo_redo_levels){for(n=0;n0){t.fire("change",a);t.isNotDirty=false}return e},undo:function(){var e;if(i.typing){i.add();i.typing=false}if(s>0){e=o[--s];if(s===0){t.isNotDirty=true}t.setContent(e.content,{format:"raw"});t.selection.moveToBookmark(e.beforeBookmark);t.fire("undo",{level:e})}return e},redo:function(){var e;if(s0||i.typing&&o[0]&&l()!=o[0].content},hasRedo:function(){return s'}return r}function _(t){var n,r,i;if(d.nodeType==3&&(t?v>0:v0){return true}}}function B(){var e,t,r;if(d&&d.nodeType==3&&v>=d.nodeValue.length){if(!n&&!H()){e=i.create("br");c.insertNode(e);c.setStartAfter(e);c.setEndAfter(e);t=true}}e=i.create("br");c.insertNode(e);if(n&&S=="PRE"&&(!g||g<8)){e.parentNode.insertBefore(i.doc.createTextNode("\r"),e)}r=i.create("span",{}," ");e.parentNode.insertBefore(r,e);s.scrollIntoView(r);i.remove(r);if(!t){c.setStartAfter(e);c.setEndAfter(e)}else{c.setStartBefore(e);c.setEndBefore(e)}s.setRng(c);u.add()}function j(e){do{if(e.nodeType===3){e.nodeValue=e.nodeValue.replace(/^[\r\n]+/,"")}e=e.firstChild}while(e)}function F(e){var t=i.getRoot(),n,r;n=e;while(n!==t&&i.getContentEditable(n)!=="false"){if(i.getContentEditable(n)==="true"){r=n}n=n.parentNode}return n!==t?r:t}function I(e){var t;if(!n){e.normalize();t=e.lastChild;if(!t||/^(left|right)$/gi.test(i.getStyle(t,"float",true))){i.add(e,"br")}}}var c=s.getRng(true),h,p,d,v,m,g,y,b,w,E,S,x,T,N;if(!c.collapsed){r.execCommand("Delete");return}if(l.isDefaultPrevented()){return}d=c.startContainer;v=c.startOffset;T=(o.force_p_newlines?"p":"")||o.forced_root_block;T=T?T.toUpperCase():"";g=i.doc.documentMode;y=l.shiftKey;if(d.nodeType==1&&d.hasChildNodes()){N=v>d.childNodes.length-1;d=d.childNodes[Math.min(v,d.childNodes.length-1)]||d;if(N&&d.nodeType==3){v=d.nodeValue.length}else{v=0}}p=F(d);if(!p){return}u.beforeChange();if(!i.isBlock(p)&&p!=i.getRoot()){if(!T||y){B()}return}if(T&&!y||!T&&y){d=D(d,v)}m=i.getParent(d,i.isBlock);E=m?i.getParent(m.parentNode,i.isBlock):null;S=m?m.nodeName.toUpperCase():"";x=E?E.nodeName.toUpperCase():"";if(x=="LI"&&!l.ctrlKey){m=E;S=x}if(S=="LI"){if(!T&&y){B();return}if(i.isEmpty(m)){P();return}}if(S=="PRE"&&o.br_in_pre!==false){if(!y){B();return}}else{if(!T&&!y&&S!="LI"||T&&y){B();return}}if(T&&m===r.getBody()){return}T=T||"P";if(_()){if(/^(H[1-6]|PRE|FIGURE)$/.test(S)&&x!="HGROUP"){b=M(T)}else{b=M()}if(o.end_container_on_empty_block&&C(E)&&i.isEmpty(m)){b=i.split(E,m)}else{i.insertAfter(b,m)}A(b)}else if(_(true)){b=m.parentNode.insertBefore(M(),m);k(b);A(m)}else{h=c.cloneRange();h.setEndAfter(m);w=h.extractContents();j(w);b=w.firstChild;i.insertAfter(w,m);L(b);I(m);A(b)}i.setAttrib(b,"id","");r.fire("NewBlock",{newBlock:b});u.add()}var i=r.dom,s=r.selection,o=r.settings;var u=r.undoManager,a=r.schema,f=a.getNonEmptyElements();r.on("keydown",function(e){if(e.keyCode==13){if(l(e)!==false){e.preventDefault()}}})}});i("tinymce/ForceBlocks",[],function(){return function(e){function o(){var o=r.getStart(),u=e.getBody(),a;var f,l,c,h,p;var d,v=-16777215,m,g;var y,b,w;w=t.forced_root_block;if(!o||o.nodeType!==1||!w){return}while(o&&o!=u){if(s[o.nodeName]){return}o=o.parentNode}a=r.getRng();if(a.setStart){f=a.startContainer;l=a.startOffset;c=a.endContainer;h=a.endOffset;try{g=e.getDoc().activeElement===u}catch(E){}}else{if(a.item){o=a.item(0);a=e.getDoc().body.createTextRange();a.moveToElementText(o)}g=a.parentElement().ownerDocument===e.getDoc();y=a.duplicate();y.collapse(true);l=y.move("character",v)*-1;if(!y.collapsed){y=a.duplicate();y.collapse(false);h=y.move("character",v)*-1-l}}o=u.firstChild;b=u.nodeName.toLowerCase();while(o){if((o.nodeType===3||o.nodeType==1&&!s[o.nodeName])&&i.isValidChild(b,w.toLowerCase())){if(o.nodeType===3&&o.nodeValue.length===0){d=o;o=o.nextSibling;n.remove(d);continue}if(!p){p=n.create(w,e.settings.forced_root_block_attrs);o.parentNode.insertBefore(p,o);m=true}d=o;o=o.nextSibling;p.appendChild(d)}else{p=null;o=o.nextSibling}}if(m&&g){if(a.setStart){a.setStart(f,l);a.setEnd(c,h);r.setRng(a)}else{try{a=e.getDoc().body.createTextRange();a.moveToElementText(u);a.collapse(true);a.moveStart("character",l);if(h>0){a.moveEnd("character",h)}a.select()}catch(E){}}e.nodeChanged()}}var t=e.settings,n=e.dom,r=e.selection;var i=e.schema,s=i.getBlockElements();if(t.forced_root_block){e.on("NodeChange",o)}}});i("tinymce/EditorCommands",["tinymce/html/Serializer","tinymce/Env","tinymce/util/Tools"],function(e,n,r){var i=r.each,s=r.extend;var o=r.map,u=r.inArray,a=r.explode;var f=n.gecko,l=n.ie;var c=true,h=false;return function(r){function b(e,t,n){var r;e=e.toLowerCase();if(r=v.exec[e]){r(e,t,n);return c}return h}function w(e){var t;e=e.toLowerCase();if(t=v.state[e]){return t(e)}return-1}function E(e){var t;e=e.toLowerCase();if(t=v.value[e]){return t(e)}return h}function S(e,t){t=t||"exec";i(e,function(e,n){i(n.toLowerCase().split(","),function(n){v[t][n]=e})})}function x(e,n,i){if(n===t){n=h}if(i===t){i=null}return r.getDoc().execCommand(e,n,i)}function T(e){return g.match(e)}function N(e,n){g.toggle(e,n?{value:n}:t);r.nodeChanged()}function C(e){y=d.getBookmark(e)}function k(){d.moveToBookmark(y)}var p=r.dom,d=r.selection,v={state:{},exec:{},value:{}},m=r.settings,g=r.formatter,y;s(this,{execCommand:b,queryCommandState:w,queryCommandValue:E,addCommands:S});S({"mceResetDesignMode,mceBeginUndoLevel":function(){},"mceEndUndoLevel,mceAddUndoLevel":function(){r.undoManager.add()},"Cut,Copy,Paste":function(e){var t=r.getDoc(),i;try{x(e)}catch(s){i=c}if(i||!t.queryCommandSupported(e)){var o=r.translate("Your browser doesn't support direct access to the clipboard. "+"Please use the Ctrl+X/C/V keyboard shortcuts instead.");if(n.mac){o=o.replace(/Ctrl\+/g,"⌘+")}r.windowManager.alert(o)}},unlink:function(){if(d.isCollapsed()){var e=d.getNode();if(e.tagName=="A"){r.dom.remove(e,true)}return}g.remove("link")},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(e){var t=e.substring(7);if(t=="full"){t="justify"}i("left,center,right,justify".split(","),function(e){if(t!=e){g.remove("align"+e)}});N("align"+t);b("mceRepaint")},"InsertUnorderedList,InsertOrderedList":function(e){var t,n;x(e);t=p.getParent(d.getNode(),"ol,ul");if(t){n=t.parentNode;if(/^(H[1-6]|P|ADDRESS|PRE)$/.test(n.nodeName)){C();p.split(n,t);k()}}},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){N(e)},"ForeColor,HiliteColor,FontName":function(e,t,n){N(e,n)},FontSize:function(e,t,n){var r,i;if(n>=1&&n<=7){i=a(m.font_size_style_values);r=a(m.font_size_classes);if(r){n=r[n-1]||n}else{n=i[n-1]||n}}N(e,n)},RemoveFormat:function(e){g.remove(e)},mceBlockQuote:function(){N("blockquote")},FormatBlock:function(e,t,n){return N(n||"p")},mceCleanup:function(){var e=d.getBookmark();r.setContent(r.getContent({cleanup:c}),{cleanup:c});d.moveToBookmark(e)},mceRemoveNode:function(e,t,n){var i=n||d.getNode();if(i!=r.getBody()){C();r.dom.remove(i,c);k()}},mceSelectNodeDepth:function(e,t,n){var i=0;p.getParent(d.getNode(),function(e){if(e.nodeType==1&&i++==n){d.select(e);return h}},r.getBody())},mceSelectNode:function(e,t,n){d.select(n)},mceInsertContent:function(t,n,i){function b(e){function i(e){return n[e]&&n[e].nodeType==3}var t,n,r;t=d.getRng(true);n=t.startContainer;r=t.startOffset;if(n.nodeType==3){if(r>0){e=e.replace(/^ /," ")}else if(!i("previousSibling")){e=e.replace(/^ /," ")}if(r|)$/," ")}else if(!i("nextSibling")){e=e.replace(/( | )(
|)$/," ")}}return e}var s,o,u,a,f,c;var h,v,m,g,y;if(/^ | $/.test(i)){i=b(i)}s=r.parser;o=new e({},r.schema);y='ÈB;';c={content:i,format:"html",selection:true};r.fire("BeforeSetContent",c);i=c.content;if(i.indexOf("{$caret}")==-1){i+="{$caret}"}i=i.replace(/\{\$caret\}/,y);v=d.getRng();var w=v.startContainer||(v.parentElement?v.parentElement():null);var E=r.getBody();if(w===E&&d.isCollapsed()){if(p.isBlock(E.firstChild)&&p.isEmpty(E.firstChild)){v=p.createRng();v.setStart(E.firstChild,0);v.setEnd(E.firstChild,0);d.setRng(v)}}if(!d.isCollapsed()){r.getDoc().execCommand("Delete",false,null)}u=d.getNode();var S={context:u.nodeName.toLowerCase()};f=s.parse(i,S);m=f.lastChild;if(m.attr("id")=="mce_marker"){h=m;for(m=m.prev;m;m=m.walk(true)){if(m.type==3||!p.isBlock(m.name)){m.parent.insert(h,m,m.name==="br");break}}}if(!S.invalid){i=o.serialize(f);m=u.firstChild;g=u.lastChild;if(!m||m===g&&m.nodeName==="BR"){p.setHTML(u,i)}else{d.setContent(i)}}else{d.setContent(y);u=d.getNode();a=r.getBody();if(u.nodeType==9){u=m=a}else{m=u}while(m!==a){u=m;m=m.parentNode}i=u==a?a.innerHTML:p.getOuterHTML(u);i=o.serialize(s.parse(i.replace(//i,function(){return o.serialize(f)})));if(u==a){p.setHTML(a,i)}else{p.setOuterHTML(u,i)}}h=p.get("mce_marker");d.scrollIntoView(h);v=p.createRng();m=h.previousSibling;if(m&&m.nodeType==3){v.setStart(m,m.nodeValue.length);if(!l){g=h.nextSibling;if(g&&g.nodeType==3){m.appendData(g.data);g.parentNode.removeChild(g)}}}else{v.setStartBefore(h);v.setEndBefore(h)}p.remove(h);d.setRng(v);r.fire("SetContent",c);r.addVisual()},mceInsertRawHTML:function(e,t,n){d.setContent("tiny_mce_marker");r.setContent(r.getContent().replace(/tiny_mce_marker/g,function(){return n}))},mceToggleFormat:function(e,t,n){N(n)},mceSetContent:function(e,t,n){r.setContent(n)},"Indent,Outdent":function(e){var t,n,s;t=m.indentation;n=/[a-z%]+$/i.exec(t);t=parseInt(t,10);if(!w("InsertUnorderedList")&&!w("InsertOrderedList")){if(!m.forced_root_block&&!p.getParent(d.getNode(),p.isBlock)){g.apply("div")}i(d.getSelectedBlocks(),function(i){if(i.nodeName!="LI"){var o=r.getParam("indent_use_margin",false)?"margin":"padding";o+=p.getStyle(i,"direction",true)=="rtl"?"Right":"Left";if(e=="outdent"){s=Math.max(0,parseInt(i.style[o]||0,10)-t);p.setStyle(i,o,s?s+n:"")}else{s=parseInt(i.style[o]||0,10)+t+n;p.setStyle(i,o,s)}}})}else{x(e)}},mceRepaint:function(){if(f){try{C(c);if(d.getSel()){d.getSel().selectAllChildren(r.getBody())}d.collapse(c);k()}catch(e){}}},InsertHorizontalRule:function(){r.execCommand("mceInsertContent",false,"
")},mceToggleVisualAid:function(){r.hasVisual=!r.hasVisual;r.addVisual()},mceReplaceContent:function(e,t,n){r.execCommand("mceInsertContent",false,n.replace(/\{\$selection\}/g,d.getContent({format:"text"})))},mceInsertLink:function(e,t,n){var r;if(typeof n=="string"){n={href:n}}r=p.getParent(d.getNode(),"a");n.href=n.href.replace(" ","%20");if(!r||!n.href){g.remove("link")}if(n.href){g.apply("link",n,r)}},selectAll:function(){var e=p.getRoot(),t;if(d.getRng().setStart){t=p.createRng();t.setStart(e,0);t.setEnd(e,e.childNodes.length);d.setRng(t)}else{t=d.getRng();if(!t.item){t.moveToElementText(e);t.select()}}},"delete":function(){x("Delete");var e=r.getBody();if(p.isEmpty(e)){r.setContent("");if(e.firstChild&&p.isBlock(e.firstChild)){r.selection.setCursorLocation(e.firstChild,0)}else{r.selection.setCursorLocation(e,0)}}},mceNewDocument:function(){r.setContent("")}});S({"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(e){var t="align"+e.substring(7);var n=d.isCollapsed()?[p.getParent(d.getNode(),p.isBlock)]:d.getSelectedBlocks();var r=o(n,function(e){return!!g.matchNode(e,t)});return u(r,c)!==-1},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){return T(e)},mceBlockQuote:function(){return T("blockquote")},Outdent:function(){var e;if(m.inline_styles){if((e=p.getParent(d.getStart(),p.isBlock))&&parseInt(e.style.paddingLeft,10)>0){return c}if((e=p.getParent(d.getEnd(),p.isBlock))&&parseInt(e.style.paddingLeft,10)>0){return c}}return w("InsertUnorderedList")||w("InsertOrderedList")||!m.inline_styles&&!!p.getParent(d.getNode(),"BLOCKQUOTE")},"InsertUnorderedList,InsertOrderedList":function(e){var t=p.getParent(d.getNode(),"ul,ol");return t&&(e==="insertunorderedlist"&&t.tagName==="UL"||e==="insertorderedlist"&&t.tagName==="OL")}},"state");S({"FontSize,FontName":function(e){var t=0,n;if(n=p.getParent(d.getNode(),"span")){if(e=="fontsize"){t=n.style.fontSize}else{t=n.style.fontFamily.replace(/, /g,",").replace(/[\'\"]/g,"").toLowerCase()}}return t}},"value");S({Undo:function(){r.undoManager.undo()},Redo:function(){r.undoManager.redo()}})}});i("tinymce/util/URI",["tinymce/util/Tools"],function(e){function r(e,i){var s=this,o,u;e=n(e);i=s.settings=i||{};if(/^([\w\-]+):([^\/]{2})/i.test(e)||/^\s*#/.test(e)){s.source=e;return}var a=e.indexOf("//")===0;if(e.indexOf("/")===0&&!a){e=(i.base_uri?i.base_uri.protocol||"http":"http")+"://mce_host"+e}if(!/^[\w\-]*:?\/\//.test(e)){u=i.base_uri?i.base_uri.path:(new r(location.href)).directory;if(i.base_uri.protocol===""){e="//mce_host"+s.toAbsPath(u,e)}else{e=(i.base_uri&&i.base_uri.protocol||"http")+"://mce_host"+s.toAbsPath(u,e)}}e=e.replace(/@@/g,"(mce_at)");e=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(e);t(["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],function(t,n){var r=e[n];if(r){r=r.replace(/\(mce_at\)/g,"@@")}s[t]=r});o=i.base_uri;if(o){if(!s.protocol){s.protocol=o.protocol}if(!s.userInfo){s.userInfo=o.userInfo}if(!s.port&&s.host==="mce_host"){s.port=o.port}if(!s.host||s.host==="mce_host"){s.host=o.host}s.source=""}if(a){s.protocol=""}}var t=e.each,n=e.trim;r.prototype={setPath:function(e){var t=this;e=/^(.*?)\/?(\w+)?$/.exec(e);t.path=e[0];t.directory=e[1];t.file=e[2];t.source="";t.getURI()},toRelative:function(e){var t=this,n;if(e==="./"){return e}e=new r(e,{base_uri:t});if(e.host!="mce_host"&&t.host!=e.host&&e.host||t.port!=e.port||t.protocol!=e.protocol&&e.protocol!==""){return e.getURI()}var i=t.getURI(),s=e.getURI();if(i==s||i.charAt(i.length-1)=="/"&&i.substr(0,i.length-1)==s){return i}n=t.toRelPath(t.path,e.path);if(e.query){n+="?"+e.query}if(e.anchor){n+="#"+e.anchor}return n},toAbsolute:function(e,t){e=new r(e,{base_uri:this});return e.getURI(this.host==e.host&&this.protocol==e.protocol?t:0)},toRelPath:function(e,t){var n,r=0,i="",s,o;e=e.substring(0,e.lastIndexOf("/"));e=e.split("/");n=t.split("/");if(e.length>=n.length){for(s=0,o=e.length;s=n.length||e[s]!=n[s]){r=s+1;break}}}if(e.length=e.length||e[s]!=n[s]){r=s+1;break}}}if(r===1){return t}for(s=0,o=e.length-(r-1);s=0;r--){if(n[r].length===0||n[r]==="."){continue}if(n[r]===".."){i++;continue}if(i>0){i--;continue}s.push(n[r])}r=e.length-i;if(r<=0){u=s.reverse().join("/")}else{u=e.slice(0,r).join("/")+"/"+s.reverse().join("/")}if(u.indexOf("/")!==0){u="/"+u}if(o&&u.lastIndexOf("/")!==u.length-1){u+=o}return u},getURI:function(e){var t,n=this;if(!n.source||e){t="";if(!e){if(n.protocol){t+=n.protocol+"://"}else{t+="//"}if(n.userInfo){t+=n.userInfo+"@"}if(n.host){t+=n.host}if(n.port){t+=":"+n.port}}if(n.path){t+=n.path}if(n.query){t+="?"+n.query}if(n.anchor){t+="#"+n.anchor}n.source=t}return n.source}};return r});i("tinymce/util/Class",["tinymce/util/Tools"],function(e){function s(){}var t=e.each,n=e.extend;var r,i;s.extend=r=function(e){function l(){var e,t,n,r;if(!i){r=this;if(r.init){r.init.apply(r,arguments)}t=r.Mixins;if(t){e=t.length;while(e--){n=t[e];if(n.init){n.init.apply(r,arguments)}}}}}function c(){return this}function h(e,t){return function(){var n=this,r=n._super,i;n._super=o[e];i=t.apply(n,arguments);n._super=r;return i}}var s=this,o=s.prototype,u,a,f;i=true;u=new s;i=false;if(e.Mixins){t(e.Mixins,function(t){t=t;for(var n in t){if(n!=="init"){e[n]=t[n]}}});if(o.Mixins){e.Mixins=o.Mixins.concat(e.Mixins)}}if(e.Methods){t(e.Methods.split(","),function(t){e[t]=c})}if(e.Properties){t(e.Properties.split(","),function(t){var n="_"+t;e[t]=function(e){var t=this,r;if(e!==r){t[n]=e;return t}return t[n]}})}if(e.Statics){t(e.Statics,function(e,t){l[t]=e})}if(e.Defaults&&o.Defaults){e.Defaults=n({},o.Defaults,e.Defaults)}for(a in e){f=e[a];if(typeof f=="function"&&o[a]){u[a]=h(a,f)}else{u[a]=f}}l.prototype=u;l.constructor=l;l.extend=r;return l};return s});i("tinymce/ui/Selector",["tinymce/util/Class"],function(e){"use strict";function t(e){var t=[],n=e.length,r;while(n--){r=e[n];if(!r.__checked){t.push(r);r.__checked=1}}n=t.length;while(n--){delete t[n].__checked}return t}var n=/^([\w\\*]+)?(?:#([\w\\]+))?(?:\.([\w\\\.]+))?(?:\[\@?([\w\\]+)([\^\$\*!~]?=)([\w\\]+)\])?(?:\:(.+))?/i;var r=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,i=/^\s*|\s*$/g,s;var o=e.extend({init:function(e){function s(e){if(e){e=e.toLowerCase();return function(t){return e==="*"||t.type===e}}}function o(e){if(e){return function(t){return t._name===e}}}function u(e){if(e){e=e.split(".");return function(t){var n=e.length;while(n--){if(!t.hasClass(e[n])){return false}}return true}}}function a(e,t,n){if(e){return function(r){var i=r[e]?r[e]():"";return!t?!!n:t==="="?i===n:t==="*="?i.indexOf(n)>=0:t==="~="?(" "+i+" ").indexOf(" "+n+" ")>=0:t==="!="?i!=n:t==="^="?i.indexOf(n)===0:t==="$="?i.substr(i.length-n.length)===n:false}}}function f(e){var n;if(e){e=/(?:not\((.+)\))|(.+)/i.exec(e);if(!e[1]){e=e[2];return function(t,n,r){return e==="first"?n===0:e==="last"?n===r-1:e==="even"?n%2===0:e==="odd"?n%2===1:t[e]?t[e]():false}}else{n=c(e[1],[]);return function(e){return!t(e,n)}}}}function l(e,t,r){function c(e){if(e){t.push(e)}}var l;l=n.exec(e.replace(i,""));c(s(l[1]));c(o(l[2]));c(u(l[3]));c(a(l[4],l[5],l[6]));c(f(l[7]));t.psuedo=!!l[7];t.direct=r;return t}function c(e,t){var n=[],i,s,o;do{r.exec("");s=r.exec(e);if(s){e=s[3];n.push(s[1]);if(s[2]){i=s[3];break}}}while(s);if(i){c(i,t)}e=[];for(o=0;o"){e.push(l(n[o],[],n[o-1]===">"))}}t.push(e);return t}var t=this.match;this._selectors=c(e,[])},match:function(e,t){var n,r,i,s,o,u,a,f,l,c,h,p,d;t=t||this._selectors;for(n=0,r=t.length;n=0;i--){f=o[i];while(d){if(f.psuedo){h=d.parent().items();l=c=h.length;while(l--){if(h[l]===d){break}}}for(u=0,a=f.length;u1){n=t(n)}}if(!s){s=o.Collection}return new s(n)}});return o});i("tinymce/ui/Collection",["tinymce/util/Tools","tinymce/ui/Selector","tinymce/util/Class"],function(e,t,n){"use strict";var r,i,s=Array.prototype.push,o=Array.prototype.slice;i={length:0,init:function(e){if(e){this.add(e)}},add:function(t){var n=this;if(!e.isArray(t)){if(t instanceof r){n.add(t.toArray())}else{s.call(n,t)}}else{s.apply(n,t)}return n},set:function(e){var t=this,n=t.length,r;t.length=0;t.add(e);for(r=t.length;rn.maxW?n.maxW:i;n.w=i;n.innerW=i-s}i=e.h;if(i!==u){i=in.maxH?n.maxH:i;n.h=i;n.innerH=i-o}i=e.innerW;if(i!==u){i=in.maxW-s?n.maxW-s:i;n.innerW=i;n.w=i+s}i=e.innerH;if(i!==u){i=in.maxH-o?n.maxH-o:i;n.innerH=i;n.h=i+o}if(e.contentW!==u){n.contentW=e.contentW}if(e.contentH!==u){n.contentH=e.contentH}r=t._lastLayoutRect;if(r.x!==n.x||r.y!==n.y||r.w!==n.w||r.h!==n.h){f=a.repaintControls;if(f){if(f.map&&!f.map[t._id]){f.push(t);f.map[t._id]=true}}r.x=n.x;r.y=n.y;r.w=n.w;r.h=n.h}return t}return n},repaint:function(){var e=this,t,n,r,i,s=0,o=0,u,a;a=!document.createRange?Math.round:function(e){return e};t=e.getEl().style;r=e._layoutRect;u=e._lastRepaintRect||{};i=e._borderBox;s=i.left+i.right;o=i.top+i.bottom;if(r.x!==u.x){t.left=a(r.x)+"px";u.x=r.x}if(r.y!==u.y){t.top=a(r.y)+"px";u.y=r.y}if(r.w!==u.w){t.width=a(r.w-s)+"px";u.w=r.w}if(r.h!==u.h){t.height=a(r.h-o)+"px";u.h=r.h}if(e._hasBody&&r.innerW!==u.innerW){n=e.getEl("body").style;n.width=a(r.innerW)+"px";u.innerW=r.innerW}if(e._hasBody&&r.innerH!==u.innerH){n=n||e.getEl("body").style;n.height=a(r.innerH)+"px";u.innerH=r.innerH}e._lastRepaintRect=u;e.fire("repaint",{},false)},on:function(e,t){function a(e){var t,r;return function(i){if(!t){n.parents().each(function(n){var i=n.settings.callbacks;if(i&&(t=i[e])){r=n;return false}})}return t.call(r,i)}}var n=this,r,s,o,u;if(t){if(typeof t=="string"){t=a(t)}o=e.toLowerCase().split(" ");u=o.length;while(u--){e=o[u];r=n._bindings;if(!r){r=n._bindings={}}s=r[e];if(!s){s=r[e]=[]}s.push(t);if(i[e]){if(!n._nativeEvents){n._nativeEvents={name:true}}else{n._nativeEvents[e]=true}if(n._rendered){n.bindPendingEvents()}}}}return n},off:function(e,t){var n=this,r,i=n._bindings,s,o,u,a;if(i){if(e){u=e.toLowerCase().split(" ");r=u.length;while(r--){e=u[r];s=i[e];if(!e){for(o in i){i[o].length=0}return n}if(s){if(!t){s.length=0}else{a=s.length;while(a--){if(s[a]===t){s.splice(a,1)}}}}}}else{n._bindings=[]}}return n},fire:function(e,t,n){function a(){return false}function f(){return true}var r=this,i,s,o,u;e=e.toLowerCase();t=t||{};if(!t.type){t.type=e}if(!t.control){t.control=r}if(!t.preventDefault){t.preventDefault=function(){t.isDefaultPrevented=f};t.stopPropagation=function(){t.isPropagationStopped=f};t.stopImmediatePropagation=function(){t.isImmediatePropagationStopped=f};t.isDefaultPrevented=a;t.isPropagationStopped=a;t.isImmediatePropagationStopped=a}if(r._bindings){o=r._bindings[e];if(o){for(i=0,s=o.length;i"]/g,function(e){return"&#"+e.charCodeAt(0)+";"})},before:function(e){var t=this,n=t.parent();if(n){n.insert(e,n.items().indexOf(t),true)}return t},after:function(e){var t=this,n=t.parent();if(n){n.insert(e,n.items().indexOf(t))}return t},remove:function(){var e=this,t=e.getEl(),n=e.parent(),i,o;if(e.items){var u=e.items().toArray();o=u.length;while(o--){u[o].remove()}}if(n&&n.items){i=[];n.items().each(function(t){if(t!==e){i.push(t)}});n.items().set(i);n._lastRect=null}if(e._eventsRoot&&e._eventsRoot==e){r.off(t)}var a=e.getRoot().controlIdLookup;if(a){delete a[e._id]}delete s[e._id];if(t&&t.parentNode){var f=t.getElementsByTagName("*");o=f.length;while(o--){delete s[f[o].id]}t.parentNode.removeChild(t)}e._rendered=false;return e},renderBefore:function(e){var t=this;e.parentNode.insertBefore(r.createFragment(t.renderHtml()),e);t.postRender();return t},renderTo:function(e){var t=this;e=e||t.getContainerElm();e.appendChild(r.createFragment(t.renderHtml()));t.postRender();return t},postRender:function(){var e=this,t=e.settings,n,i,s,o,u;for(o in t){if(o.indexOf("on")===0){e.on(o.substr(2),t[o])}}if(e._eventsRoot){for(s=e.parent();!u&&s;s=s.parent()){u=s._eventsRoot}if(u){for(o in u._nativeEvents){e._nativeEvents[o]=true}}}e.bindPendingEvents();if(t.style){n=e.getEl();if(n){n.setAttribute("style",t.style);n.style.cssText=t.style}}if(!e._visible){r.css(e.getEl(),"display","none")}if(e.settings.border){i=e.borderBox();r.css(e.getEl(),{"border-top-width":i.top,"border-right-width":i.right,"border-bottom-width":i.bottom,"border-left-width":i.left})}var a=e.getRoot();if(!a.controlIdLookup){a.controlIdLookup={}}a.controlIdLookup[e._id]=e;for(var f in e._aria){e.aria(f,e._aria[f])}e.fire("postrender",{},false)},scrollIntoView:function(e){function t(e,t){var n,r,i=e;n=r=0;while(i&&i!=t&&i.nodeType){n+=i.offsetLeft||0;r+=i.offsetTop||0;i=i.offsetParent}return{x:n,y:r}}var n=this.getEl(),r=n.parentNode;var i,s,o,u,a,f;var l=t(n,r);i=l.x;s=l.y;o=n.offsetWidth;u=n.offsetHeight;a=r.clientWidth;f=r.clientHeight;if(e=="end"){i-=a-o;s-=f-u}else if(e=="center"){i-=a/2-o/2;s-=f/2-u/2}r.scrollLeft=i;r.scrollTop=s;return this},bindPendingEvents:function(){function l(t){var n=e.getParentCtrl(t.target);if(n){n.fire(t.type,t)}}function c(){var e=s._lastHoverCtrl;if(e){e.fire("mouseleave",{target:e.getEl()});e.parents().each(function(e){e.fire("mouseleave",{target:e.getEl()})});s._lastHoverCtrl=null}}function h(t){var n=e.getParentCtrl(t.target),r=s._lastHoverCtrl,i=0,o,u,a;if(n!==r){s._lastHoverCtrl=n;u=n.parents().toArray().reverse();u.push(n);if(r){a=r.parents().toArray().reverse();a.push(r);for(i=0;i=i;o--){r=a[o];r.fire("mouseleave",{target:r.getEl()})}}for(o=i;o=0){n=t.getEl();if(n){n.parentNode.removeChild(n)}n=e.getEl();if(n){n.parentNode.removeChild(n)}}t.parent(this)},create:function(t){var n=this,s,o=[];if(!i.isArray(t)){t=[t]}i.each(t,function(t){if(t){if(!(t instanceof e)){if(typeof t=="string"){t={type:t}}s=i.extend({},n.settings.defaults,t);t.type=s.type=s.type||t.type||n.settings.defaultType||(s.defaults?s.defaults.type:null);t=r.create(s)}o.push(t)}});return o},renderNew:function(){var e=this;e.items().each(function(t,n){var r,i;t.parent(e);if(!t._rendered){r=e.getEl("body");i=s.createFragment(t.renderHtml());if(r.hasChildNodes()&&n<=r.childNodes.length-1){r.insertBefore(i,r.childNodes[n])}else{r.appendChild(i)}t.postRender()}});e._layout.applyClasses(e);e._lastRect=null;return e},append:function(e){return this.add(e).renderNew()},prepend:function(e){var t=this;t.items().set(t.create(e).concat(t.items().toArray()));return t.renderNew()},insert:function(e,t,n){var r=this,i,s,o;e=r.create(e);i=r.items();if(!n&&t=0&&t"+'
'+(e.settings.html||"")+t.renderHtml(e)+"
"+""},postRender:function(){var e=this,t;e.items().exec("postRender");e._super();e._layout.postRender(e);e._rendered=true;if(e.settings.style){s.css(e.getEl(),e.settings.style)}if(e.settings.border){t=e.borderBox();s.css(e.getEl(),{"border-top-width":t.top,"border-right-width":t.right,"border-bottom-width":t.bottom,"border-left-width":t.left})}return e},initLayoutRect:function(){var e=this,t=e._super();e._layout.recalc(e);return t},recalc:function(){var e=this,t=e._layoutRect,n=e._lastRect;if(!n||n.w!=t.w||n.h!=t.h){e._layout.recalc(e);t=e.layoutRect();e._lastRect={x:t.x,y:t.y,w:t.w,h:t.h};return true}},reflow:function(){var t,n;if(this.visible()){e.repaintControls=[];e.repaintControls.map={};n=this.recalc();t=e.repaintControls.length;while(t--){e.repaintControls[t].repaint()}if(this.settings.layout!=="flow"&&this.settings.layout!=="stack"){this.repaint()}e.repaintControls=[]}return this}})});i("tinymce/ui/DragHelper",["tinymce/ui/DomUtils"],function(e){"use strict";function t(){var e=document,t,n,r,i;var s,o,u,a,f=Math.max;t=e.documentElement;n=e.body;r=f(t.scrollWidth,n.scrollWidth);i=f(t.clientWidth,n.clientWidth);s=f(t.offsetWidth,n.offsetWidth);o=f(t.scrollHeight,n.scrollHeight);u=f(t.clientHeight,n.clientHeight);a=f(t.offsetHeight,n.offsetHeight);return{width:rs.clientWidth;i=s.scrollHeight>s.clientHeight;o("h","Left","Width","contentW",t,"Height");o("v","Top","Height","contentH",i,"Width")}function s(){function i(i,s,o,u,a){var f,l=n._id+"-scroll"+i,c=n.classPrefix;n.getEl().appendChild(e.createFragment('
'+'
'+"
"));n.draghelper=new t(l+"t",{start:function(){f=n.getEl("body")["scroll"+s];e.addClass(e.get(l),c+"active")},drag:function(e){var t,l,c,h,p=n.layoutRect();l=p.contentW>p.innerW;c=p.contentH>p.innerH;h=n.getEl("body")["client"+o]-r*2;h-=l&&c?n.getEl("scroll"+i)["client"+a]:0;t=h/n.getEl("body")["scroll"+o];n.getEl("body")["scroll"+s]=f+e["delta"+u]/t},stop:function(){e.removeClass(e.get(l),c+"active")}})}n.addClass("scroll");i("v","Top","Height","Y","Width");i("h","Left","Width","X","Height")}var n=this,r=2;if(n.settings.autoScroll){if(!n._hasScroll){n._hasScroll=true;s();n.on("wheel",function(e){var t=n.getEl("body");t.scrollLeft+=(e.deltaX||0)*10;t.scrollTop+=e.deltaY*10;i()});e.on(n.getEl("body"),"scroll",i)}i()}}}});i("tinymce/ui/Panel",["tinymce/ui/Container","tinymce/ui/Scrollable"],function(e,t){"use strict";return e.extend({Defaults:{layout:"fit",containerCls:"panel"},Mixins:[t],renderHtml:function(){var e=this,t=e._layout,n=e.settings.html;e.preRender();t.preRender(e);if(typeof n=="undefined"){n='
'+t.renderHtml(e)+"
"}else{if(typeof n=="function"){n=n.call(e)}e._hasBody=false}return'
'+(e._preBodyHtml||"")+n+"
"}})});i("tinymce/ui/Movable",["tinymce/ui/DomUtils"],function(e){"use strict";function t(t,n,r){var i,s,o,u,a,f,l,c,h,p;h=e.getViewPort();s=e.getPos(n);o=s.x;u=s.y;if(t._fixed){o-=h.x;u-=h.y}i=t.getEl();p=e.getSize(i);a=p.width;f=p.height;p=e.getSize(n);l=p.width;c=p.height;r=(r||"").split("");if(r[0]==="b"){u+=c}if(r[1]==="r"){o+=l}if(r[0]==="c"){u+=Math.round(c/2)}if(r[1]==="c"){o+=Math.round(l/2)}if(r[3]==="b"){u-=f}if(r[4]==="r"){o-=a}if(r[3]==="c"){u-=Math.round(f/2)}if(r[4]==="c"){o-=Math.round(a/2)}return{x:o,y:u,w:a,h:f}}return{testMoveRel:function(n,r){var i=e.getViewPort();for(var s=0;s0&&o.x+o.w0&&o.y+o.hi.x&&o.x+o.wi.y&&o.y+o.ht){e=t-n;return e<0?0:e}return e}var r=this;if(r.settings.constrainToViewport){var s=e.getViewPort(window);var o=r.layoutRect();t=i(t,s.w+s.x,o.w);n=i(n,s.h+s.y,o.h)}if(r._rendered){r.layoutRect({x:t,y:n}).repaint()}else{r.settings.x=t;r.settings.y=n}r.fire("move",{x:t,y:n});return r}}});i("tinymce/ui/Resizable",["tinymce/ui/DomUtils"],function(e){"use strict";return{resizeToContent:function(){this._layoutRect.autoResize=true;this._lastRect=null;this.reflow()},resizeTo:function(t,n){if(t<=1||n<=1){var r=e.getWindowSize();t=t<=1?t*r.w:t;n=n<=1?n*r.h:n}this._layoutRect.autoResize=false;return this.layoutRect({minW:t,minH:n,w:t,h:n}).reflow()},resizeBy:function(e,t){var n=this,r=n.layoutRect();return n.resizeTo(r.w+e,r.h+t)}}});i("tinymce/ui/FloatPanel",["tinymce/ui/Panel","tinymce/ui/Movable","tinymce/ui/Resizable","tinymce/ui/DomUtils"],function(e,t,n,r){"use strict";function l(e){var t;t=o.length;while(t--){if(o[t]===e){o.splice(t,1)}}t=u.length;while(t--){if(u[t]===e){u.splice(t,1)}}}var i,s,o=[];var u=[],a;var f=e.extend({Mixins:[t,n],init:function(e){function n(){var e,n=f.zIndex||65535,i;if(u.length){for(e=0;et){e.fixed(false).layoutRect({y:e._autoFixY}).repaint();n(false,e._autoFixY-t)}}}}var t=this;t._super(e);t._eventsRoot=t;t.addClass("floatpanel");if(e.autohide){if(!i){i=function(e){var t=o.length;while(t--){var n=o[t],r=n.getParentCtrl(e.target);if(n.settings.autohide){if(r){if(l(r,n)||n.parent()===r){continue}}e=n.fire("autohide",{target:e.target});if(!e.isDefaultPrevented()){n.hide()}}}};r.on(document,"click",i)}o.push(t)}if(e.autofix){if(!s){s=function(){var e;e=o.length;while(e--){c(o[e])}};r.on(window,"scroll",s)}t.on("move",function(){c(this)})}t.on("postrender show",function(e){if(e.control==t){var i,s=t.classPrefix;if(t.modal&&!a){i=r.createFragment('
');i=i.firstChild;t.getContainerElm().appendChild(i);setTimeout(function(){r.addClass(i,s+"in");r.addClass(t.getEl(),s+"in")},0);a=true}u.push(t);n()}});t.on("close hide",function(e){if(e.control==t){var r=u.length;while(r--){if(u[r]===t){u.splice(r,1)}}n()}});t.on("show",function(){t.parents().each(function(e){if(e._fixed){t.fixed(true);return false}})});if(e.popover){t._preBodyHtml='
';t.addClass("popover").addClass("bottom").addClass(t.isRtl()?"end":"start")}},fixed:function(e){var t=this;if(t._fixed!=e){if(t._rendered){var n=r.getViewPort();if(e){t.layoutRect().y-=n.y}else{t.layoutRect().y+=n.y}}t.toggleClass("fixed",e);t._fixed=e}return t},show:function(){var e=this,t,n=e._super();t=o.length;while(t--){if(o[t]===e){break}}if(t===-1){o.push(e)}return n},hide:function(){l(this);return this._super()},hideAll:function(){f.hideAll()},close:function(){var e=this;e.fire("close");return e.remove()},remove:function(){l(this);this._super()}});f.hideAll=function(){var e=o.length;while(e--){var t=o[e];if(t.settings.autohide){t.fire("cancel",{},false);t.hide();o.splice(e,1)}}};return f});i("tinymce/ui/KeyboardNavigation",["tinymce/ui/DomUtils"],function(e){"use strict";return function(t){function u(){if(!s){s=[];if(n.find){n.find("*").each(function(e){if(e.canFocus){s.push(e.getEl())}})}else{var e=n.getEl().getElementsByTagName("*");for(var t=0;t=f.length){r=0}i=f[r];i.focus();o=i.id;if(t.actOnFocus){h()}}function v(){var e,n;n=f(t.root.getEl());u();e=s.length;while(e--){if(n=="toolbar"&&s[e].id===o){s[e].focus();return}}s[0].focus()}var n=t.root,r=t.enableUpDown!==false;var i=t.enableLeftRight!==false;var s=t.items,o;n.on("keydown",function(e){var n=37,s=39,o=38,u=40;var a=27,v=14,m=13,g=32,y=9;var b;switch(e.keyCode){case n:if(i){if(t.leftAction){t.leftAction()}else{d(-1)}b=true}break;case s:if(i){if(f()=="menuitem"&&l()=="menu"){if(c("haspopup")){h()}}else{d(1)}b=true}break;case o:if(r){d(-1);b=true}break;case u:if(r){if(f()=="menuitem"&&l()=="menubar"){h()}else if(f()=="button"&&c("haspopup")){h()}else{d(1)}b=true}break;case y:b=true;if(e.shiftKey){d(-1)}else{d(1)}break;case a:b=true;p();break;case v:case m:case g:b=h();break}if(b){e.stopPropagation();e.preventDefault()}});n.on("focusin",function(e){u();o=e.target.id});return{moveFocus:d,focusFirst:v,cancel:p}}});i("tinymce/ui/Window",["tinymce/ui/FloatPanel","tinymce/ui/Panel","tinymce/ui/DomUtils","tinymce/ui/KeyboardNavigation","tinymce/ui/DragHelper"],function(e,t,n,r,i){"use strict";var s=e.extend({modal:true,Defaults:{border:1,layout:"flex",containerCls:"panel",role:"dialog",callbacks:{submit:function(){this.fire("submit",{data:this.toJSON()})},close:function(){this.close()}}},init:function(e){var n=this;n._super(e);if(n.isRtl()){n.addClass("rtl")}n.addClass("window");n._fixed=true;if(e.buttons){n.statusbar=new t({layout:"flex",border:"1 0 0 0",spacing:3,padding:10,align:"center",pack:n.isRtl()?"start":"end",defaults:{type:"button"},items:e.buttons});n.statusbar.addClass("foot");n.statusbar.parent(n)}n.on("click",function(e){if(e.target.className.indexOf(n.classPrefix+"close")!=-1){n.close()}});n.aria("label",e.title);n._fullscreen=false},recalc:function(){var e=this,t=e.statusbar,r,i,s,o;if(e._fullscreen){e.layoutRect(n.getWindowSize());e.layoutRect().contentH=e.layoutRect().innerH}e._super();r=e.layoutRect();if(e.settings.title&&!e._fullscreen){i=r.headerW;if(i>r.w){s=r.x-Math.max(0,i/2);e.layoutRect({w:i,x:s});o=true}}if(t){t.layoutRect({w:e.layoutRect().innerW}).recalc();i=t.layoutRect().minW+r.deltaW;if(i>r.w){s=r.x-Math.max(0,i-r.w);e.layoutRect({w:i,x:s});o=true}}if(o){e.recalc()}},initLayoutRect:function(){var e=this,t=e._super(),r=0,i;if(e.settings.title&&!e._fullscreen){i=e.getEl("head");var s=n.getSize(i);t.headerW=s.width;t.headerH=s.height;r+=t.headerH}if(e.statusbar){r+=e.statusbar.layoutRect().h}t.deltaH+=r;t.minH+=r;t.h+=r;var o=n.getWindowSize();t.x=Math.max(0,o.w/2-t.w/2);t.y=Math.max(0,o.h/2-t.h/2);return t},renderHtml:function(){var e=this,t=e._layout,n=e._id,r=e.classPrefix;var i=e.settings,s="",o="",u=i.html;e.preRender();t.preRender(e);if(i.title){s='
'+'
'+e.encode(i.title)+"
"+''+'
'+"
"}if(i.url){u=''}if(typeof u=="undefined"){u=t.renderHtml(e)}if(e.statusbar){o=e.statusbar.renderHtml()}return'
'+s+'
'+u+"
"+o+"
"},fullscreen:function(e){var t=this,r=document.documentElement,i,s=t.classPrefix,o;if(e!=t._fullscreen){n.on(window,"resize",function(){var e;if(t._fullscreen){if(!i){e=(new Date).getTime();var r=n.getWindowSize();t.moveTo(0,0).resizeTo(r.w,r.h);if((new Date).getTime()-e>50){i=true}}else{if(!t._timer){t._timer=setTimeout(function(){var e=n.getWindowSize();t.moveTo(0,0).resizeTo(e.w,e.h);t._timer=0},50)}}}});o=t.layoutRect();t._fullscreen=e;if(!e){t._borderBox=t.parseBox(t.settings.border);t.getEl("head").style.display="";o.deltaH+=o.headerH;n.removeClass(r,s+"fullscreen");n.removeClass(document.body,s+"fullscreen");t.removeClass("fullscreen");t.moveTo(t._initial.x,t._initial.y).resizeTo(t._initial.w,t._initial.h)}else{t._initial={x:o.x,y:o.y,w:o.w,h:o.h};t._borderBox=t.parseBox("0");t.getEl("head").style.display="none";o.deltaH-=o.headerH+2;n.addClass(r,s+"fullscreen");n.addClass(document.body,s+"fullscreen");t.addClass("fullscreen");var u=n.getWindowSize();t.moveTo(0,0).resizeTo(u.w,u.h)}}return t.reflow()},postRender:function(){var e=this,t=[],n,s,o;setTimeout(function(){e.addClass("in")},0);e.keyboardNavigation=new r({root:e,enableLeftRight:false,enableUpDown:false,items:t,onCancel:function(){e.close()}});e.find("*").each(function(e){if(e.canFocus){s=s||e.settings.autofocus;n=n||e;if(e.subinput){t.push(e.getEl("inp"));if(e.getEl("open")){t.push(e.getEl("open"))}}else{t.push(e.getEl())}}});if(e.statusbar){e.statusbar.find("*").each(function(e){if(e.canFocus){s=s||e.settings.autofocus;n=n||e;t.push(e.getEl())}})}e._super();if(e.statusbar){e.statusbar.postRender()}if(!s&&n){n.focus()}this.dragHelper=new i(e._id+"-dragh",{start:function(){o={x:e.layoutRect().x,y:e.layoutRect().y}},drag:function(t){e.moveTo(o.x+t.deltaX,o.y+t.deltaY)}});e.on("submit",function(t){if(!t.isDefaultPrevented()){e.close()}})},submit:function(){return this.fire("submit",{data:this.toJSON()})},remove:function(){var e=this,t=e.classPrefix;e.dragHelper.destroy();e._super();if(e.statusbar){this.statusbar.remove()}if(e._fullscreen){n.removeClass(document.documentElement,t+"fullscreen");n.removeClass(document.body,t+"fullscreen")}}});return s});i("tinymce/ui/MessageBox",["tinymce/ui/Window"],function(e){"use strict";var t=e.extend({init:function(e){e={border:1,padding:20,layout:"flex",pack:"center",align:"center",containerCls:"panel",autoScroll:true,buttons:{type:"button",text:"Ok",action:"ok"},items:{type:"label",multiline:true,maxWidth:500,maxHeight:200}};this._super(e)},Statics:{OK:1,OK_CANCEL:2,YES_NO:3,YES_NO_CANCEL:4,msgBox:function(n){var r,i=n.callback||function(){};switch(n.buttons){case t.OK_CANCEL:r=[{type:"button",text:"Ok",subtype:"primary",onClick:function(e){e.control.parents()[1].close();i(true)}},{type:"button",text:"Cancel",onClick:function(e){e.control.parents()[1].close();i(false)}}];break;case t.YES_NO:r=[{type:"button",text:"Ok",subtype:"primary",onClick:function(e){e.control.parents()[1].close();i(true)}}];break;case t.YES_NO_CANCEL:r=[{type:"button",text:"Ok",subtype:"primary",onClick:function(e){e.control.parents()[1].close()}}];break;default:r=[{type:"button",text:"Ok",subtype:"primary",onClick:function(e){e.control.parents()[1].close();i(true)}}];break}return(new e({padding:20,x:n.x,y:n.y,minWidth:300,minHeight:100,layout:"flex",pack:"center",align:"center",buttons:r,title:n.title,items:{type:"label",multiline:true,maxWidth:500,maxHeight:200,text:n.text},onClose:n.onClose})).renderTo(document.body).reflow()},alert:function(e,n){if(typeof e=="string"){e={text:e}}e.callback=n;return t.msgBox(e)},confirm:function(e,n){if(typeof e=="string"){e={text:e}}e.callback=n;e.buttons=t.OK_CANCEL;return t.msgBox(e)}}});return t});i("tinymce/WindowManager",["tinymce/ui/Window","tinymce/ui/MessageBox"],function(e,t){return function(n){function s(){if(i.length){return i[i.length-1]}}var r=this,i=[];r.windows=i;r.open=function(t,r){var s;n.editorManager.activeEditor=n;t.title=t.title||" ";t.url=t.url||t.file;if(t.url){t.width=parseInt(t.width||320,10);t.height=parseInt(t.height||240,10)}if(t.body){t.items={defaults:t.defaults,type:t.bodyType||"form",items:t.body}}if(!t.url&&!t.buttons){t.buttons=[{text:"Ok",subtype:"primary",onclick:function(){s.find("form")[0].submit();s.close()}},{text:"Cancel",onclick:function(){s.close()}}]}s=new e(t);i.push(s);s.on("close",function(){var e=i.length;while(e--){if(i[e]===s){i.splice(e,1)}}n.focus()});if(t.data){s.on("postRender",function(){this.find("*").each(function(e){var n=e.name();if(n in t.data){e.value(t.data[n])}})})}s.features=t||{};s.params=r||{};n.nodeChanged();return s.renderTo(document.body).reflow()};r.alert=function(e,n,r){t.alert(e,function(){if(n){n.call(r||this)}})};r.confirm=function(e,n,r){t.confirm(e,function(e){n.call(r||this,e)})};r.close=function(){if(s()){s().close()}};r.getParams=function(){return s()?s().params:null};r.setParams=function(e){if(s()){s().params=e}}}});i("tinymce/util/Quirks",["tinymce/util/VK","tinymce/dom/RangeUtils","tinymce/html/Node","tinymce/html/Entities","tinymce/Env","tinymce/util/Tools"],function(e,t,n,r,i,s){return function(o){function y(e,t){try{o.getDoc().execCommand(e,false,t)}catch(n){}}function b(){var e=o.getDoc().documentMode;return e?e:6}function w(e){return e.isDefaultPrevented()}function E(){function n(e){var t=new MutationObserver(function(){});s.each(o.getBody().getElementsByTagName("*"),function(e){if(e.tagName=="SPAN"){e.setAttribute("mce-data-marked",1)}if(!e.hasAttribute("data-mce-style")&&e.hasAttribute("style")){o.dom.setAttrib(e,"style",e.getAttribute("style"))}});t.observe(o.getDoc(),{childList:true,attributes:true,subtree:true,attributeFilter:["style"]});o.getDoc().execCommand(e?"ForwardDelete":"Delete",false,null);var n=o.selection.getRng();var r=n.startContainer.parentNode;s.each(t.takeRecords(),function(e){if(e.attributeName=="style"){var t=e.target.getAttribute("data-mce-style");if(t){e.target.setAttribute("style",t)}else{e.target.removeAttribute("style")}}s.each(e.addedNodes,function(e){if(e.nodeName=="SPAN"&&!e.getAttribute("mce-data-marked")){var t,i;if(e==r){t=n.startOffset;i=e.firstChild}l.remove(e,true);if(i){n.setStart(i,t);n.setEnd(i,t);o.selection.setRng(n)}}})});t.disconnect();s.each(o.dom.select("span[mce-data-marked]"),function(e){e.removeAttribute("mce-data-marked")})}var t=o.getDoc();if(!window.MutationObserver){return}o.on("keydown",function(t){var r=t.keyCode==f,i=e.metaKeyPressed(t);if(!w(t)&&(r||t.keyCode==a)){var s=o.selection.getRng(),u=s.startContainer,l=s.startOffset;if(!i&&s.collapsed&&u.nodeType==3){if(r?l0){return}}t.preventDefault();if(i){o.selection.getSel().modify("extend",r?"forward":"backward","word")}n(r)}});o.on("keypress",function(t){if(!w(t)&&!c.isCollapsed()&&t.charCode&&!e.metaKeyPressed(t)){t.preventDefault();n(true);o.selection.setContent(String.fromCharCode(t.charCode))}});o.addCommand("Delete",function(){n()});o.addCommand("ForwardDelete",function(){n(true)});o.on("dragstart",function(e){e.dataTransfer.setData("mce-internal",o.selection.getContent())});o.on("drop",function(e){if(!w(e)){var r=e.dataTransfer.getData("mce-internal");if(r&&t.caretRangeFromPoint){e.preventDefault();n();o.selection.setRng(t.caretRangeFromPoint(e.x,e.y));o.insertContent(r)}}});o.on("cut",function(e){if(!w(e)&&e.clipboardData){e.preventDefault();e.clipboardData.clearData();e.clipboardData.setData("text/html",o.selection.getContent());e.clipboardData.setData("text/plain",o.selection.getContent({format:"text"}));n(true)}})}function S(){function e(e){var t=l.create("body");var n=e.cloneContents();t.appendChild(n);return c.serializer.serialize(t,{format:"html"})}function n(n){if(!n.setStart){if(n.item){return false}var r=n.duplicate();r.moveToElementText(o.getBody());return t.compareRanges(n,r)}var i=e(n);var s=l.createRng();s.selectNode(o.getBody());var u=e(s);return i===u}o.on("keydown",function(e){var t=e.keyCode,r,i;if(!w(e)&&(t==f||t==a)){r=o.selection.isCollapsed();i=o.getBody();if(r&&!l.isEmpty(i)){return}if(!r&&!n(o.selection.getRng())){return}e.preventDefault();o.setContent("");if(i.firstChild&&l.isBlock(i.firstChild)){o.selection.setCursorLocation(i.firstChild,0)}else{o.selection.setCursorLocation(i,0)}o.nodeChanged()}})}function x(){o.on("keydown",function(t){if(!w(t)&&t.keyCode==65&&e.metaKeyPressed(t)){t.preventDefault();o.execCommand("SelectAll")}})}function T(){if(!o.settings.content_editable){l.bind(o.getDoc(),"focusin",function(){c.setRng(c.getRng())});l.bind(o.getDoc(),"mousedown",function(e){if(e.target==o.getDoc().documentElement){o.getBody().focus();c.setRng(c.getRng())}})}}function N(){o.on("keydown",function(e){if(!w(e)&&e.keyCode===a){if(c.isCollapsed()&&c.getRng(true).startOffset===0){var t=c.getNode();var n=t.previousSibling;if(t.nodeName=="HR"){l.remove(t);e.preventDefault();return}if(n&&n.nodeName&&n.nodeName.toLowerCase()==="hr"){l.remove(n);e.preventDefault()}}}})}function C(){if(!window.Range.prototype.getClientRects){o.on("mousedown",function(e){if(!w(e)&&e.target.nodeName==="HTML"){var t=o.getBody();t.blur();setTimeout(function(){t.focus()},0)}})}}function k(){o.on("click",function(e){e=e.target;if(/^(IMG|HR)$/.test(e.nodeName)){c.getSel().setBaseAndExtent(e,0,e,1)}if(e.nodeName=="A"&&l.hasClass(e,"mce-item-anchor")){c.select(e)}o.nodeChanged()})}function L(){function e(){var e=l.getAttribs(c.getStart().cloneNode(false));return function(){var t=c.getStart();if(t!==o.getBody()){l.setAttrib(t,"style",null);u(e,function(e){t.setAttributeNode(e.cloneNode(true))})}}}function t(){return!c.isCollapsed()&&l.getParent(c.getStart(),l.isBlock)!=l.getParent(c.getEnd(),l.isBlock)}o.on("keypress",function(n){var r;if(!w(n)&&(n.keyCode==8||n.keyCode==46)&&t()){r=e();o.getDoc().execCommand("delete",false,null);r();n.preventDefault();return false}});l.bind(o.getDoc(),"cut",function(n){var r;if(!w(n)&&t()){r=e();setTimeout(function(){r()},0)}})}function A(){var e,n;o.on("selectionchange",function(){if(n){clearTimeout(n);n=0}n=window.setTimeout(function(){var n=c.getRng();if(!e||!t.compareRanges(n,e)){o.nodeChanged();e=n}},50)})}function O(){document.body.setAttribute("role","application")}function M(){o.on("keydown",function(e){if(!w(e)&&e.keyCode===a){if(c.isCollapsed()&&c.getRng(true).startOffset===0){var t=c.getNode().previousSibling;if(t&&t.nodeName&&t.nodeName.toLowerCase()==="table"){e.preventDefault();return false}}}})}function _(){if(b()>7){return}y("RespectVisibilityInDesign",true);o.contentStyles.push(".mceHideBrInPre pre br {display: none}");l.addClass(o.getBody(),"mceHideBrInPre");p.addNodeFilter("pre",function(e){var t=e.length,r,i,s,o;while(t--){r=e[t].getAll("br");i=r.length;while(i--){s=r[i];o=s.prev;if(o&&o.type===3&&o.value.charAt(o.value-1)!="\n"){o.value+="\n"}else{s.parent.insert(new n("#text",3),s,true).value="\n"}}}});d.addNodeFilter("pre",function(e){var t=e.length,n,r,i,s;while(t--){n=e[t].getAll("br");r=n.length;while(r--){i=n[r];s=i.prev;if(s&&s.type==3){s.value=s.value.replace(/\r?\n$/,"")}}}})}function D(){l.bind(o.getBody(),"mouseup",function(){var e,t=c.getNode();if(t.nodeName=="IMG"){if(e=l.getStyle(t,"width")){l.setAttrib(t,"width",e.replace(/[^0-9%]+/g,""));l.setStyle(t,"width","")}if(e=l.getStyle(t,"height")){l.setAttrib(t,"height",e.replace(/[^0-9%]+/g,""));l.setStyle(t,"height","")}}})}function P(){o.on("keydown",function(t){var n,r,i,s,u;if(w(t)||t.keyCode!=e.BACKSPACE){return}n=c.getRng();r=n.startContainer;i=n.startOffset;s=l.getRoot();u=r;if(!n.collapsed||i!==0){return}while(u&&u.parentNode&&u.parentNode.firstChild==u&&u.parentNode!=s){u=u.parentNode}if(u.tagName==="BLOCKQUOTE"){o.formatter.toggle("blockquote",null,u);n=l.createRng();n.setStart(r,0);n.setEnd(r,0);c.setRng(n)}})}function H(){function e(){o._refreshContentEditable();y("StyleWithCSS",false);y("enableInlineTableEditing",false);if(!h.object_resizing){y("enableObjectResizing",false)}}if(!h.readonly){o.on("BeforeExecCommand MouseDown",e)}}function B(){function e(){u(l.select("a"),function(e){var t=e.parentNode,n=l.getRoot();if(t.lastChild===e){while(t&&!l.isBlock(t)){if(t.parentNode.lastChild!==t||t===n){return}t=t.parentNode}l.add(t,"br",{"data-mce-bogus":1})}})}o.on("SetContent ExecCommand",function(t){if(t.type=="setcontent"||t.command==="mceInsertLink"){e()}})}function j(){if(h.forced_root_block){o.on("init",function(){y("DefaultParagraphSeparator",h.forced_root_block)})}}function F(){o.on("Undo Redo SetContent",function(e){if(!e.initial){o.execCommand("mceRepaint")}})}function I(){o.on("keydown",function(e){var t;if(!w(e)&&e.keyCode==a){t=o.getDoc().selection.createRange();if(t&&t.item){e.preventDefault();o.undoManager.beforeChange();l.remove(t.item(0));o.undoManager.add()}}})}function q(){var e;if(b()>=10){e="";u("p div h1 h2 h3 h4 h5 h6".split(" "),function(t,n){e+=(n>0?",":"")+t+":empty"});o.contentStyles.push(e+"{padding-right: 1px !important}")}}function R(){if(b()<9){p.addNodeFilter("noscript",function(e){var t=e.length,n,r;while(t--){n=e[t];r=n.firstChild;if(r){n.attr("data-mce-innertext",r.value)}}});d.addNodeFilter("noscript",function(e){var t=e.length,i,s,o;while(t--){i=e[t];s=e[t].firstChild;if(s){s.value=r.decode(s.value)}else{o=i.attributes.map["data-mce-innertext"];if(o){i.attr("data-mce-innertext",null);s=new n("#text",3);s.value=o;s.raw=true;i.append(s)}}}})}}function U(){function s(e,n){var r=t.createTextRange();try{r.moveToPoint(e,n)}catch(i){r=null}return r}function o(e){var t;if(e.button){t=s(e.x,e.y);if(t){if(t.compareEndPoints("StartToStart",r)>0){t.setEndPoint("StartToStart",r)}else{t.setEndPoint("EndToEnd",r)}t.select()}}else{u()}}function u(){var t=e.selection.createRange();if(r&&!t.item&&t.compareEndPoints("StartToEnd",t)===0){r.select()}l.unbind(e,"mouseup",u);l.unbind(e,"mousemove",o);r=n=0}var e=l.doc,t=e.body,n,r,i;e.documentElement.unselectable=true;l.bind(e,"mousedown contextmenu",function(t){if(t.target.nodeName==="HTML"){if(n){u()}i=e.documentElement;if(i.scrollHeight>i.clientHeight){return}n=1;r=s(t.x,t.y);if(r){l.bind(e,"mouseup",u);l.bind(e,"mousemove",o);l.win.focus();r.select()}}})}function z(){o.on("keyup focusin",function(t){if(t.keyCode!=65||!e.metaKeyPressed(t)){c.normalize()}})}function W(){o.contentStyles.push("img:-moz-broken {"+"-moz-force-broken-image-icon:1;"+"min-width:24px;"+"min-height:24px"+"}")}function X(){if(!o.inline){o.on("keydown",function(){if(document.activeElement==document.body){o.getWin().focus()}})}}function V(){if(!o.inline){o.contentStyles.push("body {min-height: 150px}");o.on("click",function(e){if(e.target.nodeName=="HTML"){o.execCommand("SelectAll");o.selection.collapse(true);o.nodeChanged()}})}}function $(){if(i.mac){o.on("keydown",function(t){if(e.metaKeyPressed(t)&&(t.keyCode==37||t.keyCode==39)){t.preventDefault();o.selection.getSel().modify("move",t.keyCode==37?"backward":"forward","word")}})}}function J(){y("AutoUrlDetect",false)}var u=s.each;var a=e.BACKSPACE,f=e.DELETE,l=o.dom,c=o.selection,h=o.settings,p=o.parser,d=o.serializer;var v=i.gecko,m=i.ie,g=i.webkit;M();P();S();z();if(g){E();T();k();j();if(i.iOS){A();X();V()}else{x()}}if(m&&i.ie<11){N();O();_();D();I();q();R();U()}if(i.ie>=11){V()}if(i.ie){x();J()}if(v){N();C();L();H();B();F();W();$()}}});i("tinymce/util/Observable",["tinymce/util/Tools"],function(e){function r(){return false}function i(){return true}var t="__bindings";var n=e.makeMap("focusin focusout click dblclick mousedown mouseup mousemove mouseover beforepaste paste cut copy selectionchange"+" mouseout mouseenter mouseleave keydown keypress keyup contextmenu dragstart dragend dragover draggesture dragdrop drop drag"," ");return{fire:function(e,n,s){var o=this,u,a,f,l,c;e=e.toLowerCase();n=n||{};n.type=e;if(!n.target){n.target=o}if(!n.preventDefault){n.preventDefault=function(){n.isDefaultPrevented=i};n.stopPropagation=function(){n.isPropagationStopped=i};n.stopImmediatePropagation=function(){n.isImmediatePropagationStopped=i};n.isDefaultPrevented=r;n.isPropagationStopped=r;n.isImmediatePropagationStopped=r}if(o[t]){u=o[t][e];if(u){for(a=0,f=u.length;a=0){u.splice(e,1)}});var f=u.join(",");t=C(t,{plugins:f,external_filemanager_path:s+"/filemanager/",filemanager_title:"File manager",external_plugins:{filemanager:s+"/filemanager/plugin.min.js"},skin:"prestashop",resize:false,theme:"modern"});i.settings=t=C({id:e,theme:"modern",delta_width:0,delta_height:0,popup_css:"",plugins:"",document_base_url:s,add_form_submit_trigger:true,submit_patch:true,add_unload_trigger:true,convert_urls:true,relative_urls:true,remove_script_host:true,object_resizing:true,doctype:"",visual:true,font_size_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",forced_root_block:"p",hidden_input:true,padd_empty_editor:true,render_ui:true,indentation:"30px",inline_styles:true,convert_fonts_to_spans:true,indent:"simple",indent_before:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,"+"tfoot,tbody,tr,section,article,hgroup,aside,figure,option,optgroup,datalist",indent_after:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,"+"tfoot,tbody,tr,section,article,hgroup,aside,figure,option,optgroup,datalist",validate:true,entity_encoding:"named",url_converter:i.convertURL,url_converter_scope:i,ie7_compat:true},t);n.language=t.language||"en";n.languageLoad=t.language_load;n.baseURL=r.baseURL;i.id=t.id=e;i.isNotDirty=true;i.plugins={};i.documentBaseURI=new h(t.document_base_url||s,{base_uri:o});i.baseURI=o;i.contentCSS=[];i.contentStyles=[];i.shortcuts=new S(i);i.execCommands={};i.queryStateCommands={};i.queryValueCommands={};i.loadedCSS={};i.suffix=r.suffix;i.editorManager=r;i.inline=t.inline;r.fire("SetupEditor",i);i.execCallback("setup",i)}var x=e.DOM,T=n.ThemeManager,N=n.PluginManager;var C=w.extend,k=w.each,L=w.explode;var A=w.inArray,O=w.trim,M=w.resolve;var _=d.Event;var D=b.gecko,P=b.ie;B.prototype={render:function(){function i(){x.unbind(window,"ready",i);e.render()}function o(){var n=p.ScriptLoader;if(t.language&&t.language!="en"&&!t.language_url){t.language_url=e.editorManager.baseURL+"/langs/"+t.language+".js"}if(t.language_url){n.add(t.language_url)}if(t.theme&&typeof t.theme!="function"&&t.theme.charAt(0)!="-"&&!T.urls[t.theme]){var i=t.theme_url;if(i){i=e.documentBaseURI.toAbsolute(i)}else{i="themes/"+t.theme+"/theme"+r+".js"}T.load(t.theme,i)}if(w.isArray(t.plugins)){t.plugins=t.plugins.join(" ")}k(t.external_plugins,function(e,n){N.load(n,e);t.plugins+=" "+n});k(t.plugins.split(/[ ,]/),function(e){e=O(e);if(e&&!N.urls[e]){if(e.charAt(0)=="-"){e=e.substr(1,e.length);var t=N.dependencies(e);k(t,function(e){var t={prefix:"plugins/",resource:e,suffix:"/plugin"+r+".js"};e=N.createUrl(t,e);N.load(e.resource,e)})}else{N.load(e,{prefix:"plugins/",resource:e,suffix:"/plugin"+r+".js"})}}});n.loadQueue(function(){if(!e.removed){e.init()}})}var e=this,t=e.settings,n=e.id,r=e.suffix;if(!_.domLoaded){x.bind(window,"ready",i);return}if(!e.getElement()){return}if(!b.contentEditable){return}if(!t.inline){e.orgVisibility=e.getElement().style.visibility;e.getElement().style.visibility="hidden"}else{e.inline=true}var s=e.getElement().form||x.getParent(n,"form");if(s){e.formElement=s;if(t.hidden_input&&!/TEXTAREA|INPUT/i.test(e.getElement().nodeName)){x.insertAfter(x.create("input",{type:"hidden",name:n}),n);e.hasHiddenInput=true}e.formEventDelegate=function(t){e.fire(t.type,t)};x.bind(s,"submit reset",e.formEventDelegate);e.on("reset",function(){e.setContent(e.startContent,{format:"raw"})});if(t.submit_patch&&!s.submit.nodeType&&!s.submit.length&&!s._mceOldSubmit){s._mceOldSubmit=s.submit;s.submit=function(){e.editorManager.triggerSave();e.isNotDirty=true;return s._mceOldSubmit(s)}}}e.windowManager=new v(e);if(t.encoding=="xml"){e.on("GetContent",function(e){if(e.save){e.content=x.encode(e.content)}})}if(t.add_form_submit_trigger){e.on("submit",function(){if(e.initialized){e.save()}})}if(t.add_unload_trigger){e._beforeUnload=function(){if(e.initialized&&!e.destroyed&&!e.isHidden()){e.save({format:"raw",no_events:true,set_dirty:false})}};e.editorManager.on("BeforeUnload",e._beforeUnload)}o()},init:function(){function d(t){var n=N.get(t),r,i;r=N.urls[t]||e.documentBaseUrl.replace(/\/$/,"");t=O(t);if(n&&A(p,t)===-1){k(N.dependencies(t),function(e){d(e)});i=new n(e,r);e.plugins[t]=i;if(i.init){i.init(e,r);p.push(t)}}}var e=this,t=e.settings,n=e.getElement();var r,i,s,o,u,a,f,l,c,h,p=[];e.rtl=this.editorManager.i18n.rtl;e.editorManager.add(e);t.aria_label=t.aria_label||x.getAttrib(n,"aria-label",e.getLang("aria.rich_text_area"));if(t.theme){if(typeof t.theme!="function"){t.theme=t.theme.replace(/-/,"");u=T.get(t.theme);e.theme=new u(e,T.urls[t.theme]);if(e.theme.init){e.theme.init(e,T.urls[t.theme]||e.documentBaseUrl.replace(/\/$/,""))}}else{e.theme=t.theme}}k(t.plugins.replace(/\-/g,"").split(/[ ,]/),d);if(t.render_ui&&e.theme){e.orgDisplay=n.style.display;if(typeof t.theme!="function"){r=t.width||n.style.width||n.offsetWidth;i=t.height||n.style.height||n.offsetHeight;s=t.min_height||100;c=/^[0-9\.]+(|px)$/i;if(c.test(""+r)){r=Math.max(parseInt(r,10)+(u.deltaWidth||0),100)}if(c.test(""+i)){i=Math.max(parseInt(i,10)+(u.deltaHeight||0),s)}u=e.theme.renderUI({targetNode:n,width:r,height:i,deltaWidth:t.delta_width,deltaHeight:t.delta_height});if(!t.content_editable){x.setStyles(u.sizeContainer||u.editorContainer,{wi2dth:r,h2eight:i});i=(u.iframeHeight||i)+(typeof i=="number"?u.deltaHeight||0:"");if(i";if(t.document_base_url!=e.documentBaseUrl){e.iframeHTML+=''}if(!b.caretAfter&&t.ie7_compat){e.iframeHTML+=''}e.iframeHTML+='';for(h=0;h';e.loadedCSS[v]=true}f=t.body_id||"tinymce";if(f.indexOf("=")!=-1){f=e.getParam("body_id","","hash");f=f[e.id]||f}l=t.body_class||"";if(l.indexOf("=")!=-1){l=e.getParam("body_class","","hash");l=l[e.id]||""}e.iframeHTML+='
";var m="javascript:(function(){"+'document.open();document.domain="'+document.domain+'";'+'var ed = window.parent.tinymce.get("'+e.id+'");document.write(ed.iframeHTML);'+"document.close();ed.initContentBody(true);})()";if(document.domain!=location.hostname){a=m}o=x.add(u.iframeContainer,"iframe",{id:e.id+"_ifr",src:a||'javascript:""',frameBorder:"0",allowTransparency:"true",title:e.editorManager.translate("Rich Text Area. Press ALT-F9 for menu. "+"Press ALT-F10 for toolbar. Press ALT-0 for help"),style:{width:"100%",height:i,display:"block"}});if(P){try{e.getDoc()}catch(g){o.src=a=m}}e.contentAreaContainer=u.iframeContainer;if(u.editorContainer){x.get(u.editorContainer).style.display=e.orgDisplay}x.get(e.id).style.display="none";x.setAttrib(e.id,"aria-hidden",true);if(!a){e.initContentBody()}n=o=u=null},initContentBody:function(t){var n=this,s=n.settings,h=x.get(n.id),p=n.getDoc(),d,v;if(!s.inline){n.getElement().style.visibility=n.orgVisibility}if(!t&&!s.content_editable){p.open();p.write(n.iframeHTML);p.close()}if(s.content_editable){n.on("remove",function(){var e=this.getBody();x.removeClass(e,"mce-content-body");x.removeClass(e,"mce-edit-focus");x.setAttrib(e,"tabIndex",null);x.setAttrib(e,"contentEditable",null)});x.addClass(h,"mce-content-body");h.tabIndex=-1;n.contentDocument=p=s.content_document||document;n.contentWindow=s.content_window||window;n.bodyElement=h;s.content_document=s.content_window=null;s.root_name=h.nodeName.toLowerCase()}d=n.getBody();d.disabled=true;if(!s.readonly){if(n.inline&&x.getStyle(d,"position",true)=="static"){d.style.position="relative"}d.contentEditable=n.getParam("content_editable_state",true)}d.disabled=false;n.schema=new m(s);n.dom=new e(p,{keep_values:true,url_converter:n.convertURL,url_converter_scope:n,hex_colors:s.force_hex_style_colors,class_filter:s.class_filter,update_styles:true,root_element:s.content_editable?n.id:null,collect:s.content_editable,schema:n.schema,onSetAttrib:function(e){n.fire("SetAttrib",e)}});n.parser=new g(s,n.schema);n.parser.addAttributeFilter("src,href,style",function(e,t){var r=e.length,i,s=n.dom,o,u;while(r--){i=e[r];o=i.attr(t);u="data-mce-"+t;if(!i.attributes.map[u]){if(t==="style"){i.attr(u,s.serializeStyle(s.parseStyle(o),i.name))}else{i.attr(u,n.convertURL(o,t,i.name))}}}});n.parser.addNodeFilter("script",function(e){var t=e.length,n;while(t--){n=e[t];n.attr("type","mce-"+(n.attr("type")||"text/javascript"))}});n.parser.addNodeFilter("#cdata",function(e){var t=e.length,n;while(t--){n=e[t];n.type=8;n.name="#comment";n.value="[CDATA["+n.value+"]]"}});n.parser.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",function(e){var t=e.length,i,s=n.schema.getNonEmptyElements();while(t--){i=e[t];if(i.isEmpty(s)){i.empty().append(new r("br",1)).shortEnded=true}}});n.serializer=new i(s,n);n.selection=new o(n.dom,n.getWin(),n.serializer,n);n.formatter=new u(n);n.undoManager=new a(n);n.forceBlocks=new l(n);n.enterKey=new f(n);n.editorCommands=new c(n);n.fire("PreInit");if(!s.browser_spellcheck&&!s.gecko_spellcheck){p.body.spellcheck=false;x.setAttrib(d,"spellcheck","false")}n.fire("PostRender");n.quirks=y(n);if(s.directionality){d.dir=s.directionality}if(s.nowrap){d.style.whiteSpace="nowrap"}if(s.protect){n.on("BeforeSetContent",function(e){k(s.protect,function(t){e.content=e.content.replace(t,function(e){return""})})})}n.on("SetContent",function(){n.addVisual(n.getBody())});if(s.padd_empty_editor){n.on("PostProcess",function(e){e.content=e.content.replace(/^(]*>( | |\s|\u00a0|)<\/p>[\r\n]*|
[\r\n]*)$/,"")})}n.load({initial:true,format:"html"});n.startContent=n.getContent({format:"raw"});n.initialized=true;k(n._pendingNativeEvents,function(e){n.dom.bind(H(n,e),e,function(e){n.fire(e.type,e)})});n.fire("init");n.focus(true);n.nodeChanged({initial:true});n.execCallback("init_instance_callback",n);if(n.contentStyles.length>0){v="";k(n.contentStyles,function(e){v+=e+"\r\n"});n.dom.addStyle(v)}k(n.contentCSS,function(e){if(!n.loadedCSS[e]){n.dom.loadCSS(e);n.loadedCSS[e]=true}});if(s.auto_focus){setTimeout(function(){var e=n.editorManager.get(s.auto_focus);e.selection.select(e.getBody(),1);e.selection.collapse(1);e.getBody().focus();e.getWin().focus()},100)}h=p=d=null},focus:function(e){var t,n=this,r=n.selection,i=n.settings.content_editable,s;var o,u=n.getDoc(),a;if(!e){s=r.getRng();if(s.item){o=s.item(0)}n._refreshContentEditable();if(!i){if(!b.opera){n.getBody().focus()}n.getWin().focus()}if(D||i){a=n.getBody();if(a.setActive&&b.ie<11){a.setActive()}else{a.focus()}if(i){r.normalize()}}if(o&&o.ownerDocument==u){s=u.body.createControlRange();s.addElement(o);s.select()}}if(n.editorManager.activeEditor!=n){if(t=n.editorManager.activeEditor){t.fire("deactivate",{relatedTarget:n})}n.fire("activate",{relatedTarget:t})}n.editorManager.activeEditor=n},execCallback:function(e){var t=this,n=t.settings[e],r;if(!n){return}if(t.callbackLookup&&(r=t.callbackLookup[e])){n=r.func;r=r.scope}if(typeof n==="string"){r=n.replace(/\.\w+$/,"");r=r?M(r):0;n=M(n);t.callbackLookup=t.callbackLookup||{};t.callbackLookup[e]={func:n,scope:r}}return n.apply(r||t,Array.prototype.slice.call(arguments,1))},translate:function(e){var t=this.settings.language||"en",n=this.editorManager.i18n;if(!e){return""}return n.data[t+"."+e]||e.replace(/\{\#([^\}]+)\}/g,function(e,r){return n.data[t+"."+r]||"{#"+r+"}"})},getLang:function(e,n){return this.editorManager.i18n.data[(this.settings.language||"en")+"."+e]||(n!==t?n:"{#"+e+"}")},getParam:function(e,t,n){var r=e in this.settings?this.settings[e]:t,i;if(n==="hash"){i={};if(typeof r==="string"){k(r.indexOf("=")>0?r.split(/[;,](?![^=;,]*(?:[;,]|$))/):r.split(","),function(e){e=e.split("=");if(e.length>1){i[O(e[0])]=O(e[1])}else{i[O(e[0])]=O(e)}})}else{i=r}return i}return r},nodeChanged:function(){var e=this,t=e.selection,n,r,i;if(e.initialized&&!e.settings.disable_nodechange){i=e.getBody();n=t.getStart()||i;n=P&&n.ownerDocument!=e.getDoc()?e.getBody():n;if(n.nodeName=="IMG"&&t.isCollapsed()){n=n.parentNode}r=[];e.dom.getParent(n,function(e){if(e===i){return true}r.push(e)});e.fire("NodeChange",{element:n,parents:r})}},addButton:function(e,t){var n=this;if(t.cmd){t.onclick=function(){n.execCommand(t.cmd)}}if(!t.text&&!t.icon){t.icon=e}n.buttons=n.buttons||{};t.tooltip=t.tooltip||t.title;n.buttons[e]=t},addMenuItem:function(e,t){var n=this;if(t.cmd){t.onclick=function(){n.execCommand(t.cmd)}}n.menuItems=n.menuItems||{};n.menuItems[e]=t},addCommand:function(e,t,n){this.execCommands[e]={func:t,scope:n||this}},addQueryStateHandler:function(e,t,n){this.queryStateCommands[e]={func:t,scope:n||this}},addQueryValueHandler:function(e,t,n){this.queryValueCommands[e]={func:t,scope:n||this}},addShortcut:function(e,t,n,r){this.shortcuts.add(e,t,n,r)},execCommand:function(e,t,n,r){var i=this,s=0,o;if(!/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint)$/.test(e)&&(!r||!r.skip_focus)){i.focus()}r=C({},r);r=i.fire("BeforeExecCommand",{command:e,ui:t,value:n});if(r.isDefaultPrevented()){return false}if(o=i.execCommands[e]){if(o.func.call(o.scope,t,n)!==true){i.fire("ExecCommand",{command:e,ui:t,value:n});return true}}k(i.plugins,function(r){if(r.execCommand&&r.execCommand(e,t,n)){i.fire("ExecCommand",{command:e,ui:t,value:n});s=true;return false}});if(s){return s}if(i.theme&&i.theme.execCommand&&i.theme.execCommand(e,t,n)){i.fire("ExecCommand",{command:e,ui:t,value:n});return true}if(i.editorCommands.execCommand(e,t,n)){i.fire("ExecCommand",{command:e,ui:t,value:n});return true}i.getDoc().execCommand(e,t,n);i.fire("ExecCommand",{command:e,ui:t,value:n})},queryCommandState:function(e){var t=this,n,r;if(t._isHidden()){return}if(n=t.queryStateCommands[e]){r=n.func.call(n.scope);if(r!==true){return r}}r=t.editorCommands.queryCommandState(e);if(r!==-1){return r}try{return t.getDoc().queryCommandState(e)}catch(i){}},queryCommandValue:function(e){var n=this,r,i;if(n._isHidden()){return}if(r=n.queryValueCommands[e]){i=r.func.call(r.scope);if(i!==true){return i}}i=n.editorCommands.queryCommandValue(e);if(i!==t){return i}try{return n.getDoc().queryCommandValue(e)}catch(s){}},show:function(){var e=this;x.show(e.getContainer());x.hide(e.id);e.load();e.fire("show")},hide:function(){var e=this,t=e.getDoc();if(P&&t&&!e.inline){t.execCommand("SelectAll")}e.save();x.hide(e.getContainer());x.setStyle(e.id,"display",e.orgDisplay);e.fire("hide")},isHidden:function(){return!x.isHidden(this.id)},setProgressState:function(e,t){this.fire("ProgressState",{state:e,time:t})},load:function(e){var n=this,r=n.getElement(),i;if(r){e=e||{};e.load=true;i=n.setContent(r.value!==t?r.value:r.innerHTML,e);e.element=r;if(!e.no_events){n.fire("LoadContent",e)}e.element=r=null;return i}},save:function(e){var t=this,n=t.getElement(),r,i;if(!n||!t.initialized){return}e=e||{};e.save=true;e.element=n;r=e.content=t.getContent(e);if(!e.no_events){t.fire("SaveContent",e)}r=e.content;if(!/TEXTAREA|INPUT/i.test(n.nodeName)){n.innerHTML=r;if(i=x.getParent(t.id,"form")){k(i.elements,function(e){if(e.name==t.id){e.value=r;return false}})}}else{n.value=r}e.element=n=null;if(e.set_dirty!==false){t.isNotDirty=true}return r},setContent:function(e,t){var n=this,r=n.getBody(),i;t=t||{};t.format=t.format||"html";t.set=true;t.content=e;if(!t.no_events){n.fire("BeforeSetContent",t)}e=t.content;if(e.length===0||/^\s+$/.test(e)){i=n.settings.forced_root_block;if(i&&n.schema.isValidChild(r.nodeName.toLowerCase(),i.toLowerCase())){e=P&&P<11?"":'
';e=n.dom.createHTML(i,n.settings.forced_root_block_attrs,e)}else if(!P||P<11){e='
'}r.innerHTML=e;n.fire("SetContent",t)}else{if(t.format!=="raw"){e=(new s({},n.schema)).serialize(n.parser.parse(e,{isRootContent:true}))}t.content=O(e);n.dom.setHTML(r,t.content);if(!t.no_events){n.fire("SetContent",t)}}return t.content},getContent:function(e){var t=this,n,r=t.getBody();e=e||{};e.format=e.format||"html";e.get=true;e.getInner=true;if(!e.no_events){t.fire("BeforeGetContent",e)}if(e.format=="raw"){n=r.innerHTML}else if(e.format=="text"){n=r.innerText||r.textContent}else{n=t.serializer.serialize(r,e)}if(e.format!="text"){e.content=O(n)}else{e.content=n}if(!e.no_events){t.fire("GetContent",e)}return e.content},insertContent:function(e){this.execCommand("mceInsertContent",false,e)},isDirty:function(){return!this.isNotDirty},getContainer:function(){var e=this;if(!e.container){e.container=x.get(e.editorContainer||e.id+"_parent")}return e.container},getContentAreaContainer:function(){return this.contentAreaContainer},getElement:function(){return x.get(this.settings.content_element||this.id)},getWin:function(){var e=this,t;if(!e.contentWindow){t=x.get(e.id+"_ifr");if(t){e.contentWindow=t.contentWindow}}return e.contentWindow},getDoc:function(){var e=this,t;if(!e.contentDocument){t=e.getWin();if(t){e.contentDocument=t.document}}return e.contentDocument},getBody:function(){return this.bodyElement||this.getDoc().body},convertURL:function(e,t,n){var r=this,i=r.settings;if(i.urlconverter_callback){return r.execCallback("urlconverter_callback",e,n,true,t)}if(!i.convert_urls||n&&n.nodeName=="LINK"||e.indexOf("file:")===0||e.length===0){return e}if(i.relative_urls){return r.documentBaseURI.toRelative(e)}e=r.documentBaseURI.toAbsolute(e,i.remove_script_host);return e},addVisual:function(e){var n=this,r=n.settings,i=n.dom,s;e=e||n.getBody();if(n.hasVisual===t){n.hasVisual=r.visual}k(i.select("table,a",e),function(e){var t;switch(e.nodeName){case"TABLE":s=r.visual_table_class||"mce-item-table";t=i.getAttrib(e,"border");if(!t||t=="0"){if(n.hasVisual){i.addClass(e,s)}else{i.removeClass(e,s)}}return;case"A":if(!i.getAttrib(e,"href",false)){t=i.getAttrib(e,"name")||e.id;s="mce-item-anchor";if(t){if(n.hasVisual){i.addClass(e,s)}else{i.removeClass(e,s)}}}return}});n.fire("VisualAid",{element:e,hasVisual:n.hasVisual})},remove:function(){var e=this;if(!e.removed){e.removed=1;if(e.hasHiddenInput){x.remove(e.getElement().nextSibling)}var t=e.getDoc();if(P&&t&&!e.inline){t.execCommand("SelectAll")}e.save();x.setStyle(e.id,"display",e.orgDisplay);if(!e.settings.content_editable){_.unbind(e.getWin());_.unbind(e.getDoc())}var n=e.getContainer();_.unbind(e.getBody());_.unbind(n);e.fire("remove");e.editorManager.remove(e);x.remove(n);e.destroy()}},bindNative:function(e){var t=this;if(t.settings.readonly){return}if(t.initialized){t.dom.bind(H(t,e),e,function(n){t.fire(e,n)})}else{if(!t._pendingNativeEvents){t._pendingNativeEvents=[e]}else{t._pendingNativeEvents.push(e)}}},unbindNative:function(e){var t=this;if(t.initialized){t.dom.unbind(e)}},destroy:function(e){var t=this,n;if(t.destroyed){return}if(!e&&!t.removed){t.remove();return}if(e&&D){_.unbind(t.getDoc());_.unbind(t.getWin());_.unbind(t.getBody())}if(!e){t.editorManager.off("beforeunload",t._beforeUnload);if(t.theme&&t.theme.destroy){t.theme.destroy()}t.selection.destroy();t.dom.destroy()}n=t.formElement;if(n){if(n._mceOldSubmit){n.submit=n._mceOldSubmit;n._mceOldSubmit=null}x.unbind(n,"submit reset",t.formEventDelegate)}t.contentAreaContainer=t.formElement=t.container=null;t.settings.content_element=t.bodyElement=t.contentDocument=t.contentWindow=null;if(t.selection){t.selection=t.selection.win=t.selection.dom=t.selection.dom.doc=null}t.destroyed=1},_refreshContentEditable:function(){var e=this,t,n;if(e._isHidden()){t=e.getBody();n=t.parentNode;n.removeChild(t);n.appendChild(t);t.focus()}},_isHidden:function(){var e;if(!D){return 0}e=this.selection.getSel();return!e||!e.rangeCount||e.rangeCount===0}};C(B.prototype,E);return B});i("tinymce/util/I18n",[],function(){"use strict";var e={};return{rtl:false,add:function(t,n){for(var r in n){e[r]=n[r]}this.rtl=this.rtl||e._dir==="rtl"},translate:function(t){if(typeof t=="undefined"){return t}if(typeof t!="string"&&t.raw){return t.raw}if(t.push){var n=t.slice(1);t=(e[t[0]]||t[0]).replace(/\{([^\}]+)\}/g,function(e,t){return n[t]})}return e[t]||t},data:e}});i("tinymce/FocusManager",["tinymce/dom/DOMUtils","tinymce/Env"],function(e,t){function n(r){function i(){try{return document.activeElement}catch(e){return document.body}}function s(e){if(e&&e.startContainer){return{startContainer:e.startContainer,startOffset:e.startOffset,endContainer:e.endContainer,endOffset:e.endOffset}}return e}function o(e,t){var n;if(t.startContainer){n=e.getDoc().createRange();n.setStart(t.startContainer,t.startOffset);n.setEnd(t.endContainer,t.endOffset)}else{n=t}return n}function u(t){return!!e.DOM.getParent(t,n.isEditorUIElement)}function a(e,t){var n=t.getBody();while(e){if(e==n){return true}e=e.parentNode}}function f(n){var f=n.editor,l;f.on("init",function(){if("onbeforedeactivate"in document&&t.ie<11){f.dom.bind(f.getBody(),"beforedeactivate",function(){try{f.lastRng=f.selection.getRng()}catch(e){}f.selection.lastFocusBookmark=s(f.lastRng)})}else if(f.inline||t.ie>10){f.on("nodechange keyup",function(){var e=document.activeElement;if(e&&e.id==f.id+"_ifr"){e=f.getBody()}if(a(e,f)){f.lastRng=f.selection.getRng()}});if(t.webkit){l=function(){var e=f.selection.getRng();if(!e.collapsed){f.lastRng=e}};e.DOM.bind(document,"selectionchange",l);f.on("remove",function(){e.DOM.unbind(document,"selectionchange",l)})}}});f.on("setcontent",function(){f.lastRng=null});f.on("mousedown",function(){f.selection.lastFocusBookmark=null});f.on("focusin",function(){var e=r.focusedEditor;if(f.selection.lastFocusBookmark){f.selection.setRng(o(f,f.selection.lastFocusBookmark));f.selection.lastFocusBookmark=null}if(e!=f){if(e){e.fire("blur",{focusedEditor:f})}r.activeEditor=f;r.focusedEditor=f;f.fire("focus",{blurredEditor:e});f.focus(false)}f.lastRng=null});f.on("focusout",function(){window.setTimeout(function(){var e=r.focusedEditor;if(!u(i())&&e==f){f.fire("blur",{focusedEditor:null});r.focusedEditor=null;if(f.selection){f.selection.lastFocusBookmark=null}}},0)})}e.DOM.bind(document,"focusin",function(e){var t=r.activeEditor;if(t&&e.target.ownerDocument==document){if(t.selection){t.selection.lastFocusBookmark=s(t.lastRng)}if(!u(e.target)&&r.focusedEditor==t){t.fire("blur",{focusedEditor:null});r.focusedEditor=null}}});r.on("AddEditor",f)}n.isEditorUIElement=function(e){return e.className.indexOf("mce-")!==-1};return n});i("tinymce/EditorManager",["tinymce/Editor","tinymce/dom/DOMUtils","tinymce/util/URI","tinymce/Env","tinymce/util/Tools","tinymce/util/Observable","tinymce/util/I18n","tinymce/FocusManager"],function(e,n,r,i,s,o,u,a){var f=n.DOM;var l=s.explode,c=s.each,h=s.extend;var p=0,d;var v={majorVersion:"4",minorVersion:"0.16",releaseDate:"2014-01-31",editors:[],i18n:u,activeEditor:null,setup:function(){var e=this,t,n,i="",s;n=document.location.href.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,"");if(!/[\/\\]$/.test(n)){n+="/"}s=window.tinymce||window.tinyMCEPreInit;if(s){t=s.base||s.baseURL;i=s.suffix}else{var o=document.getElementsByTagName("script");for(var u=0;u0){c(l(d),function(s){if(f.get(s)){i=new e(s,t,n);r.push(i);i.render(true)}else{c(document.forms,function(o){c(o.elements,function(o){if(o.name===s){s="mce_editor_"+p++;f.setAttrib(o,"id",s);i=new e(s,t,n);r.push(i);i.render(1)}})})}})}break;case"textareas":case"specific_textareas":c(f.select("textarea"),function(o){if(t.editor_deselector&&u(o,t.editor_deselector)){return}if(!t.editor_selector||u(o,t.editor_selector)){i=new e(s(o),t,n);r.push(i);i.render(true)}});break}if(t.oninit){d=v=0;c(r,function(e){v++;if(!e.initialized){e.on("init",function(){d++;if(d==v){o(t,"oninit")}})}else{d++}if(d==v){o(t,"oninit")}})}}var n=this,r=[],i;n.settings=t;f.bind(window,"ready",a)},get:function(e){if(e===t){return this.editors}return this.editors[e]},add:function(e){var t=this,n=t.editors;n[e.id]=e;n.push(e);t.activeEditor=e;t.fire("AddEditor",{editor:e});if(!d){d=function(){t.fire("BeforeUnload")};f.bind(window,"beforeunload",d)}return e},createEditor:function(t,n){return this.add(new e(t,n,this))},remove:function(e){var t=this,n,r=t.editors,i,s;if(!e){for(n=r.length-1;n>=0;n--){t.remove(r[n])}return}if(typeof e=="string"){e=e.selector||e;c(f.select(e),function(e){t.remove(r[e.id])});return}i=e;if(!r[i.id]){return null}delete r[i.id];for(n=0;n1e4){if(e.success&&n<1e4&&t.status==200){e.success.call(e.success_scope,""+t.responseText,t,e)}else if(e.error){e.error.call(e.error_scope,n>1e4?"TIMED_OUT":"GENERAL",t,e)}t=null}else{setTimeout(r,10)}}var t,n=0;e.scope=e.scope||this;e.success_scope=e.success_scope||e.scope;e.error_scope=e.error_scope||e.scope;e.async=e.async===false?false:true;e.data=e.data||"";t=new XMLHttpRequest;if(t){if(t.overrideMimeType){t.overrideMimeType(e.content_type)}t.open(e.type||(e.data?"POST":"GET"),e.url,e.async);if(e.content_type){t.setRequestHeader("Content-Type",e.content_type)}t.setRequestHeader("X-Requested-With","XMLHttpRequest");t.send(e.data);if(!e.async){return r()}setTimeout(r,10)}}}});i("tinymce/util/JSON",[],function(){function e(t,n){var r,i,s,o;n=n||'"';if(t===null){return"null"}s=typeof t;if(s=="string"){i="\bb t\nn\ff\rr\"\"''\\\\";return n+t.replace(/([\u0080-\uFFFF\x00-\x1f\"\'\\])/g,function(e,t){if(n==='"'&&e==="'"){return e}r=i.indexOf(t);if(r+1){return"\\"+i.charAt(r+1)}e=t.charCodeAt().toString(16);return"\\u"+"0000".substring(e.length)+e})+n}if(s=="object"){if(t.hasOwnProperty&&Object.prototype.toString.call(t)==="[object Array]"){for(r=0,i="[";r0?",":"")+e(t[r],n)}return i+"]"}i="{";for(o in t){if(t.hasOwnProperty(o)){i+=typeof t[o]!="function"?(i.length>1?","+n:n)+o+n+":"+e(t[o],n):""}}return i+"}"}return""+t}return{serialize:e,parse:function(e){try{return window[String.fromCharCode(101)+"val"]("("+e+")")}catch(t){}}}});i("tinymce/util/JSONRequest",["tinymce/util/JSON","tinymce/util/XHR","tinymce/util/Tools"],function(e,t,n){function i(e){this.settings=r({},e);this.count=0}var r=n.extend;i.sendRPC=function(e){return(new i).send(e)};i.prototype={send:function(n){var i=n.error,s=n.success;n=r(this.settings,n);n.success=function(t,r){t=e.parse(t);if(typeof t=="undefined"){t={error:"JSON Parse error."}}if(t.error){i.call(n.error_scope||n.scope,t.error,r)}else{s.call(n.success_scope||n.scope,t.result)}};n.error=function(e,t){if(i){i.call(n.error_scope||n.scope,e,t)}};n.data=e.serialize({id:n.id||"c"+this.count++,method:n.method,params:n.params});n.content_type="application/json";t.send(n)}};return i});i("tinymce/util/JSONP",["tinymce/dom/DOMUtils"],function(e){return{callbacks:{},count:0,send:function(n){var r=this,i=e.DOM,s=n.count!==t?n.count:r.count;var o="tinymce_jsonp_"+s;r.callbacks[s]=function(e){i.remove(o);delete r.callbacks[s];n.callback(e)};i.add(i.doc.body,"script",{id:o,src:n.url,type:"text/javascript"});r.count++}}});i("tinymce/util/LocalStorage",[],function(){function a(){i=[];for(var t in r){i.push(t)}e.length=i.length}function f(){function l(e){var n,r;r=e!==t?f+e:i.indexOf(",",f);if(r===-1||r>i.length){return null}n=i.substring(f,r);f=r+1;return n}var e,i,u,f=0;r={};if(!o){return}n.load(s);i=n.getAttribute(s)||"";do{var c=l();if(c===null){break}e=l(parseInt(c,32)||0);if(e!==null){c=l();if(c===null){break}u=l(parseInt(c,32)||0);if(e){r[e]=u}}}while(e!==null);a()}function l(){var e,t="";if(!o){return}for(var i in r){e=r[i];t+=(t?",":"")+i.length.toString(32)+","+i+","+e.length.toString(32)+","+e}n.setAttribute(s,t);try{n.save(s)}catch(u){}a()}var e,n,r,i,s,o;try{if(window.localStorage){return localStorage}}catch(u){}s="tinymce";n=document.documentElement;o=!!n.addBehavior;if(o){n.addBehavior("#default#userData")}e={key:function(e){return i[e]},getItem:function(e){return e in r?r[e]:null},setItem:function(e,t){r[e]=""+t;l()},removeItem:function(e){delete r[e];l()},clear:function(){r={};l()}};f();return e});i("tinymce/Compat",["tinymce/dom/DOMUtils","tinymce/dom/EventUtils","tinymce/dom/ScriptLoader","tinymce/AddOnManager","tinymce/util/Tools","tinymce/Env"],function(e,t,n,r,i,s){var o=window.tinymce;o.DOM=e.DOM;o.ScriptLoader=n.ScriptLoader;o.PluginManager=r.PluginManager;o.ThemeManager=r.ThemeManager;o.dom=o.dom||{};o.dom.Event=t.Event;i.each(i,function(e,t){o[t]=e});i.each("isOpera isWebKit isIE isGecko isMac".split(" "),function(e){o[e]=s[e.substr(2).toLowerCase()]});return{}});i("tinymce/ui/Layout",["tinymce/util/Class","tinymce/util/Tools"],function(e,t){"use strict";return e.extend({Defaults:{firstControlClass:"first",lastControlClass:"last"},init:function(e){this.settings=t.extend({},this.Defaults,e)},preRender:function(e){e.addClass(this.settings.containerClass,"body")},applyClasses:function(e){var t=this,n=t.settings,r,i,s;r=e.items().filter(":visible");i=n.firstControlClass;s=n.lastControlClass;r.each(function(e){e.removeClass(i).removeClass(s);if(n.controlClass){e.addClass(n.controlClass)}});r.eq(0).addClass(i);r.eq(-1).addClass(s)},renderHtml:function(e){var t=this,n=t.settings,r,i="";r=e.items();r.eq(0).addClass(n.firstControlClass);r.eq(-1).addClass(n.lastControlClass);r.each(function(e){if(n.controlClass){e.addClass(n.controlClass)}i+=e.renderHtml()});return i},recalc:function(){},postRender:function(){}})});i("tinymce/ui/AbsoluteLayout",["tinymce/ui/Layout"],function(e){"use strict";return e.extend({Defaults:{containerClass:"abs-layout",controlClass:"abs-layout-item"},recalc:function(e){e.items().filter(":visible").each(function(e){var t=e.settings;e.layoutRect({x:t.x,y:t.y,w:t.w,h:t.h});if(e.recalc){e.recalc()}})},renderHtml:function(e){return'
'+this._super(e)}})});i("tinymce/ui/Tooltip",["tinymce/ui/Control","tinymce/ui/Movable"],function(e,t){return e.extend({Mixins:[t],Defaults:{classes:"widget tooltip tooltip-n"},text:function(e){var t=this;if(typeof e!="undefined"){t._value=e;if(t._rendered){t.getEl().lastChild.innerHTML=t.encode(e)}return t}return t._value},renderHtml:function(){var e=this,t=e.classPrefix;return'"},repaint:function(){var e=this,t,n;t=e.getEl().style;n=e._layoutRect;t.left=n.x+"px";t.top=n.y+"px";t.zIndex=65535+65535}})});i("tinymce/ui/Widget",["tinymce/ui/Control","tinymce/ui/Tooltip"],function(e,t){"use strict";var n;var r=e.extend({init:function(e){var t=this;t._super(e);t.canFocus=true;if(e.tooltip&&r.tooltips!==false){t.on("mouseenter",function(n){var r=t.tooltip().moveTo(-65535);if(n.control==t){var i=r.text(e.tooltip).show().testMoveRel(t.getEl(),["bc-tc","bc-tl","bc-tr"]);r.toggleClass("tooltip-n",i=="bc-tc");r.toggleClass("tooltip-nw",i=="bc-tl");r.toggleClass("tooltip-ne",i=="bc-tr");r.moveRel(t.getEl(),i)}else{r.hide()}});t.on("mouseleave mousedown click",function(){t.tooltip().hide()})}t.aria("label",e.tooltip)},tooltip:function(){var e=this;if(!n){n=new t({type:"tooltip"});n.renderTo(e.getContainerElm())}return n},active:function(e){var t=this,n;if(e!==n){t.aria("pressed",e);t.toggleClass("active",e)}return t._super(e)},disabled:function(e){var t=this,n;if(e!==n){t.aria("disabled",e);t.toggleClass("disabled",e)}return t._super(e)},postRender:function(){var e=this,t=e.settings;e._rendered=true;e._super();if(!e.parent()&&(t.width||t.height)){e.initLayoutRect();e.repaint()}if(t.autofocus){setTimeout(function(){e.focus()},0)}},remove:function(){this._super();if(n){n.remove();n=null}}});return r});i("tinymce/ui/Button",["tinymce/ui/Widget"],function(e){"use strict";return e.extend({Defaults:{classes:"widget btn",role:"button"},init:function(e){var t=this,n;t.on("click mousedown",function(e){e.preventDefault()});t._super(e);n=e.size;if(e.subtype){t.addClass(e.subtype)}if(n){t.addClass("btn-"+n)}},icon:function(e){var t=this,n=t.classPrefix;if(typeof e=="undefined"){return t.settings.icon}t.settings.icon=e;e=e?n+"ico "+n+"i-"+t.settings.icon:"";if(t._rendered){var r=t.getEl().firstChild,i=r.getElementsByTagName("i")[0];if(e){if(!i||i!=r.firstChild){i=document.createElement("i");r.insertBefore(i,r.firstChild)}i.className=e}else if(i){r.removeChild(i)}t.text(t._text)}return t},repaint:function(){var e=this.getEl().firstChild.style;e.width=e.height="100%";this._super()},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix;var r=e.settings.icon,i="";if(e.settings.image){r="none";i=" style=\"background-image: url('"+e.settings.image+"')\""}r=e.settings.icon?n+"ico "+n+"i-"+r:"";return'
'+'"+"
"}})});i("tinymce/ui/ButtonGroup",["tinymce/ui/Container"],function(e){"use strict";return e.extend({Defaults:{defaultType:"button",role:"toolbar"},renderHtml:function(){var e=this,t=e._layout;e.addClass("btn-group");e.preRender();t.preRender(e);return'
'+'
'+(e.settings.html||"")+t.renderHtml(e)+"
"+"
"}})});i("tinymce/ui/Checkbox",["tinymce/ui/Widget"],function(e){"use strict";return e.extend({Defaults:{classes:"checkbox",role:"checkbox",checked:false},init:function(e){var t=this;t._super(e);t.on("click mousedown",function(e){e.preventDefault()});t.on("click",function(e){e.preventDefault();if(!t.disabled()){t.checked(!t.checked())}});t.checked(t.settings.checked)},checked:function(e){var t=this;if(typeof e!="undefined"){if(e){t.addClass("checked")}else{t.removeClass("checked")}t._checked=e;t.aria("checked",e);return t}return t._checked},value:function(e){return this.checked(e)},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix;return'
'+''+''+e.encode(e._text)+""+"
"}})});i("tinymce/ui/PanelButton",["tinymce/ui/Button","tinymce/ui/FloatPanel"],function(e,t){"use strict";return e.extend({showPanel:function(){var e=this,n=e.settings;e.active(true);if(!e.panel){var r=n.panel;if(r.type){r={layout:"grid",items:r}}r.popover=true;r.autohide=true;e.panel=(new t(r)).on("hide",function(){e.active(false)}).parent(e).renderTo(e.getContainerElm());e.panel.fire("show");e.panel.reflow()}else{e.panel.show()}e.panel.moveRel(e.getEl(),n.popoverAlign||(e.isRtl()?["bc-tr","bc-tc"]:["bc-tl","bc-tc"]))},hidePanel:function(){var e=this;if(e.panel){e.panel.hide()}},postRender:function(){var e=this;e.on("click",function(t){if(t.control===e){if(e.panel&&e.panel.visible()){e.hidePanel()}else{e.showPanel()}}});return e._super()}})});i("tinymce/ui/ColorButton",["tinymce/ui/PanelButton","tinymce/dom/DOMUtils"],function(e,t){"use strict";var n=t.DOM;return e.extend({init:function(e){this._super(e);this.addClass("colorbutton")},color:function(e){if(e){this._color=e;this.getEl("preview").style.backgroundColor=e;return this}return this._color},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix;var r=e.settings.icon?n+"ico "+n+"i-"+e.settings.icon:"";var i=e.settings.image?" style=\"background-image: url('"+e.settings.image+"')\"":"";return'
'+'"+'"+"
"},postRender:function(){var e=this,t=e.settings.onclick;e.on("click",function(r){if(r.control==e&&!n.getParent(r.target,"."+e.classPrefix+"open")){r.stopImmediatePropagation();t.call(e,r)}});delete e.settings.onclick;return e._super()}})});i("tinymce/ui/ComboBox",["tinymce/ui/Widget","tinymce/ui/Factory","tinymce/ui/DomUtils"],function(e,t,n){"use strict";return e.extend({init:function(e){var t=this;t._super(e);t.addClass("combobox");t.subinput=true;e=t.settings;e.menu=e.menu||e.values;if(e.menu){e.icon="caret"}t.on("click",function(n){var r=n.target;while(r){if(r.id&&r.id.indexOf("-open")!=-1){t.fire("action");if(e.menu){t.showMenu();if(n.keyboard){t.menu.items()[0].focus()}}}r=r.parentNode}});t.on("keydown",function(e){if(e.target.nodeName=="INPUT"&&e.keyCode==13){t.parents().reverse().each(function(n){e.preventDefault();t.fire("change");if(n.hasEventListeners("submit")&&n.toJSON){n.fire("submit",{data:n.toJSON()});return false}})}});if(e.placeholder){t.addClass("placeholder");t.on("focusin",function(){if(!t._hasOnChange){n.on(t.getEl("inp"),"change",function(){t.fire("change")});t._hasOnChange=true}if(t.hasClass("placeholder")){t.getEl("inp").value="";t.removeClass("placeholder")}});t.on("focusout",function(){if(t.value().length===0){t.getEl("inp").value=e.placeholder;t.addClass("placeholder")}})}},showMenu:function(){var e=this,n=e.settings,r;if(!e.menu){r=n.menu||[];if(r.length){r={type:"menu",items:r}}else{r.type=r.type||"menu"}e.menu=t.create(r).parent(e).renderTo(e.getContainerElm());e.fire("createmenu");e.menu.reflow();e.menu.on("cancel",function(t){if(t.control===e.menu){e.focus()}});e.menu.on("show hide",function(t){t.control.items().each(function(t){t.active(t.value()==e.value())})}).fire("show");e.menu.on("select",function(t){e.value(t.control.value())});e.on("focusin",function(t){if(t.target.tagName=="INPUT"){e.menu.hide()}});e.aria("expanded",true)}e.menu.show();e.menu.layoutRect({w:e.layoutRect().w});e.menu.moveRel(e.getEl(),e.isRtl()?["br-tr","tr-br"]:["bl-tl","tl-bl"])},value:function(e){var t=this;if(typeof e!="undefined"){t._value=e;t.removeClass("placeholder");if(t._rendered){t.getEl("inp").value=e}return t}if(t._rendered){e=t.getEl("inp").value;if(e!=t.settings.placeholder){return e}return""}return t._value},disabled:function(e){var t=this;if(t._rendered&&typeof e!="undefined"){t.getEl("inp").disabled=e}return t._super(e)},focus:function(){this.getEl("inp").focus()},repaint:function(){var e=this,t=e.getEl(),r=e.getEl("open"),i=e.layoutRect();var s,o;if(r){s=i.w-n.getSize(r).width-10}else{s=i.w-10}var u=document;if(u.all&&(!u.documentMode||u.documentMode<=8)){o=e.layoutRect().h-2+"px"}n.css(t.firstChild,{width:s,lineHeight:o});e._super();return e},postRender:function(){var e=this;n.on(this.getEl("inp"),"change",function(){e.fire("change")});return e._super()},remove:function(){n.off(this.getEl("inp"));this._super()},renderHtml:function(){var e=this,t=e._id,n=e.settings,r=e.classPrefix;var i=n.value||n.placeholder||"";var s,o,u="",a="";if("spellcheck"in n){a+=' spellcheck="'+n.spellcheck+'"'}if(n.maxLength){a+=' maxlength="'+n.maxLength+'"'}if(n.size){a+=' size="'+n.size+'"'}if(n.subtype){a+=' type="'+n.subtype+'"'}if(e.disabled()){a+=' disabled="disabled"'}s=n.icon;if(s&&s!="caret"){s=r+"ico "+r+"i-"+n.icon}o=e._text;if(s||o){u='
'+'"+"
";e.addClass("has-open")}return'
'+'"+u+"
"}})});i("tinymce/ui/Path",["tinymce/ui/Widget","tinymce/ui/KeyboardNavigation"],function(e,t){"use strict";return e.extend({init:function(e){var t=this;if(!e.delimiter){e.delimiter="»"}t._super(e);t.addClass("path");t.canFocus=true;t.on("click",function(e){var n,r=e.target;if(n=r.getAttribute("data-index")){t.fire("select",{value:t.data()[n],index:n})}})},focus:function(){var e=this;e.keyNav=new t({root:e,enableLeftRight:true});e.keyNav.focusFirst();return e},data:function(e){var t=this;if(typeof e!=="undefined"){t._data=e;t.update();return t}return t._data},update:function(){this.innerHtml(this._getPathHtml())},postRender:function(){var e=this;e._super();e.data(e.settings.data)},renderHtml:function(){var e=this;return'
'+e._getPathHtml()+"
"},_getPathHtml:function(){var e=this,t=e._data||[],n,r,i="",s=e.classPrefix;for(n=0,r=t.length;n0?'":"")+'
'+t[n].name+"
"}if(!i){i='
 
'}return i}})});i("tinymce/ui/ElementPath",["tinymce/ui/Path","tinymce/EditorManager"],function(e,t){return e.extend({postRender:function(){function r(e){if(e.nodeType===1){if(e.nodeName=="BR"||!!e.getAttribute("data-mce-bogus")){return true}if(e.getAttribute("data-mce-type")==="bookmark"){return true}}return false}var e=this,n=t.activeEditor;e.on("select",function(e){var t=[],i,s=n.getBody();n.focus();i=n.selection.getStart();while(i&&i!=s){if(!r(i)){t.push(i)}i=i.parentNode}n.selection.select(t[t.length-1-e.index]);n.nodeChanged()});n.on("nodeChange",function(t){var i=[],s=t.parents,o=s.length;while(o--){if(s[o].nodeType==1&&!r(s[o])){var u=n.fire("ResolveName",{name:s[o].nodeName.toLowerCase(),target:s[o]});i.push({name:u.name})}}e.data(i)});return e._super()}})});i("tinymce/ui/FormItem",["tinymce/ui/Container"],function(e){"use strict";return e.extend({Defaults:{layout:"flex",align:"center",defaults:{flex:1}},renderHtml:function(){var e=this,t=e._layout,n=e.classPrefix;e.addClass("formitem");t.preRender(e);return'
'+(e.settings.title?'
'+e.settings.title+"
":"")+'
'+(e.settings.html||"")+t.renderHtml(e)+"
"+"
"}})});i("tinymce/ui/Form",["tinymce/ui/Container","tinymce/ui/FormItem"],function(e,t){"use strict";return e.extend({Defaults:{containerCls:"form",layout:"flex",direction:"column",align:"stretch",flex:1,padding:20,labelGap:30,spacing:10,callbacks:{submit:function(){this.submit()}}},preRender:function(){var e=this,n=e.items();n.each(function(n){var r,i=n.settings.label;if(i){r=new t({layout:"flex",autoResize:"overflow",defaults:{flex:1},items:[{type:"label",text:i,flex:0,forId:n._id,disabled:n.disabled()}]});r.type="formitem";if(typeof n.settings.flex=="undefined"){n.settings.flex=1}e.replace(n,r);r.add(n)}})},recalcLabels:function(){var e=this,t=0,n=[],r,i;if(e.settings.labelGapCalc===false){return}e.items().filter("formitem").each(function(e){var r=e.items()[0],i=r.getEl().clientWidth;t=i>t?i:t;n.push(r)});i=e.settings.labelGap||0;r=n.length;while(r--){n[r].settings.minWidth=t+i}},visible:function(e){var t=this._super(e);if(e===true&&this._rendered){this.recalcLabels()}return t},submit:function(){return this.fire("submit",{data:this.toJSON()})},postRender:function(){var e=this;e._super();e.recalcLabels();e.fromJSON(e.settings.data)}})});i("tinymce/ui/FieldSet",["tinymce/ui/Form"],function(e){"use strict";return e.extend({Defaults:{containerCls:"fieldset",layout:"flex",direction:"column",align:"stretch",flex:1,padding:"25 15 5 15",labelGap:30,spacing:10,border:1},renderHtml:function(){var e=this,t=e._layout,n=e.classPrefix;e.preRender();t.preRender(e);return'
'+(e.settings.title?''+e.settings.title+"":"")+'
'+(e.settings.html||"")+t.renderHtml(e)+"
"+"
"}})});i("tinymce/ui/FilePicker",["tinymce/ui/ComboBox"],function(e){"use strict";return e.extend({init:function(e){var t=this,n=tinymce.activeEditor,r;e.spellcheck=false;r=n.settings.file_browser_callback;if(r){e.icon="browse";e.onaction=function(){r(t.getEl("inp").id,t.getEl("inp").value,e.filetype,window)}}t._super(e)}})});i("tinymce/ui/FitLayout",["tinymce/ui/AbsoluteLayout"],function(e){"use strict";return e.extend({recalc:function(e){var t=e.layoutRect(),n=e.paddingBox();e.items().filter(":visible").each(function(e){e.layoutRect({x:n.left,y:n.top,w:t.innerW-n.right-n.left,h:t.innerH-n.top-n.bottom});if(e.recalc){e.recalc()}})}})});i("tinymce/ui/FlexLayout",["tinymce/ui/AbsoluteLayout"],function(e){"use strict";return e.extend({recalc:function(e){var t,n,r,i,s,o,u,a,f,l,c,h;var p,d,v,m,g=[],y,b,w,E,S,x;var T,N,C,k,L,A,O,M,_;var D,P,H,B,j,F,I;var q,R;var U=Math.max,z=Math.min;r=e.items().filter(":visible");i=e.layoutRect();s=e._paddingBox;o=e.settings;h=e.isRtl()?o.direction||"row-reversed":o.direction;u=o.align;a=e.isRtl()?o.pack||"end":o.pack;f=o.spacing||0;if(h=="row-reversed"||h=="column-reverse"){r=r.set(r.toArray().reverse());h=h.split("-")[0]}if(h=="column"){C="y";T="h";N="minH";k="maxH";A="innerH";L="top";O="bottom";M="deltaH";_="contentH";F="left";H="w";D="x";P="innerW";B="minW";j="maxW";I="right";q="deltaW";R="contentW"}else{C="x";T="w";N="minW";k="maxW";A="innerW";L="left";O="right";M="deltaW";_="contentW";F="top";H="h";D="y";P="innerH";B="minH";j="maxH";I="bottom";q="deltaH";R="contentH"}c=i[A]-s[L]-s[L];x=l=0;for(t=0,n=r.length;t0){l+=m;if(d[k]){g.push(p)}d.flex=m}c-=d[N];y=s[F]+d[B]+s[I];if(y>x){x=y}}E={};if(c<0){E[N]=i[N]-c+i[M]}else{E[N]=i[A]-c+i[M]}E[B]=x+i[q];E[_]=i[A]-c;E[R]=x;E.minW=z(E.minW,i.maxW);E.minH=z(E.minH,i.maxH);E.minW=U(E.minW,i.startMinWidth);E.minH=U(E.minH,i.startMinHeight);if(i.autoResize&&(E.minW!=i.minW||E.minH!=i.minH)){E.w=E.minW;E.h=E.minH;e.layoutRect(E);this.recalc(e);if(e._lastRect===null){var W=e.parent();if(W){W._lastRect=null;W.recalc()}}return}w=c/l;for(t=0,n=g.length;tb){c-=d[k]-d[N];l-=d.flex;d.flex=0;d.maxFlexSize=b}else{d.maxFlexSize=0}}w=c/l;S=s[L];E={};if(l===0){if(a=="end"){S=c+s[L]}else if(a=="center"){S=Math.round(i[A]/2-(i[A]-c)/2)+s[L];if(S<0){S=s[L]}}else if(a=="justify"){S=s[L];f=Math.floor(c/(r.length-1))}}E[D]=s[F];for(t=0,n=r.length;t0){y+=d.flex*w}E[T]=y;E[C]=S;p.layoutRect(E);if(p.recalc){p.recalc()}S+=y+f}}})});i("tinymce/ui/FlowLayout",["tinymce/ui/Layout"],function(e){return e.extend({Defaults:{containerClass:"flow-layout",controlClass:"flow-layout-item",endClass:"break"},recalc:function(e){e.items().filter(":visible").each(function(e){if(e.recalc){e.recalc()}})}})});i("tinymce/ui/FormatControls",["tinymce/ui/Control","tinymce/ui/Widget","tinymce/ui/FloatPanel","tinymce/util/Tools","tinymce/EditorManager","tinymce/Env"],function(e,t,n,r,i,s){function u(e){function r(t){function f(e){return e.replace(/%(\w+)/g,"")}var n,r,i=e.dom;var s="",u,a;a=e.settings.preview_styles;if(a===false){return""}if(!a){a="font-family font-size font-weight font-style text-decoration "+"text-transform color background-color border border-radius outline text-shadow"}t=e.formatter.get(t);if(!t){return}t=t[0];n=t.block||t.inline||"span";r=i.create(n);o(t.styles,function(e,t){e=f(e);if(e){i.setStyle(r,t,e)}});o(t.attributes,function(e,t){e=f(e);if(e){i.setAttrib(r,t,e)}});o(t.classes,function(e){e=f(e);if(!i.hasClass(r,e)){i.addClass(r,e)}});e.fire("PreviewFormats");i.setStyles(r,{position:"absolute",left:-65535});e.getBody().appendChild(r);u=i.getStyle(e.getBody(),"fontSize",true);u=/px$/.test(u)?parseInt(u,10):0;o(a.split(" "),function(t){var n=i.getStyle(r,t,true);if(t=="background-color"&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(n)){n=i.getStyle(e.getBody(),t,true);if(i.toHex(n).toLowerCase()=="#ffffff"){return}}if(t=="color"){if(i.toHex(n).toLowerCase()=="#000000"){return}}if(t=="font-size"){if(/em|%$/.test(n)){if(u===0){return}n=parseFloat(n,10)/(/%$/.test(n)?100:1);n=n*u+"px"}}if(t=="border"&&n){s+="padding:0 2px;"}s+=t+":"+n+";"});e.fire("AfterPreviewFormats");i.remove(r);return s}function i(t,n){return function(){var r=this;e.on("nodeChange",function(i){var s=e.formatter;var u=null;o(i.parents,function(e){o(t,function(t){if(n){if(s.matchNode(e,n,{value:t.value})){u=t.value}}else{if(s.matchNode(e,t.value)){u=t.value}}if(u){return false}});if(u){return false}});r.value(u)})}}function s(e){e=e.split(";");var t=e.length;while(t--){e[t]=e[t].split("=")}return e}function u(){function s(e){var r=[];if(!e){return}o(e,function(e){var i={text:e.title,icon:e.icon};if(e.items){i.menu=s(e.items)}else{var o=e.format||"custom"+t++;if(!e.format){e.name=o;n.push(e)}i.format=o}r.push(i)});return r}function u(){var t;if(e.settings.style_formats_merge){if(e.settings.style_formats){t=s(i.concat(e.settings.style_formats))}else{t=s(i)}}else{t=s(e.settings.style_formats||i)}return t}var t=0,n=[];var i=[{title:"Headers",items:[{title:"Header 1",format:"h1"},{title:"Header 2",format:"h2"},{title:"Header 3",format:"h3"},{title:"Header 4",format:"h4"},{title:"Header 5",format:"h5"},{title:"Header 6",format:"h6"}]},{title:"Inline",items:[{title:"Bold",icon:"bold",format:"bold"},{title:"Italic",icon:"italic",format:"italic"},{title:"Underline",icon:"underline",format:"underline"},{title:"Strikethrough",icon:"strikethrough",format:"strikethrough"},{title:"Superscript",icon:"superscript",format:"superscript"},{title:"Subscript",icon:"subscript",format:"subscript"},{title:"Code",icon:"code",format:"code"}]},{title:"Blocks",items:[{title:"Paragraph",format:"p"},{title:"Blockquote",format:"blockquote"},{title:"Div",format:"div"},{title:"Pre",format:"pre"}]},{title:"Alignment",items:[{title:"Left",icon:"alignleft",format:"alignleft"},{title:"Center",icon:"aligncenter",format:"aligncenter"},{title:"Right",icon:"alignright",format:"alignright"},{title:"Justify",icon:"alignjustify",format:"alignjustify"}]}];e.on("init",function(){o(n,function(t){e.formatter.register(t.name,t)})});return{type:"menu",items:u(),onPostRender:function(t){e.fire("renderFormatsMenu",{control:t.control})},itemDefaults:{preview:true,textStyle:function(){if(this.settings.format){return r(this.settings.format)}},onPostRender:function(){var t=this,n=this.settings.format;if(n){t.parent().on("show",function(){t.disabled(!e.formatter.canApply(n));t.active(e.formatter.match(n))})}},onclick:function(){if(this.settings.format){p(this.settings.format)}}}}}function a(){return e.undoManager?e.undoManager.hasUndo():false}function f(){return e.undoManager?e.undoManager.hasRedo():false}function l(){var t=this;t.disabled(!a());e.on("Undo Redo AddUndo TypingUndo",function(){t.disabled(!a())})}function c(){var t=this;t.disabled(!f());e.on("Undo Redo AddUndo TypingUndo",function(){t.disabled(!f())})}function h(){var t=this;e.on("VisualAid",function(e){t.active(e.hasVisual)});t.active(e.hasVisual)}function p(t){if(t.control){t=t.control.value()}if(t){e.execCommand("mceToggleFormat",false,t)}}var t;t=u();o({bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",subscript:"Subscript",superscript:"Superscript"},function(t,n){e.addButton(n,{tooltip:t,onPostRender:function(){var t=this;if(e.formatter){e.formatter.formatChanged(n,function(e){t.active(e)})}else{e.on("init",function(){e.formatter.formatChanged(n,function(e){t.active(e)})})}},onclick:function(){p(n)}})});o({outdent:["Decrease indent","Outdent"],indent:["Increase indent","Indent"],cut:["Cut","Cut"],copy:["Copy","Copy"],paste:["Paste","Paste"],help:["Help","mceHelp"],selectall:["Select all","SelectAll"],hr:["Insert horizontal rule","InsertHorizontalRule"],removeformat:["Clear formatting","RemoveFormat"],visualaid:["Visual aids","mceToggleVisualAid"],newdocument:["New document","mceNewDocument"]},function(t,n){e.addButton(n,{tooltip:t[0],cmd:t[1]})});o({blockquote:["Blockquote","mceBlockQuote"],numlist:["Numbered list","InsertOrderedList"],bullist:["Bullet list","InsertUnorderedList"],subscript:["Subscript","Subscript"],superscript:["Superscript","Superscript"],alignleft:["Align left","JustifyLeft"],aligncenter:["Align center","JustifyCenter"],alignright:["Align right","JustifyRight"],alignjustify:["Justify","JustifyFull"]},function(t,n){e.addButton(n,{tooltip:t[0],cmd:t[1],onPostRender:function(){var t=this;if(e.formatter){e.formatter.formatChanged(n,function(e){t.active(e)})}else{e.on("init",function(){e.formatter.formatChanged(n,function(e){t.active(e)})})}}})});e.addButton("undo",{tooltip:"Undo",onPostRender:l,cmd:"undo"});e.addButton("redo",{tooltip:"Redo",onPostRender:c,cmd:"redo"});e.addMenuItem("newdocument",{text:"New document",shortcut:"Ctrl+N",icon:"newdocument",cmd:"mceNewDocument"});e.addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Ctrl+Z",onPostRender:l,cmd:"undo"});e.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Ctrl+Y",onPostRender:c,cmd:"redo"});e.addMenuItem("visualaid",{text:"Visual aids",selectable:true,onPostRender:h,cmd:"mceToggleVisualAid"});o({cut:["Cut","Cut","Ctrl+X"],copy:["Copy","Copy","Ctrl+C"],paste:["Paste","Paste","Ctrl+V"],selectall:["Select all","SelectAll","Ctrl+A"],bold:["Bold","Bold","Ctrl+B"],italic:["Italic","Italic","Ctrl+I"],underline:["Underline","Underline"],strikethrough:["Strikethrough","Strikethrough"],subscript:["Subscript","Subscript"],superscript:["Superscript","Superscript"],removeformat:["Clear formatting","RemoveFormat"]},function(t,n){e.addMenuItem(n,{text:t[0],icon:n,shortcut:t[2],cmd:t[1]})});e.on("mousedown",function(){n.hideAll()});e.addButton("styleselect",{type:"menubutton",text:"Formats",menu:t});e.addButton("formatselect",function(){var t=[],n=s(e.settings.block_formats||"Paragraph=p;"+"Address=address;"+"Pre=pre;"+"Header 1=h1;"+"Header 2=h2;"+"Header 3=h3;"+"Header 4=h4;"+"Header 5=h5;"+"Header 6=h6");o(n,function(e){t.push({text:e[0],value:e[1],textStyle:function(){return r(e[1])}})});return{type:"listbox",text:n[0][0],values:t,fixedWidth:true,onselect:p,onPostRender:i(t)}});e.addButton("fontselect",function(){var t="Andale Mono=andale mono,times;"+"Arial=arial,helvetica,sans-serif;"+"Arial Black=arial black,avant garde;"+"Book Antiqua=book antiqua,palatino;"+"Comic Sans MS=comic sans ms,sans-serif;"+"Courier New=courier new,courier;"+"Georgia=georgia,palatino;"+"Helvetica=helvetica;"+"Impact=impact,chicago;"+"Symbol=symbol;"+"Tahoma=tahoma,arial,helvetica,sans-serif;"+"Terminal=terminal,monaco;"+"Times New Roman=times new roman,times;"+"Trebuchet MS=trebuchet ms,geneva;"+"Verdana=verdana,geneva;"+"Webdings=webdings;"+"Wingdings=wingdings,zapf dingbats";var n=[],r=s(e.settings.font_formats||t);o(r,function(e){n.push({text:{raw:e[0]},value:e[1],textStyle:e[1].indexOf("dings")==-1?"font-family:"+e[1]:""})});return{type:"listbox",text:"Font Family",tooltip:"Font Family",values:n,fixedWidth:true,onPostRender:i(n,"fontname"),onselect:function(t){if(t.control.settings.value){e.execCommand("FontName",false,t.control.settings.value)}}}});e.addButton("fontsizeselect",function(){var t=[],n="8pt 10pt 12pt 14pt 18pt 24pt 36pt";var r=e.settings.fontsize_formats||n;o(r.split(" "),function(e){t.push({text:e,value:e})});return{type:"listbox",text:"Font Sizes",tooltip:"Font Sizes",values:t,fixedWidth:true,onPostRender:i(t,"fontsize"),onclick:function(t){if(t.control.settings.value){e.execCommand("FontSize",false,t.control.settings.value)}}}});e.addMenuItem("formats",{text:"Formats",menu:t})}var o=r.each;i.on("AddEditor",function(t){if(t.editor.rtl){e.rtl=true}u(t.editor)});e.translate=function(e){return i.translate(e)};t.tooltips=!s.iOS});i("tinymce/ui/GridLayout",["tinymce/ui/AbsoluteLayout"],function(e){"use strict";return e.extend({recalc:function(e){var t=e.settings,n,r,i,s,o,u,a,f,l,c,h,p,d,v,m,g,y,b,w,E,S,x,T=[],N=[],C,k,L,A,O,M;t=e.settings;i=e.items().filter(":visible");s=e.layoutRect();r=t.columns||Math.ceil(Math.sqrt(i.length));n=Math.ceil(i.length/r);y=t.spacingH||t.spacing||0;b=t.spacingV||t.spacing||0;w=t.alignH||t.align;E=t.alignV||t.align;m=e._paddingBox;if(w&&typeof w=="string"){w=[w]}if(E&&typeof E=="string"){E=[E]}for(c=0;cT[c]?C:T[c];N[h]=k>N[h]?k:N[h]}}O=s.innerW-m.left-m.right;for(S=0,c=0;c0?y:0);O-=(c>0?y:0)+T[c]}M=s.innerH-m.top-m.bottom;for(x=0,h=0;h0?b:0);M-=(h>0?b:0)+N[h]}S+=m.left+m.right;x+=m.top+m.bottom;a={};a.minW=S+(s.w-s.innerW);a.minH=x+(s.h-s.innerH);a.contentW=a.minW-s.deltaW;a.contentH=a.minH-s.deltaH;a.minW=Math.min(a.minW,s.maxW);a.minH=Math.min(a.minH,s.maxH);a.minW=Math.max(a.minW,s.startMinWidth);a.minH=Math.max(a.minH,s.startMinHeight);if(s.autoResize&&(a.minW!=s.minW||a.minH!=s.minH)){a.w=a.minW;a.h=a.minH;e.layoutRect(a);this.recalc(e);if(e._lastRect===null){var _=e.parent();if(_){_._lastRect=null;_.recalc()}}return}if(s.autoResize){a=e.layoutRect(a);a.contentW=a.minW-s.deltaW;a.contentH=a.minH-s.deltaH}var D;if(t.packV=="start"){D=0}else{D=M>0?Math.floor(M/n):0}var P=0;var H=t.flexWidths;if(H){for(c=0;c'},src:function(e){this.getEl().src=e},html:function(e,t){var n=this,r=this.getEl().contentWindow.document.body;if(!r){setTimeout(function(){n.html(e)},0)}else{r.innerHTML=e;if(t){t()}}return this}})});i("tinymce/ui/Label",["tinymce/ui/Widget","tinymce/ui/DomUtils"],function(e,t){"use strict";return e.extend({init:function(e){var t=this;t._super(e);t.addClass("widget");t.addClass("label");t.canFocus=false;if(e.multiline){t.addClass("autoscroll")}if(e.strong){t.addClass("strong")}},initLayoutRect:function(){var e=this,n=e._super();if(e.settings.multiline){var r=t.getSize(e.getEl());if(r.width>n.maxW){n.minW=n.maxW;e.addClass("multiline")}e.getEl().style.width=n.minW+"px";n.startMinH=n.h=n.minH=Math.min(n.maxH,t.getSize(e.getEl()).height)}return n},repaint:function(){var e=this;if(!e.settings.multiline){e.getEl().style.lineHeight=e.layoutRect().h+"px"}return e._super()},text:function(e){var t=this;if(t._rendered&&e){this.innerHtml(t.encode(e))}return t._super(e)},renderHtml:function(){var e=this,t=e.settings.forId;return'"}})});i("tinymce/ui/Toolbar",["tinymce/ui/Container","tinymce/ui/KeyboardNavigation"],function(e,t){"use strict";return e.extend({Defaults:{role:"toolbar",layout:"flow"},init:function(e){var t=this;t._super(e);t.addClass("toolbar")},postRender:function(){var e=this;e.items().addClass("toolbar-item");e.keyNav=new t({root:e,enableLeftRight:true});return e._super()}})});i("tinymce/ui/MenuBar",["tinymce/ui/Toolbar"],function(e){"use strict";return e.extend({Defaults:{role:"menubar",containerCls:"menubar",defaults:{type:"menubutton"}}})});i("tinymce/ui/MenuButton",["tinymce/ui/Button","tinymce/ui/Factory","tinymce/ui/MenuBar"],function(e,t,n){"use strict";function r(e,t){while(e){if(t===e){return true}e=e.parentNode}return false}var i=e.extend({init:function(e){var t=this;t._renderOpen=true;t._super(e);t.addClass("menubtn");if(e.fixedWidth){t.addClass("fixed-width")}t.aria("haspopup",true);t.hasPopup=true},showMenu:function(){var e=this,n=e.settings,r;if(e.menu&&e.menu.visible()){return e.hideMenu()}if(!e.menu){r=n.menu||[];if(r.length){r={type:"menu",items:r}}else{r.type=r.type||"menu"}e.menu=t.create(r).parent(e).renderTo(e.getContainerElm());e.fire("createmenu");e.menu.reflow();e.menu.on("cancel",function(t){if(t.control===e.menu){e.focus()}});e.menu.on("show hide",function(t){if(t.control==e.menu){e.activeMenu(t.type=="show")}}).fire("show");e.aria("expanded",true)}e.menu.show();e.menu.layoutRect({w:e.layoutRect().w});e.menu.moveRel(e.getEl(),e.isRtl()?["br-tr","tr-br"]:["bl-tl","tl-bl"])},hideMenu:function(){var e=this;if(e.menu){e.menu.items().each(function(e){if(e.hideMenu){e.hideMenu()}});e.menu.hide();e.aria("expanded",false)}},activeMenu:function(e){this.toggleClass("active",e)},renderHtml:function(){var e=this,t=e._id,r=e.classPrefix;var i=e.settings.icon?r+"ico "+r+"i-"+e.settings.icon:"";e.aria("role",e.parent()instanceof n?"menuitem":"button");return'
'+'"+"
"},postRender:function(){var e=this;e.on("click",function(t){if(t.control===e&&r(t.target,e.getEl())){e.showMenu();if(t.keyboard){e.menu.items()[0].focus()}}});e.on("mouseenter",function(t){var n=t.control,r=e.parent(),s;if(n&&r&&n instanceof i&&n.parent()==r){r.items().filter("MenuButton").each(function(e){if(e.hideMenu&&e!=n){if(e.menu&&e.menu.visible()){s=true}e.hideMenu()}});if(s){n.focus();n.showMenu()}}});return e._super()},text:function(e){var t=this,n,r;if(t._rendered){r=t.getEl("open").getElementsByTagName("span");for(n=0;n'+(s!=="-"?' ":"")+(s!=="-"?''+s+"":"")+(a?'
'+a+"
":"")+(r.menu?'
':"")+""},postRender:function(){var e=this,t=e.settings;var n=t.textStyle;if(typeof n=="function"){n=n.call(this)}if(n){var r=e.getEl("text");if(r){r.setAttribute("style",n)}}return e._super()},remove:function(){this._super();if(this.menu){this.menu.remove()}}})});i("tinymce/ui/Menu",["tinymce/ui/FloatPanel","tinymce/ui/KeyboardNavigation","tinymce/ui/MenuItem","tinymce/util/Tools"],function(e,t,n,r){"use strict";var i=e.extend({Defaults:{defaultType:"menuitem",border:1,layout:"stack",role:"menu"},init:function(e){var i=this;e.autohide=true;e.constrainToViewport=true;if(e.itemDefaults){var s=e.items,o=s.length;while(o--){s[o]=r.extend({},e.itemDefaults,s[o])}}i._super(e);i.addClass("menu");i.keyNav=new t({root:i,enableUpDown:true,enableLeftRight:true,leftAction:function(){if(i.parent()instanceof n){i.keyNav.cancel()}},onCancel:function(){i.fire("cancel",{},false);i.hide()}})},repaint:function(){this.toggleClass("menu-align",true);this._super();this.getEl().style.height="";this.getEl("body").style.height="";return this},cancel:function(){var e=this;e.hideAll();e.fire("cancel");e.fire("select")},hideAll:function(){var e=this;this.find("menuitem").exec("hideMenu");return e._super()},preRender:function(){var e=this;e.items().each(function(t){var n=t.settings;if(n.icon||n.selectable){e._hasIcons=true;return false}});return e._super()}});return i});i("tinymce/ui/Radio",["tinymce/ui/Checkbox"],function(e){"use strict";return e.extend({Defaults:{classes:"radio",role:"radio"}})});i("tinymce/ui/ResizeHandle",["tinymce/ui/Widget","tinymce/ui/DragHelper"],function(e,t){"use strict";return e.extend({renderHtml:function(){var e=this,t=e.classPrefix;e.addClass("resizehandle");if(e.settings.direction=="both"){e.addClass("resizehandle-both")}e.canFocus=false;return'
'+''+"
"},postRender:function(){var e=this;e._super();e.resizeDragHelper=new t(this._id,{start:function(){e.fire("ResizeStart")},drag:function(t){if(e.settings.direction!="both"){t.deltaX=0}e.fire("Resize",t)},stop:function(){e.fire("ResizeEnd")}})},remove:function(){if(this.resizeDragHelper){this.resizeDragHelper.destroy()}return this._super()}})});i("tinymce/ui/Spacer",["tinymce/ui/Widget"],function(e){"use strict";return e.extend({renderHtml:function(){var e=this;e.addClass("spacer");e.canFocus=false;return'
'}})});i("tinymce/ui/SplitButton",["tinymce/ui/MenuButton","tinymce/ui/DomUtils"],function(e,t){return e.extend({Defaults:{classes:"widget btn splitbtn",role:"splitbutton"},repaint:function(){var e=this,n=e.getEl(),r=e.layoutRect(),i,s;e._super();i=n.firstChild;s=n.lastChild;t.css(i,{width:r.w-t.getSize(s).width,height:r.h-2});t.css(s,{height:r.h-2});return e},activeMenu:function(e){var n=this;t.toggleClass(n.getEl().lastChild,n.classPrefix+"active",e)},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix;var r=e.settings.icon?n+"ico "+n+"i-"+e.settings.icon:"";return'
'+'"+'"+"
"},postRender:function(){var e=this,t=e.settings.onclick;e.on("click",function(e){var n=e.target;if(e.control==this){while(n){if(n.nodeName=="BUTTON"&&n.className.indexOf("open")==-1){e.stopImmediatePropagation();t.call(this,e);return}n=n.parentNode}}});delete e.settings.onclick;return e._super()}})});i("tinymce/ui/StackLayout",["tinymce/ui/FlowLayout"],function(e){"use strict";return e.extend({Defaults:{containerClass:"stack-layout",controlClass:"stack-layout-item",endClass:"break"}})});i("tinymce/ui/TabPanel",["tinymce/ui/Panel","tinymce/ui/DomUtils"],function(e,t){"use strict";return e.extend({lastIdx:0,Defaults:{layout:"absolute",defaults:{type:"panel"}},activateTab:function(e){if(this.activeTabId){t.removeClass(this.getEl(this.activeTabId),this.classPrefix+"active")}this.activeTabId="t"+e;t.addClass(this.getEl("t"+e),this.classPrefix+"active");if(e!=this.lastIdx){this.items()[this.lastIdx].hide();this.lastIdx=e}this.items()[e].show().fire("showtab");this.reflow()},renderHtml:function(){var e=this,t=e._layout,n="",r=e.classPrefix;e.preRender();t.preRender(e);e.items().each(function(t,i){n+='
'+e.encode(t.settings.title)+"
"});return'
'+'
'+n+"
"+'
'+t.renderHtml(e)+"
"+"
"},postRender:function(){var e=this;e._super();e.settings.activeTab=e.settings.activeTab||0;e.activateTab(e.settings.activeTab);this.on("click",function(t){var n=t.target.parentNode;if(t.target.parentNode.id==e._id+"-head"){var r=n.childNodes.length;while(r--){if(n.childNodes[r]==t.target){e.activateTab(r)}}}})},initLayoutRect:function(){var e=this,n,r,i;r=t.getSize(e.getEl("head")).width;r=r<0?0:r;i=0;e.items().each(function(t,n){r=Math.max(r,t.layoutRect().minW);i=Math.max(i,t.layoutRect().minH);if(e.settings.activeTab!=n){t.hide()}});e.items().each(function(e){e.settings.x=0;e.settings.y=0;e.settings.w=r;e.settings.h=i;e.layoutRect({x:0,y:0,w:r,h:i})});var s=t.getSize(e.getEl("head")).height;e.settings.minWidth=r;e.settings.minHeight=i+s;n=e._super();n.deltaH+=s;n.innerH=n.h-n.deltaH;return n}})});i("tinymce/ui/TextBox",["tinymce/ui/Widget","tinymce/ui/DomUtils"],function(e,t){"use strict";return e.extend({init:function(e){var t=this;t._super(e);t._value=e.value||"";t.addClass("textbox");if(e.multiline){t.addClass("multiline")}else{t.on("keydown",function(e){if(e.keyCode==13){t.parents().reverse().each(function(t){e.preventDefault();if(t.hasEventListeners("submit")&&t.toJSON){t.fire("submit",{data:t.toJSON()});return false}})}})}},disabled:function(e){var t=this;if(t._rendered&&typeof e!="undefined"){t.getEl().disabled=e}return t._super(e)},value:function(e){var t=this;if(typeof e!="undefined"){t._value=e;if(t._rendered){t.getEl().value=e}return t}if(t._rendered){return t.getEl().value}return t._value},repaint:function(){var e=this,t,n,r,i=0,s=0,o;t=e.getEl().style;n=e._layoutRect;o=e._lastRepaintRect||{};var u=document;if(!e.settings.multiline&&u.all&&(!u.documentMode||u.documentMode<=8)){t.lineHeight=n.h-s+"px"}r=e._borderBox;i=r.left+r.right+8;s=r.top+r.bottom+(e.settings.multiline?8:0);if(n.x!==o.x){t.left=n.x+"px";o.x=n.x}if(n.y!==o.y){t.top=n.y+"px";o.y=n.y}if(n.w!==o.w){t.width=n.w-i+"px";o.w=n.w}if(n.h!==o.h){t.height=n.h-s+"px";o.h=n.h}e._lastRepaintRect=o;e.fire("repaint",{},false);return e},renderHtml:function(){var e=this,t=e._id,n=e.settings,r=e.encode(e._value,false),i="";if("spellcheck"in n){i+=' spellcheck="'+n.spellcheck+'"'}if(n.maxLength){i+=' maxlength="'+n.maxLength+'"'}if(n.size){i+=' size="'+n.size+'"'}if(n.subtype){i+=' type="'+n.subtype+'"'}if(e.disabled()){i+=' disabled="disabled"'}if(n.multiline){return'"}return'"},postRender:function(){var e=this;t.on(e.getEl(),"change",function(t){e.fire("change",t)});return e._super()},remove:function(){t.off(this.getEl());this._super()}})});i("tinymce/ui/Throbber",["tinymce/ui/DomUtils"],function(e){"use strict";return function(t){var n=this,r;n.show=function(i){n.hide();r=true;window.setTimeout(function(){if(r){t.appendChild(e.createFragment('
'))}},i||0);return n};n.hide=function(){var e=t.lastChild;if(e&&e.className.indexOf("throbber")!=-1){e.parentNode.removeChild(e)}r=false;return n}}});u(["tinymce/dom/EventUtils","tinymce/dom/Sizzle","tinymce/dom/DomQuery","tinymce/html/Styles","tinymce/dom/TreeWalker","tinymce/util/Tools","tinymce/dom/Range","tinymce/html/Entities","tinymce/Env","tinymce/dom/StyleSheetLoader","tinymce/dom/DOMUtils","tinymce/dom/ScriptLoader","tinymce/AddOnManager","tinymce/html/Node","tinymce/html/Schema","tinymce/html/SaxParser","tinymce/html/DomParser","tinymce/html/Writer","tinymce/html/Serializer","tinymce/dom/Serializer","tinymce/dom/TridentSelection","tinymce/util/VK","tinymce/dom/ControlSelection","tinymce/dom/Selection","tinymce/dom/RangeUtils","tinymce/Formatter","tinymce/UndoManager","tinymce/EnterKey","tinymce/ForceBlocks","tinymce/EditorCommands","tinymce/util/URI","tinymce/util/Class","tinymce/ui/Selector","tinymce/ui/Collection","tinymce/ui/DomUtils","tinymce/ui/Control","tinymce/ui/Factory","tinymce/ui/Container","tinymce/ui/DragHelper","tinymce/ui/Scrollable","tinymce/ui/Panel","tinymce/ui/Movable","tinymce/ui/Resizable","tinymce/ui/FloatPanel","tinymce/ui/KeyboardNavigation","tinymce/ui/Window","tinymce/ui/MessageBox","tinymce/WindowManager","tinymce/util/Quirks","tinymce/util/Observable","tinymce/Shortcuts","tinymce/Editor","tinymce/util/I18n","tinymce/FocusManager","tinymce/EditorManager","tinymce/LegacyInput","tinymce/util/XHR","tinymce/util/JSON","tinymce/util/JSONRequest","tinymce/util/JSONP","tinymce/util/LocalStorage","tinymce/Compat","tinymce/ui/Layout","tinymce/ui/AbsoluteLayout","tinymce/ui/Tooltip","tinymce/ui/Widget","tinymce/ui/Button","tinymce/ui/ButtonGroup","tinymce/ui/Checkbox","tinymce/ui/PanelButton","tinymce/ui/ColorButton","tinymce/ui/ComboBox","tinymce/ui/Path","tinymce/ui/ElementPath","tinymce/ui/FormItem","tinymce/ui/Form","tinymce/ui/FieldSet","tinymce/ui/FilePicker","tinymce/ui/FitLayout","tinymce/ui/FlexLayout","tinymce/ui/FlowLayout","tinymce/ui/FormatControls","tinymce/ui/GridLayout","tinymce/ui/Iframe","tinymce/ui/Label","tinymce/ui/Toolbar","tinymce/ui/MenuBar","tinymce/ui/MenuButton","tinymce/ui/ListBox","tinymce/ui/MenuItem","tinymce/ui/Menu","tinymce/ui/Radio","tinymce/ui/ResizeHandle","tinymce/ui/Spacer","tinymce/ui/SplitButton","tinymce/ui/StackLayout","tinymce/ui/TabPanel","tinymce/ui/TextBox","tinymce/ui/Throbber"])})(this)