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


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

  .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"), Cs = Ds, Ls = {
  parser: Oi,
  db: Ts,
  renderer: Ms,
  styles: Cs
};
export {
  Ls as diagram
};
