import { a8 as On, a7 as In, ap as Hn, ao as Wn, a9 as Pn, aa as Nn, _ as f, g as _t, a5 as jt, ab as zn, aH as rt, l as Tt, ah as Bn, af as Vn, av as Zn, an as jn, aI as ie, aJ as an, aK as Xn, aL as on, aM as cn, aN as un, aO as qn, a6 as ne } from "./index-Bh-wTBlD.js";
import { f as Rn, u as Jn, e as Kn, R as Qn, E as We } from "./linear-h6L3lVRp-DOzK9CUG.js";
import { t as Gn } from "./init-DjUOC4st-C8Nwz6AJ.js";
function tr(t, e) {
  let n;
  if (e === void 0)
    for (const r of t)
      r != null && (n < r || n === void 0 && r >= r) && (n = r);
  else {
    let r = -1;
    for (let i of t)
      (i = e(i, ++r, t)) != null && (n < i || n === void 0 && i >= i) && (n = i);
  }
  return n;
}
function er(t, e) {
  let n;
  if (e === void 0)
    for (const r of t)
      r != null && (n > r || n === void 0 && r >= r) && (n = r);
  else {
    let r = -1;
    for (let i of t)
      (i = e(i, ++r, t)) != null && (n > i || n === void 0 && i >= i) && (n = i);
  }
  return n;
}
function nr(t) {
  return t;
}
var qt = 1, se = 2, ye = 3, Xt = 4, Pe = 1e-6;
function rr(t) {
  return "translate(" + t + ",0)";
}
function ir(t) {
  return "translate(0," + t + ")";
}
function sr(t) {
  return (e) => +t(e);
}
function ar(t, e) {
  return e = Math.max(0, t.bandwidth() - e * 2) / 2, t.round() && (e = Math.round(e)), (n) => +t(n) + e;
}
function or() {
  return !this.__axis;
}
function ln(t, e) {
  var n = [], r = null, i = null, s = 6, c = 6, b = 3, F = typeof window < "u" && window.devicePixelRatio > 1 ? 0 : 0.5, w = t === qt || t === Xt ? -1 : 1, x = t === Xt || t === se ? "x" : "y", O = t === qt || t === ye ? rr : ir;
  function $(_) {
    var V = r ?? (e.ticks ? e.ticks.apply(e, n) : e.domain()), L = i ?? (e.tickFormat ? e.tickFormat.apply(e, n) : nr), Y = Math.max(s, 0) + b, E = e.range(), W = +E[0] + F, U = +E[E.length - 1] + F, B = (e.bandwidth ? ar : sr)(e.copy(), F), R = _.selection ? _.selection() : _, T = R.selectAll(".domain").data([null]), y = R.selectAll(".tick").data(V, e).order(), k = y.exit(), g = y.enter().append("g").attr("class", "tick"), C = y.select("line"), D = y.select("text");
    T = T.merge(T.enter().insert("path", ".tick").attr("class", "domain").attr("stroke", "currentColor")), y = y.merge(g), C = C.merge(g.append("line").attr("stroke", "currentColor").attr(x + "2", w * s)), D = D.merge(g.append("text").attr("fill", "currentColor").attr(x, w * Y).attr("dy", t === qt ? "0em" : t === ye ? "0.71em" : "0.32em")), _ !== R && (T = T.transition(_), y = y.transition(_), C = C.transition(_), D = D.transition(_), k = k.transition(_).attr("opacity", Pe).attr("transform", function(v) {
      return isFinite(v = B(v)) ? O(v + F) : this.getAttribute("transform");
    }), g.attr("opacity", Pe).attr("transform", function(v) {
      var p = this.parentNode.__axis;
      return O((p && isFinite(p = p(v)) ? p : B(v)) + F);
    })), k.remove(), T.attr("d", t === Xt || t === se ? c ? "M" + w * c + "," + W + "H" + F + "V" + U + "H" + w * c : "M" + F + "," + W + "V" + U : c ? "M" + W + "," + w * c + "V" + F + "H" + U + "V" + w * c : "M" + W + "," + F + "H" + U), y.attr("opacity", 1).attr("transform", function(v) {
      return O(B(v) + F);
    }), C.attr(x + "2", w * s), D.attr(x, w * Y).text(L), R.filter(or).attr("fill", "none").attr("font-size", 10).attr("font-family", "sans-serif").attr("text-anchor", t === se ? "start" : t === Xt ? "end" : "middle"), R.each(function() {
      this.__axis = B;
    });
  }
  return $.scale = function(_) {
    return arguments.length ? (e = _, $) : e;
  }, $.ticks = function() {
    return n = Array.from(arguments), $;
  }, $.tickArguments = function(_) {
    return arguments.length ? (n = _ == null ? [] : Array.from(_), $) : n.slice();
  }, $.tickValues = function(_) {
    return arguments.length ? (r = _ == null ? null : Array.from(_), $) : r && r.slice();
  }, $.tickFormat = function(_) {
    return arguments.length ? (i = _, $) : i;
  }, $.tickSize = function(_) {
    return arguments.length ? (s = c = +_, $) : s;
  }, $.tickSizeInner = function(_) {
    return arguments.length ? (s = +_, $) : s;
  }, $.tickSizeOuter = function(_) {
    return arguments.length ? (c = +_, $) : c;
  }, $.tickPadding = function(_) {
    return arguments.length ? (b = +_, $) : b;
  }, $.offset = function(_) {
    return arguments.length ? (F = +_, $) : F;
  }, $;
}
function cr(t) {
  return ln(qt, t);
}
function ur(t) {
  return ln(ye, t);
}
const lr = Math.PI / 180, dr = 180 / Math.PI, Kt = 18, dn = 0.96422, hn = 1, fn = 0.82521, gn = 4 / 29, St = 6 / 29, mn = 3 * St * St, hr = St * St * St;
function yn(t) {
  if (t instanceof lt) return new lt(t.l, t.a, t.b, t.opacity);
  if (t instanceof ht) return kn(t);
  t instanceof an || (t = Xn(t));
  var e = ue(t.r), n = ue(t.g), r = ue(t.b), i = ae((0.2225045 * e + 0.7168786 * n + 0.0606169 * r) / hn), s, c;
  return e === n && n === r ? s = c = i : (s = ae((0.4360747 * e + 0.3850649 * n + 0.1430804 * r) / dn), c = ae((0.0139322 * e + 0.0971045 * n + 0.7141733 * r) / fn)), new lt(116 * i - 16, 500 * (s - i), 200 * (i - c), t.opacity);
}
function fr(t, e, n, r) {
  return arguments.length === 1 ? yn(t) : new lt(t, e, n, r ?? 1);
}
function lt(t, e, n, r) {
  this.l = +t, this.a = +e, this.b = +n, this.opacity = +r;
}
on(lt, fr, cn(un, {
  brighter(t) {
    return new lt(this.l + Kt * (t ?? 1), this.a, this.b, this.opacity);
  },
  darker(t) {
    return new lt(this.l - Kt * (t ?? 1), this.a, this.b, this.opacity);
  },
  rgb() {
    var t = (this.l + 16) / 116, e = isNaN(this.a) ? t : t + this.a / 500, n = isNaN(this.b) ? t : t - this.b / 200;
    return e = dn * oe(e), t = hn * oe(t), n = fn * oe(n), new an(
      ce(3.1338561 * e - 1.6168667 * t - 0.4906146 * n),
      ce(-0.9787684 * e + 1.9161415 * t + 0.033454 * n),
      ce(0.0719453 * e - 0.2289914 * t + 1.4052427 * n),
      this.opacity
    );
  }
}));
function ae(t) {
  return t > hr ? Math.pow(t, 1 / 3) : t / mn + gn;
}
function oe(t) {
  return t > St ? t * t * t : mn * (t - gn);
}
function ce(t) {
  return 255 * (t <= 31308e-7 ? 12.92 * t : 1.055 * Math.pow(t, 1 / 2.4) - 0.055);
}
function ue(t) {
  return (t /= 255) <= 0.04045 ? t / 12.92 : Math.pow((t + 0.055) / 1.055, 2.4);
}
function gr(t) {
  if (t instanceof ht) return new ht(t.h, t.c, t.l, t.opacity);
  if (t instanceof lt || (t = yn(t)), t.a === 0 && t.b === 0) return new ht(NaN, 0 < t.l && t.l < 100 ? 0 : NaN, t.l, t.opacity);
  var e = Math.atan2(t.b, t.a) * dr;
  return new ht(e < 0 ? e + 360 : e, Math.sqrt(t.a * t.a + t.b * t.b), t.l, t.opacity);
}
function ke(t, e, n, r) {
  return arguments.length === 1 ? gr(t) : new ht(t, e, n, r ?? 1);
}
function ht(t, e, n, r) {
  this.h = +t, this.c = +e, this.l = +n, this.opacity = +r;
}
function kn(t) {
  if (isNaN(t.h)) return new lt(t.l, 0, 0, t.opacity);
  var e = t.h * lr;
  return new lt(t.l, Math.cos(e) * t.c, Math.sin(e) * t.c, t.opacity);
}
on(ht, ke, cn(un, {
  brighter(t) {
    return new ht(this.h, this.c, this.l + Kt * (t ?? 1), this.opacity);
  },
  darker(t) {
    return new ht(this.h, this.c, this.l - Kt * (t ?? 1), this.opacity);
  },
  rgb() {
    return kn(this).rgb();
  }
}));
function mr(t) {
  return function(e, n) {
    var r = t((e = ke(e)).h, (n = ke(n)).h), i = ie(e.c, n.c), s = ie(e.l, n.l), c = ie(e.opacity, n.opacity);
    return function(b) {
      return e.h = r(b), e.c = i(b), e.l = s(b), e.opacity = c(b), e + "";
    };
  };
}
const yr = mr(qn);
function kr(t, e) {
  t = t.slice();
  var n = 0, r = t.length - 1, i = t[n], s = t[r], c;
  return s < i && (c = n, n = r, r = c, c = i, i = s, s = c), t[n] = e.floor(i), t[r] = e.ceil(s), t;
}
const le = /* @__PURE__ */ new Date(), de = /* @__PURE__ */ new Date();
function tt(t, e, n, r) {
  function i(s) {
    return t(s = arguments.length === 0 ? /* @__PURE__ */ new Date() : /* @__PURE__ */ new Date(+s)), s;
  }
  return i.floor = (s) => (t(s = /* @__PURE__ */ new Date(+s)), s), i.ceil = (s) => (t(s = new Date(s - 1)), e(s, 1), t(s), s), i.round = (s) => {
    const c = i(s), b = i.ceil(s);
    return s - c < b - s ? c : b;
  }, i.offset = (s, c) => (e(s = /* @__PURE__ */ new Date(+s), c == null ? 1 : Math.floor(c)), s), i.range = (s, c, b) => {
    const F = [];
    if (s = i.ceil(s), b = b == null ? 1 : Math.floor(b), !(s < c) || !(b > 0)) return F;
    let w;
    do
      F.push(w = /* @__PURE__ */ new Date(+s)), e(s, b), t(s);
    while (w < s && s < c);
    return F;
  }, i.filter = (s) => tt((c) => {
    if (c >= c) for (; t(c), !s(c); ) c.setTime(c - 1);
  }, (c, b) => {
    if (c >= c)
      if (b < 0) for (; ++b <= 0; )
        for (; e(c, -1), !s(c); )
          ;
      else for (; --b >= 0; )
        for (; e(c, 1), !s(c); )
          ;
  }), n && (i.count = (s, c) => (le.setTime(+s), de.setTime(+c), t(le), t(de), Math.floor(n(le, de))), i.every = (s) => (s = Math.floor(s), !isFinite(s) || !(s > 0) ? null : s > 1 ? i.filter(r ? (c) => r(c) % s === 0 : (c) => i.count(0, c) % s === 0) : i)), i;
}
const Ft = tt(() => {
}, (t, e) => {
  t.setTime(+t + e);
}, (t, e) => e - t);
Ft.every = (t) => (t = Math.floor(t), !isFinite(t) || !(t > 0) ? null : t > 1 ? tt((e) => {
  e.setTime(Math.floor(e / t) * t);
}, (e, n) => {
  e.setTime(+e + n * t);
}, (e, n) => (n - e) / t) : Ft);
Ft.range;
const ft = 1e3, ot = ft * 60, gt = ot * 60, mt = gt * 24, Me = mt * 7, Ne = mt * 30, he = mt * 365, kt = tt((t) => {
  t.setTime(t - t.getMilliseconds());
}, (t, e) => {
  t.setTime(+t + e * ft);
}, (t, e) => (e - t) / ft, (t) => t.getUTCSeconds());
kt.range;
const It = tt((t) => {
  t.setTime(t - t.getMilliseconds() - t.getSeconds() * ft);
}, (t, e) => {
  t.setTime(+t + e * ot);
}, (t, e) => (e - t) / ot, (t) => t.getMinutes());
It.range;
const pr = tt((t) => {
  t.setUTCSeconds(0, 0);
}, (t, e) => {
  t.setTime(+t + e * ot);
}, (t, e) => (e - t) / ot, (t) => t.getUTCMinutes());
pr.range;
const Ht = tt((t) => {
  t.setTime(t - t.getMilliseconds() - t.getSeconds() * ft - t.getMinutes() * ot);
}, (t, e) => {
  t.setTime(+t + e * gt);
}, (t, e) => (e - t) / gt, (t) => t.getHours());
Ht.range;
const Tr = tt((t) => {
  t.setUTCMinutes(0, 0, 0);
}, (t, e) => {
  t.setTime(+t + e * gt);
}, (t, e) => (e - t) / gt, (t) => t.getUTCHours());
Tr.range;
const vt = tt(
  (t) => t.setHours(0, 0, 0, 0),
  (t, e) => t.setDate(t.getDate() + e),
  (t, e) => (e - t - (e.getTimezoneOffset() - t.getTimezoneOffset()) * ot) / mt,
  (t) => t.getDate() - 1
);
vt.range;
const $e = tt((t) => {
  t.setUTCHours(0, 0, 0, 0);
}, (t, e) => {
  t.setUTCDate(t.getUTCDate() + e);
}, (t, e) => (e - t) / mt, (t) => t.getUTCDate() - 1);
$e.range;
const vr = tt((t) => {
  t.setUTCHours(0, 0, 0, 0);
}, (t, e) => {
  t.setUTCDate(t.getUTCDate() + e);
}, (t, e) => (e - t) / mt, (t) => Math.floor(t / mt));
vr.range;
function wt(t) {
  return tt((e) => {
    e.setDate(e.getDate() - (e.getDay() + 7 - t) % 7), e.setHours(0, 0, 0, 0);
  }, (e, n) => {
    e.setDate(e.getDate() + n * 7);
  }, (e, n) => (n - e - (n.getTimezoneOffset() - e.getTimezoneOffset()) * ot) / Me);
}
const Nt = wt(0), Wt = wt(1), pn = wt(2), Tn = wt(3), xt = wt(4), vn = wt(5), xn = wt(6);
Nt.range;
Wt.range;
pn.range;
Tn.range;
xt.range;
vn.range;
xn.range;
function Dt(t) {
  return tt((e) => {
    e.setUTCDate(e.getUTCDate() - (e.getUTCDay() + 7 - t) % 7), e.setUTCHours(0, 0, 0, 0);
  }, (e, n) => {
    e.setUTCDate(e.getUTCDate() + n * 7);
  }, (e, n) => (n - e) / Me);
}
const bn = Dt(0), Qt = Dt(1), xr = Dt(2), br = Dt(3), At = Dt(4), wr = Dt(5), Dr = Dt(6);
bn.range;
Qt.range;
xr.range;
br.range;
At.range;
wr.range;
Dr.range;
const Pt = tt((t) => {
  t.setDate(1), t.setHours(0, 0, 0, 0);
}, (t, e) => {
  t.setMonth(t.getMonth() + e);
}, (t, e) => e.getMonth() - t.getMonth() + (e.getFullYear() - t.getFullYear()) * 12, (t) => t.getMonth());
Pt.range;
const Cr = tt((t) => {
  t.setUTCDate(1), t.setUTCHours(0, 0, 0, 0);
}, (t, e) => {
  t.setUTCMonth(t.getUTCMonth() + e);
}, (t, e) => e.getUTCMonth() - t.getUTCMonth() + (e.getUTCFullYear() - t.getUTCFullYear()) * 12, (t) => t.getUTCMonth());
Cr.range;
const yt = tt((t) => {
  t.setMonth(0, 1), t.setHours(0, 0, 0, 0);
}, (t, e) => {
  t.setFullYear(t.getFullYear() + e);
}, (t, e) => e.getFullYear() - t.getFullYear(), (t) => t.getFullYear());
yt.every = (t) => !isFinite(t = Math.floor(t)) || !(t > 0) ? null : tt((e) => {
  e.setFullYear(Math.floor(e.getFullYear() / t) * t), e.setMonth(0, 1), e.setHours(0, 0, 0, 0);
}, (e, n) => {
  e.setFullYear(e.getFullYear() + n * t);
});
yt.range;
const bt = tt((t) => {
  t.setUTCMonth(0, 1), t.setUTCHours(0, 0, 0, 0);
}, (t, e) => {
  t.setUTCFullYear(t.getUTCFullYear() + e);
}, (t, e) => e.getUTCFullYear() - t.getUTCFullYear(), (t) => t.getUTCFullYear());
bt.every = (t) => !isFinite(t = Math.floor(t)) || !(t > 0) ? null : tt((e) => {
  e.setUTCFullYear(Math.floor(e.getUTCFullYear() / t) * t), e.setUTCMonth(0, 1), e.setUTCHours(0, 0, 0, 0);
}, (e, n) => {
  e.setUTCFullYear(e.getUTCFullYear() + n * t);
});
bt.range;
function Mr(t, e, n, r, i, s) {
  const c = [
    [kt, 1, ft],
    [kt, 5, 5 * ft],
    [kt, 15, 15 * ft],
    [kt, 30, 30 * ft],
    [s, 1, ot],
    [s, 5, 5 * ot],
    [s, 15, 15 * ot],
    [s, 30, 30 * ot],
    [i, 1, gt],
    [i, 3, 3 * gt],
    [i, 6, 6 * gt],
    [i, 12, 12 * gt],
    [r, 1, mt],
    [r, 2, 2 * mt],
    [n, 1, Me],
    [e, 1, Ne],
    [e, 3, 3 * Ne],
    [t, 1, he]
  ];
  function b(w, x, O) {
    const $ = x < w;
    $ && ([w, x] = [x, w]);
    const _ = O && typeof O.range == "function" ? O : F(w, x, O), V = _ ? _.range(w, +x + 1) : [];
    return $ ? V.reverse() : V;
  }
  function F(w, x, O) {
    const $ = Math.abs(x - w) / O, _ = Qn(([, , Y]) => Y).right(c, $);
    if (_ === c.length) return t.every(We(w / he, x / he, O));
    if (_ === 0) return Ft.every(Math.max(We(w, x, O), 1));
    const [V, L] = c[$ / c[_ - 1][2] < c[_][2] / $ ? _ - 1 : _];
    return V.every(L);
  }
  return [b, F];
}
const [$r, _r] = Mr(yt, Pt, Nt, vt, Ht, It);
function fe(t) {
  if (0 <= t.y && t.y < 100) {
    var e = new Date(-1, t.m, t.d, t.H, t.M, t.S, t.L);
    return e.setFullYear(t.y), e;
  }
  return new Date(t.y, t.m, t.d, t.H, t.M, t.S, t.L);
}
function ge(t) {
  if (0 <= t.y && t.y < 100) {
    var e = new Date(Date.UTC(-1, t.m, t.d, t.H, t.M, t.S, t.L));
    return e.setUTCFullYear(t.y), e;
  }
  return new Date(Date.UTC(t.y, t.m, t.d, t.H, t.M, t.S, t.L));
}
function Lt(t, e, n) {
  return { y: t, m: e, d: n, H: 0, M: 0, S: 0, L: 0 };
}
function Sr(t) {
  var e = t.dateTime, n = t.date, r = t.time, i = t.periods, s = t.days, c = t.shortDays, b = t.months, F = t.shortMonths, w = Ut(i), x = Ot(i), O = Ut(s), $ = Ot(s), _ = Ut(c), V = Ot(c), L = Ut(b), Y = Ot(b), E = Ut(F), W = Ot(F), U = {
    a: S,
    A: a,
    b: o,
    B: u,
    c: null,
    d: Xe,
    e: Xe,
    f: Qr,
    g: ci,
    G: li,
    H: Rr,
    I: Jr,
    j: Kr,
    L: wn,
    m: Gr,
    M: ti,
    p: A,
    q: z,
    Q: Je,
    s: Ke,
    S: ei,
    u: ni,
    U: ri,
    V: ii,
    w: si,
    W: ai,
    x: null,
    X: null,
    y: oi,
    Y: ui,
    Z: di,
    "%": Re
  }, B = {
    a: I,
    A: q,
    b: J,
    B: K,
    c: null,
    d: qe,
    e: qe,
    f: mi,
    g: Ci,
    G: $i,
    H: hi,
    I: fi,
    j: gi,
    L: Cn,
    m: yi,
    M: ki,
    p: it,
    q: pt,
    Q: Je,
    s: Ke,
    S: pi,
    u: Ti,
    U: vi,
    V: xi,
    w: bi,
    W: wi,
    x: null,
    X: null,
    y: Di,
    Y: Mi,
    Z: _i,
    "%": Re
  }, R = {
    a: C,
    A: D,
    b: v,
    B: p,
    c: l,
    d: Ze,
    e: Ze,
    f: Zr,
    g: Ve,
    G: Be,
    H: je,
    I: je,
    j: Nr,
    L: Vr,
    m: Pr,
    M: zr,
    p: g,
    q: Wr,
    Q: Xr,
    s: qr,
    S: Br,
    u: Lr,
    U: Ur,
    V: Or,
    w: Er,
    W: Ir,
    x: m,
    X: h,
    y: Ve,
    Y: Be,
    Z: Hr,
    "%": jr
  };
  U.x = T(n, U), U.X = T(r, U), U.c = T(e, U), B.x = T(n, B), B.X = T(r, B), B.c = T(e, B);
  function T(M, H) {
    return function(N) {
      var d = [], Z = -1, P = 0, X = M.length, Q, et, ct;
      for (N instanceof Date || (N = /* @__PURE__ */ new Date(+N)); ++Z < X; )
        M.charCodeAt(Z) === 37 && (d.push(M.slice(P, Z)), (et = ze[Q = M.charAt(++Z)]) != null ? Q = M.charAt(++Z) : et = Q === "e" ? " " : "0", (ct = H[Q]) && (Q = ct(N, et)), d.push(Q), P = Z + 1);
      return d.push(M.slice(P, Z)), d.join("");
    };
  }
  function y(M, H) {
    return function(N) {
      var d = Lt(1900, void 0, 1), Z = k(d, M, N += "", 0), P, X;
      if (Z != N.length) return null;
      if ("Q" in d) return new Date(d.Q);
      if ("s" in d) return new Date(d.s * 1e3 + ("L" in d ? d.L : 0));
      if (H && !("Z" in d) && (d.Z = 0), "p" in d && (d.H = d.H % 12 + d.p * 12), d.m === void 0 && (d.m = "q" in d ? d.q : 0), "V" in d) {
        if (d.V < 1 || d.V > 53) return null;
        "w" in d || (d.w = 1), "Z" in d ? (P = ge(Lt(d.y, 0, 1)), X = P.getUTCDay(), P = X > 4 || X === 0 ? Qt.ceil(P) : Qt(P), P = $e.offset(P, (d.V - 1) * 7), d.y = P.getUTCFullYear(), d.m = P.getUTCMonth(), d.d = P.getUTCDate() + (d.w + 6) % 7) : (P = fe(Lt(d.y, 0, 1)), X = P.getDay(), P = X > 4 || X === 0 ? Wt.ceil(P) : Wt(P), P = vt.offset(P, (d.V - 1) * 7), d.y = P.getFullYear(), d.m = P.getMonth(), d.d = P.getDate() + (d.w + 6) % 7);
      } else ("W" in d || "U" in d) && ("w" in d || (d.w = "u" in d ? d.u % 7 : "W" in d ? 1 : 0), X = "Z" in d ? ge(Lt(d.y, 0, 1)).getUTCDay() : fe(Lt(d.y, 0, 1)).getDay(), d.m = 0, d.d = "W" in d ? (d.w + 6) % 7 + d.W * 7 - (X + 5) % 7 : d.w + d.U * 7 - (X + 6) % 7);
      return "Z" in d ? (d.H += d.Z / 100 | 0, d.M += d.Z % 100, ge(d)) : fe(d);
    };
  }
  function k(M, H, N, d) {
    for (var Z = 0, P = H.length, X = N.length, Q, et; Z < P; ) {
      if (d >= X) return -1;
      if (Q = H.charCodeAt(Z++), Q === 37) {
        if (Q = H.charAt(Z++), et = R[Q in ze ? H.charAt(Z++) : Q], !et || (d = et(M, N, d)) < 0) return -1;
      } else if (Q != N.charCodeAt(d++))
        return -1;
    }
    return d;
  }
  function g(M, H, N) {
    var d = w.exec(H.slice(N));
    return d ? (M.p = x.get(d[0].toLowerCase()), N + d[0].length) : -1;
  }
  function C(M, H, N) {
    var d = _.exec(H.slice(N));
    return d ? (M.w = V.get(d[0].toLowerCase()), N + d[0].length) : -1;
  }
  function D(M, H, N) {
    var d = O.exec(H.slice(N));
    return d ? (M.w = $.get(d[0].toLowerCase()), N + d[0].length) : -1;
  }
  function v(M, H, N) {
    var d = E.exec(H.slice(N));
    return d ? (M.m = W.get(d[0].toLowerCase()), N + d[0].length) : -1;
  }
  function p(M, H, N) {
    var d = L.exec(H.slice(N));
    return d ? (M.m = Y.get(d[0].toLowerCase()), N + d[0].length) : -1;
  }
  function l(M, H, N) {
    return k(M, e, H, N);
  }
  function m(M, H, N) {
    return k(M, n, H, N);
  }
  function h(M, H, N) {
    return k(M, r, H, N);
  }
  function S(M) {
    return c[M.getDay()];
  }
  function a(M) {
    return s[M.getDay()];
  }
  function o(M) {
    return F[M.getMonth()];
  }
  function u(M) {
    return b[M.getMonth()];
  }
  function A(M) {
    return i[+(M.getHours() >= 12)];
  }
  function z(M) {
    return 1 + ~~(M.getMonth() / 3);
  }
  function I(M) {
    return c[M.getUTCDay()];
  }
  function q(M) {
    return s[M.getUTCDay()];
  }
  function J(M) {
    return F[M.getUTCMonth()];
  }
  function K(M) {
    return b[M.getUTCMonth()];
  }
  function it(M) {
    return i[+(M.getUTCHours() >= 12)];
  }
  function pt(M) {
    return 1 + ~~(M.getUTCMonth() / 3);
  }
  return {
    format: function(M) {
      var H = T(M += "", U);
      return H.toString = function() {
        return M;
      }, H;
    },
    parse: function(M) {
      var H = y(M += "", !1);
      return H.toString = function() {
        return M;
      }, H;
    },
    utcFormat: function(M) {
      var H = T(M += "", B);
      return H.toString = function() {
        return M;
      }, H;
    },
    utcParse: function(M) {
      var H = y(M += "", !0);
      return H.toString = function() {
        return M;
      }, H;
    }
  };
}
var ze = { "-": "", _: " ", 0: "0" }, nt = /^\s*\d+/, Yr = /^%/, Fr = /[\\^$*+?|[\]().{}]/g;
function j(t, e, n) {
  var r = t < 0 ? "-" : "", i = (r ? -t : t) + "", s = i.length;
  return r + (s < n ? new Array(n - s + 1).join(e) + i : i);
}
function Ar(t) {
  return t.replace(Fr, "\\$&");
}
function Ut(t) {
  return new RegExp("^(?:" + t.map(Ar).join("|") + ")", "i");
}
function Ot(t) {
  return new Map(t.map((e, n) => [e.toLowerCase(), n]));
}
function Er(t, e, n) {
  var r = nt.exec(e.slice(n, n + 1));
  return r ? (t.w = +r[0], n + r[0].length) : -1;
}
function Lr(t, e, n) {
  var r = nt.exec(e.slice(n, n + 1));
  return r ? (t.u = +r[0], n + r[0].length) : -1;
}
function Ur(t, e, n) {
  var r = nt.exec(e.slice(n, n + 2));
  return r ? (t.U = +r[0], n + r[0].length) : -1;
}
function Or(t, e, n) {
  var r = nt.exec(e.slice(n, n + 2));
  return r ? (t.V = +r[0], n + r[0].length) : -1;
}
function Ir(t, e, n) {
  var r = nt.exec(e.slice(n, n + 2));
  return r ? (t.W = +r[0], n + r[0].length) : -1;
}
function Be(t, e, n) {
  var r = nt.exec(e.slice(n, n + 4));
  return r ? (t.y = +r[0], n + r[0].length) : -1;
}
function Ve(t, e, n) {
  var r = nt.exec(e.slice(n, n + 2));
  return r ? (t.y = +r[0] + (+r[0] > 68 ? 1900 : 2e3), n + r[0].length) : -1;
}
function Hr(t, e, n) {
  var r = /^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n, n + 6));
  return r ? (t.Z = r[1] ? 0 : -(r[2] + (r[3] || "00")), n + r[0].length) : -1;
}
function Wr(t, e, n) {
  var r = nt.exec(e.slice(n, n + 1));
  return r ? (t.q = r[0] * 3 - 3, n + r[0].length) : -1;
}
function Pr(t, e, n) {
  var r = nt.exec(e.slice(n, n + 2));
  return r ? (t.m = r[0] - 1, n + r[0].length) : -1;
}
function Ze(t, e, n) {
  var r = nt.exec(e.slice(n, n + 2));
  return r ? (t.d = +r[0], n + r[0].length) : -1;
}
function Nr(t, e, n) {
  var r = nt.exec(e.slice(n, n + 3));
  return r ? (t.m = 0, t.d = +r[0], n + r[0].length) : -1;
}
function je(t, e, n) {
  var r = nt.exec(e.slice(n, n + 2));
  return r ? (t.H = +r[0], n + r[0].length) : -1;
}
function zr(t, e, n) {
  var r = nt.exec(e.slice(n, n + 2));
  return r ? (t.M = +r[0], n + r[0].length) : -1;
}
function Br(t, e, n) {
  var r = nt.exec(e.slice(n, n + 2));
  return r ? (t.S = +r[0], n + r[0].length) : -1;
}
function Vr(t, e, n) {
  var r = nt.exec(e.slice(n, n + 3));
  return r ? (t.L = +r[0], n + r[0].length) : -1;
}
function Zr(t, e, n) {
  var r = nt.exec(e.slice(n, n + 6));
  return r ? (t.L = Math.floor(r[0] / 1e3), n + r[0].length) : -1;
}
function jr(t, e, n) {
  var r = Yr.exec(e.slice(n, n + 1));
  return r ? n + r[0].length : -1;
}
function Xr(t, e, n) {
  var r = nt.exec(e.slice(n));
  return r ? (t.Q = +r[0], n + r[0].length) : -1;
}
function qr(t, e, n) {
  var r = nt.exec(e.slice(n));
  return r ? (t.s = +r[0], n + r[0].length) : -1;
}
function Xe(t, e) {
  return j(t.getDate(), e, 2);
}
function Rr(t, e) {
  return j(t.getHours(), e, 2);
}
function Jr(t, e) {
  return j(t.getHours() % 12 || 12, e, 2);
}
function Kr(t, e) {
  return j(1 + vt.count(yt(t), t), e, 3);
}
function wn(t, e) {
  return j(t.getMilliseconds(), e, 3);
}
function Qr(t, e) {
  return wn(t, e) + "000";
}
function Gr(t, e) {
  return j(t.getMonth() + 1, e, 2);
}
function ti(t, e) {
  return j(t.getMinutes(), e, 2);
}
function ei(t, e) {
  return j(t.getSeconds(), e, 2);
}
function ni(t) {
  var e = t.getDay();
  return e === 0 ? 7 : e;
}
function ri(t, e) {
  return j(Nt.count(yt(t) - 1, t), e, 2);
}
function Dn(t) {
  var e = t.getDay();
  return e >= 4 || e === 0 ? xt(t) : xt.ceil(t);
}
function ii(t, e) {
  return t = Dn(t), j(xt.count(yt(t), t) + (yt(t).getDay() === 4), e, 2);
}
function si(t) {
  return t.getDay();
}
function ai(t, e) {
  return j(Wt.count(yt(t) - 1, t), e, 2);
}
function oi(t, e) {
  return j(t.getFullYear() % 100, e, 2);
}
function ci(t, e) {
  return t = Dn(t), j(t.getFullYear() % 100, e, 2);
}
function ui(t, e) {
  return j(t.getFullYear() % 1e4, e, 4);
}
function li(t, e) {
  var n = t.getDay();
  return t = n >= 4 || n === 0 ? xt(t) : xt.ceil(t), j(t.getFullYear() % 1e4, e, 4);
}
function di(t) {
  var e = t.getTimezoneOffset();
  return (e > 0 ? "-" : (e *= -1, "+")) + j(e / 60 | 0, "0", 2) + j(e % 60, "0", 2);
}
function qe(t, e) {
  return j(t.getUTCDate(), e, 2);
}
function hi(t, e) {
  return j(t.getUTCHours(), e, 2);
}
function fi(t, e) {
  return j(t.getUTCHours() % 12 || 12, e, 2);
}
function gi(t, e) {
  return j(1 + $e.count(bt(t), t), e, 3);
}
function Cn(t, e) {
  return j(t.getUTCMilliseconds(), e, 3);
}
function mi(t, e) {
  return Cn(t, e) + "000";
}
function yi(t, e) {
  return j(t.getUTCMonth() + 1, e, 2);
}
function ki(t, e) {
  return j(t.getUTCMinutes(), e, 2);
}
function pi(t, e) {
  return j(t.getUTCSeconds(), e, 2);
}
function Ti(t) {
  var e = t.getUTCDay();
  return e === 0 ? 7 : e;
}
function vi(t, e) {
  return j(bn.count(bt(t) - 1, t), e, 2);
}
function Mn(t) {
  var e = t.getUTCDay();
  return e >= 4 || e === 0 ? At(t) : At.ceil(t);
}
function xi(t, e) {
  return t = Mn(t), j(At.count(bt(t), t) + (bt(t).getUTCDay() === 4), e, 2);
}
function bi(t) {
  return t.getUTCDay();
}
function wi(t, e) {
  return j(Qt.count(bt(t) - 1, t), e, 2);
}
function Di(t, e) {
  return j(t.getUTCFullYear() % 100, e, 2);
}
function Ci(t, e) {
  return t = Mn(t), j(t.getUTCFullYear() % 100, e, 2);
}
function Mi(t, e) {
  return j(t.getUTCFullYear() % 1e4, e, 4);
}
function $i(t, e) {
  var n = t.getUTCDay();
  return t = n >= 4 || n === 0 ? At(t) : At.ceil(t), j(t.getUTCFullYear() % 1e4, e, 4);
}
function _i() {
  return "+0000";
}
function Re() {
  return "%";
}
function Je(t) {
  return +t;
}
function Ke(t) {
  return Math.floor(+t / 1e3);
}
var Mt, Gt;
Si({
  dateTime: "%x, %X",
  date: "%-m/%-d/%Y",
  time: "%-I:%M:%S %p",
  periods: ["AM", "PM"],
  days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
  shortDays: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
  months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
  shortMonths: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
});
function Si(t) {
  return Mt = Sr(t), Gt = Mt.format, Mt.parse, Mt.utcFormat, Mt.utcParse, Mt;
}
function Yi(t) {
  return new Date(t);
}
function Fi(t) {
  return t instanceof Date ? +t : +/* @__PURE__ */ new Date(+t);
}
function $n(t, e, n, r, i, s, c, b, F, w) {
  var x = Jn(), O = x.invert, $ = x.domain, _ = w(".%L"), V = w(":%S"), L = w("%I:%M"), Y = w("%I %p"), E = w("%a %d"), W = w("%b %d"), U = w("%B"), B = w("%Y");
  function R(T) {
    return (F(T) < T ? _ : b(T) < T ? V : c(T) < T ? L : s(T) < T ? Y : r(T) < T ? i(T) < T ? E : W : n(T) < T ? U : B)(T);
  }
  return x.invert = function(T) {
    return new Date(O(T));
  }, x.domain = function(T) {
    return arguments.length ? $(Array.from(T, Fi)) : $().map(Yi);
  }, x.ticks = function(T) {
    var y = $();
    return t(y[0], y[y.length - 1], T ?? 10);
  }, x.tickFormat = function(T, y) {
    return y == null ? R : w(y);
  }, x.nice = function(T) {
    var y = $();
    return (!T || typeof T.range != "function") && (T = e(y[0], y[y.length - 1], T ?? 10)), T ? $(kr(y, T)) : x;
  }, x.copy = function() {
    return Kn(x, $n(t, e, n, r, i, s, c, b, F, w));
  }, x;
}
function Ai() {
  return Gn.apply($n($r, _r, yt, Pt, Nt, vt, Ht, It, kt, Gt).domain([new Date(2e3, 0, 1), new Date(2e3, 0, 2)]), arguments);
}
var pe = { exports: {} }, Ei = pe.exports, Qe;
function Li() {
  return Qe || (Qe = 1, function(t, e) {
    (function(n, r) {
      t.exports = r();
    })(Ei, function() {
      var n = "day";
      return function(r, i, s) {
        var c = function(w) {
          return w.add(4 - w.isoWeekday(), n);
        }, b = i.prototype;
        b.isoWeekYear = function() {
          return c(this).year();
        }, b.isoWeek = function(w) {
          if (!this.$utils().u(w)) return this.add(7 * (w - this.isoWeek()), n);
          var x, O, $, _, V = c(this), L = (x = this.isoWeekYear(), O = this.$u, $ = (O ? s.utc : s)().year(x).startOf("year"), _ = 4 - $.isoWeekday(), $.isoWeekday() > 4 && (_ += 7), $.add(_, n));
          return V.diff(L, "week") + 1;
        }, b.isoWeekday = function(w) {
          return this.$utils().u(w) ? this.day() || 7 : this.day(this.day() % 7 ? w : w - 7);
        };
        var F = b.startOf;
        b.startOf = function(w, x) {
          var O = this.$utils(), $ = !!O.u(x) || x;
          return O.p(w) === "isoweek" ? $ ? this.date(this.date() - (this.isoWeekday() - 1)).startOf("day") : this.date(this.date() - 1 - (this.isoWeekday() - 1) + 7).endOf("day") : F.bind(this)(w, x);
        };
      };
    });
  }(pe)), pe.exports;
}
var Ui = Li();
const Oi = /* @__PURE__ */ ne(Ui);
var Te = { exports: {} }, Ii = Te.exports, Ge;
function Hi() {
  return Ge || (Ge = 1, function(t, e) {
    (function(n, r) {
      t.exports = r();
    })(Ii, function() {
      var n = { LTS: "h:mm:ss A", LT: "h:mm A", L: "MM/DD/YYYY", LL: "MMMM D, YYYY", LLL: "MMMM D, YYYY h:mm A", LLLL: "dddd, MMMM D, YYYY h:mm A" }, r = /(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g, i = /\d/, s = /\d\d/, c = /\d\d?/, b = /\d*[^-_:/,()\s\d]+/, F = {}, w = function(Y) {
        return (Y = +Y) + (Y > 68 ? 1900 : 2e3);
      }, x = function(Y) {
        return function(E) {
          this[Y] = +E;
        };
      }, O = [/[+-]\d\d:?(\d\d)?|Z/, function(Y) {
        (this.zone || (this.zone = {})).offset = function(E) {
          if (!E || E === "Z") return 0;
          var W = E.match(/([+-]|\d\d)/g), U = 60 * W[1] + (+W[2] || 0);
          return U === 0 ? 0 : W[0] === "+" ? -U : U;
        }(Y);
      }], $ = function(Y) {
        var E = F[Y];
        return E && (E.indexOf ? E : E.s.concat(E.f));
      }, _ = function(Y, E) {
        var W, U = F.meridiem;
        if (U) {
          for (var B = 1; B <= 24; B += 1) if (Y.indexOf(U(B, 0, E)) > -1) {
            W = B > 12;
            break;
          }
        } else W = Y === (E ? "pm" : "PM");
        return W;
      }, V = { A: [b, function(Y) {
        this.afternoon = _(Y, !1);
      }], a: [b, function(Y) {
        this.afternoon = _(Y, !0);
      }], Q: [i, function(Y) {
        this.month = 3 * (Y - 1) + 1;
      }], S: [i, function(Y) {
        this.milliseconds = 100 * +Y;
      }], SS: [s, function(Y) {
        this.milliseconds = 10 * +Y;
      }], SSS: [/\d{3}/, function(Y) {
        this.milliseconds = +Y;
      }], s: [c, x("seconds")], ss: [c, x("seconds")], m: [c, x("minutes")], mm: [c, x("minutes")], H: [c, x("hours")], h: [c, x("hours")], HH: [c, x("hours")], hh: [c, x("hours")], D: [c, x("day")], DD: [s, x("day")], Do: [b, function(Y) {
        var E = F.ordinal, W = Y.match(/\d+/);
        if (this.day = W[0], E) for (var U = 1; U <= 31; U += 1) E(U).replace(/\[|\]/g, "") === Y && (this.day = U);
      }], w: [c, x("week")], ww: [s, x("week")], M: [c, x("month")], MM: [s, x("month")], MMM: [b, function(Y) {
        var E = $("months"), W = ($("monthsShort") || E.map(function(U) {
          return U.slice(0, 3);
        })).indexOf(Y) + 1;
        if (W < 1) throw new Error();
        this.month = W % 12 || W;
      }], MMMM: [b, function(Y) {
        var E = $("months").indexOf(Y) + 1;
        if (E < 1) throw new Error();
        this.month = E % 12 || E;
      }], Y: [/[+-]?\d+/, x("year")], YY: [s, function(Y) {
        this.year = w(Y);
      }], YYYY: [/\d{4}/, x("year")], Z: O, ZZ: O };
      function L(Y) {
        var E, W;
        E = Y, W = F && F.formats;
        for (var U = (Y = E.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, function(C, D, v) {
          var p = v && v.toUpperCase();
          return D || W[v] || n[v] || W[p].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, function(l, m, h) {
            return m || h.slice(1);
          });
        })).match(r), B = U.length, R = 0; R < B; R += 1) {
          var T = U[R], y = V[T], k = y && y[0], g = y && y[1];
          U[R] = g ? { regex: k, parser: g } : T.replace(/^\[|\]$/g, "");
        }
        return function(C) {
          for (var D = {}, v = 0, p = 0; v < B; v += 1) {
            var l = U[v];
            if (typeof l == "string") p += l.length;
            else {
              var m = l.regex, h = l.parser, S = C.slice(p), a = m.exec(S)[0];
              h.call(D, a), C = C.replace(a, "");
            }
          }
          return function(o) {
            var u = o.afternoon;
            if (u !== void 0) {
              var A = o.hours;
              u ? A < 12 && (o.hours += 12) : A === 12 && (o.hours = 0), delete o.afternoon;
            }
          }(D), D;
        };
      }
      return function(Y, E, W) {
        W.p.customParseFormat = !0, Y && Y.parseTwoDigitYear && (w = Y.parseTwoDigitYear);
        var U = E.prototype, B = U.parse;
        U.parse = function(R) {
          var T = R.date, y = R.utc, k = R.args;
          this.$u = y;
          var g = k[1];
          if (typeof g == "string") {
            var C = k[2] === !0, D = k[3] === !0, v = C || D, p = k[2];
            D && (p = k[2]), F = this.$locale(), !C && p && (F = W.Ls[p]), this.$d = function(S, a, o, u) {
              try {
                if (["x", "X"].indexOf(a) > -1) return new Date((a === "X" ? 1e3 : 1) * S);
                var A = L(a)(S), z = A.year, I = A.month, q = A.day, J = A.hours, K = A.minutes, it = A.seconds, pt = A.milliseconds, M = A.zone, H = A.week, N = /* @__PURE__ */ new Date(), d = q || (z || I ? 1 : N.getDate()), Z = z || N.getFullYear(), P = 0;
                z && !I || (P = I > 0 ? I - 1 : N.getMonth());
                var X, Q = J || 0, et = K || 0, ct = it || 0, st = pt || 0;
                return M ? new Date(Date.UTC(Z, P, d, Q, et, ct, st + 60 * M.offset * 1e3)) : o ? new Date(Date.UTC(Z, P, d, Q, et, ct, st)) : (X = new Date(Z, P, d, Q, et, ct, st), H && (X = u(X).week(H).toDate()), X);
              } catch {
                return /* @__PURE__ */ new Date("");
              }
            }(T, g, y, W), this.init(), p && p !== !0 && (this.$L = this.locale(p).$L), v && T != this.format(g) && (this.$d = /* @__PURE__ */ new Date("")), F = {};
          } else if (g instanceof Array) for (var l = g.length, m = 1; m <= l; m += 1) {
            k[1] = g[m - 1];
            var h = W.apply(this, k);
            if (h.isValid()) {
              this.$d = h.$d, this.$L = h.$L, this.init();
              break;
            }
            m === l && (this.$d = /* @__PURE__ */ new Date(""));
          }
          else B.call(this, R);
        };
      };
    });
  }(Te)), Te.exports;
}
var Wi = Hi();
const Pi = /* @__PURE__ */ ne(Wi);
var ve = { exports: {} }, Ni = ve.exports, tn;
function zi() {
  return tn || (tn = 1, function(t, e) {
    (function(n, r) {
      t.exports = r();
    })(Ni, function() {
      return function(n, r) {
        var i = r.prototype, s = i.format;
        i.format = function(c) {
          var b = this, F = this.$locale();
          if (!this.isValid()) return s.bind(this)(c);
          var w = this.$utils(), x = (c || "YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g, function(O) {
            switch (O) {
              case "Q":
                return Math.ceil((b.$M + 1) / 3);
              case "Do":
                return F.ordinal(b.$D);
              case "gggg":
                return b.weekYear();
              case "GGGG":
                return b.isoWeekYear();
              case "wo":
                return F.ordinal(b.week(), "W");
              case "w":
              case "ww":
                return w.s(b.week(), O === "w" ? 1 : 2, "0");
              case "W":
              case "WW":
                return w.s(b.isoWeek(), O === "W" ? 1 : 2, "0");
              case "k":
              case "kk":
                return w.s(String(b.$H === 0 ? 24 : b.$H), O === "k" ? 1 : 2, "0");
              case "X":
                return Math.floor(b.$d.getTime() / 1e3);
              case "x":
                return b.$d.getTime();
              case "z":
                return "[" + b.offsetName() + "]";
              case "zzz":
                return "[" + b.offsetName("long") + "]";
              default:
                return O;
            }
          });
          return s.bind(this)(x);
        };
      };
    });
  }(ve)), ve.exports;
}
var Bi = zi();
const Vi = /* @__PURE__ */ ne(Bi);
var xe = { exports: {} }, Zi = xe.exports, en;
function ji() {
  return en || (en = 1, function(t, e) {
    (function(n, r) {
      t.exports = r();
    })(Zi, function() {
      var n, r, i = 1e3, s = 6e4, c = 36e5, b = 864e5, F = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, w = 31536e6, x = 2628e6, O = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/, $ = { years: w, months: x, days: b, hours: c, minutes: s, seconds: i, milliseconds: 1, weeks: 6048e5 }, _ = function(T) {
        return T instanceof B;
      }, V = function(T, y, k) {
        return new B(T, k, y.$l);
      }, L = function(T) {
        return r.p(T) + "s";
      }, Y = function(T) {
        return T < 0;
      }, E = function(T) {
        return Y(T) ? Math.ceil(T) : Math.floor(T);
      }, W = function(T) {
        return Math.abs(T);
      }, U = function(T, y) {
        return T ? Y(T) ? { negative: !0, format: "" + W(T) + y } : { negative: !1, format: "" + T + y } : { negative: !1, format: "" };
      }, B = function() {
        function T(k, g, C) {
          var D = this;
          if (this.$d = {}, this.$l = C, k === void 0 && (this.$ms = 0, this.parseFromMilliseconds()), g) return V(k * $[L(g)], this);
          if (typeof k == "number") return this.$ms = k, this.parseFromMilliseconds(), this;
          if (typeof k == "object") return Object.keys(k).forEach(function(l) {
            D.$d[L(l)] = k[l];
          }), this.calMilliseconds(), this;
          if (typeof k == "string") {
            var v = k.match(O);
            if (v) {
              var p = v.slice(2).map(function(l) {
                return l != null ? Number(l) : 0;
              });
              return this.$d.years = p[0], this.$d.months = p[1], this.$d.weeks = p[2], this.$d.days = p[3], this.$d.hours = p[4], this.$d.minutes = p[5], this.$d.seconds = p[6], this.calMilliseconds(), this;
            }
          }
          return this;
        }
        var y = T.prototype;
        return y.calMilliseconds = function() {
          var k = this;
          this.$ms = Object.keys(this.$d).reduce(function(g, C) {
            return g + (k.$d[C] || 0) * $[C];
          }, 0);
        }, y.parseFromMilliseconds = function() {
          var k = this.$ms;
          this.$d.years = E(k / w), k %= w, this.$d.months = E(k / x), k %= x, this.$d.days = E(k / b), k %= b, this.$d.hours = E(k / c), k %= c, this.$d.minutes = E(k / s), k %= s, this.$d.seconds = E(k / i), k %= i, this.$d.milliseconds = k;
        }, y.toISOString = function() {
          var k = U(this.$d.years, "Y"), g = U(this.$d.months, "M"), C = +this.$d.days || 0;
          this.$d.weeks && (C += 7 * this.$d.weeks);
          var D = U(C, "D"), v = U(this.$d.hours, "H"), p = U(this.$d.minutes, "M"), l = this.$d.seconds || 0;
          this.$d.milliseconds && (l += this.$d.milliseconds / 1e3, l = Math.round(1e3 * l) / 1e3);
          var m = U(l, "S"), h = k.negative || g.negative || D.negative || v.negative || p.negative || m.negative, S = v.format || p.format || m.format ? "T" : "", a = (h ? "-" : "") + "P" + k.format + g.format + D.format + S + v.format + p.format + m.format;
          return a === "P" || a === "-P" ? "P0D" : a;
        }, y.toJSON = function() {
          return this.toISOString();
        }, y.format = function(k) {
          var g = k || "YYYY-MM-DDTHH:mm:ss", C = { Y: this.$d.years, YY: r.s(this.$d.years, 2, "0"), YYYY: r.s(this.$d.years, 4, "0"), M: this.$d.months, MM: r.s(this.$d.months, 2, "0"), D: this.$d.days, DD: r.s(this.$d.days, 2, "0"), H: this.$d.hours, HH: r.s(this.$d.hours, 2, "0"), m: this.$d.minutes, mm: r.s(this.$d.minutes, 2, "0"), s: this.$d.seconds, ss: r.s(this.$d.seconds, 2, "0"), SSS: r.s(this.$d.milliseconds, 3, "0") };
          return g.replace(F, function(D, v) {
            return v || String(C[D]);
          });
        }, y.as = function(k) {
          return this.$ms / $[L(k)];
        }, y.get = function(k) {
          var g = this.$ms, C = L(k);
          return C === "milliseconds" ? g %= 1e3 : g = C === "weeks" ? E(g / $[C]) : this.$d[C], g || 0;
        }, y.add = function(k, g, C) {
          var D;
          return D = g ? k * $[L(g)] : _(k) ? k.$ms : V(k, this).$ms, V(this.$ms + D * (C ? -1 : 1), this);
        }, y.subtract = function(k, g) {
          return this.add(k, g, !0);
        }, y.locale = function(k) {
          var g = this.clone();
          return g.$l = k, g;
        }, y.clone = function() {
          return V(this.$ms, this);
        }, y.humanize = function(k) {
          return n().add(this.$ms, "ms").locale(this.$l).fromNow(!k);
        }, y.valueOf = function() {
          return this.asMilliseconds();
        }, y.milliseconds = function() {
          return this.get("milliseconds");
        }, y.asMilliseconds = function() {
          return this.as("milliseconds");
        }, y.seconds = function() {
          return this.get("seconds");
        }, y.asSeconds = function() {
          return this.as("seconds");
        }, y.minutes = function() {
          return this.get("minutes");
        }, y.asMinutes = function() {
          return this.as("minutes");
        }, y.hours = function() {
          return this.get("hours");
        }, y.asHours = function() {
          return this.as("hours");
        }, y.days = function() {
          return this.get("days");
        }, y.asDays = function() {
          return this.as("days");
        }, y.weeks = function() {
          return this.get("weeks");
        }, y.asWeeks = function() {
          return this.as("weeks");
        }, y.months = function() {
          return this.get("months");
        }, y.asMonths = function() {
          return this.as("months");
        }, y.years = function() {
          return this.get("years");
        }, y.asYears = function() {
          return this.as("years");
        }, T;
      }(), R = function(T, y, k) {
        return T.add(y.years() * k, "y").add(y.months() * k, "M").add(y.days() * k, "d").add(y.hours() * k, "h").add(y.minutes() * k, "m").add(y.seconds() * k, "s").add(y.milliseconds() * k, "ms");
      };
      return function(T, y, k) {
        n = k, r = k().$utils(), k.duration = function(D, v) {
          var p = k.locale();
          return V(D, { $l: p }, v);
        }, k.isDuration = _;
        var g = y.prototype.add, C = y.prototype.subtract;
        y.prototype.add = function(D, v) {
          return _(D) ? R(this, D, 1) : g.bind(this)(D, v);
        }, y.prototype.subtract = function(D, v) {
          return _(D) ? R(this, D, -1) : C.bind(this)(D, v);
        };
      };
    });
  }(xe)), xe.exports;
}
var Xi = ji();
const qi = /* @__PURE__ */ ne(Xi);
var be = function() {
  var t = /* @__PURE__ */ f(function(p, l, m, h) {
    for (m = m || {}, h = p.length; h--; m[p[h]] = l) ;
    return m;
  }, "o"), e = [6, 8, 10, 12, 13, 14, 15, 16, 17, 18, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 33, 35, 36, 38, 40], n = [1, 26], r = [1, 27], i = [1, 28], s = [1, 29], c = [1, 30], b = [1, 31], F = [1, 32], w = [1, 33], x = [1, 34], O = [1, 9], $ = [1, 10], _ = [1, 11], V = [1, 12], L = [1, 13], Y = [1, 14], E = [1, 15], W = [1, 16], U = [1, 19], B = [1, 20], R = [1, 21], T = [1, 22], y = [1, 23], k = [1, 25], g = [1, 35], C = {
    trace: /* @__PURE__ */ f(function() {
    }, "trace"),
    yy: {},
    symbols_: { error: 2, start: 3, gantt: 4, document: 5, EOF: 6, line: 7, SPACE: 8, statement: 9, NL: 10, weekday: 11, weekday_monday: 12, weekday_tuesday: 13, weekday_wednesday: 14, weekday_thursday: 15, weekday_friday: 16, weekday_saturday: 17, weekday_sunday: 18, weekend: 19, weekend_friday: 20, weekend_saturday: 21, dateFormat: 22, inclusiveEndDates: 23, topAxis: 24, axisFormat: 25, tickInterval: 26, excludes: 27, includes: 28, todayMarker: 29, title: 30, acc_title: 31, acc_title_value: 32, acc_descr: 33, acc_descr_value: 34, acc_descr_multiline_value: 35, section: 36, clickStatement: 37, taskTxt: 38, taskData: 39, click: 40, callbackname: 41, callbackargs: 42, href: 43, clickStatementDebug: 44, $accept: 0, $end: 1 },
    terminals_: { 2: "error", 4: "gantt", 6: "EOF", 8: "SPACE", 10: "NL", 12: "weekday_monday", 13: "weekday_tuesday", 14: "weekday_wednesday", 15: "weekday_thursday", 16: "weekday_friday", 17: "weekday_saturday", 18: "weekday_sunday", 20: "weekend_friday", 21: "weekend_saturday", 22: "dateFormat", 23: "inclusiveEndDates", 24: "topAxis", 25: "axisFormat", 26: "tickInterval", 27: "excludes", 28: "includes", 29: "todayMarker", 30: "title", 31: "acc_title", 32: "acc_title_value", 33: "acc_descr", 34: "acc_descr_value", 35: "acc_descr_multiline_value", 36: "section", 38: "taskTxt", 39: "taskData", 40: "click", 41: "callbackname", 42: "callbackargs", 43: "href" },
    productions_: [0, [3, 3], [5, 0], [5, 2], [7, 2], [7, 1], [7, 1], [7, 1], [11, 1], [11, 1], [11, 1], [11, 1], [11, 1], [11, 1], [11, 1], [19, 1], [19, 1], [9, 1], [9, 1], [9, 1], [9, 1], [9, 1], [9, 1], [9, 1], [9, 1], [9, 1], [9, 1], [9, 1], [9, 2], [9, 2], [9, 1], [9, 1], [9, 1], [9, 2], [37, 2], [37, 3], [37, 3], [37, 4], [37, 3], [37, 4], [37, 2], [44, 2], [44, 3], [44, 3], [44, 4], [44, 3], [44, 4], [44, 2]],
    performAction: /* @__PURE__ */ f(function(p, l, m, h, S, a, o) {
      var u = a.length - 1;
      switch (S) {
        case 1:
          return a[u - 1];
        case 2:
          this.$ = [];
          break;
        case 3:
          a[u - 1].push(a[u]), this.$ = a[u - 1];
          break;
        case 4:
        case 5:
          this.$ = a[u];
          break;
        case 6:
        case 7:
          this.$ = [];
          break;
        case 8:
          h.setWeekday("monday");
          break;
        case 9:
          h.setWeekday("tuesday");
          break;
        case 10:
          h.setWeekday("wednesday");
          break;
        case 11:
          h.setWeekday("thursday");
          break;
        case 12:
          h.setWeekday("friday");
          break;
        case 13:
          h.setWeekday("saturday");
          break;
        case 14:
          h.setWeekday("sunday");
          break;
        case 15:
          h.setWeekend("friday");
          break;
        case 16:
          h.setWeekend("saturday");
          break;
        case 17:
          h.setDateFormat(a[u].substr(11)), this.$ = a[u].substr(11);
          break;
        case 18:
          h.enableInclusiveEndDates(), this.$ = a[u].substr(18);
          break;
        case 19:
          h.TopAxis(), this.$ = a[u].substr(8);
          break;
        case 20:
          h.setAxisFormat(a[u].substr(11)), this.$ = a[u].substr(11);
          break;
        case 21:
          h.setTickInterval(a[u].substr(13)), this.$ = a[u].substr(13);
          break;
        case 22:
          h.setExcludes(a[u].substr(9)), this.$ = a[u].substr(9);
          break;
        case 23:
          h.setIncludes(a[u].substr(9)), this.$ = a[u].substr(9);
          break;
        case 24:
          h.setTodayMarker(a[u].substr(12)), this.$ = a[u].substr(12);
          break;
        case 27:
          h.setDiagramTitle(a[u].substr(6)), this.$ = a[u].substr(6);
          break;
        case 28:
          this.$ = a[u].trim(), h.setAccTitle(this.$);
          break;
        case 29:
        case 30:
          this.$ = a[u].trim(), h.setAccDescription(this.$);
          break;
        case 31:
          h.addSection(a[u].substr(8)), this.$ = a[u].substr(8);
          break;
        case 33:
          h.addTask(a[u - 1], a[u]), this.$ = "task";
          break;
        case 34:
          this.$ = a[u - 1], h.setClickEvent(a[u - 1], a[u], null);
          break;
        case 35:
          this.$ = a[u - 2], h.setClickEvent(a[u - 2], a[u - 1], a[u]);
          break;
        case 36:
          this.$ = a[u - 2], h.setClickEvent(a[u - 2], a[u - 1], null), h.setLink(a[u - 2], a[u]);
          break;
        case 37:
          this.$ = a[u - 3], h.setClickEvent(a[u - 3], a[u - 2], a[u - 1]), h.setLink(a[u - 3], a[u]);
          break;
        case 38:
          this.$ = a[u - 2], h.setClickEvent(a[u - 2], a[u], null), h.setLink(a[u - 2], a[u - 1]);
          break;
        case 39:
          this.$ = a[u - 3], h.setClickEvent(a[u - 3], a[u - 1], a[u]), h.setLink(a[u - 3], a[u - 2]);
          break;
        case 40:
          this.$ = a[u - 1], h.setLink(a[u - 1], a[u]);
          break;
        case 41:
        case 47:
          this.$ = a[u - 1] + " " + a[u];
          break;
        case 42:
        case 43:
        case 45:
          this.$ = a[u - 2] + " " + a[u - 1] + " " + a[u];
          break;
        case 44:
        case 46:
          this.$ = a[u - 3] + " " + a[u - 2] + " " + a[u - 1] + " " + a[u];
          break;
      }
    }, "anonymous"),
    table: [{ 3: 1, 4: [1, 2] }, { 1: [3] }, t(e, [2, 2], { 5: 3 }), { 6: [1, 4], 7: 5, 8: [1, 6], 9: 7, 10: [1, 8], 11: 17, 12: n, 13: r, 14: i, 15: s, 16: c, 17: b, 18: F, 19: 18, 20: w, 21: x, 22: O, 23: $, 24: _, 25: V, 26: L, 27: Y, 28: E, 29: W, 30: U, 31: B, 33: R, 35: T, 36: y, 37: 24, 38: k, 40: g }, t(e, [2, 7], { 1: [2, 1] }), t(e, [2, 3]), { 9: 36, 11: 17, 12: n, 13: r, 14: i, 15: s, 16: c, 17: b, 18: F, 19: 18, 20: w, 21: x, 22: O, 23: $, 24: _, 25: V, 26: L, 27: Y, 28: E, 29: W, 30: U, 31: B, 33: R, 35: T, 36: y, 37: 24, 38: k, 40: g }, t(e, [2, 5]), t(e, [2, 6]), t(e, [2, 17]), t(e, [2, 18]), t(e, [2, 19]), t(e, [2, 20]), t(e, [2, 21]), t(e, [2, 22]), t(e, [2, 23]), t(e, [2, 24]), t(e, [2, 25]), t(e, [2, 26]), t(e, [2, 27]), { 32: [1, 37] }, { 34: [1, 38] }, t(e, [2, 30]), t(e, [2, 31]), t(e, [2, 32]), { 39: [1, 39] }, t(e, [2, 8]), t(e, [2, 9]), t(e, [2, 10]), t(e, [2, 11]), t(e, [2, 12]), t(e, [2, 13]), t(e, [2, 14]), t(e, [2, 15]), t(e, [2, 16]), { 41: [1, 40], 43: [1, 41] }, t(e, [2, 4]), t(e, [2, 28]), t(e, [2, 29]), t(e, [2, 33]), t(e, [2, 34], { 42: [1, 42], 43: [1, 43] }), t(e, [2, 40], { 41: [1, 44] }), t(e, [2, 35], { 43: [1, 45] }), t(e, [2, 36]), t(e, [2, 38], { 42: [1, 46] }), t(e, [2, 37]), t(e, [2, 39])],
    defaultActions: {},
    parseError: /* @__PURE__ */ f(function(p, l) {
      if (l.recoverable)
        this.trace(p);
      else {
        var m = new Error(p);
        throw m.hash = l, m;
      }
    }, "parseError"),
    parse: /* @__PURE__ */ f(function(p) {
      var l = this, m = [0], h = [], S = [null], a = [], o = this.table, u = "", A = 0, z = 0, I = 2, q = 1, J = a.slice.call(arguments, 1), K = Object.create(this.lexer), it = { yy: {} };
      for (var pt in this.yy)
        Object.prototype.hasOwnProperty.call(this.yy, pt) && (it.yy[pt] = this.yy[pt]);
      K.setInput(p, it.yy), it.yy.lexer = K, it.yy.parser = this, typeof K.yylloc > "u" && (K.yylloc = {});
      var M = K.yylloc;
      a.push(M);
      var H = K.options && K.options.ranges;
      typeof it.yy.parseError == "function" ? this.parseError = it.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
      function N(at) {
        m.length = m.length - 2 * at, S.length = S.length - at, a.length = a.length - at;
      }
      f(N, "popStack");
      function d() {
        var at;
        return at = h.pop() || K.lex() || q, typeof at != "number" && (at instanceof Array && (h = at, at = h.pop()), at = l.symbols_[at] || at), at;
      }
      f(d, "lex");
      for (var Z, P, X, Q, et = {}, ct, st, He, Zt; ; ) {
        if (P = m[m.length - 1], this.defaultActions[P] ? X = this.defaultActions[P] : ((Z === null || typeof Z > "u") && (Z = d()), X = o[P] && o[P][Z]), typeof X > "u" || !X.length || !X[0]) {
          var re = "";
          Zt = [];
          for (ct in o[P])
            this.terminals_[ct] && ct > I && Zt.push("'" + this.terminals_[ct] + "'");
          K.showPosition ? re = "Parse error on line " + (A + 1) + `:
` + K.showPosition() + `
Expecting ` + Zt.join(", ") + ", got '" + (this.terminals_[Z] || Z) + "'" : re = "Parse error on line " + (A + 1) + ": Unexpected " + (Z == q ? "end of input" : "'" + (this.terminals_[Z] || Z) + "'"), this.parseError(re, {
            text: K.match,
            token: this.terminals_[Z] || Z,
            line: K.yylineno,
            loc: M,
            expected: Zt
          });
        }
        if (X[0] instanceof Array && X.length > 1)
          throw new Error("Parse Error: multiple actions possible at state: " + P + ", token: " + Z);
        switch (X[0]) {
          case 1:
            m.push(Z), S.push(K.yytext), a.push(K.yylloc), m.push(X[1]), Z = null, z = K.yyleng, u = K.yytext, A = K.yylineno, M = K.yylloc;
            break;
          case 2:
            if (st = this.productions_[X[1]][1], et.$ = S[S.length - st], et._$ = {
              first_line: a[a.length - (st || 1)].first_line,
              last_line: a[a.length - 1].last_line,
              first_column: a[a.length - (st || 1)].first_column,
              last_column: a[a.length - 1].last_column
            }, H && (et._$.range = [
              a[a.length - (st || 1)].range[0],
              a[a.length - 1].range[1]
            ]), Q = this.performAction.apply(et, [
              u,
              z,
              A,
              it.yy,
              X[1],
              S,
              a
            ].concat(J)), typeof Q < "u")
              return Q;
            st && (m = m.slice(0, -1 * st * 2), S = S.slice(0, -1 * st), a = a.slice(0, -1 * st)), m.push(this.productions_[X[1]][0]), S.push(et.$), a.push(et._$), He = o[m[m.length - 2]][m[m.length - 1]], m.push(He);
            break;
          case 3:
            return !0;
        }
      }
      return !0;
    }, "parse")
  }, D = /* @__PURE__ */ function() {
    var p = {
      EOF: 1,
      parseError: /* @__PURE__ */ f(function(l, m) {
        if (this.yy.parser)
          this.yy.parser.parseError(l, m);
        else
          throw new Error(l);
      }, "parseError"),
      // resets the lexer, sets new input
      setInput: /* @__PURE__ */ f(function(l, m) {
        return this.yy = m || this.yy || {}, this._input = l, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
          first_line: 1,
          first_column: 0,
          last_line: 1,
          last_column: 0
        }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
      }, "setInput"),
      // consumes and returns one char from the input
      input: /* @__PURE__ */ f(function() {
        var l = this._input[0];
        this.yytext += l, this.yyleng++, this.offset++, this.match += l, this.matched += l;
        var m = l.match(/(?:\r\n?|\n).*/g);
        return m ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), l;
      }, "input"),
      // unshifts one char (or a string) into the input
      unput: /* @__PURE__ */ f(function(l) {
        var m = l.length, h = l.split(/(?:\r\n?|\n)/g);
        this._input = l + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - m), this.offset -= m;
        var S = this.match.split(/(?:\r\n?|\n)/g);
        this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), h.length - 1 && (this.yylineno -= h.length - 1);
        var a = this.yylloc.range;
        return this.yylloc = {
          first_line: this.yylloc.first_line,
          last_line: this.yylineno + 1,
          first_column: this.yylloc.first_column,
          last_column: h ? (h.length === S.length ? this.yylloc.first_column : 0) + S[S.length - h.length].length - h[0].length : this.yylloc.first_column - m
        }, this.options.ranges && (this.yylloc.range = [a[0], a[0] + this.yyleng - m]), this.yyleng = this.yytext.length, this;
      }, "unput"),
      // When called from action, caches matched text and appends it on next action
      more: /* @__PURE__ */ f(function() {
        return this._more = !0, this;
      }, "more"),
      // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.
      reject: /* @__PURE__ */ f(function() {
        if (this.options.backtrack_lexer)
          this._backtrack = !0;
        else
          return this.parseError("Lexical error on line " + (this.yylineno + 1) + `. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
` + this.showPosition(), {
            text: "",
            token: null,
            line: this.yylineno
          });
        return this;
      }, "reject"),
      // retain first n characters of the match
      less: /* @__PURE__ */ f(function(l) {
        this.unput(this.match.slice(l));
      }, "less"),
      // displays already matched input, i.e. for error messages
      pastInput: /* @__PURE__ */ f(function() {
        var l = this.matched.substr(0, this.matched.length - this.match.length);
        return (l.length > 20 ? "..." : "") + l.substr(-20).replace(/\n/g, "");
      }, "pastInput"),
      // displays upcoming input, i.e. for error messages
      upcomingInput: /* @__PURE__ */ f(function() {
        var l = this.match;
        return l.length < 20 && (l += this._input.substr(0, 20 - l.length)), (l.substr(0, 20) + (l.length > 20 ? "..." : "")).replace(/\n/g, "");
      }, "upcomingInput"),
      // displays the character position where the lexing error occurred, i.e. for error messages
      showPosition: /* @__PURE__ */ f(function() {
        var l = this.pastInput(), m = new Array(l.length + 1).join("-");
        return l + this.upcomingInput() + `
` + m + "^";
      }, "showPosition"),
      // test the lexed token: return FALSE when not a match, otherwise return token
      test_match: /* @__PURE__ */ f(function(l, m) {
        var h, S, a;
        if (this.options.backtrack_lexer && (a = {
          yylineno: this.yylineno,
          yylloc: {
            first_line: this.yylloc.first_line,
            last_line: this.last_line,
            first_column: this.yylloc.first_column,
            last_column: this.yylloc.last_column
          },
          yytext: this.yytext,
          match: this.match,
          matches: this.matches,
          matched: this.matched,
          yyleng: this.yyleng,
          offset: this.offset,
          _more: this._more,
          _input: this._input,
          yy: this.yy,
          conditionStack: this.conditionStack.slice(0),
          done: this.done
        }, this.options.ranges && (a.yylloc.range = this.yylloc.range.slice(0))), S = l[0].match(/(?:\r\n?|\n).*/g), S && (this.yylineno += S.length), this.yylloc = {
          first_line: this.yylloc.last_line,
          last_line: this.yylineno + 1,
          first_column: this.yylloc.last_column,
          last_column: S ? S[S.length - 1].length - S[S.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + l[0].length
        }, this.yytext += l[0], this.match += l[0], this.matches = l, this.yyleng = this.yytext.length, this.options.ranges && (this.yylloc.range = [this.offset, this.offset += this.yyleng]), this._more = !1, this._backtrack = !1, this._input = this._input.slice(l[0].length), this.matched += l[0], h = this.performAction.call(this, this.yy, this, m, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), h)
          return h;
        if (this._backtrack) {
          for (var o in a)
            this[o] = a[o];
          return !1;
        }
        return !1;
      }, "test_match"),
      // return next match in input
      next: /* @__PURE__ */ f(function() {
        if (this.done)
          return this.EOF;
        this._input || (this.done = !0);
        var l, m, h, S;
        this._more || (this.yytext = "", this.match = "");
        for (var a = this._currentRules(), o = 0; o < a.length; o++)
          if (h = this._input.match(this.rules[a[o]]), h && (!m || h[0].length > m[0].length)) {
            if (m = h, S = o, this.options.backtrack_lexer) {
              if (l = this.test_match(h, a[o]), l !== !1)
                return l;
              if (this._backtrack) {
                m = !1;
                continue;
              } else
                return !1;
            } else if (!this.options.flex)
              break;
          }
        return m ? (l = this.test_match(m, a[S]), l !== !1 ? l : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
` + this.showPosition(), {
          text: "",
          token: null,
          line: this.yylineno
        });
      }, "next"),
      // return next match that has a token
      lex: /* @__PURE__ */ f(function() {
        var l = this.next();
        return l || this.lex();
      }, "lex"),
      // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
      begin: /* @__PURE__ */ f(function(l) {
        this.conditionStack.push(l);
      }, "begin"),
      // pop the previously active lexer condition state off the condition stack
      popState: /* @__PURE__ */ f(function() {
        var l = this.conditionStack.length - 1;
        return l > 0 ? this.conditionStack.pop() : this.conditionStack[0];
      }, "popState"),
      // produce the lexer rule set which is active for the currently active lexer condition state
      _currentRules: /* @__PURE__ */ f(function() {
        return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
      }, "_currentRules"),
      // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
      topState: /* @__PURE__ */ f(function(l) {
        return l = this.conditionStack.length - 1 - Math.abs(l || 0), l >= 0 ? this.conditionStack[l] : "INITIAL";
      }, "topState"),
      // alias for begin(condition)
      pushState: /* @__PURE__ */ f(function(l) {
        this.begin(l);
      }, "pushState"),
      // return the number of states currently on the stack
      stateStackSize: /* @__PURE__ */ f(function() {
        return this.conditionStack.length;
      }, "stateStackSize"),
      options: { "case-insensitive": !0 },
      performAction: /* @__PURE__ */ f(function(l, m, h, S) {
        switch (h) {
          case 0:
            return this.begin("open_directive"), "open_directive";
          case 1:
            return this.begin("acc_title"), 31;
          case 2:
            return this.popState(), "acc_title_value";
          case 3:
            return this.begin("acc_descr"), 33;
          case 4:
            return this.popState(), "acc_descr_value";
          case 5:
            this.begin("acc_descr_multiline");
            break;
          case 6:
            this.popState();
            break;
          case 7:
            return "acc_descr_multiline_value";
          case 8:
            break;
          case 9:
            break;
          case 10:
            break;
          case 11:
            return 10;
          case 12:
            break;
          case 13:
            break;
          case 14:
            this.begin("href");
            break;
          case 15:
            this.popState();
            break;
          case 16:
            return 43;
          case 17:
            this.begin("callbackname");
            break;
          case 18:
            this.popState();
            break;
          case 19:
            this.popState(), this.begin("callbackargs");
            break;
          case 20:
            return 41;
          case 21:
            this.popState();
            break;
          case 22:
            return 42;
          case 23:
            this.begin("click");
            break;
          case 24:
            this.popState();
            break;
          case 25:
            return 40;
          case 26:
            return 4;
          case 27:
            return 22;
          case 28:
            return 23;
          case 29:
            return 24;
          case 30:
            return 25;
          case 31:
            return 26;
          case 32:
            return 28;
          case 33:
            return 27;
          case 34:
            return 29;
          case 35:
            return 12;
          case 36:
            return 13;
          case 37:
            return 14;
          case 38:
            return 15;
          case 39:
            return 16;
          case 40:
            return 17;
          case 41:
            return 18;
          case 42:
            return 20;
          case 43:
            return 21;
          case 44:
            return "date";
          case 45:
            return 30;
          case 46:
            return "accDescription";
          case 47:
            return 36;
          case 48:
            return 38;
          case 49:
            return 39;
          case 50:
            return ":";
          case 51:
            return 6;
          case 52:
            return "INVALID";
        }
      }, "anonymous"),
      rules: [/^(?:%%\{)/i, /^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?:%%(?!\{)*[^\n]*)/i, /^(?:[^\}]%%*[^\n]*)/i, /^(?:%%*[^\n]*[\n]*)/i, /^(?:[\n]+)/i, /^(?:\s+)/i, /^(?:%[^\n]*)/i, /^(?:href[\s]+["])/i, /^(?:["])/i, /^(?:[^"]*)/i, /^(?:call[\s]+)/i, /^(?:\([\s]*\))/i, /^(?:\()/i, /^(?:[^(]*)/i, /^(?:\))/i, /^(?:[^)]*)/i, /^(?:click[\s]+)/i, /^(?:[\s\n])/i, /^(?:[^\s\n]*)/i, /^(?:gantt\b)/i, /^(?:dateFormat\s[^#\n;]+)/i, /^(?:inclusiveEndDates\b)/i, /^(?:topAxis\b)/i, /^(?:axisFormat\s[^#\n;]+)/i, /^(?:tickInterval\s[^#\n;]+)/i, /^(?:includes\s[^#\n;]+)/i, /^(?:excludes\s[^#\n;]+)/i, /^(?:todayMarker\s[^\n;]+)/i, /^(?:weekday\s+monday\b)/i, /^(?:weekday\s+tuesday\b)/i, /^(?:weekday\s+wednesday\b)/i, /^(?:weekday\s+thursday\b)/i, /^(?:weekday\s+friday\b)/i, /^(?:weekday\s+saturday\b)/i, /^(?:weekday\s+sunday\b)/i, /^(?:weekend\s+friday\b)/i, /^(?:weekend\s+saturday\b)/i, /^(?:\d\d\d\d-\d\d-\d\d\b)/i, /^(?:title\s[^\n]+)/i, /^(?:accDescription\s[^#\n;]+)/i, /^(?:section\s[^\n]+)/i, /^(?:[^:\n]+)/i, /^(?::[^#\n;]+)/i, /^(?::)/i, /^(?:$)/i, /^(?:.)/i],
      conditions: { acc_descr_multiline: { rules: [6, 7], inclusive: !1 }, acc_descr: { rules: [4], inclusive: !1 }, acc_title: { rules: [2], inclusive: !1 }, callbackargs: { rules: [21, 22], inclusive: !1 }, callbackname: { rules: [18, 19, 20], inclusive: !1 }, href: { rules: [15, 16], inclusive: !1 }, click: { rules: [24, 25], inclusive: !1 }, INITIAL: { rules: [0, 1, 3, 5, 8, 9, 10, 11, 12, 13, 14, 17, 23, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52], inclusive: !0 } }
    };
    return p;
  }();
  C.lexer = D;
  function v() {
    this.yy = {};
  }
  return f(v, "Parser"), v.prototype = C, C.Parser = v, new v();
}();
be.parser = be;
var Ri = be;
rt.extend(Oi);
rt.extend(Pi);
rt.extend(Vi);
var nn = { friday: 5, saturday: 6 }, ut = "", _e = "", Se = void 0, Ye = "", zt = [], Bt = [], Fe = /* @__PURE__ */ new Map(), Ae = [], te = [], Et = "", Ee = "", _n = ["active", "done", "crit", "milestone", "vert"], Le = [], $t = "", Vt = !1, Ue = !1, Oe = "sunday", ee = "saturday", we = 0, Ji = /* @__PURE__ */ f(function() {
  Ae = [], te = [], Et = "", Le = [], Rt = 0, Ce = void 0, Jt = void 0, G = [], ut = "", _e = "", Ee = "", Se = void 0, Ye = "", zt = [], Bt = [], Vt = !1, Ue = !1, we = 0, Fe = /* @__PURE__ */ new Map(), $t = "", Zn(), Oe = "sunday", ee = "saturday";
}, "clear"), Ki = /* @__PURE__ */ f(function(t) {
  $t = t;
}, "setDiagramId"), Qi = /* @__PURE__ */ f(function(t) {
  _e = t;
}, "setAxisFormat"), Gi = /* @__PURE__ */ f(function() {
  return _e;
}, "getAxisFormat"), ts = /* @__PURE__ */ f(function(t) {
  Se = t;
}, "setTickInterval"), es = /* @__PURE__ */ f(function() {
  return Se;
}, "getTickInterval"), ns = /* @__PURE__ */ f(function(t) {
  Ye = t;
}, "setTodayMarker"), rs = /* @__PURE__ */ f(function() {
  return Ye;
}, "getTodayMarker"), is = /* @__PURE__ */ f(function(t) {
  ut = t;
}, "setDateFormat"), ss = /* @__PURE__ */ f(function() {
  Vt = !0;
}, "enableInclusiveEndDates"), as = /* @__PURE__ */ f(function() {
  return Vt;
}, "endDatesAreInclusive"), os = /* @__PURE__ */ f(function() {
  Ue = !0;
}, "enableTopAxis"), cs = /* @__PURE__ */ f(function() {
  return Ue;
}, "topAxisEnabled"), us = /* @__PURE__ */ f(function(t) {
  Ee = t;
}, "setDisplayMode"), ls = /* @__PURE__ */ f(function() {
  return Ee;
}, "getDisplayMode"), ds = /* @__PURE__ */ f(function() {
  return ut;
}, "getDateFormat"), hs = /* @__PURE__ */ f(function(t) {
  zt = t.toLowerCase().split(/[\s,]+/);
}, "setIncludes"), fs = /* @__PURE__ */ f(function() {
  return zt;
}, "getIncludes"), gs = /* @__PURE__ */ f(function(t) {
  Bt = t.toLowerCase().split(/[\s,]+/);
}, "setExcludes"), ms = /* @__PURE__ */ f(function() {
  return Bt;
}, "getExcludes"), ys = /* @__PURE__ */ f(function() {
  return Fe;
}, "getLinks"), ks = /* @__PURE__ */ f(function(t) {
  Et = t, Ae.push(t);
}, "addSection"), ps = /* @__PURE__ */ f(function() {
  return Ae;
}, "getSections"), Ts = /* @__PURE__ */ f(function() {
  let t = rn();
  const e = 10;
  let n = 0;
  for (; !t && n < e; )
    t = rn(), n++;
  return te = G, te;
}, "getTasks"), Sn = /* @__PURE__ */ f(function(t, e, n, r) {
  const i = t.format(e.trim()), s = t.format("YYYY-MM-DD");
  return r.includes(i) || r.includes(s) ? !1 : n.includes("weekends") && (t.isoWeekday() === nn[ee] || t.isoWeekday() === nn[ee] + 1) || n.includes(t.format("dddd").toLowerCase()) ? !0 : n.includes(i) || n.includes(s);
}, "isInvalidDate"), vs = /* @__PURE__ */ f(function(t) {
  Oe = t;
}, "setWeekday"), xs = /* @__PURE__ */ f(function() {
  return Oe;
}, "getWeekday"), bs = /* @__PURE__ */ f(function(t) {
  ee = t;
}, "setWeekend"), Yn = /* @__PURE__ */ f(function(t, e, n, r) {
  if (!n.length || t.manualEndTime)
    return;
  let i;
  t.startTime instanceof Date ? i = rt(t.startTime) : i = rt(t.startTime, e, !0), i = i.add(1, "d");
  let s;
  t.endTime instanceof Date ? s = rt(t.endTime) : s = rt(t.endTime, e, !0);
  const [c, b] = ws(
    i,
    s,
    e,
    n,
    r
  );
  t.endTime = c.toDate(), t.renderEndTime = b;
}, "checkTaskDates"), ws = /* @__PURE__ */ f(function(t, e, n, r, i) {
  let s = !1, c = null;
  for (; t <= e; )
    s || (c = e.toDate()), s = Sn(t, n, r, i), s && (e = e.add(1, "d")), t = t.add(1, "d");
  return [e, c];
}, "fixTaskDates"), De = /* @__PURE__ */ f(function(t, e, n) {
  if (n = n.trim(), (/* @__PURE__ */ f((s) => {
    const c = s.trim();
    return c === "x" || c === "X";
  }, "isTimestampFormat"))(e) && /^\d+$/.test(n))
    return new Date(Number(n));
  const r = /^after\s+(?<ids>[\d\w- ]+)/.exec(n);
  if (r !== null) {
    let s = null;
    for (const b of r.groups.ids.split(" ")) {
      let F = Ct(b);
      F !== void 0 && (!s || F.endTime > s.endTime) && (s = F);
    }
    if (s)
      return s.endTime;
    const c = /* @__PURE__ */ new Date();
    return c.setHours(0, 0, 0, 0), c;
  }
  let i = rt(n, e.trim(), !0);
  if (i.isValid())
    return i.toDate();
  {
    Tt.debug("Invalid date:" + n), Tt.debug("With date format:" + e.trim());
    const s = new Date(n);
    if (s === void 0 || isNaN(s.getTime()) || // WebKit browsers can mis-parse invalid dates to be ridiculously
    // huge numbers, e.g. new Date('202304') gets parsed as January 1, 202304.
    // This can cause virtually infinite loops while rendering, so for the
    // purposes of Gantt charts we'll just treat any date beyond 10,000 AD/BC as
    // invalid.
    s.getFullYear() < -1e4 || s.getFullYear() > 1e4)
      throw new Error("Invalid date:" + n);
    return s;
  }
}, "getStartDate"), Fn = /* @__PURE__ */ f(function(t) {
  const e = /^(\d+(?:\.\d+)?)([Mdhmswy]|ms)$/.exec(t.trim());
  return e !== null ? [Number.parseFloat(e[1]), e[2]] : [NaN, "ms"];
}, "parseDuration"), An = /* @__PURE__ */ f(function(t, e, n, r = !1) {
  n = n.trim();
  const i = /^until\s+(?<ids>[\d\w- ]+)/.exec(n);
  if (i !== null) {
    let w = null;
    for (const O of i.groups.ids.split(" ")) {
      let $ = Ct(O);
      $ !== void 0 && (!w || $.startTime < w.startTime) && (w = $);
    }
    if (w)
      return w.startTime;
    const x = /* @__PURE__ */ new Date();
    return x.setHours(0, 0, 0, 0), x;
  }
  let s = rt(n, e.trim(), !0);
  if (s.isValid())
    return r && (s = s.add(1, "d")), s.toDate();
  let c = rt(t);
  const [b, F] = Fn(n);
  if (!Number.isNaN(b)) {
    const w = c.add(b, F);
    w.isValid() && (c = w);
  }
  return c.toDate();
}, "getEndDate"), Rt = 0, Yt = /* @__PURE__ */ f(function(t) {
  return t === void 0 ? (Rt = Rt + 1, "task" + Rt) : t;
}, "parseId"), Ds = /* @__PURE__ */ f(function(t, e) {
  let n;
  e.substr(0, 1) === ":" ? n = e.substr(1, e.length) : n = e;
  const r = n.split(","), i = {};
  Ie(r, i, _n);
  for (let c = 0; c < r.length; c++)
    r[c] = r[c].trim();
  let s = "";
  switch (r.length) {
    case 1:
      i.id = Yt(), i.startTime = t.endTime, s = r[0];
      break;
    case 2:
      i.id = Yt(), i.startTime = De(void 0, ut, r[0]), s = r[1];
      break;
    case 3:
      i.id = Yt(r[0]), i.startTime = De(void 0, ut, r[1]), s = r[2];
      break;
  }
  return s && (i.endTime = An(i.startTime, ut, s, Vt), i.manualEndTime = rt(s, "YYYY-MM-DD", !0).isValid(), Yn(i, ut, Bt, zt)), i;
}, "compileData"), Cs = /* @__PURE__ */ f(function(t, e) {
  let n;
  e.substr(0, 1) === ":" ? n = e.substr(1, e.length) : n = e;
  const r = n.split(","), i = {};
  Ie(r, i, _n);
  for (let s = 0; s < r.length; s++)
    r[s] = r[s].trim();
  switch (r.length) {
    case 1:
      i.id = Yt(), i.startTime = {
        type: "prevTaskEnd",
        id: t
      }, i.endTime = {
        data: r[0]
      };
      break;
    case 2:
      i.id = Yt(), i.startTime = {
        type: "getStartDate",
        startData: r[0]
      }, i.endTime = {
        data: r[1]
      };
      break;
    case 3:
      i.id = Yt(r[0]), i.startTime = {
        type: "getStartDate",
        startData: r[1]
      }, i.endTime = {
        data: r[2]
      };
      break;
  }
  return i;
}, "parseData"), Ce, Jt, G = [], En = {}, Ms = /* @__PURE__ */ f(function(t, e) {
  const n = {
    section: Et,
    type: Et,
    processed: !1,
    manualEndTime: !1,
    renderEndTime: null,
    raw: { data: e },
    task: t,
    classes: []
  }, r = Cs(Jt, e);
  n.raw.startTime = r.startTime, n.raw.endTime = r.endTime, n.id = r.id, n.prevTaskId = Jt, n.active = r.active, n.done = r.done, n.crit = r.crit, n.milestone = r.milestone, n.vert = r.vert, n.order = we, we++;
  const i = G.push(n);
  Jt = n.id, En[n.id] = i - 1;
}, "addTask"), Ct = /* @__PURE__ */ f(function(t) {
  const e = En[t];
  return G[e];
}, "findTaskById"), $s = /* @__PURE__ */ f(function(t, e) {
  const n = {
    section: Et,
    type: Et,
    description: t,
    task: t,
    classes: []
  }, r = Ds(Ce, e);
  n.startTime = r.startTime, n.endTime = r.endTime, n.id = r.id, n.active = r.active, n.done = r.done, n.crit = r.crit, n.milestone = r.milestone, n.vert = r.vert, Ce = n, te.push(n);
}, "addTaskOrg"), rn = /* @__PURE__ */ f(function() {
  const t = /* @__PURE__ */ f(function(n) {
    const r = G[n];
    let i = "";
    switch (G[n].raw.startTime.type) {
      case "prevTaskEnd": {
        const s = Ct(r.prevTaskId);
        r.startTime = s.endTime;
        break;
      }
      case "getStartDate":
        i = De(void 0, ut, G[n].raw.startTime.startData), i && (G[n].startTime = i);
        break;
    }
    return G[n].startTime && (G[n].endTime = An(
      G[n].startTime,
      ut,
      G[n].raw.endTime.data,
      Vt
    ), G[n].endTime && (G[n].processed = !0, G[n].manualEndTime = rt(
      G[n].raw.endTime.data,
      "YYYY-MM-DD",
      !0
    ).isValid(), Yn(G[n], ut, Bt, zt))), G[n].processed;
  }, "compileTask");
  let e = !0;
  for (const [n, r] of G.entries())
    t(n), e = e && r.processed;
  return e;
}, "compileTasks"), _s = /* @__PURE__ */ f(function(t, e) {
  let n = e;
  _t().securityLevel !== "loose" && (n = Vn.sanitizeUrl(e)), t.split(",").forEach(function(r) {
    Ct(r) !== void 0 && (Un(r, () => {
      window.open(n, "_self");
    }), Fe.set(r, n));
  }), Ln(t, "clickable");
}, "setLink"), Ln = /* @__PURE__ */ f(function(t, e) {
  t.split(",").forEach(function(n) {
    let r = Ct(n);
    r !== void 0 && r.classes.push(e);
  });
}, "setClass"), Ss = /* @__PURE__ */ f(function(t, e, n) {
  if (_t().securityLevel !== "loose" || e === void 0)
    return;
  let r = [];
  if (typeof n == "string") {
    r = n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);
    for (let i = 0; i < r.length; i++) {
      let s = r[i].trim();
      s.startsWith('"') && s.endsWith('"') && (s = s.substr(1, s.length - 2)), r[i] = s;
    }
  }
  r.length === 0 && r.push(t), Ct(t) !== void 0 && Un(t, () => {
    jn.runFunc(e, ...r);
  });
}, "setClickFun"), Un = /* @__PURE__ */ f(function(t, e) {
  Le.push(
    function() {
      const n = $t ? `${$t}-${t}` : t, r = document.querySelector(`[id="${n}"]`);
      r !== null && r.addEventListener("click", function() {
        e();
      });
    },
    function() {
      const n = $t ? `${$t}-${t}` : t, r = document.querySelector(`[id="${n}-text"]`);
      r !== null && r.addEventListener("click", function() {
        e();
      });
    }
  );
}, "pushFun"), Ys = /* @__PURE__ */ f(function(t, e, n) {
  t.split(",").forEach(function(r) {
    Ss(r, e, n);
  }), Ln(t, "clickable");
}, "setClickEvent"), Fs = /* @__PURE__ */ f(function(t) {
  Le.forEach(function(e) {
    e(t);
  });
}, "bindFunctions"), As = {
  getConfig: /* @__PURE__ */ f(() => _t().gantt, "getConfig"),
  clear: Ji,
  setDateFormat: is,
  getDateFormat: ds,
  enableInclusiveEndDates: ss,
  endDatesAreInclusive: as,
  enableTopAxis: os,
  topAxisEnabled: cs,
  setAxisFormat: Qi,
  getAxisFormat: Gi,
  setTickInterval: ts,
  getTickInterval: es,
  setTodayMarker: ns,
  getTodayMarker: rs,
  setAccTitle: Nn,
  getAccTitle: Pn,
  setDiagramTitle: Wn,
  getDiagramTitle: Hn,
  setDiagramId: Ki,
  setDisplayMode: us,
  getDisplayMode: ls,
  setAccDescription: In,
  getAccDescription: On,
  addSection: ks,
  getSections: ps,
  getTasks: Ts,
  addTask: Ms,
  findTaskById: Ct,
  addTaskOrg: $s,
  setIncludes: hs,
  getIncludes: fs,
  setExcludes: gs,
  getExcludes: ms,
  setClickEvent: Ys,
  setLink: _s,
  getLinks: ys,
  bindFunctions: Fs,
  parseDuration: Fn,
  isInvalidDate: Sn,
  setWeekday: vs,
  getWeekday: xs,
  setWeekend: bs
};
function Ie(t, e, n) {
  let r = !0;
  for (; r; )
    r = !1, n.forEach(function(i) {
      const s = "^\\s*" + i + "\\s*$", c = new RegExp(s);
      t[0].match(c) && (e[i] = !0, t.shift(1), r = !0);
    });
}
f(Ie, "getTaskTags");
rt.extend(qi);
var Es = /* @__PURE__ */ f(function() {
  Tt.debug("Something is calling, setConf, remove the call");
}, "setConf"), sn = {
  monday: Wt,
  tuesday: pn,
  wednesday: Tn,
  thursday: xt,
  friday: vn,
  saturday: xn,
  sunday: Nt
}, Ls = /* @__PURE__ */ f((t, e) => {
  let n = [...t].map(() => -1 / 0), r = [...t].sort((s, c) => s.startTime - c.startTime || s.order - c.order), i = 0;
  for (const s of r)
    for (let c = 0; c < n.length; c++)
      if (s.startTime >= n[c]) {
        n[c] = s.endTime, s.order = c + e, c > i && (i = c);
        break;
      }
  return i;
}, "getMaxIntersections"), dt, me = 1e4, Us = /* @__PURE__ */ f(function(t, e, n, r) {
  const i = _t().gantt;
  r.db.setDiagramId(e);
  const s = _t().securityLevel;
  let c;
  s === "sandbox" && (c = jt("#i" + e));
  const b = s === "sandbox" ? jt(c.nodes()[0].contentDocument.body) : jt("body"), F = s === "sandbox" ? c.nodes()[0].contentDocument : document, w = F.getElementById(e);
  dt = w.parentElement.offsetWidth, dt === void 0 && (dt = 1200), i.useWidth !== void 0 && (dt = i.useWidth);
  const x = r.db.getTasks();
  let O = [];
  for (const g of x)
    O.push(g.type);
  O = k(O);
  const $ = {};
  let _ = 2 * i.topPadding;
  if (r.db.getDisplayMode() === "compact" || i.displayMode === "compact") {
    const g = {};
    for (const D of x)
      g[D.section] === void 0 ? g[D.section] = [D] : g[D.section].push(D);
    let C = 0;
    for (const D of Object.keys(g)) {
      const v = Ls(g[D], C) + 1;
      C += v, _ += v * (i.barHeight + i.barGap), $[D] = v;
    }
  } else {
    _ += x.length * (i.barHeight + i.barGap);
    for (const g of O)
      $[g] = x.filter((C) => C.type === g).length;
  }
  w.setAttribute("viewBox", "0 0 " + dt + " " + _);
  const V = b.select(`[id="${e}"]`), L = Ai().domain([
    er(x, function(g) {
      return g.startTime;
    }),
    tr(x, function(g) {
      return g.endTime;
    })
  ]).rangeRound([0, dt - i.leftPadding - i.rightPadding]);
  function Y(g, C) {
    const D = g.startTime, v = C.startTime;
    let p = 0;
    return D > v ? p = 1 : D < v && (p = -1), p;
  }
  f(Y, "taskCompare"), x.sort(Y), E(x, dt, _), zn(V, _, dt, i.useMaxWidth), V.append("text").text(r.db.getDiagramTitle()).attr("x", dt / 2).attr("y", i.titleTopMargin).attr("class", "titleText");
  function E(g, C, D) {
    const v = i.barHeight, p = v + i.barGap, l = i.topPadding, m = i.leftPadding, h = Rn().domain([0, O.length]).range(["#00B9FA", "#F95002"]).interpolate(yr);
    U(
      p,
      l,
      m,
      C,
      D,
      g,
      r.db.getExcludes(),
      r.db.getIncludes()
    ), R(m, l, C, D), W(g, p, l, m, v, h, C), T(p, l), y(m, l, C, D);
  }
  f(E, "makeGantt");
  function W(g, C, D, v, p, l, m) {
    g.sort((o, u) => o.vert === u.vert ? 0 : o.vert ? 1 : -1);
    const h = [...new Set(g.map((o) => o.order))].map((o) => g.find((u) => u.order === o));
    V.append("g").selectAll("rect").data(h).enter().append("rect").attr("x", 0).attr("y", function(o, u) {
      return u = o.order, u * C + D - 2;
    }).attr("width", function() {
      return m - i.rightPadding / 2;
    }).attr("height", C).attr("class", function(o) {
      for (const [u, A] of O.entries())
        if (o.type === A)
          return "section section" + u % i.numberSectionStyles;
      return "section section0";
    }).enter();
    const S = V.append("g").selectAll("rect").data(g).enter(), a = r.db.getLinks();
    if (S.append("rect").attr("id", function(o) {
      return e + "-" + o.id;
    }).attr("rx", 3).attr("ry", 3).attr("x", function(o) {
      return o.milestone ? L(o.startTime) + v + 0.5 * (L(o.endTime) - L(o.startTime)) - 0.5 * p : L(o.startTime) + v;
    }).attr("y", function(o, u) {
      return u = o.order, o.vert ? i.gridLineStartPadding : u * C + D;
    }).attr("width", function(o) {
      return o.milestone ? p : o.vert ? 0.08 * p : L(o.renderEndTime || o.endTime) - L(o.startTime);
    }).attr("height", function(o) {
      return o.vert ? x.length * (i.barHeight + i.barGap) + i.barHeight * 2 : p;
    }).attr("transform-origin", function(o, u) {
      return u = o.order, (L(o.startTime) + v + 0.5 * (L(o.endTime) - L(o.startTime))).toString() + "px " + (u * C + D + 0.5 * p).toString() + "px";
    }).attr("class", function(o) {
      const u = "task";
      let A = "";
      o.classes.length > 0 && (A = o.classes.join(" "));
      let z = 0;
      for (const [q, J] of O.entries())
        o.type === J && (z = q % i.numberSectionStyles);
      let I = "";
      return o.active ? o.crit ? I += " activeCrit" : I = " active" : o.done ? o.crit ? I = " doneCrit" : I = " done" : o.crit && (I += " crit"), I.length === 0 && (I = " task"), o.milestone && (I = " milestone " + I), o.vert && (I = " vert " + I), I += z, I += " " + A, u + I;
    }), S.append("text").attr("id", function(o) {
      return e + "-" + o.id + "-text";
    }).text(function(o) {
      return o.task;
    }).attr("font-size", i.fontSize).attr("x", function(o) {
      let u = L(o.startTime), A = L(o.renderEndTime || o.endTime);
      if (o.milestone && (u += 0.5 * (L(o.endTime) - L(o.startTime)) - 0.5 * p, A = u + p), o.vert)
        return L(o.startTime) + v;
      const z = this.getBBox().width;
      return z > A - u ? A + z + 1.5 * i.leftPadding > m ? u + v - 5 : A + v + 5 : (A - u) / 2 + u + v;
    }).attr("y", function(o, u) {
      return o.vert ? i.gridLineStartPadding + x.length * (i.barHeight + i.barGap) + 60 : (u = o.order, u * C + i.barHeight / 2 + (i.fontSize / 2 - 2) + D);
    }).attr("text-height", p).attr("class", function(o) {
      const u = L(o.startTime);
      let A = L(o.endTime);
      o.milestone && (A = u + p);
      const z = this.getBBox().width;
      let I = "";
      o.classes.length > 0 && (I = o.classes.join(" "));
      let q = 0;
      for (const [K, it] of O.entries())
        o.type === it && (q = K % i.numberSectionStyles);
      let J = "";
      return o.active && (o.crit ? J = "activeCritText" + q : J = "activeText" + q), o.done ? o.crit ? J = J + " doneCritText" + q : J = J + " doneText" + q : o.crit && (J = J + " critText" + q), o.milestone && (J += " milestoneText"), o.vert && (J += " vertText"), z > A - u ? A + z + 1.5 * i.leftPadding > m ? I + " taskTextOutsideLeft taskTextOutside" + q + " " + J : I + " taskTextOutsideRight taskTextOutside" + q + " " + J + " width-" + z : I + " taskText taskText" + q + " " + J + " width-" + z;
    }), _t().securityLevel === "sandbox") {
      let o;
      o = jt("#i" + e);
      const u = o.nodes()[0].contentDocument;
      S.filter(function(A) {
        return a.has(A.id);
      }).each(function(A) {
        var z = u.querySelector("#" + CSS.escape(e + "-" + A.id)), I = u.querySelector("#" + CSS.escape(e + "-" + A.id + "-text"));
        const q = z.parentNode;
        var J = u.createElement("a");
        J.setAttribute("xlink:href", a.get(A.id)), J.setAttribute("target", "_top"), q.appendChild(J), J.appendChild(z), J.appendChild(I);
      });
    }
  }
  f(W, "drawRects");
  function U(g, C, D, v, p, l, m, h) {
    if (m.length === 0 && h.length === 0)
      return;
    let S, a;
    for (const { startTime: I, endTime: q } of l)
      (S === void 0 || I < S) && (S = I), (a === void 0 || q > a) && (a = q);
    if (!S || !a)
      return;
    if (rt(a).diff(rt(S), "year") > 5) {
      Tt.warn(
        "The difference between the min and max time is more than 5 years. This will cause performance issues. Skipping drawing exclude days."
      );
      return;
    }
    const o = r.db.getDateFormat(), u = [];
    let A = null, z = rt(S);
    for (; z.valueOf() <= a; )
      r.db.isInvalidDate(z, o, m, h) ? A ? A.end = z : A = {
        start: z,
        end: z
      } : A && (u.push(A), A = null), z = z.add(1, "d");
    V.append("g").selectAll("rect").data(u).enter().append("rect").attr("id", (I) => e + "-exclude-" + I.start.format("YYYY-MM-DD")).attr("x", (I) => L(I.start.startOf("day")) + D).attr("y", i.gridLineStartPadding).attr("width", (I) => L(I.end.endOf("day")) - L(I.start.startOf("day"))).attr("height", p - C - i.gridLineStartPadding).attr("transform-origin", function(I, q) {
      return (L(I.start) + D + 0.5 * (L(I.end) - L(I.start))).toString() + "px " + (q * g + 0.5 * p).toString() + "px";
    }).attr("class", "exclude-range");
  }
  f(U, "drawExcludeDays");
  function B(g, C, D, v) {
    if (D <= 0 || g > C)
      return 1 / 0;
    const p = C - g, l = rt.duration({ [v ?? "day"]: D }).asMilliseconds();
    return l <= 0 ? 1 / 0 : Math.ceil(p / l);
  }
  f(B, "getEstimatedTickCount");
  function R(g, C, D, v) {
    const p = r.db.getDateFormat(), l = r.db.getAxisFormat();
    let m;
    l ? m = l : p === "D" ? m = "%d" : m = i.axisFormat ?? "%Y-%m-%d";
    let h = ur(L).tickSize(-v + C + i.gridLineStartPadding).tickFormat(Gt(m));
    const S = /^([1-9]\d*)(millisecond|second|minute|hour|day|week|month)$/.exec(
      r.db.getTickInterval() || i.tickInterval
    );
    if (S !== null) {
      const a = parseInt(S[1], 10);
      if (isNaN(a) || a <= 0)
        Tt.warn(
          `Invalid tick interval value: "${S[1]}". Skipping custom tick interval.`
        );
      else {
        const o = S[2], u = r.db.getWeekday() || i.weekday, A = L.domain(), z = A[0], I = A[1], q = B(z, I, a, o);
        if (q > me)
          Tt.warn(
            `The tick interval "${a}${o}" would generate ${q} ticks, which exceeds the maximum allowed (${me}). This may indicate an invalid date or time range. Skipping custom tick interval.`
          );
        else
          switch (o) {
            case "millisecond":
              h.ticks(Ft.every(a));
              break;
            case "second":
              h.ticks(kt.every(a));
              break;
            case "minute":
              h.ticks(It.every(a));
              break;
            case "hour":
              h.ticks(Ht.every(a));
              break;
            case "day":
              h.ticks(vt.every(a));
              break;
            case "week":
              h.ticks(sn[u].every(a));
              break;
            case "month":
              h.ticks(Pt.every(a));
              break;
          }
      }
    }
    if (V.append("g").attr("class", "grid").attr("transform", "translate(" + g + ", " + (v - 50) + ")").call(h).selectAll("text").style("text-anchor", "middle").attr("fill", "#000").attr("stroke", "none").attr("font-size", 10).attr("dy", "1em"), r.db.topAxisEnabled() || i.topAxis) {
      let a = cr(L).tickSize(-v + C + i.gridLineStartPadding).tickFormat(Gt(m));
      if (S !== null) {
        const o = parseInt(S[1], 10);
        if (isNaN(o) || o <= 0)
          Tt.warn(
            `Invalid tick interval value: "${S[1]}". Skipping custom tick interval.`
          );
        else {
          const u = S[2], A = r.db.getWeekday() || i.weekday, z = L.domain(), I = z[0], q = z[1];
          if (B(I, q, o, u) <= me)
            switch (u) {
              case "millisecond":
                a.ticks(Ft.every(o));
                break;
              case "second":
                a.ticks(kt.every(o));
                break;
              case "minute":
                a.ticks(It.every(o));
                break;
              case "hour":
                a.ticks(Ht.every(o));
                break;
              case "day":
                a.ticks(vt.every(o));
                break;
              case "week":
                a.ticks(sn[A].every(o));
                break;
              case "month":
                a.ticks(Pt.every(o));
                break;
            }
        }
      }
      V.append("g").attr("class", "grid").attr("transform", "translate(" + g + ", " + C + ")").call(a).selectAll("text").style("text-anchor", "middle").attr("fill", "#000").attr("stroke", "none").attr("font-size", 10);
    }
  }
  f(R, "makeGrid");
  function T(g, C) {
    let D = 0;
    const v = Object.keys($).map((p) => [p, $[p]]);
    V.append("g").selectAll("text").data(v).enter().append(function(p) {
      const l = p[0].split(Bn.lineBreakRegex), m = -(l.length - 1) / 2, h = F.createElementNS("http://www.w3.org/2000/svg", "text");
      h.setAttribute("dy", m + "em");
      for (const [S, a] of l.entries()) {
        const o = F.createElementNS("http://www.w3.org/2000/svg", "tspan");
        o.setAttribute("alignment-baseline", "central"), o.setAttribute("x", "10"), S > 0 && o.setAttribute("dy", "1em"), o.textContent = a, h.appendChild(o);
      }
      return h;
    }).attr("x", 10).attr("y", function(p, l) {
      if (l > 0)
        for (let m = 0; m < l; m++)
          return D += v[l - 1][1], p[1] * g / 2 + D * g + C;
      else
        return p[1] * g / 2 + C;
    }).attr("font-size", i.sectionFontSize).attr("class", function(p) {
      for (const [l, m] of O.entries())
        if (p[0] === m)
          return "sectionTitle sectionTitle" + l % i.numberSectionStyles;
      return "sectionTitle";
    });
  }
  f(T, "vertLabels");
  function y(g, C, D, v) {
    const p = r.db.getTodayMarker();
    if (p === "off")
      return;
    const l = V.append("g").attr("class", "today"), m = /* @__PURE__ */ new Date(), h = l.append("line");
    h.attr("x1", L(m) + g).attr("x2", L(m) + g).attr("y1", i.titleTopMargin).attr("y2", v - i.titleTopMargin).attr("class", "today"), p !== "" && h.attr("style", p.replace(/,/g, ";"));
  }
  f(y, "drawToday");
  function k(g) {
    const C = {}, D = [];
    for (let v = 0, p = g.length; v < p; ++v)
      Object.prototype.hasOwnProperty.call(C, g[v]) || (C[g[v]] = !0, D.push(g[v]));
    return D;
  }
  f(k, "checkUnique");
}, "draw"), Os = {
  setConf: Es,
  draw: Us
}, Is = /* @__PURE__ */ f((t) => `
  .mermaid-main-font {
        font-family: ${t.fontFamily};
  }

  .exclude-range {
    fill: ${t.excludeBkgColor};
  }

  .section {
    stroke: none;
    opacity: 0.2;
  }

  .section0 {
    fill: ${t.sectionBkgColor};
  }

  .section2 {
    fill: ${t.sectionBkgColor2};
  }

  .section1,
  .section3 {
    fill: ${t.altSectionBkgColor};
    opacity: 0.2;
  }

  .sectionTitle0 {
    fill: ${t.titleColor};
  }

  .sectionTitle1 {
    fill: ${t.titleColor};
  }

  .sectionTitle2 {
    fill: ${t.titleColor};
  }

  .sectionTitle3 {
    fill: ${t.titleColor};
  }

  .sectionTitle {
    text-anchor: start;
    font-family: ${t.fontFamily};
  }


  /* Grid and axis */

  .grid .tick {
    stroke: ${t.gridColor};
    opacity: 0.8;
    shape-rendering: crispEdges;
  }

  .grid .tick text {
    font-family: ${t.fontFamily};
    fill: ${t.textColor};
  }

  .grid path {
    stroke-width: 0;
  }


  /* Today line */

  .today {
    fill: none;
    stroke: ${t.todayLineColor};
    stroke-width: 2px;
  }


  /* Task styling */

  /* Default task */

  .task {
    stroke-width: 2;
  }

  .taskText {
    text-anchor: middle;
    font-family: ${t.fontFamily};
  }

  .taskTextOutsideRight {
    fill: ${t.taskTextDarkColor};
    text-anchor: start;
    font-family: ${t.fontFamily};
  }

  .taskTextOutsideLeft {
    fill: ${t.taskTextDarkColor};
    text-anchor: end;
  }


  /* Special case clickable */

  .task.clickable {
    cursor: pointer;
  }

  .taskText.clickable {
    cursor: pointer;
    fill: ${t.taskTextClickableColor} !important;
    font-weight: bold;
  }

  .taskTextOutsideLeft.clickable {
    cursor: pointer;
    fill: ${t.taskTextClickableColor} !important;
    font-weight: bold;
  }

  .taskTextOutsideRight.clickable {
    cursor: pointer;
    fill: ${t.taskTextClickableColor} !important;
    font-weight: bold;
  }


  /* Specific task settings for the sections*/

  .taskText0,
  .taskText1,
  .taskText2,
  .taskText3 {
    fill: ${t.taskTextColor};
  }

  .task0,
  .task1,
  .task2,
  .task3 {
    fill: ${t.taskBkgColor};
    stroke: ${t.taskBorderColor};
  }

  .taskTextOutside0,
  .taskTextOutside2
  {
    fill: ${t.taskTextOutsideColor};
  }

  .taskTextOutside1,
  .taskTextOutside3 {
    fill: ${t.taskTextOutsideColor};
  }


  /* Active task */

  .active0,
  .active1,
  .active2,
  .active3 {
    fill: ${t.activeTaskBkgColor};
    stroke: ${t.activeTaskBorderColor};
  }

  .activeText0,
  .activeText1,
  .activeText2,
  .activeText3 {
    fill: ${t.taskTextDarkColor} !important;
  }


  /* Completed task */

  .done0,
  .done1,
  .done2,
  .done3 {
    stroke: ${t.doneTaskBorderColor};
    fill: ${t.doneTaskBkgColor};
    stroke-width: 2;
  }

  .doneText0,
  .doneText1,
  .doneText2,
  .doneText3 {
    fill: ${t.taskTextDarkColor} !important;
  }

  /* Done task text displayed outside the bar sits against the diagram background,
     not against the done-task bar, so it must use the outside/contrast color. */
  .doneText0.taskTextOutsideLeft,
  .doneText0.taskTextOutsideRight,
  .doneText1.taskTextOutsideLeft,
  .doneText1.taskTextOutsideRight,
  .doneText2.taskTextOutsideLeft,
  .doneText2.taskTextOutsideRight,
  .doneText3.taskTextOutsideLeft,
  .doneText3.taskTextOutsideRight {
    fill: ${t.taskTextOutsideColor} !important;
  }


  /* Tasks on the critical line */

  .crit0,
  .crit1,
  .crit2,
  .crit3 {
    stroke: ${t.critBorderColor};
    fill: ${t.critBkgColor};
    stroke-width: 2;
  }

  .activeCrit0,
  .activeCrit1,
  .activeCrit2,
  .activeCrit3 {
    stroke: ${t.critBorderColor};
    fill: ${t.activeTaskBkgColor};
    stroke-width: 2;
  }

  .doneCrit0,
  .doneCrit1,
  .doneCrit2,
  .doneCrit3 {
    stroke: ${t.critBorderColor};
    fill: ${t.doneTaskBkgColor};
    stroke-width: 2;
    cursor: pointer;
    shape-rendering: crispEdges;
  }

  .milestone {
    transform: rotate(45deg) scale(0.8,0.8);
  }

  .milestoneText {
    font-style: italic;
  }
  .doneCritText0,
  .doneCritText1,
  .doneCritText2,
  .doneCritText3 {
    fill: ${t.taskTextDarkColor} !important;
  }

  /* Done-crit task text outside the bar — same reasoning as doneText above. */
  .doneCritText0.taskTextOutsideLeft,
  .doneCritText0.taskTextOutsideRight,
  .doneCritText1.taskTextOutsideLeft,
  .doneCritText1.taskTextOutsideRight,
  .doneCritText2.taskTextOutsideLeft,
  .doneCritText2.taskTextOutsideRight,
  .doneCritText3.taskTextOutsideLeft,
  .doneCritText3.taskTextOutsideRight {
    fill: ${t.taskTextOutsideColor} !important;
  }

  .vert {
    stroke: ${t.vertLineColor};
  }

  .vertText {
    font-size: 15px;
    text-anchor: middle;
    fill: ${t.vertLineColor} !important;
  }

  .activeCritText0,
  .activeCritText1,
  .activeCritText2,
  .activeCritText3 {
    fill: ${t.taskTextDarkColor} !important;
  }

  .titleText {
    text-anchor: middle;
    font-size: 18px;
    fill: ${t.titleColor || t.textColor};
    font-family: ${t.fontFamily};
  }
`, "getStyles"), Hs = Is, zs = {
  parser: Ri,
  db: As,
  renderer: Os,
  styles: Hs
};
export {
  zs as diagram
};
