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