import namespace_default from "../../../d3-selection/src/namespace.js";
function attrInterpolate(e, t) {
	return function(n) {
		this.setAttribute(e, t.call(this, n));
	};
}
function attrInterpolateNS(e, t) {
	return function(n) {
		this.setAttributeNS(e.space, e.local, t.call(this, n));
	};
}
function attrTweenNS(e, t) {
	var r, i;
	function a() {
		var a = t.apply(this, arguments);
		return a !== i && (r = (i = a) && attrInterpolateNS(e, a)), r;
	}
	return a._value = t, a;
}
function attrTween(e, n) {
	var r, i;
	function a() {
		var a = n.apply(this, arguments);
		return a !== i && (r = (i = a) && attrInterpolate(e, a)), r;
	}
	return a._value = n, a;
}
function attrTween_default(t, n) {
	var a = "attr." + t;
	if (arguments.length < 2) return (a = this.tween(a)) && a._value;
	if (n == null) return this.tween(a, null);
	if (typeof n != "function") throw Error();
	var o = namespace_default(t);
	return this.tween(a, (o.local ? attrTweenNS : attrTween)(o, n));
}
export { attrTween_default as default };
