import "../../../../../../node_modules/.pnpm/vue@3.3.4/node_modules/vue/dist/vue.runtime.esm-bundler.mjs";
import { requireErrorImg } from "../../../../../utils/utils.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 "../../../../../store/modules/designStore/designStore.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 "../../../../../settings/designSetting.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 { useChartDataFetch } from "../../../../../hooks/useChartDataFetch.hook.mjs";
import "../../../../../api/axios.mjs";
import "../../../../../../node_modules/.pnpm/echarts@5.4.3/node_modules/echarts/index.mjs";
import "../../../../../store/modules/langStore/langStore.mjs";
import { useChartEditStore } from "../../../../../store/modules/chartEditStore/chartEditStore.mjs";
import { option } from "./config.mjs";
import { defineComponent, watch, resolveComponent, openBlock, createElementBlock, createVNode, withCtx, Fragment, renderList, createBlock } from "../../../../../../node_modules/.pnpm/@vue_runtime-core@3.3.4/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.mjs";
import { shallowReactive, toRefs, unref } from "../../../../../../node_modules/.pnpm/@vue_reactivity@3.3.4/node_modules/@vue/reactivity/dist/reactivity.esm-bundler.mjs";
const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "index",
  props: {
    chartConfig: {
      type: Object,
      required: true
    }
  },
  setup(__props) {
    const props = __props;
    const option$1 = shallowReactive({
      dataset: option.dataset
    });
    const { w, h } = toRefs(props.chartConfig.attr);
    const {
      autoplay,
      interval,
      slidesPerview,
      direction,
      draggable,
      centeredSlides,
      effect,
      dotType,
      dotPlacement,
      showArrow,
      showDots,
      fit
    } = toRefs(props.chartConfig.option);
    watch(
      () => props.chartConfig.option.dataset,
      (newData) => {
        option$1.dataset = newData;
      },
      {
        immediate: true,
        deep: false
      }
    );
    useChartDataFetch(props.chartConfig, useChartEditStore, (newData) => {
      option$1.dataset = newData;
    });
    return (_ctx, _cache) => {
      const _component_n_image = resolveComponent("n-image");
      const _component_n_carousel = resolveComponent("n-carousel");
      return openBlock(), createElementBlock("div", null, [
        createVNode(_component_n_carousel, {
          autoplay: unref(autoplay),
          interval: unref(interval),
          "centered-slides": unref(centeredSlides),
          direction: unref(direction),
          "dot-placement": unref(dotPlacement),
          "dot-type": unref(dotType),
          draggable: unref(draggable),
          effect: unref(effect),
          "slides-per-view": unref(slidesPerview),
          "show-arrow": unref(showArrow),
          "show-dots": unref(showDots)
        }, {
          default: withCtx(() => [
            (openBlock(true), createElementBlock(Fragment, null, renderList(unref(option$1).dataset, (url, index) => {
              return openBlock(), createBlock(_component_n_image, {
                "preview-disabled": "",
                key: index,
                "object-fit": unref(fit),
                src: url,
                "fallback-src": unref(requireErrorImg)(),
                width: unref(w),
                height: unref(h)
              }, null, 8, ["object-fit", "src", "fallback-src", "width", "height"]);
            }), 128))
          ]),
          _: 1
        }, 8, ["autoplay", "interval", "centered-slides", "direction", "dot-placement", "dot-type", "draggable", "effect", "slides-per-view", "show-arrow", "show-dots"])
      ]);
    };
  }
});
export {
  _sfc_main as default
};
