import u from "../../../../../../lodash-es@4.17.22/node_modules/lodash-es/forEach.js";
import f from "../../../../../../lodash-es@4.17.22/node_modules/lodash-es/min.js";
import m from "../../../../../../lodash-es@4.17.22/node_modules/lodash-es/map.js";
function p(n) {
  var r = {};
  function t(o) {
    var a = n.node(o);
    if (Object.prototype.hasOwnProperty.call(r, o))
      return a.rank;
    r[o] = !0;
    var e = f(
      m(n.outEdges(o), function(i) {
        return t(i.w) - n.edge(i).minlen;
      })
    );
    return (e === Number.POSITIVE_INFINITY || // return value of _.map([]) for Lodash 3
    e === void 0 || // return value of _.map([]) for Lodash 4
    e === null) && (e = 0), a.rank = e;
  }
  u(n.sources(), t);
}
function s(n, r) {
  return n.node(r.w).rank - n.node(r.v).rank - n.edge(r).minlen;
}
export {
  p as longestPath,
  s as slack
};
