From 72215e4ebcc72fdb4618e4439086a7427e675822 Mon Sep 17 00:00:00 2001 From: Spuds Date: Sat, 27 Apr 2024 08:53:20 -0500 Subject: [PATCH] ! prevent a few validation issues --- themes/default/scripts/editor/jquery.sceditor.bbcode.min.js | 2 +- themes/default/scripts/script.js | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/themes/default/scripts/editor/jquery.sceditor.bbcode.min.js b/themes/default/scripts/editor/jquery.sceditor.bbcode.min.js index 1bf24effa4..781ef87484 100644 --- a/themes/default/scripts/editor/jquery.sceditor.bbcode.min.js +++ b/themes/default/scripts/editor/jquery.sceditor.bbcode.min.js @@ -1,2 +1,2 @@ /* SCEditor v3.2.0 | ElkArte | (C) 2017, Sam Clarke | sceditor.com/license */ -!function(){"use strict";var i=(e=jQuery)&&"object"==typeof e&&"default"in e?e:{default:e};function a(e,t){return typeof t===e}var ye=a.bind(null,"string"),Xe=a.bind(null,"undefined"),Ke=a.bind(null,"function"),l=a.bind(null,"number");function s(e){return!Object.keys(e).length}function be(e,t){var n=e===!!e,o=n?2:1,r=n?t:e,i=n&&e;function a(e){return null!==e&&"object"==typeof e&&Object.getPrototypeOf(e)===Object.prototype}for(;o":">"," ":"  ","\r\n":"
","\r":"
","\n":"
"})!==t&&(n['"']=""",n["'"]="'",n["`"]="`"),e=e.replace(/ {2}|\r\n|[&<>\r\n'"`]/g,function(e){return n[e]||e})),e}var b={html:'

',toolbarButton:'
{dispName}
',emoticon:'{key}',fontOpt:'{font}',sizeOpt:'{size}',pastetext:'
',table:'
',image:'
',email:'
',link:'
',youtubeMenu:'
',youtube:''};function Pe(e,t,n){var o=b[e];return Object.keys(t).forEach(function(e){o=o.replace(new RegExp(bt("{"+e+"}"),"g"),t[e])}),o=n?ct(o):o}function x(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(Me(n.parentNode,"whiteSpace"))&&ke(n),n=t}}var Ue={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){var t;if(e=e&&3===e.nodeType?e.parentNode:e)return t="ltr"===Me(e,"direction"),e=Me(e,"textAlign"),/left/.test(e)||e===(t?"start":"end")},exec:"justifyleft",tooltip:"Align left"},center:{exec:"justifycenter",tooltip:"Center"},right:{state:function(e){var t;if(e=e&&3===e.nodeType?e.parentNode:e)return t="ltr"===Me(e,"direction"),e=Me(e,"textAlign"),/right/.test(e)||e===(t?"end":"start")},exec:"justifyright",tooltip:"Align right"},justify:{exec:"justifyfull",tooltip:"Justify"},font:{_dropDown:function(t,e,n){var o=Ee("div");De(o,"click","a",function(e){n(nt(this,"font")),t.closeDropDown(!0),e.preventDefault()}),t.opts.fonts.split(",").forEach(function(e){Se(o,Pe("fontOpt",{font:e},!0))}),t.createDropDown(e,"font-picker",o)},exec:function(e){var t=this;Ue.font._dropDown(t,e,function(e){t.execCommand("fontname",e)})},tooltip:"Font Name"},size:{_dropDown:function(t,e,n){var o=Ee("div");De(o,"click","a",function(e){n(nt(this,"size")),t.closeDropDown(!0),e.preventDefault()});for(var r=1;r<=7;r++)Se(o,Pe("sizeOpt",{size:r},!0));t.createDropDown(e,"fontsize-picker",o)},exec:function(e){var t=this;Ue.size._dropDown(t,e,function(e){t.execCommand("fontsize",e)})},tooltip:"Font Size"},color:{_dropDown:function(t,e,n){var o=Ee("div"),r="",i=Ue.color;i._htmlCache||(t.opts.colors.split("|").forEach(function(e){r+='
',e.split(",").forEach(function(e){r+=''}),r+="
"}),i._htmlCache=r),Se(o,ct(i._htmlCache)),De(o,"click","a",function(e){n(nt(this,"color")),t.closeDropDown(!0),e.preventDefault()}),t.createDropDown(e,"color-picker",o)},exec:function(e){var t=this;Ue.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=Ee("div"),o=this;Se(n,Pe("pastetext",{label:o._("Paste your text inside the following box:"),insert:o._("Insert")},!0)),De(n,"click",".button",function(e){(t=Ne(n,"#txt")[0].value)&&o.wysiwygEditorInsertText(t),o.closeDropDown(!0),e.preventDefault()}),o.createDropDown(e,"pastetext",n)},tooltip:"Paste Text"},bulletlist:{exec:function(){x(this),this.execCommand("insertunorderedlist")},tooltip:"Bullet list"},orderedlist:{exec:function(){x(this),this.execCommand("insertorderedlist")},tooltip:"Numbered list"},indent:{state:function(e,t){var n;return Oe(t,"li")||Oe(t,"ul,ol,menu")&&(n=(t=this.getRangeHelper().selectedRange()).startContainer.parentNode,t=t.endContainer.parentNode,n!==n.parentNode.firstElementChild||Oe(t,"li")&&t!==t.parentNode.lastElementChild)?0:-1},exec:function(){var e=this.getRangeHelper().getFirstBlockParent();this.focus(),Ce(e,"ul,ol,menu")&&this.execCommand("indent")},tooltip:"Add indent"},outdent:{state:function(e,t){return Ce(t,"ul,ol,menu")?0:-1},exec:function(){Ce(this.getRangeHelper().getFirstBlockParent(),"ul,ol,menu")&&this.execCommand("outdent")},tooltip:"Remove one indent"},table:{exec:function(e){var r=this,i=Ee("div");Se(i,Pe("table",{rows:r._("Rows:"),cols:r._("Cols:"),insert:r._("Insert")},!0)),De(i,"click",".button",function(e){var t=Number(Ne(i,"#rows")[0].value),n=Number(Ne(i,"#cols")[0].value),o="";0"+Array(n+1).join("")+""),r.wysiwygEditorInsertHtml(o+="

"),r.closeDropDown(!0),e.preventDefault())}),r.createDropDown(e,"inserttable",i)},tooltip:"Insert a table"},horizontalrule:{exec:"inserthorizontalrule",tooltip:"Insert a horizontal rule"},code:{exec:function(){this.wysiwygEditorInsertHtml("","
")},tooltip:"Code"},image:{_dropDown:function(t,e,n,o){var r=Ee("div"),i=(Se(r,Pe("image",{url:t._("URL:"),width:t._("Width (optional):"),height:t._("Height (optional):"),alt:t._("Alt Text (optional):"),insert:t._("Insert")},!0)),Ne(r,"#image")[0]);i.value=n,De(r,"click",".button",function(e){i.value&&o(i.value,Ne(r,"#width")[0].value,Ne(r,"#height")[0].value,Ne(r,"#alt")[0].value),t.closeDropDown(!0),e.preventDefault()}),t.createDropDown(e,"insertimage",r)},exec:function(e){var i=this;Ue.image._dropDown(i,e,"",function(e,t,n,o){var r="";t&&(r+=' width="'+parseInt(t,10)+'"'),n&&(r+=' height="'+parseInt(n,10)+'"'),o&&(r+=' alt="'+ze(o)+'"'),r+=' src="'+ze(e)+'"',i.wysiwygEditorInsertHtml("")})},tooltip:"Insert an image"},email:{_dropDown:function(n,e,o){var r=Ee("div");Se(r,Pe("email",{label:n._("E-mail:"),desc:n._("Description (optional):"),insert:n._("Insert")},!0)),De(r,"click",".button",function(e){var t=Ne(r,"#email")[0].value;t&&o(t,Ne(r,"#des")[0].value),n.closeDropDown(!0),e.preventDefault()}),n.createDropDown(e,"insertemail",r)},exec:function(e){var n=this;Ue.email._dropDown(n,e,function(e,t){!n.getRangeHelper().selectedHtml()||t?n.wysiwygEditorInsertHtml(''+ze(t||e)+""):n.execCommand("createlink","mailto:"+e)})},tooltip:"Insert an email"},link:{_dropDown:function(t,e,n){var o=Ee("div"),r=(Se(o,Pe("link",{url:t._("URL:"),desc:t._("Description (optional):"),ins:t._("Insert")},!0)),Ne(o,"#link")[0]);function i(e){r.value&&n(r.value,Ne(o,"#des")[0].value),t.closeDropDown(!0),e.preventDefault()}De(o,"click",".button",i),De(o,"keypress",function(e){13===e.which&&r.value&&i(e)},!0),t.createDropDown(e,"insertlink",o)},exec:function(e){var n=this;Ue.link._dropDown(n,e,function(e,t){t||!n.getRangeHelper().selectedHtml()?n.wysiwygEditorInsertHtml(''+ze(t||e)+""):n.execCommand("createlink",e)})},tooltip:"Insert a link"},unlink:{state:function(){return Ce(this.currentNode(),"a")?0:-1},exec:function(){var e=Ce(this.currentNode(),"a");if(e){for(;e.firstChild;)Ie(e.firstChild,e);ke(e)}},tooltip:"Unlink"},quote:{exec:function(e,t,n){var o="
",r="
";t?(o=o+(n=n?""+ze(n)+"":"")+t+r,r=null):""===this.getRangeHelper().selectedHtml()&&(r="
"+r),this.wysiwygEditorInsertHtml(o,r)},tooltip:"Insert a Quote"},emoticon:{exec:function(d){var f=this;f.createDropDown(d,"emoticons",function t(e){var n,o=f.opts,r=o.emoticonsRoot||"",i=o.emoticonsCompat,a=f.getRangeHelper(),l=i&&" "!==a.getOuterText(!0,1)?" ":"",s=i&&" "!==a.getOuterText(!1,1)?" ":"",c=Ee("div"),u=Ee("div"),i=be({},o.emoticons.dropdown,e?o.emoticons.more:{});return Se(c,u),n=Math.sqrt(Object.keys(i).length),De(c,"click","img",function(e){f.insert(l+_e(this,"alt")+s,null,!1).closeDropDown(!0),e.preventDefault()}),xe(i,function(e,t){Se(u,Ee("img",{src:r+(t.url||t),alt:e,title:t.tooltip||e})),u.children.length>=n&&(u=Ee("div"),Se(c,u))}),!e&&o.emoticons.more&&(Se(a=Ee("a",{className:"sceditor-more"}),document.createTextNode(f._("More"))),De(a,"click",function(e){f.createDropDown(d,"more-emoticons",t(!0)),e.preventDefault()}),Se(c,a)),c}(!1))},txtExec:function(e){Ue.emoticon.exec.call(this,e)},tooltip:"Insert an emoticon"},youtube:{_dropDown:function(r,e,i){var a=Ee("div");Se(a,Pe("youtubeMenu",{label:r._("Video URL:"),insert:r._("Insert")},!0)),De(a,"click",".button",function(e){var t=(n=Ne(a,"#link")[0].value).match(/(?:v=|v\/|embed\/|youtu.be\/)?([a-zA-Z0-9_-]{11})/),n=n.match(/[&|?](?:star)?t=((\d+[hms]?){1,3})/),o=0;n&&xe(n[1].split(/[hms]/),function(e,t){""!==t&&(o=60*o+Number(t))}),t&&/^[a-zA-Z0-9_\-]{11}$/.test(t[1])&&i(t[1],o),r.closeDropDown(!0),e.preventDefault()}),r.createDropDown(e,"insertlink",a)},exec:function(e){var n=this;Ue.youtube._dropDown(n,e,function(e,t){n.wysiwygEditorInsertHtml(Pe("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;return o<10&&(o="0"+o),(t=t.getDate())<10&&(t="0"+t),e.opts.dateFormat.replace(/year/i,n=n<2e3?1900+n:n).replace(/month/i,o).replace(/day/i,t)},exec:function(){this.insertText(Ue.date._date(this))},txtExec:function(){this.insertText(Ue.date._date(this))},tooltip:"Insert current date"},time:{_time:function(){var e=new Date,t=e.getHours(),n=e.getMinutes();return(t=t<10?"0"+t:t)+":"+(n=n<10?"0"+n:n)+":"+((e=e.getSeconds())<10?"0"+e:e)},exec:function(){this.insertText(Ue.time._time())},txtExec:function(){this.insertText(Ue.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&&!Oe(t,"body")||(this.execCommand("formatBlock","p"),(t=e.getFirstBlockParent())&&!Oe(t,"body")))&&(e="ltr"===Me(t,"direction")?"":"ltr",Me(t,"direction",e))},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&&!Oe(t,"body")||(this.execCommand("formatBlock","p"),(t=e.getFirstBlockParent())&&!Oe(t,"body")))&&(e="rtl"===Me(t,"direction")?"":"rtl",Me(t,"direction",e))},tooltip:"Right-to-Left"},print:{exec:"print",tooltip:"Print"},maximize:{state:function(){return this.maximize()},exec:function(){this.maximize(!this.maximize()),this.focus()},txtExec:function(){this.maximize(!this.maximize()),this.focus()},tooltip:"Maximize",shortcut:"Ctrl+Shift+M"},source:{state:function(){return this.sourceMode()},exec:function(){this.toggleSourceMode(),this.focus()},txtExec:function(){this.toggleSourceMode(),this.focus()},tooltip:"View source",shortcut:"Ctrl+Shift+S"},ignore:{}},w={};function xt(i){function a(e){return"signal"+e.charAt(0).toUpperCase()+e.slice(1)}function e(e,t){for(var n,o=a((e=[].slice.call(e)).shift()),r=0;rs.length&&c&&3===c.nodeType;)o=c.nodeValue,r=n-s.length,l&&(a=o.length,i=0),l=c,c=t?(u=i=Math.max(a-r,0),s=o.substr(i,a-i)+s,l.previousSibling):(u=i+(a=Math.min(r,o.length)),s+=o.substr(i,a),l.nextSibling);return{node:l||c,offset:u,text:s}};function wt(r,e,i){var a,l,s=e||r.contentDocument||r.document,c="sceditor-start-marker",u="sceditor-end-marker",g=this;g.insertHTML=function(e,t){var n,o;if(!g.selectedRange())return!1;for(t&&(e+=g.selectedHtml()+t),o=Ee("p",{},s),n=s.createDocumentFragment(),o.innerHTML=i(e);o.firstChild;)Se(n,o.firstChild);g.insertNode(n)},l=function(e,t,n){var o,r=s.createDocumentFragment();if("string"==typeof e?(t&&(e+=g.selectedHtml()+t),r=ct(e)):(Se(r,e),t&&(Se(r,g.selectedRange().extractContents()),Se(r,t))),o=r.lastChild){for(;!Fe(o.lastChild,!0);)o=o.lastChild;return ft(o)?o.lastChild||Se(o,document.createTextNode("​")):o=r,g.removeMarkers(),Se(o,a(c)),Se(o,a(u)),n?(Se(e=Ee("div"),r),e.innerHTML):r}},g.insertNode=function(e,t){var n,o,e=l(e,t),r=(t=g.selectedRange()).commonAncestorContainer,i=[];if(!e)return!1;function a(e){e&&m(e)&&i.indexOf(e)<0&&ke(e)}t.startContainer!==t.endContainer&&(xe(r.childNodes,function(e,t){m(t)&&i.push(t)}),n=e.firstChild,o=e.lastChild),t.deleteContents(),r&&3!==r.nodeType&&!ft(r)?Ie(e,r):(t.insertNode(e),a(n&&n.previousSibling),a(o&&o.nextSibling)),g.restoreRange()},g.cloneSelected=function(){var e=g.selectedRange();if(e)return e.cloneRange()},g.selectedRange=function(){var e,t,n=r.getSelection();if(n){if(n.rangeCount<=0){for(t=s.body;t.firstChild;)t=t.firstChild;(e=s.createRange()).setStartBefore(t),n.addRange(e)}return 0/gm),R=t(/\${[\w\W]*}/gm),M=t(/^data-[\-\w.\u00B7-\uFFFF]/),n=t(/^aria-[\-\w]+$/);const Xt=t(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i);var O=t(/^(?:\w+script|data):/i),I=t(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g);const Kt=t(/^html$/i);var Qt=Object.freeze({__proto__:null,MUSTACHE_EXPR:_,ERB_EXPR:e,TMPLIT_EXPR:R,DATA_ATTR:M,ARIA_ATTR:n,IS_ALLOWED_URI:Xt,IS_SCRIPT_OR_DATA:O,ATTR_WHITESPACE:I,DOCTYPE_NAME:Kt}),Zt=function B(e){e=0B(e);if(c.version="3.0.9",c.removed=[],!e||!e.document||9!==e.document.nodeType)return c.isSupported=!1,c;let i=e.document;const l=i,H=l.currentScript,{DocumentFragment:F,HTMLTemplateElement:z,Node:s,Element:P,NodeFilter:t,NamedNodeMap:U=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:j,DOMParser:W,trustedTypes:u}=e,q=Ht(e=P.prototype,"cloneNode"),V=Ht(e,"nextSibling"),Y=Ht(e,"childNodes"),a=Ht(e,"parentNode");"function"==typeof z&&(e=i.createElement("template")).content&&e.content.ownerDocument&&(i=e.content.ownerDocument);let d,f="";const{implementation:p,createNodeIterator:G,createDocumentFragment:$,getElementsByTagName:X}=i,K=l.importNode;let o={};c.isSupported="function"==typeof Ct&&"function"==typeof a&&p&&void 0!==p.createHTMLDocument;const{MUSTACHE_EXPR:m,ERB_EXPR:h,TMPLIT_EXPR:g,DATA_ATTR:Q,ARIA_ATTR:Z,IS_SCRIPT_OR_DATA:J,ATTR_WHITESPACE:ee}=Qt;let te=Qt.IS_ALLOWED_URI,v=null;const ne=Ve({},[...Ft,...zt,...Pt,...jt,...qt]);let y=null;const oe=Ve({},[...Vt,...Yt,...Gt,...$t]);let b=Object.seal(kt(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),x=null,re=null,ie=!0,ae=!0,le=!1,se=!0,w=!1,T=!1,ce=!1,ue=!1,E=!1,C=!1,k=!1,de=!0,fe=!1;const pe="user-content-";let me=!0,S=!1,n={},N=null;const he=Ve({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let ge=null;const ve=Ve({},["audio","video","img","source","image","track"]);let ye=null;const be=Ve({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),D="http://www.w3.org/1998/Math/MathML",A="http://www.w3.org/2000/svg",_="http://www.w3.org/1999/xhtml";let R=_,xe,we=null;const Te=Ve({},[D,A,_],Rt);let M=null;const Ee=["application/xhtml+xml","text/html"];let O=null,r=null;function Ce(e){return e instanceof RegExp||e instanceof Function}function ke(e){let t=0"+e:(o=Mt(e,/^[\r\n\t ]+/),n=o&&o[0]),"application/xhtml+xml"===M&&R===_&&(e=''+e+"");var o=d?d.createHTML(e):e;if(R===_)try{t=(new W).parseFromString(o,M)}catch(e){}if(!t||!t.documentElement){t=p.createDocument(R,"template",null);try{t.documentElement.innerHTML=xe?f:o}catch(e){}}const r=t.body||t.documentElement;return e&&n&&r.insertBefore(i.createTextNode(n),r.childNodes[0]||null),R===_?X.call(t,T?"html":"body")[0]:T?t.documentElement:r}function Ne(e){return G.call(e.ownerDocument||e,e,t.SHOW_ELEMENT|t.SHOW_COMMENT|t.SHOW_TEXT,null)}function De(e){return"function"==typeof s&&e instanceof s}function Ae(t){let n=null;if(L("beforeSanitizeElements",t,null),!((e=t)instanceof j)||"string"==typeof e.nodeName&&"string"==typeof e.textContent&&"function"==typeof e.removeChild&&e.attributes instanceof U&&"function"==typeof e.removeAttribute&&"function"==typeof e.setAttribute&&"string"==typeof e.namespaceURI&&"function"==typeof e.insertBefore&&"function"==typeof e.hasChildNodes){var e=O(t.nodeName);if(L("uponSanitizeElement",t,{tagName:e,allowedTags:v}),!t.hasChildNodes()||De(t.firstElementChild)||!qe(/<[/\w]/g,t.innerHTML)||!qe(/<[/\w]/g,t.textContent)){if(v[e]&&!x[e])return t instanceof P&&!function(e){let t=a(e);t&&t.tagName||(t={namespaceURI:R,tagName:"template"});var n=_t(e.tagName),o=_t(t.tagName);return we[e.namespaceURI]&&(e.namespaceURI===A?t.namespaceURI===_?"svg"===n:t.namespaceURI===D?"svg"===n&&("annotation-xml"===o||Oe[o]):Boolean(Be[n]):e.namespaceURI===D?t.namespaceURI===_?"math"===n:t.namespaceURI===A?"math"===n&&Ie[o]:Boolean(He[n]):e.namespaceURI===_?(t.namespaceURI!==A||Ie[o])&&(t.namespaceURI!==D||Oe[o])&&!He[n]&&(Le[n]||!Be[n]):"application/xhtml+xml"===M&&we[e.namespaceURI])}(t)||("noscript"===e||"noembed"===e||"noframes"===e)&&qe(/<\/no(script|embed|frames)/i,t.innerHTML)?(I(t),1):(w&&3===t.nodeType&&(n=t.textContent,Nt([m,h,g],e=>{n=Ot(n,e," ")}),t.textContent!==n&&(At(c.removed,{element:t.cloneNode()}),t.textContent=n)),L("afterSanitizeElements",t,null),0);if(!x[e]&&_e(e)){if(b.tagNameCheck instanceof RegExp&&qe(b.tagNameCheck,e))return;if(b.tagNameCheck instanceof Function&&b.tagNameCheck(e))return}if(me&&!N[e]){const r=a(t)||t.parentNode;var o=Y(t)||t.childNodes;if(o&&r)for(let e=o.length-1;0<=e;--e)r.insertBefore(q(o[e],!0),V(t))}}}return I(t),1}function _e(e){return"annotation-xml"!==e&&0/i,t))Fe(r,n);else if(w&&Nt([m,h,g],e=>{t=Ot(t,e," ")}),a=O(n.nodeName),ze(a,l,t)){if(!fe||"id"!==l&&"name"!==l||(Fe(r,n),t=pe+t),d&&"object"==typeof u&&"function"==typeof u.getAttributeType&&!i)switch(u.getAttributeType(a,l)){case"TrustedHTML":t=d.createHTML(t);break;case"TrustedScriptURL":t=d.createScriptURL(t)}try{i?n.setAttributeNS(i,r,t):n.setAttribute(r,t),Dt(c.removed)}catch(e){}}}L("afterSanitizeAttributes",n,null)}}const Me=i.createElement("form"),Oe=Ve({},["mi","mo","mn","ms","mtext"]),Ie=Ve({},["foreignobject","desc","title","annotation-xml"]),Le=Ve({},["title","style","font","a","script"]),Be=Ve({},[...zt,...Pt,...Ut]),He=Ve({},[...jt,...Wt]),Fe=function(e,t){try{At(c.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){At(c.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!y[e])if(E||C)try{I(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},L=function(e,t,n){o[e]&&Nt(o[e],e=>{e.call(c,t,n,r)})},ze=function(e,t,n){if(de&&("id"===t||"name"===t)&&(n in i||n in Me))return!1;if((!ae||re[t]||!qe(Q,t))&&(!ie||!qe(Z,t)))if(!y[t]||re[t]){if(!(_e(e)&&(b.tagNameCheck instanceof RegExp&&qe(b.tagNameCheck,e)||b.tagNameCheck instanceof Function&&b.tagNameCheck(e))&&(b.attributeNameCheck instanceof RegExp&&qe(b.attributeNameCheck,t)||b.attributeNameCheck instanceof Function&&b.attributeNameCheck(t))||"is"===t&&b.allowCustomizedBuiltInElements&&(b.tagNameCheck instanceof RegExp&&qe(b.tagNameCheck,n)||b.tagNameCheck instanceof Function&&b.tagNameCheck(n))))return!1}else if(!ye[t]&&!qe(te,Ot(n,ee,""))&&("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==It(n,"data:")||!ge[e])&&(!le||qe(J,Ot(n,ee,"")))&&n)return!1;return!0};return c.sanitize=function(e){var t,n=1\n"+a),w&&Nt([m,h,g],e=>{a=Ot(a,e," ")}),d&&k?d.createHTML(a):a},c.setConfig=function(){ke(0'})},void n.readAsDataURL(t);i[a[s]]=r.getData(a[s])}i.text=i["text/plain"],i.html=L(i["text/html"]),Q(i)}else if(!w){var c=o.scrollTop;for(m.saveRange(),w=Ge.createDocumentFragment();o.firstChild;)Se(w,o.firstChild);setTimeout(function(){var e=o.innerHTML;o.innerHTML="",Se(o,w),o.scrollTop=c,w=!1,m.restoreRange(),Q({html:L(e)})},0)}},Q=function(e){var t=Ee("div",{},d),e=(h.call("pasteRaw",e),at(x,"pasteraw",e),e.html?(t.innerHTML=L(e.html),pt(t)):t.innerHTML=ze(e.text||""),{val:t.innerHTML}),t=("fragmentToSource"in a&&(e.val=a.fragmentToSource(e.val,d,g)),h.call("paste",e),at(x,"paste",e),"fragmentToHtml"in a&&(e.val=a.fragmentToHtml(e.val,g)),h.call("pasteHtml",e),m.getFirstBlockParent());A.wysiwygEditorInsertHtml(e.val,null,!0),function e(t){if(t.nodeType===we){for(var n=t.parentNode,o=t.tagName,r=t.childNodes.length;r--;)e(t.childNodes[r]);if(Fe(t)&&"BR"!==o){for(r=t.style.length;r--;){var i=t.style[r];Me(n,i)===Me(t,i)&&t.style.removeProperty(i)}if(!t.style.length)if(Re(t,"style"),"FONT"===o&&(Me(t,"fontFamily").toLowerCase()===Me(n,"fontFamily").toLowerCase()&&Re(t,"face"),Me(t,"color")===Me(n,"color")&&Re(t,"color"),Me(t,"fontSize")===Me(n,"fontSize")&&Re(t,"size")),!t.attributes.length&&/SPAN|FONT/.test(o))vt(t);else if(/B|STRONG|EM|SPAN|FONT/.test(o))for(var a=/B|STRONG/.test(o),l="EM"===o;n&&Fe(n)&&(!a||/bold|700/i.test(Me(n,"fontWeight")))&&(!l||"italic"===Me(n,"fontStyle"));){if((n.tagName===o||a&&/B|STRONG/.test(n.tagName))&>(n,t)){vt(t);break}n=n.parentNode}var s=t.nextSibling;s&&s.tagName===o&>(s,t)&&(Se(t,s),vt(s))}}}(t)},A.closeDropDown=function(e){s&&(ke(s),s=null),!0===e&&A.focus()},A.wysiwygEditorInsertHtml=function(e,t,n){var o=He(i);A.focus(),!n&&Ce(v,"code")||(m.insertHTML(e,t),m.saveRange(),P(),pt(f),en(f,d),et(n=Ne(f,"#sceditor-end-marker")[0]),e=f.scrollTop,t=ht(n).top+1.5*n.offsetHeight-o,Je(n),(e").replace(/&/g,"&")),A.wysiwygEditorInsertHtml(e)),A},A.getWysiwygEditorValue=function(e){for(var t,n=Ee("div",{},d),o=f.childNodes,r=0;r

"),P(),k(),S(),D()},A.setSourceEditorValue=function(e){l.value=e,S()},A.updateOriginal=function(){r.value=A.val()},P=function(){var e,l,s,c,t,u,d;I.emoticonsEnabled&&(e=f,l=O,s=I.emoticonsCompat,c=e.ownerDocument,t="(^|\\s| | | | |$)",u=[],d={},Ze(e,"code")||(xe(l,function(e){d[e]=new RegExp(t+bt(e)+t),u.push(e)}),u.sort(function(e,t){return t.length-e.length}),function e(t){for(t=t.firstChild;t;){if(t.nodeType!==we||Oe(t,"code")||e(t),t.nodeType===Te)for(var n=0;n"),e.preventDefault()))},k=function(){st(f,function(e){return e.nodeType!==we||/inline/.test(Me(e,"display"))||Oe(e,".sceditor-nlf")||!ut(e)?!(3===e.nodeType&&!/^\s*$/.test(e.nodeValue)||Oe(e,"br"))&&void 0:((e=Ee("p",{},d)).className="sceditor-nlf",e.innerHTML="
",Se(f,e),!1)})},E=function(){A.val(r.value)},te=function(){A.closeDropDown()},A._=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+1]?n[+t+1]:"{"+t+"}"})},oe=function(t){h&&h.call(t.type+"Event",t,A);var e=(t.target===l?"scesrc":"scewys")+t.type;_[e]&&_[e].forEach(function(e){e.call(A,t)})},A.bind=function(e,t,n,o){for(var r,i,a=(e=e.split(" ")).length;a--;)Ke(t)&&(r="scewys"+e[a],i="scesrc"+e[a],n||(_[r]=_[r]||[],_[r].push(t)),o||(_[i]=_[i]||[],_[i].push(t)),"valuechanged"===e[a]&&(S.hasHandler=!0));return A},A.unbind=function(e,t,n,o){for(var r=(e=e.split(" ")).length;r--;)Ke(t)&&(n||Qe(_["scewys"+e[r]]||[],t),o||Qe(_["scesrc"+e[r]]||[],t));return A},A.blur=function(e,t,n){return Ke(e)?A.bind("blur",e,t,n):(A.sourceMode()?l:f).blur(),A},A.focus=function(e,t,n){if(Ke(e))A.bind("focus",e,t,n);else if(A.inSourceMode())l.focus();else{if(Ne(d,":focus").length)return;e=m.selectedRange(),y||ce(!0),e&&1===e.endOffset&&e.collapsed&&(t=e.endContainer)&&1===t.childNodes.length&&Oe(t.firstChild,"br")&&(e.setStartBefore(t.firstChild),e.collapse(!0),m.selectRange(e)),o.focus(),f.focus()}return C(),A},A.keyDown=function(e,t,n){return A.bind("keydown",e,t,n)},A.keyPress=function(e,t,n){return A.bind("keypress",e,t,n)},A.keyUp=function(e,t,n){return A.bind("keyup",e,t,n)},A.nodeChanged=function(e){return A.bind("nodechanged",e,!1,!0)},A.selectionChanged=function(e){return A.bind("selectionchanged",e,!1,!0)},A.valueChanged=function(e,t,n){return A.bind("valuechanged",e,t,n)},ue=function(e){var n=0,o=A.emoticonsCache,t=String.fromCharCode(e.which);Ce(v,"code")||(o||(o=[],xe(O,function(e,t){o[n++]=[e,t]}),o.sort(function(e,t){return e[0].length-t[0].length}),A.emoticonsCache=o,A.longestEmoticonCode=o[o.length-1][0].length),!m.replaceKeyword(A.emoticonsCache,!0,!0,A.longestEmoticonCode,I.emoticonsCompat,t)||I.emoticonsCompat&&/^\s$/.test(t)||e.preventDefault())},de=function(){var e=v,t=m,n=/[^\s\xA0\u2002\u2003\u2009]+/,o=e&&Ne(e,"img[data-sceditor-emoticon]");if(e&&o.length)for(var r=0;r","/":"?","\\":"|","[":"{","]":"}"},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"},r=e.which,i={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:"'"}[r]||String.fromCharCode(r).toLowerCase();(e.ctrlKey||e.metaKey)&&t.push("ctrl"),e.altKey&&t.push("alt"),e.shiftKey&&(t.push("shift"),o[r]?i=o[r]:n[i]&&(i=n[i])),i&&(r<16||18{0}"},i:{tags:{i:null,em:null},styles:{"font-style":["italic","oblique"]},format:"[i]{0}[/i]",html:"{0}"},u:{tags:{u:null},styles:{"text-decoration":["underline"]},format:"[u]{0}[/u]",html:"{0}"},s:{tags:{s:null,strike:null},styles:{"text-decoration":["line-through"]},format:"[s]{0}[/s]",html:"{0}"},sub:{tags:{sub:null},format:"[sub]{0}[/sub]",html:"{0}"},sup:{tags:{sup:null},format:"[sup]{0}[/sup]",html:"{0}"},font:{tags:{font:{face:null}},styles:{"font-family":null},quoteType:x.never,format:function(e,t){var n;return"[font="+l(n=v(e,"font")&&(n=g(e,"face"))?n:f(e,"font-family"))+"]"+t+"[/font]"},html:'{0}'},size:{tags:{font:{size:null}},styles:{"font-size":null},format:function(e,t){var n=g(e,"size"),o=2;return-1<(n=n||f(e,"fontSize")).indexOf("px")?((n=+n.replace("px",""))<12&&(o=1),15{!0}'},color:{tags:{font:{color:null}},styles:{color:null},quoteType:x.never,format:function(e,t){var n;return"[color="+a(n=v(e,"font")&&(n=g(e,"color"))?n:e.style.color||f(e,"color"))+"]"+t+"[/color]"},html:function(e,t,n){return''+n+""}},ul:{tags:{ul:null},breakStart:!0,isInline:!1,skipLastLineBreak:!0,format:"[ul]{0}[/ul]",html:"
    {0}
"},list:{breakStart:!0,isInline:!1,skipLastLineBreak:!0,html:"
    {0}
"},ol:{tags:{ol:null},breakStart:!0,isInline:!1,skipLastLineBreak:!0,format:"[ol]{0}[/ol]",html:"
    {0}
"},li:{tags:{li:null},isInline:!1,closedBy:["/ul","/ol","/list","*","li"],format:"[li]{0}[/li]",html:"
  • {0}
  • "},"*":{isInline:!1,closedBy:["/ul","/ol","/list","*","li"],html:"
  • {0}
  • "},table:{tags:{table:null},isInline:!1,isHtmlInline:!0,skipLastLineBreak:!0,format:"[table]{0}[/table]",html:"{0}
    "},tr:{tags:{tr:null},isInline:!1,skipLastLineBreak:!0,format:"[tr]{0}[/tr]",html:"{0}"},th:{tags:{th:null},allowsEmpty:!0,isInline:!1,format:"[th]{0}[/th]",html:"{0}"},td:{tags:{td:null},allowsEmpty:!0,isInline:!1,format:"[td]{0}[/td]",html:"{0}"},emoticon:{allowsEmpty:!0,tags:{img:{src:null,"data-sceditor-emoticon":null}},format:function(e,t){return g(e,b)+t},html:"{0}"},hr:{tags:{hr:null},allowsEmpty:!0,isSelfClosing:!0,isInline:!1,format:"[hr]{0}",html:"
    "},img:{allowsEmpty:!0,tags:{img:{src:null}},allowedChildren:["#"],quoteType:x.auto,format:function(t,e){function n(e){return t.style?t.style[e]:null}var o,r,i="";return g(t,b)?e:(e=g(t,"width")||n("width"),o=g(t,"height")||n("height"),(r=g(t,"alt")||null)?(e&&(i+=' width="'+e+'"'),o&&(i+=' height="'+o+'"'),i+=' alt="'+r+'"'):(t.complete&&(e||o)||e&&o)&&(i="="+h.width(t)+"x"+h.height(t)),"[img"+i+"]"+g(t,"src")+"[/img]")},html:function(e,t,n){var o,r="",i=t.width,a=t.height,l=t.alt;return t.defaultattr&&(i=(t=t.defaultattr.split(/x/i))[0],a=2===t.length?t[1]:t[0]),i!==o&&(r+=' width="'+d(i,!0)+'"'),a!==o&&(r+=' height="'+d(a,!0)+'"'),l!==o&&(r+=' alt="'+d(l,!0)+'"'),"'}},url:{allowsEmpty:!0,tags:{a:{href:null}},quoteType:x.never,format:function(e,t){e=g(e,"href");return"mailto:"===e.substr(0,7)?'[email="'+e.substr(7)+'"]'+t+"[/email]":"[url="+e+"]"+t+"[/url]"},html:function(e,t,n){return t.defaultattr=d(t.defaultattr,!0)||n,''+n+""}},email:{quoteType:x.never,html:function(e,t,n){return''+n+""}},quote:{tags:{blockquote:null},isInline:!1,quoteType:x.never,format:function(e,t){for(var n,o="data-author",r="",i=e.children,a=0;!n&&a"+(n=t.defaultattr?""+d(t.defaultattr)+""+n:n)+""}},code:{tags:{code:null},isInline:!1,allowedChildren:["#","#newline"],format:"[code]{0}[/code]",html:"{0}"},left:{styles:{"text-align":["left","-webkit-left","-moz-left","-khtml-left"]},isInline:!1,allowsEmpty:!0,format:"[left]{0}[/left]",html:'
    {0}
    '},center:{styles:{"text-align":["center","-webkit-center","-moz-center","-khtml-center"]},isInline:!1,allowsEmpty:!0,format:"[center]{0}[/center]",html:'
    {0}
    '},right:{styles:{"text-align":["right","-webkit-right","-moz-right","-khtml-right"]},isInline:!1,allowsEmpty:!0,format:"[right]{0}[/right]",html:'
    {0}
    '},justify:{styles:{"text-align":["justify","-webkit-justify","-moz-justify","-khtml-justify"]},isInline:!1,allowsEmpty:!0,format:"[justify]{0}[/justify]",html:'
    {0}
    '},youtube:{allowsEmpty:!0,tags:{iframe:{"data-youtube-id":null}},format:function(e,t){return(e=g(e,"data-youtube-id"))?"[youtube]"+e+"[/youtube]":t},html:''},rtl:{styles:{direction:["rtl"]},isInline:!1,format:"[rtl]{0}[/rtl]",html:'
    {0}
    '},ltr:{styles:{direction:["ltr"]},isInline:!1,format:"[ltr]{0}[/ltr]",html:'
    {0}
    '},ignore:{}};function T(e,o){return e.replace(/\{([^}]+)\}/g,function(e,t){var n=!0;return"!"===t.charAt(0)&&(n=!1,t=t.substring(1)),"0"===t&&(n=!1),void 0===o[t]?e:n?d(o[t],!0):o[t]})}function E(e){return"function"==typeof e}function l(e){return e&&e.replace(/\\(.)/g,"$1").replace(/^(["'])(.*?)\1$/,"$2")}var C="open",k="content",S="newline",N="close";function c(e,t,n,o,r,i){var a=this;a.type=e,a.name=t,a.val=n,a.attrs=o||{},a.children=r||[],a.closing=i||null}function D(e){var m=this;function a(e,t){var n,o,r;return e===C&&(n=t.match(/\[([^\]\s=]+)(?:([^\]]+))?\]/))&&(r=i(n[1]),n[2]&&(n[2]=n[2].trim())&&(o=function(e){var t,n=/([^\s=]+)=(?:(?:(["'])((?:\\\2|[^\2])*?)\2)|((?:.(?!\s\S+=))*.))/g,o={};if("="===e.charAt(0)&&e.indexOf("=",1)<0)o.defaultattr=l(e.substr(1));else for("="===e.charAt(0)&&(e="defaultattr"+e);t=n.exec(e);)o[i(t[1])]=l(t[3])||t[4];return o}(n[2]))),e===N&&(n=t.match(/\[\/([^\[\]]+)\]/))&&(r=i(n[1])),(r=e===S?"#newline":r)&&(e!==C&&e!==N||w[r])||(e=k,r="#"),new c(e,r,t,o)}function f(e,t,n){for(var o=n.length;o--;)if(n[o].type===t&&n[o].name===e)return 1}function p(e,t){e=(e?w[e.name]:{}).allowedChildren;return!m.opts.fixInvalidChildren||!e||-1"),E(o.html)?o.html.call(m,n,n.attrs,r):(n.attrs[0]=r,T(o.html,n.attrs))):n.val+r+(n.closing?n.closing.val:"");else{if(n.type===S){if(!t){s+="
    ";continue}a||(s+="
    "),s+="
    ",e.length||(s+="
    "),s+="
    \n",a=!1;continue}i=t,l=d(n.val,!0)}i&&!a?(s+="
    ",a=!0):!i&&a&&(s+="
    \n",a=!1),s+=l}return a&&(s+="\n"),s}function h(e,t,n){var o=/\s|=/.test(e);return E(t)?t(e,n):t===x.never||t===x.auto&&!o?e:'"'+e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')+'"'}function g(e){return e.length?e[e.length-1]:null}function i(e){return e.toLowerCase()}m.opts=n({},D.defaults,e),m.tokenize=function(e){var t,n,o,r=[],i=[{type:k,regex:/^([^\[\r\n]+|\[)/},{type:S,regex:/^(\r\n|\r|\n)/},{type:C,regex:/^\[[^\[\]]+\]/},{type:N,regex:/^\[\/[^\[\]]+\]/}];e:for(;e.length;){for(o=i.length;o--;)if(n=i[o].type,(t=e.match(i[o].regex))&&t[0]){r.push(a(n,t[0])),e=e.substr(t[0].length);continue e}e.length&&r.push(a(k,e)),e=""}return r},m.parse=function(e,t){var e=function(e){function t(){return g(d)}function n(e){(t()?t().children:u).push(e)}function o(e){return t()&&(i=w[t().name])&&i.closedBy&&-1":">"," ":"  ","\r\n":"
    ","\r":"
    ","\n":"
    "})!==t&&(n['"']=""",n["'"]="'",n["`"]="`"),e=e.replace(/ {2}|\r\n|[&<>\r\n'"`]/g,function(e){return n[e]||e})),e}var b={html:'

    ',toolbarButton:'
    {dispName}
    ',emoticon:'{key}',fontOpt:'{font}',sizeOpt:'{size}',pastetext:'
    ',table:'
    ',image:'
    ',email:'
    ',link:'
    ',youtubeMenu:'
    ',youtube:''};function Pe(e,t,n){var o=b[e];return Object.keys(t).forEach(function(e){o=o.replace(new RegExp(bt("{"+e+"}"),"g"),t[e])}),o=n?ct(o):o}function x(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(Me(n.parentNode,"whiteSpace"))&&ke(n),n=t}}var Ue={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){var t;if(e=e&&3===e.nodeType?e.parentNode:e)return t="ltr"===Me(e,"direction"),e=Me(e,"textAlign"),/left/.test(e)||e===(t?"start":"end")},exec:"justifyleft",tooltip:"Align left"},center:{exec:"justifycenter",tooltip:"Center"},right:{state:function(e){var t;if(e=e&&3===e.nodeType?e.parentNode:e)return t="ltr"===Me(e,"direction"),e=Me(e,"textAlign"),/right/.test(e)||e===(t?"end":"start")},exec:"justifyright",tooltip:"Align right"},justify:{exec:"justifyfull",tooltip:"Justify"},font:{_dropDown:function(t,e,n){var o=Ee("div");De(o,"click","a",function(e){n(nt(this,"font")),t.closeDropDown(!0),e.preventDefault()}),t.opts.fonts.split(",").forEach(function(e){Se(o,Pe("fontOpt",{font:e},!0))}),t.createDropDown(e,"font-picker",o)},exec:function(e){var t=this;Ue.font._dropDown(t,e,function(e){t.execCommand("fontname",e)})},tooltip:"Font Name"},size:{_dropDown:function(t,e,n){var o=Ee("div");De(o,"click","a",function(e){n(nt(this,"size")),t.closeDropDown(!0),e.preventDefault()});for(var r=1;r<=7;r++)Se(o,Pe("sizeOpt",{size:r},!0));t.createDropDown(e,"fontsize-picker",o)},exec:function(e){var t=this;Ue.size._dropDown(t,e,function(e){t.execCommand("fontsize",e)})},tooltip:"Font Size"},color:{_dropDown:function(t,e,n){var o=Ee("div"),r="",i=Ue.color;i._htmlCache||(t.opts.colors.split("|").forEach(function(e){r+='
    ',e.split(",").forEach(function(e){r+=''}),r+="
    "}),i._htmlCache=r),Se(o,ct(i._htmlCache)),De(o,"click","a",function(e){n(nt(this,"color")),t.closeDropDown(!0),e.preventDefault()}),t.createDropDown(e,"color-picker",o)},exec:function(e){var t=this;Ue.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=Ee("div"),o=this;Se(n,Pe("pastetext",{label:o._("Paste your text inside the following box:"),insert:o._("Insert")},!0)),De(n,"click",".button",function(e){(t=Ne(n,"#txt")[0].value)&&o.wysiwygEditorInsertText(t),o.closeDropDown(!0),e.preventDefault()}),o.createDropDown(e,"pastetext",n)},tooltip:"Paste Text"},bulletlist:{exec:function(){x(this),this.execCommand("insertunorderedlist")},tooltip:"Bullet list"},orderedlist:{exec:function(){x(this),this.execCommand("insertorderedlist")},tooltip:"Numbered list"},indent:{state:function(e,t){var n;return Oe(t,"li")||Oe(t,"ul,ol,menu")&&(n=(t=this.getRangeHelper().selectedRange()).startContainer.parentNode,t=t.endContainer.parentNode,n!==n.parentNode.firstElementChild||Oe(t,"li")&&t!==t.parentNode.lastElementChild)?0:-1},exec:function(){var e=this.getRangeHelper().getFirstBlockParent();this.focus(),Ce(e,"ul,ol,menu")&&this.execCommand("indent")},tooltip:"Add indent"},outdent:{state:function(e,t){return Ce(t,"ul,ol,menu")?0:-1},exec:function(){Ce(this.getRangeHelper().getFirstBlockParent(),"ul,ol,menu")&&this.execCommand("outdent")},tooltip:"Remove one indent"},table:{exec:function(e){var r=this,i=Ee("div");Se(i,Pe("table",{rows:r._("Rows:"),cols:r._("Cols:"),insert:r._("Insert")},!0)),De(i,"click",".button",function(e){var t=Number(Ne(i,"#rows")[0].value),n=Number(Ne(i,"#cols")[0].value),o="";0"+Array(n+1).join("")+""),r.wysiwygEditorInsertHtml(o+="

    "),r.closeDropDown(!0),e.preventDefault())}),r.createDropDown(e,"inserttable",i)},tooltip:"Insert a table"},horizontalrule:{exec:"inserthorizontalrule",tooltip:"Insert a horizontal rule"},code:{exec:function(){this.wysiwygEditorInsertHtml("","
    ")},tooltip:"Code"},image:{_dropDown:function(t,e,n,o){var r=Ee("div"),i=(Se(r,Pe("image",{url:t._("URL:"),width:t._("Width (optional):"),height:t._("Height (optional):"),alt:t._("Alt Text (optional):"),insert:t._("Insert")},!0)),Ne(r,"#image")[0]);i.value=n,De(r,"click",".button",function(e){i.value&&o(i.value,Ne(r,"#width")[0].value,Ne(r,"#height")[0].value,Ne(r,"#alt")[0].value),t.closeDropDown(!0),e.preventDefault()}),t.createDropDown(e,"insertimage",r)},exec:function(e){var i=this;Ue.image._dropDown(i,e,"",function(e,t,n,o){var r="";t&&(r+=' width="'+parseInt(t,10)+'"'),n&&(r+=' height="'+parseInt(n,10)+'"'),o&&(r+=' alt="'+ze(o)+'"'),r+=' src="'+ze(e)+'"',i.wysiwygEditorInsertHtml("")})},tooltip:"Insert an image"},email:{_dropDown:function(n,e,o){var r=Ee("div");Se(r,Pe("email",{label:n._("E-mail:"),desc:n._("Description (optional):"),insert:n._("Insert")},!0)),De(r,"click",".button",function(e){var t=Ne(r,"#email")[0].value;t&&o(t,Ne(r,"#des")[0].value),n.closeDropDown(!0),e.preventDefault()}),n.createDropDown(e,"insertemail",r)},exec:function(e){var n=this;Ue.email._dropDown(n,e,function(e,t){!n.getRangeHelper().selectedHtml()||t?n.wysiwygEditorInsertHtml(''+ze(t||e)+""):n.execCommand("createlink","mailto:"+e)})},tooltip:"Insert an email"},link:{_dropDown:function(t,e,n){var o=Ee("div"),r=(Se(o,Pe("link",{url:t._("URL:"),desc:t._("Description (optional):"),ins:t._("Insert")},!0)),Ne(o,"#link")[0]);function i(e){r.value&&n(r.value,Ne(o,"#des")[0].value),t.closeDropDown(!0),e.preventDefault()}De(o,"click",".button",i),De(o,"keypress",function(e){13===e.which&&r.value&&i(e)},!0),t.createDropDown(e,"insertlink",o)},exec:function(e){var n=this;Ue.link._dropDown(n,e,function(e,t){t||!n.getRangeHelper().selectedHtml()?n.wysiwygEditorInsertHtml(''+ze(t||e)+""):n.execCommand("createlink",e)})},tooltip:"Insert a link"},unlink:{state:function(){return Ce(this.currentNode(),"a")?0:-1},exec:function(){var e=Ce(this.currentNode(),"a");if(e){for(;e.firstChild;)Ie(e.firstChild,e);ke(e)}},tooltip:"Unlink"},quote:{exec:function(e,t,n){var o="
    ",r="
    ";t?(o=o+(n=n?""+ze(n)+"":"")+t+r,r=null):""===this.getRangeHelper().selectedHtml()&&(r="
    "+r),this.wysiwygEditorInsertHtml(o,r)},tooltip:"Insert a Quote"},emoticon:{exec:function(d){var f=this;f.createDropDown(d,"emoticons",function t(e){var n,o=f.opts,r=o.emoticonsRoot||"",i=o.emoticonsCompat,a=f.getRangeHelper(),l=i&&" "!==a.getOuterText(!0,1)?" ":"",s=i&&" "!==a.getOuterText(!1,1)?" ":"",c=Ee("div"),u=Ee("div"),i=be({},o.emoticons.dropdown,e?o.emoticons.more:{});return Se(c,u),n=Math.sqrt(Object.keys(i).length),De(c,"click","img",function(e){f.insert(l+_e(this,"alt")+s,null,!1).closeDropDown(!0),e.preventDefault()}),xe(i,function(e,t){Se(u,Ee("img",{src:r+(t.url||t),alt:e,title:t.tooltip||e})),u.children.length>=n&&(u=Ee("div"),Se(c,u))}),!e&&o.emoticons.more&&(Se(a=Ee("a",{className:"sceditor-more"}),document.createTextNode(f._("More"))),De(a,"click",function(e){f.createDropDown(d,"more-emoticons",t(!0)),e.preventDefault()}),Se(c,a)),c}(!1))},txtExec:function(e){Ue.emoticon.exec.call(this,e)},tooltip:"Insert an emoticon"},youtube:{_dropDown:function(r,e,i){var a=Ee("div");Se(a,Pe("youtubeMenu",{label:r._("Video URL:"),insert:r._("Insert")},!0)),De(a,"click",".button",function(e){var t=(n=Ne(a,"#link")[0].value).match(/(?:v=|v\/|embed\/|youtu.be\/)?([a-zA-Z0-9_-]{11})/),n=n.match(/[&|?](?:star)?t=((\d+[hms]?){1,3})/),o=0;n&&xe(n[1].split(/[hms]/),function(e,t){""!==t&&(o=60*o+Number(t))}),t&&/^[a-zA-Z0-9_\-]{11}$/.test(t[1])&&i(t[1],o),r.closeDropDown(!0),e.preventDefault()}),r.createDropDown(e,"insertlink",a)},exec:function(e){var n=this;Ue.youtube._dropDown(n,e,function(e,t){n.wysiwygEditorInsertHtml(Pe("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;return o<10&&(o="0"+o),(t=t.getDate())<10&&(t="0"+t),e.opts.dateFormat.replace(/year/i,n=n<2e3?1900+n:n).replace(/month/i,o).replace(/day/i,t)},exec:function(){this.insertText(Ue.date._date(this))},txtExec:function(){this.insertText(Ue.date._date(this))},tooltip:"Insert current date"},time:{_time:function(){var e=new Date,t=e.getHours(),n=e.getMinutes();return(t=t<10?"0"+t:t)+":"+(n=n<10?"0"+n:n)+":"+((e=e.getSeconds())<10?"0"+e:e)},exec:function(){this.insertText(Ue.time._time())},txtExec:function(){this.insertText(Ue.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&&!Oe(t,"body")||(this.execCommand("formatBlock","p"),(t=e.getFirstBlockParent())&&!Oe(t,"body")))&&(e="ltr"===Me(t,"direction")?"":"ltr",Me(t,"direction",e))},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&&!Oe(t,"body")||(this.execCommand("formatBlock","p"),(t=e.getFirstBlockParent())&&!Oe(t,"body")))&&(e="rtl"===Me(t,"direction")?"":"rtl",Me(t,"direction",e))},tooltip:"Right-to-Left"},print:{exec:"print",tooltip:"Print"},maximize:{state:function(){return this.maximize()},exec:function(){this.maximize(!this.maximize()),this.focus()},txtExec:function(){this.maximize(!this.maximize()),this.focus()},tooltip:"Maximize",shortcut:"Ctrl+Shift+M"},source:{state:function(){return this.sourceMode()},exec:function(){this.toggleSourceMode(),this.focus()},txtExec:function(){this.toggleSourceMode(),this.focus()},tooltip:"View source",shortcut:"Ctrl+Shift+S"},ignore:{}},w={};function xt(i){function a(e){return"signal"+e.charAt(0).toUpperCase()+e.slice(1)}function e(e,t){for(var n,o=a((e=[].slice.call(e)).shift()),r=0;rs.length&&c&&3===c.nodeType;)o=c.nodeValue,r=n-s.length,l&&(a=o.length,i=0),l=c,c=t?(u=i=Math.max(a-r,0),s=o.substr(i,a-i)+s,l.previousSibling):(u=i+(a=Math.min(r,o.length)),s+=o.substr(i,a),l.nextSibling);return{node:l||c,offset:u,text:s}};function wt(r,e,i){var a,l,s=e||r.contentDocument||r.document,c="sceditor-start-marker",u="sceditor-end-marker",g=this;g.insertHTML=function(e,t){var n,o;if(!g.selectedRange())return!1;for(t&&(e+=g.selectedHtml()+t),o=Ee("p",{},s),n=s.createDocumentFragment(),o.innerHTML=i(e);o.firstChild;)Se(n,o.firstChild);g.insertNode(n)},l=function(e,t,n){var o,r=s.createDocumentFragment();if("string"==typeof e?(t&&(e+=g.selectedHtml()+t),r=ct(e)):(Se(r,e),t&&(Se(r,g.selectedRange().extractContents()),Se(r,t))),o=r.lastChild){for(;!Fe(o.lastChild,!0);)o=o.lastChild;return ft(o)?o.lastChild||Se(o,document.createTextNode("​")):o=r,g.removeMarkers(),Se(o,a(c)),Se(o,a(u)),n?(Se(e=Ee("div"),r),e.innerHTML):r}},g.insertNode=function(e,t){var n,o,e=l(e,t),r=(t=g.selectedRange()).commonAncestorContainer,i=[];if(!e)return!1;function a(e){e&&m(e)&&i.indexOf(e)<0&&ke(e)}t.startContainer!==t.endContainer&&(xe(r.childNodes,function(e,t){m(t)&&i.push(t)}),n=e.firstChild,o=e.lastChild),t.deleteContents(),r&&3!==r.nodeType&&!ft(r)?Ie(e,r):(t.insertNode(e),a(n&&n.previousSibling),a(o&&o.nextSibling)),g.restoreRange()},g.cloneSelected=function(){var e=g.selectedRange();if(e)return e.cloneRange()},g.selectedRange=function(){var e,t,n=r.getSelection();if(n){if(n.rangeCount<=0){for(t=s.body;t.firstChild;)t=t.firstChild;(e=s.createRange()).setStartBefore(t),n.addRange(e)}return 0/gm),R=t(/\${[\w\W]*}/gm),M=t(/^data-[\-\w.\u00B7-\uFFFF]/),n=t(/^aria-[\-\w]+$/);const Xt=t(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i);var O=t(/^(?:\w+script|data):/i),I=t(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g);const Kt=t(/^html$/i);var Qt=Object.freeze({__proto__:null,MUSTACHE_EXPR:_,ERB_EXPR:e,TMPLIT_EXPR:R,DATA_ATTR:M,ARIA_ATTR:n,IS_ALLOWED_URI:Xt,IS_SCRIPT_OR_DATA:O,ATTR_WHITESPACE:I,DOCTYPE_NAME:Kt}),Zt=function B(e){e=0B(e);if(c.version="3.0.9",c.removed=[],!e||!e.document||9!==e.document.nodeType)return c.isSupported=!1,c;let i=e.document;const l=i,H=l.currentScript,{DocumentFragment:F,HTMLTemplateElement:z,Node:s,Element:P,NodeFilter:t,NamedNodeMap:U=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:j,DOMParser:W,trustedTypes:u}=e,q=Ht(e=P.prototype,"cloneNode"),V=Ht(e,"nextSibling"),Y=Ht(e,"childNodes"),a=Ht(e,"parentNode");"function"==typeof z&&(e=i.createElement("template")).content&&e.content.ownerDocument&&(i=e.content.ownerDocument);let d,f="";const{implementation:p,createNodeIterator:G,createDocumentFragment:$,getElementsByTagName:X}=i,K=l.importNode;let o={};c.isSupported="function"==typeof Ct&&"function"==typeof a&&p&&void 0!==p.createHTMLDocument;const{MUSTACHE_EXPR:m,ERB_EXPR:h,TMPLIT_EXPR:g,DATA_ATTR:Q,ARIA_ATTR:Z,IS_SCRIPT_OR_DATA:J,ATTR_WHITESPACE:ee}=Qt;let te=Qt.IS_ALLOWED_URI,v=null;const ne=Ve({},[...Ft,...zt,...Pt,...jt,...qt]);let y=null;const oe=Ve({},[...Vt,...Yt,...Gt,...$t]);let b=Object.seal(kt(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),x=null,re=null,ie=!0,ae=!0,le=!1,se=!0,w=!1,T=!1,ce=!1,ue=!1,E=!1,C=!1,k=!1,de=!0,fe=!1;const pe="user-content-";let me=!0,S=!1,n={},N=null;const he=Ve({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let ge=null;const ve=Ve({},["audio","video","img","source","image","track"]);let ye=null;const be=Ve({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),D="http://www.w3.org/1998/Math/MathML",A="http://www.w3.org/2000/svg",_="http://www.w3.org/1999/xhtml";let R=_,xe,we=null;const Te=Ve({},[D,A,_],Rt);let M=null;const Ee=["application/xhtml+xml","text/html"];let O=null,r=null;function Ce(e){return e instanceof RegExp||e instanceof Function}function ke(e){let t=0"+e:(o=Mt(e,/^[\r\n\t ]+/),n=o&&o[0]),"application/xhtml+xml"===M&&R===_&&(e=''+e+"");var o=d?d.createHTML(e):e;if(R===_)try{t=(new W).parseFromString(o,M)}catch(e){}if(!t||!t.documentElement){t=p.createDocument(R,"template",null);try{t.documentElement.innerHTML=xe?f:o}catch(e){}}const r=t.body||t.documentElement;return e&&n&&r.insertBefore(i.createTextNode(n),r.childNodes[0]||null),R===_?X.call(t,T?"html":"body")[0]:T?t.documentElement:r}function Ne(e){return G.call(e.ownerDocument||e,e,t.SHOW_ELEMENT|t.SHOW_COMMENT|t.SHOW_TEXT,null)}function De(e){return"function"==typeof s&&e instanceof s}function Ae(t){let n=null;if(L("beforeSanitizeElements",t,null),!((e=t)instanceof j)||"string"==typeof e.nodeName&&"string"==typeof e.textContent&&"function"==typeof e.removeChild&&e.attributes instanceof U&&"function"==typeof e.removeAttribute&&"function"==typeof e.setAttribute&&"string"==typeof e.namespaceURI&&"function"==typeof e.insertBefore&&"function"==typeof e.hasChildNodes){var e=O(t.nodeName);if(L("uponSanitizeElement",t,{tagName:e,allowedTags:v}),!t.hasChildNodes()||De(t.firstElementChild)||!qe(/<[/\w]/g,t.innerHTML)||!qe(/<[/\w]/g,t.textContent)){if(v[e]&&!x[e])return t instanceof P&&!function(e){let t=a(e);t&&t.tagName||(t={namespaceURI:R,tagName:"template"});var n=_t(e.tagName),o=_t(t.tagName);return we[e.namespaceURI]&&(e.namespaceURI===A?t.namespaceURI===_?"svg"===n:t.namespaceURI===D?"svg"===n&&("annotation-xml"===o||Oe[o]):Boolean(Be[n]):e.namespaceURI===D?t.namespaceURI===_?"math"===n:t.namespaceURI===A?"math"===n&&Ie[o]:Boolean(He[n]):e.namespaceURI===_?(t.namespaceURI!==A||Ie[o])&&(t.namespaceURI!==D||Oe[o])&&!He[n]&&(Le[n]||!Be[n]):"application/xhtml+xml"===M&&we[e.namespaceURI])}(t)||("noscript"===e||"noembed"===e||"noframes"===e)&&qe(/<\/no(script|embed|frames)/i,t.innerHTML)?(I(t),1):(w&&3===t.nodeType&&(n=t.textContent,Nt([m,h,g],e=>{n=Ot(n,e," ")}),t.textContent!==n&&(At(c.removed,{element:t.cloneNode()}),t.textContent=n)),L("afterSanitizeElements",t,null),0);if(!x[e]&&_e(e)){if(b.tagNameCheck instanceof RegExp&&qe(b.tagNameCheck,e))return;if(b.tagNameCheck instanceof Function&&b.tagNameCheck(e))return}if(me&&!N[e]){const r=a(t)||t.parentNode;var o=Y(t)||t.childNodes;if(o&&r)for(let e=o.length-1;0<=e;--e)r.insertBefore(q(o[e],!0),V(t))}}}return I(t),1}function _e(e){return"annotation-xml"!==e&&0/i,t))Fe(r,n);else if(w&&Nt([m,h,g],e=>{t=Ot(t,e," ")}),a=O(n.nodeName),ze(a,l,t)){if(!fe||"id"!==l&&"name"!==l||(Fe(r,n),t=pe+t),d&&"object"==typeof u&&"function"==typeof u.getAttributeType&&!i)switch(u.getAttributeType(a,l)){case"TrustedHTML":t=d.createHTML(t);break;case"TrustedScriptURL":t=d.createScriptURL(t)}try{i?n.setAttributeNS(i,r,t):n.setAttribute(r,t),Dt(c.removed)}catch(e){}}}L("afterSanitizeAttributes",n,null)}}const Me=i.createElement("form"),Oe=Ve({},["mi","mo","mn","ms","mtext"]),Ie=Ve({},["foreignobject","desc","title","annotation-xml"]),Le=Ve({},["title","style","font","a","script"]),Be=Ve({},[...zt,...Pt,...Ut]),He=Ve({},[...jt,...Wt]),Fe=function(e,t){try{At(c.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){At(c.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!y[e])if(E||C)try{I(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},L=function(e,t,n){o[e]&&Nt(o[e],e=>{e.call(c,t,n,r)})},ze=function(e,t,n){if(de&&("id"===t||"name"===t)&&(n in i||n in Me))return!1;if((!ae||re[t]||!qe(Q,t))&&(!ie||!qe(Z,t)))if(!y[t]||re[t]){if(!(_e(e)&&(b.tagNameCheck instanceof RegExp&&qe(b.tagNameCheck,e)||b.tagNameCheck instanceof Function&&b.tagNameCheck(e))&&(b.attributeNameCheck instanceof RegExp&&qe(b.attributeNameCheck,t)||b.attributeNameCheck instanceof Function&&b.attributeNameCheck(t))||"is"===t&&b.allowCustomizedBuiltInElements&&(b.tagNameCheck instanceof RegExp&&qe(b.tagNameCheck,n)||b.tagNameCheck instanceof Function&&b.tagNameCheck(n))))return!1}else if(!ye[t]&&!qe(te,Ot(n,ee,""))&&("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==It(n,"data:")||!ge[e])&&(!le||qe(J,Ot(n,ee,"")))&&n)return!1;return!0};return c.sanitize=function(e){var t,n=1\n"+a),w&&Nt([m,h,g],e=>{a=Ot(a,e," ")}),d&&k?d.createHTML(a):a},c.setConfig=function(){ke(0'})},void n.readAsDataURL(t);i[a[s]]=r.getData(a[s])}i.text=i["text/plain"],i.html=L(i["text/html"]),Q(i)}else if(!w){var c=o.scrollTop;for(m.saveRange(),w=Ge.createDocumentFragment();o.firstChild;)Se(w,o.firstChild);setTimeout(function(){var e=o.innerHTML;o.innerHTML="",Se(o,w),o.scrollTop=c,w=!1,m.restoreRange(),Q({html:L(e)})},0)}},Q=function(e){var t=Ee("div",{},d),e=(h.call("pasteRaw",e),at(x,"pasteraw",e),e.html?(t.innerHTML=L(e.html),pt(t)):t.innerHTML=ze(e.text||""),{val:t.innerHTML}),t=("fragmentToSource"in a&&(e.val=a.fragmentToSource(e.val,d,g)),h.call("paste",e),at(x,"paste",e),"fragmentToHtml"in a&&(e.val=a.fragmentToHtml(e.val,g)),h.call("pasteHtml",e),m.getFirstBlockParent());A.wysiwygEditorInsertHtml(e.val,null,!0),function e(t){if(t.nodeType===we){for(var n=t.parentNode,o=t.tagName,r=t.childNodes.length;r--;)e(t.childNodes[r]);if(Fe(t)&&"BR"!==o){for(r=t.style.length;r--;){var i=t.style[r];Me(n,i)===Me(t,i)&&t.style.removeProperty(i)}if(!t.style.length)if(Re(t,"style"),"FONT"===o&&(Me(t,"fontFamily").toLowerCase()===Me(n,"fontFamily").toLowerCase()&&Re(t,"face"),Me(t,"color")===Me(n,"color")&&Re(t,"color"),Me(t,"fontSize")===Me(n,"fontSize")&&Re(t,"size")),!t.attributes.length&&/SPAN|FONT/.test(o))vt(t);else if(/B|STRONG|EM|SPAN|FONT/.test(o))for(var a=/B|STRONG/.test(o),l="EM"===o;n&&Fe(n)&&(!a||/bold|700/i.test(Me(n,"fontWeight")))&&(!l||"italic"===Me(n,"fontStyle"));){if((n.tagName===o||a&&/B|STRONG/.test(n.tagName))&>(n,t)){vt(t);break}n=n.parentNode}var s=t.nextSibling;s&&s.tagName===o&>(s,t)&&(Se(t,s),vt(s))}}}(t)},A.closeDropDown=function(e){s&&(ke(s),s=null),!0===e&&A.focus()},A.wysiwygEditorInsertHtml=function(e,t,n){var o=He(i);A.focus(),!n&&Ce(v,"code")||(m.insertHTML(e,t),m.saveRange(),P(),pt(f),en(f,d),et(n=Ne(f,"#sceditor-end-marker")[0]),e=f.scrollTop,t=ht(n).top+1.5*n.offsetHeight-o,Je(n),(e").replace(/&/g,"&")),A.wysiwygEditorInsertHtml(e)),A},A.getWysiwygEditorValue=function(e){for(var t,n=Ee("div",{},d),o=f.childNodes,r=0;r

    "),P(),k(),S(),D()},A.setSourceEditorValue=function(e){l.value=e,S()},A.updateOriginal=function(){r.value=A.val()},P=function(){var e,l,s,c,t,u,d;I.emoticonsEnabled&&(e=f,l=O,s=I.emoticonsCompat,c=e.ownerDocument,t="(^|\\s| | | | |$)",u=[],d={},Ze(e,"code")||(xe(l,function(e){d[e]=new RegExp(t+bt(e)+t),u.push(e)}),u.sort(function(e,t){return t.length-e.length}),function e(t){for(t=t.firstChild;t;){if(t.nodeType!==we||Oe(t,"code")||e(t),t.nodeType===Te)for(var n=0;n"),e.preventDefault()))},k=function(){st(f,function(e){return e.nodeType!==we||/inline/.test(Me(e,"display"))||Oe(e,".sceditor-nlf")||!ut(e)?!(3===e.nodeType&&!/^\s*$/.test(e.nodeValue)||Oe(e,"br"))&&void 0:((e=Ee("p",{},d)).className="sceditor-nlf",e.innerHTML="
    ",Se(f,e),!1)})},E=function(){A.val(r.value)},te=function(){A.closeDropDown()},A._=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+1]?n[+t+1]:"{"+t+"}"})},oe=function(t){h&&h.call(t.type+"Event",t,A);var e=(t.target===l?"scesrc":"scewys")+t.type;_[e]&&_[e].forEach(function(e){e.call(A,t)})},A.bind=function(e,t,n,o){for(var r,i,a=(e=e.split(" ")).length;a--;)Ke(t)&&(r="scewys"+e[a],i="scesrc"+e[a],n||(_[r]=_[r]||[],_[r].push(t)),o||(_[i]=_[i]||[],_[i].push(t)),"valuechanged"===e[a]&&(S.hasHandler=!0));return A},A.unbind=function(e,t,n,o){for(var r=(e=e.split(" ")).length;r--;)Ke(t)&&(n||Qe(_["scewys"+e[r]]||[],t),o||Qe(_["scesrc"+e[r]]||[],t));return A},A.blur=function(e,t,n){return Ke(e)?A.bind("blur",e,t,n):(A.sourceMode()?l:f).blur(),A},A.focus=function(e,t,n){if(Ke(e))A.bind("focus",e,t,n);else if(A.inSourceMode())l.focus();else{if(Ne(d,":focus").length)return;e=m.selectedRange(),y||ce(!0),e&&1===e.endOffset&&e.collapsed&&(t=e.endContainer)&&1===t.childNodes.length&&Oe(t.firstChild,"br")&&(e.setStartBefore(t.firstChild),e.collapse(!0),m.selectRange(e)),o.focus(),f.focus()}return C(),A},A.keyDown=function(e,t,n){return A.bind("keydown",e,t,n)},A.keyPress=function(e,t,n){return A.bind("keypress",e,t,n)},A.keyUp=function(e,t,n){return A.bind("keyup",e,t,n)},A.nodeChanged=function(e){return A.bind("nodechanged",e,!1,!0)},A.selectionChanged=function(e){return A.bind("selectionchanged",e,!1,!0)},A.valueChanged=function(e,t,n){return A.bind("valuechanged",e,t,n)},ue=function(e){var n=0,o=A.emoticonsCache,t=String.fromCharCode(e.which);Ce(v,"code")||(o||(o=[],xe(O,function(e,t){o[n++]=[e,t]}),o.sort(function(e,t){return e[0].length-t[0].length}),A.emoticonsCache=o,A.longestEmoticonCode=o[o.length-1][0].length),!m.replaceKeyword(A.emoticonsCache,!0,!0,A.longestEmoticonCode,I.emoticonsCompat,t)||I.emoticonsCompat&&/^\s$/.test(t)||e.preventDefault())},de=function(){var e=v,t=m,n=/[^\s\xA0\u2002\u2003\u2009]+/,o=e&&Ne(e,"img[data-sceditor-emoticon]");if(e&&o.length)for(var r=0;r","/":"?","\\":"|","[":"{","]":"}"},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"},r=e.which,i={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:"'"}[r]||String.fromCharCode(r).toLowerCase();(e.ctrlKey||e.metaKey)&&t.push("ctrl"),e.altKey&&t.push("alt"),e.shiftKey&&(t.push("shift"),o[r]?i=o[r]:n[i]&&(i=n[i])),i&&(r<16||18{0}"},i:{tags:{i:null,em:null},styles:{"font-style":["italic","oblique"]},format:"[i]{0}[/i]",html:"{0}"},u:{tags:{u:null},styles:{"text-decoration":["underline"]},format:"[u]{0}[/u]",html:"{0}"},s:{tags:{s:null,strike:null},styles:{"text-decoration":["line-through"]},format:"[s]{0}[/s]",html:"{0}"},sub:{tags:{sub:null},format:"[sub]{0}[/sub]",html:"{0}"},sup:{tags:{sup:null},format:"[sup]{0}[/sup]",html:"{0}"},font:{tags:{font:{face:null}},styles:{"font-family":null},quoteType:x.never,format:function(e,t){var n;return"[font="+l(n=v(e,"font")&&(n=g(e,"face"))?n:f(e,"font-family"))+"]"+t+"[/font]"},html:'{0}'},size:{tags:{font:{size:null}},styles:{"font-size":null},format:function(e,t){var n=g(e,"size"),o=2;return-1<(n=n||f(e,"fontSize")).indexOf("px")?((n=+n.replace("px",""))<12&&(o=1),15{!0}'},color:{tags:{font:{color:null}},styles:{color:null},quoteType:x.never,format:function(e,t){var n;return"[color="+a(n=v(e,"font")&&(n=g(e,"color"))?n:e.style.color||f(e,"color"))+"]"+t+"[/color]"},html:function(e,t,n){return''+n+""}},ul:{tags:{ul:null},breakStart:!0,isInline:!1,skipLastLineBreak:!0,format:"[ul]{0}[/ul]",html:"
      {0}
    "},list:{breakStart:!0,isInline:!1,skipLastLineBreak:!0,html:"
      {0}
    "},ol:{tags:{ol:null},breakStart:!0,isInline:!1,skipLastLineBreak:!0,format:"[ol]{0}[/ol]",html:"
      {0}
    "},li:{tags:{li:null},isInline:!1,closedBy:["/ul","/ol","/list","*","li"],format:"[li]{0}[/li]",html:"
  • {0}
  • "},"*":{isInline:!1,closedBy:["/ul","/ol","/list","*","li"],html:"
  • {0}
  • "},table:{tags:{table:null},isInline:!1,isHtmlInline:!0,skipLastLineBreak:!0,format:"[table]{0}[/table]",html:"{0}
    "},tr:{tags:{tr:null},isInline:!1,skipLastLineBreak:!0,format:"[tr]{0}[/tr]",html:"{0}"},th:{tags:{th:null},allowsEmpty:!0,isInline:!1,format:"[th]{0}[/th]",html:"{0}"},td:{tags:{td:null},allowsEmpty:!0,isInline:!1,format:"[td]{0}[/td]",html:"{0}"},emoticon:{allowsEmpty:!0,tags:{img:{src:null,"data-sceditor-emoticon":null}},format:function(e,t){return g(e,b)+t},html:"{0}"},hr:{tags:{hr:null},allowsEmpty:!0,isSelfClosing:!0,isInline:!1,format:"[hr]{0}",html:"
    "},img:{allowsEmpty:!0,tags:{img:{src:null}},allowedChildren:["#"],quoteType:x.auto,format:function(t,e){function n(e){return t.style?t.style[e]:null}var o,r,i="";return g(t,b)?e:(e=g(t,"width")||n("width"),o=g(t,"height")||n("height"),(r=g(t,"alt")||null)?(e&&(i+=' width="'+e+'"'),o&&(i+=' height="'+o+'"'),i+=' alt="'+r+'"'):(t.complete&&(e||o)||e&&o)&&(i="="+h.width(t)+"x"+h.height(t)),"[img"+i+"]"+g(t,"src")+"[/img]")},html:function(e,t,n){var o,r="",i=t.width,a=t.height,l=t.alt;return t.defaultattr&&(i=(t=t.defaultattr.split(/x/i))[0],a=2===t.length?t[1]:t[0]),i!==o&&(r+=' width="'+d(i,!0)+'"'),a!==o&&(r+=' height="'+d(a,!0)+'"'),l!==o&&(r+=' alt="'+d(l,!0)+'"'),"'}},url:{allowsEmpty:!0,tags:{a:{href:null}},quoteType:x.never,format:function(e,t){e=g(e,"href");return"mailto:"===e.substr(0,7)?'[email="'+e.substr(7)+'"]'+t+"[/email]":"[url="+e+"]"+t+"[/url]"},html:function(e,t,n){return t.defaultattr=d(t.defaultattr,!0)||n,''+n+""}},email:{quoteType:x.never,html:function(e,t,n){return''+n+""}},quote:{tags:{blockquote:null},isInline:!1,quoteType:x.never,format:function(e,t){for(var n,o="data-author",r="",i=e.children,a=0;!n&&a"+(n=t.defaultattr?""+d(t.defaultattr)+""+n:n)+""}},code:{tags:{code:null},isInline:!1,allowedChildren:["#","#newline"],format:"[code]{0}[/code]",html:"{0}"},left:{styles:{"text-align":["left","-webkit-left","-moz-left","-khtml-left"]},isInline:!1,allowsEmpty:!0,format:"[left]{0}[/left]",html:'
    {0}
    '},center:{styles:{"text-align":["center","-webkit-center","-moz-center","-khtml-center"]},isInline:!1,allowsEmpty:!0,format:"[center]{0}[/center]",html:'
    {0}
    '},right:{styles:{"text-align":["right","-webkit-right","-moz-right","-khtml-right"]},isInline:!1,allowsEmpty:!0,format:"[right]{0}[/right]",html:'
    {0}
    '},justify:{styles:{"text-align":["justify","-webkit-justify","-moz-justify","-khtml-justify"]},isInline:!1,allowsEmpty:!0,format:"[justify]{0}[/justify]",html:'
    {0}
    '},youtube:{allowsEmpty:!0,tags:{iframe:{"data-youtube-id":null}},format:function(e,t){return(e=g(e,"data-youtube-id"))?"[youtube]"+e+"[/youtube]":t},html:''},rtl:{styles:{direction:["rtl"]},isInline:!1,format:"[rtl]{0}[/rtl]",html:'
    {0}
    '},ltr:{styles:{direction:["ltr"]},isInline:!1,format:"[ltr]{0}[/ltr]",html:'
    {0}
    '},ignore:{}};function T(e,o){return e.replace(/\{([^}]+)\}/g,function(e,t){var n=!0;return"!"===t.charAt(0)&&(n=!1,t=t.substring(1)),"0"===t&&(n=!1),void 0===o[t]?e:n?d(o[t],!0):o[t]})}function E(e){return"function"==typeof e}function l(e){return e&&e.replace(/\\(.)/g,"$1").replace(/^(["'])(.*?)\1$/,"$2")}var C="open",k="content",S="newline",N="close";function c(e,t,n,o,r,i){var a=this;a.type=e,a.name=t,a.val=n,a.attrs=o||{},a.children=r||[],a.closing=i||null}function D(e){var m=this;function a(e,t){var n,o,r;return e===C&&(n=t.match(/\[([^\]\s=]+)(?:([^\]]+))?\]/))&&(r=i(n[1]),n[2]&&(n[2]=n[2].trim())&&(o=function(e){var t,n=/([^\s=]+)=(?:(?:(["'])((?:\\\2|[^\2])*?)\2)|((?:.(?!\s\S+=))*.))/g,o={};if("="===e.charAt(0)&&e.indexOf("=",1)<0)o.defaultattr=l(e.substr(1));else for("="===e.charAt(0)&&(e="defaultattr"+e);t=n.exec(e);)o[i(t[1])]=l(t[3])||t[4];return o}(n[2]))),e===N&&(n=t.match(/\[\/([^\[\]]+)\]/))&&(r=i(n[1])),(r=e===S?"#newline":r)&&(e!==C&&e!==N||w[r])||(e=k,r="#"),new c(e,r,t,o)}function f(e,t,n){for(var o=n.length;o--;)if(n[o].type===t&&n[o].name===e)return 1}function p(e,t){e=(e?w[e.name]:{}).allowedChildren;return!m.opts.fixInvalidChildren||!e||-1"),E(o.html)?o.html.call(m,n,n.attrs,r):(n.attrs[0]=r,T(o.html,n.attrs))):n.val+r+(n.closing?n.closing.val:"");else{if(n.type===S){if(!t){s+="
    ";continue}a||(s+="
    "),s+="
    ",e.length||(s+="
    "),s+="
    \n",a=!1;continue}i=t,l=d(n.val,!0)}i&&!a?(s+="
    ",a=!0):!i&&a&&(s+="
    \n",a=!1),s+=l}return a&&(s+="\n"),s}function h(e,t,n){var o=/\s|=/.test(e);return E(t)?t(e,n):t===x.never||t===x.auto&&!o?e:'"'+e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')+'"'}function g(e){return e.length?e[e.length-1]:null}function i(e){return e.toLowerCase()}m.opts=n({},D.defaults,e),m.tokenize=function(e){var t,n,o,r=[],i=[{type:k,regex:/^([^\[\r\n]+|\[)/},{type:S,regex:/^(\r\n|\r|\n)/},{type:C,regex:/^\[[^\[\]]+\]/},{type:N,regex:/^\[\/[^\[\]]+\]/}];e:for(;e.length;){for(o=i.length;o--;)if(n=i[o].type,(t=e.match(i[o].regex))&&t[0]){r.push(a(n,t[0])),e=e.substr(t[0].length);continue e}e.length&&r.push(a(k,e)),e=""}return r},m.parse=function(e,t){var e=function(e){function t(){return g(d)}function n(e){(t()?t().children:u).push(e)}function o(e){return t()&&(i=w[t().name])&&i.closedBy&&-1' + document.images[i].alt + ''); + setOuterHTML(document.images[i], '' + document.images[i].alt + ''); } } }; @@ -1274,7 +1274,6 @@ IconList.prototype.openPopup = function(oDiv, iMessageId) { } // Set the position of the container. - // @todo why not make it a child of the existing div let aPos = elk_itemPos(oDiv); this.oContainerDiv.style.top = (aPos[1] + oDiv.offsetHeight) + 'px';