import { ea as B, aF as ae, eb as Y, ec as Ve, ed as zt, j as A, k as E, ee as Ae, e2 as Ee, e as ut, L as W, ef as Be, eg as Oe, H as $, eh as se, f as Me, ei as oe, a3 as De, P as He, ej as Ge, x as ze, dZ as Fe, ek as Ue, el as je, r as j, ch as K, em as Ze, en as dt, eo as qe, aS as Ft, ep as Ke, aG as Xe, i as Ye, eq as $e, er as Je, es as Qe, et as We, eu as ti, ev as ei, ew as ii, ex as fe, ey as Tt, ez as ri, eA as ni, eB as ai, eC as si, z as oi, O as he, eD as U, eE as fi, aV as hi, eF as vi, eG as ve, B as ot, eH as St, dY as ui, bJ as li, eI as ue, eJ as di, eK as ci, eL as _i, eM as pi, eN as ft, eO as gi, eP as yi, c5 as mi, cj as ht, c as xi } from "./index-SHEAnnHB.js";
import "react";
import "react-dom";
import "lodash";
import "@emotion/react";
import "@alkuip/core";
import "@alkuip/forms";
import "@mui/material";
import "@alkuip/charts";
import "@emotion/styled";
var mt = Math.sin, xt = Math.cos, le = Math.PI, M = Math.PI * 2, wi = 180 / le, de = function() {
  function e() {
  }
  return e.prototype.reset = function(t) {
    this._start = !0, this._d = [], this._str = "", this._p = Math.pow(10, t || 4);
  }, e.prototype.moveTo = function(t, i) {
    this._add("M", t, i);
  }, e.prototype.lineTo = function(t, i) {
    this._add("L", t, i);
  }, e.prototype.bezierCurveTo = function(t, i, r, n, a, s) {
    this._add("C", t, i, r, n, a, s);
  }, e.prototype.quadraticCurveTo = function(t, i, r, n) {
    this._add("Q", t, i, r, n);
  }, e.prototype.arc = function(t, i, r, n, a, s) {
    this.ellipse(t, i, r, r, 0, n, a, s);
  }, e.prototype.ellipse = function(t, i, r, n, a, s, f, o) {
    var h = f - s, u = !o, v = Math.abs(h), l = B(v - M) || (u ? h >= M : -h >= M), c = h > 0 ? h % M : h % M + M, _ = !1;
    l ? _ = !0 : B(v) ? _ = !1 : _ = c >= le == !!u;
    var d = t + r * xt(s), p = i + n * mt(s);
    this._start && this._add("M", d, p);
    var y = Math.round(a * wi);
    if (l) {
      var g = 1 / this._p, m = (u ? 1 : -1) * (M - g);
      this._add("A", r, n, y, 1, +u, t + r * xt(s + m), i + n * mt(s + m)), g > 0.01 && this._add("A", r, n, y, 0, +u, d, p);
    } else {
      var x = t + r * xt(f), R = i + n * mt(f);
      this._add("A", r, n, y, +_, +u, x, R);
    }
  }, e.prototype.rect = function(t, i, r, n) {
    this._add("M", t, i), this._add("l", r, 0), this._add("l", 0, n), this._add("l", -r, 0), this._add("Z");
  }, e.prototype.closePath = function() {
    this._d.length > 0 && this._add("Z");
  }, e.prototype._add = function(t, i, r, n, a, s, f, o, h) {
    for (var u = [], v = this._p, l = 1; l < arguments.length; l++) {
      var c = arguments[l];
      if (isNaN(c)) {
        this._invalid = !0;
        return;
      }
      u.push(Math.round(c * v) / v);
    }
    this._d.push(t + u.join(" ")), this._start = t === "Z";
  }, e.prototype.generateStr = function() {
    this._str = this._invalid ? "" : this._d.join(""), this._d = [];
  }, e.prototype.getStr = function() {
    return this._str;
  }, e;
}(), X = "none", Li = Math.round;
function Si(e) {
  var t = e.fill;
  return t != null && t !== X;
}
function Ii(e) {
  var t = e.stroke;
  return t != null && t !== X;
}
var It = ["lineCap", "miterLimit", "lineJoin"], bi = A(It, function(e) {
  return "stroke-" + e.toLowerCase();
});
function Pi(e, t, i, r) {
  var n = t.opacity == null ? 1 : t.opacity;
  if (i instanceof ae) {
    e("opacity", n);
    return;
  }
  if (Si(t)) {
    var a = Y(t.fill);
    e("fill", a.color);
    var s = t.fillOpacity != null ? t.fillOpacity * a.opacity * n : a.opacity * n;
    (r || s < 1) && e("fill-opacity", s);
  } else
    e("fill", X);
  if (Ii(t)) {
    var f = Y(t.stroke);
    e("stroke", f.color);
    var o = t.strokeNoScale ? i.getLineScale() : 1, h = o ? (t.lineWidth || 0) / o : 0, u = t.strokeOpacity != null ? t.strokeOpacity * f.opacity * n : f.opacity * n, v = t.strokeFirst;
    if ((r || h !== 1) && e("stroke-width", h), (r || v) && e("paint-order", v ? "stroke" : "fill"), (r || u < 1) && e("stroke-opacity", u), t.lineDash) {
      var l = Ve(i), c = l[0], _ = l[1];
      c && (_ = Li(_ || 0), e("stroke-dasharray", c.join(",")), (_ || r) && e("stroke-dashoffset", _));
    } else
      r && e("stroke-dasharray", X);
    for (var d = 0; d < It.length; d++) {
      var p = It[d];
      if (r || t[p] !== zt[p]) {
        var y = t[p] || zt[p];
        y && e(bi[d], y);
      }
    }
  } else
    r && e("stroke", X);
}
var ce = "http://www.w3.org/2000/svg", _e = "http://www.w3.org/1999/xlink", Ti = "http://www.w3.org/2000/xmlns/", Ni = "http://www.w3.org/XML/1998/namespace", Ut = "ecmeta_";
function pe(e) {
  return document.createElementNS(ce, e);
}
function b(e, t, i, r, n) {
  return {
    tag: e,
    attrs: i || {},
    children: r,
    text: n,
    key: t
  };
}
function Ri(e, t) {
  var i = [];
  if (t)
    for (var r in t) {
      var n = t[r], a = r;
      n !== !1 && (n !== !0 && n != null && (a += '="' + n + '"'), i.push(a));
    }
  return "<" + e + " " + i.join(" ") + ">";
}
function Ci(e) {
  return "</" + e + ">";
}
function Nt(e, t) {
  t = t || {};
  var i = t.newline ? `
` : "";
  function r(n) {
    var a = n.children, s = n.tag, f = n.attrs, o = n.text;
    return Ri(s, f) + (s !== "style" ? Ae(o) : o || "") + (a ? "" + i + A(a, function(h) {
      return r(h);
    }).join(i) + i : "") + Ci(s);
  }
  return r(e);
}
function ki(e, t, i) {
  i = i || {};
  var r = i.newline ? `
` : "", n = " {" + r, a = r + "}", s = A(E(e), function(o) {
    return o + n + A(E(e[o]), function(h) {
      return h + ":" + e[o][h] + ";";
    }).join(r) + a;
  }).join(r), f = A(E(t), function(o) {
    return "@keyframes " + o + n + A(E(t[o]), function(h) {
      return h + n + A(E(t[o][h]), function(u) {
        var v = t[o][h][u];
        return u === "d" && (v = 'path("' + v + '")'), u + ":" + v + ";";
      }).join(r) + a;
    }).join(r) + a;
  }).join(r);
  return !s && !f ? "" : ["<![CDATA[", s, f, "]]>"].join(r);
}
function bt(e) {
  return {
    zrId: e,
    shadowCache: {},
    patternCache: {},
    gradientCache: {},
    clipPathCache: {},
    defs: {},
    cssNodes: {},
    cssAnims: {},
    cssStyleCache: {},
    cssAnimIdx: 0,
    shadowIdx: 0,
    gradientIdx: 0,
    patternIdx: 0,
    clipPathIdx: 0
  };
}
function jt(e, t, i, r) {
  return b("svg", "root", {
    width: e,
    height: t,
    xmlns: ce,
    "xmlns:xlink": _e,
    version: "1.1",
    baseProfile: "full",
    viewBox: r ? "0 0 " + e + " " + t : !1
  }, i);
}
var Vi = 0;
function ge() {
  return Vi++;
}
var Zt = {
  cubicIn: "0.32,0,0.67,0",
  cubicOut: "0.33,1,0.68,1",
  cubicInOut: "0.65,0,0.35,1",
  quadraticIn: "0.11,0,0.5,0",
  quadraticOut: "0.5,1,0.89,1",
  quadraticInOut: "0.45,0,0.55,1",
  quarticIn: "0.5,0,0.75,0",
  quarticOut: "0.25,1,0.5,1",
  quarticInOut: "0.76,0,0.24,1",
  quinticIn: "0.64,0,0.78,0",
  quinticOut: "0.22,1,0.36,1",
  quinticInOut: "0.83,0,0.17,1",
  sinusoidalIn: "0.12,0,0.39,0",
  sinusoidalOut: "0.61,1,0.88,1",
  sinusoidalInOut: "0.37,0,0.63,1",
  exponentialIn: "0.7,0,0.84,0",
  exponentialOut: "0.16,1,0.3,1",
  exponentialInOut: "0.87,0,0.13,1",
  circularIn: "0.55,0,1,0.45",
  circularOut: "0,0.55,0.45,1",
  circularInOut: "0.85,0,0.15,1"
}, H = "transform-origin";
function Ai(e, t, i) {
  var r = $({}, e.shape);
  $(r, t), e.buildPath(i, r);
  var n = new de();
  return n.reset(oe(e)), i.rebuildPath(n, 1), n.generateStr(), n.getStr();
}
function Ei(e, t) {
  var i = t.originX, r = t.originY;
  (i || r) && (e[H] = i + "px " + r + "px");
}
var Bi = {
  fill: "fill",
  opacity: "opacity",
  lineWidth: "stroke-width",
  lineDashOffset: "stroke-dashoffset"
};
function ye(e, t) {
  var i = t.zrId + "-ani-" + t.cssAnimIdx++;
  return t.cssAnims[i] = e, i;
}
function Oi(e, t, i) {
  var r = e.shape.paths, n = {}, a, s;
  if (ut(r, function(o) {
    var h = bt(i.zrId);
    h.animation = !0, ct(o, {}, h, !0);
    var u = h.cssAnims, v = h.cssNodes, l = E(u), c = l.length;
    if (c) {
      s = l[c - 1];
      var _ = u[s];
      for (var d in _) {
        var p = _[d];
        n[d] = n[d] || { d: "" }, n[d].d += p.d || "";
      }
      for (var y in v) {
        var g = v[y].animation;
        g.indexOf(s) >= 0 && (a = g);
      }
    }
  }), !!a) {
    t.d = !1;
    var f = ye(n, i);
    return a.replace(s, f);
  }
}
function qt(e) {
  return W(e) ? Zt[e] ? "cubic-bezier(" + Zt[e] + ")" : Be(e) ? e : "" : "";
}
function ct(e, t, i, r) {
  var n = e.animators, a = n.length, s = [];
  if (e instanceof Ee) {
    var f = Oi(e, t, i);
    if (f)
      s.push(f);
    else if (!a)
      return;
  } else if (!a)
    return;
  for (var o = {}, h = 0; h < a; h++) {
    var u = n[h], v = [u.getMaxTime() / 1e3 + "s"], l = qt(u.getClip().easing), c = u.getDelay();
    l ? v.push(l) : v.push("linear"), c && v.push(c / 1e3 + "s"), u.getLoop() && v.push("infinite");
    var _ = v.join(" ");
    o[_] = o[_] || [_, []], o[_][1].push(u);
  }
  function d(g) {
    var m = g[1], x = m.length, R = {}, C = {}, w = {}, I = "animation-timing-function";
    function P(et, it, Mt) {
      for (var rt = et.getTracks(), ke = et.getMaxTime(), pt = 0; pt < rt.length; pt++) {
        var gt = rt[pt];
        if (gt.needsAnimate()) {
          var Dt = gt.keyframes, nt = gt.propName;
          if (Mt && (nt = Mt(nt)), nt)
            for (var yt = 0; yt < Dt.length; yt++) {
              var at = Dt[yt], st = Math.round(at.time / ke * 100) + "%", Ht = qt(at.easing), Gt = at.rawValue;
              (W(Gt) || De(Gt)) && (it[st] = it[st] || {}, it[st][nt] = at.rawValue, Ht && (it[st][I] = Ht));
            }
        }
      }
    }
    for (var L = 0; L < x; L++) {
      var N = m[L], T = N.targetName;
      T ? T === "shape" && P(N, C) : !r && P(N, R);
    }
    for (var S in R) {
      var k = {};
      Oe(k, e), $(k, R[S]);
      var Z = se(k), O = R[S][I];
      w[S] = Z ? {
        transform: Z
      } : {}, Ei(w[S], k), O && (w[S][I] = O);
    }
    var z, At = !0;
    for (var S in C) {
      w[S] = w[S] || {};
      var Et = !z, O = C[S][I];
      Et && (z = new He());
      var Te = z.len();
      z.reset(), w[S].d = Ai(e, C[S], z);
      var Ne = z.len();
      if (!Et && Te !== Ne) {
        At = !1;
        break;
      }
      O && (w[S][I] = O);
    }
    if (!At)
      for (var S in w)
        delete w[S].d;
    if (!r)
      for (var L = 0; L < x; L++) {
        var N = m[L], T = N.targetName;
        T === "style" && P(N, w, function(rt) {
          return Bi[rt];
        });
      }
    for (var tt = E(w), Bt = !0, _t, L = 1; L < tt.length; L++) {
      var Ot = tt[L - 1], Re = tt[L];
      if (w[Ot][H] !== w[Re][H]) {
        Bt = !1;
        break;
      }
      _t = w[Ot][H];
    }
    if (Bt && _t) {
      for (var S in w)
        w[S][H] && delete w[S][H];
      t[H] = _t;
    }
    if (Me(tt, function(et) {
      return E(w[et]).length > 0;
    }).length) {
      var Ce = ye(w, i);
      return Ce + " " + g[0] + " both";
    }
  }
  for (var p in o) {
    var f = d(o[p]);
    f && s.push(f);
  }
  if (s.length) {
    var y = i.zrId + "-cls-" + ge();
    i.cssNodes["." + y] = {
      animation: s.join(",")
    }, t.class = y;
  }
}
function Mi(e, t, i) {
  if (!e.ignore)
    if (e.isSilent()) {
      var r = {
        "pointer-events": "none"
      };
      Kt(r, t, i, !0);
    } else {
      var n = e.states.emphasis && e.states.emphasis.style ? e.states.emphasis.style : {}, a = n.fill;
      if (!a) {
        var s = e.style && e.style.fill, f = e.states.select && e.states.select.style && e.states.select.style.fill, o = e.currentStates.indexOf("select") >= 0 && f || s;
        o && (a = Ge(o));
      }
      var h = n.lineWidth;
      if (h) {
        var u = !n.strokeNoScale && e.transform ? e.transform[0] : 1;
        h = h / u;
      }
      var r = {
        cursor: "pointer"
      };
      a && (r.fill = a), n.stroke && (r.stroke = n.stroke), h && (r["stroke-width"] = h), Kt(r, t, i, !0);
    }
}
function Kt(e, t, i, r) {
  var n = JSON.stringify(e), a = i.cssStyleCache[n];
  a || (a = i.zrId + "-cls-" + ge(), i.cssStyleCache[n] = a, i.cssNodes["." + a + (r ? ":hover" : "")] = e), t.class = t.class ? t.class + " " + a : a;
}
var J = Math.round;
function me(e) {
  return e && W(e.src);
}
function xe(e) {
  return e && Ye(e.toDataURL);
}
function Rt(e, t, i, r) {
  Pi(function(n, a) {
    var s = n === "fill" || n === "stroke";
    s && fe(a) ? Le(t, e, n, r) : s && Tt(a) ? Se(i, e, n, r) : s && a === "none" ? e[n] = "transparent" : e[n] = a;
  }, t, i, !1), ji(i, e, r);
}
function Ct(e, t) {
  var i = ri(t);
  i && (i.each(function(r, n) {
    r != null && (e[(Ut + n).toLowerCase()] = r + "");
  }), t.isSilent() && (e[Ut + "silent"] = "true"));
}
function Xt(e) {
  return B(e[0] - 1) && B(e[1]) && B(e[2]) && B(e[3] - 1);
}
function Di(e) {
  return B(e[4]) && B(e[5]);
}
function kt(e, t, i) {
  if (t && !(Di(t) && Xt(t))) {
    var r = i ? 10 : 1e4;
    e.transform = Xt(t) ? "translate(" + J(t[4] * r) / r + " " + J(t[5] * r) / r + ")" : ni(t);
  }
}
function Yt(e, t, i) {
  for (var r = e.points, n = [], a = 0; a < r.length; a++)
    n.push(J(r[a][0] * i) / i), n.push(J(r[a][1] * i) / i);
  t.points = n.join(" ");
}
function $t(e) {
  return !e.smooth;
}
function Hi(e) {
  var t = A(e, function(i) {
    return typeof i == "string" ? [i, i] : i;
  });
  return function(i, r, n) {
    for (var a = 0; a < t.length; a++) {
      var s = t[a], f = i[s[0]];
      f != null && (r[s[1]] = J(f * n) / n);
    }
  };
}
var Gi = {
  circle: [Hi(["cx", "cy", "r"])],
  polyline: [Yt, $t],
  polygon: [Yt, $t]
};
function zi(e) {
  for (var t = e.animators, i = 0; i < t.length; i++)
    if (t[i].targetName === "shape")
      return !0;
  return !1;
}
function we(e, t) {
  var i = e.style, r = e.shape, n = Gi[e.type], a = {}, s = t.animation, f = "path", o = e.style.strokePercent, h = t.compress && oe(e) || 4;
  if (n && !t.willUpdate && !(n[1] && !n[1](r)) && !(s && zi(e)) && !(o < 1)) {
    f = e.type;
    var u = Math.pow(10, h);
    n[0](r, a, u);
  } else {
    var v = !e.path || e.shapeChanged();
    e.path || e.createPathProxy();
    var l = e.path;
    v && (l.beginPath(), e.buildPath(l, e.shape), e.pathUpdated());
    var c = l.getVersion(), _ = e, d = _.__svgPathBuilder;
    (_.__svgPathVersion !== c || !d || o !== _.__svgPathStrokePercent) && (d || (d = _.__svgPathBuilder = new de()), d.reset(h), l.rebuildPath(d, o), d.generateStr(), _.__svgPathVersion = c, _.__svgPathStrokePercent = o), a.d = d.getStr();
  }
  return kt(a, e.transform), Rt(a, i, e, t), Ct(a, e), t.animation && ct(e, a, t), t.emphasis && Mi(e, a, t), b(f, e.id + "", a);
}
function Fi(e, t) {
  var i = e.style, r = i.image;
  if (r && !W(r) && (me(r) ? r = r.src : xe(r) && (r = r.toDataURL())), !!r) {
    var n = i.x || 0, a = i.y || 0, s = i.width, f = i.height, o = {
      href: r,
      width: s,
      height: f
    };
    return n && (o.x = n), a && (o.y = a), kt(o, e.transform), Rt(o, i, e, t), Ct(o, e), t.animation && ct(e, o, t), b("image", e.id + "", o);
  }
}
function Ui(e, t) {
  var i = e.style, r = i.text;
  if (r != null && (r += ""), !(!r || isNaN(i.x) || isNaN(i.y))) {
    var n = i.font || $e, a = i.x || 0, s = Je(i.y || 0, Qe(n), i.textBaseline), f = We[i.textAlign] || i.textAlign, o = {
      "dominant-baseline": "central",
      "text-anchor": f
    };
    if (ti(i)) {
      var h = "", u = i.fontStyle, v = ei(i.fontSize);
      if (!parseFloat(v))
        return;
      var l = i.fontFamily || ii, c = i.fontWeight;
      h += "font-size:" + v + ";font-family:" + l + ";", u && u !== "normal" && (h += "font-style:" + u + ";"), c && c !== "normal" && (h += "font-weight:" + c + ";"), o.style = h;
    } else
      o.style = "font: " + n;
    return r.match(/\s/) && (o["xml:space"] = "preserve"), a && (o.x = a), s && (o.y = s), kt(o, e.transform), Rt(o, i, e, t), Ct(o, e), t.animation && ct(e, o, t), b("text", e.id + "", o, void 0, r);
  }
}
function Jt(e, t) {
  if (e instanceof ze)
    return we(e, t);
  if (e instanceof ae)
    return Fi(e, t);
  if (e instanceof Fe)
    return Ui(e, t);
}
function ji(e, t, i) {
  var r = e.style;
  if (ai(r)) {
    var n = si(e), a = i.shadowCache, s = a[n];
    if (!s) {
      var f = e.getGlobalScale(), o = f[0], h = f[1];
      if (!o || !h)
        return;
      var u = r.shadowOffsetX || 0, v = r.shadowOffsetY || 0, l = r.shadowBlur, c = Y(r.shadowColor), _ = c.opacity, d = c.color, p = l / 2 / o, y = l / 2 / h, g = p + " " + y;
      s = i.zrId + "-s" + i.shadowIdx++, i.defs[s] = b("filter", s, {
        id: s,
        x: "-100%",
        y: "-100%",
        width: "300%",
        height: "300%"
      }, [
        b("feDropShadow", "", {
          dx: u / o,
          dy: v / h,
          stdDeviation: g,
          "flood-color": d,
          "flood-opacity": _
        })
      ]), a[n] = s;
    }
    t.filter = dt(s);
  }
}
function Le(e, t, i, r) {
  var n = e[i], a, s = {
    gradientUnits: n.global ? "userSpaceOnUse" : "objectBoundingBox"
  };
  if (Ue(n))
    a = "linearGradient", s.x1 = n.x, s.y1 = n.y, s.x2 = n.x2, s.y2 = n.y2;
  else if (je(n))
    a = "radialGradient", s.cx = j(n.x, 0.5), s.cy = j(n.y, 0.5), s.r = j(n.r, 0.5);
  else {
    process.env.NODE_ENV !== "production" && K("Illegal gradient type.");
    return;
  }
  for (var f = n.colorStops, o = [], h = 0, u = f.length; h < u; ++h) {
    var v = Ze(f[h].offset) * 100 + "%", l = f[h].color, c = Y(l), _ = c.color, d = c.opacity, p = {
      offset: v
    };
    p["stop-color"] = _, d < 1 && (p["stop-opacity"] = d), o.push(b("stop", h + "", p));
  }
  var y = b(a, "", s, o), g = Nt(y), m = r.gradientCache, x = m[g];
  x || (x = r.zrId + "-g" + r.gradientIdx++, m[g] = x, s.id = x, r.defs[x] = b(a, x, s, o)), t[i] = dt(x);
}
function Se(e, t, i, r) {
  var n = e.style[i], a = e.getBoundingRect(), s = {}, f = n.repeat, o = f === "no-repeat", h = f === "repeat-x", u = f === "repeat-y", v;
  if (qe(n)) {
    var l = n.imageWidth, c = n.imageHeight, _ = void 0, d = n.image;
    if (W(d) ? _ = d : me(d) ? _ = d.src : xe(d) && (_ = d.toDataURL()), typeof Image > "u") {
      var p = "Image width/height must been given explictly in svg-ssr renderer.";
      Ft(l, p), Ft(c, p);
    } else if (l == null || c == null) {
      var y = function(L, N) {
        if (L) {
          var T = L.elm, S = l || N.width, k = c || N.height;
          L.tag === "pattern" && (h ? (k = 1, S /= a.width) : u && (S = 1, k /= a.height)), L.attrs.width = S, L.attrs.height = k, T && (T.setAttribute("width", S), T.setAttribute("height", k));
        }
      }, g = Ke(_, null, e, function(L) {
        o || y(C, L), y(v, L);
      });
      g && g.width && g.height && (l = l || g.width, c = c || g.height);
    }
    v = b("image", "img", {
      href: _,
      width: l,
      height: c
    }), s.width = l, s.height = c;
  } else
    n.svgElement && (v = Xe(n.svgElement), s.width = n.svgWidth, s.height = n.svgHeight);
  if (v) {
    var m, x;
    o ? m = x = 1 : h ? (x = 1, m = s.width / a.width) : u ? (m = 1, x = s.height / a.height) : s.patternUnits = "userSpaceOnUse", m != null && !isNaN(m) && (s.width = m), x != null && !isNaN(x) && (s.height = x);
    var R = se(n);
    R && (s.patternTransform = R);
    var C = b("pattern", "", s, [v]), w = Nt(C), I = r.patternCache, P = I[w];
    P || (P = r.zrId + "-p" + r.patternIdx++, I[w] = P, s.id = P, C = r.defs[P] = b("pattern", P, s, [v])), t[i] = dt(P);
  }
}
function Zi(e, t, i) {
  var r = i.clipPathCache, n = i.defs, a = r[e.id];
  if (!a) {
    a = i.zrId + "-c" + i.clipPathIdx++;
    var s = {
      id: a
    };
    r[e.id] = a, n[a] = b("clipPath", a, s, [we(e, i)]);
  }
  t["clip-path"] = dt(a);
}
function Qt(e) {
  return document.createTextNode(e);
}
function G(e, t, i) {
  e.insertBefore(t, i);
}
function Wt(e, t) {
  e.removeChild(t);
}
function te(e, t) {
  e.appendChild(t);
}
function Ie(e) {
  return e.parentNode;
}
function be(e) {
  return e.nextSibling;
}
function wt(e, t) {
  e.textContent = t;
}
var ee = 58, qi = 120, Ki = b("", "");
function Pt(e) {
  return e === void 0;
}
function V(e) {
  return e !== void 0;
}
function Xi(e, t, i) {
  for (var r = {}, n = t; n <= i; ++n) {
    var a = e[n].key;
    a !== void 0 && (process.env.NODE_ENV !== "production" && r[a] != null && console.error("Duplicate key " + a), r[a] = n);
  }
  return r;
}
function q(e, t) {
  var i = e.key === t.key, r = e.tag === t.tag;
  return r && i;
}
function Q(e) {
  var t, i = e.children, r = e.tag;
  if (V(r)) {
    var n = e.elm = pe(r);
    if (Vt(Ki, e), oi(i))
      for (t = 0; t < i.length; ++t) {
        var a = i[t];
        a != null && te(n, Q(a));
      }
    else
      V(e.text) && !he(e.text) && te(n, Qt(e.text));
  } else
    e.elm = Qt(e.text);
  return e.elm;
}
function Pe(e, t, i, r, n) {
  for (; r <= n; ++r) {
    var a = i[r];
    a != null && G(e, Q(a), t);
  }
}
function lt(e, t, i, r) {
  for (; i <= r; ++i) {
    var n = t[i];
    if (n != null)
      if (V(n.tag)) {
        var a = Ie(n.elm);
        Wt(a, n.elm);
      } else
        Wt(e, n.elm);
  }
}
function Vt(e, t) {
  var i, r = t.elm, n = e && e.attrs || {}, a = t.attrs || {};
  if (n !== a) {
    for (i in a) {
      var s = a[i], f = n[i];
      f !== s && (s === !0 ? r.setAttribute(i, "") : s === !1 ? r.removeAttribute(i) : i === "style" ? r.style.cssText = s : i.charCodeAt(0) !== qi ? r.setAttribute(i, s) : i === "xmlns:xlink" || i === "xmlns" ? r.setAttributeNS(Ti, i, s) : i.charCodeAt(3) === ee ? r.setAttributeNS(Ni, i, s) : i.charCodeAt(5) === ee ? r.setAttributeNS(_e, i, s) : r.setAttribute(i, s));
    }
    for (i in n)
      i in a || r.removeAttribute(i);
  }
}
function Yi(e, t, i) {
  for (var r = 0, n = 0, a = t.length - 1, s = t[0], f = t[a], o = i.length - 1, h = i[0], u = i[o], v, l, c, _; r <= a && n <= o; )
    s == null ? s = t[++r] : f == null ? f = t[--a] : h == null ? h = i[++n] : u == null ? u = i[--o] : q(s, h) ? (F(s, h), s = t[++r], h = i[++n]) : q(f, u) ? (F(f, u), f = t[--a], u = i[--o]) : q(s, u) ? (F(s, u), G(e, s.elm, be(f.elm)), s = t[++r], u = i[--o]) : q(f, h) ? (F(f, h), G(e, f.elm, s.elm), f = t[--a], h = i[++n]) : (Pt(v) && (v = Xi(t, r, a)), l = v[h.key], Pt(l) ? G(e, Q(h), s.elm) : (c = t[l], c.tag !== h.tag ? G(e, Q(h), s.elm) : (F(c, h), t[l] = void 0, G(e, c.elm, s.elm))), h = i[++n]);
  (r <= a || n <= o) && (r > a ? (_ = i[o + 1] == null ? null : i[o + 1].elm, Pe(e, _, i, n, o)) : lt(e, t, r, a));
}
function F(e, t) {
  var i = t.elm = e.elm, r = e.children, n = t.children;
  e !== t && (Vt(e, t), Pt(t.text) ? V(r) && V(n) ? r !== n && Yi(i, r, n) : V(n) ? (V(e.text) && wt(i, ""), Pe(i, null, n, 0, n.length - 1)) : V(r) ? lt(i, r, 0, r.length - 1) : V(e.text) && wt(i, "") : e.text !== t.text && (V(r) && lt(i, r, 0, r.length - 1), wt(i, t.text)));
}
function $i(e, t) {
  if (q(e, t))
    F(e, t);
  else {
    var i = e.elm, r = Ie(i);
    Q(t), r !== null && (G(r, t.elm, be(i)), lt(r, [e], 0, 0));
  }
  return t;
}
var Ji = 0, Qi = function() {
  function e(t, i, r) {
    if (this.type = "svg", this.refreshHover = ie("refreshHover"), this.configLayer = ie("configLayer"), this.storage = i, this._opts = r = $({}, r), this.root = t, this._id = "zr" + Ji++, this._oldVNode = jt(r.width, r.height), t && !r.ssr) {
      var n = this._viewport = document.createElement("div");
      n.style.cssText = "position:relative;overflow:hidden";
      var a = this._svgDom = this._oldVNode.elm = pe("svg");
      Vt(null, this._oldVNode), n.appendChild(a), t.appendChild(n);
    }
    this.resize(r.width, r.height);
  }
  return e.prototype.getType = function() {
    return this.type;
  }, e.prototype.getViewportRoot = function() {
    return this._viewport;
  }, e.prototype.getViewportRootOffset = function() {
    var t = this.getViewportRoot();
    if (t)
      return {
        offsetLeft: t.offsetLeft || 0,
        offsetTop: t.offsetTop || 0
      };
  }, e.prototype.getSvgDom = function() {
    return this._svgDom;
  }, e.prototype.refresh = function() {
    if (this.root) {
      var t = this.renderToVNode({
        willUpdate: !0
      });
      t.attrs.style = "position:absolute;left:0;top:0;user-select:none", $i(this._oldVNode, t), this._oldVNode = t;
    }
  }, e.prototype.renderOneToVNode = function(t) {
    return Jt(t, bt(this._id));
  }, e.prototype.renderToVNode = function(t) {
    t = t || {};
    var i = this.storage.getDisplayList(!0), r = this._width, n = this._height, a = bt(this._id);
    a.animation = t.animation, a.willUpdate = t.willUpdate, a.compress = t.compress, a.emphasis = t.emphasis;
    var s = [], f = this._bgVNode = Wi(r, n, this._backgroundColor, a);
    f && s.push(f);
    var o = t.compress ? null : this._mainVNode = b("g", "main", {}, []);
    this._paintList(i, a, o ? o.children : s), o && s.push(o);
    var h = A(E(a.defs), function(l) {
      return a.defs[l];
    });
    if (h.length && s.push(b("defs", "defs", {}, h)), t.animation) {
      var u = ki(a.cssNodes, a.cssAnims, { newline: !0 });
      if (u) {
        var v = b("style", "stl", {}, [], u);
        s.push(v);
      }
    }
    return jt(r, n, s, t.useViewBox);
  }, e.prototype.renderToString = function(t) {
    return t = t || {}, Nt(this.renderToVNode({
      animation: j(t.cssAnimation, !0),
      emphasis: j(t.cssEmphasis, !0),
      willUpdate: !1,
      compress: !0,
      useViewBox: j(t.useViewBox, !0)
    }), { newline: !0 });
  }, e.prototype.setBackgroundColor = function(t) {
    this._backgroundColor = t;
  }, e.prototype.getSvgRoot = function() {
    return this._mainVNode && this._mainVNode.elm;
  }, e.prototype._paintList = function(t, i, r) {
    for (var n = t.length, a = [], s = 0, f, o, h = 0, u = 0; u < n; u++) {
      var v = t[u];
      if (!v.invisible) {
        var l = v.__clipPaths, c = l && l.length || 0, _ = o && o.length || 0, d = void 0;
        for (d = Math.max(c - 1, _ - 1); d >= 0 && !(l && o && l[d] === o[d]); d--)
          ;
        for (var p = _ - 1; p > d; p--)
          s--, f = a[s - 1];
        for (var y = d + 1; y < c; y++) {
          var g = {};
          Zi(l[y], g, i);
          var m = b("g", "clip-g-" + h++, g, []);
          (f ? f.children : r).push(m), a[s++] = m, f = m;
        }
        o = l;
        var x = Jt(v, i);
        x && (f ? f.children : r).push(x);
      }
    }
  }, e.prototype.resize = function(t, i) {
    var r = this._opts, n = this.root, a = this._viewport;
    if (t != null && (r.width = t), i != null && (r.height = i), n && a && (a.style.display = "none", t = U(n, 0, r), i = U(n, 1, r), a.style.display = ""), this._width !== t || this._height !== i) {
      if (this._width = t, this._height = i, a) {
        var s = a.style;
        s.width = t + "px", s.height = i + "px";
      }
      if (Tt(this._backgroundColor))
        this.refresh();
      else {
        var f = this._svgDom;
        f && (f.setAttribute("width", t), f.setAttribute("height", i));
        var o = this._bgVNode && this._bgVNode.elm;
        o && (o.setAttribute("width", t), o.setAttribute("height", i));
      }
    }
  }, e.prototype.getWidth = function() {
    return this._width;
  }, e.prototype.getHeight = function() {
    return this._height;
  }, e.prototype.dispose = function() {
    this.root && (this.root.innerHTML = ""), this._svgDom = this._viewport = this.storage = this._oldVNode = this._bgVNode = this._mainVNode = null;
  }, e.prototype.clear = function() {
    this._svgDom && (this._svgDom.innerHTML = null), this._oldVNode = null;
  }, e.prototype.toDataURL = function(t) {
    var i = this.renderToString(), r = "data:image/svg+xml;";
    return t ? (i = fi(i), i && r + "base64," + i) : r + "charset=UTF-8," + encodeURIComponent(i);
  }, e;
}();
function ie(e) {
  return function() {
    process.env.NODE_ENV !== "production" && K('In SVG mode painter not support method "' + e + '"');
  };
}
function Wi(e, t, i, r) {
  var n;
  if (i && i !== "none")
    if (n = b("rect", "bg", {
      width: e,
      height: t,
      x: "0",
      y: "0"
    }), fe(i))
      Le({ fill: i }, n.attrs, "fill", r);
    else if (Tt(i))
      Se({
        style: {
          fill: i
        },
        dirty: hi,
        getBoundingRect: function() {
          return { width: e, height: t };
        }
      }, n.attrs, "fill", r);
    else {
      var a = Y(i), s = a.color, f = a.opacity;
      n.attrs.fill = s, f < 1 && (n.attrs["fill-opacity"] = f);
    }
  return n;
}
const tr = Qi;
function gr(e) {
  e.registerPainter("svg", tr);
}
function re(e, t, i) {
  var r = li.createCanvas(), n = t.getWidth(), a = t.getHeight(), s = r.style;
  return s && (s.position = "absolute", s.left = "0", s.top = "0", s.width = n + "px", s.height = a + "px", r.setAttribute("data-zr-dom-id", e)), r.width = n * i, r.height = a * i, r;
}
var er = function(e) {
  vi(t, e);
  function t(i, r, n) {
    var a = e.call(this) || this;
    a.motionBlur = !1, a.lastFrameAlpha = 0.7, a.dpr = 1, a.virtual = !1, a.config = {}, a.incremental = !1, a.zlevel = 0, a.maxRepaintRectCount = 5, a.__dirty = !0, a.__firstTimePaint = !0, a.__used = !1, a.__drawIndex = 0, a.__startIndex = 0, a.__endIndex = 0, a.__prevStartIndex = null, a.__prevEndIndex = null;
    var s;
    n = n || ue, typeof i == "string" ? s = re(i, r, n) : he(i) && (s = i, i = s.id), a.id = i, a.dom = s;
    var f = s.style;
    return f && (ve(s), s.onselectstart = function() {
      return !1;
    }, f.padding = "0", f.margin = "0", f.borderWidth = "0"), a.painter = r, a.dpr = n, a;
  }
  return t.prototype.getElementCount = function() {
    return this.__endIndex - this.__startIndex;
  }, t.prototype.afterBrush = function() {
    this.__prevStartIndex = this.__startIndex, this.__prevEndIndex = this.__endIndex;
  }, t.prototype.initContext = function() {
    this.ctx = this.dom.getContext("2d"), this.ctx.dpr = this.dpr;
  }, t.prototype.setUnpainted = function() {
    this.__firstTimePaint = !0;
  }, t.prototype.createBackBuffer = function() {
    var i = this.dpr;
    this.domBack = re("back-" + this.id, this.painter, i), this.ctxBack = this.domBack.getContext("2d"), i !== 1 && this.ctxBack.scale(i, i);
  }, t.prototype.createRepaintRects = function(i, r, n, a) {
    if (this.__firstTimePaint)
      return this.__firstTimePaint = !1, null;
    var s = [], f = this.maxRepaintRectCount, o = !1, h = new ot(0, 0, 0, 0);
    function u(g) {
      if (!(!g.isFinite() || g.isZero()))
        if (s.length === 0) {
          var m = new ot(0, 0, 0, 0);
          m.copy(g), s.push(m);
        } else {
          for (var x = !1, R = 1 / 0, C = 0, w = 0; w < s.length; ++w) {
            var I = s[w];
            if (I.intersect(g)) {
              var P = new ot(0, 0, 0, 0);
              P.copy(I), P.union(g), s[w] = P, x = !0;
              break;
            } else if (o) {
              h.copy(g), h.union(I);
              var L = g.width * g.height, N = I.width * I.height, T = h.width * h.height, S = T - L - N;
              S < R && (R = S, C = w);
            }
          }
          if (o && (s[C].union(g), x = !0), !x) {
            var m = new ot(0, 0, 0, 0);
            m.copy(g), s.push(m);
          }
          o || (o = s.length >= f);
        }
    }
    for (var v = this.__startIndex; v < this.__endIndex; ++v) {
      var l = i[v];
      if (l) {
        var c = l.shouldBePainted(n, a, !0, !0), _ = l.__isRendered && (l.__dirty & St || !c) ? l.getPrevPaintRect() : null;
        _ && u(_);
        var d = c && (l.__dirty & St || !l.__isRendered) ? l.getPaintRect() : null;
        d && u(d);
      }
    }
    for (var v = this.__prevStartIndex; v < this.__prevEndIndex; ++v) {
      var l = r[v], c = l && l.shouldBePainted(n, a, !0, !0);
      if (l && (!c || !l.__zr) && l.__isRendered) {
        var _ = l.getPrevPaintRect();
        _ && u(_);
      }
    }
    var p;
    do {
      p = !1;
      for (var v = 0; v < s.length; ) {
        if (s[v].isZero()) {
          s.splice(v, 1);
          continue;
        }
        for (var y = v + 1; y < s.length; )
          s[v].intersect(s[y]) ? (p = !0, s[v].union(s[y]), s.splice(y, 1)) : y++;
        v++;
      }
    } while (p);
    return this._paintRects = s, s;
  }, t.prototype.debugGetPaintRects = function() {
    return (this._paintRects || []).slice();
  }, t.prototype.resize = function(i, r) {
    var n = this.dpr, a = this.dom, s = a.style, f = this.domBack;
    s && (s.width = i + "px", s.height = r + "px"), a.width = i * n, a.height = r * n, f && (f.width = i * n, f.height = r * n, n !== 1 && this.ctxBack.scale(n, n));
  }, t.prototype.clear = function(i, r, n) {
    var a = this.dom, s = this.ctx, f = a.width, o = a.height;
    r = r || this.clearColor;
    var h = this.motionBlur && !i, u = this.lastFrameAlpha, v = this.dpr, l = this;
    h && (this.domBack || this.createBackBuffer(), this.ctxBack.globalCompositeOperation = "copy", this.ctxBack.drawImage(a, 0, 0, f / v, o / v));
    var c = this.domBack;
    function _(d, p, y, g) {
      if (s.clearRect(d, p, y, g), r && r !== "transparent") {
        var m = void 0;
        if (di(r)) {
          var x = r.global || r.__width === y && r.__height === g;
          m = x && r.__canvasGradient || ci(s, r, {
            x: 0,
            y: 0,
            width: y,
            height: g
          }), r.__canvasGradient = m, r.__width = y, r.__height = g;
        } else
          _i(r) && (r.scaleX = r.scaleX || v, r.scaleY = r.scaleY || v, m = pi(s, r, {
            dirty: function() {
              l.setUnpainted(), l.painter.refresh();
            }
          }));
        s.save(), s.fillStyle = m || r, s.fillRect(d, p, y, g), s.restore();
      }
      h && (s.save(), s.globalAlpha = u, s.drawImage(c, d, p, y, g), s.restore());
    }
    !n || h ? _(0, 0, f, o) : n.length && ut(n, function(d) {
      _(d.x * v, d.y * v, d.width * v, d.height * v);
    });
  }, t;
}(ui);
const Lt = er;
var ne = 1e5, D = 314159, vt = 0.01, ir = 1e-3;
function rr(e) {
  return e ? e.__builtin__ ? !0 : !(typeof e.resize != "function" || typeof e.refresh != "function") : !1;
}
function nr(e, t) {
  var i = document.createElement("div");
  return i.style.cssText = [
    "position:relative",
    "width:" + e + "px",
    "height:" + t + "px",
    "padding:0",
    "margin:0",
    "border-width:0"
  ].join(";") + ";", i;
}
var ar = function() {
  function e(t, i, r, n) {
    this.type = "canvas", this._zlevelList = [], this._prevDisplayList = [], this._layers = {}, this._layerConfig = {}, this._needsManuallyCompositing = !1, this.type = "canvas";
    var a = !t.nodeName || t.nodeName.toUpperCase() === "CANVAS";
    this._opts = r = $({}, r || {}), this.dpr = r.devicePixelRatio || ue, this._singleCanvas = a, this.root = t;
    var s = t.style;
    s && (ve(t), t.innerHTML = ""), this.storage = i;
    var f = this._zlevelList;
    this._prevDisplayList = [];
    var o = this._layers;
    if (a) {
      var u = t, v = u.width, l = u.height;
      r.width != null && (v = r.width), r.height != null && (l = r.height), this.dpr = r.devicePixelRatio || 1, u.width = v * this.dpr, u.height = l * this.dpr, this._width = v, this._height = l;
      var c = new Lt(u, this, this.dpr);
      c.__builtin__ = !0, c.initContext(), o[D] = c, c.zlevel = D, f.push(D), this._domRoot = t;
    } else {
      this._width = U(t, 0, r), this._height = U(t, 1, r);
      var h = this._domRoot = nr(this._width, this._height);
      t.appendChild(h);
    }
  }
  return e.prototype.getType = function() {
    return "canvas";
  }, e.prototype.isSingleCanvas = function() {
    return this._singleCanvas;
  }, e.prototype.getViewportRoot = function() {
    return this._domRoot;
  }, e.prototype.getViewportRootOffset = function() {
    var t = this.getViewportRoot();
    if (t)
      return {
        offsetLeft: t.offsetLeft || 0,
        offsetTop: t.offsetTop || 0
      };
  }, e.prototype.refresh = function(t) {
    var i = this.storage.getDisplayList(!0), r = this._prevDisplayList, n = this._zlevelList;
    this._redrawId = Math.random(), this._paintList(i, r, t, this._redrawId);
    for (var a = 0; a < n.length; a++) {
      var s = n[a], f = this._layers[s];
      if (!f.__builtin__ && f.refresh) {
        var o = a === 0 ? this._backgroundColor : null;
        f.refresh(o);
      }
    }
    return this._opts.useDirtyRect && (this._prevDisplayList = i.slice()), this;
  }, e.prototype.refreshHover = function() {
    this._paintHoverList(this.storage.getDisplayList(!1));
  }, e.prototype._paintHoverList = function(t) {
    var i = t.length, r = this._hoverlayer;
    if (r && r.clear(), !!i) {
      for (var n = {
        inHover: !0,
        viewWidth: this._width,
        viewHeight: this._height
      }, a, s = 0; s < i; s++) {
        var f = t[s];
        f.__inHover && (r || (r = this._hoverlayer = this.getLayer(ne)), a || (a = r.ctx, a.save()), ft(a, f, n, s === i - 1));
      }
      a && a.restore();
    }
  }, e.prototype.getHoverLayer = function() {
    return this.getLayer(ne);
  }, e.prototype.paintOne = function(t, i) {
    gi(t, i);
  }, e.prototype._paintList = function(t, i, r, n) {
    if (this._redrawId === n) {
      r = r || !1, this._updateLayerStatus(t);
      var a = this._doPaintList(t, i, r), s = a.finished, f = a.needsRefreshHover;
      if (this._needsManuallyCompositing && this._compositeManually(), f && this._paintHoverList(t), s)
        this.eachLayer(function(h) {
          h.afterBrush && h.afterBrush();
        });
      else {
        var o = this;
        yi(function() {
          o._paintList(t, i, r, n);
        });
      }
    }
  }, e.prototype._compositeManually = function() {
    var t = this.getLayer(D).ctx, i = this._domRoot.width, r = this._domRoot.height;
    t.clearRect(0, 0, i, r), this.eachBuiltinLayer(function(n) {
      n.virtual && t.drawImage(n.dom, 0, 0, i, r);
    });
  }, e.prototype._doPaintList = function(t, i, r) {
    for (var n = this, a = [], s = this._opts.useDirtyRect, f = 0; f < this._zlevelList.length; f++) {
      var o = this._zlevelList[f], h = this._layers[o];
      h.__builtin__ && h !== this._hoverlayer && (h.__dirty || r) && a.push(h);
    }
    for (var u = !0, v = !1, l = function(d) {
      var p = a[d], y = p.ctx, g = s && p.createRepaintRects(t, i, c._width, c._height), m = r ? p.__startIndex : p.__drawIndex, x = !r && p.incremental && Date.now, R = x && Date.now(), C = p.zlevel === c._zlevelList[0] ? c._backgroundColor : null;
      if (p.__startIndex === p.__endIndex)
        p.clear(!1, C, g);
      else if (m === p.__startIndex) {
        var w = t[m];
        (!w.incremental || !w.notClear || r) && p.clear(!1, C, g);
      }
      m === -1 && (console.error("For some unknown reason. drawIndex is -1"), m = p.__startIndex);
      var I, P = function(S) {
        var k = {
          inHover: !1,
          allClipped: !1,
          prevEl: null,
          viewWidth: n._width,
          viewHeight: n._height
        };
        for (I = m; I < p.__endIndex; I++) {
          var Z = t[I];
          if (Z.__inHover && (v = !0), n._doPaintEl(Z, p, s, S, k, I === p.__endIndex - 1), x) {
            var O = Date.now() - R;
            if (O > 15)
              break;
          }
        }
        k.prevElClipPaths && y.restore();
      };
      if (g)
        if (g.length === 0)
          I = p.__endIndex;
        else
          for (var L = c.dpr, N = 0; N < g.length; ++N) {
            var T = g[N];
            y.save(), y.beginPath(), y.rect(T.x * L, T.y * L, T.width * L, T.height * L), y.clip(), P(T), y.restore();
          }
      else
        y.save(), P(), y.restore();
      p.__drawIndex = I, p.__drawIndex < p.__endIndex && (u = !1);
    }, c = this, _ = 0; _ < a.length; _++)
      l(_);
    return mi.wxa && ut(this._layers, function(d) {
      d && d.ctx && d.ctx.draw && d.ctx.draw();
    }), {
      finished: u,
      needsRefreshHover: v
    };
  }, e.prototype._doPaintEl = function(t, i, r, n, a, s) {
    var f = i.ctx;
    if (r) {
      var o = t.getPaintRect();
      (!n || o && o.intersect(n)) && (ft(f, t, a, s), t.setPrevPaintRect(o));
    } else
      ft(f, t, a, s);
  }, e.prototype.getLayer = function(t, i) {
    this._singleCanvas && !this._needsManuallyCompositing && (t = D);
    var r = this._layers[t];
    return r || (r = new Lt("zr_" + t, this, this.dpr), r.zlevel = t, r.__builtin__ = !0, this._layerConfig[t] ? ht(r, this._layerConfig[t], !0) : this._layerConfig[t - vt] && ht(r, this._layerConfig[t - vt], !0), i && (r.virtual = i), this.insertLayer(t, r), r.initContext()), r;
  }, e.prototype.insertLayer = function(t, i) {
    var r = this._layers, n = this._zlevelList, a = n.length, s = this._domRoot, f = null, o = -1;
    if (r[t]) {
      process.env.NODE_ENV !== "production" && K("ZLevel " + t + " has been used already");
      return;
    }
    if (!rr(i)) {
      process.env.NODE_ENV !== "production" && K("Layer of zlevel " + t + " is not valid");
      return;
    }
    if (a > 0 && t > n[0]) {
      for (o = 0; o < a - 1 && !(n[o] < t && n[o + 1] > t); o++)
        ;
      f = r[n[o]];
    }
    if (n.splice(o + 1, 0, t), r[t] = i, !i.virtual)
      if (f) {
        var h = f.dom;
        h.nextSibling ? s.insertBefore(i.dom, h.nextSibling) : s.appendChild(i.dom);
      } else
        s.firstChild ? s.insertBefore(i.dom, s.firstChild) : s.appendChild(i.dom);
    i.painter || (i.painter = this);
  }, e.prototype.eachLayer = function(t, i) {
    for (var r = this._zlevelList, n = 0; n < r.length; n++) {
      var a = r[n];
      t.call(i, this._layers[a], a);
    }
  }, e.prototype.eachBuiltinLayer = function(t, i) {
    for (var r = this._zlevelList, n = 0; n < r.length; n++) {
      var a = r[n], s = this._layers[a];
      s.__builtin__ && t.call(i, s, a);
    }
  }, e.prototype.eachOtherLayer = function(t, i) {
    for (var r = this._zlevelList, n = 0; n < r.length; n++) {
      var a = r[n], s = this._layers[a];
      s.__builtin__ || t.call(i, s, a);
    }
  }, e.prototype.getLayers = function() {
    return this._layers;
  }, e.prototype._updateLayerStatus = function(t) {
    this.eachBuiltinLayer(function(v, l) {
      v.__dirty = v.__used = !1;
    });
    function i(v) {
      a && (a.__endIndex !== v && (a.__dirty = !0), a.__endIndex = v);
    }
    if (this._singleCanvas)
      for (var r = 1; r < t.length; r++) {
        var n = t[r];
        if (n.zlevel !== t[r - 1].zlevel || n.incremental) {
          this._needsManuallyCompositing = !0;
          break;
        }
      }
    var a = null, s = 0, f, o;
    for (o = 0; o < t.length; o++) {
      var n = t[o], h = n.zlevel, u = void 0;
      f !== h && (f = h, s = 0), n.incremental ? (u = this.getLayer(h + ir, this._needsManuallyCompositing), u.incremental = !0, s = 1) : u = this.getLayer(h + (s > 0 ? vt : 0), this._needsManuallyCompositing), u.__builtin__ || K("ZLevel " + h + " has been used by unkown layer " + u.id), u !== a && (u.__used = !0, u.__startIndex !== o && (u.__dirty = !0), u.__startIndex = o, u.incremental ? u.__drawIndex = -1 : u.__drawIndex = o, i(o), a = u), n.__dirty & St && !n.__inHover && (u.__dirty = !0, u.incremental && u.__drawIndex < 0 && (u.__drawIndex = o));
    }
    i(o), this.eachBuiltinLayer(function(v, l) {
      !v.__used && v.getElementCount() > 0 && (v.__dirty = !0, v.__startIndex = v.__endIndex = v.__drawIndex = 0), v.__dirty && v.__drawIndex < 0 && (v.__drawIndex = v.__startIndex);
    });
  }, e.prototype.clear = function() {
    return this.eachBuiltinLayer(this._clearLayer), this;
  }, e.prototype._clearLayer = function(t) {
    t.clear();
  }, e.prototype.setBackgroundColor = function(t) {
    this._backgroundColor = t, ut(this._layers, function(i) {
      i.setUnpainted();
    });
  }, e.prototype.configLayer = function(t, i) {
    if (i) {
      var r = this._layerConfig;
      r[t] ? ht(r[t], i, !0) : r[t] = i;
      for (var n = 0; n < this._zlevelList.length; n++) {
        var a = this._zlevelList[n];
        if (a === t || a === t + vt) {
          var s = this._layers[a];
          ht(s, r[t], !0);
        }
      }
    }
  }, e.prototype.delLayer = function(t) {
    var i = this._layers, r = this._zlevelList, n = i[t];
    n && (n.dom.parentNode.removeChild(n.dom), delete i[t], r.splice(xi(r, t), 1));
  }, e.prototype.resize = function(t, i) {
    if (this._domRoot.style) {
      var r = this._domRoot;
      r.style.display = "none";
      var n = this._opts, a = this.root;
      if (t != null && (n.width = t), i != null && (n.height = i), t = U(a, 0, n), i = U(a, 1, n), r.style.display = "", this._width !== t || i !== this._height) {
        r.style.width = t + "px", r.style.height = i + "px";
        for (var s in this._layers)
          this._layers.hasOwnProperty(s) && this._layers[s].resize(t, i);
        this.refresh(!0);
      }
      this._width = t, this._height = i;
    } else {
      if (t == null || i == null)
        return;
      this._width = t, this._height = i, this.getLayer(D).resize(t, i);
    }
    return this;
  }, e.prototype.clearLayer = function(t) {
    var i = this._layers[t];
    i && i.clear();
  }, e.prototype.dispose = function() {
    this.root.innerHTML = "", this.root = this.storage = this._domRoot = this._layers = null;
  }, e.prototype.getRenderedCanvas = function(t) {
    if (t = t || {}, this._singleCanvas && !this._compositeManually)
      return this._layers[D].dom;
    var i = new Lt("image", this, t.pixelRatio || this.dpr);
    i.initContext(), i.clear(!1, t.backgroundColor || this._backgroundColor);
    var r = i.ctx;
    if (t.pixelRatio <= this.dpr) {
      this.refresh();
      var n = i.dom.width, a = i.dom.height;
      this.eachLayer(function(v) {
        v.__builtin__ ? r.drawImage(v.dom, 0, 0, n, a) : v.renderToCanvas && (r.save(), v.renderToCanvas(r), r.restore());
      });
    } else
      for (var s = {
        inHover: !1,
        viewWidth: this._width,
        viewHeight: this._height
      }, f = this.storage.getDisplayList(!0), o = 0, h = f.length; o < h; o++) {
        var u = f[o];
        ft(r, u, s, o === h - 1);
      }
    return i.dom;
  }, e.prototype.getWidth = function() {
    return this._width;
  }, e.prototype.getHeight = function() {
    return this._height;
  }, e;
}();
const sr = ar;
function yr(e) {
  e.registerPainter("canvas", sr);
}
export {
  yr as CanvasRenderer,
  gr as SVGRenderer
};
//# sourceMappingURL=renderers-aY1ohm69.js.map
