import{b as p}from"./primevue-CfIk0_DY.js";import{u as d,S as o,b as c,s}from"./index-BxIwIJfy.js";import{o as m,b as f,c as v,d as r,v as _,a7 as b,E as g}from"./vue-core-Di3IuVqe.js";import"./cjs-helpers-psZwOBky.js";import"./vue-cal-DKMVGERa.js";import"./moment-BeHQNF8T.js";const y={class:"btns flex items-center gap-2"},E={__name:"ouvertureAnnee",setup(j){const{showError:i,showWarn:n}=d(),t=g({lecture:!1,ajout:!1,modif:!1,supp:!1,devalidation:!1,validation:!1}),l=async()=>{try{const e=(await c.post(`${s.lienApi}/verifierDroit/${s.state.dbCommun6}`,{id_utilisateur:s.userId,id_page:110,mail:s.state.userCloud.mail},{headers:{"Content-Type":"application/json"}})).data;e&&Object.keys(e).length>0&&(t.lecture=e.lecture,t.ajout=e.ajout,t.modif=e.modif,t.supp=e.supp,t.devalidation=e.devalidation,t.validation=e.validation),t.lecture||(n("Vous n'avez pas le droit, veuillez consulter l'administrateur"),o("ouvertureAnnee"))}catch(a){i("Une erreur est survenue : "+(a.response?.data?.message||a.message))}finally{s.state.afficher_in_progress=!1}};return m(async()=>{await l()}),(a,e)=>{const u=p;return f(),v("div",null,[r("div",y,[_(u,{icon:"pi pi-times",label:"Fermer",text:"",onClick:e[0]||(e[0]=x=>b(o)("ouvertureAnnee"))})]),e[1]||(e[1]=r("div",null,"Ouverture de l'année..",-1))])}}};export{E as default};
