import{e as a,u as m,i as c,a as d,b as h,c as p,d as v,f as g,g as y,h as $,j as b,k as w,l as B,m as k}from"./echarts-DiepRh70.js?v=1773287522785";import{f as r}from"./naive-ui--dJnpVcV.js?v=1773287522785";import{k as x,r as z,w as L,o as S,n as o,b as C,$ as D,Z as _,H as E,S as u}from"./vue-core-DJjvd5ZC.js?v=1773287522785";import{b1 as I}from"./index-BTglIPU2.js?v=1773287522785";m([c,d,h,p,v,g,y,$,b,w,B,k]);const U=x({__name:"index",props:{width:{type:[Number,String],default:"100%"},height:{type:[Number,String],default:"200px"},dataZoom:{type:Boolean,default:!1},option:{type:Object,required:!0}},setup(n){const i=n,t=z(null);function s(){if(t.value===null)return;let e=a.getInstanceByDom(t.value);e==null&&(e=a.init(t.value)),e.setOption(i.option,!0)}function f(){var e;t.value!==null&&((e=a.getInstanceByDom(t.value))==null||e.resize())}L(()=>i.option,e=>{e&&o(()=>{s()})},{immediate:!0,deep:!0});const l=I(f,300,{maxWait:800});return S(()=>{o(()=>{s(),window.addEventListener("resize",l)})}),C(()=>{var e;t.value&&((e=a.getInstanceByDom(t.value))==null||e.dispose(),window.removeEventListener("resize",l))}),(e,R)=>(D(),_("div",{ref_key:"chartRef",ref:t,style:E({width:u(r)(n.width),height:u(r)(n.height)})},null,4))}});export{U as _};
