import{aZ as e,c1 as a,ac as s,aV as t,b1 as r,A as o,x as n,aQ as i,z as d,ba as l,u as p}from"./vendor.js?ver=3.0.6";import{_ as c}from"./fc-bits-ui.js?ver=3.0.6";const h={class:"echart-container-wrapper"},u={key:0,class:"fcrm-chart-placeholder"};const v=c({name:"FreshChart",props:{options:{type:Object,default:null},height:{type:[Number,String],default:400}},setup(r){const o=l(null);let n=null;const i=p(()=>!!r.options&&(!!Array.isArray(r.options.series)&&r.options.series.some(e=>Array.isArray(e.data)&&e.data.length>0))),d=()=>{n&&n.resize()};return e(()=>{o.value&&(n=s(o.value),n.setOption(r.options||{},!0),window.addEventListener("resize",d))}),a(()=>r.options,e=>{o.value&&(n||(n=s(o.value),window.addEventListener("resize",d)),e&&n.setOption(e,!0))},{deep:!0}),t(()=>{n&&(window.removeEventListener("resize",d),n.dispose())}),{chartRef:o,hasData:i}}},[["render",function(e,a,s,t,l,p){return r(),o("div",h,[n("div",{ref:"chartRef",class:"chart-container",style:i("height:"+s.height+"px;")},null,4),t.hasData?d("",!0):(r(),o("div",u," Chart placeholder (ECharts not loaded or data is empty) "))])}],["__scopeId","data-v-5d01edb6"]]);export{v as E};