import{__toESM as e,createSvgIcon as t,require_react as n}from"./index-D6C_Nj7C.js";var r=e(n()),i=t(r.createElement(`path`,{d:`M6 19h4V5H6v14zm8-14v14h4V5h-4z`}),`Pause`),a=t(r.createElement(`path`,{d:`M8 5v14l11-7z`}),`PlayArrow`),o=t(r.createElement(`path`,{d:`M12 5V1L7 6l5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8z`}),`Replay`);const s=({timerIsOn:e,updatePromise:t,isLoading:n,initialSeconds:i=60})=>{let[a,o]=(0,r.useState)(i),s=(0,r.useCallback)(()=>setInterval(()=>{o(e=>e>-1?e-1:e)},1e3),[]),c=(0,r.useRef)(null);return(0,r.useEffect)(()=>{n||o(i)},[n]),(0,r.useEffect)(()=>{(async()=>{a===0&&(clearInterval(c.current),await t(),c.current=s())})()},[a]),(0,r.useEffect)(()=>(e?c.current=s():clearInterval(c.current),()=>{clearInterval(c.current)}),[e]),{seconds:a}};export{i as Pause_default,a as PlayArrow_default,o as Replay_default,s as useMESFTimer};
//# sourceMappingURL=useMESFTimer-BG8FZmx5.js.map