import{W as c}from"./WidgetChart-CQnj_aQq.js";import{b as m,k as p,y as f}from"./vue-core-Di3IuVqe.js";import"./WidgetCard-CLnTgmXL.js";import"./primevue-CfIk0_DY.js";import"./index-BxIwIJfy.js";import"./cjs-helpers-psZwOBky.js";import"./vue-cal-DKMVGERa.js";import"./moment-BeHQNF8T.js";const S={__name:"WidgetDelaiPaiementEcheancier30j",props:{data:{type:[Array,Object,null],default:null},loading:{type:Boolean,default:!1},error:{type:String,default:""},editing:{type:Boolean,default:!1}},emits:["refresh","remove"],setup(t){const n=t,l=f(()=>{const r=Array.isArray(n.data)?n.data:[],e=["Sem 1","Sem 2","Sem 3","Sem 4"],a=[0,0,0,0],s=[0,0,0,0];for(const i of r){const o=Number(i.semaine)-1;o>=0&&o<4&&(a[o]=i.a_payer||0,s[o]=i.a_recevoir||0)}return{labels:e,datasets:[{label:"À payer (frs)",data:a,backgroundColor:"#ef4444",borderWidth:0},{label:"À recevoir (clients)",data:s,backgroundColor:"#10b981",borderWidth:0}]}}),d={plugins:{legend:{position:"top",labels:{font:{size:10},boxWidth:12}}},scales:{x:{grid:{display:!1},ticks:{font:{size:10}}},y:{beginAtZero:!0,ticks:{font:{size:10}}}}};return(r,e)=>(m(),p(c,{title:"Échéancier 4 semaines",icon:"pi pi-calendar",type:"bar","chart-data":l.value,options:d,loading:t.loading,error:t.error,editing:t.editing,onRefresh:e[0]||(e[0]=a=>r.$emit("refresh")),onRemove:e[1]||(e[1]=a=>r.$emit("remove"))},null,8,["chart-data","loading","error","editing"]))}};export{S as default};
