import e from "../../../lodash-es/clone.js";
import t from "../../../lodash-es/map.js";
import n from "../../../lodash-es/isUndefined.js";
import "./graph.js";
//#region ../../node_modules/dagre-d3-es/src/graphlib/json.js
function r(t) {
	var r = {
		options: {
			directed: t.isDirected(),
			multigraph: t.isMultigraph(),
			compound: t.isCompound()
		},
		nodes: i(t),
		edges: a(t)
	};
	return n(t.graph()) || (r.value = e(t.graph())), r;
}
function i(e) {
	return t(e.nodes(), function(t) {
		var r = e.node(t), i = e.parent(t), a = { v: t };
		return n(r) || (a.value = r), n(i) || (a.parent = i), a;
	});
}
function a(e) {
	return t(e.edges(), function(t) {
		var r = e.edge(t), i = {
			v: t.v,
			w: t.w
		};
		return n(t.name) || (i.name = t.name), n(r) || (i.value = r), i;
	});
}
//#endregion
export { r as write };

//# sourceMappingURL=json.js.map