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