import { assign as q } from "../../../min-dash/dist/index.esm.mjs";
import y$1 from "../../../diagram-js/lib/util/Text.mjs";
var f = 12, y = 1.2, s = 30;
function g(r) {
  var e = q({
    fontFamily: "Arial, sans-serif",
    fontSize: f,
    fontWeight: "normal",
    lineHeight: y
  }, r && r.defaultStyle || {}), o = parseInt(e.fontSize, 10) - 1, h = q({}, e, {
    fontSize: o
  }, r && r.externalStyle || {}), a = new y$1({
    style: e
  });
  this.getExternalLabelBounds = function(t, i) {
    var n = a.getDimensions(i, {
      box: {
        width: 90,
        height: 30,
        x: t.width / 2 + t.x,
        y: t.height / 2 + t.y
      },
      style: h
    });
    return {
      x: Math.round(t.x + t.width / 2 - n.width / 2),
      y: Math.round(t.y),
      width: Math.ceil(n.width),
      height: Math.ceil(n.height)
    };
  }, this.getTextAnnotationBounds = function(t, i) {
    var n = a.getDimensions(i, {
      box: t,
      style: e,
      align: "left-top",
      padding: 5
    });
    return {
      x: t.x,
      y: t.y,
      width: t.width,
      height: Math.max(s, Math.round(n.height))
    };
  }, this.createText = function(t, i) {
    return a.createText(t, i || {});
  }, this.getDefaultStyle = function() {
    return e;
  }, this.getExternalStyle = function() {
    return h;
  };
}
g.$inject = [
  "config.textRenderer"
];
export {
  g as default
};
