function Si(){this.Init()}m("AdfDhtmlDialogManager",Si);r.v(Si);Si.prototype.Init=function(){Si.h.Init.call(this);this.JU=[];this.AGa=[];this.St=null;var a=q.b;a.R();a.Y();this.CG={};this.CG.Hi=function(){var a=this.blb;a?J.va(a):J.dra()};this.CG.Aaa=function(){};this.CG.g_=function(){}};r.a("AdfDhtmlDialogManager.prototype.Init",{Init:Si.prototype.Init});Si.prototype.rj=function(){return this.JU.length};r.a("AdfDhtmlDialogManager.prototype.getElementCount",{rj:Si.prototype.rj});
Si.prototype.bua=function(a){this.JU[this.JU.length]=a;delete this.VN};r.a("AdfDhtmlDialogManager.prototype.registerDialog",{bua:Si.prototype.bua});
function Ui(a){var b=-1,d=a.St,e=a.VN;if(e)return d&&(b=E.indexOf(e,d)),b;for(var e=[],f=a.JU,g=!1,h=f.length-1;-1<h;h--){var l=f[h];if(g){var n=a,t=l.EH(),y=n.xjb;if(!y){var y=A.c,y=y.m(y.gj),z=y.o();z.bind(y);y=n.xjb=z.vy()}if(t==y){e.splice(e.length-1,0,l);l.vl();d=e[e.length-1];d.ss()&&(f={},f.msgDialog=l,f.modalDialog=d,d.d8(Si.rmb,f));break}}else{if(l.getModal()&&(g=!0,2==l.Q9()))break;-1==b&&d&&l==d&&(b=e.length);e[e.length]=l}}e.reverse();-1<b&&(b=e.length-1-b);g||(e[e.length]=a.CG);a.VN=
e;return b}Si.rmb=function(a){u.Uc(a,"params is required");var b=a.msgDialog;a=a.modalDialog;u.s(b,Ri,"params.msgDialog]");u.s(a,Ri,"params.modalDialog");a=a.Ee();b.Zua(a&&a.id?a.id:null)};Si.prototype.CY=function(a){a&&(this.CG.blb=a);a=Ui(this);var b=this.VN,d=0;b&&!(1>=b.length)&&(d=-1==a||a+1==b.length?0:a+1,a=b[d])&&(this.jY(a),a.Hi())};r.a("AdfDhtmlDialogManager.prototype.focusNextModelessDialog",{CY:Si.prototype.CY});
Si.prototype.Kva=function(a){var b=this.AGa,d=this.JU;Ui(this);E.Ig(d,a);E.Ig(b,a);if(a.getModal())for(var e=A.c,f=this.VN,g=f.length-1;0<g;g--){var h=f[g];if(h!=this.CG){var l=h.EH(),n=e.m(l);if(n&&n instanceof AdfRichDialog){var t=n.getParent();if(t&&t instanceof AdfRichDocument&&t.o().vy()==l)continue;l=n.o();l.bind(n);l.M8()}else n=h.jP(),(n=e.m(n))&&n instanceof AdfRichPopup&&n.cancel();E.Ig(d,h);E.Ig(b,h)}}delete this.VN;this.St==a&&(this.St=null,a=b.length,1<=a&&(this.St=b[a-1]).Hi())};
r.a("AdfDhtmlDialogManager.prototype.unregisterDialog",{Kva:Si.prototype.Kva});Si.prototype.jY=function(a){var b=this.St;if(b==a)return!1;Ui(this);var d=this.VN;if(d&&0>E.indexOf(d,a))return!1;b&&this.B8();if(a==this.CG)return!1;this.St=a;b=this.AGa;E.Ig(b,a);b.push(a);a.g_();return!0};r.a("AdfDhtmlDialogManager.prototype.activateDialog",{jY:Si.prototype.jY});Si.prototype.B8=function(){this.St&&(this.St.Aaa(),this.St=null)};r.a("AdfDhtmlDialogManager.prototype.deactivateCurrentDialog",{B8:Si.prototype.B8});
Si.$=function(){null==this.Wk&&(this.Wk=new Si);return this.Wk};m("AdfDhtmlDialogManager.getInstance",Si.$);Si.prototype.BH=function(){return this.St};r.a("AdfDhtmlDialogManager.prototype.getActiveDialog",{BH:Si.prototype.BH});