1 |
- import{r as _,bl as d,w as y,b7 as w,bB as O,c9 as b}from"./index-35c97d5b.js";function f(e){return w()?(O(e),!0):!1}function P(e){return typeof e=="function"?e():b(e)}const p=typeof window<"u",V=()=>{};function I(e,t=1e3,r={}){const{immediate:c=!0,immediateCallback:a=!1}=r;let n=null;const o=_(!1);function s(){n&&(clearInterval(n),n=null)}function u(){o.value=!1,s()}function i(){const l=P(t);l<=0||(o.value=!0,a&&e(),s(),n=setInterval(e,l))}if(c&&p&&i(),d(t)||typeof t=="function"){const l=y(t,()=>{o.value&&p&&i()});f(l)}return f(u),{isActive:o,pause:u,resume:i}}var $=Object.defineProperty,m=Object.getOwnPropertySymbols,S=Object.prototype.hasOwnProperty,g=Object.prototype.propertyIsEnumerable,v=(e,t,r)=>t in e?$(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,h=(e,t)=>{for(var r in t||(t={}))S.call(t,r)&&v(e,r,t[r]);if(m)for(var r of m(t))g.call(t,r)&&v(e,r,t[r]);return e};function j(e=1e3,t={}){const{controls:r=!1,immediate:c=!0,callback:a}=t,n=_(0),o=()=>n.value+=1,s=()=>{n.value=0},u=I(a?()=>{o(),a(n.value)}:o,e,{immediate:c});return r?h({counter:n,reset:s},u):n}export{P as a,I as b,p as i,V as n,f as t,j as u};
|