import { computed as s, openBlock as r, createElementBlock as h, createBaseVNode as x } from "./composables-Ci32s3jE.js";
const v = ["width", "height"], b = ["cols", "rows", "disabled", "value"], L = {
  __name: "SpaceStatus",
  props: {
    content: {
      type: String,
      required: !0
    },
    maxRowLength: {
      type: Number,
      default: 50
    },
    lineHeight: {
      type: Number,
      default: 26
    },
    editable: {
      type: Boolean,
      default: !1
    }
  },
  emits: ["update"],
  setup(n, { emit: g }) {
    const e = n, d = g, o = s(() => {
      var i;
      const t = e.content.length;
      if (t < 1) return [];
      const a = Math.ceil(t / e.maxRowLength), c = [];
      for (let l = 0; l < a; l++) {
        const u = l * e.maxRowLength, f = u + e.maxRowLength;
        c.push((i = e.content) == null ? void 0 : i.slice(u, f));
      }
      return c;
    }), m = s(() => o.value.length < 1 ? 100 : (Math.max(...o.value.map((a) => a.length)) + 2) * e.lineHeight * 0.42), w = s(() => e.lineHeight + o.value.length * e.lineHeight);
    function p(t) {
      d("update", t.target.value);
    }
    return (t, a) => (r(), h("g", null, [
      (r(), h("foreignObject", {
        x: "-30",
        y: "20",
        width: m.value,
        height: w.value * 2
      }, [
        x("textarea", {
          cols: n.maxRowLength,
          rows: o.value.length,
          disabled: !n.editable,
          onInput: p,
          value: n.content
        }, null, 40, b)
      ], 8, v))
    ]));
  }
};
export {
  L as default
};
//# sourceMappingURL=SpaceStatus-DhjIdK7G.js.map
