import{r}from"./index-BP8_t0zE.js";import"./assertThisInitialized-ClXgY4BW.js";function c(e){var t=r.useState(e),n=t[0],f=t[1],u=r.useRef(!1);r.useEffect(function(){return u.current=!0,function(){u.current=!1}},[]);var a=r.useCallback(function(s){if(u.current)return f(s)},[u,f]);return[n,a]}function v(e){var t=r.useRef();return r.useEffect(function(){t.current=e}),t.current}function l(e,t){e===void 0&&(e=0),t===void 0&&(t="");var n=c(!1),f=n[0],u=n[1];return r.useEffect(function(){u(!1);var a=setTimeout(function(){u(!0)},e);return function(){clearTimeout(a)}},[t,e,u]),f}function d(){var e=r.useRef(!0);return r.useEffect(function(){return e.current=!0,function(){e.current=!1}},[]),e}export{c as a,d as b,v as c,l as u};
