import e from "./count.js";
import t from "./each.js";
import n from "./eachBefore.js";
import r from "./eachAfter.js";
import i from "./find.js";
import a from "./sum.js";
import o from "./sort.js";
import s from "./path.js";
import c from "./ancestors.js";
import l from "./descendants.js";
import u from "./leaves.js";
import d from "./links.js";
import f from "./iterator.js";
//#region ../../node_modules/d3-hierarchy/src/hierarchy/index.js
function p(e, t) {
	e instanceof Map ? (e = [void 0, e], t === void 0 && (t = g)) : t === void 0 && (t = h);
	for (var n = new y(e), r, i = [n], a, o, s, c; r = i.pop();) if ((o = t(r.data)) && (c = (o = Array.from(o)).length)) for (r.children = o, s = c - 1; s >= 0; --s) i.push(a = o[s] = new y(o[s])), a.parent = r, a.depth = r.depth + 1;
	return n.eachBefore(v);
}
function m() {
	return p(this).eachBefore(_);
}
function h(e) {
	return e.children;
}
function g(e) {
	return Array.isArray(e) ? e[1] : null;
}
function _(e) {
	e.data.value !== void 0 && (e.value = e.data.value), e.data = e.data.data;
}
function v(e) {
	var t = 0;
	do
		e.height = t;
	while ((e = e.parent) && e.height < ++t);
}
function y(e) {
	this.data = e, this.depth = this.height = 0, this.parent = null;
}
y.prototype = p.prototype = {
	constructor: y,
	count: e,
	each: t,
	eachAfter: r,
	eachBefore: n,
	find: i,
	sum: a,
	sort: o,
	path: s,
	ancestors: c,
	descendants: l,
	leaves: u,
	links: d,
	copy: m,
	[Symbol.iterator]: f
};
//#endregion
export { y as Node, p as default };
