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