import { M as Pe, N as Re, R as ze, O as je, P as bn, Q as Kt, T as vn, c as xn, g as wn, U as Cn, V as Dn, e as xt, s as Mn, a as _n, F as Sn, G as Un, d as Fn, b as En, H as An, o as In, l as qt, j as Pt, k as Yn, m as Ln, C as Wn } from "./8de8f14b.js";
import { b as On, t as Me, c as Nn, a as Hn, l as Vn } from "./28fbb66a.js";
import { i as Pn } from "./f9637058.js";
function Rn(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 zn(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 jn(t) {
  return t;
}
var zt = 1, $t = 2, le = 3, Rt = 4, _e = 1e-6;
function Bn(t) {
  return "translate(" + t + ",0)";
}
function qn(t) {
  return "translate(0," + t + ")";
}
function Zn(t) {
  return (e) => +t(e);
}
function Xn(t, e) {
  return e = Math.max(0, t.bandwidth() - e * 2) / 2, t.round() && (e = Math.round(e)), (n) => +t(n) + e;
}
function Qn() {
  return !this.__axis;
}
function Be(t, e) {
  var n = [], r = null, i = null, s = 6, a = 6, x = 3, S = typeof window < "u" && window.devicePixelRatio > 1 ? 0 : 0.5, k = t === zt || t === Rt ? -1 : 1, p = t === Rt || t === $t ? "x" : "y", F = t === zt || t === le ? Bn : qn;
  function T(g) {
    var P = r ?? (e.ticks ? e.ticks.apply(e, n) : e.domain()), E = i ?? (e.tickFormat ? e.tickFormat.apply(e, n) : jn), $ = Math.max(s, 0) + x, et = e.range(), tt = +et[0] + S, B = +et[et.length - 1] + S, q = (e.bandwidth ? Xn : Zn)(e.copy(), S), K = g.selection ? g.selection() : g, v = K.selectAll(".domain").data([null]), H = K.selectAll(".tick").data(P, e).order(), b = H.exit(), U = H.enter().append("g").attr("class", "tick"), _ = H.select("line"), w = H.select("text");
    v = v.merge(v.enter().insert("path", ".tick").attr("class", "domain").attr("stroke", "currentColor")), H = H.merge(U), _ = _.merge(U.append("line").attr("stroke", "currentColor").attr(p + "2", k * s)), w = w.merge(U.append("text").attr("fill", "currentColor").attr(p, k * $).attr("dy", t === zt ? "0em" : t === le ? "0.71em" : "0.32em")), g !== K && (v = v.transition(g), H = H.transition(g), _ = _.transition(g), w = w.transition(g), b = b.transition(g).attr("opacity", _e).attr("transform", function(c) {
      return isFinite(c = q(c)) ? F(c + S) : this.getAttribute("transform");
    }), U.attr("opacity", _e).attr("transform", function(c) {
      var d = this.parentNode.__axis;
      return F((d && isFinite(d = d(c)) ? d : q(c)) + S);
    })), b.remove(), v.attr("d", t === Rt || t === $t ? a ? "M" + k * a + "," + tt + "H" + S + "V" + B + "H" + k * a : "M" + S + "," + tt + "V" + B : a ? "M" + tt + "," + k * a + "V" + S + "H" + B + "V" + k * a : "M" + tt + "," + S + "H" + B), H.attr("opacity", 1).attr("transform", function(c) {
      return F(q(c) + S);
    }), _.attr(p + "2", k * s), w.attr(p, k * $).text(E), K.filter(Qn).attr("fill", "none").attr("font-size", 10).attr("font-family", "sans-serif").attr("text-anchor", t === $t ? "start" : t === Rt ? "end" : "middle"), K.each(function() {
      this.__axis = q;
    });
  }
  return T.scale = function(g) {
    return arguments.length ? (e = g, T) : e;
  }, T.ticks = function() {
    return n = Array.from(arguments), T;
  }, T.tickArguments = function(g) {
    return arguments.length ? (n = g == null ? [] : Array.from(g), T) : n.slice();
  }, T.tickValues = function(g) {
    return arguments.length ? (r = g == null ? null : Array.from(g), T) : r && r.slice();
  }, T.tickFormat = function(g) {
    return arguments.length ? (i = g, T) : i;
  }, T.tickSize = function(g) {
    return arguments.length ? (s = a = +g, T) : s;
  }, T.tickSizeInner = function(g) {
    return arguments.length ? (s = +g, T) : s;
  }, T.tickSizeOuter = function(g) {
    return arguments.length ? (a = +g, T) : a;
  }, T.tickPadding = function(g) {
    return arguments.length ? (x = +g, T) : x;
  }, T.offset = function(g) {
    return arguments.length ? (S = +g, T) : S;
  }, T;
}
function Gn(t) {
  return Be(zt, t);
}
function Jn(t) {
  return Be(le, t);
}
const Kn = Math.PI / 180, $n = 180 / Math.PI, Zt = 18, qe = 0.96422, Ze = 1, Xe = 0.82521, Qe = 4 / 29, wt = 6 / 29, Ge = 3 * wt * wt, tr = wt * wt * wt;
function Je(t) {
  if (t instanceof it)
    return new it(t.l, t.a, t.b, t.opacity);
  if (t instanceof ot)
    return Ke(t);
  t instanceof ze || (t = bn(t));
  var e = re(t.r), n = re(t.g), r = re(t.b), i = te((0.2225045 * e + 0.7168786 * n + 0.0606169 * r) / Ze), s, a;
  return e === n && n === r ? s = a = i : (s = te((0.4360747 * e + 0.3850649 * n + 0.1430804 * r) / qe), a = te((0.0139322 * e + 0.0971045 * n + 0.7141733 * r) / Xe)), new it(116 * i - 16, 500 * (s - i), 200 * (i - a), t.opacity);
}
function er(t, e, n, r) {
  return arguments.length === 1 ? Je(t) : new it(t, e, n, r ?? 1);
}
function it(t, e, n, r) {
  this.l = +t, this.a = +e, this.b = +n, this.opacity = +r;
}
Pe(it, er, Re(je, {
  brighter(t) {
    return new it(this.l + Zt * (t ?? 1), this.a, this.b, this.opacity);
  },
  darker(t) {
    return new it(this.l - Zt * (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 = qe * ee(e), t = Ze * ee(t), n = Xe * ee(n), new ze(
      ne(3.1338561 * e - 1.6168667 * t - 0.4906146 * n),
      ne(-0.9787684 * e + 1.9161415 * t + 0.033454 * n),
      ne(0.0719453 * e - 0.2289914 * t + 1.4052427 * n),
      this.opacity
    );
  }
}));
function te(t) {
  return t > tr ? Math.pow(t, 1 / 3) : t / Ge + Qe;
}
function ee(t) {
  return t > wt ? t * t * t : Ge * (t - Qe);
}
function ne(t) {
  return 255 * (t <= 31308e-7 ? 12.92 * t : 1.055 * Math.pow(t, 1 / 2.4) - 0.055);
}
function re(t) {
  return (t /= 255) <= 0.04045 ? t / 12.92 : Math.pow((t + 0.055) / 1.055, 2.4);
}
function nr(t) {
  if (t instanceof ot)
    return new ot(t.h, t.c, t.l, t.opacity);
  if (t instanceof it || (t = Je(t)), t.a === 0 && t.b === 0)
    return new ot(NaN, 0 < t.l && t.l < 100 ? 0 : NaN, t.l, t.opacity);
  var e = Math.atan2(t.b, t.a) * $n;
  return new ot(e < 0 ? e + 360 : e, Math.sqrt(t.a * t.a + t.b * t.b), t.l, t.opacity);
}
function ue(t, e, n, r) {
  return arguments.length === 1 ? nr(t) : new ot(t, e, n, r ?? 1);
}
function ot(t, e, n, r) {
  this.h = +t, this.c = +e, this.l = +n, this.opacity = +r;
}
function Ke(t) {
  if (isNaN(t.h))
    return new it(t.l, 0, 0, t.opacity);
  var e = t.h * Kn;
  return new it(t.l, Math.cos(e) * t.c, Math.sin(e) * t.c, t.opacity);
}
Pe(ot, ue, Re(je, {
  brighter(t) {
    return new ot(this.h, this.c, this.l + Zt * (t ?? 1), this.opacity);
  },
  darker(t) {
    return new ot(this.h, this.c, this.l - Zt * (t ?? 1), this.opacity);
  },
  rgb() {
    return Ke(this).rgb();
  }
}));
function rr(t) {
  return function(e, n) {
    var r = t((e = ue(e)).h, (n = ue(n)).h), i = Kt(e.c, n.c), s = Kt(e.l, n.l), a = Kt(e.opacity, n.opacity);
    return function(x) {
      return e.h = r(x), e.c = i(x), e.l = s(x), e.opacity = a(x), e + "";
    };
  };
}
const ir = rr(vn);
function sr(t, e) {
  t = t.slice();
  var n = 0, r = t.length - 1, i = t[n], s = t[r], a;
  return s < i && (a = n, n = r, r = a, a = i, i = s, s = a), t[n] = e.floor(i), t[r] = e.ceil(s), t;
}
const ie = /* @__PURE__ */ new Date(), se = /* @__PURE__ */ new Date();
function X(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 a = i(s), x = i.ceil(s);
    return s - a < x - s ? a : x;
  }, i.offset = (s, a) => (e(s = /* @__PURE__ */ new Date(+s), a == null ? 1 : Math.floor(a)), s), i.range = (s, a, x) => {
    const S = [];
    if (s = i.ceil(s), x = x == null ? 1 : Math.floor(x), !(s < a) || !(x > 0))
      return S;
    let k;
    do
      S.push(k = /* @__PURE__ */ new Date(+s)), e(s, x), t(s);
    while (k < s && s < a);
    return S;
  }, i.filter = (s) => X((a) => {
    if (a >= a)
      for (; t(a), !s(a); )
        a.setTime(a - 1);
  }, (a, x) => {
    if (a >= a)
      if (x < 0)
        for (; ++x <= 0; )
          for (; e(a, -1), !s(a); )
            ;
      else
        for (; --x >= 0; )
          for (; e(a, 1), !s(a); )
            ;
  }), n && (i.count = (s, a) => (ie.setTime(+s), se.setTime(+a), t(ie), t(se), Math.floor(n(ie, se))), i.every = (s) => (s = Math.floor(s), !isFinite(s) || !(s > 0) ? null : s > 1 ? i.filter(r ? (a) => r(a) % s === 0 : (a) => i.count(0, a) % s === 0) : i)), i;
}
const Dt = X(() => {
}, (t, e) => {
  t.setTime(+t + e);
}, (t, e) => e - t);
Dt.every = (t) => (t = Math.floor(t), !isFinite(t) || !(t > 0) ? null : t > 1 ? X((e) => {
  e.setTime(Math.floor(e / t) * t);
}, (e, n) => {
  e.setTime(+e + n * t);
}, (e, n) => (n - e) / t) : Dt);
Dt.range;
const ct = 1e3, nt = ct * 60, lt = nt * 60, ut = lt * 24, ye = ut * 7, Se = ut * 30, ae = ut * 365, ht = X((t) => {
  t.setTime(t - t.getMilliseconds());
}, (t, e) => {
  t.setTime(+t + e * ct);
}, (t, e) => (e - t) / ct, (t) => t.getUTCSeconds());
ht.range;
const At = X((t) => {
  t.setTime(t - t.getMilliseconds() - t.getSeconds() * ct);
}, (t, e) => {
  t.setTime(+t + e * nt);
}, (t, e) => (e - t) / nt, (t) => t.getMinutes());
At.range;
const ar = X((t) => {
  t.setUTCSeconds(0, 0);
}, (t, e) => {
  t.setTime(+t + e * nt);
}, (t, e) => (e - t) / nt, (t) => t.getUTCMinutes());
ar.range;
const It = X((t) => {
  t.setTime(t - t.getMilliseconds() - t.getSeconds() * ct - t.getMinutes() * nt);
}, (t, e) => {
  t.setTime(+t + e * lt);
}, (t, e) => (e - t) / lt, (t) => t.getHours());
It.range;
const or = X((t) => {
  t.setUTCMinutes(0, 0, 0);
}, (t, e) => {
  t.setTime(+t + e * lt);
}, (t, e) => (e - t) / lt, (t) => t.getUTCHours());
or.range;
const yt = X(
  (t) => t.setHours(0, 0, 0, 0),
  (t, e) => t.setDate(t.getDate() + e),
  (t, e) => (e - t - (e.getTimezoneOffset() - t.getTimezoneOffset()) * nt) / ut,
  (t) => t.getDate() - 1
);
yt.range;
const ge = X((t) => {
  t.setUTCHours(0, 0, 0, 0);
}, (t, e) => {
  t.setUTCDate(t.getUTCDate() + e);
}, (t, e) => (e - t) / ut, (t) => t.getUTCDate() - 1);
ge.range;
const cr = X((t) => {
  t.setUTCHours(0, 0, 0, 0);
}, (t, e) => {
  t.setUTCDate(t.getUTCDate() + e);
}, (t, e) => (e - t) / ut, (t) => Math.floor(t / ut));
cr.range;
function pt(t) {
  return X((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()) * nt) / ye);
}
const Wt = pt(0), Yt = pt(1), $e = pt(2), tn = pt(3), gt = pt(4), en = pt(5), nn = pt(6);
Wt.range;
Yt.range;
$e.range;
tn.range;
gt.range;
en.range;
nn.range;
function Tt(t) {
  return X((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) / ye);
}
const rn = Tt(0), Xt = Tt(1), lr = Tt(2), ur = Tt(3), Mt = Tt(4), fr = Tt(5), hr = Tt(6);
rn.range;
Xt.range;
lr.range;
ur.range;
Mt.range;
fr.range;
hr.range;
const Lt = X((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());
Lt.range;
const dr = X((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());
dr.range;
const ft = X((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());
ft.every = (t) => !isFinite(t = Math.floor(t)) || !(t > 0) ? null : X((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);
});
ft.range;
const kt = X((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());
kt.every = (t) => !isFinite(t = Math.floor(t)) || !(t > 0) ? null : X((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);
});
kt.range;
function mr(t, e, n, r, i, s) {
  const a = [
    [ht, 1, ct],
    [ht, 5, 5 * ct],
    [ht, 15, 15 * ct],
    [ht, 30, 30 * ct],
    [s, 1, nt],
    [s, 5, 5 * nt],
    [s, 15, 15 * nt],
    [s, 30, 30 * nt],
    [i, 1, lt],
    [i, 3, 3 * lt],
    [i, 6, 6 * lt],
    [i, 12, 12 * lt],
    [r, 1, ut],
    [r, 2, 2 * ut],
    [n, 1, ye],
    [e, 1, Se],
    [e, 3, 3 * Se],
    [t, 1, ae]
  ];
  function x(k, p, F) {
    const T = p < k;
    T && ([k, p] = [p, k]);
    const g = F && typeof F.range == "function" ? F : S(k, p, F), P = g ? g.range(k, +p + 1) : [];
    return T ? P.reverse() : P;
  }
  function S(k, p, F) {
    const T = Math.abs(p - k) / F, g = On(([, , $]) => $).right(a, T);
    if (g === a.length)
      return t.every(Me(k / ae, p / ae, F));
    if (g === 0)
      return Dt.every(Math.max(Me(k, p, F), 1));
    const [P, E] = a[T / a[g - 1][2] < a[g][2] / T ? g - 1 : g];
    return P.every(E);
  }
  return [x, S];
}
const [yr, gr] = mr(ft, Lt, Wt, yt, It, At);
function oe(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 ce(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 Ut(t, e, n) {
  return { y: t, m: e, d: n, H: 0, M: 0, S: 0, L: 0 };
}
function kr(t) {
  var e = t.dateTime, n = t.date, r = t.time, i = t.periods, s = t.days, a = t.shortDays, x = t.months, S = t.shortMonths, k = Ft(i), p = Et(i), F = Ft(s), T = Et(s), g = Ft(a), P = Et(a), E = Ft(x), $ = Et(x), et = Ft(S), tt = Et(S), B = {
    a: o,
    A: z,
    b: h,
    B: f,
    c: null,
    d: Ye,
    e: Ye,
    f: Vr,
    g: Gr,
    G: Kr,
    H: Or,
    I: Nr,
    j: Hr,
    L: sn,
    m: Pr,
    M: Rr,
    p: M,
    q: R,
    Q: Oe,
    s: Ne,
    S: zr,
    u: jr,
    U: Br,
    V: qr,
    w: Zr,
    W: Xr,
    x: null,
    X: null,
    y: Qr,
    Y: Jr,
    Z: $r,
    "%": We
  }, q = {
    a: Y,
    A: W,
    b: I,
    B: O,
    c: null,
    d: Le,
    e: Le,
    f: ri,
    g: di,
    G: yi,
    H: ti,
    I: ei,
    j: ni,
    L: on,
    m: ii,
    M: si,
    p: dt,
    q: mt,
    Q: Oe,
    s: Ne,
    S: ai,
    u: oi,
    U: ci,
    V: li,
    w: ui,
    W: fi,
    x: null,
    X: null,
    y: hi,
    Y: mi,
    Z: gi,
    "%": We
  }, K = {
    a: _,
    A: w,
    b: c,
    B: d,
    c: m,
    d: Ae,
    e: Ae,
    f: Ir,
    g: Ee,
    G: Fe,
    H: Ie,
    I: Ie,
    j: Ur,
    L: Ar,
    m: Sr,
    M: Fr,
    p: U,
    q: _r,
    Q: Lr,
    s: Wr,
    S: Er,
    u: xr,
    U: wr,
    V: Cr,
    w: vr,
    W: Dr,
    x: u,
    X: D,
    y: Ee,
    Y: Fe,
    Z: Mr,
    "%": Yr
  };
  B.x = v(n, B), B.X = v(r, B), B.c = v(e, B), q.x = v(n, q), q.X = v(r, q), q.c = v(e, q);
  function v(y, A) {
    return function(C) {
      var l = [], V = -1, N = 0, j = y.length, Q, J, St;
      for (C instanceof Date || (C = /* @__PURE__ */ new Date(+C)); ++V < j; )
        y.charCodeAt(V) === 37 && (l.push(y.slice(N, V)), (J = Ue[Q = y.charAt(++V)]) != null ? Q = y.charAt(++V) : J = Q === "e" ? " " : "0", (St = A[Q]) && (Q = St(C, J)), l.push(Q), N = V + 1);
      return l.push(y.slice(N, V)), l.join("");
    };
  }
  function H(y, A) {
    return function(C) {
      var l = Ut(1900, void 0, 1), V = b(l, y, C += "", 0), N, j;
      if (V != C.length)
        return null;
      if ("Q" in l)
        return new Date(l.Q);
      if ("s" in l)
        return new Date(l.s * 1e3 + ("L" in l ? l.L : 0));
      if (A && !("Z" in l) && (l.Z = 0), "p" in l && (l.H = l.H % 12 + l.p * 12), l.m === void 0 && (l.m = "q" in l ? l.q : 0), "V" in l) {
        if (l.V < 1 || l.V > 53)
          return null;
        "w" in l || (l.w = 1), "Z" in l ? (N = ce(Ut(l.y, 0, 1)), j = N.getUTCDay(), N = j > 4 || j === 0 ? Xt.ceil(N) : Xt(N), N = ge.offset(N, (l.V - 1) * 7), l.y = N.getUTCFullYear(), l.m = N.getUTCMonth(), l.d = N.getUTCDate() + (l.w + 6) % 7) : (N = oe(Ut(l.y, 0, 1)), j = N.getDay(), N = j > 4 || j === 0 ? Yt.ceil(N) : Yt(N), N = yt.offset(N, (l.V - 1) * 7), l.y = N.getFullYear(), l.m = N.getMonth(), l.d = N.getDate() + (l.w + 6) % 7);
      } else
        ("W" in l || "U" in l) && ("w" in l || (l.w = "u" in l ? l.u % 7 : "W" in l ? 1 : 0), j = "Z" in l ? ce(Ut(l.y, 0, 1)).getUTCDay() : oe(Ut(l.y, 0, 1)).getDay(), l.m = 0, l.d = "W" in l ? (l.w + 6) % 7 + l.W * 7 - (j + 5) % 7 : l.w + l.U * 7 - (j + 6) % 7);
      return "Z" in l ? (l.H += l.Z / 100 | 0, l.M += l.Z % 100, ce(l)) : oe(l);
    };
  }
  function b(y, A, C, l) {
    for (var V = 0, N = A.length, j = C.length, Q, J; V < N; ) {
      if (l >= j)
        return -1;
      if (Q = A.charCodeAt(V++), Q === 37) {
        if (Q = A.charAt(V++), J = K[Q in Ue ? A.charAt(V++) : Q], !J || (l = J(y, C, l)) < 0)
          return -1;
      } else if (Q != C.charCodeAt(l++))
        return -1;
    }
    return l;
  }
  function U(y, A, C) {
    var l = k.exec(A.slice(C));
    return l ? (y.p = p.get(l[0].toLowerCase()), C + l[0].length) : -1;
  }
  function _(y, A, C) {
    var l = g.exec(A.slice(C));
    return l ? (y.w = P.get(l[0].toLowerCase()), C + l[0].length) : -1;
  }
  function w(y, A, C) {
    var l = F.exec(A.slice(C));
    return l ? (y.w = T.get(l[0].toLowerCase()), C + l[0].length) : -1;
  }
  function c(y, A, C) {
    var l = et.exec(A.slice(C));
    return l ? (y.m = tt.get(l[0].toLowerCase()), C + l[0].length) : -1;
  }
  function d(y, A, C) {
    var l = E.exec(A.slice(C));
    return l ? (y.m = $.get(l[0].toLowerCase()), C + l[0].length) : -1;
  }
  function m(y, A, C) {
    return b(y, e, A, C);
  }
  function u(y, A, C) {
    return b(y, n, A, C);
  }
  function D(y, A, C) {
    return b(y, r, A, C);
  }
  function o(y) {
    return a[y.getDay()];
  }
  function z(y) {
    return s[y.getDay()];
  }
  function h(y) {
    return S[y.getMonth()];
  }
  function f(y) {
    return x[y.getMonth()];
  }
  function M(y) {
    return i[+(y.getHours() >= 12)];
  }
  function R(y) {
    return 1 + ~~(y.getMonth() / 3);
  }
  function Y(y) {
    return a[y.getUTCDay()];
  }
  function W(y) {
    return s[y.getUTCDay()];
  }
  function I(y) {
    return S[y.getUTCMonth()];
  }
  function O(y) {
    return x[y.getUTCMonth()];
  }
  function dt(y) {
    return i[+(y.getUTCHours() >= 12)];
  }
  function mt(y) {
    return 1 + ~~(y.getUTCMonth() / 3);
  }
  return {
    format: function(y) {
      var A = v(y += "", B);
      return A.toString = function() {
        return y;
      }, A;
    },
    parse: function(y) {
      var A = H(y += "", !1);
      return A.toString = function() {
        return y;
      }, A;
    },
    utcFormat: function(y) {
      var A = v(y += "", q);
      return A.toString = function() {
        return y;
      }, A;
    },
    utcParse: function(y) {
      var A = H(y += "", !0);
      return A.toString = function() {
        return y;
      }, A;
    }
  };
}
var Ue = { "-": "", _: " ", 0: "0" }, G = /^\s*\d+/, pr = /^%/, Tr = /[\\^$*+?|[\]().{}]/g;
function L(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 br(t) {
  return t.replace(Tr, "\\$&");
}
function Ft(t) {
  return new RegExp("^(?:" + t.map(br).join("|") + ")", "i");
}
function Et(t) {
  return new Map(t.map((e, n) => [e.toLowerCase(), n]));
}
function vr(t, e, n) {
  var r = G.exec(e.slice(n, n + 1));
  return r ? (t.w = +r[0], n + r[0].length) : -1;
}
function xr(t, e, n) {
  var r = G.exec(e.slice(n, n + 1));
  return r ? (t.u = +r[0], n + r[0].length) : -1;
}
function wr(t, e, n) {
  var r = G.exec(e.slice(n, n + 2));
  return r ? (t.U = +r[0], n + r[0].length) : -1;
}
function Cr(t, e, n) {
  var r = G.exec(e.slice(n, n + 2));
  return r ? (t.V = +r[0], n + r[0].length) : -1;
}
function Dr(t, e, n) {
  var r = G.exec(e.slice(n, n + 2));
  return r ? (t.W = +r[0], n + r[0].length) : -1;
}
function Fe(t, e, n) {
  var r = G.exec(e.slice(n, n + 4));
  return r ? (t.y = +r[0], n + r[0].length) : -1;
}
function Ee(t, e, n) {
  var r = G.exec(e.slice(n, n + 2));
  return r ? (t.y = +r[0] + (+r[0] > 68 ? 1900 : 2e3), n + r[0].length) : -1;
}
function Mr(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 _r(t, e, n) {
  var r = G.exec(e.slice(n, n + 1));
  return r ? (t.q = r[0] * 3 - 3, n + r[0].length) : -1;
}
function Sr(t, e, n) {
  var r = G.exec(e.slice(n, n + 2));
  return r ? (t.m = r[0] - 1, n + r[0].length) : -1;
}
function Ae(t, e, n) {
  var r = G.exec(e.slice(n, n + 2));
  return r ? (t.d = +r[0], n + r[0].length) : -1;
}
function Ur(t, e, n) {
  var r = G.exec(e.slice(n, n + 3));
  return r ? (t.m = 0, t.d = +r[0], n + r[0].length) : -1;
}
function Ie(t, e, n) {
  var r = G.exec(e.slice(n, n + 2));
  return r ? (t.H = +r[0], n + r[0].length) : -1;
}
function Fr(t, e, n) {
  var r = G.exec(e.slice(n, n + 2));
  return r ? (t.M = +r[0], n + r[0].length) : -1;
}
function Er(t, e, n) {
  var r = G.exec(e.slice(n, n + 2));
  return r ? (t.S = +r[0], n + r[0].length) : -1;
}
function Ar(t, e, n) {
  var r = G.exec(e.slice(n, n + 3));
  return r ? (t.L = +r[0], n + r[0].length) : -1;
}
function Ir(t, e, n) {
  var r = G.exec(e.slice(n, n + 6));
  return r ? (t.L = Math.floor(r[0] / 1e3), n + r[0].length) : -1;
}
function Yr(t, e, n) {
  var r = pr.exec(e.slice(n, n + 1));
  return r ? n + r[0].length : -1;
}
function Lr(t, e, n) {
  var r = G.exec(e.slice(n));
  return r ? (t.Q = +r[0], n + r[0].length) : -1;
}
function Wr(t, e, n) {
  var r = G.exec(e.slice(n));
  return r ? (t.s = +r[0], n + r[0].length) : -1;
}
function Ye(t, e) {
  return L(t.getDate(), e, 2);
}
function Or(t, e) {
  return L(t.getHours(), e, 2);
}
function Nr(t, e) {
  return L(t.getHours() % 12 || 12, e, 2);
}
function Hr(t, e) {
  return L(1 + yt.count(ft(t), t), e, 3);
}
function sn(t, e) {
  return L(t.getMilliseconds(), e, 3);
}
function Vr(t, e) {
  return sn(t, e) + "000";
}
function Pr(t, e) {
  return L(t.getMonth() + 1, e, 2);
}
function Rr(t, e) {
  return L(t.getMinutes(), e, 2);
}
function zr(t, e) {
  return L(t.getSeconds(), e, 2);
}
function jr(t) {
  var e = t.getDay();
  return e === 0 ? 7 : e;
}
function Br(t, e) {
  return L(Wt.count(ft(t) - 1, t), e, 2);
}
function an(t) {
  var e = t.getDay();
  return e >= 4 || e === 0 ? gt(t) : gt.ceil(t);
}
function qr(t, e) {
  return t = an(t), L(gt.count(ft(t), t) + (ft(t).getDay() === 4), e, 2);
}
function Zr(t) {
  return t.getDay();
}
function Xr(t, e) {
  return L(Yt.count(ft(t) - 1, t), e, 2);
}
function Qr(t, e) {
  return L(t.getFullYear() % 100, e, 2);
}
function Gr(t, e) {
  return t = an(t), L(t.getFullYear() % 100, e, 2);
}
function Jr(t, e) {
  return L(t.getFullYear() % 1e4, e, 4);
}
function Kr(t, e) {
  var n = t.getDay();
  return t = n >= 4 || n === 0 ? gt(t) : gt.ceil(t), L(t.getFullYear() % 1e4, e, 4);
}
function $r(t) {
  var e = t.getTimezoneOffset();
  return (e > 0 ? "-" : (e *= -1, "+")) + L(e / 60 | 0, "0", 2) + L(e % 60, "0", 2);
}
function Le(t, e) {
  return L(t.getUTCDate(), e, 2);
}
function ti(t, e) {
  return L(t.getUTCHours(), e, 2);
}
function ei(t, e) {
  return L(t.getUTCHours() % 12 || 12, e, 2);
}
function ni(t, e) {
  return L(1 + ge.count(kt(t), t), e, 3);
}
function on(t, e) {
  return L(t.getUTCMilliseconds(), e, 3);
}
function ri(t, e) {
  return on(t, e) + "000";
}
function ii(t, e) {
  return L(t.getUTCMonth() + 1, e, 2);
}
function si(t, e) {
  return L(t.getUTCMinutes(), e, 2);
}
function ai(t, e) {
  return L(t.getUTCSeconds(), e, 2);
}
function oi(t) {
  var e = t.getUTCDay();
  return e === 0 ? 7 : e;
}
function ci(t, e) {
  return L(rn.count(kt(t) - 1, t), e, 2);
}
function cn(t) {
  var e = t.getUTCDay();
  return e >= 4 || e === 0 ? Mt(t) : Mt.ceil(t);
}
function li(t, e) {
  return t = cn(t), L(Mt.count(kt(t), t) + (kt(t).getUTCDay() === 4), e, 2);
}
function ui(t) {
  return t.getUTCDay();
}
function fi(t, e) {
  return L(Xt.count(kt(t) - 1, t), e, 2);
}
function hi(t, e) {
  return L(t.getUTCFullYear() % 100, e, 2);
}
function di(t, e) {
  return t = cn(t), L(t.getUTCFullYear() % 100, e, 2);
}
function mi(t, e) {
  return L(t.getUTCFullYear() % 1e4, e, 4);
}
function yi(t, e) {
  var n = t.getUTCDay();
  return t = n >= 4 || n === 0 ? Mt(t) : Mt.ceil(t), L(t.getUTCFullYear() % 1e4, e, 4);
}
function gi() {
  return "+0000";
}
function We() {
  return "%";
}
function Oe(t) {
  return +t;
}
function Ne(t) {
  return Math.floor(+t / 1e3);
}
var vt, Qt;
ki({
  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 ki(t) {
  return vt = kr(t), Qt = vt.format, vt.parse, vt.utcFormat, vt.utcParse, vt;
}
function pi(t) {
  return new Date(t);
}
function Ti(t) {
  return t instanceof Date ? +t : +/* @__PURE__ */ new Date(+t);
}
function ln(t, e, n, r, i, s, a, x, S, k) {
  var p = Nn(), F = p.invert, T = p.domain, g = k(".%L"), P = k(":%S"), E = k("%I:%M"), $ = k("%I %p"), et = k("%a %d"), tt = k("%b %d"), B = k("%B"), q = k("%Y");
  function K(v) {
    return (S(v) < v ? g : x(v) < v ? P : a(v) < v ? E : s(v) < v ? $ : r(v) < v ? i(v) < v ? et : tt : n(v) < v ? B : q)(v);
  }
  return p.invert = function(v) {
    return new Date(F(v));
  }, p.domain = function(v) {
    return arguments.length ? T(Array.from(v, Ti)) : T().map(pi);
  }, p.ticks = function(v) {
    var H = T();
    return t(H[0], H[H.length - 1], v ?? 10);
  }, p.tickFormat = function(v, H) {
    return H == null ? K : k(H);
  }, p.nice = function(v) {
    var H = T();
    return (!v || typeof v.range != "function") && (v = e(H[0], H[H.length - 1], v ?? 10)), v ? T(sr(H, v)) : p;
  }, p.copy = function() {
    return Hn(p, ln(t, e, n, r, i, s, a, x, S, k));
  }, p;
}
function bi() {
  return Pn.apply(ln(yr, gr, ft, Lt, Wt, yt, It, At, ht, Qt).domain([new Date(2e3, 0, 1), new Date(2e3, 0, 2)]), arguments);
}
var un = { exports: {} };
(function(t, e) {
  (function(n, r) {
    t.exports = r();
  })(xn, function() {
    var n = "day";
    return function(r, i, s) {
      var a = function(k) {
        return k.add(4 - k.isoWeekday(), n);
      }, x = i.prototype;
      x.isoWeekYear = function() {
        return a(this).year();
      }, x.isoWeek = function(k) {
        if (!this.$utils().u(k))
          return this.add(7 * (k - this.isoWeek()), n);
        var p, F, T, g, P = a(this), E = (p = this.isoWeekYear(), F = this.$u, T = (F ? s.utc : s)().year(p).startOf("year"), g = 4 - T.isoWeekday(), T.isoWeekday() > 4 && (g += 7), T.add(g, n));
        return P.diff(E, "week") + 1;
      }, x.isoWeekday = function(k) {
        return this.$utils().u(k) ? this.day() || 7 : this.day(this.day() % 7 ? k : k - 7);
      };
      var S = x.startOf;
      x.startOf = function(k, p) {
        var F = this.$utils(), T = !!F.u(p) || p;
        return F.p(k) === "isoweek" ? T ? this.date(this.date() - (this.isoWeekday() - 1)).startOf("day") : this.date(this.date() - 1 - (this.isoWeekday() - 1) + 7).endOf("day") : S.bind(this)(k, p);
      };
    };
  });
})(un);
var vi = un.exports;
const xi = /* @__PURE__ */ wn(vi);
var fe = function() {
  var t = function(w, c, d, m) {
    for (d = d || {}, m = w.length; m--; d[w[m]] = c)
      ;
    return d;
  }, e = [6, 8, 10, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 30, 32, 33, 35, 37], n = [1, 25], r = [1, 26], i = [1, 27], s = [1, 28], a = [1, 29], x = [1, 30], S = [1, 31], k = [1, 9], p = [1, 10], F = [1, 11], T = [1, 12], g = [1, 13], P = [1, 14], E = [1, 15], $ = [1, 16], et = [1, 18], tt = [1, 19], B = [1, 20], q = [1, 21], K = [1, 22], v = [1, 24], H = [1, 32], b = {
    trace: function() {
    },
    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, dateFormat: 19, inclusiveEndDates: 20, topAxis: 21, axisFormat: 22, tickInterval: 23, excludes: 24, includes: 25, todayMarker: 26, title: 27, acc_title: 28, acc_title_value: 29, acc_descr: 30, acc_descr_value: 31, acc_descr_multiline_value: 32, section: 33, clickStatement: 34, taskTxt: 35, taskData: 36, click: 37, callbackname: 38, callbackargs: 39, href: 40, clickStatementDebug: 41, $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", 19: "dateFormat", 20: "inclusiveEndDates", 21: "topAxis", 22: "axisFormat", 23: "tickInterval", 24: "excludes", 25: "includes", 26: "todayMarker", 27: "title", 28: "acc_title", 29: "acc_title_value", 30: "acc_descr", 31: "acc_descr_value", 32: "acc_descr_multiline_value", 33: "section", 35: "taskTxt", 36: "taskData", 37: "click", 38: "callbackname", 39: "callbackargs", 40: "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], [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], [34, 2], [34, 3], [34, 3], [34, 4], [34, 3], [34, 4], [34, 2], [41, 2], [41, 3], [41, 3], [41, 4], [41, 3], [41, 4], [41, 2]],
    performAction: function(c, d, m, u, D, o, z) {
      var h = o.length - 1;
      switch (D) {
        case 1:
          return o[h - 1];
        case 2:
          this.$ = [];
          break;
        case 3:
          o[h - 1].push(o[h]), this.$ = o[h - 1];
          break;
        case 4:
        case 5:
          this.$ = o[h];
          break;
        case 6:
        case 7:
          this.$ = [];
          break;
        case 8:
          u.setWeekday("monday");
          break;
        case 9:
          u.setWeekday("tuesday");
          break;
        case 10:
          u.setWeekday("wednesday");
          break;
        case 11:
          u.setWeekday("thursday");
          break;
        case 12:
          u.setWeekday("friday");
          break;
        case 13:
          u.setWeekday("saturday");
          break;
        case 14:
          u.setWeekday("sunday");
          break;
        case 15:
          u.setDateFormat(o[h].substr(11)), this.$ = o[h].substr(11);
          break;
        case 16:
          u.enableInclusiveEndDates(), this.$ = o[h].substr(18);
          break;
        case 17:
          u.TopAxis(), this.$ = o[h].substr(8);
          break;
        case 18:
          u.setAxisFormat(o[h].substr(11)), this.$ = o[h].substr(11);
          break;
        case 19:
          u.setTickInterval(o[h].substr(13)), this.$ = o[h].substr(13);
          break;
        case 20:
          u.setExcludes(o[h].substr(9)), this.$ = o[h].substr(9);
          break;
        case 21:
          u.setIncludes(o[h].substr(9)), this.$ = o[h].substr(9);
          break;
        case 22:
          u.setTodayMarker(o[h].substr(12)), this.$ = o[h].substr(12);
          break;
        case 24:
          u.setDiagramTitle(o[h].substr(6)), this.$ = o[h].substr(6);
          break;
        case 25:
          this.$ = o[h].trim(), u.setAccTitle(this.$);
          break;
        case 26:
        case 27:
          this.$ = o[h].trim(), u.setAccDescription(this.$);
          break;
        case 28:
          u.addSection(o[h].substr(8)), this.$ = o[h].substr(8);
          break;
        case 30:
          u.addTask(o[h - 1], o[h]), this.$ = "task";
          break;
        case 31:
          this.$ = o[h - 1], u.setClickEvent(o[h - 1], o[h], null);
          break;
        case 32:
          this.$ = o[h - 2], u.setClickEvent(o[h - 2], o[h - 1], o[h]);
          break;
        case 33:
          this.$ = o[h - 2], u.setClickEvent(o[h - 2], o[h - 1], null), u.setLink(o[h - 2], o[h]);
          break;
        case 34:
          this.$ = o[h - 3], u.setClickEvent(o[h - 3], o[h - 2], o[h - 1]), u.setLink(o[h - 3], o[h]);
          break;
        case 35:
          this.$ = o[h - 2], u.setClickEvent(o[h - 2], o[h], null), u.setLink(o[h - 2], o[h - 1]);
          break;
        case 36:
          this.$ = o[h - 3], u.setClickEvent(o[h - 3], o[h - 1], o[h]), u.setLink(o[h - 3], o[h - 2]);
          break;
        case 37:
          this.$ = o[h - 1], u.setLink(o[h - 1], o[h]);
          break;
        case 38:
        case 44:
          this.$ = o[h - 1] + " " + o[h];
          break;
        case 39:
        case 40:
        case 42:
          this.$ = o[h - 2] + " " + o[h - 1] + " " + o[h];
          break;
        case 41:
        case 43:
          this.$ = o[h - 3] + " " + o[h - 2] + " " + o[h - 1] + " " + o[h];
          break;
      }
    },
    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: a, 17: x, 18: S, 19: k, 20: p, 21: F, 22: T, 23: g, 24: P, 25: E, 26: $, 27: et, 28: tt, 30: B, 32: q, 33: K, 34: 23, 35: v, 37: H }, t(e, [2, 7], { 1: [2, 1] }), t(e, [2, 3]), { 9: 33, 11: 17, 12: n, 13: r, 14: i, 15: s, 16: a, 17: x, 18: S, 19: k, 20: p, 21: F, 22: T, 23: g, 24: P, 25: E, 26: $, 27: et, 28: tt, 30: B, 32: q, 33: K, 34: 23, 35: v, 37: H }, t(e, [2, 5]), t(e, [2, 6]), t(e, [2, 15]), t(e, [2, 16]), 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]), { 29: [1, 34] }, { 31: [1, 35] }, t(e, [2, 27]), t(e, [2, 28]), t(e, [2, 29]), { 36: [1, 36] }, 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]), { 38: [1, 37], 40: [1, 38] }, t(e, [2, 4]), t(e, [2, 25]), t(e, [2, 26]), t(e, [2, 30]), t(e, [2, 31], { 39: [1, 39], 40: [1, 40] }), t(e, [2, 37], { 38: [1, 41] }), t(e, [2, 32], { 40: [1, 42] }), t(e, [2, 33]), t(e, [2, 35], { 39: [1, 43] }), t(e, [2, 34]), t(e, [2, 36])],
    defaultActions: {},
    parseError: function(c, d) {
      if (d.recoverable)
        this.trace(c);
      else {
        var m = new Error(c);
        throw m.hash = d, m;
      }
    },
    parse: function(c) {
      var d = this, m = [0], u = [], D = [null], o = [], z = this.table, h = "", f = 0, M = 0, R = 2, Y = 1, W = o.slice.call(arguments, 1), I = Object.create(this.lexer), O = { yy: {} };
      for (var dt in this.yy)
        Object.prototype.hasOwnProperty.call(this.yy, dt) && (O.yy[dt] = this.yy[dt]);
      I.setInput(c, O.yy), O.yy.lexer = I, O.yy.parser = this, typeof I.yylloc > "u" && (I.yylloc = {});
      var mt = I.yylloc;
      o.push(mt);
      var y = I.options && I.options.ranges;
      typeof O.yy.parseError == "function" ? this.parseError = O.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
      function A() {
        var st;
        return st = u.pop() || I.lex() || Y, typeof st != "number" && (st instanceof Array && (u = st, st = u.pop()), st = d.symbols_[st] || st), st;
      }
      for (var C, l, V, N, j = {}, Q, J, St, Vt; ; ) {
        if (l = m[m.length - 1], this.defaultActions[l] ? V = this.defaultActions[l] : ((C === null || typeof C > "u") && (C = A()), V = z[l] && z[l][C]), typeof V > "u" || !V.length || !V[0]) {
          var Jt = "";
          Vt = [];
          for (Q in z[l])
            this.terminals_[Q] && Q > R && Vt.push("'" + this.terminals_[Q] + "'");
          I.showPosition ? Jt = "Parse error on line " + (f + 1) + `:
` + I.showPosition() + `
Expecting ` + Vt.join(", ") + ", got '" + (this.terminals_[C] || C) + "'" : Jt = "Parse error on line " + (f + 1) + ": Unexpected " + (C == Y ? "end of input" : "'" + (this.terminals_[C] || C) + "'"), this.parseError(Jt, {
            text: I.match,
            token: this.terminals_[C] || C,
            line: I.yylineno,
            loc: mt,
            expected: Vt
          });
        }
        if (V[0] instanceof Array && V.length > 1)
          throw new Error("Parse Error: multiple actions possible at state: " + l + ", token: " + C);
        switch (V[0]) {
          case 1:
            m.push(C), D.push(I.yytext), o.push(I.yylloc), m.push(V[1]), C = null, M = I.yyleng, h = I.yytext, f = I.yylineno, mt = I.yylloc;
            break;
          case 2:
            if (J = this.productions_[V[1]][1], j.$ = D[D.length - J], j._$ = {
              first_line: o[o.length - (J || 1)].first_line,
              last_line: o[o.length - 1].last_line,
              first_column: o[o.length - (J || 1)].first_column,
              last_column: o[o.length - 1].last_column
            }, y && (j._$.range = [
              o[o.length - (J || 1)].range[0],
              o[o.length - 1].range[1]
            ]), N = this.performAction.apply(j, [
              h,
              M,
              f,
              O.yy,
              V[1],
              D,
              o
            ].concat(W)), typeof N < "u")
              return N;
            J && (m = m.slice(0, -1 * J * 2), D = D.slice(0, -1 * J), o = o.slice(0, -1 * J)), m.push(this.productions_[V[1]][0]), D.push(j.$), o.push(j._$), St = z[m[m.length - 2]][m[m.length - 1]], m.push(St);
            break;
          case 3:
            return !0;
        }
      }
      return !0;
    }
  }, U = function() {
    var w = {
      EOF: 1,
      parseError: function(d, m) {
        if (this.yy.parser)
          this.yy.parser.parseError(d, m);
        else
          throw new Error(d);
      },
      // resets the lexer, sets new input
      setInput: function(c, d) {
        return this.yy = d || this.yy || {}, this._input = c, 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;
      },
      // consumes and returns one char from the input
      input: function() {
        var c = this._input[0];
        this.yytext += c, this.yyleng++, this.offset++, this.match += c, this.matched += c;
        var d = c.match(/(?:\r\n?|\n).*/g);
        return d ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), c;
      },
      // unshifts one char (or a string) into the input
      unput: function(c) {
        var d = c.length, m = c.split(/(?:\r\n?|\n)/g);
        this._input = c + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - d), this.offset -= d;
        var u = 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), m.length - 1 && (this.yylineno -= m.length - 1);
        var D = 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: m ? (m.length === u.length ? this.yylloc.first_column : 0) + u[u.length - m.length].length - m[0].length : this.yylloc.first_column - d
        }, this.options.ranges && (this.yylloc.range = [D[0], D[0] + this.yyleng - d]), this.yyleng = this.yytext.length, this;
      },
      // When called from action, caches matched text and appends it on next action
      more: function() {
        return this._more = !0, this;
      },
      // 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: 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;
      },
      // retain first n characters of the match
      less: function(c) {
        this.unput(this.match.slice(c));
      },
      // displays already matched input, i.e. for error messages
      pastInput: function() {
        var c = this.matched.substr(0, this.matched.length - this.match.length);
        return (c.length > 20 ? "..." : "") + c.substr(-20).replace(/\n/g, "");
      },
      // displays upcoming input, i.e. for error messages
      upcomingInput: function() {
        var c = this.match;
        return c.length < 20 && (c += this._input.substr(0, 20 - c.length)), (c.substr(0, 20) + (c.length > 20 ? "..." : "")).replace(/\n/g, "");
      },
      // displays the character position where the lexing error occurred, i.e. for error messages
      showPosition: function() {
        var c = this.pastInput(), d = new Array(c.length + 1).join("-");
        return c + this.upcomingInput() + `
` + d + "^";
      },
      // test the lexed token: return FALSE when not a match, otherwise return token
      test_match: function(c, d) {
        var m, u, D;
        if (this.options.backtrack_lexer && (D = {
          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 && (D.yylloc.range = this.yylloc.range.slice(0))), u = c[0].match(/(?:\r\n?|\n).*/g), u && (this.yylineno += u.length), this.yylloc = {
          first_line: this.yylloc.last_line,
          last_line: this.yylineno + 1,
          first_column: this.yylloc.last_column,
          last_column: u ? u[u.length - 1].length - u[u.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + c[0].length
        }, this.yytext += c[0], this.match += c[0], this.matches = c, 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(c[0].length), this.matched += c[0], m = this.performAction.call(this, this.yy, this, d, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), m)
          return m;
        if (this._backtrack) {
          for (var o in D)
            this[o] = D[o];
          return !1;
        }
        return !1;
      },
      // return next match in input
      next: function() {
        if (this.done)
          return this.EOF;
        this._input || (this.done = !0);
        var c, d, m, u;
        this._more || (this.yytext = "", this.match = "");
        for (var D = this._currentRules(), o = 0; o < D.length; o++)
          if (m = this._input.match(this.rules[D[o]]), m && (!d || m[0].length > d[0].length)) {
            if (d = m, u = o, this.options.backtrack_lexer) {
              if (c = this.test_match(m, D[o]), c !== !1)
                return c;
              if (this._backtrack) {
                d = !1;
                continue;
              } else
                return !1;
            } else if (!this.options.flex)
              break;
          }
        return d ? (c = this.test_match(d, D[u]), c !== !1 ? c : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
` + this.showPosition(), {
          text: "",
          token: null,
          line: this.yylineno
        });
      },
      // return next match that has a token
      lex: function() {
        var d = this.next();
        return d || this.lex();
      },
      // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
      begin: function(d) {
        this.conditionStack.push(d);
      },
      // pop the previously active lexer condition state off the condition stack
      popState: function() {
        var d = this.conditionStack.length - 1;
        return d > 0 ? this.conditionStack.pop() : this.conditionStack[0];
      },
      // produce the lexer rule set which is active for the currently active lexer condition state
      _currentRules: function() {
        return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
      },
      // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
      topState: function(d) {
        return d = this.conditionStack.length - 1 - Math.abs(d || 0), d >= 0 ? this.conditionStack[d] : "INITIAL";
      },
      // alias for begin(condition)
      pushState: function(d) {
        this.begin(d);
      },
      // return the number of states currently on the stack
      stateStackSize: function() {
        return this.conditionStack.length;
      },
      options: { "case-insensitive": !0 },
      performAction: function(d, m, u, D) {
        switch (u) {
          case 0:
            return this.begin("open_directive"), "open_directive";
          case 1:
            return this.begin("acc_title"), 28;
          case 2:
            return this.popState(), "acc_title_value";
          case 3:
            return this.begin("acc_descr"), 30;
          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 40;
          case 17:
            this.begin("callbackname");
            break;
          case 18:
            this.popState();
            break;
          case 19:
            this.popState(), this.begin("callbackargs");
            break;
          case 20:
            return 38;
          case 21:
            this.popState();
            break;
          case 22:
            return 39;
          case 23:
            this.begin("click");
            break;
          case 24:
            this.popState();
            break;
          case 25:
            return 37;
          case 26:
            return 4;
          case 27:
            return 19;
          case 28:
            return 20;
          case 29:
            return 21;
          case 30:
            return 22;
          case 31:
            return 23;
          case 32:
            return 25;
          case 33:
            return 24;
          case 34:
            return 26;
          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 "date";
          case 43:
            return 27;
          case 44:
            return "accDescription";
          case 45:
            return 33;
          case 46:
            return 35;
          case 47:
            return 36;
          case 48:
            return ":";
          case 49:
            return 6;
          case 50:
            return "INVALID";
        }
      },
      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, /^(?:\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], inclusive: !0 } }
    };
    return w;
  }();
  b.lexer = U;
  function _() {
    this.yy = {};
  }
  return _.prototype = b, b.Parser = _, new _();
}();
fe.parser = fe;
const wi = fe;
$dayjs.extend(xi);
$dayjs.extend(Cn);
$dayjs.extend(Dn);
let rt = "", ke = "", pe, Te = "", Ot = [], Nt = [], be = {}, ve = [], Gt = [], _t = "", xe = "";
const fn = ["active", "done", "crit", "milestone"];
let we = [], Ht = !1, Ce = !1, De = "sunday", he = 0;
const Ci = function() {
  ve = [], Gt = [], _t = "", we = [], jt = 0, me = void 0, Bt = void 0, Z = [], rt = "", ke = "", xe = "", pe = void 0, Te = "", Ot = [], Nt = [], Ht = !1, Ce = !1, he = 0, be = {}, An(), De = "sunday";
}, Di = function(t) {
  ke = t;
}, Mi = function() {
  return ke;
}, _i = function(t) {
  pe = t;
}, Si = function() {
  return pe;
}, Ui = function(t) {
  Te = t;
}, Fi = function() {
  return Te;
}, Ei = function(t) {
  rt = t;
}, Ai = function() {
  Ht = !0;
}, Ii = function() {
  return Ht;
}, Yi = function() {
  Ce = !0;
}, Li = function() {
  return Ce;
}, Wi = function(t) {
  xe = t;
}, Oi = function() {
  return xe;
}, Ni = function() {
  return rt;
}, Hi = function(t) {
  Ot = t.toLowerCase().split(/[\s,]+/);
}, Vi = function() {
  return Ot;
}, Pi = function(t) {
  Nt = t.toLowerCase().split(/[\s,]+/);
}, Ri = function() {
  return Nt;
}, zi = function() {
  return be;
}, ji = function(t) {
  _t = t, ve.push(t);
}, Bi = function() {
  return ve;
}, qi = function() {
  let t = He();
  const e = 10;
  let n = 0;
  for (; !t && n < e; )
    t = He(), n++;
  return Gt = Z, Gt;
}, hn = function(t, e, n, r) {
  return r.includes(t.format(e.trim())) ? !1 : t.isoWeekday() >= 6 && n.includes("weekends") || n.includes(t.format("dddd").toLowerCase()) ? !0 : n.includes(t.format(e.trim()));
}, Zi = function(t) {
  De = t;
}, Xi = function() {
  return De;
}, dn = function(t, e, n, r) {
  if (!n.length || t.manualEndTime)
    return;
  let i;
  t.startTime instanceof Date ? i = $dayjs(t.startTime) : i = $dayjs(t.startTime, e, !0), i = i.add(1, "d");
  let s;
  t.endTime instanceof Date ? s = $dayjs(t.endTime) : s = $dayjs(t.endTime, e, !0);
  const [a, x] = Qi(
    i,
    s,
    e,
    n,
    r
  );
  t.endTime = a.toDate(), t.renderEndTime = x;
}, Qi = function(t, e, n, r, i) {
  let s = !1, a = null;
  for (; t <= e; )
    s || (a = e.toDate()), s = hn(t, n, r, i), s && (e = e.add(1, "d")), t = t.add(1, "d");
  return [e, a];
}, de = function(t, e, n) {
  n = n.trim();
  const i = /^after\s+(?<ids>[\d\w- ]+)/.exec(n);
  if (i !== null) {
    let a = null;
    for (const S of i.groups.ids.split(" ")) {
      let k = bt(S);
      k !== void 0 && (!a || k.endTime > a.endTime) && (a = k);
    }
    if (a)
      return a.endTime;
    const x = /* @__PURE__ */ new Date();
    return x.setHours(0, 0, 0, 0), x;
  }
  let s = $dayjs(n, e.trim(), !0);
  if (s.isValid())
    return s.toDate();
  {
    qt.debug("Invalid date:" + n), qt.debug("With date format:" + e.trim());
    const a = new Date(n);
    if (a === void 0 || isNaN(a.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.
    a.getFullYear() < -1e4 || a.getFullYear() > 1e4)
      throw new Error("Invalid date:" + n);
    return a;
  }
}, mn = function(t) {
  const e = /^(\d+(?:\.\d+)?)([Mdhmswy]|ms)$/.exec(t.trim());
  return e !== null ? [Number.parseFloat(e[1]), e[2]] : [NaN, "ms"];
}, yn = function(t, e, n, r = !1) {
  n = n.trim();
  const s = /^until\s+(?<ids>[\d\w- ]+)/.exec(n);
  if (s !== null) {
    let p = null;
    for (const T of s.groups.ids.split(" ")) {
      let g = bt(T);
      g !== void 0 && (!p || g.startTime < p.startTime) && (p = g);
    }
    if (p)
      return p.startTime;
    const F = /* @__PURE__ */ new Date();
    return F.setHours(0, 0, 0, 0), F;
  }
  let a = $dayjs(n, e.trim(), !0);
  if (a.isValid())
    return r && (a = a.add(1, "d")), a.toDate();
  let x = $dayjs(t);
  const [S, k] = mn(n);
  if (!Number.isNaN(S)) {
    const p = x.add(S, k);
    p.isValid() && (x = p);
  }
  return x.toDate();
};
let jt = 0;
const Ct = function(t) {
  return t === void 0 ? (jt = jt + 1, "task" + jt) : t;
}, Gi = function(t, e) {
  let n;
  e.substr(0, 1) === ":" ? n = e.substr(1, e.length) : n = e;
  const r = n.split(","), i = {};
  Tn(r, i, fn);
  for (let a = 0; a < r.length; a++)
    r[a] = r[a].trim();
  let s = "";
  switch (r.length) {
    case 1:
      i.id = Ct(), i.startTime = t.endTime, s = r[0];
      break;
    case 2:
      i.id = Ct(), i.startTime = de(void 0, rt, r[0]), s = r[1];
      break;
    case 3:
      i.id = Ct(r[0]), i.startTime = de(void 0, rt, r[1]), s = r[2];
      break;
  }
  return s && (i.endTime = yn(i.startTime, rt, s, Ht), i.manualEndTime = $dayjs(s, "YYYY-MM-DD", !0).isValid(), dn(i, rt, Nt, Ot)), i;
}, Ji = function(t, e) {
  let n;
  e.substr(0, 1) === ":" ? n = e.substr(1, e.length) : n = e;
  const r = n.split(","), i = {};
  Tn(r, i, fn);
  for (let s = 0; s < r.length; s++)
    r[s] = r[s].trim();
  switch (r.length) {
    case 1:
      i.id = Ct(), i.startTime = {
        type: "prevTaskEnd",
        id: t
      }, i.endTime = {
        data: r[0]
      };
      break;
    case 2:
      i.id = Ct(), i.startTime = {
        type: "getStartDate",
        startData: r[0]
      }, i.endTime = {
        data: r[1]
      };
      break;
    case 3:
      i.id = Ct(r[0]), i.startTime = {
        type: "getStartDate",
        startData: r[1]
      }, i.endTime = {
        data: r[2]
      };
      break;
  }
  return i;
};
let me, Bt, Z = [];
const gn = {}, Ki = function(t, e) {
  const n = {
    section: _t,
    type: _t,
    processed: !1,
    manualEndTime: !1,
    renderEndTime: null,
    raw: { data: e },
    task: t,
    classes: []
  }, r = Ji(Bt, e);
  n.raw.startTime = r.startTime, n.raw.endTime = r.endTime, n.id = r.id, n.prevTaskId = Bt, n.active = r.active, n.done = r.done, n.crit = r.crit, n.milestone = r.milestone, n.order = he, he++;
  const i = Z.push(n);
  Bt = n.id, gn[n.id] = i - 1;
}, bt = function(t) {
  const e = gn[t];
  return Z[e];
}, $i = function(t, e) {
  const n = {
    section: _t,
    type: _t,
    description: t,
    task: t,
    classes: []
  }, r = Gi(me, 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, me = n, Gt.push(n);
}, He = function() {
  const t = function(n) {
    const r = Z[n];
    let i = "";
    switch (Z[n].raw.startTime.type) {
      case "prevTaskEnd": {
        const s = bt(r.prevTaskId);
        r.startTime = s.endTime;
        break;
      }
      case "getStartDate":
        i = de(void 0, rt, Z[n].raw.startTime.startData), i && (Z[n].startTime = i);
        break;
    }
    return Z[n].startTime && (Z[n].endTime = yn(
      Z[n].startTime,
      rt,
      Z[n].raw.endTime.data,
      Ht
    ), Z[n].endTime && (Z[n].processed = !0, Z[n].manualEndTime = $dayjs(
      Z[n].raw.endTime.data,
      "YYYY-MM-DD",
      !0
    ).isValid(), dn(Z[n], rt, Nt, Ot))), Z[n].processed;
  };
  let e = !0;
  for (const [n, r] of Z.entries())
    t(n), e = e && r.processed;
  return e;
}, ts = function(t, e) {
  let n = e;
  xt().securityLevel !== "loose" && (n = In.sanitizeUrl(e)), t.split(",").forEach(function(r) {
    bt(r) !== void 0 && (pn(r, () => {
      window.open(n, "_self");
    }), be[r] = n);
  }), kn(t, "clickable");
}, kn = function(t, e) {
  t.split(",").forEach(function(n) {
    let r = bt(n);
    r !== void 0 && r.classes.push(e);
  });
}, es = function(t, e, n) {
  if (xt().securityLevel !== "loose" || e === void 0)
    return;
  let r = [];
  if (typeof n == "string") {
    r = n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);
    for (let s = 0; s < r.length; s++) {
      let a = r[s].trim();
      a.charAt(0) === '"' && a.charAt(a.length - 1) === '"' && (a = a.substr(1, a.length - 2)), r[s] = a;
    }
  }
  r.length === 0 && r.push(t), bt(t) !== void 0 && pn(t, () => {
    Wn.runFunc(e, ...r);
  });
}, pn = function(t, e) {
  we.push(
    function() {
      const n = document.querySelector(`[id="${t}"]`);
      n !== null && n.addEventListener("click", function() {
        e();
      });
    },
    function() {
      const n = document.querySelector(`[id="${t}-text"]`);
      n !== null && n.addEventListener("click", function() {
        e();
      });
    }
  );
}, ns = function(t, e, n) {
  t.split(",").forEach(function(r) {
    es(r, e, n);
  }), kn(t, "clickable");
}, rs = function(t) {
  we.forEach(function(e) {
    e(t);
  });
}, is = {
  getConfig: () => xt().gantt,
  clear: Ci,
  setDateFormat: Ei,
  getDateFormat: Ni,
  enableInclusiveEndDates: Ai,
  endDatesAreInclusive: Ii,
  enableTopAxis: Yi,
  topAxisEnabled: Li,
  setAxisFormat: Di,
  getAxisFormat: Mi,
  setTickInterval: _i,
  getTickInterval: Si,
  setTodayMarker: Ui,
  getTodayMarker: Fi,
  setAccTitle: Mn,
  getAccTitle: _n,
  setDiagramTitle: Sn,
  getDiagramTitle: Un,
  setDisplayMode: Wi,
  getDisplayMode: Oi,
  setAccDescription: Fn,
  getAccDescription: En,
  addSection: ji,
  getSections: Bi,
  getTasks: qi,
  addTask: Ki,
  findTaskById: bt,
  addTaskOrg: $i,
  setIncludes: Hi,
  getIncludes: Vi,
  setExcludes: Pi,
  getExcludes: Ri,
  setClickEvent: ns,
  setLink: ts,
  getLinks: zi,
  bindFunctions: rs,
  parseDuration: mn,
  isInvalidDate: hn,
  setWeekday: Zi,
  getWeekday: Xi
};
function Tn(t, e, n) {
  let r = !0;
  for (; r; )
    r = !1, n.forEach(function(i) {
      const s = "^\\s*" + i + "\\s*$", a = new RegExp(s);
      t[0].match(a) && (e[i] = !0, t.shift(1), r = !0);
    });
}
const ss = function() {
  qt.debug("Something is calling, setConf, remove the call");
}, Ve = {
  monday: Yt,
  tuesday: $e,
  wednesday: tn,
  thursday: gt,
  friday: en,
  saturday: nn,
  sunday: Wt
}, as = (t, e) => {
  let n = [...t].map(() => -1 / 0), r = [...t].sort((s, a) => s.startTime - a.startTime || s.order - a.order), i = 0;
  for (const s of r)
    for (let a = 0; a < n.length; a++)
      if (s.startTime >= n[a]) {
        n[a] = s.endTime, s.order = a + e, a > i && (i = a);
        break;
      }
  return i;
};
let at;
const os = function(t, e, n, r) {
  const i = xt().gantt, s = xt().securityLevel;
  let a;
  s === "sandbox" && (a = Pt("#i" + e));
  const x = s === "sandbox" ? Pt(a.nodes()[0].contentDocument.body) : Pt("body"), S = s === "sandbox" ? a.nodes()[0].contentDocument : document, k = S.getElementById(e);
  at = k.parentElement.offsetWidth, at === void 0 && (at = 1200), i.useWidth !== void 0 && (at = i.useWidth);
  const p = r.db.getTasks();
  let F = [];
  for (const b of p)
    F.push(b.type);
  F = H(F);
  const T = {};
  let g = 2 * i.topPadding;
  if (r.db.getDisplayMode() === "compact" || i.displayMode === "compact") {
    const b = {};
    for (const _ of p)
      b[_.section] === void 0 ? b[_.section] = [_] : b[_.section].push(_);
    let U = 0;
    for (const _ of Object.keys(b)) {
      const w = as(b[_], U) + 1;
      U += w, g += w * (i.barHeight + i.barGap), T[_] = w;
    }
  } else {
    g += p.length * (i.barHeight + i.barGap);
    for (const b of F)
      T[b] = p.filter((U) => U.type === b).length;
  }
  k.setAttribute("viewBox", "0 0 " + at + " " + g);
  const P = x.select(`[id="${e}"]`), E = bi().domain([
    zn(p, function(b) {
      return b.startTime;
    }),
    Rn(p, function(b) {
      return b.endTime;
    })
  ]).rangeRound([0, at - i.leftPadding - i.rightPadding]);
  function $(b, U) {
    const _ = b.startTime, w = U.startTime;
    let c = 0;
    return _ > w ? c = 1 : _ < w && (c = -1), c;
  }
  p.sort($), et(p, at, g), Yn(P, g, at, i.useMaxWidth), P.append("text").text(r.db.getDiagramTitle()).attr("x", at / 2).attr("y", i.titleTopMargin).attr("class", "titleText");
  function et(b, U, _) {
    const w = i.barHeight, c = w + i.barGap, d = i.topPadding, m = i.leftPadding, u = Vn().domain([0, F.length]).range(["#00B9FA", "#F95002"]).interpolate(ir);
    B(
      c,
      d,
      m,
      U,
      _,
      b,
      r.db.getExcludes(),
      r.db.getIncludes()
    ), q(m, d, U, _), tt(b, c, d, m, w, u, U), K(c, d), v(m, d, U, _);
  }
  function tt(b, U, _, w, c, d, m) {
    const D = [...new Set(b.map((f) => f.order))].map((f) => b.find((M) => M.order === f));
    P.append("g").selectAll("rect").data(D).enter().append("rect").attr("x", 0).attr("y", function(f, M) {
      return M = f.order, M * U + _ - 2;
    }).attr("width", function() {
      return m - i.rightPadding / 2;
    }).attr("height", U).attr("class", function(f) {
      for (const [M, R] of F.entries())
        if (f.type === R)
          return "section section" + M % i.numberSectionStyles;
      return "section section0";
    });
    const o = P.append("g").selectAll("rect").data(b).enter(), z = r.db.getLinks();
    if (o.append("rect").attr("id", function(f) {
      return f.id;
    }).attr("rx", 3).attr("ry", 3).attr("x", function(f) {
      return f.milestone ? E(f.startTime) + w + 0.5 * (E(f.endTime) - E(f.startTime)) - 0.5 * c : E(f.startTime) + w;
    }).attr("y", function(f, M) {
      return M = f.order, M * U + _;
    }).attr("width", function(f) {
      return f.milestone ? c : E(f.renderEndTime || f.endTime) - E(f.startTime);
    }).attr("height", c).attr("transform-origin", function(f, M) {
      return M = f.order, (E(f.startTime) + w + 0.5 * (E(f.endTime) - E(f.startTime))).toString() + "px " + (M * U + _ + 0.5 * c).toString() + "px";
    }).attr("class", function(f) {
      const M = "task";
      let R = "";
      f.classes.length > 0 && (R = f.classes.join(" "));
      let Y = 0;
      for (const [I, O] of F.entries())
        f.type === O && (Y = I % i.numberSectionStyles);
      let W = "";
      return f.active ? f.crit ? W += " activeCrit" : W = " active" : f.done ? f.crit ? W = " doneCrit" : W = " done" : f.crit && (W += " crit"), W.length === 0 && (W = " task"), f.milestone && (W = " milestone " + W), W += Y, W += " " + R, M + W;
    }), o.append("text").attr("id", function(f) {
      return f.id + "-text";
    }).text(function(f) {
      return f.task;
    }).attr("font-size", i.fontSize).attr("x", function(f) {
      let M = E(f.startTime), R = E(f.renderEndTime || f.endTime);
      f.milestone && (M += 0.5 * (E(f.endTime) - E(f.startTime)) - 0.5 * c), f.milestone && (R = M + c);
      const Y = this.getBBox().width;
      return Y > R - M ? R + Y + 1.5 * i.leftPadding > m ? M + w - 5 : R + w + 5 : (R - M) / 2 + M + w;
    }).attr("y", function(f, M) {
      return M = f.order, M * U + i.barHeight / 2 + (i.fontSize / 2 - 2) + _;
    }).attr("text-height", c).attr("class", function(f) {
      const M = E(f.startTime);
      let R = E(f.endTime);
      f.milestone && (R = M + c);
      const Y = this.getBBox().width;
      let W = "";
      f.classes.length > 0 && (W = f.classes.join(" "));
      let I = 0;
      for (const [dt, mt] of F.entries())
        f.type === mt && (I = dt % i.numberSectionStyles);
      let O = "";
      return f.active && (f.crit ? O = "activeCritText" + I : O = "activeText" + I), f.done ? f.crit ? O = O + " doneCritText" + I : O = O + " doneText" + I : f.crit && (O = O + " critText" + I), f.milestone && (O += " milestoneText"), Y > R - M ? R + Y + 1.5 * i.leftPadding > m ? W + " taskTextOutsideLeft taskTextOutside" + I + " " + O : W + " taskTextOutsideRight taskTextOutside" + I + " " + O + " width-" + Y : W + " taskText taskText" + I + " " + O + " width-" + Y;
    }), xt().securityLevel === "sandbox") {
      let f;
      f = Pt("#i" + e);
      const M = f.nodes()[0].contentDocument;
      o.filter(function(R) {
        return z[R.id] !== void 0;
      }).each(function(R) {
        var Y = M.querySelector("#" + R.id), W = M.querySelector("#" + R.id + "-text");
        const I = Y.parentNode;
        var O = M.createElement("a");
        O.setAttribute("xlink:href", z[R.id]), O.setAttribute("target", "_top"), I.appendChild(O), O.appendChild(Y), O.appendChild(W);
      });
    }
  }
  function B(b, U, _, w, c, d, m, u) {
    if (m.length === 0 && u.length === 0)
      return;
    let D, o;
    for (const { startTime: Y, endTime: W } of d)
      (D === void 0 || Y < D) && (D = Y), (o === void 0 || W > o) && (o = W);
    if (!D || !o)
      return;
    if ($dayjs(o).diff($dayjs(D), "year") > 5) {
      qt.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 z = r.db.getDateFormat(), h = [];
    let f = null, M = $dayjs(D);
    for (; M.valueOf() <= o; )
      r.db.isInvalidDate(M, z, m, u) ? f ? f.end = M : f = {
        start: M,
        end: M
      } : f && (h.push(f), f = null), M = M.add(1, "d");
    P.append("g").selectAll("rect").data(h).enter().append("rect").attr("id", function(Y) {
      return "exclude-" + Y.start.format("YYYY-MM-DD");
    }).attr("x", function(Y) {
      return E(Y.start) + _;
    }).attr("y", i.gridLineStartPadding).attr("width", function(Y) {
      const W = Y.end.add(1, "day");
      return E(W) - E(Y.start);
    }).attr("height", c - U - i.gridLineStartPadding).attr("transform-origin", function(Y, W) {
      return (E(Y.start) + _ + 0.5 * (E(Y.end) - E(Y.start))).toString() + "px " + (W * b + 0.5 * c).toString() + "px";
    }).attr("class", "exclude-range");
  }
  function q(b, U, _, w) {
    let c = Jn(E).tickSize(-w + U + i.gridLineStartPadding).tickFormat(Qt(r.db.getAxisFormat() || i.axisFormat || "%Y-%m-%d"));
    const m = /^([1-9]\d*)(millisecond|second|minute|hour|day|week|month)$/.exec(
      r.db.getTickInterval() || i.tickInterval
    );
    if (m !== null) {
      const u = m[1], D = m[2], o = r.db.getWeekday() || i.weekday;
      switch (D) {
        case "millisecond":
          c.ticks(Dt.every(u));
          break;
        case "second":
          c.ticks(ht.every(u));
          break;
        case "minute":
          c.ticks(At.every(u));
          break;
        case "hour":
          c.ticks(It.every(u));
          break;
        case "day":
          c.ticks(yt.every(u));
          break;
        case "week":
          c.ticks(Ve[o].every(u));
          break;
        case "month":
          c.ticks(Lt.every(u));
          break;
      }
    }
    if (P.append("g").attr("class", "grid").attr("transform", "translate(" + b + ", " + (w - 50) + ")").call(c).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 u = Gn(E).tickSize(-w + U + i.gridLineStartPadding).tickFormat(Qt(r.db.getAxisFormat() || i.axisFormat || "%Y-%m-%d"));
      if (m !== null) {
        const D = m[1], o = m[2], z = r.db.getWeekday() || i.weekday;
        switch (o) {
          case "millisecond":
            u.ticks(Dt.every(D));
            break;
          case "second":
            u.ticks(ht.every(D));
            break;
          case "minute":
            u.ticks(At.every(D));
            break;
          case "hour":
            u.ticks(It.every(D));
            break;
          case "day":
            u.ticks(yt.every(D));
            break;
          case "week":
            u.ticks(Ve[z].every(D));
            break;
          case "month":
            u.ticks(Lt.every(D));
            break;
        }
      }
      P.append("g").attr("class", "grid").attr("transform", "translate(" + b + ", " + U + ")").call(u).selectAll("text").style("text-anchor", "middle").attr("fill", "#000").attr("stroke", "none").attr("font-size", 10);
    }
  }
  function K(b, U) {
    let _ = 0;
    const w = Object.keys(T).map((c) => [c, T[c]]);
    P.append("g").selectAll("text").data(w).enter().append(function(c) {
      const d = c[0].split(Ln.lineBreakRegex), m = -(d.length - 1) / 2, u = S.createElementNS("http://www.w3.org/2000/svg", "text");
      u.setAttribute("dy", m + "em");
      for (const [D, o] of d.entries()) {
        const z = S.createElementNS("http://www.w3.org/2000/svg", "tspan");
        z.setAttribute("alignment-baseline", "central"), z.setAttribute("x", "10"), D > 0 && z.setAttribute("dy", "1em"), z.textContent = o, u.appendChild(z);
      }
      return u;
    }).attr("x", 10).attr("y", function(c, d) {
      if (d > 0)
        for (let m = 0; m < d; m++)
          return _ += w[d - 1][1], c[1] * b / 2 + _ * b + U;
      else
        return c[1] * b / 2 + U;
    }).attr("font-size", i.sectionFontSize).attr("class", function(c) {
      for (const [d, m] of F.entries())
        if (c[0] === m)
          return "sectionTitle sectionTitle" + d % i.numberSectionStyles;
      return "sectionTitle";
    });
  }
  function v(b, U, _, w) {
    const c = r.db.getTodayMarker();
    if (c === "off")
      return;
    const d = P.append("g").attr("class", "today"), m = /* @__PURE__ */ new Date(), u = d.append("line");
    u.attr("x1", E(m) + b).attr("x2", E(m) + b).attr("y1", i.titleTopMargin).attr("y2", w - i.titleTopMargin).attr("class", "today"), c !== "" && u.attr("style", c.replace(/,/g, ";"));
  }
  function H(b) {
    const U = {}, _ = [];
    for (let w = 0, c = b.length; w < c; ++w)
      Object.prototype.hasOwnProperty.call(U, b[w]) || (U[b[w]] = !0, _.push(b[w]));
    return _;
  }
}, cs = {
  setConf: ss,
  draw: os
}, ls = (t) => `
  .mermaid-main-font {
    font-family: var(--mermaid-font-family, "trebuchet ms", verdana, arial, sans-serif);
  }

  .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: var(--mermaid-font-family, "trebuchet ms", verdana, arial, sans-serif);
  }


  /* 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: var(--mermaid-font-family, "trebuchet ms", verdana, arial, sans-serif);
  }

  .taskTextOutsideRight {
    fill: ${t.taskTextDarkColor};
    text-anchor: start;
    font-family: var(--mermaid-font-family, "trebuchet ms", verdana, arial, sans-serif);
  }

  .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;
  }


  /* 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;
  }

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

  .titleText {
    text-anchor: middle;
    font-size: 18px;
    fill: ${t.titleColor || t.textColor};
    font-family: var(--mermaid-font-family, "trebuchet ms", verdana, arial, sans-serif);
  }
`, us = ls, ms = {
  parser: wi,
  db: is,
  renderer: cs,
  styles: us
};
export {
  ms as diagram
};
