"use strict";
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
require("../../../../../../node_modules/.pnpm/vue@3.3.4/node_modules/vue/dist/vue.runtime.esm-bundler.js");
const chartEditStore = require("../../../../../store/modules/chartEditStore/chartEditStore.js");
require("../../../../../store/modules/designStore/designStore.js");
require("../../../../../settings/designSetting.js");
require("../../../../../../node_modules/.pnpm/screenfull@6.0.2/node_modules/screenfull/index.js");
require("../../../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_root.js");
require("../../../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseGetTag.js");
require("../../../../../../node_modules/.pnpm/html2canvas@1.4.1/node_modules/html2canvas/dist/html2canvas.esm.js");
require("../../../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseClone.js");
const eventEnum = require("../../../../../enums/eventEnum.js");
require("../../../../../../node_modules/.pnpm/crypto-js@4.1.1/node_modules/crypto-js/index.js");
require("../../../../../enums/pageEnum.js");
require("../../../../../router/index.js");
require("../../../../../../node_modules/.pnpm/vue3-lazyload@0.2.5-beta_a6dezdz3je235ci4e3tu4rayna/node_modules/vue3-lazyload/dist/vue3-lazyload.esm.js");
require("../../../../../components/GoSkeleton/index.vue.js");
require("../../../../../components/GoLoading/index.js");
require("../../../../../api/axios.js");
require("../../../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/merge.js");
require("../../../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/pick.js");
require("../../../../../../node_modules/.pnpm/echarts@5.4.3/node_modules/echarts/index.js");
require("../../../../../store/modules/langStore/langStore.js");
const useChartInteract_hook = require("../../../../../hooks/useChartInteract.hook.js");
const interact = require("./interact.js");
const runtimeCore_esmBundler = require("../../../../../../node_modules/.pnpm/@vue_runtime-core@3.3.4/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js");
const reactivity_esmBundler = require("../../../../../../node_modules/.pnpm/@vue_reactivity@3.3.4/node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js");
const shared_esmBundler = require("../../../../../../node_modules/.pnpm/@vue_shared@3.3.4/node_modules/@vue/shared/dist/shared.esm-bundler.js");
const _sfc_main = /* @__PURE__ */ runtimeCore_esmBundler.defineComponent({
  __name: "index",
  props: {
    chartConfig: {
      type: Object,
      required: true
    }
  },
  setup(__props) {
    const props = __props;
    const { w, h } = reactivity_esmBundler.toRefs(props.chartConfig.attr);
    const option = reactivity_esmBundler.shallowReactive({
      value: {
        pageValue: props.chartConfig.option.pageValue,
        dataset: props.chartConfig.option.dataset,
        sizeValue: props.chartConfig.option.sizeValue,
        pageSize: props.chartConfig.option.pageSize
      }
    });
    const onChange = (v, v2) => {
      if (v == void 0)
        return;
      useChartInteract_hook.useChartInteract(
        props.chartConfig,
        chartEditStore.useChartEditStore,
        {
          [interact.ComponentInteractParamsEnum.DATA]: v,
          [interact.ComponentInteractParamsEnum.DATA2]: v2
        },
        eventEnum.InteractEventOn.CHANGE
      );
    };
    runtimeCore_esmBundler.watch(
      () => props.chartConfig.option,
      (newData) => {
        option.value = newData;
        onChange(newData.pageValue, newData.pageSize);
      },
      {
        immediate: true,
        deep: true
      }
    );
    return (_ctx, _cache) => {
      const _component_n_pagination = runtimeCore_esmBundler.resolveComponent("n-pagination");
      return runtimeCore_esmBundler.openBlock(), runtimeCore_esmBundler.createElementBlock("div", null, [
        runtimeCore_esmBundler.createVNode(_component_n_pagination, {
          "onOnUpdate:page": onChange,
          style: shared_esmBundler.normalizeStyle(`width:${reactivity_esmBundler.unref(w)}px;`),
          page: reactivity_esmBundler.unref(option).value.pageValue,
          "onUpdate:page": _cache[0] || (_cache[0] = ($event) => reactivity_esmBundler.unref(option).value.pageValue = $event),
          "page-count": reactivity_esmBundler.unref(option).value.dataset,
          "page-slot": 7,
          "show-size-picker": "",
          "page-sizes": reactivity_esmBundler.unref(option).value.sizeValue,
          "page-size": reactivity_esmBundler.unref(option).value.pageSize,
          "onUpdate:pageSize": _cache[1] || (_cache[1] = ($event) => reactivity_esmBundler.unref(option).value.pageSize = $event)
        }, null, 8, ["style", "page", "page-count", "page-sizes", "page-size"])
      ]);
    };
  }
});
exports.default = _sfc_main;
