import{c as t,g as n}from"./_commonjsHelpers.lGe4XDVY.js";var r=function(t){var n=typeof t;return null!=t&&("object"==n||"function"==n)},e="object"==typeof t&&t&&t.Object===Object&&t,o="object"==typeof self&&self&&self.Object===Object&&self,i=e||o||Function("return this")(),u=i,c=function(){return u.Date.now()},a=/\s/;var f=function(t){for(var n=t.length;n--&&a.test(t.charAt(n)););return n},l=/^\s+/;var v=function(t){return t?t.slice(0,f(t)+1).replace(l,""):t},s=i.Symbol,p=s,b=Object.prototype,d=b.hasOwnProperty,m=b.toString,y=p?p.toStringTag:void 0;var j=function(t){var n=d.call(t,y),r=t[y];try{t[y]=void 0;var e=!0}catch(i){}var o=m.call(t);return e&&(n?t[y]=r:delete t[y]),o},g=Object.prototype.toString;var h=j,O=function(t){return g.call(t)},T=s?s.toStringTag:void 0;var x=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":T&&T in Object(t)?h(t):O(t)},S=function(t){return null!=t&&"object"==typeof t};var N=v,w=r,$=function(t){return"symbol"==typeof t||S(t)&&"[object Symbol]"==x(t)},E=/^[-+]0x[0-9a-f]+$/i,M=/^0b[01]+$/i,W=/^0o[0-7]+$/i,A=parseInt;var D=r,F=c,H=function(t){if("number"==typeof t)return t;if($(t))return NaN;if(w(t)){var n="function"==typeof t.valueOf?t.valueOf():t;t=w(n)?n+"":n}if("string"!=typeof t)return 0===t?t:+t;t=N(t);var r=M.test(t);return r||W.test(t)?A(t.slice(2),r?2:8):E.test(t)?NaN:+t},I=Math.max,P=Math.min;const U=n((function(t,n,r){var e,o,i,u,c,a,f=0,l=!1,v=!1,s=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function p(n){var r=e,i=o;return e=o=void 0,f=n,u=t.apply(i,r)}function b(t){return f=t,c=setTimeout(m,n),l?p(t):u}function d(t){var r=t-a;return void 0===a||r>=n||r<0||v&&t-f>=i}function m(){var t=F();if(d(t))return y(t);c=setTimeout(m,function(t){var r=n-(t-a);return v?P(r,i-(t-f)):r}(t))}function y(t){return c=void 0,s&&e?p(t):(e=o=void 0,u)}function j(){var t=F(),r=d(t);if(e=arguments,o=this,a=t,r){if(void 0===c)return b(a);if(v)return clearTimeout(c),c=setTimeout(m,n),p(a)}return void 0===c&&(c=setTimeout(m,n)),u}return n=H(n)||0,D(r)&&(l=!!r.leading,i=(v="maxWait"in r)?I(H(r.maxWait)||0,n):i,s="trailing"in r?!!r.trailing:s),j.cancel=function(){void 0!==c&&clearTimeout(c),f=0,e=a=o=c=void 0},j.flush=function(){return void 0===c?u:y(F())},j}));export{U as d};
