import{e as a,u as c,a as d,b as h,c as p,d as g,f as v,g as y,h as $,n as b,o as w,k as B,l as x,m as z}from"./echarts-DiepRh70.js?v=1773287522785";import{f as o}from"./naive-ui--dJnpVcV.js?v=1773287522785";import{k,r as C,w as D,o as L,n as u,b as S,$ as I,Z as E,H as R,S as m}from"./vue-core-DJjvd5ZC.js?v=1773287522785";import{b1 as _}from"./index-BTglIPU2.js?v=1773287522785";import"./prismjs-BZPoR7_J.js?v=1773287522785";c([d,h,p,g,v,y,$,b,w,B,x,z]);const q=k({__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,{expose:f}){const s=n,t=C(null);function i(){if(t.value===null)return;let e=a.getInstanceByDom(t.value);e==null&&(e=a.init(t.value)),e.setOption(s.option,!0)}function l(){var e;t.value!==null&&((e=a.getInstanceByDom(t.value))==null||e.resize())}D(()=>s.option,e=>{e&&u(()=>{i()})},{immediate:!0,deep:!0});const r=_(l,300,{maxWait:800});return L(()=>{u(()=>{i(),window.addEventListener("resize",r)})}),S(()=>{var e;t.value&&((e=a.getInstanceByDom(t.value))==null||e.dispose(),window.removeEventListener("resize",r))}),f({resize:l,getChart:()=>a.getInstanceByDom(t.value)}),(e,N)=>(I(),E("div",{ref_key:"chartRef",ref:t,style:R({width:m(o)(n.width),height:m(o)(n.height)})},null,4))}});export{q as default};
