var fo=I.ea(I,"AdfDhtmlCommandToolbarButtonPeer");m("AdfDhtmlCommandToolbarButtonPeer",fo);
fo.C=function(){I.ra(this,D.Bc,D.wb,D.Bd,D.Rg);q.b.Dd()||I.ra(this,D.ze,D.gg);I.sb(this,AdfRichCommandToolbarButton.DISABLED,AdfRichCommandToolbarButton.SELECTED,AdfRichCommandToolbarButton.SHORT_DESC,AdfRichCommandToolbarButton.TEXT);I.hc(this,AdfRichCommandToolbarButton.TEXT);this.aT="popEl";this.ZS="popCtr";this.$S="popArea";this.Sfa="popup";this.Mf="_afrPopId";this.jS="_afrGrp";this.Ph="p_AFDepressed";this.Mj="p_AFSelected";this.df="_busy"};m("AdfDhtmlCommandToolbarButtonPeer.InitSubclass",fo.C);
fo.prototype.tb=function(a,b){fo.h.tb.call(this,a,b);this.dF=C.sa(b,"p_AFActionDisabled")};r.a("AdfDhtmlCommandToolbarButtonPeer.prototype.BindToComponent",{tb:fo.prototype.tb});fo.prototype.ma=function(a){if(!a.Aa()){var b=a.na(),d=this.f(),e=this.qp();if(this.In(a)){var f=this.dF&&(b==w.jb||b==w.gd);b==w.Ra||f?this.PW(e,!0,a):b==w.gd&&(f=d.K(fo.df),d.getDisabled()||f||(this.mp(),a.cancel()))}b==w.Ih&&(e||(e=d.g()),this.Jb(d,e))}};
r.a("AdfDhtmlCommandToolbarButtonPeer.prototype.HandleComponentKeyDown",{ma:fo.prototype.ma});fo.prototype.M=function(a){if(a.ec()&&!this.dF&&!this.cW(a)&&this.In(a)){a=this.f();var b=a.K(fo.df);a.getDisabled()||b||this.mp()}};r.a("AdfDhtmlCommandToolbarButtonPeer.prototype.HandleComponentClick",{M:fo.prototype.M});fo.prototype.$a=function(a){!this.f().getDisabled()&&this.In(a)&&this.Vl(this.f())};r.a("AdfDhtmlCommandToolbarButtonPeer.prototype.HandleComponentMouseOver",{$a:fo.prototype.$a});
fo.prototype.fc=function(a){var b=this.f();!b.getDisabled()&&this.In(a)&&(b.getSelected()?(this.Gb(b,!0),this.Ul(b)):(this.Gb(b,!1),this.Ei(b)))};r.a("AdfDhtmlCommandToolbarButtonPeer.prototype.HandleComponentMouseOut",{fc:fo.prototype.fc});fo.prototype.Ac=function(a){var b=this.f();!b.getDisabled()&&a.ec()&&this.In(a)&&(this.Gb(b,!1),this.Vl(b))};r.a("AdfDhtmlCommandToolbarButtonPeer.prototype.HandleComponentMouseUp",{Ac:fo.prototype.Ac});
fo.prototype.Fa=function(a){var b=this.f(),d=a.ec();!b.getDisabled()&&d&&this.In(a)&&(this.Gb(b,!0),this.Ul(b),this.dF||this.cW(a))&&(b=this.qp(),this.PW(b,!1,a))};r.a("AdfDhtmlCommandToolbarButtonPeer.prototype.HandleComponentMouseDown",{Fa:fo.prototype.Fa});fo.prototype.we=function(a,b,d){var e=C.ib(b,"A");1==d?(C.w(b,I.lb),e.removeAttribute("href"),this.VA(a),this.SG(a),e.setAttribute(J.Hh,"false")):(C.O(b,I.lb),e.setAttribute("href","#"),this.Ei(a),this.FG(a),e.setAttribute(J.Hh,"true"))};
r.a("AdfDhtmlCommandToolbarButtonPeer.prototype.ComponentDisabledChanged",{we:fo.prototype.we});fo.prototype.zq=function(a,b,d){var e=a.getType();d?(this.Gb(a,!0),C.w(b,fo.Mj),this.Ul(a),"radio"==e&&(this.UB(),this.Rja(a)),"check"==e&&this.Sja(a)):(this.Gb(a,!1),C.O(b,fo.Mj),this.Ei(a),"radio"==e&&this.Aja(a),"check"==e&&this.Bja(a))};r.a("AdfDhtmlCommandToolbarButtonPeer.prototype.ComponentSelectedChanged",{zq:fo.prototype.zq});
fo.prototype.Cz=function(a,b,d){b.setAttribute("title",d);if(a=this.Zl(a))a.setAttribute("title",d),a.setAttribute("alt",d)};r.a("AdfDhtmlCommandToolbarButtonPeer.prototype.ComponentShortDescChanged",{Cz:fo.prototype.Cz});fo.prototype.Jg=C.YE;fo.prototype.Oa=function(){return ji.jd()};r.a("AdfDhtmlCommandToolbarButtonPeer.prototype.GetInlineEditor",{Oa:fo.prototype.Oa});
fo.prototype.sc=function(a,b){var d=I.j(a.g(),fo.$S);if(d=(d=q.b.getElementById(d))?C.lc(d):b){if(d=C.ib(d,"span"))if(d=q.b.mc(d),""!=d)return d;return null}u.assert(!1,"Unable to find the element containing the text")};r.a("AdfDhtmlCommandToolbarButtonPeer.prototype.GetComponentText",{sc:fo.prototype.sc});fo.prototype.vd=function(a){var b=this.f(),d=this.i();!C.lf(d)||b.getDisabled()||A.c.Zg()||(C.qd(a,d,I.lb),b.setProperty(fo.df,a,!1,G.ud))};
r.a("AdfDhtmlCommandToolbarButtonPeer.prototype.SetBusy",{vd:fo.prototype.vd});fo.prototype.ob=function(a,b,d){fo.h.ob.call(this,a,b);a=a.g();d==a&&(d=I.la(a,fo.ZS),(d=q.b.getElementById(d))&&d.appendChild(b))};r.a("AdfDhtmlCommandToolbarButtonPeer.prototype.PopupClosed",{ob:fo.prototype.ob});fo.prototype.bd=function(a){this.bind(a);a=this.bf(a);var b=null!=a?a.o():null;b&&b.bd&&b.bd(a)};r.a("AdfDhtmlCommandToolbarButtonPeer.prototype.__preferredSizeChangeNotify",{bd:fo.prototype.bd});k=fo.prototype;
k.mp=function(){var a=this.f(),b=new ab(a);b.F(a.getPartialSubmit());b.Aa()||(b=a.getType(),"check"==b?a.setSelected(!a.getSelected()):"radio"==b&&this.UB())};
k.PW=function(a,b,d){var e=this.f(),f=e.g(),g=I.la(f,fo.aT);if(q.b.getElementById(g))if(g=this.i(),null!=a)e=A.c.m(a).o(),a={},a.alignElement=g,a[AdfRichPopup.Ed]=AdfRichPopup.qf,a.focus=b,e.show(a),d.cancel();else{a=I.la(f,fo.ZS);var h=q.b.getElementById(a);if(null!=h){for(var l=h.firstChild;l&&8==l.nodeType;)l=l.nextSibling;if(null!=l){a={};var n=I.la(f,fo.Sfa);l.id!=n&&(h=h.ownerDocument.createElement("div"),h.appendChild(l),l=h,l.id=n);a.autodismiss="autodismissAlways";a.alignElement=g;a[AdfRichPopup.Ed]=
AdfRichPopup.qf;a.focus=b;this.He(e,l,a,f);d.cancel()}}}};k.UB=function(){for(var a=this.f(),b=this.i(),b=this.jx(b),d=a.getParent(),d=d.o().Cd(d),e=0;e<d.length;e++){var f=d[e],g=I.Fb(f),g=this.jx(g);b==g&&f!=a&&f.getType&&"radio"==f.getType()&&this.mpa(f)}a.setSelected(!0)};k.jx=function(a){return a.getAttribute(fo.jS)};k.mpa=function(a){a.setSelected(!1);this.Gb(a,!1);this.Ei(a)};k.Zl=function(a){a=a.g();a=I.la(a,"icon");return q.b.getElementById(a)};k.Ei=function(a){this.Hd(a,null)};
k.Ul=function(a){this.Hd(a,a.getDepressedIcon())};k.Vl=function(a){a.getSelected()||this.Hd(a,a.getHoverIcon())};k.VA=function(a){this.Hd(a,a.getDisabledIcon())};k.Hd=function(a,b){if(I.yo(a))b&&v.l.warning("component: ",a.g(),", depressed, disabled and hover icons are not supported when iconDelivery is inline/fetchAndInline for svg icons.CSS styles can be applied on inline SVG to handle these states.Icon url: ",b);else{var d=a.getIcon(),e=this.Zl(a);e&&d&&(e.src=b||d)}};
k.Gb=function(a,b){var d=I.Fb(a),e=fo.Ph;b?C.w(d,e):C.O(d,e)};k.cW=function(a){var b=this.f().g(),d=I.la(b,fo.$S);for(a=a.X();null!=a&&a.id!=b;){if(a.id==d)return!0;a=a.parentNode}return!1};k.qp=function(){var a=this.f(),a=I.la(a.g(),fo.aT),a=q.b.getElementById(a);if(!a)return null;var a=a.parentNode,b=a.getAttribute(fo.Mf);null==b&&(b=a.parentNode.getAttribute(fo.Mf));return b};
k.In=function(a){var b=a.X();a=this.qp();for(var d=null!=a,e=this.i();b.parentNode&&(!d||a!=b.id);b=b.parentNode)if(b==e)return!0;return!1};k.Sja=function(){var a=this.i();"A"!=a.tagName&&(a=C.Ic(a,"a",0));a.setAttribute("aria-pressed","true")};k.Bja=function(){var a=this.i();"A"!=a.tagName&&(a=C.Ic(a,"a",0));a.setAttribute("aria-pressed","false")};
k.Rja=function(){var a=this.i();"A"!=a.tagName&&(a=C.Ic(a,"a",0));var b="button"==a.getAttribute("role").toLowerCase()?"aria-pressed":"aria-checked";a.setAttribute(b,"true")};k.Aja=function(){var a=this.i();"A"!=a.tagName&&(a=C.Ic(a,"a",0));var b="button"==a.getAttribute("role").toLowerCase()?"aria-pressed":"aria-checked";a.setAttribute(b,"false")};k.SG=function(){var a=this.i();"A"!=a.tagName&&(a=C.Ic(a,"a",0));a.setAttribute("aria-disabled","true")};
k.FG=function(){var a=this.i();"A"!=a.tagName&&(a=C.Ic(a,"a",0));a.removeAttribute("aria-disabled")};