import "../../../../../../node_modules/.pnpm/vue@3.3.4/node_modules/vue/dist/vue.runtime.esm-bundler.mjs";
import { getUUID } 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 { defineComponent, computed, openBlock, createElementBlock, createElementVNode as createBaseVNode, pushScopeId, popScopeId } from "../../../../../../node_modules/.pnpm/@vue_runtime-core@3.3.4/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.mjs";
import { toRefs, unref } from "../../../../../../node_modules/.pnpm/@vue_reactivity@3.3.4/node_modules/@vue/reactivity/dist/reactivity.esm-bundler.mjs";
const _withScopeId = (n) => (pushScopeId("data-v-966367ac"), n = n(), popScopeId(), n);
const _hoisted_1 = { class: "go-border-box" };
const _hoisted_2 = ["width", "height"];
const _hoisted_3 = ["d"];
const _hoisted_4 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createBaseVNode("stop", {
  offset: "0%",
  "stop-color": "#fff",
  "stop-opacity": "1"
}, null, -1));
const _hoisted_5 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createBaseVNode("stop", {
  offset: "100%",
  "stop-color": "#fff",
  "stop-opacity": "0"
}, null, -1));
const _hoisted_6 = [
  _hoisted_4,
  _hoisted_5
];
const _hoisted_7 = ["fill"];
const _hoisted_8 = ["dur", "path"];
const _hoisted_9 = ["fill", "points"];
const _hoisted_10 = ["stroke", "xlink:href"];
const _hoisted_11 = ["stroke", "xlink:href", "mask"];
const _hoisted_12 = ["from", "to", "dur"];
const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "index",
  props: {
    chartConfig: {
      type: Object,
      required: true
    }
  },
  setup(__props) {
    const props = __props;
    const path = `border-box-08-path-${getUUID()}`;
    const gradient = `border-box-08-gradient-${getUUID()}`;
    const mask = `border-box-08-mask-${getUUID()}`;
    const { w, h } = toRefs(props.chartConfig.attr);
    const { colors, dur, backgroundColor, reverse } = toRefs(
      props.chartConfig.option
    );
    const length = computed(() => {
      return (w.value + h.value - 5) * 2;
    });
    const pathD = computed(() => {
      if (reverse.value)
        return `M 2.5, 2.5 L 2.5, ${h.value - 2.5} L ${w.value - 2.5}, ${h.value - 2.5} L ${w.value - 2.5}, 2.5 L 2.5, 2.5`;
      return `M2.5, 2.5 L${w.value - 2.5}, 2.5 L${w.value - 2.5}, ${h.value - 2.5} L2.5, ${h.value - 2.5} L2.5, 2.5`;
    });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1, [
        (openBlock(), createElementBlock("svg", {
          width: unref(w),
          height: unref(h)
        }, [
          createBaseVNode("defs", null, [
            createBaseVNode("path", {
              id: path,
              d: pathD.value,
              fill: "transparent"
            }, null, 8, _hoisted_3),
            createBaseVNode("radialGradient", {
              id: gradient,
              cx: "50%",
              cy: "50%",
              r: "50%"
            }, _hoisted_6),
            createBaseVNode("mask", { id: mask }, [
              createBaseVNode("circle", {
                cx: "0",
                cy: "0",
                r: "150",
                fill: `url(#${gradient})`
              }, [
                createBaseVNode("animateMotion", {
                  dur: `${unref(dur)}s`,
                  path: pathD.value,
                  rotate: "auto",
                  repeatCount: "indefinite"
                }, null, 8, _hoisted_8)
              ], 8, _hoisted_7)
            ])
          ]),
          createBaseVNode("polygon", {
            fill: unref(backgroundColor),
            points: `5, 5 ${unref(w) - 5}, 5 ${unref(w) - 5} ${unref(h) - 5} 5, ${unref(h) - 5}`
          }, null, 8, _hoisted_9),
          createBaseVNode("use", {
            stroke: unref(colors)[0],
            "stroke-width": "1",
            "xlink:href": `#${path}`
          }, null, 8, _hoisted_10),
          createBaseVNode("use", {
            stroke: unref(colors)[1],
            "stroke-width": "3",
            "xlink:href": `#${path}`,
            mask: `url(#${mask})`
          }, [
            createBaseVNode("animate", {
              attributeName: "stroke-dasharray",
              from: `0, ${length.value}`,
              to: `${length.value}, 0`,
              dur: `${unref(dur)}s`,
              repeatCount: "indefinite"
            }, null, 8, _hoisted_12)
          ], 8, _hoisted_11)
        ], 8, _hoisted_2))
      ]);
    };
  }
});
export {
  _sfc_main as default
};
