import { assign as q } from "../../../min-dash/dist/index.esm.mjs";
import t from "../../../inherits-browser/dist/index.es.mjs";
import l$1 from "../../../object-refs/index.mjs";
var s = new l$1({ name: "children", enumerable: true, collection: true }, { name: "parent" }), c = new l$1({ name: "labels", enumerable: true, collection: true }, { name: "labelTarget" }), l = new l$1({ name: "attachers", collection: true }, { name: "host" }), b = new l$1({ name: "outgoing", collection: true }, { name: "source" }), h = new l$1({ name: "incoming", collection: true }, { name: "target" });
function r() {
  Object.defineProperty(this, "businessObject", {
    writable: true
  }), Object.defineProperty(this, "label", {
    get: function() {
      return this.labels[0];
    },
    set: function(t2) {
      var a = this.label, n = this.labels;
      !t2 && a ? n.remove(a) : n.add(t2, 0);
    }
  }), s.bind(this, "parent"), c.bind(this, "labels"), b.bind(this, "outgoing"), h.bind(this, "incoming");
}
function e() {
  r.call(this), s.bind(this, "children"), l.bind(this, "host"), l.bind(this, "attachers");
}
t(e, r);
function u() {
  e.call(this);
}
t(u, e);
function m() {
  e.call(this), c.bind(this, "labelTarget");
}
t(m, e);
function f() {
  r.call(this), b.bind(this, "source"), h.bind(this, "target");
}
t(f, r);
var g = {
  connection: f,
  shape: e,
  label: m,
  root: u
};
function v(t2, a) {
  var n = g[t2];
  if (!n)
    throw new Error("unknown type: <" + t2 + ">");
  return q(new n(), a);
}
export {
  r as Base,
  f as Connection,
  m as Label,
  u as Root,
  e as Shape,
  v as create
};
