function Qc(){this.Init()}v("AdfEditingAgent",Qc);z.l(Qc);Qc.O=function(){if(Qc.Qi==k)if(F.c.Dg())Qc.Qi=new Sc;else switch(w.b.G()){case w.ed:Qc.Qi=new Sc;break;case w.aa:11<=w.b.nb()?Qc.Qi=new Tc:Qc.Qi=new Uc;break;case w.Fc:Qc.Qi=new Vc;break;default:Qc.Qi=new Qc}return Qc.Qi};v("AdfEditingAgent.getInstance",Qc.O);Qc.prototype.As=ba();z.a("AdfEditingAgent.prototype.toBrowserSpecificCommand",{As:Qc.prototype.As});
Qc.prototype.X_=function(a){B.p(a,"IFRAME");B.assert(a.contentWindow,"Unexpected null contentWindow.");return a.contentWindow};z.a("AdfEditingAgent.prototype.getContentWindow",{X_:Qc.prototype.X_});Qc.prototype.GI=function(a){var b=n,b=a.indexOf&&0===a.indexOf("#")?new TrColorConverter(["#RRGGBB"],p):new TrColorConverter(["'rgb'(r, g, b)","'rgb'(r,g,b)"],p);try{a=b.getAsObject(a)}catch(d){a=n}return a};z.a("AdfEditingAgent.prototype.getColor",{GI:Qc.prototype.GI});
Qc.prototype.Jc=function(a){B.p(a,"IFRAME");a=this.X_(a);B.assert(a,"Unexpected null contentWindow.");B.assert(a.document,"Unexpected null contentWindow document.");return a.document};z.a("AdfEditingAgent.prototype.getInlineFrameDocument",{Jc:Qc.prototype.Jc});
Qc.prototype.execCommand=function(a,b,d,e){var f;"insert"!=d&&(B.p(b,"IFRAME"),f=Qc.O().Jc(b));if(e==n)switch(d){case "createlink":e=Wc(this,a,b);if("popup"===a.getToolbarDisplay()){a=a.k();b=a.d();a=a.ur;d=Qc.O();if(!Xc(a))if(f=Yc(b),H.hc(f))H.setVisible(f,p);else{var g=Zc(b);b=$c(b);g.setValue(d.Fn(a));b.setValue(e);H.setVisible(f,l)}return}g=F.c.u().V("af_richTextEditor.LABEL_SPECIFY_THE_URL");e=prompt(g,e);if(e==n||""==e)return}switch(d){case "insert":e==n&&(e="");this.fm(b,e);break;case "moderichtext":a.k().y1(p);
break;case "modecode":a.k().y1(l);break;case "undo":this.nq(a,b,f);break;case "redo":this.mq(a,b,f);break;case "createlink":this.jz(a,f,e);break;default:bd(this,f,d,e)}};z.a("AdfEditingAgent.prototype.execCommand",{execCommand:Qc.prototype.execCommand});Qc.prototype.kha=function(a){B.p(a,"IFRAME");doc=Qc.O().Jc(a);return doc.getSelection&&""==doc.getSelection()?l:p};z.a("AdfEditingAgent.prototype.isEmptySelection",{kha:Qc.prototype.kha});
Qc.prototype.queryCommandEnabled=function(a,b,d){B.s(d);var e=p;switch(d){case "insert":case "moderichtext":case "modecode":e=l;break;case "undo":e=this.Bq(a,b);break;case "redo":e=this.Aq(a,b);break;default:e=cd(this,b,d)}return e};z.a("AdfEditingAgent.prototype.queryCommandEnabled",{queryCommandEnabled:Qc.prototype.queryCommandEnabled});Qc.prototype.Xy=function(a){B.p(a,"IFRAME");a=this.Jc(a);this.gq()?a.body.contentEditable=l:a.designMode="on";return l};
z.a("AdfEditingAgent.prototype.setInlineFrameContentEditable",{Xy:Qc.prototype.Xy});Qc.prototype.gq=t(p);z.a("AdfEditingAgent.prototype.useContentEditable",{gq:Qc.prototype.gq});Qc.prototype.hm=function(a){a=this.Jc(a);if(this.gq())return a.body.contentEditable==l;(a=a.designMode)&&(a=a.toLowerCase());return"on"==a};z.a("AdfEditingAgent.prototype.isDesignMode",{hm:Qc.prototype.hm});Qc.prototype.xJ=t(p);z.a("AdfEditingAgent.prototype.isDesignModeReloadingFrame",{xJ:Qc.prototype.xJ});
Qc.prototype.queryCommandValue=function(a,b){b=this.As(b);var d=p;try{d=this.Jc(a).queryCommandValue(b)}catch(e){D.i.severe("queryCommandValue: command not supported (",b,").",e)}return d};z.a("AdfEditingAgent.prototype.queryCommandValue",{queryCommandValue:Qc.prototype.queryCommandValue});
Qc.prototype.queryCommandState=function(a,b){B.s(b);if(!("indent"==b||"outdent"==b)){if("forecolor"==b||"backcolor"==b||"fontsize"==b||"fontname"==b)return this.queryCommandValue(a,b);var d=p;b=this.As(b);try{d=this.Jc(a).queryCommandState(b)}catch(e){D.i.severe("queryCommandState: command not supported (",b,").",e)}return d}};z.a("AdfEditingAgent.prototype.queryCommandState",{queryCommandState:Qc.prototype.queryCommandState});
Qc.prototype.Cia=function(a){B.assert(a);a=a.body;B.p(a,"BODY");a.setAttribute("dir",F.c.Ma().Oa()?"rtl":"ltr")};z.a("AdfEditingAgent.prototype.setRTL",{Cia:Qc.prototype.Cia});Qc.prototype.Tp=function(a,b){b=this.As(b);var d=p;try{d=this.Jc(a).queryCommandIndeterm(b)}catch(e){D.i.severe("queryCommandIndeterminate: command not supported (",b,").",e)}return d};z.a("AdfEditingAgent.prototype.queryCommandIndeterminate",{Tp:Qc.prototype.Tp});Qc.prototype.Ap=ba();
z.a("AdfEditingAgent.prototype.getFocusBlurElement",{Ap:Qc.prototype.Ap});Qc.prototype.jf=function(a){return this.Jc(a).selection.createRange()};z.a("AdfEditingAgent.prototype.getSelectionRange",{jf:Qc.prototype.jf});Qc.prototype.An=function(a){return this.Jc(a).body.innerHTML};z.a("AdfEditingAgent.prototype.getInlineFrameContent",{An:Qc.prototype.An});Qc.prototype.jS=function(a,b){this.Jc(a).body.innerHTML=b};z.a("AdfEditingAgent.prototype.setInlineFrameContent",{jS:Qc.prototype.jS});
Qc.prototype.xn=t("");z.a("AdfEditingAgent.prototype.getDefaultContent",{xn:Qc.prototype.xn});Qc.prototype.setSelectionRange=function(a,b){b.select()};z.a("AdfEditingAgent.prototype.setSelectionRange",{setSelectionRange:Qc.prototype.setSelectionRange});
Qc.prototype.fm=function(a,b){if("TEXTAREA"==a.nodeName||"INPUT"==a.nodeName){var d=a.selectionStart+b.length;a.value=a.value.substr(0,a.selectionStart)+b+a.value.substr(a.selectionEnd);a.selectionStart=d;a.selectionEnd=d}else if(d=this.jf(a),d==n)D.i.severe("Unexpected null selection for insert command.");else{0<d.toString().length&&d.deleteContents();d.cloneRange();var e=document.createElement("div");e.innerHTML=b;for(var e=e.childNodes,f=n,g=e.length-1;0<=g;g--){var h=e[g];f==n&&(f=h);d.insertNode(h)}f!=
n&&(d.selectNode(f),d.setStartAfter(f))}};z.a("AdfEditingAgent.prototype.insertHtmlAtSelection",{fm:Qc.prototype.fm});Qc.prototype.Hn=ca();z.a("AdfEditingAgent.prototype.handleTab",{Hn:Qc.prototype.Hn});Qc.prototype.Cs=ca();z.a("AdfEditingAgent.prototype.updateValueHistory",{Cs:Qc.prototype.Cs});Qc.prototype.nq=function(a,b,d){bd(this,d,"undo",n)};z.a("AdfEditingAgent.prototype.ExecuteUndo",{nq:Qc.prototype.nq});Qc.prototype.mq=function(a,b,d){bd(this,d,"redo",n)};
z.a("AdfEditingAgent.prototype.ExecuteRedo",{mq:Qc.prototype.mq});Qc.prototype.jz=function(a,b,d){bd(this,b,"createlink",d)};z.a("AdfEditingAgent.prototype.CreateLink",{jz:Qc.prototype.jz});Qc.prototype.Bq=function(a,b){return cd(this,b,"undo")};z.a("AdfEditingAgent.prototype.QueryUndoEnabled",{Bq:Qc.prototype.Bq});Qc.prototype.Aq=function(a,b){return cd(this,b,"redo")};z.a("AdfEditingAgent.prototype.QueryRedoEnabled",{Aq:Qc.prototype.Aq});
Qc.prototype.wq=function(a,b){var d=b.ownerDocument.createRange();try{d.selectNode(b)}catch(e){return D.i.zf(e,"Unable to select node in range"),p}var f=-1!=a.compareBoundaryPoints(Range.START_TO_START,d),d=1!=a.compareBoundaryPoints(Range.END_TO_END,d);return f&&d};z.a("AdfEditingAgent.prototype.IsNodeWrappingRange",{wq:Qc.prototype.wq});function bd(a,b,d,e){a=a.As(d);try{b.execCommand(a,n,e)}catch(f){D.i.severe("execCommand[",d,",",e,"] failed with the following exception: ",f)}}
function cd(a,b,d){var e=p;b=a.Jc(b);d=a.As(d);try{e=b.queryCommandEnabled(d)}catch(f){D.i.severe("queryCommandEnabled failed with the following exception: [",d,"]: ",f)}return e}function Wc(a,b,d){B.p(d,"IFRAME");d=a.Jc(d).getElementsByTagName("a");b=b.k().jf(b);for(var e="about:blank",f=0;f<d.length;f++)if(a.wq(b,d[f])){e=d[f].href;break}return e}Qc.prototype.Fn=function(a){return a?a.toString():""};z.a("AdfEditingAgent.prototype.getSelectionRangeString",{Fn:Qc.prototype.Fn});