import o from "../../../../../lodash-es@4.17.22/node_modules/lodash-es/forEach.js";
function u(e) {
  var n = e.graph().rankdir.toLowerCase();
  (n === "lr" || n === "rl") && f(e);
}
function h(e) {
  var n = e.graph().rankdir.toLowerCase();
  (n === "bt" || n === "rl") && c(e), (n === "lr" || n === "rl") && (a(e), f(e));
}
function f(e) {
  o(e.nodes(), function(n) {
    d(e.node(n));
  }), o(e.edges(), function(n) {
    d(e.edge(n));
  });
}
function d(e) {
  var n = e.width;
  e.width = e.height, e.height = n;
}
function c(e) {
  o(e.nodes(), function(n) {
    r(e.node(n));
  }), o(e.edges(), function(n) {
    var i = e.edge(n);
    o(i.points, r), Object.prototype.hasOwnProperty.call(i, "y") && r(i);
  });
}
function r(e) {
  e.y = -e.y;
}
function a(e) {
  o(e.nodes(), function(n) {
    t(e.node(n));
  }), o(e.edges(), function(n) {
    var i = e.edge(n);
    o(i.points, t), Object.prototype.hasOwnProperty.call(i, "x") && t(i);
  });
}
function t(e) {
  var n = e.x;
  e.x = e.y, e.y = n;
}
export {
  u as adjust,
  h as undo
};
