import e from "./identity.js";
//#region ../../node_modules/d3-axis/src/axis.js
var t = 1, n = 2, r = 3, i = 4, a = 1e-6;
function o(e) {
	return "translate(" + e + ",0)";
}
function s(e) {
	return "translate(0," + e + ")";
}
function c(e) {
	return (t) => +e(t);
}
function l(e, t) {
	return t = Math.max(0, e.bandwidth() - t * 2) / 2, e.round() && (t = Math.round(t)), (n) => +e(n) + t;
}
function u() {
	return !this.__axis;
}
function d(d, f) {
	var p = [], m = null, h = null, g = 6, _ = 6, v = 3, y = typeof window < "u" && window.devicePixelRatio > 1 ? 0 : .5, b = d === t || d === i ? -1 : 1, x = d === i || d === n ? "x" : "y", S = d === t || d === r ? o : s;
	function C(o) {
		var s = m ?? (f.ticks ? f.ticks.apply(f, p) : f.domain()), C = h ?? (f.tickFormat ? f.tickFormat.apply(f, p) : e), w = Math.max(g, 0) + v, T = f.range(), E = +T[0] + y, D = +T[T.length - 1] + y, O = (f.bandwidth ? l : c)(f.copy(), y), k = o.selection ? o.selection() : o, A = k.selectAll(".domain").data([null]), j = k.selectAll(".tick").data(s, f).order(), M = j.exit(), N = j.enter().append("g").attr("class", "tick"), P = j.select("line"), F = j.select("text");
		A = A.merge(A.enter().insert("path", ".tick").attr("class", "domain").attr("stroke", "currentColor")), j = j.merge(N), P = P.merge(N.append("line").attr("stroke", "currentColor").attr(x + "2", b * g)), F = F.merge(N.append("text").attr("fill", "currentColor").attr(x, b * w).attr("dy", d === t ? "0em" : d === r ? "0.71em" : "0.32em")), o !== k && (A = A.transition(o), j = j.transition(o), P = P.transition(o), F = F.transition(o), M = M.transition(o).attr("opacity", a).attr("transform", function(e) {
			return isFinite(e = O(e)) ? S(e + y) : this.getAttribute("transform");
		}), N.attr("opacity", a).attr("transform", function(e) {
			var t = this.parentNode.__axis;
			return S((t && isFinite(t = t(e)) ? t : O(e)) + y);
		})), M.remove(), A.attr("d", d === i || d === n ? _ ? "M" + b * _ + "," + E + "H" + y + "V" + D + "H" + b * _ : "M" + y + "," + E + "V" + D : _ ? "M" + E + "," + b * _ + "V" + y + "H" + D + "V" + b * _ : "M" + E + "," + y + "H" + D), j.attr("opacity", 1).attr("transform", function(e) {
			return S(O(e) + y);
		}), P.attr(x + "2", b * g), F.attr(x, b * w).text(C), k.filter(u).attr("fill", "none").attr("font-size", 10).attr("font-family", "sans-serif").attr("text-anchor", d === n ? "start" : d === i ? "end" : "middle"), k.each(function() {
			this.__axis = O;
		});
	}
	return C.scale = function(e) {
		return arguments.length ? (f = e, C) : f;
	}, C.ticks = function() {
		return p = Array.from(arguments), C;
	}, C.tickArguments = function(e) {
		return arguments.length ? (p = e == null ? [] : Array.from(e), C) : p.slice();
	}, C.tickValues = function(e) {
		return arguments.length ? (m = e == null ? null : Array.from(e), C) : m && m.slice();
	}, C.tickFormat = function(e) {
		return arguments.length ? (h = e, C) : h;
	}, C.tickSize = function(e) {
		return arguments.length ? (g = _ = +e, C) : g;
	}, C.tickSizeInner = function(e) {
		return arguments.length ? (g = +e, C) : g;
	}, C.tickSizeOuter = function(e) {
		return arguments.length ? (_ = +e, C) : _;
	}, C.tickPadding = function(e) {
		return arguments.length ? (v = +e, C) : v;
	}, C.offset = function(e) {
		return arguments.length ? (y = +e, C) : y;
	}, C;
}
function f(e) {
	return d(t, e);
}
function p(e) {
	return d(r, e);
}
//#endregion
export { p as axisBottom, f as axisTop };
