import "../../../../../../node_modules/.pnpm/vue@3.3.4/node_modules/vue/dist/vue.runtime.esm-bundler.mjs";
import cloneDeep from "../../../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/cloneDeep.mjs";
import { useChartEditStore } from "../../../../../store/modules/chartEditStore/chartEditStore.mjs";
import "../../../../../store/modules/designStore/designStore.mjs";
import "../../../../../settings/designSetting.mjs";
import "../../../../../../node_modules/.pnpm/screenfull@6.0.2/node_modules/screenfull/index.mjs";
import "../../../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_root.mjs";
import "../../../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseGetTag.mjs";
import "../../../../../../node_modules/.pnpm/html2canvas@1.4.1/node_modules/html2canvas/dist/html2canvas.esm.mjs";
import { InteractEventOn } from "../../../../../enums/eventEnum.mjs";
import "../../../../../../node_modules/.pnpm/crypto-js@4.1.1/node_modules/crypto-js/index.mjs";
import "../../../../../enums/pageEnum.mjs";
import "../../../../../router/index.mjs";
import "../../../../../../node_modules/.pnpm/vue3-lazyload@0.2.5-beta_a6dezdz3je235ci4e3tu4rayna/node_modules/vue3-lazyload/dist/vue3-lazyload.esm.mjs";
import "../../../../../components/GoSkeleton/index.vue.mjs";
import "../../../../../components/GoLoading/index.mjs";
import "../../../../../api/axios.mjs";
import "../../../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/merge.mjs";
import "../../../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/pick.mjs";
import "../../../../../../node_modules/.pnpm/echarts@5.4.3/node_modules/echarts/index.mjs";
import "../../../../../store/modules/langStore/langStore.mjs";
import { useChartInteract } from "../../../../../hooks/useChartInteract.hook.mjs";
import { ComponentInteractParamsEnum } from "./interact.mjs";
import { defineComponent, watch, resolveComponent, openBlock, createBlock, withCtx, createElementBlock, Fragment, renderList, createTextVNode } from "../../../../../../node_modules/.pnpm/@vue_runtime-core@3.3.4/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.mjs";
import { toRefs, shallowReactive, unref } from "../../../../../../node_modules/.pnpm/@vue_reactivity@3.3.4/node_modules/@vue/reactivity/dist/reactivity.esm-bundler.mjs";
import { toDisplayString } from "../../../../../../node_modules/.pnpm/@vue_shared@3.3.4/node_modules/@vue/shared/dist/shared.esm-bundler.mjs";
const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "index",
  props: {
    chartConfig: {
      type: Object,
      required: true
    }
  },
  setup(__props) {
    const props = __props;
    toRefs(props.chartConfig.attr);
    const option = shallowReactive({
      value: cloneDeep(props.chartConfig.option)
    });
    const onChange = (v) => {
      if (v === void 0)
        return;
      const selectItem = option.value.dataset.find((item) => item.label === v);
      useChartInteract(
        props.chartConfig,
        useChartEditStore,
        { [ComponentInteractParamsEnum.DATA]: selectItem.value },
        InteractEventOn.CHANGE
      );
    };
    watch(
      () => props.chartConfig.option,
      (newData) => {
        option.value = newData;
        onChange(newData.tabValue);
      },
      {
        immediate: true,
        deep: true
      }
    );
    return (_ctx, _cache) => {
      const _component_n_tab = resolveComponent("n-tab");
      const _component_n_tabs = resolveComponent("n-tabs");
      return openBlock(), createBlock(_component_n_tabs, {
        type: unref(option).value.tabType,
        "onUpdate:value": onChange,
        "default-value": unref(option).value.tabLabel
      }, {
        default: withCtx(() => [
          (openBlock(true), createElementBlock(Fragment, null, renderList(unref(option).value.dataset, (item, index) => {
            return openBlock(), createBlock(_component_n_tab, {
              name: item.label,
              key: index
            }, {
              default: withCtx(() => [
                createTextVNode(toDisplayString(item.label), 1)
              ]),
              _: 2
            }, 1032, ["name"]);
          }), 128))
        ]),
        _: 1
      }, 8, ["type", "default-value"]);
    };
  }
});
export {
  _sfc_main as default
};
