var c=(t,o,e)=>new Promise((r,n)=>{var u=s=>{try{i(e.next(s))}catch(m){n(m)}},a=s=>{try{i(e.throw(s))}catch(m){n(m)}},i=s=>s.done?r(s.value):Promise.resolve(s.value).then(u,a);i((e=e.apply(t,o)).next())});import{u as y}from"./useQuery-DGaD2i6Y.js";import{a as f}from"./master-services-BAYa7sWP.js";const M=(t,o=10)=>{const{isPending:e,data:r,isError:n,error:u}=y({queryKey:["getMasters",t,o],queryFn:()=>c(null,null,function*(){const a=yield f(t,o);if(a.status===200)return a.data;throw new Error("Error fetching")})});return{isPending:e,masters:(r==null?void 0:r.masters)||[],totalItems:(r==null?void 0:r.total)||0,isError:n,error:u}};export{M as u};
