import{W as l}from"./WidgetChart-CQnj_aQq.js";import{b as d,k as p,y as m}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 v={__name:"WidgetStockValorisationParDepot",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(a){const o=a,i=["#0ea5e9","#6366f1","#10b981","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#84cc16"],n=m(()=>{const t=Array.isArray(o.data)?o.data:[];return{labels:t.map(e=>e.depot||"Sans dépôt"),datasets:[{label:"Valeur",data:t.map(e=>e.montant||0),backgroundColor:t.map((e,r)=>i[r%i.length]),borderWidth:0}]}}),s={plugins:{legend:{display:!1}},scales:{x:{grid:{display:!1},ticks:{font:{size:10}}},y:{beginAtZero:!0,ticks:{font:{size:10}}}}};return(t,e)=>(d(),p(l,{title:"Valeur stock par dépôt",icon:"pi pi-warehouse",type:"bar","chart-data":n.value,options:s,loading:a.loading,error:a.error,editing:a.editing,onRefresh:e[0]||(e[0]=r=>t.$emit("refresh")),onRemove:e[1]||(e[1]=r=>t.$emit("remove"))},null,8,["chart-data","loading","error","editing"]))}};export{v as default};
