import{a as o}from"./p-80de33dc.js";var e=o((function(o,e){function r(o,e,r,t){var n={timer:void 0,lastArgs:[]},i=function(){for(var t=this,i=[],u=0;u<arguments.length;u++)i[u]=arguments[u];n.lastArgs=i,n.timer?clearTimeout(n.timer):e&&r.apply(this,n.lastArgs),n.timer=setTimeout((function(){e||r.apply(t,n.lastArgs),n.timer=void 0}),o)};return t&&(i=i.bind(t)),i.options=n,i}function t(o,e,t,n){var i;Object.defineProperty(t,n,{configurable:!0,enumerable:!1,get:function(){return i},set:function(t){i=r(o,e,t,this)}})}function n(o,e,t){return t.value=r(o,e,t.value),t}function i(o,e){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];if(0===r.length)throw new Error("function applied debounce decorator should be a method");if(1===r.length)throw new Error("method applied debounce decorator should have valid name");var u=r[0],f=r[1],a=3===r.length&&r[2]?r[2]:Object.getOwnPropertyDescriptor(u,f);if(a)return n(o,e,a);t(o,e,u,f)}Object.defineProperty(e,"__esModule",{value:!0}),e.cancel=function(o){o&&o.options&&clearTimeout(o.options.timer)},e.debounce=function(){for(var o=[],e=0;e<arguments.length;e++)o[e]=arguments[e];var r=500,t=!1;if(o.length&&("number"==typeof o[0]||"object"==typeof o[0]&&void 0!==o[0].leading)){"number"==typeof o[0]&&(r=o[0]);var n=void 0;return"object"==typeof o[0]&&void 0!==o[0].leading&&(n=o[0]),1<o.length&&"object"==typeof o[1]&&void 0!==o[1].leading&&(n=o[1]),n&&(t=n.leading),function(){for(var o=[],e=0;e<arguments.length;e++)o[e]=arguments[e];return i.apply(void 0,[r,t].concat(o))}}return i.apply(void 0,[r,t].concat(o))}}));export{e as i}