import "../../../../../../node_modules/.pnpm/vue@3.3.4/node_modules/vue/dist/vue.runtime.esm-bundler.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 "../../../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseClone.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 { 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 { defineComponent, watch, onMounted, onUnmounted, openBlock, createElementBlock, createElementVNode as createBaseVNode } from "../../../../../../node_modules/.pnpm/@vue_runtime-core@3.3.4/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.mjs";
import { ref, toRefs, unref } from "../../../../../../node_modules/.pnpm/@vue_reactivity@3.3.4/node_modules/@vue/reactivity/dist/reactivity.esm-bundler.mjs";
import { toDisplayString, normalizeStyle } 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;
    let yearMonthDay = ref("2021-2-3");
    let nowData = ref("08:00:00");
    let newData = ref("2021-2-3 08:00:00");
    let boxShadow = ref("none");
    let timer = null;
    const { w, h } = toRefs(props.chartConfig.attr);
    let {
      timeColor,
      timeSize,
      timeLineHeight,
      timeTextIndent,
      fontWeight,
      showShadow,
      hShadow,
      vShadow,
      blurShadow,
      colorShadow
    } = toRefs(props.chartConfig.option);
    watch(
      props.chartConfig.option,
      () => {
        try {
          if (props.chartConfig.option.showShadow) {
            boxShadow.value = `${props.chartConfig.option.hShadow}px ${props.chartConfig.option.vShadow}px ${props.chartConfig.option.blurShadow}px ${props.chartConfig.option.colorShadow}`;
          } else {
            boxShadow.value = "none";
          }
        } catch (error) {
          console.log(error);
        }
      },
      {
        immediate: true
      }
    );
    onMounted(() => {
      timer = setInterval(() => {
        var datetime = /* @__PURE__ */ new Date();
        var year = datetime.getFullYear();
        var month = datetime.getMonth() + 1 < 10 ? "0" + (datetime.getMonth() + 1) : datetime.getMonth() + 1;
        var date = datetime.getDate() < 10 ? "0" + datetime.getDate() : datetime.getDate();
        var hh = datetime.getHours();
        var mm = datetime.getMinutes();
        var ss = datetime.getSeconds();
        let time = "";
        if (hh < 10)
          time += "0";
        time += hh + ":";
        if (mm < 10)
          time += "0";
        time += mm + ":";
        if (ss < 10)
          time += "0";
        time += ss;
        yearMonthDay.value = `${year}-${month}-${date}`;
        nowData.value = time;
        newData.value = yearMonthDay.value + " " + nowData.value;
      }, 500);
    });
    onUnmounted(() => {
      clearInterval(timer);
    });
    useChartDataFetch(props.chartConfig, useChartEditStore);
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", {
        class: "go-decorates-number",
        style: normalizeStyle(`width:${unref(w)}px;height:${unref(h)}px;`)
      }, [
        createBaseVNode("div", {
          style: normalizeStyle(`color:${unref(timeColor)};font-size:${unref(timeSize)}px;line-height:${unref(timeLineHeight)}px;
      letter-spacing:${unref(timeTextIndent)}px;font-weight:${unref(fontWeight)};
      text-shadow: ${unref(boxShadow)}`)
        }, toDisplayString(unref(newData)), 5)
      ], 4);
    };
  }
});
export {
  _sfc_main as default
};
