import{t as g}from"./debounce-Xd493GvO.js";import{a as x}from"./echarts_auto_tooltip-BNPm6hqZ.js";import{r as y}from"./request-CEvu378m.js";import{ar as _}from"./echarts-DB130vfq.js";import{s as K,r as p,ax as j,c as b,w as c,j as z,n as I,X as L,S as O,B as k,z as B}from"./vue-BJk78QHK.js";import"./index-M_JNBppB.js";import"./element-3_pOinej.js";import"./utils-YI6ye1sf.js";import"./threejs-BafxXW5-.js";import"./vxe-Dx3zSILm.js";const M=Object.assign({name:"Funnel"},{__name:"Funnel",props:{propValue:{type:Object,default:()=>({})},request:{type:Object,default:()=>({})},element:{type:Object,default:()=>({})}},setup(q){var d,m;const e=q,t=K(null),f=p(null),l=p(null),a=p(null),u=j(),n=b(()=>e.propValue),w=b(()=>{const o=e.element.style.width,r=e.element.style.height;return{width:o,height:r}});function v(){t.value&&(t.value.clear(),t.value.setOption(n.value,!0),a.value&&(a.value.clearLoop(),a.value=null),e.propValue.autoPlay&&(a.value=x(t.value,n.value,{interval:e.propValue.autoPlayTime*1e3,loopSeries:e.propValue.loopSeries,seriesIndex:Number.parseInt(e.propValue.seriesIndex)})))}function i(){t.value&&t.value.resize()}return c(w,g(o=>{i()},500),{deep:!0}),c(n,g(o=>{v()},500),{deep:!0}),z(()=>{t.value=_(f.value,"vintage"),I(()=>{v()}),window.addEventListener("resize",i)}),L(()=>{e.propValue.request&&l.value&&l.value(),a.value&&(a.value.clearLoop(),a.value=null)}),O(()=>{window.removeEventListener("resize",i),t.value&&(t.value.clear(),t.value.dispose(),t.value=null)}),e.request&&(l.value=y(e.request,e.propValue.series[0],"data")),((m=(d=e.request)==null?void 0:d.global)==null?void 0:m.length)>0&&c(()=>u.state.globalKey,()=>{e.request.global.forEach(o=>{const r=u.state.globalKey.findIndex(s=>s.globalKey===o);if(r>-1){const s=[u.state.globalKey[r].globalKey,u.state.globalKey[r].globalValue],h=e.request.data.findIndex(V=>V[0]===s[0]);h>-1?e.request.data[h][1]=s[1]:e.request.data.push(s)}}),l.value&&l.value(),l.value=y(e.request,e.propValue.series[0],"data")},{deep:!0}),(o,r)=>(B(),k("div",{ref_key:"chartRef",ref:f,style:{width:"100%",height:"100%"}},null,512))}});export{M as default};
