"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("vue"),r=require("lodash"),v=require("../../core/useChart.js"),m={class:"zerov-widget"},_=["id"],b=s.defineComponent({name:"zv-chart-other-word-cloud"}),f=s.defineComponent({...b,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:o}=v.useChart({basicOption:r.cloneDeep(e.basicOption),useEvents:r.cloneDeep(e.useEvents),customRenderData:t=>{t=r.cloneDeep(t),window.SHJDatasourceV2({tId:e.uuid,sources:e.sources,callback:({data:a})=>{try{window.SHJParseEvent(e.useEvents,"dataListener",a),t.series[0].data=r.cloneDeep(a[0].data),i(t)}catch{window.SHJParseEvent(e.useEvents,"dataListener",null),i(t)}}})},emit:h});return s.watch(()=>e.sources,()=>{o(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),o(e.basicOption)},refreshView:()=>{e.sources&&e.sources.length>0&&n(e.basicOption)},refreshData:()=>{o(e.basicOption)}}),(t,a)=>(s.openBlock(),s.createElementBlock("div",m,[s.createElementVNode("div",{id:s.unref(p),class:"widget"},null,8,_)]))}});exports.default=f;
