import { styleValue as e } from "../../../d3-selection/src/selection/style.js";
import { interpolateTransformCss as t } from "../../../d3-interpolate/src/transform/index.js";
import { set as n } from "./schedule.js";
import { tweenValue as r } from "./tween.js";
import i from "./interpolate.js";
//#region ../../node_modules/d3-transition/src/transition/style.js
function a(t, n) {
	var r, i, a;
	return function() {
		var o = e(this, t), s = (this.style.removeProperty(t), e(this, t));
		return o === s ? null : o === r && s === i ? a : a = n(r = o, i = s);
	};
}
function o(e) {
	return function() {
		this.style.removeProperty(e);
	};
}
function s(t, n, r) {
	var i, a = r + "", o;
	return function() {
		var s = e(this, t);
		return s === a ? null : s === i ? o : o = n(i = s, r);
	};
}
function c(t, n, r) {
	var i, a, o;
	return function() {
		var s = e(this, t), c = r(this), l = c + "";
		return c ?? (l = c = (this.style.removeProperty(t), e(this, t))), s === l ? null : s === i && l === a ? o : (a = l, o = n(i = s, c));
	};
}
function l(e, t) {
	var r, i, a, s = "style." + t, c = "end." + s, l;
	return function() {
		var u = n(this, e), d = u.on, f = u.value[s] == null ? l ||= o(t) : void 0;
		(d !== r || a !== f) && (i = (r = d).copy()).on(c, a = f), u.on = i;
	};
}
function u(e, n, u) {
	var d = (e += "") == "transform" ? t : i;
	return n == null ? this.styleTween(e, a(e, d)).on("end.style." + e, o(e)) : typeof n == "function" ? this.styleTween(e, c(e, d, r(this, "style." + e, n))).each(l(this._id, e)) : this.styleTween(e, s(e, d, n), u).on("end.style." + e, null);
}
//#endregion
export { u as default };
