-
Notifications
You must be signed in to change notification settings - Fork 76
/
steelseries-min.js
7 lines (7 loc) · 209 KB
/
steelseries-min.js
1
2
3
4
5
6
7
/*!
* Name : steelseries.js
* Author : Gerrit Grunwald, Mark Crossley
* Last modified : 14.12.2011
* Revision : 0.9.1
*/
var steelseries=function(){function tt(n,t){var i="#"===n.charAt(0)?n.substring(1,7):n,f=parseInt(i.substring(0,2),16),u=parseInt(i.substring(2,4),16),r=parseInt(i.substring(4,6),16);return this.color="rgba("+f+","+u+","+r+","+t+")",this}function ti(t,i,r,u){var f=1/255,y=t.getRed(),v=t.getGreen(),a=t.getBlue(),b=t.getAlpha(),w=i.getRed()-t.getRed(),p=i.getGreen()-t.getGreen(),s=i.getBlue()-t.getBlue(),o=i.getAlpha()*f-t.getAlpha()*f,e=w/r,l=p/r,c=s/r,h=o/r;return new n((y+e*u).toFixed(0),(v+l*u).toFixed(0),(a+c*u).toFixed(0),b+h*u)}function lu(n,t,i){return{start:n,stop:t,color:i}}function f(n,t){var u=Math.floor(Math.log10(n)),r=n/Math.pow(10,u),i;return i=t?1.5>r?1:3>r?2:7>r?5:10:1<r?2<r?5<r?10:5:2:1,i*Math.pow(10,u)}function e(n,t,i,r,u,f){var e=t+r,o=i+u;n.beginPath(),n.moveTo(t+f,i),n.lineTo(e-f,i),n.quadraticCurveTo(e,i,e,i+f),n.lineTo(e,i+u-f),n.quadraticCurveTo(e,o,e-f,o),n.lineTo(t+f,o),n.quadraticCurveTo(t,o,t,o-f),n.lineTo(t,i+f),n.quadraticCurveTo(t,i,t+f,i)}function t(n,t){var i=r.createElement("canvas");return i.width=n,i.height=t,i}function ii(n,t,i){var u=r.createElement("canvas");return u.width=n,u.height=t,i(u.getContext("2d")),u}function k(n){var t,i=ii(1,1,function(t){t.fillStyle=n,t.beginPath(),t.rect(0,0,1,1),t.fill()});return t=i.getContext("2d").getImageData(0,0,2,2).data,[t[0],t[1],t[2],t[3]]}function pt(t){var o,e,f,s,u,r=k(t),i=new n(r[0],r[1],r[2],r[3]);return o=yi(i,.32),e=yi(i,.62),f=ri(i,.84),s=ri(i,.94),u=ri(i,1),new l(o,e,i,f,s,u)}function hu(n,t,i){var u;n/=255,t/=255,i/=255;var f=Math.max(n,t,i),e=Math.min(n,t,i),r,o,s=(f+e)/2;if(f===e)r=o=0;else{u=f-e,o=s>.5?u/(2-f-e):u/(f+e);switch(f){case n:r=(t-i)/u+(t<i?6:0);break;case t:r=(i-n)/u+2;break;case i:r=(n-t)/u+4}r/=6}return[r,o,s]}function lt(n,t,i){var f,u,r,c=Math.floor(n*6),h=n*6-c,e=i*(1-t),o=i*(1-h*t),s=i*(1-(1-h)*t);switch(c%6){case 0:f=i,u=s,r=e;break;case 1:f=o,u=i,r=e;break;case 2:f=e,u=i,r=s;break;case 3:f=e,u=o,r=i;break;case 4:f=s,u=e,r=i;break;case 5:f=i,u=e,r=o}return[Math.floor(f*255),Math.floor(u*255),Math.floor(r*255)]}function g(n,t,i){n=n/255,t=t/255,i=i/255;var u=Math.max(n,t,i),e=Math.min(n,t,i),r,o,s=u,f=u-e;o=u==0?0:f/u;if(u==e)r=0;else{switch(u){case n:r=(t-i)/f+(t<i?6:0);break;case t:r=(i-n)/f+2;break;case i:r=(n-t)/f+4}r/=6}return[r,o,s]}function yi(t,i){var r=Math.floor(t.getRed()*(1-i)),f=Math.floor(t.getGreen()*(1-i)),u=Math.floor(t.getBlue()*(1-i));return r=r<0?0:r>255?255:r,f=f<0?0:r>255?255:f,u=u<0?0:u>255?255:u,new n(r,f,u,t.getAlpha())}function ri(t,i){var r=Math.round(t.getRed()*(1+i)),f=Math.round(t.getGreen()*(1+i)),u=Math.round(t.getBlue()*(1+i));return r=r<0?0:r>255?255:r,f=f<0?0:r>255?255:f,u=u<0?0:u>255?255:u,new n(r,f,u,t.getAlpha())}function eu(n,t,i){if(i<=t)throw"Rotary bounds are of negative or zero size";var r=i-t,u=Math.floor((n-t)/r);return n-u*r}function ni(n,t){return eu(t-n,-180,180)}var r=document,li=function(n,i){var pi;i=i||{};var ut=undefined===i.gaugeType?steelseries.GaugeType.TYPE4:i.gaugeType,e=undefined===i.size?200:i.size,c=undefined===i.minValue?0:i.minValue,k=undefined===i.maxValue?c+100:i.maxValue,nf=undefined===i.niceScale?!0:i.niceScale,bt=undefined===i.threshold?(k-c)/2:i.threshold,kt=undefined===i.section?null:i.section,ti=undefined===i.area?null:i.area,tu=undefined===i.titleString?"":i.titleString,hr=undefined===i.unitString?"":i.unitString,pr=undefined===i.frameDesign?steelseries.FrameDesign.METAL:i.frameDesign,ku=undefined===i.frameVisible?!0:i.frameVisible,wt=undefined===i.backgroundColor?steelseries.BackgroundColor.DARK_GRAY:i.backgroundColor,ir=undefined===i.pointerType?steelseries.PointerType.TYPE1:i.pointerType,ur=undefined===i.pointerColor?steelseries.ColorDef.RED:i.pointerColor,bu=undefined===i.knobType?steelseries.KnobType.STANDARD_KNOB:i.knobType,dt=undefined===i.knobStyle?steelseries.KnobStyle.SILVER:i.knobStyle,ri=undefined===i.lcdColor?steelseries.LcdColor.STANDARD:i.lcdColor,or=undefined===i.lcdVisible?!0:i.lcdVisible,lr=undefined===i.lcdDecimals?2:i.lcdDecimals,gu=undefined===i.digitalFont?!1:i.digitalFont,du=undefined===i.fractionalScaleDecimals?1:i.fractionalScaleDecimals,rr=undefined===i.ledColor?steelseries.LedColor.RED_LED:i.ledColor,ru=undefined===i.ledVisible?!0:i.ledVisible,fu=undefined===i.thresholdVisible?!0:i.thresholdVisible,er=undefined===i.minMeasuredValueVisible?!1:i.minMeasuredValueVisible,tr=undefined===i.maxMeasuredValueVisible?!1:i.maxMeasuredValueVisible,gr=undefined===i.foregroundType?steelseries.ForegroundType.TYPE1:i.foregroundType,yu=undefined===i.labelNumberFormat?steelseries.LabelNumberFormat.STANDARD:i.labelNumberFormat,fr=undefined===i.playAlarm?!1:i.playAlarm,nu=undefined===i.alarmSound?!1:i.alarmSound,vu=undefined===i.customLayer?null:i.customLayer,wu=undefined===i.tickLabelOrientation?ut===steelseries.GaugeType.TYPE1?steelseries.TickLabelOrientation.TANGENT:steelseries.TickLabelOrientation.NORMAL:i.tickLabelOrientation;fr&&nu!==!1&&(pi=r.createElement("audio"),pi.setAttribute("src",nu),pi.setAttribute("preload","auto"));var a=c,pu=this,ni=k,gt=c,et=!1,uu=0,ii,fi,it,gi,ft,st,wi=it+(a-c)*st,u=r.getElementById(n).getContext("2d");u.save(),u.clearRect(0,0,u.canvas.width,u.canvas.height),u.canvas.width=e,u.canvas.height=e;var h=e,l=e,d=h/2,g=l/2,of=.6*h,ef=.4*l,hf=Math.floor(h/10)+"px sans-serif",sf=Math.floor(h/10)+"px LCDMono2Ultra",rt=Math.PI/2,rf=Math.PI/180,ou=!1,bi=c,nr=k,si=k-c,lt=nr-bi,di=0,ct=0,ei=10,kr=10,tf=function(){nf?(si=f(k-c,!1),ct=f(si/(kr-1),!0),bi=Math.floor(c/ct)*ct,nr=Math.ceil(k/ct)*ct,di=f(ct/(ei-1),!0),c=bi,k=nr,lt=k-c):(si=k-c,bi=c,nr=k,lt=si,ct=f(si/(kr-1),!0),di=f(ct/(ei-1),!0));switch(ut.type){case"type1":fi=0,it=Math.PI,gi=rt,ft=rt,st=ft/lt;break;case"type2":fi=0,it=Math.PI,gi=rt,ft=Math.PI,st=ft/lt;break;case"type3":fi=0,it=rt,gi=0,ft=1.5*Math.PI,st=ft/lt;break;case"type4":default:fi=60*rf,it=rt+fi/2,gi=0,ft=2*Math.PI-fi,st=ft/lt}wi=it+(a-c)*st},vi=t(e,e),sr=vi.getContext("2d"),hi=t(e,e),nt=hi.getContext("2d"),yr,ui=t(e*.093457,e*.093457),cr=ui.getContext("2d"),vt=t(e*.093457,e*.093457),vr=vt.getContext("2d"),oi=vt,br=t(Math.ceil(e*.028037),Math.ceil(e*.028037)),ff=br.getContext("2d"),ar=t(Math.ceil(e*.028037),Math.ceil(e*.028037)),uf=ar.getContext("2d"),ai=t(e,e),wr=ai.getContext("2d"),yi=t(e,e),eu=yi.getContext("2d"),ci=t(e,e),pt=ci.getContext("2d"),li=t(e,e),dr=li.getContext("2d"),au=function(n){u.save(),u.textAlign="right",u.textBaseline="middle",u.strokeStyle=ri.textColor,u.fillStyle=ri.textColor,(ri===steelseries.LcdColor.STANDARD||ri===steelseries.LcdColor.STANDARD_GREEN)&&(u.shadowColor="gray",u.shadowOffsetX=h*.007,u.shadowOffsetY=h*.007,u.shadowBlur=h*.009),u.font=gu?sf:hf,u.fillText(n.toFixed(lr),(h+h*.4)/2-2,h*.63,h*.4),u.restore()},hu=function(n){n.save(),"type1"===ut.type&&n.drawImage(s(Math.ceil(l*.037383),steelseries.KnobType.STANDARD_KNOB,dt),h*.523364,l*.130841),("type1"===ut.type||"type2"===ut.type)&&n.drawImage(s(Math.ceil(l*.037383),steelseries.KnobType.STANDARD_KNOB,dt),h*.130841,l*.514018),("type2"===ut.type||"type3"===ut.type)&&n.drawImage(s(Math.ceil(l*.037383),steelseries.KnobType.STANDARD_KNOB,dt),h*.831775,l*.514018),"type3"===ut.type&&n.drawImage(s(Math.ceil(l*.037383),steelseries.KnobType.STANDARD_KNOB,dt),h*.523364,l*.831775),"type4"===ut.type&&(n.drawImage(s(Math.ceil(l*.037383),steelseries.KnobType.STANDARD_KNOB,dt),h*.336448,l*.803738),n.drawImage(s(Math.ceil(l*.037383),steelseries.KnobType.STANDARD_KNOB,dt),h*.626168,l*.803738)),n.restore()},su=function(){var t=r.createElement("canvas"),n,i;return t.width=Math.ceil(e*.046728),t.height=Math.ceil(t.width*.9),n=t.getContext("2d"),n.save(),i=n.createLinearGradient(0,.1,0,t.height*.9),i.addColorStop(0,"#520000"),i.addColorStop(.3,"#fc1d00"),i.addColorStop(.59,"#fc1d00"),i.addColorStop(1,"#520000"),n.fillStyle=i,n.beginPath(),n.moveTo(t.width*.5,.1),n.lineTo(t.width*.9,t.height*.9),n.lineTo(t.width*.1,t.height*.9),n.lineTo(t.width*.5,.1),n.closePath(),n.fill(),n.strokeStyle="#FFFFFF",n.stroke(),n.restore(),t},iu=function(n,t,i,r,u){n.save(),n.strokeStyle=r,n.fillStyle=r,n.lineWidth=h*.035;var f=ft/lt*t-ft/lt*c,e=f+(i-t)/(lt/ft);n.translate(d,g),n.rotate(it),n.beginPath(),u?(n.moveTo(0,0),n.arc(0,0,h*.365-n.lineWidth/2,f,e,!1)):n.arc(0,0,h*.365,f,e,!1),n.moveTo(0,0),n.closePath(),u?n.fill():n.stroke(),n.translate(-d,-g),n.restore()},cu=function(n,t){var y,v,a,s;wt.labelColor.setAlpha(1),n.save(),n.textAlign="center",n.textBaseline="middle",y=Math.ceil(h*.04),n.font=y+"px sans-serif",n.strokeStyle=wt.labelColor.getRgbaColor(),n.fillStyle=wt.labelColor.getRgbaColor(),n.translate(d,g),n.rotate(it);var o=it,i=st*di,r,e=c,u=ei-1,l=h*.38,w=h*.35,nt=h*.355,b=h*.36,p=h*.3,f=h*.1;for((ut.type==="type1"||ut.type==="type2")&&(f=h*.035),v=ei/2,a=parseFloat(k.toFixed(2)),s=c;parseFloat(s.toFixed(2))<=a;s+=di){r=i+rt,u++;if(u===ei){n.lineWidth=1.5,n.beginPath(),n.moveTo(l,0),n.lineTo(w,0),n.closePath(),n.stroke(),n.save(),n.translate(p,0);switch(wu.type){case"horizontal":r=-o;break;case"tangent":r=o<=rt+Math.PI?Math.PI:0;break;case"normal":default:r=rt}n.rotate(r);switch(t.format){case"fractional":n.fillText(e.toFixed(du),0,0,f);break;case"scientific":n.fillText(e.toPrecision(2),0,0,f);break;case"standard":default:n.fillText(e.toFixed(0),0,0,f)}n.translate(-p,0),n.restore(),e+=ct,u=0,n.rotate(i),o+=i;continue}0==ei%2&&u===v?(n.lineWidth=1,n.beginPath(),n.moveTo(l,0),n.lineTo(nt,0),n.closePath(),n.stroke()):(n.lineWidth=.5,n.beginPath(),n.moveTo(l,0),n.lineTo(b,0),n.closePath(),n.stroke()),n.rotate(i),o+=i}n.translate(-d,-g),n.restore()},tt=function(n){var i,t;n=n||{};var u=undefined===n.frame?!1:n.frame,r=undefined===n.background?!1:n.background,f=undefined===n.led?!1:n.led,s=undefined===n.pointer?!1:n.pointer,a=undefined===n.foreground?!1:n.foreground;ou=!0,tf(),u&&ku&&y(sr,pr,d,g,h,l),r&&b(nt,wt,d,g,h,l),r&&ot(nt,vu,d,g,h,l),f&&(cr.drawImage(o(Math.ceil(e*.093457),1,rr),0,0),vr.drawImage(o(Math.ceil(e*.093457),0,rr),0,0)),er&&ff.drawImage(v(Math.ceil(e*.028037),steelseries.ColorDef.BLUE.dark.getRgbaColor(),!0,!0),0,0),tr&&uf.drawImage(v(Math.ceil(e*.028037),steelseries.ColorDef.RED.medium.getRgbaColor(),!0),0,0);if(r){hu(nt);if(null!==kt&&0<kt.length){i=kt.length;do i--,iu(nt,kt[i].start,kt[i].stop,kt[i].color,!1);while(0<i)}if(null!==ti&&0<ti.length){t=ti.length;do t--,iu(nt,ti[t].start,ti[t].stop,ti[t].color,!0);while(0<t)}cu(nt,yu),fu&&(nt.save(),nt.translate(d,g),nt.rotate(it+(bt-c)*st+rt),nt.translate(-d,-g),nt.drawImage(su(),h*.480369,l*.13),nt.translate(d,g),nt.restore()),at(nt,h,l,tu,hr,wt,!0,!0),or&&(yr=w(h*.4,l*.15,ri),nt.drawImage(yr,(h-h*.4)/2,l*.55))}s&&(ht(wr,h,ir,ur,wt.labelColor,!1),ht(eu,h,ir,ur,wt.labelColor,!0)),a&&p(dr,gr,h,l,!0,bu,dt,ut)},yt=function(n){n=n||{};var u=undefined===n.frame?!1:n.frame,f=undefined===n.background?!1:n.background,r=undefined===n.led?!1:n.led,t=undefined===n.pointer?!1:n.pointer,i=undefined===n.foreground?!1:n.foreground;u&&(vi.width=e,vi.height=e,sr=vi.getContext("2d")),f&&(hi.width=e,hi.height=e,nt=hi.getContext("2d")),r&&(ui.width=Math.ceil(e*.093457),ui.height=Math.ceil(e*.093457),cr=ui.getContext("2d"),vt.width=Math.ceil(e*.093457),vt.height=Math.ceil(e*.093457),vr=vt.getContext("2d"),oi=vt),t&&(ai.width=e,ai.height=e,wr=ai.getContext("2d"),yi.width=e,yi.height=e,eu=yi.getContext("2d"),ci.width=e,ci.height=e,pt=ci.getContext("2d")),i&&(li.width=e,li.height=e,dr=li.getContext("2d"))},ki=function(n){n?uu=setInterval(lu,1e3):clearInterval(uu)},lu=function(){ru&&(oi=oi===ui?vt:ui,pu.repaint())};return this.setValue=function(n){var t=n<c?c:n>k?k:n;a!==t&&(a=t,a>gt&&(gt=a),a<ni&&(ni=a),a<bt||et?a<bt&&(et=!1,ki(et),fr&&pi.pause()):(et=!0,ki(et),fr&&pi.play()),this.repaint())},this.getValue=function(){return a},this.setValueAnimated=function(n){var i=n<c?c:n>k?k:n,t;a!==i&&(undefined!==ii&&ii.playing&&ii.stop(),ii=new Tween({},"",Tween.regularEaseInOut,a,i,1),t=this,ii.onMotionChanged=function(n){a=n.target._pos,a<bt||et?a<bt&&(et=!1,ki(et)):(et=!0,ki(et)),a>gt&&(gt=a),a<ni&&(ni=a),t.repaint()},ii.start())},this.resetMinMeasuredValue=function(){ni=a,this.repaint()},this.resetMaxMeasuredValue=function(){gt=a,this.repaint()},this.setMinMeasuredValueVisible=function(n){er=n,this.repaint()},this.setMaxMeasuredValueVisible=function(n){tr=n,this.repaint()},this.setMaxMeasuredValue=function(n){var t=n<c?c:n>k?k:n;gt=t,this.repaint()},this.setMinMeasuredValue=function(n){var t=n<c?c:n>k?k:n;ni=t,this.repaint()},this.setTitleString=function(n){tu=n,tt({background:!0})},this.setUnitString=function(n){hr=n,tt({background:!0})},this.setMinValue=function(n){c=n,tt({background:!0})},this.getMinValue=function(){return c},this.setMaxValue=function(n){k=n,tt({background:!0})},this.getMaxValue=function(){return k},this.setThreshold=function(n){var t=n<c?c:n>k?k:n;bt=t,tt({background:!0}),this.repaint()},this.setArea=function(n){ti=n,yt({foreground:!0}),tt({background:!0,foreground:!0}),this.repaint()},this.setSection=function(n){kt=n,yt({foreground:!0}),tt({background:!0,foreground:!0}),this.repaint()},this.setThresholdVisible=function(n){fu=n,this.repaint()},this.setLcdDecimals=function(n){lr=n,this.repaint()},this.setFrameDesign=function(n){yt({frame:!0}),pr=n,tt({frame:!0}),this.repaint()},this.setBackgroundColor=function(n){yt({background:!0,pointer:!0}),wt=n,tt({background:!0,pointer:!0}),this.repaint()},this.setForegroundType=function(n){yt({foreground:!0}),gr=n,tt({foreground:!0}),this.repaint()},this.setPointerType=function(n){yt({pointer:!0}),ir=n,tt({pointer:!0}),this.repaint()},this.setPointerColor=function(n){yt({pointer:!0}),ur=n,tt({pointer:!0}),this.repaint()},this.setLedColor=function(n){yt({led:!0}),rr=n,tt({led:!0}),this.repaint()},this.setLcdColor=function(n){ri=n,tt({background:!0}),this.repaint()},this.repaint=function(){ou||tt({frame:!0,background:!0,led:!0,pointer:!0,foreground:!0}),u.clearRect(0,0,u.canvas.width,u.canvas.height),u.drawImage(vi,0,0),u.drawImage(hi,0,0),or&&au(a),ru&&(a<bt&&(et=!1,oi=vt),u.drawImage(oi,of,ef)),er&&(u.save(),u.translate(d,g),u.rotate(it+rt+(ni-c)*st),u.translate(-d,-g),u.drawImage(br,u.canvas.width*.4865,u.canvas.height*.105),u.restore()),tr&&(u.save(),u.translate(d,g),u.rotate(it+rt+(gt-c)*st),u.translate(-d,-g),u.drawImage(ar,u.canvas.width*.4865,u.canvas.height*.105),u.restore()),wi=it+rt+(a-c)*st;var n=h*.006;pt.clearRect(0,0,h,l),pt.save(),pt.translate(d,g),pt.rotate(wi),pt.translate(-d,-g),pt.drawImage(yi,0,0),pt.restore(),u.drawImage(ci,0,0,h,l,n,n,h+n,l+n),u.save(),u.translate(d,g),u.rotate(wi),u.translate(-d,-g),u.drawImage(ai,0,0),u.restore(),u.drawImage(li,0,0)},this.repaint(),this},cr=function(n,i){var hi;i=i||{};var kt=undefined===i.gaugeType?steelseries.GaugeType.TYPE4:i.gaugeType,s=undefined===i.size?200:i.size,h=undefined===i.minValue?0:i.minValue,l=undefined===i.maxValue?h+100:i.maxValue,dr=undefined===i.niceScale?!0:i.niceScale,ui=undefined===i.threshold?(l-h)/2:i.threshold,vt=undefined===i.section?null:i.section,vr=undefined===i.useSectionColors?!1:i.useSectionColors,ar=undefined===i.titleString?"":i.titleString,cr=undefined===i.unitString?"":i.unitString,lr=undefined===i.frameDesign?steelseries.FrameDesign.METAL:i.frameDesign,uu=undefined===i.frameVisible?!0:i.frameVisible,gt=undefined===i.backgroundColor?steelseries.BackgroundColor.DARK_GRAY:i.backgroundColor,ki=undefined===i.valueColor?steelseries.ColorDef.RED:i.valueColor,ti=undefined===i.lcdColor?steelseries.LcdColor.STANDARD:i.lcdColor,sr=undefined===i.lcdVisible?!0:i.lcdVisible,yu=undefined===i.lcdDecimals?2:i.lcdDecimals,vu=undefined===i.digitalFont?!1:i.digitalFont,pu=undefined===i.fractionalScaleDecimals?1:i.fractionalScaleDecimals,ku=undefined===i.customLayer?null:i.customLayer,nr=undefined===i.ledColor?steelseries.LedColor.RED_LED:i.ledColor,ur=undefined===i.ledVisible?!0:i.ledVisible,bu=undefined===i.labelNumberFormat?steelseries.LabelNumberFormat.STANDARD:i.labelNumberFormat,br=undefined===i.foregroundType?steelseries.ForegroundType.TYPE1:i.foregroundType,gi=undefined===i.playAlarm?!1:i.playAlarm,pr=undefined===i.alarmSound?!1:i.alarmSound,si=undefined===i.valueGradient?null:i.valueGradient,su=undefined===i.useValueGradient?!1:i.useValueGradient,hu=undefined===i.tickLabelOrientation?kt===steelseries.GaugeType.TYPE1?steelseries.TickLabelOrientation.TANGENT:steelseries.TickLabelOrientation.NORMAL:i.tickLabelOrientation;gi&&pr!==!1&&(hi=r.createElement("audio"),hi.setAttribute("src",pr),hi.setAttribute("preload","auto"));var nt=h,rt=l-h,ut=!1,wr=0,ii,it,a,dt,ht,c,et,ft,bt=[],bi=!1,tr=!1,u=r.getElementById(n).getContext("2d");u.save(),u.clearRect(0,0,u.canvas.width,u.canvas.height),u.canvas.width=s,u.canvas.height=s;var e=s,g=s,d=e/2,v=g/2,cu=Math.floor(e/10)+"px sans-serif",lu=Math.floor(e/10)+"px LCDMono2Ultra",tt=Math.PI/2,fu=e*.116822,eu=e*.485981,ou=e*.453271,wu=g*.65,yt=Math.PI/180;switch(kt.type){case"type1":it=0,a=Math.PI,dt=0,ht=tt,c=tt,et=c/Math.PI*180,ft=c/rt;break;case"type2":it=0,a=Math.PI,dt=0,ht=tt,c=Math.PI,et=c/Math.PI*180,ft=c/rt;break;case"type3":it=0,a=tt,dt=-tt,ht=0,c=1.5*Math.PI,et=c/Math.PI*180,ft=c/rt;break;case"type4":default:it=Math.PI/3,a=tt+it/2,dt=Math.PI/-3,ht=0,c=2*Math.PI-it,et=c/Math.PI*180,ft=c/rt}var ci=t(s,s),kr=ci.getContext("2d"),li=t(s,s),ct=li.getContext("2d"),rr,ri=t(Math.ceil(s*.060747),Math.ceil(s*.023364)),di=ri.getContext("2d"),ni=t(Math.ceil(s*.093457),Math.ceil(s*.093457)),ir=ni.getContext("2d"),lt=t(Math.ceil(s*.093457),Math.ceil(s*.093457)),hr=lt.getContext("2d"),wt=lt,au,fi=t(s,s),er=fi.getContext("2d"),or=!1,yi=h,pi=l,oi=l-h;rt=pi-yi;var wi=0,st=0,vi=10,fr=10,nu=function(){dr?(oi=f(l-h,!1),st=f(oi/(fr-1),!0),yi=Math.floor(h/st)*st,pi=Math.ceil(l/st)*st,wi=f(st/(vi-1),!0),h=yi,l=pi,rt=l-h):(oi=l-h,yi=h,pi=l,rt=oi,st=f(oi/(fr-1),!0),wi=f(st/(vi-1),!0));switch(kt.type){case"type1":it=0,a=Math.PI,ht=tt,c=tt,ft=c/rt;break;case"type2":it=0,a=Math.PI,ht=tt,c=Math.PI,ft=c/rt;break;case"type3":it=0,a=tt,ht=0,c=1.5*Math.PI,ft=c/rt;break;case"type4":default:it=60*yt,a=tt+it/2,ht=0,c=2*Math.PI-it,ft=c/rt}angle=a+(nt-h)*ft},k=function(n){var t;n=n||{};var f=undefined===n.frame?!1:n.frame,i=undefined===n.background?!1:n.background,u=undefined===n.led?!1:n.led,c=undefined===n.value?!1:n.value,r=undefined===n.foreground?!1:n.foreground;or=!0,nu(),f&&uu&&y(kr,lr,d,v,e,g),i&&b(ct,gt,d,v,e,g),i&&ot(ct,ku,d,v,e,g),u&&(ir.drawImage(o(Math.ceil(s*.093457),1,nr),0,0),hr.drawImage(o(Math.ceil(s*.093457),0,nr),0,0),au=ct.getImageData(e*.453271,g*.65,Math.ceil(s*.093457),Math.ceil(s*.093457))),i&&(tu(ct,bu),iu(ct),at(ct,e,g,ar,cr,gt,!0,!0),sr&&(rr=w(e*.48,g*.15,ti),ct.drawImage(rr,(e-e*.48)/2,g*.425))),bi=!1;if(vr&&null!==vt&&0<vt.length){bi=!0,t=vt.length,bt=[];do t--,bt.push({start:(vt[t].start+Math.abs(h))/(l-h)*et,stop:(vt[t].stop+Math.abs(h))/(l-h)*et,color:pt(vt[t].color)});while(0<t)}tr=!1,su&&si!==null&&(bi=!1,tr=!0),c&&yr(di,ki),r&&p(er,br,e,g,!1,kt)},ei=function(n){n=n||{};var u=undefined===n.frame?!1:n.frame,f=undefined===n.background?!1:n.background,r=undefined===n.led?!1:n.led,t=undefined===n.value?!1:n.value,i=undefined===n.foreground?!1:n.foreground;u&&(ci.width=s,ci.height=s,kr=ci.getContext("2d")),f&&(li.width=s,li.height=s,ct=li.getContext("2d")),t&&(ri.width=Math.ceil(s*.060747),ri.height=Math.ceil(s*.023364),di=ri.getContext("2d")),r&&(ni.width=Math.ceil(s*.093457),ni.height=Math.ceil(s*.093457),ir=ni.getContext("2d"),lt.width=Math.ceil(s*.093457),lt.height=Math.ceil(s*.093457),hr=lt.getContext("2d"),wt=lt),i&&(fi.width=s,fi.height=s,er=fi.getContext("2d"))},iu=function(n){var t,r,i;n.save(),n.save(),n.lineWidth=17,n.beginPath(),n.translate(d,v),n.rotate(a-4*yt),n.translate(-d,-v),n.arc(d,v,e*.35514,0,c+8*yt,!1),n.rotate(-a),t=n.createLinearGradient(0,.107476*g,0,.897195*g),t.addColorStop(0,"#000000"),t.addColorStop(.22,"#333333"),t.addColorStop(.76,"#333333"),t.addColorStop(1,"#cccccc"),n.strokeStyle=t,n.stroke(),n.restore(),n.save(),n.lineWidth=15,n.beginPath(),n.translate(d,v),n.rotate(a-4*yt),n.translate(-d,-v),n.arc(d,v,e*.35514,0,c+8*yt,!1),n.rotate(-a),r=n.createLinearGradient(0,.112149*g,0,.892523*g),r.addColorStop(0,"#111111"),r.addColorStop(1,"#333333"),n.strokeStyle=r,n.stroke(),n.restore();var f=(e*.116822+e*.060747)/2,o=(e*.485981+e*.023364)/2,u=n.createRadialGradient(f,o,0,f,o,.030373*e);for(u.addColorStop(0,"#3c3c3c"),u.addColorStop(1,"#323232"),i=0;i<=et;i+=5)n.save(),n.translate(d,v),n.rotate(i*yt+dt),n.translate(-d,-v),n.beginPath(),n.rect(e*.116822,e*.485981,e*.060747,e*.023364),n.closePath(),n.fillStyle=u,n.fill(),n.restore();n.restore()},yr=function(n,t){n.save(),n.beginPath(),n.rect(0,0,n.canvas.width,n.canvas.height),n.closePath();var r=n.canvas.width/2,f=n.canvas.height/2,i=u.createRadialGradient(r,f,0,r,f,n.canvas.width/2);i.addColorStop(0,t.light.getRgbaColor()),i.addColorStop(1,t.dark.getRgbaColor()),n.fillStyle=i,n.fill(),n.restore()},ru=function(n){u.save(),u.textAlign="right",u.textBaseline="middle",u.strokeStyle=ti.textColor,u.fillStyle=ti.textColor,(ti===steelseries.LcdColor.STANDARD||ti===steelseries.LcdColor.STANDARD_GREEN)&&(u.shadowColor="gray",u.shadowOffsetX=e*.007,u.shadowOffsetY=e*.007,u.shadowBlur=e*.009),u.font=vu?lu:cu,u.fillText(n.toFixed(yu),(e+e*.48)/2-2,e*.5,e*.48),u.restore()},tu=function(n,t){var y,p,s;gt.labelColor.setAlpha(1),n.save(),n.textAlign="center",n.textBaseline="middle",y=Math.ceil(e*.04),n.font=y+"px sans-serif",n.strokeStyle=gt.labelColor.getRgbaColor(),n.fillStyle=gt.labelColor.getRgbaColor(),n.translate(d,v),n.rotate(a);var o=a,i=ft*wi,r,u=h,c=vi-1,w=e*.28,f=e*.1;for((kt.type==="type1"||kt.type==="type2")&&(f=e*.0375),p=parseFloat(l.toFixed(2)),s=h;parseFloat(s.toFixed(2))<=p;s+=wi){r=+i+tt,c++;if(c===vi){n.save(),n.translate(w,0);switch(hu.type){case"horizontal":r=-o;break;case"tangent":r=o<=tt+Math.PI?Math.PI:0;break;case"normal":default:r=tt}n.rotate(r);switch(t.format){case"fractional":n.fillText(u.toFixed(pu),0,0,f);break;case"scientific":n.fillText(u.toPrecision(2),0,0,f);break;case"standard":default:n.fillText(u.toFixed(0),0,0,f)}n.translate(-w,0),n.restore(),u+=st,c=0,n.rotate(i),o+=i;continue}n.rotate(i),o+=i}n.translate(-d,-v),n.restore()},ai=function(n){n?wr=setInterval(gr,1e3):clearInterval(wr)},gr=function(){ur&&(wt=wt===ni?lt:ni,u.save(),u.drawImage(wt,e*.453271,g*.65),u.restore())};return this.setValue=function(n){var t=n<h?h:n>l?l:n;nt!==t&&(nt=t,nt<ui||ut?nt<ui&&(ut=!1,ai(ut),gi&&hi.pause()):(ut=!0,ai(ut),gi&&hi.play()),this.repaint())},this.getValue=function(){return nt},this.setValueAnimated=function(n){var i=n<h?h:n>l?l:n,t;nt!==i&&(undefined!==ii&&ii.playing&&ii.stop(),ii=new Tween({},"",Tween.regularEaseInOut,nt,i,1),t=this,ii.onMotionChanged=function(n){nt=n.target._pos,nt<ui||ut?nt<ui&&(ut=!1,ai(ut)):(ut=!0,ai(ut)),t.repaint()},ii.start())},this.setFrameDesign=function(n){ei({frame:!0}),lr=n,k({frame:!0}),this.repaint()},this.setBackgroundColor=function(n){ei({background:!0,led:!0}),gt=n,k({background:!0,led:!0}),this.repaint()},this.setForegroundType=function(n){ei({foreground:!0}),br=n,k({foreground:!0}),this.repaint()},this.setValueColor=function(n){ei({value:!0}),ki=n,k({value:!0}),this.repaint()},this.setLedColor=function(n){ei({led:!0}),nr=n,k({led:!0}),this.repaint()},this.setLcdColor=function(n){ti=n,k({background:!0}),this.repaint()},this.setSection=function(n){vt=n,k(),this.repaint()},this.setSectionActive=function(n){vr=n,k(),this.repaint()},this.setGradient=function(n){si=n,k(),this.repaint()},this.setGradientActive=function(n){useGradient=n,k(),this.repaint()},this.setMinValue=function(n){h=n,k({background:!0,foreground:!0,pointer:!0}),this.repaint()},this.getMinValue=function(){return h},this.setMaxValue=function(n){l=n,k({background:!0,foreground:!0,pointer:!0}),this.repaint()},this.getMaxValue=function(){return l},this.setTitleString=function(n){ar=n,k({background:!0}),this.repaint()},this.setUnitString=function(n){cr=n,k({background:!0}),this.repaint()},this.repaint=function(){var e,i,f,n,t;for(or||k({frame:!0,background:!0,led:!0,value:!0,foreground:!0}),u.save(),u.clearRect(0,0,u.canvas.width,u.canvas.height),u.drawImage(ci,0,0),u.drawImage(li,0,0),e=(nt+Math.abs(h))/(l-h)*et,f=ki,n=0;n<=e;n+=5){i=ki;if(tr){var o=h+n/et*(l-h),s=si.getEnd()-si.getStart(),r=o/s;r=Math.max(Math.min(r,1),0),i=pt(si.getColorAt(r).getRgbaColor())}else if(bi)for(t=0;t<bt.length;t++)if(n>=bt[t].start&&n<bt[t].stop){i=bt[t].color;break}f.medium.getHexColor()!=i.medium.getHexColor()&&(yr(di,i),f=i),u.save(),u.translate(d,v),u.rotate(n*yt+dt),u.translate(-d,-v),u.drawImage(ri,fu,eu),u.restore()}sr&&ru(nt),ur&&(nt<ui&&(ut=!1,wt=lt),u.drawImage(wt,ou,wu)),u.drawImage(fi,0,0),u.restore()},this.repaint(),this},ou=function(n,i){var hi;i=i||{};var tt=undefined===i.orientation?steelseries.Orientation.NORTH:i.orientation,c=undefined===i.size?200:i.size,k=undefined===i.minValue?0:i.minValue,g=undefined===i.maxValue?k+100:i.maxValue,hu=undefined===i.niceScale?!0:i.niceScale,dt=undefined===i.threshold?(g-k)/2:i.threshold,gt=undefined===i.section?null:i.section,ni=undefined===i.area?null:i.area,gr=undefined===i.titleString?"":i.titleString,tu=undefined===i.unitString?"":i.unitString,yr=undefined===i.frameDesign?steelseries.FrameDesign.METAL:i.frameDesign,cu=undefined===i.frameVisible?!0:i.frameVisible,it=undefined===i.backgroundColor?steelseries.BackgroundColor.DARK_GRAY:i.backgroundColor,nr=undefined===i.pointerType?steelseries.PointerType.TYPE1:i.pointerType,a=undefined===i.pointerColor?steelseries.ColorDef.RED:i.pointerColor,lu=undefined===i.knobType?steelseries.KnobType.STANDARD_KNOB:i.knobType,ii=undefined===i.knobStyle?steelseries.KnobStyle.SILVER:i.knobStyle,tr=undefined===i.ledColor?steelseries.LedColor.RED_LED:i.ledColor,pr=undefined===i.ledVisible?!0:i.ledVisible,nu=undefined===i.thresholdVisible?!0:i.thresholdVisible,di=undefined===i.minMeasuredValueVisible?!1:i.minMeasuredValueVisible,gi=undefined===i.maxMeasuredValueVisible?!1:i.maxMeasuredValueVisible,dr=undefined===i.foregroundType?steelseries.ForegroundType.TYPE1:i.foregroundType,eu=undefined===i.labelNumberFormat?steelseries.LabelNumberFormat.STANDARD:i.labelNumberFormat,ir=undefined===i.playAlarm?!1:i.playAlarm,hr=undefined===i.alarmSound?!1:i.alarmSound;ir&&hr!==!1&&(hi=r.createElement("audio"),hi.setAttribute("src",hr),hi.setAttribute("preload","auto"));var er=steelseries.GaugeType.TYPE5,ou=this,d=k,yt=g,vt=k,rt=!1,lr=0,bt,bi=ut+(d-k)*ot,l=r.getElementById(n).getContext("2d");l.save(),l.clearRect(0,0,l.canvas.width,l.canvas.height),l.canvas.width=c,l.canvas.height=c;var u=c,e=c,h=u/2,nt=e*.733644,su=.455*u,pu=.51*e,ct=Math.PI/2,ku=Math.PI/180,bu=0,ut=1.25*Math.PI,au=1.25*Math.PI,at=ct,ot=at/ht,wr=!1,vi=k,wi=g,ki=g-k,ht=wi-vi,yi=0,ft=0,ri=10,vu=10,yu=function(){hu?(ki=f(g-k,!1),ft=f(ki/(vu-1),!0),vi=Math.floor(k/ft)*ft,wi=Math.ceil(g/ft)*ft,yi=f(ft/(ri-1),!0),k=vi,g=wi,ht=g-k):(ki=g-k,vi=k,wi=g,ht=ki,yi=1,ft=10),bu=0,ut=1.25*Math.PI,au=1.25*Math.PI,at=ct,ot=at/ht,bi=ut+(d-k)*ot},fi=t(c,c),kr=fi.getContext("2d"),ei=t(c,c),w=ei.getContext("2d"),pt=t(c*.093457,c*.093457),ur=pt.getContext("2d"),et=t(c*.093457,c*.093457),fr=et.getContext("2d"),kt=et,cr=t(Math.ceil(c*.028037),Math.ceil(c*.028037)),ai=cr.getContext("2d"),ar=t(Math.ceil(c*.028037),Math.ceil(c*.028037)),ci=ar.getContext("2d"),oi=t(c,c),or=oi.getContext("2d"),si=t(c,c),sr=si.getContext("2d"),wt=t(c,c),st=wt.getContext("2d"),ui=t(c,c),br=ui.getContext("2d"),fu=function(n){n.save();if("type5"===er.type)switch(tt.type){case"west":n.drawImage(s(Math.ceil(e*.037383),steelseries.KnobType.STANDARD_KNOB,ii),u*.44,e*.8),n.drawImage(s(Math.ceil(e*.037383),steelseries.KnobType.STANDARD_KNOB,ii),u*.44,e*.16);break;default:n.drawImage(s(Math.ceil(e*.037383),steelseries.KnobType.STANDARD_KNOB,ii),u*.2-e*.037383,e*.446666),n.drawImage(s(Math.ceil(e*.037383),steelseries.KnobType.STANDARD_KNOB,ii),u*.8,e*.446666)}n.restore()},uu=function(){var t=r.createElement("canvas"),n,i;return t.width=Math.ceil(c*.046728),t.height=Math.ceil(t.width*.9),n=t.getContext("2d"),n.save(),i=n.createLinearGradient(0,.1,0,t.height*.9),i.addColorStop(0,"#520000"),i.addColorStop(.3,"#fc1d00"),i.addColorStop(.59,"#fc1d00"),i.addColorStop(1,"#520000"),n.fillStyle=i,n.beginPath(),n.moveTo(t.width*.5,.1),n.lineTo(t.width*.9,t.height*.9),n.lineTo(t.width*.1,t.height*.9),n.lineTo(t.width*.5,.1),n.closePath(),n.fill(),n.strokeStyle="#FFFFFF",n.stroke(),n.restore(),t},vr=function(n,t,i,r,f){n.save(),n.strokeStyle=r,n.fillStyle=r,n.lineWidth=u*.035;var e=at/ht*t-at/ht*k,o=e+(i-t)/(ht/at);n.translate(h,nt),n.rotate(ut),n.beginPath(),f?(n.moveTo(0,0),n.arc(0,0,u*.365-n.lineWidth/2,e,o,!1)):n.arc(0,0,u*.365,e,o,!1),n.moveTo(0,0),n.closePath(),f?n.fill():n.stroke(),n.translate(-h,-nt),n.restore()},ru=function(n){var r,i,t;n.save(),n.textAlign="left",n.textBaseline="middle",n.strokeStyle=it.labelColor.getRgbaColor(),n.fillStyle=it.labelColor.getRgbaColor(),r=u,li||vertical||(r=e),n.font=.046728*u+"px sans-serif",i=n.measureText(gr).width,n.fillText(gr,(u-i)/2,e*.4,u*.3),t=n.measureText(tu).width,n.fillText(tu,(u-t)/2,e*.47,u*.2),n.restore()},iu=function(n,t){var l,e;it.labelColor.setAlpha(1),n.save(),steelseries.Orientation.WEST===tt&&(n.translate(h,h),n.rotate(-Math.PI/2),n.translate(-h,-h)),n.textAlign="center",n.textBaseline="middle",l=Math.ceil(u*.04),n.font=l+"px sans-serif",n.strokeStyle=it.labelColor.getRgbaColor(),n.fillStyle=it.labelColor.getRgbaColor(),n.translate(h,nt),n.rotate(ut);var s=ot*yi,a,i=k,r=ri-1,o=u*.44,b=u*.41,w=u*.415,y=u*.42,c=u*.48,f=u*.0375,p=ri/2,v=parseFloat(g.toFixed(2));for(e=k;parseFloat(e.toFixed(2))<=v;e+=yi){a=+s+ct,r++;if(r===ri){n.lineWidth=1.5,n.beginPath(),n.moveTo(o,0),n.lineTo(b,0),n.closePath(),n.stroke(),n.save(),n.translate(c,0),n.rotate(a);switch(t.format){case"fractional":n.fillText(i.toFixed(2),0,0,f);break;case"scientific":n.fillText(i.toPrecision(2),0,0,f);break;case"standard":default:n.fillText(i.toFixed(0),0,0,f)}n.translate(-c,0),n.restore(),i+=ft,r=0,n.rotate(s);continue}0==ri%2&&r===p?(n.lineWidth=1,n.beginPath(),n.moveTo(o,0),n.lineTo(w,0),n.closePath(),n.stroke()):(n.lineWidth=.5,n.beginPath(),n.moveTo(o,0),n.lineTo(y,0),n.closePath(),n.stroke()),n.rotate(s)}n.translate(-h,-nt),n.restore()},rr=function(n,t){n.save();var i;t&&(n.shadowColor="#000000",n.shadowBlur=3,n.fillStyle="rgba(0, 0, 0, 0.4)",n.strokeStyle="rgba(0, 0, 0, 0.4)");switch(nr.type){case"type2":t||(i=n.createLinearGradient(0,.733333*e,0,.3*e),i.addColorStop(0,it.labelColor.getRgbaColor()),i.addColorStop(.36,it.labelColor.getRgbaColor()),i.addColorStop(.36,a.light.getRgbaColor()),i.addColorStop(1,a.light.getRgbaColor()),n.fillStyle=i),n.beginPath(),n.moveTo(u*.518691,e*.705607),n.lineTo(u*.509345,e*.696261),n.lineTo(u*.509345,e*.574766),n.lineTo(u*.504672,e*.289719),n.lineTo(u*.495327,e*.289719),n.lineTo(u*.490654,e*.574766),n.lineTo(u*.490654,e*.696261),n.lineTo(u*.481308,e*.705607),n.bezierCurveTo(u*.481308,e*.705607,u*.467289,e*.724299,u*.467289,e*.733644),n.bezierCurveTo(u*.467289,e*.752336,u*.481308,e*.766355,u*.5,e*.766355),n.bezierCurveTo(u*.518691,e*.766355,u*.53271,e*.752336,u*.53271,e*.733644),n.bezierCurveTo(u*.53271,e*.724299,u*.518691,e*.705607,u*.518691,e*.705607),n.closePath(),n.fill();break;case"type3":n.beginPath(),n.rect(u*.495327,e*.289719,u*.009345,e*.448598),n.closePath(),t||(n.fillStyle=a.light.getRgbaColor()),n.fill();break;case"type4":t||(i=n.createLinearGradient(.467289*u,0,.53271*u,0),i.addColorStop(0,a.dark.getRgbaColor()),i.addColorStop(.5,a.dark.getRgbaColor()),i.addColorStop(.5,a.light.getRgbaColor()),i.addColorStop(1,a.light.getRgbaColor()),n.fillStyle=i),n.beginPath(),n.moveTo(u*.5,e*.294392),n.lineTo(u*.514018,e*.303738),n.lineTo(u*.53271,e*.733644),n.lineTo(u*.523364,e*.836448),n.lineTo(u*.476635,e*.836448),n.lineTo(u*.467289,e*.733644),n.lineTo(u*.485982,e*.303738),n.lineTo(u*.5,e*.294392),n.closePath(),n.fill();break;case"type5":t||(i=n.createLinearGradient(.473333*u,0,.526666*u,0),i.addColorStop(0,a.light.getRgbaColor()),i.addColorStop(.5,a.light.getRgbaColor()),i.addColorStop(.5,a.medium.getRgbaColor()),i.addColorStop(1,a.medium.getRgbaColor()),n.fillStyle=i,n.strokeStyle=a.dark.getRgbaColor()),n.beginPath(),n.moveTo(u*.5,e*.74),n.lineTo(u*.526666,e*.74),n.lineTo(u*.5,e*.3),n.lineTo(u*.473333,e*.74),n.lineTo(u*.5,e*.74),n.closePath(),n.fill(),n.lineWidth=1,n.lineCap="square",n.lineJoin="miter",n.stroke();break;case"type6":t||(n.fillStyle=a.medium.getRgbaColor()),n.beginPath(),n.moveTo(u*.473333,e*.733333),n.lineTo(u*.473333,e*.6),n.lineTo(u*.48,e*.493333),n.lineTo(u*.493333,e*.306666),n.lineTo(u*.5,e*.306666),n.lineTo(u*.506666,e*.306666),n.lineTo(u*.52,e*.493333),n.lineTo(u*.526666,e*.593333),n.lineTo(u*.526666,e*.733333),n.lineTo(u*.506666,e*.733333),n.lineTo(u*.506666,e*.593333),n.lineTo(u*.5,e*.493333),n.lineTo(u*.493333,e*.6),n.lineTo(u*.493333,e*.733333),n.lineTo(u*.473333,e*.733333),n.closePath(),n.fill();break;case"type7":t||(i=n.createLinearGradient(.473333*u,0,.526666*u,0),i.addColorStop(0,a.dark.getRgbaColor()),i.addColorStop(1,a.medium.getRgbaColor()),n.fillStyle=i),n.beginPath(),n.moveTo(u*.486666,e*.306666),n.lineTo(u*.473333,e*.733333),n.lineTo(u*.526666,e*.733333),n.lineTo(u*.506666,e*.306666),n.lineTo(u*.486666,e*.306666),n.closePath(),n.fill();break;case"type8":t||(i=n.createLinearGradient(.46*u,0,.54*u,0),i.addColorStop(0,a.light.getRgbaColor()),i.addColorStop(.5,a.light.getRgbaColor()),i.addColorStop(.5,a.medium.getRgbaColor()),i.addColorStop(1,a.medium.getRgbaColor()),n.fillStyle=i,n.strokeStyle=a.dark.getRgbaColor()),n.beginPath(),n.moveTo(u*.5,e*.766666),n.lineTo(u*.533333,e*.733333),n.bezierCurveTo(u*.533333,e*.733333,u*.506666,e*.706666,u*.5,e*.313333),n.bezierCurveTo(u*.493333,e*.706666,u*.466666,e*.733333,u*.466666,e*.733333),n.lineTo(u*.5,e*.766666),n.closePath(),n.fill(),n.stroke();break;case"type9":t||(i=n.createLinearGradient(.471962*u,0,.528036*u,0),i.addColorStop(0,"#323232"),i.addColorStop(.5,"#666666"),i.addColorStop(1,"#323232"),n.fillStyle=i,n.strokeStyle="#2E2E2E"),n.beginPath(),n.moveTo(u*.493333,e*.42),n.lineTo(u*.506666,e*.42),n.lineTo(u*.513333,e*.66),n.lineTo(u*.486666,e*.66),n.lineTo(u*.493333,e*.42),n.closePath(),n.moveTo(u*.493333,e*.3),n.lineTo(u*.473333,e*.7),n.lineTo(u*.473333,e*.766666),n.bezierCurveTo(u*.473333,e*.766666,u*.473333,e*.853333,u*.473333,e*.853333),n.bezierCurveTo(u*.473333,e*.86,u*.48,e*.86,u*.5,e*.86),n.bezierCurveTo(u*.52,e*.86,u*.526666,e*.86,u*.526666,e*.853333),n.bezierCurveTo(u*.526666,e*.853333,u*.526666,e*.766666,u*.526666,e*.766666),n.lineTo(u*.526666,e*.7),n.lineTo(u*.506666,e*.3),n.lineTo(u*.493333,e*.3),n.closePath(),n.fill(),n.beginPath(),n.moveTo(u*.493333,e*.406666),n.lineTo(u*.506666,e*.406666),n.lineTo(u*.506666,e*.306666),n.lineTo(u*.493333,e*.306666),n.lineTo(u*.493333,e*.406666),n.closePath(),t||(n.fillStyle=a.medium.getRgbaColor()),n.fill();break;case"type10":n.beginPath(),n.moveTo(u*.5,e*.149532),n.moveTo(u*.5,e*.3),n.bezierCurveTo(u*.5,e*.3,u*.433333,e*.713333,u*.433333,e*.726666),n.bezierCurveTo(u*.433333,e*.76,u*.46,e*.793333,u*.5,e*.793333),n.bezierCurveTo(u*.54,e*.793333,u*.566666,e*.76,u*.566666,e*.726666),n.bezierCurveTo(u*.566666,e*.713333,u*.5,e*.3,u*.5,e*.3),n.closePath(),t||(i=n.createLinearGradient(.471962*u,0,.528036*u,0),i.addColorStop(0,a.light.getRgbaColor()),i.addColorStop(.5,a.light.getRgbaColor()),i.addColorStop(.5,a.medium.getRgbaColor()),i.addColorStop(1,a.medium.getRgbaColor()),n.fillStyle=i,n.strokeStyle=a.medium.getRgbaColor()),n.lineWidth=1,n.lineCap="square",n.lineJoin="miter",n.fill(),n.stroke();break;case"type11":n.beginPath(),n.moveTo(.5*u,.3*e),n.lineTo(.486666*u,.733333*e),n.bezierCurveTo(.486666*u,.733333*e,.486666*u,.806666*e,.5*u,.806666*e),n.bezierCurveTo(.513333*u,.806666*e,.513333*u,.733333*e,.513333*u,.733333*e),n.lineTo(.5*u,.3*e),n.closePath(),t||(i=n.createLinearGradient(0,.226666*e,0,.866666*e),i.addColorStop(0,a.light.getRgbaColor()),i.addColorStop(1,a.medium.getRgbaColor()),n.fillStyle=i,n.strokeStyle=a.dark.getRgbaColor()),n.fill(),n.stroke();break;case"type12":n.beginPath(),n.moveTo(.5*u,.3*e),n.lineTo(.486666*u,.733333*e),n.lineTo(.5*u,.746666*e),n.lineTo(.513333*u,.733333*e),n.lineTo(.5*u,.3*e),n.closePath(),t||(i=n.createLinearGradient(0,.226666*e,0,.746666*e),i.addColorStop(0,a.light.getRgbaColor()),i.addColorStop(1,a.medium.getRgbaColor()),n.fillStyle=i,n.strokeStyle=a.dark.getRgbaColor()),n.fill(),n.stroke();break;case"type13":case"type14":n.beginPath(),n.moveTo(.486666*u,.326666*e),n.lineTo(.5*u,.293333*e),n.lineTo(.513333*u,.326666*e),n.lineTo(.513333*u,.746666*e),n.lineTo(.486666*u,.746666*e),n.lineTo(.486666*u,.326666*e),n.closePath(),t||(nr.type==="type13"?(i=n.createLinearGradient(0,.733333*e,0,.293333*e),i.addColorStop(0,it.labelColor.getRgbaColor()),i.addColorStop(.849999,it.labelColor.getRgbaColor()),i.addColorStop(.85,a.medium.getRgbaColor()),i.addColorStop(1,a.medium.getRgbaColor()),n.fillStyle=i):(i=n.createLinearGradient(.486666*u,0,.513333*u,0),i.addColorStop(0,a.veryDark.getRgbaColor()),i.addColorStop(.5,a.light.getRgbaColor()),i.addColorStop(1,a.veryDark.getRgbaColor()),n.fillStyle=i)),n.fill();break;case"type1":default:t||(i=n.createLinearGradient(0,.386666*e,0,.72*e),i.addColorStop(0,a.veryDark.getRgbaColor()),i.addColorStop(.3,a.medium.getRgbaColor()),i.addColorStop(.59,a.medium.getRgbaColor()),i.addColorStop(1,a.veryDark.getRgbaColor()),n.fillStyle=i,n.strokeStyle=a.light.getRgbaColor()),n.beginPath(),n.moveTo(u*.518691,e*.705607),n.bezierCurveTo(u*.514018,e*.691588,u*.509345,e*.626168,u*.509345,e*.612149),n.bezierCurveTo(u*.504672,e*.59813,u*.5,e*.299065,u*.5,e*.299065),n.bezierCurveTo(u*.5,e*.299065,u*.490654,e*.59813,u*.490654,e*.612149),n.bezierCurveTo(u*.490654,e*.630841,u*.485981,e*.691588,u*.481308,e*.705607),n.bezierCurveTo(u*.471962,e*.714953,u*.467289,e*.724299,u*.467289,e*.733644),n.bezierCurveTo(u*.467289,e*.752336,u*.481308,e*.766355,u*.5,e*.766355),n.bezierCurveTo(u*.518691,e*.766355,u*.53271,e*.752336,u*.53271,e*.733644),n.bezierCurveTo(u*.53271,e*.724299,u*.528037,e*.714953,u*.518691,e*.705607),n.closePath(),n.fill(),n.stroke()}n.restore()},lt=function(n){var i,t;n=n||{};var f=undefined===n.frame?!1:n.frame,r=undefined===n.background?!1:n.background,s=undefined===n.led?!1:n.led,l=undefined===n.pointer?!1:n.pointer,a=undefined===n.foreground?!1:n.foreground;wr=!0,yu(),f&&cu&&y(kr,yr,h,c/2,u,e),r&&b(w,it,h,c/2,u,e),s&&(ur.drawImage(o(Math.ceil(c*.093457),1,tr),0,0),fr.drawImage(o(Math.ceil(c*.093457),0,tr),0,0)),di&&(steelseries.Orientation.WEST===tt&&(ai.translate(h,h),ai.rotate(-Math.PI/2),ai.translate(-h,-h)),ai.drawImage(v(Math.ceil(c*.028037),steelseries.ColorDef.BLUE.dark.getRgbaColor(),!0,!0),0,0),ai.restore()),gi&&(steelseries.Orientation.WEST===tt&&(ci.translate(h,h),ci.rotate(-Math.PI/2),ci.translate(-h,-h)),ci.drawImage(v(Math.ceil(c*.028037),steelseries.ColorDef.RED.medium.getRgbaColor(),!0),0,0),ci.restore());if(r){fu(w);if(null!==gt&&0<gt.length){w.save(),steelseries.Orientation.WEST===tt&&(w.translate(h,h),w.rotate(-Math.PI/2),w.translate(-h,-h)),i=gt.length;do i--,vr(w,gt[i].start,gt[i].stop,gt[i].color,!1);while(0<i);w.restore()}if(null!==ni&&0<ni.length){steelseries.Orientation.WEST===tt&&(w.translate(h,h),w.rotate(-Math.PI/2),w.translate(-h,-h)),t=ni.length;do t--,vr(w,ni[t].start,ni[t].stop,ni[t].color,!0);while(0<t);w.restore()}iu(w,eu),nu&&(w.save(),steelseries.Orientation.WEST===tt&&(w.translate(h,h),w.rotate(-Math.PI/2),w.translate(-h,-h)),w.translate(h,nt),w.rotate(ut+(dt-k)*ot+ct),w.translate(-h,-nt),w.drawImage(uu(),u*.475,e*.33),w.restore()),ru(w)}l&&(rr(or,!1),rr(sr,!0)),a&&p(br,dr,u,e,!0,lu,ii,er,tt)},ti=function(n){n=n||{};var u=undefined===n.frame?!1:n.frame,f=undefined===n.background?!1:n.background,r=undefined===n.led?!1:n.led,t=undefined===n.pointer?!1:n.pointer,i=undefined===n.foreground?!1:n.foreground;u&&(fi.width=c,fi.height=c,kr=fi.getContext("2d")),f&&(ei.width=c,ei.height=c,w=ei.getContext("2d")),r&&(pt.width=Math.ceil(c*.093457),pt.height=Math.ceil(c*.093457),ur=pt.getContext("2d"),et.width=Math.ceil(c*.093457),et.height=Math.ceil(c*.093457),fr=et.getContext("2d"),kt=et),t&&(oi.width=c,oi.height=c,or=oi.getContext("2d"),si.width=c,si.height=c,sr=si.getContext("2d"),wt.width=c,wt.height=c,st=wt.getContext("2d")),i&&(ui.width=c,ui.height=c,br=ui.getContext("2d"))},pi=function(n){n?lr=setInterval(wu,1e3):clearInterval(lr)},wu=function(){pr&&(kt=kt===pt?et:pt,ou.repaint())};return this.setValue=function(n){var t=n<k?k:n>g?g:n;d!==t&&(d=t,d>vt&&(vt=d),d<yt&&(yt=d),d<dt||rt?d<dt&&(rt=!1,pi(rt),ir&&hi.pause()):(rt=!0,pi(rt),ir&&hi.play()),this.repaint())},this.getValue=function(){return d},this.setValueAnimated=function(n){var i=n<k?k:n>g?g:n,t;d!==i&&(undefined!==bt&&bt.playing&&bt.stop(),bt=new Tween({},"",Tween.regularEaseInOut,d,i,1),t=this,bt.onMotionChanged=function(n){d=n.target._pos,d<dt||rt?d<dt&&(rt=!1,pi(rt)):(rt=!0,pi(rt)),d>vt&&(vt=d),d<yt&&(yt=d),t.repaint()},bt.start())},this.resetMinMeasuredValue=function(){yt=d,this.repaint()},this.resetMaxMeasuredValue=function(){vt=d,this.repaint()},this.setMinMeasuredValueVisible=function(n){di=n,this.repaint()},this.setMaxMeasuredValueVisible=function(n){gi=n,this.repaint()},this.setThresholdVisible=function(n){nu=n,this.repaint()},this.setFrameDesign=function(n){ti({frame:!0}),yr=n,lt({frame:!0}),this.repaint()},this.setBackgroundColor=function(n){ti({background:!0,pointer:!0}),it=n,lt({background:!0,pointer:!0}),this.repaint()},this.setForegroundType=function(n){ti({foreground:!0}),dr=n,lt({foreground:!0}),this.repaint()},this.setPointerType=function(n){ti({pointer:!0}),nr=n,lt({pointer:!0}),this.repaint()},this.setPointerColor=function(n){ti({pointer:!0}),a=n,lt({pointer:!0}),this.repaint()},this.setLedColor=function(n){ti({led:!0}),tr=n,lt({led:!0}),this.repaint()},this.repaint=function(){wr||lt({frame:!0,background:!0,led:!0,pointer:!0,foreground:!0}),l.clearRect(0,0,l.canvas.width,l.canvas.height),l.drawImage(fi,0,0),l.drawImage(ei,0,0),pr&&(d<dt&&(rt=!1,kt=et),l.drawImage(kt,su,pu)),steelseries.Orientation.WEST===tt&&(l.translate(h,h),l.rotate(-Math.PI/2),l.translate(-h,-h)),di&&(l.save(),l.translate(h,nt),l.rotate(ut+ct+(yt-k)*ot),l.translate(-h,-nt),l.drawImage(cr,l.canvas.width*.4865,l.canvas.height*.105),l.restore()),gi&&(l.save(),l.translate(h,nt),l.rotate(ut+ct+(vt-k)*ot),l.translate(-h,-nt),l.drawImage(ar,l.canvas.width*.4865,l.canvas.height*.105),l.restore()),bi=ut+ct+(d-k)*ot;var n=u*.006;st.clearRect(0,0,u,e),st.save(),st.translate(h,nt),st.rotate(bi),st.translate(-h,-nt),st.drawImage(si,0,0),st.restore(),steelseries.Orientation.NORTH===tt?l.drawImage(wt,0,0,u,e,n,n,u+n,e+n):l.drawImage(wt,0,0,u,e,-n,n,u-n,e+n),l.save(),l.translate(h,nt),l.rotate(bi),l.translate(-h,-nt),l.drawImage(oi,0,0),l.restore(),steelseries.Orientation.WEST===tt&&(l.translate(h,h),l.rotate(Math.PI/2),l.translate(-h,-h)),l.drawImage(ui,0,0)},this.repaint(),this},su=function(n,i){var lt;i=i||{};var a=undefined===i.width?140:i.width,p=undefined===i.height?320:i.height,h=undefined===i.minValue?0:i.minValue,c=undefined===i.maxValue?h+100:i.maxValue,yr=undefined===i.niceScale?!0:i.niceScale,rt=undefined===i.threshold?(c-h)/2:i.threshold,vi=undefined===i.titleString?"":i.titleString,li=undefined===i.unitString?"":i.unitString,tr=undefined===i.frameDesign?steelseries.FrameDesign.METAL:i.frameDesign,iu=undefined===i.frameVisible?!0:i.frameVisible,ut=undefined===i.backgroundColor?steelseries.BackgroundColor.DARK_GRAY:i.backgroundColor,dt=undefined===i.valueColor?steelseries.ColorDef.RED:i.valueColor,ft=undefined===i.lcdColor?steelseries.LcdColor.STANDARD:i.lcdColor,ti=undefined===i.lcdVisible?!0:i.lcdVisible,bi=undefined===i.lcdDecimals?2:i.lcdDecimals,dr=undefined===i.digitalFont?!1:i.digitalFont,ct=undefined===i.ledColor?steelseries.LedColor.RED_LED:i.ledColor,wi=undefined===i.ledVisible?!0:i.ledVisible,cr=undefined===i.thresholdVisible?!0:i.thresholdVisible,oi=undefined===i.minMeasuredValueVisible?!1:i.minMeasuredValueVisible,ci=undefined===i.maxMeasuredValueVisible?!1:i.maxMeasuredValueVisible,kr=undefined===i.labelNumberFormat?steelseries.LabelNumberFormat.STANDARD:i.labelNumberFormat,hi=undefined===i.playAlarm?!1:i.playAlarm,or=undefined===i.alarmSound?!1:i.alarmSound;hi&&or!==!1&&(lt=r.createElement("audio"),lt.setAttribute("src",or),lt.setAttribute("preload","auto"));var tu=this,l=h,it=c,tt=h,et,k=!1,sr=0,s=r.getElementById(n).getContext("2d");s.save(),s.clearRect(0,0,s.canvas.width,s.canvas.height),s.canvas.width=a,s.canvas.height=p;var u=a,e=p,y=a<=p,si,pi,yi,ai;y?(si=.453271*u,pi=18/e*e,yi=Math.floor(u/10)+"px sans-serif",ai=Math.floor(u/10)+"px LCDMono2Ultra"):(si=.89*u,pi=.453271*e,yi=Math.floor(e/10)+"px sans-serif",ai=Math.floor(e/10)+"px LCDMono2Ultra");var er=!1,ri=h,kt=c,wt=c-h,hr=kt-ri,bt=0,g=0,ht=10,gr=10,br=function(){yr?(wt=f(c-h,!1),g=f(wt/(gr-1),!0),ri=Math.floor(h/g)*g,kt=Math.ceil(c/g)*g,bt=f(g/(ht-1),!0),h=ri,c=kt,hr=c-h):(wt=c-h,ri=h,kt=c,hr=wt,bt=1,g=10)},pt=t(a,p),lr=pt.getContext("2d"),vt=t(a,p),b=vt.getContext("2d"),ii,st=t(Math.ceil(a*.093457),Math.ceil(a*.093457)),ui=st.getContext("2d"),nt=t(Math.ceil(a*.093457),Math.ceil(a*.093457)),ei=nt.getContext("2d"),ot=nt,ki=t(Math.ceil(a*.028037),Math.ceil(a*.028037)),rr=ki.getContext("2d"),fr=t(Math.ceil(a*.028037),Math.ceil(a*.028037)),ir=fr.getContext("2d"),yt=t(a,p),di=yt.getContext("2d"),nu=function(n,t){s.save(),s.textAlign="right",s.textBaseline="middle",s.strokeStyle=ft.textColor,s.fillStyle=ft.textColor,(ft===steelseries.LcdColor.STANDARD||ft===steelseries.LcdColor.STANDARD_GREEN)&&(s.shadowColor="gray",t?(s.shadowOffsetX=u*.007,s.shadowOffsetY=u*.007,s.shadowBlur=u*.009):(s.shadowOffsetX=e*.007,s.shadowOffsetY=e*.007,s.shadowBlur=e*.009));var f,r,i;s.font=dr?ai:yi,t?(f=(u-u*.571428)/2+u*.571428-1,r=e*.88+1+(e*.055-2)/2,i=u*.7-2):(f=u*.695+u*.18-2,r=e*.22+1+(e*.15-2)/2,i=e*.22-2),s.fillText(n.toFixed(bi),f,r,i),s.restore()},wr=function(n){var i=r.createElement("canvas"),t,f;return i.width=n?Math.ceil(u*.046728):Math.ceil(e*.046728),i.height=Math.ceil(i.width*.9),t=i.getContext("2d"),t.save(),f=t.createLinearGradient(0,.1,0,i.height*.9),f.addColorStop(0,"#520000"),f.addColorStop(.3,"#fc1d00"),f.addColorStop(.59,"#fc1d00"),f.addColorStop(1,"#520000"),t.fillStyle=f,n?(t.beginPath(),t.moveTo(.1,i.height*.5),t.lineTo(i.width*.9,.1),t.lineTo(i.width*.9,i.height*.9),t.closePath()):(t.beginPath(),t.moveTo(.1,.1),t.lineTo(i.width*.9,.1),t.lineTo(i.width*.5,i.height*.9),t.closePath()),t.fill(),t.strokeStyle="#FFFFFF",t.stroke(),t.restore(),i},ar=function(n,t,i){var f,b,l;ut.labelColor.setAlpha(1),n.save(),n.textBaseline="middle",f=u*.1,n.strokeStyle=ut.labelColor.getRgbaColor(),n.fillStyle=ut.labelColor.getRgbaColor();var r=h,a=ht-1,k,d,w,o,s=1,nt,it,tt,y,v,p;for(i?(nt=.34*u,it=.36*u,tt=.33*u,y=.36*u,v=.32*u,p=.36*u,n.textAlign="right",k=0,d=e*.12864,w=0,o=e*.856796-e*.12864,s=o/(c-h)):(nt=.65*e,it=.63*e,tt=.66*e,y=.63*e,v=.67*e,p=.63*e,n.textAlign="center",k=u*.142857,d=0,w=u*.871012-u*.142857,o=0,s=w/(c-h)),b=h,l=0;b<=c;b+=bt,l+=bt){currentPos=i?d+o-l*s:k+l*s,a++;if(a===ht){n.lineWidth=1.5,fi(n,v,p,currentPos,i);if(i)switch(t.format){case"fractional":n.fillText(r.toFixed(2),u*.28,currentPos,f);break;case"scientific":n.fillText(r.toPrecision(2),u*.28,currentPos,f);break;case"standard":default:n.fillText(r.toFixed(0),u*.28,currentPos,f)}else switch(t.format){case"fractional":n.fillText(r.toFixed(2),currentPos,e*.73,f);break;case"scientific":n.fillText(r.toPrecision(2),currentPos,e*.73,f);break;case"standard":default:n.fillText(r.toFixed(0),currentPos,e*.73,f)}r+=g,a=0;continue}0==ht%2&&a===ht/2?(n.lineWidth=1,fi(n,tt,y,currentPos,i)):(n.lineWidth=.5,fi(n,nt,it,currentPos,i))}n.restore()},fi=function(n,t,i,r,u){u?(n.beginPath(),n.moveTo(t,r),n.lineTo(i,r),n.closePath(),n.stroke()):(n.beginPath(),n.moveTo(r,t),n.lineTo(r,i),n.closePath(),n.stroke())},d=function(n){var t;n=n||{};var r=undefined===n.frame?!1:n.frame,i=undefined===n.background?!1:n.background,s=undefined===n.led?!1:n.led,f=undefined===n.foreground?!1:n.foreground;er=!0,br(),r&&iu&&ur(lr,tr,u,e,y),i&&gi(b,ut,u,e),s&&(y?(ui.drawImage(o(Math.ceil(a*.093457),1,ct),0,0),ei.drawImage(o(Math.ceil(a*.093457),0,ct),0,0)):(ui.drawImage(o(Math.ceil(p*.093457),1,ct),0,0),ei.drawImage(o(Math.ceil(p*.093457),0,ct),0,0))),oi&&(y?rr.drawImage(v(Math.ceil(a*.05),steelseries.ColorDef.BLUE.dark.getRgbaColor(),!1,y),0,0):rr.drawImage(v(Math.ceil(p*.05),steelseries.ColorDef.BLUE.dark.getRgbaColor(),!1,y),0,0)),ci&&(y?ir.drawImage(v(Math.ceil(a*.05),steelseries.ColorDef.RED.medium.getRgbaColor(),!1,y),0,0):ir.drawImage(v(Math.ceil(p*.05),steelseries.ColorDef.RED.medium.getRgbaColor(),!1,y),0,0)),i&&(ar(b,kr,y),cr&&(b.save(),y?(t=e*.856796-e*.728155*(rt/(c-h)),b.translate(u*.435714-Math.ceil(u*.046728)-2,t-Math.ceil(u*.046728)/2)):(t=(u*.856796-u*.12864)*rt/(c-h),b.translate(u*.142857-Math.ceil(e*.046728)/2+t,e*.571428+2)),b.drawImage(wr(y),0,0),b.restore()),y?at(b,u,e,vi,li,ut,y,null,ti):at(b,u,e,vi,li,ut,y,null,ti),ti&&(y?(ii=w(u*.571428,e*.055,ft),b.drawImage(ii,(u-u*.571428)/2,e*.88)):(ii=w(u*.18,e*.15,ft),b.drawImage(ii,u*.695,e*.22)))),f&&nr(di,u,e,y,!1)},gt=function(n){n=n||{};var r=undefined===n.frame?!1:n.frame,u=undefined===n.background?!1:n.background,t=undefined===n.led?!1:n.led,i=undefined===n.foreground?!1:n.foreground;r&&(pt.width=a,pt.height=p,lr=pt.getContext("2d")),u&&(vt.width=a,vt.height=p,b=vt.getContext("2d")),t&&(st.width=Math.ceil(a*.093457),st.height=Math.ceil(p*.093457),ui=st.getContext("2d"),nt.width=Math.ceil(a*.093457),nt.height=Math.ceil(p*.093457),ei=nt.getContext("2d"),ot=nt),i&&(yt.width=a,yt.height=p,di=yt.getContext("2d"))},ni=function(n){n?sr=setInterval(pr,1e3):clearInterval(sr)},pr=function(){wi&&(ot=ot===st?nt:st,tu.repaint())},vr=function(n,t,i){var e=t<i,f,y,r=ut.labelColor,u,o,a,g,nt,d,ft,rt,it,st,ot,et,tt,b,k,v,s,p,w;e?(f=i*.12864,y=i*.856796,u=y-f,o=u*(l-h)/(c-h),a=f+u-o,g=0,nt=f,d=0,ft=f+u):(f=t*.856796,y=t*.142857,u=f-t*.12864,o=u*(l-h)/(c-h),a=y,g=f,nt=0,d=y,ft=0),v=n.createLinearGradient(g,nt,d,ft),r.setAlpha(.047058),v.addColorStop(0,r.getRgbaColor()),r.setAlpha(.145098),v.addColorStop(.48,r.getRgbaColor()),r.setAlpha(.149019),v.addColorStop(.49,r.getRgbaColor()),r.setAlpha(.047058),v.addColorStop(1,r.getRgbaColor()),n.fillStyle=v,e?n.fillRect(t*.435714,f,t*.142857,u):n.fillRect(t*.142857,i*.435714,u,i*.142857),e?(rt=0,it=f,st=0,ot=f+u):(rt=t*.142857+u,it=0,st=t*.142857,ot=0),s=n.createLinearGradient(rt,it,st,ot),r.setAlpha(.298039),s.addColorStop(0,r.getRgbaColor()),r.setAlpha(.686274),s.addColorStop(.48,r.getRgbaColor()),r.setAlpha(.698039),s.addColorStop(.49,r.getRgbaColor()),r.setAlpha(.4),s.addColorStop(1,r.getRgbaColor()),n.fillStyle=s,e?(n.fillRect(t*.435714,f,t*.007142,u),n.fillRect(t*.571428,f,t*.007142,u)):(n.fillRect(t*.142857,i*.435714,u,i*.007142),n.fillRect(t*.142857,i*.571428,u,i*.007142)),e?(valueStartX=t*.45,valueStartY=0,valueStopX=t*.45+t*.114285,valueStopY=0):(valueStartX=0,valueStartY=i*.45,valueStopX=0,valueStopY=i*.45+i*.114285),p=n.createLinearGradient(valueStartX,valueStartY,valueStopX,valueStopY),p.addColorStop(0,dt.medium.getRgbaColor()),p.addColorStop(.99,dt.light.getRgbaColor()),p.addColorStop(1,dt.light.getRgbaColor()),n.fillStyle=p,e?n.fillRect(t*.45,a,t*.114285,o):n.fillRect(a,i*.45,o,i*.114285),e?(et=t*.45,tt=0,b=t*.45+t*.05,k=0):(et=0,tt=i*.45,b=0,k=i*.45+i*.05),w=n.createLinearGradient(et,tt,b,k),w.addColorStop(0,"rgba(255, 255, 255, 0.7)"),w.addColorStop(1,"rgba(255, 255, 255, 0.05)"),n.fillStyle=w,e?n.fillRect(t*.45,a,t*.05,o):n.fillRect(a,i*.45,o,i*.05)};return this.setValue=function(n){var t=n<h?h:n>c?c:n;l!==t&&(l=t,l>tt&&(tt=l),l<it&&(it=l),l<rt||k?l<rt&&(k=!1,ni(k),hi&<.pause()):(k=!0,ni(k),hi&<.play()),this.repaint())},this.getValue=function(){return l},this.setValueAnimated=function(n){var i=n<h?h:n>c?c:n,t;l!==i&&(undefined!==et&&et.playing&&et.stop(),et=new Tween({},"",Tween.regularEaseInOut,l,i,1),t=this,et.onMotionChanged=function(n){l=n.target._pos,l<rt||k?l<rt&&(k=!1,ni(k)):(k=!0,ni(k)),l>tt&&(tt=l),l<it&&(it=l),t.repaint()},et.start())},this.resetMinMeasuredValue=function(){it=l,this.repaint()},this.resetMaxMeasuredValue=function(){tt=l,this.repaint()},this.setMinMeasuredValueVisible=function(n){oi=n,this.repaint()},this.setMaxMeasuredValueVisible=function(n){ci=n,this.repaint()},this.setThresholdVisible=function(n){cr=n,this.repaint()},this.setLcdDecimals=function(n){bi=n,this.repaint()},this.setFrameDesign=function(n){gt({frame:!0}),tr=n,d({frame:!0}),this.repaint()},this.setBackgroundColor=function(n){gt({background:!0}),ut=n,d({background:!0}),this.repaint()},this.setValueColor=function(n){dt=n,this.repaint()},this.setLedColor=function(n){gt({led:!0}),ct=n,d({led:!0}),this.repaint()},this.setLcdColor=function(n){gt({background:!0}),ft=n,d({background:!0}),this.repaint()},this.setMaxMeasuredValue=function(n){var t=n<h?h:n>c?c:n;tt=t,this.repaint()},this.setMinMeasuredValue=function(n){var t=n<h?h:n>c?c:n;it=t,this.repaint()},this.setTitleString=function(n){vi=n,d({background:!0}),this.repaint()},this.setUnitString=function(n){li=n,d({background:!0}),this.repaint()},this.setMinValue=function(n){h=n,d({background:!0,foreground:!0,pointer:!0}),this.repaint()},this.getMinValue=function(){return h},this.setMaxValue=function(n){c=n,d({background:!0,foreground:!0,pointer:!0}),this.repaint()},this.getMaxValue=function(){return c},this.setThreshold=function(n){var t=n<h?h:n>c?c:n;rt=t,d({background:!0}),this.repaint()},this.repaint=function(){er||d({frame:!0,background:!0,led:!0,foreground:!0});var n;s.clearRect(0,0,s.canvas.width,s.canvas.height),s.drawImage(pt,0,0),s.drawImage(vt,0,0),ti&&nu(l,y),wi&&(l<rt&&(k=!1,ot=nt),s.drawImage(ot,si,pi)),oi&&(s.save(),y?(n=e*.856796-e*.728155*(it/(c-h)),s.translate(u*.37-Math.ceil(u*.05)-2,n-Math.ceil(u*.05)/2+1)):(n=(u*.856796-u*.12864)*it/(c-h),s.translate(u*.142857-Math.ceil(e*.05)/2+n,e*.63+2)),s.drawImage(ki,0,0),s.restore()),ci&&(s.save(),y?(n=e*.856796-e*.728155*(tt/(c-h)),s.translate(u*.37-Math.ceil(u*.05)-2,n-Math.ceil(u)*.05/2+1)):(n=(u*.856796-u*.12864)*tt/(c-h),s.translate(u*.142857-Math.ceil(e*.05)/2+n,e*.63+2)),s.drawImage(fr,0,0),s.restore()),s.save(),vr(s,u,e),s.restore(),s.drawImage(yt,0,0)},this.repaint(),this},fu=function(n,i){var ri,ni,k;i=i||{};var y=undefined===i.width?140:i.width,p=undefined===i.height?320:i.height,e=undefined===i.minValue?0:i.minValue,c=undefined===i.maxValue?e+100:i.maxValue,ht=undefined===i.section?null:i.section,uu=undefined===i.useSectionColors?!1:i.useSectionColors,su=undefined===i.niceScale?!0:i.niceScale,rt=undefined===i.threshold?(c-e)/2:i.threshold,di=undefined===i.titleString?"":i.titleString,tr=undefined===i.unitString?"":i.unitString,yr=undefined===i.frameDesign?steelseries.FrameDesign.METAL:i.frameDesign,ru=undefined===i.frameVisible?!0:i.frameVisible,ot=undefined===i.backgroundColor?steelseries.BackgroundColor.DARK_GRAY:i.backgroundColor,ii=undefined===i.valueColor?steelseries.ColorDef.RED:i.valueColor,ct=undefined===i.lcdColor?steelseries.LcdColor.STANDARD:i.lcdColor,hi=undefined===i.lcdVisible?!0:i.lcdVisible,vr=undefined===i.lcdDecimals?2:i.lcdDecimals,wu=undefined===i.digitalFont?!1:i.digitalFont,gt=undefined===i.ledColor?steelseries.LedColor.RED_LED:i.ledColor,hr=undefined===i.ledVisible?!0:i.ledVisible,sr=undefined===i.thresholdVisible?!0:i.thresholdVisible,ki=undefined===i.minMeasuredValueVisible?!1:i.minMeasuredValueVisible,wi=undefined===i.maxMeasuredValueVisible?!1:i.maxMeasuredValueVisible,pu=undefined===i.labelNumberFormat?steelseries.LabelNumberFormat.STANDARD:i.labelNumberFormat,bi=undefined===i.playAlarm?!1:i.playAlarm,tu=undefined===i.alarmSound?!1:i.alarmSound,et=undefined===i.valueGradient?null:i.valueGradient,au=undefined===i.useValueGradient?!1:i.useValueGradient;bi&&tu!==!1&&(ri=r.createElement("audio"),ri.setAttribute("src",tu),ri.setAttribute("preload","auto"));var hu=this,l=e,it=c,ut=e,yt,nt=!1,kt=!1,li=!1,tt=[],kr=0,h=r.getElementById(n).getContext("2d");h.save(),h.clearRect(0,0,h.canvas.width,h.canvas.height),h.canvas.width=y,h.canvas.height=p;var u=h.canvas.width,s=h.canvas.height,a=y<=p,ir,fr,or,rr;a?(ir=.453271*u,fr=18/s*s,or=Math.floor(u/10)+"px sans-serif",rr=Math.floor(u/10)+"px LCDMono2Ultra"):(ir=(u-34)/u*u,fr=.453271*s,or=Math.floor(s/10)+"px sans-serif",rr=Math.floor(s/10)+"px LCDMono2Ultra");var dr=!1,fi=e,ei=c,oi=c-e,gr=ei-fi,ui=0,st=0,wt=10,cu=10,lu=function(){su?(oi=f(c-e,!1),st=f(oi/(cu-1),!0),fi=Math.floor(e/st)*st,ei=Math.ceil(c/st)*st,ui=f(st/(wt-1),!0),e=fi,c=ei,gr=c-e):(oi=c-e,fi=e,ei=c,gr=oi,ui=1,st=10)},bt=t(y,p),br=bt.getContext("2d"),dt=t(y,p),g=dt.getContext("2d"),ai,d=r.createElement("canvas");a?(d.width=u*.121428,d.height=s*.012135):(d.width=u*.012135,d.height=s*.121428),ni=d.getContext("2d"),k=r.createElement("canvas"),a?(k.width=u*.121428,k.height=s*.012135):(k.width=u*.012135,k.height=s*.121428);var nu=k.getContext("2d"),vt=t(Math.ceil(y*.093457),Math.ceil(y*.093457)),yi=vt.getContext("2d"),ft=t(Math.ceil(y*.093457),Math.ceil(y*.093457)),vi=ft.getContext("2d"),lt=ft,pr=t(Math.ceil(y*.028037),Math.ceil(y*.028037)),wr=pr.getContext("2d"),lr=t(Math.ceil(y*.028037),Math.ceil(y*.028037)),ar=lr.getContext("2d"),ti=t(y,p),cr=ti.getContext("2d"),vu=function(n,t){h.save(),h.textAlign="right",h.textBaseline="middle",h.strokeStyle=ct.textColor,h.fillStyle=ct.textColor,(ct===steelseries.LcdColor.STANDARD||ct===steelseries.LcdColor.STANDARD_GREEN)&&(h.shadowColor="gray",t?(h.shadowOffsetX=u*.007,h.shadowOffsetY=u*.007,h.shadowBlur=u*.009):(h.shadowOffsetX=s*.007,h.shadowOffsetY=s*.007,h.shadowBlur=s*.009));var f,r,i;h.font=wu?rr:or,t?(f=(u-u*.571428)/2+1+u*.571428-2,r=s*.88+1+(s*.055-2)/2,i=u*.7-2):(f=u*.695+u*.18-2,r=s*.22+1+(s*.15-2)/2,i=s*.22-2),h.fillText(n.toFixed(vr),f,r,i),h.restore()},yu=function(n){var i=r.createElement("canvas"),t,f;return i.width=n?Math.ceil(u*.046728):Math.ceil(s*.046728),i.height=Math.ceil(i.width*.9),t=i.getContext("2d"),t.save(),f=t.createLinearGradient(0,.1,0,i.height*.9),f.addColorStop(0,"#520000"),f.addColorStop(.3,"#fc1d00"),f.addColorStop(.59,"#fc1d00"),f.addColorStop(1,"#520000"),t.fillStyle=f,n?(t.beginPath(),t.moveTo(.1,i.height*.5),t.lineTo(i.width*.9,.1),t.lineTo(i.width*.9,i.height*.9),t.closePath()):(t.beginPath(),t.moveTo(.1,.1),t.lineTo(i.width*.9,.1),t.lineTo(i.width*.5,i.height*.9),t.closePath()),t.fill(),t.strokeStyle="#FFFFFF",t.stroke(),t.restore(),i},iu=function(n,t,i){var f,b,l;ot.labelColor.setAlpha(1),n.save(),n.textBaseline="middle",f=u*.1,n.strokeStyle=ot.labelColor.getRgbaColor(),n.fillStyle=ot.labelColor.getRgbaColor();var r=e,a=wt-1,k,d,w,o,h=1,g,tt,nt,y,v,p;for(i?(g=.34*u,tt=.36*u,nt=.33*u,y=.36*u,v=.32*u,p=.36*u,n.textAlign="right",k=0,d=s*.12864,w=0,o=s*.856796-s*.12864,h=o/(c-e)):(g=.65*s,tt=.63*s,nt=.66*s,y=.63*s,v=.67*s,p=.63*s,n.textAlign="center",k=u*.142857,d=0,w=u*.871012-u*.142857,o=0,h=w/(c-e)),b=e,l=0;b<=c;b+=ui,l+=ui){currentPos=i?d+o-l*h:k+l*h,a++;if(a===wt){n.lineWidth=1.5,pi(n,v,p,currentPos,i);if(i)switch(t.format){case"fractional":n.fillText(r.toFixed(2),u*.28,currentPos,f);break;case"scientific":n.fillText(r.toPrecision(2),u*.28,currentPos,f);break;case"standard":default:n.fillText(r.toFixed(0),u*.28,currentPos,f)}else switch(t.format){case"fractional":n.fillText(r.toFixed(2),currentPos,s*.73,f);break;case"scientific":n.fillText(r.toPrecision(2),currentPos,s*.73,f);break;case"standard":default:n.fillText(r.toFixed(0),currentPos,s*.73,f)}r+=st,a=0;continue}0==wt%2&&a===wt/2?(n.lineWidth=1,pi(n,nt,y,currentPos,i)):(n.lineWidth=.5,pi(n,g,tt,currentPos,i))}n.restore()},pi=function(n,t,i,r,u){u?(n.beginPath(),n.moveTo(t,r),n.lineTo(i,r),n.closePath(),n.stroke()):(n.beginPath(),n.moveTo(r,t),n.lineTo(r,i),n.closePath(),n.stroke())},b=function(n){var i,t,r,h,f,l;n=n||{};var d=undefined===n.frame?!1:n.frame,b=undefined===n.background?!1:n.background,it=undefined===n.led?!1:n.led,nt=undefined===n.foreground?!1:n.foreground,k=undefined===n.bargraphled?!1:n.bargraphled;dr=!0,lu(),d&&ru&&ur(br,yr,u,s,a),b&&gi(g,ot,u,s),it&&(a?(yi.drawImage(o(Math.ceil(y*.093457),1,gt),0,0),vi.drawImage(o(Math.ceil(y*.093457),0,gt),0,0)):(yi.drawImage(o(Math.ceil(p*.093457),1,gt),0,0),vi.drawImage(o(Math.ceil(p*.093457),0,gt),0,0))),ki&&(a?wr.drawImage(v(Math.ceil(y*.05),steelseries.ColorDef.BLUE.dark.getRgbaColor(),!1,a),0,0):wr.drawImage(v(Math.ceil(p*.05),steelseries.ColorDef.BLUE.dark.getRgbaColor(),!1,a),0,0)),wi&&(a?ar.drawImage(v(Math.ceil(y*.05),steelseries.ColorDef.RED.medium.getRgbaColor(),!1,a),0,0):ar.drawImage(v(Math.ceil(p*.05),steelseries.ColorDef.RED.medium.getRgbaColor(),!1,a),0,0)),b&&(iu(g,pu,a),sr&&(g.save(),a?(i=s*.856796-s*.728155*(rt/(c-e)),g.translate(u*.435714-Math.ceil(u*.046728)-2,i-Math.ceil(u*.046728)/2)):(i=(u*.856796-u*.12864)*rt/(c-e),g.translate(u*.142857-Math.ceil(s*.046728)/2+i,s*.571428+2)),g.drawImage(yu(a),0,0),g.restore()),a?at(g,u,s,di,tr,ot,a,null,hi):at(g,u,s,di,tr,ot,a,null,hi),hi&&(a?(ai=w(u*.571428,s*.055,ct),g.drawImage(ai,(u-u*.571428)/2,s*.88)):(ai=w(u*.18,s*.15,ct),g.drawImage(ai,u*.695,s*.22)))),k&&(ou(nu),er(ni,ii)),kt=!1;if(null!==ht&&0<ht.length){kt=!0,t=ht.length,a?(r=s*.12864,h=s*.856796,f=h-r,l=0):(r=u*.856796,h=u*.12864,f=r-h,l=u*.012135/2),tt=[];do t--,tt.push({start:(ht[t].start+Math.abs(e))/(c-e)*f-l,stop:(ht[t].stop+Math.abs(e))/(c-e)*f-l,color:pt(ht[t].color)});while(0<t)}li=!1,au&&et!==null&&(kt=!1,li=!0),nt&&nr(cr,u,s,a,!1)},ci=function(n){n=n||{};var u=undefined===n.frame?!1:n.frame,f=undefined===n.background?!1:n.background,r=undefined===n.led?!1:n.led,t=undefined===n.bargraphled?!1:n.bargraphled,i=undefined===n.foreground?!1:n.foreground;u&&(bt.width=y,bt.height=p,br=bt.getContext("2d")),f&&(dt.width=y,dt.height=p,g=dt.getContext("2d")),t&&(a?(d.width=y*.121428,d.height=p*.012135):(d.width=y*.012135,d.height=p*.121428),ni=d.getContext("2d"),a?(k.width=y*.121428,k.height=p*.012135):(k.width=y*.012135,k.height=p*.121428),nu=k.getContext("2d")),r&&(vt.width=Math.ceil(y*.093457),vt.height=Math.ceil(p*.093457),yi=vt.getContext("2d"),ft.width=Math.ceil(y*.093457),ft.height=Math.ceil(p*.093457),vi=ft.getContext("2d"),lt=ft),i&&(ti.width=y,ti.height=p,cr=ti.getContext("2d"))},si=function(n){n?kr=setInterval(fu,1e3):clearInterval(kr)},fu=function(){hr&&(lt=lt===vt?ft:vt,hu.repaint())},eu=function(n,t,i){var it=t<i,a,st,u=ot.labelColor,r,wt,ti,nt,ft,ct,vt,yt,bt,at,dt,b,w,y,p,v,g,ri,ui,ht,lt,f,o,h,ut,s;it?(a=i*.12864,st=i*.856796,r=st-a,wt=r*(l-e)/(c-e),ti=a+r-wt,nt=0,ft=a,ct=0,vt=a+r):(a=t*.856796,st=t*.12864,r=a-st,wt=r*(l-e)/(c-e),ti=st,nt=t*.142857,ft=i*.435714,ct=nt+r,vt=ft+i*.142857),b=n.createLinearGradient(nt,ft,ct,vt),u.setAlpha(.047058),b.addColorStop(0,u.getRgbaColor()),u.setAlpha(.145098),b.addColorStop(.48,u.getRgbaColor()),u.setAlpha(.149019),b.addColorStop(.49,u.getRgbaColor()),u.setAlpha(.047058),b.addColorStop(1,u.getRgbaColor()),n.fillStyle=b,it?n.fillRect(t*.435714,a,t*.142857,r):n.fillRect(nt,ft,r,i*.142857),it?(yt=0,bt=a,at=0,dt=a+r):(yt=nt,bt=0,at=ct,dt=0),w=n.createLinearGradient(yt,bt,at,dt),u.setAlpha(.298039),w.addColorStop(0,u.getRgbaColor()),u.setAlpha(.686274),w.addColorStop(.48,u.getRgbaColor()),u.setAlpha(.698039),w.addColorStop(.49,u.getRgbaColor()),u.setAlpha(.4),w.addColorStop(1,u.getRgbaColor()),n.fillStyle=w,it?(n.fillRect(t*.435714,a,t*.007142,r),n.fillRect(t*.571428,a,t*.007142,r)):(n.fillRect(t*.142857,i*.435714,r,i*.007142),n.fillRect(t*.142857,i*.571428,r,i*.007142)),it?(y=t*.45,p=i*.851941,v=t*.121428,g=i*.012135,ri=(y+v)/2,ui=(p+g)/2):(y=t*.142857,p=i*.45,v=t*.012135,g=i*.121428,ri=(y+v)/2,ui=(p+g)/2),ut=ii;if(it){for(lt=(c+Math.abs(e))/(c-e)*r,o=0;o<=lt;o+=g+1)n.translate(0,-o),n.drawImage(k,y,p),n.translate(0,o);if(0!==l)for(ht=(l+Math.abs(e))/(c-e)*r,o=0;o<=ht;o+=g+1){h=ii;if(li){var fi=e+o/r*(c-e),gt=et.getEnd()-et.getStart(),rt=fi/gt;rt=Math.max(Math.min(rt,1),0),h=pt(et.getColorAt(rt).getRgbaColor())}else if(kt)for(s=0;s<tt.length;s++)if(o>=tt[s].start&&o<tt[s].stop){h=tt[s].color;break}ut.medium.getHexColor()!=h.medium.getHexColor()&&(er(ni,h),ut=h),n.translate(0,-o),n.drawImage(d,y,p),n.translate(0,o)}}else{for(lt=(c+Math.abs(e))/(c-e)*r,f=-(v/2);f<=lt;f+=v+1)n.translate(f,0),n.drawImage(k,y,p),n.translate(-f,0);if(0!==l)for(ht=(l+Math.abs(e))/(c-e)*r,f=-(v/2);f<=ht;f+=v+1){h=ii;if(li){var fi=e+f/r*(c-e),gt=et.getEnd()-et.getStart(),rt=fi/gt;rt=Math.max(Math.min(rt,1),0),h=pt(et.getColorAt(rt).getRgbaColor())}else if(kt)for(s=0;s<tt.length;s++)if(f>=tt[s].start&&f<tt[s].stop){h=tt[s].color;break}ut.medium.getHexColor()!=h.medium.getHexColor()&&(er(ni,h),ut=h),n.translate(f,0),n.drawImage(d,y,p),n.translate(-f,0)}}},ou=function(n){n.save(),n.beginPath(),n.rect(0,0,n.canvas.width,n.canvas.height),n.closePath();var i=n.canvas.width/2,r=n.canvas.height/2,t=h.createRadialGradient(i,r,0,i,r,n.canvas.width/2);t.addColorStop(0,"#3c3c3c"),t.addColorStop(1,"#323232"),n.fillStyle=t,n.fill(),n.restore()},er=function(n,t){var r,f,u,i;n.save(),n.beginPath(),n.rect(0,0,n.canvas.width,n.canvas.height),n.closePath(),r=n.canvas.width/2,f=n.canvas.height/2,u=a?n.canvas.width/2:n.canvas.height/2,i=h.createRadialGradient(r,f,0,r,f,u),i.addColorStop(0,t.light.getRgbaColor()),i.addColorStop(1,t.dark.getRgbaColor()),n.fillStyle=i,n.fill(),n.restore()};return this.setValue=function(n){var t=n<e?e:n>c?c:n;l!==t&&(l=t,l>ut&&(ut=l),l<it&&(it=l),l<rt||nt?l<rt&&(nt=!1,si(nt),bi&&ri.pause()):(nt=!0,si(nt),bi&&ri.play()),this.repaint())},this.getValue=function(){return l},this.setValueAnimated=function(n){var i=n<e?e:n>c?c:n,t;l!==i&&(undefined!==yt&&yt.playing&&yt.stop(),yt=new Tween({},"",Tween.regularEaseInOut,l,i,1),t=this,yt.onMotionChanged=function(n){l=n.target._pos,l<rt||nt?l<rt&&(nt=!1,si(nt)):(nt=!0,si(nt)),l>ut&&(ut=l),l<it&&(it=l),t.repaint()},yt.start())},this.resetMinMeasuredValue=function(){it=l,this.repaint()},this.resetMaxMeasuredValue=function(){ut=l,this.repaint()},this.setMinMeasuredValueVisible=function(n){ki=n,this.repaint()},this.setMaxMeasuredValueVisible=function(n){wi=n,this.repaint()},this.setThresholdVisible=function(n){sr=n,this.repaint()},this.setLcdDecimals=function(n){vr=n,this.repaint()},this.setFrameDesign=function(n){ci({frame:!0}),yr=n,b({frame:!0}),this.repaint()},this.setBackgroundColor=function(n){ci({background:!0}),ot=n,b({background:!0}),this.repaint()},this.setValueColor=function(n){ci({bargraphled:!0}),ii=n,b({bargraphled:!0}),this.repaint()},this.setLedColor=function(n){ci({led:!0}),gt=n,b({led:!0}),this.repaint()},this.setLcdColor=function(n){ct=n,b({background:!0}),this.repaint()},this.setSection=function(n){ht=n,b(),this.repaint()},this.setSectionActive=function(n){uu=n,b(),this.repaint()},this.setGradient=function(n){et=n,b(),this.repaint()},this.setGradientActive=function(n){useGradient=n,b(),this.repaint()},this.setMaxMeasuredValue=function(n){var t=n<e?e:n>c?c:n;ut!==t&&(ut=t,this.repaint())},this.setMinMeasuredValue=function(n){var t=n<e?e:n>c?c:n;it!==t&&(it=t,this.repaint())},this.setTitleString=function(n){di=n,b({background:!0}),this.repaint()},this.setUnitString=function(n){tr=n,b({background:!0}),this.repaint()},this.setMinValue=function(n){e=n,b({background:!0,foreground:!0,pointer:!0}),this.repaint()},this.getMinValue=function(){return e},this.setMaxValue=function(n){c!==n&&(c=n,b({background:!0,foreground:!0,pointer:!0}),this.repaint())},this.getMaxValue=function(){return c},this.setThreshold=function(n){var t=n<e?e:n>c?c:n;rt!==t&&(rt=t,b({background:!0}),this.repaint())},this.repaint=function(){dr||b({frame:!0,background:!0,led:!0,pointer:!0,foreground:!0,bargraphled:!0}),h.clearRect(0,0,h.canvas.width,h.canvas.height),h.drawImage(bt,0,0),h.drawImage(dt,0,0),hi&&vu(l,a),hr&&(l<rt&&(nt=!1,lt=ft),h.drawImage(lt,ir,fr));var n;ki&&(h.save(),a?(n=s*.856796-s*.728155*(it/(c-e)),h.translate(u*.37-Math.ceil(u*.05)-2,n-Math.ceil(u*.05)/2+1)):(n=(u*.856796-u*.12864)*it/(c-e),h.translate(u*.142857-Math.ceil(s*.05)/2+n,s*.63+2)),h.drawImage(pr,0,0),h.restore()),wi&&(h.save(),a?(n=s*.856796-s*.728155*(ut/(c-e)),h.translate(u*.37-Math.ceil(u*.05)-2,n-Math.ceil(u)*.05/2+1)):(n=(u*.856796-u*.12864)*ut/(c-e),h.translate(u*.142857-Math.ceil(s*.05)/2+n,s*.63+2)),h.drawImage(lr,0,0),h.restore()),h.save(),eu(h,u,s),h.restore(),h.drawImage(ti,0,0)},this.repaint(),this},au=function(n,i){i=i||{};var y=undefined===i.width?128:i.width,p=undefined===i.height?48:i.height,a=undefined===i.lcdColor?steelseries.LcdColor.STANDARD:i.lcdColor,vt=undefined===i.lcdDecimals?2:i.lcdDecimals,tt=undefined===i.unitString?"":i.unitString,ht=undefined===i.unitStringVisible?!1:i.unitStringVisible,ct=undefined===i.digitalFont?!1:i.digitalFont,pt=undefined===i.valuesNumeric?!0:i.valuesNumeric,v=undefined===i.value?0:i.value,st=undefined===i.autoScroll?!1:i.autoScroll,o=undefined===i.section?null:i.section,c=!1,s=0,nt,wt=this,u=r.getElementById(n).getContext("2d");u.save(),u.clearRect(0,0,u.canvas.width,u.canvas.height),u.canvas.width=y,u.canvas.height=p;var h=y,f=p,l=0,et=Math.floor(f/1.5)+"px sans-serif",it=Math.floor(f/1.5)+"px LCDMono2Ultra",ot=!1,rt,ft=[],ut=[],bt=function(n,t){var r,i;u.save(),u.textAlign="right",u.textBaseline="middle",u.strokeStyle=t,u.fillStyle=t,(a===steelseries.LcdColor.STANDARD||a===steelseries.LcdColor.STANDARD_GREEN)&&o===null&&(u.shadowColor="gray",u.shadowOffsetX=f*.05,u.shadowOffsetY=f*.05,u.shadowBlur=f*.06),u.beginPath(),u.rect(2,2,h-4,f-4),u.closePath(),u.clip(),pt?(u.font=Math.floor(f/2.5)+"px sans-serif",r=0,l=0,ht&&(u.font=Math.floor(f/2.5)+"px sans-serif",r=u.measureText(tt).width),u.font=ct?it:et,i=n.toFixed(vt),l=u.measureText(i).width,u.fillText(i,h-r-4-s,f*.5),ht&&(u.font=Math.floor(f/2.5)+"px sans-serif",u.fillText(tt,h-2-s,f*.58))):(u.font=ct?it:et,l=u.measureText(n).width,st&&l>h-4?c||(s=h-l-h*.2,c=!0,clearTimeout(nt),nt=setTimeout(b,200)):st&&l<=h-4&&(s=0,c=!1),u.fillText(n,h-2-s,f*.5)),u.restore()},yt=function(n,i,r,u){var ut=t(n,i),f=ut.getContext("2d");f.save();var pt=0,nt=0,kt=n,ot=i,ft=Math.min(n,i)*.095,h=f.createLinearGradient(0,nt,0,nt+ot);h.addColorStop(0,"rgb(76, 76, 76)"),h.addColorStop(.08,"rgb(102, 102, 102)"),h.addColorStop(.92,"rgb(102, 102, 102)"),h.addColorStop(1,"rgb(230, 230, 230)"),f.fillStyle=h,e(f,pt,nt,kt,ot,ft),f.fill(),f.restore(),f.save();var it=k(r),o=g(it[0],it[1],it[2]),tt=k(u.gradientStartColor),ht=g(tt[0],tt[1],tt[2]),rt=k(u.gradientFraction1Color),at=g(rt[0],rt[1],rt[2]),a=k(u.gradientFraction2Color),ct=g(a[0],a[1],a[2]),v=k(u.gradientFraction3Color),wt=g(v[0],v[1],v[2]),c=k(u.gradientStopColor),yt=g(c[0],c[1],c[2]),l=lt(o[0],o[1],ht[2]-.31),y=lt(o[0],o[1],at[2]-.31),d=lt(o[0],o[1],ct[2]-.31),p=lt(o[0],o[1],wt[2]-.31),w=lt(o[0],o[1],yt[2]-.31),bt=1,b=1,st=n-2,et=i-2,vt=ft-1,s=f.createLinearGradient(0,b,0,b+et);return s.addColorStop(0,"rgb("+l[0]+", "+l[1]+", "+l[2]+")"),s.addColorStop(.03,"rgb("+y[0]+","+y[1]+","+y[2]+")"),s.addColorStop(.49,"rgb("+d[0]+","+d[1]+","+d[2]+")"),s.addColorStop(.5,"rgb("+p[0]+","+p[1]+","+p[2]+")"),s.addColorStop(1,"rgb("+w[0]+","+w[1]+","+w[2]+")"),f.fillStyle=s,e(f,bt,b,st,et,vt),f.fill(),f.restore(),ut},at=function(n){var i=k(n),r=g(i[0],i[1],i[2]),t=lt(r[0],.57,.83);return"rgb("+t[0]+", "+t[1]+", "+t[2]+")"},b=function(){c?(s>h&&(s=-l),s+=2,nt=setTimeout(b,60)):s=0,wt.repaint()},d=function(){ot=!0,rt=w(y,p,a);if(null!==o&&0<o.length)for(var n=0;n<o.length;n++)ft[n]=yt(y,p,o[n].color,a),ut[n]=at(o[n].color)};return this.setValue=function(n){v!==n&&(v=n,this.repaint())},this.setLcdColor=function(n){a=n,d(),this.repaint()},this.setSection=function(n){o=n,resetBuffers({foreground:!0}),d({background:!0,foreground:!0}),this.repaint()},this.setScrolling=function(n){if(n){if(c)return;c=n,b()}else c=n},this.repaint=function(){var t,i,n;ot||d(),u.clearRect(0,0,u.canvas.width,u.canvas.height),t=rt,i=a.textColor;if(null!==o&&0<o.length)for(n=0;n<o.length;n++)if(v>=o[n].start&&v<=o[n].stop){t=ft[n],i=ut[n];break}u.drawImage(t,0,0),bt(v,i)},this.repaint(),this},vu=function(n,t){t=t||{};var h=undefined===t.width?128:t.width,c=undefined===t.height?64:t.height,f=undefined===t.lcdColor?steelseries.LcdColor.STANDARD:t.lcdColor,k=undefined===t.lcdDecimals?2:t.lcdDecimals,d=undefined===t.unitString?"":t.unitString,b=undefined===t.unitStringVisible?!1:t.unitStringVisible,p=undefined===t.digitalFont?!1:t.digitalFont,rt=undefined===t.valuesNumeric?!0:t.valuesNumeric,o=undefined===t.value?0:t.value,s=0,i=r.getElementById(n).getContext("2d");i.save(),i.clearRect(0,0,i.canvas.width,i.canvas.height),i.canvas.width=h,i.canvas.height=c;var e=h,u=c,g=Math.floor(u/1.875)+"px sans-serif",tt=Math.floor(u/1.875)+"px LCDMono2Ultra",y=Math.floor(u/3.5)+"px sans-serif",it=Math.floor(u/3.5)+"px LCDMono2Ultra",v=!1,l,nt=function(n){var t,o,r;i.save(),i.textAlign="right",i.textBaseline="middle",i.strokeStyle=f.textColor,i.fillStyle=f.textColor,(f===steelseries.LcdColor.STANDARD||f===steelseries.LcdColor.STANDARD_GREEN)&&(i.shadowColor="gray",i.shadowOffsetX=u*.05,i.shadowOffsetY=u*.05,i.shadowBlur=u*.06),rt?(i.font=Math.floor(u/2.5)+"px sans-serif",t=0,b&&(i.font=Math.floor(u/2.5)+"px sans-serif",t=i.measureText(d).width),i.font=p?tt:g,o=n.toFixed(k),i.fillText(o,e-t-4,u*.38),b&&(i.font=Math.floor(u/3)+"px sans-serif",i.fillText(d,e-2,u*.46)),r=s.toFixed(k),i.font=p?it:y,i.textAlign="center",i.fillText(r,e/2,u*.8)):(i.font=Math.floor(u/2.5)+"px sans-serif",i.fillText(n,e-2,u*.38),i.font=y,i.textAlign="center",i.fillText(s,e/2,u*.8)),i.restore()},a=function(){v=!0,l=w(h,c,f)};return this.setValue=function(n){(o!==n||s!==n)&&(s=o,o=n,this.repaint())},this.setLcdColor=function(n){f=n,a(),this.repaint()},this.repaint=function(){v||a(),i.clearRect(0,0,i.canvas.width,i.canvas.height),i.drawImage(l,0,0),nt(o)},this.repaint(),this},cu=function(n,u){u=u||{};var c=undefined===u.size?200:u.size,ot=undefined===u.decimalsVisible?!1:u.decimalsVisible,bt=undefined===u.textOrientationFixed?!1:u.textOrientationFixed,ht=undefined===u.frameDesign?steelseries.FrameDesign.METAL:u.frameDesign,kt=undefined===u.frameVisible?!0:u.frameVisible,a=undefined===u.backgroundColor?steelseries.BackgroundColor.DARK_GRAY:u.backgroundColor,w=undefined===u.pointerColor?steelseries.ColorDef.RED:u.pointerColor,vt=undefined===u.foregroundType?steelseries.ForegroundType.TYPE1:u.foregroundType,d,e=0,k=0,h=0,pt=Math.PI/180,st=this.value,ct=ot?1:0,s=r.getElementById(n).getContext("2d");s.save(),s.clearRect(0,0,s.canvas.width,s.canvas.height),s.canvas.width=c,s.canvas.height=c;var f=c,o=c,v=f/2,l=o/2,yt=!1,it=t(c,c),ut=it.getContext("2d"),g=t(c,c),et=g.getContext("2d"),nt=t(c,c),lt=nt.getContext("2d"),tt=t(c,c),at=tt.getContext("2d"),dt=function(n){n.textAlign="center",n.textBaseline="middle",n.save(),n.strokeStyle=a.labelColor.getRgbaColor(),n.fillStyle=a.labelColor.getRgbaColor(),n.translate(v,l);var r,t;for(i=0;360>i;i++){n.strokeStyle=a.labelColor.getRgbaColor(),n.lineWidth=.5,n.beginPath(),n.moveTo(f*.38,0),n.lineTo(f*.37,0),n.closePath(),n.stroke(),0==i%5&&(n.strokeStyle=a.labelColor.getRgbaColor(),n.lineWidth=1,n.beginPath(),n.moveTo(f*.38,0),n.lineTo(f*.36,0),n.closePath(),n.stroke()),0==i%45&&(n.strokeStyle=a.labelColor.getRgbaColor(),n.lineWidth=1,n.beginPath(),n.moveTo(f*.38,0),n.lineTo(f*.34,0),n.closePath(),n.stroke()),300<f&&(r="14px sans-serif",t="12px sans-serif"),300<f||(r="12px sans-serif",t="10px sans-serif"),200<f||(r="10px sans-serif",t="8px sans-serif"),100<f||(r="8px sans-serif",t="6px sans-serif"),n.save();switch(i){case 0:n.translate(f*.31,0),n.rotate(i*Math.PI/180+Math.PI/2),n.font=r,n.fillText("0\u00b0",0,0,f),n.rotate(-(i*Math.PI/180)+Math.PI/2),n.translate(-f*.31,0),n.translate(f*.41,0),n.rotate(i*Math.PI/180-Math.PI/2),n.font=t,n.fillText("0%",0,0,f);break;case 45:n.translate(f*.31,0),n.rotate(i*Math.PI/180+.25*Math.PI),n.font=r,n.fillText("45\u00b0",0,0,f),n.rotate(-(i*Math.PI/180)+.25*Math.PI),n.translate(-f*.31,0),n.translate(f*.31,f*.085),n.rotate(i*Math.PI/180-.25*Math.PI),n.font=t,n.fillText("100%",0,0,f);break;case 90:n.translate(f*.31,0),n.rotate(i*Math.PI/180),n.font=r,n.fillText("90\u00b0",0,0,f),n.rotate(-(i*Math.PI/180)),n.translate(-f*.31,0),n.translate(f*.21,0),n.rotate(i*Math.PI/180),n.font=t,n.fillText("\u221e",0,0,f);break;case 135:n.translate(f*.31,0),n.rotate(i*Math.PI/180-.25*Math.PI),n.font=r,n.fillText("45\u00b0",0,0,f),n.rotate(-(i*Math.PI/180)-.25*Math.PI),n.translate(-f*.31,0),n.translate(f*.31,-f*.085),n.rotate(i*Math.PI/180+.25*Math.PI),n.font=t,n.fillText("100%",0,0,f);break;case 180:n.translate(f*.31,0),n.rotate(i*Math.PI/180-Math.PI/2),n.font=r,n.fillText("0\u00b0",0,0,f),n.rotate(-(i*Math.PI/180)-Math.PI/2),n.translate(-f*.31,0),n.translate(f*.41,0),n.rotate(i*Math.PI/180+Math.PI/2),n.font=t,n.fillText("0%",0,0,f),n.translate(-f*.41,0);break;case 225:n.translate(f*.31,0),n.rotate(i*Math.PI/180-.75*Math.PI),n.font=r,n.fillText("45\u00b0",0,0,f),n.rotate(-(i*Math.PI/180)-.75*Math.PI),n.translate(-f*.31,0),n.translate(f*.31,f*.085),n.rotate(i*Math.PI/180+.75*Math.PI),n.font=t,n.fillText("100%",0,0,f);break;case 270:n.translate(f*.31,0),n.rotate(i*Math.PI/180-Math.PI),n.font=r,n.fillText("90\u00b0",0,0,f),n.rotate(-(i*Math.PI/180)-Math.PI),n.translate(-f*.31,0),n.translate(f*.21,0),n.rotate(i*Math.PI/180-Math.PI),n.font=t,n.fillText("\u221e",0,0,f);break;case 315:n.translate(f*.31,0),n.rotate(i*Math.PI/180-1.25*Math.PI),n.font=r,n.fillText("45\u00b0",0,0,f),n.rotate(-(i*Math.PI/180)-1.25*Math.PI),n.translate(-f*.31,0),n.translate(f*.31,-f*.085),n.rotate(i*Math.PI/180+1.25*Math.PI),n.font=t,n.fillText("100%",0,0,f)}n.restore(),n.rotate(pt)}n.translate(-v,-l),n.restore()},gt=function(n){n.save(),n.strokeStyle=a.labelColor.getRgbaColor(),n.fillStyle=a.labelColor.getRgbaColor(),n.save(),n.beginPath(),n.moveTo(f*.200934,o*.434579),n.lineTo(f*.163551,o*.434579),n.lineTo(f*.163551,o*.560747),n.lineTo(f*.200934,o*.560747),n.lineWidth=1,n.lineCap="square",n.lineJoin="miter",n.stroke(),n.save(),n.beginPath(),n.moveTo(f*.163551,o*.471962),n.lineTo(f*.205607,o*.5),n.lineTo(f*.163551,o*.523364),n.lineTo(f*.163551,o*.471962),n.closePath(),n.fill(),n.save(),n.beginPath(),n.moveTo(f*.799065,o*.434579),n.lineTo(f*.836448,o*.434579),n.lineTo(f*.836448,o*.560747),n.lineTo(f*.799065,o*.560747),n.lineWidth=1,n.lineCap="square",n.lineJoin="miter",n.stroke(),n.save(),n.beginPath(),n.moveTo(f*.836448,o*.471962),n.lineTo(f*.794392,o*.5),n.lineTo(f*.836448,o*.523364),n.lineTo(f*.836448,o*.471962),n.closePath(),n.fill(),n.restore()},ni=function(n){var u;n.save(),n.save(),n.beginPath(),n.moveTo(f*.523364,o*.350467),n.lineTo(f*.5,o*.130841),n.lineTo(f*.476635,o*.350467),n.bezierCurveTo(f*.476635,o*.350467,f*.490654,o*.345794,f*.5,o*.345794),n.bezierCurveTo(f*.509345,o*.345794,f*.523364,o*.350467,f*.523364,o*.350467),n.closePath();var t=n.createLinearGradient(0,.154205*o,0,.350466*o),r=w.dark,i=w.light;r.setAlpha(.70588),i.setAlpha(.70588),t.addColorStop(0,r.getRgbaColor()),t.addColorStop(.3,i.getRgbaColor()),t.addColorStop(.59,i.getRgbaColor()),t.addColorStop(1,r.getRgbaColor()),n.fillStyle=t,u=w.light.getRgbaColor(),n.lineWidth=1,n.lineCap="square",n.lineJoin="miter",n.strokeStyle=u,n.fill(),n.stroke(),r.setAlpha(1),i.setAlpha(1),n.restore()},wt=function(n){var i,t,u,s,r,e;n.save(),i=w.dark,t=w.light,i.setAlpha(.70588),t.setAlpha(.70588),n.save(),n.beginPath(),n.moveTo(f*.285046,o*.514018),n.lineTo(f*.21028,o*.5),n.lineTo(f*.285046,o*.481308),n.bezierCurveTo(f*.285046,o*.481308,f*.280373,o*.490654,f*.280373,o*.495327),n.bezierCurveTo(f*.280373,o*.504672,f*.285046,o*.514018,f*.285046,o*.514018),n.closePath(),u=n.createLinearGradient(.224299*f,0,.289719*f,0),u.addColorStop(0,i.getRgbaColor()),u.addColorStop(.3,t.getRgbaColor()),u.addColorStop(.59,t.getRgbaColor()),u.addColorStop(1,i.getRgbaColor()),n.fillStyle=u,s=w.light.getRgbaColor(),n.lineWidth=1,n.lineCap="square",n.lineJoin="miter",n.strokeStyle=s,n.fill(),n.stroke(),n.save(),n.beginPath(),n.moveTo(f*.714953,o*.514018),n.lineTo(f*.789719,o*.5),n.lineTo(f*.714953,o*.481308),n.bezierCurveTo(f*.714953,o*.481308,f*.719626,o*.490654,f*.719626,o*.495327),n.bezierCurveTo(f*.719626,o*.504672,f*.714953,o*.514018,f*.714953,o*.514018),n.closePath(),r=n.createLinearGradient(.7757*f,0,.71028*f,0),r.addColorStop(0,i.getRgbaColor()),r.addColorStop(.3,t.getRgbaColor()),r.addColorStop(.59,t.getRgbaColor()),r.addColorStop(1,i.getRgbaColor()),n.fillStyle=r,e=w.light.getRgbaColor(),n.lineWidth=1,n.lineCap="square",n.lineJoin="miter",n.strokeStyle=e,n.fill(),n.stroke(),i.setAlpha(1),t.setAlpha(1),n.restore()},rt=function(){yt=!0,kt&&y(ut,ht,v,l,f,o),b(ut,a,v,l,f,o),dt(ut),gt(et),ni(et),wt(lt),p(at,vt,f,o,!1)},ft=function(){it.width=c,it.height=c,ut=it.getContext("2d"),g.width=c,g.height=c,et=g.getContext("2d"),nt.width=c,nt.height=c,lt=nt.getContext("2d"),tt.width=c,tt.height=c,at=tt.getContext("2d")};return this.setValue=function(n){var t;t=0>n?360+n:n,t=359.9<n?n-360:n,e!==t&&(e=t,k=2*(Math.abs(e)*10%10),10<k&&(k-=20),0===e&&(h=90),0<e&&90>=e&&(h=90-e),90<e&&180>=e&&(h=e-90),180<e&&270>=e&&(h=270-e),270<e&&360>=e&&(h=e-270),0>e&&e>=-90&&(h=90-Math.abs(e)),e<-90&&e>=-180&&(h=Math.abs(e)-90),e<-180&&e>=-270&&(h=270-Math.abs(e)),e<-270&&e>=-360&&(h=Math.abs(e)-270),this.repaint())},this.getValue=function(){return e},this.setValueAnimated=function(n){360-n+e<n-e&&(n=360-n);if(e!==n){undefined!==d&&d.playing&&d.stop(),d=new Tween({},"",Tween.regularEaseInOut,e,n,1);var t=this;d.onMotionChanged=function(n){e=n.target._pos,k=2*(Math.abs(e)*10%10),10<k&&(k-=20),0===e&&(h=90),0<e&&90>=e&&(h=90-e),90<e&&180>=e&&(h=e-90),180<e&&270>=e&&(h=270-e),270<e&&360>=e&&(h=e-270),0>e&&e>=-90&&(h=90-Math.abs(e)),e<-90&&e>=-180&&(h=Math.abs(e)-90),e<-180&&e>=-270&&(h=270-Math.abs(e)),e<-270&&e>=-360&&(h=Math.abs(e)-270),t.repaint()},d.start()}},this.setFrameDesign=function(n){ft(),ht=n,rt(),this.repaint()},this.setBackgroundColor=function(n){ft(),a=n,rt(),this.repaint()},this.setForegroundType=function(n){ft(),vt=n,rt(),this.repaint()},this.setPointerColor=function(n){ft(),w=n,rt(),this.repaint()},this.repaint=function(){yt||rt(),s.save(),s.clearRect(0,0,s.canvas.width,s.canvas.height),s.drawImage(it,0,0),st=Math.PI/2+e*pt-Math.PI/2,s.save(),s.translate(v,l),s.rotate(st),s.translate(-v,-l),s.drawImage(g,0,0),s.fillStyle=a.labelColor.getRgbaColor(),s.textAlign="center",s.textBaseline="middle",bt?(s.restore(),s.font=ot?f*.1+"px sans-serif":f*.15+"px sans-serif",s.fillText(h.toFixed(ct)+"\u00b0",v,l,f*.35)):(s.font=ot?f*.15+"px sans-serif":f*.2+"px sans-serif",s.fillText(h.toFixed(ct)+"\u00b0",v,l,f*.35),s.restore()),s.translate(v,l),s.rotate(st+k*Math.PI/180),s.translate(-v,-l),s.drawImage(nt,0,0),s.restore(),s.drawImage(tt,0,0),s.restore()},this.repaint(),this},kr=function(n,u){u=u||{};var o=undefined===u.size?200:u.size,pt=undefined===u.frameDesign?steelseries.FrameDesign.METAL:u.frameDesign,ri=undefined===u.frameVisible?!0:u.frameVisible,g=undefined===u.backgroundColor?steelseries.BackgroundColor.DARK_GRAY:u.backgroundColor,lt=undefined===u.pointerType?steelseries.PointerType.TYPE2:u.pointerType,h=undefined===u.pointerColor?steelseries.ColorDef.RED:u.pointerColor,gt=undefined===u.knobType?steelseries.KnobType.STANDARD_KNOB:u.knobType,ii=undefined===u.knobStyle?steelseries.KnobStyle.SILVER:u.knobStyle,kt=undefined===u.foregroundType?steelseries.ForegroundType.TYPE1:u.foregroundType,c=undefined===u.pointSymbols?["N","NE","E","SE","S","SW","W","NW"]:u.pointSymbols,ui=undefined===u.customLayer?null:u.customLayer,dt=undefined===u.degreeScale?!1:u.degreeScale,ct=undefined===u.roseVisible?!0:u.roseVisible,tt,v=0,st=Math.PI/180,ht=this.value,s=r.getElementById(n).getContext("2d");s.save(),s.clearRect(0,0,s.canvas.width,s.canvas.height),s.canvas.width=o,s.canvas.height=o;var f=o,e=o,l=f/2,a=e/2,bt=!1,rt=t(o,o),d=rt.getContext("2d"),it=t(o,o),yt=it.getContext("2d"),ut=t(o,o),wt=ut.getContext("2d"),et=t(o,o),w=et.getContext("2d"),ft=t(o,o),at=ft.getContext("2d"),ti=function(n){var t,r,u;n.textAlign="center",n.textBaseline="middle",n.save(),n.strokeStyle=g.labelColor.getRgbaColor(),n.fillStyle=g.labelColor.getRgbaColor(),n.translate(l,a);if(dt)for(t=.08*f+"px serif",r=f*.033+"px serif",n.rotate(st*10),i=10;360>=i;i+=10){n.save();switch(i){case 360:n.translate(f*.35,0),n.rotate(Math.PI/2),n.font=t,n.fillText(c[2],0,0,f),n.translate(-f*.35,0);break;case 90:n.translate(f*.35,0),n.rotate(Math.PI/2),n.font=t,n.fillText(c[4],0,0,f),n.translate(-f*.35,0);break;case 180:n.translate(f*.35,0),n.rotate(Math.PI/2),n.font=t,n.fillText(c[6],0,0,f),n.translate(-f*.35,0);break;case 270:n.translate(f*.35,0),n.rotate(Math.PI/2),n.font=t,n.fillText(c[0],0,0,f),n.translate(-f*.35,0);break;default:u=(i+90)%360,n.translate(f*.37,0),n.rotate(Math.PI/2),n.font=r,n.fillText("0".substring(u>=100)+u,0,0,f),n.translate(-f*.37,0)}n.restore(),n.rotate(st*10)}else for(t=.12*f+"px serif",r=.06*f+"px serif",i=0;360>i;i+=2.5){0==i%5&&(n.lineWidth=1,n.beginPath(),n.moveTo(f*.38,0),n.lineTo(f*.36,0),n.closePath(),n.stroke()),n.save();switch(i){case 0:n.translate(f*.35,0),n.rotate(Math.PI/2),n.font=t,n.fillText(c[2],0,0,f),n.translate(-f*.35,0);break;case 45:n.translate(f*.29,0),n.rotate(Math.PI/2),n.font=r,n.fillText(c[3],0,0,f),n.translate(-f*.29,0);break;case 90:n.translate(f*.35,0),n.rotate(Math.PI/2),n.font=t,n.fillText(c[4],0,0,f),n.translate(-f*.35,0);break;case 135:n.translate(f*.29,0),n.rotate(Math.PI/2),n.font=r,n.fillText(c[5],0,0,f),n.translate(-f*.29,0);break;case 180:n.translate(f*.35,0),n.rotate(Math.PI/2),n.font=t,n.fillText(c[6],0,0,f),n.translate(-f*.35,0);break;case 225:n.translate(f*.29,0),n.rotate(Math.PI/2),n.font=r,n.fillText(c[7],0,0,f),n.translate(-f*.29,0);break;case 270:n.translate(f*.35,0),n.rotate(Math.PI/2),n.font=t,n.fillText(c[0],0,0,f),n.translate(-f*.35,0);break;case 315:n.translate(f*.29,0),n.rotate(Math.PI/2),n.font=r,n.fillText(c[1],0,0,f),n.translate(-f*.29,0)}n.restore(),ct&&(0===i||22.5===i||45===i||67.5===i||90===i||112.5===i||135===i||157.5===i||180===i||202.5===i||225===i||247.5===i||270===i||292.5===i||315===i||337.5===i||360===i)&&(n.save(),n.beginPath(),i%45?n.moveTo(f*.29,0):n.moveTo(f*.38,0),n.lineTo(f*.1,0),n.closePath(),n.restore(),n.lineWidth=1,n.strokeStyle=g.symbolColor.getRgbaColor(),n.stroke()),n.rotate(st*2.5)}n.translate(-l,-a),n.restore()},vt=function(n,t){var o,s,l,i,r,u,c;n.save(),t&&(n.shadowColor="#000000",n.shadowBlur=3,n.fillStyle="rgba(0, 0, 0, 0.4)",n.strokeStyle="rgba(0, 0, 0, 0.4)");switch(lt.type){case"type2":n.beginPath(),n.moveTo(f*.53271,e*.453271),n.bezierCurveTo(f*.53271,e*.453271,f*.5,e*.149532,f*.5,e*.149532),n.bezierCurveTo(f*.5,e*.149532,f*.467289,e*.453271,f*.467289,e*.453271),n.bezierCurveTo(f*.453271,e*.462616,f*.443925,e*.481308,f*.443925,e*.5),n.bezierCurveTo(f*.443925,e*.5,f*.556074,e*.5,f*.556074,e*.5),n.bezierCurveTo(f*.556074,e*.481308,f*.546728,e*.462616,f*.53271,e*.453271),n.closePath(),t||(o=n.createLinearGradient(.471962*f,0,.528036*f,0),o.addColorStop(0,h.light.getRgbaColor()),o.addColorStop(.46,h.light.getRgbaColor()),o.addColorStop(.47,h.medium.getRgbaColor()),o.addColorStop(1,h.medium.getRgbaColor()),n.fillStyle=o,n.strokeStyle=h.dark.getRgbaColor()),n.lineWidth=1,n.lineCap="square",n.lineJoin="miter",n.fill(),n.stroke(),n.beginPath(),n.moveTo(f*.467289,e*.546728),n.bezierCurveTo(f*.467289,e*.546728,f*.5,e*.850467,f*.5,e*.850467),n.bezierCurveTo(f*.5,e*.850467,f*.53271,e*.546728,f*.53271,e*.546728),n.bezierCurveTo(f*.546728,e*.537383,f*.556074,e*.518691,f*.556074,e*.5),n.bezierCurveTo(f*.556074,e*.5,f*.443925,e*.5,f*.443925,e*.5),n.bezierCurveTo(f*.443925,e*.518691,f*.453271,e*.537383,f*.467289,e*.546728),n.closePath(),t||(s=n.createLinearGradient(.471962*f,0,.528036*f,0),s.addColorStop(0,"rgb(227, 229, 232)"),s.addColorStop(.48,"rgb(227, 229, 232)"),s.addColorStop(.480099,"rgb(171, 177, 184)"),s.addColorStop(1,"rgb(171, 177, 184)"),n.fillStyle=s,l="#ABB1B8",n.strokeStyle=l),n.lineWidth=1,n.lineCap="square",n.lineJoin="miter",n.fill(),n.stroke();break;case"type3":n.beginPath(),n.moveTo(f*.5,e*.149532),n.bezierCurveTo(f*.5,e*.149532,f*.443925,e*.490654,f*.443925,e*.5),n.bezierCurveTo(f*.443925,e*.53271,f*.467289,e*.556074,f*.5,e*.556074),n.bezierCurveTo(f*.53271,e*.556074,f*.556074,e*.53271,f*.556074,e*.5),n.bezierCurveTo(f*.556074,e*.490654,f*.5,e*.149532,f*.5,e*.149532),n.closePath(),t||(i=n.createLinearGradient(.471962*f,0,.528036*f,0),i.addColorStop(0,h.light.getRgbaColor()),i.addColorStop(.46,h.light.getRgbaColor()),i.addColorStop(.47,h.medium.getRgbaColor()),i.addColorStop(1,h.medium.getRgbaColor()),n.fillStyle=i,n.strokeStyle=h.dark.getRgbaColor()),n.lineWidth=1,n.lineCap="square",n.lineJoin="miter",n.fill(),n.stroke();break;case"type1:":default:n.beginPath(),n.moveTo(f*.5,e*.495327),n.lineTo(f*.528037,e*.495327),n.lineTo(f*.5,e*.149532),n.lineTo(f*.471962,e*.495327),n.lineTo(f*.5,e*.495327),n.closePath(),t||(r=n.createLinearGradient(.471962*f,0,.528036*f,0),r.addColorStop(0,h.light.getRgbaColor()),r.addColorStop(.46,h.light.getRgbaColor()),r.addColorStop(.47,h.medium.getRgbaColor()),r.addColorStop(1,h.medium.getRgbaColor()),n.fillStyle=r,n.strokeStyle=h.dark.getRgbaColor()),n.lineWidth=1,n.lineCap="square",n.lineJoin="miter",n.fill(),n.stroke(),n.beginPath(),n.moveTo(f*.5,e*.504672),n.lineTo(f*.471962,e*.504672),n.lineTo(f*.5,e*.850467),n.lineTo(f*.528037,e*.504672),n.lineTo(f*.5,e*.504672),n.closePath(),t||(u=n.createLinearGradient(.471962*f,0,.528036*f,0),u.addColorStop(0,"rgb(227, 229, 232)"),u.addColorStop(.48,"rgb(227, 229, 232)"),u.addColorStop(.480099,"rgb(171, 177, 184)"),u.addColorStop(1,"rgb(171, 177, 184)"),n.fillStyle=u,c="#ABB1B8",n.strokeStyle=c),n.lineWidth=1,n.lineCap="square",n.lineJoin="miter",n.fill(),n.stroke()}n.restore()},k=function(){bt=!0,ri&&y(d,pt,l,a,f,e),b(d,g,l,a,f,e),ot(d,ui,l,a,f,e),ct&&tr(d,l,a,f,e,g),ti(d),vt(yt,!1),vt(wt,!0),p(at,kt,f,e,!0,gt,ii)},nt=function(){rt.width=o,rt.height=o,d=rt.getContext("2d"),it.width=o,it.height=o,yt=it.getContext("2d"),ut.width=o,ut.height=o,wt=ut.getContext("2d"),et.width=o,et.height=o,w=et.getContext("2d"),ft.width=o,ft.height=o,at=ft.getContext("2d")};return this.setValue=function(n){n=n%360,v!==n&&(v=n,this.repaint())},this.getValue=function(){return v},this.setValueAnimated=function(n){var i=n%360,r=this,t;v!==i&&(undefined!==tt&&tt.playing&&tt.stop(),t=ni(v,i),tt=new Tween({},"",Tween.elasticEaseOut,v,v+t,2),tt.onMotionChanged=function(n){v=n.target._pos%360,r.repaint()},tt.start())},this.setFrameDesign=function(n){nt(),pt=n,k(),this.repaint()},this.setBackgroundColor=function(n){nt(),g=n,k(),this.repaint()},this.setForegroundType=function(n){nt(),kt=n,k(),this.repaint()},this.setPointerColor=function(n){nt(),h=n,k(),this.repaint()},this.setPointerType=function(n){nt(),lt=n,k(),this.repaint()},this.setPointSymbols=function(n){nt(),c=n,k(),this.repaint()},this.repaint=function(){bt||k(),s.clearRect(0,0,s.canvas.width,s.canvas.height),s.drawImage(rt,0,0),ht=Math.PI/2+v*st-Math.PI/2;var n=f*.006;w.clearRect(0,0,f,e),w.save(),w.translate(l,a),w.rotate(ht),w.translate(-l,-a),w.drawImage(ut,0,0),w.restore(),s.drawImage(et,0,0,f,e,n,n,f+n,e+n),s.save(),s.translate(l,a),s.rotate(ht),s.translate(-l,-a),s.drawImage(it,0,0),s.restore(),s.drawImage(ft,0,0),s.restore()},this.repaint(),this},dr=function(n,u){u=u||{};var o=undefined===u.size?200:u.size,yi=undefined===u.frameDesign?steelseries.FrameDesign.METAL:u.frameDesign,sr=undefined===u.frameVisible?!0:u.frameVisible,k=undefined===u.backgroundColor?steelseries.BackgroundColor.DARK_GRAY:u.backgroundColor,ui=undefined===u.pointerTypeLatest?steelseries.PointerType.TYPE1:u.pointerTypeLatest,dt=undefined===u.pointerTypeAverage?steelseries.PointerType.TYPE8:u.pointerTypeAverage,kt=undefined===u.pointerColor?steelseries.ColorDef.RED:u.pointerColor,bi=undefined===u.pointerColorAverage?steelseries.ColorDef.BLUE:u.pointerColorAverage,hr=undefined===u.knobType?steelseries.KnobType.STANDARD_KNOB:u.knobType,ur=undefined===u.knobStyle?steelseries.KnobStyle.SILVER:u.knobStyle,ai=undefined===u.foregroundType?steelseries.ForegroundType.TYPE1:u.foregroundType,a=undefined===u.pointSymbols?["N","NE","E","SE","S","SW","W","NW"]:u.pointSymbols,rr=undefined===u.customLayer?null:u.customLayer,er=undefined===u.degreeScale?!0:u.degreeScale,si=undefined===u.roseVisible?!1:u.roseVisible,et=undefined===u.lcdColor?steelseries.LcdColor.STANDARD:u.lcdColor,vi=undefined===u.lcdVisible?!0:u.lcdVisible,fr=undefined===u.digitalFont?!1:u.digitalFont,it=undefined===u.section?null:u.section,rt=undefined===u.area?null:u.area,bt=undefined===u.lcdTitleStrings?["Latest","Average"]:u.lcdTitleStrings,ri=undefined===u.titleString?"":u.titleString,ut,ft,g=0,nt=0,ct=Math.PI/180,ti=this.valueLatest,ii=this.valueAverage,nr=-Math.PI/2,ci=Math.PI*2,li=360,e=r.getElementById(n).getContext("2d");e.save(),e.clearRect(0,0,e.canvas.width,e.canvas.height),e.canvas.width=o,e.canvas.height=o;var f=o,s=o,h=f/2,c=s/2,cr=Math.floor(f/10)+"px sans-serif",or=Math.floor(f/10)+"px LCDMono2Ultra",pi=!1,vt=t(o,o),d=vt.getContext("2d"),gt,at=t(o,o),hi=at.getContext("2d"),yt=t(o,o),ei=yt.getContext("2d"),lt=t(o,o),oi=lt.getContext("2d"),pt=t(o,o),fi=pt.getContext("2d"),st=t(o,o),l=st.getContext("2d"),wt=t(o,o),wi=wt.getContext("2d"),ki=function(n,t){e.save(),e.textAlign="center",e.textBaseline="middle",e.strokeStyle=et.textColor,e.fillStyle=et.textColor,n<0&&(n+=360),n="00"+Math.round(n),n=n.substring(n.length,n.length-3),(et===steelseries.LcdColor.STANDARD||et===steelseries.LcdColor.STANDARD_GREEN)&&(e.shadowColor="gray",e.shadowOffsetX=f*.007,e.shadowOffsetY=f*.007,e.shadowBlur=f*.01),e.font=fr?or:cr,t?e.fillText(n+"\u00b0",f/2+2,f*.385,f*.4):e.fillText(n+"\u00b0",f/2+2,f*.63,f*.4),e.restore()},di=function(n,t,i,r,u){n.save(),n.strokeStyle=r,n.fillStyle=r,n.lineWidth=f*.035;var e=ci/li*t,o=e+(i-t)/(li/ci);n.translate(h,c),n.rotate(nr),n.beginPath(),u?(n.moveTo(0,0),n.arc(0,0,f*.365-n.lineWidth/2,e,o,!1)):n.arc(0,0,f*.365,e,o,!1),n.moveTo(0,0),n.closePath(),u?n.fill():n.stroke(),n.translate(-h,-c),n.restore()},gi=function(n){var l,o;n.textAlign="center",n.textBaseline="middle";var s=f*.38,v=f*.35,w=f*.355,p=f*.36,e=f*.1,y=f*.31,r=f*.36,t,u;n.save(),n.strokeStyle=k.labelColor.getRgbaColor(),n.fillStyle=k.labelColor.getRgbaColor(),n.translate(h,c);if(er)for(t=Math.floor(.1*f)+"px serif bold",u=Math.floor(f*.04)+"px sans-serif",n.rotate(ct*5),i=5;360>=i;i+=5){n.save();switch(i){case 360:n.translate(r,0),n.rotate(Math.PI/2),n.font=t,n.fillText(a[2],0,0,e),n.translate(-r,0);break;case 90:n.translate(r,0),n.rotate(Math.PI/2),n.font=t,n.fillText(a[4],0,0,e),n.translate(-r,0);break;case 180:n.translate(r,0),n.rotate(Math.PI/2),n.font=t,n.fillText(a[6],0,0,e),n.translate(-r,0);break;case 270:n.translate(r,0),n.rotate(Math.PI/2),n.font=t,n.fillText(a[0],0,0,e),n.translate(-r,0);break;case 5:case 85:case 95:case 175:case 185:case 265:case 275:case 355:break;default:(i+90)%20?(n.lineWidth=(i+90)%5?1.5:1,n.beginPath(),n.moveTo(s,0),l=(i+90)%10?p:v,n.lineTo(l,0),n.closePath(),n.stroke()):(n.lineWidth=1.5,n.beginPath(),n.moveTo(s,0),n.lineTo(v,0),n.closePath(),n.stroke(),o=(i+90)%360,n.translate(y,0),n.rotate(Math.PI/2),n.font=u,n.fillText("0".substring(o>=100)+o,0,0,e),n.translate(-y,0))}n.restore(),n.rotate(ct*5)}else for(t=.12*f+"px serif",u=.06*f+"px serif",i=0;360>i;i+=2.5){0==i%5&&(n.lineWidth=1,n.beginPath(),n.moveTo(f*.38,0),n.lineTo(f*.36,0),n.closePath(),n.stroke()),n.save();switch(i){case 0:n.translate(f*.35,0),n.rotate(Math.PI/2),n.font=t,n.fillText(a[2],0,0,f),n.translate(-f*.35,0);break;case 45:n.translate(f*.29,0),n.rotate(Math.PI/2),n.font=u,n.fillText(a[3],0,0,f),n.translate(-f*.29,0);break;case 90:n.translate(f*.35,0),n.rotate(Math.PI/2),n.font=t,n.fillText(a[4],0,0,f),n.translate(-f*.35,0);break;case 135:n.translate(f*.29,0),n.rotate(Math.PI/2),n.font=u,n.fillText(a[5],0,0,f),n.translate(-f*.29,0);break;case 180:n.translate(f*.35,0),n.rotate(Math.PI/2),n.font=t,n.fillText(a[6],0,0,f),n.translate(-f*.35,0);break;case 225:n.translate(f*.29,0),n.rotate(Math.PI/2),n.font=u,n.fillText(a[7],0,0,f),n.translate(-f*.29,0);break;case 270:n.translate(f*.35,0),n.rotate(Math.PI/2),n.font=t,n.fillText(a[0],0,0,f),n.translate(-f*.35,0);break;case 315:n.translate(f*.29,0),n.rotate(Math.PI/2),n.font=u,n.fillText(a[1],0,0,f),n.translate(-f*.29,0)}n.restore(),si&&(0===i||22.5===i||45===i||67.5===i||90===i||112.5===i||135===i||157.5===i||180===i||202.5===i||225===i||247.5===i||270===i||292.5===i||315===i||337.5===i||360===i)&&(n.save(),n.beginPath(),i%45?n.moveTo(f*.29,0):n.moveTo(f*.38,0),n.lineTo(f*.1,0),n.closePath(),n.restore(),n.lineWidth=1,n.strokeStyle=k.symbolColor.getRgbaColor(),n.stroke()),n.rotate(ct*2.5)}n.translate(-h,-c),n.restore()},ir=function(n){if(bt.length>0){n.save(),n.textAlign="left",n.textBaseline="middle",n.strokeStyle=k.labelColor.getRgbaColor(),n.fillStyle=k.labelColor.getRgbaColor(),n.font=.04*f+"px sans-serif";var t=n.measureText(bt[0]).width;n.fillText(bt[0],(f-t)/2,s*.27,f*.3),t=n.measureText(bt[1]).width,n.fillText(bt[1],(f-t)/2,s*.73,f*.3),ri.length>0&&(n.font=.0467*f+"px sans-serif",t=n.measureText(ri).width,n.fillText(ri,(f-t)/2,s*.5,f*.3))}},v=function(n){var i,t;n=n||{};var r=undefined===n.frame?!1:n.frame,e=undefined===n.background?!1:n.background,u=undefined===n.pointer?!1:n.pointer,o=undefined===n.foreground?!1:n.foreground;pi=!0,r&&sr&&y(d,yi,h,c,f,s);if(e){b(d,k,h,c,f,s),ot(d,rr,h,c,f,s);if(null!==it&&0<it.length){i=it.length;do i--,di(d,it[i].start,it[i].stop,it[i].color,!1);while(0<i)}if(null!==rt&&0<rt.length){t=rt.length;do t--,di(d,rt[t].start,rt[t].stop,rt[t].color,!0);while(0<t)}si&&tr(d,h,c,f,s,k),gi(d),vi&&(gt=w(f*.3,s*.15,et),d.drawImage(gt,(f-f*.3)/2,s*.55),d.drawImage(gt,(f-f*.3)/2,s*.305),ir(d))}u&&(ht(oi,f,dt,bi,k.labelColor),ht(fi,f,dt,kt,k.labelColor,!0),ht(hi,f,ui,kt,k.labelColor),ht(ei,f,ui,kt,k.labelColor,!0)),o&&p(wi,ai,f,s,!0,hr,ur)},tt=function(n){n=n||{};var r=undefined===n.background?!1:n.background,i=undefined===n.pointer?!1:n.pointer,t=undefined===n.foreground?!1:n.foreground;r&&(vt.width=o,vt.height=o,d=vt.getContext("2d")),i&&(at.width=o,at.height=o,hi=at.getContext("2d"),yt.width=o,yt.height=o,ei=yt.getContext("2d"),lt.width=o,lt.height=o,oi=lt.getContext("2d"),pt.width=o,pt.height=o,fi=pt.getContext("2d"),st.width=o,st.height=o,l=st.getContext("2d")),t&&(wt.width=o,wt.height=o,wi=wt.getContext("2d"))};return this.setValueLatest=function(n){n=n%360,g!==n&&(g=n,this.repaint())},this.getValueLatest=function(){return g},this.setValueAverage=function(n){n=n%360,nt!==n&&(nt=n,this.repaint())},this.getValueAverage=function(){return nt},this.setValueAnimatedLatest=function(n){var r=n%360,i,t;g!==r&&(i=this,undefined!==ut&&ut.playing&&ut.stop(),t=ni(g,r),ut=new Tween({},"",Tween.regularEaseInOut,g,g+t,2.5),ut.onMotionChanged=function(n){g=n.target._pos%360,i.repaint()},ut.start())},this.setValueAnimatedAverage=function(n){var r=n%360,t,i;nt!==n&&(t=this,undefined!==ft&&ft.playing&&ft.stop(),i=ni(nt,r),ft=new Tween({},"",Tween.regularEaseInOut,nt,nt+i,2.5),ft.onMotionChanged=function(n){nt=n.target._pos%360,t.repaint()},ft.start())},this.setArea=function(n){rt=n,tt({foreground:!0}),v({background:!0,foreground:!0}),this.repaint()},this.setSection=function(n){it=n,tt({foreground:!0}),v({background:!0,foreground:!0}),this.repaint()},this.setFrameDesign=function(n){tt({background:!0}),yi=n,v({frame:!0,background:!0}),this.repaint()},this.setBackgroundColor=function(n){tt(),k=n,v({background:!0}),this.repaint()},this.setForegroundType=function(n){tt({foreground:!0}),ai=n,v({foreground:!0}),this.repaint()},this.setPointerColor=function(n){tt({pointer:!0}),kt=n,v({pointer:!0}),this.repaint()},this.setPointerColorAverage=function(n){tt({pointer:!0}),bi=n,v({pointer:!0}),this.repaint()},this.setPointerType=function(n){tt({pointer:!0}),ui=n,v({pointer:!0}),this.repaint()},this.setPointerTypeAverage=function(n){tt({pointer:!0}),dt=n,v({pointer:!0}),this.repaint()},this.setPointSymbols=function(n){tt({background:!0}),a=n,v({background:!0}),this.repaint()},this.setLcdColor=function(n){et=n,v({background:!0}),this.repaint()},this.repaint=function(){pi||v({frame:!0,background:!0,led:!0,pointer:!0,foreground:!0}),e.clearRect(0,0,e.canvas.width,e.canvas.height),e.drawImage(vt,0,0),vi&&(ki(g,!0),ki(nt,!1)),ii=Math.PI/2+nt*ct-Math.PI/2;var n=f*.006;l.clearRect(0,0,f,s),l.save(),l.translate(h,c),l.rotate(ii),l.translate(-h,-c),l.drawImage(pt,0,0),l.restore(),e.drawImage(st,0,0,f,s,n,n,f+n,s+n),e.save(),e.translate(h,c),e.rotate(ii),e.translate(-h,-c),e.drawImage(lt,0,0),e.restore(),ti=Math.PI/2+g*ct-Math.PI/2,l.clearRect(0,0,f,s),l.save(),l.translate(h,c),l.rotate(ti),l.translate(-h,-c),l.drawImage(yt,0,0),l.restore(),e.drawImage(st,0,0,f,s,n,n,f+n,s+n),e.save(),e.translate(h,c),e.rotate(ti),e.translate(-h,-c),e.drawImage(at,0,0),e.restore(),e.drawImage(wt,0,0)},this.repaint(),this},wr=function(n,i){i=i||{};var o=undefined===i.size?200:i.size,st=undefined===i.frameDesign?steelseries.FrameDesign.METAL:i.frameDesign,at=undefined===i.frameVisible?!0:i.frameVisible,ot=undefined===i.foregroundType?steelseries.ForegroundType.TYPE1:i.foregroundType,nt=undefined===i.pointerColor?steelseries.ColorDef.WHITE:i.pointerColor,b,w,h=0,s=0,et=Math.PI*o/360,ft=0,g=!1,e=r.getElementById(n).getContext("2d");e.save(),e.clearRect(0,0,e.canvas.width,e.canvas.height),e.canvas.width=o,e.canvas.height=o;var u=o,f=o,c=u/2,l=f/2,ct=!1,d=t(o,o),ht=d.getContext("2d"),a=t(o,o*Math.PI),ut=a.getContext("2d"),v=t(o*.037383,o*.056074),rt=v.getContext("2d"),k=t(o,o),tt=k.getContext("2d"),yt=function(n){var t,u,i,f,h;n.save(),t=o,u=o*Math.PI,n.beginPath(),n.rect(0,0,t,u),n.closePath(),f=n.createLinearGradient(0,0,0,u),f.addColorStop(0,"rgb(127, 213, 240)"),f.addColorStop(.5,"rgb(127, 213, 240)"),f.addColorStop(.5,"rgb(60, 68, 57)"),f.addColorStop(1,"rgb(60, 68, 57)"),n.fillStyle=f,n.fill(),n.lineWidth=1;var s=u/72,e=!1,r=10;for(n.textAlign="center",n.textBaseline="middle",h=t*.04,n.font=h+"px sans-serif",n.fillStyle="#37596e",i=u/2-s;i>0;i-=s)r>90||(e?(n.fillText(r,(t-t*.2)/2-8,i,t*.375),n.fillText(r,t-(t-t*.2)/2+8,i,t*.375),n.beginPath(),n.moveTo((t-t*.2)/2,i),n.lineTo(t-(t-t*.2)/2,i),n.closePath(),r+=10):(n.beginPath(),n.moveTo((t-t*.1)/2,i),n.lineTo(t-(t-t*.1)/2,i),n.closePath()),n.stroke()),e^=!0;for(e=!1,r=10,n.strokeStyle="#FFFFFF",n.lineWidth=1.5,n.beginPath(),n.moveTo(0,u/2),n.lineTo(t,u/2),n.closePath(),n.stroke(),n.fillStyle="#FFFFFF",n.lineWidth=1,i=u/2+s;i<=u;i+=s)r>90||(e?(n.fillText(-r,(t-t*.2)/2-8,i,t*.375),n.fillText(-r,t-(t-t*.2)/2+8,i,t*.375),n.beginPath(),n.moveTo((t-t*.2)/2,i),n.lineTo(t-(t-t*.2)/2,i),n.closePath(),r+=10):(n.beginPath(),n.moveTo((t-t*.1)/2,i),n.lineTo(t-(t-t*.1)/2,i),n.closePath()),n.stroke()),e^=!0;n.restore()},pt=function(n){var i,r,t;for(n.save(),n.fillStyle=nt.light.getRgbaColor(),n.beginPath(),n.moveTo(u*.476635,f*.5),n.bezierCurveTo(u*.476635,f*.514018,u*.485981,f*.523364,u*.5,f*.523364),n.bezierCurveTo(u*.514018,f*.523364,u*.523364,f*.514018,u*.523364,f*.5),n.bezierCurveTo(u*.523364,f*.485981,u*.514018,f*.476635,u*.5,f*.476635),n.bezierCurveTo(u*.485981,f*.476635,u*.476635,f*.485981,u*.476635,f*.5),n.closePath(),n.moveTo(u*.415887,f*.504672),n.lineTo(u*.415887,f*.495327),n.bezierCurveTo(u*.415887,f*.495327,u*.467289,f*.495327,u*.467289,f*.495327),n.bezierCurveTo(u*.471962,f*.481308,u*.481308,f*.471962,u*.495327,f*.467289),n.bezierCurveTo(u*.495327,f*.467289,u*.495327,f*.415887,u*.495327,f*.415887),n.lineTo(u*.504672,f*.415887),n.bezierCurveTo(u*.504672,f*.415887,u*.504672,f*.467289,u*.504672,f*.467289),n.bezierCurveTo(u*.518691,f*.471962,u*.528037,f*.481308,u*.53271,f*.495327),n.bezierCurveTo(u*.53271,f*.495327,u*.584112,f*.495327,u*.584112,f*.495327),n.lineTo(u*.584112,f*.504672),n.bezierCurveTo(u*.584112,f*.504672,u*.53271,f*.504672,u*.53271,f*.504672),n.bezierCurveTo(u*.528037,f*.518691,u*.518691,f*.53271,u*.5,f*.53271),n.bezierCurveTo(u*.481308,f*.53271,u*.471962,f*.518691,u*.467289,f*.504672),n.bezierCurveTo(u*.467289,f*.504672,u*.415887,f*.504672,u*.415887,f*.504672),n.closePath(),n.fill(),i=5,r=Math.PI/36,n.translate(c,l),n.rotate(-Math.PI/2),n.translate(-c,-l),t=-90;t<=90;t+=i)t%45==0||t===0?(n.strokeStyle=nt.medium.getRgbaColor(),n.lineWidth=2,n.beginPath(),n.moveTo(u*.5,f*.088785),n.lineTo(u*.5,f*.113),n.closePath(),n.stroke()):t%15==0?(n.strokeStyle="#FFFFFF",n.lineWidth=1,n.beginPath(),n.moveTo(u*.5,f*.088785),n.lineTo(u*.5,f*.103785),n.closePath(),n.stroke()):(n.strokeStyle="#FFFFFF",n.lineWidth=.5,n.beginPath(),n.moveTo(u*.5,f*.088785),n.lineTo(u*.5,f*.093785),n.closePath(),n.stroke()),n.translate(c,l),n.rotate(r,c,l),n.translate(-c,-l);n.restore()},vt=function(n){n.save();var i=u*.037383,t=f*.056074;n.beginPath(),n.moveTo(i*.5,0),n.lineTo(0,t),n.lineTo(i,t),n.closePath(),n.fillStyle=nt.light.getRgbaColor(),n.fill(),n.strokeStyle=nt.medium.getRgbaColor(),n.stroke(),n.restore()},it=function(){ct=!0,at&&y(ht,st,c,l,u,f),yt(ut),vt(rt),pt(tt),p(tt,ot,u,f,!0,di,ai,ki)},lt=function(){d.width=o,d.height=o,ht=d.getContext("2d"),a.width=o,a.height=o*Math.PI,ut=a.getContext("2d"),v.width=o*.037383,v.height=o*.056074,rt=v.getContext("2d"),k.width=o,k.height=o,tt=k.getContext("2d")};return this.setRoll=function(n){n=n%360,h!==n&&(h=n,this.repaint())},this.getRoll=function(){return h},this.setRollAnimated=function(n){n=n%360;if(h!==n){var t=this;undefined!==b&&b.playing&&b.stop(),b=new Tween({},"",Tween.regularEaseInOut,h,n,1),b.onMotionChanged=function(n){h=n.target._pos,t.repaint()},b.start()}},this.setPitch=function(n){n=(n+180-ft)%360-180,s!==n&&(s=n,s>90?(s=180-s,g||this.setRoll(h-180),g=!0):s<-90?(s=-180-s,g||this.setRoll(h+180),g=!0):g=!1,this.repaint())},this.getPitch=function(){return s},this.setPitchAnimated=function(n){if(s!==n){undefined!==w&&w.playing&&w.stop();var t=this;w=new Tween({},"",Tween.regularEaseInOut,s,n,1),w.onMotionChanged=function(n){t.setPitch(n.target._pos)},w.start()}},this.setPitchOffset=function(n){ft=n,this.repaint()},this.setFrameDesign=function(n){lt(),st=n,it(),this.repaint()},this.setForegroundType=function(n){lt(),ot=n,it(),this.repaint()},this.repaint=function(){ct||it(),e.save(),e.clearRect(0,0,e.canvas.width,e.canvas.height),e.drawImage(d,0,0),e.save(),e.beginPath(),e.arc(c,l,u*.831775/2,0,Math.PI*2,!0),e.closePath(),e.clip(),e.translate(c,l),e.rotate(-(h*Math.PI/180)),e.translate(-c,0),e.translate(0,s*et),e.drawImage(a,0,-a.height/2),e.translate(0,-(s*et)-l),e.drawImage(v,u*.5-v.width/2,u*.107476),e.restore(),e.drawImage(k,0,0)},this.repaint(),this},br=function(n,t){var a,e,h,f,c;t=t||{};var u=undefined===t.size?32:t.size,y=undefined===t.ledColor?steelseries.LedColor.RED_LED:t.ledColor,v=!1,p=0,i=r.getElementById(n).getContext("2d");i.save(),i.clearRect(0,0,i.canvas.width,i.canvas.height),i.canvas.width=u,i.canvas.height=u,a=!1,e=r.createElement("canvas"),e.width=u,e.height=u,h=e.getContext("2d"),f=r.createElement("canvas"),f.width=u,f.height=u;var l=f.getContext("2d"),s=f,w=function(){a=!0,h.clearRect(0,0,h.canvas.width,h.canvas.height),h.drawImage(o(u,1,y),0,0),l.clearRect(0,0,l.canvas.width,l.canvas.height),l.drawImage(o(u,0,y),0,0)};return this.toggleLed=function(){s=s===e?f:e,c()},this.setLedColor=function(n){y=n,a=!1,c()},this.setLedOnOff=function(n){s=!0===n?e:f,c()},this.blink=function(n){n?v||(p=setInterval(this.toggleLed,1e3),v=!0):v&&(clearInterval(p),v=!1)},c=function(){a||w(),i.save(),i.clearRect(0,0,i.canvas.width,i.canvas.height),i.drawImage(s,0,0),i.restore()},c(),this},uu=function(n,i){i=i||{};var f=undefined===i.size?200:i.size,vi=undefined===i.frameDesign?steelseries.FrameDesign.METAL:i.frameDesign,ir=undefined===i.frameVisible?!0:i.frameVisible,v=undefined===i.pointerType?steelseries.PointerType.TYPE1:i.pointerType,w=undefined===i.pointerColor?v===steelseries.PointerType.TYPE1?steelseries.ColorDef.GRAY:steelseries.ColorDef.BLACK:i.pointerColor,ut=undefined===i.backgroundColor?v===steelseries.PointerType.TYPE1?steelseries.BackgroundColor.ANTHRACITE:steelseries.BackgroundColor.LIGHT_GRAY:i.backgroundColor,si=undefined===i.foregroundType?steelseries.ForegroundType.TYPE1:i.foregroundType,tr=undefined===i.customLayer?null:i.customLayer,tt=undefined===i.isAutomatic?!0:i.isAutomatic,l=undefined===i.hour?11:i.hour,a=undefined===i.minute?5:i.minute,d=undefined===i.second?0:i.second,dt=undefined===i.secondMovesContinuous?!1:i.secondMovesContinuous,kt=undefined===i.timeZoneOffsetHour?0:i.timeZoneOffsetHour,bt=undefined===i.timeZoneOffsetMinute?0:i.timeZoneOffsetMinute,gt=undefined===i.secondPointerVisible?!0:i.secondPointerVisible,k=new Date,ri,ii,ui,bi,rt=dt?100:1e3;rt=gt?rt:100;var rr=this,or=Math.PI/2,g=Math.PI*2,nt=Math.PI/180,ei=6,s=r.getElementById(n).getContext("2d");s.save(),s.clearRect(0,0,s.canvas.width,s.canvas.height),s.canvas.width=f,s.canvas.height=f;var u=f,e=f,o=u/2,h=e/2,pi=!1,ht=t(f,f),wi=ht.getContext("2d"),ct=t(f,f),ni=ct.getContext("2d"),yt=t(f,f),yi=yt.getContext("2d"),et=t(f,f),nr=et.getContext("2d"),wt=t(f,f),gi=wt.getContext("2d"),lt=t(f,f),di=lt.getContext("2d"),at=t(f,f),ki=at.getContext("2d"),vt=t(f,f),hi=vt.getContext("2d"),it=t(f,f),c=it.getContext("2d"),pt=t(f,f),oi=pt.getContext("2d"),ur=function(n,t){var i,e,s,r,f;r=u*.405,n.save(),n.translate(o,h);switch(t.type){case"type1":for(e=u*.074766,f=r-e,n.strokeStyle=ut.labelColor.getRgbaColor(),n.lineWidth=u*.014018,i=0;i<360;i+=30)n.beginPath(),n.moveTo(r,0),n.lineTo(f,0),n.closePath(),n.stroke(),n.rotate(30*nt);for(s=u*.126168,f=r-s,n.lineWidth=u*.03271,i=0;i<360;i+=90)n.beginPath(),n.moveTo(r,0),n.lineTo(f,0),n.closePath(),n.stroke(),n.rotate(90*nt);break;case"type2":default:for(e=u*.037383,f=r-e,n.strokeStyle=ut.labelColor.getRgbaColor(),n.lineWidth=u*.009345,i=0;i<360;i+=6)n.beginPath(),n.moveTo(r,0),n.lineTo(f,0),n.closePath(),n.stroke(),n.rotate(6*nt);for(s=u*.084112,f=r-s,n.lineWidth=u*.028037,i=0;i<360;i+=30)n.beginPath(),n.moveTo(r,0),n.lineTo(f,0),n.closePath(),n.stroke(),n.rotate(30*nt)}n.translate(-o,-h),n.restore()},ci=function(n,t,i){n.save();var r;i&&(n.shadowColor="#000000",n.shadowBlur=3,n.fillStyle="rgba(0, 0, 0, 0.4)",n.strokeStyle="rgba(0, 0, 0, 0.4)");switch(t.type){case"type2":n.beginPath(),n.lineWidth=u*.046728,n.moveTo(o,u*.289719),n.lineTo(o,u*.289719+u*.224299),i||(n.strokeStyle=w.medium.getRgbaColor()),n.closePath(),n.stroke();break;case"type1":default:n.beginPath(),n.moveTo(u*.471962,e*.560747),n.lineTo(u*.471962,e*.214953),n.lineTo(u*.5,e*.182242),n.lineTo(u*.528037,e*.214953),n.lineTo(u*.528037,e*.560747),n.lineTo(u*.471962,e*.560747),n.closePath(),i||(r=n.createLinearGradient(u*.471962,e*.560747,u*.528037,e*.214953),r.addColorStop(1,w.veryLight.getRgbaColor()),r.addColorStop(0,w.light.getRgbaColor()),n.fillStyle=r,n.strokeStyle=w.light.getRgbaColor()),n.fill(),n.stroke()}n.restore()},li=function(n,t,i){n.save();var r;i&&(n.shadowColor="#000000",n.shadowBlur=3,n.fillStyle="rgba(0, 0, 0, 0.4)",n.strokeStyle="rgba(0, 0, 0, 0.4)");switch(t.type){case"type2":n.beginPath(),n.lineWidth=u*.03271,n.moveTo(o,u*.116822),n.lineTo(o,u*.116822+u*.38785),i||(n.strokeStyle=w.medium.getRgbaColor()),n.closePath(),n.stroke();break;case"type1":default:n.beginPath(),n.moveTo(u*.518691,e*.574766),n.lineTo(u*.523364,e*.135514),n.lineTo(u*.5,e*.107476),n.lineTo(u*.476635,e*.140186),n.lineTo(u*.476635,e*.574766),n.lineTo(u*.518691,e*.574766),n.closePath(),i||(r=n.createLinearGradient(u*.518691,e*.574766,u*.476635,e*.140186),r.addColorStop(1,w.veryLight.getRgbaColor()),r.addColorStop(0,w.light.getRgbaColor()),n.fillStyle=r,n.strokeStyle=w.light.getRgbaColor()),n.fill(),n.stroke()}n.restore()},ai=function(n,t,i){n.save();var r;i?(n.shadowColor="#000000",n.shadowBlur=3,n.fillStyle="rgba(0, 0, 0, 0.4)",n.strokeStyle="rgba(0, 0, 0, 0.4)"):(n.fillStyle=steelseries.ColorDef.RED.medium.getRgbaColor(),n.strokeStyle=steelseries.ColorDef.RED.medium.getRgbaColor());switch(t.type){case"type2":n.lineWidth=u*.009345,n.beginPath(),n.moveTo(o,u*.09813),n.lineTo(o,u*.09813+u*.126168),n.closePath(),n.stroke(),n.lineWidth=u*.018691,n.beginPath(),n.moveTo(o,u*.308411),n.lineTo(o,u*.308411+u*.191588),n.closePath(),n.stroke(),n.lineWidth=u*.016,n.beginPath(),n.arc(o,u*.26,u*.085/2,0,g),n.closePath(),n.stroke();break;case"type1":default:n.beginPath(),n.moveTo(u*.509345,e*.116822),n.lineTo(u*.509345,e*.574766),n.lineTo(u*.490654,e*.574766),n.lineTo(u*.490654,e*.116822),n.lineTo(u*.509345,e*.116822),n.closePath(),i||(r=n.createLinearGradient(u*.509345,e*.116822,u*.490654,e*.574766),r.addColorStop(0,steelseries.ColorDef.RED.light.getRgbaColor()),r.addColorStop(.47,steelseries.ColorDef.RED.medium.getRgbaColor()),r.addColorStop(1,steelseries.ColorDef.RED.dark.getRgbaColor()),n.fillStyle=r,n.strokeStyle=steelseries.ColorDef.RED.dark.getRgbaColor()),n.fill(),n.stroke()}n.restore()},fr=function(n){var i=u*.006,t;n.shadowColor="#000000",n.shadowBlur=3,n.fillStyle="rgba(0, 0, 0, 0.4)",n.beginPath(),n.arc(o+i,h+i,u*.045,0,g),n.closePath(),n.fill(),n.beginPath(),n.arc(o,h,u*.045,0,g),n.closePath(),n.shadowColor="",n.shadowBlur=0,t=n.createLinearGradient(o-u*.045/2,h-u*.045/2,o+u*.045/2,h+u*.045/2),t.addColorStop(0,"rgb(238, 240, 242)"),t.addColorStop(1,"rgb(101, 105, 109)"),n.fillStyle=t,n.fill()},er=function(n,t){var r=u*.006,i;n.save();switch(t.type){case"type2":n.shadowColor="#000000",n.shadowBlur=3,n.fillStyle="rgba(0, 0, 0, 0.4)",n.beginPath(),n.arc(o+r,h+r,u*.088785/2,0,g),n.closePath(),n.fill(),n.shadowColor="",n.shadowBlur=0,n.fillStyle="#000000",n.beginPath(),n.arc(o,h,u*.088785/2,0,g),n.closePath(),n.fill();break;case"type1":default:n.shadowColor="#000000",n.shadowBlur=3,n.fillStyle="rgba(0, 0, 0, 0.4)",n.beginPath(),n.arc(o+r,h+r,u*.027,0,g),n.closePath(),n.fill(),n.shadowColor="",n.shadowBlur=0,i=n.createLinearGradient(o-u*.027/2,h-u*.027/2,o+u*.027/2,h+u*.027/2),i.addColorStop(0,"rgb(234, 235, 238)"),i.addColorStop(.11,"rgb(234, 236, 238)"),i.addColorStop(.12,"rgb(232, 234, 236)"),i.addColorStop(.2,"rgb(192, 197, 203)"),i.addColorStop(.2001,"rgb(190, 195, 201)"),i.addColorStop(1,"rgb(190, 195, 201)"),n.fillStyle=i,n.beginPath(),n.arc(o,h,u*.027,0,g),n.closePath(),n.fill()}n.restore()},ti=function(n,t,i){ui=i*ei*nt,ri=t*ei*nt,ii=(n+t/60)*ei*5*nt},fi=function(){tt?k=new Date:(k.setHours(l),k.setMinutes(a),k.setSeconds(d)),d=k.getSeconds()+(dt?k.getMilliseconds()/1e3:0),l=kt!=0&&bt!=0?k.getUTCHours()+kt:k.getHours(),l=l%12,a=kt!=0&&bt!=0?k.getUTCMinutes()+bt:k.getMinutes(),a>60&&(a-=60,l++),a<0&&(a+=60,l--),l=l%12,ti(l,a,d),tt&&(bi=setTimeout(fi,rt)),rr.repaint()},ft=function(n){n=n||{};var r=undefined===n.frame?!1:n.frame,f=undefined===n.background?!1:n.background,t=undefined===n.pointers?!1:n.pointers,i=undefined===n.foreground?!1:n.foreground;pi=!0,r&&ir&&y(wi,vi,o,h,u,e),f&&(b(ni,ut,o,h,u,e),ot(ni,tr,o,h,u,e),ur(ni,v)),t&&(ci(yi,v,!1),ci(nr,v,!0),li(gi,v,!1),li(di,v,!0),ai(ki,v,!1),ai(hi,v,!0)),i&&(er(oi,v),p(oi,si,u,e,!1))},st=function(n){n=n||{};var r=undefined===n.frame?!1:n.frame,u=undefined===n.background?!1:n.background,t=undefined===n.pointers?!1:n.pointers,i=undefined===n.foreground?!1:n.foreground;r&&(ht.width=f,ht.height=f,wi=ht.getContext("2d")),u&&(ct.width=f,ct.height=f,ni=ct.getContext("2d")),t&&(yt.width=f,yt.height=f,yi=yt.getContext("2d"),et.width=f,et.height=f,nr=et.getContext("2d"),wt.width=f,wt.height=f,gi=wt.getContext("2d"),lt.width=f,lt.height=f,di=lt.getContext("2d"),at.width=f,at.height=f,ki=at.getContext("2d"),vt.width=f,vt.height=f,hi=vt.getContext("2d"),it.width=f,it.height=f,c=it.getContext("2d")),i&&(pt.width=f,pt.height=f,oi=pt.getContext("2d"))};return this.getAutomatic=function(){return tt},this.setAutomatic=function(n){tt&&!n?(clearTimer(bi),tt=n):!tt&&n&&(tt=n,fi())},this.getHour=function(){return l},this.setHour=function(n){n=n%12,l!==n&&(l=n,ti(l,a,d),this.repaint())},this.getMinute=function(){return a},this.setMinute=function(n){n=n%60,a!==n&&(a=n,ti(l,a,d),this.repaint())},this.getSecond=function(){return d},this.setSecond=function(n){d=n%60,d!==n&&(d=n,ti(l,a,d),this.repaint())},this.getTimeZoneOffsetHour=function(){return kt},this.setTimeZoneOffsetHour=function(n){kt=n,this.repaint()},this.getTimeZoneOffsetMinute=function(){return bt},this.setTimeZoneOffsetMinute=function(n){bt=n,this.repaint()},this.getSecondPointerVisible=function(){return gt},this.setSecondPointerVisible=function(n){gt=n,this.repaint()},this.getSecondMovesContinuous=function(){return dt},this.setSecondMovesContinuous=function(n){dt=n,rt=dt?100:1e3,rt=gt?rt:100},this.setFrameDesign=function(n){st({frame:!0}),vi=n,ft({frame:!0}),this.repaint()},this.setBackgroundColor=function(n){st({background:!0}),ut=n,ft({background:!0}),this.repaint()},this.setForegroundType=function(n){st({foreground:!0}),si=n,ft({foreground:!0}),this.repaint()},this.setPointerType=function(n){st({background:!0,pointers:!0,foreground:!0}),v=n,v.type==="type1"?(w=steelseries.ColorDef.GRAY,ut=steelseries.BackgroundColor.ANTHRACITE):(w=steelseries.ColorDef.BLACK,ut=steelseries.BackgroundColor.LIGHT_GRAY),ft({frame:!0,background:!0,pointers:!0,foreground:!0}),this.repaint()},this.setPointerColor=function(n){st({pointers:!0}),w=n,ft({pointers:!0}),this.repaint()},this.repaint=function(){pi||ft({frame:!0,background:!0,pointers:!0,foreground:!0}),s.clearRect(0,0,s.canvas.width,s.canvas.height),s.drawImage(ht,0,0),s.drawImage(ct,0,0);var n=u*.006;c.clearRect(0,0,u,e),c.save(),c.translate(o,h),c.rotate(ii),c.translate(-o,-h),c.drawImage(et,0,0),c.restore(),s.drawImage(it,0,0,u,e,n,n,u+n,e+n),s.save(),s.translate(o,h),s.rotate(ii),s.translate(-o,-h),s.drawImage(yt,0,0),s.restore(),c.clearRect(0,0,u,e),c.save(),c.translate(o,h),c.rotate(ri),c.translate(-o,-h),c.drawImage(lt,0,0),c.restore(),s.drawImage(it,0,0,u,e,n,n,u+n,e+n),s.save(),s.translate(o,h),s.rotate(ri),s.translate(-o,-h),s.drawImage(wt,0,0),s.restore(),v.type==="type1"&&fr(s),gt&&(c.clearRect(0,0,u,e),c.save(),c.translate(o,h),c.rotate(ui),c.translate(-o,-h),c.drawImage(vt,0,0),c.restore(),s.drawImage(it,0,0,u,e,n,n,u+n,e+n),s.save(),s.translate(o,h),s.rotate(ui),s.translate(-o,-h),s.drawImage(at,0,0),s.restore()),s.drawImage(pt,0,0)},fi(),this},tu=function(t,i){var s;i=i||{};var o=undefined===i.size?50:i.size,f=undefined===i.value?50:i.value,e=o,h=Math.ceil(o*.45),u=r.getElementById(t).getContext("2d");return u.save(),u.clearRect(0,0,u.canvas.width,u.canvas.height),u.canvas.width=e,u.canvas.height=e,s=function(t,i,r,u){var f,e;t.beginPath(),t.moveTo(i*.025,r*.055555),t.lineTo(i*.9,r*.055555),t.lineTo(i*.9,r*.944444),t.lineTo(i*.025,r*.944444),t.lineTo(i*.025,r*.055555),t.closePath(),t.beginPath(),t.moveTo(i*.925,0),t.lineTo(0,0),t.lineTo(0,r),t.lineTo(i*.925,r),t.lineTo(i*.925,r*.722222),t.bezierCurveTo(i*.925,r*.722222,i*.975,r*.722222,i*.975,r*.722222),t.bezierCurveTo(i,r*.722222,i,r*.666666,i,r*.666666),t.bezierCurveTo(i,r*.666666,i,r*.333333,i,r*.333333),t.bezierCurveTo(i,r*.333333,i,r*.277777,i*.975,r*.277777),t.bezierCurveTo(i*.975,r*.277777,i*.925,r*.277777,i*.925,r*.277777),t.lineTo(i*.925,0),t.closePath(),f=t.createLinearGradient(0,0,0,r),f.addColorStop(0,"#ffffff"),f.addColorStop(1,"#7e7e7e"),t.fillStyle=f,t.fill(),t.beginPath(),e=Math.max(i*.875*(u/100),Math.ceil(i*.01)),t.rect(i*.025,i*.025,e,r*.888888),t.closePath();var a=[0,.4,1],l=[new n(177,25,2,1),new n(219,167,21,1),new n(121,162,75,1)],y=new kt(0,100,a,l);t.fillStyle=y.getColorAt(u/100).getRgbColor(),t.fill(),t.beginPath(),e=Math.max(e-i*.05,0),t.rect(i*.05,i*.05,e,r*.777777),t.closePath();var v=[new n(198,39,5,1),new n(228,189,32,1),new n(163,216,102,1)],h=[new n(246,121,48,1),new n(246,244,157,1),new n(223,233,86,1)],o=[0,.4,1],s=new kt(0,100,o,v),c=new kt(0,100,o,h);f=t.createLinearGradient(i*.05,0,i*.875,0),f.addColorStop(0,s.getColorAt(u/100).getRgbColor()),f.addColorStop(.5,c.getColorAt(u/100).getRgbColor()),f.addColorStop(1,s.getColorAt(u/100).getRgbColor()),t.fillStyle=f,t.fill(),t.beginPath(),t.rect(i*.025,i*.025,i*.875,r*.444444),t.closePath(),f=t.createLinearGradient(i*.025,i*.025,i*.875,r*.444444),f.addColorStop(0,"rgba(255, 255, 255, 0)"),f.addColorStop(1,"rgba(255, 255, 255, 0.8)"),t.fillStyle=f,t.fill()},this.setValue=function(n){n=n<0?0:n>100?100:n,f!==n&&(f=n,this.repaint())},this.getValue=function(){return f},this.repaint=function(){u.clearRect(0,0,u.canvas.width,u.canvas.height),s(u,e,h,f)},this.repaint(),this},nu=function(n,i){i=i||{};var f=undefined===i.size?200:i.size,ui=undefined===i.frameDesign?steelseries.FrameDesign.METAL:i.frameDesign,oi=undefined===i.frameVisible?!0:i.frameVisible,h=undefined===i.pointerColor?steelseries.ColorDef.BLACK:i.pointerColor,pt=undefined===i.backgroundColor?steelseries.BackgroundColor.LIGHT_GRAY:i.backgroundColor,ei=undefined===i.foregroundType?steelseries.ForegroundType.TYPE1:i.foregroundType,bi=undefined===i.customLayer?null:i.customLayer,dt=0,yt=0,bt,pi=6,st=Math.PI*2,lt=Math.PI/180,wi=this,at=0,g=0,hi=0,ci=0,si=0,l=!1,w=!1,e=r.getElementById(n).getContext("2d");e.save(),e.clearRect(0,0,e.canvas.width,e.canvas.height),e.canvas.width=f,e.canvas.height=f;var u=f,c=f,o=u/2,v=c/2,a=.285*u,ki=o-a/2,k=.17*u,yi=!1,rt=t(f,f),vi=rt.getContext("2d"),it=t(f,f),nt=it.getContext("2d"),ft=t(f,f),ai=ft.getContext("2d"),ct=t(f,f),li=ct.getContext("2d"),tt=t(f,f),fi=tt.getContext("2d"),ht=t(f,f),ti=ht.getContext("2d"),d=t(f,f),s=d.getContext("2d"),ut=t(f,f),ii=ut.getContext("2d"),gt=function(n,t,i,r,u,f,e){var ht;n.width=n.height=t;var nt=r*t,tt=nt+"px sans-serif",ut=t*.15,st=.5,k=1,ft=1.5,b=u*t,d=Math.round(.025*t),g=Math.round(.035*t),p=Math.round(.045*t),et=pt.labelColor.getRgbaColor(),w=pt.labelColor.getRgbaColor(),s=t/2,o=t*.4,a=0,y=0,ot=0,h=0,c=0,v,it=-Math.PI,l,rt=2*Math.PI/i;for(n.save(),n.textAlign="center",n.textBaseline="middle",n.font=tt,v=it,l=0;l<=i+1;v-=rt*.1,l+=.1)n.lineWidth=st,h=Math.sin(v),c=Math.cos(v),a%2==0&&(innerPoint=[s+(o-d)*h+f,s+(o-d)*c+e],outerPoint=[s+o*h+f,s+o*c+e],n.strokeStyle=w,n.beginPath(),n.moveTo(innerPoint[0],innerPoint[1]),n.lineTo(outerPoint[0],outerPoint[1]),n.closePath(),n.stroke()),(a===10||a===0)&&(n.fillStyle=et,n.lineWidth=k,outerPoint=[s+o*h+f,s+o*c+e],textPoint=[s+(o-b)*h+f,s+(o-b)*c+e],y===5?(l!==i&&Math.round(l)!==60&&n.fillText(Math.round(l),textPoint[0],textPoint[1],ut),n.lineWidth=ft,innerPoint=[s+(o-p)*h+f,s+(o-p)*c+e],y=0):(n.lineWidth=k,innerPoint=[s+(o-g)*h+f,s+(o-g)*c+e]),n.strokeStyle=w,n.beginPath(),n.moveTo(innerPoint[0],innerPoint[1]),n.lineTo(outerPoint[0],outerPoint[1]),n.closePath(),n.stroke(),a=0,ot++,y++),a++;n.restore()},ri=function(n,t){var i,r;n.save(),n.beginPath(),n.moveTo(u*.509345,u*.457943),n.lineTo(u*.5,u*.102803),n.lineTo(u*.490654,u*.457943),n.bezierCurveTo(u*.490654,u*.457943,u*.490654,u*.457943,u*.490654,u*.457943),n.bezierCurveTo(u*.471962,u*.462616,u*.457943,u*.481308,u*.457943,u*.5),n.bezierCurveTo(u*.457943,u*.518691,u*.471962,u*.537383,u*.490654,u*.542056),n.bezierCurveTo(u*.490654,u*.542056,u*.490654,u*.542056,u*.490654,u*.542056),n.lineTo(u*.490654,u*.621495),n.lineTo(u*.509345,u*.621495),n.lineTo(u*.509345,u*.542056),n.bezierCurveTo(u*.509345,u*.542056,u*.509345,u*.542056,u*.509345,u*.542056),n.bezierCurveTo(u*.528037,u*.537383,u*.542056,u*.518691,u*.542056,u*.5),n.bezierCurveTo(u*.542056,u*.481308,u*.528037,u*.462616,u*.509345,u*.457943),n.bezierCurveTo(u*.509345,u*.457943,u*.509345,u*.457943,u*.509345,u*.457943),n.closePath(),t?(n.shadowColor="#000000",n.shadowBlur=3,n.fillStyle="rgba(0, 0, 0, 0.4)",n.strokeStyle="rgba(0, 0, 0, 0.4)",n.fill()):(i=n.createLinearGradient(0,0,0,u*.621495),i.addColorStop(0,h.medium.getRgbaColor()),i.addColorStop(.388888,h.medium.getRgbaColor()),i.addColorStop(.5,h.light.getRgbaColor()),i.addColorStop(.611111,h.medium.getRgbaColor()),i.addColorStop(1,h.medium.getRgbaColor()),n.fillStyle=i,n.strokeStyle=h.dark.getRgbaColor(),n.fill(),n.stroke()),t||(n.beginPath(),r=u*.06542/2,n.arc(o,v,r,0,st),i=n.createLinearGradient(o-r,o+r,0,o+r),i.addColorStop(0,"rgb(230, 179, 92)"),i.addColorStop(.01,"rgb(230, 179, 92)"),i.addColorStop(.99,"rgb(196, 130, 0)"),i.addColorStop(1,"rgb(196, 130, 0)"),n.fillStyle=i,n.closePath(),n.fill(),n.beginPath(),r=u*.046728/2,n.arc(o,v,r,0,st),i=n.createRadialGradient(o,o,0,o,o,r),i.addColorStop(0,"#c5c5c5"),i.addColorStop(.19,"#c5c5c5"),i.addColorStop(.22,"#000000"),i.addColorStop(.8,"#000000"),i.addColorStop(.99,"#707070"),i.addColorStop(1,"#707070"),n.fillStyle=i,n.closePath(),n.fill()),n.restore()},ni=function(n,t){var i,r;n.save(),n.beginPath(),n.moveTo(u*.476635,u*.313084),n.bezierCurveTo(u*.476635,u*.322429,u*.485981,u*.331775,u*.495327,u*.336448),n.bezierCurveTo(u*.495327,u*.336448,u*.495327,u*.350467,u*.495327,u*.350467),n.lineTo(u*.504672,u*.350467),n.bezierCurveTo(u*.504672,u*.350467,u*.504672,u*.336448,u*.504672,u*.336448),n.bezierCurveTo(u*.514018,u*.331775,u*.523364,u*.322429,u*.523364,u*.313084),n.bezierCurveTo(u*.523364,u*.303738,u*.514018,u*.294392,u*.504672,u*.289719),n.bezierCurveTo(u*.504672,u*.289719,u*.5,u*.200934,u*.5,u*.200934),n.bezierCurveTo(u*.5,u*.200934,u*.495327,u*.289719,u*.495327,u*.289719),n.bezierCurveTo(u*.485981,u*.294392,u*.476635,u*.303738,u*.476635,u*.313084),n.closePath(),t?(n.shadowColor="#000000",n.shadowBlur=3,n.fillStyle="rgba(0, 0, 0, 0.4)",n.strokeStyle="rgba(0, 0, 0, 0.4)",n.fill()):(i=n.createLinearGradient(0,0,u,0),i.addColorStop(0,h.medium.getRgbaColor()),i.addColorStop(.388888,h.medium.getRgbaColor()),i.addColorStop(.5,h.light.getRgbaColor()),i.addColorStop(.611111,h.medium.getRgbaColor()),i.addColorStop(1,h.medium.getRgbaColor()),n.fillStyle=i,n.strokeStyle=h.dark.getRgbaColor(),n.fill(),n.stroke()),t||(n.beginPath(),r=u*.037383/2,n.arc(o,k+a/2,r,0,st),n.fillStyle="#C48200",n.closePath(),n.fill(),n.beginPath(),r=u*.028037/2,n.arc(o,k+a/2,r,0,st),n.fillStyle="#999999",n.closePath(),n.fill(),n.beginPath(),r=u*.018691/2,n.arc(o,k+a/2,r,0,st),n.fillStyle="#000000",n.closePath(),n.fill()),n.restore()},wt=function(){g=+new Date-at,yt=g*pi/1e3,dt=yt%10800/30,hi=g/6e4%30,ci=g/1e3%60,si=g%1e3},et=function(n){n=n||{};var r=undefined===n.frame?!1:n.frame,f=undefined===n.background?!1:n.background,t=undefined===n.pointers?!1:n.pointers,i=undefined===n.foreground?!1:n.foreground;yi=!0,r&&oi&&y(vi,ui,o,v,u,c),f&&(b(nt,pt,o,v,u,c),ot(nt,bi,o,v,u,c),gt(nt,u,60,.075,.1,0,0),gt(nt,a,30,.095,.13,ki,k)),t&&(ri(fi,!1),ri(ti,!0),ni(ai,!1),ni(li,!0)),i&&p(ii,ei,u,c,!1)},vt=function(n){n=n||{};var r=undefined===n.frame?!1:n.frame,u=undefined===n.background?!1:n.background,t=undefined===n.pointers?!1:n.pointers,i=undefined===n.foreground?!1:n.foreground;r&&(rt.width=f,rt.height=f,vi=rt.getContext("2d")),u&&(it.width=f,it.height=f,nt=it.getContext("2d")),t&&(ft.width=f,ft.height=f,ai=ft.getContext("2d"),ct.width=f,ct.height=f,li=ct.getContext("2d"),tt.width=f,tt.height=f,fi=tt.getContext("2d"),ht.width=f,ht.height=f,ti=ht.getContext("2d"),d.width=f,d.height=f,s=d.getContext("2d")),i&&(ut.width=f,ut.height=f,ii=ut.getContext("2d"))},kt=function(){w||(wt(),wi.repaint()),l&&(bt=setTimeout(kt,200))};return this.isRunning=function(){return l},this.start=function(){l||(l=!0,at=+new Date-g,kt())},this.stop=function(){l&&(l=!1,clearTimeout(bt)),w&&(w=!1,wt(),this.repaint())},this.reset=function(){l&&(l=!1,w=!1,clearTimeout(bt)),at=+new Date,wt(),this.repaint()},this.lap=function(){l&&!w?w=!0:w&&(w=!1)},this.getMeasuredTime=function(){return hi+":"+ci+":"+si},this.setFrameDesign=function(n){vt({frame:!0}),ui=n,et({frame:!0}),this.repaint()},this.setBackgroundColor=function(n){vt({background:!0}),pt=n,et({background:!0}),this.repaint()},this.setForegroundType=function(n){vt({foreground:!0}),ei=n,et({foreground:!0}),this.repaint()},this.setPointerColor=function(n){vt({pointers:!0}),h=n,et({pointers:!0}),this.repaint()},this.repaint=function(){yi||et({frame:!0,background:!0,pointers:!0,foreground:!0}),e.clearRect(0,0,e.canvas.width,e.canvas.height),oi&&e.drawImage(rt,0,0),e.drawImage(it,0,0);var n=u*.006,t=(dt+2*Math.sin(dt*lt))*lt;s.clearRect(0,0,u,c),s.save(),s.translate(o,k+a/2),s.rotate(t),s.translate(-o,-(k+a/2)),s.drawImage(ct,0,0),s.restore(),e.drawImage(d,0,0,u,c,n/2,n/2,u+n/2,c+n/2),e.save(),e.translate(o,k+a/2),e.rotate(t),e.translate(-o,-(k+a/2)),e.drawImage(ft,0,0),e.restore(),t=(yt+2*Math.sin(yt*lt))*lt,s.clearRect(0,0,u,c),s.save(),s.translate(o,v),s.rotate(t),s.translate(-o,-v),s.drawImage(ht,0,0),s.restore(),e.drawImage(d,0,0,u,c,n,n,u+n,c+n),e.save(),e.translate(o,v),e.rotate(t),e.translate(-o,-v),e.drawImage(tt,0,0),e.restore(),e.drawImage(ut,0,0)},at=+new Date,kt(),this},ru=function(n,i){function vi(){tt=2*Math.PI/(fi-l),et=tt/10,ct=et/10}function yi(){ht=a%1e3/100,lt=a%1e4/100,at=a%1e5/100}var g,ft;i=i||{};var o=undefined===i.size?200:i.size,ui=undefined===i.frameDesign?steelseries.FrameDesign.METAL:i.frameDesign,ai=undefined===i.frameVisible?!0:i.frameVisible,st=undefined===i.backgroundColor?steelseries.BackgroundColor.DARK_GRAY:i.backgroundColor,ci=undefined===i.knobType?steelseries.KnobType.METAL_KNOB:i.knobType,nr=undefined===i.knobStyle?steelseries.KnobStyle.BLACK:i.knobStyle,k=undefined===i.lcdColor?steelseries.LcdColor.BLACK:i.lcdColor,pt=undefined===i.lcdVisible?!0:i.lcdVisible,bi=undefined===i.digitalFont?!1:i.digitalFont,ti=undefined===i.foregroundType?steelseries.ForegroundType.TYPE1:i.foregroundType,gi=undefined===i.customLayer?null:i.customLayer,l=0,fi=10,a=l,ht=0,lt=0,at=0,tt,et,ct,di=1,d,e=r.getElementById(n).getContext("2d");e.save(),e.clearRect(0,0,e.canvas.width,e.canvas.height),e.canvas.width=o,e.canvas.height=o;var u=o,f=o,h=u/2,c=f/2,ki=Math.floor(u*.09)+"px sans-serif",or=Math.PI/2,er=Math.PI/180,wi=Math.PI,oi=!1,ut=t(o,o),si=ut.getContext("2d"),rt=t(o,o),it=rt.getContext("2d"),wt,vt=t(o,o),ur=vt.getContext("2d"),yt=t(o,o),fr=yt.getContext("2d"),gt=t(o,o),tr=gt.getContext("2d"),ni=t(o,o),ir=ni.getContext("2d"),dt=t(o,o),rr=dt.getContext("2d"),kt=t(o,o),pi=kt.getContext("2d"),v=t(o,o),s=v.getContext("2d"),nt=t(o,o),bt=nt.getContext("2d"),li=function(n){e.save(),e.textAlign="right",e.textBaseline="middle",e.strokeStyle=k.textColor,e.fillStyle=k.textColor,(k===steelseries.LcdColor.STANDARD||k===steelseries.LcdColor.STANDARD_GREEN)&&(e.shadowColor="gray",e.shadowOffsetX=u*.007,e.shadowOffsetY=u*.007,e.shadowBlur=u*.009),e.font=bi?Math.floor(u*.075)+"px LCDMono2Ultra":Math.floor(u*.075)+"px sans-serif",e.fillText(Math.round(n),(u+u*.4)/2-4,u*.607,u*.4),e.restore()},hi=function(n,t,i,r,f,e){var it=Math.max(u*.012,2),rt=Math.max(u*.007,1.5),d=u*.13,g=u*.05,nt=u*.07,v=u*.4,b=0,ut=0,p=0,y=0,k,w,tt=-i-t/2;for(n.save(),n.textAlign="center",n.textBaseline="middle",n.font=ki,n.strokeStyle=st.labelColor.getRgbaColor(),n.fillStyle=st.labelColor.getRgbaColor(),k=tt,w=0;w<=10;k-=e*.1,w+=.1)p=Math.sin(k),y=Math.cos(k),b%2==0&&(n.lineWidth=rt,n.beginPath(),n.moveTo(h+(v-g)*p,c+(v-g)*y),n.lineTo(h+v*p,c+v*y),n.closePath(),n.stroke()),(b===10||b===0)&&(n.lineWidth=it,t===0&&Math.round(w)!=fi&&n.fillText(Math.round(w).toString(),h+(v-d)*p,c+(v-d)*y),b=0,ut++,n.beginPath(),n.moveTo(h+(v-nt)*p,c+(v-nt)*y),n.lineTo(h+v*p,c+v*y),n.closePath(),n.stroke()),b++;n.restore()},ei=function(n,t){var i;t?(n.shadowColor="#000000",n.shadowBlur=3,n.fillStyle="rgba(0, 0, 0, 0.4)",n.strokeStyle="rgba(0, 0, 0, 0.4)"):(i=n.createLinearGradient(0,f*.168224,0,f*.626168),i.addColorStop(0,"#ffffff"),i.addColorStop(.31,"#ffffff"),i.addColorStop(.3101,"#ffffff"),i.addColorStop(.32,"rgb(32, 32, 32)"),i.addColorStop(1,"rgb(32, 32, 32)"),n.fillStyle=i),n.save(),n.beginPath(),n.moveTo(u*.518691,f*.471962),n.bezierCurveTo(u*.514018,f*.471962,u*.509345,f*.467289,u*.509345,f*.467289),n.lineTo(u*.509345,f*.200934),n.lineTo(u*.5,f*.168224),n.lineTo(u*.490654,f*.200934),n.lineTo(u*.490654,f*.467289),n.bezierCurveTo(u*.490654,f*.467289,u*.481308,f*.471962,u*.481308,f*.471962),n.bezierCurveTo(u*.471962,f*.481308,u*.467289,f*.490654,u*.467289,f*.5),n.bezierCurveTo(u*.467289,f*.514018,u*.476635,f*.528037,u*.490654,f*.53271),n.bezierCurveTo(u*.490654,f*.53271,u*.490654,f*.579439,u*.490654,f*.588785),n.bezierCurveTo(u*.485981,f*.593457,u*.481308,f*.59813,u*.481308,f*.607476),n.bezierCurveTo(u*.481308,f*.616822,u*.490654,f*.626168,u*.5,f*.626168),n.bezierCurveTo(u*.509345,f*.626168,u*.518691,f*.616822,u*.518691,f*.607476),n.bezierCurveTo(u*.518691,f*.59813,u*.514018,f*.593457,u*.504672,f*.588785),n.bezierCurveTo(u*.504672,f*.579439,u*.504672,f*.53271,u*.509345,f*.53271),n.bezierCurveTo(u*.523364,f*.528037,u*.53271,f*.514018,u*.53271,f*.5),n.bezierCurveTo(u*.53271,f*.490654,u*.528037,f*.481308,u*.518691,f*.471962),n.closePath(),n.fill(),n.restore()},ii=function(n,t){var i;t?(n.shadowColor="#000000",n.shadowBlur=3,n.fillStyle="rgba(0, 0, 0, 0.4)",n.strokeStyle="rgba(0, 0, 0, 0.4)"):(i=n.createLinearGradient(0,f*.401869,0,f*.616822),i.addColorStop(0,"#ffffff"),i.addColorStop(.51,"#ffffff"),i.addColorStop(.52,"#ffffff"),i.addColorStop(.5201,"rgb(32, 32, 32)"),i.addColorStop(.53,"rgb(32, 32, 32)"),i.addColorStop(1,"rgb(32, 32, 32)"),n.fillStyle=i),n.beginPath(),n.moveTo(u*.518691,f*.471962),n.bezierCurveTo(u*.514018,f*.462616,u*.528037,f*.401869,u*.528037,f*.401869),n.lineTo(u*.5,f*.331775),n.lineTo(u*.471962,f*.401869),n.bezierCurveTo(u*.471962,f*.401869,u*.485981,f*.462616,u*.481308,f*.471962),n.bezierCurveTo(u*.471962,f*.481308,u*.467289,f*.490654,u*.467289,f*.5),n.bezierCurveTo(u*.467289,f*.514018,u*.476635,f*.528037,u*.490654,f*.53271),n.bezierCurveTo(u*.490654,f*.53271,u*.462616,f*.574766,u*.462616,f*.593457),n.bezierCurveTo(u*.467289,f*.616822,u*.5,f*.612149,u*.5,f*.612149),n.bezierCurveTo(u*.5,f*.612149,u*.53271,f*.616822,u*.537383,f*.593457),n.bezierCurveTo(u*.537383,f*.574766,u*.509345,f*.53271,u*.509345,f*.53271),n.bezierCurveTo(u*.523364,f*.528037,u*.53271,f*.514018,u*.53271,f*.5),n.bezierCurveTo(u*.53271,f*.490654,u*.528037,f*.481308,u*.518691,f*.471962),n.closePath(),n.fill(),n.restore()},ri=function(n,t){t?(n.shadowColor="#000000",n.shadowBlur=3,n.fillStyle="rgba(0, 0, 0, 0.4)",n.strokeStyle="rgba(0, 0, 0, 0.4)"):n.fillStyle="#ffffff",n.beginPath(),n.moveTo(u*.518691,f*.471962),n.bezierCurveTo(u*.514018,f*.471962,u*.514018,f*.467289,u*.514018,f*.467289),n.lineTo(u*.514018,f*.317757),n.lineTo(u*.504672,f*.303738),n.lineTo(u*.504672,f*.182242),n.lineTo(u*.53271,f*.116822),n.lineTo(u*.462616,f*.116822),n.lineTo(u*.495327,f*.182242),n.lineTo(u*.495327,f*.299065),n.lineTo(u*.485981,f*.317757),n.lineTo(u*.485981,f*.467289),n.bezierCurveTo(u*.485981,f*.467289,u*.485981,f*.471962,u*.481308,f*.471962),n.bezierCurveTo(u*.471962,f*.481308,u*.467289,f*.490654,u*.467289,f*.5),n.bezierCurveTo(u*.467289,f*.518691,u*.481308,f*.53271,u*.5,f*.53271),n.bezierCurveTo(u*.518691,f*.53271,u*.53271,f*.518691,u*.53271,f*.5),n.bezierCurveTo(u*.53271,f*.490654,u*.528037,f*.481308,u*.518691,f*.471962),n.closePath(),n.fill()};return g=function(n){n=n||{};var r=undefined===n.frame?!1:n.frame,e=undefined===n.background?!1:n.background,t=undefined===n.pointers?!1:n.pointers,i=undefined===n.foreground?!1:n.foreground;oi=!0,vi(),r&&ai&&y(si,ui,h,c,u,f),e&&(b(it,st,h,c,u,f),ot(it,gi,h,c,u,f),hi(it,0,wi,0,10,tt,di,0,!0,!0,null),pt&&(wt=w(u*.4,f*.09,k),it.drawImage(wt,(u-u*.4)/2,f*.56))),t&&(ei(rr,!1),ei(pi,!0),ii(tr,!1),ii(ir,!0),ri(ur,!1),ri(fr,!0)),i&&p(bt,ti,u,f,!0,ci,nr)},ft=function(n){n=n||{};var r=undefined===n.frame?!1:n.frame,u=undefined===n.background?!1:n.background,t=undefined===n.pointers?!1:n.pointers,i=undefined===n.foreground?!1:n.foreground;r&&(ut.width=o,ut.height=o,si=ut.getContext("2d")),u&&(rt.width=o,rt.height=o,it=rt.getContext("2d")),t&&(pointer100ftBuffer.width=o,pointer100ftBuffer.height=o,pointer100ftContext=pointer100ftBuffer.getContext("2d"),pointer100ftShadowBuffer.width=o,pointer100ftShadowBuffer.height=o,pointer100ftShadowContext=pointer100ftShadowBuffer.getContext("2d"),pointer1000ftBuffer.width=o,pointer1000ftBuffer.height=o,pointer1000ftContext=pointer1000ftBuffer.getContext("2d"),pointer1000ftShadowBuffer.width=o,pointer1000ftShadowBuffer.height=o,pointer1000ftShadowContext=pointer1000ftShadowBuffer.getContext("2d"),pointer10000ftBuffer.width=o,pointer10000ftBuffer.height=o,pointer10000ftContext=pointer10000ftBuffer.getContext("2d"),pointer10000ftShadowBuffer.width=o,pointer10000ftShadowBuffer.height=o,pointer10000ftShadowContext=pointer10000ftShadowBuffer.getContext("2d"),v.width=o,v.height=o,s=v.getContext("2d")),i&&(nt.width=o,nt.height=o,bt=nt.getContext("2d"))},this.setValue=function(n){a=n,this.repaint()},this.getValue=function(){return a},this.setValueAnimated=function(n){var t=n<l?l:n,r,i;a!==t&&(undefined!==d&&d.playing&&d.stop(),r=Math.max(Math.abs(a-t)/2e3,1),d=new Tween({},"",Tween.regularEaseInOut,a,t,r),i=this,d.onMotionChanged=function(n){a=n.target._pos,i.repaint()},d.start())},this.setFrameDesign=function(n){ft({frame:!0}),ui=n,g({frame:!0}),this.repaint()},this.setBackgroundColor=function(n){ft({background:!0,pointer:!0}),st=n,g({background:!0,pointer:!0}),this.repaint()},this.setForegroundType=function(n){ft({foreground:!0}),ti=n,g({foreground:!0}),this.repaint()},this.setLcdColor=function(n){k=n,g({background:!0}),this.repaint()},this.repaint=function(){oi||g({frame:!0,background:!0,led:!0,pointers:!0,foreground:!0}),e.clearRect(0,0,e.canvas.width,e.canvas.height),e.drawImage(ut,0,0),e.drawImage(rt,0,0),pt&&li(a),yi();var n=u*.006*.5;s.clearRect(0,0,u,f),s.save(),s.translate(h,c),s.rotate((at-l)*ct),s.translate(-h,-c),s.drawImage(yt,0,0),s.restore(),e.drawImage(v,0,0,u,f,n,n,u+n,f+n),e.save(),e.translate(h,c),e.rotate((at-l)*ct),e.translate(-h,-c),e.drawImage(vt,0,0),e.restore(),s.clearRect(0,0,u,f),s.save(),s.translate(h,c),s.rotate((lt-l)*et),s.translate(-h,-c),s.drawImage(ni,0,0),s.restore(),e.drawImage(v,0,0,u,f,n,n,u+n,f+n),n=u*.006*.75,e.save(),e.translate(h,c),e.rotate((lt-l)*et),e.translate(-h,-c),e.drawImage(gt,0,0),e.restore(),n=u*.006,s.clearRect(0,0,u,f),s.save(),s.translate(h,c),s.rotate((ht-l)*tt),s.translate(-h,-c),s.drawImage(kt,0,0),s.restore(),e.drawImage(v,0,0,u,f,n,n,u+n,f+n),e.save(),e.translate(h,c),e.rotate((ht-l)*tt),e.translate(-h,-c),e.drawImage(dt,0,0),e.restore(),e.drawImage(nt,0,0)},this.repaint(),this},iu=function(n,t){function pt(n,t,i){var u=r.createElement("canvas");return u.width=n,u.height=t,i(u.getContext("2d")),u}var ot,s,st,h,et,o,at,e,lt,c,ct,v,ft,l,ut,a,rt,y,tt;t=t||{};var g=undefined===t.width?98:t.width,d=undefined===t.height?278:t.height,f=r.getElementById(n).getContext("2d");f.save(),f.clearRect(0,0,f.canvas.width,f.canvas.height),f.canvas.width=g,f.canvas.height=d;var it=g<d*.3525179856?g*2.8367346939:d,i=it*.3525179856,u=it,w=!1,b=!1,k=!1,ht=!1,p=r.createElement("canvas");p.width=i,p.height=u,ot=p.getContext("2d"),s=r.createElement("canvas"),s.width=i,s.height=u,st=s.getContext("2d"),h=r.createElement("canvas"),h.width=i,h.height=u,et=h.getContext("2d"),o=r.createElement("canvas"),o.width=i,o.height=u,at=o.getContext("2d"),e=r.createElement("canvas"),e.width=i,e.height=u,lt=e.getContext("2d"),c=r.createElement("canvas"),c.width=i,c.height=u,ct=c.getContext("2d"),v=r.createElement("canvas"),v.width=i,v.height=u,ft=v.getContext("2d"),l=r.createElement("canvas"),l.width=i,l.height=u,ut=l.getContext("2d"),a=r.createElement("canvas"),a.width=i,a.height=u,rt=a.getContext("2d"),y=r.createElement("canvas"),y.width=i,y.height=u;var ni=y.getContext("2d"),gt=function(n){var r,t;n.save(),n.save(),n.beginPath(),n.moveTo(.10714285714285714*i,0),n.lineTo(i-.10714285714285714*i,0),n.quadraticCurveTo(i,0,i,.10714285714285714*i),n.lineTo(i,u-.10714285714285714*i),n.quadraticCurveTo(i,u,i-.10714285714285714*i,u),n.lineTo(.10714285714285714*i,u),n.quadraticCurveTo(0,u,0,u-.10714285714285714*i),n.lineTo(0,.10714285714285714*i),n.quadraticCurveTo(0,0,.10714285714285714*i,u),n.closePath(),r=n.createLinearGradient(.040816326530612242*i,.0071942446043165471*u,.95210113647305927*i,.99588249355863079*u),r.addColorStop(0,"rgb(152, 152, 154)"),r.addColorStop(.01,"rgb(152, 152, 154)"),r.addColorStop(.09,"rgb(51, 51, 51)"),r.addColorStop(.24,"rgb(152, 152, 154)"),r.addColorStop(.55,"rgb(31, 31, 31)"),r.addColorStop(.78,"rgb(54, 54, 54)"),r.addColorStop(.98,"rgb(0, 0, 0)"),r.addColorStop(1,"rgb(0, 0, 0)"),n.fillStyle=r,n.fill(),n.restore(),n.save(),n.beginPath(),n.moveTo(.030612244897959183*i+.084183673469387751*i,.010791366906474821*u),n.lineTo(.030612244897959183*i+.93877551020408168*i-.084183673469387751*i,.010791366906474821*u),n.quadraticCurveTo(.030612244897959183*i+.93877551020408168*i,.010791366906474821*u,.030612244897959183*i+.93877551020408168*i,.010791366906474821*u+.084183673469387751*i),n.lineTo(.030612244897959183*i+.93877551020408168*i,.010791366906474821*u+.97841726618705038*u-.084183673469387751*i),n.quadraticCurveTo(.030612244897959183*i+.93877551020408168*i,.010791366906474821*u+.97841726618705038*u,.030612244897959183*i+.93877551020408168*i-.084183673469387751*i,.010791366906474821*u+.97841726618705038*u),n.lineTo(.030612244897959183*i+.084183673469387751*i,.010791366906474821*u+.97841726618705038*u),n.quadraticCurveTo(.030612244897959183*i,.010791366906474821*u+.97841726618705038*u,.030612244897959183*i,.010791366906474821*u+.97841726618705038*u-.084183673469387751*i),n.lineTo(.030612244897959183*i,.010791366906474821*u+.084183673469387751*i),n.quadraticCurveTo(.030612244897959183*i,.010791366906474821*u,.030612244897959183*i+.084183673469387751*i,.010791366906474821*u),n.closePath(),t=n.createLinearGradient(-.1326530612244898*i,-.0539568345323741*u,2.0614080436330213*i,.66729322970638327*u),t.addColorStop(0,"rgb(0, 0, 0)"),t.addColorStop(.01,"rgb(0, 0, 0)"),t.addColorStop(.16,"rgb(55, 55, 53)"),t.addColorStop(.31,"rgb(0, 0, 0)"),t.addColorStop(.44,"rgb(48, 48, 48)"),t.addColorStop(.65,"rgb(0, 0, 0)"),t.addColorStop(.87,"rgb(54, 54, 54)"),t.addColorStop(.98,"rgb(0, 0, 0)"),t.addColorStop(1,"rgb(0, 0, 0)"),n.fillStyle=t,n.fill(),n.restore(),n.restore()},dt=function(n){var t,f,r,e;n.save(),n.save(),n.scale(1,1),n.beginPath(),n.arc(.5*i,.80575539568345322*u,.39795918367346939*i,0,2*Math.PI,!1),t=n.createLinearGradient(.5*i,.66546762589928055*u,.50000000000000011*i,.9460431654676259*u),t.addColorStop(0,"rgb(255, 255, 255)"),t.addColorStop(.05,"rgb(204, 204, 204)"),t.addColorStop(.1,"rgb(153, 153, 153)"),t.addColorStop(.17,"rgb(102, 102, 102)"),t.addColorStop(.27,"rgb(51, 51, 51)"),t.addColorStop(1,"rgb(1, 1, 1)"),n.fillStyle=t,n.fill(),n.restore(),n.save(),n.scale(1.0833333333333333,1),n.beginPath(),n.arc(.46153846153846156*i,.81654676258992809*u,.36734693877551022*i,0,2*Math.PI,!1),f=n.createLinearGradient(.5*i,.68705035971223016*u,.50000000000000011*i,.9460431654676259*u),f.addColorStop(0,"rgb(0, 0, 0)"),f.addColorStop(.35,"rgb(4, 4, 4)"),f.addColorStop(.66,"rgb(0, 0, 0)"),f.addColorStop(1,"rgb(1, 1, 1)"),n.fillStyle=f,n.fill(),n.restore(),n.save(),n.scale(1,1),n.beginPath(),n.arc(.5*i,.80935251798561147*u,.35714285714285715*i,0,2*Math.PI,!1),r=n.createRadialGradient(.5*i,.80935251798561147*u,0,.5*i,.80935251798561147*u,.36224489795918369*i),r.addColorStop(0,"rgb(0, 0, 0)"),r.addColorStop(.88,"rgb(0, 0, 0)"),r.addColorStop(.95,"rgb(94, 94, 94)"),r.addColorStop(1,"rgb(1, 1, 1)"),n.fillStyle=r,n.fill(),n.restore(),n.save(),n.scale(1,1),n.beginPath(),n.arc(.5*i,.80935251798561147*u,.35714285714285715*i,0,2*Math.PI,!1),e=n.createLinearGradient(.5*i,.68705035971223016*u,.50000000000000011*i,.91726618705035967*u),e.addColorStop(0,"rgb(0, 0, 0)"),e.addColorStop(1,"rgba(1, 1, 1, 0)"),n.fillStyle=e,n.fill(),n.restore(),n.restore()},ri=function(n){var r,t;n.save(),n.save(),n.scale(1,1),n.beginPath(),n.arc(.5*i,.80935251798561147*u,.32653061224489793*i,0,2*Math.PI,!1),r=n.createRadialGradient(.5*i,.80935251798561147*u,0,.5*i,.80935251798561147*u,.32653061224489793*i),r.addColorStop(0,"rgb(85, 185, 123)"),r.addColorStop(1,"rgb(0, 31, 0)"),n.fillStyle=r,n.fill(),n.restore(),n.save(),n.beginPath(),n.moveTo(0,.81294964028776984*u),n.bezierCurveTo(0,.91007194244604317*u,.22448979591836735*i,.98920863309352514*u,.5*i,.98920863309352514*u),n.bezierCurveTo(.77551020408163263*i,.98920863309352514*u,i,.91007194244604317*u,i,.80935251798561147*u),n.bezierCurveTo(.90816326530612246*i,.75179856115107913*u,.70408163265306123*i,.68705035971223016*u,.5*i,.68705035971223016*u),n.bezierCurveTo(.2857142857142857*i,.68705035971223016*u,.081632653061224483*i,.75179856115107913*u,0,.81294964028776984*u),n.closePath(),t=n.createRadialGradient(.5*i,.80935251798561147*u,0,.5*i,.80935251798561147*u,.51530612244897955*i),t.addColorStop(0,"rgb(65, 187, 126)"),t.addColorStop(1,"rgba(4, 37, 8, 0)"),n.fillStyle=t,n.fill(),n.restore(),n.restore()},wt=function(n){var r,t;n.save(),n.save(),n.scale(1,1),n.beginPath(),n.arc(.5*i,.80935251798561147*u,.32653061224489793*i,0,2*Math.PI,!1),r=n.createRadialGradient(.5*i,.80935251798561147*u,0,.5*i,.80935251798561147*u,.32653061224489793*i),r.addColorStop(0,"rgba(0, 255, 0, 0.2470588235)"),r.addColorStop(1,"rgba(0, 255, 0, 0.0470588235)"),n.fillStyle=r,n.fill(),n.restore(),n.save(),n.scale(1,1),n.beginPath(),n.arc(.5*i,.80935251798561147*u,.32653061224489793*i,0,2*Math.PI,!1),t=n.createRadialGradient(.5*i,.80935251798561147*u,0,.5*i,.80935251798561147*u,.32653061224489793*i),t.addColorStop(0,"rgba(1, 1, 1, 0)"),t.addColorStop(.55,"rgba(0, 0, 0, 0)"),t.addColorStop(.5501,"rgba(0, 0, 0, 0)"),t.addColorStop(.78,"rgba(0, 0, 0, 0.1215686275)"),t.addColorStop(.79,"rgba(0, 0, 0, 0.1294117647)"),t.addColorStop(1,"rgba(0, 0, 0, 0.4980392157)"),n.fillStyle=t,n.fill(),n.restore(),n.fillStyle=n.createPattern(nt,"repeat"),n.fill(),n.restore()},ii=function(n){var t,f,r,e;n.save(),n.save(),n.scale(1,1),n.beginPath(),n.arc(.5*i,.49640287769784175*u,.39795918367346939*i,0,2*Math.PI,!1),t=n.createLinearGradient(.5*i,.35611510791366907*u,.50000000000000011*i,.63669064748201443*u),t.addColorStop(0,"rgb(255, 255, 255)"),t.addColorStop(.05,"rgb(204, 204, 204)"),t.addColorStop(.1,"rgb(153, 153, 153)"),t.addColorStop(.17,"rgb(102, 102, 102)"),t.addColorStop(.27,"rgb(51, 51, 51)"),t.addColorStop(1,"rgb(1, 1, 1)"),n.fillStyle=t,n.fill(),n.restore(),n.save(),n.scale(1.0833333333333333,1),n.beginPath(),n.arc(.46153846153846156*i,.5071942446043165*u,.36734693877551022*i,0,2*Math.PI,!1),f=n.createLinearGradient(.5*i,.37769784172661869*u,.50000000000000011*i,.63669064748201443*u),f.addColorStop(0,"rgb(0, 0, 0)"),f.addColorStop(.35,"rgb(4, 4, 4)"),f.addColorStop(.66,"rgb(0, 0, 0)"),f.addColorStop(1,"rgb(1, 1, 1)"),n.fillStyle=f,n.fill(),n.restore(),n.save(),n.scale(1,1),n.beginPath(),n.arc(.5*i,.5*u,.35714285714285715*i,0,2*Math.PI,!1),r=n.createRadialGradient(.5*i,.5*u,0,.5*i,.5*u,.36224489795918369*i),r.addColorStop(0,"rgb(0, 0, 0)"),r.addColorStop(.88,"rgb(0, 0, 0)"),r.addColorStop(.95,"rgb(94, 94, 94)"),r.addColorStop(1,"rgb(1, 1, 1)"),n.fillStyle=r,n.fill(),n.restore(),n.save(),n.scale(1,1),n.beginPath(),n.arc(.5*i,.5*u,.35714285714285715*i,0,2*Math.PI,!1),e=n.createLinearGradient(.5*i,.37769784172661869*u,.50000000000000011*i,.6079136690647482*u),e.addColorStop(0,"rgb(0, 0, 0)"),e.addColorStop(1,"rgba(1, 1, 1, 0)"),n.fillStyle=e,n.fill(),n.restore(),n.restore()},ti=function(n){var r,t;n.save(),n.save(),n.scale(1,1),n.beginPath(),n.arc(.5*i,.5*u,.32653061224489793*i,0,2*Math.PI,!1),r=n.createRadialGradient(.5*i,.5*u,0,.5*i,.5*u,.32653061224489793*i),r.addColorStop(0,"rgb(254, 212, 52)"),r.addColorStop(1,"rgb(130, 51, 12)"),n.fillStyle=r,n.fill(),n.restore(),n.save(),n.beginPath(),n.moveTo(0,.50359712230215825*u),n.bezierCurveTo(0,.60071942446043169*u,.22448979591836735*i,.67985611510791366*u,.5*i,.67985611510791366*u),n.bezierCurveTo(.77551020408163263*i,.67985611510791366*u,i,.60071942446043169*u,i,.5*u),n.bezierCurveTo(.90816326530612246*i,.44244604316546765*u,.70408163265306123*i,.37769784172661869*u,.5*i,.37769784172661869*u),n.bezierCurveTo(.2857142857142857*i,.37769784172661869*u,.081632653061224483*i,.44244604316546765*u,0,.50359712230215825*u),n.closePath(),t=n.createRadialGradient(.5*i,.5*u,0,.5*i,.5*u,.51530612244897955*i),t.addColorStop(0,"rgb(254, 212, 52)"),t.addColorStop(1,"rgba(130, 51, 12, 0)"),n.fillStyle=t,n.fill(),n.restore(),n.restore()},kt=function(n){var r,t;n.save(),n.save(),n.scale(1,1),n.beginPath(),n.arc(.5*i,.5*u,.32653061224489793*i,0,2*Math.PI,!1),r=n.createRadialGradient(.5*i,.5*u,0,.5*i,.5*u,.32653061224489793*i),r.addColorStop(0,"rgba(255, 255, 0, 0.2470588235)"),r.addColorStop(1,"rgba(255, 255, 0, 0.0470588235)"),n.fillStyle=r,n.fill(),n.restore(),n.save(),n.scale(1,1),n.beginPath(),n.arc(.5*i,.5*u,.32653061224489793*i,0,2*Math.PI,!1),t=n.createRadialGradient(.5*i,.5*u,0,.5*i,.5*u,.32653061224489793*i),t.addColorStop(0,"rgba(1, 1, 1, 0)"),t.addColorStop(.55,"rgba(0, 0, 0, 0)"),t.addColorStop(.5501,"rgba(0, 0, 0, 0)"),t.addColorStop(.78,"rgba(0, 0, 0, 0.1215686275)"),t.addColorStop(.79,"rgba(0, 0, 0, 0.1294117647)"),t.addColorStop(1,"rgba(0, 0, 0, 0.4980392157)"),n.fillStyle=t,n.fill(),n.restore(),n.fillStyle=n.createPattern(nt,"repeat"),n.fill(),n.restore()},vt=function(n){var t,f,r,e;n.save(),n.save(),n.scale(1,1),n.beginPath(),n.arc(.5*i,.18705035971223022*u,.39795918367346939*i,0,2*Math.PI,!1),t=n.createLinearGradient(.5*i,.046762589928057555*u,.50000000000000011*i,.3273381294964029*u),t.addColorStop(0,"rgb(255, 255, 255)"),t.addColorStop(.05,"rgb(204, 204, 204)"),t.addColorStop(.1,"rgb(153, 153, 153)"),t.addColorStop(.17,"rgb(102, 102, 102)"),t.addColorStop(.27,"rgb(51, 51, 51)"),t.addColorStop(1,"rgb(1, 1, 1)"),n.fillStyle=t,n.fill(),n.restore(),n.save(),n.scale(1.0833333333333333,1),n.beginPath(),n.arc(.46153846153846156*i,.19784172661870503*u,.36734693877551022*i,0,2*Math.PI,!1),f=n.createLinearGradient(.5*i,.0683453237410072*u,.50000000000000011*i,.3273381294964029*u),f.addColorStop(0,"rgb(0, 0, 0)"),f.addColorStop(.35,"rgb(4, 4, 4)"),f.addColorStop(.66,"rgb(0, 0, 0)"),f.addColorStop(1,"rgb(1, 1, 1)"),n.fillStyle=f,n.fill(),n.restore(),n.save(),n.scale(1,1),n.beginPath(),n.arc(.5*i,.1906474820143885*u,.35714285714285715*i,0,2*Math.PI,!1),r=n.createRadialGradient(.5*i,.1906474820143885*u,0,.5*i,.1906474820143885*u,.36224489795918369*i),r.addColorStop(0,"rgb(0, 0, 0)"),r.addColorStop(.88,"rgb(0, 0, 0)"),r.addColorStop(.95,"rgb(94, 94, 94)"),r.addColorStop(1,"rgb(1, 1, 1)"),n.fillStyle=r,n.fill(),n.restore(),n.save(),n.scale(1,1),n.beginPath(),n.arc(.5*i,.1906474820143885*u,.35714285714285715*i,0,2*Math.PI,!1),e=n.createLinearGradient(.5*i,.0683453237410072*u,.50000000000000011*i,.29856115107913667*u),e.addColorStop(0,"rgb(0, 0, 0)"),e.addColorStop(1,"rgba(1, 1, 1, 0)"),n.fillStyle=e,n.fill(),n.restore(),n.restore()},yt=function(n){var r,t;n.save(),n.save(),n.scale(1,1),n.beginPath(),n.arc(.5*i,.1906474820143885*u,.32653061224489793*i,0,2*Math.PI,!1),r=n.createRadialGradient(.5*i,.1906474820143885*u,0,.5*i,.1906474820143885*u,.32653061224489793*i),r.addColorStop(0,"rgb(255, 0, 0)"),r.addColorStop(1,"rgb(65, 0, 4)"),n.fillStyle=r,n.fill(),n.restore(),n.save(),n.beginPath(),n.moveTo(0,.19424460431654678*u),n.bezierCurveTo(0,.29136690647482016*u,.22448979591836735*i,.37050359712230213*u,.5*i,.37050359712230213*u),n.bezierCurveTo(.77551020408163263*i,.37050359712230213*u,i,.29136690647482016*u,i,.1906474820143885*u),n.bezierCurveTo(.90816326530612246*i,.13309352517985612*u,.70408163265306123*i,.0683453237410072*u,.5*i,.0683453237410072*u),n.bezierCurveTo(.2857142857142857*i,.0683453237410072*u,.081632653061224483*i,.13309352517985612*u,0,.19424460431654678*u),n.closePath(),t=n.createRadialGradient(.5*i,.1906474820143885*u,0,.5*i,.1906474820143885*u,.51530612244897955*i),t.addColorStop(0,"rgb(255, 0, 0)"),t.addColorStop(1,"rgba(118, 5, 1, 0)"),n.fillStyle=t,n.fill(),n.restore(),n.restore()},bt=function(n){var r,t;n.save(),n.save(),n.scale(1,1),n.beginPath(),n.arc(.5*i,.1906474820143885*u,.32653061224489793*i,0,2*Math.PI,!1),r=n.createRadialGradient(.5*i,.1906474820143885*u,0,.5*i,.1906474820143885*u,.32653061224489793*i),r.addColorStop(0,"rgba(255, 0, 0, 0.2470588235)"),r.addColorStop(1,"rgba(255, 0, 0, 0.0470588235)"),n.fillStyle=r,n.fill(),n.restore(),n.save(),n.scale(1,1),n.beginPath(),n.arc(.5*i,.1906474820143885*u,.32653061224489793*i,0,2*Math.PI,!1),t=n.createRadialGradient(.5*i,.1906474820143885*u,0,.5*i,.1906474820143885*u,.32653061224489793*i),t.addColorStop(0,"rgba(1, 1, 1, 0)"),t.addColorStop(.55,"rgba(0, 0, 0, 0)"),t.addColorStop(.5501,"rgba(0, 0, 0, 0)"),t.addColorStop(.78,"rgba(0, 0, 0, 0.1215686275)"),t.addColorStop(.79,"rgba(0, 0, 0, 0.1294117647)"),t.addColorStop(1,"rgba(0, 0, 0, 0.4980392157)"),n.fillStyle=t,n.fill(),n.restore(),n.fillStyle=n.createPattern(nt,"repeat"),n.fill(),n.restore()},nt=pt(2,2,function(n){n.save(),n.strokeStyle="rgba(0, 0, 0, 0.1)",n.beginPath(),n.lineTo(0,0,1,0),n.lineTo(0,1,0,1),n.stroke(),n.restore()});return tt=function(){ht=!0,gt(ot),dt(st),ri(et),wt(at),ii(lt),ti(ct),kt(ft),vt(ut),yt(rt),bt(ni)},this.setRedOn=function(n){w=n,this.repaint()},this.isRedOn=function(){return w},this.setYellowOn=function(n){b=n,this.repaint()},this.isYellowOn=function(){return b},this.setGreenOn=function(n){k=n,this.repaint()},this.isGreenOn=function(){return k},this.repaint=function(){ht||tt(),f.save(),f.clearRect(0,0,f.canvas.width,f.canvas.height),f.drawImage(p,0,0),f.drawImage(s,0,0),k&&f.drawImage(h,0,0),f.drawImage(o,0,0),f.drawImage(e,0,0),b&&f.drawImage(c,0,0),f.drawImage(v,0,0),f.drawImage(l,0,0),w&&f.drawImage(a,0,0),f.drawImage(y,0,0),f.restore()},this.repaint(),this},gr=function(n,t){function tt(n,t,i){var u=r.createElement("canvas");return u.width=n,u.height=t,i(u.getContext("2d")),u}var k,e,p,o,y,s;t=t||{};var a=undefined===t.width?100:t.width,l=undefined===t.height?100:t.height,h=undefined===t.glowColor?"rgb(255, 255, 0)":t.glowColor,f=document.getElementById(n).getContext("2d");f.save(),f.clearRect(0,0,f.canvas.width,f.canvas.height),f.canvas.width=a,f.canvas.height=l;var b=a<l?a:l,i=b,u=b,w=!1,v=!1,c=1;k=function(n){var t,i=tt(1,1,function(t){t.fillStyle=n,t.beginPath(),t.rect(0,0,1,1),t.fill()});return t=i.getContext("2d").getImageData(0,0,2,2).data,[t[0],t[1],t[2]]},e=r.createElement("canvas"),e.width=i,e.height=u,p=e.getContext("2d"),o=r.createElement("canvas"),o.width=i,o.height=u,y=o.getContext("2d"),s=r.createElement("canvas"),s.width=i,s.height=u;var it=s.getContext("2d"),rt=function(n){n.save(),n.clearRect(0,0,n.canvas.width,n.canvas.height),n.save(),n.beginPath(),n.moveTo(.28947368421052633*i,.43859649122807015*u),n.bezierCurveTo(.28947368421052633*i,.56140350877192979*u,.38596491228070173*i,.60526315789473684*u,.38596491228070173*i,.74561403508771928*u),n.bezierCurveTo(.38596491228070173*i,.74561403508771928*u,.58771929824561409*i,.74561403508771928*u,.58771929824561409*i,.74561403508771928*u),n.bezierCurveTo(.58771929824561409*i,.60526315789473684*u,.69298245614035092*i,.56140350877192979*u,.69298245614035092*i,.43859649122807015*u),n.bezierCurveTo(.69298245614035092*i,.32456140350877194*u,.60526315789473684*i,.22807017543859648*u,.5*i,.22807017543859648*u),n.bezierCurveTo(.38596491228070173*i,.22807017543859648*u,.28947368421052633*i,.32456140350877194*u,.28947368421052633*i,.43859649122807015*u),n.closePath();var t=n.createLinearGradient(.5*i,.28947368421052633*u,.5*i,.70175438596491224*u);t.addColorStop(0,"rgb(238, 238, 238)"),t.addColorStop(.99,"rgb(153, 153, 153)"),t.addColorStop(1,"rgb(153, 153, 153)"),n.fillStyle=t,n.fill(),n.lineCap="butt",n.lineJoin="round",n.lineWidth=.008771929824561403*i,n.strokeStyle="rgb(204, 204, 204)",n.stroke(),n.restore(),n.restore()},ut=function(n){n.save(),n.clearRect(0,0,n.canvas.width,n.canvas.height),n.save(),n.beginPath(),n.moveTo(.28947368421052633*i,.43859649122807015*u),n.bezierCurveTo(.28947368421052633*i,.56140350877192979*u,.38596491228070173*i,.60526315789473684*u,.38596491228070173*i,.74561403508771928*u),n.bezierCurveTo(.38596491228070173*i,.74561403508771928*u,.58771929824561409*i,.74561403508771928*u,.58771929824561409*i,.74561403508771928*u),n.bezierCurveTo(.58771929824561409*i,.60526315789473684*u,.69298245614035092*i,.56140350877192979*u,.69298245614035092*i,.43859649122807015*u),n.bezierCurveTo(.69298245614035092*i,.32456140350877194*u,.60526315789473684*i,.22807017543859648*u,.5*i,.22807017543859648*u),n.bezierCurveTo(.38596491228070173*i,.22807017543859648*u,.28947368421052633*i,.32456140350877194*u,.28947368421052633*i,.43859649122807015*u),n.closePath();var t=n.createLinearGradient(.5*i,.28947368421052633*u,.5*i,.70175438596491224*u),s=k(h),e=s[0],r=s[1],o=s[2],f=hu(e,r,o);e===r&&r==o?(t.addColorStop(0,"hsl(0, 60%, 0%)"),t.addColorStop(1,"hsl(0, 40%, 0%)")):(t.addColorStop(0,"hsl("+f[0]*255+", "+f[1]*100+"%, 70%)"),t.addColorStop(1,"hsl("+f[0]*255+", "+f[1]*100+"%, 80%)")),n.fillStyle=t,n.shadowOffsetX=0,n.shadowOffsetY=0,n.shadowBlur=30,n.shadowColor=h,n.fill(),n.lineCap="butt",n.lineJoin="round",n.lineWidth=.008771929824561403*i,n.strokeStyle="rgba("+e+", "+r+", "+o+", 0.4)",n.stroke(),n.restore(),n.restore()},g=function(n){var e,t,f,r;n.save(),n.clearRect(0,0,n.canvas.width,n.canvas.height),n.save(),n.beginPath(),n.moveTo(.35087719298245612*i,.33333333333333331*u),n.bezierCurveTo(.35087719298245612*i,.2807017543859649*u,.41228070175438597*i,.23684210526315788*u,.5*i,.23684210526315788*u),n.bezierCurveTo(.57894736842105265*i,.23684210526315788*u,.64035087719298245*i,.2807017543859649*u,.64035087719298245*i,.33333333333333331*u),n.bezierCurveTo(.64035087719298245*i,.38596491228070173*u,.57894736842105265*i,.42982456140350878*u,.5*i,.42982456140350878*u),n.bezierCurveTo(.41228070175438597*i,.42982456140350878*u,.35087719298245612*i,.38596491228070173*u,.35087719298245612*i,.33333333333333331*u),n.closePath(),e=n.createLinearGradient(.5*i,.24561403508771928*u,.5*i,.42982456140350878*u),e.addColorStop(0,"rgb(255, 255, 255)"),e.addColorStop(.99,"rgba(255, 255, 255, 0)"),e.addColorStop(1,"rgba(255, 255, 255, 0)"),n.fillStyle=e,n.fill(),n.restore(),n.save(),n.beginPath(),n.moveTo(.37719298245614036*i,.74561403508771928*u),n.bezierCurveTo(.37719298245614036*i,.74561403508771928*u,.42982456140350878*i,.72807017543859653*u,.49122807017543857*i,.72807017543859653*u),n.bezierCurveTo(.56140350877192979*i,.72807017543859653*u,.60526315789473684*i,.73684210526315785*u,.60526315789473684*i,.73684210526315785*u),n.lineTo(.60526315789473684*i,.76315789473684215*u),n.lineTo(.59649122807017541*i,.7807017543859649*u),n.lineTo(.60526315789473684*i,.79824561403508776*u),n.lineTo(.59649122807017541*i,.81578947368421051*u),n.lineTo(.60526315789473684*i,.83333333333333337*u),n.lineTo(.59649122807017541*i,.85087719298245612*u),n.lineTo(.60526315789473684*i,.868421052631579*u),n.lineTo(.59649122807017541*i,.88596491228070173*u),n.lineTo(.60526315789473684*i,.89473684210526316*u),n.bezierCurveTo(.60526315789473684*i,.89473684210526316*u,.57017543859649122*i,.956140350877193*u,.53508771929824561*i,.99122807017543857*u),n.bezierCurveTo(.52631578947368418*i,.99122807017543857*u,.51754385964912286*i,u,.5*i,u),n.bezierCurveTo(.48245614035087719*i,u,.47368421052631576*i,u,.46491228070175439*i,.99122807017543857*u),n.bezierCurveTo(.42105263157894735*i,.94736842105263153*u,.39473684210526316*i,.90350877192982459*u,.39473684210526316*i,.90350877192982459*u),n.lineTo(.39473684210526316*i,.89473684210526316*u),n.lineTo(.38596491228070173*i,.88596491228070173*u),n.lineTo(.39473684210526316*i,.868421052631579*u),n.lineTo(.38596491228070173*i,.85087719298245612*u),n.lineTo(.39473684210526316*i,.83333333333333337*u),n.lineTo(.38596491228070173*i,.81578947368421051*u),n.lineTo(.39473684210526316*i,.79824561403508776*u),n.lineTo(.37719298245614036*i,.78947368421052633*u),n.lineTo(.39473684210526316*i,.77192982456140347*u),n.lineTo(.37719298245614036*i,.76315789473684215*u),n.lineTo(.37719298245614036*i,.74561403508771928*u),n.closePath(),t=n.createLinearGradient(.47368421052631576*i,.72807017543859653*u,.48470230657746188*i,.93830797222903317*u),t.addColorStop(0,"rgb(51, 51, 51)"),t.addColorStop(.04,"rgb(217, 216, 214)"),t.addColorStop(.19,"rgb(228, 229, 224)"),t.addColorStop(.24,"rgb(151, 153, 150)"),t.addColorStop(.31,"rgb(251, 255, 255)"),t.addColorStop(.4,"rgb(129, 133, 132)"),t.addColorStop(.48,"rgb(245, 247, 244)"),t.addColorStop(.56,"rgb(149, 151, 148)"),t.addColorStop(.64,"rgb(242, 242, 240)"),t.addColorStop(.7,"rgb(130, 135, 131)"),t.addColorStop(.78,"rgb(252, 252, 252)"),t.addColorStop(1,"rgb(102, 102, 102)"),n.fillStyle=t,n.fill(),n.restore(),n.save(),n.beginPath(),n.moveTo(.37719298245614036*i,.74561403508771928*u),n.bezierCurveTo(.37719298245614036*i,.74561403508771928*u,.42982456140350878*i,.72807017543859653*u,.49122807017543857*i,.72807017543859653*u),n.bezierCurveTo(.56140350877192979*i,.72807017543859653*u,.60526315789473684*i,.73684210526315785*u,.60526315789473684*i,.73684210526315785*u),n.lineTo(.60526315789473684*i,.76315789473684215*u),n.lineTo(.59649122807017541*i,.7807017543859649*u),n.lineTo(.60526315789473684*i,.79824561403508776*u),n.lineTo(.59649122807017541*i,.81578947368421051*u),n.lineTo(.60526315789473684*i,.83333333333333337*u),n.lineTo(.59649122807017541*i,.85087719298245612*u),n.lineTo(.60526315789473684*i,.868421052631579*u),n.lineTo(.59649122807017541*i,.88596491228070173*u),n.lineTo(.60526315789473684*i,.89473684210526316*u),n.bezierCurveTo(.60526315789473684*i,.89473684210526316*u,.57017543859649122*i,.956140350877193*u,.53508771929824561*i,.99122807017543857*u),n.bezierCurveTo(.52631578947368418*i,.99122807017543857*u,.51754385964912286*i,u,.5*i,u),n.bezierCurveTo(.48245614035087719*i,u,.47368421052631576*i,u,.46491228070175439*i,.99122807017543857*u),n.bezierCurveTo(.42105263157894735*i,.94736842105263153*u,.39473684210526316*i,.90350877192982459*u,.39473684210526316*i,.90350877192982459*u),n.lineTo(.39473684210526316*i,.89473684210526316*u),n.lineTo(.38596491228070173*i,.88596491228070173*u),n.lineTo(.39473684210526316*i,.868421052631579*u),n.lineTo(.38596491228070173*i,.85087719298245612*u),n.lineTo(.39473684210526316*i,.83333333333333337*u),n.lineTo(.38596491228070173*i,.81578947368421051*u),n.lineTo(.39473684210526316*i,.79824561403508776*u),n.lineTo(.37719298245614036*i,.78947368421052633*u),n.lineTo(.39473684210526316*i,.77192982456140347*u),n.lineTo(.37719298245614036*i,.76315789473684215*u),n.lineTo(.37719298245614036*i,.74561403508771928*u),n.closePath(),f=n.createLinearGradient(.37719298245614036*i,.78947368421052633*u,.60526315789473684*i,.78947368421052633*u),f.addColorStop(0,"rgba(0, 0, 0, 0.4)"),f.addColorStop(.15,"rgba(0, 0, 0, 0.3254901961)"),f.addColorStop(.85,"rgba(0, 0, 0, 0.3294117647)"),f.addColorStop(1,"rgba(0, 0, 0, 0.4)"),n.fillStyle=f,n.fill(),n.restore(),n.save(),n.beginPath(),n.moveTo(.42105263157894735*i,.94736842105263153*u),n.bezierCurveTo(.43859649122807015*i,.956140350877193*u,.44736842105263158*i,.97368421052631582*u,.46491228070175439*i,.99122807017543857*u),n.bezierCurveTo(.47368421052631576*i,u,.48245614035087719*i,u,.5*i,u),n.bezierCurveTo(.51754385964912286*i,u,.52631578947368418*i,.99122807017543857*u,.53508771929824561*i,.99122807017543857*u),n.bezierCurveTo(.543859649122807*i,.98245614035087714*u,.56140350877192979*i,.956140350877193*u,.57894736842105265*i,.94736842105263153*u),n.bezierCurveTo(.55263157894736847*i,.93859649122807021*u,.52631578947368418*i,.93859649122807021*u,.5*i,.93859649122807021*u),n.bezierCurveTo(.47368421052631576*i,.93859649122807021*u,.44736842105263158*i,.93859649122807021*u,.42105263157894735*i,.94736842105263153*u),n.closePath(),r=n.createLinearGradient(.5*i,.93859649122807021*u,.5*i,1*u),r.addColorStop(0,"rgb(5, 10, 6)"),r.addColorStop(.61,"rgb(7, 6, 2)"),r.addColorStop(.71,"rgb(153, 146, 136)"),r.addColorStop(.83,"rgb(1, 1, 1)"),r.addColorStop(1,"rgb(0, 0, 0)"),n.fillStyle=r,n.fill(),n.restore(),n.restore()},nt=function(n){n.save(),n.setTransform(1,0,0,1,0,0),n.clearRect(0,0,n.canvas.width,n.canvas.height),n.restore()},d=function(){w=!0,rt(p),ut(y),g(it)};return this.setOn=function(n){v=n,this.repaint()},this.isOn=function(){return v},this.setAlpha=function(n){c=n,this.repaint()},this.getAlpha=function(){return c},this.setGlowColor=function(n){h=n,d(),this.repaint()},this.getGlowColor=function(){return h},this.repaint=function(){w||d(),nt(f),f.save(),f.drawImage(e,0,0),f.globalAlpha=c,v&&f.drawImage(o,0,0),f.globalAlpha=1,f.drawImage(s,0,0),f.restore()},this.repaint(),this},et=t(1,1),ft=t(1,1),ci,pi,st=t(1,1),ut=t(1,1),vi,fi,nt=t(1,1),ei,ui,hi,si,oi,ir,it=t(1,1),rr,tr=function(n,t,i,r,u,f){var h=0,e,s=Math.PI/180,c,o;for(n.save(),n.lineWidth=1,n.fillStyle=f.symbolColor.getRgbaColor(),n.strokeStyle=f.symbolColor.getRgbaColor(),n.translate(t,i),e=0;360>e;e+=15)h++,n.beginPath(),n.rotate(e*s),n.moveTo(r*.23,0),n.lineTo(r*.26,0),n.rotate(-e*s),n.arc(0,0,r*.26,e*s,(e+15)*s,!1),n.arc(0,0,r*.23,(e+15)*s,e*s,!0),n.closePath(),0==h%2&&n.fill(),n.stroke();for(n.translate(-t,-i),c=f.symbolColor.getRgbaColor(),n.strokeStyle=f.symbolColor.getRgbaColor(),e=0;360>=e;e+=90)n.beginPath(),n.moveTo(r*.560747,u*.584112),n.lineTo(r*.640186,u*.644859),n.lineTo(r*.584112,u*.560747),n.lineTo(r*.560747,u*.584112),n.closePath(),n.fillStyle=c,n.fill(),n.stroke(),n.beginPath(),n.moveTo(r*.523364,u*.397196),n.lineTo(r*.5,u*.196261),n.lineTo(r*.471962,u*.397196),n.lineTo(r*.523364,u*.397196),n.closePath(),o=n.createLinearGradient(.476635*r,0,.518691*r,0),o.addColorStop(0,"rgb(222, 223, 218)"),o.addColorStop(.48,"rgb(222, 223, 218)"),o.addColorStop(.49,f.symbolColor.getRgbaColor()),o.addColorStop(1,f.symbolColor.getRgbaColor()),n.fillStyle=o,n.fill(),n.stroke(),n.translate(t,i),n.rotate(e*Math.PI/180),n.translate(-t,-i);n.beginPath(),n.translate(t,i),n.arc(0,0,r*.1,0,Math.PI*2,!1),n.lineWidth=r*.022,n.strokeStyle=f.symbolColor.getRgbaColor(),n.stroke(),n.translate(-t,-i),n.restore()},ht=function(n,t,i,r,u,f){n.save();var e;f&&(n.shadowColor="#000000",n.shadowBlur=3,n.fillStyle="rgba(0, 0, 0, 0.4)",n.strokeStyle="rgba(0, 0, 0, 0.4)");switch(i.type){case"type2":f||(e=n.createLinearGradient(0,t*.471962,0,t*.130841),e.addColorStop(0,u.getRgbaColor()),e.addColorStop(.36,u.getRgbaColor()),e.addColorStop(.361,r.light.getRgbaColor()),e.addColorStop(1,r.light.getRgbaColor()),n.fillStyle=e),n.beginPath(),n.moveTo(t*.518691,t*.471962),n.lineTo(t*.509345,t*.462616),n.lineTo(t*.509345,t*.341121),n.lineTo(t*.504672,t*.130841),n.lineTo(t*.495327,t*.130841),n.lineTo(t*.490654,t*.341121),n.lineTo(t*.490654,t*.462616),n.lineTo(t*.481308,t*.471962),n.closePath(),n.fill();break;case"type3":n.beginPath(),n.rect(t*.495327,t*.130841,t*.009345,t*.373831),n.closePath(),f||(n.fillStyle=r.light.getRgbaColor()),n.fill();break;case"type4":f||(e=n.createLinearGradient(.467289*t,0,.528036*t,0),e.addColorStop(0,r.dark.getRgbaColor()),e.addColorStop(.51,r.dark.getRgbaColor()),e.addColorStop(.52,r.light.getRgbaColor()),e.addColorStop(1,r.light.getRgbaColor()),n.fillStyle=e),n.beginPath(),n.moveTo(t*.5,t*.126168),n.lineTo(t*.514018,t*.135514),n.lineTo(t*.53271,t*.5),n.lineTo(t*.523364,t*.602803),n.lineTo(t*.476635,t*.602803),n.lineTo(t*.467289,t*.5),n.lineTo(t*.485981,t*.135514),n.lineTo(t*.5,t*.126168),n.closePath(),n.fill();break;case"type5":f||(e=n.createLinearGradient(.471962*t,0,.528036*t,0),e.addColorStop(0,r.light.getRgbaColor()),e.addColorStop(.5,r.light.getRgbaColor()),e.addColorStop(.5,r.medium.getRgbaColor()),e.addColorStop(1,r.medium.getRgbaColor()),n.fillStyle=e),n.beginPath(),n.moveTo(t*.5,t*.495327),n.lineTo(t*.528037,t*.495327),n.lineTo(t*.5,t*.149532),n.lineTo(t*.471962,t*.495327),n.lineTo(t*.5,t*.495327),n.closePath(),n.fill(),n.lineWidth=1,n.lineCap="square",n.lineJoin="miter",f||(n.strokeStyle=r.dark.getRgbaColor()),n.stroke();break;case"type6":f||(n.fillStyle=r.medium.getRgbaColor()),n.beginPath(),n.moveTo(t*.481308,t*.485981),n.lineTo(t*.481308,t*.392523),n.lineTo(t*.485981,t*.317757),n.lineTo(t*.495327,t*.130841),n.lineTo(t*.504672,t*.130841),n.lineTo(t*.514018,t*.317757),n.lineTo(t*.518691,t*.38785),n.lineTo(t*.518691,t*.485981),n.lineTo(t*.504672,t*.485981),n.lineTo(t*.504672,t*.38785),n.lineTo(t*.5,t*.317757),n.lineTo(t*.495327,t*.392523),n.lineTo(t*.495327,t*.485981),n.lineTo(t*.481308,t*.485981),n.closePath(),n.fill();break;case"type7":f||(e=n.createLinearGradient(.481308*t,0,.518691*t,0),e.addColorStop(0,r.dark.getRgbaColor()),e.addColorStop(1,r.medium.getRgbaColor()),n.fillStyle=e),n.beginPath(),n.moveTo(t*.490654,t*.130841),n.lineTo(t*.481308,t*.5),n.lineTo(t*.518691,t*.5),n.lineTo(t*.504672,t*.130841),n.lineTo(t*.490654,t*.130841),n.closePath(),n.fill();break;case"type8":f||(e=n.createLinearGradient(.471962*t,0,.528036*t,0),e.addColorStop(0,r.light.getRgbaColor()),e.addColorStop(.5,r.light.getRgbaColor()),e.addColorStop(.5,r.medium.getRgbaColor()),e.addColorStop(1,r.medium.getRgbaColor()),n.fillStyle=e,n.strokeStyle=r.dark.getRgbaColor()),n.beginPath(),n.moveTo(t*.5,t*.53271),n.lineTo(t*.53271,t*.5),n.bezierCurveTo(t*.53271,t*.5,t*.509345,t*.457943,t*.5,t*.149532),n.bezierCurveTo(t*.490654,t*.457943,t*.467289,t*.5,t*.467289,t*.5),n.lineTo(t*.5,t*.53271),n.closePath(),n.fill(),n.stroke();break;case"type9":f||(e=n.createLinearGradient(.471962*t,0,.528036*t,0),e.addColorStop(0,"rgb(50, 50, 50)"),e.addColorStop(.5,"rgb(102, 102, 102)"),e.addColorStop(1,"rgb(50, 50, 50)"),n.fillStyle=e,n.strokeStyle="#2E2E2E"),n.beginPath(),n.moveTo(t*.495327,t*.233644),n.lineTo(t*.504672,t*.233644),n.lineTo(t*.514018,t*.439252),n.lineTo(t*.485981,t*.439252),n.lineTo(t*.495327,t*.233644),n.closePath(),n.moveTo(t*.490654,t*.130841),n.lineTo(t*.471962,t*.471962),n.lineTo(t*.471962,t*.528037),n.bezierCurveTo(t*.471962,t*.528037,t*.476635,t*.602803,t*.476635,t*.602803),n.bezierCurveTo(t*.476635,t*.607476,t*.481308,t*.607476,t*.5,t*.607476),n.bezierCurveTo(t*.518691,t*.607476,t*.523364,t*.607476,t*.523364,t*.602803),n.bezierCurveTo(t*.523364,t*.602803,t*.528037,t*.528037,t*.528037,t*.528037),n.lineTo(t*.528037,t*.471962),n.lineTo(t*.509345,t*.130841),n.lineTo(t*.490654,t*.130841),n.closePath(),n.fill(),n.beginPath(),n.moveTo(t*.495327,t*.219626),n.lineTo(t*.504672,t*.219626),n.lineTo(t*.504672,t*.135514),n.lineTo(t*.495327,t*.135514),n.lineTo(t*.495327,t*.219626),n.closePath(),f||(n.fillStyle=r.medium.getRgbaColor()),n.fill();break;case"type10":n.beginPath(),n.moveTo(t*.5,t*.149532),n.bezierCurveTo(t*.5,t*.149532,t*.443925,t*.490654,t*.443925,t*.5),n.bezierCurveTo(t*.443925,t*.53271,t*.467289,t*.556074,t*.5,t*.556074),n.bezierCurveTo(t*.53271,t*.556074,t*.556074,t*.53271,t*.556074,t*.5),n.bezierCurveTo(t*.556074,t*.490654,t*.5,t*.149532,t*.5,t*.149532),n.closePath(),f||(e=n.createLinearGradient(.471962*t,0,.528036*t,0),e.addColorStop(0,r.light.getRgbaColor()),e.addColorStop(.5,r.light.getRgbaColor()),e.addColorStop(.5,r.medium.getRgbaColor()),e.addColorStop(1,r.medium.getRgbaColor()),n.fillStyle=e,n.strokeStyle=r.medium.getRgbaColor()),n.lineWidth=1,n.lineCap="square",n.lineJoin="miter",n.fill(),n.stroke();break;case"type11":n.beginPath(),n.moveTo(.5*t,.168224*t),n.lineTo(.485981*t,.5*t),n.bezierCurveTo(.485981*t,.5*t,.481308*t,.584112*t,.5*t,.584112*t),n.bezierCurveTo(.514018*t,.584112*t,.509345*t,.5*t,.509345*t,.5*t),n.lineTo(.5*t,.168224*t),n.closePath(),f||(e=n.createLinearGradient(0,.168224*t,0,.584112*t),e.addColorStop(0,r.medium.getRgbaColor()),e.addColorStop(1,r.dark.getRgbaColor()),n.fillStyle=e,n.strokeStyle=r.dark.getRgbaColor()),n.fill(),n.stroke();break;case"type12":n.beginPath(),n.moveTo(.5*t,.168224*t),n.lineTo(.485981*t,.5*t),n.lineTo(.5*t,.504672*t),n.lineTo(.509345*t,.5*t),n.lineTo(.5*t,.168224*t),n.closePath(),f||(e=n.createLinearGradient(0,.168224*t,0,.504672*t),e.addColorStop(0,r.medium.getRgbaColor()),e.addColorStop(1,r.dark.getRgbaColor()),n.fillStyle=e,n.strokeStyle=r.dark.getRgbaColor()),n.fill(),n.stroke();break;case"type13":case"type14":n.beginPath(),n.moveTo(.485981*t,.168224*t),n.lineTo(.5*t,.130841*t),n.lineTo(.509345*t,.168224*t),n.lineTo(.509345*t,.509345*t),n.lineTo(.485981*t,.509345*t),n.lineTo(.485981*t,.168224*t),n.closePath(),f||(i.type==="type13"?(e=n.createLinearGradient(0,.5*t,0,.130841*t),e.addColorStop(0,u.getRgbaColor()),e.addColorStop(.85,u.getRgbaColor()),e.addColorStop(.85,r.medium.getRgbaColor()),e.addColorStop(1,r.medium.getRgbaColor()),n.fillStyle=e):(e=n.createLinearGradient(.485981*t,0,.509345*t,0),e.addColorStop(0,r.veryDark.getRgbaColor()),e.addColorStop(.5,r.light.getRgbaColor()),e.addColorStop(1,r.veryDark.getRgbaColor()),n.fillStyle=e)),n.fill();break;case"type1":default:f||(e=n.createLinearGradient(0,t*.471962,0,t*.130841),e.addColorStop(0,r.veryDark.getRgbaColor()),e.addColorStop(.3,r.medium.getRgbaColor()),e.addColorStop(.59,r.medium.getRgbaColor()),e.addColorStop(1,r.veryDark.getRgbaColor()),n.fillStyle=e),n.beginPath(),n.moveTo(t*.518691,t*.471962),n.bezierCurveTo(t*.514018,t*.457943,t*.509345,t*.415887,t*.509345,t*.401869),n.bezierCurveTo(t*.504672,t*.383177,t*.5,t*.130841,t*.5,t*.130841),n.bezierCurveTo(t*.5,t*.130841,t*.490654,t*.383177,t*.490654,t*.397196),n.bezierCurveTo(t*.490654,t*.415887,t*.485981,t*.457943,t*.481308,t*.471962),n.bezierCurveTo(t*.471962,t*.481308,t*.467289,t*.490654,t*.467289,t*.5),n.bezierCurveTo(t*.467289,t*.518691,t*.481308,t*.53271,t*.5,t*.53271),n.bezierCurveTo(t*.518691,t*.53271,t*.53271,t*.518691,t*.53271,t*.5),n.bezierCurveTo(t*.53271,t*.490654,t*.528037,t*.481308,t*.518691,t*.471962),n.closePath(),n.fill()}n.restore()},y=function(t,i,r,u,f,e){var s,o,l,a,h,c;t.save();if(f===et.width&&e===et.height&&i===pi)return t.drawImage(et,0,0),t.restore(),this;pi=i,et.width=f,et.height=e,s=et.getContext("2d"),s.fillStyle="#848484",s.strokeStyle="rgba(132, 132, 132, 0.5)",s.beginPath(),s.arc(r,u,f/2,0,Math.PI*2,!0),s.closePath(),s.fill(),s.stroke(),s.beginPath(),s.arc(r,u,f*.990654/2,0,Math.PI*2,!0),s.closePath();switch(i.design){case"metal":o=s.createLinearGradient(0,f*.004672,0,e*.990654),o.addColorStop(0,"#fefefe"),o.addColorStop(.07,"rgb(210, 210, 210)"),o.addColorStop(.12,"rgb(179, 179, 179)"),o.addColorStop(1,"rgb(213, 213, 213)"),s.fillStyle=o,s.fill();break;case"brass":o=s.createLinearGradient(0,f*.004672,0,e*.990654),o.addColorStop(0,"rgb(249, 243, 155)"),o.addColorStop(.05,"rgb(246, 226, 101)"),o.addColorStop(.1,"rgb(240, 225, 132)"),o.addColorStop(.5,"rgb(90, 57, 22)"),o.addColorStop(.9,"rgb(249, 237, 139)"),o.addColorStop(.95,"rgb(243, 226, 108)"),o.addColorStop(1,"rgb(202, 182, 113)"),s.fillStyle=o,s.fill();break;case"steel":o=s.createLinearGradient(0,f*.004672,0,e*.990654),o.addColorStop(0,"rgb(231, 237, 237)"),o.addColorStop(.05,"rgb(189, 199, 198)"),o.addColorStop(.1,"rgb(192, 201, 200)"),o.addColorStop(.5,"rgb(23, 31, 33)"),o.addColorStop(.9,"rgb(196, 205, 204)"),o.addColorStop(.95,"rgb(194, 204, 203)"),o.addColorStop(1,"rgb(189, 201, 199)"),s.fillStyle=o,s.fill();break;case"gold":o=s.createLinearGradient(0,f*.004672,0,e*.990654),o.addColorStop(0,"rgb(255, 255, 207)"),o.addColorStop(.15,"rgb(255, 237, 96)"),o.addColorStop(.22,"rgb(254, 199, 57)"),o.addColorStop(.3,"rgb(255, 249, 203)"),o.addColorStop(.38,"rgb(255, 199, 64)"),o.addColorStop(.44,"rgb(252, 194, 60)"),o.addColorStop(.51,"rgb(255, 204, 59)"),o.addColorStop(.6,"rgb(213, 134, 29)"),o.addColorStop(.68,"rgb(255, 201, 56)"),o.addColorStop(.75,"rgb(212, 135, 29)"),o.addColorStop(1,"rgb(247, 238, 101)"),s.fillStyle=o,s.fill();break;case"anthracite":o=s.createLinearGradient(0,.004672*e,0,.995326*e),o.addColorStop(0,"rgb(118, 117, 135)"),o.addColorStop(.06,"rgb(74, 74, 82)"),o.addColorStop(.12,"rgb(50, 50, 54)"),o.addColorStop(1,"rgb(79, 79, 87)"),s.fillStyle=o,s.fill();break;case"tiltedGray":o=s.createLinearGradient(.233644*f,.084112*e,.81258*f,.910919*e),o.addColorStop(0,"#ffffff"),o.addColorStop(.07,"rgb(210, 210, 210)"),o.addColorStop(.16,"rgb(179, 179, 179)"),o.addColorStop(.33,"#ffffff"),o.addColorStop(.55,"#c5c5c5"),o.addColorStop(.79,"#ffffff"),o.addColorStop(1,"rgb(102, 102, 102)"),s.fillStyle=o,s.fill();break;case"tiltedBlack":o=s.createLinearGradient(.228971*f,.079439*e,.802547*f,.898591*e),o.addColorStop(0,"rgb(102, 102, 102)"),o.addColorStop(.21,"#000000"),o.addColorStop(.47,"rgb(102, 102, 102)"),o.addColorStop(.99,"#000000"),o.addColorStop(1,"#000000"),s.fillStyle=o,s.fill();break;case"glossyMetal":o=s.createRadialGradient(.5*f,.5*e,0,.5*f,.5*f,.5*f),o.addColorStop(0,"rgb(207, 207, 207)"),o.addColorStop(.96,"rgb(205, 204, 205)"),o.addColorStop(1,"rgb(244, 244, 244)"),s.fillStyle=o,s.fill(),s.beginPath(),s.arc(.5*f,.5*e,.973962*f/2,0,Math.PI*2),s.closePath(),o=s.createLinearGradient(0,e-.971962*e,0,.971962*e),o.addColorStop(0,"rgb(249, 249, 249)"),o.addColorStop(.23,"rgb(200, 195, 191)"),o.addColorStop(.36,"#ffffff"),o.addColorStop(.59,"rgb(29, 29, 29)"),o.addColorStop(.76,"rgb(200, 194, 192)"),o.addColorStop(1,"rgb(209, 209, 209)"),s.fillStyle=o,s.fill(),s.beginPath(),s.arc(.5*f,.5*e,.869158*f/2,0,Math.PI*2),s.closePath(),s.fillStyle="#f6f6f6",s.fill(),s.beginPath(),s.arc(.5*f,.5*e,.85*f/2,0,Math.PI*2),s.closePath(),s.fillStyle="#333333",s.fill();break;case"blackMetal":h=[0,.125,.347222,.5,.680555,.875,1],c=[new n(254,254,254,1),new n(0,0,0,1),new n(153,153,153,1),new n(0,0,0,1),new n(153,153,153,1),new n(0,0,0,1),new n(254,254,254,1)],s.save(),s.clip(s.arc(r,u,f*.990654/2,0,Math.PI*2,!0)),l=f*.495327,a=f*.42056,o=new rt(h,c,-Math.PI/2),o.fill(s,r,u,a,l),s.restore();break;case"shinyMetal":h=[0,.125,.25,.347222,.5,.652777,.75,.875,1],c=[new n(254,254,254,1),new n(210,210,210,1),new n(179,179,179,1),new n(238,238,238,1),new n(160,160,160,1),new n(238,238,238,1),new n(179,179,179,1),new n(210,210,210,1),new n(254,254,254,1)],s.save(),s.clip(s.arc(r,u,f*.990654/2,0,Math.PI*2,!0)),l=f*.495327,a=f*.42056,o=new rt(h,c,-Math.PI/2),o.fill(s,r,u,a,l),s.restore();break;case"chrome":h=[0,.09,.12,.16,.25,.29,.33,.38,.48,.52,.63,.68,.8,.83,.87,.97,1],c=[new n(255,255,255,1),new n(255,255,255,1),new n(136,136,138,1),new n(164,185,190,1),new n(158,179,182,1),new n(112,112,112,1),new n(221,227,227,1),new n(155,176,179,1),new n(156,176,177,1),new n(254,255,255,1),new n(255,255,255,1),new n(156,180,180,1),new n(198,209,211,1),new n(246,248,247,1),new n(204,216,216,1),new n(164,188,190,1),new n(255,255,255,1)],s.save(),s.clip(s.arc(r,u,f*.990654/2,0,Math.PI*2,!0)),l=f*.495327,a=f*.42056,o=new rt(h,c,-Math.PI/2),o.fill(s,r,u,a,l),s.restore()}return s.fillStyle="rgb(191, 191, 191)",s.beginPath(),s.arc(r,u,f*.841121/2,0,Math.PI*2,!0),s.closePath(),s.fill(),t.drawImage(et,0,0),t.restore(),this},ur=function(t,i,r,u,f){var s,c,l,h,o;t.save();if(r===st.width&&u===st.height&&i===fi)return t.drawImage(st,0,0),t.restore(),this;fi=i,st.width=r,st.height=u,s=st.getContext("2d"),r<u?(c=r*.05,l=c-1,h=r*.028571):(c=u*.05,l=c-1,h=u*.028571),e(s,0,0,r,u,c),s.fillStyle="#838383",s.fill(),e(s,1,1,r-2,u-2,l),o=s.createLinearGradient(0,1,0,u-1);switch(i.design){case"metal":o=s.createLinearGradient(0,r*.004672,0,u*.990654),o.addColorStop(0,"#fefefe"),o.addColorStop(.07,"rgb(210, 210, 210)"),o.addColorStop(.12,"rgb(179, 179, 179)"),o.addColorStop(1,"rgb(213, 213, 213)"),s.fillStyle=o,s.fill();break;case"brass":o=s.createLinearGradient(0,r*.004672,0,u*.990654),o.addColorStop(0,"rgb(249, 243, 155)"),o.addColorStop(.05,"rgb(246, 226, 101)"),o.addColorStop(.1,"rgb(240, 225, 132)"),o.addColorStop(.5,"rgb(90, 57, 22)"),o.addColorStop(.9,"rgb(249, 237, 139)"),o.addColorStop(.95,"rgb(243, 226, 108)"),o.addColorStop(1,"rgb(202, 182, 113)"),s.fillStyle=o,s.fill();break;case"steel":o=s.createLinearGradient(0,r*.004672,0,u*.990654),o.addColorStop(0,"rgb(231, 237, 237)"),o.addColorStop(.05,"rgb(189, 199, 198)"),o.addColorStop(.1,"rgb(192, 201, 200)"),o.addColorStop(.5,"rgb(23, 31, 33)"),o.addColorStop(.9,"rgb(196, 205, 204)"),o.addColorStop(.95,"rgb(194, 204, 203)"),o.addColorStop(1,"rgb(189, 201, 199)"),s.fillStyle=o,s.fill();break;case"gold":o=s.createLinearGradient(0,r*.004672,0,u*.990654),o.addColorStop(0,"rgb(255, 255, 207)"),o.addColorStop(.15,"rgb(255, 237, 96)"),o.addColorStop(.22,"rgb(254, 199, 57)"),o.addColorStop(.3,"rgb(255, 249, 203)"),o.addColorStop(.38,"rgb(255, 199, 64)"),o.addColorStop(.44,"rgb(252, 194, 60)"),o.addColorStop(.51,"rgb(255, 204, 59)"),o.addColorStop(.6,"rgb(213, 134, 29)"),o.addColorStop(.68,"rgb(255, 201, 56)"),o.addColorStop(.75,"rgb(212, 135, 29)"),o.addColorStop(1,"rgb(247, 238, 101)"),s.fillStyle=o,s.fill();break;case"anthracite":o=s.createLinearGradient(0,.004672*u,0,.995326*u),o.addColorStop(0,"rgb(118, 117, 135)"),o.addColorStop(.06,"rgb(74, 74, 82)"),o.addColorStop(.12,"rgb(50, 50, 54)"),o.addColorStop(1,"rgb(79, 79, 87)"),s.fillStyle=o,s.fill();break;case"tiltedGray":o=s.createLinearGradient(.233644*r,.084112*u,.81258*r,.910919*u),o.addColorStop(0,"#ffffff"),o.addColorStop(.07,"rgb(210, 210, 210)"),o.addColorStop(.16,"rgb(179, 179, 179)"),o.addColorStop(.33,"#ffffff"),o.addColorStop(.55,"#c5c5c5"),o.addColorStop(.79,"#ffffff"),o.addColorStop(1,"rgb(102, 102, 102)"),s.fillStyle=o,s.fill();break;case"tiltedBlack":o=s.createLinearGradient(.228971*r,.079439*u,.802547*r,.898591*u),o.addColorStop(0,"rgb(102, 102, 102)"),o.addColorStop(.21,"#000000"),o.addColorStop(.47,"rgb(102, 102, 102)"),o.addColorStop(.99,"#000000"),o.addColorStop(1,"#000000"),s.fillStyle=o,s.fill();break;case"glossyMetal":s.clip(e(s,1,1,r-2,u-2,c)),s.fillStyle="#cfcfcf",s.fill(),s.clip(e(s,2,2,r-4,u-4,l)),o=s.createLinearGradient(0,2,0,u-4),o.addColorStop(0,"rgb(249, 249, 249)"),o.addColorStop(.2,"rgb(200, 195, 191)"),o.addColorStop(.3,"#ffffff"),o.addColorStop(.6,"rgb(29, 29, 29)"),o.addColorStop(.8,"rgb(200, 194, 192)"),o.addColorStop(1,"rgb(209, 209, 209)"),s.fillStyle=o,s.fill(),s.clip(e(s,12,12,r-24,u-24,h)),s.fillStyle="#f6f6f6",s.fill(),s.clip(e(s,13,13,r-26,u-26,h)),s.fillStyle="#333333",s.fill();break;case"blackMetal":fractions=[0,.125,.347222,.5,.680555,.875,1],colors=[new n(254,254,254,1),new n(0,0,0,1),new n(153,153,153,1),new n(0,0,0,1),new n(153,153,153,1),new n(0,0,0,1),new n(254,254,254,1)],innerX=0,outerX=f?u:r,s.clip(e(s,1,1,r-2,u-2,h)),o=new rt(fractions,colors,-Math.PI/2),o.fill(s,r/2,u/2,innerX,outerX);break;case"shinyMetal":fractions=[0,.125,.25,.347222,.5,.652777,.75,.875,1],colors=[new n(254,254,254,1),new n(210,210,210,1),new n(179,179,179,1),new n(238,238,238,1),new n(160,160,160,1),new n(238,238,238,1),new n(179,179,179,1),new n(210,210,210,1),new n(254,254,254,1)],innerX=0,outerX=f?u:r,s.clip(e(s,1,1,r-2,u-2,h)),o=new rt(fractions,colors,-Math.PI/2),o.fill(s,r/2,u/2,innerX,outerX);break;case"chrome":fractions=[0,.09,.12,.16,.25,.29,.33,.38,.48,.52,.63,.68,.8,.83,.87,.97,1],colors=[new n(255,255,255,1),new n(255,255,255,1),new n(136,136,138,1),new n(164,185,190,1),new n(158,179,182,1),new n(112,112,112,1),new n(221,227,227,1),new n(155,176,179,1),new n(156,176,177,1),new n(254,255,255,1),new n(255,255,255,1),new n(156,180,180,1),new n(198,209,211,1),new n(246,248,247,1),new n(204,216,216,1),new n(164,188,190,1),new n(255,255,255,1)],innerX=0,outerX=f?u:r,s.clip(e(s,1,1,r-2,u-2,h)),o=new rt(fractions,colors,-Math.PI/2),o.fill(s,r/2,u/2,innerX,outerX)}return e(s,13,13,r-26,u-26,h-1),s.fillStyle="rgb(192, 192, 192)",t.drawImage(st,0,0),t.restore(),this},b=function(n,t,i,r,u,f){var e,c,s,h,o;return n.save(),u===ft.width&&f===ft.height&&t===ci?(n.drawImage(ft,0,0),n.restore(),this):(ci=t,ft.width=u,ft.height=f,e=ft.getContext("2d"),e.beginPath(),e.arc(i,r,u*.831775/2,0,Math.PI*2,!0),e.closePath(),t===steelseries.BackgroundColor.CARBON||t===steelseries.BackgroundColor.PUNCHED_SHEET?(t===steelseries.BackgroundColor.CARBON&&(e.fillStyle=e.createPattern(wi,"repeat"),e.fill()),t===steelseries.BackgroundColor.PUNCHED_SHEET&&(e.fillStyle=e.createPattern(bi,"repeat"),e.fill()),c=u*.831775/2,s=e.createLinearGradient(c,0,u-c,0),s.addColorStop(0,"rgba(0, 0, 0, 0.25)"),s.addColorStop(.5,"rgba(0, 0, 0, 0)"),s.addColorStop(1,"rgba(0, 0, 0, 0.25)"),e.fillStyle=s,e.beginPath(),e.arc(i,r,u*.831775/2,0,Math.PI*2,!0),e.closePath(),e.fill()):(h=e.createLinearGradient(0,u*.084112,0,f*.831775),h.addColorStop(0,t.gradientStart.getRgbaColor()),h.addColorStop(.4,t.gradientFraction.getRgbaColor()),h.addColorStop(1,t.gradientStop.getRgbaColor()),e.fillStyle=h,e.fill()),o=e.createRadialGradient(i,r,0,i,r,u*.831775/2),o.addColorStop(0,"rgba(0, 0, 0, 0)"),o.addColorStop(.7,"rgba(0, 0, 0, 0)"),o.addColorStop(.71,"rgba(0, 0, 0, 0)"),o.addColorStop(.86,"rgba(0, 0, 0, 0.03)"),o.addColorStop(.92,"rgba(0, 0, 0, 0.07)"),o.addColorStop(.97,"rgba(0, 0, 0, 0.15)"),o.addColorStop(1,"rgba(0, 0, 0, 0.3)"),e.fillStyle=o,e.beginPath(),e.arc(i,r,u*.831775/2,0,Math.PI*2,!0),e.closePath(),e.fill(),n.drawImage(ft,0,0),n.restore(),this)},ot=function(n,t,i,r,u,f){if(t!==null&&t.height>0&&t.width>0){n.save(),n.beginPath(),n.arc(i,r,u*.831775/2,0,Math.PI*2,!0),n.clip();var o=u*.831775,e=f*.831775,h=(u-o)/2,s=(f-e)/2;n.drawImage(t,h,s,o,e),n.restore()}return this},gi=function(n,t,i,r){var u,o,s,h,f;n.save();if(i===ut.width&&r===ut.height&&t===vi)return n.drawImage(ut,0,0),n.restore(),this;for(vi=t,ut.width=i,ut.height=r,u=ut.getContext("2d"),e(u,14,14,i-28,r-28,4),t===steelseries.BackgroundColor.CARBON||t===steelseries.BackgroundColor.PUNCHED_SHEET?(t===steelseries.BackgroundColor.CARBON&&(u.fillStyle=u.createPattern(wi,"repeat"),u.fill()),t===steelseries.BackgroundColor.PUNCHED_SHEET&&(u.fillStyle=u.createPattern(bi,"repeat"),u.fill()),o=u.createLinearGradient(14,14,i-28,r-28),o.addColorStop(0,"rgba(0, 0, 0, 0.25)"),o.addColorStop(.5,"rgba(0, 0, 0, 0)"),o.addColorStop(1,"rgba(0, 0, 0, 0.25)"),u.fillStyle=o,e(u,14,14,i-28,r-28,4),u.fill()):(s=u.createLinearGradient(0,14,0,r-28),s.addColorStop(0,t.gradientStart.getRgbaColor()),s.addColorStop(.4,t.gradientFraction.getRgbaColor()),s.addColorStop(1,t.gradientStop.getRgbaColor()),u.fillStyle=s,u.fill()),h=["rgba(0, 0, 0, 0.3)","rgba(0, 0, 0, 0.15)","rgba(0, 0, 0, 0.07)","rgba(0, 0, 0, 0.03)","rgba(0, 0, 0, 0)","rgba(0, 0, 0, 0)","rgba(0, 0, 0, 0)"],f=0;f<7;f++)e(u,14+f,14+f,i-28-2*f,r-28-2*f,4),u.strokeStyle=h[f],u.stroke();return n.drawImage(ut,0,0),n.restore(),this},p=function(n,t,i,r,u,f,e,o,h){var c,a,l,v;n.save();if(t.type===ui&&i===nt.width&&r===nt.height&&u===hi&&f===si&&e===ei&&oi===o&&ir===h)return n.drawImage(nt,0,0),n.restore(),this;hi=u,si=f,ei=e,nt.width=i,nt.height=r,oi=o,ir=h,ui=t.type,c=nt.getContext("2d"),a=i*.008,u&&(o===steelseries.GaugeType.TYPE5?steelseries.Orientation.WEST===h?(c.drawImage(s(Math.ceil(r*.084112),f,e,!0),i*.693333+a,r*.457943+a),c.drawImage(s(Math.ceil(r*.084112),f,e,!1),i*.693333,r*.457943)):(c.drawImage(s(Math.ceil(r*.084112),f,e,!0),i*.457943+a,r*.691588+a),c.drawImage(s(Math.ceil(r*.084112),f,e,!1),i*.457943,r*.691588)):(c.drawImage(s(Math.ceil(r*.084112),f,e,!0),i*.457943+a,r*.457943+a),c.drawImage(s(Math.ceil(r*.084112),f,e,!1),i*.457943,r*.457943)));switch(ui){case"type2":c.beginPath(),c.moveTo(i*.135514,r*.696261),c.bezierCurveTo(i*.214953,r*.588785,i*.317757,r*.5,i*.462616,r*.425233),c.bezierCurveTo(i*.612149,r*.345794,i*.733644,r*.317757,i*.873831,r*.322429),c.bezierCurveTo(i*.766355,r*.112149,i*.528037,r*.023364,i*.313084,r*.130841),c.bezierCurveTo(i*.09813,r*.238317,i*.028037,r*.485981,i*.135514,r*.696261),c.closePath(),l=c.createLinearGradient(.313084*i,.135514*r,.495528*i,.493582*r),l.addColorStop(0,"rgba(255, 255, 255, 0.275)"),l.addColorStop(1,"rgba(255, 255, 255, 0.015)");break;case"type3":c.beginPath(),c.moveTo(i*.084112,r*.509345),c.bezierCurveTo(i*.21028,r*.556074,i*.462616,r*.560747,i*.5,r*.560747),c.bezierCurveTo(i*.537383,r*.560747,i*.794392,r*.560747,i*.915887,r*.509345),c.bezierCurveTo(i*.915887,r*.2757,i*.738317,r*.084112,i*.5,r*.084112),c.bezierCurveTo(i*.261682,r*.084112,i*.084112,r*.2757,i*.084112,r*.509345),c.closePath(),l=c.createLinearGradient(0,.093457*r,0,.556073*r),l.addColorStop(0,"rgba(255, 255, 255, 0.275)"),l.addColorStop(1,"rgba(255, 255, 255, 0.015)");break;case"type4":c.beginPath(),c.moveTo(i*.67757,r*.24299),c.bezierCurveTo(i*.771028,r*.308411,i*.822429,r*.411214,i*.813084,r*.528037),c.bezierCurveTo(i*.799065,r*.654205,i*.719626,r*.757009,i*.593457,r*.799065),c.bezierCurveTo(i*.485981,r*.831775,i*.369158,r*.808411,i*.285046,r*.728971),c.bezierCurveTo(i*.2757,r*.719626,i*.252336,r*.714953,i*.233644,r*.728971),c.bezierCurveTo(i*.214953,r*.747663,i*.219626,r*.771028,i*.228971,r*.7757),c.bezierCurveTo(i*.331775,r*.878504,i*.476635,r*.915887,i*.616822,r*.869158),c.bezierCurveTo(i*.771028,r*.822429,i*.873831,r*.691588,i*.88785,r*.53271),c.bezierCurveTo(i*.897196,r*.38785,i*.836448,r*.257009,i*.719626,r*.182242),c.bezierCurveTo(i*.705607,r*.172897,i*.682242,r*.163551,i*.663551,r*.186915),c.bezierCurveTo(i*.654205,r*.205607,i*.668224,r*.238317,i*.67757,r*.24299),c.closePath(),l=c.createRadialGradient(.5*i,.5*r,0,.5*i,.5*r,.38785*i),l.addColorStop(0,"rgba(255, 255, 255, 0)"),l.addColorStop(.82,"rgba(255, 255, 255, 0)"),l.addColorStop(.83,"rgba(255, 255, 255, 0)"),l.addColorStop(1,"rgba(255, 255, 255, 0.15)"),c.beginPath(),c.moveTo(i*.261682,r*.224299),c.bezierCurveTo(i*.285046,r*.238317,i*.252336,r*.285046,i*.24299,r*.317757),c.bezierCurveTo(i*.24299,r*.350467,i*.271028,r*.383177,i*.271028,r*.397196),c.bezierCurveTo(i*.2757,r*.415887,i*.261682,r*.457943,i*.238317,r*.509345),c.bezierCurveTo(i*.224299,r*.542056,i*.17757,r*.612149,i*.158878,r*.612149),c.bezierCurveTo(i*.144859,r*.612149,i*.088785,r*.546728,i*.130841,r*.369158),c.bezierCurveTo(i*.140186,r*.336448,i*.214953,r*.200934,i*.261682,r*.224299),c.closePath(),v=c.createLinearGradient(.130841*i,.369158*r,.273839*i,.412877*r),v.addColorStop(0,"rgba(255, 255, 255, 0.275)"),v.addColorStop(1,"rgba(255, 255, 255, 0.015)"),c.fillStyle=v,c.fill();break;case"type5":c.beginPath(),c.moveTo(i*.084112,r*.5),c.bezierCurveTo(i*.084112,r*.271028,i*.271028,r*.084112,i*.5,r*.084112),c.bezierCurveTo(i*.700934,r*.084112,i*.864485,r*.224299,i*.906542,r*.411214),c.bezierCurveTo(i*.911214,r*.439252,i*.911214,r*.518691,i*.845794,r*.537383),c.bezierCurveTo(i*.794392,r*.546728,i*.551401,r*.411214,i*.392523,r*.457943),c.bezierCurveTo(i*.168224,r*.509345,i*.135514,r*.7757,i*.093457,r*.593457),c.bezierCurveTo(i*.088785,r*.560747,i*.084112,r*.53271,i*.084112,r*.5),c.closePath(),l=c.createLinearGradient(0,.084112*r,0,.644859*r),l.addColorStop(0,"rgba(255, 255, 255, 0.275)"),l.addColorStop(1,"rgba(255, 255, 255, 0.015)");break;case"type1":default:c.beginPath(),c.moveTo(i*.084112,r*.509345),c.bezierCurveTo(i*.205607,r*.448598,i*.336448,r*.415887,i*.5,r*.415887),c.bezierCurveTo(i*.672897,r*.415887,i*.789719,r*.443925,i*.915887,r*.509345),c.bezierCurveTo(i*.915887,r*.2757,i*.738317,r*.084112,i*.5,r*.084112),c.bezierCurveTo(i*.261682,r*.084112,i*.084112,r*.2757,i*.084112,r*.509345),c.closePath(),l=c.createLinearGradient(0,.088785*r,0,.490654*r),l.addColorStop(0,"rgba(255, 255, 255, 0.275)"),l.addColorStop(1,"rgba(255, 255, 255, 0.015)")}return c.fillStyle=l,c.fill(),n.drawImage(nt,0,0),n.restore(),this},nr=function(n,t,i,r){n.save();if(t===it.width&&i===it.height&&rr===r)return n.drawImage(it,0,0),n.restore(),this;rr=r,it.width=t,it.height=i;var f=it.getContext("2d"),u;return f.save(),f.beginPath(),f.moveTo(18,i-18),f.lineTo(t-18,i-18),f.bezierCurveTo(t-18,i-18,t-27,i*.7,t-27,i*.5),f.bezierCurveTo(t-27,27,t-18,18,t-18,18),f.lineTo(18,18),f.bezierCurveTo(18,18,27,i*.285714,27,i*.5),f.bezierCurveTo(27,i*.7,18,i-18,18,i-18),f.closePath(),u=f.createLinearGradient(0,i-14,0,14),u.addColorStop(0,"rgba(255, 255, 255, 0)"),u.addColorStop(.06,"rgba(255, 255, 255, 0)"),u.addColorStop(.07,"rgba(255, 255, 255, 0)"),u.addColorStop(.12,"rgba(255, 255, 255, 0)"),u.addColorStop(.17,"rgba(255, 255, 255, 0.013546)"),u.addColorStop(.1701,"rgba(255, 255, 255, 0)"),u.addColorStop(.79,"rgba(255, 255, 255, 0)"),u.addColorStop(.8,"rgba(255, 255, 255, 0)"),u.addColorStop(.84,"rgba(255, 255, 255, 0.082217)"),u.addColorStop(.93,"rgba(255, 255, 255, 0.288702)"),u.addColorStop(.94,"rgba(255, 255, 255, 0.298039)"),u.addColorStop(.96,"rgba(255, 255, 255, 0.119213)"),u.addColorStop(.97,"rgba(255, 255, 255, 0)"),u.addColorStop(1,"rgba(255, 255, 255, 0)"),f.fillStyle=u,f.fill(),n.drawImage(it,0,0),n.restore(),this},s=function(n,t,i,u){var v=r.createElement("canvas"),f,h,c,l,o,p,w,y,b,a,e,s;v.width=n,v.height=n,f=v.getContext("2d"),f.save(),h=n/2,c=n/2,u&&(f.shadowColor="#000000",f.shadowBlur=3,f.fillStyle="rgba(0, 0, 0, 0.4)",f.strokeStyle="rgba(0, 0, 0, 0.4)");switch(t.type){case"metalKnob":f.save(),f.beginPath(),f.moveTo(0,n*.5),f.bezierCurveTo(0,n*.222222,n*.222222,0,n*.5,0),f.bezierCurveTo(n*.777777,0,n,n*.222222,n,n*.5),f.bezierCurveTo(n,n*.777777,n*.777777,n,n*.5,n),f.bezierCurveTo(n*.222222,n,0,n*.777777,0,n*.5),f.closePath(),u||(l=f.createLinearGradient(0,0,0,n),l.addColorStop(0,"rgb(92, 95, 101)"),l.addColorStop(.47,"rgb(46, 49, 53)"),l.addColorStop(1,"rgb(22, 23, 26)"),f.fillStyle=l),f.fill(),f.save(),f.beginPath(),f.moveTo(n*.055555,n*.5),f.bezierCurveTo(n*.055555,n*.277777,n*.277777,n*.055555,n*.5,n*.055555),f.bezierCurveTo(n*.722222,n*.055555,n*.944444,n*.277777,n*.944444,n*.5),f.bezierCurveTo(n*.944444,n*.722222,n*.722222,n*.944444,n*.5,n*.944444),f.bezierCurveTo(n*.277777,n*.944444,n*.055555,n*.722222,n*.055555,n*.5),f.closePath();if(u)f.fill();else{o=f.createLinearGradient(0,.055555*n,0,.944443*n);switch(i.style){case"black":o.addColorStop(0,"rgb(43, 42, 47)"),o.addColorStop(1,"rgb(26, 27, 32)"),f.fillStyle=o,f.fill();break;case"brass":o.addColorStop(0,"rgb(150, 110, 54)"),o.addColorStop(1,"rgb(124, 95, 61)"),f.fillStyle=o,f.fill();break;case"silver":default:o.addColorStop(0,"rgb(204, 204, 204)"),o.addColorStop(1,"rgb(87, 92, 98)"),f.fillStyle=o,f.fill()}}f.save(),f.beginPath(),f.moveTo(n*.777777,n*.833333),f.bezierCurveTo(n*.722222,n*.722222,n*.611111,n*.666666,n*.5,n*.666666),f.bezierCurveTo(n*.388888,n*.666666,n*.277777,n*.722222,n*.222222,n*.833333),f.bezierCurveTo(n*.277777,n*.888888,n*.388888,n*.944444,n*.5,n*.944444),f.bezierCurveTo(n*.611111,n*.944444,n*.722222,n*.888888,n*.777777,n*.833333),f.closePath(),u||(p=f.createRadialGradient(.555555*n,.944444*n,0,.555555*n,.944444*n,.388888*n),p.addColorStop(0,"rgba(255, 255, 255, 0.6)"),p.addColorStop(1,"rgba(255, 255, 255, 0)"),f.fillStyle=p),f.fill(),f.save(),f.beginPath(),f.moveTo(n*.944444,n*.277777),f.bezierCurveTo(n*.833333,n*.111111,n*.666666,0,n*.5,0),f.bezierCurveTo(n*.333333,0,n*.166666,n*.111111,n*.055555,n*.277777),f.bezierCurveTo(n*.166666,n*.333333,n*.333333,n*.388888,n*.5,n*.388888),f.bezierCurveTo(n*.666666,n*.388888,n*.833333,n*.333333,n*.944444,n*.277777),f.closePath(),u||(w=f.createRadialGradient(.5*n,0,0,.5*n,0,.583333*n),w.addColorStop(0,"rgba(255, 255, 255, 0.749019)"),w.addColorStop(1,"rgba(255, 255, 255, 0)"),f.fillStyle=w),f.fill(),f.save(),f.beginPath(),f.moveTo(n*.277777,n*.555555),f.bezierCurveTo(n*.277777,n*.388888,n*.388888,n*.277777,n*.5,n*.277777),f.bezierCurveTo(n*.611111,n*.277777,n*.777777,n*.388888,n*.777777,n*.555555),f.bezierCurveTo(n*.777777,n*.666666,n*.611111,n*.777777,n*.5,n*.777777),f.bezierCurveTo(n*.388888,n*.777777,n*.277777,n*.666666,n*.277777,n*.555555),f.closePath(),u||(y=f.createLinearGradient(0,.277777*n,0,.722221*n),y.addColorStop(0,"#000000"),y.addColorStop(1,"rgb(204, 204, 204)"),f.fillStyle=y),f.fill(),f.save(),f.beginPath(),f.moveTo(n*.333333,n*.555555),f.bezierCurveTo(n*.333333,n*.444444,n*.388888,n*.333333,n*.5,n*.333333),f.bezierCurveTo(n*.611111,n*.333333,n*.722222,n*.444444,n*.722222,n*.555555),f.bezierCurveTo(n*.722222,n*.611111,n*.611111,n*.722222,n*.5,n*.722222),f.bezierCurveTo(n*.388888,n*.722222,n*.333333,n*.611111,n*.333333,n*.555555),f.closePath(),u||(b=f.createLinearGradient(0,.333333*n,0,.666666*n),b.addColorStop(0,"rgb(10, 9, 1)"),b.addColorStop(1,"rgb(42, 41, 37)"),f.fillStyle=b),f.fill();break;case"standardKnob":u||(a=f.createLinearGradient(0,0,0,n),a.addColorStop(0,"rgb(180, 180, 180)"),a.addColorStop(.46,"rgb(63, 63, 63)"),a.addColorStop(1,"rgb(40, 40, 40)"),f.fillStyle=a),f.beginPath(),f.arc(h,c,n/2,0,Math.PI*2,!0),f.closePath(),f.fill(),f.restore(),f.save();if(!u){e=f.createLinearGradient(0,n-n*.77,0,n-n*.77+n*.77);switch(i.style){case"black":e.addColorStop(0,"rgb(191, 191, 191)"),e.addColorStop(.5,"rgb(45, 44, 49)"),e.addColorStop(1,"rgb(125, 126, 128)"),f.fillStyle=e;break;case"brass":e.addColorStop(0,"rgb(223, 208, 174)"),e.addColorStop(.5,"rgb(123, 95, 63)"),e.addColorStop(1,"rgb(207, 190, 157)"),f.fillStyle=e;break;case"silver":default:e.addColorStop(0,"rgb(215, 215, 215)"),e.addColorStop(.5,"rgb(116, 116, 116)"),e.addColorStop(1,"rgb(215, 215, 215)"),f.fillStyle=e}}f.beginPath(),f.arc(h,c,n*.77/2,0,Math.PI*2,!0),f.closePath(),f.fill(),f.restore(),f.save(),u||(s=f.createRadialGradient(h,c,0,h,c,n*.77/2),s.addColorStop(0,"rgba(0, 0, 0, 0)"),s.addColorStop(.75,"rgba(0, 0, 0, 0)"),s.addColorStop(.76,"rgba(0, 0, 0, 0.01)"),s.addColorStop(1,"rgba(0, 0, 0, 0.2)"),f.fillStyle=s),f.beginPath(),f.arc(h,c,n*.77/2,0,Math.PI*2,!0),f.closePath(),f.fill()}return f.restore(),v},o=function(n,t,i){var a=r.createElement("canvas"),l,c,s;a.width=n,a.height=n;var u=a.getContext("2d"),f=n/2,e=n/2,o,h;switch(t){case 0:u.save(),o=u.createRadialGradient(f,e,0,f,e,n*.5/2),o.addColorStop(0,i.innerColor1_OFF),o.addColorStop(.2,i.innerColor2_OFF),o.addColorStop(1,i.outerColor_OFF),u.fillStyle=o,u.beginPath(),u.arc(f,e,n*.5/2,0,Math.PI*2,!0),u.closePath(),u.fill(),u.restore(),u.save(),l=u.createRadialGradient(f,e,0,f,e,n*.5/2),l.addColorStop(0,"rgba(0, 0, 0, 0)"),l.addColorStop(.8,"rgba(0, 0, 0, 0)"),l.addColorStop(1,"rgba(0, 0, 0, 0.4)"),u.fillStyle=l,u.beginPath(),u.arc(f,e,n*.5/2,0,Math.PI*2,!0),u.closePath(),u.fill(),u.restore(),u.save(),h=u.createLinearGradient(0,.35*n,0,.35*n+.15*n),h.addColorStop(0,"rgba(255, 255, 255, 0.4)"),h.addColorStop(1,"rgba(255, 255, 255, 0)"),u.fillStyle=h,u.beginPath(),u.arc(f,.35*n+.2*n/2,n*.2,0,Math.PI*2,!0),u.closePath(),u.fill(),u.restore();break;case 1:u.save(),o=u.createRadialGradient(f,e,0,f,e,n*.5/2),o.addColorStop(0,i.innerColor1_ON),o.addColorStop(.2,i.innerColor2_ON),o.addColorStop(1,i.outerColor_ON),u.fillStyle=o,u.beginPath(),u.arc(f,e,n*.5/2,0,Math.PI*2,!0),u.closePath(),u.fill(),u.restore(),u.save(),c=u.createRadialGradient(f,e,0,f,e,n*.5/2),c.addColorStop(0,"rgba(0, 0, 0, 0)"),c.addColorStop(.8,"rgba(0, 0, 0, 0)"),c.addColorStop(1,"rgba(0, 0, 0, 0.4)"),u.fillStyle=c,u.beginPath(),u.arc(f,e,n*.5/2,0,Math.PI*2,!0),u.closePath(),u.fill(),u.restore(),u.save(),h=u.createLinearGradient(0,.35*n,0,.35*n+.15*n),h.addColorStop(0,"rgba(255, 255, 255, 0.4)"),h.addColorStop(1,"rgba(255, 255, 255, 0)"),u.fillStyle=h,u.beginPath(),u.arc(f,.35*n+.2*n/2,n*.2,0,Math.PI*2,!0),u.closePath(),u.fill(),u.restore(),u.save(),s=u.createRadialGradient(f,e,0,f,e,n/2),s.addColorStop(0,tt(i.coronaColor,0).color),s.addColorStop(.6,tt(i.coronaColor,.4).color),s.addColorStop(.7,tt(i.coronaColor,.25).color),s.addColorStop(.8,tt(i.coronaColor,.15).color),s.addColorStop(.85,tt(i.coronaColor,.05).color),s.addColorStop(1,tt(i.coronaColor,0).color),u.fillStyle=s,u.beginPath(),u.arc(f,e,n/2,0,Math.PI*2,!0),u.closePath(),u.fill(),u.restore()}return a},w=function(n,i,r){var a=t(n,i),u=a.getContext("2d");u.save();var p=0,h=0,w=n,c=i,v=Math.min(n,i)*.095,o=u.createLinearGradient(0,h,0,h+c);o.addColorStop(0,"rgb(76, 76, 76)"),o.addColorStop(.08,"#666666"),o.addColorStop(.92,"#666666"),o.addColorStop(1,"rgb(230, 230, 230)"),u.fillStyle=o,e(u,p,h,w,c,v),u.fill(),u.restore(),u.save();var b=1,s=1,k=n-2,l=i-2,y=v-1,f=u.createLinearGradient(0,s,0,s+l);return f.addColorStop(0,r.gradientStartColor),f.addColorStop(.03,r.gradientFraction1Color),f.addColorStop(.49,r.gradientFraction2Color),f.addColorStop(.5,r.gradientFraction3Color),f.addColorStop(1,r.gradientStopColor),u.fillStyle=f,e(u,b,s,k,l,y),u.fill(),u.restore(),a},v=function(n,t,i,u){var e=r.createElement("canvas"),f;return e.width=n,e.height=n,f=e.getContext("2d"),f.save(),f.fillStyle=t,i?(f.beginPath(),f.moveTo(n*.5,n),f.lineTo(0,0),f.lineTo(n,0),f.closePath(),f.fill()):u?(f.beginPath(),f.moveTo(n,n*.5),f.lineTo(0,0),f.lineTo(0,n),f.closePath(),f.fill()):(f.beginPath(),f.moveTo(n*.5,0),f.lineTo(n,n),f.lineTo(0,n),f.closePath(),f.fill()),f.restore(),e},at=function(n,t,i,r,u,f,e,o,s){var c=n.measureText(u).width,l=t,h;n.save(),n.textAlign="left",n.textBaseline="middle",n.strokeStyle=f.labelColor.getRgbaColor(),n.fillStyle=f.labelColor.getRgbaColor(),o||e||(l=i),o?(n.font=.046728*t+"px sans-serif",h=n.measureText(r).width,n.fillText(r,(t-h)/2,i*.3,t*.3),n.fillText(u,(t-Math.min(c,t*.2))/2,i*.38,t*.2)):e?(n.font=.1*t+"px sans-serif",n.save(),n.translate(.671428*t,.1375*i),n.rotate(1.570796),n.fillText(r,0,0),n.translate(-.671428*t,-.1375*i),n.restore(),n.font=.071428*t+"px sans-serif",s?n.fillText(u,.63*t,i*.85,t*.2):n.fillText(u,(t-c)/2,i*.89,t*.2)):(n.font=.1*i+"px sans-serif",n.fillText(r,t*.15,i*.25,t*.3),n.font=.03*t+"px sans-serif",n.fillText(u,t*.0625,i*.7,t*.07)),n.restore()},wi=ii(12,12,function(n){var r=n.canvas.width,t=n.canvas.height,u=0,i=0,c,h,a,l,e,f,s,o;n.save(),n.save(),n.beginPath(),n.rect(0,0,r*.5,t*.5),n.closePath(),n.restore(),c=n.createLinearGradient(0,i*t,0,.5*t+i*t),c.addColorStop(0,"rgb(35, 35, 35)"),c.addColorStop(1,"rgb(23, 23, 23)"),n.fillStyle=c,n.fill(),n.save(),n.beginPath(),n.rect(r*.083333,0,r*.333333,t*.416666),n.closePath(),n.restore(),u=.083333,i=0,h=n.createLinearGradient(0,i*t,0,.416666*t+i*t),h.addColorStop(0,"rgb(38, 38, 38)"),h.addColorStop(1,"rgb(30, 30, 30)"),n.fillStyle=h,n.fill(),n.save(),n.beginPath(),n.rect(r*.5,t*.5,r*.5,t*.5),n.closePath(),n.restore(),u=.5,i=.5,a=n.createLinearGradient(0,i*t,0,.5*t+i*t),a.addColorStop(0,"rgb(35, 35, 35)"),a.addColorStop(1,"rgb(23, 23, 23)"),n.fillStyle=a,n.fill(),n.save(),n.beginPath(),n.rect(r*.583333,t*.5,r*.333333,t*.416666),n.closePath(),n.restore(),u=.583333,i=.5,l=n.createLinearGradient(0,i*t,0,.416666*t+i*t),l.addColorStop(0,"rgb(38, 38, 38)"),l.addColorStop(1,"rgb(30, 30, 30)"),n.fillStyle=l,n.fill(),n.save(),n.beginPath(),n.rect(r*.5,0,r*.5,t*.5),n.closePath(),n.restore(),u=.5,i=0,e=n.createLinearGradient(0,i*t,0,.5*t+i*t),e.addColorStop(0,"rgb(48, 48, 48)"),e.addColorStop(1,"rgb(40, 40, 40)"),n.fillStyle=e,n.fill(),n.save(),n.beginPath(),n.rect(r*.583333,t*.083333,r*.333333,t*.416666),n.closePath(),n.restore(),u=.583333,i=.083333,f=n.createLinearGradient(0,i*t,0,.416666*t+i*t),f.addColorStop(0,"rgb(53, 53, 53)"),f.addColorStop(1,"rgb(45, 45, 45)"),n.fillStyle=f,n.fill(),n.save(),n.beginPath(),n.rect(0,t*.5,r*.5,t*.5),n.closePath(),n.restore(),u=0,i=.5,s=n.createLinearGradient(0,i*t,0,.5*t+i*t),s.addColorStop(0,"#303030"),s.addColorStop(1,"#282828"),n.fillStyle=s,n.fill(),n.save(),n.beginPath(),n.rect(r*.083333,t*.583333,r*.333333,t*.416666),n.closePath(),n.restore(),u=.083333,i=.583333,o=n.createLinearGradient(0,i*t,0,.416666*t+i*t),o.addColorStop(0,"#353535"),o.addColorStop(1,"#2d2d2d"),n.fillStyle=o,n.fill(),n.restore()}),bi=ii(15,15,function(n){var i=n.canvas.width,t=n.canvas.height,e,r,o,u,f;n.save(),n.save(),n.beginPath(),n.rect(0,0,i,t),n.closePath(),n.restore(),e="#1D2123",n.fillStyle=e,n.fill(),n.save(),n.beginPath(),n.moveTo(0,t*.266666),n.bezierCurveTo(0,t*.4,i*.066666,t*.466666,i*.2,t*.466666),n.bezierCurveTo(i*.333333,t*.466666,i*.4,t*.4,i*.4,t*.266666),n.bezierCurveTo(i*.4,t*.133333,i*.333333,t*.066666,i*.2,t*.066666),n.bezierCurveTo(i*.066666,t*.066666,0,t*.133333,0,t*.266666),n.closePath(),r=n.createLinearGradient(0,.066666*t,0,.466666*t),r.addColorStop(0,"#000000"),r.addColorStop(1,"#444444"),n.fillStyle=r,n.fill(),n.save(),n.beginPath(),n.moveTo(0,t*.2),n.bezierCurveTo(0,t*.333333,i*.066666,t*.4,i*.2,t*.4),n.bezierCurveTo(i*.333333,t*.4,i*.4,t*.333333,i*.4,t*.2),n.bezierCurveTo(i*.4,t*.066666,i*.333333,0,i*.2,0),n.bezierCurveTo(i*.066666,0,0,t*.066666,0,t*.2),n.closePath(),o="#050506",n.fillStyle=o,n.fill(),n.save(),n.beginPath(),n.moveTo(i*.466666,t*.733333),n.bezierCurveTo(i*.466666,t*.866666,i*.533333,t*.933333,i*.666666,t*.933333),n.bezierCurveTo(i*.8,t*.933333,i*.866666,t*.866666,i*.866666,t*.733333),n.bezierCurveTo(i*.866666,t*.6,i*.8,t*.533333,i*.666666,t*.533333),n.bezierCurveTo(i*.533333,t*.533333,i*.466666,t*.6,i*.466666,t*.733333),n.closePath(),u=n.createLinearGradient(0,.533333*t,0,.933333*t),u.addColorStop(0,"#000000"),u.addColorStop(1,"#444444"),n.fillStyle=u,n.fill(),n.save(),n.beginPath(),n.moveTo(i*.466666,t*.666666),n.bezierCurveTo(i*.466666,t*.8,i*.533333,t*.866666,i*.666666,t*.866666),n.bezierCurveTo(i*.8,t*.866666,i*.866666,t*.8,i*.866666,t*.666666),n.bezierCurveTo(i*.866666,t*.533333,i*.8,t*.466666,i*.666666,t*.466666),n.bezierCurveTo(i*.533333,t*.466666,i*.466666,t*.533333,i*.466666,t*.666666),n.closePath(),f="#050506",n.fillStyle=f,n.fill(),n.restore()}),n=function(n,t,i,r){function s(){e=0>n?0:n,e=255<n?255:n,f=0>t?0:t,f=255<t?255:t,u=0>i?0:i,u=255<i?255:i,o=0>r?0:r,o=1<r?1:r}var e,f,u,o;r===null&&(r=1),s(),this.getRed=function(){return e},this.setRed=function(n){e=0>n?0:n,e=255<n?255:n},this.getGreen=function(){return f},this.setGreen=function(n){f=0>n?0:n,f=255<n?255:n},this.getBlue=function(){return u},this.setBlue=function(n){u=0>n?0:n,u=255<n?255:n},this.getAlpha=function(){return o},this.setAlpha=function(n){o=0>n?0:n,o=1<n?1:n},this.getRgbaColor=function(){return"rgba("+e+", "+f+", "+u+", "+o+")"},this.getRgbColor=function(){return"rgb("+e+", "+f+", "+u+")"},this.getHexColor=function(){return"#"+e.toString(16)+f.toString(16)+u.toString(16)}},rt=function(n,t,i){i=i===undefined?-Math.PI/2:i,this.fill=function(r,u,f,e,o){var l,v,y=180/Math.PI,h=2*Math.PI,c=(o*2-u)*h/450,w,b,k,s,p,a;for(c=h/(360*c),r.save(),r.lineWidth=2,r.translate(u,f),r.rotate(i),s=0,p=n.length-1;s<p;s++)for(l=h*n[s],v=h*n[s+1],w=(v-l)*y,b=t[s],k=t[s+1],a=l;a<v;a+=c)r.rotate(c),r.strokeStyle=ti(b,k,w,(a-l)*y).getRgbaColor(),r.beginPath(),r.moveTo(e,0),r.lineTo(o,0),r.closePath(),r.stroke();r.restore()}},kt=function(n,t,i,r){this.getColorAt=function(n){var o;n=n<0?0:n>1?1:n;for(var u=0,e=0,f=1,s=1,h=0,t=0;t<i.length;t++){i[t]<n&&u<i[t]&&(u=i[t],e=t);if(i[t]==n)return r[t];i[t]>n&&f>=i[t]&&(f=i[t],s=t)}return o=(n-u)/(f-u),ti(r[e],r[s],1,o)},this.getStart=function(){return n},this.getEnd=function(){return t}},h,u,l,d,ct,yt,gt,wt,a,c,vt,bt,dt;Math.log10=function(n){return Math.log(n)/Math.LN10},function(){h=function(n,t,i,r,u){this.gradientStart=i,this.gradientFraction=t,this.gradientStop=i,this.labelColor=r,this.symbolColor=u}}(),function(){u=function(n,t,i,r,u,f){this.gradientStartColor=n,this.gradientFraction1Color=t,this.gradientFraction2Color=i,this.gradientFraction3Color=r,this.gradientStopColor=u,this.textColor=f}}(),function(){l=function(n,t,i,r,u,f){this.veryDark=n,this.dark=t,this.medium=i,this.light=r,this.lighter=u,this.veryLight=f}}(),function(){d=function(n,t,i,r,u,f,e){this.innerColor1_ON=n,this.innerColor2_ON=t,this.outerColor_ON=i,this.coronaColor=r,this.innerColor1_OFF=u,this.innerColor2_OFF=f,this.outerColor_OFF=e}}(),function(){ct=function(n){this.type=n}}(),function(){yt=function(n){this.type=n}}(),function(){gt=function(n){this.type=n}}(),function(){wt=function(n){this.style=n}}(),function(){a=function(n){this.design=n}}(),function(){c=function(n){this.type=n}}(),function(){vt=function(n){this.type=n}}(),function(){bt=function(n){this.format=n}}(),function(){dt=function(n){this.type=n}}();var lr={DARK_GRAY:new h(new n(0,0,0,1),new n(51,51,51,1),new n(153,153,153,1),new n(255,255,255,1),new n(180,180,180,1)),SATIN_GRAY:new h(new n(45,57,57,1),new n(45,57,57,1),new n(45,57,57,1),new n(167,184,180,1),new n(137,154,150,1)),LIGHT_GRAY:new h(new n(130,130,130,1),new n(181,181,181,1),new n(253,253,253,1),new n(0,0,0,1),new n(80,80,80,1)),WHITE:new h(new n(255,255,255,1),new n(255,255,255,1),new n(255,255,255,1),new n(0,0,0,1),new n(80,80,80,1)),BLACK:new h(new n(0,0,0,1),new n(0,0,0,1),new n(0,0,0,1),new n(255,255,255,1),new n(150,150,150,1)),BEIGE:new h(new n(178,172,150,1),new n(204,205,184,1),new n(231,231,214,1),new n(0,0,0,1),new n(80,80,80,1)),BROWN:new h(new n(245,225,193,1),new n(245,225,193,1),new n(255,250,240,1),new n(109,73,47,1),new n(89,53,27,1)),RED:new h(new n(198,93,95,1),new n(212,132,134,1),new n(242,218,218,1),new n(0,0,0,1),new n(90,0,0,1)),GREEN:new h(new n(65,120,40,1),new n(129,171,95,1),new n(218,237,202,1),new n(0,0,0,1),new n(0,90,0,1)),BLUE:new h(new n(45,83,122,1),new n(115,144,170,1),new n(227,234,238,1),new n(0,0,0,1),new n(0,0,90,1)),ANTHRACITE:new h(new n(50,50,54,1),new n(47,47,51,1),new n(69,69,74,1),new n(250,250,250,1),new n(180,180,180,1)),MUD:new h(new n(80,86,82,1),new n(70,76,72,1),new n(57,62,58,1),new n(255,255,240,1),new n(225,225,210,1)),PUNCHED_SHEET:new h(new n(50,50,54,1),new n(47,47,51,1),new n(69,69,74,1),new n(255,255,255,1),new n(180,180,180,1)),CARBON:new h(new n(50,50,54,1),new n(47,47,51,1),new n(69,69,74,1),new n(255,255,255,1),new n(180,180,180,1))},pr={BEIGE:new u("#c8c8b1","rgb(241, 237, 207)","rgb(234, 230, 194)","rgb(225, 220, 183)","rgb(237, 232, 191)","#000000"),BLUE:new u("#ffffff","rgb(231, 246, 255)","rgb(170, 224, 255)","rgb(136, 212, 255)","rgb(192, 232, 255)","#124564"),ORANGE:new u("#ffffff","rgb(255, 245, 225)","rgb(255, 217, 147)","rgb(255, 201, 104)","rgb(255, 227, 173)","#503700"),RED:new u("#ffffff","rgb(255, 225, 225)","rgb(253, 152, 152)","rgb(252, 114, 115)","rgb(254, 178, 178)","#4f0c0e"),YELLOW:new u("#ffffff","rgb(245, 255, 186)","rgb(210, 255, 0)","rgb(158, 205, 0)","rgb(210, 255, 0)","#405300"),WHITE:new u("#ffffff","#ffffff","rgb(241, 246, 242)","rgb(229, 239, 244)","#ffffff","#000000"),GRAY:new u("#414141","rgb(117, 117, 117)","rgb(87, 87, 87)","#414141","rgb(81, 81, 81)","#ffffff"),BLACK:new u("#414141","#666666","#333333","#000000","#333333","#cccccc"),GREEN:new u("rgb(33, 67, 67)","rgb(33, 67, 67)","rgb(29, 58, 58)","rgb(28, 57, 57)","rgb(23, 46, 46)","rgba(0, 185, 165, 255)"),BLUE2:new u("rgb(0, 68, 103)","rgb(8, 109, 165)","rgb(0, 72, 117)","rgb(0, 72, 117)","rgb(0, 68, 103)","rgb(111, 182, 228)"),BLUE_BLACK:new u("rgb(22, 125, 212)","rgb(3, 162, 254)","rgb(3, 162, 254)","rgb(3, 162, 254)","rgb(11, 172, 244)","#000000"),BLUE_DARKBLUE:new u("rgb(18, 33, 88)","rgb(18, 33, 88)","rgb(19, 30, 90)","rgb(17, 31, 94)","rgb(21, 25, 90)","rgb(23, 99, 221)"),BLUE_GRAY:new u("rgb(135, 174, 255)","rgb(101, 159, 255)","rgb(44, 93, 255)","rgb(27, 65, 254)","rgb(12, 50, 255)","#b2b4ed"),STANDARD:new u("rgb(131, 133, 119)","rgb(176, 183, 167)","rgb(165, 174, 153)","rgb(166, 175, 156)","rgb(175, 184, 165)","rgb(35, 42, 52)"),STANDARD_GREEN:new u("#ffffff","rgb(219, 230, 220)","rgb(179, 194, 178)","rgb(153, 176, 151)","rgb(114, 138, 109)","#080C06"),BLUE_BLUE:new u("rgb(100, 168, 253)","rgb(100, 168, 253)","rgb(95, 160, 250)","rgb(80, 144, 252)","rgb(74, 134, 255)","#002cbb"),RED_DARKRED:new u("rgb(72, 36, 50)","rgb(185, 111, 110)","rgb(148, 66, 72)","rgb(83, 19, 20)","rgb(7, 6, 14)","#FE8B92"),DARKBLUE:new u("rgb(14, 24, 31)","rgb(46, 105, 144)","rgb(19, 64, 96)","rgb(6, 20, 29)","rgb(8, 9, 10)","#3DB3FF"),LILA:new u("rgb(175, 164, 255)","rgb(188, 168, 253)","rgb(176, 159, 255)","rgb(174, 147, 252)","rgb(168, 136, 233)","#076148"),BLACKRED:new u("rgb(8, 12, 11)","rgb(10, 11, 13)","rgb(11, 10, 15)","rgb(7, 13, 9)","rgb(9, 13, 14)","#B50026"),DARKGREEN:new u("rgb(25, 85, 0)","rgb(47, 154, 0)","rgb(30, 101, 0)","rgb(30, 101, 0)","rgb(25, 85, 0)","#233123"),SECTIONS:new u("#b2b2b2","#ffffff","#c4c4c4","#c4c4c4","#b2b2b2","#000000")},er={RED:new l(new n(82,0,0,1),new n(158,0,19,1),new n(213,0,25,1),new n(240,82,88,1),new n(255,171,173,1),new n(255,217,218,1)),GREEN:new l(new n(8,54,4,1),new n(0,107,14,1),new n(15,148,0,1),new n(121,186,37,1),new n(190,231,141,1),new n(234,247,218,1)),BLUE:new l(new n(0,11,68,1),new n(0,73,135,1),new n(0,108,201,1),new n(0,141,242,1),new n(122,200,255,1),new n(204,236,255,1)),ORANGE:new l(new n(118,83,30,1),new n(215,67,0,1),new n(240,117,0,1),new n(255,166,0,1),new n(255,255,128,1),new n(255,247,194,1)),YELLOW:new l(new n(41,41,0,1),new n(102,102,0,1),new n(177,165,0,1),new n(255,242,0,1),new n(255,250,153,1),new n(255,252,204,1)),CYAN:new l(new n(15,109,109,1),new n(0,109,144,1),new n(0,144,191,1),new n(0,174,239,1),new n(153,223,249,1),new n(204,239,252,1)),MAGENTA:new l(new n(98,0,114,1),new n(128,24,72,1),new n(191,36,107,1),new n(255,48,143,1),new n(255,172,210,1),new n(255,214,23,1)),WHITE:new l(new n(210,210,210,1),new n(220,220,220,1),new n(235,235,235,1),new n(255,255,255,1),new n(255,255,255,1),new n(255,255,255,1)),GRAY:new l(new n(25,25,25,1),new n(51,51,51,1),new n(76,76,76,1),new n(128,128,128,1),new n(204,204,204,1),new n(243,243,243,1)),BLACK:new l(new n(0,0,0,1),new n(5,5,5,1),new n(10,10,10,1),new n(15,15,15,1),new n(20,20,20,1),new n(25,25,25,1)),RAITH:new l(new n(0,32,65,1),new n(0,65,125,1),new n(0,106,172,1),new n(130,180,214,1),new n(148,203,242,1),new n(191,229,255,1)),GREEN_LCD:new l(new n(0,55,45,1),new n(15,109,93,1),new n(0,185,165,1),new n(48,255,204,1),new n(153,255,227,1),new n(204,255,241,1)),JUG_GREEN:new l(new n(0,56,0,1),new n(32,69,36,1),new n(50,161,0,1),new n(129,206,0,1),new n(190,231,141,1),new n(234,247,218,1))},ar={RED_LED:new d("#FF9A89","#FF9A89","#FF3300","#FF8D70","#7E1C00","#7E1C00","#641B00"),GREEN_LED:new d("#9AFF89","#9AFF89","#59FF2A","#A5FF00","#1C7E00","#1C7E00","#1B6400"),BLUE_LED:new d("#899AFF","#899AFF","#0033FF","#708DFF","#001C7E","#001C7E","#001B64"),ORANGE_LED:new d("#FEA23F","#FEA23F","#FD6C00","#FD6C00","#592800","#592800","#421F00"),YELLOW_LED:new d("#FFFF62","#FFFF62","#FFFF00","#FFFF00","#6B6D00","#6B6D00","#515300"),CYAN_LED:new d("#00FFFF","#00FFFF","#1BC3C3","#00FFFF","#083B3B","#083B3B","#052727"),MAGENTA_LED:new d("#D300FF","#D300FF","#8600CB","#C300FF","#38004B","#38004B","#280035")},ki={TYPE1:new ct("type1"),TYPE2:new ct("type2"),TYPE3:new ct("type3"),TYPE4:new ct("type4"),TYPE5:new ct("type5")},vr={NORTH:new yt("north"),SOUTH:new yt("south"),EAST:new yt("east"),WEST:new yt("west")},di={STANDARD_KNOB:new gt("standardKnob"),METAL_KNOB:new gt("metalKnob")},ai={BLACK:new wt("black"),BRASS:new wt("brass"),SILVER:new wt("silver")},yr={BLACK_METAL:new a("blackMetal"),METAL:new a("metal"),SHINY_METAL:new a("shinyMetal"),BRASS:new a("brass"),STEEL:new a("steel"),CHROME:new a("chrome"),GOLD:new a("gold"),ANTHRACITE:new a("anthracite"),TILTED_GRAY:new a("tiltedGray"),TILTED_BLACK:new a("tiltedBlack"),GLOSSY_METAL:new a("glossyMetal")},fr={TYPE1:new c("type1"),TYPE2:new c("type2"),TYPE3:new c("type3"),TYPE4:new c("type4"),TYPE5:new c("type5"),TYPE6:new c("type6"),TYPE7:new c("type7"),TYPE8:new c("type8"),TYPE9:new c("type9"),TYPE10:new c("type10"),TYPE11:new c("type11"),TYPE12:new c("type12"),TYPE13:new c("type13"),TYPE14:new c("type14")},or={TYPE1:new vt("type1"),TYPE2:new vt("type2"),TYPE3:new vt("type3"),TYPE4:new vt("type4"),TYPE5:new vt("type5")},hr={STANDARD:new bt("standard"),FRACTIONAL:new bt("fractional"),SCIENTIFIC:new bt("scientific")},sr={NORMAL:new dt("normal"),HORIZONTAL:new dt("horizontal"),TANGENT:new dt("tangent")};return{Radial:li,RadialBargraph:cr,RadialVertical:ou,Linear:su,LinearBargraph:fu,DisplaySingle:au,DisplayMulti:vu,Level:cu,Compass:kr,WindDirection:dr,Horizon:wr,Led:br,Clock:uu,Battery:tu,StopWatch:nu,Altimeter:ru,TrafficLight:iu,LightBulb:gr,drawFrame:y,drawBackground:b,drawForeground:p,rgbaColor:n,conicalGradient:rt,setAlpha:tt,getColorFromFraction:ti,gradientWrapper:kt,BackgroundColor:lr,LcdColor:pr,ColorDef:er,LedColor:ar,GaugeType:ki,Orientation:vr,FrameDesign:yr,PointerType:fr,ForegroundType:or,KnobType:di,KnobStyle:ai,LabelNumberFormat:hr,TickLabelOrientation:sr,Section:lu}}()