import{m as n,h as r}from"./index-Au1XOH8d.js";const m=n("user",()=>{const o=r(JSON.parse(localStorage.getItem("user")||"null")),t=r(localStorage.getItem("token")||"");function s(e,l){t.value=e,o.value=l,localStorage.setItem("token",e),localStorage.setItem("user",JSON.stringify(l))}function a(){t.value="",o.value=null,localStorage.removeItem("token"),localStorage.removeItem("user")}return{user:o,token:t,setLogin:s,logout:a,isLoggedIn:()=>!!t.value,getRole:()=>{var e;return((e=o.value)==null?void 0:e.role)||""}}});export{m as u};
