var f=function(n){return setTimeout(n,16)},o=function(n){return clearTimeout(n)};typeof window<"u"&&"requestAnimationFrame"in window&&(f=function(n){return window.requestAnimationFrame(n)},o=function(n){return window.cancelAnimationFrame(n)});var u=0,a=new Map;function c(e){a.delete(e)}function m(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;u+=1;var r=u;function t(i){if(i===0)c(r),e();else{var d=f(function(){t(i-1)});a.set(r,d)}}return t(n),r}m.cancel=function(e){var n=a.get(e);return c(n),o(n)};export{m as w};
