var In=I.ea(I,"AdfDhtmlChooseNumberSpinwheelPeer");m("AdfDhtmlChooseNumberSpinwheelPeer",In);In.C=function(){this.sea=0;this.ODa=15;this.$7a=5;this.mDa=27;this.LFa=2;this.G2a=this.$3a=80;this.PS=2E3;this.dha="AFWheelItemPos";I.sb(this,AdfRichChooseNumberSpinwheel.VALUE);I.hc(this,AdfRichChooseNumberSpinwheel.VALUE);I.ra(this,D.Nd,D.Pc,D.wb,D.Bc,D.hh);r.bb(qi)};m("AdfDhtmlChooseNumberSpinwheelPeer.InitSubclass",In.C);
In.prototype.G=function(a,b){In.h.G.call(this,a,b);this.tb(a,b);In.C9a(a);u.assert("DIV"==b.nodeName);In.zlb(a,b);var d=In.web(a),e=a.getStepSize(),f=a.getMinimum(),g=a.getMaximum(),h=In.tfb(f,g,e);if(h<=In.$7a){var l=this.f();l.A5=!0;e=document.createDocumentFragment();for(l=l.getStepSize();f<=g;f+=l){var n=f-d;Jn(this,f,In.sM()+n,e)}}else{e=document.createDocumentFragment();l=In.sM();Jn(this,d,l+"0",e);for(var n=this.f().getStepSize(),t=d,y=1,h=h/2;y<=h;y++)t+=n,t>g&&(t=f),Jn(this,t,l+y,e),d-=n,
d<f&&(d=g),Jn(this,d,l+-y,e,!0)}this.i().appendChild(e);a.Nha(!0);g={};g[qi.MODE]=qi.VJ;g[qi.gda]=!0;g[qi.nba]=a;f={};f[qi.dE]=this.D(this.sx);f[qi.x0]=this.D(this.UF);f[qi.jK]=this.D(this.Vka);a.rnb=new qi(b,f,g);a.ij=this.D(this.du);b.addEventListener("wheel",a.ij)};r.a("AdfDhtmlChooseNumberSpinwheelPeer.prototype.InitDomElement",{G:In.prototype.G});In.prototype.ka=function(a){this.bind(a);a.rnb.release();this.i().removeEventListener("wheel",a.ij);In.h.ka.call(this,a)};
r.a("AdfDhtmlChooseNumberSpinwheelPeer.prototype.ComponentRemoved",{ka:In.prototype.ka});In.C9a=function(a){var b=a.TY();0!==b.length&&(a.setMaximum(b.length-1),a.setMinimum(0),a.Jwb(1))};In.web=function(a){var b=a.getValue();return isNaN(b)?In.sea>=a.getMinimum()&&In.sea<=a.getMaximum()?In.sea:a.getMinimum():b};In.prototype.Ff=function(a,b,d){u.Da(d);b=a.TY();b=Kn(this,b[d],!1);void 0!==b?Ln(this,b):Mn(this,a,d);return!1};r.a("AdfDhtmlChooseNumberSpinwheelPeer.prototype.ComponentValueChanged",{Ff:In.prototype.Ff});
In.prototype.vk=function(a,b){var d=b.getAttribute("aria-valuenow");return parseInt(d)};r.a("AdfDhtmlChooseNumberSpinwheelPeer.prototype.GetComponentValue",{vk:In.prototype.vk});function Jn(a,b,d,e,f){var g=document.createElement("div");g.setAttribute("class",d);d=a.f().TY();if(0!==d.length)a=d[b];else{d=b;(b=0>d)&&(d=Math.abs(d));d+="";for(a=a.f().Tvb();d.length<a;)d="0"+d;a=b?"-"+d:d}g.textContent=a;f?e.insertBefore(g,e.firstChild):e.appendChild(g)}
In.zlb=function(a,b){b.setAttribute("role","spinbutton");b.setAttribute("aria-valuemin",a.getMinimum());b.setAttribute("aria-valuemax",a.getMaximum());var d=a.getLabel();null!=d&&b.setAttribute("aria-label",d);d=a.getValue();if(!isNaN(d)){b.setAttribute("aria-valuenow",d);var e=a.TY();0!==e.length&&b.setAttribute("aria-valuetext",e[d])}b.setAttribute("tabindex","0");d=A.c.H().getStyleClass("af|chooseNumberSpinwheel");C.w(b,d)};
In.tfb=function(a,b,d){a=(b-a)/d;if(0>a){if(isNaN(component.getValue()))throw"Combination of maximum, minimum and stepSize is invalid for component: "+component.g();a=1}return In.ODa>a?a:In.ODa};k=In.prototype;k.du=function(a){q.b.preventDefault(a);var b=a.target;"spinbutton"!==b.getAttribute("role")&&(b=b.parentElement);"spinbutton"===b.getAttribute("role")&&(J.va(b),b=A.c.m(b.id),this.bind(b),a=a.deltaY,a>In.LFa?this.Mx(b):a<-In.LFa&&this.Nx(b))};
k.sx=function(a,b){this.bind(b);this.Cr||(J.va(this.i()),this.Cr=!0,this.xja=0);var d=this.xja-a.deltaY;d>In.mDa?(this.xja=a.deltaY,this.Nx(b)):d<-In.mDa&&(this.xja=a.deltaY,this.Mx(b))};k.UF=function(){this.Cr=null};k.Vka=function(a,b){this.Cr=null;this.bind(b);for(var d=Math.floor(a.Xaa*this.i().offsetHeight/In.$3a),e=0<a.deltaY?this.Mx:this.Nx,f=A.c,g=0;g<d;g++)f.ta(this,e,b,In.G2a*g,{isSynchronized:!0})};
k.Mx=function(a){this.bind(a);var b=this.i(),d=b.lastElementChild;if(d){var e=In.Z4(d),f=d;if(a.A5){if(0==e+1-b.childElementCount)return;e++}else f=d.previousElementSibling,b.removeChild(d);for(;f;)f.setAttribute("class",In.sM()+e),0===e&&Nn(this,f),e--,f=f.previousElementSibling;a.A5||(d=parseInt(b.firstElementChild.textContent)-a.getStepSize(),f=a.getMinimum(),d=d<f?a.getMaximum()+1-(f-d):d,Jn(this,d,In.sM()+e,b,!0))}};
k.Nx=function(a){this.bind(a);var b=this.i(),d=b.firstElementChild;if(d){var e=In.Z4(d),f=d;if(a.A5){if(0==e-1+b.childElementCount)return;e--}else f=d.nextElementSibling,b.removeChild(d);for(;f;)f.setAttribute("class",In.sM()+e),0===e&&Nn(this,f),e++,f=f.nextElementSibling;a.A5||(d=parseInt(b.lastElementChild.textContent)+a.getStepSize(),f=a.getMaximum(),d=d>f?a.getMinimum()-1+(d-f):d,Jn(this,d,In.sM()+e,b))}};
function Nn(a,b){var d=a.i(),e=b.textContent,f=parseInt(e);isNaN(f)?(d.setAttribute("aria-valuetext",e),d.setAttribute("aria-valuenow",a.f().TY().indexOf(e))):d.setAttribute("aria-valuenow",f)}In.Z4=function(a){a=a.getAttribute("class");return parseInt(a.slice(a.indexOf(In.dha)+In.dha.length))};In.prototype.Ta=function(){var a=this.f();a.Gi=a.getValue()};r.a("AdfDhtmlChooseNumberSpinwheelPeer.prototype.HandleComponentFocus",{Ta:In.prototype.Ta});
In.prototype.Lb=function(){var a=this.f(),b=a.getValue();b!==a.Gi&&lc.F(a,a.Gi,b,!1)};r.a("AdfDhtmlChooseNumberSpinwheelPeer.prototype.HandleComponentBlur",{Lb:In.prototype.Lb});In.prototype.M=function(a){a=a.X();a=In.Z4(a);isNaN(a)||Ln(this,a)};r.a("AdfDhtmlChooseNumberSpinwheelPeer.prototype.HandleComponentClick",{M:In.prototype.M});
In.prototype.ma=function(a){var b=this.f(),d=a.na();d===w.Ra?(a.cancel(),this.Mx(b)):d===w.ab?(a.cancel(),this.Nx(b)):d===w.uz&&void 0!==b.Zh&&(b.Zh=b.Zh.slice(0,-1),this.i().setAttribute("title",b.Zh))};r.a("AdfDhtmlChooseNumberSpinwheelPeer.prototype.HandleComponentKeyDown",{ma:In.prototype.ma});
In.prototype.Yb=function(a){var b=this.f();void 0===b.Zh&&(b.Zh="");b.Zh+=a.U().key;a=b.Zh;var d;a:if(d=b.TY(),0===d.length)d=!1;else{var e=Kn(this,a,!0);if(void 0!==e)Ln(this,e),d=!0;else{for(var e=0,f=d.length;e<f;e++)if(In.e6(d[e],a,!0)){d=b.getValue();Ln(this,e-d);d=!0;break a}d=void 0}}d||Mn(this,b,a);this.i().setAttribute("title",b.Zh);a=A.c;b.nG?a.Ds(b.nG,In.PS):b.nG=a.ta(null,In.Qia,b,In.PS)};r.a("AdfDhtmlChooseNumberSpinwheelPeer.prototype.HandleComponentKeyPress",{Yb:In.prototype.Yb});
function Mn(a,b,d){d=parseInt(d);if(!isNaN(d)){var e=Kn(a,d,!1);if(void 0!==e)Ln(a,e);else{for(var e=b.getValue(),f=b.getStepSize(),g=e,h=b.getMaximum();g<=h;g+=f)if(g===d){Ln(a,(g-e)/f);return}g=e;for(b=b.getMinimum();g>=b;g-=f)if(g===d){Ln(a,(g-e)/f);break}}}}function Ln(a,b){var d=a.f(),e=0>b?a.Mx:a.Nx;b=Math.abs(b);i=0;for(b=Math.abs(b);i<b;i++)e.call(a,d)}function Kn(a,b,d){for(a=a.i().firstElementChild;a;){if(In.e6(a.textContent,b,d))return In.Z4(a);a=a.nextElementSibling}}
In.sM=function(){In.MFa||(In.MFa=A.c.H().getStyleClass("af|chooseNumberSpinwheel::item")+" "+In.dha);return In.MFa};In.e6=function(a,b,d){return d?0===a.toLowerCase().indexOf(b.toLowerCase()):a==b};In.Qia=function(a){delete a.nG;delete a.Zh;I.Fb(a).removeAttribute("title")};