var Zi=I.ea(I,"AdfDhtmlDocumentPeer",!1);m("AdfDhtmlDocumentPeer",Zi);Zi.C=function(){I.ra(this,ha.Nd,ha.Oc,Za.ua,D.wb,D.Ad,ha.Qm,nh.JR);I.sb(this,AdfRichDocument.SHORT_DESC,AdfRichDocument.TITLE);this.V0a="iconC";this.KCa="msgDlg";this.n2a="msgCtr";this.F1="liveCtr";this.J5a="skip";this.L1="p_AFInactive";this.a1="afr::UtilPopupCtnr";this.Iza="data-afr-pid";this.Bda="data-afr-did";this.B_a="contentContainer";this.A_a="cancel"};m("AdfDhtmlDocumentPeer.InitSubclass",Zi.C);
Zi.prototype.Init=function(a){A.c.PUa(a.g());Zi.h.Init.call(this,a)};r.a("AdfDhtmlDocumentPeer.prototype.Init",{Init:Zi.prototype.Init});Zi.prototype.Cz=function(a,b,d){u.$d(d);document.body.title=d;return!0};r.a("AdfDhtmlDocumentPeer.prototype.ComponentShortDescChanged",{Cz:Zi.prototype.Cz});Zi.prototype.SQ=function(a,b,d){u.$d(d);document.title=d;return!0};r.a("AdfDhtmlDocumentPeer.prototype.ComponentTitleChanged",{SQ:Zi.prototype.SQ});
Zi.prototype.NP=function(){var a=A.c,b=a.pm(),d=this.f().g(),b=b[d],d=wo(),e=!1;null!=d&&(e=d.getGlobalOnly());return L.n$(a,b,e)};r.a("AdfDhtmlDocumentPeer.prototype.isMessagesDialogShowable",{NP:Zi.prototype.NP});Zi.prototype.uy=function(){var a=this.f().g();return"old"==A.c.H().qa("af|dialog-tr-button-type")?I.j(a,Zi.KCa):a+"_"+Zi.KCa};r.a("AdfDhtmlDocumentPeer.prototype.getMessageDialogId",{uy:Zi.prototype.uy});
Zi.prototype.xZ=function(){var a=this.uy(),a=q.b.getElementById(a),b=xo(this);return a&&a.parentNode.id==b};r.a("AdfDhtmlDocumentPeer.prototype.isMessagesInline",{xZ:Zi.prototype.xZ});Zi.prototype.ZC=function(a){a?this.OC():(a=this.f(),this.Jb(a))};r.a("AdfDhtmlDocumentPeer.prototype.setMessagesDialogShown",{ZC:Zi.prototype.ZC});Zi.prototype.Ta=function(a){if(a.ce()==Qa.Ef){var b=yo(this.f());a.X()==b&&(b.style.top="0px")}};r.a("AdfDhtmlDocumentPeer.prototype.HandleComponentFocus",{Ta:Zi.prototype.Ta});
Zi.prototype.Lb=function(a){if(a.ce()==Qa.Ef){var b=yo(this.f());a.X()==b&&(b.style.top="")}};r.a("AdfDhtmlDocumentPeer.prototype.HandleComponentBlur",{Lb:Zi.prototype.Lb});Zi.prototype.M=function(a){if(a.ce()==Qa.Ef){var b=yo(this.f());a.X()==b&&(b=Zi.OKa(this.f()),b=q.b.getElementById(b),u.u(b),b=C.x9(b,null,!1,Zi.jib),u.u(b),b&&(J.Em(b)||(b.tabIndex=-1),J.va(b)),a.cancel())}};r.a("AdfDhtmlDocumentPeer.prototype.HandleComponentClick",{M:Zi.prototype.M});Zi.prototype.Kz=function(a){Zi.Dtb||C.AVa(a)};
r.a("AdfDhtmlDocumentPeer.prototype.HandleComponentContextMenu",{Kz:Zi.prototype.Kz});Zi.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&&Qi.$().CY(a.X())}};r.a("AdfDhtmlDocumentPeer.prototype.HandleComponentKeyUp",{za:Zi.prototype.za});
Zi.prototype.eg=function(a){var b=a.getSource().g(),d=this.f().g(),e=this.uy();if(b==e&&(b=a.ll(),a.cancel(),this.Jb(this.f()),b==Za.Zm&&(a=A.c,b=wo(),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:Zi.prototype.eg});Zi.prototype.Yxa=function(a){var b=a.Ksa();A.c.ARa(b,a.bsa())};r.a("AdfDhtmlDocumentPeer.prototype.HandleComponentRedirect",{Yxa:Zi.prototype.Yxa});
Zi.prototype.ob=function(a,b){Zi.h.ob.call(this,a,b);C.O(b,I.IJ);C.O(b,Zi.L1);var d=xo(this);(d=q.b.getElementById(d))&&d.appendChild(b)};r.a("AdfDhtmlDocumentPeer.prototype.PopupClosed",{ob:Zi.prototype.ob});
Zi.prototype.G=function(a,b){var d=A.c;Zi.h.G.call(this,a,b);var e=new ha(a,"load");d.Gla?e.F():(e=e.D(e.F),d.aVa(e));a.getInitialFocusId()&&(this.uGa=this.D(this.c9a),this.RJa=window.setTimeout(this.uGa,50));this.WKa=0;d=!1;e=Zi.OKa(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=yo(a))&&(d.style.display="none");(d=a.getTitle())&&this.R().title!=
d&&(d=this.D(this.acb),setTimeout(d,0));this.Joa(a)};r.a("AdfDhtmlDocumentPeer.prototype.InitDomElement",{G:Zi.prototype.G});Zi.prototype.Zb=function(a,b){var d=this.f().g(),d=I.j(d,Zi.V0a);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 Zi.h.Zb.call(this,a,b)};r.a("AdfDhtmlDocumentPeer.prototype.ReplaceDomElement",{Zb:Zi.prototype.Zb});Zi.prototype.Ym=function(a,b){this.xW(a,b,!0)};
r.a("AdfDhtmlDocumentPeer.prototype.MessageShow",{Ym:Zi.prototype.Ym});Zi.prototype.vi=function(a,b){this.xW(a,b,!1)};r.a("AdfDhtmlDocumentPeer.prototype.MessageNotify",{vi:Zi.prototype.vi});
Zi.prototype.xW=function(a,b,d){var e=A.c,f=wo(),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.ps(e,b,g))L.LJ();else if(d&&!L.n$(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.WKa<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.uy(),K=e.m(f),P=this.i(),e=0;null!=a&&(e=a);if(g)e=t.xs;else for(var Q in n)a=n[Q].xs,
a>e&&(e=a);if(y.yh(P,I.J2)!=e){y.tg(P,I.J2,e);var da;null!=d&&(da=L.Rra(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.Wu(e))}n=I.j(f,"_cnt");if(n=y.getElementById(n))l=L.ora(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.WKa=b};function wo(){var a=A.c,b=a.rC();return null!=b?a.m(b):null}Zi.prototype.c9a=function(){var a=this.f().getInitialFocusId();if(a){var b=A.c.Ku(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.RJa);this.RJa=this.uGa=null};
function yo(a){u.assert(a);a=a.g();a=I.j(a,Zi.J5a);return q.b.getElementById(a)}Zi.OKa=function(a){return a.K("_afrSkpLnk")};Zi.jib=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};Zi.prototype.acb=function(){var a=this.R(),b=this.f();b&&(a.title=b.getTitle())};Zi.prototype.Joa=function(a){a=a.getUncommittedDataWarning();A.c.eGa(a&&"on"==a.toLowerCase())};
Zi.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(Zi.a1);u.u(h,"DIV");h=h.getAttribute(Zi.Bda);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);Zi.sPa(h,d);Ui.K8a(h,!a);l.addEventListener(Za.ua,Zi.YGa);a={Ip:e,wvb:h};f&&(a.EVa=g.ta(this,Zi.O9a,h,f));g.Df(h,a);n.show({zorderScope:2});return!0};
r.a("AdfDhtmlDocumentPeer.prototype.__showAlertConfirm",{c3:Zi.prototype.c3});function xo(a){a=a.f().g();return I.j(a,Zi.n2a)}Zi.O9a=function(a){a=A.c.m(a);var b=a.o();b.bind(a);b.M8()};
Zi.YGa=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.Pe(d);u.Tc(f,"alert/confirm state token invalid");e.Df(d,null);f.EVa&&e.ic(f.EVa);e=f.Ip;try{e(a)}catch(g){v.l.Ge(g,"exception caught calling alert/confirm dialog event callback")}b.setTitle("");Zi.sPa(d,"");b.removeEventListener(Za.ua,Zi.YGa)};Zi.sPa=function(a,b){var d=q.b,e=I.la(a,Zi.B_a),e=d.getElementById(e);u.u(e,"TD");d.bc(e,b)};