//>>built define("dojo/_base/array dojo/_base/config dojo/_base/declare dojo/_base/Deferred dojo/dom dojo/dom-attr dojo/dom-class dojo/dom-construct dojo/dom-geometry dojo/dom-style dojo/_base/kernel dojo/keys dojo/_base/lang dojo/on dojo/query dojo/domReady dojo/sniff dojo/string dojo/topic dojo/_base/unload dojo/_base/url dojo/window ../_Widget ../_CssStateMixin ../selection ./range ./html ../focus ../main".split(" "),function(q,G,L,H,A,B,I,m,M,w,x,r,k,v,C,N,d,D,J,O,E,F,P,Q,R,t,y,K,z){var p=L("dijit._editor.RichText", [P,Q],{constructor:function(a){this.contentPreFilters=[];this.contentPostFilters=[];this.contentDomPreFilters=[];this.contentDomPostFilters=[];this.editingAreaStyleSheets=[];this.events=[].concat(this.events);this._keyHandlers={};a&&k.isString(a.value)&&(this.value=a.value);this.onLoadDeferred=new H},baseClass:"dijitEditor",inheritWidth:!1,focusOnLoad:!1,name:"",styleSheets:"",height:"300px",minHeight:"1em",isClosed:!0,isLoaded:!1,_SEPARATOR:"@@**%%__RICHTEXTBOUNDRY__%%**@@",_NAME_CONTENT_SEP:"@@**%%:%%**@@", onLoadDeferred:null,isTabIndent:!1,disableSpellCheck:!1,postCreate:function(){"textarea"===this.domNode.tagName.toLowerCase()&&console.warn("RichText should not be used with the TEXTAREA tag. See dijit._editor.RichText docs.");this.contentPreFilters=[k.trim,k.hitch(this,"_preFixUrlAttributes")].concat(this.contentPreFilters);d("mozilla")&&(this.contentPreFilters=[this._normalizeFontStyle].concat(this.contentPreFilters),this.contentPostFilters=[this._removeMozBogus].concat(this.contentPostFilters)); d("webkit")&&(this.contentPreFilters=[this._removeWebkitBogus].concat(this.contentPreFilters),this.contentPostFilters=[this._removeWebkitBogus].concat(this.contentPostFilters));if(d("ie")||d("trident"))this.contentPostFilters=[this._normalizeFontStyle].concat(this.contentPostFilters),this.contentDomPostFilters=[k.hitch(this,"_stripBreakerNodes")].concat(this.contentDomPostFilters);this.contentDomPostFilters=[k.hitch(this,"_stripTrailingEmptyNodes")].concat(this.contentDomPostFilters);this.inherited(arguments); J.publish(z._scopeName+"._editor.RichText::init",this)},startup:function(){this.inherited(arguments);this.open();this.setupDefaultShortcuts()},setupDefaultShortcuts:function(){var a=k.hitch(this,function(a,b){return function(){return!this.execCommand(a,b)}}),b={b:a("bold"),i:a("italic"),u:a("underline"),a:a("selectall"),s:function(){this.save(!0)},m:function(){this.isTabIndent=!this.isTabIndent},1:a("formatblock","h1"),2:a("formatblock","h2"),3:a("formatblock","h3"),4:a("formatblock","h4"),"\\":a("insertunorderedlist")}; d("ie")||(b.Z=a("redo"));for(var c in b)this.addKeyHandler(c,!0,!1,b[c])},events:["onKeyDown","onKeyUp"],captureEvents:[],_editorCommandsLocalized:!1,_localizeEditorCommands:function(){if(p._editorCommandsLocalized)this._local2NativeFormatNames=p._local2NativeFormatNames,this._native2LocalFormatNames=p._native2LocalFormatNames;else{p._editorCommandsLocalized=!0;p._local2NativeFormatNames={};p._native2LocalFormatNames={};this._local2NativeFormatNames=p._local2NativeFormatNames;this._native2LocalFormatNames= p._native2LocalFormatNames;for(var a="div p pre h1 h2 h3 h4 h5 h6 ol ul address".split(" "),b="",c,f=0;c=a[f++];)b="l"!==c.charAt(1)?b+("\x3c"+c+"\x3e\x3cspan\x3econtent\x3c/span\x3e\x3c/"+c+"\x3e\x3cbr/\x3e"):b+("\x3c"+c+"\x3e\x3cli\x3econtent\x3c/li\x3e\x3c/"+c+"\x3e\x3cbr/\x3e");var e=m.create("div",{style:{position:"absolute",top:"0px",zIndex:10,opacity:.01},innerHTML:b});this.ownerDocumentBody.appendChild(e);a=k.hitch(this,function(){for(var a=e.firstChild;a;)try{this.selection.selectElement(a.firstChild); var b=a.tagName.toLowerCase();this._local2NativeFormatNames[b]=document.queryCommandValue("formatblock");this._native2LocalFormatNames[this._local2NativeFormatNames[b]]=b;a=a.nextSibling.nextSibling}catch(h){}m.destroy(e)});this.defer(a)}},open:function(a){if(!this.onLoadDeferred||0<=this.onLoadDeferred.fired)this.onLoadDeferred=new H;this.isClosed||this.close();J.publish(z._scopeName+"._editor.RichText::open",this);1===arguments.length&&a.nodeName&&(this.domNode=a);var b=this.domNode,c;if(k.isString(this.value))c= this.value,b.innerHTML="";else if(b.nodeName&&"textarea"==b.nodeName.toLowerCase()){var f=this.textarea=b;this.name=f.name;c=f.value;b=this.domNode=this.ownerDocument.createElement("div");b.setAttribute("widgetId",this.id);f.removeAttribute("widgetId");b.cssText=f.cssText;b.className+=" "+f.className;m.place(b,f,"before");var e=k.hitch(this,function(){w.set(f,{display:"block",position:"absolute",top:"-1000px"});if(d("ie")){var a=f.style;this.__overflow=a.overflow;a.overflow="hidden"}});d("ie")?this.defer(e, 10):e();if(f.form){var u=f.value;this.reset=function(){this.getValue()!==u&&this.replaceValue(u)};v(f.form,"submit",k.hitch(this,function(){B.set(f,"disabled",this.disabled);f.value=this.getValue()}))}}else c=y.getChildrenHtml(b),b.innerHTML="";this.value=c;b.nodeName&&"LI"===b.nodeName&&(b.innerHTML=" \x3cbr\x3e");this.header=b.ownerDocument.createElement("div");b.appendChild(this.header);this.editingArea=b.ownerDocument.createElement("div");b.appendChild(this.editingArea);this.footer=b.ownerDocument.createElement("div"); b.appendChild(this.footer);this.name||(this.name=this.id+"_AUTOGEN");if(""!==this.name&&(!G.useXDomain||G.allowXdRichTextSave)){if((c=A.byId(z._scopeName+"._editor.RichText.value"))&&""!==c.value)for(var e=c.value.split(this._SEPARATOR),g=0,h;h=e[g++];)if(h=h.split(this._NAME_CONTENT_SEP),h[0]===this.name){this.value=h[1];e=e.splice(g,1);c.value=e.join(this._SEPARATOR);break}p._globalSaveHandler||(p._globalSaveHandler={},O.addOnUnload(function(){for(var a in p._globalSaveHandler){var b=p._globalSaveHandler[a]; k.isFunction(b)&&b()}}));p._globalSaveHandler[this.id]=k.hitch(this,"_saveContent")}this.isClosed=!1;c=this.editorObject=this.iframe=this.ownerDocument.createElement("iframe");c.id=this.id+"_iframe";c.style.border="none";c.style.width="100%";this._layoutMode?c.style.height="100%":7<=d("ie")?(this.height&&(c.style.height=this.height),this.minHeight&&(c.style.minHeight=this.minHeight)):c.style.height=this.height?this.height:this.minHeight;c.frameBorder=0;c._loadFunc=k.hitch(this,function(a){this.window= a;this.document=a.document;this.selection=new R.SelectionManager(a);d("ie")&&this._localizeEditorCommands();this.onLoad(this.get("value"))});e=this._getIframeDocTxt().replace(/\\/g,"\\\\").replace(/'/g,"\\'");e=11>d("ie")?'javascript:document.open();try{parent.window;}catch(e){document.domain\x3d"'+document.domain+"\";}document.write('"+e+"');document.close()":"javascript: '"+e+"'";this.editingArea.appendChild(c);c.src=e;"LI"===b.nodeName&&(b.lastChild.style.marginTop="-1.2em");I.add(this.domNode, this.baseClass)},_local2NativeFormatNames:{},_native2LocalFormatNames:{},_getIframeDocTxt:function(){var a=w.getComputedStyle(this.domNode),b;if(this["aria-label"])b=this["aria-label"];else{var c=C('label[for\x3d"'+this.id+'"]',this.ownerDocument)[0]||A.byId(this["aria-labelledby"],this.ownerDocument);c&&(b=c.textContent||c.innerHTML||"")}var c="\x3cdiv id\x3d'dijitEditorBody' role\x3d'textbox' aria-multiline\x3d'true' "+(b?" aria-label\x3d'"+D.escape(b)+"'":"")+"\x3e\x3c/div\x3e",f=[a.fontWeight, a.fontSize,a.fontFamily].join(" "),e=a.lineHeight,e=0<=e.indexOf("px")?parseFloat(e)/parseFloat(a.fontSize):0<=e.indexOf("em")?parseFloat(e):"normal",u="",g=this;this.style.replace(/(^|;)\s*(line-|font-?)[^;]+/ig,function(a){a=a.replace(/^;/ig,"")+";";var b=a.split(":")[0];if(b){var b=k.trim(b),b=b.toLowerCase(),c,e="";for(c=0;cd("ie")&&a.keyCode===r.BACKSPACE&&"Control"===this.document.selection.type&& (a.stopPropagation(),a.preventDefault(),this.execCommand("delete"));d("ff")&&(a.keyCode===r.PAGE_UP||a.keyCode===r.PAGE_DOWN)&&this.editNode.clientHeight>=this.editNode.scrollHeight&&a.preventDefault();var b=this._keyHandlers[a.keyCode],c=arguments;b&&!a.altKey&&q.some(b,function(b){if(!(b.shift^a.shiftKey||b.ctrl^(a.ctrlKey||a.metaKey)))return b.handler.apply(this,c)||a.preventDefault(),!0},this);this.defer("onKeyPressed",1);return!0},onKeyUp:function(){},setDisabled:function(a){x.deprecated("dijit.Editor::setDisabled is deprecated", 'use dijit.Editor::attr("disabled",boolean) instead',2);this.set("disabled",a)},_setValueAttr:function(a){this.setValue(a)},_setDisableSpellCheckAttr:function(a){this.document?B.set(this.document.body,"spellcheck",!a):this.onLoadDeferred.then(k.hitch(this,function(){B.set(this.document.body,"spellcheck",!a)}));this._set("disableSpellCheck",a)},addKeyHandler:function(a,b,c,f){"string"==typeof a&&(a=a.toUpperCase().charCodeAt(0));k.isArray(this._keyHandlers[a])||(this._keyHandlers[a]=[]);this._keyHandlers[a].push({shift:c|| !1,ctrl:b||!1,handler:f})},onKeyPressed:function(){this.onDisplayChanged()},onClick:function(a){this.onDisplayChanged(a)},_onIEMouseDown:function(){this.focused||this.disabled||this.focus()},_onBlur:function(a){(d("ie")||d("trident"))&&this.defer(function(){K.curNode||this.ownerDocumentBody.focus()});this.inherited(arguments);var b=this.getValue(!0);if(b!==this.value)this.onChange(b);this._set("value",b)},_onFocus:function(a){this.disabled||(this._disabledOK||this.set("disabled",!1),this.inherited(arguments))}, blur:function(){!d("ie")&&this.window.document.documentElement&&this.window.document.documentElement.focus?this.window.document.documentElement.focus():this.ownerDocumentBody.focus&&this.ownerDocumentBody.focus()},focus:function(){this.isLoaded?9>d("ie")?this.iframe.fireEvent("onfocus",document.createEventObject()):this.editNode.focus():this.focusOnLoad=!0},updateInterval:200,_updateTimer:null,onDisplayChanged:function(){this._updateTimer&&this._updateTimer.remove();this._updateTimer=this.defer("onNormalizedDisplayChanged", this.updateInterval)},onNormalizedDisplayChanged:function(){delete this._updateTimer},onChange:function(){},_normalizeCommand:function(a,b){a=a.toLowerCase();"formatblock"===a?d("safari")&&void 0===b&&(a="heading"):"hilitecolor"!==a||d("mozilla")||(a="backcolor");return a},_implCommand:function(a){return"_"+this._normalizeCommand(a)+"EnabledImpl"},_qcaCache:{},queryCommandAvailable:function(a){var b=this._qcaCache[a];return void 0!==b?b:this._qcaCache[a]=this._queryCommandAvailable(a)},_queryCommandAvailable:function(a){switch(a.toLowerCase()){case "bold":case "italic":case "underline":case "subscript":case "superscript":case "fontname":case "fontsize":case "forecolor":case "hilitecolor":case "justifycenter":case "justifyfull":case "justifyleft":case "justifyright":case "delete":case "selectall":case "toggledir":case "createlink":case "unlink":case "removeformat":case "inserthorizontalrule":case "insertimage":case "insertorderedlist":case "insertunorderedlist":case "indent":case "outdent":case "formatblock":case "inserthtml":case "undo":case "redo":case "strikethrough":case "tabindent":case "cut":case "copy":case "paste":return!0; case "blockdirltr":case "blockdirrtl":case "dirltr":case "dirrtl":case "inlinedirltr":case "inlinedirrtl":return d("ie")||d("trident")||d("edge");case "inserttable":case "insertcell":case "insertcol":case "insertrow":case "deletecells":case "deletecols":case "deleterows":case "mergecells":case "splitcell":return!d("webkit");default:return!1}},execCommand:function(a,b){var c;this.focused&&this.focus();a=this._normalizeCommand(a,b);if(void 0!==b){if("heading"===a)throw Error("unimplemented");"formatblock"=== a&&(d("ie")||d("trident"))&&(b="\x3c"+b+"\x3e")}var f="_"+a+"Impl";if(this[f])c=this[f](b);else if((b=1/gm,"\x26gt;").replace(/"/gm,"\x26quot;");b||(a=a.replace(/'/gm,"\x26#39;"));return a},getNodeHtml:function(a){x.deprecated("dijit.Editor::getNodeHtml is deprecated","use dijit/_editor/html::getNodeHtml instead", 2);return y.getNodeHtml(a)},getNodeChildrenHtml:function(a){x.deprecated("dijit.Editor::getNodeChildrenHtml is deprecated","use dijit/_editor/html::getChildrenHtml instead",2);return y.getChildrenHtml(a)},close:function(a){if(!this.isClosed){arguments.length||(a=!0);a&&this._set("value",this.getValue(!0));this.interval&&clearInterval(this.interval);this._webkitListener&&(this._webkitListener.remove(),delete this._webkitListener);d("ie")&&(this.iframe.onfocus=null);this.iframe._loadFunc=null;this._iframeRegHandle&& (this._iframeRegHandle.remove(),delete this._iframeRegHandle);if(this.textarea){var b=this.textarea.style;b.position="";b.left=b.top="";d("ie")&&(b.overflow=this.__overflow,this.__overflow=null);this.textarea.value=this.value;m.destroy(this.domNode);this.domNode=this.textarea}else this.domNode.innerHTML=this.value;delete this.iframe;I.remove(this.domNode,this.baseClass);this.isClosed=!0;this.isLoaded=!1;delete this.editNode;delete this.focusNode;this.window&&this.window._frameElement&&(this.window._frameElement= null);this.editorObject=this.editingArea=this.document=this.window=null}},destroy:function(){this.isClosed||this.close(!1);this._updateTimer&&this._updateTimer.remove();this.inherited(arguments);p._globalSaveHandler&&delete p._globalSaveHandler[this.id]},_removeMozBogus:function(a){return a.replace(/\stype="_moz"/gi,"").replace(/\s_moz_dirty=""/gi,"").replace(/_moz_resizing="(true|false)"/gi,"")},_removeWebkitBogus:function(a){a=a.replace(/\sclass="webkit-block-placeholder"/gi,"");a=a.replace(/\sclass="apple-style-span"/gi, "");return a=a.replace(//gi,"")},_normalizeFontStyle:function(a){return a.replace(/<(\/)?strong([ \>])/gi,"\x3c$1b$2").replace(/<(\/)?em([ \>])/gi,"\x3c$1i$2")},_preFixUrlAttributes:function(a){return a.replace(/(?:(]+))/gi,"$1$4$2$3$5$2 _djrealurl\x3d$2$3$5$2").replace(/(?:(]+))/gi,"$1$4$2$3$5$2 _djrealurl\x3d$2$3$5$2")},_browserQueryCommandEnabled:function(a){if(!a)return!1; if(d("ie")||d("trident")||d("edge"))return this.focused&&!this.disabled;var b=9>d("ie")?this.document.selection.createRange():this.document;try{return b.queryCommandEnabled(a)}catch(c){return!1}},_createlinkEnabledImpl:function(){var a=!0;return a=d("opera")?this.window.getSelection().isCollapsed?!0:this.document.queryCommandEnabled("createlink"):this._browserQueryCommandEnabled("createlink")},_unlinkEnabledImpl:function(){var a=!0;return a=d("mozilla")||d("webkit")||d("ie")||d("trident")||d("edge")? this.selection.hasAncestorElement("a"):this._browserQueryCommandEnabled("unlink")},_inserttableEnabledImpl:function(){var a=!0;return a=d("mozilla")||d("webkit")?!0:this._browserQueryCommandEnabled("inserttable")},_cutEnabledImpl:function(){var a=!0;d("webkit")?((a=this.window.getSelection())&&(a=a.toString()),a=!!a):a=this._browserQueryCommandEnabled("cut");return a},_copyEnabledImpl:function(){var a=!0;d("webkit")?((a=this.window.getSelection())&&(a=a.toString()),a=!!a):a=this._browserQueryCommandEnabled("copy"); return a},_pasteEnabledImpl:function(){var a=!0;return d("webkit")?!0:a=this._browserQueryCommandEnabled("paste")},_inserthorizontalruleImpl:function(a){return d("ie")?this._inserthtmlImpl("\x3chr\x3e"):this.document.execCommand("inserthorizontalrule",!1,a)},_unlinkImpl:function(a){return this.queryCommandEnabled("unlink")&&(d("mozilla")||d("webkit"))?(a=this.selection.getAncestorElement("a"),this.selection.selectElement(a),this.document.execCommand("unlink",!1,null)):this.document.execCommand("unlink", !1,a)},_hilitecolorImpl:function(a){var b;this._handleTextColorOrProperties("hilitecolor",a)||(d("mozilla")?(this.document.execCommand("styleWithCSS",!1,!0),console.log("Executing color command."),b=this.document.execCommand("hilitecolor",!1,a),this.document.execCommand("styleWithCSS",!1,!1)):b=this.document.execCommand("hilitecolor",!1,a));return b},_backcolorImpl:function(a){d("ie")&&(a=a?a:null);var b=this._handleTextColorOrProperties("backcolor",a);b||(b=this.document.execCommand("backcolor", !1,a));return b},_forecolorImpl:function(a){d("ie")&&(a=a?a:null);var b=!1;(b=this._handleTextColorOrProperties("forecolor",a))||(b=this.document.execCommand("forecolor",!1,a));return b},_inserthtmlImpl:function(a){a=this._preFilterContent(a);var b=!0;if(9>d("ie")){var c=this.document.selection.createRange();if("CONTROL"===this.document.selection.type.toUpperCase()){for(var f=c.item(0);c.length;)c.remove(c.item(0));f.outerHTML=a}else c.pasteHTML(a);c.select()}else if(8>d("trident")){var e=t.getSelection(this.window); if(e&&e.rangeCount&&e.getRangeAt){c=e.getRangeAt(0);c.deleteContents();var u=m.create("div");u.innerHTML=a;for(var g,f=this.document.createDocumentFragment();a=u.firstChild;)g=f.appendChild(a);c.insertNode(f);g&&(c=c.cloneRange(),c.setStartAfter(g),c.collapse(!1),e.removeAllRanges(),e.addRange(c))}}else d("mozilla")&&!a.length?this.selection.remove():b=this.document.execCommand("inserthtml",!1,a);return b},_boldImpl:function(a){var b=!1;if(d("ie")||d("trident"))this._adaptIESelection(),b=this._adaptIEFormatAreaAndExec("bold"); b||(b=this.document.execCommand("bold",!1,a));return b},_italicImpl:function(a){var b=!1;if(d("ie")||d("trident"))this._adaptIESelection(),b=this._adaptIEFormatAreaAndExec("italic");b||(b=this.document.execCommand("italic",!1,a));return b},_underlineImpl:function(a){var b=!1;if(d("ie")||d("trident"))this._adaptIESelection(),b=this._adaptIEFormatAreaAndExec("underline");b||(b=this.document.execCommand("underline",!1,a));return b},_strikethroughImpl:function(a){var b=!1;if(d("ie")||d("trident"))this._adaptIESelection(), b=this._adaptIEFormatAreaAndExec("strikethrough");b||(b=this.document.execCommand("strikethrough",!1,a));return b},_superscriptImpl:function(a){var b=!1;if(d("ie")||d("trident"))this._adaptIESelection(),b=this._adaptIEFormatAreaAndExec("superscript");b||(b=this.document.execCommand("superscript",!1,a));return b},_subscriptImpl:function(a){var b=!1;if(d("ie")||d("trident"))this._adaptIESelection(),b=this._adaptIEFormatAreaAndExec("subscript");b||(b=this.document.execCommand("subscript",!1,a));return b}, _fontnameImpl:function(a){var b;if(d("ie")||d("trident"))b=this._handleTextColorOrProperties("fontname",a);b||(b=this.document.execCommand("fontname",!1,a));return b},_fontsizeImpl:function(a){var b;if(d("ie")||d("trident"))b=this._handleTextColorOrProperties("fontsize",a);b||(b=this.document.execCommand("fontsize",!1,a));return b},_insertorderedlistImpl:function(a){var b=!1;if(d("ie")||d("trident")||d("edge"))b=this._adaptIEList("insertorderedlist",a);b||(b=this.document.execCommand("insertorderedlist", !1,a));return b},_insertunorderedlistImpl:function(a){var b=!1;if(d("ie")||d("trident")||d("edge"))b=this._adaptIEList("insertunorderedlist",a);b||(b=this.document.execCommand("insertunorderedlist",!1,a));return b},getHeaderHeight:function(){return this._getNodeChildrenHeight(this.header)},getFooterHeight:function(){return this._getNodeChildrenHeight(this.footer)},_getNodeChildrenHeight:function(a){var b=0;if(a&&a.childNodes){var c;for(c=0;c=c.length&&c.nextSibling;)f-=c.length,c=c.nextSibling;for(var e=null;this._isNodeEmpty(c,f)&&c!==e;)e=c,b=this._removeStartingRangeFromRange(c,b),c=b.startContainer,f=0;a.removeAllRanges();a.addRange(b)}},_adaptIEFormatAreaAndExec:function(a){var b=t.getSelection(this.window),c=this.document,f,e,d,g,h,l,n;if(a&&b&&b.isCollapsed){if(this.queryCommandValue(a)){a=this._tagNamesForCommand(a);d=b.getRangeAt(0);g=d.startContainer;3===g.nodeType&&(e=d.endOffset,g.length< e&&(e=this._adjustNodeAndOffset(f,e),g=e.node,e=e.offset));for(;g&&g!==this.editNode;){f=g.tagName?g.tagName.toLowerCase():"";if(-1