/* SCEditor v2.1.3 | (C) 2017, Sam Clarke | sceditor.com/license */ !function(o){"use strict";function e(e,t){return typeof t===e}o=o&&o.hasOwnProperty("default")?o.default:o;var ye=e.bind(null,"string"),xe=e.bind(null,"undefined"),we=e.bind(null,"function"),i=e.bind(null,"number");function t(e){return!Object.keys(e).length}function Ce(e,t){for(var n=e===!!e,o=n?2:1,i=n?t:e,r=!!n&&e;o":">"," ":"  ","\r\n":"
","\r":"
","\n":"
"};return!1!==t&&(n['"']=""",n["'"]="'",n["`"]="`"),e.replace(/ {2}|\r\n|[&<>\r\n'"`]/g,function(e){return n[e]||e})}var y={html:'

',toolbarButton:'
{dispName}
',emoticon:'{key}',fontOpt:'{font}',sizeOpt:'{size}',pastetext:'
',table:'
',image:'
',email:'
',link:'
',youtubeMenu:'
',youtube:''};function gt(e,t,n){var o=y[e];return Object.keys(t).forEach(function(e){o=o.replace(new RegExp(ft("{"+e+"}"),"g"),t[e])}),n&&(o=et(o)),o}var x=v&&v<11;function w(e){if("mozHidden"in document)for(var t,n=e.getBody();n;){if((t=n).firstChild)t=t.firstChild;else{for(;t&&!t.nextSibling;)t=t.parentNode;t&&(t=t.nextSibling)}3===n.nodeType&&/[\n\r\t]+/.test(n.nodeValue)&&(/^pre/.test(Pe(n.parentNode,"whiteSpace"))||Re(n)),n=t}}var mt={bold:{exec:"bold",tooltip:"Bold",shortcut:"Ctrl+B"},italic:{exec:"italic",tooltip:"Italic",shortcut:"Ctrl+I"},underline:{exec:"underline",tooltip:"Underline",shortcut:"Ctrl+U"},strike:{exec:"strikethrough",tooltip:"Strikethrough"},subscript:{exec:"subscript",tooltip:"Subscript"},superscript:{exec:"superscript",tooltip:"Superscript"},left:{state:function(e){if(e&&3===e.nodeType&&(e=e.parentNode),e){var t="ltr"===Pe(e,"direction"),n=Pe(e,"textAlign");return"left"===n||n===(t?"start":"end")}},exec:"justifyleft",tooltip:"Align left"},center:{exec:"justifycenter",tooltip:"Center"},right:{state:function(e){if(e&&3===e.nodeType&&(e=e.parentNode),e){var t="ltr"===Pe(e,"direction"),n=Pe(e,"textAlign");return"right"===n||n===(t?"end":"start")}},exec:"justifyright",tooltip:"Align right"},justify:{exec:"justifyfull",tooltip:"Justify"},font:{_dropDown:function(t,e,n){var o=De("div");ze(o,"click","a",function(e){n(Ve(this,"font")),t.closeDropDown(!0),e.preventDefault()}),t.opts.fonts.split(",").forEach(function(e){He(o,gt("fontOpt",{font:e},!0))}),t.createDropDown(e,"font-picker",o)},exec:function(e){var t=this;mt.font._dropDown(t,e,function(e){t.execCommand("fontname",e)})},tooltip:"Font Name"},size:{_dropDown:function(t,e,n){var o=De("div");ze(o,"click","a",function(e){n(Ve(this,"size")),t.closeDropDown(!0),e.preventDefault()});for(var i=1;i<=7;i++)He(o,gt("sizeOpt",{size:i},!0));t.createDropDown(e,"fontsize-picker",o)},exec:function(e){var t=this;mt.size._dropDown(t,e,function(e){t.execCommand("fontsize",e)})},tooltip:"Font Size"},color:{_dropDown:function(t,e,n){var o=De("div"),i="",r=mt.color;r._htmlCache||(t.opts.colors.split("|").forEach(function(e){i+='
',e.split(",").forEach(function(e){i+=''}),i+="
"}),r._htmlCache=i),He(o,et(r._htmlCache)),ze(o,"click","a",function(e){n(Ve(this,"color")),t.closeDropDown(!0),e.preventDefault()}),t.createDropDown(e,"color-picker",o)},exec:function(e){var t=this;mt.color._dropDown(t,e,function(e){t.execCommand("forecolor",e)})},tooltip:"Font Color"},removeformat:{exec:"removeformat",tooltip:"Remove Formatting"},cut:{exec:"cut",tooltip:"Cut",errorMessage:"Your browser does not allow the cut command. Please use the keyboard shortcut Ctrl/Cmd-X"},copy:{exec:"copy",tooltip:"Copy",errorMessage:"Your browser does not allow the copy command. Please use the keyboard shortcut Ctrl/Cmd-C"},paste:{exec:"paste",tooltip:"Paste",errorMessage:"Your browser does not allow the paste command. Please use the keyboard shortcut Ctrl/Cmd-V"},pastetext:{exec:function(e){var t,n=De("div"),o=this;He(n,gt("pastetext",{label:o._("Paste your text inside the following box:"),insert:o._("Insert")},!0)),ze(n,"click",".button",function(e){(t=Fe(n,"#txt")[0].value)&&o.wysiwygEditorInsertText(t),o.closeDropDown(!0),e.preventDefault()}),o.createDropDown(e,"pastetext",n)},tooltip:"Paste Text"},bulletlist:{exec:function(){w(this),this.execCommand("insertunorderedlist")},tooltip:"Bullet list"},orderedlist:{exec:function(){w(this),this.execCommand("insertorderedlist")},tooltip:"Numbered list"},indent:{state:function(e,t){var n,o,i;return je(t,"li")?0:je(t,"ul,ol,menu")&&(o=(n=this.getRangeHelper().selectedRange()).startContainer.parentNode,i=n.endContainer.parentNode,o!==o.parentNode.firstElementChild||je(i,"li")&&i!==i.parentNode.lastElementChild)?0:-1},exec:function(){var e=this.getRangeHelper().getFirstBlockParent();this.focus(),Me(e,"ul,ol,menu")&&this.execCommand("indent")},tooltip:"Add indent"},outdent:{state:function(e,t){return Me(t,"ul,ol,menu")?0:-1},exec:function(){Me(this.getRangeHelper().getFirstBlockParent(),"ul,ol,menu")&&this.execCommand("outdent")},tooltip:"Remove one indent"},table:{exec:function(e){var i=this,r=De("div");He(r,gt("table",{rows:i._("Rows:"),cols:i._("Cols:"),insert:i._("Insert")},!0)),ze(r,"click",".button",function(e){var t=Number(Fe(r,"#rows")[0].value),n=Number(Fe(r,"#cols")[0].value),o="";0"+Array(n+1).join("")+""),o+="
"+(x?"":"
")+"
",i.wysiwygEditorInsertHtml(o),i.closeDropDown(!0),e.preventDefault())}),i.createDropDown(e,"inserttable",r)},tooltip:"Insert a table"},horizontalrule:{exec:"inserthorizontalrule",tooltip:"Insert a horizontal rule"},code:{exec:function(){this.wysiwygEditorInsertHtml("",(x?"":"
")+"
")},tooltip:"Code"},image:{_dropDown:function(t,e,n,o){var i=De("div");He(i,gt("image",{url:t._("URL:"),width:t._("Width (optional):"),height:t._("Height (optional):"),insert:t._("Insert")},!0));var r=Fe(i,"#image")[0];r.value=n,ze(i,"click",".button",function(e){r.value&&o(r.value,Fe(i,"#width")[0].value,Fe(i,"#height")[0].value),t.closeDropDown(!0),e.preventDefault()}),t.createDropDown(e,"insertimage",i)},exec:function(e){var i=this;mt.image._dropDown(i,e,"",function(e,t,n){var o="";t&&(o+=' width="'+t+'"'),n&&(o+=' height="'+n+'"'),i.wysiwygEditorInsertHtml("')})},tooltip:"Insert an image"},email:{_dropDown:function(n,e,o){var i=De("div");He(i,gt("email",{label:n._("E-mail:"),desc:n._("Description (optional):"),insert:n._("Insert")},!0)),ze(i,"click",".button",function(e){var t=Fe(i,"#email")[0].value;t&&o(t,Fe(i,"#des")[0].value),n.closeDropDown(!0),e.preventDefault()}),n.createDropDown(e,"insertemail",i)},exec:function(e){var n=this;mt.email._dropDown(n,e,function(e,t){n.focus(),!n.getRangeHelper().selectedHtml()||t?n.wysiwygEditorInsertHtml(''+(t||e)+""):n.execCommand("createlink","mailto:"+e)})},tooltip:"Insert an email"},link:{_dropDown:function(t,e,n){var o=De("div");He(o,gt("link",{url:t._("URL:"),desc:t._("Description (optional):"),ins:t._("Insert")},!0));var i=Fe(o,"#link")[0];function r(e){i.value&&n(i.value,Fe(o,"#des")[0].value),t.closeDropDown(!0),e.preventDefault()}ze(o,"click",".button",r),ze(o,"keypress",function(e){13===e.which&&i.value&&r(e)},_e),t.createDropDown(e,"insertlink",o)},exec:function(e){var n=this;mt.link._dropDown(n,e,function(e,t){n.focus(),t||!n.getRangeHelper().selectedHtml()?(t=t||e,n.wysiwygEditorInsertHtml(''+t+"")):n.execCommand("createlink",e)})},tooltip:"Insert a link"},unlink:{state:function(){return Me(this.currentNode(),"a")?0:-1},exec:function(){var e=Me(this.currentNode(),"a");if(e){for(;e.firstChild;)We(e.firstChild,e);Re(e)}},tooltip:"Unlink"},quote:{exec:function(e,t,n){var o="
",i="
";t?(o=o+(n=n?""+n+"":"")+t+i,i=null):""===this.getRangeHelper().selectedHtml()&&(i=(x?"":"
")+i),this.wysiwygEditorInsertHtml(o,i)},tooltip:"Insert a Quote"},emoticon:{exec:function(f){var p=this,g=function(e){var t,n,o=p.opts,i=o.emoticonsRoot||"",r=o.emoticonsCompat,a=p.getRangeHelper(),l=r&&" "!==a.getOuterText(!0,1)?" ":"",c=r&&" "!==a.getOuterText(!1,1)?" ":"",s=De("div"),u=De("div"),d=Ce({},o.emoticons.dropdown,e?o.emoticons.more:{});return He(s,u),n=Math.sqrt(Object.keys(d).length),ze(s,"click","img",function(e){p.insert(l+Oe(this,"alt")+c,null,!1).closeDropDown(!0),e.preventDefault()}),Se(d,function(e,t){He(u,De("img",{src:i+(t.url||t),alt:e,title:t.tooltip||e})),u.children.length>=n&&(u=De("div"),He(s,u))}),!e&&o.emoticons.more&&(He(t=De("a",{className:"sceditor-more"}),document.createTextNode(p._("More"))),ze(t,"click",function(e){p.createDropDown(f,"more-emoticons",g(!0)),e.preventDefault()}),He(s,t)),s};p.createDropDown(f,"emoticons",g(!1))},txtExec:function(e){mt.emoticon.exec.call(this,e)},tooltip:"Insert an emoticon"},youtube:{_dropDown:function(r,e,a){var l=De("div");He(l,gt("youtubeMenu",{label:r._("Video URL:"),insert:r._("Insert")},!0)),ze(l,"click",".button",function(e){var t=Fe(l,"#link")[0].value,n=t.match(/(?:v=|v\/|embed\/|youtu.be\/)(.{11})/),o=t.match(/[&|?](?:star)?t=((\d+[hms]?){1,3})/),i=0;o&&Se(o[1].split(/[hms]/),function(e,t){""!==t&&(i=60*i+Number(t))}),n&&/^[a-zA-Z0-9_\-]{11}$/.test(n[1])&&a(n[1],i),r.closeDropDown(!0),e.preventDefault()}),r.createDropDown(e,"insertlink",l)},exec:function(e){var n=this;mt.youtube._dropDown(n,e,function(e,t){n.wysiwygEditorInsertHtml(gt("youtube",{id:e,time:t}))})},tooltip:"Insert a YouTube video"},date:{_date:function(e){var t=new Date,n=t.getYear(),o=t.getMonth()+1,i=t.getDate();return n<2e3&&(n=1900+n),o<10&&(o="0"+o),i<10&&(i="0"+i),e.opts.dateFormat.replace(/year/i,n).replace(/month/i,o).replace(/day/i,i)},exec:function(){this.insertText(mt.date._date(this))},txtExec:function(){this.insertText(mt.date._date(this))},tooltip:"Insert current date"},time:{_time:function(){var e=new Date,t=e.getHours(),n=e.getMinutes(),o=e.getSeconds();return t<10&&(t="0"+t),n<10&&(n="0"+n),o<10&&(o="0"+o),t+":"+n+":"+o},exec:function(){this.insertText(mt.time._time())},txtExec:function(){this.insertText(mt.time._time())},tooltip:"Insert current time"},ltr:{state:function(e,t){return t&&"ltr"===t.style.direction},exec:function(){var e=this.getRangeHelper(),t=e.getFirstBlockParent();this.focus(),(t&&!je(t,"body")||(this.execCommand("formatBlock","p"),(t=e.getFirstBlockParent())&&!je(t,"body")))&&Pe(t,"direction","ltr"===Pe(t,"direction")?"":"ltr")},tooltip:"Left-to-Right"},rtl:{state:function(e,t){return t&&"rtl"===t.style.direction},exec:function(){var e=this.getRangeHelper(),t=e.getFirstBlockParent();this.focus(),(t&&!je(t,"body")||(this.execCommand("formatBlock","p"),(t=e.getFirstBlockParent())&&!je(t,"body")))&&Pe(t,"direction","rtl"===Pe(t,"direction")?"":"rtl")},tooltip:"Right-to-Left"},print:{exec:"print",tooltip:"Print"},maximize:{state:function(){return this.maximize()},exec:function(){this.maximize(!this.maximize())},txtExec:function(){this.maximize(!this.maximize())},tooltip:"Maximize",shortcut:"Ctrl+Shift+M"},source:{state:function(){return this.sourceMode()},exec:function(){this.toggleSourceMode()},txtExec:function(){this.toggleSourceMode()},tooltip:"View source",shortcut:"Ctrl+Shift+S"},ignore:{}},C={};function ht(r){var i=this,a=[],l=function(e){return"signal"+e.charAt(0).toUpperCase()+e.slice(1)},e=function(e,t){e=[].slice.call(e);var n,o,i=l(e.shift());for(n=0;nc.length&&s&&3===s.nodeType;)o=s.nodeValue,i=n-c.length,l&&(a=o.length,r=0),l=s,t?(u=r=Math.max(a-i,0),c=o.substr(r,a-r)+c,s=l.previousSibling):(u=r+(a=Math.min(i,o.length)),c+=o.substr(r,a),s=l.nextSibling);return{node:l||s,offset:u,text:c}};function vt(r,e){var a,l,c=e||r.contentDocument||r.document,s="sceditor-start-marker",u="sceditor-end-marker",b=this;b.insertHTML=function(e,t){var n,o;if(!b.selectedRange())return!1;for(t&&(e+=b.selectedHtml()+t),o=De("p",{},c),n=c.createDocumentFragment(),o.innerHTML=e;o.firstChild;)He(n,o.firstChild);b.insertNode(n)},l=function(e,t,n){var o,i=c.createDocumentFragment();if("string"==typeof e?(t&&(e+=b.selectedHtml()+t),i=et(e)):(He(i,e),t&&(He(i,b.selectedRange().extractContents()),He(i,t))),o=i.lastChild){for(;!it(o.lastChild,!0);)o=o.lastChild;if(ot(o)?o.lastChild||He(o,document.createTextNode("​")):o=i,b.removeMarkers(),He(o,a(s)),He(o,a(u)),n){var r=De("div");return He(r,i),r.innerHTML}return i}},b.insertNode=function(e,t){var n=l(e,t),o=b.selectedRange(),i=o.commonAncestorContainer;if(!n)return!1;o.deleteContents(),i&&3!==i.nodeType&&!ot(i)?We(n,i):o.insertNode(n),b.restoreRange()},b.cloneSelected=function(){var e=b.selectedRange();if(e)return e.cloneRange()},b.selectedRange=function(){var e,t,n=r.getSelection();if(n){if(n.rangeCount<=0){for(t=c.body;t.firstChild;)t=t.firstChild;(e=c.createRange()).setStartBefore(t),n.addRange(e)}return 0'})},void n.readAsDataURL(t);a[l[s]]=r.getData(l[s])}a.text=a["text/plain"],a.html=a["text/html"],V(a)}else if(!T){var u=i.scrollTop;for(v.saveRange(),T=yt.createDocumentFragment();i.firstChild;)He(T,i.firstChild);setTimeout(function(){var e=i.innerHTML;i.innerHTML="",He(i,T),i.scrollTop=u,T=!1,v.restoreRange(),V({html:e})},0)}},V=function(e){var t=De("div",{},d);i.call("pasteRaw",e),Qe(w,"pasteraw",e),e.html?(t.innerHTML=e.html,rt(t)):t.innerHTML=pt(e.text||"");var n={val:t.innerHTML};"fragmentToSource"in a&&(n.val=a.fragmentToSource(n.val,d,b)),i.call("paste",n),Qe(w,"paste",n),"fragmentToHtml"in a&&(n.val=a.fragmentToHtml(n.val,b)),i.call("pasteHtml",n),de.wysiwygEditorInsertHtml(n.val,null,!0)},de.closeDropDown=function(e){f&&(Re(f),f=null),!0===e&&de.focus()},de.wysiwygEditorInsertHtml=function(e,t,n){var o,i,r,a=Xe(c);de.focus(),!n&&Me(y,"code")||(v.insertHTML(e,t),v.saveRange(),M(),Le(o=Fe(g,"#sceditor-end-marker")[0]),i=g.scrollTop,r=lt(o).top+1.5*o.offsetHeight-a,Be(o),(i").replace(/&/g,"&")),de.wysiwygEditorInsertHtml(e),de},de.getWysiwygEditorValue=function(e){for(var t,n=De("div",{},d),o=g.childNodes,i=0;i"+(xt?"":"
")+"

"),g.innerHTML=e,M(),Z(),ae(),ue()},de.setSourceEditorValue=function(e){s.value=e,ae()},de.updateOriginal=function(){l.value=de.val()},M=function(){var e,s,u,d,t,f,p;be.emoticonsEnabled&&(e=g,s=ve,u=be.emoticonsCompat,d=e.ownerDocument,t="(^|\\s| | | | |$)",f=[],p={},Ne(e,"code")||(Se(s,function(e){p[e]=new RegExp(t+ft(e)+t),f.push(e)}),f.sort(function(e,t){return t.length-e.length}),function e(t){for(t=t.firstChild;t;){if(t.nodeType!==ke||je(t,"code")||e(t),t.nodeType===Te)for(var n=0;n")}e.preventDefault()}},Z=function(){Ze(g,function(e){if(e.nodeType===ke&&!/inline/.test(Pe(e,"display"))&&!je(e,".sceditor-nlf")&&tt(e)){var t=De("p",{},d);return t.className="sceditor-nlf",t.innerHTML=wt?"":"
",He(g,t),!1}if(3===e.nodeType&&!/^\s*$/.test(e.nodeValue)||je(e,"br"))return!1})},U=function(){de.val(l.value)},$=function(){de.closeDropDown(),p=null},de._=function(){var n=arguments;return t&&t[n[0]]&&(n[0]=t[n[0]]),n[0].replace(/\{(\d+)\}/g,function(e,t){return void 0!==n[t-0+1]?n[t-0+1]:"{"+t+"}"})},K=function(t){i&&i.call(t.type+"Event",t,de);var e=(t.target===s?"scesrc":"scewys")+t.type;fe[e]&&fe[e].forEach(function(e){e.call(de,t)})},de.bind=function(e,t,n,o){for(var i=(e=e.split(" ")).length;i--;)if(we(t)){var r="scewys"+e[i],a="scesrc"+e[i];n||(fe[r]=fe[r]||[],fe[r].push(t)),o||(fe[a]=fe[a]||[],fe[a].push(t)),"valuechanged"===e[i]&&(ae.hasHandler=!0)}return de},de.unbind=function(e,t,n,o){for(var i=(e=e.split(" ")).length;i--;)we(t)&&(n||Ee(fe["scewys"+e[i]]||[],t),o||Ee(fe["scesrc"+e[i]]||[],t));return de},de.blur=function(e,t,n){return we(e)?de.bind("blur",e,t,n):de.sourceMode()?s.blur():g.blur(),de},de.focus=function(e,t,n){if(we(e))de.bind("focus",e,t,n);else if(de.inSourceMode())s.focus();else{if(Fe(d,":focus").length)return;var o,i=v.selectedRange();x||ne(),!wt&&i&&1===i.endOffset&&i.collapsed&&(o=i.endContainer)&&1===o.childNodes.length&&je(o.firstChild,"br")&&(i.setStartBefore(o.firstChild),i.collapse(!0),v.selectRange(i)),r.focus(),g.focus(),p&&(v.selectRange(p),p=null)}return G(),de},de.keyDown=function(e,t,n){return de.bind("keydown",e,t,n)},de.keyPress=function(e,t,n){return de.bind("keypress",e,t,n)},de.keyUp=function(e,t,n){return de.bind("keyup",e,t,n)},de.nodeChanged=function(e){return de.bind("nodechanged",e,!1,!0)},de.selectionChanged=function(e){return de.bind("selectionchanged",e,!1,!0)},de.valueChanged=function(e,t,n){return de.bind("valuechanged",e,t,n)},oe=function(e){var n=0,o=de.emoticonsCache,t=String.fromCharCode(e.which);Me(y,"code")||(o||(o=[],Se(ve,function(e,t){o[n++]=[e,t]}),o.sort(function(e,t){return e[0].length-t[0].length}),de.emoticonsCache=o,de.longestEmoticonCode=o[o.length-1][0].length),v.replaceKeyword(de.emoticonsCache,!0,!0,de.longestEmoticonCode,be.emoticonsCompat,t)&&(be.emoticonsCompat&&/^\s$/.test(t)||e.preventDefault()))},ie=function(){!function(e,t){var n=/[^\s\xA0\u2002\u2003\u2009\u00a0]+/,o=e&&Fe(e,"img[data-sceditor-emoticon]");if(e&&o.length)for(var i=0;i","/":"?","\\":"|","[":"{","]":"}"},o={109:"-",110:"del",111:"/",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9"},i=e.which,r={8:"backspace",9:"tab",13:"enter",19:"pause",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"insert",46:"del",91:"win",92:"win",93:"select",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",144:"numlock",145:"scrolllock",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"}[i]||String.fromCharCode(i).toLowerCase();(e.ctrlKey||e.metaKey)&&t.push("ctrl"),e.altKey&&t.push("alt"),e.shiftKey&&(t.push("shift"),o[i]?r=o[i]:n[r]&&(r=n[r])),r&&(i<16||18",""]},italic:{txtExec:["",""]},underline:{txtExec:['',""]},strike:{txtExec:['',""]},subscript:{txtExec:["",""]},superscript:{txtExec:["",""]},left:{txtExec:['
',"
"]},center:{txtExec:['
',"
"]},right:{txtExec:['
',"
"]},justify:{txtExec:['
',"
"]},font:{txtExec:function(e){var t=this;l("font")._dropDown(t,e,function(e){t.insertText('',"")})}},size:{txtExec:function(e){var t=this;l("size")._dropDown(t,e,function(e){t.insertText('',"")})}},color:{txtExec:function(e){var t=this;l("color")._dropDown(t,e,function(e){t.insertText('',"")})}},bulletlist:{txtExec:["
  • ","
"]},orderedlist:{txtExec:["
  1. ","
"]},table:{txtExec:["
","
"]},horizontalrule:{txtExec:["
"]},code:{txtExec:["",""]},image:{txtExec:function(e,t){var i=this;l("image")._dropDown(i,e,t,function(e,t,n){var o="";t&&(o+=' width="'+t+'"'),n&&(o+=' height="'+n+'"'),i.insertText("')})}},email:{txtExec:function(e,n){var o=this;l("email")._dropDown(o,e,function(e,t){o.insertText(''+(t||n||e)+"")})}},link:{txtExec:function(e,n){var o=this;l("link")._dropDown(o,e,function(e,t){o.insertText(''+(t||n||e)+"")})}},quote:{txtExec:["
","
"]},youtube:{txtExec:function(e){var n=this;l("youtube")._dropDown(n,e,function(e,t){n.insertText('')})}},rtl:{txtExec:['
',"
"]},ltr:{txtExec:['
',"
"]}};function N(){var i=this,n={},b={};function e(e,t,n){var o,i,m,r,a,l,c,s,u,d,f,p,g,h,v=n.createElement("div");return v.innerHTML=t,S(v,"visibility","hidden"),n.body.appendChild(v),i=v,E.traverse(i,function(e){var t=e.nodeName.toLowerCase();y("*",e),y(t,e)},!0),m=v,E.traverse(m,function(e){var t,n=e.nodeName.toLowerCase(),o=e.parentNode,i=e.nodeType,r=!E.isInline(e),a=e.previousSibling,l=e.nextSibling,c=o===m,s=!a&&!l,u="iframe"!==n&&function e(t,n){var o,i=t.childNodes,r=t.nodeName.toLowerCase(),a=t.nodeValue,l=i.length,c=N.allowedEmptyTags||[];if(n&&"br"===r)return!0;if(k(t,".sceditor-ignore"))return!0;if(-1":">",'"':"""," ":" "};return e?e.replace(/[&<>"\xa0]/g,function(e){return t[e]||e}):""}function p(e,t){switch(e.nodeType){case 1:"!"===e.nodeName.toLowerCase()?n(e):function(e,t){var n,o,i,r=e.nodeName.toLowerCase(),a="iframe"===r,l=e.attributes.length,c=e.firstChild,s=t||/pre(?:\-wrap)?$/i.test(S(e,"whiteSpace")),u=!e.firstChild&&!E.canHaveChildren(e)&&!a;if(k(e,".sceditor-ignore"))return;g("<"+r,!t&&m(e));for(;l--;)o=e.attributes[l],i=o.value,g(" "+o.name.toLowerCase()+'="'+f(i)+'"',!1);g(u?" />":">",!1),a||(n=c);for(;n;)d++,p(n,s),n=n.nextSibling,d--;u||g("",!s&&!a&&m(e)&&c&&m(c))}(e,t);break;case 3:!function(e,t){var n=e.nodeValue;t||(n=n.replace(/[\r\n]/," ").replace(/[^\S|\u00A0]+/g," "));n&&g(f(n),!t&&m(e))}(e,t);break;case 4:g("");break;case 8:n(e);break;case 9:case 11:!function(e){var t=e.firstChild;for(;t;)p(t),t=t.nextSibling}(e)}}function n(e){g("\x3c!-- "+f(e.nodeValue)+" --\x3e")}function g(e,t){var n=d;if(!1!==t)for(i.length&&i.push("\n");n--;)i.push(o.indentStr);i.push(e)}function m(e){var t=e.previousSibling;return 1!==e.nodeType&&t?!E.isInline(t):!t&&!E.isInline(e.parentNode)||!E.isInline(e)}this.serialize=function(e,t){if(i=[],t)for(e=e.firstChild;e;)p(e),e=e.nextSibling;else p(e);return i.join("")}},N.converters=[{tags:{"*":{width:null}},conv:function(e){S(e,"width",n(e,"width")),T(e,"width")}},{tags:{"*":{height:null}},conv:function(e){S(e,"height",n(e,"height")),T(e,"height")}},{tags:{li:{value:null}},conv:function(e){T(e,"value")}},{tags:{"*":{text:null}},conv:function(e){S(e,"color",n(e,"text")),T(e,"text")}},{tags:{"*":{color:null}},conv:function(e){S(e,"color",n(e,"color")),T(e,"color")}},{tags:{"*":{face:null}},conv:function(e){S(e,"fontFamily",n(e,"face")),T(e,"face")}},{tags:{"*":{align:null}},conv:function(e){S(e,"textAlign",n(e,"align")),T(e,"align")}},{tags:{"*":{border:null}},conv:function(e){S(e,"borderWidth",n(e,"border")),T(e,"border")}},{tags:{applet:{name:null},img:{name:null},layer:{name:null},map:{name:null},object:{name:null},param:{name:null}},conv:function(e){n(e,"id")||n(e,"id",n(e,"name")),T(e,"name")}},{tags:{"*":{vspace:null}},conv:function(e){S(e,"marginTop",n(e,"vspace")-0),S(e,"marginBottom",n(e,"vspace")-0),T(e,"vspace")}},{tags:{"*":{hspace:null}},conv:function(e){S(e,"marginLeft",n(e,"hspace")-0),S(e,"marginRight",n(e,"hspace")-0),T(e,"hspace")}},{tags:{hr:{noshade:null}},conv:function(e){S(e,"borderStyle","solid"),T(e,"noshade")}},{tags:{"*":{nowrap:null}},conv:function(e){S(e,"whiteSpace","nowrap"),T(e,"nowrap")}},{tags:{big:null},conv:function(e){S(o(e,"span"),"fontSize","larger")}},{tags:{small:null},conv:function(e){S(o(e,"span"),"fontSize","smaller")}},{tags:{b:null},conv:function(e){o(e,"strong")}},{tags:{u:null},conv:function(e){S(o(e,"span"),"textDecoration","underline")}},{tags:{s:null,strike:null},conv:function(e){S(o(e,"span"),"textDecoration","line-through")}},{tags:{dir:null},conv:function(e){o(e,"ul")}},{tags:{center:null},conv:function(e){S(o(e,"div"),"textAlign","center")}},{tags:{font:{size:null}},conv:function(e){S(e,"fontSize",S(e,"fontSize")),T(e,"size")}},{tags:{font:null},conv:function(e){o(e,"span")}},{tags:{"*":{type:["_moz"]}},conv:function(e){T(e,"type")}},{tags:{"*":{_moz_dirty:null}},conv:function(e){T(e,"_moz_dirty")}},{tags:{"*":{_moz_editor_bogus_node:null}},conv:function(e){e.parentNode.removeChild(e)}}],N.allowedAttribs={},N.disallowedAttribs={},N.allowedTags=[],N.disallowedTags=[],N.allowedEmptyTags=[],w.formats.xhtml=N}(sceditor);