import { defineComponent, toRefs, openBlock, createElementBlock, unref, createElementVNode, createCommentVNode } from "vue";
const _hoisted_1 = { class: "go-border-box" };
const _hoisted_2 = ["width", "height"];
const _hoisted_3 = /* @__PURE__ */ createElementVNode("feMorphology", {
  operator: "dilate",
  radius: "1",
  in: "SourceAlpha",
  result: "thicken"
}, null, -1);
const _hoisted_4 = /* @__PURE__ */ createElementVNode("feGaussianBlur", {
  in: "thicken",
  stdDeviation: "2",
  result: "blurred"
}, null, -1);
const _hoisted_5 = ["flood-color"];
const _hoisted_6 = ["values"];
const _hoisted_7 = /* @__PURE__ */ createElementVNode("feComposite", {
  in: "glowColor",
  in2: "blurred",
  operator: "in",
  result: "softGlowColored"
}, null, -1);
const _hoisted_8 = /* @__PURE__ */ createElementVNode("feMerge", null, [
  /* @__PURE__ */ createElementVNode("feMergeNode", { in: "softGlowColored" }),
  /* @__PURE__ */ createElementVNode("feMergeNode", { in: "SourceGraphic" })
], -1);
const _hoisted_9 = ["fill", "stroke", "d"];
const _hoisted_10 = ["filter", "stroke"];
const _hoisted_11 = ["filter", "stroke", "d"];
const _hoisted_12 = ["filter", "stroke", "d"];
const _hoisted_13 = ["filter", "stroke", "d"];
const __default__ = defineComponent({ name: "EBorder03" });
const _sfc_main = /* @__PURE__ */ defineComponent({
  ...__default__,
  props: {
    chartConfig: {
      type: Object,
      required: true
    }
  },
  setup(__props) {
    const props = __props;
    const alpha = (color, any) => {
      return color;
    };
    const getUUID = (randomLength = 10) => {
      return Number(
        Math.random().toString().substring(2, randomLength) + Date.now()
      ).toString(36);
    };
    const filterId = `border-box-03-filterId-${getUUID()}`;
    const { w, h } = toRefs(props.chartConfig.attr);
    const { colors, backgroundColor } = toRefs(props.chartConfig.option);
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1, [
        (openBlock(), createElementBlock("svg", {
          width: unref(w),
          height: unref(h)
        }, [
          createElementVNode("defs", null, [
            createElementVNode("filter", {
              id: filterId,
              height: "150%",
              width: "150%",
              x: "-25%",
              y: "-25%"
            }, [
              _hoisted_3,
              _hoisted_4,
              createElementVNode("feFlood", {
                "flood-color": alpha(unref(colors)[1]),
                result: "glowColor"
              }, [
                createElementVNode("animate", {
                  attributeName: "flood-color",
                  values: `
                ${alpha(unref(colors)[1])};
                ${alpha(unref(colors)[1])};
                ${alpha(unref(colors)[1])};
              `,
                  dur: "3s",
                  begin: "0s",
                  repeatCount: "indefinite"
                }, null, 8, _hoisted_6)
              ], 8, _hoisted_5),
              _hoisted_7,
              _hoisted_8
            ])
          ]),
          unref(w) && unref(h) ? (openBlock(), createElementBlock("path", {
            key: 0,
            fill: unref(backgroundColor),
            "stroke-width": "2",
            stroke: unref(colors)[0],
            d: `
          M15 5 L ${unref(w) - 15} 5 Q ${unref(w) - 5} 5, ${unref(w) - 5} 15
          L ${unref(w) - 5} ${unref(h) - 15} Q ${unref(w) - 5} ${unref(h) - 5}, ${unref(w) - 15} ${unref(h) - 5}
          L 15, ${unref(h) - 5} Q 5 ${unref(h) - 5} 5 ${unref(h) - 15} L 5 15
          Q 5 5 15 5
        `
          }, null, 8, _hoisted_9)) : createCommentVNode("", true),
          createElementVNode("path", {
            "stroke-width": "2",
            fill: "transparent",
            "stroke-linecap": "round",
            filter: `url(#${filterId})`,
            stroke: unref(colors)[1],
            d: `M 20 5 L 15 5 Q 5 5 5 15 L 5 20`
          }, null, 8, _hoisted_10),
          createElementVNode("path", {
            "stroke-width": "2",
            fill: "transparent",
            "stroke-linecap": "round",
            filter: `url(#${filterId})`,
            stroke: unref(colors)[1],
            d: `M ${unref(w) - 20} 5 L ${unref(w) - 15} 5 Q ${unref(w) - 5} 5 ${unref(w) - 5} 15 L ${unref(w) - 5} 20`
          }, null, 8, _hoisted_11),
          createElementVNode("path", {
            "stroke-width": "2",
            fill: "transparent",
            "stroke-linecap": "round",
            filter: `url(#${filterId})`,
            stroke: unref(colors)[1],
            d: `
          M ${unref(w) - 20} ${unref(h) - 5} L ${unref(w) - 15} ${unref(h) - 5}
          Q ${unref(w) - 5} ${unref(h) - 5} ${unref(w) - 5} ${unref(h) - 15}
          L ${unref(w) - 5} ${unref(h) - 20}
        `
          }, null, 8, _hoisted_12),
          createElementVNode("path", {
            "stroke-width": "2",
            fill: "transparent",
            "stroke-linecap": "round",
            filter: `url(#${filterId})`,
            stroke: unref(colors)[1],
            d: `
          M 20 ${unref(h) - 5} L 15 ${unref(h) - 5}
          Q 5 ${unref(h) - 5} 5 ${unref(h) - 15}
          L 5 ${unref(h) - 20}
        `
          }, null, 8, _hoisted_13)
        ], 8, _hoisted_2))
      ]);
    };
  }
});
export { _sfc_main as default };
