import{a0 as e}from"./common.js?v=1753954525509";import"./interface.js?v=1753954525509";import{bR as t}from"./naive.js?v=1753954525509";import{k as a,r as s,w as n,n as i,an as o,o as r,b as l,U as u,V as m,I as p,X as d}from"./vue.js?v=1753954525509";import{a4 as c}from"./echarts.js?v=1753954525509";import"./__commonjsHelpers__.js?v=1753954525509";const f=a({__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(a,{expose:f}){const v=a,h=s(null);let w=!0;function y(){var e;null!==h.value&&(null==(e=c.getInstanceByDom(h.value))||e.resize())}n((()=>v.option),(t=>{t&&i((()=>{!async function(){if(w){const{data:t}=await e.get("/static/vite/data/world.json");c.registerMap("world",t),w=!1}if(null===h.value)return;let t=c.getInstanceByDom(h.value);null==t&&(t=c.init(h.value)),t.setOption(v.option,!0)}()}))}),{immediate:!0,deep:!0});const g=o(y,300,{maxWait:800});return r((async()=>{window.addEventListener("resize",g)})),l((()=>{var e;h.value&&(null==(e=c.getInstanceByDom(h.value))||e.dispose(),window.removeEventListener("resize",g))})),f({resize:y}),(e,s)=>(u(),m("div",{ref_key:"chartRef",ref:h,style:p({width:d(t)(a.width),height:d(t)(a.height)})},null,4))}});export{f as default};
