import{a as u,a2 as p}from"./vue-core-Di3IuVqe.js";const i="http://localhost:3333",l=u(!1),n=p.create({baseURL:i,timeout:3e4,headers:{"Content-Type":"application/json"}});function P(){const o=u(!1),t=u("");return{agentConnecte:l,loading:o,erreur:t,verifierAgent:async()=>{try{const r=await n.post("/status");return l.value=r.data.status==="ok",l.value}catch{return l.value=!1,!1}},connecter:async(r,a=4370)=>{o.value=!0,t.value="";try{return(await n.post("/connecter",{ip:r,port:a})).data}catch(e){throw t.value=e.response?.data?.error||e.message,e}finally{o.value=!1}},deconnecter:async(r,a=4370)=>{try{return(await n.post("/deconnecter",{ip:r,port:a})).data}catch(e){throw t.value=e.response?.data?.error||e.message,e}},recupererPointage:async(r,a=4370,e=null,s=null)=>{o.value=!0,t.value="";try{return(await n.post("/recupererPointage",{ip:r,port:a,dateDu:e,dateAu:s})).data}catch(c){throw t.value=c.response?.data?.error||c.message,c}finally{o.value=!1}},envoyerEmployes:async(r,a=4370,e=[])=>{o.value=!0,t.value="";try{return(await n.post("/envoyerEmployes",{ip:r,port:a,employes:e})).data}catch(s){throw t.value=s.response?.data?.error||s.message,s}finally{o.value=!1}},lireEmployes:async(r,a=4370)=>{o.value=!0,t.value="";try{return(await n.post("/lireEmployes",{ip:r,port:a})).data}catch(e){throw t.value=e.response?.data?.error||e.message,e}finally{o.value=!1}},supprimerEmploye:async(r,a=4370,e)=>{try{return(await n.post("/supprimerEmploye",{ip:r,port:a,uid:e})).data}catch(s){throw t.value=s.response?.data?.error||s.message,s}},viderPointage:async(r,a=4370)=>{try{return(await n.post("/viderPointage",{ip:r,port:a})).data}catch(e){throw t.value=e.response?.data?.error||e.message,e}}}}export{P as u};
