var __defProp = Object.defineProperty;
var __defProps = Object.defineProperties;
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __spreadValues = (a, b) => {
  for (var prop in b || (b = {}))
    if (__hasOwnProp.call(b, prop))
      __defNormalProp(a, prop, b[prop]);
  if (__getOwnPropSymbols)
    for (var prop of __getOwnPropSymbols(b)) {
      if (__propIsEnum.call(b, prop))
        __defNormalProp(a, prop, b[prop]);
    }
  return a;
};
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
import { i as inherit, B as BaseElement, F as ellipseModel } from "./install-editor.js";
import { P as Promise$1 } from "./base-element.js";
import "./index.js";
import "vue";
import "./watermark.js";
import "./v4.js";
import "./defaults.js";
import "./index15.js";
import "./asyncToGenerator.js";
import "./pixel-helper.js";
import "./index16.js";
import "./uniq.js";
import "./video.js";
import "./get-lines.js";
import "./gif-apng.worker.js";
import "./vue-slider-component.umd.min.js";
var methods = {};
var template = `<div
    class="editor-element"
    :class="[
        'editor-element-' + model.type,
        model.lock ? 'editor-element-lock' : '',
        model.hidden ? 'editor-element-hidden' : '',
        model.frozen ? 'editor-element-frozen' : '',
        model.$loaded ? '' : 'editor-element-loading',
        model.$selected ? 'editor-element-selected' : '',
        model.$editing ? 'editor-element-editing' : ''
    ]"
    :style="baseStyle"
>
    <svg
        class="element-main"
        :width="model.width"
        :height="model.height"
        :viewBox="'0 0 ' + model.width + ' ' + model.height"
        version="1.1"
        xmlns="http://www.w3.org/2000/svg">
        <ellipse
            :rx="shapeAttr.rx"
            :ry="shapeAttr.ry"
            :cx="shapeAttr.cx"
            :cy="shapeAttr.cy"
            :style="shapeStyle"/>
    </svg>

    <slot :hideBlink="hideBlink" :isShowBlink="isShowBlink" :bgNinePatch="bgNinePatch"></slot>
</div>
`;
var ellipseElement = inherit(BaseElement, {
  name: "ellipse-element",
  template,
  data() {
    return {};
  },
  computed: {
    shapeAttr() {
      const { model } = this;
      const centerX = model.width / 2;
      const centerY = model.height / 2;
      return {
        cx: centerX,
        cy: centerY,
        rx: model.width / 2 - model.strokeWidth / 2,
        ry: model.height / 2 - model.strokeWidth / 2
      };
    },
    shapeStyle() {
      const { model } = this;
      let strokeLineStyle = {};
      if (model.strokeLineStyle === "dashed") {
        strokeLineStyle.strokeDasharray = `${model.strokeWidth * 2} ${model.strokeWidth}`;
      } else if (model.strokeLineStyle === "dotted") {
        strokeLineStyle.strokeLinecap = "round";
        strokeLineStyle.strokeDasharray = `0 ${model.strokeWidth * 2}`;
      }
      return __spreadProps(__spreadValues({}, strokeLineStyle), {
        stroke: model.stroke,
        strokeWidth: model.strokeWidth,
        fill: model.fill || "transparent"
      });
    }
  },
  methods: {
    load() {
      return Promise$1.resolve();
    }
  },
  mounted() {
    this.model.$getResizeLimit = () => ({
      maxWidth: Infinity,
      minWidth: (this.model.strokeWidth * 2 + 1) * this.editor.zoom,
      maxHeight: Infinity,
      minHeight: (this.model.strokeWidth * 2 + 1) * this.editor.zoom
    });
  }
});
var index = {
  model: ellipseModel,
  methods,
  layoutComponent: ellipseElement
};
export { index as default };
