"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});let l=e=>setTimeout(e,16),u=e=>clearTimeout(e);typeof window<"u"&&"requestAnimationFrame"in window&&(l=e=>window.requestAnimationFrame(e),u=e=>window.cancelAnimationFrame(e));let r=0;const a=new Map;function c(e){a.delete(e)}function d(e,n=1){r+=1;const t=r;function i(o){if(o===0)c(t),e();else{const f=l(()=>{i(o-1)});a.set(t,f)}}return i(n),t}d.cancel=e=>{const n=a.get(e);return c(n),u(n)};exports.default=d;
