import e from "../../d3-array/src/range.js";
import { initRange as t } from "./init.js";
import n from "./ordinal.js";
//#region ../../node_modules/d3-scale/src/band.js
function r() {
	var i = n().unknown(void 0), a = i.domain, o = i.range, s = 0, c = 1, l, u, d = !1, f = 0, p = 0, m = .5;
	delete i.unknown;
	function h() {
		var t = a().length, n = c < s, r = n ? c : s, i = n ? s : c;
		l = (i - r) / Math.max(1, t - f + p * 2), d && (l = Math.floor(l)), r += (i - r - l * (t - f)) * m, u = l * (1 - f), d && (r = Math.round(r), u = Math.round(u));
		var h = e(t).map(function(e) {
			return r + l * e;
		});
		return o(n ? h.reverse() : h);
	}
	return i.domain = function(e) {
		return arguments.length ? (a(e), h()) : a();
	}, i.range = function(e) {
		return arguments.length ? ([s, c] = e, s = +s, c = +c, h()) : [s, c];
	}, i.rangeRound = function(e) {
		return [s, c] = e, s = +s, c = +c, d = !0, h();
	}, i.bandwidth = function() {
		return u;
	}, i.step = function() {
		return l;
	}, i.round = function(e) {
		return arguments.length ? (d = !!e, h()) : d;
	}, i.padding = function(e) {
		return arguments.length ? (f = Math.min(1, p = +e), h()) : f;
	}, i.paddingInner = function(e) {
		return arguments.length ? (f = Math.min(1, e), h()) : f;
	}, i.paddingOuter = function(e) {
		return arguments.length ? (p = +e, h()) : p;
	}, i.align = function(e) {
		return arguments.length ? (m = Math.max(0, Math.min(1, e)), h()) : m;
	}, i.copy = function() {
		return r(a(), [s, c]).round(d).paddingInner(f).paddingOuter(p).align(m);
	}, t.apply(h(), arguments);
}
//#endregion
export { r as default };
