import e from "../../../../lodash-es/isArray.js";
import t from "../../../../lodash-es/forEach.js";
//#region ../../node_modules/dagre-d3-es/src/graphlib/alg/dfs.js
function n(n, i, a) {
	e(i) || (i = [i]);
	var o = (n.isDirected() ? n.successors : n.neighbors).bind(n), s = [], c = {};
	return t(i, function(e) {
		if (!n.hasNode(e)) throw Error("Graph does not have node: " + e);
		r(n, e, a === "post", c, o, s);
	}), s;
}
function r(e, n, i, a, o, s) {
	Object.prototype.hasOwnProperty.call(a, n) || (a[n] = !0, i || s.push(n), t(o(n), function(t) {
		r(e, t, i, a, o, s);
	}), i && s.push(n));
}
//#endregion
export { n as dfs };
