var bj=I.ea(I,"AdfDhtmlDocumentPeer",!1);m("AdfDhtmlDocumentPeer",bj);bj.C=function(){I.ra(this,ha.Nd,ha.Pc,Za.ua,D.wb,D.Ad,ha.Qm,ph.JR);I.sb(this,AdfRichDocument.SHORT_DESC,AdfRichDocument.TITLE);this.$0a="iconC";this.OCa="msgDlg";this.s2a="msgCtr";this.F1="liveCtr";this.M5a="skip";this.L1="p_AFInactive";this.a1="afr::UtilPopupCtnr";this.Mza="data-afr-pid";this.Dda="data-afr-did";this.G_a="contentContainer";this.F_a="cancel"};m("AdfDhtmlDocumentPeer.InitSubclass",bj.C);
bj.prototype.Init=function(a){A.c.TUa(a.g());bj.h.Init.call(this,a)};r.a("AdfDhtmlDocumentPeer.prototype.Init",{Init:bj.prototype.Init});bj.prototype.Cz=function(a,b,d){u.ae(d);document.body.title=d;return!0};r.a("AdfDhtmlDocumentPeer.prototype.ComponentShortDescChanged",{Cz:bj.prototype.Cz});bj.prototype.SQ=function(a,b,d){u.ae(d);document.title=d;return!0};r.a("AdfDhtmlDocumentPeer.prototype.ComponentTitleChanged",{SQ:bj.prototype.SQ});
bj.prototype.NP=function(){var a=A.c,b=a.pm(),d=this.f().g(),b=b[d],d=yo(),e=!1;null!=d&&(e=d.getGlobalOnly());return L.o$(a,b,e)};r.a("AdfDhtmlDocumentPeer.prototype.isMessagesDialogShowable",{NP:bj.prototype.NP});bj.prototype.vy=function(){var a=this.f().g();return"old"==A.c.H().qa("af|dialog-tr-button-type")?I.j(a,bj.OCa):a+"_"+bj.OCa};r.a("AdfDhtmlDocumentPeer.prototype.getMessageDialogId",{vy:bj.prototype.vy});
bj.prototype.xZ=function(){var a=this.vy(),a=q.b.getElementById(a),b=zo(this);return a&&a.parentNode.id==b};r.a("AdfDhtmlDocumentPeer.prototype.isMessagesInline",{xZ:bj.prototype.xZ});bj.prototype.ZC=function(a){a?this.OC():(a=this.f(),this.Jb(a))};r.a("AdfDhtmlDocumentPeer.prototype.setMessagesDialogShown",{ZC:bj.prototype.ZC});bj.prototype.Ta=function(a){if(a.Wd()==Qa.Ef){var b=Ao(this.f());a.X()==b&&(b.style.top="0px")}};r.a("AdfDhtmlDocumentPeer.prototype.HandleComponentFocus",{Ta:bj.prototype.Ta});
bj.prototype.Lb=function(a){if(a.Wd()==Qa.Ef){var b=Ao(this.f());a.X()==b&&(b.style.top="")}};r.a("AdfDhtmlDocumentPeer.prototype.HandleComponentBlur",{Lb:bj.prototype.Lb});bj.prototype.M=function(a){if(a.Wd()==Qa.Ef){var b=Ao(this.f());a.X()==b&&(b=bj.TKa(this.f()),b=q.b.getElementById(b),u.u(b),b=C.x9(b,null,!1,bj.kib),u.u(b),b&&(J.Em(b)||(b.tabIndex=-1),J.va(b)),a.cancel())}};r.a("AdfDhtmlDocumentPeer.prototype.HandleComponentClick",{M:bj.prototype.M});bj.prototype.Kz=function(a){bj.Dtb||C.EVa(a)};
r.a("AdfDhtmlDocumentPeer.prototype.HandleComponentContextMenu",{Kz:bj.prototype.Kz});bj.prototype.za=function(a){if(!a.Aa()&&A.c.wm()==this.f().g()){var b=a.na();a.ctrlKey&&a.altKey?79==b&&(this.ZC(!1),a.cancel()):a.ctrlKey&&a.shiftKey&&87==b&&(this.ZC(!0),a.cancel())}if(!a.Aa()){var d=a.U(),b=a.na();d.ctrlKey&&d.altKey&&87==b&&Si.$().CY(a.X())}};r.a("AdfDhtmlDocumentPeer.prototype.HandleComponentKeyUp",{za:bj.prototype.za});
bj.prototype.eg=function(a){var b=a.getSource().g(),d=this.f().g(),e=this.vy();if(b==e&&(b=a.ll(),a.cancel(),this.Jb(this.f()),b==Za.Zm&&(a=A.c,b=yo(),e=!1,null!=b&&(e=b.getGlobalOnly()),!e))){var f;a=a.pm();for(var g in a)if(g!=d&&(b=a[g],null!=b&&null!=b.s8)){f=g;break}null!=f&&L.FZ(f)}};r.a("AdfDhtmlDocumentPeer.prototype.HandleComponentDialog",{eg:bj.prototype.eg});bj.prototype.bya=function(a){var b=a.Nsa();A.c.FRa(b,a.fsa())};r.a("AdfDhtmlDocumentPeer.prototype.HandleComponentRedirect",{bya:bj.prototype.bya});
bj.prototype.ob=function(a,b){bj.h.ob.call(this,a,b);C.O(b,I.IJ);C.O(b,bj.L1);var d=zo(this);(d=q.b.getElementById(d))&&d.appendChild(b)};r.a("AdfDhtmlDocumentPeer.prototype.PopupClosed",{ob:bj.prototype.ob});
bj.prototype.G=function(a,b){var d=A.c;bj.h.G.call(this,a,b);var e=new ha(a,"load");d.Jla?e.F():(e=e.D(e.F),d.eVa(e));a.getInitialFocusId()&&(this.yGa=this.D(this.f9a),this.WJa=window.setTimeout(this.yGa,50));this.aLa=0;d=!1;e=bj.TKa(a);e?null==q.b.getElementById(e)&&(d=!0,v.l.warning("Unable to locate skip link target: "+e+".  Make sure that af:skipLinkTarget is contained within a parent that generates content (and an id).")):d=!0;d&&(d=Ao(a))&&(d.style.display="none");(d=a.getTitle())&&this.R().title!=
d&&(d=this.D(this.bcb),setTimeout(d,0));this.Noa(a)};r.a("AdfDhtmlDocumentPeer.prototype.InitDomElement",{G:bj.prototype.G});bj.prototype.Zb=function(a,b){var d=this.f().g(),d=I.j(d,bj.$0a);if(a.id==d)for(var d=q.b,e=a.firstChild;e;){var f=e.nextSibling;if(1==e.nodeType){var g=e.id;g&&!d.getElementById(g)&&(b.appendChild(e),d.Ia(e))}e=f}else bj.h.Zb.call(this,a,b)};r.a("AdfDhtmlDocumentPeer.prototype.ReplaceDomElement",{Zb:bj.prototype.Zb});bj.prototype.Ym=function(a,b){this.xW(a,b,!0)};
r.a("AdfDhtmlDocumentPeer.prototype.MessageShow",{Ym:bj.prototype.Ym});bj.prototype.vi=function(a,b){this.xW(a,b,!1)};r.a("AdfDhtmlDocumentPeer.prototype.MessageNotify",{vi:bj.prototype.vi});
bj.prototype.xW=function(a,b,d){var e=A.c,f=yo(),g=!1;null!=f&&(g=f.getGlobalOnly());var h=this.f(),l=h.g(),n=e.pm(),t=n[l];b=0;null!=t&&(b=t.length);if(!d&&!L.qs(e,b,g))L.LJ();else if(d&&!L.o$(e,t,g))for(l in L.LJ(),n)h=n[l],null!=h&&null!=h.s8&&L.FZ(l);else if(d||this.Za(h)||this.aLa<b){var y=q.b,z=null,B=null,F=null;d=null;null!=f&&(z=f.getMessage(),B=f.getText(),F=f.getShortDesc(),d=f.getStyleClass());var f=this.vy(),K=e.m(f),P=this.i(),e=0;null!=a&&(e=a);if(g)e=t.ys;else for(var Q in n)a=n[Q].ys,
a>e&&(e=a);if(y.zh(P,I.J2)!=e){y.tg(P,I.J2,e);var da;null!=d&&(da=L.Vra(e,"."+d+" ",!0),null==da&&v.l.warning("Icon not found with style class "+d+".  Make sure that skin contains class prefixed the message styleCalss: ."+d));da||(da=L.getIcon(e,!0));K.setTitleIconSource(da.src);B?K.setTitle(B):K.setTitle(L.Xu(e))}n=I.j(f,"_cnt");if(n=y.getElementById(n))l=L.sra(l,z,g),null!=F&&(l.title=F),n.hasChildNodes()?n.replaceChild(l,n.firstChild):n.appendChild(l);this.xZ()&&(l=y.getElementById(f),this.W0(l,
e),null!=d&&n&&q.b.getAttribute(n,"data-afr-msg-apply-class")&&C.w(l,d),this.He(h,l,{topPosition:.25}))}this.aLa=b};function yo(){var a=A.c,b=a.rC();return null!=b?a.m(b):null}bj.prototype.f9a=function(){var a=this.f().getInitialFocusId();if(a){var b=A.c.Lu(a);b?b.focus():v.l.warning("Invalid component id referenced by document initialFocusId: "+a+". You may need to set clientComponent to true for the desired focus component.")}window.clearTimeout(this.WJa);this.WJa=this.yGa=null};
function Ao(a){u.assert(a);a=a.g();a=I.j(a,bj.M5a);return q.b.getElementById(a)}bj.TKa=function(a){return a.K("_afrSkpLnk")};bj.kib=function(a){if(J.Em(a))return!0;var b=!1;switch(a.nodeName.toLowerCase()){case "div":case "span":case "h1":case "h2":case "h3":case "h4":case "h5":case "h6":b=!0}return b?J.tZ(a):!1};bj.prototype.bcb=function(){var a=this.R(),b=this.f();b&&(a.title=b.getTitle())};bj.prototype.Noa=function(a){a=a.getUncommittedDataWarning();A.c.iGa(a&&"on"==a.toLowerCase())};
bj.prototype.c3=function(a,b,d,e,f){u.J(b);u.J(d);u.Ja(e,"confirm callback");f&&u.Da(f,"confirm timeout");var g=A.c,h=q.b.getElementById(bj.a1);u.u(h,"DIV");h=h.getAttribute(bj.Dda);u.J(h);var l=g.m(h);u.s(l,AdfRichDialog);var n=l.getParent();u.s(n,AdfRichPopup);if(n.Za())return!1;l.setTitle(b);bj.xPa(h,d);$i.N8a(h,!a);l.addEventListener(Za.ua,bj.bHa);a={Jp:e,yvb:h};f&&(a.IVa=g.ta(this,bj.R9a,h,f));g.Df(h,a);n.show({zorderScope:2});return!0};
r.a("AdfDhtmlDocumentPeer.prototype.__showAlertConfirm",{c3:bj.prototype.c3});function zo(a){a=a.f().g();return I.j(a,bj.s2a)}bj.R9a=function(a){a=A.c.m(a);var b=a.o();b.bind(a);b.M8()};
bj.bHa=function(a){a.cancel();var b=a.getSource(),d=b.g(),e=b.getParent();u.s(e,AdfRichPopup);e.cancel();var e=A.c,f=e.Qe(d);u.Uc(f,"alert/confirm state token invalid");e.Df(d,null);f.IVa&&e.ic(f.IVa);e=f.Jp;try{e(a)}catch(g){v.l.Ge(g,"exception caught calling alert/confirm dialog event callback")}b.setTitle("");bj.xPa(d,"");b.removeEventListener(Za.ua,bj.bHa)};bj.xPa=function(a,b){var d=q.b,e=I.la(a,bj.G_a),e=d.getElementById(e);u.u(e,"TD");d.bc(e,b)};