import{r as M,d as C,a as v,u as h,L as p,c as b,b as _,H as E,e as u,w as l,f as o,n as f,Q as D,l as S,t as w,g as y,h as N,j as $,F as I,k,A as F,K as Q,q as U,s as A,o as T,B as V,ai as z}from"./index-OSKNspXo.js";import{_ as P}from"./deenovaListComponent-_TZ3FQzO.js";import"./QPageSticky-CCfAiVse.js";/* empty css                                                            */import{u as R}from"./accedStore-DNY_Z4CG.js";import{_ as j}from"./loadingComponent-FlFZMTxk.js";import"./deenovaLayoutListComponent-t63hrAmm.js";import"./use-page-sticky-BHWvjlS4.js";import"./QInnerLoading-DoPJsn3N.js";class q{async getMessage(a){return(await M.get(`/api/acced/message/${a}`)).data.data}async upload(a){let s=new FormData;return s.append("file",a),(await M.post("/api/acced/message/importdefault",s,{headers:{"Content-Type":"multipart/form-data"}})).data.data}}const x=C("AccedFeasiblityStore",()=>{const t=new q,a=v([]),s=v(null),n=v(!1);async function r(){try{n.value=!0,a.value=await t.getMessage(s.value)}finally{n.value=!1}}return{current_mag:s,service:t,list:a,isLoading:n,getAll:r}}),G={"acced.messages.list.title":"List of pending messages","acced.messages.browser.title":"MEDIAN - Pending messages","acced.messages.total":"No pending message | 1 pending message | {count} pending messages"},H={},K={},O={"acced.messages.list.title":"Liste des messages en attente","acced.messages.browser.title":"MEDIAN - Messages en attente","acced.messages.total":"Aucun message en attente | 1 message en attente | {count} messages en attente"},J={},W={},X={class:"row"},Y={__name:"messageItemComponent",props:{item:{type:Object}},setup(t){const{t:a,d:s}=h({useScope:"parent"}),n=t,r=p(),d=[3,2,1],i=b(()=>{var c;return(c=r.state.global.connectedUser)==null?void 0:c.lang.replaceAll("_","-")});function g(c){let m="";return c<=n.item.lvl&&(m=n.item.lvl>2?"negative":"warning"),m}return(c,m)=>t.item?(u(),_(U,{key:0,class:Q(t.item.default===1?"text-negative":"")},{default:l(()=>[o(f,{avatar:""},{default:l(()=>[o(D,{name:t.item.default===1?"warning_amber":"info",color:t.item.default===1?"negative":"info",size:"2rem"},null,8,["name","color"])]),_:1}),o(f,null,{default:l(()=>[S(w(y(s)(new Date(t.item.date),"all",i.value)),1)]),_:1}),o(f,null,{default:l(()=>[S(w(`${t.item.num_default} : ${t.item.label}`),1)]),_:1}),o(f,{side:""},{default:l(()=>[N("div",X,[(u(),$(I,null,k(d,e=>o(D,{name:"build",n:e,size:"1.5rem",color:g(e)},{default:l(()=>[o(F,null,{default:l(()=>[S(w(e),1)]),_:2},1024)]),_:2},1032,["n","color"])),64))])]),_:1})]),_:1},8,["class"])):E("",!0)}},Z={__name:"accedMessagesListComponent",setup(t){const{t:a}=h({useScope:"parent"}),s=p(),n=x(),r=R(),{title:d,actions:i,subActions:g}=A(r);p(),b(()=>{var e;return(e=s.state.global.connectedUser)==null?void 0:e.lang.replaceAll("_","-")});const{list:c,isLoading:m}=A(n);return T(()=>{d.value=a("acced.dashboard.message.title"),i.value=[],g.value=[]}),(e,B)=>y(m)?(u(),_(j,{key:1})):(u(),_(V,{key:0,separator:"",bordered:""},{default:l(()=>[(u(!0),$(I,null,k(y(c),L=>(u(),_(Y,{item:L,key:L},null,8,["item"]))),128))]),_:1}))}},ee={},te={class:"h-100 w-100"},ue={__name:"accedMessagesComponent",props:{id:{type:String}},setup(t){const a=t,{t:s,d:n}=h({messages:{en_GB:G,en_US:H,es_ES:K,fr_FR:O,it_IT:J,pl_PL:W,de_DE:ee}}),r=p(),d=x(),i=p();b(()=>{var e;return(e=r.state.global.connectedUser)==null?void 0:e.lang.replaceAll("_","-")});const{current_mag:g,list:c}=A(d),m=b(()=>i.state.global.stores.find(e=>e.type_mag===a.id));return z(),T(async()=>{var e;await i.dispatch("global/getDocumentTitle",s("acced.messages.browser.title")),await i.dispatch("global/screenTitle",{title:`${(e=m.value)==null?void 0:e.libelle} - ${s("menu.acced.messages.title")}`,name:"Messages"}),g.value=a.id,await d.getAll()}),(e,B)=>(u(),$("div",te,[o(P,null,{list:l(()=>[o(Z)]),_:1})]))}};export{ue as default};
//# sourceMappingURL=accedMessagesComponent-BYxM9vBq.js.map
