var nz=M.U(M,"AdfDhtmlToolbarPeer",p);v("AdfDhtmlToolbarPeer",nz);nz.m=function(){z.kb(ap);M.ha(this,I.ec,I.Wf,I.tc)};v("AdfDhtmlToolbarPeer.InitSubclass",nz.m);nz.prototype.q=function(a,b){nz.f.q.call(this,a,b);var d=a.e(),e=M.g(d,"eoc"),f=w.b;if(this.Gj=(this.Hd=f.getElementById(e))?l:p)e=M.g(d,"eoi"),this.Dl=f.getElementById(e),F.c.Go(a);this.HA=f.Sk(f.Su(b.getElementsByTagName("table")[0],0));(this.tB=O.bCa(b)==n)?this.ya=O.wEa(b):this.Gj&&this.Dl.setAttribute("tabIndex","0")};
z.a("AdfDhtmlToolbarPeer.prototype.InitDomElement",{q:nz.prototype.q});nz.prototype.Md=t(l);z.a("AdfDhtmlToolbarPeer.prototype.needsChildVisibilityChanges",{Md:nz.prototype.Md});nz.prototype.ja=t(l);z.a("AdfDhtmlToolbarPeer.prototype.needsResizeNotify",{ja:nz.prototype.ja});nz.prototype.ce=function(a,b){b||(b=[]);nz.f.ce.call(this,a,b);this.Gj==l&&Oi.rga(a,b);return b};z.a("AdfDhtmlToolbarPeer.prototype.getDescendantComponents",{ce:nz.prototype.ce});
nz.prototype.kg=function(){this.tB&&(this.ya&&this.ya.setAttribute("tabIndex","-1"),this.ya=O.pD(this.h()))};z.a("AdfDhtmlToolbarPeer.prototype.resetActiveDescendant",{kg:nz.prototype.kg});
nz.prototype.Ia=function(){var a=this.h(),b=this.d(),d=b.e();if(this.Gj!=p||b.getStretchId()){this.uQ();if(this.Gj==l){if(!this.Fa){this.Fa=new Oi(d,this,"end",n,n,this.tB);b=w.b;a=b.Sk(b.Su(a.getElementsByTagName("table")[0],0));b=0;for(d=a[0];d;)this.Fa.un(),this.Fa.addElement(d),d=H.ca(d),ap.sha(d)&&(d=this.MA(d),this.Fa.lp(d)),b++,d=a[b]}this.Fa.Nf()}this.JP();(!this.ya||!(0<this.ya.offsetWidth||0<this.ya.offsetHeight))&&this.kg()}};z.a("AdfDhtmlToolbarPeer.prototype.ResizeNotify",{Ia:nz.prototype.Ia});
nz.prototype.Ed=function(){F.c.jc(this.d());return p};z.a("AdfDhtmlToolbarPeer.prototype.ChildVisibilityChanged",{Ed:nz.prototype.Ed});nz.prototype.nj=function(){if(this.Ar)D.i.fine("toolbar#GetPreferredWidth called, returned cached value of: "+this.Ar);else{var a=this.h().firstChild;this.uQ();this.Fa&&this.Fa.kD();this.Ar=a.offsetWidth;this.JP();D.i.fine("toolbar#GetPreferredWidth called, returned calculated value of: "+this.Ar)}return this.Ar};
z.a("AdfDhtmlToolbarPeer.prototype.GetPreferredWidth",{nj:nz.prototype.nj});nz.prototype.iE=function(){if(!this.Si)if(this.Gj==p)this.Si=this.nj();else if(this.HA&&0<this.HA.length){var a=this.Dl.style.display,b=this.Dl;b.style.display="block";var d=w.b.getComputedStyle(b);this.Si=b.offsetWidth+w.ua(d.marginLeft)+w.ua(d.marginRight);b.style.display=a;a=this.nj();this.Si>a&&(this.Si=a)}else this.Si=0;return this.Si};z.a("AdfDhtmlToolbarPeer.prototype.GetMinimumWidth",{iE:nz.prototype.iE});
nz.prototype.Z=function(a){this.Fa&&(this.Fa.lv(),delete this.Fa);delete this.Hd;delete this.Dl;delete this.HA;delete this.Gj;delete this.Ar;delete this.Si;F.c.Nm(a);nz.f.Z.call(this,a)};z.a("AdfDhtmlToolbarPeer.prototype.ComponentRemoved",{Z:nz.prototype.Z});nz.prototype.ba=function(a){if(!a.na()){var b=w.b,d=a.ia();b.oy()==I.ec&&this.Ak(d,a)}};z.a("AdfDhtmlToolbarPeer.prototype.HandleComponentKeyDown",{ba:nz.prototype.ba});
nz.prototype.zb=function(a){if(!a.na()&&w.b.oy()==I.Wf){var b=a.ia();this.Ak(b,a)}};z.a("AdfDhtmlToolbarPeer.prototype.HandleComponentKeyPress",{zb:nz.prototype.zb});nz.prototype.Ha=function(a){if(this.tB){var b=a.getSource(),d=a.L(),d=w.b.T(d),e=b.e(),e=w.b.getElementById(e);e==this.h()&&(e=d);d==this.Dl?this.ya!=d&&this.tu(d):ap.ej(e)?(b=O.Zl(e))&&this.Fa.u2(b):ap.$Ca(b)&&(b=O.Zl(e))&&b!=this.ya&&this.tu(b);a.cancel()}};z.a("AdfDhtmlToolbarPeer.prototype.HandleComponentFocus",{Ha:nz.prototype.Ha});
nz.prototype.Ki=function(a,b,d){nz.f.Ki.call(this,a,b,d);this.Gj&&this.Fa.ej(b)&&this.Fa.a2()};z.a("AdfDhtmlToolbarPeer.prototype.SimulateMouseOnDescendant",{Ki:nz.prototype.Ki});nz.prototype.uc=function(a){this.bind(a);this.Si=this.Ar=n;a=this.Ee(a);var b=a!=n?a.k():n;b&&b.uc&&b.uc(a)};z.a("AdfDhtmlToolbarPeer.prototype.__preferredSizeChangeNotify",{uc:nz.prototype.uc});u=nz.prototype;u.uQ=function(){var a=this.CG();a&&(a.parentNode.style.width="")};
u.JP=function(){var a=this.CG();if(a)if(ap.ej(a))a.parentNode.style.width="100%";else{var b=w.b.getWindowWidth()+"px";a.parentNode.style.width=b}};
u.MA=function(a){var b=this.CG(),b=a==b?"auto":"100%",d=a.ownerDocument.createElement("table");d.cellPadding=0;d.cellSpacing=0;d.style.width="100%";d.setAttribute("role","presentation");var e=d.insertRow(-1),f=e.insertCell(-1);f.setAttribute(ap.Tz,"true");f.setAttribute("role","presentation");H.n(f,ap.fL);a=this.Fa.OQ(a);f.appendChild(a);e.insertCell(-1).style.width=b;return d};
u.CG=function(){var a=this.d(),b=a.getStretchId();if(b){if(a=a.j(b))return b=a.e(),w.b.getElementById(b);D.i.warning("Unable to find client component for stretch id "+b)}return n};
u.Ak=function(a,b){var d=b.L();if(!d.ctrlKey&&!d.altKey&&!d.shiftKey&&!d.metaKey){var d=w.b.T(d),e=b.getSource().e(),e=w.b.getElementById(e);e==this.h()&&(e=d);if(ap.ej(e))if(this.tB)switch(a){case E.Ya:case E.Kb:this.Fa.O_(this.Hd);b.cancel();break;case E.Ja:case E.Lb:this.Fa.N_(this.Hd),b.cancel()}else switch(a){case E.Ya:case E.Kb:O.Qh(d,this.Hd);b.cancel();break;case E.Ja:case E.Lb:O.Ud(d,this.Hd),b.cancel()}else switch(a){case E.Kb:this.tB&&this.Ow()?(d=this.h(),(d=O.CI(d,this.ya))?this.ya=d:
O.Qh(this.ya)):(d=b.L(),d=w.b.T(d),O.Qh(d));b.cancel();break;case E.Lb:this.tB&&this.Ow()?(d=this.h(),(d=O.BI(d,this.ya))?this.ya=d:O.Ud(this.ya)):(d=b.L(),d=w.b.T(d),O.Ud(d)),b.cancel()}}};u.Ow=function(){B.p(this.ya);B.assert("0"==this.ya.getAttribute("tabindex"),"The toolbar's active descendant should have tabindex 0");this.ya||(D.i.warning("Toolbar has lost its assigned activeDescendant!"),this.kg());return this.ya!=n};
u.tu=function(a){B.p(a);this.ya&&this.ya.setAttribute("tabIndex","-1");a.setAttribute("tabIndex","0");this.ya=a};