import { defineComponent as v, createElementBlock as E, openBlock as D, createElementVNode as y, unref as _ } from "vue";
import { cloneDeep as o } from "lodash";
import { useCommonChart as S } from "./hooks/useCommonChart.mjs";
/* empty css                       */
/* empty css                       */
import "../../../components/Interaction/components/Tabs/index.mjs";
import "../../../components/Interaction/components/Tabs-icon/index.mjs";
import "../../../components/Interaction/components/Button/index.mjs";
import "../../../components/Interaction/components/DatePicker/index.mjs";
import "../../../components/Interaction/components/DatePickerRange/index.mjs";
import "../../../components/Interaction/components/Switch/index.mjs";
import "../../../components/Interaction/components/Input/index.mjs";
import "../../../components/Interaction/components/Select/index.mjs";
import "../../../components/Interaction/components/Slider/index.mjs";
import "../../../components/Text/components/List/index.mjs";
import "../../../components/Text/components/Text/index.mjs";
import "../../../components/Text/components/TextDynamic/index.mjs";
import "../../../components/Text/components/TableBasic/index.mjs";
import "../../../components/Text/components/TableScroll/index.mjs";
import "../../../components/Text/components/RowScroll/index.mjs";
import "../../../components/Text/components/RealTime/index.mjs";
import "../../../components/Text/components/OverNumber/index.mjs";
import "../../../components/Text/components/CountDown/index.mjs";
import "../../../components/Text/components/TextCarousel/index.mjs";
import "../../../components/Media/components/Audio/index.mjs";
import "../../../components/Media/components/Video/index.mjs";
import "../../../components/Media/components/Carousel/index.mjs";
import "../../../components/Media/components/Flv/index.mjs";
import "../../../components/Media/components/Iframe/index.mjs";
import "../../../components/Media/components/IframeCarousel/index.mjs";
import "../../../components/Media/components/Image/index.mjs";
import "../../../components/Media/components/ImageDynamic/index.mjs";
import "../../../components/Media/components/M3u8/index.mjs";
import "../../../components/Media/components/Wavesurfer/index.mjs";
import "../../../components/Media/components/Weather/index.mjs";
import "../../../components/Media/components/Qrcode/index.mjs";
import "../../../components/Chart/components/bar/basic/index.mjs";
import "../../../components/Chart/components/bar/animation/index.mjs";
import "../../../components/Chart/components/bar/contrast/index.mjs";
import "../../../components/Chart/components/bar/contrast2/index.mjs";
import "../../../components/Chart/components/bar/contrast3/index.mjs";
import "../../../components/Chart/components/bar/gradient-column-chart/index.mjs";
import "../../../components/Chart/components/bar/horizontal/index.mjs";
import "../../../components/Chart/components/bar/horizontal-stack/index.mjs";
import "../../../components/Chart/components/bar/line-bar/index.mjs";
import "../../../components/Chart/components/bar/line-bar2/index.mjs";
import "../../../components/Chart/components/bar/loop/index.mjs";
import "../../../components/Chart/components/bar/mini/index.mjs";
import "../../../components/Chart/components/bar/polar/index.mjs";
import "../../../components/Chart/components/bar/polar-stack/index.mjs";
import "../../../components/Chart/components/bar/polar2/index.mjs";
import "../../../components/Chart/components/bar/radius-circle/index.mjs";
import "../../../components/Chart/components/bar/rank/index.mjs";
import "../../../components/Chart/components/bar/segmented-progress/index.mjs";
import "../../../components/Chart/components/bar/spire/index.mjs";
import "../../../components/Chart/components/bar/stack/index.mjs";
import "../../../components/Chart/components/bar/stack-line/index.mjs";
import "../../../components/Chart/components/bar/stack2/index.mjs";
import "../../../components/Chart/components/bar/stack3/index.mjs";
import "../../../components/Chart/components/bar/staggered/index.mjs";
import "../../../components/Chart/components/bar/three/index.mjs";
import "../../../components/Chart/components/bar/waterfall/index.mjs";
import "../../../components/Chart/components/bar/zebra/index.mjs";
import "../../../components/Chart/components/line/area-gradient/index.mjs";
import "../../../components/Chart/components/line/area-highlight/index.mjs";
import "../../../components/Chart/components/line/area-highlight2/index.mjs";
import "../../../components/Chart/components/line/basic/index.mjs";
import "../../../components/Chart/components/line/bump/index.mjs";
import "../../../components/Chart/components/line/dashed/index.mjs";
import "../../../components/Chart/components/line/ladder/index.mjs";
import "../../../components/Chart/components/line/logarithm/index.mjs";
import "../../../components/Chart/components/line/multix/index.mjs";
import "../../../components/Chart/components/line/polar-double/index.mjs";
import "../../../components/Chart/components/line/rain-flow/index.mjs";
import "../../../components/Chart/components/line/scale/index.mjs";
import "../../../components/Chart/components/line/smooth/index.mjs";
import "../../../components/Chart/components/line/smooth-area/index.mjs";
import "../../../components/Chart/components/line/stack/index.mjs";
import "../../../components/Chart/components/line/stack-area/index.mjs";
import "../../../components/Chart/components/line/temp/index.mjs";
import "../../../components/Chart/components/line/vertical/index.mjs";
import "../../../components/Chart/components/map/basic/index.mjs";
import "../../../components/Chart/components/map/bmap-basic/index.mjs";
import "../../../components/Chart/components/map/bmap-heatmap/index.mjs";
import "../../../components/Chart/components/map/bmap-rich/index.mjs";
import "../../../components/Chart/components/map/customize/index.mjs";
import "../../../components/Chart/components/map/lines/index.mjs";
import "../../../components/Chart/components/map/scatter/index.mjs";
import "../../../components/Chart/components/pie/3d/index.mjs";
import "../../../components/Chart/components/pie/basic/index.mjs";
import "../../../components/Chart/components/pie/basic2/index.mjs";
import "../../../components/Chart/components/pie/customized/index.mjs";
import "../../../components/Chart/components/pie/index/index.mjs";
import "../../../components/Chart/components/pie/interval/index.mjs";
import "../../../components/Chart/components/pie/legend-scroll/index.mjs";
import "../../../components/Chart/components/pie/radius/index.mjs";
import "../../../components/Chart/components/pie/rose/index.mjs";
import "../../../components/Chart/components/pie/round/index.mjs";
import "../../../components/Chart/components/pie/sunburst/index.mjs";
import "../../../components/Chart/components/scatter/basic/index.mjs";
import "../../../components/Chart/components/scatter/basic2/index.mjs";
import "../../../components/Chart/components/scatter/bubble/index.mjs";
import "../../../components/Chart/components/scatter/ripples/index.mjs";
import "../../../components/Chart/components/other/candlestick-basic/index.mjs";
import "../../../components/Chart/components/other/sunburst-basic/index.mjs";
import "../../../components/Chart/components/other/sunburst-basic2/index.mjs";
import "../../../components/Chart/components/other/sunburst-basic3/index.mjs";
import "../../../components/Chart/components/other/sunburst-basic4/index.mjs";
import "../../../components/Chart/components/other/sunburst-book/index.mjs";
import "../../../components/Chart/components/other/sunburst-flavors/index.mjs";
import "../../../components/Chart/components/other/sunburst-radius/index.mjs";
import "../../../components/Chart/components/other/funnel/index.mjs";
import "../../../components/Chart/components/other/funnel-contrast/index.mjs";
import "../../../components/Chart/components/other/funnel-split/index.mjs";
import "../../../components/Chart/components/other/funnel2/index.mjs";
import "../../../components/Chart/components/other/force/index.mjs";
import "../../../components/Chart/components/other/force2/index.mjs";
import "../../../components/Chart/components/other/gauge/index.mjs";
import "../../../components/Chart/components/other/gauge-grade/index.mjs";
import "../../../components/Chart/components/other/gauge-stage/index.mjs";
import "../../../components/Chart/components/other/graph-basic/index.mjs";
import "../../../components/Chart/components/other/graph-basic2/index.mjs";
import "../../../components/Chart/components/other/graph-calendar/index.mjs";
import "../../../components/Chart/components/other/circular-graph/index.mjs";
import "../../../components/Chart/components/other/heatmap/index.mjs";
import "../../../components/Chart/components/other/liquidfill/index.mjs";
import "../../../components/Chart/components/other/parallel-basic/index.mjs";
import "../../../components/Chart/components/other/parallel-mul/index.mjs";
import "../../../components/Chart/components/other/radar-stack/index.mjs";
import "../../../components/Chart/components/other/tree/index.mjs";
import "../../../components/Chart/components/other/tree-line/index.mjs";
import "../../../components/Chart/components/other/word-cloud/index.mjs";
import "../../../components/Chart/components/other/treemap/index.mjs";
import "../../../components/Chart/components/other/treemap-basic/index.mjs";
import "../../../components/Chart/components/other/label-gauge/index.mjs";
import "../../../components/Chart/components/other/grid-percentage/index.mjs";
import "../../../components/Chart/components/other/radar/index.mjs";
import "../../../components/Commons/components/CustomComponentRender/index.mjs";
import "../../../components/Commons/components/Graphical/index.mjs";
import "../../../components/Commons/components/Svg/index.mjs";
import "../../../components/Commons/components/ModelViewer/index.mjs";
import "../../../components/Commons/components/VrVideo/index.mjs";
import "../../../components/Commons/components/VrPhoto/index.mjs";
import "../../../components/Commons/components/Babylon/index.mjs";
import "../../../components/Commons/components/Echarts/index.mjs";
import "../../../components/Commons/components/GSViewer/index.mjs";
import "../../../components/Scene/components/Amap2d/index.mjs";
import "../../../components/Scene/components/Amap3d/index.mjs";
import "../../../components/Scene/components/Default/index.mjs";
import "../../../components/Scene/components/Map2d/index.mjs";
import "../../../components/Scene/components/Map3d/index.mjs";
import "../../../components/Scene/components/UeIframe/index.mjs";
import "../../../components/Scene/components/UeShj/index.mjs";
import "../../../components/Scene/components/UnityIframe/index.mjs";
import "../../../components/Scene/components/UnityWebgl/index.mjs";
import "../../../components/Scene/components/Vr/index.mjs";
import "../../../components/Scene/components/Earth/index.mjs";
import { SHJDatasourceV2 as k } from "../../plugins/datasource/index.mjs";
import { SHJParseEvent as n } from "../../plugins/event/index.mjs";
import { useChart as x } from "./hooks/useChart.mjs";
import { EchartsUtils as m } from "../../utils/echartsUtils.mjs";
const B = { class: "zerov-widget" }, C = ["id"], Li = /* @__PURE__ */ v({
  __name: "index",
  props: {
    option: {},
    sources: {},
    useEvents: {},
    isMultiSeries: { type: Boolean },
    customRenderData: { type: Function },
    isParseScatter: { type: Boolean },
    isParseOther: { type: Boolean }
  },
  emits: [
    "dataListener",
    "chart-click",
    "chart-dblclick",
    "chart-mousedown",
    "chart-mouseover",
    "chart-mouseout",
    "chart-contextmenu"
  ],
  setup(c, { expose: u, emit: l }) {
    const r = c, e = l, { id: h, setOption: p, chart: d, renderChart: s, renderData: a } = x({
      basicOption: o(r.option),
      useEvents: o(r.useEvents),
      customRenderData: (t) => {
        t = o(t), k.parse({
          sources: r.sources,
          callback: ({ data: i }) => {
            try {
              if (e("dataListener", i), n.parseEvents(r.useEvents, "dataListener", i), r.customRenderData) {
                r.customRenderData(t, i, p);
                return;
              }
              if (r.isParseOther) {
                p(m.parseOtherData(i, t));
                return;
              }
              r.isParseScatter ? t.dataset = m.parseScatterData(o(i)) : t.dataset = m.parseDataset(o(i)), t.series.every(
                (f) => f.type === t.series[0].type
              ) && (r.isMultiSeries ? (t.series = [o(t.series[0])], t.series = m.cloneSeries(i, t.series), r.option.series = [o(r.option.series[0])]) : r.option.series = m.cloneSeries(
                i,
                t.series
              )), p(t);
            } catch {
              e("dataListener", null), n.parseEvents(r.useEvents, "dataListener", null), p(t);
            }
          }
        });
      },
      emits: e
    });
    return S(r, a, s), u({
      getEchartsInstance: () => d.value,
      refresh: () => {
        a(r.option), s(r.option);
      },
      refreshView: () => {
        s(r.option);
      },
      refreshData: () => {
        a(r.option);
      }
    }), (t, i) => (D(), E("div", B, [
      y("div", {
        id: _(h),
        class: "widget"
      }, null, 8, C)
    ]));
  }
});
export {
  Li as default
};
