"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function h(n,d,g){var o=g||{},t=o.noTrailing,a=t===void 0?!1:t,v=o.noLeading,m=v===void 0?!1:v,p=o.debounceMode,r=p===void 0?void 0:p,i,b=!1,l=0;function T(){i&&clearTimeout(i)}function D(f){var u=f||{},e=u.upcomingOnly,s=e===void 0?!1:e;T(),b=!s}function w(){for(var f=arguments.length,u=new Array(f),e=0;e<f;e++)u[e]=arguments[e];var s=this,M=Date.now()-l;if(b)return;function c(){l=Date.now(),d.apply(s,u)}function $(){i=void 0}!m&&r&&!i&&c(),T(),r===void 0&&M>n?m?(l=Date.now(),a||(i=setTimeout(r?$:c,n))):c():a!==!0&&(i=setTimeout(r?$:c,r===void 0?n-M:n))}return w.cancel=D,w}function O(n,d,g){var o={},t=o.atBegin,a=t===void 0?!1:t;return h(n,d,{debounceMode:a!==!1})}exports.debounce=O;exports.throttle=h;
