var Bg=M.U(Ag,"AdfDhtmlDialogPeer");v("AdfDhtmlDialogPeer",Bg);Bg.m=function(){this.P6="ok";this.eHa="cancel";this.Lra="yes";this.EMa="no";this.R6="data-afr-pdo";this.BL=[Bg.P6,Bg.Lra,Bg.EMa,Bg.eHa];this.WGa=[ab.fl,ab.qT,ab.Nla,ab.vm];M.ha(this,I.jb);this.rJa="af|dialog::resize-ghost";this.V4="af|dialog-tr-open-animation-duration";this.U4="af|dialog-tr-animate"};v("AdfDhtmlDialogPeer.InitSubclass",Bg.m);Bg.prototype.Init=function(a,b){Bg.f.Init.call(this,a,b)};
z.a("AdfDhtmlDialogPeer.prototype.Init",{Init:Bg.prototype.Init});Bg.prototype.q=function(a,b){Bg.f.q.call(this,a,b);var d=a.e();Bg.H0a(d)};z.a("AdfDhtmlDialogPeer.prototype.InitDomElement",{q:Bg.prototype.q});
Bg.OCa=function(a){a=F.c.j(a);if(a!=n&&a instanceof AdfRichDialog){var b=F.c,d=b.Jk(),e=b.Pk(),f;for(f in d){var g=f==e,h=p;if(!g){var m=b.j(f);m!=n&&(h=m.gm(a))}if(g||h){g=d[f];for(h=0;h<g.length;h++)if(g[h].getSeverity()>=TrFacesMessage.SEVERITY_ERROR)return}}f=a.getParent();f instanceof AdfRichPopup?f.rb():a.setVisible(p)}};v("AdfDhtmlDialogPeer.hideDialogIfNoMessages",Bg.OCa);v("AdfDhtmlDialogPeer.hideDialogIfNoMessages",Bg.OCa);Bg.prototype.L_=function(){var a=this.d(),b=new ab(a,ab.vm);a.pC(b)};
z.a("AdfDhtmlDialogPeer.prototype.fireCancel",{L_:Bg.prototype.L_});Bg.prototype.C=function(a){var b=this.d();this.pj(b.e())&&(a.cancel(),a.dc());(a.na()||!a.Jb()||!Cg(this,b,a,p))&&Bg.f.C.call(this,a)};z.a("AdfDhtmlDialogPeer.prototype.HandleComponentClick",{C:Bg.prototype.C});Bg.prototype.RC=function(a){var b=this.d();(new ab(b,ab.vm)).v();w.b.va(a)};z.a("AdfDhtmlDialogPeer.prototype.handleEscapeKey",{RC:Bg.prototype.RC});
Bg.prototype.ba=function(a){var b=this.d();this.pj(b.e())&&(a.cancel(),a.dc());if(!a.na()&&a.ia()==E.$a){if(Cg(this,b,a,l))return;var d=a.Q(),e=d.tagName,f,g=b.e();Bg.bYa(g)?f=ab.fl:Bg.mYa(g)&&(f=ab.qT);if("A"==e||"BUTTON"==e||"TEXTAREA"==e)f=n;else if("INPUT"==e&&(d=d.type,"button"==d||"submit"==d||"reset"==d))f=n;if(f){if(d=F.c.Vr())(e=d.k())&&e instanceof xe&&e.GV(d);a.cancel();a.dc();(new ab(b,f)).v();return}}Bg.f.ba.call(this,a)};z.a("AdfDhtmlDialogPeer.prototype.HandleComponentKeyDown",{ba:Bg.prototype.ba});
Bg.prototype.pa=function(a){if(!a.na()){var b=a.ia(),d=this.d();if(b==E.zd&&Cg(this,d,a,p))return}Bg.f.pa.call(this,a)};z.a("AdfDhtmlDialogPeer.prototype.HandleComponentKeyUp",{pa:Bg.prototype.pa});Bg.prototype.zb=function(a){if(!a.na()&&a.ia()==E.$a){var b=a.Q().getAttribute(Bg.R6);if(b==ab.vm){a.cancel();a.dc();a=this.d();(new ab(a,b)).v();return}}Bg.f.zb.call(this,a)};z.a("AdfDhtmlDialogPeer.prototype.HandleComponentKeyPress",{zb:Bg.prototype.zb});
function Cg(a,b,d,e){var f;if(a.zE(d))f=ab.vm;else{a=d.Q();f=b.e();a:{var g=a;if(Bg.pn(f)){for(var h=0;4>h;h++){var m=g.id;if(m.length&&m.length>f.length&&f==m.substring(0,f.length)){f=g;break a}g=g.parentNode}f=n}else f="SPAN"==g.tagName&&"BUTTON"==g.parentNode.tagName?g.parentNode:g}g=f==n?a:f;if((f=g.getAttribute(Bg.R6))&&(a.disabled||H.ta(g,M.gb)))f=n}e&&f==ab.vm?f=p:f&&(d.cancel(),d.dc(),(new ab(b,f)).v());return f}Bg.bYa=function(a){return Bg.Ot(a,Bg.P6)!=n};
Bg.mYa=function(a){return Bg.Ot(a,Bg.Lra)!=n};Bg.Ot=function(a,b){return Bg.pn(a)?w.b.getElementById(a+"_"+b):w.b.getElementById(M.g(a,b))};Bg.pn=function(a){return"old"==F.c.u().ka("af|dialog-tr-button-type")?p:1==a.split("::").length};Bg.H0a=function(a){for(var b=Bg.BL,d=Bg.WGa,e=b.length,f=0;f<e;f++){var g=Bg.Ot(a,b[f]);g&&g.setAttribute(Bg.R6,d[f])}};
Bg.F0a=function(a,b){B.s(a);B.pc(b);for(var d=Bg.BL,e=d.length,f=0;f<e;f++){var g=Bg.Ot(a,d[f]);Bg.pn(a)?(g=F.c.j(a+"_"+d[f]))&&g.setProperty("disabled",b):g&&hg.v8(g,b)}};Bg.prototype.pj=function(a){for(var b=Bg.BL,d=b.length,e=0,f=0,g=0;g<d;g++){var h=Bg.Ot(a,b[g]);h&&(e++,H.ta(h,M.gb)&&f++)}return 0<e&&e==f};z.a("AdfDhtmlDialogPeer.prototype.IsBusy",{pj:Bg.prototype.pj});Bg.prototype.gd=function(a){F.c.Dg()||Bg.F0a(this.d().e(),a)};z.a("AdfDhtmlDialogPeer.prototype.SetBusy",{gd:Bg.prototype.gd});
Bg.prototype.Kfa=function(a){for(var b=Bg.BL,d=b.length,e=0;e<d;e++){var f=Bg.Ot(a,b[e]);if(f)return f}return n};z.a("AdfDhtmlDialogPeer.prototype.getDefaultButtonDom",{Kfa:Bg.prototype.Kfa});Bg.KQa=function(a,b){var d=Dg.pJa;Bg.pn(a)?(d=F.c.j(a+"_"+d))&&d.setProperty("visible",b):(d=Bg.Ot(a,d))&&H.setVisible(d,b)};
Bg.prototype.MM=function(a,b){for(var d=Bg.BL,e=d.length,f,g,h=0;h<e;h++){var m=Bg.Ot(a,d[h]);if(m){f=m;g=d[h];break}}f&&(Bg.pn(a)?(d=F.c.j(a+"_"+g))&&d.setProperty("disabled",b):hg.v8(f,b))};z.a("AdfDhtmlDialogPeer.prototype.__setDefaultButtonDisabled",{MM:Bg.prototype.MM});Bg.prototype.kE=function(){return Bg.rJa};z.a("AdfDhtmlDialogPeer.prototype.GetResizeGhostSelector",{kE:Bg.prototype.kE});Bg.prototype.FI=function(){return Bg.V4};
z.a("AdfDhtmlDialogPeer.prototype.getAnimationDurationSkinProperty",{FI:Bg.prototype.FI});Bg.prototype.EI=function(){return Bg.U4};z.a("AdfDhtmlDialogPeer.prototype.getAnimateSkinProperty",{EI:Bg.prototype.EI});