var t,n,e=0,o=0,i=0,r=0,a=0,l=0,c="object"==typeof performance&&performance.now?performance:Date,u="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function s(){return a||(u(f),a=c.now()+l)}function f(){a=0}function _(){this._call=this._time=this._next=null}function w(t,n,e){var o=new _;return o.restart(t,n,e),o}function m(){a=(r=c.now())+l,e=o=0;try{!function(){s(),++e;for(var n,o=t;o;)(n=a-o._time)>=0&&o._call.call(void 0,n),o=o._next;--e}()}finally{e=0,function(){var e,o,i=t,r=1/0;for(;i;)i._call?(r>i._time&&(r=i._time),e=i,i=i._next):(o=i._next,i._next=null,i=e?e._next=o:t=o);n=e,p(r)}(),a=0}}function h(){var t=c.now(),n=t-r;n>1e3&&(l-=n,r=t)}function p(t){e||(o&&(o=clearTimeout(o)),t-a>24?(t<1/0&&(o=setTimeout(m,t-c.now()-l)),i&&(i=clearInterval(i))):(i||(r=c.now(),i=setInterval(h,1e3)),e=1,u(m)))}function v(t,n,e){var o=new _;return n=null==n?0:+n,o.restart(e=>{o.stop(),t(e+n)},n,e),o}_.prototype=w.prototype={constructor:_,restart:function(e,o,i){if("function"!=typeof e)throw new TypeError("callback is not a function");i=(null==i?s():+i)+(null==o?0:+o),this._next||n===this||(n?n._next=this:t=this,n=this),this._call=e,this._time=i,p()},stop:function(){this._call&&(this._call=null,this._time=1/0,p())}};export{v as a,s as n,w as t};
