"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("vue"),c=require("lodash"),_=require("../../commons/plugins/datasource/index.js"),b=require("../../commons/core/useChart.js"),u=require("../../commons/plugins/event/index.js"),E={class:"zerov-widget"},O=["id"],D=s.defineComponent({name:"zv-chart-map-lines"}),g=s.defineComponent({...D,props:{basicOption:{},sources:{},useEvents:{},uuid:{}},emits:["chart-click","chart-dblclick","chart-mousedown","chart-mouseover","chart-mouseout","chart-contextmenu"],setup(d,{expose:l,emit:p}){const e=d,h=p,{id:v,setOption:o,chart:m,renderChart:a,renderData:n}=b.useChart({basicOption:c.cloneDeep(e.basicOption),useEvents:c.cloneDeep(e.useEvents),customRenderData:t=>{t=c.cloneDeep(t),_.SHJDatasourceV2.parse({tId:e.uuid,sources:e.sources,callback:r=>{try{u.SHJParseEvent.parseEvents(e.useEvents,"dataListener",r.data);const i=t.series.find(f=>f._sourceId===r.id);i&&(i.data=r.data[0].data),o(t)}catch{u.SHJParseEvent.parseEvents(e.useEvents,"dataListener",null),o(t)}}})},emit:h});return s.watch(()=>e.sources,()=>{n(e.basicOption)},{deep:!0}),s.watch(()=>c.cloneDeep(e.basicOption),(t,r)=>{c.isEqual(t,r)||a(t)},{deep:!0}),l({getEchartsInstance:()=>m.value,refresh:()=>{e.sources&&e.sources.length>0&&a(e.basicOption),n(e.basicOption)},refreshView:()=>{e.sources&&e.sources.length>0&&a(e.basicOption)},refreshData:()=>{n(e.basicOption)}}),(t,r)=>(s.openBlock(),s.createElementBlock("div",E,[s.createElementVNode("div",{id:s.unref(v),class:"widget"},null,8,O)]))}});exports.default=g;
