!function(a,n){"function"==typeof define&&define.amd?define(n):"object"==typeof exports?module.exports=n(require,exports,module):a.countup=n()}(this,function(a,n,t){var e=function(a,n,t,e,i,r){function o(a){a=a.tofixed(l.decimals),a+="";var n,t,e,i,r,o;if(n=a.split("."),t=n[0],e=n.length>1?l.options.decimal+n[1]:"",l.options.usegrouping){for(i="",r=0,o=t.length;rl.endval,l.frameval=l.startval,l.initialized=!0,!0):(l.error="[countup] startval ("+n+") or endval ("+t+") is not a number",!1)):(l.error="[countup] target is null or undefined",!1))},l.printvalue=function(a){var n=l.options.formattingfn(a);"input"===l.d.tagname?this.d.value=n:"text"===l.d.tagname||"tspan"===l.d.tagname?this.d.textcontent=n:this.d.innerhtml=n},l.count=function(a){l.starttime||(l.starttime=a),l.timestamp=a;var n=a-l.starttime;l.remaining=l.duration-n,l.options.useeasing?l.countdown?l.frameval=l.startval-l.options.easingfn(n,0,l.startval-l.endval,l.duration):l.frameval=l.options.easingfn(n,l.startval,l.endval-l.startval,l.duration):l.countdown?l.frameval=l.startval-(l.startval-l.endval)*(n/l.duration):l.frameval=l.startval+(l.endval-l.startval)*(n/l.duration),l.countdown?l.frameval=l.framevall.endval?l.endval:l.frameval,l.frameval=math.round(l.frameval*l.dec)/l.dec,l.printvalue(l.frameval),nl.endval,l.raf=requestanimationframe(l.count))}},l.initialize()&&l.printvalue(l.startval)};return e});