import { Y as te, a0 as vn$1, a1 as Mo, a2 as _u, a3 as oi } from './index.esm2.js';
import { t } from './init-f9637058.esm.js';

function _array_like_to_array(arr, len) {
    if (len == null || len > arr.length) len = arr.length;
    for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
    return arr2;
}
function _array_with_holes(arr) {
    if (Array.isArray(arr)) return arr;
}
function _instanceof(left, right) {
    if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
        return !!right[Symbol.hasInstance](left);
    } else {
        return left instanceof right;
    }
}
function _iterable_to_array_limit(arr, i) {
    var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
    if (_i == null) return;
    var _arr = [];
    var _n = true;
    var _d = false;
    var _s, _e;
    try {
        for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
            _arr.push(_s.value);
            if (i && _arr.length === i) break;
        }
    } catch (err) {
        _d = true;
        _e = err;
    } finally{
        try {
            if (!_n && _i["return"] != null) _i["return"]();
        } finally{
            if (_d) throw _e;
        }
    }
    return _arr;
}
function _non_iterable_rest() {
    throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _sliced_to_array(arr, i) {
    return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
}
function _type_of(obj) {
    "@swc/helpers - typeof";
    return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
}
function _unsupported_iterable_to_array(o, minLen) {
    if (!o) return;
    if (typeof o === "string") return _array_like_to_array(o, minLen);
    var n = Object.prototype.toString.call(o).slice(8, -1);
    if (n === "Object" && o.constructor) n = o.constructor.name;
    if (n === "Map" || n === "Set") return Array.from(n);
    if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
}
function F(n, t) {
    return n == null || t == null ? NaN : n < t ? -1 : n > t ? 1 : n >= t ? 0 : NaN;
}
function hn(n, t) {
    return n == null || t == null ? NaN : t < n ? -1 : t > n ? 1 : t >= n ? 0 : NaN;
}
function _(n) {
    var t, e, r;
    n.length !== 2 ? (t = F, e = function(u, c) {
        return F(n(u), c);
    }, r = function(u, c) {
        return n(u) - c;
    }) : (t = n === F || n === hn ? n : mn, e = n, r = n);
    function i(u, c) {
        var o = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 0, l = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : u.length;
        if (o < l) {
            if (t(c, c) !== 0) return l;
            do {
                var h = o + l >>> 1;
                e(u[h], c) < 0 ? o = h + 1 : l = h;
            }while (o < l);
        }
        return o;
    }
    function f(u, c) {
        var o = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 0, l = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : u.length;
        if (o < l) {
            if (t(c, c) !== 0) return l;
            do {
                var h = o + l >>> 1;
                e(u[h], c) <= 0 ? o = h + 1 : l = h;
            }while (o < l);
        }
        return o;
    }
    function a(u, c) {
        var o = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 0, l = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : u.length;
        var h = i(u, c, o, l - 1);
        return h > o && r(u[h - 1], c) > -r(u[h], c) ? h - 1 : h;
    }
    return {
        left: i,
        center: a,
        right: f
    };
}
function mn() {
    return 0;
}
function sn(n) {
    return n === null ? NaN : +n;
}
var ln = _(F), dn = ln.right;
_(sn).center;
var gn = dn, yn = Math.sqrt(50), Mn = Math.sqrt(10), pn = Math.sqrt(2);
function R(n, t, e) {
    var r = (t - n) / Math.max(0, e), i = Math.floor(Math.log10(r)), f = r / Math.pow(10, i), a = f >= yn ? 10 : f >= Mn ? 5 : f >= pn ? 2 : 1;
    var u, c, o;
    return i < 0 ? (o = Math.pow(10, -i) / a, u = Math.round(n * o), c = Math.round(t * o), u / o < n && ++u, c / o > t && --c, o = -o) : (o = Math.pow(10, i) * a, u = Math.round(n / o), c = Math.round(t / o), u * o < n && ++u, c * o > t && --c), c < u && 0.5 <= e && e < 2 ? R(n, t, e * 2) : [
        u,
        c,
        o
    ];
}
function wn(n, t, e) {
    if (t = +t, n = +n, e = +e, !(e > 0)) return [];
    if (n === t) return [
        n
    ];
    var r = t < n, _ref = _sliced_to_array(r ? R(t, n, e) : R(n, t, e), 3), i = _ref[0], f = _ref[1], a = _ref[2];
    if (!(f >= i)) return [];
    var u = f - i + 1, c = new Array(u);
    if (r) if (a < 0) for(var o = 0; o < u; ++o)c[o] = (f - o) / -a;
    else for(var o1 = 0; o1 < u; ++o1)c[o1] = (f - o1) * a;
    else if (a < 0) for(var o2 = 0; o2 < u; ++o2)c[o2] = (i + o2) / -a;
    else for(var o3 = 0; o3 < u; ++o3)c[o3] = (i + o3) * a;
    return c;
}
function L(n, t, e) {
    return t = +t, n = +n, e = +e, R(n, t, e)[2];
}
function Nn(n, t, e) {
    t = +t, n = +n, e = +e;
    var r = t < n, i = r ? L(t, n, e) : L(n, t, e);
    return (r ? -1 : 1) * (i < 0 ? 1 / -i : i);
}
function kn(n, t) {
    t || (t = []);
    var e = n ? Math.min(t.length, n.length) : 0, r = t.slice(), i;
    return function(f) {
        for(i = 0; i < e; ++i)r[i] = n[i] * (1 - f) + t[i] * f;
        return r;
    };
}
function xn(n) {
    return ArrayBuffer.isView(n) && !_instanceof(n, DataView);
}
function An(n, t) {
    var e = t ? t.length : 0, r = n ? Math.min(e, n.length) : 0, i = new Array(r), f = new Array(e), a;
    for(a = 0; a < r; ++a)i[a] = C(n[a], t[a]);
    for(; a < e; ++a)f[a] = t[a];
    return function(u) {
        for(a = 0; a < r; ++a)f[a] = i[a](u);
        return f;
    };
}
function vn(n, t) {
    var e = /* @__PURE__ */ new Date();
    return n = +n, t = +t, function(r) {
        return e.setTime(n * (1 - r) + t * r), e;
    };
}
function Sn(n, t) {
    var e = {}, r = {}, i;
    (n === null || (typeof n === "undefined" ? "undefined" : _type_of(n)) != "object") && (n = {}), (t === null || (typeof t === "undefined" ? "undefined" : _type_of(t)) != "object") && (t = {});
    for(i in t)i in n ? e[i] = C(n[i], t[i]) : r[i] = t[i];
    return function(f) {
        for(i in e)r[i] = e[i](f);
        return r;
    };
}
function C(n, t) {
    var e = typeof t === "undefined" ? "undefined" : _type_of(t), r;
    return t == null || e === "boolean" ? vn$1(t) : (e === "number" ? te : e === "string" ? (r = oi(t)) ? (t = r, Mo) : _u : _instanceof(t, oi) ? Mo : _instanceof(t, Date) ? vn : xn(t) ? kn : Array.isArray(t) ? An : typeof t.valueOf != "function" && typeof t.toString != "function" || isNaN(t) ? Sn : te)(n, t);
}
function bn(n, t) {
    return n = +n, t = +t, function(e) {
        return Math.round(n * (1 - e) + t * e);
    };
}
function jn(n) {
    return Math.abs(n = Math.round(n)) >= 1e21 ? n.toLocaleString("en").replace(/,/g, "") : n.toString(10);
}
function E(n, t) {
    if ((e = (n = t ? n.toExponential(t - 1) : n.toExponential()).indexOf("e")) < 0) return null;
    var e, r = n.slice(0, e);
    return [
        r.length > 1 ? r[0] + r.slice(2) : r,
        +n.slice(e + 1)
    ];
}
function v(n) {
    return n = E(Math.abs(n)), n ? n[1] : NaN;
}
function Pn(n, t) {
    return function(e, r) {
        for(var i = e.length, f = [], a = 0, u = n[0], c = 0; i > 0 && u > 0 && (c + u + 1 > r && (u = Math.max(1, r - c)), f.push(e.substring(i -= u, i + u)), !((c += u + 1) > r));)u = n[a = (a + 1) % n.length];
        return f.reverse().join(t);
    };
}
function zn(n) {
    return function(t) {
        return t.replace(/[0-9]/g, function(e) {
            return n[+e];
        });
    };
}
var $n = /^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;
function D(n) {
    if (!(t = $n.exec(n))) throw new Error("invalid format: " + n);
    var t;
    return new B({
        fill: t[1],
        align: t[2],
        sign: t[3],
        symbol: t[4],
        zero: t[5],
        width: t[6],
        comma: t[7],
        precision: t[8] && t[8].slice(1),
        trim: t[9],
        type: t[10]
    });
}
D.prototype = B.prototype;
function B(n) {
    this.fill = n.fill === void 0 ? " " : n.fill + "", this.align = n.align === void 0 ? ">" : n.align + "", this.sign = n.sign === void 0 ? "-" : n.sign + "", this.symbol = n.symbol === void 0 ? "" : n.symbol + "", this.zero = !!n.zero, this.width = n.width === void 0 ? void 0 : +n.width, this.comma = !!n.comma, this.precision = n.precision === void 0 ? void 0 : +n.precision, this.trim = !!n.trim, this.type = n.type === void 0 ? "" : n.type + "";
}
B.prototype.toString = function() {
    return this.fill + this.align + this.sign + this.symbol + (this.zero ? "0" : "") + (this.width === void 0 ? "" : Math.max(1, this.width | 0)) + (this.comma ? "," : "") + (this.precision === void 0 ? "" : "." + Math.max(0, this.precision | 0)) + (this.trim ? "~" : "") + this.type;
};
function Fn(n) {
    n: for(var t = n.length, e = 1, r = -1, i; e < t; ++e)switch(n[e]){
        case ".":
            r = i = e;
            break;
        case "0":
            r === 0 && (r = e), i = e;
            break;
        default:
            if (!+n[e]) break n;
            r > 0 && (r = 0);
            break;
    }
    return r > 0 ? n.slice(0, r) + n.slice(i + 1) : n;
}
var nn;
function Rn(n, t) {
    var e = E(n, t);
    if (!e) return n + "";
    var r = e[0], i = e[1], f = i - (nn = Math.max(-8, Math.min(8, Math.floor(i / 3))) * 3) + 1, a = r.length;
    return f === a ? r : f > a ? r + new Array(f - a + 1).join("0") : f > 0 ? r.slice(0, f) + "." + r.slice(f) : "0." + new Array(1 - f).join("0") + E(n, Math.max(0, t + f - 1))[0];
}
function Z(n, t) {
    var e = E(n, t);
    if (!e) return n + "";
    var r = e[0], i = e[1];
    return i < 0 ? "0." + new Array(-i).join("0") + r : r.length > i + 1 ? r.slice(0, i + 1) + "." + r.slice(i + 1) : r + new Array(i - r.length + 2).join("0");
}
var H = {
    "%": function(n, t) {
        return (n * 100).toFixed(t);
    },
    b: function(n) {
        return Math.round(n).toString(2);
    },
    c: function(n) {
        return n + "";
    },
    d: jn,
    e: function(n, t) {
        return n.toExponential(t);
    },
    f: function(n, t) {
        return n.toFixed(t);
    },
    g: function(n, t) {
        return n.toPrecision(t);
    },
    o: function(n) {
        return Math.round(n).toString(8);
    },
    p: function(n, t) {
        return Z(n * 100, t);
    },
    r: Z,
    s: Rn,
    X: function(n) {
        return Math.round(n).toString(16).toUpperCase();
    },
    x: function(n) {
        return Math.round(n).toString(16);
    }
};
function J(n) {
    return n;
}
var K = Array.prototype.map, Q = [
    "y",
    "z",
    "a",
    "f",
    "p",
    "n",
    "µ",
    "m",
    "",
    "k",
    "M",
    "G",
    "T",
    "P",
    "E",
    "Z",
    "Y"
];
function En(n) {
    var t = n.grouping === void 0 || n.thousands === void 0 ? J : Pn(K.call(n.grouping, Number), n.thousands + ""), e = n.currency === void 0 ? "" : n.currency[0] + "", r = n.currency === void 0 ? "" : n.currency[1] + "", i = n.decimal === void 0 ? "." : n.decimal + "", f = n.numerals === void 0 ? J : zn(K.call(n.numerals, String)), a = n.percent === void 0 ? "%" : n.percent + "", u = n.minus === void 0 ? "−" : n.minus + "", c = n.nan === void 0 ? "NaN" : n.nan + "";
    function o(h) {
        h = D(h);
        var s = h.fill, p = h.align, y = h.sign, S = h.symbol, k = h.zero, b = h.width, T = h.comma, w = h.precision, G = h.trim, d = h.type;
        d === "n" ? (T = true, d = "g") : H[d] || (w === void 0 && (w = 12), G = true, d = "g"), (k || s === "0" && p === "=") && (k = true, s = "0", p = "=");
        var en = S === "$" ? e : S === "#" && /[boxX]/.test(d) ? "0" + d.toLowerCase() : "", on = S === "$" ? r : /[%p]/.test(d) ? a : "", O = H[d], an = /[defgprs%]/.test(d);
        w = w === void 0 ? 6 : /[gprs]/.test(d) ? Math.max(1, Math.min(21, w)) : Math.max(0, Math.min(20, w));
        function V(m) {
            var N = en, g = on, x, X, j;
            if (d === "c") g = O(m) + g, m = "";
            else {
                m = +m;
                var P = m < 0 || 1 / m < 0;
                if (m = isNaN(m) ? c : O(Math.abs(m), w), G && (m = Fn(m)), P && +m == 0 && y !== "+" && (P = false), N = (P ? y === "(" ? y : u : y === "-" || y === "(" ? "" : y) + N, g = (d === "s" ? Q[8 + nn / 3] : "") + g + (P && y === "(" ? ")" : ""), an) {
                    for(x = -1, X = m.length; ++x < X;)if (j = m.charCodeAt(x), 48 > j || j > 57) {
                        g = (j === 46 ? i + m.slice(x + 1) : m.slice(x)) + g, m = m.slice(0, x);
                        break;
                    }
                }
            }
            T && !k && (m = t(m, 1 / 0));
            var z = N.length + m.length + g.length, M = z < b ? new Array(b - z + 1).join(s) : "";
            switch(T && k && (m = t(M + m, M.length ? b - g.length : 1 / 0), M = ""), p){
                case "<":
                    m = N + m + g + M;
                    break;
                case "=":
                    m = N + M + m + g;
                    break;
                case "^":
                    m = M.slice(0, z = M.length >> 1) + N + m + g + M.slice(z);
                    break;
                default:
                    m = M + N + m + g;
                    break;
            }
            return f(m);
        }
        return V.toString = function() {
            return h + "";
        }, V;
    }
    function l(h, s) {
        var p = o((h = D(h), h.type = "f", h)), y = Math.max(-8, Math.min(8, Math.floor(v(s) / 3))) * 3, S = Math.pow(10, -y), k = Q[8 + y / 3];
        return function(b) {
            return p(S * b) + k;
        };
    }
    return {
        format: o,
        formatPrefix: l
    };
}
var $, tn, rn;
Dn({
    thousands: ",",
    grouping: [
        3
    ],
    currency: [
        "$",
        ""
    ]
});
function Dn(n) {
    return $ = En(n), tn = $.format, rn = $.formatPrefix, $;
}
function Tn(n) {
    return Math.max(0, -v(Math.abs(n)));
}
function In(n, t) {
    return Math.max(0, Math.max(-8, Math.min(8, Math.floor(v(t) / 3))) * 3 - v(Math.abs(n)));
}
function Ln(n, t) {
    return n = Math.abs(n), t = Math.abs(t) - n, Math.max(0, v(t) - v(n)) + 1;
}
function qn(n) {
    return function() {
        return n;
    };
}
function Cn(n) {
    return +n;
}
var W = [
    0,
    1
];
function A(n) {
    return n;
}
function q(n, t) {
    return (t -= n = +n) ? function(e) {
        return (e - n) / t;
    } : qn(isNaN(t) ? NaN : 0.5);
}
function Bn(n, t) {
    var e;
    return n > t && (e = n, n = t, t = e), function(r) {
        return Math.max(n, Math.min(t, r));
    };
}
function Gn(n, t, e) {
    var r = n[0], i = n[1], f = t[0], a = t[1];
    return i < r ? (r = q(i, r), f = e(a, f)) : (r = q(r, i), f = e(f, a)), function(u) {
        return f(r(u));
    };
}
function On(n, t, e) {
    var r = Math.min(n.length, t.length) - 1, i = new Array(r), f = new Array(r), a = -1;
    for(n[r] < n[0] && (n = n.slice().reverse(), t = t.slice().reverse()); ++a < r;)i[a] = q(n[a], n[a + 1]), f[a] = e(t[a], t[a + 1]);
    return function(u) {
        var c = gn(n, u, 1, r) - 1;
        return f[c](i[c](u));
    };
}
function Vn(n, t) {
    return t.domain(n.domain()).range(n.range()).interpolate(n.interpolate()).clamp(n.clamp()).unknown(n.unknown());
}
function Xn() {
    var n = W, t = W, e = C, r, i, f, a = A, u, c, o;
    function l() {
        var s = Math.min(n.length, t.length);
        return a !== A && (a = Bn(n[0], n[s - 1])), u = s > 2 ? On : Gn, c = o = null, h;
    }
    function h(s) {
        return s == null || isNaN(s = +s) ? f : (c || (c = u(n.map(r), t, e)))(r(a(s)));
    }
    return h.invert = function(s) {
        return a(i((o || (o = u(t, n.map(r), te)))(s)));
    }, h.domain = function(s) {
        return arguments.length ? (n = Array.from(s, Cn), l()) : n.slice();
    }, h.range = function(s) {
        return arguments.length ? (t = Array.from(s), l()) : t.slice();
    }, h.rangeRound = function(s) {
        return t = Array.from(s), e = bn, l();
    }, h.clamp = function(s) {
        return arguments.length ? (a = s ? true : A, l()) : a !== A;
    }, h.interpolate = function(s) {
        return arguments.length ? (e = s, l()) : e;
    }, h.unknown = function(s) {
        return arguments.length ? (f = s, h) : f;
    }, function(s, p) {
        return r = s, i = p, l();
    };
}
function Un() {
    return Xn()(A, A);
}
function Yn(n, t, e, r) {
    var i = Nn(n, t, e), f;
    switch(r = D(r !== null && r !== void 0 ? r : ",f"), r.type){
        case "s":
            {
                var a = Math.max(Math.abs(n), Math.abs(t));
                return r.precision == null && !isNaN(f = In(i, a)) && (r.precision = f), rn(r, a);
            }
        case "":
        case "e":
        case "g":
        case "p":
        case "r":
            {
                r.precision == null && !isNaN(f = Ln(i, Math.max(Math.abs(n), Math.abs(t)))) && (r.precision = f - (r.type === "e"));
                break;
            }
        case "f":
        case "%":
            {
                r.precision == null && !isNaN(f = Tn(i)) && (r.precision = f - (r.type === "%") * 2);
                break;
            }
    }
    return tn(r);
}
function Zn(n) {
    var t = n.domain;
    return n.ticks = function(e) {
        var r = t();
        return wn(r[0], r[r.length - 1], e !== null && e !== void 0 ? e : 10);
    }, n.tickFormat = function(e, r) {
        var i = t();
        return Yn(i[0], i[i.length - 1], e !== null && e !== void 0 ? e : 10, r);
    }, n.nice = function(e) {
        e == null && (e = 10);
        var r = t(), i = 0, f = r.length - 1, a = r[i], u = r[f], c, o, l = 10;
        for(u < a && (o = a, a = u, u = o, o = i, i = f, f = o); l-- > 0;){
            if (o = L(a, u, e), o === c) return r[i] = a, r[f] = u, t(r);
            if (o > 0) a = Math.floor(a / o) * o, u = Math.ceil(u / o) * o;
            else if (o < 0) a = Math.ceil(a * o) / o, u = Math.floor(u * o) / o;
            else break;
            c = o;
        }
        return n;
    }, n;
}
function Hn() {
    var n = Un();
    return n.copy = function() {
        return Vn(n, Hn());
    }, t.apply(n, arguments), Zn(n);
}

export { Hn as H, Nn as N, Un as U, Vn as V, _ };
