import{W as p}from"./WidgetChart-CQnj_aQq.js";import{s as c}from"./index-BxIwIJfy.js";import{b as m,k as f,y as u}from"./vue-core-Di3IuVqe.js";import"./WidgetCard-CLnTgmXL.js";import"./primevue-CfIk0_DY.js";import"./cjs-helpers-psZwOBky.js";import"./vue-cal-DKMVGERa.js";import"./moment-BeHQNF8T.js";const S={__name:"WidgetParcComparatifInterventions",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 s=t,n=["Janv","Févr","Mars","Avr","Mai","Juin","Juil","Août","Sept","Oct","Nov","Déc"],l=u(()=>{const r=Array.isArray(s.data)?s.data:[],e={};for(const o of r)e[Number(o.mois)]=o;const a=parseInt(c.state.annee_fiscale)||new Date().getFullYear();return{labels:n,datasets:[{label:String(a),data:n.map((o,i)=>e[i+1]?.annee_n||0),borderColor:"#10b981",backgroundColor:"#10b98133",tension:.3},{label:String(a-1),data:n.map((o,i)=>e[i+1]?.annee_p||0),borderColor:"#9ca3af",backgroundColor:"#9ca3af33",tension:.3}]}}),d={scales:{x:{grid:{display:!1},ticks:{font:{size:10}}},y:{beginAtZero:!0,ticks:{font:{size:10},precision:0}}}};return(r,e)=>(m(),f(p,{title:"Interventions N / N-1",icon:"pi pi-wrench",type:"line","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};
