var Gn=I.ea(I,"AdfDhtmlChooseNumberSpinwheelPeer");m("AdfDhtmlChooseNumberSpinwheelPeer",Gn);Gn.C=function(){this.qea=0;this.KDa=15;this.X7a=5;this.iDa=27;this.HFa=2;this.B2a=this.X3a=80;this.PS=2E3;this.bha="AFWheelItemPos";I.sb(this,AdfRichChooseNumberSpinwheel.VALUE);I.hc(this,AdfRichChooseNumberSpinwheel.VALUE);I.ra(this,D.Nd,D.Oc,D.wb,D.Bc,D.gh);r.bb(oi)};m("AdfDhtmlChooseNumberSpinwheelPeer.InitSubclass",Gn.C);
Gn.prototype.G=function(a,b){Gn.h.G.call(this,a,b);this.tb(a,b);Gn.z9a(a);u.assert("DIV"==b.nodeName);Gn.ylb(a,b);var d=Gn.veb(a),e=a.getStepSize(),f=a.getMinimum(),g=a.getMaximum(),h=Gn.sfb(f,g,e);if(h<=Gn.X7a){var l=this.f();l.A5=!0;e=document.createDocumentFragment();for(l=l.getStepSize();f<=g;f+=l){var n=f-d;Hn(this,f,Gn.sM()+n,e)}}else{e=document.createDocumentFragment();l=Gn.sM();Hn(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),Hn(this,t,l+y,e),d-=n,
d<f&&(d=g),Hn(this,d,l+-y,e,!0)}this.i().appendChild(e);a.Lha(!0);g={};g[oi.MODE]=oi.VJ;g[oi.eda]=!0;g[oi.lba]=a;f={};f[oi.dE]=this.D(this.rx);f[oi.x0]=this.D(this.UF);f[oi.jK]=this.D(this.Ska);a.rnb=new oi(b,f,g);a.hj=this.D(this.cu);b.addEventListener("wheel",a.hj)};r.a("AdfDhtmlChooseNumberSpinwheelPeer.prototype.InitDomElement",{G:Gn.prototype.G});Gn.prototype.ka=function(a){this.bind(a);a.rnb.release();this.i().removeEventListener("wheel",a.hj);Gn.h.ka.call(this,a)};
r.a("AdfDhtmlChooseNumberSpinwheelPeer.prototype.ComponentRemoved",{ka:Gn.prototype.ka});Gn.z9a=function(a){var b=a.TY();0!==b.length&&(a.setMaximum(b.length-1),a.setMinimum(0),a.Hwb(1))};Gn.veb=function(a){var b=a.getValue();return isNaN(b)?Gn.qea>=a.getMinimum()&&Gn.qea<=a.getMaximum()?Gn.qea:a.getMinimum():b};Gn.prototype.Ff=function(a,b,d){u.Da(d);b=a.TY();b=In(this,b[d],!1);void 0!==b?Jn(this,b):Kn(this,a,d);return!1};r.a("AdfDhtmlChooseNumberSpinwheelPeer.prototype.ComponentValueChanged",{Ff:Gn.prototype.Ff});
Gn.prototype.vk=function(a,b){var d=b.getAttribute("aria-valuenow");return parseInt(d)};r.a("AdfDhtmlChooseNumberSpinwheelPeer.prototype.GetComponentValue",{vk:Gn.prototype.vk});function Hn(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().Rvb();d.length<a;)d="0"+d;a=b?"-"+d:d}g.textContent=a;f?e.insertBefore(g,e.firstChild):e.appendChild(g)}
Gn.ylb=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)};
Gn.sfb=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 Gn.KDa>a?a:Gn.KDa};k=Gn.prototype;k.cu=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>Gn.HFa?this.Lx(b):a<-Gn.HFa&&this.Mx(b))};
k.rx=function(a,b){this.bind(b);this.Br||(J.va(this.i()),this.Br=!0,this.uja=0);var d=this.uja-a.deltaY;d>Gn.iDa?(this.uja=a.deltaY,this.Mx(b)):d<-Gn.iDa&&(this.uja=a.deltaY,this.Lx(b))};k.UF=function(){this.Br=null};k.Ska=function(a,b){this.Br=null;this.bind(b);for(var d=Math.floor(a.Vaa*this.i().offsetHeight/Gn.X3a),e=0<a.deltaY?this.Lx:this.Mx,f=A.c,g=0;g<d;g++)f.ta(this,e,b,Gn.B2a*g,{isSynchronized:!0})};
k.Lx=function(a){this.bind(a);var b=this.i(),d=b.lastElementChild;if(d){var e=Gn.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",Gn.sM()+e),0===e&&Ln(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,Hn(this,d,Gn.sM()+e,b,!0))}};
k.Mx=function(a){this.bind(a);var b=this.i(),d=b.firstElementChild;if(d){var e=Gn.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",Gn.sM()+e),0===e&&Ln(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,Hn(this,d,Gn.sM()+e,b))}};
function Ln(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)}Gn.Z4=function(a){a=a.getAttribute("class");return parseInt(a.slice(a.indexOf(Gn.bha)+Gn.bha.length))};Gn.prototype.Ta=function(){var a=this.f();a.Fi=a.getValue()};r.a("AdfDhtmlChooseNumberSpinwheelPeer.prototype.HandleComponentFocus",{Ta:Gn.prototype.Ta});
Gn.prototype.Lb=function(){var a=this.f(),b=a.getValue();b!==a.Fi&&lc.F(a,a.Fi,b,!1)};r.a("AdfDhtmlChooseNumberSpinwheelPeer.prototype.HandleComponentBlur",{Lb:Gn.prototype.Lb});Gn.prototype.M=function(a){a=a.X();a=Gn.Z4(a);isNaN(a)||Jn(this,a)};r.a("AdfDhtmlChooseNumberSpinwheelPeer.prototype.HandleComponentClick",{M:Gn.prototype.M});
Gn.prototype.ma=function(a){var b=this.f(),d=a.na();d===w.Ra?(a.cancel(),this.Lx(b)):d===w.ab?(a.cancel(),this.Mx(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:Gn.prototype.ma});
Gn.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=In(this,a,!0);if(void 0!==e)Jn(this,e),d=!0;else{for(var e=0,f=d.length;e<f;e++)if(Gn.e6(d[e],a,!0)){d=b.getValue();Jn(this,e-d);d=!0;break a}d=void 0}}d||Kn(this,b,a);this.i().setAttribute("title",b.Zh);a=A.c;b.nG?a.Cs(b.nG,Gn.PS):b.nG=a.ta(null,Gn.Nia,b,Gn.PS)};r.a("AdfDhtmlChooseNumberSpinwheelPeer.prototype.HandleComponentKeyPress",{Yb:Gn.prototype.Yb});
function Kn(a,b,d){d=parseInt(d);if(!isNaN(d)){var e=In(a,d,!1);if(void 0!==e)Jn(a,e);else{for(var e=b.getValue(),f=b.getStepSize(),g=e,h=b.getMaximum();g<=h;g+=f)if(g===d){Jn(a,(g-e)/f);return}g=e;for(b=b.getMinimum();g>=b;g-=f)if(g===d){Jn(a,(g-e)/f);break}}}}function Jn(a,b){var d=a.f(),e=0>b?a.Lx:a.Mx;b=Math.abs(b);i=0;for(b=Math.abs(b);i<b;i++)e.call(a,d)}function In(a,b,d){for(a=a.i().firstElementChild;a;){if(Gn.e6(a.textContent,b,d))return Gn.Z4(a);a=a.nextElementSibling}}
Gn.sM=function(){Gn.IFa||(Gn.IFa=A.c.H().getStyleClass("af|chooseNumberSpinwheel::item")+" "+Gn.bha);return Gn.IFa};Gn.e6=function(a,b,d){return d?0===a.toLowerCase().indexOf(b.toLowerCase()):a==b};Gn.Nia=function(a){delete a.nG;delete a.Zh;I.Fb(a).removeAttribute("title")};