import{ref as a}from"vue";import{defineStore as e}from"pinia";import{b as t,k as o}from"./server.mjs";const r=e("career",(()=>{const{locale:e}=t(),{$axios:r}=o(),s=a({}),n=a(!1),i=a(!0),c=a(!1);let p=a();const u=a(!1),l=a([]);let v=a(),m=a(1),d=a();return{errors:s,isLoading:n,pendingState:u,isLoading2:i,getContact:async function(a,t,o,i){n.value=!0;try{let i=new FormData;if(i.append("name",a.name),i.append("phone",`+966${a.phone}`),i.append("email",a.email),i.append("cv",a.cv),(await r.post(`career/store/${o}`,i)).status>=200){n.value=!1,s.value=void 0,p.value=!1;const a=await import("mosha-vue-toastify"),{createToast:o}=a;o("ar"==e.value?"تم التواصل بنجاح ":"Communication was successful",{toastBackgroundColor:"#00A0B4",position:"top-right",type:"success",transition:"bounce",showIcon:"true",timeout:3e3}),t({values:{email:"",name:"",cv:"",phone:""},errors:{}})}}catch(a){a.response&&(n.value=!1,s.value=a.response.data.errors)}},careers:l,total:v,isLoading3:c,per_page:d,page:m,active:p,getCareer:async function(a){c.value=!0;try{const e=await r.get("career",{params:{page:a}});e.status>=200&&(i.value=!1,l.value=[...l.value,...e.data.data],v.value=e.data.meta.total,d.value=e.data.meta.per_page,c.value=!1)}catch(a){a.response&&(i.value=!1)}}}}));export{r as F};
