import { tickStep as s } from "../../../../d3-array@3.2.4/node_modules/d3-array/src/ticks.js";
import c from "../../../../d3-format@3.1.2/node_modules/d3-format/src/formatSpecifier.js";
import e from "../../../../d3-format@3.1.2/node_modules/d3-format/src/precisionFixed.js";
import p from "../../../../d3-format@3.1.2/node_modules/d3-format/src/precisionRound.js";
import l from "../../../../d3-format@3.1.2/node_modules/d3-format/src/precisionPrefix.js";
import { formatPrefix as u, format as h } from "../../../../d3-format@3.1.2/node_modules/d3-format/src/defaultLocale.js";
function d(r, t, i, a) {
  var n = s(r, t, i), o;
  switch (a = c(a ?? ",f"), a.type) {
    case "s": {
      var m = Math.max(Math.abs(r), Math.abs(t));
      return a.precision == null && !isNaN(o = l(n, m)) && (a.precision = o), u(a, m);
    }
    case "":
    case "e":
    case "g":
    case "p":
    case "r": {
      a.precision == null && !isNaN(o = p(n, Math.max(Math.abs(r), Math.abs(t)))) && (a.precision = o - (a.type === "e"));
      break;
    }
    case "f":
    case "%": {
      a.precision == null && !isNaN(o = e(n)) && (a.precision = o - (a.type === "%") * 2);
      break;
    }
  }
  return h(a);
}
export {
  d as default
};
