function rg(){this.Init()}v("AdfAutoDismissalManager",rg);z.l(rg);rg.prototype.Init=function(){rg.f.Init.call(this);this.ki=[];this.hua=500};z.a("AdfAutoDismissalManager.prototype.Init",{Init:rg.prototype.Init});rg.prototype.Dfa=function(){return this.ki.length};z.a("AdfAutoDismissalManager.prototype.getBehaviorCount",{Dfa:rg.prototype.Dfa});rg.prototype.Bb=function(){this.Oea();this.a_()};z.a("AdfAutoDismissalManager.prototype.dispose",{Bb:rg.prototype.Bb});
rg.prototype.addBehavior=function(a,b){if(!this.Tga(a,b)){var d=b.autodismiss;switch(d){case "autodismissMenu":case "autodismissAlways":case "autodismissMouseOut":case "autodismissInactivate":case "autodismissTimeout":var e=a.e(),f=F.c,g=this.ki;if(!(a instanceof AdfRichDocument))for(var h=g.length-1;0<=h;h--){var m=g[h];if(m){var q=f.j(m.id);e!=m.id&&!a.gm(q)&&(m=m.yI,B.Da(m),m(h))}}h={};h.id=e;h.type=d;h.autodismissMouseOut=b.autodismissMouseOut;h[AdfRichPopup.Cf]=b[AdfRichPopup.Cf];h.popupId=b.popupId?
b.popupId:e;"autodismissTimeout"==d?(h.yI=this.o(this.ASa),d={g2:h,Ln:this},h.timer=f.oa(this,rg.SZ,d,b.autodismissTimeout)):(h.yI="autodismissInactivate"==d?this.o(this.BXa):this.o(this.lwa),0<b.autodismissPopupTimeout&&!b.modal&&(h.autodismissPopupTimeout=b.autodismissPopupTimeout,d={g2:h,Ln:this},h.timer=f.oa(this,rg.SZ,d,b.autodismissPopupTimeout)));0==g.length&&this.Nca();g.push(h)}}};z.a("AdfAutoDismissalManager.prototype.addBehavior",{addBehavior:rg.prototype.addBehavior});
rg.prototype.removeBehavior=function(a,b){var d=a.e(),e=this.ki;b||(b=d);for(var f=0;f<e.length;f++){var g=e[f];if(g){var h=g.id,g=g.popupId?g.popupId:d;if(h==d&&g==b){if(a instanceof AdfRichPopup)for(d=e.length-1;d>f;d--){var m=e[d];m&&(g=m.id,page.j(g).gm(a)&&(m=m.yI,B.Da(m),D.i.ks(D.FINE,"force autodismissal for descendant popupId: '"+g+"' of parent popupId: '"+h+"'"),m(d)))}D.i.ks(D.FINE,"unregistering autodismissal for popupId: '"+h+"'");e.splice(f,1);0==e.length&&this.a_();break}}}};
z.a("AdfAutoDismissalManager.prototype.removeBehavior",{removeBehavior:rg.prototype.removeBehavior});rg.prototype.Mea=function(a,b){for(var d=a.e(),e=this.ki,f=e.length,g=b.autodismiss,h=0;h<f;h++){var m=e[h];if(m.id==d){m.type=g;break}}};z.a("AdfAutoDismissalManager.prototype.changeBehavior",{Mea:rg.prototype.Mea});rg.prototype.LCa=function(){return 0<this.ki.length};z.a("AdfAutoDismissalManager.prototype.hasComponents",{LCa:rg.prototype.LCa});
rg.prototype.Tga=function(a,b){for(var d=a.e(),e=this.ki,f=e.length,g=0;g<f;g++)if(e[g].id==d)if(b.popupId){if(e[g].popupId==b.popupId)return l}else return l;return p};z.a("AdfAutoDismissalManager.prototype.hasComponent",{Tga:rg.prototype.Tga});rg.prototype.Oea=function(){for(var a=F.c,b=this.ki,d=b.length-1;-1<d;d--){var e,f=a.j(b[d].id);f&&(e=f.k())&&e.Wi(f,l)}ya.eBa(b)};z.a("AdfAutoDismissalManager.prototype.closeAll",{Oea:rg.prototype.Oea});
rg.prototype.kh=function(a){for(var b=this.ki,d=b.length-1;0<=d;d--){var e=b[d];e&&!sg(a,e)&&(e=e.yI,B.Da(e),e(d))}};z.a("AdfAutoDismissalManager.prototype.dismiss",{kh:rg.prototype.kh});rg.prototype.Yia=function(a){a=a.e();for(var b=this.ki,d=b.length,e=F.c,f=0;f<d;f++)b[f].timer&&b[f].id==a&&(e.ac(b[f].timer),delete b[f].timer)};z.a("AdfAutoDismissalManager.prototype.stopPopupDismissTimeout",{Yia:rg.prototype.Yia});
rg.prototype.$ha=function(a){a=a.e();for(var b=this.ki,d=b.length,e=F.c,f=0;f<d;f++)b[f].id==a&&(b[f].autodismissPopupTimeout&&!b[f].timer)&&(b[f].timer=e.oa(this,rg.SZ,{g2:b[f],Ln:this},this.hua))};z.a("AdfAutoDismissalManager.prototype.restartPopupDismissTimeout",{$ha:rg.prototype.$ha});rg.prototype.Lea=function(a){a=a.e();for(var b=this.ki,d=b.length,e=F.c,f=0;f<d;f++)b[f].id==a&&(b[f].timer&&(e.ac(b[f].timer),delete b[f].timer),b[f].autodismissPopupTimeout&&delete b[f].autodismissPopupTimeout)};
z.a("AdfAutoDismissalManager.prototype.cancelPopupDismissTimeout",{Lea:rg.prototype.Lea});
function sg(a,b){var d=b.autodismissMouseOut,e=b[AdfRichPopup.Cf],f=F.c.j(b.id),g=f.k();g.bind(f);g=g.Eu(f);if(g==n)return p;var h=tg(a,g),m;switch(b.type){case "autodismissAlways":m=h;!m&&(e&&H.sb(w.b.getElementById(e),a))&&(m=l);if(d=!m)d=f.k(),d.bind(f),f=d.h(),d=!F.c.am().hs(f);d&&(m=l);break;case "autodismissMenu":m=h||ug(a,f);break;case "autodismissMouseOut":m=d?h||H.sb(w.b.getElementById(d),a):h||ug(a,f);break;case "autodismissInactivate":m=h;break;case "autodismissTimeout":m=!tg(a,g)}return m}
function tg(a,b){var d=n,e;for(e in b){var f=b[e];if(f.La){f=f.La();if(H.oc(f,a))return l;if(d==n)a:{d=a;for(f=F.c;d;){var g=d.id;!g&&1==d.nodeType&&(g=d.getAttribute(vg.rV));if(g=g?f.j(g):n){d=g;break a}d=d.parentNode}d=n}if(f=e)a:{f=e;for(g=d;g;){if(f==g.e()){f=l;break a}g=g.getParent()}f=p}if(f)return l}}return p}function ug(a,b){var d=b.k();d.bind(b);d=d.h();return H.sb(d,a)}
rg.prototype.BXa=function(a){B.Ea(a);var b=this.ki[a];a=b.popupId;b=F.c.j(b.id);if((a=b.k().bs(b,a))&&a instanceof wg)b=xg.O(),b.WQ()==a&&b.B_()};rg.prototype.lwa=function(a){B.Ea(a);a=F.c.j(this.ki[a].id);yg(a)};rg.prototype.ASa=function(a){B.Ea(a);var b=F.c;a=this.ki[a];var d=a.timer;B.Ea(d);b.ac(d);a.type="autodismissMenu";a.yI=this.o(this.lwa);delete a.timer};rg.SZ=function(a){a=a.g2;var b=a.autodismissPopupTimeout;if("autodismissTimeout"==a.type||b)a=F.c.j(a.id),yg(a)};
function yg(a){var b=a.k();a instanceof AdfRichMenu?b.Xi():b.Wi(a)}u=rg.prototype;u.Nca=function(){var a=w.b,b=a.G()==w.aa,d=a.G()==w.Fc,e=a.w(),f=this.bxa=this.o(this.AO);a.S(e,"keyup",f);f=this.Ixa=this.o(this.caa);a.S(e.body,"mousedown",f);b?(b=this.jva=this.o(this.BWa),a.S(e,"focusin",b)):d?(b=a.R(),d=this.cr=this.o(this.wO),a.S(b,"blur",d)):(b=this.cr=this.o(this.wO),a.S(e,"blur",b));b=this.Jxa=this.o(this.JWa);a.S(e,"mouseover",b)};
u.a_=function(){var a=w.b,b=a.G()==w.aa,d=a.G()==w.Fc,e=a.w(),f=this.bxa;f&&(a.sa(e,"keyup",f),delete this.bxa);if(f=this.Ixa)a.sa(e.body,"mousedown",f),delete this.Ixa;if(b){if(b=this.jva)a.sa(e,"focusin",b),delete this.jva}else if(d){if(b=this.cr)d=a.R(),a.sa(d,"blur",b)}else if(b=this.cr)a.sa(e,"blur",b),delete this.cr;if(b=this.Jxa)a.sa(e,"mouseover",b),delete this.Jxa};u.BWa=function(a){(a=w.b.T(a))&&"IFRAME"==a.tagName&&this.kh(a)};u.caa=function(a){w.b.Ai(a)||this.kh(w.b.T(a))};
u.AO=function(a){var b=w.b;if(b.ia(a)==E.Df){var d=b.T(a);F.c.am().hs(d)?this.kh(d):(b.va(a),a=xg.O(),(dialogWindow=a.WQ())&&dialogWindow.Nh?dialogWindow.Nh():a.TQ())}};u.wO=function(a){if(!this.sX&&(a.target instanceof HTMLDocument||a.target.location))this.sX=F.c.oa(this,rg.HTa,{Ln:this,m9a:a.target},100)};
rg.HTa=function(a){var b,d=w.b.w().activeElement;if(d)try{b=d.tagName}catch(e){D.i.zf(e,"unable to detect the activeElement")}a=a.Ln;if("IFRAME"==b||"BODY"==b){b=a.ki;for(var f=b.length-1;0<=f;f--){var g=b[f],h=F.c;if("autodismissInactivate"==g.type){var g=g.id,h=h.j(g),m=h.k();m.bind(h);h=m.Eu(h);if(h!=n&&(g=h[g]))if(h=g.La(),H.oc(h,d)){g.y0(p);break}}else a.kh(d)}}delete this.sX};rg.prototype.Kea=function(){var a=this.sX;a&&(F.c.ac(a),delete this.sX)};
z.a("AdfAutoDismissalManager.prototype.cancelBlurTimeout",{Kea:rg.prototype.Kea});rg.prototype.JWa=function(a){var b=F.c,d=this.Pba;d&&(b.ac(d),delete this.Pba);a={Ln:this,l4a:w.b.T(a)};this.Pba=b.oa(this,rg.KWa,a,300)};
rg.KWa=function(a){var b=a.Ln;a=a.l4a;for(var d=b.ki,e=d.length-1;0<=e;e--){var f=d[e];if(("autodismissMouseOut"==f.type||"autodismissTimeout"==f.type)&&!sg(a,f))f=f.yI,B.Da(f),f(e)}for(var d=b.ki,e=F.c,f=w.b.w().activeElement,g=d.length-1;0<=g;g--){var h=d[g];h.autodismissPopupTimeout&&(h.timer&&(sg(a,h)||sg(f,h))?(e.ac(h.timer),delete h.timer):!h.timer&&(!sg(a,h)&&!sg(f,h))&&(h.timer=e.oa(b,rg.SZ,{g2:h,Ln:b},b.hua)))}delete this.Pba};