import { now } from "../../../d3-timer/src/timer.js";
import schedule_default from "../transition/schedule.js";
import { Transition, newId } from "../transition/index.js";
import { cubicInOut } from "../../../d3-ease/src/cubic.js";
var defaultTiming = {
	time: null,
	delay: 0,
	duration: 250,
	ease: cubicInOut
};
function inherit(e, i) {
	for (var a; !(a = e.__transition) || !(a = a[i]);) if (!(e = e.parentNode)) throw Error(`transition ${i} not found`);
	return a;
}
function transition_default(o) {
	var s, c;
	o instanceof Transition ? (s = o._id, o = o._name) : (s = newId(), (c = defaultTiming).time = now(), o = o == null ? null : o + "");
	for (var l = this._groups, u = l.length, d = 0; d < u; ++d) for (var f = l[d], p = f.length, m, h = 0; h < p; ++h) (m = f[h]) && schedule_default(m, o, s, h, f, c || inherit(m, s));
	return new Transition(l, this._parents, o, s);
}
export { transition_default as default };
