"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("vue");require("echarts-gl");const c=require("lodash"),m=require("./renderPie3d.js"),_=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"],g=s.defineComponent({name:"zv-chart-pie-3d"}),D=s.defineComponent({...g,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:a,chart:f,renderChart:n,renderData:o}=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:({data:r})=>{try{u.SHJParseEvent.parseEvents(e.useEvents,"dataListener",r);const i=m.getPie3D(r[0].data,t);a(i,"canvas")}catch{u.SHJParseEvent.parseEvents(e.useEvents,"dataListener",null),a(t)}}})},emit:h});return s.watch(()=>e.sources,()=>{e.sources&&e.sources.length>0&&o(e.basicOption)},{deep:!0}),s.watch(()=>c.cloneDeep(e.basicOption),(t,r)=>{c.isEqual(t,r)||n(t)},{deep:!0}),l({getEchartsInstance:()=>f.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,r)=>(s.openBlock(),s.createElementBlock("div",E,[s.createElementVNode("div",{id:s.unref(v),class:"widget"},null,8,O)]))}});exports.default=D;
