import { defineComponent, toRefs, shallowReactive, watch, openBlock, createElementBlock, normalizeStyle, unref, createElementVNode } from "vue";
const _hoisted_1 = ["src", "width", "height"];
const __default__ = defineComponent({ name: "EIframe" });
const _sfc_main = /* @__PURE__ */ defineComponent({
  ...__default__,
  props: {
    chartConfig: {
      type: Object,
      required: true
    }
  },
  setup(__props) {
    const props = __props;
    const { w, h } = toRefs(props.chartConfig.attr);
    const { borderRadius } = toRefs(props.chartConfig.option);
    const option = shallowReactive({
      dataset: ""
    });
    const getStyle = (radius) => {
      return {
        borderRadius: `${radius}px`,
        overflow: "hidden"
      };
    };
    watch(
      () => props.chartConfig.option.dataset,
      (newData) => {
        option.dataset = newData;
      },
      {
        immediate: true
      }
    );
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", {
        style: normalizeStyle(getStyle(unref(borderRadius)))
      }, [
        createElementVNode("iframe", {
          src: unref(option).dataset,
          width: unref(w),
          height: unref(h),
          style: { "border-width": "0" }
        }, null, 8, _hoisted_1)
      ], 4);
    };
  }
});
export { _sfc_main as default };
