import { __exports as e } from "../../../../../../_virtual/manipulation.js";
var u;
function O() {
  if (u) return e;
  u = 1, Object.defineProperty(e, "__esModule", { value: !0 }), e.removeElement = a, e.replaceElement = f, e.appendChild = o, e.append = x, e.prependChild = d, e.prepend = s;
  function a(r) {
    if (r.prev && (r.prev.next = r.next), r.next && (r.next.prev = r.prev), r.parent) {
      var n = r.parent.children, p = n.lastIndexOf(r);
      p >= 0 && n.splice(p, 1);
    }
    r.next = null, r.prev = null, r.parent = null;
  }
  function f(r, n) {
    var p = n.prev = r.prev;
    p && (p.next = n);
    var t = n.next = r.next;
    t && (t.prev = n);
    var i = n.parent = r.parent;
    if (i) {
      var v = i.children;
      v[v.lastIndexOf(r)] = n, r.parent = null;
    }
  }
  function o(r, n) {
    if (a(n), n.next = null, n.parent = r, r.children.push(n) > 1) {
      var p = r.children[r.children.length - 2];
      p.next = n, n.prev = p;
    } else
      n.prev = null;
  }
  function x(r, n) {
    a(n);
    var p = r.parent, t = r.next;
    if (n.next = t, n.prev = r, r.next = n, n.parent = p, t) {
      if (t.prev = n, p) {
        var i = p.children;
        i.splice(i.lastIndexOf(t), 0, n);
      }
    } else p && p.children.push(n);
  }
  function d(r, n) {
    if (a(n), n.parent = r, n.prev = null, r.children.unshift(n) !== 1) {
      var p = r.children[1];
      p.prev = n, n.next = p;
    } else
      n.next = null;
  }
  function s(r, n) {
    a(n);
    var p = r.parent;
    if (p) {
      var t = p.children;
      t.splice(t.indexOf(r), 0, n);
    }
    r.prev && (r.prev.next = n), n.parent = p, n.prev = r.prev, n.next = r, r.prev = n;
  }
  return e;
}
export {
  O as __require
};
//# sourceMappingURL=manipulation.js.map
